2024-11-08 15:44:31 +00:00
|
|
|
export = googleAuth;
|
|
|
|
/**
|
|
|
|
* SERVER FUNCTION: Login with google Function
|
|
|
|
* ==============================================================================
|
|
|
|
*
|
|
|
|
* @async
|
|
|
|
*
|
|
|
|
* @param {object} params - main params object
|
2024-12-08 08:58:57 +00:00
|
|
|
* @param {string} [params.key] - API full access key
|
2024-11-08 15:44:31 +00:00
|
|
|
* @param {string} params.token - Google access token gotten from the client side
|
2024-12-10 18:44:11 +00:00
|
|
|
* @param {string} [params.database] - Target database name
|
2024-12-08 08:58:57 +00:00
|
|
|
* @param {http.ServerResponse} [params.response] - HTTPS response object
|
|
|
|
* @param {string} [params.encryptionKey] - Encryption key
|
|
|
|
* @param {string} [params.encryptionSalt] - Encryption salt
|
|
|
|
* @param {string[]} [params.additionalFields] - Additional Fields to be added to the user object
|
2024-12-10 18:44:11 +00:00
|
|
|
* @param {string | number} [params.apiUserID] - API user ID
|
2024-12-06 10:44:26 +00:00
|
|
|
* @param {boolean} [params.useLocal] - Whether to use a remote database instead of API
|
2024-11-08 15:44:31 +00:00
|
|
|
*
|
2024-12-10 18:51:02 +00:00
|
|
|
* @returns { Promise<import("../../package-shared/types").APILoginFunctionReturn> }
|
2024-11-08 15:44:31 +00:00
|
|
|
*/
|
2024-12-10 18:44:11 +00:00
|
|
|
declare function googleAuth({ key, token, database, response, encryptionKey, encryptionSalt, additionalFields, apiUserID, useLocal, }: {
|
2024-12-08 08:58:57 +00:00
|
|
|
key?: string;
|
2024-11-08 15:44:31 +00:00
|
|
|
token: string;
|
2024-12-10 18:44:11 +00:00
|
|
|
database?: string;
|
2024-12-08 08:58:57 +00:00
|
|
|
response?: http.ServerResponse;
|
|
|
|
encryptionKey?: string;
|
|
|
|
encryptionSalt?: string;
|
|
|
|
additionalFields?: string[];
|
2024-12-06 10:44:26 +00:00
|
|
|
apiUserID?: string | number;
|
|
|
|
useLocal?: boolean;
|
2024-12-10 18:51:02 +00:00
|
|
|
}): Promise<import("../../package-shared/types").APILoginFunctionReturn>;
|
2024-11-08 15:44:31 +00:00
|
|
|
import http = require("http");
|