diff --git a/src/index.ts b/src/index.ts index 0ed1f0c..50cf253 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,12 +32,12 @@ export class Transformer { // console.log(`WE DONT DO THE OP ${api}, ${this.data.edge.query_operation}`) // } - if (this.data.edge.query_operation?.transformer?.pair_jq || this.data.edge.query_operation?.transformer?.wrap_jq) { + if (this.data.edge.query_operation?.transformer?.jq) { // console.log("WE DO THE OP", this.data.edge.query_operation.transformer) this.tf = new JQTransformer(this.data, { ...this.config, - wrap: this.data.edge.query_operation.transformer.wrap_jq, - pair: this.data.edge.query_operation.transformer.pair_jq, + wrap: this.data.edge.query_operation.transformer.jq.wrap, + pair: this.data.edge.query_operation.transformer.jq.pair, }); } else if (tags.includes("bte-trapi")) { this.tf = new TRAPITransformer(this.data, this.config); diff --git a/src/types.ts b/src/types.ts index 417f5c4..384457d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -15,8 +15,12 @@ interface XBTEParametersObject { } interface TransformerObject { - wrap_jq?: string; - pair_jq?: string; + wrap?: string; + pair?: string; +} + +interface TransformerSet { + [transformerPattern: string]: TransformerObject; } interface QueryOperationInterface { @@ -29,7 +33,7 @@ interface QueryOperationInterface { request_body: object; supportBatch: boolean; inputSeparator: string; - transformer: TransformerObject; + transformer: TransformerSet; } interface SmartAPIKGOperationObject { @@ -58,6 +62,6 @@ export interface BTEQueryObject { } export interface JQVariable { - name: string; - value: string; -} \ No newline at end of file + name: string; + value: string; +}