"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var config_exports = {};
__export(config_exports, {
  appDetails: () => appDetails,
  authorization: () => authorization,
  awsCredentials: () => awsCredentials,
  dbDetails: () => dbDetails,
  dbErrorMessages: () => dbErrorMessages,
  environment: () => environment,
  generalSettings: () => generalSettings,
  jwtSecret: () => jwtSecret,
  mailConfig: () => mailConfig,
  openAIKey: () => openAIKey,
  publicRequestLimit: () => publicRequestLimit,
  statusCodes: () => statusCodes,
  tokenExpiry: () => tokenExpiry,
  webHookToken: () => webHookToken,
  websocketConfig: () => websocketConfig
});
module.exports = __toCommonJS(config_exports);
var dotenv = __toESM(require("dotenv"));
var import_path = require("path");
const envFile = process.env.NODE_ENV == "production" || process.env.NODE_ENV == "staging" ? ".env." + process.env.NODE_ENV : ".env.development";
dotenv.config({ path: (0, import_path.resolve)(__dirname, envFile) });
const jwtSecret = process.env.JWT_SECRET || "secret";
const authorization = process.env.AUTHORIZATION || "";
const environment = process.env.ENVIRONMENT || "development";
const tokenExpiry = "1h";
const openAIKey = process.env.OPENAI_KEY || "";
const webHookToken = process.env.WEB_HOOK_TOKEN || "HOOKWEB";
const publicRequestLimit = {
  timing: 5 * 60 * 1e3,
  // last 10 minutes
  limit: 50
  // request limit
};
const appDetails = {
  appName: process.env.APP_NAME || "",
  baseUrl: process.env.BASE_URL || "",
  port: process.env.PORT || 3131,
  adminMail: process.env.ADMIN_MAIL || "",
  origin: process.env.ORIGIN || "*"
};
const dbDetails = {
  from: process.env.DATABASE_FROM || "pg",
  provider: process.env.DATABASE_PROVIDER || "postgresql",
  user: process.env.DATABASE_USER || "postgres",
  pass: process.env.DATABASE_PASSWORD || "postgres",
  host: process.env.DATABASE_HOST || "localhost",
  db: process.env.DATABASE_NAME || "lcp_framework",
  trusted_connection: (process.env.DATABASE_TRUSTED ?? "false") !== "false",
  driver: process.env.DATABASE_DRIVER || "ODBC Driver 17 for SQL Server",
  port: (typeof process.env.DATABASE_PORT === "string" ? parseInt(process.env.DATABASE_PORT) : process.env.DATABASE_PORT) || 5432,
  mobile_db_name: "lcp"
};
const mailConfig = {
  mailer: process.env.MAIL_MAILER,
  host: process.env.MAIL_HOST || "",
  port: process.env.MAIL_PORT,
  username: process.env.MAIL_USERNAME,
  password: process.env.MAIL_PASSWORD,
  encryption: process.env.MAIL_ENCRYPTION,
  fromAddress: process.env.MAIL_FROM_ADDRESS,
  fromName: process.env.MAIL_FROM_NAME || process.env.APP_NAME,
  replyTo: process.env.MAIL_REPLY_TO
};
const awsCredentials = {
  region: process.env.AWS_REGION || "",
  bucket: process.env.AWS_BUCKET || "",
  accessKeyId: process.env.AWS_ACCESS_KEY_ID || "",
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || "",
  endpoint: process.env.AWS_ENDPOINT || "",
  environmentFolder: process.env.AWS_ENVIRONMENT_FOLDER || ""
};
const generalSettings = {
  login_type: process.env.LOGIN_TYPE || "password",
  // otp or password
  email_verification: false,
  password_criteria: true,
  otp_validity: 5,
  // In minutes
  allow_admin_url_to_sadmin: true
  // Super admin can access admin API's
};
const websocketConfig = {
  ssl: process.env.WS_SSL === "yes",
  port: parseInt(process.env.WS_PORT || "8089", 10),
  // Parse as a number
  host: process.env.WS_HOST || "localhost:8089",
  sslCertPath: process.env.WS_SSL_CERT_PATH || "",
  sslKeyPath: process.env.WS_SSL_KEY_PATH || ""
};
const statusCodes = {
  res_status: 200,
  // This one should be null if you want to apply diffrent response ststus
  success: 200,
  email_verification: 202,
  login_verification: 203,
  validation_error: 400,
  unauthorized: 401,
  invalid_user: 421,
  invalid_token: 402,
  access_denied: 403,
  page_not_found: 404,
  user_defined_error: 405,
  something_wrong: 500,
  password_criteria: 422,
  old_password_invalid: 423,
  otp_expired: 424,
  invalid_otp: 425,
  data_not_found: 426,
  too_many_request: 429
};
const dbErrorMessages = {
  // Unique constraint violation (duplicate field)
  "23505": `The provided information contains duplicate data. Please update it and try again.`,
  // Foreign key violation
  "23503": "We couldn\u2019t find the related record. Please check if the information is correct.",
  // Not-null constraint violation
  "23502": "Please fill in this required information.",
  // String data too long
  "22001": "Your input is too long. Please shorten it and try again.",
  // Integrity constraint violation
  "23000": "Something went wrong with the data. Please check and try again.",
  // Undefined table
  "42P01": "The requested data is not available. Please contact support.",
  // Undefined function
  "42883": "The requested action could not be completed. Please check your request.",
  // Numeric value out of range
  "22003": "The number you entered is too large. Please use a smaller number.",
  // Syntax error
  "42601": "There was an issue with the input format. Please double-check your entry.",
  // Connection does not exist
  "08003": "We couldn\u2019t connect to the database. Please check your connection.",
  // Serialization failure (for concurrent transactions)
  "40001": "There was a conflict while processing your request. Please try again.",
  // Duplicate table
  "42P07": "A table with this name already exists. Please choose a different name.",
  // Undefined column
  "42703": "We couldn\u2019t find this information. Please check the details.",
  // Query canceled by user request
  "57014": "The request was canceled. Please check your input and try again.",
  // Ambiguous column reference
  "42P02": "There\u2019s some confusion about the data. Please clarify and try again.",
  // PL/pgSQL exception (trigger or rule violation)
  "P0001": "Something went wrong while processing your request. Please try again later.",
  // Invalid parameter value
  "22023": "The value you provided is not valid. Please double-check your input.",
  // Insufficient privilege
  "42501": "You don\u2019t have permission to perform this action.",
  // Invalid transaction state
  "42P10": "There was an issue with your request. Please try again.",
  // Too many tables in the query
  "42P11": "There are too many references. Please simplify your request.",
  // Unknown error (fallback message)
  "default": "An unexpected error occurred. Please try again later.",
  // Invalid text representation
  "22P02": "The data you entered is incorrect. Please check the format.",
  // Division by zero
  "22012": "You cannot divide by zero. Please adjust your calculation.",
  // Invalid date format
  "22008": "The date format is incorrect. Please enter a valid date.",
  // Data type mismatch
  "42804": "There\u2019s an issue with the data type. Please check your input.",
  // Invalid array dimension
  "22007": "The array size is incorrect. Please adjust your input.",
  // Invalid JSON
  "39001": "The data format is incorrect. Please check the structure.",
  // Invalid cast
  "42846": "The data type cannot be converted. Please check your input.",
  // Duplicate function
  "42P05": "A function with this name already exists. Please choose a different name.",
  // Duplicate column
  "42P06": "A column with this name already exists. Please use a different name.",
  // Invalid schema name
  "3D000": "The requested data structure does not exist. Please contact support.",
  // Invalid object name
  "42P03": "The object you\u2019re looking for doesn\u2019t exist. Please check the name."
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  appDetails,
  authorization,
  awsCredentials,
  dbDetails,
  dbErrorMessages,
  environment,
  generalSettings,
  jwtSecret,
  mailConfig,
  openAIKey,
  publicRequestLimit,
  statusCodes,
  tokenExpiry,
  webHookToken,
  websocketConfig
});
