cloud-ide-lms-model 1.0.0 → 1.0.2

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.
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initialTableData = exports.MTableQueries = void 0;
4
- var MTableQueries = /** @class */ (function () {
5
- function MTableQueries(init) {
4
+ class MTableQueries {
5
+ constructor(init) {
6
6
  this.total = 1;
7
7
  this.pageIndex = 1;
8
8
  this.pageSize = 10;
@@ -13,9 +13,9 @@ var MTableQueries = /** @class */ (function () {
13
13
  };
14
14
  Object.assign(this, init);
15
15
  }
16
- MTableQueries.prototype.Validate = function () {
16
+ Validate() {
17
17
  var _a, _b, _c, _d, _e;
18
- var errorLogger = {};
18
+ let errorLogger = {};
19
19
  if (this.sort) {
20
20
  if (((_a = this.sort) === null || _a === void 0 ? void 0 : _a.order) != 'asc' && ((_b = this.sort) === null || _b === void 0 ? void 0 : _b.order) != 'desc' && ((_c = this.sort) === null || _c === void 0 ? void 0 : _c.order) != '') {
21
21
  errorLogger.sort = "Incorect Sort order!";
@@ -44,9 +44,8 @@ var MTableQueries = /** @class */ (function () {
44
44
  errorLogger.pageSize = "Page Size is required";
45
45
  }
46
46
  return errorLogger;
47
- };
48
- return MTableQueries;
49
- }());
47
+ }
48
+ }
50
49
  exports.MTableQueries = MTableQueries;
51
50
  exports.initialTableData = {
52
51
  total: 0,
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MForgotPassword = void 0;
4
4
  /* INTERFACE END */
5
5
  /* MODEL START */
6
- var MForgotPassword = /** @class */ (function () {
7
- function MForgotPassword(init) {
6
+ class MForgotPassword {
7
+ constructor(init) {
8
8
  Object.assign(this, init);
9
9
  }
10
- MForgotPassword.prototype.Validate = function () {
10
+ Validate() {
11
11
  var _a, _b, _c;
12
- var errorLogger = {};
12
+ let errorLogger = {};
13
13
  /* Check method set or not */
14
14
  if (!this.custom_forgot_password_method) {
15
15
  errorLogger.custom_forgot_password_method = "Forgot Password Method is Required!";
@@ -56,7 +56,6 @@ var MForgotPassword = /** @class */ (function () {
56
56
  }
57
57
  }
58
58
  return errorLogger;
59
- };
60
- return MForgotPassword;
61
- }());
59
+ }
60
+ }
62
61
  exports.MForgotPassword = MForgotPassword;
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MReLogin = exports.MLogin = void 0;
4
4
  /* INTERFACE END */
5
5
  /* MODEL START */
6
- var MLogin = /** @class */ (function () {
7
- function MLogin(init) {
6
+ class MLogin {
7
+ constructor(init) {
8
8
  Object.assign(this, init);
9
9
  }
10
- MLogin.prototype.Validate = function () {
10
+ Validate() {
11
11
  var _a, _b;
12
- var errorLogger = {};
12
+ let errorLogger = {};
13
13
  if (!this.user_username) {
14
14
  errorLogger.user_username = "Username is Required";
15
15
  }
@@ -50,19 +50,18 @@ var MLogin = /** @class */ (function () {
50
50
  }
51
51
  }
52
52
  return errorLogger;
53
- };
54
- return MLogin;
55
- }());
53
+ }
54
+ }
56
55
  exports.MLogin = MLogin;
57
56
  /* INTERFACE END */
58
57
  /* MODEL START */
59
- var MReLogin = /** @class */ (function () {
60
- function MReLogin(init) {
58
+ class MReLogin {
59
+ constructor(init) {
61
60
  Object.assign(this, init);
62
61
  }
63
- MReLogin.prototype.Validate = function () {
62
+ Validate() {
64
63
  var _a, _b;
65
- var errorLogger = {};
64
+ let errorLogger = {};
66
65
  if (!this.token) {
67
66
  errorLogger.token = "Token is Required";
68
67
  }
@@ -103,7 +102,6 @@ var MReLogin = /** @class */ (function () {
103
102
  }
104
103
  }
105
104
  return errorLogger;
106
- };
107
- return MReLogin;
108
- }());
105
+ }
106
+ }
109
107
  exports.MReLogin = MReLogin;
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MRegister = void 0;
4
4
  /* INTERFACE END */
5
5
  /* MODEL START */
6
- var MRegister = /** @class */ (function () {
7
- function MRegister(init) {
6
+ class MRegister {
7
+ constructor(init) {
8
8
  Object.assign(this, init);
9
9
  }
10
- MRegister.prototype.Validate = function () {
10
+ Validate() {
11
11
  var _a, _b;
12
- var errorLogger = [];
12
+ let errorLogger = [];
13
13
  if (!this.user_username) {
14
14
  errorLogger.push({
15
15
  control: "user_username",
@@ -27,7 +27,6 @@ var MRegister = /** @class */ (function () {
27
27
  }
28
28
  }
29
29
  return errorLogger;
30
- };
31
- return MRegister;
32
- }());
30
+ }
31
+ }
33
32
  exports.MRegister = MRegister;
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MResetPassword = void 0;
4
4
  /* INTERFACE END */
5
5
  /* MODEL START */
6
- var MResetPassword = /** @class */ (function () {
7
- function MResetPassword(init) {
6
+ class MResetPassword {
7
+ constructor(init) {
8
8
  Object.assign(this, init);
9
9
  }
10
- MResetPassword.prototype.Validate = function () {
11
- var errorLogger = {};
10
+ Validate() {
11
+ let errorLogger = {};
12
12
  if (!this.sylog_config_data) {
13
13
  errorLogger.sylog_config_data = "Configuration Data is Required!";
14
14
  }
@@ -16,7 +16,6 @@ var MResetPassword = /** @class */ (function () {
16
16
  errorLogger.user_password = "Password is Required!";
17
17
  }
18
18
  return errorLogger;
19
- };
20
- return MResetPassword;
21
- }());
19
+ }
20
+ }
22
21
  exports.MResetPassword = MResetPassword;
@@ -3,17 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MDesignConfig = void 0;
4
4
  /* INTERFACE END */
5
5
  /* MODEL START */
6
- var MDesignConfig = /** @class */ (function () {
7
- function MDesignConfig(init) {
6
+ class MDesignConfig {
7
+ constructor(init) {
8
8
  Object.assign(this, init);
9
9
  }
10
- MDesignConfig.prototype.Validate = function () {
11
- var errorLogger = {};
10
+ Validate() {
11
+ let errorLogger = {};
12
12
  if (!this.sypg_page_code) {
13
13
  errorLogger.sypg_page_code = "Page Code is Required!";
14
14
  }
15
15
  return errorLogger;
16
- };
17
- return MDesignConfig;
18
- }());
16
+ }
17
+ }
19
18
  exports.MDesignConfig = MDesignConfig;
@@ -1,35 +1,17 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.MEntity = void 0;
19
- var common_1 = require("../../common-types/common");
4
+ const common_1 = require("../../common-types/common");
20
5
  /* INTERFACE END */
21
6
  /* MODEL START */
22
- var MEntity = /** @class */ (function (_super) {
23
- __extends(MEntity, _super);
24
- function MEntity(init) {
25
- var _this = _super.call(this, init) || this;
26
- Object.assign(_this, init);
27
- return _this;
7
+ class MEntity extends common_1.MTableQueries {
8
+ constructor(init) {
9
+ super(init);
10
+ Object.assign(this, init);
28
11
  }
29
- MEntity.prototype.Validate = function () {
30
- var errorLogger = {};
12
+ Validate() {
13
+ let errorLogger = {};
31
14
  return errorLogger;
32
- };
33
- return MEntity;
34
- }(common_1.MTableQueries));
15
+ }
16
+ }
35
17
  exports.MEntity = MEntity;
@@ -3,17 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MGeneralMasterSelect = void 0;
4
4
  /* INTERFACE END */
5
5
  /* MODEL START */
6
- var MGeneralMasterSelect = /** @class */ (function () {
7
- function MGeneralMasterSelect(init) {
6
+ class MGeneralMasterSelect {
7
+ constructor(init) {
8
8
  Object.assign(this, init);
9
9
  }
10
- MGeneralMasterSelect.prototype.Validate = function () {
11
- var errorLogger = {};
10
+ Validate() {
11
+ let errorLogger = {};
12
12
  if (!this.sygmt_code) {
13
13
  errorLogger.sygmt_code = "Master Type is required";
14
14
  }
15
15
  return errorLogger;
16
- };
17
- return MGeneralMasterSelect;
18
- }());
16
+ }
17
+ }
19
18
  exports.MGeneralMasterSelect = MGeneralMasterSelect;
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MMenu = void 0;
4
4
  /* INTERFACE END */
5
5
  /* MODEL START */
6
- var MMenu = /** @class */ (function () {
7
- function MMenu(init) {
6
+ class MMenu {
7
+ constructor(init) {
8
8
  Object.assign(this, init);
9
9
  }
10
- MMenu.prototype.Validate = function () {
11
- var errorLogger = {};
10
+ Validate() {
11
+ let errorLogger = {};
12
12
  if (!this.syme_id) {
13
13
  errorLogger.syme_id = "System menu ID is Required!";
14
14
  }
@@ -25,7 +25,6 @@ var MMenu = /** @class */ (function () {
25
25
  }
26
26
  }
27
27
  return errorLogger;
28
- };
29
- return MMenu;
30
- }());
28
+ }
29
+ }
31
30
  exports.MMenu = MMenu;
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MPinCodeSelect = void 0;
4
4
  /* INTERFACE END */
5
5
  /* MODEL START */
6
- var MPinCodeSelect = /** @class */ (function () {
7
- function MPinCodeSelect(init) {
6
+ class MPinCodeSelect {
7
+ constructor(init) {
8
8
  Object.assign(this, init);
9
9
  }
10
- MPinCodeSelect.prototype.Validate = function () {
10
+ Validate() {
11
11
  var _a;
12
- var errorLogger = {};
12
+ let errorLogger = {};
13
13
  if (!this.sypin_pincode) {
14
14
  errorLogger.sypin_pincode = "Pin Code is Required!";
15
15
  }
@@ -22,7 +22,6 @@ var MPinCodeSelect = /** @class */ (function () {
22
22
  }
23
23
  }
24
24
  return errorLogger;
25
- };
26
- return MPinCodeSelect;
27
- }());
25
+ }
26
+ }
28
27
  exports.MPinCodeSelect = MPinCodeSelect;
@@ -3,17 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MUserSelect = void 0;
4
4
  /* INTERFACE END */
5
5
  /* MODEL START */
6
- var MUserSelect = /** @class */ (function () {
7
- function MUserSelect(init) {
6
+ class MUserSelect {
7
+ constructor(init) {
8
8
  Object.assign(this, init);
9
9
  }
10
- MUserSelect.prototype.Validate = function () {
11
- var errorLogger = {};
10
+ Validate() {
11
+ let errorLogger = {};
12
12
  if (!this.user_fullname) {
13
13
  errorLogger.user_fullname = "Name of user is Required!";
14
14
  }
15
15
  return errorLogger;
16
- };
17
- return MUserSelect;
18
- }());
16
+ }
17
+ }
19
18
  exports.MUserSelect = MUserSelect;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IMpin = void 0;
4
4
  /* INTERFASE START */
5
- var IMpin = /** @class */ (function () {
6
- function IMpin() {
7
- }
8
- return IMpin;
9
- }());
5
+ class IMpin {
6
+ }
10
7
  exports.IMpin = IMpin;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ICoreSyco = void 0;
4
4
  /* INTERFASE START */
5
- var ICoreSyco = /** @class */ (function () {
6
- function ICoreSyco() {
7
- }
8
- return ICoreSyco;
9
- }());
5
+ class ICoreSyco {
6
+ }
10
7
  exports.ICoreSyco = ICoreSyco;
@@ -2,11 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ICoreSylog = void 0;
4
4
  /* INTERFASE START */
5
- var ICoreSylog = /** @class */ (function () {
6
- function ICoreSylog() {
7
- }
8
- return ICoreSylog;
9
- }());
5
+ class ICoreSylog {
6
+ }
10
7
  exports.ICoreSylog = ICoreSylog;
11
8
  /*
12
9
  || EXAMPLE for TRACE log type
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ICoreSyme = void 0;
4
4
  /* INTERFASE START */
5
- var ICoreSyme = /** @class */ (function () {
6
- function ICoreSyme() {
7
- }
8
- return ICoreSyme;
9
- }());
5
+ class ICoreSyme {
6
+ }
10
7
  exports.ICoreSyme = ICoreSyme;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ICoreSypg = void 0;
4
4
  /* INTERFASE START */
5
- var ICoreSypg = /** @class */ (function () {
6
- function ICoreSypg() {
7
- }
8
- return ICoreSypg;
9
- }());
5
+ class ICoreSypg {
6
+ }
10
7
  exports.ICoreSypg = ICoreSypg;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ICoreSytm = void 0;
4
4
  /* INTERFASE START */
5
- var ICoreSytm = /** @class */ (function () {
6
- function ICoreSytm() {
7
- }
8
- return ICoreSytm;
9
- }());
5
+ class ICoreSytm {
6
+ }
10
7
  exports.ICoreSytm = ICoreSytm;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IEmailList = void 0;
4
4
  /* INTERFASE START */
5
- var IEmailList = /** @class */ (function () {
6
- function IEmailList() {
7
- }
8
- return IEmailList;
9
- }());
5
+ class IEmailList {
6
+ }
10
7
  exports.IEmailList = IEmailList;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IEmailLog = void 0;
4
4
  /* INTERFASE START */
5
- var IEmailLog = /** @class */ (function () {
6
- function IEmailLog() {
7
- }
8
- return IEmailLog;
9
- }());
5
+ class IEmailLog {
6
+ }
10
7
  exports.IEmailLog = IEmailLog;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IEmailReference = void 0;
4
4
  /* INTERFASE START */
5
- var IEmailReference = /** @class */ (function () {
6
- function IEmailReference() {
7
- }
8
- return IEmailReference;
9
- }());
5
+ class IEmailReference {
6
+ }
10
7
  exports.IEmailReference = IEmailReference;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IEmailVendorSubscription = void 0;
4
4
  /* INTERFASE START */
5
- var IEmailVendorSubscription = /** @class */ (function () {
6
- function IEmailVendorSubscription() {
7
- }
8
- return IEmailVendorSubscription;
9
- }());
5
+ class IEmailVendorSubscription {
6
+ }
10
7
  exports.IEmailVendorSubscription = IEmailVendorSubscription;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IEmailTemplete = void 0;
4
4
  /* INTERFASE START */
5
- var IEmailTemplete = /** @class */ (function () {
6
- function IEmailTemplete() {
7
- }
8
- return IEmailTemplete;
9
- }());
5
+ class IEmailTemplete {
6
+ }
10
7
  exports.IEmailTemplete = IEmailTemplete;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IEmailVendor = void 0;
4
4
  /* INTERFASE START */
5
- var IEmailVendor = /** @class */ (function () {
6
- function IEmailVendor() {
7
- }
8
- return IEmailVendor;
9
- }());
5
+ class IEmailVendor {
6
+ }
10
7
  exports.IEmailVendor = IEmailVendor;
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.customDecrypt = void 0;
4
4
  // Custom decryption function
5
5
  function customDecrypt(encryptedPassword) {
6
- var decryptedPassword = '';
7
- for (var i = 0; i < encryptedPassword.length; i++) {
6
+ let decryptedPassword = '';
7
+ for (let i = 0; i < encryptedPassword.length; i++) {
8
8
  // Shift ASCII value of each character back by the same amount
9
- var decryptedCharCode = encryptedPassword.charCodeAt(i) - 1; // Shift back by 1
9
+ const decryptedCharCode = encryptedPassword.charCodeAt(i) - 1; // Shift back by 1
10
10
  decryptedPassword += String.fromCharCode(decryptedCharCode);
11
11
  }
12
12
  return decryptedPassword;
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ErrorLoggerResponseHelper = exports.errorLoggerResponse = exports.MErrorLoggerHelper = exports.errorLoggerRegister = void 0;
4
- var MErrorLoggerHelper = /** @class */ (function () {
5
- function MErrorLoggerHelper() {
6
- }
7
- return MErrorLoggerHelper;
8
- }());
4
+ class MErrorLoggerHelper {
5
+ }
9
6
  exports.MErrorLoggerHelper = MErrorLoggerHelper;
10
- var ErrorLoggerResponseHelper = /** @class */ (function () {
11
- function ErrorLoggerResponseHelper() {
7
+ class ErrorLoggerResponseHelper {
8
+ constructor() {
12
9
  this.errorLogged = {};
13
10
  }
14
- return ErrorLoggerResponseHelper;
15
- }());
11
+ }
16
12
  exports.ErrorLoggerResponseHelper = ErrorLoggerResponseHelper;
17
13
  function errorLoggerRegister(errorLoggerRegister) {
18
14
  }
@@ -6,7 +6,7 @@ interface controllerResponse {
6
6
  message?: string;
7
7
  data?: any;
8
8
  code?: statusCode;
9
- details?: string;
9
+ action?: string;
10
10
  total?: number;
11
11
  pageIndex?: number;
12
12
  pageSize?: number;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultControllerResponse = void 0;
4
- var defaultControllerResponse = {
4
+ const defaultControllerResponse = {
5
5
  success: true,
6
6
  code: 200,
7
7
  message: "Welcome to Cloud IDE!"
@@ -8,33 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
11
  var __asyncValues = (this && this.__asyncValues) || function (o) {
39
12
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
40
13
  var m = o[Symbol.asyncIterator], i;
@@ -45,188 +18,163 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
45
18
  Object.defineProperty(exports, "__esModule", { value: true });
46
19
  exports.stringInterpolation = void 0;
47
20
  function stringInterpolation(variables, body, data) {
48
- return __awaiter(this, void 0, void 0, function () {
49
- var bodyArray, replacedBody, _a, bodyArray_1, bodyArray_1_1, body_row, body_row_init, row_count, variable_array, spilited_variable_array, i, _b, body_row_init_1, body_row_init_1_1, body_row_init_row, replacedRow, index, row_array, _c, row_array_1, row_array_1_1, row_splited, updated_row, row_data, variable, variable_array_index, array_data_path, array_data_path, e_1_1, e_2_1, e_3_1;
50
- var _d, e_3, _e, _f, _g, e_2, _h, _j, _k, e_1, _l, _m;
51
- var _o, _p, _q;
52
- return __generator(this, function (_r) {
53
- switch (_r.label) {
54
- case 0:
55
- bodyArray = body.split("//");
56
- replacedBody = [];
57
- _r.label = 1;
58
- case 1:
59
- _r.trys.push([1, 29, 30, 35]);
60
- _a = true, bodyArray_1 = __asyncValues(bodyArray);
61
- _r.label = 2;
62
- case 2: return [4 /*yield*/, bodyArray_1.next()];
63
- case 3:
64
- if (!(bodyArray_1_1 = _r.sent(), _d = bodyArray_1_1.done, !_d)) return [3 /*break*/, 28];
65
- _f = bodyArray_1_1.value;
66
- _a = false;
67
- body_row = _f;
68
- body_row_init = [body_row];
69
- if (body_row.includes('[')) {
70
- body_row_init = [];
71
- row_count = 0;
72
- variable_array = body_row.slice(1, (body_row === null || body_row === void 0 ? void 0 : body_row.indexOf(']')));
73
- if (variable_array === null || variable_array === void 0 ? void 0 : variable_array.includes("-")) {
74
- spilited_variable_array = variable_array === null || variable_array === void 0 ? void 0 : variable_array.split("-");
75
- if ((spilited_variable_array === null || spilited_variable_array === void 0 ? void 0 : spilited_variable_array.length) == 2) {
76
- row_count = (_o = data[spilited_variable_array[0]][spilited_variable_array[1]]) === null || _o === void 0 ? void 0 : _o.length;
77
- }
78
- }
79
- else {
80
- row_count = (_p = data[variable_array]) === null || _p === void 0 ? void 0 : _p.length;
81
- }
82
- for (i = 0; i < row_count; i++) {
83
- body_row_init.push("[" + i + "]" + body_row.slice(((body_row === null || body_row === void 0 ? void 0 : body_row.indexOf(']')) + 1)));
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ /*
23
+ const placeholders = {
24
+ 'status': 'user.status',
25
+ 'userName': 'user.name',
26
+ 'userFullName': 'user.fullName',
27
+ 'entityName': 'entity.name',
28
+ 'entityLoginTime': 'entity.data~login',
29
+ 'entityAddress': 'entity.address.city',
30
+ };
31
+
32
+
33
+ const data = {
34
+ user: {
35
+ status: 'active',
36
+ name: 'John Doe',
37
+ fullName: 'John Doe Jr.',
38
+ },
39
+ entity: {
40
+ name: 'Acme Corp',
41
+ data: [
42
+ { login: '2 days ago' },
43
+ { login: '3 days ago' },
44
+ ],
45
+ address: {
46
+ city: 'Metropolis',
47
+ },
48
+ },
49
+ };
50
+
51
+
52
+ const template = 'Hello, {userName}! Your status is {status}. Full name is {userFullName}.' +
53
+ '[entity-data] This is the row for login time: {entityLoginTime}. [/entity-data]' +
54
+ 'Your entity is {entityName}. The city is {entityAddress}.';
55
+
56
+ */
57
+ var _a, e_1, _b, _c, _d, e_2, _e, _f, _g, e_3, _h, _j;
58
+ var _k, _l, _m;
59
+ let bodyArray = body.split("//");
60
+ let replacedBody = [];
61
+ try {
62
+ for (var _o = true, bodyArray_1 = __asyncValues(bodyArray), bodyArray_1_1; bodyArray_1_1 = yield bodyArray_1.next(), _a = bodyArray_1_1.done, !_a; _o = true) {
63
+ _c = bodyArray_1_1.value;
64
+ _o = false;
65
+ const body_row = _c;
66
+ let body_row_init = [body_row];
67
+ if (body_row.includes('[')) {
68
+ body_row_init = [];
69
+ let row_count = 0;
70
+ let variable_array = body_row.slice(1, (body_row === null || body_row === void 0 ? void 0 : body_row.indexOf(']')));
71
+ if (variable_array === null || variable_array === void 0 ? void 0 : variable_array.includes("-")) {
72
+ let spilited_variable_array = variable_array === null || variable_array === void 0 ? void 0 : variable_array.split("-");
73
+ if ((spilited_variable_array === null || spilited_variable_array === void 0 ? void 0 : spilited_variable_array.length) == 2) {
74
+ row_count = (_k = data[spilited_variable_array[0]][spilited_variable_array[1]]) === null || _k === void 0 ? void 0 : _k.length;
84
75
  }
85
76
  }
86
- _r.label = 4;
87
- case 4:
88
- _r.trys.push([4, 21, 22, 27]);
89
- _b = true, body_row_init_1 = (e_2 = void 0, __asyncValues(body_row_init));
90
- _r.label = 5;
91
- case 5: return [4 /*yield*/, body_row_init_1.next()];
92
- case 6:
93
- if (!(body_row_init_1_1 = _r.sent(), _g = body_row_init_1_1.done, !_g)) return [3 /*break*/, 20];
94
- _j = body_row_init_1_1.value;
95
- _b = false;
96
- body_row_init_row = _j;
97
- replacedRow = [];
98
- index = 0;
99
- if (body_row_init_row === null || body_row_init_row === void 0 ? void 0 : body_row_init_row.includes("[")) {
100
- index = parseInt(body_row_init_row === null || body_row_init_row === void 0 ? void 0 : body_row_init_row.slice(1, ((body_row_init_row === null || body_row_init_row === void 0 ? void 0 : body_row_init_row.indexOf(']')) + 1)));
101
- body_row_init_row = body_row_init_row === null || body_row_init_row === void 0 ? void 0 : body_row_init_row.slice((body_row_init_row === null || body_row_init_row === void 0 ? void 0 : body_row_init_row.indexOf(']')) + 1);
77
+ else {
78
+ row_count = (_l = data[variable_array]) === null || _l === void 0 ? void 0 : _l.length;
102
79
  }
103
- row_array = body_row_init_row.split("\\");
104
- _r.label = 7;
105
- case 7:
106
- _r.trys.push([7, 12, 13, 18]);
107
- _c = true, row_array_1 = (e_1 = void 0, __asyncValues(row_array));
108
- _r.label = 8;
109
- case 8: return [4 /*yield*/, row_array_1.next()];
110
- case 9:
111
- if (!(row_array_1_1 = _r.sent(), _k = row_array_1_1.done, !_k)) return [3 /*break*/, 11];
112
- _m = row_array_1_1.value;
113
- _c = false;
114
- row_splited = _m;
115
- updated_row = row_splited;
116
- if ((updated_row === null || updated_row === void 0 ? void 0 : updated_row.length) > 2) {
117
- row_data = data;
118
- if (updated_row[0] == "{" && updated_row[(updated_row === null || updated_row === void 0 ? void 0 : updated_row.length) - 1] == "}") {
119
- variable = variables[updated_row.slice(1, ((updated_row === null || updated_row === void 0 ? void 0 : updated_row.length) - 1))];
120
- if (variable === null || variable === void 0 ? void 0 : variable.includes("~")) {
121
- variable_array_index = variable === null || variable === void 0 ? void 0 : variable.split("~");
122
- if ((_q = variable_array_index[0]) === null || _q === void 0 ? void 0 : _q.includes("-")) {
123
- array_data_path = variable_array_index[0].split("-");
124
- if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 2) {
125
- row_data = row_data[array_data_path[0]][array_data_path[1]][index];
126
- }
127
- if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 3) {
128
- row_data = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]][index];
129
- }
130
- if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 4) {
131
- row_data = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]][array_data_path[3]][index];
132
- }
133
- if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 5) {
134
- row_data = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]][array_data_path[3]][array_data_path[4]][index];
80
+ for (let i = 0; i < row_count; i++) {
81
+ body_row_init.push("[" + i + "]" + body_row.slice(((body_row === null || body_row === void 0 ? void 0 : body_row.indexOf(']')) + 1)));
82
+ }
83
+ }
84
+ try {
85
+ for (var _p = true, body_row_init_1 = (e_2 = void 0, __asyncValues(body_row_init)), body_row_init_1_1; body_row_init_1_1 = yield body_row_init_1.next(), _d = body_row_init_1_1.done, !_d; _p = true) {
86
+ _f = body_row_init_1_1.value;
87
+ _p = false;
88
+ let body_row_init_row = _f;
89
+ let replacedRow = [];
90
+ let index = 0;
91
+ if (body_row_init_row === null || body_row_init_row === void 0 ? void 0 : body_row_init_row.includes("[")) {
92
+ index = parseInt(body_row_init_row === null || body_row_init_row === void 0 ? void 0 : body_row_init_row.slice(1, ((body_row_init_row === null || body_row_init_row === void 0 ? void 0 : body_row_init_row.indexOf(']')) + 1)));
93
+ body_row_init_row = body_row_init_row === null || body_row_init_row === void 0 ? void 0 : body_row_init_row.slice((body_row_init_row === null || body_row_init_row === void 0 ? void 0 : body_row_init_row.indexOf(']')) + 1);
94
+ }
95
+ let row_array = body_row_init_row.split("\\");
96
+ try {
97
+ for (var _q = true, row_array_1 = (e_3 = void 0, __asyncValues(row_array)), row_array_1_1; row_array_1_1 = yield row_array_1.next(), _g = row_array_1_1.done, !_g; _q = true) {
98
+ _j = row_array_1_1.value;
99
+ _q = false;
100
+ const row_splited = _j;
101
+ let updated_row = row_splited;
102
+ if ((updated_row === null || updated_row === void 0 ? void 0 : updated_row.length) > 2) {
103
+ let row_data = data;
104
+ if (updated_row[0] == "{" && updated_row[(updated_row === null || updated_row === void 0 ? void 0 : updated_row.length) - 1] == "}") {
105
+ let variable = variables[updated_row.slice(1, ((updated_row === null || updated_row === void 0 ? void 0 : updated_row.length) - 1))];
106
+ if (variable === null || variable === void 0 ? void 0 : variable.includes("~")) {
107
+ let variable_array_index = variable === null || variable === void 0 ? void 0 : variable.split("~");
108
+ if ((_m = variable_array_index[0]) === null || _m === void 0 ? void 0 : _m.includes("-")) {
109
+ let array_data_path = variable_array_index[0].split("-");
110
+ if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 2) {
111
+ row_data = row_data[array_data_path[0]][array_data_path[1]][index];
112
+ }
113
+ if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 3) {
114
+ row_data = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]][index];
115
+ }
116
+ if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 4) {
117
+ row_data = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]][array_data_path[3]][index];
118
+ }
119
+ if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 5) {
120
+ row_data = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]][array_data_path[3]][array_data_path[4]][index];
121
+ }
122
+ }
123
+ else {
124
+ row_data = row_data[variable];
125
+ }
126
+ variable = variable_array_index[1];
127
+ }
128
+ if (variable === null || variable === void 0 ? void 0 : variable.includes("-")) {
129
+ let array_data_path = variable.split("-");
130
+ if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 2) {
131
+ updated_row = row_data[array_data_path[0]][array_data_path[1]];
132
+ }
133
+ if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 3) {
134
+ updated_row = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]];
135
+ }
136
+ if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 4) {
137
+ updated_row = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]][array_data_path[3]];
138
+ }
139
+ if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 5) {
140
+ updated_row = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]][array_data_path[3]][array_data_path[4]];
141
+ }
142
+ }
143
+ else {
144
+ updated_row = row_data[variable];
145
+ }
135
146
  }
136
147
  }
137
- else {
138
- row_data = row_data[variable];
139
- }
140
- variable = variable_array_index[1];
148
+ replacedRow.push(updated_row);
141
149
  }
142
- if (variable === null || variable === void 0 ? void 0 : variable.includes("-")) {
143
- array_data_path = variable.split("-");
144
- if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 2) {
145
- updated_row = row_data[array_data_path[0]][array_data_path[1]];
146
- }
147
- if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 3) {
148
- updated_row = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]];
149
- }
150
- if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 4) {
151
- updated_row = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]][array_data_path[3]];
152
- }
153
- if ((array_data_path === null || array_data_path === void 0 ? void 0 : array_data_path.length) == 5) {
154
- updated_row = row_data[array_data_path[0]][array_data_path[1]][array_data_path[2]][array_data_path[3]][array_data_path[4]];
155
- }
156
- }
157
- else {
158
- updated_row = row_data[variable];
150
+ }
151
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
152
+ finally {
153
+ try {
154
+ if (!_q && !_g && (_h = row_array_1.return)) yield _h.call(row_array_1);
159
155
  }
156
+ finally { if (e_3) throw e_3.error; }
160
157
  }
158
+ replacedBody.push(replacedRow === null || replacedRow === void 0 ? void 0 : replacedRow.join(""));
161
159
  }
162
- replacedRow.push(updated_row);
163
- _r.label = 10;
164
- case 10:
165
- _c = true;
166
- return [3 /*break*/, 8];
167
- case 11: return [3 /*break*/, 18];
168
- case 12:
169
- e_1_1 = _r.sent();
170
- e_1 = { error: e_1_1 };
171
- return [3 /*break*/, 18];
172
- case 13:
173
- _r.trys.push([13, , 16, 17]);
174
- if (!(!_c && !_k && (_l = row_array_1.return))) return [3 /*break*/, 15];
175
- return [4 /*yield*/, _l.call(row_array_1)];
176
- case 14:
177
- _r.sent();
178
- _r.label = 15;
179
- case 15: return [3 /*break*/, 17];
180
- case 16:
181
- if (e_1) throw e_1.error;
182
- return [7 /*endfinally*/];
183
- case 17: return [7 /*endfinally*/];
184
- case 18:
185
- replacedBody.push(replacedRow === null || replacedRow === void 0 ? void 0 : replacedRow.join(""));
186
- _r.label = 19;
187
- case 19:
188
- _b = true;
189
- return [3 /*break*/, 5];
190
- case 20: return [3 /*break*/, 27];
191
- case 21:
192
- e_2_1 = _r.sent();
193
- e_2 = { error: e_2_1 };
194
- return [3 /*break*/, 27];
195
- case 22:
196
- _r.trys.push([22, , 25, 26]);
197
- if (!(!_b && !_g && (_h = body_row_init_1.return))) return [3 /*break*/, 24];
198
- return [4 /*yield*/, _h.call(body_row_init_1)];
199
- case 23:
200
- _r.sent();
201
- _r.label = 24;
202
- case 24: return [3 /*break*/, 26];
203
- case 25:
204
- if (e_2) throw e_2.error;
205
- return [7 /*endfinally*/];
206
- case 26: return [7 /*endfinally*/];
207
- case 27:
208
- _a = true;
209
- return [3 /*break*/, 2];
210
- case 28: return [3 /*break*/, 35];
211
- case 29:
212
- e_3_1 = _r.sent();
213
- e_3 = { error: e_3_1 };
214
- return [3 /*break*/, 35];
215
- case 30:
216
- _r.trys.push([30, , 33, 34]);
217
- if (!(!_a && !_d && (_e = bodyArray_1.return))) return [3 /*break*/, 32];
218
- return [4 /*yield*/, _e.call(bodyArray_1)];
219
- case 31:
220
- _r.sent();
221
- _r.label = 32;
222
- case 32: return [3 /*break*/, 34];
223
- case 33:
224
- if (e_3) throw e_3.error;
225
- return [7 /*endfinally*/];
226
- case 34: return [7 /*endfinally*/];
227
- case 35: return [2 /*return*/, replacedBody.join("")];
160
+ }
161
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
162
+ finally {
163
+ try {
164
+ if (!_p && !_d && (_e = body_row_init_1.return)) yield _e.call(body_row_init_1);
165
+ }
166
+ finally { if (e_2) throw e_2.error; }
167
+ }
168
+ }
169
+ }
170
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
171
+ finally {
172
+ try {
173
+ if (!_o && !_a && (_b = bodyArray_1.return)) yield _b.call(bodyArray_1);
228
174
  }
229
- });
175
+ finally { if (e_1) throw e_1.error; }
176
+ }
177
+ return replacedBody.join("");
230
178
  });
231
179
  }
232
180
  exports.stringInterpolation = stringInterpolation;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "typescript": "^5.4.2"
6
6
  },
7
7
  "name": "cloud-ide-lms-model",
8
- "version": "1.0.0",
8
+ "version": "1.0.2",
9
9
  "description": "Package for Model management of Cloud IDEsys LMS",
10
10
  "main": "lib/index.js",
11
11
  "types": "lib/index.d.ts",