From fd175481e534c55e5764de3a7273974dedfad3d1 Mon Sep 17 00:00:00 2001 From: Paul V Puey Date: Sun, 1 Oct 2023 11:31:01 -0700 Subject: [PATCH] Put api keys in explicit apiKey object --- src/queryEngine.ts | 2 +- src/types.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/queryEngine.ts b/src/queryEngine.ts index 3656ab98..757bbadf 100644 --- a/src/queryEngine.ts +++ b/src/queryEngine.ts @@ -323,7 +323,7 @@ async function runPlugin( } // set apiKeys and settings for use in partner's function - const apiKeys = app.partnerIds[partnerId] + const { apiKeys } = app.partnerIds[partnerId] const settings = progressSettings.progressCache datelog(`Querying ${app.appId.toLowerCase()}_${partnerId}`) // run the plugin function diff --git a/src/types.ts b/src/types.ts index 8aa9f37d..e1d8cb66 100644 --- a/src/types.ts +++ b/src/types.ts @@ -78,13 +78,16 @@ export const asStandardPluginParams = asObject({ }) }) -const asApiKeys = asMap(asString) +const asPartnerInfo = asObject({ + apiKeys: asMap(asString) +}) + export const asApp = asObject({ _id: asString, _rev: asString, appId: asString, appName: asString, - partnerIds: asMap(asApiKeys) + partnerIds: asMap(asPartnerInfo) }) export const asApps = asArray(asApp)