cloud-ide-lms-model 1.0.121 → 1.0.124
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.
|
@@ -4,7 +4,7 @@ type ICoreSycrErrorLogger = {
|
|
|
4
4
|
[key in keyof ICoreSycr]: string;
|
|
5
5
|
};
|
|
6
6
|
interface entityInsertUpdateControllerResponse extends controllerResponse {
|
|
7
|
-
data?: ICoreSycr
|
|
7
|
+
data?: ICoreSycr;
|
|
8
8
|
}
|
|
9
9
|
export { ICoreSycrErrorLogger, //interface
|
|
10
10
|
entityInsertUpdateControllerResponse };
|
|
@@ -5,3 +5,5 @@ export declare const cidePath: {
|
|
|
5
5
|
join: (path: string[]) => string;
|
|
6
6
|
};
|
|
7
7
|
export declare const generateRandomAlphanumericString: (length: number) => string;
|
|
8
|
+
export declare const generateStringFromObject: (object: any) => string;
|
|
9
|
+
export declare const generateObjectFromString: (string: string) => any;
|
|
@@ -7,7 +7,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
7
7
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.generateRandomAlphanumericString = exports.cidePath = void 0;
|
|
10
|
+
exports.generateObjectFromString = exports.generateStringFromObject = exports.generateRandomAlphanumericString = exports.cidePath = void 0;
|
|
11
11
|
exports.stringInterpolation = stringInterpolation;
|
|
12
12
|
async function stringInterpolation(variables, body, data) {
|
|
13
13
|
/*
|
|
@@ -183,3 +183,23 @@ const generateRandomAlphanumericString = (length) => {
|
|
|
183
183
|
return result;
|
|
184
184
|
};
|
|
185
185
|
exports.generateRandomAlphanumericString = generateRandomAlphanumericString;
|
|
186
|
+
// method to generate string from object this should be encripted and decript json from string
|
|
187
|
+
const generateStringFromObject = (object) => {
|
|
188
|
+
let string = JSON.stringify(object);
|
|
189
|
+
// create won encription method
|
|
190
|
+
let encryptedString = "";
|
|
191
|
+
for (let i = 0; i < string.length; i++) {
|
|
192
|
+
encryptedString += String.fromCharCode(string.charCodeAt(i) + 1);
|
|
193
|
+
}
|
|
194
|
+
return encryptedString;
|
|
195
|
+
};
|
|
196
|
+
exports.generateStringFromObject = generateStringFromObject;
|
|
197
|
+
const generateObjectFromString = (string) => {
|
|
198
|
+
let decryptedString = "";
|
|
199
|
+
for (let i = 0; i < string.length; i++) {
|
|
200
|
+
decryptedString += String.fromCharCode(string.charCodeAt(i) - 1);
|
|
201
|
+
}
|
|
202
|
+
let object = JSON.parse(decryptedString);
|
|
203
|
+
return object;
|
|
204
|
+
};
|
|
205
|
+
exports.generateObjectFromString = generateObjectFromString;
|