This commit is contained in:
Benjamin Toby 2025-01-05 09:00:50 +01:00
parent b2f5ff1377
commit 9f77036b91
5 changed files with 22 additions and 21 deletions

View File

@ -1,10 +1 @@
export type HttpRequestExtraParams = {
scheme?: "http" | "https";
body?: {
[x: string]: any;
};
query?: {
[x: string]: any;
};
urlEncodedFormBody?: boolean;
};
export {};

View File

@ -6,18 +6,9 @@ import querystring from "querystring";
import serializeQuery from "../../utils/serialize-query";
import _ from "lodash";
/**
* @typedef {object} HttpRequestExtraParams
* @property {"http" | "https"} [scheme]
* @property {Object<string, any>} [body]
* @property {Object<string, any>} [query]
* @property {boolean} [urlEncodedFormBody]
*/
/**
* # Generate a http Request
* @param {import("node:https").RequestOptions & HttpRequestExtraParams} params
*
* @param {import("../../types").HttpRequestParams} params *
* @returns { Promise<Object<string, any> | string | null> }
*/
async function httpRequest(params) {

View File

@ -1,3 +1,4 @@
import { RequestOptions } from "https";
import { Editor } from "tinymce";
export type DSQL_DatabaseFullName = string;
export interface DSQL_DatabaseSchemaType {
@ -1224,4 +1225,14 @@ export type CookieObject = {
sameSite?: "Strict" | "Lax" | "None";
priority?: "Low" | "Medium" | "High";
};
export type HttpRequestParams = RequestOptions & {
scheme?: "http" | "https";
body?: {
[key: string]: any;
};
query?: {
[key: string]: any;
};
urlEncodedFormBody?: boolean;
};
export {};

View File

@ -1,4 +1,5 @@
import type { IncomingMessage, ServerResponse } from "http";
import { RequestOptions } from "https";
import { Editor } from "tinymce";
export type DSQL_DatabaseFullName = string;
@ -1442,3 +1443,10 @@ export type CookieObject = {
sameSite?: "Strict" | "Lax" | "None";
priority?: "Low" | "Medium" | "High";
};
export type HttpRequestParams = RequestOptions & {
scheme?: "http" | "https";
body?: { [key: string]: any };
query?: { [key: string]: any };
urlEncodedFormBody?: boolean;
};

View File

@ -1,6 +1,6 @@
{
"name": "@moduletrace/datasquirel",
"version": "3.3.1",
"version": "3.3.2",
"description": "Cloud-based SQL data management tool",
"main": "index.js",
"bin": {