add zapier integration

This commit is contained in:
chungyau97
2023-06-27 23:01:09 +08:00
parent 4e36be3214
commit dd8b59abb8
2 changed files with 43 additions and 1 deletions
+12
View File
@@ -547,6 +547,18 @@ export const addAPIKey = async (keyName: string): Promise<ICommonObject[]> => {
return content
}
/**
* Get API Key details
* @param {string} apiKey
* @returns {Promise<ICommonObject[]>}
*/
export const getApiKey = async (apiKey: string) => {
const existingAPIKeys = await getAPIKeys()
const keyIndex = existingAPIKeys.findIndex((key) => key.apiKey === apiKey)
if (keyIndex < 0) return undefined
return existingAPIKeys[keyIndex]
}
/**
* Update existing API key
* @param {string} keyIdToUpdate