@optimiser/common 1.0.365 → 1.0.367
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 +94 -93
- package/dist/lib/helper.js +1016 -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 -298
- package/dist/lib/utility.js +5626 -5621
- 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/helper.d.ts
CHANGED
|
@@ -1,93 +1,94 @@
|
|
|
1
|
-
import { Db, ObjectId } from "mongodb";
|
|
2
|
-
import { AnyObjectInterface } from "../modals/utility.modal";
|
|
3
|
-
declare function GetCompanyDetails(Master_DB: Db, companyId: string): Promise<any>;
|
|
4
|
-
declare function GetListSchema(db: Db, listName: string): Promise<Error | AnyObjectInterface[] | []>;
|
|
5
|
-
declare function GetEmailwiseUnsubscribeData(db: Db, mailID: string, domainID?: string): Promise<Error | AnyObjectInterface[] | []>;
|
|
6
|
-
declare function GenerateAutoIncrementFieldValue(db: Db, autoIncrementID: string): Promise<null | string>;
|
|
7
|
-
declare function GetAccountDetailByName(db: Db, accountName: string): Promise<AnyObjectInterface | null>;
|
|
8
|
-
declare function GetContactDetailByEmail(db: Db, contactEmail: string): Promise<null | AnyObjectInterface>;
|
|
9
|
-
declare function GetSystemEmailTemplate(db: Db, TemplateIDArray: ObjectId[]): Promise<null | AnyObjectInterface>;
|
|
10
|
-
declare function UpdateContactDetails(db: Db, contactData: AnyObjectInterface): void;
|
|
11
|
-
declare function CreateContact(db: Db, contactData: AnyObjectInterface): Promise<null | AnyObjectInterface>;
|
|
12
|
-
declare function MapAccountContact(db: Db, dataObj: AnyObjectInterface): void;
|
|
13
|
-
declare function UpdatePipelineMailStatus(db: Db, pipelineID: string, mailStatus: any): void;
|
|
14
|
-
declare function AddLog(db: Db, data: any): void;
|
|
15
|
-
/**
|
|
16
|
-
* Returns object - To and From date from given operator value
|
|
17
|
-
*
|
|
18
|
-
* @param {string} operator today/yesterday/tomorrow
|
|
19
|
-
* @return { dates } object container start and end date
|
|
20
|
-
*/
|
|
21
|
-
declare const GetDateRangeFromOperatorValue: (operator: any, fiscalMonth: any, fiscalFrom: any) => {
|
|
22
|
-
startDate: any;
|
|
23
|
-
endDate: any;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Returns boolean - Check date exist in Given Date Range(Quarter)
|
|
27
|
-
*
|
|
28
|
-
* @param {string} date date to compare
|
|
29
|
-
* @param {string} startDate format DD-MMM-YYYY
|
|
30
|
-
* @param {string} endDate format DD-MMM-YYYY
|
|
31
|
-
* @return { boolean } true/false
|
|
32
|
-
*/
|
|
33
|
-
declare const CheckDateExistInRange: (date: any, startDate: any, endDate: any) => boolean;
|
|
34
|
-
/**
|
|
35
|
-
* To get the email subscribe status. By default it take email as subscribed
|
|
36
|
-
* and check if email is unsusbscribed for all categories of all domains then it give it as unsubscribe.
|
|
37
|
-
* @param {db} database object
|
|
38
|
-
* @param {email} string
|
|
39
|
-
*
|
|
40
|
-
* @param retunrs true|false|error for subscribe or unsubscribe.
|
|
41
|
-
*/
|
|
42
|
-
declare const GetEmailSubscribeStatus: (db: Db, email: string) => Promise<Error | boolean>;
|
|
43
|
-
/**
|
|
44
|
-
* To subscribe or unsubscribe email id for all domains
|
|
45
|
-
* @param {db} database object
|
|
46
|
-
* @param {email} string
|
|
47
|
-
* @param {isSubscribe} boolean
|
|
48
|
-
* @param {companyID} mongodb object id, comany id of email
|
|
49
|
-
* @param {comment} string , to add comment
|
|
50
|
-
* @param {mongodbQueryOptions} object, params to pass on db queries
|
|
51
|
-
* @returns resolve success | error object
|
|
52
|
-
*/
|
|
53
|
-
declare const SubscribeEmailForAllDomains: (db: Db, email: string, isSubscribe: boolean, companyID: ObjectId, comment?: string, mongodbQueryOptions?: any) => Promise<unknown>;
|
|
54
|
-
/**
|
|
55
|
-
* checking phone number is valid and has dialing code
|
|
56
|
-
* if it has dialing code then get country code, get its optimiser country phone code
|
|
57
|
-
* if it doesn't has dialing code then try to pasrse it with countryCode
|
|
58
|
-
* if phone is valid then use it other wise ignore that no.
|
|
59
|
-
* @param {phoneNumber} string, phone no with or without dialing code
|
|
60
|
-
* @param {countryCode} string, ISO country code
|
|
61
|
-
* @returns {
|
|
62
|
-
IsValid: boolean, //phone is valid or not
|
|
63
|
-
CountryCode?: string, //phone country code
|
|
64
|
-
PhoneCallingCode?: CountryCallingCode, //phone country calling code
|
|
65
|
-
PhoneNumberParsed?: NationalNumber, //phone no local to the country, without country calling code and only digits
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* @param {
|
|
75
|
-
* @param {
|
|
76
|
-
* @param {
|
|
77
|
-
* @
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
1
|
+
import { Db, ObjectId } from "mongodb";
|
|
2
|
+
import { AnyObjectInterface } from "../modals/utility.modal";
|
|
3
|
+
declare function GetCompanyDetails(Master_DB: Db, companyId: string): Promise<any>;
|
|
4
|
+
declare function GetListSchema(db: Db, listName: string): Promise<Error | AnyObjectInterface[] | []>;
|
|
5
|
+
declare function GetEmailwiseUnsubscribeData(db: Db, mailID: string, domainID?: string): Promise<Error | AnyObjectInterface[] | []>;
|
|
6
|
+
declare function GenerateAutoIncrementFieldValue(db: Db, autoIncrementID: string): Promise<null | string>;
|
|
7
|
+
declare function GetAccountDetailByName(db: Db, accountName: string): Promise<AnyObjectInterface | null>;
|
|
8
|
+
declare function GetContactDetailByEmail(db: Db, contactEmail: string): Promise<null | AnyObjectInterface>;
|
|
9
|
+
declare function GetSystemEmailTemplate(db: Db, TemplateIDArray: ObjectId[]): Promise<null | AnyObjectInterface>;
|
|
10
|
+
declare function UpdateContactDetails(db: Db, contactData: AnyObjectInterface): void;
|
|
11
|
+
declare function CreateContact(db: Db, contactData: AnyObjectInterface): Promise<null | AnyObjectInterface>;
|
|
12
|
+
declare function MapAccountContact(db: Db, dataObj: AnyObjectInterface): void;
|
|
13
|
+
declare function UpdatePipelineMailStatus(db: Db, pipelineID: string, mailStatus: any): void;
|
|
14
|
+
declare function AddLog(db: Db, data: any): void;
|
|
15
|
+
/**
|
|
16
|
+
* Returns object - To and From date from given operator value
|
|
17
|
+
*
|
|
18
|
+
* @param {string} operator today/yesterday/tomorrow
|
|
19
|
+
* @return { dates } object container start and end date
|
|
20
|
+
*/
|
|
21
|
+
declare const GetDateRangeFromOperatorValue: (operator: any, fiscalMonth: any, fiscalFrom: any) => {
|
|
22
|
+
startDate: any;
|
|
23
|
+
endDate: any;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Returns boolean - Check date exist in Given Date Range(Quarter)
|
|
27
|
+
*
|
|
28
|
+
* @param {string} date date to compare
|
|
29
|
+
* @param {string} startDate format DD-MMM-YYYY
|
|
30
|
+
* @param {string} endDate format DD-MMM-YYYY
|
|
31
|
+
* @return { boolean } true/false
|
|
32
|
+
*/
|
|
33
|
+
declare const CheckDateExistInRange: (date: any, startDate: any, endDate: any) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* To get the email subscribe status. By default it take email as subscribed
|
|
36
|
+
* and check if email is unsusbscribed for all categories of all domains then it give it as unsubscribe.
|
|
37
|
+
* @param {db} database object
|
|
38
|
+
* @param {email} string
|
|
39
|
+
*
|
|
40
|
+
* @param retunrs true|false|error for subscribe or unsubscribe.
|
|
41
|
+
*/
|
|
42
|
+
declare const GetEmailSubscribeStatus: (db: Db, email: string) => Promise<Error | boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* To subscribe or unsubscribe email id for all domains
|
|
45
|
+
* @param {db} database object
|
|
46
|
+
* @param {email} string
|
|
47
|
+
* @param {isSubscribe} boolean
|
|
48
|
+
* @param {companyID} mongodb object id, comany id of email
|
|
49
|
+
* @param {comment} string , to add comment
|
|
50
|
+
* @param {mongodbQueryOptions} object, params to pass on db queries
|
|
51
|
+
* @returns resolve success | error object
|
|
52
|
+
*/
|
|
53
|
+
declare const SubscribeEmailForAllDomains: (db: Db, email: string, isSubscribe: boolean, companyID: ObjectId, comment?: string, mongodbQueryOptions?: any) => Promise<unknown>;
|
|
54
|
+
/**
|
|
55
|
+
* checking phone number is valid and has dialing code
|
|
56
|
+
* if it has dialing code then get country code, get its optimiser country phone code
|
|
57
|
+
* if it doesn't has dialing code then try to pasrse it with countryCode
|
|
58
|
+
* if phone is valid then use it other wise ignore that no.
|
|
59
|
+
* @param {phoneNumber} string, phone no with or without dialing code
|
|
60
|
+
* @param {countryCode} string, ISO country code
|
|
61
|
+
* @returns {
|
|
62
|
+
IsValid: boolean, //phone is valid or not
|
|
63
|
+
CountryCode?: string, //phone country code
|
|
64
|
+
PhoneCallingCode?: CountryCallingCode, //phone country calling code
|
|
65
|
+
PhoneNumberParsed?: NationalNumber, //phone no local to the country, without country calling code and only digits
|
|
66
|
+
ValidatedBy? : string, //Possible Values are SELF | COUNTRY_CODE, this field tells Phone No is valid by self or found valid with Country code
|
|
67
|
+
Error: Error
|
|
68
|
+
}
|
|
69
|
+
*/
|
|
70
|
+
declare const IsValidPhoneNumber: (phoneNumber: string, countryCode: string) => AnyObjectInterface;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* Server side field validatinon
|
|
74
|
+
* @param {db} object database connection
|
|
75
|
+
* @param {dataObj} object contains field data
|
|
76
|
+
* @param {objectType} string object name
|
|
77
|
+
* @param {countryCode} string, ISO country code
|
|
78
|
+
* @returns {
|
|
79
|
+
IsValid: boolean, //phone is valid or not
|
|
80
|
+
CountryCode?: string, //phone country code
|
|
81
|
+
PhoneCallingCode?: CountryCallingCode, //phone country calling code
|
|
82
|
+
PhoneNumberParsed?: NationalNumber, //phone no local to the country, without country calling code and only digits
|
|
83
|
+
Error: Error
|
|
84
|
+
}
|
|
85
|
+
*/
|
|
86
|
+
declare function ValidateData(db: Db, dataObj: AnyObjectInterface, objectType: string): Promise<unknown>;
|
|
87
|
+
/**
|
|
88
|
+
* Returns boolean - Whether given date is future or not
|
|
89
|
+
*
|
|
90
|
+
* @param {string} date date
|
|
91
|
+
* @return { boolean } true/false
|
|
92
|
+
*/
|
|
93
|
+
declare const IsFutureDate: (date: any) => boolean;
|
|
94
|
+
export { GetCompanyDetails, GetListSchema, GetEmailwiseUnsubscribeData, GenerateAutoIncrementFieldValue, GetAccountDetailByName, GetContactDetailByEmail, GetSystemEmailTemplate, UpdateContactDetails, CreateContact, MapAccountContact, UpdatePipelineMailStatus, AddLog, CheckDateExistInRange, GetDateRangeFromOperatorValue, GetEmailSubscribeStatus, SubscribeEmailForAllDomains, IsValidPhoneNumber, ValidateData, IsFutureDate };
|