diff --git a/Example/expoUsePushy/TestConsole.js b/Example/expoUsePushy/TestConsole.js index c05fa5d5..2e5ef9f9 100644 --- a/Example/expoUsePushy/TestConsole.js +++ b/Example/expoUsePushy/TestConsole.js @@ -59,10 +59,6 @@ export default function TestConsole({visible, onClose}) { }, }, { - name: 'getLocalHashInfo', - invoke: () => { - setText(`getLocalHashInfo\n${Hash}`); - }, }, { name: 'setUuid', diff --git a/Example/harmony_use_pushy/TestConsole.js b/Example/harmony_use_pushy/TestConsole.js index c05fa5d5..2e5ef9f9 100644 --- a/Example/harmony_use_pushy/TestConsole.js +++ b/Example/harmony_use_pushy/TestConsole.js @@ -59,10 +59,6 @@ export default function TestConsole({visible, onClose}) { }, }, { - name: 'getLocalHashInfo', - invoke: () => { - setText(`getLocalHashInfo\n${Hash}`); - }, }, { name: 'setUuid', diff --git a/Example/testHotUpdate/e2e/local-merge.test.js b/Example/testHotUpdate/e2e/local-merge.test.js index 2eca04c1..954ad4b5 100644 --- a/Example/testHotUpdate/e2e/local-merge.test.js +++ b/Example/testHotUpdate/e2e/local-merge.test.js @@ -97,7 +97,6 @@ describe('Local Update Merge E2E', () => { await openTestConsole(); await runCommand('setLocalHashInfo'); - await runCommand('getLocalHashInfo'); await runCommand('setUuid'); await runCommand('downloadFullUpdate'); await runCommand('setNeedUpdateFull'); diff --git a/Example/testHotUpdate/src/TestConsole.js b/Example/testHotUpdate/src/TestConsole.js index ec6b6d8d..6ca3b084 100644 --- a/Example/testHotUpdate/src/TestConsole.js +++ b/Example/testHotUpdate/src/TestConsole.js @@ -87,10 +87,6 @@ export default function TestConsole({visible, onClose}) { }, }, { - name: 'getLocalHashInfo', - invoke: () => { - setText(convertCommands('getLocalHashInfo', LOCAL_UPDATE_HASHES.full)); - }, }, { name: 'setUuid', diff --git a/src/__tests__/core.test.ts b/src/__tests__/core.test.ts index 420cc78d..4c9b78a7 100644 --- a/src/__tests__/core.test.ts +++ b/src/__tests__/core.test.ts @@ -32,7 +32,6 @@ describe('core info parsing', () => { buildTime: '2023-01-01', uuid: 'existing-uuid', setLocalHashInfo: mock(() => {}), - getLocalHashInfo: mock(() => Promise.resolve('{}')), setUuid: mock(() => {}), }, }, @@ -84,7 +83,6 @@ describe('core info parsing', () => { buildTime: '2023-01-01', uuid: 'existing-uuid', setLocalHashInfo: mockSetLocalHashInfo, - getLocalHashInfo: mock(() => Promise.resolve('{}')), setUuid: mock(() => {}), }, }, diff --git a/src/context.ts b/src/context.ts index 8fbf5e92..c5f4afa3 100644 --- a/src/context.ts +++ b/src/context.ts @@ -15,7 +15,6 @@ export const defaultContext = { downloadUpdate: asyncNoop, downloadAndInstallApk: asyncNoop, restartApp: asyncNoop, - getCurrentVersionInfo: () => Promise.resolve({}), parseTestQrCode: () => false, currentHash: '', packageVersion: '', @@ -30,12 +29,6 @@ export const UpdateContext = createContext<{ dismissError: () => void; downloadUpdate: () => Promise; downloadAndInstallApk: (url: string) => Promise; - // @deprecated use currentVersionInfo instead - getCurrentVersionInfo: () => Promise<{ - name?: string; - description?: string; - metaInfo?: string; - }>; currentVersionInfo: { name?: string; description?: string; @@ -61,6 +54,3 @@ export const useUpdate = __DEV__ ? () => { return context; } : () => useContext(UpdateContext); - -/** @deprecated Please use `useUpdate` instead */ -export const usePushy = useUpdate; diff --git a/src/core.ts b/src/core.ts index ec5d1415..58a67248 100644 --- a/src/core.ts +++ b/src/core.ts @@ -65,18 +65,6 @@ export const buildTime: string = PushyConstants.buildTime; let uuid = PushyConstants.uuid; -async function getLocalHashInfo(hash: string) { - return JSON.parse(await PushyModule.getLocalHashInfo(hash)); -} - -// @deprecated use currentVersionInfo instead -export async function getCurrentVersionInfo(): Promise<{ - name?: string; - description?: string; - metaInfo?: string; -}> { - return currentVersion ? (await getLocalHashInfo(currentVersion)) || {} : {}; -} export const pushyNativeEventEmitter = new NativeEventEmitter(PushyModule); diff --git a/src/index.ts b/src/index.ts index 2de9e853..19ebf8bd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ export { Pushy, Cresc } from './client'; -export { UpdateContext, usePushy, useUpdate } from './context'; -export { PushyProvider, UpdateProvider } from './provider'; +export { UpdateContext, useUpdate } from './context'; +export { UpdateProvider } from './provider'; export { PushyModule, UpdateModule } from './core'; diff --git a/src/provider.tsx b/src/provider.tsx index 08dec9ac..f2d82060 100644 --- a/src/provider.tsx +++ b/src/provider.tsx @@ -16,7 +16,6 @@ import { Pushy, Cresc, sharedState } from './client'; import { currentVersion, packageVersion, - getCurrentVersionInfo, currentVersionInfo, } from './core'; import { @@ -411,7 +410,6 @@ export const UpdateProvider = ({ currentHash: currentVersion, progress, downloadAndInstallApk, - getCurrentVersionInfo, currentVersionInfo, parseTestQrCode, restartApp, @@ -420,6 +418,3 @@ export const UpdateProvider = ({ ); }; - -/** @deprecated Please use `UpdateProvider` instead */ -export const PushyProvider = UpdateProvider;