web-agent-bridge 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sdk/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # WAB Agent SDK
2
+
3
+ SDK for building AI agents that interact with [Web Agent Bridge](https://github.com/abokenan444/web-agent-bridge).
4
+
5
+ ## Quick Start
6
+
7
+ ```javascript
8
+ const puppeteer = require('puppeteer');
9
+ const { WABAgent } = require('web-agent-bridge/sdk');
10
+
11
+ const browser = await puppeteer.launch();
12
+ const page = await browser.newPage();
13
+
14
+ const agent = new WABAgent(page);
15
+ await agent.navigateAndWait('https://example.com');
16
+
17
+ // Discover available actions
18
+ const actions = await agent.getActions();
19
+ console.log(actions);
20
+
21
+ // Execute an action
22
+ const result = await agent.execute('signup', { email: 'user@example.com' });
23
+
24
+ // Read page content
25
+ const content = await agent.readContent('h1');
26
+
27
+ await browser.close();
28
+ ```
29
+
30
+ ## BiDi Mode
31
+
32
+ ```javascript
33
+ const agent = new WABAgent(page, { useBiDi: true });
34
+ await agent.waitForBridge();
35
+
36
+ const context = await agent.getBiDiContext();
37
+ const actions = await agent.getActions();
38
+ await agent.execute('click-login');
39
+ ```
40
+
41
+ ## API
42
+
43
+ | Method | Description |
44
+ |---|---|
45
+ | `waitForBridge()` | Wait for WAB to load on the page |
46
+ | `hasBridge()` | Check if WAB is available |
47
+ | `getActions(category?)` | List available actions |
48
+ | `getAction(name)` | Get a specific action |
49
+ | `execute(name, params?)` | Execute an action |
50
+ | `readContent(selector)` | Read element text content |
51
+ | `getPageInfo()` | Get page metadata |
52
+ | `authenticate(apiKey, meta?)` | Authenticate the agent |
53
+ | `navigateAndWait(url)` | Navigate and wait for bridge |
54
+ | `executeSteps(steps)` | Execute multiple actions in sequence |
55
+ | `getBiDiContext()` | Get BiDi context (BiDi mode only) |
package/sdk/index.js ADDED
@@ -0,0 +1,167 @@
1
+ /**
2
+ * WAB Agent SDK
3
+ *
4
+ * Helpers for building AI agents that interact with Web Agent Bridge.
5
+ * Works with Puppeteer, Playwright, or any browser automation tool.
6
+ *
7
+ * Usage:
8
+ * const { WABAgent } = require('./sdk');
9
+ * const agent = new WABAgent(page);
10
+ * await agent.waitForBridge();
11
+ * const actions = await agent.getActions();
12
+ * await agent.execute('signup', { email: 'test@example.com' });
13
+ */
14
+
15
+ class WABAgent {
16
+ /**
17
+ * @param {object} page — A Puppeteer or Playwright page object
18
+ * @param {object} [options]
19
+ * @param {number} [options.timeout=10000] — Default timeout in ms
20
+ * @param {boolean} [options.useBiDi=false] — Use BiDi interface instead of AICommands
21
+ */
22
+ constructor(page, options = {}) {
23
+ this.page = page;
24
+ this.timeout = options.timeout || 10000;
25
+ this.useBiDi = options.useBiDi || false;
26
+ this._biDiId = 0;
27
+ }
28
+
29
+ /**
30
+ * Wait for the WAB bridge to be ready on the page.
31
+ * @returns {Promise<boolean>}
32
+ */
33
+ async waitForBridge() {
34
+ const iface = this.useBiDi ? '__wab_bidi' : 'AICommands';
35
+ await this.page.waitForFunction(
36
+ (name) => typeof window[name] !== 'undefined',
37
+ { timeout: this.timeout },
38
+ iface
39
+ );
40
+ return true;
41
+ }
42
+
43
+ /**
44
+ * Check if the bridge is loaded on the current page.
45
+ * @returns {Promise<boolean>}
46
+ */
47
+ async hasBridge() {
48
+ const iface = this.useBiDi ? '__wab_bidi' : 'AICommands';
49
+ return this.page.evaluate((name) => typeof window[name] !== 'undefined', iface);
50
+ }
51
+
52
+ /**
53
+ * Get all available actions.
54
+ * @param {string} [category] — Optional category filter
55
+ * @returns {Promise<Array>}
56
+ */
57
+ async getActions(category) {
58
+ if (this.useBiDi) {
59
+ const result = await this._bidiSend('wab.getActions', category ? { category } : {});
60
+ return result.result || [];
61
+ }
62
+ return this.page.evaluate((cat) => window.AICommands.getActions(cat), category);
63
+ }
64
+
65
+ /**
66
+ * Get a single action by name.
67
+ * @param {string} name
68
+ * @returns {Promise<object|null>}
69
+ */
70
+ async getAction(name) {
71
+ return this.page.evaluate((n) => window.AICommands.getAction(n), name);
72
+ }
73
+
74
+ /**
75
+ * Execute an action by name.
76
+ * @param {string} name — Action name
77
+ * @param {object} [params] — Action parameters
78
+ * @returns {Promise<object>}
79
+ */
80
+ async execute(name, params) {
81
+ if (this.useBiDi) {
82
+ const result = await this._bidiSend('wab.executeAction', { name, data: params || {} });
83
+ return result.result || result;
84
+ }
85
+ return this.page.evaluate(
86
+ (n, p) => window.AICommands.execute(n, p),
87
+ name, params
88
+ );
89
+ }
90
+
91
+ /**
92
+ * Read text content of an element.
93
+ * @param {string} selector — CSS selector
94
+ * @returns {Promise<object>}
95
+ */
96
+ async readContent(selector) {
97
+ if (this.useBiDi) {
98
+ const result = await this._bidiSend('wab.readContent', { selector });
99
+ return result.result || result;
100
+ }
101
+ return this.page.evaluate((sel) => window.AICommands.readContent(sel), selector);
102
+ }
103
+
104
+ /**
105
+ * Get page info and bridge metadata.
106
+ * @returns {Promise<object>}
107
+ */
108
+ async getPageInfo() {
109
+ if (this.useBiDi) {
110
+ const result = await this._bidiSend('wab.getPageInfo');
111
+ return result.result || result;
112
+ }
113
+ return this.page.evaluate(() => window.AICommands.getPageInfo());
114
+ }
115
+
116
+ /**
117
+ * Authenticate an agent with the bridge.
118
+ * @param {string} apiKey
119
+ * @param {object} [meta] — Agent metadata
120
+ * @returns {Promise<object>}
121
+ */
122
+ async authenticate(apiKey, meta) {
123
+ return this.page.evaluate(
124
+ (key, m) => window.AICommands.authenticate(key, m),
125
+ apiKey, meta
126
+ );
127
+ }
128
+
129
+ /**
130
+ * Navigate to a URL and wait for the bridge.
131
+ * @param {string} url
132
+ * @returns {Promise<void>}
133
+ */
134
+ async navigateAndWait(url) {
135
+ await this.page.goto(url, { waitUntil: 'networkidle2' });
136
+ await this.waitForBridge();
137
+ }
138
+
139
+ /**
140
+ * Execute multiple actions in sequence.
141
+ * @param {Array<{name: string, params?: object}>} steps
142
+ * @returns {Promise<Array>}
143
+ */
144
+ async executeSteps(steps) {
145
+ const results = [];
146
+ for (const step of steps) {
147
+ results.push(await this.execute(step.name, step.params));
148
+ }
149
+ return results;
150
+ }
151
+
152
+ /**
153
+ * Get BiDi context (only available when useBiDi is true).
154
+ * @returns {Promise<object>}
155
+ */
156
+ async getBiDiContext() {
157
+ return this.page.evaluate(() => window.__wab_bidi.getContext());
158
+ }
159
+
160
+ /** @private */
161
+ async _bidiSend(method, params = {}) {
162
+ const cmd = { id: ++this._biDiId, method, params };
163
+ return this.page.evaluate((c) => window.__wab_bidi.send(c), cmd);
164
+ }
165
+ }
166
+
167
+ module.exports = { WABAgent };
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@anthropic-wab/agent-sdk",
3
+ "version": "1.0.0",
4
+ "description": "SDK for building AI agents that interact with Web Agent Bridge (WAB)",
5
+ "main": "index.js",
6
+ "license": "MIT",
7
+ "keywords": ["wab", "ai-agent", "sdk", "web-automation", "bridge"],
8
+ "peerDependencies": {
9
+ "puppeteer": ">=20.0.0"
10
+ },
11
+ "peerDependenciesMeta": {
12
+ "puppeteer": { "optional": true }
13
+ }
14
+ }
@@ -0,0 +1,105 @@
1
+ require('dotenv').config();
2
+
3
+ const express = require('express');
4
+ const http = require('http');
5
+ const cors = require('cors');
6
+ const helmet = require('helmet');
7
+ const rateLimit = require('express-rate-limit');
8
+ const path = require('path');
9
+ const { setupWebSocket } = require('./ws');
10
+
11
+ const authRoutes = require('./routes/auth');
12
+ const apiRoutes = require('./routes/api');
13
+ const licenseRoutes = require('./routes/license');
14
+
15
+ const app = express();
16
+ const PORT = process.env.PORT || 3000;
17
+
18
+ // ─── Security & Middleware ──────────────────────────────────────────────
19
+ app.use(helmet({
20
+ contentSecurityPolicy: {
21
+ directives: {
22
+ defaultSrc: ["'self'"],
23
+ scriptSrc: ["'self'", "'unsafe-inline'"],
24
+ styleSrc: ["'self'", "'unsafe-inline'"],
25
+ imgSrc: ["'self'", "data:", "https:"],
26
+ connectSrc: ["'self'", "ws:", "wss:"],
27
+ fontSrc: ["'self'", "https:", "data:"],
28
+ frameSrc: ["'none'"],
29
+ frameAncestors: ["'none'"],
30
+ objectSrc: ["'none'"],
31
+ baseUri: ["'self'"]
32
+ }
33
+ },
34
+ crossOriginEmbedderPolicy: false
35
+ }));
36
+ app.use(cors());
37
+ app.use(express.json());
38
+
39
+ const apiLimiter = rateLimit({
40
+ windowMs: 15 * 60 * 1000,
41
+ max: 200,
42
+ standardHeaders: true,
43
+ legacyHeaders: false,
44
+ message: { error: 'Too many requests, please try again later' }
45
+ });
46
+
47
+ const licenseLimiter = rateLimit({
48
+ windowMs: 60 * 1000,
49
+ max: 120,
50
+ standardHeaders: true,
51
+ legacyHeaders: false
52
+ });
53
+
54
+ // ─── Static Files ───────────────────────────────────────────────────────
55
+ app.use(express.static(path.join(__dirname, '..', 'public')));
56
+ app.use('/script', express.static(path.join(__dirname, '..', 'script')));
57
+
58
+ // ─── API Routes ─────────────────────────────────────────────────────────
59
+ app.use('/api/auth', apiLimiter, authRoutes);
60
+ app.use('/api', apiLimiter, apiRoutes);
61
+ app.use('/api/license', licenseLimiter, licenseRoutes);
62
+
63
+ // ─── HTML Routes ────────────────────────────────────────────────────────
64
+ app.get('/dashboard', (req, res) => {
65
+ res.sendFile(path.join(__dirname, '..', 'public', 'dashboard.html'));
66
+ });
67
+ app.get('/docs', (req, res) => {
68
+ res.sendFile(path.join(__dirname, '..', 'public', 'docs.html'));
69
+ });
70
+ app.get('/login', (req, res) => {
71
+ res.sendFile(path.join(__dirname, '..', 'public', 'login.html'));
72
+ });
73
+ app.get('/register', (req, res) => {
74
+ res.sendFile(path.join(__dirname, '..', 'public', 'register.html'));
75
+ });
76
+
77
+ // ─── CDN Versioned Script ───────────────────────────────────────────────
78
+ const pkg = require('../package.json');
79
+ app.use(`/v${pkg.version.split('.')[0]}`, express.static(path.join(__dirname, '..', 'script')));
80
+ app.use('/latest', express.static(path.join(__dirname, '..', 'script')));
81
+
82
+ // ─── SPA Fallback ───────────────────────────────────────────────────────
83
+ app.get('*', (req, res) => {
84
+ if (req.accepts('html')) {
85
+ res.sendFile(path.join(__dirname, '..', 'public', 'index.html'));
86
+ } else {
87
+ res.status(404).json({ error: 'Not found' });
88
+ }
89
+ });
90
+
91
+ // ─── Start ──────────────────────────────────────────────────────────────
92
+ if (process.env.NODE_ENV !== 'test') {
93
+ const server = http.createServer(app);
94
+ setupWebSocket(server);
95
+
96
+ server.listen(PORT, () => {
97
+ console.log(`\n ╔══════════════════════════════════════════╗`);
98
+ console.log(` ║ Web Agent Bridge v${pkg.version} ║`);
99
+ console.log(` ║ Server running on http://localhost:${PORT} ║`);
100
+ console.log(` ║ WebSocket: ws://localhost:${PORT}/ws/analytics ║`);
101
+ console.log(` ╚══════════════════════════════════════════╝\n`);
102
+ });
103
+ }
104
+
105
+ module.exports = app;
@@ -0,0 +1,44 @@
1
+ const jwt = require('jsonwebtoken');
2
+
3
+ const JWT_SECRET = process.env.JWT_SECRET || 'dev-secret-change-in-production';
4
+
5
+ function generateToken(user) {
6
+ return jwt.sign(
7
+ { id: user.id, email: user.email, name: user.name },
8
+ JWT_SECRET,
9
+ { expiresIn: '7d' }
10
+ );
11
+ }
12
+
13
+ function authenticateToken(req, res, next) {
14
+ const authHeader = req.headers['authorization'];
15
+ const token = authHeader && authHeader.split(' ')[1];
16
+
17
+ if (!token) {
18
+ return res.status(401).json({ error: 'Access token required' });
19
+ }
20
+
21
+ try {
22
+ const decoded = jwt.verify(token, JWT_SECRET);
23
+ req.user = decoded;
24
+ next();
25
+ } catch (err) {
26
+ return res.status(403).json({ error: 'Invalid or expired token' });
27
+ }
28
+ }
29
+
30
+ function optionalAuth(req, res, next) {
31
+ const authHeader = req.headers['authorization'];
32
+ const token = authHeader && authHeader.split(' ')[1];
33
+
34
+ if (token) {
35
+ try {
36
+ req.user = jwt.verify(token, JWT_SECRET);
37
+ } catch (e) {
38
+ // ignore invalid tokens for optional auth
39
+ }
40
+ }
41
+ next();
42
+ }
43
+
44
+ module.exports = { generateToken, authenticateToken, optionalAuth };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Database Adapter Interface
3
+ *
4
+ * WAB supports multiple database backends via adapters.
5
+ * Set DB_ADAPTER environment variable to choose: sqlite (default), postgresql, mysql
6
+ *
7
+ * For PostgreSQL:
8
+ * npm install pg
9
+ * DB_ADAPTER=postgresql DATABASE_URL=postgres://user:pass@host:5432/wab
10
+ *
11
+ * For MySQL:
12
+ * npm install mysql2
13
+ * DB_ADAPTER=mysql DATABASE_URL=mysql://user:pass@host:3306/wab
14
+ */
15
+
16
+ const adapter = process.env.DB_ADAPTER || 'sqlite';
17
+
18
+ let db;
19
+ switch (adapter) {
20
+ case 'postgresql':
21
+ case 'postgres':
22
+ db = require('./postgresql');
23
+ break;
24
+ case 'mysql':
25
+ db = require('./mysql');
26
+ break;
27
+ case 'sqlite':
28
+ default:
29
+ db = require('./sqlite');
30
+ break;
31
+ }
32
+
33
+ module.exports = db;
@@ -0,0 +1,183 @@
1
+ /**
2
+ * MySQL Adapter for WAB
3
+ *
4
+ * Prerequisites: npm install mysql2
5
+ * Set DATABASE_URL=mysql://user:pass@host:3306/wab
6
+ *
7
+ * This adapter implements the same interface as the SQLite adapter
8
+ * so it can be used as a drop-in replacement.
9
+ */
10
+
11
+ const mysql = require('mysql2/promise');
12
+ const bcrypt = require('bcryptjs');
13
+ const { v4: uuidv4 } = require('uuid');
14
+
15
+ const pool = mysql.createPool(process.env.DATABASE_URL);
16
+
17
+ // Initialize tables
18
+ async function initDB() {
19
+ const conn = await pool.getConnection();
20
+ try {
21
+ await conn.query(`
22
+ CREATE TABLE IF NOT EXISTS users (
23
+ id VARCHAR(36) PRIMARY KEY,
24
+ email VARCHAR(255) UNIQUE NOT NULL,
25
+ password VARCHAR(255) NOT NULL,
26
+ name VARCHAR(255) NOT NULL,
27
+ company VARCHAR(255),
28
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
29
+ updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
30
+ )
31
+ `);
32
+ await conn.query(`
33
+ CREATE TABLE IF NOT EXISTS sites (
34
+ id VARCHAR(36) PRIMARY KEY,
35
+ user_id VARCHAR(36) NOT NULL,
36
+ domain VARCHAR(255) NOT NULL,
37
+ name VARCHAR(255) NOT NULL,
38
+ description TEXT,
39
+ tier ENUM('free','starter','pro','enterprise') DEFAULT 'free',
40
+ license_key VARCHAR(30) UNIQUE NOT NULL,
41
+ api_key VARCHAR(50) UNIQUE,
42
+ config JSON,
43
+ active BOOLEAN DEFAULT TRUE,
44
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
45
+ updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
46
+ FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
47
+ INDEX idx_sites_domain (domain),
48
+ INDEX idx_sites_license (license_key)
49
+ )
50
+ `);
51
+ await conn.query(`
52
+ CREATE TABLE IF NOT EXISTS analytics (
53
+ id INT AUTO_INCREMENT PRIMARY KEY,
54
+ site_id VARCHAR(36) NOT NULL,
55
+ action_name VARCHAR(255) NOT NULL,
56
+ agent_id VARCHAR(255),
57
+ trigger_type VARCHAR(50),
58
+ success BOOLEAN,
59
+ metadata JSON,
60
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
61
+ FOREIGN KEY (site_id) REFERENCES sites(id) ON DELETE CASCADE,
62
+ INDEX idx_analytics_site (site_id),
63
+ INDEX idx_analytics_created (created_at)
64
+ )
65
+ `);
66
+ await conn.query(`
67
+ CREATE TABLE IF NOT EXISTS subscriptions (
68
+ id VARCHAR(36) PRIMARY KEY,
69
+ user_id VARCHAR(36) NOT NULL,
70
+ site_id VARCHAR(36) NOT NULL,
71
+ tier ENUM('free','starter','pro','enterprise') NOT NULL,
72
+ status ENUM('active','cancelled','expired','trial') DEFAULT 'active',
73
+ started_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
74
+ expires_at TIMESTAMP NULL,
75
+ FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
76
+ FOREIGN KEY (site_id) REFERENCES sites(id) ON DELETE CASCADE
77
+ )
78
+ `);
79
+ } finally {
80
+ conn.release();
81
+ }
82
+ }
83
+
84
+ initDB().catch(console.error);
85
+
86
+ function generateLicenseKey() {
87
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
88
+ const segments = [];
89
+ for (let s = 0; s < 4; s++) {
90
+ let seg = '';
91
+ for (let i = 0; i < 5; i++) seg += chars[Math.floor(Math.random() * chars.length)];
92
+ segments.push(seg);
93
+ }
94
+ return `WAB-${segments.join('-')}`;
95
+ }
96
+
97
+ function generateApiKey() {
98
+ return `wab_${uuidv4().replace(/-/g, '')}`;
99
+ }
100
+
101
+ // ─── User Operations ──────────────────────────────────────────────────
102
+ async function registerUser({ email, password, name, company }) {
103
+ const id = uuidv4();
104
+ const hashed = bcrypt.hashSync(password, 12);
105
+ await pool.execute(
106
+ 'INSERT INTO users (id, email, password, name, company) VALUES (?, ?, ?, ?, ?)',
107
+ [id, email, hashed, name, company || null]
108
+ );
109
+ return { id, email, name, company };
110
+ }
111
+
112
+ async function loginUser({ email, password }) {
113
+ const [rows] = await pool.execute('SELECT * FROM users WHERE email = ?', [email]);
114
+ const user = rows[0];
115
+ if (!user) return null;
116
+ if (!bcrypt.compareSync(password, user.password)) return null;
117
+ return { id: user.id, email: user.email, name: user.name, company: user.company };
118
+ }
119
+
120
+ // ─── Site Operations ──────────────────────────────────────────────────
121
+ async function addSite({ userId, domain, name, description, tier }) {
122
+ const id = uuidv4();
123
+ const licenseKey = generateLicenseKey();
124
+ const apiKey = generateApiKey();
125
+ const config = JSON.stringify({
126
+ agentPermissions: { readContent: true, click: true, fillForms: false, scroll: true, navigate: false, apiAccess: false, automatedLogin: false, extractData: false },
127
+ features: { advancedAnalytics: false, realTimeUpdates: false },
128
+ restrictions: { allowedSelectors: [], blockedSelectors: ['.private', '[data-private]'], rateLimit: { maxCallsPerMinute: 60 } },
129
+ logging: { enabled: false, level: 'basic' }
130
+ });
131
+ await pool.execute(
132
+ 'INSERT INTO sites (id, user_id, domain, name, description, tier, license_key, api_key, config) VALUES (?,?,?,?,?,?,?,?,?)',
133
+ [id, userId, domain, name, description || '', tier || 'free', licenseKey, apiKey, config]
134
+ );
135
+ return { id, domain, name, licenseKey, apiKey, tier: tier || 'free' };
136
+ }
137
+
138
+ // ─── Analytics ────────────────────────────────────────────────────────
139
+ async function recordAnalytic({ siteId, actionName, agentId, triggerType, success, metadata }) {
140
+ await pool.execute(
141
+ 'INSERT INTO analytics (site_id, action_name, agent_id, trigger_type, success, metadata) VALUES (?,?,?,?,?,?)',
142
+ [siteId, actionName, agentId || null, triggerType || null, success ? 1 : 0, JSON.stringify(metadata || {})]
143
+ );
144
+ }
145
+
146
+ // ─── License Verification ─────────────────────────────────────────────
147
+ async function verifyLicense(domain, licenseKey) {
148
+ const [rows] = await pool.execute(
149
+ 'SELECT * FROM sites WHERE domain = ? AND license_key = ? AND active = TRUE', [domain, licenseKey]
150
+ );
151
+ const site = rows[0];
152
+ if (!site) {
153
+ const [byKey] = await pool.execute('SELECT * FROM sites WHERE license_key = ? AND active = TRUE', [licenseKey]);
154
+ if (byKey[0]) return { valid: false, error: 'Domain mismatch', tier: 'free' };
155
+ return { valid: false, error: 'Invalid license key', tier: 'free' };
156
+ }
157
+
158
+ const tierPermissions = {
159
+ free: { apiAccess: false, automatedLogin: false, extractData: false, advancedAnalytics: false },
160
+ starter: { apiAccess: false, automatedLogin: true, extractData: false, advancedAnalytics: true },
161
+ pro: { apiAccess: true, automatedLogin: true, extractData: true, advancedAnalytics: true },
162
+ enterprise: { apiAccess: true, automatedLogin: true, extractData: true, advancedAnalytics: true }
163
+ };
164
+
165
+ const config = typeof site.config === 'string' ? JSON.parse(site.config) : site.config;
166
+ return {
167
+ valid: true,
168
+ tier: site.tier,
169
+ permissions: { ...config.agentPermissions, ...tierPermissions[site.tier] },
170
+ restrictions: config.restrictions,
171
+ features: config.features,
172
+ siteId: site.id
173
+ };
174
+ }
175
+
176
+ module.exports = {
177
+ registerUser,
178
+ loginUser,
179
+ addSite,
180
+ recordAnalytic,
181
+ verifyLicense,
182
+ pool
183
+ };