Documentation

File: Constants.js

Description: This file defines constants used throughout the application. These constants are used for configuration, API endpoints, UI elements, and various other settings.

Constants


Constant: APP_NAME

Description: The name of the application.

Type: String

Value: "Komment AI Inc"


Constant: IP_SERVICE

Description: The URL for an IP address lookup service.

Type: String

Value: "https://ipapi.co/json"


Constant: ADMIN_EMAIL

Description: The email address of the application administrator.

Type: String

Value: "adi@komment.ai"


Constant: MAIL_FROM

Description: The email address used as the "from" address when sending emails.

Type: String

Value: "Komment <hello@komment.ai>"


Constant: CALENDLY_DEMO

Description: The URL for scheduling a demo through Calendly.

Type: String

Value: "https://calendly.com/komment/demo"


Constant: TERMLY_PRIVACY_POLICY

Description: The ID for the TermLys privacy policy.

Type: String

Value: "62155e0b-ff64-4d21-91d3-21da2f83930c"


Constant: TERMLY_TERMS_POLICY

Description: The ID for the TermLys terms of service policy.

Type: String

Value: "52aba87c-abdf-4c89-86df-bc9d071c7de5"


Constant: N_LOG_HISTORY

Description: The maximum number of log entries to keep in history.

Type: Number

Value: 500


Constant: SYSTEM_LOG_ID

Description: The identifier for system-generated log entries.

Type: String

Value: "system"


Constant: QS_COMMIT

Description: The commit identifier used for the quickstart feature.

Type: String

Value: "quickstart"


Constant: GITHUB_API_ENDPOINT

Description: The base URL for the GitHub API.

Type: String

Value: "https://api.github.com"


Constant: GITHUB_AUTH_URL

Description: The URL for GitHub OAuth authorization.

Type: String

Value: https://github.com/login/oauth/authorize?client_id=${process.env.REACT_APP_GITHUB_CLIENT}


Constant: GITHUB_APP_URL

Description: The URL for the GitHub application.

Type: String

Value: https://github.com/apps/${process.env.REACT_APP_GITHUB_APP}


Constant: GITHUB_INSTALL_URL

Description: The URL for GitHub installation selection.

Type: String

Value: ${GITHUB_APP_URL}/installations/select_target


Constant: GITLAB_API_ENDPOINT

Description: The base URL for the GitLab API.

Type: String

Value: "https://api.github.com"


Constant: GITLAB_SCOPE

Description: The scope of permissions requested for GitLab OAuth.

Type: String

Value: "api+read_user+profile"


Constant: GITLAB_AUTH_URL

Description: The URL for GitLab OAuth authorization.

Type: String

Value: https://gitlab.com/oauth/authorize?client_id=${process.env.REACT_APP_GITLAB_CLIENT}&response_type=code&scope=${GITLAB_SCOPE}


Constant: GITLAB_PAT_URL

Description: The URL for creating a personal access token on GitLab.

Type: String

Value: "https://gitlab.com/-/user_settings/personal_access_tokens"


Constant: BITBUCKET_AUTH_URL

Description: The URL for Bitbucket OAuth authorization.

Type: String

Value: https://bitbucket.org/site/oauth2/authorize?client_id=${process.env.REACT_APP_BITBUCKET_CLIENT}&response_type=code


Constant: STRIPE_PAYMENT_URL

Description: The URL for Stripe payment.

Type: String

Value: "http://buy.stripe.com/7sIg1eamx5vsgcU9AA"


Constant: Provider

Description: An object containing enums for supported providers (GitHub, GitLab).

Type: Object

Properties:

  • GITHUB: 'github'
  • GITLAB: 'gitlab'

Constant: ProviderBaseURL

Description: An object containing base URLs for supported providers.

Type: Object

Properties:

  • GITHUB: "https://github.com"
  • GITLAB: "https://gitlab.com"

Constant: Setup

Description: An object containing enums for setup states.

Type: Object

Properties:

  • INCOMPLETE: 1
  • IN_PROGRESS: 2
  • COMPLETE: 3

Constant: PipeStatus

Description: An object containing enums for pipeline status.

Type: Object

Properties:

  • FAILED: -1
  • COMPLETED: 0
  • IN_PROGRESS: 1
  • SKIPPED: 2
  • QUEUED: 3
  • REGISTERED: 4
  • STOPPED: 5

Constant: LogStatus

Description: An object containing enums for log status.

Type: Object

Properties:

  • INFO: 0
  • IN_PROGRESS: 1
  • SUCCESS: 2
  • ERROR: 3
  • DEBUG: 4
  • WARNING: 5

Constant: FormStatus

Description: An object containing enums for form status.

Type: Object

Properties:

  • ERROR: -1
  • UNSENT: 0
  • BUSY: 1
  • SENT: 2

Constant: MenuPosition

Description: An object containing enums for menu position.

Type: Object

Properties:

  • TOP: 0
  • BOTTOM: 1

Constant: ErrorStatus

Description: An object containing enums for error status.

Type: Object

Properties:

  • NONE: 0
  • ACTIVE: 1
  • INACTIVE: 2

Constant: RequestType

Description: An object containing enums for request types.

Type: Object

Properties:

  • AUTH: 1
  • INSTALL: 2
  • UPDATE: 3

Constant: FormErrorMsg

Description: A generic error message for forms.

Type: String

Value: "Something went wrong. Please try again."


Constant: ErrorMsg

Description: An object containing error messages for different field validations.

Type: Object

Properties:

  • FIELD_BLANK: "Please fill out this field"
  • EMAIL_INVALID: "Please enter a valid email address"
  • EMAIL_PERSONAL: "Please enter your professional email address"
  • PASSWORD_SHORT: "Please choose a longer password"
  • PASSWORD_WEAK: "Please choose a stronger password"

Constant: FormType

Description: An object containing enums for form types.

Type: Object

Properties:

  • CONTACT: 1
  • LOGIN: 2
  • REGISTER: 3
  • FORGOT: 4

Constant: RepoMode

Description: An object containing enums for repository mode.

Type: Object

Properties:

  • AUTO: 0
  • MANUAL: 1

Constant: OverwriteMode

Description: An object containing enums for overwrite mode.

Type: Object

Properties:

  • NEVER: false
  • ALWAYS: true

Constant: TriggerType

Description: An object containing enums for trigger types.

Type: Object

Properties:

  • PUSH: 0
  • PULL_REQUEST: 1

Constant: OutputChannel

Description: An object containing enums for output channel types.

Type: Object

Properties:

  • DIRECT_PUSH: 0
  • PULL_REQUEST: 1

Constant: ContactType

Description: An object containing enums for contact type.

Type: Object

Properties:

  • SUPPORT: 1
  • FEATURE: 2
  • ISSUE: 3

Constant: ModalPath

Description: An object containing URLs for different modal windows.

Type: Object

Properties:

  • CONNECTION: "#connection"
  • QUICKSTART: "#quickstart"
  • CONTACT: "#contact"

Constant: DocState

Description: An object containing enums for document state.

Type: Object

Properties:

  • INCOMPLETE: -1
  • COMPLETE: 0
  • IN_PROGRESS: 1

Constant: DocType

Description: An object containing enums for document type.

Type: Object

Properties:

  • INTERFACE: "interface"
  • CLASS: "class"
  • CONSTRUCTOR: "constructor"
  • METHOD: "method"
  • FUNCTION: "function"

Constant: PlanType

Description: An object containing enums for plan types.

Type: Object

Properties:

  • FREE: 0
  • BASIC: 1
  • PREMIUM: 2
  • ENTERPRISE: 3

Constant: PlanName

Description: An object containing names for each plan type.

Type: Object

Properties:

  • [PlanType.FREE]: "Starter"
  • [PlanType.BASIC]: "Developer"
  • [PlanType.PREMIUM]: "Teams"
  • [PlanType.ENTERPRISE]: "Enterprise"

Constant: PlanStatus

Description: An object containing enums for plan status.

Type: Object

Properties:

  • PENDING: 0
  • ACTIVE: 1
  • EXPIRING: 2
  • DISABLED: 3

Description: The recommended plan type for users.

Type: Number

Value: PlanType.PREMIUM


Constant: PERSONAL_DOMAINS

Description: An array of common personal email domain names.

Type: Array

Value: [ "gmail", "yahoo", "hotmail", "aol", "msn", "outlook", "live", "comcast", "free", "gmx", "web", "mail", "ymail", "yandex", "inbox", "icloud", "skiff", ]


Constant: MIN_PASS_LEN

Description: The minimum allowed length for passwords.

Type: Number

Value: 8


Constant: EMAIL_TEMPLATES

Description: An object containing IDs for email templates.

Type: Object

Properties:

  • admin: 34496455
  • user: 34496456

Constant: GITLAB_DISABLED

Description: A flag indicating whether GitLab integration is disabled.

Type: Boolean

Value: process.env.REACT_APP_GITLAB_DISABLED === "true" || false


Constant: LINKED_ACCOUNTS

Description: A flag indicating whether linked account functionality is enabled.

Type: Boolean

Value: false


Constant: ENABLE_BULK_RUN

Description: A flag indicating whether bulk run functionality is enabled.

Type: Boolean

Value: process.env.REACT_APP_ENABLE_BULK_RUN === "true" || false


Constant: SHOW_MY_DOCS

Description: A flag indicating whether the "My Docs" section should be shown.

Type: Boolean

Value: process.env.REACT_APP_SHOW_MY_DOCS === "true" || false


Constant: DAY_HOURS

Description: The number of work hours in a day.

Type: Number

Value: 8


Constant: YEARLY_HOURS

Description: An estimate of the number of legal work hours in a year.

Type: Number

Value: 5 * DAY_HOURS * 52 - 10 * DAY_HOURS


Constant: DESKTOP_WIDTH_THRESH

Description: The minimum screen width considered to be a desktop.

Type: Number

Value: 470


Notes:

  • The constants are exported for use in other parts of the application.
  • Many constants are defined using environment variables for flexibility and ease of configuration.
  • The documentation provides a clear and concise explanation of each constant's purpose and value.