Remove all 'useLocal' params

This commit is contained in:
Benjamin Toby
2025-01-20 09:12:43 +01:00
parent 16191975f9
commit 7d0f3e12f3
113 changed files with 164 additions and 425 deletions
+1 -4
View File
@@ -15,7 +15,6 @@ type Param = {
encryptionSalt?: string;
user_id?: string | number;
apiUserId?: string | number;
useLocal?: boolean;
};
/**
@@ -27,7 +26,6 @@ export default async function addUser({
database,
encryptionKey,
user_id,
useLocal,
apiUserId,
}: Param): Promise<AddUserFunctionReturn> {
/**
@@ -51,7 +49,7 @@ export default async function addUser({
DSQL_DB_USERNAME?.match(/./) &&
DSQL_DB_PASSWORD?.match(/./) &&
DSQL_DB_NAME?.match(/./) &&
useLocal
global.DSQL_USE_LOCAL
) {
/** @type {import("../package-shared/types").DSQL_DatabaseSchemaType | undefined} */
let dbSchema:
@@ -71,7 +69,6 @@ export default async function addUser({
encryptionKey,
payload,
userId: apiUserId,
useLocal,
});
}
+1 -4
View File
@@ -9,7 +9,6 @@ type Param = {
database?: string;
deletedUserId: string | number;
user_id?: boolean;
useLocal?: boolean;
};
/**
@@ -19,7 +18,6 @@ export default async function deleteUser({
key,
database,
user_id,
useLocal,
deletedUserId,
}: Param): Promise<UpdateUserFunctionReturn> {
/**
@@ -38,7 +36,7 @@ export default async function deleteUser({
DSQL_DB_USERNAME?.match(/./) &&
DSQL_DB_PASSWORD?.match(/./) &&
DSQL_DB_NAME?.match(/./) &&
useLocal
global.DSQL_USE_LOCAL
) {
/** @type {import("../package-shared/types").DSQL_DatabaseSchemaType | undefined} */
let dbSchema:
@@ -55,7 +53,6 @@ export default async function deleteUser({
return await apiDeleteUser({
dbFullName: DSQL_DB_NAME,
useLocal,
deletedUserId,
});
}
-3
View File
@@ -9,7 +9,6 @@ type Param = {
encryptionKey: string;
encryptionSalt: string;
database: string;
useLocal?: boolean;
};
type Return = {
@@ -27,8 +26,6 @@ export default function getToken({
request,
encryptionKey,
encryptionSalt,
database,
useLocal,
cookieString,
}: Param): Return {
try {
+1 -4
View File
@@ -10,7 +10,6 @@ type Param = {
userId: number;
fields?: string[];
apiUserId?: boolean;
useLocal?: boolean;
};
/**
@@ -22,7 +21,6 @@ export default async function getUser({
database,
fields,
apiUserId,
useLocal,
}: Param): Promise<GetUserFunctionReturn> {
/**
* Initialize
@@ -69,7 +67,7 @@ export default async function getUser({
DSQL_DB_USERNAME?.match(/./) &&
DSQL_DB_PASSWORD?.match(/./) &&
DSQL_DB_NAME?.match(/./) &&
useLocal
global.DSQL_USE_LOCAL
) {
/** @type {import("../package-shared/types").DSQL_DatabaseSchemaType | undefined} */
let dbSchema:
@@ -88,7 +86,6 @@ export default async function getUser({
userId,
fields: [...new Set(updatedFields)],
dbFullName: DSQL_DB_NAME,
useLocal,
});
}
+1 -4
View File
@@ -30,7 +30,6 @@ type Param = {
token?: boolean;
user_id?: string | number;
skipPassword?: boolean;
useLocal?: boolean;
debug?: boolean;
skipWriteAuthFile?: boolean;
apiUserID?: string | number;
@@ -54,7 +53,6 @@ export default async function loginUser({
token,
user_id,
skipPassword,
useLocal,
apiUserID,
skipWriteAuthFile,
dbUserId,
@@ -128,7 +126,7 @@ export default async function loginUser({
DSQL_DB_USERNAME?.match(/./) &&
DSQL_DB_PASSWORD?.match(/./) &&
DSQL_DB_NAME?.match(/./) &&
useLocal
global.DSQL_USE_LOCAL
) {
let dbSchema: DSQL_DatabaseSchemaType | undefined;
@@ -152,7 +150,6 @@ export default async function loginUser({
email_login_code,
email_login_field: emailLoginTempCodeFieldName,
token,
useLocal,
dbUserId,
debug,
});
+1 -4
View File
@@ -25,7 +25,6 @@ type Param = {
additionalFields?: string[];
encryptedUserString?: string;
user_id?: string | number;
useLocal?: boolean;
};
/**
@@ -42,7 +41,6 @@ export default async function reauthUser({
additionalFields,
encryptedUserString,
user_id,
useLocal,
}: Param): Promise<APILoginFunctionReturn> {
/**
* Check Encryption Keys
@@ -92,7 +90,7 @@ export default async function reauthUser({
DSQL_DB_USERNAME?.match(/./) &&
DSQL_DB_PASSWORD?.match(/./) &&
DSQL_DB_NAME?.match(/./) &&
useLocal
global.DSQL_USE_LOCAL
) {
/** @type {import("../package-shared/types").DSQL_DatabaseSchemaType | undefined} */
let dbSchema:
@@ -110,7 +108,6 @@ export default async function reauthUser({
httpResponse = await apiReauthUser({
existingUser: existingUser.payload,
additionalFields,
useLocal,
});
} else {
/**
+1 -4
View File
@@ -17,7 +17,6 @@ type Param = {
mail_port?: number;
sender?: string;
user_id?: boolean;
useLocal?: boolean;
extraCookies?: import("../package-shared/types").CookieObject[];
};
@@ -35,7 +34,6 @@ export default async function sendEmailCode({
mail_port,
sender,
user_id,
useLocal,
response,
extraCookies,
}: Param): Promise<SendOneTimeCodeEmailResponse> {
@@ -65,7 +63,7 @@ export default async function sendEmailCode({
DSQL_DB_USERNAME?.match(/./) &&
DSQL_DB_PASSWORD?.match(/./) &&
DSQL_DB_NAME?.match(/./) &&
useLocal
global.DSQL_USE_LOCAL
) {
/** @type {import("../package-shared/types").DSQL_DatabaseSchemaType | undefined} */
let dbSchema:
@@ -90,7 +88,6 @@ export default async function sendEmailCode({
mail_port,
mail_username,
sender,
useLocal,
response,
extraCookies,
});
+1 -4
View File
@@ -16,7 +16,6 @@ type Param = {
additionalFields?: string[];
additionalData?: { [s: string]: string | number };
apiUserID?: string | number;
useLocal?: boolean;
debug?: boolean;
};
@@ -33,7 +32,6 @@ export default async function googleAuth({
additionalFields,
additionalData,
apiUserID,
useLocal,
debug,
}: Param): Promise<APILoginFunctionReturn> {
const grabedHostNames = grabHostNames();
@@ -96,7 +94,7 @@ export default async function googleAuth({
DSQL_DB_USERNAME?.match(/./) &&
DSQL_DB_PASSWORD?.match(/./) &&
DSQL_DB_NAME?.match(/./) &&
useLocal
global.DSQL_USE_LOCAL
) {
if (debug) {
console.log(`Google login with Local Paradigm ...`);
@@ -107,7 +105,6 @@ export default async function googleAuth({
additionalFields,
additionalData,
debug,
useLocal: true,
});
} else {
/**
+1 -4
View File
@@ -10,7 +10,6 @@ type Param = {
updatedUserId: string | number;
payload: { [s: string]: any };
user_id?: boolean;
useLocal?: boolean;
};
/**
@@ -21,7 +20,6 @@ export default async function updateUser({
payload,
database,
user_id,
useLocal,
updatedUserId,
}: Param): Promise<UpdateUserFunctionReturn> {
/**
@@ -40,7 +38,7 @@ export default async function updateUser({
DSQL_DB_USERNAME?.match(/./) &&
DSQL_DB_PASSWORD?.match(/./) &&
DSQL_DB_NAME?.match(/./) &&
useLocal
global.DSQL_USE_LOCAL
) {
/** @type {import("../package-shared/types").DSQL_DatabaseSchemaType | undefined} */
let dbSchema:
@@ -58,7 +56,6 @@ export default async function updateUser({
return await apiUpdateUser({
payload: payload,
dbFullName: DSQL_DB_NAME,
useLocal,
updatedUserId,
dbSchema,
});