This commit is contained in:
Benjamin Toby 2024-12-06 11:53:26 +01:00
parent c49513c189
commit 34868ee0cf
5 changed files with 29 additions and 4 deletions

18
index.d.ts vendored
View File

@ -49,4 +49,22 @@ import sqlGenerator = require("./package-shared/functions/dsql/sql/sql-generator
import sqlInsertGenerator = require("./package-shared/functions/dsql/sql/sql-insert-generator"); import sqlInsertGenerator = require("./package-shared/functions/dsql/sql/sql-insert-generator");
import sqlDeleteGenerator = require("./package-shared/functions/dsql/sql/sql-delete-generator"); import sqlDeleteGenerator = require("./package-shared/functions/dsql/sql/sql-delete-generator");
import trimSql = require("./package-shared/utils/trim-sql"); import trimSql = require("./package-shared/utils/trim-sql");
export declare namespace utils {
namespace crypto {
let encrypt: ({ data, encryptionKey, encryptionSalt }: {
data: string;
encryptionKey?: string;
encryptionSalt?: string;
}) => string | null;
let decrypt: ({ encryptedString, encryptionKey, encryptionSalt }: {
encryptedString: string;
encryptionKey?: string;
encryptionSalt?: string;
}) => string;
let hashPassword: ({ password, encryptionKey }: {
password: string;
encryptionKey: string;
}) => string;
}
}
export { get, post, getSchema, sanitizeSql, datasquirelClient as client }; export { get, post, getSchema, sanitizeSql, datasquirelClient as client };

View File

@ -88,6 +88,13 @@ const datasquirel = {
sanitizeSql, sanitizeSql,
client: datasquirelClient, client: datasquirelClient,
sql, sql,
utils: {
crypto: {
encrypt: require("./package-shared/functions/dsql/encrypt"),
decrypt: require("./package-shared/functions/dsql/decrypt"),
hashPassword: require("./package-shared/functions/dsql/hashPassword"),
},
},
}; };
module.exports = datasquirel; module.exports = datasquirel;

View File

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

4
users/add-user.d.ts vendored
View File

@ -11,7 +11,7 @@ export = addUser;
* @param {string} param.encryptionKey * @param {string} param.encryptionKey
* @param {string} [param.encryptionSalt] * @param {string} [param.encryptionSalt]
* @param {string | number} [param.user_id] * @param {string | number} [param.user_id]
* @param {string | number} param.apiUserId * @param {string | number} [param.apiUserId]
* @param {boolean} [param.useLocal] * @param {boolean} [param.useLocal]
* *
* @returns { Promise<import("../package-shared/types").AddUserFunctionReturn> } * @returns { Promise<import("../package-shared/types").AddUserFunctionReturn> }
@ -23,6 +23,6 @@ declare function addUser({ key, payload, database, encryptionKey, user_id, useLo
encryptionKey: string; encryptionKey: string;
encryptionSalt?: string; encryptionSalt?: string;
user_id?: string | number; user_id?: string | number;
apiUserId: string | number; apiUserId?: string | number;
useLocal?: boolean; useLocal?: boolean;
}): Promise<import("../package-shared/types").AddUserFunctionReturn>; }): Promise<import("../package-shared/types").AddUserFunctionReturn>;

View File

@ -17,7 +17,7 @@ const apiCreateUser = require("../package-shared/functions/api/users/api-create-
* @param {string} param.encryptionKey * @param {string} param.encryptionKey
* @param {string} [param.encryptionSalt] * @param {string} [param.encryptionSalt]
* @param {string | number} [param.user_id] * @param {string | number} [param.user_id]
* @param {string | number} param.apiUserId * @param {string | number} [param.apiUserId]
* @param {boolean} [param.useLocal] * @param {boolean} [param.useLocal]
* *
* @returns { Promise<import("../package-shared/types").AddUserFunctionReturn> } * @returns { Promise<import("../package-shared/types").AddUserFunctionReturn> }