@optimiser/common 1.0.248 → 1.0.252
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.js
CHANGED
|
@@ -158,7 +158,7 @@ var AwsServices = /** @class */ (function () {
|
|
|
158
158
|
case 2:
|
|
159
159
|
err_1 = _a.sent();
|
|
160
160
|
console.error("Error While Creating Signed Url:", err_1);
|
|
161
|
-
|
|
161
|
+
return [3 /*break*/, 3];
|
|
162
162
|
case 3: return [2 /*return*/];
|
|
163
163
|
}
|
|
164
164
|
});
|
|
@@ -264,6 +264,11 @@ var AwsServices = /** @class */ (function () {
|
|
|
264
264
|
};
|
|
265
265
|
AwsServices.prototype.GeneratePreSignedUrlNotAccelerated = function (params) {
|
|
266
266
|
var region = params.region, bucket = params.bucket, path = params.path, _a = params.expires, expires = _a === void 0 ? 60 : _a, _b = params.acl, acl = _b === void 0 ? 'private' : _b, _c = params.contentType, contentType = _c === void 0 ? 'application/octet-stream' : _c, _d = params.accessKeyId, accessKeyId = _d === void 0 ? this.accessKeyId : _d, _e = params.secretAccessKey, secretAccessKey = _e === void 0 ? this.secretAccessKey : _e;
|
|
267
|
+
// added by Mohan ason 28-01-2022. To overwrite acl variable.
|
|
268
|
+
// acl variable will have public-read OR private value. default is private
|
|
269
|
+
if (params.accessType != '' && params.accessType != undefined && params.accessType != null) {
|
|
270
|
+
acl = params.accessType;
|
|
271
|
+
}
|
|
267
272
|
var S3 = new aws_sdk_1.default.S3({
|
|
268
273
|
accessKeyId: accessKeyId,
|
|
269
274
|
secretAccessKey: secretAccessKey,
|
|
@@ -59,6 +59,42 @@ exports.MemoryDBConnect = void 0;
|
|
|
59
59
|
//var net = require('net');
|
|
60
60
|
var net = __importStar(require("net"));
|
|
61
61
|
var crypto = __importStar(require("crypto"));
|
|
62
|
+
var MessageBuffer = /** @class */ (function () {
|
|
63
|
+
function MessageBuffer(delimiter) {
|
|
64
|
+
this.delimiter = delimiter;
|
|
65
|
+
this.buffer = "";
|
|
66
|
+
}
|
|
67
|
+
MessageBuffer.prototype.isFinished = function () {
|
|
68
|
+
if (this.buffer.length === 0 ||
|
|
69
|
+
this.buffer.indexOf(this.delimiter) === -1) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
};
|
|
74
|
+
MessageBuffer.prototype.push = function (data) {
|
|
75
|
+
this.buffer += data;
|
|
76
|
+
};
|
|
77
|
+
MessageBuffer.prototype.getMessage = function () {
|
|
78
|
+
var delimiterIndex = this.buffer.indexOf(this.delimiter);
|
|
79
|
+
if (delimiterIndex !== -1) {
|
|
80
|
+
var message = this.buffer.slice(0, delimiterIndex);
|
|
81
|
+
this.buffer = this.buffer.replace(message + this.delimiter, "");
|
|
82
|
+
return message;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
};
|
|
86
|
+
MessageBuffer.prototype.handleData = function () {
|
|
87
|
+
/**
|
|
88
|
+
* Try to accumulate the buffer with messages
|
|
89
|
+
*
|
|
90
|
+
* If the server isnt sending delimiters for some reason
|
|
91
|
+
* then nothing will ever come back for these requests
|
|
92
|
+
*/
|
|
93
|
+
var message = this.getMessage();
|
|
94
|
+
return message;
|
|
95
|
+
};
|
|
96
|
+
return MessageBuffer;
|
|
97
|
+
}());
|
|
62
98
|
var MemoryDBConnect = /** @class */ (function () {
|
|
63
99
|
/**
|
|
64
100
|
* @param masterConfig Master Connectivity Object
|
|
@@ -71,6 +107,7 @@ var MemoryDBConnect = /** @class */ (function () {
|
|
|
71
107
|
this.host = "";
|
|
72
108
|
this.isConnected = false;
|
|
73
109
|
this.messages = {};
|
|
110
|
+
this.memBuffObj = new MessageBuffer("##message_response##");
|
|
74
111
|
this.portNo = portNumber;
|
|
75
112
|
this.host = hostName;
|
|
76
113
|
// this.Initialize().then(([error, result]) => {
|
|
@@ -99,13 +136,25 @@ var MemoryDBConnect = /** @class */ (function () {
|
|
|
99
136
|
_this.client.on('data', function (data) {
|
|
100
137
|
console.log("Data from MemServer", (data || "").toString());
|
|
101
138
|
//console.log("")
|
|
102
|
-
|
|
139
|
+
// let message = null;
|
|
103
140
|
try {
|
|
104
|
-
data = JSON.parse(data);
|
|
105
|
-
message =
|
|
106
|
-
if (message) {
|
|
107
|
-
|
|
108
|
-
|
|
141
|
+
// data = JSON.parse(data);
|
|
142
|
+
// message = this.messages[data.id];
|
|
143
|
+
// if (message) {
|
|
144
|
+
// delete this.messages[data.id];
|
|
145
|
+
// message(data);
|
|
146
|
+
// }
|
|
147
|
+
_this.memBuffObj.push(data);
|
|
148
|
+
while (!_this.memBuffObj.isFinished()) {
|
|
149
|
+
var message = _this.memBuffObj.handleData();
|
|
150
|
+
// console.log(message);
|
|
151
|
+
// console.log(JSON.parse(message))
|
|
152
|
+
if (message) {
|
|
153
|
+
message = JSON.parse(message);
|
|
154
|
+
var messageCallbackFn = _this.messages[message.id];
|
|
155
|
+
delete _this.messages[message.id];
|
|
156
|
+
messageCallbackFn(message);
|
|
157
|
+
}
|
|
109
158
|
}
|
|
110
159
|
}
|
|
111
160
|
catch (error) {
|
|
@@ -159,7 +208,7 @@ var MemoryDBConnect = /** @class */ (function () {
|
|
|
159
208
|
}
|
|
160
209
|
}, 60000);
|
|
161
210
|
if (_this.client && _this.isConnected) {
|
|
162
|
-
_this.client.write(JSON.stringify(message_1));
|
|
211
|
+
_this.client.write(JSON.stringify(message_1) + "##message##");
|
|
163
212
|
}
|
|
164
213
|
else {
|
|
165
214
|
//to avoid again resolve by set timeout
|
package/dist/lib/utility.js
CHANGED
|
@@ -257,7 +257,8 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
257
257
|
ExtraLookupFields: [
|
|
258
258
|
"UserStatus",
|
|
259
259
|
"IsAppUser"
|
|
260
|
-
]
|
|
260
|
+
],
|
|
261
|
+
OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"
|
|
261
262
|
}
|
|
262
263
|
};
|
|
263
264
|
createdDateObj = {
|
|
@@ -295,7 +296,8 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
295
296
|
ExtraLookupFields: [
|
|
296
297
|
"UserStatus",
|
|
297
298
|
"IsAppUser"
|
|
298
|
-
]
|
|
299
|
+
],
|
|
300
|
+
OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"
|
|
299
301
|
}
|
|
300
302
|
};
|
|
301
303
|
modDateObj = {
|
|
@@ -1695,8 +1697,10 @@ function CheckDataBeforeUpdate(updateObj, objectData, objectSchema, db) {
|
|
|
1695
1697
|
if (fieldSchema.UIDataType == 'multiselect' || fieldSchema.UIDataType == 'multilookup') {
|
|
1696
1698
|
isSame = IsEqualArrays(oldValue, newValue);
|
|
1697
1699
|
}
|
|
1698
|
-
else
|
|
1699
|
-
|
|
1700
|
+
else {
|
|
1701
|
+
if (fldName !== "ModifiedBy")
|
|
1702
|
+
isSame = IsEqualValue(oldValue, newValue);
|
|
1703
|
+
}
|
|
1700
1704
|
if (!isSame) return [3 /*break*/, 3];
|
|
1701
1705
|
delete updateObj[fldName];
|
|
1702
1706
|
return [3 /*break*/, 5];
|