repzo 1.0.170 → 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 +9 -0
- package/lib/index.js +19 -0
- package/lib/types/index.d.ts +137 -0
- package/package.json +1 -1
- package/src/index.ts +46 -0
- package/src/types/index.ts +140 -0
package/lib/index.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ 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
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"];
|
|
@@ -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
|
@@ -15823,6 +15823,143 @@ export declare namespace Service {
|
|
|
15823
15823
|
}
|
|
15824
15824
|
export {};
|
|
15825
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
|
+
}
|
|
15826
15963
|
}
|
|
15827
15964
|
export type StringId = string;
|
|
15828
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
|
@@ -17852,6 +17852,146 @@ export namespace Service {
|
|
|
17852
17852
|
export type Result = Data;
|
|
17853
17853
|
}
|
|
17854
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
|
+
}
|
|
17855
17995
|
}
|
|
17856
17996
|
|
|
17857
17997
|
export type StringId = string;
|