@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/redis.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import IORedis from "ioredis";
|
|
2
|
-
import RedisConfig from "../modals/redisconfig.modal";
|
|
3
|
-
declare class Redis {
|
|
4
|
-
private config;
|
|
5
|
-
private ioredis;
|
|
6
|
-
/**
|
|
7
|
-
* @param config
|
|
8
|
-
* @description Initialize redis
|
|
9
|
-
*/
|
|
10
|
-
constructor(config: RedisConfig);
|
|
11
|
-
private Initialize;
|
|
12
|
-
/**
|
|
13
|
-
* @description Get the config passed to redis
|
|
14
|
-
*/
|
|
15
|
-
GetConfig(): RedisConfig;
|
|
16
|
-
/**
|
|
17
|
-
* @description The the redisClient
|
|
18
|
-
*/
|
|
19
|
-
GetClient(): IORedis.Redis | undefined;
|
|
20
|
-
}
|
|
21
|
-
export default Redis;
|
|
1
|
+
import IORedis from "ioredis";
|
|
2
|
+
import RedisConfig from "../modals/redisconfig.modal";
|
|
3
|
+
declare class Redis {
|
|
4
|
+
private config;
|
|
5
|
+
private ioredis;
|
|
6
|
+
/**
|
|
7
|
+
* @param config
|
|
8
|
+
* @description Initialize redis
|
|
9
|
+
*/
|
|
10
|
+
constructor(config: RedisConfig);
|
|
11
|
+
private Initialize;
|
|
12
|
+
/**
|
|
13
|
+
* @description Get the config passed to redis
|
|
14
|
+
*/
|
|
15
|
+
GetConfig(): RedisConfig;
|
|
16
|
+
/**
|
|
17
|
+
* @description The the redisClient
|
|
18
|
+
*/
|
|
19
|
+
GetClient(): IORedis.Redis | undefined;
|
|
20
|
+
}
|
|
21
|
+
export default Redis;
|
package/dist/lib/redis.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var ioredis_1 = __importDefault(require("ioredis"));
|
|
7
|
-
var Redis = /** @class */ (function () {
|
|
8
|
-
/**
|
|
9
|
-
* @param config
|
|
10
|
-
* @description Initialize redis
|
|
11
|
-
*/
|
|
12
|
-
function Redis(config) {
|
|
13
|
-
this.config = config;
|
|
14
|
-
this.Initialize(config);
|
|
15
|
-
}
|
|
16
|
-
Redis.prototype.Initialize = function (config) {
|
|
17
|
-
var opts = {
|
|
18
|
-
host: config.REDIS_URL,
|
|
19
|
-
port: config.REDIS_PORT,
|
|
20
|
-
autoResubscribe: true,
|
|
21
|
-
maxRetriesPerRequest: 5,
|
|
22
|
-
password: config.REDIS_PASS
|
|
23
|
-
};
|
|
24
|
-
this.ioredis = new ioredis_1.default(opts);
|
|
25
|
-
this.ioredis.on('connect', function () {
|
|
26
|
-
console.log('Redis client connected');
|
|
27
|
-
});
|
|
28
|
-
this.ioredis.on('error', function (err) {
|
|
29
|
-
console.log('Something went wrong ' + err);
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* @description Get the config passed to redis
|
|
34
|
-
*/
|
|
35
|
-
Redis.prototype.GetConfig = function () {
|
|
36
|
-
return this.config;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* @description The the redisClient
|
|
40
|
-
*/
|
|
41
|
-
Redis.prototype.GetClient = function () {
|
|
42
|
-
return this.ioredis;
|
|
43
|
-
};
|
|
44
|
-
return Redis;
|
|
45
|
-
}());
|
|
46
|
-
exports.default = Redis;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var ioredis_1 = __importDefault(require("ioredis"));
|
|
7
|
+
var Redis = /** @class */ (function () {
|
|
8
|
+
/**
|
|
9
|
+
* @param config
|
|
10
|
+
* @description Initialize redis
|
|
11
|
+
*/
|
|
12
|
+
function Redis(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
this.Initialize(config);
|
|
15
|
+
}
|
|
16
|
+
Redis.prototype.Initialize = function (config) {
|
|
17
|
+
var opts = {
|
|
18
|
+
host: config.REDIS_URL,
|
|
19
|
+
port: config.REDIS_PORT,
|
|
20
|
+
autoResubscribe: true,
|
|
21
|
+
maxRetriesPerRequest: 5,
|
|
22
|
+
password: config.REDIS_PASS
|
|
23
|
+
};
|
|
24
|
+
this.ioredis = new ioredis_1.default(opts);
|
|
25
|
+
this.ioredis.on('connect', function () {
|
|
26
|
+
console.log('Redis client connected');
|
|
27
|
+
});
|
|
28
|
+
this.ioredis.on('error', function (err) {
|
|
29
|
+
console.log('Something went wrong ' + err);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @description Get the config passed to redis
|
|
34
|
+
*/
|
|
35
|
+
Redis.prototype.GetConfig = function () {
|
|
36
|
+
return this.config;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @description The the redisClient
|
|
40
|
+
*/
|
|
41
|
+
Redis.prototype.GetClient = function () {
|
|
42
|
+
return this.ioredis;
|
|
43
|
+
};
|
|
44
|
+
return Redis;
|
|
45
|
+
}());
|
|
46
|
+
exports.default = Redis;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import IORedis from "ioredis";
|
|
2
|
-
declare const _default: (redis: IORedis.Redis, UserId: string) => Promise<string[]>;
|
|
3
|
-
export default _default;
|
|
1
|
+
import IORedis from "ioredis";
|
|
2
|
+
declare const _default: (redis: IORedis.Redis, UserId: string) => Promise<string[]>;
|
|
3
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = (function (redis, UserId) {
|
|
4
|
-
return redis.lrange("UserSocketID." + [UserId], 0, -1);
|
|
5
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = (function (redis, UserId) {
|
|
4
|
+
return redis.lrange("UserSocketID." + [UserId], 0, -1);
|
|
5
|
+
});
|
package/dist/lib/taskutils.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { NextFunction } from "express";
|
|
2
|
-
import { ObjectId, Db } from "mongodb";
|
|
3
|
-
import { AnyObjectInterface } from "../modals/utility.modal";
|
|
4
|
-
import { OPT_Request } from "../modals/connection.modal";
|
|
5
|
-
import 'moment-timezone';
|
|
6
|
-
/**
|
|
7
|
-
* @param obj object contains data of task
|
|
8
|
-
* @param assignees - assignees object ids array
|
|
9
|
-
* @param userID user object id
|
|
10
|
-
* @param db db connection
|
|
11
|
-
* @param next next function
|
|
12
|
-
* @description Generating Next auto-increment number and return array for each assignee
|
|
13
|
-
*/
|
|
14
|
-
declare function GenerateTaskNumber(obj: AnyObjectInterface, assignees: ObjectId[], userID: ObjectId, db: Db, next: NextFunction): Promise<unknown>;
|
|
15
|
-
/**
|
|
16
|
-
* @param req - request obj
|
|
17
|
-
* @param options object contains data of task
|
|
18
|
-
* @param db db connection
|
|
19
|
-
* @param event event passed from optimiser to send notifications
|
|
20
|
-
* @description initiates notifications to be send after action performed in Task
|
|
21
|
-
*/
|
|
22
|
-
declare function GenerateTaskNotifications(req: OPT_Request, options: any, db: Db, event: any): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* @param types contains notification type to be executed
|
|
25
|
-
* @param data - notification data
|
|
26
|
-
* @param req - request obj
|
|
27
|
-
* @param db db connection
|
|
28
|
-
* @param event event passed from optimiser to send notifications
|
|
29
|
-
* @description sends notifications
|
|
30
|
-
*/
|
|
31
|
-
declare function TriggerNotifications(types: any[] | undefined, data: AnyObjectInterface, req: OPT_Request, db: Db, event: any): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* @param info data of task
|
|
34
|
-
* @param req - request obj
|
|
35
|
-
* @param db db connection
|
|
36
|
-
* @param event event passed from optimiser to send notifications
|
|
37
|
-
* @description creates notification content
|
|
38
|
-
*/
|
|
39
|
-
declare function CreateNotificationContent(info: AnyObjectInterface, req: OPT_Request, db: Db, event: any): Promise<void>;
|
|
40
|
-
export { GenerateTaskNumber, GenerateTaskNotifications, TriggerNotifications, CreateNotificationContent };
|
|
1
|
+
import { NextFunction } from "express";
|
|
2
|
+
import { ObjectId, Db } from "mongodb";
|
|
3
|
+
import { AnyObjectInterface } from "../modals/utility.modal";
|
|
4
|
+
import { OPT_Request } from "../modals/connection.modal";
|
|
5
|
+
import 'moment-timezone';
|
|
6
|
+
/**
|
|
7
|
+
* @param obj object contains data of task
|
|
8
|
+
* @param assignees - assignees object ids array
|
|
9
|
+
* @param userID user object id
|
|
10
|
+
* @param db db connection
|
|
11
|
+
* @param next next function
|
|
12
|
+
* @description Generating Next auto-increment number and return array for each assignee
|
|
13
|
+
*/
|
|
14
|
+
declare function GenerateTaskNumber(obj: AnyObjectInterface, assignees: ObjectId[], userID: ObjectId, db: Db, next: NextFunction): Promise<unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* @param req - request obj
|
|
17
|
+
* @param options object contains data of task
|
|
18
|
+
* @param db db connection
|
|
19
|
+
* @param event event passed from optimiser to send notifications
|
|
20
|
+
* @description initiates notifications to be send after action performed in Task
|
|
21
|
+
*/
|
|
22
|
+
declare function GenerateTaskNotifications(req: OPT_Request, options: any, db: Db, event: any): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* @param types contains notification type to be executed
|
|
25
|
+
* @param data - notification data
|
|
26
|
+
* @param req - request obj
|
|
27
|
+
* @param db db connection
|
|
28
|
+
* @param event event passed from optimiser to send notifications
|
|
29
|
+
* @description sends notifications
|
|
30
|
+
*/
|
|
31
|
+
declare function TriggerNotifications(types: any[] | undefined, data: AnyObjectInterface, req: OPT_Request, db: Db, event: any): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* @param info data of task
|
|
34
|
+
* @param req - request obj
|
|
35
|
+
* @param db db connection
|
|
36
|
+
* @param event event passed from optimiser to send notifications
|
|
37
|
+
* @description creates notification content
|
|
38
|
+
*/
|
|
39
|
+
declare function CreateNotificationContent(info: AnyObjectInterface, req: OPT_Request, db: Db, event: any): Promise<void>;
|
|
40
|
+
export { GenerateTaskNumber, GenerateTaskNotifications, TriggerNotifications, CreateNotificationContent };
|