lambdaorm-client-node
Advanced tools
Comparing version 0.7.26 to 0.7.27
@@ -60,3 +60,4 @@ import { ExpressionApi } from '../api'; | ||
executeQueued(expression: string, topic: string, data?: any, chunk?: number, options?: QueryOptions): Promise<any>; | ||
private toExpression; | ||
private solveOptions; | ||
} |
@@ -22,3 +22,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const _expression = typeof expression !== 'string' ? _3xpr_1.expressions.toExpression(expression) : expression; | ||
const _expression = typeof expression !== 'string' ? this.toExpression(expression) : expression; | ||
const result = yield this.expressionApi.model({ expression: _expression }); | ||
@@ -30,3 +30,3 @@ return result.data; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const _expression = typeof expression !== 'string' ? _3xpr_1.expressions.toExpression(expression) : expression; | ||
const _expression = typeof expression !== 'string' ? this.toExpression(expression) : expression; | ||
const result = yield this.expressionApi.parameters({ expression: _expression }); | ||
@@ -38,3 +38,3 @@ return result.data; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const _expression = typeof expression !== 'string' ? _3xpr_1.expressions.toExpression(expression) : expression; | ||
const _expression = typeof expression !== 'string' ? this.toExpression(expression) : expression; | ||
const result = yield this.expressionApi.constraints({ expression: _expression }); | ||
@@ -46,3 +46,3 @@ return result.data; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const _expression = typeof expression !== 'string' ? _3xpr_1.expressions.toExpression(expression) : expression; | ||
const _expression = typeof expression !== 'string' ? this.toExpression(expression) : expression; | ||
const result = yield this.expressionApi.metadata({ expression: _expression }); | ||
@@ -54,3 +54,3 @@ return result.data; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const _expression = typeof expression !== 'string' ? _3xpr_1.expressions.toExpression(expression) : expression; | ||
const _expression = typeof expression !== 'string' ? this.toExpression(expression) : expression; | ||
const _options = this.solveOptions(options); | ||
@@ -63,3 +63,3 @@ const result = yield this.expressionApi.plan({ expression: _expression, options: _options }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const _expression = typeof expression !== 'string' ? _3xpr_1.expressions.toExpression(expression) : expression; | ||
const _expression = typeof expression !== 'string' ? this.toExpression(expression) : expression; | ||
const _options = this.solveOptions(options); | ||
@@ -72,3 +72,3 @@ const result = yield this.expressionApi.execute({ expression: _expression, data, options: _options }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const _expression = typeof expression !== 'string' ? _3xpr_1.expressions.toExpression(expression) : expression; | ||
const _expression = typeof expression !== 'string' ? this.toExpression(expression) : expression; | ||
const _options = this.solveOptions(options); | ||
@@ -79,2 +79,5 @@ const result = yield this.expressionApi.executeQueued({ expression: _expression, data, options: _options, topic, chunk }); | ||
} | ||
toExpression(expression) { | ||
return typeof expression !== 'string' ? _3xpr_1.expressions.convert(expression, 'function')[0] : expression; | ||
} | ||
solveOptions(options) { | ||
@@ -81,0 +84,0 @@ if (!options) { |
@@ -43,3 +43,3 @@ "use strict"; | ||
} | ||
new __1.SentenceLibrary(_3xpr_1.expressions.model).load(); | ||
new __1.SentenceLibrary(_3xpr_1.expressions).load(); | ||
this.configuration = new domain_1.Configuration({ basePath: this.host }); | ||
@@ -46,0 +46,0 @@ this.expressionService = new ExpressionApiService_1.ExpressionApiService(new api_1.ExpressionApi(this.configuration)); |
@@ -1,7 +0,7 @@ | ||
import { IModelManager } from '3xpr'; | ||
import { Expressions } from '3xpr'; | ||
export declare class SentenceLibrary { | ||
private readonly model; | ||
constructor(model: IModelManager); | ||
private readonly expressions; | ||
constructor(expressions: Expressions); | ||
load(): void; | ||
private functions; | ||
} |
@@ -7,4 +7,4 @@ "use strict"; | ||
// eslint-disable-next-line no-useless-constructor | ||
constructor(model) { | ||
this.model = model; | ||
constructor(expressions) { | ||
this.expressions = expressions; | ||
} | ||
@@ -15,16 +15,16 @@ load() { | ||
functions() { | ||
this.model.addFunction('toBase64(value:string):string', (value) => CryptoJS.enc.Base64.parse(value)); | ||
this.model.addFunction('getBase64(value:string):string', (value) => CryptoJS.enc.Base64.stringify(value)); | ||
this.model.addFunction('encrypt(value:string):string', (value, key) => CryptoJS.AES.encrypt(value, key).toString()); | ||
this.model.addFunction('decrypt(value:string):string', (value, key) => { | ||
this.expressions.addFunction('toBase64(value:string):string', (value) => CryptoJS.enc.Base64.parse(value)); | ||
this.expressions.addFunction('getBase64(value:string):string', (value) => CryptoJS.enc.Base64.stringify(value)); | ||
this.expressions.addFunction('encrypt(value:string):string', (value, key) => CryptoJS.AES.encrypt(value, key).toString()); | ||
this.expressions.addFunction('decrypt(value:string):string', (value, key) => { | ||
const bytes = CryptoJS.AES.decrypt(value, key); | ||
return bytes.toString(CryptoJS.enc.Utf8); | ||
}); | ||
this.model.addFunction('update(list: any[], predicate: any):any', () => { throw new Error('NotImplemented'); }); | ||
this.model.addFunction('updateAll(list: any[], predicate: any):any', () => { throw new Error('NotImplemented'); }); | ||
this.model.addFunction('deleteAll(list: any[]):any', () => { throw new Error('NotImplemented'); }); | ||
this.model.addFunction('having(list: T[], predicate: boolean):T[]', () => { throw new Error('NotImplemented'); }); | ||
this.model.addFunction('include(list: any[], predicate: any):any', () => { throw new Error('NotImplemented'); }); | ||
this.model.addFunction('desc(value:any):void', () => { throw new Error('NotImplemented'); }); | ||
this.model.addFunction('asc(value:any):void', () => { throw new Error('NotImplemented'); }); | ||
this.expressions.addFunction('update(list: any[], predicate: any):any', () => { throw new Error('NotImplemented'); }); | ||
this.expressions.addFunction('updateAll(list: any[], predicate: any):any', () => { throw new Error('NotImplemented'); }); | ||
this.expressions.addFunction('deleteAll(list: any[]):any', () => { throw new Error('NotImplemented'); }); | ||
this.expressions.addFunction('having(list: T[], predicate: boolean):T[]', () => { throw new Error('NotImplemented'); }); | ||
this.expressions.addFunction('include(list: any[], predicate: any):any', () => { throw new Error('NotImplemented'); }); | ||
this.expressions.addFunction('desc(value:any):void', () => { throw new Error('NotImplemented'); }); | ||
this.expressions.addFunction('asc(value:any):void', () => { throw new Error('NotImplemented'); }); | ||
} | ||
@@ -31,0 +31,0 @@ } |
{ | ||
"name": "lambdaorm-client-node", | ||
"version": "0.7.26", | ||
"version": "0.7.27", | ||
"description": "Client form lambda ORM service", | ||
@@ -23,3 +23,3 @@ "author": "Flavio Lionel Rita <flaviolrita@gmail.com>", | ||
"dependencies": { | ||
"3xpr": "1.6.12", | ||
"3xpr": "1.12.18", | ||
"axios": "^1.6.2", | ||
@@ -26,0 +26,0 @@ "crypto-js": "^4.1.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
298748
5875
+ Added3xpr@1.12.18(transitive)
+ Addedtyp3s@0.1.0(transitive)
- Removed3xpr@1.6.12(transitive)
- Removedh3lp@1.2.3(transitive)
Updated3xpr@1.12.18