From 3dbb64b9a746c25143d4d21f732402c99472d3e1 Mon Sep 17 00:00:00 2001 From: Arian Flores Date: Wed, 20 Sep 2023 14:20:35 -0700 Subject: [PATCH] Removes deprecation warnings for @magic-ext/auth methods --- .../@magic-sdk/provider/src/modules/auth.ts | 36 ------------------- .../@magic-sdk/provider/src/modules/user.ts | 8 ++++- 2 files changed, 7 insertions(+), 37 deletions(-) diff --git a/packages/@magic-sdk/provider/src/modules/auth.ts b/packages/@magic-sdk/provider/src/modules/auth.ts index 0983ff5f4..f5339478f 100644 --- a/packages/@magic-sdk/provider/src/modules/auth.ts +++ b/packages/@magic-sdk/provider/src/modules/auth.ts @@ -13,16 +13,8 @@ import { BaseModule } from './base-module'; import { createJsonRpcRequestPayload } from '../core/json-rpc'; import { SDKEnvironment } from '../core/sdk-environment'; import { UpdateEmailEvents } from './user'; -import { createDeprecationWarning } from '../core/sdk-exceptions'; import { isMajorVersionAtLeast } from '../util/version-check'; -export const ProductConsolidationMethodRemovalVersions = { - 'magic-sdk': 'v18.0.0', - '@magic-sdk/react-native': 'v14.0.0', - '@magic-sdk/react-native-bare': 'v19.0.0', - '@magic-sdk/react-native-expo': 'v19.0.0', -}; - export class AuthModule extends BaseModule { /** * Initiate the "magic link" login flow for a user. If the flow is successful, @@ -41,14 +33,6 @@ export class AuthModule extends BaseModule { ); } - createDeprecationWarning({ - method: 'auth.loginWithMagicLink()', - removalVersions: ProductConsolidationMethodRemovalVersions, - useInstead: isRNMobilePackage - ? '@magic-ext/auth auth.loginWithEmailOTP()' - : '@magic-ext/auth auth.loginWithMagicLink()', - }).log(); - const { email, showUI = true, redirectURI } = configuration; const requestPayload = createJsonRpcRequestPayload( @@ -64,11 +48,6 @@ export class AuthModule extends BaseModule { * of 15 minutes) */ public loginWithSMS(configuration: LoginWithSmsConfiguration) { - createDeprecationWarning({ - method: 'auth.loginWithSMS()', - removalVersions: ProductConsolidationMethodRemovalVersions, - useInstead: '@magic-ext/auth auth.loginWithSMS()', - }).log(); const { phoneNumber } = configuration; const requestPayload = createJsonRpcRequestPayload( this.sdk.testMode ? MagicPayloadMethod.LoginWithSmsTestMode : MagicPayloadMethod.LoginWithSms, @@ -116,11 +95,6 @@ export class AuthModule extends BaseModule { * `window.location.search`. */ public loginWithCredential(credentialOrQueryString?: string) { - createDeprecationWarning({ - method: 'auth.loginWithCredential()', - removalVersions: ProductConsolidationMethodRemovalVersions, - useInstead: '@magic-ext/auth auth.loginWithCredential()', - }).log(); let credentialResolved = credentialOrQueryString ?? ''; if (!credentialOrQueryString && SDKEnvironment.platform === 'web') { @@ -141,21 +115,11 @@ export class AuthModule extends BaseModule { // Custom Auth public setAuthorizationToken(jwt: string) { - createDeprecationWarning({ - method: 'auth.setAuthorizationToken()', - removalVersions: ProductConsolidationMethodRemovalVersions, - useInstead: '@magic-ext/auth auth.setAuthorizationToken()', - }).log(); const requestPayload = createJsonRpcRequestPayload(MagicPayloadMethod.SetAuthorizationToken, [{ jwt }]); return this.request(requestPayload); } public updateEmailWithUI(configuration: UpdateEmailConfiguration) { - createDeprecationWarning({ - method: 'auth.updateEmailWithUI()', - removalVersions: ProductConsolidationMethodRemovalVersions, - useInstead: '@magic-ext/auth auth.updateEmailWithUI()', - }).log(); const { email, showUI = true } = configuration; const requestPayload = createJsonRpcRequestPayload( this.sdk.testMode ? MagicPayloadMethod.UpdateEmailTestMode : MagicPayloadMethod.UpdateEmail, diff --git a/packages/@magic-sdk/provider/src/modules/user.ts b/packages/@magic-sdk/provider/src/modules/user.ts index a26dd90a6..a4a99e40a 100644 --- a/packages/@magic-sdk/provider/src/modules/user.ts +++ b/packages/@magic-sdk/provider/src/modules/user.ts @@ -13,7 +13,13 @@ import { getItem, removeItem } from '../util/storage'; import { BaseModule } from './base-module'; import { createJsonRpcRequestPayload } from '../core/json-rpc'; import { createDeprecationWarning } from '../core/sdk-exceptions'; -import { ProductConsolidationMethodRemovalVersions } from './auth'; + +const ProductConsolidationMethodRemovalVersions = { + 'magic-sdk': 'v18.0.0', + '@magic-sdk/react-native': 'v14.0.0', + '@magic-sdk/react-native-bare': 'v19.0.0', + '@magic-sdk/react-native-expo': 'v19.0.0', +}; export type UpdateEmailEvents = { 'email-sent': () => void;