@optimiser/common 1.0.364 → 1.0.366
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/dist/aws/awsservices.d.ts +39 -39
- package/dist/aws/awsservices.js +398 -398
- package/dist/constants.d.ts +35 -35
- package/dist/constants.js +36 -36
- package/dist/enums/databasetype.enum.d.ts +7 -7
- package/dist/enums/databasetype.enum.js +11 -11
- package/dist/enums/log.enum.d.ts +22 -22
- package/dist/enums/log.enum.js +26 -26
- package/dist/index.d.ts +25 -25
- package/dist/index.js +69 -61
- package/dist/lib/activity.d.ts +1 -1
- package/dist/lib/activity.js +44 -44
- package/dist/lib/calculatedbsize.d.ts +15 -15
- package/dist/lib/calculatedbsize.js +75 -75
- package/dist/lib/connection.d.ts +116 -116
- package/dist/lib/connection.js +595 -595
- package/dist/lib/convertfilesize.d.ts +2 -2
- package/dist/lib/convertfilesize.js +15 -15
- package/dist/lib/countrycode.d.ts +2 -2
- package/dist/lib/countrycode.js +255 -255
- package/dist/lib/event.d.ts +26 -26
- package/dist/lib/event.js +252 -248
- package/dist/lib/helper.d.ts +93 -93
- package/dist/lib/helper.js +1010 -1009
- package/dist/lib/memoryserverclient.d.ts +40 -40
- package/dist/lib/memoryserverclient.js +256 -252
- package/dist/lib/operautilitycommon.d.ts +65 -65
- package/dist/lib/operautilitycommon.js +620 -620
- package/dist/lib/redis.d.ts +21 -21
- package/dist/lib/redis.js +46 -46
- package/dist/lib/socketidfromredis.d.ts +3 -3
- package/dist/lib/socketidfromredis.js +5 -5
- package/dist/lib/taskutils.d.ts +40 -40
- package/dist/lib/taskutils.js +656 -656
- package/dist/lib/utility.d.ts +300 -292
- package/dist/lib/utility.js +5626 -5615
- package/dist/lib/validateRequest.d.ts +3 -3
- package/dist/lib/validateRequest.js +13 -13
- package/dist/logs/auditlog.d.ts +25 -25
- package/dist/logs/auditlog.js +1033 -1029
- package/dist/logs/checklogtable.d.ts +3 -3
- package/dist/logs/checklogtable.js +67 -67
- package/dist/logs/log.table.d.ts +7 -7
- package/dist/logs/log.table.js +127 -127
- package/dist/modals/connection.modal.d.ts +32 -32
- package/dist/modals/connection.modal.js +2 -2
- package/dist/modals/globalNotification.modal.d.ts +8 -8
- package/dist/modals/globalNotification.modal.js +2 -2
- package/dist/modals/log.modal.d.ts +64 -64
- package/dist/modals/log.modal.js +2 -2
- package/dist/modals/mail.modal.d.ts +6 -6
- package/dist/modals/mail.modal.js +2 -2
- package/dist/modals/notificationData.modal.d.ts +29 -29
- package/dist/modals/notificationData.modal.js +2 -2
- package/dist/modals/redisconfig.modal.d.ts +6 -6
- package/dist/modals/redisconfig.modal.js +2 -2
- package/dist/modals/sqsconfig.modal.d.ts +8 -8
- package/dist/modals/sqsconfig.modal.js +2 -2
- package/dist/modals/utility.modal.d.ts +17 -17
- package/dist/modals/utility.modal.js +2 -2
- package/dist/utility/crypto.d.ts +4 -4
- package/dist/utility/crypto.js +43 -43
- package/dist/utility/errorHandler.d.ts +30 -30
- package/dist/utility/errorHandler.js +24 -24
- package/dist/utility/errorHandlerForServices.d.ts +22 -22
- package/dist/utility/errorHandlerForServices.js +19 -19
- package/dist/utility/mail.d.ts +21 -21
- package/dist/utility/mail.js +91 -87
- package/package.json +3 -3
package/dist/lib/utility.d.ts
CHANGED
|
@@ -1,292 +1,300 @@
|
|
|
1
|
-
import { Moment } from "moment";
|
|
2
|
-
import { NextFunction, Response } from "express";
|
|
3
|
-
import { ObjectId, Db } from "mongodb";
|
|
4
|
-
import { ResponseStructure, OPT_ERROR } from "../modals/connection.modal";
|
|
5
|
-
import { Express } from '../modals/log.modal';
|
|
6
|
-
import { AnyObjectInterface, callBackInterface, GetEncryptedURLOptions } from "../modals/utility.modal";
|
|
7
|
-
import { OPT_Request } from "../modals/connection.modal";
|
|
8
|
-
import { Redis } from "ioredis";
|
|
9
|
-
import 'moment-timezone';
|
|
10
|
-
import { integer } from "aws-sdk/clients/cloudfront";
|
|
11
|
-
declare function GetObjectByKeyValueFromList(list: AnyObjectInterface, key: string, val: any): any;
|
|
12
|
-
declare function IsEqualArrays(a: [any] | [], b: [any] | []): boolean;
|
|
13
|
-
declare function IsEqualValue(a: any, b: any): boolean;
|
|
14
|
-
declare function AddDaysToDate(date: any, days: integer): Date;
|
|
15
|
-
declare function CheckUserProfileField(pageData: AnyObjectInterface, profileData: AnyObjectInterface): void;
|
|
16
|
-
declare function GetPageFieldData(pageName: string, db: any, mdb: any, msp_d: any, next: NextFunction, callback: callBackInterface): void;
|
|
17
|
-
declare function GetPageObjectSchema(pageName: string, db: Db, next: NextFunction, callback: callBackInterface): void;
|
|
18
|
-
declare function GetFieldDetail(objectName: string, fieldName: string, db: any, callback: callBackInterface, next: NextFunction): void;
|
|
19
|
-
declare function UpdateRecentViewObject(objectName: string, objectID: ObjectId, userID: ObjectId, db: Db): void;
|
|
20
|
-
declare function UpdateRecentViewFields(objectName: string, fieldID: string, userID: ObjectId, db: Db): void;
|
|
21
|
-
declare function SyncChildObjectData(pageData: AnyObjectInterface, objectID: ObjectId, db: Db): Promise<void>;
|
|
22
|
-
declare function SyncParentObjectData(pageData: AnyObjectInterface, objectID: ObjectId, db: Db): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Delete field in other collection after delete records
|
|
25
|
-
* @param
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
declare function
|
|
37
|
-
declare function
|
|
38
|
-
declare function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
declare function
|
|
43
|
-
declare function
|
|
44
|
-
declare function
|
|
45
|
-
declare function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
declare function
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
declare function
|
|
69
|
-
declare function
|
|
70
|
-
declare function
|
|
71
|
-
declare function
|
|
72
|
-
declare function
|
|
73
|
-
declare function
|
|
74
|
-
declare function
|
|
75
|
-
declare function
|
|
76
|
-
declare function
|
|
77
|
-
declare function
|
|
78
|
-
declare function
|
|
79
|
-
declare function
|
|
80
|
-
declare function
|
|
81
|
-
declare function
|
|
82
|
-
declare function
|
|
83
|
-
declare function
|
|
84
|
-
declare function
|
|
85
|
-
declare function
|
|
86
|
-
declare function
|
|
87
|
-
declare function
|
|
88
|
-
declare function
|
|
89
|
-
declare function
|
|
90
|
-
declare function
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
* @param
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
117
|
-
* @param
|
|
118
|
-
* @
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
* @param
|
|
123
|
-
* @
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
* @
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
*
|
|
134
|
-
* @
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
*
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
* @
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
declare function
|
|
192
|
-
declare function
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* @param {object} record
|
|
219
|
-
* @param {string}
|
|
220
|
-
* @
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
* @param {
|
|
230
|
-
* @param {
|
|
231
|
-
* @
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
* @param {object}
|
|
240
|
-
* @param
|
|
241
|
-
* @
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
*
|
|
248
|
-
* @param
|
|
249
|
-
* @
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
*
|
|
256
|
-
* @
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
*
|
|
262
|
-
* @param
|
|
263
|
-
* @
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* @param
|
|
271
|
-
* @
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* @param
|
|
280
|
-
* @
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
declare function
|
|
284
|
-
/**
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
* @
|
|
288
|
-
* @
|
|
289
|
-
* @return
|
|
290
|
-
*/
|
|
291
|
-
declare function
|
|
292
|
-
|
|
1
|
+
import { Moment } from "moment";
|
|
2
|
+
import { NextFunction, Response } from "express";
|
|
3
|
+
import { ObjectId, Db } from "mongodb";
|
|
4
|
+
import { ResponseStructure, OPT_ERROR } from "../modals/connection.modal";
|
|
5
|
+
import { Express } from '../modals/log.modal';
|
|
6
|
+
import { AnyObjectInterface, callBackInterface, GetEncryptedURLOptions } from "../modals/utility.modal";
|
|
7
|
+
import { OPT_Request } from "../modals/connection.modal";
|
|
8
|
+
import { Redis } from "ioredis";
|
|
9
|
+
import 'moment-timezone';
|
|
10
|
+
import { integer } from "aws-sdk/clients/cloudfront";
|
|
11
|
+
declare function GetObjectByKeyValueFromList(list: AnyObjectInterface, key: string, val: any): any;
|
|
12
|
+
declare function IsEqualArrays(a: [any] | [], b: [any] | []): boolean;
|
|
13
|
+
declare function IsEqualValue(a: any, b: any): boolean;
|
|
14
|
+
declare function AddDaysToDate(date: any, days: integer): Date;
|
|
15
|
+
declare function CheckUserProfileField(pageData: AnyObjectInterface, profileData: AnyObjectInterface): void;
|
|
16
|
+
declare function GetPageFieldData(pageName: string, db: any, mdb: any, msp_d: any, next: NextFunction, callback: callBackInterface): void;
|
|
17
|
+
declare function GetPageObjectSchema(pageName: string, db: Db, next: NextFunction, callback: callBackInterface): void;
|
|
18
|
+
declare function GetFieldDetail(objectName: string, fieldName: string, db: any, callback: callBackInterface, next: NextFunction): void;
|
|
19
|
+
declare function UpdateRecentViewObject(objectName: string, objectID: ObjectId, userID: ObjectId, db: Db): void;
|
|
20
|
+
declare function UpdateRecentViewFields(objectName: string, fieldID: string, userID: ObjectId, db: Db): void;
|
|
21
|
+
declare function SyncChildObjectData(pageData: AnyObjectInterface, objectID: ObjectId, db: Db): Promise<void>;
|
|
22
|
+
declare function SyncParentObjectData(pageData: AnyObjectInterface, objectID: ObjectId, db: Db): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Delete field in other collection after delete records
|
|
25
|
+
* @param objectName : ObjectName of record to which we want to delete
|
|
26
|
+
* @param objectIDs : ObjectId of the created records of above object name collection
|
|
27
|
+
* @param db : database connection || Db
|
|
28
|
+
* @param params : It includes the object of remaining arguments passing here as an argument
|
|
29
|
+
* @param params.isBuiltOnPromise : optional param need to send with params obj for to confirm function is used with promise or not!!
|
|
30
|
+
* @param params.mongoQueryOpts :optional param sending with params obj for some specific mongodb query operation, to maintain session for transactions
|
|
31
|
+
* @param comMasterDb : optional param sending to get it update and sync with master db.
|
|
32
|
+
*/
|
|
33
|
+
declare function DeleteFieldInOtherCollection(objectName: string, objectIDs: ObjectId, db: Db, params?: AnyObjectInterface, comMasterDb?: Db): Promise<void>;
|
|
34
|
+
declare function ReactivateFieldInOtherCollection(objectName: string, objectIDs: ObjectId, db: Db): void;
|
|
35
|
+
declare function SyncFieldInSameCollection(objectName: string, objectIDs: ObjectId[], db: Db, comMasterDb?: Db): Promise<any>;
|
|
36
|
+
declare function SyncFieldInSameCollectionByObjectID(objectName: string, objectID: ObjectId, db: Db): void;
|
|
37
|
+
declare function SyncFieldInSameCollectionByObjectIDWithPromise(objectName: string, objectID: ObjectId, db: Db): Promise<any>;
|
|
38
|
+
declare function SyncFieldInOtherCollection(syncFields: AnyObjectInterface[], db: Db): Promise<any>;
|
|
39
|
+
/** Special Note: Need to create seachValue for it in QPC-6169.
|
|
40
|
+
I've not done yet, cause it was not calling from anywhere.
|
|
41
|
+
*/
|
|
42
|
+
declare function SyncUserInOtherCollection(options: AnyObjectInterface, db: Db, callback: callBackInterface, next: NextFunction): void;
|
|
43
|
+
declare function GetObjectByString(o: any, s: any): any;
|
|
44
|
+
declare function BuildLookupDataField(fieldSchema: AnyObjectInterface, updateObj: AnyObjectInterface, db: Db): Promise<void>;
|
|
45
|
+
declare function CheckDataBeforeAdd(updateObj: AnyObjectInterface, objectSchema: AnyObjectInterface, db: Db): Promise<void>;
|
|
46
|
+
declare function CheckDataBeforeUpdate(updateObj: AnyObjectInterface, objectData: AnyObjectInterface, objectSchema: AnyObjectInterface, db: Db): Promise<void>;
|
|
47
|
+
declare function BuildGridFieldProjection(project: AnyObjectInterface, field: AnyObjectInterface, group?: AnyObjectInterface): void;
|
|
48
|
+
declare function BuildFieldProjection(project: AnyObjectInterface, field: AnyObjectInterface, group: AnyObjectInterface): void;
|
|
49
|
+
declare function BuildLookupFieldProjection(field: AnyObjectInterface, group: AnyObjectInterface, project: AnyObjectInterface, aggregateArry: AnyObjectInterface[]): void;
|
|
50
|
+
declare function FilterConditions(condition: AnyObjectInterface, match: AnyObjectInterface, fields: AnyObjectInterface): void;
|
|
51
|
+
declare function GirdHeaderFilters(filters: AnyObjectInterface, fields: AnyObjectInterface): {
|
|
52
|
+
$and: AnyObjectInterface[];
|
|
53
|
+
} | undefined;
|
|
54
|
+
declare function FieldsGridHeaderFilters(filters: AnyObjectInterface, fields: AnyObjectInterface): {
|
|
55
|
+
$and: AnyObjectInterface[];
|
|
56
|
+
lookupConditions: {
|
|
57
|
+
[x: number]: RegExp;
|
|
58
|
+
}[];
|
|
59
|
+
};
|
|
60
|
+
/** @desc:{
|
|
61
|
+
objectName: It's a name of Collection.
|
|
62
|
+
logAction: Add | Modify | Delete
|
|
63
|
+
objLogProp :{ // Its details of the object
|
|
64
|
+
ObjectID: Object Id
|
|
65
|
+
Data : Full Collection Object
|
|
66
|
+
}
|
|
67
|
+
}*/
|
|
68
|
+
declare function AddLog(req: OPT_Request, objectName: string, logAction: string, objLogProp: AnyObjectInterface, db: Db, next: NextFunction): void;
|
|
69
|
+
declare function CheckFilterFieldsProjection(condition: AnyObjectInterface, fields: AnyObjectInterface, pageData: AnyObjectInterface, project: AnyObjectInterface): void;
|
|
70
|
+
declare function VerifyEmailPassword(options: AnyObjectInterface, callback: callBackInterface): void;
|
|
71
|
+
declare function GetMyTeamUsers(options: AnyObjectInterface, next: NextFunction): void;
|
|
72
|
+
declare function ExtractChildUsersTree(userId: string, childUsersArray: AnyObjectInterface[], usersTraversed: string[], counter: number, db: Db, onFetch: callBackInterface): void;
|
|
73
|
+
declare function GetMaxKeyValueListSchema(ListName: string, db: Db): Promise<any>;
|
|
74
|
+
declare function VerifyAWSEmailConfig(mailData: AnyObjectInterface, callback: callBackInterface): void;
|
|
75
|
+
declare function GenerateId(obj: AnyObjectInterface): void;
|
|
76
|
+
declare function SyncUserDetailsWithMasterDB(userData: AnyObjectInterface, callback: CallableFunction, dbMaster: Db): void;
|
|
77
|
+
declare function SignoutUserFromAllDevices(options: AnyObjectInterface, dbMaster: Db, redisClient: Redis): void;
|
|
78
|
+
declare function SignoutUsersWithPromise(options: AnyObjectInterface, dbMaster: Db, redisClient: Redis): Promise<unknown>;
|
|
79
|
+
declare function SignoutMultipleUsersFromAllDevices(options: AnyObjectInterface, dbMaster: Db, redisClient: Redis): void;
|
|
80
|
+
declare function UserLicenseConsumeCalculate(options: AnyObjectInterface): void;
|
|
81
|
+
declare function sendMailWithUserAccount(mailObj: AnyObjectInterface, files: AnyObjectInterface, userSettings: AnyObjectInterface): Promise<any>;
|
|
82
|
+
declare function GetEmailClientConfigs(options: AnyObjectInterface): void;
|
|
83
|
+
declare function GetCompanyEncryptionKey(options: AnyObjectInterface): void;
|
|
84
|
+
declare function ExecuteDynamicDMLQuery(options: AnyObjectInterface): Promise<string>;
|
|
85
|
+
declare function ExecuteDynamicDQLQuery(options: AnyObjectInterface): Promise<AnyObjectInterface>;
|
|
86
|
+
declare function GetUserProfilePermissions(options: AnyObjectInterface): void;
|
|
87
|
+
declare function MakeUserPasswordInvalid(options: AnyObjectInterface): void;
|
|
88
|
+
declare function ConvertJsonToXLXS(data: AnyObjectInterface, params: AnyObjectInterface | undefined, filePath: string): Promise<void>;
|
|
89
|
+
declare function SendResetPasswordMail(db: Db, userDetails: AnyObjectInterface, type?: string): Promise<unknown>;
|
|
90
|
+
declare function SendMailToSupport(mailData: AnyObjectInterface, callback: callBackInterface): void;
|
|
91
|
+
declare function MailTemplateStructure(content: string, HasDontReplyContent?: boolean): string;
|
|
92
|
+
declare function SendMailToCustomer(mailData: AnyObjectInterface, callback: callBackInterface): void;
|
|
93
|
+
declare function parseMSPCookie(cookie: AnyObjectInterface): any;
|
|
94
|
+
declare function isEmptyObj(object: AnyObjectInterface): boolean;
|
|
95
|
+
declare function ConvertFileByteSize(bytes: number): string;
|
|
96
|
+
declare function GetIPDetailsFromReq(req: Express.Request): Promise<{
|
|
97
|
+
countryName: string;
|
|
98
|
+
region: string;
|
|
99
|
+
city: string;
|
|
100
|
+
ip: string;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* @param res
|
|
104
|
+
* @param params
|
|
105
|
+
* @description Helper function to send response
|
|
106
|
+
*/
|
|
107
|
+
declare function ReturnJsonResponse(res: Response, params: ResponseStructure): void;
|
|
108
|
+
declare function CheckForWhiteListedDomain(req: Express.Request, whiteListedDomain: Array<string>): boolean;
|
|
109
|
+
declare function SyncListSchemaFieldInOtherCollection(syncFields: AnyObjectInterface, db: Db, msp_d: AnyObjectInterface): Promise<void>;
|
|
110
|
+
declare function UpdateTagCountAfterDelete(objectids: ObjectId[], objectName: string, db: Db, params?: AnyObjectInterface): Promise<void>;
|
|
111
|
+
declare function SyncTagCountAfterUpdate(objectName: string, db: Db): void;
|
|
112
|
+
declare function SyncUserLicenceConsumedCount(msp_d: AnyObjectInterface, db: Db, dbMaster: Db): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* @param db: database object
|
|
115
|
+
* @param event : event module object
|
|
116
|
+
* @param EventsList : array of events like socket event..
|
|
117
|
+
* * @param EventName : name of event like refresh-notification
|
|
118
|
+
* * @param EventData : event data, if needed
|
|
119
|
+
* * @param IsSocketEvent : Type of event, currently handled for socket event only
|
|
120
|
+
* @param UserID : creater of the event, event is not sending to sender
|
|
121
|
+
* @param req : request object
|
|
122
|
+
* @param req : response object
|
|
123
|
+
* @param next : next object
|
|
124
|
+
* @description To Broad Case any event to all company Users like refresh-notification
|
|
125
|
+
*/
|
|
126
|
+
declare function BroadCastEventToAllCompanyUsers(params: AnyObjectInterface): void;
|
|
127
|
+
/**
|
|
128
|
+
* @param actionType : add, edit, delete
|
|
129
|
+
* @description check before add update or delete operation
|
|
130
|
+
*/
|
|
131
|
+
declare function CheckDataPermission(fieldsObj: AnyObjectInterface, pageData: AnyObjectInterface, profileData: AnyObjectInterface, actionType: string): void;
|
|
132
|
+
/**
|
|
133
|
+
* @param fieldsObj : company ID
|
|
134
|
+
* @description Sync Company Licence In Master Company
|
|
135
|
+
*/
|
|
136
|
+
declare function SyncCompanyLicenceInMasterCompanyAfterAdd(fieldsObj: AnyObjectInterface, dbMaster: Db): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Returns date string - Date for next service with the given options
|
|
139
|
+
*
|
|
140
|
+
* @param object options date string
|
|
141
|
+
* @return string - date
|
|
142
|
+
*/
|
|
143
|
+
declare function NextServiceDateForDashboard(options: any): string;
|
|
144
|
+
/**
|
|
145
|
+
* Returns - Check Date Exist in Past
|
|
146
|
+
* _common.GetWeekDayInfoInMonth("sunday");
|
|
147
|
+
*
|
|
148
|
+
* @param {object} currentDt moment date object
|
|
149
|
+
* @param {object} dateToCheck moment date object
|
|
150
|
+
* @return boolean
|
|
151
|
+
*/
|
|
152
|
+
declare function CheckDateNotInPast(currentDt: Moment, dateToCheck: Moment): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Returns - date by given date, weekday and occurance like first, second -
|
|
155
|
+
* _common.GetWeekDayByDayAndOccurance(moment().format(), 5, "fourth");
|
|
156
|
+
*
|
|
157
|
+
* @param {string} dt date moment date string
|
|
158
|
+
* @param {string} weekday weekday like sunday, monday
|
|
159
|
+
* @param {string} occuranceSeq occurence like first, second till fourth & last
|
|
160
|
+
* @return string
|
|
161
|
+
*/
|
|
162
|
+
declare function GetWeekDayByDayAndOccurance(dt: string, weekday: number, occuranceSeq: string): string;
|
|
163
|
+
/**
|
|
164
|
+
* Returns - get occurence index from list
|
|
165
|
+
* _common.GetInterValFromOccurance("first");
|
|
166
|
+
*
|
|
167
|
+
* @param {string} occurVal first, second till fourth & last
|
|
168
|
+
* @return number
|
|
169
|
+
*/
|
|
170
|
+
declare function GetInterValFromOccurance(occurVal: string): number;
|
|
171
|
+
/**
|
|
172
|
+
* Returns object - Get Date information related to occurance, day index etc.
|
|
173
|
+
*
|
|
174
|
+
* @param {string} dt date string
|
|
175
|
+
* @return occurance, day, month, date, dayIndex
|
|
176
|
+
*/
|
|
177
|
+
declare function GetWeekDayInfoInMonth(dt: string): {
|
|
178
|
+
occurance: string;
|
|
179
|
+
day: string;
|
|
180
|
+
month: string;
|
|
181
|
+
date: number;
|
|
182
|
+
dayIndex: number;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Returns - weekindex
|
|
186
|
+
* _common.GetWeekDayInfoInMonth("sunday");
|
|
187
|
+
*
|
|
188
|
+
* @param {string} day sunday to saturday
|
|
189
|
+
* @return number
|
|
190
|
+
*/
|
|
191
|
+
declare function GetDayIndex(day: string): number;
|
|
192
|
+
declare function GetUserProfile(msp_d: AnyObjectInterface, db: Db, mdb: Db, next: NextFunction): Promise<{
|
|
193
|
+
statusCode: number;
|
|
194
|
+
message: string;
|
|
195
|
+
data: any;
|
|
196
|
+
} | undefined>;
|
|
197
|
+
declare function CheckPageAuthentication(pageData: AnyObjectInterface, msp_d: AnyObjectInterface, db: Db, mdb: Db, next: NextFunction): Promise<boolean>;
|
|
198
|
+
declare function RemoveFieldsFromFilters(condition: AnyObjectInterface, fields: AnyObjectInterface[], identifier: string): void;
|
|
199
|
+
/**
|
|
200
|
+
* @param Error Error object
|
|
201
|
+
* @param ServiceOrigin - Error Occur in Service (Service Name)
|
|
202
|
+
* @param EmailConfig Email configuration object
|
|
203
|
+
* @param Module Module
|
|
204
|
+
* @param db db connection
|
|
205
|
+
* @description Error handler function: Send Error Email & Save Error in database
|
|
206
|
+
*/
|
|
207
|
+
declare function ErrorHandlerForServices(Error: OPT_ERROR, ServiceOrigin: string, EmailConfig: any, Module?: string, db?: Db): Promise<any>;
|
|
208
|
+
declare function CheckCaptcha(token: string, captcha: string, redisClient: Redis): Promise<unknown>;
|
|
209
|
+
declare function IsStringValue(val: any): boolean;
|
|
210
|
+
declare function ValidateSanitizeUserInput(inputFields: AnyObjectInterface, pageData: AnyObjectInterface): Promise<(AnyObjectInterface | {
|
|
211
|
+
msg: string;
|
|
212
|
+
})[] | undefined>;
|
|
213
|
+
declare function ValidateUserInput(options: AnyObjectInterface): Promise<string | undefined>;
|
|
214
|
+
/**
|
|
215
|
+
* TODO: Check conditional field criteria with user inputs
|
|
216
|
+
*
|
|
217
|
+
* @param {object} field Contains shcema
|
|
218
|
+
* @param {object} record contains user inputs
|
|
219
|
+
* @param {string} action shows add or update
|
|
220
|
+
* @return message in string
|
|
221
|
+
*/
|
|
222
|
+
declare function CheckConditionalField(field: any, record: any, action: string): string;
|
|
223
|
+
/**
|
|
224
|
+
* TODO: Check expression on date field
|
|
225
|
+
*
|
|
226
|
+
* @param {object} record Contains user inputs
|
|
227
|
+
* @param {string} fieldName name
|
|
228
|
+
* @param {string} range like 'Custom', 'today', yesterday etc.
|
|
229
|
+
* @param {string} startDate in case of custom range
|
|
230
|
+
* @param {string} endDate in case of custom range
|
|
231
|
+
* @return true or false
|
|
232
|
+
*/
|
|
233
|
+
declare function CheckExpressionOnDateField(record: any, fieldName: string, range: string, startDate: string, endDate: string): boolean;
|
|
234
|
+
/**
|
|
235
|
+
* TODO: Create lookup of fields of list schema for Vat Setting data
|
|
236
|
+
*
|
|
237
|
+
* @param {object} msp_d Contains user information
|
|
238
|
+
* @param {object} db Database connection object
|
|
239
|
+
* @param {object} sdata contains vat setting data including list schema
|
|
240
|
+
* @param next middleware for error handling
|
|
241
|
+
* @return N/A
|
|
242
|
+
*/
|
|
243
|
+
declare function CreateBanquetingVATSettingsData(msp_d: AnyObjectInterface, db: Db, sdata: AnyObjectInterface, next: NextFunction): Promise<void>;
|
|
244
|
+
/**
|
|
245
|
+
* TODO: To Check if given user has access to Report Folder - THIS FUNCTION IS COPIED FROM report_controller.js
|
|
246
|
+
*
|
|
247
|
+
* @param {object} report Contains Report information
|
|
248
|
+
* @param {object} db Database connection object
|
|
249
|
+
* @param {object} msp_d Contains User id information
|
|
250
|
+
* @param folderActiveStatus boolean default value true
|
|
251
|
+
* @return N/A
|
|
252
|
+
*/
|
|
253
|
+
declare function CheckReportFolderAccess(report: AnyObjectInterface, db: Db, msp_d: AnyObjectInterface, folderActiveStatus?: boolean): Promise<boolean>;
|
|
254
|
+
/**
|
|
255
|
+
* TODO: Return On behalf String in Calendar Invitation mails
|
|
256
|
+
* @param fromUser From User Name
|
|
257
|
+
* @returns string
|
|
258
|
+
*/
|
|
259
|
+
declare function GetMailFromString(fromUser: string): string;
|
|
260
|
+
/**
|
|
261
|
+
* TODO: Return On behalf String in Calendar Invitation mails
|
|
262
|
+
* @param fromUser From User Name
|
|
263
|
+
* @param fromEmail From User Email
|
|
264
|
+
* @returns string
|
|
265
|
+
*/
|
|
266
|
+
declare function InvitationMailReplyContent(fromUser: string, fromEmail: string): string;
|
|
267
|
+
/**
|
|
268
|
+
* TODO: Check if filter has fiscal in Operator value - Recursion Function
|
|
269
|
+
*
|
|
270
|
+
* @param filter - object || array
|
|
271
|
+
* @return boolean
|
|
272
|
+
*/
|
|
273
|
+
declare function HasFiscalOperator(filter: any): boolean;
|
|
274
|
+
/**
|
|
275
|
+
* TODO: Return Encrypted URL
|
|
276
|
+
*
|
|
277
|
+
* @param recordIds - ObjectId[]
|
|
278
|
+
* @param companyId - string
|
|
279
|
+
* @param secretKey - string
|
|
280
|
+
* @return object
|
|
281
|
+
*/
|
|
282
|
+
declare function GetEncryptedURL(options: GetEncryptedURLOptions): any[];
|
|
283
|
+
declare function GenerateBase64QRCodeData(data: string, options?: any): Promise<any>;
|
|
284
|
+
/**
|
|
285
|
+
* QPC-7137: getting Drive sharing
|
|
286
|
+
*
|
|
287
|
+
* @param parentFolderID - folder id
|
|
288
|
+
* @param db - object db connecttion
|
|
289
|
+
* @return array of all sharing of child file folders
|
|
290
|
+
*/
|
|
291
|
+
declare function GetFileFolderDetailsInFolderForDriveSharing(parentFolderID: any, db: Db): Promise<any>;
|
|
292
|
+
/**
|
|
293
|
+
* TODO: Sync total slots remainig in Event Registration
|
|
294
|
+
*
|
|
295
|
+
* @param1 registration id || ObjectId
|
|
296
|
+
* @param2 database connection || Db
|
|
297
|
+
* @return NA
|
|
298
|
+
*/
|
|
299
|
+
declare function SyncTotalSlotRemaining(registrationID: any, db: Db): Promise<void>;
|
|
300
|
+
export { CheckForWhiteListedDomain, ReturnJsonResponse, ConvertFileByteSize, GetObjectByKeyValueFromList, IsEqualArrays, IsEqualValue, CheckUserProfileField, GetPageFieldData, GetPageObjectSchema, GetFieldDetail, UpdateRecentViewObject, UpdateRecentViewFields, SyncChildObjectData, SyncParentObjectData, DeleteFieldInOtherCollection, SyncFieldInSameCollection, SyncFieldInSameCollectionByObjectID, SyncFieldInSameCollectionByObjectIDWithPromise, SyncFieldInOtherCollection, SyncUserInOtherCollection, GetObjectByString, BuildLookupDataField, CheckDataBeforeAdd, CheckDataBeforeUpdate, BuildGridFieldProjection, BuildFieldProjection, BuildLookupFieldProjection, FilterConditions, GirdHeaderFilters, FieldsGridHeaderFilters, AddLog, CheckFilterFieldsProjection, VerifyEmailPassword, GetMyTeamUsers, ExtractChildUsersTree, GetMaxKeyValueListSchema, VerifyAWSEmailConfig, GenerateId, SyncUserDetailsWithMasterDB, SignoutUserFromAllDevices, SignoutUsersWithPromise, SignoutMultipleUsersFromAllDevices, UserLicenseConsumeCalculate, sendMailWithUserAccount, GetEmailClientConfigs, GetCompanyEncryptionKey, ExecuteDynamicDMLQuery, ExecuteDynamicDQLQuery, GetUserProfilePermissions, MakeUserPasswordInvalid, ConvertJsonToXLXS, SendResetPasswordMail, SendMailToSupport, MailTemplateStructure, SendMailToCustomer, parseMSPCookie, GetIPDetailsFromReq, isEmptyObj, SyncListSchemaFieldInOtherCollection, UpdateTagCountAfterDelete, SyncTagCountAfterUpdate, ReactivateFieldInOtherCollection, SyncUserLicenceConsumedCount, BroadCastEventToAllCompanyUsers, CheckDataPermission, SyncCompanyLicenceInMasterCompanyAfterAdd, NextServiceDateForDashboard, CheckDateNotInPast, GetWeekDayByDayAndOccurance, GetInterValFromOccurance, GetWeekDayInfoInMonth, GetDayIndex, RemoveFieldsFromFilters, GetUserProfile, CheckPageAuthentication, ErrorHandlerForServices, CheckCaptcha, IsStringValue, ValidateSanitizeUserInput, ValidateUserInput, CheckConditionalField, CheckExpressionOnDateField, AddDaysToDate, CreateBanquetingVATSettingsData, CheckReportFolderAccess, GetMailFromString, InvitationMailReplyContent, HasFiscalOperator, GetEncryptedURL, GenerateBase64QRCodeData, GetFileFolderDetailsInFolderForDriveSharing, SyncTotalSlotRemaining };
|