Updates
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
import { APIConnectionOptions, APIResponseObject, DSQL_DatabaseSchemaType, DSQL_FieldSchemaType, DSQL_TableSchemaType } from "../../types";
|
||||
import { GrabHostNamesReturn } from "../../utils/grab-host-names";
|
||||
type Params = {
|
||||
dbName: string;
|
||||
tableName?: string;
|
||||
fieldName?: string;
|
||||
apiKey?: string;
|
||||
apiConnectionConfig?: APIConnectionOptions;
|
||||
grabbedHostnames?: GrabHostNamesReturn;
|
||||
useDefault?: boolean;
|
||||
};
|
||||
export default function <T extends DSQL_DatabaseSchemaType | DSQL_TableSchemaType | DSQL_FieldSchemaType = DSQL_DatabaseSchemaType>({ dbName, tableName, apiKey, useDefault, fieldName, apiConnectionConfig, grabbedHostnames, }: Params): Promise<APIResponseObject<T>>;
|
||||
export {};
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const query_dsql_api_1 = __importDefault(require("../../functions/api/query-dsql-api"));
|
||||
const grab_api_base_path_1 = __importDefault(require("../../utils/grab-api-base-path"));
|
||||
function default_1(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ dbName, tableName, apiKey, useDefault, fieldName, apiConnectionConfig, grabbedHostnames, }) {
|
||||
const basePath = (0, grab_api_base_path_1.default)({ paradigm: "schema" });
|
||||
const finalPath = path_1.default.join(basePath, dbName, tableName || "", fieldName || "");
|
||||
const GET_RES = yield (0, query_dsql_api_1.default)({
|
||||
method: "GET",
|
||||
path: finalPath,
|
||||
apiKey,
|
||||
useDefault,
|
||||
apiConnectionConfig,
|
||||
grabbedHostnames,
|
||||
});
|
||||
return GET_RES;
|
||||
});
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import get from "./get";
|
||||
declare const schema: {
|
||||
get: typeof get;
|
||||
};
|
||||
export default schema;
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const get_1 = __importDefault(require("./get"));
|
||||
const schema = {
|
||||
get: get_1.default,
|
||||
};
|
||||
exports.default = schema;
|
||||
Reference in New Issue
Block a user