Showing preview only (2,448K chars total). Download the full file or copy to clipboard to get everything.
Repository: getmaxun/maxun
Branch: develop
Commit: c7bf0e97a94e
Files: 226
Total size: 2.3 MB
Directory structure:
gitextract_d__9ladc/
├── .dockerignore
├── .github/
│ ├── CODE_OF_CONDUCT.md
│ ├── COMMIT_CONVENTION.md
│ └── ISSUE_TEMPLATE/
│ └── bug_report.yml
├── .gitignore
├── .sequelizerc
├── CONTRIBUTING.md
├── Dockerfile.backend
├── Dockerfile.frontend
├── ENVEXAMPLE
├── LICENSE
├── README.md
├── SETUP.md
├── browser/
│ ├── .dockerignore
│ ├── Dockerfile
│ ├── package.json
│ ├── server.ts
│ └── tsconfig.json
├── docker-compose.yml
├── docker-entrypoint.sh
├── docs/
│ ├── nginx.conf
│ └── self-hosting-docker.md
├── index.html
├── legacy/
│ ├── server/
│ │ └── worker.ts
│ └── src/
│ ├── AddWhatCondModal.tsx
│ ├── AddWhereCondModal.tsx
│ ├── Canvas.tsx
│ ├── DisplayWhereConditionSettings.tsx
│ ├── Highlighter.tsx
│ ├── LeftSidePanel.tsx
│ ├── LeftSidePanelContent.tsx
│ ├── LeftSidePanelSettings.tsx
│ ├── Pair.tsx
│ ├── PairDetail.tsx
│ ├── PairDisplayDiv.tsx
│ ├── PairEditForm.tsx
│ ├── Renderer.tsx
│ ├── RobotEdit.tsx
│ ├── RobotSettings.tsx
│ ├── ScheduleSettings.tsx
│ ├── coordinateMapper.ts
│ └── inputHelpers.ts
├── maxun-core/
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── src/
│ │ ├── browserSide/
│ │ │ └── scraper.js
│ │ ├── index.ts
│ │ ├── interpret.ts
│ │ ├── preprocessor.ts
│ │ ├── types/
│ │ │ ├── logic.ts
│ │ │ └── workflow.ts
│ │ └── utils/
│ │ ├── concurrency.ts
│ │ ├── logger.ts
│ │ └── utils.ts
│ └── tsconfig.json
├── nginx.conf
├── package.json
├── public/
│ └── locales/
│ ├── de.json
│ ├── en.json
│ ├── es.json
│ ├── ja.json
│ ├── tr.json
│ └── zh.json
├── server/
│ ├── .gitignore
│ ├── config/
│ │ └── config.json
│ ├── docker-entrypoint.sh
│ ├── src/
│ │ ├── api/
│ │ │ ├── record.ts
│ │ │ └── sdk.ts
│ │ ├── browser-management/
│ │ │ ├── browserConnection.ts
│ │ │ ├── classes/
│ │ │ │ ├── BrowserPool.ts
│ │ │ │ └── RemoteBrowser.ts
│ │ │ ├── controller.ts
│ │ │ └── inputHandlers.ts
│ │ ├── constants/
│ │ │ └── config.ts
│ │ ├── db/
│ │ │ ├── config/
│ │ │ │ └── database.js
│ │ │ ├── migrate.js
│ │ │ ├── migrations/
│ │ │ │ ├── 20250327111003-add-airtable-columns.js
│ │ │ │ └── 20250527105655-add-webhooks.js
│ │ │ └── models/
│ │ │ └── index.js
│ │ ├── index.ts
│ │ ├── logger.ts
│ │ ├── markdownify/
│ │ │ ├── markdown.ts
│ │ │ └── scrape.ts
│ │ ├── mcp-worker.ts
│ │ ├── middlewares/
│ │ │ ├── api.ts
│ │ │ └── auth.ts
│ │ ├── models/
│ │ │ ├── Robot.ts
│ │ │ ├── Run.ts
│ │ │ ├── User.ts
│ │ │ └── associations.ts
│ │ ├── pgboss-worker.ts
│ │ ├── routes/
│ │ │ ├── auth.ts
│ │ │ ├── index.ts
│ │ │ ├── proxy.ts
│ │ │ ├── record.ts
│ │ │ ├── storage.ts
│ │ │ ├── webhook.ts
│ │ │ └── workflow.ts
│ │ ├── schedule-worker.ts
│ │ ├── sdk/
│ │ │ ├── browserSide/
│ │ │ │ └── pageAnalyzer.js
│ │ │ ├── selectorValidator.ts
│ │ │ └── workflowEnricher.ts
│ │ ├── server.ts
│ │ ├── socket-connection/
│ │ │ └── connection.ts
│ │ ├── storage/
│ │ │ ├── db.ts
│ │ │ ├── mino.ts
│ │ │ ├── pgboss.ts
│ │ │ └── schedule.ts
│ │ ├── swagger/
│ │ │ └── config.ts
│ │ ├── types/
│ │ │ └── index.ts
│ │ ├── utils/
│ │ │ ├── analytics.ts
│ │ │ ├── api.ts
│ │ │ ├── auth.ts
│ │ │ ├── env.ts
│ │ │ └── schedule.ts
│ │ └── workflow-management/
│ │ ├── classes/
│ │ │ ├── Generator.ts
│ │ │ └── Interpreter.ts
│ │ ├── integrations/
│ │ │ ├── airtable.ts
│ │ │ └── gsheet.ts
│ │ ├── scheduler/
│ │ │ └── index.ts
│ │ ├── selector.ts
│ │ ├── storage.ts
│ │ └── utils.ts
│ ├── start.sh
│ ├── tsconfig.json
│ └── tsconfig.mcp.json
├── src/
│ ├── App.tsx
│ ├── api/
│ │ ├── auth.ts
│ │ ├── integration.ts
│ │ ├── proxy.ts
│ │ ├── recording.ts
│ │ ├── storage.ts
│ │ ├── webhook.ts
│ │ └── workflow.ts
│ ├── apiConfig.js
│ ├── components/
│ │ ├── action/
│ │ │ ├── ActionDescriptionBox.tsx
│ │ │ ├── ActionSettings.tsx
│ │ │ └── action-settings/
│ │ │ ├── Scrape.tsx
│ │ │ ├── ScrapeSchema.tsx
│ │ │ ├── Screenshot.tsx
│ │ │ ├── Scroll.tsx
│ │ │ └── index.ts
│ │ ├── api/
│ │ │ └── ApiKey.tsx
│ │ ├── browser/
│ │ │ ├── BrowserContent.tsx
│ │ │ ├── BrowserNavBar.tsx
│ │ │ ├── BrowserRecordingSave.tsx
│ │ │ ├── BrowserTabs.tsx
│ │ │ ├── BrowserWindow.tsx
│ │ │ └── UrlForm.tsx
│ │ ├── dashboard/
│ │ │ ├── MainMenu.tsx
│ │ │ ├── NavBar.tsx
│ │ │ └── NotFound.tsx
│ │ ├── icons/
│ │ │ ├── DiscordIcon.tsx
│ │ │ └── RecorderIcon.tsx
│ │ ├── integration/
│ │ │ └── IntegrationSettings.tsx
│ │ ├── pickers/
│ │ │ ├── DatePicker.tsx
│ │ │ ├── DateTimeLocalPicker.tsx
│ │ │ ├── Dropdown.tsx
│ │ │ └── TimePicker.tsx
│ │ ├── proxy/
│ │ │ └── ProxyForm.tsx
│ │ ├── recorder/
│ │ │ ├── DOMBrowserRenderer.tsx
│ │ │ ├── KeyValueForm.tsx
│ │ │ ├── KeyValuePair.tsx
│ │ │ ├── RightSidePanel.tsx
│ │ │ ├── SaveRecording.tsx
│ │ │ └── SidePanelHeader.tsx
│ │ ├── robot/
│ │ │ ├── Recordings.tsx
│ │ │ ├── RecordingsTable.tsx
│ │ │ ├── ToggleButton.tsx
│ │ │ └── pages/
│ │ │ ├── RobotConfigPage.tsx
│ │ │ ├── RobotCreate.tsx
│ │ │ ├── RobotDuplicatePage.tsx
│ │ │ ├── RobotEditPage.tsx
│ │ │ ├── RobotIntegrationPage.tsx
│ │ │ ├── RobotSettingsPage.tsx
│ │ │ └── ScheduleSettingsPage.tsx
│ │ ├── run/
│ │ │ ├── ColapsibleRow.tsx
│ │ │ ├── InterpretationButtons.tsx
│ │ │ ├── InterpretationLog.tsx
│ │ │ ├── RunContent.tsx
│ │ │ ├── RunSettings.tsx
│ │ │ ├── Runs.tsx
│ │ │ └── RunsTable.tsx
│ │ └── ui/
│ │ ├── AlertSnackbar.tsx
│ │ ├── Box.tsx
│ │ ├── ConfirmationBox.tsx
│ │ ├── DropdownMui.tsx
│ │ ├── Form.tsx
│ │ ├── GenericModal.tsx
│ │ ├── Loader.tsx
│ │ ├── buttons/
│ │ │ ├── AddButton.tsx
│ │ │ ├── BreakpointButton.tsx
│ │ │ ├── Buttons.tsx
│ │ │ ├── ClearButton.tsx
│ │ │ ├── EditButton.tsx
│ │ │ └── RemoveButton.tsx
│ │ └── texts.tsx
│ ├── constants/
│ │ └── const.ts
│ ├── context/
│ │ ├── auth.tsx
│ │ ├── browserActions.tsx
│ │ ├── browserDimensions.tsx
│ │ ├── browserSteps.tsx
│ │ ├── globalInfo.tsx
│ │ ├── socket.tsx
│ │ └── theme-provider.tsx
│ ├── helpers/
│ │ ├── capturedElementHighlighter.ts
│ │ ├── clientListExtractor.ts
│ │ ├── clientPaginationDetector.ts
│ │ ├── clientSelectorGenerator.ts
│ │ ├── dimensionUtils.ts
│ │ └── uuid.ts
│ ├── i18n.ts
│ ├── index.css
│ ├── index.tsx
│ ├── pages/
│ │ ├── Login.tsx
│ │ ├── MainPage.tsx
│ │ ├── PageWrapper.tsx
│ │ ├── RecordingPage.tsx
│ │ └── Register.tsx
│ ├── routes/
│ │ └── userRoute.tsx
│ └── shared/
│ ├── constants.ts
│ └── types.ts
├── tsconfig.json
├── typedoc.json
├── vite-env.d.ts
└── vite.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .dockerignore
================================================
node_modules
npm-debug.log
dist
.git
.gitignore
.md
.vscode
coverage
docker-compose.yml
Dockerfile
Dockerfile.frontend
Dockerfile.backend
================================================
FILE: .github/CODE_OF_CONDUCT.md
================================================
# Contributor Code of Conduct
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of the level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
This Code of Conduct is adapted from the Contributor Covenant, version 1.0.0, available at http://contributor-covenant.org/version/1/0/0/
================================================
FILE: .github/COMMIT_CONVENTION.md
================================================
## Git Commit Message Convention
> This is adapted from [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/).
## Summary
The Conventional Commits specification is a lightweight convention on top of commit messages.
It provides an easy set of rules for creating an explicit commit history;
which makes it easier to write automated tools on top of.
This convention dovetails with [SemVer](http://semver.org),
by describing the features, fixes, and breaking changes made in commit messages.
The commit message should be structured as follows:
---
```
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```
---
<br />
The commit contains the following structural elements, to communicate intent to the
consumers of your library:
1. **fix:** a commit of the _type_ `fix` patches a bug in your codebase (this correlates with [`PATCH`](http://semver.org/#summary) in Semantic Versioning).
1. **feat:** a commit of the _type_ `feat` introduces a new feature to the codebase (this correlates with [`MINOR`](http://semver.org/#summary) in Semantic Versioning).
1. **BREAKING CHANGE:** a commit that has a footer `BREAKING CHANGE:`, or appends a `!` after the type/scope, introduces a breaking API change (correlating with [`MAJOR`](http://semver.org/#summary) in Semantic Versioning).
A BREAKING CHANGE can be part of commits of any _type_.
1. _types_ other than `fix:` and `feat:` are allowed, for example [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional) (based on the [the Angular convention](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines)) recommends `build:`, `chore:`,
`ci:`, `docs:`, `style:`, `refactor:`, `perf:`, `test:`, and others.
1. _footers_ other than `BREAKING CHANGE: <description>` may be provided and follow a convention similar to
[git trailer format](https://git-scm.com/docs/git-interpret-trailers).
Additional types are not mandated by the Conventional Commits specification, and have no implicit effect in Semantic Versioning (unless they include a BREAKING CHANGE).
<br /><br />
A scope may be provided to a commit's type, to provide additional contextual information and is contained within parenthesis, e.g., `feat(parser): add ability to parse arrays`.
## Examples
### Commit message with description and breaking change footer
```
feat: allow provided config object to extend other configs
BREAKING CHANGE: `extends` key in config file is now used for extending other config files
```
### Commit message with `!` to draw attention to breaking change
```
feat!: send an email to the customer when a product is shipped
```
### Commit message with scope and `!` to draw attention to breaking change
```
feat(api)!: send an email to the customer when a product is shipped
```
### Commit message with both `!` and BREAKING CHANGE footer
```
chore!: drop support for Node 6
BREAKING CHANGE: use JavaScript features not available in Node 6.
```
### Commit message with no body
```
docs: correct spelling of CHANGELOG
```
### Commit message with scope
```
feat(lang): add polish language
```
### Commit message with multi-paragraph body and multiple footers
```
fix: prevent racing of requests
Introduce a request id and a reference to latest request. Dismiss
incoming responses other than from latest request.
Remove timeouts which were used to mitigate the racing issue but are
obsolete now.
Reviewed-by: Z
Refs: #123
```
## Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).
1. Commits MUST be prefixed with a type, which consists of a noun, `feat`, `fix`, etc., followed
by the OPTIONAL scope, OPTIONAL `!`, and REQUIRED terminal colon and space.
1. The type `feat` MUST be used when a commit adds a new feature to your application or library.
1. The type `fix` MUST be used when a commit represents a bug fix for your application.
1. A scope MAY be provided after a type. A scope MUST consist of a noun describing a
section of the codebase surrounded by parenthesis, e.g., `fix(parser):`
1. A description MUST immediately follow the colon and space after the type/scope prefix.
The description is a short summary of the code changes, e.g., _fix: array parsing issue when multiple spaces were contained in string_.
1. A longer commit body MAY be provided after the short description, providing additional contextual information about the code changes. The body MUST begin one blank line after the description.
1. A commit body is free-form and MAY consist of any number of newline separated paragraphs.
1. One or more footers MAY be provided one blank line after the body. Each footer MUST consist of
a word token, followed by either a `:<space>` or `<space>#` separator, followed by a string value (this is inspired by the
[git trailer convention](https://git-scm.com/docs/git-interpret-trailers)).
1. A footer's token MUST use `-` in place of whitespace characters, e.g., `Acked-by` (this helps differentiate
the footer section from a multi-paragraph body). An exception is made for `BREAKING CHANGE`, which MAY also be used as a token.
1. A footer's value MAY contain spaces and newlines, and parsing MUST terminate when the next valid footer
token/separator pair is observed.
1. Breaking changes MUST be indicated in the type/scope prefix of a commit, or as an entry in the
footer.
1. If included as a footer, a breaking change MUST consist of the uppercase text BREAKING CHANGE, followed by a colon, space, and description, e.g.,
_BREAKING CHANGE: environment variables now take precedence over config files_.
1. If included in the type/scope prefix, breaking changes MUST be indicated by a
`!` immediately before the `:`. If `!` is used, `BREAKING CHANGE:` MAY be omitted from the footer section,
and the commit description SHALL be used to describe the breaking change.
1. Types other than `feat` and `fix` MAY be used in your commit messages, e.g., _docs: updated ref docs._
1. The units of information that make up Conventional Commits MUST NOT be treated as case sensitive by implementors, with the exception of BREAKING CHANGE which MUST be uppercase.
1. BREAKING-CHANGE MUST be synonymous with BREAKING CHANGE, when used as a token in a footer.
## Why Use Conventional Commits
* Automatically generating CHANGELOGs.
* Automatically determining a semantic version bump (based on the types of commits landed).
* Communicating the nature of changes to teammates, the public, and other stakeholders.
* Triggering build and publish processes.
* Making it easier for people to contribute to your projects, by allowing them to explore
a more structured commit history.
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yml
================================================
name: Bug Report
description: Report a bug to help us improve
title: "[Bug]: "
labels: [bug]
assignees: []
body:
- type: dropdown
id: environment
attributes:
label: Where are you using the app?
options:
- Cloud (Hosted by Us)
- Self-Hosted (OSS) with Docker
- Self-Hosted (OSS) without Docker
validations:
required: true
- type: input
id: app_version
attributes:
label: App Version
description: Enter the version number you are using (if known).
placeholder: "e.g., v1.2.3"
validations:
required: false
- type: input
id: browser
attributes:
label: Browser
description: Which browser are you using?
placeholder: "e.g., Chrome 124, Firefox 115, Safari 17"
validations:
required: true
- type: input
id: operating_system
attributes:
label: Operating System
description: Your operating system and version.
placeholder: "e.g., Windows 11, macOS Sonoma, Ubuntu 22.04"
validations:
required: true
- type: textarea
id: steps_to_reproduce
attributes:
label: Steps to Reproduce
description: How can we reproduce the problem?
placeholder: |
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
validations:
required: true
- type: textarea
id: expected_behavior
attributes:
label: Expected Behavior
description: What did you expect to happen instead?
validations:
required: true
- type: textarea
id: actual_behavior
attributes:
label: Actual Behavior
description: What actually happened?
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant Logs or Screenshots
description: Please paste any logs, screenshots, or console errors if available.
placeholder: "Paste logs or upload screenshots."
validations:
required: false
- type: textarea
id: additional_context
attributes:
label: Additional Context
description: Anything else we should know?
validations:
required: false
================================================
FILE: .gitignore
================================================
# dependencies
/node_modules
/browser/node_modules
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.env
/.idea
/server/logs
/build
package-lock.json
================================================
FILE: .sequelizerc
================================================
const path = require('path');
module.exports = {
'config': path.resolve('server/src/db/config', 'database.js'),
'models-path': path.resolve('server/src/db/models'),
'seeders-path': path.resolve('server/src/db/seeders'),
'migrations-path': path.resolve('server/src/db/migrations')
};
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
## Local Setup
Read local installation instructions here: <a href="https://docs.maxun.dev/installation/local">Local Installation</a>
## Open Your First Pull Request
### 1. Create a new branch
Create a new branch from the develop branch. Use a descriptive name for your branch, such as `feature/new-feature` or `fix/bug-fix`. This makes it easier to understand the purpose of the changes.
### 2. Make your changes
Make the necessary code changes and commit them to your local branch.
Follow Conventional Commits: Use the format `<type>(<scope>): <short description>[optional body][optional footer]` for your commit messages.
Example: `feat(api): Add new endpoint for user data`
### 3. Push your changes
Push your local branch to the remote repository:
```git push origin <your-branch-name>```
### 4. Create a Pull Request
1. Go to the repository on GitHub and navigate to the `Pull Requests` tab.
2. Click `New pull request`.
3. Select your branch as the "compare" branch and develop as the "base" branch.
4. Give your PR a descriptive title that summarizes the changes.
5. Write a clear and concise description of the changes you made and why they are necessary.
6. Add any relevant screenshots or GIFs to help visualize the changes.
### 5. Review and Merge
1. Once you submit the PR, it will be reviewed by other developers.
2. Address any comments or requested changes from the reviewers.
3. Once the PR is approved, it will be merged into the develop branch.
### 6. Remember
1. Always test your changes thoroughly before submitting a PR.
2. Keep your PRs focused on a single feature or bug fix.
3. Be respectful and responsive to feedback from reviewers.
### 7. AI-Assisted Contributions
AI-assisted contributions are welcome. If you use AI tools to generate code, please ensure that:
1. The changes fully address the issue or feature request.
2. The code is tested and works as expected.
3. The implementation follows the existing project structure and conventions.
4. You understand the code you are submitting and can respond to review feedback.
Low-quality, unverified, or blindly generated patches will not be merged.
================================================
FILE: Dockerfile.backend
================================================
FROM node:20-slim
# Set working directory
WORKDIR /app
COPY .sequelizerc .sequelizerc
# Install node dependencies
COPY package*.json ./
COPY src ./src
COPY public ./public
COPY server ./server
COPY tsconfig.json ./
COPY server/tsconfig.json ./server/
# COPY server/start.sh ./
# Install dependencies
RUN npm install --legacy-peer-deps
# Build TypeScript server
RUN npm run build:server
# Expose backend port
EXPOSE ${BACKEND_PORT:-8080}
# Run migrations & start backend using plain node
CMD ["npm", "run", "server"]
# CMD ["sh", "-c", "npm run migrate && npm run server"]
================================================
FILE: Dockerfile.frontend
================================================
FROM node:18-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install --legacy-peer-deps
# Copy frontend source code and config
COPY src ./src
COPY public ./public
COPY index.html ./
COPY vite.config.js ./
COPY tsconfig.json ./
# Expose the frontend port
EXPOSE ${FRONTEND_PORT:-5173}
# Start the frontend using the client script
CMD ["npm", "run", "client", "--", "--host"]
================================================
FILE: ENVEXAMPLE
================================================
# App Setup
NODE_ENV=production # Set to 'development' or 'production' as required
JWT_SECRET=a9Z$kLq7^f03GzNw!bP9dH4xV6sT2yXl3O8vR@uYq3 # Replace with a secure JWT secret key
DB_NAME=maxun # Your PostgreSQL database name
DB_USER=postgres # PostgreSQL username
DB_PASSWORD=postgres # PostgreSQL password
DB_HOST=postgres # Host for PostgreSQL in Docker
DB_PORT=5432 # Port for PostgreSQL (default: 5432)
ENCRYPTION_KEY=f4d5e6a7b8c9d0e1f23456789abcdef01234567890abcdef123456789abcdef0 # Key for encrypting sensitive data (passwords and proxies)
SESSION_SECRET=maxun_session # A strong, random string used to sign session cookies. Recommended to define your own session secret to avoid session hijacking.
MINIO_ENDPOINT=minio # MinIO endpoint in Docker
MINIO_PORT=9000 # Port for MinIO (default: 9000)
MINIO_CONSOLE_PORT=9001 # Web UI Port for MinIO (default: 9001)
MINIO_ACCESS_KEY=minio_access_key # MinIO access key
MINIO_SECRET_KEY=minio_secret_key # MinIO secret key
REDIS_HOST=redis # Redis host in Docker
REDIS_PORT=6379 # Redis port (default: 6379)
REDIS_PASSWORD=redis_password # Redis password (This is optional. Needed to authenticate with a password-protected Redis instance; if not set, Redis will connect without authentication.)
# Backend and Frontend URLs and Ports
BACKEND_PORT=8080 # Port to run backend on. Needed for Docker setup
FRONTEND_PORT=5173 # Port to run frontend on. Needed for Docker setup
BACKEND_URL=http://localhost:8080 # URL on which the backend runs. You can change it based on your needs.
PUBLIC_URL=http://localhost:5173 # URL on which the frontend runs. You can change it based on your needs.
VITE_BACKEND_URL=http://localhost:8080 # URL used by frontend to connect to backend. It should always have the same value as BACKEND_URL
VITE_PUBLIC_URL=http://localhost:5173 # URL used by backend to connect to frontend. It should always have the same value as PUBLIC_URL
# Optional Google OAuth settings for Google Sheet Integration
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=your_google_redirect_uri
# Optional Airtable OAuth settings for Airtable Integration
AIRTABLE_CLIENT_ID=your_airtable_client_id
AIRTABLE_REDIRECT_URI=http://localhost:8080/auth/airtable/callback
# Telemetry Settings - Please keep it enabled. Keeping it enabled helps us understand how the product is used and assess the impact of any new changes.
MAXUN_TELEMETRY=true
# WebSocket port for browser CDP connections
BROWSER_WS_PORT=3001
BROWSER_HEALTH_PORT=3002
BROWSER_WS_HOST=browser
================================================
FILE: LICENSE
================================================
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.
================================================
FILE: README.md
================================================
<h2 align="center">
<div>
<a href="https://www.maxun.dev/?ref=ghread">
<img src="/src/assets/maxunlogo.png" width="70" />
<br>
Maxun
</a>
</div>
Turn Any Website Into A Structured API
<br>
</h2>
<p align="center">
✨ The unified open-source no-code platform for real-time web scraping, crawling, search and AI data extraction ✨
<p align="center">
<a href="https://app.maxun.dev/?ref=ghread"><b>Go To App</b></a> •
<a href="https://docs.maxun.dev/?ref=ghread"><b>Documentation</b></a> •
<a href="https://www.maxun.dev/?ref=ghread"><b>Website</b></a> •
<a href="https://discord.gg/5GbPjBUkws"><b>Discord</b></a> •
<a href="https://www.youtube.com/@MaxunOSS?ref=ghread"><b>Watch Tutorials</b></a>
<br />
<br />
<a href="https://trendshift.io/repositories/12113" target="_blank"><img src="https://trendshift.io/api/badge/repositories/12113" alt="getmaxun%2Fmaxun | Trendshift" style="width: 250px; height: 55px; margin-top: 10px;" width="250" height="55"/></a>
</p>
## What is Maxun?
Maxun is an open-source no-code web data platform for turning the web into structured, reliable data.
It supports extraction, crawling, scraping, and search — designed to scale from simple use cases to complex, automated workflows.
### Ecosystem
1. **[Extract](https://docs.maxun.dev/category/extract)** – Emulate real user behavior and collect structured data from any website.
* **[Recorder Mode](https://docs.maxun.dev/robot/extract/robot-actions)** – Record your actions as you browse; Maxun turns them into a reusable extraction robot.
* **[AI Mode](https://docs.maxun.dev/robot/extract/llm-extraction)** – Describe what you want in natural language and let LLM-powered extraction do the rest.
2. **[Scrape](https://docs.maxun.dev/robot/scrape/scrape-robots)** – Convert full webpages into clean Markdown or HTML and capture screenshots.
3. **[Crawl](https://docs.maxun.dev/robot/crawl/crawl-introduction)** – Crawl entire websites and extract content from every relevant page, with full control over scope and discovery.
4. **[Search](https://docs.maxun.dev/robot/search/search-introduction)** – Run automated web searches to discover or scrape results, with support for time-based filters.
5. **[SDK](https://docs.maxun.dev/sdk/sdk-overview)** – A complete developer toolkit for scraping, extraction, scheduling, and end-to-end data automation.
## How Does It Work?
Maxun robots are automated tools that help you collect data from websites without writing any code. Think of them as your personal web assistants that can navigate websites, extract information, and organize data just like you would manually - but faster and more efficiently.
There are four types of robots, each designed for a different job.
### 1. Extract
Extract emulates real user behavior and captures structured data.
- <a href="/robot/extract/robot-actions">Recorder Mode</a> - Record your actions as you browse; Maxun turns them into a reusable extraction robot.
### Example: Extract 10 Property Listings from Airbnb
[https://github.com/user-attachments/assets/recorder-mode-demo-video](https://github.com/user-attachments/assets/c6baa75f-b950-482c-8d26-8a8b6c5382c3)
- <a href="/robot/extract/llm-extraction">AI Mode</a> - Describe what you want in natural language and let LLM-powered extraction do the rest.
### Example: Extract Names, Rating & Duration of Top 50 Movies from IMDb
https://github.com/user-attachments/assets/f714e860-58d6-44ed-bbcd-c9374b629384
Learn more <a href="/category/extract">here</a>.
### 2. Scrape
Scrape converts full webpages into clean Markdown, HTML and can capture screenshots. Ideal for AI workflows, agents, and document processing.
Learn more <a href="https://docs.maxun.dev/robot/scrape/scrape-robots">here</a>.
### 3. Crawl
Crawl entire websites and extract content from every relevant page, with full control over scope and discovery.
Learn more <a href="https://docs.maxun.dev/robot/crawl/crawl-introduction">here</a>.
### 4. Search
Run automated web searches to discover or scrape results, with support for time-based filters.
Learn more <a href="https://docs.maxun.dev/robot/search/search-introduction">here</a>.
## Quick Start
### Getting Started
The simplest & fastest way to get started is to use the hosted version: https://app.maxun.dev. You can self-host if you prefer!
### Installation
Maxun can run locally with or without Docker
1. [Setup with Docker Compose](https://docs.maxun.dev/installation/docker)
2. [Setup without Docker](https://docs.maxun.dev/installation/local)
3. [Environment Variables](https://docs.maxun.dev/installation/environment_variables)
4. [SDK](https://github.com/getmaxun/node-sdk)
### Upgrading & Self Hosting
1. [Self Host Maxun With Docker & Portainer](https://docs.maxun.dev/self-host)
2. [Upgrade Maxun With Docker Compose Setup](https://docs.maxun.dev/installation/upgrade#upgrading-with-docker-compose)
3. [Upgrade Maxun Without Docker Compose Setup](https://docs.maxun.dev/installation/upgrade#upgrading-with-local-setup)
## Sponsors
<table>
<tr>
<td width="229">
<br/>
<a href="https://www.testmuai.com/?utm_medium=sponsor&utm_source=maxun" target="_blank">
<img src="https://github.com/user-attachments/assets/6c96005b-85df-43e0-9b63-96aaca676c11" /><br/><br/>
<b>TestMu AI</b>
</a>
<br/>
<sub>The Native AI-Agentic Cloud Platform to Supercharge Quality Engineering. Test Intelligently and Ship Faster.
</sub>
</td>
</tr>
</table>
## Features
- ✨ **Extract Data With No-Code** – Point and click interface
- ✨ **LLM-Powered Extraction** – Describe what you want; use LLMs to scrape structured data
- ✨ **Developer SDK** – Programmatic extraction, scheduling, and robot management
- ✨ **Handle Pagination & Scrolling** – Automatic navigation
- ✨ **Run Robots On Schedules** – Set it and forget it
- ✨ **Turn Websites to APIs** – RESTful endpoints from any site
- ✨ **Turn Websites to Spreadsheets** – Direct data export to Google Sheets & Airtable
- ✨ **Adapt To Website Layout Changes** – Auto-recovery from site updates
- ✨ **Extract Behind Login** – Handle authentication seamlessly
- ✨ **Integrations** – Connect with your favorite tools
- ✨ **MCP Support** – Model Context Protocol integration
- ✨ **LLM-Ready Data** – Clean Markdown for AI applications
- ✨ **Self-Hostable** – Full control over your infrastructure
- ✨ **Open Source** – Transparent and community-driven
## Demos
Maxun can be used for various use-cases, including lead generation, market research, content aggregation and more.
View demos here: https://www.maxun.dev/usecases
## Note
This project is in early stages of development. Your feedback is very important for us - we're actively working on improvements. </a>
## License
<p>
This project is licensed under <a href="./LICENSE">AGPLv3</a>.
</p>
## Project Values
We believe in fair and responsible use of open source.
If you rely on this project commercially, please consider contributing back
or supporting its development.
## Support Us
Star the repository, contribute if you love what we’re building, or [sponsor us](https://github.com/sponsors/amhsirak).
## Contributors
Thank you to the combined efforts of everyone who contributes!
<a href="https://github.com/getmaxun/maxun/graphs/contributors">
<img src="https://contrib.rocks/image?repo=getmaxun/maxun" />
</a>
================================================
FILE: SETUP.md
================================================
# Local Installation
1. Create a root folder for your project (e.g. 'maxun')
2. Create a file named `.env` in the root folder of the project
3. Example env file can be viewed [here](https://github.com/getmaxun/maxun/blob/master/ENVEXAMPLE). Copy all content of example env to your `.env` file.
4. Choose your installation method below
### Docker Compose
1. Copy paste the [docker-compose.yml file](https://github.com/getmaxun/maxun/blob/master/docker-compose.yml) into your root folder
2. Ensure you have setup the `.env` file in that same folder
3. Run the command below from a terminal
```
docker-compose up -d
```
You can access the frontend at http://localhost:5173/ and backend at http://localhost:8080/
### Without Docker
1. Ensure you have Node.js, PostgreSQL, MinIO and Redis installed on your system.
2. Run the commands below
```
git clone https://github.com/getmaxun/maxun
# change directory to the project root
cd maxun
# install dependencies
npm install
# change directory to maxun-core to install dependencies
cd maxun-core
npm install
# get back to the root directory
cd ..
# install chromium and its dependencies
npx playwright install --with-deps chromium
# get back to the root directory
cd ..
# start frontend and backend together
npm run start
```
You can access the frontend at http://localhost:5173/ and backend at http://localhost:8080/
# Environment Variables
1. Create a file named `.env` in the root folder of the project
2. Example env file can be viewed [here](https://github.com/getmaxun/maxun/blob/master/ENVEXAMPLE).
| Variable | Mandatory | Description | If Not Set |
|-----------------------|-----------|----------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `BACKEND_PORT` | Yes | Port to run backend on. Needed for Docker setup | Default value: 8080 |
| `FRONTEND_PORT` | Yes | Port to run frontend on. Needed for Docker setup | Default value: 5173 |
| `BACKEND_URL` | Yes | URL to run backend on. | Default value: http://localhost:8080 |
| `VITE_BACKEND_URL` | Yes | URL used by frontend to connect to backend | Default value: http://localhost:8080 |
| `PUBLIC_URL` | Yes | URL to run frontend on. | Default value: http://localhost:5173 |
| `VITE_PUBLIC_URL` | Yes | URL used by backend to connect to frontend | Default value: http://localhost:5173 |
| `JWT_SECRET` | Yes | Secret key used to sign and verify JSON Web Tokens (JWTs) for authentication. | JWT authentication will not work. |
| `DB_NAME` | Yes | Name of the Postgres database to connect to. | Database connection will fail. |
| `DB_USER` | Yes | Username for Postgres database authentication. | Database connection will fail. |
| `DB_PASSWORD` | Yes | Password for Postgres database authentication. | Database connection will fail. |
| `DB_HOST` | Yes | Host address where the Postgres database server is running. | Database connection will fail. |
| `DB_PORT` | Yes | Port number used to connect to the Postgres database server. | Database connection will fail. |
| `ENCRYPTION_KEY` | Yes | Key used for encrypting sensitive data (proxies, passwords). | Encryption functionality will not work. |
| `SESSION_SECRET` | No | A strong, random string used to sign session cookies | Uses default secret. Recommended to define your own session secret to avoid session hijacking. |
| `MINIO_ENDPOINT` | Yes | Endpoint URL for MinIO, to store Robot Run Screenshots. | Connection to MinIO storage will fail. |
| `MINIO_PORT` | Yes | Port number for MinIO service. | Connection to MinIO storage will fail. |
| `MINIO_CONSOLE_PORT` | No | Port number for MinIO WebUI service. Needed for Docker setup. | Cannot access MinIO Web UI. |
| `MINIO_ACCESS_KEY` | Yes | Access key for authenticating with MinIO. | MinIO authentication will fail. |
| `GOOGLE_CLIENT_ID` | No | Client ID for Google OAuth. Used for Google Sheet integration authentication. | Google login will not work. |
| `GOOGLE_CLIENT_SECRET`| No | Client Secret for Google OAuth. Used for Google Sheet integration authentication. | Google login will not work. |
| `GOOGLE_REDIRECT_URI` | No | Redirect URI for handling Google OAuth responses. | Google login will not work. |
| `AIRTABLE_CLIENT_ID` | No | Client ID for Airtable, used for Airtable integration authentication. | Airtable login will not work. |
| `AIRTABLE_REDIRECT_URI` | No | Redirect URI for handling Airtable OAuth responses. | Airtable login will not work. |
| `MAXUN_TELEMETRY` | No | Disables telemetry to stop sending anonymous usage data. Keeping it enabled helps us understand how the product is used and assess the impact of any new changes. Please keep it enabled. | Telemetry data will not be collected. |
================================================
FILE: browser/.dockerignore
================================================
node_modules
npm-debug.log
.env
.git
.gitignore
dist
*.ts
!*.d.ts
tsconfig.json
================================================
FILE: browser/Dockerfile
================================================
FROM mcr.microsoft.com/playwright:v1.57.0-jammy
WORKDIR /app
# Copy package files
COPY browser/package*.json ./
# Install dependencies
RUN npm install
# Copy TypeScript source and config
COPY browser/server.ts ./
COPY browser/tsconfig.json ./
# Build TypeScript
RUN npm run build
# Accept build arguments for ports (with defaults)
ARG BROWSER_WS_PORT=3001
ARG BROWSER_HEALTH_PORT=3002
# Set as environment variables
ENV BROWSER_WS_PORT=${BROWSER_WS_PORT}
ENV BROWSER_HEALTH_PORT=${BROWSER_HEALTH_PORT}
# Expose ports dynamically based on build args
EXPOSE ${BROWSER_WS_PORT} ${BROWSER_HEALTH_PORT}
# Start the browser service (run compiled JS)
CMD ["node", "dist/server.js"]
================================================
FILE: browser/package.json
================================================
{
"name": "maxun-browser-service",
"version": "1.0.0",
"description": "Browser service that exposes Playwright browsers via WebSocket with stealth plugins",
"main": "dist/server.js",
"scripts": {
"build": "tsc",
"start": "node dist/server.js",
"dev": "ts-node server.ts"
},
"dependencies": {
"playwright": "1.57.0",
"playwright-extra": "^4.3.6",
"puppeteer-extra-plugin-stealth": "^2.11.2"
},
"devDependencies": {
"@types/node": "^22.7.9",
"typescript": "^5.0.0",
"ts-node": "^10.9.2"
}
}
================================================
FILE: browser/server.ts
================================================
import { chromium } from 'playwright-extra';
import stealthPlugin from 'puppeteer-extra-plugin-stealth';
import http from 'http';
import type { BrowserServer } from 'playwright';
// Apply stealth plugin to chromium
chromium.use(stealthPlugin());
let browserServer: BrowserServer | null = null;
// Configurable ports with defaults
const BROWSER_WS_PORT = parseInt(process.env.BROWSER_WS_PORT || '3001', 10);
const BROWSER_HEALTH_PORT = parseInt(process.env.BROWSER_HEALTH_PORT || '3002', 10);
const BROWSER_WS_HOST = process.env.BROWSER_WS_HOST || 'localhost';
async function start(): Promise<void> {
console.log('Starting Maxun Browser Service...');
console.log(`WebSocket port: ${BROWSER_WS_PORT}`);
console.log(`Health check port: ${BROWSER_HEALTH_PORT}`);
try {
// Launch browser server that exposes WebSocket endpoint
browserServer = await chromium.launchServer({
headless: true,
args: [
'--disable-blink-features=AutomationControlled',
'--disable-web-security',
'--disable-features=IsolateOrigins,site-per-process',
'--disable-site-isolation-trials',
'--disable-extensions',
'--no-sandbox',
'--disable-dev-shm-usage',
'--disable-gpu',
'--force-color-profile=srgb',
'--force-device-scale-factor=2',
'--ignore-certificate-errors',
'--mute-audio'
],
port: BROWSER_WS_PORT,
});
console.log(`✅ Browser WebSocket endpoint ready: ${browserServer.wsEndpoint()}`);
console.log(`✅ Stealth plugin enabled`);
// Health check HTTP server
const healthServer = http.createServer((req, res) => {
if (req.url === '/health') {
const wsEndpoint = browserServer?.wsEndpoint().replace('localhost', BROWSER_WS_HOST) || '';
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
status: 'healthy',
wsEndpoint,
wsPort: BROWSER_WS_PORT,
healthPort: BROWSER_HEALTH_PORT,
timestamp: new Date().toISOString()
}));
} else if (req.url === '/') {
res.writeHead(200, { 'Content-Type': 'text/plain' });
const wsEndpoint = browserServer?.wsEndpoint().replace('localhost', BROWSER_WS_HOST) || '';
res.end(`Maxun Browser Service\nWebSocket: ${wsEndpoint}\nHealth: http://localhost:${BROWSER_HEALTH_PORT}/health`);
} else {
res.writeHead(404);
res.end('Not Found');
}
});
healthServer.listen(BROWSER_HEALTH_PORT, () => {
console.log(`✅ Health check server running on port ${BROWSER_HEALTH_PORT}`);
console.log('Browser service is ready to accept connections!');
});
} catch (error) {
console.error('❌ Failed to start browser service:', error);
process.exit(1);
}
}
// Graceful shutdown
async function shutdown(): Promise<void> {
console.log('Shutting down browser service...');
if (browserServer) {
try {
await browserServer.close();
console.log('Browser server closed');
} catch (error) {
console.error('Error closing browser server:', error);
}
}
process.exit(0);
}
process.on('SIGTERM', shutdown);
process.on('SIGINT', shutdown);
// Start the service
start().catch(console.error);
================================================
FILE: browser/tsconfig.json
================================================
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"lib": [
"ES2020"
],
"outDir": "./dist",
"rootDir": "./",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"moduleResolution": "node"
},
"include": [
"server.ts"
],
"exclude": [
"node_modules",
"dist"
]
}
================================================
FILE: docker-compose.yml
================================================
services:
postgres:
image: postgres:13
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "${DB_PORT:-5432}:${DB_PORT:-5432}"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
minio:
image: minio/minio
restart: unless-stopped
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
command: server /data --console-address :${MINIO_CONSOLE_PORT:-9001}
ports:
- "${MINIO_PORT:-9000}:${MINIO_PORT:-9000}" # API port
- "${MINIO_CONSOLE_PORT:-9001}:${MINIO_CONSOLE_PORT:-9001}" # WebUI port
volumes:
- minio_data:/data
backend:
# build:
# context: .
# dockerfile: Dockerfile.backend
image: getmaxun/maxun-backend:latest
restart: unless-stopped
ports:
- "${BACKEND_PORT:-8080}:${BACKEND_PORT:-8080}"
env_file: .env
environment:
BACKEND_URL: ${BACKEND_URL}
# to ensure Playwright works in Docker
PLAYWRIGHT_BROWSERS_PATH: /ms-playwright
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 0
# Force container/CI detection for headless mode
CI: "true"
CONTAINER: "true"
# DEBUG: pw:api
# PWDEBUG: 1 # Enables debugging
CHROMIUM_FLAGS: '--disable-gpu --no-sandbox --headless=new'
security_opt:
- seccomp=unconfined # This might help with browser sandbox issues
shm_size: '2gb' # Increase shared memory size for Chromium
mem_limit: 6g # Set 6GB memory limit
depends_on:
- postgres
- minio
volumes:
- /var/run/dbus:/var/run/dbus
frontend:
# build:
# context: .
# dockerfile: Dockerfile.frontend
image: getmaxun/maxun-frontend:latest
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-5173}:${FRONTEND_PORT:-5173}"
env_file: .env
environment:
PUBLIC_URL: ${PUBLIC_URL}
BACKEND_URL: ${BACKEND_URL}
depends_on:
- backend
browser:
build:
context: .
dockerfile: browser/Dockerfile
args:
BROWSER_WS_PORT: ${BROWSER_WS_PORT:-3001}
BROWSER_HEALTH_PORT: ${BROWSER_HEALTH_PORT:-3002}
ports:
- "${BROWSER_WS_PORT:-3001}:${BROWSER_WS_PORT:-3001}"
- "${BROWSER_HEALTH_PORT:-3002}:${BROWSER_HEALTH_PORT:-3002}"
environment:
- NODE_ENV=production
- DEBUG=pw:browser*
- BROWSER_WS_PORT=${BROWSER_WS_PORT:-3001}
- BROWSER_HEALTH_PORT=${BROWSER_HEALTH_PORT:-3002}
- BROWSER_WS_HOST=${BROWSER_WS_HOST:-browser}
- PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${BROWSER_HEALTH_PORT:-3002}/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
deploy:
resources:
limits:
memory: 2G
cpus: '1.5'
reservations:
memory: 1G
cpus: '1.0'
security_opt:
- seccomp:unconfined
shm_size: 2gb
cap_add:
- SYS_ADMIN
volumes:
postgres_data:
minio_data:
================================================
FILE: docker-entrypoint.sh
================================================
#!/bin/sh
# Start backend server
cd /app && npm run start:server -- --host 0.0.0.0 &
# Start nginx
nginx -g 'daemon off;'
================================================
FILE: docs/nginx.conf
================================================
# Robust maxun nginx config file
# DO NOT uncomment commented lines unless YOU know what they mean and YOU know what YOU are doing!
### HTTP server block ###
server {
server_name maxun.my.domain;
root /usr/share/nginx/html;
listen 80;
server_tokens off;
return 301 https://$server_name$request_uri;
}
### HTTPS server block ###
server {
### Default config ###
server_name maxun.my.domain;
root /usr/share/nginx/html;
access_log /var/log/nginx/maxun_access.log;
error_log /var/log/nginx/maxun_error.log info;
listen 443 ssl;
http2 on;
server_tokens off;
### SSL config ###
ssl_certificate /etc/letsencrypt/live/my.domain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/my.domain/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/my.domain/chain.pem;
ssl_protocols TLSv1.2 TLSv1.3;
#ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1:secp384r1;
ssl_ecdh_curve X25519:prime256v1:secp384r1;
ssl_prefer_server_ciphers off;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
ssl_stapling off;
ssl_stapling_verify off;
ssl_session_cache shared:MozSSL:10m;
ssl_session_tickets off;
ssl_session_timeout 1d;
ssl_dhparam dh.pem;
#ssl_conf_command Options KTLS;
### Performance tuning config ###
client_max_body_size 512M;
client_body_timeout 300s;
client_body_buffer_size 256k;
#pagespeed off;
### Compression ###
## gzip ##
gzip on;
gzip_vary on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_disable msie6;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_buffers 16 8k;
gzip_types application/atom+xml text/javascript application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
## brotli: enable only if you have compiled nginx with brotli support!!! ##
#brotli on;
#brotli_static on;
#brotli_comp_level 6;
#brotli_types application/atom+xml application/javascript application/json application/rss+xml
# application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype
# application/x-font-ttf application/x-javascript application/xhtml+xml application/xml
# font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon
# image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml;
### Default headers ###
add_header Referrer-Policy "no-referrer" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Permissions-Policy "geolocation=(self), midi=(self), sync-xhr=(self), microphone=(self), camera=(self), magnetometer=(self), gyroscope=(self), fullscreen=(self), payment=(self), interest-cohort=()";
### Proxy rules ###
# Backend web traffic and websockets
location ~ ^/(auth|storage|record|workflow|robot|proxy|api-docs|api|webhook|socket.io)(/|$) {
proxy_pass http://localhost:8080; #Change the port number to match .env file BACKEND_PORT variable
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Frontend web traffic
location / {
proxy_pass http://localhost:5173; #Change the port number to match .env file FRONTEND_PORT variable
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
================================================
FILE: docs/self-hosting-docker.md
================================================
# Self hosting docker guide
So you want to create a bot? Let's get you started!
## Requirements (not covered)
- Webserver (Apache2, nginx, etc.)
- SSL Certificates (letsencrypt, zerossl, etc)
- A sub-domain to host maxun i.e. maxun.my.domain
- Docker
- Docker compose
- Probably others...
## Guide
For this guide, we assume that before you start, you have a dedicated docker folder to house config files and everything else we need for persistence between docker container reboots and updates. The path in this guide is `/home/$USER/Docker/maxun`.
1. Change directory into your docker folder `cd /home/$USER/Docker/`
2. Create a new directory for maxun and all the required sub-folders for our docker services `mkdir -p maxun/{db,minio,redis}`
3. Change directory to enter the newly created folder `cd maxun`
4. Create an environment file to save your variables `nano .env` with the following contents:
```
NODE_ENV=production
JWT_SECRET=openssl rand -base64 48
DB_NAME=maxun
DB_USER=postgres
DB_PASSWORD=openssl rand -base64 24
DB_HOST=postgres
DB_PORT=5432
ENCRYPTION_KEY=openssl rand -base64 64
SESSION_SECRET=openssl rand -base64 48
MINIO_ENDPOINT=minio
MINIO_PORT=9000
MINIO_CONSOLE_PORT=9001
MINIO_ACCESS_KEY=minio
MINIO_SECRET_KEY=openssl rand -base64 24
REDIS_HOST=maxun-redis
REDIS_PORT=6379
REDIS_PASSWORD=
BACKEND_PORT=8080
FRONTEND_PORT=5173
BACKEND_URL=https://maxun.my.domain
PUBLIC_URL=https://maxun.my.domain
VITE_BACKEND_URL=https://maxun.my.domain
VITE_PUBLIC_URL=https://maxun.my.domain
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=
AIRTABLE_CLIENT_ID=
AIRTABLE_REDIRECT_URI=
MAXUN_TELEMETRY=true
```
5. Ctrl + x, Y, Enter will save your changes
6. Please be sure to READ this file and change the variables to match your environment!!! i.e. BACKEND_PORT=30000
7. Create a file for docker compose `nano docker-compose.yml` with the following contents:
```yml
services:
postgres:
image: postgres:17
container_name: maxun-postgres
mem_limit: 512M
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- /home/$USER/Docker/maxun/db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: docker.io/library/redis:7
container_name: maxun-redis
restart: always
mem_limit: 128M
volumes:
- /home/$USER/Docker/maxun/redis:/data
minio:
image: minio/minio
container_name: maxun-minio
mem_limit: 512M
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
command: server /data --console-address :${MINIO_CONSOLE_PORT:-9001}
volumes:
- /home/$USER/Docker/maxun/minio:/data
backend:
image: getmaxun/maxun-backend:latest
container_name: maxun-backend
ports:
- "127.0.0.1:${BACKEND_PORT:-8080}:${BACKEND_PORT:-8080}"
env_file: .env
environment:
BACKEND_URL: ${BACKEND_URL}
PLAYWRIGHT_BROWSERS_PATH: /ms-playwright
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 0
# DEBUG: pw:api
# PWDEBUG: 1 # Enables debugging
CHROMIUM_FLAGS: '--disable-gpu --no-sandbox --headless=new'
security_opt:
- seccomp=unconfined # This might help with browser sandbox issues
shm_size: '2gb'
mem_limit: 4g
depends_on:
- postgres
- minio
volumes:
- /var/run/dbus:/var/run/dbus
frontend:
image: getmaxun/maxun-frontend:latest
container_name: maxun-frontend
mem_limit: 512M
ports:
- "127.0.0.1:${FRONTEND_PORT:-5173}:5173"
env_file: .env
environment:
PUBLIC_URL: ${PUBLIC_URL}
BACKEND_URL: ${BACKEND_URL}
depends_on:
- backend
```
8. Ctrl + x, Y, Enter will save your changes
9. This particular setup is "production ready" meaning that maxun is only accessible from localhost. You must configure a reverse proxy to access it!
10. Start maxun `sudo docker compose up -d` or `sudo docker-compose up -d`
11. Wait 30 seconds for everything to come up
12. Access your maxun instance at http://localhost:5173 if using defaults
## Next steps
You will want to configure a reverse proxy. Click on a link below to check out some examples.
- [Nginx](nginx.conf)
================================================
FILE: index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Maxun is an open-source no-code web data extraction platform. Train a robot in 2 minutes to extract data on auto-pilot!"
/>
<link rel="icon" type="image/png" href="src/assets/maxunlogo.png">
<title>Maxun • Turn Websites To APIs • Open Source</title>
</head>
<body>
<script type="module" src="/src/index.tsx"></script>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!-- Vite will automatically inject the necessary scripts here during the build -->
</body>
</html>
================================================
FILE: legacy/server/worker.ts
================================================
import { Queue, Worker } from 'bullmq';
import IORedis from 'ioredis';
import logger from './logger';
import { handleRunRecording } from "./workflow-management/scheduler";
import Robot from './models/Robot';
import { computeNextRun } from './utils/schedule';
const connection = new IORedis({
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT ? parseInt(process.env.REDIS_PORT, 10) : 6379,
maxRetriesPerRequest: null,
password: process.env.REDIS_PASSWORD ? process.env.REDIS_PASSWORD : undefined,
});
connection.on('connect', () => {
console.log('Connected to Redis!');
});
connection.on('error', (err) => {
console.error('Redis connection error:', err);
});
const workflowQueue = new Queue('workflow', { connection });
const worker = new Worker('workflow', async job => {
const { runId, userId, id } = job.data;
try {
const result = await handleRunRecording(id, userId);
return result;
} catch (error) {
logger.error('Error running workflow:', error);
throw error;
}
}, { connection });
worker.on('completed', async (job: any) => {
logger.log(`info`, `Job ${job.id} completed for ${job.data.runId}`);
const robot = await Robot.findOne({ where: { 'recording_meta.id': job.data.id } });
if (robot) {
// Update `lastRunAt` to the current time
const lastRunAt = new Date();
// Compute the next run date
if (robot.schedule && robot.schedule.cronExpression && robot.schedule.timezone) {
const nextRunAt = computeNextRun(robot.schedule.cronExpression, robot.schedule.timezone) || undefined;
await robot.update({
schedule: {
...robot.schedule,
lastRunAt,
nextRunAt,
},
});
} else {
logger.error('Robot schedule, cronExpression, or timezone is missing.');
}
}
});
worker.on('failed', async (job: any, err) => {
logger.log(`error`, `Job ${job.id} failed for ${job.data.runId}:`, err);
});
console.log('Worker is running...');
async function jobCounts() {
const jobCounts = await workflowQueue.getJobCounts();
}
jobCounts();
// We dont need this right now
// process.on('SIGINT', () => {
// console.log('Worker shutting down...');
// process.exit();
// });
export { workflowQueue, worker };
================================================
FILE: legacy/src/AddWhatCondModal.tsx
================================================
import { WhereWhatPair } from "maxun-core";
import { GenericModal } from "../../src/components/ui/GenericModal";
import { modalStyle } from "./AddWhereCondModal";
import { Button, TextField, Typography } from "@mui/material";
import React, { useRef } from "react";
import { KeyValueForm } from "../../src/components/recorder/KeyValueForm";
import { ClearButton } from "../../src/components/ui/buttons/ClearButton";
import { useSocketStore } from "../../src/context/socket";
interface AddWhatCondModalProps {
isOpen: boolean;
onClose: () => void;
pair: WhereWhatPair;
index: number;
}
export const AddWhatCondModal = ({ isOpen, onClose, pair, index }: AddWhatCondModalProps) => {
const [action, setAction] = React.useState<string>('');
const [objectIndex, setObjectIndex] = React.useState<number>(0);
const [args, setArgs] = React.useState<({ type: string, value: (string | number | object | unknown) })[]>([]);
const objectRefs = useRef<({ getObject: () => object } | unknown)[]>([]);
const { socket } = useSocketStore();
const handleSubmit = () => {
const argsArray: (string | number | object | unknown)[] = [];
args.map((arg, index) => {
switch (arg.type) {
case 'string':
case 'number':
argsArray[index] = arg.value;
break;
case 'object':
// @ts-ignore
argsArray[index] = objectRefs.current[arg.value].getObject();
}
})
setArgs([]);
onClose();
pair.what.push({
// @ts-ignore
action,
args: argsArray,
})
socket?.emit('updatePair', { index: index - 1, pair: pair });
}
return (
<GenericModal isOpen={isOpen} onClose={() => {
setArgs([]);
onClose();
}} modalStyle={modalStyle}>
<div>
<Typography sx={{ margin: '20px 0px' }}>Add what condition:</Typography>
<div style={{ margin: '8px' }}>
<Typography>Action:</Typography>
<TextField
size='small'
type="string"
onChange={(e) => setAction(e.target.value)}
value={action}
label='action'
/>
<div>
<Typography>Add new argument of type:</Typography>
<Button onClick={() => setArgs([...args, { type: 'string', value: null }])}>string</Button>
<Button onClick={() => setArgs([...args, { type: 'number', value: null }])}>number</Button>
<Button onClick={() => {
setArgs([...args, { type: 'object', value: objectIndex }])
setObjectIndex(objectIndex + 1);
}}>object</Button>
</div>
<Typography>args:</Typography>
{args.map((arg, index) => {
// @ts-ignore
return (
<div style={{ border: 'solid 1px gray', padding: '10px', display: 'flex', flexDirection: 'row', alignItems: 'center' }}
key={`wrapper-for-${arg.type}-${index}`}>
<ClearButton handleClick={() => {
args.splice(index, 1);
setArgs([...args]);
}} />
<Typography sx={{ margin: '5px' }} key={`number-argument-${arg.type}-${index}`}>{index}: </Typography>
{arg.type === 'string' ?
<TextField
size='small'
type="string"
onChange={(e) => setArgs([
...args.slice(0, index),
{ type: arg.type, value: e.target.value },
...args.slice(index + 1)
])}
value={args[index].value || ''}
label="string"
key={`arg-${arg.type}-${index}`}
/> : arg.type === 'number' ?
<TextField
key={`arg-${arg.type}-${index}`}
size='small'
type="number"
onChange={(e) => setArgs([
...args.slice(0, index),
{ type: arg.type, value: Number(e.target.value) },
...args.slice(index + 1)
])}
value={args[index].value || ''}
label="number"
/> :
<KeyValueForm ref={el =>
//@ts-ignore
objectRefs.current[arg.value] = el} key={`arg-${arg.type}-${index}`} />
}
</div>
)
})}
<Button
onClick={handleSubmit}
variant="outlined"
sx={{
display: "table-cell",
float: "right",
marginRight: "15px",
marginTop: "20px",
}}
>
{"Add Condition"}
</Button>
</div>
</div>
</GenericModal>
)
}
================================================
FILE: legacy/src/AddWhereCondModal.tsx
================================================
import { Dropdown as MuiDropdown } from "../../src/components/ui/DropdownMui";
import {
Button,
MenuItem,
Typography
} from "@mui/material";
import React, { useRef } from "react";
import { GenericModal } from "../../src/components/ui/GenericModal";
import { WhereWhatPair } from "maxun-core";
import { SelectChangeEvent } from "@mui/material/Select/Select";
import { DisplayConditionSettings } from "./DisplayWhereConditionSettings";
import { useSocketStore } from "../../src/context/socket";
interface AddWhereCondModalProps {
isOpen: boolean;
onClose: () => void;
pair: WhereWhatPair;
index: number;
}
export const AddWhereCondModal = ({ isOpen, onClose, pair, index }: AddWhereCondModalProps) => {
const [whereProp, setWhereProp] = React.useState<string>('');
const [additionalSettings, setAdditionalSettings] = React.useState<string>('');
const [newValue, setNewValue] = React.useState<any>('');
const [checked, setChecked] = React.useState<boolean[]>(new Array(Object.keys(pair.where).length).fill(false));
const keyValueFormRef = useRef<{ getObject: () => object }>(null);
const { socket } = useSocketStore();
const handlePropSelect = (event: SelectChangeEvent<string>) => {
setWhereProp(event.target.value);
switch (event.target.value) {
case 'url': setNewValue(''); break;
case 'selectors': setNewValue(['']); break;
case 'default': return;
}
}
const handleSubmit = () => {
switch (whereProp) {
case 'url':
if (additionalSettings === 'string') {
pair.where.url = newValue;
} else {
pair.where.url = { $regex: newValue };
}
break;
case 'selectors':
pair.where.selectors = newValue;
break;
case 'cookies':
pair.where.cookies = keyValueFormRef.current?.getObject() as Record<string, string>
break;
case 'before':
pair.where.$before = newValue;
break;
case 'after':
pair.where.$after = newValue;
break;
case 'boolean':
const booleanArr = [];
const deleteKeys: string[] = [];
for (let i = 0; i < checked.length; i++) {
if (checked[i]) {
if (Object.keys(pair.where)[i]) {
//@ts-ignore
if (pair.where[Object.keys(pair.where)[i]]) {
booleanArr.push({
//@ts-ignore
[Object.keys(pair.where)[i]]: pair.where[Object.keys(pair.where)[i]]
});
}
deleteKeys.push(Object.keys(pair.where)[i]);
}
}
}
// @ts-ignore
deleteKeys.forEach((key: string) => delete pair.where[key]);
//@ts-ignore
pair.where[`$${additionalSettings}`] = booleanArr;
break;
default:
return;
}
onClose();
setWhereProp('');
setAdditionalSettings('');
setNewValue('');
socket?.emit('updatePair', { index: index - 1, pair: pair });
}
return (
<GenericModal isOpen={isOpen} onClose={() => {
setWhereProp('');
setAdditionalSettings('');
setNewValue('');
onClose();
}} modalStyle={modalStyle}>
<div>
<Typography sx={{ margin: '20px 0px' }}>Add where condition:</Typography>
<div style={{ margin: '8px' }}>
<MuiDropdown
id="whereProp"
label="Condition"
value={whereProp}
handleSelect={handlePropSelect}>
<MenuItem value="url">url</MenuItem>
<MenuItem value="selectors">selectors</MenuItem>
<MenuItem value="cookies">cookies</MenuItem>
<MenuItem value="before">before</MenuItem>
<MenuItem value="after">after</MenuItem>
<MenuItem value="boolean">boolean logic</MenuItem>
</MuiDropdown>
</div>
{whereProp ?
<div style={{ margin: '8px' }}>
<DisplayConditionSettings
whereProp={whereProp} additionalSettings={additionalSettings} setAdditionalSettings={setAdditionalSettings}
newValue={newValue} setNewValue={setNewValue} checked={checked} setChecked={setChecked}
keyValueFormRef={keyValueFormRef} whereKeys={Object.keys(pair.where)}
/>
<Button
onClick={handleSubmit}
variant="outlined"
sx={{
display: "table-cell",
float: "right",
marginRight: "15px",
marginTop: "20px",
}}
>
{"Add Condition"}
</Button>
</div>
: null}
</div>
</GenericModal>
)
}
export const modalStyle = {
top: '45%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: '30%',
backgroundColor: 'background.paper',
p: 4,
height: 'fit-content',
display: 'block',
padding: '20px',
};
================================================
FILE: legacy/src/Canvas.tsx
================================================
import React, { memo, useCallback, useEffect, useRef } from 'react';
import { useSocketStore } from '../../context/socket';
import { useGlobalInfoStore } from "../../context/globalInfo";
import { useActionContext } from '../../context/browserActions';
import DatePicker from '../pickers/DatePicker';
import Dropdown from '../pickers/Dropdown';
import TimePicker from '../pickers/TimePicker';
import DateTimeLocalPicker from '../pickers/DateTimeLocalPicker';
import { coordinateMapper } from '../../helpers/coordinateMapper';
interface CreateRefCallback {
(ref: React.RefObject<HTMLCanvasElement>): void;
}
interface CanvasProps {
width: number;
height: number;
onCreateRef: CreateRefCallback;
}
/**
* Interface for mouse's x,y coordinates
*/
export interface Coordinates {
x: number;
y: number;
};
const Canvas = ({ width, height, onCreateRef }: CanvasProps) => {
const canvasRef = useRef<HTMLCanvasElement>(null);
const contextRef = useRef<CanvasRenderingContext2D | null>(null);
const imageDataRef = useRef<ImageData | null>(null);
const animationFrameRef = useRef<number | null>(null);
const { socket } = useSocketStore();
const { setLastAction, lastAction } = useGlobalInfoStore();
const { getText, getList } = useActionContext();
const getTextRef = useRef(getText);
const getListRef = useRef(getList);
const MOUSE_MOVE_THROTTLE = 8;
const lastMouseMoveTime = useRef(0);
const [datePickerInfo, setDatePickerInfo] = React.useState<{
coordinates: Coordinates;
selector: string;
} | null>(null);
const [dropdownInfo, setDropdownInfo] = React.useState<{
coordinates: Coordinates;
selector: string;
options: Array<{
value: string;
text: string;
disabled: boolean;
selected: boolean;
}>;
} | null>(null);
const [timePickerInfo, setTimePickerInfo] = React.useState<{
coordinates: Coordinates;
selector: string;
} | null>(null);
const [dateTimeLocalInfo, setDateTimeLocalInfo] = React.useState<{
coordinates: Coordinates;
selector: string;
} | null>(null);
const notifyLastAction = (action: string) => {
if (lastAction !== action) {
setLastAction(action);
}
};
const lastMousePosition = useRef<Coordinates>({ x: 0, y: 0 });
useEffect(() => {
if (canvasRef.current && !contextRef.current) {
const ctx = canvasRef.current.getContext('2d', {
alpha: false,
desynchronized: true,
willReadFrequently: false
});
if (ctx) {
contextRef.current = ctx;
imageDataRef.current = ctx.createImageData(width, height);
}
}
}, [width, height]);
useEffect(() => {
getTextRef.current = getText;
getListRef.current = getList;
}, [getText, getList]);
useEffect(() => {
if (socket) {
const handleDatePicker = (info: { coordinates: Coordinates, selector: string }) => {
const canvasCoords = coordinateMapper.mapBrowserToCanvas(info.coordinates);
setDatePickerInfo({ ...info, coordinates: canvasCoords });
};
const handleDropdown = (info: {
coordinates: Coordinates,
selector: string,
options: Array<{ value: string; text: string; disabled: boolean; selected: boolean; }>;
}) => {
const canvasCoords = coordinateMapper.mapBrowserToCanvas(info.coordinates);
setDropdownInfo({ ...info, coordinates: canvasCoords });
};
const handleTimePicker = (info: { coordinates: Coordinates, selector: string }) => {
const canvasCoords = coordinateMapper.mapBrowserToCanvas(info.coordinates);
setTimePickerInfo({ ...info, coordinates: canvasCoords });
};
const handleDateTimePicker = (info: { coordinates: Coordinates, selector: string }) => {
const canvasCoords = coordinateMapper.mapBrowserToCanvas(info.coordinates);
setDateTimeLocalInfo({ ...info, coordinates: canvasCoords });
};
socket.on('showDatePicker', handleDatePicker);
socket.on('showDropdown', handleDropdown);
socket.on('showTimePicker', handleTimePicker);
socket.on('showDateTimePicker', handleDateTimePicker);
return () => {
socket.off('showDatePicker', handleDatePicker);
socket.off('showDropdown', handleDropdown);
socket.off('showTimePicker', handleTimePicker);
socket.off('showDateTimePicker', handleDateTimePicker);
};
}
}, [socket]);
const onMouseEvent = useCallback((event: MouseEvent) => {
if (!socket || !canvasRef.current) return;
const rect = canvasRef.current.getBoundingClientRect();
const clickCoordinates = {
x: event.clientX - rect.left,
y: event.clientY - rect.top,
};
const browserCoordinates = coordinateMapper.mapCanvasToBrowser(clickCoordinates);
switch (event.type) {
case 'mousedown':
if (getTextRef.current === true) {
console.log('Capturing Text...');
} else if (getListRef.current === true) {
console.log('Capturing List...');
} else {
socket.emit('input:mousedown', browserCoordinates);
}
notifyLastAction('click');
break;
case 'mousemove': {
const now = performance.now();
if (now - lastMouseMoveTime.current < MOUSE_MOVE_THROTTLE) {
return;
}
lastMouseMoveTime.current = now;
const dx = Math.abs(lastMousePosition.current.x - clickCoordinates.x);
const dy = Math.abs(lastMousePosition.current.y - clickCoordinates.y);
if (dx > 0.5 || dy > 0.5) {
lastMousePosition.current = clickCoordinates;
socket.emit('input:mousemove', browserCoordinates);
notifyLastAction('move');
}
break;
}
case 'wheel': {
const wheelEvent = event as WheelEvent;
const deltaX = Math.round(wheelEvent.deltaX / 5) * 5;
const deltaY = Math.round(wheelEvent.deltaY / 5) * 5;
if (Math.abs(deltaX) > 2 || Math.abs(deltaY) > 2) {
socket.emit('input:wheel', { deltaX, deltaY });
notifyLastAction('scroll');
}
break;
}
default:
return;
}
}, [socket, notifyLastAction]);
const onKeyboardEvent = useCallback((event: KeyboardEvent) => {
if (socket) {
const browserCoordinates = coordinateMapper.mapCanvasToBrowser(lastMousePosition.current);
switch (event.type) {
case 'keydown':
socket.emit('input:keydown', { key: event.key, coordinates: browserCoordinates });
notifyLastAction(`${event.key} pressed`);
break;
case 'keyup':
socket.emit('input:keyup', event.key);
break;
default:
console.log('Default keyEvent registered');
return;
}
}
}, [socket, notifyLastAction]);
useEffect(() => {
const canvas = canvasRef.current;
if (!canvas) return;
onCreateRef(canvasRef);
const options = { passive: true };
canvas.addEventListener('mousedown', onMouseEvent, options);
canvas.addEventListener('mousemove', onMouseEvent, options);
canvas.addEventListener('wheel', onMouseEvent, options);
canvas.addEventListener('keydown', onKeyboardEvent);
canvas.addEventListener('keyup', onKeyboardEvent);
return () => {
canvas.removeEventListener('mousedown', onMouseEvent);
canvas.removeEventListener('mousemove', onMouseEvent);
canvas.removeEventListener('wheel', onMouseEvent);
canvas.removeEventListener('keydown', onKeyboardEvent);
canvas.removeEventListener('keyup', onKeyboardEvent);
};
}, [onMouseEvent, onKeyboardEvent, onCreateRef]);
useEffect(() => {
return () => {
if (animationFrameRef.current) {
cancelAnimationFrame(animationFrameRef.current);
}
};
}, []);
const containerStyle = React.useMemo<React.CSSProperties>(() => ({
borderRadius: '0px 0px 5px 5px',
overflow: 'hidden',
backgroundColor: 'white',
contain: 'layout style paint',
isolation: 'isolate' as React.CSSProperties['isolation']
}), []);
const canvasStyle = React.useMemo(() => ({
display: 'block',
imageRendering: 'crisp-edges' as const,
willChange: 'contents',
backfaceVisibility: 'hidden' as const,
transform: 'translateZ(0)',
maxWidth: '100%',
maxHeight: '100%'
}), []);
return (
<div style={containerStyle}>
<canvas
tabIndex={0}
ref={canvasRef}
height={height}
width={width}
style={canvasStyle}
/>
{datePickerInfo && (
<DatePicker
coordinates={datePickerInfo.coordinates}
selector={datePickerInfo.selector}
onClose={() => setDatePickerInfo(null)}
/>
)}
{dropdownInfo && (
<Dropdown
coordinates={dropdownInfo.coordinates}
selector={dropdownInfo.selector}
options={dropdownInfo.options}
onClose={() => setDropdownInfo(null)}
/>
)}
{timePickerInfo && (
<TimePicker
coordinates={timePickerInfo.coordinates}
selector={timePickerInfo.selector}
onClose={() => setTimePickerInfo(null)}
/>
)}
{dateTimeLocalInfo && (
<DateTimeLocalPicker
coordinates={dateTimeLocalInfo.coordinates}
selector={dateTimeLocalInfo.selector}
onClose={() => setDateTimeLocalInfo(null)}
/>
)}
</div>
);
};
export default memo(Canvas);
================================================
FILE: legacy/src/DisplayWhereConditionSettings.tsx
================================================
import React from "react";
import { Dropdown as MuiDropdown } from "../../src/components/ui/DropdownMui";
import { Checkbox, FormControlLabel, FormGroup, MenuItem, Stack, TextField } from "@mui/material";
import { AddButton } from "../../src/components/ui/buttons/AddButton";
import { RemoveButton } from "../../src/components/ui/buttons/RemoveButton";
import { KeyValueForm } from "../../src/components/recorder/KeyValueForm";
import { WarningText } from "../../src/components/ui/texts";
interface DisplayConditionSettingsProps {
whereProp: string;
additionalSettings: string;
setAdditionalSettings: (value: any) => void;
newValue: any;
setNewValue: (value: any) => void;
keyValueFormRef: React.RefObject<{ getObject: () => object }>;
whereKeys: string[];
checked: boolean[];
setChecked: (value: boolean[]) => void;
}
export const DisplayConditionSettings = (
{ whereProp, setAdditionalSettings, additionalSettings,
setNewValue, newValue, keyValueFormRef, whereKeys, checked, setChecked }
: DisplayConditionSettingsProps) => {
switch (whereProp) {
case 'url':
return (
<React.Fragment>
<MuiDropdown
id="url"
label="type"
value={additionalSettings}
handleSelect={(e) => setAdditionalSettings(e.target.value)}>
<MenuItem value="string">string</MenuItem>
<MenuItem value="regex">regex</MenuItem>
</MuiDropdown>
{additionalSettings ? <TextField
size='small'
type="string"
onChange={(e) => setNewValue(e.target.value)}
value={newValue}
/> : null}
</React.Fragment>
)
case 'selectors':
return (
<React.Fragment>
<Stack direction='column' spacing={2}>
{
newValue.map((selector: string, index: number) => {
return <TextField
key={`whereProp-selector-${index}`}
size='small'
type="string"
onChange={(e) => setNewValue([
...newValue.slice(0, index),
e.target.value,
...newValue.slice(index + 1)
])} />
})
}
</Stack>
<AddButton handleClick={() => setNewValue([...newValue, ''])} />
<RemoveButton handleClick={() => {
const arr = newValue;
arr.splice(-1);
setNewValue([...arr]);
}} />
</React.Fragment>
)
case 'cookies':
return <KeyValueForm ref={keyValueFormRef} />
case 'before':
return <TextField
label='pair id'
size='small'
type="string"
onChange={(e) => setNewValue(e.target.value)}
/>
case 'after':
return <TextField
label='pair id'
size='small'
type="string"
onChange={(e) => setNewValue(e.target.value)}
/>
case 'boolean':
return (
<React.Fragment>
<MuiDropdown
id="boolean"
label="operator"
value={additionalSettings}
handleSelect={(e) => setAdditionalSettings(e.target.value)}>
<MenuItem value="and">and</MenuItem>
<MenuItem value="or">or</MenuItem>
</MuiDropdown>
<FormGroup>
{
whereKeys.map((key: string, index: number) => {
return (
<FormControlLabel control={
<Checkbox
checked={checked[index]}
onChange={() => setChecked([
...checked.slice(0, index),
!checked[index],
...checked.slice(index + 1)
])}
key={`checkbox-${key}-${index}`}
/>
} label={key} key={`control-label-form-${key}-${index}`} />
)
})
}
</FormGroup>
<WarningText>
Choose at least 2 where conditions. Nesting of boolean operators
is possible by adding more conditions.
</WarningText>
</React.Fragment>
)
default:
return null;
}
}
================================================
FILE: legacy/src/Highlighter.tsx
================================================
import React, { useMemo } from 'react';
import styled from "styled-components";
import { coordinateMapper } from '../../helpers/coordinateMapper';
interface HighlighterProps {
unmodifiedRect: DOMRect;
displayedSelector: string;
width: number;
height: number;
canvasRect: DOMRect;
};
const HighlighterComponent = ({ unmodifiedRect, displayedSelector = '', width, height, canvasRect }: HighlighterProps) => {
if (!unmodifiedRect) {
return null;
} else {
const rect = useMemo(() => {
const mappedRect = coordinateMapper.mapBrowserRectToCanvas(unmodifiedRect);
return {
top: mappedRect.top + canvasRect.top + window.scrollY,
left: mappedRect.left + canvasRect.left + window.scrollX,
width: mappedRect.width,
height: mappedRect.height,
};
}, [unmodifiedRect, canvasRect.top, canvasRect.left]);
return (
<div>
<HighlighterOutline
id="Highlighter-outline"
top={rect.top}
left={rect.left}
width={rect.width}
height={rect.height}
/>
{/* <HighlighterLabel
id="Highlighter-label"
top={rect.top + rect.height + 8}
left={rect.left}
>
{displayedSelector}
</HighlighterLabel> */}
</div>
);
}
}
export const Highlighter = React.memo(HighlighterComponent);
const HighlighterOutline = styled.div<HighlighterOutlineProps>`
box-sizing: border-box;
pointer-events: none !important;
position: fixed !important;
background: #ff5d5b26 !important;
outline: 2px solid #ff00c3 !important;
z-index: 2147483647 !important;
top: ${(p: HighlighterOutlineProps) => p.top}px;
left: ${(p: HighlighterOutlineProps) => p.left}px;
width: ${(p: HighlighterOutlineProps) => p.width}px;
height: ${(p: HighlighterOutlineProps) => p.height}px;
`;
const HighlighterLabel = styled.div<HighlighterLabelProps>`
pointer-events: none !important;
position: fixed !important;
background: #080a0b !important;
color: white !important;
padding: 8px !important;
font-family: monospace !important;
border-radius: 5px !important;
z-index: 2147483647 !important;
top: ${(p: HighlighterLabelProps) => p.top}px;
left: ${(p: HighlighterLabelProps) => p.left}px;
`;
interface HighlighterLabelProps {
top: number;
left: number;
}
interface HighlighterOutlineProps {
top: number;
left: number;
width: number;
height: number;
}
================================================
FILE: legacy/src/LeftSidePanel.tsx
================================================
import { Box, Paper, Tab, Tabs } from "@mui/material";
import React, { useCallback, useEffect, useState } from "react";
import { getActiveWorkflow, getParamsOfActiveWorkflow } from "../../src/api/workflow";
import { useSocketStore } from '../../src/context/socket';
import { WhereWhatPair, WorkflowFile } from "maxun-core";
import { emptyWorkflow } from "../../src/shared/constants";
import { LeftSidePanelContent } from "./LeftSidePanelContent";
import { useGlobalInfoStore } from "../../src/context/globalInfo";
import { TabContext, TabPanel } from "@mui/lab";
import { LeftSidePanelSettings } from "./LeftSidePanelSettings";
import { RunSettings } from "../../src/components/run/RunSettings";
const fetchWorkflow = (id: string, callback: (response: WorkflowFile) => void) => {
getActiveWorkflow(id).then(
(response) => {
if (response) {
callback(response);
} else {
throw new Error("No workflow found");
}
}
).catch((error) => { console.log(`Failed to fetch workflow:`,error.message) })
};
interface LeftSidePanelProps {
sidePanelRef: HTMLDivElement | null;
alreadyHasScrollbar: boolean;
recordingName: string;
handleSelectPairForEdit: (pair: WhereWhatPair, index: number) => void;
}
export const LeftSidePanel = (
{ sidePanelRef, alreadyHasScrollbar, recordingName, handleSelectPairForEdit }: LeftSidePanelProps) => {
const [workflow, setWorkflow] = useState<WorkflowFile>(emptyWorkflow);
const [hasScrollbar, setHasScrollbar] = useState<boolean>(alreadyHasScrollbar);
const [tab, setTab] = useState<string>('recording');
const [params, setParams] = useState<string[]>([]);
const [settings, setSettings] = React.useState<RunSettings>({
maxConcurrency: 1,
maxRepeats: 1,
debug: false,
});
const { id, socket } = useSocketStore();
const { setRecordingLength } = useGlobalInfoStore();
const workflowHandler = useCallback((data: WorkflowFile) => {
setWorkflow(data);
setRecordingLength(data.workflow.length);
}, [workflow])
useEffect(() => {
// fetch the workflow every time the id changes
if (id) {
fetchWorkflow(id, workflowHandler);
}
// fetch workflow in 15min intervals
let interval = setInterval(() => {
if (id) {
fetchWorkflow(id, workflowHandler);
}
}, (900 * 60 * 15));
return () => clearInterval(interval)
}, [id]);
useEffect(() => {
if (socket) {
socket.on("workflow", workflowHandler);
}
if (sidePanelRef) {
const workflowListHeight = sidePanelRef.clientHeight;
const innerHeightWithoutNavbar = window.innerHeight - 70;
if (innerHeightWithoutNavbar <= workflowListHeight) {
if (!hasScrollbar) {
setHasScrollbar(true);
}
} else {
if (hasScrollbar && !alreadyHasScrollbar) {
setHasScrollbar(false);
}
}
}
return () => {
socket?.off('workflow', workflowHandler);
}
}, [socket, workflowHandler]);
return (
<Paper
sx={{
height: '100%',
width: '100%',
backgroundColor: 'lightgray',
display: 'flex',
alignItems: 'center',
justifyContent: 'flex-start',
flexDirection: 'column',
}}
>
{/* <SidePanelHeader /> */}
<TabContext value={tab}>
<Tabs value={tab} onChange={(e, newTab) => setTab(newTab)}>
<Tab label="Recording" value='recording' />
<Tab label="Settings" value='settings' onClick={() => {
getParamsOfActiveWorkflow(id).then((response) => {
if (response) {
setParams(response);
}
})
}} />
</Tabs>
<TabPanel value='recording' sx={{ padding: '0px' }}>
<LeftSidePanelContent
workflow={workflow}
updateWorkflow={setWorkflow}
recordingName={recordingName}
handleSelectPairForEdit={handleSelectPairForEdit}
/>
</TabPanel>
<TabPanel value='settings'>
<LeftSidePanelSettings params={params}
settings={settings} setSettings={setSettings} />
</TabPanel>
</TabContext>
</Paper>
);
};
================================================
FILE: legacy/src/LeftSidePanelContent.tsx
================================================
import React, { useCallback, useEffect, useState } from 'react';
import { Pair } from "./Pair";
import { WhereWhatPair, WorkflowFile } from "maxun-core";
import { useSocketStore } from "../../src/context/socket";
import { Socket } from "socket.io-client";
import { AddButton } from "../../src/components/ui/buttons/AddButton";
import { AddPair } from "../../src/api/workflow";
import { GenericModal } from "../../src/components/ui/GenericModal";
import { PairEditForm } from "./PairEditForm";
import { Tooltip } from "@mui/material";
interface LeftSidePanelContentProps {
workflow: WorkflowFile;
updateWorkflow: (workflow: WorkflowFile) => void;
recordingName: string;
handleSelectPairForEdit: (pair: WhereWhatPair, index: number) => void;
}
export const LeftSidePanelContent = ({ workflow, updateWorkflow, recordingName, handleSelectPairForEdit }: LeftSidePanelContentProps) => {
const [activeId, setActiveId] = React.useState<number>(0);
const [breakpoints, setBreakpoints] = React.useState<boolean[]>([]);
const [showEditModal, setShowEditModal] = useState(false);
const { socket } = useSocketStore();
const activePairIdHandler = useCallback((data: string, socket: Socket) => {
setActiveId(parseInt(data) + 1);
// -1 is specially emitted when the interpretation finishes
if (parseInt(data) === -1) {
return;
}
socket.emit('activeIndex', data);
}, [activeId])
const addPair = (pair: WhereWhatPair, index: number) => {
AddPair((index - 1), pair).then((updatedWorkflow) => {
updateWorkflow(updatedWorkflow);
}).catch((error) => {
console.error(error);
});
setShowEditModal(false);
};
useEffect(() => {
socket?.on("activePairId", (data) => activePairIdHandler(data, socket));
return () => {
socket?.off("activePairId", (data) => activePairIdHandler(data, socket));
}
}, [socket, setActiveId]);
const handleBreakpointClick = (id: number) => {
setBreakpoints(oldBreakpoints => {
const newArray = [...oldBreakpoints, ...Array(workflow.workflow.length - oldBreakpoints.length).fill(false)];
newArray[id] = !newArray[id];
socket?.emit("breakpoints", newArray);
return newArray;
});
};
const handleAddPair = () => {
setShowEditModal(true);
};
return (
<div>
<Tooltip title='Add pair' placement='left' arrow>
<div style={{ float: 'right' }}>
<AddButton
handleClick={handleAddPair}
title=''
hoverEffect={false}
style={{ color: 'white', background: '#1976d2' }}
/>
</div>
</Tooltip>
<GenericModal
isOpen={showEditModal}
onClose={() => setShowEditModal(false)}
>
<PairEditForm
onSubmitOfPair={addPair}
numberOfPairs={workflow.workflow.length}
/>
</GenericModal>
<div>
{
workflow.workflow.map((pair, i, workflow,) =>
<Pair
handleBreakpoint={() => handleBreakpointClick(i)}
isActive={activeId === i + 1}
key={workflow.length - i}
index={workflow.length - i}
pair={pair}
updateWorkflow={updateWorkflow}
numberOfPairs={workflow.length}
handleSelectPairForEdit={handleSelectPairForEdit}
/>)
}
</div>
</div>
);
};
================================================
FILE: legacy/src/LeftSidePanelSettings.tsx
================================================
import React from "react";
import { Button, MenuItem, TextField, Typography } from "@mui/material";
import { Dropdown } from "../../src/components/ui/DropdownMui";
import { RunSettings } from "../../src/components/run/RunSettings";
import { useSocketStore } from "../../src/context/socket";
interface LeftSidePanelSettingsProps {
params: any[]
settings: RunSettings,
setSettings: (setting: RunSettings) => void
}
export const LeftSidePanelSettings = ({ params, settings, setSettings }: LeftSidePanelSettingsProps) => {
const { socket } = useSocketStore();
return (
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start' }}>
{params.length !== 0 && (
<React.Fragment>
<Typography>Parameters:</Typography>
{params?.map((item: string, index: number) => {
return <TextField
sx={{ margin: '15px 0px' }}
value={settings.params ? settings.params[item] : ''}
key={`param-${index}`}
type="string"
label={item}
required
onChange={(e) => setSettings(
{
...settings,
params: settings.params
? {
...settings.params,
[item]: e.target.value,
}
: {
[item]: e.target.value,
},
})}
/>
})}
</React.Fragment>
)}
<Typography sx={{ margin: '15px 0px' }}>Interpreter:</Typography>
<TextField
type="number"
label="maxConcurrency"
required
onChange={(e) => setSettings(
{
...settings,
maxConcurrency: parseInt(e.target.value),
})}
defaultValue={settings.maxConcurrency}
/>
<TextField
sx={{ margin: '15px 0px' }}
type="number"
label="maxRepeats"
required
onChange={(e) => setSettings(
{
...settings,
maxRepeats: parseInt(e.target.value),
})}
defaultValue={settings.maxRepeats}
/>
<Dropdown
id="debug"
label="debug"
value={settings.debug?.toString()}
handleSelect={(e) => setSettings(
{
...settings,
debug: e.target.value === "true",
})}
>
<MenuItem value="true">true</MenuItem>
<MenuItem value="false">false</MenuItem>
</Dropdown>
<Button sx={{ margin: '15px 0px' }} variant='contained'
onClick={() => socket?.emit('settings', settings)}>change</Button>
</div>
);
}
================================================
FILE: legacy/src/Pair.tsx
================================================
import React, { FC, useState } from 'react';
import { Stack, Button, IconButton, Tooltip, Badge } from "@mui/material";
import { AddPair, deletePair, UpdatePair } from "../../src/api/workflow";
import { WorkflowFile } from "maxun-core";
import { ClearButton } from "../../src/components/ui/buttons/ClearButton";
import { GenericModal } from "../../src/components/ui/GenericModal";
import { PairEditForm } from "./PairEditForm";
import { PairDisplayDiv } from "./PairDisplayDiv";
import { EditButton } from "../../src/components/ui/buttons/EditButton";
import { BreakpointButton } from "../../src/components/ui/buttons/BreakpointButton";
import VisibilityIcon from '@mui/icons-material/Visibility';
import styled from "styled-components";
import { LoadingButton } from "@mui/lab";
type WhereWhatPair = WorkflowFile["workflow"][number];
interface PairProps {
handleBreakpoint: () => void;
isActive: boolean;
index: number;
pair: WhereWhatPair;
updateWorkflow: (workflow: WorkflowFile) => void;
numberOfPairs: number;
handleSelectPairForEdit: (pair: WhereWhatPair, index: number) => void;
}
export const Pair: FC<PairProps> = (
{
handleBreakpoint, isActive, index,
pair, updateWorkflow, numberOfPairs,
handleSelectPairForEdit
}) => {
const [open, setOpen] = useState(false);
const [edit, setEdit] = useState(false);
const [breakpoint, setBreakpoint] = useState(false);
const enableEdit = () => setEdit(true);
const disableEdit = () => setEdit(false);
const handleOpen = () => setOpen(true);
const handleClose = () => {
setOpen(false);
disableEdit();
}
const handleDelete = () => {
deletePair(index - 1).then((updatedWorkflow) => {
updateWorkflow(updatedWorkflow);
}).catch((error) => {
console.error(error);
});
};
const handleEdit = (pair: WhereWhatPair, newIndex: number) => {
if (newIndex !== index) {
AddPair((newIndex - 1), pair).then((updatedWorkflow) => {
updateWorkflow(updatedWorkflow);
}).catch((error) => {
console.error(error);
});
} else {
UpdatePair((index - 1), pair).then((updatedWorkflow) => {
updateWorkflow(updatedWorkflow);
}).catch((error) => {
console.error(error);
});
}
handleClose();
};
const handleBreakpointClick = () => {
setBreakpoint(!breakpoint);
handleBreakpoint();
};
return (
<PairWrapper isActive={isActive}>
<Stack direction="row">
<div style={{ display: 'flex', maxWidth: '20px', alignItems: 'center', justifyContent: 'center', }}>
{isActive ? <LoadingButton loading variant="text" />
: breakpoint ? <BreakpointButton changeColor={true} handleClick={handleBreakpointClick} />
: <BreakpointButton handleClick={handleBreakpointClick} />
}
</div>
<Badge badgeContent={pair.what.length} color="primary">
<Button sx={{
position: 'relative',
color: 'black',
padding: '5px 20px',
fontSize: '1rem',
textTransform: 'none',
}} variant='text' key={`pair-${index}`}
onClick={() => handleSelectPairForEdit(pair, index)}>
index: {index}
</Button>
</Badge>
<Stack direction="row" spacing={0}
sx={{
color: 'inherit',
"&:hover": {
color: 'inherit',
}
}}>
<Tooltip title="View" placement='right' arrow>
<div>
<ViewButton
handleClick={handleOpen}
/>
</div>
</Tooltip>
<Tooltip title="Raw edit" placement='right' arrow>
<div>
<EditButton
handleClick={() => {
enableEdit();
handleOpen();
}}
/>
</div>
</Tooltip>
<Tooltip title="Delete" placement='right' arrow>
<div>
<ClearButton handleClick={handleDelete} />
</div>
</Tooltip>
</Stack>
</Stack>
<GenericModal isOpen={open} onClose={handleClose}>
{edit
?
<PairEditForm
onSubmitOfPair={handleEdit}
numberOfPairs={numberOfPairs}
index={index.toString()}
where={pair.where ? JSON.stringify(pair.where) : undefined}
what={pair.what ? JSON.stringify(pair.what) : undefined}
id={pair.id}
/>
:
<div>
<PairDisplayDiv
index={index.toString()}
pair={pair}
/>
</div>
}
</GenericModal>
</PairWrapper>
);
};
interface ViewButtonProps {
handleClick: () => void;
}
const ViewButton = ({ handleClick }: ViewButtonProps) => {
return (
<IconButton aria-label="add" size={"small"} onClick={handleClick}
sx={{ color: 'inherit', '&:hover': { color: '#1976d2', backgroundColor: 'transparent' } }}>
<VisibilityIcon />
</IconButton>
);
}
const PairWrapper = styled.div<{ isActive: boolean }>`
background-color: ${({ isActive }) => isActive ? 'rgba(255, 0, 0, 0.1)' : 'transparent'};
border: ${({ isActive }) => isActive ? 'solid 2px red' : 'none'};
display: flex;
flex-direction: row;
flex-grow: 1;
width: 98%;
color: gray;
&:hover {
color: dimgray;
background: ${({ isActive }) => isActive ? 'rgba(255, 0, 0, 0.1)' : 'transparent'};
}
`;
================================================
FILE: legacy/src/PairDetail.tsx
================================================
import React, { useLayoutEffect, useRef, useState } from 'react';
import { WhereWhatPair } from "maxun-core";
import { IconButton, Stack, TextField, Tooltip, Typography } from "@mui/material";
import { Close, KeyboardArrowDown, KeyboardArrowUp } from "@mui/icons-material";
import TreeView from '@mui/lab/TreeView';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
import TreeItem from '@mui/lab/TreeItem';
import { AddButton } from "../../src/components/ui/buttons/AddButton";
import { WarningText } from "../../src/components/ui/texts";
import NotificationImportantIcon from '@mui/icons-material/NotificationImportant';
import { RemoveButton } from "../../src/components/ui/buttons/RemoveButton";
import { AddWhereCondModal } from "./AddWhereCondModal";
import { useSocketStore } from "../../src/context/socket";
import { AddWhatCondModal } from "./AddWhatCondModal";
interface PairDetailProps {
pair: WhereWhatPair | null;
index: number;
}
export const PairDetail = ({ pair, index }: PairDetailProps) => {
const [pairIsSelected, setPairIsSelected] = useState(false);
const [collapseWhere, setCollapseWhere] = useState(true);
const [collapseWhat, setCollapseWhat] = useState(true);
const [rerender, setRerender] = useState(false);
const [expanded, setExpanded] = React.useState<string[]>(
pair ? Object.keys(pair.where).map((key, index) => `${key}-${index}`) : []
);
const [addWhereCondOpen, setAddWhereCondOpen] = useState(false);
const [addWhatCondOpen, setAddWhatCondOpen] = useState(false);
const { socket } = useSocketStore();
const handleCollapseWhere = () => {
setCollapseWhere(!collapseWhere);
}
const handleCollapseWhat = () => {
setCollapseWhat(!collapseWhat);
}
const handleToggle = (event: React.SyntheticEvent, nodeIds: string[]) => {
setExpanded(nodeIds);
};
useLayoutEffect(() => {
if (pair) {
setPairIsSelected(true);
}
}, [pair])
const handleChangeValue = (value: any, where: boolean, keys: (string | number)[]) => {
// a moving reference to internal objects within pair.where or pair.what
let schema: any = where ? pair?.where : pair?.what;
const length = keys.length;
for (let i = 0; i < length - 1; i++) {
const elem = keys[i];
if (!schema[elem]) schema[elem] = {}
schema = schema[elem];
}
schema[keys[length - 1]] = value;
if (pair && socket) {
socket.emit('updatePair', { index: index - 1, pair: pair });
}
setRerender(!rerender);
}
const DisplayValueContent = (value: any, keys: (string | number)[], where: boolean = true) => {
switch (typeof (value)) {
case 'string':
return <TextField
size='small'
type="string"
onChange={(e) => {
try {
const obj = JSON.parse(e.target.value);
handleChangeValue(obj, where, keys);
} catch (error) {
const num = Number(e.target.value);
if (!isNaN(num)) {
handleChangeValue(num, where, keys);
}
handleChangeValue(e.target.value, where, keys)
}
}}
defaultValue={value}
key={`text-field-${keys.join('-')}-${where}`}
/>
case 'number':
return <TextField
size='small'
type="number"
onChange={(e) => handleChangeValue(Number(e.target.value), where, keys)}
defaultValue={value}
key={`text-field-${keys.join('-')}-${where}`}
/>
case 'object':
if (value) {
if (Array.isArray(value)) {
return (
<React.Fragment>
{
value.map((element, index) => {
return DisplayValueContent(element, [...keys, index], where);
})
}
<AddButton handleClick={() => {
let prevValue: any = where ? pair?.where : pair?.what;
for (const key of keys) {
prevValue = prevValue[key];
}
handleChangeValue([...prevValue, ''], where, keys);
setRerender(!rerender);
}} hoverEffect={false} />
<RemoveButton handleClick={() => {
let prevValue: any = where ? pair?.where : pair?.what;
for (const key of keys) {
prevValue = prevValue[key];
}
prevValue.splice(-1);
handleChangeValue(prevValue, where, keys);
setRerender(!rerender);
}} />
</React.Fragment>
)
} else {
return (
<TreeView
defaultCollapseIcon={<ExpandMoreIcon />}
defaultExpandIcon={<ChevronRightIcon />}
sx={{ flexGrow: 1, overflowY: 'auto' }}
key={`tree-view-nested-${keys.join('-')}-${where}`}
>
{
Object.keys(value).map((key2, index) => {
return (
<TreeItem nodeId={`${key2}-${index}`} label={`${key2}:`} key={`${key2}-${index}`}>
{DisplayValueContent(value[key2], [...keys, key2], where)}
</TreeItem>
)
})
}
</TreeView>
)
}
}
break;
default:
return null;
}
}
return (
<React.Fragment>
{pair &&
<React.Fragment>
<AddWhatCondModal isOpen={addWhatCondOpen} onClose={() => setAddWhatCondOpen(false)}
pair={pair} index={index} />
<AddWhereCondModal isOpen={addWhereCondOpen} onClose={() => setAddWhereCondOpen(false)}
pair={pair} index={index} />
</React.Fragment>
}
{
pairIsSelected
? (
<div style={{ padding: '10px', overflow: 'hidden' }}>
<Typography>Pair number: {index}</Typography>
<TextField
size='small'
label='id'
onChange={(e) => {
if (pair && socket) {
socket.emit('updatePair', { index: index - 1, pair: pair });
pair.id = e.target.value;
}
}}
value={pair ? pair.id ? pair.id : '' : ''}
/>
<Stack spacing={0} direction='row' sx={{
display: 'flex',
alignItems: 'center',
background: 'lightGray',
}}>
<CollapseButton
handleClick={handleCollapseWhere}
isCollapsed={collapseWhere}
/>
<Typography>Where</Typography>
<Tooltip title='Add where condition' placement='right'>
<div>
<AddButton handleClick={() => {
setAddWhereCondOpen(true);
}} style={{ color: 'rgba(0, 0, 0, 0.54)', background: 'transparent' }} />
</div>
</Tooltip>
</Stack>
{(collapseWhere && pair && pair.where)
?
<React.Fragment>
{Object.keys(pair.where).map((key, index) => {
return (
<TreeView
expanded={expanded}
defaultCollapseIcon={<ExpandMoreIcon />}
defaultExpandIcon={<ChevronRightIcon />}
sx={{ flexGrow: 1, overflowY: 'auto' }}
onNodeToggle={handleToggle}
key={`tree-view-${key}-${index}`}
>
<TreeItem nodeId={`${key}-${index}`} label={`${key}:`} key={`${key}-${index}`}>
{
// @ts-ignore
DisplayValueContent(pair.where[key], [key])
}
</TreeItem>
</TreeView>
);
})}
</React.Fragment>
: null
}
<Stack spacing={0} direction='row' sx={{
display: 'flex',
alignItems: 'center',
background: 'lightGray',
}}>
<CollapseButton
handleClick={handleCollapseWhat}
isCollapsed={collapseWhat}
/>
<Typography>What</Typography>
<Tooltip title='Add what condition' placement='right'>
<div>
<AddButton handleClick={() => {
setAddWhatCondOpen(true);
}} style={{ color: 'rgba(0, 0, 0, 0.54)', background: 'transparent' }} />
</div>
</Tooltip>
</Stack>
{(collapseWhat && pair && pair.what)
? (
<React.Fragment>
{Object.keys(pair.what).map((key, index) => {
return (
<TreeView
defaultCollapseIcon={<ExpandMoreIcon />}
defaultExpandIcon={<ChevronRightIcon />}
sx={{ flexGrow: 1, overflowY: 'auto' }}
key={`tree-view-2-${key}-${index}`}
>
<TreeItem
nodeId={`${String(key)}-${index}`}
label={`${String(pair.what[index].action)}`}
>
{
// @ts-ignore
DisplayValueContent(pair.what[key], [key], false)
}
<Tooltip title='remove action' placement='left'>
<div style={{ float: 'right' }}>
<CloseButton handleClick={() => {
//@ts-ignore
pair.what.splice(key, 1);
setRerender(!rerender);
}} />
</div>
</Tooltip>
</TreeItem>
</TreeView>
);
})}
</React.Fragment>
)
: null
}
</div>
)
: <WarningText>
<NotificationImportantIcon color="warning" />
No pair from the left side panel was selected.
</WarningText>
}
</React.Fragment>
);
}
interface CollapseButtonProps {
handleClick: () => void;
isCollapsed?: boolean;
}
const CollapseButton = ({ handleClick, isCollapsed }: CollapseButtonProps) => {
return (
<IconButton aria-label="add" size={"small"} onClick={handleClick}>
{isCollapsed ? <KeyboardArrowDown /> : <KeyboardArrowUp />}
</IconButton>
);
}
const CloseButton = ({ handleClick }: CollapseButtonProps) => {
return (
<IconButton aria-label="add" size={"small"} onClick={handleClick}
sx={{ '&:hover': { color: '#1976d2', backgroundColor: 'white' } }}>
<Close />
</IconButton>
);
}
================================================
FILE: legacy/src/PairDisplayDiv.tsx
================================================
import React, { FC } from 'react';
import Typography from '@mui/material/Typography';
import { WhereWhatPair } from "maxun-core";
import styled from "styled-components";
interface PairDisplayDivProps {
index: string;
pair: WhereWhatPair;
}
export const PairDisplayDiv: FC<PairDisplayDivProps> = ({ index, pair }) => {
return (
<div>
<Typography sx={{ marginBottom: '10px', marginTop: '25px' }} id="pair-index" variant="h6" component="h2">
{`Index: ${index}`}
{pair.id ? `, Id: ${pair.id}` : ''}
</Typography>
<Typography id="where-title" variant="h6" component="h2">
{"Where:"}
</Typography>
<DescriptionWrapper id="where-description">
<pre>{JSON.stringify(pair?.where, undefined, 2)}</pre>
</DescriptionWrapper>
<Typography id="what-title" variant="h6" component="h2">
{"What:"}
</Typography>
<DescriptionWrapper id="what-description">
<pre>{JSON.stringify(pair?.what, undefined, 2)}</pre>
</DescriptionWrapper>
</div>
);
}
const DescriptionWrapper = styled.div`
margin: 0;
font-family: "Roboto","Helvetica","Arial",sans-serif;
font-weight: 400;
font-size: 1rem;
line-height: 1.5;
letter-spacing: 0.00938em;
`;
================================================
FILE: legacy/src/PairEditForm.tsx
================================================
import { Button, TextField, Typography } from "@mui/material";
import React, { FC } from "react";
import { Preprocessor, WhereWhatPair } from "maxun-core";
interface PairProps {
index: string;
id?: string;
where: string | null;
what: string | null;
}
interface PairEditFormProps {
onSubmitOfPair: (value: WhereWhatPair, index: number) => void;
numberOfPairs: number;
index?: string;
where?: string;
what?: string;
id?: string;
}
export const PairEditForm: FC<PairEditFormProps> = (
{
onSubmitOfPair,
numberOfPairs,
index,
where,
what,
id,
}) => {
const [pairProps, setPairProps] = React.useState<PairProps>({
where: where || null,
what: what || null,
index: index || "1",
id: id || '',
});
const [errors, setErrors] = React.useState<PairProps>({
where: null,
what: null,
index: '',
});
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const { id, value } = event.target;
if (id === 'index') {
if (parseInt(value, 10) < 1) {
setErrors({ ...errors, index: 'Index must be greater than 0' });
return;
} else {
setErrors({ ...errors, index: '' });
}
}
setPairProps({ ...pairProps, [id]: value });
};
const validateAndSubmit = (event: React.SyntheticEvent) => {
event.preventDefault();
let whereFromPair, whatFromPair;
// validate where
whereFromPair = {
where: pairProps.where && pairProps.where !== '{"url":"","selectors":[""] }'
? JSON.parse(pairProps.where)
: {},
what: [],
};
const validationError = Preprocessor.validateWorkflow({ workflow: [whereFromPair] });
setErrors({ ...errors, where: null });
if (validationError) {
setErrors({ ...errors, where: validationError.message });
return;
}
// validate what
whatFromPair = {
where: {},
what: pairProps.what && pairProps.what !== '[{"action":"","args":[""] }]'
? JSON.parse(pairProps.what) : [],
};
const validationErrorWhat = Preprocessor.validateWorkflow({ workflow: [whatFromPair] });
setErrors({ ...errors, "what": null });
if (validationErrorWhat) {
setErrors({ ...errors, what: validationErrorWhat.message });
return;
}
//validate index
const index = parseInt(pairProps?.index, 10);
if (index > (numberOfPairs + 1)) {
if (numberOfPairs === 0) {
setErrors(prevState => ({
...prevState,
index: 'Index of the first pair must be 1'
}));
return;
} else {
setErrors(prevState => ({
...prevState,
index: `Index must be in the range 1-${numberOfPairs + 1}`
}));
return;
}
} else {
setErrors({ ...errors, index: '' });
}
// submit the pair
onSubmitOfPair(pairProps.id
? {
id: pairProps.id,
where: whereFromPair?.where || {},
what: whatFromPair?.what || [],
}
: {
where: whereFromPair?.where || {},
what: whatFromPair?.what || [],
}
, index);
};
return (
<form
onSubmit={validateAndSubmit}
style={{
display: "grid",
padding: "0px 30px 0px 30px",
marginTop: "36px",
}}
>
<Typography sx={{ marginBottom: '30px' }} variant='h5'>Raw pair edit form:</Typography>
<TextField sx={{
display: "block",
marginBottom: "20px"
}} id="index" label="Index" type="number"
InputProps={{ inputProps: { min: 1 } }}
InputLabelProps={{
shrink: true,
}} defaultValue={pairProps.index}
onChange={handleInputChange}
error={!!errors.index} helperText={errors.index}
required
/>
<TextField sx={{
marginBottom: "20px"
}} id="id" label="Id" type="string"
defaultValue={pairProps.id}
onChange={handleInputChange}
/>
<TextField multiline sx={{ marginBottom: "20px" }}
id="where" label="Where" variant="outlined" onChange={handleInputChange}
defaultValue={where || '{"url":"","selectors":[""]}'}
error={!!errors.where} helperText={errors.where} />
<TextField multiline sx={{ marginBottom: "20px" }}
id="what" label="What" variant="outlined" onChange={handleInputChange}
defaultValue={what || '[{"action":"","args":[""]}]'}
error={!!errors.what} helperText={errors.what} />
<Button
type="submit"
variant="contained"
sx={{ padding: "8px 20px", }}
>
Save
</Button>
</form>
);
};
================================================
FILE: legacy/src/Renderer.tsx
================================================
export class CanvasRenderer {
private canvas: HTMLCanvasElement;
private ctx: CanvasRenderingContext2D;
private offscreenCanvas: OffscreenCanvas | null = null;
private offscreenCtx: CanvasRenderingContext2D | null = null;
private lastFrameRequest: number | null = null;
private imageCache: Map<string, HTMLImageElement> = new Map();
private consecutiveFrameCount: number = 0;
private lastDrawTime: number = 0;
private memoryCheckCounter: number = 0;
private lastMemoryCheck: number = 0;
private memoryThreshold: number = 100000000; // 100MB
constructor(canvas: HTMLCanvasElement) {
this.canvas = canvas;
// Get 2D context with optimized settings
const ctx = canvas.getContext('2d', {
alpha: false, // Disable alpha for better performance
desynchronized: true, // Reduce latency when possible
});
if (!ctx) {
throw new Error('Could not get 2D context from canvas');
}
this.ctx = ctx;
// Apply performance optimizations
this.ctx.imageSmoothingEnabled = false;
// Set up offscreen canvas if supported
if (typeof OffscreenCanvas !== 'undefined') {
this.offscreenCanvas = new OffscreenCanvas(canvas.width, canvas.height);
const offCtx = this.offscreenCanvas.getContext('2d', {
alpha: false
});
if (offCtx) {
this.offscreenCtx = offCtx as unknown as CanvasRenderingContext2D;
this.offscreenCtx.imageSmoothingEnabled = false;
}
}
// Initial timestamp
this.lastDrawTime = performance.now();
this.lastMemoryCheck = performance.now();
}
/**
* Renders a screenshot to the canvas, optimized for performance
*/
public drawScreenshot(
screenshot: string | ImageBitmap | HTMLImageElement,
x: number = 0,
y: number = 0,
width?: number,
height?: number
): void {
// Cancel any pending frame request
if (this.lastFrameRequest !== null) {
cancelAnimationFrame(this.lastFrameRequest);
}
// Check memory usage periodically
this.memoryCheckCounter++;
const now = performance.now();
if (this.memoryCheckCounter >= 30 || now - this.lastMemoryCheck > 5000) {
this.checkMemoryUsage();
this.memoryCheckCounter = 0;
this.lastMemoryCheck = now;
}
// Request a new frame
this.lastFrameRequest = requestAnimationFrame(() => {
this.renderFrame(screenshot, x, y, width, height);
});
}
private renderFrame(
screenshot: string | ImageBitmap | HTMLImageElement,
x: number,
y: number,
width?: number,
height?: number
): void {
// Target context (offscreen if available, otherwise main)
const targetCtx = this.offscreenCtx || this.ctx;
// Start timing the render
const startTime = performance.now();
const timeSinceLastDraw = startTime - this.lastDrawTime;
// Adaptive frame skipping for high-frequency updates
// If we're getting updates faster than 60fps and this isn't the first frame
if (timeSinceLastDraw < 16 && this.consecutiveFrameCount > 5) {
this.consecutiveFrameCount++;
// Skip some frames when we're getting excessive updates
if (this.consecutiveFrameCount % 2 !== 0) {
return;
}
} else {
this.consecutiveFrameCount = 0;
}
try {
if (typeof screenshot === 'string') {
// Check if we have this image in cache
let img = this.imageCache.get(screenshot);
if (!img) {
img = new Image();
img.src = screenshot;
this.imageCache.set(screenshot, img);
// If image isn't loaded yet, draw when it loads
if (!img.complete) {
img.onload = () => {
if (img) {
this.drawScreenshot(img, x, y, width, height);
}
};
return;
}
}
targetCtx.drawImage(
img,
x, y,
width || img.width,
height || img.height
);
} else {
// Draw ImageBitmap or HTMLImageElement directly
targetCtx.drawImage(
screenshot,
x, y,
width || screenshot.width,
height || screenshot.height
);
}
// If using offscreen canvas, copy to main canvas
if (this.offscreenCanvas && this.offscreenCtx) {
if ('transferToImageBitmap' in this.offscreenCanvas) {
// Use more efficient transfer when available
const bitmap = this.offscreenCanvas.transferToImageBitmap();
this.ctx.drawImage(bitmap, 0, 0);
} else {
// Fallback to drawImage
this.ctx.drawImage(this.offscreenCanvas, 0, 0);
}
}
// Update timestamp
this.lastDrawTime = performance.now();
} catch (error) {
console.error('Error rendering frame:', error);
}
}
/**
* Checks current memory usage and cleans up if necessary
*/
private checkMemoryUsage(): void {
if (window.performance && (performance as any).memory) {
const memory = (performance as any).memory;
if (memory.usedJSHeapSize > this.memoryThreshold) {
this.cleanupMemory();
}
}
}
/**
* Cleans up resources to reduce memory usage
*/
private cleanupMemory(): void {
// Limit image cache size
if (this.imageCache.size > 20) {
// Keep only the most recent 10 images
const keysToDelete = Array.from(this.imageCache.keys()).slice(0, this.imageCache.size - 10);
keysToDelete.forEach(key => {
this.imageCache.delete(key);
});
}
// Suggest garbage collection
if (window.gc) {
try {
window.gc();
} catch (e) {
// GC not available, ignore
}
}
}
/**
* Update canvas dimensions
*/
public updateCanvasSize(width: number, height: number): void {
this.canvas.width = width;
this.canvas.height = height;
// Re-apply context settings
this.ctx.imageSmoothingEnabled = false;
// Update offscreen canvas if available
if (this.offscreenCanvas) {
this.offscreenCanvas.width = width;
this.offscreenCanvas.height = height;
if (this.offscreenCtx) {
this.offscreenCtx.imageSmoothingEnabled = false;
}
}
}
/**
* Clean up resources
*/
public dispose(): void {
// Cancel any pending frame requests
if (this.lastFrameRequest !== null) {
cancelAnimationFrame(this.lastFrameRequest);
this.lastFrameRequest = null;
}
// Clear the image cache
this.imageCache.clear();
// Clear canvases
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
if (this.offscreenCtx && this.offscreenCanvas) {
this.offscreenCtx.clearRect(0, 0, this.offscreenCanvas.width, this.offscreenCanvas.height);
}
}
}
================================================
FILE: legacy/src/RobotEdit.tsx
================================================
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { GenericModal } from "../ui/GenericModal";
import { TextField, Typography, Box, Button, IconButton, InputAdornment } from "@mui/material";
import { Visibility, VisibilityOff } from '@mui/icons-material';
import { modalStyle } from "../recorder/AddWhereCondModal";
import { useGlobalInfoStore } from '../../context/globalInfo';
import { getStoredRecording, updateRecording } from '../../api/storage';
import { WhereWhatPair } from 'maxun-core';
interface RobotMeta {
name: string;
id: string;
createdAt: string;
pairs: number;
updatedAt: string;
params: any[];
}
interface RobotWorkflow {
workflow: WhereWhatPair[];
}
interface ScheduleConfig {
runEvery: number;
runEveryUnit: 'MINUTES' | 'HOURS' | 'DAYS' | 'WEEKS' | 'MONTHS';
startFrom: 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY';
atTimeStart?: string;
atTimeEnd?: string;
timezone: string;
lastRunAt?: Date;
nextRunAt?: Date;
cronExpression?: string;
}
export interface RobotSettings {
id: string;
userId?: number;
recording_meta: RobotMeta;
recording: RobotWorkflow;
google_sheet_email?: string | null;
google_sheet_name?: string | null;
google_sheet_id?: string | null;
google_access_token?: string | null;
google_refresh_token?: string | null;
schedule?: ScheduleConfig | null;
}
interface RobotSettingsProps {
isOpen: boolean;
handleStart: (settings: RobotSettings) => void;
handleClose: () => void;
initialSettings?: RobotSettings | null;
}
interface CredentialInfo {
value: string;
type: string;
}
interface Credentials {
[key: string]: CredentialInfo;
}
interface CredentialVisibility {
[key: string]: boolean;
}
interface GroupedCredentials {
passwords: string[];
emails: string[];
usernames: string[];
others: string[];
}
interface ScrapeListLimit {
pairIndex: number;
actionIndex: number;
argIndex: number;
currentLimit: number;
}
export const RobotEditModal = ({ isOpen, handleStart, handleClose, initialSettings }: RobotSettingsProps) => {
const { t } = useTranslation();
const [credentials, setCredentials] = useState<Credentials>({});
const { recordingId, notify, setRerenderRobots } = useGlobalInfoStore();
const [robot, setRobot] = useState<RobotSettings | null>(null);
const [credentialGroups, setCredentialGroups] = useState<GroupedCredentials>({
passwords: [],
emails: [],
usernames: [],
others: []
});
const [showPasswords, setShowPasswords] = useState<CredentialVisibility>({});
const [scrapeListLimits, setScrapeListLimits] = useState<ScrapeListLimit[]>([]);
const isEmailPattern = (value: string): boolean => {
return value.includes('@');
};
const isUsernameSelector = (selector: string): boolean => {
return selector.toLowerCase().includes('username') ||
selector.toLowerCase().includes('user') ||
selector.toLowerCase().includes('email');
};
const determineCredentialType = (selector: string, info: CredentialInfo): 'password' | 'email' | 'username' | 'other' => {
if (info.type === 'password' || selector.toLowerCase().includes('password')) {
return 'password';
}
if (isEmailPattern(info.value) || selector.toLowerCase().includes('email')) {
return 'email';
}
if (isUsernameSelector(selector)) {
return 'username';
}
return 'other';
};
useEffect(() => {
if (isOpen) {
getRobot();
}
}, [isOpen]);
useEffect(() => {
if (robot?.recording?.workflow) {
const extractedCredentials = extractInitialCredentials(robot.recording.workflow);
setCredentials(extractedCredentials);
setCredentialGroups(groupCredentialsByType(extractedCredentials));
findScrapeListLimits(robot.recording.workflow);
}
}, [robot]);
const findScrapeListLimits = (workflow: WhereWhatPair[]) => {
const limits: ScrapeListLimit[] = [];
workflow.forEach((pair, pairIndex) => {
if (!pair.what) return;
pair.what.forEach((action, actionIndex) => {
if (action.action === 'scrapeList' && action.args && action.args.length > 0) {
// Check if first argument has a limit property
const arg = action.args[0];
if (arg && typeof arg === 'object' && 'limit' in arg) {
limits.push({
pairIndex,
actionIndex,
argIndex: 0,
currentLimit: arg.limit
});
}
}
});
});
setScrapeListLimits(limits);
};
function extractInitialCredentials(workflow: any[]): Credentials {
const credentials: Credentials = {};
const isPrintableCharacter = (char: string): boolean => {
return char.length === 1 && !!char.match(/^[\x20-\x7E]$/);
};
workflow.forEach(step => {
if (!step.what) return;
let currentSelector = '';
let currentValue = '';
let currentType = '';
let i = 0;
while (i < step.what.length) {
const action = step.what[i];
if (!action.action || !action.args?.[0]) {
i++;
continue;
}
const selector = action.args[0];
// Handle full word type actions first
if (action.action === 'type' &&
action.args?.length >= 2 &&
typeof action.args[1] === 'string' &&
action.args[1].length > 1) {
if (!credentials[selector]) {
credentials[selector] = {
value: action.args[1],
type: action.args[2] || 'text'
};
}
i++;
continue;
}
// Handle character-by-character sequences (both type and press)
if ((action.action === 'type' || action.action === 'press') &&
action.args?.length >= 2 &&
typeof action.args[1] === 'string') {
if (selector !== currentSelector) {
if (currentSelector && currentValue) {
credentials[currentSelector] = {
value: currentValue,
type: currentType || 'text'
};
}
currentSelector = selector;
currentValue = credentials[selector]?.value || '';
currentType = action.args[2] || credentials[selector]?.type || 'text';
}
const character = action.args[1];
if (isPrintableCharacter(character)) {
currentValue += character;
} else if (character === 'Backspace') {
currentValue = currentValue.slice(0, -1);
}
if (!currentType && action.args[2]?.toLowerCase() === 'password') {
currentType = 'password';
}
let j = i + 1;
while (j < step.what.length) {
const nextAction = step.what[j];
if (!nextAction.action || !nextAction.args?.[0] ||
nextAction.args[0] !== selector ||
(nextAction.action !== 'type' && nextAction.action !== 'press')) {
break;
}
if (nextAction.args[1] === 'Backspace') {
currentValue = currentValue.slice(0, -1);
} else if (isPrintableCharacter(nextAction.args[1])) {
currentValue += nextAction.args[1];
}
j++;
}
credentials[currentSelector] = {
value: currentValue,
type: currentType
};
i = j;
} else {
i++;
}
}
if (currentSelector && currentValue) {
credentials[currentSelector] = {
value: currentValue,
type: currentType || 'text'
};
}
});
return credentials;
}
const groupCredentialsByType = (credentials: Credentials): GroupedCredentials => {
return Object.entries(credentials).reduce((acc: GroupedCredentials, [selector, info]) => {
const credentialType = determineCredentialType(selector, info);
switch (credentialType) {
case 'password':
acc.passwords.push(selector);
break;
case 'email':
acc.emails.push(selector);
break;
case 'username':
acc.usernames.push(selector);
break;
default:
acc.others.push(selector);
}
return acc;
}, { passwords: [], emails: [], usernames: [], others: [] });
};
const getRobot = async () => {
if (recordingId) {
const robot = await getStoredRecording(recordingId);
setRobot(robot);
} else {
notify('error', t('robot_edit.notifications.update_failed'));
}
};
const handleClickShowPassword = (selector: string) => {
setShowPasswords(prev => ({
...prev,
[selector]: !prev[selector]
}));
};
const handleRobotNameChange = (newName: string) => {
setRobot((prev) =>
prev ? { ...prev, recording_meta: { ...prev.recording_meta, name: newName } } : prev
);
};
const handleCredentialChange = (selector: string, value: string) => {
setCredentials(prev => ({
...prev,
[selector]: {
...prev[selector],
value
}
}));
};
const handleLimitChange = (pairIndex: number, actionIndex: number, argIndex: number, newLimit: number) => {
setRobot((prev) => {
if (!prev) return prev;
const updatedWorkflow = [...prev.recording.workflow];
if (
updatedWorkflow.length > pairIndex &&
updatedWorkflow[pairIndex]?.what &&
updatedWorkflow[pairIndex].what.length > actionIndex &&
updatedWorkflow[pairIndex].what[actionIndex].args &&
updatedWorkflow[pairIndex].what[actionIndex].args.length > argIndex
) {
updatedWorkflow[pairIndex].what[actionIndex].args[argIndex].limit = newLimit;
setScrapeListLimits(prev => {
return prev.map(item => {
if (item.pairIndex === pairIndex &&
item.actionIndex === actionIndex &&
item.argIndex === argIndex) {
return { ...item, currentLimit: newLimit };
}
return item;
});
});
}
return { ...prev, recording: { ...prev.recording, workflow: updatedWorkflow } };
});
};
const handleTargetUrlChange = (newUrl: string) => {
setRobot((prev) => {
if (!prev) return prev;
const updatedWorkflow = [...prev.recording.workflow];
const lastPairIndex = updatedWorkflow.length - 1;
if (lastPairIndex >= 0) {
const gotoAction = updatedWorkflow[lastPairIndex]?.what?.find(action => action.action === "goto");
if (gotoAction && gotoAction.args && gotoAction.args.length > 0) {
gotoAction.args[0] = newUrl;
}
}
return { ...prev, recording: { ...prev.recording, workflow: updatedWorkflow } };
});
};
const renderAllCredentialFields = () => {
return (
<>
{renderCredentialFields(
credentialGroups.usernames,
t('Username'),
'text'
)}
{renderCredentialFields(
credentialGroups.emails,
t('Email'),
'text'
)}
{renderCredentialFields(
credentialGroups.passwords,
t('Password'),
'password'
)}
{renderCredentialFields(
credentialGroups.others,
t('Other'),
'text'
)}
</>
);
};
const renderCredentialFields = (selectors: string[], headerText: string, defaultType: 'text' | 'password' = 'text') => {
if (selectors.length === 0) return null;
return (
<>
{selectors.map((selector, index) => {
const isVisible = showPasswords[selector];
return (
<TextField
key={selector}
type={isVisible ? 'text' : 'password'}
label={headerText === 'Other' ? `${`Input`} ${index + 1}` : headerText}
value={credentials[selector]?.value || ''}
onChange={(e) => handleCredentialChange(selector, e.target.value)}
style={{ marginBottom: '20px' }}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<IconButton
aria-label="Show input"
onClick={() => handleClickShowPassword(selector)}
edge="end"
disabled={!credentials[selector]?.value}
>
{isVisible ? <Visibility /> : <VisibilityOff />}
</IconButton>
</InputAdornment>
),
}}
/>
);
})}
</>
);
};
const renderScrapeListLimitFields = () => {
if (scrapeListLimits.length === 0) return null;
return (
<>
<Typography variant="body1" style={{ marginBottom: '20px' }}>
{t('List Limits')}
</Typography>
{scrapeListLimits.map((limitInfo, index) => (
<TextField
key={`limit-${limitInfo.pairIndex}-${limitInfo.actionIndex}`}
label={`${t('List Limit')} ${index + 1}`}
type="number"
value={limitInfo.currentLimit || ''}
onChange={(e) => {
const value = parseInt(e.target.value, 10);
if (value >= 1) {
handleLimitChange(
limitInfo.pairIndex,
limitInfo.actionIndex,
limitInfo.argIndex,
value
);
}
}}
inputProps={{ min: 1 }}
style={{ marginBottom: '20px' }}
/>
))}
</>
);
};
const handleSave = async () => {
if (!robot) return;
try {
const credentialsForPayload = Object.entries(credentials).reduce((acc, [selector, info]) => {
const enforceType = info.type === 'password' ? 'password' : 'text';
acc[selector] = {
value: info.value,
type: enforceType
};
return acc;
}, {} as Record<string, CredentialInfo>);
const lastPair = robot.recording.workflow[robot.recording.workflow.length - 1];
const targetUrl = lastPair?.what.find(action => action.action === "goto")?.args?.[0];
const payload = {
name: robot.recording_meta.name,
limits: scrapeListLimits.map(limit => ({
pairIndex: limit.pairIndex,
actionIndex: limit.actionIndex,
argIndex: limit.argIndex,
limit: limit.currentLimit
})),
credentials: credentialsForPayload,
targetUrl: targetUrl,
};
const success = await updateRecording(robot.recording_meta.id, payload);
if (success) {
setRerenderRobots(true);
notify('success', t('robot_edit.notifications.update_success'));
handleStart(robot);
handleClose();
} else {
notify('error', t('robot_edit.notifications.update_failed'));
}
} catch (error) {
notify('error', t('robot_edit.notifications.update_error'));
console.error('Error updating robot:', error);
}
};
const lastPair = robot?.recording.workflow[robot?.recording.workflow.length - 1];
const targetUrl = lastPair?.what.find(action => action.action === "goto")?.args?.[0];
return (
<GenericModal
isOpen={isOpen}
onClose={handleClose}
modalStyle={modalStyle}
>
<>
<Typography variant="h5" style={{ marginBottom: '20px' }}>
{t('robot_edit.title')}
</Typography>
<Box style={{ display: 'flex', flexDirection: 'column' }}>
{robot && (
<>
<TextField
label={t('robot_edit.change_name')}
key="Robot Name"
type='text'
value={robot.recording_meta.name}
onChange={(e) => handleRobotNameChange(e.target.value)}
style={{ marginBottom: '20px' }}
/>
<TextField
label="Robot Target URL"
key="Robot Target URL"
type='text'
value={targetUrl || ''}
onChange={(e) => handleTargetUrlChange(e.target.value)}
style={{ marginBottom: '20px' }}
/>
{renderScrapeListLimitFields()}
{(Object.keys(credentials).length > 0) && (
<>
<Typography variant="body1" style={{ marginBottom: '20px' }}>
{t('Input Texts')}
</Typography>
{renderAllCredentialFields()}
</>
)}
<Box mt={2} display="flex" justifyContent="flex-end">
<Button variant="contained" color="primary" onClick={handleSave}>
{t('robot_edit.save')}
</Button>
<Button
onClick={handleClose}
color="primary"
variant="outlined"
style={{ marginLeft: '10px' }}
sx={{
color: '#ff00c3 !important',
borderColor: '#ff00c3 !important',
backgroundColor: 'whitesmoke !important',
}}>
{t('robot_edit.cancel')}
</Button>
</Box>
</>
)}
</Box>
</>
</GenericModal>
);
};
================================================
FILE: legacy/src/RobotSettings.tsx
================================================
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { GenericModal } from "../ui/GenericModal";
import { TextField, Typography, Box } from "@mui/material";
import { useGlobalInfoStore } from '../../context/globalInfo';
import { getStoredRecording } from '../../api/storage';
import { WhereWhatPair } from 'maxun-core';
import { getUserById } from "../../api/auth";
interface RobotMeta {
name: string;
id: string;
createdAt: string;
pairs: number;
updatedAt: string;
params: any[];
}
interface RobotWorkflow {
workflow: WhereWhatPair[];
}
interface ScheduleConfig {
runEvery: number;
runEveryUnit: 'MINUTES' | 'HOURS' | 'DAYS' | 'WEEKS' | 'MONTHS';
startFrom: 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY';
atTimeStart?: string;
atTimeEnd?: string;
timezone: string;
lastRunAt?: Date;
nextRunAt?: Date;
cronExpression?: string;
}
export interface RobotSettings {
id: string;
userId?: number;
recording_meta: RobotMeta;
recording: RobotWorkflow;
google_sheet_email?: string | null;
google_sheet_name?: string | null;
google_sheet_id?: string | null;
google_access_token?: string | null;
google_refresh_token?: string | null;
schedule?: ScheduleConfig | null;
}
interface RobotSettingsProps {
isOpen: boolean;
handleStart: (settings: RobotSettings) => void;
handleClose: () => void;
initialSettings?: RobotSettings | null;
}
export const RobotSettingsModal = ({ isOpen, handleStart, handleClose, initialSettings }: RobotSettingsProps) => {
const { t } = useTranslation();
const [userEmail, setUserEmail] = useState<string | null>(null);
const [robot, setRobot] = useState<RobotSettings | null>(null);
const { recordingId, notify } = useGlobalInfoStore();
useEffect(() => {
if (isOpen) {
getRobot();
}
}, [isOpen]);
const getRobot = async () => {
if (recordingId) {
const robot = await getStoredRecording(recordingId);
setRobot(robot);
} else {
notify('error', t('robot_settings.errors.robot_not_found'));
}
}
const lastPair = robot?.recording.workflow[robot?.recording.workflow.length - 1];
// Find the `goto` action in `what` and retrieve its arguments
const targetUrl = lastPair?.what.find(action => action.action === "goto")?.args?.[0];
useEffect(() => {
const fetchUserEmail = async () => {
if (robot && robot.userId) {
const userData = await getUserById(robot.userId.toString());
if (userData && userData.user) {
setUserEmail(userData.user.email);
}
}
};
fetchUserEmail();
}, [robot?.userId]);
return (
<GenericModal
isOpen={isOpen}
onClose={handleClose}
modalStyle={modalStyle}
>
<>
<Typography variant="h5" style={{ marginBottom: '20px' }}>
{t('robot_settings.title')}
</Typography>
<Box style={{ display: 'flex', flexDirection: 'column' }}>
{
robot && (
<>
<TextField
label={t('robot_settings.target_url')}
key="Robot Target URL"
value={targetUrl}
InputProps={{
readOnly: true,
}}
style={{ marginBottom: '20px' }}
/>
<TextField
label={t('robot_settings.robot_id')}
key="Robot ID"
value={robot.recording_meta.id}
InputProps={{
readOnly: true,
}}
style={{ marginBottom: '20px' }}
/>
{robot.recording.workflow?.[0]?.what?.[0]?.args?.[0]?.limit !== undefined && (
<TextField
label={t('robot_settings.robot_limit')}
type="number"
value={robot.recording.workflow[0].what[0].args[0].limit || ''}
InputProps={{
readOnly: true,
}}
style={{ marginBottom: '20px' }}
/>
)}
<TextField
label={t('robot_settings.created_by_user')}
key="Created By User"
value={userEmail ? userEmail : ''}
InputProps={{
readOnly: true,
}}
style={{ marginBottom: '20px' }}
/>
<TextField
label={t('robot_settings.created_at')}
key="Robot Created At"
value={robot.recording_meta.createdAt}
InputProps={{
readOnly: true,
}}
style={{ marginBottom: '20px' }}
/>
</>
)
}
</Box>
</>
</GenericModal>
);
};
export const modalStyle = {
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
width: "30%",
backgroundColor: "background.paper",
p: 4,
height: "fit-content",
display: "block",
padding: "20px",
};
================================================
FILE: legacy/src/ScheduleSettings.tsx
================================================
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { GenericModal } from "../ui/GenericModal";
import { MenuItem, TextField, Typography, Box } from "@mui/material";
import { Dropdown } from "../ui/DropdownMui";
import Button from "@mui/material/Button";
import { validMomentTimezones } from '../../constants/const';
import { useGlobalInfoStore } from '../../context/globalInfo';
import { getSchedule, deleteSchedule } from '../../api/storage';
interface ScheduleSettingsProps {
isOpen: boolean;
handleStart: (settings: ScheduleSettings) => Promise<boolean>;
handleClose: () => void;
initialSettings?: ScheduleSettings | null;
}
export interface ScheduleSettings {
runEvery: number;
runEveryUnit: string;
startFrom: string;
dayOfMonth?: string;
atTimeStart?: string;
atTimeEnd?: string;
timezone: string;
}
export const ScheduleSettingsModal = ({ isOpen, handleStart, handleClose, initialSettings }: ScheduleSettingsProps) => {
const { t } = useTranslation();
const [schedule, setSchedule] = useState<ScheduleSettings | null>(null);
const [settings, setSettings] = useState<ScheduleSettings>({
runEvery: 1,
runEveryUnit: 'HOURS',
startFrom: 'MONDAY',
dayOfMonth: '1',
atTimeStart: '00:00',
atTimeEnd: '01:00',
timezone: 'UTC'
});
useEffect(() => {
if (initialSettings) {
setSettings(initialSettings);
}
}, [initialSettings]);
const handleChange = (field: keyof ScheduleSettings, value: string | number | boolean) => {
setSettings(prev => ({ ...prev, [field]: value }));
};
const textStyle = {
width: '150px',
height: '52px',
marginRight: '10px',
};
const dropDownStyle = {
marginTop: '2px',
width: '150px',
height: '59px',
marginRight: '10px',
};
const units = [
'MINUTES',
'HOURS',
'DAYS',
'WEEKS',
'MONTHS'
];
const days = [
'MONDAY',
'TUESDAY',
'WEDNESDAY',
'THURSDAY',
'FRIDAY',
'SATURDAY',
'SUNDAY'
];
const { recordingId, notify } = useGlobalInfoStore();
const deleteRobotSchedule = () => {
if (recordingId) {
deleteSchedule(recordingId);
setSchedule(null);
notify('success', t('Schedule deleted successfully'));
} else {
console.error('No recording id provided');
}
setSettings({
runEvery: 1,
runEveryUnit: 'HOURS',
startFrom: 'MONDAY',
dayOfMonth: '',
atTimeStart: '00:00',
atTimeEnd: '01:00',
timezone: 'UTC'
});
};
const getRobotSchedule = async () => {
if (recordingId) {
const scheduleData = await getSchedule(recordingId);
setSchedule(scheduleData);
} else {
console.error('No recording id provided');
}
}
useEffect(() => {
if (isOpen) {
const fetchSchedule = async () => {
await getRobotSchedule();
};
fetchSchedule();
}
}, [isOpen]);
const getDayOrdinal = (day: string | undefined) => {
if (!day) return '';
const lastDigit = day.slice(-1);
const lastTwoDigits = day.slice(-2);
// Special cases for 11, 12, 13
if (['11', '12', '13'].includes(lastTwoDigits)) {
return t('schedule_settings.labels.on_day.th');
}
// Other cases
switch (lastDigit) {
case '1': return t('schedule_settings.labels.on_day.st');
case '2': return t('schedule_settings.labels.on_day.nd');
case '3': return t('schedule_settings.labels.on_day.rd');
default: return t('schedule_settings.labels.on_day.th');
}
};
return (
<GenericModal
isOpen={isOpen}
onClose={handleClose}
modalStyle={modalStyle}
>
<Box sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
padding: '20px',
'& > *': { marginBottom: '20px' },
}}>
<Typography variant="h6" sx={{ marginBottom: '20px' }}>{t('schedule_settings.title')}</Typography>
<>
{schedule !== null ? (
<>
<Typography>{t('schedule_settings.run_every')}: {schedule.runEvery} {schedule.runEveryUnit.toLowerCase()}</Typography>
<Typography>{['MONTHS', 'WEEKS'].includes(settings.runEveryUnit) ? t('schedule_settings.start_from') : t('schedule_settings.start_from')}: {schedule.startFrom.charAt(0).toUpperCase() + schedule.startFrom.slice(1).toLowerCase()}</Typography>
{schedule.runEveryUnit === 'MONTHS' && (
<Typography>{t('schedule_settings.on_day')}: {schedule.dayOfMonth}{getDayOrdinal(schedule.dayOfMonth)} of the month</Typography>
)}
<Typography>{t('schedule_settings.at_around')}: {schedule.atTimeStart}, {schedule.timezone} {t('schedule_settings.timezone')}</Typography>
<Box mt={2} display="flex" justifyContent="space-between">
<Button
onClick={deleteRobotSchedule}
variant="outlined"
color="error"
>
{t('schedule_settings.buttons.delete_schedule')}
</Button>
</Box>
</>
) : (
<>
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
<Typography sx={{ marginRight: '10px' }}>{t('schedule_settings.labels.run_once_every')}</Typography>
<TextField
type="number"
value={settings.runEvery}
onChange={(e) => handleChange('runEvery', parseInt(e.target.value))}
sx={textStyle}
inputProps={{ min: 1 }}
/>
<Dropdown
label=""
id="runEveryUnit"
value={settings.runEveryUnit}
handleSelect={(e) => handleChange('runEveryUnit', e.target.value)}
sx={dropDownStyle}
>
{units.map((unit) => (
<MenuItem key={unit} value={unit}> {unit.charAt(0).toUpperCase() + unit.slice(1).toLowerCase()}</MenuItem>
))}
</Dropdown>
</Box>
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
<Typography sx={{ marginBottom: '5px', marginRight: '25px' }}>
{['MONTHS', 'WEEKS'].includes(settings.runEveryUnit) ? t('schedule_settings.labels.start_from_label') : t('schedule_settings.labels.start_from_label')}
</Typography>
<Dropdown
label=""
id="startFrom"
value={settings.startFrom}
handleSelect={(e) => handleChange('startFrom', e.target.value)}
sx={dropDownStyle}
>
{days.map((day) => (
<MenuItem key={day} value={day}>
{day.charAt(0).toUpperCase() + day.slice(1).toLowerCase()}
</MenuItem>
))}
</Dropdown>
</Box>
{settings.runEveryUnit === 'MONTHS' && (
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
<Typography sx={{ marginBottom: '5px', marginRight: '25px' }}>{t('schedule_settings.labels.on_day_of_month')}</Typography>
<TextField
type="number"
value={settings.dayOfMonth}
onChange={(e) => handleChange('dayOfMonth', e.target.value)}
sx={textStyle}
inputProps={{ min: 1, max: 31 }}
/>
</Box>
)}
{['MINUTES', 'HOURS'].includes(settings.runEveryUnit) ? (
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
<Box sx={{ marginRight: '20px' }}>
<Typography sx={{ marginBottom: '5px' }}>{t('schedule_settings.labels.in_between')}</Typography>
<TextField
type="time"
value={settings.atTimeStart}
onChange={(e) => handleChange('atTimeStart', e.target.value)}
sx={textStyle}
/>
<TextField
type="time"
value={settings.atTimeEnd}
onChange={(e) => handleChange('atTimeEnd', e.target.value)}
sx={textStyle}
/>
</Box>
</Box>
) : (
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
<Typography sx={{ marginBottom: '5px', marginRight: '10px' }}>{t('schedule_settings.at_around')}</Typography>
<TextField
type="time"
value={settings.atTimeStart}
onChange={(e) => handleChange('atTimeStart', e.target.value)}
sx={textStyle}
/>
</Box>
)}
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
<Typography sx={{ marginRight: '10px' }}>{t('schedule_settings.timezone')}</Typography>
<Dropdown
label=""
id="timezone"
value={settings.timezone}
handleSelect={(e) => handleChange('timezone', e.target.value)}
sx={dropDownStyle}
>
{validMomentTimezones.map((tz) => (
<MenuItem key={tz} value={tz}>{tz.charAt(0).toUpperCase() + tz.slice(1).toLowerCase()}</MenuItem>
))}
</Dropdown>
</Box>
<Box mt={2} display="flex" justifyContent="flex-end">
<Button onClick={async () => {
const success = await handleStart(settings);
if (success) {
await getRobotSchedule();
}
}} variant="contained" color="primary">
{t('schedule_settings.buttons.save_schedule')}
</Button>
<Button
onClick={handleClose}
color="primary"
variant="outlined"
style={{ marginLeft: '10px' }}
sx={{
color: '#ff00c3 !important',
borderColor: '#ff00c3 !important',
backgroundColor: 'whitesmoke !important',
}}>
{t('schedule_settings.buttons.cancel')}
</Button>
</Box>
</>
)}
</>
</Box>
</GenericModal>
);
};
const modalStyle = {
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: '40%',
backgroundColor: 'background.paper',
p: 4,
height: 'fit-content',
display: 'block',
padding: '20px',
};
================================================
FILE: legacy/src/coordinateMapper.ts
================================================
import { BROWSER_DEFAULT_HEIGHT, BROWSER_DEFAULT_WIDTH } from "../constants/const";
import { getResponsiveDimensions } from "./dimensionUtils";
export class CoordinateMapper {
private canvasWidth: number;
private canvasHeight: number;
private browserWidth: number;
private browserHeight: number;
private lastBrowserRect: { left: number, top: number, right: number, bottom: number } | null = null;
private lastCanvasRect: DOMRect | null = null;
constructor() {
const dimensions = getResponsiveDimensions();
this.canvasWidth = dimensions.canvasWidth;
this.canvasHeight = dimensions.canvasHeight;
this.browserWidth = BROWSER_DEFAULT_WIDTH;
this.browserHeight = BROWSER_DEFAULT_HEIGHT;
}
mapCanvasToBrowser(coord: { x: number, y: number }): { x: number, y: number } {
return {
x: (coord.x / this.canvasWidth) * this.browserWidth,
y: (coord.y / this.canvasHeight) * this.browserHeight
};
}
mapBrowserToCanvas(coord: { x: number, y: number }): { x: number, y: number } {
return {
x: (coord.x / this.browserWidth) * this.canvasWidth,
y: (coord.y / this.browserHeight) * this.canvasHeight
};
}
mapBrowserRectToCanvas(re
gitextract_d__9ladc/ ├── .dockerignore ├── .github/ │ ├── CODE_OF_CONDUCT.md │ ├── COMMIT_CONVENTION.md │ └── ISSUE_TEMPLATE/ │ └── bug_report.yml ├── .gitignore ├── .sequelizerc ├── CONTRIBUTING.md ├── Dockerfile.backend ├── Dockerfile.frontend ├── ENVEXAMPLE ├── LICENSE ├── README.md ├── SETUP.md ├── browser/ │ ├── .dockerignore │ ├── Dockerfile │ ├── package.json │ ├── server.ts │ └── tsconfig.json ├── docker-compose.yml ├── docker-entrypoint.sh ├── docs/ │ ├── nginx.conf │ └── self-hosting-docker.md ├── index.html ├── legacy/ │ ├── server/ │ │ └── worker.ts │ └── src/ │ ├── AddWhatCondModal.tsx │ ├── AddWhereCondModal.tsx │ ├── Canvas.tsx │ ├── DisplayWhereConditionSettings.tsx │ ├── Highlighter.tsx │ ├── LeftSidePanel.tsx │ ├── LeftSidePanelContent.tsx │ ├── LeftSidePanelSettings.tsx │ ├── Pair.tsx │ ├── PairDetail.tsx │ ├── PairDisplayDiv.tsx │ ├── PairEditForm.tsx │ ├── Renderer.tsx │ ├── RobotEdit.tsx │ ├── RobotSettings.tsx │ ├── ScheduleSettings.tsx │ ├── coordinateMapper.ts │ └── inputHelpers.ts ├── maxun-core/ │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── src/ │ │ ├── browserSide/ │ │ │ └── scraper.js │ │ ├── index.ts │ │ ├── interpret.ts │ │ ├── preprocessor.ts │ │ ├── types/ │ │ │ ├── logic.ts │ │ │ └── workflow.ts │ │ └── utils/ │ │ ├── concurrency.ts │ │ ├── logger.ts │ │ └── utils.ts │ └── tsconfig.json ├── nginx.conf ├── package.json ├── public/ │ └── locales/ │ ├── de.json │ ├── en.json │ ├── es.json │ ├── ja.json │ ├── tr.json │ └── zh.json ├── server/ │ ├── .gitignore │ ├── config/ │ │ └── config.json │ ├── docker-entrypoint.sh │ ├── src/ │ │ ├── api/ │ │ │ ├── record.ts │ │ │ └── sdk.ts │ │ ├── browser-management/ │ │ │ ├── browserConnection.ts │ │ │ ├── classes/ │ │ │ │ ├── BrowserPool.ts │ │ │ │ └── RemoteBrowser.ts │ │ │ ├── controller.ts │ │ │ └── inputHandlers.ts │ │ ├── constants/ │ │ │ └── config.ts │ │ ├── db/ │ │ │ ├── config/ │ │ │ │ └── database.js │ │ │ ├── migrate.js │ │ │ ├── migrations/ │ │ │ │ ├── 20250327111003-add-airtable-columns.js │ │ │ │ └── 20250527105655-add-webhooks.js │ │ │ └── models/ │ │ │ └── index.js │ │ ├── index.ts │ │ ├── logger.ts │ │ ├── markdownify/ │ │ │ ├── markdown.ts │ │ │ └── scrape.ts │ │ ├── mcp-worker.ts │ │ ├── middlewares/ │ │ │ ├── api.ts │ │ │ └── auth.ts │ │ ├── models/ │ │ │ ├── Robot.ts │ │ │ ├── Run.ts │ │ │ ├── User.ts │ │ │ └── associations.ts │ │ ├── pgboss-worker.ts │ │ ├── routes/ │ │ │ ├── auth.ts │ │ │ ├── index.ts │ │ │ ├── proxy.ts │ │ │ ├── record.ts │ │ │ ├── storage.ts │ │ │ ├── webhook.ts │ │ │ └── workflow.ts │ │ ├── schedule-worker.ts │ │ ├── sdk/ │ │ │ ├── browserSide/ │ │ │ │ └── pageAnalyzer.js │ │ │ ├── selectorValidator.ts │ │ │ └── workflowEnricher.ts │ │ ├── server.ts │ │ ├── socket-connection/ │ │ │ └── connection.ts │ │ ├── storage/ │ │ │ ├── db.ts │ │ │ ├── mino.ts │ │ │ ├── pgboss.ts │ │ │ └── schedule.ts │ │ ├── swagger/ │ │ │ └── config.ts │ │ ├── types/ │ │ │ └── index.ts │ │ ├── utils/ │ │ │ ├── analytics.ts │ │ │ ├── api.ts │ │ │ ├── auth.ts │ │ │ ├── env.ts │ │ │ └── schedule.ts │ │ └── workflow-management/ │ │ ├── classes/ │ │ │ ├── Generator.ts │ │ │ └── Interpreter.ts │ │ ├── integrations/ │ │ │ ├── airtable.ts │ │ │ └── gsheet.ts │ │ ├── scheduler/ │ │ │ └── index.ts │ │ ├── selector.ts │ │ ├── storage.ts │ │ └── utils.ts │ ├── start.sh │ ├── tsconfig.json │ └── tsconfig.mcp.json ├── src/ │ ├── App.tsx │ ├── api/ │ │ ├── auth.ts │ │ ├── integration.ts │ │ ├── proxy.ts │ │ ├── recording.ts │ │ ├── storage.ts │ │ ├── webhook.ts │ │ └── workflow.ts │ ├── apiConfig.js │ ├── components/ │ │ ├── action/ │ │ │ ├── ActionDescriptionBox.tsx │ │ │ ├── ActionSettings.tsx │ │ │ └── action-settings/ │ │ │ ├── Scrape.tsx │ │ │ ├── ScrapeSchema.tsx │ │ │ ├── Screenshot.tsx │ │ │ ├── Scroll.tsx │ │ │ └── index.ts │ │ ├── api/ │ │ │ └── ApiKey.tsx │ │ ├── browser/ │ │ │ ├── BrowserContent.tsx │ │ │ ├── BrowserNavBar.tsx │ │ │ ├── BrowserRecordingSave.tsx │ │ │ ├── BrowserTabs.tsx │ │ │ ├── BrowserWindow.tsx │ │ │ └── UrlForm.tsx │ │ ├── dashboard/ │ │ │ ├── MainMenu.tsx │ │ │ ├── NavBar.tsx │ │ │ └── NotFound.tsx │ │ ├── icons/ │ │ │ ├── DiscordIcon.tsx │ │ │ └── RecorderIcon.tsx │ │ ├── integration/ │ │ │ └── IntegrationSettings.tsx │ │ ├── pickers/ │ │ │ ├── DatePicker.tsx │ │ │ ├── DateTimeLocalPicker.tsx │ │ │ ├── Dropdown.tsx │ │ │ └── TimePicker.tsx │ │ ├── proxy/ │ │ │ └── ProxyForm.tsx │ │ ├── recorder/ │ │ │ ├── DOMBrowserRenderer.tsx │ │ │ ├── KeyValueForm.tsx │ │ │ ├── KeyValuePair.tsx │ │ │ ├── RightSidePanel.tsx │ │ │ ├── SaveRecording.tsx │ │ │ └── SidePanelHeader.tsx │ │ ├── robot/ │ │ │ ├── Recordings.tsx │ │ │ ├── RecordingsTable.tsx │ │ │ ├── ToggleButton.tsx │ │ │ └── pages/ │ │ │ ├── RobotConfigPage.tsx │ │ │ ├── RobotCreate.tsx │ │ │ ├── RobotDuplicatePage.tsx │ │ │ ├── RobotEditPage.tsx │ │ │ ├── RobotIntegrationPage.tsx │ │ │ ├── RobotSettingsPage.tsx │ │ │ └── ScheduleSettingsPage.tsx │ │ ├── run/ │ │ │ ├── ColapsibleRow.tsx │ │ │ ├── InterpretationButtons.tsx │ │ │ ├── InterpretationLog.tsx │ │ │ ├── RunContent.tsx │ │ │ ├── RunSettings.tsx │ │ │ ├── Runs.tsx │ │ │ └── RunsTable.tsx │ │ └── ui/ │ │ ├── AlertSnackbar.tsx │ │ ├── Box.tsx │ │ ├── ConfirmationBox.tsx │ │ ├── DropdownMui.tsx │ │ ├── Form.tsx │ │ ├── GenericModal.tsx │ │ ├── Loader.tsx │ │ ├── buttons/ │ │ │ ├── AddButton.tsx │ │ │ ├── BreakpointButton.tsx │ │ │ ├── Buttons.tsx │ │ │ ├── ClearButton.tsx │ │ │ ├── EditButton.tsx │ │ │ └── RemoveButton.tsx │ │ └── texts.tsx │ ├── constants/ │ │ └── const.ts │ ├── context/ │ │ ├── auth.tsx │ │ ├── browserActions.tsx │ │ ├── browserDimensions.tsx │ │ ├── browserSteps.tsx │ │ ├── globalInfo.tsx │ │ ├── socket.tsx │ │ └── theme-provider.tsx │ ├── helpers/ │ │ ├── capturedElementHighlighter.ts │ │ ├── clientListExtractor.ts │ │ ├── clientPaginationDetector.ts │ │ ├── clientSelectorGenerator.ts │ │ ├── dimensionUtils.ts │ │ └── uuid.ts │ ├── i18n.ts │ ├── index.css │ ├── index.tsx │ ├── pages/ │ │ ├── Login.tsx │ │ ├── MainPage.tsx │ │ ├── PageWrapper.tsx │ │ ├── RecordingPage.tsx │ │ └── Register.tsx │ ├── routes/ │ │ └── userRoute.tsx │ └── shared/ │ ├── constants.ts │ └── types.ts ├── tsconfig.json ├── typedoc.json ├── vite-env.d.ts └── vite.config.js
SYMBOL INDEX (753 symbols across 138 files)
FILE: browser/server.ts
constant BROWSER_WS_PORT (line 12) | const BROWSER_WS_PORT = parseInt(process.env.BROWSER_WS_PORT || '3001', ...
constant BROWSER_HEALTH_PORT (line 13) | const BROWSER_HEALTH_PORT = parseInt(process.env.BROWSER_HEALTH_PORT || ...
constant BROWSER_WS_HOST (line 14) | const BROWSER_WS_HOST = process.env.BROWSER_WS_HOST || 'localhost';
function start (line 16) | async function start(): Promise<void> {
function shutdown (line 78) | async function shutdown(): Promise<void> {
FILE: legacy/server/worker.ts
function jobCounts (line 65) | async function jobCounts() {
FILE: legacy/src/AddWhatCondModal.tsx
type AddWhatCondModalProps (line 10) | interface AddWhatCondModalProps {
FILE: legacy/src/AddWhereCondModal.tsx
type AddWhereCondModalProps (line 14) | interface AddWhereCondModalProps {
FILE: legacy/src/Canvas.tsx
type CreateRefCallback (line 11) | interface CreateRefCallback {
type CanvasProps (line 15) | interface CanvasProps {
type Coordinates (line 24) | interface Coordinates {
FILE: legacy/src/DisplayWhereConditionSettings.tsx
type DisplayConditionSettingsProps (line 9) | interface DisplayConditionSettingsProps {
FILE: legacy/src/Highlighter.tsx
type HighlighterProps (line 5) | interface HighlighterProps {
type HighlighterLabelProps (line 77) | interface HighlighterLabelProps {
type HighlighterOutlineProps (line 82) | interface HighlighterOutlineProps {
FILE: legacy/src/LeftSidePanel.tsx
type LeftSidePanelProps (line 25) | interface LeftSidePanelProps {
FILE: legacy/src/LeftSidePanelContent.tsx
type LeftSidePanelContentProps (line 12) | interface LeftSidePanelContentProps {
FILE: legacy/src/LeftSidePanelSettings.tsx
type LeftSidePanelSettingsProps (line 7) | interface LeftSidePanelSettingsProps {
FILE: legacy/src/Pair.tsx
type WhereWhatPair (line 15) | type WhereWhatPair = WorkflowFile["workflow"][number];
type PairProps (line 18) | interface PairProps {
type ViewButtonProps (line 155) | interface ViewButtonProps {
FILE: legacy/src/PairDetail.tsx
type PairDetailProps (line 17) | interface PairDetailProps {
type CollapseButtonProps (line 291) | interface CollapseButtonProps {
FILE: legacy/src/PairDisplayDiv.tsx
type PairDisplayDivProps (line 6) | interface PairDisplayDivProps {
FILE: legacy/src/PairEditForm.tsx
type PairProps (line 5) | interface PairProps {
type PairEditFormProps (line 12) | interface PairEditFormProps {
FILE: legacy/src/Renderer.tsx
class CanvasRenderer (line 1) | class CanvasRenderer {
method constructor (line 14) | constructor(canvas: HTMLCanvasElement) {
method drawScreenshot (line 53) | public drawScreenshot(
method renderFrame (line 81) | private renderFrame(
method checkMemoryUsage (line 167) | private checkMemoryUsage(): void {
method cleanupMemory (line 180) | private cleanupMemory(): void {
method updateCanvasSize (line 203) | public updateCanvasSize(width: number, height: number): void {
method dispose (line 224) | public dispose(): void {
FILE: legacy/src/RobotEdit.tsx
type RobotMeta (line 11) | interface RobotMeta {
type RobotWorkflow (line 20) | interface RobotWorkflow {
type ScheduleConfig (line 24) | interface ScheduleConfig {
type RobotSettings (line 36) | interface RobotSettings {
type RobotSettingsProps (line 49) | interface RobotSettingsProps {
type CredentialInfo (line 56) | interface CredentialInfo {
type Credentials (line 61) | interface Credentials {
type CredentialVisibility (line 65) | interface CredentialVisibility {
type GroupedCredentials (line 69) | interface GroupedCredentials {
type ScrapeListLimit (line 76) | interface ScrapeListLimit {
function extractInitialCredentials (line 161) | function extractInitialCredentials(workflow: any[]): Credentials {
FILE: legacy/src/RobotSettings.tsx
type RobotMeta (line 10) | interface RobotMeta {
type RobotWorkflow (line 19) | interface RobotWorkflow {
type ScheduleConfig (line 23) | interface ScheduleConfig {
type RobotSettings (line 35) | interface RobotSettings {
type RobotSettingsProps (line 48) | interface RobotSettingsProps {
FILE: legacy/src/ScheduleSettings.tsx
type ScheduleSettingsProps (line 11) | interface ScheduleSettingsProps {
type ScheduleSettings (line 18) | interface ScheduleSettings {
FILE: legacy/src/coordinateMapper.ts
class CoordinateMapper (line 4) | class CoordinateMapper {
method constructor (line 13) | constructor() {
method mapCanvasToBrowser (line 21) | mapCanvasToBrowser(coord: { x: number, y: number }): { x: number, y: n...
method mapBrowserToCanvas (line 28) | mapBrowserToCanvas(coord: { x: number, y: number }): { x: number, y: n...
method mapBrowserRectToCanvas (line 35) | mapBrowserRectToCanvas(rect: DOMRect): DOMRect {
method mapCanvasRectToBrowser (line 68) | mapCanvasRectToBrowser(rect: DOMRect): DOMRect {
method updateDimensions (line 83) | updateDimensions(canvasWidth?: number, canvasHeight?: number, browserW...
FILE: maxun-core/src/browserSide/scraper.js
function getBiggestElement (line 5) | function getBiggestElement(selector) {
function GetSelectorStructural (line 23) | function GetSelectorStructural(element) {
function scrapableHeuristics (line 41) | function scrapableHeuristics(maxCountPerPage = 50, minArea = 20000, scro...
function omap (line 193) | function omap(object, f, kf = (x) => x) {
function ofilter (line 200) | function ofilter(object, f) {
function findAllElements (line 207) | function findAllElements(config) {
function getElementValue (line 308) | function getElementValue(element, attribute) {
function getSeedKey (line 343) | function getSeedKey(listObj) {
function getMBEs (line 353) | function getMBEs(elements) {
FILE: maxun-core/src/interpret.ts
type Window (line 22) | interface Window {
type InterpreterOptions (line 38) | interface InterpreterOptions {
class Interpreter (line 57) | class Interpreter extends EventEmitter {
method constructor (line 93) | constructor(workflow: WorkflowFile, options?: Partial<InterpreterOptio...
method abort (line 139) | public abort(): void {
method getIsAborted (line 146) | public getIsAborted(): boolean {
method getSelectors (line 177) | private getSelectors(workflow: Workflow): string[] {
method getState (line 206) | private async getState(page: Page, workflowCopy: Workflow, selectors: ...
method applicable (line 283) | private applicable(where: Where, context: PageState, usedActions: stri...
method carryOutSteps (line 387) | private async carryOutSteps(page: Page, steps: What[]): Promise<void> {
method handlePagination (line 1735) | private async handlePagination(page: Page, config: {
method getMatchingActionId (line 2353) | private getMatchingActionId(workflow: Workflow, pageState: PageState, ...
method removeShadowSelectors (line 2369) | private removeShadowSelectors(workflow: Workflow) {
method removeSpecialSelectors (line 2383) | private removeSpecialSelectors(workflow: Workflow) {
method runLoop (line 2398) | private async runLoop(p: Page, workflow: Workflow) {
method ensureScriptsLoaded (line 2578) | private async ensureScriptsLoaded(page: Page) {
method run (line 2619) | public async run(page: Page, params?: ParamType): Promise<void> {
method stop (line 2664) | public async stop(): Promise<void> {
method cleanup (line 2676) | public async cleanup(): Promise<void> {
FILE: maxun-core/src/preprocessor.ts
class Preprocessor (line 10) | class Preprocessor {
method validateWorkflow (line 11) | static validateWorkflow(workflow: WorkflowFile): any {
method getParams (line 56) | static getParams(workflow: WorkflowFile): string[] {
method extractSelectors (line 79) | static extractSelectors(workflow: Workflow): SelectorArray {
method initWorkflow (line 117) | static initWorkflow(workflow: Workflow, params?: ParamType): Workflow {
FILE: maxun-core/src/types/workflow.ts
type Operator (line 6) | type Operator = typeof operators[number];
type UnaryOperator (line 7) | type UnaryOperator = typeof unaryOperators[number];
type NAryOperator (line 8) | type NAryOperator = typeof naryOperators[number];
type Meta (line 10) | type Meta = typeof meta[number];
type SelectorArray (line 12) | type SelectorArray = string[];
type RegexableString (line 14) | type RegexableString = string | { '$regex': string };
type BaseConditions (line 16) | type BaseConditions = {
type Where (line 22) | type Where =
type MethodNames (line 27) | type MethodNames<T> = {
type CustomFunctions (line 31) | type CustomFunctions = 'scrape' | 'scrapeSchema' | 'scroll' | 'screensho...
type What (line 33) | type What = {
type PageState (line 40) | type PageState = Partial<BaseConditions>;
type ParamType (line 42) | type ParamType = Record<string, any>;
type MetaData (line 44) | type MetaData = {
type WhereWhatPair (line 49) | interface WhereWhatPair {
type Workflow (line 55) | type Workflow = WhereWhatPair[];
type WorkflowFile (line 57) | type WorkflowFile = {
FILE: maxun-core/src/utils/concurrency.ts
class Concurrency (line 4) | class Concurrency {
method constructor (line 29) | constructor(maxConcurrency: number) {
method runNextJob (line 36) | private runNextJob(): void {
method addJob (line 66) | addJob(job: () => Promise<any>): void {
method waitForCompletion (line 84) | waitForCompletion(): Promise<void> {
FILE: maxun-core/src/utils/logger.ts
type Level (line 5) | enum Level {
function logger (line 14) | function logger(
FILE: maxun-core/src/utils/utils.ts
function arrayToObject (line 11) | function arrayToObject(array : any[]) {
FILE: server/src/api/record.ts
function formatRunResponse (line 330) | function formatRunResponse(run: any) {
function createWorkflowAndStoreMetadata (line 480) | async function createWorkflowAndStoreMetadata(id: string, userId: string...
function withTimeout (line 569) | function withTimeout<T>(promise: Promise<T>, timeoutMs: number, operatio...
function triggerIntegrationUpdates (line 578) | async function triggerIntegrationUpdates(runId: string, robotMetaId: str...
function readyForRunHandler (line 604) | async function readyForRunHandler(browserId: string, id: string, userId:...
function resetRecordingState (line 629) | function resetRecordingState(browserId: string, id: string) {
function AddGeneratedFlags (line 634) | function AddGeneratedFlags(workflow: WorkflowFile) {
function executeRun (line 645) | async function executeRun(id: string, userId: string, requestedFormats?:...
function handleRunRecording (line 1195) | async function handleRunRecording(id: string, userId: string, isSDK: boo...
function cleanupSocketConnection (line 1243) | function cleanupSocketConnection(socket: Socket, browserId: string, id: ...
function waitForRunCompletion (line 1265) | async function waitForRunCompletion(runId: string, interval: number = 20...
FILE: server/src/api/sdk.ts
type AuthenticatedRequest (line 23) | interface AuthenticatedRequest extends Request {
function waitForRunCompletion (line 503) | async function waitForRunCompletion(runId: string, interval: number = 20...
FILE: server/src/browser-management/browserConnection.ts
constant CONNECTION_CONFIG (line 8) | const CONNECTION_CONFIG = {
function getBrowserServiceEndpoint (line 18) | async function getBrowserServiceEndpoint(): Promise<string> {
function launchLocalBrowser (line 47) | async function launchLocalBrowser(): Promise<Browser> {
function connectToRemoteBrowser (line 89) | async function connectToRemoteBrowser(retries?: number): Promise<Browser> {
function checkBrowserServiceHealth (line 136) | async function checkBrowserServiceHealth(): Promise<boolean> {
FILE: server/src/browser-management/classes/BrowserPool.ts
type BrowserState (line 11) | type BrowserState = "recording" | "run";
type BrowserPoolInfo (line 13) | interface BrowserPoolInfo {
type PoolDictionary (line 55) | interface PoolDictionary {
class BrowserPool (line 65) | class BrowserPool {
FILE: server/src/browser-management/classes/RemoteBrowser.ts
type Window (line 22) | interface Window {
class RemoteBrowser (line 42) | class RemoteBrowser {
method constructor (line 118) | public constructor(socket: Socket, userId: string, poolId: string, isR...
method normalizeUrl (line 177) | private normalizeUrl(url: string): string {
method shouldEmitUrlChange (line 191) | private shouldEmitUrlChange(newUrl: string): boolean {
method setupScrollEventListener (line 203) | private setupScrollEventListener(): void {
method emitLoadingProgress (line 219) | private emitLoadingProgress(progress: number, pendingRequests: number)...
method setupPageEventListeners (line 228) | private async setupPageEventListeners(page: Page) {
method initializeRRWebRecording (line 289) | private async initializeRRWebRecording(page: Page): Promise<void> {
method getUserAgent (line 388) | private getUserAgent() {
method applyEnhancedFingerprinting (line 404) | private async applyEnhancedFingerprinting(context: BrowserContext): Pr...
method removeAllSocketListeners (line 642) | private removeAllSocketListeners(): void {
method switchOff (line 704) | public async switchOff(): Promise<void> {
FILE: server/src/browser-management/inputHandlers.ts
type CustomActionEventData (line 63) | interface CustomActionEventData {
function evaluateSelector (line 749) | function evaluateSelector(sel: string): Element[] {
function evaluateSelector (line 801) | function evaluateSelector(sel: string): Element[] {
FILE: server/src/constants/config.ts
constant SERVER_PORT (line 1) | const SERVER_PORT = process.env.BACKEND_PORT ? Number(process.env.BACKEN...
constant DEBUG (line 2) | const DEBUG = process.env.DEBUG === 'true'
constant LOGS_PATH (line 3) | const LOGS_PATH = process.env.LOGS_PATH ?? 'server/logs'
constant ANALYTICS_ID (line 4) | const ANALYTICS_ID = 'oss'
FILE: server/src/db/migrate.js
function runMigrations (line 11) | async function runMigrations() {
FILE: server/src/db/migrations/20250527105655-add-webhooks.js
method up (line 4) | async up(queryInterface, Sequelize) {
method down (line 20) | async down(queryInterface, Sequelize) {
FILE: server/src/markdownify/markdown.ts
function parseMarkdown (line 1) | async function parseMarkdown(
function isRelativeUrl (line 103) | function isRelativeUrl(url: string): boolean {
function getDomainFromUrl (line 107) | function getDomainFromUrl(url: string): string | null {
function cleanUrl (line 116) | function cleanUrl(u: string): string {
function cleanAttribute (line 120) | function cleanAttribute(attr: string) {
function tidyHtml (line 124) | function tidyHtml(html: string): string {
function fixBrokenLinks (line 146) | function fixBrokenLinks(md: string): string {
function stripSkipLinks (line 158) | function stripSkipLinks(md: string): string {
FILE: server/src/markdownify/scrape.ts
function gotoWithFallback (line 5) | async function gotoWithFallback(page: any, url: string) {
function convertPageToMarkdown (line 26) | async function convertPageToMarkdown(url: string, page: Page): Promise<s...
function convertPageToHTML (line 80) | async function convertPageToHTML(url: string, page: Page): Promise<strin...
function convertPageToScreenshot (line 133) | async function convertPageToScreenshot(url: string, page: Page, fullPage...
FILE: server/src/mcp-worker.ts
class MaxunMCPWorker (line 15) | class MaxunMCPWorker {
method constructor (line 20) | constructor() {
method makeApiRequest (line 36) | private async makeApiRequest(endpoint: string, options: any = {}) {
method setupTools (line 56) | private setupTools() {
method start (line 327) | async start() {
method stop (line 338) | async stop() {
function main (line 348) | async function main() {
FILE: server/src/middlewares/auth.ts
type UserRequest (line 4) | interface UserRequest extends Request {
FILE: server/src/models/Robot.ts
type RobotMeta (line 5) | interface RobotMeta {
type RobotWorkflow (line 18) | interface RobotWorkflow {
type WebhookConfig (line 22) | interface WebhookConfig {
type RobotAttributes (line 35) | interface RobotAttributes {
type ScheduleConfig (line 55) | interface ScheduleConfig {
type RobotCreationAttributes (line 68) | interface RobotCreationAttributes extends Optional<RobotAttributes, 'id'...
class Robot (line 70) | class Robot extends Model<RobotAttributes, RobotCreationAttributes> impl...
FILE: server/src/models/Run.ts
type InterpreterSettings (line 5) | interface InterpreterSettings {
type RunAttributes (line 11) | interface RunAttributes {
type RunCreationAttributes (line 32) | interface RunCreationAttributes extends Optional<RunAttributes, 'id'> { }
class Run (line 34) | class Run extends Model<RunAttributes, RunCreationAttributes> implements...
FILE: server/src/models/User.ts
type UserAttributes (line 4) | interface UserAttributes {
type UserCreationAttributes (line 16) | interface UserCreationAttributes extends Optional<UserAttributes, 'id'> { }
class User (line 18) | class User extends Model<UserAttributes, UserCreationAttributes> impleme...
FILE: server/src/models/associations.ts
function setupAssociations (line 4) | function setupAssociations() {
FILE: server/src/pgboss-worker.ts
type InitializeBrowserData (line 31) | interface InitializeBrowserData {
type InterpretWorkflow (line 35) | interface InterpretWorkflow {
type StopInterpretWorkflow (line 39) | interface StopInterpretWorkflow {
type DestroyBrowserData (line 43) | interface DestroyBrowserData {
type ExecuteRunData (line 48) | interface ExecuteRunData {
type AbortRunData (line 54) | interface AbortRunData {
function extractJobData (line 68) | function extractJobData<T>(job: Job<T> | Job<T>[]): T {
function AddGeneratedFlags (line 78) | function AddGeneratedFlags(workflow: WorkflowFile) {
function withTimeout (line 89) | function withTimeout<T>(promise: Promise<T>, timeoutMs: number, operatio...
function triggerIntegrationUpdates (line 98) | async function triggerIntegrationUpdates(runId: string, robotMetaId: str...
function processRunExecution (line 127) | async function processRunExecution(job: Job<ExecuteRunData>) {
function abortRun (line 788) | async function abortRun(runId: string, userId: string): Promise<boolean> {
function registerWorkerForQueue (line 891) | async function registerWorkerForQueue(queueName: string) {
function registerAbortWorkerForQueue (line 909) | async function registerAbortWorkerForQueue(queueName: string) {
function registerRunExecutionWorker (line 931) | async function registerRunExecutionWorker() {
function registerAbortRunWorker (line 979) | async function registerAbortRunWorker() {
function startWorkers (line 1019) | async function startWorkers() {
FILE: server/src/routes/auth.ts
type SessionData (line 13) | interface SessionData {
type AuthenticatedRequest (line 21) | interface AuthenticatedRequest extends Request {
FILE: server/src/routes/proxy.ts
type AuthenticatedRequest (line 9) | interface AuthenticatedRequest extends Request {
FILE: server/src/routes/record.ts
type AuthenticatedRequest (line 22) | interface AuthenticatedRequest extends Request {
function waitForJobCompletion (line 26) | async function waitForJobCompletion(jobId: string, queueName: string, ti...
FILE: server/src/routes/storage.ts
function formatRunResponse (line 134) | function formatRunResponse(run: any) {
type CredentialInfo (line 159) | interface CredentialInfo {
type Credentials (line 164) | interface Credentials {
function handleWorkflowActions (line 168) | function handleWorkflowActions(workflow: any[], credentials: Credentials) {
function AddGeneratedFlags (line 895) | function AddGeneratedFlags(workflow: WorkflowFile) {
constant MAX_CONSECUTIVE_ERRORS (line 1227) | const MAX_CONSECUTIVE_ERRORS = 3;
constant CIRCUIT_BREAKER_COOLDOWN (line 1228) | const CIRCUIT_BREAKER_COOLDOWN = 30000;
function processQueuedRuns (line 1231) | async function processQueuedRuns() {
function recoverOrphanedRuns (line 1313) | async function recoverOrphanedRuns() {
FILE: server/src/routes/webhook.ts
type AuthenticatedRequest (line 9) | interface AuthenticatedRequest extends Request {
type WebhookConfig (line 13) | interface WebhookConfig {
FILE: server/src/schedule-worker.ts
type ScheduledWorkflowData (line 24) | interface ScheduledWorkflowData {
function processScheduledWorkflow (line 32) | async function processScheduledWorkflow(job: Job<ScheduledWorkflowData>) {
function registerScheduledWorkflowWorker (line 73) | async function registerScheduledWorkflowWorker() {
function registerWorkerForQueue (line 92) | async function registerWorkerForQueue(queueName: string) {
function startScheduleWorker (line 120) | async function startScheduleWorker() {
FILE: server/src/sdk/browserSide/pageAnalyzer.js
function evaluateSelector (line 12) | function evaluateSelector(selector, doc) {
function cssToXPath (line 44) | function cssToXPath(cssSelector) {
function convertCssPart (line 78) | function convertCssPart(cssPart) {
function generateOptimizedChildXPaths (line 227) | function generateOptimizedChildXPaths(parentElement, listSelector, other...
function getAllDescendantsIncludingShadow (line 272) | function getAllDescendantsIncludingShadow(parentElement) {
function isMeaningfulElement (line 345) | function isMeaningfulElement(element) {
function buildOptimizedAbsoluteXPath (line 382) | function buildOptimizedAbsoluteXPath(targetElement, listSelector, listEl...
function getOptimizedStructuralPath (line 407) | function getOptimizedStructuralPath(targetElement, rootElement, otherLis...
function generateOptimizedStructuralStep (line 462) | function generateOptimizedStructuralStep(element, rootElement, addPositi...
function getCommonClassesAcrossLists (line 523) | function getCommonClassesAcrossLists(targetElement, otherListElements) {
function normalizeClasses (line 600) | function normalizeClasses(classList) {
function isAttributeCommonAcrossLists (line 617) | function isAttributeCommonAcrossLists(targetElement, attrName, attrValue...
function getElementPath (line 640) | function getElementPath(element) {
function findCorrespondingElement (line 656) | function findCorrespondingElement(rootElement, path) {
function getSiblingPosition (line 673) | function getSiblingPosition(element, parent) {
function queryElementsInScope (line 683) | function queryElementsInScope(rootElement, tagName) {
function isInShadowDOM (line 694) | function isInShadowDOM(element) {
function deepQuerySelectorAll (line 701) | function deepQuerySelectorAll(root, selector) {
function elementContains (line 725) | function elementContains(container, element) {
function generateMandatoryChildFallbackXPath (line 746) | function generateMandatoryChildFallbackXPath(childElement, parentElement) {
function getMandatoryFallbackPath (line 778) | function getMandatoryFallbackPath(targetElement, rootElement) {
function evaluateXPath (line 804) | function evaluateXPath(xpath, contextNode) {
function createFieldsFromSelectors (line 835) | function createFieldsFromSelectors(selectorObjects, listElements, parent...
function createFieldData (line 902) | function createFieldData(element, selector, forceAttribute) {
function getElementPosition (line 951) | function getElementPosition(element) {
function removeParentChildDuplicates (line 962) | function removeParentChildDuplicates(candidates) {
function removeDuplicateContentAndFormat (line 995) | function removeDuplicateContentAndFormat(candidates) {
function matchesAnyPattern (line 1068) | function matchesAnyPattern(text, patterns) {
function isVisible (line 1072) | function isVisible(element) {
function getClickableElements (line 1085) | function getClickableElements(root) {
function isNearList (line 1098) | function isNearList(element, listCont) {
function isSkippable (line 1123) | function isSkippable(element, listCont) {
function isNextButton (line 1129) | function isNextButton(text, ariaLabel, combinedText) {
function generatePaginationSelector (line 1136) | function generatePaginationSelector(element) {
function getSelectors (line 1168) | function getSelectors(iframeDoc, coordinates) {
function containsNumericPageLinks (line 1844) | function containsNumericPageLinks(container) {
function containsPaginationLinks (line 1861) | function containsPaginationLinks(container) {
function getListContainer (line 1874) | function getListContainer(listElements) {
function findPaginationContainer (line 1893) | function findPaginationContainer(listCont) {
function findLastPageLink (line 1926) | function findLastPageLink(container) {
function detectFromPaginationWrapper (line 1945) | function detectFromPaginationWrapper(wrapper) {
function detectFromNearbyElements (line 2000) | function detectFromNearbyElements(listCont) {
function detectInfiniteScrollScore (line 2061) | function detectInfiniteScrollScore() {
function detectFromFullDocument (line 2102) | function detectFromFullDocument(listCont) {
FILE: server/src/sdk/selectorValidator.ts
type SelectorInput (line 9) | interface SelectorInput {
type EnrichedSelector (line 14) | interface EnrichedSelector {
type ValidationResult (line 21) | interface ValidationResult {
class SelectorValidator (line 27) | class SelectorValidator {
method initialize (line 35) | async initialize(page: Page, url: string): Promise<void> {
method validateSelector (line 54) | async validateSelector(input: SelectorInput): Promise<ValidationResult> {
method validateSchemaFields (line 113) | async validateSchemaFields(
method validateListFields (line 143) | async validateListFields(config: {
method detectInputType (line 187) | async detectInputType(selector: string): Promise<string> {
method autoDetectListFields (line 229) | async autoDetectListFields(listSelector: string): Promise<{
method autoDetectPagination (line 294) | async autoDetectPagination(listSelector: string): Promise<{
method testLoadMoreButton (line 394) | private async testLoadMoreButton(buttonSelector: string, listSelector:...
method testInfiniteScrollByScrolling (line 492) | private async testInfiniteScrollByScrolling(listSelector: string): Pro...
method close (line 581) | async close(): Promise<void> {
FILE: server/src/sdk/workflowEnricher.ts
type SimplifiedAction (line 13) | interface SimplifiedAction {
type RegexableString (line 20) | type RegexableString = string | { $regex: string };
type SimplifiedWorkflowPair (line 22) | interface SimplifiedWorkflowPair {
class WorkflowEnricher (line 30) | class WorkflowEnricher {
method enrichWorkflow (line 34) | static async enrichWorkflow(
method generateWorkflowFromPrompt (line 276) | static async generateWorkflowFromPrompt(
method analyzePageGroups (line 354) | private static async analyzePageGroups(validator: SelectorValidator): ...
method getLLMDecisionWithVision (line 384) | private static async getLLMDecisionWithVision(
method fallbackHeuristicDecision (line 617) | private static fallbackHeuristicDecision(prompt: string, elementGroups...
method generateFieldLabels (line 649) | private static async generateFieldLabels(
method generateFieldLabelsBatch (line 706) | private static async generateFieldLabelsBatch(
method filterFieldsByIntent (line 941) | private static async filterFieldsByIntent(
method extractFieldSamples (line 1162) | private static async extractFieldSamples(
method generateListName (line 1246) | private static async generateListName(
method buildWorkflowFromLLMDecision (line 1408) | private static async buildWorkflowFromLLMDecision(
method generateWorkflowFromPromptWithSearch (line 1538) | static async generateWorkflowFromPromptWithSearch(
method parseSearchIntent (line 1637) | private static async parseSearchIntent(
method performDuckDuckGoSearch (line 1789) | private static async performDuckDuckGoSearch(
method selectBestUrlFromResults (line 1891) | private static async selectBestUrlFromResults(
FILE: server/src/server.ts
type PgStoreOptions (line 51) | interface PgStoreOptions {
FILE: server/src/storage/mino.ts
function fixMinioBucketConfiguration (line 12) | async function fixMinioBucketConfiguration(bucketName: string) {
function createBucketWithPolicy (line 53) | async function createBucketWithPolicy(bucketName: string, policy = 'publ...
class BinaryOutputService (line 86) | class BinaryOutputService {
method constructor (line 89) | constructor(bucketName: string) {
method uploadAndStoreBinaryOutput (line 99) | async uploadAndStoreBinaryOutput(run: Run, binaryOutput: Record<string...
method uploadBinaryOutputToMinioBucket (line 193) | async uploadBinaryOutputToMinioBucket(run: Run, key: string, data: Buf...
method getBinaryOutputFromMinioBucket (line 208) | public async getBinaryOutputFromMinioBucket(key: string): Promise<Buff...
FILE: server/src/storage/pgboss.ts
function startPgBossClient (line 38) | async function startPgBossClient(): Promise<void> {
function stopPgBossClient (line 57) | async function stopPgBossClient(): Promise<void> {
FILE: server/src/storage/schedule.ts
function scheduleWorkflow (line 17) | async function scheduleWorkflow(id: string, userId: string, cronExpress...
function cancelScheduledWorkflow (line 47) | async function cancelScheduledWorkflow(robotId: string) {
FILE: server/src/types/index.ts
type InterpreterSettings (line 7) | interface InterpreterSettings {
type Coordinates (line 18) | interface Coordinates {
type DatePickerEventData (line 27) | interface DatePickerEventData {
type ScrollDeltas (line 37) | interface ScrollDeltas {
type RemoteBrowserOptions (line 50) | interface RemoteBrowserOptions {
type KeyboardInput (line 59) | interface KeyboardInput {
type PossibleOverShadow (line 69) | type PossibleOverShadow = {
type Rectangle (line 77) | interface Rectangle extends Coordinates {
type ActionType (line 91) | enum ActionType {
type TagName (line 109) | enum TagName {
type BaseActionInfo (line 124) | interface BaseActionInfo {
type IframeSelector (line 133) | interface IframeSelector {
type ShadowSelector (line 138) | interface ShadowSelector {
type Selectors (line 147) | interface Selectors {
type BaseAction (line 167) | interface BaseAction extends BaseActionInfo{
type KeydownAction (line 185) | interface KeydownAction extends BaseAction {
type InputAction (line 194) | interface InputAction extends BaseAction {
type ClickAction (line 202) | interface ClickAction extends BaseAction {
type DragAndDropAction (line 210) | interface DragAndDropAction extends BaseAction {
type HoverAction (line 222) | interface HoverAction extends BaseAction {
type LoadAction (line 230) | interface LoadAction extends BaseAction {
type NavigateAction (line 239) | interface NavigateAction extends BaseAction {
type WheelAction (line 249) | interface WheelAction extends BaseAction {
type FullScreenshotAction (line 261) | interface FullScreenshotAction extends BaseAction {
type AwaitTextAction (line 269) | interface AwaitTextAction extends BaseAction {
type Action (line 278) | type Action =
FILE: server/src/utils/analytics.ts
constant DEFAULT_DISTINCT_ID (line 12) | const DEFAULT_DISTINCT_ID = "oss";
function getOssVersion (line 14) | function getOssVersion() {
function analyticsMetadata (line 25) | function analyticsMetadata() {
function capture (line 36) | function capture(event: any, data = {}) {
FILE: server/src/utils/schedule.ts
function computeNextRun (line 5) | function computeNextRun(cronExpression: string, timezone: string) {
FILE: server/src/workflow-management/classes/Generator.ts
type PersistedGeneratedData (line 22) | interface PersistedGeneratedData {
type MetaData (line 30) | interface MetaData {
type InputState (line 41) | interface InputState {
class WorkflowGenerator (line 55) | class WorkflowGenerator {
method constructor (line 83) | public constructor(socket: Socket, poolId: string) {
method initializeSocketListeners (line 131) | private initializeSocketListeners() {
method initializeDOMListeners (line 143) | private initializeDOMListeners() {
method getSelectorsForSchema (line 199) | private async getSelectorsForSchema(page: Page, schema: Record<string,...
method getLastUsedSelectorInfo (line 663) | private async getLastUsedSelectorInfo(page: Page, selector: string) {
method removeSocketListeners (line 840) | private removeSocketListeners(): void {
method cleanup (line 916) | public cleanup(): void {
type possibleOverShadow (line 1203) | type possibleOverShadow = {
FILE: server/src/workflow-management/classes/Interpreter.ts
function processWorkflow (line 14) | function processWorkflow(workflow: WorkflowFile, checkLimit: boolean = f...
class WorkflowInterpreter (line 58) | class WorkflowInterpreter {
method constructor (line 174) | constructor(socket: Socket, runId?: string) {
method removePausingListeners (line 184) | private removePausingListeners(): void {
method addToPersistenceBatch (line 781) | private addToPersistenceBatch(actionType: string, data: any, listIndex...
method scheduleBatchFlush (line 797) | private scheduleBatchFlush(): void {
method flushPersistenceBuffer (line 809) | public async flushPersistenceBuffer(): Promise<void> {
FILE: server/src/workflow-management/integrations/airtable.ts
type AirtableUpdateTask (line 7) | interface AirtableUpdateTask {
type SerializableOutput (line 14) | interface SerializableOutput {
constant MAX_RETRIES (line 23) | const MAX_RETRIES = 3;
constant BASE_API_DELAY (line 24) | const BASE_API_DELAY = 2000;
constant MAX_QUEUE_SIZE (line 25) | const MAX_QUEUE_SIZE = 1000;
function addAirtableUpdateTask (line 30) | function addAirtableUpdateTask(runId: string, task: AirtableUpdateTask):...
function refreshAirtableToken (line 45) | async function refreshAirtableToken(refreshToken: string) {
function mergeRelatedData (line 68) | function mergeRelatedData(serializableOutput: SerializableOutput, binary...
function updateAirtable (line 321) | async function updateAirtable(robotId: string, runId: string) {
function withTokenRefresh (line 369) | async function withTokenRefresh<T>(robotId: string, apiCall: (accessToke...
function writeDataToAirtable (line 409) | async function writeDataToAirtable(
function deleteEmptyRecords (line 503) | async function deleteEmptyRecords(base: Airtable.Base, tableName: string...
function retryableAirtableCreate (line 536) | async function retryableAirtableCreate(
function getExistingFields (line 554) | async function getExistingFields(base: Airtable.Base, tableName: string)...
function createAirtableField (line 574) | async function createAirtableField(
function inferFieldType (line 613) | function inferFieldType(value: any): string {
function isValidUrl (line 625) | function isValidUrl(str: string): boolean {
FILE: server/src/workflow-management/integrations/gsheet.ts
type GoogleSheetUpdateTask (line 6) | interface GoogleSheetUpdateTask {
type SerializableOutput (line 13) | interface SerializableOutput {
constant MAX_RETRIES (line 23) | const MAX_RETRIES = 5;
constant MAX_QUEUE_SIZE (line 24) | const MAX_QUEUE_SIZE = 1000;
function addGoogleSheetUpdateTask (line 29) | function addGoogleSheetUpdateTask(runId: string, task: GoogleSheetUpdate...
function updateGoogleSheet (line 44) | async function updateGoogleSheet(robotId: string, runId: string) {
function processOutputType (line 195) | async function processOutputType(
function ensureSheetExists (line 225) | async function ensureSheetExists(spreadsheetId: string, sheetName: strin...
function getOAuth2Client (line 260) | function getOAuth2Client(robotConfig: any) {
function writeDataToSheet (line 275) | async function writeDataToSheet(
FILE: server/src/workflow-management/scheduler/index.ts
function createWorkflowAndStoreMetadata (line 18) | async function createWorkflowAndStoreMetadata(id: string, userId: string) {
function withTimeout (line 104) | function withTimeout<T>(promise: Promise<T>, timeoutMs: number, operatio...
function triggerIntegrationUpdates (line 113) | async function triggerIntegrationUpdates(runId: string, robotMetaId: str...
function AddGeneratedFlags (line 139) | function AddGeneratedFlags(workflow: WorkflowFile) {
function executeRun (line 150) | async function executeRun(id: string, userId: string) {
function readyForRunHandler (line 676) | async function readyForRunHandler(browserId: string, id: string, userId:...
function resetRecordingState (line 697) | function resetRecordingState(browserId: string, id: string) {
function handleRunRecording (line 702) | async function handleRunRecording(id: string, userId: string) {
function cleanupSocketConnection (line 744) | function cleanupSocketConnection(socket: Socket, browserId: string, id: ...
FILE: server/src/workflow-management/selector.ts
type Workflow (line 6) | type Workflow = WorkflowFile["workflow"];
method toJSON (line 803) | toJSON() {
method toJSON (line 1028) | toJSON() {
type Node (line 1103) | type Node = {
type Path (line 1109) | type Path = Node[];
type Limit (line 1111) | enum Limit {
type Options (line 1117) | type Options = {
function finder (line 1133) | function finder(input: Element, options?: Partial<Options>) {
function findRootDocument (line 1175) | function findRootDocument(rootNode: Element | Document, defaults: Option...
function bottomUpSearch (line 1185) | function bottomUpSearch(
function findUniquePath (line 1249) | function findUniquePath(
function selector (line 1268) | function selector(path: Path): string {
function penalty (line 1285) | function penalty(path: Path): number {
function unique (line 1289) | function unique(path: Path) {
function id (line 1302) | function id(input: Element): Node | null {
function attr (line 1313) | function attr(input: Element): Node[] {
function classNames (line 1331) | function classNames(input: Element): Node[] {
function tagName (line 1342) | function tagName(input: Element): Node | null {
function any (line 1353) | function any(): Node {
function index (line 1360) | function index(input: Element): number | null {
function nthChild (line 1387) | function nthChild(node: Node, i: number): Node {
function dispensableNth (line 1394) | function dispensableNth(node: Node) {
function maybe (line 1398) | function maybe(...level: (Node | null)[]): Node[] | null {
function notEmpty (line 1406) | function notEmpty<T>(value: T | null | undefined): value is T {
function sort (line 1420) | function sort(paths: Iterable<Path>): Path[] {
type Scope (line 1424) | type Scope = {
function same (line 1462) | function same(path: Path, input: Element) {
function cssesc (line 1478) | function cssesc(string: string, opt: Partial<typeof defaultOptions> = {}) {
function genAttributeSet (line 1941) | function genAttributeSet(element: HTMLElement, attributes: string[]) {
function isAttributesDefined (line 1950) | function isAttributesDefined(element: HTMLElement, attributes: string[]) {
function genValidAttributeFilter (line 1955) | function genValidAttributeFilter(element: HTMLElement, attributes: strin...
function genSelectorForAttributes (line 1961) | function genSelectorForAttributes(element: HTMLElement, attributes: stri...
function isCharacterNumber (line 1981) | function isCharacterNumber(char: string) {
type SelectorResult (line 2010) | interface SelectorResult {
type DOMContext (line 2023) | interface DOMContext {
function getNonUniqueSelector (line 2189) | function getNonUniqueSelector(element: HTMLElement): string {
function getContextPath (line 2279) | function getContextPath(element: HTMLElement): DOMContext[] {
function getSelectorPath (line 2323) | function getSelectorPath(element: HTMLElement | null): string {
function getNonUniqueSelector (line 2554) | function getNonUniqueSelector(element: HTMLElement): string {
function getContextPath (line 2645) | function getContextPath(element: HTMLElement): DOMContext[] {
function getSelectorPath (line 2689) | function getSelectorPath(element: HTMLElement | null): string {
function getNonUniqueSelector (line 2762) | function getNonUniqueSelector(element: HTMLElement): string {
function getSelectorPath (line 2803) | function getSelectorPath(element: HTMLElement): string {
function getSpecialContextChildren (line 2833) | function getSpecialContextChildren(element: HTMLElement): HTMLElement[] {
function getAllDescendantSelectors (line 2895) | function getAllDescendantSelectors(element: HTMLElement): string[] {
FILE: server/src/workflow-management/storage.ts
function promiseAllP (line 71) | function promiseAllP(items: any, block: any) {
FILE: src/App.tsx
function App (line 8) | function App() {
FILE: src/api/storage.ts
type CredentialInfo (line 8) | interface CredentialInfo {
type Credentials (line 13) | interface Credentials {
type CreateRunResponseWithQueue (line 227) | interface CreateRunResponseWithQueue extends CreateRunResponse {
FILE: src/api/webhook.ts
type WebhookConfig (line 4) | interface WebhookConfig {
type WebhookResponse (line 17) | interface WebhookResponse {
FILE: src/components/action/ActionDescriptionBox.tsx
type CustomBoxContainerProps (line 8) | interface CustomBoxContainerProps {
FILE: src/components/action/ActionSettings.tsx
type ActionSettingsProps (line 7) | interface ActionSettingsProps {
FILE: src/components/action/action-settings/Scrape.tsx
method getSettings (line 9) | getSettings() {
FILE: src/components/action/action-settings/ScrapeSchema.tsx
method getSettings (line 10) | getSettings() {
FILE: src/components/action/action-settings/Screenshot.tsx
method getSettings (line 11) | getSettings() {
FILE: src/components/action/action-settings/Scroll.tsx
method getSettings (line 7) | getSettings() {
FILE: src/components/browser/BrowserNavBar.tsx
type NavBarProps (line 32) | interface NavBarProps {
FILE: src/components/browser/BrowserTabs.tsx
type BrowserTabsProp (line 6) | interface BrowserTabsProp {
type CloseButtonProps (line 78) | interface CloseButtonProps {
FILE: src/components/browser/BrowserWindow.tsx
type ElementInfo (line 20) | interface ElementInfo {
type AttributeOption (line 34) | interface AttributeOption {
FILE: src/components/browser/UrlForm.tsx
type Props (line 10) | type Props = {
FILE: src/components/dashboard/MainMenu.tsx
type MainMenuProps (line 10) | interface MainMenuProps {
FILE: src/components/dashboard/NavBar.tsx
type NavBarProps (line 38) | interface NavBarProps {
FILE: src/components/dashboard/NotFound.tsx
function NotFoundPage (line 3) | function NotFoundPage() {
FILE: src/components/integration/IntegrationSettings.tsx
type IntegrationProps (line 41) | interface IntegrationProps {
type IntegrationSettings (line 48) | interface IntegrationSettings {
FILE: src/components/pickers/DatePicker.tsx
type Coordinates (line 4) | interface Coordinates {
type DatePickerProps (line 9) | interface DatePickerProps {
FILE: src/components/pickers/DateTimeLocalPicker.tsx
type Coordinates (line 4) | interface Coordinates {
type DateTimeLocalPickerProps (line 9) | interface DateTimeLocalPickerProps {
FILE: src/components/pickers/Dropdown.tsx
type Coordinates (line 4) | interface Coordinates {
type DropdownProps (line 9) | interface DropdownProps {
FILE: src/components/pickers/TimePicker.tsx
type Coordinates (line 4) | interface Coordinates {
type TimePickerProps (line 9) | interface TimePickerProps {
FILE: src/components/recorder/DOMBrowserRenderer.tsx
type ElementInfo (line 17) | interface ElementInfo {
type RRWebDOMBrowserRendererProps (line 31) | interface RRWebDOMBrowserRendererProps {
function findScrollableAncestor (line 90) | function findScrollableAncestor(element: Element, root: Element): Elemen...
FILE: src/components/recorder/KeyValueForm.tsx
method getObject (line 11) | getObject() {
FILE: src/components/recorder/KeyValuePair.tsx
type KeyValueFormProps (line 4) | interface KeyValueFormProps {
method getKeyValuePair (line 13) | getKeyValuePair() {
FILE: src/components/recorder/RightSidePanel.tsx
type RightSidePanelProps (line 35) | interface RightSidePanelProps {
function evaluateSelector (line 96) | function evaluateSelector(selector: string, doc: Document): Element[] {
function evaluateSelector (line 390) | function evaluateSelector(selector: string, doc: Document): Element[] {
function evaluateSelector (line 550) | function evaluateSelector(selector: string, doc: Document): Element[] {
function evaluateSelector (line 768) | function evaluateSelector(selector: string, doc: Document): Element[] {
function evaluateSelector (line 973) | function evaluateSelector(selector: string, doc: Document): Element[] {
FILE: src/components/recorder/SaveRecording.tsx
type SaveRecordingProps (line 14) | interface SaveRecordingProps {
FILE: src/components/recorder/SidePanelHeader.tsx
type SidePanelHeaderProps (line 5) | interface SidePanelHeaderProps {
FILE: src/components/robot/Recordings.tsx
type RecordingsProps (line 17) | interface RecordingsProps {
FILE: src/components/robot/RecordingsTable.tsx
type Window (line 47) | interface Window {
type Column (line 52) | interface Column {
type Data (line 60) | interface Data {
type RecordingsTableProps (line 69) | interface RecordingsTableProps {
function useDebounce (line 443) | function useDebounce<T>(value: T, delay: number): T {
type InterpretButtonProps (line 713) | interface InterpretButtonProps {
type ScheduleButtonProps (line 728) | interface ScheduleButtonProps {
type IntegrateButtonProps (line 743) | interface IntegrateButtonProps {
type SettingsButtonProps (line 758) | interface SettingsButtonProps {
type OptionsButtonProps (line 773) | interface OptionsButtonProps {
FILE: src/components/robot/ToggleButton.tsx
type ToggleButtonProps (line 4) | interface ToggleButtonProps {
FILE: src/components/robot/pages/RobotConfigPage.tsx
type RobotConfigPageProps (line 14) | interface RobotConfigPageProps {
FILE: src/components/robot/pages/RobotCreate.tsx
type TabPanelProps (line 32) | interface TabPanelProps {
function TabPanel (line 38) | function TabPanel(props: TabPanelProps) {
FILE: src/components/robot/pages/RobotDuplicatePage.tsx
type RobotDuplicatePageProps (line 9) | interface RobotDuplicatePageProps {
FILE: src/components/robot/pages/RobotEditPage.tsx
type RobotMeta (line 25) | interface RobotMeta {
type RobotWorkflow (line 39) | interface RobotWorkflow {
type ScheduleConfig (line 43) | interface ScheduleConfig {
type RobotSettings (line 62) | interface RobotSettings {
type RobotSettingsProps (line 75) | interface RobotSettingsProps {
type CredentialInfo (line 79) | interface CredentialInfo {
type Credentials (line 84) | interface Credentials {
type CredentialVisibility (line 88) | interface CredentialVisibility {
type GroupedCredentials (line 92) | interface GroupedCredentials {
type ScrapeListLimit (line 99) | interface ScrapeListLimit {
type CrawlConfig (line 106) | interface CrawlConfig {
type SearchConfig (line 117) | interface SearchConfig {
function extractInitialCredentials (line 258) | function extractInitialCredentials(workflow: any[]): Credentials {
FILE: src/components/robot/pages/RobotIntegrationPage.tsx
type IntegrationProps (line 49) | interface IntegrationProps {
type IntegrationSettings (line 55) | interface IntegrationSettings {
FILE: src/components/robot/pages/RobotSettingsPage.tsx
type RobotMeta (line 11) | interface RobotMeta {
type RobotWorkflow (line 24) | interface RobotWorkflow {
type ScheduleConfig (line 28) | interface ScheduleConfig {
type RobotSettings (line 47) | interface RobotSettings {
type RobotSettingsProps (line 60) | interface RobotSettingsProps {
FILE: src/components/robot/pages/ScheduleSettingsPage.tsx
type ScheduleSettingsProps (line 17) | interface ScheduleSettingsProps {
type ScheduleSettings (line 21) | interface ScheduleSettings {
FILE: src/components/run/ColapsibleRow.tsx
function getOrCreateSocket (line 21) | function getOrCreateSocket(browserId: string): Socket {
function cleanupSocketIfUnused (line 42) | function cleanupSocketIfUnused(browserId: string) {
type RunTypeChipProps (line 55) | interface RunTypeChipProps {
type CollapsibleRowProps (line 72) | interface CollapsibleRowProps {
FILE: src/components/run/InterpretationButtons.tsx
type InterpretationButtonsProps (line 10) | interface InterpretationButtonsProps {
type InterpretationInfo (line 15) | interface InterpretationInfo {
FILE: src/components/run/InterpretationLog.tsx
type InterpretationLogProps (line 26) | interface InterpretationLogProps {
FILE: src/components/run/RunContent.tsx
type RunContentProps (line 27) | interface RunContentProps {
FILE: src/components/run/RunSettings.tsx
type RunSettingsProps (line 8) | interface RunSettingsProps {
type RunSettings (line 16) | interface RunSettings {
FILE: src/components/run/Runs.tsx
type RunsProps (line 5) | interface RunsProps {
FILE: src/components/run/RunsTable.tsx
type SortDirection (line 32) | type SortDirection = 'asc' | 'desc' | 'none';
type AccordionSortConfig (line 34) | interface AccordionSortConfig {
type Column (line 41) | interface Column {
type Data (line 49) | interface Data {
type RunsTableProps (line 69) | interface RunsTableProps {
type PaginationState (line 76) | interface PaginationState {
FILE: src/components/ui/AlertSnackbar.tsx
type AlertSnackbarProps (line 13) | interface AlertSnackbarProps {
FILE: src/components/ui/Box.tsx
type BoxProps (line 4) | interface BoxProps {
FILE: src/components/ui/ConfirmationBox.tsx
type ConfirmationBoxProps (line 4) | interface ConfirmationBoxProps {
FILE: src/components/ui/DropdownMui.tsx
type DropdownProps (line 6) | interface DropdownProps {
FILE: src/components/ui/GenericModal.tsx
type ModalProps (line 5) | interface ModalProps {
FILE: src/components/ui/Loader.tsx
type LoaderProps (line 5) | interface LoaderProps {
type StyledParagraphProps (line 25) | interface StyledParagraphProps {
FILE: src/components/ui/buttons/AddButton.tsx
type AddButtonProps (line 5) | interface AddButtonProps {
FILE: src/components/ui/buttons/BreakpointButton.tsx
type BreakpointButtonProps (line 4) | interface BreakpointButtonProps {
FILE: src/components/ui/buttons/ClearButton.tsx
type ClearButtonProps (line 5) | interface ClearButtonProps {
FILE: src/components/ui/buttons/EditButton.tsx
type EditButtonProps (line 5) | interface EditButtonProps {
FILE: src/components/ui/buttons/RemoveButton.tsx
type RemoveButtonProps (line 5) | interface RemoveButtonProps {
FILE: src/constants/const.ts
constant VIEWPORT_W (line 1) | const VIEWPORT_W = 900;
constant VIEWPORT_H (line 2) | const VIEWPORT_H = 400;
constant BROWSER_DEFAULT_WIDTH (line 5) | const BROWSER_DEFAULT_WIDTH = 1280;
constant BROWSER_DEFAULT_HEIGHT (line 6) | const BROWSER_DEFAULT_HEIGHT = 720;
constant ONE_PERCENT_OF_VIEWPORT_W (line 8) | const ONE_PERCENT_OF_VIEWPORT_W = VIEWPORT_W / 100;
constant ONE_PERCENT_OF_VIEWPORT_H (line 9) | const ONE_PERCENT_OF_VIEWPORT_H = VIEWPORT_H / 100;
FILE: src/context/auth.tsx
type AuthProviderProps (line 6) | interface AuthProviderProps {
type ActionType (line 10) | interface ActionType {
type InitialStateType (line 15) | type InitialStateType = {
constant AUTO_LOGOUT_TIME (line 25) | const AUTO_LOGOUT_TIME = 4 * 60 * 60 * 1000;
FILE: src/context/browserActions.tsx
type PaginationType (line 6) | type PaginationType = 'scrollDown' | 'scrollUp' | 'clickNext' | 'clickLo...
type LimitType (line 7) | type LimitType = '10' | '100' | 'custom' | '';
type CaptureStage (line 8) | type CaptureStage = 'initial' | 'pagination' | 'limit' | 'complete' | '';
type ActionType (line 9) | type ActionType = 'text' | 'list' | 'screenshot';
type ActionContextProps (line 11) | interface ActionContextProps {
FILE: src/context/browserDimensions.tsx
type BrowserDimensionsContext (line 4) | interface BrowserDimensionsContext extends AppDimensions {
FILE: src/context/browserSteps.tsx
type TextStep (line 6) | interface TextStep {
type ScreenshotStep (line 17) | interface ScreenshotStep {
type ListStep (line 26) | interface ListStep {
type BrowserStep (line 43) | type BrowserStep = TextStep | ScreenshotStep | ListStep;
type SelectorObject (line 45) | interface SelectorObject {
type BrowserStepsContextType (line 53) | interface BrowserStepsContextType {
FILE: src/context/globalInfo.tsx
type RobotMeta (line 23) | interface RobotMeta {
type RobotWorkflow (line 36) | interface RobotWorkflow {
type ScheduleConfig (line 40) | interface ScheduleConfig {
type RobotSettings (line 52) | interface RobotSettings {
type GlobalInfo (line 65) | interface GlobalInfo {
class GlobalInfoStore (line 118) | class GlobalInfoStore implements Partial<GlobalInfo> {
FILE: src/context/socket.tsx
constant SERVER_ENDPOINT (line 5) | const SERVER_ENDPOINT = apiUrl;
type SocketState (line 7) | interface SocketState {
class SocketStore (line 16) | class SocketStore implements Partial<SocketState> {
FILE: src/helpers/capturedElementHighlighter.ts
class CapturedElementHighlighter (line 5) | class CapturedElementHighlighter {
method applyHighlights (line 12) | public applyHighlights(selectors: Array<{ selector: string }>): void {
method clearHighlights (line 48) | public clearHighlights(): void {
method getIframeDocument (line 61) | private getIframeDocument(): Document | null {
method getCSSSelector (line 74) | private getCSSSelector(selector: string): string {
FILE: src/helpers/clientListExtractor.ts
type TextStep (line 1) | interface TextStep {
type ExtractedListData (line 14) | interface ExtractedListData {
type Field (line 18) | interface Field {
class ClientListExtractor (line 25) | class ClientListExtractor {
method createIndexedXPath (line 414) | private createIndexedXPath(
FILE: src/helpers/clientPaginationDetector.ts
type PaginationDetectionResult (line 9) | type PaginationDetectionResult = {
constant MAX_BUTTON_TEXT_LENGTH (line 16) | const MAX_BUTTON_TEXT_LENGTH = 50;
class ClientPaginationDetector (line 51) | class ClientPaginationDetector {
method autoDetectPagination (line 52) | autoDetectPagination(
method getListContainer (line 116) | private getListContainer(listElements: HTMLElement[]): HTMLElement {
method findPaginationContainer (line 140) | private findPaginationContainer(listContainer: HTMLElement, _doc: Docu...
method containsPaginationLinks (line 176) | private containsPaginationLinks(container: HTMLElement): boolean {
method containsNumericPageLinks (line 194) | private containsNumericPageLinks(container: HTMLElement): boolean {
method detectFromPaginationWrapper (line 218) | private detectFromPaginationWrapper(
method findLastPageLink (line 297) | private findLastPageLink(container: HTMLElement): HTMLElement | null {
method detectFromNearbyElements (line 320) | private detectFromNearbyElements(
method detectFromFullDocument (line 404) | private detectFromFullDocument(
method evaluateSelector (line 479) | private evaluateSelector(selector: string, doc: Document): HTMLElement...
method getClickableElements (line 504) | private getClickableElements(doc: Document): HTMLElement[] {
method getClickableElementsIn (line 513) | private getClickableElementsIn(container: HTMLElement): HTMLElement[] {
method isVisible (line 525) | private isVisible(element: HTMLElement): boolean {
method matchesAnyPattern (line 538) | private matchesAnyPattern(text: string, patterns: RegExp[]): boolean {
method isNearList (line 542) | private isNearList(element: HTMLElement, listContainer: HTMLElement): ...
method detectInfiniteScrollIndicators (line 572) | private detectInfiniteScrollIndicators(doc: Document, _listContainer: ...
method generateSelectorsForElement (line 627) | private generateSelectorsForElement(
FILE: src/helpers/clientSelectorGenerator.ts
type Coordinates (line 1) | interface Coordinates {
type ElementInfo (line 6) | interface ElementInfo {
type Selectors (line 27) | interface Selectors {
type ActionType (line 48) | enum ActionType {
type TagName (line 61) | enum TagName {
type Action (line 73) | interface Action {
type ElementFingerprint (line 84) | interface ElementFingerprint {
type ElementGroup (line 101) | interface ElementGroup {
class ClientSelectorGenerator (line 107) | class ClientSelectorGenerator {
method setListSelector (line 143) | public setListSelector(selector: string): void {
method setGetList (line 147) | public setGetList(getList: boolean): void {
method setPaginationMode (line 151) | public setPaginationMode(paginationMode: boolean): void {
method getCurrentState (line 155) | public getCurrentState(): {
method normalizeClasses (line 170) | private normalizeClasses(classList: DOMTokenList): string {
method getStructuralFingerprint (line 188) | private getStructuralFingerprint(
method calculateSimilarity (line 293) | private calculateSimilarity(
method getAllVisibleElementsWithShadow (line 356) | private getAllVisibleElementsWithShadow(doc: Document): HTMLElement[] {
method analyzeElementGroups (line 391) | public analyzeElementGroups(iframeDoc: Document): void {
method hasAnyMeaningfulChildren (line 547) | private hasAnyMeaningfulChildren(element: HTMLElement): boolean {
method getMeaningfulChildren (line 555) | private getMeaningfulChildren(element: HTMLElement): HTMLElement[] {
method isMeaningfulElementCached (line 592) | private isMeaningfulElementCached(element: HTMLElement): boolean {
method isMeaningfulElement (line 605) | private isMeaningfulElement(element: HTMLElement): boolean {
method isElementGrouped (line 633) | public isElementGrouped(element: HTMLElement): boolean {
method getElementGroup (line 640) | public getElementGroup(element: HTMLElement): ElementGroup | null {
method getAllMatchingElements (line 644) | public getAllMatchingElements(
method extractSelectorPattern (line 694) | private extractSelectorPattern(selector: string): {
method arePatternsRelated (line 739) | private arePatternsRelated(pattern1: any, pattern2: any): boolean {
method findElementsInShadowDOM (line 757) | private findElementsInShadowDOM(
method parseChildXPath (line 795) | private parseChildXPath(xpath: string): {
method findChildrenInElementShadowDOM (line 838) | private findChildrenInElementShadowDOM(
method searchWithinShadowRoot (line 872) | private searchWithinShadowRoot(
method findGroupedContainerAtPoint (line 963) | private findGroupedContainerAtPoint(
method filterParentChildGroupedElements (line 1025) | private filterParentChildGroupedElements(
method toJSON (line 1349) | toJSON() {
method toJSON (line 1423) | toJSON() {
type Node (line 1484) | type Node = {
type Path (line 1490) | type Path = Node[];
type Limit (line 1492) | enum Limit {
type Options (line 1498) | type Options = {
method finder (line 1514) | function finder(input: Element, options?: Partial<Options>) {
method findRootDocument (line 1560) | function findRootDocument(
method bottomUpSearch (line 1573) | function bottomUpSearch(
method findUniquePath (line 1637) | function findUniquePath(
method selector (line 1656) | function selector(path: Path): string {
method penalty (line 1673) | function penalty(path: Path): number {
method unique (line 1677) | function unique(path: Path) {
method id (line 1690) | function id(input: Element): Node | null {
method attr (line 1701) | function attr(input: Element): Node[] {
method classNames (line 1731) | function classNames(input: Element): Node[] {
method tagName (line 1742) | function tagName(input: Element): Node | null {
method any (line 1753) | function any(): Node {
method index (line 1760) | function index(input: Element): number | null {
method nthChild (line 1787) | function nthChild(node: Node, i: number): Node {
method dispensableNth (line 1794) | function dispensableNth(node: Node) {
method maybe (line 1798) | function maybe(...level: (Node | null)[]): Node[] | null {
method notEmpty (line 1806) | function notEmpty<T>(value: T | null | undefined): value is T {
method sort (line 1826) | function sort(paths: Iterable<Path>): Path[] {
type Scope (line 1830) | type Scope = {
method same (line 1868) | function same(path: Path, input: Element) {
method cssesc (line 1884) | function cssesc(
method genAttributeSet (line 2452) | function genAttributeSet(element: HTMLElement, attributes: string[]) {
method isAttributesDefined (line 2461) | function isAttributesDefined(element: HTMLElement, attributes: string[...
method genValidAttributeFilter (line 2466) | function genValidAttributeFilter(
method genSelectorForAttributes (line 2475) | function genSelectorForAttributes(
method isCharacterNumber (line 2498) | function isCharacterNumber(char: string) {
method getAllDescendantsIncludingShadow (line 2617) | private getAllDescendantsIncludingShadow(
method generateOptimizedChildXPaths (line 2688) | private generateOptimizedChildXPaths(
method generateOptimizedStructuralStep (line 2732) | private generateOptimizedStructuralStep(
method getSiblingPosition (line 2805) | private getSiblingPosition(
method queryElementsInScope (line 2816) | private queryElementsInScope(
method isInShadowDOM (line 2830) | private isInShadowDOM(element: HTMLElement): boolean {
method deepQuerySelectorAll (line 2835) | private deepQuerySelectorAll(
method buildOptimizedAbsoluteXPath (line 2859) | private buildOptimizedAbsoluteXPath(
method getOptimizedStructuralPath (line 2886) | private getOptimizedStructuralPath(
method isAttributeCommonAcrossLists (line 2958) | private isAttributeCommonAcrossLists(
method getElementPath (line 2986) | private getElementPath(element: HTMLElement): number[] {
method findCorrespondingElement (line 2999) | private findCorrespondingElement(
method getCommonClassesAcrossLists (line 3016) | private getCommonClassesAcrossLists(
method elementContains (line 3094) | private elementContains(container: HTMLElement, element: HTMLElement):...
method validateXPath (line 3116) | private validateXPath(xpath: string, document: Document): boolean {
method precomputeSelectorMappings (line 3132) | private precomputeSelectorMappings(
method getElementGridKey (line 3185) | private getElementGridKey(element: HTMLElement): string {
method getNearbySelectorCandidates (line 3194) | private getNearbySelectorCandidates(element: HTMLElement): string[] {
method findDirectMatches (line 3219) | private findDirectMatches(
method sortByPositionalPriority (line 3268) | private sortByPositionalPriority(selectors: string[]): string[] {
method findProximityMatch (line 3285) | private findProximityMatch(
method calculateQuickSimilarity (line 3343) | private calculateQuickSimilarity(
method findMatchingAbsoluteXPath (line 3387) | private findMatchingAbsoluteXPath(
method precomputeChildSelectorMappings (line 3435) | public precomputeChildSelectorMappings(
method calculateXPathSpecificity (line 3443) | private calculateXPathSpecificity(xpath: string): number {
method buildTargetXPath (line 3462) | private buildTargetXPath(
method evaluateXPath (line 3490) | private evaluateXPath(
method isXPathSelector (line 3527) | private isXPathSelector(selector: string): boolean {
method fallbackXPathEvaluation (line 3541) | private fallbackXPathEvaluation(
method isElementInShadowDOM (line 3687) | private isElementInShadowDOM(element: HTMLElement): boolean {
method generateDataForHighlighter (line 3704) | public generateDataForHighlighter(
method generateGroupContainerSelector (line 3896) | private generateGroupContainerSelector(group: ElementGroup): string {
method getCommonStrings (line 3947) | private getCommonStrings(lists: string[][]): string[] {
method getCommonAttributes (line 3954) | private getCommonAttributes(
method getDeepestElementFromPoint (line 4004) | private getDeepestElementFromPoint(
method findAtomicChildAtPoint (line 4035) | private findAtomicChildAtPoint(
method filterLogicalElements (line 4070) | private filterLogicalElements(
method elementHasRelevantContentAtPoint (line 4088) | private elementHasRelevantContentAtPoint(
method findTrulyDeepestElement (line 4131) | private findTrulyDeepestElement(
method getElementDepth (line 4174) | private getElementDepth(element: HTMLElement): number {
method isDialogElement (line 4191) | private isDialogElement(el: HTMLElement): boolean {
method findAllDialogElements (line 4198) | private findAllDialogElements(doc: Document): HTMLElement[] {
method getElementsFromDialogs (line 4214) | private getElementsFromDialogs(dialogElements: HTMLElement[]): HTMLEle...
method getElementsFromShadowRoot (line 4259) | private getElementsFromShadowRoot(shadowRoot: ShadowRoot): HTMLElement...
method cleanup (line 4289) | public cleanup(): void {
method generateSelector (line 4305) | public generateSelector(
FILE: src/helpers/dimensionUtils.ts
constant WIDTH_BREAKPOINTS (line 3) | const WIDTH_BREAKPOINTS = {
constant HEIGHT_BREAKPOINTS (line 11) | const HEIGHT_BREAKPOINTS = {
type AppDimensions (line 31) | interface AppDimensions {
FILE: src/pages/MainPage.tsx
type MainPageProps (line 20) | interface MainPageProps {
type CreateRunResponse (line 25) | interface CreateRunResponse {
type ScheduleRunResponse (line 31) | interface ScheduleRunResponse {
FILE: src/pages/RecordingPage.tsx
type RecordingPageProps (line 20) | interface RecordingPageProps {
type PairForEdit (line 24) | interface PairForEdit {
FILE: src/shared/types.ts
type Workflow (line 4) | type Workflow = WorkflowFile["workflow"];
type ScreenshotSettings (line 6) | interface ScreenshotSettings {
type CustomActions (line 26) | type CustomActions = 'scrape' | 'scrapeSchema' | 'scroll' | 'screenshot'...
FILE: vite-env.d.ts
type ImportMetaEnv (line 1) | interface ImportMetaEnv {
type ImportMeta (line 5) | interface ImportMeta {
Condensed preview — 226 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,516K chars).
[
{
"path": ".dockerignore",
"chars": 137,
"preview": "node_modules\nnpm-debug.log\ndist\n.git\n.gitignore\n.md\n.vscode\ncoverage\ndocker-compose.yml\nDockerfile\nDockerfile.frontend\nD"
},
{
"path": ".github/CODE_OF_CONDUCT.md",
"chars": 1341,
"preview": "# Contributor Code of Conduct\nAs contributors and maintainers of this project, we pledge to respect all people who contr"
},
{
"path": ".github/COMMIT_CONVENTION.md",
"chars": 6914,
"preview": "## Git Commit Message Convention\n\n> This is adapted from [Conventional Commits 1.0.0](https://www.conventionalcommits.or"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.yml",
"chars": 2186,
"preview": "name: Bug Report\ndescription: Report a bug to help us improve\ntitle: \"[Bug]: \"\nlabels: [bug]\nassignees: []\n\nbody:\n - ty"
},
{
"path": ".gitignore",
"chars": 194,
"preview": "# dependencies\n/node_modules\n/browser/node_modules\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n."
},
{
"path": ".sequelizerc",
"chars": 291,
"preview": "const path = require('path');\n\nmodule.exports = {\n 'config': path.resolve('server/src/db/config', 'database.js'),\n 'mo"
},
{
"path": "CONTRIBUTING.md",
"chars": 2163,
"preview": "# Contributing\n\n## Local Setup\nRead local installation instructions here: <a href=\"https://docs.maxun.dev/installation/l"
},
{
"path": "Dockerfile.backend",
"chars": 578,
"preview": "FROM node:20-slim\n\n# Set working directory\nWORKDIR /app\n\nCOPY .sequelizerc .sequelizerc\n\n# Install node dependencies\nCOP"
},
{
"path": "Dockerfile.frontend",
"chars": 437,
"preview": "FROM node:18-alpine AS builder\n\nWORKDIR /app\n\n# Copy package files\nCOPY package*.json ./\n\n# Install dependencies\nRUN npm"
},
{
"path": "ENVEXAMPLE",
"chars": 2860,
"preview": "# App Setup\nNODE_ENV=production # Set to 'development' or 'production' as required\nJWT_SECRET=a9Z$kL"
},
{
"path": "LICENSE",
"chars": 34520,
"preview": " GNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 19 November 2007\n\n Copyright (C)"
},
{
"path": "README.md",
"chars": 7443,
"preview": "<h2 align=\"center\">\n <div>\n <a href=\"https://www.maxun.dev/?ref=ghread\">\n <img src=\"/src/assets/max"
},
{
"path": "SETUP.md",
"chars": 6456,
"preview": "# Local Installation\n1. Create a root folder for your project (e.g. 'maxun')\n2. Create a file named `.env` in the root f"
},
{
"path": "browser/.dockerignore",
"chars": 80,
"preview": "node_modules\nnpm-debug.log\n.env\n.git\n.gitignore\ndist\n*.ts\n!*.d.ts\ntsconfig.json\n"
},
{
"path": "browser/Dockerfile",
"chars": 684,
"preview": "FROM mcr.microsoft.com/playwright:v1.57.0-jammy\n\nWORKDIR /app\n\n# Copy package files\nCOPY browser/package*.json ./\n\n# Ins"
},
{
"path": "browser/package.json",
"chars": 600,
"preview": "{\n \"name\": \"maxun-browser-service\",\n \"version\": \"1.0.0\",\n \"description\": \"Browser service that exposes Playwrig"
},
{
"path": "browser/server.ts",
"chars": 3645,
"preview": "import { chromium } from 'playwright-extra';\nimport stealthPlugin from 'puppeteer-extra-plugin-stealth';\nimport http fro"
},
{
"path": "browser/tsconfig.json",
"chars": 508,
"preview": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"module\": \"commonjs\",\n \"lib\": [\n \"ES202"
},
{
"path": "docker-compose.yml",
"chars": 3271,
"preview": "services:\n postgres:\n image: postgres:13\n restart: unless-stopped\n environment:\n POSTGRES_USER: ${DB_USER"
},
{
"path": "docker-entrypoint.sh",
"chars": 124,
"preview": "#!/bin/sh\n\n# Start backend server\ncd /app && npm run start:server -- --host 0.0.0.0 &\n\n# Start nginx\nnginx -g 'daemon of"
},
{
"path": "docs/nginx.conf",
"chars": 4942,
"preview": "# Robust maxun nginx config file\n# DO NOT uncomment commented lines unless YOU know what they mean and YOU know what YOU"
},
{
"path": "docs/self-hosting-docker.md",
"chars": 4315,
"preview": "# Self hosting docker guide\n\nSo you want to create a bot? Let's get you started!\n\n## Requirements (not covered)\n- Webser"
},
{
"path": "index.html",
"chars": 786,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-w"
},
{
"path": "legacy/server/worker.ts",
"chars": 2394,
"preview": "import { Queue, Worker } from 'bullmq';\nimport IORedis from 'ioredis';\nimport logger from './logger';\nimport { handleRun"
},
{
"path": "legacy/src/AddWhatCondModal.tsx",
"chars": 4889,
"preview": "import { WhereWhatPair } from \"maxun-core\";\nimport { GenericModal } from \"../../src/components/ui/GenericModal\";\nimport "
},
{
"path": "legacy/src/AddWhereCondModal.tsx",
"chars": 4917,
"preview": "import { Dropdown as MuiDropdown } from \"../../src/components/ui/DropdownMui\";\nimport {\n Button,\n MenuItem,\n Typograp"
},
{
"path": "legacy/src/Canvas.tsx",
"chars": 11046,
"preview": "import React, { memo, useCallback, useEffect, useRef } from 'react';\nimport { useSocketStore } from '../../context/socke"
},
{
"path": "legacy/src/DisplayWhereConditionSettings.tsx",
"chars": 4286,
"preview": "import React from \"react\";\nimport { Dropdown as MuiDropdown } from \"../../src/components/ui/DropdownMui\";\nimport { Check"
},
{
"path": "legacy/src/Highlighter.tsx",
"chars": 2453,
"preview": "import React, { useMemo } from 'react';\nimport styled from \"styled-components\";\nimport { coordinateMapper } from '../../"
},
{
"path": "legacy/src/LeftSidePanel.tsx",
"chars": 4209,
"preview": "import { Box, Paper, Tab, Tabs } from \"@mui/material\";\nimport React, { useCallback, useEffect, useState } from \"react\";\n"
},
{
"path": "legacy/src/LeftSidePanelContent.tsx",
"chars": 3403,
"preview": "import React, { useCallback, useEffect, useState } from 'react';\nimport { Pair } from \"./Pair\";\nimport { WhereWhatPair, "
},
{
"path": "legacy/src/LeftSidePanelSettings.tsx",
"chars": 2713,
"preview": "import React from \"react\";\nimport { Button, MenuItem, TextField, Typography } from \"@mui/material\";\nimport { Dropdown } "
},
{
"path": "legacy/src/Pair.tsx",
"chars": 5530,
"preview": "import React, { FC, useState } from 'react';\nimport { Stack, Button, IconButton, Tooltip, Badge } from \"@mui/material\";\n"
},
{
"path": "legacy/src/PairDetail.tsx",
"chars": 11533,
"preview": "import React, { useLayoutEffect, useRef, useState } from 'react';\nimport { WhereWhatPair } from \"maxun-core\";\nimport { I"
},
{
"path": "legacy/src/PairDisplayDiv.tsx",
"chars": 1252,
"preview": "import React, { FC } from 'react';\nimport Typography from '@mui/material/Typography';\nimport { WhereWhatPair } from \"max"
},
{
"path": "legacy/src/PairEditForm.tsx",
"chars": 4627,
"preview": "import { Button, TextField, Typography } from \"@mui/material\";\nimport React, { FC } from \"react\";\nimport { Preprocessor,"
},
{
"path": "legacy/src/Renderer.tsx",
"chars": 6809,
"preview": "export class CanvasRenderer {\n private canvas: HTMLCanvasElement;\n private ctx: CanvasRenderingContext2D;\n private of"
},
{
"path": "legacy/src/RobotEdit.tsx",
"chars": 21521,
"preview": "import React, { useState, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { GenericModa"
},
{
"path": "legacy/src/RobotSettings.tsx",
"chars": 6377,
"preview": "import React, { useState, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { GenericModa"
},
{
"path": "legacy/src/ScheduleSettings.tsx",
"chars": 11057,
"preview": "import React, { useState, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { GenericModa"
},
{
"path": "legacy/src/coordinateMapper.ts",
"chars": 2964,
"preview": "import { BROWSER_DEFAULT_HEIGHT, BROWSER_DEFAULT_WIDTH } from \"../constants/const\";\nimport { getResponsiveDimensions } f"
},
{
"path": "legacy/src/inputHelpers.ts",
"chars": 3231,
"preview": "import {\n ONE_PERCENT_OF_VIEWPORT_H,\n ONE_PERCENT_OF_VIEWPORT_W,\n} from \"../constants/const\";\nimport { Coordinates } f"
},
{
"path": "maxun-core/.gitignore",
"chars": 172,
"preview": "# dependencies\n/node_modules\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n."
},
{
"path": "maxun-core/README.md",
"chars": 14,
"preview": "### Maxun-Core"
},
{
"path": "maxun-core/package.json",
"chars": 824,
"preview": "{\n \"name\": \"maxun-core\",\n \"version\": \"0.0.32\",\n \"description\": \"Core package for Maxun, responsible for data extracti"
},
{
"path": "maxun-core/src/browserSide/scraper.js",
"chars": 49343,
"preview": "/* eslint-disable @typescript-eslint/no-unused-vars */\n\nconst area = (element) => element.offsetHeight * element.offsetW"
},
{
"path": "maxun-core/src/index.ts",
"chars": 296,
"preview": "import Interpreter from './interpret';\n\nexport default Interpreter;\nexport { default as Preprocessor } from './preproces"
},
{
"path": "maxun-core/src/interpret.ts",
"chars": 99946,
"preview": "/* eslint-disable no-await-in-loop, no-restricted-syntax */\nimport { ElementHandle, Page, PageScreenshotOptions } from '"
},
{
"path": "maxun-core/src/preprocessor.ts",
"chars": 5861,
"preview": "import Joi from 'joi';\nimport {\n Workflow, WorkflowFile, ParamType, SelectorArray, Where,\n} from './types/workflow';\nim"
},
{
"path": "maxun-core/src/types/logic.ts",
"chars": 229,
"preview": "export const unaryOperators = ['$not'] as const;\nexport const naryOperators = ['$and', '$or'] as const;\n\nexport const op"
},
{
"path": "maxun-core/src/types/workflow.ts",
"chars": 1704,
"preview": "import { Page } from 'playwright-core';\nimport {\n naryOperators, unaryOperators, operators, meta,\n} from './logic';\n\nex"
},
{
"path": "maxun-core/src/utils/concurrency.ts",
"chars": 2646,
"preview": "/**\n * Concurrency class for running concurrent tasks while managing a limited amount of resources.\n */\nexport default c"
},
{
"path": "maxun-core/src/utils/logger.ts",
"chars": 857,
"preview": "/*\n* Logger class for more detailed and comprehensible logs (with colors and timestamps)\n*/\n\nexport enum Level {\n DAT"
},
{
"path": "maxun-core/src/utils/utils.ts",
"chars": 369,
"preview": "/**\n * ESLint rule in case there is only one util function\n * (it still does not represent the \"utils\" file)\n*/\n\n/* esli"
},
{
"path": "maxun-core/tsconfig.json",
"chars": 225,
"preview": "{\n \"compilerOptions\": {\n \"outDir\": \"./build\",\n \"declaration\": true,\n \"allowJs\": true,\n \"target\": \"es6\",\n "
},
{
"path": "nginx.conf",
"chars": 702,
"preview": "server {\n listen 80;\n server_name _;\n\n root /var/www/maxun;\n index index.html;\n\n # Serve the frontend\n "
},
{
"path": "package.json",
"chars": 4437,
"preview": "{\n \"name\": \"maxun\",\n \"version\": \"0.0.35\",\n \"author\": \"Maxun\",\n \"license\": \"AGPL-3.0-or-later\",\n \"dependencies\": {\n "
},
{
"path": "public/locales/de.json",
"chars": 29653,
"preview": "{\n \"login\": {\n \"title\": \"Willkommen zurück!\",\n \"email\": \"Geben Sie Ihre geschäftliche E-Mail-Adresse ei"
},
{
"path": "public/locales/en.json",
"chars": 24925,
"preview": "{\n \"login\": {\n \"title\": \"Welcome Back!\",\n \"email\": \"Enter Work Email\",\n \"password\": \"Password\",\n "
},
{
"path": "public/locales/es.json",
"chars": 25761,
"preview": "{\n \"login\": {\n \"title\": \"¡Bienvenido de nuevo!\",\n \"email\": \"Introducir correo electrónico de trabajo\",\n \"passw"
},
{
"path": "public/locales/ja.json",
"chars": 22026,
"preview": "{\n \"login\": {\n \"title\": \"お帰りなさい!\",\n \"email\": \"勤務先メールアドレスを入力\",\n \"password\": \"パスワード\",\n \"butto"
},
{
"path": "public/locales/tr.json",
"chars": 22325,
"preview": "{\n \"login\": {\n \"title\": \"Tekrar Hoş Geldiniz!\",\n \"email\": \"İş E‑postası Girin\",\n \"password\": \"Şifre\",\n \"but"
},
{
"path": "public/locales/zh.json",
"chars": 16687,
"preview": "{\n \"login\": {\n \"title\": \"欢迎回来!\",\n \"email\": \"输入工作电子邮箱\",\n \"password\": \"密码\",\n \"button\": \"登录\",\n \"loading\": \""
},
{
"path": "server/.gitignore",
"chars": 179,
"preview": "# dependencies\n/node_modules\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n."
},
{
"path": "server/config/config.json",
"chars": 576,
"preview": "{\n \"development\": {\n \"username\": \"postgres\",\n \"password\": \"postgres\",\n \"database\": \"maxun\",\n \"hos"
},
{
"path": "server/docker-entrypoint.sh",
"chars": 880,
"preview": "#!/bin/bash\nset -e\n\n# Function to wait for PostgreSQL\nwait_for_postgres() {\n echo \"Waiting for PostgreSQL at $DB_HOST:$"
},
{
"path": "server/src/api/record.ts",
"chars": 56253,
"preview": "import { Router, Request, Response } from 'express';\nimport { requireAPIKey } from \"../middlewares/api\";\nimport Robot fr"
},
{
"path": "server/src/api/sdk.ts",
"chars": 30315,
"preview": "/**\n * SDK API Routes\n * Separate API endpoints specifically for Maxun SDKs\n * All routes require API key authentication"
},
{
"path": "server/src/browser-management/browserConnection.ts",
"chars": 5830,
"preview": "import { chromium } from 'playwright-core';\nimport type { Browser } from 'playwright-core';\nimport logger from '../logge"
},
{
"path": "server/src/browser-management/classes/BrowserPool.ts",
"chars": 28820,
"preview": "import { RemoteBrowser } from \"./RemoteBrowser\";\nimport logger from \"../../logger\";\n\n/**\n * @category Types\n */\n/**\n * R"
},
{
"path": "server/src/browser-management/classes/RemoteBrowser.ts",
"chars": 33823,
"preview": "import {\n Page,\n Browser,\n CDPSession,\n BrowserContext\n} from 'playwright-core';\nimport { Socket } from \"soc"
},
{
"path": "server/src/browser-management/controller.ts",
"chars": 17777,
"preview": "/**\n * The main function group which determines the flow of remote browser management.\n * Holds the singleton instances "
},
{
"path": "server/src/browser-management/inputHandlers.ts",
"chars": 30598,
"preview": "/**\n * A set of functions handling reproduction of user input\n * on the remote browser instance as well as the generatio"
},
{
"path": "server/src/constants/config.ts",
"chars": 241,
"preview": "export const SERVER_PORT = process.env.BACKEND_PORT ? Number(process.env.BACKEND_PORT) : 8080\nexport const DEBUG = proce"
},
{
"path": "server/src/db/config/database.js",
"chars": 1099,
"preview": "const dotenv = require('dotenv');\ndotenv.config({ path: './.env' });\n\n// Validate required environment variables\nconst r"
},
{
"path": "server/src/db/migrate.js",
"chars": 826,
"preview": "'use strict';\n\nimport { execSync } from 'child_process';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\ni"
},
{
"path": "server/src/db/migrations/20250327111003-add-airtable-columns.js",
"chars": 3205,
"preview": "'use strict';\n\nmodule.exports = {\n up: async (queryInterface, Sequelize) => {\n // Add Airtable related columns\n r"
},
{
"path": "server/src/db/migrations/20250527105655-add-webhooks.js",
"chars": 795,
"preview": "'use strict';\n\nmodule.exports = {\n async up(queryInterface, Sequelize) {\n await queryInterface.addColumn('robot', 'w"
},
{
"path": "server/src/db/models/index.js",
"chars": 1587,
"preview": "'use strict';\n\nimport fs from 'fs';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport Sequelize from "
},
{
"path": "server/src/index.ts",
"chars": 650,
"preview": "export * from \"./server\";\nexport * from \"./logger\";\nexport * from \"./types\";\nexport * from \"./browser-management/control"
},
{
"path": "server/src/logger.ts",
"chars": 660,
"preview": "import { createLogger, format, transports } from 'winston';\nimport { DEBUG, LOGS_PATH } from \"./constants/config\";\n\ncons"
},
{
"path": "server/src/markdownify/markdown.ts",
"chars": 4075,
"preview": "export async function parseMarkdown(\n html: string | null | undefined,\n baseUrl?: string | null\n): Promise<string> {\n "
},
{
"path": "server/src/markdownify/scrape.ts",
"chars": 3961,
"preview": "import { Page } from \"playwright-core\";\nimport { parseMarkdown } from \"./markdown\";\nimport logger from \"../logger\";\n\nasy"
},
{
"path": "server/src/mcp-worker.ts",
"chars": 11080,
"preview": "import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontext"
},
{
"path": "server/src/middlewares/api.ts",
"chars": 561,
"preview": "import { Response } from \"express\";\nimport User from \"../models/User\";\nimport { AuthenticatedRequest } from \"../routes/r"
},
{
"path": "server/src/middlewares/auth.ts",
"chars": 961,
"preview": "import { Request, Response } from \"express\";\nimport { verify, JwtPayload } from \"jsonwebtoken\";\n\ninterface UserRequest e"
},
{
"path": "server/src/models/Robot.ts",
"chars": 4206,
"preview": "import { Model, DataTypes, Optional } from 'sequelize';\nimport sequelize from '../storage/db';\nimport { WhereWhatPair } "
},
{
"path": "server/src/models/Run.ts",
"chars": 3094,
"preview": "import { Model, DataTypes, Optional } from 'sequelize';\nimport sequelize from '../storage/db';\nimport Robot from './Robo"
},
{
"path": "server/src/models/User.ts",
"chars": 2049,
"preview": "import { DataTypes, Model, Optional } from 'sequelize';\nimport sequelize from '../storage/db';\n\ninterface UserAttributes"
},
{
"path": "server/src/models/associations.ts",
"chars": 203,
"preview": "import Robot from './Robot';\nimport Run from './Run';\n\nexport default function setupAssociations() {\n Run.belongsTo(Rob"
},
{
"path": "server/src/pgboss-worker.ts",
"chars": 41797,
"preview": "/**\n * Recording worker using PgBoss for asynchronous browser recording operations\n */\nimport PgBoss, { Job } from 'pg-b"
},
{
"path": "server/src/routes/auth.ts",
"chars": 26265,
"preview": "import { Router, Request, Response } from \"express\";\nimport User from \"../models/User\";\nimport Robot from \"../models/Rob"
},
{
"path": "server/src/routes/index.ts",
"chars": 357,
"preview": "import { router as record } from './record';\nimport { router as workflow } from './workflow';\nimport { router as storage"
},
{
"path": "server/src/routes/proxy.ts",
"chars": 6059,
"preview": "import { Router, Request, Response } from 'express';\nimport { connectToRemoteBrowser } from '../browser-management/brows"
},
{
"path": "server/src/routes/record.ts",
"chars": 9667,
"preview": "/**\n * RESTful API endpoints handling remote browser recording sessions.\n */\nimport { Router, Request, Response } from '"
},
{
"path": "server/src/routes/storage.ts",
"chars": 49309,
"preview": "import { Router } from 'express';\nimport logger from \"../logger\";\nimport { createRemoteBrowserForRun, destroyRemoteBrows"
},
{
"path": "server/src/routes/webhook.ts",
"chars": 17967,
"preview": "import { Router, Request, Response } from 'express';\nimport Robot from '../models/Robot';\nimport { requireSignIn } from "
},
{
"path": "server/src/routes/workflow.ts",
"chars": 5163,
"preview": "/**\n * RESTful API endpoints handling currently generated workflow management.\n */\n\nimport { Router } from 'express';\nim"
},
{
"path": "server/src/schedule-worker.ts",
"chars": 5314,
"preview": "/**\n * Worker process focused solely on scheduling logic\n */\nimport PgBoss, { Job } from 'pg-boss';\nimport logger from '"
},
{
"path": "server/src/sdk/browserSide/pageAnalyzer.js",
"chars": 81921,
"preview": "/**\n * Page Analyzer for pagination auto-detection, selector generation and grouping\n */\n\n(function () {\n 'use strict';"
},
{
"path": "server/src/sdk/selectorValidator.ts",
"chars": 17264,
"preview": "/**\n * Selector Validator\n * Validates and enriches selectors with metadata using Playwright page instance\n */\n\nimport {"
},
{
"path": "server/src/sdk/workflowEnricher.ts",
"chars": 68243,
"preview": "/**\n * Workflow Enricher\n * Converts simplified SDK workflow to full format with validation\n */\n\nimport { SelectorValida"
},
{
"path": "server/src/server.ts",
"chars": 14135,
"preview": "import express from 'express';\nimport path from 'path';\nimport http from 'http';\nimport { Server } from \"socket.io\";\nimp"
},
{
"path": "server/src/socket-connection/connection.ts",
"chars": 1990,
"preview": "import { Namespace, Socket } from 'socket.io';\nimport logger from \"../logger\";\nimport { registerInputHandlers, removeInp"
},
{
"path": "server/src/storage/db.ts",
"chars": 2056,
"preview": "import { Sequelize } from 'sequelize';\nimport dotenv from 'dotenv';\n\ndotenv.config();\n\nif (!process.env.DB_USER || !proc"
},
{
"path": "server/src/storage/mino.ts",
"chars": 7986,
"preview": "import { Client } from 'minio';\nimport Run from '../models/Run';\n\nconst minioClient = new Client({\n endPoint: process.e"
},
{
"path": "server/src/storage/pgboss.ts",
"chars": 2237,
"preview": "/**\n * Shared PgBoss singleton for job queue operations\n *\n * This module provides a single PgBoss instance that can be "
},
{
"path": "server/src/storage/schedule.ts",
"chars": 2180,
"preview": "/**\n * Shared scheduling utilities\n * These functions use the shared PgBoss client to avoid connection leaks\n */\nimport "
},
{
"path": "server/src/swagger/config.ts",
"chars": 1602,
"preview": "import swaggerJSDoc from 'swagger-jsdoc';\nimport path from 'path';\nimport fs from 'fs';\n\nconst apiDir = path.join(__dirn"
},
{
"path": "server/src/types/index.ts",
"chars": 6015,
"preview": "import {BrowserType, LaunchOptions} from \"playwright-core\";\n\n/**\n * Interpreter settings properties including recording "
},
{
"path": "server/src/utils/analytics.ts",
"chars": 1229,
"preview": "import { PostHog } from 'posthog-node'\nimport os from 'os'\nimport fs from 'fs'\nimport path from 'path'\nimport { ANALYTIC"
},
{
"path": "server/src/utils/api.ts",
"chars": 131,
"preview": "import crypto from 'crypto';\n\nexport const genAPIKey = (): string => {\n return crypto.randomBytes(24).toString('base6"
},
{
"path": "server/src/utils/auth.ts",
"chars": 2376,
"preview": "import bcrypt from \"bcrypt\";\nimport crypto from 'crypto';\nimport { getEnvVariable } from './env';\n\nexport const hashPass"
},
{
"path": "server/src/utils/env.ts",
"chars": 334,
"preview": "// Helper function to get environment variables and throw an error if they are not set\nexport const getEnvVariable = (ke"
},
{
"path": "server/src/utils/schedule.ts",
"chars": 455,
"preview": "import cronParser from 'cron-parser';\nimport moment from 'moment-timezone';\n\n// Function to compute next run date based "
},
{
"path": "server/src/workflow-management/classes/Generator.ts",
"chars": 47116,
"preview": "import { Action, ActionType, Coordinates, TagName, DatePickerEventData } from \"../../types\";\nimport { WhereWhatPair, Wor"
},
{
"path": "server/src/workflow-management/classes/Interpreter.ts",
"chars": 31026,
"preview": "import Interpreter, { WorkflowFile } from \"maxun-core\";\nimport logger from \"../../logger\";\nimport { Socket } from \"socke"
},
{
"path": "server/src/workflow-management/integrations/airtable.ts",
"chars": 23041,
"preview": "import Airtable from \"airtable\";\nimport axios from \"axios\";\nimport logger from \"../../logger\";\nimport Run from \"../../mo"
},
{
"path": "server/src/workflow-management/integrations/gsheet.ts",
"chars": 13539,
"preview": "import { google } from \"googleapis\";\nimport logger from \"../../logger\";\nimport Run from \"../../models/Run\";\nimport Robot"
},
{
"path": "server/src/workflow-management/scheduler/index.ts",
"chars": 26621,
"preview": "import { v4 as uuid } from \"uuid\";\nimport { io, Socket } from \"socket.io-client\";\nimport { createRemoteBrowserForRun, de"
},
{
"path": "server/src/workflow-management/selector.ts",
"chars": 112150,
"preview": "import { Page } from \"playwright-core\";\nimport { Coordinates } from \"../types\";\nimport { WhereWhatPair, WorkflowFile } f"
},
{
"path": "server/src/workflow-management/storage.ts",
"chars": 3118,
"preview": "/**\n * A group of functions for storing recordings on the file system.\n * Functions are asynchronous to unload the serve"
},
{
"path": "server/src/workflow-management/utils.ts",
"chars": 2935,
"preview": "import { Action, ActionType, TagName } from \"../types\";\n\n/**\n * A helper function to get the best selector for the speci"
},
{
"path": "server/start.sh",
"chars": 193,
"preview": "#!/bin/bash\n\n# Start Xvfb in the background with the desired dimensions\n#Xvfb :0 -screen 0 900x400x24 &\n\n# Wait for Xvfb"
},
{
"path": "server/tsconfig.json",
"chars": 777,
"preview": "{\n \"compilerOptions\": {\n \"target\": \"es2020\",\n \"module\": \"commonjs\",\n \"outDir\": \"./dist\",\n \"rootDir\": \"../\","
},
{
"path": "server/tsconfig.mcp.json",
"chars": 452,
"preview": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"Node16\",\n \"moduleResolution\": \"Node16\",\n \"outDir\":"
},
{
"path": "src/App.tsx",
"chars": 524,
"preview": "import React from \"react\";\nimport { Routes, Route } from \"react-router-dom\";\nimport { GlobalInfoProvider } from \"./conte"
},
{
"path": "src/api/auth.ts",
"chars": 474,
"preview": "import { default as axios } from \"axios\";\nimport { apiUrl } from \"../apiConfig\"\n\nexport const getUserById = async (userI"
},
{
"path": "src/api/integration.ts",
"chars": 692,
"preview": "import { default as axios } from \"axios\";\nimport { apiUrl } from \"../apiConfig\";\n\nexport const handleUploadCredentials ="
},
{
"path": "src/api/proxy.ts",
"chars": 1956,
"preview": "import { default as axios } from \"axios\";\nimport { apiUrl } from \"../apiConfig\";\n\nexport const sendProxyConfig = async ("
},
{
"path": "src/api/recording.ts",
"chars": 2883,
"preview": "import { default as axios, AxiosResponse } from \"axios\";\nimport { apiUrl } from \"../apiConfig\";\n\nexport const startRecor"
},
{
"path": "src/api/storage.ts",
"chars": 10837,
"preview": "import { default as axios } from \"axios\";\nimport { WorkflowFile } from \"maxun-core\";\nimport { RunSettings } from \"../com"
},
{
"path": "src/api/webhook.ts",
"chars": 4747,
"preview": "import { default as axios } from \"axios\";\nimport { apiUrl } from \"../apiConfig\";\n\nexport interface WebhookConfig {\n i"
},
{
"path": "src/api/workflow.ts",
"chars": 2422,
"preview": "import { WhereWhatPair, WorkflowFile } from \"maxun-core\";\nimport { emptyWorkflow } from \"../shared/constants\";\nimport { "
},
{
"path": "src/apiConfig.js",
"chars": 115,
"preview": "export const apiUrl = import.meta.env.VITE_BACKEND_URL ? import.meta.env.VITE_BACKEND_URL : 'http://localhost:8080'"
},
{
"path": "src/components/action/ActionDescriptionBox.tsx",
"chars": 4470,
"preview": "import React from 'react';\nimport styled from 'styled-components';\nimport { Typography, FormControlLabel, Checkbox, Box "
},
{
"path": "src/components/action/ActionSettings.tsx",
"chars": 2152,
"preview": "import React, { useRef } from 'react';\nimport styled from \"styled-components\";\nimport { Button } from \"@mui/material\";\ni"
},
{
"path": "src/components/action/action-settings/Scrape.tsx",
"chars": 993,
"preview": "import React, { forwardRef, useImperativeHandle } from 'react';\nimport { Stack, TextField } from \"@mui/material\";\nimport"
},
{
"path": "src/components/action/action-settings/ScrapeSchema.tsx",
"chars": 786,
"preview": "import React, { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { WarningText } from \"../../ui/texts\";\nim"
},
{
"path": "src/components/action/action-settings/Screenshot.tsx",
"chars": 3465,
"preview": "import React, { forwardRef, useImperativeHandle } from 'react';\nimport { MenuItem, TextField } from \"@mui/material\";\nimp"
},
{
"path": "src/components/action/action-settings/Scroll.tsx",
"chars": 524,
"preview": "import React, { forwardRef, useImperativeHandle } from 'react';\nimport { TextField } from \"@mui/material\";\n\nexport const"
},
{
"path": "src/components/action/action-settings/index.ts",
"chars": 287,
"preview": "import { ScrollSettings } from './Scroll';\nimport { ScreenshotSettings } from \"./Screenshot\";\nimport { ScrapeSettings } "
},
{
"path": "src/components/api/ApiKey.tsx",
"chars": 7734,
"preview": "import React, { useState, useEffect } from 'react';\nimport {\n Box,\n Button,\n Typography,\n IconButton,\n CircularProg"
},
{
"path": "src/components/browser/BrowserContent.tsx",
"chars": 4443,
"preview": "import React, { useCallback, useEffect, useState } from \"react\";\nimport styled from \"styled-components\";\nimport BrowserN"
},
{
"path": "src/components/browser/BrowserNavBar.tsx",
"chars": 3799,
"preview": "import type { FC } from 'react';\nimport styled from 'styled-components';\nimport ReplayIcon from '@mui/icons-material/Rep"
},
{
"path": "src/components/browser/BrowserRecordingSave.tsx",
"chars": 7684,
"preview": "import React, { useState } from 'react'\nimport { Grid, Button, Box, Typography, IconButton, Menu, MenuItem, ListItemText"
},
{
"path": "src/components/browser/BrowserTabs.tsx",
"chars": 2658,
"preview": "import * as React from 'react';\nimport { Box, IconButton, Tab, Tabs } from \"@mui/material\";\nimport { Close } from \"@mui/"
},
{
"path": "src/components/browser/BrowserWindow.tsx",
"chars": 72923,
"preview": "import React, { useCallback, useContext, useEffect, useState } from 'react';\nimport { generateUUID } from '../../helpers"
},
{
"path": "src/components/browser/UrlForm.tsx",
"chars": 2422,
"preview": "import React, { useState, useEffect, useCallback, useRef } from 'react';\nimport type { SyntheticEvent } from 'react';\nim"
},
{
"path": "src/components/dashboard/MainMenu.tsx",
"chars": 10187,
"preview": "import React, { useState, useEffect } from 'react'; \nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/materi"
},
{
"path": "src/components/dashboard/NavBar.tsx",
"chars": 16258,
"preview": "import { useTranslation } from \"react-i18next\";\nimport React, { useState, useContext, useEffect } from 'react';\nimport a"
},
{
"path": "src/components/dashboard/NotFound.tsx",
"chars": 293,
"preview": "import React from 'react';\n\nexport function NotFoundPage() {\n return (\n <div style={{ textAlign: 'center' }}>\n "
},
{
"path": "src/components/icons/DiscordIcon.tsx",
"chars": 1516,
"preview": "import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon';\n\nconst DiscordIcon: React.FC<S"
},
{
"path": "src/components/icons/RecorderIcon.tsx",
"chars": 4628,
"preview": "import React from 'react';\n\nexport const RecordingIcon = () => {\n return (\n <svg style={{ height: '40px', marginLeft"
},
{
"path": "src/components/integration/IntegrationSettings.tsx",
"chars": 43584,
"preview": "import React, { useState, useEffect } from \"react\";\nimport { GenericModal } from \"../ui/GenericModal\";\nimport {\n MenuIt"
},
{
"path": "src/components/pickers/DatePicker.tsx",
"chars": 3406,
"preview": "import React, { useState } from 'react';\nimport { useSocketStore } from '../../context/socket';\n\ninterface Coordinates {"
},
{
"path": "src/components/pickers/DateTimeLocalPicker.tsx",
"chars": 3506,
"preview": "import React, { useState } from 'react';\nimport { useSocketStore } from '../../context/socket';\n\ninterface Coordinates {"
},
{
"path": "src/components/pickers/Dropdown.tsx",
"chars": 4941,
"preview": "import React, { useState } from 'react';\nimport { useSocketStore } from '../../context/socket';\n\ninterface Coordinates {"
},
{
"path": "src/components/pickers/TimePicker.tsx",
"chars": 4698,
"preview": "import React, { useState } from 'react';\nimport { useSocketStore } from '../../context/socket';\n\ninterface Coordinates {"
},
{
"path": "src/components/proxy/ProxyForm.tsx",
"chars": 11052,
"preview": "import React, { useState, useEffect } from 'react';\nimport {\n Alert,\n AlertTitle,\n TextField,\n Button,\n S"
},
{
"path": "src/components/recorder/DOMBrowserRenderer.tsx",
"chars": 29497,
"preview": "import React, {\n useCallback,\n useContext,\n useEffect,\n useState,\n useRef,\n} from \"react\";\nimport { useSocketStore "
},
{
"path": "src/components/recorder/KeyValueForm.tsx",
"chars": 1397,
"preview": "import React, { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { KeyValuePair } from \"./KeyValuePair\";\ni"
},
{
"path": "src/components/recorder/KeyValuePair.tsx",
"chars": 1346,
"preview": "import React, { forwardRef, useImperativeHandle } from \"react\";\nimport { Box, TextField } from \"@mui/material\";\n\ninterfa"
},
{
"path": "src/components/recorder/RightSidePanel.tsx",
"chars": 48895,
"preview": "import React, { useState, useCallback, useEffect, useRef, useMemo } from 'react';\nimport { generateUUID } from '../../he"
},
{
"path": "src/components/recorder/SaveRecording.tsx",
"chars": 7138,
"preview": "import React, { useCallback, useEffect, useState, useContext } from 'react';\nimport { Button, Box, LinearProgress, Toolt"
},
{
"path": "src/components/recorder/SidePanelHeader.tsx",
"chars": 714,
"preview": "import React, { FC, useState } from 'react';\nimport { InterpretationButtons } from \"../run/InterpretationButtons\";\nimpor"
},
{
"path": "src/components/robot/Recordings.tsx",
"chars": 5380,
"preview": "import React, { useEffect, useState } from \"react\";\nimport { RecordingsTable } from \"./RecordingsTable\";\nimport { Grid }"
},
{
"path": "src/components/robot/RecordingsTable.tsx",
"chars": 28220,
"preview": "import * as React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport Paper from '@mui/material/Paper';"
},
{
"path": "src/components/robot/ToggleButton.tsx",
"chars": 1244,
"preview": "import React, { FC } from \"react\";\nimport styled from \"styled-components\";\n\ninterface ToggleButtonProps {\n isChecked?: "
},
{
"path": "src/components/robot/pages/RobotConfigPage.tsx",
"chars": 5100,
"preview": "import React from 'react';\nimport {\n Box,\n Typography,\n Button,\n IconButton,\n Divider,\n useTheme\n} from '@mui/mate"
},
{
"path": "src/components/robot/pages/RobotCreate.tsx",
"chars": 44651,
"preview": "import React, { useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useTranslation } from "
},
{
"path": "src/components/robot/pages/RobotDuplicatePage.tsx",
"chars": 3862,
"preview": "import React, { useState, useEffect } from \"react\";\nimport { TextField, Box } from \"@mui/material\";\nimport { useGlobalIn"
},
{
"path": "src/components/robot/pages/RobotEditPage.tsx",
"chars": 32193,
"preview": "import { useState, useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n TextField,\n Typ"
},
{
"path": "src/components/robot/pages/RobotIntegrationPage.tsx",
"chars": 41305,
"preview": "import React, { useState, useEffect } from \"react\";\nimport {\n MenuItem,\n Typography,\n CircularProgress,\n Alert,\n Al"
},
{
"path": "src/components/robot/pages/RobotSettingsPage.tsx",
"chars": 6146,
"preview": "import { useState, useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { TextField, Box } f"
},
{
"path": "src/components/robot/pages/ScheduleSettingsPage.tsx",
"chars": 11972,
"preview": "import React, { useState, useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n MenuItem,"
},
{
"path": "src/components/run/ColapsibleRow.tsx",
"chars": 12701,
"preview": "import { useEffect, useRef, useState } from \"react\";\nimport * as React from \"react\";\nimport TableRow from \"@mui/material"
},
{
"path": "src/components/run/InterpretationButtons.tsx",
"chars": 6205,
"preview": "import { Box, Button, Stack, Typography, CircularProgress } from \"@mui/material\";\nimport React, { useCallback, useEffect"
},
{
"path": "src/components/run/InterpretationLog.tsx",
"chars": 59985,
"preview": "import * as React from 'react';\nimport SwipeableDrawer from '@mui/material/SwipeableDrawer';\nimport Typography from '@mu"
},
{
"path": "src/components/run/RunContent.tsx",
"chars": 105579,
"preview": "import {\n Box,\n Typography,\n Paper,\n Button,\n CircularProgress,\n Accordion,\n AccordionSummary,\n AccordionDetails"
},
{
"path": "src/components/run/RunSettings.tsx",
"chars": 4320,
"preview": "import React, { useState, useEffect, useRef } from \"react\";\nimport { GenericModal } from \"../ui/GenericModal\";\nimport { "
},
{
"path": "src/components/run/Runs.tsx",
"chars": 760,
"preview": "import React from 'react';\nimport { Grid } from \"@mui/material\";\nimport { RunsTable } from \"./RunsTable\";\n\ninterface Run"
},
{
"path": "src/components/run/RunsTable.tsx",
"chars": 22257,
"preview": "import * as React from 'react';\nimport { useCallback, useEffect, useMemo, useState, useRef } from \"react\";\nimport { useT"
},
{
"path": "src/components/ui/AlertSnackbar.tsx",
"chars": 1222,
"preview": "import * as React from 'react';\nimport Snackbar from '@mui/material/Snackbar';\nimport MuiAlert, { AlertProps } from '@mu"
},
{
"path": "src/components/ui/Box.tsx",
"chars": 499,
"preview": "import * as React from 'react';\nimport Box from '@mui/material/Box';\n\ninterface BoxProps {\n width: number | string,\n h"
},
{
"path": "src/components/ui/ConfirmationBox.tsx",
"chars": 860,
"preview": "import React from 'react';\nimport { Box, Button, Typography } from \"@mui/material\";\n\ninterface ConfirmationBoxProps {\n "
},
{
"path": "src/components/ui/DropdownMui.tsx",
"chars": 813,
"preview": "import React from 'react';\nimport { FormControl, InputLabel, Select } from \"@mui/material\";\nimport { SelectChangeEvent }"
},
{
"path": "src/components/ui/Form.tsx",
"chars": 370,
"preview": "import styled from 'styled-components';\n\nexport const NavBarForm = styled.form`\n flex: 1px;\n margin-left: 5px;\n "
},
{
"path": "src/components/ui/GenericModal.tsx",
"chars": 1257,
"preview": "import React, { FC } from 'react';\nimport { Modal, IconButton, Box } from '@mui/material';\nimport { Clear } from \"@mui/i"
},
{
"path": "src/components/ui/Loader.tsx",
"chars": 1708,
"preview": "import styled from \"styled-components\";\nimport { Stack } from \"@mui/material\";\nimport { useThemeMode } from \"../../conte"
},
{
"path": "src/components/ui/buttons/AddButton.tsx",
"chars": 869,
"preview": "import { IconButton } from \"@mui/material\";\nimport { Add } from \"@mui/icons-material\";\nimport React, { FC } from \"react\""
},
{
"path": "src/components/ui/buttons/BreakpointButton.tsx",
"chars": 781,
"preview": "import { IconButton } from \"@mui/material\";\nimport { Circle } from \"@mui/icons-material\";\n\ninterface BreakpointButtonPro"
},
{
"path": "src/components/ui/buttons/Buttons.tsx",
"chars": 896,
"preview": "import styled from 'styled-components';\n\nexport const NavBarButton = styled.button<{ disabled: boolean, mode: 'light' | "
},
{
"path": "src/components/ui/buttons/ClearButton.tsx",
"chars": 530,
"preview": "import { IconButton } from \"@mui/material\";\nimport { Clear } from \"@mui/icons-material\";\nimport React, { FC } from \"reac"
},
{
"path": "src/components/ui/buttons/EditButton.tsx",
"chars": 525,
"preview": "import { IconButton } from \"@mui/material\";\nimport { Edit } from \"@mui/icons-material\";\nimport React, { FC } from \"react"
},
{
"path": "src/components/ui/buttons/RemoveButton.tsx",
"chars": 517,
"preview": "import { IconButton } from \"@mui/material\";\nimport { Remove } from \"@mui/icons-material\";\nimport React, { FC } from \"rea"
},
{
"path": "src/components/ui/texts.tsx",
"chars": 364,
"preview": "import styled from \"styled-components\";\n\nexport const WarningText = styled.p`\n border: 1px solid orange;\n display: fle"
},
{
"path": "src/constants/const.ts",
"chars": 13525,
"preview": "export const VIEWPORT_W = 900;\nexport const VIEWPORT_H = 400;\n\n// Default Playwright viewport dimensions\nexport const BR"
},
{
"path": "src/context/auth.tsx",
"chars": 4937,
"preview": "import { useReducer, createContext, useEffect, useCallback } from 'react';\nimport axios from 'axios';\nimport { useNaviga"
},
{
"path": "src/context/browserActions.tsx",
"chars": 6834,
"preview": "import React, { createContext, useContext, useState, ReactNode } from 'react';\nimport { useSocketStore } from './socket'"
}
]
// ... and 26 more files (download for full content)
About this extraction
This page contains the full source code of the getmaxun/maxun GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 226 files (2.3 MB), approximately 613.2k tokens, and a symbol index with 753 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.