diff --git a/.DS_Store b/.DS_Store index 11ffa2bd..9880dac3 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.eslintrc.js b/.eslintrc.js index d3545e60..f805da92 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,10 +3,14 @@ module.exports = { parserOptions: { sourceType: 'CommonJS', }, - plugins: ['@typescript-eslint/eslint-plugin'], + plugins: [ + '@typescript-eslint', + 'simple-import-sort', + 'import' + ], extends: [ + 'eslint:recommended', 'plugin:@typescript-eslint/recommended', - 'plugin:prettier/recommended', 'plugin:prettier/recommended' ], globals: { @@ -26,7 +30,11 @@ module.exports = { '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'error', + 'import/first': 'error', + 'import/no-duplicates': 'error', + 'simple-import-sort/imports': 'error', + 'simple-import-sort/exports': 'error', '@typescript-eslint/ban-types': [ 'error', { diff --git a/.gitignore b/.gitignore index e707b33e..2364b077 100644 --- a/.gitignore +++ b/.gitignore @@ -16,16 +16,19 @@ lerna-debug.log* /docker-compose-data /docker-data +docker-compose.yaml + # Package /yarn.lock /package-lock.json -# IDE - VSCode +# IDEs .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json +.nova/* # Prisma /prisma/migrations @@ -38,3 +41,6 @@ lerna-debug.log* /store /temp/* + +.DS_Store +*.DS_Store \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js index 067abea5..f55f3f06 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -2,8 +2,11 @@ module.exports = { semi: true, trailingComma: 'all', singleQuote: true, - printWidth: 90, + printWidth: 120, + arrowParens: 'always', tabWidth: 2, - bracketSameLine: true, - bracketSpacing: true + useTabs: false, + bracketSameLine: false, + bracketSpacing: true, + parser: 'typescript' } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d70a8685..427a412b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,168 @@ +# 1.5.1 (homolog) + +### Feature + +* Added listening_from_me option in Set Typebot +* Added variables options in Start Typebot +* Added webhooks for typebot events +* Added ChamaAI integration +* Added webhook to send errors + +### Fixed + +* Fix looping connection messages in chatwoot + +# 1.5.0 (2023-08-18 12:47) + +### Feature + +* New instance manager in /manager route +* Added extra files for chatwoot and appsmith +* Added Get Last Message and Archive for Chat +* Added env var QRCODE_COLOR +* Added websocket to send events +* Added rabbitmq to send events +* Added Typebot integration +* Added proxy endpoint +* Added send and date_time in webhook data + +### Fixed + +* Solved problem when disconnecting from the instance the instance was deleted +* Encoded spaces in chatwoot webhook +* Adjustment in the saving of contacts, saving the information of the number and Jid +* Update Dockerfile +* If you pass empty events in create instance and set webhook it is understood as all +* Fixed issue that did not output base64 averages +* Messages sent by the api now arrive in chatwoot + +### Integrations + +- Chatwoot: v2.18.0 - v3.0.0 +- Typebot: v2.16.0 +- Manager Evolution API + +# 1.4.8 (2023-07-27 10:27) + +### Fixed + +* Fixed error return bug + +# 1.4.7 (2023-07-27 08:47) + +### Fixed + +* Fixed error return bug +* Fixed problem of getting message when deleting message in chatwoot +* Change in error return pattern + +# 1.4.6 (2023-07-26 17:54) + +### Fixed + +* Fixed bug of creating new inbox by chatwoot +* When conversation reopens is pending when conversation pending is true +* Added docker-compose file with dockerhub image + +# 1.4.5 (2023-07-26 09:32) + +### Fixed + +* Fixed problems in localization template in chatwoot +* Fix mids going duplicated in chatwoot + +# 1.4.4 (2023-07-25 15:24) + +### Fixed + +* Fixed chatwoot line wrap issue +* Solved receive location in chatwoot +* When requesting the pairing code, it also brings the qr code +* Option reopen_conversation in chatwoot endpoint +* Option conversation_pending in chatwoot endpoint + +# 1.4.3 (2023-07-25 10:51) + +### Fixed + +* Adjusts in settings with options always_online, read_messages and read_status +* Fixed send webhook for event CALL +* Create instance with settings + +# 1.4.2 (2023-07-24 20:52) + +### Fixed + +* Fixed validation is set settings +* Adjusts in group validations +* Ajusts in sticker message to chatwoot + +# 1.4.1 (2023-07-24 18:28) + +### Fixed + +* Fixed reconnect with pairing code or qrcode +* Fixed problem in createJid + +# 1.4.0 (2023-07-24 17:03) + +### Features + +* Added connection functionality via pairing code +* Added fetch profile endpoint in chat controller +* Created settings controller +* Added reject call and send text message when receiving a call +* Added setting to ignore group messages +* Added connection with pairing code in chatwoot with command /init:{NUMBER} +* Added encoding option in endpoint sendWhatsAppAudio + +### Fixed + +* Added link preview option in send text message +* Fixed problem with fileSha256 appearing when sending a sticker in chatwoot +* Fixed issue where it was not possible to open a conversation when sent at first by me on my cell phone in chatwoot +* Now it only updates the contact name if it is the same as the phone number in chatwoot +* Now accepts all chatwoot inbox templates +* Command to create new instances set to /new_instance:{NAME}:{NUMBER} +* Fix in chatwoot set, sign msg can now be disabled + +### Integrations + +- Chatwoot: v2.18.0 - v3.0.0 (Beta) + +# 1.3.2 (2023-07-21 17:19) + +### Fixed + +* Fix in update settings that needed to restart after updated +* Correction in the use of the api with mongodb +* Adjustments to search endpoint for contacts, chats, messages and Status messages +* Now when deleting the instance, the data referring to it in mongodb is also deleted +* It is now validated if the instance name contains uppercase and special characters +* For compatibility reasons, container mode has been removed +* Added docker-compose files example + +### Integrations + +- Chatwoot: v2.18.0 + # 1.3.1 (2023-07-20 07:48) ### Fixed * Adjust in create store files +### Integrations + +- Chatwoot: v2.18.0 + # 1.3.0 (2023-07-19 11:33) ### Features * Added messages.delete event * Added restart instance endpoint -* Created automation for creating instances in the chatwoot bot with the command '#inbox_whatsapp:' +* Created automation for creating instances in the chatwoot bot with the command '#inbox_whatsapp:{INSTANCE_NAME} * Change Baileys version to: 6.4.0 * Send contact in chatwoot * Send contact array in chatwoot diff --git a/Docker/.env.example b/Docker/.env.example index 81eee8ca..88be79fe 100644 --- a/Docker/.env.example +++ b/Docker/.env.example @@ -1,13 +1,13 @@ # Server URL - Set your application url -SERVER_URL='http://localhost:8080' +SERVER_URL=http://localhost:8080 # Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com' -CORS_ORIGIN='*' -CORS_METHODS='POST,GET,PUT,DELETE' +CORS_ORIGIN=* +CORS_METHODS=POST,GET,PUT,DELETE CORS_CREDENTIALS=true # Determine the logs to be displayed -LOG_LEVEL='ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS' +LOG_LEVEL=ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS LOG_COLOR=true # Log Baileys - "fatal" | "error" | "warn" | "info" | "debug" | "trace" LOG_BAILEYS=error @@ -33,7 +33,7 @@ CLEAN_STORE_CHATS=true # Permanent data storage DATABASE_ENABLED=false DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true -DATABASE_CONNECTION_DB_PREFIX_NAME=evolution +DATABASE_CONNECTION_DB_PREFIX_NAME=evdocker # Choose the data you want to save in the application's database or store DATABASE_SAVE_DATA_INSTANCE=false @@ -44,7 +44,12 @@ DATABASE_SAVE_DATA_CHATS=false REDIS_ENABLED=false REDIS_URI=redis://redis:6379 -REDIS_PREFIX_KEY=evolution +REDIS_PREFIX_KEY=evdocker + +RABBITMQ_ENABLED=false +RABBITMQ_URI=amqp://guest:guest@rabbitmq:5672 + +WEBSOCKET_ENABLED=false # Global Webhook Settings # Each instance's Webhook URL and events will be requested at the time it is created @@ -73,37 +78,37 @@ WEBHOOK_EVENTS_GROUPS_UPSERT=true WEBHOOK_EVENTS_GROUPS_UPDATE=true WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true WEBHOOK_EVENTS_CONNECTION_UPDATE=true +WEBHOOK_EVENTS_CALL=true # This event fires every time a new token is requested via the refresh route WEBHOOK_EVENTS_NEW_JWT_TOKEN=false +# This events is used with Typebot +WEBHOOK_EVENTS_TYPEBOT_START=false +WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false +# This event is used with Chama AI +WEBHOOK_EVENTS_CHAMA_AI_ACTION=false +# This event is used to send errors +WEBHOOK_EVENTS_ERRORS=false +WEBHOOK_EVENTS_ERRORS_WEBHOOK= # Name that will be displayed on smartphone connection -CONFIG_SESSION_PHONE_CLIENT='Evolution API' -# Browser Name = chrome | firefox | edge | opera | safari -CONFIG_SESSION_PHONE_NAME=chrome +CONFIG_SESSION_PHONE_CLIENT=EvolutionAPI +# Browser Name = Chrome | Firefox | Edge | Opera | Safari +CONFIG_SESSION_PHONE_NAME=Chrome # Set qrcode display limit QRCODE_LIMIT=30 +QRCODE_COLOR=#198754 # Defines an authentication type for the api # We recommend using the apikey because it will allow you to use a custom token, # if you use jwt, a random token will be generated and may be expired and you will have to generate a new token # jwt or 'apikey' -AUTHENTICATION_TYPE='apikey' +AUTHENTICATION_TYPE=apikey ## Define a global apikey to access all instances. ### OBS: This key must be inserted in the request header to create an instance. -AUTHENTICATION_API_KEY='B6D711FCDE4D4FD5936544120E713976' +AUTHENTICATION_API_KEY=B6D711FCDE4D4FD5936544120E713976 AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true ## Set the secret key to encrypt and decrypt your token and its expiration time # seconds - 3600s ===1h | zero (0) - never expires AUTHENTICATION_JWT_EXPIRIN_IN=0 -AUTHENTICATION_JWT_SECRET='L0YWtjb2w554WFqPG' -# Set the instance name and webhook url to create an instance in init the application -# With this option activated, you work with a url per webhook event, respecting the local url and the name of each event -# container or server -AUTHENTICATION_INSTANCE_MODE=server -# if you are using container mode, set the container name and the webhook url to default instance -AUTHENTICATION_INSTANCE_NAME=evolution -AUTHENTICATION_INSTANCE_WEBHOOK_URL='' -AUTHENTICATION_INSTANCE_CHATWOOT_ACCOUNT_ID=1 -AUTHENTICATION_INSTANCE_CHATWOOT_TOKEN=123456 -AUTHENTICATION_INSTANCE_CHATWOOT_URL='' +AUTHENTICATION_JWT_SECRET='L=0YWt]b2w[WF>#>:&E`' diff --git a/Docker/docker-compose.yaml b/Docker/docker-compose.yaml new file mode 100644 index 00000000..cbc55c12 --- /dev/null +++ b/Docker/docker-compose.yaml @@ -0,0 +1,22 @@ +version: '3.3' + +services: + + api: + container_name: evolution_api + image: davidsongomes/evolution-api + restart: always + ports: + - 8080:8080 + volumes: + - evolution_instances:/evolution/instances + - evolution_store:/evolution/store + env_file: + - .env + command: ['node', './dist/src/main.js'] + expose: + - 8080 + +volumes: + evolution_instances: + evolution_store: \ No newline at end of file diff --git a/Docker/evolution-api-all-services/.env b/Docker/evolution-api-all-services/.env new file mode 100644 index 00000000..555ba7bc --- /dev/null +++ b/Docker/evolution-api-all-services/.env @@ -0,0 +1,109 @@ +# Server URL - Set your application url +SERVER_URL='http://localhost:8080' + +# Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com' +CORS_ORIGIN='*' +CORS_METHODS='POST,GET,PUT,DELETE' +CORS_CREDENTIALS=true + +# Determine the logs to be displayed +LOG_LEVEL='ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS' +LOG_COLOR=true +# Log Baileys - "fatal" | "error" | "warn" | "info" | "debug" | "trace" +LOG_BAILEYS=error + +# Determine how long the instance should be deleted from memory in case of no connection. +# Default time: 5 minutes +# If you don't even want an expiration, enter the value false +DEL_INSTANCE=false + +# Temporary data storage +STORE_MESSAGES=true +STORE_MESSAGE_UP=true +STORE_CONTACTS=true +STORE_CHATS=true + +# Set Store Interval in Seconds (7200 = 2h) +CLEAN_STORE_CLEANING_INTERVAL=7200 +CLEAN_STORE_MESSAGES=true +CLEAN_STORE_MESSAGE_UP=true +CLEAN_STORE_CONTACTS=true +CLEAN_STORE_CHATS=true + +# Permanent data storage +DATABASE_ENABLED=true +DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true +DATABASE_CONNECTION_DB_PREFIX_NAME=evolution + +# Choose the data you want to save in the application's database or store +DATABASE_SAVE_DATA_INSTANCE=false +DATABASE_SAVE_DATA_NEW_MESSAGE=false +DATABASE_SAVE_MESSAGE_UPDATE=false +DATABASE_SAVE_DATA_CONTACTS=false +DATABASE_SAVE_DATA_CHATS=false + +REDIS_ENABLED=true +REDIS_URI=redis://redis:6379 +REDIS_PREFIX_KEY=evolution + +# Global Webhook Settings +# Each instance's Webhook URL and events will be requested at the time it is created +## Define a global webhook that will listen for enabled events from all instances +WEBHOOK_GLOBAL_URL='' +WEBHOOK_GLOBAL_ENABLED=false +# With this option activated, you work with a url per webhook event, respecting the global url and the name of each event +WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false +## Set the events you want to hear +WEBHOOK_EVENTS_APPLICATION_STARTUP=false +WEBHOOK_EVENTS_QRCODE_UPDATED=true +WEBHOOK_EVENTS_MESSAGES_SET=true +WEBHOOK_EVENTS_MESSAGES_UPSERT=true +WEBHOOK_EVENTS_MESSAGES_UPDATE=true +WEBHOOK_EVENTS_MESSAGES_DELETE=true +WEBHOOK_EVENTS_SEND_MESSAGE=true +WEBHOOK_EVENTS_CONTACTS_SET=true +WEBHOOK_EVENTS_CONTACTS_UPSERT=true +WEBHOOK_EVENTS_CONTACTS_UPDATE=true +WEBHOOK_EVENTS_PRESENCE_UPDATE=true +WEBHOOK_EVENTS_CHATS_SET=true +WEBHOOK_EVENTS_CHATS_UPSERT=true +WEBHOOK_EVENTS_CHATS_UPDATE=true +WEBHOOK_EVENTS_CHATS_DELETE=true +WEBHOOK_EVENTS_GROUPS_UPSERT=true +WEBHOOK_EVENTS_GROUPS_UPDATE=true +WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true +WEBHOOK_EVENTS_CONNECTION_UPDATE=true +# This event fires every time a new token is requested via the refresh route +WEBHOOK_EVENTS_NEW_JWT_TOKEN=false + +# Name that will be displayed on smartphone connection +CONFIG_SESSION_PHONE_CLIENT='Evolution API' +# Browser Name = chrome | firefox | edge | opera | safari +CONFIG_SESSION_PHONE_NAME=chrome + +# Set qrcode display limit +QRCODE_LIMIT=30 + +# Defines an authentication type for the api +# We recommend using the apikey because it will allow you to use a custom token, +# if you use jwt, a random token will be generated and may be expired and you will have to generate a new token +# jwt or 'apikey' +AUTHENTICATION_TYPE='apikey' +## Define a global apikey to access all instances. +### OBS: This key must be inserted in the request header to create an instance. +AUTHENTICATION_API_KEY='B6D711FCDE4D4FD5936544120E713976' +AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true +## Set the secret key to encrypt and decrypt your token and its expiration time +# seconds - 3600s ===1h | zero (0) - never expires +AUTHENTICATION_JWT_EXPIRIN_IN=0 +AUTHENTICATION_JWT_SECRET='L0YWtjb2w554WFqPG' +# Set the instance name and webhook url to create an instance in init the application +# With this option activated, you work with a url per webhook event, respecting the local url and the name of each event +# container or server +AUTHENTICATION_INSTANCE_MODE=server +# if you are using container mode, set the container name and the webhook url to default instance +AUTHENTICATION_INSTANCE_NAME=evolution +AUTHENTICATION_INSTANCE_WEBHOOK_URL='' +AUTHENTICATION_INSTANCE_CHATWOOT_ACCOUNT_ID=1 +AUTHENTICATION_INSTANCE_CHATWOOT_TOKEN=123456 +AUTHENTICATION_INSTANCE_CHATWOOT_URL='' \ No newline at end of file diff --git a/Docker/evolution-api-all-services/docker-compose.yaml b/Docker/evolution-api-all-services/docker-compose.yaml new file mode 100644 index 00000000..1fe01975 --- /dev/null +++ b/Docker/evolution-api-all-services/docker-compose.yaml @@ -0,0 +1,91 @@ +version: '3.3' + +services: + + mongodb: + container_name: mongodb + image: mongo + restart: on-failure + ports: + - 27017:27017 + environment: + - MONGO_INITDB_ROOT_USERNAME=root + - MONGO_INITDB_ROOT_PASSWORD=root + - PUID=1000 + - PGID=1000 + volumes: + - evolution_mongodb_data:/data/db + - evolution_mongodb_configdb:/data/configdb + expose: + - 27017 + + mongo-express: + container_name: mongodb-express + image: mongo-express + restart: on-failure + ports: + - 8081:8081 + depends_on: + - mongodb + environment: + ME_CONFIG_BASICAUTH_USERNAME: root + ME_CONFIG_BASICAUTH_PASSWORD: root + ME_CONFIG_MONGODB_SERVER: mongodb + ME_CONFIG_MONGODB_ADMINUSERNAME: root + ME_CONFIG_MONGODB_ADMINPASSWORD: root + links: + - mongodb + + redis: + container_name: redis + image: redis:latest + restart: on-failure + ports: + - 6379:6379 + command: > + redis-server + --port 6379 + --appendonly yes + volumes: + - evolution_redis:/data + + rebrow: + container_name: rebrow + image: marian/rebrow + restart: on-failure + depends_on: + - redis + ports: + - 5001:5001 + links: + - redis + + api: + container_name: evolution_api + image: davidsongomes/evolution-api + restart: always + depends_on: + - mongodb + - redis + ports: + - 8080:8080 + volumes: + - evolution_instances:/evolution/instances + - evolution_store:/evolution/store + env_file: + - .env + command: ['node', './dist/src/main.js'] + expose: + - 8080 + +volumes: + evolution_mongodb_data: + evolution_mongodb_configdb: + evolution_redis: + evolution_instances: + evolution_store: + +networks: + evolution-net: + external: true + \ No newline at end of file diff --git a/Docker/mongodb/docker-compose.yaml b/Docker/mongodb/docker-compose.yaml index 698ca50c..01220c54 100644 --- a/Docker/mongodb/docker-compose.yaml +++ b/Docker/mongodb/docker-compose.yaml @@ -35,7 +35,8 @@ volumes: evolution_mongodb_data: evolution_mongodb_configdb: + networks: evolution-net: - external: true - \ No newline at end of file + name: evolution-net + driver: bridge diff --git a/Docker/redis/docker-compose.yaml b/Docker/redis/docker-compose.yaml index 6409b851..297b11db 100644 --- a/Docker/redis/docker-compose.yaml +++ b/Docker/redis/docker-compose.yaml @@ -5,24 +5,17 @@ services: image: redis:latest container_name: redis command: > - redis-server - --port 6379 - --appendonly yes + redis-server --port 6379 --appendonly yes volumes: - evolution_redis:/data ports: - 6379:6379 - - rebrow: - image: marian/rebrow - ports: - - 5001:5001 - links: - - redis - + volumes: evolution_redis: + networks: evolution-net: - external: true + name: evolution-net + driver: bridge diff --git a/Dockerfile b/Dockerfile index 088f6fa1..df4b3176 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,20 @@ FROM node:16.18-alpine -LABEL version="1.1.3" description="Api to control whatsapp features through http requests." +LABEL version="1.5.1" description="Api to control whatsapp features through http requests." LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes" LABEL contact="contato@agenciadgcode.com" RUN apk update && apk upgrade && \ - apk add --no-cache git + apk add --no-cache git tzdata ffmpeg wget curl WORKDIR /evolution COPY ./package.json . +ENV TZ=America/Sao_Paulo ENV DOCKER_ENV=true -ENV SERVER_URL='http://localhost:8080' +ENV SERVER_URL=http://localhost:8080 ENV CORS_ORIGIN=* ENV CORS_METHODS=POST,GET,PUT,DELETE @@ -50,7 +51,12 @@ ENV REDIS_ENABLED=false ENV REDIS_URI=redis://redis:6379 ENV REDIS_PREFIX_KEY=evolution -ENV WEBHOOK_GLOBAL_URL= +ENV RABBITMQ_ENABLED=false +ENV RABBITMQ_URI=amqp://guest:guest@rabbitmq:5672 + +ENV WEBSOCKET_ENABLED=false + +ENV WEBHOOK_GLOBAL_URL= ENV WEBHOOK_GLOBAL_ENABLED=false ENV WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false @@ -74,13 +80,23 @@ ENV WEBHOOK_EVENTS_GROUPS_UPSERT=true ENV WEBHOOK_EVENTS_GROUPS_UPDATE=true ENV WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true ENV WEBHOOK_EVENTS_CONNECTION_UPDATE=true +ENV WEBHOOK_EVENTS_CALL=true ENV WEBHOOK_EVENTS_NEW_JWT_TOKEN=false -ENV CONFIG_SESSION_PHONE_CLIENT='Evolution API' -ENV CONFIG_SESSION_PHONE_NAME=chrome +ENV WEBHOOK_EVENTS_TYPEBOT_START=false +ENV WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false + +ENV WEBHOOK_EVENTS_CHAMA_AI_ACTION=false + +ENV WEBHOOK_EVENTS_ERRORS=false +ENV WEBHOOK_EVENTS_ERRORS_WEBHOOK= + +ENV CONFIG_SESSION_PHONE_CLIENT=EvolutionAPI +ENV CONFIG_SESSION_PHONE_NAME=Chrome ENV QRCODE_LIMIT=30 +ENV QRCODE_COLOR=#198754 ENV AUTHENTICATION_TYPE=apikey diff --git a/Extras/appsmith/manager.json b/Extras/appsmith/manager.json new file mode 100644 index 00000000..391f1a03 --- /dev/null +++ b/Extras/appsmith/manager.json @@ -0,0 +1 @@ +{"clientSchemaVersion":1.0,"serverSchemaVersion":6.0,"exportedApplication":{"name":"manager2","isPublic":true,"pages":[{"id":"Home","isDefault":true}],"publishedPages":[{"id":"Home","isDefault":true}],"viewMode":false,"appIsExample":false,"unreadCommentThreads":0.0,"clonedFromApplicationId":"64da025f98d1c41c0da60e90","color":"#F5D1D1","icon":"email","slug":"manager2","unpublishedAppLayout":{"type":"FLUID"},"publishedAppLayout":{"type":"FLUID"},"unpublishedCustomJSLibs":[],"publishedCustomJSLibs":[],"evaluationVersion":2.0,"applicationVersion":2.0,"collapseInvisibleWidgets":true,"isManualUpdate":false,"deleted":false},"datasourceList":[],"customJSLibList":[],"pageList":[{"unpublishedPage":{"name":"Home","slug":"home","customSlug":"","layouts":[{"viewMode":false,"dsl":{"widgetName":"MainContainer","backgroundColor":"none","rightColumn":4896.0,"snapColumns":64.0,"detachFromLayout":true,"widgetId":"0","topRow":0.0,"bottomRow":480.0,"containerStyle":"none","snapRows":124.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"version":83.0,"minHeight":1292.0,"dynamicTriggerPathList":[],"parentColumnSpace":1.0,"dynamicBindingPathList":[],"leftColumn":0.0,"children":[{"boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","borderColor":"#E0DEDE","isVisibleDownload":true,"iconSVG":"https://appcdn.appsmith.com/static/media/icon.24905525921dd6f5ff46d0dd843b9e12.svg","topRow":6.0,"isSortable":true,"type":"TABLE_WIDGET_V2","inlineEditingSaveOption":"ROW_LEVEL","animateLoading":true,"dynamicBindingPathList":[{"key":"tableData"},{"key":"primaryColumns.customColumn9.boxShadow"},{"key":"primaryColumns.customColumn9.borderRadius"},{"key":"primaryColumns.customColumn9.menuColor"},{"key":"primaryColumns.customColumn8.computedValue"},{"key":"primaryColumns.customColumn7.computedValue"},{"key":"primaryColumns.customColumn6.computedValue"},{"key":"primaryColumns.customColumn5.computedValue"},{"key":"primaryColumns.customColumn2.computedValue"},{"key":"primaryColumns.customColumn1.textColor"},{"key":"primaryColumns.customColumn1.cellBackground"},{"key":"primaryColumns.customColumn1.computedValue"},{"key":"primaryColumns.instance.computedValue"},{"key":"isVisible"},{"key":"accentColor"},{"key":"borderRadius"},{"key":"boxShadow"}],"needsHeightForContent":true,"leftColumn":14.0,"delimiter":",","defaultSelectedRowIndex":0.0,"showInlineEditingOptionDropdown":true,"accentColor":"{{appsmith.theme.colors.primaryColor}}","isVisibleFilters":true,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","enableClientSideSearch":true,"version":2.0,"totalRecordsCount":0.0,"isLoading":false,"childStylesheet":{"button":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"menuButton":{"menuColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"iconButton":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"editActions":{"saveButtonColor":"{{appsmith.theme.colors.primaryColor}}","saveBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","discardButtonColor":"{{appsmith.theme.colors.primaryColor}}","discardBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"}},"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","columnUpdatedAt":1.690746223636E12,"defaultSelectedRowIndices":[0.0],"mobileBottomRow":32.0,"widgetName":"TableInstances","defaultPageSize":0.0,"columnOrder":["instance","customColumn5","customColumn1","customColumn2","customColumn6","customColumn7","customColumn8","customColumn9"],"dynamicPropertyPathList":[{"key":"primaryColumns.customColumn1.cellBackground"},{"key":"isVisible"}],"displayName":"Table","bottomRow":42.0,"columnWidthMap":{"customColumn3":92.0,"customColumn2":340.0,"customColumn5":254.0,"customColumn9":60.0},"parentRowSpace":10.0,"hideCard":false,"mobileRightColumn":36.0,"parentColumnSpace":20.078125,"dynamicTriggerPathList":[{"key":"primaryColumns.customColumn9.menuItems.menuItemjfzsd8g6yr.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItem4sqork5nmt.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItemig6ua4ixjx.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItemx9oyhys8cj.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItemxk5jvvwwef.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItem16ysonwzrq.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItembtatfbml4y.onClick"}],"borderWidth":"1","primaryColumns":{"instance":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":0.0,"width":150.0,"originalId":"instance","id":"instance","alias":"instance","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":true,"isDerived":false,"label":"Instance","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.instanceName))}}","sticky":"","validation":{}},"customColumn1":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":1.0,"width":150.0,"originalId":"customColumn1","id":"customColumn1","alias":"Status","horizontalAlignment":"CENTER","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":true,"isDerived":true,"label":"Status","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.status))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF","cellBackground":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.status === \"open\" ? \"#499B51\" : currentRow.instance.status === \"close\" ? \"#DD524C\" : \"#2770FC\"))}}","textColor":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( (appsmith.theme.colors.backgroundColor)))}}"},"customColumn2":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":2.0,"width":150.0,"originalId":"customColumn2","id":"customColumn2","alias":"Apikey","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":true,"isDerived":true,"label":"Apikey","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.apikey))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF"},"customColumn5":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":5.0,"width":150.0,"originalId":"customColumn5","id":"customColumn5","alias":"Owner","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":true,"isDerived":true,"label":"Owner","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.owner))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF"},"customColumn6":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":6.0,"width":150.0,"originalId":"customColumn6","id":"customColumn6","alias":"profilePictureUrl","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":false,"isDerived":true,"label":"profilePictureUrl","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.profilePictureUrl))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF"},"customColumn7":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":7.0,"width":150.0,"originalId":"customColumn7","id":"customColumn7","alias":"profileName","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":false,"isDerived":true,"label":"profileName","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.profileName))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF"},"customColumn8":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":8.0,"width":150.0,"originalId":"customColumn8","id":"customColumn8","alias":"profileStatus","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":false,"isDerived":true,"label":"profileStatus","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.profileStatus))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF"},"customColumn9":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":9.0,"width":150.0,"originalId":"customColumn9","id":"customColumn9","alias":"#","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"menuButton","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":true,"isDerived":true,"label":"#","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF","menuColor":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( (appsmith.theme.colors.primaryColor)))}}","borderRadius":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( (appsmith.theme.borderRadius.appBorderRadius)))}}","boxShadow":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( \"none\"))}}","customAlias":"","menuItemsSource":"STATIC","menuButtonLabel":" ","menuButtoniconName":"chevron-down","menuItems":{"menuItemjfzsd8g6yr":{"id":"menuItemjfzsd8g6yr","index":0.0,"label":"Webhook","widgetId":"vygcejtdun","isDisabled":false,"isVisible":true,"onClick":"{{Find_Webhook.run({\n //\"key\": \"value\",\n});\nshowModal('ModalWebhook');}}"},"menuItem4sqork5nmt":{"id":"menuItem4sqork5nmt","index":1.0,"label":"Settings","widgetId":"0hw8oqpwcj","isDisabled":false,"isVisible":true,"onClick":"{{Find_Settings.run();\nshowModal('ModalSettings');}}"},"menuItemx9oyhys8cj":{"id":"menuItemx9oyhys8cj","index":2.0,"label":"Websocket","widgetId":"j75a4k6ecq","isDisabled":false,"isVisible":true,"onClick":"{{Find_Websocket.run();\nshowModal('ModalWebsocket');}}"},"menuItemxk5jvvwwef":{"id":"menuItemxk5jvvwwef","index":3.0,"label":"Rabbitmq","widgetId":"3u94ov6qst","isDisabled":false,"isVisible":true,"onClick":"{{Find_Rabbitmq.run();\nshowModal('ModalRabbitmq');}}"},"menuItemig6ua4ixjx":{"id":"menuItemig6ua4ixjx","index":4.0,"label":"Chatwoot","widgetId":"fuq5dtgbqc","isDisabled":false,"isVisible":true,"onClick":"{{Find_Chatwoot.run()\nshowModal('ModalChatwoot');}}"},"menuItem16ysonwzrq":{"id":"menuItem16ysonwzrq","index":5.0,"label":"Set Typebot","widgetId":"fi9nb2bace","isDisabled":false,"isVisible":true,"onClick":"{{Find_Typebot.run()\nshowModal('ModalTypebot');}}"},"menuItembtatfbml4y":{"id":"menuItembtatfbml4y","index":6.0,"label":"TypeBot Set Session Status","widgetId":"7f6mg653ra","isDisabled":false,"isVisible":true,"onClick":"{{showModal('ModalTypebotChangeSessionStatu');}}"}}}},"key":"e3yxhhyeel","canFreezeColumn":true,"isDeprecated":false,"rightColumn":63.0,"textSize":"0.875rem","widgetId":"uupm7enu8u","minWidth":450.0,"tableData":"{{fetch_Instances.data}}","label":"Data","searchKey":"","parentId":"0","renderMode":"CANVAS","mobileTopRow":4.0,"horizontalAlignment":"LEFT","isVisibleSearch":true,"responsiveBehavior":"fill","mobileLeftColumn":2.0,"isVisiblePagination":true,"verticalAlignment":"CENTER"},{"resetFormOnClick":false,"boxShadow":"none","mobileBottomRow":5.0,"widgetName":"BtnNewInstance","onClick":"{{showModal('ModalInstance');}}","buttonColor":"rgb(3, 179, 101)","dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":1.0,"bottomRow":5.0,"parentRowSpace":10.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":8.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":7.0,"dynamicBindingPathList":[{"key":"isVisible"},{"key":"borderRadius"}],"text":"New Instance","isDisabled":false,"key":"crzwqv3pdr","isDeprecated":false,"rightColumn":19.0,"isDefaultClickDisabled":true,"iconName":"add","widgetId":"84ei9q1ugm","minWidth":120.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","recaptchaType":"V3","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"hug","disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":0.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"boxShadow":"none","mobileBottomRow":74.0,"widgetName":"ModalQrcode","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":50.0,"bottomRow":500.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":45.0,"animateLoading":true,"parentColumnSpace":11.828125,"leftColumn":21.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas1","displayName":"Canvas","topRow":0.0,"bottomRow":450.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":240.0,"mobileRightColumn":283.875,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","mobileBottomRow":52.0,"widgetName":"ImageQrcode","displayName":"Image","iconSVG":"https://appcdn.appsmith.com/static/media/icon.30c8cbd442cce232b01ba2d434c53a53.svg","topRow":6.0,"bottomRow":43.0,"parentRowSpace":10.0,"type":"IMAGE_WIDGET","hideCard":false,"mobileRightColumn":55.0,"animateLoading":true,"parentColumnSpace":20.078125,"dynamicTriggerPathList":[],"imageShape":"RECTANGLE","leftColumn":2.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"image"}],"defaultImage":"https://manualnegocioonline.com.br/downloads/evolution-api-favicon2.png","key":"4chlj9l432","image":"{{Connect.data.base64}}","isDeprecated":false,"rightColumn":61.0,"objectFit":"contain","widgetId":"27dpgapd7q","isVisible":true,"version":1.0,"parentId":"we6j3r2byy","renderMode":"CANVAS","isLoading":false,"mobileTopRow":40.0,"maxZoomLevel":1.0,"enableDownload":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":43.0,"enableRotation":false},{"boxShadow":"none","mobileBottomRow":4.0,"widgetName":"IconButton1","onClick":"{{closeModal('ModalQrcode');\nfetch_Instances.run()}}","buttonColor":"{{appsmith.theme.colors.primaryColor}}","displayName":"Icon button","iconSVG":"/static/media/icon.80fc7466c0d7181ec0271de7fda795ec.svg","searchTags":["click","submit"],"topRow":0.0,"bottomRow":4.0,"type":"ICON_BUTTON_WIDGET","hideCard":false,"mobileRightColumn":64.0,"animateLoading":true,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":58.0,"dynamicBindingPathList":[{"key":"buttonColor"},{"key":"borderRadius"}],"iconSize":24.0,"isDisabled":false,"key":"pezy0hb491","isDeprecated":false,"rightColumn":64.0,"iconName":"cross","widgetId":"i1dw369dch","minWidth":50.0,"isVisible":true,"version":1.0,"parentId":"we6j3r2byy","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"hug","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":58.0,"buttonVariant":"TERTIARY"},{"mobileBottomRow":5.0,"widgetName":"Text1","displayName":"Text","iconSVG":"/static/media/icon.c3b6033f570046f8c6288d911333a827.svg","searchTags":["typography","paragraph","label"],"topRow":1.0,"bottomRow":5.0,"type":"TEXT_WIDGET","hideCard":false,"mobileRightColumn":41.0,"animateLoading":true,"overflow":"NONE","fontFamily":"{{appsmith.theme.fontFamily.appFont}}","dynamicTriggerPathList":[],"leftColumn":1.0,"dynamicBindingPathList":[{"key":"fontFamily"}],"shouldTruncate":false,"truncateButtonColor":"{{appsmith.theme.colors.primaryColor}}","text":"Qrcode","key":"9s8f10sepn","isDeprecated":false,"rightColumn":41.0,"textAlign":"LEFT","dynamicHeight":"AUTO_HEIGHT","widgetId":"mg2cqsi9fn","minWidth":450.0,"isVisible":true,"fontStyle":"BOLD","textColor":"#231F20","version":1.0,"parentId":"we6j3r2byy","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"fill","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":1.0,"maxDynamicHeight":9000.0,"fontSize":"1.25rem","minDynamicHeight":4.0}],"isDisabled":false,"key":"e8r23nd8j4","isDeprecated":false,"rightColumn":283.875,"detachFromLayout":true,"widgetId":"we6j3r2byy","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"ljwryrjhy7","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"g8xx6ocuvi","height":450.0,"isDeprecated":false,"rightColumn":45.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"ljwryrjhy7","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":50.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":21.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0},{"resetFormOnClick":false,"boxShadow":"none","mobileBottomRow":5.0,"widgetName":"BtnConfig","onClick":"{{showModal('ModalConfig');}}","buttonColor":"#2563eb","dynamicPropertyPathList":[],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":1.0,"bottomRow":5.0,"parentRowSpace":10.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":30.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":1.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"text":"Access","isDisabled":false,"key":"crzwqv3pdr","isDeprecated":false,"rightColumn":7.0,"isDefaultClickDisabled":true,"iconName":"user","widgetId":"uegjpy37i6","minWidth":120.0,"isVisible":true,"recaptchaType":"V3","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"hug","disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":14.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"boxShadow":"none","mobileBottomRow":73.0,"widgetName":"ModalConfig","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":49.0,"bottomRow":30.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":25.0,"minHeight":300.0,"animateLoading":true,"parentColumnSpace":11.75,"leftColumn":1.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas2","displayName":"Canvas","topRow":0.0,"bottomRow":300.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":300.0,"mobileRightColumn":282.0,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","mobileBottomRow":84.0,"borderColor":"#E0DEDE","widgetName":"FormConfig","isCanvas":true,"displayName":"Form","iconSVG":"/static/media/icon.5d6d2ac5cb1aa68bcd9b14f11c56b44a.svg","searchTags":["group"],"topRow":0.0,"bottomRow":28.0,"parentRowSpace":10.0,"type":"FORM_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":25.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[],"leftColumn":1.0,"dynamicBindingPathList":[],"children":[{"mobileBottomRow":400.0,"widgetName":"Canvas2Copy","displayName":"Canvas","topRow":0.0,"bottomRow":280.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":false,"hideCard":true,"minHeight":400.0,"mobileRightColumn":283.875,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"mobileBottomRow":5.0,"widgetName":"Text2","displayName":"Text","iconSVG":"/static/media/icon.c3b6033f570046f8c6288d911333a827.svg","searchTags":["typography","paragraph","label"],"topRow":1.0,"bottomRow":5.0,"type":"TEXT_WIDGET","hideCard":false,"mobileRightColumn":25.5,"animateLoading":true,"overflow":"NONE","fontFamily":"{{appsmith.theme.fontFamily.appFont}}","dynamicTriggerPathList":[],"leftColumn":1.5,"dynamicBindingPathList":[{"key":"fontFamily"}],"shouldTruncate":false,"truncateButtonColor":"{{appsmith.theme.colors.primaryColor}}","text":"Access Credentials","key":"9s8f10sepn","isDeprecated":false,"rightColumn":25.5,"textAlign":"LEFT","dynamicHeight":"AUTO_HEIGHT","widgetId":"tps5rw2lk9","minWidth":450.0,"isVisible":true,"fontStyle":"BOLD","textColor":"#231F20","version":1.0,"parentId":"lrtvcpswru","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"fill","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":1.5,"maxDynamicHeight":9000.0,"fontSize":"1.25rem","minDynamicHeight":4.0},{"resetFormOnClick":true,"boxShadow":"none","mobileBottomRow":37.0,"widgetName":"Button1","onClick":"{{storeValue('api_url', FormConfig.data.InputApiUrl);\nstoreValue('api_key', FormConfig.data.InputGlobalApiKey);\nfetch_Instances.run().then(() => {\n showAlert('successful login', 'success');\n}).catch(() => {\n showAlert('Could not load instances', 'error');\n});\ncloseModal('ModalConfig').then(() => {});}}","buttonColor":"{{appsmith.theme.colors.primaryColor}}","dynamicPropertyPathList":[{"key":"isDisabled"}],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":22.0,"bottomRow":26.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":62.0,"animateLoading":true,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":51.0,"dynamicBindingPathList":[{"key":"buttonColor"},{"key":"borderRadius"}],"text":"Login","isDisabled":"","key":"crzwqv3pdr","isDeprecated":false,"rightColumn":63.0,"isDefaultClickDisabled":true,"iconName":"log-in","widgetId":"gzxvnsxk0y","minWidth":120.0,"isVisible":true,"recaptchaType":"V3","version":1.0,"parentId":"lrtvcpswru","renderMode":"CANVAS","isLoading":false,"mobileTopRow":33.0,"responsiveBehavior":"hug","disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":46.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"resetFormOnClick":true,"boxShadow":"none","mobileBottomRow":37.0,"widgetName":"Button1Copy","onClick":"{{removeValue('api_url');\nremoveValue('api_key').then(() => {\n showAlert('successful logout', 'success');\n});}}","buttonColor":"#dc2626","dynamicPropertyPathList":[{"key":"isDisabled"}],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":21.0,"bottomRow":25.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":62.0,"animateLoading":true,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":2.0,"dynamicBindingPathList":[{"key":"isDisabled"},{"key":"borderRadius"}],"text":"Logout","isDisabled":"{{!appsmith.store.api_key && !appsmith.store.api_url ? true : false}}","key":"crzwqv3pdr","isDeprecated":false,"rightColumn":14.0,"isDefaultClickDisabled":true,"iconName":"log-out","widgetId":"f2i8tsbgx1","minWidth":120.0,"isVisible":true,"recaptchaType":"V3","version":1.0,"parentId":"lrtvcpswru","renderMode":"CANVAS","isLoading":false,"mobileTopRow":33.0,"responsiveBehavior":"hug","disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":46.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"boxShadow":"none","iconSVG":"/static/media/icon.d0ce957b6c4640f8a7418ce846ee200e.svg","topRow":6.0,"labelWidth":5.0,"type":"INPUT_WIDGET_V2","animateLoading":true,"resetOnSubmit":true,"leftColumn":2.0,"dynamicBindingPathList":[{"key":"defaultText"},{"key":"accentColor"},{"key":"borderRadius"}],"labelStyle":"","inputType":"TEXT","placeholderText":"","isDisabled":false,"isRequired":true,"dynamicHeight":"FIXED","accentColor":"{{appsmith.theme.colors.primaryColor}}","showStepArrows":false,"isVisible":true,"version":2.0,"isLoading":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileBottomRow":13.0,"widgetName":"InputApiUrl","displayName":"Input","searchTags":["form","text input","number","textarea"],"bottomRow":13.0,"parentRowSpace":10.0,"autoFocus":false,"hideCard":false,"mobileRightColumn":22.0,"parentColumnSpace":5.047119140625,"dynamicTriggerPathList":[],"labelPosition":"Top","key":"r1hfat3ouf","labelTextSize":"0.875rem","isDeprecated":false,"rightColumn":63.0,"widgetId":"spgryrb5ao","minWidth":450.0,"label":"API URL","parentId":"lrtvcpswru","labelAlignment":"left","renderMode":"CANVAS","mobileTopRow":6.0,"responsiveBehavior":"fill","mobileLeftColumn":2.0,"maxDynamicHeight":9000.0,"isSpellCheck":false,"iconAlign":"left","defaultText":"{{appsmith.store.api_url || ''}}","minDynamicHeight":4.0},{"boxShadow":"none","iconSVG":"/static/media/icon.d0ce957b6c4640f8a7418ce846ee200e.svg","topRow":14.0,"labelWidth":5.0,"type":"INPUT_WIDGET_V2","animateLoading":true,"resetOnSubmit":true,"leftColumn":2.0,"dynamicBindingPathList":[{"key":"defaultText"},{"key":"accentColor"},{"key":"borderRadius"}],"labelStyle":"","inputType":"PASSWORD","isDisabled":false,"isRequired":true,"dynamicHeight":"FIXED","accentColor":"{{appsmith.theme.colors.primaryColor}}","showStepArrows":false,"isVisible":true,"version":2.0,"isLoading":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileBottomRow":13.0,"widgetName":"InputGlobalApiKey","displayName":"Input","searchTags":["form","text input","number","textarea"],"bottomRow":21.0,"parentRowSpace":10.0,"autoFocus":false,"hideCard":false,"mobileRightColumn":22.0,"parentColumnSpace":5.047119140625,"dynamicTriggerPathList":[],"labelPosition":"Top","key":"r1hfat3ouf","labelTextSize":"0.875rem","isDeprecated":false,"rightColumn":63.0,"widgetId":"v2vedr13py","minWidth":450.0,"label":"GLOBAL API KEY","parentId":"lrtvcpswru","labelAlignment":"left","renderMode":"CANVAS","mobileTopRow":6.0,"responsiveBehavior":"fill","mobileLeftColumn":2.0,"maxDynamicHeight":9000.0,"shouldAllowAutofill":true,"iconAlign":"left","defaultText":"{{appsmith.store.api_key || ''}}","minDynamicHeight":4.0},{"boxShadow":"none","mobileBottomRow":4.0,"widgetName":"IconButton2","onClick":"{{closeModal('ModalConfig');}}","buttonColor":"{{appsmith.theme.colors.primaryColor}}","displayName":"Icon button","iconSVG":"/static/media/icon.80fc7466c0d7181ec0271de7fda795ec.svg","searchTags":["click","submit"],"topRow":0.0,"bottomRow":4.0,"parentRowSpace":10.0,"type":"ICON_BUTTON_WIDGET","hideCard":false,"mobileRightColumn":64.0,"animateLoading":true,"parentColumnSpace":9.072265625,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":60.0,"dynamicBindingPathList":[{"key":"buttonColor"},{"key":"borderRadius"}],"isDisabled":false,"key":"pezy0hb491","isDeprecated":false,"rightColumn":64.0,"iconName":"cross","widgetId":"oaouelmhi1","minWidth":50.0,"isVisible":true,"version":1.0,"parentId":"lrtvcpswru","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"hug","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":60.0,"buttonVariant":"TERTIARY"}],"key":"e8r23nd8j4","isDeprecated":false,"rightColumn":283.875,"detachFromLayout":true,"widgetId":"lrtvcpswru","containerStyle":"none","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"h97rbttd5c","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"borderWidth":"0","positioning":"fixed","key":"dtzd07zsya","backgroundColor":"#FFFFFF","isDeprecated":false,"rightColumn":63.0,"dynamicHeight":"AUTO_HEIGHT","widgetId":"h97rbttd5c","minWidth":450.0,"isVisible":true,"parentId":"es5gsctogb","renderMode":"CANVAS","isLoading":false,"mobileTopRow":44.0,"responsiveBehavior":"fill","originalTopRow":0.0,"borderRadius":"0.375rem","mobileLeftColumn":1.0,"maxDynamicHeight":9000.0,"originalBottomRow":28.0,"minDynamicHeight":10.0}],"isDisabled":false,"key":"e8r23nd8j4","isDeprecated":false,"rightColumn":282.0,"detachFromLayout":true,"widgetId":"es5gsctogb","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"gneh33z88k","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"g8xx6ocuvi","height":300.0,"isDeprecated":false,"rightColumn":25.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"gneh33z88k","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":49.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":1.0,"maxDynamicHeight":9000.0,"width":632.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":66.0,"widgetName":"ModalInstance","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":42.0,"bottomRow":1892.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":37.0,"minHeight":1850.0,"animateLoading":true,"parentColumnSpace":11.828125,"leftColumn":13.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas3","displayName":"Canvas","topRow":0.0,"bottomRow":1850.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":1140.0,"mobileRightColumn":283.875,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","mobileBottomRow":4.0,"widgetName":"IconButton3Copy","onClick":"{{closeModal('ModalInstance');}}","buttonColor":"{{appsmith.theme.colors.primaryColor}}","displayName":"Icon button","iconSVG":"/static/media/icon.80fc7466c0d7181ec0271de7fda795ec.svg","searchTags":["click","submit"],"topRow":0.0,"bottomRow":4.0,"type":"ICON_BUTTON_WIDGET","hideCard":false,"mobileRightColumn":64.0,"animateLoading":true,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":57.0,"dynamicBindingPathList":[{"key":"buttonColor"},{"key":"borderRadius"}],"iconSize":24.0,"isDisabled":false,"key":"mr6bto7c8j","isDeprecated":false,"rightColumn":63.0,"iconName":"cross","widgetId":"xofakp4har","minWidth":50.0,"isVisible":true,"version":1.0,"parentId":"esgwuzqcwt","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"hug","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":58.0,"buttonVariant":"TERTIARY"},{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Create_Instance.run().then(() => {\n showAlert('Instance created successfully', 'success');\n}).catch(() => {\n showAlert('Error creating instance', 'error');\n});\nfetch_Instances.run();\ncloseModal('ModalInstance');}}","topRow":4.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"resetButtonStyles.buttonColor"},{"key":"schema.__root_schema__.defaultValue"},{"key":"schema.__root_schema__.borderRadius"},{"key":"schema.__root_schema__.children.webhook.defaultValue"},{"key":"schema.__root_schema__.children.webhook.borderRadius"},{"key":"schema.__root_schema__.cellBorderRadius"},{"key":"schema.__root_schema__.children.instance.defaultValue"},{"key":"schema.__root_schema__.children.instance.borderRadius"},{"key":"schema.__root_schema__.children.instance.cellBorderRadius"},{"key":"schema.__root_schema__.children.instance.children.instanceName.defaultValue"},{"key":"schema.__root_schema__.children.instance.children.instanceName.accentColor"},{"key":"schema.__root_schema__.children.instance.children.instanceName.borderRadius"},{"key":"schema.__root_schema__.children.instance.children.token.defaultValue"},{"key":"schema.__root_schema__.children.instance.children.token.accentColor"},{"key":"schema.__root_schema__.children.instance.children.token.borderRadius"},{"key":"schema.__root_schema__.children.webhook.cellBorderRadius"},{"key":"schema.__root_schema__.children.webhook.children.webhook.defaultValue"},{"key":"schema.__root_schema__.children.webhook.children.webhook.accentColor"},{"key":"schema.__root_schema__.children.webhook.children.webhook.borderRadius"},{"key":"schema.__root_schema__.children.webhook.children.events.defaultValue"},{"key":"schema.__root_schema__.children.webhook.children.events.accentColor"},{"key":"schema.__root_schema__.children.webhook.children.events.borderRadius"},{"key":"schema.__root_schema__.children.webhook.children.webhook_by_events.defaultValue"},{"key":"schema.__root_schema__.children.webhook.children.webhook_by_events.accentColor"},{"key":"schema.__root_schema__.children.settings.defaultValue"},{"key":"schema.__root_schema__.children.settings.borderRadius"},{"key":"schema.__root_schema__.children.settings.cellBorderRadius"},{"key":"schema.__root_schema__.children.settings.children.reject_call.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.reject_call.accentColor"},{"key":"schema.__root_schema__.children.settings.children.msg_call.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.msg_call.accentColor"},{"key":"schema.__root_schema__.children.settings.children.msg_call.borderRadius"},{"key":"schema.__root_schema__.children.settings.children.groups_ignore.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.groups_ignore.accentColor"},{"key":"schema.__root_schema__.children.settings.children.always_online.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.always_online.accentColor"},{"key":"schema.__root_schema__.children.settings.children.read_messages.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.read_messages.accentColor"},{"key":"schema.__root_schema__.children.settings.children.read_status.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.read_status.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.borderRadius"},{"key":"schema.__root_schema__.children.chatwoot.cellBorderRadius"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_account_id.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_account_id.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_account_id.borderRadius"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_token.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_token.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_token.borderRadius"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_url.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_url.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_url.borderRadius"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_sign_msg.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_reopen_conversation.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_conversation_pending.accentColor"},{"key":"schema.__root_schema__.children.instance.children.qrcode.defaultValue"},{"key":"schema.__root_schema__.children.instance.children.qrcode.accentColor"},{"key":"schema.__root_schema__.children.websocket.defaultValue"},{"key":"schema.__root_schema__.children.websocket.borderRadius"},{"key":"schema.__root_schema__.children.websocket.cellBorderRadius"},{"key":"schema.__root_schema__.children.websocket.children.websocket_enabled.defaultValue"},{"key":"schema.__root_schema__.children.websocket.children.websocket_enabled.accentColor"},{"key":"schema.__root_schema__.children.websocket.children.websocket_events.defaultValue"},{"key":"schema.__root_schema__.children.websocket.children.websocket_events.accentColor"},{"key":"schema.__root_schema__.children.websocket.children.websocket_events.borderRadius"},{"key":"schema.__root_schema__.children.rabbitmq.defaultValue"},{"key":"schema.__root_schema__.children.rabbitmq.borderRadius"},{"key":"schema.__root_schema__.children.rabbitmq.cellBorderRadius"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_enabled.defaultValue"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_enabled.accentColor"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_events.defaultValue"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_events.accentColor"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_events.borderRadius"}],"showReset":true,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY","iconAlign":"left"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Create","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":183.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"webhook":{"children":{"webhook":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook.webhook))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"webhook","identifier":"webhook","position":0.0,"originalIdentifier":"webhook","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Webhook"},"events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook.events))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Multiselect","sourceData":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL","NEW_JWT_TOKEN"],"isCustomField":false,"accessor":"events","identifier":"events","position":2.0,"originalIdentifier":"events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"APPLICATION_STARTUP\",\n \"value\": \"APPLICATION_STARTUP\"\n },\n {\n \"label\": \"QRCODE_UPDATED\",\n \"value\": \"QRCODE_UPDATED\"\n },\n {\n \"label\": \"MESSAGES_SET\",\n \"value\": \"MESSAGES_SET\"\n },\n {\n \"label\": \"MESSAGES_UPSERT\",\n \"value\": \"MESSAGES_UPSERT\"\n },\n {\n \"label\": \"MESSAGES_UPDATE\",\n \"value\": \"MESSAGES_UPDATE\"\n },\n {\n \"label\": \"MESSAGES_DELETE\",\n \"value\": \"MESSAGES_DELETE\"\n },\n {\n \"label\": \"SEND_MESSAGE\",\n \"value\": \"SEND_MESSAGE\"\n },\n {\n \"label\": \"CONTACTS_SET\",\n \"value\": \"CONTACTS_SET\"\n },\n {\n \"label\": \"CONTACTS_UPSERT\",\n \"value\": \"CONTACTS_UPSERT\"\n },\n {\n \"label\": \"CONTACTS_UPDATE\",\n \"value\": \"CONTACTS_UPDATE\"\n },\n {\n \"label\": \"PRESENCE_UPDATE\",\n \"value\": \"PRESENCE_UPDATE\"\n },\n {\n \"label\": \"CHATS_SET\",\n \"value\": \"CHATS_SET\"\n },\n {\n \"label\": \"CHATS_UPSERT\",\n \"value\": \"CHATS_UPSERT\"\n },\n {\n \"label\": \"CHATS_UPDATE\",\n \"value\": \"CHATS_UPDATE\"\n },\n {\n \"label\": \"CHATS_DELETE\",\n \"value\": \"CHATS_DELETE\"\n },\n {\n \"label\": \"GROUPS_UPSERT\",\n \"value\": \"GROUPS_UPSERT\"\n },\n {\n \"label\": \"GROUP_UPDATE\",\n \"value\": \"GROUP_UPDATE\"\n },\n {\n \"label\": \"GROUP_PARTICIPANTS_UPDATE\",\n \"value\": \"GROUP_PARTICIPANTS_UPDATE\"\n },\n {\n \"label\": \"CONNECTION_UPDATE\",\n \"value\": \"CONNECTION_UPDATE\"\n },\n {\n \"label\": \"CALL\",\n \"value\": \"CALL\"\n },\n {\n \"label\": \"NEW_JWT_TOKEN\",\n \"value\": \"NEW_JWT_TOKEN\"\n }\n]"},"webhook_by_events":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook.webhook_by_events))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"webhook_by_events","identifier":"webhook_by_events","position":2.0,"originalIdentifier":"webhook_by_events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Webhook By Events"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{},"isCustomField":false,"accessor":"webhook","identifier":"webhook","position":1.0,"originalIdentifier":"webhook","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Webhook","labelStyle":"BOLD"},"instance":{"children":{"instanceName":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.instance.instanceName))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"instanceName","identifier":"instanceName","position":0.0,"originalIdentifier":"instanceName","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Instance Name"},"token":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.instance.token))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"token","identifier":"token","position":1.0,"originalIdentifier":"token","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Token"},"qrcode":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.instance.qrcode))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"qrcode","identifier":"qrcode","position":2.0,"originalIdentifier":"qrcode","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Qrcode"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.instance))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{},"isCustomField":false,"accessor":"instance","identifier":"instance","position":0.0,"originalIdentifier":"instance","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Instance","labelStyle":"BOLD"},"settings":{"children":{"reject_call":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.reject_call))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"reject_call","identifier":"reject_call","position":0.0,"originalIdentifier":"reject_call","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Reject Call"},"msg_call":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.msg_call))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"msg_call","identifier":"msg_call","position":1.0,"originalIdentifier":"msg_call","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Msg Call"},"groups_ignore":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.groups_ignore))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"groups_ignore","identifier":"groups_ignore","position":2.0,"originalIdentifier":"groups_ignore","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Groups Ignore"},"always_online":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.always_online))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"always_online","identifier":"always_online","position":3.0,"originalIdentifier":"always_online","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Always Online"},"read_messages":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.read_messages))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"read_messages","identifier":"read_messages","position":4.0,"originalIdentifier":"read_messages","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Read Messages"},"read_status":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.read_status))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"read_status","identifier":"read_status","position":5.0,"originalIdentifier":"read_status","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Read Status"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{},"isCustomField":false,"accessor":"settings","identifier":"settings","position":2.0,"originalIdentifier":"settings","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Settings","labelStyle":"BOLD"},"chatwoot":{"children":{"chatwoot_account_id":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_account_id))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"chatwoot_account_id","identifier":"chatwoot_account_id","position":0.0,"originalIdentifier":"chatwoot_account_id","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Account Id"},"chatwoot_token":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_token))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Password Input","sourceData":"","isCustomField":false,"accessor":"chatwoot_token","identifier":"chatwoot_token","position":1.0,"originalIdentifier":"chatwoot_token","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Token","shouldAllowAutofill":true},"chatwoot_url":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_url))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"chatwoot_url","identifier":"chatwoot_url","position":2.0,"originalIdentifier":"chatwoot_url","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Url"},"chatwoot_sign_msg":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_sign_msg))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"chatwoot_sign_msg","identifier":"chatwoot_sign_msg","position":3.0,"originalIdentifier":"chatwoot_sign_msg","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Sign Msg"},"chatwoot_reopen_conversation":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_reopen_conversation))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"chatwoot_reopen_conversation","identifier":"chatwoot_reopen_conversation","position":4.0,"originalIdentifier":"chatwoot_reopen_conversation","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Reopen Conversation"},"chatwoot_conversation_pending":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_conversation_pending))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"chatwoot_conversation_pending","identifier":"chatwoot_conversation_pending","position":5.0,"originalIdentifier":"chatwoot_conversation_pending","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Conversation Pending"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{},"isCustomField":false,"accessor":"chatwoot","identifier":"chatwoot","position":5.0,"originalIdentifier":"chatwoot","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Chatwoot","labelStyle":"BOLD"},"websocket":{"children":{"websocket_enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.websocket.websocket_enabled))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"websocket_enabled","identifier":"websocket_enabled","position":0.0,"originalIdentifier":"websocket_enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Websocket Enabled"},"websocket_events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.websocket.websocket_events))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Multiselect","sourceData":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL","NEW_JWT_TOKEN"],"isCustomField":false,"accessor":"websocket_events","identifier":"websocket_events","position":1.0,"originalIdentifier":"websocket_events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Websocket Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":[{"label":"Blue","value":"BLUE"},{"label":"Green","value":"GREEN"},{"label":"Red","value":"RED"}]}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.websocket))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{},"isCustomField":false,"accessor":"websocket","identifier":"websocket","position":3.0,"originalIdentifier":"websocket","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Websocket","labelStyle":"BOLD"},"rabbitmq":{"children":{"rabbitmq_enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.rabbitmq.rabbitmq_enabled))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"rabbitmq_enabled","identifier":"rabbitmq_enabled","position":1.0,"originalIdentifier":"rabbitmq_enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Rabbitmq Enabled"},"rabbitmq_events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.rabbitmq.rabbitmq_events))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Multiselect","sourceData":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL","NEW_JWT_TOKEN"],"isCustomField":false,"accessor":"rabbitmq_events","identifier":"rabbitmq_events","position":1.0,"originalIdentifier":"rabbitmq_events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Rabbitmq Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":[{"label":"Blue","value":"BLUE"},{"label":"Green","value":"GREEN"},{"label":"Red","value":"RED"}]}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.rabbitmq))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{"websocket_enabled":false,"websocket_events":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL","NEW_JWT_TOKEN"]},"isCustomField":false,"accessor":"rabbitmq","identifier":"rabbitmq","position":4.0,"originalIdentifier":"rabbitmq","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Rabbitmq","labelStyle":"BOLD"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{"instanceName":"","token":"","webhook":"","webhook_by_events":false,"events":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL","NEW_JWT_TOKEN"],"reject_call":false,"msg_call":"","groups_ignore":false,"always_online":false,"read_messages":false,"read_status":false,"chatwoot_account_id":"","chatwoot_token":"","chatwoot_url":"","chatwoot_sign_msg":false,"chatwoot_reopen_conversation":false,"chatwoot_conversation_pending":false},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":85.0,"widgetName":"FormInstance","submitButtonStyles":{"buttonColor":"rgb(3, 179, 101)","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.webhook.children.webhook_by_events.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.reject_call.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.groups_ignore.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.always_online.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.read_messages.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.read_status.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.instance.children.qrcode.defaultValue"},{"key":"schema.__root_schema__.children.websocket.children.websocket_enabled.defaultValue"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_enabled.defaultValue"}],"displayName":"JSON Form","bottomRow":183.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"New Instance","hideCard":false,"mobileRightColumn":22.0,"shouldScrollContents":true,"parentColumnSpace":17.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n \"instance\": {\n\t\t\t\"instanceName\": \"\",\n \t\"token\": \"\",\n\t\t\t\"qrcode\": true\n\t\t},\n\t\t\"webhook\": {\n\t\t\t\"webhook\": \"\",\n\t\t\t\"events\": [\n\t\t\t\t\"APPLICATION_STARTUP\",\n\t\t\t\t\t\"QRCODE_UPDATED\",\n\t\t\t\t\t\"MESSAGES_SET\",\n\t\t\t\t\t\"MESSAGES_UPSERT\",\n\t\t\t\t\t\"MESSAGES_UPDATE\",\n\t\t\t\t\t\"MESSAGES_DELETE\",\n\t\t\t\t\t\"SEND_MESSAGE\",\n\t\t\t\t\t\"CONTACTS_SET\",\n\t\t\t\t\t\"CONTACTS_UPSERT\",\n\t\t\t\t\t\"CONTACTS_UPDATE\",\n\t\t\t\t\t\"PRESENCE_UPDATE\",\n\t\t\t\t\t\"CHATS_SET\",\n\t\t\t\t\t\"CHATS_UPSERT\",\n\t\t\t\t\t\"CHATS_UPDATE\",\n\t\t\t\t\t\"CHATS_DELETE\",\n\t\t\t\t\t\"GROUPS_UPSERT\",\n\t\t\t\t\t\"GROUP_UPDATE\",\n\t\t\t\t\t\"GROUP_PARTICIPANTS_UPDATE\",\n\t\t\t\t\t\"CONNECTION_UPDATE\",\n\t\t\t\t\t\"CALL\",\n\t\t\t\t\t\"NEW_JWT_TOKEN\"\n\t\t\t],\n\t\t\t\"webhook_by_events\": false\n\t\t},\n \"settings\": {\n\t\t\t\"reject_call\": false,\n\t\t\t\"msg_call\": \"\",\n\t\t\t\"groups_ignore\": false,\n\t\t\t\"always_online\": false,\n\t\t\t\"read_messages\": false,\n\t\t\t\"read_status\": false\n\t\t},\n\t\t\"websocket\": {\n\t\t\t\"websocket_enabled\": false,\n\t\t\t\"websocket_events\": [\n\t\t\t\t\"APPLICATION_STARTUP\",\n\t\t\t\t\t\"QRCODE_UPDATED\",\n\t\t\t\t\t\"MESSAGES_SET\",\n\t\t\t\t\t\"MESSAGES_UPSERT\",\n\t\t\t\t\t\"MESSAGES_UPDATE\",\n\t\t\t\t\t\"MESSAGES_DELETE\",\n\t\t\t\t\t\"SEND_MESSAGE\",\n\t\t\t\t\t\"CONTACTS_SET\",\n\t\t\t\t\t\"CONTACTS_UPSERT\",\n\t\t\t\t\t\"CONTACTS_UPDATE\",\n\t\t\t\t\t\"PRESENCE_UPDATE\",\n\t\t\t\t\t\"CHATS_SET\",\n\t\t\t\t\t\"CHATS_UPSERT\",\n\t\t\t\t\t\"CHATS_UPDATE\",\n\t\t\t\t\t\"CHATS_DELETE\",\n\t\t\t\t\t\"GROUPS_UPSERT\",\n\t\t\t\t\t\"GROUP_UPDATE\",\n\t\t\t\t\t\"GROUP_PARTICIPANTS_UPDATE\",\n\t\t\t\t\t\"CONNECTION_UPDATE\",\n\t\t\t\t\t\"CALL\",\n\t\t\t\t\t\"NEW_JWT_TOKEN\"\n\t\t\t]\n\t\t},\n\t\t\"rabbitmq\": {\n\t\t\t\"rabbitmq_enabled\": false,\n\t\t\t\"rabbitmq_events\": [\n\t\t\t\t\"APPLICATION_STARTUP\",\n\t\t\t\t\t\"QRCODE_UPDATED\",\n\t\t\t\t\t\"MESSAGES_SET\",\n\t\t\t\t\t\"MESSAGES_UPSERT\",\n\t\t\t\t\t\"MESSAGES_UPDATE\",\n\t\t\t\t\t\"MESSAGES_DELETE\",\n\t\t\t\t\t\"SEND_MESSAGE\",\n\t\t\t\t\t\"CONTACTS_SET\",\n\t\t\t\t\t\"CONTACTS_UPSERT\",\n\t\t\t\t\t\"CONTACTS_UPDATE\",\n\t\t\t\t\t\"PRESENCE_UPDATE\",\n\t\t\t\t\t\"CHATS_SET\",\n\t\t\t\t\t\"CHATS_UPSERT\",\n\t\t\t\t\t\"CHATS_UPDATE\",\n\t\t\t\t\t\"CHATS_DELETE\",\n\t\t\t\t\t\"GROUPS_UPSERT\",\n\t\t\t\t\t\"GROUP_UPDATE\",\n\t\t\t\t\t\"GROUP_PARTICIPANTS_UPDATE\",\n\t\t\t\t\t\"CONNECTION_UPDATE\",\n\t\t\t\t\t\"CALL\",\n\t\t\t\t\t\"NEW_JWT_TOKEN\"\n\t\t\t]\n\t\t},\n \"chatwoot\": {\n\t\t\t\"chatwoot_account_id\": \"\",\n\t\t\t\"chatwoot_token\": \"\",\n\t\t\t\"chatwoot_url\": \"\",\n\t\t\t\"chatwoot_sign_msg\": false,\n\t\t\t\"chatwoot_reopen_conversation\": false,\n\t\t\t\"chatwoot_conversation_pending\": false\n\t\t}\n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"o0v8ypwnya","minWidth":450.0,"parentId":"esgwuzqcwt","renderMode":"CANVAS","mobileTopRow":44.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":4.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"w17ra2a85u","isDeprecated":false,"rightColumn":283.875,"detachFromLayout":true,"widgetId":"esgwuzqcwt","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"rnttu90jzr","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"bkvkzj4d20","height":1850.0,"isDeprecated":false,"rightColumn":37.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"rnttu90jzr","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":42.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":13.0,"maxDynamicHeight":9000.0,"width":628.0,"minDynamicHeight":24.0},{"resetFormOnClick":false,"boxShadow":"none","mobileBottomRow":5.0,"widgetName":"ButtonRefreshData","onClick":"{{fetch_Instances.run()}}","buttonColor":"#60a5fa","dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":1.0,"bottomRow":5.0,"parentRowSpace":10.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":35.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":19.0,"dynamicBindingPathList":[{"key":"isVisible"},{"key":"borderRadius"}],"text":"","isDisabled":false,"key":"k10nyfsas3","isDeprecated":false,"rightColumn":24.0,"isDefaultClickDisabled":true,"iconName":"refresh","widgetId":"dn1ehe3gvu","minWidth":120.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","recaptchaType":"V3","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"hug","disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":19.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"boxShadow":"none","mobileBottomRow":5.0,"widgetName":"ButtonGroup1","isCanvas":false,"dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Button Group","iconSVG":"/static/media/icon.7c22979bacc83c8d84aedf56ea6c2022.svg","searchTags":["click","submit"],"topRow":1.0,"bottomRow":5.0,"parentRowSpace":10.0,"groupButtons":{"groupButton1":{"label":"Connect","iconName":"camera","id":"groupButton1","widgetId":"","buttonType":"SIMPLE","placement":"CENTER","isVisible":true,"isDisabled":false,"index":0.0,"menuItems":{},"buttonColor":"#16a34a","onClick":"{{Connect.run();\nfetch_Instances.run();\nshowModal('ModalQrcode');}}"},"groupButton2":{"label":"Restart","iconName":"reset","id":"groupButton2","buttonType":"SIMPLE","placement":"CENTER","widgetId":"","isVisible":true,"isDisabled":false,"index":1.0,"menuItems":{},"buttonColor":"#2563eb","onClick":"{{Restart.run().then(() => {\n showAlert('Instance restarted successfully', 'success');\n}).catch(() => {\n showAlert('Error restarting instance', 'error');\n});\nfetch_Instances.run();}}"},"groupButton3":{"label":"Logout","iconName":"log-in","id":"groupButton3","buttonType":"SIMPLE","placement":"CENTER","widgetId":"","isVisible":true,"isDisabled":false,"index":2.0,"menuItems":{"menuItem1":{"label":"First Option","backgroundColor":"#FFFFFF","id":"menuItem1","widgetId":"","onClick":"","isVisible":true,"isDisabled":false,"index":0.0},"menuItem2":{"label":"Second Option","backgroundColor":"#FFFFFF","id":"menuItem2","widgetId":"","onClick":"","isVisible":true,"isDisabled":false,"index":1.0},"menuItem3":{"label":"Delete","iconName":"trash","iconColor":"#FFFFFF","iconAlign":"right","textColor":"#FFFFFF","backgroundColor":"#DD4B34","id":"menuItem3","widgetId":"","onClick":"","isVisible":true,"isDisabled":false,"index":2.0}},"buttonColor":"#a16207","onClick":"{{Logout.run().then(() => {\n showAlert('Instance logout successfully', 'success');\n}).catch(() => {\n showAlert('Error logout instance', 'error');\n});\nfetch_Instances.run();}}"},"groupButtonmghcs8rd4g":{"id":"groupButtonmghcs8rd4g","index":3.0,"label":"Delete","menuItems":{},"buttonType":"SIMPLE","placement":"CENTER","widgetId":"v0qkg2pjo2","isDisabled":false,"isVisible":true,"buttonColor":"#ef4444","iconName":"cross","onClick":"{{Delete.run().then(() => {\n showAlert('Instance deleted successfully', 'success');\n}).catch(() => {\n showAlert('Error deleting instance', 'error');\n});\nfetch_Instances.run();}}"}},"type":"BUTTON_GROUP_WIDGET","hideCard":false,"mobileRightColumn":51.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[{"key":"groupButtons.groupButton1.onClick"},{"key":"groupButtons.groupButton2.onClick"},{"key":"groupButtons.groupButton3.onClick"},{"key":"groupButtons.groupButtonmghcs8rd4g.onClick"}],"leftColumn":27.0,"dynamicBindingPathList":[{"key":"isVisible"},{"key":"borderRadius"}],"isDisabled":false,"key":"za8m3k8x7w","orientation":"horizontal","isDeprecated":false,"rightColumn":63.0,"widgetId":"2s6fqi483g","minWidth":450.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"fill","childStylesheet":{"button":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}"}},"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":27.0,"buttonVariant":"PRIMARY"},{"boxShadow":"none","mobileBottomRow":18.0,"widgetName":"ProfilePicture","dynamicPropertyPathList":[{"key":"isVisible"},{"key":"borderRadius"}],"displayName":"Image","iconSVG":"/static/media/icon.30c8cbd442cce232b01ba2d434c53a53.svg","topRow":6.0,"bottomRow":28.0,"parentRowSpace":10.0,"type":"IMAGE_WIDGET","hideCard":false,"mobileRightColumn":13.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[],"imageShape":"RECTANGLE","leftColumn":1.0,"dynamicBindingPathList":[{"key":"image"},{"key":"isVisible"}],"defaultImage":"https://th.bing.com/th/id/OIP.ruat7whad9-kcI8_1KH_tQHaGI?pid=ImgDet&rs=1","key":"bl30j21wwb","image":"{{TableInstances.selectedRow.profilePictureUrl}}","isDeprecated":false,"rightColumn":13.0,"objectFit":"contain","widgetId":"1sjznr31jo","isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":6.0,"maxZoomLevel":1.0,"enableDownload":false,"borderRadius":"0.335rem","mobileLeftColumn":1.0,"enableRotation":false},{"mobileBottomRow":22.0,"widgetName":"Text4","dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Text","iconSVG":"/static/media/icon.c3b6033f570046f8c6288d911333a827.svg","searchTags":["typography","paragraph","label"],"topRow":40.0,"bottomRow":48.0,"parentRowSpace":10.0,"type":"TEXT_WIDGET","hideCard":false,"mobileRightColumn":11.0,"animateLoading":true,"overflow":"NONE","fontFamily":"{{appsmith.theme.fontFamily.appFont}}","parentColumnSpace":11.828125,"dynamicTriggerPathList":[],"leftColumn":1.0,"dynamicBindingPathList":[{"key":"text"},{"key":"isVisible"},{"key":"fontFamily"}],"shouldTruncate":false,"truncateButtonColor":"{{appsmith.theme.colors.primaryColor}}","text":"{{TableInstances.selectedRow.profileName || ''}}\n\n{{TableInstances.selectedRow.profileStatus || ''}}","key":"gqt8t28m33","isDeprecated":false,"rightColumn":13.0,"textAlign":"CENTER","dynamicHeight":"AUTO_HEIGHT","widgetId":"0c356c66hp","minWidth":450.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","fontStyle":"BOLD","textColor":"#231F20","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":18.0,"responsiveBehavior":"fill","originalTopRow":40.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"originalBottomRow":48.0,"fontSize":"0.875rem","minDynamicHeight":4.0},{"mobileBottomRow":41.0,"widgetName":"Text5","dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Text","iconSVG":"/static/media/icon.c3b6033f570046f8c6288d911333a827.svg","searchTags":["typography","paragraph","label"],"topRow":32.0,"bottomRow":40.0,"parentRowSpace":10.0,"type":"TEXT_WIDGET","hideCard":false,"mobileRightColumn":9.0,"animateLoading":true,"overflow":"NONE","fontFamily":"{{appsmith.theme.fontFamily.appFont}}","parentColumnSpace":11.75,"dynamicTriggerPathList":[],"leftColumn":1.0,"dynamicBindingPathList":[{"key":"text"},{"key":"isVisible"},{"key":"fontFamily"}],"shouldTruncate":false,"truncateButtonColor":"{{appsmith.theme.colors.primaryColor}}","text":"{{TableInstances.selectedRow.instance || ''}}","key":"gqt8t28m33","isDeprecated":false,"rightColumn":13.0,"textAlign":"CENTER","dynamicHeight":"AUTO_HEIGHT","widgetId":"5qg2iscn1l","minWidth":450.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","fontStyle":"BOLD","textColor":"#231F20","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":37.0,"responsiveBehavior":"fill","originalTopRow":32.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"originalBottomRow":40.0,"fontSize":"1.25rem","minDynamicHeight":4.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalWebhook","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":46.0,"bottomRow":43.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":430.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4","displayName":"Canvas","topRow":0.0,"bottomRow":430.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":240.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Webhook.run().then(() => {\n showAlert('Webhook updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating webhook', 'error');\n});\ncloseModal('ModalWebhook');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"sourceData"},{"key":"schema.__root_schema__.children.events.borderRadius"},{"key":"schema.__root_schema__.children.events.defaultValue"},{"key":"schema.__root_schema__.children.url.accentColor"},{"key":"schema.__root_schema__.children.url.defaultValue"},{"key":"schema.__root_schema__.children.enabled.accentColor"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.webhook_by_events.accentColor"},{"key":"schema.__root_schema__.children.webhook_by_events.defaultValue"},{"key":"borderRadius"},{"key":"schema.__root_schema__.children.events.accentColor"},{"key":"schema.__root_schema__.children.url.borderRadius"},{"key":"submitButtonStyles.buttonColor"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":41.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"webhook_by_events":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook_by_events))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"webhook_by_events","identifier":"webhook_by_events","position":3.0,"originalIdentifier":"webhook_by_events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Webhook By Events"},"enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.enabled))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"enabled","identifier":"enabled","position":0.0,"originalIdentifier":"enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Enabled"},"url":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.url))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Text Input","sourceData":"https://webhook.site/06c7b29f-543b-49bc-b598-51bf99d08f6c","isCustomField":false,"accessor":"url","identifier":"url","position":1.0,"originalIdentifier":"url","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Url"},"events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.events))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Multiselect","sourceData":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL"],"isCustomField":false,"accessor":"events","identifier":"events","position":2.0,"originalIdentifier":"events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n\n {\n \"label\": \"APPLICATION_STARTUP\",\n \"value\": \"APPLICATION_STARTUP\"\n },\n {\n \"label\": \"QRCODE_UPDATED\",\n \"value\": \"QRCODE_UPDATED\"\n },\n {\n \"label\": \"MESSAGES_SET\",\n \"value\": \"MESSAGES_SET\"\n },\n {\n \"label\": \"MESSAGES_UPSERT\",\n \"value\": \"MESSAGES_UPSERT\"\n },\n {\n \"label\": \"MESSAGES_UPDATE\",\n \"value\": \"MESSAGES_UPDATE\"\n },\n {\n \"label\": \"MESSAGES_DELETE\",\n \"value\": \"MESSAGES_DELETE\"\n },\n {\n \"label\": \"SEND_MESSAGE\",\n \"value\": \"SEND_MESSAGE\"\n },\n {\n \"label\": \"CONTACTS_SET\",\n \"value\": \"CONTACTS_SET\"\n },\n {\n \"label\": \"CONTACTS_UPSERT\",\n \"value\": \"CONTACTS_UPSERT\"\n },\n {\n \"label\": \"CONTACTS_UPDATE\",\n \"value\": \"CONTACTS_UPDATE\"\n },\n {\n \"label\": \"PRESENCE_UPDATE\",\n \"value\": \"PRESENCE_UPDATE\"\n },\n {\n \"label\": \"CHATS_SET\",\n \"value\": \"CHATS_SET\"\n },\n {\n \"label\": \"CHATS_UPSERT\",\n \"value\": \"CHATS_UPSERT\"\n },\n {\n \"label\": \"CHATS_UPDATE\",\n \"value\": \"CHATS_UPDATE\"\n },\n {\n \"label\": \"CHATS_DELETE\",\n \"value\": \"CHATS_DELETE\"\n },\n {\n \"label\": \"GROUPS_UPSERT\",\n \"value\": \"GROUPS_UPSERT\"\n },\n {\n \"label\": \"GROUP_UPDATE\",\n \"value\": \"GROUP_UPDATE\"\n },\n {\n \"label\": \"GROUP_PARTICIPANTS_UPDATE\",\n \"value\": \"GROUP_PARTICIPANTS_UPDATE\"\n },\n {\n \"label\": \"CONNECTION_UPDATE\",\n \"value\": \"CONNECTION_UPDATE\"\n },\n {\n \"label\": \"CALL\",\n \"value\": \"CALL\"\n },\n {\n \"label\": \"NEW_JWT_TOKEN\",\n \"value\": \"NEW_JWT_TOKEN\"\n }\n]"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormWebhook","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.webhook_by_events.defaultValue"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.url.defaultValue"}],"displayName":"JSON Form","bottomRow":41.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Webhook","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"enabled\": {{Find_Webhook.data.enabled || false}},\n\t\"url\": {{Find_Webhook.data.url}},\n \"webhook_by_events\": {{Find_Webhook.data.webhook_by_events}},\n \"events\": {{Find_Webhook.data.events || false}} \n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"tb1ekur7fx","minWidth":450.0,"parentId":"mv02ta6pzr","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"mv02ta6pzr","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"0g8ql5hukz","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":430.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"0g8ql5hukz","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalWebsocket","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":42.0,"bottomRow":32.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":320.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4Copy1","displayName":"Canvas","topRow":0.0,"bottomRow":320.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":290.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Websocket.run().then(() => {\n showAlert('Websocket updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating websocket', 'error');\n});\ncloseModal('ModalWebsocket');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"sourceData"},{"key":"schema.__root_schema__.children.events.defaultValue"},{"key":"schema.__root_schema__.children.enabled.accentColor"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"borderRadius"},{"key":"schema.__root_schema__.children.events.accentColor"},{"key":"submitButtonStyles.buttonColor"},{"key":"schema.__root_schema__.children.events.borderRadius"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":30.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.enabled))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"enabled","identifier":"enabled","position":0.0,"originalIdentifier":"enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Enabled"},"events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.events))(FormWebsocket.sourceData, FormWebsocket.formData, FormWebsocket.fieldState)}}","fieldType":"Multiselect","sourceData":[],"isCustomField":false,"accessor":"events","identifier":"events","position":2.0,"originalIdentifier":"events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebsocket.sourceData, FormWebsocket.formData, FormWebsocket.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebsocket.sourceData, FormWebsocket.formData, FormWebsocket.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n\n {\n \"label\": \"APPLICATION_STARTUP\",\n \"value\": \"APPLICATION_STARTUP\"\n },\n {\n \"label\": \"QRCODE_UPDATED\",\n \"value\": \"QRCODE_UPDATED\"\n },\n {\n \"label\": \"MESSAGES_SET\",\n \"value\": \"MESSAGES_SET\"\n },\n {\n \"label\": \"MESSAGES_UPSERT\",\n \"value\": \"MESSAGES_UPSERT\"\n },\n {\n \"label\": \"MESSAGES_UPDATE\",\n \"value\": \"MESSAGES_UPDATE\"\n },\n {\n \"label\": \"MESSAGES_DELETE\",\n \"value\": \"MESSAGES_DELETE\"\n },\n {\n \"label\": \"SEND_MESSAGE\",\n \"value\": \"SEND_MESSAGE\"\n },\n {\n \"label\": \"CONTACTS_SET\",\n \"value\": \"CONTACTS_SET\"\n },\n {\n \"label\": \"CONTACTS_UPSERT\",\n \"value\": \"CONTACTS_UPSERT\"\n },\n {\n \"label\": \"CONTACTS_UPDATE\",\n \"value\": \"CONTACTS_UPDATE\"\n },\n {\n \"label\": \"PRESENCE_UPDATE\",\n \"value\": \"PRESENCE_UPDATE\"\n },\n {\n \"label\": \"CHATS_SET\",\n \"value\": \"CHATS_SET\"\n },\n {\n \"label\": \"CHATS_UPSERT\",\n \"value\": \"CHATS_UPSERT\"\n },\n {\n \"label\": \"CHATS_UPDATE\",\n \"value\": \"CHATS_UPDATE\"\n },\n {\n \"label\": \"CHATS_DELETE\",\n \"value\": \"CHATS_DELETE\"\n },\n {\n \"label\": \"GROUPS_UPSERT\",\n \"value\": \"GROUPS_UPSERT\"\n },\n {\n \"label\": \"GROUP_UPDATE\",\n \"value\": \"GROUP_UPDATE\"\n },\n {\n \"label\": \"GROUP_PARTICIPANTS_UPDATE\",\n \"value\": \"GROUP_PARTICIPANTS_UPDATE\"\n },\n {\n \"label\": \"CONNECTION_UPDATE\",\n \"value\": \"CONNECTION_UPDATE\"\n },\n {\n \"label\": \"CALL\",\n \"value\": \"CALL\"\n },\n {\n \"label\": \"NEW_JWT_TOKEN\",\n \"value\": \"NEW_JWT_TOKEN\"\n }\n]"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormWebsocket","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.events.defaultValue"}],"displayName":"JSON Form","bottomRow":30.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Websocket","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"enabled\": {{Find_Websocket.data.enabled}},\n \"events\": {{Find_Websocket.data.events || []}} \n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"masqwth5vo","minWidth":450.0,"parentId":"gzf4hjxdo8","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"gzf4hjxdo8","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"9twyngcwej","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":320.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"9twyngcwej","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalRabbitmq","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":31.0,"bottomRow":32.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":320.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4Copy1Copy","displayName":"Canvas","topRow":0.0,"bottomRow":320.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":240.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Rabbitmq.run().then(() => {\n showAlert('Rabbitmq updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating rabbitmq', 'error');\n});\ncloseModal('ModalRabbitmq');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"sourceData"},{"key":"schema.__root_schema__.children.events.defaultValue"},{"key":"schema.__root_schema__.children.enabled.accentColor"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"borderRadius"},{"key":"schema.__root_schema__.children.events.accentColor"},{"key":"submitButtonStyles.buttonColor"},{"key":"schema.__root_schema__.children.events.borderRadius"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":30.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.enabled))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"enabled","identifier":"enabled","position":0.0,"originalIdentifier":"enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Enabled"},"events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.events))(FormRabbitmq.sourceData, FormRabbitmq.formData, FormRabbitmq.fieldState)}}","fieldType":"Multiselect","sourceData":[],"isCustomField":false,"accessor":"events","identifier":"events","position":2.0,"originalIdentifier":"events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormRabbitmq.sourceData, FormRabbitmq.formData, FormRabbitmq.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormRabbitmq.sourceData, FormRabbitmq.formData, FormRabbitmq.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n\n {\n \"label\": \"APPLICATION_STARTUP\",\n \"value\": \"APPLICATION_STARTUP\"\n },\n {\n \"label\": \"QRCODE_UPDATED\",\n \"value\": \"QRCODE_UPDATED\"\n },\n {\n \"label\": \"MESSAGES_SET\",\n \"value\": \"MESSAGES_SET\"\n },\n {\n \"label\": \"MESSAGES_UPSERT\",\n \"value\": \"MESSAGES_UPSERT\"\n },\n {\n \"label\": \"MESSAGES_UPDATE\",\n \"value\": \"MESSAGES_UPDATE\"\n },\n {\n \"label\": \"MESSAGES_DELETE\",\n \"value\": \"MESSAGES_DELETE\"\n },\n {\n \"label\": \"SEND_MESSAGE\",\n \"value\": \"SEND_MESSAGE\"\n },\n {\n \"label\": \"CONTACTS_SET\",\n \"value\": \"CONTACTS_SET\"\n },\n {\n \"label\": \"CONTACTS_UPSERT\",\n \"value\": \"CONTACTS_UPSERT\"\n },\n {\n \"label\": \"CONTACTS_UPDATE\",\n \"value\": \"CONTACTS_UPDATE\"\n },\n {\n \"label\": \"PRESENCE_UPDATE\",\n \"value\": \"PRESENCE_UPDATE\"\n },\n {\n \"label\": \"CHATS_SET\",\n \"value\": \"CHATS_SET\"\n },\n {\n \"label\": \"CHATS_UPSERT\",\n \"value\": \"CHATS_UPSERT\"\n },\n {\n \"label\": \"CHATS_UPDATE\",\n \"value\": \"CHATS_UPDATE\"\n },\n {\n \"label\": \"CHATS_DELETE\",\n \"value\": \"CHATS_DELETE\"\n },\n {\n \"label\": \"GROUPS_UPSERT\",\n \"value\": \"GROUPS_UPSERT\"\n },\n {\n \"label\": \"GROUP_UPDATE\",\n \"value\": \"GROUP_UPDATE\"\n },\n {\n \"label\": \"GROUP_PARTICIPANTS_UPDATE\",\n \"value\": \"GROUP_PARTICIPANTS_UPDATE\"\n },\n {\n \"label\": \"CONNECTION_UPDATE\",\n \"value\": \"CONNECTION_UPDATE\"\n },\n {\n \"label\": \"CALL\",\n \"value\": \"CALL\"\n },\n {\n \"label\": \"NEW_JWT_TOKEN\",\n \"value\": \"NEW_JWT_TOKEN\"\n }\n]"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormRabbitmq","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.events.defaultValue"}],"displayName":"JSON Form","bottomRow":30.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Rabbitmq","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"enabled\": {{Find_Rabbitmq.data.enabled || false}},\n \"events\": {{Find_Rabbitmq.data.events || []}} \n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"gdkpog7ep5","minWidth":450.0,"parentId":"rkuaegvcin","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"rkuaegvcin","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"76vl08dr1n","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":320.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"76vl08dr1n","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalSettings","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":46.0,"bottomRow":516.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":470.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4Copy","displayName":"Canvas","topRow":0.0,"bottomRow":470.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":240.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Settings.run().then(() => {\n showAlert('Settings updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating Settings', 'error');\n});\ncloseModal('ModalSettings');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":1.0,"dynamicBindingPathList":[{"key":"schema.__root_schema__.children.read_status.accentColor"},{"key":"schema.__root_schema__.children.read_status.defaultValue"},{"key":"schema.__root_schema__.children.read_messages.accentColor"},{"key":"schema.__root_schema__.children.read_messages.defaultValue"},{"key":"schema.__root_schema__.children.always_online.accentColor"},{"key":"schema.__root_schema__.children.always_online.defaultValue"},{"key":"schema.__root_schema__.children.groups_ignore.accentColor"},{"key":"schema.__root_schema__.children.groups_ignore.defaultValue"},{"key":"schema.__root_schema__.children.msg_call.accentColor"},{"key":"schema.__root_schema__.children.msg_call.defaultValue"},{"key":"schema.__root_schema__.children.reject_call.accentColor"},{"key":"schema.__root_schema__.children.reject_call.defaultValue"},{"key":"borderRadius"},{"key":"sourceData"},{"key":"schema.__root_schema__.children.msg_call.borderRadius"},{"key":"submitButtonStyles.buttonColor"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":45.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"reject_call":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.reject_call))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"reject_call","identifier":"reject_call","position":0.0,"originalIdentifier":"reject_call","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Reject Call"},"msg_call":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.msg_call))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Text Input","sourceData":"Não aceitamos chamadas!","isCustomField":false,"accessor":"msg_call","identifier":"msg_call","position":1.0,"originalIdentifier":"msg_call","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Msg Call"},"groups_ignore":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.groups_ignore))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"groups_ignore","identifier":"groups_ignore","position":2.0,"originalIdentifier":"groups_ignore","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Groups Ignore"},"always_online":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.always_online))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"always_online","identifier":"always_online","position":3.0,"originalIdentifier":"always_online","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Always Online"},"read_messages":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.read_messages))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"read_messages","identifier":"read_messages","position":4.0,"originalIdentifier":"read_messages","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Read Messages"},"read_status":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.read_status))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"read_status","identifier":"read_status","position":5.0,"originalIdentifier":"read_status","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Read Status"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormSettings","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.reject_call.defaultValue"},{"key":"schema.__root_schema__.children.groups_ignore.defaultValue"},{"key":"schema.__root_schema__.children.always_online.defaultValue"},{"key":"schema.__root_schema__.children.read_messages.defaultValue"},{"key":"schema.__root_schema__.children.read_status.defaultValue"},{"key":"schema.__root_schema__.children.msg_call.defaultValue"}],"displayName":"JSON Form","bottomRow":45.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Settings","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"reject_call\": {{Find_Settings.data.reject_call || false}},\n \"msg_call\": {{Find_Settings.data.msg_call}},\n \"groups_ignore\": {{Find_Settings.data.groups_ignore || false}},\n \"always_online\": {{Find_Settings.data.always_online || false}},\n \"read_messages\": {{Find_Settings.data.read_messages || false}},\n \"read_status\": {{Find_Settings.data.read_status || false}}\n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":64.0,"widgetId":"3wajdobhry","minWidth":450.0,"parentId":"bj66ktxeor","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"bj66ktxeor","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"9pvl5efylb","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":470.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"9pvl5efylb","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalChatwoot","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":50.0,"bottomRow":780.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":730.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4CopyCopy","displayName":"Canvas","topRow":0.0,"bottomRow":730.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":730.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Chatwoot.run().then(() => {\n showAlert('Chatwoot updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating Chatwoot', 'error');\n});\ncloseModal('ModalChatwoot');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"schema.__root_schema__.children.conversation_pending.accentColor"},{"key":"schema.__root_schema__.children.conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.reopen_conversation.accentColor"},{"key":"schema.__root_schema__.children.reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.sign_msg.accentColor"},{"key":"schema.__root_schema__.children.sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.url.borderRadius"},{"key":"schema.__root_schema__.children.url.accentColor"},{"key":"schema.__root_schema__.children.url.defaultValue"},{"key":"schema.__root_schema__.children.token.borderRadius"},{"key":"schema.__root_schema__.children.token.accentColor"},{"key":"schema.__root_schema__.children.token.defaultValue"},{"key":"schema.__root_schema__.children.account_id.accentColor"},{"key":"schema.__root_schema__.children.account_id.defaultValue"},{"key":"schema.__root_schema__.children.enabled.accentColor"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"borderRadius"},{"key":"sourceData"},{"key":"schema.__root_schema__.children.account_id.borderRadius"},{"key":"schema.__root_schema__.children.webhook_url.defaultValue"},{"key":"schema.__root_schema__.children.webhook_url.accentColor"},{"key":"schema.__root_schema__.children.webhook_url.borderRadius"},{"key":"schema.__root_schema__.defaultValue"},{"key":"schema.__root_schema__.borderRadius"},{"key":"schema.__root_schema__.cellBorderRadius"},{"key":"schema.__root_schema__.children.name_inbox.defaultValue"},{"key":"schema.__root_schema__.children.name_inbox.borderRadius"},{"key":"schema.__root_schema__.children.name_inbox.accentColor"},{"key":"submitButtonStyles.buttonColor"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":71.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.enabled))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"enabled","identifier":"enabled","position":0.0,"originalIdentifier":"enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Enabled"},"account_id":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.account_id))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Text Input","sourceData":"1","isCustomField":false,"accessor":"account_id","identifier":"account_id","position":1.0,"originalIdentifier":"account_id","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Account Id"},"token":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.token))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Password Input","sourceData":"uHquVJgCdkee8JPJm9YBkdH6","isCustomField":false,"accessor":"token","identifier":"token","position":2.0,"originalIdentifier":"token","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Token","shouldAllowAutofill":true},"url":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.url))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Text Input","sourceData":"https://chatwoot.evolution.dgcode.com.br","isCustomField":false,"accessor":"url","identifier":"url","position":3.0,"originalIdentifier":"url","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Url"},"sign_msg":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.sign_msg))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"sign_msg","identifier":"sign_msg","position":4.0,"originalIdentifier":"sign_msg","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Sign Msg"},"reopen_conversation":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.reopen_conversation))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"reopen_conversation","identifier":"reopen_conversation","position":5.0,"originalIdentifier":"reopen_conversation","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Reopen Conversation"},"conversation_pending":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.conversation_pending))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"conversation_pending","identifier":"conversation_pending","position":6.0,"originalIdentifier":"conversation_pending","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Conversation Pending"},"webhook_url":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook_url))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Text Input","sourceData":"https://api.evolution.dgcode.com.br/chatwoot/webhook/evolution-cwId-4","isCustomField":false,"accessor":"webhook_url","identifier":"webhook_url","position":8.0,"originalIdentifier":"webhook_url","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":true,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Webhook Url"},"name_inbox":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.name_inbox))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Text Input","sourceData":"evolution-cwId-4","isCustomField":false,"accessor":"name_inbox","identifier":"name_inbox","position":7.0,"originalIdentifier":"name_inbox","accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":true,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Name Inbox"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormChatwoot","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.account_id.defaultValue"},{"key":"schema.__root_schema__.children.webhook_url.defaultValue"}],"displayName":"JSON Form","bottomRow":71.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Chatwoot","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"enabled\": {{Find_Chatwoot.data.enabled || false}},\n\t\"account_id\": {{Find_Chatwoot.data.account_id}},\n \"token\": {{Find_Chatwoot.data.token}},\n \"url\": {{Find_Chatwoot.data.url}},\n \"sign_msg\": {{Find_Chatwoot.data.sign_msg || false}},\n \"reopen_conversation\": {{Find_Chatwoot.data.reopen_conversation || false}},\n \"conversation_pending\": {{Find_Chatwoot.data.conversation_pending || false}},\n\t\t\"name_inbox\": {{Find_Chatwoot.data.name_inbox}},\n\t\t\"webhook_url\": {{Find_Chatwoot.data.webhook_url}}\n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"c5v1lwuyrk","minWidth":450.0,"parentId":"wqoo05rt9h","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"wqoo05rt9h","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"kekx3o71p4","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":730.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"kekx3o71p4","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":692.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalTypebot","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":45.0,"bottomRow":665.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":620.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4CopyCopyCopy","displayName":"Canvas","topRow":0.0,"bottomRow":620.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":730.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Typebot.run().then(() => {\n showAlert('Typebot updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating Typebot', 'error');\n});\ncloseModal('ModalTypebot');}}","topRow":1.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"schema.__root_schema__.defaultValue"},{"key":"schema.__root_schema__.borderRadius"},{"key":"submitButtonStyles.buttonColor"},{"key":"sourceData"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.enabled.accentColor"},{"key":"schema.__root_schema__.children.url.defaultValue"},{"key":"schema.__root_schema__.children.url.accentColor"},{"key":"schema.__root_schema__.children.url.borderRadius"},{"key":"schema.__root_schema__.children.typebot.defaultValue"},{"key":"schema.__root_schema__.children.typebot.accentColor"},{"key":"schema.__root_schema__.children.typebot.borderRadius"},{"key":"schema.__root_schema__.children.expire.defaultValue"},{"key":"schema.__root_schema__.children.expire.accentColor"},{"key":"schema.__root_schema__.children.expire.borderRadius"},{"key":"schema.__root_schema__.children.keyword_finish.defaultValue"},{"key":"schema.__root_schema__.children.keyword_finish.accentColor"},{"key":"schema.__root_schema__.children.keyword_finish.borderRadius"},{"key":"schema.__root_schema__.children.delay_message.defaultValue"},{"key":"schema.__root_schema__.children.delay_message.accentColor"},{"key":"schema.__root_schema__.children.delay_message.borderRadius"},{"key":"schema.__root_schema__.cellBorderRadius"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":68.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.enabled))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"enabled","identifier":"enabled","position":0.0,"originalIdentifier":"enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Enabled"},"url":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.url))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Text Input","sourceData":"https://chat2.manualnegocioonline.com.br","isCustomField":false,"accessor":"url","identifier":"url","position":1.0,"originalIdentifier":"url","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Url"},"typebot":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.typebot))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Text Input","sourceData":"francis-whatsapp-pesquisa-satisfacao-copy-copy-74fk24p","isCustomField":false,"accessor":"typebot","identifier":"typebot","position":2.0,"originalIdentifier":"typebot","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Typebot"},"expire":{"children":{},"dataType":"number","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.expire))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Number Input","sourceData":20.0,"isCustomField":false,"accessor":"expire","identifier":"expire","position":3.0,"originalIdentifier":"expire","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Expire"},"keyword_finish":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.keyword_finish))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Text Input","sourceData":"#SAIR","isCustomField":false,"accessor":"keyword_finish","identifier":"keyword_finish","position":4.0,"originalIdentifier":"keyword_finish","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Keyword Finish"},"delay_message":{"children":{},"dataType":"number","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.delay_message))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Number Input","sourceData":3000.0,"isCustomField":false,"accessor":"delay_message","identifier":"delay_message","position":5.0,"originalIdentifier":"delay_message","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Delay Message"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Object","sourceData":{"enabled":true,"url":"https://chat2.manualnegocioonline.com.br","typebot":"francis-whatsapp-pesquisa-satisfacao-copy-copy-74fk24p","expire":20.0,"keyword_finish":"#SAIR","delay_message":3000.0,"unknown_message":"Mensagem não reconhecida2"},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormTypebot","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.account_id.defaultValue"},{"key":"schema.__root_schema__.children.webhook_url.defaultValue"}],"displayName":"JSON Form","bottomRow":60.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Set Typebot","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"enabled\": {{Find_Typebot.data.enabled || false}},\n \"url\": {{Find_Typebot.data.url}},\n \"typebot\": {{Find_Typebot.data.typebot}},\n \"expire\": {{Find_Typebot.data.expire}},\n \"keyword_finish\": {{Find_Typebot.data.keyword_finish}},\n \"delay_message\": {{Find_Typebot.data.delay_message}}\n \n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"fyu0oxvlx7","minWidth":450.0,"parentId":"bvxewkusbf","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":1.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"bvxewkusbf","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"4n3m0wo9tx","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":620.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"4n3m0wo9tx","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":692.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalTypebotChangeSessionStatu","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":45.0,"bottomRow":415.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":370.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4CopyCopyCopyCopy","displayName":"Canvas","topRow":0.0,"bottomRow":370.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":730.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_TypebotChangeSessionStatus.run().then(() => {\n showAlert('Typebot Change Session updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating Session Typebot', 'error');\n});\ncloseModal('ModalTypebotChangeSessionStatu');}}","topRow":1.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"schema.__root_schema__.defaultValue"},{"key":"schema.__root_schema__.borderRadius"},{"key":"submitButtonStyles.buttonColor"},{"key":"schema.__root_schema__.cellBorderRadius"},{"key":"schema.__root_schema__.children.remoteJid.defaultValue"},{"key":"schema.__root_schema__.children.remoteJid.accentColor"},{"key":"schema.__root_schema__.children.remoteJid.borderRadius"},{"key":"schema.__root_schema__.children.status.defaultValue"},{"key":"schema.__root_schema__.children.status.accentColor"},{"key":"schema.__root_schema__.children.status.borderRadius"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":60.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"remoteJid":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.remoteJid))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"remoteJid","identifier":"remoteJid","position":0.0,"originalIdentifier":"remoteJid","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":true,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Remote Jid (WhatsApp. Ex: 5511968162699@s.whatsapp.net)"},"status":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.status))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"status","identifier":"status","position":1.0,"originalIdentifier":"status","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Status (opened, paused or closed)"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Object","sourceData":{"enabled":true,"url":"https://chat2.manualnegocioonline.com.br","typebot":"francis-whatsapp-pesquisa-satisfacao-copy-copy-74fk24p","expire":20.0,"keyword_finish":"#SAIR","delay_message":3000.0,"unknown_message":"Mensagem não reconhecida2"},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormTypebotChangeSessionStatus","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.account_id.defaultValue"},{"key":"schema.__root_schema__.children.webhook_url.defaultValue"}],"displayName":"JSON Form","bottomRow":35.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Typebot Change Session Status","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n \"remoteJid\": \"@s.whatsapp.net\",\n \"status\": \"\"\n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"28lli5jdvr","minWidth":450.0,"parentId":"8m0yhclt7g","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":1.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"8m0yhclt7g","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"84rj87eew6","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":370.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"84rj87eew6","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":692.0,"minDynamicHeight":24.0},{"resetFormOnClick":false,"boxShadow":"none","mobileBottomRow":50.0,"widgetName":"Button2","onClick":"{{Fetch_Instance.run();\nFetch_PrivacySettings.run();\nshowModal('ModalProfile');}}","buttonColor":"#2770fc","dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":28.0,"bottomRow":32.0,"parentRowSpace":10.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":21.0,"animateLoading":true,"parentColumnSpace":17.9375,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":1.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"isVisible"}],"text":"Edit Profile","isDisabled":false,"key":"zhd9fobc1z","isDeprecated":false,"rightColumn":13.0,"isDefaultClickDisabled":true,"iconName":"edit","widgetId":"uh6430ysqy","minWidth":120.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? TableInstances.selectedRow.instance ? TableInstances.selectedRow.Status === 'open' ? true : false : false : false}}","recaptchaType":"V3","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"responsiveBehavior":"hug","originalTopRow":51.0,"disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":5.0,"originalBottomRow":55.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"boxShadow":"none","mobileBottomRow":59.0,"widgetName":"ModalProfile","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":35.0,"bottomRow":975.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":940.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas5","displayName":"Canvas","topRow":0.0,"bottomRow":940.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":240.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Update_ProfileName.run().then(() => {\n showAlert('ProfileName successfully saved!', 'success');\n}).catch(() => {\n showAlert('Error updating ProfileName', 'error');\n});\nUpdate_ProfilePicture.run().then(() => {\n showAlert('ProfilePicture successfully saved!', 'success');\n}).catch(() => {\n showAlert('Error updating ProfilePicture', 'error');\n});\nUpdate_ProfileStatus.run().then(() => {\n showAlert('ProfileStatus successfully saved!', 'success');\n}).catch(() => {\n showAlert('Error updating ProfileStatus', 'error');\n});\nUpdate_PrivacySettings.run().then(() => {\n showAlert('PrivacySttings successfully saved!', 'success');\n}).catch(() => {\n showAlert('Error updating PrivacySttings', 'error');\n});\nfetch_Instances.run();\ncloseModal('ModalProfile');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"submitButtonStyles.buttonColor"},{"key":"submitButtonStyles.borderRadius"},{"key":"resetButtonStyles.buttonColor"},{"key":"resetButtonStyles.borderRadius"},{"key":"schema.__root_schema__.defaultValue"},{"key":"schema.__root_schema__.borderRadius"},{"key":"schema.__root_schema__.cellBorderRadius"},{"key":"schema.__root_schema__.children.profileName.defaultValue"},{"key":"schema.__root_schema__.children.profileName.accentColor"},{"key":"schema.__root_schema__.children.profileName.borderRadius"},{"key":"schema.__root_schema__.children.profileStatus.defaultValue"},{"key":"schema.__root_schema__.children.profileStatus.accentColor"},{"key":"schema.__root_schema__.children.profileStatus.borderRadius"},{"key":"schema.__root_schema__.children.profilePictureUrl.defaultValue"},{"key":"schema.__root_schema__.children.profilePictureUrl.borderRadius"},{"key":"sourceData"},{"key":"schema.__root_schema__.children.profilePictureUrl.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.readreceipts.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.readreceipts.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.readreceipts.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.children.profile.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.profile.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.profile.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.children.status.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.status.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.status.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.children.online.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.online.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.online.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.children.last.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.last.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.last.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.children.groupadd.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.groupadd.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.groupadd.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.cellBorderRadius"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":92.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"profileName":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.profileName))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"profileName","identifier":"profileName","position":1.0,"originalIdentifier":"profileName","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Profile Name"},"profileStatus":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.profileStatus))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"profileStatus","identifier":"profileStatus","position":2.0,"originalIdentifier":"profileStatus","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Profile Status"},"profilePictureUrl":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.profilePictureUrl))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Text Input","sourceData":"https://pps.whatsapp.net/v/t61.24694-24/359816109_329991892684302_7466658594467953893_n.jpg?ccb=11-4&oh=01_AdTpgc4O-xiZDr2v0OLu_jssxaw8dsws819srLMOzUwEnw&oe=64D3C41E","isCustomField":false,"accessor":"profilePictureUrl","identifier":"profilePictureUrl","position":0.0,"originalIdentifier":"profilePictureUrl","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Profile Picture Url"},"privacySettings":{"children":{"readreceipts":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.readreceipts))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"all","isCustomField":false,"accessor":"readreceipts","identifier":"readreceipts","position":0.0,"originalIdentifier":"readreceipts","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Readreceipts","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"none\",\n \"value\": \"none\"\n }\n]"},"profile":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.profile))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"all","isCustomField":false,"accessor":"profile","identifier":"profile","position":1.0,"originalIdentifier":"profile","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Profile","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"contacts\",\n \"value\": \"contacts\"\n },\n {\n \"label\": \"contact_blacklist\",\n \"value\": \"contact_blacklist\"\n },\n {\n \"label\": \"none\",\n \"value\": \"none\"\n }\n]"},"status":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.status))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"contacts","isCustomField":false,"accessor":"status","identifier":"status","position":2.0,"originalIdentifier":"status","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Status","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"contacts\",\n \"value\": \"contacts\"\n },\n {\n \"label\": \"contact_blacklist\",\n \"value\": \"contact_blacklist\"\n },\n {\n \"label\": \"none\",\n \"value\": \"none\"\n }\n]"},"online":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.online))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"all","isCustomField":false,"accessor":"online","identifier":"online","position":3.0,"originalIdentifier":"online","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Online","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"match_last_seen\",\n \"value\": \"match_last_seen\"\n }\n]"},"last":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.last))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"contacts","isCustomField":false,"accessor":"last","identifier":"last","position":4.0,"originalIdentifier":"last","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Last","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"contacts\",\n \"value\": \"contacts\"\n },\n {\n \"label\": \"contact_blacklist\",\n \"value\": \"contact_blacklist\"\n },\n {\n \"label\": \"none\",\n \"value\": \"none\"\n }\n]"},"groupadd":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.groupadd))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"all","isCustomField":false,"accessor":"groupadd","identifier":"groupadd","position":5.0,"originalIdentifier":"groupadd","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Groupadd","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"contacts\",\n \"value\": \"contacts\"\n },\n {\n \"label\": \"contact_blacklist\",\n \"value\": \"contact_blacklist\"\n },\n {\n \"label\": \"none\",\n \"value\": \"none\"\n }\n]"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Object","sourceData":{"readreceipts":"all","profile":"all","status":"contacts","online":"all","last":"contacts","groupadd":"all"},"isCustomField":false,"accessor":"privacySettings","identifier":"privacySettings","position":3.0,"originalIdentifier":"privacySettings","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Privacy Settings","labelStyle":"BOLD"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormProfile","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[],"displayName":"JSON Form","bottomRow":92.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Edit Profile","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"profilePictureUrl\": \"{{Fetch_Instance.data.instance.profilePictureUrl}}\",\n\t\"profileName\": \"{{Fetch_Instance.data.instance.profileName}}\",\n\t\"profileStatus\": \"{{Fetch_Instance.data.instance.profileStatus}}\",\n\t\"privacySettings\": {\n \"readreceipts\": {{Fetch_PrivacySettings.data.readreceipts}},\n \"profile\": {{Fetch_PrivacySettings.data.profile}},\n \"status\": {{Fetch_PrivacySettings.data.status}},\n \"online\": {{Fetch_PrivacySettings.data.online}},\n \"last\": {{Fetch_PrivacySettings.data.last}},\n \"groupadd\": {{Fetch_PrivacySettings.data.groupadd}}\n\t\t}\n}","resetButtonLabel":"","key":"72nqor459k","backgroundColor":"#fff","isDeprecated":false,"rightColumn":64.0,"widgetId":"hguxefink2","minWidth":450.0,"parentId":"basosxf5qt","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"mepf0qsn1e","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"basosxf5qt","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"ss96aihlej","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"4ktj7iym0b","height":940.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"ss96aihlej","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":35.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0}]},"layoutOnLoadActions":[[{"id":"Home_Scripts.verifyConfig","name":"Scripts.verifyConfig","collectionId":"Home_Scripts","clientSideExecution":true,"confirmBeforeExecute":false,"pluginType":"JS","jsonPathKeys":[],"timeoutInMillisecond":10000.0}],[{"id":"Home_Find_Rabbitmq","name":"Find_Rabbitmq","confirmBeforeExecute":false,"pluginType":"API","jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"timeoutInMillisecond":10000.0},{"id":"Home_Find_Websocket","name":"Find_Websocket","confirmBeforeExecute":false,"pluginType":"API","jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"timeoutInMillisecond":10000.0}]],"layoutOnLoadActionErrors":[],"validOnPageLoadActions":true,"id":"Home","deleted":false,"policies":[],"userPermissions":[]}],"userPermissions":[],"policies":[],"isHidden":false},"publishedPage":{"name":"Home","slug":"home","customSlug":"","layouts":[{"viewMode":false,"dsl":{"widgetName":"MainContainer","backgroundColor":"none","rightColumn":4896.0,"snapColumns":64.0,"detachFromLayout":true,"widgetId":"0","topRow":0.0,"bottomRow":480.0,"containerStyle":"none","snapRows":124.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"version":83.0,"minHeight":1292.0,"dynamicTriggerPathList":[],"parentColumnSpace":1.0,"dynamicBindingPathList":[],"leftColumn":0.0,"children":[{"boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","borderColor":"#E0DEDE","isVisibleDownload":true,"iconSVG":"https://appcdn.appsmith.com/static/media/icon.24905525921dd6f5ff46d0dd843b9e12.svg","topRow":6.0,"isSortable":true,"type":"TABLE_WIDGET_V2","inlineEditingSaveOption":"ROW_LEVEL","animateLoading":true,"dynamicBindingPathList":[{"key":"tableData"},{"key":"primaryColumns.customColumn9.boxShadow"},{"key":"primaryColumns.customColumn9.borderRadius"},{"key":"primaryColumns.customColumn9.menuColor"},{"key":"primaryColumns.customColumn8.computedValue"},{"key":"primaryColumns.customColumn7.computedValue"},{"key":"primaryColumns.customColumn6.computedValue"},{"key":"primaryColumns.customColumn5.computedValue"},{"key":"primaryColumns.customColumn2.computedValue"},{"key":"primaryColumns.customColumn1.textColor"},{"key":"primaryColumns.customColumn1.cellBackground"},{"key":"primaryColumns.customColumn1.computedValue"},{"key":"primaryColumns.instance.computedValue"},{"key":"isVisible"},{"key":"accentColor"},{"key":"borderRadius"},{"key":"boxShadow"}],"needsHeightForContent":true,"leftColumn":14.0,"delimiter":",","defaultSelectedRowIndex":0.0,"showInlineEditingOptionDropdown":true,"accentColor":"{{appsmith.theme.colors.primaryColor}}","isVisibleFilters":true,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","enableClientSideSearch":true,"version":2.0,"totalRecordsCount":0.0,"isLoading":false,"childStylesheet":{"button":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"menuButton":{"menuColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"iconButton":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"editActions":{"saveButtonColor":"{{appsmith.theme.colors.primaryColor}}","saveBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","discardButtonColor":"{{appsmith.theme.colors.primaryColor}}","discardBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"}},"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","columnUpdatedAt":1.690746223636E12,"defaultSelectedRowIndices":[0.0],"mobileBottomRow":32.0,"widgetName":"TableInstances","defaultPageSize":0.0,"columnOrder":["instance","customColumn5","customColumn1","customColumn2","customColumn6","customColumn7","customColumn8","customColumn9"],"dynamicPropertyPathList":[{"key":"primaryColumns.customColumn1.cellBackground"},{"key":"isVisible"}],"displayName":"Table","bottomRow":42.0,"columnWidthMap":{"customColumn3":92.0,"customColumn2":340.0,"customColumn5":254.0,"customColumn9":60.0},"parentRowSpace":10.0,"hideCard":false,"mobileRightColumn":36.0,"parentColumnSpace":20.078125,"dynamicTriggerPathList":[{"key":"primaryColumns.customColumn9.menuItems.menuItemjfzsd8g6yr.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItem4sqork5nmt.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItemig6ua4ixjx.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItemx9oyhys8cj.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItemxk5jvvwwef.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItem16ysonwzrq.onClick"},{"key":"primaryColumns.customColumn9.menuItems.menuItembtatfbml4y.onClick"}],"borderWidth":"1","primaryColumns":{"instance":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":0.0,"width":150.0,"originalId":"instance","id":"instance","alias":"instance","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":true,"isDerived":false,"label":"Instance","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.instanceName))}}","sticky":"","validation":{}},"customColumn1":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":1.0,"width":150.0,"originalId":"customColumn1","id":"customColumn1","alias":"Status","horizontalAlignment":"CENTER","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":true,"isDerived":true,"label":"Status","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.status))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF","cellBackground":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.status === \"open\" ? \"#499B51\" : currentRow.instance.status === \"close\" ? \"#DD524C\" : \"#2770FC\"))}}","textColor":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( (appsmith.theme.colors.backgroundColor)))}}"},"customColumn2":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":2.0,"width":150.0,"originalId":"customColumn2","id":"customColumn2","alias":"Apikey","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":true,"isDerived":true,"label":"Apikey","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.apikey))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF"},"customColumn5":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":5.0,"width":150.0,"originalId":"customColumn5","id":"customColumn5","alias":"Owner","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":true,"isDerived":true,"label":"Owner","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.owner))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF"},"customColumn6":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":6.0,"width":150.0,"originalId":"customColumn6","id":"customColumn6","alias":"profilePictureUrl","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":false,"isDerived":true,"label":"profilePictureUrl","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.profilePictureUrl))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF"},"customColumn7":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":7.0,"width":150.0,"originalId":"customColumn7","id":"customColumn7","alias":"profileName","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":false,"isDerived":true,"label":"profileName","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.profileName))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF"},"customColumn8":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":8.0,"width":150.0,"originalId":"customColumn8","id":"customColumn8","alias":"profileStatus","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"text","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":false,"isDerived":true,"label":"profileStatus","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( currentRow.instance.profileStatus))}}","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF"},"customColumn9":{"allowCellWrapping":false,"allowSameOptionsInNewRow":true,"index":9.0,"width":150.0,"originalId":"customColumn9","id":"customColumn9","alias":"#","horizontalAlignment":"LEFT","verticalAlignment":"CENTER","columnType":"menuButton","textSize":"0.875rem","enableFilter":true,"enableSort":true,"isVisible":true,"isDisabled":false,"isCellEditable":false,"isEditable":false,"isCellVisible":true,"isDerived":true,"label":"#","isSaveVisible":true,"isDiscardVisible":true,"computedValue":"","sticky":"","validation":{},"buttonStyle":"rgb(3, 179, 101)","labelColor":"#FFFFFF","menuColor":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( (appsmith.theme.colors.primaryColor)))}}","borderRadius":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( (appsmith.theme.borderRadius.appBorderRadius)))}}","boxShadow":"{{TableInstances.processedTableData.map((currentRow, currentIndex) => ( \"none\"))}}","customAlias":"","menuItemsSource":"STATIC","menuButtonLabel":" ","menuButtoniconName":"chevron-down","menuItems":{"menuItemjfzsd8g6yr":{"id":"menuItemjfzsd8g6yr","index":0.0,"label":"Webhook","widgetId":"vygcejtdun","isDisabled":false,"isVisible":true,"onClick":"{{Find_Webhook.run({\n //\"key\": \"value\",\n});\nshowModal('ModalWebhook');}}"},"menuItem4sqork5nmt":{"id":"menuItem4sqork5nmt","index":1.0,"label":"Settings","widgetId":"0hw8oqpwcj","isDisabled":false,"isVisible":true,"onClick":"{{Find_Settings.run();\nshowModal('ModalSettings');}}"},"menuItemx9oyhys8cj":{"id":"menuItemx9oyhys8cj","index":2.0,"label":"Websocket","widgetId":"j75a4k6ecq","isDisabled":false,"isVisible":true,"onClick":"{{Find_Websocket.run();\nshowModal('ModalWebsocket');}}"},"menuItemxk5jvvwwef":{"id":"menuItemxk5jvvwwef","index":3.0,"label":"Rabbitmq","widgetId":"3u94ov6qst","isDisabled":false,"isVisible":true,"onClick":"{{Find_Rabbitmq.run();\nshowModal('ModalRabbitmq');}}"},"menuItemig6ua4ixjx":{"id":"menuItemig6ua4ixjx","index":4.0,"label":"Chatwoot","widgetId":"fuq5dtgbqc","isDisabled":false,"isVisible":true,"onClick":"{{Find_Chatwoot.run()\nshowModal('ModalChatwoot');}}"},"menuItem16ysonwzrq":{"id":"menuItem16ysonwzrq","index":5.0,"label":"Set Typebot","widgetId":"fi9nb2bace","isDisabled":false,"isVisible":true,"onClick":"{{Find_Typebot.run()\nshowModal('ModalTypebot');}}"},"menuItembtatfbml4y":{"id":"menuItembtatfbml4y","index":6.0,"label":"TypeBot Set Session Status","widgetId":"7f6mg653ra","isDisabled":false,"isVisible":true,"onClick":"{{showModal('ModalTypebotChangeSessionStatu');}}"}}}},"key":"e3yxhhyeel","canFreezeColumn":true,"isDeprecated":false,"rightColumn":63.0,"textSize":"0.875rem","widgetId":"uupm7enu8u","minWidth":450.0,"tableData":"{{fetch_Instances.data}}","label":"Data","searchKey":"","parentId":"0","renderMode":"CANVAS","mobileTopRow":4.0,"horizontalAlignment":"LEFT","isVisibleSearch":true,"responsiveBehavior":"fill","mobileLeftColumn":2.0,"isVisiblePagination":true,"verticalAlignment":"CENTER"},{"resetFormOnClick":false,"boxShadow":"none","mobileBottomRow":5.0,"widgetName":"BtnNewInstance","onClick":"{{showModal('ModalInstance');}}","buttonColor":"rgb(3, 179, 101)","dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":1.0,"bottomRow":5.0,"parentRowSpace":10.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":8.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":7.0,"dynamicBindingPathList":[{"key":"isVisible"},{"key":"borderRadius"}],"text":"New Instance","isDisabled":false,"key":"crzwqv3pdr","isDeprecated":false,"rightColumn":19.0,"isDefaultClickDisabled":true,"iconName":"add","widgetId":"84ei9q1ugm","minWidth":120.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","recaptchaType":"V3","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"hug","disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":0.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"boxShadow":"none","mobileBottomRow":74.0,"widgetName":"ModalQrcode","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":50.0,"bottomRow":500.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":45.0,"animateLoading":true,"parentColumnSpace":11.828125,"leftColumn":21.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas1","displayName":"Canvas","topRow":0.0,"bottomRow":450.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":240.0,"mobileRightColumn":283.875,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","mobileBottomRow":52.0,"widgetName":"ImageQrcode","displayName":"Image","iconSVG":"https://appcdn.appsmith.com/static/media/icon.30c8cbd442cce232b01ba2d434c53a53.svg","topRow":6.0,"bottomRow":43.0,"parentRowSpace":10.0,"type":"IMAGE_WIDGET","hideCard":false,"mobileRightColumn":55.0,"animateLoading":true,"parentColumnSpace":20.078125,"dynamicTriggerPathList":[],"imageShape":"RECTANGLE","leftColumn":2.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"image"}],"defaultImage":"https://manualnegocioonline.com.br/downloads/evolution-api-favicon2.png","key":"4chlj9l432","image":"{{Connect.data.base64}}","isDeprecated":false,"rightColumn":61.0,"objectFit":"contain","widgetId":"27dpgapd7q","isVisible":true,"version":1.0,"parentId":"we6j3r2byy","renderMode":"CANVAS","isLoading":false,"mobileTopRow":40.0,"maxZoomLevel":1.0,"enableDownload":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":43.0,"enableRotation":false},{"boxShadow":"none","mobileBottomRow":4.0,"widgetName":"IconButton1","onClick":"{{closeModal('ModalQrcode');\nfetch_Instances.run()}}","buttonColor":"{{appsmith.theme.colors.primaryColor}}","displayName":"Icon button","iconSVG":"/static/media/icon.80fc7466c0d7181ec0271de7fda795ec.svg","searchTags":["click","submit"],"topRow":0.0,"bottomRow":4.0,"type":"ICON_BUTTON_WIDGET","hideCard":false,"mobileRightColumn":64.0,"animateLoading":true,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":58.0,"dynamicBindingPathList":[{"key":"buttonColor"},{"key":"borderRadius"}],"iconSize":24.0,"isDisabled":false,"key":"pezy0hb491","isDeprecated":false,"rightColumn":64.0,"iconName":"cross","widgetId":"i1dw369dch","minWidth":50.0,"isVisible":true,"version":1.0,"parentId":"we6j3r2byy","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"hug","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":58.0,"buttonVariant":"TERTIARY"},{"mobileBottomRow":5.0,"widgetName":"Text1","displayName":"Text","iconSVG":"/static/media/icon.c3b6033f570046f8c6288d911333a827.svg","searchTags":["typography","paragraph","label"],"topRow":1.0,"bottomRow":5.0,"type":"TEXT_WIDGET","hideCard":false,"mobileRightColumn":41.0,"animateLoading":true,"overflow":"NONE","fontFamily":"{{appsmith.theme.fontFamily.appFont}}","dynamicTriggerPathList":[],"leftColumn":1.0,"dynamicBindingPathList":[{"key":"fontFamily"}],"shouldTruncate":false,"truncateButtonColor":"{{appsmith.theme.colors.primaryColor}}","text":"Qrcode","key":"9s8f10sepn","isDeprecated":false,"rightColumn":41.0,"textAlign":"LEFT","dynamicHeight":"AUTO_HEIGHT","widgetId":"mg2cqsi9fn","minWidth":450.0,"isVisible":true,"fontStyle":"BOLD","textColor":"#231F20","version":1.0,"parentId":"we6j3r2byy","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"fill","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":1.0,"maxDynamicHeight":9000.0,"fontSize":"1.25rem","minDynamicHeight":4.0}],"isDisabled":false,"key":"e8r23nd8j4","isDeprecated":false,"rightColumn":283.875,"detachFromLayout":true,"widgetId":"we6j3r2byy","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"ljwryrjhy7","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"g8xx6ocuvi","height":450.0,"isDeprecated":false,"rightColumn":45.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"ljwryrjhy7","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":50.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":21.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0},{"resetFormOnClick":false,"boxShadow":"none","mobileBottomRow":5.0,"widgetName":"BtnConfig","onClick":"{{showModal('ModalConfig');}}","buttonColor":"#2563eb","dynamicPropertyPathList":[],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":1.0,"bottomRow":5.0,"parentRowSpace":10.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":30.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":1.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"text":"Access","isDisabled":false,"key":"crzwqv3pdr","isDeprecated":false,"rightColumn":7.0,"isDefaultClickDisabled":true,"iconName":"user","widgetId":"uegjpy37i6","minWidth":120.0,"isVisible":true,"recaptchaType":"V3","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"hug","disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":14.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"boxShadow":"none","mobileBottomRow":73.0,"widgetName":"ModalConfig","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":49.0,"bottomRow":30.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":25.0,"minHeight":300.0,"animateLoading":true,"parentColumnSpace":11.75,"leftColumn":1.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas2","displayName":"Canvas","topRow":0.0,"bottomRow":300.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":300.0,"mobileRightColumn":282.0,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","mobileBottomRow":84.0,"borderColor":"#E0DEDE","widgetName":"FormConfig","isCanvas":true,"displayName":"Form","iconSVG":"/static/media/icon.5d6d2ac5cb1aa68bcd9b14f11c56b44a.svg","searchTags":["group"],"topRow":0.0,"bottomRow":28.0,"parentRowSpace":10.0,"type":"FORM_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":25.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[],"leftColumn":1.0,"dynamicBindingPathList":[],"children":[{"mobileBottomRow":400.0,"widgetName":"Canvas2Copy","displayName":"Canvas","topRow":0.0,"bottomRow":280.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":false,"hideCard":true,"minHeight":400.0,"mobileRightColumn":283.875,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"mobileBottomRow":5.0,"widgetName":"Text2","displayName":"Text","iconSVG":"/static/media/icon.c3b6033f570046f8c6288d911333a827.svg","searchTags":["typography","paragraph","label"],"topRow":1.0,"bottomRow":5.0,"type":"TEXT_WIDGET","hideCard":false,"mobileRightColumn":25.5,"animateLoading":true,"overflow":"NONE","fontFamily":"{{appsmith.theme.fontFamily.appFont}}","dynamicTriggerPathList":[],"leftColumn":1.5,"dynamicBindingPathList":[{"key":"fontFamily"}],"shouldTruncate":false,"truncateButtonColor":"{{appsmith.theme.colors.primaryColor}}","text":"Access Credentials","key":"9s8f10sepn","isDeprecated":false,"rightColumn":25.5,"textAlign":"LEFT","dynamicHeight":"AUTO_HEIGHT","widgetId":"tps5rw2lk9","minWidth":450.0,"isVisible":true,"fontStyle":"BOLD","textColor":"#231F20","version":1.0,"parentId":"lrtvcpswru","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"fill","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":1.5,"maxDynamicHeight":9000.0,"fontSize":"1.25rem","minDynamicHeight":4.0},{"resetFormOnClick":true,"boxShadow":"none","mobileBottomRow":37.0,"widgetName":"Button1","onClick":"{{storeValue('api_url', FormConfig.data.InputApiUrl);\nstoreValue('api_key', FormConfig.data.InputGlobalApiKey);\nfetch_Instances.run().then(() => {\n showAlert('successful login', 'success');\n}).catch(() => {\n showAlert('Could not load instances', 'error');\n});\ncloseModal('ModalConfig').then(() => {});}}","buttonColor":"{{appsmith.theme.colors.primaryColor}}","dynamicPropertyPathList":[{"key":"isDisabled"}],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":22.0,"bottomRow":26.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":62.0,"animateLoading":true,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":51.0,"dynamicBindingPathList":[{"key":"buttonColor"},{"key":"borderRadius"}],"text":"Login","isDisabled":"","key":"crzwqv3pdr","isDeprecated":false,"rightColumn":63.0,"isDefaultClickDisabled":true,"iconName":"log-in","widgetId":"gzxvnsxk0y","minWidth":120.0,"isVisible":true,"recaptchaType":"V3","version":1.0,"parentId":"lrtvcpswru","renderMode":"CANVAS","isLoading":false,"mobileTopRow":33.0,"responsiveBehavior":"hug","disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":46.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"resetFormOnClick":true,"boxShadow":"none","mobileBottomRow":37.0,"widgetName":"Button1Copy","onClick":"{{removeValue('api_url');\nremoveValue('api_key').then(() => {\n showAlert('successful logout', 'success');\n});}}","buttonColor":"#dc2626","dynamicPropertyPathList":[{"key":"isDisabled"}],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":21.0,"bottomRow":25.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":62.0,"animateLoading":true,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":2.0,"dynamicBindingPathList":[{"key":"isDisabled"},{"key":"borderRadius"}],"text":"Logout","isDisabled":"{{!appsmith.store.api_key && !appsmith.store.api_url ? true : false}}","key":"crzwqv3pdr","isDeprecated":false,"rightColumn":14.0,"isDefaultClickDisabled":true,"iconName":"log-out","widgetId":"f2i8tsbgx1","minWidth":120.0,"isVisible":true,"recaptchaType":"V3","version":1.0,"parentId":"lrtvcpswru","renderMode":"CANVAS","isLoading":false,"mobileTopRow":33.0,"responsiveBehavior":"hug","disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":46.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"boxShadow":"none","iconSVG":"/static/media/icon.d0ce957b6c4640f8a7418ce846ee200e.svg","topRow":6.0,"labelWidth":5.0,"type":"INPUT_WIDGET_V2","animateLoading":true,"resetOnSubmit":true,"leftColumn":2.0,"dynamicBindingPathList":[{"key":"defaultText"},{"key":"accentColor"},{"key":"borderRadius"}],"labelStyle":"","inputType":"TEXT","placeholderText":"","isDisabled":false,"isRequired":true,"dynamicHeight":"FIXED","accentColor":"{{appsmith.theme.colors.primaryColor}}","showStepArrows":false,"isVisible":true,"version":2.0,"isLoading":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileBottomRow":13.0,"widgetName":"InputApiUrl","displayName":"Input","searchTags":["form","text input","number","textarea"],"bottomRow":13.0,"parentRowSpace":10.0,"autoFocus":false,"hideCard":false,"mobileRightColumn":22.0,"parentColumnSpace":5.047119140625,"dynamicTriggerPathList":[],"labelPosition":"Top","key":"r1hfat3ouf","labelTextSize":"0.875rem","isDeprecated":false,"rightColumn":63.0,"widgetId":"spgryrb5ao","minWidth":450.0,"label":"API URL","parentId":"lrtvcpswru","labelAlignment":"left","renderMode":"CANVAS","mobileTopRow":6.0,"responsiveBehavior":"fill","mobileLeftColumn":2.0,"maxDynamicHeight":9000.0,"isSpellCheck":false,"iconAlign":"left","defaultText":"{{appsmith.store.api_url || ''}}","minDynamicHeight":4.0},{"boxShadow":"none","iconSVG":"/static/media/icon.d0ce957b6c4640f8a7418ce846ee200e.svg","topRow":14.0,"labelWidth":5.0,"type":"INPUT_WIDGET_V2","animateLoading":true,"resetOnSubmit":true,"leftColumn":2.0,"dynamicBindingPathList":[{"key":"defaultText"},{"key":"accentColor"},{"key":"borderRadius"}],"labelStyle":"","inputType":"PASSWORD","isDisabled":false,"isRequired":true,"dynamicHeight":"FIXED","accentColor":"{{appsmith.theme.colors.primaryColor}}","showStepArrows":false,"isVisible":true,"version":2.0,"isLoading":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileBottomRow":13.0,"widgetName":"InputGlobalApiKey","displayName":"Input","searchTags":["form","text input","number","textarea"],"bottomRow":21.0,"parentRowSpace":10.0,"autoFocus":false,"hideCard":false,"mobileRightColumn":22.0,"parentColumnSpace":5.047119140625,"dynamicTriggerPathList":[],"labelPosition":"Top","key":"r1hfat3ouf","labelTextSize":"0.875rem","isDeprecated":false,"rightColumn":63.0,"widgetId":"v2vedr13py","minWidth":450.0,"label":"GLOBAL API KEY","parentId":"lrtvcpswru","labelAlignment":"left","renderMode":"CANVAS","mobileTopRow":6.0,"responsiveBehavior":"fill","mobileLeftColumn":2.0,"maxDynamicHeight":9000.0,"shouldAllowAutofill":true,"iconAlign":"left","defaultText":"{{appsmith.store.api_key || ''}}","minDynamicHeight":4.0},{"boxShadow":"none","mobileBottomRow":4.0,"widgetName":"IconButton2","onClick":"{{closeModal('ModalConfig');}}","buttonColor":"{{appsmith.theme.colors.primaryColor}}","displayName":"Icon button","iconSVG":"/static/media/icon.80fc7466c0d7181ec0271de7fda795ec.svg","searchTags":["click","submit"],"topRow":0.0,"bottomRow":4.0,"parentRowSpace":10.0,"type":"ICON_BUTTON_WIDGET","hideCard":false,"mobileRightColumn":64.0,"animateLoading":true,"parentColumnSpace":9.072265625,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":60.0,"dynamicBindingPathList":[{"key":"buttonColor"},{"key":"borderRadius"}],"isDisabled":false,"key":"pezy0hb491","isDeprecated":false,"rightColumn":64.0,"iconName":"cross","widgetId":"oaouelmhi1","minWidth":50.0,"isVisible":true,"version":1.0,"parentId":"lrtvcpswru","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"hug","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":60.0,"buttonVariant":"TERTIARY"}],"key":"e8r23nd8j4","isDeprecated":false,"rightColumn":283.875,"detachFromLayout":true,"widgetId":"lrtvcpswru","containerStyle":"none","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"h97rbttd5c","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"borderWidth":"0","positioning":"fixed","key":"dtzd07zsya","backgroundColor":"#FFFFFF","isDeprecated":false,"rightColumn":63.0,"dynamicHeight":"AUTO_HEIGHT","widgetId":"h97rbttd5c","minWidth":450.0,"isVisible":true,"parentId":"es5gsctogb","renderMode":"CANVAS","isLoading":false,"mobileTopRow":44.0,"responsiveBehavior":"fill","originalTopRow":0.0,"borderRadius":"0.375rem","mobileLeftColumn":1.0,"maxDynamicHeight":9000.0,"originalBottomRow":28.0,"minDynamicHeight":10.0}],"isDisabled":false,"key":"e8r23nd8j4","isDeprecated":false,"rightColumn":282.0,"detachFromLayout":true,"widgetId":"es5gsctogb","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"gneh33z88k","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"g8xx6ocuvi","height":300.0,"isDeprecated":false,"rightColumn":25.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"gneh33z88k","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":49.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":1.0,"maxDynamicHeight":9000.0,"width":632.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":66.0,"widgetName":"ModalInstance","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":42.0,"bottomRow":1892.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":37.0,"minHeight":1850.0,"animateLoading":true,"parentColumnSpace":11.828125,"leftColumn":13.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas3","displayName":"Canvas","topRow":0.0,"bottomRow":1850.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":1140.0,"mobileRightColumn":283.875,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","mobileBottomRow":4.0,"widgetName":"IconButton3Copy","onClick":"{{closeModal('ModalInstance');}}","buttonColor":"{{appsmith.theme.colors.primaryColor}}","displayName":"Icon button","iconSVG":"/static/media/icon.80fc7466c0d7181ec0271de7fda795ec.svg","searchTags":["click","submit"],"topRow":0.0,"bottomRow":4.0,"type":"ICON_BUTTON_WIDGET","hideCard":false,"mobileRightColumn":64.0,"animateLoading":true,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":57.0,"dynamicBindingPathList":[{"key":"buttonColor"},{"key":"borderRadius"}],"iconSize":24.0,"isDisabled":false,"key":"mr6bto7c8j","isDeprecated":false,"rightColumn":63.0,"iconName":"cross","widgetId":"xofakp4har","minWidth":50.0,"isVisible":true,"version":1.0,"parentId":"esgwuzqcwt","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"hug","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":58.0,"buttonVariant":"TERTIARY"},{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Create_Instance.run().then(() => {\n showAlert('Instance created successfully', 'success');\n}).catch(() => {\n showAlert('Error creating instance', 'error');\n});\nfetch_Instances.run();\ncloseModal('ModalInstance');}}","topRow":4.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"resetButtonStyles.buttonColor"},{"key":"schema.__root_schema__.defaultValue"},{"key":"schema.__root_schema__.borderRadius"},{"key":"schema.__root_schema__.children.webhook.defaultValue"},{"key":"schema.__root_schema__.children.webhook.borderRadius"},{"key":"schema.__root_schema__.cellBorderRadius"},{"key":"schema.__root_schema__.children.instance.defaultValue"},{"key":"schema.__root_schema__.children.instance.borderRadius"},{"key":"schema.__root_schema__.children.instance.cellBorderRadius"},{"key":"schema.__root_schema__.children.instance.children.instanceName.defaultValue"},{"key":"schema.__root_schema__.children.instance.children.instanceName.accentColor"},{"key":"schema.__root_schema__.children.instance.children.instanceName.borderRadius"},{"key":"schema.__root_schema__.children.instance.children.token.defaultValue"},{"key":"schema.__root_schema__.children.instance.children.token.accentColor"},{"key":"schema.__root_schema__.children.instance.children.token.borderRadius"},{"key":"schema.__root_schema__.children.webhook.cellBorderRadius"},{"key":"schema.__root_schema__.children.webhook.children.webhook.defaultValue"},{"key":"schema.__root_schema__.children.webhook.children.webhook.accentColor"},{"key":"schema.__root_schema__.children.webhook.children.webhook.borderRadius"},{"key":"schema.__root_schema__.children.webhook.children.events.defaultValue"},{"key":"schema.__root_schema__.children.webhook.children.events.accentColor"},{"key":"schema.__root_schema__.children.webhook.children.events.borderRadius"},{"key":"schema.__root_schema__.children.webhook.children.webhook_by_events.defaultValue"},{"key":"schema.__root_schema__.children.webhook.children.webhook_by_events.accentColor"},{"key":"schema.__root_schema__.children.settings.defaultValue"},{"key":"schema.__root_schema__.children.settings.borderRadius"},{"key":"schema.__root_schema__.children.settings.cellBorderRadius"},{"key":"schema.__root_schema__.children.settings.children.reject_call.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.reject_call.accentColor"},{"key":"schema.__root_schema__.children.settings.children.msg_call.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.msg_call.accentColor"},{"key":"schema.__root_schema__.children.settings.children.msg_call.borderRadius"},{"key":"schema.__root_schema__.children.settings.children.groups_ignore.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.groups_ignore.accentColor"},{"key":"schema.__root_schema__.children.settings.children.always_online.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.always_online.accentColor"},{"key":"schema.__root_schema__.children.settings.children.read_messages.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.read_messages.accentColor"},{"key":"schema.__root_schema__.children.settings.children.read_status.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.read_status.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.borderRadius"},{"key":"schema.__root_schema__.children.chatwoot.cellBorderRadius"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_account_id.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_account_id.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_account_id.borderRadius"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_token.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_token.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_token.borderRadius"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_url.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_url.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_url.borderRadius"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_sign_msg.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_reopen_conversation.accentColor"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_conversation_pending.accentColor"},{"key":"schema.__root_schema__.children.instance.children.qrcode.defaultValue"},{"key":"schema.__root_schema__.children.instance.children.qrcode.accentColor"},{"key":"schema.__root_schema__.children.websocket.defaultValue"},{"key":"schema.__root_schema__.children.websocket.borderRadius"},{"key":"schema.__root_schema__.children.websocket.cellBorderRadius"},{"key":"schema.__root_schema__.children.websocket.children.websocket_enabled.defaultValue"},{"key":"schema.__root_schema__.children.websocket.children.websocket_enabled.accentColor"},{"key":"schema.__root_schema__.children.websocket.children.websocket_events.defaultValue"},{"key":"schema.__root_schema__.children.websocket.children.websocket_events.accentColor"},{"key":"schema.__root_schema__.children.websocket.children.websocket_events.borderRadius"},{"key":"schema.__root_schema__.children.rabbitmq.defaultValue"},{"key":"schema.__root_schema__.children.rabbitmq.borderRadius"},{"key":"schema.__root_schema__.children.rabbitmq.cellBorderRadius"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_enabled.defaultValue"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_enabled.accentColor"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_events.defaultValue"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_events.accentColor"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_events.borderRadius"}],"showReset":true,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY","iconAlign":"left"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Create","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":183.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"webhook":{"children":{"webhook":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook.webhook))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"webhook","identifier":"webhook","position":0.0,"originalIdentifier":"webhook","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Webhook"},"events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook.events))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Multiselect","sourceData":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL","NEW_JWT_TOKEN"],"isCustomField":false,"accessor":"events","identifier":"events","position":2.0,"originalIdentifier":"events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"APPLICATION_STARTUP\",\n \"value\": \"APPLICATION_STARTUP\"\n },\n {\n \"label\": \"QRCODE_UPDATED\",\n \"value\": \"QRCODE_UPDATED\"\n },\n {\n \"label\": \"MESSAGES_SET\",\n \"value\": \"MESSAGES_SET\"\n },\n {\n \"label\": \"MESSAGES_UPSERT\",\n \"value\": \"MESSAGES_UPSERT\"\n },\n {\n \"label\": \"MESSAGES_UPDATE\",\n \"value\": \"MESSAGES_UPDATE\"\n },\n {\n \"label\": \"MESSAGES_DELETE\",\n \"value\": \"MESSAGES_DELETE\"\n },\n {\n \"label\": \"SEND_MESSAGE\",\n \"value\": \"SEND_MESSAGE\"\n },\n {\n \"label\": \"CONTACTS_SET\",\n \"value\": \"CONTACTS_SET\"\n },\n {\n \"label\": \"CONTACTS_UPSERT\",\n \"value\": \"CONTACTS_UPSERT\"\n },\n {\n \"label\": \"CONTACTS_UPDATE\",\n \"value\": \"CONTACTS_UPDATE\"\n },\n {\n \"label\": \"PRESENCE_UPDATE\",\n \"value\": \"PRESENCE_UPDATE\"\n },\n {\n \"label\": \"CHATS_SET\",\n \"value\": \"CHATS_SET\"\n },\n {\n \"label\": \"CHATS_UPSERT\",\n \"value\": \"CHATS_UPSERT\"\n },\n {\n \"label\": \"CHATS_UPDATE\",\n \"value\": \"CHATS_UPDATE\"\n },\n {\n \"label\": \"CHATS_DELETE\",\n \"value\": \"CHATS_DELETE\"\n },\n {\n \"label\": \"GROUPS_UPSERT\",\n \"value\": \"GROUPS_UPSERT\"\n },\n {\n \"label\": \"GROUP_UPDATE\",\n \"value\": \"GROUP_UPDATE\"\n },\n {\n \"label\": \"GROUP_PARTICIPANTS_UPDATE\",\n \"value\": \"GROUP_PARTICIPANTS_UPDATE\"\n },\n {\n \"label\": \"CONNECTION_UPDATE\",\n \"value\": \"CONNECTION_UPDATE\"\n },\n {\n \"label\": \"CALL\",\n \"value\": \"CALL\"\n },\n {\n \"label\": \"NEW_JWT_TOKEN\",\n \"value\": \"NEW_JWT_TOKEN\"\n }\n]"},"webhook_by_events":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook.webhook_by_events))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"webhook_by_events","identifier":"webhook_by_events","position":2.0,"originalIdentifier":"webhook_by_events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Webhook By Events"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{},"isCustomField":false,"accessor":"webhook","identifier":"webhook","position":1.0,"originalIdentifier":"webhook","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Webhook","labelStyle":"BOLD"},"instance":{"children":{"instanceName":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.instance.instanceName))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"instanceName","identifier":"instanceName","position":0.0,"originalIdentifier":"instanceName","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Instance Name"},"token":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.instance.token))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"token","identifier":"token","position":1.0,"originalIdentifier":"token","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Token"},"qrcode":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.instance.qrcode))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"qrcode","identifier":"qrcode","position":2.0,"originalIdentifier":"qrcode","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Qrcode"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.instance))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{},"isCustomField":false,"accessor":"instance","identifier":"instance","position":0.0,"originalIdentifier":"instance","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Instance","labelStyle":"BOLD"},"settings":{"children":{"reject_call":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.reject_call))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"reject_call","identifier":"reject_call","position":0.0,"originalIdentifier":"reject_call","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Reject Call"},"msg_call":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.msg_call))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"msg_call","identifier":"msg_call","position":1.0,"originalIdentifier":"msg_call","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Msg Call"},"groups_ignore":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.groups_ignore))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"groups_ignore","identifier":"groups_ignore","position":2.0,"originalIdentifier":"groups_ignore","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Groups Ignore"},"always_online":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.always_online))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"always_online","identifier":"always_online","position":3.0,"originalIdentifier":"always_online","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Always Online"},"read_messages":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.read_messages))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"read_messages","identifier":"read_messages","position":4.0,"originalIdentifier":"read_messages","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Read Messages"},"read_status":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings.read_status))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"read_status","identifier":"read_status","position":5.0,"originalIdentifier":"read_status","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Read Status"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.settings))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{},"isCustomField":false,"accessor":"settings","identifier":"settings","position":2.0,"originalIdentifier":"settings","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Settings","labelStyle":"BOLD"},"chatwoot":{"children":{"chatwoot_account_id":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_account_id))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"chatwoot_account_id","identifier":"chatwoot_account_id","position":0.0,"originalIdentifier":"chatwoot_account_id","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Account Id"},"chatwoot_token":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_token))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Password Input","sourceData":"","isCustomField":false,"accessor":"chatwoot_token","identifier":"chatwoot_token","position":1.0,"originalIdentifier":"chatwoot_token","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Token","shouldAllowAutofill":true},"chatwoot_url":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_url))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"chatwoot_url","identifier":"chatwoot_url","position":2.0,"originalIdentifier":"chatwoot_url","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Url"},"chatwoot_sign_msg":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_sign_msg))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"chatwoot_sign_msg","identifier":"chatwoot_sign_msg","position":3.0,"originalIdentifier":"chatwoot_sign_msg","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Sign Msg"},"chatwoot_reopen_conversation":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_reopen_conversation))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"chatwoot_reopen_conversation","identifier":"chatwoot_reopen_conversation","position":4.0,"originalIdentifier":"chatwoot_reopen_conversation","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Reopen Conversation"},"chatwoot_conversation_pending":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot.chatwoot_conversation_pending))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"chatwoot_conversation_pending","identifier":"chatwoot_conversation_pending","position":5.0,"originalIdentifier":"chatwoot_conversation_pending","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Chatwoot Conversation Pending"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.chatwoot))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{},"isCustomField":false,"accessor":"chatwoot","identifier":"chatwoot","position":5.0,"originalIdentifier":"chatwoot","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Chatwoot","labelStyle":"BOLD"},"websocket":{"children":{"websocket_enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.websocket.websocket_enabled))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"websocket_enabled","identifier":"websocket_enabled","position":0.0,"originalIdentifier":"websocket_enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Websocket Enabled"},"websocket_events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.websocket.websocket_events))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Multiselect","sourceData":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL","NEW_JWT_TOKEN"],"isCustomField":false,"accessor":"websocket_events","identifier":"websocket_events","position":1.0,"originalIdentifier":"websocket_events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Websocket Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":[{"label":"Blue","value":"BLUE"},{"label":"Green","value":"GREEN"},{"label":"Red","value":"RED"}]}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.websocket))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{},"isCustomField":false,"accessor":"websocket","identifier":"websocket","position":3.0,"originalIdentifier":"websocket","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Websocket","labelStyle":"BOLD"},"rabbitmq":{"children":{"rabbitmq_enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.rabbitmq.rabbitmq_enabled))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"rabbitmq_enabled","identifier":"rabbitmq_enabled","position":1.0,"originalIdentifier":"rabbitmq_enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Rabbitmq Enabled"},"rabbitmq_events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.rabbitmq.rabbitmq_events))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Multiselect","sourceData":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL","NEW_JWT_TOKEN"],"isCustomField":false,"accessor":"rabbitmq_events","identifier":"rabbitmq_events","position":1.0,"originalIdentifier":"rabbitmq_events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Rabbitmq Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":[{"label":"Blue","value":"BLUE"},{"label":"Green","value":"GREEN"},{"label":"Red","value":"RED"}]}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.rabbitmq))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{"websocket_enabled":false,"websocket_events":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL","NEW_JWT_TOKEN"]},"isCustomField":false,"accessor":"rabbitmq","identifier":"rabbitmq","position":4.0,"originalIdentifier":"rabbitmq","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Rabbitmq","labelStyle":"BOLD"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","fieldType":"Object","sourceData":{"instanceName":"","token":"","webhook":"","webhook_by_events":false,"events":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL","NEW_JWT_TOKEN"],"reject_call":false,"msg_call":"","groups_ignore":false,"always_online":false,"read_messages":false,"read_status":false,"chatwoot_account_id":"","chatwoot_token":"","chatwoot_url":"","chatwoot_sign_msg":false,"chatwoot_reopen_conversation":false,"chatwoot_conversation_pending":false},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormInstance.sourceData, FormInstance.formData, FormInstance.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":85.0,"widgetName":"FormInstance","submitButtonStyles":{"buttonColor":"rgb(3, 179, 101)","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.webhook.children.webhook_by_events.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.reject_call.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.groups_ignore.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.always_online.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.read_messages.defaultValue"},{"key":"schema.__root_schema__.children.settings.children.read_status.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.chatwoot.children.chatwoot_conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.instance.children.qrcode.defaultValue"},{"key":"schema.__root_schema__.children.websocket.children.websocket_enabled.defaultValue"},{"key":"schema.__root_schema__.children.rabbitmq.children.rabbitmq_enabled.defaultValue"}],"displayName":"JSON Form","bottomRow":183.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"New Instance","hideCard":false,"mobileRightColumn":22.0,"shouldScrollContents":true,"parentColumnSpace":17.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n \"instance\": {\n\t\t\t\"instanceName\": \"\",\n \t\"token\": \"\",\n\t\t\t\"qrcode\": true\n\t\t},\n\t\t\"webhook\": {\n\t\t\t\"webhook\": \"\",\n\t\t\t\"events\": [\n\t\t\t\t\"APPLICATION_STARTUP\",\n\t\t\t\t\t\"QRCODE_UPDATED\",\n\t\t\t\t\t\"MESSAGES_SET\",\n\t\t\t\t\t\"MESSAGES_UPSERT\",\n\t\t\t\t\t\"MESSAGES_UPDATE\",\n\t\t\t\t\t\"MESSAGES_DELETE\",\n\t\t\t\t\t\"SEND_MESSAGE\",\n\t\t\t\t\t\"CONTACTS_SET\",\n\t\t\t\t\t\"CONTACTS_UPSERT\",\n\t\t\t\t\t\"CONTACTS_UPDATE\",\n\t\t\t\t\t\"PRESENCE_UPDATE\",\n\t\t\t\t\t\"CHATS_SET\",\n\t\t\t\t\t\"CHATS_UPSERT\",\n\t\t\t\t\t\"CHATS_UPDATE\",\n\t\t\t\t\t\"CHATS_DELETE\",\n\t\t\t\t\t\"GROUPS_UPSERT\",\n\t\t\t\t\t\"GROUP_UPDATE\",\n\t\t\t\t\t\"GROUP_PARTICIPANTS_UPDATE\",\n\t\t\t\t\t\"CONNECTION_UPDATE\",\n\t\t\t\t\t\"CALL\",\n\t\t\t\t\t\"NEW_JWT_TOKEN\"\n\t\t\t],\n\t\t\t\"webhook_by_events\": false\n\t\t},\n \"settings\": {\n\t\t\t\"reject_call\": false,\n\t\t\t\"msg_call\": \"\",\n\t\t\t\"groups_ignore\": false,\n\t\t\t\"always_online\": false,\n\t\t\t\"read_messages\": false,\n\t\t\t\"read_status\": false\n\t\t},\n\t\t\"websocket\": {\n\t\t\t\"websocket_enabled\": false,\n\t\t\t\"websocket_events\": [\n\t\t\t\t\"APPLICATION_STARTUP\",\n\t\t\t\t\t\"QRCODE_UPDATED\",\n\t\t\t\t\t\"MESSAGES_SET\",\n\t\t\t\t\t\"MESSAGES_UPSERT\",\n\t\t\t\t\t\"MESSAGES_UPDATE\",\n\t\t\t\t\t\"MESSAGES_DELETE\",\n\t\t\t\t\t\"SEND_MESSAGE\",\n\t\t\t\t\t\"CONTACTS_SET\",\n\t\t\t\t\t\"CONTACTS_UPSERT\",\n\t\t\t\t\t\"CONTACTS_UPDATE\",\n\t\t\t\t\t\"PRESENCE_UPDATE\",\n\t\t\t\t\t\"CHATS_SET\",\n\t\t\t\t\t\"CHATS_UPSERT\",\n\t\t\t\t\t\"CHATS_UPDATE\",\n\t\t\t\t\t\"CHATS_DELETE\",\n\t\t\t\t\t\"GROUPS_UPSERT\",\n\t\t\t\t\t\"GROUP_UPDATE\",\n\t\t\t\t\t\"GROUP_PARTICIPANTS_UPDATE\",\n\t\t\t\t\t\"CONNECTION_UPDATE\",\n\t\t\t\t\t\"CALL\",\n\t\t\t\t\t\"NEW_JWT_TOKEN\"\n\t\t\t]\n\t\t},\n\t\t\"rabbitmq\": {\n\t\t\t\"rabbitmq_enabled\": false,\n\t\t\t\"rabbitmq_events\": [\n\t\t\t\t\"APPLICATION_STARTUP\",\n\t\t\t\t\t\"QRCODE_UPDATED\",\n\t\t\t\t\t\"MESSAGES_SET\",\n\t\t\t\t\t\"MESSAGES_UPSERT\",\n\t\t\t\t\t\"MESSAGES_UPDATE\",\n\t\t\t\t\t\"MESSAGES_DELETE\",\n\t\t\t\t\t\"SEND_MESSAGE\",\n\t\t\t\t\t\"CONTACTS_SET\",\n\t\t\t\t\t\"CONTACTS_UPSERT\",\n\t\t\t\t\t\"CONTACTS_UPDATE\",\n\t\t\t\t\t\"PRESENCE_UPDATE\",\n\t\t\t\t\t\"CHATS_SET\",\n\t\t\t\t\t\"CHATS_UPSERT\",\n\t\t\t\t\t\"CHATS_UPDATE\",\n\t\t\t\t\t\"CHATS_DELETE\",\n\t\t\t\t\t\"GROUPS_UPSERT\",\n\t\t\t\t\t\"GROUP_UPDATE\",\n\t\t\t\t\t\"GROUP_PARTICIPANTS_UPDATE\",\n\t\t\t\t\t\"CONNECTION_UPDATE\",\n\t\t\t\t\t\"CALL\",\n\t\t\t\t\t\"NEW_JWT_TOKEN\"\n\t\t\t]\n\t\t},\n \"chatwoot\": {\n\t\t\t\"chatwoot_account_id\": \"\",\n\t\t\t\"chatwoot_token\": \"\",\n\t\t\t\"chatwoot_url\": \"\",\n\t\t\t\"chatwoot_sign_msg\": false,\n\t\t\t\"chatwoot_reopen_conversation\": false,\n\t\t\t\"chatwoot_conversation_pending\": false\n\t\t}\n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"o0v8ypwnya","minWidth":450.0,"parentId":"esgwuzqcwt","renderMode":"CANVAS","mobileTopRow":44.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":4.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"w17ra2a85u","isDeprecated":false,"rightColumn":283.875,"detachFromLayout":true,"widgetId":"esgwuzqcwt","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"rnttu90jzr","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"bkvkzj4d20","height":1850.0,"isDeprecated":false,"rightColumn":37.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"rnttu90jzr","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":42.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":13.0,"maxDynamicHeight":9000.0,"width":628.0,"minDynamicHeight":24.0},{"resetFormOnClick":false,"boxShadow":"none","mobileBottomRow":5.0,"widgetName":"ButtonRefreshData","onClick":"{{fetch_Instances.run()}}","buttonColor":"#60a5fa","dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":1.0,"bottomRow":5.0,"parentRowSpace":10.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":35.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":19.0,"dynamicBindingPathList":[{"key":"isVisible"},{"key":"borderRadius"}],"text":"","isDisabled":false,"key":"k10nyfsas3","isDeprecated":false,"rightColumn":24.0,"isDefaultClickDisabled":true,"iconName":"refresh","widgetId":"dn1ehe3gvu","minWidth":120.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","recaptchaType":"V3","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"hug","disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":19.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"boxShadow":"none","mobileBottomRow":5.0,"widgetName":"ButtonGroup1","isCanvas":false,"dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Button Group","iconSVG":"/static/media/icon.7c22979bacc83c8d84aedf56ea6c2022.svg","searchTags":["click","submit"],"topRow":1.0,"bottomRow":5.0,"parentRowSpace":10.0,"groupButtons":{"groupButton1":{"label":"Connect","iconName":"camera","id":"groupButton1","widgetId":"","buttonType":"SIMPLE","placement":"CENTER","isVisible":true,"isDisabled":false,"index":0.0,"menuItems":{},"buttonColor":"#16a34a","onClick":"{{Connect.run();\nfetch_Instances.run();\nshowModal('ModalQrcode');}}"},"groupButton2":{"label":"Restart","iconName":"reset","id":"groupButton2","buttonType":"SIMPLE","placement":"CENTER","widgetId":"","isVisible":true,"isDisabled":false,"index":1.0,"menuItems":{},"buttonColor":"#2563eb","onClick":"{{Restart.run().then(() => {\n showAlert('Instance restarted successfully', 'success');\n}).catch(() => {\n showAlert('Error restarting instance', 'error');\n});\nfetch_Instances.run();}}"},"groupButton3":{"label":"Logout","iconName":"log-in","id":"groupButton3","buttonType":"SIMPLE","placement":"CENTER","widgetId":"","isVisible":true,"isDisabled":false,"index":2.0,"menuItems":{"menuItem1":{"label":"First Option","backgroundColor":"#FFFFFF","id":"menuItem1","widgetId":"","onClick":"","isVisible":true,"isDisabled":false,"index":0.0},"menuItem2":{"label":"Second Option","backgroundColor":"#FFFFFF","id":"menuItem2","widgetId":"","onClick":"","isVisible":true,"isDisabled":false,"index":1.0},"menuItem3":{"label":"Delete","iconName":"trash","iconColor":"#FFFFFF","iconAlign":"right","textColor":"#FFFFFF","backgroundColor":"#DD4B34","id":"menuItem3","widgetId":"","onClick":"","isVisible":true,"isDisabled":false,"index":2.0}},"buttonColor":"#a16207","onClick":"{{Logout.run().then(() => {\n showAlert('Instance logout successfully', 'success');\n}).catch(() => {\n showAlert('Error logout instance', 'error');\n});\nfetch_Instances.run();}}"},"groupButtonmghcs8rd4g":{"id":"groupButtonmghcs8rd4g","index":3.0,"label":"Delete","menuItems":{},"buttonType":"SIMPLE","placement":"CENTER","widgetId":"v0qkg2pjo2","isDisabled":false,"isVisible":true,"buttonColor":"#ef4444","iconName":"cross","onClick":"{{Delete.run().then(() => {\n showAlert('Instance deleted successfully', 'success');\n}).catch(() => {\n showAlert('Error deleting instance', 'error');\n});\nfetch_Instances.run();}}"}},"type":"BUTTON_GROUP_WIDGET","hideCard":false,"mobileRightColumn":51.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[{"key":"groupButtons.groupButton1.onClick"},{"key":"groupButtons.groupButton2.onClick"},{"key":"groupButtons.groupButton3.onClick"},{"key":"groupButtons.groupButtonmghcs8rd4g.onClick"}],"leftColumn":27.0,"dynamicBindingPathList":[{"key":"isVisible"},{"key":"borderRadius"}],"isDisabled":false,"key":"za8m3k8x7w","orientation":"horizontal","isDeprecated":false,"rightColumn":63.0,"widgetId":"2s6fqi483g","minWidth":450.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":1.0,"responsiveBehavior":"fill","childStylesheet":{"button":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}"}},"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":27.0,"buttonVariant":"PRIMARY"},{"boxShadow":"none","mobileBottomRow":18.0,"widgetName":"ProfilePicture","dynamicPropertyPathList":[{"key":"isVisible"},{"key":"borderRadius"}],"displayName":"Image","iconSVG":"/static/media/icon.30c8cbd442cce232b01ba2d434c53a53.svg","topRow":6.0,"bottomRow":28.0,"parentRowSpace":10.0,"type":"IMAGE_WIDGET","hideCard":false,"mobileRightColumn":13.0,"animateLoading":true,"parentColumnSpace":11.828125,"dynamicTriggerPathList":[],"imageShape":"RECTANGLE","leftColumn":1.0,"dynamicBindingPathList":[{"key":"image"},{"key":"isVisible"}],"defaultImage":"https://th.bing.com/th/id/OIP.ruat7whad9-kcI8_1KH_tQHaGI?pid=ImgDet&rs=1","key":"bl30j21wwb","image":"{{TableInstances.selectedRow.profilePictureUrl}}","isDeprecated":false,"rightColumn":13.0,"objectFit":"contain","widgetId":"1sjznr31jo","isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":6.0,"maxZoomLevel":1.0,"enableDownload":false,"borderRadius":"0.335rem","mobileLeftColumn":1.0,"enableRotation":false},{"mobileBottomRow":22.0,"widgetName":"Text4","dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Text","iconSVG":"/static/media/icon.c3b6033f570046f8c6288d911333a827.svg","searchTags":["typography","paragraph","label"],"topRow":40.0,"bottomRow":48.0,"parentRowSpace":10.0,"type":"TEXT_WIDGET","hideCard":false,"mobileRightColumn":11.0,"animateLoading":true,"overflow":"NONE","fontFamily":"{{appsmith.theme.fontFamily.appFont}}","parentColumnSpace":11.828125,"dynamicTriggerPathList":[],"leftColumn":1.0,"dynamicBindingPathList":[{"key":"text"},{"key":"isVisible"},{"key":"fontFamily"}],"shouldTruncate":false,"truncateButtonColor":"{{appsmith.theme.colors.primaryColor}}","text":"{{TableInstances.selectedRow.profileName || ''}}\n\n{{TableInstances.selectedRow.profileStatus || ''}}","key":"gqt8t28m33","isDeprecated":false,"rightColumn":13.0,"textAlign":"CENTER","dynamicHeight":"AUTO_HEIGHT","widgetId":"0c356c66hp","minWidth":450.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","fontStyle":"BOLD","textColor":"#231F20","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":18.0,"responsiveBehavior":"fill","originalTopRow":40.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"originalBottomRow":48.0,"fontSize":"0.875rem","minDynamicHeight":4.0},{"mobileBottomRow":41.0,"widgetName":"Text5","dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Text","iconSVG":"/static/media/icon.c3b6033f570046f8c6288d911333a827.svg","searchTags":["typography","paragraph","label"],"topRow":32.0,"bottomRow":40.0,"parentRowSpace":10.0,"type":"TEXT_WIDGET","hideCard":false,"mobileRightColumn":9.0,"animateLoading":true,"overflow":"NONE","fontFamily":"{{appsmith.theme.fontFamily.appFont}}","parentColumnSpace":11.75,"dynamicTriggerPathList":[],"leftColumn":1.0,"dynamicBindingPathList":[{"key":"text"},{"key":"isVisible"},{"key":"fontFamily"}],"shouldTruncate":false,"truncateButtonColor":"{{appsmith.theme.colors.primaryColor}}","text":"{{TableInstances.selectedRow.instance || ''}}","key":"gqt8t28m33","isDeprecated":false,"rightColumn":13.0,"textAlign":"CENTER","dynamicHeight":"AUTO_HEIGHT","widgetId":"5qg2iscn1l","minWidth":450.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? true : false}}","fontStyle":"BOLD","textColor":"#231F20","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":37.0,"responsiveBehavior":"fill","originalTopRow":32.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"originalBottomRow":40.0,"fontSize":"1.25rem","minDynamicHeight":4.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalWebhook","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":46.0,"bottomRow":43.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":430.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4","displayName":"Canvas","topRow":0.0,"bottomRow":430.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":240.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Webhook.run().then(() => {\n showAlert('Webhook updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating webhook', 'error');\n});\ncloseModal('ModalWebhook');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"sourceData"},{"key":"schema.__root_schema__.children.events.borderRadius"},{"key":"schema.__root_schema__.children.events.defaultValue"},{"key":"schema.__root_schema__.children.url.accentColor"},{"key":"schema.__root_schema__.children.url.defaultValue"},{"key":"schema.__root_schema__.children.enabled.accentColor"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.webhook_by_events.accentColor"},{"key":"schema.__root_schema__.children.webhook_by_events.defaultValue"},{"key":"borderRadius"},{"key":"schema.__root_schema__.children.events.accentColor"},{"key":"schema.__root_schema__.children.url.borderRadius"},{"key":"submitButtonStyles.buttonColor"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":41.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"webhook_by_events":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook_by_events))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"webhook_by_events","identifier":"webhook_by_events","position":3.0,"originalIdentifier":"webhook_by_events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Webhook By Events"},"enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.enabled))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"enabled","identifier":"enabled","position":0.0,"originalIdentifier":"enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Enabled"},"url":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.url))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Text Input","sourceData":"https://webhook.site/06c7b29f-543b-49bc-b598-51bf99d08f6c","isCustomField":false,"accessor":"url","identifier":"url","position":1.0,"originalIdentifier":"url","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Url"},"events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.events))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Multiselect","sourceData":["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","CALL"],"isCustomField":false,"accessor":"events","identifier":"events","position":2.0,"originalIdentifier":"events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n\n {\n \"label\": \"APPLICATION_STARTUP\",\n \"value\": \"APPLICATION_STARTUP\"\n },\n {\n \"label\": \"QRCODE_UPDATED\",\n \"value\": \"QRCODE_UPDATED\"\n },\n {\n \"label\": \"MESSAGES_SET\",\n \"value\": \"MESSAGES_SET\"\n },\n {\n \"label\": \"MESSAGES_UPSERT\",\n \"value\": \"MESSAGES_UPSERT\"\n },\n {\n \"label\": \"MESSAGES_UPDATE\",\n \"value\": \"MESSAGES_UPDATE\"\n },\n {\n \"label\": \"MESSAGES_DELETE\",\n \"value\": \"MESSAGES_DELETE\"\n },\n {\n \"label\": \"SEND_MESSAGE\",\n \"value\": \"SEND_MESSAGE\"\n },\n {\n \"label\": \"CONTACTS_SET\",\n \"value\": \"CONTACTS_SET\"\n },\n {\n \"label\": \"CONTACTS_UPSERT\",\n \"value\": \"CONTACTS_UPSERT\"\n },\n {\n \"label\": \"CONTACTS_UPDATE\",\n \"value\": \"CONTACTS_UPDATE\"\n },\n {\n \"label\": \"PRESENCE_UPDATE\",\n \"value\": \"PRESENCE_UPDATE\"\n },\n {\n \"label\": \"CHATS_SET\",\n \"value\": \"CHATS_SET\"\n },\n {\n \"label\": \"CHATS_UPSERT\",\n \"value\": \"CHATS_UPSERT\"\n },\n {\n \"label\": \"CHATS_UPDATE\",\n \"value\": \"CHATS_UPDATE\"\n },\n {\n \"label\": \"CHATS_DELETE\",\n \"value\": \"CHATS_DELETE\"\n },\n {\n \"label\": \"GROUPS_UPSERT\",\n \"value\": \"GROUPS_UPSERT\"\n },\n {\n \"label\": \"GROUP_UPDATE\",\n \"value\": \"GROUP_UPDATE\"\n },\n {\n \"label\": \"GROUP_PARTICIPANTS_UPDATE\",\n \"value\": \"GROUP_PARTICIPANTS_UPDATE\"\n },\n {\n \"label\": \"CONNECTION_UPDATE\",\n \"value\": \"CONNECTION_UPDATE\"\n },\n {\n \"label\": \"CALL\",\n \"value\": \"CALL\"\n },\n {\n \"label\": \"NEW_JWT_TOKEN\",\n \"value\": \"NEW_JWT_TOKEN\"\n }\n]"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormWebhook","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.webhook_by_events.defaultValue"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.url.defaultValue"}],"displayName":"JSON Form","bottomRow":41.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Webhook","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"enabled\": {{Find_Webhook.data.enabled || false}},\n\t\"url\": {{Find_Webhook.data.url}},\n \"webhook_by_events\": {{Find_Webhook.data.webhook_by_events}},\n \"events\": {{Find_Webhook.data.events || false}} \n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"tb1ekur7fx","minWidth":450.0,"parentId":"mv02ta6pzr","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"mv02ta6pzr","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"0g8ql5hukz","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":430.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"0g8ql5hukz","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalWebsocket","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":42.0,"bottomRow":32.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":320.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4Copy1","displayName":"Canvas","topRow":0.0,"bottomRow":320.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":290.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Websocket.run().then(() => {\n showAlert('Websocket updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating websocket', 'error');\n});\ncloseModal('ModalWebsocket');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"sourceData"},{"key":"schema.__root_schema__.children.events.defaultValue"},{"key":"schema.__root_schema__.children.enabled.accentColor"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"borderRadius"},{"key":"schema.__root_schema__.children.events.accentColor"},{"key":"submitButtonStyles.buttonColor"},{"key":"schema.__root_schema__.children.events.borderRadius"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":30.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.enabled))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"enabled","identifier":"enabled","position":0.0,"originalIdentifier":"enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Enabled"},"events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.events))(FormWebsocket.sourceData, FormWebsocket.formData, FormWebsocket.fieldState)}}","fieldType":"Multiselect","sourceData":[],"isCustomField":false,"accessor":"events","identifier":"events","position":2.0,"originalIdentifier":"events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebsocket.sourceData, FormWebsocket.formData, FormWebsocket.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebsocket.sourceData, FormWebsocket.formData, FormWebsocket.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n\n {\n \"label\": \"APPLICATION_STARTUP\",\n \"value\": \"APPLICATION_STARTUP\"\n },\n {\n \"label\": \"QRCODE_UPDATED\",\n \"value\": \"QRCODE_UPDATED\"\n },\n {\n \"label\": \"MESSAGES_SET\",\n \"value\": \"MESSAGES_SET\"\n },\n {\n \"label\": \"MESSAGES_UPSERT\",\n \"value\": \"MESSAGES_UPSERT\"\n },\n {\n \"label\": \"MESSAGES_UPDATE\",\n \"value\": \"MESSAGES_UPDATE\"\n },\n {\n \"label\": \"MESSAGES_DELETE\",\n \"value\": \"MESSAGES_DELETE\"\n },\n {\n \"label\": \"SEND_MESSAGE\",\n \"value\": \"SEND_MESSAGE\"\n },\n {\n \"label\": \"CONTACTS_SET\",\n \"value\": \"CONTACTS_SET\"\n },\n {\n \"label\": \"CONTACTS_UPSERT\",\n \"value\": \"CONTACTS_UPSERT\"\n },\n {\n \"label\": \"CONTACTS_UPDATE\",\n \"value\": \"CONTACTS_UPDATE\"\n },\n {\n \"label\": \"PRESENCE_UPDATE\",\n \"value\": \"PRESENCE_UPDATE\"\n },\n {\n \"label\": \"CHATS_SET\",\n \"value\": \"CHATS_SET\"\n },\n {\n \"label\": \"CHATS_UPSERT\",\n \"value\": \"CHATS_UPSERT\"\n },\n {\n \"label\": \"CHATS_UPDATE\",\n \"value\": \"CHATS_UPDATE\"\n },\n {\n \"label\": \"CHATS_DELETE\",\n \"value\": \"CHATS_DELETE\"\n },\n {\n \"label\": \"GROUPS_UPSERT\",\n \"value\": \"GROUPS_UPSERT\"\n },\n {\n \"label\": \"GROUP_UPDATE\",\n \"value\": \"GROUP_UPDATE\"\n },\n {\n \"label\": \"GROUP_PARTICIPANTS_UPDATE\",\n \"value\": \"GROUP_PARTICIPANTS_UPDATE\"\n },\n {\n \"label\": \"CONNECTION_UPDATE\",\n \"value\": \"CONNECTION_UPDATE\"\n },\n {\n \"label\": \"CALL\",\n \"value\": \"CALL\"\n },\n {\n \"label\": \"NEW_JWT_TOKEN\",\n \"value\": \"NEW_JWT_TOKEN\"\n }\n]"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormWebsocket","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.events.defaultValue"}],"displayName":"JSON Form","bottomRow":30.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Websocket","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"enabled\": {{Find_Websocket.data.enabled}},\n \"events\": {{Find_Websocket.data.events || []}} \n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"masqwth5vo","minWidth":450.0,"parentId":"gzf4hjxdo8","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"gzf4hjxdo8","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"9twyngcwej","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":320.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"9twyngcwej","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalRabbitmq","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":31.0,"bottomRow":32.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":320.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4Copy1Copy","displayName":"Canvas","topRow":0.0,"bottomRow":320.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":240.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Rabbitmq.run().then(() => {\n showAlert('Rabbitmq updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating rabbitmq', 'error');\n});\ncloseModal('ModalRabbitmq');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"sourceData"},{"key":"schema.__root_schema__.children.events.defaultValue"},{"key":"schema.__root_schema__.children.enabled.accentColor"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"borderRadius"},{"key":"schema.__root_schema__.children.events.accentColor"},{"key":"submitButtonStyles.buttonColor"},{"key":"schema.__root_schema__.children.events.borderRadius"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":30.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.enabled))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"enabled","identifier":"enabled","position":0.0,"originalIdentifier":"enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Enabled"},"events":{"children":{},"dataType":"array","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.events))(FormRabbitmq.sourceData, FormRabbitmq.formData, FormRabbitmq.fieldState)}}","fieldType":"Multiselect","sourceData":[],"isCustomField":false,"accessor":"events","identifier":"events","position":2.0,"originalIdentifier":"events","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormRabbitmq.sourceData, FormRabbitmq.formData, FormRabbitmq.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormRabbitmq.sourceData, FormRabbitmq.formData, FormRabbitmq.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Events","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n\n {\n \"label\": \"APPLICATION_STARTUP\",\n \"value\": \"APPLICATION_STARTUP\"\n },\n {\n \"label\": \"QRCODE_UPDATED\",\n \"value\": \"QRCODE_UPDATED\"\n },\n {\n \"label\": \"MESSAGES_SET\",\n \"value\": \"MESSAGES_SET\"\n },\n {\n \"label\": \"MESSAGES_UPSERT\",\n \"value\": \"MESSAGES_UPSERT\"\n },\n {\n \"label\": \"MESSAGES_UPDATE\",\n \"value\": \"MESSAGES_UPDATE\"\n },\n {\n \"label\": \"MESSAGES_DELETE\",\n \"value\": \"MESSAGES_DELETE\"\n },\n {\n \"label\": \"SEND_MESSAGE\",\n \"value\": \"SEND_MESSAGE\"\n },\n {\n \"label\": \"CONTACTS_SET\",\n \"value\": \"CONTACTS_SET\"\n },\n {\n \"label\": \"CONTACTS_UPSERT\",\n \"value\": \"CONTACTS_UPSERT\"\n },\n {\n \"label\": \"CONTACTS_UPDATE\",\n \"value\": \"CONTACTS_UPDATE\"\n },\n {\n \"label\": \"PRESENCE_UPDATE\",\n \"value\": \"PRESENCE_UPDATE\"\n },\n {\n \"label\": \"CHATS_SET\",\n \"value\": \"CHATS_SET\"\n },\n {\n \"label\": \"CHATS_UPSERT\",\n \"value\": \"CHATS_UPSERT\"\n },\n {\n \"label\": \"CHATS_UPDATE\",\n \"value\": \"CHATS_UPDATE\"\n },\n {\n \"label\": \"CHATS_DELETE\",\n \"value\": \"CHATS_DELETE\"\n },\n {\n \"label\": \"GROUPS_UPSERT\",\n \"value\": \"GROUPS_UPSERT\"\n },\n {\n \"label\": \"GROUP_UPDATE\",\n \"value\": \"GROUP_UPDATE\"\n },\n {\n \"label\": \"GROUP_PARTICIPANTS_UPDATE\",\n \"value\": \"GROUP_PARTICIPANTS_UPDATE\"\n },\n {\n \"label\": \"CONNECTION_UPDATE\",\n \"value\": \"CONNECTION_UPDATE\"\n },\n {\n \"label\": \"CALL\",\n \"value\": \"CALL\"\n },\n {\n \"label\": \"NEW_JWT_TOKEN\",\n \"value\": \"NEW_JWT_TOKEN\"\n }\n]"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormRabbitmq","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.events.defaultValue"}],"displayName":"JSON Form","bottomRow":30.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Rabbitmq","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"enabled\": {{Find_Rabbitmq.data.enabled || false}},\n \"events\": {{Find_Rabbitmq.data.events || []}} \n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"gdkpog7ep5","minWidth":450.0,"parentId":"rkuaegvcin","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"rkuaegvcin","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"76vl08dr1n","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":320.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"76vl08dr1n","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalSettings","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":46.0,"bottomRow":516.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":470.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4Copy","displayName":"Canvas","topRow":0.0,"bottomRow":470.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":240.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Settings.run().then(() => {\n showAlert('Settings updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating Settings', 'error');\n});\ncloseModal('ModalSettings');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":1.0,"dynamicBindingPathList":[{"key":"schema.__root_schema__.children.read_status.accentColor"},{"key":"schema.__root_schema__.children.read_status.defaultValue"},{"key":"schema.__root_schema__.children.read_messages.accentColor"},{"key":"schema.__root_schema__.children.read_messages.defaultValue"},{"key":"schema.__root_schema__.children.always_online.accentColor"},{"key":"schema.__root_schema__.children.always_online.defaultValue"},{"key":"schema.__root_schema__.children.groups_ignore.accentColor"},{"key":"schema.__root_schema__.children.groups_ignore.defaultValue"},{"key":"schema.__root_schema__.children.msg_call.accentColor"},{"key":"schema.__root_schema__.children.msg_call.defaultValue"},{"key":"schema.__root_schema__.children.reject_call.accentColor"},{"key":"schema.__root_schema__.children.reject_call.defaultValue"},{"key":"borderRadius"},{"key":"sourceData"},{"key":"schema.__root_schema__.children.msg_call.borderRadius"},{"key":"submitButtonStyles.buttonColor"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":45.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"reject_call":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.reject_call))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"reject_call","identifier":"reject_call","position":0.0,"originalIdentifier":"reject_call","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Reject Call"},"msg_call":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.msg_call))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Text Input","sourceData":"Não aceitamos chamadas!","isCustomField":false,"accessor":"msg_call","identifier":"msg_call","position":1.0,"originalIdentifier":"msg_call","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Msg Call"},"groups_ignore":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.groups_ignore))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"groups_ignore","identifier":"groups_ignore","position":2.0,"originalIdentifier":"groups_ignore","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Groups Ignore"},"always_online":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.always_online))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"always_online","identifier":"always_online","position":3.0,"originalIdentifier":"always_online","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Always Online"},"read_messages":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.read_messages))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"read_messages","identifier":"read_messages","position":4.0,"originalIdentifier":"read_messages","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Read Messages"},"read_status":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.read_status))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"read_status","identifier":"read_status","position":5.0,"originalIdentifier":"read_status","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormSettings.sourceData, FormSettings.formData, FormSettings.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Read Status"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormSettings","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.reject_call.defaultValue"},{"key":"schema.__root_schema__.children.groups_ignore.defaultValue"},{"key":"schema.__root_schema__.children.always_online.defaultValue"},{"key":"schema.__root_schema__.children.read_messages.defaultValue"},{"key":"schema.__root_schema__.children.read_status.defaultValue"},{"key":"schema.__root_schema__.children.msg_call.defaultValue"}],"displayName":"JSON Form","bottomRow":45.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Settings","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"reject_call\": {{Find_Settings.data.reject_call || false}},\n \"msg_call\": {{Find_Settings.data.msg_call}},\n \"groups_ignore\": {{Find_Settings.data.groups_ignore || false}},\n \"always_online\": {{Find_Settings.data.always_online || false}},\n \"read_messages\": {{Find_Settings.data.read_messages || false}},\n \"read_status\": {{Find_Settings.data.read_status || false}}\n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":64.0,"widgetId":"3wajdobhry","minWidth":450.0,"parentId":"bj66ktxeor","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"bj66ktxeor","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"9pvl5efylb","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":470.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"9pvl5efylb","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalChatwoot","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":50.0,"bottomRow":780.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":730.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4CopyCopy","displayName":"Canvas","topRow":0.0,"bottomRow":730.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":730.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Chatwoot.run().then(() => {\n showAlert('Chatwoot updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating Chatwoot', 'error');\n});\ncloseModal('ModalChatwoot');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"schema.__root_schema__.children.conversation_pending.accentColor"},{"key":"schema.__root_schema__.children.conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.reopen_conversation.accentColor"},{"key":"schema.__root_schema__.children.reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.sign_msg.accentColor"},{"key":"schema.__root_schema__.children.sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.url.borderRadius"},{"key":"schema.__root_schema__.children.url.accentColor"},{"key":"schema.__root_schema__.children.url.defaultValue"},{"key":"schema.__root_schema__.children.token.borderRadius"},{"key":"schema.__root_schema__.children.token.accentColor"},{"key":"schema.__root_schema__.children.token.defaultValue"},{"key":"schema.__root_schema__.children.account_id.accentColor"},{"key":"schema.__root_schema__.children.account_id.defaultValue"},{"key":"schema.__root_schema__.children.enabled.accentColor"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"borderRadius"},{"key":"sourceData"},{"key":"schema.__root_schema__.children.account_id.borderRadius"},{"key":"schema.__root_schema__.children.webhook_url.defaultValue"},{"key":"schema.__root_schema__.children.webhook_url.accentColor"},{"key":"schema.__root_schema__.children.webhook_url.borderRadius"},{"key":"schema.__root_schema__.defaultValue"},{"key":"schema.__root_schema__.borderRadius"},{"key":"schema.__root_schema__.cellBorderRadius"},{"key":"schema.__root_schema__.children.name_inbox.defaultValue"},{"key":"schema.__root_schema__.children.name_inbox.borderRadius"},{"key":"schema.__root_schema__.children.name_inbox.accentColor"},{"key":"submitButtonStyles.buttonColor"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":71.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.enabled))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"enabled","identifier":"enabled","position":0.0,"originalIdentifier":"enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Enabled"},"account_id":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.account_id))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Text Input","sourceData":"1","isCustomField":false,"accessor":"account_id","identifier":"account_id","position":1.0,"originalIdentifier":"account_id","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Account Id"},"token":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.token))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Password Input","sourceData":"uHquVJgCdkee8JPJm9YBkdH6","isCustomField":false,"accessor":"token","identifier":"token","position":2.0,"originalIdentifier":"token","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Token","shouldAllowAutofill":true},"url":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.url))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Text Input","sourceData":"https://chatwoot.evolution.dgcode.com.br","isCustomField":false,"accessor":"url","identifier":"url","position":3.0,"originalIdentifier":"url","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Url"},"sign_msg":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.sign_msg))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"sign_msg","identifier":"sign_msg","position":4.0,"originalIdentifier":"sign_msg","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Sign Msg"},"reopen_conversation":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.reopen_conversation))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"reopen_conversation","identifier":"reopen_conversation","position":5.0,"originalIdentifier":"reopen_conversation","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Reopen Conversation"},"conversation_pending":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.conversation_pending))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Switch","sourceData":false,"isCustomField":false,"accessor":"conversation_pending","identifier":"conversation_pending","position":6.0,"originalIdentifier":"conversation_pending","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Conversation Pending"},"webhook_url":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.webhook_url))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Text Input","sourceData":"https://api.evolution.dgcode.com.br/chatwoot/webhook/evolution-cwId-4","isCustomField":false,"accessor":"webhook_url","identifier":"webhook_url","position":8.0,"originalIdentifier":"webhook_url","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":true,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Webhook Url"},"name_inbox":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.name_inbox))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","fieldType":"Text Input","sourceData":"evolution-cwId-4","isCustomField":false,"accessor":"name_inbox","identifier":"name_inbox","position":7.0,"originalIdentifier":"name_inbox","accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormChatwoot.sourceData, FormChatwoot.formData, FormChatwoot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":true,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Name Inbox"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormWebhook.sourceData, FormWebhook.formData, FormWebhook.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormChatwoot","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.account_id.defaultValue"},{"key":"schema.__root_schema__.children.webhook_url.defaultValue"}],"displayName":"JSON Form","bottomRow":71.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Chatwoot","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"enabled\": {{Find_Chatwoot.data.enabled || false}},\n\t\"account_id\": {{Find_Chatwoot.data.account_id}},\n \"token\": {{Find_Chatwoot.data.token}},\n \"url\": {{Find_Chatwoot.data.url}},\n \"sign_msg\": {{Find_Chatwoot.data.sign_msg || false}},\n \"reopen_conversation\": {{Find_Chatwoot.data.reopen_conversation || false}},\n \"conversation_pending\": {{Find_Chatwoot.data.conversation_pending || false}},\n\t\t\"name_inbox\": {{Find_Chatwoot.data.name_inbox}},\n\t\t\"webhook_url\": {{Find_Chatwoot.data.webhook_url}}\n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"c5v1lwuyrk","minWidth":450.0,"parentId":"wqoo05rt9h","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"wqoo05rt9h","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"kekx3o71p4","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":730.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"kekx3o71p4","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":692.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalTypebot","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":45.0,"bottomRow":665.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":620.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4CopyCopyCopy","displayName":"Canvas","topRow":0.0,"bottomRow":620.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":730.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_Typebot.run().then(() => {\n showAlert('Typebot updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating Typebot', 'error');\n});\ncloseModal('ModalTypebot');}}","topRow":1.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"schema.__root_schema__.defaultValue"},{"key":"schema.__root_schema__.borderRadius"},{"key":"submitButtonStyles.buttonColor"},{"key":"sourceData"},{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.enabled.accentColor"},{"key":"schema.__root_schema__.children.url.defaultValue"},{"key":"schema.__root_schema__.children.url.accentColor"},{"key":"schema.__root_schema__.children.url.borderRadius"},{"key":"schema.__root_schema__.children.typebot.defaultValue"},{"key":"schema.__root_schema__.children.typebot.accentColor"},{"key":"schema.__root_schema__.children.typebot.borderRadius"},{"key":"schema.__root_schema__.children.expire.defaultValue"},{"key":"schema.__root_schema__.children.expire.accentColor"},{"key":"schema.__root_schema__.children.expire.borderRadius"},{"key":"schema.__root_schema__.children.keyword_finish.defaultValue"},{"key":"schema.__root_schema__.children.keyword_finish.accentColor"},{"key":"schema.__root_schema__.children.keyword_finish.borderRadius"},{"key":"schema.__root_schema__.children.delay_message.defaultValue"},{"key":"schema.__root_schema__.children.delay_message.accentColor"},{"key":"schema.__root_schema__.children.delay_message.borderRadius"},{"key":"schema.__root_schema__.cellBorderRadius"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":68.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"enabled":{"children":{},"dataType":"boolean","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.enabled))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Switch","sourceData":true,"isCustomField":false,"accessor":"enabled","identifier":"enabled","position":0.0,"originalIdentifier":"enabled","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","alignWidget":"LEFT","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Enabled"},"url":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.url))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Text Input","sourceData":"https://chat2.manualnegocioonline.com.br","isCustomField":false,"accessor":"url","identifier":"url","position":1.0,"originalIdentifier":"url","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Url"},"typebot":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.typebot))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Text Input","sourceData":"francis-whatsapp-pesquisa-satisfacao-copy-copy-74fk24p","isCustomField":false,"accessor":"typebot","identifier":"typebot","position":2.0,"originalIdentifier":"typebot","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Typebot"},"expire":{"children":{},"dataType":"number","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.expire))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Number Input","sourceData":20.0,"isCustomField":false,"accessor":"expire","identifier":"expire","position":3.0,"originalIdentifier":"expire","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Expire"},"keyword_finish":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.keyword_finish))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Text Input","sourceData":"#SAIR","isCustomField":false,"accessor":"keyword_finish","identifier":"keyword_finish","position":4.0,"originalIdentifier":"keyword_finish","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Keyword Finish"},"delay_message":{"children":{},"dataType":"number","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.delay_message))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Number Input","sourceData":3000.0,"isCustomField":false,"accessor":"delay_message","identifier":"delay_message","position":5.0,"originalIdentifier":"delay_message","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Delay Message"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Object","sourceData":{"enabled":true,"url":"https://chat2.manualnegocioonline.com.br","typebot":"francis-whatsapp-pesquisa-satisfacao-copy-copy-74fk24p","expire":20.0,"keyword_finish":"#SAIR","delay_message":3000.0,"unknown_message":"Mensagem não reconhecida2"},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormTypebot","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.enabled.defaultValue"},{"key":"schema.__root_schema__.children.sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.account_id.defaultValue"},{"key":"schema.__root_schema__.children.webhook_url.defaultValue"}],"displayName":"JSON Form","bottomRow":60.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Set Typebot","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"enabled\": {{Find_Typebot.data.enabled || false}},\n \"url\": {{Find_Typebot.data.url}},\n \"typebot\": {{Find_Typebot.data.typebot}},\n \"expire\": {{Find_Typebot.data.expire}},\n \"keyword_finish\": {{Find_Typebot.data.keyword_finish}},\n \"delay_message\": {{Find_Typebot.data.delay_message}}\n \n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"fyu0oxvlx7","minWidth":450.0,"parentId":"bvxewkusbf","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":1.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"bvxewkusbf","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"4n3m0wo9tx","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":620.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"4n3m0wo9tx","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":692.0,"minDynamicHeight":24.0},{"boxShadow":"none","mobileBottomRow":70.0,"widgetName":"ModalTypebotChangeSessionStatu","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":45.0,"bottomRow":415.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":370.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas4CopyCopyCopyCopy","displayName":"Canvas","topRow":0.0,"bottomRow":370.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":730.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Set_TypebotChangeSessionStatus.run().then(() => {\n showAlert('Typebot Change Session updated successfully', 'success');\n}).catch(() => {\n showAlert('Error updating Session Typebot', 'error');\n});\ncloseModal('ModalTypebotChangeSessionStatu');}}","topRow":1.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"schema.__root_schema__.defaultValue"},{"key":"schema.__root_schema__.borderRadius"},{"key":"submitButtonStyles.buttonColor"},{"key":"schema.__root_schema__.cellBorderRadius"},{"key":"schema.__root_schema__.children.remoteJid.defaultValue"},{"key":"schema.__root_schema__.children.remoteJid.accentColor"},{"key":"schema.__root_schema__.children.remoteJid.borderRadius"},{"key":"schema.__root_schema__.children.status.defaultValue"},{"key":"schema.__root_schema__.children.status.accentColor"},{"key":"schema.__root_schema__.children.status.borderRadius"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":60.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"remoteJid":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.remoteJid))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"remoteJid","identifier":"remoteJid","position":0.0,"originalIdentifier":"remoteJid","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":true,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Remote Jid (WhatsApp. Ex: 5511968162699@s.whatsapp.net)"},"status":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.status))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"status","identifier":"status","position":1.0,"originalIdentifier":"status","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebotChangeSessionStatus.sourceData, FormTypebotChangeSessionStatus.formData, FormTypebotChangeSessionStatus.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Status (opened, paused or closed)"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","fieldType":"Object","sourceData":{"enabled":true,"url":"https://chat2.manualnegocioonline.com.br","typebot":"francis-whatsapp-pesquisa-satisfacao-copy-copy-74fk24p","expire":20.0,"keyword_finish":"#SAIR","delay_message":3000.0,"unknown_message":"Mensagem não reconhecida2"},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormTypebot.sourceData, FormTypebot.formData, FormTypebot.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormTypebotChangeSessionStatus","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[{"key":"schema.__root_schema__.children.sign_msg.defaultValue"},{"key":"schema.__root_schema__.children.reopen_conversation.defaultValue"},{"key":"schema.__root_schema__.children.conversation_pending.defaultValue"},{"key":"schema.__root_schema__.children.account_id.defaultValue"},{"key":"schema.__root_schema__.children.webhook_url.defaultValue"}],"displayName":"JSON Form","bottomRow":35.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Typebot Change Session Status","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n \"remoteJid\": \"@s.whatsapp.net\",\n \"status\": \"\"\n}","resetButtonLabel":"Reset","key":"lgqqk5r1jk","backgroundColor":"#fff","isDeprecated":false,"rightColumn":63.0,"widgetId":"28lli5jdvr","minWidth":450.0,"parentId":"8m0yhclt7g","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":1.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"svq68rvpdn","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"8m0yhclt7g","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"84rj87eew6","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"6x3z5yow7u","height":370.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"84rj87eew6","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":692.0,"minDynamicHeight":24.0},{"resetFormOnClick":false,"boxShadow":"none","mobileBottomRow":50.0,"widgetName":"Button2","onClick":"{{Fetch_Instance.run();\nFetch_PrivacySettings.run();\nshowModal('ModalProfile');}}","buttonColor":"#2770fc","dynamicPropertyPathList":[{"key":"isVisible"}],"displayName":"Button","iconSVG":"/static/media/icon.7beb9123fb53027d9d6b778cdfe4caed.svg","searchTags":["click","submit"],"topRow":28.0,"bottomRow":32.0,"parentRowSpace":10.0,"type":"BUTTON_WIDGET","hideCard":false,"mobileRightColumn":21.0,"animateLoading":true,"parentColumnSpace":17.9375,"dynamicTriggerPathList":[{"key":"onClick"}],"leftColumn":1.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"isVisible"}],"text":"Edit Profile","isDisabled":false,"key":"zhd9fobc1z","isDeprecated":false,"rightColumn":13.0,"isDefaultClickDisabled":true,"iconName":"edit","widgetId":"uh6430ysqy","minWidth":120.0,"isVisible":"{{appsmith.store.api_key && appsmith.store.api_url ? TableInstances.selectedRow.instance ? TableInstances.selectedRow.Status === 'open' ? true : false : false : false}}","recaptchaType":"V3","version":1.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":46.0,"responsiveBehavior":"hug","originalTopRow":51.0,"disabledWhenInvalid":false,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":5.0,"originalBottomRow":55.0,"buttonVariant":"PRIMARY","iconAlign":"left","placement":"CENTER"},{"boxShadow":"none","mobileBottomRow":59.0,"widgetName":"ModalProfile","isCanvas":true,"displayName":"Modal","iconSVG":"/static/media/icon.d2ab7de0666eaef853cc2d330f86887b.svg","searchTags":["dialog","popup","notification"],"topRow":35.0,"bottomRow":975.0,"parentRowSpace":10.0,"type":"MODAL_WIDGET","hideCard":false,"shouldScrollContents":true,"mobileRightColumn":35.0,"minHeight":940.0,"animateLoading":true,"parentColumnSpace":17.9375,"leftColumn":11.0,"dynamicBindingPathList":[{"key":"borderRadius"}],"children":[{"mobileBottomRow":240.0,"widgetName":"Canvas5","displayName":"Canvas","topRow":0.0,"bottomRow":940.0,"parentRowSpace":1.0,"type":"CANVAS_WIDGET","canExtend":true,"hideCard":true,"shouldScrollContents":false,"minHeight":240.0,"mobileRightColumn":430.5,"parentColumnSpace":1.0,"leftColumn":0.0,"dynamicBindingPathList":[],"children":[{"boxShadow":"none","borderColor":"#E0DEDE","iconSVG":"/static/media/icon.efac588608711d232f1c6c8a2144d2dd.svg","onSubmit":"{{Update_ProfileName.run().then(() => {\n showAlert('ProfileName successfully saved!', 'success');\n}).catch(() => {\n showAlert('Error updating ProfileName', 'error');\n});\nUpdate_ProfilePicture.run().then(() => {\n showAlert('ProfilePicture successfully saved!', 'success');\n}).catch(() => {\n showAlert('Error updating ProfilePicture', 'error');\n});\nUpdate_ProfileStatus.run().then(() => {\n showAlert('ProfileStatus successfully saved!', 'success');\n}).catch(() => {\n showAlert('Error updating ProfileStatus', 'error');\n});\nUpdate_PrivacySettings.run().then(() => {\n showAlert('PrivacySttings successfully saved!', 'success');\n}).catch(() => {\n showAlert('Error updating PrivacySttings', 'error');\n});\nfetch_Instances.run();\ncloseModal('ModalProfile');}}","topRow":0.0,"type":"JSON_FORM_WIDGET","animateLoading":true,"leftColumn":0.0,"dynamicBindingPathList":[{"key":"borderRadius"},{"key":"submitButtonStyles.buttonColor"},{"key":"submitButtonStyles.borderRadius"},{"key":"resetButtonStyles.buttonColor"},{"key":"resetButtonStyles.borderRadius"},{"key":"schema.__root_schema__.defaultValue"},{"key":"schema.__root_schema__.borderRadius"},{"key":"schema.__root_schema__.cellBorderRadius"},{"key":"schema.__root_schema__.children.profileName.defaultValue"},{"key":"schema.__root_schema__.children.profileName.accentColor"},{"key":"schema.__root_schema__.children.profileName.borderRadius"},{"key":"schema.__root_schema__.children.profileStatus.defaultValue"},{"key":"schema.__root_schema__.children.profileStatus.accentColor"},{"key":"schema.__root_schema__.children.profileStatus.borderRadius"},{"key":"schema.__root_schema__.children.profilePictureUrl.defaultValue"},{"key":"schema.__root_schema__.children.profilePictureUrl.borderRadius"},{"key":"sourceData"},{"key":"schema.__root_schema__.children.profilePictureUrl.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.readreceipts.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.readreceipts.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.readreceipts.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.children.profile.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.profile.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.profile.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.children.status.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.status.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.status.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.children.online.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.online.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.online.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.children.last.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.last.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.last.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.children.groupadd.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.children.groupadd.accentColor"},{"key":"schema.__root_schema__.children.privacySettings.children.groupadd.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.defaultValue"},{"key":"schema.__root_schema__.children.privacySettings.borderRadius"},{"key":"schema.__root_schema__.children.privacySettings.cellBorderRadius"}],"showReset":false,"dynamicHeight":"AUTO_HEIGHT","autoGenerateForm":true,"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"SECONDARY"},"isVisible":true,"version":1.0,"isLoading":false,"submitButtonLabel":"Save","childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}},"disabledWhenInvalid":true,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","originalBottomRow":92.0,"useSourceData":false,"schema":{"__root_schema__":{"children":{"profileName":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.profileName))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"profileName","identifier":"profileName","position":1.0,"originalIdentifier":"profileName","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Profile Name"},"profileStatus":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.profileStatus))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Text Input","sourceData":"","isCustomField":false,"accessor":"profileStatus","identifier":"profileStatus","position":2.0,"originalIdentifier":"profileStatus","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Profile Status"},"profilePictureUrl":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.profilePictureUrl))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Text Input","sourceData":"https://pps.whatsapp.net/v/t61.24694-24/359816109_329991892684302_7466658594467953893_n.jpg?ccb=11-4&oh=01_AdTpgc4O-xiZDr2v0OLu_jssxaw8dsws819srLMOzUwEnw&oe=64D3C41E","isCustomField":false,"accessor":"profilePictureUrl","identifier":"profilePictureUrl","position":0.0,"originalIdentifier":"profilePictureUrl","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","iconAlign":"left","isDisabled":false,"isRequired":false,"isSpellCheck":false,"isVisible":true,"labelTextSize":"0.875rem","label":"Profile Picture Url"},"privacySettings":{"children":{"readreceipts":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.readreceipts))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"all","isCustomField":false,"accessor":"readreceipts","identifier":"readreceipts","position":0.0,"originalIdentifier":"readreceipts","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Readreceipts","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"none\",\n \"value\": \"none\"\n }\n]"},"profile":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.profile))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"all","isCustomField":false,"accessor":"profile","identifier":"profile","position":1.0,"originalIdentifier":"profile","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Profile","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"contacts\",\n \"value\": \"contacts\"\n },\n {\n \"label\": \"contact_blacklist\",\n \"value\": \"contact_blacklist\"\n },\n {\n \"label\": \"none\",\n \"value\": \"none\"\n }\n]"},"status":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.status))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"contacts","isCustomField":false,"accessor":"status","identifier":"status","position":2.0,"originalIdentifier":"status","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Status","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"contacts\",\n \"value\": \"contacts\"\n },\n {\n \"label\": \"contact_blacklist\",\n \"value\": \"contact_blacklist\"\n },\n {\n \"label\": \"none\",\n \"value\": \"none\"\n }\n]"},"online":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.online))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"all","isCustomField":false,"accessor":"online","identifier":"online","position":3.0,"originalIdentifier":"online","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Online","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"match_last_seen\",\n \"value\": \"match_last_seen\"\n }\n]"},"last":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.last))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"contacts","isCustomField":false,"accessor":"last","identifier":"last","position":4.0,"originalIdentifier":"last","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Last","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"contacts\",\n \"value\": \"contacts\"\n },\n {\n \"label\": \"contact_blacklist\",\n \"value\": \"contact_blacklist\"\n },\n {\n \"label\": \"none\",\n \"value\": \"none\"\n }\n]"},"groupadd":{"children":{},"dataType":"string","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings.groupadd))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Select","sourceData":"all","isCustomField":false,"accessor":"groupadd","identifier":"groupadd","position":5.0,"originalIdentifier":"groupadd","accentColor":"{{((sourceData, formData, fieldState) => ((appsmith.theme.colors.primaryColor)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","isDisabled":false,"isFilterable":false,"isRequired":false,"isVisible":true,"label":"Groupadd","labelTextSize":"0.875rem","serverSideFiltering":false,"options":"[\n {\n \"label\": \"all\",\n \"value\": \"all\"\n },\n {\n \"label\": \"contacts\",\n \"value\": \"contacts\"\n },\n {\n \"label\": \"contact_blacklist\",\n \"value\": \"contact_blacklist\"\n },\n {\n \"label\": \"none\",\n \"value\": \"none\"\n }\n]"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData.privacySettings))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Object","sourceData":{"readreceipts":"all","profile":"all","status":"contacts","online":"all","last":"contacts","groupadd":"all"},"isCustomField":false,"accessor":"privacySettings","identifier":"privacySettings","position":3.0,"originalIdentifier":"privacySettings","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"1rem","label":"Privacy Settings","labelStyle":"BOLD"}},"dataType":"object","defaultValue":"{{((sourceData, formData, fieldState) => (sourceData))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","fieldType":"Object","sourceData":{"name":"John","date_of_birth":"20/02/1990","employee_id":1001.0},"isCustomField":false,"accessor":"__root_schema__","identifier":"__root_schema__","position":-1.0,"originalIdentifier":"__root_schema__","borderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","boxShadow":"none","cellBorderRadius":"{{((sourceData, formData, fieldState) => ((appsmith.theme.borderRadius.appBorderRadius)))(FormProfile.sourceData, FormProfile.formData, FormProfile.fieldState)}}","cellBoxShadow":"none","isDisabled":false,"isRequired":false,"isVisible":true,"labelTextSize":"0.875rem","label":""}},"mobileBottomRow":41.0,"widgetName":"FormProfile","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","buttonVariant":"PRIMARY"},"dynamicPropertyPathList":[],"displayName":"JSON Form","bottomRow":92.0,"fieldLimitExceeded":false,"parentRowSpace":10.0,"title":"Edit Profile","hideCard":false,"mobileRightColumn":25.0,"parentColumnSpace":6.9375,"dynamicTriggerPathList":[{"key":"onSubmit"}],"borderWidth":"0","sourceData":"{\n\t\"profilePictureUrl\": \"{{Fetch_Instance.data.instance.profilePictureUrl}}\",\n\t\"profileName\": \"{{Fetch_Instance.data.instance.profileName}}\",\n\t\"profileStatus\": \"{{Fetch_Instance.data.instance.profileStatus}}\",\n\t\"privacySettings\": {\n \"readreceipts\": {{Fetch_PrivacySettings.data.readreceipts}},\n \"profile\": {{Fetch_PrivacySettings.data.profile}},\n \"status\": {{Fetch_PrivacySettings.data.status}},\n \"online\": {{Fetch_PrivacySettings.data.online}},\n \"last\": {{Fetch_PrivacySettings.data.last}},\n \"groupadd\": {{Fetch_PrivacySettings.data.groupadd}}\n\t\t}\n}","resetButtonLabel":"","key":"72nqor459k","backgroundColor":"#fff","isDeprecated":false,"rightColumn":64.0,"widgetId":"hguxefink2","minWidth":450.0,"parentId":"basosxf5qt","renderMode":"CANVAS","mobileTopRow":0.0,"scrollContents":true,"responsiveBehavior":"fill","fixedFooter":true,"originalTopRow":0.0,"mobileLeftColumn":0.0,"maxDynamicHeight":9000.0,"minDynamicHeight":4.0}],"isDisabled":false,"key":"mepf0qsn1e","isDeprecated":false,"rightColumn":430.5,"detachFromLayout":true,"widgetId":"basosxf5qt","minWidth":450.0,"isVisible":true,"version":1.0,"parentId":"ss96aihlej","renderMode":"CANVAS","isLoading":false,"mobileTopRow":0.0,"responsiveBehavior":"fill","mobileLeftColumn":0.0,"flexLayers":[]}],"key":"4ktj7iym0b","height":940.0,"isDeprecated":false,"rightColumn":35.0,"detachFromLayout":true,"dynamicHeight":"AUTO_HEIGHT","widgetId":"ss96aihlej","canOutsideClickClose":true,"canEscapeKeyClose":true,"version":2.0,"parentId":"0","renderMode":"CANVAS","isLoading":false,"mobileTopRow":35.0,"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","mobileLeftColumn":11.0,"maxDynamicHeight":9000.0,"width":456.0,"minDynamicHeight":24.0}]},"layoutOnLoadActions":[[{"id":"Home_Scripts.verifyConfig","name":"Scripts.verifyConfig","collectionId":"Home_Scripts","clientSideExecution":true,"confirmBeforeExecute":false,"pluginType":"JS","jsonPathKeys":[],"timeoutInMillisecond":10000.0}],[{"id":"Home_Find_Rabbitmq","name":"Find_Rabbitmq","confirmBeforeExecute":false,"pluginType":"API","jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"timeoutInMillisecond":10000.0},{"id":"Home_Find_Websocket","name":"Find_Websocket","confirmBeforeExecute":false,"pluginType":"API","jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"timeoutInMillisecond":10000.0}]],"layoutOnLoadActionErrors":[],"validOnPageLoadActions":true,"id":"Home","deleted":false,"policies":[],"userPermissions":[]}],"userPermissions":[],"policies":[],"isHidden":false},"deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7b0"}],"actionList":[{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Restart","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/restart/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"","bodyFormData":[],"httpMethod":"PUT","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T03:01:05Z"},"publishedAction":{"name":"Restart","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/restart/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"","bodyFormData":[],"httpMethod":"PUT","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T03:01:05Z"},"id":"Home_Restart","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7b4"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Create_Instance","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/create","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"instanceName\": FormInstance.formData.instance.instanceName,\n\t\t\"token\": FormInstance.formData.instance.token,\n\t\t\"qrcode\": FormInstance.formData.instance.qrcode,\n\t\t\"webhook\": FormInstance.formData.webhook.webhook,\n\t\t\"webhook_by_events\": FormInstance.formData.webhook.webhook_by_events,\n\t\t\"websocket_enabled\": FormInstance.formData.websocket.websocket_enabled,\n\t\t\"websocket_events\": FormInstance.formData.websocket.websocket_events,\n\t\t\"rabbitmq_enabled\": FormInstance.formData.websocket.rabbitmq_enabled,\n\t\t\"rabbitmq_events\": FormInstance.formData.websocket.rabbitmq_events,\n\t\t\"events\": FormInstance.formData.webhook.events,\n\t\t\"reject_call\": FormInstance.formData.settings.reject_call,\n\t\t\"msg_call\": FormInstance.formData.settings.msg_call,\n\t\t\"groups_ignore\": FormInstance.formData.settings.groups_ignore,\n\t\t\"always_online\": FormInstance.formData.settings.always_online,\n\t\t\"read_messages\": FormInstance.formData.settings.read_messages,\n\t\t\"read_status\": FormInstance.formData.settings.read_status,\n\t\t\"chatwoot_account_id\": FormInstance.formData.chatwoot.chatwoot_account_id,\n\t\t\"chatwoot_token\": FormInstance.formData.chatwoot.chatwoot_token,\n\t\t\"chatwoot_url\": FormInstance.formData.chatwoot.chatwoot_url,\n\t\t\"chatwoot_sign_msg\": FormInstance.formData.chatwoot.chatwoot_sign_msg,\n\t\t\"chatwoot_reopen_conversation\": FormInstance.formData.chatwoot.chatwoot_reopen_conversation,\n\t\t\"chatwoot_conversation_pending\": FormInstance.formData.chatwoot.chatwoot_conversation_pending\n\t}\n}}","bodyFormData":[{"key":"instanceName","value":"{{FormInstance.data.InputNewInstanceName}}"},{"key":"token","value":"{{FormInstance.data.InputNewInstanceToken}}"}],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"application/json"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"bodyFormData[0].value"},{"key":"bodyFormData[1].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["\n\t{\n\t\t\"instanceName\": FormInstance.formData.instance.instanceName,\n\t\t\"token\": FormInstance.formData.instance.token,\n\t\t\"qrcode\": FormInstance.formData.instance.qrcode,\n\t\t\"webhook\": FormInstance.formData.webhook.webhook,\n\t\t\"webhook_by_events\": FormInstance.formData.webhook.webhook_by_events,\n\t\t\"websocket_enabled\": FormInstance.formData.websocket.websocket_enabled,\n\t\t\"websocket_events\": FormInstance.formData.websocket.websocket_events,\n\t\t\"rabbitmq_enabled\": FormInstance.formData.websocket.rabbitmq_enabled,\n\t\t\"rabbitmq_events\": FormInstance.formData.websocket.rabbitmq_events,\n\t\t\"events\": FormInstance.formData.webhook.events,\n\t\t\"reject_call\": FormInstance.formData.settings.reject_call,\n\t\t\"msg_call\": FormInstance.formData.settings.msg_call,\n\t\t\"groups_ignore\": FormInstance.formData.settings.groups_ignore,\n\t\t\"always_online\": FormInstance.formData.settings.always_online,\n\t\t\"read_messages\": FormInstance.formData.settings.read_messages,\n\t\t\"read_status\": FormInstance.formData.settings.read_status,\n\t\t\"chatwoot_account_id\": FormInstance.formData.chatwoot.chatwoot_account_id,\n\t\t\"chatwoot_token\": FormInstance.formData.chatwoot.chatwoot_token,\n\t\t\"chatwoot_url\": FormInstance.formData.chatwoot.chatwoot_url,\n\t\t\"chatwoot_sign_msg\": FormInstance.formData.chatwoot.chatwoot_sign_msg,\n\t\t\"chatwoot_reopen_conversation\": FormInstance.formData.chatwoot.chatwoot_reopen_conversation,\n\t\t\"chatwoot_conversation_pending\": FormInstance.formData.chatwoot.chatwoot_conversation_pending\n\t}\n","FormInstance.data.InputNewInstanceName","FormInstance.data.InputNewInstanceToken","appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T03:22:09Z"},"publishedAction":{"name":"Create_Instance","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/create","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"instanceName\": FormInstance.formData.instance.instanceName,\n\t\t\"token\": FormInstance.formData.instance.token,\n\t\t\"qrcode\": FormInstance.formData.instance.qrcode,\n\t\t\"webhook\": FormInstance.formData.webhook.webhook,\n\t\t\"webhook_by_events\": FormInstance.formData.webhook.webhook_by_events,\n\t\t\"websocket_enabled\": FormInstance.formData.websocket.websocket_enabled,\n\t\t\"websocket_events\": FormInstance.formData.websocket.websocket_events,\n\t\t\"rabbitmq_enabled\": FormInstance.formData.websocket.rabbitmq_enabled,\n\t\t\"rabbitmq_events\": FormInstance.formData.websocket.rabbitmq_events,\n\t\t\"events\": FormInstance.formData.webhook.events,\n\t\t\"reject_call\": FormInstance.formData.settings.reject_call,\n\t\t\"msg_call\": FormInstance.formData.settings.msg_call,\n\t\t\"groups_ignore\": FormInstance.formData.settings.groups_ignore,\n\t\t\"always_online\": FormInstance.formData.settings.always_online,\n\t\t\"read_messages\": FormInstance.formData.settings.read_messages,\n\t\t\"read_status\": FormInstance.formData.settings.read_status,\n\t\t\"chatwoot_account_id\": FormInstance.formData.chatwoot.chatwoot_account_id,\n\t\t\"chatwoot_token\": FormInstance.formData.chatwoot.chatwoot_token,\n\t\t\"chatwoot_url\": FormInstance.formData.chatwoot.chatwoot_url,\n\t\t\"chatwoot_sign_msg\": FormInstance.formData.chatwoot.chatwoot_sign_msg,\n\t\t\"chatwoot_reopen_conversation\": FormInstance.formData.chatwoot.chatwoot_reopen_conversation,\n\t\t\"chatwoot_conversation_pending\": FormInstance.formData.chatwoot.chatwoot_conversation_pending\n\t}\n}}","bodyFormData":[{"key":"instanceName","value":"{{FormInstance.data.InputNewInstanceName}}"},{"key":"token","value":"{{FormInstance.data.InputNewInstanceToken}}"}],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"application/json"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"bodyFormData[0].value"},{"key":"bodyFormData[1].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["\n\t{\n\t\t\"instanceName\": FormInstance.formData.instance.instanceName,\n\t\t\"token\": FormInstance.formData.instance.token,\n\t\t\"qrcode\": FormInstance.formData.instance.qrcode,\n\t\t\"webhook\": FormInstance.formData.webhook.webhook,\n\t\t\"webhook_by_events\": FormInstance.formData.webhook.webhook_by_events,\n\t\t\"websocket_enabled\": FormInstance.formData.websocket.websocket_enabled,\n\t\t\"websocket_events\": FormInstance.formData.websocket.websocket_events,\n\t\t\"rabbitmq_enabled\": FormInstance.formData.websocket.rabbitmq_enabled,\n\t\t\"rabbitmq_events\": FormInstance.formData.websocket.rabbitmq_events,\n\t\t\"events\": FormInstance.formData.webhook.events,\n\t\t\"reject_call\": FormInstance.formData.settings.reject_call,\n\t\t\"msg_call\": FormInstance.formData.settings.msg_call,\n\t\t\"groups_ignore\": FormInstance.formData.settings.groups_ignore,\n\t\t\"always_online\": FormInstance.formData.settings.always_online,\n\t\t\"read_messages\": FormInstance.formData.settings.read_messages,\n\t\t\"read_status\": FormInstance.formData.settings.read_status,\n\t\t\"chatwoot_account_id\": FormInstance.formData.chatwoot.chatwoot_account_id,\n\t\t\"chatwoot_token\": FormInstance.formData.chatwoot.chatwoot_token,\n\t\t\"chatwoot_url\": FormInstance.formData.chatwoot.chatwoot_url,\n\t\t\"chatwoot_sign_msg\": FormInstance.formData.chatwoot.chatwoot_sign_msg,\n\t\t\"chatwoot_reopen_conversation\": FormInstance.formData.chatwoot.chatwoot_reopen_conversation,\n\t\t\"chatwoot_conversation_pending\": FormInstance.formData.chatwoot.chatwoot_conversation_pending\n\t}\n","FormInstance.data.InputNewInstanceName","FormInstance.data.InputNewInstanceToken","appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T03:22:09Z"},"id":"Home_Create_Instance","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7b3"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Find_Chatwoot","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chatwoot/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T19:49:33Z"},"publishedAction":{"name":"Find_Chatwoot","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chatwoot/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T19:49:33Z"},"id":"Home_Find_Chatwoot","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7b5"},{"pluginType":"JS","pluginId":"js-plugin","unpublishedAction":{"name":"verifyConfig","fullyQualifiedName":"Scripts.verifyConfig","datasource":{"name":"UNUSED_DATASOURCE","pluginId":"js-plugin","invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","collectionId":"Home_Scripts","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","encodeParamsToggle":true,"body":"async function () {\n const api_url = await appsmith.store.api_url;\n const api_key = await appsmith.store.api_key;\n if (!api_url && !api_key) {\n showModal('ModalConfig');\n return false;\n }\n fetch_Instances.run();\n Find_Webhook.run();\n Find_Settings.run();\n Find_Chatwoot.run();\n return true;\n}","selfReferencingDataPaths":[],"jsArguments":[],"isAsync":true},"executeOnLoad":true,"clientSideExecution":true,"dynamicBindingPathList":[{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":[],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-29T16:12:42Z"},"publishedAction":{"name":"verifyConfig","fullyQualifiedName":"Scripts.verifyConfig","datasource":{"name":"UNUSED_DATASOURCE","pluginId":"js-plugin","invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","collectionId":"Home_Scripts","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","encodeParamsToggle":true,"body":"async function () {\n const api_url = await appsmith.store.api_url;\n const api_key = await appsmith.store.api_key;\n if (!api_url && !api_key) {\n showModal('ModalConfig');\n return false;\n }\n fetch_Instances.run();\n Find_Webhook.run();\n Find_Settings.run();\n Find_Chatwoot.run();\n return true;\n}","selfReferencingDataPaths":[],"jsArguments":[],"isAsync":true},"executeOnLoad":true,"clientSideExecution":true,"dynamicBindingPathList":[{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":[],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-29T16:12:42Z"},"id":"Home_Scripts.verifyConfig","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7b2"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Find_Settings","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/settings/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T19:48:45Z"},"publishedAction":{"name":"Find_Settings","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/settings/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T19:48:45Z"},"id":"Home_Find_Settings","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7b9"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"fetch_Instances","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/fetchInstances","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-29T16:12:42Z"},"publishedAction":{"name":"fetch_Instances","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/fetchInstances","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-29T16:12:42Z"},"id":"Home_fetch_Instances","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7b6"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Connect","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/connect/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-29T16:12:42Z"},"publishedAction":{"name":"Connect","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/connect/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-29T16:12:42Z"},"id":"Home_Connect","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7ba"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Delete","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/delete/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"","bodyFormData":[],"httpMethod":"DELETE","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T03:02:32Z"},"publishedAction":{"name":"Delete","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/delete/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"","bodyFormData":[],"httpMethod":"DELETE","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T03:02:32Z"},"id":"Home_Delete","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7b7"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Logout","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/logout/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"","bodyFormData":[],"httpMethod":"DELETE","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T03:02:00Z"},"publishedAction":{"name":"Logout","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/logout/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"","bodyFormData":[],"httpMethod":"DELETE","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url","appsmith.store.api_key"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T03:02:00Z"},"id":"Home_Logout","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7b8"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Find_Webhook","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/webhook/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T19:46:50Z"},"publishedAction":{"name":"Find_Webhook","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/webhook/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T19:46:50Z"},"id":"Home_Find_Webhook","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7c5"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Find_Rabbitmq","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/rabbitmq/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":true,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-03T00:55:16Z"},"publishedAction":{"name":"Find_Rabbitmq","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/rabbitmq/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":true,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-03T00:55:16Z"},"id":"Home_Find_Rabbitmq","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7c1"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Set_Websocket","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/websocket/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\tFormWebsocket.formData\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\tFormWebsocket.formData\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-03T00:55:30Z"},"publishedAction":{"name":"Set_Websocket","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/websocket/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\tFormWebsocket.formData\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\tFormWebsocket.formData\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-03T00:55:30Z"},"id":"Home_Set_Websocket","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7bd"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Update_ProfileName","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/updateProfileName/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"name\": FormProfile.formData.profileName\n\t}\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\t{\n\t\t\"name\": FormProfile.formData.profileName\n\t}\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:22:45Z"},"publishedAction":{"name":"Update_ProfileName","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/updateProfileName/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"name\": FormProfile.formData.profileName\n\t}\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\t{\n\t\t\"name\": FormProfile.formData.profileName\n\t}\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:22:45Z"},"id":"Home_Update_ProfileName","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7bb"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Update_ProfileStatus","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/updateProfileStatus/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"status\": FormProfile.formData.profileStatus\n\t}\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"application/json"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"body"},{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\t{\n\t\t\"status\": FormProfile.formData.profileStatus\n\t}\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:25:00Z"},"publishedAction":{"name":"Update_ProfileStatus","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/updateProfileStatus/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"status\": FormProfile.formData.profileStatus\n\t}\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"application/json"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"body"},{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\t{\n\t\t\"status\": FormProfile.formData.profileStatus\n\t}\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:25:00Z"},"id":"Home_Update_ProfileStatus","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b37fa2945b083c5bc7c6"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Set_Settings","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/settings/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\tFormSettings.formData\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"application/json"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url","\n\tFormSettings.formData\n"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T20:13:25Z"},"publishedAction":{"name":"Set_Settings","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/settings/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\tFormSettings.formData\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"application/json"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url","\n\tFormSettings.formData\n"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T20:13:25Z"},"id":"Home_Set_Settings","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7ce"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Set_Chatwoot","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chatwoot/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"enabled\": FormChatwoot.formData.enabled,\n\t\t\"account_id\": String(FormChatwoot.formData.account_id),\n\t\t\"token\": FormChatwoot.formData.token,\n\t\t\"url\": FormChatwoot.formData.url,\n\t\t\"sign_msg\": FormChatwoot.formData.sign_msg,\n\t\t\"reopen_conversation\": FormChatwoot.formData.reopen_conversation,\n\t\t\"conversation_pending\": FormChatwoot.formData.conversation_pending\n\t}\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\t{\n\t\t\"enabled\": FormChatwoot.formData.enabled,\n\t\t\"account_id\": String(FormChatwoot.formData.account_id),\n\t\t\"token\": FormChatwoot.formData.token,\n\t\t\"url\": FormChatwoot.formData.url,\n\t\t\"sign_msg\": FormChatwoot.formData.sign_msg,\n\t\t\"reopen_conversation\": FormChatwoot.formData.reopen_conversation,\n\t\t\"conversation_pending\": FormChatwoot.formData.conversation_pending\n\t}\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T20:15:01Z"},"publishedAction":{"name":"Set_Chatwoot","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chatwoot/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"enabled\": FormChatwoot.formData.enabled,\n\t\t\"account_id\": String(FormChatwoot.formData.account_id),\n\t\t\"token\": FormChatwoot.formData.token,\n\t\t\"url\": FormChatwoot.formData.url,\n\t\t\"sign_msg\": FormChatwoot.formData.sign_msg,\n\t\t\"reopen_conversation\": FormChatwoot.formData.reopen_conversation,\n\t\t\"conversation_pending\": FormChatwoot.formData.conversation_pending\n\t}\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\t{\n\t\t\"enabled\": FormChatwoot.formData.enabled,\n\t\t\"account_id\": String(FormChatwoot.formData.account_id),\n\t\t\"token\": FormChatwoot.formData.token,\n\t\t\"url\": FormChatwoot.formData.url,\n\t\t\"sign_msg\": FormChatwoot.formData.sign_msg,\n\t\t\"reopen_conversation\": FormChatwoot.formData.reopen_conversation,\n\t\t\"conversation_pending\": FormChatwoot.formData.conversation_pending\n\t}\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T20:15:01Z"},"id":"Home_Set_Chatwoot","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7d0"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Fetch_Instance","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/fetchInstances","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[{"key":"instanceName","value":"{{TableInstances.selectedRow.instance}}"}],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"queryParameters[0].value"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["appsmith.store.api_url","appsmith.store.api_key","TableInstances.selectedRow.instance"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:16:40Z"},"publishedAction":{"name":"Fetch_Instance","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/instance/fetchInstances","headers":[{"key":"apikey","value":"{{appsmith.store.api_key}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[{"key":"instanceName","value":"{{TableInstances.selectedRow.instance}}"}],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"queryParameters[0].value"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["appsmith.store.api_url","appsmith.store.api_key","TableInstances.selectedRow.instance"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:16:40Z"},"id":"Home_Fetch_Instance","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7cf"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Remove_ProfilePicture","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/removeProfilePicture/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"","bodyFormData":[],"httpMethod":"DELETE","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:27:20Z"},"publishedAction":{"name":"Remove_ProfilePicture","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/removeProfilePicture/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"","bodyFormData":[],"httpMethod":"DELETE","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:27:20Z"},"id":"Home_Remove_ProfilePicture","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7d4"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Set_Webhook","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/webhook/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\tFormWebhook.formData\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\tFormWebhook.formData\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T20:10:19Z"},"publishedAction":{"name":"Set_Webhook","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/webhook/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\tFormWebhook.formData\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\tFormWebhook.formData\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-30T20:10:19Z"},"id":"Home_Set_Webhook","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7d5"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Update_ProfilePicture","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/updateProfilePicture/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"picture\": FormProfile.formData.profilePictureUrl\n\t}\n}}","bodyFormData":[],"httpMethod":"PUT","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\t{\n\t\t\"picture\": FormProfile.formData.profilePictureUrl\n\t}\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:25:56Z"},"publishedAction":{"name":"Update_ProfilePicture","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/updateProfilePicture/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"picture\": FormProfile.formData.profilePictureUrl\n\t}\n}}","bodyFormData":[],"httpMethod":"PUT","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\t{\n\t\t\"picture\": FormProfile.formData.profilePictureUrl\n\t}\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:25:56Z"},"id":"Home_Update_ProfilePicture","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7d1"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Set_TypebotChangeSessionStatus","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/typebot/changeStatus/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n{\n \"remoteJid\": FormTypebotChangeSessionStatus.formData.remoteJid,\n \"status\": FormTypebotChangeSessionStatus.formData.status\n}\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"headers[0].value"},{"key":"path"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","\n{\n \"remoteJid\": FormTypebotChangeSessionStatus.formData.remoteJid,\n \"status\": FormTypebotChangeSessionStatus.formData.status\n}\n","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-19T11:28:01Z"},"publishedAction":{"name":"Set_TypebotChangeSessionStatus","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/typebot/changeStatus/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n{\n \"remoteJid\": FormTypebotChangeSessionStatus.formData.remoteJid,\n \"status\": FormTypebotChangeSessionStatus.formData.status\n}\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"headers[0].value"},{"key":"path"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","\n{\n \"remoteJid\": FormTypebotChangeSessionStatus.formData.remoteJid,\n \"status\": FormTypebotChangeSessionStatus.formData.status\n}\n","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-19T11:28:01Z"},"id":"Home_Set_TypebotChangeSessionStatus","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7d2"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Set_Typebot","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/typebot/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"enabled\": FormTypebot.formData.enabled,\n\t\t\"url\": (FormTypebot.formData.url),\n\t\t\"typebot\": FormTypebot.formData.typebot,\n\t\t\"expire\": FormTypebot.formData.expire,\n\t\t\"keyword_finish\": FormTypebot.formData.keyword_finish,\n\t\t\"delay_message\": FormTypebot.formData.delay_message,\n\t\t\"unknown_messageg\": FormTypebot.formData.cunknown_messageg\n\t}\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"headers[0].value"},{"key":"path"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","\n\t{\n\t\t\"enabled\": FormTypebot.formData.enabled,\n\t\t\"url\": (FormTypebot.formData.url),\n\t\t\"typebot\": FormTypebot.formData.typebot,\n\t\t\"expire\": FormTypebot.formData.expire,\n\t\t\"keyword_finish\": FormTypebot.formData.keyword_finish,\n\t\t\"delay_message\": FormTypebot.formData.delay_message,\n\t\t\"unknown_messageg\": FormTypebot.formData.cunknown_messageg\n\t}\n","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-19T05:00:46Z"},"publishedAction":{"name":"Set_Typebot","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/typebot/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n\t\t\"enabled\": FormTypebot.formData.enabled,\n\t\t\"url\": (FormTypebot.formData.url),\n\t\t\"typebot\": FormTypebot.formData.typebot,\n\t\t\"expire\": FormTypebot.formData.expire,\n\t\t\"keyword_finish\": FormTypebot.formData.keyword_finish,\n\t\t\"delay_message\": FormTypebot.formData.delay_message,\n\t\t\"unknown_messageg\": FormTypebot.formData.cunknown_messageg\n\t}\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"headers[0].value"},{"key":"path"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","\n\t{\n\t\t\"enabled\": FormTypebot.formData.enabled,\n\t\t\"url\": (FormTypebot.formData.url),\n\t\t\"typebot\": FormTypebot.formData.typebot,\n\t\t\"expire\": FormTypebot.formData.expire,\n\t\t\"keyword_finish\": FormTypebot.formData.keyword_finish,\n\t\t\"delay_message\": FormTypebot.formData.delay_message,\n\t\t\"unknown_messageg\": FormTypebot.formData.cunknown_messageg\n\t}\n","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-19T05:00:46Z"},"id":"Home_Set_Typebot","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7d9"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Find_Websocket","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/websocket/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":true,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-03T00:54:48Z"},"publishedAction":{"name":"Find_Websocket","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/websocket/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":true,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-03T00:54:48Z"},"id":"Home_Find_Websocket","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7d8"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Fetch_PrivacySettings","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/fetchPrivacySettings/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:27:52Z"},"publishedAction":{"name":"Fetch_PrivacySettings","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/fetchPrivacySettings/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:27:52Z"},"id":"Home_Fetch_PrivacySettings","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7dd"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Set_Rabbitmq","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/rabbitmq/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\tFormRabbitmq.formData\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\tFormRabbitmq.formData\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-03T00:56:01Z"},"publishedAction":{"name":"Set_Rabbitmq","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/rabbitmq/set/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\tFormRabbitmq.formData\n}}","bodyFormData":[],"httpMethod":"POST","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"},{"key":"body"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\tFormRabbitmq.formData\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-03T00:56:01Z"},"id":"Home_Set_Rabbitmq","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7de"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Update_PrivacySettings","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/updatePrivacySettings/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n \"privacySettings\": {\n \"readreceipts\": FormProfile.formData.privacySettings.readreceipts,\n \"profile\": FormProfile.formData.privacySettings.profile,\n \"status\": FormProfile.formData.privacySettings.status,\n \"online\": FormProfile.formData.privacySettings.online,\n \"last\": FormProfile.formData.privacySettings.last,\n \"groupadd\": FormProfile.formData.privacySettings.groupadd\n\t\t}\n\t}\n}}","bodyFormData":[],"httpMethod":"PUT","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"headers[0].value"},{"key":"body"},{"key":"path"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\t{\n \"privacySettings\": {\n \"readreceipts\": FormProfile.formData.privacySettings.readreceipts,\n \"profile\": FormProfile.formData.privacySettings.profile,\n \"status\": FormProfile.formData.privacySettings.status,\n \"online\": FormProfile.formData.privacySettings.online,\n \"last\": FormProfile.formData.privacySettings.last,\n \"groupadd\": FormProfile.formData.privacySettings.groupadd\n\t\t}\n\t}\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:28:39Z"},"publishedAction":{"name":"Update_PrivacySettings","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/chat/updatePrivacySettings/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[{"key":"content-type","value":"application/json"}],"encodeParamsToggle":true,"queryParameters":[],"body":"{{\n\t{\n \"privacySettings\": {\n \"readreceipts\": FormProfile.formData.privacySettings.readreceipts,\n \"profile\": FormProfile.formData.privacySettings.profile,\n \"status\": FormProfile.formData.privacySettings.status,\n \"online\": FormProfile.formData.privacySettings.online,\n \"last\": FormProfile.formData.privacySettings.last,\n \"groupadd\": FormProfile.formData.privacySettings.groupadd\n\t\t}\n\t}\n}}","bodyFormData":[],"httpMethod":"PUT","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"headers[0].value"},{"key":"body"},{"key":"path"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","\n\t{\n \"privacySettings\": {\n \"readreceipts\": FormProfile.formData.privacySettings.readreceipts,\n \"profile\": FormProfile.formData.privacySettings.profile,\n \"status\": FormProfile.formData.privacySettings.status,\n \"online\": FormProfile.formData.privacySettings.online,\n \"last\": FormProfile.formData.privacySettings.last,\n \"groupadd\": FormProfile.formData.privacySettings.groupadd\n\t\t}\n\t}\n","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":false,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-07-31T12:28:39Z"},"id":"Home_Update_PrivacySettings","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7db"},{"pluginType":"API","pluginId":"restapi-plugin","unpublishedAction":{"name":"Find_Typebot","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/typebot/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-19T03:57:40Z"},"publishedAction":{"name":"Find_Typebot","datasource":{"name":"DEFAULT_REST_DATASOURCE","pluginId":"restapi-plugin","datasourceConfiguration":{"url":""},"invalids":[],"messages":[],"isAutoGenerated":false,"deleted":false,"policies":[],"userPermissions":[]},"pageId":"Home","actionConfiguration":{"timeoutInMillisecond":10000.0,"paginationType":"NONE","path":"{{appsmith.store.api_url}}/typebot/find/{{encodeURIComponent(TableInstances.selectedRow.instance)}}","headers":[{"key":"apikey","value":"{{TableInstances.selectedRow.Apikey}}"}],"autoGeneratedHeaders":[],"encodeParamsToggle":true,"queryParameters":[],"bodyFormData":[],"httpMethod":"GET","selfReferencingDataPaths":[],"pluginSpecifiedTemplates":[{"value":true}],"formData":{"apiContentType":"none"}},"executeOnLoad":false,"dynamicBindingPathList":[{"key":"path"},{"key":"headers[0].value"}],"isValid":true,"invalids":[],"messages":[],"jsonPathKeys":["TableInstances.selectedRow.Apikey","encodeURIComponent(TableInstances.selectedRow.instance)","appsmith.store.api_url"],"userSetOnLoad":true,"confirmBeforeExecute":false,"policies":[],"userPermissions":[],"createdAt":"2023-08-19T03:57:40Z"},"id":"Home_Find_Typebot","deleted":false,"gitSyncId":"64e0b37fa2945b083c5bc7ac_64e0b380a2945b083c5bc7e3"}],"actionCollectionList":[{"unpublishedCollection":{"name":"Scripts","pageId":"Home","pluginId":"js-plugin","pluginType":"JS","actions":[],"archivedActions":[],"body":"export default {\n\tmyVar1: [],\n\tmyVar2: {},\n\tasync verifyConfig () {\n\t\tconst api_url = await appsmith.store.api_url;\n\t\tconst api_key = await appsmith.store.api_key;\n\t\tif(!api_url && !api_key){\n\t\t\tshowModal('ModalConfig');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfetch_Instances.run();\n\t\tFind_Webhook.run();\n\t\tFind_Settings.run();\n\t\tFind_Chatwoot.run();\n\t\treturn true;\n\t}\n}","variables":[{"name":"myVar1","value":"[]"},{"name":"myVar2","value":"{}"}],"userPermissions":[]},"publishedCollection":{"name":"Scripts","pageId":"Home","pluginId":"js-plugin","pluginType":"JS","actions":[],"archivedActions":[],"body":"export default {\n\tmyVar1: [],\n\tmyVar2: {},\n\tasync verifyConfig () {\n\t\tconst api_url = await appsmith.store.api_url;\n\t\tconst api_key = await appsmith.store.api_key;\n\t\tif(!api_url && !api_key){\n\t\t\tshowModal('ModalConfig');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfetch_Instances.run();\n\t\tFind_Webhook.run();\n\t\tFind_Settings.run();\n\t\tFind_Chatwoot.run();\n\t\treturn true;\n\t}\n}","variables":[{"name":"myVar1","value":"[]"},{"name":"myVar2","value":"{}"}],"userPermissions":[]},"id":"Home_Scripts","deleted":false,"gitSyncId":"64c534835ebbd221b60b4c54_64c5372a5dd3482b9ab5e11e"}],"updatedResources":{"customJSLibList":[],"actionList":["Scripts.verifyConfig##ENTITY_SEPARATOR##Home","Logout##ENTITY_SEPARATOR##Home","Fetch_Instance##ENTITY_SEPARATOR##Home","Set_Websocket##ENTITY_SEPARATOR##Home","Update_ProfileName##ENTITY_SEPARATOR##Home","Set_Chatwoot##ENTITY_SEPARATOR##Home","Create_Instance##ENTITY_SEPARATOR##Home","Update_ProfileStatus##ENTITY_SEPARATOR##Home","Find_Webhook##ENTITY_SEPARATOR##Home","Update_ProfilePicture##ENTITY_SEPARATOR##Home","Find_Settings##ENTITY_SEPARATOR##Home","Set_Settings##ENTITY_SEPARATOR##Home","Set_Typebot##ENTITY_SEPARATOR##Home","Update_PrivacySettings##ENTITY_SEPARATOR##Home","Find_Typebot##ENTITY_SEPARATOR##Home","Delete##ENTITY_SEPARATOR##Home","Find_Websocket##ENTITY_SEPARATOR##Home","Find_Chatwoot##ENTITY_SEPARATOR##Home","Connect##ENTITY_SEPARATOR##Home","Remove_ProfilePicture##ENTITY_SEPARATOR##Home","Fetch_PrivacySettings##ENTITY_SEPARATOR##Home","Restart##ENTITY_SEPARATOR##Home","Set_Rabbitmq##ENTITY_SEPARATOR##Home","fetch_Instances##ENTITY_SEPARATOR##Home","Find_Rabbitmq##ENTITY_SEPARATOR##Home","Set_Webhook##ENTITY_SEPARATOR##Home","Set_TypebotChangeSessionStatus##ENTITY_SEPARATOR##Home"],"pageList":["Home"],"actionCollectionList":["Scripts##ENTITY_SEPARATOR##Home"]},"editModeTheme":{"name":"Default","displayName":"Modern","config":{"colors":{"primaryColor":"#553DE9","backgroundColor":"#F8FAFC"},"borderRadius":{"appBorderRadius":{"none":"0px","M":"0.375rem","L":"1.5rem"}},"boxShadow":{"appBoxShadow":{"none":"none","S":"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)","M":"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)","L":"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"}},"fontFamily":{"appFont":["System Default","Nunito Sans","Poppins","Inter","Montserrat","Noto Sans","Open Sans","Roboto","Rubik","Ubuntu"]}},"properties":{"colors":{"primaryColor":"#16a34a","backgroundColor":"#F8FAFC"},"borderRadius":{"appBorderRadius":"0.375rem"},"boxShadow":{"appBoxShadow":"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},"fontFamily":{"appFont":"Nunito Sans"}},"stylesheet":{"AUDIO_RECORDER_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"BUTTON_WIDGET":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"BUTTON_GROUP_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","childStylesheet":{"button":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}"}}},"CAMERA_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"CHART_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","accentColor":"{{appsmith.theme.colors.primaryColor}}","fontFamily":"{{appsmith.theme.fontFamily.appFont}}"},"CHECKBOX_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CHECKBOX_GROUP_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CONTAINER_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"CIRCULAR_PROGRESS_WIDGET":{"fillColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_INPUT_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATE_PICKER_WIDGET2":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"FILE_PICKER_WIDGET_V2":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"FORM_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"FORM_BUTTON_WIDGET":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"ICON_BUTTON_WIDGET":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"IFRAME_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"IMAGE_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"INPUT_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"INPUT_WIDGET_V2":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"JSON_FORM_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}}},"LIST_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"MAP_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"MAP_CHART_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","fontFamily":"{{appsmith.theme.fontFamily.appFont}}"},"MENU_BUTTON_WIDGET":{"menuColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MODAL_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTI_SELECT_TREE_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTI_SELECT_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTI_SELECT_WIDGET_V2":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DROP_DOWN_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PROGRESSBAR_WIDGET":{"fillColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"PROGRESS_WIDGET":{"fillColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CODE_SCANNER_WIDGET":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RATE_WIDGET":{"activeColor":"{{appsmith.theme.colors.primaryColor}}"},"RADIO_GROUP_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"RICH_TEXT_EDITOR_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"STATBOX_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"SWITCH_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SWITCH_GROUP_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}"},"SELECT_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"TABLE_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","childStylesheet":{"button":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"menuButton":{"menuColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"iconButton":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}}},"TABLE_WIDGET_V2":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","childStylesheet":{"button":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"menuButton":{"menuColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"iconButton":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"editActions":{"saveButtonColor":"{{appsmith.theme.colors.primaryColor}}","saveBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","discardButtonColor":"{{appsmith.theme.colors.primaryColor}}","discardBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"}}},"TABS_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"TEXT_WIDGET":{"truncateButtonColor":"{{appsmith.theme.colors.primaryColor}}","fontFamily":"{{appsmith.theme.fontFamily.appFont}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"VIDEO_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"SINGLE_SELECT_TREE_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"CATEGORY_SLIDER_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}"},"NUMBER_SLIDER_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}"},"RANGE_SLIDER_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}"}},"isSystemTheme":false,"deleted":false},"publishedTheme":{"name":"Default","displayName":"Modern","config":{"colors":{"primaryColor":"#553DE9","backgroundColor":"#F8FAFC"},"borderRadius":{"appBorderRadius":{"none":"0px","M":"0.375rem","L":"1.5rem"}},"boxShadow":{"appBoxShadow":{"none":"none","S":"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)","M":"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)","L":"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"}},"fontFamily":{"appFont":["System Default","Nunito Sans","Poppins","Inter","Montserrat","Noto Sans","Open Sans","Roboto","Rubik","Ubuntu"]}},"properties":{"colors":{"primaryColor":"#16a34a","backgroundColor":"#F8FAFC"},"borderRadius":{"appBorderRadius":"0.375rem"},"boxShadow":{"appBoxShadow":"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},"fontFamily":{"appFont":"Nunito Sans"}},"stylesheet":{"AUDIO_RECORDER_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"BUTTON_WIDGET":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"BUTTON_GROUP_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","childStylesheet":{"button":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}"}}},"CAMERA_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"CHART_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","accentColor":"{{appsmith.theme.colors.primaryColor}}","fontFamily":"{{appsmith.theme.fontFamily.appFont}}"},"CHECKBOX_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CHECKBOX_GROUP_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CONTAINER_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"CIRCULAR_PROGRESS_WIDGET":{"fillColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_INPUT_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATE_PICKER_WIDGET2":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"FILE_PICKER_WIDGET_V2":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"FORM_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"FORM_BUTTON_WIDGET":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"ICON_BUTTON_WIDGET":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"IFRAME_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"IMAGE_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"INPUT_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"INPUT_WIDGET_V2":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"JSON_FORM_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","submitButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"resetButtonStyles":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"childStylesheet":{"ARRAY":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"OBJECT":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none","cellBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","cellBoxShadow":"none"},"CHECKBOX":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CURRENCY_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DATEPICKER":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"EMAIL_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTISELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTILINE_TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PASSWORD_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PHONE_NUMBER_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RADIO_GROUP":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SELECT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"SWITCH":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"TEXT_INPUT":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}}},"LIST_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"MAP_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"MAP_CHART_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","fontFamily":"{{appsmith.theme.fontFamily.appFont}}"},"MENU_BUTTON_WIDGET":{"menuColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MODAL_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTI_SELECT_TREE_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTI_SELECT_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"MULTI_SELECT_WIDGET_V2":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"DROP_DOWN_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"PROGRESSBAR_WIDGET":{"fillColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"PROGRESS_WIDGET":{"fillColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"CODE_SCANNER_WIDGET":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"RATE_WIDGET":{"activeColor":"{{appsmith.theme.colors.primaryColor}}"},"RADIO_GROUP_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"RICH_TEXT_EDITOR_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"STATBOX_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"SWITCH_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","boxShadow":"none"},"SWITCH_GROUP_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}"},"SELECT_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"TABLE_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","childStylesheet":{"button":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"menuButton":{"menuColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"iconButton":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"}}},"TABLE_WIDGET_V2":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}","childStylesheet":{"button":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"menuButton":{"menuColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"iconButton":{"buttonColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"editActions":{"saveButtonColor":"{{appsmith.theme.colors.primaryColor}}","saveBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","discardButtonColor":"{{appsmith.theme.colors.primaryColor}}","discardBorderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"}}},"TABS_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"TEXT_WIDGET":{"truncateButtonColor":"{{appsmith.theme.colors.primaryColor}}","fontFamily":"{{appsmith.theme.fontFamily.appFont}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}"},"VIDEO_WIDGET":{"borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"{{appsmith.theme.boxShadow.appBoxShadow}}"},"SINGLE_SELECT_TREE_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}","borderRadius":"{{appsmith.theme.borderRadius.appBorderRadius}}","boxShadow":"none"},"CATEGORY_SLIDER_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}"},"NUMBER_SLIDER_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}"},"RANGE_SLIDER_WIDGET":{"accentColor":"{{appsmith.theme.colors.primaryColor}}"}},"isSystemTheme":false,"deleted":false}} diff --git a/Extras/chatwoot/configurar_admin.json b/Extras/chatwoot/configurar_admin.json new file mode 100644 index 00000000..823bae65 --- /dev/null +++ b/Extras/chatwoot/configurar_admin.json @@ -0,0 +1,241 @@ +{ + "name": "[Evolution] Configurar Admin", + "nodes": [ + { + "parameters": { + "values": { + "string": [ + { + "name": "api_access_token", + "value": "CHATWOOT_ADMIN_USER_TOKEN" + }, + { + "name": "chatwoot_url", + "value": "https://CHATWOOT_URL" + }, + { + "name": "n8n_url", + "value": "https://N8N_URL" + }, + { + "name": "organization", + "value": "ORGANIZATION_NAME" + }, + { + "name": "logo", + "value": "ORGANIZATION_LOGO" + } + ] + }, + "options": {} + }, + "id": "7a89a538-2cae-4032-8896-09627c07bc68", + "name": "Info Base", + "type": "n8n-nodes-base.set", + "typeVersion": 2, + "position": [ + 620, + 480 + ] + }, + { + "parameters": { + "method": "POST", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/contacts/", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Info Base').item.json[\"api_access_token\"] }}" + } + ] + }, + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={\n \"inbox_id\": {{ $('Cria Inbox Start').item.json[\"id\"] }},\n \"name\": \"Bot {{ $('Info Base').item.json[\"organization\"] }}\",\n \"phone_number\": \"+123456\",\n \"avatar_url\": \"{{ $('Info Base').item.json[\"logo\"] }}\"\n}", + "options": {} + }, + "id": "12a39df3-6b95-4f83-a0bc-50b25adaca7f", + "name": "Cria Contato Bot", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 1020, + 480 + ] + }, + { + "parameters": { + "method": "POST", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/inboxes/", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Info Base').item.json[\"api_access_token\"] }}" + } + ] + }, + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={\n \"name\": \"Start {{ $('Info Base').item.json[\"organization\"] }}\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}", + "options": {} + }, + "id": "bed7c54d-e232-4fe4-9584-0515e9679868", + "name": "Cria Inbox Start", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 820, + 480 + ] + }, + { + "parameters": {}, + "id": "36ada769-a757-4193-989b-0cc4ea504b80", + "name": "When clicking \"Execute Workflow\"", + "type": "n8n-nodes-base.manualTrigger", + "typeVersion": 1, + "position": [ + 420, + 480 + ] + }, + { + "parameters": { + "method": "POST", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/automation_rules/", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Info Base').item.json[\"api_access_token\"] }}" + } + ] + }, + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={\n \"name\": \"Create Company Chatwoot\",\n \"description\": \"Create Company Chatwoot\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/criadorchatwoot\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"Tema Criador de Empresa:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}", + "options": {} + }, + "id": "f5bbb285-71a8-4c58-a4d7-e56002d697f0", + "name": "Cria Automação Empresas", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 1220, + 480 + ] + }, + { + "parameters": { + "method": "POST", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/automation_rules/", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Info Base').item.json[\"api_access_token\"] }}" + } + ] + }, + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={\n \"name\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"description\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Info Base').item.json[\"api_access_token\"] }}&organization={{ $('Info Base').item.json[\"organization\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n \n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n\n\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}", + "options": {} + }, + "id": "a36bebdc-a318-40a2-8532-c7f476f8adb7", + "name": "Cria Automação Inboxes", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 1420, + 480 + ] + }, + { + "parameters": { + "content": "## Workflow Para Configurar admin\n**Aqui você prepara o Chatwoot Principal com um usuário (Superadmin) que poderá criar empresas e caixas de entrada**\n**Instruções**\n**No node Info Base, configure as variáveis de seu Chatwoot e N8N**\n**Obs: A variável api_access_token é o token do usuário que irá poder criar as empresas**", + "width": 894.6435495898575 + }, + "id": "db66e867-e9f4-452d-b521-725eeac652c8", + "name": "Sticky Note", + "type": "n8n-nodes-base.stickyNote", + "typeVersion": 1, + "position": [ + 420, + 280 + ] + } + ], + "pinData": {}, + "connections": { + "Info Base": { + "main": [ + [ + { + "node": "Cria Inbox Start", + "type": "main", + "index": 0 + } + ] + ] + }, + "Cria Contato Bot": { + "main": [ + [ + { + "node": "Cria Automação Empresas", + "type": "main", + "index": 0 + } + ] + ] + }, + "Cria Inbox Start": { + "main": [ + [ + { + "node": "Cria Contato Bot", + "type": "main", + "index": 0 + } + ] + ] + }, + "When clicking \"Execute Workflow\"": { + "main": [ + [ + { + "node": "Info Base", + "type": "main", + "index": 0 + } + ] + ] + }, + "Cria Automação Empresas": { + "main": [ + [ + { + "node": "Cria Automação Inboxes", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": false, + "settings": {}, + "versionId": "78f155dc-7809-4bfc-9282-63f49b07fc4d", + "id": "BSATyGpGWLR4ZwNm", + "meta": { + "instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906" + }, + "tags": [] +} \ No newline at end of file diff --git a/Extras/chatwoot/criador_de_empresas.json b/Extras/chatwoot/criador_de_empresas.json new file mode 100644 index 00000000..aa97a6bd --- /dev/null +++ b/Extras/chatwoot/criador_de_empresas.json @@ -0,0 +1,456 @@ +{ + "name": "[Evolution] Criador de Empresas", + "nodes": [ + { + "parameters": { + "httpMethod": "POST", + "path": "criadorchatwoot", + "options": {} + }, + "id": "5a47c10a-e43c-4fa5-baad-4b6cc511bfcd", + "name": "Webhook", + "type": "n8n-nodes-base.webhook", + "typeVersion": 1, + "position": [ + 1420, + 860 + ], + "webhookId": "6fe428e3-1752-453c-9358-abf18b793387" + }, + { + "parameters": { + "method": "POST", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/platform/api/v1/accounts", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Info Base').item.json[\"api_access_token\"] }}" + } + ] + }, + "sendBody": true, + "bodyParameters": { + "parameters": [ + { + "name": "name", + "value": "={{ $json.name_company }}" + }, + { + "name": "locale", + "value": "pt_BR" + } + ] + }, + "options": {} + }, + "id": "8295c119-3a96-424e-9386-43d75f6816f5", + "name": "Cria Conta", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 2020, + 860 + ] + }, + { + "parameters": { + "method": "POST", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/platform/api/v1/users", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Info Base').item.json[\"api_access_token\"] }}" + } + ] + }, + "sendBody": true, + "bodyParameters": { + "parameters": [ + { + "name": "name", + "value": "={{ $('Info Base').item.json.name_admin }}" + }, + { + "name": "email", + "value": "={{ $('Info Base').item.json[\"email\"] }}" + }, + { + "name": "password", + "value": "={{ $('Info Base').item.json[\"password\"] }}" + } + ] + }, + "options": {} + }, + "id": "4fe5007a-3a6b-490a-a446-e45cc168189f", + "name": "Cria Usuario", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 2220, + 860 + ] + }, + { + "parameters": { + "method": "POST", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/platform/api/v1/accounts/{{ $node[\"Cria Conta\"].json[\"id\"] }}/account_users", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Info Base').item.json[\"api_access_token\"] }}" + } + ] + }, + "sendBody": true, + "bodyParameters": { + "parameters": [ + { + "name": "user_id", + "value": "={{ $node[\"Cria Usuario\"].json[\"id\"] }}" + }, + { + "name": "role", + "value": "administrator" + } + ] + }, + "options": {} + }, + "id": "848c55e2-5678-4291-9602-c94d994da95b", + "name": "Add Usuario a Conta", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 2420, + 860 + ] + }, + { + "parameters": { + "fromEmail": "={{ $('Info Base').item.json[\"from_email\"] }}", + "toEmail": "={{ $('LimpaDados').item.json.email }}", + "subject": "=Bem vindo à {{ $('Info Base').item.json[\"organization\"] }}", + "text": "=Olá seja bem vindo:\n\nAbaixo segue seus dados de acesso:\n\nURL: {{ $('Info Base').item.json[\"chatwoot_url\"] }}\n\nuser: {{ $('LimpaDados').item.json[\"email\"] }}\n\nSenha: {{ $('LimpaDados').item.json[\"password\"] }}", + "options": {} + }, + "id": "27f3b24f-1cf2-4d0d-a354-ecba066059f6", + "name": "Send Email", + "type": "n8n-nodes-base.emailSend", + "typeVersion": 2, + "position": [ + 3220, + 860 + ], + "credentials": { + "smtp": { + "id": "6BxluEUV8zrXKoVG", + "name": "[Dgcode] SMTP" + } + } + }, + { + "parameters": { + "values": { + "string": [ + { + "name": "api_access_token", + "value": "CHATWOOT_PLATFORM_TOKEN" + }, + { + "name": "chatwoot_url", + "value": "https://CHATWOOT_URL" + }, + { + "name": "n8n_url", + "value": "https://N8N_URL" + }, + { + "name": "organization", + "value": "ORGANIZATION_NAME" + }, + { + "name": "logo", + "value": "ORGANIZATION_LOGO" + }, + { + "name": "from_email", + "value": "FROM_EMAIL" + }, + { + "name": "name", + "value": "={{ $json.name_company }}" + }, + { + "name": "email", + "value": "={{ $json.email }}" + }, + { + "name": "password", + "value": "={{ $json.password }}" + }, + { + "name": "name_company", + "value": "={{ $json.name_company }}" + } + ] + }, + "options": {} + }, + "id": "38b4069d-e51e-4db7-933f-941b1be6d124", + "name": "Info Base", + "type": "n8n-nodes-base.set", + "typeVersion": 2, + "position": [ + 1820, + 860 + ] + }, + { + "parameters": { + "keepOnlySet": true, + "values": { + "string": [ + { + "name": "name_admin", + "value": "={{$node[\"Webhook\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Nome Usuario Administrador: ([^\\n]+)/)[1];}}" + }, + { + "name": "name_company", + "value": "={{$node[\"Webhook\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Nome da Empresa: ([^\\n]+)/)[1];}}" + }, + { + "name": "email", + "value": "={{$node[\"Webhook\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Email: ([^\\s]+)/)[1];}}" + }, + { + "name": "password", + "value": "={{$node[\"Webhook\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Senha: ([^\\s]+)/)[1];}}" + } + ] + }, + "options": {} + }, + "id": "28e29e73-aadc-49ca-bd6d-b57ee0160a21", + "name": "LimpaDados", + "type": "n8n-nodes-base.set", + "typeVersion": 2, + "position": [ + 1620, + 860 + ] + }, + { + "parameters": { + "method": "POST", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Add Usuario a Conta').item.json.account_id }}/contacts/", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Cria Usuario').item.json.access_token }}" + } + ] + }, + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={\n \"inbox_id\": {{ $('Cria Inbox Start').item.json[\"id\"] }},\n \"name\": \"Bot {{ $('Info Base').item.json[\"organization\"] }}\",\n \"phone_number\": \"+123456\",\n \"avatar_url\": \"{{ $('Info Base').item.json[\"logo\"] }}\"\n}", + "options": {} + }, + "id": "bb671443-bdb4-4f56-99af-f0baef246a3e", + "name": "Cria Contato Bot", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 2820, + 860 + ] + }, + { + "parameters": { + "method": "POST", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Add Usuario a Conta').item.json.account_id }}/automation_rules/", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Cria Usuario').item.json.access_token }}" + } + ] + }, + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={\n \"name\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"description\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Cria Usuario').item.json.access_token }}&organization={{ $('Info Base').item.json[\"organization\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}", + "options": {} + }, + "id": "e016a2af-b212-4e00-a3ff-8cd03530aa06", + "name": "Cria Automação", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 3020, + 860 + ] + }, + { + "parameters": { + "method": "POST", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $json.account_id }}/inboxes/", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Cria Usuario').item.json.access_token }}" + } + ] + }, + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={\n \"name\": \"Start {{ $('Info Base').item.json[\"organization\"] }}\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}", + "options": {} + }, + "id": "d3c42148-8920-4c98-a874-eb7113f2dd22", + "name": "Cria Inbox Start", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 2620, + 860 + ] + }, + { + "parameters": { + "content": "## Workflow Criador de Empresas\n**Cria Contas (Empresas) e Usuários através de tema**\n**Instruções**\n**No node Info Base, configure as variáveis de seu Chatwoot e N8N**\n**Obs: A variável api_access_token é o token PlatformApp encontrado no acesso ao Super Admin**\n**Tema para criar novas empresa:**\n\nTema Criador de Empresa:\n\nNome Usuario Administrador: Joao Linhares\nNome da Empresa: Oficina Linhates\nEmail: machineteste24@gmail.com\nSenha: Mfcd62!!", + "height": 304.02684563758396, + "width": 1129.7777777777778 + }, + "id": "d07516c0-4c8e-43ab-ba86-c8d063b09be5", + "name": "Sticky Note", + "type": "n8n-nodes-base.stickyNote", + "typeVersion": 1, + "position": [ + 1420, + 520 + ] + } + ], + "pinData": {}, + "connections": { + "Webhook": { + "main": [ + [ + { + "node": "LimpaDados", + "type": "main", + "index": 0 + } + ] + ] + }, + "Cria Conta": { + "main": [ + [ + { + "node": "Cria Usuario", + "type": "main", + "index": 0 + } + ] + ] + }, + "Cria Usuario": { + "main": [ + [ + { + "node": "Add Usuario a Conta", + "type": "main", + "index": 0 + } + ] + ] + }, + "Add Usuario a Conta": { + "main": [ + [ + { + "node": "Cria Inbox Start", + "type": "main", + "index": 0 + } + ] + ] + }, + "Info Base": { + "main": [ + [ + { + "node": "Cria Conta", + "type": "main", + "index": 0 + } + ] + ] + }, + "LimpaDados": { + "main": [ + [ + { + "node": "Info Base", + "type": "main", + "index": 0 + } + ] + ] + }, + "Cria Contato Bot": { + "main": [ + [ + { + "node": "Cria Automação", + "type": "main", + "index": 0 + } + ] + ] + }, + "Cria Automação": { + "main": [ + [ + { + "node": "Send Email", + "type": "main", + "index": 0 + } + ] + ] + }, + "Cria Inbox Start": { + "main": [ + [ + { + "node": "Cria Contato Bot", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": true, + "settings": {}, + "versionId": "3ffd6d3f-6966-4de4-af8f-1fda464bc1b8", + "id": "79R6qQDtfyCwgYjJ", + "meta": { + "instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906" + }, + "tags": [] +} \ No newline at end of file diff --git a/Extras/chatwoot/criador_de_inbox.json b/Extras/chatwoot/criador_de_inbox.json new file mode 100644 index 00000000..ddf32ace --- /dev/null +++ b/Extras/chatwoot/criador_de_inbox.json @@ -0,0 +1,510 @@ +{ + "name": "[Evolution] Criador de Inbox", + "nodes": [ + { + "parameters": { + "httpMethod": "POST", + "path": "inbox_whatsapp", + "options": {} + }, + "id": "8205b929-73e9-456a-9b0d-e1474991663a", + "name": "Webhook", + "type": "n8n-nodes-base.webhook", + "typeVersion": 1, + "position": [ + 320, + 300 + ], + "webhookId": "cf37002d-3869-4bb1-af3a-739fdd3c1756" + }, + { + "parameters": { + "method": "POST", + "url": "={{ $json.evolution_url }}/instance/create", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "Content-Type", + "value": "application/json" + }, + { + "name": "apikey", + "value": "={{ $json.global_api_key }}" + } + ] + }, + "sendBody": true, + "bodyParameters": { + "parameters": [ + { + "name": "instanceName", + "value": "={{ $json.instance_name }}" + }, + { + "name": "qrcode", + "value": "={{ $json.qrcode }}" + }, + { + "name": "chatwoot_account_id", + "value": "={{ $json.chatwoot_account_id }}" + }, + { + "name": "chatwoot_token", + "value": "={{ $json.chatwoot_token }}" + }, + { + "name": "chatwoot_url", + "value": "={{ $json.chatwoot_url }}" + }, + { + "name": "chatwoot_sign_msg", + "value": "={{ $json.chatwoot_sign_msg }}" + }, + { + "name": "chatwoot_reopen_conversation", + "value": "={{ $json.chatwoot_reopen_conversation }}" + }, + { + "name": "chatwoot_conversation_pending", + "value": "={{ $json.chatwoot_conversation_pending }}" + }, + { + "name": "reject_call", + "value": "={{ $json.reject_call }}" + }, + { + "name": "msg_call", + "value": "={{ $json.msg_call }}" + }, + { + "name": "groups_ignore", + "value": "={{ $json.groups_ignore }}" + }, + { + "name": "always_online", + "value": "={{ $json.always_online }}" + }, + { + "name": "read_messages", + "value": "={{ $json.read_messages }}" + }, + { + "name": "read_status", + "value": "={{ $json.read_status }}" + } + ] + }, + "options": {} + }, + "id": "275aa370-2fdb-42f4-844a-2fb3051301bd", + "name": "Cria Instancia", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.1, + "position": [ + 760, + 300 + ] + }, + { + "parameters": { + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Info Base').item.json[\"chatwoot_account_id\"] }}/inboxes/", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Info Base').item.json.chatwoot_token }}" + } + ] + }, + "options": {} + }, + "id": "e4650812-ba0a-4f72-8bd8-a235eca4b2de", + "name": "Lista Inboxes", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 980, + 300 + ] + }, + { + "parameters": { + "content": "## Workflow Para Criar Inbox\n**Aqui você configura a comunicação entre o chatwoot e a Evolution API para criar novas instâncias a partir do chatwoot**\n**Instruções**\n**No node Info Base, configure as variáveis de seu Chatwoot e Evolution API**", + "width": 1129.7777777777778 + }, + "id": "aa763d9e-d973-44fc-8399-277bb24718a5", + "name": "Sticky Note", + "type": "n8n-nodes-base.stickyNote", + "typeVersion": 1, + "position": [ + 320, + 80 + ] + }, + { + "parameters": { + "keepOnlySet": true, + "values": { + "string": [ + { + "name": "chatwoot_url", + "value": "CHATWOOT_URL" + }, + { + "name": "evolution_url", + "value": "EVOLUTION_URL" + }, + { + "name": "global_api_key", + "value": "EVOLUTION_GLOBAL_API_KEY" + }, + { + "name": "organization", + "value": "={{ $json.query.organization }}" + }, + { + "name": "instance_name", + "value": "={{ $json.body.messages[0].content.split(':')[1] }}-cwId-{{ $json.body.messages[0].account_id }}" + }, + { + "name": "chatwoot_token", + "value": "={{ $json.query.utoken }}" + }, + { + "name": "msg_call", + "value": "Não aceitamos chamadas, por favor deixe uma mensagem!" + } + ], + "boolean": [ + { + "name": "qrcode", + "value": true + }, + { + "name": "chatwoot_sign_msg", + "value": true + }, + { + "name": "chatwoot_reopen_conversation", + "value": true + }, + { + "name": "chatwoot_conversation_pending" + }, + { + "name": "reject_call", + "value": true + }, + { + "name": "groups_ignore" + }, + { + "name": "always_online", + "value": true + }, + { + "name": "read_messages", + "value": true + }, + { + "name": "read_status" + } + ], + "number": [ + { + "name": "chatwoot_account_id", + "value": "={{ $json.body.messages[0].account_id }}" + } + ] + }, + "options": {} + }, + "id": "297df325-ecc4-4a34-817c-092d16d5753b", + "name": "Info Base", + "type": "n8n-nodes-base.set", + "typeVersion": 2, + "position": [ + 540, + 300 + ] + }, + { + "parameters": { + "conditions": { + "string": [ + { + "value1": "={{ $json.name }}", + "value2": "=Start {{ $('Info Base').item.json[\"organization\"] }}" + } + ] + } + }, + "id": "a8d955e6-ac51-4316-aeec-09d4d65e943a", + "name": "é Start Inbox?", + "type": "n8n-nodes-base.if", + "typeVersion": 1, + "position": [ + 1660, + 200 + ] + }, + { + "parameters": { + "batchSize": 1, + "options": {} + }, + "id": "0d2d2194-aa4a-4241-9022-217d88bb581f", + "name": "Split In Batches", + "type": "n8n-nodes-base.splitInBatches", + "typeVersion": 2, + "position": [ + 1420, + 300 + ] + }, + { + "parameters": { + "conditions": { + "string": [ + { + "value1": "={{ $json.name }}", + "value2": "={{ $('Webhook').item.json[\"body\"][\"messages\"][0][\"content\"].split(':')[1] }}" + } + ] + } + }, + "id": "0bfbc2cb-eff5-423c-bd3a-b266aaf6a943", + "name": "é_pre-existente?", + "type": "n8n-nodes-base.if", + "typeVersion": 1, + "position": [ + 1900, + 340 + ] + }, + { + "parameters": { + "method": "PATCH", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Info Base').item.json[\"chatwoot_account_id\"] }}/inboxes/{{ $json.id }}", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Info Base').item.json.chatwoot_token }}" + }, + { + "name": "Content-Type", + "value": "application/json" + } + ] + }, + "sendBody": true, + "specifyBody": "json", + "jsonBody": "={\n\"channel\": {\n\"webhook_url\": \"{{ $('Info Base').item.json[\"evolution_url\"] }}/chatwoot/webhook/{{ encodeURIComponent($('Info Base').item.json[\"instance_name\"]) }}\"\n}\n}", + "options": {} + }, + "id": "fb589456-5566-4a45-96a7-75986d0aa1d5", + "name": "Update_webhook_url", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 2120, + 340 + ] + }, + { + "parameters": { + "method": "DELETE", + "url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Info Base').item.json[\"chatwoot_account_id\"] }}/inboxes/{{ $json.id }}", + "sendHeaders": true, + "headerParameters": { + "parameters": [ + { + "name": "api_access_token", + "value": "={{ $('Info Base').item.json.chatwoot_token }}" + } + ] + }, + "options": {} + }, + "id": "e6094941-410f-496c-9c9c-7b95fd9349af", + "name": "Deleta Inbox Start", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 3, + "position": [ + 1900, + 100 + ] + }, + { + "parameters": {}, + "id": "8cf9a78f-9e8a-4288-9d7b-801790af68d5", + "name": "No Operation, do nothing", + "type": "n8n-nodes-base.noOp", + "typeVersion": 1, + "position": [ + 1660, + 400 + ] + }, + { + "parameters": { + "fieldToSplitOut": "payload", + "options": {} + }, + "id": "9468896a-5f86-4598-9d20-e8f495cae859", + "name": "Ajusta lista", + "type": "n8n-nodes-base.itemLists", + "typeVersion": 2.2, + "position": [ + 1200, + 300 + ] + } + ], + "pinData": {}, + "connections": { + "Webhook": { + "main": [ + [ + { + "node": "Info Base", + "type": "main", + "index": 0 + } + ] + ] + }, + "Lista Inboxes": { + "main": [ + [ + { + "node": "Ajusta lista", + "type": "main", + "index": 0 + } + ] + ] + }, + "Cria Instancia": { + "main": [ + [ + { + "node": "Lista Inboxes", + "type": "main", + "index": 0 + } + ] + ] + }, + "Info Base": { + "main": [ + [ + { + "node": "Cria Instancia", + "type": "main", + "index": 0 + } + ] + ] + }, + "é Start Inbox?": { + "main": [ + [ + { + "node": "Deleta Inbox Start", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "é_pre-existente?", + "type": "main", + "index": 0 + } + ] + ] + }, + "Split In Batches": { + "main": [ + [ + { + "node": "é Start Inbox?", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "No Operation, do nothing", + "type": "main", + "index": 0 + } + ] + ] + }, + "é_pre-existente?": { + "main": [ + [ + { + "node": "Update_webhook_url", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Split In Batches", + "type": "main", + "index": 0 + } + ] + ] + }, + "Update_webhook_url": { + "main": [ + [ + { + "node": "Split In Batches", + "type": "main", + "index": 0 + } + ] + ] + }, + "Deleta Inbox Start": { + "main": [ + [ + { + "node": "Split In Batches", + "type": "main", + "index": 0 + } + ] + ] + }, + "Ajusta lista": { + "main": [ + [ + { + "node": "Split In Batches", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": true, + "settings": {}, + "versionId": "ab910349-b559-4738-9ac6-de6b06d6bbce", + "id": "ByW2ccjR4XPrOyio", + "meta": { + "instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906" + }, + "tags": [] +} \ No newline at end of file diff --git a/Extras/typebot/typebot-example.json b/Extras/typebot/typebot-example.json new file mode 100644 index 00000000..c45cd509 --- /dev/null +++ b/Extras/typebot/typebot-example.json @@ -0,0 +1 @@ +{"id":"l27ft2bq9a7tke15i7m64d9o","version":"3","createdAt":"2023-08-04T17:27:18.072Z","updatedAt":"2023-08-20T13:35:33.073Z","icon":null,"name":"[Dgcode] [whatsapp] Pesquisa Satisfacao","folderId":"cll1fzkfy0008pa65kgz3tm86","groups":[{"id":"c76ucoughhenpernmadu7ibg","title":"Start","blocks":[{"id":"qn40kjwtw1he3l1bujt3bnje","type":"start","label":"Start","groupId":"c76ucoughhenpernmadu7ibg","outgoingEdgeId":"aovnigvk665gzhyzg7bxhvn0"}],"graphCoordinates":{"x":-126.43,"y":220.29}},{"id":"nog2woqmvhssnnjlcpwd41k5","title":"Apresentação","blocks":[{"id":"potdr8jwrn6mnkjipynqjmhh","type":"Set variable","groupId":"nog2woqmvhssnnjlcpwd41k5","options":{"type":"Random ID","variableId":"vsu5or5sxes9lyuhsgcl3cuyd"}},{"id":"mcpyoq8x28bnwp23g7h1dbc1","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Olá! {{pushName}} Bem-vindo(a) à nossa "},{"bold":true,"text":"pesquisa de satisfação"},{"text":"."}]}]},"groupId":"nog2woqmvhssnnjlcpwd41k5"},{"id":"o0731ch0epj2vm2c5aoxyvw1","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Meu nome é "},{"bold":true,"text":"🤖 Mike"},{"text":", estou aqui para ouvir sua opinião e experiência com nossos serviços."}]}]},"groupId":"nog2woqmvhssnnjlcpwd41k5"},{"id":"twx683ok814enh3bwlaexe0t","type":"Wait","groupId":"nog2woqmvhssnnjlcpwd41k5","options":{"secondsToWaitFor":"5"}},{"id":"hgqbj5kmosz64cb435xqh0am","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Sua opinião é fundamental para nos ajudar a melhorar!"}]}]},"groupId":"nog2woqmvhssnnjlcpwd41k5"},{"id":"cbvgdo0jknjyzmvwe6o614ni","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Vamos começar?"}]}]},"groupId":"nog2woqmvhssnnjlcpwd41k5"},{"id":"vpj58atr9o534tjhhu0l0t0b","type":"Wait","groupId":"nog2woqmvhssnnjlcpwd41k5","options":{"secondsToWaitFor":"5"}},{"id":"nmhkn4jod3evk08tbq5vw3s3","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Qual o seu nome?"}]}]},"groupId":"nog2woqmvhssnnjlcpwd41k5"},{"id":"o8ijci5gdfsp6fpv07kwh8br","type":"text input","groupId":"nog2woqmvhssnnjlcpwd41k5","options":{"isLong":false,"labels":{"button":"Enviar","placeholder":"Digite o seu nome"},"variableId":"vo40px5r6wg9vhs9fixd45kzn"},"outgoingEdgeId":"vwx6ofz1ur8maxcbw8fk66x9"}],"graphCoordinates":{"x":771.26,"y":213}},{"id":"j5co2kcotxafuxhzlj7u0qnn","title":"Qual seu email?","blocks":[{"id":"he1367t9ssao735kidd86mna","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Muito bem {{name}}, agora me informe seu endereço de email?"}]}]},"groupId":"j5co2kcotxafuxhzlj7u0qnn"},{"id":"qb8nwfs52g168tmnvp257b44","type":"email input","groupId":"j5co2kcotxafuxhzlj7u0qnn","options":{"labels":{"button":"Enviar","placeholder":"Digite o seu email"},"variableId":"vr75l1drc5uoxvisje0hio5ph","retryMessageContent":"Email incorreto!"},"outgoingEdgeId":"v53mvhejcapb4a1zq98swq5b"}],"graphCoordinates":{"x":1236.92,"y":204.84}},{"id":"wtd0o382phaji7i7u2n8pody","title":"Pergunta 1","blocks":[{"id":"zr69lw3bcmmkgahqq8og7shw","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Em uma escala de 0 a 10, qual é o seu nível de satisfação geral com os serviços que nossa empresa fornece?"}]}]},"groupId":"wtd0o382phaji7i7u2n8pody"},{"id":"ku0zpu43cbbnd7y0ai71ptde","type":"rating input","groupId":"wtd0o382phaji7i7u2n8pody","options":{"labels":{"button":"Send"},"length":10,"buttonType":"Numbers","customIcon":{"isEnabled":false},"variableId":"vbfl3sqze2wzicn9l1n9ckjs4"},"outgoingEdgeId":"ed1x8zan90zvrpo9xk9moroe"}],"graphCoordinates":{"x":1692.4,"y":194.19}},{"id":"ylerbfc1l2o62j68g8ghegxt","title":"Pergunta 2","blocks":[{"id":"l19jgtpln9al473dudr0gbzn","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Em uma escala de 0 a 10, em que medida nossa empresa atendeu às suas expectativas em termos de qualidade do serviço prestado?"}]}]},"groupId":"ylerbfc1l2o62j68g8ghegxt"},{"id":"kfxuc6p58cdzy1xcyp4i4ra7","type":"rating input","groupId":"ylerbfc1l2o62j68g8ghegxt","options":{"labels":{"button":"Send"},"length":10,"buttonType":"Numbers","customIcon":{"isEnabled":false},"variableId":"vkgl2bfdbyms1dyc1s6efx678"},"outgoingEdgeId":"iy61ajcfl6ubbj7zghxeu6f7"}],"graphCoordinates":{"x":2156.14,"y":190.76}},{"id":"lbieknd0qp42pogsby5l82ww","title":"Pergunta 3","blocks":[{"id":"y43s12dnoxh772c9o3pmnhxf","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Você teve alguma dificuldade em se comunicar com nossa equipe de suporte ao cliente?"}]},{"type":"p","children":[{"text":""}]},{"type":"p","children":[{"text":"1 - Sim"}]},{"type":"p","children":[{"text":"2 - Não"}]}]},"groupId":"lbieknd0qp42pogsby5l82ww"},{"id":"fb6ckchqp8vx9ypig07we6q4","type":"text input","groupId":"lbieknd0qp42pogsby5l82ww","options":{"isLong":false,"labels":{"button":"Enviar","placeholder":"Responda com uma das opções"},"variableId":"vzhsu0uc4suqoz38kv3q891ma"}},{"id":"b538q1mt18l6oddo397nh1m4","type":"Condition","items":[{"id":"dwhc3ptqvktlgfvl17xg79s5","type":1,"blockId":"b538q1mt18l6oddo397nh1m4","content":{"comparisons":[{"id":"rln6ido55pzqyr9ihqp3r0oe","value":"^([Ss][IiÍí][Mm]|1)$","variableId":"vzhsu0uc4suqoz38kv3q891ma","comparisonOperator":"Matches regex"}],"logicalOperator":"OR"},"outgoingEdgeId":"w6ao5pi6wt0966tobkned56m"},{"id":"cod3tkt16ry8ixm5u7rwxzm9","type":1,"blockId":"b538q1mt18l6oddo397nh1m4","content":{"comparisons":[{"id":"n0dm7n4vyowa9bftkmu0ypud","value":"^([Nn][AaÃã][Oo]|2)$","variableId":"vzhsu0uc4suqoz38kv3q891ma","comparisonOperator":"Matches regex"}],"logicalOperator":"OR"},"outgoingEdgeId":"wlfmh2g3j5avj75sa9q6rsab"}],"groupId":"lbieknd0qp42pogsby5l82ww","outgoingEdgeId":"ehcwqdrkc4025pui2y1s9390"}],"graphCoordinates":{"x":2605.34,"y":189.93}},{"id":"qzhp25b9f2lvt4yeniqvjkav","title":"Pergunta 4","blocks":[{"id":"pos7njae2r35r29kcbyxtz2j","type":"text","content":{"richText":[{"type":"p","children":[{"text":"{{name}}, por favor, descreva o problema para que possamos melhorar."}]}]},"groupId":"qzhp25b9f2lvt4yeniqvjkav"},{"id":"ce2eodve0e4f2rubk4wv5jf1","type":"text input","groupId":"qzhp25b9f2lvt4yeniqvjkav","options":{"isLong":false,"labels":{"button":"Enviar","placeholder":"Descreva o problema"},"variableId":"vd6fm2i9shcdjz8bhhwbsdh6t"},"outgoingEdgeId":"i11xudmpsb1tbsss7qoge6cm"}],"graphCoordinates":{"x":3041.23,"y":187.11}},{"id":"c8kh8eee1m3wyy372v4n6m1i","title":"Pergunta 5","blocks":[{"id":"txqi87lwinpa0p5of0xmqxu6","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Em uma escala de 0 a 10, como você avalia a capacidade da nossa empresa de cumprir os prazos acordados?"}]}]},"groupId":"c8kh8eee1m3wyy372v4n6m1i"},{"id":"mg2tmcmwnx3tap0hs4b7e0la","type":"rating input","groupId":"c8kh8eee1m3wyy372v4n6m1i","options":{"labels":{"button":"Enviar"},"length":10,"buttonType":"Numbers","customIcon":{"isEnabled":false},"variableId":"vz6lvahwo15dosvckdtkxduly"},"outgoingEdgeId":"c9nrzzcxt8w4dgk2sfez53n5"}],"graphCoordinates":{"x":3501.8,"y":179.58}},{"id":"tn8bcyughy9dsxhmjngrosvj","title":"Pergunta 6","blocks":[{"id":"aema350m33n9dljopcsxn8q5","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Você recomendaria nossos serviços para outras pessoas ou empresas?"}]},{"type":"p","children":[{"text":""}]},{"type":"p","children":[{"text":"1 - Sim"}]},{"type":"p","children":[{"text":"2 - Não"}]}]},"groupId":"tn8bcyughy9dsxhmjngrosvj"},{"id":"wk4bkxbxcfu9skrzn8p8077u","type":"text input","groupId":"tn8bcyughy9dsxhmjngrosvj","options":{"isLong":false,"labels":{"button":"Enviar","placeholder":"Responda com uma das opções"},"variableId":"vndjnalmnb3ez9beeon5tzrgq"}},{"id":"n3j2dxaalkljl020o0o61ef9","type":"Condition","items":[{"id":"ifhm8cj8lsulhrarnfda2oal","type":1,"blockId":"n3j2dxaalkljl020o0o61ef9","content":{"comparisons":[{"id":"rln6ido55pzqyr9ihqp3r0oe","value":"^([Ss][IiÍí][Mm]|1)$","variableId":"vndjnalmnb3ez9beeon5tzrgq","comparisonOperator":"Matches regex"}],"logicalOperator":"OR"},"outgoingEdgeId":"yu9762ttf5jn3bmhd6uzrsv8"},{"id":"gxp6j3ouga4r0t8364tn8axs","type":1,"blockId":"n3j2dxaalkljl020o0o61ef9","content":{"comparisons":[{"id":"n0dm7n4vyowa9bftkmu0ypud","value":"^([Nn][AaÃã][Oo]|2)$","variableId":"vndjnalmnb3ez9beeon5tzrgq","comparisonOperator":"Matches regex"}],"logicalOperator":"OR"},"outgoingEdgeId":"ji1y2o1hldhemto0ymwou09c"}],"groupId":"tn8bcyughy9dsxhmjngrosvj","outgoingEdgeId":"d3u83fikqplfy9ntva3sm7eg"}],"graphCoordinates":{"x":3926.41,"y":186.15}},{"id":"nzkhdw3hdv550aepsxvk2a0u","title":"Pergunta 7","blocks":[{"id":"io90onrpfrokejgkps94r3dj","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Que pena {{name}}, por gentileza, nos conte o motivo?"}]}]},"groupId":"nzkhdw3hdv550aepsxvk2a0u"},{"id":"dj7dbgyjqk0a5u3jn6kzykb2","type":"text input","groupId":"nzkhdw3hdv550aepsxvk2a0u","options":{"isLong":false,"labels":{"button":"Enviar","placeholder":"Digite o motivo"},"variableId":"vept0w6tr0w7eyyi52hgq1r3c"},"outgoingEdgeId":"k7vrrf5cfxopvmhsbf35bt3m"}],"graphCoordinates":{"x":4352.64,"y":194.04}},{"id":"jdz9w8vrz09vefk4wqrf0vwl","title":"Pergunta 8","blocks":[{"id":"hndzyb58fqxudykajr22skla","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Existe alguma sugestão que você gostaria de nos dar para melhorar nossos serviços?"}]},{"type":"p","children":[{"text":""}]},{"type":"p","children":[{"text":"1 - Sim"}]},{"type":"p","children":[{"text":"2 - Não"}]}]},"groupId":"jdz9w8vrz09vefk4wqrf0vwl"},{"id":"ol9l8fdb3q65auykrn383q6d","type":"text input","groupId":"jdz9w8vrz09vefk4wqrf0vwl","options":{"isLong":false,"labels":{"button":"Enviar","placeholder":"Responda com uma das opções"},"variableId":"vy5it60mewmth7mayzhlgmzf0"}},{"id":"zderh9hqjkpuz58p79szfa1i","type":"Condition","items":[{"id":"lur26nqa8dv7m4jmmljpyyf1","type":1,"blockId":"zderh9hqjkpuz58p79szfa1i","content":{"comparisons":[{"id":"rln6ido55pzqyr9ihqp3r0oe","value":"^([Ss][IiÍí][Mm]|1)$","variableId":"vy5it60mewmth7mayzhlgmzf0","comparisonOperator":"Matches regex"}],"logicalOperator":"OR"},"outgoingEdgeId":"x2fzu1uuukp9cgmdzecp7mgk"},{"id":"aoj7e49zimwxng4o7bd6u00s","type":1,"blockId":"zderh9hqjkpuz58p79szfa1i","content":{"comparisons":[{"id":"n0dm7n4vyowa9bftkmu0ypud","value":"^([Nn][AaÃã][Oo]|2)$","variableId":"vy5it60mewmth7mayzhlgmzf0","comparisonOperator":"Matches regex"}],"logicalOperator":"OR"},"outgoingEdgeId":"mb1fg83gijikrafud2ml6zbn"}],"groupId":"jdz9w8vrz09vefk4wqrf0vwl","outgoingEdgeId":"amyrx4i2rm3cjksym5zvwd50"}],"graphCoordinates":{"x":4768.69,"y":201.49}},{"id":"c4k1ftb4rbynkb01ulwuh4qh","title":"Pergunta 9","blocks":[{"id":"jqn5de3i29ygjyf6usbj117t","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Qual seria a sua sugestão?"}]}]},"groupId":"c4k1ftb4rbynkb01ulwuh4qh"},{"id":"wfucksh3yaeq21l7mnlnsx75","type":"text input","groupId":"c4k1ftb4rbynkb01ulwuh4qh","options":{"isLong":false,"labels":{"button":"Enviar","placeholder":"Deixe sua sugestão"},"variableId":"vhygxyvhu5l6r2uws1cbthmxm"},"outgoingEdgeId":"u8c55of7l95fnz25gf7swt1m"}],"graphCoordinates":{"x":5233.77,"y":205.27}},{"id":"vvyooiddvdbon0t21bvzdr7q","title":"Finalização","blocks":[{"id":"efk089lhks1ev4khy38caner","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Então {{name}}, agradecemos muito por dedicar um tempo para nos fornecer seu feedback."}]}]},"groupId":"vvyooiddvdbon0t21bvzdr7q"},{"id":"pvu3g8vpqdi3aecu2u0in2d0","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Sua opinião é muito importante para nós, e trabalharemos arduamente para melhorar ainda mais nossos serviços!"}]}]},"groupId":"vvyooiddvdbon0t21bvzdr7q"},{"id":"wqe9r1ivjf0ikubqichufzsg","type":"Webhook","groupId":"vvyooiddvdbon0t21bvzdr7q","options":{"isCustomBody":true,"isAdvancedConfig":true,"variablesForTest":[],"responseVariableMapping":[]},"webhookId":"i3g1959ev6fl9s61ir8hn1we"}],"graphCoordinates":{"x":7067.06,"y":231.55}},{"id":"ffm0s2y4head3auw808hwfnx","title":"Retorna Pergunta 3","blocks":[{"id":"ox70407atqtf1kwrszis4cix","type":"Set variable","groupId":"ffm0s2y4head3auw808hwfnx","options":{"type":"Empty","variableId":"vzhsu0uc4suqoz38kv3q891ma"}},{"id":"bcwkrcxtsc8drzwynb2igu0g","type":"Jump","groupId":"ffm0s2y4head3auw808hwfnx","options":{"groupId":"lbieknd0qp42pogsby5l82ww"}}],"graphCoordinates":{"x":3040.8,"y":772.28}},{"id":"cf8r0wx0sgw6c9v79ebja1tj","title":"Retorna Pergunta 6","blocks":[{"id":"e02yfpbpj298m1q9y4tb905i","type":"Set variable","groupId":"cf8r0wx0sgw6c9v79ebja1tj","options":{"type":"Empty","variableId":"vndjnalmnb3ez9beeon5tzrgq"}},{"id":"wjfe41oxiik0jgwcye7sczeu","type":"Jump","groupId":"cf8r0wx0sgw6c9v79ebja1tj","options":{"groupId":"tn8bcyughy9dsxhmjngrosvj"}}],"graphCoordinates":{"x":4360.16,"y":732.74}},{"id":"b7zfnwcxvu28s98ii03isdae","title":"Retorna Pergunta 8","blocks":[{"id":"j1xmpy60ggf162ej9a0rti4f","type":"Set variable","groupId":"b7zfnwcxvu28s98ii03isdae","options":{"type":"Empty","variableId":"vy5it60mewmth7mayzhlgmzf0"}},{"id":"lk06yb9dvrctn2u9tx35n12c","type":"Jump","groupId":"b7zfnwcxvu28s98ii03isdae","options":{"groupId":"jdz9w8vrz09vefk4wqrf0vwl"}}],"graphCoordinates":{"x":5213.21,"y":778}},{"id":"z0idhsnqisrd695z0j1tnqvw","title":"Retorna Pergunta 10","blocks":[{"id":"gs96ig682082mj4igcjjuh76","type":"Set variable","groupId":"z0idhsnqisrd695z0j1tnqvw","options":{"type":"Empty","variableId":"vx6p4ivk4mnssvbhl30c5zng9"}},{"id":"tihlp1xm8mvpdm3d0dqkwwx6","type":"Jump","groupId":"z0idhsnqisrd695z0j1tnqvw","options":{"groupId":"cs5kjnrcsh4bjiuvwf99agho"}}],"graphCoordinates":{"x":6100.86,"y":819.65}},{"id":"qsrkmfsr04kayulair47gmn0","title":"Gera QRCODE pix","blocks":[{"id":"qs1uxqm8jqla9uui43ofms65","type":"Webhook","groupId":"qsrkmfsr04kayulair47gmn0","options":{"isCustomBody":true,"isAdvancedConfig":true,"variablesForTest":[],"responseVariableMapping":[{"id":"gcia6kdba4yydt14klsg8h6x","bodyPath":"data.qrcode_base64","variableId":"vamn8ortov9nk1y04vczo375h"}]},"webhookId":"ajx8mv7trd50mbv2uj6fr3x5"},{"id":"sz447ty7t4vreto9bf07h52i","type":"Set variable","groupId":"qsrkmfsr04kayulair47gmn0","options":{"type":"Custom","variableId":"vamn8ortov9nk1y04vczo375h","expressionToEvaluate":"if({{remoteJid}}){\n return {{qrcode}}.replace('data:image/png;base64,', ''); \n}else{\n return {{qrcode}}\n}\n"}},{"id":"c3wp5ic2wx9emj6kkii42xpj","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Aqui está qrcode para sua contribuição de R$ {{question11}}, caso tenha dificuldade na leitura utilize a nossa chave:"}]},{"type":"p","children":[{"text":""}]},{"type":"p","children":[{"text":"Telefone: 7499879409"}]},{"type":"p","children":[{"text":"Em nome de: Davidson Oliveira Gomes"}]}]},"groupId":"qsrkmfsr04kayulair47gmn0"},{"id":"jncggap4fivalzgntw3bfaom","type":"image","content":{"url":"{{qrcode}}"},"groupId":"qsrkmfsr04kayulair47gmn0"},{"id":"chiz9utw18jvui4c2r0vsiqp","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Muito obrigado pela sua contribuição!"}]}]},"groupId":"qsrkmfsr04kayulair47gmn0","outgoingEdgeId":"cwlt91vwhr7gvgx0qx2mnxtr"}],"graphCoordinates":{"x":6607.75,"y":229.53}},{"id":"cs5kjnrcsh4bjiuvwf99agho","title":"Pergunta 10","blocks":[{"id":"axpk3aoauusbiy8av70fc2fo","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Gostaria de fazer uma contribuição?"}]},{"type":"p","children":[{"text":""}]},{"type":"p","children":[{"text":"1 - Sim"}]},{"type":"p","children":[{"text":"2 - Não"}]}]},"groupId":"cs5kjnrcsh4bjiuvwf99agho"},{"id":"q136n37ja1g5dyhdeisur4rg","type":"text input","groupId":"cs5kjnrcsh4bjiuvwf99agho","options":{"isLong":false,"labels":{"button":"Enviar","placeholder":"Deixe sua resposta"},"variableId":"vx6p4ivk4mnssvbhl30c5zng9"}},{"id":"xza6e0p4hgkfz1wvwcjss48s","type":"Condition","items":[{"id":"m5mvt5ecw81eevl428n56aji","type":1,"blockId":"xza6e0p4hgkfz1wvwcjss48s","content":{"comparisons":[{"id":"rln6ido55pzqyr9ihqp3r0oe","value":"^([Ss][IiÍí][Mm]|1)$","variableId":"vx6p4ivk4mnssvbhl30c5zng9","comparisonOperator":"Matches regex"}],"logicalOperator":"OR"},"outgoingEdgeId":"fe1wk4fc1xzt7mefasb2qzqz"},{"id":"bpcidulg0g7v8pwh3w9my880","type":1,"blockId":"xza6e0p4hgkfz1wvwcjss48s","content":{"comparisons":[{"id":"n0dm7n4vyowa9bftkmu0ypud","value":"^([Nn][AaÃã][Oo]|2)$","variableId":"vx6p4ivk4mnssvbhl30c5zng9","comparisonOperator":"Matches regex"}],"logicalOperator":"OR"},"outgoingEdgeId":"xg1zkpvob8ilx2r8p0kv604d"}],"groupId":"cs5kjnrcsh4bjiuvwf99agho","outgoingEdgeId":"o746eh96sq2j7juionfql73t"}],"graphCoordinates":{"x":5708.94,"y":210.9}},{"id":"tq60r6azxrmn17b4y7mjovf5","title":"Pergunta 11","blocks":[{"id":"o5fspfge731wt6m781nzjsll","type":"text","content":{"richText":[{"type":"p","children":[{"text":"Muito bem {{name}}, quanto você deseja contribuir?"}]}]},"groupId":"tq60r6azxrmn17b4y7mjovf5"},{"id":"khncvmg5fcjsmu8tlmf8in6m","type":"number input","groupId":"tq60r6azxrmn17b4y7mjovf5","options":{"max":5000,"min":1,"step":1,"labels":{"button":"Enviar","placeholder":"Digite um numero"},"variableId":"vhoqah2c0blbx92bfmd4gjnyx"},"outgoingEdgeId":"ns2kch8n15uklzwf8kn4m0lb"}],"graphCoordinates":{"x":6158.94,"y":224.91}},{"id":"h0svx6gyzgjsclr9hbpo04v6","title":"Configurações Iniciais","blocks":[{"id":"na4zglpatkg8ejqcap8lcv69","type":"Set variable","groupId":"h0svx6gyzgjsclr9hbpo04v6","options":{"variableId":"vp1ask55v2r58ukom5lek5hej","expressionToEvaluate":"https://d715-45-39-187-135.ngrok-free.app"}},{"id":"t2bdxy8x8fsn29yijk02ti43","type":"Set variable","groupId":"h0svx6gyzgjsclr9hbpo04v6","options":{"variableId":"vtsldvs2u8ui93tktazy77djw","expressionToEvaluate":"0f1c6e17-5a6a-4989-8c12-a7e7350870fe"}},{"id":"rt5h0lk6jaoh5hzag0s5hidd","type":"Set variable","groupId":"h0svx6gyzgjsclr9hbpo04v6","options":{"variableId":"vkg1qlinovziltaloqhso2cw7","expressionToEvaluate":"https://pix.dgcode.com.br"}},{"id":"mh758b8y8288t56s6wz73mht","type":"Set variable","groupId":"h0svx6gyzgjsclr9hbpo04v6","options":{"variableId":"vpjyy2e2ha6mu5x10q0nowuz3","expressionToEvaluate":"Davidson Oliveira Gomes"}},{"id":"ri9kv80djsej7r51m8xfjhuk","type":"Set variable","groupId":"h0svx6gyzgjsclr9hbpo04v6","options":{"variableId":"vicsm3nkvhssvfhgss2xce2ad","expressionToEvaluate":"Telefone"}},{"id":"ye4teva02mnxph0rvfszdnsn","type":"Set variable","groupId":"h0svx6gyzgjsclr9hbpo04v6","options":{"variableId":"vlmflx32cjlz457h0uzdi706g","expressionToEvaluate":"74999879409"}},{"id":"hfz4hqzfe6wgje96ezb5kann","type":"Set variable","groupId":"h0svx6gyzgjsclr9hbpo04v6","options":{"variableId":"veesfw943copg17w2qzdln9be","expressionToEvaluate":"Irece"}},{"id":"nd3yk369k7j73kws6exos0jw","type":"Set variable","groupId":"h0svx6gyzgjsclr9hbpo04v6","options":{"variableId":"vavwvk4wgst506zdioplg4u8p","expressionToEvaluate":"TypeBot"},"outgoingEdgeId":"mb90csrzzep8qz2opcxmw736"}],"graphCoordinates":{"x":312.08,"y":218.28}}],"variables":[{"id":"vo40px5r6wg9vhs9fixd45kzn","name":"name"},{"id":"vr75l1drc5uoxvisje0hio5ph","name":"email"},{"id":"vzhsu0uc4suqoz38kv3q891ma","name":"question3"},{"id":"vbfl3sqze2wzicn9l1n9ckjs4","name":"question1"},{"id":"vkgl2bfdbyms1dyc1s6efx678","name":"question2"},{"id":"vd6fm2i9shcdjz8bhhwbsdh6t","name":"question4"},{"id":"vz6lvahwo15dosvckdtkxduly","name":"question5"},{"id":"vndjnalmnb3ez9beeon5tzrgq","name":"question6"},{"id":"vept0w6tr0w7eyyi52hgq1r3c","name":"question7"},{"id":"vy5it60mewmth7mayzhlgmzf0","name":"question8"},{"id":"vhygxyvhu5l6r2uws1cbthmxm","name":"question9"},{"id":"vrdwfo2lpoei2fzlzazh4pp61","name":"pushName"},{"id":"vz1uq7t77aivpi5crwy6ifact","name":"remoteJid"},{"id":"vsu5or5sxes9lyuhsgcl3cuyd","name":"ID"},{"id":"vamn8ortov9nk1y04vczo375h","name":"qrcode"},{"id":"vx6p4ivk4mnssvbhl30c5zng9","name":"question10"},{"id":"vhoqah2c0blbx92bfmd4gjnyx","name":"question11"},{"id":"vpjyy2e2ha6mu5x10q0nowuz3","name":"me"},{"id":"vicsm3nkvhssvfhgss2xce2ad","name":"typePIX"},{"id":"vavwvk4wgst506zdioplg4u8p","name":"reference"},{"id":"vlmflx32cjlz457h0uzdi706g","name":"keyPIX"},{"id":"vkg1qlinovziltaloqhso2cw7","name":"apiURL"},{"id":"veesfw943copg17w2qzdln9be","name":"city"},{"id":"vp1ask55v2r58ukom5lek5hej","name":"evolutionURL"},{"id":"vtsldvs2u8ui93tktazy77djw","name":"evolutionToken"},{"id":"vpoyfwgfw4tbt4l4iy4homfoq","name":"instanceName"}],"edges":[{"id":"w6ao5pi6wt0966tobkned56m","to":{"groupId":"qzhp25b9f2lvt4yeniqvjkav"},"from":{"itemId":"dwhc3ptqvktlgfvl17xg79s5","blockId":"b538q1mt18l6oddo397nh1m4","groupId":"lbieknd0qp42pogsby5l82ww"}},{"id":"wlfmh2g3j5avj75sa9q6rsab","to":{"groupId":"tn8bcyughy9dsxhmjngrosvj"},"from":{"itemId":"cod3tkt16ry8ixm5u7rwxzm9","blockId":"b538q1mt18l6oddo397nh1m4","groupId":"lbieknd0qp42pogsby5l82ww"}},{"id":"yu9762ttf5jn3bmhd6uzrsv8","to":{"groupId":"jdz9w8vrz09vefk4wqrf0vwl"},"from":{"itemId":"ifhm8cj8lsulhrarnfda2oal","blockId":"n3j2dxaalkljl020o0o61ef9","groupId":"tn8bcyughy9dsxhmjngrosvj"}},{"id":"ji1y2o1hldhemto0ymwou09c","to":{"groupId":"nzkhdw3hdv550aepsxvk2a0u"},"from":{"itemId":"gxp6j3ouga4r0t8364tn8axs","blockId":"n3j2dxaalkljl020o0o61ef9","groupId":"tn8bcyughy9dsxhmjngrosvj"}},{"id":"x2fzu1uuukp9cgmdzecp7mgk","to":{"groupId":"c4k1ftb4rbynkb01ulwuh4qh"},"from":{"itemId":"lur26nqa8dv7m4jmmljpyyf1","blockId":"zderh9hqjkpuz58p79szfa1i","groupId":"jdz9w8vrz09vefk4wqrf0vwl"}},{"id":"d3u83fikqplfy9ntva3sm7eg","to":{"groupId":"cf8r0wx0sgw6c9v79ebja1tj"},"from":{"blockId":"n3j2dxaalkljl020o0o61ef9","groupId":"tn8bcyughy9dsxhmjngrosvj"}},{"id":"ehcwqdrkc4025pui2y1s9390","to":{"groupId":"ffm0s2y4head3auw808hwfnx"},"from":{"blockId":"b538q1mt18l6oddo397nh1m4","groupId":"lbieknd0qp42pogsby5l82ww"}},{"id":"mb1fg83gijikrafud2ml6zbn","to":{"groupId":"cs5kjnrcsh4bjiuvwf99agho"},"from":{"itemId":"aoj7e49zimwxng4o7bd6u00s","blockId":"zderh9hqjkpuz58p79szfa1i","groupId":"jdz9w8vrz09vefk4wqrf0vwl"}},{"id":"amyrx4i2rm3cjksym5zvwd50","to":{"groupId":"b7zfnwcxvu28s98ii03isdae"},"from":{"blockId":"zderh9hqjkpuz58p79szfa1i","groupId":"jdz9w8vrz09vefk4wqrf0vwl"}},{"id":"o746eh96sq2j7juionfql73t","to":{"groupId":"z0idhsnqisrd695z0j1tnqvw"},"from":{"blockId":"xza6e0p4hgkfz1wvwcjss48s","groupId":"cs5kjnrcsh4bjiuvwf99agho"}},{"id":"fe1wk4fc1xzt7mefasb2qzqz","to":{"groupId":"tq60r6azxrmn17b4y7mjovf5"},"from":{"itemId":"m5mvt5ecw81eevl428n56aji","blockId":"xza6e0p4hgkfz1wvwcjss48s","groupId":"cs5kjnrcsh4bjiuvwf99agho"}},{"id":"xg1zkpvob8ilx2r8p0kv604d","to":{"groupId":"vvyooiddvdbon0t21bvzdr7q"},"from":{"itemId":"bpcidulg0g7v8pwh3w9my880","blockId":"xza6e0p4hgkfz1wvwcjss48s","groupId":"cs5kjnrcsh4bjiuvwf99agho"}},{"id":"cwlt91vwhr7gvgx0qx2mnxtr","to":{"groupId":"vvyooiddvdbon0t21bvzdr7q"},"from":{"blockId":"chiz9utw18jvui4c2r0vsiqp","groupId":"qsrkmfsr04kayulair47gmn0"}},{"id":"aovnigvk665gzhyzg7bxhvn0","to":{"groupId":"h0svx6gyzgjsclr9hbpo04v6"},"from":{"blockId":"qn40kjwtw1he3l1bujt3bnje","groupId":"c76ucoughhenpernmadu7ibg"}},{"id":"mb90csrzzep8qz2opcxmw736","to":{"groupId":"nog2woqmvhssnnjlcpwd41k5"},"from":{"blockId":"nd3yk369k7j73kws6exos0jw","groupId":"h0svx6gyzgjsclr9hbpo04v6"}},{"id":"vwx6ofz1ur8maxcbw8fk66x9","to":{"groupId":"j5co2kcotxafuxhzlj7u0qnn"},"from":{"blockId":"o8ijci5gdfsp6fpv07kwh8br","groupId":"nog2woqmvhssnnjlcpwd41k5"}},{"id":"v53mvhejcapb4a1zq98swq5b","to":{"groupId":"wtd0o382phaji7i7u2n8pody"},"from":{"blockId":"qb8nwfs52g168tmnvp257b44","groupId":"j5co2kcotxafuxhzlj7u0qnn"}},{"id":"ed1x8zan90zvrpo9xk9moroe","to":{"groupId":"ylerbfc1l2o62j68g8ghegxt"},"from":{"blockId":"ku0zpu43cbbnd7y0ai71ptde","groupId":"wtd0o382phaji7i7u2n8pody"}},{"id":"iy61ajcfl6ubbj7zghxeu6f7","to":{"groupId":"lbieknd0qp42pogsby5l82ww"},"from":{"blockId":"kfxuc6p58cdzy1xcyp4i4ra7","groupId":"ylerbfc1l2o62j68g8ghegxt"}},{"id":"i11xudmpsb1tbsss7qoge6cm","to":{"groupId":"c8kh8eee1m3wyy372v4n6m1i"},"from":{"blockId":"ce2eodve0e4f2rubk4wv5jf1","groupId":"qzhp25b9f2lvt4yeniqvjkav"}},{"id":"c9nrzzcxt8w4dgk2sfez53n5","to":{"groupId":"tn8bcyughy9dsxhmjngrosvj"},"from":{"blockId":"mg2tmcmwnx3tap0hs4b7e0la","groupId":"c8kh8eee1m3wyy372v4n6m1i"}},{"id":"k7vrrf5cfxopvmhsbf35bt3m","to":{"groupId":"jdz9w8vrz09vefk4wqrf0vwl"},"from":{"blockId":"dj7dbgyjqk0a5u3jn6kzykb2","groupId":"nzkhdw3hdv550aepsxvk2a0u"}},{"id":"u8c55of7l95fnz25gf7swt1m","to":{"groupId":"cs5kjnrcsh4bjiuvwf99agho"},"from":{"blockId":"wfucksh3yaeq21l7mnlnsx75","groupId":"c4k1ftb4rbynkb01ulwuh4qh"}},{"id":"ns2kch8n15uklzwf8kn4m0lb","to":{"groupId":"qsrkmfsr04kayulair47gmn0"},"from":{"blockId":"khncvmg5fcjsmu8tlmf8in6m","groupId":"tq60r6azxrmn17b4y7mjovf5"}}],"theme":{"chat":{"inputs":{"color":"#ffffff","backgroundColor":"#1e293b","placeholderColor":"#9095A0"},"buttons":{"color":"#ffffff","backgroundColor":"#1a5fff"},"roundness":"large","hostAvatar":{"isEnabled":true},"guestAvatar":{"isEnabled":false},"hostBubbles":{"color":"#ffffff","backgroundColor":"#1e293b"},"guestBubbles":{"color":"#FFFFFF","backgroundColor":"#FF8E21"}},"general":{"font":"Open Sans","background":{"type":"Color","content":"#171923"}}},"selectedThemeTemplateId":"typebot-dark","settings":{"general":{"isBrandingEnabled":false},"metadata":{"imageUrl":"https://i.imgur.com/48TjKBb.jpg","description":"Sua opinião é fundamental para nos ajudar a melhorar!"},"typingEmulation":{"speed":300,"enabled":true,"maxDelay":1.5}},"publicId":"dgcode-pesquisa-satisfacao-whatsapp-7m64d9o","customDomain":null,"workspaceId":"clktt8c1y0001qa66zyg5tt23","resultsTablePreferences":null,"isArchived":false,"isClosed":false} \ No newline at end of file diff --git a/README.md b/README.md index 351ec3ce..c5c4bc37 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ [![Postman Collection](https://img.shields.io/badge/Postman-Collection-orange)](https://evolution-api.com/postman) [![Documentation](https://img.shields.io/badge/Documentation-Official-green)](https://doc.evolution-api.com) [![License](https://img.shields.io/badge/license-GPL--3.0-orange)](./LICENSE) -[![Support](https://img.shields.io/badge/Buy%20me-coffe-orange)](https://app.picpay.com/user/davidsongomes1998) +[![Support](https://img.shields.io/badge/Donation-picpay-green)](https://app.picpay.com/user/davidsongomes1998) +[![Support](https://img.shields.io/badge/Buy%20me-coffe-orange)](https://bmc.link/evolutionapi) @@ -34,7 +35,15 @@ This code was produced based on the baileys library and it is still under develo
- + + +
+ +#### Buy me coffe + +
+ +
diff --git a/docker-compose.yaml b/docker-compose.yaml.example similarity index 82% rename from docker-compose.yaml rename to docker-compose.yaml.example index c6d1bc73..d0a75a5d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml.example @@ -4,12 +4,15 @@ services: api: container_name: evolution_api image: evolution/api:local + build: . restart: always ports: - 8080:8080 volumes: - evolution_instances:/evolution/instances - evolution_store:/evolution/store + networks: + - evolution-net env_file: - ./Docker/.env command: ['node', './dist/src/main.js'] @@ -22,5 +25,5 @@ volumes: networks: evolution-net: - external: true - \ No newline at end of file + name: evolution-net + driver: bridge diff --git a/docker-compose.yaml.example.complete b/docker-compose.yaml.example.complete new file mode 100644 index 00000000..de13de57 --- /dev/null +++ b/docker-compose.yaml.example.complete @@ -0,0 +1,80 @@ +version: '3.3' + +services: + api: + container_name: evolution_api + image: evolution/api:local + build: . + restart: always + ports: + - 8080:8080 + volumes: + - evolution_instances:/evolution/instances + - evolution_store:/evolution/store + networks: + - evolution-net + env_file: + - ./Docker/.env + command: ['node', './dist/src/main.js'] + expose: + - 8080 + + mongodb: + container_name: mongodb + image: mongo + restart: always + ports: + - 27017:27017 + environment: + - MONGO_INITDB_ROOT_USERNAME=root + - MONGO_INITDB_ROOT_PASSWORD=root + - PUID=1000 + - PGID=1000 + volumes: + - evolution_mongodb_data:/data/db + - evolution_mongodb_configdb:/data/configdb + networks: + - evolution-net + expose: + - 27017 + + mongo-express: + image: mongo-express + networks: + - evolution-net + environment: + ME_CONFIG_BASICAUTH_USERNAME: root + ME_CONFIG_BASICAUTH_PASSWORD: root + ME_CONFIG_MONGODB_SERVER: mongodb + ME_CONFIG_MONGODB_ADMINUSERNAME: root + ME_CONFIG_MONGODB_ADMINPASSWORD: root + ports: + - 8081:8081 + links: + - mongodb + + redis: + image: redis:latest + container_name: redis + command: > + redis-server + --port 6379 + --appendonly yes + volumes: + - evolution_redis:/data + networks: + - evolution-net + ports: + - 6379:6379 + +volumes: + evolution_instances: + evolution_store: + evolution_mongodb_data: + evolution_mongodb_configdb: + evolution_redis: + +networks: + evolution-net: + name: evolution-net + driver: bridge diff --git a/docker-compose.yaml.example.dockerhub b/docker-compose.yaml.example.dockerhub new file mode 100644 index 00000000..562d1b07 --- /dev/null +++ b/docker-compose.yaml.example.dockerhub @@ -0,0 +1,28 @@ +version: '3.3' + +services: + api: + container_name: evolution_api + image: davidsongomes/evolution-api:latest + restart: always + ports: + - 8080:8080 + volumes: + - evolution_instances:/evolution/instances + - evolution_store:/evolution/store + networks: + - evolution-net + env_file: + - ./Docker/.env + command: ['node', './dist/src/main.js'] + expose: + - 8080 + +volumes: + evolution_instances: + evolution_store: + +networks: + evolution-net: + name: evolution-net + driver: bridge diff --git a/docker.sh b/docker.sh deleted file mode 100755 index d72e56dd..00000000 --- a/docker.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -NET='evolution-net' -IMAGE='evolution/api:local' - -if !(docker network ls | grep ${NET} > /dev/null) -then - docker network create -d bridge ${NET} -fi - -docker build -t ${IMAGE} . - -docker compose up -d \ No newline at end of file diff --git a/package.json b/package.json index b56b045d..783731d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "evolution-api", - "version": "1.3.1", + "version": "1.5.1", "description": "Rest api for communication with WhatsApp", "main": "./dist/src/main.js", "scripts": { @@ -8,7 +8,8 @@ "start": "ts-node --files --transpile-only ./src/main.ts", "start:prod": "bash start.sh", "dev:server": "clear && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./src/main.ts", - "test": "clear && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./test/all.test.ts" + "test": "clear && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./test/all.test.ts", + "lint": "eslint --fix --ext .ts src" }, "repository": { "type": "git", @@ -45,7 +46,8 @@ "@figuro/chatwoot-sdk": "^1.1.14", "@hapi/boom": "^10.0.1", "@sentry/node": "^7.59.2", - "@whiskeysockets/baileys": "^6.4.0", + "@whiskeysockets/baileys": "^6.4.1", + "amqplib": "^0.10.3", "axios": "^1.3.5", "class-validator": "^0.13.2", "compression": "^1.7.4", @@ -62,16 +64,20 @@ "js-yaml": "^4.1.0", "jsonschema": "^1.4.1", "jsonwebtoken": "^8.5.1", + "libphonenumber-js": "^1.10.39", "link-preview-js": "^3.0.4", "mongoose": "^6.10.5", "node-cache": "^5.1.2", "node-mime-types": "^1.1.0", + "node-windows": "^1.0.0-beta.8", "pino": "^8.11.0", - "proxy-agent": "^6.2.1", + "proxy-agent": "^6.3.0", "qrcode": "^1.5.1", "qrcode-terminal": "^0.12.0", "redis": "^4.6.5", "sharp": "^0.30.7", + "socket.io": "^4.7.1", + "socks-proxy-agent": "^8.0.1", "uuid": "^9.0.0" }, "devDependencies": { @@ -80,16 +86,20 @@ "@types/express": "^4.17.17", "@types/js-yaml": "^4.0.5", "@types/jsonwebtoken": "^8.5.9", + "@types/mime-types": "^2.1.1", "@types/node": "^18.15.11", + "@types/node-windows": "^0.1.2", "@types/qrcode": "^1.5.0", "@types/qrcode-terminal": "^0.12.0", "@types/uuid": "^8.3.4", - "@typescript-eslint/eslint-plugin": "^5.57.1", - "@typescript-eslint/parser": "^5.57.1", - "eslint": "^8.38.0", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", + "eslint": "^8.45.0", "eslint-config-prettier": "^8.8.0", + "eslint-plugin-import": "^2.27.5", "eslint-plugin-prettier": "^4.2.1", - "prettier": "^2.8.7", + "eslint-plugin-simple-import-sort": "^10.0.0", + "prettier": "^2.8.8", "ts-node-dev": "^2.0.0", "typescript": "^4.9.5" } diff --git a/public/images/bmc_qr.png b/public/images/bmc_qr.png new file mode 100644 index 00000000..1024d760 Binary files /dev/null and b/public/images/bmc_qr.png differ diff --git a/public/images/picpay-qr.jpeg b/public/images/picpay-qr.jpeg new file mode 100644 index 00000000..de911657 Binary files /dev/null and b/public/images/picpay-qr.jpeg differ diff --git a/src/config/env.config.ts b/src/config/env.config.ts index 7221f474..e4995aab 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -1,7 +1,7 @@ +import { isBooleanString } from 'class-validator'; import { readFileSync } from 'fs'; import { load } from 'js-yaml'; import { join } from 'path'; -import { isBooleanString } from 'class-validator'; export type HttpServer = { TYPE: 'http' | 'https'; PORT: number; URL: string }; @@ -14,15 +14,7 @@ export type Cors = { export type LogBaileys = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace'; -export type LogLevel = - | 'ERROR' - | 'WARN' - | 'DEBUG' - | 'INFO' - | 'LOG' - | 'VERBOSE' - | 'DARK' - | 'WEBHOOKS'; +export type LogLevel = 'ERROR' | 'WARN' | 'DEBUG' | 'INFO' | 'LOG' | 'VERBOSE' | 'DARK' | 'WEBHOOKS'; export type Log = { LEVEL: LogLevel[]; @@ -69,6 +61,15 @@ export type Redis = { PREFIX_KEY: string; }; +export type Rabbitmq = { + ENABLED: boolean; + URI: string; +}; + +export type Websocket = { + ENABLED: boolean; +}; + export type EventsWebhook = { APPLICATION_STARTUP: boolean; QRCODE_UPDATED: boolean; @@ -89,25 +90,23 @@ export type EventsWebhook = { GROUPS_UPSERT: boolean; GROUP_UPDATE: boolean; GROUP_PARTICIPANTS_UPDATE: boolean; + CALL: boolean; NEW_JWT_TOKEN: boolean; + TYPEBOT_START: boolean; + TYPEBOT_CHANGE_STATUS: boolean; + CHAMA_AI_ACTION: boolean; + ERRORS: boolean; + ERRORS_WEBHOOK: string; }; export type ApiKey = { KEY: string }; export type Jwt = { EXPIRIN_IN: number; SECRET: string }; -export type Instance = { - NAME: string; - WEBHOOK_URL: string; - MODE: string; - CHATWOOT_ACCOUNT_ID: string; - CHATWOOT_TOKEN: string; - CHATWOOT_URL: string; -}; + export type Auth = { API_KEY: ApiKey; EXPOSE_IN_FETCH_INSTANCES: boolean; JWT: Jwt; TYPE: 'jwt' | 'apikey'; - INSTANCE: Instance; }; export type DelInstance = number | boolean; @@ -120,7 +119,7 @@ export type GlobalWebhook = { export type SslConf = { PRIVKEY: string; FULLCHAIN: string }; export type Webhook = { GLOBAL?: GlobalWebhook; EVENTS: EventsWebhook }; export type ConfigSessionPhone = { CLIENT: string; NAME: string }; -export type QrCode = { LIMIT: number }; +export type QrCode = { LIMIT: number; COLOR: string }; export type Production = boolean; export interface Env { @@ -131,6 +130,8 @@ export interface Env { CLEAN_STORE: CleanStoreConf; DATABASE: Database; REDIS: Redis; + RABBITMQ: Rabbitmq; + WEBSOCKET: Websocket; LOG: Log; DEL_INSTANCE: DelInstance; WEBHOOK: Webhook; @@ -163,26 +164,24 @@ export class ConfigService { } private envYaml(): Env { - return load( - readFileSync(join(process.cwd(), 'src', 'env.yml'), { encoding: 'utf-8' }), - ) as Env; + return load(readFileSync(join(process.cwd(), 'src', 'env.yml'), { encoding: 'utf-8' })) as Env; } private envProcess(): Env { return { SERVER: { TYPE: process.env.SERVER_TYPE as 'http' | 'https', - PORT: Number.parseInt(process.env.SERVER_PORT), + PORT: Number.parseInt(process.env.SERVER_PORT) || 8080, URL: process.env.SERVER_URL, }, CORS: { - ORIGIN: process.env.CORS_ORIGIN.split(','), - METHODS: process.env.CORS_METHODS.split(',') as HttpMethods[], + ORIGIN: process.env.CORS_ORIGIN.split(',') || ['*'], + METHODS: (process.env.CORS_METHODS.split(',') as HttpMethods[]) || ['POST', 'GET', 'PUT', 'DELETE'], CREDENTIALS: process.env?.CORS_CREDENTIALS === 'true', }, SSL_CONF: { - PRIVKEY: process.env?.SSL_CONF_PRIVKEY, - FULLCHAIN: process.env?.SSL_CONF_FULLCHAIN, + PRIVKEY: process.env?.SSL_CONF_PRIVKEY || '', + FULLCHAIN: process.env?.SSL_CONF_FULLCHAIN || '', }, STORE: { MESSAGES: process.env?.STORE_MESSAGES === 'true', @@ -201,8 +200,8 @@ export class ConfigService { }, DATABASE: { CONNECTION: { - URI: process.env.DATABASE_CONNECTION_URI, - DB_PREFIX_NAME: process.env.DATABASE_CONNECTION_DB_PREFIX_NAME, + URI: process.env.DATABASE_CONNECTION_URI || '', + DB_PREFIX_NAME: process.env.DATABASE_CONNECTION_DB_PREFIX_NAME || 'evolution', }, ENABLED: process.env?.DATABASE_ENABLED === 'true', SAVE_DATA: { @@ -215,11 +214,27 @@ export class ConfigService { }, REDIS: { ENABLED: process.env?.REDIS_ENABLED === 'true', - URI: process.env.REDIS_URI, - PREFIX_KEY: process.env.REDIS_PREFIX_KEY, + URI: process.env.REDIS_URI || '', + PREFIX_KEY: process.env.REDIS_PREFIX_KEY || 'evolution', + }, + RABBITMQ: { + ENABLED: process.env?.RABBITMQ_ENABLED === 'true', + URI: process.env.RABBITMQ_URI || '', + }, + WEBSOCKET: { + ENABLED: process.env?.WEBSOCKET_ENABLED === 'true', }, LOG: { - LEVEL: process.env?.LOG_LEVEL.split(',') as LogLevel[], + LEVEL: (process.env?.LOG_LEVEL.split(',') as LogLevel[]) || [ + 'ERROR', + 'WARN', + 'DEBUG', + 'INFO', + 'LOG', + 'VERBOSE', + 'DARK', + 'WEBHOOKS', + ], COLOR: process.env?.LOG_COLOR === 'true', BAILEYS: (process.env?.LOG_BAILEYS as LogBaileys) || 'error', }, @@ -228,7 +243,7 @@ export class ConfigService { : Number.parseInt(process.env.DEL_INSTANCE) || false, WEBHOOK: { GLOBAL: { - URL: process.env?.WEBHOOK_GLOBAL_URL, + URL: process.env?.WEBHOOK_GLOBAL_URL || '', ENABLED: process.env?.WEBHOOK_GLOBAL_ENABLED === 'true', WEBHOOK_BY_EVENTS: process.env?.WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS === 'true', }, @@ -251,39 +266,35 @@ export class ConfigService { CONNECTION_UPDATE: process.env?.WEBHOOK_EVENTS_CONNECTION_UPDATE === 'true', GROUPS_UPSERT: process.env?.WEBHOOK_EVENTS_GROUPS_UPSERT === 'true', GROUP_UPDATE: process.env?.WEBHOOK_EVENTS_GROUPS_UPDATE === 'true', - GROUP_PARTICIPANTS_UPDATE: - process.env?.WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE === 'true', + GROUP_PARTICIPANTS_UPDATE: process.env?.WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE === 'true', + CALL: process.env?.WEBHOOK_EVENTS_CALL === 'true', NEW_JWT_TOKEN: process.env?.WEBHOOK_EVENTS_NEW_JWT_TOKEN === 'true', + TYPEBOT_START: process.env?.WEBHOOK_EVENTS_TYPEBOT_START === 'true', + TYPEBOT_CHANGE_STATUS: process.env?.WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS === 'true', + CHAMA_AI_ACTION: process.env?.WEBHOOK_EVENTS_CHAMA_AI_ACTION === 'true', + ERRORS: process.env?.WEBHOOK_EVENTS_ERRORS === 'true', + ERRORS_WEBHOOK: process.env?.WEBHOOK_EVENTS_ERRORS_WEBHOOK || '', }, }, CONFIG_SESSION_PHONE: { CLIENT: process.env?.CONFIG_SESSION_PHONE_CLIENT || 'Evolution API', - NAME: process.env?.CONFIG_SESSION_PHONE_NAME || 'chrome', + NAME: process.env?.CONFIG_SESSION_PHONE_NAME || 'Chrome', }, QRCODE: { LIMIT: Number.parseInt(process.env.QRCODE_LIMIT) || 30, + COLOR: process.env.QRCODE_COLOR || '#198754', }, AUTHENTICATION: { - TYPE: process.env.AUTHENTICATION_TYPE as 'jwt', + TYPE: process.env.AUTHENTICATION_TYPE as 'apikey', API_KEY: { - KEY: process.env.AUTHENTICATION_API_KEY, + KEY: process.env.AUTHENTICATION_API_KEY || 'BQYHJGJHJ', }, - EXPOSE_IN_FETCH_INSTANCES: - process.env?.AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES === 'true', + EXPOSE_IN_FETCH_INSTANCES: process.env?.AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES === 'true', JWT: { EXPIRIN_IN: Number.isInteger(process.env?.AUTHENTICATION_JWT_EXPIRIN_IN) ? Number.parseInt(process.env.AUTHENTICATION_JWT_EXPIRIN_IN) : 3600, - SECRET: process.env.AUTHENTICATION_JWT_SECRET, - }, - INSTANCE: { - NAME: process.env.AUTHENTICATION_INSTANCE_NAME, - WEBHOOK_URL: process.env.AUTHENTICATION_INSTANCE_WEBHOOK_URL, - MODE: process.env.AUTHENTICATION_INSTANCE_MODE, - CHATWOOT_ACCOUNT_ID: - process.env.AUTHENTICATION_INSTANCE_CHATWOOT_ACCOUNT_ID || '', - CHATWOOT_TOKEN: process.env.AUTHENTICATION_INSTANCE_CHATWOOT_TOKEN || '', - CHATWOOT_URL: process.env.AUTHENTICATION_INSTANCE_CHATWOOT_URL || '', + SECRET: process.env.AUTHENTICATION_JWT_SECRET || 'L=0YWt]b2w[WF>#>:&E`', }, }, }; diff --git a/src/config/error.config.ts b/src/config/error.config.ts index 6449d52e..7a6717da 100644 --- a/src/config/error.config.ts +++ b/src/config/error.config.ts @@ -8,6 +8,7 @@ export function onUnexpectedError() { stderr: process.stderr.fd, error, }); + process.exit(1); }); process.on('unhandledRejection', (error, origin) => { @@ -17,5 +18,6 @@ export function onUnexpectedError() { stderr: process.stderr.fd, error, }); + process.exit(1); }); } diff --git a/src/config/logger.config.ts b/src/config/logger.config.ts index 26e4c38f..221ee098 100644 --- a/src/config/logger.config.ts +++ b/src/config/logger.config.ts @@ -1,5 +1,8 @@ -import { configService, Log } from './env.config'; import dayjs from 'dayjs'; +import fs from 'fs'; + +import { configService, Log } from './env.config'; +const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8')); const formatDateLog = (timestamp: number) => dayjs(timestamp) @@ -73,6 +76,8 @@ export class Logger { /*Command.UNDERSCORE +*/ Command.BRIGHT + Level[type], '[Evolution API]', Command.BRIGHT + Color[type], + `v${packageJson.version}`, + Command.BRIGHT + Color[type], process.pid.toString(), Command.RESET, Command.BRIGHT + Color[type], diff --git a/src/dev-env.yml b/src/dev-env.yml index c0f907fc..e670f1ec 100644 --- a/src/dev-env.yml +++ b/src/dev-env.yml @@ -79,6 +79,13 @@ REDIS: URI: "redis://localhost:6379" PREFIX_KEY: "evolution" +RABBITMQ: + ENABLED: false + URI: "amqp://guest:guest@localhost:5672" + +WEBSOCKET: + ENABLED: false + # Global Webhook Settings # Each instance's Webhook URL and events will be requested at the time it is created WEBHOOK: @@ -110,17 +117,27 @@ WEBHOOK: GROUP_UPDATE: true GROUP_PARTICIPANTS_UPDATE: true CONNECTION_UPDATE: true + CALL: true # This event fires every time a new token is requested via the refresh route NEW_JWT_TOKEN: false + # This events is used with Typebot + TYPEBOT_START: false + TYPEBOT_CHANGE_STATUS: false + # This event is used with Chama AI + CHAMA_AI_ACTION: false + # This event is used to send errors to the webhook + ERRORS: false + ERRORS_WEBHOOK: CONFIG_SESSION_PHONE: # Name that will be displayed on smartphone connection CLIENT: "Evolution API" - NAME: chrome # chrome | firefox | edge | opera | safari + NAME: Chrome # Chrome | Firefox | Edge | Opera | Safari # Set qrcode display limit QRCODE: LIMIT: 30 + COLOR: "#198754" # Defines an authentication type for the api # We recommend using the apikey because it will allow you to use a custom token, @@ -137,13 +154,3 @@ AUTHENTICATION: JWT: EXPIRIN_IN: 0 # seconds - 3600s === 1h | zero (0) - never expires SECRET: L=0YWt]b2w[WF>#>:&E` - # Set the instance name and webhook url to create an instance in init the application - INSTANCE: - # With this option activated, you work with a url per webhook event, respecting the local url and the name of each event - MODE: server # container or server - # if you are using container mode, set the container name and the webhook url to default instance - NAME: evolution - WEBHOOK_URL: - CHATWOOT_ACCOUNT_ID: 1 - CHATWOOT_TOKEN: 123456 - CHATWOOT_URL: diff --git a/src/exceptions/401.exception.ts b/src/exceptions/401.exception.ts index 72734d4e..d5424c71 100644 --- a/src/exceptions/401.exception.ts +++ b/src/exceptions/401.exception.ts @@ -5,7 +5,7 @@ export class UnauthorizedException { throw { status: HttpStatus.UNAUTHORIZED, error: 'Unauthorized', - message: objectError.length > 0 ? objectError : undefined, + message: objectError.length > 0 ? objectError : 'Unauthorized', }; } } diff --git a/src/libs/amqp.server.ts b/src/libs/amqp.server.ts new file mode 100644 index 00000000..18b82c52 --- /dev/null +++ b/src/libs/amqp.server.ts @@ -0,0 +1,73 @@ +import * as amqp from 'amqplib/callback_api'; + +import { configService, Rabbitmq } from '../config/env.config'; +import { Logger } from '../config/logger.config'; + +const logger = new Logger('AMQP'); + +let amqpChannel: amqp.Channel | null = null; + +export const initAMQP = () => { + return new Promise((resolve, reject) => { + const uri = configService.get('RABBITMQ').URI; + amqp.connect(uri, (error, connection) => { + if (error) { + reject(error); + return; + } + + connection.createChannel((channelError, channel) => { + if (channelError) { + reject(channelError); + return; + } + + const exchangeName = 'evolution_exchange'; + + channel.assertExchange(exchangeName, 'topic', { + durable: true, + autoDelete: false, + }); + + amqpChannel = channel; + + logger.info('AMQP initialized'); + resolve(); + }); + }); + }); +}; + +export const getAMQP = (): amqp.Channel | null => { + return amqpChannel; +}; + +export const initQueues = (instanceName: string, events: string[]) => { + if (!events || !events.length) return; + + const queues = events.map((event) => { + return `${event.replace(/_/g, '.').toLowerCase()}`; + }); + + queues.forEach((event) => { + const amqp = getAMQP(); + const exchangeName = instanceName ?? 'evolution_exchange'; + + amqp.assertExchange(exchangeName, 'topic', { + durable: true, + autoDelete: false, + }); + + const queueName = `${instanceName}.${event}`; + + amqp.assertQueue(queueName, { + durable: true, + autoDelete: false, + arguments: { + 'x-queue-type': 'quorum', + }, + }); + + amqp.bindQueue(queueName, exchangeName, event); + }); +}; diff --git a/src/db/db.connect.ts b/src/libs/db.connect.ts similarity index 99% rename from src/db/db.connect.ts rename to src/libs/db.connect.ts index 59530b48..b11610c7 100644 --- a/src/db/db.connect.ts +++ b/src/libs/db.connect.ts @@ -1,4 +1,5 @@ import mongoose from 'mongoose'; + import { configService, Database } from '../config/env.config'; import { Logger } from '../config/logger.config'; diff --git a/src/db/redis.client.ts b/src/libs/redis.client.ts similarity index 84% rename from src/db/redis.client.ts rename to src/libs/redis.client.ts index 50e7efcb..f03513ba 100644 --- a/src/db/redis.client.ts +++ b/src/libs/redis.client.ts @@ -1,9 +1,14 @@ import { createClient, RedisClientType } from '@redis/client'; -import { Logger } from '../config/logger.config'; import { BufferJSON } from '@whiskeysockets/baileys'; + import { Redis } from '../config/env.config'; +import { Logger } from '../config/logger.config'; export class RedisCache { + async disconnect() { + await this.client.disconnect(); + this.statusConnection = false; + } constructor() { this.logger.verbose('instance created'); process.on('beforeExit', async () => { @@ -59,11 +64,7 @@ export class RedisCache { this.logger.verbose('writeData: ' + field); const json = JSON.stringify(data, BufferJSON.replacer); - return await this.client.hSet( - this.redisEnv.PREFIX_KEY + ':' + this.instanceName, - field, - json, - ); + return await this.client.hSet(this.redisEnv.PREFIX_KEY + ':' + this.instanceName, field, json); } catch (error) { this.logger.error(error); } @@ -72,10 +73,7 @@ export class RedisCache { public async readData(field: string) { try { this.logger.verbose('readData: ' + field); - const data = await this.client.hGet( - this.redisEnv.PREFIX_KEY + ':' + this.instanceName, - field, - ); + const data = await this.client.hGet(this.redisEnv.PREFIX_KEY + ':' + this.instanceName, field); if (data) { this.logger.verbose('readData: ' + field + ' success'); @@ -92,10 +90,7 @@ export class RedisCache { public async removeData(field: string) { try { this.logger.verbose('removeData: ' + field); - return await this.client.hDel( - this.redisEnv.PREFIX_KEY + ':' + this.instanceName, - field, - ); + return await this.client.hDel(this.redisEnv.PREFIX_KEY + ':' + this.instanceName, field); } catch (error) { this.logger.error(error); } @@ -104,9 +99,7 @@ export class RedisCache { public async delAll(hash?: string) { try { this.logger.verbose('instance delAll: ' + hash); - const result = await this.client.del( - hash || this.redisEnv.PREFIX_KEY + ':' + this.instanceName, - ); + const result = await this.client.del(hash || this.redisEnv.PREFIX_KEY + ':' + this.instanceName); return result; } catch (error) { diff --git a/src/libs/socket.server.ts b/src/libs/socket.server.ts new file mode 100644 index 00000000..9da11b0a --- /dev/null +++ b/src/libs/socket.server.ts @@ -0,0 +1,44 @@ +import { Server } from 'http'; +import { Server as SocketIO } from 'socket.io'; + +import { configService, Cors, Websocket } from '../config/env.config'; +import { Logger } from '../config/logger.config'; + +const logger = new Logger('Socket'); + +let io: SocketIO; + +const cors = configService.get('CORS').ORIGIN; + +export const initIO = (httpServer: Server) => { + if (configService.get('WEBSOCKET').ENABLED) { + io = new SocketIO(httpServer, { + cors: { + origin: cors, + }, + }); + + io.on('connection', (socket) => { + logger.info('User connected'); + + socket.on('disconnect', () => { + logger.info('User disconnected'); + }); + }); + + logger.info('Socket.io initialized'); + return io; + } + return null; +}; + +export const getIO = (): SocketIO => { + logger.verbose('Getting Socket.io'); + + if (!io) { + logger.error('Socket.io not initialized'); + throw new Error('Socket.io not initialized'); + } + + return io; +}; diff --git a/src/main.ts b/src/main.ts index ac66e7b5..9f93ac71 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,16 +1,20 @@ +import 'express-async-errors'; + +import axios from 'axios'; import compression from 'compression'; -import { configService, Cors, HttpServer } from './config/env.config'; import cors from 'cors'; import express, { json, NextFunction, Request, Response, urlencoded } from 'express'; import { join } from 'path'; + +import { configService, Cors, HttpServer, Rabbitmq, Webhook } from './config/env.config'; import { onUnexpectedError } from './config/error.config'; import { Logger } from './config/logger.config'; import { ROOT_DIR } from './config/path.config'; -import { waMonitor } from './whatsapp/whatsapp.module'; -import { HttpStatus, router } from './whatsapp/routers/index.router'; -import 'express-async-errors'; +import { initAMQP } from './libs/amqp.server'; +import { initIO } from './libs/socket.server'; import { ServerUP } from './utils/server-up'; -import * as Sentry from '@sentry/node'; +import { HttpStatus, router } from './whatsapp/routers/index.router'; +import { waMonitor } from './whatsapp/whatsapp.module'; function initWA() { waMonitor.loadInstance(); @@ -20,32 +24,13 @@ function bootstrap() { const logger = new Logger('SERVER'); const app = express(); - // Sentry.init({ - // dsn: '', - // integrations: [ - // // enable HTTP calls tracing - // new Sentry.Integrations.Http({ tracing: true }), - // // enable Express.js middleware tracing - // new Sentry.Integrations.Express({ app }), - // // Automatically instrument Node.js libraries and frameworks - // ...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations(), - // ], - - // // Set tracesSampleRate to 1.0 to capture 100% - // // of transactions for performance monitoring. - // // We recommend adjusting this value in production - // tracesSampleRate: 1.0, - // }); - - // app.use(Sentry.Handlers.requestHandler()); - - // app.use(Sentry.Handlers.tracingHandler()); - app.use( cors({ origin(requestOrigin, callback) { const { ORIGIN } = configService.get('CORS'); - !requestOrigin ? (requestOrigin = '*') : undefined; + if (ORIGIN.includes('*')) { + return callback(null, true); + } if (ORIGIN.indexOf(requestOrigin) !== -1) { return callback(null, true); } @@ -63,28 +48,66 @@ function bootstrap() { app.set('views', join(ROOT_DIR, 'views')); app.use(express.static(join(ROOT_DIR, 'public'))); + app.use('/store', express.static(join(ROOT_DIR, 'store'))); + app.use('/', router); - // app.use(Sentry.Handlers.errorHandler()); - - // app.use(function onError(err, req, res, next) { - // res.statusCode = 500; - // res.end(res.sentry + '\n'); - // }); - app.use( (err: Error, req: Request, res: Response, next: NextFunction) => { if (err) { - return res.status(err['status'] || 500).json(err); + const webhook = configService.get('WEBHOOK'); + + if (webhook.EVENTS.ERRORS_WEBHOOK && webhook.EVENTS.ERRORS_WEBHOOK != '' && webhook.EVENTS.ERRORS) { + const tzoffset = new Date().getTimezoneOffset() * 60000; //offset in milliseconds + const localISOTime = new Date(Date.now() - tzoffset).toISOString(); + const now = localISOTime; + + const errorData = { + event: 'error', + data: { + error: err['error'] || 'Internal Server Error', + message: err['message'] || 'Internal Server Error', + status: err['status'] || 500, + response: { + message: err['message'] || 'Internal Server Error', + }, + }, + date_time: now, + }; + + logger.error(errorData); + + const baseURL = webhook.EVENTS.ERRORS_WEBHOOK; + const httpService = axios.create({ baseURL }); + + httpService.post('', errorData); + } + + if (err['message'].includes('No sessions')) { + console.log(err['message']); + process.exit(1); + } + + return res.status(err['status'] || 500).json({ + status: err['status'] || 500, + error: err['error'] || 'Internal Server Error', + response: { + message: err['message'] || 'Internal Server Error', + }, + }); } + + next(); }, (req: Request, res: Response, next: NextFunction) => { const { method, url } = req; res.status(HttpStatus.NOT_FOUND).json({ status: HttpStatus.NOT_FOUND, - message: `Cannot ${method.toUpperCase()} ${url}`, error: 'Not Found', + response: { + message: [`Cannot ${method.toUpperCase()} ${url}`], + }, }); next(); @@ -96,12 +119,14 @@ function bootstrap() { ServerUP.app = app; const server = ServerUP[httpServer.TYPE]; - server.listen(httpServer.PORT, () => - logger.log(httpServer.TYPE.toUpperCase() + ' - ON: ' + httpServer.PORT), - ); + server.listen(httpServer.PORT, () => logger.log(httpServer.TYPE.toUpperCase() + ' - ON: ' + httpServer.PORT)); initWA(); + initIO(server); + + if (configService.get('RABBITMQ').ENABLED) initAMQP(); + onUnexpectedError(); } diff --git a/src/utils/server-up.ts b/src/utils/server-up.ts index 9868efc0..e06caea7 100644 --- a/src/utils/server-up.ts +++ b/src/utils/server-up.ts @@ -1,8 +1,9 @@ import { Express } from 'express'; import { readFileSync } from 'fs'; -import { configService, SslConf } from '../config/env.config'; -import * as https from 'https'; import * as http from 'http'; +import * as https from 'https'; + +import { configService, SslConf } from '../config/env.config'; export class ServerUP { static #app: Express; diff --git a/src/utils/use-multi-file-auth-state-db.ts b/src/utils/use-multi-file-auth-state-db.ts index d0c518da..a021372a 100644 --- a/src/utils/use-multi-file-auth-state-db.ts +++ b/src/utils/use-multi-file-auth-state-db.ts @@ -6,9 +6,10 @@ import { proto, SignalDataTypeMap, } from '@whiskeysockets/baileys'; + import { configService, Database } from '../config/env.config'; import { Logger } from '../config/logger.config'; -import { dbserver } from '../db/db.connect'; +import { dbserver } from '../libs/db.connect'; export async function useMultiFileAuthStateDb( coll: string, @@ -24,12 +25,12 @@ export async function useMultiFileAuthStateDb( const writeData = async (data: any, key: string): Promise => { try { await client.connect(); - return await collection.replaceOne( - { _id: key }, - JSON.parse(JSON.stringify(data, BufferJSON.replacer)), - { upsert: true }, - ); - } catch {} + return await collection.replaceOne({ _id: key }, JSON.parse(JSON.stringify(data, BufferJSON.replacer)), { + upsert: true, + }); + } catch (error) { + logger.error(error); + } }; const readData = async (key: string): Promise => { @@ -38,14 +39,18 @@ export async function useMultiFileAuthStateDb( const data = await collection.findOne({ _id: key }); const creds = JSON.stringify(data); return JSON.parse(creds, BufferJSON.reviver); - } catch {} + } catch (error) { + logger.error(error); + } }; const removeData = async (key: string) => { try { await client.connect(); return await collection.deleteOne({ _id: key }); - } catch {} + } catch (error) { + logger.error(error); + } }; const creds: AuthenticationCreds = (await readData('creds')) || initAuthCreds(); diff --git a/src/utils/use-multi-file-auth-state-redis-db.ts b/src/utils/use-multi-file-auth-state-redis-db.ts index c5450ddc..8e685b54 100644 --- a/src/utils/use-multi-file-auth-state-redis-db.ts +++ b/src/utils/use-multi-file-auth-state-redis-db.ts @@ -5,9 +5,9 @@ import { proto, SignalDataTypeMap, } from '@whiskeysockets/baileys'; -import { RedisCache } from '../db/redis.client'; + import { Logger } from '../config/logger.config'; -import { Redis } from '../config/env.config'; +import { RedisCache } from '../libs/redis.client'; export async function useMultiFileAuthStateRedisDb(cache: RedisCache): Promise<{ state: AuthenticationState; diff --git a/src/validate/validate.schema.ts b/src/validate/validate.schema.ts index 2533e4d7..b8a4c0ad 100644 --- a/src/validate/validate.schema.ts +++ b/src/validate/validate.schema.ts @@ -53,11 +53,16 @@ export const instanceNameSchema: JSONSchema7 = { 'GROUP_UPDATE', 'GROUP_PARTICIPANTS_UPDATE', 'CONNECTION_UPDATE', + 'CALL', 'NEW_JWT_TOKEN', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'CHAMA_AI_ACTION', ], }, }, qrcode: { type: 'boolean', enum: [true, false] }, + number: { type: 'string', pattern: '^\\d+[\\.@\\w-]+' }, token: { type: 'string' }, }, ...isNotEmpty('instanceName'), @@ -123,7 +128,6 @@ const optionsSchema: JSONSchema7 = { const numberDefinition: JSONSchema7Definition = { type: 'string', - pattern: '^\\d+[\\.@\\w-]+', description: 'Invalid format', }; @@ -398,7 +402,7 @@ export const contactMessageSchema: JSONSchema7 = { email: { type: 'string' }, url: { type: 'string' }, }, - required: ['fullName', 'wuid', 'phoneNumber'], + required: ['fullName', 'phoneNumber'], ...isNotEmpty('fullName'), }, minItems: 1, @@ -445,7 +449,6 @@ export const whatsappNumberSchema: JSONSchema7 = { uniqueItems: true, items: { type: 'string', - pattern: '^\\d+', description: '"numbers" must be an array of numeric strings', }, }, @@ -456,7 +459,7 @@ export const readMessageSchema: JSONSchema7 = { $id: v4(), type: 'object', properties: { - readMessages: { + read_messages: { type: 'array', minItems: 1, uniqueItems: true, @@ -471,7 +474,7 @@ export const readMessageSchema: JSONSchema7 = { }, }, }, - required: ['readMessages'], + required: ['read_messages'], }; export const privacySettingsSchema: JSONSchema7 = { @@ -508,6 +511,7 @@ export const archiveChatSchema: JSONSchema7 = { $id: v4(), type: 'object', properties: { + chat: { type: 'string' }, lastMessage: { type: 'object', properties: { @@ -528,7 +532,7 @@ export const archiveChatSchema: JSONSchema7 = { }, archive: { type: 'boolean', enum: [true, false] }, }, - required: ['lastMessage', 'archive'], + required: ['archive'], }; export const deleteMessageSchema: JSONSchema7 = { @@ -668,6 +672,7 @@ export const createGroupSchema: JSONSchema7 = { subject: { type: 'string' }, description: { type: 'string' }, profilePicture: { type: 'string' }, + promoteParticipants: { type: 'boolean', enum: [true, false] }, participants: { type: 'array', minItems: 1, @@ -822,12 +827,84 @@ export const updateGroupDescriptionSchema: JSONSchema7 = { ...isNotEmpty('groupJid', 'description'), }; -// Webhook Schema export const webhookSchema: JSONSchema7 = { $id: v4(), type: 'object', properties: { url: { type: 'string' }, + events: { + type: 'array', + minItems: 0, + items: { + type: 'string', + enum: [ + 'APPLICATION_STARTUP', + 'QRCODE_UPDATED', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'SEND_MESSAGE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'PRESENCE_UPDATE', + 'CHATS_SET', + 'CHATS_UPSERT', + 'CHATS_UPDATE', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUP_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CONNECTION_UPDATE', + 'CALL', + 'NEW_JWT_TOKEN', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'CHAMA_AI_ACTION', + ], + }, + }, + }, + required: ['url'], + ...isNotEmpty('url'), +}; + +export const chatwootSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + enabled: { type: 'boolean', enum: [true, false] }, + account_id: { type: 'string' }, + token: { type: 'string' }, + url: { type: 'string' }, + sign_msg: { type: 'boolean', enum: [true, false] }, + reopen_conversation: { type: 'boolean', enum: [true, false] }, + conversation_pending: { type: 'boolean', enum: [true, false] }, + }, + required: ['enabled', 'account_id', 'token', 'url', 'sign_msg', 'reopen_conversation', 'conversation_pending'], + ...isNotEmpty('account_id', 'token', 'url', 'sign_msg', 'reopen_conversation', 'conversation_pending'), +}; + +export const settingsSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + reject_call: { type: 'boolean', enum: [true, false] }, + msg_call: { type: 'string' }, + groups_ignore: { type: 'boolean', enum: [true, false] }, + always_online: { type: 'boolean', enum: [true, false] }, + read_messages: { type: 'boolean', enum: [true, false] }, + read_status: { type: 'boolean', enum: [true, false] }, + }, + required: ['reject_call', 'groups_ignore', 'always_online', 'read_messages', 'read_status'], + ...isNotEmpty('reject_call', 'groups_ignore', 'always_online', 'read_messages', 'read_status'), +}; + +export const websocketSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { enabled: { type: 'boolean', enum: [true, false] }, events: { type: 'array', @@ -854,25 +931,122 @@ export const webhookSchema: JSONSchema7 = { 'GROUP_UPDATE', 'GROUP_PARTICIPANTS_UPDATE', 'CONNECTION_UPDATE', + 'CALL', 'NEW_JWT_TOKEN', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'CHAMA_AI_ACTION', ], }, }, }, - required: ['url', 'enabled'], - ...isNotEmpty('url'), + required: ['enabled'], + ...isNotEmpty('enabled'), }; -export const chatwootSchema: JSONSchema7 = { +export const rabbitmqSchema: JSONSchema7 = { $id: v4(), type: 'object', properties: { enabled: { type: 'boolean', enum: [true, false] }, - account_id: { type: 'string' }, - token: { type: 'string' }, - url: { type: 'string' }, - sign_msg: { type: 'boolean', enum: [true, false] }, + events: { + type: 'array', + minItems: 0, + items: { + type: 'string', + enum: [ + 'APPLICATION_STARTUP', + 'QRCODE_UPDATED', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'SEND_MESSAGE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'PRESENCE_UPDATE', + 'CHATS_SET', + 'CHATS_UPSERT', + 'CHATS_UPDATE', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUP_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CONNECTION_UPDATE', + 'CALL', + 'NEW_JWT_TOKEN', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'CHAMA_AI_ACTION', + ], + }, + }, }, - required: ['enabled', 'account_id', 'token', 'url', 'sign_msg'], - ...isNotEmpty('account_id', 'token', 'url', 'sign_msg'), + required: ['enabled'], + ...isNotEmpty('enabled'), +}; + +export const typebotSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + enabled: { type: 'boolean', enum: [true, false] }, + url: { type: 'string' }, + typebot: { type: 'string' }, + expire: { type: 'integer' }, + delay_message: { type: 'integer' }, + unknown_message: { type: 'string' }, + listening_from_me: { type: 'boolean', enum: [true, false] }, + }, + required: ['enabled', 'url', 'typebot', 'expire', 'delay_message', 'unknown_message', 'listening_from_me'], + ...isNotEmpty('enabled', 'url', 'typebot', 'expire', 'delay_message', 'unknown_message', 'listening_from_me'), +}; + +export const typebotStatusSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + remoteJid: { type: 'string' }, + status: { type: 'string', enum: ['opened', 'closed', 'paused'] }, + }, + required: ['remoteJid', 'status'], + ...isNotEmpty('remoteJid', 'status'), +}; + +export const typebotStartSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + remoteJid: { type: 'string' }, + url: { type: 'string' }, + typebot: { type: 'string' }, + }, + required: ['remoteJid', 'url', 'typebot'], + ...isNotEmpty('remoteJid', 'url', 'typebot'), +}; + +export const proxySchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + enabled: { type: 'boolean', enum: [true, false] }, + proxy: { type: 'string' }, + }, + required: ['enabled', 'proxy'], + ...isNotEmpty('enabled', 'proxy'), +}; + +export const chamaaiSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + enabled: { type: 'boolean', enum: [true, false] }, + url: { type: 'string' }, + token: { type: 'string' }, + waNumber: { type: 'string' }, + answerByAudio: { type: 'boolean', enum: [true, false] }, + }, + required: ['enabled', 'url', 'token', 'waNumber', 'answerByAudio'], + ...isNotEmpty('enabled', 'url', 'token', 'waNumber', 'answerByAudio'), }; diff --git a/src/whatsapp/abstract/abstract.repository.ts b/src/whatsapp/abstract/abstract.repository.ts index a7215383..a5b7a841 100644 --- a/src/whatsapp/abstract/abstract.repository.ts +++ b/src/whatsapp/abstract/abstract.repository.ts @@ -1,5 +1,6 @@ import { existsSync, mkdirSync, writeFileSync } from 'fs'; import { join } from 'path'; + import { ConfigService, Database } from '../../config/env.config'; import { ROOT_DIR } from '../../config/path.config'; @@ -34,11 +35,9 @@ export abstract class Repository implements IRepository { mkdirSync(create.path, { recursive: true }); } try { - writeFileSync( - join(create.path, create.fileName + '.json'), - JSON.stringify({ ...create.data }), - { encoding: 'utf-8' }, - ); + writeFileSync(join(create.path, create.fileName + '.json'), JSON.stringify({ ...create.data }), { + encoding: 'utf-8', + }); return { message: 'create - success' }; } finally { @@ -46,19 +45,23 @@ export abstract class Repository implements IRepository { } }; - public insert(data: any, instanceName: string, saveDb = false): Promise { + // eslint-disable-next-line + public insert(data: any, instanceName: string, saveDb = false): Promise { throw new Error('Method not implemented.'); } - public update(data: any, instanceName: string, saveDb = false): Promise { + // eslint-disable-next-line + public update(data: any, instanceName: string, saveDb = false): Promise { throw new Error('Method not implemented.'); } - public find(query: any): Promise { + // eslint-disable-next-line + public find(query: any): Promise { throw new Error('Method not implemented.'); } - delete(query: any, force?: boolean): Promise { + // eslint-disable-next-line + delete(query: any, force?: boolean): Promise { throw new Error('Method not implemented.'); } } diff --git a/src/whatsapp/abstract/abstract.router.ts b/src/whatsapp/abstract/abstract.router.ts index cb224cd6..7c603880 100644 --- a/src/whatsapp/abstract/abstract.router.ts +++ b/src/whatsapp/abstract/abstract.router.ts @@ -1,11 +1,13 @@ -import { InstanceDto } from '../dto/instance.dto'; -import { JSONSchema7 } from 'json-schema'; -import { Request } from 'express'; -import { validate } from 'jsonschema'; -import { BadRequestException } from '../../exceptions'; import 'express-async-errors'; + +import { Request } from 'express'; +import { JSONSchema7 } from 'json-schema'; +import { validate } from 'jsonschema'; + import { Logger } from '../../config/logger.config'; -import { GetParticipant, GroupInvite, GroupJid } from '../dto/group.dto'; +import { BadRequestException } from '../../exceptions'; +import { GetParticipant, GroupInvite } from '../dto/group.dto'; +import { InstanceDto } from '../dto/instance.dto'; type DataValidate = { request: Request; @@ -46,20 +48,21 @@ export abstract class RouterBroker { const v = schema ? validate(ref, schema) : { valid: true, errors: [] }; if (!v.valid) { - const message: any[] = v.errors.map(({ property, stack, schema }) => { + const message: any[] = v.errors.map(({ stack, schema }) => { let message: string; if (schema['description']) { message = schema['description']; } else { message = stack.replace('instance.', ''); } - return { - property: property.replace('instance.', ''), - message, - }; + return message; + // return { + // property: property.replace('instance.', ''), + // message, + // }; }); - logger.error([...message]); - throw new BadRequestException(...message); + logger.error(message); + throw new BadRequestException(message); } return await execute(instance, ref); @@ -99,21 +102,29 @@ export abstract class RouterBroker { public async groupValidate(args: DataValidate) { const { request, ClassRef, schema, execute } = args; - const groupJid = request.query as unknown as GroupJid; - - if (!groupJid?.groupJid) { - throw new BadRequestException( - 'The group id needs to be informed in the query', - 'ex: "groupJid=120362@g.us"', - ); - } - const instance = request.params as unknown as InstanceDto; const body = request.body; + let groupJid = body?.groupJid; + + if (!groupJid) { + if (request.query?.groupJid) { + groupJid = request.query.groupJid; + } else { + throw new BadRequestException('The group id needs to be informed in the query', 'ex: "groupJid=120362@g.us"'); + } + } + + if (!groupJid.endsWith('@g.us')) { + groupJid = groupJid + '@g.us'; + } + + Object.assign(body, { + groupJid: groupJid, + }); + const ref = new ClassRef(); - Object.assign(body, groupJid); Object.assign(ref, body); const v = validate(ref, schema); @@ -186,9 +197,7 @@ export abstract class RouterBroker { const getParticipants = request.query as unknown as GetParticipant; if (!getParticipants?.getParticipants) { - throw new BadRequestException( - 'The getParticipants needs to be informed in the query', - ); + throw new BadRequestException('The getParticipants needs to be informed in the query'); } const instance = request.params as unknown as InstanceDto; diff --git a/src/whatsapp/controllers/chamaai.controller.ts b/src/whatsapp/controllers/chamaai.controller.ts new file mode 100644 index 00000000..e9cafb50 --- /dev/null +++ b/src/whatsapp/controllers/chamaai.controller.ts @@ -0,0 +1,29 @@ +import { Logger } from '../../config/logger.config'; +import { ChamaaiDto } from '../dto/chamaai.dto'; +import { InstanceDto } from '../dto/instance.dto'; +import { ChamaaiService } from '../services/chamaai.service'; + +const logger = new Logger('ChamaaiController'); + +export class ChamaaiController { + constructor(private readonly chamaaiService: ChamaaiService) {} + + public async createChamaai(instance: InstanceDto, data: ChamaaiDto) { + logger.verbose('requested createChamaai from ' + instance.instanceName + ' instance'); + + if (!data.enabled) { + logger.verbose('chamaai disabled'); + data.url = ''; + data.token = ''; + data.waNumber = ''; + data.answerByAudio = false; + } + + return this.chamaaiService.create(instance, data); + } + + public async findChamaai(instance: InstanceDto) { + logger.verbose('requested findChamaai from ' + instance.instanceName + ' instance'); + return this.chamaaiService.find(instance); + } +} diff --git a/src/whatsapp/controllers/chat.controller.ts b/src/whatsapp/controllers/chat.controller.ts index 2b500ad1..0299841c 100644 --- a/src/whatsapp/controllers/chat.controller.ts +++ b/src/whatsapp/controllers/chat.controller.ts @@ -1,7 +1,8 @@ -import { proto } from '@whiskeysockets/baileys'; +import { Logger } from '../../config/logger.config'; import { ArchiveChatDto, DeleteMessage, + getBase64FromMediaMessageDto, NumberDto, PrivacySettingDto, ProfileNameDto, @@ -9,14 +10,12 @@ import { ProfileStatusDto, ReadMessageDto, WhatsAppNumberDto, - getBase64FromMediaMessageDto, } from '../dto/chat.dto'; import { InstanceDto } from '../dto/instance.dto'; import { ContactQuery } from '../repository/contact.repository'; import { MessageQuery } from '../repository/message.repository'; import { MessageUpQuery } from '../repository/messageUp.repository'; import { WAMonitoringService } from '../services/monitor.service'; -import { Logger } from '../../config/logger.config'; const logger = new Logger('ChatController'); @@ -47,7 +46,7 @@ export class ChatController { logger.verbose('requested fetchProfilePicture from ' + instanceName + ' instance'); return await this.waMonitor.waInstances[instanceName].profilePicture(data.number); } - + public async fetchProfile({ instanceName }: InstanceDto, data: NumberDto) { logger.verbose('requested fetchProfile from ' + instanceName + ' instance'); return await this.waMonitor.waInstances[instanceName].fetchProfile(instanceName, data.number); @@ -58,13 +57,8 @@ export class ChatController { return await this.waMonitor.waInstances[instanceName].fetchContacts(query); } - public async getBase64FromMediaMessage( - { instanceName }: InstanceDto, - data: getBase64FromMediaMessageDto, - ) { - logger.verbose( - 'requested getBase64FromMediaMessage from ' + instanceName + ' instance', - ); + public async getBase64FromMediaMessage({ instanceName }: InstanceDto, data: getBase64FromMediaMessageDto) { + logger.verbose('requested getBase64FromMediaMessage from ' + instanceName + ' instance'); return await this.waMonitor.waInstances[instanceName].getBase64FromMediaMessage(data); } @@ -88,22 +82,14 @@ export class ChatController { return await this.waMonitor.waInstances[instanceName].fetchPrivacySettings(); } - public async updatePrivacySettings( - { instanceName }: InstanceDto, - data: PrivacySettingDto, - ) { + public async updatePrivacySettings({ instanceName }: InstanceDto, data: PrivacySettingDto) { logger.verbose('requested updatePrivacySettings from ' + instanceName + ' instance'); return await this.waMonitor.waInstances[instanceName].updatePrivacySettings(data); } - public async fetchBusinessProfile( - { instanceName }: InstanceDto, - data: ProfilePictureDto, - ) { + public async fetchBusinessProfile({ instanceName }: InstanceDto, data: ProfilePictureDto) { logger.verbose('requested fetchBusinessProfile from ' + instanceName + ' instance'); - return await this.waMonitor.waInstances[instanceName].fetchBusinessProfile( - data.number, - ); + return await this.waMonitor.waInstances[instanceName].fetchBusinessProfile(data.number); } public async updateProfileName({ instanceName }: InstanceDto, data: ProfileNameDto) { @@ -111,30 +97,17 @@ export class ChatController { return await this.waMonitor.waInstances[instanceName].updateProfileName(data.name); } - public async updateProfileStatus( - { instanceName }: InstanceDto, - data: ProfileStatusDto, - ) { + public async updateProfileStatus({ instanceName }: InstanceDto, data: ProfileStatusDto) { logger.verbose('requested updateProfileStatus from ' + instanceName + ' instance'); - return await this.waMonitor.waInstances[instanceName].updateProfileStatus( - data.status, - ); + return await this.waMonitor.waInstances[instanceName].updateProfileStatus(data.status); } - public async updateProfilePicture( - { instanceName }: InstanceDto, - data: ProfilePictureDto, - ) { + public async updateProfilePicture({ instanceName }: InstanceDto, data: ProfilePictureDto) { logger.verbose('requested updateProfilePicture from ' + instanceName + ' instance'); - return await this.waMonitor.waInstances[instanceName].updateProfilePicture( - data.picture, - ); + return await this.waMonitor.waInstances[instanceName].updateProfilePicture(data.picture); } - public async removeProfilePicture( - { instanceName }: InstanceDto, - data: ProfilePictureDto, - ) { + public async removeProfilePicture({ instanceName }: InstanceDto) { logger.verbose('requested removeProfilePicture from ' + instanceName + ' instance'); return await this.waMonitor.waInstances[instanceName].removeProfilePicture(); } diff --git a/src/whatsapp/controllers/chatwoot.controller.ts b/src/whatsapp/controllers/chatwoot.controller.ts index de0aef7a..46b93aee 100644 --- a/src/whatsapp/controllers/chatwoot.controller.ts +++ b/src/whatsapp/controllers/chatwoot.controller.ts @@ -1,24 +1,20 @@ import { isURL } from 'class-validator'; -import { BadRequestException } from '../../exceptions'; -import { InstanceDto } from '../dto/instance.dto'; -import { ChatwootDto } from '../dto/chatwoot.dto'; -import { ChatwootService } from '../services/chatwoot.service'; -import { Logger } from '../../config/logger.config'; -import { waMonitor } from '../whatsapp.module'; + import { ConfigService, HttpServer } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; +import { BadRequestException } from '../../exceptions'; +import { ChatwootDto } from '../dto/chatwoot.dto'; +import { InstanceDto } from '../dto/instance.dto'; +import { ChatwootService } from '../services/chatwoot.service'; +import { waMonitor } from '../whatsapp.module'; const logger = new Logger('ChatwootController'); export class ChatwootController { - constructor( - private readonly chatwootService: ChatwootService, - private readonly configService: ConfigService, - ) {} + constructor(private readonly chatwootService: ChatwootService, private readonly configService: ConfigService) {} public async createChatwoot(instance: InstanceDto, data: ChatwootDto) { - logger.verbose( - 'requested createChatwoot from ' + instance.instanceName + ' instance', - ); + logger.verbose('requested createChatwoot from ' + instance.instanceName + ' instance'); if (data.enabled) { if (!isURL(data.url, { require_tld: false })) { @@ -33,7 +29,7 @@ export class ChatwootController { throw new BadRequestException('token is required'); } - if (!data.sign_msg) { + if (data.sign_msg !== true && data.sign_msg !== false) { throw new BadRequestException('sign_msg is required'); } } @@ -44,6 +40,8 @@ export class ChatwootController { data.token = ''; data.url = ''; data.sign_msg = false; + data.reopen_conversation = false; + data.conversation_pending = false; } data.name_inbox = instance.instanceName; @@ -54,7 +52,7 @@ export class ChatwootController { const response = { ...result, - webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`, + webhook_url: `${urlServer}/chatwoot/webhook/${encodeURIComponent(instance.instanceName)}`, }; return response; @@ -80,16 +78,14 @@ export class ChatwootController { const response = { ...result, - webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`, + webhook_url: `${urlServer}/chatwoot/webhook/${encodeURIComponent(instance.instanceName)}`, }; return response; } public async receiveWebhook(instance: InstanceDto, data: any) { - logger.verbose( - 'requested receiveWebhook from ' + instance.instanceName + ' instance', - ); + logger.verbose('requested receiveWebhook from ' + instance.instanceName + ' instance'); const chatwootService = new ChatwootService(waMonitor, this.configService); return chatwootService.receiveWebhook(instance, data); diff --git a/src/whatsapp/controllers/group.controller.ts b/src/whatsapp/controllers/group.controller.ts index f4d381ce..0cf093ca 100644 --- a/src/whatsapp/controllers/group.controller.ts +++ b/src/whatsapp/controllers/group.controller.ts @@ -1,3 +1,4 @@ +import { Logger } from '../../config/logger.config'; import { CreateGroupDto, GetParticipant, @@ -13,7 +14,6 @@ import { } from '../dto/group.dto'; import { InstanceDto } from '../dto/instance.dto'; import { WAMonitoringService } from '../services/monitor.service'; -import { Logger } from '../../config/logger.config'; const logger = new Logger('ChatController'); @@ -26,33 +26,18 @@ export class GroupController { } public async updateGroupPicture(instance: InstanceDto, update: GroupPictureDto) { - logger.verbose( - 'requested updateGroupPicture from ' + instance.instanceName + ' instance', - ); - return await this.waMonitor.waInstances[instance.instanceName].updateGroupPicture( - update, - ); + logger.verbose('requested updateGroupPicture from ' + instance.instanceName + ' instance'); + return await this.waMonitor.waInstances[instance.instanceName].updateGroupPicture(update); } public async updateGroupSubject(instance: InstanceDto, update: GroupSubjectDto) { - logger.verbose( - 'requested updateGroupSubject from ' + instance.instanceName + ' instance', - ); - return await this.waMonitor.waInstances[instance.instanceName].updateGroupSubject( - update, - ); + logger.verbose('requested updateGroupSubject from ' + instance.instanceName + ' instance'); + return await this.waMonitor.waInstances[instance.instanceName].updateGroupSubject(update); } - public async updateGroupDescription( - instance: InstanceDto, - update: GroupDescriptionDto, - ) { - logger.verbose( - 'requested updateGroupDescription from ' + instance.instanceName + ' instance', - ); - return await this.waMonitor.waInstances[instance.instanceName].updateGroupDescription( - update, - ); + public async updateGroupDescription(instance: InstanceDto, update: GroupDescriptionDto) { + logger.verbose('requested updateGroupDescription from ' + instance.instanceName + ' instance'); + return await this.waMonitor.waInstances[instance.instanceName].updateGroupDescription(update); } public async findGroupInfo(instance: InstanceDto, groupJid: GroupJid) { @@ -61,12 +46,8 @@ export class GroupController { } public async fetchAllGroups(instance: InstanceDto, getPaticipants: GetParticipant) { - logger.verbose( - 'requested fetchAllGroups from ' + instance.instanceName + ' instance', - ); - return await this.waMonitor.waInstances[instance.instanceName].fetchAllGroups( - getPaticipants, - ); + logger.verbose('requested fetchAllGroups from ' + instance.instanceName + ' instance'); + return await this.waMonitor.waInstances[instance.instanceName].fetchAllGroups(getPaticipants); } public async inviteCode(instance: InstanceDto, groupJid: GroupJid) { @@ -85,49 +66,28 @@ export class GroupController { } public async revokeInviteCode(instance: InstanceDto, groupJid: GroupJid) { - logger.verbose( - 'requested revokeInviteCode from ' + instance.instanceName + ' instance', - ); - return await this.waMonitor.waInstances[instance.instanceName].revokeInviteCode( - groupJid, - ); + logger.verbose('requested revokeInviteCode from ' + instance.instanceName + ' instance'); + return await this.waMonitor.waInstances[instance.instanceName].revokeInviteCode(groupJid); } public async findParticipants(instance: InstanceDto, groupJid: GroupJid) { - logger.verbose( - 'requested findParticipants from ' + instance.instanceName + ' instance', - ); - return await this.waMonitor.waInstances[instance.instanceName].findParticipants( - groupJid, - ); + logger.verbose('requested findParticipants from ' + instance.instanceName + ' instance'); + return await this.waMonitor.waInstances[instance.instanceName].findParticipants(groupJid); } - public async updateGParticipate( - instance: InstanceDto, - update: GroupUpdateParticipantDto, - ) { - logger.verbose( - 'requested updateGParticipate from ' + instance.instanceName + ' instance', - ); - return await this.waMonitor.waInstances[instance.instanceName].updateGParticipant( - update, - ); + public async updateGParticipate(instance: InstanceDto, update: GroupUpdateParticipantDto) { + logger.verbose('requested updateGParticipate from ' + instance.instanceName + ' instance'); + return await this.waMonitor.waInstances[instance.instanceName].updateGParticipant(update); } public async updateGSetting(instance: InstanceDto, update: GroupUpdateSettingDto) { - logger.verbose( - 'requested updateGSetting from ' + instance.instanceName + ' instance', - ); + logger.verbose('requested updateGSetting from ' + instance.instanceName + ' instance'); return await this.waMonitor.waInstances[instance.instanceName].updateGSetting(update); } public async toggleEphemeral(instance: InstanceDto, update: GroupToggleEphemeralDto) { - logger.verbose( - 'requested toggleEphemeral from ' + instance.instanceName + ' instance', - ); - return await this.waMonitor.waInstances[instance.instanceName].toggleEphemeral( - update, - ); + logger.verbose('requested toggleEphemeral from ' + instance.instanceName + ' instance'); + return await this.waMonitor.waInstances[instance.instanceName].toggleEphemeral(update); } public async leaveGroup(instance: InstanceDto, groupJid: GroupJid) { diff --git a/src/whatsapp/controllers/instance.controller.ts b/src/whatsapp/controllers/instance.controller.ts index f0adb3a3..8d0e21ca 100644 --- a/src/whatsapp/controllers/instance.controller.ts +++ b/src/whatsapp/controllers/instance.controller.ts @@ -1,18 +1,23 @@ import { delay } from '@whiskeysockets/baileys'; +import { isURL } from 'class-validator'; import EventEmitter2 from 'eventemitter2'; -import { Auth, ConfigService, HttpServer } from '../../config/env.config'; + +import { ConfigService, HttpServer } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; import { BadRequestException, InternalServerErrorException } from '../../exceptions'; +import { RedisCache } from '../../libs/redis.client'; import { InstanceDto } from '../dto/instance.dto'; import { RepositoryBroker } from '../repository/repository.manager'; import { AuthService, OldToken } from '../services/auth.service'; -import { WAMonitoringService } from '../services/monitor.service'; -import { WAStartupService } from '../services/whatsapp.service'; -import { WebhookService } from '../services/webhook.service'; import { ChatwootService } from '../services/chatwoot.service'; -import { Logger } from '../../config/logger.config'; +import { WAMonitoringService } from '../services/monitor.service'; +import { RabbitmqService } from '../services/rabbitmq.service'; +import { SettingsService } from '../services/settings.service'; +import { TypebotService } from '../services/typebot.service'; +import { WebhookService } from '../services/webhook.service'; +import { WebsocketService } from '../services/websocket.service'; +import { WAStartupService } from '../services/whatsapp.service'; import { wa } from '../types/wa.types'; -import { RedisCache } from '../../db/redis.client'; -import { isURL } from 'class-validator'; export class InstanceController { constructor( @@ -23,6 +28,10 @@ export class InstanceController { private readonly authService: AuthService, private readonly webhookService: WebhookService, private readonly chatwootService: ChatwootService, + private readonly settingsService: SettingsService, + private readonly websocketService: WebsocketService, + private readonly rabbitmqService: RabbitmqService, + private readonly typebotService: TypebotService, private readonly cache: RedisCache, ) {} @@ -34,40 +43,42 @@ export class InstanceController { webhook_by_events, events, qrcode, + number, token, chatwoot_account_id, chatwoot_token, chatwoot_url, chatwoot_sign_msg, + chatwoot_reopen_conversation, + chatwoot_conversation_pending, + reject_call, + msg_call, + groups_ignore, + always_online, + read_messages, + read_status, + websocket_enabled, + websocket_events, + rabbitmq_enabled, + rabbitmq_events, + typebot_url, + typebot, + typebot_expire, + typebot_keyword_finish, + typebot_delay_message, + typebot_unknown_message, + typebot_listening_from_me, }: InstanceDto) { - this.logger.verbose('requested createInstance from ' + instanceName + ' instance'); - - const mode = this.configService.get('AUTHENTICATION').INSTANCE.MODE; - - if (mode === 'container') { - this.logger.verbose('container mode'); - - if (Object.keys(this.waMonitor.waInstances).length > 0) { - throw new BadRequestException([ - 'Instance already created', - 'Only one instance can be created', - ]); - } + try { + this.logger.verbose('requested createInstance from ' + instanceName + ' instance'); this.logger.verbose('checking duplicate token'); await this.authService.checkDuplicateToken(token); this.logger.verbose('creating instance'); - const instance = new WAStartupService( - this.configService, - this.eventEmitter, - this.repository, - this.cache, - ); - instance.instanceName = instanceName - .toLowerCase() - .replace(/[^a-z0-9]/g, '') - .replace(' ', ''); + const instance = new WAStartupService(this.configService, this.eventEmitter, this.repository, this.cache); + instance.instanceName = instanceName; + this.logger.verbose('instance: ' + instance.instanceName + ' created'); this.waMonitor.waInstances[instance.instanceName] = instance; @@ -83,193 +94,237 @@ export class InstanceController { this.logger.verbose('hash: ' + hash + ' generated'); - let getEvents: string[]; + let webhookEvents: string[]; if (webhook) { if (!isURL(webhook, { require_tld: false })) { throw new BadRequestException('Invalid "url" property in webhook'); } + this.logger.verbose('creating webhook'); try { + let newEvents: string[] = []; + if (events.length === 0) { + newEvents = [ + 'APPLICATION_STARTUP', + 'QRCODE_UPDATED', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'SEND_MESSAGE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'PRESENCE_UPDATE', + 'CHATS_SET', + 'CHATS_UPSERT', + 'CHATS_UPDATE', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUP_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CONNECTION_UPDATE', + 'CALL', + 'NEW_JWT_TOKEN', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'CHAMA_AI_ACTION', + ]; + } else { + newEvents = events; + } this.webhookService.create(instance, { enabled: true, url: webhook, - events, + events: newEvents, webhook_by_events, }); - getEvents = (await this.webhookService.find(instance)).events; + webhookEvents = (await this.webhookService.find(instance)).events; } catch (error) { this.logger.log(error); } } - if (!chatwoot_account_id || !chatwoot_token || !chatwoot_url) { - this.logger.verbose('instance created'); - this.logger.verbose({ - instance: { - instanceName: instance.instanceName, - status: 'created', - }, - hash, - webhook, - events: getEvents, - }); + let websocketEvents: string[]; - return { - instance: { - instanceName: instance.instanceName, - status: 'created', - }, - hash, - webhook, - events: getEvents, - }; + if (websocket_enabled) { + this.logger.verbose('creating websocket'); + try { + let newEvents: string[] = []; + if (websocket_events.length === 0) { + newEvents = [ + 'APPLICATION_STARTUP', + 'QRCODE_UPDATED', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'SEND_MESSAGE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'PRESENCE_UPDATE', + 'CHATS_SET', + 'CHATS_UPSERT', + 'CHATS_UPDATE', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUP_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CONNECTION_UPDATE', + 'CALL', + 'NEW_JWT_TOKEN', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'CHAMA_AI_ACTION', + ]; + } else { + newEvents = websocket_events; + } + this.websocketService.create(instance, { + enabled: true, + events: newEvents, + }); + + websocketEvents = (await this.websocketService.find(instance)).events; + } catch (error) { + this.logger.log(error); + } } - if (!chatwoot_account_id) { - throw new BadRequestException('account_id is required'); + let rabbitmqEvents: string[]; + + if (rabbitmq_enabled) { + this.logger.verbose('creating rabbitmq'); + try { + let newEvents: string[] = []; + if (rabbitmq_events.length === 0) { + newEvents = [ + 'APPLICATION_STARTUP', + 'QRCODE_UPDATED', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'SEND_MESSAGE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'PRESENCE_UPDATE', + 'CHATS_SET', + 'CHATS_UPSERT', + 'CHATS_UPDATE', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUP_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CONNECTION_UPDATE', + 'CALL', + 'NEW_JWT_TOKEN', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'CHAMA_AI_ACTION', + ]; + } else { + newEvents = rabbitmq_events; + } + this.rabbitmqService.create(instance, { + enabled: true, + events: newEvents, + }); + + rabbitmqEvents = (await this.rabbitmqService.find(instance)).events; + } catch (error) { + this.logger.log(error); + } } - if (!chatwoot_token) { - throw new BadRequestException('token is required'); + if (typebot_url) { + try { + if (!isURL(typebot_url, { require_tld: false })) { + throw new BadRequestException('Invalid "url" property in typebot_url'); + } + + this.logger.verbose('creating typebot'); + + this.typebotService.create(instance, { + enabled: true, + url: typebot_url, + typebot: typebot, + expire: typebot_expire, + keyword_finish: typebot_keyword_finish, + delay_message: typebot_delay_message, + unknown_message: typebot_unknown_message, + listening_from_me: typebot_listening_from_me, + }); + } catch (error) { + this.logger.log(error); + } } - if (!chatwoot_url) { - throw new BadRequestException('url is required'); - } - - if (!isURL(chatwoot_url, { require_tld: false })) { - throw new BadRequestException('Invalid "url" property in chatwoot'); - } - - const urlServer = this.configService.get('SERVER').URL; - - try { - this.chatwootService.create(instance, { - enabled: true, - account_id: chatwoot_account_id, - token: chatwoot_token, - url: chatwoot_url, - sign_msg: chatwoot_sign_msg || false, - name_inbox: instance.instanceName, - }); - - this.chatwootService.initInstanceChatwoot( - instance, - instance.instanceName, - `${urlServer}/chatwoot/webhook/${instance.instanceName}`, - qrcode, - ); - } catch (error) { - this.logger.log(error); - } - - return { - instance: { - instanceName: instance.instanceName, - status: 'created', - }, - hash, - chatwoot: { - enabled: true, - account_id: chatwoot_account_id, - token: chatwoot_token, - url: chatwoot_url, - sign_msg: chatwoot_sign_msg || false, - name_inbox: instance.instanceName, - webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`, - }, + this.logger.verbose('creating settings'); + const settings: wa.LocalSettings = { + reject_call: reject_call || false, + msg_call: msg_call || '', + groups_ignore: groups_ignore || false, + always_online: always_online || false, + read_messages: read_messages || false, + read_status: read_status || false, }; - } else { - this.logger.verbose('server mode'); - this.logger.verbose('checking duplicate token'); - await this.authService.checkDuplicateToken(token); + this.logger.verbose('settings: ' + JSON.stringify(settings)); - this.logger.verbose('creating instance'); - const instance = new WAStartupService( - this.configService, - this.eventEmitter, - this.repository, - this.cache, - ); - instance.instanceName = instanceName - .toLowerCase() - .replace(/[^a-z0-9]/g, '') - .replace(' ', ''); - - this.logger.verbose('instance: ' + instance.instanceName + ' created'); - - this.waMonitor.waInstances[instance.instanceName] = instance; - this.waMonitor.delInstanceTime(instance.instanceName); - - this.logger.verbose('generating hash'); - const hash = await this.authService.generateHash( - { - instanceName: instance.instanceName, - }, - token, - ); - - this.logger.verbose('hash: ' + hash + ' generated'); - - let getEvents: string[]; - - if (webhook) { - if (!isURL(webhook, { require_tld: false })) { - throw new BadRequestException('Invalid "url" property in webhook'); - } - - this.logger.verbose('creating webhook'); - try { - this.webhookService.create(instance, { - enabled: true, - url: webhook, - events, - webhook_by_events, - }); - - getEvents = (await this.webhookService.find(instance)).events; - } catch (error) { - this.logger.log(error); - } - } + this.settingsService.create(instance, settings); if (!chatwoot_account_id || !chatwoot_token || !chatwoot_url) { let getQrcode: wa.QrCode; if (qrcode) { this.logger.verbose('creating qrcode'); - await instance.connectToWhatsapp(); - await delay(2000); + await instance.connectToWhatsapp(number); + await delay(5000); getQrcode = instance.qrCode; } - this.logger.verbose('instance created'); - this.logger.verbose({ + const result = { instance: { instanceName: instance.instanceName, status: 'created', }, hash, - webhook, - webhook_by_events, - events: getEvents, - qrcode: getQrcode, - }); - - return { - instance: { - instanceName: instance.instanceName, - status: 'created', + webhook: { + webhook, + webhook_by_events, + events: webhookEvents, }, - hash, - webhook, - webhook_by_events, - events: getEvents, + websocket: { + enabled: websocket_enabled, + events: websocketEvents, + }, + rabbitmq: { + enabled: rabbitmq_enabled, + events: rabbitmqEvents, + }, + typebot: { + enabled: typebot_url ? true : false, + url: typebot_url, + typebot, + expire: typebot_expire, + keyword_finish: typebot_keyword_finish, + delay_message: typebot_delay_message, + unknown_message: typebot_unknown_message, + listening_from_me: typebot_listening_from_me, + }, + settings, qrcode: getQrcode, }; + + this.logger.verbose('instance created'); + this.logger.verbose(result); + + return result; } if (!chatwoot_account_id) { @@ -288,6 +343,18 @@ export class InstanceController { throw new BadRequestException('Invalid "url" property in chatwoot'); } + if (chatwoot_sign_msg !== true && chatwoot_sign_msg !== false) { + throw new BadRequestException('sign_msg is required'); + } + + if (chatwoot_reopen_conversation !== true && chatwoot_reopen_conversation !== false) { + throw new BadRequestException('reopen_conversation is required'); + } + + if (chatwoot_conversation_pending !== true && chatwoot_conversation_pending !== false) { + throw new BadRequestException('conversation_pending is required'); + } + const urlServer = this.configService.get('SERVER').URL; try { @@ -297,14 +364,18 @@ export class InstanceController { token: chatwoot_token, url: chatwoot_url, sign_msg: chatwoot_sign_msg || false, - name_inbox: instance.instanceName, + name_inbox: instance.instanceName.split('-cwId-')[0], + number, + reopen_conversation: chatwoot_reopen_conversation || false, + conversation_pending: chatwoot_conversation_pending || false, }); this.chatwootService.initInstanceChatwoot( instance, - instance.instanceName, - `${urlServer}/chatwoot/webhook/${instance.instanceName}`, + instance.instanceName.split('-cwId-')[0], + `${urlServer}/chatwoot/webhook/${encodeURIComponent(instance.instanceName)}`, qrcode, + number, ); } catch (error) { this.logger.log(error); @@ -316,44 +387,85 @@ export class InstanceController { status: 'created', }, hash, - webhook, - webhook_by_events, - events: getEvents, + webhook: { + webhook, + webhook_by_events, + events: webhookEvents, + }, + websocket: { + enabled: websocket_enabled, + events: websocketEvents, + }, + rabbitmq: { + enabled: rabbitmq_enabled, + events: rabbitmqEvents, + }, + typebot: { + enabled: typebot_url ? true : false, + url: typebot_url, + typebot, + expire: typebot_expire, + keyword_finish: typebot_keyword_finish, + delay_message: typebot_delay_message, + unknown_message: typebot_unknown_message, + listening_from_me: typebot_listening_from_me, + }, + settings, chatwoot: { enabled: true, account_id: chatwoot_account_id, token: chatwoot_token, url: chatwoot_url, sign_msg: chatwoot_sign_msg || false, + reopen_conversation: chatwoot_reopen_conversation || false, + conversation_pending: chatwoot_conversation_pending || false, + number, name_inbox: instance.instanceName, - webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`, + webhook_url: `${urlServer}/chatwoot/webhook/${encodeURIComponent(instance.instanceName)}`, }, }; + } catch (error) { + this.logger.error(error.message[0]); + throw new BadRequestException(error.message[0]); } } - public async connectToWhatsapp({ instanceName }: InstanceDto) { + public async connectToWhatsapp({ instanceName, number = null }: InstanceDto) { try { - this.logger.verbose( - 'requested connectToWhatsapp from ' + instanceName + ' instance', - ); + this.logger.verbose('requested connectToWhatsapp from ' + instanceName + ' instance'); const instance = this.waMonitor.waInstances[instanceName]; const state = instance?.connectionStatus?.state; this.logger.verbose('state: ' + state); - switch (state) { - case 'close': - this.logger.verbose('connecting'); - await instance.connectToWhatsapp(); - await delay(2000); - return instance.qrCode; - case 'connecting': - return instance.qrCode; - default: - return await this.connectionState({ instanceName }); + if (!state) { + throw new BadRequestException('The "' + instanceName + '" instance does not exist'); } + + if (state == 'open') { + return await this.connectionState({ instanceName }); + } + + if (state == 'connecting') { + return instance.qrCode; + } + + if (state == 'close') { + this.logger.verbose('connecting'); + await instance.connectToWhatsapp(number); + + await delay(5000); + return instance.qrCode; + } + + return { + instance: { + instanceName: instanceName, + status: state, + }, + qrcode: instance?.qrCode, + }; } catch (error) { this.logger.error(error); } @@ -366,7 +478,7 @@ export class InstanceController { this.logger.verbose('logging out instance: ' + instanceName); this.waMonitor.waInstances[instanceName]?.client?.ws?.close(); - return { error: false, message: 'Instance restarted' }; + return { status: 'SUCCESS', error: false, response: { message: 'Instance restarted' } }; } catch (error) { this.logger.error(error); } @@ -374,39 +486,41 @@ export class InstanceController { public async connectionState({ instanceName }: InstanceDto) { this.logger.verbose('requested connectionState from ' + instanceName + ' instance'); - return this.waMonitor.waInstances[instanceName]?.connectionStatus; + return { + instance: { + instanceName: instanceName, + state: this.waMonitor.waInstances[instanceName]?.connectionStatus?.state, + }, + }; } public async fetchInstances({ instanceName }: InstanceDto) { - this.logger.verbose('requested fetchInstances from ' + instanceName + ' instance'); if (instanceName) { + this.logger.verbose('requested fetchInstances from ' + instanceName + ' instance'); this.logger.verbose('instanceName: ' + instanceName); return this.waMonitor.instanceInfo(instanceName); } + this.logger.verbose('requested fetchInstances (all instances)'); return this.waMonitor.instanceInfo(); } public async logout({ instanceName }: InstanceDto) { this.logger.verbose('requested logout from ' + instanceName + ' instance'); - const stateConn = await this.connectionState({ instanceName }); + const { instance } = await this.connectionState({ instanceName }); - if (stateConn.state === 'close') { - throw new BadRequestException( - 'The "' + instanceName + '" instance is not connected', - ); + if (instance.state === 'close') { + throw new BadRequestException('The "' + instanceName + '" instance is not connected'); } try { this.logger.verbose('logging out instance: ' + instanceName); - await this.waMonitor.waInstances[instanceName]?.client?.logout( - 'Log out instance: ' + instanceName, - ); + await this.waMonitor.waInstances[instanceName]?.client?.logout('Log out instance: ' + instanceName); this.logger.verbose('close connection instance: ' + instanceName); this.waMonitor.waInstances[instanceName]?.client?.ws?.close(); - return { error: false, message: 'Instance logged out' }; + return { status: 'SUCCESS', error: false, response: { message: 'Instance logged out' } }; } catch (error) { throw new InternalServerErrorException(error.toString()); } @@ -414,26 +528,24 @@ export class InstanceController { public async deleteInstance({ instanceName }: InstanceDto) { this.logger.verbose('requested deleteInstance from ' + instanceName + ' instance'); - const stateConn = await this.connectionState({ instanceName }); + const { instance } = await this.connectionState({ instanceName }); - if (stateConn.state === 'open') { - throw new BadRequestException( - 'The "' + instanceName + '" instance needs to be disconnected', - ); + if (instance.state === 'open') { + throw new BadRequestException('The "' + instanceName + '" instance needs to be disconnected'); } try { - if (stateConn.state === 'connecting') { + if (instance.state === 'connecting') { this.logger.verbose('logging out instance: ' + instanceName); await this.logout({ instanceName }); delete this.waMonitor.waInstances[instanceName]; - return { error: false, message: 'Instance deleted' }; + return { status: 'SUCCESS', error: false, response: { message: 'Instance deleted' } }; } else { this.logger.verbose('deleting instance: ' + instanceName); delete this.waMonitor.waInstances[instanceName]; this.eventEmitter.emit('remove.instance', instanceName, 'inner'); - return { error: false, message: 'Instance deleted' }; + return { status: 'SUCCESS', error: false, response: { message: 'Instance deleted' } }; } } catch (error) { throw new BadRequestException(error.toString()); diff --git a/src/whatsapp/controllers/proxy.controller.ts b/src/whatsapp/controllers/proxy.controller.ts new file mode 100644 index 00000000..1656d830 --- /dev/null +++ b/src/whatsapp/controllers/proxy.controller.ts @@ -0,0 +1,26 @@ +import { Logger } from '../../config/logger.config'; +import { InstanceDto } from '../dto/instance.dto'; +import { ProxyDto } from '../dto/proxy.dto'; +import { ProxyService } from '../services/proxy.service'; + +const logger = new Logger('ProxyController'); + +export class ProxyController { + constructor(private readonly proxyService: ProxyService) {} + + public async createProxy(instance: InstanceDto, data: ProxyDto) { + logger.verbose('requested createProxy from ' + instance.instanceName + ' instance'); + + if (!data.enabled) { + logger.verbose('proxy disabled'); + data.proxy = ''; + } + + return this.proxyService.create(instance, data); + } + + public async findProxy(instance: InstanceDto) { + logger.verbose('requested findProxy from ' + instance.instanceName + ' instance'); + return this.proxyService.find(instance); + } +} diff --git a/src/whatsapp/controllers/rabbitmq.controller.ts b/src/whatsapp/controllers/rabbitmq.controller.ts new file mode 100644 index 00000000..8d33ce84 --- /dev/null +++ b/src/whatsapp/controllers/rabbitmq.controller.ts @@ -0,0 +1,56 @@ +import { Logger } from '../../config/logger.config'; +import { InstanceDto } from '../dto/instance.dto'; +import { RabbitmqDto } from '../dto/rabbitmq.dto'; +import { RabbitmqService } from '../services/rabbitmq.service'; + +const logger = new Logger('RabbitmqController'); + +export class RabbitmqController { + constructor(private readonly rabbitmqService: RabbitmqService) {} + + public async createRabbitmq(instance: InstanceDto, data: RabbitmqDto) { + logger.verbose('requested createRabbitmq from ' + instance.instanceName + ' instance'); + + if (!data.enabled) { + logger.verbose('rabbitmq disabled'); + data.events = []; + } + + if (data.events.length === 0) { + logger.verbose('rabbitmq events empty'); + data.events = [ + 'APPLICATION_STARTUP', + 'QRCODE_UPDATED', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'SEND_MESSAGE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'PRESENCE_UPDATE', + 'CHATS_SET', + 'CHATS_UPSERT', + 'CHATS_UPDATE', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUP_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CONNECTION_UPDATE', + 'CALL', + 'NEW_JWT_TOKEN', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'CHAMA_AI_ACTION', + ]; + } + + return this.rabbitmqService.create(instance, data); + } + + public async findRabbitmq(instance: InstanceDto) { + logger.verbose('requested findRabbitmq from ' + instance.instanceName + ' instance'); + return this.rabbitmqService.find(instance); + } +} diff --git a/src/whatsapp/controllers/sendMessage.controller.ts b/src/whatsapp/controllers/sendMessage.controller.ts index fb942a9c..20e38ae5 100644 --- a/src/whatsapp/controllers/sendMessage.controller.ts +++ b/src/whatsapp/controllers/sendMessage.controller.ts @@ -1,4 +1,6 @@ import { isBase64, isURL } from 'class-validator'; + +import { Logger } from '../../config/logger.config'; import { BadRequestException } from '../../exceptions'; import { InstanceDto } from '../dto/instance.dto'; import { @@ -16,8 +18,6 @@ import { } from '../dto/sendMessage.dto'; import { WAMonitoringService } from '../services/monitor.service'; -import { Logger } from '../../config/logger.config'; - const logger = new Logger('MessageRouter'); export class SendMessageController { @@ -39,12 +39,7 @@ export class SendMessageController { throw new BadRequestException('For base64 the file name must be informed.'); } - logger.verbose( - 'isURL: ' + - isURL(data?.mediaMessage?.media) + - ', isBase64: ' + - isBase64(data?.mediaMessage?.media), - ); + logger.verbose('isURL: ' + isURL(data?.mediaMessage?.media) + ', isBase64: ' + isBase64(data?.mediaMessage?.media)); if (isURL(data?.mediaMessage?.media) || isBase64(data?.mediaMessage?.media)) { return await this.waMonitor.waInstances[instanceName].mediaMessage(data); } @@ -55,10 +50,7 @@ export class SendMessageController { logger.verbose('requested sendSticker from ' + instanceName + ' instance'); logger.verbose( - 'isURL: ' + - isURL(data?.stickerMessage?.image) + - ', isBase64: ' + - isBase64(data?.stickerMessage?.image), + 'isURL: ' + isURL(data?.stickerMessage?.image) + ', isBase64: ' + isBase64(data?.stickerMessage?.image), ); if (isURL(data.stickerMessage.image) || isBase64(data.stickerMessage.image)) { return await this.waMonitor.waInstances[instanceName].mediaSticker(data); @@ -69,12 +61,7 @@ export class SendMessageController { public async sendWhatsAppAudio({ instanceName }: InstanceDto, data: SendAudioDto) { logger.verbose('requested sendWhatsAppAudio from ' + instanceName + ' instance'); - logger.verbose( - 'isURL: ' + - isURL(data?.audioMessage?.audio) + - ', isBase64: ' + - isBase64(data?.audioMessage?.audio), - ); + logger.verbose('isURL: ' + isURL(data?.audioMessage?.audio) + ', isBase64: ' + isBase64(data?.audioMessage?.audio)); if (isURL(data.audioMessage.audio) || isBase64(data.audioMessage.audio)) { return await this.waMonitor.waInstances[instanceName].audioWhatsapp(data); } @@ -83,10 +70,7 @@ export class SendMessageController { public async sendButtons({ instanceName }: InstanceDto, data: SendButtonDto) { logger.verbose('requested sendButtons from ' + instanceName + ' instance'); - if ( - isBase64(data.buttonMessage.mediaMessage?.media) && - !data.buttonMessage.mediaMessage?.fileName - ) { + if (isBase64(data.buttonMessage.mediaMessage?.media) && !data.buttonMessage.mediaMessage?.fileName) { throw new BadRequestException('For bse64 the file name must be informed.'); } return await this.waMonitor.waInstances[instanceName].buttonMessage(data); @@ -109,7 +93,7 @@ export class SendMessageController { public async sendReaction({ instanceName }: InstanceDto, data: SendReactionDto) { logger.verbose('requested sendReaction from ' + instanceName + ' instance'); - if (!data.reactionMessage.reaction.match(/[^\(\)\w\sà-ú"-\+]+/)) { + if (!data.reactionMessage.reaction.match(/[^()\w\sà-ú"-+]+/)) { throw new BadRequestException('"reaction" must be an emoji'); } return await this.waMonitor.waInstances[instanceName].reactionMessage(data); diff --git a/src/whatsapp/controllers/settings.controller.ts b/src/whatsapp/controllers/settings.controller.ts new file mode 100644 index 00000000..1a8baafc --- /dev/null +++ b/src/whatsapp/controllers/settings.controller.ts @@ -0,0 +1,24 @@ +// import { isURL } from 'class-validator'; + +import { Logger } from '../../config/logger.config'; +// import { BadRequestException } from '../../exceptions'; +import { InstanceDto } from '../dto/instance.dto'; +import { SettingsDto } from '../dto/settings.dto'; +import { SettingsService } from '../services/settings.service'; + +const logger = new Logger('SettingsController'); + +export class SettingsController { + constructor(private readonly settingsService: SettingsService) {} + + public async createSettings(instance: InstanceDto, data: SettingsDto) { + logger.verbose('requested createSettings from ' + instance.instanceName + ' instance'); + + return this.settingsService.create(instance, data); + } + + public async findSettings(instance: InstanceDto) { + logger.verbose('requested findSettings from ' + instance.instanceName + ' instance'); + return this.settingsService.find(instance); + } +} diff --git a/src/whatsapp/controllers/typebot.controller.ts b/src/whatsapp/controllers/typebot.controller.ts new file mode 100644 index 00000000..53dc967f --- /dev/null +++ b/src/whatsapp/controllers/typebot.controller.ts @@ -0,0 +1,46 @@ +import { Logger } from '../../config/logger.config'; +import { InstanceDto } from '../dto/instance.dto'; +import { TypebotDto } from '../dto/typebot.dto'; +import { TypebotService } from '../services/typebot.service'; + +const logger = new Logger('TypebotController'); + +export class TypebotController { + constructor(private readonly typebotService: TypebotService) {} + + public async createTypebot(instance: InstanceDto, data: TypebotDto) { + logger.verbose('requested createTypebot from ' + instance.instanceName + ' instance'); + + if (!data.enabled) { + logger.verbose('typebot disabled'); + data.url = ''; + data.typebot = ''; + data.expire = 0; + data.sessions = []; + } else { + const saveData = await this.typebotService.find(instance); + + if (saveData.enabled) { + logger.verbose('typebot enabled'); + data.sessions = saveData.sessions; + } + } + + return this.typebotService.create(instance, data); + } + + public async findTypebot(instance: InstanceDto) { + logger.verbose('requested findTypebot from ' + instance.instanceName + ' instance'); + return this.typebotService.find(instance); + } + + public async changeStatus(instance: InstanceDto, data: any) { + logger.verbose('requested changeStatus from ' + instance.instanceName + ' instance'); + return this.typebotService.changeStatus(instance, data); + } + + public async startTypebot(instance: InstanceDto, data: any) { + logger.verbose('requested startTypebot from ' + instance.instanceName + ' instance'); + return this.typebotService.startTypebot(instance, data); + } +} diff --git a/src/whatsapp/controllers/views.controller.ts b/src/whatsapp/controllers/views.controller.ts index 3f54ef39..e775b960 100644 --- a/src/whatsapp/controllers/views.controller.ts +++ b/src/whatsapp/controllers/views.controller.ts @@ -1,26 +1,15 @@ import { Request, Response } from 'express'; -import { Auth, ConfigService } from '../../config/env.config'; -import { BadRequestException } from '../../exceptions'; -import { InstanceDto } from '../dto/instance.dto'; + +import { ConfigService } from '../../config/env.config'; import { HttpStatus } from '../routers/index.router'; import { WAMonitoringService } from '../services/monitor.service'; export class ViewsController { - constructor( - private readonly waMonit: WAMonitoringService, - private readonly configService: ConfigService, - ) {} + constructor(private readonly waMonit: WAMonitoringService, private readonly configService: ConfigService) {} - public async qrcode(request: Request, response: Response) { + public async manager(request: Request, response: Response) { try { - const param = request.params as unknown as InstanceDto; - const instance = this.waMonit.waInstances[param.instanceName]; - if (instance.connectionStatus.state === 'open') { - throw new BadRequestException('The instance is already connected'); - } - const type = this.configService.get('AUTHENTICATION').TYPE; - - return response.status(HttpStatus.OK).render('qrcode', { type, ...param }); + return response.status(HttpStatus.OK).render('manager'); } catch (error) { console.log('ERROR: ', error); } diff --git a/src/whatsapp/controllers/webhook.controller.ts b/src/whatsapp/controllers/webhook.controller.ts index b5747b2e..8201f1b5 100644 --- a/src/whatsapp/controllers/webhook.controller.ts +++ b/src/whatsapp/controllers/webhook.controller.ts @@ -1,9 +1,10 @@ import { isURL } from 'class-validator'; + +import { Logger } from '../../config/logger.config'; import { BadRequestException } from '../../exceptions'; import { InstanceDto } from '../dto/instance.dto'; import { WebhookDto } from '../dto/webhook.dto'; import { WebhookService } from '../services/webhook.service'; -import { Logger } from '../../config/logger.config'; const logger = new Logger('WebhookController'); @@ -13,14 +14,44 @@ export class WebhookController { public async createWebhook(instance: InstanceDto, data: WebhookDto) { logger.verbose('requested createWebhook from ' + instance.instanceName + ' instance'); - if (data.enabled && !isURL(data.url, { require_tld: false })) { + if (!isURL(data.url, { require_tld: false })) { throw new BadRequestException('Invalid "url" property'); } + data.enabled = data.enabled ?? true; + if (!data.enabled) { logger.verbose('webhook disabled'); data.url = ''; data.events = []; + } else if (data.events.length === 0) { + logger.verbose('webhook events empty'); + data.events = [ + 'APPLICATION_STARTUP', + 'QRCODE_UPDATED', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'SEND_MESSAGE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'PRESENCE_UPDATE', + 'CHATS_SET', + 'CHATS_UPSERT', + 'CHATS_UPDATE', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUP_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CONNECTION_UPDATE', + 'CALL', + 'NEW_JWT_TOKEN', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'CHAMA_AI_ACTION', + ]; } return this.webhookService.create(instance, data); diff --git a/src/whatsapp/controllers/websocket.controller.ts b/src/whatsapp/controllers/websocket.controller.ts new file mode 100644 index 00000000..5771027a --- /dev/null +++ b/src/whatsapp/controllers/websocket.controller.ts @@ -0,0 +1,56 @@ +import { Logger } from '../../config/logger.config'; +import { InstanceDto } from '../dto/instance.dto'; +import { WebsocketDto } from '../dto/websocket.dto'; +import { WebsocketService } from '../services/websocket.service'; + +const logger = new Logger('WebsocketController'); + +export class WebsocketController { + constructor(private readonly websocketService: WebsocketService) {} + + public async createWebsocket(instance: InstanceDto, data: WebsocketDto) { + logger.verbose('requested createWebsocket from ' + instance.instanceName + ' instance'); + + if (!data.enabled) { + logger.verbose('websocket disabled'); + data.events = []; + } + + if (data.events.length === 0) { + logger.verbose('websocket events empty'); + data.events = [ + 'APPLICATION_STARTUP', + 'QRCODE_UPDATED', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'SEND_MESSAGE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'PRESENCE_UPDATE', + 'CHATS_SET', + 'CHATS_UPSERT', + 'CHATS_UPDATE', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUP_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CONNECTION_UPDATE', + 'CALL', + 'NEW_JWT_TOKEN', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'CHAMA_AI_ACTION', + ]; + } + + return this.websocketService.create(instance, data); + } + + public async findWebsocket(instance: InstanceDto) { + logger.verbose('requested findWebsocket from ' + instance.instanceName + ' instance'); + return this.websocketService.find(instance); + } +} diff --git a/src/whatsapp/dto/chamaai.dto.ts b/src/whatsapp/dto/chamaai.dto.ts new file mode 100644 index 00000000..2c71a07d --- /dev/null +++ b/src/whatsapp/dto/chamaai.dto.ts @@ -0,0 +1,7 @@ +export class ChamaaiDto { + enabled: boolean; + url: string; + token: string; + waNumber: string; + answerByAudio: boolean; +} diff --git a/src/whatsapp/dto/chat.dto.ts b/src/whatsapp/dto/chat.dto.ts index 5af66a5e..f8a5da5f 100644 --- a/src/whatsapp/dto/chat.dto.ts +++ b/src/whatsapp/dto/chat.dto.ts @@ -1,16 +1,7 @@ -import { - WAPrivacyOnlineValue, - WAPrivacyValue, - WAReadReceiptsValue, - proto, -} from '@whiskeysockets/baileys'; +import { proto, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '@whiskeysockets/baileys'; export class OnWhatsAppDto { - constructor( - public readonly jid: string, - public readonly exists: boolean, - public readonly name?: string, - ) {} + constructor(public readonly jid: string, public readonly exists: boolean, public readonly name?: string) {} } export class getBase64FromMediaMessageDto { @@ -59,16 +50,17 @@ class Key { remoteJid: string; } export class ReadMessageDto { - readMessages: Key[]; + read_messages: Key[]; } -class LastMessage { +export class LastMessage { key: Key; messageTimestamp?: number; } export class ArchiveChatDto { - lastMessage: LastMessage; + lastMessage?: LastMessage; + chat?: string; archive: boolean; } diff --git a/src/whatsapp/dto/chatwoot.dto.ts b/src/whatsapp/dto/chatwoot.dto.ts index e78b0676..b270c869 100644 --- a/src/whatsapp/dto/chatwoot.dto.ts +++ b/src/whatsapp/dto/chatwoot.dto.ts @@ -5,4 +5,7 @@ export class ChatwootDto { url?: string; name_inbox?: string; sign_msg?: boolean; + number?: string; + reopen_conversation?: boolean; + conversation_pending?: boolean; } diff --git a/src/whatsapp/dto/group.dto.ts b/src/whatsapp/dto/group.dto.ts index bc36e27f..6dfdc45c 100644 --- a/src/whatsapp/dto/group.dto.ts +++ b/src/whatsapp/dto/group.dto.ts @@ -1,7 +1,8 @@ export class CreateGroupDto { subject: string; - description?: string; participants: string[]; + description?: string; + promoteParticipants?: boolean; } export class GroupPictureDto { diff --git a/src/whatsapp/dto/instance.dto.ts b/src/whatsapp/dto/instance.dto.ts index ce282e03..7807d1a5 100644 --- a/src/whatsapp/dto/instance.dto.ts +++ b/src/whatsapp/dto/instance.dto.ts @@ -1,12 +1,34 @@ export class InstanceDto { instanceName: string; + qrcode?: boolean; + number?: string; + token?: string; webhook?: string; webhook_by_events?: boolean; events?: string[]; - qrcode?: boolean; - token?: string; + reject_call?: boolean; + msg_call?: string; + groups_ignore?: boolean; + always_online?: boolean; + read_messages?: boolean; + read_status?: boolean; chatwoot_account_id?: string; chatwoot_token?: string; chatwoot_url?: string; chatwoot_sign_msg?: boolean; + chatwoot_reopen_conversation?: boolean; + chatwoot_conversation_pending?: boolean; + websocket_enabled?: boolean; + websocket_events?: string[]; + rabbitmq_enabled?: boolean; + rabbitmq_events?: string[]; + typebot_url?: string; + typebot?: string; + typebot_expire?: number; + typebot_keyword_finish?: string; + typebot_delay_message?: number; + typebot_unknown_message?: string; + typebot_listening_from_me?: boolean; + proxy_enabled?: boolean; + proxy_proxy?: string; } diff --git a/src/whatsapp/dto/proxy.dto.ts b/src/whatsapp/dto/proxy.dto.ts new file mode 100644 index 00000000..0b6b2e70 --- /dev/null +++ b/src/whatsapp/dto/proxy.dto.ts @@ -0,0 +1,4 @@ +export class ProxyDto { + enabled: boolean; + proxy: string; +} diff --git a/src/whatsapp/dto/rabbitmq.dto.ts b/src/whatsapp/dto/rabbitmq.dto.ts new file mode 100644 index 00000000..9bfd5b42 --- /dev/null +++ b/src/whatsapp/dto/rabbitmq.dto.ts @@ -0,0 +1,4 @@ +export class RabbitmqDto { + enabled: boolean; + events?: string[]; +} diff --git a/src/whatsapp/dto/sendMessage.dto.ts b/src/whatsapp/dto/sendMessage.dto.ts index 51a55cec..c2ddb3a2 100644 --- a/src/whatsapp/dto/sendMessage.dto.ts +++ b/src/whatsapp/dto/sendMessage.dto.ts @@ -15,6 +15,8 @@ export class Options { presence?: WAPresence; quoted?: Quoted; mentions?: Mentions; + linkPreview?: boolean; + encoding?: boolean; } class OptionsMessage { options: Options; diff --git a/src/whatsapp/dto/settings.dto.ts b/src/whatsapp/dto/settings.dto.ts new file mode 100644 index 00000000..594ab3a4 --- /dev/null +++ b/src/whatsapp/dto/settings.dto.ts @@ -0,0 +1,8 @@ +export class SettingsDto { + reject_call?: boolean; + msg_call?: string; + groups_ignore?: boolean; + always_online?: boolean; + read_messages?: boolean; + read_status?: boolean; +} diff --git a/src/whatsapp/dto/typebot.dto.ts b/src/whatsapp/dto/typebot.dto.ts new file mode 100644 index 00000000..6e9c6111 --- /dev/null +++ b/src/whatsapp/dto/typebot.dto.ts @@ -0,0 +1,19 @@ +export class Session { + remoteJid?: string; + sessionId?: string; + status?: string; + createdAt?: number; + updateAt?: number; +} + +export class TypebotDto { + enabled?: boolean; + url: string; + typebot?: string; + expire?: number; + keyword_finish?: string; + delay_message?: number; + unknown_message?: string; + listening_from_me?: boolean; + sessions?: Session[]; +} diff --git a/src/whatsapp/dto/websocket.dto.ts b/src/whatsapp/dto/websocket.dto.ts new file mode 100644 index 00000000..27f6d785 --- /dev/null +++ b/src/whatsapp/dto/websocket.dto.ts @@ -0,0 +1,4 @@ +export class WebsocketDto { + enabled: boolean; + events?: string[]; +} diff --git a/src/whatsapp/guards/auth.guard.ts b/src/whatsapp/guards/auth.guard.ts index 8607cab4..a72ebfff 100644 --- a/src/whatsapp/guards/auth.guard.ts +++ b/src/whatsapp/guards/auth.guard.ts @@ -1,12 +1,13 @@ import { isJWT } from 'class-validator'; import { NextFunction, Request, Response } from 'express'; import jwt from 'jsonwebtoken'; + +import { name } from '../../../package.json'; import { Auth, configService } from '../../config/env.config'; import { Logger } from '../../config/logger.config'; -import { name } from '../../../package.json'; +import { ForbiddenException, UnauthorizedException } from '../../exceptions'; import { InstanceDto } from '../dto/instance.dto'; import { JwtPayload } from '../services/auth.service'; -import { ForbiddenException, UnauthorizedException } from '../../exceptions'; import { repository } from '../whatsapp.module'; const logger = new Logger('GUARD'); @@ -22,15 +23,8 @@ async function jwtGuard(req: Request, res: Response, next: NextFunction) { return next(); } - if ( - (req.originalUrl.includes('/instance/create') || - req.originalUrl.includes('/instance/fetchInstances')) && - !key - ) { - throw new ForbiddenException( - 'Missing global api key', - 'The global api key must be set', - ); + if ((req.originalUrl.includes('/instance/create') || req.originalUrl.includes('/instance/fetchInstances')) && !key) { + throw new ForbiddenException('Missing global api key', 'The global api key must be set'); } const jwtOpts = configService.get('AUTHENTICATION').JWT; @@ -61,7 +55,7 @@ async function jwtGuard(req: Request, res: Response, next: NextFunction) { } } -async function apikey(req: Request, res: Response, next: NextFunction) { +async function apikey(req: Request, _: Response, next: NextFunction) { const env = configService.get('AUTHENTICATION').API_KEY; const key = req.get('apikey'); @@ -69,15 +63,8 @@ async function apikey(req: Request, res: Response, next: NextFunction) { return next(); } - if ( - (req.originalUrl.includes('/instance/create') || - req.originalUrl.includes('/instance/fetchInstances')) && - !key - ) { - throw new ForbiddenException( - 'Missing global api key', - 'The global api key must be set', - ); + if ((req.originalUrl.includes('/instance/create') || req.originalUrl.includes('/instance/fetchInstances')) && !key) { + throw new ForbiddenException('Missing global api key', 'The global api key must be set'); } try { @@ -86,7 +73,9 @@ async function apikey(req: Request, res: Response, next: NextFunction) { if (instanceKey.apikey === key) { return next(); } - } catch (error) {} + } catch (error) { + logger.error(error); + } throw new UnauthorizedException(); } diff --git a/src/whatsapp/guards/instance.guard.ts b/src/whatsapp/guards/instance.guard.ts index 1e79ff1d..e5b7ebe0 100644 --- a/src/whatsapp/guards/instance.guard.ts +++ b/src/whatsapp/guards/instance.guard.ts @@ -1,44 +1,47 @@ import { NextFunction, Request, Response } from 'express'; import { existsSync } from 'fs'; import { join } from 'path'; + +import { configService, Database, Redis } from '../../config/env.config'; import { INSTANCE_DIR } from '../../config/path.config'; -import { dbserver } from '../../db/db.connect'; import { BadRequestException, ForbiddenException, + InternalServerErrorException, NotFoundException, } from '../../exceptions'; +import { dbserver } from '../../libs/db.connect'; import { InstanceDto } from '../dto/instance.dto'; import { cache, waMonitor } from '../whatsapp.module'; -import { Database, Redis, configService } from '../../config/env.config'; async function getInstance(instanceName: string) { - const db = configService.get('DATABASE'); - const redisConf = configService.get('REDIS'); + try { + const db = configService.get('DATABASE'); + const redisConf = configService.get('REDIS'); - const exists = !!waMonitor.waInstances[instanceName]; + const exists = !!waMonitor.waInstances[instanceName]; - if (redisConf.ENABLED) { - const keyExists = await cache.keyExists(); - return exists || keyExists; + if (redisConf.ENABLED) { + const keyExists = await cache.keyExists(); + return exists || keyExists; + } + + if (db.ENABLED) { + const collection = dbserver + .getClient() + .db(db.CONNECTION.DB_PREFIX_NAME + '-instances') + .collection(instanceName); + return exists || (await collection.find({}).toArray()).length > 0; + } + + return exists || existsSync(join(INSTANCE_DIR, instanceName)); + } catch (error) { + throw new InternalServerErrorException(error?.toString()); } - - if (db.ENABLED) { - const collection = dbserver - .getClient() - .db(db.CONNECTION.DB_PREFIX_NAME + '-instances') - .collection(instanceName); - return exists || (await collection.find({}).toArray()).length > 0; - } - - return exists || existsSync(join(INSTANCE_DIR, instanceName)); } export async function instanceExistsGuard(req: Request, _: Response, next: NextFunction) { - if ( - req.originalUrl.includes('/instance/create') || - req.originalUrl.includes('/instance/fetchInstances') - ) { + if (req.originalUrl.includes('/instance/create') || req.originalUrl.includes('/instance/fetchInstances')) { return next(); } @@ -58,9 +61,7 @@ export async function instanceLoggedGuard(req: Request, _: Response, next: NextF if (req.originalUrl.includes('/instance/create')) { const instance = req.body as InstanceDto; if (await getInstance(instance.instanceName)) { - throw new ForbiddenException( - `This name "${instance.instanceName}" is already in use.`, - ); + throw new ForbiddenException(`This name "${instance.instanceName}" is already in use.`); } if (waMonitor.waInstances[instance.instanceName]) { diff --git a/src/whatsapp/models/auth.model.ts b/src/whatsapp/models/auth.model.ts index b5da800d..0f7d5ec3 100644 --- a/src/whatsapp/models/auth.model.ts +++ b/src/whatsapp/models/auth.model.ts @@ -1,5 +1,6 @@ import { Schema } from 'mongoose'; -import { dbserver } from '../../db/db.connect'; + +import { dbserver } from '../../libs/db.connect'; export class AuthRaw { _id?: string; diff --git a/src/whatsapp/models/chamaai.model.ts b/src/whatsapp/models/chamaai.model.ts new file mode 100644 index 00000000..d3d10aff --- /dev/null +++ b/src/whatsapp/models/chamaai.model.ts @@ -0,0 +1,24 @@ +import { Schema } from 'mongoose'; + +import { dbserver } from '../../libs/db.connect'; + +export class ChamaaiRaw { + _id?: string; + enabled?: boolean; + url?: string; + token?: string; + waNumber?: string; + answerByAudio?: boolean; +} + +const chamaaiSchema = new Schema({ + _id: { type: String, _id: true }, + enabled: { type: Boolean, required: true }, + url: { type: String, required: true }, + token: { type: String, required: true }, + waNumber: { type: String, required: true }, + answerByAudio: { type: Boolean, required: true }, +}); + +export const ChamaaiModel = dbserver?.model(ChamaaiRaw.name, chamaaiSchema, 'chamaai'); +export type IChamaaiModel = typeof ChamaaiModel; diff --git a/src/whatsapp/models/chat.model.ts b/src/whatsapp/models/chat.model.ts index ebf7f217..053d100e 100644 --- a/src/whatsapp/models/chat.model.ts +++ b/src/whatsapp/models/chat.model.ts @@ -1,5 +1,6 @@ import { Schema } from 'mongoose'; -import { dbserver } from '../../db/db.connect'; + +import { dbserver } from '../../libs/db.connect'; export class ChatRaw { _id?: string; diff --git a/src/whatsapp/models/chatwoot.model.ts b/src/whatsapp/models/chatwoot.model.ts index ca082309..18d6b6f0 100644 --- a/src/whatsapp/models/chatwoot.model.ts +++ b/src/whatsapp/models/chatwoot.model.ts @@ -1,5 +1,6 @@ import { Schema } from 'mongoose'; -import { dbserver } from '../../db/db.connect'; + +import { dbserver } from '../../libs/db.connect'; export class ChatwootRaw { _id?: string; @@ -9,6 +10,9 @@ export class ChatwootRaw { url?: string; name_inbox?: string; sign_msg?: boolean; + number?: string; + reopen_conversation?: boolean; + conversation_pending?: boolean; } const chatwootSchema = new Schema({ @@ -19,11 +23,8 @@ const chatwootSchema = new Schema({ url: { type: String, required: true }, name_inbox: { type: String, required: true }, sign_msg: { type: Boolean, required: true }, + number: { type: String, required: true }, }); -export const ChatwootModel = dbserver?.model( - ChatwootRaw.name, - chatwootSchema, - 'chatwoot', -); +export const ChatwootModel = dbserver?.model(ChatwootRaw.name, chatwootSchema, 'chatwoot'); export type IChatwootModel = typeof ChatwootModel; diff --git a/src/whatsapp/models/contact.model.ts b/src/whatsapp/models/contact.model.ts index c15411fa..f5936b61 100644 --- a/src/whatsapp/models/contact.model.ts +++ b/src/whatsapp/models/contact.model.ts @@ -1,5 +1,6 @@ import { Schema } from 'mongoose'; -import { dbserver } from '../../db/db.connect'; + +import { dbserver } from '../../libs/db.connect'; export class ContactRaw { _id?: string; diff --git a/src/whatsapp/models/index.ts b/src/whatsapp/models/index.ts index e0b773f0..e79093f9 100644 --- a/src/whatsapp/models/index.ts +++ b/src/whatsapp/models/index.ts @@ -1,6 +1,12 @@ +export * from './auth.model'; +export * from './chamaai.model'; export * from './chat.model'; +export * from './chatwoot.model'; export * from './contact.model'; export * from './message.model'; -export * from './auth.model'; +export * from './proxy.model'; +export * from './rabbitmq.model'; +export * from './settings.model'; +export * from './typebot.model'; export * from './webhook.model'; -export * from './chatwoot.model'; +export * from './websocket.model'; diff --git a/src/whatsapp/models/message.model.ts b/src/whatsapp/models/message.model.ts index 4a684e53..a5790be7 100644 --- a/src/whatsapp/models/message.model.ts +++ b/src/whatsapp/models/message.model.ts @@ -1,5 +1,6 @@ import { Schema } from 'mongoose'; -import { dbserver } from '../../db/db.connect'; + +import { dbserver } from '../../libs/db.connect'; import { wa } from '../types/wa.types'; class Key { @@ -64,9 +65,5 @@ const messageUpdateSchema = new Schema({ owner: { type: String, required: true, min: 1 }, }); -export const MessageUpModel = dbserver?.model( - MessageUpdateRaw.name, - messageUpdateSchema, - 'messageUpdate', -); +export const MessageUpModel = dbserver?.model(MessageUpdateRaw.name, messageUpdateSchema, 'messageUpdate'); export type IMessageUpModel = typeof MessageUpModel; diff --git a/src/whatsapp/models/proxy.model.ts b/src/whatsapp/models/proxy.model.ts new file mode 100644 index 00000000..3dea4f0c --- /dev/null +++ b/src/whatsapp/models/proxy.model.ts @@ -0,0 +1,18 @@ +import { Schema } from 'mongoose'; + +import { dbserver } from '../../libs/db.connect'; + +export class ProxyRaw { + _id?: string; + enabled?: boolean; + proxy?: string; +} + +const proxySchema = new Schema({ + _id: { type: String, _id: true }, + enabled: { type: Boolean, required: true }, + proxy: { type: String, required: true }, +}); + +export const ProxyModel = dbserver?.model(ProxyRaw.name, proxySchema, 'proxy'); +export type IProxyModel = typeof ProxyModel; diff --git a/src/whatsapp/models/rabbitmq.model.ts b/src/whatsapp/models/rabbitmq.model.ts new file mode 100644 index 00000000..e89ee3b1 --- /dev/null +++ b/src/whatsapp/models/rabbitmq.model.ts @@ -0,0 +1,18 @@ +import { Schema } from 'mongoose'; + +import { dbserver } from '../../libs/db.connect'; + +export class RabbitmqRaw { + _id?: string; + enabled?: boolean; + events?: string[]; +} + +const rabbitmqSchema = new Schema({ + _id: { type: String, _id: true }, + enabled: { type: Boolean, required: true }, + events: { type: [String], required: true }, +}); + +export const RabbitmqModel = dbserver?.model(RabbitmqRaw.name, rabbitmqSchema, 'rabbitmq'); +export type IRabbitmqModel = typeof RabbitmqModel; diff --git a/src/whatsapp/models/settings.model.ts b/src/whatsapp/models/settings.model.ts new file mode 100644 index 00000000..48593fbe --- /dev/null +++ b/src/whatsapp/models/settings.model.ts @@ -0,0 +1,26 @@ +import { Schema } from 'mongoose'; + +import { dbserver } from '../../libs/db.connect'; + +export class SettingsRaw { + _id?: string; + reject_call?: boolean; + msg_call?: string; + groups_ignore?: boolean; + always_online?: boolean; + read_messages?: boolean; + read_status?: boolean; +} + +const settingsSchema = new Schema({ + _id: { type: String, _id: true }, + reject_call: { type: Boolean, required: true }, + msg_call: { type: String, required: true }, + groups_ignore: { type: Boolean, required: true }, + always_online: { type: Boolean, required: true }, + read_messages: { type: Boolean, required: true }, + read_status: { type: Boolean, required: true }, +}); + +export const SettingsModel = dbserver?.model(SettingsRaw.name, settingsSchema, 'settings'); +export type ISettingsModel = typeof SettingsModel; diff --git a/src/whatsapp/models/typebot.model.ts b/src/whatsapp/models/typebot.model.ts new file mode 100644 index 00000000..28135ebd --- /dev/null +++ b/src/whatsapp/models/typebot.model.ts @@ -0,0 +1,48 @@ +import { Schema } from 'mongoose'; + +import { dbserver } from '../../libs/db.connect'; + +class Session { + remoteJid?: string; + sessionId?: string; + status?: string; + createdAt?: number; + updateAt?: number; +} + +export class TypebotRaw { + _id?: string; + enabled?: boolean; + url: string; + typebot?: string; + expire?: number; + keyword_finish?: string; + delay_message?: number; + unknown_message?: string; + listening_from_me?: boolean; + sessions?: Session[]; +} + +const typebotSchema = new Schema({ + _id: { type: String, _id: true }, + enabled: { type: Boolean, required: true }, + url: { type: String, required: true }, + typebot: { type: String, required: true }, + expire: { type: Number, required: true }, + keyword_finish: { type: String, required: true }, + delay_message: { type: Number, required: true }, + unknown_message: { type: String, required: true }, + listening_from_me: { type: Boolean, required: true }, + sessions: [ + { + remoteJid: { type: String, required: true }, + sessionId: { type: String, required: true }, + status: { type: String, required: true }, + createdAt: { type: Number, required: true }, + updateAt: { type: Number, required: true }, + }, + ], +}); + +export const TypebotModel = dbserver?.model(TypebotRaw.name, typebotSchema, 'typebot'); +export type ITypebotModel = typeof TypebotModel; diff --git a/src/whatsapp/models/webhook.model.ts b/src/whatsapp/models/webhook.model.ts index 62ee38f4..05a222e0 100644 --- a/src/whatsapp/models/webhook.model.ts +++ b/src/whatsapp/models/webhook.model.ts @@ -1,5 +1,6 @@ import { Schema } from 'mongoose'; -import { dbserver } from '../../db/db.connect'; + +import { dbserver } from '../../libs/db.connect'; export class WebhookRaw { _id?: string; diff --git a/src/whatsapp/models/websocket.model.ts b/src/whatsapp/models/websocket.model.ts new file mode 100644 index 00000000..e96332b1 --- /dev/null +++ b/src/whatsapp/models/websocket.model.ts @@ -0,0 +1,18 @@ +import { Schema } from 'mongoose'; + +import { dbserver } from '../../libs/db.connect'; + +export class WebsocketRaw { + _id?: string; + enabled?: boolean; + events?: string[]; +} + +const websocketSchema = new Schema({ + _id: { type: String, _id: true }, + enabled: { type: Boolean, required: true }, + events: { type: [String], required: true }, +}); + +export const WebsocketModel = dbserver?.model(WebsocketRaw.name, websocketSchema, 'websocket'); +export type IWebsocketModel = typeof WebsocketModel; diff --git a/src/whatsapp/repository/auth.repository.ts b/src/whatsapp/repository/auth.repository.ts index c795737c..4da8980b 100644 --- a/src/whatsapp/repository/auth.repository.ts +++ b/src/whatsapp/repository/auth.repository.ts @@ -1,16 +1,14 @@ -import { join } from 'path'; -import { Auth, ConfigService } from '../../config/env.config'; -import { IInsert, Repository } from '../abstract/abstract.repository'; -import { IAuthModel, AuthRaw } from '../models'; import { readFileSync } from 'fs'; -import { AUTH_DIR } from '../../config/path.config'; +import { join } from 'path'; + +import { Auth, ConfigService } from '../../config/env.config'; import { Logger } from '../../config/logger.config'; +import { AUTH_DIR } from '../../config/path.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { AuthRaw, IAuthModel } from '../models'; export class AuthRepository extends Repository { - constructor( - private readonly authModel: IAuthModel, - readonly configService: ConfigService, - ) { + constructor(private readonly authModel: IAuthModel, readonly configService: ConfigService) { super(configService); this.auth = configService.get('AUTHENTICATION'); } @@ -23,11 +21,7 @@ export class AuthRepository extends Repository { this.logger.verbose('creating auth'); if (this.dbSettings.ENABLED) { this.logger.verbose('saving auth to db'); - const insert = await this.authModel.replaceOne( - { _id: instance }, - { ...data }, - { upsert: true }, - ); + const insert = await this.authModel.replaceOne({ _id: instance }, { ...data }, { upsert: true }); this.logger.verbose('auth saved to db: ' + insert.modifiedCount + ' auth'); return { insertCount: insert.modifiedCount }; @@ -40,9 +34,7 @@ export class AuthRepository extends Repository { fileName: instance, data, }); - this.logger.verbose( - 'auth saved to store in path: ' + join(AUTH_DIR, this.auth.TYPE) + '/' + instance, - ); + this.logger.verbose('auth saved to store in path: ' + join(AUTH_DIR, this.auth.TYPE) + '/' + instance); this.logger.verbose('auth created'); return { insertCount: 1 }; diff --git a/src/whatsapp/repository/chamaai.repository.ts b/src/whatsapp/repository/chamaai.repository.ts new file mode 100644 index 00000000..a2009f41 --- /dev/null +++ b/src/whatsapp/repository/chamaai.repository.ts @@ -0,0 +1,62 @@ +import { readFileSync } from 'fs'; +import { join } from 'path'; + +import { ConfigService } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { ChamaaiRaw, IChamaaiModel } from '../models'; + +export class ChamaaiRepository extends Repository { + constructor(private readonly chamaaiModel: IChamaaiModel, private readonly configService: ConfigService) { + super(configService); + } + + private readonly logger = new Logger('ChamaaiRepository'); + + public async create(data: ChamaaiRaw, instance: string): Promise { + try { + this.logger.verbose('creating chamaai'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('saving chamaai to db'); + const insert = await this.chamaaiModel.replaceOne({ _id: instance }, { ...data }, { upsert: true }); + + this.logger.verbose('chamaai saved to db: ' + insert.modifiedCount + ' chamaai'); + return { insertCount: insert.modifiedCount }; + } + + this.logger.verbose('saving chamaai to store'); + + this.writeStore({ + path: join(this.storePath, 'chamaai'), + fileName: instance, + data, + }); + + this.logger.verbose('chamaai saved to store in path: ' + join(this.storePath, 'chamaai') + '/' + instance); + + this.logger.verbose('chamaai created'); + return { insertCount: 1 }; + } catch (error) { + return error; + } + } + + public async find(instance: string): Promise { + try { + this.logger.verbose('finding chamaai'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('finding chamaai in db'); + return await this.chamaaiModel.findOne({ _id: instance }); + } + + this.logger.verbose('finding chamaai in store'); + return JSON.parse( + readFileSync(join(this.storePath, 'chamaai', instance + '.json'), { + encoding: 'utf-8', + }), + ) as ChamaaiRaw; + } catch (error) { + return {}; + } + } +} diff --git a/src/whatsapp/repository/chat.repository.ts b/src/whatsapp/repository/chat.repository.ts index 0f05760c..68d653a4 100644 --- a/src/whatsapp/repository/chat.repository.ts +++ b/src/whatsapp/repository/chat.repository.ts @@ -1,29 +1,23 @@ -import { join } from 'path'; -import { ConfigService, StoreConf } from '../../config/env.config'; -import { IInsert, Repository } from '../abstract/abstract.repository'; import { opendirSync, readFileSync, rmSync } from 'fs'; -import { ChatRaw, IChatModel } from '../models'; +import { join } from 'path'; + +import { ConfigService, StoreConf } from '../../config/env.config'; import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { ChatRaw, IChatModel } from '../models'; export class ChatQuery { where: ChatRaw; } export class ChatRepository extends Repository { - constructor( - private readonly chatModel: IChatModel, - private readonly configService: ConfigService, - ) { + constructor(private readonly chatModel: IChatModel, private readonly configService: ConfigService) { super(configService); } private readonly logger = new Logger('ChatRepository'); - public async insert( - data: ChatRaw[], - instanceName: string, - saveDb = false, - ): Promise { + public async insert(data: ChatRaw[], instanceName: string, saveDb = false): Promise { this.logger.verbose('inserting chats'); if (data.length === 0) { this.logger.verbose('no chats to insert'); @@ -53,10 +47,7 @@ export class ChatRepository extends Repository { data: chat, }); this.logger.verbose( - 'chats saved to store in path: ' + - join(this.storePath, 'chats', instanceName) + - '/' + - chat.id, + 'chats saved to store in path: ' + join(this.storePath, 'chats', instanceName) + '/' + chat.id, ); }); @@ -89,10 +80,9 @@ export class ChatRepository extends Repository { if (dirent.isFile()) { chats.push( JSON.parse( - readFileSync( - join(this.storePath, 'chats', query.where.owner, dirent.name), - { encoding: 'utf-8' }, - ), + readFileSync(join(this.storePath, 'chats', query.where.owner, dirent.name), { + encoding: 'utf-8', + }), ), ); } diff --git a/src/whatsapp/repository/chatwoot.repository.ts b/src/whatsapp/repository/chatwoot.repository.ts index 3d24022a..47398d68 100644 --- a/src/whatsapp/repository/chatwoot.repository.ts +++ b/src/whatsapp/repository/chatwoot.repository.ts @@ -1,15 +1,13 @@ -import { IInsert, Repository } from '../abstract/abstract.repository'; -import { ConfigService } from '../../config/env.config'; -import { join } from 'path'; import { readFileSync } from 'fs'; -import { IChatwootModel, ChatwootRaw } from '../models'; +import { join } from 'path'; + +import { ConfigService } from '../../config/env.config'; import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { ChatwootRaw, IChatwootModel } from '../models'; export class ChatwootRepository extends Repository { - constructor( - private readonly chatwootModel: IChatwootModel, - private readonly configService: ConfigService, - ) { + constructor(private readonly chatwootModel: IChatwootModel, private readonly configService: ConfigService) { super(configService); } @@ -20,15 +18,9 @@ export class ChatwootRepository extends Repository { this.logger.verbose('creating chatwoot'); if (this.dbSettings.ENABLED) { this.logger.verbose('saving chatwoot to db'); - const insert = await this.chatwootModel.replaceOne( - { _id: instance }, - { ...data }, - { upsert: true }, - ); + const insert = await this.chatwootModel.replaceOne({ _id: instance }, { ...data }, { upsert: true }); - this.logger.verbose( - 'chatwoot saved to db: ' + insert.modifiedCount + ' chatwoot', - ); + this.logger.verbose('chatwoot saved to db: ' + insert.modifiedCount + ' chatwoot'); return { insertCount: insert.modifiedCount }; } @@ -40,12 +32,7 @@ export class ChatwootRepository extends Repository { data, }); - this.logger.verbose( - 'chatwoot saved to store in path: ' + - join(this.storePath, 'chatwoot') + - '/' + - instance, - ); + this.logger.verbose('chatwoot saved to store in path: ' + join(this.storePath, 'chatwoot') + '/' + instance); this.logger.verbose('chatwoot created'); return { insertCount: 1 }; diff --git a/src/whatsapp/repository/contact.repository.ts b/src/whatsapp/repository/contact.repository.ts index 648b5bf4..03851607 100644 --- a/src/whatsapp/repository/contact.repository.ts +++ b/src/whatsapp/repository/contact.repository.ts @@ -1,29 +1,23 @@ import { opendirSync, readFileSync } from 'fs'; import { join } from 'path'; + import { ConfigService, StoreConf } from '../../config/env.config'; -import { ContactRaw, IContactModel } from '../models'; -import { IInsert, Repository } from '../abstract/abstract.repository'; import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { ContactRaw, IContactModel } from '../models'; export class ContactQuery { where: ContactRaw; } export class ContactRepository extends Repository { - constructor( - private readonly contactModel: IContactModel, - private readonly configService: ConfigService, - ) { + constructor(private readonly contactModel: IContactModel, private readonly configService: ConfigService) { super(configService); } private readonly logger = new Logger('ContactRepository'); - public async insert( - data: ContactRaw[], - instanceName: string, - saveDb = false, - ): Promise { + public async insert(data: ContactRaw[], instanceName: string, saveDb = false): Promise { this.logger.verbose('inserting contacts'); if (data.length === 0) { @@ -54,10 +48,7 @@ export class ContactRepository extends Repository { data: contact, }); this.logger.verbose( - 'contacts saved to store in path: ' + - join(this.storePath, 'contacts', instanceName) + - '/' + - contact.id, + 'contacts saved to store in path: ' + join(this.storePath, 'contacts', instanceName) + '/' + contact.id, ); }); @@ -74,11 +65,7 @@ export class ContactRepository extends Repository { } } - public async update( - data: ContactRaw[], - instanceName: string, - saveDb = false, - ): Promise { + public async update(data: ContactRaw[], instanceName: string, saveDb = false): Promise { try { this.logger.verbose('updating contacts'); @@ -119,10 +106,7 @@ export class ContactRepository extends Repository { data: contact, }); this.logger.verbose( - 'contacts updated in store in path: ' + - join(this.storePath, 'contacts', instanceName) + - '/' + - contact.id, + 'contacts updated in store in path: ' + join(this.storePath, 'contacts', instanceName) + '/' + contact.id, ); }); @@ -154,15 +138,9 @@ export class ContactRepository extends Repository { this.logger.verbose('finding contacts in store by id'); contacts.push( JSON.parse( - readFileSync( - join( - this.storePath, - 'contacts', - query.where.owner, - query.where.id + '.json', - ), - { encoding: 'utf-8' }, - ), + readFileSync(join(this.storePath, 'contacts', query.where.owner, query.where.id + '.json'), { + encoding: 'utf-8', + }), ), ); } else { @@ -175,10 +153,9 @@ export class ContactRepository extends Repository { if (dirent.isFile()) { contacts.push( JSON.parse( - readFileSync( - join(this.storePath, 'contacts', query.where.owner, dirent.name), - { encoding: 'utf-8' }, - ), + readFileSync(join(this.storePath, 'contacts', query.where.owner, dirent.name), { + encoding: 'utf-8', + }), ), ); } diff --git a/src/whatsapp/repository/message.repository.ts b/src/whatsapp/repository/message.repository.ts index dbfe01fc..ed362815 100644 --- a/src/whatsapp/repository/message.repository.ts +++ b/src/whatsapp/repository/message.repository.ts @@ -1,9 +1,10 @@ -import { ConfigService, StoreConf } from '../../config/env.config'; -import { join } from 'path'; -import { IMessageModel, MessageRaw } from '../models'; -import { IInsert, Repository } from '../abstract/abstract.repository'; import { opendirSync, readFileSync } from 'fs'; +import { join } from 'path'; + +import { ConfigService, StoreConf } from '../../config/env.config'; import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { IMessageModel, MessageRaw } from '../models'; export class MessageQuery { where: MessageRaw; @@ -11,20 +12,13 @@ export class MessageQuery { } export class MessageRepository extends Repository { - constructor( - private readonly messageModel: IMessageModel, - private readonly configService: ConfigService, - ) { + constructor(private readonly messageModel: IMessageModel, private readonly configService: ConfigService) { super(configService); } private readonly logger = new Logger('MessageRepository'); - public async insert( - data: MessageRaw[], - instanceName: string, - saveDb = false, - ): Promise { + public async insert(data: MessageRaw[], instanceName: string, saveDb = false): Promise { this.logger.verbose('inserting messages'); if (!Array.isArray(data) || data.length === 0) { @@ -74,10 +68,7 @@ export class MessageRepository extends Repository { data: message, }); this.logger.verbose( - 'messages saved to store in path: ' + - join(this.storePath, 'messages', instanceName) + - '/' + - message.key.id, + 'messages saved to store in path: ' + join(this.storePath, 'messages', instanceName) + '/' + message.key.id, ); }); @@ -119,15 +110,9 @@ export class MessageRepository extends Repository { this.logger.verbose('finding messages in store by id'); messages.push( JSON.parse( - readFileSync( - join( - this.storePath, - 'messages', - query.where.owner, - query.where.key.id + '.json', - ), - { encoding: 'utf-8' }, - ), + readFileSync(join(this.storePath, 'messages', query.where.owner, query.where.key.id + '.json'), { + encoding: 'utf-8', + }), ), ); } else { @@ -140,10 +125,9 @@ export class MessageRepository extends Repository { if (dirent.isFile()) { messages.push( JSON.parse( - readFileSync( - join(this.storePath, 'messages', query.where.owner, dirent.name), - { encoding: 'utf-8' }, - ), + readFileSync(join(this.storePath, 'messages', query.where.owner, dirent.name), { + encoding: 'utf-8', + }), ), ); } diff --git a/src/whatsapp/repository/messageUp.repository.ts b/src/whatsapp/repository/messageUp.repository.ts index 6a9f9cc4..b97bf59b 100644 --- a/src/whatsapp/repository/messageUp.repository.ts +++ b/src/whatsapp/repository/messageUp.repository.ts @@ -1,9 +1,10 @@ -import { ConfigService, StoreConf } from '../../config/env.config'; -import { IMessageUpModel, MessageUpdateRaw } from '../models'; -import { IInsert, Repository } from '../abstract/abstract.repository'; -import { join } from 'path'; import { opendirSync, readFileSync } from 'fs'; +import { join } from 'path'; + +import { ConfigService, StoreConf } from '../../config/env.config'; import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { IMessageUpModel, MessageUpdateRaw } from '../models'; export class MessageUpQuery { where: MessageUpdateRaw; @@ -11,20 +12,13 @@ export class MessageUpQuery { } export class MessageUpRepository extends Repository { - constructor( - private readonly messageUpModel: IMessageUpModel, - private readonly configService: ConfigService, - ) { + constructor(private readonly messageUpModel: IMessageUpModel, private readonly configService: ConfigService) { super(configService); } private readonly logger = new Logger('MessageUpRepository'); - public async insert( - data: MessageUpdateRaw[], - instanceName: string, - saveDb?: boolean, - ): Promise { + public async insert(data: MessageUpdateRaw[], instanceName: string, saveDb?: boolean): Promise { this.logger.verbose('inserting message up'); if (data.length === 0) { @@ -54,10 +48,7 @@ export class MessageUpRepository extends Repository { data: update, }); this.logger.verbose( - 'message up saved to store in path: ' + - join(this.storePath, 'message-up', instanceName) + - '/' + - update.id, + 'message up saved to store in path: ' + join(this.storePath, 'message-up', instanceName) + '/' + update.id, ); }); @@ -91,42 +82,32 @@ export class MessageUpRepository extends Repository { messageUpdate.push( JSON.parse( - readFileSync( - join( - this.storePath, - 'message-up', - query.where.owner, - query.where.id + '.json', - ), - { encoding: 'utf-8' }, - ), + readFileSync(join(this.storePath, 'message-up', query.where.owner, query.where.id + '.json'), { + encoding: 'utf-8', + }), ), ); } else { this.logger.verbose('finding message up in store by owner'); - const openDir = opendirSync( - join(this.storePath, 'message-up', query.where.owner), - { encoding: 'utf-8' }, - ); + const openDir = opendirSync(join(this.storePath, 'message-up', query.where.owner), { + encoding: 'utf-8', + }); for await (const dirent of openDir) { if (dirent.isFile()) { messageUpdate.push( JSON.parse( - readFileSync( - join(this.storePath, 'message-up', query.where.owner, dirent.name), - { encoding: 'utf-8' }, - ), + readFileSync(join(this.storePath, 'message-up', query.where.owner, dirent.name), { + encoding: 'utf-8', + }), ), ); } } } - this.logger.verbose( - 'message up found in store: ' + messageUpdate.length + ' message up', - ); + this.logger.verbose('message up found in store: ' + messageUpdate.length + ' message up'); return messageUpdate .sort((x, y) => { return y.datetime - x.datetime; diff --git a/src/whatsapp/repository/proxy.repository.ts b/src/whatsapp/repository/proxy.repository.ts new file mode 100644 index 00000000..169e798f --- /dev/null +++ b/src/whatsapp/repository/proxy.repository.ts @@ -0,0 +1,62 @@ +import { readFileSync } from 'fs'; +import { join } from 'path'; + +import { ConfigService } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { IProxyModel, ProxyRaw } from '../models'; + +export class ProxyRepository extends Repository { + constructor(private readonly proxyModel: IProxyModel, private readonly configService: ConfigService) { + super(configService); + } + + private readonly logger = new Logger('ProxyRepository'); + + public async create(data: ProxyRaw, instance: string): Promise { + try { + this.logger.verbose('creating proxy'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('saving proxy to db'); + const insert = await this.proxyModel.replaceOne({ _id: instance }, { ...data }, { upsert: true }); + + this.logger.verbose('proxy saved to db: ' + insert.modifiedCount + ' proxy'); + return { insertCount: insert.modifiedCount }; + } + + this.logger.verbose('saving proxy to store'); + + this.writeStore({ + path: join(this.storePath, 'proxy'), + fileName: instance, + data, + }); + + this.logger.verbose('proxy saved to store in path: ' + join(this.storePath, 'proxy') + '/' + instance); + + this.logger.verbose('proxy created'); + return { insertCount: 1 }; + } catch (error) { + return error; + } + } + + public async find(instance: string): Promise { + try { + this.logger.verbose('finding proxy'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('finding proxy in db'); + return await this.proxyModel.findOne({ _id: instance }); + } + + this.logger.verbose('finding proxy in store'); + return JSON.parse( + readFileSync(join(this.storePath, 'proxy', instance + '.json'), { + encoding: 'utf-8', + }), + ) as ProxyRaw; + } catch (error) { + return {}; + } + } +} diff --git a/src/whatsapp/repository/rabbitmq.repository.ts b/src/whatsapp/repository/rabbitmq.repository.ts new file mode 100644 index 00000000..3dfb5ec2 --- /dev/null +++ b/src/whatsapp/repository/rabbitmq.repository.ts @@ -0,0 +1,62 @@ +import { readFileSync } from 'fs'; +import { join } from 'path'; + +import { ConfigService } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { IRabbitmqModel, RabbitmqRaw } from '../models'; + +export class RabbitmqRepository extends Repository { + constructor(private readonly rabbitmqModel: IRabbitmqModel, private readonly configService: ConfigService) { + super(configService); + } + + private readonly logger = new Logger('RabbitmqRepository'); + + public async create(data: RabbitmqRaw, instance: string): Promise { + try { + this.logger.verbose('creating rabbitmq'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('saving rabbitmq to db'); + const insert = await this.rabbitmqModel.replaceOne({ _id: instance }, { ...data }, { upsert: true }); + + this.logger.verbose('rabbitmq saved to db: ' + insert.modifiedCount + ' rabbitmq'); + return { insertCount: insert.modifiedCount }; + } + + this.logger.verbose('saving rabbitmq to store'); + + this.writeStore({ + path: join(this.storePath, 'rabbitmq'), + fileName: instance, + data, + }); + + this.logger.verbose('rabbitmq saved to store in path: ' + join(this.storePath, 'rabbitmq') + '/' + instance); + + this.logger.verbose('rabbitmq created'); + return { insertCount: 1 }; + } catch (error) { + return error; + } + } + + public async find(instance: string): Promise { + try { + this.logger.verbose('finding rabbitmq'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('finding rabbitmq in db'); + return await this.rabbitmqModel.findOne({ _id: instance }); + } + + this.logger.verbose('finding rabbitmq in store'); + return JSON.parse( + readFileSync(join(this.storePath, 'rabbitmq', instance + '.json'), { + encoding: 'utf-8', + }), + ) as RabbitmqRaw; + } catch (error) { + return {}; + } + } +} diff --git a/src/whatsapp/repository/repository.manager.ts b/src/whatsapp/repository/repository.manager.ts index aa0fbd65..1c16fdef 100644 --- a/src/whatsapp/repository/repository.manager.ts +++ b/src/whatsapp/repository/repository.manager.ts @@ -1,17 +1,22 @@ -import { MessageRepository } from './message.repository'; -import { ChatRepository } from './chat.repository'; -import { ContactRepository } from './contact.repository'; -import { MessageUpRepository } from './messageUp.repository'; -import { MongoClient } from 'mongodb'; -import { WebhookRepository } from './webhook.repository'; -import { ChatwootRepository } from './chatwoot.repository'; - -import { AuthRepository } from './auth.repository'; -import { Auth, ConfigService, Database } from '../../config/env.config'; -import { execSync } from 'child_process'; -import { join } from 'path'; import fs from 'fs'; +import { MongoClient } from 'mongodb'; +import { join } from 'path'; + +import { Auth, ConfigService, Database } from '../../config/env.config'; import { Logger } from '../../config/logger.config'; +import { AuthRepository } from './auth.repository'; +import { ChamaaiRepository } from './chamaai.repository'; +import { ChatRepository } from './chat.repository'; +import { ChatwootRepository } from './chatwoot.repository'; +import { ContactRepository } from './contact.repository'; +import { MessageRepository } from './message.repository'; +import { MessageUpRepository } from './messageUp.repository'; +import { ProxyRepository } from './proxy.repository'; +import { RabbitmqRepository } from './rabbitmq.repository'; +import { SettingsRepository } from './settings.repository'; +import { TypebotRepository } from './typebot.repository'; +import { WebhookRepository } from './webhook.repository'; +import { WebsocketRepository } from './websocket.repository'; export class RepositoryBroker { constructor( public readonly message: MessageRepository, @@ -20,6 +25,12 @@ export class RepositoryBroker { public readonly messageUpdate: MessageUpRepository, public readonly webhook: WebhookRepository, public readonly chatwoot: ChatwootRepository, + public readonly settings: SettingsRepository, + public readonly websocket: WebsocketRepository, + public readonly rabbitmq: RabbitmqRepository, + public readonly typebot: TypebotRepository, + public readonly proxy: ProxyRepository, + public readonly chamaai: ChamaaiRepository, public readonly auth: AuthRepository, private configService: ConfigService, dbServer?: MongoClient, @@ -42,20 +53,21 @@ export class RepositoryBroker { this.logger.verbose('creating store path: ' + storePath); try { - const authDir = join( - storePath, - 'auth', - this.configService.get('AUTHENTICATION').TYPE, - ); + const authDir = join(storePath, 'auth', this.configService.get('AUTHENTICATION').TYPE); const chatsDir = join(storePath, 'chats'); const contactsDir = join(storePath, 'contacts'); const messagesDir = join(storePath, 'messages'); const messageUpDir = join(storePath, 'message-up'); const webhookDir = join(storePath, 'webhook'); const chatwootDir = join(storePath, 'chatwoot'); + const settingsDir = join(storePath, 'settings'); + const websocketDir = join(storePath, 'websocket'); + const rabbitmqDir = join(storePath, 'rabbitmq'); + const typebotDir = join(storePath, 'typebot'); + const proxyDir = join(storePath, 'proxy'); + const chamaaiDir = join(storePath, 'chamaai'); const tempDir = join(storePath, 'temp'); - // Check if directories exist, create them if not if (!fs.existsSync(authDir)) { this.logger.verbose('creating auth dir: ' + authDir); fs.mkdirSync(authDir, { recursive: true }); @@ -80,6 +92,50 @@ export class RepositoryBroker { this.logger.verbose('creating webhook dir: ' + webhookDir); fs.mkdirSync(webhookDir, { recursive: true }); } + if (!fs.existsSync(chatwootDir)) { + this.logger.verbose('creating chatwoot dir: ' + chatwootDir); + fs.mkdirSync(chatwootDir, { recursive: true }); + } + if (!fs.existsSync(settingsDir)) { + this.logger.verbose('creating settings dir: ' + settingsDir); + fs.mkdirSync(settingsDir, { recursive: true }); + } + if (!fs.existsSync(websocketDir)) { + this.logger.verbose('creating websocket dir: ' + websocketDir); + fs.mkdirSync(websocketDir, { recursive: true }); + } + if (!fs.existsSync(rabbitmqDir)) { + this.logger.verbose('creating rabbitmq dir: ' + rabbitmqDir); + fs.mkdirSync(rabbitmqDir, { recursive: true }); + } + if (!fs.existsSync(typebotDir)) { + this.logger.verbose('creating typebot dir: ' + typebotDir); + fs.mkdirSync(typebotDir, { recursive: true }); + } + if (!fs.existsSync(proxyDir)) { + this.logger.verbose('creating proxy dir: ' + proxyDir); + fs.mkdirSync(proxyDir, { recursive: true }); + } + if (!fs.existsSync(chamaaiDir)) { + this.logger.verbose('creating chamaai dir: ' + chamaaiDir); + fs.mkdirSync(chamaaiDir, { recursive: true }); + } + if (!fs.existsSync(tempDir)) { + this.logger.verbose('creating temp dir: ' + tempDir); + fs.mkdirSync(tempDir, { recursive: true }); + } + } catch (error) { + this.logger.error(error); + } + } else { + try { + const storePath = join(process.cwd(), 'store'); + + this.logger.verbose('creating store path: ' + storePath); + + const tempDir = join(storePath, 'temp'); + const chatwootDir = join(storePath, 'chatwoot'); + if (!fs.existsSync(chatwootDir)) { this.logger.verbose('creating chatwoot dir: ' + chatwootDir); fs.mkdirSync(chatwootDir, { recursive: true }); diff --git a/src/whatsapp/repository/settings.repository.ts b/src/whatsapp/repository/settings.repository.ts new file mode 100644 index 00000000..4d09d79f --- /dev/null +++ b/src/whatsapp/repository/settings.repository.ts @@ -0,0 +1,62 @@ +import { readFileSync } from 'fs'; +import { join } from 'path'; + +import { ConfigService } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { ISettingsModel, SettingsRaw } from '../models'; + +export class SettingsRepository extends Repository { + constructor(private readonly settingsModel: ISettingsModel, private readonly configService: ConfigService) { + super(configService); + } + + private readonly logger = new Logger('SettingsRepository'); + + public async create(data: SettingsRaw, instance: string): Promise { + try { + this.logger.verbose('creating settings'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('saving settings to db'); + const insert = await this.settingsModel.replaceOne({ _id: instance }, { ...data }, { upsert: true }); + + this.logger.verbose('settings saved to db: ' + insert.modifiedCount + ' settings'); + return { insertCount: insert.modifiedCount }; + } + + this.logger.verbose('saving settings to store'); + + this.writeStore({ + path: join(this.storePath, 'settings'), + fileName: instance, + data, + }); + + this.logger.verbose('settings saved to store in path: ' + join(this.storePath, 'settings') + '/' + instance); + + this.logger.verbose('settings created'); + return { insertCount: 1 }; + } catch (error) { + return error; + } + } + + public async find(instance: string): Promise { + try { + this.logger.verbose('finding settings'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('finding settings in db'); + return await this.settingsModel.findOne({ _id: instance }); + } + + this.logger.verbose('finding settings in store'); + return JSON.parse( + readFileSync(join(this.storePath, 'settings', instance + '.json'), { + encoding: 'utf-8', + }), + ) as SettingsRaw; + } catch (error) { + return {}; + } + } +} diff --git a/src/whatsapp/repository/typebot.repository.ts b/src/whatsapp/repository/typebot.repository.ts new file mode 100644 index 00000000..8653e9c9 --- /dev/null +++ b/src/whatsapp/repository/typebot.repository.ts @@ -0,0 +1,68 @@ +import { readFileSync } from 'fs'; +import { join } from 'path'; + +import { ConfigService } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { ITypebotModel, TypebotRaw } from '../models'; + +export class TypebotRepository extends Repository { + constructor(private readonly typebotModel: ITypebotModel, private readonly configService: ConfigService) { + super(configService); + } + + private readonly logger = new Logger('TypebotRepository'); + + public async create(data: TypebotRaw, instance: string): Promise { + try { + this.logger.verbose('creating typebot'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('saving typebot to db'); + const insert = await this.typebotModel.replaceOne({ _id: instance }, { ...data }, { upsert: true }); + + this.logger.verbose('typebot saved to db: ' + insert.modifiedCount + ' typebot'); + return { insertCount: insert.modifiedCount }; + } + + this.logger.verbose('saving typebot to store'); + + this.writeStore({ + path: join(this.storePath, 'typebot'), + fileName: instance, + data, + }); + + this.logger.verbose('typebot saved to store in path: ' + join(this.storePath, 'typebot') + '/' + instance); + + this.logger.verbose('typebot created'); + return { insertCount: 1 }; + } catch (error) { + return error; + } + } + + public async find(instance: string): Promise { + try { + this.logger.verbose('finding typebot'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('finding typebot in db'); + return await this.typebotModel.findOne({ _id: instance }); + } + + this.logger.verbose('finding typebot in store'); + return JSON.parse( + readFileSync(join(this.storePath, 'typebot', instance + '.json'), { + encoding: 'utf-8', + }), + ) as TypebotRaw; + } catch (error) { + return { + enabled: false, + url: '', + typebot: '', + expire: 0, + sessions: [], + }; + } + } +} diff --git a/src/whatsapp/repository/webhook.repository.ts b/src/whatsapp/repository/webhook.repository.ts index d9b34af1..10074516 100644 --- a/src/whatsapp/repository/webhook.repository.ts +++ b/src/whatsapp/repository/webhook.repository.ts @@ -1,15 +1,13 @@ -import { IInsert, Repository } from '../abstract/abstract.repository'; -import { ConfigService } from '../../config/env.config'; -import { join } from 'path'; import { readFileSync } from 'fs'; -import { IWebhookModel, WebhookRaw } from '../models'; +import { join } from 'path'; + +import { ConfigService } from '../../config/env.config'; import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { IWebhookModel, WebhookRaw } from '../models'; export class WebhookRepository extends Repository { - constructor( - private readonly webhookModel: IWebhookModel, - private readonly configService: ConfigService, - ) { + constructor(private readonly webhookModel: IWebhookModel, private readonly configService: ConfigService) { super(configService); } @@ -20,11 +18,7 @@ export class WebhookRepository extends Repository { this.logger.verbose('creating webhook'); if (this.dbSettings.ENABLED) { this.logger.verbose('saving webhook to db'); - const insert = await this.webhookModel.replaceOne( - { _id: instance }, - { ...data }, - { upsert: true }, - ); + const insert = await this.webhookModel.replaceOne({ _id: instance }, { ...data }, { upsert: true }); this.logger.verbose('webhook saved to db: ' + insert.modifiedCount + ' webhook'); return { insertCount: insert.modifiedCount }; @@ -38,12 +32,7 @@ export class WebhookRepository extends Repository { data, }); - this.logger.verbose( - 'webhook saved to store in path: ' + - join(this.storePath, 'webhook') + - '/' + - instance, - ); + this.logger.verbose('webhook saved to store in path: ' + join(this.storePath, 'webhook') + '/' + instance); this.logger.verbose('webhook created'); return { insertCount: 1 }; diff --git a/src/whatsapp/repository/websocket.repository.ts b/src/whatsapp/repository/websocket.repository.ts new file mode 100644 index 00000000..19823194 --- /dev/null +++ b/src/whatsapp/repository/websocket.repository.ts @@ -0,0 +1,62 @@ +import { readFileSync } from 'fs'; +import { join } from 'path'; + +import { ConfigService } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; +import { IInsert, Repository } from '../abstract/abstract.repository'; +import { IWebsocketModel, WebsocketRaw } from '../models'; + +export class WebsocketRepository extends Repository { + constructor(private readonly websocketModel: IWebsocketModel, private readonly configService: ConfigService) { + super(configService); + } + + private readonly logger = new Logger('WebsocketRepository'); + + public async create(data: WebsocketRaw, instance: string): Promise { + try { + this.logger.verbose('creating websocket'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('saving websocket to db'); + const insert = await this.websocketModel.replaceOne({ _id: instance }, { ...data }, { upsert: true }); + + this.logger.verbose('websocket saved to db: ' + insert.modifiedCount + ' websocket'); + return { insertCount: insert.modifiedCount }; + } + + this.logger.verbose('saving websocket to store'); + + this.writeStore({ + path: join(this.storePath, 'websocket'), + fileName: instance, + data, + }); + + this.logger.verbose('websocket saved to store in path: ' + join(this.storePath, 'websocket') + '/' + instance); + + this.logger.verbose('websocket created'); + return { insertCount: 1 }; + } catch (error) { + return error; + } + } + + public async find(instance: string): Promise { + try { + this.logger.verbose('finding websocket'); + if (this.dbSettings.ENABLED) { + this.logger.verbose('finding websocket in db'); + return await this.websocketModel.findOne({ _id: instance }); + } + + this.logger.verbose('finding websocket in store'); + return JSON.parse( + readFileSync(join(this.storePath, 'websocket', instance + '.json'), { + encoding: 'utf-8', + }), + ) as WebsocketRaw; + } catch (error) { + return {}; + } + } +} diff --git a/src/whatsapp/routers/chamaai.router.ts b/src/whatsapp/routers/chamaai.router.ts new file mode 100644 index 00000000..e8021306 --- /dev/null +++ b/src/whatsapp/routers/chamaai.router.ts @@ -0,0 +1,52 @@ +import { RequestHandler, Router } from 'express'; + +import { Logger } from '../../config/logger.config'; +import { chamaaiSchema, instanceNameSchema } from '../../validate/validate.schema'; +import { RouterBroker } from '../abstract/abstract.router'; +import { ChamaaiDto } from '../dto/chamaai.dto'; +import { InstanceDto } from '../dto/instance.dto'; +import { chamaaiController } from '../whatsapp.module'; +import { HttpStatus } from './index.router'; + +const logger = new Logger('ChamaaiRouter'); + +export class ChamaaiRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .post(this.routerPath('set'), ...guards, async (req, res) => { + logger.verbose('request received in setChamaai'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: chamaaiSchema, + ClassRef: ChamaaiDto, + execute: (instance, data) => chamaaiController.createChamaai(instance, data), + }); + + res.status(HttpStatus.CREATED).json(response); + }) + .get(this.routerPath('find'), ...guards, async (req, res) => { + logger.verbose('request received in findChamaai'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: instanceNameSchema, + ClassRef: InstanceDto, + execute: (instance) => chamaaiController.findChamaai(instance), + }); + + res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router = Router(); +} diff --git a/src/whatsapp/routers/chat.router.ts b/src/whatsapp/routers/chat.router.ts index 68ecd97e..285c29a0 100644 --- a/src/whatsapp/routers/chat.router.ts +++ b/src/whatsapp/routers/chat.router.ts @@ -1,4 +1,6 @@ import { RequestHandler, Router } from 'express'; + +import { Logger } from '../../config/logger.config'; import { archiveChatSchema, contactValidateSchema, @@ -13,9 +15,11 @@ import { readMessageSchema, whatsappNumberSchema, } from '../../validate/validate.schema'; +import { RouterBroker } from '../abstract/abstract.router'; import { ArchiveChatDto, DeleteMessage, + getBase64FromMediaMessageDto, NumberDto, PrivacySettingDto, ProfileNameDto, @@ -23,17 +27,13 @@ import { ProfileStatusDto, ReadMessageDto, WhatsAppNumberDto, - getBase64FromMediaMessageDto, } from '../dto/chat.dto'; +import { InstanceDto } from '../dto/instance.dto'; import { ContactQuery } from '../repository/contact.repository'; import { MessageQuery } from '../repository/message.repository'; -import { chatController } from '../whatsapp.module'; -import { RouterBroker } from '../abstract/abstract.router'; -import { HttpStatus } from './index.router'; import { MessageUpQuery } from '../repository/messageUp.repository'; -import { proto } from '@whiskeysockets/baileys'; -import { InstanceDto } from '../dto/instance.dto'; -import { Logger } from '../../config/logger.config'; +import { chatController } from '../whatsapp.module'; +import { HttpStatus } from './index.router'; const logger = new Logger('ChatRouter'); @@ -92,27 +92,23 @@ export class ChatRouter extends RouterBroker { return res.status(HttpStatus.CREATED).json(response); }) - .delete( - this.routerPath('deleteMessageForEveryone'), - ...guards, - async (req, res) => { - logger.verbose('request received in deleteMessageForEveryone'); - logger.verbose('request body: '); - logger.verbose(req.body); + .delete(this.routerPath('deleteMessageForEveryone'), ...guards, async (req, res) => { + logger.verbose('request received in deleteMessageForEveryone'); + logger.verbose('request body: '); + logger.verbose(req.body); - logger.verbose('request query: '); - logger.verbose(req.query); + logger.verbose('request query: '); + logger.verbose(req.query); - const response = await this.dataValidate({ - request: req, - schema: deleteMessageSchema, - ClassRef: DeleteMessage, - execute: (instance, data) => chatController.deleteMessage(instance, data), - }); + const response = await this.dataValidate({ + request: req, + schema: deleteMessageSchema, + ClassRef: DeleteMessage, + execute: (instance, data) => chatController.deleteMessage(instance, data), + }); - return res.status(HttpStatus.CREATED).json(response); - }, - ) + return res.status(HttpStatus.CREATED).json(response); + }) .post(this.routerPath('fetchProfilePictureUrl'), ...guards, async (req, res) => { logger.verbose('request received in fetchProfilePictureUrl'); logger.verbose('request body: '); @@ -134,7 +130,7 @@ export class ChatRouter extends RouterBroker { logger.verbose('request received in fetchProfile'); logger.verbose('request body: '); logger.verbose(req.body); - + logger.verbose('request query: '); logger.verbose(req.query); @@ -176,8 +172,7 @@ export class ChatRouter extends RouterBroker { request: req, schema: null, ClassRef: getBase64FromMediaMessageDto, - execute: (instance, data) => - chatController.getBase64FromMediaMessage(instance, data), + execute: (instance, data) => chatController.getBase64FromMediaMessage(instance, data), }); return res.status(HttpStatus.CREATED).json(response); @@ -263,8 +258,7 @@ export class ChatRouter extends RouterBroker { request: req, schema: privacySettingsSchema, ClassRef: PrivacySettingDto, - execute: (instance, data) => - chatController.updatePrivacySettings(instance, data), + execute: (instance, data) => chatController.updatePrivacySettings(instance, data), }); return res.status(HttpStatus.CREATED).json(response); @@ -281,8 +275,7 @@ export class ChatRouter extends RouterBroker { request: req, schema: profilePictureSchema, ClassRef: ProfilePictureDto, - execute: (instance, data) => - chatController.fetchBusinessProfile(instance, data), + execute: (instance, data) => chatController.fetchBusinessProfile(instance, data), }); return res.status(HttpStatus.OK).json(response); @@ -333,8 +326,7 @@ export class ChatRouter extends RouterBroker { request: req, schema: profilePictureSchema, ClassRef: ProfilePictureDto, - execute: (instance, data) => - chatController.updateProfilePicture(instance, data), + execute: (instance, data) => chatController.updateProfilePicture(instance, data), }); return res.status(HttpStatus.OK).json(response); @@ -351,8 +343,7 @@ export class ChatRouter extends RouterBroker { request: req, schema: profilePictureSchema, ClassRef: ProfilePictureDto, - execute: (instance, data) => - chatController.removeProfilePicture(instance, data), + execute: (instance) => chatController.removeProfilePicture(instance), }); return res.status(HttpStatus.OK).json(response); diff --git a/src/whatsapp/routers/chatwoot.router.ts b/src/whatsapp/routers/chatwoot.router.ts index 3d87f137..eb779587 100644 --- a/src/whatsapp/routers/chatwoot.router.ts +++ b/src/whatsapp/routers/chatwoot.router.ts @@ -1,12 +1,13 @@ import { RequestHandler, Router } from 'express'; -import { instanceNameSchema, chatwootSchema } from '../../validate/validate.schema'; -import { RouterBroker } from '../abstract/abstract.router'; -import { InstanceDto } from '../dto/instance.dto'; -import { ChatwootDto } from '../dto/chatwoot.dto'; -import { chatwootController } from '../whatsapp.module'; -import { ChatwootService } from '../services/chatwoot.service'; -import { HttpStatus } from './index.router'; + import { Logger } from '../../config/logger.config'; +import { chatwootSchema, instanceNameSchema } from '../../validate/validate.schema'; +import { RouterBroker } from '../abstract/abstract.router'; +import { ChatwootDto } from '../dto/chatwoot.dto'; +import { InstanceDto } from '../dto/instance.dto'; +// import { ChatwootService } from '../services/chatwoot.service'; +import { chatwootController } from '../whatsapp.module'; +import { HttpStatus } from './index.router'; const logger = new Logger('ChatwootRouter'); diff --git a/src/whatsapp/routers/group.router.ts b/src/whatsapp/routers/group.router.ts index 4c1b3023..f59e82a4 100644 --- a/src/whatsapp/routers/group.router.ts +++ b/src/whatsapp/routers/group.router.ts @@ -1,34 +1,35 @@ import { RequestHandler, Router } from 'express'; + +import { Logger } from '../../config/logger.config'; import { createGroupSchema, + getParticipantsSchema, + groupInviteSchema, groupJidSchema, - updateParticipantsSchema, - updateSettingsSchema, + groupSendInviteSchema, toggleEphemeralSchema, + updateGroupDescriptionSchema, updateGroupPictureSchema, updateGroupSubjectSchema, - updateGroupDescriptionSchema, - groupInviteSchema, - groupSendInviteSchema, - getParticipantsSchema, + updateParticipantsSchema, + updateSettingsSchema, } from '../../validate/validate.schema'; import { RouterBroker } from '../abstract/abstract.router'; import { CreateGroupDto, + GetParticipant, + GroupDescriptionDto, GroupInvite, GroupJid, GroupPictureDto, + GroupSendInvite, GroupSubjectDto, - GroupDescriptionDto, + GroupToggleEphemeralDto, GroupUpdateParticipantDto, GroupUpdateSettingDto, - GroupToggleEphemeralDto, - GroupSendInvite, - GetParticipant, } from '../dto/group.dto'; import { groupController } from '../whatsapp.module'; import { HttpStatus } from './index.router'; -import { Logger } from '../../config/logger.config'; const logger = new Logger('GroupRouter'); @@ -96,8 +97,7 @@ export class GroupRouter extends RouterBroker { request: req, schema: updateGroupDescriptionSchema, ClassRef: GroupDescriptionDto, - execute: (instance, data) => - groupController.updateGroupDescription(instance, data), + execute: (instance, data) => groupController.updateGroupDescription(instance, data), }); res.status(HttpStatus.CREATED).json(response); diff --git a/src/whatsapp/routers/index.router.ts b/src/whatsapp/routers/index.router.ts index 5d8a2c05..f67c936a 100644 --- a/src/whatsapp/routers/index.router.ts +++ b/src/whatsapp/routers/index.router.ts @@ -1,15 +1,22 @@ import { Router } from 'express'; +import fs from 'fs'; + import { Auth, configService } from '../../config/env.config'; -import { instanceExistsGuard, instanceLoggedGuard } from '../guards/instance.guard'; import { authGuard } from '../guards/auth.guard'; +import { instanceExistsGuard, instanceLoggedGuard } from '../guards/instance.guard'; +import { ChamaaiRouter } from './chamaai.router'; import { ChatRouter } from './chat.router'; +import { ChatwootRouter } from './chatwoot.router'; import { GroupRouter } from './group.router'; import { InstanceRouter } from './instance.router'; +import { ProxyRouter } from './proxy.router'; +import { RabbitmqRouter } from './rabbitmq.router'; import { MessageRouter } from './sendMessage.router'; +import { SettingsRouter } from './settings.router'; +import { TypebotRouter } from './typebot.router'; import { ViewsRouter } from './view.router'; import { WebhookRouter } from './webhook.router'; -import { ChatwootRouter } from './chatwoot.router'; -import fs from 'fs'; +import { WebsocketRouter } from './websocket.router'; enum HttpStatus { OK = 200, @@ -35,15 +42,18 @@ router version: packageJson.version, }); }) - .use( - '/instance', - new InstanceRouter(configService, ...guards).router, - new ViewsRouter(instanceExistsGuard).router, - ) + .use('/instance', new InstanceRouter(configService, ...guards).router) + .use('/manager', new ViewsRouter().router) .use('/message', new MessageRouter(...guards).router) .use('/chat', new ChatRouter(...guards).router) .use('/group', new GroupRouter(...guards).router) .use('/webhook', new WebhookRouter(...guards).router) - .use('/chatwoot', new ChatwootRouter(...guards).router); + .use('/chatwoot', new ChatwootRouter(...guards).router) + .use('/settings', new SettingsRouter(...guards).router) + .use('/websocket', new WebsocketRouter(...guards).router) + .use('/rabbitmq', new RabbitmqRouter(...guards).router) + .use('/typebot', new TypebotRouter(...guards).router) + .use('/proxy', new ProxyRouter(...guards).router) + .use('/chamaai', new ChamaaiRouter(...guards).router); -export { router, HttpStatus }; +export { HttpStatus, router }; diff --git a/src/whatsapp/routers/instance.router.ts b/src/whatsapp/routers/instance.router.ts index 850ffebd..96a1a5da 100644 --- a/src/whatsapp/routers/instance.router.ts +++ b/src/whatsapp/routers/instance.router.ts @@ -1,13 +1,14 @@ import { RequestHandler, Router } from 'express'; -import { instanceNameSchema, oldTokenSchema } from '../../validate/validate.schema'; -import { InstanceDto } from '../dto/instance.dto'; -import { instanceController } from '../whatsapp.module'; -import { RouterBroker } from '../abstract/abstract.router'; -import { HttpStatus } from './index.router'; -import { OldToken } from '../services/auth.service'; + import { Auth, ConfigService, Database } from '../../config/env.config'; -import { dbserver } from '../../db/db.connect'; import { Logger } from '../../config/logger.config'; +import { dbserver } from '../../libs/db.connect'; +import { instanceNameSchema, oldTokenSchema } from '../../validate/validate.schema'; +import { RouterBroker } from '../abstract/abstract.router'; +import { InstanceDto } from '../dto/instance.dto'; +import { OldToken } from '../services/auth.service'; +import { instanceController } from '../whatsapp.module'; +import { HttpStatus } from './index.router'; const logger = new Logger('InstanceRouter'); @@ -162,17 +163,13 @@ export class InstanceRouter extends RouterBroker { await dbserver.dropDatabase(); return res .status(HttpStatus.CREATED) - .json({ error: false, message: 'Database deleted' }); + .json({ status: 'SUCCESS', error: false, response: { message: 'database deleted' } }); } catch (error) { - return res - .status(HttpStatus.INTERNAL_SERVER_ERROR) - .json({ error: true, message: error.message }); + return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json({ error: true, message: error.message }); } } - return res - .status(HttpStatus.INTERNAL_SERVER_ERROR) - .json({ error: true, message: 'Database is not enabled' }); + return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json({ error: true, message: 'Database is not enabled' }); }); } diff --git a/src/whatsapp/routers/proxy.router.ts b/src/whatsapp/routers/proxy.router.ts new file mode 100644 index 00000000..2ae0141b --- /dev/null +++ b/src/whatsapp/routers/proxy.router.ts @@ -0,0 +1,52 @@ +import { RequestHandler, Router } from 'express'; + +import { Logger } from '../../config/logger.config'; +import { instanceNameSchema, proxySchema } from '../../validate/validate.schema'; +import { RouterBroker } from '../abstract/abstract.router'; +import { InstanceDto } from '../dto/instance.dto'; +import { ProxyDto } from '../dto/proxy.dto'; +import { proxyController } from '../whatsapp.module'; +import { HttpStatus } from './index.router'; + +const logger = new Logger('ProxyRouter'); + +export class ProxyRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .post(this.routerPath('set'), ...guards, async (req, res) => { + logger.verbose('request received in setProxy'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: proxySchema, + ClassRef: ProxyDto, + execute: (instance, data) => proxyController.createProxy(instance, data), + }); + + res.status(HttpStatus.CREATED).json(response); + }) + .get(this.routerPath('find'), ...guards, async (req, res) => { + logger.verbose('request received in findProxy'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: instanceNameSchema, + ClassRef: InstanceDto, + execute: (instance) => proxyController.findProxy(instance), + }); + + res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router = Router(); +} diff --git a/src/whatsapp/routers/rabbitmq.router.ts b/src/whatsapp/routers/rabbitmq.router.ts new file mode 100644 index 00000000..e3f65283 --- /dev/null +++ b/src/whatsapp/routers/rabbitmq.router.ts @@ -0,0 +1,52 @@ +import { RequestHandler, Router } from 'express'; + +import { Logger } from '../../config/logger.config'; +import { instanceNameSchema, rabbitmqSchema } from '../../validate/validate.schema'; +import { RouterBroker } from '../abstract/abstract.router'; +import { InstanceDto } from '../dto/instance.dto'; +import { RabbitmqDto } from '../dto/rabbitmq.dto'; +import { rabbitmqController } from '../whatsapp.module'; +import { HttpStatus } from './index.router'; + +const logger = new Logger('RabbitmqRouter'); + +export class RabbitmqRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .post(this.routerPath('set'), ...guards, async (req, res) => { + logger.verbose('request received in setRabbitmq'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: rabbitmqSchema, + ClassRef: RabbitmqDto, + execute: (instance, data) => rabbitmqController.createRabbitmq(instance, data), + }); + + res.status(HttpStatus.CREATED).json(response); + }) + .get(this.routerPath('find'), ...guards, async (req, res) => { + logger.verbose('request received in findRabbitmq'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: instanceNameSchema, + ClassRef: InstanceDto, + execute: (instance) => rabbitmqController.findRabbitmq(instance), + }); + + res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router = Router(); +} diff --git a/src/whatsapp/routers/sendMessage.router.ts b/src/whatsapp/routers/sendMessage.router.ts index f6f9c3eb..d87db44d 100644 --- a/src/whatsapp/routers/sendMessage.router.ts +++ b/src/whatsapp/routers/sendMessage.router.ts @@ -1,4 +1,6 @@ import { RequestHandler, Router } from 'express'; + +import { Logger } from '../../config/logger.config'; import { audioMessageSchema, buttonMessageSchema, @@ -12,6 +14,7 @@ import { stickerMessageSchema, textMessageSchema, } from '../../validate/validate.schema'; +import { RouterBroker } from '../abstract/abstract.router'; import { SendAudioDto, SendButtonDto, @@ -26,9 +29,7 @@ import { SendTextDto, } from '../dto/sendMessage.dto'; import { sendMessageController } from '../whatsapp.module'; -import { RouterBroker } from '../abstract/abstract.router'; import { HttpStatus } from './index.router'; -import { Logger } from '../../config/logger.config'; const logger = new Logger('MessageRouter'); @@ -79,8 +80,7 @@ export class MessageRouter extends RouterBroker { request: req, schema: audioMessageSchema, ClassRef: SendMediaDto, - execute: (instance, data) => - sendMessageController.sendWhatsAppAudio(instance, data), + execute: (instance, data) => sendMessageController.sendWhatsAppAudio(instance, data), }); return res.status(HttpStatus.CREATED).json(response); diff --git a/src/whatsapp/routers/settings.router.ts b/src/whatsapp/routers/settings.router.ts new file mode 100644 index 00000000..6bd4d549 --- /dev/null +++ b/src/whatsapp/routers/settings.router.ts @@ -0,0 +1,53 @@ +import { RequestHandler, Router } from 'express'; + +import { Logger } from '../../config/logger.config'; +import { instanceNameSchema, settingsSchema } from '../../validate/validate.schema'; +import { RouterBroker } from '../abstract/abstract.router'; +import { InstanceDto } from '../dto/instance.dto'; +import { SettingsDto } from '../dto/settings.dto'; +// import { SettingsService } from '../services/settings.service'; +import { settingsController } from '../whatsapp.module'; +import { HttpStatus } from './index.router'; + +const logger = new Logger('SettingsRouter'); + +export class SettingsRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .post(this.routerPath('set'), ...guards, async (req, res) => { + logger.verbose('request received in setSettings'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: settingsSchema, + ClassRef: SettingsDto, + execute: (instance, data) => settingsController.createSettings(instance, data), + }); + + res.status(HttpStatus.CREATED).json(response); + }) + .get(this.routerPath('find'), ...guards, async (req, res) => { + logger.verbose('request received in findSettings'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: instanceNameSchema, + ClassRef: InstanceDto, + execute: (instance) => settingsController.findSettings(instance), + }); + + res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router = Router(); +} diff --git a/src/whatsapp/routers/typebot.router.ts b/src/whatsapp/routers/typebot.router.ts new file mode 100644 index 00000000..0f785de3 --- /dev/null +++ b/src/whatsapp/routers/typebot.router.ts @@ -0,0 +1,89 @@ +import { RequestHandler, Router } from 'express'; + +import { Logger } from '../../config/logger.config'; +import { + instanceNameSchema, + typebotSchema, + typebotStartSchema, + typebotStatusSchema, +} from '../../validate/validate.schema'; +import { RouterBroker } from '../abstract/abstract.router'; +import { InstanceDto } from '../dto/instance.dto'; +import { TypebotDto } from '../dto/typebot.dto'; +import { typebotController } from '../whatsapp.module'; +import { HttpStatus } from './index.router'; + +const logger = new Logger('TypebotRouter'); + +export class TypebotRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .post(this.routerPath('set'), ...guards, async (req, res) => { + logger.verbose('request received in setTypebot'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: typebotSchema, + ClassRef: TypebotDto, + execute: (instance, data) => typebotController.createTypebot(instance, data), + }); + + res.status(HttpStatus.CREATED).json(response); + }) + .get(this.routerPath('find'), ...guards, async (req, res) => { + logger.verbose('request received in findTypebot'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: instanceNameSchema, + ClassRef: InstanceDto, + execute: (instance) => typebotController.findTypebot(instance), + }); + + res.status(HttpStatus.OK).json(response); + }) + .post(this.routerPath('changeStatus'), ...guards, async (req, res) => { + logger.verbose('request received in changeStatusTypebot'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: typebotStatusSchema, + ClassRef: InstanceDto, + execute: (instance, data) => typebotController.changeStatus(instance, data), + }); + + res.status(HttpStatus.OK).json(response); + }) + .post(this.routerPath('start'), ...guards, async (req, res) => { + logger.verbose('request received in startTypebot'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: typebotStartSchema, + ClassRef: InstanceDto, + execute: (instance, data) => typebotController.startTypebot(instance, data), + }); + + res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router = Router(); +} diff --git a/src/whatsapp/routers/view.router.ts b/src/whatsapp/routers/view.router.ts index b5ddc008..11002777 100644 --- a/src/whatsapp/routers/view.router.ts +++ b/src/whatsapp/routers/view.router.ts @@ -1,13 +1,14 @@ -import { RequestHandler, Router } from 'express'; +import { Router } from 'express'; + import { RouterBroker } from '../abstract/abstract.router'; import { viewsController } from '../whatsapp.module'; export class ViewsRouter extends RouterBroker { - constructor(...guards: RequestHandler[]) { + constructor() { super(); - this.router.get(this.routerPath('qrcode'), ...guards, (req, res) => { - return viewsController.qrcode(req, res); + this.router.get('/', (req, res) => { + return viewsController.manager(req, res); }); } diff --git a/src/whatsapp/routers/webhook.router.ts b/src/whatsapp/routers/webhook.router.ts index c520d9d5..835d6014 100644 --- a/src/whatsapp/routers/webhook.router.ts +++ b/src/whatsapp/routers/webhook.router.ts @@ -1,11 +1,12 @@ import { RequestHandler, Router } from 'express'; + +import { Logger } from '../../config/logger.config'; import { instanceNameSchema, webhookSchema } from '../../validate/validate.schema'; import { RouterBroker } from '../abstract/abstract.router'; import { InstanceDto } from '../dto/instance.dto'; import { WebhookDto } from '../dto/webhook.dto'; import { webhookController } from '../whatsapp.module'; import { HttpStatus } from './index.router'; -import { Logger } from '../../config/logger.config'; const logger = new Logger('WebhookRouter'); diff --git a/src/whatsapp/routers/websocket.router.ts b/src/whatsapp/routers/websocket.router.ts new file mode 100644 index 00000000..f04cad0d --- /dev/null +++ b/src/whatsapp/routers/websocket.router.ts @@ -0,0 +1,52 @@ +import { RequestHandler, Router } from 'express'; + +import { Logger } from '../../config/logger.config'; +import { instanceNameSchema, websocketSchema } from '../../validate/validate.schema'; +import { RouterBroker } from '../abstract/abstract.router'; +import { InstanceDto } from '../dto/instance.dto'; +import { WebsocketDto } from '../dto/websocket.dto'; +import { websocketController } from '../whatsapp.module'; +import { HttpStatus } from './index.router'; + +const logger = new Logger('WebsocketRouter'); + +export class WebsocketRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .post(this.routerPath('set'), ...guards, async (req, res) => { + logger.verbose('request received in setWebsocket'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: websocketSchema, + ClassRef: WebsocketDto, + execute: (instance, data) => websocketController.createWebsocket(instance, data), + }); + + res.status(HttpStatus.CREATED).json(response); + }) + .get(this.routerPath('find'), ...guards, async (req, res) => { + logger.verbose('request received in findWebsocket'); + logger.verbose('request body: '); + logger.verbose(req.body); + + logger.verbose('request query: '); + logger.verbose(req.query); + const response = await this.dataValidate({ + request: req, + schema: instanceNameSchema, + ClassRef: InstanceDto, + execute: (instance) => websocketController.findWebsocket(instance), + }); + + res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router = Router(); +} diff --git a/src/whatsapp/services/auth.service.ts b/src/whatsapp/services/auth.service.ts index 88a84905..915a07b7 100644 --- a/src/whatsapp/services/auth.service.ts +++ b/src/whatsapp/services/auth.service.ts @@ -1,14 +1,15 @@ -import { Auth, ConfigService, Webhook } from '../../config/env.config'; -import { InstanceDto } from '../dto/instance.dto'; -import { name as apiName } from '../../../package.json'; -import { verify, sign } from 'jsonwebtoken'; -import { Logger } from '../../config/logger.config'; -import { v4 } from 'uuid'; -import { isJWT } from 'class-validator'; -import { BadRequestException } from '../../exceptions'; import axios from 'axios'; -import { WAMonitoringService } from './monitor.service'; +import { isJWT } from 'class-validator'; +import { sign, verify } from 'jsonwebtoken'; +import { v4 } from 'uuid'; + +import { name as apiName } from '../../../package.json'; +import { Auth, ConfigService, Webhook } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; +import { BadRequestException } from '../../exceptions'; +import { InstanceDto } from '../dto/instance.dto'; import { RepositoryBroker } from '../repository/repository.manager'; +import { WAMonitoringService } from './monitor.service'; export type JwtPayload = { instanceName: string; @@ -63,9 +64,7 @@ export class AuthService { private async apikey(instance: InstanceDto, token?: string) { const apikey = token ? token : v4().toUpperCase(); - this.logger.verbose( - token ? 'APIKEY defined: ' + apikey : 'APIKEY created: ' + apikey, - ); + this.logger.verbose(token ? 'APIKEY defined: ' + apikey : 'APIKEY created: ' + apikey); const auth = await this.repository.auth.create({ apikey }, instance.instanceName); @@ -101,13 +100,9 @@ export class AuthService { public async generateHash(instance: InstanceDto, token?: string) { const options = this.configService.get('AUTHENTICATION'); - this.logger.verbose( - 'generating hash ' + options.TYPE + ' to instance: ' + instance.instanceName, - ); + this.logger.verbose('generating hash ' + options.TYPE + ' to instance: ' + instance.instanceName); - return (await this[options.TYPE](instance, token)) as - | { jwt: string } - | { apikey: string }; + return (await this[options.TYPE](instance, token)) as { jwt: string } | { apikey: string }; } public async refreshToken({ oldToken }: OldToken) { @@ -150,10 +145,7 @@ export class AuthService { try { this.logger.verbose('checking webhook'); const webhook = await this.repository.webhook.find(decode.instanceName); - if ( - webhook?.enabled && - this.configService.get('WEBHOOK').EVENTS.NEW_JWT_TOKEN - ) { + if (webhook?.enabled && this.configService.get('WEBHOOK').EVENTS.NEW_JWT_TOKEN) { this.logger.verbose('sending webhook'); const httpService = axios.create({ baseURL: webhook.url }); diff --git a/src/whatsapp/services/chamaai.service.ts b/src/whatsapp/services/chamaai.service.ts new file mode 100644 index 00000000..ad2a42ad --- /dev/null +++ b/src/whatsapp/services/chamaai.service.ts @@ -0,0 +1,230 @@ +import axios from 'axios'; +import { writeFileSync } from 'fs'; +import path from 'path'; + +import { ConfigService, HttpServer } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; +import { ChamaaiDto } from '../dto/chamaai.dto'; +import { InstanceDto } from '../dto/instance.dto'; +import { ChamaaiRaw } from '../models'; +import { Events } from '../types/wa.types'; +import { WAMonitoringService } from './monitor.service'; + +export class ChamaaiService { + constructor(private readonly waMonitor: WAMonitoringService, private readonly configService: ConfigService) {} + + private readonly logger = new Logger(ChamaaiService.name); + + public create(instance: InstanceDto, data: ChamaaiDto) { + this.logger.verbose('create chamaai: ' + instance.instanceName); + this.waMonitor.waInstances[instance.instanceName].setChamaai(data); + + return { chamaai: { ...instance, chamaai: data } }; + } + + public async find(instance: InstanceDto): Promise { + try { + this.logger.verbose('find chamaai: ' + instance.instanceName); + const result = await this.waMonitor.waInstances[instance.instanceName].findChamaai(); + + if (Object.keys(result).length === 0) { + throw new Error('Chamaai not found'); + } + + return result; + } catch (error) { + return { enabled: false, url: '', token: '', waNumber: '', answerByAudio: false }; + } + } + + private getTypeMessage(msg: any) { + this.logger.verbose('get type message'); + + const types = { + conversation: msg.conversation, + extendedTextMessage: msg.extendedTextMessage?.text, + }; + + this.logger.verbose('type message: ' + types); + + return types; + } + + private getMessageContent(types: any) { + this.logger.verbose('get message content'); + const typeKey = Object.keys(types).find((key) => types[key] !== undefined); + + const result = typeKey ? types[typeKey] : undefined; + + this.logger.verbose('message content: ' + result); + + return result; + } + + private getConversationMessage(msg: any) { + this.logger.verbose('get conversation message'); + + const types = this.getTypeMessage(msg); + + const messageContent = this.getMessageContent(types); + + this.logger.verbose('conversation message: ' + messageContent); + + return messageContent; + } + + private calculateTypingTime(text: string) { + const wordsPerMinute = 100; + + const wordCount = text.split(' ').length; + const typingTimeInMinutes = wordCount / wordsPerMinute; + const typingTimeInMilliseconds = typingTimeInMinutes * 60; + return typingTimeInMilliseconds; + } + + private convertToMilliseconds(count: number) { + const averageCharactersPerSecond = 15; + const characterCount = count; + const speakingTimeInSeconds = characterCount / averageCharactersPerSecond; + return speakingTimeInSeconds; + } + + private getRegexPatterns() { + const patternsToCheck = [ + '.*atend.*humano.*', + '.*falar.*com.*um.*humano.*', + '.*fala.*humano.*', + '.*atend.*humano.*', + '.*fala.*atend.*', + '.*preciso.*ajuda.*', + '.*quero.*suporte.*', + '.*preciso.*assiste.*', + '.*ajuda.*atend.*', + '.*chama.*atendente.*', + '.*suporte.*urgente.*', + '.*atend.*por.*favor.*', + '.*quero.*falar.*com.*alguém.*', + '.*falar.*com.*um.*humano.*', + '.*transfer.*humano.*', + '.*transfer.*atend.*', + '.*equipe.*humano.*', + '.*suporte.*humano.*', + ]; + + const regexPatterns = patternsToCheck.map((pattern) => new RegExp(pattern, 'iu')); + return regexPatterns; + } + + public async sendChamaai(instance: InstanceDto, remoteJid: string, msg: any) { + const content = this.getConversationMessage(msg.message); + const msgType = msg.messageType; + const find = await this.find(instance); + const url = find.url; + const token = find.token; + const waNumber = find.waNumber; + const answerByAudio = find.answerByAudio; + + if (!content && msgType !== 'audioMessage') { + return; + } + + let data; + let endpoint; + + if (msgType === 'audioMessage') { + const downloadBase64 = await this.waMonitor.waInstances[instance.instanceName].getBase64FromMediaMessage({ + message: { + ...msg, + }, + }); + + const random = Math.random().toString(36).substring(7); + const nameFile = `${random}.ogg`; + + const fileData = Buffer.from(downloadBase64.base64, 'base64'); + + const fileName = `${path.join( + this.waMonitor.waInstances[instance.instanceName].storePath, + 'temp', + `${nameFile}`, + )}`; + + writeFileSync(fileName, fileData, 'utf8'); + + const urlServer = this.configService.get('SERVER').URL; + + const url = `${urlServer}/store/temp/${nameFile}`; + + data = { + waNumber: waNumber, + audioUrl: url, + queryNumber: remoteJid.split('@')[0], + answerByAudio: answerByAudio, + }; + endpoint = 'processMessageAudio'; + } else { + data = { + waNumber: waNumber, + question: content, + queryNumber: remoteJid.split('@')[0], + answerByAudio: answerByAudio, + }; + endpoint = 'processMessageText'; + } + + const request = await axios.post(`${url}/${endpoint}`, data, { + headers: { + Authorization: `${token}`, + }, + }); + + const answer = request.data?.answer; + + const type = request.data?.type; + + const characterCount = request.data?.characterCount; + + if (answer) { + if (type === 'text') { + this.waMonitor.waInstances[instance.instanceName].textMessage({ + number: remoteJid.split('@')[0], + options: { + delay: this.calculateTypingTime(answer) * 1000 || 1000, + presence: 'composing', + linkPreview: false, + quoted: { + key: msg.key, + message: msg.message, + }, + }, + textMessage: { + text: answer, + }, + }); + } + + if (type === 'audio') { + this.waMonitor.waInstances[instance.instanceName].audioWhatsapp({ + number: remoteJid.split('@')[0], + options: { + delay: characterCount ? this.convertToMilliseconds(characterCount) * 1000 || 1000 : 1000, + presence: 'recording', + encoding: true, + }, + audioMessage: { + audio: answer, + }, + }); + } + + if (this.getRegexPatterns().some((pattern) => pattern.test(answer))) { + this.waMonitor.waInstances[instance.instanceName].sendDataWebhook(Events.CHAMA_AI_ACTION, { + remoteJid: remoteJid, + message: msg, + answer: answer, + action: 'transfer', + }); + } + } + } +} diff --git a/src/whatsapp/services/chatwoot.service.ts b/src/whatsapp/services/chatwoot.service.ts index decb5822..485e408d 100644 --- a/src/whatsapp/services/chatwoot.service.ts +++ b/src/whatsapp/services/chatwoot.service.ts @@ -1,18 +1,17 @@ -import { InstanceDto } from '../dto/instance.dto'; -import path from 'path'; -import { ChatwootDto } from '../dto/chatwoot.dto'; -import { WAMonitoringService } from './monitor.service'; -import { Logger } from '../../config/logger.config'; import ChatwootClient from '@figuro/chatwoot-sdk'; -import { createReadStream, readFileSync, unlinkSync, writeFileSync } from 'fs'; import axios from 'axios'; import FormData from 'form-data'; -import { SendTextDto } from '../dto/sendMessage.dto'; +import { createReadStream, readFileSync, unlinkSync, writeFileSync } from 'fs'; import mimeTypes from 'mime-types'; -import { SendAudioDto } from '../dto/sendMessage.dto'; -import { SendMediaDto } from '../dto/sendMessage.dto'; +import path from 'path'; + +import { ConfigService } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; import { ROOT_DIR } from '../../config/path.config'; -import { ConfigService, HttpServer } from '../../config/env.config'; +import { ChatwootDto } from '../dto/chatwoot.dto'; +import { InstanceDto } from '../dto/instance.dto'; +import { SendAudioDto, SendMediaDto, SendTextDto } from '../dto/sendMessage.dto'; +import { WAMonitoringService } from './monitor.service'; export class ChatwootService { private messageCacheFile: string; @@ -22,10 +21,7 @@ export class ChatwootService { private provider: any; - constructor( - private readonly waMonitor: WAMonitoringService, - private readonly configService: ConfigService, - ) { + constructor(private readonly waMonitor: WAMonitoringService, private readonly configService: ConfigService) { this.messageCache = new Set(); } @@ -56,9 +52,7 @@ export class ChatwootService { private async getProvider(instance: InstanceDto) { this.logger.verbose('get provider to instance: ' + instance.instanceName); try { - const provider = await this.waMonitor.waInstances[ - instance.instanceName - ].findChatwoot(); + const provider = await this.waMonitor.waInstances[instance.instanceName].findChatwoot(); if (!provider) { this.logger.warn('provider not found'); @@ -154,6 +148,7 @@ export class ChatwootService { inboxName: string, webhookUrl: string, qrcode: boolean, + number: string, ) { this.logger.verbose('init instance chatwoot: ' + instance.instanceName); @@ -170,9 +165,7 @@ export class ChatwootService { }); this.logger.verbose('check duplicate inbox'); - const checkDuplicate = findInbox.payload - .map((inbox) => inbox.name) - .includes(inboxName); + const checkDuplicate = findInbox.payload.map((inbox) => inbox.name).includes(inboxName); let inboxId: number; @@ -218,6 +211,7 @@ export class ChatwootService { inboxId, false, 'EvolutionAPI', + 'https://evolution-api.com/files/evolution-api-favicon.png', )) as any); if (!contact) { @@ -229,12 +223,18 @@ export class ChatwootService { if (qrcode) { this.logger.verbose('create conversation in chatwoot'); + const data = { + contact_id: contactId.toString(), + inbox_id: inboxId.toString(), + }; + + if (this.provider.conversation_pending) { + data['status'] = 'pending'; + } + const conversation = await client.conversations.create({ accountId: this.provider.account_id, - data: { - contact_id: contactId.toString(), - inbox_id: inboxId.toString(), - }, + data, }); if (!conversation) { @@ -243,11 +243,18 @@ export class ChatwootService { } this.logger.verbose('create message for init instance in chatwoot'); + + let contentMsg = 'init'; + + if (number) { + contentMsg = `init:${number}`; + } + const message = await client.messages.create({ accountId: this.provider.account_id, conversationId: conversation.id, data: { - content: '/init', + content: contentMsg, message_type: 'outgoing', }, }); @@ -269,6 +276,7 @@ export class ChatwootService { isGroup: boolean, name?: string, avatar_url?: string, + jid?: string, ) { this.logger.verbose('create contact to instance: ' + instance.instanceName); @@ -286,6 +294,7 @@ export class ChatwootService { inbox_id: inboxId, name: name || phoneNumber, phone_number: `+${phoneNumber}`, + identifier: jid, avatar_url: avatar_url, }; } else { @@ -410,28 +419,25 @@ export class ChatwootService { if (isGroup) { this.logger.verbose('get group name'); - const group = await this.waMonitor.waInstances[ - instance.instanceName - ].client.groupMetadata(chatId); + const group = await this.waMonitor.waInstances[instance.instanceName].client.groupMetadata(chatId); nameContact = `${group.subject} (GROUP)`; this.logger.verbose('find or create participant in chatwoot'); - const picture_url = await this.waMonitor.waInstances[ - instance.instanceName - ].profilePicture(body.key.participant.split('@')[0]); - - const findParticipant = await this.findContact( - instance, + const picture_url = await this.waMonitor.waInstances[instance.instanceName].profilePicture( body.key.participant.split('@')[0], ); + const findParticipant = await this.findContact(instance, body.key.participant.split('@')[0]); + if (findParticipant) { - await this.updateContact(instance, findParticipant.id, { - name: body.pushName, - avatar_url: picture_url.profilePictureUrl || null, - }); + if (!findParticipant.name || findParticipant.name === chatId) { + await this.updateContact(instance, findParticipant.id, { + name: body.pushName, + avatar_url: picture_url.profilePictureUrl || null, + }); + } } else { await this.createContact( instance, @@ -440,28 +446,25 @@ export class ChatwootService { false, body.pushName, picture_url.profilePictureUrl || null, + body.key.participant, ); } } this.logger.verbose('find or create contact in chatwoot'); - const picture_url = await this.waMonitor.waInstances[ - instance.instanceName - ].profilePicture(chatId); + const picture_url = await this.waMonitor.waInstances[instance.instanceName].profilePicture(chatId); const findContact = await this.findContact(instance, chatId); let contact: any; if (body.key.fromMe) { - contact = findContact; - } else { if (findContact) { contact = await this.updateContact(instance, findContact.id, { - name: nameContact, avatar_url: picture_url.profilePictureUrl || null, }); } else { + const jid = isGroup ? null : body.key.remoteJid; contact = await this.createContact( instance, chatId, @@ -469,6 +472,31 @@ export class ChatwootService { isGroup, nameContact, picture_url.profilePictureUrl || null, + jid, + ); + } + } else { + if (findContact) { + if (!findContact.name || findContact.name === chatId) { + contact = await this.updateContact(instance, findContact.id, { + name: nameContact, + avatar_url: picture_url.profilePictureUrl || null, + }); + } else { + contact = await this.updateContact(instance, findContact.id, { + avatar_url: picture_url.profilePictureUrl || null, + }); + } + } else { + const jid = isGroup ? null : body.key.remoteJid; + contact = await this.createContact( + instance, + chatId, + filterInbox.id, + isGroup, + nameContact, + picture_url.profilePictureUrl || null, + jid, ); } } @@ -478,8 +506,7 @@ export class ChatwootService { return null; } - const contactId = - contact?.payload?.id || contact?.payload?.contact?.id || contact?.id; + const contactId = contact?.payload?.id || contact?.payload?.contact?.id || contact?.id; if (!body.key.fromMe && contact.name === chatId && nameContact !== chatId) { this.logger.verbose('update contact name in chatwoot'); @@ -495,11 +522,26 @@ export class ChatwootService { })) as any; if (contactConversations) { + let conversation: any; + if (this.provider.reopen_conversation) { + conversation = contactConversations.payload.find((conversation) => conversation.inbox_id == filterInbox.id); + + if (this.provider.conversation_pending) { + await client.conversations.toggleStatus({ + accountId: this.provider.account_id, + conversationId: conversation.id, + data: { + status: 'pending', + }, + }); + } + } else { + conversation = contactConversations.payload.find( + (conversation) => conversation.status !== 'resolved' && conversation.inbox_id == filterInbox.id, + ); + } this.logger.verbose('return conversation if exists'); - const conversation = contactConversations.payload.find( - (conversation) => - conversation.status !== 'resolved' && conversation.inbox_id == filterInbox.id, - ); + if (conversation) { this.logger.verbose('conversation found'); return conversation.id; @@ -507,12 +549,18 @@ export class ChatwootService { } this.logger.verbose('create conversation in chatwoot'); + const data = { + contact_id: contactId.toString(), + inbox_id: filterInbox.id.toString(), + }; + + if (this.provider.conversation_pending) { + data['status'] = 'pending'; + } + const conversation = await client.conversations.create({ accountId: this.provider.account_id, - data: { - contact_id: `${contactId}`, - inbox_id: `${filterInbox.id}`, - }, + data, }); if (!conversation) { @@ -548,9 +596,7 @@ export class ChatwootService { } this.logger.verbose('find inbox by name'); - const findByName = inbox.payload.find( - (inbox) => inbox.name === instance.instanceName, - ); + const findByName = inbox.payload.find((inbox) => inbox.name === instance.instanceName.split('-cwId-')[0]); if (!findByName) { this.logger.warn('inbox not found'); @@ -652,8 +698,7 @@ export class ChatwootService { this.logger.verbose('find conversation by contact id'); const conversation = findConversation.data.payload.find( - (conversation) => - conversation?.meta?.sender?.id === contact.id && conversation.status === 'open', + (conversation) => conversation?.meta?.sender?.id === contact.id && conversation.status === 'open', ); if (!conversation) { @@ -773,8 +818,7 @@ export class ChatwootService { this.logger.verbose('find conversation by contact id'); const conversation = findConversation.data.payload.find( - (conversation) => - conversation?.meta?.sender?.id === contact.id && conversation.status === 'open', + (conversation) => conversation?.meta?.sender?.id === contact.id && conversation.status === 'open', ); if (!conversation) { @@ -824,12 +868,7 @@ export class ChatwootService { } } - public async sendAttachment( - waInstance: any, - number: string, - media: any, - caption?: string, - ) { + public async sendAttachment(waInstance: any, number: string, media: any, caption?: string) { this.logger.verbose('send attachment to instance: ' + waInstance.instanceName); try { @@ -910,9 +949,10 @@ export class ChatwootService { public async receiveWebhook(instance: InstanceDto, body: any) { try { - this.logger.verbose( - 'receive webhook to chatwoot instance: ' + instance.instanceName, - ); + // espera 500ms para evitar duplicidade de mensagens + await new Promise((resolve) => setTimeout(resolve, 500)); + + this.logger.verbose('receive webhook to chatwoot instance: ' + instance.instanceName); const client = await this.clientCw(instance); if (!client) { @@ -921,12 +961,11 @@ export class ChatwootService { } this.logger.verbose('check if is bot'); - if (!body?.conversation || body.private) return { message: 'bot' }; + if (!body?.conversation || body.private || body.event === 'message_updated') return { message: 'bot' }; this.logger.verbose('check if is group'); const chatId = - body.conversation.meta.sender?.phone_number?.replace('+', '') || - body.conversation.meta.sender?.identifier; + body.conversation.meta.sender?.phone_number?.replace('+', '') || body.conversation.meta.sender?.identifier; const messageReceived = body.content; const senderName = body?.sender?.name; const waInstance = this.waMonitor.waInstances[instance.instanceName]; @@ -936,20 +975,17 @@ export class ChatwootService { const command = messageReceived.replace('/', ''); - if (command === 'init' || command === 'iniciar') { + if (command.includes('init') || command.includes('iniciar')) { this.logger.verbose('command init found'); const state = waInstance?.connectionStatus?.state; if (state !== 'open') { this.logger.verbose('connect to whatsapp'); - await waInstance.connectToWhatsapp(); + const number = command.split(':')[1]; + await waInstance.connectToWhatsapp(number); } else { this.logger.verbose('whatsapp already connected'); - await this.createBotMessage( - instance, - `🚨 ${body.inbox.name} instance is connected.`, - 'incoming', - ); + await this.createBotMessage(instance, `🚨 ${body.inbox.name} instance is connected.`, 'incoming'); } } @@ -960,20 +996,12 @@ export class ChatwootService { if (!state) { this.logger.verbose('state not found'); - await this.createBotMessage( - instance, - `⚠️ ${body.inbox.name} instance not found.`, - 'incoming', - ); + await this.createBotMessage(instance, `⚠️ ${body.inbox.name} instance not found.`, 'incoming'); } if (state) { this.logger.verbose('state: ' + state + ' found'); - await this.createBotMessage( - instance, - `⚠️ ${body.inbox.name} instance status: *${state}*`, - 'incoming', - ); + await this.createBotMessage(instance, `⚠️ ${body.inbox.name} instance status: *${state}*`, 'incoming'); } } @@ -989,48 +1017,12 @@ export class ChatwootService { await waInstance?.client?.logout('Log out instance: ' + instance.instanceName); await waInstance?.client?.ws?.close(); } - - if (command.includes('#inbox_whatsapp')) { - const urlServer = this.configService.get('SERVER').URL; - const apiKey = this.configService.get('AUTHENTICATION').API_KEY.KEY; - - const data = { - instanceName: command.split(':')[1], - qrcode: true, - chatwoot_account_id: this.provider.account_id, - chatwoot_token: this.provider.token, - chatwoot_url: this.provider.url, - chatwoot_sign_msg: this.provider.sign_msg, - }; - - const config = { - method: 'post', - maxBodyLength: Infinity, - url: `${urlServer}/instance/create`, - headers: { - 'Content-Type': 'application/json', - apikey: apiKey, - }, - data: data, - }; - - await axios.request(config); - } } - if ( - body.message_type === 'outgoing' && - body?.conversation?.messages?.length && - chatId !== '123456' - ) { + if (body.message_type === 'outgoing' && body?.conversation?.messages?.length && chatId !== '123456') { this.logger.verbose('check if is group'); - this.messageCacheFile = path.join( - ROOT_DIR, - 'store', - 'chatwoot', - `${instance.instanceName}_cache.txt`, - ); + this.messageCacheFile = path.join(ROOT_DIR, 'store', 'chatwoot', `${instance.instanceName}_cache.txt`); this.logger.verbose('cache file path: ' + this.messageCacheFile); this.messageCache = this.loadMessageCache(); @@ -1051,9 +1043,7 @@ export class ChatwootService { if (senderName === null || senderName === undefined) { formatText = messageReceived; } else { - formatText = this.provider.sign_msg - ? `*${senderName}:*\n\n${messageReceived}` - : messageReceived; + formatText = this.provider.sign_msg ? `*${senderName}:*\n${messageReceived}` : messageReceived; } for (const message of body.conversation.messages) { @@ -1067,12 +1057,7 @@ export class ChatwootService { formatText = null; } - await this.sendAttachment( - waInstance, - chatId, - attachment.data_url, - formatText, - ); + await this.sendAttachment(waInstance, chatId, attachment.data_url, formatText); } } else { this.logger.verbose('message is text'); @@ -1094,17 +1079,13 @@ export class ChatwootService { } } - if ( - body.message_type === 'template' && - body.content_type === 'input_csat' && - body.event === 'message_created' - ) { - this.logger.verbose('check if is csat'); + if (body.message_type === 'template' && body.event === 'message_created') { + this.logger.verbose('check if is template'); const data: SendTextDto = { number: chatId, textMessage: { - text: body.content, + text: body.content.replace(/\\\r\n|\\\n|\n/g, '\n'), }, options: { delay: 1200, @@ -1153,13 +1134,14 @@ export class ChatwootService { videoMessage: msg.videoMessage?.caption, extendedTextMessage: msg.extendedTextMessage?.text, messageContextInfo: msg.messageContextInfo?.stanzaId, - stickerMessage: msg.stickerMessage?.fileSha256.toString('base64'), + stickerMessage: undefined, documentMessage: msg.documentMessage?.caption, - documentWithCaptionMessage: - msg.documentWithCaptionMessage?.message?.documentMessage?.caption, + documentWithCaptionMessage: msg.documentWithCaptionMessage?.message?.documentMessage?.caption, audioMessage: msg.audioMessage?.caption, contactMessage: msg.contactMessage?.vcard, contactsArrayMessage: msg.contactsArrayMessage, + locationMessage: msg.locationMessage, + liveLocationMessage: msg.liveLocationMessage, }; this.logger.verbose('type message: ' + types); @@ -1173,6 +1155,21 @@ export class ChatwootService { const result = typeKey ? types[typeKey] : undefined; + if (typeKey === 'locationMessage' || typeKey === 'liveLocationMessage') { + const latitude = result.degreesLatitude; + const longitude = result.degreesLongitude; + + const formattedLocation = `**Location:** + **latitude:** ${latitude} + **longitude:** ${longitude} + https://www.google.com/maps/search/?api=1&query=${latitude},${longitude} + `; + + this.logger.verbose('message content: ' + formattedLocation); + + return formattedLocation; + } + if (typeKey === 'contactMessage') { const vCardData = result.split('\n'); const contactInfo = {}; @@ -1276,6 +1273,16 @@ export class ChatwootService { return; } + this.logger.verbose('get conversation message'); + const bodyMessage = await this.getConversationMessage(body.message); + + const isMedia = this.isMediaMessage(body.message); + + if (!bodyMessage && !isMedia) { + this.logger.warn('no body message found'); + return; + } + this.logger.verbose('get conversation in chatwoot'); const getConversion = await this.createConversation(instance, body); @@ -1288,18 +1295,8 @@ export class ChatwootService { this.logger.verbose('message type: ' + messageType); - const isMedia = this.isMediaMessage(body.message); - this.logger.verbose('is media: ' + isMedia); - this.logger.verbose('get conversation message'); - const bodyMessage = await this.getConversationMessage(body.message); - - if (!bodyMessage && !isMedia) { - this.logger.warn('no body message found'); - return; - } - this.logger.verbose('check if is media'); if (isMedia) { this.logger.verbose('message is media'); @@ -1333,31 +1330,21 @@ export class ChatwootService { if (!body.key.fromMe) { this.logger.verbose('message is not from me'); - content = `**${participantName}**\n\n${bodyMessage}`; + content = `**${participantName}:**\n\n${bodyMessage}`; } else { this.logger.verbose('message is from me'); content = `${bodyMessage}`; } this.logger.verbose('send data to chatwoot'); - const send = await this.sendData( - getConversion, - fileName, - messageType, - content, - ); + const send = await this.sendData(getConversion, fileName, messageType, content); if (!send) { this.logger.warn('message not sent'); return; } - this.messageCacheFile = path.join( - ROOT_DIR, - 'store', - 'chatwoot', - `${instance.instanceName}_cache.txt`, - ); + this.messageCacheFile = path.join(ROOT_DIR, 'store', 'chatwoot', `${instance.instanceName}_cache.txt`); this.messageCache = this.loadMessageCache(); @@ -1371,24 +1358,14 @@ export class ChatwootService { this.logger.verbose('message is not group'); this.logger.verbose('send data to chatwoot'); - const send = await this.sendData( - getConversion, - fileName, - messageType, - bodyMessage, - ); + const send = await this.sendData(getConversion, fileName, messageType, bodyMessage); if (!send) { this.logger.warn('message not sent'); return; } - this.messageCacheFile = path.join( - ROOT_DIR, - 'store', - 'chatwoot', - `${instance.instanceName}_cache.txt`, - ); + this.messageCacheFile = path.join(ROOT_DIR, 'store', 'chatwoot', `${instance.instanceName}_cache.txt`); this.messageCache = this.loadMessageCache(); @@ -1417,24 +1394,14 @@ export class ChatwootService { } this.logger.verbose('send data to chatwoot'); - const send = await this.createMessage( - instance, - getConversion, - content, - messageType, - ); + const send = await this.createMessage(instance, getConversion, content, messageType); if (!send) { this.logger.warn('message not sent'); return; } - this.messageCacheFile = path.join( - ROOT_DIR, - 'store', - 'chatwoot', - `${instance.instanceName}_cache.txt`, - ); + this.messageCacheFile = path.join(ROOT_DIR, 'store', 'chatwoot', `${instance.instanceName}_cache.txt`); this.messageCache = this.loadMessageCache(); @@ -1448,24 +1415,14 @@ export class ChatwootService { this.logger.verbose('message is not group'); this.logger.verbose('send data to chatwoot'); - const send = await this.createMessage( - instance, - getConversion, - bodyMessage, - messageType, - ); + const send = await this.createMessage(instance, getConversion, bodyMessage, messageType); if (!send) { this.logger.warn('message not sent'); return; } - this.messageCacheFile = path.join( - ROOT_DIR, - 'store', - 'chatwoot', - `${instance.instanceName}_cache.txt`, - ); + this.messageCacheFile = path.join(ROOT_DIR, 'store', 'chatwoot', `${instance.instanceName}_cache.txt`); this.messageCache = this.loadMessageCache(); @@ -1494,37 +1451,30 @@ export class ChatwootService { await this.createBotMessage(instance, msgStatus, 'incoming'); } - if (event === 'connection.update') { - this.logger.verbose('event connection.update'); + // if (event === 'connection.update') { + // this.logger.verbose('event connection.update'); - if (body.status === 'open') { - const msgConnection = `🚀 Connection successfully established!`; + // if (body.status === 'open') { + // const msgConnection = `🚀 Connection successfully established!`; - this.logger.verbose('send message to chatwoot'); - await this.createBotMessage(instance, msgConnection, 'incoming'); - } - } + // this.logger.verbose('send message to chatwoot'); + // await this.createBotMessage(instance, msgConnection, 'incoming'); + // } + // } if (event === 'qrcode.updated') { this.logger.verbose('event qrcode.updated'); if (body.statusCode === 500) { this.logger.verbose('qrcode error'); - const erroQRcode = `🚨 QRCode generation limit reached, to generate a new QRCode, send the /init message again.`; + const erroQRcode = `🚨 QRCode generation limit reached, to generate a new QRCode, send the 'init' message again.`; this.logger.verbose('send message to chatwoot'); return await this.createBotMessage(instance, erroQRcode, 'incoming'); } else { this.logger.verbose('qrcode success'); - const fileData = Buffer.from( - body?.qrcode.base64.replace('data:image/png;base64,', ''), - 'base64', - ); + const fileData = Buffer.from(body?.qrcode.base64.replace('data:image/png;base64,', ''), 'base64'); - const fileName = `${path.join( - waInstance?.storePath, - 'temp', - `${`${instance}.png`}`, - )}`; + const fileName = `${path.join(waInstance?.storePath, 'temp', `${`${instance}.png`}`)}`; this.logger.verbose('temp file name: ' + fileName); @@ -1532,14 +1482,18 @@ export class ChatwootService { writeFileSync(fileName, fileData, 'utf8'); this.logger.verbose('send qrcode to chatwoot'); - await this.createBotQr( - instance, - 'QRCode successfully generated!', - 'incoming', - fileName, - ); + await this.createBotQr(instance, 'QRCode successfully generated!', 'incoming', fileName); - const msgQrCode = `⚡️ QRCode successfully generated!\n\nScan this QR code within the next 40 seconds:`; + let msgQrCode = `⚡️ QRCode successfully generated!\n\nScan this QR code within the next 40 seconds.`; + + if (body?.qrcode?.pairingCode) { + msgQrCode = + msgQrCode + + `\n\n*Pairing Code:* ${body.qrcode.pairingCode.substring(0, 4)}-${body.qrcode.pairingCode.substring( + 4, + 8, + )}`; + } this.logger.verbose('send message to chatwoot'); await this.createBotMessage(instance, msgQrCode, 'incoming'); diff --git a/src/whatsapp/services/monitor.service.ts b/src/whatsapp/services/monitor.service.ts index 8b347c21..69aae5aa 100644 --- a/src/whatsapp/services/monitor.service.ts +++ b/src/whatsapp/services/monitor.service.ts @@ -1,23 +1,26 @@ -import { opendirSync, readdirSync, rmSync } from 'fs'; -import { WAStartupService } from './whatsapp.service'; -import { INSTANCE_DIR, STORE_DIR } from '../../config/path.config'; -import EventEmitter2 from 'eventemitter2'; -import { join } from 'path'; -import { Logger } from '../../config/logger.config'; -import { - Auth, - ConfigService, - Database, - DelInstance, - HttpServer, - Redis, -} from '../../config/env.config'; -import { RepositoryBroker } from '../repository/repository.manager'; -import { NotFoundException } from '../../exceptions'; -import { Db } from 'mongodb'; -import { initInstance } from '../whatsapp.module'; -import { RedisCache } from '../../db/redis.client'; import { execSync } from 'child_process'; +import EventEmitter2 from 'eventemitter2'; +import { opendirSync, readdirSync, rmSync } from 'fs'; +import { Db } from 'mongodb'; +import { join } from 'path'; + +import { Auth, ConfigService, Database, DelInstance, HttpServer, Redis } from '../../config/env.config'; +import { Logger } from '../../config/logger.config'; +import { INSTANCE_DIR, STORE_DIR } from '../../config/path.config'; +import { NotFoundException } from '../../exceptions'; +import { dbserver } from '../../libs/db.connect'; +import { RedisCache } from '../../libs/redis.client'; +import { + AuthModel, + ChatwootModel, + ContactModel, + MessageModel, + MessageUpModel, + SettingsModel, + WebhookModel, +} from '../models'; +import { RepositoryBroker } from '../repository/repository.manager'; +import { WAStartupService } from './whatsapp.service'; export class WAMonitoringService { constructor( @@ -45,22 +48,20 @@ export class WAMonitoringService { private dbInstance: Db; + private dbStore = dbserver; + private readonly logger = new Logger(WAMonitoringService.name); public readonly waInstances: Record = {}; public delInstanceTime(instance: string) { const time = this.configService.get('DEL_INSTANCE'); if (typeof time === 'number' && time > 0) { - this.logger.verbose( - `Instance "${instance}" don't have connection, will be removed in ${time} minutes`, - ); + this.logger.verbose(`Instance "${instance}" don't have connection, will be removed in ${time} minutes`); setTimeout(async () => { if (this.waInstances[instance]?.connectionStatus?.state !== 'open') { if (this.waInstances[instance]?.connectionStatus?.state === 'connecting') { - await this.waInstances[instance]?.client?.logout( - 'Log out instance: ' + instance, - ); + await this.waInstances[instance]?.client?.logout('Log out instance: ' + instance); this.waInstances[instance]?.client?.ws?.close(); this.waInstances[instance]?.client?.end(undefined); delete this.waInstances[instance]; @@ -90,10 +91,10 @@ export class WAMonitoringService { const findChatwoot = await this.waInstances[key].findChatwoot(); - if (findChatwoot.enabled) { + if (findChatwoot && findChatwoot.enabled) { chatwoot = { ...findChatwoot, - webhook_url: `${urlServer}/chatwoot/webhook/${key}`, + webhook_url: `${urlServer}/chatwoot/webhook/${encodeURIComponent(key)}`, }; } @@ -112,21 +113,16 @@ export class WAMonitoringService { }; if (this.configService.get('AUTHENTICATION').EXPOSE_IN_FETCH_INSTANCES) { - instanceData.instance['serverUrl'] = - this.configService.get('SERVER').URL; + instanceData.instance['serverUrl'] = this.configService.get('SERVER').URL; - instanceData.instance['apikey'] = ( - await this.repository.auth.find(key) - ).apikey; + instanceData.instance['apikey'] = (await this.repository.auth.find(key))?.apikey; instanceData.instance['chatwoot'] = chatwoot; } instances.push(instanceData); } else { - this.logger.verbose( - 'instance: ' + key + ' - connectionStatus: ' + value.connectionStatus.state, - ); + this.logger.verbose('instance: ' + key + ' - connectionStatus: ' + value.connectionStatus.state); const instanceData = { instance: { @@ -136,12 +132,9 @@ export class WAMonitoringService { }; if (this.configService.get('AUTHENTICATION').EXPOSE_IN_FETCH_INSTANCES) { - instanceData.instance['serverUrl'] = - this.configService.get('SERVER').URL; + instanceData.instance['serverUrl'] = this.configService.get('SERVER').URL; - instanceData.instance['apikey'] = ( - await this.repository.auth.find(key) - ).apikey; + instanceData.instance['apikey'] = (await this.repository.auth.find(key))?.apikey; instanceData.instance['chatwoot'] = chatwoot; } @@ -164,15 +157,11 @@ export class WAMonitoringService { collections.forEach(async (collection) => { const name = collection.namespace.replace(/^[\w-]+./, ''); await this.dbInstance.collection(name).deleteMany({ - $or: [ - { _id: { $regex: /^app.state.*/ } }, - { _id: { $regex: /^session-.*/ } }, - ], + $or: [{ _id: { $regex: /^app.state.*/ } }, { _id: { $regex: /^session-.*/ } }], }); this.logger.verbose('instance files deleted: ' + name); }); - } else if (this.redis.ENABLED) { - } else { + } else if (!this.redis.ENABLED) { const dir = opendirSync(INSTANCE_DIR, { encoding: 'utf-8' }); for await (const dirent of dir) { if (dirent.isDirectory()) { @@ -210,6 +199,7 @@ export class WAMonitoringService { this.logger.verbose('cleaning up instance in redis: ' + instanceName); this.cache.reference = instanceName; await this.cache.delAll(); + this.cache.disconnect(); return; } @@ -218,11 +208,8 @@ export class WAMonitoringService { } public async cleaningStoreFiles(instanceName: string) { - this.logger.verbose('cleaning store files instance: ' + instanceName); - if (!this.db.ENABLED) { - const instance = this.waInstances[instanceName]; - + this.logger.verbose('cleaning store files instance: ' + instanceName); rmSync(join(INSTANCE_DIR, instanceName), { recursive: true, force: true }); execSync(`rm -rf ${join(STORE_DIR, 'chats', instanceName)}`); @@ -233,18 +220,34 @@ export class WAMonitoringService { execSync(`rm -rf ${join(STORE_DIR, 'auth', 'apikey', instanceName + '.json')}`); execSync(`rm -rf ${join(STORE_DIR, 'webhook', instanceName + '.json')}`); execSync(`rm -rf ${join(STORE_DIR, 'chatwoot', instanceName + '*')}`); + execSync(`rm -rf ${join(STORE_DIR, 'chamaai', instanceName + '*')}`); + execSync(`rm -rf ${join(STORE_DIR, 'proxy', instanceName + '*')}`); + execSync(`rm -rf ${join(STORE_DIR, 'rabbitmq', instanceName + '*')}`); + execSync(`rm -rf ${join(STORE_DIR, 'typebot', instanceName + '*')}`); + execSync(`rm -rf ${join(STORE_DIR, 'websocket', instanceName + '*')}`); + execSync(`rm -rf ${join(STORE_DIR, 'settings', instanceName + '*')}`); + + return; } + + this.logger.verbose('cleaning store database instance: ' + instanceName); + + await AuthModel.deleteMany({ owner: instanceName }); + await ContactModel.deleteMany({ owner: instanceName }); + await MessageModel.deleteMany({ owner: instanceName }); + await MessageUpModel.deleteMany({ owner: instanceName }); + await AuthModel.deleteMany({ _id: instanceName }); + await WebhookModel.deleteMany({ _id: instanceName }); + await ChatwootModel.deleteMany({ _id: instanceName }); + await SettingsModel.deleteMany({ _id: instanceName }); + + return; } public async loadInstance() { this.logger.verbose('load instances'); const set = async (name: string) => { - const instance = new WAStartupService( - this.configService, - this.eventEmitter, - this.repository, - this.cache, - ); + const instance = new WAStartupService(this.configService, this.eventEmitter, this.repository, this.cache); instance.instanceName = name; this.logger.verbose('instance loaded: ' + name); @@ -264,8 +267,8 @@ export class WAMonitoringService { keys.forEach(async (k) => await set(k.split(':')[1])); } else { this.logger.verbose('no instance keys found'); - initInstance(); } + this.cache.disconnect(); return; } @@ -275,12 +278,9 @@ export class WAMonitoringService { const collections: any[] = await this.dbInstance.collections(); if (collections.length > 0) { this.logger.verbose('reading collections and setting instances'); - collections.forEach( - async (coll) => await set(coll.namespace.replace(/^[\w-]+\./, '')), - ); + collections.forEach(async (coll) => await set(coll.namespace.replace(/^[\w-]+\./, ''))); } else { this.logger.verbose('no collections found'); - initInstance(); } return; } @@ -301,7 +301,6 @@ export class WAMonitoringService { await set(dirent.name); } else { this.logger.verbose('no instance files found'); - initInstance(); } } } catch (error) { @@ -315,7 +314,9 @@ export class WAMonitoringService { try { this.logger.verbose('instance: ' + instanceName + ' - removing from memory'); this.waInstances[instanceName] = undefined; - } catch {} + } catch (error) { + this.logger.error(error); + } try { this.logger.verbose('request cleaning up instance: ' + instanceName); @@ -340,11 +341,14 @@ export class WAMonitoringService { this.logger.verbose('checking instances without connection'); this.eventEmitter.on('no.connection', async (instanceName) => { try { - this.logger.verbose('instance: ' + instanceName + ' - removing from memory'); - this.waInstances[instanceName] = undefined; + this.logger.verbose('logging out instance: ' + instanceName); + await this.waInstances[instanceName]?.client?.logout('Log out instance: ' + instanceName); - this.logger.verbose('request cleaning up instance: ' + instanceName); - this.cleaningUp(instanceName); + this.logger.verbose('close connection instance: ' + instanceName); + this.waInstances[instanceName]?.client?.ws?.close(); + + this.waInstances[instanceName].instance.qrcode = { count: 0 }; + this.waInstances[instanceName].stateConnection.state = 'close'; } catch (error) { this.logger.error({ localError: 'noConnection', diff --git a/src/whatsapp/services/proxy.service.ts b/src/whatsapp/services/proxy.service.ts new file mode 100644 index 00000000..c6631671 --- /dev/null +++ b/src/whatsapp/services/proxy.service.ts @@ -0,0 +1,33 @@ +import { Logger } from '../../config/logger.config'; +import { InstanceDto } from '../dto/instance.dto'; +import { ProxyDto } from '../dto/proxy.dto'; +import { ProxyRaw } from '../models'; +import { WAMonitoringService } from './monitor.service'; + +export class ProxyService { + constructor(private readonly waMonitor: WAMonitoringService) {} + + private readonly logger = new Logger(ProxyService.name); + + public create(instance: InstanceDto, data: ProxyDto) { + this.logger.verbose('create proxy: ' + instance.instanceName); + this.waMonitor.waInstances[instance.instanceName].setProxy(data); + + return { proxy: { ...instance, proxy: data } }; + } + + public async find(instance: InstanceDto): Promise { + try { + this.logger.verbose('find proxy: ' + instance.instanceName); + const result = await this.waMonitor.waInstances[instance.instanceName].findProxy(); + + if (Object.keys(result).length === 0) { + throw new Error('Proxy not found'); + } + + return result; + } catch (error) { + return { enabled: false, proxy: '' }; + } + } +} diff --git a/src/whatsapp/services/rabbitmq.service.ts b/src/whatsapp/services/rabbitmq.service.ts new file mode 100644 index 00000000..a377595b --- /dev/null +++ b/src/whatsapp/services/rabbitmq.service.ts @@ -0,0 +1,35 @@ +import { Logger } from '../../config/logger.config'; +import { initQueues } from '../../libs/amqp.server'; +import { InstanceDto } from '../dto/instance.dto'; +import { RabbitmqDto } from '../dto/rabbitmq.dto'; +import { RabbitmqRaw } from '../models'; +import { WAMonitoringService } from './monitor.service'; + +export class RabbitmqService { + constructor(private readonly waMonitor: WAMonitoringService) {} + + private readonly logger = new Logger(RabbitmqService.name); + + public create(instance: InstanceDto, data: RabbitmqDto) { + this.logger.verbose('create rabbitmq: ' + instance.instanceName); + this.waMonitor.waInstances[instance.instanceName].setRabbitmq(data); + + initQueues(instance.instanceName, data.events); + return { rabbitmq: { ...instance, rabbitmq: data } }; + } + + public async find(instance: InstanceDto): Promise { + try { + this.logger.verbose('find rabbitmq: ' + instance.instanceName); + const result = await this.waMonitor.waInstances[instance.instanceName].findRabbitmq(); + + if (Object.keys(result).length === 0) { + throw new Error('Rabbitmq not found'); + } + + return result; + } catch (error) { + return { enabled: false, events: [] }; + } + } +} diff --git a/src/whatsapp/services/settings.service.ts b/src/whatsapp/services/settings.service.ts new file mode 100644 index 00000000..6815ca40 --- /dev/null +++ b/src/whatsapp/services/settings.service.ts @@ -0,0 +1,32 @@ +import { Logger } from '../../config/logger.config'; +import { InstanceDto } from '../dto/instance.dto'; +import { SettingsDto } from '../dto/settings.dto'; +import { WAMonitoringService } from './monitor.service'; + +export class SettingsService { + constructor(private readonly waMonitor: WAMonitoringService) {} + + private readonly logger = new Logger(SettingsService.name); + + public create(instance: InstanceDto, data: SettingsDto) { + this.logger.verbose('create settings: ' + instance.instanceName); + this.waMonitor.waInstances[instance.instanceName].setSettings(data); + + return { settings: { ...instance, settings: data } }; + } + + public async find(instance: InstanceDto): Promise { + try { + this.logger.verbose('find settings: ' + instance.instanceName); + const result = await this.waMonitor.waInstances[instance.instanceName].findSettings(); + + if (Object.keys(result).length === 0) { + throw new Error('Settings not found'); + } + + return result; + } catch (error) { + return { reject_call: false, msg_call: '', groups_ignore: false }; + } + } +} diff --git a/src/whatsapp/services/typebot.service.ts b/src/whatsapp/services/typebot.service.ts new file mode 100644 index 00000000..ff595c6b --- /dev/null +++ b/src/whatsapp/services/typebot.service.ts @@ -0,0 +1,521 @@ +import axios from 'axios'; + +import { Logger } from '../../config/logger.config'; +import { InstanceDto } from '../dto/instance.dto'; +import { Session, TypebotDto } from '../dto/typebot.dto'; +import { MessageRaw } from '../models'; +import { Events } from '../types/wa.types'; +import { WAMonitoringService } from './monitor.service'; + +export class TypebotService { + constructor(private readonly waMonitor: WAMonitoringService) {} + + private readonly logger = new Logger(TypebotService.name); + + public create(instance: InstanceDto, data: TypebotDto) { + this.logger.verbose('create typebot: ' + instance.instanceName); + this.waMonitor.waInstances[instance.instanceName].setTypebot(data); + + return { typebot: { ...instance, typebot: data } }; + } + + public async find(instance: InstanceDto): Promise { + try { + this.logger.verbose('find typebot: ' + instance.instanceName); + const result = await this.waMonitor.waInstances[instance.instanceName].findTypebot(); + + if (Object.keys(result).length === 0) { + throw new Error('Typebot not found'); + } + + return result; + } catch (error) { + return { enabled: false, url: '', typebot: '', expire: 0, sessions: [] }; + } + } + + public async changeStatus(instance: InstanceDto, data: any) { + const remoteJid = data.remoteJid; + const status = data.status; + + const findData = await this.find(instance); + + const session = findData.sessions.find((session) => session.remoteJid === remoteJid); + + if (session) { + if (status === 'closed') { + findData.sessions.splice(findData.sessions.indexOf(session), 1); + + const typebotData = { + enabled: true, + url: findData.url, + typebot: findData.typebot, + expire: findData.expire, + keyword_finish: findData.keyword_finish, + delay_message: findData.delay_message, + unknown_message: findData.unknown_message, + listening_from_me: findData.listening_from_me, + sessions: findData.sessions, + }; + + this.create(instance, typebotData); + + return { typebot: { ...instance, typebot: typebotData } }; + } + + findData.sessions.map((session) => { + if (session.remoteJid === remoteJid) { + session.status = status; + } + }); + } + + const typebotData = { + enabled: true, + url: findData.url, + typebot: findData.typebot, + expire: findData.expire, + keyword_finish: findData.keyword_finish, + delay_message: findData.delay_message, + unknown_message: findData.unknown_message, + listening_from_me: findData.listening_from_me, + sessions: findData.sessions, + }; + + this.create(instance, typebotData); + + this.waMonitor.waInstances[instance.instanceName].sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, { + remoteJid: remoteJid, + status: status, + url: findData.url, + typebot: findData.typebot, + session, + }); + + return { typebot: { ...instance, typebot: typebotData } }; + } + + public async startTypebot(instance: InstanceDto, data: any) { + const remoteJid = data.remoteJid; + const url = data.url; + const typebot = data.typebot; + const variables = data.variables; + + const prefilledVariables = { + remoteJid: remoteJid, + }; + + variables.forEach((variable) => { + prefilledVariables[variable.name] = variable.value; + }); + + const id = Math.floor(Math.random() * 10000000000).toString(); + + const reqData = { + sessionId: id, + startParams: { + typebot: data.typebot, + prefilledVariables: prefilledVariables, + }, + }; + + const request = await axios.post(data.url + '/api/v1/sendMessage', reqData); + + await this.sendWAMessage( + instance, + remoteJid, + request.data.messages, + request.data.input, + request.data.clientSideActions, + ); + + this.waMonitor.waInstances[instance.instanceName].sendDataWebhook(Events.TYPEBOT_START, { + remoteJid: remoteJid, + url: url, + typebot: typebot, + variables: variables, + sessionId: id, + }); + + return { + typebot: { + ...instance, + typebot: { + url: url, + remoteJid: remoteJid, + typebot: typebot, + variables: variables, + }, + }, + }; + } + + private getTypeMessage(msg: any) { + this.logger.verbose('get type message'); + + const types = { + conversation: msg.conversation, + extendedTextMessage: msg.extendedTextMessage?.text, + }; + + this.logger.verbose('type message: ' + types); + + return types; + } + + private getMessageContent(types: any) { + this.logger.verbose('get message content'); + const typeKey = Object.keys(types).find((key) => types[key] !== undefined); + + const result = typeKey ? types[typeKey] : undefined; + + this.logger.verbose('message content: ' + result); + + return result; + } + + private getConversationMessage(msg: any) { + this.logger.verbose('get conversation message'); + + const types = this.getTypeMessage(msg); + + const messageContent = this.getMessageContent(types); + + this.logger.verbose('conversation message: ' + messageContent); + + return messageContent; + } + + public async createNewSession(instance: InstanceDto, data: any) { + const id = Math.floor(Math.random() * 10000000000).toString(); + const reqData = { + sessionId: id, + startParams: { + typebot: data.typebot, + prefilledVariables: { + remoteJid: data.remoteJid, + pushName: data.pushName, + instanceName: instance.instanceName, + }, + }, + }; + + const request = await axios.post(data.url + '/api/v1/sendMessage', reqData); + + if (request.data.sessionId) { + data.sessions.push({ + remoteJid: data.remoteJid, + sessionId: `${id}-${request.data.sessionId}`, + status: 'opened', + createdAt: Date.now(), + updateAt: Date.now(), + }); + + const typebotData = { + enabled: true, + url: data.url, + typebot: data.typebot, + expire: data.expire, + keyword_finish: data.keyword_finish, + delay_message: data.delay_message, + unknown_message: data.unknown_message, + listening_from_me: data.listening_from_me, + sessions: data.sessions, + }; + + this.create(instance, typebotData); + } + + return request.data; + } + + public async sendWAMessage( + instance: InstanceDto, + remoteJid: string, + messages: any[], + input: any[], + clientSideActions: any[], + ) { + processMessages(this.waMonitor.waInstances[instance.instanceName], messages, input, clientSideActions).catch( + (err) => { + console.error('Erro ao processar mensagens:', err); + }, + ); + + function findItemAndGetSecondsToWait(array, targetId) { + if (!array) return null; + + for (const item of array) { + if (item.lastBubbleBlockId === targetId) { + return item.wait?.secondsToWaitFor; + } + } + return null; + } + + async function processMessages(instance, messages, input, clientSideActions) { + for (const message of messages) { + const wait = findItemAndGetSecondsToWait(clientSideActions, message.id); + + if (message.type === 'text') { + let formattedText = ''; + + let linkPreview = false; + + for (const richText of message.content.richText) { + for (const element of richText.children) { + let text = ''; + if (element.text) { + text = element.text; + } + + if (element.bold) { + text = `*${text}*`; + } + + if (element.italic) { + text = `_${text}_`; + } + + if (element.underline) { + text = `~${text}~`; + } + + if (element.url) { + const linkText = element.children[0].text; + text = `[${linkText}](${element.url})`; + linkPreview = true; + } + + formattedText += text; + } + formattedText += '\n'; + } + + formattedText = formattedText.replace(/\n$/, ''); + + await instance.textMessage({ + number: remoteJid.split('@')[0], + options: { + delay: wait ? wait * 1000 : instance.localTypebot.delay_message || 1000, + presence: 'composing', + linkPreview: linkPreview, + }, + textMessage: { + text: formattedText, + }, + }); + } + + if (message.type === 'image') { + await instance.mediaMessage({ + number: remoteJid.split('@')[0], + options: { + delay: wait ? wait * 1000 : instance.localTypebot.delay_message || 1000, + presence: 'composing', + }, + mediaMessage: { + mediatype: 'image', + media: message.content.url, + }, + }); + } + + if (message.type === 'video') { + await instance.mediaMessage({ + number: remoteJid.split('@')[0], + options: { + delay: wait ? wait * 1000 : instance.localTypebot.delay_message || 1000, + presence: 'composing', + }, + mediaMessage: { + mediatype: 'video', + media: message.content.url, + }, + }); + } + + if (message.type === 'audio') { + await instance.audioWhatsapp({ + number: remoteJid.split('@')[0], + options: { + delay: wait ? wait * 1000 : instance.localTypebot.delay_message || 1000, + presence: 'recording', + encoding: true, + }, + audioMessage: { + audio: message.content.url, + }, + }); + } + } + + if (input) { + if (input.type === 'choice input') { + let formattedText = ''; + + const items = input.items; + + for (const item of items) { + formattedText += `▶️ ${item.content}\n`; + } + + formattedText = formattedText.replace(/\n$/, ''); + + await instance.textMessage({ + number: remoteJid.split('@')[0], + options: { + delay: 1200, + presence: 'composing', + linkPreview: false, + }, + textMessage: { + text: formattedText, + }, + }); + } + } + } + } + + public async sendTypebot(instance: InstanceDto, remoteJid: string, msg: MessageRaw) { + const findTypebot = await this.find(instance); + const url = findTypebot.url; + const typebot = findTypebot.typebot; + const sessions = (findTypebot.sessions as Session[]) ?? []; + const expire = findTypebot.expire; + const keyword_finish = findTypebot.keyword_finish; + const delay_message = findTypebot.delay_message; + const unknown_message = findTypebot.unknown_message; + const listening_from_me = findTypebot.listening_from_me; + + const session = sessions.find((session) => session.remoteJid === remoteJid); + + if (session && expire && expire > 0) { + const now = Date.now(); + + const diff = now - session.updateAt; + + const diffInMinutes = Math.floor(diff / 1000 / 60); + + if (diffInMinutes > expire) { + sessions.splice(sessions.indexOf(session), 1); + + const data = await this.createNewSession(instance, { + url: url, + typebot: typebot, + expire: expire, + keyword_finish: keyword_finish, + delay_message: delay_message, + unknown_message: unknown_message, + listening_from_me: listening_from_me, + sessions: sessions, + remoteJid: remoteJid, + pushName: msg.pushName, + }); + + await this.sendWAMessage(instance, remoteJid, data.messages, data.input, data.clientSideActions); + + return; + } + } + + if (session && session.status !== 'opened') { + return; + } + + if (!session) { + const data = await this.createNewSession(instance, { + url: url, + typebot: typebot, + expire: expire, + keyword_finish: keyword_finish, + delay_message: delay_message, + unknown_message: unknown_message, + listening_from_me: listening_from_me, + sessions: sessions, + remoteJid: remoteJid, + pushName: msg.pushName, + }); + + await this.sendWAMessage(instance, remoteJid, data.messages, data.input, data.clientSideActions); + + return; + } + + sessions.map((session) => { + if (session.remoteJid === remoteJid) { + session.updateAt = Date.now(); + } + }); + + const typebotData = { + enabled: true, + url: url, + typebot: typebot, + expire: expire, + keyword_finish: keyword_finish, + delay_message: delay_message, + unknown_message: unknown_message, + listening_from_me: listening_from_me, + sessions, + }; + + this.create(instance, typebotData); + + const content = this.getConversationMessage(msg.message); + + if (!content) { + if (unknown_message) { + this.waMonitor.waInstances[instance.instanceName].textMessage({ + number: remoteJid.split('@')[0], + options: { + delay: delay_message || 1000, + presence: 'composing', + }, + textMessage: { + text: unknown_message, + }, + }); + } + return; + } + + if (content.toLowerCase() === keyword_finish.toLowerCase()) { + sessions.splice(sessions.indexOf(session), 1); + + const typebotData = { + enabled: true, + url: url, + typebot: typebot, + expire: expire, + keyword_finish: keyword_finish, + delay_message: delay_message, + unknown_message: unknown_message, + listening_from_me: listening_from_me, + sessions, + }; + + this.create(instance, typebotData); + + return; + } + + const reqData = { + message: content, + sessionId: session.sessionId.split('-')[1], + }; + + const request = await axios.post(url + '/api/v1/sendMessage', reqData); + + await this.sendWAMessage( + instance, + remoteJid, + request.data.messages, + request.data.input, + request.data.clientSideActions, + ); + + return; + } +} diff --git a/src/whatsapp/services/webhook.service.ts b/src/whatsapp/services/webhook.service.ts index 2370e05b..dd0a88cd 100644 --- a/src/whatsapp/services/webhook.service.ts +++ b/src/whatsapp/services/webhook.service.ts @@ -1,7 +1,7 @@ +import { Logger } from '../../config/logger.config'; import { InstanceDto } from '../dto/instance.dto'; import { WebhookDto } from '../dto/webhook.dto'; import { WAMonitoringService } from './monitor.service'; -import { Logger } from '../../config/logger.config'; export class WebhookService { constructor(private readonly waMonitor: WAMonitoringService) {} @@ -18,9 +18,7 @@ export class WebhookService { public async find(instance: InstanceDto): Promise { try { this.logger.verbose('find webhook: ' + instance.instanceName); - const result = await this.waMonitor.waInstances[ - instance.instanceName - ].findWebhook(); + const result = await this.waMonitor.waInstances[instance.instanceName].findWebhook(); if (Object.keys(result).length === 0) { throw new Error('Webhook not found'); diff --git a/src/whatsapp/services/websocket.service.ts b/src/whatsapp/services/websocket.service.ts new file mode 100644 index 00000000..20663bbf --- /dev/null +++ b/src/whatsapp/services/websocket.service.ts @@ -0,0 +1,33 @@ +import { Logger } from '../../config/logger.config'; +import { InstanceDto } from '../dto/instance.dto'; +import { WebsocketDto } from '../dto/websocket.dto'; +import { WebsocketRaw } from '../models'; +import { WAMonitoringService } from './monitor.service'; + +export class WebsocketService { + constructor(private readonly waMonitor: WAMonitoringService) {} + + private readonly logger = new Logger(WebsocketService.name); + + public create(instance: InstanceDto, data: WebsocketDto) { + this.logger.verbose('create websocket: ' + instance.instanceName); + this.waMonitor.waInstances[instance.instanceName].setWebsocket(data); + + return { websocket: { ...instance, websocket: data } }; + } + + public async find(instance: InstanceDto): Promise { + try { + this.logger.verbose('find websocket: ' + instance.instanceName); + const result = await this.waMonitor.waInstances[instance.instanceName].findWebsocket(); + + if (Object.keys(result).length === 0) { + throw new Error('Websocket not found'); + } + + return result; + } catch (error) { + return { enabled: false, events: [] }; + } + } +} diff --git a/src/whatsapp/services/whatsapp.service.ts b/src/whatsapp/services/whatsapp.service.ts index 09c78078..33f62536 100644 --- a/src/whatsapp/services/whatsapp.service.ts +++ b/src/whatsapp/services/whatsapp.service.ts @@ -1,9 +1,10 @@ +import ffmpegPath from '@ffmpeg-installer/ffmpeg'; +import { Boom } from '@hapi/boom'; import makeWASocket, { AnyMessageContent, BufferedEventData, BufferJSON, CacheStore, - makeCacheableSignalKeyStore, Chat, ConnectionState, Contact, @@ -12,11 +13,13 @@ import makeWASocket, { downloadMediaMessage, fetchLatestBaileysVersion, generateWAMessageFromContent, + getAggregateVotesInPollMessage, getContentType, getDevice, GroupMetadata, isJidGroup, isJidUser, + makeCacheableSignalKeyStore, MessageUpsertType, MiscMessageGenerationOptions, ParticipantAction, @@ -29,8 +32,24 @@ import makeWASocket, { WAMessage, WAMessageUpdate, WASocket, - getAggregateVotesInPollMessage, } from '@whiskeysockets/baileys'; +import axios from 'axios'; +import { exec, execSync } from 'child_process'; +import { arrayUnique, isBase64, isURL } from 'class-validator'; +import EventEmitter2 from 'eventemitter2'; +import fs, { existsSync, readFileSync } from 'fs'; +import Long from 'long'; +import NodeCache from 'node-cache'; +import { getMIMEType } from 'node-mime-types'; +import { release } from 'os'; +import { join } from 'path'; +import P from 'pino'; +import { ProxyAgent } from 'proxy-agent'; +import qrcode, { QRCodeToDataURLOptions } from 'qrcode'; +import qrcodeTerminal from 'qrcode-terminal'; +import sharp from 'sharp'; +import { v4 } from 'uuid'; + import { Auth, CleanStoreConf, @@ -38,31 +57,45 @@ import { ConfigSessionPhone, Database, HttpServer, + Log, QrCode, Redis, Webhook, + Websocket, } from '../../config/env.config'; -import fs from 'fs'; import { Logger } from '../../config/logger.config'; import { INSTANCE_DIR, ROOT_DIR } from '../../config/path.config'; -import { existsSync, readFileSync } from 'fs'; -import { join } from 'path'; -import axios from 'axios'; -import { v4 } from 'uuid'; -import qrcode, { QRCodeToDataURLOptions } from 'qrcode'; -import qrcodeTerminal from 'qrcode-terminal'; -import { Events, TypeMediaMessage, wa, MessageSubtype } from '../types/wa.types'; -import { Boom } from '@hapi/boom'; -import EventEmitter2 from 'eventemitter2'; -import { release } from 'os'; -import P from 'pino'; -import { execSync, exec } from 'child_process'; -import ffmpegPath from '@ffmpeg-installer/ffmpeg'; -import { RepositoryBroker } from '../repository/repository.manager'; -import { MessageRaw, MessageUpdateRaw } from '../models/message.model'; -import { ContactRaw } from '../models/contact.model'; -import { ChatRaw } from '../models/chat.model'; -import { getMIMEType } from 'node-mime-types'; +import { BadRequestException, InternalServerErrorException, NotFoundException } from '../../exceptions'; +import { getAMQP } from '../../libs/amqp.server'; +import { dbserver } from '../../libs/db.connect'; +import { RedisCache } from '../../libs/redis.client'; +import { getIO } from '../../libs/socket.server'; +import { useMultiFileAuthStateDb } from '../../utils/use-multi-file-auth-state-db'; +import { useMultiFileAuthStateRedisDb } from '../../utils/use-multi-file-auth-state-redis-db'; +import { + ArchiveChatDto, + DeleteMessage, + getBase64FromMediaMessageDto, + LastMessage, + NumberBusiness, + OnWhatsAppDto, + PrivacySettingDto, + ReadMessageDto, + WhatsAppNumberDto, +} from '../dto/chat.dto'; +import { + CreateGroupDto, + GetParticipant, + GroupDescriptionDto, + GroupInvite, + GroupJid, + GroupPictureDto, + GroupSendInvite, + GroupSubjectDto, + GroupToggleEphemeralDto, + GroupUpdateParticipantDto, + GroupUpdateSettingDto, +} from '../dto/group.dto'; import { ContactMessage, MediaMessage, @@ -73,58 +106,30 @@ import { SendListDto, SendLocationDto, SendMediaDto, - SendReactionDto, - SendTextDto, SendPollDto, - SendStickerDto, + SendReactionDto, SendStatusDto, + SendStickerDto, + SendTextDto, StatusMessage, } from '../dto/sendMessage.dto'; -import { arrayUnique, isBase64, isURL } from 'class-validator'; -import { - ArchiveChatDto, - DeleteMessage, - OnWhatsAppDto, - NumberBusiness, - PrivacySettingDto, - ReadMessageDto, - WhatsAppNumberDto, - getBase64FromMediaMessageDto, -} from '../dto/chat.dto'; -import { MessageQuery } from '../repository/message.repository'; -import { ContactQuery } from '../repository/contact.repository'; -import { - BadRequestException, - InternalServerErrorException, - NotFoundException, -} from '../../exceptions'; -import { - CreateGroupDto, - GroupInvite, - GroupJid, - GroupPictureDto, - GroupUpdateParticipantDto, - GroupUpdateSettingDto, - GroupToggleEphemeralDto, - GroupSubjectDto, - GroupDescriptionDto, - GroupSendInvite, - GetParticipant, -} from '../dto/group.dto'; -import { MessageUpQuery } from '../repository/messageUp.repository'; -import { useMultiFileAuthStateDb } from '../../utils/use-multi-file-auth-state-db'; -import Long from 'long'; -import { WebhookRaw } from '../models/webhook.model'; +import { ChamaaiRaw, ProxyRaw, RabbitmqRaw, SettingsRaw, TypebotRaw } from '../models'; +import { ChatRaw } from '../models/chat.model'; import { ChatwootRaw } from '../models/chatwoot.model'; -import { dbserver } from '../../db/db.connect'; -import NodeCache from 'node-cache'; -import { useMultiFileAuthStateRedisDb } from '../../utils/use-multi-file-auth-state-redis-db'; -import sharp from 'sharp'; -import { RedisCache } from '../../db/redis.client'; -import { Log } from '../../config/env.config'; -import ProxyAgent from 'proxy-agent'; -import { ChatwootService } from './chatwoot.service'; +import { ContactRaw } from '../models/contact.model'; +import { MessageRaw, MessageUpdateRaw } from '../models/message.model'; +import { WebhookRaw } from '../models/webhook.model'; +import { WebsocketRaw } from '../models/websocket.model'; +import { ContactQuery } from '../repository/contact.repository'; +import { MessageQuery } from '../repository/message.repository'; +import { MessageUpQuery } from '../repository/messageUp.repository'; +import { RepositoryBroker } from '../repository/repository.manager'; +import { Events, MessageSubtype, TypeMediaMessage, wa } from '../types/wa.types'; import { waMonitor } from '../whatsapp.module'; +import { ChamaaiService } from './chamaai.service'; +import { ChatwootService } from './chatwoot.service'; +//import { SocksProxyAgent } from './socks-proxy-agent'; +import { TypebotService } from './typebot.service'; export class WAStartupService { constructor( @@ -139,19 +144,31 @@ export class WAStartupService { } private readonly logger = new Logger(WAStartupService.name); - private readonly instance: wa.Instance = {}; + public readonly instance: wa.Instance = {}; public client: WASocket; private readonly localWebhook: wa.LocalWebHook = {}; private readonly localChatwoot: wa.LocalChatwoot = {}; - private stateConnection: wa.StateConnection = { state: 'close' }; + private readonly localSettings: wa.LocalSettings = {}; + private readonly localWebsocket: wa.LocalWebsocket = {}; + private readonly localRabbitmq: wa.LocalRabbitmq = {}; + public readonly localTypebot: wa.LocalTypebot = {}; + private readonly localProxy: wa.LocalProxy = {}; + private readonly localChamaai: wa.LocalChamaai = {}; + public stateConnection: wa.StateConnection = { state: 'close' }; public readonly storePath = join(ROOT_DIR, 'store'); private readonly msgRetryCounterCache: CacheStore = new NodeCache(); private readonly userDevicesCache: CacheStore = new NodeCache(); private endSession = false; private logBaileys = this.configService.get('LOG').BAILEYS; + private phoneNumber: string; + private chatwootService = new ChatwootService(waMonitor, this.configService); + private typebotService = new TypebotService(waMonitor); + + private chamaaiService = new ChamaaiService(waMonitor, this.configService); + public set instanceName(name: string) { this.logger.verbose(`Initializing instance '${name}'`); if (!name) { @@ -198,10 +215,7 @@ export class WAStartupService { this.logger.verbose('Database enabled, trying to get from database'); const collection = dbserver .getClient() - .db( - this.configService.get('DATABASE').CONNECTION.DB_PREFIX_NAME + - '-instances', - ) + .db(this.configService.get('DATABASE').CONNECTION.DB_PREFIX_NAME + '-instances') .collection(this.instanceName); const data = await collection.findOne({ _id: 'creds' }); if (data) { @@ -239,7 +253,9 @@ export class WAStartupService { public get qrCode(): wa.QrCode { this.logger.verbose('Getting qrcode'); + return { + pairingCode: this.instance.qrcode?.pairingCode, code: this.instance.qrcode?.code, base64: this.instance.qrcode?.base64, }; @@ -307,6 +323,15 @@ export class WAStartupService { this.localChatwoot.sign_msg = data?.sign_msg; this.logger.verbose(`Chatwoot sign msg: ${this.localChatwoot.sign_msg}`); + this.localChatwoot.number = data?.number; + this.logger.verbose(`Chatwoot number: ${this.localChatwoot.number}`); + + this.localChatwoot.reopen_conversation = data?.reopen_conversation; + this.logger.verbose(`Chatwoot reopen conversation: ${this.localChatwoot.reopen_conversation}`); + + this.localChatwoot.conversation_pending = data?.conversation_pending; + this.logger.verbose(`Chatwoot conversation pending: ${this.localChatwoot.conversation_pending}`); + this.logger.verbose('Chatwoot loaded'); } @@ -318,6 +343,8 @@ export class WAStartupService { this.logger.verbose(`Chatwoot url: ${data.url}`); this.logger.verbose(`Chatwoot inbox name: ${data.name_inbox}`); this.logger.verbose(`Chatwoot sign msg: ${data.sign_msg}`); + this.logger.verbose(`Chatwoot reopen conversation: ${data.reopen_conversation}`); + this.logger.verbose(`Chatwoot conversation pending: ${data.conversation_pending}`); Object.assign(this.localChatwoot, data); this.logger.verbose('Chatwoot set'); @@ -329,7 +356,7 @@ export class WAStartupService { if (!data) { this.logger.verbose('Chatwoot not found'); - throw new NotFoundException('Chatwoot not found'); + return null; } this.logger.verbose(`Chatwoot account id: ${data.account_id}`); @@ -337,6 +364,272 @@ export class WAStartupService { this.logger.verbose(`Chatwoot url: ${data.url}`); this.logger.verbose(`Chatwoot inbox name: ${data.name_inbox}`); this.logger.verbose(`Chatwoot sign msg: ${data.sign_msg}`); + this.logger.verbose(`Chatwoot reopen conversation: ${data.reopen_conversation}`); + this.logger.verbose(`Chatwoot conversation pending: ${data.conversation_pending}`); + + return data; + } + + private async loadSettings() { + this.logger.verbose('Loading settings'); + const data = await this.repository.settings.find(this.instanceName); + this.localSettings.reject_call = data?.reject_call; + this.logger.verbose(`Settings reject_call: ${this.localSettings.reject_call}`); + + this.localSettings.msg_call = data?.msg_call; + this.logger.verbose(`Settings msg_call: ${this.localSettings.msg_call}`); + + this.localSettings.groups_ignore = data?.groups_ignore; + this.logger.verbose(`Settings groups_ignore: ${this.localSettings.groups_ignore}`); + + this.localSettings.always_online = data?.always_online; + this.logger.verbose(`Settings always_online: ${this.localSettings.always_online}`); + + this.localSettings.read_messages = data?.read_messages; + this.logger.verbose(`Settings read_messages: ${this.localSettings.read_messages}`); + + this.localSettings.read_status = data?.read_status; + this.logger.verbose(`Settings read_status: ${this.localSettings.read_status}`); + + this.logger.verbose('Settings loaded'); + } + + public async setSettings(data: SettingsRaw) { + this.logger.verbose('Setting settings'); + await this.repository.settings.create(data, this.instanceName); + this.logger.verbose(`Settings reject_call: ${data.reject_call}`); + this.logger.verbose(`Settings msg_call: ${data.msg_call}`); + this.logger.verbose(`Settings groups_ignore: ${data.groups_ignore}`); + this.logger.verbose(`Settings always_online: ${data.always_online}`); + this.logger.verbose(`Settings read_messages: ${data.read_messages}`); + this.logger.verbose(`Settings read_status: ${data.read_status}`); + Object.assign(this.localSettings, data); + this.logger.verbose('Settings set'); + + this.client?.ws?.close(); + } + + public async findSettings() { + this.logger.verbose('Finding settings'); + const data = await this.repository.settings.find(this.instanceName); + + if (!data) { + this.logger.verbose('Settings not found'); + return null; + } + + this.logger.verbose(`Settings url: ${data.reject_call}`); + this.logger.verbose(`Settings msg_call: ${data.msg_call}`); + this.logger.verbose(`Settings groups_ignore: ${data.groups_ignore}`); + this.logger.verbose(`Settings always_online: ${data.always_online}`); + this.logger.verbose(`Settings read_messages: ${data.read_messages}`); + this.logger.verbose(`Settings read_status: ${data.read_status}`); + return data; + } + + private async loadWebsocket() { + this.logger.verbose('Loading websocket'); + const data = await this.repository.websocket.find(this.instanceName); + + this.localWebsocket.enabled = data?.enabled; + this.logger.verbose(`Websocket enabled: ${this.localWebsocket.enabled}`); + + this.localWebsocket.events = data?.events; + this.logger.verbose(`Websocket events: ${this.localWebsocket.events}`); + + this.logger.verbose('Websocket loaded'); + } + + public async setWebsocket(data: WebsocketRaw) { + this.logger.verbose('Setting websocket'); + await this.repository.websocket.create(data, this.instanceName); + this.logger.verbose(`Websocket events: ${data.events}`); + Object.assign(this.localWebsocket, data); + this.logger.verbose('Websocket set'); + } + + public async findWebsocket() { + this.logger.verbose('Finding websocket'); + const data = await this.repository.websocket.find(this.instanceName); + + if (!data) { + this.logger.verbose('Websocket not found'); + throw new NotFoundException('Websocket not found'); + } + + this.logger.verbose(`Websocket events: ${data.events}`); + return data; + } + + private async loadRabbitmq() { + this.logger.verbose('Loading rabbitmq'); + const data = await this.repository.rabbitmq.find(this.instanceName); + + this.localRabbitmq.enabled = data?.enabled; + this.logger.verbose(`Rabbitmq enabled: ${this.localRabbitmq.enabled}`); + + this.localRabbitmq.events = data?.events; + this.logger.verbose(`Rabbitmq events: ${this.localRabbitmq.events}`); + + this.logger.verbose('Rabbitmq loaded'); + } + + public async setRabbitmq(data: RabbitmqRaw) { + this.logger.verbose('Setting rabbitmq'); + await this.repository.rabbitmq.create(data, this.instanceName); + this.logger.verbose(`Rabbitmq events: ${data.events}`); + Object.assign(this.localRabbitmq, data); + this.logger.verbose('Rabbitmq set'); + } + + public async findRabbitmq() { + this.logger.verbose('Finding rabbitmq'); + const data = await this.repository.rabbitmq.find(this.instanceName); + + if (!data) { + this.logger.verbose('Rabbitmq not found'); + throw new NotFoundException('Rabbitmq not found'); + } + + this.logger.verbose(`Rabbitmq events: ${data.events}`); + return data; + } + + private async loadTypebot() { + this.logger.verbose('Loading typebot'); + const data = await this.repository.typebot.find(this.instanceName); + + this.localTypebot.enabled = data?.enabled; + this.logger.verbose(`Typebot enabled: ${this.localTypebot.enabled}`); + + this.localTypebot.url = data?.url; + this.logger.verbose(`Typebot url: ${this.localTypebot.url}`); + + this.localTypebot.typebot = data?.typebot; + this.logger.verbose(`Typebot typebot: ${this.localTypebot.typebot}`); + + this.localTypebot.expire = data?.expire; + this.logger.verbose(`Typebot expire: ${this.localTypebot.expire}`); + + this.localTypebot.keyword_finish = data?.keyword_finish; + this.logger.verbose(`Typebot keyword_finish: ${this.localTypebot.keyword_finish}`); + + this.localTypebot.delay_message = data?.delay_message; + this.logger.verbose(`Typebot delay_message: ${this.localTypebot.delay_message}`); + + this.localTypebot.unknown_message = data?.unknown_message; + this.logger.verbose(`Typebot unknown_message: ${this.localTypebot.unknown_message}`); + + this.localTypebot.listening_from_me = data?.listening_from_me; + this.logger.verbose(`Typebot listening_from_me: ${this.localTypebot.listening_from_me}`); + + this.localTypebot.sessions = data?.sessions; + + this.logger.verbose('Typebot loaded'); + } + + public async setTypebot(data: TypebotRaw) { + this.logger.verbose('Setting typebot'); + await this.repository.typebot.create(data, this.instanceName); + this.logger.verbose(`Typebot typebot: ${data.typebot}`); + this.logger.verbose(`Typebot expire: ${data.expire}`); + this.logger.verbose(`Typebot keyword_finish: ${data.keyword_finish}`); + this.logger.verbose(`Typebot delay_message: ${data.delay_message}`); + this.logger.verbose(`Typebot unknown_message: ${data.unknown_message}`); + this.logger.verbose(`Typebot listening_from_me: ${data.listening_from_me}`); + Object.assign(this.localTypebot, data); + this.logger.verbose('Typebot set'); + } + + public async findTypebot() { + this.logger.verbose('Finding typebot'); + const data = await this.repository.typebot.find(this.instanceName); + + if (!data) { + this.logger.verbose('Typebot not found'); + throw new NotFoundException('Typebot not found'); + } + + return data; + } + + private async loadProxy() { + this.logger.verbose('Loading proxy'); + const data = await this.repository.proxy.find(this.instanceName); + + this.localProxy.enabled = data?.enabled; + this.logger.verbose(`Proxy enabled: ${this.localProxy.enabled}`); + + this.localProxy.proxy = data?.proxy; + this.logger.verbose(`Proxy proxy: ${this.localProxy.proxy}`); + + this.logger.verbose('Proxy loaded'); + } + + public async setProxy(data: ProxyRaw) { + this.logger.verbose('Setting proxy'); + await this.repository.proxy.create(data, this.instanceName); + this.logger.verbose(`Proxy proxy: ${data.proxy}`); + Object.assign(this.localProxy, data); + this.logger.verbose('Proxy set'); + + this.client?.ws?.close(); + } + + public async findProxy() { + this.logger.verbose('Finding proxy'); + const data = await this.repository.proxy.find(this.instanceName); + + if (!data) { + this.logger.verbose('Proxy not found'); + throw new NotFoundException('Proxy not found'); + } + + return data; + } + + private async loadChamaai() { + this.logger.verbose('Loading chamaai'); + const data = await this.repository.chamaai.find(this.instanceName); + + this.localChamaai.enabled = data?.enabled; + this.logger.verbose(`Chamaai enabled: ${this.localChamaai.enabled}`); + + this.localChamaai.url = data?.url; + this.logger.verbose(`Chamaai url: ${this.localChamaai.url}`); + + this.localChamaai.token = data?.token; + this.logger.verbose(`Chamaai token: ${this.localChamaai.token}`); + + this.localChamaai.waNumber = data?.waNumber; + this.logger.verbose(`Chamaai waNumber: ${this.localChamaai.waNumber}`); + + this.localChamaai.answerByAudio = data?.answerByAudio; + this.logger.verbose(`Chamaai answerByAudio: ${this.localChamaai.answerByAudio}`); + + this.logger.verbose('Chamaai loaded'); + } + + public async setChamaai(data: ChamaaiRaw) { + this.logger.verbose('Setting chamaai'); + await this.repository.chamaai.create(data, this.instanceName); + this.logger.verbose(`Chamaai url: ${data.url}`); + this.logger.verbose(`Chamaai token: ${data.token}`); + this.logger.verbose(`Chamaai waNumber: ${data.waNumber}`); + this.logger.verbose(`Chamaai answerByAudio: ${data.answerByAudio}`); + + Object.assign(this.localChamaai, data); + this.logger.verbose('Chamaai set'); + } + + public async findChamaai() { + this.logger.verbose('Finding chamaai'); + const data = await this.repository.chamaai.find(this.instanceName); + + if (!data) { + this.logger.verbose('Chamaai not found'); + throw new NotFoundException('Chamaai not found'); + } return data; } @@ -344,22 +637,129 @@ export class WAStartupService { public async sendDataWebhook(event: Events, data: T, local = true) { const webhookGlobal = this.configService.get('WEBHOOK'); const webhookLocal = this.localWebhook.events; + const websocketLocal = this.localWebsocket.events; + const rabbitmqLocal = this.localRabbitmq.events; const serverUrl = this.configService.get('SERVER').URL; - const we = event.replace(/[\.-]/gm, '_').toUpperCase(); + const we = event.replace(/[.-]/gm, '_').toUpperCase(); const transformedWe = we.replace(/_/gm, '-').toLowerCase(); - const instance = this.configService.get('AUTHENTICATION').INSTANCE; + const tzoffset = new Date().getTimezoneOffset() * 60000; //offset in milliseconds + const localISOTime = new Date(Date.now() - tzoffset).toISOString(); + const now = localISOTime; - const expose = - this.configService.get('AUTHENTICATION').EXPOSE_IN_FETCH_INSTANCES; + const expose = this.configService.get('AUTHENTICATION').EXPOSE_IN_FETCH_INSTANCES; const tokenStore = await this.repository.auth.find(this.instanceName); - const instanceApikey = tokenStore.apikey || 'Apikey not found'; + const instanceApikey = tokenStore?.apikey || 'Apikey not found'; + + if (this.localRabbitmq.enabled) { + const amqp = getAMQP(); + + if (amqp) { + if (Array.isArray(rabbitmqLocal) && rabbitmqLocal.includes(we)) { + const exchangeName = this.instanceName ?? 'evolution_exchange'; + + amqp.assertExchange(exchangeName, 'topic', { + durable: true, + autoDelete: false, + }); + + const queueName = `${this.instanceName}.${event}`; + + amqp.assertQueue(queueName, { + durable: true, + autoDelete: false, + arguments: { + 'x-queue-type': 'quorum', + }, + }); + + amqp.bindQueue(queueName, exchangeName, event); + + const message = { + event, + instance: this.instance.name, + data, + server_url: serverUrl, + date_time: now, + sender: this.wuid, + }; + + if (expose && instanceApikey) { + message['apikey'] = instanceApikey; + } + + amqp.publish(exchangeName, event, Buffer.from(JSON.stringify(message))); + + if (this.configService.get('LOG').LEVEL.includes('WEBHOOKS')) { + const logData = { + local: WAStartupService.name + '.sendData-RabbitMQ', + event, + instance: this.instance.name, + data, + server_url: serverUrl, + apikey: (expose && instanceApikey) || null, + date_time: now, + sender: this.wuid, + }; + + if (expose && instanceApikey) { + logData['apikey'] = instanceApikey; + } + + this.logger.log(logData); + } + } + } + } + + if (this.configService.get('WEBSOCKET').ENABLED && this.localWebsocket.enabled) { + this.logger.verbose('Sending data to websocket on channel: ' + this.instance.name); + if (Array.isArray(websocketLocal) && websocketLocal.includes(we)) { + this.logger.verbose('Sending data to websocket on event: ' + event); + const io = getIO(); + + const message = { + event, + instance: this.instance.name, + data, + server_url: serverUrl, + date_time: now, + sender: this.wuid, + }; + + if (expose && instanceApikey) { + message['apikey'] = instanceApikey; + } + + this.logger.verbose('Sending data to socket.io in channel: ' + this.instance.name); + io.of(`/${this.instance.name}`).emit(event, message); + + if (this.configService.get('LOG').LEVEL.includes('WEBHOOKS')) { + const logData = { + local: WAStartupService.name + '.sendData-Websocket', + event, + instance: this.instance.name, + data, + server_url: serverUrl, + apikey: (expose && instanceApikey) || null, + date_time: now, + sender: this.wuid, + }; + + if (expose && instanceApikey) { + logData['apikey'] = instanceApikey; + } + + this.logger.log(logData); + } + } + } const globalApiKey = this.configService.get('AUTHENTICATION').API_KEY.KEY; - if (local && instance.MODE !== 'container') { + if (local) { if (Array.isArray(webhookLocal) && webhookLocal.includes(we)) { this.logger.verbose('Sending data to webhook local'); - let baseURL; + let baseURL: string; if (this.localWebhook.webhook_by_events) { baseURL = `${this.localWebhook.url}/${transformedWe}`; @@ -375,6 +775,8 @@ export class WAStartupService { instance: this.instance.name, data, destination: this.localWebhook.url, + date_time: now, + sender: this.wuid, server_url: serverUrl, apikey: (expose && instanceApikey) || null, }; @@ -387,13 +789,15 @@ export class WAStartupService { } try { - if (this.localWebhook.enabled && isURL(this.localWebhook.url)) { + if (this.localWebhook.enabled && isURL(this.localWebhook.url, { require_tld: false })) { const httpService = axios.create({ baseURL }); const postData = { event, instance: this.instance.name, data, destination: this.localWebhook.url, + date_time: now, + sender: this.wuid, server_url: serverUrl, }; @@ -433,13 +837,7 @@ export class WAStartupService { globalURL = globalWebhook.URL; } - let localUrl; - - if (instance.MODE === 'container') { - localUrl = instance.WEBHOOK_URL; - } else { - localUrl = this.localWebhook.url; - } + const localUrl = this.localWebhook.url; if (this.configService.get('LOG').LEVEL.includes('WEBHOOKS')) { const logData = { @@ -449,6 +847,8 @@ export class WAStartupService { instance: this.instance.name, data, destination: localUrl, + date_time: now, + sender: this.wuid, server_url: serverUrl, }; @@ -467,6 +867,8 @@ export class WAStartupService { instance: this.instance.name, data, destination: localUrl, + date_time: now, + sender: this.wuid, server_url: serverUrl, }; @@ -494,11 +896,7 @@ export class WAStartupService { } } - private async connectionUpdate({ - qr, - connection, - lastDisconnect, - }: Partial) { + private async connectionUpdate({ qr, connection, lastDisconnect }: Partial) { this.logger.verbose('Connection update'); if (qr) { this.logger.verbose('QR code found'); @@ -529,23 +927,6 @@ export class WAStartupService { statusReason: DisconnectReason.connectionClosed, }); - this.logger.verbose('Sending data to webhook in event STATUS_INSTANCE'); - this.sendDataWebhook(Events.STATUS_INSTANCE, { - instance: this.instance.name, - status: 'removed', - }); - - if (this.localChatwoot.enabled) { - this.chatwootService.eventWhatsapp( - Events.STATUS_INSTANCE, - { instanceName: this.instance.name }, - { - instance: this.instance.name, - status: 'removed', - }, - ); - } - this.logger.verbose('endSession defined as true'); this.endSession = true; @@ -556,13 +937,22 @@ export class WAStartupService { this.logger.verbose('Incrementing QR code count'); this.instance.qrcode.count++; + const color = this.configService.get('QRCODE').COLOR; + const optsQrcode: QRCodeToDataURLOptions = { margin: 3, scale: 4, errorCorrectionLevel: 'H', - color: { light: '#ffffff', dark: '#198754' }, + color: { light: '#ffffff', dark: color }, }; + if (this.phoneNumber) { + await delay(2000); + this.instance.qrcode.pairingCode = await this.client.requestPairingCode(this.phoneNumber); + } else { + this.instance.qrcode.pairingCode = null; + } + this.logger.verbose('Generating QR code'); qrcode.toDataURL(qr, optsQrcode, (error, base64) => { if (error) { @@ -574,7 +964,12 @@ export class WAStartupService { this.instance.qrcode.code = qr; this.sendDataWebhook(Events.QRCODE_UPDATED, { - qrcode: { instance: this.instance.name, code: qr, base64 }, + qrcode: { + instance: this.instance.name, + pairingCode: this.instance.qrcode.pairingCode, + code: qr, + base64, + }, }); if (this.localChatwoot.enabled) { @@ -582,7 +977,12 @@ export class WAStartupService { Events.QRCODE_UPDATED, { instanceName: this.instance.name }, { - qrcode: { instance: this.instance.name, code: qr, base64 }, + qrcode: { + instance: this.instance.name, + pairingCode: this.instance.qrcode.pairingCode, + code: qr, + base64, + }, }, ); } @@ -591,7 +991,7 @@ export class WAStartupService { this.logger.verbose('Generating QR code in terminal'); qrcodeTerminal.generate(qr, { small: true }, (qrcode) => this.logger.log( - `\n{ instance: ${this.instance.name}, qrcodeCount: ${this.instance.qrcode.count} }\n` + + `\n{ instance: ${this.instance.name} pairingCode: ${this.instance.qrcode.pairingCode}, qrcodeCount: ${this.instance.qrcode.count} }\n` + qrcode, ), ); @@ -613,8 +1013,7 @@ export class WAStartupService { if (connection === 'close') { this.logger.verbose('Connection closed'); - const shouldReconnect = - (lastDisconnect.error as Boom)?.output?.statusCode !== DisconnectReason.loggedOut; + const shouldReconnect = (lastDisconnect.error as Boom)?.output?.statusCode !== DisconnectReason.loggedOut; if (shouldReconnect) { this.logger.verbose('Reconnecting to whatsapp'); await this.connectToWhatsapp(); @@ -623,7 +1022,7 @@ export class WAStartupService { this.logger.verbose('Sending data to webhook in event STATUS_INSTANCE'); this.sendDataWebhook(Events.STATUS_INSTANCE, { instance: this.instance.name, - status: 'removed', + status: 'closed', }); if (this.localChatwoot.enabled) { @@ -632,7 +1031,7 @@ export class WAStartupService { { instanceName: this.instance.name }, { instance: this.instance.name, - status: 'removed', + status: 'closed', }, ); } @@ -648,9 +1047,7 @@ export class WAStartupService { if (connection === 'open') { this.logger.verbose('Connection opened'); this.instance.wuid = this.client.user.id.replace(/:\d+/, ''); - this.instance.profilePictureUrl = ( - await this.profilePicture(this.instance.wuid) - ).profilePictureUrl; + this.instance.profilePictureUrl = (await this.profilePicture(this.instance.wuid)).profilePictureUrl; this.logger.info( ` ┌──────────────────────────────┐ @@ -683,8 +1080,7 @@ export class WAStartupService { } if (webMessageInfo[0].message?.pollCreationMessage) { this.logger.verbose('Returning poll message'); - const messageSecretBase64 = - webMessageInfo[0].message?.messageContextInfo?.messageSecret; + const messageSecretBase64 = webMessageInfo[0].message?.messageContextInfo?.messageSecret; if (typeof messageSecretBase64 === 'string') { const messageSecret = Buffer.from(messageSecretBase64, 'base64'); @@ -718,22 +1114,16 @@ export class WAStartupService { for (const [key, value] of Object.entries(cleanStore)) { if (value === true) { execSync( - `rm -rf ${join( - this.storePath, - key.toLowerCase().replace('_', '-'), - this.instance.name, - )}/*.json`, + `rm -rf ${join(this.storePath, key.toLowerCase().replace('_', '-'), this.instance.name)}/*.json`, ); this.logger.verbose( - `Cleaned ${join( - this.storePath, - key.toLowerCase().replace('_', '-'), - this.instance.name, - )}/*.json`, + `Cleaned ${join(this.storePath, key.toLowerCase().replace('_', '-'), this.instance.name)}/*.json`, ); } } - } catch (error) {} + } catch (error) { + this.logger.error(error); + } }, (cleanStore?.CLEANING_INTERVAL ?? 3600) * 1000); } } @@ -758,11 +1148,17 @@ export class WAStartupService { return await useMultiFileAuthState(join(INSTANCE_DIR, this.instance.name)); } - public async connectToWhatsapp(): Promise { + public async connectToWhatsapp(number?: string): Promise { this.logger.verbose('Connecting to whatsapp'); try { this.loadWebhook(); this.loadChatwoot(); + this.loadSettings(); + this.loadWebsocket(); + this.loadRabbitmq(); + this.loadTypebot(); + this.loadProxy(); + this.loadChamaai(); this.instance.authState = await this.defineAuthState(); @@ -772,35 +1168,39 @@ export class WAStartupService { const browser: WABrowserDescription = [session.CLIENT, session.NAME, release()]; this.logger.verbose('Browser: ' + JSON.stringify(browser)); + let options; + + if (this.localProxy.enabled) { + this.logger.verbose('Proxy enabled'); + options = { + agent: new ProxyAgent(this.localProxy.proxy as any), + fetchAgent: new ProxyAgent(this.localProxy.proxy as any), + }; + } + const socketConfig: UserFacingSocketConfig = { + ...options, auth: { creds: this.instance.authState.state.creds, - keys: makeCacheableSignalKeyStore( - this.instance.authState.state.keys, - P({ level: 'error' }), - ), + keys: makeCacheableSignalKeyStore(this.instance.authState.state.keys, P({ level: 'error' })), }, logger: P({ level: this.logBaileys }), printQRInTerminal: false, browser, version, + markOnlineOnConnect: this.localSettings.always_online, connectTimeoutMs: 60_000, qrTimeout: 40_000, defaultQueryTimeoutMs: undefined, emitOwnEvents: false, msgRetryCounterCache: this.msgRetryCounterCache, - getMessage: async (key) => - (await this.getMessage(key)) as Promise, + getMessage: async (key) => (await this.getMessage(key)) as Promise, generateHighQualityLinkPreview: true, syncFullHistory: true, userDevicesCache: this.userDevicesCache, transactionOpts: { maxCommitRetries: 1, delayBetweenTriesMs: 10 }, patchMessageBeforeSending: (message) => { - const requiresPatch = !!( - message.buttonsMessage || - message.listMessage || - message.templateMessage - ); + const requiresPatch = !!(message.buttonsMessage || message.listMessage || message.templateMessage); if (requiresPatch) { message = { viewOnceMessageV2: { @@ -831,6 +1231,8 @@ export class WAStartupService { this.logger.verbose('Socket event handler initialized'); + this.phoneNumber = number; + return this.client; } catch (error) { this.logger.error(error); @@ -861,11 +1263,7 @@ export class WAStartupService { await this.sendDataWebhook(Events.CHATS_UPSERT, chatsRaw); this.logger.verbose('Inserting chats in database'); - await this.repository.chat.insert( - chatsRaw, - this.instance.name, - database.SAVE_DATA.CHATS, - ); + await this.repository.chat.insert(chatsRaw, this.instance.name, database.SAVE_DATA.CHATS); }, 'chats.update': async ( @@ -930,11 +1328,7 @@ export class WAStartupService { await this.sendDataWebhook(Events.CONTACTS_UPSERT, contactsRaw); this.logger.verbose('Inserting contacts in database'); - await this.repository.contact.insert( - contactsRaw, - this.instance.name, - database.SAVE_DATA.CONTACTS, - ); + await this.repository.contact.insert(contactsRaw, this.instance.name, database.SAVE_DATA.CONTACTS); }, 'contacts.update': async (contacts: Partial[], database: Database) => { @@ -955,11 +1349,7 @@ export class WAStartupService { await this.sendDataWebhook(Events.CONTACTS_UPDATE, contactsRaw); this.logger.verbose('Updating contacts in database'); - await this.repository.contact.update( - contactsRaw, - this.instance.name, - database.SAVE_DATA.CONTACTS, - ); + await this.repository.contact.update(contactsRaw, this.instance.name, database.SAVE_DATA.CONTACTS); }, }; @@ -992,11 +1382,7 @@ export class WAStartupService { await this.sendDataWebhook(Events.CHATS_SET, chatsRaw); this.logger.verbose('Inserting chats in database'); - await this.repository.chat.insert( - chatsRaw, - this.instance.name, - database.SAVE_DATA.CHATS, - ); + await this.repository.chat.insert(chatsRaw, this.instance.name, database.SAVE_DATA.CHATS); } const messagesRaw: MessageRaw[] = []; @@ -1007,11 +1393,7 @@ export class WAStartupService { if (!m.message) { continue; } - if ( - messagesRepository.find( - (mr) => mr.owner === this.instance.name && mr.key.id === m.key.id, - ) - ) { + if (messagesRepository.find((mr) => mr.owner === this.instance.name && mr.key.id === m.key.id)) { continue; } @@ -1045,12 +1427,14 @@ export class WAStartupService { type: MessageUpsertType; }, database: Database, + settings: SettingsRaw, ) => { this.logger.verbose('Event received: messages.upsert'); const received = messages[0]; if ( type !== 'notify' || + !received.message || received.message?.protocolMessage || received.message?.pollUpdateMessage ) { @@ -1062,6 +1446,11 @@ export class WAStartupService { received.messageTimestamp = received.messageTimestamp?.toNumber(); } + if (settings?.groups_ignore && received.key.remoteJid.includes('@g.us')) { + this.logger.verbose('group ignored'); + return; + } + const messageRaw: MessageRaw = { key: received.key, pushName: received.pushName, @@ -1072,6 +1461,14 @@ export class WAStartupService { source: getDevice(received.key.id), }; + if (this.localSettings.read_messages && received.key.id !== 'status@broadcast') { + await this.client.readMessages([received.key]); + } + + if (this.localSettings.read_status && received.key.id === 'status@broadcast') { + await this.client.readMessages([received.key]); + } + this.logger.log(messageRaw); this.logger.verbose('Sending data to webhook in event MESSAGES_UPSERT'); @@ -1085,12 +1482,26 @@ export class WAStartupService { ); } + if (this.localTypebot.enabled) { + if (!(this.localTypebot.listening_from_me === false && messageRaw.key.fromMe === true)) { + await this.typebotService.sendTypebot( + { instanceName: this.instance.name }, + messageRaw.key.remoteJid, + messageRaw, + ); + } + } + + if (this.localChamaai.enabled && messageRaw.key.fromMe === false) { + await this.chamaaiService.sendChamaai( + { instanceName: this.instance.name }, + messageRaw.key.remoteJid, + messageRaw, + ); + } + this.logger.verbose('Inserting message in database'); - await this.repository.message.insert( - [messageRaw], - this.instance.name, - database.SAVE_DATA.NEW_MESSAGE, - ); + await this.repository.message.insert([messageRaw], this.instance.name, database.SAVE_DATA.NEW_MESSAGE); this.logger.verbose('Verifying contact from message'); const contact = await this.repository.contact.find({ @@ -1100,8 +1511,7 @@ export class WAStartupService { const contactRaw: ContactRaw = { id: received.key.remoteJid, pushName: received.pushName, - profilePictureUrl: (await this.profilePicture(received.key.remoteJid)) - .profilePictureUrl, + profilePictureUrl: (await this.profilePicture(received.key.remoteJid)).profilePictureUrl, owner: this.instance.name, }; @@ -1115,8 +1525,7 @@ export class WAStartupService { const contactRaw: ContactRaw = { id: received.key.remoteJid, pushName: contact[0].pushName, - profilePictureUrl: (await this.profilePicture(received.key.remoteJid)) - .profilePictureUrl, + profilePictureUrl: (await this.profilePicture(received.key.remoteJid)).profilePictureUrl, owner: this.instance.name, }; @@ -1132,11 +1541,7 @@ export class WAStartupService { } this.logger.verbose('Updating contact in database'); - await this.repository.contact.update( - [contactRaw], - this.instance.name, - database.SAVE_DATA.CONTACTS, - ); + await this.repository.contact.update([contactRaw], this.instance.name, database.SAVE_DATA.CONTACTS); return; } @@ -1146,14 +1551,10 @@ export class WAStartupService { await this.sendDataWebhook(Events.CONTACTS_UPSERT, contactRaw); this.logger.verbose('Inserting contact in database'); - await this.repository.contact.insert( - [contactRaw], - this.instance.name, - database.SAVE_DATA.CONTACTS, - ); + await this.repository.contact.insert([contactRaw], this.instance.name, database.SAVE_DATA.CONTACTS); }, - 'messages.update': async (args: WAMessageUpdate[], database: Database) => { + 'messages.update': async (args: WAMessageUpdate[], database: Database, settings: SettingsRaw) => { this.logger.verbose('Event received: messages.update'); const status: Record = { 0: 'ERROR', @@ -1164,6 +1565,10 @@ export class WAStartupService { 5: 'PLAYED', }; for await (const { key, update } of args) { + if (settings?.groups_ignore && key.remoteJid.includes('@g.us')) { + this.logger.verbose('group ignored'); + return; + } if (key.remoteJid !== 'status@broadcast' && !key?.remoteJid?.match(/(:\d+)/)) { this.logger.verbose('Message update is valid'); @@ -1191,6 +1596,22 @@ export class WAStartupService { this.logger.verbose('Sending data to webhook in event MESSAGE_DELETE'); await this.sendDataWebhook(Events.MESSAGES_DELETE, key); + + const message: MessageUpdateRaw = { + ...key, + status: 'DELETED', + datetime: Date.now(), + owner: this.instance.name, + }; + + this.logger.verbose(message); + + this.logger.verbose('Inserting message in database'); + await this.repository.messageUpdate.insert( + [message], + this.instance.name, + database.SAVE_DATA.MESSAGE_UPDATE, + ); return; } @@ -1208,11 +1629,7 @@ export class WAStartupService { await this.sendDataWebhook(Events.MESSAGES_UPDATE, message); this.logger.verbose('Inserting message in database'); - await this.repository.messageUpdate.insert( - [message], - this.instance.name, - database.SAVE_DATA.MESSAGE_UPDATE, - ); + await this.repository.messageUpdate.insert([message], this.instance.name, database.SAVE_DATA.MESSAGE_UPDATE); } } }, @@ -1247,9 +1664,36 @@ export class WAStartupService { private eventHandler() { this.logger.verbose('Initializing event handler'); - this.client.ev.process((events) => { + this.client.ev.process(async (events) => { if (!this.endSession) { const database = this.configService.get('DATABASE'); + const settings = await this.findSettings(); + + if (events.call) { + this.logger.verbose('Listening event: call'); + const call = events.call[0]; + + if (settings?.reject_call && call.status == 'offer') { + this.logger.verbose('Rejecting call'); + this.client.rejectCall(call.id, call.from); + } + + if (settings?.msg_call.trim().length > 0 && call.status == 'offer') { + this.logger.verbose('Sending message in call'); + const msg = await this.client.sendMessage(call.from, { + text: settings.msg_call, + }); + + this.logger.verbose('Sending data to event messages.upsert'); + this.client.ev.emit('messages.upsert', { + messages: [msg], + type: 'notify', + }); + } + + this.logger.verbose('Sending data to webhook in event CALL'); + this.sendDataWebhook(Events.CALL, call); + } if (events['connection.update']) { this.logger.verbose('Listening event: connection.update'); @@ -1270,37 +1714,44 @@ export class WAStartupService { if (events['messages.upsert']) { this.logger.verbose('Listening event: messages.upsert'); const payload = events['messages.upsert']; - this.messageHandle['messages.upsert'](payload, database); + this.messageHandle['messages.upsert'](payload, database, settings); } if (events['messages.update']) { this.logger.verbose('Listening event: messages.update'); const payload = events['messages.update']; - this.messageHandle['messages.update'](payload, database); + this.messageHandle['messages.update'](payload, database, settings); } if (events['presence.update']) { this.logger.verbose('Listening event: presence.update'); const payload = events['presence.update']; + + if (settings.groups_ignore && payload.id.includes('@g.us')) { + this.logger.verbose('group ignored'); + return; + } this.sendDataWebhook(Events.PRESENCE_UPDATE, payload); } - if (events['groups.upsert']) { - this.logger.verbose('Listening event: groups.upsert'); - const payload = events['groups.upsert']; - this.groupHandler['groups.upsert'](payload); - } + if (!settings?.groups_ignore) { + if (events['groups.upsert']) { + this.logger.verbose('Listening event: groups.upsert'); + const payload = events['groups.upsert']; + this.groupHandler['groups.upsert'](payload); + } - if (events['groups.update']) { - this.logger.verbose('Listening event: groups.update'); - const payload = events['groups.update']; - this.groupHandler['groups.update'](payload); - } + if (events['groups.update']) { + this.logger.verbose('Listening event: groups.update'); + const payload = events['groups.update']; + this.groupHandler['groups.update'](payload); + } - if (events['group-participants.update']) { - this.logger.verbose('Listening event: group-participants.update'); - const payload = events['group-participants.update']; - this.groupHandler['group-participants.update'](payload); + if (events['group-participants.update']) { + this.logger.verbose('Listening event: group-participants.update'); + const payload = events['group-participants.update']; + this.groupHandler['group-participants.update'](payload); + } } if (events['chats.upsert']) { @@ -1383,35 +1834,25 @@ export class WAStartupService { return number; } - const countryCode = number.substring(0, 2); + number = number + ?.replace(/\s/g, '') + .replace(/\+/g, '') + .replace(/\(/g, '') + .replace(/\)/g, '') + .split(':')[0] + .split('@')[0]; - if (Number(countryCode) === 55) { - const formattedBRNumber = this.formatBRNumber(number); - if (formattedBRNumber !== number) { - this.logger.verbose( - 'Jid created is whatsapp in format BR: ' + - `${formattedBRNumber}@s.whatsapp.net`, - ); - return `${formattedBRNumber}@s.whatsapp.net`; - } - } - - if (Number(countryCode) === 52 || Number(countryCode) === 54) { - console.log('numero mexicano'); - - const formattedMXARNumber = this.formatMXOrARNumber(number); - - if (formattedMXARNumber !== number) { - this.logger.verbose( - 'Jid created is whatsapp in format MXAR: ' + - `${formattedMXARNumber}@s.whatsapp.net`, - ); - return `${formattedMXARNumber}@s.whatsapp.net`; - } - } - - if (number.includes('-')) { + if (number.includes('-') && number.length >= 24) { this.logger.verbose('Jid created is group: ' + `${number}@g.us`); + number = number.replace(/[^\d-]/g, ''); + return `${number}@g.us`; + } + + number = number.replace(/\D/g, ''); + + if (number.length >= 18) { + this.logger.verbose('Jid created is group: ' + `${number}@g.us`); + number = number.replace(/[^\d-]/g, ''); return `${number}@g.us`; } @@ -1437,10 +1878,10 @@ export class WAStartupService { }; } } - + public async getStatus(number: string) { const jid = this.createJid(number); - + this.logger.verbose('Getting profile status with jid:' + jid); try { this.logger.verbose('Getting status'); @@ -1456,7 +1897,7 @@ export class WAStartupService { }; } } - + public async fetchProfile(instanceName: string, number?: string) { const jid = number ? this.createJid(number) : this.client?.user?.id; @@ -1484,7 +1925,7 @@ export class WAStartupService { } else { const info = await waMonitor.instanceInfo(instanceName); const business = await this.fetchBusinessProfile(jid); - + return { wuid: jid, name: info?.instance?.profileName, @@ -1510,22 +1951,17 @@ export class WAStartupService { } } - private async sendMessageWithTyping( - number: string, - message: T, - options?: Options, - ) { + private async sendMessageWithTyping(number: string, message: T, options?: Options) { this.logger.verbose('Sending message with typing'); - const jid = this.createJid(number); - const numberWA = await this.whatsappNumber({ numbers: [jid] }); + const numberWA = await this.whatsappNumber({ numbers: [number] }); const isWA = numberWA[0]; if (!isWA.exists && !isJidGroup(isWA.jid) && !isWA.jid.includes('@broadcast')) { throw new BadRequestException(isWA); } - const sender = isJidGroup(jid) ? jid : isWA.jid; + const sender = isWA.jid; try { if (options?.delay) { @@ -1534,10 +1970,8 @@ export class WAStartupService { await this.client.presenceSubscribe(sender); this.logger.verbose('Subscribing to presence'); - await this.client.sendPresenceUpdate(options?.presence ?? 'composing', jid); - this.logger.verbose( - 'Sending presence update: ' + options?.presence ?? 'composing', - ); + await this.client.sendPresenceUpdate(options?.presence ?? 'composing', sender); + this.logger.verbose('Sending presence update: ' + options?.presence ?? 'composing'); await delay(options.delay); this.logger.verbose('Set delay: ' + options.delay); @@ -1546,14 +1980,14 @@ export class WAStartupService { this.logger.verbose('Sending presence update: paused'); } + const linkPreview = options?.linkPreview != false ? undefined : false; + let quoted: WAMessage; if (options?.quoted) { const m = options?.quoted; - const msg = m?.message - ? m - : ((await this.getMessage(m.key, true)) as proto.IWebMessageInfo); + const msg = m?.message ? m : ((await this.getMessage(m.key, true)) as proto.IWebMessageInfo); if (!msg) { throw 'Message not found'; @@ -1575,25 +2009,19 @@ export class WAStartupService { if (options?.mentions) { this.logger.verbose('Mentions defined'); - if ( - !Array.isArray(options.mentions.mentioned) && - !options.mentions.everyOne - ) { - throw new BadRequestException('Mentions must be an array'); - } - - if (options.mentions.everyOne) { + if (options.mentions?.everyOne) { this.logger.verbose('Mentions everyone'); this.logger.verbose('Getting group metadata'); mentions = groupMetadata.participants.map((participant) => participant.id); this.logger.verbose('Getting group metadata for mentions'); - } else { + } else if (options.mentions?.mentioned?.length) { this.logger.verbose('Mentions manually defined'); mentions = options.mentions.mentioned.map((mention) => { const jid = this.createJid(mention); if (isJidGroup(jid)) { - throw new BadRequestException('Mentions must be a number'); + return null; + // throw new BadRequestException('Mentions must be a number'); } return jid; }); @@ -1639,6 +2067,7 @@ export class WAStartupService { { text: message['conversation'], mentions, + linkPreview: linkPreview, } as unknown as AnyMessageContent, option as unknown as MiscMessageGenerationOptions, ); @@ -1680,13 +2109,9 @@ export class WAStartupService { this.logger.verbose('Sending data to webhook in event SEND_MESSAGE'); await this.sendDataWebhook(Events.SEND_MESSAGE, messageRaw); - // if (this.localChatwoot.enabled) { - // this.chatwootService.eventWhatsapp( - // Events.SEND_MESSAGE, - // { instanceName: this.instance.name }, - // messageRaw, - // ); - // } + if (this.localChatwoot.enabled) { + this.chatwootService.eventWhatsapp(Events.SEND_MESSAGE, { instanceName: this.instance.name }, messageRaw); + } this.logger.verbose('Inserting message in database'); await this.repository.message.insert( @@ -1759,9 +2184,7 @@ export class WAStartupService { } this.logger.verbose('Getting contacts with push name'); - status.statusJidList = contacts - .filter((contact) => contact.pushName) - .map((contact) => contact.id); + status.statusJidList = contacts.filter((contact) => contact.pushName).map((contact) => contact.id); this.logger.verbose(status.statusJidList); } @@ -1878,15 +2301,21 @@ export class WAStartupService { this.logger.verbose('Media type: ' + mediaType); if (mediaMessage.mediatype === 'document' && !mediaMessage.fileName) { - this.logger.verbose( - 'If media type is document and file name is not defined then', - ); + this.logger.verbose('If media type is document and file name is not defined then'); const regex = new RegExp(/.*\/(.+?)\./); const arrayMatch = regex.exec(mediaMessage.media); mediaMessage.fileName = arrayMatch[1]; this.logger.verbose('File name: ' + mediaMessage.fileName); } + if (mediaMessage.mediatype === 'image' && !mediaMessage.fileName) { + mediaMessage.fileName = 'image.png'; + } + + if (mediaMessage.mediatype === 'video' && !mediaMessage.fileName) { + mediaMessage.fileName = 'video.mp4'; + } + let mimetype: string; if (isURL(mediaMessage.media)) { @@ -1993,14 +2422,10 @@ export class WAStartupService { this.logger.verbose('Sending media message'); const generate = await this.prepareMediaMessage(data.mediaMessage); - return await this.sendMessageWithTyping( - data.number, - { ...generate.message }, - data?.options, - ); + return await this.sendMessageWithTyping(data.number, { ...generate.message }, data?.options); } - private async processAudio(audio: string, number: string) { + public async processAudio(audio: string, number: string) { this.logger.verbose('Processing audio'); let tempAudioPath: string; let outputAudio: string; @@ -2042,43 +2467,59 @@ export class WAStartupService { this.logger.verbose('Converting audio to mp4'); return new Promise((resolve, reject) => { - exec( - `${ffmpegPath.path} -i ${tempAudioPath} -vn -ab 128k -ar 44100 -f ipod ${outputAudio} -y`, - (error, _stdout, _stderr) => { - fs.unlinkSync(tempAudioPath); - this.logger.verbose('Temp audio deleted'); + exec(`${ffmpegPath.path} -i ${tempAudioPath} -vn -ab 128k -ar 44100 -f ipod ${outputAudio} -y`, (error) => { + fs.unlinkSync(tempAudioPath); + this.logger.verbose('Temp audio deleted'); - if (error) reject(error); + if (error) reject(error); - this.logger.verbose('Audio converted to mp4'); - resolve(outputAudio); - }, - ); + this.logger.verbose('Audio converted to mp4'); + resolve(outputAudio); + }); }); } public async audioWhatsapp(data: SendAudioDto) { this.logger.verbose('Sending audio whatsapp'); - const convert = await this.processAudio(data.audioMessage.audio, data.number); - if (typeof convert === 'string') { - const audio = fs.readFileSync(convert).toString('base64'); - const result = this.sendMessageWithTyping( - data.number, - { - audio: Buffer.from(audio, 'base64'), - ptt: true, - mimetype: 'audio/mp4', - }, - { presence: 'recording', delay: data?.options?.delay }, - ); - fs.unlinkSync(convert); - this.logger.verbose('Converted audio deleted'); - - return result; - } else { - throw new InternalServerErrorException(convert); + if (!data.options?.encoding && data.options?.encoding !== false) { + data.options.encoding = true; } + + if (data.options?.encoding) { + const convert = await this.processAudio(data.audioMessage.audio, data.number); + if (typeof convert === 'string') { + const audio = fs.readFileSync(convert).toString('base64'); + const result = this.sendMessageWithTyping( + data.number, + { + audio: Buffer.from(audio, 'base64'), + ptt: true, + mimetype: 'audio/mp4', + }, + { presence: 'recording', delay: data?.options?.delay }, + ); + + fs.unlinkSync(convert); + this.logger.verbose('Converted audio deleted'); + + return result; + } else { + throw new InternalServerErrorException(convert); + } + } + + return await this.sendMessageWithTyping( + data.number, + { + audio: isURL(data.audioMessage.audio) + ? { url: data.audioMessage.audio } + : Buffer.from(data.audioMessage.audio, 'base64'), + ptt: true, + mimetype: 'audio/ogg; codecs=opus', + }, + { presence: 'recording', delay: data?.options?.delay }, + ); } public async buttonMessage(data: SendButtonDto) { @@ -2100,10 +2541,7 @@ export class WAStartupService { }; if (!arrayUnique(btnItems.text) || !arrayUnique(btnItems.ids)) { - throw new BadRequestException( - 'Button texts cannot be repeated', - 'Button IDs cannot be repeated.', - ); + throw new BadRequestException('Button texts cannot be repeated', 'Button IDs cannot be repeated.'); } return await this.sendMessageWithTyping( @@ -2170,11 +2608,7 @@ export class WAStartupService { const vcard = (contact: ContactMessage) => { this.logger.verbose('Creating vcard'); - let result = - 'BEGIN:VCARD\n' + - 'VERSION:3.0\n' + - `N:${contact.fullName}\n` + - `FN:${contact.fullName}\n`; + let result = 'BEGIN:VCARD\n' + 'VERSION:3.0\n' + `N:${contact.fullName}\n` + `FN:${contact.fullName}\n`; if (contact.organization) { this.logger.verbose('Organization defined'); @@ -2191,10 +2625,12 @@ export class WAStartupService { result += `URL:${contact.url}\n`; } - result += - `item1.TEL;waid=${contact.wuid}:${contact.phoneNumber}\n` + - 'item1.X-ABLabel:Celular\n' + - 'END:VCARD'; + if (!contact.wuid) { + this.logger.verbose('Wuid defined'); + contact.wuid = this.createJid(contact.phoneNumber); + } + + result += `item1.TEL;waid=${contact.wuid}:${contact.phoneNumber}\n` + 'item1.X-ABLabel:Celular\n' + 'END:VCARD'; this.logger.verbose('Vcard created'); return result; @@ -2236,8 +2672,8 @@ export class WAStartupService { const onWhatsapp: OnWhatsAppDto[] = []; for await (const number of data.numbers) { - const jid = this.createJid(number); - // const jid = `${number}@s.whatsapp.net`; + let jid = this.createJid(number); + if (isJidGroup(jid)) { const group = await this.findGroup({ groupJid: jid }, 'inner'); @@ -2245,6 +2681,7 @@ export class WAStartupService { onWhatsapp.push(new OnWhatsAppDto(group.id, !!group?.id, group?.subject)); } else { + jid = !jid.startsWith('+') ? `+${jid}` : jid; const verify = await this.client.onWhatsApp(jid); const result = verify[0]; @@ -2264,7 +2701,7 @@ export class WAStartupService { this.logger.verbose('Marking message as read'); try { const keys: proto.IMessageKey[] = []; - data.readMessages.forEach((read) => { + data.read_messages.forEach((read) => { if (isJidGroup(read.remoteJid) || isJidUser(read.remoteJid)) { keys.push({ remoteJid: read.remoteJid, @@ -2280,30 +2717,61 @@ export class WAStartupService { } } + public async getLastMessage(number: string) { + const messages = await this.fetchMessages({ + where: { + key: { + remoteJid: number, + }, + owner: this.instance.name, + }, + }); + + let lastMessage = messages.pop(); + + for (const message of messages) { + if (message.messageTimestamp >= lastMessage.messageTimestamp) { + lastMessage = message; + } + } + + return lastMessage as unknown as LastMessage; + } + public async archiveChat(data: ArchiveChatDto) { this.logger.verbose('Archiving chat'); try { - data.lastMessage.messageTimestamp = - data.lastMessage?.messageTimestamp ?? Date.now(); + let last_message = data.lastMessage; + let number = data.chat; + + if (!last_message && number) { + last_message = await this.getLastMessage(number); + } else { + last_message = data.lastMessage; + last_message.messageTimestamp = last_message?.messageTimestamp ?? Date.now(); + number = last_message?.key?.remoteJid; + } + + if (!last_message || Object.keys(last_message).length === 0) { + throw new NotFoundException('Last message not found'); + } + await this.client.chatModify( { archive: data.archive, - lastMessages: [data.lastMessage], + lastMessages: [last_message], }, - data.lastMessage.key.remoteJid, + this.createJid(number), ); return { - chatId: data.lastMessage.key.remoteJid, + chatId: number, archived: true, }; } catch (error) { throw new InternalServerErrorException({ archived: false, - message: [ - 'An error occurred while archiving the chat. Open a calling.', - error.toString(), - ], + message: ['An error occurred while archiving the chat. Open a calling.', error.toString()], }); } } @@ -2313,10 +2781,7 @@ export class WAStartupService { try { return await this.client.sendMessage(del.remoteJid, { delete: del }); } catch (error) { - throw new InternalServerErrorException( - 'Error while deleting message for everyone', - error?.toString(), - ); + throw new InternalServerErrorException('Error while deleting message for everyone', error?.toString()); } } @@ -2326,9 +2791,7 @@ export class WAStartupService { const m = data?.message; const convertToMp4 = data?.convertToMp4 ?? false; - const msg = m?.message - ? m - : ((await this.getMessage(m.key, true)) as proto.IWebMessageInfo); + const msg = m?.message ? m : ((await this.getMessage(m.key, true)) as proto.IWebMessageInfo); if (!msg) { throw 'Message not found'; @@ -2424,6 +2887,9 @@ export class WAStartupService { this.logger.verbose('Fetching contacts'); if (query?.where) { query.where.owner = this.instance.name; + if (query.where?.id) { + query.where.id = this.createJid(query.where.id); + } } else { query = { where: { @@ -2437,6 +2903,9 @@ export class WAStartupService { public async fetchMessages(query: MessageQuery) { this.logger.verbose('Fetching messages'); if (query?.where) { + if (query.where?.key?.remoteJid) { + query.where.key.remoteJid = this.createJid(query.where.key.remoteJid); + } query.where.owner = this.instance.name; } else { query = { @@ -2452,6 +2921,9 @@ export class WAStartupService { public async fetchStatusMessage(query: MessageUpQuery) { this.logger.verbose('Fetching status messages'); if (query?.where) { + if (query.where?.remoteJid) { + query.where.remoteJid = this.createJid(query.where.remoteJid); + } query.where.owner = this.instance.name; } else { query = { @@ -2495,47 +2967,49 @@ export class WAStartupService { await this.client.updateGroupsAddPrivacy(settings.privacySettings.groupadd); this.logger.verbose('Groups add privacy updated'); - // reinicia a instancia + this.client?.ws?.close(); - return { update: 'success', data: await this.client.fetchPrivacySettings() }; + return { + update: 'success', + data: { + readreceipts: settings.privacySettings.readreceipts, + profile: settings.privacySettings.profile, + status: settings.privacySettings.status, + online: settings.privacySettings.online, + last: settings.privacySettings.last, + groupadd: settings.privacySettings.groupadd, + }, + }; } catch (error) { - throw new InternalServerErrorException( - 'Error updating privacy settings', - error.toString(), - ); + throw new InternalServerErrorException('Error updating privacy settings', error.toString()); } } - public async fetchBusinessProfile(number: string) : Promise { + public async fetchBusinessProfile(number: string): Promise { this.logger.verbose('Fetching business profile'); try { - const jid = (number) - ? this.createJid(number) - : this.instance.wuid; + const jid = number ? this.createJid(number) : this.instance.wuid; const profile = await this.client.getBusinessProfile(jid); this.logger.verbose('Trying to get business profile'); if (!profile) { const info = await this.whatsappNumber({ numbers: [jid] }); - + return { isBusiness: false, message: 'Not is business profile', - ...info?.shift() + ...info?.shift(), }; } this.logger.verbose('Business profile fetched'); return { isBusiness: true, - ...profile + ...profile, }; } catch (error) { - throw new InternalServerErrorException( - 'Error updating profile name', - error.toString(), - ); + throw new InternalServerErrorException('Error updating profile name', error.toString()); } } @@ -2546,10 +3020,7 @@ export class WAStartupService { return { update: 'success' }; } catch (error) { - throw new InternalServerErrorException( - 'Error updating profile name', - error.toString(), - ); + throw new InternalServerErrorException('Error updating profile name', error.toString()); } } @@ -2560,10 +3031,7 @@ export class WAStartupService { return { update: 'success' }; } catch (error) { - throw new InternalServerErrorException( - 'Error updating profile status', - error.toString(), - ); + throw new InternalServerErrorException('Error updating profile status', error.toString()); } } @@ -2592,10 +3060,7 @@ export class WAStartupService { return { update: 'success' }; } catch (error) { - throw new InternalServerErrorException( - 'Error updating profile picture', - error.toString(), - ); + throw new InternalServerErrorException('Error updating profile picture', error.toString()); } } @@ -2606,10 +3071,7 @@ export class WAStartupService { return { update: 'success' }; } catch (error) { - throw new InternalServerErrorException( - 'Error removing profile picture', - error.toString(), - ); + throw new InternalServerErrorException('Error removing profile picture', error.toString()); } } @@ -2617,7 +3079,9 @@ export class WAStartupService { public async createGroup(create: CreateGroupDto) { this.logger.verbose('Creating group: ' + create.subject); try { - const participants = create.participants.map((p) => this.createJid(p)); + const participants = (await this.whatsappNumber({ numbers: create.participants })) + .filter((participant) => participant.exists) + .map((participant) => participant.jid); const { id } = await this.client.groupCreate(create.subject, participants); this.logger.verbose('Group created: ' + id); @@ -2626,10 +3090,19 @@ export class WAStartupService { await this.client.groupUpdateDescription(id, create.description); } - const group = await this.client.groupMetadata(id); - this.logger.verbose('Getting group metadata'); + if (create?.promoteParticipants) { + this.logger.verbose('Prometing group participants: ' + participants); + await this.updateGParticipant({ + groupJid: id, + action: 'promote', + participants: participants, + }); + } - return { groupMetadata: group }; + this.logger.verbose('Getting group metadata'); + const group = await this.client.groupMetadata(id); + + return group; } catch (error) { this.logger.error(error); throw new InternalServerErrorException('Error creating group', error.toString()); @@ -2661,10 +3134,7 @@ export class WAStartupService { return { update: 'success' }; } catch (error) { - throw new InternalServerErrorException( - 'Error update group picture', - error.toString(), - ); + throw new InternalServerErrorException('Error update group picture', error.toString()); } } @@ -2675,10 +3145,7 @@ export class WAStartupService { return { update: 'success' }; } catch (error) { - throw new InternalServerErrorException( - 'Error updating group subject', - error.toString(), - ); + throw new InternalServerErrorException('Error updating group subject', error.toString()); } } @@ -2689,10 +3156,7 @@ export class WAStartupService { return { update: 'success' }; } catch (error) { - throw new InternalServerErrorException( - 'Error updating group description', - error.toString(), - ); + throw new InternalServerErrorException('Error updating group description', error.toString()); } } @@ -2828,10 +3292,7 @@ export class WAStartupService { public async updateGSetting(update: GroupUpdateSettingDto) { this.logger.verbose('Updating setting for group: ' + update.groupJid); try { - const updateSetting = await this.client.groupSettingUpdate( - update.groupJid, - update.action, - ); + const updateSetting = await this.client.groupSettingUpdate(update.groupJid, update.action); return { updateSetting: updateSetting }; } catch (error) { throw new BadRequestException('Error updating setting', error.toString()); @@ -2841,10 +3302,7 @@ export class WAStartupService { public async toggleEphemeral(update: GroupToggleEphemeralDto) { this.logger.verbose('Toggling ephemeral for group: ' + update.groupJid); try { - const toggleEphemeral = await this.client.groupToggleEphemeral( - update.groupJid, - update.expiration, - ); + await this.client.groupToggleEphemeral(update.groupJid, update.expiration); return { success: true }; } catch (error) { throw new BadRequestException('Error updating setting', error.toString()); diff --git a/src/whatsapp/types/wa.types.ts b/src/whatsapp/types/wa.types.ts index 169df515..2025e7f7 100644 --- a/src/whatsapp/types/wa.types.ts +++ b/src/whatsapp/types/wa.types.ts @@ -22,12 +22,22 @@ export enum Events { GROUPS_UPSERT = 'groups.upsert', GROUPS_UPDATE = 'groups.update', GROUP_PARTICIPANTS_UPDATE = 'group-participants.update', + CALL = 'call', + TYPEBOT_START = 'typebot.start', + TYPEBOT_CHANGE_STATUS = 'typebot.change-status', + CHAMA_AI_ACTION = 'chama-ai.action', } export declare namespace wa { - export type QrCode = { count?: number; base64?: string; code?: string }; + export type QrCode = { + count?: number; + pairingCode?: string; + base64?: string; + code?: string; + }; export type Instance = { qrcode?: QrCode; + pairingCode?: string; authState?: { state: AuthenticationState; saveCreds: () => void }; name?: string; wuid?: string; @@ -49,6 +59,59 @@ export declare namespace wa { url?: string; name_inbox?: string; sign_msg?: boolean; + number?: string; + reopen_conversation?: boolean; + conversation_pending?: boolean; + }; + + export type LocalSettings = { + reject_call?: boolean; + msg_call?: string; + groups_ignore?: boolean; + always_online?: boolean; + read_messages?: boolean; + read_status?: boolean; + }; + + export type LocalWebsocket = { + enabled?: boolean; + events?: string[]; + }; + + export type LocalRabbitmq = { + enabled?: boolean; + events?: string[]; + }; + + type Session = { + remoteJid?: string; + sessionId?: string; + createdAt?: number; + }; + + export type LocalTypebot = { + enabled?: boolean; + url?: string; + typebot?: string; + expire?: number; + keyword_finish?: string; + delay_message?: number; + unknown_message?: string; + listening_from_me?: boolean; + sessions?: Session[]; + }; + + export type LocalProxy = { + enabled?: boolean; + proxy?: string; + }; + + export type LocalChamaai = { + enabled?: boolean; + url?: string; + token?: string; + waNumber?: string; + answerByAudio?: boolean; }; export type StateConnection = { @@ -57,22 +120,10 @@ export declare namespace wa { statusReason?: number; }; - export type StatusMessage = - | 'ERROR' - | 'PENDING' - | 'SERVER_ACK' - | 'DELIVERY_ACK' - | 'READ' - | 'PLAYED'; + export type StatusMessage = 'ERROR' | 'PENDING' | 'SERVER_ACK' | 'DELIVERY_ACK' | 'READ' | 'DELETED' | 'PLAYED'; } -export const TypeMediaMessage = [ - 'imageMessage', - 'documentMessage', - 'audioMessage', - 'videoMessage', - 'stickerMessage', -]; +export const TypeMediaMessage = ['imageMessage', 'documentMessage', 'audioMessage', 'videoMessage', 'stickerMessage']; export const MessageSubtype = [ 'ephemeralMessage', diff --git a/src/whatsapp/whatsapp.module.ts b/src/whatsapp/whatsapp.module.ts index dbc80427..a37e98ef 100644 --- a/src/whatsapp/whatsapp.module.ts +++ b/src/whatsapp/whatsapp.module.ts @@ -1,39 +1,60 @@ -import { Auth, configService } from '../config/env.config'; -import { Logger } from '../config/logger.config'; +import { configService } from '../config/env.config'; import { eventEmitter } from '../config/event.config'; -import { MessageRepository } from './repository/message.repository'; -import { WAMonitoringService } from './services/monitor.service'; -import { ChatRepository } from './repository/chat.repository'; -import { ContactRepository } from './repository/contact.repository'; -import { MessageUpRepository } from './repository/messageUp.repository'; +import { Logger } from '../config/logger.config'; +import { dbserver } from '../libs/db.connect'; +import { RedisCache } from '../libs/redis.client'; +import { ChamaaiController } from './controllers/chamaai.controller'; import { ChatController } from './controllers/chat.controller'; -import { InstanceController } from './controllers/instance.controller'; -import { SendMessageController } from './controllers/sendMessage.controller'; -import { AuthService } from './services/auth.service'; -import { GroupController } from './controllers/group.controller'; -import { ViewsController } from './controllers/views.controller'; -import { WebhookService } from './services/webhook.service'; -import { WebhookController } from './controllers/webhook.controller'; -import { ChatwootService } from './services/chatwoot.service'; import { ChatwootController } from './controllers/chatwoot.controller'; -import { RepositoryBroker } from './repository/repository.manager'; +import { GroupController } from './controllers/group.controller'; +import { InstanceController } from './controllers/instance.controller'; +import { ProxyController } from './controllers/proxy.controller'; +import { RabbitmqController } from './controllers/rabbitmq.controller'; +import { SendMessageController } from './controllers/sendMessage.controller'; +import { SettingsController } from './controllers/settings.controller'; +import { TypebotController } from './controllers/typebot.controller'; +import { ViewsController } from './controllers/views.controller'; +import { WebhookController } from './controllers/webhook.controller'; +import { WebsocketController } from './controllers/websocket.controller'; import { AuthModel, + ChamaaiModel, ChatModel, + ChatwootModel, ContactModel, MessageModel, MessageUpModel, - ChatwootModel, + ProxyModel, + RabbitmqModel, + SettingsModel, + TypebotModel, WebhookModel, + WebsocketModel, } from './models'; -import { dbserver } from '../db/db.connect'; -import { WebhookRepository } from './repository/webhook.repository'; -import { ChatwootRepository } from './repository/chatwoot.repository'; import { AuthRepository } from './repository/auth.repository'; -import { WAStartupService } from './services/whatsapp.service'; -import { delay } from '@whiskeysockets/baileys'; -import { Events } from './types/wa.types'; -import { RedisCache } from '../db/redis.client'; +import { ChamaaiRepository } from './repository/chamaai.repository'; +import { ChatRepository } from './repository/chat.repository'; +import { ChatwootRepository } from './repository/chatwoot.repository'; +import { ContactRepository } from './repository/contact.repository'; +import { MessageRepository } from './repository/message.repository'; +import { MessageUpRepository } from './repository/messageUp.repository'; +import { ProxyRepository } from './repository/proxy.repository'; +import { RabbitmqRepository } from './repository/rabbitmq.repository'; +import { RepositoryBroker } from './repository/repository.manager'; +import { SettingsRepository } from './repository/settings.repository'; +import { TypebotRepository } from './repository/typebot.repository'; +import { WebhookRepository } from './repository/webhook.repository'; +import { WebsocketRepository } from './repository/websocket.repository'; +import { AuthService } from './services/auth.service'; +import { ChamaaiService } from './services/chamaai.service'; +import { ChatwootService } from './services/chatwoot.service'; +import { WAMonitoringService } from './services/monitor.service'; +import { ProxyService } from './services/proxy.service'; +import { RabbitmqService } from './services/rabbitmq.service'; +import { SettingsService } from './services/settings.service'; +import { TypebotService } from './services/typebot.service'; +import { WebhookService } from './services/webhook.service'; +import { WebsocketService } from './services/websocket.service'; const logger = new Logger('WA MODULE'); @@ -41,8 +62,14 @@ const messageRepository = new MessageRepository(MessageModel, configService); const chatRepository = new ChatRepository(ChatModel, configService); const contactRepository = new ContactRepository(ContactModel, configService); const messageUpdateRepository = new MessageUpRepository(MessageUpModel, configService); +const typebotRepository = new TypebotRepository(TypebotModel, configService); const webhookRepository = new WebhookRepository(WebhookModel, configService); +const websocketRepository = new WebsocketRepository(WebsocketModel, configService); +const proxyRepository = new ProxyRepository(ProxyModel, configService); +const chamaaiRepository = new ChamaaiRepository(ChamaaiModel, configService); +const rabbitmqRepository = new RabbitmqRepository(RabbitmqModel, configService); const chatwootRepository = new ChatwootRepository(ChatwootModel, configService); +const settingsRepository = new SettingsRepository(SettingsModel, configService); const authRepository = new AuthRepository(AuthModel, configService); export const repository = new RepositoryBroker( @@ -52,6 +79,12 @@ export const repository = new RepositoryBroker( messageUpdateRepository, webhookRepository, chatwootRepository, + settingsRepository, + websocketRepository, + rabbitmqRepository, + typebotRepository, + proxyRepository, + chamaaiRepository, authRepository, configService, dbserver?.getClient(), @@ -59,23 +92,42 @@ export const repository = new RepositoryBroker( export const cache = new RedisCache(); -export const waMonitor = new WAMonitoringService( - eventEmitter, - configService, - repository, - cache, -); +export const waMonitor = new WAMonitoringService(eventEmitter, configService, repository, cache); const authService = new AuthService(configService, waMonitor, repository); +const typebotService = new TypebotService(waMonitor); + +export const typebotController = new TypebotController(typebotService); + const webhookService = new WebhookService(waMonitor); export const webhookController = new WebhookController(webhookService); +const websocketService = new WebsocketService(waMonitor); + +export const websocketController = new WebsocketController(websocketService); + +const proxyService = new ProxyService(waMonitor); + +export const proxyController = new ProxyController(proxyService); + +const chamaaiService = new ChamaaiService(waMonitor, configService); + +export const chamaaiController = new ChamaaiController(chamaaiService); + +const rabbitmqService = new RabbitmqService(waMonitor); + +export const rabbitmqController = new RabbitmqController(rabbitmqService); + const chatwootService = new ChatwootService(waMonitor, configService); export const chatwootController = new ChatwootController(chatwootService, configService); +const settingsService = new SettingsService(waMonitor); + +export const settingsController = new SettingsController(settingsService); + export const instanceController = new InstanceController( waMonitor, configService, @@ -84,6 +136,10 @@ export const instanceController = new InstanceController( authService, webhookService, chatwootService, + settingsService, + websocketService, + rabbitmqService, + typebotService, cache, ); export const viewsController = new ViewsController(waMonitor, configService); @@ -91,111 +147,4 @@ export const sendMessageController = new SendMessageController(waMonitor); export const chatController = new ChatController(waMonitor); export const groupController = new GroupController(waMonitor); -export async function initInstance() { - const instance = new WAStartupService(configService, eventEmitter, repository, cache); - - const mode = configService.get('AUTHENTICATION').INSTANCE.MODE; - - logger.verbose('Sending data webhook for event: ' + Events.APPLICATION_STARTUP); - instance.sendDataWebhook( - Events.APPLICATION_STARTUP, - { - message: 'Application startup', - mode, - }, - false, - ); - - if (mode === 'container') { - logger.verbose('Application startup in container mode'); - - const instanceName = configService.get('AUTHENTICATION').INSTANCE.NAME; - logger.verbose('Instance name: ' + instanceName); - - const instanceWebhook = - configService.get('AUTHENTICATION').INSTANCE.WEBHOOK_URL; - logger.verbose('Instance webhook: ' + instanceWebhook); - - // const chatwootAccountId = - // configService.get('AUTHENTICATION').INSTANCE.CHATWOOT_ACCOUNT_ID; - // logger.verbose('Chatwoot account id: ' + chatwootAccountId); - - // const chatwootToken = - // configService.get('AUTHENTICATION').INSTANCE.CHATWOOT_TOKEN; - // logger.verbose('Chatwoot token: ' + chatwootToken); - - // const chatwootUrl = configService.get('AUTHENTICATION').INSTANCE.CHATWOOT_URL; - // logger.verbose('Chatwoot url: ' + chatwootUrl); - - instance.instanceName = instanceName; - - waMonitor.waInstances[instance.instanceName] = instance; - waMonitor.delInstanceTime(instance.instanceName); - - const hash = await authService.generateHash({ - instanceName: instance.instanceName, - token: configService.get('AUTHENTICATION').API_KEY.KEY, - }); - logger.verbose('Hash generated: ' + hash); - - if (instanceWebhook) { - logger.verbose('Creating webhook for instance: ' + instanceName); - try { - webhookService.create(instance, { enabled: true, url: instanceWebhook }); - logger.verbose('Webhook created'); - } catch (error) { - logger.log(error); - } - } - - // if (chatwootUrl && chatwootToken && chatwootAccountId) { - // logger.verbose('Creating chatwoot for instance: ' + instanceName); - // try { - // chatwootService.create(instance, { - // enabled: true, - // url: chatwootUrl, - // token: chatwootToken, - // account_id: chatwootAccountId, - // sign_msg: false, - // }); - // logger.verbose('Chatwoot created'); - // } catch (error) { - // logger.log(error); - // } - // } - - try { - const state = instance.connectionStatus?.state; - - switch (state) { - case 'close': - await instance.connectToWhatsapp(); - await delay(2000); - return instance.qrCode; - case 'connecting': - return instance.qrCode; - default: - return await this.connectionState({ instanceName }); - } - } catch (error) { - logger.log(error); - } - - const result = { - instance: { - instanceName: instance.instanceName, - status: 'created', - }, - hash, - webhook: instanceWebhook, - }; - - logger.info(result); - - return result; - } - - return null; -} - logger.info('Module - ON'); diff --git a/views/manager.hbs b/views/manager.hbs new file mode 100644 index 00000000..5414bdf1 --- /dev/null +++ b/views/manager.hbs @@ -0,0 +1,18 @@ + + + + + + + + + Instance Manager + + + + + + + + + \ No newline at end of file diff --git a/views/qrcode.hbs b/views/qrcode.hbs deleted file mode 100644 index 54f39251..00000000 --- a/views/qrcode.hbs +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - Generate QRCode - - - - -
- -
-

Connect to whatsapp

-
- - - -
-
-
- -
- -
- - - - - - \ No newline at end of file