
* [skip ci] tRPC shared package * [skip ci] tRPC shared package - fix * [skip ci] shared package - app sections * [skip ci] segment - implement shared components * [skip ci] extract theme synchronizer * extract components and implement them in apps * cms - extract shared packages * Fix imports * remove urql from peer deps
24 lines
698 B
TypeScript
24 lines
698 B
TypeScript
import { SettingsManager } from "@saleor/app-sdk/settings-manager";
|
|
import { AppConfigurationFields } from "./configuration";
|
|
|
|
/**
|
|
* Before single-key configuration was introduced, this was a shape of settings.
|
|
*/
|
|
export const fetchLegacyConfiguration = async (
|
|
settingsManager: SettingsManager,
|
|
domain: string,
|
|
): Promise<AppConfigurationFields | null> => {
|
|
const secretKey = await settingsManager.get("secretKey", domain);
|
|
const appId = await settingsManager.get("appId", domain);
|
|
const indexNamePrefix = await settingsManager.get("indexNamePrefix", domain);
|
|
|
|
if (secretKey && appId) {
|
|
return {
|
|
appId,
|
|
secretKey,
|
|
indexNamePrefix,
|
|
};
|
|
}
|
|
|
|
return null;
|
|
};
|