From dab541d0af1ade9223f0b4b85247b64c98a1d6ee Mon Sep 17 00:00:00 2001 From: rashgaroth <50513263+rashgaroth@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:08:49 +0800 Subject: [PATCH] add build env --- README.md | 6 +++--- package.json | 2 +- src/interfaces.ts | 3 ++- src/utils.ts | 30 ++++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e72d6a3..ae1a5f1 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ const upbond = new Upbond(options); - `options` (optional) : The options of the constructor - `buttonPosition` (optional) : string, default is `BOTTOM_LEFT`
- The position of the Upbond button. Supported values are `top-left` `bottom-left` `top-right` `bottom-right`. Or you can following this code: - ```javascript + The position of the Upbond button. Supported values are `top-left` `bottom-left` `top-right` `bottom-right`. Or you can following this code: + ```javascript BOTTOM_LEFT: "bottom-left", TOP_LEFT: "top-left", BOTTOM_RIGHT: "bottom-right", @@ -271,4 +271,4 @@ You can check this out [here](https://github.com/upbond/embed/tree/master/exampl # Current version -version: v1.0.9 +version: v1.0.10 diff --git a/package.json b/package.json index efab50f..a42bce6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@upbond/upbond-embed", - "version": "1.0.9", + "version": "1.0.10", "description": "Embed script for Upbond", "main": "dist/upbondEmbed.cjs.js", "module": "dist/upbondEmbed.esm.js", diff --git a/src/interfaces.ts b/src/interfaces.ts index e7e3d17..f07586b 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -51,9 +51,10 @@ export const UPBOND_BUILD_ENV = { TESTING: "testing", TORUS_UPBOND: "torus-upbond", DIRECT_TEST: "direct-test", + NEW_DEV_LOCAL: "new-dev-local", } as const; -export type BuildEnv = "production" | "development" | "testing" | "torus-upbond" | "direct-test"; +export type BuildEnv = "production" | "development" | "testing" | "torus-upbond" | "direct-test" | "new-dev-local"; export type PAYMENT_PROVIDER_TYPE = typeof PAYMENT_PROVIDER[keyof typeof PAYMENT_PROVIDER]; diff --git a/src/utils.ts b/src/utils.ts index 5854b08..51b9a4f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -47,6 +47,32 @@ export const defaultLoginParam = { mainOption: true, priority: 1, } as LoginConfigItem, + jwt: { + loginProvider: "jwt", + verifier: "upbond-google-dev-tesnet", + typeOfLogin: "jwt", + name: "google", + description: "", + clientId: "hxFv4SaQVXv3tE_rhe5u9", + verifierSubIdentifier: "torus", + logoHover: "", + logoLight: "", + logoDark: "", + showOnModal: false, + mainOption: false, + showOnDesktop: false, + showOnMobile: false, + // For torus only + buttonDescription: "", + walletVerifier: "upbond-google-dev-tesnet", + jwtParameters: { + domain: "https://lzg2dndj.auth.dev.upbond.io/", + connection: "google", + clientId: "hxFv4SaQVXv3tE_rhe5u9", + redirect_uri: "http://localhost:3002/auth", + }, + customLogo: "google", + } as LoginConfigItem, } as LoginConfig; export const validatePaymentProvider = (provider: string, params: PaymentParams): { errors: PaymentErrors; isValid: boolean } => { @@ -179,6 +205,10 @@ export const getUpbondWalletUrl = async ( torusUrl = "http://localhost:3001"; logLevel = "debug"; break; + case "new-dev-local": + torusUrl = "http://localhost:3000"; + logLevel = "debug"; + break; case "torus-upbond": torusUrl = "https://torus-wallet.upbond.io"; logLevel = "debug";