├── .babelrc ├── .eslintrc.js ├── .gitignore ├── .prettierrc ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── example └── index.html ├── index.js ├── lib ├── index.js └── index.js.LICENSE.txt ├── mint.json ├── package.json ├── src ├── config │ └── index.js ├── index.js ├── libs │ └── libsamplerate.worklet.js ├── models │ ├── Audio │ │ ├── AudioWorklet.js │ │ └── AudioWorkletStream.js │ ├── AudioClass.js │ ├── Call.js │ ├── Device.js │ ├── DeviceEmitter.js │ ├── Microphone.js │ └── Microphone │ │ └── AudioWorkletMic.js ├── utils │ └── functions.js └── websocket │ └── index.js └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env" 4 | ], 5 | "plugins": [ 6 | "@babel/plugin-proposal-class-properties" 7 | ] 8 | } -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | 'airbnb-base/legacy', 4 | 'prettier', 5 | 'plugin:vue/recommended', 6 | 'plugin:storybook/recommended', 7 | 'plugin:cypress/recommended', 8 | ], 9 | parserOptions: { 10 | parser: '@babel/eslint-parser', 11 | ecmaVersion: 2020, 12 | sourceType: 'module', 13 | }, 14 | plugins: ['html', 'prettier', 'babel'], 15 | rules: { 16 | 'prettier/prettier': ['error'], 17 | 'camelcase': 'off', 18 | 'no-param-reassign': 'off', 19 | 'import/no-extraneous-dependencies': 'off', 20 | 'import/prefer-default-export': 'off', 21 | 'import/no-named-as-default': 'off', 22 | 'import/no-unresolved': 'off', 23 | 'import/extensions': ['off'], 24 | 'no-console': 'error', 25 | }, 26 | settings: { 27 | 'import/resolver': { 28 | webpack: { 29 | config: 'config/webpack/resolve.js', 30 | }, 31 | }, 32 | }, 33 | env: { 34 | browser: true, 35 | node: true, 36 | }, 37 | globals: { 38 | bus: true, 39 | vi: true, 40 | }, 41 | }; 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /dev 3 | /example/** -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 80, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "arrowParens": "avoid" 6 | } 7 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "disponiveis", 4 | "whatsappid" 5 | ] 6 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 wavoip-api 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Wavoip - Biblioteca JavaScript para Chamadas de Áudio via WhatsApp 2 | 3 | A Wavoip é uma biblioteca JavaScript inovadora que possibilita a integração fácil e rápida de chamadas de áudio via WhatsApp em seus projetos. Com esta biblioteca, você pode aproveitar as funcionalidades de chamada do WhatsApp para enriquecer a experiência do usuário em seus aplicativos web. 4 | 5 | ## Recursos Principais 6 | 7 | - **Integração Simples:** Integre chamadas de áudio via WhatsApp em seus aplicativos web com apenas algumas linhas de código. 8 | 9 | - **Personalização:** Adapte as chamadas de acordo com as necessidades do seu projeto, personalizando a experiência do usuário. 10 | 11 | - **Compatibilidade:** Funciona perfeitamente em diversos navegadores, garantindo uma experiência consistente para os usuários. 12 | 13 | - **Documentação Clara:** Oferecemos uma documentação abrangente para ajudar você a começar rapidamente e explorar todos os recursos da Wavoip. 14 | 15 | ## Como Começar 16 | 17 | 1. Instale a biblioteca em seu projeto: 18 | ```bash 19 | npm install wavoip-api 20 | 21 | 2. Siga a documentação para integrar a funcionalidade de chamada de áudio em seu aplicativo. 22 | 23 | 3. Aproveite os benefícios de oferecer chamadas de áudio via WhatsApp aos seus usuários! 24 | 25 | 1. Instale a biblioteca em seu projeto: 26 | ```javascript 27 | const Wavoip = require("wavoip-api"); 28 | const WAV = new Wavoip; 29 | const whatsapp_instance = WAV.connect("my_token"); 30 | 31 | whatsapp_instance.socket.on('connect', () => { 32 | console.log('Successfully connected!'); 33 | 34 | whatsapp_instance.callStart({ 35 | whatsappid: "phone_number" 36 | }); 37 | }); 38 | ``` 39 | 40 | Explore mais recursos e exemplos na nossa documentação. 41 | 42 | ## Contribuições 43 | Contribuições são bem-vindas! Sinta-se à vontade para abrir issues, enviar pull requests ou fornecer feedback para tornar a Wavoip ainda melhor. 44 | 45 | ## Licença 46 | Este projeto está licenciado sob a Licença MIT. 47 | 48 | Lembre-se de substituir os marcadores de lugar, como `my_token` e `phone_number`, pelos valores apropriados. Boa sorte com o seu projeto! 49 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./src/index").default; -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Wavoip=e():t.Wavoip=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=21)}([function(t,e,r){"use strict";(function(t){var n=r(12);const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,s=(a=Object.create(null),t=>{const e=o.call(t);return a[e]||(a[e]=e.slice(8,-1).toLowerCase())});var a;const c=t=>(t=t.toLowerCase(),e=>s(e)===t),u=t=>e=>typeof e===t,{isArray:h}=Array,f=u("undefined");const l=c("ArrayBuffer");const p=u("string"),d=u("function"),y=u("number"),m=t=>null!==t&&"object"==typeof t,g=t=>{if("object"!==s(t))return!1;const e=i(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},v=c("Date"),b=c("File"),w=c("Blob"),E=c("FileList"),_=c("URLSearchParams");function O(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),h(t))for(n=0,o=t.length;n