2024-04-03 10:51:09 -07:00
|
|
|
import { AppType } from '@joplin/lib/models/Setting';
|
2024-03-29 05:40:54 -07:00
|
|
|
import RepositoryApi, { InstallMode } from '@joplin/lib/services/plugins/RepositoryApi';
|
2024-03-11 08:02:15 -07:00
|
|
|
import { createTempDir, supportDir } from '@joplin/lib/testing/test-utils';
|
|
|
|
|
|
|
|
|
2024-04-03 10:51:09 -07:00
|
|
|
const newRepoApi = async (installMode: InstallMode, appVersion = '3.0.0'): Promise<RepositoryApi> => {
|
|
|
|
const appInfo = { type: AppType.Mobile, version: appVersion };
|
|
|
|
const repo = new RepositoryApi(`${supportDir}/pluginRepo`, await createTempDir(), appInfo, installMode);
|
2024-06-18 02:02:42 -07:00
|
|
|
await repo.reinitialize();
|
2024-03-11 08:02:15 -07:00
|
|
|
return repo;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default newRepoApi;
|