#  ┌──────────────────────────────────────────────────────────────────────────────┐
#  │ @author jrCleber                                                             |
#  │ @filename dev-env.yml                                                        │
#  │ Developed by: Cleber Wilson                                                  │
#  │ File name: dev-env.yml                                                       │
#  │ Creation date: Nov 27, 2022                                                  │
#  │ Contact: contato@codechat.dev                                                │
#  ├──────────────────────────────────────────────────────────────────────────────┤
#  │ @copyright © Cleber Wilson 2022. All rights reserved.                        │
#  │ Licensed under the Apache License, Version 2.0                               │
#  │                                                                              │
#  │  @license "https://github.com/code-chat-br/whatsapp-api/blob/main/LICENSE"   │
#  │                                                                              │
#  │ You may not use this file except in compliance with the License.             │
#  │ You may obtain a copy of the License at                                      │
#  │                                                                              │
#  │    http://www.apache.org/licenses/LICENSE-2.0                                │
#  │                                                                              │
#  │ Unless required by applicable law or agreed to in writing, software          │
#  │ distributed under the License is distributed on an "AS IS" BASIS,            │
#  │ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.     │
#  │                                                                              │
#  │ See the License for the specific language governing permissions and          │
#  │ limitations under the License.                                               │
#  ├──────────────────────────────────────────────────────────────────────────────┤
#  │ @important                                                                   │
#  │ For any future changes to the code in this file, it is recommended to        │
#  │ contain, together with the modification, the information of the developer    │
#  │ who changed it and the date of modification.                                 │
#  └──────────────────────────────────────────────────────────────────────────────┘

# ⚠️
# ⚠️ ALL SETTINGS DEFINED IN THIS FILE ARE APPLIED TO ALL INSTANCES.
# ⚠️

# ⚠️ COPY THIS FILE TO env.yml

# Choose the server type for the application
SERVER:
  TYPE: https
  PORT: 3123

CORS:
  ORIGIN:
    - '*'

  METHODS:
    - POST
    - GET
    - PUT
    - DELETE
  CREDENTIALS: true

# Install ssl certificate and replace string <domain> with domain name
# Access: https://certbot.eff.org/instructions?ws=other&os=ubuntufocal
SSL_CONF:
  PRIVKEY: /home/denbit/etc/letsencrypt/node/dentalbit/privkey.pem
  FULLCHAIN: /home/denbit/etc/letsencrypt/node/dentalbit/fullchain.pem

# Determine the logs to be displayed
LOG:
  LEVEL:
    - ERROR
    - WARN
    - DEBUG
    - INFO
    - LOG
    - VERBOSE
    - DARK
  COLOR: true

# 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: 5 # or false

# Temporary data storage
STORE:
  CLEANING_INTERVAL: 7200 # seconds === 2h
  MESSAGE: true
  CONTACTS: false
  CHATS: false

# Permanent data storage
DATABASE:
  ENABLED: false
  CONNECTION:
    URI: 'mongodb://<USER>:<PASSWORD>@<HOST>/?authSource=admin&readPreference=primary&ssl=false&directConnection=true'
    DB_PREFIX_NAME: codechat
  # Choose the data you want to save in the application's database or store
  SAVE_DATA:
    INSTANCE: true
    OLD_MESSAGE: true
    NEW_MESSAGE: true
    MESSAGE_UPDATE: true
    CONTACTS: true
    CHATS: true

REDIS:
  ENABLED: false
  URI: 'redis://<HOST>'
  PREFIX_KEY: 'codechat'

# Webhook Settings
WEBHOOK:
  # Define a global webhook that will listen for enabled events from all instances
  GLOBAL:
    URL: <url>
    ENABLED: false
  # Automatically maps webhook paths
  # Set the events you want to hear  
  EVENTS:
    QRCODE_UPDATED: false
    MESSAGES_SET: true
    MESSAGES_UPSERT: true
    MESSAGES_UPDATE: true
    SEND_MESSAGE: true
    CONTACTS_SET: false
    CONTACTS_UPSERT: false
    CONTACTS_UPDATE: false
    PRESENCE_UPDATE: false
    CHATS_SET: false
    CHATS_UPSERT: false
    CHATS_UPDATE: false
    CHATS_DELETE: false
    GROUPS_UPSERT: false
    GROUP_UPDATE: false
    GROUP_PARTICIPANTS_UPDATE: false
    CONNECTION_UPDATE: false
    # This event fires every time a new token is requested via the refresh route
    NEW_JWT_TOKEN: false

CONFIG_SESSION_PHONE:
  # Name that will be displayed on smartphone connection
  CLIENT: Dentalbit
  NAME: Chrome # firefox | edge | opera | safari

# Set qrcode display limit
QRCODE:
  LIMIT: 6

# Defines an authentication type for the api
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.
  API_KEY: zYzP7ocstxh3SJ23D4FZTCu4ehnM8v4huDb
  # Set the secret key to encrypt and decrypt your token and its expiration time.
  JWT:
    EXPIRIN_IN: 0 # seconds - 3600s === 1h | zero (0) - never expires
    SECRET: 3RFYiiRmvNiokSBrLZzx

SESSION_SECRET: W0NvZGVDaGF0XTpbU2Vzc2lvbiBTZWNyZXQgS2V5Ll0=