Compare commits

..

4 Commits

Author SHA1 Message Date
Simon Larsen
446e947cc9 Update Dockerfile and package.json scripts 2024-02-02 07:07:26 +00:00
Simon Larsen
428c563659 Remove accounts service from docker-compose files 2024-02-02 06:45:57 +00:00
Simon Larsen
34a83637e1 Update Dockerfile and package.json for Accounts feature 2024-02-02 06:44:59 +00:00
Simon Larsen
27d030ab30 move accounts to featureset 2024-02-02 06:34:53 +00:00
5085 changed files with 325452 additions and 547491 deletions

View File

@@ -1,68 +0,0 @@
# These are aliases that will make your life simple when you're building OneUptime
# Make directory and change directory at the same time.
mkcdir ()
{
mkdir -p -- "$1" &&
cd -P -- "$1"
}
# Git aliases
alias g="git"
alias gs="git status"
alias ga="git add"
alias gc="git checkout"
alias gb="git branch"
alias gp="git pull"
alias gpo="git push origin"
alias gl="git log"
alias gd="git diff"
alias gm="git merge"
# Kubernetes aliases
alias k="kubectl"
alias kg="kubectl get"
alias kd="kubectl describe"
alias kc="kubectl create"
alias kdel="kubectl delete"
alias klo="kubectl logs"
alias klof="kubectl logs -f"
alias kex="kubectl exec"
alias kexi="kubectl exec -it"
# Docker aliases
alias d="docker"
alias dc="docker compose"
alias dcu="docker compose up"
alias dcd="docker compose down"
# Node aliases
alias n="npm"
alias ni="npm install"
alias nis="npm install --save"
alias nid="npm install --save-dev"
alias nr="npm run"
alias nt="npm test"
alias ns="npm start"
alias nb="npm build"
# Rust aliases
alias c="cargo"
alias cb="cargo build"
alias cr="cargo run"
# OneUptime Specific Aliases
# --------------------------
alias nrd="npm run dev"
alias nrl="npm run logs"
alias nrb="npm run build"
alias nrfb="npm run force-build"
alias nrps="npm run ps-dev"
# OneUptime LLM Server
alias nrfbl="npm run force-build-llm"
alias nrdl="npm run dev-llm"
alias nrll="npm run logs-llm"
alias nrbl="npm run build-llm"

View File

@@ -56,4 +56,5 @@ settings.json
GoSDK/tester/
Llama/Models/*

28
.eslintignore Normal file
View File

@@ -0,0 +1,28 @@
*/node_modules/*
*/build/*
*/coverage/*
*/dist/*
*/public/*
*/views/*
*fonts*
*logos*
.*
*.png
*.sh
*.txt
*.snap
*.enc
Dockerfile
CHANGELOG
LICENSE
marketing/*/*
licenses/*
certifications/*
ApiReference/public/assets/*
JavaScriptSDK/src/cli/server-monitor/out/scripts/prettify/*
_test/*

191
.eslintrc.json Normal file
View File

@@ -0,0 +1,191 @@
{
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true,
"tsx": true,
"spread": true
},
"sourceType": "module",
"project": [
"./tsconfig.json"
]
},
"env": {
"browser": true,
"node": true,
"jquery": true,
"es6": true,
"jest": true,
"jasmine": true
},
"plugins": [
"react",
"jsx-a11y",
"progress",
"@typescript-eslint",
"unused-imports"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended",
"prettier"
],
"globals": {
"describe": true,
"context": true,
"before": true,
"beforeEach": true,
"after": true,
"afterEach": true,
"it": true,
"expect": true,
"workbox": true,
"importScripts": true,
"$TSFixMe": true,
"NodeJS": true,
"JSX": true
},
"parser": "@typescript-eslint/parser",
"rules": {
"no-fallthrough": "error",
"no-unreachable": "error",
"no-cond-assign": "error",
"valid-typeof": "error",
"no-func-assign": "error",
"curly": "error",
"no-extra-semi": "error",
"no-else-return": "error",
"no-div-regex": "error",
"no-octal": "error",
"no-extra-bind": "error",
"unicode-bom": "error",
"no-extra-boolean-cast": "error",
"wrap-regex": "error",
"wrap-iife": "error",
"yield-star-spacing": "error",
"no-implicit-coercion": "error",
"no-extra-label": "error",
"multiline-comment-style": "off",
"no-lonely-if": "error",
"no-floating-decimal": "error",
"eqeqeq": "error",
"dot-notation": "off", // Off because it messes up with typescript compiler.
"@typescript-eslint/dot-notation": "off", //temp off.
"progress/activate": 1,
"linebreak-style": [
"error",
"unix"
],
"@typescript-eslint/no-empty-interface": [
"error",
{
"allowSingleExtends": true
}
],
// https://www.npmjs.com/package/eslint-plugin-unused-imports
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", {"argsIgnorePattern": "^_"}],
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-floating-promises":"error",
"@typescript-eslint/await-thenable":"error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/explicit-member-accessibility": [
"error"
],
"no-console": "error",
"no-undef": "error",
"no-empty": "error",
"prefer-arrow-callback": "error",
"constructor-super": "error",
"no-case-declarations": "error",
"no-mixed-spaces-and-tabs": "error",
"no-useless-escape": "error",
"prettier/prettier": "error",
"react/jsx-no-undef": "error",
"react/jsx-no-bind": [
"error",
{
"allowArrowFunctions": true,
"allowBind": false,
"ignoreRefs": false
}
],
"react/no-children-prop": "error",
"react/no-deprecated": "error",
"react/boolean-prop-naming": "error",
"react/no-is-mounted": "error",
"react/no-find-dom-node": "error",
"one-var-declaration-per-line": "error",
"arrow-parens": "error",
"arrow-body-style": [
"error",
"always"
],
"@typescript-eslint/typedef": [
"error",
{
"arrowParameter": true,
"variableDeclaration": true
}
],
"@typescript-eslint/strict-boolean-expressions": "off", //Need to enable this very soon
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"react/no-did-update-set-state": "error",
"react/no-unknown-property": "error",
"react/no-unused-prop-types": "error",
"react/jsx-no-duplicate-props": "error",
"react/no-unused-state": "error",
"react/jsx-uses-vars": "error",
"react/prop-types": "error",
"react/react-in-jsx-scope": "error",
"react/no-string-refs": "error",
"jsx-a11y/href-no-hash": [
0
],
"react/no-unescaped-entities": "error",
"react/display-name": "error",
"react/jsx-pascal-case": "error",
"array-callback-return": "error",
"no-loop-func": "error",
"no-duplicate-imports": "error",
"no-promise-executor-return": "error",
"capitalized-comments": "off", // this is turned off because come commented code should not be capitalized.
"for-direction": "error",
"getter-return": "error",
"jsx-a11y/anchor-is-valid": "error",
"no-async-promise-executor": "error",
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": false
}
],
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"no-unneeded-ternary": "error"
},
"settings": {
"react": {
"version": "18.1.0"
}
}
}

View File

@@ -1,7 +1,7 @@
---
name: Bug report
about: Create a report to help us improve
title: '<Title of the issue>'
title: 'Bug: <Title of the issue>'
labels: 'bug'
assignees: ''

View File

@@ -1,7 +1,7 @@
---
name: Feature request
about: Suggest an idea for this project
title: '<Title of the issue>'
title: 'Enhancement: <Title of the issue>'
labels: 'enhancement'
assignees: ''

View File

@@ -1,414 +0,0 @@
name: Build
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*'
- 'release'
jobs:
docker-build-accounts:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./Accounts/Dockerfile .
docker-build-isolated-vm:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./IsolatedVM/Dockerfile .
docker-build-home:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./Home/Dockerfile .
docker-build-worker:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./Worker/Dockerfile .
docker-build-workflow:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./Workflow/Dockerfile .
docker-build-api-reference:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./APIReference/Dockerfile .
docker-build-docs:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./Docs/Dockerfile .
docker-build-otel-collector:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./OTelCollector/Dockerfile .
docker-build-app:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./App/Dockerfile .
docker-build-copilot:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./Copilot/Dockerfile .
docker-build-e2e:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./E2E/Dockerfile .
docker-build-admin-dashboard:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for home
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./AdminDashboard/Dockerfile .
docker-build-dashboard:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for home
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./Dashboard/Dockerfile .
docker-build-probe:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image probe api
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./Probe/Dockerfile .
docker-build-probe-ingest:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image probe api
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./ProbeIngest/Dockerfile .
docker-build-server-monitor-ingest:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image probe api
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./ServerMonitorIngest/Dockerfile .
docker-build-open-telemetry-ingest:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image probe api
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./OpenTelemetryIngest/Dockerfile .
docker-build-incoming-request-ingest:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image probe api
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./IncomingRequestIngest/Dockerfile .
docker-build-fluent-ingest:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image probe api
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./FluentIngest/Dockerfile .
docker-build-status-page:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for home
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./StatusPage/Dockerfile .
docker-build-test-server:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preinstall
run: npm run prerun
# build image for mail service
- name: build docker image
uses: nick-fields/retry@v3
with:
timeout_minutes: 45
max_attempts: 3
command: sudo docker build -f ./TestServer/Dockerfile .

View File

@@ -31,8 +31,10 @@ jobs:
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'typescript', 'go' ]
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

View File

@@ -14,7 +14,7 @@ jobs:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: Install Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
@@ -28,7 +28,7 @@ jobs:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@v2
- run: sudo apt-get update
- run: sudo apt-get install -y curl gcc
- run: sudo apt-get install -y build-essential

View File

@@ -15,202 +15,68 @@ jobs:
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
node-version: 18.3.0
- run: cd Common && npm install
- name: Compile Accounts
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd Accounts && npm install && npm run compile && npm run dep-check
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd CommonUI && npm install --force
- run: cd Accounts && npm install && npm run compile && npm run dep-check
compile-isolated-vm:
compile-common-server:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
node-version: 18.3.0
- run: cd Common && npm install
- name: Compile IsolatedVM
uses: nick-fields/retry@v3
- run: cd Model && npm install
- run: cd CommonServer && npm install && npm run compile && npm run dep-check
compile-common-ui:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
timeout_minutes: 30
max_attempts: 3
command: cd IsolatedVM && npm install && npm run compile && npm run dep-check
node-version: 18.3.0
- run: cd Common && npm install
- run: cd Model && npm install
- run: cd CommonUI && npm install --force && npm run compile && npm run dep-check
compile-common:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
- name: Compile Common
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd Common && npm install && npm run compile && npm run dep-check
node-version: 18.3.0
- run: cd Common && npm install
- run: cd Model && npm install && npm run compile && npm run dep-check
compile-app:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
node-version: 18.3.0
- run: cd Common && npm install
- name: Compile App
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd App && npm install && npm run compile && npm run dep-check
compile-home:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile Home
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd Home && npm install && npm run compile && npm run dep-check
compile-worker:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile Worker
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd Worker && npm install && npm run compile && npm run dep-check
compile-workflow:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile Workflow
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd Workflow && npm install && npm run compile && npm run dep-check
compile-api-reference:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile API Reference
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd APIReference && npm install && npm run compile && npm run dep-check
compile-docs-reference:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile Docs Reference
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd Docs && npm install && npm run compile && npm run dep-check
compile-copilot:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile Copilot
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd Copilot && npm install && npm run compile && npm run dep-check
compile-nginx:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile Nginx
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd Nginx && npm install && npm run compile && npm run dep-check
compile-infrastructure-agent:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
# Setup Go
- uses: actions/setup-go@v5
- name: Compile Infrastructure Agent
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd InfrastructureAgent && go build .
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd CommonUI && npm install --force
- run: cd App && npm install && npm run compile && npm run dep-check
compile-admin-dashboard:
@@ -218,158 +84,83 @@ jobs:
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
node-version: 18.3.0
- run: cd Common && npm install
- name: Compile Admin Dashboard
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd AdminDashboard && npm install && npm run compile && npm run dep-check
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd CommonUI && npm install --force
- run: cd AdminDashboard && npm install && npm run compile && npm run dep-check
compile-dashboard:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
node-version: 18.3.0
- run: cd Common && npm install
- name: Compile Dashboard
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd Dashboard && npm install && npm run compile && npm run dep-check
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd CommonUI && npm install --force
- run: cd Dashboard && npm install && npm run compile && npm run dep-check
compile-model:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: cd Common && npm install
- run: cd Model && npm install
- run: cd Model && npm install && npm run compile && npm run dep-check
compile-e2e:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
- run: sudo apt-get update
- run: cd Common && npm install
- name: Compile E2E
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd E2E && npm install && npm run compile && npm run dep-check
node-version: 18.3.0
- run: cd E2E && npm install && npm run compile && npm run dep-check
compile-probe:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
node-version: 18.3.0
- run: cd Common && npm install
- name: Compile Probe
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd Probe && npm install && npm run compile && npm run dep-check
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd Probe && npm install && npm run compile && npm run dep-check
compile-probe-ingest:
compile-ingestor:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
node-version: 18.3.0
- run: cd Common && npm install
- name: Compile Probe Ingest
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd ProbeIngest && npm install && npm run compile && npm run dep-check
compile-server-monitor-ingest:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile Server Monitor Ingest
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd ServerMonitorIngest && npm install && npm run compile && npm run dep-check
compile-open-telemetry-ingest:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile Open Telemetry Ingest
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd OpenTelemetryIngest && npm install && npm run compile && npm run dep-check
compile-incoming-request-ingest:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile Incoming Request Ingest
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd IncomingRequestIngest && npm install && npm run compile && npm run dep-check
compile-fluent-ingest:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile Fluent Ingest
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd FluentIngest && npm install && npm run compile && npm run dep-check
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd Ingestor && npm install && npm run compile && npm run dep-check
compile-status-page:
@@ -377,49 +168,26 @@ jobs:
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
node-version: 18.3.0
- run: cd Common && npm install
- name: Compile Status Page
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd StatusPage && npm install && npm run compile && npm run dep-check
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd CommonUI && npm install --force
- run: cd StatusPage && npm install && npm run compile && npm run dep-check
compile-test-server:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
node-version: 18.3.0
- run: cd Common && npm install
- name: Compile Test Server
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd TestServer && npm install && npm run compile && npm run dep-check
compile-mcp:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- name: Compile MCP
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: cd MCP && npm install && npm run compile && npm run dep-check
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd TestServer && npm install && npm run compile && npm run dep-check

165
.github/workflows/docker-build.yml vendored Normal file
View File

@@ -0,0 +1,165 @@
name: Docker Build
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*'
- 'release'
jobs:
docker-build-accounts:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
run: sudo docker build -f ./Accounts/Dockerfile .
docker-build-otel-collector:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
run: sudo docker build -f ./OTelCollector/Dockerfile .
docker-build-app:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build image for accounts service
- name: build docker image
run: sudo docker build -f ./App/Dockerfile .
docker-build-admin-dashboard:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build image for home
- name: build docker image
run: sudo docker build -f ./AdminDashboard/Dockerfile .
docker-build-dashboard:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build image for home
- name: build docker image
run: sudo docker build -f ./Dashboard/Dockerfile .
docker-build-haraka:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build images
- name: build docker image
run: sudo docker build -f ./Haraka/Dockerfile .
docker-build-probe:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build image probe api
- name: build docker image
run: sudo docker build -f ./Probe/Dockerfile .
docker-build-ingestor:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build image probe api
- name: build docker image
run: sudo docker build -f ./Ingestor/Dockerfile .
docker-build-status-page:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build image for home
- name: build docker image
run: sudo docker build -f ./StatusPage/Dockerfile .
docker-build-test-server:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build image for mail service
- name: build docker image
run: sudo docker build -f ./TestServer/Dockerfile .

View File

@@ -0,0 +1,16 @@
name: Misc / Dependabot Automerge
on:
pull_request:
jobs:
merge:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,74 +0,0 @@
name: OpenAPI Spec Generation
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*'
- 'release'
jobs:
generate-openapi-spec:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{ github.run_number }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: 'npm'
- name: Install Common dependencies
run: cd Common && npm install
- name: Install root dependencies
run: npm install
- name: Install Script dependencies
run: cd Scripts && npm install
- name: Generate OpenAPI specification
run: npm run generate-openapi-spec
- name: Check if OpenAPI spec was generated
run: |
if [ -f "./openapi.json" ]; then
echo "✅ OpenAPI spec file generated successfully"
echo "📄 File size: $(du -h ./openapi.json | cut -f1)"
echo "📊 Spec contains $(jq '.paths | length' ./openapi.json) API paths"
echo "🏷️ API version: $(jq -r '.info.version' ./openapi.json)"
echo "📝 API title: $(jq -r '.info.title' ./openapi.json)"
else
echo "❌ OpenAPI spec file was not generated"
exit 1
fi
- name: Validate OpenAPI spec format
run: |
# Check if the file is valid JSON
if jq empty ./openapi.json; then
echo "✅ OpenAPI spec is valid JSON"
else
echo "❌ OpenAPI spec is not valid JSON"
exit 1
fi
# Check if it has required OpenAPI fields
if jq -e '.openapi and .info and .paths' ./openapi.json > /dev/null; then
echo "✅ OpenAPI spec has required fields"
else
echo "❌ OpenAPI spec missing required fields (openapi, info, paths)"
exit 1
fi
- name: Upload OpenAPI spec as artifact
uses: actions/upload-artifact@v4
with:
name: openapi-spec
path: ./openapi.json
retention-days: 30

31
.github/workflows/playwright.yml.skip vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
BASE_URL: http://localhost
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Run Server in Docker
run: npm run dev
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: cd Playwright && npm install && npx playwright install && npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

File diff suppressed because it is too large Load Diff

View File

@@ -1,32 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
name: "OneUptime Reliability Copilot"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
# Run every day at midnight UTC
- cron: '0 0 * * *'
jobs:
analyze:
name: Analyze Code
runs-on: ubuntu-latest
steps:
# Run Reliability Copilot in Docker Container
- name: Run Copilot
run: |
docker run --rm \
-e ONEUPTIME_URL="https://test.oneuptime.com" \
-e ONEUPTIME_REPOSITORY_SECRET_KEY="${{ secrets.COPILOT_ONEUPTIME_REPOSITORY_SECRET_KEY }}" \
-e CODE_REPOSITORY_PASSWORD="${{ github.token }}" \
-e CODE_REPOSITORY_USERNAME="simlarsen" \
-e OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY }}" \
--net=host oneuptime/copilot:test

View File

@@ -1,101 +0,0 @@
name: Terraform Provider Generation
on:
pull_request:
push:
branches:
- main
- master
- develop
workflow_dispatch: # Allow manual trigger
jobs:
generate-terraform-provider:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{ github.run_number }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: 'npm'
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: true
- name: Install Common dependencies
run: cd Common && npm install
- name: Install root dependencies
run: npm install
- name: Install Script dependencies
run: cd Scripts && npm install
- name: Generate Terraform provider
run: npm run generate-terraform-provider
- name: Verify provider generation
run: |
PROVIDER_DIR="./Terraform"
# Check if provider directory was created
if [ ! -d "$PROVIDER_DIR" ]; then
echo "❌ Terraform provider directory not created"
exit 1
fi
echo "✅ Provider directory created: $PROVIDER_DIR"
# Count generated files
GO_FILES=$(find "$PROVIDER_DIR" -name "*.go" | wc -l)
echo "📊 Generated Go files: $GO_FILES"
if [ "$GO_FILES" -eq 0 ]; then
echo "❌ No Go files were generated"
exit 1
fi
# Check for essential files
if [ -f "$PROVIDER_DIR/go.mod" ]; then
echo "✅ Go module file created"
fi
if [ -f "$PROVIDER_DIR/README.md" ]; then
echo "✅ Documentation created"
fi
# Show directory structure for debugging
echo "📁 Provider directory structure:"
ls -la "$PROVIDER_DIR" || true
- name: Test Go build
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: |
PROVIDER_DIR="./Terraform"
if [ -d "$PROVIDER_DIR" ] && [ -f "$PROVIDER_DIR/go.mod" ]; then
cd "$PROVIDER_DIR"
echo "🔨 Testing Go build..."
go mod tidy
go build -v ./...
echo "✅ Go build successful"
else
echo "⚠️ Cannot test build - missing go.mod or provider directory"
fi
- name: Upload Terraform provider as artifact
uses: actions/upload-artifact@v4
with:
name: Terraform
path: ./Terraform/
retention-days: 30

20
.github/workflows/test-app.yaml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: App Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: cd App && npm install && npm run test

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
name: Common Server Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: cd Common && npm install
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd CommonServer && bash test-setup.sh
- run: export $(grep -v '^#' config.env | xargs) && cd CommonServer && rm -rf build && npm run test

View File

@@ -12,12 +12,11 @@ jobs:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
BILLING_PRIVATE_KEY: ${{secrets.TEST_BILLING_PRIVATE_KEY}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
- run: cd Common && bash test-setup.sh
- run: cd Common && npm install && rm -rf build && npm run test
node-version: 18.3.0
- run: cd Model && npm install
- run: cd Common && npm install && npm run test

23
.github/workflows/test.commonui.yaml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: CommonUI Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: cd Common && npm install
- run: cd Model && npm install
- run: cd CommonUI && npm install --force && npm run test

View File

@@ -1,20 +0,0 @@
name: Fluent Ingest Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd FluentIngest && npm install && npm run test

View File

@@ -1,21 +0,0 @@
name: Incoming Request Ingest Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd IncomingRequestIngest && npm install && npm run test

21
.github/workflows/test.ingestor.yaml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Ingestor Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: cd Ingestor && npm install && npm run test

View File

@@ -1,21 +0,0 @@
name: MCP Server Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Common && npm install
- run: cd MCP && npm install && npm run test

23
.github/workflows/test.model.yaml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Model Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: cd Common && npm install
- run: cd Model && npm install
- run: cd Model && npm install && npm run test

View File

@@ -1,21 +0,0 @@
name: OpenTelemetryIngest Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd OpenTelemetryIngest && npm install && npm run test

View File

@@ -1,21 +0,0 @@
name: ProbeIngest Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd ProbeIngest && npm install && npm run test

View File

@@ -9,15 +9,16 @@ on:
jobs:
test:
runs-on: ubuntu-latest
runs-on: self-hosted # this needs to be self-hosted because ICMP checks are disbled in hosted runners
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: latest
node-version: 18.3.0
- run: cd Common && npm install
- run: cd CommonServer && npm install
- run: cd Probe && npm install
- run: cd Probe && npm run test

View File

@@ -1,42 +0,0 @@
name: Tests
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test-app:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd App && npm install && npm run test
test-home:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Home && npm install && npm run test
test-worker:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: cd Worker && npm install && npm run test

43
.gitignore vendored
View File

@@ -86,45 +86,16 @@ Backups/*.tar
.env
Haraka/dkim/keys/private_base64.txt
Haraka/dkim/keys/public_base64.txt
.eslintcache
HelmChart/Values/*.values.yaml
LLM/__pycache__/*
Llama/Models/tokenizer*
Llama/Models/llama*
LLM/Models/*
Llama/__pycache__/*
Examples/otel-dotnet/obj/*
InfrastructureAgent/sea-prep.blob
InfrastructureAgent/InfrastructureAgent
InfrastructureAgent/build/*
InfrastructureAgent/err.log
InfrastructureAgent/out.log
InfrastructureAgent/daemon.pid
App/greenlock/.greenlockrc
App/greenlock/greenlock.d/config.json
App/greenlock/greenlock.d/config.json.bak
Examples/otel-dotnet/bin/Debug/net6.0/Grpc.Core.Api.dll.txt
InfrastructureAgent/oneuptime-infrastructure-agent
# ESLint cache
.eslintcache*
# Terraform generated files
openapi.json
Terraform/**
TerraformTest/**
terraform-provider-example/**
# MCP Server
MCP/build/
MCP/.env
MCP/node_modules
Dashboard/public/sw.js
.claude/settings.local.json
Examples/otel-dotnet/obj

View File

@@ -1,15 +0,0 @@
## OneUptime Copilot
This folder contains the configuration files for the OneUptime Copilot. The Copilot is a tool that automatically improves your code. It can fix issues, improve code quality, and help you ship faster.
This folder has the following structure:
- `config.js`: The configuration file for the Copilot. You can customize the Copilot's behavior by changing this file.
- `scripts`: A folder containing scripts that the Copilot runs. These are hooks that run at different stages of the Copilot's process.
- `on-after-clone.sh`: A script that runs after the Copilot clones your repository.
- `on-before-code-change.sh`: A script that runs before the Copilot makes changes to your code.
- `on-after-code-change.sh`: A script that runs after the Copilot makes changes to your code.
- `on-before-commit.sh`: A script that runs before the Copilot commits changes to your repository.
- `on-after-commit.sh`: A script that runs after the Copilot commits changes to your repository.

View File

@@ -1,10 +0,0 @@
// This is the configuration file for the oneuptime copilot.
const getCopilotConfig = () => {
return {
// The version of the schema for this configuration file.
schemaVersion: '1.0',
}
}
export default getCopilotConfig;

View File

@@ -1,16 +0,0 @@
# Description: Copilot clones your repository and to improve your code.
# This scirpt runs after the clone process is completed.
# Some of the common tasks you can do here are:
# 1. Install dependencies
# 2. Run linting
# 3. Run tests
# 4. Run build
# 5. Run any other command that you want to run after the clone process is completed.
# If this script fails, copilot will not proceed with the next steps to improve your code.
# This step is to ensure that the code is in a good state before we start improving it.
# If you want to skip this script, you can keep this file empty.
# It's highly recommended to run linting and tests in this script to ensure the code is in a good state.
# This scirpt will run on ubuntu machine. So, make sure the commands you run are compatible with ubuntu.
npm install
npm run lint

View File

@@ -1,13 +0,0 @@
# Description: Copilot will run this script after we make improvements to your code and write it to disk.
# Some of the common tasks you can do here are:
# 1. Run linting
# 2. Run tests
# 3. Run build
# 4. Run any other command that you want to run after the code is changed.
# If this script fails, copilot will not commit the changes to your repository.
# This step is to ensure that the code is in a good state before we commit the changes.
# If you want to skip this script, you can keep this file empty.
# It's highly recommended to run linting and tests in this script to ensure the code is in a good state.
# This scirpt will run on ubuntu machine. So, make sure the commands you run are compatible with ubuntu.
npm run fix

View File

@@ -1 +0,0 @@
# Description: Copilot will run this script after the commit process is completed.

View File

@@ -1,9 +0,0 @@
# Description: Copilot will run this script before we make changes to your code.
# Some of the common tasks you can do here are:
# 1. Install dependencies
# 2. Run any other command that you want to run before the code is changed.
# If this script fails, copilot will not make any changes to the code.
# This step is to ensure that the code is in a good state before we start making changes.
# If you want to skip this script, you can keep this file empty.
# It's highly recommended to run things like installing dependencies in this script.
# This scirpt will run on ubuntu machine. So, make sure the commands you run are compatible with ubuntu.

View File

@@ -1 +0,0 @@
# Description: Copilot will run this script before we commit the changes to your repository.

View File

@@ -50,4 +50,4 @@ marketing/*/*
licenses/*
certifications/*
ApiReference/public/assets/*
JavaScriptSDK/src/cli/server-monitor/out/scripts/prettify/*
JavaScriptSDK/src/cli/server-monitor/out/scripts/prettify/*

8
.prettierrc.json Normal file
View File

@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"arrowParens": "avoid"
}

227
.vscode/launch.json vendored
View File

@@ -19,28 +19,6 @@
}
],
"configurations": [
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/TestServer",
"name": "Copilot: Debug with Docker",
"port": 9985,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"name": "Debug Infrastructure Agent",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "./InfrastructureAgent",
"args": ["start"],
},
{
"name": "Node.js - Debug Current File",
"type": "node",
@@ -63,76 +41,6 @@
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/Home",
"name": "Home: Debug with Docker",
"port": 9212,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/Worker",
"name": "Worker: Debug with Docker",
"port": 8734,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/Workflow",
"name": "Workflow: Debug with Docker",
"port": 8735,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/Docs",
"name": "Docs: Debug with Docker",
"port": 8738,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/APIReference",
"name": "API Reference: Debug with Docker",
"port": 8737,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/TestServer",
@@ -151,7 +59,7 @@
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/Probe",
"name": "Probe: Debug with Docker",
"port": 9229,
"port": 9655,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
@@ -163,8 +71,8 @@
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/ProbeIngest",
"name": "ProbeIngest: Debug with Docker",
"localRoot": "${workspaceFolder}/Ingestor",
"name": "Ingestor: Debug with Docker",
"port": 9932,
"remoteRoot": "/usr/src/app",
"request": "attach",
@@ -175,76 +83,6 @@
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/ServerMonitorIngest",
"name": "ServerMonitorIngest: Debug with Docker",
"port": 9941,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/IncomingRequestIngest",
"name": "IncomingRequestIngest: Debug with Docker",
"port": 9933,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/OpenTelemetryIngest",
"name": "OpenTelemetryIngest: Debug with Docker",
"port": 9938,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/FluentIngest",
"name": "Fluent Ingest: Debug with Docker",
"port": 9937,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/IsolatedVM",
"name": "Isolated VM: Debug with Docker",
"port": 9974,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/Workflow",
@@ -273,6 +111,20 @@
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/Workers",
"name": "Workers: Debug with Docker",
"port": 9654,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/StatusPage",
@@ -287,6 +139,34 @@
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/Ingestor",
"name": "Probe API: Debug with Docker",
"port": 9251,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/Identity",
"name": "File: Debug with Docker",
"port": 9012,
"remoteRoot": "/usr/src/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"restart": true,
"autoAttachChildProcesses": true
},
{
"address": "127.0.0.1",
"localRoot": "${workspaceFolder}/HttpTestServer",
@@ -330,12 +210,25 @@
"autoAttachChildProcesses": true
},
{
"name": "Common: Debug Tests",
"name": "CommonServer: Debug Tests",
"type": "node",
"restart": true,
"autoAttachChildProcesses": true,
"request": "launch",
"cwd": "${workspaceRoot}/Common",
"cwd": "${workspaceRoot}/CommonServer",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"debug:test"
],
},
{
"name": "Probe: Debug Tests",
"type": "node",
"restart": true,
"autoAttachChildProcesses": true,
"request": "launch",
"cwd": "${workspaceRoot}/Probe",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",

View File

@@ -1,30 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
#/backend/node_modules
/kubernetes
/node_modules
.idea
# misc
.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock
**/*/paymentService.test.js
apiTest.rest
application_security_dir
container_security_dir
# coverage
/coverage
/.nyc_output
/greenlock.d/config.json
/greenlock.d/config.json.bak
/.greenlockrc

View File

@@ -1,8 +0,0 @@
{
"query": {
"age": {
"_type": "EqualTo",
value: 10
}
}
}

View File

@@ -1,8 +0,0 @@
{
"query": {
"age": {
"_type": "GreaterThanOrNull",
"value": 10
}
}
}

View File

@@ -1,11 +0,0 @@
{
"query": {
"labels": {
"_type": "Includes",
"value": [
"aaa00000-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"bbb00000-bbbb-bbbb-bbbb-bbbbbbbbbbbb"
]
}
}
}

View File

@@ -1,8 +0,0 @@
{
"query": {
"age": {
"_type": "LessThanOrNull",
"value": 10
}
}
}

View File

@@ -1,72 +0,0 @@
#
# OneUptime-App Dockerfile
#
# Pull base image nodejs image.
FROM public.ecr.aws/docker/library/node:23.8-alpine3.21
RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global
RUN npm config set fetch-retries 5
RUN npm config set fetch-retry-mintimeout 100000
RUN npm config set fetch-retry-maxtimeout 600000
ARG GIT_SHA
ARG APP_VERSION
ENV GIT_SHA=${GIT_SHA}
ENV APP_VERSION=${APP_VERSION}
# IF APP_VERSION is not set, set it to 1.0.0
RUN if [ -z "$APP_VERSION" ]; then export APP_VERSION=1.0.0; fi
# Install bash.
RUN apk add bash && apk add curl
# Install python
RUN apk update && apk add --no-cache --virtual .gyp python3 make g++
#Use bash shell by default
SHELL ["/bin/bash", "-c"]
RUN mkdir /usr/src
WORKDIR /usr/src/Common
COPY ./Common/package*.json /usr/src/Common/
# Set version in ./Common/package.json to the APP_VERSION
RUN sed -i "s/\"version\": \".*\"/\"version\": \"$APP_VERSION\"/g" /usr/src/Common/package.json
RUN npm install
COPY ./Common /usr/src/Common
ENV PRODUCTION=true
WORKDIR /usr/src/app
# Install app dependencies
COPY ./APIReference/package*.json /usr/src/app/
# Set version in ./App/package.json to the APP_VERSION
RUN sed -i "s/\"version\": \".*\"/\"version\": \"$APP_VERSION\"/g" /usr/src/app/package.json
RUN npm install
# Expose ports.
# - 1446: OneUptime-api-reference
EXPOSE 1446
{{ if eq .Env.ENVIRONMENT "development" }}
#Run the app
CMD [ "npm", "run", "dev" ]
{{ else }}
# Copy app source
COPY ./APIReference /usr/src/app
# Bundle app source
RUN npm run compile
# Set permission to write logs and cache in case container run as non root
RUN chown -R 1000:1000 "/tmp/npm" && chmod -R 2777 "/tmp/npm"
#Run the app
CMD [ "npm", "start" ]
{{ end }}

View File

@@ -1,52 +0,0 @@
import APIReferenceRoutes from "./Routes";
import { PromiseVoidFunction } from "Common/Types/FunctionTypes";
import InfrastructureStatus from "Common/Server/Infrastructure/Status";
import logger from "Common/Server/Utils/Logger";
import App from "Common/Server/Utils/StartServer";
import Telemetry from "Common/Server/Utils/Telemetry";
import "ejs";
const APP_NAME: string = "reference";
const init: PromiseVoidFunction = async (): Promise<void> => {
try {
// Initialize telemetry
Telemetry.init({
serviceName: APP_NAME,
});
const statusCheck: PromiseVoidFunction = async (): Promise<void> => {
// Check the status of infrastructure components
return await InfrastructureStatus.checkStatusWithRetry({
checkClickhouseStatus: false,
checkPostgresStatus: false,
checkRedisStatus: false,
retryCount: 3,
});
};
// Initialize the app with service name and status checks
await App.init({
appName: APP_NAME,
statusOptions: {
liveCheck: statusCheck,
readyCheck: statusCheck,
},
});
await APIReferenceRoutes.init();
// Add default routes to the app
await App.addDefaultRoutes();
} catch (err) {
logger.error("App Init Failed:");
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.error("Exiting node process");
process.exit(1);
});

View File

@@ -1,29 +0,0 @@
# README
This README would normally document whatever steps are necessary to get your application up and running.
### What is this repository for?
- Quick summary
- Version
- [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
### How do I get set up?
- Summary of set up
- Configuration
- Dependencies
- Database configuration
- How to run tests
- Deployment instructions
### Contribution guidelines
- Writing tests
- Code review
- Other guidelines
### Who do I talk to?
- Repo owner or admin
- Other community or team contact

View File

@@ -1,89 +0,0 @@
import AuthenticationServiceHandler from "./Service/Authentication";
import DataTypeServiceHandler from "./Service/DataType";
import ErrorServiceHandler from "./Service/Errors";
import OpenAPIServiceHandler from "./Service/OpenAPI";
import IntroductionServiceHandler from "./Service/Introduction";
import ModelServiceHandler from "./Service/Model";
import PageNotFoundServiceHandler from "./Service/PageNotFound";
import PaginationServiceHandler from "./Service/Pagination";
import PermissionServiceHandler from "./Service/Permissions";
import StatusServiceHandler from "./Service/Status";
import { StaticPath } from "./Utils/Config";
import ResourceUtil, { ModelDocumentation } from "./Utils/Resources";
import Dictionary from "Common/Types/Dictionary";
import FeatureSet from "Common/Server/Types/FeatureSet";
import Express, {
ExpressApplication,
ExpressRequest,
ExpressResponse,
ExpressStatic,
} from "Common/Server/Utils/Express";
const APIReferenceFeatureSet: FeatureSet = {
init: async (): Promise<void> => {
const ResourceDictionary: Dictionary<ModelDocumentation> =
ResourceUtil.getResourceDictionaryByPath();
const app: ExpressApplication = Express.getExpressApp();
// Serve static files for the API reference with a cache max age of 30 days
app.use("/reference", ExpressStatic(StaticPath, { maxAge: 2592000 }));
// Redirect index page to the introduction page
app.get(["/reference"], (_req: ExpressRequest, res: ExpressResponse) => {
return res.redirect("/reference/introduction");
});
// Handle "Page Not Found" page
app.get(
["/reference/page-not-found"],
(req: ExpressRequest, res: ExpressResponse) => {
return PageNotFoundServiceHandler.executeResponse(req, res);
},
);
// Handle all other pages based on the "page" parameter
app.get(
["/reference/:page"],
(req: ExpressRequest, res: ExpressResponse) => {
const page: string | undefined = req.params["page"];
if (!page) {
return PageNotFoundServiceHandler.executeResponse(req, res);
}
const currentResource: ModelDocumentation | undefined =
ResourceDictionary[page];
// Execute the appropriate service handler based on the "page" parameter
if (req.params["page"] === "permissions") {
return PermissionServiceHandler.executeResponse(req, res);
} else if (req.params["page"] === "authentication") {
return AuthenticationServiceHandler.executeResponse(req, res);
} else if (req.params["page"] === "pagination") {
return PaginationServiceHandler.executeResponse(req, res);
} else if (req.params["page"] === "errors") {
return ErrorServiceHandler.executeResponse(req, res);
} else if (req.params["page"] === "introduction") {
return IntroductionServiceHandler.executeResponse(req, res);
} else if (req.params["page"] === "openapi") {
return OpenAPIServiceHandler.executeResponse(req, res);
} else if (req.params["page"] === "status") {
return StatusServiceHandler.executeResponse(req, res);
} else if (req.params["page"] === "data-types") {
return DataTypeServiceHandler.executeResponse(req, res);
} else if (currentResource) {
return ModelServiceHandler.executeResponse(req, res);
}
// page not found
return PageNotFoundServiceHandler.executeResponse(req, res);
},
);
app.get("/reference/*", (req: ExpressRequest, res: ExpressResponse) => {
return PageNotFoundServiceHandler.executeResponse(req, res);
});
},
};
export default APIReferenceFeatureSet;

View File

@@ -1,36 +0,0 @@
import { IsBillingEnabled } from "Common/Server/EnvironmentConfig";
import { ViewsPath } from "../Utils/Config";
import ResourceUtil, { ModelDocumentation } from "../Utils/Resources";
import { ExpressRequest, ExpressResponse } from "Common/Server/Utils/Express";
import Dictionary from "Common/Types/Dictionary";
// Retrieve resources documentation
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources();
export default class ServiceHandler {
public static async executeResponse(
req: ExpressRequest,
res: ExpressResponse,
): Promise<void> {
let pageTitle: string = "";
let pageDescription: string = "";
// Extract page parameter from request
const page: string | undefined = req.params["page"];
const pageData: Dictionary<unknown> = {};
// Set default page title and description for the authentication page
pageTitle = "Authentication";
pageDescription = "Learn how to authenticate requests with OneUptime API";
// Render the index page with the specified parameters
return res.render(`${ViewsPath}/pages/index`, {
page: page,
resources: Resources,
pageTitle: pageTitle,
enableGoogleTagManager: IsBillingEnabled,
pageDescription: pageDescription,
pageData: pageData,
});
}
}

View File

@@ -1,159 +0,0 @@
import { IsBillingEnabled } from "Common/Server/EnvironmentConfig";
import { CodeExamplesPath, ViewsPath } from "../Utils/Config";
import ResourceUtil, { ModelDocumentation } from "../Utils/Resources";
import LocalCache from "Common/Server/Infrastructure/LocalCache";
import { ExpressRequest, ExpressResponse } from "Common/Server/Utils/Express";
import LocalFile from "Common/Server/Utils/LocalFile";
import Dictionary from "Common/Types/Dictionary";
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources();
export default class ServiceHandler {
public static async executeResponse(
_req: ExpressRequest,
res: ExpressResponse,
): Promise<void> {
const pageData: Dictionary<unknown> = {};
pageData["selectCode"] = await LocalCache.getOrSetString(
"data-type",
"select",
async () => {
return await LocalFile.read(`${CodeExamplesPath}/DataTypes/Select.md`);
},
);
pageData["sortCode"] = await LocalCache.getOrSetString(
"data-type",
"sort",
async () => {
return await LocalFile.read(`${CodeExamplesPath}/DataTypes/Sort.md`);
},
);
pageData["equalToCode"] = await LocalCache.getOrSetString(
"data-type",
"equal-to",
async () => {
return await LocalFile.read(`${CodeExamplesPath}/DataTypes/EqualTo.md`);
},
);
pageData["equalToOrNullCode"] = await LocalCache.getOrSetString(
"data-type",
"equal-to-or-null",
async () => {
return await LocalFile.read(
`${CodeExamplesPath}/DataTypes/EqualToOrNull.md`,
);
},
);
pageData["greaterThanCode"] = await LocalCache.getOrSetString(
"data-type",
"greater-than",
async () => {
return await LocalFile.read(
`${CodeExamplesPath}/DataTypes/GreaterThan.md`,
);
},
);
pageData["greaterThanOrEqualCode"] = await LocalCache.getOrSetString(
"data-type",
"greater-than-or-equal",
async () => {
return await LocalFile.read(
`${CodeExamplesPath}/DataTypes/GreaterThanOrEqual.md`,
);
},
);
pageData["lessThanCode"] = await LocalCache.getOrSetString(
"data-type",
"less-than",
async () => {
return await LocalFile.read(
`${CodeExamplesPath}/DataTypes/LessThan.md`,
);
},
);
pageData["lessThanOrEqualCode"] = await LocalCache.getOrSetString(
"data-type",
"less-than-or-equal",
async () => {
return await LocalFile.read(
`${CodeExamplesPath}/DataTypes/LessThanOrEqual.md`,
);
},
);
pageData["includesCode"] = await LocalCache.getOrSetString(
"data-type",
"includes",
async () => {
return await LocalFile.read(
`${CodeExamplesPath}/DataTypes/Includes.md`,
);
},
);
pageData["lessThanOrNullCode"] = await LocalCache.getOrSetString(
"data-type",
"less-than-or-equal",
async () => {
return await LocalFile.read(
`${CodeExamplesPath}/DataTypes/LessThanOrNull.md`,
);
},
);
pageData["greaterThanOrNullCode"] = await LocalCache.getOrSetString(
"data-type",
"less-than-or-equal",
async () => {
return await LocalFile.read(
`${CodeExamplesPath}/DataTypes/LessThanOrNull.md`,
);
},
);
pageData["isNullCode"] = await LocalCache.getOrSetString(
"data-type",
"is-null",
async () => {
return await LocalFile.read(`${CodeExamplesPath}/DataTypes/IsNull.md`);
},
);
pageData["notNullCode"] = await LocalCache.getOrSetString(
"data-type",
"not-null",
async () => {
return await LocalFile.read(`${CodeExamplesPath}/DataTypes/NotNull.md`);
},
);
pageData["notEqualToCode"] = await LocalCache.getOrSetString(
"data-type",
"not-equals",
async () => {
return await LocalFile.read(
`${CodeExamplesPath}/DataTypes/NotEqualTo.md`,
);
},
);
res.status(200);
return res.render(`${ViewsPath}/pages/index`, {
page: "data-types",
pageTitle: "Data Types",
enableGoogleTagManager: IsBillingEnabled,
pageDescription:
"Data Types that can be used to interact with OneUptime API",
resources: Resources,
pageData: pageData,
});
}
}

View File

@@ -1,37 +0,0 @@
import { IsBillingEnabled } from "Common/Server/EnvironmentConfig";
import { ViewsPath } from "../Utils/Config";
import ResourceUtil, { ModelDocumentation } from "../Utils/Resources";
import { ExpressRequest, ExpressResponse } from "Common/Server/Utils/Express";
import Dictionary from "Common/Types/Dictionary";
// Fetch a list of resources used in the application
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources();
export default class ServiceHandler {
// Handles the HTTP response for a given request
public static async executeResponse(
req: ExpressRequest,
res: ExpressResponse,
): Promise<void> {
let pageTitle: string = "";
let pageDescription: string = "";
// Get the 'page' parameter from the request
const page: string | undefined = req.params["page"];
const pageData: Dictionary<unknown> = {};
// Set the default page title and description
pageTitle = "Errors";
pageDescription = "Learn more about how we return errors from API";
// Render the response using the given view and data
return res.render(`${ViewsPath}/pages/index`, {
page: page,
resources: Resources,
pageTitle: pageTitle,
enableGoogleTagManager: IsBillingEnabled,
pageDescription: pageDescription,
pageData: pageData,
});
}
}

View File

@@ -1,43 +0,0 @@
import { IsBillingEnabled } from "Common/Server/EnvironmentConfig";
import { ViewsPath } from "../Utils/Config";
import ResourceUtil, { ModelDocumentation } from "../Utils/Resources";
import { ExpressRequest, ExpressResponse } from "Common/Server/Utils/Express";
import Dictionary from "Common/Types/Dictionary";
// Get all resources and featured resources from ResourceUtil
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources();
const FeaturedResources: Array<ModelDocumentation> =
ResourceUtil.getFeaturedResources();
export default class ServiceHandler {
// Handle the API request
public static async executeResponse(
req: ExpressRequest,
res: ExpressResponse,
): Promise<void> {
// Initialize page title and description
let pageTitle: string = "";
let pageDescription: string = "";
// Get the requested page from the URL parameters
const page: string | undefined = req.params["page"];
const pageData: Dictionary<unknown> = {};
// Set featured resources for the page
pageData["featuredResources"] = FeaturedResources;
// Set page title and description
pageTitle = "Introduction";
pageDescription = "API Reference for OneUptime";
// Render the index page with the required data
return res.render(`${ViewsPath}/pages/index`, {
page: page,
resources: Resources,
pageTitle: pageTitle,
enableGoogleTagManager: IsBillingEnabled,
pageDescription: pageDescription,
pageData: pageData,
});
}
}

View File

@@ -1,284 +0,0 @@
import { CodeExamplesPath, ViewsPath } from "../Utils/Config";
import ResourceUtil, { ModelDocumentation } from "../Utils/Resources";
import PageNotFoundServiceHandler from "./PageNotFound";
import { AppApiRoute } from "Common/ServiceRoute";
import { ColumnAccessControl } from "Common/Types/BaseDatabase/AccessControl";
import {
getTableColumns,
TableColumnMetadata,
} from "Common/Types/Database/TableColumn";
import Dictionary from "Common/Types/Dictionary";
import ObjectID from "Common/Types/ObjectID";
import Permission, {
PermissionHelper,
PermissionProps,
} from "Common/Types/Permission";
import LocalCache from "Common/Server/Infrastructure/LocalCache";
import { ExpressRequest, ExpressResponse } from "Common/Server/Utils/Express";
import LocalFile from "Common/Server/Utils/LocalFile";
import { IsBillingEnabled } from "Common/Server/EnvironmentConfig";
// Get all resources and resource dictionary
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources();
const ResourceDictionary: Dictionary<ModelDocumentation> =
ResourceUtil.getResourceDictionaryByPath();
// Get all permission props
const PermissionDictionary: Dictionary<PermissionProps> =
PermissionHelper.getAllPermissionPropsAsDictionary();
export default class ServiceHandler {
// Execute response for a given page
public static async executeResponse(
req: ExpressRequest,
res: ExpressResponse,
): Promise<void> {
let pageTitle: string = "";
let pageDescription: string = "";
let page: string | undefined = req.params["page"];
const pageData: Dictionary<unknown> = {};
// Check if page is provided
if (!page) {
return PageNotFoundServiceHandler.executeResponse(req, res);
}
// Get current resource
const currentResource: ModelDocumentation | undefined =
ResourceDictionary[page];
// Check if current resource exists
if (!currentResource) {
return PageNotFoundServiceHandler.executeResponse(req, res);
}
// Set page title and description
pageTitle = currentResource.name;
pageDescription = currentResource.description;
page = "model";
// Get table columns for current resource
const tableColumns: Dictionary<TableColumnMetadata> = getTableColumns(
currentResource.model,
);
// Filter out columns with no access
for (const key in tableColumns) {
const accessControl: ColumnAccessControl | null =
currentResource.model.getColumnAccessControlFor(key);
if (!accessControl) {
delete tableColumns[key];
continue;
}
if (
accessControl?.create.length === 0 &&
accessControl?.read.length === 0 &&
accessControl?.update.length === 0
) {
delete tableColumns[key];
continue;
}
if (tableColumns[key] && tableColumns[key]!.hideColumnInDocumentation) {
delete tableColumns[key];
continue;
}
if (tableColumns[key]) {
(tableColumns[key] as any).permissions = accessControl;
}
}
// Remove unnecessary columns
delete tableColumns["deletedAt"];
delete tableColumns["deletedByUserId"];
delete tableColumns["deletedByUser"];
delete tableColumns["version"];
// Set page data
pageData["title"] = currentResource.model.singularName;
pageData["description"] = currentResource.model.tableDescription;
pageData["columns"] = tableColumns;
pageData["tablePermissions"] = {
read: currentResource.model.readRecordPermissions.map(
(permission: Permission) => {
return PermissionDictionary[permission];
},
),
update: currentResource.model.updateRecordPermissions.map(
(permission: Permission) => {
return PermissionDictionary[permission];
},
),
delete: currentResource.model.deleteRecordPermissions.map(
(permission: Permission) => {
return PermissionDictionary[permission];
},
),
create: currentResource.model.createRecordPermissions.map(
(permission: Permission) => {
return PermissionDictionary[permission];
},
),
};
// Cache the list request data
pageData["listRequest"] = await LocalCache.getOrSetString(
"model",
"list-request",
async () => {
// Read the list request data from a file
return await LocalFile.read(`${CodeExamplesPath}/Model/ListRequest.md`);
},
);
// Cache the item request data
pageData["itemRequest"] = await LocalCache.getOrSetString(
"model",
"item-request",
async () => {
// Read the item request data from a file
return await LocalFile.read(`${CodeExamplesPath}/Model/ItemRequest.md`);
},
);
// Cache the item response data
pageData["itemResponse"] = await LocalCache.getOrSetString(
"model",
"item-response",
async () => {
// Read the item response data from a file
return await LocalFile.read(
`${CodeExamplesPath}/Model/ItemResponse.md`,
);
},
);
// Cache the count request data
pageData["countRequest"] = await LocalCache.getOrSetString(
"model",
"count-request",
async () => {
// Read the count request data from a file
return await LocalFile.read(
`${CodeExamplesPath}/Model/CountRequest.md`,
);
},
);
// Cache the count response data
pageData["countResponse"] = await LocalCache.getOrSetString(
"model",
"count-response",
async () => {
// Read the CountResponse.md file
return await LocalFile.read(
`${CodeExamplesPath}/Model/CountResponse.md`,
);
},
);
pageData["updateRequest"] = await LocalCache.getOrSetString(
"model",
"update-request",
async () => {
// Read the UpdateRequest.md file
return await LocalFile.read(
`${CodeExamplesPath}/Model/UpdateRequest.md`,
);
},
);
pageData["updateResponse"] = await LocalCache.getOrSetString(
"model",
"update-response",
async () => {
// Read the UpdateResponse.md file
return await LocalFile.read(
`${CodeExamplesPath}/Model/UpdateResponse.md`,
);
},
);
pageData["createRequest"] = await LocalCache.getOrSetString(
"model",
"create-request",
async () => {
// Read the CreateRequest.md file
return await LocalFile.read(
`${CodeExamplesPath}/Model/CreateRequest.md`,
);
},
);
pageData["createResponse"] = await LocalCache.getOrSetString(
"model",
"create-response",
async () => {
// Read the CreateResponse.md file
return await LocalFile.read(
`${CodeExamplesPath}/Model/CreateResponse.md`,
);
},
);
pageData["deleteRequest"] = await LocalCache.getOrSetString(
"model",
"delete-request",
async () => {
// Read the DeleteRequest.md file
return await LocalFile.read(
`${CodeExamplesPath}/Model/DeleteRequest.md`,
);
},
);
pageData["deleteResponse"] = await LocalCache.getOrSetString(
"model",
"delete-response",
async () => {
// Read the DeleteResponse.md file
return await LocalFile.read(
`${CodeExamplesPath}/Model/DeleteResponse.md`,
);
},
);
// Get list response from cache or set it if it's not available
pageData["listResponse"] = await LocalCache.getOrSetString(
"model",
"list-response",
async () => {
// Read the list response from a file
return await LocalFile.read(
`${CodeExamplesPath}/Model/ListResponse.md`,
);
},
);
// Generate a unique ID for the example object
pageData["exampleObjectID"] = ObjectID.generate();
// Construct the API path for the current resource
pageData["apiPath"] =
AppApiRoute.toString() + currentResource.model.crudApiPath?.toString();
// Check if the current resource is a master admin API
pageData["isMasterAdminApiDocs"] =
currentResource.model.isMasterAdminApiDocs;
// Render the index page with the required data
return res.render(`${ViewsPath}/pages/index`, {
page: page,
resources: Resources,
pageTitle: pageTitle,
enableGoogleTagManager: IsBillingEnabled,
pageDescription: pageDescription,
pageData: pageData,
});
}
}

View File

@@ -1,45 +0,0 @@
import {
Host,
HttpProtocol,
IsBillingEnabled,
} from "Common/Server/EnvironmentConfig";
import { ViewsPath } from "../Utils/Config";
import ResourceUtil, { ModelDocumentation } from "../Utils/Resources";
import { ExpressRequest, ExpressResponse } from "Common/Server/Utils/Express";
import URL from "Common/Types/API/URL";
import Dictionary from "Common/Types/Dictionary";
// Fetch a list of resources used in the application
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources();
export default class ServiceHandler {
// Handles the HTTP response for a given request
public static async executeResponse(
req: ExpressRequest,
res: ExpressResponse,
): Promise<void> {
let pageTitle: string = "";
let pageDescription: string = "";
// Get the 'page' parameter from the request
const page: string | undefined = req.params["page"];
const pageData: Dictionary<unknown> = {
hostUrl: new URL(HttpProtocol, Host).toString(),
};
// Set the default page title and description
pageTitle = "OneUptime OpenAPI Specification";
pageDescription =
"Learn more about the OpenAPI specification for OneUptime";
// Render the response using the given view and data
return res.render(`${ViewsPath}/pages/index`, {
page: page,
resources: Resources,
pageTitle: pageTitle,
enableGoogleTagManager: IsBillingEnabled,
pageDescription: pageDescription,
pageData: pageData,
});
}
}

View File

@@ -1,27 +0,0 @@
import { IsBillingEnabled } from "Common/Server/EnvironmentConfig";
import { ViewsPath } from "../Utils/Config";
import ResourceUtil, { ModelDocumentation } from "../Utils/Resources";
import { ExpressRequest, ExpressResponse } from "Common/Server/Utils/Express";
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources(); // Get an array of model documentation resources
export default class ServiceHandler {
// This is a static method that handles the response
public static async executeResponse(
_req: ExpressRequest,
res: ExpressResponse,
): Promise<void> {
// Set the HTTP status code to 404 (Not Found)
res.status(404);
// Render the 'index' page with the given data
return res.render(`${ViewsPath}/pages/index`, {
page: "404", // The page type (404 in this case)
pageTitle: "Page Not Found", // The page title
enableGoogleTagManager: IsBillingEnabled,
pageDescription: "Page you're looking for is not found.", // The page description
resources: Resources, // The array of model documentation resources
pageData: {}, // An empty object to hold any additional page data
});
}
}

View File

@@ -1,58 +0,0 @@
import { IsBillingEnabled } from "Common/Server/EnvironmentConfig";
import { CodeExamplesPath, ViewsPath } from "../Utils/Config";
import ResourceUtil, { ModelDocumentation } from "../Utils/Resources";
import LocalCache from "Common/Server/Infrastructure/LocalCache";
import { ExpressRequest, ExpressResponse } from "Common/Server/Utils/Express";
import LocalFile from "Common/Server/Utils/LocalFile";
import Dictionary from "Common/Types/Dictionary";
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources(); // Get all resources from ResourceUtil
export default class ServiceHandler {
public static async executeResponse(
req: ExpressRequest,
res: ExpressResponse,
): Promise<void> {
let pageTitle: string = ""; // Initialize page title
let pageDescription: string = ""; // Initialize page description
const page: string | undefined = req.params["page"]; // Get the page parameter from the request
const pageData: Dictionary<unknown> = {}; // Initialize page data object
// Set page title and description
pageTitle = "Pagination";
pageDescription = "Learn how to paginate requests with OneUptime API";
// Get response and request code from LocalCache or LocalFile
pageData["responseCode"] = await LocalCache.getOrSetString(
"pagination",
"response",
async () => {
// Read Response.md file from CodeExamplesPath
return await LocalFile.read(
`${CodeExamplesPath}/Pagination/Response.md`,
);
},
);
pageData["requestCode"] = await LocalCache.getOrSetString(
"pagination",
"request",
async () => {
// Read Request.md file from CodeExamplesPath
return await LocalFile.read(
`${CodeExamplesPath}/Pagination/Request.md`,
);
},
);
// Render the page with the page data
return res.render(`${ViewsPath}/pages/index`, {
page: page, // Pass the page parameter
resources: Resources, // Pass all resources
pageTitle: pageTitle,
enableGoogleTagManager: IsBillingEnabled, // Pass the page title
pageDescription: pageDescription, // Pass the page description
pageData: pageData, // Pass the page data
});
}
}

View File

@@ -1,44 +0,0 @@
import { ViewsPath } from "../Utils/Config";
import ResourceUtil, { ModelDocumentation } from "../Utils/Resources";
import { PermissionHelper, PermissionProps } from "Common/Types/Permission";
import { ExpressRequest, ExpressResponse } from "Common/Server/Utils/Express";
import { IsBillingEnabled } from "Common/Server/EnvironmentConfig";
import Dictionary from "Common/Types/Dictionary";
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources();
export default class ServiceHandler {
public static async executeResponse(
req: ExpressRequest,
res: ExpressResponse,
): Promise<void> {
// Initialize page title and description
let pageTitle: string = "";
let pageDescription: string = "";
// Get the requested page
const page: string | undefined = req.params["page"];
const pageData: Dictionary<unknown> = {};
// Set page title and description
pageTitle = "Permissions";
pageDescription = "Learn how permissions work with OneUptime";
// Filter permissions to only include those assignable to tenants
pageData["permissions"] = PermissionHelper.getAllPermissionProps().filter(
(i: PermissionProps) => {
return i.isAssignableToTenant;
},
);
// Render the page
return res.render(`${ViewsPath}/pages/index`, {
page: page,
resources: Resources,
pageTitle: pageTitle,
enableGoogleTagManager: IsBillingEnabled,
pageDescription: pageDescription,
pageData: pageData,
});
}
}

View File

@@ -1,27 +0,0 @@
import { IsBillingEnabled } from "Common/Server/EnvironmentConfig";
import { ViewsPath } from "../Utils/Config";
import ResourceUtil, { ModelDocumentation } from "../Utils/Resources";
import { ExpressRequest, ExpressResponse } from "Common/Server/Utils/Express";
// Retrieve resources from ResourceUtil
const resources: Array<ModelDocumentation> = ResourceUtil.getResources();
export default class ServiceHandler {
public static async executeResponse(
_req: ExpressRequest, // Ignore request object
res: ExpressResponse,
): Promise<void> {
// Set HTTP status to 200
res.status(200);
// Render index page with necessary data
return res.render(`${ViewsPath}/pages/index`, {
page: "status",
pageTitle: "Status",
enableGoogleTagManager: IsBillingEnabled,
pageDescription: "200 - Success",
resources: resources, // Pass resources to the template
pageData: {}, // Pass empty data to the template
});
}
}

View File

@@ -1,3 +0,0 @@
export const ViewsPath: string = "/usr/src/app/views";
export const StaticPath: string = "/usr/src/app/Static";
export const CodeExamplesPath: string = "/usr/src/app/CodeExamples";

View File

@@ -1,77 +0,0 @@
import BaseModel from "Common/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel";
import ArrayUtil from "Common/Utils/Array";
import Dictionary from "Common/Types/Dictionary";
import { IsBillingEnabled } from "Common/Server/EnvironmentConfig";
import Models from "Common/Models/DatabaseModels/Index";
export interface ModelDocumentation {
name: string;
path: string;
model: BaseModel;
description: string;
}
export default class ResourceUtil {
// Get all resources that should have documentation enabled
public static getResources(): Array<ModelDocumentation> {
const resources: Array<ModelDocumentation> = Models.filter(
(model: { new (): BaseModel }) => {
const modelInstance: BaseModel = new model();
let showDocs: boolean = modelInstance.enableDocumentation;
// If billing is enabled, do not show master admin API docs
if (modelInstance.isMasterAdminApiDocs && IsBillingEnabled) {
showDocs = false;
}
return showDocs;
},
)
.map((model: { new (): BaseModel }) => {
const modelInstance: BaseModel = new model();
return {
name: modelInstance.singularName!,
path: modelInstance.getAPIDocumentationPath(),
model: modelInstance,
description: modelInstance.tableDescription!,
};
})
.sort(ArrayUtil.sortByFieldName("name"));
return resources;
}
// Get featured resources that are pre-selected
public static getFeaturedResources(): Array<ModelDocumentation> {
const featuredResources: Array<string> = [
"Monitor",
"Scheduled Maintenance Event",
"Status Page",
"Incident",
"Team",
"On-Call Duty",
"Label",
"Team Member",
];
return ResourceUtil.getResources().filter(
(resource: ModelDocumentation) => {
return featuredResources.includes(resource.name);
},
);
}
// Create a dictionary of resources indexed by their path
public static getResourceDictionaryByPath(): Dictionary<ModelDocumentation> {
const dict: Dictionary<ModelDocumentation> = {};
const resources: Array<ModelDocumentation> = ResourceUtil.getResources();
for (const resource of resources) {
dict[resource.path] = resource;
}
return dict;
}
}

View File

@@ -1,10 +0,0 @@
{
"watch": ["./","../Common/Server", "../Common/Types", "../Common/Utils", "../Common/Models"],
"ext": "ts,json,tsx,env,js,jsx,hbs",
"ignore": [
"greenlock.d/*"
],
"watchOptions": {"useFsEvents": false, "interval": 500},
"env": {"TS_NODE_TRANSPILE_ONLY": "1", "TS_NODE_FILES": "false"},
"exec": "node --inspect=0.0.0.0:9229 -r ts-node/register/transpile-only Index.ts"
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,29 +0,0 @@
{
"name": "@oneuptime/api-reference",
"version": "1.0.0",
"description": "",
"main": "Index.ts",
"scripts": {
"start": "export NODE_OPTIONS='--max-old-space-size=8096' && node --require ts-node/register Index.ts",
"compile": "tsc",
"clear-modules": "rm -rf node_modules && rm package-lock.json && npm install",
"dev": "npx nodemon",
"audit": "npm audit --audit-level=low",
"dep-check": "npm install -g depcheck && depcheck ./ --skip-missing=true",
"test": "rm -rf build && jest --detectOpenHandles --passWithNoTests",
"coverage": "jest --detectOpenHandles --coverage"
},
"author": "OneUptime <hello@oneuptime.com> (https://oneuptime.com/)",
"license": "Apache-2.0",
"dependencies": {
"Common": "file:../Common",
"ejs": "^3.1.9",
"ts-node": "^10.9.1"
},
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/node": "^17.0.31",
"jest": "^28.1.0",
"nodemon": "^2.0.20"
}
}

View File

@@ -1,112 +0,0 @@
{
"ts-node": {
// these options are overrides used only by ts-node
// same as the --compilerOptions flag and the TS_NODE_COMPILER_OPTIONS environment variable
"compilerOptions": {
"module": "commonjs",
"resolveJsonModule": true,
}
},
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "es2017" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
"jsx": "react" /* Specify what JSX code is generated. */,
"experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
"emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
/* Modules */
// "module": "es2022" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
"typeRoots": [
"./node_modules/@types"
], /* Specify multiple folders that act like `./node_modules/@types`. */
"types": ["node", "jest"], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "resolveJsonModule": true, /* Enable importing .json files */
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
"outDir": "./build/dist", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
"noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
"strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
"strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
"strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
"strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
"noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
"useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
"alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
"noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
"exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
"noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
"noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
"noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"resolveJsonModule": true
}
}

View File

@@ -1,749 +0,0 @@
<main class="py-16">
<article class="prose ">
<h1>
<%= pageData.title -%>
</h1>
<p class="lead">
<%= pageData.description -%>
</p>
<h2 id="the-contact-model" class="scroll-mt-24">
The <%= pageData.title -%> Model
</h2>
<script>
function showPermissions(id) {
var permissionsblock = document.getElementById(id + "-permissions");
var viewPermissionsBtn = document.getElementById(id + "-view-permissions");
if (permissionsblock.style.display === "none") {
permissionsblock.style.display = "block";
viewPermissionsBtn.innerHTML = "Hide Permissions";
} else {
permissionsblock.style.display = "none";
viewPermissionsBtn.innerHTML = "View Permissions";
}
}
</script>
<h3>Properties</h3>
<div class="my-6">
<ul role="list" class="m-0 w-full list-none divide-y divide-zinc-900/5 p-0 ">
<% for(var i=0; i<Object.keys(pageData.columns).length; i++) {%>
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0 mt-5">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Name</dt>
<dd><code class="model-inline-code"><%= Object.keys(pageData.columns)[i] -%></code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">
<%= pageData.columns[Object.keys(pageData.columns)[i]].type -%>
<% if(pageData.columns[Object.keys(pageData.columns)[i]].required){ %>
(Required)
<% } %>
</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none text-sm [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>
<%= pageData.columns[Object.keys(pageData.columns)[i]].description -%> <a
class="text-gray-500 hover:underline cursor-pointer text-xs"
id="<%= Object.keys(pageData.columns)[i] -%>-view-permissions"
onclick="showPermissions('<%= Object.keys(pageData.columns)[i] -%>')">View
Permissions</a>
</p>
</dd>
<dd class="font-mono text-xs" style="display: none;"
id="<%= Object.keys(pageData.columns)[i] -%>-permissions">
<div class="mb-3 mt-3">
<span class="text-gray-700 text-xs">Permissions to Create:&nbsp;</span>
<% for(var j=0; j <
pageData.columns[Object.keys(pageData.columns)[i]].permissions.create.length; j++) {%>
<span
class="rounded-xl p-0.5 px-1 text-xs text-slate-500 bg-slate-100 border-2 border-slate-200">
<%= pageData.columns[Object.keys(pageData.columns)[i]].permissions.create[j] -%>
</span>
<% if(j
!==pageData.columns[Object.keys(pageData.columns)[i]].permissions.create.length-1){ %>
<span class="text-gray-400 text-xs ml-1 mr-1">or</span>
<% } %>
<% } %>
<% if(pageData.columns[Object.keys(pageData.columns)[i]].permissions.create.length===0){
%>
<span class="p-0.5 px-1 text-xs text-rose-400"> This property is
autogenerated. </span>
<% } %>
</div>
<div class="mb-3 mt-3">
<span class="text-gray-700 text-xs">Permissions to Read:&nbsp;</span>
<% for(var j=0; j <
pageData.columns[Object.keys(pageData.columns)[i]].permissions.read.length; j++) {%>
<span
class="rounded-xl p-0.5 px-1 text-xs text-slate-500 bg-slate-100 border-2 border-slate-200">
<%= pageData.columns[Object.keys(pageData.columns)[i]].permissions.read[j] -%>
</span>
<% if(j !==pageData.columns[Object.keys(pageData.columns)[i]].permissions.read.length-1){
%>
<span class="text-gray-400 text-xs ml-1 mr-1">or</span>
<% } %>
<% } %>
<% if(pageData.columns[Object.keys(pageData.columns)[i]].permissions.read.length===0){
%>
<span class="p-0.5 px-1 text-xs text-rose-400"> This property cannot be read.
</span>
<% } %>
</div>
<div class="mb-3 mt-3">
<span class="text-gray-700 text-xs">Permissions to Update:&nbsp;</span>
<% for(var j=0; j <
pageData.columns[Object.keys(pageData.columns)[i]].permissions.update.length; j++) {%>
<span
class="rounded-xl p-0.5 px-1 text-xs text-slate-500 bg-slate-100 border-2 border-slate-200">
<%= pageData.columns[Object.keys(pageData.columns)[i]].permissions.update[j] -%>
</span>
<% if(j
!==pageData.columns[Object.keys(pageData.columns)[i]].permissions.update.length-1){ %>
<span class="text-gray-400 text-xs ml-1 mr-1">or</span>
<% } %>
<% } %>
<% if(pageData.columns[Object.keys(pageData.columns)[i]].permissions.update.length===0){
%>
<span class="p-0.5 px-1 text-xs text-rose-400"> This property cannot be
updated. </span>
<% } %>
</div>
</dd>
</dl>
</li>
<% } %>
</ul>
</div>
<div class="mt-10">
<hr>
<div class="flex items-center gap-x-3 mt-10"><span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-emerald-300 bg-emerald-400/10 text-emerald-500 ">GET</span>
<span class="font-mono text-xs text-zinc-400">or</span> <span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-sky-300 bg-sky-400/10 text-sky-500 ">POST</span><span
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span class="font-mono text-xs text-zinc-400">
<%= pageData.apiPath -%>/get-list
</span>
</div>
<div class="-mt-20">
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span
class="group text-inherit no-underline hover:text-inherit">List</span></h2>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10 xl:max-w-none xl:grid-cols-2">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>This endpoint allows you to retrieve a paginated list of all your <%= pageData.title -%>. By
default, a maximum of ten
<%= pageData.title -%> are shown per page.</p>
<h3>Optional Query Params</h3>
<div class="my-6">
<ul role="list"
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Limit</dt>
<dd><code class="inline-code">limit</code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">number</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>Number of objects to fetch. By default 10, you can increase this count up to 100</p>
</dd>
</dl>
</li>
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Skip</dt>
<dd><code class="inline-code">skip</code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">number</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>Number of objects to skip. This can be useful in pagination</p>
</dd>
</dl>
</li>
</ul>
</div>
<h3>Optional Request Body</h3>
<div class="my-6">
<ul role="list"
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Query</dt>
<dd><code class="inline-code">query</code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">query</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>If you would like to filter on <%= pageData.title -%>. You can specify include a
query here. For more information, <a class="link" target="_blank"
href="/reference/data-types#queries">please check out writing queries
here.</a></p>
</dd>
</dl>
</li>
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Select</dt>
<dd><code class="inline-code">select</code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">select</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p> By default you will only retrieve ID of objects, to retrieve more fields you need
to select them. For more information, <a class="link" target="_blank"
href="/reference/data-types#select">please check how to select here.</a></p>
</dd>
</dl>
</li>
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Sort</dt>
<dd><code class="inline-code">sort</code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">sort</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p> Objects will be sorted based on created date by default. You can change the sort
order by passing <a class="link" target="_blank"
href="/reference/data-types#select">please check how to select here.</a></p>
</dd>
</dl>
</li>
</ul>
</div>
</div>
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0 xl:sticky xl:top-24">
<%- include('../partials/code', {title: "Example List Request" , requestUrl:
pageData.apiPath+"/get-list?skip=0&limit=10", code: pageData.listRequest, requestType: "POST" })
-%>
<%- include('../partials/code', {title: "Example List Response" , code: pageData.listResponse,
requestType: "" }) -%>
</div>
</div>
</div>
</div>
<div class="mt-10">
<hr>
<div class="flex items-center gap-x-3 mt-10"><span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-emerald-300 bg-emerald-400/10 text-emerald-500 ">GET</span>
<span class="font-mono text-xs text-zinc-400">or</span> <span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-sky-300 bg-sky-400/10 text-sky-500 ">POST</span><span
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span class="font-mono text-xs text-zinc-400">
<%= pageData.apiPath -%>/:id/get-item
</span>
</div>
<div class="-mt-20">
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span
class="group text-inherit no-underline hover:text-inherit">Get item by ID</span></h2>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10 xl:max-w-none xl:grid-cols-2">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>This endpoint allows you to retrieve <%= pageData.title -%> by ID.
<h3>Required Query Params</h3>
<div class="my-6">
<ul role="list"
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">ID</dt>
<dd><code class="inline-code">id</code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">text</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>ID of the Object</p>
</dd>
</dl>
</li>
</ul>
</div>
<h3>Optional Request Body</h3>
<div class="my-6">
<ul role="list"
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Select</dt>
<dd><code class="inline-code">select</code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">select</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p> By default you will only retrieve ID of objects, to retrieve more fields you
need to select them. For more information, <a class="link" target="_blank"
href="/reference/data-types#select">please check how to select here.</a>
</p>
</dd>
</dl>
</li>
</ul>
</div>
</div>
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0 xl:sticky xl:top-24">
<%- include('../partials/code', {title: "Example Item Request" , requestUrl:
pageData.apiPath+"/:id/get-item", code: pageData.itemRequest, requestType: "POST" }) -%>
<%- include('../partials/code', {title: "Example Item Response" , code: pageData.itemResponse,
requestType: "" }) -%>
</div>
</div>
</div>
</div>
<div class="mt-10">
<hr>
<div class="flex items-center gap-x-3 mt-10"><span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-sky-300 bg-sky-400/10 text-sky-500 ">POST</span><span
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span class="font-mono text-xs text-zinc-400">
<%= pageData.apiPath -%>/count
</span></div>
<div class="-mt-20">
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span
class="group text-inherit no-underline hover:text-inherit">Count</span></h2>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10 xl:max-w-none xl:grid-cols-2">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>This endpoint allows you to retrieve the count of all your <%= pageData.title -%>. </p>
<h3>Optional Request Body</h3>
<div class="my-6">
<ul role="list"
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Query</dt>
<dd><code class="inline-code">query</code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">query</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>If you would like to filter on <%= pageData.title -%>. You can specify include a
query here. For more information, <a class="link" target="_blank"
href="/reference/data-types#queries">please check out writing queries
here.</a></p>
</dd>
</dl>
</li>
</ul>
</div>
</div>
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0 xl:sticky xl:top-24">
<%- include('../partials/code', {title: "Example Count Request" , requestUrl:
pageData.apiPath+"/count", code: pageData.countRequest, requestType: "POST" }) -%>
<%- include('../partials/code', {title: "Example Count Response" , code: pageData.countResponse,
requestType: "" }) -%>
</div>
</div>
</div>
</div>
<div class="mt-10">
<hr>
<div class="flex items-center gap-x-3 mt-10"><span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-sky-300 bg-sky-400/10 text-sky-500 ">POST</span><span
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span class="font-mono text-xs text-zinc-400">
<%= pageData.apiPath -%>
</span></div>
<div class="-mt-20">
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span
class="group text-inherit no-underline hover:text-inherit">Create <%= pageData.title -%> </span></h2>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10 xl:max-w-none xl:grid-cols-2">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>This endpoint allows you to create a new object. </p>
<h3>Request Body</h3>
<div class="my-6">
<ul role="list"
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Data</dt>
<dd><code class="inline-code">data</code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">JSON</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>Object to update as JSON</p>
</dd>
</dl>
</li>
</ul>
</div>
</div>
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0 xl:sticky xl:top-24">
<%- include('../partials/code', {title: "Example Create Request" , requestUrl: pageData.apiPath, code:
pageData.createRequest, requestType: "POST" }) -%>
<%- include('../partials/code', {title: "Example Create Response" , code: pageData.createResponse,
requestType: "" }) -%>
</div>
</div>
</div>
</div>
<div class="mt-10">
<hr>
<div class="flex items-center gap-x-3 mt-10"><span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-amber-300 bg-amber-400/10 text-amber-500 ">PUT</span><span
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span class="font-mono text-xs text-zinc-400">
<%= pageData.apiPath -%>/:id
</span></div>
<div class="-mt-20">
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span
class="group text-inherit no-underline hover:text-inherit">Update by ID</span></h2>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10 xl:max-w-none xl:grid-cols-2">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>This endpoint allows you to update object by its ID. </p>
<h3>Request Body</h3>
<div class="my-6">
<ul role="list"
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Data</dt>
<dd><code class="inline-code">data</code></dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">JSON</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>Object to update as JSON</p>
</dd>
</dl>
</li>
</ul>
</div>
<div class="border border-gray-100 bg-gray-50 rounded-md p-4 text-sm mt-10">
<h4 class="font-semibold text-gray-700 ">For clients that do not support PUT requests<h4>
<p class="text-gray-500 text-xs mt-4">
You can also update an object by sending a POST or GET request to these endpoints with the
same
request headers and body.
</p>
<div class="flex items-center gap-x-3 mt-10"><span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-sky-300 bg-sky-400/10 text-sky-500 ">POST</span><span
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span
class="font-mono text-xs text-zinc-400">
<%= pageData.apiPath -%>/:id/update-item
</span></div>
<div class="flex items-center gap-x-3 mt-10"><span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-emerald-300 bg-emerald-400/10 text-emerald-500 ">GET</span><span
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span
class="font-mono text-xs text-zinc-400">
<%= pageData.apiPath -%>/:id/update-item
</span></div>
</div>
</div>
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0 xl:sticky xl:top-24">
<%- include('../partials/code', {title: "Example Update Request" , requestUrl:
pageData.apiPath+"/:id", code: pageData.updateRequest, requestType: "PUT" }) -%>
<%- include('../partials/code', {title: "Example Update Response" , code: pageData.updateResponse,
requestType: "" }) -%>
</div>
</div>
</div>
</div>
<div class="mt-10">
<hr>
<div class="flex items-center gap-x-3 mt-10"><span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-red-300 bg-red-400/10 text-red-500 ">DELETE</span><span
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span class="font-mono text-xs text-zinc-400">
<%= pageData.apiPath -%>/:id
</span></div>
<div class="-mt-20">
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span
class="group text-inherit no-underline hover:text-inherit">Delete by ID</span></h2>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10 xl:max-w-none xl:grid-cols-2">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>This endpoint allows you to delete object by its ID. </p>
<div class="border border-gray-100 bg-gray-50 rounded-md p-4 text-sm mt-10">
<h4 class="font-semibold text-gray-700 ">For clients that do not support DELETE requests<h4>
<p class="text-gray-500 text-xs mt-4">
You can also delete an object by sending a POST or GET request to these endpoints with the
same
request headers and body.
</p>
<div class="flex items-center gap-x-3 mt-10"><span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-sky-300 bg-sky-400/10 text-sky-500 ">POST</span><span
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span
class="font-mono text-xs text-zinc-400">
<%= pageData.apiPath -%>/:id/delete-item
</span></div>
<div class="flex items-center gap-x-3 mt-10"><span
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-emerald-300 bg-emerald-400/10 text-emerald-500 ">GET</span><span
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span
class="font-mono text-xs text-zinc-400">
<%= pageData.apiPath -%>/:id/delete-item
</span></div>
</div>
</div>
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0 xl:sticky xl:top-24">
<%- include('../partials/code', {title: "Example Delete Request" , requestUrl:
pageData.apiPath+"/:id", code: pageData.deleteRequest, requestType: "DELETE" }) -%>
<%- include('../partials/code', {title: "Example Delete Response" , code: pageData.deleteResponse,
requestType: "" }) -%>
</div>
</div>
</div>
</div>
<h2>Permissions</h2>
<% if(!pageData.isMasterAdminApiDocs){ %>
<p class="lead"> Your API Token needs permissions to create, update, read or delete this resource. If you do
not have permissions to make a request a <code class="inline-code">4xx</code> status will be sent as
response. </p>
<h3 id="consuming-webhooks">
Read Permissions
</h3>
<p>You need one of these permissions to read <%= pageData.title -%>:</p>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<div class="my-6">
<ul role="list" class="m-0 w-full">
<% for(var i=0; i<pageData.tablePermissions.read.length; i++) {%>
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Name</dt>
<dd><code class="inline-code"> <%= pageData.tablePermissions.read[i].permission -%></code>
</dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">
<%= pageData.tablePermissions.read[i].title -%>
</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full text-sm flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>
<%= pageData.tablePermissions.read[i].description -%>
</p>
</dd>
</dl>
</li>
<% } %>
</ul>
</div>
</div>
</div>
<h3 id="consuming-webhooks">
Create Permissions
</h3>
<p>You need one of these permissions to create <%= pageData.title -%>:</p>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<div class="my-6">
<ul role="list" class="m-0 w-full">
<% for(var i=0; i<pageData.tablePermissions.create.length; i++) {%>
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Name</dt>
<dd><code
class="inline-code"> <%= pageData.tablePermissions.create[i].permission -%></code>
</dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">
<%= pageData.tablePermissions.create[i].title -%>
</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full text-sm flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>
<%= pageData.tablePermissions.create[i].description -%>
</p>
</dd>
</dl>
</li>
<% } %>
</ul>
</div>
</div>
</div>
<h3 id="consuming-webhooks">
Update Permissions
</h3>
<p>You need one of these permissions to update <%= pageData.title -%>:</p>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<div class="my-6">
<ul role="list" class="m-0 w-full">
<% for(var i=0; i<pageData.tablePermissions.update.length; i++) {%>
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Name</dt>
<dd><code
class="inline-code"> <%= pageData.tablePermissions.update[i].permission -%></code>
</dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">
<%= pageData.tablePermissions.update[i].title -%>
</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none text-sm [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>
<%= pageData.tablePermissions.update[i].description -%>
</p>
</dd>
</dl>
</li>
<% } %>
</ul>
</div>
</div>
</div>
<h3 id="consuming-webhooks">
Delete Permissions
</h3>
<p>You need one of these permissions to delete <%= pageData.title -%>:</p>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<div class="my-6">
<ul role="list" class="m-0 w-full">
<% for(var i=0; i<pageData.tablePermissions.delete.length; i++) {%>
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Name</dt>
<dd><code
class="inline-code"> <%= pageData.tablePermissions.delete[i].permission -%></code>
</dd>
<dt class="sr-only">Type</dt>
<dd class="font-mono text-xs text-zinc-400 ">
<%= pageData.tablePermissions.delete[i].title -%>
</dd>
<dt class="sr-only">Description</dt>
<dd class="w-full text-sm flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>
<%= pageData.tablePermissions.delete[i].description -%>
</p>
</dd>
</dl>
</li>
<% } %>
</ul>
</div>
</div>
</div>
<% } %>
<% if(pageData.isMasterAdminApiDocs){ %>
<div class="border-l-4 border-yellow-400 bg-yellow-50 p-4">
<div class="flex">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-yellow-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z"
clip-rule="evenodd" />
</svg>
</div>
<div class="ml-3">
<div class="text-sm font-medium text-yellow-700 mb-0">
This API can only be accessed through a Master API Token. You can create one on the Admin
Dashboard. Please add the token to the <code class="inline-code">ApiKey</code> header to make
the request.
</div>
</div>
</div>
</div>
<% } %>
</article>
</main>

View File

@@ -1,53 +0,0 @@
<main class="py-16">
<article class="prose ">
<h1>OneUptime OpenAPI Specification</h1>
<p class="lead">In this guide, we will look at how to import and work with the OneUptime OpenAPI specification. The OpenAPI spec provides a comprehensive reference for all available API endpoints.</p>
<p>The OneUptime API follows the OpenAPI 3.0 specification, which provides a standardized way to describe REST APIs. You can import our OpenAPI spec into various tools like Swagger Editor, Postman, or other API documentation tools to explore and test our endpoints.</p>
<h2 id="importing-spec" class="scroll-mt-24">
Importing the OpenAPI Spec
</h2>
<div class="grid grid-cols-1 items-start gap-x-16 gap-y-10">
<div class="[&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>To import the OneUptime OpenAPI specification into Swagger Editor, follow these simple steps:</p>
<div class="my-6">
<ol class="list-decimal pl-6">
<li class="mb-2">Open <a href="https://editor.swagger.io" target="_blank" class="text-blue-600 hover:text-blue-800">editor.swagger.io</a> in your web browser</li>
<li class="mb-2">Click on <strong>File</strong> in the menu bar</li>
<li class="mb-2">Select <strong>Import URL</strong> from the dropdown menu</li>
<li class="mb-2">Enter the URL: <code class="inline-code"><%= pageData.hostUrl %>api/openapi/spec</code></li>
<li class="mb-2">Click <strong>Import</strong> to load the specification</li>
</ol>
</div>
<h2 id="spec-url" class="scroll-mt-24">
Specification URL
</h2>
<div class="my-6">
<ul role="list"
class="m-0 list-none divide-y divide-zinc-900/5 p-0 ">
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">Endpoint</dt>
<dd><code class="inline-code"><%= pageData.hostUrl %>api/openapi/spec</code></dd>
<dt class="sr-only">Description</dt>
<dd class="w-full flex-none [&amp;>:first-child]:mt-0 [&amp;>:last-child]:mb-0">
<p>Complete OpenAPI 3.0 specification for the OneUptime API including all endpoints, request/response schemas, and authentication methods.</p>
</dd>
</dl>
</li>
</ul>
</div>
<h2 id="benefits" class="scroll-mt-24">
Benefits of Using the OpenAPI Spec
</h2>
<div class="my-6">
<ul class="list-disc pl-6">
<li class="mb-2"><strong>Interactive Documentation:</strong> Test API endpoints directly in Swagger Editor</li>
<li class="mb-2"><strong>Code Generation:</strong> Generate client SDKs in multiple programming languages</li>
<li class="mb-2"><strong>Validation:</strong> Ensure your requests match the expected schema</li>
<li class="mb-2"><strong>Import to Tools:</strong> Use with Postman, Insomnia, or other API testing tools</li>
</ul>
</div>
</div>
</div>
</article>
</main>

View File

@@ -1,27 +0,0 @@
<html lang="en" class="js-focus-visible ctshmsrlsm idc0_345">
<%- include('../partials/head', {
enableGoogleTagManager: typeof enableGoogleTagManager !== 'undefined' ? enableGoogleTagManager : false,
}) -%>
<body onload="applyStyles()" class="bg-white antialiased " data-new-gr-c-s-check-loaded="14.1095.0"
data-gr-ext-installed="">
<div id="__next">
<div class="lg:ml-72 xl:ml-80">
<%- include('../partials/nav') -%>
<div class="flex justify-center">
<div class="relative px-4 pt-14 sm:px-6 lg:px-8 max-w-5xl ">
<div>
<div class="flex justify-center">
<%- include('../main/'+page) -%>
</div>
<div class="flex justify-center">
<%- include('../partials/footer') -%>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -1,211 +0,0 @@
<head>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
<script>
function applyStyles() {
applyStylesTo("h1", "font-bold text-2xl mb-5")
applyStylesTo("h2", "mb-5 scroll-mt-24 mt-24 font-bold text-xl")
applyStylesTo("h3", "mb-5 scroll-mt-24 mt-10 font-bold text-base")
applyStylesTo("p", "mb-5")
applyStylesTo("link", "text-emerald-500 hover:text-emerald-600")
applyStylesTo("model-inline-code", "rounded p-0.5 px-1 text-sm text-gray-50 bg-gray-600 border-2 border-gray-600 shadow")
applyStylesTo("inline-code", "rounded p-0.5 px-1 text-sm text-gray-500 bg-gray-100 border-2 border-gray-200")
}
function applyStylesTo(tagOrClassName, classList) {
let elements = document.getElementsByClassName(tagOrClassName);
if(elements.length === 0){
elements = document.getElementsByTagName(tagOrClassName);
}
for (var i = 0, all = elements.length; i < all; i++) {
classList.split(" ").map((classItem)=> {
elements[i].classList.add(classItem);
})
}
}
</script>
<style>
.hljs {
color: unset;
background-color: unset;
}
.hljs-string {
color: #6ee7b7
}
.hljs-number {
color: #7dd3fc
}
.hljs-punctuation {
color: #e5e7eb
}
.hljs-comment {
color: #9ca3af
}
.hljs-keyword{
color: #7dd3fc;
font-weight: unset;
}
.hljs-attr{
color: #fda4af;
}
* {
font-family: Inter;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
background: transparent;
bottom: 0;
color: transparent;
cursor: pointer;
height: auto;
left: 0;
position: absolute;
right: 0;
top: 0;
width: auto;
}
input[type="date"]::-webkit-calendar-picker-indicator {
background: transparent;
bottom: 0;
color: transparent;
cursor: pointer;
height: auto;
left: 0;
position: absolute;
right: 0;
top: 0;
width: auto;
}
</style>
<script src="https://cdn.tailwindcss.com"></script>
<% if(typeof enableGoogleTagManager !== 'undefined' ? enableGoogleTagManager : false){ %>
<!-- Google Tag Manager -->
<script>(function (w, d, s, l, i) {
w[l] = w[l] || []; w[l].push({
'gtm.start':
new Date().getTime(), event: 'gtm.js'
}); var f = d.getElementsByTagName(s)[0],
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-PKQD5WH');</script>
<!-- End Google Tag Manager -->
<% } %>
<style>
.async-hide {
opacity: 0 !important
}
</style>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="/img/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/img/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicons/favicon-16x16.png">
<link rel="mask-icon" href="/img/favicons/safari-pinned-tab.svg" color="#32335b">
<meta name="msapplication-TileColor" content="#32335b">
<link rel="apple-touch-icon-precomposed" href="/img/ou-wb.svg">
<link rel="icon" href="/img/ou-wb.svg">
<link rel="image_src" type="image/png" href="/img/hou-wb.svg">
<link rel="manifest" href="/manifest.json">
<meta property="og:title" content="OneUptime - One Complete Observability platform.">
<meta property="og:url" content="https://oneuptime.com">
<meta property="og:type" content="website" />
<meta property="og:description"
content="OneUptime monitors websites, API's, and servers and alerts your team if something goes wrong. It also keeps your customers updated about any downtime. ">
<meta property="og:image" content="https://oneuptime.com/img/hou-wb.svg">
<meta name="twitter:card" content="summary">
<meta name="theme-color" content="#000000">
<meta name="twitter:image" content="/img/ou-wb.svg">
<meta name="twitter:site" content="@oneuptimeinc">
<meta name="twitter:title" content="OneUptime - One Complete Observability platform.">
<meta name="twitter:description"
content="OneUptime monitors websites, API's, and servers and alerts your team if something goes wrong. It also keeps your customers updated about any downtime.">
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Corporation",
"name": "OneUptime",
"url": "https://www.oneuptime.com",
"logo": "https://oneuptime.com/img/ou-bb.svg",
"sameAs": [
"https://www.facebook.com/oneuptimeinc",
"https://twitter.com/OneUptimeInc",
"https://www.linkedin.com/company/oneuptime"
],
"description": "OneUptime monitors websites, API's, and servers and alerts your team if something goes wrong. It also keeps your customers updated about any downtime."
}
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>OneUptime API Reference - <%= pageTitle -%>
</title>
<meta name="description" content="<%= pageDescription -%>">
<meta name="next-head-count" content="4">
<script>
let darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
updateMode()
darkModeMediaQuery.addEventListener('change', updateModeWithoutTransitions)
window.addEventListener('storage', updateModeWithoutTransitions)
function updateMode() {
let isSystemDarkMode = darkModeMediaQuery.matches
let isDarkMode = window.localStorage.isDarkMode === 'true' || (!('isDarkMode' in window.localStorage) && isSystemDarkMode)
if (isDarkMode) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
if (isDarkMode === isSystemDarkMode) {
delete window.localStorage.isDarkMode
}
}
function disableTransitionsTemporarily() {
document.documentElement.classList.add('[&_*]:!transition-none')
window.setTimeout(() => {
document.documentElement.classList.remove('[&_*]:!transition-none')
}, 0)
}
function updateModeWithoutTransitions() {
disableTransitionsTemporarily()
updateMode()
}
</script>
</head>

View File

@@ -1,270 +0,0 @@
<header class="contents lg:pointer-events-none lg:fixed lg:inset-0 lg:z-40 lg:flex">
<div
class="contents lg:pointer-events-auto lg:block lg:w-72 lg:overflow-y-auto lg:border-r lg:border-zinc-900/10 lg:px-6 lg:pt-4 lg:pb-8 xl:w-80">
<div class="hidden lg:flex">
<a aria-label="Home" href="/">
<svg class="h-6 -ml-48" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="500" zoomAndPan="magnify" viewBox="0 0 375 74.999997" height="100"
preserveAspectRatio="xMidYMid meet" version="1.0">
<defs>
<g />
<clipPath id="1d83d73318">
<path
d="M 351.792969 35.324219 L 367.53125 35.324219 L 367.53125 51.0625 L 351.792969 51.0625 Z M 351.792969 35.324219 "
clip-rule="nonzero" />
</clipPath>
<clipPath id="32c1ad7ad2">
<path
d="M 366.480469 51.03125 L 352.816406 51.03125 C 352.253906 51.03125 351.792969 50.574219 351.792969 50.007812 L 351.792969 36.347656 C 351.792969 35.785156 352.253906 35.324219 352.816406 35.324219 L 366.480469 35.324219 C 367.042969 35.324219 367.5 35.785156 367.5 36.347656 L 367.5 50.007812 C 367.5 50.574219 367.042969 51.03125 366.480469 51.03125 "
clip-rule="nonzero" />
</clipPath>
</defs>
<g clip-path="url(#1d83d73318)">
<g clip-path="url(#32c1ad7ad2)">
<path fill="#7ed957"
d="M 351.792969 35.324219 L 367.53125 35.324219 L 367.53125 51.0625 L 351.792969 51.0625 Z M 351.792969 35.324219 "
fill-opacity="1" fill-rule="nonzero" />
</g>
</g>
<g fill="#121212" fill-opacity="1">
<g transform="translate(11.173064, 55.95717)">
<g>
<path
d="M 1.5625 -21.828125 C 1.5625 -25.191406 2.054688 -28.320312 3.046875 -31.21875 C 4.046875 -34.164062 5.5 -36.71875 7.40625 -38.875 C 9.3125 -41.070312 11.632812 -42.773438 14.375 -43.984375 C 15.738281 -44.597656 17.195312 -45.0625 18.75 -45.375 C 20.3125 -45.6875 21.941406 -45.84375 23.640625 -45.84375 C 25.335938 -45.84375 26.960938 -45.6875 28.515625 -45.375 C 30.078125 -45.0625 31.539062 -44.578125 32.90625 -43.921875 C 34.269531 -43.296875 35.53125 -42.546875 36.6875 -41.671875 C 37.851562 -40.804688 38.914062 -39.8125 39.875 -38.6875 C 41.78125 -36.53125 43.25 -34.003906 44.28125 -31.109375 C 45.28125 -28.203125 45.78125 -25.109375 45.78125 -21.828125 C 45.78125 -18.554688 45.28125 -15.46875 44.28125 -12.5625 C 43.957031 -11.613281 43.578125 -10.679688 43.140625 -9.765625 C 42.703125 -8.847656 42.210938 -7.984375 41.671875 -7.171875 C 41.140625 -6.367188 40.5625 -5.597656 39.9375 -4.859375 C 38.976562 -3.734375 37.90625 -2.734375 36.71875 -1.859375 C 35.539062 -0.992188 34.289062 -0.25 32.96875 0.375 C 30.226562 1.65625 27.113281 2.296875 23.625 2.296875 C 20.144531 2.296875 17.039062 1.65625 14.3125 0.375 C 13.644531 0.0390625 13 -0.3125 12.375 -0.6875 C 11.757812 -1.0625 11.160156 -1.460938 10.578125 -1.890625 C 9.992188 -2.328125 9.429688 -2.796875 8.890625 -3.296875 C 8.359375 -3.796875 7.863281 -4.316406 7.40625 -4.859375 C 5.5 -7.054688 4.046875 -9.625 3.046875 -12.5625 C 2.054688 -15.46875 1.5625 -18.554688 1.5625 -21.828125 Z M 10.703125 -21.828125 C 10.703125 -20.796875 10.773438 -19.769531 10.921875 -18.75 C 11.066406 -17.738281 11.28125 -16.734375 11.5625 -15.734375 C 11.894531 -14.785156 12.269531 -13.882812 12.6875 -13.03125 C 13.101562 -12.175781 13.601562 -11.378906 14.1875 -10.640625 C 14.351562 -10.390625 14.535156 -10.160156 14.734375 -9.953125 C 14.941406 -9.742188 15.148438 -9.535156 15.359375 -9.328125 C 15.566406 -9.117188 15.785156 -8.910156 16.015625 -8.703125 C 16.242188 -8.492188 16.484375 -8.304688 16.734375 -8.140625 C 16.984375 -7.984375 17.234375 -7.820312 17.484375 -7.65625 C 17.734375 -7.488281 17.976562 -7.320312 18.21875 -7.15625 C 19.800781 -6.320312 21.609375 -5.90625 23.640625 -5.90625 C 24.378906 -5.90625 25.082031 -5.945312 25.75 -6.03125 C 26.414062 -6.113281 27.035156 -6.25 27.609375 -6.4375 C 28.191406 -6.625 28.734375 -6.84375 29.234375 -7.09375 C 30.847656 -7.875 32.195312 -8.953125 33.28125 -10.328125 C 33.65625 -10.785156 33.984375 -11.269531 34.265625 -11.78125 C 34.554688 -12.300781 34.828125 -12.863281 35.078125 -13.46875 C 35.328125 -14.070312 35.554688 -14.679688 35.765625 -15.296875 C 36.347656 -17.328125 36.640625 -19.503906 36.640625 -21.828125 C 36.640625 -23.898438 36.328125 -25.894531 35.703125 -27.8125 C 35.117188 -29.71875 34.25 -31.414062 33.09375 -32.90625 C 31.96875 -34.351562 30.617188 -35.515625 29.046875 -36.390625 C 27.472656 -37.222656 25.671875 -37.640625 23.640625 -37.640625 C 23.140625 -37.640625 22.640625 -37.617188 22.140625 -37.578125 C 21.640625 -37.535156 21.160156 -37.460938 20.703125 -37.359375 C 20.253906 -37.253906 19.820312 -37.128906 19.40625 -36.984375 C 18.988281 -36.835938 18.59375 -36.660156 18.21875 -36.453125 C 17.394531 -36.078125 16.648438 -35.617188 15.984375 -35.078125 C 15.316406 -34.546875 14.71875 -33.925781 14.1875 -33.21875 C 13.0625 -31.8125 12.1875 -30.148438 11.5625 -28.234375 C 10.988281 -26.242188 10.703125 -24.109375 10.703125 -21.828125 Z M 10.703125 -21.828125 " />
</g>
</g>
</g>
<g fill="#121212" fill-opacity="1">
<g transform="translate(58.505968, 55.95717)">
<g>
<path
d="M 11.9375 -31.046875 C 12.269531 -31.367188 12.601562 -31.65625 12.9375 -31.90625 C 13.269531 -32.15625 13.625 -32.382812 14 -32.59375 C 16.070312 -33.957031 18.5 -34.640625 21.28125 -34.640625 C 23.3125 -34.640625 25.113281 -34.316406 26.6875 -33.671875 C 28.257812 -33.035156 29.585938 -32.078125 30.671875 -30.796875 C 32.703125 -28.304688 33.71875 -25.070312 33.71875 -21.09375 L 33.71875 1.5625 L 25 1.5625 L 25 -20.46875 C 25 -21.164062 24.945312 -21.804688 24.84375 -22.390625 C 24.738281 -22.972656 24.59375 -23.488281 24.40625 -23.9375 C 24.226562 -24.394531 23.992188 -24.789062 23.703125 -25.125 C 23.453125 -25.457031 23.171875 -25.738281 22.859375 -25.96875 C 22.546875 -26.195312 22.179688 -26.363281 21.765625 -26.46875 C 21.359375 -26.570312 20.882812 -26.625 20.34375 -26.625 C 19.59375 -26.625 18.84375 -26.476562 18.09375 -26.1875 C 17.3125 -25.894531 16.546875 -25.476562 15.796875 -24.9375 C 15.054688 -24.363281 14.351562 -23.722656 13.6875 -23.015625 C 13.4375 -22.679688 13.164062 -22.335938 12.875 -21.984375 C 12.582031 -21.628906 12.332031 -21.289062 12.125 -20.96875 L 12.125 1.5625 L 3.421875 1.5625 L 3.421875 -33.90625 L 11.9375 -33.90625 Z M 11.9375 -31.046875 " />
</g>
</g>
</g>
<g fill="#121212" fill-opacity="1">
<g transform="translate(95.327364, 55.95717)">
<g>
<path
d="M 10.390625 -12.3125 C 10.847656 -10.488281 11.632812 -9.019531 12.75 -7.90625 C 14.195312 -6.488281 16.144531 -5.78125 18.59375 -5.78125 C 19.175781 -5.78125 19.738281 -5.800781 20.28125 -5.84375 C 20.820312 -5.882812 21.335938 -5.945312 21.828125 -6.03125 C 22.328125 -6.113281 22.804688 -6.21875 23.265625 -6.34375 C 23.722656 -6.46875 24.175781 -6.601562 24.625 -6.75 C 25.082031 -6.894531 25.53125 -7.050781 25.96875 -7.21875 C 26.40625 -7.382812 26.851562 -7.570312 27.3125 -7.78125 L 28.921875 -8.515625 L 29.421875 -6.78125 L 30.734375 -1.984375 L 31.109375 -0.6875 L 29.921875 -0.125 C 28.304688 0.625 26.503906 1.207031 24.515625 1.625 C 23.515625 1.863281 22.460938 2.035156 21.359375 2.140625 C 20.265625 2.242188 19.117188 2.296875 17.921875 2.296875 C 15.390625 2.296875 13.085938 1.882812 11.015625 1.0625 C 8.941406 0.1875 7.175781 -1.054688 5.71875 -2.671875 C 4.269531 -4.242188 3.148438 -6.191406 2.359375 -8.515625 C 1.617188 -10.753906 1.25 -13.304688 1.25 -16.171875 C 1.25 -18.742188 1.617188 -21.148438 2.359375 -23.390625 C 2.773438 -24.503906 3.253906 -25.554688 3.796875 -26.546875 C 4.335938 -27.546875 4.957031 -28.460938 5.65625 -29.296875 C 7.070312 -30.953125 8.773438 -32.257812 10.765625 -33.21875 C 12.753906 -34.164062 14.972656 -34.640625 17.421875 -34.640625 C 18.242188 -34.640625 19.039062 -34.585938 19.8125 -34.484375 C 20.582031 -34.390625 21.328125 -34.25 22.046875 -34.0625 C 22.773438 -33.875 23.472656 -33.632812 24.140625 -33.34375 C 25.128906 -32.882812 26.023438 -32.351562 26.828125 -31.75 C 27.640625 -31.15625 28.378906 -30.460938 29.046875 -29.671875 C 30.335938 -28.140625 31.3125 -26.378906 31.96875 -24.390625 C 32.257812 -23.390625 32.488281 -22.359375 32.65625 -21.296875 C 32.820312 -20.242188 32.90625 -19.175781 32.90625 -18.09375 C 32.90625 -17.8125 32.90625 -17.523438 32.90625 -17.234375 C 32.90625 -16.941406 32.894531 -16.640625 32.875 -16.328125 C 32.851562 -16.015625 32.84375 -15.710938 32.84375 -15.421875 C 32.84375 -15.128906 32.832031 -14.847656 32.8125 -14.578125 C 32.789062 -14.316406 32.757812 -14.039062 32.71875 -13.75 L 32.59375 -12.3125 Z M 17.296875 -26.6875 C 15.304688 -26.6875 13.6875 -26.019531 12.4375 -24.6875 C 11.9375 -24.15625 11.5 -23.492188 11.125 -22.703125 C 10.757812 -21.910156 10.472656 -21 10.265625 -19.96875 L 24.5625 -19.96875 C 24.363281 -21.957031 23.742188 -23.507812 22.703125 -24.625 C 21.421875 -26 19.617188 -26.6875 17.296875 -26.6875 Z M 17.296875 -26.6875 " />
</g>
</g>
</g>
<g fill="#121212" fill-opacity="1">
<g transform="translate(129.163241, 55.95717)">
<g>
<path
d="M 31.28125 -45.09375 L 38.5625 -45.09375 L 38.5625 -16.796875 C 38.5625 -13.890625 38.148438 -11.253906 37.328125 -8.890625 C 36.492188 -6.523438 35.289062 -4.492188 33.71875 -2.796875 C 33.382812 -2.460938 33.039062 -2.148438 32.6875 -1.859375 C 32.332031 -1.578125 31.976562 -1.289062 31.625 -1 C 31.28125 -0.707031 30.910156 -0.445312 30.515625 -0.21875 C 30.117188 0.0078125 29.710938 0.226562 29.296875 0.4375 C 28.878906 0.644531 28.441406 0.832031 27.984375 1 C 25.828125 1.863281 23.425781 2.296875 20.78125 2.296875 C 15.257812 2.296875 10.925781 0.660156 7.78125 -2.609375 C 4.664062 -5.890625 3.109375 -10.535156 3.109375 -16.546875 L 3.109375 -45.09375 L 12.125 -45.09375 L 12.125 -17.484375 C 12.125 -13.617188 12.875 -10.691406 14.375 -8.703125 C 15.03125 -7.796875 15.875 -7.113281 16.90625 -6.65625 C 17.945312 -6.195312 19.238281 -5.96875 20.78125 -5.96875 C 23.800781 -5.96875 26.019531 -6.878906 27.4375 -8.703125 C 28.96875 -10.648438 29.734375 -13.578125 29.734375 -17.484375 L 29.734375 -45.09375 Z M 31.28125 -45.09375 " />
</g>
</g>
</g>
<g fill="#121212" fill-opacity="1">
<g transform="translate(170.836098, 55.95717)">
<g>
<path
d="M 3.671875 -33.90625 C 4.492188 -33.90625 5.257812 -33.84375 5.96875 -33.71875 C 6.675781 -33.59375 7.347656 -33.394531 7.984375 -33.125 C 8.628906 -32.851562 9.222656 -32.507812 9.765625 -32.09375 C 10.304688 -31.675781 10.765625 -31.179688 11.140625 -30.609375 C 11.835938 -31.304688 12.644531 -31.925781 13.5625 -32.46875 C 13.8125 -32.632812 14.0625 -32.789062 14.3125 -32.9375 C 14.5625 -33.082031 14.828125 -33.21875 15.109375 -33.34375 C 15.398438 -33.46875 15.691406 -33.582031 15.984375 -33.6875 C 16.273438 -33.789062 16.566406 -33.90625 16.859375 -34.03125 C 17.523438 -34.238281 18.207031 -34.390625 18.90625 -34.484375 C 19.613281 -34.585938 20.34375 -34.640625 21.09375 -34.640625 C 23.164062 -34.640625 25.164062 -34.222656 27.09375 -33.390625 C 29.019531 -32.566406 30.707031 -31.367188 32.15625 -29.796875 C 33.613281 -28.222656 34.753906 -26.316406 35.578125 -24.078125 C 35.867188 -23.328125 36.109375 -22.535156 36.296875 -21.703125 C 36.484375 -20.878906 36.628906 -20.03125 36.734375 -19.15625 C 36.835938 -18.289062 36.890625 -17.398438 36.890625 -16.484375 C 36.890625 -13.742188 36.472656 -11.210938 35.640625 -8.890625 C 35.222656 -7.773438 34.734375 -6.71875 34.171875 -5.71875 C 33.617188 -4.726562 32.96875 -3.816406 32.21875 -2.984375 C 31.96875 -2.648438 31.6875 -2.335938 31.375 -2.046875 C 31.070312 -1.765625 30.753906 -1.476562 30.421875 -1.1875 C 30.085938 -0.894531 29.753906 -0.625 29.421875 -0.375 C 29.085938 -0.125 28.734375 0.101562 28.359375 0.3125 C 27.992188 0.519531 27.625 0.707031 27.25 0.875 C 26.289062 1.375 25.300781 1.734375 24.28125 1.953125 C 23.269531 2.179688 22.25 2.296875 21.21875 2.296875 C 19.019531 2.296875 17.003906 1.863281 15.171875 1 C 14.515625 0.707031 13.894531 0.375 13.3125 0 L 13.3125 15.234375 L 4.609375 15.234375 L 4.609375 -24.078125 C 4.609375 -25.023438 4.441406 -25.644531 4.109375 -25.9375 C 3.734375 -26.269531 3.191406 -26.4375 2.484375 -26.4375 L 0.4375 -26.4375 L 1 -28.421875 L 2.171875 -32.78125 L 2.484375 -33.90625 Z M 28.046875 -16.296875 C 28.046875 -17.171875 27.984375 -17.976562 27.859375 -18.71875 C 27.742188 -19.46875 27.570312 -20.160156 27.34375 -20.796875 C 27.113281 -21.441406 26.851562 -22.035156 26.5625 -22.578125 C 26.269531 -23.117188 25.9375 -23.617188 25.5625 -24.078125 C 24.820312 -24.941406 23.960938 -25.59375 22.984375 -26.03125 C 22.003906 -26.46875 20.957031 -26.6875 19.84375 -26.6875 C 19.09375 -26.6875 18.382812 -26.59375 17.71875 -26.40625 C 17.0625 -26.21875 16.441406 -25.9375 15.859375 -25.5625 C 14.785156 -24.894531 13.9375 -24.191406 13.3125 -23.453125 L 13.3125 -8.703125 C 14.1875 -7.921875 15.140625 -7.257812 16.171875 -6.71875 C 17.335938 -6.09375 18.644531 -5.78125 20.09375 -5.78125 C 21.25 -5.78125 22.304688 -6.007812 23.265625 -6.46875 C 24.210938 -6.96875 25.039062 -7.648438 25.75 -8.515625 C 26.125 -8.972656 26.445312 -9.472656 26.71875 -10.015625 C 26.988281 -10.554688 27.226562 -11.15625 27.4375 -11.8125 C 27.644531 -12.476562 27.796875 -13.179688 27.890625 -13.921875 C 27.992188 -14.671875 28.046875 -15.460938 28.046875 -16.296875 Z M 28.046875 -16.296875 " />
</g>
</g>
</g>
<g fill="#121212" fill-opacity="1">
<g transform="translate(208.963656, 55.95717)">
<g>
<path
d="M 7.53125 -42.921875 L 13.375 -42.921875 L 13.375 -32.71875 L 22.328125 -32.71875 L 22.328125 -24.75 L 13.375 -24.75 L 13.375 -10.703125 C 13.375 -9.660156 13.476562 -8.8125 13.6875 -8.15625 C 13.894531 -7.53125 14.144531 -7.050781 14.4375 -6.71875 C 14.71875 -6.382812 15.066406 -6.15625 15.484375 -6.03125 C 15.734375 -5.945312 15.984375 -5.882812 16.234375 -5.84375 C 16.484375 -5.800781 16.734375 -5.78125 16.984375 -5.78125 C 17.847656 -5.78125 18.632812 -5.90625 19.34375 -6.15625 C 20.21875 -6.488281 21.023438 -6.863281 21.765625 -7.28125 L 23.390625 -8.15625 L 24.015625 -6.40625 L 25.5625 -1.921875 L 25.9375 -0.75 L 24.875 -0.125 C 23.96875 0.457031 22.75 1 21.21875 1.5 C 20.425781 1.78125 19.613281 1.984375 18.78125 2.109375 C 17.957031 2.234375 17.128906 2.296875 16.296875 2.296875 C 12.734375 2.296875 9.894531 1.113281 7.78125 -1.25 C 6.695312 -2.445312 5.90625 -3.875 5.40625 -5.53125 C 4.914062 -7.195312 4.671875 -9.066406 4.671875 -11.140625 L 4.671875 -24.75 L -0.9375 -24.75 L -0.9375 -32.71875 L 4.96875 -32.71875 L 5.96875 -41.546875 L 6.15625 -42.921875 Z M 7.53125 -42.921875 " />
</g>
</g>
</g>
<g fill="#121212" fill-opacity="1">
<g transform="translate(233.656391, 55.95717)">
<g>
<path
d="M 10.578125 1.5625 L 3.421875 1.5625 L 3.421875 -33.90625 L 12.125 -33.90625 L 12.125 1.5625 Z M 7.78125 -36.328125 C 6.28125 -36.328125 4.988281 -36.863281 3.90625 -37.9375 C 2.832031 -39.019531 2.296875 -40.304688 2.296875 -41.796875 C 2.296875 -43.410156 2.800781 -44.726562 3.8125 -45.75 C 4.832031 -46.769531 6.15625 -47.28125 7.78125 -47.28125 C 8.519531 -47.28125 9.222656 -47.144531 9.890625 -46.875 C 10.554688 -46.601562 11.144531 -46.207031 11.65625 -45.6875 C 12.175781 -45.164062 12.570312 -44.570312 12.84375 -43.90625 C 13.113281 -43.25 13.25 -42.546875 13.25 -41.796875 C 13.25 -40.179688 12.738281 -38.863281 11.71875 -37.84375 C 10.707031 -36.832031 9.394531 -36.328125 7.78125 -36.328125 Z M 7.78125 -36.328125 " />
</g>
</g>
</g>
<g fill="#121212" fill-opacity="1">
<g transform="translate(249.205965, 55.95717)">
<g>
<path
d="M 11.9375 -31.109375 C 12.269531 -31.390625 12.59375 -31.65625 12.90625 -31.90625 C 13.21875 -32.15625 13.5625 -32.382812 13.9375 -32.59375 C 14.4375 -32.925781 14.953125 -33.226562 15.484375 -33.5 C 16.023438 -33.769531 16.59375 -33.984375 17.1875 -34.140625 C 17.789062 -34.304688 18.394531 -34.429688 19 -34.515625 C 19.601562 -34.597656 20.238281 -34.640625 20.90625 -34.640625 C 23.800781 -34.640625 26.203125 -33.914062 28.109375 -32.46875 C 29.273438 -31.59375 30.234375 -30.515625 30.984375 -29.234375 C 32.015625 -30.398438 33.113281 -31.4375 34.28125 -32.34375 C 34.6875 -32.632812 35.117188 -32.90625 35.578125 -33.15625 C 36.035156 -33.40625 36.507812 -33.625 37 -33.8125 C 37.5 -34 38.007812 -34.148438 38.53125 -34.265625 C 39.050781 -34.390625 39.578125 -34.484375 40.109375 -34.546875 C 40.648438 -34.609375 41.210938 -34.640625 41.796875 -34.640625 C 42.046875 -34.640625 42.285156 -34.640625 42.515625 -34.640625 C 42.742188 -34.640625 42.972656 -34.628906 43.203125 -34.609375 C 43.429688 -34.585938 43.65625 -34.554688 43.875 -34.515625 C 44.101562 -34.472656 44.320312 -34.429688 44.53125 -34.390625 C 44.738281 -34.359375 44.945312 -34.320312 45.15625 -34.28125 C 45.363281 -34.238281 45.570312 -34.1875 45.78125 -34.125 C 45.988281 -34.0625 46.195312 -33.988281 46.40625 -33.90625 C 46.613281 -33.820312 46.820312 -33.738281 47.03125 -33.65625 C 47.394531 -33.488281 47.753906 -33.300781 48.109375 -33.09375 C 48.460938 -32.882812 48.796875 -32.65625 49.109375 -32.40625 C 49.421875 -32.15625 49.722656 -31.894531 50.015625 -31.625 C 50.304688 -31.351562 50.570312 -31.054688 50.8125 -30.734375 C 51.851562 -29.523438 52.601562 -28.09375 53.0625 -26.4375 C 53.5625 -24.820312 53.8125 -23.039062 53.8125 -21.09375 L 53.8125 1.5625 L 45.09375 1.5625 L 45.09375 -20.65625 C 45.09375 -22.5625 44.679688 -24.070312 43.859375 -25.1875 C 43.109375 -26.144531 42.09375 -26.625 40.8125 -26.625 C 40.0625 -26.625 39.351562 -26.476562 38.6875 -26.1875 C 37.945312 -25.851562 37.242188 -25.414062 36.578125 -24.875 C 35.867188 -24.300781 35.179688 -23.640625 34.515625 -22.890625 C 34.273438 -22.554688 34.007812 -22.203125 33.71875 -21.828125 C 33.425781 -21.460938 33.175781 -21.113281 32.96875 -20.78125 L 32.96875 1.5625 L 24.265625 1.5625 L 24.265625 -20.65625 C 24.265625 -22.5625 23.847656 -24.070312 23.015625 -25.1875 C 22.265625 -26.144531 21.25 -26.625 19.96875 -26.625 C 19.257812 -26.625 18.554688 -26.476562 17.859375 -26.1875 C 17.523438 -26.0625 17.171875 -25.894531 16.796875 -25.6875 C 16.421875 -25.476562 16.066406 -25.226562 15.734375 -24.9375 C 15.609375 -24.851562 15.484375 -24.757812 15.359375 -24.65625 C 15.234375 -24.5625 15.117188 -24.460938 15.015625 -24.359375 C 14.910156 -24.253906 14.796875 -24.148438 14.671875 -24.046875 C 14.554688 -23.941406 14.445312 -23.835938 14.34375 -23.734375 C 14.238281 -23.628906 14.132812 -23.515625 14.03125 -23.390625 C 13.925781 -23.265625 13.8125 -23.140625 13.6875 -23.015625 C 13.4375 -22.679688 13.164062 -22.335938 12.875 -21.984375 C 12.582031 -21.628906 12.332031 -21.289062 12.125 -20.96875 L 12.125 1.5625 L 3.421875 1.5625 L 3.421875 -33.90625 L 11.9375 -33.90625 Z M 11.9375 -31.109375 " />
</g>
</g>
</g>
<g fill="#121212" fill-opacity="1">
<g transform="translate(306.117405, 55.95717)">
<g>
<path
d="M 10.390625 -12.3125 C 10.847656 -10.488281 11.632812 -9.019531 12.75 -7.90625 C 14.195312 -6.488281 16.144531 -5.78125 18.59375 -5.78125 C 19.175781 -5.78125 19.738281 -5.800781 20.28125 -5.84375 C 20.820312 -5.882812 21.335938 -5.945312 21.828125 -6.03125 C 22.328125 -6.113281 22.804688 -6.21875 23.265625 -6.34375 C 23.722656 -6.46875 24.175781 -6.601562 24.625 -6.75 C 25.082031 -6.894531 25.53125 -7.050781 25.96875 -7.21875 C 26.40625 -7.382812 26.851562 -7.570312 27.3125 -7.78125 L 28.921875 -8.515625 L 29.421875 -6.78125 L 30.734375 -1.984375 L 31.109375 -0.6875 L 29.921875 -0.125 C 28.304688 0.625 26.503906 1.207031 24.515625 1.625 C 23.515625 1.863281 22.460938 2.035156 21.359375 2.140625 C 20.265625 2.242188 19.117188 2.296875 17.921875 2.296875 C 15.390625 2.296875 13.085938 1.882812 11.015625 1.0625 C 8.941406 0.1875 7.175781 -1.054688 5.71875 -2.671875 C 4.269531 -4.242188 3.148438 -6.191406 2.359375 -8.515625 C 1.617188 -10.753906 1.25 -13.304688 1.25 -16.171875 C 1.25 -18.742188 1.617188 -21.148438 2.359375 -23.390625 C 2.773438 -24.503906 3.253906 -25.554688 3.796875 -26.546875 C 4.335938 -27.546875 4.957031 -28.460938 5.65625 -29.296875 C 7.070312 -30.953125 8.773438 -32.257812 10.765625 -33.21875 C 12.753906 -34.164062 14.972656 -34.640625 17.421875 -34.640625 C 18.242188 -34.640625 19.039062 -34.585938 19.8125 -34.484375 C 20.582031 -34.390625 21.328125 -34.25 22.046875 -34.0625 C 22.773438 -33.875 23.472656 -33.632812 24.140625 -33.34375 C 25.128906 -32.882812 26.023438 -32.351562 26.828125 -31.75 C 27.640625 -31.15625 28.378906 -30.460938 29.046875 -29.671875 C 30.335938 -28.140625 31.3125 -26.378906 31.96875 -24.390625 C 32.257812 -23.390625 32.488281 -22.359375 32.65625 -21.296875 C 32.820312 -20.242188 32.90625 -19.175781 32.90625 -18.09375 C 32.90625 -17.8125 32.90625 -17.523438 32.90625 -17.234375 C 32.90625 -16.941406 32.894531 -16.640625 32.875 -16.328125 C 32.851562 -16.015625 32.84375 -15.710938 32.84375 -15.421875 C 32.84375 -15.128906 32.832031 -14.847656 32.8125 -14.578125 C 32.789062 -14.316406 32.757812 -14.039062 32.71875 -13.75 L 32.59375 -12.3125 Z M 17.296875 -26.6875 C 15.304688 -26.6875 13.6875 -26.019531 12.4375 -24.6875 C 11.9375 -24.15625 11.5 -23.492188 11.125 -22.703125 C 10.757812 -21.910156 10.472656 -21 10.265625 -19.96875 L 24.5625 -19.96875 C 24.363281 -21.957031 23.742188 -23.507812 22.703125 -24.625 C 21.421875 -26 19.617188 -26.6875 17.296875 -26.6875 Z M 17.296875 -26.6875 " />
</g>
</g>
</g>
</svg>
</a>
</div>
<div class="fixed inset-x-0 top-0 z-50 flex h-14 border-b-2 items-center justify-between gap-12 px-4 transition sm:px-6 lg:left-72 lg:z-30 lg:px-8 xl:left-80 backdrop-blur-sm lg:left-72 xl:left-80 bg-white/[var(--bg-opacity-light)] /[var(--bg-opacity-dark)]"
style="--bg-opacity-light:0.5; ">
<div class="absolute inset-x-0 top-full h-px transition bg-zinc-900/7.5 "></div>
<div class="hidden lg:block lg:max-w-md lg:flex-auto">
<!-- <button type="button"
class="hidden h-8 w-full items-center gap-2 rounded-full bg-white pl-2 pr-3 text-sm text-zinc-500 ring-1 ring-zinc-900/10 transition hover:ring-zinc-900/20 lg:flex focus:[&amp;:not(:focus-visible)]:outline-none">
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true" class="h-5 w-5 stroke-current">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12.01 12a4.25 4.25 0 1 0-6.02-6 4.25 4.25 0 0 0 6.02 6Zm0 0 3.24 3.25"></path>
</svg>
Find something...<kbd class="ml-auto text-2xs text-zinc-400 "><kbd
class="font-sans">⌘</kbd><kbd class="font-sans">K</kbd></kbd>
</button> -->
</div>
<div class="flex items-center gap-5 lg:hidden">
<button type="button"
class="flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-zinc-900/5 "
aria-label="Toggle navigation">
<svg viewBox="0 0 10 9" fill="none" stroke-linecap="round" aria-hidden="true"
class="w-2.5 stroke-zinc-900 ">
<path d="M.5 1h9M.5 8h9M.5 4.5h9"></path>
</svg>
</button>
<a aria-label="Home" href="/">
<svg viewBox="0 0 99 24" aria-hidden="true" class="h-6">
<path class="fill-emerald-400"
d="M16 8a5 5 0 0 0-5-5H5a5 5 0 0 0-5 5v13.927a1 1 0 0 0 1.623.782l3.684-2.93a4 4 0 0 1 2.49-.87H11a5 5 0 0 0 5-5V8Z">
</path>
<path class="fill-zinc-900 "
d="M26.538 18h2.654v-3.999h2.576c2.672 0 4.456-1.723 4.456-4.333V9.65c0-2.61-1.784-4.333-4.456-4.333h-5.23V18Zm4.58-10.582c1.52 0 2.416.8 2.416 2.241v.018c0 1.441-.896 2.25-2.417 2.25h-1.925V7.418h1.925ZM38.051 18h2.566v-5.414c0-1.371.923-2.206 2.382-2.206.396 0 .791.061 1.178.15V8.287a3.843 3.843 0 0 0-.958-.123c-1.257 0-2.136.615-2.443 1.661h-.159V8.323h-2.566V18Zm11.55.202c2.979 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.773-5.036-2.953 0-4.772 1.916-4.772 5.036v.018c0 3.146 1.793 5.036 4.772 5.036Zm0-2.013c-1.372 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.144-3.023 1.354 0 2.145 1.134 2.145 3.023v.018c0 1.907-.782 3.023-2.145 3.023Zm10.52 1.846c.492 0 .967-.053 1.283-.114v-1.907a6.057 6.057 0 0 1-.755.044c-.87 0-1.24-.387-1.24-1.257v-4.544h1.995V8.323H59.41V6.012h-2.592v2.311h-1.495v1.934h1.495v5.133c0 1.88.949 2.645 3.304 2.645Zm7.287.167c2.98 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.772-5.036-2.954 0-4.773 1.916-4.773 5.036v.018c0 3.146 1.793 5.036 4.773 5.036Zm0-2.013c-1.372 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.145-3.023 1.353 0 2.144 1.134 2.144 3.023v.018c0 1.907-.782 3.023-2.144 3.023Zm10.767 2.013c2.522 0 4.034-1.353 4.297-3.463l.01-.053h-2.374l-.017.036c-.229.966-.853 1.467-1.908 1.467-1.37 0-2.135-1.08-2.135-3.04v-.018c0-1.934.755-3.006 2.135-3.006 1.099 0 1.74.615 1.908 1.556l.008.017h2.391v-.026c-.228-2.162-1.749-3.56-4.315-3.56-3.033 0-4.738 1.837-4.738 5.019v.017c0 3.217 1.714 5.054 4.738 5.054Zm10.257 0c2.98 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.772-5.036-2.953 0-4.773 1.916-4.773 5.036v.018c0 3.146 1.793 5.036 4.773 5.036Zm0-2.013c-1.371 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.145-3.023 1.353 0 2.144 1.134 2.144 3.023v.018c0 1.907-.782 3.023-2.144 3.023ZM95.025 18h2.566V4.623h-2.566V18Z">
</path>
</svg>
</a>
</div>
<div class="flex items-center gap-5">
<nav class="hidden md:block">
<ul role="list" class="flex items-center gap-8">
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
href="/">Home</a></li>
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
target="_blank"
href="https://join.slack.com/t/oneuptimesupport/shared_invite/zt-2pz5p1uhe-Fpmc7bv5ZE5xRMe7qJnwmA">Chat
with us on Slack</a></li>
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
href="/support">Support</a></li>
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
href="/reference/openapi" type="_blank">OpenAPI Spec</a></li>
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
href="https://github.com/oneuptime/oneuptime">GitHub</a></li>
</ul>
</nav>
<div class="hidden md:block md:h-5 md:w-px md:bg-zinc-900/10 md:"></div>
<div class="flex gap-4">
<div class="contents lg:hidden">
<button type="button"
class="flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-zinc-900/5 lg:hidden focus:[&amp;:not(:focus-visible)]:outline-none"
aria-label="Find something...">
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"
class="h-5 w-5 stroke-zinc-900 ">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12.01 12a4.25 4.25 0 1 0-6.02-6 4.25 4.25 0 0 0 6.02 6Zm0 0 3.24 3.25">
</path>
</svg>
</button>
</div>
<!-- <button type="button"
class="flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-zinc-900/5 "
aria-label="Toggle dark mode">
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"
class="h-5 w-5 stroke-zinc-900 ">
<path d="M12.5 10a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"></path>
<path stroke-linecap="round"
d="M10 5.5v-1M13.182 6.818l.707-.707M14.5 10h1M13.182 13.182l.707.707M10 15.5v-1M6.11 13.889l.708-.707M4.5 10h1M6.11 6.111l.708.707">
</path>
</svg>
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"
class="hidden h-5 w-5 stroke-white ">
<path d="M15.224 11.724a5.5 5.5 0 0 1-6.949-6.949 5.5 5.5 0 1 0 6.949 6.949Z"></path>
</svg>
</button> -->
</div>
<div class="hidden min-[416px]:contents"><a
class="inline-flex gap-0.5 justify-center overflow-hidden text-sm font-medium transition rounded-full bg-zinc-900 py-1 px-3 text-white hover:bg-zinc-700 "
href="/dashboard">Sign in</a></div>
</div>
</div>
<nav class="hidden lg:mt-10 lg:block">
<ul role="list">
<li class="md:hidden"><a
class="block py-1 text-sm text-zinc-600 transition hover:text-zinc-900 "
href="/">API</a></li>
<li class="md:hidden"><a
class="block py-1 text-sm text-zinc-600 transition hover:text-zinc-900 "
href="/#">Documentation</a></li>
<li class="md:hidden"><a
class="block py-1 text-sm text-zinc-600 transition hover:text-zinc-900 "
href="/#">Support</a></li>
<li class="relative mt-6 md:mt-0">
<h6 class="text-sm font-semibold text-zinc-900 ">Guides</h6>
<div class="relative mt-3 pl-2">
<div class="absolute inset-x-0 top-0 bg-zinc-800/2.5 will-change-transform "
data-projection-id="32"
style="height: 64px; top: 0px; border-radius: 8px; opacity: 1; transform: none; transform-origin: 50% 50% 0px;">
</div>
<div class="absolute inset-y-0 left-2 w-px bg-zinc-900/10 "
style="transform: none; transform-origin: 50% 50% 0px;"></div>
<div class="absolute left-2 h-6 w-px bg-emerald-500" data-projection-id="33"
style="top: 4px; opacity: 1;"></div>
<ul role="list" class="border-l border-transparent">
<li class="relative">
<a class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-900 "
href="/reference/introduction" aria-current="page"><span
class="truncate">Introduction</span></a>
</li>
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
href="/reference/authentication"><span class="truncate">Authentication</span></a></li>
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
href="/reference/pagination"><span class="truncate">Pagination</span></a></li>
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
href="/reference/permissions"><span class="truncate">Permissions</span></a></li>
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
href="/reference/data-types"><span class="truncate">Data Types</span></a></li>
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
href="/reference/errors"><span class="truncate">Errors</span></a></li>
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
href="/reference/openapi"><span class="truncate">OpenAPI Spec</span></a></li>
</ul>
</div>
</li>
<li class="relative mt-6">
<h6 class="text-sm font-semibold text-zinc-900 "
style="transform: none; transform-origin: 50% 50% 0px;">Resources</h6>
<div class="relative mt-3 pl-2">
<div class="absolute inset-y-0 left-2 w-px bg-zinc-900/10 "
style="transform: none; transform-origin: 50% 50% 0px;"></div>
<ul role="list" class="border-l border-transparent">
<% for(var i=0; i<resources.length; i++) {%>
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
href="/reference/<%= resources[i].path -%>"><span class="truncate">
<%= resources[i].name -%>
</span></a></li>
<% } %>
</ul>
</div>
</li>
<li class="sticky bottom-0 z-10 mt-6 min-[416px]:hidden"><a
class="inline-flex gap-0.5 justify-center overflow-hidden text-sm font-medium transition rounded-full bg-zinc-900 py-1 px-3 text-white hover:bg-zinc-700 :bg-emerald-400 w-full"
href="/#">Sign in</a></li>
</ul>
</nav>
</div>
</header>

View File

@@ -1 +0,0 @@
*.js text eol=lf

23
Accounts/.gitignore vendored
View File

@@ -1,23 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
node_modules
.idea
# testing
/coverage
# production
/build
/dist
# misc
.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock
Untitled-1
.eslintcache

View File

@@ -1,90 +0,0 @@
#
# Accounts Dockerfile
#
# Pull base image nodejs image.
FROM public.ecr.aws/docker/library/node:23.8-alpine3.21
RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global
RUN npm config set fetch-retries 5
RUN npm config set fetch-retry-mintimeout 100000
RUN npm config set fetch-retry-maxtimeout 600000
ARG GIT_SHA
ARG APP_VERSION
ENV GIT_SHA=${GIT_SHA}
ENV APP_VERSION=${APP_VERSION}
# IF APP_VERSION is not set, set it to 1.0.0
RUN if [ -z "$APP_VERSION" ]; then export APP_VERSION=1.0.0; fi
# Install bash.
RUN apk add bash && apk add curl
#Use bash shell by default
SHELL ["/bin/bash", "-c"]
RUN mkdir /usr/src
WORKDIR /usr/src/Common
COPY ./Common/package*.json /usr/src/Common/
# Set version in ./Common/package.json to the APP_VERSION
RUN sed -i "s/\"version\": \".*\"/\"version\": \"$APP_VERSION\"/g" /usr/src/Common/package.json
RUN npm install
COPY ./Common /usr/src/Common
ENV PRODUCTION=true
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
WORKDIR /usr/src/app
# Install app dependencies
COPY ./Accounts/package*.json /usr/src/app/
RUN npm install
# Expose ports.
# - 3003: accounts
EXPOSE 3003
{{ if eq .Env.ENVIRONMENT "development" }}
#Run the app
CMD [ "npm", "run", "dev" ]
{{ else }}
# Copy app source
COPY ./Accounts /usr/src/app
# Bundle app source
RUN npm run build
# Set permission to write logs and cache in case container run as non root
RUN chown -R 1000:1000 "/tmp/npm" && chmod -R 2777 "/tmp/npm"
#Run the app
CMD [ "npm", "start" ]
{{ end }}

View File

@@ -1,46 +0,0 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies ( Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).

View File

@@ -1,38 +0,0 @@
import { PromiseVoidFunction } from "Common/Types/FunctionTypes";
import Express, { ExpressApplication } from "Common/Server/Utils/Express";
import logger from "Common/Server/Utils/Logger";
import App from "Common/Server/Utils/StartServer";
import "ejs";
export const APP_NAME: string = "accounts";
const app: ExpressApplication = Express.getExpressApp();
const init: PromiseVoidFunction = async (): Promise<void> => {
try {
// init the app
await App.init({
appName: APP_NAME,
port: undefined,
isFrontendApp: true,
statusOptions: {
liveCheck: async () => {},
readyCheck: async () => {},
},
});
// add default routes
await App.addDefaultRoutes();
} catch (err) {
logger.error("App Init Failed:");
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.error("Exiting node process");
process.exit(1);
});
export default app;

View File

@@ -1,12 +0,0 @@
const { createConfig, build, watch } = require('Common/UI/esbuild-config');
const config = createConfig({
serviceName: 'Accounts',
publicPath: '/accounts/dist/',
});
if (process.argv.includes('--watch')) {
watch(config, 'Accounts');
} else {
build(config, 'Accounts');
}

4
Accounts/index.d.ts vendored
View File

@@ -1,4 +0,0 @@
declare module "*.png";
declare module "*.svg";
declare module "*.jpg";
declare module "*.gif";

View File

@@ -1,14 +0,0 @@
{
"watch": ["./","../Common/UI", "../Common/Types", "../Common/Utils", "../Common/Models"],
"ext": "ts,json,tsx,env,js,jsx,hbs",
"ignore": [
"./public/**",
"./public/dist/**",
"./build/*",
"./build/**",
"./build/dist/*",
"./build/dist/**",
"../Common/Server/**"
],
"exec": "npm run dev-build && npm run start"
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,48 +0,0 @@
{
"name": "@oneuptime/accounts",
"version": "0.1.0",
"private": false,
"scripts": {
"dev-build": "NODE_ENV=development node esbuild.config.js",
"dev": "npx nodemon",
"build": "NODE_ENV=production node esbuild.config.js",
"analyze": "analyze=true NODE_ENV=production node esbuild.config.js",
"test": "",
"compile": "tsc",
"clear-modules": "rm -rf node_modules && rm package-lock.json && npm install",
"start": "node --require ts-node/register Serve.ts",
"audit": "npm audit --audit-level=low",
"configure": "npx npm-force-resolutions || echo 'No package-lock.json file. Skipping force resolutions'",
"dep-check": "npm install -g depcheck && depcheck ./ --skip-missing=true"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"dependencies": {
"Common": "file:../Common",
"ejs": "^3.1.10",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.23.1",
"use-async-effect": "^2.2.7"
},
"devDependencies": {
"@types/node": "^16.11.35",
"@types/react": "^18.2.38",
"@types/react-dom": "^18.0.4",
"@types/react-router-dom": "^5.3.3",
"nodemon": "^2.0.20",
"ts-node": "^10.9.1"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,76 +0,0 @@
import React, { ReactElement, lazy, Suspense } from "react";
import {
Route,
Routes,
useLocation,
useNavigate,
useParams,
} from "react-router-dom";
import Navigation from "Common/UI/Utils/Navigation";
import PageLoader from "Common/UI/Components/Loader/PageLoader";
// Lazy load page components
const ForbiddenPage: React.LazyExoticComponent<() => JSX.Element> = lazy(() => {
return import("./Pages/Forbidden");
});
const ForgotPasswordPage: React.LazyExoticComponent<() => JSX.Element> = lazy(
() => {
return import("./Pages/ForgotPassword");
},
);
const LoginPage: React.LazyExoticComponent<() => JSX.Element> = lazy(() => {
return import("./Pages/Login");
});
const LoginWithSSO: React.LazyExoticComponent<() => JSX.Element> = lazy(() => {
return import("./Pages/LoginWithSSO");
});
const NotFound: React.LazyExoticComponent<() => JSX.Element> = lazy(() => {
return import("./Pages/NotFound");
});
const RegisterPage: React.LazyExoticComponent<() => JSX.Element> = lazy(() => {
return import("./Pages/Register");
});
const ResetPasswordPage: React.LazyExoticComponent<() => JSX.Element> = lazy(
() => {
return import("./Pages/ResetPassword");
},
);
const VerifyEmail: React.LazyExoticComponent<() => JSX.Element> = lazy(() => {
return import("./Pages/VerifyEmail");
});
function App(): ReactElement {
Navigation.setNavigateHook(useNavigate());
Navigation.setLocation(useLocation());
Navigation.setParams(useParams());
return (
<div className="m-auto h-screen">
<Suspense fallback={<PageLoader isVisible={true} />}>
<Routes>
<Route path="/accounts" element={<LoginPage />} />
<Route path="/accounts/login" element={<LoginPage />} />
<Route path="/accounts/forbidden" element={<ForbiddenPage />} />
<Route path="/accounts/sso" element={<LoginWithSSO />} />
<Route
path="/accounts/forgot-password"
element={<ForgotPasswordPage />}
/>
<Route
path="/accounts/reset-password/:token"
element={<ResetPasswordPage />}
/>
<Route path="/accounts/register" element={<RegisterPage />} />
<Route
path="/accounts/verify-email/:token"
element={<VerifyEmail />}
/>
{/* 👇️ only match this when no other routes match */}
<Route path="*" element={<NotFound />} />
</Routes>
</Suspense>
</div>
);
}
export default App;

View File

@@ -1,20 +0,0 @@
import React from "react";
import { Link } from "react-router-dom";
const Footer: () => JSX.Element = () => {
return (
<div className="footer">
<p>
<Link to="/">&copy; OneUptime</Link>
</p>
<p>
<Link to="/">Contact</Link>
</p>
<p>
<Link to="/">Privacy &amp; terms</Link>
</p>
</div>
);
};
export default Footer;

View File

@@ -1,19 +0,0 @@
import App from "./App";
import Telemetry from "Common/UI/Utils/Telemetry/Telemetry";
import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
Telemetry.init({
serviceName: "accounts",
});
const root: any = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement,
);
root.render(
<BrowserRouter>
<App />
</BrowserRouter>,
);

View File

@@ -1,18 +0,0 @@
import React from "react";
const ForbiddenPage: () => JSX.Element = () => {
return (
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<h2 className="mt-6 text-center text-2xl tracking-tight text-gray-900">
Forbidden
</h2>
<p className="mt-2 text-center text-sm text-gray-600">
You do not have permission to access this page.
</p>
</div>
</div>
);
};
export default ForbiddenPage;

View File

@@ -1,100 +0,0 @@
import { FORGOT_PASSWORD_API_URL } from "../Utils/ApiPaths";
import Route from "Common/Types/API/Route";
import URL from "Common/Types/API/URL";
import ModelForm, { FormType } from "Common/UI/Components/Forms/ModelForm";
import FormFieldSchemaType from "Common/UI/Components/Forms/Types/FormFieldSchemaType";
import Link from "Common/UI/Components/Link/Link";
import OneUptimeLogo from "Common/UI/Images/logos/OneUptimeSVG/3-transparent.svg";
import User from "Common/Models/DatabaseModels/User";
import React, { useState } from "react";
const ForgotPassword: () => JSX.Element = () => {
const apiUrl: URL = FORGOT_PASSWORD_API_URL;
const [isSuccess, setIsSuccess] = useState<boolean>(false);
return (
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<img
className="mx-auto h-12 w-auto"
src={OneUptimeLogo}
alt="Your Company"
/>
<h2 className="mt-6 text-center text-2xl tracking-tight text-gray-900">
Forgot your password
</h2>
{!isSuccess && (
<p className="mt-2 text-center text-sm text-gray-600">
Please enter your email and the password reset link will be sent to
you.
</p>
)}
{isSuccess && (
<p className="mt-2 text-center text-sm text-gray-600">
We have emailed you the password reset link. Please do not forget to
check spam.
</p>
)}
</div>
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
{!isSuccess && (
<div className="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<ModelForm<User>
modelType={User}
name="Forgot Password"
id="login-form"
createOrUpdateApiUrl={apiUrl}
fields={[
{
field: {
email: true,
},
title: "Email",
fieldType: FormFieldSchemaType.Email,
required: true,
disableSpellCheck: true,
},
]}
onSuccess={() => {
setIsSuccess(true);
}}
submitButtonText={"Send Password Reset Link"}
formType={FormType.Create}
maxPrimaryButtonWidth={true}
footer={
<div className="actions pointer text-center mt-4 hover:underline fw-semibold">
<p>
<Link
to={new Route("/accounts/login")}
className="text-indigo-500 hover:text-indigo-900 cursor-pointer text-sm"
>
Return to Sign in.
</Link>
</p>
</div>
}
/>
</div>
)}
<div className="mt-5 text-center">
<p className="text-muted mb-0 text-gray-500">
Remember your password?{" "}
<Link
to={new Route("/accounts/login")}
className="text-indigo-500 hover:text-indigo-900 cursor-pointer"
>
Login.
</Link>
</p>
</div>
</div>
</div>
);
};
export default ForgotPassword;

View File

@@ -1,295 +0,0 @@
import {
LOGIN_API_URL,
VERIFY_TWO_FACTOR_AUTH_API_URL,
} from "../Utils/ApiPaths";
import Route from "Common/Types/API/Route";
import URL from "Common/Types/API/URL";
import { JSONArray, JSONObject } from "Common/Types/JSON";
import ModelForm, { FormType } from "Common/UI/Components/Forms/ModelForm";
import FormFieldSchemaType from "Common/UI/Components/Forms/Types/FormFieldSchemaType";
import Link from "Common/UI/Components/Link/Link";
import { DASHBOARD_URL } from "Common/UI/Config";
import OneUptimeLogo from "Common/UI/Images/logos/OneUptimeSVG/3-transparent.svg";
import UiAnalytics from "Common/UI/Utils/Analytics";
import LoginUtil from "Common/UI/Utils/Login";
import UserTwoFactorAuth from "Common/Models/DatabaseModels/UserTwoFactorAuth";
import Navigation from "Common/UI/Utils/Navigation";
import UserUtil from "Common/UI/Utils/User";
import User from "Common/Models/DatabaseModels/User";
import React from "react";
import useAsyncEffect from "use-async-effect";
import StaticModelList from "Common/UI/Components/ModelList/StaticModelList";
import BasicForm from "Common/UI/Components/Forms/BasicForm";
import API from "Common/UI/Utils/API/API";
import HTTPErrorResponse from "Common/Types/API/HTTPErrorResponse";
import HTTPResponse from "Common/Types/API/HTTPResponse";
const LoginPage: () => JSX.Element = () => {
const apiUrl: URL = LOGIN_API_URL;
if (UserUtil.isLoggedIn()) {
Navigation.navigate(DASHBOARD_URL);
}
const [initialValues, setInitialValues] = React.useState<JSONObject>({});
const [showTwoFactorAuth, setShowTwoFactorAuth] =
React.useState<boolean>(false);
const [twoFactorAuthList, setTwoFactorAuthList] = React.useState<
UserTwoFactorAuth[]
>([]);
const [selectedTwoFactorAuth, setSelectedTwoFactorAuth] = React.useState<
UserTwoFactorAuth | undefined
>(undefined);
const [isTwoFactorAuthLoading, setIsTwoFactorAuthLoading] =
React.useState<boolean>(false);
const [twofactorAuthError, setTwoFactorAuthError] =
React.useState<string>("");
useAsyncEffect(async () => {
if (Navigation.getQueryStringByName("email")) {
setInitialValues({
email: Navigation.getQueryStringByName("email"),
});
}
}, []);
type LoginFunction = (user: User, miscData: JSONObject) => void;
const login: LoginFunction = (user: User, miscData: JSONObject): void => {
if (user instanceof User && user && user.email) {
UiAnalytics.userAuth(user.email);
UiAnalytics.capture("accounts/login");
}
LoginUtil.login({
user: user,
token: miscData ? miscData["token"] : undefined,
});
};
return (
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="">
<img
className="mx-auto h-12 w-auto"
src={OneUptimeLogo}
alt="OneUptime"
/>
{!showTwoFactorAuth && (
<>
<h2 className="mt-6 text-center text-2xl tracking-tight text-gray-900">
Sign in to your account
</h2>
<p className="mt-2 text-center text-sm text-gray-600">
Join thousands of business that use OneUptime to help them stay
online all the time.
</p>
</>
)}
{showTwoFactorAuth && (
<>
<h2 className="mt-6 text-center text-2xl tracking-tight text-gray-900">
Two Factor Authentication
</h2>
<p className="mt-2 text-center text-sm text-gray-600">
Select two factor authentication method. You will be asked to
enter a code from the selected method.
</p>
</>
)}
</div>
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
{!showTwoFactorAuth && (
<ModelForm<User>
modelType={User}
id="login-form"
name="Login"
fields={[
{
field: {
email: true,
},
fieldType: FormFieldSchemaType.Email,
placeholder: "jeff@example.com",
required: true,
disabled: Boolean(initialValues && initialValues["email"]),
title: "Email",
dataTestId: "email",
disableSpellCheck: true,
},
{
field: {
password: true,
},
title: "Password",
required: true,
validation: {
minLength: 6,
},
fieldType: FormFieldSchemaType.Password,
sideLink: {
text: "Forgot password?",
url: new Route("/accounts/forgot-password"),
openLinkInNewTab: false,
},
dataTestId: "password",
disableSpellCheck: true,
},
]}
createOrUpdateApiUrl={apiUrl}
formType={FormType.Create}
submitButtonText={"Login"}
onBeforeCreate={(data: User) => {
setInitialValues(User.toJSON(data, User));
return Promise.resolve(data);
}}
onSuccess={(
value: User | JSONObject,
miscData: JSONObject | undefined,
) => {
if (
miscData &&
(miscData as JSONObject)["twoFactorAuth"] === true
) {
const twoFactorAuthList: Array<UserTwoFactorAuth> =
UserTwoFactorAuth.fromJSONArray(
(miscData as JSONObject)[
"twoFactorAuthList"
] as JSONArray,
UserTwoFactorAuth,
);
setTwoFactorAuthList(twoFactorAuthList);
setShowTwoFactorAuth(true);
return;
}
login(value as User, miscData as JSONObject);
}}
maxPrimaryButtonWidth={true}
footer={
<div className="actions text-center mt-4 hover:underline fw-semibold">
<div>
<Link to={new Route("/accounts/sso")}>
<div className="text-indigo-500 hover:text-indigo-900 cursor-pointer text-sm">
Use single sign-on (SSO) instead
</div>
</Link>
</div>
</div>
}
/>
)}
{showTwoFactorAuth && !selectedTwoFactorAuth && (
<StaticModelList<UserTwoFactorAuth>
titleField="name"
descriptionField=""
selectedItems={[]}
list={twoFactorAuthList}
onClick={(item: UserTwoFactorAuth) => {
setSelectedTwoFactorAuth(item);
}}
/>
)}
{showTwoFactorAuth && selectedTwoFactorAuth && (
<BasicForm
id="two-factor-auth-form"
name="Two Factor Auth"
fields={[
{
field: {
code: true,
},
title: "Code",
description: "Enter the code from your authenticator app",
required: true,
dataTestId: "code",
fieldType: FormFieldSchemaType.Text,
},
]}
submitButtonText={"Login"}
maxPrimaryButtonWidth={true}
isLoading={isTwoFactorAuthLoading}
error={twofactorAuthError}
onSubmit={async (data: JSONObject) => {
setIsTwoFactorAuthLoading(true);
try {
const code: string = data["code"] as string;
const twoFactorAuthId: string =
selectedTwoFactorAuth.id?.toString() as string;
const result: HTTPErrorResponse | HTTPResponse<JSONObject> =
await API.post(VERIFY_TWO_FACTOR_AUTH_API_URL, {
data: {
...initialValues,
code: code,
twoFactorAuthId: twoFactorAuthId,
},
});
if (result instanceof HTTPErrorResponse) {
throw result;
}
const user: User = User.fromJSON(
result["data"] as JSONObject,
User,
) as User;
const miscData: JSONObject = (result["data"] as JSONObject)[
"miscData"
] as JSONObject;
login(user as User, miscData as JSONObject);
} catch (error) {
setTwoFactorAuthError(
API.getFriendlyErrorMessage(error as Error),
);
}
setIsTwoFactorAuthLoading(false);
}}
/>
)}
</div>
<div className="mt-10 text-center">
{!selectedTwoFactorAuth && (
<div className="text-muted mb-0 text-gray-500">
Don&apos;t have an account?{" "}
<Link
to={new Route("/accounts/register")}
className="text-indigo-500 hover:text-indigo-900 cursor-pointer"
>
Register.
</Link>
</div>
)}
{selectedTwoFactorAuth ? (
<div className="text-muted mb-0 text-gray-500">
<Link
onClick={() => {
setSelectedTwoFactorAuth(undefined);
}}
className="text-indigo-500 hover:text-indigo-900 cursor-pointer"
>
Select a different two factor authentication method
</Link>
</div>
) : (
<></>
)}
</div>
</div>
</div>
);
};
export default LoginPage;

View File

@@ -1,236 +0,0 @@
import { SERVICE_PROVIDER_LOGIN_URL } from "../Utils/ApiPaths";
import Route from "Common/Types/API/Route";
import URL from "Common/Types/API/URL";
import { JSONArray, JSONObject } from "Common/Types/JSON";
import FormFieldSchemaType from "Common/UI/Components/Forms/Types/FormFieldSchemaType";
import Link from "Common/UI/Components/Link/Link";
import { DASHBOARD_URL, IDENTITY_URL } from "Common/UI/Config";
import OneUptimeLogo from "Common/UI/Images/logos/OneUptimeSVG/3-transparent.svg";
import Navigation from "Common/UI/Utils/Navigation";
import UserUtil from "Common/UI/Utils/User";
import User from "Common/Models/DatabaseModels/User";
import React, { ReactElement, useState } from "react";
import ProjectSSO from "Common/Models/DatabaseModels/ProjectSso";
import PageLoader from "Common/UI/Components/Loader/PageLoader";
import API from "Common/UI/Utils/API/API";
import BasicForm from "Common/UI/Components/Forms/BasicForm";
import Email from "Common/Types/Email";
import HTTPErrorResponse from "Common/Types/API/HTTPErrorResponse";
import HTTPResponse from "Common/Types/API/HTTPResponse";
import StaticModelList from "Common/UI/Components/ModelList/StaticModelList";
const LoginPage: () => JSX.Element = () => {
const apiUrl: URL = SERVICE_PROVIDER_LOGIN_URL;
if (UserUtil.isLoggedIn()) {
Navigation.navigate(DASHBOARD_URL);
}
const [error, setError] = useState<string | undefined>(undefined);
const [isLoading, setIsLoading] = useState<boolean>(false);
const [projectSsoConfigList, setProjectSsoConfigList] = useState<
Array<ProjectSSO>
>([]);
type FetchSSOConfigsFunction = (email: Email) => Promise<void>;
const fetchSsoConfigs: FetchSSOConfigsFunction = async (
email: Email,
): Promise<void> => {
if (email) {
setIsLoading(true);
try {
// get sso config by email.
const listResult: HTTPErrorResponse | HTTPResponse<JSONArray> =
await API.get(
URL.fromString(apiUrl.toString()).addQueryParam(
"email",
email.toString(),
),
);
if (listResult instanceof HTTPErrorResponse) {
throw listResult;
}
if (!listResult.data || (listResult.data as JSONArray).length === 0) {
setError(
"No SSO configuration found for the email: " + email.toString(),
);
} else {
setProjectSsoConfigList(
ProjectSSO.fromJSONArray(listResult["data"], ProjectSSO),
);
}
} catch (error) {
setError(API.getFriendlyErrorMessage(error as Error));
}
} else {
setError("Email is required to perform this action");
}
setIsLoading(false);
};
type GetSsoConfigModelListFunction = (
configs: Array<ProjectSSO>,
) => ReactElement;
const getSsoConfigModelList: GetSsoConfigModelListFunction = (
configs: Array<ProjectSSO>,
): ReactElement => {
return (
<StaticModelList<ProjectSSO>
list={configs}
titleField="name"
selectedItems={[]}
descriptionField="description"
onClick={(item: ProjectSSO) => {
setIsLoading(true);
Navigation.navigate(
URL.fromURL(IDENTITY_URL).addRoute(
new Route(
`/sso/${item.projectId?.toString()}/${item.id?.toString()}`,
),
),
);
}}
/>
);
};
if (isLoading) {
return <PageLoader isVisible={true} />;
}
type GetProjectNameFunction = (projectId: string) => string;
const getProjectName: GetProjectNameFunction = (
projectId: string,
): string => {
const projectNames: Array<string | undefined> = projectSsoConfigList
.filter((config: ProjectSSO) => {
return config.projectId?.toString() === projectId.toString();
})
.map((config: ProjectSSO) => {
return config.project?.name;
});
return projectNames[0] || "Project";
};
if (projectSsoConfigList.length > 0 && !error && !isLoading) {
const projectIds: Array<string> = projectSsoConfigList.map(
(config: ProjectSSO) => {
return config.projectId?.toString() as string;
},
);
return (
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="">
<img
className="mx-auto h-12 w-auto"
src={OneUptimeLogo}
alt="OneUptime"
/>
<h2 className="mt-10 text-center text-xl tracking-tight text-gray-900">
Select Project
</h2>
<p className="mt-2 text-center text-sm text-gray-600">
Select the project you want to login to.
</p>
</div>
{projectIds.map((projectId: string) => {
return (
<div key={projectId}>
<h3 className="mt-6 font-medium tracking-tight">
{getProjectName(projectId)}
</h3>
{getSsoConfigModelList(
projectSsoConfigList.filter((config: ProjectSSO) => {
return (
config.projectId?.toString() === projectId.toString()
);
}),
)}
</div>
);
})}
</div>
</div>
);
}
return (
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="">
<img
className="mx-auto h-12 w-auto"
src={OneUptimeLogo}
alt="OneUptime"
/>
<h2 className="mt-6 text-center text-2xl tracking-tight text-gray-900">
Login with SSO
</h2>
<p className="mt-2 text-center text-sm text-gray-600">
Login with your SSO provider to access your account.
</p>
</div>
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<BasicForm
modelType={User}
id="login-form"
error={error}
name="Login"
fields={[
{
field: {
email: true,
},
fieldType: FormFieldSchemaType.Email,
placeholder: "jeff@example.com",
required: true,
title: "Email",
dataTestId: "email",
disableSpellCheck: true,
},
]}
maxPrimaryButtonWidth={true}
submitButtonText="Login with SSO"
onSubmit={async (data: JSONObject) => {
await fetchSsoConfigs(data["email"] as Email);
}}
footer={
<div className="actions text-center mt-4 hover:underline fw-semibold">
<div>
<Link to={new Route("/accounts/login")}>
<div className="text-indigo-500 hover:text-indigo-900 cursor-pointer text-sm">
Use username and password instead.
</div>
</Link>
</div>
</div>
}
/>
</div>
<div className="mt-10 text-center">
<div className="text-muted mb-0 text-gray-500">
Don&apos;t have an account?{" "}
<Link
to={new Route("/accounts/register")}
className="text-indigo-500 hover:text-indigo-900 cursor-pointer"
>
Register.
</Link>
</div>
</div>
</div>
</div>
);
};
export default LoginPage;

View File

@@ -1,18 +0,0 @@
import React from "react";
const LoginPage: () => JSX.Element = () => {
return (
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<h2 className="mt-6 text-center text-2xl tracking-tight text-gray-900">
Page not found
</h2>
<p className="mt-2 text-center text-sm text-gray-600">
Page you are looking for does not exist.
</p>
</div>
</div>
);
};
export default LoginPage;

View File

@@ -1,272 +0,0 @@
import { SIGNUP_API_URL } from "../Utils/ApiPaths";
import Route from "Common/Types/API/Route";
import URL from "Common/Types/API/URL";
import Dictionary from "Common/Types/Dictionary";
import { JSONObject } from "Common/Types/JSON";
import ErrorMessage from "Common/UI/Components/ErrorMessage/ErrorMessage";
import ModelForm, { FormType } from "Common/UI/Components/Forms/ModelForm";
import Fields from "Common/UI/Components/Forms/Types/Fields";
import FormFieldSchemaType from "Common/UI/Components/Forms/Types/FormFieldSchemaType";
import Link from "Common/UI/Components/Link/Link";
import PageLoader from "Common/UI/Components/Loader/PageLoader";
import { BILLING_ENABLED, DASHBOARD_URL } from "Common/UI/Config";
import OneUptimeLogo from "Common/UI/Images/logos/OneUptimeSVG/3-transparent.svg";
import BaseAPI from "Common/UI/Utils/API/API";
import UiAnalytics from "Common/UI/Utils/Analytics";
import LocalStorage from "Common/UI/Utils/LocalStorage";
import LoginUtil from "Common/UI/Utils/Login";
import ModelAPI, { ListResult } from "Common/UI/Utils/ModelAPI/ModelAPI";
import Navigation from "Common/UI/Utils/Navigation";
import UserUtil from "Common/UI/Utils/User";
import Reseller from "Common/Models/DatabaseModels/Reseller";
import User from "Common/Models/DatabaseModels/User";
import React, { useState } from "react";
import useAsyncEffect from "use-async-effect";
const RegisterPage: () => JSX.Element = () => {
const apiUrl: URL = SIGNUP_API_URL;
const [initialValues, setInitialValues] = React.useState<JSONObject>({});
const [error, setError] = useState<string>("");
const [isLoading, setIsLoading] = React.useState<boolean>(false);
const [reseller, setResller] = React.useState<Reseller | undefined>(
undefined,
);
if (UserUtil.isLoggedIn()) {
Navigation.navigate(DASHBOARD_URL);
}
type FetchResellerFunction = (resellerId: string) => Promise<void>;
const fetchReseller: FetchResellerFunction = async (
resellerId: string,
): Promise<void> => {
setIsLoading(true);
try {
const reseller: ListResult<Reseller> = await ModelAPI.getList<Reseller>({
modelType: Reseller,
query: {
resellerId: resellerId,
},
limit: 1,
skip: 0,
select: {
hidePhoneNumberOnSignup: true,
},
sort: {},
requestOptions: {},
});
if (reseller.data.length > 0) {
setResller(reseller.data[0]);
}
} catch (err) {
setError(BaseAPI.getFriendlyMessage(err));
}
setIsLoading(false);
};
useAsyncEffect(async () => {
// if promo code is found, please save it in localstorage.
if (Navigation.getQueryStringByName("promoCode")) {
LocalStorage.setItem(
"promoCode",
Navigation.getQueryStringByName("promoCode"),
);
}
if (Navigation.getQueryStringByName("email")) {
setInitialValues({
email: Navigation.getQueryStringByName("email"),
});
}
// if promo code is found, please save it in localstorage.
if (Navigation.getQueryStringByName("partnerId")) {
await fetchReseller(Navigation.getQueryStringByName("partnerId")!);
}
}, []);
let formFields: Fields<User> = [
{
field: {
email: true,
},
fieldType: FormFieldSchemaType.Email,
placeholder: "jeff@example.com",
required: true,
disabled: Boolean(initialValues && initialValues["email"]),
title: "Email",
dataTestId: "email",
disableSpellCheck: true,
},
{
field: {
name: true,
},
fieldType: FormFieldSchemaType.Text,
placeholder: "Jeff Smith",
required: true,
title: "Full Name",
dataTestId: "name",
disableSpellCheck: true,
},
];
if (BILLING_ENABLED) {
formFields = formFields.concat([
{
field: {
companyName: true,
},
fieldType: FormFieldSchemaType.Text,
placeholder: "Acme, Inc.",
required: true,
title: "Company Name",
dataTestId: "companyName",
disableSpellCheck: true,
},
]);
// If reseller wants to hide phone number on sign up, we hide it.
if (!reseller || !reseller.hidePhoneNumberOnSignup) {
formFields.push({
field: {
companyPhoneNumber: true,
},
fieldType: FormFieldSchemaType.Phone,
required: true,
placeholder: "+11234567890",
title: "Phone Number",
dataTestId: "companyPhoneNumber",
});
}
}
formFields = formFields.concat([
{
field: {
password: true,
},
fieldType: FormFieldSchemaType.Password,
validation: {
minLength: 6,
},
placeholder: "Password",
title: "Password",
required: true,
dataTestId: "password",
disableSpellCheck: true,
},
{
field: {
confirmPassword: true,
} as any,
validation: {
minLength: 6,
toMatchField: "password",
},
fieldType: FormFieldSchemaType.Password,
placeholder: "Confirm Password",
title: "Confirm Password",
overrideFieldKey: "confirmPassword",
required: true,
showEvenIfPermissionDoesNotExist: true,
dataTestId: "confirmPassword",
disableSpellCheck: true,
},
]);
if (error) {
return <ErrorMessage message={error} />;
}
if (isLoading) {
return <PageLoader isVisible={true} />;
}
return (
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<img
className="mx-auto h-12 w-auto"
src={OneUptimeLogo}
alt="OneUptime"
/>
<h2 className="mt-6 text-center text-2xl tracking-tight text-gray-900">
Create your OneUptime account
</h2>
<p className="mt-2 text-center text-sm text-gray-600">
Join thousands of business that use OneUptime to help them stay online
all the time.
</p>
<p className="mt-2 text-center text-sm text-gray-600">
No credit card required.
</p>
</div>
<div className="mt-8 lg:mx-auto lg:w-full lg:max-w-2xl">
<div className="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<ModelForm<User>
modelType={User}
id="register-form"
showAsColumns={reseller ? 1 : 2}
name="Register"
initialValues={initialValues}
maxPrimaryButtonWidth={true}
fields={formFields}
createOrUpdateApiUrl={apiUrl}
onBeforeCreate={(item: User): Promise<User> => {
const utmParams: Dictionary<string> = UserUtil.getUtmParams();
if (utmParams && Object.keys(utmParams).length > 0) {
item.utmSource = utmParams["utmSource"] || "";
item.utmMedium = utmParams["utmMedium"] || "";
item.utmCampaign = utmParams["utmCampaign"] || "";
item.utmTerm = utmParams["utmTerm"] || "";
item.utmContent = utmParams["utmContent"] || "";
item.utmUrl = utmParams["utmUrl"] || "";
UiAnalytics.capture("utm_event", utmParams);
}
return Promise.resolve(item);
}}
formType={FormType.Create}
submitButtonText={"Sign Up"}
onSuccess={(value: User, miscData: JSONObject | undefined) => {
if (value && value.email) {
UiAnalytics.userAuth(value.email);
UiAnalytics.capture("accounts/register");
}
LoginUtil.login({
user: value,
token: miscData ? miscData["token"] : undefined,
});
}}
/>
</div>
<div className="mt-5 text-center text-gray-500">
<p className="text-muted mb-0">
Already have an account?{" "}
<Link
to={new Route("/accounts/login")}
className="text-indigo-500 hover:text-indigo-900 cursor-pointer"
>
Log in.
</Link>
</p>
</div>
</div>
</div>
);
};
export default RegisterPage;

View File

@@ -1,116 +0,0 @@
import { RESET_PASSWORD_API_URL } from "../Utils/ApiPaths";
import Route from "Common/Types/API/Route";
import URL from "Common/Types/API/URL";
import ModelForm, { FormType } from "Common/UI/Components/Forms/ModelForm";
import FormFieldSchemaType from "Common/UI/Components/Forms/Types/FormFieldSchemaType";
import Link from "Common/UI/Components/Link/Link";
import OneUptimeLogo from "Common/UI/Images/logos/OneUptimeSVG/3-transparent.svg";
import Navigation from "Common/UI/Utils/Navigation";
import User from "Common/Models/DatabaseModels/User";
import React, { useState } from "react";
const RegisterPage: () => JSX.Element = () => {
const apiUrl: URL = RESET_PASSWORD_API_URL;
const [isSuccess, setIsSuccess] = useState<boolean>(false);
return (
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<img
className="mx-auto h-12 w-auto"
src={OneUptimeLogo}
alt="Your Company"
/>
<h2 className="mt-6 text-center text-2xl tracking-tight text-gray-900">
Reset your password
</h2>
{!isSuccess && (
<p className="mt-2 text-center text-sm text-gray-600">
Please enter your new password and we will have it updated.{" "}
</p>
)}
{isSuccess && (
<p className="mt-2 text-center text-sm text-gray-600">
Your password has been updated. Please log in.
</p>
)}
</div>
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
{!isSuccess && (
<div className="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<ModelForm<User>
modelType={User}
id="register-form"
name="Reset Password"
onBeforeCreate={(item: User): Promise<User> => {
item.resetPasswordToken =
Navigation.getLastParam()
?.toString()
.replace("/", "")
.toString() || "";
return Promise.resolve(item);
}}
showAsColumns={1}
maxPrimaryButtonWidth={true}
fields={[
{
field: {
password: true,
},
fieldType: FormFieldSchemaType.Password,
validation: {
minLength: 6,
},
placeholder: "New Password",
title: "New Password",
required: true,
showEvenIfPermissionDoesNotExist: true,
disableSpellCheck: true,
},
{
field: {
confirmPassword: true,
} as any,
validation: {
minLength: 6,
toMatchField: "password",
},
fieldType: FormFieldSchemaType.Password,
placeholder: "Confirm Password",
title: "Confirm Password",
overrideFieldKey: "confirmPassword",
required: true,
showEvenIfPermissionDoesNotExist: true,
disableSpellCheck: true,
},
]}
createOrUpdateApiUrl={apiUrl}
formType={FormType.Create}
submitButtonText={"Reset Password"}
onSuccess={() => {
setIsSuccess(true);
}}
/>
</div>
)}
<div className="mt-5 text-center">
<p className="text-muted mb-0 text-gray-500">
Know your password?{" "}
<Link
to={new Route("/accounts/login")}
className="text-indigo-500 hover:text-indigo-900 cursor-pointer"
>
Log in.
</Link>
</p>
</div>
</div>
</div>
);
};
export default RegisterPage;

View File

@@ -1,121 +0,0 @@
import { VERIFY_EMAIL_API_URL } from "../Utils/ApiPaths";
import Route from "Common/Types/API/Route";
import URL from "Common/Types/API/URL";
import { PromiseVoidFunction } from "Common/Types/FunctionTypes";
import ObjectID from "Common/Types/ObjectID";
import { FormType } from "Common/UI/Components/Forms/ModelForm";
import Link from "Common/UI/Components/Link/Link";
import PageLoader from "Common/UI/Components/Loader/PageLoader";
import OneUptimeLogo from "Common/UI/Images/logos/OneUptimeSVG/3-transparent.svg";
import API from "Common/UI/Utils/API/API";
import ModelAPI from "Common/UI/Utils/ModelAPI/ModelAPI";
import Navigation from "Common/UI/Utils/Navigation";
import EmailVerificationToken from "Common/Models/DatabaseModels/EmailVerificationToken";
import React, { useEffect, useState } from "react";
const VerifyEmail: () => JSX.Element = () => {
const apiUrl: URL = VERIFY_EMAIL_API_URL;
const [error, setError] = useState<string>("");
const [isLoading, setIsLoading] = useState<boolean>(true);
const init: PromiseVoidFunction = async (): Promise<void> => {
// Ping an API here.
setError("");
setIsLoading(true);
try {
// strip data.
const emailverificationToken: EmailVerificationToken =
new EmailVerificationToken();
emailverificationToken.token = new ObjectID(
Navigation.getLastParam()?.toString().replace("/", "") || "",
);
await ModelAPI.createOrUpdate<EmailVerificationToken>({
model: emailverificationToken,
modelType: EmailVerificationToken,
formType: FormType.Create,
miscDataProps: {},
requestOptions: {
overrideRequestUrl: apiUrl,
},
});
} catch (err) {
setError(API.getFriendlyMessage(err));
}
setIsLoading(false);
};
useEffect(() => {
init().catch((err: Error) => {
setError(err.toString());
});
}, []);
if (isLoading) {
return <PageLoader isVisible={true} />;
}
return (
<div className="auth-page">
<div className="container-fluid p-0">
<div className="row g-0">
<div className="col-xxl-4 col-lg-4 col-md-3"></div>
<div className="col-xxl-4 col-lg-4 col-md-6">
<div className="auth-full-page-content d-flex p-sm-5 p-4">
<div className="w-100">
<div className="d-flex flex-column h-100">
<div className="auth-content my-auto">
<div
className="mt-4 text-center flex justify-center"
style={{ marginBottom: "40px" }}
>
<img
style={{ height: "50px" }}
src={`${OneUptimeLogo}`}
/>
</div>
{!error && (
<div className="text-center">
<h5 className="mb-0">Your email is verified.</h5>
<p className="text-muted mt-2 mb-0">
Thank you for verifying your email. You can now log in
to OneUptime.{" "}
</p>
</div>
)}
{error && (
<div className="text-center">
<h5 className="mb-0">Sorry, something went wrong!</h5>
<p className="text-muted mt-2 mb-0">{error}</p>
</div>
)}
<div className="mt-5 text-center">
<p className="text-muted mb-0">
Return to sign in?{" "}
<Link
to={new Route("/accounts/login")}
className="hover:underline text-primary fw-semibold"
>
Login.
</Link>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div className="col-xxl-4 col-lg-4 col-md-3"></div>
</div>
</div>
</div>
);
};
export default VerifyEmail;

View File

@@ -1,30 +0,0 @@
import Route from "Common/Types/API/Route";
import URL from "Common/Types/API/URL";
import { IDENTITY_URL } from "Common/UI/Config";
export const SIGNUP_API_URL: URL = URL.fromURL(IDENTITY_URL).addRoute(
new Route("/signup"),
);
export const LOGIN_API_URL: URL = URL.fromURL(IDENTITY_URL).addRoute(
new Route("/login"),
);
export const VERIFY_TWO_FACTOR_AUTH_API_URL: URL = URL.fromURL(
IDENTITY_URL,
).addRoute(new Route("/verify-two-factor-auth"));
export const SERVICE_PROVIDER_LOGIN_URL: URL = URL.fromURL(
IDENTITY_URL,
).addRoute(new Route("/service-provider-login"));
export const FORGOT_PASSWORD_API_URL: URL = URL.fromURL(IDENTITY_URL).addRoute(
new Route("/forgot-password"),
);
export const VERIFY_EMAIL_API_URL: URL = URL.fromURL(IDENTITY_URL).addRoute(
new Route("/verify-email"),
);
export const RESET_PASSWORD_API_URL: URL = URL.fromURL(IDENTITY_URL).addRoute(
new Route("/reset-password"),
);

View File

@@ -1,112 +0,0 @@
{
"ts-node": {
// these options are overrides used only by ts-node
// same as the --compilerOptions flag and the TS_NODE_COMPILER_OPTIONS environment variable
"compilerOptions": {
"module": "commonjs",
"resolveJsonModule": true,
}
},
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "es2017" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
"jsx": "react" /* Specify what JSX code is generated. */,
"experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
"emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
/* Modules */
"module": "es2022" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
"typeRoots": [
"./node_modules/@types"
], /* Specify multiple folders that act like `./node_modules/@types`. */
"types": ["node"], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "resolveJsonModule": true, /* Enable importing .json files */
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
"outDir": "./build/dist", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
"noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
"strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
"strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
"strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
"strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
"noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
"useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
"alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
"noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
"exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
"noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
"noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
"noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"resolveJsonModule": true
}
}

View File

@@ -1,123 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charSet='utf-8' />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<meta name="slack-app-id" content="ACVBMTPJQ">
<meta name="description" content="OneUptime — the complete open-source observability platform.">
<% if(typeof enableGoogleTagManager !== 'undefined' ? enableGoogleTagManager : false){ %>
<!-- Google Tag Manager -->
<script>(function (w, d, s, l, i) {
w[l] = w[l] || []; w[l].push({
'gtm.start':
new Date().getTime(), event: 'gtm.js'
}); var f = d.getElementsByTagName(s)[0],
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-PKQD5WH');</script>
<!-- End Google Tag Manager -->
<% } %>
<link rel="manifest" href="/accounts/assets/img/favicons/ma">
<link rel="apple-touch-icon" sizes="180x180" href="/accounts/assets/img/favicons/apple-touch-icon.png">
<link rel="shortcut icon" href="/accounts/assets/img/favicons/favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="/accounts/assets/img/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="194x194" href="/accounts/assets/img/favicons/favicon-194x194.png">
<link rel="icon" type="image/png" sizes="192x192" href="/accounts/assets/img/favicons/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/accounts/assets/img/favicons/favicon-16x16.png">
<link rel="mask-icon" href="/accounts/assets/img/favicons/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#121212">
<meta name="msapplication-TileImage" content="/accounts/assets/img/favicons/mstile-144x144.png">
<meta name="theme-color" content="#121212">
<script src="/accounts/env.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<style>
* {
font-family: Inter;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
background: transparent;
bottom: 0;
color: transparent;
cursor: pointer;
height: auto;
left: 0;
position: absolute;
right: 0;
top: 0;
width: auto;
}
input[type="date"]::-webkit-calendar-picker-indicator {
background: transparent;
bottom: 0;
color: transparent;
cursor: pointer;
height: auto;
left: 0;
position: absolute;
right: 0;
top: 0;
width: auto;
}
</style>
<script src="/accounts/assets/js/tailwind-3.4.5.js"></script>
<title>OneUptime Accounts</title>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>OneUptime | Account</title>
</head>
<body class="h-full bg-gray-50">
<% if(typeof enableGoogleTagManager !== 'undefined' ? enableGoogleTagManager : false){ %>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PKQD5WH" height="0" width="0"
style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<% } %>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/accounts/dist/Index.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#000000'
}
}
}
}
</script>
</body>
</html>

View File

@@ -3,14 +3,10 @@
#
# Pull base image nodejs image.
FROM public.ecr.aws/docker/library/node:23.8-alpine3.21
FROM node:21.6-alpine3.18
USER root
RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global
RUN npm config set fetch-retries 5
RUN npm config set fetch-retry-mintimeout 100000
RUN npm config set fetch-retry-maxtimeout 600000
ARG GIT_SHA
ARG APP_VERSION
@@ -19,10 +15,6 @@ ENV GIT_SHA=${GIT_SHA}
ENV APP_VERSION=${APP_VERSION}
# IF APP_VERSION is not set, set it to 1.0.0
RUN if [ -z "$APP_VERSION" ]; then export APP_VERSION=1.0.0; fi
# Install bash.
RUN apk add bash && apk add curl
@@ -34,23 +26,31 @@ RUN mkdir /usr/src
WORKDIR /usr/src/Common
COPY ./Common/package*.json /usr/src/Common/
# Set version in ./Common/package.json to the APP_VERSION
RUN sed -i "s/\"version\": \".*\"/\"version\": \"$APP_VERSION\"/g" /usr/src/Common/package.json
RUN npm install
COPY ./Common /usr/src/Common
WORKDIR /usr/src/Model
COPY ./Model/package*.json /usr/src/Model/
RUN npm install
COPY ./Model /usr/src/Model
WORKDIR /usr/src/CommonServer
COPY ./CommonServer/package*.json /usr/src/CommonServer/
RUN npm install
COPY ./CommonServer /usr/src/CommonServer
# Install CommonUI
WORKDIR /usr/src/CommonUI
COPY ./CommonUI/package*.json /usr/src/CommonUI/
RUN npm install --force
COPY ./CommonUI /usr/src/CommonUI
@@ -67,20 +67,19 @@ RUN npm install
# - 3158: AdminDashboard
EXPOSE 3158
RUN npm i -D webpack-cli
{{ if eq .Env.ENVIRONMENT "development" }}
#Run the app
RUN mkdir /usr/src/app/dev-env
RUN touch /usr/src/app/dev-env/.env
RUN npm i -D webpack-dev-server
CMD [ "npm", "run", "dev" ]
{{ else }}
# Copy app source
COPY ./AdminDashboard /usr/src/app
# Bundle app source
RUN npm run build
# Set permission to write logs and cache in case container run as non root
RUN chown -R 1000:1000 "/tmp/npm" && chmod -R 2777 "/tmp/npm"
#Run the app
CMD [ "npm", "start" ]
{{ end }}

View File

@@ -35,7 +35,7 @@ See the section about [deployment](https://facebook.github.io/create-react-app/d
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies ( Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.

View File

@@ -1,39 +1,26 @@
import { PromiseVoidFunction } from "Common/Types/FunctionTypes";
import Express, { ExpressApplication } from "Common/Server/Utils/Express";
import logger from "Common/Server/Utils/Logger";
import App from "Common/Server/Utils/StartServer";
import "ejs";
import App from 'CommonServer/Utils/StartServer';
import Express, { ExpressApplication } from 'CommonServer/Utils/Express';
import logger from 'CommonServer/Utils/Logger';
export const APP_NAME: string = "admin";
export const APP_NAME: string = 'admin';
const app: ExpressApplication = Express.getExpressApp();
const init: PromiseVoidFunction = async (): Promise<void> => {
try {
// init the app
await App.init({
appName: APP_NAME,
port: undefined,
isFrontendApp: true,
statusOptions: {
liveCheck: async () => {},
readyCheck: async () => {},
},
});
// add default routes
await App.addDefaultRoutes();
} catch (err) {
logger.error("App Init Failed:");
logger.error(err);
throw err;
}
const init: () => Promise<void> = async (): Promise<void> => {
try {
// init the app
await App(APP_NAME, undefined, true);
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.error("Exiting node process");
process.exit(1);
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});
export default app;

Some files were not shown because too many files have changed in this diff Show More