lambdaorm-client-node
Advanced tools
Comparing version 0.4.4 to 0.4.5
@@ -783,2 +783,39 @@ /** | ||
* @export | ||
* @interface QueryRequest | ||
*/ | ||
export interface QueryQueuedRequest { | ||
/** | ||
* | ||
* @type {QueryOptions} | ||
* @memberof QueryQueuedRequest | ||
*/ | ||
'options'?: QueryOptions; | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof QueryQueuedRequest | ||
*/ | ||
'expression': string; | ||
/** | ||
* | ||
* @type {any} | ||
* @memberof QueryQueuedRequest | ||
*/ | ||
'data'?: any; | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof QueryQueuedRequest | ||
*/ | ||
'topic': string; | ||
/** | ||
* | ||
* @type {number} | ||
* @memberof QueryQueuedRequest | ||
*/ | ||
'chunk'?: number; | ||
} | ||
/** | ||
* | ||
* @export | ||
* @interface QueryResponse | ||
@@ -1004,2 +1041,9 @@ */ | ||
/** | ||
* | ||
* @param {QueryRequest} queryRequest | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
executeQueued(queryQueuedRequest: QueryQueuedRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>>; | ||
/** | ||
* | ||
@@ -1106,2 +1150,10 @@ * @param {QueryRequest} [queryRequest] | ||
* | ||
* @param {QueryQueuedRequest} queryQueuedRequest | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof ExpressionApi | ||
*/ | ||
executeQueued(queryQueuedRequest: QueryQueuedRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<any, any>>; | ||
/** | ||
* | ||
* @param {QueryRequest} [queryRequest] | ||
@@ -1108,0 +1160,0 @@ * @param {*} [options] Override http request option. |
@@ -46,2 +46,11 @@ import { MetadataSentence, QueryOptions, Metadata, MetadataModel, MetadataConstraint, MetadataParameter } from './client'; | ||
execute(expression: string, data?: any, options?: QueryOptions): Promise<any>; | ||
/** | ||
* Execute expression | ||
* @param data Data with variables | ||
* @param stage Stage name | ||
* @param view View name | ||
* @returns Result of execution | ||
*/ | ||
executeQueued(expression: Function, topic: string, data?: any, chunk?: number, options?: QueryOptions): Promise<string>; | ||
executeQueued(expression: string, topic: string, data?: any, chunk?: number, options?: QueryOptions): Promise<string>; | ||
} |
@@ -14,2 +14,3 @@ import { MetadataSentence, MetadataParameter, MetadataModel, MetadataConstraint, Metadata } from '../client'; | ||
execute(expression: string, data: any): Promise<any>; | ||
executeQueued(expression: string, topic: string, data: any, chunk?: number): Promise<any>; | ||
} |
@@ -49,4 +49,9 @@ "use strict"; | ||
} | ||
executeQueued(expression, topic, data, chunk) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield this.orm.executeQueued(`${this.name}${expression}`, topic, data, chunk, { stage: this.stage }); | ||
}); | ||
} | ||
} | ||
exports.ExpressionActions = ExpressionActions; | ||
//# sourceMappingURL=expressionActions.js.map |
@@ -8,2 +8,3 @@ import { ExpressionActions } from './expressionActions'; | ||
execute(data: any): Promise<any>; | ||
executeQueued(topic: string, data: any, chunk?: number): Promise<any>; | ||
model(): Promise<MetadataModel[]>; | ||
@@ -10,0 +11,0 @@ constraints(): Promise<MetadataConstraint>; |
@@ -23,2 +23,7 @@ "use strict"; | ||
} | ||
executeQueued(topic, data, chunk) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield this.actions.executeQueued(this.expression, topic, data, chunk); | ||
}); | ||
} | ||
model() { | ||
@@ -25,0 +30,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -10,2 +10,3 @@ import { IOrmClient } from '../IOrm'; | ||
execute(expression: string, data?: any): Promise<any>; | ||
executeQueued(topic: string, expression: string, data?: any, chunk?: number): Promise<any>; | ||
/** */ | ||
@@ -12,0 +13,0 @@ insert(entity: TEntity): Promise<any>; |
@@ -39,2 +39,7 @@ "use strict"; | ||
} | ||
executeQueued(topic, expression, data, chunk) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield this.orm.executeQueued(`${this.name}${expression}`, topic, data, chunk, { stage: this.stage }); | ||
}); | ||
} | ||
insert(entity, include) { | ||
@@ -41,0 +46,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -62,3 +62,12 @@ import { IOrmClient } from './IOrm'; | ||
execute(expression: string, data?: any, options?: QueryOptions): Promise<any>; | ||
/** | ||
* Execute expression | ||
* @param expression query expression | ||
* @param data Data with variables | ||
* @param options options of execution | ||
* @returns Result of execution | ||
*/ | ||
executeQueued(expression: Function, topic: string, data?: any, chunk?: number, options?: QueryOptions): Promise<any>; | ||
executeQueued(expression: string, topic: string, data?: any, chunk?: number, options?: QueryOptions): Promise<any>; | ||
private solveOptions; | ||
} |
11
orm.js
@@ -109,2 +109,13 @@ "use strict"; | ||
} | ||
executeQueued(expression, topic, data = {}, chunk, options = undefined) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const _expression = typeof expression !== 'string' ? _3xpr_1.expressions.toExpression(expression) : expression; | ||
const _options = this.solveOptions(options); | ||
if (!this.expressionApi) { | ||
throw new Error('Orm not initialized'); | ||
} | ||
const result = yield this.expressionApi.executeQueued({ expression: _expression, data, options: _options, topic, chunk }); | ||
return result.data; | ||
}); | ||
} | ||
solveOptions(options) { | ||
@@ -111,0 +122,0 @@ if (!options) { |
{ | ||
"name": "lambdaorm-client-node", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"description": "ORM", | ||
@@ -5,0 +5,0 @@ "author": "Flavio Lionel Rita <flaviolrita@gmail.com>", |
Sorry, the diff of this file is too big to display
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
221750
4608