diff --git a/package-shared/types/index.d.ts b/package-shared/types/index.d.ts index e911139..0f1fa98 100644 --- a/package-shared/types/index.d.ts +++ b/package-shared/types/index.d.ts @@ -316,24 +316,25 @@ export interface GetReturn { schema?: DSQL_TableSchemaType; } -interface GetSchemaRequestQuery { +export interface GetSchemaRequestQuery { database?: string; table?: string; field?: string; } -interface GetSchemaAPICredentialsParam { +export interface GetSchemaAPICredentialsParam { key: string; } -type GetSchemaAPIParam = GetSchemaRequestQuery & GetSchemaAPICredentialsParam; +export type GetSchemaAPIParam = GetSchemaRequestQuery & + GetSchemaAPICredentialsParam; -interface PostReturn { +export interface PostReturn { success: boolean; - payload?: Object[] | string; + payload?: Object[] | string | PostInsertReturn; } -interface PostDataPayload { +export interface PostDataPayload { action: "insert" | "update" | "delete"; table: string; data?: object; @@ -344,15 +345,26 @@ interface PostDataPayload { update?: boolean; } -interface LocalPostReturn { +export interface LocalPostReturn { success: boolean; payload?: any; msg?: string; error?: string; } -interface LocalPostQueryObject { +export interface LocalPostQueryObject { query: string | PostDataPayload; tableName?: string; queryValues?: string[]; } + +export interface PostInsertReturn { + fieldCount: number; + affectedRows: number; + insertId: number; + serverStatus: number; + warningCount: number; + message: string; + protocol41: boolean; + changedRows: number; +} diff --git a/package-shared/types/index.js b/package-shared/types/index.js index 9c64efd..ea6351e 100644 --- a/package-shared/types/index.js +++ b/package-shared/types/index.js @@ -373,7 +373,7 @@ const http = require("http"); /** * @typedef {Object} PostReturn * @property {boolean} success - Did the function run successfully? - * @property {(Object[]|string)} [payload=[]] - The Y Coordinate + * @property {PostInsertReturn | Object[] | string} [payload] - The Y Coordinate */ /** @@ -406,3 +406,15 @@ const http = require("http"); * @property {string} [tableName] - Table Name * @property {string[]} [queryValues] - GET request results */ + +/** + * @typedef {object} PostInsertReturn + * @property {number} fieldCount + * @property {number} affectedRows + * @property {number} insertId + * @property {number} serverStatus + * @property {number} warningCount + * @property {string} message + * @property {boolean} protocol41 + * @property {number} changedRows + */ diff --git a/package.json b/package.json index d4e0135..dceb35f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "2.3.2", + "version": "2.3.3", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {