repzo 1.0.169 → 1.0.171
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 +11 -2
- package/lib/index.js +19 -0
- package/lib/types/index.d.ts +151 -20
- package/package.json +1 -1
- package/src/index.ts +46 -0
- package/src/types/index.ts +158 -22
package/lib/index.d.ts
CHANGED
|
@@ -95,10 +95,11 @@ export declare const end_points: {
|
|
|
95
95
|
readonly TIMELINE_TIME_LIST: "timeline-time-list";
|
|
96
96
|
readonly WORKORDER_AGENDA: "workorder-agenda";
|
|
97
97
|
readonly MODULE_CUSTOM_VALIDATOR: "module-custom-validator";
|
|
98
|
+
readonly NOTIFICATIONS_CENTER: "notifications-center";
|
|
98
99
|
};
|
|
99
|
-
export type EndPoints = typeof end_points[keyof typeof end_points];
|
|
100
|
+
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
100
101
|
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"];
|
|
101
|
-
export type AvailableService = typeof availableService[number];
|
|
102
|
+
export type AvailableService = (typeof availableService)[number];
|
|
102
103
|
export default class Repzo {
|
|
103
104
|
private svAPIEndpoint;
|
|
104
105
|
headers: Headers;
|
|
@@ -201,6 +202,7 @@ export default class Repzo {
|
|
|
201
202
|
readonly TIMELINE_TIME_LIST: "timeline-time-list";
|
|
202
203
|
readonly WORKORDER_AGENDA: "workorder-agenda";
|
|
203
204
|
readonly MODULE_CUSTOM_VALIDATOR: "module-custom-validator";
|
|
205
|
+
readonly NOTIFICATIONS_CENTER: "notifications-center";
|
|
204
206
|
};
|
|
205
207
|
private _fetch;
|
|
206
208
|
private _create;
|
|
@@ -960,4 +962,11 @@ export default class Repzo {
|
|
|
960
962
|
update: (id: Service.ModuleCustomValidator.Update.ID, body: Service.ModuleCustomValidator.Update.Body) => Promise<Service.ModuleCustomValidator.Update.Result>;
|
|
961
963
|
remove: (id: Service.ModuleCustomValidator.Remove.ID, params: Service.ModuleCustomValidator.Remove.Params) => Promise<Service.ModuleCustomValidator.Remove.Result>;
|
|
962
964
|
};
|
|
965
|
+
notificationsCenter: {
|
|
966
|
+
_path: "notifications-center";
|
|
967
|
+
find: (params?: Service.NotificationsCenter.Find.Params) => Promise<Service.NotificationsCenter.Find.Result>;
|
|
968
|
+
get: (id: Service.NotificationsCenter.Get.ID, params?: Service.NotificationsCenter.Get.Params) => Promise<Service.NotificationsCenter.Get.Result>;
|
|
969
|
+
create: (body: Service.NotificationsCenter.Create.Body) => Promise<Service.NotificationsCenter.Create.Result>;
|
|
970
|
+
update: (id: Service.NotificationsCenter.Update.ID, body: Service.NotificationsCenter.Update.Body) => Promise<Service.NotificationsCenter.Update.Result>;
|
|
971
|
+
};
|
|
963
972
|
}
|
package/lib/index.js
CHANGED
|
@@ -96,6 +96,7 @@ export const end_points = {
|
|
|
96
96
|
TIMELINE_TIME_LIST: "timeline-time-list",
|
|
97
97
|
WORKORDER_AGENDA: "workorder-agenda",
|
|
98
98
|
MODULE_CUSTOM_VALIDATOR: "module-custom-validator",
|
|
99
|
+
NOTIFICATIONS_CENTER: "notifications-center",
|
|
99
100
|
};
|
|
100
101
|
export const availableService = [
|
|
101
102
|
"client",
|
|
@@ -1965,6 +1966,24 @@ class Repzo {
|
|
|
1965
1966
|
return res;
|
|
1966
1967
|
},
|
|
1967
1968
|
};
|
|
1969
|
+
this.notificationsCenter = {
|
|
1970
|
+
_path: Repzo._end_points.NOTIFICATIONS_CENTER,
|
|
1971
|
+
find: async (params) => {
|
|
1972
|
+
let res = await this._fetch(this.svAPIEndpoint, this.notificationsCenter._path, params);
|
|
1973
|
+
return res;
|
|
1974
|
+
},
|
|
1975
|
+
get: async (id, params) => {
|
|
1976
|
+
return await this._fetch(this.svAPIEndpoint, this.notificationsCenter._path + `/${id}`, params);
|
|
1977
|
+
},
|
|
1978
|
+
create: async (body) => {
|
|
1979
|
+
let res = await this._create(this.svAPIEndpoint, this.notificationsCenter._path, body);
|
|
1980
|
+
return res;
|
|
1981
|
+
},
|
|
1982
|
+
update: async (id, body) => {
|
|
1983
|
+
let res = await this._update(this.svAPIEndpoint, this.notificationsCenter._path + `/${id}`, body);
|
|
1984
|
+
return res;
|
|
1985
|
+
},
|
|
1986
|
+
};
|
|
1968
1987
|
this.svAPIEndpoint =
|
|
1969
1988
|
!options?.env || options?.env == "production"
|
|
1970
1989
|
? "https://sv.api.repzo.me"
|
package/lib/types/index.d.ts
CHANGED
|
@@ -7295,6 +7295,7 @@ export declare namespace Service {
|
|
|
7295
7295
|
sync_id: string;
|
|
7296
7296
|
transaction_processed: boolean;
|
|
7297
7297
|
media?: StringId[];
|
|
7298
|
+
currency?: string;
|
|
7298
7299
|
createdAt: Date;
|
|
7299
7300
|
updatedAt: Date;
|
|
7300
7301
|
}
|
|
@@ -14061,7 +14062,7 @@ export declare namespace Service {
|
|
|
14061
14062
|
}[];
|
|
14062
14063
|
}
|
|
14063
14064
|
export const fieldType_enums: readonly ["Text", "String", "Phone", "Email", "Date", "Number", "List", "Separator", "Heading", "Media", "Signature", "DateTime", "YesNo", "ProductBarcodeScan", "BarcodeScan", "GeoPoint"];
|
|
14064
|
-
export type FormV2FieldType = typeof fieldType_enums[number];
|
|
14065
|
+
export type FormV2FieldType = (typeof fieldType_enums)[number];
|
|
14065
14066
|
interface FieldPrintSettings {
|
|
14066
14067
|
three_inch: {
|
|
14067
14068
|
grid_column?: 1 | 2;
|
|
@@ -14203,7 +14204,7 @@ export declare namespace Service {
|
|
|
14203
14204
|
}
|
|
14204
14205
|
namespace ActivityFormV2Result {
|
|
14205
14206
|
const fieldType_enums: readonly ["Text", "String", "Phone", "Email", "Date", "Number", "List", "Separator", "Heading", "Media", "Signature", "DateTime", "YesNo", "ProductBarcodeScan", "BarcodeScan", "GeoPoint"];
|
|
14206
|
-
type FormV2FieldType = typeof fieldType_enums[number];
|
|
14207
|
+
type FormV2FieldType = (typeof fieldType_enums)[number];
|
|
14207
14208
|
interface FieldResult {
|
|
14208
14209
|
_id?: string;
|
|
14209
14210
|
field_id: string;
|
|
@@ -14478,7 +14479,7 @@ export declare namespace Service {
|
|
|
14478
14479
|
}
|
|
14479
14480
|
namespace TimelineReport {
|
|
14480
14481
|
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"];
|
|
14481
|
-
type ActivityType = typeof activity_types[number];
|
|
14482
|
+
type ActivityType = (typeof activity_types)[number];
|
|
14482
14483
|
export interface Data {
|
|
14483
14484
|
_id: StringId;
|
|
14484
14485
|
company_namespace: string[];
|
|
@@ -14509,7 +14510,7 @@ export declare namespace Service {
|
|
|
14509
14510
|
}
|
|
14510
14511
|
export type VisitDetails = {
|
|
14511
14512
|
activity_type: "visit";
|
|
14512
|
-
activities: (ActivityAuditVisitDetails | ActivityPhotoVisitDetails | ActivityAvailabilityVisitDetails | ActivityNoteVisitDetails | ActivityTaskVisitDetails | ActivityPlanogramVisitDetails | ActivityShelfshareVisitDetails | ActivitySecondaryDisplayVisitDetails | ActivityCheckoutDisplayVisitDetails | ActivityItemStatusVisitDetails | ActivityFormResultVisitDetails | ActivityFormV2ResultVisitDetails | ActivityStorecheckVisitDetails | ActivityFeedbackVisitDetails | ApprovalRequestVisitDetails | AssetPartReceivalVisitDetails | AssetPartTransferVisitDetails | ReturnAssetPartUnitVisitDetails | StoreAssetPartUnitVisitDetails | PaymentVisitDetails | RefundVisitDetails | ConvertProformaVisitDetails |
|
|
14513
|
+
activities: (ActivityAuditVisitDetails | ActivityPhotoVisitDetails | ActivityAvailabilityVisitDetails | ActivityNoteVisitDetails | ActivityTaskVisitDetails | ActivityPlanogramVisitDetails | ActivityShelfshareVisitDetails | ActivitySecondaryDisplayVisitDetails | ActivityCheckoutDisplayVisitDetails | ActivityItemStatusVisitDetails | ActivityFormResultVisitDetails | ActivityFormV2ResultVisitDetails | ActivityStorecheckVisitDetails | ActivityFeedbackVisitDetails | ApprovalRequestVisitDetails | AssetPartReceivalVisitDetails | AssetPartTransferVisitDetails | ReturnAssetPartUnitVisitDetails | StoreAssetPartUnitVisitDetails | PaymentVisitDetails | RefundVisitDetails | ConvertProformaVisitDetails | FullInvoiceVisitDetails | ProformaVisitDetails | ReturnWholeInvoiceVisitDetails | VoidInvoiceVisitDetails)[];
|
|
14513
14514
|
} & Pick<Visit.Data, "closed_by_system" | "geoPoint" | "start_time" | "end_time" | "total_time" | "battery_level" | "version_name" | "device_brand" | "start_out_of_geofence" | "end_out_of_geofence" | "auto_closed_by_geofence" | "auto_closed_by_geofence_reason" | "client_geo_location" | "delta_distance">;
|
|
14514
14515
|
export type ActivityPhotoDetails = {
|
|
14515
14516
|
activity_type: "activity-photo";
|
|
@@ -14720,11 +14721,7 @@ export declare namespace Service {
|
|
|
14720
14721
|
} & Pick<Refund.Data, "amount" | "serial_number" | "currency" | "transaction_type" | "time">;
|
|
14721
14722
|
export type SettlementDetails = {
|
|
14722
14723
|
activity_type: "settlement";
|
|
14723
|
-
} & Pick<Settlement.Data, "amount" | "serial_number" | "paytime" | "origin" | "payment_type">;
|
|
14724
|
-
export type SettlementVisitDetails = {
|
|
14725
|
-
activity_type: "settlement";
|
|
14726
|
-
activity_id: StringId;
|
|
14727
|
-
} & Pick<Settlement.Data, "amount" | "serial_number" | "origin" | "payment_type" | "time">;
|
|
14724
|
+
} & Pick<Settlement.Data, "amount" | "serial_number" | "paytime" | "origin" | "payment_type" | "currency">;
|
|
14728
14725
|
export type ConvertProformaDetails = {
|
|
14729
14726
|
activity_type: "convert-proforma";
|
|
14730
14727
|
proforma_reference: FullInvoice.Data["proforma_reference"];
|
|
@@ -15185,7 +15182,7 @@ export declare namespace Service {
|
|
|
15185
15182
|
}
|
|
15186
15183
|
namespace TimelineTimeList {
|
|
15187
15184
|
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"];
|
|
15188
|
-
type ActivityType = typeof activity_types[number];
|
|
15185
|
+
type ActivityType = (typeof activity_types)[number];
|
|
15189
15186
|
export interface Data {
|
|
15190
15187
|
_id: StringId;
|
|
15191
15188
|
company_namespace: string[];
|
|
@@ -15225,7 +15222,7 @@ export declare namespace Service {
|
|
|
15225
15222
|
}
|
|
15226
15223
|
export type VisitDetails = {
|
|
15227
15224
|
activity_type: "visit";
|
|
15228
|
-
activities: (ActivityAuditVisitDetails | ActivityPhotoVisitDetails | ActivityAvailabilityVisitDetails | ActivityNoteVisitDetails | ActivityTaskVisitDetails | ActivityPlanogramVisitDetails | ActivityShelfshareVisitDetails | ActivitySecondaryDisplayVisitDetails | ActivityCheckoutDisplayVisitDetails | ActivityItemStatusVisitDetails | ActivityFormResultVisitDetails | ActivityFormV2ResultVisitDetails | ActivityStorecheckVisitDetails | ActivityFeedbackVisitDetails | ApprovalRequestVisitDetails | AssetPartReceivalVisitDetails | AssetPartTransferVisitDetails | ReturnAssetPartUnitVisitDetails | StoreAssetPartUnitVisitDetails | PaymentVisitDetails | RefundVisitDetails | ConvertProformaVisitDetails |
|
|
15225
|
+
activities: (ActivityAuditVisitDetails | ActivityPhotoVisitDetails | ActivityAvailabilityVisitDetails | ActivityNoteVisitDetails | ActivityTaskVisitDetails | ActivityPlanogramVisitDetails | ActivityShelfshareVisitDetails | ActivitySecondaryDisplayVisitDetails | ActivityCheckoutDisplayVisitDetails | ActivityItemStatusVisitDetails | ActivityFormResultVisitDetails | ActivityFormV2ResultVisitDetails | ActivityStorecheckVisitDetails | ActivityFeedbackVisitDetails | ApprovalRequestVisitDetails | AssetPartReceivalVisitDetails | AssetPartTransferVisitDetails | ReturnAssetPartUnitVisitDetails | StoreAssetPartUnitVisitDetails | PaymentVisitDetails | RefundVisitDetails | ConvertProformaVisitDetails | FullInvoiceVisitDetails | ProformaVisitDetails | ReturnWholeInvoiceVisitDetails | VoidInvoiceVisitDetails)[];
|
|
15229
15226
|
feed_back_option?: StringId;
|
|
15230
15227
|
feed_back_option_label?: string;
|
|
15231
15228
|
} & Pick<Visit.Data, "closed_by_system" | "geoPoint" | "start_time" | "end_time" | "total_time" | "start_out_of_geofence" | "end_out_of_geofence" | "auto_closed_by_geofence" | "auto_closed_by_geofence_reason" | "client_geo_location" | "delta_distance">;
|
|
@@ -15449,11 +15446,7 @@ export declare namespace Service {
|
|
|
15449
15446
|
} & Pick<Refund.Data, "amount" | "serial_number" | "currency" | "transaction_type" | "time">;
|
|
15450
15447
|
export type SettlementDetails = {
|
|
15451
15448
|
activity_type: "settlement";
|
|
15452
|
-
} & Pick<Settlement.Data, "amount" | "serial_number" | "paytime" | "origin" | "payment_type">;
|
|
15453
|
-
export type SettlementVisitDetails = {
|
|
15454
|
-
activity_type: "settlement";
|
|
15455
|
-
activity_id: StringId;
|
|
15456
|
-
} & Pick<Settlement.Data, "amount" | "serial_number" | "origin" | "payment_type" | "time">;
|
|
15449
|
+
} & Pick<Settlement.Data, "amount" | "serial_number" | "paytime" | "origin" | "payment_type" | "currency">;
|
|
15457
15450
|
export type ConvertProformaDetails = {
|
|
15458
15451
|
activity_type: "convert-proforma";
|
|
15459
15452
|
proforma_reference: FullInvoice.Data["proforma_reference"];
|
|
@@ -15480,7 +15473,8 @@ export declare namespace Service {
|
|
|
15480
15473
|
export type ReceivingMaterialDetails = {
|
|
15481
15474
|
activity_type: "receiving-material";
|
|
15482
15475
|
to_name: string;
|
|
15483
|
-
|
|
15476
|
+
supplier_name?: string;
|
|
15477
|
+
} & Pick<ReceivingMaterial.Data, "serial_number" | "to" | "items_count" | "comment" | "supplier">;
|
|
15484
15478
|
export type FullInvoiceDetails = {
|
|
15485
15479
|
activity_type: "fullinvoices";
|
|
15486
15480
|
} & Pick<FullInvoice.Data, "total" | "serial_number" | "currency" | "issue_date" | "due_date" | "external_serial_number">;
|
|
@@ -15746,7 +15740,7 @@ export declare namespace Service {
|
|
|
15746
15740
|
creator: AdminCreator;
|
|
15747
15741
|
editor?: AdminCreator;
|
|
15748
15742
|
_id?: string;
|
|
15749
|
-
module:
|
|
15743
|
+
module: RepzoModel;
|
|
15750
15744
|
key: string;
|
|
15751
15745
|
origin_type: "system_field" | "custom_field";
|
|
15752
15746
|
disabled: boolean;
|
|
@@ -15773,7 +15767,7 @@ export declare namespace Service {
|
|
|
15773
15767
|
export type Data = ReferenceData | NumberData | TextData;
|
|
15774
15768
|
export interface BasicCreateBody {
|
|
15775
15769
|
creator: AdminCreator;
|
|
15776
|
-
module:
|
|
15770
|
+
module: RepzoModel;
|
|
15777
15771
|
key: string;
|
|
15778
15772
|
origin_type: "system_field" | "custom_field";
|
|
15779
15773
|
scope: "all" | "rep" | "admin";
|
|
@@ -15784,7 +15778,7 @@ export declare namespace Service {
|
|
|
15784
15778
|
export type CreateBody = BasicCreateBody & (ReferenceData | NumberData | TextData);
|
|
15785
15779
|
export interface BasicUpdateBody {
|
|
15786
15780
|
editor?: AdminCreator;
|
|
15787
|
-
module?:
|
|
15781
|
+
module?: RepzoModel;
|
|
15788
15782
|
key?: string;
|
|
15789
15783
|
origin_type?: "system_field" | "custom_field";
|
|
15790
15784
|
scope?: "all" | "rep" | "admin";
|
|
@@ -15829,6 +15823,143 @@ export declare namespace Service {
|
|
|
15829
15823
|
}
|
|
15830
15824
|
export {};
|
|
15831
15825
|
}
|
|
15826
|
+
namespace NotificationsCenter {
|
|
15827
|
+
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";
|
|
15828
|
+
export interface Data {
|
|
15829
|
+
_id: StringId;
|
|
15830
|
+
command: Command;
|
|
15831
|
+
executed?: boolean;
|
|
15832
|
+
listed?: boolean;
|
|
15833
|
+
payload?: {
|
|
15834
|
+
endpoint?: string;
|
|
15835
|
+
message?: {
|
|
15836
|
+
ar?: string;
|
|
15837
|
+
en?: string;
|
|
15838
|
+
};
|
|
15839
|
+
photo?: string;
|
|
15840
|
+
media?: StringId[];
|
|
15841
|
+
type?: string;
|
|
15842
|
+
};
|
|
15843
|
+
read?: boolean;
|
|
15844
|
+
realmId?: StringId;
|
|
15845
|
+
time?: number;
|
|
15846
|
+
toast?: {
|
|
15847
|
+
ar?: string;
|
|
15848
|
+
en?: string;
|
|
15849
|
+
};
|
|
15850
|
+
teams?: StringId[];
|
|
15851
|
+
docs_ids?: StringId[];
|
|
15852
|
+
user?: AdminOrRep;
|
|
15853
|
+
visible?: boolean;
|
|
15854
|
+
meta?: {
|
|
15855
|
+
[key: string]: any;
|
|
15856
|
+
};
|
|
15857
|
+
company_namespace: string[];
|
|
15858
|
+
createdAt: Date;
|
|
15859
|
+
updatedAt: Date;
|
|
15860
|
+
}
|
|
15861
|
+
export type PopulatedDoc = Data & {
|
|
15862
|
+
cycle?: Cycle.Schema & {
|
|
15863
|
+
payload?: Data["payload"] & {
|
|
15864
|
+
media?: PopulatedMediaStorage[];
|
|
15865
|
+
};
|
|
15866
|
+
};
|
|
15867
|
+
};
|
|
15868
|
+
export interface CreateBody {
|
|
15869
|
+
command: Command;
|
|
15870
|
+
executed?: boolean;
|
|
15871
|
+
listed?: boolean;
|
|
15872
|
+
payload?: {
|
|
15873
|
+
endpoint?: string;
|
|
15874
|
+
message?: {
|
|
15875
|
+
ar?: string;
|
|
15876
|
+
en?: string;
|
|
15877
|
+
};
|
|
15878
|
+
photo?: string;
|
|
15879
|
+
media?: StringId[];
|
|
15880
|
+
type?: string;
|
|
15881
|
+
};
|
|
15882
|
+
read?: boolean;
|
|
15883
|
+
realmId?: StringId;
|
|
15884
|
+
time?: number;
|
|
15885
|
+
toast?: {
|
|
15886
|
+
ar?: string;
|
|
15887
|
+
en?: string;
|
|
15888
|
+
};
|
|
15889
|
+
teams?: StringId[];
|
|
15890
|
+
docs_ids?: StringId[];
|
|
15891
|
+
user?: AdminOrRep;
|
|
15892
|
+
visible?: boolean;
|
|
15893
|
+
meta?: {
|
|
15894
|
+
[key: string]: any;
|
|
15895
|
+
};
|
|
15896
|
+
company_namespace?: string[];
|
|
15897
|
+
}
|
|
15898
|
+
export interface UpdateBody {
|
|
15899
|
+
_id?: StringId;
|
|
15900
|
+
command?: Command;
|
|
15901
|
+
executed?: boolean;
|
|
15902
|
+
listed?: boolean;
|
|
15903
|
+
payload?: {
|
|
15904
|
+
endpoint?: string;
|
|
15905
|
+
message?: {
|
|
15906
|
+
ar?: string;
|
|
15907
|
+
en?: string;
|
|
15908
|
+
};
|
|
15909
|
+
photo?: string;
|
|
15910
|
+
media?: StringId[];
|
|
15911
|
+
type?: string;
|
|
15912
|
+
};
|
|
15913
|
+
read?: boolean;
|
|
15914
|
+
realmId?: StringId;
|
|
15915
|
+
time?: number;
|
|
15916
|
+
toast?: {
|
|
15917
|
+
ar?: string;
|
|
15918
|
+
en?: string;
|
|
15919
|
+
};
|
|
15920
|
+
teams?: StringId[];
|
|
15921
|
+
docs_ids?: StringId[];
|
|
15922
|
+
user?: AdminOrRep;
|
|
15923
|
+
visible?: boolean;
|
|
15924
|
+
meta?: {
|
|
15925
|
+
[key: string]: any;
|
|
15926
|
+
};
|
|
15927
|
+
company_namespace?: string[];
|
|
15928
|
+
createdAt?: Date;
|
|
15929
|
+
updatedAt?: Date;
|
|
15930
|
+
}
|
|
15931
|
+
type PopulatedKeys = "media";
|
|
15932
|
+
export namespace Find {
|
|
15933
|
+
type Params = DefaultPaginationQueryParams & {
|
|
15934
|
+
command?: Command | Command[];
|
|
15935
|
+
"user._id"?: StringId | StringId[];
|
|
15936
|
+
executed?: boolean;
|
|
15937
|
+
populatedKeys?: PopulatedKeys[];
|
|
15938
|
+
[key: string]: any;
|
|
15939
|
+
};
|
|
15940
|
+
interface Result extends DefaultPaginationResult {
|
|
15941
|
+
data: Data[] | PopulatedDoc[];
|
|
15942
|
+
}
|
|
15943
|
+
}
|
|
15944
|
+
export namespace Get {
|
|
15945
|
+
type ID = string;
|
|
15946
|
+
type Params = {
|
|
15947
|
+
populatedKeys?: PopulatedKeys[];
|
|
15948
|
+
[key: string]: any;
|
|
15949
|
+
};
|
|
15950
|
+
type Result = Data | PopulatedDoc;
|
|
15951
|
+
}
|
|
15952
|
+
export namespace Create {
|
|
15953
|
+
type Body = CreateBody;
|
|
15954
|
+
type Result = Data;
|
|
15955
|
+
}
|
|
15956
|
+
export namespace Update {
|
|
15957
|
+
type ID = string;
|
|
15958
|
+
type Body = UpdateBody;
|
|
15959
|
+
type Result = Data;
|
|
15960
|
+
}
|
|
15961
|
+
export {};
|
|
15962
|
+
}
|
|
15832
15963
|
}
|
|
15833
15964
|
export type StringId = string;
|
|
15834
15965
|
export type NameSpaces = string[];
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -106,6 +106,7 @@ export const end_points = {
|
|
|
106
106
|
TIMELINE_TIME_LIST: "timeline-time-list",
|
|
107
107
|
WORKORDER_AGENDA: "workorder-agenda",
|
|
108
108
|
MODULE_CUSTOM_VALIDATOR: "module-custom-validator",
|
|
109
|
+
NOTIFICATIONS_CENTER: "notifications-center",
|
|
109
110
|
} as const;
|
|
110
111
|
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
111
112
|
|
|
@@ -5012,6 +5013,51 @@ export default class Repzo {
|
|
|
5012
5013
|
return res;
|
|
5013
5014
|
},
|
|
5014
5015
|
};
|
|
5016
|
+
|
|
5017
|
+
notificationsCenter = {
|
|
5018
|
+
_path: Repzo._end_points.NOTIFICATIONS_CENTER,
|
|
5019
|
+
find: async (
|
|
5020
|
+
params?: Service.NotificationsCenter.Find.Params,
|
|
5021
|
+
): Promise<Service.NotificationsCenter.Find.Result> => {
|
|
5022
|
+
let res: Service.NotificationsCenter.Find.Result = await this._fetch(
|
|
5023
|
+
this.svAPIEndpoint,
|
|
5024
|
+
this.notificationsCenter._path,
|
|
5025
|
+
params,
|
|
5026
|
+
);
|
|
5027
|
+
return res;
|
|
5028
|
+
},
|
|
5029
|
+
get: async (
|
|
5030
|
+
id: Service.NotificationsCenter.Get.ID,
|
|
5031
|
+
params?: Service.NotificationsCenter.Get.Params,
|
|
5032
|
+
): Promise<Service.NotificationsCenter.Get.Result> => {
|
|
5033
|
+
return await this._fetch(
|
|
5034
|
+
this.svAPIEndpoint,
|
|
5035
|
+
this.notificationsCenter._path + `/${id}`,
|
|
5036
|
+
params,
|
|
5037
|
+
);
|
|
5038
|
+
},
|
|
5039
|
+
create: async (
|
|
5040
|
+
body: Service.NotificationsCenter.Create.Body,
|
|
5041
|
+
): Promise<Service.NotificationsCenter.Create.Result> => {
|
|
5042
|
+
let res = await this._create(
|
|
5043
|
+
this.svAPIEndpoint,
|
|
5044
|
+
this.notificationsCenter._path,
|
|
5045
|
+
body,
|
|
5046
|
+
);
|
|
5047
|
+
return res;
|
|
5048
|
+
},
|
|
5049
|
+
update: async (
|
|
5050
|
+
id: Service.NotificationsCenter.Update.ID,
|
|
5051
|
+
body: Service.NotificationsCenter.Update.Body,
|
|
5052
|
+
): Promise<Service.NotificationsCenter.Update.Result> => {
|
|
5053
|
+
let res: Service.NotificationsCenter.Update.Result = await this._update(
|
|
5054
|
+
this.svAPIEndpoint,
|
|
5055
|
+
this.notificationsCenter._path + `/${id}`,
|
|
5056
|
+
body,
|
|
5057
|
+
);
|
|
5058
|
+
return res;
|
|
5059
|
+
},
|
|
5060
|
+
};
|
|
5015
5061
|
}
|
|
5016
5062
|
|
|
5017
5063
|
function normalizeParams(params: Params): { [key: string]: any } {
|
package/src/types/index.ts
CHANGED
|
@@ -7805,6 +7805,7 @@ export namespace Service {
|
|
|
7805
7805
|
sync_id: string;
|
|
7806
7806
|
transaction_processed: boolean;
|
|
7807
7807
|
media?: StringId[];
|
|
7808
|
+
currency?: string;
|
|
7808
7809
|
createdAt: Date;
|
|
7809
7810
|
updatedAt: Date;
|
|
7810
7811
|
}
|
|
@@ -15569,7 +15570,6 @@ export namespace Service {
|
|
|
15569
15570
|
| PaymentVisitDetails
|
|
15570
15571
|
| RefundVisitDetails
|
|
15571
15572
|
| ConvertProformaVisitDetails
|
|
15572
|
-
| SettlementVisitDetails
|
|
15573
15573
|
| FullInvoiceVisitDetails
|
|
15574
15574
|
| ProformaVisitDetails
|
|
15575
15575
|
| ReturnWholeInvoiceVisitDetails
|
|
@@ -15941,14 +15941,12 @@ export namespace Service {
|
|
|
15941
15941
|
// Settlement ********************************************************************
|
|
15942
15942
|
export type SettlementDetails = { activity_type: "settlement" } & Pick<
|
|
15943
15943
|
Settlement.Data,
|
|
15944
|
-
|
|
15945
|
-
|
|
15946
|
-
|
|
15947
|
-
|
|
15948
|
-
|
|
15949
|
-
|
|
15950
|
-
Settlement.Data,
|
|
15951
|
-
"amount" | "serial_number" | "origin" | "payment_type" | "time"
|
|
15944
|
+
| "amount"
|
|
15945
|
+
| "serial_number"
|
|
15946
|
+
| "paytime"
|
|
15947
|
+
| "origin"
|
|
15948
|
+
| "payment_type"
|
|
15949
|
+
| "currency"
|
|
15952
15950
|
>;
|
|
15953
15951
|
|
|
15954
15952
|
// ConvertProforma ********************************************************************
|
|
@@ -16967,7 +16965,6 @@ export namespace Service {
|
|
|
16967
16965
|
| PaymentVisitDetails
|
|
16968
16966
|
| RefundVisitDetails
|
|
16969
16967
|
| ConvertProformaVisitDetails
|
|
16970
|
-
| SettlementVisitDetails
|
|
16971
16968
|
| FullInvoiceVisitDetails
|
|
16972
16969
|
| ProformaVisitDetails
|
|
16973
16970
|
| ReturnWholeInvoiceVisitDetails
|
|
@@ -17356,14 +17353,12 @@ export namespace Service {
|
|
|
17356
17353
|
// Settlement ********************************************************************
|
|
17357
17354
|
export type SettlementDetails = { activity_type: "settlement" } & Pick<
|
|
17358
17355
|
Settlement.Data,
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
|
|
17362
|
-
|
|
17363
|
-
|
|
17364
|
-
|
|
17365
|
-
Settlement.Data,
|
|
17366
|
-
"amount" | "serial_number" | "origin" | "payment_type" | "time"
|
|
17356
|
+
| "amount"
|
|
17357
|
+
| "serial_number"
|
|
17358
|
+
| "paytime"
|
|
17359
|
+
| "origin"
|
|
17360
|
+
| "payment_type"
|
|
17361
|
+
| "currency"
|
|
17367
17362
|
>;
|
|
17368
17363
|
|
|
17369
17364
|
// ConvertProforma ********************************************************************
|
|
@@ -17400,9 +17395,10 @@ export namespace Service {
|
|
|
17400
17395
|
export type ReceivingMaterialDetails = {
|
|
17401
17396
|
activity_type: "receiving-material";
|
|
17402
17397
|
to_name: string;
|
|
17398
|
+
supplier_name?: string;
|
|
17403
17399
|
} & Pick<
|
|
17404
17400
|
ReceivingMaterial.Data,
|
|
17405
|
-
"serial_number" | "to" | "items_count" | "comment"
|
|
17401
|
+
"serial_number" | "to" | "items_count" | "comment" | "supplier"
|
|
17406
17402
|
>;
|
|
17407
17403
|
|
|
17408
17404
|
// FullInvoice ********************************************************************
|
|
@@ -17764,7 +17760,7 @@ export namespace Service {
|
|
|
17764
17760
|
creator: AdminCreator;
|
|
17765
17761
|
editor?: AdminCreator;
|
|
17766
17762
|
_id?: string;
|
|
17767
|
-
module:
|
|
17763
|
+
module: RepzoModel;
|
|
17768
17764
|
key: string;
|
|
17769
17765
|
origin_type: "system_field" | "custom_field";
|
|
17770
17766
|
disabled: boolean;
|
|
@@ -17794,7 +17790,7 @@ export namespace Service {
|
|
|
17794
17790
|
|
|
17795
17791
|
export interface BasicCreateBody {
|
|
17796
17792
|
creator: AdminCreator;
|
|
17797
|
-
module:
|
|
17793
|
+
module: RepzoModel;
|
|
17798
17794
|
key: string;
|
|
17799
17795
|
origin_type: "system_field" | "custom_field";
|
|
17800
17796
|
scope: "all" | "rep" | "admin";
|
|
@@ -17808,7 +17804,7 @@ export namespace Service {
|
|
|
17808
17804
|
|
|
17809
17805
|
export interface BasicUpdateBody {
|
|
17810
17806
|
editor?: AdminCreator;
|
|
17811
|
-
module?:
|
|
17807
|
+
module?: RepzoModel;
|
|
17812
17808
|
key?: string;
|
|
17813
17809
|
origin_type?: "system_field" | "custom_field";
|
|
17814
17810
|
scope?: "all" | "rep" | "admin";
|
|
@@ -17856,6 +17852,146 @@ export namespace Service {
|
|
|
17856
17852
|
export type Result = Data;
|
|
17857
17853
|
}
|
|
17858
17854
|
}
|
|
17855
|
+
|
|
17856
|
+
export namespace NotificationsCenter {
|
|
17857
|
+
export type Command =
|
|
17858
|
+
| "update-categories"
|
|
17859
|
+
| "update-clients"
|
|
17860
|
+
| "bulk-update-clients"
|
|
17861
|
+
| "update-inventory"
|
|
17862
|
+
| "update-measureunitFamilies"
|
|
17863
|
+
| "update-measureunits"
|
|
17864
|
+
| "update-pricelistItems"
|
|
17865
|
+
| "update-pricelists"
|
|
17866
|
+
| "update-products"
|
|
17867
|
+
| "update-rep"
|
|
17868
|
+
| "update-salesmsl"
|
|
17869
|
+
| "update-settings"
|
|
17870
|
+
| "update-tags"
|
|
17871
|
+
| "update-taxes"
|
|
17872
|
+
| "update-transfer"
|
|
17873
|
+
| "update-warehouses"
|
|
17874
|
+
| "update-jobCategories"
|
|
17875
|
+
| "update-plans"
|
|
17876
|
+
| "update-workorders"
|
|
17877
|
+
| "update-commentsThread"
|
|
17878
|
+
| "update-approval-request"
|
|
17879
|
+
| "update-variant-batch"
|
|
17880
|
+
| "update-asset-part-type"
|
|
17881
|
+
| "update-asset-part"
|
|
17882
|
+
| "update-asset-part-unit"
|
|
17883
|
+
| "update-custom-status"
|
|
17884
|
+
| "update-module-custom-validator";
|
|
17885
|
+
export interface Data {
|
|
17886
|
+
_id: StringId;
|
|
17887
|
+
command: Command;
|
|
17888
|
+
executed?: boolean;
|
|
17889
|
+
listed?: boolean;
|
|
17890
|
+
payload?: {
|
|
17891
|
+
endpoint?: string;
|
|
17892
|
+
message?: { ar?: string; en?: string };
|
|
17893
|
+
photo?: string;
|
|
17894
|
+
media?: StringId[];
|
|
17895
|
+
type?: string;
|
|
17896
|
+
};
|
|
17897
|
+
read?: boolean;
|
|
17898
|
+
realmId?: StringId;
|
|
17899
|
+
time?: number;
|
|
17900
|
+
toast?: { ar?: string; en?: string };
|
|
17901
|
+
teams?: StringId[];
|
|
17902
|
+
docs_ids?: StringId[];
|
|
17903
|
+
user?: AdminOrRep;
|
|
17904
|
+
visible?: boolean;
|
|
17905
|
+
meta?: { [key: string]: any };
|
|
17906
|
+
company_namespace: string[];
|
|
17907
|
+
createdAt: Date;
|
|
17908
|
+
updatedAt: Date;
|
|
17909
|
+
}
|
|
17910
|
+
export type PopulatedDoc = Data & {
|
|
17911
|
+
cycle?: Cycle.Schema & {
|
|
17912
|
+
payload?: Data["payload"] & { media?: PopulatedMediaStorage[] };
|
|
17913
|
+
};
|
|
17914
|
+
};
|
|
17915
|
+
export interface CreateBody {
|
|
17916
|
+
command: Command;
|
|
17917
|
+
executed?: boolean;
|
|
17918
|
+
listed?: boolean;
|
|
17919
|
+
payload?: {
|
|
17920
|
+
endpoint?: string;
|
|
17921
|
+
message?: { ar?: string; en?: string };
|
|
17922
|
+
photo?: string;
|
|
17923
|
+
media?: StringId[];
|
|
17924
|
+
type?: string;
|
|
17925
|
+
};
|
|
17926
|
+
read?: boolean;
|
|
17927
|
+
realmId?: StringId;
|
|
17928
|
+
time?: number;
|
|
17929
|
+
toast?: { ar?: string; en?: string };
|
|
17930
|
+
teams?: StringId[];
|
|
17931
|
+
docs_ids?: StringId[];
|
|
17932
|
+
user?: AdminOrRep;
|
|
17933
|
+
visible?: boolean;
|
|
17934
|
+
meta?: { [key: string]: any };
|
|
17935
|
+
company_namespace?: string[];
|
|
17936
|
+
}
|
|
17937
|
+
export interface UpdateBody {
|
|
17938
|
+
_id?: StringId;
|
|
17939
|
+
command?: Command;
|
|
17940
|
+
executed?: boolean;
|
|
17941
|
+
listed?: boolean;
|
|
17942
|
+
payload?: {
|
|
17943
|
+
endpoint?: string;
|
|
17944
|
+
message?: { ar?: string; en?: string };
|
|
17945
|
+
photo?: string;
|
|
17946
|
+
media?: StringId[];
|
|
17947
|
+
type?: string;
|
|
17948
|
+
};
|
|
17949
|
+
read?: boolean;
|
|
17950
|
+
realmId?: StringId;
|
|
17951
|
+
time?: number;
|
|
17952
|
+
toast?: { ar?: string; en?: string };
|
|
17953
|
+
teams?: StringId[];
|
|
17954
|
+
docs_ids?: StringId[];
|
|
17955
|
+
user?: AdminOrRep;
|
|
17956
|
+
visible?: boolean;
|
|
17957
|
+
meta?: { [key: string]: any };
|
|
17958
|
+
company_namespace?: string[];
|
|
17959
|
+
createdAt?: Date;
|
|
17960
|
+
updatedAt?: Date;
|
|
17961
|
+
}
|
|
17962
|
+
|
|
17963
|
+
type PopulatedKeys = "media";
|
|
17964
|
+
|
|
17965
|
+
export namespace Find {
|
|
17966
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
17967
|
+
command?: Command | Command[];
|
|
17968
|
+
"user._id"?: StringId | StringId[];
|
|
17969
|
+
executed?: boolean;
|
|
17970
|
+
populatedKeys?: PopulatedKeys[];
|
|
17971
|
+
[key: string]: any; // integration_meta.
|
|
17972
|
+
};
|
|
17973
|
+
export interface Result extends DefaultPaginationResult {
|
|
17974
|
+
data: Data[] | PopulatedDoc[];
|
|
17975
|
+
}
|
|
17976
|
+
}
|
|
17977
|
+
export namespace Get {
|
|
17978
|
+
export type ID = string;
|
|
17979
|
+
export type Params = {
|
|
17980
|
+
populatedKeys?: PopulatedKeys[];
|
|
17981
|
+
[key: string]: any;
|
|
17982
|
+
};
|
|
17983
|
+
export type Result = Data | PopulatedDoc;
|
|
17984
|
+
}
|
|
17985
|
+
export namespace Create {
|
|
17986
|
+
export type Body = CreateBody;
|
|
17987
|
+
export type Result = Data;
|
|
17988
|
+
}
|
|
17989
|
+
export namespace Update {
|
|
17990
|
+
export type ID = string;
|
|
17991
|
+
export type Body = UpdateBody;
|
|
17992
|
+
export type Result = Data;
|
|
17993
|
+
}
|
|
17994
|
+
}
|
|
17859
17995
|
}
|
|
17860
17996
|
|
|
17861
17997
|
export type StringId = string;
|