This commit is contained in:
Benjamin Toby
2025-01-14 15:59:48 +01:00
parent 49716e8c5c
commit fc9839fd0c
8 changed files with 24 additions and 12 deletions
+4 -1
View File
@@ -6,8 +6,11 @@ type GrabHostNamesReturn = {
scheme: typeof http | typeof https;
user_id: string | number;
};
type Param = {
userId?: string | number;
};
/**
* # Grab Names For Query
*/
export default function grabHostNames(): GrabHostNamesReturn;
export default function grabHostNames(param?: Param): GrabHostNamesReturn;
export {};
+2 -2
View File
@@ -10,7 +10,7 @@ const http_1 = __importDefault(require("http"));
/**
* # Grab Names For Query
*/
function grabHostNames() {
function grabHostNames(param) {
var _a, _b;
const scheme = process.env.DSQL_HTTP_SCHEME;
const localHost = process.env.DSQL_LOCAL_HOST;
@@ -25,6 +25,6 @@ function grabHostNames() {
host: remoteHost || localHost || "datasquirel.com",
port: remoteHostPort || localHostPort || 443,
scheme: (scheme === null || scheme === void 0 ? void 0 : scheme.match(/^http$/i)) ? http_1.default : https_1.default,
user_id: String(process.env.DSQL_API_USER_ID || 0),
user_id: (param === null || param === void 0 ? void 0 : param.userId) || String(process.env.DSQL_API_USER_ID || 0),
};
}