Updates
This commit is contained in:
parent
7e8bb37c09
commit
3730e4722e
3
dist/package-shared/api/crud/delete.d.ts
vendored
3
dist/package-shared/api/crud/delete.d.ts
vendored
@ -10,12 +10,13 @@ type Params<T extends {
|
|||||||
deleteKeyValues?: SQLDeleteData<T>[];
|
deleteKeyValues?: SQLDeleteData<T>[];
|
||||||
};
|
};
|
||||||
targetID?: string | number;
|
targetID?: string | number;
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
export default function apiCrudDELETE<T extends {
|
export default function apiCrudDELETE<T extends {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
} = {
|
} = {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}>({ dbName, tableName, deleteSpec, targetID }: Params<T>): Promise<import("../../types").APIResponseObject<{
|
}>({ dbName, tableName, deleteSpec, targetID, apiKey }: Params<T>): Promise<import("../../types").APIResponseObject<{
|
||||||
[k: string]: any;
|
[k: string]: any;
|
||||||
}>>;
|
}>>;
|
||||||
export {};
|
export {};
|
||||||
|
3
dist/package-shared/api/crud/delete.js
vendored
3
dist/package-shared/api/crud/delete.js
vendored
@ -1,7 +1,7 @@
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
import queryDSQLAPI from "../../functions/api/query-dsql-api";
|
import queryDSQLAPI from "../../functions/api/query-dsql-api";
|
||||||
import grabAPIBasePath from "../../utils/grab-api-base-path";
|
import grabAPIBasePath from "../../utils/grab-api-base-path";
|
||||||
export default async function apiCrudDELETE({ dbName, tableName, deleteSpec, targetID }) {
|
export default async function apiCrudDELETE({ dbName, tableName, deleteSpec, targetID, apiKey }) {
|
||||||
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
||||||
const finalID = typeof targetID === "number" ? String(targetID) : targetID;
|
const finalID = typeof targetID === "number" ? String(targetID) : targetID;
|
||||||
const finalPath = path.join(basePath, dbName, tableName, finalID || "");
|
const finalPath = path.join(basePath, dbName, tableName, finalID || "");
|
||||||
@ -9,6 +9,7 @@ export default async function apiCrudDELETE({ dbName, tableName, deleteSpec, tar
|
|||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
path: finalPath,
|
path: finalPath,
|
||||||
body: deleteSpec,
|
body: deleteSpec,
|
||||||
|
apiKey,
|
||||||
});
|
});
|
||||||
return GET_RES;
|
return GET_RES;
|
||||||
}
|
}
|
||||||
|
3
dist/package-shared/api/crud/get.d.ts
vendored
3
dist/package-shared/api/crud/get.d.ts
vendored
@ -8,10 +8,11 @@ type Params<T extends {
|
|||||||
tableName: string;
|
tableName: string;
|
||||||
query?: DsqlCrudQueryObject<T>;
|
query?: DsqlCrudQueryObject<T>;
|
||||||
targetId?: string | number;
|
targetId?: string | number;
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
export default function apiCrudGET<T extends {
|
export default function apiCrudGET<T extends {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
} = {
|
} = {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}>({ dbName, tableName, query, targetId, }: Params<T>): Promise<APIResponseObject>;
|
}>({ dbName, tableName, query, targetId, apiKey, }: Params<T>): Promise<APIResponseObject>;
|
||||||
export {};
|
export {};
|
||||||
|
3
dist/package-shared/api/crud/get.js
vendored
3
dist/package-shared/api/crud/get.js
vendored
@ -1,7 +1,7 @@
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
import queryDSQLAPI from "../../functions/api/query-dsql-api";
|
import queryDSQLAPI from "../../functions/api/query-dsql-api";
|
||||||
import grabAPIBasePath from "../../utils/grab-api-base-path";
|
import grabAPIBasePath from "../../utils/grab-api-base-path";
|
||||||
export default async function apiCrudGET({ dbName, tableName, query, targetId, }) {
|
export default async function apiCrudGET({ dbName, tableName, query, targetId, apiKey, }) {
|
||||||
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
||||||
const finalID = typeof targetId === "number" ? String(targetId) : targetId;
|
const finalID = typeof targetId === "number" ? String(targetId) : targetId;
|
||||||
const finalPath = path.join(basePath, dbName, tableName, finalID || "");
|
const finalPath = path.join(basePath, dbName, tableName, finalID || "");
|
||||||
@ -9,6 +9,7 @@ export default async function apiCrudGET({ dbName, tableName, query, targetId, }
|
|||||||
method: "GET",
|
method: "GET",
|
||||||
path: finalPath,
|
path: finalPath,
|
||||||
query,
|
query,
|
||||||
|
apiKey,
|
||||||
});
|
});
|
||||||
return GET_RES;
|
return GET_RES;
|
||||||
}
|
}
|
||||||
|
3
dist/package-shared/api/crud/post.d.ts
vendored
3
dist/package-shared/api/crud/post.d.ts
vendored
@ -8,9 +8,10 @@ export type APICrudPostParams<T extends {
|
|||||||
tableName: string;
|
tableName: string;
|
||||||
body: T;
|
body: T;
|
||||||
update?: boolean;
|
update?: boolean;
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
export default function apiCrudPOST<T extends {
|
export default function apiCrudPOST<T extends {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
} = {
|
} = {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}>({ dbName, tableName, body, update, }: APICrudPostParams<T>): Promise<APIResponseObject>;
|
}>({ dbName, tableName, body, update, apiKey, }: APICrudPostParams<T>): Promise<APIResponseObject>;
|
||||||
|
3
dist/package-shared/api/crud/post.js
vendored
3
dist/package-shared/api/crud/post.js
vendored
@ -1,7 +1,7 @@
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
import queryDSQLAPI from "../../functions/api/query-dsql-api";
|
import queryDSQLAPI from "../../functions/api/query-dsql-api";
|
||||||
import grabAPIBasePath from "../../utils/grab-api-base-path";
|
import grabAPIBasePath from "../../utils/grab-api-base-path";
|
||||||
export default async function apiCrudPOST({ dbName, tableName, body, update, }) {
|
export default async function apiCrudPOST({ dbName, tableName, body, update, apiKey, }) {
|
||||||
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
||||||
const passedID = body.id;
|
const passedID = body.id;
|
||||||
const finalID = update
|
const finalID = update
|
||||||
@ -14,6 +14,7 @@ export default async function apiCrudPOST({ dbName, tableName, body, update, })
|
|||||||
method: update ? "PUT" : "POST",
|
method: update ? "PUT" : "POST",
|
||||||
path: finalPath,
|
path: finalPath,
|
||||||
body,
|
body,
|
||||||
|
apiKey,
|
||||||
});
|
});
|
||||||
return GET_RES;
|
return GET_RES;
|
||||||
}
|
}
|
||||||
|
3
dist/package-shared/api/crud/put.d.ts
vendored
3
dist/package-shared/api/crud/put.d.ts
vendored
@ -5,10 +5,11 @@ type Params<T extends {
|
|||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}> = Omit<APICrudPostParams<T>, "update"> & {
|
}> = Omit<APICrudPostParams<T>, "update"> & {
|
||||||
targetID: string | number;
|
targetID: string | number;
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
export default function apiCrudPUT<T extends {
|
export default function apiCrudPUT<T extends {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
} = {
|
} = {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}>({ dbName, tableName, body, targetID }: Params<T>): Promise<import("../../types").APIResponseObject>;
|
}>({ dbName, tableName, body, targetID, apiKey }: Params<T>): Promise<import("../../types").APIResponseObject>;
|
||||||
export {};
|
export {};
|
||||||
|
3
dist/package-shared/api/crud/put.js
vendored
3
dist/package-shared/api/crud/put.js
vendored
@ -1,5 +1,5 @@
|
|||||||
import apiCrudPOST from "./post";
|
import apiCrudPOST from "./post";
|
||||||
export default async function apiCrudPUT({ dbName, tableName, body, targetID }) {
|
export default async function apiCrudPUT({ dbName, tableName, body, targetID, apiKey }) {
|
||||||
const updatedBody = Object.assign({}, body);
|
const updatedBody = Object.assign({}, body);
|
||||||
if (targetID) {
|
if (targetID) {
|
||||||
updatedBody["id"] = targetID;
|
updatedBody["id"] = targetID;
|
||||||
@ -9,5 +9,6 @@ export default async function apiCrudPUT({ dbName, tableName, body, targetID })
|
|||||||
tableName,
|
tableName,
|
||||||
body: updatedBody,
|
body: updatedBody,
|
||||||
update: true,
|
update: true,
|
||||||
|
apiKey,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
7
dist/package-shared/api/media/delete.d.ts
vendored
7
dist/package-shared/api/media/delete.d.ts
vendored
@ -1,5 +1,8 @@
|
|||||||
import { APIResponseObject } from "../../types";
|
import { APIResponseObject } from "../../types";
|
||||||
import { DSQL_DATASQUIREL_USER_MEDIA } from "../../types/dsql";
|
import { DSQL_DATASQUIREL_USER_MEDIA } from "../../types/dsql";
|
||||||
export default function apiMediaDELETE(params: {
|
type Params = {
|
||||||
mediaID?: string | number;
|
mediaID?: string | number;
|
||||||
}): Promise<APIResponseObject<DSQL_DATASQUIREL_USER_MEDIA | DSQL_DATASQUIREL_USER_MEDIA[]>>;
|
apiKey?: string;
|
||||||
|
};
|
||||||
|
export default function apiMediaDELETE(params: Params): Promise<APIResponseObject<DSQL_DATASQUIREL_USER_MEDIA | DSQL_DATASQUIREL_USER_MEDIA[]>>;
|
||||||
|
export {};
|
||||||
|
1
dist/package-shared/api/media/delete.js
vendored
1
dist/package-shared/api/media/delete.js
vendored
@ -12,6 +12,7 @@ export default async function apiMediaDELETE(params) {
|
|||||||
const DELETE_MEDIA_RES = await queryDSQLAPI({
|
const DELETE_MEDIA_RES = await queryDSQLAPI({
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
path: finalPath,
|
path: finalPath,
|
||||||
|
apiKey: params.apiKey,
|
||||||
});
|
});
|
||||||
return DELETE_MEDIA_RES;
|
return DELETE_MEDIA_RES;
|
||||||
}
|
}
|
||||||
|
1
dist/package-shared/api/media/get.js
vendored
1
dist/package-shared/api/media/get.js
vendored
@ -13,6 +13,7 @@ export default async function apiMediaGET(params) {
|
|||||||
method: "GET",
|
method: "GET",
|
||||||
path: finalPath,
|
path: finalPath,
|
||||||
query: params,
|
query: params,
|
||||||
|
apiKey: params.apiKey,
|
||||||
});
|
});
|
||||||
return GET_MEDIA_RES;
|
return GET_MEDIA_RES;
|
||||||
}
|
}
|
||||||
|
1
dist/package-shared/api/media/post.js
vendored
1
dist/package-shared/api/media/post.js
vendored
@ -6,6 +6,7 @@ export default async function apiMediaPOST(params) {
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
path: basePath,
|
path: basePath,
|
||||||
body: params,
|
body: params,
|
||||||
|
apiKey: params.apiKey,
|
||||||
});
|
});
|
||||||
return POST_MEDIA_RES;
|
return POST_MEDIA_RES;
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,12 @@ import { APIResponseObject, DataCrudRequestMethods, DataCrudRequestMethodsLowerC
|
|||||||
type Param<T = {
|
type Param<T = {
|
||||||
[k: string]: any;
|
[k: string]: any;
|
||||||
}> = {
|
}> = {
|
||||||
key?: string;
|
|
||||||
body?: T;
|
body?: T;
|
||||||
query?: T;
|
query?: T;
|
||||||
useDefault?: boolean;
|
useDefault?: boolean;
|
||||||
path: string;
|
path: string;
|
||||||
method?: (typeof DataCrudRequestMethods)[number] | (typeof DataCrudRequestMethodsLowerCase)[number];
|
method?: (typeof DataCrudRequestMethods)[number] | (typeof DataCrudRequestMethodsLowerCase)[number];
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* # Query DSQL API
|
* # Query DSQL API
|
||||||
@ -16,5 +16,5 @@ export default function queryDSQLAPI<T = {
|
|||||||
[k: string]: any;
|
[k: string]: any;
|
||||||
}, P = {
|
}, P = {
|
||||||
[k: string]: any;
|
[k: string]: any;
|
||||||
}>({ key, body, query, useDefault, path: passedPath, method, }: Param<T>): Promise<APIResponseObject<P>>;
|
}>({ body, query, useDefault, path: passedPath, method, apiKey, }: Param<T>): Promise<APIResponseObject<P>>;
|
||||||
export {};
|
export {};
|
||||||
|
@ -4,7 +4,7 @@ import serializeQuery from "../../utils/serialize-query";
|
|||||||
/**
|
/**
|
||||||
* # Query DSQL API
|
* # Query DSQL API
|
||||||
*/
|
*/
|
||||||
export default async function queryDSQLAPI({ key, body, query, useDefault, path: passedPath, method, }) {
|
export default async function queryDSQLAPI({ body, query, useDefault, path: passedPath, method, apiKey, }) {
|
||||||
const grabedHostNames = grabHostNames({ useDefault });
|
const grabedHostNames = grabHostNames({ useDefault });
|
||||||
const { host, port, scheme } = grabedHostNames;
|
const { host, port, scheme } = grabedHostNames;
|
||||||
try {
|
try {
|
||||||
@ -17,7 +17,7 @@ export default async function queryDSQLAPI({ key, body, query, useDefault, path:
|
|||||||
const reqPayload = body ? JSON.stringify(body) : undefined;
|
const reqPayload = body ? JSON.stringify(body) : undefined;
|
||||||
let headers = {
|
let headers = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Authorization: key ||
|
Authorization: apiKey ||
|
||||||
(!method || method == "GET" || method == "get"
|
(!method || method == "GET" || method == "get"
|
||||||
? process.env.DSQL_READ_ONLY_API_KEY
|
? process.env.DSQL_READ_ONLY_API_KEY
|
||||||
: undefined) ||
|
: undefined) ||
|
||||||
|
2
dist/package-shared/types/index.d.ts
vendored
2
dist/package-shared/types/index.d.ts
vendored
@ -1757,10 +1757,12 @@ export type APIGetMediaParams = {
|
|||||||
skipBase64?: "true" | "false";
|
skipBase64?: "true" | "false";
|
||||||
stream?: "stream";
|
stream?: "stream";
|
||||||
thumbnail?: "true" | "false";
|
thumbnail?: "true" | "false";
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
export type AddMediaAPIBody = {
|
export type AddMediaAPIBody = {
|
||||||
media: MediaUploadDataType[];
|
media: MediaUploadDataType[];
|
||||||
folder?: string | null;
|
folder?: string | null;
|
||||||
type: (typeof MediaTypes)[number];
|
type: (typeof MediaTypes)[number];
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
export {};
|
export {};
|
||||||
|
@ -8,11 +8,12 @@ type Params<T extends { [key: string]: any } = { [key: string]: any }> = {
|
|||||||
tableName: string;
|
tableName: string;
|
||||||
deleteSpec?: T & { deleteKeyValues?: SQLDeleteData<T>[] };
|
deleteSpec?: T & { deleteKeyValues?: SQLDeleteData<T>[] };
|
||||||
targetID?: string | number;
|
targetID?: string | number;
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function apiCrudDELETE<
|
export default async function apiCrudDELETE<
|
||||||
T extends { [key: string]: any } = { [key: string]: any }
|
T extends { [key: string]: any } = { [key: string]: any }
|
||||||
>({ dbName, tableName, deleteSpec, targetID }: Params<T>) {
|
>({ dbName, tableName, deleteSpec, targetID, apiKey }: Params<T>) {
|
||||||
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
||||||
|
|
||||||
const finalID = typeof targetID === "number" ? String(targetID) : targetID;
|
const finalID = typeof targetID === "number" ? String(targetID) : targetID;
|
||||||
@ -23,6 +24,7 @@ export default async function apiCrudDELETE<
|
|||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
path: finalPath,
|
path: finalPath,
|
||||||
body: deleteSpec,
|
body: deleteSpec,
|
||||||
|
apiKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
return GET_RES;
|
return GET_RES;
|
||||||
|
@ -8,6 +8,7 @@ type Params<T extends { [key: string]: any } = { [key: string]: any }> = {
|
|||||||
tableName: string;
|
tableName: string;
|
||||||
query?: DsqlCrudQueryObject<T>;
|
query?: DsqlCrudQueryObject<T>;
|
||||||
targetId?: string | number;
|
targetId?: string | number;
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function apiCrudGET<
|
export default async function apiCrudGET<
|
||||||
@ -17,6 +18,7 @@ export default async function apiCrudGET<
|
|||||||
tableName,
|
tableName,
|
||||||
query,
|
query,
|
||||||
targetId,
|
targetId,
|
||||||
|
apiKey,
|
||||||
}: Params<T>): Promise<APIResponseObject> {
|
}: Params<T>): Promise<APIResponseObject> {
|
||||||
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
||||||
|
|
||||||
@ -28,6 +30,7 @@ export default async function apiCrudGET<
|
|||||||
method: "GET",
|
method: "GET",
|
||||||
path: finalPath,
|
path: finalPath,
|
||||||
query,
|
query,
|
||||||
|
apiKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
return GET_RES;
|
return GET_RES;
|
||||||
|
@ -10,6 +10,7 @@ export type APICrudPostParams<
|
|||||||
tableName: string;
|
tableName: string;
|
||||||
body: T;
|
body: T;
|
||||||
update?: boolean;
|
update?: boolean;
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function apiCrudPOST<
|
export default async function apiCrudPOST<
|
||||||
@ -19,6 +20,7 @@ export default async function apiCrudPOST<
|
|||||||
tableName,
|
tableName,
|
||||||
body,
|
body,
|
||||||
update,
|
update,
|
||||||
|
apiKey,
|
||||||
}: APICrudPostParams<T>): Promise<APIResponseObject> {
|
}: APICrudPostParams<T>): Promise<APIResponseObject> {
|
||||||
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
||||||
|
|
||||||
@ -36,6 +38,7 @@ export default async function apiCrudPOST<
|
|||||||
method: update ? "PUT" : "POST",
|
method: update ? "PUT" : "POST",
|
||||||
path: finalPath,
|
path: finalPath,
|
||||||
body,
|
body,
|
||||||
|
apiKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
return GET_RES;
|
return GET_RES;
|
||||||
|
@ -5,11 +5,12 @@ type Params<T extends { [key: string]: any } = { [key: string]: any }> = Omit<
|
|||||||
"update"
|
"update"
|
||||||
> & {
|
> & {
|
||||||
targetID: string | number;
|
targetID: string | number;
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function apiCrudPUT<
|
export default async function apiCrudPUT<
|
||||||
T extends { [key: string]: any } = { [key: string]: any }
|
T extends { [key: string]: any } = { [key: string]: any }
|
||||||
>({ dbName, tableName, body, targetID }: Params<T>) {
|
>({ dbName, tableName, body, targetID, apiKey }: Params<T>) {
|
||||||
const updatedBody = { ...body } as any;
|
const updatedBody = { ...body } as any;
|
||||||
|
|
||||||
if (targetID) {
|
if (targetID) {
|
||||||
@ -21,5 +22,6 @@ export default async function apiCrudPUT<
|
|||||||
tableName,
|
tableName,
|
||||||
body: updatedBody,
|
body: updatedBody,
|
||||||
update: true,
|
update: true,
|
||||||
|
apiKey,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,14 @@ import { DSQL_DATASQUIREL_USER_MEDIA } from "../../types/dsql";
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
import grabAPIBasePath from "../../utils/grab-api-base-path";
|
import grabAPIBasePath from "../../utils/grab-api-base-path";
|
||||||
|
|
||||||
export default async function apiMediaDELETE(params: {
|
type Params = {
|
||||||
mediaID?: string | number;
|
mediaID?: string | number;
|
||||||
}): Promise<
|
apiKey?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function apiMediaDELETE(
|
||||||
|
params: Params
|
||||||
|
): Promise<
|
||||||
APIResponseObject<
|
APIResponseObject<
|
||||||
DSQL_DATASQUIREL_USER_MEDIA | DSQL_DATASQUIREL_USER_MEDIA[]
|
DSQL_DATASQUIREL_USER_MEDIA | DSQL_DATASQUIREL_USER_MEDIA[]
|
||||||
>
|
>
|
||||||
@ -24,6 +29,7 @@ export default async function apiMediaDELETE(params: {
|
|||||||
const DELETE_MEDIA_RES = await queryDSQLAPI({
|
const DELETE_MEDIA_RES = await queryDSQLAPI({
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
path: finalPath,
|
path: finalPath,
|
||||||
|
apiKey: params.apiKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
return DELETE_MEDIA_RES as APIResponseObject<
|
return DELETE_MEDIA_RES as APIResponseObject<
|
||||||
|
@ -25,6 +25,7 @@ export default async function apiMediaGET(
|
|||||||
method: "GET",
|
method: "GET",
|
||||||
path: finalPath,
|
path: finalPath,
|
||||||
query: params,
|
query: params,
|
||||||
|
apiKey: params.apiKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
return GET_MEDIA_RES as APIResponseObject<
|
return GET_MEDIA_RES as APIResponseObject<
|
||||||
|
@ -16,6 +16,7 @@ export default async function apiMediaPOST(
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
path: basePath,
|
path: basePath,
|
||||||
body: params,
|
body: params,
|
||||||
|
apiKey: params.apiKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
return POST_MEDIA_RES as APIResponseObject<
|
return POST_MEDIA_RES as APIResponseObject<
|
||||||
|
@ -10,7 +10,6 @@ import grabHostNames from "../../utils/grab-host-names";
|
|||||||
import serializeQuery from "../../utils/serialize-query";
|
import serializeQuery from "../../utils/serialize-query";
|
||||||
|
|
||||||
type Param<T = { [k: string]: any }> = {
|
type Param<T = { [k: string]: any }> = {
|
||||||
key?: string;
|
|
||||||
body?: T;
|
body?: T;
|
||||||
query?: T;
|
query?: T;
|
||||||
useDefault?: boolean;
|
useDefault?: boolean;
|
||||||
@ -18,6 +17,7 @@ type Param<T = { [k: string]: any }> = {
|
|||||||
method?:
|
method?:
|
||||||
| (typeof DataCrudRequestMethods)[number]
|
| (typeof DataCrudRequestMethods)[number]
|
||||||
| (typeof DataCrudRequestMethodsLowerCase)[number];
|
| (typeof DataCrudRequestMethodsLowerCase)[number];
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,12 +27,12 @@ export default async function queryDSQLAPI<
|
|||||||
T = { [k: string]: any },
|
T = { [k: string]: any },
|
||||||
P = { [k: string]: any }
|
P = { [k: string]: any }
|
||||||
>({
|
>({
|
||||||
key,
|
|
||||||
body,
|
body,
|
||||||
query,
|
query,
|
||||||
useDefault,
|
useDefault,
|
||||||
path: passedPath,
|
path: passedPath,
|
||||||
method,
|
method,
|
||||||
|
apiKey,
|
||||||
}: Param<T>): Promise<APIResponseObject<P>> {
|
}: Param<T>): Promise<APIResponseObject<P>> {
|
||||||
const grabedHostNames = grabHostNames({ useDefault });
|
const grabedHostNames = grabHostNames({ useDefault });
|
||||||
const { host, port, scheme } = grabedHostNames;
|
const { host, port, scheme } = grabedHostNames;
|
||||||
@ -49,7 +49,7 @@ export default async function queryDSQLAPI<
|
|||||||
let headers: OutgoingHttpHeaders = {
|
let headers: OutgoingHttpHeaders = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Authorization:
|
Authorization:
|
||||||
key ||
|
apiKey ||
|
||||||
(!method || method == "GET" || method == "get"
|
(!method || method == "GET" || method == "get"
|
||||||
? process.env.DSQL_READ_ONLY_API_KEY
|
? process.env.DSQL_READ_ONLY_API_KEY
|
||||||
: undefined) ||
|
: undefined) ||
|
||||||
|
@ -2268,10 +2268,12 @@ export type APIGetMediaParams = {
|
|||||||
skipBase64?: "true" | "false";
|
skipBase64?: "true" | "false";
|
||||||
stream?: "stream";
|
stream?: "stream";
|
||||||
thumbnail?: "true" | "false";
|
thumbnail?: "true" | "false";
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AddMediaAPIBody = {
|
export type AddMediaAPIBody = {
|
||||||
media: MediaUploadDataType[];
|
media: MediaUploadDataType[];
|
||||||
folder?: string | null;
|
folder?: string | null;
|
||||||
type: (typeof MediaTypes)[number];
|
type: (typeof MediaTypes)[number];
|
||||||
|
apiKey?: string;
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/datasquirel",
|
"name": "@moduletrace/datasquirel",
|
||||||
"version": "4.7.5",
|
"version": "4.7.6",
|
||||||
"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