Updates
This commit is contained in:
parent
d7cef41552
commit
0e5b5fea6e
@ -31,6 +31,7 @@ function queryDSQLAPI(_a) {
|
|||||||
: undefined) ||
|
: undefined) ||
|
||||||
process.env.DSQL_FULL_ACCESS_API_KEY ||
|
process.env.DSQL_FULL_ACCESS_API_KEY ||
|
||||||
process.env.DSQL_API_KEY;
|
process.env.DSQL_API_KEY;
|
||||||
|
let requestOptions;
|
||||||
try {
|
try {
|
||||||
/**
|
/**
|
||||||
* Make https request
|
* Make https request
|
||||||
@ -51,7 +52,7 @@ function queryDSQLAPI(_a) {
|
|||||||
const queryString = (0, serialize_query_1.default)(query);
|
const queryString = (0, serialize_query_1.default)(query);
|
||||||
finalPath += `${queryString}`;
|
finalPath += `${queryString}`;
|
||||||
}
|
}
|
||||||
const requestOptions = {
|
requestOptions = {
|
||||||
method: method || "GET",
|
method: method || "GET",
|
||||||
headers,
|
headers,
|
||||||
port,
|
port,
|
||||||
@ -83,7 +84,7 @@ function queryDSQLAPI(_a) {
|
|||||||
// httpsRequest.getHeaders()
|
// httpsRequest.getHeaders()
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
resolve(responseObj);
|
resolve(Object.assign(Object.assign({}, responseObj), { requestOptions }));
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
resolve({
|
resolve({
|
||||||
@ -107,6 +108,7 @@ function queryDSQLAPI(_a) {
|
|||||||
msg: `An error occurred on the response`,
|
msg: `An error occurred on the response`,
|
||||||
error: err.message,
|
error: err.message,
|
||||||
errorData: { requestOptions, grabedHostNames },
|
errorData: { requestOptions, grabedHostNames },
|
||||||
|
requestOptions,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -120,6 +122,7 @@ function queryDSQLAPI(_a) {
|
|||||||
requestOptions,
|
requestOptions,
|
||||||
grabedHostNames: lodash_1.default.omit(grabedHostNames, ["scheme"]),
|
grabedHostNames: lodash_1.default.omit(grabedHostNames, ["scheme"]),
|
||||||
},
|
},
|
||||||
|
requestOptions,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if (reqPayload) {
|
if (reqPayload) {
|
||||||
@ -135,6 +138,7 @@ function queryDSQLAPI(_a) {
|
|||||||
singleRes: undefined,
|
singleRes: undefined,
|
||||||
msg: `Request Failed`,
|
msg: `Request Failed`,
|
||||||
error: error.message,
|
error: error.message,
|
||||||
|
requestOptions,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
1
dist/package-shared/types/index.d.ts
vendored
1
dist/package-shared/types/index.d.ts
vendored
@ -1477,6 +1477,7 @@ export type APIResponseObject<T extends {
|
|||||||
code?: string;
|
code?: string;
|
||||||
createdAt?: number;
|
createdAt?: number;
|
||||||
email?: string;
|
email?: string;
|
||||||
|
requestOptions?: RequestOptions;
|
||||||
};
|
};
|
||||||
export declare const UserTypes: readonly ["su", "admin"];
|
export declare const UserTypes: readonly ["su", "admin"];
|
||||||
export declare const SignUpParadigms: readonly [{
|
export declare const SignUpParadigms: readonly [{
|
||||||
|
|||||||
@ -53,6 +53,8 @@ export default async function queryDSQLAPI<T = { [k: string]: any }>({
|
|||||||
process.env.DSQL_FULL_ACCESS_API_KEY ||
|
process.env.DSQL_FULL_ACCESS_API_KEY ||
|
||||||
process.env.DSQL_API_KEY;
|
process.env.DSQL_API_KEY;
|
||||||
|
|
||||||
|
let requestOptions: RequestOptions | undefined;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
/**
|
/**
|
||||||
* Make https request
|
* Make https request
|
||||||
@ -78,7 +80,7 @@ export default async function queryDSQLAPI<T = { [k: string]: any }>({
|
|||||||
finalPath += `${queryString}`;
|
finalPath += `${queryString}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const requestOptions: RequestOptions = {
|
requestOptions = {
|
||||||
method: method || "GET",
|
method: method || "GET",
|
||||||
headers,
|
headers,
|
||||||
port,
|
port,
|
||||||
@ -106,6 +108,7 @@ export default async function queryDSQLAPI<T = { [k: string]: any }>({
|
|||||||
const responseObj = JSON.parse(
|
const responseObj = JSON.parse(
|
||||||
str
|
str
|
||||||
) as APIResponseObject;
|
) as APIResponseObject;
|
||||||
|
|
||||||
if (!responseObj.success) {
|
if (!responseObj.success) {
|
||||||
// console.log("responseObj", responseObj);
|
// console.log("responseObj", responseObj);
|
||||||
// console.log(
|
// console.log(
|
||||||
@ -117,7 +120,7 @@ export default async function queryDSQLAPI<T = { [k: string]: any }>({
|
|||||||
// httpsRequest.getHeaders()
|
// httpsRequest.getHeaders()
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
resolve(responseObj);
|
resolve({ ...responseObj, requestOptions });
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
resolve({
|
resolve({
|
||||||
success: false,
|
success: false,
|
||||||
@ -141,6 +144,7 @@ export default async function queryDSQLAPI<T = { [k: string]: any }>({
|
|||||||
msg: `An error occurred on the response`,
|
msg: `An error occurred on the response`,
|
||||||
error: err.message,
|
error: err.message,
|
||||||
errorData: { requestOptions, grabedHostNames },
|
errorData: { requestOptions, grabedHostNames },
|
||||||
|
requestOptions,
|
||||||
} as APIResponseObject);
|
} as APIResponseObject);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -156,6 +160,7 @@ export default async function queryDSQLAPI<T = { [k: string]: any }>({
|
|||||||
requestOptions,
|
requestOptions,
|
||||||
grabedHostNames: _.omit(grabedHostNames, ["scheme"]),
|
grabedHostNames: _.omit(grabedHostNames, ["scheme"]),
|
||||||
},
|
},
|
||||||
|
requestOptions,
|
||||||
} as APIResponseObject);
|
} as APIResponseObject);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -172,6 +177,7 @@ export default async function queryDSQLAPI<T = { [k: string]: any }>({
|
|||||||
singleRes: undefined,
|
singleRes: undefined,
|
||||||
msg: `Request Failed`,
|
msg: `Request Failed`,
|
||||||
error: error.message,
|
error: error.message,
|
||||||
|
requestOptions,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1712,6 +1712,7 @@ export type APIResponseObject<
|
|||||||
code?: string;
|
code?: string;
|
||||||
createdAt?: number;
|
createdAt?: number;
|
||||||
email?: string;
|
email?: string;
|
||||||
|
requestOptions?: RequestOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const UserTypes = ["su", "admin"] as const;
|
export const UserTypes = ["su", "admin"] as const;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/datasquirel",
|
"name": "@moduletrace/datasquirel",
|
||||||
"version": "5.5.9",
|
"version": "5.6.0",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user