├── OpenAI+API ├── .gitignore ├── .eslintignore ├── src │ ├── core.ts │ ├── schema.ts │ ├── clientAdapter.ts │ ├── authentication.ts │ ├── models │ │ ├── createTranslationResponse.ts │ │ ├── createTranscriptionResponse.ts │ │ ├── datum.ts │ │ ├── roleEnum.ts │ │ ├── sizeEnum.ts │ │ ├── responseFormatEnum.ts │ │ ├── imagesResponse.ts │ │ ├── usage.ts │ │ ├── chatCompletionResponseMessage.ts │ │ ├── chatCompletionRequestMessage.ts │ │ ├── choice.ts │ │ ├── createChatCompletionResponse.ts │ │ ├── createImageRequest.ts │ │ └── createChatCompletionRequest.ts │ ├── controllers │ │ ├── baseController.ts │ │ └── openAIController.ts │ ├── clientInterface.ts │ ├── configuration.ts │ ├── defaultConfiguration.ts │ ├── index.ts │ └── client.ts ├── tsconfig.cjs.json ├── jest.config.js ├── doc │ ├── models │ │ ├── role-enum.md │ │ ├── response-format-enum.md │ │ ├── size-enum.md │ │ ├── create-translation-response.md │ │ ├── create-transcription-response.md │ │ ├── datum.md │ │ ├── usage.md │ │ ├── chat-completion-response-message.md │ │ ├── images-response.md │ │ ├── chat-completion-request-message.md │ │ ├── choice.md │ │ ├── create-image-request.md │ │ ├── create-chat-completion-response.md │ │ └── create-chat-completion-request.md │ ├── api-response.md │ ├── api-error.md │ ├── client.md │ └── controllers │ │ └── open-ai.md ├── tsconfig.esm.json ├── .editorconfig ├── tsconfig.base.json ├── tsconfig.json ├── .eslintrc.json ├── LICENSE ├── package.json └── README.md ├── WhatsApp+Cloud+API ├── .gitignore ├── jest.config.js ├── src │ ├── core.ts │ ├── schema.ts │ ├── models │ │ ├── responseMessage.ts │ │ ├── body.ts │ │ ├── footer.ts │ │ ├── responseContact.ts │ │ ├── subTypeEnum.ts │ │ ├── row.ts │ │ ├── button.ts │ │ ├── interactiveTypeEnum.ts │ │ ├── componentTypeEnum.ts │ │ ├── headerTypeEnum.ts │ │ ├── phoneTypeEnum.ts │ │ ├── buttonParameterTypeEnum.ts │ │ ├── personalInformationTypeEnum.ts │ │ ├── parameterTypeEnum.ts │ │ ├── language.ts │ │ ├── urlObject.ts │ │ ├── audio.ts │ │ ├── emailObject.ts │ │ ├── video.ts │ │ ├── org.ts │ │ ├── sticker.ts │ │ ├── currency.ts │ │ ├── buttonReply.ts │ │ ├── messageTypeEnum.ts │ │ ├── retrieveMediaURL.ts │ │ ├── phoneObject.ts │ │ ├── image.ts │ │ ├── location.ts │ │ ├── name.ts │ │ ├── template.ts │ │ ├── sendMessageResponse.ts │ │ ├── section.ts │ │ ├── document.ts │ │ ├── buttonParameter.ts │ │ ├── action.ts │ │ ├── header.ts │ │ ├── dateTimeObject.ts │ │ ├── interactive.ts │ │ ├── component.ts │ │ ├── address.ts │ │ ├── contact.ts │ │ ├── parameter.ts │ │ ├── text.ts │ │ └── message.ts │ ├── http │ │ └── xmlSerialization.ts │ ├── controllers │ │ ├── baseController.ts │ │ ├── messagesController.ts │ │ └── mediaController.ts │ ├── clientInterface.ts │ ├── configuration.ts │ ├── defaultConfiguration.ts │ ├── authentication.ts │ ├── index.ts │ └── client.ts ├── doc │ ├── models │ │ ├── sub-type-enum.md │ │ ├── button-parameter-type-enum.md │ │ ├── component-type-enum.md │ │ ├── header-type-enum.md │ │ ├── personal-information-type-enum.md │ │ ├── phone-type-enum.md │ │ ├── interactive-type-enum.md │ │ ├── parameter-type-enum.md │ │ ├── response-message.md │ │ ├── message-type-enum.md │ │ ├── response-contact.md │ │ ├── footer.md │ │ ├── body.md │ │ ├── button.md │ │ ├── url-object.md │ │ ├── email-object.md │ │ ├── language.md │ │ ├── sticker.md │ │ ├── audio.md │ │ ├── currency.md │ │ ├── video.md │ │ ├── row.md │ │ ├── button-reply.md │ │ ├── org.md │ │ ├── template.md │ │ ├── phone-object.md │ │ ├── image.md │ │ ├── retrieve-media-url.md │ │ ├── location.md │ │ ├── button-parameter.md │ │ ├── send-message-response.md │ │ ├── header.md │ │ ├── name.md │ │ ├── document.md │ │ ├── component.md │ │ ├── date-time-object.md │ │ ├── address.md │ │ ├── parameter.md │ │ ├── section.md │ │ ├── text.md │ │ ├── action.md │ │ ├── message.md │ │ ├── interactive.md │ │ └── contact.md │ ├── api-response.md │ ├── api-error.md │ ├── client.md │ └── controllers │ │ ├── media.md │ │ └── messages.md ├── .editorconfig ├── tsdx.config.js ├── tsconfig.json ├── LICENSE ├── package.json └── README.md ├── public ├── webhook.png └── working.gif ├── .env.example ├── .gitignore ├── package.json ├── services ├── OpenAIWhisperService.js └── WhatsAppCloudService.js ├── web.config ├── index.js ├── WhatsAppAudioHandler.js ├── Transcription.js └── README.md /OpenAI+API/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .DS_Store 3 | node_modules 4 | dist 5 | coverage -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .DS_Store 3 | node_modules 4 | dist 5 | coverage -------------------------------------------------------------------------------- /OpenAI+API/.eslintignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .DS_Store 3 | node_modules 4 | dist 5 | coverage 6 | test -------------------------------------------------------------------------------- /public/webhook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mehnoorsiddiqui/whatsapp-voice-transcriber/HEAD/public/webhook.png -------------------------------------------------------------------------------- /public/working.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mehnoorsiddiqui/whatsapp-voice-transcriber/HEAD/public/working.gif -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | globals: { 4 | "__DEV__": true, 5 | } 6 | }; -------------------------------------------------------------------------------- /OpenAI+API/src/core.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAI APILib 3 | * 4 | * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). 5 | */ 6 | 7 | export * from '@apimatic/core'; -------------------------------------------------------------------------------- /OpenAI+API/src/schema.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAI APILib 3 | * 4 | * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). 5 | */ 6 | 7 | export * from '@apimatic/schema'; 8 | -------------------------------------------------------------------------------- /OpenAI+API/src/clientAdapter.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAI APILib 3 | * 4 | * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). 5 | */ 6 | 7 | export * from '@apimatic/axios-client-adapter'; -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/src/core.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * WhatsApp Cloud APILib 3 | * 4 | * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). 5 | */ 6 | 7 | export * from '@apimatic/core'; 8 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/src/schema.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * WhatsApp Cloud APILib 3 | * 4 | * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). 5 | */ 6 | 7 | export * from '@apimatic/schema'; 8 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | WHATSAPP_ACCESS_TOKEN='your_whatsapp_access_token' 2 | WHATSAPP_PHONE_NUMBER_ID='your_whatsapp_phone_number_id' 3 | WEBHOOK_VERIFY_TOKEN='your_webhook_verify_token' 4 | OPENAI_API_KEY='your_openai_api_key' 5 | -------------------------------------------------------------------------------- /OpenAI+API/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "CommonJS", 5 | "outDir": "dist/cjs", 6 | "declarationDir": "dist/types" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /OpenAI+API/src/authentication.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAI APILib 3 | * 4 | * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). 5 | */ 6 | 7 | export * from '@apimatic/authentication-adapters'; 8 | -------------------------------------------------------------------------------- /OpenAI+API/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | preset: 'ts-jest', 4 | globals: { 5 | __DEV__: true, 6 | 'ts-jest': { 7 | tsConfig: 'tsconfig.base.json', 8 | }, 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /OpenAI+API/doc/models/role-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Role Enum 3 | 4 | The role of the author of this message. 5 | 6 | ## Enumeration 7 | 8 | `RoleEnum` 9 | 10 | ## Fields 11 | 12 | | Name | 13 | | --- | 14 | | `system` | 15 | | `user` | 16 | | `assistant` | 17 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | package-lock.json 3 | WhatsApp+Cloud+API/node_modules/ 4 | WhatsApp+Cloud+API/package-lock.json 5 | OpenAI+Whisper+API/node_modules/ 6 | OpenAI+Whisper+API/package-lock. 7 | GIFs 8 | OpenAI+API+Whisper+SDK 9 | .env 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/sub-type-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Sub Type Enum 3 | 4 | ## Enumeration 5 | 6 | `SubTypeEnum` 7 | 8 | ## Fields 9 | 10 | | Name | 11 | | --- | 12 | | `quickReply` | 13 | | `url` | 14 | 15 | ## Example 16 | 17 | ``` 18 | url 19 | ``` 20 | 21 | -------------------------------------------------------------------------------- /OpenAI+API/tsconfig.esm.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "esnext", 5 | "lib": ["esnext"], 6 | "outDir": "dist/esm", 7 | "declarationDir": "dist/types", 8 | "target": "ES2017" 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/button-parameter-type-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Button Parameter Type Enum 3 | 4 | ## Enumeration 5 | 6 | `ButtonParameterTypeEnum` 7 | 8 | ## Fields 9 | 10 | | Name | 11 | | --- | 12 | | `payload` | 13 | | `text` | 14 | 15 | ## Example 16 | 17 | ``` 18 | text 19 | ``` 20 | 21 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/component-type-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Component Type Enum 3 | 4 | ## Enumeration 5 | 6 | `ComponentTypeEnum` 7 | 8 | ## Fields 9 | 10 | | Name | 11 | | --- | 12 | | `header` | 13 | | `body` | 14 | | `button` | 15 | 16 | ## Example 17 | 18 | ``` 19 | button 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/header-type-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Header Type Enum 3 | 4 | ## Enumeration 5 | 6 | `HeaderTypeEnum` 7 | 8 | ## Fields 9 | 10 | | Name | 11 | | --- | 12 | | `text` | 13 | | `document` | 14 | | `image` | 15 | | `video` | 16 | 17 | ## Example 18 | 19 | ``` 20 | text 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/personal-information-type-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Personal Information Type Enum 3 | 4 | ## Enumeration 5 | 6 | `PersonalInformationTypeEnum` 7 | 8 | ## Fields 9 | 10 | | Name | 11 | | --- | 12 | | `hOME` | 13 | | `wORK` | 14 | 15 | ## Example 16 | 17 | ``` 18 | HOME 19 | ``` 20 | 21 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/phone-type-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Phone Type Enum 3 | 4 | ## Enumeration 5 | 6 | `PhoneTypeEnum` 7 | 8 | ## Fields 9 | 10 | | Name | 11 | | --- | 12 | | `hOME` | 13 | | `wORK` | 14 | | `cELL` | 15 | | `mAIN` | 16 | | `iPHONE` | 17 | 18 | ## Example 19 | 20 | ``` 21 | HOME 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /OpenAI+API/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | max_line_length = 80 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | max_line_length = 0 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | max_line_length = 80 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | max_line_length = 0 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/interactive-type-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Interactive Type Enum 3 | 4 | The type of interactive message you want to send. 5 | 6 | ## Enumeration 7 | 8 | `InteractiveTypeEnum` 9 | 10 | ## Fields 11 | 12 | | Name | 13 | | --- | 14 | | `list` | 15 | | `button` | 16 | 17 | ## Example 18 | 19 | ``` 20 | button 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/parameter-type-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Parameter Type Enum 3 | 4 | ## Enumeration 5 | 6 | `ParameterTypeEnum` 7 | 8 | ## Fields 9 | 10 | | Name | 11 | | --- | 12 | | `text` | 13 | | `currency` | 14 | | `dateTime` | 15 | | `image` | 16 | | `document` | 17 | | `video` | 18 | 19 | ## Example 20 | 21 | ``` 22 | video 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /OpenAI+API/doc/models/response-format-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Response Format Enum 3 | 4 | The format in which the generated images are returned. Must be one of `url` or `b64_json`. 5 | 6 | ## Enumeration 7 | 8 | `ResponseFormatEnum` 9 | 10 | ## Fields 11 | 12 | | Name | 13 | | --- | 14 | | `url` | 15 | | `b64Json` | 16 | 17 | ## Example 18 | 19 | ``` 20 | url 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /OpenAI+API/doc/models/size-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Size Enum 3 | 4 | The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. 5 | 6 | ## Enumeration 7 | 8 | `SizeEnum` 9 | 10 | ## Fields 11 | 12 | | Name | 13 | | --- | 14 | | `enum256x256` | 15 | | `enum512x512` | 16 | | `enum1024x1024` | 17 | 18 | ## Example 19 | 20 | ``` 21 | 1024x1024 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /OpenAI+API/doc/models/create-translation-response.md: -------------------------------------------------------------------------------- 1 | 2 | # Create Translation Response 3 | 4 | ## Structure 5 | 6 | `CreateTranslationResponse` 7 | 8 | ## Fields 9 | 10 | | Name | Type | Tags | Description | 11 | | --- | --- | --- | --- | 12 | | `text` | `string` | Required | - | 13 | 14 | ## Example (as JSON) 15 | 16 | ```json 17 | { 18 | "text": "text0" 19 | } 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/response-message.md: -------------------------------------------------------------------------------- 1 | 2 | # Response Message 3 | 4 | ## Structure 5 | 6 | `ResponseMessage` 7 | 8 | ## Fields 9 | 10 | | Name | Type | Tags | Description | 11 | | --- | --- | --- | --- | 12 | | `id` | `string` | Required | - | 13 | 14 | ## Example (as JSON) 15 | 16 | ```json 17 | { 18 | "id": "wamid.gBGGSFcCNEOPAgkO_KJ55r4w_ww" 19 | } 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /OpenAI+API/doc/models/create-transcription-response.md: -------------------------------------------------------------------------------- 1 | 2 | # Create Transcription Response 3 | 4 | ## Structure 5 | 6 | `CreateTranscriptionResponse` 7 | 8 | ## Fields 9 | 10 | | Name | Type | Tags | Description | 11 | | --- | --- | --- | --- | 12 | | `text` | `string` | Required | - | 13 | 14 | ## Example (as JSON) 15 | 16 | ```json 17 | { 18 | "text": "text0" 19 | } 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /OpenAI+API/doc/models/datum.md: -------------------------------------------------------------------------------- 1 | 2 | # Datum 3 | 4 | ## Structure 5 | 6 | `Datum` 7 | 8 | ## Fields 9 | 10 | | Name | Type | Tags | Description | 11 | | --- | --- | --- | --- | 12 | | `url` | `string \| undefined` | Optional | - | 13 | | `b64Json` | `string \| undefined` | Optional | - | 14 | 15 | ## Example (as JSON) 16 | 17 | ```json 18 | { 19 | "url": "url4", 20 | "b64_json": "b64_json6" 21 | } 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/message-type-enum.md: -------------------------------------------------------------------------------- 1 | 2 | # Message Type Enum 3 | 4 | ## Enumeration 5 | 6 | `MessageTypeEnum` 7 | 8 | ## Fields 9 | 10 | | Name | 11 | | --- | 12 | | `text` | 13 | | `audio` | 14 | | `contacts` | 15 | | `document` | 16 | | `image` | 17 | | `interactive` | 18 | | `location` | 19 | | `sticker` | 20 | | `template` | 21 | | `video` | 22 | 23 | ## Example 24 | 25 | ``` 26 | text 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/src/models/responseMessage.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * WhatsApp Cloud APILib 3 | * 4 | * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). 5 | */ 6 | 7 | import { object, Schema, string } from '../schema'; 8 | 9 | export interface ResponseMessage { 10 | id: string; 11 | } 12 | 13 | export const responseMessageSchema: Schema = object({ 14 | id: ['id', string()], 15 | }); 16 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/response-contact.md: -------------------------------------------------------------------------------- 1 | 2 | # Response Contact 3 | 4 | ## Structure 5 | 6 | `ResponseContact` 7 | 8 | ## Fields 9 | 10 | | Name | Type | Tags | Description | 11 | | --- | --- | --- | --- | 12 | | `input` | `string` | Required | - | 13 | | `waId` | `string` | Required | - | 14 | 15 | ## Example (as JSON) 16 | 17 | ```json 18 | { 19 | "input": "48XXXXXXXXX", 20 | "wa_id": "48XXXXXXXXX " 21 | } 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/tsdx.config.js: -------------------------------------------------------------------------------- 1 | // Not transpiled with TypeScript or Babel, so use plain Es6/Node.js! 2 | module.exports = { 3 | // This function will run for each entry/format/env combination 4 | rollup(config, options) { 5 | config.onwarn = ( warning, next ) => { 6 | if ( warning.code === 'CIRCULAR_DEPENDENCY' ) return; 7 | next( warning ); 8 | }; 9 | return config; // always return a config. 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /WhatsApp+Cloud+API/doc/models/footer.md: -------------------------------------------------------------------------------- 1 | 2 | # Footer 3 | 4 | ## Structure 5 | 6 | `Footer` 7 | 8 | ## Fields 9 | 10 | | Name | Type | Tags | Description | 11 | | --- | --- | --- | --- | 12 | | `text` | `string` | Required | The footer content. Emojis and markdown are supported. Links are supported.
**Constraints**: *Maximum Length*: `60` | 13 | 14 | ## Example (as JSON) 15 | 16 | ```json 17 | { 18 | "text": "