@in.pulse-crm/sdk 1.0.0 → 1.0.1
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.
package/package.json
CHANGED
package/src/sdks/instance.sdk.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios, { AxiosInstance } from "axios";
|
|
2
2
|
import { InstanceSDKOptions } from "../types/instance.types";
|
|
3
|
-
import { SuccessDataResponse } from "../types/response.types";
|
|
3
|
+
import { QueryResultResponse, SuccessDataResponse } from "../types/response.types";
|
|
4
4
|
|
|
5
5
|
class InstanceSDK {
|
|
6
6
|
private readonly _api: AxiosInstance;
|
|
@@ -11,7 +11,7 @@ class InstanceSDK {
|
|
|
11
11
|
|
|
12
12
|
public async executeQuery<T>(instance: string, query: string, parameters: Array<any>) {
|
|
13
13
|
const response = await this._api
|
|
14
|
-
.post<
|
|
14
|
+
.post<QueryResultResponse<T>>(`/${instance}/query`, { query, parameters })
|
|
15
15
|
.catch((error) => {
|
|
16
16
|
if (error.response?.data?.message) {
|
|
17
17
|
throw new Error(error.response.data.message);
|
|
@@ -24,7 +24,7 @@ class InstanceSDK {
|
|
|
24
24
|
throw new Error(error.message);
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
return response.data.
|
|
27
|
+
return response.data.result;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
}
|