2024-04-03 19:51:09 +02:00
|
|
|
import { AppType } from '@joplin/lib/models/Setting';
|
2024-03-29 14:40:54 +02:00
|
|
|
import RepositoryApi, { InstallMode } from '@joplin/lib/services/plugins/RepositoryApi';
|
2024-03-11 17:02:15 +02:00
|
|
|
import { createTempDir, supportDir } from '@joplin/lib/testing/test-utils';
|
|
|
|
|
|
|
|
|
2024-04-03 19:51:09 +02: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 11:02:42 +02:00
|
|
|
await repo.reinitialize();
|
2024-03-11 17:02:15 +02:00
|
|
|
return repo;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default newRepoApi;
|