From 195d5686fb3049ea52832fdf956bb6adfd29540d Mon Sep 17 00:00:00 2001 From: jotacemarin Date: Sat, 7 Sep 2024 21:31:15 -0500 Subject: [PATCH] Add lambda to yml --- index.ts | 1 + serverless.yml | 1 + src/functions/telegram_get_messages/function.yml | 4 ++-- src/functions/telegram_get_messages/index.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index 155aab8..efb463b 100644 --- a/index.ts +++ b/index.ts @@ -11,3 +11,4 @@ export { telegramCleanReplyMarkup } from "./src/functions/telegram_clean_reply_m export { telegramMembersMute } from "./src/functions/telegram_members_mute"; export { telegramMembersUnmute } from "./src/functions/telegram_members_unmute"; export { telegramPublicWebhook } from "./src/functions/telegram_public_webhook"; +export { telegramGetMessages } from "./src/functions/telegram_get_messages"; diff --git a/serverless.yml b/serverless.yml index fbc5372..41546ca 100644 --- a/serverless.yml +++ b/serverless.yml @@ -39,3 +39,4 @@ functions: telegramMembersMute: ${file(./src/functions/telegram_members_mute/function.yml)} telegramMembersUnmute: ${file(./src/functions/telegram_members_unmute/function.yml)} telegramPublicWebhook: ${file(./src/functions/telegram_public_webhook/function.yml)} + telegramGetAllMessages: ${file(./src/functions/telegram_get_messages/function.yml)} diff --git a/src/functions/telegram_get_messages/function.yml b/src/functions/telegram_get_messages/function.yml index 8a95cb5..54fee34 100644 --- a/src/functions/telegram_get_messages/function.yml +++ b/src/functions/telegram_get_messages/function.yml @@ -1,11 +1,11 @@ name: ${self:custom.secrets.service.name}-${self:custom.secrets.provider.stage}-telegram-get-messages -handler: index.telegramGetAll +handler: index.telegramGetMessages memorySize: 128 timeout: 30 reservedConcurrency: 5 events: - http: path: /${self:custom.secrets.service.name}-${self:custom.secrets.provider.stage}/telegram/get-messages - method: POST + method: GET cors: true authorizer: telegramAuthorizer diff --git a/src/functions/telegram_get_messages/index.ts b/src/functions/telegram_get_messages/index.ts index cb95f03..c72741a 100644 --- a/src/functions/telegram_get_messages/index.ts +++ b/src/functions/telegram_get_messages/index.ts @@ -9,7 +9,7 @@ const execute = async (): Promise => { return { statusCode: OK, body: JSON.stringify(messages) }; }; -export const telegramGetAll = async ( +export const telegramGetMessages = async ( event: APIGatewayEvent, context: Context, callback: Callback