export async function makeSalesforceSSMConfig()

in src/libs/salesforce.ts [37:68]


export async function makeSalesforceSSMConfig(
    stage: string,
): Promise<SalesforceSSMConfig> {
    console.log(`make salesforce config for stage: ${stage}`);
    const clientId = await getSsmValue(stage, 'salesforceClientId');
    const clientSecret = await getSsmValue(stage, 'salesforceClientSecret');
    const username = await getSsmValue(stage, 'salesforceUsername');
    const password = await getSsmValue(stage, 'salesforcePassword');
    const token = await getSsmValue(stage, 'salesforceToken');
    const authenticationBaseUrl = await getSsmValue(
        stage,
        'salesforceAuthenticationBaseUrl',
    );
    if (
        clientId === undefined ||
        clientSecret === undefined ||
        username === undefined ||
        password === undefined ||
        token === undefined ||
        authenticationBaseUrl == undefined
    ) {
        throw 'Could not retrive the salesforce ssm config';
    }
    return Promise.resolve({
        clientId,
        clientSecret,
        username,
        password,
        token,
        authenticationBaseUrl,
    });
}