Updates
This commit is contained in:
parent
fe2b34d0ee
commit
07c2186b98
11
dist/package-shared/actions/upload-image.d.ts
vendored
11
dist/package-shared/actions/upload-image.d.ts
vendored
@ -1,10 +1,11 @@
|
|||||||
interface FunctionReturn {
|
export interface DSQLUploadImageFunctionReturn {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
payload: {
|
payload: DSQLUploadImagePayload | null;
|
||||||
|
msg?: string;
|
||||||
|
}
|
||||||
|
export interface DSQLUploadImagePayload {
|
||||||
urlPath: string;
|
urlPath: string;
|
||||||
urlThumbnailPath: string;
|
urlThumbnailPath: string;
|
||||||
} | null;
|
|
||||||
msg?: string;
|
|
||||||
}
|
}
|
||||||
type Param = {
|
type Param = {
|
||||||
key?: string;
|
key?: string;
|
||||||
@ -22,5 +23,5 @@ type Param = {
|
|||||||
/**
|
/**
|
||||||
* # Upload Image via API
|
* # Upload Image via API
|
||||||
*/
|
*/
|
||||||
export default function uploadImage({ key, payload, user_id, useDefault, }: Param): Promise<FunctionReturn>;
|
export default function uploadImage({ key, payload, user_id, useDefault, }: Param): Promise<DSQLUploadImageFunctionReturn>;
|
||||||
export {};
|
export {};
|
||||||
|
1
dist/package-shared/actions/upload-image.js
vendored
1
dist/package-shared/actions/upload-image.js
vendored
@ -1,5 +1,4 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
// @ts-check
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
// @ts-check
|
|
||||||
|
|
||||||
import grabHostNames from "../utils/grab-host-names";
|
import grabHostNames from "../utils/grab-host-names";
|
||||||
|
|
||||||
interface FunctionReturn {
|
export interface DSQLUploadImageFunctionReturn {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
payload: {
|
payload: DSQLUploadImagePayload | null;
|
||||||
|
msg?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DSQLUploadImagePayload {
|
||||||
urlPath: string;
|
urlPath: string;
|
||||||
urlThumbnailPath: string;
|
urlThumbnailPath: string;
|
||||||
} | null;
|
|
||||||
msg?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
@ -33,7 +33,7 @@ export default async function uploadImage({
|
|||||||
payload,
|
payload,
|
||||||
user_id,
|
user_id,
|
||||||
useDefault,
|
useDefault,
|
||||||
}: Param): Promise<FunctionReturn> {
|
}: Param): Promise<DSQLUploadImageFunctionReturn> {
|
||||||
const grabedHostNames = grabHostNames({ useDefault });
|
const grabedHostNames = grabHostNames({ useDefault });
|
||||||
const { host, port, scheme } = grabedHostNames;
|
const { host, port, scheme } = grabedHostNames;
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ export default async function uploadImage({
|
|||||||
httpsRequest.end();
|
httpsRequest.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
return httpResponse as FunctionReturn;
|
return httpResponse as DSQLUploadImageFunctionReturn;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log("Error in uploading image: ", error.message);
|
console.log("Error in uploading image: ", error.message);
|
||||||
global.ERROR_CALLBACK?.(`Error Uploading Image`, error as Error);
|
global.ERROR_CALLBACK?.(`Error Uploading Image`, error as Error);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/datasquirel",
|
"name": "@moduletrace/datasquirel",
|
||||||
"version": "4.5.6",
|
"version": "4.5.7",
|
||||||
"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