meta-cloud-api 0.2.37 → 0.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/{BusinessProfileApi-C1x8w77V.d.ts → BusinessProfileApi-DE7Nnuy_.d.ts} +2 -2
  2. package/dist/{EncryptionApi-udtMPgrF.d.ts → EncryptionApi-PHxeI2G_.d.ts} +1 -1
  3. package/dist/{FlowApi-B_S2OAFn.d.ts → FlowApi-CASVC-Al.d.ts} +1 -1
  4. package/dist/{MediaApi-Raddyh38.d.ts → MediaApi-B2vtjiCm.d.ts} +1 -1
  5. package/dist/{MessageApi-CsdVH_9V.d.ts → MessageApi-B5xedsTj.d.ts} +3 -3
  6. package/dist/{PhoneNumberApi-DVUn9x88.d.ts → PhoneNumberApi-DMb_G3uw.d.ts} +1 -1
  7. package/dist/{QrCodeApi-lDLJYnCg.d.ts → QrCodeApi-D3rVKuxV.d.ts} +1 -1
  8. package/dist/{RegistrationApi-Co1NiWw_.d.ts → RegistrationApi-DZBJWAZS.d.ts} +2 -2
  9. package/dist/{TemplateApi-DhR1Xy73.d.ts → TemplateApi-BA19cqfG.d.ts} +2 -2
  10. package/dist/{TwoStepVerificationApi-ByTfkum8.d.ts → TwoStepVerificationApi-6jV5pDxS.d.ts} +1 -1
  11. package/dist/{WabaApi-CXb5Z_Ek.d.ts → WabaApi-B8Gv2UNE.d.ts} +1 -1
  12. package/dist/{WebhookHandler-BcVZPlq8.d.ts → WebhookHandler-Bo70U_Cu.d.ts} +3 -3
  13. package/dist/{base-WGahY7ao.d.ts → base-BhCbbsxB.d.ts} +1 -1
  14. package/dist/chunk-4O3T25CT.js +2 -0
  15. package/dist/chunk-4O3T25CT.js.map +1 -0
  16. package/dist/{chunk-4LWNMCXG.js → chunk-5O5GLWIE.js} +3 -3
  17. package/dist/{chunk-4LWNMCXG.js.map → chunk-5O5GLWIE.js.map} +1 -1
  18. package/dist/chunk-Y5L5GUKB.js +3 -0
  19. package/dist/{chunk-4ZHGFSME.js.map → chunk-Y5L5GUKB.js.map} +1 -1
  20. package/dist/core/webhook/index.d.ts +15 -15
  21. package/dist/core/webhook/index.js +1 -1
  22. package/dist/core/whatsapp/index.d.ts +14 -14
  23. package/dist/core/whatsapp/index.js +1 -1
  24. package/dist/{enums-CM95zXd_.d.ts → enums-DvwSJq9w.d.ts} +20 -11
  25. package/dist/features/encryption/index.d.ts +4 -4
  26. package/dist/features/encryption/index.js +1 -1
  27. package/dist/features/flow/index.d.ts +4 -4
  28. package/dist/features/flow/index.js +1 -1
  29. package/dist/features/media/index.d.ts +4 -4
  30. package/dist/features/media/index.js +1 -1
  31. package/dist/features/messages/index.d.ts +4 -4
  32. package/dist/features/messages/index.js +1 -1
  33. package/dist/features/phone/index.d.ts +4 -4
  34. package/dist/features/phone/index.js +1 -1
  35. package/dist/features/profile/index.d.ts +4 -4
  36. package/dist/features/profile/index.js +1 -1
  37. package/dist/features/qrCode/index.d.ts +4 -4
  38. package/dist/features/qrCode/index.js +1 -1
  39. package/dist/features/registration/index.d.ts +4 -4
  40. package/dist/features/registration/index.js +1 -1
  41. package/dist/features/template/index.d.ts +4 -4
  42. package/dist/features/template/index.js +1 -1
  43. package/dist/features/twoStepVerification/index.d.ts +4 -4
  44. package/dist/features/twoStepVerification/index.js +1 -1
  45. package/dist/features/waba/index.d.ts +4 -4
  46. package/dist/features/waba/index.js +1 -1
  47. package/dist/{index-BBvXSzXG.d.ts → index-CaRxVWvr.d.ts} +13 -13
  48. package/dist/index.d.ts +16 -16
  49. package/dist/index.js +1 -1
  50. package/dist/shared/types/config.d.ts +1 -1
  51. package/dist/shared/types/enums.d.ts +1 -1
  52. package/dist/shared/types/enums.js +1 -1
  53. package/package.json +1 -1
  54. package/dist/chunk-4ZHGFSME.js +0 -3
  55. package/dist/chunk-QCFJGLDQ.js +0 -2
  56. package/dist/chunk-QCFJGLDQ.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/shared/utils/flowTypeGuards.ts","../src/core/webhook/utils/webhookUtils.ts","../src/core/webhook/WebhookHandler.ts","../src/core/webhook/utils/generateXHub256Sig.ts"],"names":["isObject","value","isString","DATA_EXCHANGE_ACTIONS","ERROR_ACTIONS","isFlowDataExchangeRequest","request","action","version","screen","data","hasValidVersion","hasValidAction","hasValidScreen","hasValidData","isFlowErrorRequest","isFlowPingRequest","LIB_NAME","LOGGER","Logger","verifyWebhook","verificationToken","mode","token","challenge","processWebhookMessages","whatsapp","handlers","body","errors","errorMsg","entry","changes","change","processMessages","error","processFlowRequest","config","flowHandlers","isRequestSignatureValid","decryptedBody","decryptFlowRequest","handler","result","encryptFlowResponse","waba_id","metadata","contacts","wabaId","displayPhoneNumber","phoneNumberId","profileName","statuses","status","processedStatus","executeHandler","messages","message","messageType","processedMessage","handlerType","signature","formattedExpectedSignature","crypto","encrypted_aes_key","encrypted_flow_data","initial_vector","privatePem","passphrase","privateKey","decryptedAesKey","flowDataBuffer","initialVectorBuffer","TAG_LENGTH","encrypted_flow_data_body","encrypted_flow_data_tag","decipher","decryptedJSONString","response","aesKeyBuffer","flipped_iv","pair","cipher","WebhookHandler","importConfig","WhatsApp","type","generateXHub256Sig","appSecret","q"],"mappings":"yIAaA,SAASA,CAAAA,CAASC,EAAkD,CAChE,OAAO,OAAOA,CAAU,EAAA,QAAA,EAAYA,CAAU,GAAA,IAClD,CAOA,SAASC,EAASD,CAAiC,CAAA,CAC/C,OAAO,OAAOA,CAAU,EAAA,QAC5B,CAGA,IAAME,CAAAA,CAAwB,CAAuE,eAAA,CAAA,MAAA,CAAA,MAAA,CAAA,CAG/FC,CAAgB,CAAA,CAAA,eAAA,CAAA,MAAkD,EASjE,SAASC,CAAAA,CAA0BC,EAKxC,CAEE,GAAI,EAAE,YAAgBA,GAAAA,CAAAA,EAAWJ,CAASI,CAAAA,CAAAA,CAAQ,UAAU,CAAA,EAAK,WAAYA,CACzE,CAAA,CAAA,OAAO,MAGX,CAAA,GAAM,CAA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CAAA,CAMvE,cAAgB,MAAOA,CAAAA,EACnBmB,EAAuBnB,CAAS,CAAA,IAAA,CAAK,OAAQ,CAChD,eAAA,CAAiB,KAAK,eACtB,CAAA,iBAAA,CAAmB,KAAK,iBACxB,CAAA,kBAAA,CAAoB,KAAK,kBAC7B,CAAC,CAME,CAAA,UAAA,CAAa,MAAOA,CAChB8B,EAAAA,CAAAA,CAAmB9B,EAAS,IAAK,CAAA,MAAA,CAAQ,KAAK,MAAQ,CAAA,IAAA,CAAK,YAAY,CAAA,CAM3E,UAAUgF,CAAwB5C,CAAAA,CAAAA,CAA+B,CACpE,IAAK,CAAA,eAAA,CAAgB,IAAI4C,CAAM5C,CAAAA,CAAO,CACtCxB,CAAAA,CAAAA,CAAO,IAAI,CAAkCoE,+BAAAA,EAAAA,CAAI,EAAE,EACvD,CAKO,oBAAoB5C,CAA+B,CAAA,CACtD,IAAK,CAAA,iBAAA,CAAoBA,EACzBxB,CAAO,CAAA,GAAA,CAAI,gCAAgC,EAC/C,CAKO,qBAAqBwB,CAA+B,CAAA,CACvD,IAAK,CAAA,kBAAA,CAAqBA,EAC1BxB,CAAO,CAAA,GAAA,CAAI,iCAAiC,EAChD,CAKO,OAAOoE,CAAoB5C,CAAAA,CAAAA,CAA4B,CAC1D,IAAA,CAAK,aAAa,GAAI4C,CAAAA,CAAAA,CAAM5C,CAAO,CACnCxB,CAAAA,CAAAA,CAAO,IAAI,CAA+BoE,4BAAAA,EAAAA,CAAI,CAAE,CAAA,EACpD,CACJ,EC3FO,IAAMC,GAAqB,CAAC3D,CAAAA,CAAc4D,IAC/BC,CAAW,CAAA,UAAA,CAAA,QAAA,CAAUD,CAAS,CAAE,CAAA,MAAA,CAAO5D,EAAM,OAAO,CAAA,CAAE,OAAO,KAAK","file":"chunk-4ZHGFSME.js","sourcesContent":["import {\n FlowActionEnum,\n FlowDataExchangeRequest,\n FlowEndpointRequest,\n FlowErrorNotificationRequest,\n FlowHealthCheckRequest,\n} from '@features/flow/types';\n\n/**\n * Helper function to check if a value is an object\n * @param value The value to check\n * @returns True if the value is a non-null object\n */\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * Helper function to check if a value is a string\n * @param value The value to check\n * @returns True if the value is a string\n */\nfunction isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\n// Array of allowed action types for data exchange requests\nconst DATA_EXCHANGE_ACTIONS = [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT, FlowActionEnum.BACK] as const;\n\n// Array of allowed action types for error notification requests\nconst ERROR_ACTIONS = [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT] as const;\n\n/**\n * Type guard to check if a request is a Data Exchange request\n * Validates the request structure according to the Flow API specifications\n *\n * @param request The Flow endpoint request to check\n * @returns True if the request is a valid Data Exchange request, false otherwise\n */\nexport function isFlowDataExchangeRequest(request: FlowEndpointRequest): request is FlowDataExchangeRequest & {\n action: (typeof DATA_EXCHANGE_ACTIONS)[number];\n screen?: string;\n flow_token: string;\n data?: Record<string, any>;\n} {\n // Check for basic required fields\n if (!('flow_token' in request && isString(request.flow_token) && 'action' in request)) {\n return false;\n }\n\n const { action, version, screen, data } = request;\n\n // Validate API version\n const hasValidVersion = version === '3.0';\n\n // Check if the action is one of the allowed actions for data exchange\n const hasValidAction = DATA_EXCHANGE_ACTIONS.includes(action as any);\n\n // Screen is optional, but when present must be a string and not 'SUCCESS'\n const hasValidScreen = typeof screen === 'undefined' || (isString(screen) && screen !== 'SUCCESS');\n\n // Data is required except for DATA_EXCHANGE action\n const hasValidData = action === FlowActionEnum.DATA_EXCHANGE || isObject(data);\n\n // All conditions must be met for a valid data exchange request\n return hasValidVersion && hasValidAction && hasValidScreen && hasValidData;\n}\n\n/**\n * Type guard to check if a request is an Error Notification request\n * Validates the request structure according to the Flow API error specifications\n *\n * @param request The Flow endpoint request to check\n * @returns True if the request is a valid Error Notification request, false otherwise\n */\nexport function isFlowErrorRequest(request: FlowEndpointRequest): request is FlowErrorNotificationRequest & {\n action: (typeof ERROR_ACTIONS)[number];\n screen: string;\n flow_token: string;\n data: {\n error: string;\n error_message: string;\n };\n} {\n // Check for basic required fields\n if (!('flow_token' in request && isString(request.flow_token) && 'action' in request)) {\n return false;\n }\n\n const { action, screen, data } = request;\n\n // Check if the action is one of the allowed actions for error notifications\n const hasValidAction = ERROR_ACTIONS.includes(action as any);\n\n // Screen is required for error notifications\n const hasValidScreen = isString(screen);\n\n // Validate error data structure\n const hasValidData =\n isObject(data) &&\n 'error_key' in data &&\n isString(data.error) &&\n 'error_message' in data &&\n isString(data.error_message);\n\n // All conditions must be met for a valid error notification request\n return hasValidAction && hasValidScreen && hasValidData;\n}\n\n/**\n * Type guard to check if a request is a Ping (health check) request\n * Simple validation for health check endpoints in the Flow API\n *\n * @param request The Flow endpoint request to check\n * @returns True if the request is a Ping request, false otherwise\n */\nexport function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest {\n // A ping request only requires the 'action' field with value 'ping'\n return 'action' in request && request.action === 'ping';\n}\n","import { FlowEndpointRequest } from '@features/flow';\nimport { FlowTypeEnum } from '@features/flow/types';\nimport { MessageTypesEnum } from '@shared/types';\nimport { WabaConfigType } from '@shared/types/config';\nimport { isFlowDataExchangeRequest, isFlowErrorRequest, isFlowPingRequest } from '@shared/utils/flowTypeGuards';\nimport Logger from '@shared/utils/logger';\nimport crypto from 'crypto';\nimport { WhatsApp } from '../../whatsapp';\nimport { WebhookMessage, WebhookMessageValue } from '../types';\n\nconst LIB_NAME = 'WEBHOOK_UTILS';\nconst LOGGER = new Logger(LIB_NAME, process.env.DEBUG === 'true');\n\nexport interface WebhookRequest {\n method: string;\n query: Record<string, any>;\n body: any;\n headers: Record<string, string | string[] | undefined>;\n rawBody?: string;\n}\n\nexport interface WebhookResponse {\n statusCode: number;\n body?: any;\n headers?: Record<string, string>;\n}\n\nexport type MessageHandler = (whatsapp: WhatsApp, message: WebhookMessage) => void | Promise<void>;\nexport type FlowHandler = (whatsapp: WhatsApp, request: FlowEndpointRequest) => any | Promise<any>;\n\n/**\n * Pure function to handle webhook verification\n */\nexport function verifyWebhook(request: Pick<WebhookRequest, 'query'>, verificationToken: string): WebhookResponse {\n const mode = request.query['hub.mode'];\n const token = request.query['hub.verify_token'];\n const challenge = request.query['hub.challenge'];\n\n // Check if this is actually a webhook verification request\n const isWebhookVerificationRequest = mode !== undefined && token !== undefined && challenge !== undefined;\n\n if (!isWebhookVerificationRequest) {\n LOGGER.log('Not a webhook verification request - missing required parameters');\n return {\n statusCode: 400,\n body: { error: 'Invalid webhook verification request' },\n };\n }\n\n const VERIFICATION_SUCCESS = mode === 'subscribe' && token === verificationToken;\n\n if (VERIFICATION_SUCCESS) {\n LOGGER.log('Webhook verified successfully');\n return {\n statusCode: 200,\n body: challenge,\n };\n } else {\n LOGGER.log('Webhook verification failed');\n return {\n statusCode: 403,\n };\n }\n}\n\n/**\n * Pure function to process webhook messages\n */\nexport async function processWebhookMessages(\n request: WebhookRequest,\n whatsapp: WhatsApp,\n handlers: {\n messageHandlers: Map<MessageTypesEnum, MessageHandler>;\n preProcessHandler?: MessageHandler;\n postProcessHandler?: MessageHandler;\n },\n): Promise<WebhookResponse> {\n const body = request.body;\n const errors: string[] = [];\n\n // Check this is a WhatsApp Business Account webhook\n if (body.object !== 'whatsapp_business_account') {\n const errorMsg = 'Received webhook for non-WhatsApp event';\n LOGGER.log(errorMsg);\n return {\n statusCode: 404,\n body: { error: errorMsg },\n };\n }\n\n // Process each entry\n for (const entry of body.entry) {\n try {\n const changes = entry.changes;\n for (const change of changes) {\n if (change.field === 'messages') {\n await processMessages(entry.id, change.value, whatsapp, handlers);\n }\n }\n } catch (error) {\n const errorMsg = `Error processing webhook: ${error}`;\n LOGGER.log(errorMsg);\n errors.push(errorMsg);\n }\n }\n\n return {\n statusCode: 200,\n body: errors.length > 0 ? { errors } : undefined,\n };\n}\n\n/**\n * Pure function to handle flow requests\n */\nexport async function processFlowRequest(\n request: WebhookRequest,\n config: WabaConfigType,\n whatsapp: WhatsApp,\n flowHandlers: Map<FlowTypeEnum, FlowHandler>,\n): Promise<WebhookResponse> {\n try {\n // Validate request signature\n if (!isRequestSignatureValid(request, config.WEBHOOK_VERIFICATION_TOKEN || '')) {\n LOGGER.log('Invalid request signature');\n return {\n statusCode: 401,\n body: { error: 'Unauthorized' },\n };\n }\n\n const body = JSON.parse(request.rawBody || '{}');\n\n // Decrypt the request\n const { decryptedBody } = decryptFlowRequest(body, config);\n\n // Get the flow handler\n const handler = flowHandlers.get(FlowTypeEnum.All);\n if (!handler) {\n LOGGER.log(`No handler registered for flow action: ${decryptedBody.action}`);\n return {\n statusCode: 404,\n body: { error: 'Handler not found' },\n };\n }\n\n // Handle different flow types\n if (isFlowPingRequest(decryptedBody)) {\n return {\n statusCode: 200,\n body: {\n version: '3.0',\n data: { status: 'active' },\n },\n };\n }\n\n if (isFlowErrorRequest(decryptedBody)) {\n LOGGER.log(`Flow error: ${JSON.stringify(decryptedBody)}`);\n return {\n statusCode: 200,\n body: {},\n };\n }\n\n if (isFlowDataExchangeRequest(decryptedBody)) {\n const result = await handler(whatsapp, decryptedBody);\n const encryptedResponse = encryptFlowResponse(\n result,\n Buffer.from(body.aes_key, 'base64'),\n Buffer.from(body.initial_vector, 'base64'),\n );\n\n return {\n statusCode: 200,\n body: encryptedResponse,\n };\n }\n\n LOGGER.log(`Unknown flow request type: ${JSON.stringify(decryptedBody)}`);\n return {\n statusCode: 400,\n body: { error: 'Unknown request type' },\n };\n } catch (error) {\n LOGGER.log(`Error handling flow request: ${error}`);\n return {\n statusCode: 500,\n body: { error: 'Internal server error' },\n };\n }\n}\n\n/**\n * Private helper functions\n */\nasync function processMessages(\n waba_id: string,\n value: WebhookMessageValue,\n whatsapp: WhatsApp,\n handlers: {\n messageHandlers: Map<MessageTypesEnum, MessageHandler>;\n preProcessHandler?: MessageHandler;\n postProcessHandler?: MessageHandler;\n },\n): Promise<void> {\n const metadata = value.metadata;\n const contacts = value.contacts;\n const wabaId = waba_id;\n const displayPhoneNumber = metadata?.display_phone_number || '';\n const phoneNumberId = metadata?.phone_number_id || '';\n const profileName = contacts?.[0]?.profile?.name || '';\n\n if (value.statuses && value.statuses.length > 0) {\n const statuses = value.statuses;\n for (const status of statuses) {\n const processedStatus: WebhookMessage = {\n wabaId,\n id: status.id,\n from: status.recipient_id,\n timestamp: status.timestamp,\n type: MessageTypesEnum.Statuses,\n phoneNumberId,\n displayPhoneNumber,\n profileName,\n statuses: value.statuses[0],\n originalData: status,\n };\n\n await executeHandler(\n handlers.messageHandlers.get(MessageTypesEnum.Statuses),\n whatsapp,\n processedStatus,\n MessageTypesEnum.Statuses,\n );\n }\n return;\n }\n\n if (value.messages && value.messages.length > 0) {\n const messages = value.messages;\n\n for (const message of messages) {\n const messageType = message.type;\n\n const processedMessage: WebhookMessage = {\n wabaId,\n id: message.id,\n from: message.from,\n timestamp: message.timestamp,\n type: message.type,\n phoneNumberId,\n displayPhoneNumber,\n profileName,\n originalData: message,\n };\n\n switch (messageType) {\n case MessageTypesEnum.Text:\n processedMessage.text = message.text;\n break;\n case MessageTypesEnum.Image:\n processedMessage.image = message.image;\n break;\n case MessageTypesEnum.Video:\n processedMessage.video = message.video;\n break;\n case MessageTypesEnum.Audio:\n processedMessage.audio = message.audio;\n break;\n case MessageTypesEnum.Document:\n processedMessage.document = message.document;\n break;\n case MessageTypesEnum.Sticker:\n processedMessage.sticker = message.sticker;\n break;\n case MessageTypesEnum.Location:\n processedMessage.location = message.location;\n break;\n case MessageTypesEnum.Contacts:\n processedMessage.contacts = message.contacts;\n break;\n case MessageTypesEnum.Interactive:\n processedMessage.interactive = message.interactive;\n break;\n case MessageTypesEnum.Button:\n processedMessage.button = message.button;\n break;\n case MessageTypesEnum.Order:\n processedMessage.order = message.order;\n break;\n case MessageTypesEnum.System:\n processedMessage.system = message.system;\n break;\n case MessageTypesEnum.Reaction:\n processedMessage.reaction = message.reaction;\n break;\n default:\n LOGGER.log(`Unknown message type: ${messageType}`);\n break;\n }\n\n // Execute handlers in sequence\n await executeHandler(handlers.preProcessHandler, whatsapp, processedMessage, 'pre-process');\n await executeHandler(handlers.messageHandlers.get(messageType), whatsapp, processedMessage, messageType);\n await executeHandler(handlers.postProcessHandler, whatsapp, processedMessage, 'post-process');\n }\n }\n}\n\nasync function executeHandler(\n handler: MessageHandler | undefined,\n whatsapp: WhatsApp,\n message: WebhookMessage,\n handlerType: string,\n): Promise<void> {\n if (handler) {\n try {\n await handler(whatsapp, message);\n } catch (error) {\n LOGGER.log(`Error in ${handlerType} handler: ${error}`);\n }\n }\n}\n\nfunction isRequestSignatureValid(request: WebhookRequest, verificationToken: string): boolean {\n const signature = request.headers['x-hub-signature-256'] as string;\n if (!signature || !request.rawBody) {\n return false;\n }\n\n const expectedSignature = crypto\n .createHmac('sha256', verificationToken)\n .update(request.rawBody, 'utf8')\n .digest('hex');\n\n const formattedExpectedSignature = `sha256=${expectedSignature}`;\n\n return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(formattedExpectedSignature));\n}\n\nfunction decryptFlowRequest(\n body: any,\n config: WabaConfigType,\n): {\n decryptedBody: FlowEndpointRequest;\n aesKeyBuffer: Buffer;\n initialVectorBuffer: Buffer;\n} {\n const { encrypted_aes_key, encrypted_flow_data, initial_vector } = body;\n\n if (!encrypted_aes_key || !encrypted_flow_data || !initial_vector) {\n throw new Error('Missing required encryption properties');\n }\n\n const privatePem = config.FLOW_API_PRIVATE_PEM.replace(/\\\\n/g, '\\n');\n const passphrase = config.FLOW_API_PASSPHRASE;\n\n const privateKey = crypto.createPrivateKey({ key: privatePem, passphrase });\n let decryptedAesKey: Buffer;\n\n try {\n decryptedAesKey = crypto.privateDecrypt(\n {\n key: privateKey,\n padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,\n oaepHash: 'sha256',\n },\n Buffer.from(encrypted_aes_key, 'base64'),\n );\n } catch (error) {\n throw new Error('Failed to decrypt the request. Please verify your private key.');\n }\n\n const flowDataBuffer = Buffer.from(encrypted_flow_data, 'base64');\n const initialVectorBuffer = Buffer.from(initial_vector, 'base64');\n\n const TAG_LENGTH = 16;\n const encrypted_flow_data_body = flowDataBuffer.subarray(0, -TAG_LENGTH);\n const encrypted_flow_data_tag = flowDataBuffer.subarray(-TAG_LENGTH);\n\n const decipher = crypto.createDecipheriv('aes-128-gcm', decryptedAesKey, initialVectorBuffer);\n decipher.setAuthTag(encrypted_flow_data_tag);\n\n const decryptedJSONString = Buffer.concat([decipher.update(encrypted_flow_data_body), decipher.final()]).toString(\n 'utf-8',\n );\n\n return {\n decryptedBody: JSON.parse(decryptedJSONString),\n aesKeyBuffer: decryptedAesKey,\n initialVectorBuffer,\n };\n}\n\nfunction encryptFlowResponse(response: any, aesKeyBuffer: Buffer, initialVectorBuffer: Buffer): string {\n const flipped_iv: number[] = [];\n for (const pair of Array.from(initialVectorBuffer.entries())) {\n flipped_iv.push(~pair[1]);\n }\n\n try {\n const cipher = crypto.createCipheriv('aes-128-gcm', aesKeyBuffer, Buffer.from(flipped_iv));\n return Buffer.concat([\n cipher.update(JSON.stringify(response || {}), 'utf-8'),\n cipher.final(),\n cipher.getAuthTag(),\n ]).toString('base64');\n } catch (error) {\n LOGGER.log('Response encryption error:', error);\n throw new Error('Failed to encrypt response. Internal server error.');\n }\n}\n","import { MessageTypesEnum } from '@shared/types';\nimport { WabaConfigType, WhatsAppConfig } from '@shared/types/config';\n\nimport { FlowTypeEnum } from '@features/flow/types';\nimport { importConfig } from '@shared/config/importConfig';\nimport Logger from '@shared/utils/logger';\nimport { WhatsApp } from '../whatsapp';\nimport {\n FlowHandler,\n MessageHandler,\n processFlowRequest,\n processWebhookMessages,\n verifyWebhook,\n WebhookRequest,\n WebhookResponse,\n} from './utils/webhookUtils';\n\nconst LIB_NAME = 'WEBHOOK';\nconst LOGGER = new Logger(LIB_NAME, process.env.DEBUG === 'true');\n\n/**\n * Framework-agnostic WebhookHandler using pure functions\n */\nexport class WebhookHandler {\n private config: WabaConfigType;\n private client: WhatsApp;\n private messageHandlers: Map<MessageTypesEnum, MessageHandler> = new Map();\n private preProcessHandler: MessageHandler | undefined = undefined;\n private postProcessHandler: MessageHandler | undefined = undefined;\n private flowHandlers: Map<FlowTypeEnum, FlowHandler> = new Map();\n\n constructor(config: WhatsAppConfig) {\n this.config = importConfig(config);\n this.client = new WhatsApp(config);\n LOGGER.log('WebhookHandler instantiated!');\n }\n\n /**\n * Handle webhook verification (framework-agnostic)\n */\n public handleVerification = (request: Pick<WebhookRequest, 'query'>): WebhookResponse => {\n return verifyWebhook(request, this.config.WEBHOOK_VERIFICATION_TOKEN || '');\n };\n\n /**\n * Handle webhook messages (framework-agnostic)\n */\n public handleWebhook = async (request: WebhookRequest): Promise<WebhookResponse> => {\n return processWebhookMessages(request, this.client, {\n messageHandlers: this.messageHandlers,\n preProcessHandler: this.preProcessHandler,\n postProcessHandler: this.postProcessHandler,\n });\n };\n\n /**\n * Handle flow requests (framework-agnostic)\n */\n public handleFlow = async (request: WebhookRequest): Promise<WebhookResponse> => {\n return processFlowRequest(request, this.config, this.client, this.flowHandlers);\n };\n\n /**\n * Register a message handler for a specific message type\n */\n public onMessage(type: MessageTypesEnum, handler: MessageHandler): void {\n this.messageHandlers.set(type, handler);\n LOGGER.log(`Registered message handler for ${type}`);\n }\n\n /**\n * Register a pre-process handler that runs before all message handlers\n */\n public onMessagePreProcess(handler: MessageHandler): void {\n this.preProcessHandler = handler;\n LOGGER.log('Registered pre-process handler');\n }\n\n /**\n * Register a post-process handler that runs after all message handlers\n */\n public onMessagePostProcess(handler: MessageHandler): void {\n this.postProcessHandler = handler;\n LOGGER.log('Registered post-process handler');\n }\n\n /**\n * Register a flow handler for a specific flow type\n */\n public onFlow(type: FlowTypeEnum, handler: FlowHandler): void {\n this.flowHandlers.set(type, handler);\n LOGGER.log(`Registered flow handler for ${type}`);\n }\n}\n","import * as crypto from 'crypto';\n\nexport const generateXHub256Sig = (body: string, appSecret: string) => {\n return crypto.createHmac('sha256', appSecret).update(body, 'utf-8').digest('hex');\n};\n"]}
1
+ {"version":3,"sources":["../src/shared/utils/flowTypeGuards.ts","../src/core/webhook/utils/webhookUtils.ts","../src/core/webhook/WebhookHandler.ts","../src/core/webhook/utils/generateXHub256Sig.ts"],"names":["isObject","value","isString","DATA_EXCHANGE_ACTIONS","ERROR_ACTIONS","isFlowDataExchangeRequest","request","action","version","screen","data","hasValidVersion","hasValidAction","hasValidScreen","hasValidData","isFlowErrorRequest","isFlowPingRequest","LIB_NAME","LOGGER","Logger","verifyWebhook","verificationToken","mode","token","challenge","processWebhookMessages","whatsapp","handlers","body","errors","errorMsg","entry","changes","change","processMessages","error","processFlowRequest","config","flowHandlers","isRequestSignatureValid","decryptedBody","decryptFlowRequest","handler","result","encryptFlowResponse","waba_id","metadata","contacts","wabaId","displayPhoneNumber","phoneNumberId","profileName","statuses","status","processedStatus","executeHandler","messages","message","messageType","processedMessage","handlerType","signature","formattedExpectedSignature","crypto","encrypted_aes_key","encrypted_flow_data","initial_vector","privatePem","passphrase","privateKey","decryptedAesKey","flowDataBuffer","initialVectorBuffer","TAG_LENGTH","encrypted_flow_data_body","encrypted_flow_data_tag","decipher","decryptedJSONString","response","aesKeyBuffer","flipped_iv","pair","cipher","WebhookHandler","importConfig","WhatsApp","type","generateXHub256Sig","appSecret","P"],"mappings":"yIAaA,SAASA,CAAAA,CAASC,EAAkD,CAChE,OAAO,OAAOA,CAAU,EAAA,QAAA,EAAYA,CAAU,GAAA,IAClD,CAOA,SAASC,EAASD,CAAiC,CAAA,CAC/C,OAAO,OAAOA,CAAU,EAAA,QAC5B,CAGA,IAAME,CAAAA,CAAwB,CAAuE,eAAA,CAAA,MAAA,CAAA,MAAA,CAAA,CAG/FC,CAAgB,CAAA,CAAA,eAAA,CAAA,MAAkD,EASjE,SAASC,CAAAA,CAA0BC,EAKxC,CAEE,GAAI,EAAE,YAAgBA,GAAAA,CAAAA,EAAWJ,CAASI,CAAAA,CAAAA,CAAQ,UAAU,CAAA,E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equest,\n FlowErrorNotificationRequest,\n FlowHealthCheckRequest,\n} from '@features/flow/types';\n\n/**\n * Helper function to check if a value is an object\n * @param value The value to check\n * @returns True if the value is a non-null object\n */\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * Helper function to check if a value is a string\n * @param value The value to check\n * @returns True if the value is a string\n */\nfunction isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\n// Array of allowed action types for data exchange requests\nconst DATA_EXCHANGE_ACTIONS = [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT, FlowActionEnum.BACK] as const;\n\n// Array of allowed action types for error notification requests\nconst ERROR_ACTIONS = [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT] as const;\n\n/**\n * Type guard to check if a request is a Data Exchange request\n * Validates the request structure according to the Flow API specifications\n *\n * @param request The Flow endpoint request to check\n * @returns True if the request is a valid Data Exchange request, false otherwise\n */\nexport function isFlowDataExchangeRequest(request: FlowEndpointRequest): request is FlowDataExchangeRequest & {\n action: (typeof DATA_EXCHANGE_ACTIONS)[number];\n screen?: string;\n flow_token: string;\n data?: Record<string, any>;\n} {\n // Check for basic required fields\n if (!('flow_token' in request && isString(request.flow_token) && 'action' in request)) {\n return false;\n }\n\n const { action, version, screen, data } = request;\n\n // Validate API version\n const hasValidVersion = version === '3.0';\n\n // Check if the action is one of the allowed actions for data exchange\n const hasValidAction = DATA_EXCHANGE_ACTIONS.includes(action as any);\n\n // Screen is optional, but when present must be a string and not 'SUCCESS'\n const hasValidScreen = typeof screen === 'undefined' || (isString(screen) && screen !== 'SUCCESS');\n\n // Data is required except for DATA_EXCHANGE action\n const hasValidData = action === FlowActionEnum.DATA_EXCHANGE || isObject(data);\n\n // All conditions must be met for a valid data exchange request\n return hasValidVersion && hasValidAction && hasValidScreen && hasValidData;\n}\n\n/**\n * Type guard to check if a request is an Error Notification request\n * Validates the request structure according to the Flow API error specifications\n *\n * @param request The Flow endpoint request to check\n * @returns True if the request is a valid Error Notification request, false otherwise\n */\nexport function isFlowErrorRequest(request: FlowEndpointRequest): request is FlowErrorNotificationRequest & {\n action: (typeof ERROR_ACTIONS)[number];\n screen: string;\n flow_token: string;\n data: {\n error: string;\n error_message: string;\n };\n} {\n // Check for basic required fields\n if (!('flow_token' in request && isString(request.flow_token) && 'action' in request)) {\n return false;\n }\n\n const { action, screen, data } = request;\n\n // Check if the action is one of the allowed actions for error notifications\n const hasValidAction = ERROR_ACTIONS.includes(action as any);\n\n // Screen is required for error notifications\n const hasValidScreen = isString(screen);\n\n // Validate error data structure\n const hasValidData =\n isObject(data) &&\n 'error_key' in data &&\n isString(data.error) &&\n 'error_message' in data &&\n isString(data.error_message);\n\n // All conditions must be met for a valid error notification request\n return hasValidAction && hasValidScreen && hasValidData;\n}\n\n/**\n * Type guard to check if a request is a Ping (health check) request\n * Simple validation for health check endpoints in the Flow API\n *\n * @param request The Flow endpoint request to check\n * @returns True if the request is a Ping request, false otherwise\n */\nexport function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest {\n // A ping request only requires the 'action' field with value 'ping'\n return 'action' in request && request.action === 'ping';\n}\n","import { FlowEndpointRequest } from '@features/flow';\nimport { FlowTypeEnum } from '@features/flow/types';\nimport { MessageTypesEnum } from '@shared/types';\nimport { WabaConfigType } from '@shared/types/config';\nimport { isFlowDataExchangeRequest, isFlowErrorRequest, isFlowPingRequest } from '@shared/utils/flowTypeGuards';\nimport Logger from '@shared/utils/logger';\nimport crypto from 'crypto';\nimport { WhatsApp } from '../../whatsapp';\nimport { WebhookMessage, WebhookMessageValue } from '../types';\n\nconst LIB_NAME = 'WEBHOOK_UTILS';\nconst LOGGER = new Logger(LIB_NAME, process.env.DEBUG === 'true');\n\nexport interface WebhookRequest {\n method: string;\n query: Record<string, any>;\n body: any;\n headers: Record<string, string | string[] | undefined>;\n rawBody?: string;\n}\n\nexport interface WebhookResponse {\n statusCode: number;\n body?: any;\n headers?: Record<string, string>;\n}\n\nexport type MessageHandler = (whatsapp: WhatsApp, message: WebhookMessage) => void | Promise<void>;\nexport type FlowHandler = (whatsapp: WhatsApp, request: FlowEndpointRequest) => any | Promise<any>;\n\n/**\n * Pure function to handle webhook verification\n */\nexport function verifyWebhook(request: Pick<WebhookRequest, 'query'>, verificationToken: string): WebhookResponse {\n const mode = request.query['hub.mode'];\n const token = request.query['hub.verify_token'];\n const challenge = request.query['hub.challenge'];\n\n // Check if this is actually a webhook verification request\n const isWebhookVerificationRequest = mode !== undefined && token !== undefined && challenge !== undefined;\n\n if (!isWebhookVerificationRequest) {\n LOGGER.log('Not a webhook verification request - missing required parameters');\n return {\n statusCode: 400,\n body: { error: 'Invalid webhook verification request' },\n };\n }\n\n const VERIFICATION_SUCCESS = mode === 'subscribe' && token === verificationToken;\n\n if (VERIFICATION_SUCCESS) {\n LOGGER.log('Webhook verified successfully');\n return {\n statusCode: 200,\n body: challenge,\n };\n } else {\n LOGGER.log('Webhook verification failed');\n return {\n statusCode: 403,\n };\n }\n}\n\n/**\n * Pure function to process webhook messages\n */\nexport async function processWebhookMessages(\n request: WebhookRequest,\n whatsapp: WhatsApp,\n handlers: {\n messageHandlers: Map<MessageTypesEnum, MessageHandler>;\n preProcessHandler?: MessageHandler;\n postProcessHandler?: MessageHandler;\n },\n): Promise<WebhookResponse> {\n const body = request.body;\n const errors: string[] = [];\n\n // Check this is a WhatsApp Business Account webhook\n if (body.object !== 'whatsapp_business_account') {\n const errorMsg = 'Received webhook for non-WhatsApp event';\n LOGGER.log(errorMsg);\n return {\n statusCode: 404,\n body: { error: errorMsg },\n };\n }\n\n // Process each entry\n for (const entry of body.entry) {\n try {\n const changes = entry.changes;\n for (const change of changes) {\n if (change.field === 'messages') {\n await processMessages(entry.id, change.value, whatsapp, handlers);\n }\n }\n } catch (error) {\n const errorMsg = `Error processing webhook: ${error}`;\n LOGGER.log(errorMsg);\n errors.push(errorMsg);\n }\n }\n\n return {\n statusCode: 200,\n body: errors.length > 0 ? { errors } : undefined,\n };\n}\n\n/**\n * Pure function to handle flow requests\n */\nexport async function processFlowRequest(\n request: WebhookRequest,\n config: WabaConfigType,\n whatsapp: WhatsApp,\n flowHandlers: Map<FlowTypeEnum, FlowHandler>,\n): Promise<WebhookResponse> {\n try {\n // Validate request signature\n if (!isRequestSignatureValid(request, config.WEBHOOK_VERIFICATION_TOKEN || '')) {\n LOGGER.log('Invalid request signature');\n return {\n statusCode: 401,\n body: { error: 'Unauthorized' },\n };\n }\n\n const body = JSON.parse(request.rawBody || '{}');\n\n // Decrypt the request\n const { decryptedBody } = decryptFlowRequest(body, config);\n\n // Get the flow handler\n const handler = flowHandlers.get(FlowTypeEnum.All);\n if (!handler) {\n LOGGER.log(`No handler registered for flow action: ${decryptedBody.action}`);\n return {\n statusCode: 404,\n body: { error: 'Handler not found' },\n };\n }\n\n // Handle different flow types\n if (isFlowPingRequest(decryptedBody)) {\n return {\n statusCode: 200,\n body: {\n version: '3.0',\n data: { status: 'active' },\n },\n };\n }\n\n if (isFlowErrorRequest(decryptedBody)) {\n LOGGER.log(`Flow error: ${JSON.stringify(decryptedBody)}`);\n return {\n statusCode: 200,\n body: {},\n };\n }\n\n if (isFlowDataExchangeRequest(decryptedBody)) {\n const result = await handler(whatsapp, decryptedBody);\n const encryptedResponse = encryptFlowResponse(\n result,\n Buffer.from(body.aes_key, 'base64'),\n Buffer.from(body.initial_vector, 'base64'),\n );\n\n return {\n statusCode: 200,\n body: encryptedResponse,\n };\n }\n\n LOGGER.log(`Unknown flow request type: ${JSON.stringify(decryptedBody)}`);\n return {\n statusCode: 400,\n body: { error: 'Unknown request type' },\n };\n } catch (error) {\n LOGGER.log(`Error handling flow request: ${error}`);\n return {\n statusCode: 500,\n body: { error: 'Internal server error' },\n };\n }\n}\n\n/**\n * Private helper functions\n */\nasync function processMessages(\n waba_id: string,\n value: WebhookMessageValue,\n whatsapp: WhatsApp,\n handlers: {\n messageHandlers: Map<MessageTypesEnum, MessageHandler>;\n preProcessHandler?: MessageHandler;\n postProcessHandler?: MessageHandler;\n },\n): Promise<void> {\n const metadata = value.metadata;\n const contacts = value.contacts;\n const wabaId = waba_id;\n const displayPhoneNumber = metadata?.display_phone_number || '';\n const phoneNumberId = metadata?.phone_number_id || '';\n const profileName = contacts?.[0]?.profile?.name || '';\n\n if (value.statuses && value.statuses.length > 0) {\n const statuses = value.statuses;\n for (const status of statuses) {\n const processedStatus: WebhookMessage = {\n wabaId,\n id: status.id,\n from: status.recipient_id,\n timestamp: status.timestamp,\n type: MessageTypesEnum.Statuses,\n phoneNumberId,\n displayPhoneNumber,\n profileName,\n statuses: value.statuses[0],\n originalData: status,\n };\n\n await executeHandler(\n handlers.messageHandlers.get(MessageTypesEnum.Statuses),\n whatsapp,\n processedStatus,\n MessageTypesEnum.Statuses,\n );\n }\n return;\n }\n\n if (value.messages && value.messages.length > 0) {\n const messages = value.messages;\n\n for (const message of messages) {\n const messageType = message.type;\n\n const processedMessage: WebhookMessage = {\n wabaId,\n id: message.id,\n from: message.from,\n timestamp: message.timestamp,\n type: message.type,\n phoneNumberId,\n displayPhoneNumber,\n profileName,\n originalData: message,\n };\n\n switch (messageType) {\n case MessageTypesEnum.Text:\n processedMessage.text = message.text;\n break;\n case MessageTypesEnum.Image:\n processedMessage.image = message.image;\n break;\n case MessageTypesEnum.Video:\n processedMessage.video = message.video;\n break;\n case MessageTypesEnum.Audio:\n processedMessage.audio = message.audio;\n break;\n case MessageTypesEnum.Document:\n processedMessage.document = message.document;\n break;\n case MessageTypesEnum.Sticker:\n processedMessage.sticker = message.sticker;\n break;\n case MessageTypesEnum.Location:\n processedMessage.location = message.location;\n break;\n case MessageTypesEnum.Contacts:\n processedMessage.contacts = message.contacts;\n break;\n case MessageTypesEnum.Interactive:\n processedMessage.interactive = message.interactive;\n break;\n case MessageTypesEnum.Button:\n processedMessage.button = message.button;\n break;\n case MessageTypesEnum.Order:\n processedMessage.order = message.order;\n break;\n case MessageTypesEnum.System:\n processedMessage.system = message.system;\n break;\n case MessageTypesEnum.Reaction:\n processedMessage.reaction = message.reaction;\n break;\n default:\n LOGGER.log(`Unknown message type: ${messageType}`);\n break;\n }\n\n // Execute handlers in sequence\n await executeHandler(handlers.preProcessHandler, whatsapp, processedMessage, 'pre-process');\n await executeHandler(handlers.messageHandlers.get(messageType), whatsapp, processedMessage, messageType);\n await executeHandler(handlers.postProcessHandler, whatsapp, processedMessage, 'post-process');\n }\n }\n}\n\nasync function executeHandler(\n handler: MessageHandler | undefined,\n whatsapp: WhatsApp,\n message: WebhookMessage,\n handlerType: string,\n): Promise<void> {\n if (handler) {\n try {\n await handler(whatsapp, message);\n } catch (error) {\n LOGGER.log(`Error in ${handlerType} handler: ${error}`);\n }\n }\n}\n\nfunction isRequestSignatureValid(request: WebhookRequest, verificationToken: string): boolean {\n const signature = request.headers['x-hub-signature-256'] as string;\n if (!signature || !request.rawBody) {\n return false;\n }\n\n const expectedSignature = crypto\n .createHmac('sha256', verificationToken)\n .update(request.rawBody, 'utf8')\n .digest('hex');\n\n const formattedExpectedSignature = `sha256=${expectedSignature}`;\n\n return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(formattedExpectedSignature));\n}\n\nfunction decryptFlowRequest(\n body: any,\n config: WabaConfigType,\n): {\n decryptedBody: FlowEndpointRequest;\n aesKeyBuffer: Buffer;\n initialVectorBuffer: Buffer;\n} {\n const { encrypted_aes_key, encrypted_flow_data, initial_vector } = body;\n\n if (!encrypted_aes_key || !encrypted_flow_data || !initial_vector) {\n throw new Error('Missing required encryption properties');\n }\n\n const privatePem = config.FLOW_API_PRIVATE_PEM.replace(/\\\\n/g, '\\n');\n const passphrase = config.FLOW_API_PASSPHRASE;\n\n const privateKey = crypto.createPrivateKey({ key: privatePem, passphrase });\n let decryptedAesKey: Buffer;\n\n try {\n decryptedAesKey = crypto.privateDecrypt(\n {\n key: privateKey,\n padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,\n oaepHash: 'sha256',\n },\n Buffer.from(encrypted_aes_key, 'base64'),\n );\n } catch (error) {\n throw new Error('Failed to decrypt the request. Please verify your private key.');\n }\n\n const flowDataBuffer = Buffer.from(encrypted_flow_data, 'base64');\n const initialVectorBuffer = Buffer.from(initial_vector, 'base64');\n\n const TAG_LENGTH = 16;\n const encrypted_flow_data_body = flowDataBuffer.subarray(0, -TAG_LENGTH);\n const encrypted_flow_data_tag = flowDataBuffer.subarray(-TAG_LENGTH);\n\n const decipher = crypto.createDecipheriv('aes-128-gcm', decryptedAesKey, initialVectorBuffer);\n decipher.setAuthTag(encrypted_flow_data_tag);\n\n const decryptedJSONString = Buffer.concat([decipher.update(encrypted_flow_data_body), decipher.final()]).toString(\n 'utf-8',\n );\n\n return {\n decryptedBody: JSON.parse(decryptedJSONString),\n aesKeyBuffer: decryptedAesKey,\n initialVectorBuffer,\n };\n}\n\nfunction encryptFlowResponse(response: any, aesKeyBuffer: Buffer, initialVectorBuffer: Buffer): string {\n const flipped_iv: number[] = [];\n for (const pair of Array.from(initialVectorBuffer.entries())) {\n flipped_iv.push(~pair[1]);\n }\n\n try {\n const cipher = crypto.createCipheriv('aes-128-gcm', aesKeyBuffer, Buffer.from(flipped_iv));\n return Buffer.concat([\n cipher.update(JSON.stringify(response || {}), 'utf-8'),\n cipher.final(),\n cipher.getAuthTag(),\n ]).toString('base64');\n } catch (error) {\n LOGGER.log('Response encryption error:', error);\n throw new Error('Failed to encrypt response. Internal server error.');\n }\n}\n","import { MessageTypesEnum } from '@shared/types';\nimport { WabaConfigType, WhatsAppConfig } from '@shared/types/config';\n\nimport { FlowTypeEnum } from '@features/flow/types';\nimport { importConfig } from '@shared/config/importConfig';\nimport Logger from '@shared/utils/logger';\nimport { WhatsApp } from '../whatsapp';\nimport {\n FlowHandler,\n MessageHandler,\n processFlowRequest,\n processWebhookMessages,\n verifyWebhook,\n WebhookRequest,\n WebhookResponse,\n} from './utils/webhookUtils';\n\nconst LIB_NAME = 'WEBHOOK';\nconst LOGGER = new Logger(LIB_NAME, process.env.DEBUG === 'true');\n\n/**\n * Framework-agnostic WebhookHandler using pure functions\n */\nexport class WebhookHandler {\n private config: WabaConfigType;\n private client: WhatsApp;\n private messageHandlers: Map<MessageTypesEnum, MessageHandler> = new Map();\n private preProcessHandler: MessageHandler | undefined = undefined;\n private postProcessHandler: MessageHandler | undefined = undefined;\n private flowHandlers: Map<FlowTypeEnum, FlowHandler> = new Map();\n\n constructor(config: WhatsAppConfig) {\n this.config = importConfig(config);\n this.client = new WhatsApp(config);\n LOGGER.log('WebhookHandler instantiated!');\n }\n\n /**\n * Handle webhook verification (framework-agnostic)\n */\n public handleVerification = (request: Pick<WebhookRequest, 'query'>): WebhookResponse => {\n return verifyWebhook(request, this.config.WEBHOOK_VERIFICATION_TOKEN || '');\n };\n\n /**\n * Handle webhook messages (framework-agnostic)\n */\n public handleWebhook = async (request: WebhookRequest): Promise<WebhookResponse> => {\n return processWebhookMessages(request, this.client, {\n messageHandlers: this.messageHandlers,\n preProcessHandler: this.preProcessHandler,\n postProcessHandler: this.postProcessHandler,\n });\n };\n\n /**\n * Handle flow requests (framework-agnostic)\n */\n public handleFlow = async (request: WebhookRequest): Promise<WebhookResponse> => {\n return processFlowRequest(request, this.config, this.client, this.flowHandlers);\n };\n\n /**\n * Register a message handler for a specific message type\n */\n public onMessage(type: MessageTypesEnum, handler: MessageHandler): void {\n this.messageHandlers.set(type, handler);\n LOGGER.log(`Registered message handler for ${type}`);\n }\n\n /**\n * Register a pre-process handler that runs before all message handlers\n */\n public onMessagePreProcess(handler: MessageHandler): void {\n this.preProcessHandler = handler;\n LOGGER.log('Registered pre-process handler');\n }\n\n /**\n * Register a post-process handler that runs after all message handlers\n */\n public onMessagePostProcess(handler: MessageHandler): void {\n this.postProcessHandler = handler;\n LOGGER.log('Registered post-process handler');\n }\n\n /**\n * Register a flow handler for a specific flow type\n */\n public onFlow(type: FlowTypeEnum, handler: FlowHandler): void {\n this.flowHandlers.set(type, handler);\n LOGGER.log(`Registered flow handler for ${type}`);\n }\n}\n","import * as crypto from 'crypto';\n\nexport const generateXHub256Sig = (body: string, appSecret: string) => {\n return crypto.createHmac('sha256', appSecret).update(body, 'utf-8').digest('hex');\n};\n"]}
@@ -1,19 +1,19 @@
1
- export { F as FlowHandler, M as MessageStatus, W as WebhookContact, a as WebhookEvent, c as WebhookHandler, b as WebhookMessage, e as WebhookRequest, f as WebhookResponse, p as processFlowRequest, d as processWebhookMessages, v as verifyWebhook } from '../../WebhookHandler-BcVZPlq8.js';
1
+ export { F as FlowHandler, M as MessageStatus, W as WebhookContact, a as WebhookEvent, c as WebhookHandler, b as WebhookMessage, e as WebhookRequest, f as WebhookResponse, p as processFlowRequest, d as processWebhookMessages, v as verifyWebhook } from '../../WebhookHandler-Bo70U_Cu.js';
2
2
  import '../../shared/types/config.js';
3
- import '../../enums-CM95zXd_.js';
4
- import '../../FlowApi-B_S2OAFn.js';
5
- import '../../base-WGahY7ao.js';
6
- import '../../index-BBvXSzXG.js';
7
- import '../../EncryptionApi-udtMPgrF.js';
8
- import '../../MediaApi-Raddyh38.js';
9
- import '../../MessageApi-CsdVH_9V.js';
10
- import '../../PhoneNumberApi-DVUn9x88.js';
11
- import '../../BusinessProfileApi-C1x8w77V.js';
12
- import '../../QrCodeApi-lDLJYnCg.js';
13
- import '../../RegistrationApi-Co1NiWw_.js';
14
- import '../../TemplateApi-DhR1Xy73.js';
15
- import '../../TwoStepVerificationApi-ByTfkum8.js';
16
- import '../../WabaApi-CXb5Z_Ek.js';
3
+ import '../../enums-DvwSJq9w.js';
4
+ import '../../FlowApi-CASVC-Al.js';
5
+ import '../../base-BhCbbsxB.js';
6
+ import '../../index-CaRxVWvr.js';
7
+ import '../../EncryptionApi-PHxeI2G_.js';
8
+ import '../../MediaApi-B2vtjiCm.js';
9
+ import '../../MessageApi-B5xedsTj.js';
10
+ import '../../PhoneNumberApi-DMb_G3uw.js';
11
+ import '../../BusinessProfileApi-DE7Nnuy_.js';
12
+ import '../../QrCodeApi-D3rVKuxV.js';
13
+ import '../../RegistrationApi-DZBJWAZS.js';
14
+ import '../../TemplateApi-BA19cqfG.js';
15
+ import '../../TwoStepVerificationApi-6jV5pDxS.js';
16
+ import '../../WabaApi-B8Gv2UNE.js';
17
17
  import 'https';
18
18
 
19
19
  declare const generateXHub256Sig: (body: string, appSecret: string) => string;
@@ -1,2 +1,2 @@
1
- export{g as WebhookHandler,h as generateXHub256Sig,f as processFlowRequest,e as processWebhookMessages,d as verifyWebhook}from'../../chunk-4ZHGFSME.js';import'../../chunk-4LWNMCXG.js';import'../../chunk-3MO3BTBC.js';import'../../chunk-R36L2XYO.js';import'../../chunk-GT3XQN7Y.js';import'../../chunk-O2OTHNWM.js';import'../../chunk-7NQLQPLH.js';import'../../chunk-UQPD6GIF.js';import'../../chunk-5JGM556C.js';import'../../chunk-2NJVBJUN.js';import'../../chunk-XPPDOFBN.js';import'../../chunk-KFPOVYEJ.js';import'../../chunk-7GL74SXM.js';import'../../chunk-LGLRGXCE.js';import'../../chunk-GIQLIMOD.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{g as WebhookHandler,h as generateXHub256Sig,f as processFlowRequest,e as processWebhookMessages,d as verifyWebhook}from'../../chunk-Y5L5GUKB.js';import'../../chunk-5O5GLWIE.js';import'../../chunk-3MO3BTBC.js';import'../../chunk-R36L2XYO.js';import'../../chunk-GT3XQN7Y.js';import'../../chunk-O2OTHNWM.js';import'../../chunk-7NQLQPLH.js';import'../../chunk-UQPD6GIF.js';import'../../chunk-5JGM556C.js';import'../../chunk-2NJVBJUN.js';import'../../chunk-XPPDOFBN.js';import'../../chunk-KFPOVYEJ.js';import'../../chunk-7GL74SXM.js';import'../../chunk-LGLRGXCE.js';import'../../chunk-GIQLIMOD.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,16 +1,16 @@
1
- export { W as WhatsApp, d as WhatsAppClass } from '../../index-BBvXSzXG.js';
2
- import '../../EncryptionApi-udtMPgrF.js';
3
- import '../../base-WGahY7ao.js';
1
+ export { W as WhatsApp, d as WhatsAppClass } from '../../index-CaRxVWvr.js';
2
+ import '../../EncryptionApi-PHxeI2G_.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
6
- import '../../FlowApi-B_S2OAFn.js';
7
- import '../../MediaApi-Raddyh38.js';
8
- import '../../MessageApi-CsdVH_9V.js';
9
- import '../../PhoneNumberApi-DVUn9x88.js';
10
- import '../../BusinessProfileApi-C1x8w77V.js';
11
- import '../../QrCodeApi-lDLJYnCg.js';
12
- import '../../RegistrationApi-Co1NiWw_.js';
13
- import '../../TemplateApi-DhR1Xy73.js';
14
- import '../../TwoStepVerificationApi-ByTfkum8.js';
15
- import '../../WabaApi-CXb5Z_Ek.js';
5
+ import '../../enums-DvwSJq9w.js';
6
+ import '../../FlowApi-CASVC-Al.js';
7
+ import '../../MediaApi-B2vtjiCm.js';
8
+ import '../../MessageApi-B5xedsTj.js';
9
+ import '../../PhoneNumberApi-DMb_G3uw.js';
10
+ import '../../BusinessProfileApi-DE7Nnuy_.js';
11
+ import '../../QrCodeApi-D3rVKuxV.js';
12
+ import '../../RegistrationApi-DZBJWAZS.js';
13
+ import '../../TemplateApi-BA19cqfG.js';
14
+ import '../../TwoStepVerificationApi-6jV5pDxS.js';
15
+ import '../../WabaApi-B8Gv2UNE.js';
16
16
  import 'https';
@@ -1,2 +1,2 @@
1
- export{b as WhatsApp}from'../../chunk-4LWNMCXG.js';import'../../chunk-3MO3BTBC.js';import'../../chunk-R36L2XYO.js';import'../../chunk-GT3XQN7Y.js';import'../../chunk-O2OTHNWM.js';import'../../chunk-7NQLQPLH.js';import'../../chunk-UQPD6GIF.js';import'../../chunk-5JGM556C.js';import'../../chunk-2NJVBJUN.js';import'../../chunk-XPPDOFBN.js';import'../../chunk-KFPOVYEJ.js';import'../../chunk-7GL74SXM.js';import'../../chunk-LGLRGXCE.js';import'../../chunk-GIQLIMOD.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{b as WhatsApp}from'../../chunk-5O5GLWIE.js';import'../../chunk-3MO3BTBC.js';import'../../chunk-R36L2XYO.js';import'../../chunk-GT3XQN7Y.js';import'../../chunk-O2OTHNWM.js';import'../../chunk-7NQLQPLH.js';import'../../chunk-UQPD6GIF.js';import'../../chunk-5JGM556C.js';import'../../chunk-2NJVBJUN.js';import'../../chunk-XPPDOFBN.js';import'../../chunk-KFPOVYEJ.js';import'../../chunk-7GL74SXM.js';import'../../chunk-LGLRGXCE.js';import'../../chunk-GIQLIMOD.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -62,14 +62,23 @@ declare enum InteractiveTypesEnum {
62
62
  AddressMessage = "address_message",
63
63
  Flow = "flow"
64
64
  }
65
- declare enum ButtonTypesEnum {
66
- QuickReply = "quick_reply",
67
- URL = "url"
68
- }
69
65
  declare enum ButtonPositionEnum {
70
- First = 0,
71
- Second = 1,
72
- Third = 2
66
+ First = 1,
67
+ Second = 2,
68
+ Third = 3,
69
+ Fourth = 4,
70
+ Fifth = 5
71
+ }
72
+ declare enum SubTypeEnum {
73
+ Catalog = "CATALOG",
74
+ CopyCode = "COPY_CODE",
75
+ Flow = "FLOW",
76
+ Mpm = "MPM",
77
+ OrderDetails = "ORDER_DETAILS",
78
+ QuickReply = "QUICK_REPLY",
79
+ Reminder = "REMINDER",
80
+ Url = "URL",
81
+ VoiceCall = "VOICE_CALL"
73
82
  }
74
83
  declare enum ComponentTypesEnum {
75
84
  Header = "HEADER",
@@ -647,8 +656,6 @@ type SDKEnums_BusinessVerticalEnum = BusinessVerticalEnum;
647
656
  declare const SDKEnums_BusinessVerticalEnum: typeof BusinessVerticalEnum;
648
657
  type SDKEnums_ButtonPositionEnum = ButtonPositionEnum;
649
658
  declare const SDKEnums_ButtonPositionEnum: typeof ButtonPositionEnum;
650
- type SDKEnums_ButtonTypesEnum = ButtonTypesEnum;
651
- declare const SDKEnums_ButtonTypesEnum: typeof ButtonTypesEnum;
652
659
  type SDKEnums_CategoryEnum = CategoryEnum;
653
660
  declare const SDKEnums_CategoryEnum: typeof CategoryEnum;
654
661
  type SDKEnums_ComponentTypesEnum = ComponentTypesEnum;
@@ -681,6 +688,8 @@ type SDKEnums_StatusEnum = StatusEnum;
681
688
  declare const SDKEnums_StatusEnum: typeof StatusEnum;
682
689
  type SDKEnums_StickerMediaTypesEnum = StickerMediaTypesEnum;
683
690
  declare const SDKEnums_StickerMediaTypesEnum: typeof StickerMediaTypesEnum;
691
+ type SDKEnums_SubTypeEnum = SubTypeEnum;
692
+ declare const SDKEnums_SubTypeEnum: typeof SubTypeEnum;
684
693
  type SDKEnums_SystemChangeTypesEnum = SystemChangeTypesEnum;
685
694
  declare const SDKEnums_SystemChangeTypesEnum: typeof SystemChangeTypesEnum;
686
695
  type SDKEnums_TemplateStatusEnum = TemplateStatusEnum;
@@ -692,7 +701,7 @@ declare const SDKEnums_WabaConfigEnum: typeof WabaConfigEnum;
692
701
  type SDKEnums_WebhookTypesEnum = WebhookTypesEnum;
693
702
  declare const SDKEnums_WebhookTypesEnum: typeof WebhookTypesEnum;
694
703
  declare namespace SDKEnums {
695
- export { SDKEnums_AudioMediaTypesEnum as AudioMediaTypesEnum, SDKEnums_BusinessVerticalEnum as BusinessVerticalEnum, SDKEnums_ButtonPositionEnum as ButtonPositionEnum, SDKEnums_ButtonTypesEnum as ButtonTypesEnum, SDKEnums_CategoryEnum as CategoryEnum, SDKEnums_ComponentTypesEnum as ComponentTypesEnum, SDKEnums_ConversationTypesEnum as ConversationTypesEnum, SDKEnums_CurrencyCodesEnum as CurrencyCodesEnum, SDKEnums_DataLocalizationRegionEnum as DataLocalizationRegionEnum, SDKEnums_DocumentMediaTypesEnum as DocumentMediaTypesEnum, SDKEnums_HttpMethodsEnum as HttpMethodsEnum, SDKEnums_ImageMediaTypesEnum as ImageMediaTypesEnum, SDKEnums_InteractiveTypesEnum as InteractiveTypesEnum, SDKEnums_LanguagesEnum as LanguagesEnum, SDKEnums_MessageTypesEnum as MessageTypesEnum, SDKEnums_ParametersTypesEnum as ParametersTypesEnum, SDKEnums_ReferralSourceTypesEnum as ReferralSourceTypesEnum, SDKEnums_RequestCodeMethodsEnum as RequestCodeMethodsEnum, SDKEnums_StatusEnum as StatusEnum, SDKEnums_StickerMediaTypesEnum as StickerMediaTypesEnum, SDKEnums_SystemChangeTypesEnum as SystemChangeTypesEnum, SDKEnums_TemplateStatusEnum as TemplateStatusEnum, SDKEnums_VideoMediaTypesEnum as VideoMediaTypesEnum, SDKEnums_WabaConfigEnum as WabaConfigEnum, SDKEnums_WebhookTypesEnum as WebhookTypesEnum };
704
+ export { SDKEnums_AudioMediaTypesEnum as AudioMediaTypesEnum, SDKEnums_BusinessVerticalEnum as BusinessVerticalEnum, SDKEnums_ButtonPositionEnum as ButtonPositionEnum, SDKEnums_CategoryEnum as CategoryEnum, SDKEnums_ComponentTypesEnum as ComponentTypesEnum, SDKEnums_ConversationTypesEnum as ConversationTypesEnum, SDKEnums_CurrencyCodesEnum as CurrencyCodesEnum, SDKEnums_DataLocalizationRegionEnum as DataLocalizationRegionEnum, SDKEnums_DocumentMediaTypesEnum as DocumentMediaTypesEnum, SDKEnums_HttpMethodsEnum as HttpMethodsEnum, SDKEnums_ImageMediaTypesEnum as ImageMediaTypesEnum, SDKEnums_InteractiveTypesEnum as InteractiveTypesEnum, SDKEnums_LanguagesEnum as LanguagesEnum, SDKEnums_MessageTypesEnum as MessageTypesEnum, SDKEnums_ParametersTypesEnum as ParametersTypesEnum, SDKEnums_ReferralSourceTypesEnum as ReferralSourceTypesEnum, SDKEnums_RequestCodeMethodsEnum as RequestCodeMethodsEnum, SDKEnums_StatusEnum as StatusEnum, SDKEnums_StickerMediaTypesEnum as StickerMediaTypesEnum, SDKEnums_SubTypeEnum as SubTypeEnum, SDKEnums_SystemChangeTypesEnum as SystemChangeTypesEnum, SDKEnums_TemplateStatusEnum as TemplateStatusEnum, SDKEnums_VideoMediaTypesEnum as VideoMediaTypesEnum, SDKEnums_WabaConfigEnum as WabaConfigEnum, SDKEnums_WebhookTypesEnum as WebhookTypesEnum };
696
705
  }
697
706
 
698
- export { AudioMediaTypesEnum as A, BusinessVerticalEnum as B, CurrencyCodesEnum as C, DataLocalizationRegionEnum as D, HttpMethodsEnum as H, ImageMediaTypesEnum as I, LanguagesEnum as L, MessageTypesEnum as M, ParametersTypesEnum as P, ReferralSourceTypesEnum as R, StatusEnum as S, TemplateStatusEnum as T, VideoMediaTypesEnum as V, WabaConfigEnum as W, CategoryEnum as a, ButtonPositionEnum as b, ButtonTypesEnum as c, ComponentTypesEnum as d, ConversationTypesEnum as e, DocumentMediaTypesEnum as f, InteractiveTypesEnum as g, RequestCodeMethodsEnum as h, StickerMediaTypesEnum as i, SystemChangeTypesEnum as j, WebhookTypesEnum as k, SDKEnums as l };
707
+ export { AudioMediaTypesEnum as A, BusinessVerticalEnum as B, CurrencyCodesEnum as C, DataLocalizationRegionEnum as D, HttpMethodsEnum as H, InteractiveTypesEnum as I, LanguagesEnum as L, MessageTypesEnum as M, ParametersTypesEnum as P, ReferralSourceTypesEnum as R, SubTypeEnum as S, TemplateStatusEnum as T, VideoMediaTypesEnum as V, WabaConfigEnum as W, CategoryEnum as a, ButtonPositionEnum as b, ComponentTypesEnum as c, ConversationTypesEnum as d, StatusEnum as e, StickerMediaTypesEnum as f, ImageMediaTypesEnum as g, DocumentMediaTypesEnum as h, WebhookTypesEnum as i, SystemChangeTypesEnum as j, RequestCodeMethodsEnum as k, SDKEnums as l };
@@ -1,8 +1,8 @@
1
- import { E as EncryptionApi } from '../../EncryptionApi-udtMPgrF.js';
2
- export { a as EncryptionClass, b as EncryptionPublicKeyResponse } from '../../EncryptionApi-udtMPgrF.js';
3
- import '../../base-WGahY7ao.js';
1
+ import { E as EncryptionApi } from '../../EncryptionApi-PHxeI2G_.js';
2
+ export { a as EncryptionClass, b as EncryptionPublicKeyResponse } from '../../EncryptionApi-PHxeI2G_.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
5
+ import '../../enums-DvwSJq9w.js';
6
6
 
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export{a as EncryptionApi,b as default}from'../../chunk-7NQLQPLH.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{a as EncryptionApi,b as default}from'../../chunk-7NQLQPLH.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- import { F as FlowApi } from '../../FlowApi-B_S2OAFn.js';
2
- export { C as CreateFlowResponse, a as Flow, c as FlowActionEnum, d as FlowAssetsResponse, e as FlowCategoryEnum, f as FlowClass, g as FlowEndpointRequest, h as FlowEndpointResponse, i as FlowMigrationResponse, j as FlowPreviewResponse, l as FlowStatusEnum, b as FlowType, n as FlowTypeEnum, m as FlowValidationError, k as FlowsListResponse, U as UpdateFlowResponse, V as ValidateFlowJsonResponse } from '../../FlowApi-B_S2OAFn.js';
3
- import '../../base-WGahY7ao.js';
1
+ import { F as FlowApi } from '../../FlowApi-CASVC-Al.js';
2
+ export { C as CreateFlowResponse, a as Flow, c as FlowActionEnum, d as FlowAssetsResponse, e as FlowCategoryEnum, f as FlowClass, g as FlowEndpointRequest, h as FlowEndpointResponse, i as FlowMigrationResponse, j as FlowPreviewResponse, l as FlowStatusEnum, b as FlowType, n as FlowTypeEnum, m as FlowValidationError, k as FlowsListResponse, U as UpdateFlowResponse, V as ValidateFlowJsonResponse } from '../../FlowApi-CASVC-Al.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
5
+ import '../../enums-DvwSJq9w.js';
6
6
 
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export{a as FlowApi,b as FlowTypeEnum,c as default}from'../../chunk-LGLRGXCE.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{a as FlowApi,b as FlowTypeEnum,c as default}from'../../chunk-LGLRGXCE.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- import { M as MediaApi } from '../../MediaApi-Raddyh38.js';
2
- export { a as MediaClass, b as MediaResponse, c as MediasResponse, U as UploadMediaResponse } from '../../MediaApi-Raddyh38.js';
3
- import '../../base-WGahY7ao.js';
1
+ import { M as MediaApi } from '../../MediaApi-B2vtjiCm.js';
2
+ export { a as MediaClass, b as MediaResponse, c as MediasResponse, U as UploadMediaResponse } from '../../MediaApi-B2vtjiCm.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
5
+ import '../../enums-DvwSJq9w.js';
6
6
 
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export{a as MediaApi,b as default}from'../../chunk-XPPDOFBN.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{a as MediaApi,b as default}from'../../chunk-XPPDOFBN.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- import { M as MessagesApi } from '../../MessageApi-CsdVH_9V.js';
2
- export { A as AudioMediaObject, C as ContactObject, D as DocumentMediaObject, I as ImageMediaObject, a as InteractiveObject, L as LocationObject, b as MessageRequestParams, d as MessageTemplateObject, c as MessagesResponse, R as ReactionParams, S as StatusParams, e as StickerMediaObject, T as TextMessageParams, f as TextObject, V as VideoMediaObject } from '../../MessageApi-CsdVH_9V.js';
3
- import '../../base-WGahY7ao.js';
1
+ import { M as MessagesApi } from '../../MessageApi-B5xedsTj.js';
2
+ export { A as AudioMediaObject, C as ContactObject, D as DocumentMediaObject, I as ImageMediaObject, a as InteractiveObject, L as LocationObject, b as MessageRequestParams, d as MessageTemplateObject, c as MessagesResponse, R as ReactionParams, S as StatusParams, e as StickerMediaObject, T as TextMessageParams, f as TextObject, V as VideoMediaObject } from '../../MessageApi-B5xedsTj.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
5
+ import '../../enums-DvwSJq9w.js';
6
6
 
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export{a as MessageApi,b as default}from'../../chunk-2NJVBJUN.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{a as MessageApi,b as default}from'../../chunk-2NJVBJUN.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- import { P as PhoneNumberApi } from '../../PhoneNumberApi-DVUn9x88.js';
2
- export { A as AccountMode, C as CodeVerificationStatus, a as Cursors, H as HealthStatus, b as HealthStatusEntity, M as MessagingLimitTier, c as PhoneNumberClass, d as PhoneNumberResponse, e as PhoneNumbersResponse, f as PlatformType, Q as QualityRating, g as QualityScore, R as RequestVerificationCodeRequest, T as Throughput, h as ThroughputLevel, i as TwoStepVerificationParams, V as VerifyCodeRequest } from '../../PhoneNumberApi-DVUn9x88.js';
3
- import '../../base-WGahY7ao.js';
1
+ import { P as PhoneNumberApi } from '../../PhoneNumberApi-DMb_G3uw.js';
2
+ export { A as AccountMode, C as CodeVerificationStatus, a as Cursors, H as HealthStatus, b as HealthStatusEntity, M as MessagingLimitTier, c as PhoneNumberClass, d as PhoneNumberResponse, e as PhoneNumbersResponse, f as PlatformType, Q as QualityRating, g as QualityScore, R as RequestVerificationCodeRequest, T as Throughput, h as ThroughputLevel, i as TwoStepVerificationParams, V as VerifyCodeRequest } from '../../PhoneNumberApi-DMb_G3uw.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
5
+ import '../../enums-DvwSJq9w.js';
6
6
 
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export{a as PhoneNumberApi,b as default}from'../../chunk-GIQLIMOD.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{a as PhoneNumberApi,b as default}from'../../chunk-GIQLIMOD.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- import { B as BusinessProfileApi } from '../../BusinessProfileApi-C1x8w77V.js';
2
- export { a as BusinessProfileClass, b as BusinessProfileData, c as BusinessProfileField, d as BusinessProfileFieldsParam, e as BusinessProfileResponse, C as CreateUploadSessionParams, G as GetUploadHandleParams, U as UpdateBusinessProfileRequest, f as UploadBusinessProfileResponse, g as UploadHandle, h as UploadMediaParams, i as UploadSession, j as UploadSessionResponse } from '../../BusinessProfileApi-C1x8w77V.js';
3
- import '../../base-WGahY7ao.js';
1
+ import { B as BusinessProfileApi } from '../../BusinessProfileApi-DE7Nnuy_.js';
2
+ export { a as BusinessProfileClass, b as BusinessProfileData, c as BusinessProfileField, d as BusinessProfileFieldsParam, e as BusinessProfileResponse, C as CreateUploadSessionParams, G as GetUploadHandleParams, U as UpdateBusinessProfileRequest, f as UploadBusinessProfileResponse, g as UploadHandle, h as UploadMediaParams, i as UploadSession, j as UploadSessionResponse } from '../../BusinessProfileApi-DE7Nnuy_.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
5
+ import '../../enums-DvwSJq9w.js';
6
6
 
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export{a as BusinessProfileApi,b as default}from'../../chunk-KFPOVYEJ.js';import'../../chunk-7GL74SXM.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{a as BusinessProfileApi,b as default}from'../../chunk-KFPOVYEJ.js';import'../../chunk-7GL74SXM.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- import { Q as QrCodeApi } from '../../QrCodeApi-lDLJYnCg.js';
2
- export { C as CreateQrCodeRequest, a as QrCodeClass, b as QrCodeResponse, c as QrCodesResponse, U as UpdateQrCodeRequest } from '../../QrCodeApi-lDLJYnCg.js';
3
- import '../../base-WGahY7ao.js';
1
+ import { Q as QrCodeApi } from '../../QrCodeApi-D3rVKuxV.js';
2
+ export { C as CreateQrCodeRequest, a as QrCodeClass, b as QrCodeResponse, c as QrCodesResponse, U as UpdateQrCodeRequest } from '../../QrCodeApi-D3rVKuxV.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
5
+ import '../../enums-DvwSJq9w.js';
6
6
 
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export{a as default}from'../../chunk-I222VSWK.js';export{a as QrCodeApi}from'../../chunk-GT3XQN7Y.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{a as default}from'../../chunk-I222VSWK.js';export{a as QrCodeApi}from'../../chunk-GT3XQN7Y.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- import { R as RegistrationApi } from '../../RegistrationApi-Co1NiWw_.js';
2
- export { a as RegistrationClass, b as RegistrationRequest } from '../../RegistrationApi-Co1NiWw_.js';
3
- import '../../base-WGahY7ao.js';
1
+ import { R as RegistrationApi } from '../../RegistrationApi-DZBJWAZS.js';
2
+ export { a as RegistrationClass, b as RegistrationRequest } from '../../RegistrationApi-DZBJWAZS.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
5
+ import '../../enums-DvwSJq9w.js';
6
6
 
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export{a as RegistrationApi,b as default}from'../../chunk-O2OTHNWM.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{a as RegistrationApi,b as default}from'../../chunk-O2OTHNWM.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- import { T as TemplateFormat, a as TemplateRequestBody } from '../../TemplateApi-DhR1Xy73.js';
2
- export { C as CatalogButton, g as ComponentTypes, h as CopyCodeButton, F as FlowButton, M as MPMButton, O as OTPButton, P as PhoneNumberButton, Q as QuickReplyButton, S as SPMButton, f as TemplateApi, i as TemplateBody, j as TemplateButton, k as TemplateButtons, l as TemplateCarousel, b as TemplateClass, c as TemplateDeleteParams, m as TemplateFooter, d as TemplateGetParams, n as TemplateHeader, o as TemplateHeaderExample, p as TemplateLimitedTimeOffer, e as TemplateResponse, U as URLButton, f as default } from '../../TemplateApi-DhR1Xy73.js';
3
- import { L as LanguagesEnum, C as CurrencyCodesEnum, a as CategoryEnum } from '../../enums-CM95zXd_.js';
4
- import '../../base-WGahY7ao.js';
1
+ import { T as TemplateFormat, a as TemplateRequestBody } from '../../TemplateApi-BA19cqfG.js';
2
+ export { C as CatalogButton, g as ComponentTypes, h as CopyCodeButton, F as FlowButton, M as MPMButton, O as OTPButton, P as PhoneNumberButton, Q as QuickReplyButton, S as SPMButton, f as TemplateApi, i as TemplateBody, j as TemplateButton, k as TemplateButtons, l as TemplateCarousel, b as TemplateClass, c as TemplateDeleteParams, m as TemplateFooter, d as TemplateGetParams, n as TemplateHeader, o as TemplateHeaderExample, p as TemplateLimitedTimeOffer, e as TemplateResponse, U as URLButton, f as default } from '../../TemplateApi-BA19cqfG.js';
3
+ import { L as LanguagesEnum, C as CurrencyCodesEnum, a as CategoryEnum } from '../../enums-DvwSJq9w.js';
4
+ import '../../base-BhCbbsxB.js';
5
5
  import '../../shared/types/config.js';
6
6
 
7
7
  interface TextParameter {
@@ -1,2 +1,2 @@
1
- export{c as createAuthenticationTemplate,d as createCatalogTemplate,e as createCouponTemplate,f as createLimitedTimeOfferTemplate,h as createMPMTemplate,g as createMediaCardCarouselTemplate,b as createOTPTemplate,i as createProductCardCarouselTemplate,j as createSPMTemplate,a as createTemplate}from'../../chunk-FLDBNTNY.js';export{a as TemplateApi,a as default}from'../../chunk-R36L2XYO.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{c as createAuthenticationTemplate,d as createCatalogTemplate,e as createCouponTemplate,f as createLimitedTimeOfferTemplate,h as createMPMTemplate,g as createMediaCardCarouselTemplate,b as createOTPTemplate,i as createProductCardCarouselTemplate,j as createSPMTemplate,a as createTemplate}from'../../chunk-FLDBNTNY.js';export{a as TemplateApi,a as default}from'../../chunk-R36L2XYO.js';import'../../chunk-BZ5QDXNR.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- import { T as TwoStepVerificationApi } from '../../TwoStepVerificationApi-ByTfkum8.js';
2
- export { a as TwoStepVerificationClass, b as TwoStepVerificationRequest } from '../../TwoStepVerificationApi-ByTfkum8.js';
3
- import '../../base-WGahY7ao.js';
1
+ import { T as TwoStepVerificationApi } from '../../TwoStepVerificationApi-6jV5pDxS.js';
2
+ export { a as TwoStepVerificationClass, b as TwoStepVerificationRequest } from '../../TwoStepVerificationApi-6jV5pDxS.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
5
+ import '../../enums-DvwSJq9w.js';
6
6
 
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export{a as TwoStepVerificationApi,b as default}from'../../chunk-UQPD6GIF.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{a as TwoStepVerificationApi,b as default}from'../../chunk-UQPD6GIF.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- import { W as WabaApi } from '../../WabaApi-CXb5Z_Ek.js';
2
- export { U as UpdateWabaSubscription, b as WABAClass, a as WabaAccount, c as WabaSubscriptions } from '../../WabaApi-CXb5Z_Ek.js';
3
- import '../../base-WGahY7ao.js';
1
+ import { W as WabaApi } from '../../WabaApi-B8Gv2UNE.js';
2
+ export { U as UpdateWabaSubscription, b as WABAClass, a as WabaAccount, c as WabaSubscriptions } from '../../WabaApi-B8Gv2UNE.js';
3
+ import '../../base-BhCbbsxB.js';
4
4
  import '../../shared/types/config.js';
5
- import '../../enums-CM95zXd_.js';
5
+ import '../../enums-DvwSJq9w.js';
6
6
 
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export{a as WabaApi,b as default}from'../../chunk-5JGM556C.js';import'../../chunk-7GL74SXM.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-QCFJGLDQ.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
1
+ export{a as WabaApi,b as default}from'../../chunk-5JGM556C.js';import'../../chunk-7GL74SXM.js';import'../../chunk-VW3LGHTJ.js';import'../../chunk-4O3T25CT.js';import'../../chunk-4C666HHU.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,17 +1,17 @@
1
- import { E as EncryptionApi } from './EncryptionApi-udtMPgrF.js';
2
- import { F as FlowApi } from './FlowApi-B_S2OAFn.js';
1
+ import { E as EncryptionApi } from './EncryptionApi-PHxeI2G_.js';
2
+ import { F as FlowApi } from './FlowApi-CASVC-Al.js';
3
3
  import { WhatsAppConfig, WabaConfigType } from './shared/types/config.js';
4
- import { M as MediaApi } from './MediaApi-Raddyh38.js';
5
- import { M as MessagesApi } from './MessageApi-CsdVH_9V.js';
6
- import { P as PhoneNumberApi } from './PhoneNumberApi-DVUn9x88.js';
7
- import { B as BusinessProfileApi } from './BusinessProfileApi-C1x8w77V.js';
8
- import { Q as QrCodeApi } from './QrCodeApi-lDLJYnCg.js';
9
- import { R as RegistrationApi } from './RegistrationApi-Co1NiWw_.js';
10
- import { f as TemplateApi } from './TemplateApi-DhR1Xy73.js';
11
- import { T as TwoStepVerificationApi } from './TwoStepVerificationApi-ByTfkum8.js';
12
- import { W as WabaApi } from './WabaApi-CXb5Z_Ek.js';
13
- import { H as HttpMethodsEnum, l as SDKEnums } from './enums-CM95zXd_.js';
14
- import { a as RequesterClass } from './base-WGahY7ao.js';
4
+ import { M as MediaApi } from './MediaApi-B2vtjiCm.js';
5
+ import { M as MessagesApi } from './MessageApi-B5xedsTj.js';
6
+ import { P as PhoneNumberApi } from './PhoneNumberApi-DMb_G3uw.js';
7
+ import { B as BusinessProfileApi } from './BusinessProfileApi-DE7Nnuy_.js';
8
+ import { Q as QrCodeApi } from './QrCodeApi-D3rVKuxV.js';
9
+ import { R as RegistrationApi } from './RegistrationApi-DZBJWAZS.js';
10
+ import { f as TemplateApi } from './TemplateApi-BA19cqfG.js';
11
+ import { T as TwoStepVerificationApi } from './TwoStepVerificationApi-6jV5pDxS.js';
12
+ import { W as WabaApi } from './WabaApi-B8Gv2UNE.js';
13
+ import { H as HttpMethodsEnum, l as SDKEnums } from './enums-DvwSJq9w.js';
14
+ import { a as RequesterClass } from './base-BhCbbsxB.js';
15
15
  import { Agent } from 'https';
16
16
 
17
17
  type ResponseHeaderValue = string | string[] | undefined;