diff --git a/dist/index.d.ts b/dist/index.d.ts index b75e5db..f040b8c 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -54,6 +54,7 @@ declare const datasquirel: { update: typeof import("./package-shared/actions/users/update-user").default; resetPassword: typeof import("./package-shared/actions/users/reset-password").default; googleLogin: typeof import("./package-shared/actions/users/social/google-auth").default; + githubLoginFn: typeof import("./package-shared/functions/api/social-login/githubLogin").default; logout: typeof import("./package-shared/actions/users/logout-user").default; auth: typeof import("./package-shared/actions/users/user-auth").default; validateTempEmailCode: typeof import("./package-shared/actions/users/validate-temp-email-code").default; diff --git a/dist/package-shared/api/user/index.d.ts b/dist/package-shared/api/user/index.d.ts index 8f6a374..0bd11f2 100644 --- a/dist/package-shared/api/user/index.d.ts +++ b/dist/package-shared/api/user/index.d.ts @@ -8,6 +8,7 @@ import googleAuth from "../../actions/users/social/google-auth"; import updateUser from "../../actions/users/update-user"; import userAuth from "../../actions/users/user-auth"; import validateTempEmailCode from "../../actions/users/validate-temp-email-code"; +import githubLogin from "../../functions/api/social-login/githubLogin"; declare const user: { auth: { login: typeof loginUser; @@ -17,6 +18,7 @@ declare const user: { update: typeof updateUser; resetPassword: typeof resetPassword; googleLogin: typeof googleAuth; + githubLoginFn: typeof githubLogin; logout: typeof logoutUser; auth: typeof userAuth; validateTempEmailCode: typeof validateTempEmailCode; diff --git a/dist/package-shared/api/user/index.js b/dist/package-shared/api/user/index.js index a9654ed..60f51b6 100644 --- a/dist/package-shared/api/user/index.js +++ b/dist/package-shared/api/user/index.js @@ -13,6 +13,7 @@ const google_auth_1 = __importDefault(require("../../actions/users/social/google const update_user_1 = __importDefault(require("../../actions/users/update-user")); const user_auth_1 = __importDefault(require("../../actions/users/user-auth")); const validate_temp_email_code_1 = __importDefault(require("../../actions/users/validate-temp-email-code")); +const githubLogin_1 = __importDefault(require("../../functions/api/social-login/githubLogin")); const user = { auth: { login: login_user_1.default, @@ -22,6 +23,7 @@ const user = { update: update_user_1.default, resetPassword: reset_password_1.default, googleLogin: google_auth_1.default, + githubLoginFn: githubLogin_1.default, logout: logout_user_1.default, auth: user_auth_1.default, validateTempEmailCode: validate_temp_email_code_1.default, diff --git a/dist/package-shared/functions/api/social-login/githubLogin.d.ts b/dist/package-shared/functions/api/social-login/githubLogin.d.ts index 4f064bd..718d0f1 100644 --- a/dist/package-shared/functions/api/social-login/githubLogin.d.ts +++ b/dist/package-shared/functions/api/social-login/githubLogin.d.ts @@ -1,36 +1,4 @@ -export interface GithubUserPayload { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - name: string; - company: string; - blog: string; - location: string; - email: string; - hireable: string; - bio: string; - twitter_username: string; - public_repos: number; - public_gists: number; - followers: number; - following: number; - created_at: string; - updated_at: string; -} +import { GithubUserPayload } from "../../../types"; type Param = { code: string; clientId: string; diff --git a/dist/package-shared/functions/api/social-login/githubLogin.js b/dist/package-shared/functions/api/social-login/githubLogin.js index 8567396..6f2c367 100644 --- a/dist/package-shared/functions/api/social-login/githubLogin.js +++ b/dist/package-shared/functions/api/social-login/githubLogin.js @@ -57,7 +57,7 @@ function githubLogin(_a) { } } } - catch ( /** @type {any} */error) { + catch (error) { console.log("ERROR in githubLogin.ts backend function =>", error.message); } return gitHubUser; diff --git a/dist/package-shared/types/index.d.ts b/dist/package-shared/types/index.d.ts index cb7ac8f..3f8b6f3 100644 --- a/dist/package-shared/types/index.d.ts +++ b/dist/package-shared/types/index.d.ts @@ -2410,3 +2410,36 @@ export type AddDbEntryParamOnDuplicate = { sql: string; values?: string[]; }; +export interface GithubUserPayload { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + name: string; + company: string; + blog: string; + location: string; + email: string; + hireable: string; + bio: string; + twitter_username: string; + public_repos: number; + public_gists: number; + followers: number; + following: number; + created_at: string; + updated_at: string; +} diff --git a/package-shared/api/user/index.ts b/package-shared/api/user/index.ts index 35eb707..280d45c 100644 --- a/package-shared/api/user/index.ts +++ b/package-shared/api/user/index.ts @@ -8,6 +8,7 @@ import googleAuth from "../../actions/users/social/google-auth"; import updateUser from "../../actions/users/update-user"; import userAuth from "../../actions/users/user-auth"; import validateTempEmailCode from "../../actions/users/validate-temp-email-code"; +import githubLogin from "../../functions/api/social-login/githubLogin"; const user = { auth: { @@ -18,6 +19,7 @@ const user = { update: updateUser, resetPassword: resetPassword, googleLogin: googleAuth, + githubLoginFn: githubLogin, logout: logoutUser, auth: userAuth, validateTempEmailCode, diff --git a/package-shared/functions/api/social-login/githubLogin.ts b/package-shared/functions/api/social-login/githubLogin.ts index 840cd3e..74f6dc2 100644 --- a/package-shared/functions/api/social-login/githubLogin.ts +++ b/package-shared/functions/api/social-login/githubLogin.ts @@ -1,40 +1,7 @@ +import { GithubUserPayload } from "../../../types"; import dbHandler from "../../backend/dbHandler"; import httpsRequest from "../../backend/httpsRequest"; -export interface GithubUserPayload { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - name: string; - company: string; - blog: string; - location: string; - email: string; - hireable: string; - bio: string; - twitter_username: string; - public_repos: number; - public_gists: number; - followers: number; - following: number; - created_at: string; - updated_at: string; -} - type Param = { code: string; clientId: string; @@ -92,10 +59,10 @@ export default async function githubLogin({ gitHubUser.email = existingGithubUser[0].email; } } - } catch (/** @type {any} */ error: any) { + } catch (error: any) { console.log( "ERROR in githubLogin.ts backend function =>", - error.message + error.message, ); } diff --git a/package-shared/types/index.ts b/package-shared/types/index.ts index 7770596..24bd44e 100644 --- a/package-shared/types/index.ts +++ b/package-shared/types/index.ts @@ -3101,3 +3101,37 @@ export type AddDbEntryParamOnDuplicate = { sql: string; values?: string[]; }; + +export interface GithubUserPayload { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + name: string; + company: string; + blog: string; + location: string; + email: string; + hireable: string; + bio: string; + twitter_username: string; + public_repos: number; + public_gists: number; + followers: number; + following: number; + created_at: string; + updated_at: string; +} diff --git a/package.json b/package.json index 19a8d6c..ffc1bc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "5.7.32", + "version": "5.7.33", "description": "Cloud-based SQL data management tool", "main": "dist/index.js", "bin": {