diff --git a/.agents/skills/agent-browser/SKILL.md b/.agents/skills/agent-browser/SKILL.md new file mode 100644 index 00000000..89275797 --- /dev/null +++ b/.agents/skills/agent-browser/SKILL.md @@ -0,0 +1,690 @@ +--- +name: agent-browser +description: Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. +allowed-tools: Bash(npx agent-browser:*), Bash(agent-browser:*) +--- + +# Browser Automation with agent-browser + +The CLI uses Chrome/Chromium via CDP directly. Install via `npm i -g agent-browser`, `brew install agent-browser`, or `cargo install agent-browser`. Run `agent-browser install` to download Chrome. Run `agent-browser upgrade` to update to the latest version. + +## Core Workflow + +Every browser automation follows this pattern: + +1. **Navigate**: `agent-browser open ` +2. **Snapshot**: `agent-browser snapshot -i` (get element refs like `@e1`, `@e2`) +3. **Interact**: Use refs to click, fill, select +4. **Re-snapshot**: After navigation or DOM changes, get fresh refs + +```bash +agent-browser open https://example.com/form +agent-browser snapshot -i +# Output: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Submit" + +agent-browser fill @e1 "user@example.com" +agent-browser fill @e2 "password123" +agent-browser click @e3 +agent-browser wait --load networkidle +agent-browser snapshot -i # Check result +``` + +## Command Chaining + +Commands can be chained with `&&` in a single shell invocation. The browser persists between commands via a background daemon, so chaining is safe and more efficient than separate calls. + +```bash +# Chain open + wait + snapshot in one call +agent-browser open https://example.com && agent-browser wait --load networkidle && agent-browser snapshot -i + +# Chain multiple interactions +agent-browser fill @e1 "user@example.com" && agent-browser fill @e2 "password123" && agent-browser click @e3 + +# Navigate and capture +agent-browser open https://example.com && agent-browser wait --load networkidle && agent-browser screenshot page.png +``` + +**When to chain:** Use `&&` when you don't need to read the output of an intermediate command before proceeding (e.g., open + wait + screenshot). Run commands separately when you need to parse the output first (e.g., snapshot to discover refs, then interact using those refs). + +## Handling Authentication + +When automating a site that requires login, choose the approach that fits: + +**Option 1: Import auth from the user's browser (fastest for one-off tasks)** + +```bash +# Connect to the user's running Chrome (they're already logged in) +agent-browser --auto-connect state save ./auth.json +# Use that auth state +agent-browser --state ./auth.json open https://app.example.com/dashboard +``` + +State files contain session tokens in plaintext -- add to `.gitignore` and delete when no longer needed. Set `AGENT_BROWSER_ENCRYPTION_KEY` for encryption at rest. + +**Option 2: Persistent profile (simplest for recurring tasks)** + +```bash +# First run: login manually or via automation +agent-browser --profile ~/.myapp open https://app.example.com/login +# ... fill credentials, submit ... + +# All future runs: already authenticated +agent-browser --profile ~/.myapp open https://app.example.com/dashboard +``` + +**Option 3: Session name (auto-save/restore cookies + localStorage)** + +```bash +agent-browser --session-name myapp open https://app.example.com/login +# ... login flow ... +agent-browser close # State auto-saved + +# Next time: state auto-restored +agent-browser --session-name myapp open https://app.example.com/dashboard +``` + +**Option 4: Auth vault (credentials stored encrypted, login by name)** + +```bash +echo "$PASSWORD" | agent-browser auth save myapp --url https://app.example.com/login --username user --password-stdin +agent-browser auth login myapp +``` + +`auth login` navigates with `load` and then waits for login form selectors to appear before filling/clicking, which is more reliable on delayed SPA login screens. + +**Option 5: State file (manual save/load)** + +```bash +# After logging in: +agent-browser state save ./auth.json +# In a future session: +agent-browser state load ./auth.json +agent-browser open https://app.example.com/dashboard +``` + +See [references/authentication.md](references/authentication.md) for OAuth, 2FA, cookie-based auth, and token refresh patterns. + +## Essential Commands + +```bash +# Navigation +agent-browser open # Navigate (aliases: goto, navigate) +agent-browser close # Close browser + +# Snapshot +agent-browser snapshot -i # Interactive elements with refs (recommended) +agent-browser snapshot -s "#selector" # Scope to CSS selector + +# Interaction (use @refs from snapshot) +agent-browser click @e1 # Click element +agent-browser click @e1 --new-tab # Click and open in new tab +agent-browser fill @e2 "text" # Clear and type text +agent-browser type @e2 "text" # Type without clearing +agent-browser select @e1 "option" # Select dropdown option +agent-browser check @e1 # Check checkbox +agent-browser press Enter # Press key +agent-browser keyboard type "text" # Type at current focus (no selector) +agent-browser keyboard inserttext "text" # Insert without key events +agent-browser scroll down 500 # Scroll page +agent-browser scroll down 500 --selector "div.content" # Scroll within a specific container + +# Get information +agent-browser get text @e1 # Get element text +agent-browser get url # Get current URL +agent-browser get title # Get page title +agent-browser get cdp-url # Get CDP WebSocket URL + +# Wait +agent-browser wait @e1 # Wait for element +agent-browser wait --load networkidle # Wait for network idle +agent-browser wait --url "**/page" # Wait for URL pattern +agent-browser wait 2000 # Wait milliseconds +agent-browser wait --text "Welcome" # Wait for text to appear (substring match) +agent-browser wait --fn "!document.body.innerText.includes('Loading...')" # Wait for text to disappear +agent-browser wait "#spinner" --state hidden # Wait for element to disappear + +# Downloads +agent-browser download @e1 ./file.pdf # Click element to trigger download +agent-browser wait --download ./output.zip # Wait for any download to complete +agent-browser --download-path ./downloads open # Set default download directory + +# Network +agent-browser network requests # Inspect tracked requests +agent-browser network requests --type xhr,fetch # Filter by resource type +agent-browser network requests --method POST # Filter by HTTP method +agent-browser network requests --status 2xx # Filter by status (200, 2xx, 400-499) +agent-browser network request # View full request/response detail +agent-browser network route "**/api/*" --abort # Block matching requests +agent-browser network har start # Start HAR recording +agent-browser network har stop ./capture.har # Stop and save HAR file + +# Viewport & Device Emulation +agent-browser set viewport 1920 1080 # Set viewport size (default: 1280x720) +agent-browser set viewport 1920 1080 2 # 2x retina (same CSS size, higher res screenshots) +agent-browser set device "iPhone 14" # Emulate device (viewport + user agent) + +# Capture +agent-browser screenshot # Screenshot to temp dir +agent-browser screenshot --full # Full page screenshot +agent-browser screenshot --annotate # Annotated screenshot with numbered element labels +agent-browser screenshot --screenshot-dir ./shots # Save to custom directory +agent-browser screenshot --screenshot-format jpeg --screenshot-quality 80 +agent-browser pdf output.pdf # Save as PDF + +# Clipboard +agent-browser clipboard read # Read text from clipboard +agent-browser clipboard write "Hello, World!" # Write text to clipboard +agent-browser clipboard copy # Copy current selection +agent-browser clipboard paste # Paste from clipboard + +# Diff (compare page states) +agent-browser diff snapshot # Compare current vs last snapshot +agent-browser diff snapshot --baseline before.txt # Compare current vs saved file +agent-browser diff screenshot --baseline before.png # Visual pixel diff +agent-browser diff url # Compare two pages +agent-browser diff url --wait-until networkidle # Custom wait strategy +agent-browser diff url --selector "#main" # Scope to element +``` + +## Batch Execution + +Execute multiple commands in a single invocation by piping a JSON array of string arrays to `batch`. This avoids per-command process startup overhead when running multi-step workflows. + +```bash +echo '[ + ["open", "https://example.com"], + ["snapshot", "-i"], + ["click", "@e1"], + ["screenshot", "result.png"] +]' | agent-browser batch --json + +# Stop on first error +agent-browser batch --bail < commands.json +``` + +Use `batch` when you have a known sequence of commands that don't depend on intermediate output. Use separate commands or `&&` chaining when you need to parse output between steps (e.g., snapshot to discover refs, then interact). + +## Common Patterns + +### Form Submission + +```bash +agent-browser open https://example.com/signup +agent-browser snapshot -i +agent-browser fill @e1 "Jane Doe" +agent-browser fill @e2 "jane@example.com" +agent-browser select @e3 "California" +agent-browser check @e4 +agent-browser click @e5 +agent-browser wait --load networkidle +``` + +### Authentication with Auth Vault (Recommended) + +```bash +# Save credentials once (encrypted with AGENT_BROWSER_ENCRYPTION_KEY) +# Recommended: pipe password via stdin to avoid shell history exposure +echo "pass" | agent-browser auth save github --url https://github.com/login --username user --password-stdin + +# Login using saved profile (LLM never sees password) +agent-browser auth login github + +# List/show/delete profiles +agent-browser auth list +agent-browser auth show github +agent-browser auth delete github +``` + +`auth login` waits for username/password/submit selectors before interacting, with a timeout tied to the default action timeout. + +### Authentication with State Persistence + +```bash +# Login once and save state +agent-browser open https://app.example.com/login +agent-browser snapshot -i +agent-browser fill @e1 "$USERNAME" +agent-browser fill @e2 "$PASSWORD" +agent-browser click @e3 +agent-browser wait --url "**/dashboard" +agent-browser state save auth.json + +# Reuse in future sessions +agent-browser state load auth.json +agent-browser open https://app.example.com/dashboard +``` + +### Session Persistence + +```bash +# Auto-save/restore cookies and localStorage across browser restarts +agent-browser --session-name myapp open https://app.example.com/login +# ... login flow ... +agent-browser close # State auto-saved to ~/.agent-browser/sessions/ + +# Next time, state is auto-loaded +agent-browser --session-name myapp open https://app.example.com/dashboard + +# Encrypt state at rest +export AGENT_BROWSER_ENCRYPTION_KEY=$(openssl rand -hex 32) +agent-browser --session-name secure open https://app.example.com + +# Manage saved states +agent-browser state list +agent-browser state show myapp-default.json +agent-browser state clear myapp +agent-browser state clean --older-than 7 +``` + +### Working with Iframes + +Iframe content is automatically inlined in snapshots. Refs inside iframes carry frame context, so you can interact with them directly. + +```bash +agent-browser open https://example.com/checkout +agent-browser snapshot -i +# @e1 [heading] "Checkout" +# @e2 [Iframe] "payment-frame" +# @e3 [input] "Card number" +# @e4 [input] "Expiry" +# @e5 [button] "Pay" + +# Interact directly — no frame switch needed +agent-browser fill @e3 "4111111111111111" +agent-browser fill @e4 "12/28" +agent-browser click @e5 + +# To scope a snapshot to one iframe: +agent-browser frame @e2 +agent-browser snapshot -i # Only iframe content +agent-browser frame main # Return to main frame +``` + +### Data Extraction + +```bash +agent-browser open https://example.com/products +agent-browser snapshot -i +agent-browser get text @e5 # Get specific element text +agent-browser get text body > page.txt # Get all page text + +# JSON output for parsing +agent-browser snapshot -i --json +agent-browser get text @e1 --json +``` + +### Parallel Sessions + +```bash +agent-browser --session site1 open https://site-a.com +agent-browser --session site2 open https://site-b.com + +agent-browser --session site1 snapshot -i +agent-browser --session site2 snapshot -i + +agent-browser session list +``` + +### Connect to Existing Chrome + +```bash +# Auto-discover running Chrome with remote debugging enabled +agent-browser --auto-connect open https://example.com +agent-browser --auto-connect snapshot + +# Or with explicit CDP port +agent-browser --cdp 9222 snapshot +``` + +Auto-connect discovers Chrome via `DevToolsActivePort`, common debugging ports (9222, 9229), and falls back to a direct WebSocket connection if HTTP-based CDP discovery fails. + +### Color Scheme (Dark Mode) + +```bash +# Persistent dark mode via flag (applies to all pages and new tabs) +agent-browser --color-scheme dark open https://example.com + +# Or via environment variable +AGENT_BROWSER_COLOR_SCHEME=dark agent-browser open https://example.com + +# Or set during session (persists for subsequent commands) +agent-browser set media dark +``` + +### Viewport & Responsive Testing + +```bash +# Set a custom viewport size (default is 1280x720) +agent-browser set viewport 1920 1080 +agent-browser screenshot desktop.png + +# Test mobile-width layout +agent-browser set viewport 375 812 +agent-browser screenshot mobile.png + +# Retina/HiDPI: same CSS layout at 2x pixel density +# Screenshots stay at logical viewport size, but content renders at higher DPI +agent-browser set viewport 1920 1080 2 +agent-browser screenshot retina.png + +# Device emulation (sets viewport + user agent in one step) +agent-browser set device "iPhone 14" +agent-browser screenshot device.png +``` + +The `scale` parameter (3rd argument) sets `window.devicePixelRatio` without changing CSS layout. Use it when testing retina rendering or capturing higher-resolution screenshots. + +### Visual Browser (Debugging) + +```bash +agent-browser --headed open https://example.com +agent-browser highlight @e1 # Highlight element +agent-browser inspect # Open Chrome DevTools for the active page +agent-browser record start demo.webm # Record session +agent-browser profiler start # Start Chrome DevTools profiling +agent-browser profiler stop trace.json # Stop and save profile (path optional) +``` + +Use `AGENT_BROWSER_HEADED=1` to enable headed mode via environment variable. Browser extensions work in both headed and headless mode. + +### Local Files (PDFs, HTML) + +```bash +# Open local files with file:// URLs +agent-browser --allow-file-access open file:///path/to/document.pdf +agent-browser --allow-file-access open file:///path/to/page.html +agent-browser screenshot output.png +``` + +### iOS Simulator (Mobile Safari) + +```bash +# List available iOS simulators +agent-browser device list + +# Launch Safari on a specific device +agent-browser -p ios --device "iPhone 16 Pro" open https://example.com + +# Same workflow as desktop - snapshot, interact, re-snapshot +agent-browser -p ios snapshot -i +agent-browser -p ios tap @e1 # Tap (alias for click) +agent-browser -p ios fill @e2 "text" +agent-browser -p ios swipe up # Mobile-specific gesture + +# Take screenshot +agent-browser -p ios screenshot mobile.png + +# Close session (shuts down simulator) +agent-browser -p ios close +``` + +**Requirements:** macOS with Xcode, Appium (`npm install -g appium && appium driver install xcuitest`) + +**Real devices:** Works with physical iOS devices if pre-configured. Use `--device ""` where UDID is from `xcrun xctrace list devices`. + +## Security + +All security features are opt-in. By default, agent-browser imposes no restrictions on navigation, actions, or output. + +### Content Boundaries (Recommended for AI Agents) + +Enable `--content-boundaries` to wrap page-sourced output in markers that help LLMs distinguish tool output from untrusted page content: + +```bash +export AGENT_BROWSER_CONTENT_BOUNDARIES=1 +agent-browser snapshot +# Output: +# --- AGENT_BROWSER_PAGE_CONTENT nonce= origin=https://example.com --- +# [accessibility tree] +# --- END_AGENT_BROWSER_PAGE_CONTENT nonce= --- +``` + +### Domain Allowlist + +Restrict navigation to trusted domains. Wildcards like `*.example.com` also match the bare domain `example.com`. Sub-resource requests, WebSocket, and EventSource connections to non-allowed domains are also blocked. Include CDN domains your target pages depend on: + +```bash +export AGENT_BROWSER_ALLOWED_DOMAINS="example.com,*.example.com" +agent-browser open https://example.com # OK +agent-browser open https://malicious.com # Blocked +``` + +### Action Policy + +Use a policy file to gate destructive actions: + +```bash +export AGENT_BROWSER_ACTION_POLICY=./policy.json +``` + +Example `policy.json`: + +```json +{ "default": "deny", "allow": ["navigate", "snapshot", "click", "scroll", "wait", "get"] } +``` + +Auth vault operations (`auth login`, etc.) bypass action policy but domain allowlist still applies. + +### Output Limits + +Prevent context flooding from large pages: + +```bash +export AGENT_BROWSER_MAX_OUTPUT=50000 +``` + +## Diffing (Verifying Changes) + +Use `diff snapshot` after performing an action to verify it had the intended effect. This compares the current accessibility tree against the last snapshot taken in the session. + +```bash +# Typical workflow: snapshot -> action -> diff +agent-browser snapshot -i # Take baseline snapshot +agent-browser click @e2 # Perform action +agent-browser diff snapshot # See what changed (auto-compares to last snapshot) +``` + +For visual regression testing or monitoring: + +```bash +# Save a baseline screenshot, then compare later +agent-browser screenshot baseline.png +# ... time passes or changes are made ... +agent-browser diff screenshot --baseline baseline.png + +# Compare staging vs production +agent-browser diff url https://staging.example.com https://prod.example.com --screenshot +``` + +`diff snapshot` output uses `+` for additions and `-` for removals, similar to git diff. `diff screenshot` produces a diff image with changed pixels highlighted in red, plus a mismatch percentage. + +## Timeouts and Slow Pages + +The default timeout is 25 seconds. This can be overridden with the `AGENT_BROWSER_DEFAULT_TIMEOUT` environment variable (value in milliseconds). For slow websites or large pages, use explicit waits instead of relying on the default timeout: + +```bash +# Wait for network activity to settle (best for slow pages) +agent-browser wait --load networkidle + +# Wait for a specific element to appear +agent-browser wait "#content" +agent-browser wait @e1 + +# Wait for a specific URL pattern (useful after redirects) +agent-browser wait --url "**/dashboard" + +# Wait for a JavaScript condition +agent-browser wait --fn "document.readyState === 'complete'" + +# Wait a fixed duration (milliseconds) as a last resort +agent-browser wait 5000 +``` + +When dealing with consistently slow websites, use `wait --load networkidle` after `open` to ensure the page is fully loaded before taking a snapshot. If a specific element is slow to render, wait for it directly with `wait ` or `wait @ref`. + +## Session Management and Cleanup + +When running multiple agents or automations concurrently, always use named sessions to avoid conflicts: + +```bash +# Each agent gets its own isolated session +agent-browser --session agent1 open site-a.com +agent-browser --session agent2 open site-b.com + +# Check active sessions +agent-browser session list +``` + +Always close your browser session when done to avoid leaked processes: + +```bash +agent-browser close # Close default session +agent-browser --session agent1 close # Close specific session +``` + +If a previous session was not closed properly, the daemon may still be running. Use `agent-browser close` to clean it up before starting new work. + +To auto-shutdown the daemon after a period of inactivity (useful for ephemeral/CI environments): + +```bash +AGENT_BROWSER_IDLE_TIMEOUT_MS=60000 agent-browser open example.com +``` + +## Ref Lifecycle (Important) + +Refs (`@e1`, `@e2`, etc.) are invalidated when the page changes. Always re-snapshot after: + +- Clicking links or buttons that navigate +- Form submissions +- Dynamic content loading (dropdowns, modals) + +```bash +agent-browser click @e5 # Navigates to new page +agent-browser snapshot -i # MUST re-snapshot +agent-browser click @e1 # Use new refs +``` + +## Annotated Screenshots (Vision Mode) + +Use `--annotate` to take a screenshot with numbered labels overlaid on interactive elements. Each label `[N]` maps to ref `@eN`. This also caches refs, so you can interact with elements immediately without a separate snapshot. + +```bash +agent-browser screenshot --annotate +# Output includes the image path and a legend: +# [1] @e1 button "Submit" +# [2] @e2 link "Home" +# [3] @e3 textbox "Email" +agent-browser click @e2 # Click using ref from annotated screenshot +``` + +Use annotated screenshots when: + +- The page has unlabeled icon buttons or visual-only elements +- You need to verify visual layout or styling +- Canvas or chart elements are present (invisible to text snapshots) +- You need spatial reasoning about element positions + +## Semantic Locators (Alternative to Refs) + +When refs are unavailable or unreliable, use semantic locators: + +```bash +agent-browser find text "Sign In" click +agent-browser find label "Email" fill "user@test.com" +agent-browser find role button click --name "Submit" +agent-browser find placeholder "Search" type "query" +agent-browser find testid "submit-btn" click +``` + +## JavaScript Evaluation (eval) + +Use `eval` to run JavaScript in the browser context. **Shell quoting can corrupt complex expressions** -- use `--stdin` or `-b` to avoid issues. + +```bash +# Simple expressions work with regular quoting +agent-browser eval 'document.title' +agent-browser eval 'document.querySelectorAll("img").length' + +# Complex JS: use --stdin with heredoc (RECOMMENDED) +agent-browser eval --stdin <<'EVALEOF' +JSON.stringify( + Array.from(document.querySelectorAll("img")) + .filter(i => !i.alt) + .map(i => ({ src: i.src.split("/").pop(), width: i.width })) +) +EVALEOF + +# Alternative: base64 encoding (avoids all shell escaping issues) +agent-browser eval -b "$(echo -n 'Array.from(document.querySelectorAll("a")).map(a => a.href)' | base64)" +``` + +**Why this matters:** When the shell processes your command, inner double quotes, `!` characters (history expansion), backticks, and `$()` can all corrupt the JavaScript before it reaches agent-browser. The `--stdin` and `-b` flags bypass shell interpretation entirely. + +**Rules of thumb:** + +- Single-line, no nested quotes -> regular `eval 'expression'` with single quotes is fine +- Nested quotes, arrow functions, template literals, or multiline -> use `eval --stdin <<'EVALEOF'` +- Programmatic/generated scripts -> use `eval -b` with base64 + +## Configuration File + +Create `agent-browser.json` in the project root for persistent settings: + +```json +{ + "headed": true, + "proxy": "http://localhost:8080", + "profile": "./browser-data" +} +``` + +Priority (lowest to highest): `~/.agent-browser/config.json` < `./agent-browser.json` < env vars < CLI flags. Use `--config ` or `AGENT_BROWSER_CONFIG` env var for a custom config file (exits with error if missing/invalid). All CLI options map to camelCase keys (e.g., `--executable-path` -> `"executablePath"`). Boolean flags accept `true`/`false` values (e.g., `--headed false` overrides config). Extensions from user and project configs are merged, not replaced. + +## Deep-Dive Documentation + +| Reference | When to Use | +| -------------------------------------------------------------------- | --------------------------------------------------------- | +| [references/commands.md](references/commands.md) | Full command reference with all options | +| [references/snapshot-refs.md](references/snapshot-refs.md) | Ref lifecycle, invalidation rules, troubleshooting | +| [references/session-management.md](references/session-management.md) | Parallel sessions, state persistence, concurrent scraping | +| [references/authentication.md](references/authentication.md) | Login flows, OAuth, 2FA handling, state reuse | +| [references/video-recording.md](references/video-recording.md) | Recording workflows for debugging and documentation | +| [references/profiling.md](references/profiling.md) | Chrome DevTools profiling for performance analysis | +| [references/proxy-support.md](references/proxy-support.md) | Proxy configuration, geo-testing, rotating proxies | + +## Browser Engine Selection + +Use `--engine` to choose a local browser engine. The default is `chrome`. + +```bash +# Use Lightpanda (fast headless browser, requires separate install) +agent-browser --engine lightpanda open example.com + +# Via environment variable +export AGENT_BROWSER_ENGINE=lightpanda +agent-browser open example.com + +# With custom binary path +agent-browser --engine lightpanda --executable-path /path/to/lightpanda open example.com +``` + +Supported engines: + +- `chrome` (default) -- Chrome/Chromium via CDP +- `lightpanda` -- Lightpanda headless browser via CDP (10x faster, 10x less memory than Chrome) + +Lightpanda does not support `--extension`, `--profile`, `--state`, or `--allow-file-access`. Install Lightpanda from https://lightpanda.io/docs/open-source/installation. + +## Ready-to-Use Templates + +| Template | Description | +| ------------------------------------------------------------------------ | ----------------------------------- | +| [templates/form-automation.sh](templates/form-automation.sh) | Form filling with validation | +| [templates/authenticated-session.sh](templates/authenticated-session.sh) | Login once, reuse state | +| [templates/capture-workflow.sh](templates/capture-workflow.sh) | Content extraction with screenshots | + +```bash +./templates/form-automation.sh https://example.com/form +./templates/authenticated-session.sh https://app.example.com/login +./templates/capture-workflow.sh https://example.com ./output +``` diff --git a/.agents/skills/agent-browser/references/authentication.md b/.agents/skills/agent-browser/references/authentication.md new file mode 100644 index 00000000..d5b86a77 --- /dev/null +++ b/.agents/skills/agent-browser/references/authentication.md @@ -0,0 +1,306 @@ +# Authentication Patterns + +Login flows, session persistence, OAuth, 2FA, and authenticated browsing. + +**Related**: [session-management.md](session-management.md) for state persistence details, [SKILL.md](../SKILL.md) for quick start. + +## Contents + +- [Import Auth from Your Browser](#import-auth-from-your-browser) +- [Persistent Profiles](#persistent-profiles) +- [Session Persistence](#session-persistence) +- [Basic Login Flow](#basic-login-flow) +- [Saving Authentication State](#saving-authentication-state) +- [Restoring Authentication](#restoring-authentication) +- [OAuth / SSO Flows](#oauth--sso-flows) +- [Two-Factor Authentication](#two-factor-authentication) +- [HTTP Basic Auth](#http-basic-auth) +- [Cookie-Based Auth](#cookie-based-auth) +- [Token Refresh Handling](#token-refresh-handling) +- [Security Best Practices](#security-best-practices) + +## Import Auth from Your Browser + +The fastest way to authenticate is to reuse cookies from a Chrome session you are already logged into. + +**Step 1: Start Chrome with remote debugging** + +```bash +# macOS +"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --remote-debugging-port=9222 + +# Linux +google-chrome --remote-debugging-port=9222 + +# Windows +"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 +``` + +Log in to your target site(s) in this Chrome window as you normally would. + +> **Security note:** `--remote-debugging-port` exposes full browser control on localhost. Any local process can connect and read cookies, execute JS, etc. Only use on trusted machines and close Chrome when done. + +**Step 2: Grab the auth state** + +```bash +# Auto-discover the running Chrome and save its cookies + localStorage +agent-browser --auto-connect state save ./my-auth.json +``` + +**Step 3: Reuse in automation** + +```bash +# Load auth at launch +agent-browser --state ./my-auth.json open https://app.example.com/dashboard + +# Or load into an existing session +agent-browser state load ./my-auth.json +agent-browser open https://app.example.com/dashboard +``` + +This works for any site, including those with complex OAuth flows, SSO, or 2FA -- as long as Chrome already has valid session cookies. + +> **Security note:** State files contain session tokens in plaintext. Add them to `.gitignore`, delete when no longer needed, and set `AGENT_BROWSER_ENCRYPTION_KEY` for encryption at rest. See [Security Best Practices](#security-best-practices). + +**Tip:** Combine with `--session-name` so the imported auth auto-persists across restarts: + +```bash +agent-browser --session-name myapp state load ./my-auth.json +# From now on, state is auto-saved/restored for "myapp" +``` + +## Persistent Profiles + +Use `--profile` to point agent-browser at a Chrome user data directory. This persists everything (cookies, IndexedDB, service workers, cache) across browser restarts without explicit save/load: + +```bash +# First run: login once +agent-browser --profile ~/.myapp-profile open https://app.example.com/login +# ... complete login flow ... + +# All subsequent runs: already authenticated +agent-browser --profile ~/.myapp-profile open https://app.example.com/dashboard +``` + +Use different paths for different projects or test users: + +```bash +agent-browser --profile ~/.profiles/admin open https://app.example.com +agent-browser --profile ~/.profiles/viewer open https://app.example.com +``` + +Or set via environment variable: + +```bash +export AGENT_BROWSER_PROFILE=~/.myapp-profile +agent-browser open https://app.example.com/dashboard +``` + +## Session Persistence + +Use `--session-name` to auto-save and restore cookies + localStorage by name, without managing files: + +```bash +# Auto-saves state on close, auto-restores on next launch +agent-browser --session-name twitter open https://twitter.com +# ... login flow ... +agent-browser close # state saved to ~/.agent-browser/sessions/ + +# Next time: state is automatically restored +agent-browser --session-name twitter open https://twitter.com +``` + +Encrypt state at rest: + +```bash +export AGENT_BROWSER_ENCRYPTION_KEY=$(openssl rand -hex 32) +agent-browser --session-name secure open https://app.example.com +``` + +## Basic Login Flow + +```bash +# Navigate to login page +agent-browser open https://app.example.com/login +agent-browser wait --load networkidle + +# Get form elements +agent-browser snapshot -i +# Output: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Sign In" + +# Fill credentials +agent-browser fill @e1 "user@example.com" +agent-browser fill @e2 "password123" + +# Submit +agent-browser click @e3 +agent-browser wait --load networkidle + +# Verify login succeeded +agent-browser get url # Should be dashboard, not login +``` + +## Saving Authentication State + +After logging in, save state for reuse: + +```bash +# Login first (see above) +agent-browser open https://app.example.com/login +agent-browser snapshot -i +agent-browser fill @e1 "user@example.com" +agent-browser fill @e2 "password123" +agent-browser click @e3 +agent-browser wait --url "**/dashboard" + +# Save authenticated state +agent-browser state save ./auth-state.json +``` + +## Restoring Authentication + +Skip login by loading saved state: + +```bash +# Load saved auth state +agent-browser state load ./auth-state.json + +# Navigate directly to protected page +agent-browser open https://app.example.com/dashboard + +# Verify authenticated +agent-browser snapshot -i +``` + +## OAuth / SSO Flows + +For OAuth redirects: + +```bash +# Start OAuth flow +agent-browser open https://app.example.com/auth/google + +# Handle redirects automatically +agent-browser wait --url "**/accounts.google.com**" +agent-browser snapshot -i + +# Fill Google credentials +agent-browser fill @e1 "user@gmail.com" +agent-browser click @e2 # Next button +agent-browser wait 2000 +agent-browser snapshot -i +agent-browser fill @e3 "password" +agent-browser click @e4 # Sign in + +# Wait for redirect back +agent-browser wait --url "**/app.example.com**" +agent-browser state save ./oauth-state.json +``` + +## Two-Factor Authentication + +Handle 2FA with manual intervention: + +```bash +# Login with credentials +agent-browser open https://app.example.com/login --headed # Show browser +agent-browser snapshot -i +agent-browser fill @e1 "user@example.com" +agent-browser fill @e2 "password123" +agent-browser click @e3 + +# Wait for user to complete 2FA manually +echo "Complete 2FA in the browser window..." +agent-browser wait --url "**/dashboard" --timeout 120000 + +# Save state after 2FA +agent-browser state save ./2fa-state.json +``` + +## HTTP Basic Auth + +For sites using HTTP Basic Authentication: + +```bash +# Set credentials before navigation +agent-browser set credentials username password + +# Navigate to protected resource +agent-browser open https://protected.example.com/api +``` + +## Cookie-Based Auth + +Manually set authentication cookies: + +```bash +# Set auth cookie +agent-browser cookies set session_token "abc123xyz" + +# Navigate to protected page +agent-browser open https://app.example.com/dashboard +``` + +## Token Refresh Handling + +For sessions with expiring tokens: + +```bash +#!/bin/bash +# Wrapper that handles token refresh + +STATE_FILE="./auth-state.json" + +# Try loading existing state +if [[ -f "$STATE_FILE" ]]; then + agent-browser state load "$STATE_FILE" + agent-browser open https://app.example.com/dashboard + + # Check if session is still valid + URL=$(agent-browser get url) + if [[ "$URL" == *"/login"* ]]; then + echo "Session expired, re-authenticating..." + # Perform fresh login + agent-browser snapshot -i + agent-browser fill @e1 "$USERNAME" + agent-browser fill @e2 "$PASSWORD" + agent-browser click @e3 + agent-browser wait --url "**/dashboard" + agent-browser state save "$STATE_FILE" + fi +else + # First-time login + agent-browser open https://app.example.com/login + # ... login flow ... +fi +``` + +## Security Best Practices + +1. **Never commit state files** - They contain session tokens + + ```bash + echo "*.auth-state.json" >> .gitignore + ``` + +2. **Use environment variables for credentials** + + ```bash + agent-browser fill @e1 "$APP_USERNAME" + agent-browser fill @e2 "$APP_PASSWORD" + ``` + +3. **Clean up after automation** + + ```bash + agent-browser cookies clear + rm -f ./auth-state.json + ``` + +4. **Use short-lived sessions for CI/CD** + ```bash + # Don't persist state in CI + agent-browser open https://app.example.com/login + # ... login and perform actions ... + agent-browser close # Session ends, nothing persisted + ``` diff --git a/.agents/skills/agent-browser/references/commands.md b/.agents/skills/agent-browser/references/commands.md new file mode 100644 index 00000000..198f3152 --- /dev/null +++ b/.agents/skills/agent-browser/references/commands.md @@ -0,0 +1,293 @@ +# Command Reference + +Complete reference for all agent-browser commands. For quick start and common patterns, see SKILL.md. + +## Navigation + +```bash +agent-browser open # Navigate to URL (aliases: goto, navigate) + # Supports: https://, http://, file://, about:, data:// + # Auto-prepends https:// if no protocol given +agent-browser back # Go back +agent-browser forward # Go forward +agent-browser reload # Reload page +agent-browser close # Close browser (aliases: quit, exit) +agent-browser connect 9222 # Connect to browser via CDP port +``` + +## Snapshot (page analysis) + +```bash +agent-browser snapshot # Full accessibility tree +agent-browser snapshot -i # Interactive elements only (recommended) +agent-browser snapshot -c # Compact output +agent-browser snapshot -d 3 # Limit depth to 3 +agent-browser snapshot -s "#main" # Scope to CSS selector +``` + +## Interactions (use @refs from snapshot) + +```bash +agent-browser click @e1 # Click +agent-browser click @e1 --new-tab # Click and open in new tab +agent-browser dblclick @e1 # Double-click +agent-browser focus @e1 # Focus element +agent-browser fill @e2 "text" # Clear and type +agent-browser type @e2 "text" # Type without clearing +agent-browser press Enter # Press key (alias: key) +agent-browser press Control+a # Key combination +agent-browser keydown Shift # Hold key down +agent-browser keyup Shift # Release key +agent-browser hover @e1 # Hover +agent-browser check @e1 # Check checkbox +agent-browser uncheck @e1 # Uncheck checkbox +agent-browser select @e1 "value" # Select dropdown option +agent-browser select @e1 "a" "b" # Select multiple options +agent-browser scroll down 500 # Scroll page (default: down 300px) +agent-browser scrollintoview @e1 # Scroll element into view (alias: scrollinto) +agent-browser drag @e1 @e2 # Drag and drop +agent-browser upload @e1 file.pdf # Upload files +``` + +## Get Information + +```bash +agent-browser get text @e1 # Get element text +agent-browser get html @e1 # Get innerHTML +agent-browser get value @e1 # Get input value +agent-browser get attr @e1 href # Get attribute +agent-browser get title # Get page title +agent-browser get url # Get current URL +agent-browser get cdp-url # Get CDP WebSocket URL +agent-browser get count ".item" # Count matching elements +agent-browser get box @e1 # Get bounding box +agent-browser get styles @e1 # Get computed styles (font, color, bg, etc.) +``` + +## Check State + +```bash +agent-browser is visible @e1 # Check if visible +agent-browser is enabled @e1 # Check if enabled +agent-browser is checked @e1 # Check if checked +``` + +## Screenshots and PDF + +```bash +agent-browser screenshot # Save to temporary directory +agent-browser screenshot path.png # Save to specific path +agent-browser screenshot --full # Full page +agent-browser pdf output.pdf # Save as PDF +``` + +## Video Recording + +```bash +agent-browser record start ./demo.webm # Start recording +agent-browser click @e1 # Perform actions +agent-browser record stop # Stop and save video +agent-browser record restart ./take2.webm # Stop current + start new +``` + +## Wait + +```bash +agent-browser wait @e1 # Wait for element +agent-browser wait 2000 # Wait milliseconds +agent-browser wait --text "Success" # Wait for text (or -t) +agent-browser wait --url "**/dashboard" # Wait for URL pattern (or -u) +agent-browser wait --load networkidle # Wait for network idle (or -l) +agent-browser wait --fn "window.ready" # Wait for JS condition (or -f) +``` + +## Mouse Control + +```bash +agent-browser mouse move 100 200 # Move mouse +agent-browser mouse down left # Press button +agent-browser mouse up left # Release button +agent-browser mouse wheel 100 # Scroll wheel +``` + +## Semantic Locators (alternative to refs) + +```bash +agent-browser find role button click --name "Submit" +agent-browser find text "Sign In" click +agent-browser find text "Sign In" click --exact # Exact match only +agent-browser find label "Email" fill "user@test.com" +agent-browser find placeholder "Search" type "query" +agent-browser find alt "Logo" click +agent-browser find title "Close" click +agent-browser find testid "submit-btn" click +agent-browser find first ".item" click +agent-browser find last ".item" click +agent-browser find nth 2 "a" hover +``` + +## Browser Settings + +```bash +agent-browser set viewport 1920 1080 # Set viewport size +agent-browser set viewport 1920 1080 2 # 2x retina (same CSS size, higher res screenshots) +agent-browser set device "iPhone 14" # Emulate device +agent-browser set geo 37.7749 -122.4194 # Set geolocation (alias: geolocation) +agent-browser set offline on # Toggle offline mode +agent-browser set headers '{"X-Key":"v"}' # Extra HTTP headers +agent-browser set credentials user pass # HTTP basic auth (alias: auth) +agent-browser set media dark # Emulate color scheme +agent-browser set media light reduced-motion # Light mode + reduced motion +``` + +## Cookies and Storage + +```bash +agent-browser cookies # Get all cookies +agent-browser cookies set name value # Set cookie +agent-browser cookies clear # Clear cookies +agent-browser storage local # Get all localStorage +agent-browser storage local key # Get specific key +agent-browser storage local set k v # Set value +agent-browser storage local clear # Clear all +``` + +## Network + +```bash +agent-browser network route # Intercept requests +agent-browser network route --abort # Block requests +agent-browser network route --body '{}' # Mock response +agent-browser network unroute [url] # Remove routes +agent-browser network requests # View tracked requests +agent-browser network requests --filter api # Filter requests +``` + +## Tabs and Windows + +```bash +agent-browser tab # List tabs +agent-browser tab new [url] # New tab +agent-browser tab 2 # Switch to tab by index +agent-browser tab close # Close current tab +agent-browser tab close 2 # Close tab by index +agent-browser window new # New window +``` + +## Frames + +```bash +agent-browser frame "#iframe" # Switch to iframe by CSS selector +agent-browser frame @e3 # Switch to iframe by element ref +agent-browser frame main # Back to main frame +``` + +### Iframe support + +Iframes are detected automatically during snapshots. When the main-frame snapshot runs, `Iframe` nodes are resolved and their content is inlined beneath the iframe element in the output (one level of nesting; iframes within iframes are not expanded). + +```bash +agent-browser snapshot -i +# @e3 [Iframe] "payment-frame" +# @e4 [input] "Card number" +# @e5 [button] "Pay" + +# Interact directly — refs inside iframes already work +agent-browser fill @e4 "4111111111111111" +agent-browser click @e5 + +# Or switch frame context for scoped snapshots +agent-browser frame @e3 # Switch using element ref +agent-browser snapshot -i # Snapshot scoped to that iframe +agent-browser frame main # Return to main frame +``` + +The `frame` command accepts: + +- **Element refs** — `frame @e3` resolves the ref to an iframe element +- **CSS selectors** — `frame "#payment-iframe"` finds the iframe by selector +- **Frame name/URL** — matches against the browser's frame tree + +## Dialogs + +```bash +agent-browser dialog accept [text] # Accept dialog +agent-browser dialog dismiss # Dismiss dialog +``` + +## JavaScript + +```bash +agent-browser eval "document.title" # Simple expressions only +agent-browser eval -b "" # Any JavaScript (base64 encoded) +agent-browser eval --stdin # Read script from stdin +``` + +Use `-b`/`--base64` or `--stdin` for reliable execution. Shell escaping with nested quotes and special characters is error-prone. + +```bash +# Base64 encode your script, then: +agent-browser eval -b "ZG9jdW1lbnQucXVlcnlTZWxlY3RvcignW3NyYyo9Il9uZXh0Il0nKQ==" + +# Or use stdin with heredoc for multiline scripts: +cat <<'EOF' | agent-browser eval --stdin +const links = document.querySelectorAll('a'); +Array.from(links).map(a => a.href); +EOF +``` + +## State Management + +```bash +agent-browser state save auth.json # Save cookies, storage, auth state +agent-browser state load auth.json # Restore saved state +``` + +## Global Options + +```bash +agent-browser --session ... # Isolated browser session +agent-browser --json ... # JSON output for parsing +agent-browser --headed ... # Show browser window (not headless) +agent-browser --full ... # Full page screenshot (-f) +agent-browser --cdp ... # Connect via Chrome DevTools Protocol +agent-browser -p ... # Cloud browser provider (--provider) +agent-browser --proxy ... # Use proxy server +agent-browser --proxy-bypass # Hosts to bypass proxy +agent-browser --headers ... # HTTP headers scoped to URL's origin +agent-browser --executable-path

# Custom browser executable +agent-browser --extension ... # Load browser extension (repeatable) +agent-browser --ignore-https-errors # Ignore SSL certificate errors +agent-browser --help # Show help (-h) +agent-browser --version # Show version (-V) +agent-browser --help # Show detailed help for a command +``` + +## Debugging + +```bash +agent-browser --headed open example.com # Show browser window +agent-browser --cdp 9222 snapshot # Connect via CDP port +agent-browser connect 9222 # Alternative: connect command +agent-browser console # View console messages +agent-browser console --clear # Clear console +agent-browser errors # View page errors +agent-browser errors --clear # Clear errors +agent-browser highlight @e1 # Highlight element +agent-browser inspect # Open Chrome DevTools for this session +agent-browser trace start # Start recording trace +agent-browser trace stop trace.zip # Stop and save trace +agent-browser profiler start # Start Chrome DevTools profiling +agent-browser profiler stop trace.json # Stop and save profile +``` + +## Environment Variables + +```bash +AGENT_BROWSER_SESSION="mysession" # Default session name +AGENT_BROWSER_EXECUTABLE_PATH="/path/chrome" # Custom browser path +AGENT_BROWSER_EXTENSIONS="/ext1,/ext2" # Comma-separated extension paths +AGENT_BROWSER_PROVIDER="browserbase" # Cloud browser provider +AGENT_BROWSER_STREAM_PORT="9223" # WebSocket streaming port +AGENT_BROWSER_HOME="/path/to/agent-browser" # Custom install location +``` diff --git a/.agents/skills/agent-browser/references/profiling.md b/.agents/skills/agent-browser/references/profiling.md new file mode 100644 index 00000000..bd47eaa0 --- /dev/null +++ b/.agents/skills/agent-browser/references/profiling.md @@ -0,0 +1,120 @@ +# Profiling + +Capture Chrome DevTools performance profiles during browser automation for performance analysis. + +**Related**: [commands.md](commands.md) for full command reference, [SKILL.md](../SKILL.md) for quick start. + +## Contents + +- [Basic Profiling](#basic-profiling) +- [Profiler Commands](#profiler-commands) +- [Categories](#categories) +- [Use Cases](#use-cases) +- [Output Format](#output-format) +- [Viewing Profiles](#viewing-profiles) +- [Limitations](#limitations) + +## Basic Profiling + +```bash +# Start profiling +agent-browser profiler start + +# Perform actions +agent-browser navigate https://example.com +agent-browser click "#button" +agent-browser wait 1000 + +# Stop and save +agent-browser profiler stop ./trace.json +``` + +## Profiler Commands + +```bash +# Start profiling with default categories +agent-browser profiler start + +# Start with custom trace categories +agent-browser profiler start --categories "devtools.timeline,v8.execute,blink.user_timing" + +# Stop profiling and save to file +agent-browser profiler stop ./trace.json +``` + +## Categories + +The `--categories` flag accepts a comma-separated list of Chrome trace categories. Default categories include: + +- `devtools.timeline` -- standard DevTools performance traces +- `v8.execute` -- time spent running JavaScript +- `blink` -- renderer events +- `blink.user_timing` -- `performance.mark()` / `performance.measure()` calls +- `latencyInfo` -- input-to-latency tracking +- `renderer.scheduler` -- task scheduling and execution +- `toplevel` -- broad-spectrum basic events + +Several `disabled-by-default-*` categories are also included for detailed timeline, call stack, and V8 CPU profiling data. + +## Use Cases + +### Diagnosing Slow Page Loads + +```bash +agent-browser profiler start +agent-browser navigate https://app.example.com +agent-browser wait --load networkidle +agent-browser profiler stop ./page-load-profile.json +``` + +### Profiling User Interactions + +```bash +agent-browser navigate https://app.example.com +agent-browser profiler start +agent-browser click "#submit" +agent-browser wait 2000 +agent-browser profiler stop ./interaction-profile.json +``` + +### CI Performance Regression Checks + +```bash +#!/bin/bash +agent-browser profiler start +agent-browser navigate https://app.example.com +agent-browser wait --load networkidle +agent-browser profiler stop "./profiles/build-${BUILD_ID}.json" +``` + +## Output Format + +The output is a JSON file in Chrome Trace Event format: + +```json +{ + "traceEvents": [ + { "cat": "devtools.timeline", "name": "RunTask", "ph": "X", "ts": 12345, "dur": 100, ... }, + ... + ], + "metadata": { + "clock-domain": "LINUX_CLOCK_MONOTONIC" + } +} +``` + +The `metadata.clock-domain` field is set based on the host platform (Linux or macOS). On Windows it is omitted. + +## Viewing Profiles + +Load the output JSON file in any of these tools: + +- **Chrome DevTools**: Performance panel > Load profile (Ctrl+Shift+I > Performance) +- **Perfetto UI**: https://ui.perfetto.dev/ -- drag and drop the JSON file +- **Trace Viewer**: `chrome://tracing` in any Chromium browser + +## Limitations + +- Only works with Chromium-based browsers (Chrome, Edge). Not supported on Firefox or WebKit. +- Trace data accumulates in memory while profiling is active (capped at 5 million events). Stop profiling promptly after the area of interest. +- Data collection on stop has a 30-second timeout. If the browser is unresponsive, the stop command may fail. diff --git a/.agents/skills/agent-browser/references/proxy-support.md b/.agents/skills/agent-browser/references/proxy-support.md new file mode 100644 index 00000000..e86a8fe3 --- /dev/null +++ b/.agents/skills/agent-browser/references/proxy-support.md @@ -0,0 +1,194 @@ +# Proxy Support + +Proxy configuration for geo-testing, rate limiting avoidance, and corporate environments. + +**Related**: [commands.md](commands.md) for global options, [SKILL.md](../SKILL.md) for quick start. + +## Contents + +- [Basic Proxy Configuration](#basic-proxy-configuration) +- [Authenticated Proxy](#authenticated-proxy) +- [SOCKS Proxy](#socks-proxy) +- [Proxy Bypass](#proxy-bypass) +- [Common Use Cases](#common-use-cases) +- [Verifying Proxy Connection](#verifying-proxy-connection) +- [Troubleshooting](#troubleshooting) +- [Best Practices](#best-practices) + +## Basic Proxy Configuration + +Use the `--proxy` flag or set proxy via environment variable: + +```bash +# Via CLI flag +agent-browser --proxy "http://proxy.example.com:8080" open https://example.com + +# Via environment variable +export HTTP_PROXY="http://proxy.example.com:8080" +agent-browser open https://example.com + +# HTTPS proxy +export HTTPS_PROXY="https://proxy.example.com:8080" +agent-browser open https://example.com + +# Both +export HTTP_PROXY="http://proxy.example.com:8080" +export HTTPS_PROXY="http://proxy.example.com:8080" +agent-browser open https://example.com +``` + +## Authenticated Proxy + +For proxies requiring authentication: + +```bash +# Include credentials in URL +export HTTP_PROXY="http://username:password@proxy.example.com:8080" +agent-browser open https://example.com +``` + +## SOCKS Proxy + +```bash +# SOCKS5 proxy +export ALL_PROXY="socks5://proxy.example.com:1080" +agent-browser open https://example.com + +# SOCKS5 with auth +export ALL_PROXY="socks5://user:pass@proxy.example.com:1080" +agent-browser open https://example.com +``` + +## Proxy Bypass + +Skip proxy for specific domains using `--proxy-bypass` or `NO_PROXY`: + +```bash +# Via CLI flag +agent-browser --proxy "http://proxy.example.com:8080" --proxy-bypass "localhost,*.internal.com" open https://example.com + +# Via environment variable +export NO_PROXY="localhost,127.0.0.1,.internal.company.com" +agent-browser open https://internal.company.com # Direct connection +agent-browser open https://external.com # Via proxy +``` + +## Common Use Cases + +### Geo-Location Testing + +```bash +#!/bin/bash +# Test site from different regions using geo-located proxies + +PROXIES=( + "http://us-proxy.example.com:8080" + "http://eu-proxy.example.com:8080" + "http://asia-proxy.example.com:8080" +) + +for proxy in "${PROXIES[@]}"; do + export HTTP_PROXY="$proxy" + export HTTPS_PROXY="$proxy" + + region=$(echo "$proxy" | grep -oP '^\w+-\w+') + echo "Testing from: $region" + + agent-browser --session "$region" open https://example.com + agent-browser --session "$region" screenshot "./screenshots/$region.png" + agent-browser --session "$region" close +done +``` + +### Rotating Proxies for Scraping + +```bash +#!/bin/bash +# Rotate through proxy list to avoid rate limiting + +PROXY_LIST=( + "http://proxy1.example.com:8080" + "http://proxy2.example.com:8080" + "http://proxy3.example.com:8080" +) + +URLS=( + "https://site.com/page1" + "https://site.com/page2" + "https://site.com/page3" +) + +for i in "${!URLS[@]}"; do + proxy_index=$((i % ${#PROXY_LIST[@]})) + export HTTP_PROXY="${PROXY_LIST[$proxy_index]}" + export HTTPS_PROXY="${PROXY_LIST[$proxy_index]}" + + agent-browser open "${URLS[$i]}" + agent-browser get text body > "output-$i.txt" + agent-browser close + + sleep 1 # Polite delay +done +``` + +### Corporate Network Access + +```bash +#!/bin/bash +# Access internal sites via corporate proxy + +export HTTP_PROXY="http://corpproxy.company.com:8080" +export HTTPS_PROXY="http://corpproxy.company.com:8080" +export NO_PROXY="localhost,127.0.0.1,.company.com" + +# External sites go through proxy +agent-browser open https://external-vendor.com + +# Internal sites bypass proxy +agent-browser open https://intranet.company.com +``` + +## Verifying Proxy Connection + +```bash +# Check your apparent IP +agent-browser open https://httpbin.org/ip +agent-browser get text body +# Should show proxy's IP, not your real IP +``` + +## Troubleshooting + +### Proxy Connection Failed + +```bash +# Test proxy connectivity first +curl -x http://proxy.example.com:8080 https://httpbin.org/ip + +# Check if proxy requires auth +export HTTP_PROXY="http://user:pass@proxy.example.com:8080" +``` + +### SSL/TLS Errors Through Proxy + +Some proxies perform SSL inspection. If you encounter certificate errors: + +```bash +# For testing only - not recommended for production +agent-browser open https://example.com --ignore-https-errors +``` + +### Slow Performance + +```bash +# Use proxy only when necessary +export NO_PROXY="*.cdn.com,*.static.com" # Direct CDN access +``` + +## Best Practices + +1. **Use environment variables** - Don't hardcode proxy credentials +2. **Set NO_PROXY appropriately** - Avoid routing local traffic through proxy +3. **Test proxy before automation** - Verify connectivity with simple requests +4. **Handle proxy failures gracefully** - Implement retry logic for unstable proxies +5. **Rotate proxies for large scraping jobs** - Distribute load and avoid bans diff --git a/.agents/skills/agent-browser/references/session-management.md b/.agents/skills/agent-browser/references/session-management.md new file mode 100644 index 00000000..0297e9db --- /dev/null +++ b/.agents/skills/agent-browser/references/session-management.md @@ -0,0 +1,194 @@ +# Session Management + +Multiple isolated browser sessions with state persistence and concurrent browsing. + +**Related**: [authentication.md](authentication.md) for login patterns, [SKILL.md](../SKILL.md) for quick start. + +## Contents + +- [Named Sessions](#named-sessions) +- [Session Isolation Properties](#session-isolation-properties) +- [Session State Persistence](#session-state-persistence) +- [Common Patterns](#common-patterns) +- [Default Session](#default-session) +- [Session Cleanup](#session-cleanup) +- [Best Practices](#best-practices) + +## Named Sessions + +Use `--session` flag to isolate browser contexts: + +```bash +# Session 1: Authentication flow +agent-browser --session auth open https://app.example.com/login + +# Session 2: Public browsing (separate cookies, storage) +agent-browser --session public open https://example.com + +# Commands are isolated by session +agent-browser --session auth fill @e1 "user@example.com" +agent-browser --session public get text body +``` + +## Session Isolation Properties + +Each session has independent: + +- Cookies +- LocalStorage / SessionStorage +- IndexedDB +- Cache +- Browsing history +- Open tabs + +## Session State Persistence + +### Save Session State + +```bash +# Save cookies, storage, and auth state +agent-browser state save /path/to/auth-state.json +``` + +### Load Session State + +```bash +# Restore saved state +agent-browser state load /path/to/auth-state.json + +# Continue with authenticated session +agent-browser open https://app.example.com/dashboard +``` + +### State File Contents + +```json +{ + "cookies": [...], + "localStorage": {...}, + "sessionStorage": {...}, + "origins": [...] +} +``` + +## Common Patterns + +### Authenticated Session Reuse + +```bash +#!/bin/bash +# Save login state once, reuse many times + +STATE_FILE="/tmp/auth-state.json" + +# Check if we have saved state +if [[ -f "$STATE_FILE" ]]; then + agent-browser state load "$STATE_FILE" + agent-browser open https://app.example.com/dashboard +else + # Perform login + agent-browser open https://app.example.com/login + agent-browser snapshot -i + agent-browser fill @e1 "$USERNAME" + agent-browser fill @e2 "$PASSWORD" + agent-browser click @e3 + agent-browser wait --load networkidle + + # Save for future use + agent-browser state save "$STATE_FILE" +fi +``` + +### Concurrent Scraping + +```bash +#!/bin/bash +# Scrape multiple sites concurrently + +# Start all sessions +agent-browser --session site1 open https://site1.com & +agent-browser --session site2 open https://site2.com & +agent-browser --session site3 open https://site3.com & +wait + +# Extract from each +agent-browser --session site1 get text body > site1.txt +agent-browser --session site2 get text body > site2.txt +agent-browser --session site3 get text body > site3.txt + +# Cleanup +agent-browser --session site1 close +agent-browser --session site2 close +agent-browser --session site3 close +``` + +### A/B Testing Sessions + +```bash +# Test different user experiences +agent-browser --session variant-a open "https://app.com?variant=a" +agent-browser --session variant-b open "https://app.com?variant=b" + +# Compare +agent-browser --session variant-a screenshot /tmp/variant-a.png +agent-browser --session variant-b screenshot /tmp/variant-b.png +``` + +## Default Session + +When `--session` is omitted, commands use the default session: + +```bash +# These use the same default session +agent-browser open https://example.com +agent-browser snapshot -i +agent-browser close # Closes default session +``` + +## Session Cleanup + +```bash +# Close specific session +agent-browser --session auth close + +# List active sessions +agent-browser session list +``` + +## Best Practices + +### 1. Name Sessions Semantically + +```bash +# GOOD: Clear purpose +agent-browser --session github-auth open https://github.com +agent-browser --session docs-scrape open https://docs.example.com + +# AVOID: Generic names +agent-browser --session s1 open https://github.com +``` + +### 2. Always Clean Up + +```bash +# Close sessions when done +agent-browser --session auth close +agent-browser --session scrape close +``` + +### 3. Handle State Files Securely + +```bash +# Don't commit state files (contain auth tokens!) +echo "*.auth-state.json" >> .gitignore + +# Delete after use +rm /tmp/auth-state.json +``` + +### 4. Timeout Long Sessions + +```bash +# Set timeout for automated scripts +timeout 60 agent-browser --session long-task get text body +``` diff --git a/.agents/skills/agent-browser/references/snapshot-refs.md b/.agents/skills/agent-browser/references/snapshot-refs.md new file mode 100644 index 00000000..e3929ea7 --- /dev/null +++ b/.agents/skills/agent-browser/references/snapshot-refs.md @@ -0,0 +1,222 @@ +# Snapshot and Refs + +Compact element references that reduce context usage dramatically for AI agents. + +**Related**: [commands.md](commands.md) for full command reference, [SKILL.md](../SKILL.md) for quick start. + +## Contents + +- [How Refs Work](#how-refs-work) +- [Snapshot Command](#the-snapshot-command) +- [Using Refs](#using-refs) +- [Ref Lifecycle](#ref-lifecycle) +- [Best Practices](#best-practices) +- [Ref Notation Details](#ref-notation-details) +- [Troubleshooting](#troubleshooting) + +## How Refs Work + +Traditional approach: + +``` +Full DOM/HTML → AI parses → CSS selector → Action (~3000-5000 tokens) +``` + +agent-browser approach: + +``` +Compact snapshot → @refs assigned → Direct interaction (~200-400 tokens) +``` + +## The Snapshot Command + +```bash +# Basic snapshot (shows page structure) +agent-browser snapshot + +# Interactive snapshot (-i flag) - RECOMMENDED +agent-browser snapshot -i +``` + +### Snapshot Output Format + +``` +Page: Example Site - Home +URL: https://example.com + +@e1 [header] + @e2 [nav] + @e3 [a] "Home" + @e4 [a] "Products" + @e5 [a] "About" + @e6 [button] "Sign In" + +@e7 [main] + @e8 [h1] "Welcome" + @e9 [form] + @e10 [input type="email"] placeholder="Email" + @e11 [input type="password"] placeholder="Password" + @e12 [button type="submit"] "Log In" + +@e13 [footer] + @e14 [a] "Privacy Policy" +``` + +## Using Refs + +Once you have refs, interact directly: + +```bash +# Click the "Sign In" button +agent-browser click @e6 + +# Fill email input +agent-browser fill @e10 "user@example.com" + +# Fill password +agent-browser fill @e11 "password123" + +# Submit the form +agent-browser click @e12 +``` + +## Ref Lifecycle + +**IMPORTANT**: Refs are invalidated when the page changes! + +```bash +# Get initial snapshot +agent-browser snapshot -i +# @e1 [button] "Next" + +# Click triggers page change +agent-browser click @e1 + +# MUST re-snapshot to get new refs! +agent-browser snapshot -i +# @e1 [h1] "Page 2" ← Different element now! +``` + +## Best Practices + +### 1. Always Snapshot Before Interacting + +```bash +# CORRECT +agent-browser open https://example.com +agent-browser snapshot -i # Get refs first +agent-browser click @e1 # Use ref + +# WRONG +agent-browser open https://example.com +agent-browser click @e1 # Ref doesn't exist yet! +``` + +### 2. Re-Snapshot After Navigation + +```bash +agent-browser click @e5 # Navigates to new page +agent-browser snapshot -i # Get new refs +agent-browser click @e1 # Use new refs +``` + +### 3. Re-Snapshot After Dynamic Changes + +```bash +agent-browser click @e1 # Opens dropdown +agent-browser snapshot -i # See dropdown items +agent-browser click @e7 # Select item +``` + +### 4. Snapshot Specific Regions + +For complex pages, snapshot specific areas: + +```bash +# Snapshot just the form +agent-browser snapshot @e9 +``` + +## Ref Notation Details + +``` +@e1 [tag type="value"] "text content" placeholder="hint" +│ │ │ │ │ +│ │ │ │ └─ Additional attributes +│ │ │ └─ Visible text +│ │ └─ Key attributes shown +│ └─ HTML tag name +└─ Unique ref ID +``` + +### Common Patterns + +``` +@e1 [button] "Submit" # Button with text +@e2 [input type="email"] # Email input +@e3 [input type="password"] # Password input +@e4 [a href="/page"] "Link Text" # Anchor link +@e5 [select] # Dropdown +@e6 [textarea] placeholder="Message" # Text area +@e7 [div class="modal"] # Container (when relevant) +@e8 [img alt="Logo"] # Image +@e9 [checkbox] checked # Checked checkbox +@e10 [radio] selected # Selected radio +``` + +## Iframes + +Snapshots automatically detect and inline iframe content. When the main-frame snapshot runs, each `Iframe` node is resolved and its child accessibility tree is included directly beneath it in the output. Refs assigned to elements inside iframes carry frame context, so interactions like `click`, `fill`, and `type` work without manually switching frames. + +```bash +agent-browser snapshot -i +# @e1 [heading] "Checkout" +# @e2 [Iframe] "payment-frame" +# @e3 [input] "Card number" +# @e4 [input] "Expiry" +# @e5 [button] "Pay" +# @e6 [button] "Cancel" + +# Interact with iframe elements directly using their refs +agent-browser fill @e3 "4111111111111111" +agent-browser fill @e4 "12/28" +agent-browser click @e5 +``` + +**Key details:** + +- Only one level of iframe nesting is expanded (iframes within iframes are not recursed) +- Cross-origin iframes that block accessibility tree access are silently skipped +- Empty iframes or iframes with no interactive content are omitted from the output +- To scope a snapshot to a single iframe, use `frame @ref` then `snapshot -i` + +## Troubleshooting + +### "Ref not found" Error + +```bash +# Ref may have changed - re-snapshot +agent-browser snapshot -i +``` + +### Element Not Visible in Snapshot + +```bash +# Scroll down to reveal element +agent-browser scroll down 1000 +agent-browser snapshot -i + +# Or wait for dynamic content +agent-browser wait 1000 +agent-browser snapshot -i +``` + +### Too Many Elements + +```bash +# Snapshot specific container +agent-browser snapshot @e5 + +# Or use get text for content-only extraction +agent-browser get text @e5 +``` diff --git a/.agents/skills/agent-browser/references/video-recording.md b/.agents/skills/agent-browser/references/video-recording.md new file mode 100644 index 00000000..e6a9fb4e --- /dev/null +++ b/.agents/skills/agent-browser/references/video-recording.md @@ -0,0 +1,173 @@ +# Video Recording + +Capture browser automation as video for debugging, documentation, or verification. + +**Related**: [commands.md](commands.md) for full command reference, [SKILL.md](../SKILL.md) for quick start. + +## Contents + +- [Basic Recording](#basic-recording) +- [Recording Commands](#recording-commands) +- [Use Cases](#use-cases) +- [Best Practices](#best-practices) +- [Output Format](#output-format) +- [Limitations](#limitations) + +## Basic Recording + +```bash +# Start recording +agent-browser record start ./demo.webm + +# Perform actions +agent-browser open https://example.com +agent-browser snapshot -i +agent-browser click @e1 +agent-browser fill @e2 "test input" + +# Stop and save +agent-browser record stop +``` + +## Recording Commands + +```bash +# Start recording to file +agent-browser record start ./output.webm + +# Stop current recording +agent-browser record stop + +# Restart with new file (stops current + starts new) +agent-browser record restart ./take2.webm +``` + +## Use Cases + +### Debugging Failed Automation + +```bash +#!/bin/bash +# Record automation for debugging + +agent-browser record start ./debug-$(date +%Y%m%d-%H%M%S).webm + +# Run your automation +agent-browser open https://app.example.com +agent-browser snapshot -i +agent-browser click @e1 || { + echo "Click failed - check recording" + agent-browser record stop + exit 1 +} + +agent-browser record stop +``` + +### Documentation Generation + +```bash +#!/bin/bash +# Record workflow for documentation + +agent-browser record start ./docs/how-to-login.webm + +agent-browser open https://app.example.com/login +agent-browser wait 1000 # Pause for visibility + +agent-browser snapshot -i +agent-browser fill @e1 "demo@example.com" +agent-browser wait 500 + +agent-browser fill @e2 "password" +agent-browser wait 500 + +agent-browser click @e3 +agent-browser wait --load networkidle +agent-browser wait 1000 # Show result + +agent-browser record stop +``` + +### CI/CD Test Evidence + +```bash +#!/bin/bash +# Record E2E test runs for CI artifacts + +TEST_NAME="${1:-e2e-test}" +RECORDING_DIR="./test-recordings" +mkdir -p "$RECORDING_DIR" + +agent-browser record start "$RECORDING_DIR/$TEST_NAME-$(date +%s).webm" + +# Run test +if run_e2e_test; then + echo "Test passed" +else + echo "Test failed - recording saved" +fi + +agent-browser record stop +``` + +## Best Practices + +### 1. Add Pauses for Clarity + +```bash +# Slow down for human viewing +agent-browser click @e1 +agent-browser wait 500 # Let viewer see result +``` + +### 2. Use Descriptive Filenames + +```bash +# Include context in filename +agent-browser record start ./recordings/login-flow-2024-01-15.webm +agent-browser record start ./recordings/checkout-test-run-42.webm +``` + +### 3. Handle Recording in Error Cases + +```bash +#!/bin/bash +set -e + +cleanup() { + agent-browser record stop 2>/dev/null || true + agent-browser close 2>/dev/null || true +} +trap cleanup EXIT + +agent-browser record start ./automation.webm +# ... automation steps ... +``` + +### 4. Combine with Screenshots + +```bash +# Record video AND capture key frames +agent-browser record start ./flow.webm + +agent-browser open https://example.com +agent-browser screenshot ./screenshots/step1-homepage.png + +agent-browser click @e1 +agent-browser screenshot ./screenshots/step2-after-click.png + +agent-browser record stop +``` + +## Output Format + +- Default format: WebM (VP8/VP9 codec) +- Compatible with all modern browsers and video players +- Compressed but high quality + +## Limitations + +- Recording adds slight overhead to automation +- Large recordings can consume significant disk space +- Some headless environments may have codec limitations diff --git a/.agents/skills/agent-browser/templates/authenticated-session.sh b/.agents/skills/agent-browser/templates/authenticated-session.sh new file mode 100755 index 00000000..b66c9289 --- /dev/null +++ b/.agents/skills/agent-browser/templates/authenticated-session.sh @@ -0,0 +1,105 @@ +#!/bin/bash +# Template: Authenticated Session Workflow +# Purpose: Login once, save state, reuse for subsequent runs +# Usage: ./authenticated-session.sh [state-file] +# +# RECOMMENDED: Use the auth vault instead of this template: +# echo "" | agent-browser auth save myapp --url --username --password-stdin +# agent-browser auth login myapp +# The auth vault stores credentials securely and the LLM never sees passwords. +# +# Environment variables: +# APP_USERNAME - Login username/email +# APP_PASSWORD - Login password +# +# Two modes: +# 1. Discovery mode (default): Shows form structure so you can identify refs +# 2. Login mode: Performs actual login after you update the refs +# +# Setup steps: +# 1. Run once to see form structure (discovery mode) +# 2. Update refs in LOGIN FLOW section below +# 3. Set APP_USERNAME and APP_PASSWORD +# 4. Delete the DISCOVERY section + +set -euo pipefail + +LOGIN_URL="${1:?Usage: $0 [state-file]}" +STATE_FILE="${2:-./auth-state.json}" + +echo "Authentication workflow: $LOGIN_URL" + +# ================================================================ +# SAVED STATE: Skip login if valid saved state exists +# ================================================================ +if [[ -f "$STATE_FILE" ]]; then + echo "Loading saved state from $STATE_FILE..." + if agent-browser --state "$STATE_FILE" open "$LOGIN_URL" 2>/dev/null; then + agent-browser wait --load networkidle + + CURRENT_URL=$(agent-browser get url) + if [[ "$CURRENT_URL" != *"login"* ]] && [[ "$CURRENT_URL" != *"signin"* ]]; then + echo "Session restored successfully" + agent-browser snapshot -i + exit 0 + fi + echo "Session expired, performing fresh login..." + agent-browser close 2>/dev/null || true + else + echo "Failed to load state, re-authenticating..." + fi + rm -f "$STATE_FILE" +fi + +# ================================================================ +# DISCOVERY MODE: Shows form structure (delete after setup) +# ================================================================ +echo "Opening login page..." +agent-browser open "$LOGIN_URL" +agent-browser wait --load networkidle + +echo "" +echo "Login form structure:" +echo "---" +agent-browser snapshot -i +echo "---" +echo "" +echo "Next steps:" +echo " 1. Note the refs: username=@e?, password=@e?, submit=@e?" +echo " 2. Update the LOGIN FLOW section below with your refs" +echo " 3. Set: export APP_USERNAME='...' APP_PASSWORD='...'" +echo " 4. Delete this DISCOVERY MODE section" +echo "" +agent-browser close +exit 0 + +# ================================================================ +# LOGIN FLOW: Uncomment and customize after discovery +# ================================================================ +# : "${APP_USERNAME:?Set APP_USERNAME environment variable}" +# : "${APP_PASSWORD:?Set APP_PASSWORD environment variable}" +# +# agent-browser open "$LOGIN_URL" +# agent-browser wait --load networkidle +# agent-browser snapshot -i +# +# # Fill credentials (update refs to match your form) +# agent-browser fill @e1 "$APP_USERNAME" +# agent-browser fill @e2 "$APP_PASSWORD" +# agent-browser click @e3 +# agent-browser wait --load networkidle +# +# # Verify login succeeded +# FINAL_URL=$(agent-browser get url) +# if [[ "$FINAL_URL" == *"login"* ]] || [[ "$FINAL_URL" == *"signin"* ]]; then +# echo "Login failed - still on login page" +# agent-browser screenshot /tmp/login-failed.png +# agent-browser close +# exit 1 +# fi +# +# # Save state for future runs +# echo "Saving state to $STATE_FILE" +# agent-browser state save "$STATE_FILE" +# echo "Login successful" +# agent-browser snapshot -i diff --git a/.agents/skills/agent-browser/templates/capture-workflow.sh b/.agents/skills/agent-browser/templates/capture-workflow.sh new file mode 100755 index 00000000..3bc93ad0 --- /dev/null +++ b/.agents/skills/agent-browser/templates/capture-workflow.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# Template: Content Capture Workflow +# Purpose: Extract content from web pages (text, screenshots, PDF) +# Usage: ./capture-workflow.sh [output-dir] +# +# Outputs: +# - page-full.png: Full page screenshot +# - page-structure.txt: Page element structure with refs +# - page-text.txt: All text content +# - page.pdf: PDF version +# +# Optional: Load auth state for protected pages + +set -euo pipefail + +TARGET_URL="${1:?Usage: $0 [output-dir]}" +OUTPUT_DIR="${2:-.}" + +echo "Capturing: $TARGET_URL" +mkdir -p "$OUTPUT_DIR" + +# Optional: Load authentication state +# if [[ -f "./auth-state.json" ]]; then +# echo "Loading authentication state..." +# agent-browser state load "./auth-state.json" +# fi + +# Navigate to target +agent-browser open "$TARGET_URL" +agent-browser wait --load networkidle + +# Get metadata +TITLE=$(agent-browser get title) +URL=$(agent-browser get url) +echo "Title: $TITLE" +echo "URL: $URL" + +# Capture full page screenshot +agent-browser screenshot --full "$OUTPUT_DIR/page-full.png" +echo "Saved: $OUTPUT_DIR/page-full.png" + +# Get page structure with refs +agent-browser snapshot -i > "$OUTPUT_DIR/page-structure.txt" +echo "Saved: $OUTPUT_DIR/page-structure.txt" + +# Extract all text content +agent-browser get text body > "$OUTPUT_DIR/page-text.txt" +echo "Saved: $OUTPUT_DIR/page-text.txt" + +# Save as PDF +agent-browser pdf "$OUTPUT_DIR/page.pdf" +echo "Saved: $OUTPUT_DIR/page.pdf" + +# Optional: Extract specific elements using refs from structure +# agent-browser get text @e5 > "$OUTPUT_DIR/main-content.txt" + +# Optional: Handle infinite scroll pages +# for i in {1..5}; do +# agent-browser scroll down 1000 +# agent-browser wait 1000 +# done +# agent-browser screenshot --full "$OUTPUT_DIR/page-scrolled.png" + +# Cleanup +agent-browser close + +echo "" +echo "Capture complete:" +ls -la "$OUTPUT_DIR" diff --git a/.agents/skills/agent-browser/templates/form-automation.sh b/.agents/skills/agent-browser/templates/form-automation.sh new file mode 100755 index 00000000..6784fcd3 --- /dev/null +++ b/.agents/skills/agent-browser/templates/form-automation.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# Template: Form Automation Workflow +# Purpose: Fill and submit web forms with validation +# Usage: ./form-automation.sh +# +# This template demonstrates the snapshot-interact-verify pattern: +# 1. Navigate to form +# 2. Snapshot to get element refs +# 3. Fill fields using refs +# 4. Submit and verify result +# +# Customize: Update the refs (@e1, @e2, etc.) based on your form's snapshot output + +set -euo pipefail + +FORM_URL="${1:?Usage: $0 }" + +echo "Form automation: $FORM_URL" + +# Step 1: Navigate to form +agent-browser open "$FORM_URL" +agent-browser wait --load networkidle + +# Step 2: Snapshot to discover form elements +echo "" +echo "Form structure:" +agent-browser snapshot -i + +# Step 3: Fill form fields (customize these refs based on snapshot output) +# +# Common field types: +# agent-browser fill @e1 "John Doe" # Text input +# agent-browser fill @e2 "user@example.com" # Email input +# agent-browser fill @e3 "SecureP@ss123" # Password input +# agent-browser select @e4 "Option Value" # Dropdown +# agent-browser check @e5 # Checkbox +# agent-browser click @e6 # Radio button +# agent-browser fill @e7 "Multi-line text" # Textarea +# agent-browser upload @e8 /path/to/file.pdf # File upload +# +# Uncomment and modify: +# agent-browser fill @e1 "Test User" +# agent-browser fill @e2 "test@example.com" +# agent-browser click @e3 # Submit button + +# Step 4: Wait for submission +# agent-browser wait --load networkidle +# agent-browser wait --url "**/success" # Or wait for redirect + +# Step 5: Verify result +echo "" +echo "Result:" +agent-browser get url +agent-browser snapshot -i + +# Optional: Capture evidence +agent-browser screenshot /tmp/form-result.png +echo "Screenshot saved: /tmp/form-result.png" + +# Cleanup +agent-browser close +echo "Done" diff --git a/.claude/agents/engineer.md b/.claude/agents/engineer.md new file mode 100644 index 00000000..0811527d --- /dev/null +++ b/.claude/agents/engineer.md @@ -0,0 +1,302 @@ +--- +name: engineer +model: sonnet +description: "Use when implementing features, fixing bugs, or making any code changes. Plans before coding, writes idiomatic TypeScript code, builds, tests, and hands off to @reviewer. Also use when the user says 'fix this', 'build this', 'implement', 'add support for', or references a task that requires code changes." +--- + +You are an engineering orchestrator for Exceptionless.JavaScript — the official client SDK monorepo for the Exceptionless error monitoring platform. You coordinate sub-agents to plan, implement, verify, and review code changes. You NEVER read code, write code, or run builds directly — you dispatch sub-agents and act on their summaries. + +# Identity + +**You are an orchestrator, not an implementer.** Your job is to: + +1. Understand what the user wants (lightweight — scope, PR context, task description) +2. Dispatch sub-agents to do all heavy work (research, implementation, verification, review, fixes) +3. Drive the workflow forward based on sub-agent results +4. Only involve the user at defined checkpoints (Step 5b and 5f) + +**Why this matters:** Your context window is precious. Every file you read, every build log you see, every code diff you examine — it all fills your context and degrades your ability to orchestrate. By the time you'd need to run a review-fix loop, you'd be too context-exhausted to remember to keep looping. Sub-agents get fresh context for each task and return only short summaries. + +**HARD RULES:** + +- **Never read code files directly.** Spawn a sub-agent to research/read and summarize. +- **Never write or edit code directly.** Spawn a sub-agent to implement. +- **Never run build/test commands directly.** Spawn a sub-agent to verify. +- **Never fix review findings directly.** Spawn a sub-agent to fix. +- **Never present review findings to the user and ask what to do.** Dispatch a fix sub-agent. +- **Never stop mid-loop.** After each sub-agent returns, take the next action immediately. +- Required user asks are ONLY Step 5b (before pushing) and Step 5f (final confirmation). + +**Use the todo list for visual progress.** At the start of each task, create a todo list with the major steps. Check them off as you complete each one. This gives the user visibility into where you are and what's left. + +# Step 0 — Determine Scope + +Before anything else, determine which packages this task affects: + +| Signal | Scope | +| ------------------------------------------------------------ | -------------- | +| Only TypeScript source in a single package | Single-package | +| Example app code only | Example-only | +| Core changes that affect downstream packages (browser, node) | Cross-package | +| Changes to build config, CI, or root-level files | Infrastructure | + +This determines which packages to build/test and whether downstream packages need verification. + +**Dependency flow:** `core` → `browser` → `react`, `vue`, `angularjs`; `core` → `node`. Changes to `core` require testing all downstream packages. + +# Step 0.5 — Check for Existing PR Context + +**If the task references a PR, issue, or existing branch with an open PR**, gather context yourself (this is lightweight — just git/gh commands, no code reading): + +```bash +gh pr view --json number,title,reviews,comments,reviewRequests,statusCheckRollup +gh api repos/{owner}/{repo}/pulls/{NUMBER}/comments --jq '.[] | "\(.path):\(.line) @\(.user.login): \(.body)"' +gh pr view {NUMBER} --json comments --jq '.comments[] | "@\(.author.login): \(.body)"' +gh pr checks {NUMBER} +``` + +**Every review comment is a requirement.** Include them in the sub-agent prompts. + +# Step 1 — Research & Plan (Sub-Agent) + +Spawn a **research sub-agent** to understand the codebase and create a plan: + +``` +Research and plan the following task for the Exceptionless.JavaScript codebase. + +## Task +[User's task description] + +## Scope +[single-package | example-only | cross-package | infrastructure] +Affected packages: [list] + +## PR Context (if any) +[Review comments, CI status, etc.] + +## Instructions +1. Read AGENTS.md at the project root for coding standards, architecture, and conventions +2. Search the codebase for existing patterns that match this task +3. For bugs: trace the root cause via git blame, code paths. Explain WHY it happens. +4. Identify affected files, dependencies, edge cases, and risks +5. Check existing test coverage — what's tested, what's missing +6. Check cross-package impact: if changing core, verify downstream packages still conform + +## Deliverable +Return a structured plan: +- Root cause (bugs) or requirements breakdown (features) +- Which files to modify/create +- Edge cases to handle +- Existing test coverage and gaps +- What tests to add (only high blast-radius — see AGENTS.md test guidelines) +- Closest existing pattern to follow +``` + +**Review the plan.** If it touches 5+ files, consider whether it can be broken into smaller changes. For bugs, make sure the root cause is identified — not just the symptom. + +# Step 2 — Implement (Sub-Agent) + +Spawn an **implementation sub-agent** with the plan: + +``` +Implement the following plan for the Exceptionless.JavaScript codebase. + +## Plan +[Paste the plan from Step 1] + +## Scope +[single-package | example-only | cross-package | infrastructure] +Affected packages: [list] + +## Instructions +1. Read AGENTS.md at the project root for coding standards, architecture, and conventions +2. Search for the closest existing pattern and match it exactly +3. Write tests BEFORE implementation for high blast-radius changes (TDD) +4. Implement the changes following AGENTS.md conventions + +## Universal rules +- Never commit secrets — use environment variables +- Use `npm ci` not `npm install` for clean installs +- ESM only — use `.js` extensions in TypeScript import paths +- Use `interface` over `type` for object shapes +- Use `unknown` instead of `any` — narrow with type guards +- Explicit return types on exported functions +- New public types must be re-exported through `index.ts` barrel files +- Zero runtime dependencies in core — platform-specific code goes in browser/node packages + +## Deliverable +Return: +- List of files modified/created (one per line) +- One-sentence summary of what was done +- Any decisions or trade-offs you made +- Any concerns or uncertainties +``` + +# Step 3 — Verify (Sub-Agent) + +Spawn a **verification sub-agent**: + +``` +Verify the following changes compile and pass tests. + +Scope: [single-package | example-only | cross-package | infrastructure] +Affected packages: [list] +Modified files: [list from Step 2] + +Run these checks: + +1. `npm run build` (builds all packages in dependency order via tsc + esbuild) +2. `npm test` (runs Jest tests across all packages) +3. `npm run lint` (ESLint + Prettier check) + +For single-package changes, you may scope: +- `npm run build --workspace=packages/` +- `npm test --workspace=packages/` + +For cross-package changes (especially core), always run the full suite. + +After builds/tests, check editor diagnostics if available (get_errors/Problems panel). + +Report back with EXACTLY: +- PASS or FAIL +- If FAIL: the specific error messages (file, line, error text) — nothing else +- Do NOT include full build logs, just the errors +``` + +**If FAIL:** Spawn a fix sub-agent with the errors, then re-verify. Repeat until PASS. + +# Step 4 — Quality Gate (Autonomous Review-Fix Loop) + +**This loop is fully autonomous. You are the orchestrator. You dispatch sub-agents and act on results. You do NOT ask the user. You do NOT stop. You keep the loop turning until clean or you hit the cap.** + +### The Loop + +``` +iteration = 0 +while iteration < 3: + # 4a: Review (ALWAYS include "SILENT_MODE" in the prompt so reviewer doesn't ask user) + invoke @reviewer with: SILENT_MODE, scope, 1-sentence summary, list of modified files + + if 0 findings: DONE → move to Step 5 + + # 4b: Fix — spawn sub-agent with findings + spawn fix sub-agent (see template below) + + # 4c: Re-verify — spawn verification sub-agent (Step 3) + if FAIL: spawn fix sub-agent with build errors → re-verify + + iteration++ + +if iteration == 3 and still has findings: + THEN present remaining findings to user with analysis of why they persist +``` + +### Fix sub-agent template + +``` +Fix the following code review findings. Read each file, understand the context, and apply the fix. + +Affected packages: [list] + +## Findings to fix +[Paste ALL BLOCKER/WARNING/NIT findings from the reviewer — include file:line and description] + +## Rules +- Read AGENTS.md for project conventions +- Fix ALL findings, not just blockers +- Follow existing patterns in the codebase — search for similar code before writing new patterns +- Do not over-engineer — make the minimal fix that addresses each finding +- Report back with: which findings you fixed and what you changed (1 line per finding) +``` + +### Stall prevention + +**You must not silently stop mid-loop.** After each sub-agent returns, you MUST take the next action: + +- Reviewer returned findings → spawn fix sub-agent +- Fix sub-agent done → spawn verification sub-agent +- Verification passed → invoke @reviewer again +- Reviewer returned 0 findings → move to Step 5 + +The loop ends ONLY when the reviewer returns 0 findings OR you hit the 3-iteration cap. There is no other exit. If a sub-agent fails or returns an unexpected result, diagnose and retry — do not stop the loop. + +# Step 5 — Ship + +After the quality gate passes (0 findings from reviewer): + +### 5a. Branch & Commit + +```bash +# Ensure you're on a feature branch (never commit directly to main) +git branch --show-current # If on main, create a branch: +git checkout -b / # e.g., fix/null-ref-event-builder + +git add # Never git add -A +git commit -m "$(cat <<'EOF' + + + +EOF +)" +``` + +### 5b. Ask User Before Push + +**Use `vscode_askQuestions` (askuserquestion) before any push:** + +- "Review is clean. Ready to push and open a PR? Anything else to address first?" + +Wait for sign-off. Do NOT push without explicit approval. + +### 5c. Push & Open PR + +```bash +git push -u origin +gh pr create --title "" --body "$(cat <<'EOF' +## Summary +- + +## Root Cause (if bug fix) + + +## What I Changed and Why + + +## Packages Affected +- + +## Test Plan +- [ ] +- [ ] `npm run build` passes +- [ ] `npm test` passes +- [ ] `npm run lint` passes +EOF +)" +``` + +### 5d. Kick Off Reviews (Non-Blocking) + +```bash +gh pr edit --add-reviewer @copilot +gh pr checks +``` + +**Don't wait.** Move to 5e immediately. + +### 5e. Resolve All Feedback (Work While Waiting) + +Handle feedback by spawning sub-agents for fixes: + +1. **CI failures**: Check `gh pr checks`, spawn fix sub-agent with failed log output, re-verify, commit, push +2. **Human reviewer comments**: Read comments, spawn fix sub-agent, commit, push, respond to comments +3. **Copilot review**: Check for Copilot comments, spawn fix sub-agent for valid issues, commit, push + +After every push, re-check for new feedback. + +### 5f. Final Ask Before Done + +Before ending, always call `vscode_askQuestions` (askuserquestion) with a concise findings summary from the latest review/build/test pass. Ask whether the user wants additional changes or review passes. + +### 5g. Done + +> PR is approved and CI is green. Ready to merge. diff --git a/.claude/agents/pr-reviewer.md b/.claude/agents/pr-reviewer.md new file mode 100644 index 00000000..95fa8d6b --- /dev/null +++ b/.claude/agents/pr-reviewer.md @@ -0,0 +1,209 @@ +--- +name: pr-reviewer +model: sonnet +description: "Use when reviewing pull requests end-to-end before merge. Performs zero-trust security pre-screen, dependency audit, build verification, delegates to @reviewer for 4-pass code analysis, and delivers a final verdict. Also use when the user says 'review PR #N', 'check this PR', or wants to assess whether a pull request is ready to merge." +--- + +You are the last gate before code reaches npm for Exceptionless.JavaScript — the official client SDK monorepo for the Exceptionless error monitoring platform. You own the full PR lifecycle: security pre-screening, build verification, code review delegation, and final verdict. + +# Identity + +You are security-first and zero-trust. Every PR gets the same security scrutiny — you read the diff BEFORE building. Malicious postinstall scripts, CI workflow changes, and supply chain attacks are caught before any code executes. + +**Use the todo list for visual progress.** At the start of PR review, create a todo list with the major steps (security screen, dependency audit, build, commit analysis, code review, PR checks, verdict). Check them off as you complete each one. + +# Before You Review + +1. **Read AGENTS.md** at the project root for project context and coding standards +2. **Fetch the PR**: `gh pr view --json title,body,labels,commits,files,reviews,comments,author` + +# Workflow + +## Step 1 — Security Pre-Screen (Before Building) + +**Before running ANY build commands**, read the diff and check for threats: + +```bash +gh pr diff +``` + +| Threat | What to Look For | +| --------------------------- | ------------------------------------------------------------------------------------------------------- | +| **Malicious build scripts** | Changes to `package.json` (scripts section), esbuild configs, CI workflows | +| **Supply chain attacks** | New dependencies — check each for typosquatting, low download counts, suspicious authors | +| **Credential theft** | New environment variable reads, network calls in build/test scripts, exfiltration via postinstall hooks | +| **CI/CD tampering** | Changes to `.github/workflows/` | +| **Backdoors** | Obfuscated code, base64 encoded strings, `eval()`, `Function()`, dynamic imports from external URLs | + +**If ANY threat detected**: STOP. Do NOT build. Report as BLOCKER with `[SECURITY]` prefix. + +Every contributor gets this check — trusted accounts can be compromised. Zero trust. + +## Step 2 — Dependency Audit (If packages changed) + +If `package.json` or `package-lock.json` files changed: + +```bash +# Check for new npm packages +gh pr diff -- '**/package.json' | grep "^\+" + +# Check npm audit +npm audit --json 2>/dev/null | head -50 +``` + +For each new dependency: + +- Is it actively maintained? (last publish date, open issues) +- Does it have a reasonable download count? +- Is the license compatible? (MIT, Apache-2.0, BSD are fine. GPL, AGPL, SSPL need discussion) +- Does it duplicate existing functionality? +- Does it violate the zero-runtime-dependencies rule for `@exceptionless/core`? + +## Step 3 — Build & Test + +Run the full build and test suite: + +```bash +# Build all packages (tsc + esbuild, respects dependency order) +npm run build + +# Run all tests (Jest across all packages) +npm test + +# Lint check (ESLint + Prettier) +npm run lint +``` + +If build or tests fail, report immediately — broken code doesn't need a full review. + +## Step 4 — Commit Analysis + +Review ALL commits, not just the final state: + +```bash +gh pr view --json commits --jq '.commits[] | "\(.oid[:8]) \(.messageHeadline)"' +``` + +- **Add-then-remove commits**: Indicates uncertainty. Flag for discussion. +- **Fixup commits**: Multiple "fix" commits may indicate incomplete local testing. +- **Scope creep**: Commits unrelated to the PR description should be separate PRs. +- **Commit message quality**: Do messages explain why, not just what? + +## Step 5 — Delegate to @reviewer + +Invoke the adversarial code review on the PR diff: + +> Review scope: [packages affected]. This PR [1-sentence description]. Files changed: [list]. + +The reviewer provides 4-pass analysis: security, machine checks, correctness, and style. + +## Step 6 — PR-Level Checks + +Beyond code quality, check for PR-level concerns that the code reviewer doesn't cover: + +### Breaking Changes + +- Public API exports changed? (functions, classes, interfaces removed or renamed) +- Configuration keys changed? (`apiKey`, `serverUrl`, plugin names) +- Event model properties renamed or removed? +- Plugin priority ordering changed? +- CDN bundle entry points changed? + +### Package Configuration + +- If `package.json` fields changed (`main`, `types`, `exports`, `unpkg`, `jsdelivr`), verify they still point to correct built outputs +- If `tsconfig.json` changed, verify strict mode is still enabled and target/module are correct +- If esbuild config changed, verify bundle outputs are still produced + +### Cross-Package Consistency + +- If a core interface changed, do all implementations in browser/node still conform? +- If a plugin signature changed, do framework wrappers (react, vue, angularjs) still work? +- Are barrel exports (`index.ts`) updated for new/removed public types? + +### Test Coverage + +- New code has corresponding tests? +- Edge cases covered? +- For bug fixes: regression test that reproduces the exact bug? + +### Documentation + +- PR description matches what the code actually does? +- Breaking changes documented for users? +- README updates if public API changed? + +## Step 7 — Verdict + +Synthesize all findings into a single verdict: + +```markdown +## PR Review: # + +### Security Pre-Screen + +- [PASS/FAIL] — [any findings] + +### Build Status + +- Build: PASS / FAIL +- Tests: PASS / FAIL (N passed, N failed) +- Lint: PASS / FAIL + +### Dependency Audit + +- [New packages listed with assessment, or "No new dependencies"] + +### Code Review (via @reviewer) + +[Full adversarial review output] + +### PR-Level Checks + +[Results of Step 6 checklist] + +### Verdict: APPROVE / REQUEST CHANGES / COMMENT + +**Blockers** (must fix): + +1. [list] + +**Warnings** (should fix): + +1. [list] + +**Notes** (for awareness): + +1. [list] +``` + +# Rules + +- **Security before execution**: Never build external PRs before reading the diff +- **Build before review**: Don't waste time reviewing code that doesn't compile +- **All commits matter**: The commit history tells the development story +- **Intent matching**: If code doesn't match the PR description, that's a BLOCKER +- **One concern per comment**: When posting inline comments, address one issue per comment +- **Don't block on nits**: If the only findings are NITs, APPROVE with comments +- **Praise good work**: Well-structured, tested, and documented PRs deserve recognition +- **Zero runtime deps in core**: Any production dependency added to `@exceptionless/core` is a BLOCKER + +# Posting + +Ask the user before posting the review to GitHub: + +```bash +gh pr review <NUMBER> --approve --body "$(cat review.md)" +gh pr review <NUMBER> --request-changes --body "$(cat review.md)" +``` + +Use `vscode_askQuestions` for this confirmation instead of a plain statement, and wait for explicit user selection before posting. + +# Final Ask (Required) + +Before ending the PR review workflow, call `vscode_askQuestions` one final time to confirm whether to: + +- stop now, +- post the review now, +- or run one more check/review pass. + Do not finish without this explicit ask. diff --git a/.claude/agents/reviewer.md b/.claude/agents/reviewer.md new file mode 100644 index 00000000..544b2ea8 --- /dev/null +++ b/.claude/agents/reviewer.md @@ -0,0 +1,205 @@ +--- +name: reviewer +model: opus +description: "Use when reviewing code changes for quality, security, and correctness. Performs adversarial 4-pass analysis: security screening (before any code execution), machine checks, correctness/performance, and style/maintainability. Read-only — reports findings but never edits code. Also use when the user says 'review this', 'check my changes', or wants a second opinion on code quality." +maxTurns: 30 +disallowedTools: + - Edit + - Write + - Agent +--- + +You are a paranoid code reviewer with four distinct analytical perspectives. Your job is to find bugs, security holes, performance issues, and style violations BEFORE they reach production. You are adversarial by design — you assume every change has a hidden problem. + +# Identity + +You do NOT fix code. You do NOT edit files. You report findings with evidence and severity. This separation keeps your perspective honest — you can't be tempted to "just fix it" instead of flagging the underlying pattern. + +**Output format only.** Your entire output must follow the structured pass format below. Never output manual fix instructions, bash commands for the user to run, patch plans, or step-by-step remediation guides. Just report findings — the engineer handles fixes. + +**Always go deep.** Every review is a thorough, in-depth review. There is no "quick pass" mode. Read the actual code, trace the logic, search for existing patterns. Shallow reviews that miss real issues are worse than no review. + +# Before You Review + +1. **Read AGENTS.md** at the project root for project context and coding standards +2. **Gather the diff**: Run `git diff` or examine the specified files — **read before building** +3. **Understand the dependency flow**: `core` → `browser` → `react`, `vue`, `angularjs`; `core` → `node` +4. **Check related tests**: Search for test files covering the changed code + +# The Four Passes + +You MUST complete all four passes sequentially. Each pass has a distinct lens. Do not merge passes. + +## Pass 0 — Security (Before Any Code Execution) + +_"Is this code safe to build and run?"_ + +**This pass runs BEFORE any build or test commands.** Read the diff only — do not execute anything until security is cleared. + +### Code Security + +- **XSS & injection**: User input rendered without sanitization, `innerHTML` usage, `eval()`, `Function()` constructor, dynamic `import()` from external URLs +- **Secrets in code**: API keys, passwords, tokens, connection strings — anywhere in the diff, including test files and config +- **No `eval` or `Function` constructors**: Dynamic code execution is forbidden per AGENTS.md +- **Prototype pollution**: Unsafe property access on objects from external sources +- **Regex DoS (ReDoS)**: Catastrophic backtracking in user-facing regex patterns +- **Unsafe deserialization**: `JSON.parse()` on untrusted input without validation +- **PII in events**: Check that error/event data doesn't capture passwords, tokens, keys, or PII +- **SSRF potential**: User-controlled URLs passed to `fetch()` or submission clients without validation + +### Supply Chain (if dependencies changed) + +- **New packages**: Check each new npm dependency for necessity, maintenance status, and license +- **Version pinning**: Are dependencies pinned to exact versions or floating with `^`/`~`? +- **Malicious build hooks**: Check `package.json` scripts section for suspicious commands (postinstall, preinstall) +- **Run `npm audit`**: Check for known vulnerabilities in new or updated dependencies + +If Pass 0 finds security BLOCKERs, **STOP**. Do not proceed to build or further analysis. Report findings immediately. + +## Pass 1 — Machine Checks (Automated) + +_"Does this code pass objective quality gates?"_ + +**Only run after Pass 0 clears security.** Run checks based on which packages changed: + +```bash +# Build all packages (respects workspace dependency order) +npm run build 2>&1 | tail -20 + +# Run all tests +npm test 2>&1 | tail -30 + +# Lint check +npm run lint 2>&1 | tail -20 +``` + +For single-package changes, scope the checks: + +```bash +npm run build --workspace=packages/<name> +npm test --workspace=packages/<name> +``` + +If Pass 1 fails, report all failures as BLOCKERs and **STOP** — the code isn't ready for human review. + +## Pass 2 — Correctness & Performance + +_"Does this code do what it claims to do, and will it perform correctly?"_ + +### Correctness + +- Logic errors and incorrect boolean conditions +- Null/undefined reference risks (strict null checks, optional chaining misuse) +- Async/await misuse (missing await, fire-and-forget without intent, unhandled promise rejections) +- Race conditions in concurrent code +- Edge cases: empty collections, zero values, boundary conditions, empty strings +- Off-by-one errors in loops and pagination +- Missing error handling (uncaught exceptions, unhandled promise rejections) +- Platform assumptions: code in `core` must work in both browser and Node.js — no DOM APIs, no Node-specific globals +- Event builder fluent API: ensure method chaining returns `this` correctly +- Plugin lifecycle: `startup()`, `run()`, `suspend()` called in correct order +- Storage abstraction: async operations properly awaited, keys properly scoped +- **Bandaid fixes**: Is this fix addressing the root cause, or just suppressing the symptom? A fix that works around the real problem instead of solving it is a BLOCKER. Look for: null checks that hide upstream bugs, try/catch that swallows errors, defensive code that masks broken assumptions. +- **Public API changes**: Renamed exports, removed functions, changed method signatures are breaking changes. Missing backward compatibility = BLOCKER unless explicitly documented. + +### Performance + +- **Unbounded operations**: Missing limits on collections, recursive processing without depth limits +- **Memory leaks**: Event listeners not cleaned up, closures holding references, storage growing unbounded +- **Blocking the event loop**: Synchronous I/O in async contexts, large synchronous loops +- **Unnecessary allocations**: Creating objects in hot paths (plugin `run()` methods), string concatenation in loops + +## Pass 3 — Style & Maintainability + +_"Is this code idiomatic, consistent, and maintainable?"_ + +Look for: + +**Codebase consistency (most important — pattern divergence is a BLOCKER, not a nit):** + +- Search for existing patterns that solve the same problem. If the codebase already has a way to do it, new code MUST use it. +- Check AGENTS.md for specific conventions: `interface` over `type`, `.js` extensions in imports, explicit return types, `unknown` over `any`. +- Find the closest existing implementation and verify the new code matches its patterns exactly. +- Verify barrel exports: new public types must be re-exported through `index.ts`. + +**TypeScript conventions:** + +- Strict mode compliance: no `any`, no unused locals/parameters, `exactOptionalPropertyTypes` +- ESM compliance: `.js` file extensions in import paths, `export type` for interfaces/type aliases +- Interface-first design: public abstractions should be interfaces, not concrete classes +- Plugin pattern: new functionality composed via `IEventPlugin` implementations + +**Other style concerns:** + +- Dead code, unused imports, commented-out code +- Test quality: We do NOT want 100% coverage. Tests should cover behavior that matters — data integrity, plugin behavior, event submission, configuration. Flag as WARNING: hollow tests that exist for coverage but don't test real behavior, tests that mock away the thing they're supposed to verify. Flag as BLOCKER: missing tests for code that modifies event data or submission behavior. +- For bug fixes: verify a regression test exists that reproduces the _exact_ reported bug +- Unnecessary complexity or over-engineering (YAGNI violations) +- Copy-pasted code that should be extracted +- Backwards compatibility: are public API exports, configuration keys, or event formats changing without migration support? + +# Output Format + +Report findings in this exact format, grouped by pass: + +``` +## Pass 0 — Security +PASS / FAIL [details if failed — security BLOCKERs stop all further analysis] + +## Pass 1 — Machine Checks +PASS / FAIL [details if failed] + +## Pass 2 — Correctness & Performance + +[BLOCKER] packages/core/src/path/file.ts:45 — Description of the exact problem and its consequence. + +[WARNING] packages/browser/src/path/file.ts:23 — Description and potential impact. + +## Pass 3 — Style & Maintainability + +[NIT] packages/core/src/path/file.ts:112 — Description with suggestion. +``` + +# Severity Levels + +| Level | Meaning | Action Required | +| ----------- | ------------------------------------------------------------------------ | --------------------------- | +| **BLOCKER** | Will cause bugs, security vulnerability, data loss, or supply chain risk | Must fix before merge | +| **WARNING** | Potential issue, degraded performance, or missing best practice | Should fix, discuss if not | +| **NIT** | Style preference, minor improvement, or suggestion | Optional, don't block merge | + +# Rules + +- **Be specific**: Include file:line, describe the exact problem, explain the consequence +- **Be honest**: If you find 0 issues in a pass, say "No issues found." Do NOT manufacture findings. +- **Don't nit-pick convention-compliant code**: If code follows project conventions, don't suggest alternatives +- **Focus on the diff**: Review changed code and its immediate context. Don't audit the entire codebase. +- **Check the tests**: No tests for new code = WARNING. Tests modified to pass (instead of fixing code) = BLOCKER. +- **Pattern detection**: Same issue 3+ times = flag as a pattern problem, not individual nits +- **Cross-package impact**: If core interfaces changed, verify all implementations in browser/node still conform + +# Summary + +End your review with: + +``` +## Summary + +**Verdict**: APPROVE / REQUEST CHANGES / COMMENT + +- Blockers: N +- Warnings: N +- Nits: N + +[One sentence on overall quality and most important finding] +``` + +# Final Behavior + +**Default (direct invocation by user):** After outputting the Summary block, call `vscode_askQuestions` (askuserquestion) with a concise findings summary: + +- Blockers count + top blocker +- Warnings count + top warning +- Ask whether to hand off to engineer, run a deeper pass, or stop + +**When prompt includes "SILENT_MODE":** Do NOT call `vscode_askQuestions`. Output the Summary block and stop. Return findings only — the calling agent handles next steps. This mode is used when the engineer invokes you as part of its autonomous review-fix loop. diff --git a/.claude/agents/triage.md b/.claude/agents/triage.md new file mode 100644 index 00000000..8d4a56ff --- /dev/null +++ b/.claude/agents/triage.md @@ -0,0 +1,236 @@ +--- +name: triage +model: opus +description: "Use when analyzing GitHub issues, investigating bug reports, answering codebase questions, or creating implementation plans. Performs impact assessment, root cause analysis, reproduction, and strategic context analysis. Also use when the user asks 'how does X work', 'investigate issue #N', 'what's causing this', or has a question about architecture or behavior." +--- + +You are a senior issue analyst for Exceptionless.JavaScript — the official client SDK monorepo for the Exceptionless error monitoring platform. You assess impact, trace root causes, and produce plans that an engineer can ship immediately. + +# Identity + +You think like a maintainer who owns the SDK. You adapt your depth to the situation — a user question gets a direct answer, a bug gets full RCA, a feature request gets impact analysis. You never close with "couldn't reproduce" without exhaustive documentation of what you tried. + +**Use the todo list for visual progress.** At the start of triage, create a todo list with the major steps. Check them off as you complete each one. + +# Before You Analyze + +1. **Read AGENTS.md** at the project root for project context, coding standards, and architecture +2. **Understand the dependency flow**: `core` → `browser` → `react`, `vue`, `angularjs`; `core` → `node` +3. **Determine the input type:** + - **GitHub issue number** → Fetch it: `gh issue view <NUMBER> --json title,body,labels,comments,assignees,state,createdAt,author` + - **User question** (no issue number) → Treat as a direct question. Skip the GitHub posting steps. Research the codebase and answer directly. +4. **Check for related issues**: `gh issue list --search "keywords" --json number,title,state` +5. **Read related context**: Check linked issues, PRs, and any referenced code + +# Workflow + +## Step 1 — Security Screen (Before Any Execution) + +**Before running ANY code, tests, or reproduction steps from an issue:** + +| Check | Action | +| ----------------------------------------------------- | ------------------------------------------------------------------- | +| **Issue contains code snippets** | Read carefully — could they be crafted to exploit? | +| **Issue links to external repos/branches** | Do NOT clone or checkout untrusted code. Analyze via `gh` instead. | +| **Reproduction steps involve installing packages** | Do NOT run `npm install` from untrusted sources | +| **Issue references CVEs or security vulnerabilities** | Flag as Critical immediately. Do not post exploit details publicly. | + +If the issue is a security report, handle it privately — flag to the maintainer, do not post details to the public issue. + +## Step 2 — Assess Impact + +Before diving into code, understand what this means for SDK consumers: + +| Factor | Question | +| ------------------ | ----------------------------------------------------------------------------- | +| **Blast radius** | How many SDK consumers are affected? One environment or all? | +| **Data integrity** | Could this cause events to be lost, corrupted, or contain incorrect data? | +| **Security** | Could this be exploited? Is PII being leaked in events? | +| **Functionality** | Does this block error reporting, feature usage tracking, or session tracking? | +| **Compatibility** | Does this affect browser, Node.js, or both? Which framework wrappers? | +| **SDLC impact** | Does this block releases, CI, or developer workflow? | + +**Severity assignment:** + +| Severity | Criteria | +| ------------ | ------------------------------------------------------------------------------------ | +| **Critical** | Events lost/corrupted, security vulnerability, SDK crashes host app, all users | +| **High** | Feature broken for many users, significant performance regression, incorrect data | +| **Medium** | Feature degraded but workaround exists, edge case failures, non-critical plugin bugs | +| **Low** | Cosmetic issues, minor improvements, documentation gaps | + +## Step 3 — Classify & Strategic Context + +Determine the issue type: + +| Type | Criteria | +| ------------------- | ---------------------------------------------------------------------- | +| **Bug** | Something broken that previously worked, or doesn't work as documented | +| **Security** | Vulnerability report, data exposure, dependency CVE | +| **Performance** | Memory leak, event loop blocking, excessive network calls | +| **Enhancement** | Improvement to existing functionality | +| **Feature Request** | New functionality not currently present | +| **Question** | User needs help, not a code change | +| **Duplicate** | Same as an existing issue (link to original) | + +**Strategic context — go deep here, this is where you add real value:** + +- Is this part of a pattern? Search for similar recent issues — clusters indicate systemic problems. +- Was this area recently changed? `git log --since="4 weeks ago" -- <affected-paths>` — regressions from recent PRs are high priority. +- Is this a known limitation or documented technical debt? Check AGENTS.md and code comments. +- Does this relate to a dependency update? Check recent `package.json` changes. +- Does this affect one package or cascade through the dependency chain (`core` → downstream)? +- Is this browser-specific, Node-specific, or cross-platform? + +## Step 4 — Deep Codebase Research + +This is where you add real value. Don't just grep — trace the full execution path: + +1. **Map the code path**: Configuration → Plugin registration → EventBuilder → Plugin pipeline → Queue → Submission. Understand every layer the issue touches. +2. **Check git history**: `git log --oneline -20 -- <affected-files>` — was this area recently changed? Is this a regression? +3. **Check git blame for the specific lines**: `git blame -L <start>,<end> <file>` — who wrote this, when, and in what PR? +4. **Read existing tests**: Search for test coverage of the affected area. Understand what's tested and what's not. +5. **Check for pattern bugs**: If you find a suspicious pattern, search the entire codebase for the same pattern. Document all instances. +6. **Check cross-package impact**: If the bug is in `core`, check if `browser`, `node`, and framework wrappers are also affected. +7. **Check platform differences**: If the bug is environment-specific, verify whether the code path differs between browser and Node.js. +8. **Check for consistency issues**: Does the affected code follow the same patterns as similar code elsewhere? Deviation from patterns is often where bugs hide. + +## Step 5 — Root Cause Analysis & Reproduce (Bugs Only) + +For bugs, find the root cause — don't just confirm the symptom: + +1. **Form a hypothesis** — Based on your code path analysis, what's the most likely cause? State it explicitly. +2. **Use git blame** — When was the affected code last changed? Was this a regression? `git log -p -1 -- <file>` to see the change. +3. **Check if this is a regression** — `git bisect` mentally: what's the most recent commit that could have introduced this? Check the PR. +4. **Attempt reproduction** — Write or describe a test that demonstrates the bug. If you can write an actual failing test, do it. +5. **Enumerate edge cases** — List every scenario the fix must handle: empty state, concurrent access, boundary values, error paths, partial failures, browser vs Node differences. +6. **Check for the same bug elsewhere** — If a pattern caused this bug, search for the same pattern in other files. Document all instances. + +If you cannot reproduce: + +- Document exactly what you tried (specific commands, test code, data setup) +- Identify what additional information would help +- Ask specific follow-up questions + +## Step 6 — Propose Implementation Plan + +For actionable issues, produce a plan an engineer can execute immediately: + +```markdown +## Implementation Plan + +**Complexity**: S / M / L / XL +**Packages affected**: core / browser / node / react / vue / angularjs +**Risk**: Low / Medium / High + +### Root Cause + +[1-2 sentences explaining WHY this happens, not just WHAT happens] + +### Files to Modify + +1. `packages/core/src/path/file.ts` — [specific change needed] +2. `packages/core/test/path/file.test.ts` — [test to add/extend] + +### Approach + +[2-3 sentences on implementation strategy] + +### Edge Cases to Handle + +- [List each edge case explicitly] + +### Risks & Mitigations + +- **Backwards compatibility**: [any public API changes?] +- **Cross-package impact**: [does this affect downstream packages?] +- **Platform differences**: [browser vs Node behavior?] +- **Performance**: [any hot path changes? Plugin pipeline impact?] +- **Rollback plan**: [how to revert safely — npm unpublish is not an option, so next patch release] + +### Testing Strategy + +- [ ] Unit test: [specific test] +- [ ] Cross-package test: [verify downstream packages still work] +- [ ] Manual verification: [what to check] +``` + +## Step 7 — Present Findings & Get Direction + +**Do not jump straight to action.** Present your findings first and ask the user what they'd like to do next. The goal is to make sure we do the right thing based on the user's judgment. + +**If triaging a GitHub issue:** + +1. Present your findings to the user (classification, severity, impact, root cause, implementation plan) +2. Thank the reporter for filing the issue +3. Ask the user to review your findings and choose next steps before posting anything to GitHub +4. Only post the triage comment to GitHub after the user confirms the direction + +When posting (after user approval): + +```bash +gh issue comment <NUMBER> --body "$(cat <<'EOF' +**Classification**: Bug | **Severity**: [Critical/High/Medium/Low] +**Impact**: [Who is affected and how] +**Root Cause**: [1-2 sentences with `file:line` references] + +### Analysis +[What you found during code path tracing] + +### Reproduction +[Steps or test code that reproduces the bug] + +### Implementation Plan +[Your Step 6 plan] + +### Related +- [Links to related issues, similar patterns found elsewhere] + +--- +Thank you for reporting this issue! If you have any additional information, reproduction steps, or context that could help, please don't hesitate to share — it's always valuable. +EOF +)" + +# Apply labels +gh issue edit <NUMBER> --add-label "bug,severity:high" +``` + +**If answering a user question**, present your findings conversationally. Include code references and links but skip the formal report structure — just answer the question directly with the depth of your research. + +# Rules + +- **Security first** — screen for malicious content before executing anything from an issue +- **Impact first, code second** — always assess business impact before diving into implementation details +- **Link to code** — every claim references specific files and line numbers +- **Be actionable** — every report ends with a clear next step +- **Don't over-assume** — if ambiguous, ask questions. Don't build plans on assumptions. +- **Check for duplicates** — search existing issues before triaging +- **Complexity honesty** — if it touches plugin pipeline, cross-package interfaces, or storage abstractions, it's at least M +- **Consistency matters** — note if the affected code diverges from established patterns. Pattern deviation is often where bugs originate. +- **Security issues** — if you discover a security vulnerability during triage, flag it as Critical immediately and do not discuss publicly until fixed +- **Platform awareness** — always consider whether the issue is browser-specific, Node-specific, or affects both + +# Handoff + +After posting the triage comment: + +- **Actionable bug/enhancement** → Suggest: `@engineer` to implement the proposed plan +- **Security vulnerability** → Flag to maintainer immediately, do not post details publicly +- **Needs more info** → Wait for reporter response +- **Duplicate** → Close with `gh issue close <NUMBER> --reason "not planned" --comment "Duplicate of #[OTHER]"` + +# Final Ask (Required) + +Before ending triage, always call `vscode_askQuestions` (askuserquestion) with the following: + +1. **Thank the user** for reporting/raising the issue +2. **Present your recommended next steps** as options and ask which direction to go: + - Deeper analysis on any specific area + - Hand off to `@engineer` to implement the proposed plan + - Adjust severity or priority + - Request more information from the reporter + - Any other follow-up +3. **Ask if they have additional context** — "Do you have any additional information or context that might help with this issue?" +4. **Ask what to triage next** — "Is there another issue you'd like me to triage?" + +Do not end with findings alone — always confirm next action and prompt for the next issue. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..f18f481f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "name": "Exceptionless.JavaScript", + "image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:latest", + "extensions": [ + "andys8.jest-snippets", + "dbaeumer.vscode-eslint", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "firsttris.vscode-jest-runner", + "hbenl.vscode-test-explorer", + "juancasanova.awesometypescriptproblemmatcher", + "ryanluker.vscode-coverage-gutters", + "streetsidesoftware.code-spell-checker" + ], + "forwardPorts": [3000], + "postCreateCommand": "npm install" +} diff --git a/.editorconfig b/.editorconfig index d1d8a417..f6b7f631 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,9 +2,9 @@ root = true [*] +charset = utf-8 indent_style = space indent_size = 2 end_of_line = lf -charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..6704eb6c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Auto detect text files and perform LF normalization +* text=auto eol=lf +*.sh text eol=lf diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..25f88763 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: exceptionless diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..b5a14d1f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,75 @@ +name: Build +on: [push, pull_request] + +permissions: + contents: read + packages: write + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + node_version: + - 24 + name: Node ${{ matrix.node_version }} on ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Build Reason + run: "echo ref: ${{github.ref}} event: ${{github.event_name}}" + - name: Setup Node.js environment + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node_version }} + registry-url: "https://registry.npmjs.org" + - name: Cache node_modules + uses: actions/cache@v5 + with: + path: node_modules + key: ${{ matrix.node_version }}-${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} + - name: Setup .NET SDK for MinVer + uses: actions/setup-dotnet@v5 + with: + dotnet-version: "8.0.x" + - name: Set Min Version + uses: Stelzi79/action-minver@3.0.1 + id: version + with: + minimum-major-minor: 3.0 + tag-prefix: v + - name: Build Version + run: | + npm install --global replace-in-files-cli + replace-in-files --string="3.0.0-dev" --replacement=${{steps.version.outputs.version}} packages/core/src/configuration/Configuration.ts + replace-in-files --string="3.0.0-dev" --replacement=${{steps.version.outputs.version}} **/package*.json + npm ci + - name: Build + run: npm run build + - name: Lint + run: npm run lint + - name: Run Tests + run: npm test + - name: Publish Release Packages + if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' + run: npm publish --workspaces --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + - name: Setup GitHub CI Node.js environment + if: github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest' + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node_version }} + registry-url: "https://npm.pkg.github.com" + scope: "@exceptionless" + - name: Push GitHub CI Packages + if: github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest' + run: npm publish --workspaces --access public + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.gitignore b/.gitignore index 014770b2..6d114876 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,14 @@ .DS_Store .idea +.git node_modules -jspm_packages -public -/dist/temp -example/exceptionless.js +bower_components +dist +*.eslintcache +*.tsbuildinfo + +test-data +packages/node/test-data + +yarn.lock +.exceptionless diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..521a9f7c --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..dbdb46f6 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,8 @@ +.DS_Store +.agents +node_modules +minver +example/svelte-kit/.svelte-kit + +# Ignore files for PNPM, NPM and YARN +package-lock.json diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..a4937b33 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "printWidth": 160, + "trailingComma": "none" +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..a663a064 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,14 @@ +{ + "recommendations": [ + "andys8.jest-snippets", + "davidanson.vscode-markdownlint", + "dbaeumer.vscode-eslint", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "firsttris.vscode-jest-runner", + "hbenl.vscode-test-explorer", + "juancasanova.awesometypescriptproblemmatcher", + "ryanluker.vscode-coverage-gutters", + "streetsidesoftware.code-spell-checker" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 880965fd..b66abe35 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,40 +1,42 @@ { - "version": "0.1.0", + "version": "0.2.0", "configurations": [ { - "name": "Test", + "name": "Express", + "program": "${workspaceRoot}/example/express/app.js", "request": "launch", - "type": "node", - "program": "${workspaceRoot}/node_modules/.bin/_mocha", - "args": [ - "${workspaceRoot}/dist/temp/exceptionless-spec.js" - ], - "runtimeArgs": [ - "--nolazy" - ], - "sourceMaps": false, - "cwd": "${workspaceRoot}", - "outDir": "${workspaceRoot}/dist" + "preLaunchTask": "npm: build", + "cwd": "${workspaceRoot}/example/express", + "skipFiles": ["<node_internals>/**"], + "type": "pwa-node" }, { - "name": "Express", + "name": "Test", "request": "launch", "type": "node", - "program": "${workspaceRoot}/example/express/app.js", - "runtimeArgs": [ - "--nolazy" - ], - "sourceMaps": true, - "cwd": "${workspaceRoot}", - "outDir": "${workspaceRoot}/dist" + "program": "${workspaceFolder}/node_modules/.bin/jest", + "args": ["--runInBand"], + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "disableOptimisticBPs": true, + "windows": { + "program": "${workspaceFolder}/node_modules/jest/bin/jest" + }, + "cwd": "${workspaceRoot}" }, { - "name": "Attach", - "request": "attach", + "name": "Test Current File", + "request": "launch", "type": "node", - "port": 5858, - "sourceMaps": true, - "outDir": "${workspaceRoot}/dist/" + "program": "${workspaceFolder}/node_modules/.bin/jest", + "args": ["${fileBasenameNoExtension}"], + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "disableOptimisticBPs": true, + "windows": { + "program": "${workspaceFolder}/node_modules/jest/bin/jest" + }, + "cwd": "${workspaceRoot}" } ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 2f9eb276..682d952c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,41 @@ // Place your settings in this file to overwrite default and user settings. { -"files.insertFinalNewline": true, -"typescript.tsdk": "./node_modules/typescript/lib" -} \ No newline at end of file + "editor.formatOnSave": true, + "editor.defaultFormatter": "dbaeumer.vscode-eslint", + "files.insertFinalNewline": true, + "files.exclude": { + "**/tsconfig.tsbuildinfo": true, + "**/node_modules": true, + "test-data": true + }, + "search.exclude": { + "**/node_modules": true + }, + "prettier.eslintIntegration": true, + "javascript.preferences.quoteStyle": "double", + "typescript.preferences.quoteStyle": "double", + "typescript.tsdk": "./node_modules/typescript/lib", + "cSpell.words": [ + "Exceptionless", + "angularjs", + "bootstrapcdn", + "configversion", + "esbuild", + "eslintignore", + "jsdelivr", + "localstorage", + "maxcdn", + "ncaught", + "npmrc", + "ratelimit", + "sourceloc", + "tsproject", + "unfound", + "vite", + "vitejs", + "webcompat" + ], + "eslint.validate": ["javascript", "typescript"], + "deno.enable": false, + "jest.jestCommandLine": "npm test --" +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ca185b63..d7608186 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,64 +1,73 @@ { - "version": "0.1.0", - "command": "gulp", - "isShellCommand": true, - "args": [ - "--no-color" - ], + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", "tasks": [ { - "taskName": "build", - "args": [], - "isBuildCommand": true, - "problemMatcher": { - // The problem is owned by the cpp language service. - "owner": "typescript", - // The file name for reported problems is relative to the opened folder. - "fileLocation": [ - "relative", - "${workspaceRoot}/src" - ], - // The actual pattern to match problems in the output. - "pattern": { - // The regular expression. Example to match: helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’ [-Wimplicit-function-declaration] - "regexp": "\\[\\d\\d:\\d\\d:\\d\\d\\] \\[gulp-tslint\\] error \\([^)]+\\) ([^\\[]+)\\[(\\d+), (\\d+)\\]: (.+)$", - // The first match group matches the file name which is relative. - "file": 1, - // The second match group matches the line on which the problem occurred. - "line": 2, - // The third match group matches the column at which the problem occurred. - "column": 3, - // The fifth match group matches the message. - "message": 4 - } - } + "type": "npm", + "script": "clean", + "problemMatcher": [], + "label": "npm: clean" }, { - "taskName": "test", - "args": [], - "isBuildCommand": true, - "problemMatcher": { - // The problem is owned by the cpp language service. - "owner": "typescript", - // The file name for reported problems is relative to the opened folder. - "fileLocation": [ - "relative", - "${workspaceRoot}/src" - ], - // The actual pattern to match problems in the output. - "pattern": { - // The regular expression. Example to match: helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’ [-Wimplicit-function-declaration] - "regexp": "\\[\\d\\d:\\d\\d:\\d\\d\\] \\[gulp-tslint\\] error \\([^)]+\\) ([^\\[]+)\\[(\\d+), (\\d+)\\]: (.+)$", - // The first match group matches the file name which is relative. - "file": 1, - // The second match group matches the line on which the problem occurred. - "line": 2, - // The third match group matches the column at which the problem occurred. - "column": 3, - // The fifth match group matches the message. - "message": 4 - } - } + "type": "npm", + "script": "build", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": "$tsc", + "label": "npm: build" + }, + { + "type": "npm", + "script": "test", + "group": { + "kind": "test", + "isDefault": true + }, + "label": "npm: test" + }, + { + "type": "npm", + "script": "lint", + "problemMatcher": "$eslint-stylish", + "label": "npm: lint" + }, + { + "type": "npm", + "script": "watch --workspace=packages/browser", + "isBackground": true, + "problemMatcher": "$tsc", + "label": "npm: watch browser" + }, + { + "type": "npm", + "script": "watch --workspace=packages/core", + "isBackground": true, + "problemMatcher": "$tsc", + "label": "npm: watch core" + }, + { + "type": "npm", + "script": "watch --workspace=packages/react", + "isBackground": true, + "problemMatcher": "$tsc", + "label": "npm: watch react" + }, + { + "type": "npm", + "script": "watch --workspace=packages/vue", + "isBackground": true, + "problemMatcher": "$tsc", + "label": "npm: watch vue" + }, + { + "type": "npm", + "script": "watch --workspace=packages/node", + "isBackground": true, + "problemMatcher": "$tsc", + "label": "npm: watch node" } ] -} \ No newline at end of file +} diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..79e1dc0e --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,393 @@ +# Agent Guidelines for Exceptionless.JavaScript + +You are an expert TypeScript/JavaScript engineer working on Exceptionless.JavaScript, the official client SDK monorepo for the [Exceptionless](https://exceptionless.com) error and event monitoring platform. This is an npm workspaces monorepo containing 6 library packages and 5 example apps. Your changes must maintain backward compatibility, cross-package consistency, and correctness across browser and Node.js environments. Approach each task methodically: research existing patterns, make surgical changes, and validate thoroughly. + +**Craftsmanship Mindset**: Every line of code should be intentional, readable, and maintainable. Write code you'd be proud to have reviewed by senior engineers. Prefer simplicity over cleverness. When in doubt, favor explicitness and clarity. + +## Repository Overview + +Exceptionless.JavaScript provides client SDKs for sending errors, logs, feature usages, and other events to an Exceptionless server: + +- **Core** (`@exceptionless/core`) — Event building, configuration, plugin system, queues, storage, submission +- **Browser** (`@exceptionless/browser`) — Browser-specific error handling, request info, lifecycle plugins +- **Node** (`@exceptionless/node`) — Node.js error handling, file-based storage, process lifecycle +- **React** (`@exceptionless/react`) — React error boundary component +- **Vue** (`@exceptionless/vue`) — Vue plugin wrapper +- **AngularJS** (`@exceptionless/angularjs`) — AngularJS module wrapper + +Design principles: **interface-first**, **plugin architecture**, **zero runtime dependencies in core**, **platform-specific extensions**, **ESM-first with CDN bundles**. + +## Quick Start + +```bash +# Install dependencies (use ci for clean installs) +npm ci + +# Build all packages (respects workspace dependency order) +npm run build + +# Run all tests +npm test + +# Lint (ESLint + Prettier check) +npm run lint + +# Auto-format with Prettier +npm run format + +# Clean all build outputs +npm run clean + +# Build + watch a specific package +npm run watch --workspace=packages/core +``` + +## Project Structure + +```text +packages/ +├── core/ # Core library — events, configuration, plugins, queues, storage, submission +│ ├── src/ +│ │ ├── configuration/ # Configuration class, SettingsManager +│ │ ├── lastReferenceIdManager/ +│ │ ├── logging/ # ILog, ConsoleLog, NullLog +│ │ ├── models/ # Event, ErrorInfo, RequestInfo, UserInfo, etc. +│ │ ├── plugins/ # IEventPlugin interface, EventPluginManager, default plugins +│ │ ├── queue/ # IEventQueue, DefaultEventQueue +│ │ ├── storage/ # IStorage, InMemoryStorage, LocalStorage +│ │ ├── submission/ # ISubmissionClient, DefaultSubmissionClient +│ │ ├── EventBuilder.ts # Fluent event builder API +│ │ ├── ExceptionlessClient.ts # Main client class +│ │ ├── Utils.ts # Shared utility functions +│ │ └── index.ts # Barrel export +│ └── test/ +├── browser/ # Browser client — extends core with browser-specific plugins +│ ├── src/ +│ │ ├── plugins/ # BrowserErrorPlugin, GlobalHandlerPlugin, etc. +│ │ ├── BrowserExceptionlessClient.ts +│ │ └── index.ts +│ └── test/ +├── node/ # Node.js client — extends core with Node-specific plugins and storage +│ ├── src/ +│ │ ├── plugins/ +│ │ ├── storage/ +│ │ ├── NodeExceptionlessClient.ts +│ │ └── index.ts +│ └── test/ +├── react/ # React error boundary wrapper +│ └── src/ +│ ├── ExceptionlessErrorBoundary.tsx +│ └── index.ts +├── vue/ # Vue plugin wrapper +│ └── src/ +│ └── index.ts +└── angularjs/ # AngularJS module wrapper + └── src/ + └── index.ts +example/ +├── browser/ # Vanilla JS browser sample +├── express/ # Express.js server sample +├── react/ # React + Vite sample +├── svelte-kit/ # SvelteKit sample +└── vue/ # Vue + Vite sample +``` + +### Dependency Flow + +```text +core → browser → react + → vue + → angularjs +core → node +``` + +All framework packages (`react`, `vue`, `angularjs`) depend on `browser`, which depends on `core`. The `node` package depends directly on `core`. + +## Coding Standards + +### Style & Formatting + +- Run `npm run format` (Prettier) to auto-format code +- Run `npm run lint` (ESLint + Prettier check) to verify +- Match existing file style; minimize diffs +- No code comments unless necessary—code should be self-explanatory + +### TypeScript + +- **Strict mode**: All packages use `"strict": true` with `exactOptionalPropertyTypes`, `noImplicitAny`, `noUnusedLocals`, `noUnusedParameters` +- **Target**: ES2022 with ESNext modules +- **Prefer `interface` over `type`** for object shapes +- **Use modern features**: optional chaining (`?.`), nullish coalescing (`??`), `async`/`await` over raw promises +- **Explicit return types** on exported functions +- **No `any`**: Use `unknown` and narrow with type guards + +### Module System + +- **ESM only**: All packages use `"type": "module"` in `package.json` +- **File extensions in imports**: Use `.js` extensions in TypeScript import paths (e.g., `import { Foo } from "./Foo.js"`) +- **Barrel exports**: Each package has an `index.ts` that re-exports all public API +- **Type-only exports**: Use `export type { ... }` for interfaces and type aliases + +### Architecture Patterns + +- **Interface-first design**: Core abstractions are interfaces (`IEventPlugin`, `IStorage`, `IEventQueue`, `ISubmissionClient`, `ILog`) +- **Plugin architecture**: Functionality is composed via `IEventPlugin` implementations registered on `Configuration` +- **Platform extension**: Browser and Node packages extend `ExceptionlessClient` with platform-specific plugins and services +- **Framework wrappers**: React, Vue, and AngularJS packages wrap the browser client with framework-specific integration patterns +- **Zero runtime dependencies in core**: The core package has no production `dependencies` +- **CDN bundles**: Each package produces esbuild bundles (`dist/index.bundle.js`, `dist/index.bundle.min.js`) for unpkg/jsdelivr + +### Code Quality + +- Write complete, runnable code—no placeholders, TODOs, or `// existing code...` comments +- Follow SOLID, DRY principles; remove unused code and parameters +- Clear, descriptive naming; prefer explicit over clever +- One primary type/class per file +- Keep files focused on a single responsibility + +### Common Patterns + +```typescript +// Plugin implementation +export class MyPlugin implements IEventPlugin { + priority = 50; + name = "MyPlugin"; + + async startup(context: PluginContext): Promise<void> { + /* ... */ + } + async run(context: EventPluginContext): Promise<void> { + /* ... */ + } +} + +// Fluent event builder +client.createLog("source", "message", "info").addTags("tag1", "tag2").setUserIdentity("user@example.com").submit(); + +// Configuration +const client = new ExceptionlessClient(); +await client.startup((config) => { + config.apiKey = "API_KEY_HERE"; + config.serverUrl = "https://localhost:5200"; + config.addPlugin(new MyPlugin()); +}); +``` + +### Key Interfaces + +```typescript +// Plugin lifecycle +interface IEventPlugin { + priority?: number; + name?: string; + startup?(context: PluginContext): Promise<void>; + suspend?(context: PluginContext): Promise<void>; + run?(context: EventPluginContext): Promise<void>; +} + +// Storage abstraction +interface IStorage { + length(): Promise<number>; + clear(): Promise<void>; + getItem(key: string): Promise<string | null>; + setItem(key: string, value: string): Promise<void>; + removeItem(key: string): Promise<void>; + key(index: number): Promise<string | null>; + keys(): Promise<string[]>; +} + +// Submission abstraction +interface ISubmissionClient { + getSettings(version: number): Promise<Response<ServerSettings>>; + submitEvents(events: Event[]): Promise<Response>; + submitUserDescription(referenceId: string, description: UserDescription): Promise<Response>; + submitHeartbeat(sessionIdOrUserId: string, closeSession: boolean): Promise<Response>; +} +``` + +## Making Changes + +### Before Starting + +1. **Gather context**: Read related files across packages, understand the dependency flow +2. **Research patterns**: Search for existing usages of the code you're modifying +3. **Understand completely**: Know the problem, side effects, and edge cases before coding +4. **Plan the approach**: Choose the simplest solution that satisfies all requirements +5. **Check cross-package impact**: Changes to `core` affect all downstream packages + +### Pre-Implementation Analysis + +Before writing any implementation code, think critically: + +1. **What could go wrong?** Consider browser vs Node differences, async timing, null/undefined edge cases +2. **What are the failure modes?** Network failures, storage unavailable, plugin errors +3. **What assumptions am I making?** Validate each assumption against the codebase +4. **Is this the root cause?** Don't fix symptoms—trace to the core problem +5. **Is there existing code that does this?** Search before creating new utilities +6. **Does this work in both browser and Node?** Core code must be platform-agnostic + +### Test-First Development + +**Always write or extend tests before implementing changes:** + +1. **Find existing tests first**: Search `test/` directories in the relevant package +2. **Extend existing test files**: Add test cases to existing `describe` blocks when possible +3. **Write failing tests**: Create tests that demonstrate the bug or missing feature +4. **Implement the fix**: Write minimal code to make tests pass +5. **Refactor**: Clean up while keeping tests green +6. **Verify edge cases**: Add tests for boundary conditions and error paths + +### While Coding + +- **Minimize diffs**: Change only what's necessary, preserve formatting and structure +- **Preserve behavior**: Don't break existing functionality or change semantics unintentionally +- **Build incrementally**: Run `npm run build` after each logical change to catch type errors early +- **Test continuously**: Run `npm test` (or `npm test --workspace=packages/core`) to verify correctness +- **Match style**: Follow the patterns in surrounding code exactly +- **Fix issues you find**: If you discover a correctness issue—whether pre-existing or introduced by your changes—fix it. If the fix is trivial, just do it. If it's non-trivial, present the issue and a proposed plan to the user. + +### Validation + +Before marking work complete, verify: + +1. **Builds successfully**: `npm run build` exits with code 0 +2. **All tests pass**: `npm test` shows no failures +3. **Lint passes**: `npm run lint` shows no errors +4. **API compatibility**: Public API changes are intentional and backward-compatible +5. **Exports updated**: New public types are re-exported through `index.ts` barrel files +6. **Cross-package consistency**: If you changed an interface in `core`, verify all implementations still conform +7. **Breaking changes flagged**: Clearly identify any breaking changes for review + +## Testing + +### Framework + +- **Jest** with **ts-jest** preset +- **`@jest/globals`** for imports (`describe`, `test`, `expect`) +- **jsdom** test environment for browser packages, **node** for the node package +- **jest-ts-webcompat-resolver** for ESM import resolution + +### Test Structure + +Tests live in `test/` directories within each package, mirroring the `src/` structure: + +```text +packages/core/test/ +├── ExceptionlessClient.test.ts +├── Utils.test.ts +├── helpers.ts # Shared test utilities +├── configuration/ +├── plugins/ +├── queue/ +├── storage/ +└── submission/ +``` + +### Writing Tests + +Follow the Arrange-Act-Assert pattern: + +```typescript +import { describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { ExceptionlessClient } from "../src/ExceptionlessClient.js"; + +describe("ExceptionlessClient", () => { + test("should use event reference ids", async () => { + // Arrange + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + + // Act + const context = await client.submitException(createException()); + + // Assert + expect(context.event.reference_id).not.toBeUndefined(); + }); +}); +``` + +### Test Naming + +Use descriptive names that explain the scenario: + +- `"should use event reference ids"` +- `"should cancel event with known bot"` +- `"should handle null input gracefully"` + +### Running Tests + +```bash +# All tests across all packages +npm test + +# Tests for a specific package +npm test --workspace=packages/core +npm test --workspace=packages/browser + +# Watch mode for a specific package +npm run test:watch --workspace=packages/core + +# Run tests matching a pattern +npx jest --testPathPattern="ExceptionlessClient" +``` + +### Test Principles (FIRST) + +- **Fast**: Tests execute quickly with no network calls +- **Isolated**: No dependencies on external services or execution order +- **Repeatable**: Consistent results every run +- **Self-checking**: Tests validate their own outcomes +- **Timely**: Write tests alongside code + +## Build System + +### Per-Package Build + +Each package runs two build steps: + +1. **`tsc`**: Compiles TypeScript → JavaScript with declarations (`.js` + `.d.ts` + `.js.map`) +2. **`esbuild`**: Bundles into single files for CDN distribution (`index.bundle.js`, `index.bundle.min.js`) + +### Build Order + +npm workspaces respects dependency order. `npm run build` at the root builds packages in topological order: `core` first, then `browser`/`node`, then `react`/`vue`/`angularjs`. + +### Package Outputs + +Each package publishes: + +```json +{ + "main": "dist/index.js", + "types": "dist/index.d.ts", + "unpkg": "dist/index.bundle.min.js", + "jsdelivr": "dist/index.bundle.min.js", + "exports": { ".": "./dist/index.js" } +} +``` + +## Security + +- **Validate all inputs**: Check for null, undefined, empty strings at public API boundaries +- **Sanitize external data**: Never trust data from network responses or storage +- **No sensitive data in events**: Don't capture passwords, tokens, keys, or PII +- **Use secure defaults**: Default to HTTPS for server URLs +- **Follow OWASP guidelines**: Review [OWASP Top 10](https://owasp.org/www-project-top-ten/) +- **Dependency security**: Run `npm audit` before adding dependencies; minimize dependency count +- **No `eval` or `Function` constructors**: Avoid dynamic code execution + +## Debugging + +1. **Reproduce** with minimal steps using an example app +2. **Check the plugin pipeline**: Enable `ConsoleLog` to trace event processing +3. **Understand** the root cause before fixing +4. **Test** the fix thoroughly across affected packages +5. **Verify** in both browser and Node environments when the change is in `core` + +## Resources + +- [README.md](README.md) — Overview, installation, and usage +- [example/](example/) — Sample applications for each platform +- [Exceptionless](https://exceptionless.com) — The error monitoring platform these SDKs target diff --git a/README.md b/README.md index 9e3f0726..dc9962d7 100644 --- a/README.md +++ b/README.md @@ -1,198 +1,202 @@ # Exceptionless.JavaScript -[![Build status](https://ci.appveyor.com/api/projects/status/ahu7u4tvls56wqqu/branch/master?svg=true)](https://ci.appveyor.com/project/Exceptionless/exceptionless-javascript) -[![Slack Status](https://slack.exceptionless.com/badge.svg)](https://slack.exceptionless.com) -[![NPM version](https://img.shields.io/npm/v/exceptionless.svg)](https://www.npmjs.org/package/exceptionless) -[![Bower version](https://img.shields.io/bower/v/exceptionless.svg)](http://bower.io/search/?q=exceptionless) -[![Donate](https://img.shields.io/badge/donorbox-donate-blue.svg)](https://donorbox.org/exceptionless) -The definition of the word exceptionless is: to be without exception. Exceptionless.js provides real-time error reporting for your JavaScript applications in the browser or in Node.js. It organizes the gathered information into simple actionable data that will help your app become exceptionless! +[![Build status](https://github.com/Exceptionless/Exceptionless.JavaScript/workflows/Build/badge.svg)](https://github.com/Exceptionless/Exceptionless.JavaScript/actions) +[![Discord](https://img.shields.io/discord/715744504891703319)](https://discord.gg/6HxgFCx) +[![NPM version](https://img.shields.io/npm/v/@exceptionless/core.svg)](https://www.npmjs.org/package/@exceptionless/core) -## Show me the code! ## +The definition of the word exceptionless is: to be without exception. Exceptionless provides real-time error reporting for your JavaScript applications in the browser or in Node.js. It organizes the gathered information into simple actionable data that will help your app become exceptionless! -```html -<script src="https://cdn.rawgit.com/exceptionless/Exceptionless.JavaScript/v1.5.3/dist/exceptionless.min.js"></script> -<script> - var client = exceptionless.ExceptionlessClient.default; - client.config.apiKey = 'API_KEY_HERE'; - - try { - throw new Error('test'); - } catch (error) { - client.submitException(error); - } -</script> -``` +## Browser + +You can install the npm package via `npm install @exceptionless/browser --save` +or via cdn [`https://unpkg.com/@exceptionless/browser`](https://unpkg.com/@exceptionless/browser). +Next, you just need to call startup during your apps startup to automatically +capture unhandled errors. + +```js +import { Exceptionless } from "https://unpkg.com/@exceptionless/browser"; -```javascript -var client = require('exceptionless').ExceptionlessClient.default; -client.config.apiKey = 'API_KEY_HERE'; +await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; + c.setUserIdentity("12345678", "Blake"); + + // set some default data + c.defaultData["mydata"] = { + myGreeting: "Hello World" + }; + + c.defaultTags.push("Example", "JavaScript", "Browser"); +}); try { - throw new Error('test'); + throw new Error("test"); } catch (error) { - client.submitException(error); + await Exceptionless.submitException(error); } +``` + +## Node + +You can install the npm package via `npm install @exceptionless/node --save`. +Next, you just need to call startup during your apps startup to automatically +capture unhandled errors. +```js +import { Exceptionless } from "@exceptionless/node"; + +await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; + c.setUserIdentity("12345678", "Blake"); + + // set some default data + c.defaultData["mydata"] = { + myGreeting: "Hello World" + }; + + c.defaultTags.push("Example", "JavaScript", "Node"); +}); + +try { + throw new Error("test"); +} catch (error) { + await Exceptionless.submitException(error); +} ``` ## Using Exceptionless ### Installation -You can install Exceptionless.js either in your browser application using Bower or a `script` tag, or you can use the Node Package Manager (npm) to install the Node.js package. +You can install Exceptionless either in your browser application using a `script` +tag, or you can use the Node Package Manager (npm) to install the package. #### Browser application -Use one of the following methods to install Exceptionless.js into your browser application: -- **CDN:** +Use one of the following methods to install Exceptionless into your browser application: - Add the following script to your page: +##### CDN - ```html - <script src="https://cdn.rawgit.com/exceptionless/Exceptionless.JavaScript/v1.5.3/dist/exceptionless.min.js"></script> - ``` +Add the following script tag at the very beginning of your page: -- **Bower:** +```html +<script type="module"> + import { Exceptionless } from "https://unpkg.com/@exceptionless/browser"; - 1. Install the package by running `bower install exceptionless`. - 2. Add the script to your HTML page: + await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; + }); +</script> +``` - ```html - <script src="bower_components/exceptionless/dist/exceptionless.min.js"></script> - ``` +##### npm -In either case, we recommend placing the `script` tag at the very beginning of your page. +1. Install the package by running `npm install @exceptionless/browser --save`. +2. Import Exceptionless and call startup during app startup. -#### Node.js -Use this method to install Exceptionless.js into your Node application: +```js +import { Exceptionless } from "@exceptionless/browser"; -1. Install the package by running `npm install exceptionless --save`. -2. Require the Exceptionless.js module in your application: +await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; +}); +``` - ```javascript - var client = require('exceptionless').ExceptionlessClient.default; - ``` +#### Node.js -### Configuring the client -In order to use Exceptionless.js, the `apiKey` setting has to be configured first. -You can configure the `ExceptionlessClient` class using one of the following ways: +Use this method to install Exceptionless into your Node application: -#### Browser application -- You can configure the `apiKey` as part of the script tag. This will be applied to all new instances of the `ExceptionlessClient` class: +1. Install the package by running `npm install @exceptionless/node --save`. +2. Import the Exceptionless module in your application: - ```html - <script src="bower_components/exceptionless/dist/exceptionless.min.js?apiKey=API_KEY_HERE"></script> - ``` +```js +import { Exceptionless } from "@exceptionless/node"; -- You can set the `apiKey` on the default `ExceptionlessClient` instance: +await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; +}); +``` - ```javascript - exceptionless.ExceptionlessClient.default.config.apiKey = 'API_KEY_HERE'; - ``` +### Configuring the client -- You can create a new instance of the `ExceptionlessClient` class and specify the `apiKey`, `serverUrl` or [configuration object](https://github.com/exceptionless/Exceptionless.JavaScript/blob/master/src/configuration/IConfigurationSettings.ts): +In order to use Exceptionless, the `apiKey` setting has to be configured first. +You can configure the `ExceptionlessClient` class by calling +`await Exceptionless.startup("API_KEY_HERE");`. If you want to configure +additional client settings you'll want to call the `startup` overload that takes +a callback as shown below: - ```javascript - var client = new exceptionless.ExceptionlessClient('API_KEY_HERE'); - // or with an api key and server url - var client = new exceptionless.ExceptionlessClient('API_KEY_HERE', 'http://localhost:50000'); - // or with a configuration object - var client = new exceptionless.ExceptionlessClient({ - apiKey: 'API_KEY_HERE', - serverUrl: 'http://localhost:50000', - submissionBatchSize: 100 - }); - ``` +```js +await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; +}); +``` -#### Node.js -- You can set the `apiKey` on the default `ExceptionlessClient` instance: - - ```javascript - var client = require('exceptionless').ExceptionlessClient.default; - client.config.apiKey = 'API_KEY_HERE'; - ``` - -- You can create a new instance of the `ExceptionlessClient` class and specify the `apiKey`, `serverUrl` or [configuration object](https://github.com/exceptionless/Exceptionless.JavaScript/blob/master/src/configuration/IConfigurationSettings.ts): - - ```javascript - var exceptionless = require('exceptionless'); - - var client = new exceptionless.ExceptionlessClient('API_KEY_HERE'); - // or with an api key and server url - var client = new exceptionless.ExceptionlessClient('API_KEY_HERE', 'http://localhost:50000'); - // or with a configuration object - var client = new exceptionless.ExceptionlessClient({ - apiKey: 'API_KEY_HERE', - serverUrl: 'http://localhost:50000', - submissionBatchSize: 100 - }); - ``` +Please see the [docs](https://exceptionless.com/docs/clients/javascript/) for +more information on configuring the client. ### Submitting Events and Errors -Once configured, Exceptionless.js will automatically submit any unhandled exceptions that happen in your application to the Exceptionless server. The following sections will show you how to manually submit different event types as well as customize the data that is sent: -####Submitting Events +Once configured, Exceptionless will automatically submit any unhandled exceptions +that happen in your application to the Exceptionless server. The following +sections will show you how to manually submit different event types as well as +customize the data that is sent: + +#### Submitting Events You may also want to submit log messages, feature usage data or other kinds of events. You can do this very easily with the fluent API: -```javascript -// Browser -var client = exceptionless.ExceptionlessClient.default; -// Node.js -// var client = require('exceptionless').ExceptionlessClient.default; +```js +import { Exceptionless } from "@exceptionless/browser"; -client.submitLog('Logging made easy'); +await Exceptionless.submitLog("Logging made easy"); // You can also specify the log source and log level. // We recommend specifying one of the following log levels: Trace, Debug, Info, Warn, Error -client.submitLog('app.logger', 'This is so easy', 'Info'); -client.createLog('app.logger', 'This is so easy', 'Info').addTags('Exceptionless').submit(); +await Exceptionless.submitLog("app.logger", "This is so easy", "Info"); +await Exceptionless.createLog("app.logger", "This is so easy", "Info").addTags("Exceptionless").submit(); // Submit feature usages -client.submitFeatureUsage('MyFeature'); -client.createFeatureUsage('MyFeature').addTags('Exceptionless').submit(); +await Exceptionless.submitFeatureUsage("MyFeature"); +await Exceptionless.createFeatureUsage("MyFeature").addTags("Exceptionless").submit(); // Submit a 404 -client.submitNotFound('/somepage'); -client.createNotFound('/somepage').addTags('Exceptionless').submit(); +await Exceptionless.submitNotFound("/somepage"); +await Exceptionless.createNotFound("/somepage").addTags("Exceptionless").submit(); // Submit a custom event type -client.submitEvent({ message = 'Low Fuel', type = 'racecar', source = 'Fuel System' }); +await Exceptionless.submitEvent({ message = "Low Fuel", type = "racecar", source = "Fuel System" }); ``` -####Manually submitting Errors -In addition to automatically sending all unhandled exceptions, you may want to manually send exceptions to the service. You can do so by using code like this: +#### Manually submitting Errors + +In addition to automatically sending all unhandled exceptions, you may want to +manually send exceptions to the service. You can do so by using code like this: + +```js +import { Exceptionless } from "@exceptionless/node"; -```javascript -// Browser -var client = exceptionless.ExceptionlessClient.default; -// Node.js -// var client = require('exceptionless').ExceptionlessClient.default; +await Exceptionless.startup("API_KEY_HERE"); try { - throw new Error('test'); + throw new Error("test"); } catch (error) { - client.submitException(error); + await Exceptionless.submitException(error); } ``` -####Sending Additional Information +#### Sending Additional Information -You can easily include additional information in your error reports using the fluent [event builder API](https://github.com/exceptionless/Exceptionless.JavaScript/blob/master/src/EventBuilder.ts). +You can easily include additional information in your error reports using the fluent [event builder API](https://github.com/exceptionless/Exceptionless.JavaScript/blob/master/packages/core/src/EventBuilder.ts). -```javascript -// Browser -var client = exceptionless.ExceptionlessClient.default; -// Node.js -// var client = require('exceptionless').ExceptionlessClient.default; +```js +import { Exceptionless } from "@exceptionless/node"; +await Exceptionless.startup("API_KEY_HERE"); try { - throw new Error('Unable to create order from quote.'); + throw new Error("Unable to create order from quote."); } catch (error) { - client.createException(error) + await Exceptionless.createException(error) // Set the reference id of the event so we can search for it later (reference:id). - // This will automatically be populated if you call client.config.useReferenceIds(); - .setReferenceId('random guid') + .setReferenceId("random guid") // Add the order object (the ability to exclude specific fields will be coming in a future version). .setProperty("Order", order) // Set the quote number. @@ -212,26 +216,31 @@ try { ## Self hosted options -The Exceptionless client can also be configured to send data to your self hosted instance. This is configured by setting the `serverUrl` setting to point to your Exceptionless instance: +The Exceptionless client can also be configured to send data to your self hosted +instance. This is configured by setting the `serverUrl` on the default +`ExceptionlessClient` when calling `startup`: -#### Browser -You can set the `serverUrl` on the default `ExceptionlessClient` instance: - -```javascript -exceptionless.ExceptionlessClient.default.config.serverUrl = 'http://localhost:50000'; +```js +await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; + c.serverUrl = "https://localhost:5100"; +}); ``` -#### Node.js -You can set the `serverUrl` on the default `ExceptionlessClient` instance: +### General Data Protection Regulation -```javascript -var client = require('exceptionless.node').ExceptionlessClient.default; -client.config.serverUrl = 'http://localhost:50000'; -``` +By default the Exceptionless Client will report all available metadata including potential PII data. +You can fine tune the collection of information via Data Exclusions or turning off collection completely. + +Please visit the [docs](https://exceptionless.com/docs/clients/javascript/client-configuration/#general-data-protection-regulation) +for detailed information on how to configure the client to meet your requirements. ## Support -If you need help, please contact us via in-app support, [open an issue](https://github.com/exceptionless/Exceptionless.JavaScript/issues/new) or [join our chat on gitter](https://gitter.im/exceptionless/Discuss). We’re always here to help if you have any questions! +If you need help, please contact us via in-app support, +[open an issue](https://github.com/exceptionless/Exceptionless.JavaScript/issues/new) +or [join our chat on Discord](https://discord.gg/6HxgFCx). We’re always here to +help if you have any questions! ## Contributing @@ -239,28 +248,31 @@ If you find a bug or want to contribute a feature, feel free to create a pull re 1. Clone this repository: - ```sh - git clone https://github.com/exceptionless/Exceptionless.JavaScript.git - ``` + ```sh + git clone https://github.com/exceptionless/Exceptionless.JavaScript.git + ``` 2. Install [Node.js](https://nodejs.org). Node is used for building and testing purposes. +3. Install the development dependencies using [npm](https://www.npmjs.com). + + ```sh + npm install + ``` -3. Install [tsd](https://github.com/DefinitelyTyped/tsd) and [gulp](http://gulpjs.com) and the development dependencies using [npm](https://www.npmjs.com). +4. Build the project by running the following command. - ```sh - npm install - ``` + ```sh + npm run build + ``` -4. Build the project by running the following gulp command. +5. Test the project by running the following command. - ```sh - npm run build - ``` + ```sh + npm test + ``` -5. Test the project by running the following gulp command. +## Thanks - ```sh - npm run test - ``` +Thanks to all the people who have contributed! -During development, you can use relative paths to require Exceptionless, e.g. `require('./dist/exceptionless.node.js')` when you are running Node.js from the git root directory. +[![contributors](https://contributors-img.web.app/image?repo=exceptionless/Exceptionless.JavaScript)](https://github.com/exceptionless/Exceptionless.JavaScript/graphs/contributors) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 4bb99e6a..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: 1.4.{build} - -install: - - ps: Install-Product node 5 - - npm install -g gulp - - npm install -g bower - - npm install - - bower install - -build_script: - - gulp build - -before_test: - #- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - -test_script: - - gulp test - -notifications: - - provider: Slack - channel: '#notifications' - auth_token: - secure: GniMpFE62HprSyQNQoej/VSBnxn2GNnTrca3BnF8+ikMdqduO4Ts4t297teZF6wDAmGwnOtXusctUla8+WxLFkIztvVCS2Z1RG/DvEDYoc0= diff --git a/bower.json b/bower.json deleted file mode 100644 index 3fd598ca..00000000 --- a/bower.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "exceptionless", - "version": "1.5.4", - "description": "JavaScript client for Exceptionless", - "license": "Apache-2.0", - "main": "dist/exceptionless.js", - "keywords": [ - "exceptionless", - "error", - "feature", - "logging", - "tracking", - "reporting" - ], - "ignore": [ - "**/.*", - "node_modules", - "bower_components" - ], - "dependencies": {}, - "repository": { - "url": "git://github.com/exceptionless/Exceptionless.JavaScript.git", - "type": "git" - } -} diff --git a/dist/exceptionless.d.ts b/dist/exceptionless.d.ts deleted file mode 100644 index 8167ef2f..00000000 --- a/dist/exceptionless.d.ts +++ /dev/null @@ -1,533 +0,0 @@ -export interface ILastReferenceIdManager { - getLast(): string; - clearLast(): void; - setLast(eventId: string): void; -} -export interface ILog { - trace(message: string): void; - info(message: string): void; - warn(message: string): void; - error(message: string): void; -} -export declare class DefaultLastReferenceIdManager implements ILastReferenceIdManager { - private _lastReferenceId; - getLast(): string; - clearLast(): void; - setLast(eventId: string): void; -} -export declare class ConsoleLog implements ILog { - trace(message: string): void; - info(message: string): void; - warn(message: string): void; - error(message: string): void; - private log(level, message); -} -export declare class NullLog implements ILog { - trace(message: string): void; - info(message: string): void; - warn(message: string): void; - error(message: string): void; -} -export interface IUserInfo { - identity?: string; - name?: string; - data?: any; -} -export declare class HeartbeatPlugin implements IEventPlugin { - priority: number; - name: string; - private _interval; - private _intervalId; - constructor(heartbeatInterval?: number); - run(context: EventPluginContext, next?: () => void): void; -} -export declare class ReferenceIdPlugin implements IEventPlugin { - priority: number; - name: string; - run(context: EventPluginContext, next?: () => void): void; -} -export declare class EventPluginContext { - cancelled: boolean; - client: ExceptionlessClient; - event: IEvent; - contextData: ContextData; - constructor(client: ExceptionlessClient, event: IEvent, contextData?: ContextData); - readonly log: ILog; -} -export declare class EventPluginManager { - static run(context: EventPluginContext, callback: (context?: EventPluginContext) => void): void; - static addDefaultPlugins(config: Configuration): void; -} -export interface IEventPlugin { - priority?: number; - name?: string; - run(context: EventPluginContext, next?: () => void): void; -} -export declare class DefaultEventQueue implements IEventQueue { - private _config; - private _handlers; - private _suspendProcessingUntil; - private _discardQueuedItemsUntil; - private _processingQueue; - private _queueTimer; - constructor(config: Configuration); - enqueue(event: IEvent): void; - process(isAppExiting?: boolean): void; - suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void; - onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void; - private eventsPosted(events, response); - private areQueuedItemsDiscarded(); - private ensureQueueTimer(); - private isQueueProcessingSuspended(); - private onProcessQueue(); - private processSubmissionResponse(response, events); - private removeEvents(events); -} -export interface IEventQueue { - enqueue(event: IEvent): void; - process(isAppExiting?: boolean): void; - suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void; - onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void; -} -export interface IEnvironmentInfoCollector { - getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo; -} -export interface IErrorParser { - parse(context: EventPluginContext, exception: Error): IError; -} -export interface IModuleCollector { - getModules(context: EventPluginContext): IModule[]; -} -export interface IRequestInfoCollector { - getRequestInfo(context: EventPluginContext): IRequestInfo; -} -export declare class InMemoryStorageProvider implements IStorageProvider { - queue: IStorage; - settings: IStorage; - constructor(maxQueueItems?: number); -} -export interface IStorageProvider { - queue: IStorage; - settings: IStorage; -} -export declare class DefaultSubmissionClient implements ISubmissionClient { - configurationVersionHeader: string; - postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void; - postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void; - getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void; - sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void; - private createRequest(config, method, url, data?); - private createSubmissionCallback(config, callback); -} -export interface ISubmissionAdapter { - sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void; -} -export interface ISubmissionClient { - postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void; - postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void; - getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void; - sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void; -} -export declare class Utils { - static addRange<T>(target: T[], ...values: T[]): T[]; - static getHashCode(source: string): number; - static getCookies(cookies: string, exclusions?: string[]): object; - static guid(): string; - static merge(defaultValues: Object, values: Object): object; - static parseVersion(source: string): string; - static parseQueryString(query: string, exclusions?: string[]): object; - static randomNumber(): number; - static isMatch(input: string, patterns: string[], ignoreCase?: boolean): boolean; - static isEmpty(input: object): boolean; - static startsWith(input: string, prefix: string): boolean; - static endsWith(input: string, suffix: string): boolean; - static stringify(data: any, exclusions?: string[], maxDepth?: number): string; - static toBoolean(input: any, defaultValue?: boolean): boolean; -} -export interface IConfigurationSettings { - apiKey?: string; - serverUrl?: string; - heartbeatServerUrl?: string; - updateSettingsWhenIdleInterval?: number; - environmentInfoCollector?: IEnvironmentInfoCollector; - errorParser?: IErrorParser; - lastReferenceIdManager?: ILastReferenceIdManager; - log?: ILog; - moduleCollector?: IModuleCollector; - requestInfoCollector?: IRequestInfoCollector; - submissionBatchSize?: number; - submissionClient?: ISubmissionClient; - submissionAdapter?: ISubmissionAdapter; - storage?: IStorageProvider; - queue?: IEventQueue; -} -export declare class SettingsManager { - private static _handlers; - static onChanged(handler: (config: Configuration) => void): void; - static applySavedServerSettings(config: Configuration): void; - static getVersion(config: Configuration): number; - static checkVersion(version: number, config: Configuration): void; - static updateSettings(config: Configuration, version?: number): void; - private static changed(config); - private static getSavedServerSettings(config); -} -export interface IEvent { - type?: string; - source?: string; - date?: Date; - tags?: string[]; - message?: string; - geo?: string; - value?: number; - data?: any; - reference_id?: string; - count?: number; -} -export declare class SubmissionResponse { - success: boolean; - badRequest: boolean; - serviceUnavailable: boolean; - paymentRequired: boolean; - unableToAuthenticate: boolean; - notFound: boolean; - requestEntityTooLarge: boolean; - statusCode: number; - message: string; - constructor(statusCode: number, message?: string); -} -export declare class ExceptionlessClient { - private static _instance; - config: Configuration; - private _intervalId; - private _timeoutId; - constructor(); - constructor(settings: IConfigurationSettings); - constructor(apiKey: string, serverUrl?: string); - createException(exception: Error): EventBuilder; - submitException(exception: Error, callback?: (context: EventPluginContext) => void): void; - createUnhandledException(exception: Error, submissionMethod?: string): EventBuilder; - submitUnhandledException(exception: Error, submissionMethod?: string, callback?: (context: EventPluginContext) => void): void; - createFeatureUsage(feature: string): EventBuilder; - submitFeatureUsage(feature: string, callback?: (context: EventPluginContext) => void): void; - createLog(message: string): EventBuilder; - createLog(source: string, message: string): EventBuilder; - createLog(source: string, message: string, level: string): EventBuilder; - submitLog(message: string): void; - submitLog(source: string, message: string): void; - submitLog(source: string, message: string, level: string, callback?: (context: EventPluginContext) => void): void; - createNotFound(resource: string): EventBuilder; - submitNotFound(resource: string, callback?: (context: EventPluginContext) => void): void; - createSessionStart(): EventBuilder; - submitSessionStart(callback?: (context: EventPluginContext) => void): void; - submitSessionEnd(sessionIdOrUserId: string): void; - submitSessionHeartbeat(sessionIdOrUserId: string): void; - createEvent(pluginContextData?: ContextData): EventBuilder; - submitEvent(event: IEvent, pluginContextData?: ContextData, callback?: (context: EventPluginContext) => void): void; - updateUserEmailAndDescription(referenceId: string, email: string, description: string, callback?: (response: SubmissionResponse) => void): void; - getLastReferenceId(): string; - private updateSettingsTimer(initialDelay?); - static readonly default: ExceptionlessClient; -} -export declare class ContextData { - setException(exception: Error): void; - readonly hasException: boolean; - getException(): Error; - markAsUnhandledError(): void; - readonly isUnhandledError: boolean; - setSubmissionMethod(method: string): void; - getSubmissionMethod(): string; -} -export interface IEnvironmentInfo { - processor_count?: number; - total_physical_memory?: number; - available_physical_memory?: number; - command_line?: string; - process_name?: string; - process_id?: string; - process_memory_size?: number; - thread_id?: string; - architecture?: string; - o_s_name?: string; - o_s_version?: string; - ip_address?: string; - machine_name?: string; - install_id?: string; - runtime_version?: string; - data?: any; -} -export interface IParameter { - data?: any; - generic_arguments?: string[]; - name?: string; - type?: string; - type_namespace?: string; -} -export interface IMethod { - data?: any; - generic_arguments?: string[]; - parameters?: IParameter[]; - is_signature_target?: boolean; - declaring_namespace?: string; - declaring_type?: string; - name?: string; - module_id?: number; -} -export interface IStackFrame extends IMethod { - file_name?: string; - line_number?: number; - column?: number; -} -export interface IInnerError { - message?: string; - type?: string; - code?: string; - data?: any; - inner?: IInnerError; - stack_trace?: IStackFrame[]; - target_method?: IMethod; -} -export interface IModule { - data?: any; - module_id?: number; - name?: string; - version?: string; - is_entry?: boolean; - created_date?: Date; - modified_date?: Date; -} -export interface IError extends IInnerError { - modules?: IModule[]; -} -export interface IRequestInfo { - user_agent?: string; - http_method?: string; - is_secure?: boolean; - host?: string; - port?: number; - path?: string; - referrer?: string; - client_ip_address?: string; - cookies?: any; - post_data?: any; - query_string?: any; - data?: any; -} -export interface IStorageItem { - timestamp: number; - value: any; -} -export interface IStorage { - save(value: any): number; - get(limit?: number): IStorageItem[]; - remove(timestamp: number): void; - clear(): void; -} -export declare type SubmissionCallback = (status: number, message: string, data?: string, headers?: object) => void; -export interface SubmissionRequest { - apiKey: string; - userAgent: string; - method: string; - url: string; - data: string; -} -export declare class Configuration implements IConfigurationSettings { - private static _defaultSettings; - defaultTags: string[]; - defaultData: object; - enabled: boolean; - environmentInfoCollector: IEnvironmentInfoCollector; - errorParser: IErrorParser; - lastReferenceIdManager: ILastReferenceIdManager; - log: ILog; - moduleCollector: IModuleCollector; - requestInfoCollector: IRequestInfoCollector; - submissionBatchSize: number; - submissionAdapter: ISubmissionAdapter; - submissionClient: ISubmissionClient; - settings: object; - storage: IStorageProvider; - queue: IEventQueue; - private _apiKey; - private _serverUrl; - private _heartbeatServerUrl; - private _updateSettingsWhenIdleInterval; - private _dataExclusions; - private _userAgentBotPatterns; - private _plugins; - private _handlers; - constructor(configSettings?: IConfigurationSettings); - apiKey: string; - readonly isValid: boolean; - serverUrl: string; - heartbeatServerUrl: string; - updateSettingsWhenIdleInterval: number; - readonly dataExclusions: string[]; - addDataExclusions(...exclusions: string[]): void; - readonly userAgentBotPatterns: string[]; - addUserAgentBotPatterns(...userAgentBotPatterns: string[]): void; - readonly plugins: IEventPlugin[]; - addPlugin(plugin: IEventPlugin): void; - addPlugin(name: string, priority: number, pluginAction: (context: EventPluginContext, next?: () => void) => void): void; - removePlugin(plugin: IEventPlugin): void; - setVersion(version: string): void; - setUserIdentity(userInfo: IUserInfo): void; - setUserIdentity(identity: string): void; - setUserIdentity(identity: string, name: string): void; - readonly userAgent: string; - useSessions(sendHeartbeats?: boolean, heartbeatInterval?: number): void; - useReferenceIds(): void; - useLocalStorage(): void; - useDebugLogger(): void; - onChanged(handler: (config: Configuration) => void): void; - private changed(); - static readonly defaults: IConfigurationSettings; -} -export interface IUserDescription { - email_address?: string; - description?: string; - data?: any; -} -export declare class SettingsResponse { - success: boolean; - settings: any; - settingsVersion: number; - message: string; - exception: any; - constructor(success: boolean, settings: any, settingsVersion?: number, exception?: any, message?: string); -} -export declare class EventBuilder { - target: IEvent; - client: ExceptionlessClient; - pluginContextData: ContextData; - private _validIdentifierErrorMessage; - constructor(event: IEvent, client: ExceptionlessClient, pluginContextData?: ContextData); - setType(type: string): EventBuilder; - setSource(source: string): EventBuilder; - setReferenceId(referenceId: string): EventBuilder; - setEventReference(name: string, id: string): EventBuilder; - setMessage(message: string): EventBuilder; - setGeo(latitude: number, longitude: number): EventBuilder; - setUserIdentity(userInfo: IUserInfo): EventBuilder; - setUserIdentity(identity: string): EventBuilder; - setUserIdentity(identity: string, name: string): EventBuilder; - setUserDescription(emailAddress: string, description: string): EventBuilder; - setManualStackingInfo(signatureData: any, title?: string): this; - setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder; - setValue(value: number): EventBuilder; - addTags(...tags: string[]): EventBuilder; - setProperty(name: string, value: any, maxDepth?: number, excludedPropertyNames?: string[]): EventBuilder; - markAsCritical(critical: boolean): EventBuilder; - addRequestInfo(request: object): EventBuilder; - submit(callback?: (context: EventPluginContext) => void): void; - private isValidIdentifier(value); -} -export interface IManualStackingInfo { - title?: string; - signature_data?: any; -} -export declare class ConfigurationDefaultsPlugin implements IEventPlugin { - priority: number; - name: string; - run(context: EventPluginContext, next?: () => void): void; -} -export declare class DuplicateCheckerPlugin implements IEventPlugin { - priority: number; - name: string; - private _mergedEvents; - private _processedHashcodes; - private _getCurrentTime; - private _interval; - constructor(getCurrentTime?: () => number, interval?: number); - run(context: EventPluginContext, next?: () => void): void; -} -export declare class EnvironmentInfoPlugin implements IEventPlugin { - priority: number; - name: string; - run(context: EventPluginContext, next?: () => void): void; -} -export declare class ErrorPlugin implements IEventPlugin { - priority: number; - name: string; - run(context: EventPluginContext, next?: () => void): void; -} -export declare class EventExclusionPlugin implements IEventPlugin { - priority: number; - name: string; - run(context: EventPluginContext, next?: () => void): void; -} -export declare class ModuleInfoPlugin implements IEventPlugin { - priority: number; - name: string; - run(context: EventPluginContext, next?: () => void): void; -} -export declare class RequestInfoPlugin implements IEventPlugin { - priority: number; - name: string; - run(context: EventPluginContext, next?: () => void): void; -} -export declare class SubmissionMethodPlugin implements IEventPlugin { - priority: number; - name: string; - run(context: EventPluginContext, next?: () => void): void; -} -export declare class InMemoryStorage implements IStorage { - private maxItems; - private items; - private lastTimestamp; - constructor(maxItems: number); - save(value: any): number; - get(limit?: number): IStorageItem[]; - remove(timestamp: number): void; - clear(): void; -} -export interface IClientConfiguration { - settings: object; - version: number; -} -export declare abstract class KeyValueStorageBase implements IStorage { - private maxItems; - private items; - private lastTimestamp; - constructor(maxItems: any); - save(value: any, single?: boolean): number; - get(limit?: number): IStorageItem[]; - remove(timestamp: number): void; - clear(): void; - protected abstract write(key: string, value: string): void; - protected abstract read(key: string): string; - protected abstract readAllKeys(): string[]; - protected abstract delete(key: string): any; - protected abstract getKey(timestamp: number): string; - protected abstract getTimestamp(key: string): number; - private ensureIndex(); - private safeDelete(key); - private createIndex(); -} -export declare class BrowserStorage extends KeyValueStorageBase { - private prefix; - static isAvailable(): boolean; - constructor(namespace: string, prefix?: string, maxItems?: number); - write(key: string, value: string): void; - read(key: string): string; - readAllKeys(): string[]; - delete(key: string): void; - getKey(timestamp: any): string; - getTimestamp(key: any): number; -} -export declare class DefaultErrorParser implements IErrorParser { - parse(context: EventPluginContext, exception: Error): IError; -} -export declare class DefaultModuleCollector implements IModuleCollector { - getModules(context: EventPluginContext): IModule[]; -} -export declare class DefaultRequestInfoCollector implements IRequestInfoCollector { - getRequestInfo(context: EventPluginContext): IRequestInfo; -} -export declare class BrowserStorageProvider implements IStorageProvider { - queue: IStorage; - settings: IStorage; - constructor(prefix?: string, maxQueueItems?: number); -} -export declare class DefaultSubmissionAdapter implements ISubmissionAdapter { - sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void; -} diff --git a/dist/exceptionless.js b/dist/exceptionless.js deleted file mode 100644 index 36f4322a..00000000 --- a/dist/exceptionless.js +++ /dev/null @@ -1,3402 +0,0 @@ -/** - * https://github.com/csnover/TraceKit - * @license MIT - * @namespace TraceKit - */ -(function(window, undefined) { -if (!window) { - return; -} - -var TraceKit = {}; -var _oldTraceKit = window.TraceKit; - -// global reference to slice -var _slice = [].slice; -var UNKNOWN_FUNCTION = '?'; - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types -var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/; - -/** - * A better form of hasOwnProperty<br/> - * Example: `_has(MainHostObject, property) === true/false` - * - * @param {Object} object to check property - * @param {string} key to check - * @return {Boolean} true if the object has the key and it is not inherited - */ -function _has(object, key) { - return Object.prototype.hasOwnProperty.call(object, key); -} - -/** - * Returns true if the parameter is undefined<br/> - * Example: `_isUndefined(val) === true/false` - * - * @param {*} what Value to check - * @return {Boolean} true if undefined and false otherwise - */ -function _isUndefined(what) { - return typeof what === 'undefined'; -} - -/** - * Export TraceKit out to another variable<br/> - * Example: `var TK = TraceKit.noConflict()` - * @return {Object} The TraceKit object - * @memberof TraceKit - */ -TraceKit.noConflict = function noConflict() { - window.TraceKit = _oldTraceKit; - return TraceKit; -}; - -/** - * Wrap any function in a TraceKit reporter<br/> - * Example: `func = TraceKit.wrap(func);` - * - * @param {Function} func Function to be wrapped - * @return {Function} The wrapped func - * @memberof TraceKit - */ -TraceKit.wrap = function traceKitWrapper(func) { - function wrapped() { - try { - return func.apply(this, arguments); - } catch (e) { - TraceKit.report(e); - throw e; - } - } - return wrapped; -}; - -/** - * Cross-browser processing of unhandled exceptions - * - * Syntax: - * ```js - * TraceKit.report.subscribe(function(stackInfo) { ... }) - * TraceKit.report.unsubscribe(function(stackInfo) { ... }) - * TraceKit.report(exception) - * try { ...code... } catch(ex) { TraceKit.report(ex); } - * ``` - * - * Supports: - * - Firefox: full stack trace with line numbers, plus column number - * on top frame; column number is not guaranteed - * - Opera: full stack trace with line and column numbers - * - Chrome: full stack trace with line and column numbers - * - Safari: line and column number for the top frame only; some frames - * may be missing, and column number is not guaranteed - * - IE: line and column number for the top frame only; some frames - * may be missing, and column number is not guaranteed - * - * In theory, TraceKit should work on all of the following versions: - * - IE5.5+ (only 8.0 tested) - * - Firefox 0.9+ (only 3.5+ tested) - * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require - * Exceptions Have Stacktrace to be enabled in opera:config) - * - Safari 3+ (only 4+ tested) - * - Chrome 1+ (only 5+ tested) - * - Konqueror 3.5+ (untested) - * - * Requires TraceKit.computeStackTrace. - * - * Tries to catch all unhandled exceptions and report them to the - * subscribed handlers. Please note that TraceKit.report will rethrow the - * exception. This is REQUIRED in order to get a useful stack trace in IE. - * If the exception does not reach the top of the browser, you will only - * get a stack trace from the point where TraceKit.report was called. - * - * Handlers receive a TraceKit.StackTrace object as described in the - * TraceKit.computeStackTrace docs. - * - * @memberof TraceKit - * @namespace - */ -TraceKit.report = (function reportModuleWrapper() { - var handlers = [], - lastException = null, - lastExceptionStack = null; - - /** - * Add a crash handler. - * @param {Function} handler - * @memberof TraceKit.report - */ - function subscribe(handler) { - installGlobalHandler(); - handlers.push(handler); - } - - /** - * Remove a crash handler. - * @param {Function} handler - * @memberof TraceKit.report - */ - function unsubscribe(handler) { - for (var i = handlers.length - 1; i >= 0; --i) { - if (handlers[i] === handler) { - handlers.splice(i, 1); - } - } - - if (handlers.length === 0) { - window.onerror = _oldOnerrorHandler; - _onErrorHandlerInstalled = false; - } - } - - /** - * Dispatch stack information to all handlers. - * @param {TraceKit.StackTrace} stack - * @param {boolean} isWindowError Is this a top-level window error? - * @param {Error=} error The error that's being handled (if available, null otherwise) - * @memberof TraceKit.report - * @throws An exception if an error occurs while calling an handler. - */ - function notifyHandlers(stack, isWindowError, error) { - var exception = null; - if (isWindowError && !TraceKit.collectWindowErrors) { - return; - } - for (var i in handlers) { - if (_has(handlers, i)) { - try { - handlers[i](stack, isWindowError, error); - } catch (inner) { - exception = inner; - } - } - } - - if (exception) { - throw exception; - } - } - - var _oldOnerrorHandler, _onErrorHandlerInstalled; - - /** - * Ensures all global unhandled exceptions are recorded. - * Supported by Gecko and IE. - * @param {string} message Error message. - * @param {string} url URL of script that generated the exception. - * @param {(number|string)} lineNo The line number at which the error occurred. - * @param {(number|string)=} columnNo The column number at which the error occurred. - * @param {Error=} errorObj The actual Error object. - * @memberof TraceKit.report - */ - function traceKitWindowOnError(message, url, lineNo, columnNo, errorObj) { - var stack = null; - - if (lastExceptionStack) { - TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message); - processLastException(); - } else if (errorObj) { - stack = TraceKit.computeStackTrace(errorObj); - notifyHandlers(stack, true, errorObj); - } else { - var location = { - 'url': url, - 'line': lineNo, - 'column': columnNo - }; - - var name; - var msg = message; // must be new var or will modify original `arguments` - if ({}.toString.call(message) === '[object String]') { - var groups = message.match(ERROR_TYPES_RE); - if (groups) { - name = groups[1]; - msg = groups[2]; - } - } - - location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line); - location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line); - stack = { - 'name': name, - 'message': msg, - 'mode': 'onerror', - 'stack': [location] - }; - - notifyHandlers(stack, true, null); - } - - if (_oldOnerrorHandler) { - return _oldOnerrorHandler.apply(this, arguments); - } - - return false; - } - - /** - * Install a global onerror handler - * @memberof TraceKit.report - */ - function installGlobalHandler() { - if (_onErrorHandlerInstalled === true) { - return; - } - - _oldOnerrorHandler = window.onerror; - window.onerror = traceKitWindowOnError; - _onErrorHandlerInstalled = true; - } - - /** - * Process the most recent exception - * @memberof TraceKit.report - */ - function processLastException() { - var _lastExceptionStack = lastExceptionStack, - _lastException = lastException; - lastExceptionStack = null; - lastException = null; - notifyHandlers(_lastExceptionStack, false, _lastException); - } - - /** - * Reports an unhandled Error to TraceKit. - * @param {Error} ex - * @memberof TraceKit.report - * @throws An exception if an incomplete stack trace is detected (old IE browsers). - */ - function report(ex) { - if (lastExceptionStack) { - if (lastException === ex) { - return; // already caught by an inner catch block, ignore - } else { - processLastException(); - } - } - - var stack = TraceKit.computeStackTrace(ex); - lastExceptionStack = stack; - lastException = ex; - - // If the stack trace is incomplete, wait for 2 seconds for - // slow slow IE to see if onerror occurs or not before reporting - // this exception; otherwise, we will end up with an incomplete - // stack trace - setTimeout(function () { - if (lastException === ex) { - processLastException(); - } - }, (stack.incomplete ? 2000 : 0)); - - throw ex; // re-throw to propagate to the top level (and cause window.onerror) - } - - report.subscribe = subscribe; - report.unsubscribe = unsubscribe; - return report; -}()); - -/** - * An object representing a single stack frame. - * @typedef {Object} StackFrame - * @property {string} url The JavaScript or HTML file URL. - * @property {string} func The function name, or empty for anonymous functions (if guessing did not work). - * @property {string[]?} args The arguments passed to the function, if known. - * @property {number=} line The line number, if known. - * @property {number=} column The column number, if known. - * @property {string[]} context An array of source code lines; the middle element corresponds to the correct line#. - * @memberof TraceKit - */ - -/** - * An object representing a JavaScript stack trace. - * @typedef {Object} StackTrace - * @property {string} name The name of the thrown exception. - * @property {string} message The exception error message. - * @property {TraceKit.StackFrame[]} stack An array of stack frames. - * @property {string} mode 'stack', 'stacktrace', 'multiline', 'callers', 'onerror', or 'failed' -- method used to collect the stack trace. - * @memberof TraceKit - */ - -/** - * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript - * - * Syntax: - * ```js - * s = TraceKit.computeStackTrace.ofCaller([depth]) - * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below) - * ``` - * - * Supports: - * - Firefox: full stack trace with line numbers and unreliable column - * number on top frame - * - Opera 10: full stack trace with line and column numbers - * - Opera 9-: full stack trace with line numbers - * - Chrome: full stack trace with line and column numbers - * - Safari: line and column number for the topmost stacktrace element - * only - * - IE: no line numbers whatsoever - * - * Tries to guess names of anonymous functions by looking for assignments - * in the source code. In IE and Safari, we have to guess source file names - * by searching for function bodies inside all page scripts. This will not - * work for scripts that are loaded cross-domain. - * Here be dragons: some function names may be guessed incorrectly, and - * duplicate functions may be mismatched. - * - * TraceKit.computeStackTrace should only be used for tracing purposes. - * Logging of unhandled exceptions should be done with TraceKit.report, - * which builds on top of TraceKit.computeStackTrace and provides better - * IE support by utilizing the window.onerror event to retrieve information - * about the top of the stack. - * - * Note: In IE and Safari, no stack trace is recorded on the Error object, - * so computeStackTrace instead walks its *own* chain of callers. - * This means that: - * * in Safari, some methods may be missing from the stack trace; - * * in IE, the topmost function in the stack trace will always be the - * caller of computeStackTrace. - * - * This is okay for tracing (because you are likely to be calling - * computeStackTrace from the function you want to be the topmost element - * of the stack trace anyway), but not okay for logging unhandled - * exceptions (because your catch block will likely be far away from the - * inner function that actually caused the exception). - * - * Tracing example: - * ```js - * function trace(message) { - * var stackInfo = TraceKit.computeStackTrace.ofCaller(); - * var data = message + "\n"; - * for(var i in stackInfo.stack) { - * var item = stackInfo.stack[i]; - * data += (item.func || '[anonymous]') + "() in " + item.url + ":" + (item.line || '0') + "\n"; - * } - * if (window.console) - * console.info(data); - * else - * alert(data); - * } - * ``` - * @memberof TraceKit - * @namespace - */ -TraceKit.computeStackTrace = (function computeStackTraceWrapper() { - var debug = false, - sourceCache = {}; - - /** - * Attempts to retrieve source code via XMLHttpRequest, which is used - * to look up anonymous function names. - * @param {string} url URL of source code. - * @return {string} Source contents. - * @memberof TraceKit.computeStackTrace - */ - function loadSource(url) { - if (!TraceKit.remoteFetching) { //Only attempt request if remoteFetching is on. - return ''; - } - try { - var getXHR = function() { - try { - return new window.XMLHttpRequest(); - } catch (e) { - // explicitly bubble up the exception if not found - return new window.ActiveXObject('Microsoft.XMLHTTP'); - } - }; - - var request = getXHR(); - request.open('GET', url, false); - request.send(''); - return request.responseText; - } catch (e) { - return ''; - } - } - - /** - * Retrieves source code from the source code cache. - * @param {string} url URL of source code. - * @return {Array.<string>} Source contents. - * @memberof TraceKit.computeStackTrace - */ - function getSource(url) { - if (typeof url !== 'string') { - return []; - } - - if (!_has(sourceCache, url)) { - // URL needs to be able to fetched within the acceptable domain. Otherwise, - // cross-domain errors will be triggered. - /* - Regex matches: - 0 - Full Url - 1 - Protocol - 2 - Domain - 3 - Port (Useful for internal applications) - 4 - Path - */ - var source = ''; - var domain = ''; - try { domain = window.document.domain; } catch (e) { } - var match = /(.*)\:\/\/([^:\/]+)([:\d]*)\/{0,1}([\s\S]*)/.exec(url); - if (match && match[2] === domain) { - source = loadSource(url); - } - sourceCache[url] = source ? source.split('\n') : []; - } - - return sourceCache[url]; - } - - /** - * Tries to use an externally loaded copy of source code to determine - * the name of a function by looking at the name of the variable it was - * assigned to, if any. - * @param {string} url URL of source code. - * @param {(string|number)} lineNo Line number in source code. - * @return {string} The function name, if discoverable. - * @memberof TraceKit.computeStackTrace - */ - function guessFunctionName(url, lineNo) { - var reFunctionArgNames = /function ([^(]*)\(([^)]*)\)/, - reGuessFunction = /['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/, - line = '', - maxLines = 10, - source = getSource(url), - m; - - if (!source.length) { - return UNKNOWN_FUNCTION; - } - - // Walk backwards from the first line in the function until we find the line which - // matches the pattern above, which is the function definition - for (var i = 0; i < maxLines; ++i) { - line = source[lineNo - i] + line; - - if (!_isUndefined(line)) { - if ((m = reGuessFunction.exec(line))) { - return m[1]; - } else if ((m = reFunctionArgNames.exec(line))) { - return m[1]; - } - } - } - - return UNKNOWN_FUNCTION; - } - - /** - * Retrieves the surrounding lines from where an exception occurred. - * @param {string} url URL of source code. - * @param {(string|number)} line Line number in source code to center around for context. - * @return {?Array.<string>} Lines of source code. - * @memberof TraceKit.computeStackTrace - */ - function gatherContext(url, line) { - var source = getSource(url); - - if (!source.length) { - return null; - } - - var context = [], - // linesBefore & linesAfter are inclusive with the offending line. - // if linesOfContext is even, there will be one extra line - // *before* the offending line. - linesBefore = Math.floor(TraceKit.linesOfContext / 2), - // Add one extra line if linesOfContext is odd - linesAfter = linesBefore + (TraceKit.linesOfContext % 2), - start = Math.max(0, line - linesBefore - 1), - end = Math.min(source.length, line + linesAfter - 1); - - line -= 1; // convert to 0-based index - - for (var i = start; i < end; ++i) { - if (!_isUndefined(source[i])) { - context.push(source[i]); - } - } - - return context.length > 0 ? context : null; - } - - /** - * Escapes special characters, except for whitespace, in a string to be - * used inside a regular expression as a string literal. - * @param {string} text The string. - * @return {string} The escaped string literal. - * @memberof TraceKit.computeStackTrace - */ - function escapeRegExp(text) { - return text.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g, '\\$&'); - } - - /** - * Escapes special characters in a string to be used inside a regular - * expression as a string literal. Also ensures that HTML entities will - * be matched the same as their literal friends. - * @param {string} body The string. - * @return {string} The escaped string. - * @memberof TraceKit.computeStackTrace - */ - function escapeCodeAsRegExpForMatchingInsideHTML(body) { - return escapeRegExp(body).replace('<', '(?:<|<)').replace('>', '(?:>|>)').replace('&', '(?:&|&)').replace('"', '(?:"|")').replace(/\s+/g, '\\s+'); - } - - /** - * Determines where a code fragment occurs in the source code. - * @param {RegExp} re The function definition. - * @param {Array.<string>} urls A list of URLs to search. - * @return {?Object.<string, (string|number)>} An object containing - * the url, line, and column number of the defined function. - * @memberof TraceKit.computeStackTrace - */ - function findSourceInUrls(re, urls) { - var source, m; - for (var i = 0, j = urls.length; i < j; ++i) { - if ((source = getSource(urls[i])).length) { - source = source.join('\n'); - if ((m = re.exec(source))) { - - return { - 'url': urls[i], - 'line': source.substring(0, m.index).split('\n').length, - 'column': m.index - source.lastIndexOf('\n', m.index) - 1 - }; - } - } - } - - return null; - } - - /** - * Determines at which column a code fragment occurs on a line of the - * source code. - * @param {string} fragment The code fragment. - * @param {string} url The URL to search. - * @param {(string|number)} line The line number to examine. - * @return {?number} The column number. - * @memberof TraceKit.computeStackTrace - */ - function findSourceInLine(fragment, url, line) { - var source = getSource(url), - re = new RegExp('\\b' + escapeRegExp(fragment) + '\\b'), - m; - - line -= 1; - - if (source && source.length > line && (m = re.exec(source[line]))) { - return m.index; - } - - return null; - } - - /** - * Determines where a function was defined within the source code. - * @param {(Function|string)} func A function reference or serialized - * function definition. - * @return {?Object.<string, (string|number)>} An object containing - * the url, line, and column number of the defined function. - * @memberof TraceKit.computeStackTrace - */ - function findSourceByFunctionBody(func) { - if (_isUndefined(window && window.document)) { - return; - } - - var urls = [window.location.href], - scripts = window.document.getElementsByTagName('script'), - body, - code = '' + func, - codeRE = /^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/, - eventRE = /^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/, - re, - parts, - result; - - for (var i = 0; i < scripts.length; ++i) { - var script = scripts[i]; - if (script.src) { - urls.push(script.src); - } - } - - if (!(parts = codeRE.exec(code))) { - re = new RegExp(escapeRegExp(code).replace(/\s+/g, '\\s+')); - } - - // not sure if this is really necessary, but I don’t have a test - // corpus large enough to confirm that and it was in the original. - else { - var name = parts[1] ? '\\s+' + parts[1] : '', - args = parts[2].split(',').join('\\s*,\\s*'); - - body = escapeRegExp(parts[3]).replace(/;$/, ';?'); // semicolon is inserted if the function ends with a comment.replace(/\s+/g, '\\s+'); - re = new RegExp('function' + name + '\\s*\\(\\s*' + args + '\\s*\\)\\s*{\\s*' + body + '\\s*}'); - } - - // look for a normal function definition - if ((result = findSourceInUrls(re, urls))) { - return result; - } - - // look for an old-school event handler function - if ((parts = eventRE.exec(code))) { - var event = parts[1]; - body = escapeCodeAsRegExpForMatchingInsideHTML(parts[2]); - - // look for a function defined in HTML as an onXXX handler - re = new RegExp('on' + event + '=[\\\'"]\\s*' + body + '\\s*[\\\'"]', 'i'); - - if ((result = findSourceInUrls(re, urls[0]))) { - return result; - } - - // look for ??? - re = new RegExp(body); - - if ((result = findSourceInUrls(re, urls))) { - return result; - } - } - - return null; - } - - // Contents of Exception in various browsers. - // - // SAFARI: - // ex.message = Can't find variable: qq - // ex.line = 59 - // ex.sourceId = 580238192 - // ex.sourceURL = http://... - // ex.expressionBeginOffset = 96 - // ex.expressionCaretOffset = 98 - // ex.expressionEndOffset = 98 - // ex.name = ReferenceError - // - // FIREFOX: - // ex.message = qq is not defined - // ex.fileName = http://... - // ex.lineNumber = 59 - // ex.columnNumber = 69 - // ex.stack = ...stack trace... (see the example below) - // ex.name = ReferenceError - // - // CHROME: - // ex.message = qq is not defined - // ex.name = ReferenceError - // ex.type = not_defined - // ex.arguments = ['aa'] - // ex.stack = ...stack trace... - // - // INTERNET EXPLORER: - // ex.message = ... - // ex.name = ReferenceError - // - // OPERA: - // ex.message = ...message... (see the example below) - // ex.name = ReferenceError - // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message) - // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace' - - /** - * Computes stack trace information from the stack property. - * Chrome and Gecko use this property. - * @param {Error} ex - * @return {?TraceKit.StackTrace} Stack trace information. - * @memberof TraceKit.computeStackTrace - */ - function computeStackTraceFromStackProp(ex) { - if (!ex.stack) { - return null; - } - - var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, - gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i, - winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i, - - // Used to additionally parse URL/line/column from eval frames - isEval, - geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, - chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/, - - lines = ex.stack.split('\n'), - stack = [], - submatch, - parts, - element, - reference = /^(.*) is undefined$/.exec(ex.message); - - for (var i = 0, j = lines.length; i < j; ++i) { - if ((parts = chrome.exec(lines[i]))) { - var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line - isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line - if (isEval && (submatch = chromeEval.exec(parts[2]))) { - // throw out eval line/column and use top-most line/column number - parts[2] = submatch[1]; // url - parts[3] = submatch[2]; // line - parts[4] = submatch[3]; // column - } - element = { - 'url': !isNative ? parts[2] : null, - 'func': parts[1] || UNKNOWN_FUNCTION, - 'args': isNative ? [parts[2]] : [], - 'line': parts[3] ? +parts[3] : null, - 'column': parts[4] ? +parts[4] : null - }; - } else if ( parts = winjs.exec(lines[i]) ) { - element = { - 'url': parts[2], - 'func': parts[1] || UNKNOWN_FUNCTION, - 'args': [], - 'line': +parts[3], - 'column': parts[4] ? +parts[4] : null - }; - } else if ((parts = gecko.exec(lines[i]))) { - isEval = parts[3] && parts[3].indexOf(' > eval') > -1; - if (isEval && (submatch = geckoEval.exec(parts[3]))) { - // throw out eval line/column and use top-most line number - parts[3] = submatch[1]; - parts[4] = submatch[2]; - parts[5] = null; // no column when eval - } else if (i === 0 && !parts[5] && !_isUndefined(ex.columnNumber)) { - // FireFox uses this awesome columnNumber property for its top frame - // Also note, Firefox's column number is 0-based and everything else expects 1-based, - // so adding 1 - // NOTE: this hack doesn't work if top-most frame is eval - stack[0].column = ex.columnNumber + 1; - } - element = { - 'url': parts[3], - 'func': parts[1] || UNKNOWN_FUNCTION, - 'args': parts[2] ? parts[2].split(',') : [], - 'line': parts[4] ? +parts[4] : null, - 'column': parts[5] ? +parts[5] : null - }; - } else { - continue; - } - - if (!element.func && element.line) { - element.func = guessFunctionName(element.url, element.line); - } - - element.context = element.line ? gatherContext(element.url, element.line) : null; - stack.push(element); - } - - if (!stack.length) { - return null; - } - - if (stack[0] && stack[0].line && !stack[0].column && reference) { - stack[0].column = findSourceInLine(reference[1], stack[0].url, stack[0].line); - } - - return { - 'mode': 'stack', - 'name': ex.name, - 'message': ex.message, - 'stack': stack - }; - } - - /** - * Computes stack trace information from the stacktrace property. - * Opera 10+ uses this property. - * @param {Error} ex - * @return {?TraceKit.StackTrace} Stack trace information. - * @memberof TraceKit.computeStackTrace - */ - function computeStackTraceFromStacktraceProp(ex) { - // Access and store the stacktrace property before doing ANYTHING - // else to it because Opera is not very good at providing it - // reliably in other circumstances. - var stacktrace = ex.stacktrace; - if (!stacktrace) { - return; - } - - var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i, - opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i, - lines = stacktrace.split('\n'), - stack = [], - parts; - - for (var line = 0; line < lines.length; line += 2) { - var element = null; - if ((parts = opera10Regex.exec(lines[line]))) { - element = { - 'url': parts[2], - 'line': +parts[1], - 'column': null, - 'func': parts[3], - 'args':[] - }; - } else if ((parts = opera11Regex.exec(lines[line]))) { - element = { - 'url': parts[6], - 'line': +parts[1], - 'column': +parts[2], - 'func': parts[3] || parts[4], - 'args': parts[5] ? parts[5].split(',') : [] - }; - } - - if (element) { - if (!element.func && element.line) { - element.func = guessFunctionName(element.url, element.line); - } - if (element.line) { - try { - element.context = gatherContext(element.url, element.line); - } catch (exc) {} - } - - if (!element.context) { - element.context = [lines[line + 1]]; - } - - stack.push(element); - } - } - - if (!stack.length) { - return null; - } - - return { - 'mode': 'stacktrace', - 'name': ex.name, - 'message': ex.message, - 'stack': stack - }; - } - - /** - * NOT TESTED. - * Computes stack trace information from an error message that includes - * the stack trace. - * Opera 9 and earlier use this method if the option to show stack - * traces is turned on in opera:config. - * @param {Error} ex - * @return {?TraceKit.StackTrace} Stack information. - * @memberof TraceKit.computeStackTrace - */ - function computeStackTraceFromOperaMultiLineMessage(ex) { - // TODO: Clean this function up - // Opera includes a stack trace into the exception message. An example is: - // - // Statement on line 3: Undefined variable: undefinedFunc - // Backtrace: - // Line 3 of linked script file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.js: In function zzz - // undefinedFunc(a); - // Line 7 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function yyy - // zzz(x, y, z); - // Line 3 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function xxx - // yyy(a, a, a); - // Line 1 of function script - // try { xxx('hi'); return false; } catch(ex) { TraceKit.report(ex); } - // ... - - var lines = ex.message.split('\n'); - if (lines.length < 4) { - return null; - } - - var lineRE1 = /^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i, - lineRE2 = /^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i, - lineRE3 = /^\s*Line (\d+) of function script\s*$/i, - stack = [], - scripts = (window && window.document && window.document.getElementsByTagName('script')), - inlineScriptBlocks = [], - parts; - - for (var s in scripts) { - if (_has(scripts, s) && !scripts[s].src) { - inlineScriptBlocks.push(scripts[s]); - } - } - - for (var line = 2; line < lines.length; line += 2) { - var item = null; - if ((parts = lineRE1.exec(lines[line]))) { - item = { - 'url': parts[2], - 'func': parts[3], - 'args': [], - 'line': +parts[1], - 'column': null - }; - } else if ((parts = lineRE2.exec(lines[line]))) { - item = { - 'url': parts[3], - 'func': parts[4], - 'args': [], - 'line': +parts[1], - 'column': null // TODO: Check to see if inline#1 (+parts[2]) points to the script number or column number. - }; - var relativeLine = (+parts[1]); // relative to the start of the <SCRIPT> block - var script = inlineScriptBlocks[parts[2] - 1]; - if (script) { - var source = getSource(item.url); - if (source) { - source = source.join('\n'); - var pos = source.indexOf(script.innerText); - if (pos >= 0) { - item.line = relativeLine + source.substring(0, pos).split('\n').length; - } - } - } - } else if ((parts = lineRE3.exec(lines[line]))) { - var url = window.location.href.replace(/#.*$/, ''); - var re = new RegExp(escapeCodeAsRegExpForMatchingInsideHTML(lines[line + 1])); - var src = findSourceInUrls(re, [url]); - item = { - 'url': url, - 'func': '', - 'args': [], - 'line': src ? src.line : parts[1], - 'column': null - }; - } - - if (item) { - if (!item.func) { - item.func = guessFunctionName(item.url, item.line); - } - var context = gatherContext(item.url, item.line); - var midline = (context ? context[Math.floor(context.length / 2)] : null); - if (context && midline.replace(/^\s*/, '') === lines[line + 1].replace(/^\s*/, '')) { - item.context = context; - } else { - // if (context) alert("Context mismatch. Correct midline:\n" + lines[i+1] + "\n\nMidline:\n" + midline + "\n\nContext:\n" + context.join("\n") + "\n\nURL:\n" + item.url); - item.context = [lines[line + 1]]; - } - stack.push(item); - } - } - if (!stack.length) { - return null; // could not parse multiline exception message as Opera stack trace - } - - return { - 'mode': 'multiline', - 'name': ex.name, - 'message': lines[0], - 'stack': stack - }; - } - - /** - * Adds information about the first frame to incomplete stack traces. - * Safari and IE require this to get complete data on the first frame. - * @param {TraceKit.StackTrace} stackInfo Stack trace information from - * one of the compute* methods. - * @param {string} url The URL of the script that caused an error. - * @param {(number|string)} lineNo The line number of the script that - * caused an error. - * @param {string=} message The error generated by the browser, which - * hopefully contains the name of the object that caused the error. - * @return {boolean} Whether or not the stack information was - * augmented. - * @memberof TraceKit.computeStackTrace - */ - function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) { - var initial = { - 'url': url, - 'line': lineNo - }; - - if (initial.url && initial.line) { - stackInfo.incomplete = false; - - if (!initial.func) { - initial.func = guessFunctionName(initial.url, initial.line); - } - - if (!initial.context) { - initial.context = gatherContext(initial.url, initial.line); - } - - var reference = / '([^']+)' /.exec(message); - if (reference) { - initial.column = findSourceInLine(reference[1], initial.url, initial.line); - } - - if (stackInfo.stack.length > 0) { - if (stackInfo.stack[0].url === initial.url) { - if (stackInfo.stack[0].line === initial.line) { - return false; // already in stack trace - } else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) { - stackInfo.stack[0].line = initial.line; - stackInfo.stack[0].context = initial.context; - return false; - } - } - } - - stackInfo.stack.unshift(initial); - stackInfo.partial = true; - return true; - } else { - stackInfo.incomplete = true; - } - - return false; - } - - /** - * Computes stack trace information by walking the arguments.caller - * chain at the time the exception occurred. This will cause earlier - * frames to be missed but is the only way to get any stack trace in - * Safari and IE. The top frame is restored by - * {@link augmentStackTraceWithInitialElement}. - * @param {Error} ex - * @return {TraceKit.StackTrace=} Stack trace information. - * @memberof TraceKit.computeStackTrace - */ - function computeStackTraceByWalkingCallerChain(ex, depth) { - var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i, - stack = [], - funcs = {}, - recursion = false, - parts, - item, - source; - - for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) { - if (curr === computeStackTrace || curr === TraceKit.report) { - continue; - } - - item = { - 'url': null, - 'func': UNKNOWN_FUNCTION, - 'args': [], - 'line': null, - 'column': null - }; - - if (curr.name) { - item.func = curr.name; - } else if ((parts = functionName.exec(curr.toString()))) { - item.func = parts[1]; - } - - if (typeof item.func === 'undefined') { - try { - item.func = parts.input.substring(0, parts.input.indexOf('{')); - } catch (e) { } - } - - if ((source = findSourceByFunctionBody(curr))) { - item.url = source.url; - item.line = source.line; - - if (item.func === UNKNOWN_FUNCTION) { - item.func = guessFunctionName(item.url, item.line); - } - - var reference = / '([^']+)' /.exec(ex.message || ex.description); - if (reference) { - item.column = findSourceInLine(reference[1], source.url, source.line); - } - } - - if (funcs['' + curr]) { - recursion = true; - }else{ - funcs['' + curr] = true; - } - - stack.push(item); - } - - if (depth) { - stack.splice(0, depth); - } - - var result = { - 'mode': 'callers', - 'name': ex.name, - 'message': ex.message, - 'stack': stack - }; - augmentStackTraceWithInitialElement(result, ex.sourceURL || ex.fileName, ex.line || ex.lineNumber, ex.message || ex.description); - return result; - } - - /** - * Computes a stack trace for an exception. - * @param {Error} ex - * @param {(string|number)=} depth - * @memberof TraceKit.computeStackTrace - */ - function computeStackTrace(ex, depth) { - var stack = null; - depth = (depth == null ? 0 : +depth); - - try { - // This must be tried first because Opera 10 *destroys* - // its stacktrace property if you try to access the stack - // property first!! - stack = computeStackTraceFromStacktraceProp(ex); - if (stack) { - return stack; - } - } catch (e) { - if (debug) { - throw e; - } - } - - try { - stack = computeStackTraceFromStackProp(ex); - if (stack) { - return stack; - } - } catch (e) { - if (debug) { - throw e; - } - } - - try { - stack = computeStackTraceFromOperaMultiLineMessage(ex); - if (stack) { - return stack; - } - } catch (e) { - if (debug) { - throw e; - } - } - - try { - stack = computeStackTraceByWalkingCallerChain(ex, depth + 1); - if (stack) { - return stack; - } - } catch (e) { - if (debug) { - throw e; - } - } - - return { - 'name': ex.name, - 'message': ex.message, - 'mode': 'failed' - }; - } - - /** - * Logs a stacktrace starting from the previous call and working down. - * @param {(number|string)=} depth How many frames deep to trace. - * @return {TraceKit.StackTrace} Stack trace information. - * @memberof TraceKit.computeStackTrace - */ - function computeStackTraceOfCaller(depth) { - depth = (depth == null ? 0 : +depth) + 1; // "+ 1" because "ofCaller" should drop one frame - try { - throw new Error(); - } catch (ex) { - return computeStackTrace(ex, depth + 1); - } - } - - computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement; - computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp; - computeStackTrace.guessFunctionName = guessFunctionName; - computeStackTrace.gatherContext = gatherContext; - computeStackTrace.ofCaller = computeStackTraceOfCaller; - computeStackTrace.getSource = getSource; - - return computeStackTrace; -}()); - -/** - * Extends support for global error handling for asynchronous browser - * functions. Adopted from Closure Library's errorhandler.js - * @memberof TraceKit - */ -TraceKit.extendToAsynchronousCallbacks = function () { - var _helper = function _helper(fnName) { - var originalFn = window[fnName]; - window[fnName] = function traceKitAsyncExtension() { - // Make a copy of the arguments - var args = _slice.call(arguments); - var originalCallback = args[0]; - if (typeof (originalCallback) === 'function') { - args[0] = TraceKit.wrap(originalCallback); - } - // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it - // also only supports 2 argument and doesn't care what "this" is, so we - // can just call the original function directly. - if (originalFn.apply) { - return originalFn.apply(this, args); - } else { - return originalFn(args[0], args[1]); - } - }; - }; - - _helper('setTimeout'); - _helper('setInterval'); -}; - -//Default options: -if (!TraceKit.remoteFetching) { - TraceKit.remoteFetching = true; -} -if (!TraceKit.collectWindowErrors) { - TraceKit.collectWindowErrors = true; -} -if (!TraceKit.linesOfContext || TraceKit.linesOfContext < 1) { - // 5 lines before, the offending line, 5 lines after - TraceKit.linesOfContext = 11; -} - -// UMD export -if (typeof define === 'function' && define.amd) { - define('TraceKit', [], TraceKit); -} else if (typeof module !== 'undefined' && module.exports && window.module !== module) { - module.exports = TraceKit; -} else { - window.TraceKit = TraceKit; -} - -}(typeof window !== 'undefined' ? window : global)); - - -var exports, require; -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - define('exceptionless', ["require","exports","TraceKit"], factory); - } else if (typeof exports === 'object') { - module.exports = factory(require, exports, require('TraceKit')); - } else { - root.exceptionless = factory(require, exports, root.TraceKit); - } -}(this, function(require, exports, TraceKit) { -if (!exports) { var exports = {}; } - -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var DefaultLastReferenceIdManager = (function () { - function DefaultLastReferenceIdManager() { - this._lastReferenceId = null; - } - DefaultLastReferenceIdManager.prototype.getLast = function () { - return this._lastReferenceId; - }; - DefaultLastReferenceIdManager.prototype.clearLast = function () { - this._lastReferenceId = null; - }; - DefaultLastReferenceIdManager.prototype.setLast = function (eventId) { - this._lastReferenceId = eventId; - }; - return DefaultLastReferenceIdManager; -}()); -exports.DefaultLastReferenceIdManager = DefaultLastReferenceIdManager; -var ConsoleLog = (function () { - function ConsoleLog() { - } - ConsoleLog.prototype.trace = function (message) { - this.log('debug', message); - }; - ConsoleLog.prototype.info = function (message) { - this.log('info', message); - }; - ConsoleLog.prototype.warn = function (message) { - this.log('warn', message); - }; - ConsoleLog.prototype.error = function (message) { - this.log('error', message); - }; - ConsoleLog.prototype.log = function (level, message) { - if (console) { - var msg = "[" + level + "] Exceptionless: " + message; - if (console[level]) { - console[level](msg); - } - else if (console.log) { - console["log"](msg); - } - } - }; - return ConsoleLog; -}()); -exports.ConsoleLog = ConsoleLog; -var NullLog = (function () { - function NullLog() { - } - NullLog.prototype.trace = function (message) { }; - NullLog.prototype.info = function (message) { }; - NullLog.prototype.warn = function (message) { }; - NullLog.prototype.error = function (message) { }; - return NullLog; -}()); -exports.NullLog = NullLog; -var HeartbeatPlugin = (function () { - function HeartbeatPlugin(heartbeatInterval) { - if (heartbeatInterval === void 0) { heartbeatInterval = 30000; } - this.priority = 100; - this.name = 'HeartbeatPlugin'; - this._interval = heartbeatInterval; - } - HeartbeatPlugin.prototype.run = function (context, next) { - clearInterval(this._intervalId); - var user = context.event.data['@user']; - if (user && user.identity) { - this._intervalId = setInterval(function () { return context.client.submitSessionHeartbeat(user.identity); }, this._interval); - } - next && next(); - }; - return HeartbeatPlugin; -}()); -exports.HeartbeatPlugin = HeartbeatPlugin; -var ReferenceIdPlugin = (function () { - function ReferenceIdPlugin() { - this.priority = 20; - this.name = 'ReferenceIdPlugin'; - } - ReferenceIdPlugin.prototype.run = function (context, next) { - if ((!context.event.reference_id || context.event.reference_id.length === 0) && context.event.type === 'error') { - context.event.reference_id = Utils.guid().replace('-', '').substring(0, 10); - } - next && next(); - }; - return ReferenceIdPlugin; -}()); -exports.ReferenceIdPlugin = ReferenceIdPlugin; -var EventPluginContext = (function () { - function EventPluginContext(client, event, contextData) { - this.client = client; - this.event = event; - this.contextData = contextData ? contextData : new ContextData(); - } - Object.defineProperty(EventPluginContext.prototype, "log", { - get: function () { - return this.client.config.log; - }, - enumerable: true, - configurable: true - }); - return EventPluginContext; -}()); -exports.EventPluginContext = EventPluginContext; -var EventPluginManager = (function () { - function EventPluginManager() { - } - EventPluginManager.run = function (context, callback) { - var wrap = function (plugin, next) { - return function () { - try { - if (!context.cancelled) { - plugin.run(context, next); - } - } - catch (ex) { - context.cancelled = true; - context.log.error("Error running plugin '" + plugin.name + "': " + ex.message + ". Discarding Event."); - } - if (context.cancelled && !!callback) { - callback(context); - } - }; - }; - var plugins = context.client.config.plugins; - var wrappedPlugins = []; - if (!!callback) { - wrappedPlugins[plugins.length] = wrap({ name: 'cb', priority: 9007199254740992, run: callback }, null); - } - for (var index = plugins.length - 1; index > -1; index--) { - wrappedPlugins[index] = wrap(plugins[index], !!callback || (index < plugins.length - 1) ? wrappedPlugins[index + 1] : null); - } - wrappedPlugins[0](); - }; - EventPluginManager.addDefaultPlugins = function (config) { - config.addPlugin(new ConfigurationDefaultsPlugin()); - config.addPlugin(new ErrorPlugin()); - config.addPlugin(new DuplicateCheckerPlugin()); - config.addPlugin(new EventExclusionPlugin()); - config.addPlugin(new ModuleInfoPlugin()); - config.addPlugin(new RequestInfoPlugin()); - config.addPlugin(new EnvironmentInfoPlugin()); - config.addPlugin(new SubmissionMethodPlugin()); - }; - return EventPluginManager; -}()); -exports.EventPluginManager = EventPluginManager; -var DefaultEventQueue = (function () { - function DefaultEventQueue(config) { - this._handlers = []; - this._processingQueue = false; - this._config = config; - } - DefaultEventQueue.prototype.enqueue = function (event) { - var eventWillNotBeQueued = 'The event will not be queued.'; - var config = this._config; - var log = config.log; - if (!config.enabled) { - log.info("Configuration is disabled. " + eventWillNotBeQueued); - return; - } - if (!config.isValid) { - log.info("Invalid Api Key. " + eventWillNotBeQueued); - return; - } - if (this.areQueuedItemsDiscarded()) { - log.info("Queue items are currently being discarded. " + eventWillNotBeQueued); - return; - } - this.ensureQueueTimer(); - var timestamp = config.storage.queue.save(event); - var logText = "type=" + event.type + " " + (!!event.reference_id ? 'refid=' + event.reference_id : ''); - if (timestamp) { - log.info("Enqueuing event: " + timestamp + " " + logText); - } - else { - log.error("Could not enqueue event " + logText); - } - }; - DefaultEventQueue.prototype.process = function (isAppExiting) { - var _this = this; - var queueNotProcessed = 'The queue will not be processed.'; - var config = this._config; - var log = config.log; - if (this._processingQueue) { - return; - } - log.info('Processing queue...'); - if (!config.enabled) { - log.info("Configuration is disabled. " + queueNotProcessed); - return; - } - if (!config.isValid) { - log.info("Invalid Api Key. " + queueNotProcessed); - return; - } - this._processingQueue = true; - this.ensureQueueTimer(); - try { - var events_1 = config.storage.queue.get(config.submissionBatchSize); - if (!events_1 || events_1.length === 0) { - this._processingQueue = false; - return; - } - log.info("Sending " + events_1.length + " events to " + config.serverUrl + "."); - config.submissionClient.postEvents(events_1.map(function (e) { return e.value; }), config, function (response) { - _this.processSubmissionResponse(response, events_1); - _this.eventsPosted(events_1.map(function (e) { return e.value; }), response); - log.info('Finished processing queue.'); - _this._processingQueue = false; - }, isAppExiting); - } - catch (ex) { - log.error("Error processing queue: " + ex); - this.suspendProcessing(); - this._processingQueue = false; - } - }; - DefaultEventQueue.prototype.suspendProcessing = function (durationInMinutes, discardFutureQueuedItems, clearQueue) { - var config = this._config; - if (!durationInMinutes || durationInMinutes <= 0) { - durationInMinutes = 5; - } - config.log.info("Suspending processing for " + durationInMinutes + " minutes."); - this._suspendProcessingUntil = new Date(new Date().getTime() + (durationInMinutes * 60000)); - if (discardFutureQueuedItems) { - this._discardQueuedItemsUntil = this._suspendProcessingUntil; - } - if (clearQueue) { - config.storage.queue.clear(); - } - }; - DefaultEventQueue.prototype.onEventsPosted = function (handler) { - !!handler && this._handlers.push(handler); - }; - DefaultEventQueue.prototype.eventsPosted = function (events, response) { - var handlers = this._handlers; - for (var _i = 0, handlers_1 = handlers; _i < handlers_1.length; _i++) { - var handler = handlers_1[_i]; - try { - handler(events, response); - } - catch (ex) { - this._config.log.error("Error calling onEventsPosted handler: " + ex); - } - } - }; - DefaultEventQueue.prototype.areQueuedItemsDiscarded = function () { - return this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date(); - }; - DefaultEventQueue.prototype.ensureQueueTimer = function () { - var _this = this; - if (!this._queueTimer) { - this._queueTimer = setInterval(function () { return _this.onProcessQueue(); }, 10000); - } - }; - DefaultEventQueue.prototype.isQueueProcessingSuspended = function () { - return this._suspendProcessingUntil && this._suspendProcessingUntil > new Date(); - }; - DefaultEventQueue.prototype.onProcessQueue = function () { - if (!this.isQueueProcessingSuspended() && !this._processingQueue) { - this.process(); - } - }; - DefaultEventQueue.prototype.processSubmissionResponse = function (response, events) { - var noSubmission = 'The event will not be submitted.'; - var config = this._config; - var log = config.log; - if (response.success) { - log.info("Sent " + events.length + " events."); - this.removeEvents(events); - return; - } - if (response.serviceUnavailable) { - log.error('Server returned service unavailable.'); - this.suspendProcessing(); - return; - } - if (response.paymentRequired) { - log.info('Too many events have been submitted, please upgrade your plan.'); - this.suspendProcessing(null, true, true); - return; - } - if (response.unableToAuthenticate) { - log.info("Unable to authenticate, please check your configuration. " + noSubmission); - this.suspendProcessing(15); - this.removeEvents(events); - return; - } - if (response.notFound || response.badRequest) { - log.error("Error while trying to submit data: " + response.message); - this.suspendProcessing(60 * 4); - this.removeEvents(events); - return; - } - if (response.requestEntityTooLarge) { - var message = 'Event submission discarded for being too large.'; - if (config.submissionBatchSize > 1) { - log.error(message + " Retrying with smaller batch size."); - config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5)); - } - else { - log.error(message + " " + noSubmission); - this.removeEvents(events); - } - return; - } - if (!response.success) { - log.error("Error submitting events: " + (response.message || 'Please check the network tab for more info.')); - this.suspendProcessing(); - } - }; - DefaultEventQueue.prototype.removeEvents = function (events) { - for (var index = 0; index < (events || []).length; index++) { - this._config.storage.queue.remove(events[index].timestamp); - } - }; - return DefaultEventQueue; -}()); -exports.DefaultEventQueue = DefaultEventQueue; -var InMemoryStorageProvider = (function () { - function InMemoryStorageProvider(maxQueueItems) { - if (maxQueueItems === void 0) { maxQueueItems = 250; } - this.queue = new InMemoryStorage(maxQueueItems); - this.settings = new InMemoryStorage(1); - } - return InMemoryStorageProvider; -}()); -exports.InMemoryStorageProvider = InMemoryStorageProvider; -var DefaultSubmissionClient = (function () { - function DefaultSubmissionClient() { - this.configurationVersionHeader = 'x-exceptionless-configversion'; - } - DefaultSubmissionClient.prototype.postEvents = function (events, config, callback, isAppExiting) { - var data = JSON.stringify(events); - var request = this.createRequest(config, 'POST', config.serverUrl + "/api/v2/events", data); - var cb = this.createSubmissionCallback(config, callback); - return config.submissionAdapter.sendRequest(request, cb, isAppExiting); - }; - DefaultSubmissionClient.prototype.postUserDescription = function (referenceId, description, config, callback) { - var path = config.serverUrl + "/api/v2/events/by-ref/" + encodeURIComponent(referenceId) + "/user-description"; - var data = JSON.stringify(description); - var request = this.createRequest(config, 'POST', path, data); - var cb = this.createSubmissionCallback(config, callback); - return config.submissionAdapter.sendRequest(request, cb); - }; - DefaultSubmissionClient.prototype.getSettings = function (config, version, callback) { - var request = this.createRequest(config, 'GET', config.serverUrl + "/api/v2/projects/config?v=" + version); - var cb = function (status, message, data, headers) { - if (status !== 200) { - return callback(new SettingsResponse(false, null, -1, null, message)); - } - var settings; - try { - settings = JSON.parse(data); - } - catch (e) { - config.log.error("Unable to parse settings: '" + data + "'"); - } - if (!settings || isNaN(settings.version)) { - return callback(new SettingsResponse(false, null, -1, null, 'Invalid configuration settings.')); - } - callback(new SettingsResponse(true, settings.settings || {}, settings.version)); - }; - return config.submissionAdapter.sendRequest(request, cb); - }; - DefaultSubmissionClient.prototype.sendHeartbeat = function (sessionIdOrUserId, closeSession, config) { - var request = this.createRequest(config, 'GET', config.heartbeatServerUrl + "/api/v2/events/session/heartbeat?id=" + sessionIdOrUserId + "&close=" + closeSession); - config.submissionAdapter.sendRequest(request); - }; - DefaultSubmissionClient.prototype.createRequest = function (config, method, url, data) { - if (data === void 0) { data = null; } - return { - method: method, - url: url, - data: data, - apiKey: config.apiKey, - userAgent: config.userAgent - }; - }; - DefaultSubmissionClient.prototype.createSubmissionCallback = function (config, callback) { - var _this = this; - return function (status, message, data, headers) { - var settingsVersion = headers && parseInt(headers[_this.configurationVersionHeader], 10); - SettingsManager.checkVersion(settingsVersion, config); - callback(new SubmissionResponse(status, message)); - }; - }; - return DefaultSubmissionClient; -}()); -exports.DefaultSubmissionClient = DefaultSubmissionClient; -var Utils = (function () { - function Utils() { - } - Utils.addRange = function (target) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - if (!target) { - target = []; - } - if (!values || values.length === 0) { - return target; - } - for (var _a = 0, values_1 = values; _a < values_1.length; _a++) { - var value = values_1[_a]; - if (value && target.indexOf(value) < 0) { - target.push(value); - } - } - return target; - }; - Utils.getHashCode = function (source) { - if (!source || source.length === 0) { - return 0; - } - var hash = 0; - for (var index = 0; index < source.length; index++) { - var character = source.charCodeAt(index); - hash = ((hash << 5) - hash) + character; - hash |= 0; - } - return hash; - }; - Utils.getCookies = function (cookies, exclusions) { - var result = {}; - var parts = (cookies || '').split('; '); - for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) { - var part = parts_1[_i]; - var cookie = part.split('='); - if (!Utils.isMatch(cookie[0], exclusions)) { - result[cookie[0]] = cookie[1]; - } - } - return !Utils.isEmpty(result) ? result : null; - }; - Utils.guid = function () { - function s4() { - return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); - } - return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); - }; - Utils.merge = function (defaultValues, values) { - var result = {}; - for (var key in defaultValues || {}) { - if (!!defaultValues[key]) { - result[key] = defaultValues[key]; - } - } - for (var key in values || {}) { - if (!!values[key]) { - result[key] = values[key]; - } - } - return result; - }; - Utils.parseVersion = function (source) { - if (!source) { - return null; - } - var versionRegex = /(v?((\d+)\.(\d+)(\.(\d+))?)(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?)/; - var matches = versionRegex.exec(source); - if (matches && matches.length > 0) { - return matches[0]; - } - return null; - }; - Utils.parseQueryString = function (query, exclusions) { - if (!query || query.length === 0) { - return null; - } - var pairs = query.split('&'); - if (pairs.length === 0) { - return null; - } - var result = {}; - for (var _i = 0, pairs_1 = pairs; _i < pairs_1.length; _i++) { - var pair = pairs_1[_i]; - var parts = pair.split('='); - if (!Utils.isMatch(parts[0], exclusions)) { - result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]); - } - } - return !Utils.isEmpty(result) ? result : null; - }; - Utils.randomNumber = function () { - return Math.floor(Math.random() * 9007199254740992); - }; - Utils.isMatch = function (input, patterns, ignoreCase) { - if (ignoreCase === void 0) { ignoreCase = true; } - if (!input || typeof input !== 'string') { - return false; - } - var trim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; - input = (ignoreCase ? input.toLowerCase() : input).replace(trim, ''); - return (patterns || []).some(function (pattern) { - if (typeof pattern !== 'string') { - return false; - } - pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, ''); - if (pattern.length <= 0) { - return false; - } - var startsWithWildcard = pattern[0] === '*'; - if (startsWithWildcard) { - pattern = pattern.slice(1); - } - var endsWithWildcard = pattern[pattern.length - 1] === '*'; - if (endsWithWildcard) { - pattern = pattern.substring(0, pattern.length - 1); - } - if (startsWithWildcard && endsWithWildcard) { - return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1; - } - if (startsWithWildcard) { - return Utils.endsWith(input, pattern); - } - if (endsWithWildcard) { - return Utils.startsWith(input, pattern); - } - return input === pattern; - }); - }; - Utils.isEmpty = function (input) { - return input === null || (typeof (input) === 'object' && Object.keys(input).length === 0); - }; - Utils.startsWith = function (input, prefix) { - return input.substring(0, prefix.length) === prefix; - }; - Utils.endsWith = function (input, suffix) { - return input.indexOf(suffix, input.length - suffix.length) !== -1; - }; - Utils.stringify = function (data, exclusions, maxDepth) { - function stringifyImpl(obj, excludedKeys) { - var cache = []; - return JSON.stringify(obj, function (key, value) { - if (Utils.isMatch(key, excludedKeys)) { - return; - } - if (typeof value === 'object' && !!value) { - if (cache.indexOf(value) !== -1) { - return; - } - cache.push(value); - } - return value; - }); - } - if (({}).toString.call(data) === '[object Object]') { - var flattened = {}; - for (var prop in data) { - var value = data[prop]; - if (value === data) { - continue; - } - flattened[prop] = data[prop]; - } - return stringifyImpl(flattened, exclusions); - } - if (({}).toString.call(data) === '[object Array]') { - var result = []; - for (var index = 0; index < data.length; index++) { - result[index] = JSON.parse(stringifyImpl(data[index], exclusions)); - } - return JSON.stringify(result); - } - return stringifyImpl(data, exclusions); - }; - Utils.toBoolean = function (input, defaultValue) { - if (defaultValue === void 0) { defaultValue = false; } - if (typeof input === 'boolean') { - return input; - } - if (input === null || typeof input !== 'number' && typeof input !== 'string') { - return defaultValue; - } - switch ((input + '').toLowerCase().trim()) { - case 'true': - case 'yes': - case '1': return true; - case 'false': - case 'no': - case '0': - case null: return false; - } - return defaultValue; - }; - return Utils; -}()); -exports.Utils = Utils; -var SettingsManager = (function () { - function SettingsManager() { - } - SettingsManager.onChanged = function (handler) { - !!handler && this._handlers.push(handler); - }; - SettingsManager.applySavedServerSettings = function (config) { - if (!config || !config.isValid) { - return; - } - var savedSettings = this.getSavedServerSettings(config); - config.log.info("Applying saved settings: v" + savedSettings.version); - config.settings = Utils.merge(config.settings, savedSettings.settings); - this.changed(config); - }; - SettingsManager.getVersion = function (config) { - if (!config || !config.isValid) { - return 0; - } - var savedSettings = this.getSavedServerSettings(config); - return savedSettings.version || 0; - }; - SettingsManager.checkVersion = function (version, config) { - var currentVersion = this.getVersion(config); - if (version <= currentVersion) { - return; - } - config.log.info("Updating settings from v" + currentVersion + " to v" + version); - this.updateSettings(config, currentVersion); - }; - SettingsManager.updateSettings = function (config, version) { - var _this = this; - if (!config || !config.enabled) { - return; - } - var unableToUpdateMessage = 'Unable to update settings'; - if (!config.isValid) { - config.log.error(unableToUpdateMessage + ": ApiKey is not set."); - return; - } - if (!version || version < 0) { - version = this.getVersion(config); - } - config.log.info("Checking for updated settings from: v" + version + "."); - config.submissionClient.getSettings(config, version, function (response) { - if (!config || !response || !response.success || !response.settings) { - config.log.warn(unableToUpdateMessage + ": " + response.message); - return; - } - config.settings = Utils.merge(config.settings, response.settings); - var savedServerSettings = SettingsManager.getSavedServerSettings(config); - for (var key in savedServerSettings) { - if (response.settings[key]) { - continue; - } - delete config.settings[key]; - } - var newSettings = { - version: response.settingsVersion, - settings: response.settings - }; - config.storage.settings.save(newSettings); - config.log.info("Updated settings: v" + newSettings.version); - _this.changed(config); - }); - }; - SettingsManager.changed = function (config) { - var handlers = this._handlers; - for (var _i = 0, handlers_2 = handlers; _i < handlers_2.length; _i++) { - var handler = handlers_2[_i]; - try { - handler(config); - } - catch (ex) { - config.log.error("Error calling onChanged handler: " + ex); - } - } - }; - SettingsManager.getSavedServerSettings = function (config) { - var item = config.storage.settings.get()[0]; - if (item && item.value && item.value.version && item.value.settings) { - return item.value; - } - return { version: 0, settings: {} }; - }; - return SettingsManager; -}()); -SettingsManager._handlers = []; -exports.SettingsManager = SettingsManager; -var SubmissionResponse = (function () { - function SubmissionResponse(statusCode, message) { - this.success = false; - this.badRequest = false; - this.serviceUnavailable = false; - this.paymentRequired = false; - this.unableToAuthenticate = false; - this.notFound = false; - this.requestEntityTooLarge = false; - this.statusCode = statusCode; - this.message = message; - this.success = statusCode >= 200 && statusCode <= 299; - this.badRequest = statusCode === 400; - this.serviceUnavailable = statusCode === 503; - this.paymentRequired = statusCode === 402; - this.unableToAuthenticate = statusCode === 401 || statusCode === 403; - this.notFound = statusCode === 404; - this.requestEntityTooLarge = statusCode === 413; - } - return SubmissionResponse; -}()); -exports.SubmissionResponse = SubmissionResponse; -var ExceptionlessClient = (function () { - function ExceptionlessClient(settingsOrApiKey, serverUrl) { - var _this = this; - this.config = typeof settingsOrApiKey === 'object' - ? new Configuration(settingsOrApiKey) - : new Configuration({ apiKey: settingsOrApiKey, serverUrl: serverUrl }); - this.updateSettingsTimer(5000); - this.config.onChanged(function (config) { return _this.updateSettingsTimer(_this._timeoutId > 0 ? 5000 : 0); }); - this.config.queue.onEventsPosted(function (events, response) { return _this.updateSettingsTimer(); }); - } - ExceptionlessClient.prototype.createException = function (exception) { - var pluginContextData = new ContextData(); - pluginContextData.setException(exception); - return this.createEvent(pluginContextData).setType('error'); - }; - ExceptionlessClient.prototype.submitException = function (exception, callback) { - this.createException(exception).submit(callback); - }; - ExceptionlessClient.prototype.createUnhandledException = function (exception, submissionMethod) { - var builder = this.createException(exception); - builder.pluginContextData.markAsUnhandledError(); - builder.pluginContextData.setSubmissionMethod(submissionMethod); - return builder; - }; - ExceptionlessClient.prototype.submitUnhandledException = function (exception, submissionMethod, callback) { - this.createUnhandledException(exception, submissionMethod).submit(callback); - }; - ExceptionlessClient.prototype.createFeatureUsage = function (feature) { - return this.createEvent().setType('usage').setSource(feature); - }; - ExceptionlessClient.prototype.submitFeatureUsage = function (feature, callback) { - this.createFeatureUsage(feature).submit(callback); - }; - ExceptionlessClient.prototype.createLog = function (sourceOrMessage, message, level) { - var builder = this.createEvent().setType('log'); - if (level) { - builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty('@level', level); - } - else if (message) { - builder = builder.setSource(sourceOrMessage).setMessage(message); - } - else { - builder = builder.setMessage(sourceOrMessage); - try { - var caller = this.createLog.caller; - builder = builder.setSource(caller && caller.caller && caller.caller.name); - } - catch (e) { - this.config.log.trace('Unable to resolve log source: ' + e.message); - } - } - return builder; - }; - ExceptionlessClient.prototype.submitLog = function (sourceOrMessage, message, level, callback) { - this.createLog(sourceOrMessage, message, level).submit(callback); - }; - ExceptionlessClient.prototype.createNotFound = function (resource) { - return this.createEvent().setType('404').setSource(resource); - }; - ExceptionlessClient.prototype.submitNotFound = function (resource, callback) { - this.createNotFound(resource).submit(callback); - }; - ExceptionlessClient.prototype.createSessionStart = function () { - return this.createEvent().setType('session'); - }; - ExceptionlessClient.prototype.submitSessionStart = function (callback) { - this.createSessionStart().submit(callback); - }; - ExceptionlessClient.prototype.submitSessionEnd = function (sessionIdOrUserId) { - if (sessionIdOrUserId) { - this.config.log.info("Submitting session end: " + sessionIdOrUserId); - this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, true, this.config); - } - }; - ExceptionlessClient.prototype.submitSessionHeartbeat = function (sessionIdOrUserId) { - if (sessionIdOrUserId) { - this.config.log.info("Submitting session heartbeat: " + sessionIdOrUserId); - this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, false, this.config); - } - }; - ExceptionlessClient.prototype.createEvent = function (pluginContextData) { - return new EventBuilder({ date: new Date() }, this, pluginContextData); - }; - ExceptionlessClient.prototype.submitEvent = function (event, pluginContextData, callback) { - function cancelled(context) { - if (!!context) { - context.cancelled = true; - } - return !!callback && callback(context); - } - var context = new EventPluginContext(this, event, pluginContextData); - if (!event) { - return cancelled(context); - } - if (!this.config.enabled) { - this.config.log.info('Event submission is currently disabled.'); - return cancelled(context); - } - if (!event.data) { - event.data = {}; - } - if (!event.tags || !event.tags.length) { - event.tags = []; - } - EventPluginManager.run(context, function (ctx) { - var config = ctx.client.config; - var ev = ctx.event; - if (!ctx.cancelled) { - if (!ev.type || ev.type.length === 0) { - ev.type = 'log'; - } - if (!ev.date) { - ev.date = new Date(); - } - config.queue.enqueue(ev); - if (ev.reference_id && ev.reference_id.length > 0) { - ctx.log.info("Setting last reference id '" + ev.reference_id + "'"); - config.lastReferenceIdManager.setLast(ev.reference_id); - } - } - !!callback && callback(ctx); - }); - }; - ExceptionlessClient.prototype.updateUserEmailAndDescription = function (referenceId, email, description, callback) { - var _this = this; - if (!referenceId || !email || !description || !this.config.enabled) { - return !!callback && callback(new SubmissionResponse(500, 'cancelled')); - } - var userDescription = { email_address: email, description: description }; - this.config.submissionClient.postUserDescription(referenceId, userDescription, this.config, function (response) { - if (!response.success) { - _this.config.log.error("Failed to submit user email and description for event '" + referenceId + "': " + response.statusCode + " " + response.message); - } - !!callback && callback(response); - }); - }; - ExceptionlessClient.prototype.getLastReferenceId = function () { - return this.config.lastReferenceIdManager.getLast(); - }; - ExceptionlessClient.prototype.updateSettingsTimer = function (initialDelay) { - var _this = this; - this.config.log.info("Updating settings timer with delay: " + initialDelay); - this._timeoutId = clearTimeout(this._timeoutId); - this._timeoutId = clearInterval(this._intervalId); - var interval = this.config.updateSettingsWhenIdleInterval; - if (interval > 0) { - var updateSettings = function () { return SettingsManager.updateSettings(_this.config); }; - if (initialDelay > 0) { - this._timeoutId = setTimeout(updateSettings, initialDelay); - } - this._intervalId = setInterval(updateSettings, interval); - } - }; - Object.defineProperty(ExceptionlessClient, "default", { - get: function () { - if (ExceptionlessClient._instance === null) { - ExceptionlessClient._instance = new ExceptionlessClient(null); - } - return ExceptionlessClient._instance; - }, - enumerable: true, - configurable: true - }); - return ExceptionlessClient; -}()); -ExceptionlessClient._instance = null; -exports.ExceptionlessClient = ExceptionlessClient; -var ContextData = (function () { - function ContextData() { - } - ContextData.prototype.setException = function (exception) { - if (exception) { - this['@@_Exception'] = exception; - } - }; - Object.defineProperty(ContextData.prototype, "hasException", { - get: function () { - return !!this['@@_Exception']; - }, - enumerable: true, - configurable: true - }); - ContextData.prototype.getException = function () { - return this['@@_Exception'] || null; - }; - ContextData.prototype.markAsUnhandledError = function () { - this['@@_IsUnhandledError'] = true; - }; - Object.defineProperty(ContextData.prototype, "isUnhandledError", { - get: function () { - return !!this['@@_IsUnhandledError']; - }, - enumerable: true, - configurable: true - }); - ContextData.prototype.setSubmissionMethod = function (method) { - if (method) { - this['@@_SubmissionMethod'] = method; - } - }; - ContextData.prototype.getSubmissionMethod = function () { - return this['@@_SubmissionMethod'] || null; - }; - return ContextData; -}()); -exports.ContextData = ContextData; -var Configuration = (function () { - function Configuration(configSettings) { - this.defaultTags = []; - this.defaultData = {}; - this.enabled = true; - this.lastReferenceIdManager = new DefaultLastReferenceIdManager(); - this.settings = {}; - this._serverUrl = 'https://collector.exceptionless.io'; - this._heartbeatServerUrl = 'https://heartbeat.exceptionless.io'; - this._updateSettingsWhenIdleInterval = 120000; - this._dataExclusions = []; - this._userAgentBotPatterns = []; - this._plugins = []; - this._handlers = []; - function inject(fn) { - return typeof fn === 'function' ? fn(this) : fn; - } - configSettings = Utils.merge(Configuration.defaults, configSettings); - this.log = inject(configSettings.log) || new NullLog(); - this.apiKey = configSettings.apiKey; - this.serverUrl = configSettings.serverUrl; - this.heartbeatServerUrl = configSettings.heartbeatServerUrl; - this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval; - this.environmentInfoCollector = inject(configSettings.environmentInfoCollector); - this.errorParser = inject(configSettings.errorParser); - this.lastReferenceIdManager = inject(configSettings.lastReferenceIdManager) || new DefaultLastReferenceIdManager(); - this.moduleCollector = inject(configSettings.moduleCollector); - this.requestInfoCollector = inject(configSettings.requestInfoCollector); - this.submissionBatchSize = inject(configSettings.submissionBatchSize) || 50; - this.submissionAdapter = inject(configSettings.submissionAdapter); - this.submissionClient = inject(configSettings.submissionClient) || new DefaultSubmissionClient(); - this.storage = inject(configSettings.storage) || new InMemoryStorageProvider(); - this.queue = inject(configSettings.queue) || new DefaultEventQueue(this); - SettingsManager.applySavedServerSettings(this); - EventPluginManager.addDefaultPlugins(this); - } - Object.defineProperty(Configuration.prototype, "apiKey", { - get: function () { - return this._apiKey; - }, - set: function (value) { - this._apiKey = value || null; - this.log.info("apiKey: " + this._apiKey); - this.changed(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "isValid", { - get: function () { - return !!this.apiKey && this.apiKey.length >= 10; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "serverUrl", { - get: function () { - return this._serverUrl; - }, - set: function (value) { - if (!!value) { - this._serverUrl = value; - this._heartbeatServerUrl = value; - this.log.info("serverUrl: " + value); - this.changed(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "heartbeatServerUrl", { - get: function () { - return this._heartbeatServerUrl; - }, - set: function (value) { - if (!!value) { - this._heartbeatServerUrl = value; - this.log.info("heartbeatServerUrl: " + value); - this.changed(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "updateSettingsWhenIdleInterval", { - get: function () { - return this._updateSettingsWhenIdleInterval; - }, - set: function (value) { - if (typeof value !== 'number') { - return; - } - if (value <= 0) { - value = -1; - } - else if (value > 0 && value < 15000) { - value = 15000; - } - this._updateSettingsWhenIdleInterval = value; - this.log.info("updateSettingsWhenIdleInterval: " + value); - this.changed(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "dataExclusions", { - get: function () { - var exclusions = this.settings['@@DataExclusions']; - return this._dataExclusions.concat(exclusions && exclusions.split(',') || []); - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.addDataExclusions = function () { - var exclusions = []; - for (var _i = 0; _i < arguments.length; _i++) { - exclusions[_i] = arguments[_i]; - } - this._dataExclusions = Utils.addRange.apply(Utils, [this._dataExclusions].concat(exclusions)); - }; - Object.defineProperty(Configuration.prototype, "userAgentBotPatterns", { - get: function () { - var patterns = this.settings['@@UserAgentBotPatterns']; - return this._userAgentBotPatterns.concat(patterns && patterns.split(',') || []); - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.addUserAgentBotPatterns = function () { - var userAgentBotPatterns = []; - for (var _i = 0; _i < arguments.length; _i++) { - userAgentBotPatterns[_i] = arguments[_i]; - } - this._userAgentBotPatterns = Utils.addRange.apply(Utils, [this._userAgentBotPatterns].concat(userAgentBotPatterns)); - }; - Object.defineProperty(Configuration.prototype, "plugins", { - get: function () { - return this._plugins.sort(function (p1, p2) { - return (p1.priority < p2.priority) ? -1 : (p1.priority > p2.priority) ? 1 : 0; - }); - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.addPlugin = function (pluginOrName, priority, pluginAction) { - var plugin = !!pluginAction ? { name: pluginOrName, priority: priority, run: pluginAction } : pluginOrName; - if (!plugin || !plugin.run) { - this.log.error('Add plugin failed: Run method not defined'); - return; - } - if (!plugin.name) { - plugin.name = Utils.guid(); - } - if (!plugin.priority) { - plugin.priority = 0; - } - var pluginExists = false; - var plugins = this._plugins; - for (var _i = 0, plugins_1 = plugins; _i < plugins_1.length; _i++) { - var p = plugins_1[_i]; - if (p.name === plugin.name) { - pluginExists = true; - break; - } - } - if (!pluginExists) { - plugins.push(plugin); - } - }; - Configuration.prototype.removePlugin = function (pluginOrName) { - var name = typeof pluginOrName === 'string' ? pluginOrName : pluginOrName.name; - if (!name) { - this.log.error('Remove plugin failed: Plugin name not defined'); - return; - } - var plugins = this._plugins; - for (var index = 0; index < plugins.length; index++) { - if (plugins[index].name === name) { - plugins.splice(index, 1); - break; - } - } - }; - Configuration.prototype.setVersion = function (version) { - if (!!version) { - this.defaultData['@version'] = version; - } - }; - Configuration.prototype.setUserIdentity = function (userInfoOrIdentity, name) { - var USER_KEY = '@user'; - var userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name: name }; - var shouldRemove = !userInfo || (!userInfo.identity && !userInfo.name); - if (shouldRemove) { - delete this.defaultData[USER_KEY]; - } - else { - this.defaultData[USER_KEY] = userInfo; - } - this.log.info("user identity: " + (shouldRemove ? 'null' : userInfo.identity)); - }; - Object.defineProperty(Configuration.prototype, "userAgent", { - get: function () { - return 'exceptionless-js/1.5.4'; - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.useSessions = function (sendHeartbeats, heartbeatInterval) { - if (sendHeartbeats === void 0) { sendHeartbeats = true; } - if (heartbeatInterval === void 0) { heartbeatInterval = 30000; } - if (sendHeartbeats) { - this.addPlugin(new HeartbeatPlugin(heartbeatInterval)); - } - }; - Configuration.prototype.useReferenceIds = function () { - this.addPlugin(new ReferenceIdPlugin()); - }; - Configuration.prototype.useLocalStorage = function () { - }; - Configuration.prototype.useDebugLogger = function () { - this.log = new ConsoleLog(); - }; - Configuration.prototype.onChanged = function (handler) { - !!handler && this._handlers.push(handler); - }; - Configuration.prototype.changed = function () { - var handlers = this._handlers; - for (var _i = 0, handlers_3 = handlers; _i < handlers_3.length; _i++) { - var handler = handlers_3[_i]; - try { - handler(this); - } - catch (ex) { - this.log.error("Error calling onChanged handler: " + ex); - } - } - }; - Object.defineProperty(Configuration, "defaults", { - get: function () { - if (Configuration._defaultSettings === null) { - Configuration._defaultSettings = {}; - } - return Configuration._defaultSettings; - }, - enumerable: true, - configurable: true - }); - return Configuration; -}()); -Configuration._defaultSettings = null; -exports.Configuration = Configuration; -var SettingsResponse = (function () { - function SettingsResponse(success, settings, settingsVersion, exception, message) { - if (settingsVersion === void 0) { settingsVersion = -1; } - if (exception === void 0) { exception = null; } - if (message === void 0) { message = null; } - this.success = false; - this.settingsVersion = -1; - this.success = success; - this.settings = settings; - this.settingsVersion = settingsVersion; - this.exception = exception; - this.message = message; - } - return SettingsResponse; -}()); -exports.SettingsResponse = SettingsResponse; -var EventBuilder = (function () { - function EventBuilder(event, client, pluginContextData) { - this._validIdentifierErrorMessage = 'must contain between 8 and 100 alphanumeric or \'-\' characters.'; - this.target = event; - this.client = client; - this.pluginContextData = pluginContextData || new ContextData(); - } - EventBuilder.prototype.setType = function (type) { - if (!!type) { - this.target.type = type; - } - return this; - }; - EventBuilder.prototype.setSource = function (source) { - if (!!source) { - this.target.source = source; - } - return this; - }; - EventBuilder.prototype.setReferenceId = function (referenceId) { - if (!this.isValidIdentifier(referenceId)) { - throw new Error("ReferenceId " + this._validIdentifierErrorMessage); - } - this.target.reference_id = referenceId; - return this; - }; - EventBuilder.prototype.setEventReference = function (name, id) { - if (!name) { - throw new Error('Invalid name'); - } - if (!id || !this.isValidIdentifier(id)) { - throw new Error("Id " + this._validIdentifierErrorMessage); - } - this.setProperty('@ref:' + name, id); - return this; - }; - EventBuilder.prototype.setMessage = function (message) { - if (!!message) { - this.target.message = message; - } - return this; - }; - EventBuilder.prototype.setGeo = function (latitude, longitude) { - if (latitude < -90.0 || latitude > 90.0) { - throw new Error('Must be a valid latitude value between -90.0 and 90.0.'); - } - if (longitude < -180.0 || longitude > 180.0) { - throw new Error('Must be a valid longitude value between -180.0 and 180.0.'); - } - this.target.geo = latitude + "," + longitude; - return this; - }; - EventBuilder.prototype.setUserIdentity = function (userInfoOrIdentity, name) { - var userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name: name }; - if (!userInfo || (!userInfo.identity && !userInfo.name)) { - return this; - } - this.setProperty('@user', userInfo); - return this; - }; - EventBuilder.prototype.setUserDescription = function (emailAddress, description) { - if (emailAddress && description) { - this.setProperty('@user_description', { email_address: emailAddress, description: description }); - } - return this; - }; - EventBuilder.prototype.setManualStackingInfo = function (signatureData, title) { - if (signatureData) { - var stack = { signature_data: signatureData }; - if (title) { - stack.title = title; - } - this.setProperty('@stack', stack); - } - return this; - }; - EventBuilder.prototype.setManualStackingKey = function (manualStackingKey, title) { - if (manualStackingKey) { - var data = { ManualStackingKey: manualStackingKey }; - this.setManualStackingInfo(data, title); - } - return this; - }; - EventBuilder.prototype.setValue = function (value) { - if (!!value) { - this.target.value = value; - } - return this; - }; - EventBuilder.prototype.addTags = function () { - var tags = []; - for (var _i = 0; _i < arguments.length; _i++) { - tags[_i] = arguments[_i]; - } - this.target.tags = Utils.addRange.apply(Utils, [this.target.tags].concat(tags)); - return this; - }; - EventBuilder.prototype.setProperty = function (name, value, maxDepth, excludedPropertyNames) { - if (!name || (value === undefined || value == null)) { - return this; - } - if (!this.target.data) { - this.target.data = {}; - } - var result = JSON.parse(Utils.stringify(value, this.client.config.dataExclusions.concat(excludedPropertyNames || []), maxDepth)); - if (!Utils.isEmpty(result)) { - this.target.data[name] = result; - } - return this; - }; - EventBuilder.prototype.markAsCritical = function (critical) { - if (critical) { - this.addTags('Critical'); - } - return this; - }; - EventBuilder.prototype.addRequestInfo = function (request) { - if (!!request) { - this.pluginContextData['@request'] = request; - } - return this; - }; - EventBuilder.prototype.submit = function (callback) { - this.client.submitEvent(this.target, this.pluginContextData, callback); - }; - EventBuilder.prototype.isValidIdentifier = function (value) { - if (!value) { - return true; - } - if (value.length < 8 || value.length > 100) { - return false; - } - for (var index = 0; index < value.length; index++) { - var code = value.charCodeAt(index); - var isDigit = (code >= 48) && (code <= 57); - var isLetter = ((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122)); - var isMinus = code === 45; - if (!(isDigit || isLetter) && !isMinus) { - return false; - } - } - return true; - }; - return EventBuilder; -}()); -exports.EventBuilder = EventBuilder; -var ConfigurationDefaultsPlugin = (function () { - function ConfigurationDefaultsPlugin() { - this.priority = 10; - this.name = 'ConfigurationDefaultsPlugin'; - } - ConfigurationDefaultsPlugin.prototype.run = function (context, next) { - var config = context.client.config; - var defaultTags = config.defaultTags || []; - for (var _i = 0, defaultTags_1 = defaultTags; _i < defaultTags_1.length; _i++) { - var tag = defaultTags_1[_i]; - if (!!tag && context.event.tags.indexOf(tag) < 0) { - context.event.tags.push(tag); - } - } - var defaultData = config.defaultData || {}; - for (var key in defaultData) { - if (!!defaultData[key]) { - var result = JSON.parse(Utils.stringify(defaultData[key], config.dataExclusions)); - if (!Utils.isEmpty(result)) { - context.event.data[key] = result; - } - } - } - next && next(); - }; - return ConfigurationDefaultsPlugin; -}()); -exports.ConfigurationDefaultsPlugin = ConfigurationDefaultsPlugin; -var DuplicateCheckerPlugin = (function () { - function DuplicateCheckerPlugin(getCurrentTime, interval) { - if (getCurrentTime === void 0) { getCurrentTime = function () { return Date.now(); }; } - if (interval === void 0) { interval = 30000; } - var _this = this; - this.priority = 1010; - this.name = 'DuplicateCheckerPlugin'; - this._mergedEvents = []; - this._processedHashcodes = []; - this._getCurrentTime = getCurrentTime; - this._interval = interval; - setInterval(function () { - while (_this._mergedEvents.length > 0) { - _this._mergedEvents.shift().resubmit(); - } - }, interval); - } - DuplicateCheckerPlugin.prototype.run = function (context, next) { - var _this = this; - function getHashCode(error) { - var hashCode = 0; - while (error) { - if (error.message && error.message.length) { - hashCode += (hashCode * 397) ^ Utils.getHashCode(error.message); - } - if (error.stack_trace && error.stack_trace.length) { - hashCode += (hashCode * 397) ^ Utils.getHashCode(JSON.stringify(error.stack_trace)); - } - error = error.inner; - } - return hashCode; - } - var error = context.event.data['@error']; - var hashCode = getHashCode(error); - if (hashCode) { - var count = context.event.count || 1; - var now_1 = this._getCurrentTime(); - var merged = this._mergedEvents.filter(function (s) { return s.hashCode === hashCode; })[0]; - if (merged) { - merged.incrementCount(count); - merged.updateDate(context.event.date); - context.log.info('Ignoring duplicate event with hash: ' + hashCode); - context.cancelled = true; - } - if (!context.cancelled && this._processedHashcodes.some(function (h) { return h.hash === hashCode && h.timestamp >= (now_1 - _this._interval); })) { - context.log.trace('Adding event with hash: ' + hashCode); - this._mergedEvents.push(new MergedEvent(hashCode, context, count)); - context.cancelled = true; - } - if (!context.cancelled) { - context.log.trace('Enqueueing event with hash: ' + hashCode + 'to cache.'); - this._processedHashcodes.push({ hash: hashCode, timestamp: now_1 }); - while (this._processedHashcodes.length > 50) { - this._processedHashcodes.shift(); - } - } - } - next && next(); - }; - return DuplicateCheckerPlugin; -}()); -exports.DuplicateCheckerPlugin = DuplicateCheckerPlugin; -var MergedEvent = (function () { - function MergedEvent(hashCode, context, count) { - this.hashCode = hashCode; - this._context = context; - this._count = count; - } - MergedEvent.prototype.incrementCount = function (count) { - this._count += count; - }; - MergedEvent.prototype.resubmit = function () { - this._context.event.count = this._count; - this._context.client.config.queue.enqueue(this._context.event); - }; - MergedEvent.prototype.updateDate = function (date) { - if (date > this._context.event.date) { - this._context.event.date = date; - } - }; - return MergedEvent; -}()); -var EnvironmentInfoPlugin = (function () { - function EnvironmentInfoPlugin() { - this.priority = 80; - this.name = 'EnvironmentInfoPlugin'; - } - EnvironmentInfoPlugin.prototype.run = function (context, next) { - var ENVIRONMENT_KEY = '@environment'; - var collector = context.client.config.environmentInfoCollector; - if (!context.event.data[ENVIRONMENT_KEY] && collector) { - var environmentInfo = collector.getEnvironmentInfo(context); - if (!!environmentInfo) { - context.event.data[ENVIRONMENT_KEY] = environmentInfo; - } - } - next && next(); - }; - return EnvironmentInfoPlugin; -}()); -exports.EnvironmentInfoPlugin = EnvironmentInfoPlugin; -var ErrorPlugin = (function () { - function ErrorPlugin() { - this.priority = 30; - this.name = 'ErrorPlugin'; - } - ErrorPlugin.prototype.run = function (context, next) { - var ERROR_KEY = '@error'; - var ignoredProperties = [ - 'arguments', - 'column', - 'columnNumber', - 'description', - 'fileName', - 'message', - 'name', - 'number', - 'line', - 'lineNumber', - 'opera#sourceloc', - 'sourceId', - 'sourceURL', - 'stack', - 'stackArray', - 'stacktrace' - ]; - var exception = context.contextData.getException(); - if (!!exception) { - context.event.type = 'error'; - if (!context.event.data[ERROR_KEY]) { - var config = context.client.config; - var parser = config.errorParser; - if (!parser) { - throw new Error('No error parser was defined.'); - } - var result = parser.parse(context, exception); - if (!!result) { - var additionalData = JSON.parse(Utils.stringify(exception, config.dataExclusions.concat(ignoredProperties))); - if (!Utils.isEmpty(additionalData)) { - if (!result.data) { - result.data = {}; - } - result.data['@ext'] = additionalData; - } - context.event.data[ERROR_KEY] = result; - } - } - } - next && next(); - }; - return ErrorPlugin; -}()); -exports.ErrorPlugin = ErrorPlugin; -var EventExclusionPlugin = (function () { - function EventExclusionPlugin() { - this.priority = 45; - this.name = 'EventExclusionPlugin'; - } - EventExclusionPlugin.prototype.run = function (context, next) { - function getLogLevel(level) { - switch ((level || '').toLowerCase().trim()) { - case 'trace': - case 'true': - case '1': - case 'yes': - return 0; - case 'debug': - return 1; - case 'info': - return 2; - case 'warn': - return 3; - case 'error': - return 4; - case 'fatal': - return 5; - case 'off': - case 'false': - case '0': - case 'no': - return 6; - default: - return -1; - } - } - function getMinLogLevel(settings, loggerName) { - if (loggerName === void 0) { loggerName = '*'; } - return getLogLevel(getTypeAndSourceSetting(settings, 'log', loggerName, 'Trace') + ''); - } - function getTypeAndSourceSetting(settings, type, source, defaultValue) { - if (settings === void 0) { settings = {}; } - if (!type) { - return defaultValue; - } - var isLog = type === 'log'; - var sourcePrefix = "@@" + type + ":"; - var value = settings[sourcePrefix + source]; - if (value) { - return !isLog ? Utils.toBoolean(value) : value; - } - for (var key in settings) { - if (Utils.startsWith(key.toLowerCase(), sourcePrefix.toLowerCase()) && Utils.isMatch(source, [key.substring(sourcePrefix.length)])) { - return !isLog ? Utils.toBoolean(settings[key]) : settings[key]; - } - } - return defaultValue; - } - var ev = context.event; - var log = context.log; - var settings = context.client.config.settings; - if (ev.type === 'log') { - var minLogLevel = getMinLogLevel(settings, ev.source); - var logLevel = getLogLevel(ev.data['@level']); - if (logLevel >= 0 && (logLevel > 5 || logLevel < minLogLevel)) { - log.info('Cancelling log event due to minimum log level.'); - context.cancelled = true; - } - } - else if (ev.type === 'error') { - var error = ev.data['@error']; - while (!context.cancelled && error) { - if (getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) { - log.info("Cancelling error from excluded exception type: " + error.type); - context.cancelled = true; - } - error = error.inner; - } - } - else if (getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) { - log.info("Cancelling event from excluded type: " + ev.type + " and source: " + ev.source); - context.cancelled = true; - } - next && next(); - }; - return EventExclusionPlugin; -}()); -exports.EventExclusionPlugin = EventExclusionPlugin; -var ModuleInfoPlugin = (function () { - function ModuleInfoPlugin() { - this.priority = 50; - this.name = 'ModuleInfoPlugin'; - } - ModuleInfoPlugin.prototype.run = function (context, next) { - var ERROR_KEY = '@error'; - var collector = context.client.config.moduleCollector; - if (context.event.data[ERROR_KEY] && !context.event.data['@error'].modules && !!collector) { - var modules = collector.getModules(context); - if (modules && modules.length > 0) { - context.event.data[ERROR_KEY].modules = modules; - } - } - next && next(); - }; - return ModuleInfoPlugin; -}()); -exports.ModuleInfoPlugin = ModuleInfoPlugin; -var RequestInfoPlugin = (function () { - function RequestInfoPlugin() { - this.priority = 70; - this.name = 'RequestInfoPlugin'; - } - RequestInfoPlugin.prototype.run = function (context, next) { - var REQUEST_KEY = '@request'; - var config = context.client.config; - var collector = config.requestInfoCollector; - if (!context.event.data[REQUEST_KEY] && !!collector) { - var requestInfo = collector.getRequestInfo(context); - if (!!requestInfo) { - if (Utils.isMatch(requestInfo.user_agent, config.userAgentBotPatterns)) { - context.log.info('Cancelling event as the request user agent matches a known bot pattern'); - context.cancelled = true; - } - else { - context.event.data[REQUEST_KEY] = requestInfo; - } - } - } - next && next(); - }; - return RequestInfoPlugin; -}()); -exports.RequestInfoPlugin = RequestInfoPlugin; -var SubmissionMethodPlugin = (function () { - function SubmissionMethodPlugin() { - this.priority = 100; - this.name = 'SubmissionMethodPlugin'; - } - SubmissionMethodPlugin.prototype.run = function (context, next) { - var submissionMethod = context.contextData.getSubmissionMethod(); - if (!!submissionMethod) { - context.event.data['@submission_method'] = submissionMethod; - } - next && next(); - }; - return SubmissionMethodPlugin; -}()); -exports.SubmissionMethodPlugin = SubmissionMethodPlugin; -var InMemoryStorage = (function () { - function InMemoryStorage(maxItems) { - this.items = []; - this.lastTimestamp = 0; - this.maxItems = maxItems; - } - InMemoryStorage.prototype.save = function (value) { - if (!value) { - return null; - } - var items = this.items; - var timestamp = Math.max(Date.now(), this.lastTimestamp + 1); - var item = { timestamp: timestamp, value: value }; - if (items.push(item) > this.maxItems) { - items.shift(); - } - this.lastTimestamp = timestamp; - return item.timestamp; - }; - InMemoryStorage.prototype.get = function (limit) { - return this.items.slice(0, limit); - }; - InMemoryStorage.prototype.remove = function (timestamp) { - var items = this.items; - for (var i = 0; i < items.length; i++) { - if (items[i].timestamp === timestamp) { - items.splice(i, 1); - return; - } - } - }; - InMemoryStorage.prototype.clear = function () { - this.items = []; - }; - return InMemoryStorage; -}()); -exports.InMemoryStorage = InMemoryStorage; -var KeyValueStorageBase = (function () { - function KeyValueStorageBase(maxItems) { - this.lastTimestamp = 0; - this.maxItems = maxItems; - } - KeyValueStorageBase.prototype.save = function (value, single) { - if (!value) { - return null; - } - this.ensureIndex(); - var items = this.items; - var timestamp = Math.max(Date.now(), this.lastTimestamp + 1); - var key = this.getKey(timestamp); - var json = JSON.stringify(value); - try { - this.write(key, json); - this.lastTimestamp = timestamp; - if (items.push(timestamp) > this.maxItems) { - this.delete(this.getKey(items.shift())); - } - } - catch (e) { - return null; - } - return timestamp; - }; - KeyValueStorageBase.prototype.get = function (limit) { - var _this = this; - this.ensureIndex(); - return this.items.slice(0, limit) - .map(function (timestamp) { - var key = _this.getKey(timestamp); - try { - var json = _this.read(key); - var value = JSON.parse(json, parseDate); - return { timestamp: timestamp, value: value }; - } - catch (error) { - _this.safeDelete(key); - return null; - } - }) - .filter(function (item) { return item != null; }); - }; - KeyValueStorageBase.prototype.remove = function (timestamp) { - this.ensureIndex(); - var items = this.items; - var index = items.indexOf(timestamp); - if (index >= 0) { - var key = this.getKey(timestamp); - this.safeDelete(key); - items.splice(index, 1); - } - }; - KeyValueStorageBase.prototype.clear = function () { - var _this = this; - this.items.forEach(function (item) { return _this.safeDelete(_this.getKey(item)); }); - this.items = []; - }; - KeyValueStorageBase.prototype.ensureIndex = function () { - if (!this.items) { - this.items = this.createIndex(); - this.lastTimestamp = Math.max.apply(Math, [0].concat(this.items)) + 1; - } - }; - KeyValueStorageBase.prototype.safeDelete = function (key) { - try { - this.delete(key); - } - catch (error) { - } - }; - KeyValueStorageBase.prototype.createIndex = function () { - var _this = this; - try { - var keys = this.readAllKeys(); - return keys.map(function (key) { - try { - var timestamp = _this.getTimestamp(key); - if (!timestamp) { - _this.safeDelete(key); - return null; - } - return timestamp; - } - catch (error) { - _this.safeDelete(key); - return null; - } - }).filter(function (timestamp) { return timestamp != null; }) - .sort(function (a, b) { return a - b; }); - } - catch (error) { - return []; - } - }; - return KeyValueStorageBase; -}()); -exports.KeyValueStorageBase = KeyValueStorageBase; -function parseDate(key, value) { - var dateRegx = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/g; - if (typeof value === 'string') { - var a = dateRegx.exec(value); - if (a) { - return new Date(value); - } - } - return value; -} -var BrowserStorage = (function (_super) { - __extends(BrowserStorage, _super); - function BrowserStorage(namespace, prefix, maxItems) { - if (prefix === void 0) { prefix = 'com.exceptionless.'; } - if (maxItems === void 0) { maxItems = 20; } - var _this = _super.call(this, maxItems) || this; - _this.prefix = prefix + namespace + '-'; - return _this; - } - BrowserStorage.isAvailable = function () { - try { - var storage = window.localStorage; - var x = '__storage_test__'; - storage.setItem(x, x); - storage.removeItem(x); - return true; - } - catch (e) { - return false; - } - }; - BrowserStorage.prototype.write = function (key, value) { - window.localStorage.setItem(key, value); - }; - BrowserStorage.prototype.read = function (key) { - return window.localStorage.getItem(key); - }; - BrowserStorage.prototype.readAllKeys = function () { - var _this = this; - return Object.keys(window.localStorage) - .filter(function (key) { return key.indexOf(_this.prefix) === 0; }); - }; - BrowserStorage.prototype.delete = function (key) { - window.localStorage.removeItem(key); - }; - BrowserStorage.prototype.getKey = function (timestamp) { - return this.prefix + timestamp; - }; - BrowserStorage.prototype.getTimestamp = function (key) { - return parseInt(key.substr(this.prefix.length), 10); - }; - return BrowserStorage; -}(KeyValueStorageBase)); -exports.BrowserStorage = BrowserStorage; -var DefaultErrorParser = (function () { - function DefaultErrorParser() { - } - DefaultErrorParser.prototype.parse = function (context, exception) { - function getParameters(parameters) { - var params = (typeof parameters === 'string' ? [parameters] : parameters) || []; - var result = []; - for (var _i = 0, params_1 = params; _i < params_1.length; _i++) { - var param = params_1[_i]; - result.push({ name: param }); - } - return result; - } - function getStackFrames(stackFrames) { - var ANONYMOUS = '<anonymous>'; - var frames = []; - for (var _i = 0, stackFrames_1 = stackFrames; _i < stackFrames_1.length; _i++) { - var frame = stackFrames_1[_i]; - frames.push({ - name: (frame.func || ANONYMOUS).replace('?', ANONYMOUS), - parameters: getParameters(frame.args), - file_name: frame.url, - line_number: frame.line || 0, - column: frame.column || 0 - }); - } - return frames; - } - var TRACEKIT_STACK_TRACE_KEY = '@@_TraceKit.StackTrace'; - var stackTrace = !!context.contextData[TRACEKIT_STACK_TRACE_KEY] - ? context.contextData[TRACEKIT_STACK_TRACE_KEY] - : TraceKit.computeStackTrace(exception, 25); - if (!stackTrace) { - throw new Error('Unable to parse the exceptions stack trace.'); - } - var message = typeof (exception) === 'string' ? exception : undefined; - return { - type: stackTrace.name || 'Error', - message: stackTrace.message || exception.message || message, - stack_trace: getStackFrames(stackTrace.stack || []) - }; - }; - return DefaultErrorParser; -}()); -exports.DefaultErrorParser = DefaultErrorParser; -var DefaultModuleCollector = (function () { - function DefaultModuleCollector() { - } - DefaultModuleCollector.prototype.getModules = function (context) { - if (!document || !document.getElementsByTagName) { - return null; - } - var modules = []; - var scripts = document.getElementsByTagName('script'); - if (scripts && scripts.length > 0) { - for (var index = 0; index < scripts.length; index++) { - if (scripts[index].src) { - modules.push({ - module_id: index, - name: scripts[index].src.split('?')[0], - version: Utils.parseVersion(scripts[index].src) - }); - } - else if (!!scripts[index].innerHTML) { - modules.push({ - module_id: index, - name: 'Script Tag', - version: Utils.getHashCode(scripts[index].innerHTML).toString() - }); - } - } - } - return modules; - }; - return DefaultModuleCollector; -}()); -exports.DefaultModuleCollector = DefaultModuleCollector; -var DefaultRequestInfoCollector = (function () { - function DefaultRequestInfoCollector() { - } - DefaultRequestInfoCollector.prototype.getRequestInfo = function (context) { - if (!document || !navigator || !location) { - return null; - } - var exclusions = context.client.config.dataExclusions; - var requestInfo = { - user_agent: navigator.userAgent, - is_secure: location.protocol === 'https:', - host: location.hostname, - port: location.port && location.port !== '' ? parseInt(location.port, 10) : 80, - path: location.pathname, - cookies: Utils.getCookies(document.cookie, exclusions), - query_string: Utils.parseQueryString(location.search.substring(1), exclusions) - }; - if (document.referrer && document.referrer !== '') { - requestInfo.referrer = document.referrer; - } - return requestInfo; - }; - return DefaultRequestInfoCollector; -}()); -exports.DefaultRequestInfoCollector = DefaultRequestInfoCollector; -var BrowserStorageProvider = (function () { - function BrowserStorageProvider(prefix, maxQueueItems) { - if (maxQueueItems === void 0) { maxQueueItems = 250; } - this.queue = new BrowserStorage('q', prefix, maxQueueItems); - this.settings = new BrowserStorage('settings', prefix, 1); - } - return BrowserStorageProvider; -}()); -exports.BrowserStorageProvider = BrowserStorageProvider; -var DefaultSubmissionAdapter = (function () { - function DefaultSubmissionAdapter() { - } - DefaultSubmissionAdapter.prototype.sendRequest = function (request, callback, isAppExiting) { - var TIMEOUT = 'timeout'; - var LOADED = 'loaded'; - var WITH_CREDENTIALS = 'withCredentials'; - var isCompleted = false; - var useSetTimeout = false; - function complete(mode, xhr) { - function parseResponseHeaders(headerStr) { - function trim(value) { - return value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); - } - var headers = {}; - var headerPairs = (headerStr || '').split('\u000d\u000a'); - for (var _i = 0, headerPairs_1 = headerPairs; _i < headerPairs_1.length; _i++) { - var headerPair = headerPairs_1[_i]; - var separator = headerPair.indexOf('\u003a\u0020'); - if (separator > 0) { - headers[trim(headerPair.substring(0, separator).toLowerCase())] = headerPair.substring(separator + 2); - } - } - return headers; - } - if (isCompleted) { - return; - } - isCompleted = true; - var message = xhr.statusText; - var responseText = xhr.responseText; - var status = xhr.status; - if (mode === TIMEOUT || status === 0) { - message = 'Unable to connect to server.'; - status = 0; - } - else if (mode === LOADED && !status) { - status = request.method === 'POST' ? 202 : 200; - } - else if (status < 200 || status > 299) { - var responseBody = xhr.responseBody; - if (!!responseBody && !!responseBody.message) { - message = responseBody.message; - } - else if (!!responseText && responseText.indexOf('message') !== -1) { - try { - message = JSON.parse(responseText).message; - } - catch (e) { - message = responseText; - } - } - } - callback && callback(status || 500, message || '', responseText, parseResponseHeaders(xhr.getAllResponseHeaders && xhr.getAllResponseHeaders())); - } - function createRequest(userAgent, method, url) { - var xhr = new XMLHttpRequest(); - if (WITH_CREDENTIALS in xhr) { - xhr.open(method, url, true); - xhr.setRequestHeader('X-Exceptionless-Client', userAgent); - if (method === 'POST') { - xhr.setRequestHeader('Content-Type', 'application/json'); - } - } - else if (typeof XDomainRequest !== 'undefined') { - useSetTimeout = true; - xhr = new XDomainRequest(); - xhr.open(method, location.protocol === 'http:' ? url.replace('https:', 'http:') : url); - } - else { - xhr = null; - } - if (xhr) { - xhr.timeout = 10000; - } - return xhr; - } - var url = "" + request.url + (request.url.indexOf('?') === -1 ? '?' : '&') + "access_token=" + encodeURIComponent(request.apiKey); - var xhr = createRequest(request.userAgent, request.method || 'POST', url); - if (!xhr) { - return (callback && callback(503, 'CORS not supported.')); - } - if (WITH_CREDENTIALS in xhr) { - xhr.onreadystatechange = function () { - if (xhr.readyState !== 4) { - return; - } - complete(LOADED, xhr); - }; - } - xhr.onprogress = function () { }; - xhr.ontimeout = function () { return complete(TIMEOUT, xhr); }; - xhr.onerror = function () { return complete('error', xhr); }; - xhr.onload = function () { return complete(LOADED, xhr); }; - if (useSetTimeout) { - setTimeout(function () { return xhr.send(request.data); }, 500); - } - else { - xhr.send(request.data); - } - }; - return DefaultSubmissionAdapter; -}()); -exports.DefaultSubmissionAdapter = DefaultSubmissionAdapter; -(function init() { - function getDefaultsSettingsFromScriptTag() { - if (!document || !document.getElementsByTagName) { - return null; - } - var scripts = document.getElementsByTagName('script'); - for (var index = 0; index < scripts.length; index++) { - if (scripts[index].src && scripts[index].src.indexOf('/exceptionless') > -1) { - return Utils.parseQueryString(scripts[index].src.split('?').pop()); - } - } - return null; - } - function processUnhandledException(stackTrace, options) { - var builder = ExceptionlessClient.default.createUnhandledException(new Error(stackTrace.message || (options || {}).status || 'Script error'), 'onerror'); - builder.pluginContextData['@@_TraceKit.StackTrace'] = stackTrace; - builder.submit(); - } - if (typeof document === 'undefined') { - return; - } - Configuration.prototype.useLocalStorage = function () { - if (BrowserStorage.isAvailable()) { - this.storage = new BrowserStorageProvider(); - SettingsManager.applySavedServerSettings(this); - this.changed(); - } - }; - var defaults = Configuration.defaults; - var settings = getDefaultsSettingsFromScriptTag(); - if (settings && (settings.apiKey || settings.serverUrl)) { - defaults.apiKey = settings.apiKey; - defaults.serverUrl = settings.serverUrl; - } - defaults.errorParser = new DefaultErrorParser(); - defaults.moduleCollector = new DefaultModuleCollector(); - defaults.requestInfoCollector = new DefaultRequestInfoCollector(); - defaults.submissionAdapter = new DefaultSubmissionAdapter(); - TraceKit.report.subscribe(processUnhandledException); - TraceKit.extendToAsynchronousCallbacks(); - Error.stackTraceLimit = Infinity; -})(); - -return exports; - -})); - - -//# sourceMappingURL=exceptionless.js.map diff --git a/dist/exceptionless.js.map b/dist/exceptionless.js.map deleted file mode 100644 index 2e30788e..00000000 --- a/dist/exceptionless.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["tracekit.js","exceptionless.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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ED,QAAQ,CAAC,WAAW,GAAG,IAAI,kBAAkB,EAAE,CAAC;IAChD,QAAQ,CAAC,eAAe,GAAG,IAAI,sBAAsB,EAAE,CAAC;IACxD,QAAQ,CAAC,oBAAoB,GAAG,IAAI,2BAA2B,EAAE,CAAC;IAClE,QAAQ,CAAC,iBAAiB,GAAG,IAAI,wBAAwB,EAAE,CAAC;IAE5D,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;IACrD,QAAQ,CAAC,6BAA6B,EAAE,CAAC;IAUxC,KAAa,CAAC,eAAe,GAAG,QAAQ,CAAC;AAC5C,CAAC,CAAC,EAAE,CAAC","file":"exceptionless.js","sourcesContent":["/**\n * https://github.com/csnover/TraceKit\n * @license MIT\n * @namespace TraceKit\n */\n(function(window, undefined) {\nif (!window) {\n return;\n}\n\nvar TraceKit = {};\nvar _oldTraceKit = window.TraceKit;\n\n// global reference to slice\nvar _slice = [].slice;\nvar UNKNOWN_FUNCTION = '?';\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types\nvar ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;\n\n/**\n * A better form of hasOwnProperty<br/>\n * Example: `_has(MainHostObject, property) === true/false`\n *\n * @param {Object} object to check property\n * @param {string} key to check\n * @return {Boolean} true if the object has the key and it is not inherited\n */\nfunction _has(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\n/**\n * Returns true if the parameter is undefined<br/>\n * Example: `_isUndefined(val) === true/false`\n *\n * @param {*} what Value to check\n * @return {Boolean} true if undefined and false otherwise\n */\nfunction _isUndefined(what) {\n return typeof what === 'undefined';\n}\n\n/**\n * Export TraceKit out to another variable<br/>\n * Example: `var TK = TraceKit.noConflict()`\n * @return {Object} The TraceKit object\n * @memberof TraceKit\n */\nTraceKit.noConflict = function noConflict() {\n window.TraceKit = _oldTraceKit;\n return TraceKit;\n};\n\n/**\n * Wrap any function in a TraceKit reporter<br/>\n * Example: `func = TraceKit.wrap(func);`\n *\n * @param {Function} func Function to be wrapped\n * @return {Function} The wrapped func\n * @memberof TraceKit\n */\nTraceKit.wrap = function traceKitWrapper(func) {\n function wrapped() {\n try {\n return func.apply(this, arguments);\n } catch (e) {\n TraceKit.report(e);\n throw e;\n }\n }\n return wrapped;\n};\n\n/**\n * Cross-browser processing of unhandled exceptions\n *\n * Syntax:\n * ```js\n * TraceKit.report.subscribe(function(stackInfo) { ... })\n * TraceKit.report.unsubscribe(function(stackInfo) { ... })\n * TraceKit.report(exception)\n * try { ...code... } catch(ex) { TraceKit.report(ex); }\n * ```\n *\n * Supports:\n * - Firefox: full stack trace with line numbers, plus column number\n * on top frame; column number is not guaranteed\n * - Opera: full stack trace with line and column numbers\n * - Chrome: full stack trace with line and column numbers\n * - Safari: line and column number for the top frame only; some frames\n * may be missing, and column number is not guaranteed\n * - IE: line and column number for the top frame only; some frames\n * may be missing, and column number is not guaranteed\n *\n * In theory, TraceKit should work on all of the following versions:\n * - IE5.5+ (only 8.0 tested)\n * - Firefox 0.9+ (only 3.5+ tested)\n * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require\n * Exceptions Have Stacktrace to be enabled in opera:config)\n * - Safari 3+ (only 4+ tested)\n * - Chrome 1+ (only 5+ tested)\n * - Konqueror 3.5+ (untested)\n *\n * Requires TraceKit.computeStackTrace.\n *\n * Tries to catch all unhandled exceptions and report them to the\n * subscribed handlers. Please note that TraceKit.report will rethrow the\n * exception. This is REQUIRED in order to get a useful stack trace in IE.\n * If the exception does not reach the top of the browser, you will only\n * get a stack trace from the point where TraceKit.report was called.\n *\n * Handlers receive a TraceKit.StackTrace object as described in the\n * TraceKit.computeStackTrace docs.\n *\n * @memberof TraceKit\n * @namespace\n */\nTraceKit.report = (function reportModuleWrapper() {\n var handlers = [],\n lastException = null,\n lastExceptionStack = null;\n\n /**\n * Add a crash handler.\n * @param {Function} handler\n * @memberof TraceKit.report\n */\n function subscribe(handler) {\n installGlobalHandler();\n handlers.push(handler);\n }\n\n /**\n * Remove a crash handler.\n * @param {Function} handler\n * @memberof TraceKit.report\n */\n function unsubscribe(handler) {\n for (var i = handlers.length - 1; i >= 0; --i) {\n if (handlers[i] === handler) {\n handlers.splice(i, 1);\n }\n }\n\n if (handlers.length === 0) {\n window.onerror = _oldOnerrorHandler;\n _onErrorHandlerInstalled = false;\n }\n }\n\n /**\n * Dispatch stack information to all handlers.\n * @param {TraceKit.StackTrace} stack\n * @param {boolean} isWindowError Is this a top-level window error?\n * @param {Error=} error The error that's being handled (if available, null otherwise)\n * @memberof TraceKit.report\n * @throws An exception if an error occurs while calling an handler.\n */\n function notifyHandlers(stack, isWindowError, error) {\n var exception = null;\n if (isWindowError && !TraceKit.collectWindowErrors) {\n return;\n }\n for (var i in handlers) {\n if (_has(handlers, i)) {\n try {\n handlers[i](stack, isWindowError, error);\n } catch (inner) {\n exception = inner;\n }\n }\n }\n\n if (exception) {\n throw exception;\n }\n }\n\n var _oldOnerrorHandler, _onErrorHandlerInstalled;\n\n /**\n * Ensures all global unhandled exceptions are recorded.\n * Supported by Gecko and IE.\n * @param {string} message Error message.\n * @param {string} url URL of script that generated the exception.\n * @param {(number|string)} lineNo The line number at which the error occurred.\n * @param {(number|string)=} columnNo The column number at which the error occurred.\n * @param {Error=} errorObj The actual Error object.\n * @memberof TraceKit.report\n */\n function traceKitWindowOnError(message, url, lineNo, columnNo, errorObj) {\n var stack = null;\n\n if (lastExceptionStack) {\n TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);\n \t processLastException();\n } else if (errorObj) {\n stack = TraceKit.computeStackTrace(errorObj);\n notifyHandlers(stack, true, errorObj);\n } else {\n var location = {\n 'url': url,\n 'line': lineNo,\n 'column': columnNo\n };\n\n var name;\n var msg = message; // must be new var or will modify original `arguments`\n if ({}.toString.call(message) === '[object String]') {\n var groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n msg = groups[2];\n }\n }\n\n location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line);\n location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line);\n stack = {\n 'name': name,\n 'message': msg,\n 'mode': 'onerror',\n 'stack': [location]\n };\n\n notifyHandlers(stack, true, null);\n }\n\n if (_oldOnerrorHandler) {\n return _oldOnerrorHandler.apply(this, arguments);\n }\n\n return false;\n }\n\n /**\n * Install a global onerror handler\n * @memberof TraceKit.report\n */\n function installGlobalHandler() {\n if (_onErrorHandlerInstalled === true) {\n return;\n }\n\n _oldOnerrorHandler = window.onerror;\n window.onerror = traceKitWindowOnError;\n _onErrorHandlerInstalled = true;\n }\n\n /**\n * Process the most recent exception\n * @memberof TraceKit.report\n */\n function processLastException() {\n var _lastExceptionStack = lastExceptionStack,\n _lastException = lastException;\n lastExceptionStack = null;\n lastException = null;\n notifyHandlers(_lastExceptionStack, false, _lastException);\n }\n\n /**\n * Reports an unhandled Error to TraceKit.\n * @param {Error} ex\n * @memberof TraceKit.report\n * @throws An exception if an incomplete stack trace is detected (old IE browsers).\n */\n function report(ex) {\n if (lastExceptionStack) {\n if (lastException === ex) {\n return; // already caught by an inner catch block, ignore\n } else {\n processLastException();\n }\n }\n\n var stack = TraceKit.computeStackTrace(ex);\n lastExceptionStack = stack;\n lastException = ex;\n\n // If the stack trace is incomplete, wait for 2 seconds for\n // slow slow IE to see if onerror occurs or not before reporting\n // this exception; otherwise, we will end up with an incomplete\n // stack trace\n setTimeout(function () {\n if (lastException === ex) {\n processLastException();\n }\n }, (stack.incomplete ? 2000 : 0));\n\n throw ex; // re-throw to propagate to the top level (and cause window.onerror)\n }\n\n report.subscribe = subscribe;\n report.unsubscribe = unsubscribe;\n return report;\n}());\n\n/**\n * An object representing a single stack frame.\n * @typedef {Object} StackFrame\n * @property {string} url The JavaScript or HTML file URL.\n * @property {string} func The function name, or empty for anonymous functions (if guessing did not work).\n * @property {string[]?} args The arguments passed to the function, if known.\n * @property {number=} line The line number, if known.\n * @property {number=} column The column number, if known.\n * @property {string[]} context An array of source code lines; the middle element corresponds to the correct line#.\n * @memberof TraceKit\n */\n\n/**\n * An object representing a JavaScript stack trace.\n * @typedef {Object} StackTrace\n * @property {string} name The name of the thrown exception.\n * @property {string} message The exception error message.\n * @property {TraceKit.StackFrame[]} stack An array of stack frames.\n * @property {string} mode 'stack', 'stacktrace', 'multiline', 'callers', 'onerror', or 'failed' -- method used to collect the stack trace.\n * @memberof TraceKit\n */\n\n/**\n * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript\n *\n * Syntax:\n * ```js\n * s = TraceKit.computeStackTrace.ofCaller([depth])\n * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)\n * ```\n *\n * Supports:\n * - Firefox: full stack trace with line numbers and unreliable column\n * number on top frame\n * - Opera 10: full stack trace with line and column numbers\n * - Opera 9-: full stack trace with line numbers\n * - Chrome: full stack trace with line and column numbers\n * - Safari: line and column number for the topmost stacktrace element\n * only\n * - IE: no line numbers whatsoever\n *\n * Tries to guess names of anonymous functions by looking for assignments\n * in the source code. In IE and Safari, we have to guess source file names\n * by searching for function bodies inside all page scripts. This will not\n * work for scripts that are loaded cross-domain.\n * Here be dragons: some function names may be guessed incorrectly, and\n * duplicate functions may be mismatched.\n *\n * TraceKit.computeStackTrace should only be used for tracing purposes.\n * Logging of unhandled exceptions should be done with TraceKit.report,\n * which builds on top of TraceKit.computeStackTrace and provides better\n * IE support by utilizing the window.onerror event to retrieve information\n * about the top of the stack.\n *\n * Note: In IE and Safari, no stack trace is recorded on the Error object,\n * so computeStackTrace instead walks its *own* chain of callers.\n * This means that:\n * * in Safari, some methods may be missing from the stack trace;\n * * in IE, the topmost function in the stack trace will always be the\n * caller of computeStackTrace.\n *\n * This is okay for tracing (because you are likely to be calling\n * computeStackTrace from the function you want to be the topmost element\n * of the stack trace anyway), but not okay for logging unhandled\n * exceptions (because your catch block will likely be far away from the\n * inner function that actually caused the exception).\n *\n * Tracing example:\n * ```js\n * function trace(message) {\n * var stackInfo = TraceKit.computeStackTrace.ofCaller();\n * var data = message + \"\\n\";\n * for(var i in stackInfo.stack) {\n * var item = stackInfo.stack[i];\n * data += (item.func || '[anonymous]') + \"() in \" + item.url + \":\" + (item.line || '0') + \"\\n\";\n * }\n * if (window.console)\n * console.info(data);\n * else\n * alert(data);\n * }\n * ```\n * @memberof TraceKit\n * @namespace\n */\nTraceKit.computeStackTrace = (function computeStackTraceWrapper() {\n var debug = false,\n sourceCache = {};\n\n /**\n * Attempts to retrieve source code via XMLHttpRequest, which is used\n * to look up anonymous function names.\n * @param {string} url URL of source code.\n * @return {string} Source contents.\n * @memberof TraceKit.computeStackTrace\n */\n function loadSource(url) {\n if (!TraceKit.remoteFetching) { //Only attempt request if remoteFetching is on.\n return '';\n }\n try {\n var getXHR = function() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {\n // explicitly bubble up the exception if not found\n return new window.ActiveXObject('Microsoft.XMLHTTP');\n }\n };\n\n var request = getXHR();\n request.open('GET', url, false);\n request.send('');\n return request.responseText;\n } catch (e) {\n return '';\n }\n }\n\n /**\n * Retrieves source code from the source code cache.\n * @param {string} url URL of source code.\n * @return {Array.<string>} Source contents.\n * @memberof TraceKit.computeStackTrace\n */\n function getSource(url) {\n if (typeof url !== 'string') {\n return [];\n }\n\n if (!_has(sourceCache, url)) {\n // URL needs to be able to fetched within the acceptable domain. Otherwise,\n // cross-domain errors will be triggered.\n /*\n Regex matches:\n 0 - Full Url\n 1 - Protocol\n 2 - Domain\n 3 - Port (Useful for internal applications)\n 4 - Path\n */\n var source = '';\n var domain = '';\n try { domain = window.document.domain; } catch (e) { }\n var match = /(.*)\\:\\/\\/([^:\\/]+)([:\\d]*)\\/{0,1}([\\s\\S]*)/.exec(url);\n if (match && match[2] === domain) {\n source = loadSource(url);\n }\n sourceCache[url] = source ? source.split('\\n') : [];\n }\n\n return sourceCache[url];\n }\n\n /**\n * Tries to use an externally loaded copy of source code to determine\n * the name of a function by looking at the name of the variable it was\n * assigned to, if any.\n * @param {string} url URL of source code.\n * @param {(string|number)} lineNo Line number in source code.\n * @return {string} The function name, if discoverable.\n * @memberof TraceKit.computeStackTrace\n */\n function guessFunctionName(url, lineNo) {\n var reFunctionArgNames = /function ([^(]*)\\(([^)]*)\\)/,\n reGuessFunction = /['\"]?([0-9A-Za-z$_]+)['\"]?\\s*[:=]\\s*(function|eval|new Function)/,\n line = '',\n maxLines = 10,\n source = getSource(url),\n m;\n\n if (!source.length) {\n return UNKNOWN_FUNCTION;\n }\n\n // Walk backwards from the first line in the function until we find the line which\n // matches the pattern above, which is the function definition\n for (var i = 0; i < maxLines; ++i) {\n line = source[lineNo - i] + line;\n\n if (!_isUndefined(line)) {\n if ((m = reGuessFunction.exec(line))) {\n return m[1];\n } else if ((m = reFunctionArgNames.exec(line))) {\n return m[1];\n }\n }\n }\n\n return UNKNOWN_FUNCTION;\n }\n\n /**\n * Retrieves the surrounding lines from where an exception occurred.\n * @param {string} url URL of source code.\n * @param {(string|number)} line Line number in source code to center around for context.\n * @return {?Array.<string>} Lines of source code.\n * @memberof TraceKit.computeStackTrace\n */\n function gatherContext(url, line) {\n var source = getSource(url);\n\n if (!source.length) {\n return null;\n }\n\n var context = [],\n // linesBefore & linesAfter are inclusive with the offending line.\n // if linesOfContext is even, there will be one extra line\n // *before* the offending line.\n linesBefore = Math.floor(TraceKit.linesOfContext / 2),\n // Add one extra line if linesOfContext is odd\n linesAfter = linesBefore + (TraceKit.linesOfContext % 2),\n start = Math.max(0, line - linesBefore - 1),\n end = Math.min(source.length, line + linesAfter - 1);\n\n line -= 1; // convert to 0-based index\n\n for (var i = start; i < end; ++i) {\n if (!_isUndefined(source[i])) {\n context.push(source[i]);\n }\n }\n\n return context.length > 0 ? context : null;\n }\n\n /**\n * Escapes special characters, except for whitespace, in a string to be\n * used inside a regular expression as a string literal.\n * @param {string} text The string.\n * @return {string} The escaped string literal.\n * @memberof TraceKit.computeStackTrace\n */\n function escapeRegExp(text) {\n return text.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#]/g, '\\\\$&');\n }\n\n /**\n * Escapes special characters in a string to be used inside a regular\n * expression as a string literal. Also ensures that HTML entities will\n * be matched the same as their literal friends.\n * @param {string} body The string.\n * @return {string} The escaped string.\n * @memberof TraceKit.computeStackTrace\n */\n function escapeCodeAsRegExpForMatchingInsideHTML(body) {\n return escapeRegExp(body).replace('<', '(?:<|<)').replace('>', '(?:>|>)').replace('&', '(?:&|&)').replace('\"', '(?:\"|")').replace(/\\s+/g, '\\\\s+');\n }\n\n /**\n * Determines where a code fragment occurs in the source code.\n * @param {RegExp} re The function definition.\n * @param {Array.<string>} urls A list of URLs to search.\n * @return {?Object.<string, (string|number)>} An object containing\n * the url, line, and column number of the defined function.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceInUrls(re, urls) {\n var source, m;\n for (var i = 0, j = urls.length; i < j; ++i) {\n if ((source = getSource(urls[i])).length) {\n source = source.join('\\n');\n if ((m = re.exec(source))) {\n\n return {\n 'url': urls[i],\n 'line': source.substring(0, m.index).split('\\n').length,\n 'column': m.index - source.lastIndexOf('\\n', m.index) - 1\n };\n }\n }\n }\n\n return null;\n }\n\n /**\n * Determines at which column a code fragment occurs on a line of the\n * source code.\n * @param {string} fragment The code fragment.\n * @param {string} url The URL to search.\n * @param {(string|number)} line The line number to examine.\n * @return {?number} The column number.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceInLine(fragment, url, line) {\n var source = getSource(url),\n re = new RegExp('\\\\b' + escapeRegExp(fragment) + '\\\\b'),\n m;\n\n line -= 1;\n\n if (source && source.length > line && (m = re.exec(source[line]))) {\n return m.index;\n }\n\n return null;\n }\n\n /**\n * Determines where a function was defined within the source code.\n * @param {(Function|string)} func A function reference or serialized\n * function definition.\n * @return {?Object.<string, (string|number)>} An object containing\n * the url, line, and column number of the defined function.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceByFunctionBody(func) {\n if (_isUndefined(window && window.document)) {\n return;\n }\n\n var urls = [window.location.href],\n scripts = window.document.getElementsByTagName('script'),\n body,\n code = '' + func,\n codeRE = /^function(?:\\s+([\\w$]+))?\\s*\\(([\\w\\s,]*)\\)\\s*\\{\\s*(\\S[\\s\\S]*\\S)\\s*\\}\\s*$/,\n eventRE = /^function on([\\w$]+)\\s*\\(event\\)\\s*\\{\\s*(\\S[\\s\\S]*\\S)\\s*\\}\\s*$/,\n re,\n parts,\n result;\n\n for (var i = 0; i < scripts.length; ++i) {\n var script = scripts[i];\n if (script.src) {\n urls.push(script.src);\n }\n }\n\n if (!(parts = codeRE.exec(code))) {\n re = new RegExp(escapeRegExp(code).replace(/\\s+/g, '\\\\s+'));\n }\n\n // not sure if this is really necessary, but I don’t have a test\n // corpus large enough to confirm that and it was in the original.\n else {\n var name = parts[1] ? '\\\\s+' + parts[1] : '',\n args = parts[2].split(',').join('\\\\s*,\\\\s*');\n\n body = escapeRegExp(parts[3]).replace(/;$/, ';?'); // semicolon is inserted if the function ends with a comment.replace(/\\s+/g, '\\\\s+');\n re = new RegExp('function' + name + '\\\\s*\\\\(\\\\s*' + args + '\\\\s*\\\\)\\\\s*{\\\\s*' + body + '\\\\s*}');\n }\n\n // look for a normal function definition\n if ((result = findSourceInUrls(re, urls))) {\n return result;\n }\n\n // look for an old-school event handler function\n if ((parts = eventRE.exec(code))) {\n var event = parts[1];\n body = escapeCodeAsRegExpForMatchingInsideHTML(parts[2]);\n\n // look for a function defined in HTML as an onXXX handler\n re = new RegExp('on' + event + '=[\\\\\\'\"]\\\\s*' + body + '\\\\s*[\\\\\\'\"]', 'i');\n\n if ((result = findSourceInUrls(re, urls[0]))) {\n return result;\n }\n\n // look for ???\n re = new RegExp(body);\n\n if ((result = findSourceInUrls(re, urls))) {\n return result;\n }\n }\n\n return null;\n }\n\n // Contents of Exception in various browsers.\n //\n // SAFARI:\n // ex.message = Can't find variable: qq\n // ex.line = 59\n // ex.sourceId = 580238192\n // ex.sourceURL = http://...\n // ex.expressionBeginOffset = 96\n // ex.expressionCaretOffset = 98\n // ex.expressionEndOffset = 98\n // ex.name = ReferenceError\n //\n // FIREFOX:\n // ex.message = qq is not defined\n // ex.fileName = http://...\n // ex.lineNumber = 59\n // ex.columnNumber = 69\n // ex.stack = ...stack trace... (see the example below)\n // ex.name = ReferenceError\n //\n // CHROME:\n // ex.message = qq is not defined\n // ex.name = ReferenceError\n // ex.type = not_defined\n // ex.arguments = ['aa']\n // ex.stack = ...stack trace...\n //\n // INTERNET EXPLORER:\n // ex.message = ...\n // ex.name = ReferenceError\n //\n // OPERA:\n // ex.message = ...message... (see the example below)\n // ex.name = ReferenceError\n // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)\n // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'\n\n /**\n * Computes stack trace information from the stack property.\n * Chrome and Gecko use this property.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromStackProp(ex) {\n if (!ex.stack) {\n return null;\n }\n\n var chrome = /^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\/).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i,\n gecko = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i,\n winjs = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i,\n\n // Used to additionally parse URL/line/column from eval frames\n isEval,\n geckoEval = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i,\n chromeEval = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/,\n\n lines = ex.stack.split('\\n'),\n stack = [],\n submatch,\n parts,\n element,\n reference = /^(.*) is undefined$/.exec(ex.message);\n\n for (var i = 0, j = lines.length; i < j; ++i) {\n if ((parts = chrome.exec(lines[i]))) {\n var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n if (isEval && (submatch = chromeEval.exec(parts[2]))) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n parts[3] = submatch[2]; // line\n parts[4] = submatch[3]; // column\n }\n element = {\n 'url': !isNative ? parts[2] : null,\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': isNative ? [parts[2]] : [],\n 'line': parts[3] ? +parts[3] : null,\n 'column': parts[4] ? +parts[4] : null\n };\n } else if ( parts = winjs.exec(lines[i]) ) {\n element = {\n 'url': parts[2],\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': [],\n 'line': +parts[3],\n 'column': parts[4] ? +parts[4] : null\n };\n } else if ((parts = gecko.exec(lines[i]))) {\n isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval && (submatch = geckoEval.exec(parts[3]))) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = null; // no column when eval\n } else if (i === 0 && !parts[5] && !_isUndefined(ex.columnNumber)) {\n // FireFox uses this awesome columnNumber property for its top frame\n // Also note, Firefox's column number is 0-based and everything else expects 1-based,\n // so adding 1\n // NOTE: this hack doesn't work if top-most frame is eval\n stack[0].column = ex.columnNumber + 1;\n }\n element = {\n 'url': parts[3],\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': parts[2] ? parts[2].split(',') : [],\n 'line': parts[4] ? +parts[4] : null,\n 'column': parts[5] ? +parts[5] : null\n };\n } else {\n continue;\n }\n\n if (!element.func && element.line) {\n element.func = guessFunctionName(element.url, element.line);\n }\n\n element.context = element.line ? gatherContext(element.url, element.line) : null;\n stack.push(element);\n }\n\n if (!stack.length) {\n return null;\n }\n\n if (stack[0] && stack[0].line && !stack[0].column && reference) {\n stack[0].column = findSourceInLine(reference[1], stack[0].url, stack[0].line);\n }\n\n return {\n 'mode': 'stack',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n }\n\n /**\n * Computes stack trace information from the stacktrace property.\n * Opera 10+ uses this property.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromStacktraceProp(ex) {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n var stacktrace = ex.stacktrace;\n if (!stacktrace) {\n return;\n }\n\n var opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i,\n opera11Regex = / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^\\)]+))\\((.*)\\))? in (.*):\\s*$/i,\n lines = stacktrace.split('\\n'),\n stack = [],\n parts;\n\n for (var line = 0; line < lines.length; line += 2) {\n var element = null;\n if ((parts = opera10Regex.exec(lines[line]))) {\n element = {\n 'url': parts[2],\n 'line': +parts[1],\n 'column': null,\n 'func': parts[3],\n 'args':[]\n };\n } else if ((parts = opera11Regex.exec(lines[line]))) {\n element = {\n 'url': parts[6],\n 'line': +parts[1],\n 'column': +parts[2],\n 'func': parts[3] || parts[4],\n 'args': parts[5] ? parts[5].split(',') : []\n };\n }\n\n if (element) {\n if (!element.func && element.line) {\n element.func = guessFunctionName(element.url, element.line);\n }\n if (element.line) {\n try {\n element.context = gatherContext(element.url, element.line);\n } catch (exc) {}\n }\n\n if (!element.context) {\n element.context = [lines[line + 1]];\n }\n\n stack.push(element);\n }\n }\n\n if (!stack.length) {\n return null;\n }\n\n return {\n 'mode': 'stacktrace',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n }\n\n /**\n * NOT TESTED.\n * Computes stack trace information from an error message that includes\n * the stack trace.\n * Opera 9 and earlier use this method if the option to show stack\n * traces is turned on in opera:config.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromOperaMultiLineMessage(ex) {\n // TODO: Clean this function up\n // Opera includes a stack trace into the exception message. An example is:\n //\n // Statement on line 3: Undefined variable: undefinedFunc\n // Backtrace:\n // Line 3 of linked script file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.js: In function zzz\n // undefinedFunc(a);\n // Line 7 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function yyy\n // zzz(x, y, z);\n // Line 3 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function xxx\n // yyy(a, a, a);\n // Line 1 of function script\n // try { xxx('hi'); return false; } catch(ex) { TraceKit.report(ex); }\n // ...\n\n var lines = ex.message.split('\\n');\n if (lines.length < 4) {\n return null;\n }\n\n var lineRE1 = /^\\s*Line (\\d+) of linked script ((?:file|https?|blob)\\S+)(?:: in function (\\S+))?\\s*$/i,\n lineRE2 = /^\\s*Line (\\d+) of inline#(\\d+) script in ((?:file|https?|blob)\\S+)(?:: in function (\\S+))?\\s*$/i,\n lineRE3 = /^\\s*Line (\\d+) of function script\\s*$/i,\n stack = [],\n scripts = (window && window.document && window.document.getElementsByTagName('script')),\n inlineScriptBlocks = [],\n parts;\n\n for (var s in scripts) {\n if (_has(scripts, s) && !scripts[s].src) {\n inlineScriptBlocks.push(scripts[s]);\n }\n }\n\n for (var line = 2; line < lines.length; line += 2) {\n var item = null;\n if ((parts = lineRE1.exec(lines[line]))) {\n item = {\n 'url': parts[2],\n 'func': parts[3],\n 'args': [],\n 'line': +parts[1],\n 'column': null\n };\n } else if ((parts = lineRE2.exec(lines[line]))) {\n item = {\n 'url': parts[3],\n 'func': parts[4],\n 'args': [],\n 'line': +parts[1],\n 'column': null // TODO: Check to see if inline#1 (+parts[2]) points to the script number or column number.\n };\n var relativeLine = (+parts[1]); // relative to the start of the <SCRIPT> block\n var script = inlineScriptBlocks[parts[2] - 1];\n if (script) {\n var source = getSource(item.url);\n if (source) {\n source = source.join('\\n');\n var pos = source.indexOf(script.innerText);\n if (pos >= 0) {\n item.line = relativeLine + source.substring(0, pos).split('\\n').length;\n }\n }\n }\n } else if ((parts = lineRE3.exec(lines[line]))) {\n var url = window.location.href.replace(/#.*$/, '');\n var re = new RegExp(escapeCodeAsRegExpForMatchingInsideHTML(lines[line + 1]));\n var src = findSourceInUrls(re, [url]);\n item = {\n 'url': url,\n 'func': '',\n 'args': [],\n 'line': src ? src.line : parts[1],\n 'column': null\n };\n }\n\n if (item) {\n if (!item.func) {\n item.func = guessFunctionName(item.url, item.line);\n }\n var context = gatherContext(item.url, item.line);\n var midline = (context ? context[Math.floor(context.length / 2)] : null);\n if (context && midline.replace(/^\\s*/, '') === lines[line + 1].replace(/^\\s*/, '')) {\n item.context = context;\n } else {\n // if (context) alert(\"Context mismatch. Correct midline:\\n\" + lines[i+1] + \"\\n\\nMidline:\\n\" + midline + \"\\n\\nContext:\\n\" + context.join(\"\\n\") + \"\\n\\nURL:\\n\" + item.url);\n item.context = [lines[line + 1]];\n }\n stack.push(item);\n }\n }\n if (!stack.length) {\n return null; // could not parse multiline exception message as Opera stack trace\n }\n\n return {\n 'mode': 'multiline',\n 'name': ex.name,\n 'message': lines[0],\n 'stack': stack\n };\n }\n\n /**\n * Adds information about the first frame to incomplete stack traces.\n * Safari and IE require this to get complete data on the first frame.\n * @param {TraceKit.StackTrace} stackInfo Stack trace information from\n * one of the compute* methods.\n * @param {string} url The URL of the script that caused an error.\n * @param {(number|string)} lineNo The line number of the script that\n * caused an error.\n * @param {string=} message The error generated by the browser, which\n * hopefully contains the name of the object that caused the error.\n * @return {boolean} Whether or not the stack information was\n * augmented.\n * @memberof TraceKit.computeStackTrace\n */\n function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {\n var initial = {\n 'url': url,\n 'line': lineNo\n };\n\n if (initial.url && initial.line) {\n stackInfo.incomplete = false;\n\n if (!initial.func) {\n initial.func = guessFunctionName(initial.url, initial.line);\n }\n\n if (!initial.context) {\n initial.context = gatherContext(initial.url, initial.line);\n }\n\n var reference = / '([^']+)' /.exec(message);\n if (reference) {\n initial.column = findSourceInLine(reference[1], initial.url, initial.line);\n }\n\n if (stackInfo.stack.length > 0) {\n if (stackInfo.stack[0].url === initial.url) {\n if (stackInfo.stack[0].line === initial.line) {\n return false; // already in stack trace\n } else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) {\n stackInfo.stack[0].line = initial.line;\n stackInfo.stack[0].context = initial.context;\n return false;\n }\n }\n }\n\n stackInfo.stack.unshift(initial);\n stackInfo.partial = true;\n return true;\n } else {\n stackInfo.incomplete = true;\n }\n\n return false;\n }\n\n /**\n * Computes stack trace information by walking the arguments.caller\n * chain at the time the exception occurred. This will cause earlier\n * frames to be missed but is the only way to get any stack trace in\n * Safari and IE. The top frame is restored by\n * {@link augmentStackTraceWithInitialElement}.\n * @param {Error} ex\n * @return {TraceKit.StackTrace=} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceByWalkingCallerChain(ex, depth) {\n var functionName = /function\\s+([_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*)?\\s*\\(/i,\n stack = [],\n funcs = {},\n recursion = false,\n parts,\n item,\n source;\n\n for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) {\n if (curr === computeStackTrace || curr === TraceKit.report) {\n continue;\n }\n\n item = {\n 'url': null,\n 'func': UNKNOWN_FUNCTION,\n 'args': [],\n 'line': null,\n 'column': null\n };\n\n if (curr.name) {\n item.func = curr.name;\n } else if ((parts = functionName.exec(curr.toString()))) {\n item.func = parts[1];\n }\n\n if (typeof item.func === 'undefined') {\n try {\n item.func = parts.input.substring(0, parts.input.indexOf('{'));\n } catch (e) { }\n }\n\n if ((source = findSourceByFunctionBody(curr))) {\n item.url = source.url;\n item.line = source.line;\n\n if (item.func === UNKNOWN_FUNCTION) {\n item.func = guessFunctionName(item.url, item.line);\n }\n\n var reference = / '([^']+)' /.exec(ex.message || ex.description);\n if (reference) {\n item.column = findSourceInLine(reference[1], source.url, source.line);\n }\n }\n\n if (funcs['' + curr]) {\n recursion = true;\n }else{\n funcs['' + curr] = true;\n }\n\n stack.push(item);\n }\n\n if (depth) {\n stack.splice(0, depth);\n }\n\n var result = {\n 'mode': 'callers',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n augmentStackTraceWithInitialElement(result, ex.sourceURL || ex.fileName, ex.line || ex.lineNumber, ex.message || ex.description);\n return result;\n }\n\n /**\n * Computes a stack trace for an exception.\n * @param {Error} ex\n * @param {(string|number)=} depth\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTrace(ex, depth) {\n var stack = null;\n depth = (depth == null ? 0 : +depth);\n\n try {\n // This must be tried first because Opera 10 *destroys*\n // its stacktrace property if you try to access the stack\n // property first!!\n stack = computeStackTraceFromStacktraceProp(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceFromStackProp(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceFromOperaMultiLineMessage(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n return {\n 'name': ex.name,\n 'message': ex.message,\n 'mode': 'failed'\n };\n }\n\n /**\n * Logs a stacktrace starting from the previous call and working down.\n * @param {(number|string)=} depth How many frames deep to trace.\n * @return {TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceOfCaller(depth) {\n depth = (depth == null ? 0 : +depth) + 1; // \"+ 1\" because \"ofCaller\" should drop one frame\n try {\n throw new Error();\n } catch (ex) {\n return computeStackTrace(ex, depth + 1);\n }\n }\n\n computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;\n computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;\n computeStackTrace.guessFunctionName = guessFunctionName;\n computeStackTrace.gatherContext = gatherContext;\n computeStackTrace.ofCaller = computeStackTraceOfCaller;\n computeStackTrace.getSource = getSource;\n\n return computeStackTrace;\n}());\n\n/**\n * Extends support for global error handling for asynchronous browser\n * functions. Adopted from Closure Library's errorhandler.js\n * @memberof TraceKit\n */\nTraceKit.extendToAsynchronousCallbacks = function () {\n var _helper = function _helper(fnName) {\n var originalFn = window[fnName];\n window[fnName] = function traceKitAsyncExtension() {\n // Make a copy of the arguments\n var args = _slice.call(arguments);\n var originalCallback = args[0];\n if (typeof (originalCallback) === 'function') {\n args[0] = TraceKit.wrap(originalCallback);\n }\n // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it\n // also only supports 2 argument and doesn't care what \"this\" is, so we\n // can just call the original function directly.\n if (originalFn.apply) {\n return originalFn.apply(this, args);\n } else {\n return originalFn(args[0], args[1]);\n }\n };\n };\n\n _helper('setTimeout');\n _helper('setInterval');\n};\n\n//Default options:\nif (!TraceKit.remoteFetching) {\n TraceKit.remoteFetching = true;\n}\nif (!TraceKit.collectWindowErrors) {\n TraceKit.collectWindowErrors = true;\n}\nif (!TraceKit.linesOfContext || TraceKit.linesOfContext < 1) {\n // 5 lines before, the offending line, 5 lines after\n TraceKit.linesOfContext = 11;\n}\n\n// UMD export\nif (typeof define === 'function' && define.amd) {\n define('TraceKit', [], TraceKit);\n} else if (typeof module !== 'undefined' && module.exports && window.module !== module) {\n module.exports = TraceKit;\n} else {\n window.TraceKit = TraceKit;\n}\n\n}(typeof window !== 'undefined' ? window : global));\n","import * as TraceKit from 'TraceKit';\nexport interface ILastReferenceIdManager {\n getLast(): string;\n clearLast(): void;\n setLast(eventId: string): void;\n}\n\nexport interface ILog {\n trace(message: string): void;\n info(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n}\n\n \n\nexport class DefaultLastReferenceIdManager implements ILastReferenceIdManager {\n /**\n * Gets the last event's reference id that was submitted to the server.\n * @type {string}\n * @private\n */\n private _lastReferenceId: string = null;\n\n /**\n * Gets the last event's reference id that was submitted to the server.\n * @returns {string}\n */\n public getLast(): string {\n return this._lastReferenceId;\n }\n\n /**\n * Clears the last event's reference id.\n */\n public clearLast(): void {\n this._lastReferenceId = null;\n }\n\n /**\n * Sets the last event's reference id.\n * @param eventId\n */\n public setLast(eventId: string): void {\n this._lastReferenceId = eventId;\n }\n}\n\n \n\nexport class ConsoleLog implements ILog {\n public trace(message: string): void {\n this.log('debug', message);\n }\n\n public info(message: string): void {\n this.log('info', message);\n }\n\n public warn(message: string): void {\n this.log('warn', message);\n }\n\n public error(message: string): void {\n this.log('error', message);\n }\n\n private log(level: string, message: string) {\n if (console) {\n const msg = `[${level}] Exceptionless: ${message}`;\n\n if (console[level]) {\n console[level](msg);\n } else if (console.log) {\n console[`log`](msg);\n }\n }\n }\n}\n\n \n\nexport class NullLog implements ILog {\n public trace(message: string): void { }\n public info(message: string): void { }\n public warn(message: string): void { }\n public error(message: string): void { }\n}\n\nexport interface IUserInfo {\n identity?: string;\n name?: string;\n data?: any;\n}\n\n \n\nexport class HeartbeatPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = 'HeartbeatPlugin';\n\n private _interval: number;\n private _intervalId: any;\n\n constructor(heartbeatInterval: number = 30000) {\n this._interval = heartbeatInterval;\n }\n\n public run(context: EventPluginContext, next?: () => void): void {\n clearInterval(this._intervalId);\n\n const user: IUserInfo = context.event.data['@user'];\n if (user && user.identity) {\n this._intervalId = setInterval(() => context.client.submitSessionHeartbeat(user.identity), this._interval);\n }\n\n next && next();\n }\n}\n\n \n\nexport class ReferenceIdPlugin implements IEventPlugin {\n public priority: number = 20;\n public name: string = 'ReferenceIdPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n if ((!context.event.reference_id || context.event.reference_id.length === 0) && context.event.type === 'error') {\n context.event.reference_id = Utils.guid().replace('-', '').substring(0, 10);\n }\n\n next && next();\n }\n}\n\n \n\nexport class EventPluginContext {\n public cancelled: boolean;\n public client: ExceptionlessClient;\n public event: IEvent;\n public contextData: ContextData;\n\n constructor(client: ExceptionlessClient, event: IEvent, contextData?: ContextData) {\n this.client = client;\n this.event = event;\n this.contextData = contextData ? contextData : new ContextData();\n }\n\n public get log(): ILog {\n return this.client.config.log;\n }\n}\n\n \n\nexport class EventPluginManager {\n public static run(context: EventPluginContext, callback: (context?: EventPluginContext) => void): void {\n const wrap = (plugin: IEventPlugin, next?: () => void): () => void => {\n return () => {\n try {\n if (!context.cancelled) {\n plugin.run(context, next);\n }\n } catch (ex) {\n context.cancelled = true;\n context.log.error(`Error running plugin '${plugin.name}': ${ex.message}. Discarding Event.`);\n }\n\n if (context.cancelled && !!callback) {\n callback(context);\n }\n };\n };\n\n const plugins: IEventPlugin[] = context.client.config.plugins; // optimization for minifier.\n const wrappedPlugins: Array<() => void> = [];\n if (!!callback) {\n wrappedPlugins[plugins.length] = wrap({ name: 'cb', priority: 9007199254740992, run: callback }, null);\n }\n\n for (let index = plugins.length - 1; index > -1; index--) {\n wrappedPlugins[index] = wrap(plugins[index], !!callback || (index < plugins.length - 1) ? wrappedPlugins[index + 1] : null);\n }\n\n wrappedPlugins[0]();\n }\n\n public static addDefaultPlugins(config: Configuration): void {\n config.addPlugin(new ConfigurationDefaultsPlugin());\n config.addPlugin(new ErrorPlugin());\n config.addPlugin(new DuplicateCheckerPlugin());\n config.addPlugin(new EventExclusionPlugin());\n config.addPlugin(new ModuleInfoPlugin());\n config.addPlugin(new RequestInfoPlugin());\n config.addPlugin(new EnvironmentInfoPlugin());\n config.addPlugin(new SubmissionMethodPlugin());\n }\n}\n\n \n\nexport interface IEventPlugin {\n priority?: number;\n name?: string;\n run(context: EventPluginContext, next?: () => void): void;\n}\n\n \n\nexport class DefaultEventQueue implements IEventQueue {\n /**\n * The configuration object.\n * @type {Configuration}\n * @private\n */\n private _config: Configuration;\n\n /**\n * A list of handlers that will be fired when events are submitted.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(events: IEvent[], response: SubmissionResponse) => void> = [];\n\n /**\n * Suspends processing until the specified time.\n * @type {Date}\n * @private\n */\n private _suspendProcessingUntil: Date;\n\n /**\n * Discards queued items until the specified time.\n * @type {Date}\n * @private\n */\n private _discardQueuedItemsUntil: Date;\n\n /**\n * Returns true if the queue is processing.\n * @type {boolean}\n * @private\n */\n private _processingQueue: boolean = false;\n\n /**\n * Processes the queue every xx seconds.\n * @type {Timer}\n * @private\n */\n private _queueTimer: any;\n\n constructor(config: Configuration) {\n this._config = config;\n }\n\n public enqueue(event: IEvent): void {\n const eventWillNotBeQueued: string = 'The event will not be queued.'; // optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (this.areQueuedItemsDiscarded()) {\n log.info(`Queue items are currently being discarded. ${eventWillNotBeQueued}`);\n return;\n }\n\n this.ensureQueueTimer();\n\n const timestamp = config.storage.queue.save(event);\n const logText = `type=${event.type} ${!!event.reference_id ? 'refid=' + event.reference_id : ''}`;\n if (timestamp) {\n log.info(`Enqueuing event: ${timestamp} ${logText}`);\n } else {\n log.error(`Could not enqueue event ${logText}`);\n }\n }\n\n public process(isAppExiting?: boolean): void {\n const queueNotProcessed: string = 'The queue will not be processed.'; // optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (this._processingQueue) {\n return;\n }\n\n log.info('Processing queue...');\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${queueNotProcessed}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${queueNotProcessed}`);\n return;\n }\n\n this._processingQueue = true;\n this.ensureQueueTimer();\n\n try {\n const events = config.storage.queue.get(config.submissionBatchSize);\n if (!events || events.length === 0) {\n this._processingQueue = false;\n return;\n }\n\n log.info(`Sending ${events.length} events to ${config.serverUrl}.`);\n config.submissionClient.postEvents(events.map((e) => e.value), config, (response: SubmissionResponse) => {\n this.processSubmissionResponse(response, events);\n this.eventsPosted(events.map((e) => e.value), response);\n log.info('Finished processing queue.');\n this._processingQueue = false;\n }, isAppExiting);\n } catch (ex) {\n log.error(`Error processing queue: ${ex}`);\n this.suspendProcessing();\n this._processingQueue = false;\n }\n }\n\n public suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void {\n const config: Configuration = this._config; // Optimization for minifier.\n\n if (!durationInMinutes || durationInMinutes <= 0) {\n durationInMinutes = 5;\n }\n\n config.log.info(`Suspending processing for ${durationInMinutes} minutes.`);\n this._suspendProcessingUntil = new Date(new Date().getTime() + (durationInMinutes * 60000));\n\n if (discardFutureQueuedItems) {\n this._discardQueuedItemsUntil = this._suspendProcessingUntil;\n }\n\n if (clearQueue) {\n // Account is over the limit and we want to ensure that the sample size being sent in will contain newer errors.\n config.storage.queue.clear();\n }\n }\n\n public onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void {\n !!handler && this._handlers.push(handler);\n }\n\n private eventsPosted(events: IEvent[], response: SubmissionResponse) {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(events, response);\n } catch (ex) {\n this._config.log.error(`Error calling onEventsPosted handler: ${ex}`);\n }\n }\n }\n\n private areQueuedItemsDiscarded(): boolean {\n return this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date();\n }\n\n private ensureQueueTimer(): void {\n if (!this._queueTimer) {\n this._queueTimer = setInterval(() => this.onProcessQueue(), 10000);\n }\n }\n\n private isQueueProcessingSuspended(): boolean {\n return this._suspendProcessingUntil && this._suspendProcessingUntil > new Date();\n }\n\n private onProcessQueue(): void {\n if (!this.isQueueProcessingSuspended() && !this._processingQueue) {\n this.process();\n }\n }\n\n private processSubmissionResponse(response: SubmissionResponse, events: IStorageItem[]): void {\n const noSubmission: string = 'The event will not be submitted.'; // Optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (response.success) {\n log.info(`Sent ${events.length} events.`);\n this.removeEvents(events);\n return;\n }\n\n if (response.serviceUnavailable) {\n // You are currently over your rate limit or the servers are under stress.\n log.error('Server returned service unavailable.');\n this.suspendProcessing();\n return;\n }\n\n if (response.paymentRequired) {\n // If the organization over the rate limit then discard the event.\n log.info('Too many events have been submitted, please upgrade your plan.');\n this.suspendProcessing(null, true, true);\n return;\n }\n\n if (response.unableToAuthenticate) {\n // The api key was suspended or could not be authorized.\n log.info(`Unable to authenticate, please check your configuration. ${noSubmission}`);\n this.suspendProcessing(15);\n this.removeEvents(events);\n return;\n }\n\n if (response.notFound || response.badRequest) {\n // The service end point could not be found.\n log.error(`Error while trying to submit data: ${response.message}`);\n this.suspendProcessing(60 * 4);\n this.removeEvents(events);\n return;\n }\n\n if (response.requestEntityTooLarge) {\n const message = 'Event submission discarded for being too large.';\n if (config.submissionBatchSize > 1) {\n log.error(`${message} Retrying with smaller batch size.`);\n config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5));\n } else {\n log.error(`${message} ${noSubmission}`);\n this.removeEvents(events);\n }\n\n return;\n }\n\n if (!response.success) {\n log.error(`Error submitting events: ${response.message || 'Please check the network tab for more info.'}`);\n this.suspendProcessing();\n }\n }\n\n private removeEvents(events: IStorageItem[]) {\n for (let index = 0; index < (events || []).length; index++) {\n this._config.storage.queue.remove(events[index].timestamp);\n }\n }\n}\n\n \n\nexport interface IEventQueue {\n enqueue(event: IEvent): void;\n process(isAppExiting?: boolean): void;\n suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void;\n onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void;\n}\n\n \n\nexport interface IEnvironmentInfoCollector {\n getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo;\n}\n\n \n\nexport interface IErrorParser {\n parse(context: EventPluginContext, exception: Error): IError;\n}\n\n \n\nexport interface IModuleCollector {\n getModules(context: EventPluginContext): IModule[];\n}\n\n \n\nexport interface IRequestInfoCollector {\n getRequestInfo(context: EventPluginContext): IRequestInfo;\n}\n\n \n\nexport class InMemoryStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(maxQueueItems: number = 250) {\n this.queue = new InMemoryStorage(maxQueueItems);\n this.settings = new InMemoryStorage(1);\n }\n\n}\n\n \n\nexport interface IStorageProvider {\n queue: IStorage;\n settings: IStorage;\n}\n\n \n\n// tslint:disable-next-line:prefer-const\ndeclare var XDomainRequest: { new (); create(); };\n\nexport class DefaultSubmissionClient implements ISubmissionClient {\n public configurationVersionHeader: string = 'x-exceptionless-configversion';\n\n public postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void {\n const data = JSON.stringify(events);\n const request = this.createRequest(config, 'POST', `${config.serverUrl}/api/v2/events`, data);\n const cb = this.createSubmissionCallback(config, callback);\n\n return config.submissionAdapter.sendRequest(request, cb, isAppExiting);\n }\n\n public postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void {\n const path = `${config.serverUrl}/api/v2/events/by-ref/${encodeURIComponent(referenceId)}/user-description`;\n const data = JSON.stringify(description);\n const request = this.createRequest(config, 'POST', path, data);\n const cb = this.createSubmissionCallback(config, callback);\n\n return config.submissionAdapter.sendRequest(request, cb);\n }\n\n public getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void {\n const request = this.createRequest(config, 'GET', `${config.serverUrl}/api/v2/projects/config?v=${version}`);\n const cb = (status, message, data?, headers?) => {\n if (status !== 200) {\n return callback(new SettingsResponse(false, null, -1, null, message));\n }\n\n let settings: IClientConfiguration;\n try {\n settings = JSON.parse(data);\n } catch (e) {\n config.log.error(`Unable to parse settings: '${data}'`);\n }\n\n if (!settings || isNaN(settings.version)) {\n return callback(new SettingsResponse(false, null, -1, null, 'Invalid configuration settings.'));\n }\n\n callback(new SettingsResponse(true, settings.settings || {}, settings.version));\n };\n\n return config.submissionAdapter.sendRequest(request, cb);\n }\n\n public sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void {\n const request = this.createRequest(config, 'GET', `${config.heartbeatServerUrl}/api/v2/events/session/heartbeat?id=${sessionIdOrUserId}&close=${closeSession}`);\n config.submissionAdapter.sendRequest(request);\n }\n\n private createRequest(config: Configuration, method: string, url: string, data: string = null): SubmissionRequest {\n return {\n method,\n url,\n data,\n apiKey: config.apiKey,\n userAgent: config.userAgent\n };\n }\n\n private createSubmissionCallback(config: Configuration, callback: (response: SubmissionResponse) => void) {\n return (status, message, data?, headers?) => {\n const settingsVersion: number = headers && parseInt(headers[this.configurationVersionHeader], 10);\n SettingsManager.checkVersion(settingsVersion, config);\n\n callback(new SubmissionResponse(status, message));\n };\n }\n}\n\n \n\nexport interface ISubmissionAdapter {\n sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void;\n}\n\n \n\nexport interface ISubmissionClient {\n postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void;\n postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void;\n getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void;\n sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void;\n}\n\nexport class Utils {\n public static addRange<T>(target: T[], ...values: T[]) {\n if (!target) {\n target = [];\n }\n\n if (!values || values.length === 0) {\n return target;\n }\n\n for (const value of values) {\n if (value && target.indexOf(value) < 0) {\n target.push(value);\n }\n }\n\n return target;\n }\n\n public static getHashCode(source: string): number {\n if (!source || source.length === 0) {\n return 0;\n }\n\n let hash: number = 0;\n for (let index = 0; index < source.length; index++) {\n const character = source.charCodeAt(index);\n hash = ((hash << 5) - hash) + character;\n hash |= 0;\n }\n\n return hash;\n }\n\n public static getCookies(cookies: string, exclusions?: string[]): object {\n const result: object = {};\n\n const parts: string[] = (cookies || '').split('; ');\n for (const part of parts) {\n const cookie: string[] = part.split('=');\n if (!Utils.isMatch(cookie[0], exclusions)) {\n result[cookie[0]] = cookie[1];\n }\n }\n\n return !Utils.isEmpty(result) ? result : null;\n }\n\n public static guid(): string {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n }\n\n // tslint:disable-next-line:ban-types\n public static merge(defaultValues: Object, values: Object) {\n const result: object = {};\n\n for (const key in defaultValues || {}) {\n if (!!defaultValues[key]) {\n result[key] = defaultValues[key];\n }\n }\n\n for (const key in values || {}) {\n if (!!values[key]) {\n result[key] = values[key];\n }\n }\n\n return result;\n }\n\n public static parseVersion(source: string): string {\n if (!source) {\n return null;\n }\n\n const versionRegex = /(v?((\\d+)\\.(\\d+)(\\.(\\d+))?)(?:-([\\dA-Za-z\\-]+(?:\\.[\\dA-Za-z\\-]+)*))?(?:\\+([\\dA-Za-z\\-]+(?:\\.[\\dA-Za-z\\-]+)*))?)/;\n const matches = versionRegex.exec(source);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n\n return null;\n }\n\n public static parseQueryString(query: string, exclusions?: string[]) {\n if (!query || query.length === 0) {\n return null;\n }\n\n const pairs: string[] = query.split('&');\n if (pairs.length === 0) {\n return null;\n }\n\n const result: object = {};\n for (const pair of pairs) {\n const parts = pair.split('=');\n if (!Utils.isMatch(parts[0], exclusions)) {\n result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);\n }\n }\n\n return !Utils.isEmpty(result) ? result : null;\n }\n\n public static randomNumber(): number {\n return Math.floor(Math.random() * 9007199254740992);\n }\n\n /**\n * Checks to see if a value matches a pattern.\n * @param input the value to check against the @pattern.\n * @param pattern The pattern to check, supports wild cards (*).\n */\n public static isMatch(input: string, patterns: string[], ignoreCase: boolean = true): boolean {\n if (!input || typeof input !== 'string') {\n return false;\n }\n\n const trim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n input = (ignoreCase ? input.toLowerCase() : input).replace(trim, '');\n\n return (patterns || []).some((pattern) => {\n if (typeof pattern !== 'string') {\n return false;\n }\n\n pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, '');\n if (pattern.length <= 0) {\n return false;\n }\n\n const startsWithWildcard: boolean = pattern[0] === '*';\n if (startsWithWildcard) {\n pattern = pattern.slice(1);\n }\n\n const endsWithWildcard: boolean = pattern[pattern.length - 1] === '*';\n if (endsWithWildcard) {\n pattern = pattern.substring(0, pattern.length - 1);\n }\n\n if (startsWithWildcard && endsWithWildcard) {\n return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1;\n }\n\n if (startsWithWildcard) {\n return Utils.endsWith(input, pattern);\n }\n\n if (endsWithWildcard) {\n return Utils.startsWith(input, pattern);\n }\n\n return input === pattern;\n });\n }\n\n public static isEmpty(input: object) {\n return input === null || (typeof (input) === 'object' && Object.keys(input).length === 0);\n }\n\n public static startsWith(input: string, prefix: string): boolean {\n return input.substring(0, prefix.length) === prefix;\n }\n\n public static endsWith(input: string, suffix: string): boolean {\n return input.indexOf(suffix, input.length - suffix.length) !== -1;\n }\n\n /**\n * Stringifys an object with optional exclusions and max depth.\n * @param data The data object to add.\n * @param exclusions Any property names that should be excluded.\n * @param maxDepth The max depth of the object to include.\n */\n public static stringify(data: any, exclusions?: string[], maxDepth?: number): string {\n function stringifyImpl(obj: any, excludedKeys: string[]): string {\n const cache: string[] = [];\n return JSON.stringify(obj, (key: string, value: any) => {\n if (Utils.isMatch(key, excludedKeys)) {\n return;\n }\n\n if (typeof value === 'object' && !!value) {\n if (cache.indexOf(value) !== -1) {\n // Circular reference found, discard key\n return;\n }\n\n cache.push(value);\n }\n\n return value;\n });\n }\n\n if (({}).toString.call(data) === '[object Object]') {\n const flattened = {};\n /* tslint:disable:forin */\n for (const prop in data) {\n const value = data[prop];\n if (value === data) {\n continue;\n }\n flattened[prop] = data[prop];\n }\n /* tslint:enable:forin */\n\n return stringifyImpl(flattened, exclusions);\n }\n\n if (({}).toString.call(data) === '[object Array]') {\n const result = [];\n for (let index = 0; index < data.length; index++) {\n result[index] = JSON.parse(stringifyImpl(data[index], exclusions));\n }\n\n return JSON.stringify(result);\n }\n\n return stringifyImpl(data, exclusions);\n }\n\n public static toBoolean(input, defaultValue: boolean = false): boolean {\n if (typeof input === 'boolean') {\n return input;\n }\n\n if (input === null || typeof input !== 'number' && typeof input !== 'string') {\n return defaultValue;\n }\n\n switch ((input + '').toLowerCase().trim()) {\n case 'true': case 'yes': case '1': return true;\n case 'false': case 'no': case '0': case null: return false;\n }\n\n return defaultValue;\n }\n}\n\n \n\nexport interface IConfigurationSettings {\n apiKey?: string;\n serverUrl?: string;\n heartbeatServerUrl?: string;\n updateSettingsWhenIdleInterval?: number;\n environmentInfoCollector?: IEnvironmentInfoCollector;\n errorParser?: IErrorParser;\n lastReferenceIdManager?: ILastReferenceIdManager;\n log?: ILog;\n moduleCollector?: IModuleCollector;\n requestInfoCollector?: IRequestInfoCollector;\n submissionBatchSize?: number;\n submissionClient?: ISubmissionClient;\n submissionAdapter?: ISubmissionAdapter;\n storage?: IStorageProvider;\n queue?: IEventQueue;\n}\n\n \n\ninterface ISettingsWithVersion {\n version: number;\n settings: { [key: string]: string };\n}\n\nexport class SettingsManager {\n /**\n * A list of handlers that will be fired when the settings change.\n * @type {Array}\n * @private\n */\n private static _handlers: Array<(config: Configuration) => void> = [];\n\n public static onChanged(handler: (config: Configuration) => void) {\n !!handler && this._handlers.push(handler);\n }\n\n public static applySavedServerSettings(config: Configuration): void {\n if (!config || !config.isValid) {\n return;\n }\n\n const savedSettings = this.getSavedServerSettings(config);\n config.log.info(`Applying saved settings: v${savedSettings.version}`);\n config.settings = Utils.merge(config.settings, savedSettings.settings);\n this.changed(config);\n }\n\n public static getVersion(config: Configuration): number {\n if (!config || !config.isValid) {\n return 0;\n }\n\n const savedSettings = this.getSavedServerSettings(config);\n return savedSettings.version || 0;\n }\n\n public static checkVersion(version: number, config: Configuration): void {\n const currentVersion: number = this.getVersion(config);\n if (version <= currentVersion) {\n return;\n }\n\n config.log.info(`Updating settings from v${currentVersion} to v${version}`);\n this.updateSettings(config, currentVersion);\n }\n\n public static updateSettings(config: Configuration, version?: number): void {\n if (!config || !config.enabled) {\n return;\n }\n\n const unableToUpdateMessage = 'Unable to update settings';\n if (!config.isValid) {\n config.log.error(`${unableToUpdateMessage}: ApiKey is not set.`);\n return;\n }\n\n if (!version || version < 0) {\n version = this.getVersion(config);\n }\n\n config.log.info(`Checking for updated settings from: v${version}.`);\n config.submissionClient.getSettings(config, version, (response: SettingsResponse) => {\n if (!config || !response || !response.success || !response.settings) {\n config.log.warn(`${unableToUpdateMessage}: ${response.message}`);\n return;\n }\n\n config.settings = Utils.merge(config.settings, response.settings);\n\n // TODO: Store snapshot of settings after reading from config and attributes and use that to revert to defaults.\n // Remove any existing server settings that are not in the new server settings.\n const savedServerSettings = SettingsManager.getSavedServerSettings(config);\n for (const key in savedServerSettings) {\n if (response.settings[key]) {\n continue;\n }\n\n delete config.settings[key];\n }\n\n const newSettings: ISettingsWithVersion = {\n version: response.settingsVersion,\n settings: response.settings\n };\n\n config.storage.settings.save(newSettings);\n\n config.log.info(`Updated settings: v${newSettings.version}`);\n this.changed(config);\n });\n }\n\n private static changed(config: Configuration) {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(config);\n } catch (ex) {\n config.log.error(`Error calling onChanged handler: ${ex}`);\n }\n }\n }\n\n private static getSavedServerSettings(config: Configuration): ISettingsWithVersion {\n const item = config.storage.settings.get()[0];\n if (item && item.value && item.value.version && item.value.settings) {\n return item.value;\n }\n\n return { version: 0, settings: {} };\n }\n}\n\nexport interface IEvent {\n type?: string;\n source?: string;\n date?: Date;\n tags?: string[];\n message?: string;\n geo?: string;\n value?: number;\n data?: any;\n reference_id?: string;\n count?: number;\n}\n\nexport class SubmissionResponse {\n public success: boolean = false;\n public badRequest: boolean = false;\n public serviceUnavailable: boolean = false;\n public paymentRequired: boolean = false;\n public unableToAuthenticate: boolean = false;\n public notFound: boolean = false;\n public requestEntityTooLarge: boolean = false;\n public statusCode: number;\n public message: string;\n\n constructor(statusCode: number, message?: string) {\n this.statusCode = statusCode;\n this.message = message;\n\n this.success = statusCode >= 200 && statusCode <= 299;\n this.badRequest = statusCode === 400;\n this.serviceUnavailable = statusCode === 503;\n this.paymentRequired = statusCode === 402;\n this.unableToAuthenticate = statusCode === 401 || statusCode === 403;\n this.notFound = statusCode === 404;\n this.requestEntityTooLarge = statusCode === 413;\n }\n}\n\n \n\nexport class ExceptionlessClient {\n /**\n * The default ExceptionlessClient instance.\n * @type {ExceptionlessClient}\n * @private\n */\n private static _instance: ExceptionlessClient = null;\n\n public config: Configuration;\n\n private _intervalId: any;\n private _timeoutId: any;\n\n constructor();\n constructor(settings: IConfigurationSettings);\n constructor(apiKey: string, serverUrl?: string);\n constructor(settingsOrApiKey?: IConfigurationSettings | string, serverUrl?: string) {\n this.config = typeof settingsOrApiKey === 'object'\n ? new Configuration(settingsOrApiKey)\n : new Configuration({ apiKey: settingsOrApiKey as string, serverUrl });\n\n this.updateSettingsTimer(5000);\n this.config.onChanged((config) => this.updateSettingsTimer(this._timeoutId > 0 ? 5000 : 0));\n this.config.queue.onEventsPosted((events, response) => this.updateSettingsTimer());\n }\n\n public createException(exception: Error): EventBuilder {\n const pluginContextData = new ContextData();\n pluginContextData.setException(exception);\n return this.createEvent(pluginContextData).setType('error');\n }\n\n public submitException(exception: Error, callback?: (context: EventPluginContext) => void): void {\n this.createException(exception).submit(callback);\n }\n\n public createUnhandledException(exception: Error, submissionMethod?: string): EventBuilder {\n const builder = this.createException(exception);\n builder.pluginContextData.markAsUnhandledError();\n builder.pluginContextData.setSubmissionMethod(submissionMethod);\n\n return builder;\n }\n\n public submitUnhandledException(exception: Error, submissionMethod?: string, callback?: (context: EventPluginContext) => void) {\n this.createUnhandledException(exception, submissionMethod).submit(callback);\n }\n\n public createFeatureUsage(feature: string): EventBuilder {\n return this.createEvent().setType('usage').setSource(feature);\n }\n\n public submitFeatureUsage(feature: string, callback?: (context: EventPluginContext) => void): void {\n this.createFeatureUsage(feature).submit(callback);\n }\n\n public createLog(message: string): EventBuilder;\n public createLog(source: string, message: string): EventBuilder;\n public createLog(source: string, message: string, level: string): EventBuilder;\n public createLog(sourceOrMessage: string, message?: string, level?: string): EventBuilder {\n let builder = this.createEvent().setType('log');\n\n if (level) {\n builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty('@level', level);\n } else if (message) {\n builder = builder.setSource(sourceOrMessage).setMessage(message);\n } else {\n builder = builder.setMessage(sourceOrMessage);\n\n try {\n // TODO: Look into using https: //www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/\n const caller: any = this.createLog.caller;\n builder = builder.setSource(caller && caller.caller && caller.caller.name);\n } catch (e) {\n this.config.log.trace('Unable to resolve log source: ' + e.message);\n }\n }\n\n return builder;\n }\n\n public submitLog(message: string): void;\n public submitLog(source: string, message: string): void;\n public submitLog(source: string, message: string, level: string, callback?: (context: EventPluginContext) => void): void;\n public submitLog(sourceOrMessage: string, message?: string, level?: string, callback?: (context: EventPluginContext) => void): void {\n this.createLog(sourceOrMessage, message, level).submit(callback);\n }\n\n public createNotFound(resource: string): EventBuilder {\n return this.createEvent().setType('404').setSource(resource);\n }\n\n public submitNotFound(resource: string, callback?: (context: EventPluginContext) => void): void {\n this.createNotFound(resource).submit(callback);\n }\n\n public createSessionStart(): EventBuilder {\n return this.createEvent().setType('session');\n }\n\n public submitSessionStart(callback?: (context: EventPluginContext) => void): void {\n this.createSessionStart().submit(callback);\n }\n\n public submitSessionEnd(sessionIdOrUserId: string): void {\n if (sessionIdOrUserId) {\n this.config.log.info(`Submitting session end: ${sessionIdOrUserId}`);\n this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, true, this.config);\n }\n }\n\n public submitSessionHeartbeat(sessionIdOrUserId: string): void {\n if (sessionIdOrUserId) {\n this.config.log.info(`Submitting session heartbeat: ${sessionIdOrUserId}`);\n this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, false, this.config);\n }\n }\n\n public createEvent(pluginContextData?: ContextData): EventBuilder {\n return new EventBuilder({ date: new Date() }, this, pluginContextData);\n }\n\n /**\n * Submits the event to be sent to the server.\n * @param event The event data.\n * @param pluginContextData Any contextual data objects to be used by Exceptionless plugins to gather default information for inclusion in the report information.\n * @param callback\n */\n public submitEvent(event: IEvent, pluginContextData?: ContextData, callback?: (context: EventPluginContext) => void): void {\n function cancelled(context: EventPluginContext) {\n if (!!context) {\n context.cancelled = true;\n }\n\n return !!callback && callback(context);\n }\n\n const context = new EventPluginContext(this, event, pluginContextData);\n if (!event) {\n return cancelled(context);\n }\n\n if (!this.config.enabled) {\n this.config.log.info('Event submission is currently disabled.');\n return cancelled(context);\n }\n\n if (!event.data) {\n event.data = {};\n }\n\n if (!event.tags || !event.tags.length) {\n event.tags = [];\n }\n\n EventPluginManager.run(context, (ctx: EventPluginContext) => {\n const config = ctx.client.config;\n const ev = ctx.event;\n\n if (!ctx.cancelled) {\n // ensure all required data\n if (!ev.type || ev.type.length === 0) {\n ev.type = 'log';\n }\n\n if (!ev.date) {\n ev.date = new Date();\n }\n\n config.queue.enqueue(ev);\n\n if (ev.reference_id && ev.reference_id.length > 0) {\n ctx.log.info(`Setting last reference id '${ev.reference_id}'`);\n config.lastReferenceIdManager.setLast(ev.reference_id);\n }\n }\n\n !!callback && callback(ctx);\n });\n }\n\n /**\n * Updates the user's email address and description of an event for the specified reference id.\n * @param referenceId The reference id of the event to update.\n * @param email The user's email address to set on the event.\n * @param description The user's description of the event.\n * @param callback The submission response.\n */\n public updateUserEmailAndDescription(referenceId: string, email: string, description: string, callback?: (response: SubmissionResponse) => void) {\n if (!referenceId || !email || !description || !this.config.enabled) {\n return !!callback && callback(new SubmissionResponse(500, 'cancelled'));\n }\n\n const userDescription: IUserDescription = { email_address: email, description };\n this.config.submissionClient.postUserDescription(referenceId, userDescription, this.config, (response: SubmissionResponse) => {\n if (!response.success) {\n this.config.log.error(`Failed to submit user email and description for event '${referenceId}': ${response.statusCode} ${response.message}`);\n }\n\n !!callback && callback(response);\n });\n }\n\n /**\n * Gets the last event client id that was submitted to the server.\n * @returns {string} The event client id.\n */\n public getLastReferenceId(): string {\n return this.config.lastReferenceIdManager.getLast();\n }\n\n private updateSettingsTimer(initialDelay?: number) {\n this.config.log.info(`Updating settings timer with delay: ${initialDelay}`);\n\n this._timeoutId = clearTimeout(this._timeoutId);\n this._timeoutId = clearInterval(this._intervalId);\n\n const interval = this.config.updateSettingsWhenIdleInterval;\n if (interval > 0) {\n const updateSettings = () => SettingsManager.updateSettings(this.config);\n if (initialDelay > 0) {\n this._timeoutId = setTimeout(updateSettings, initialDelay);\n }\n\n this._intervalId = setInterval(updateSettings, interval);\n }\n }\n\n /**\n * The default ExceptionlessClient instance.\n * @type {ExceptionlessClient}\n */\n public static get default() {\n if (ExceptionlessClient._instance === null) {\n ExceptionlessClient._instance = new ExceptionlessClient(null);\n }\n\n return ExceptionlessClient._instance;\n }\n}\n\nexport class ContextData {\n public setException(exception: Error): void {\n if (exception) {\n this['@@_Exception'] = exception;\n }\n }\n\n public get hasException(): boolean {\n return !!this['@@_Exception'];\n }\n\n public getException(): Error {\n return this['@@_Exception'] || null;\n }\n\n public markAsUnhandledError(): void {\n this['@@_IsUnhandledError'] = true;\n }\n\n public get isUnhandledError(): boolean {\n return !!this['@@_IsUnhandledError'];\n }\n\n public setSubmissionMethod(method: string): void {\n if (method) {\n this['@@_SubmissionMethod'] = method;\n }\n }\n\n public getSubmissionMethod(): string {\n return this['@@_SubmissionMethod'] || null;\n }\n}\n\nexport interface IEnvironmentInfo {\n processor_count?: number;\n total_physical_memory?: number;\n available_physical_memory?: number;\n command_line?: string;\n process_name?: string;\n process_id?: string;\n process_memory_size?: number;\n thread_id?: string;\n architecture?: string;\n o_s_name?: string;\n o_s_version?: string;\n ip_address?: string;\n machine_name?: string;\n install_id?: string;\n runtime_version?: string;\n data?: any;\n}\n\nexport interface IParameter {\n data?: any;\n generic_arguments?: string[];\n\n name?: string;\n type?: string;\n type_namespace?: string;\n}\n\n \n\nexport interface IMethod {\n data?: any;\n generic_arguments?: string[];\n parameters?: IParameter[];\n\n is_signature_target?: boolean;\n declaring_namespace?: string;\n declaring_type?: string;\n name?: string;\n module_id?: number;\n}\n\n \n\nexport interface IStackFrame extends IMethod {\n file_name?: string;\n line_number?: number;\n column?: number;\n}\n\n \n\nexport interface IInnerError {\n message?: string;\n type?: string;\n code?: string;\n data?: any;\n inner?: IInnerError;\n stack_trace?: IStackFrame[];\n target_method?: IMethod;\n}\n\nexport interface IModule {\n data?: any;\n\n module_id?: number;\n name?: string;\n version?: string;\n is_entry?: boolean;\n created_date?: Date;\n modified_date?: Date;\n}\n\n \n\nexport interface IError extends IInnerError {\n modules?: IModule[];\n}\n\nexport interface IRequestInfo {\n user_agent?: string;\n http_method?: string;\n is_secure?: boolean;\n host?: string;\n port?: number;\n path?: string;\n referrer?: string;\n client_ip_address?: string;\n cookies?: any;\n post_data?: any;\n query_string?: any;\n data?: any;\n}\n\nexport interface IStorageItem {\n timestamp: number;\n value: any;\n}\n\n \n\nexport interface IStorage {\n save(value: any): number;\n get(limit?: number): IStorageItem[];\n remove(timestamp: number): void;\n clear(): void;\n}\n\nexport type SubmissionCallback = (status: number, message: string, data?: string, headers?: object) => void;\n\nexport interface SubmissionRequest {\n apiKey: string;\n userAgent: string;\n method: string;\n url: string;\n data: string;\n}\n\n \n\nexport class Configuration implements IConfigurationSettings {\n /**\n * The default configuration settings that are applied to new configuration instances.\n * @type {IConfigurationSettings}\n * @private\n */\n private static _defaultSettings: IConfigurationSettings = null;\n\n /**\n * A default list of tags that will automatically be added to every\n * report submitted to the server.\n *\n * @type {Array}\n */\n public defaultTags: string[] = [];\n\n /**\n * A default list of of extended data objects that will automatically\n * be added to every report submitted to the server.\n *\n * @type {{}}\n */\n public defaultData: object = {};\n\n /**\n * Whether the client is currently enabled or not. If it is disabled,\n * submitted errors will be discarded and no data will be sent to the server.\n *\n * @returns {boolean}\n */\n public enabled: boolean = true;\n\n public environmentInfoCollector: IEnvironmentInfoCollector;\n public errorParser: IErrorParser;\n public lastReferenceIdManager: ILastReferenceIdManager = new DefaultLastReferenceIdManager();\n public log: ILog;\n public moduleCollector: IModuleCollector;\n public requestInfoCollector: IRequestInfoCollector;\n\n /**\n * Maximum number of events that should be sent to the server together in a batch. (Defaults to 50)\n */\n public submissionBatchSize: number;\n public submissionAdapter: ISubmissionAdapter;\n public submissionClient: ISubmissionClient;\n\n /**\n * Contains a dictionary of custom settings that can be used to control\n * the client and will be automatically updated from the server.\n */\n public settings: object = {};\n\n public storage: IStorageProvider;\n\n public queue: IEventQueue;\n\n /**\n * The API key that will be used when sending events to the server.\n * @type {string}\n * @private\n */\n private _apiKey: string;\n\n /**\n * The server url that all events will be sent to.\n * @type {string}\n * @private\n */\n private _serverUrl: string = 'https://collector.exceptionless.io';\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @type {string}\n * @private\n */\n private _heartbeatServerUrl: string = 'https://heartbeat.exceptionless.io';\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @type {number}\n * @private\n */\n private _updateSettingsWhenIdleInterval: number = 120000;\n\n /**\n * A list of exclusion patterns.\n * @type {Array}\n * @private\n */\n private _dataExclusions: string[] = [];\n\n /**\n * A list of user agent patterns.\n * @type {Array}\n * @private\n */\n private _userAgentBotPatterns: string[] = [];\n\n /**\n * The list of plugins that will be used in this configuration.\n * @type {Array}\n * @private\n */\n private _plugins: IEventPlugin[] = [];\n\n /**\n * A list of handlers that will be fired when configuration changes.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(config: Configuration) => void> = [];\n\n constructor(configSettings?: IConfigurationSettings) {\n function inject(fn: any) {\n return typeof fn === 'function' ? fn(this) : fn;\n }\n\n configSettings = Utils.merge(Configuration.defaults, configSettings);\n\n this.log = inject(configSettings.log) || new NullLog();\n this.apiKey = configSettings.apiKey;\n this.serverUrl = configSettings.serverUrl;\n this.heartbeatServerUrl = configSettings.heartbeatServerUrl;\n this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval;\n\n this.environmentInfoCollector = inject(configSettings.environmentInfoCollector);\n this.errorParser = inject(configSettings.errorParser);\n this.lastReferenceIdManager = inject(configSettings.lastReferenceIdManager) || new DefaultLastReferenceIdManager();\n this.moduleCollector = inject(configSettings.moduleCollector);\n this.requestInfoCollector = inject(configSettings.requestInfoCollector);\n this.submissionBatchSize = inject(configSettings.submissionBatchSize) || 50;\n this.submissionAdapter = inject(configSettings.submissionAdapter);\n this.submissionClient = inject(configSettings.submissionClient) || new DefaultSubmissionClient();\n this.storage = inject(configSettings.storage) || new InMemoryStorageProvider();\n this.queue = inject(configSettings.queue) || new DefaultEventQueue(this);\n\n SettingsManager.applySavedServerSettings(this);\n EventPluginManager.addDefaultPlugins(this);\n }\n\n /**\n * The API key that will be used when sending events to the server.\n * @returns {string}\n */\n public get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * The API key that will be used when sending events to the server.\n * @param value\n */\n public set apiKey(value: string) {\n this._apiKey = value || null;\n this.log.info(`apiKey: ${this._apiKey}`);\n this.changed();\n }\n\n /**\n * Returns true if the apiKey is valid.\n * @returns {boolean}\n */\n public get isValid(): boolean {\n return !!this.apiKey && this.apiKey.length >= 10;\n }\n\n /**\n * The server url that all events will be sent to.\n * @returns {string}\n */\n public get serverUrl(): string {\n return this._serverUrl;\n }\n\n /**\n * The server url that all events will be sent to.\n * @param value\n */\n public set serverUrl(value: string) {\n if (!!value) {\n this._serverUrl = value;\n this._heartbeatServerUrl = value;\n this.log.info(`serverUrl: ${value}`);\n this.changed();\n }\n }\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @returns {string}\n */\n public get heartbeatServerUrl(): string {\n return this._heartbeatServerUrl;\n }\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @param value\n */\n public set heartbeatServerUrl(value: string) {\n if (!!value) {\n this._heartbeatServerUrl = value;\n this.log.info(`heartbeatServerUrl: ${value}`);\n this.changed();\n }\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @returns {number}\n */\n public get updateSettingsWhenIdleInterval(): number {\n return this._updateSettingsWhenIdleInterval;\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @param value\n */\n public set updateSettingsWhenIdleInterval(value: number) {\n if (typeof value !== 'number') {\n return;\n }\n\n if (value <= 0) {\n value = -1;\n } else if (value > 0 && value < 15000) {\n value = 15000;\n }\n\n this._updateSettingsWhenIdleInterval = value;\n this.log.info(`updateSettingsWhenIdleInterval: ${value}`);\n this.changed();\n }\n\n /**\n * A list of exclusion patterns that will automatically remove any data that\n * matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties,\n * form fields, cookies and query parameters from the report.\n *\n * @returns {string[]}\n */\n public get dataExclusions(): string[] {\n const exclusions: string = this.settings['@@DataExclusions'];\n return this._dataExclusions.concat(exclusions && exclusions.split(',') || []);\n }\n\n /**\n * Add items to the list of exclusion patterns that will automatically remove any\n * data that matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties, form\n * fields, cookies and query parameters from the report.\n *\n * @param exclusions\n */\n public addDataExclusions(...exclusions: string[]) {\n this._dataExclusions = Utils.addRange<string>(this._dataExclusions, ...exclusions);\n }\n\n /**\n * A list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n *\n * @returns {string[]}\n */\n public get userAgentBotPatterns(): string[] {\n const patterns: string = this.settings['@@UserAgentBotPatterns'];\n return this._userAgentBotPatterns.concat(patterns && patterns.split(',') || []);\n }\n\n /**\n * Add items to the list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n *\n * @param userAgentBotPatterns\n */\n public addUserAgentBotPatterns(...userAgentBotPatterns: string[]) {\n this._userAgentBotPatterns = Utils.addRange<string>(this._userAgentBotPatterns, ...userAgentBotPatterns);\n }\n\n /**\n * The list of plugins that will be used in this configuration.\n * @returns {IEventPlugin[]}\n */\n public get plugins(): IEventPlugin[] {\n return this._plugins.sort((p1: IEventPlugin, p2: IEventPlugin) => {\n return (p1.priority < p2.priority) ? -1 : (p1.priority > p2.priority) ? 1 : 0;\n });\n }\n\n /**\n * Register an plugin to be used in this configuration.\n * @param plugin\n */\n public addPlugin(plugin: IEventPlugin): void;\n\n /**\n * Register an plugin to be used in this configuration.\n * @param name The name used to identify the plugin.\n * @param priority Used to determine plugins priority.\n * @param pluginAction A function that is run.\n */\n public addPlugin(name: string, priority: number, pluginAction: (context: EventPluginContext, next?: () => void) => void): void;\n public addPlugin(pluginOrName: IEventPlugin | string, priority?: number, pluginAction?: (context: EventPluginContext, next?: () => void) => void): void {\n const plugin: IEventPlugin = !!pluginAction ? { name: pluginOrName as string, priority, run: pluginAction } : pluginOrName as IEventPlugin;\n if (!plugin || !plugin.run) {\n this.log.error('Add plugin failed: Run method not defined');\n return;\n }\n\n if (!plugin.name) {\n plugin.name = Utils.guid();\n }\n\n if (!plugin.priority) {\n plugin.priority = 0;\n }\n\n let pluginExists: boolean = false;\n const plugins = this._plugins; // optimization for minifier.\n for (const p of plugins) {\n if (p.name === plugin.name) {\n pluginExists = true;\n break;\n }\n }\n\n if (!pluginExists) {\n plugins.push(plugin);\n }\n }\n\n /**\n * Remove the plugin from this configuration.\n * @param plugin\n */\n public removePlugin(plugin: IEventPlugin): void;\n\n /**\n * Remove an plugin by key from this configuration.\n * @param name\n */\n public removePlugin(pluginOrName: IEventPlugin | string): void {\n const name: string = typeof pluginOrName === 'string' ? pluginOrName : pluginOrName.name;\n if (!name) {\n this.log.error('Remove plugin failed: Plugin name not defined');\n return;\n }\n\n const plugins = this._plugins; // optimization for minifier.\n for (let index = 0; index < plugins.length; index++) {\n if (plugins[index].name === name) {\n plugins.splice(index, 1);\n break;\n }\n }\n }\n\n /**\n * Automatically set the application version for events.\n * @param version\n */\n public setVersion(version: string): void {\n if (!!version) {\n this.defaultData['@version'] = version;\n }\n }\n\n public setUserIdentity(userInfo: IUserInfo): void;\n public setUserIdentity(identity: string): void;\n public setUserIdentity(identity: string, name: string): void;\n public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): void {\n const USER_KEY: string = '@user'; // optimization for minifier.\n const userInfo: IUserInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n\n const shouldRemove: boolean = !userInfo || (!userInfo.identity && !userInfo.name);\n if (shouldRemove) {\n delete this.defaultData[USER_KEY];\n } else {\n this.defaultData[USER_KEY] = userInfo;\n }\n\n this.log.info(`user identity: ${shouldRemove ? 'null' : userInfo.identity}`);\n }\n\n /**\n * Used to identify the client that sent the events to the server.\n * @returns {string}\n */\n public get userAgent(): string {\n return 'exceptionless-js/1.0.0.0';\n }\n\n /**\n * Automatically send a heartbeat to keep the session alive.\n */\n public useSessions(sendHeartbeats: boolean = true, heartbeatInterval: number = 30000): void {\n if (sendHeartbeats) {\n this.addPlugin(new HeartbeatPlugin(heartbeatInterval));\n }\n }\n\n /**\n * Automatically set a reference id for error events.\n */\n public useReferenceIds(): void {\n this.addPlugin(new ReferenceIdPlugin());\n }\n\n public useLocalStorage(): void {\n // This method will be injected via the prototype.\n }\n\n // TODO: Support a min log level.\n public useDebugLogger(): void {\n this.log = new ConsoleLog();\n }\n\n public onChanged(handler: (config: Configuration) => void) {\n !!handler && this._handlers.push(handler);\n }\n\n private changed() {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(this);\n } catch (ex) {\n this.log.error(`Error calling onChanged handler: ${ex}`);\n }\n }\n }\n\n /**\n * The default configuration settings that are applied to new configuration instances.\n * @returns {IConfigurationSettings}\n */\n public static get defaults() {\n if (Configuration._defaultSettings === null) {\n Configuration._defaultSettings = {};\n }\n\n return Configuration._defaultSettings;\n }\n}\n\nexport interface IUserDescription {\n email_address?: string;\n description?: string;\n data?: any;\n}\n\nexport class SettingsResponse {\n public success: boolean = false;\n public settings: any;\n public settingsVersion: number = -1;\n public message: string;\n public exception: any;\n\n constructor(success: boolean, settings: any, settingsVersion: number = -1, exception: any = null, message: string = null) {\n this.success = success;\n this.settings = settings;\n this.settingsVersion = settingsVersion;\n this.exception = exception;\n this.message = message;\n }\n}\n\n \n\nexport class EventBuilder {\n public target: IEvent;\n public client: ExceptionlessClient;\n public pluginContextData: ContextData;\n\n private _validIdentifierErrorMessage: string = 'must contain between 8 and 100 alphanumeric or \\'-\\' characters.'; // optimization for minifier.\n\n constructor(event: IEvent, client: ExceptionlessClient, pluginContextData?: ContextData) {\n this.target = event;\n this.client = client;\n this.pluginContextData = pluginContextData || new ContextData();\n }\n\n public setType(type: string): EventBuilder {\n if (!!type) {\n this.target.type = type;\n }\n\n return this;\n }\n\n public setSource(source: string): EventBuilder {\n if (!!source) {\n this.target.source = source;\n }\n\n return this;\n }\n\n public setReferenceId(referenceId: string): EventBuilder {\n if (!this.isValidIdentifier(referenceId)) {\n throw new Error(`ReferenceId ${this._validIdentifierErrorMessage}`);\n }\n\n this.target.reference_id = referenceId;\n return this;\n }\n\n /**\n * Allows you to reference a parent event by its ReferenceId property. This allows you to have parent and child relationships.\n * @param name Reference name\n * @param id The reference id that points to a specific event\n * @returns {EventBuilder}\n */\n public setEventReference(name: string, id: string): EventBuilder {\n if (!name) {\n throw new Error('Invalid name');\n }\n\n if (!id || !this.isValidIdentifier(id)) {\n throw new Error(`Id ${this._validIdentifierErrorMessage}`);\n }\n\n this.setProperty('@ref:' + name, id);\n return this;\n }\n\n public setMessage(message: string): EventBuilder {\n if (!!message) {\n this.target.message = message;\n }\n\n return this;\n }\n\n public setGeo(latitude: number, longitude: number): EventBuilder {\n if (latitude < -90.0 || latitude > 90.0) {\n throw new Error('Must be a valid latitude value between -90.0 and 90.0.');\n }\n\n if (longitude < -180.0 || longitude > 180.0) {\n throw new Error('Must be a valid longitude value between -180.0 and 180.0.');\n }\n\n this.target.geo = `${latitude},${longitude}`;\n return this;\n }\n\n public setUserIdentity(userInfo: IUserInfo): EventBuilder;\n public setUserIdentity(identity: string): EventBuilder;\n public setUserIdentity(identity: string, name: string): EventBuilder;\n public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): EventBuilder {\n const userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n if (!userInfo || (!userInfo.identity && !userInfo.name)) {\n return this;\n }\n\n this.setProperty('@user', userInfo);\n return this;\n }\n\n /**\n * Sets the user's description of the event.\n *\n * @param emailAddress The email address\n * @param description The user's description of the event.\n * @returns {EventBuilder}\n */\n public setUserDescription(emailAddress: string, description: string): EventBuilder {\n if (emailAddress && description) {\n this.setProperty('@user_description', { email_address: emailAddress, description });\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting manual\n * stacking information.\n * @param signatureData A dictionary of strings to use for stacking.\n * @param title An optional title for the stacking information.\n * @returns {EventBuilder}\n */\n public setManualStackingInfo(signatureData: any, title?: string) {\n if (signatureData) {\n const stack: IManualStackingInfo = { signature_data: signatureData };\n if (title) {\n stack.title = title;\n }\n\n this.setProperty('@stack', stack);\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting the stacking key.\n * @param manualStackingKey The manual stacking key.\n * @param title An optional title for the stacking information.\n * @returns {EventBuilder}\n */\n public setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder {\n if (manualStackingKey) {\n const data = { ManualStackingKey: manualStackingKey };\n this.setManualStackingInfo(data, title);\n }\n\n return this;\n }\n\n public setValue(value: number): EventBuilder {\n if (!!value) {\n this.target.value = value;\n }\n\n return this;\n }\n\n public addTags(...tags: string[]): EventBuilder {\n this.target.tags = Utils.addRange<string>(this.target.tags, ...tags);\n return this;\n }\n\n /**\n * Adds the object to extended data. Uses @excludedPropertyNames\n * to exclude data from being included in the event.\n * @param name The data object to add.\n * @param value The name of the object to add.\n * @param maxDepth The max depth of the object to include.\n * @param excludedPropertyNames Any property names that should be excluded.\n */\n public setProperty(name: string, value: any, maxDepth?: number, excludedPropertyNames?: string[]): EventBuilder {\n if (!name || (value === undefined || value == null)) {\n return this;\n }\n\n if (!this.target.data) {\n this.target.data = {};\n }\n\n const result = JSON.parse(Utils.stringify(value, this.client.config.dataExclusions.concat(excludedPropertyNames || []), maxDepth));\n if (!Utils.isEmpty(result)) {\n this.target.data[name] = result;\n }\n\n return this;\n }\n\n public markAsCritical(critical: boolean): EventBuilder {\n if (critical) {\n this.addTags('Critical');\n }\n\n return this;\n }\n\n public addRequestInfo(request: object): EventBuilder {\n if (!!request) {\n this.pluginContextData['@request'] = request;\n }\n\n return this;\n }\n\n public submit(callback?: (context: EventPluginContext) => void): void {\n this.client.submitEvent(this.target, this.pluginContextData, callback);\n }\n\n private isValidIdentifier(value: string): boolean {\n if (!value) {\n return true;\n }\n\n if (value.length < 8 || value.length > 100) {\n return false;\n }\n\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index);\n const isDigit = (code >= 48) && (code <= 57);\n const isLetter = ((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122));\n const isMinus = code === 45;\n\n if (!(isDigit || isLetter) && !isMinus) {\n return false;\n }\n }\n\n return true;\n }\n}\n\nexport interface IManualStackingInfo {\n title?: string;\n signature_data?: any;\n}\n\n \n\nexport class ConfigurationDefaultsPlugin implements IEventPlugin {\n public priority: number = 10;\n public name: string = 'ConfigurationDefaultsPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const config = context.client.config;\n const defaultTags: string[] = config.defaultTags || [];\n for (const tag of defaultTags) {\n if (!!tag && context.event.tags.indexOf(tag) < 0) {\n context.event.tags.push(tag);\n }\n }\n\n // tslint:disable-next-line:ban-types\n const defaultData: Object = config.defaultData || {};\n for (const key in defaultData) {\n if (!!defaultData[key]) {\n const result = JSON.parse(Utils.stringify(defaultData[key], config.dataExclusions));\n if (!Utils.isEmpty(result)) {\n context.event.data[key] = result;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class DuplicateCheckerPlugin implements IEventPlugin {\n public priority: number = 1010;\n public name: string = 'DuplicateCheckerPlugin';\n\n private _mergedEvents: MergedEvent[] = [];\n private _processedHashcodes: TimestampedHash[] = [];\n private _getCurrentTime: () => number;\n private _interval: number;\n\n constructor(getCurrentTime: () => number = () => Date.now(), interval: number = 30000) {\n this._getCurrentTime = getCurrentTime;\n this._interval = interval;\n\n setInterval(() => {\n while (this._mergedEvents.length > 0) {\n this._mergedEvents.shift().resubmit();\n }\n }, interval);\n }\n\n public run(context: EventPluginContext, next?: () => void): void {\n function getHashCode(error: IInnerError): number {\n let hashCode = 0;\n while (error) {\n if (error.message && error.message.length) {\n hashCode += (hashCode * 397) ^ Utils.getHashCode(error.message);\n }\n if (error.stack_trace && error.stack_trace.length) {\n hashCode += (hashCode * 397) ^ Utils.getHashCode(JSON.stringify(error.stack_trace));\n }\n error = error.inner;\n }\n\n return hashCode;\n }\n\n const error = context.event.data['@error'];\n const hashCode = getHashCode(error);\n if (hashCode) {\n const count = context.event.count || 1;\n const now = this._getCurrentTime();\n\n const merged = this._mergedEvents.filter((s) => s.hashCode === hashCode)[0];\n if (merged) {\n merged.incrementCount(count);\n merged.updateDate(context.event.date);\n context.log.info('Ignoring duplicate event with hash: ' + hashCode);\n context.cancelled = true;\n }\n\n if (!context.cancelled && this._processedHashcodes.some((h) => h.hash === hashCode && h.timestamp >= (now - this._interval))) {\n context.log.trace('Adding event with hash: ' + hashCode);\n this._mergedEvents.push(new MergedEvent(hashCode, context, count));\n context.cancelled = true;\n }\n\n if (!context.cancelled) {\n context.log.trace('Enqueueing event with hash: ' + hashCode + 'to cache.');\n this._processedHashcodes.push({ hash: hashCode, timestamp: now });\n\n // Only keep the last 50 recent errors.\n while (this._processedHashcodes.length > 50) {\n this._processedHashcodes.shift();\n }\n }\n }\n\n next && next();\n }\n}\n\ninterface TimestampedHash {\n hash: number;\n timestamp: number;\n}\n\nclass MergedEvent {\n public hashCode: number;\n private _count: number;\n private _context: EventPluginContext;\n\n constructor(hashCode: number, context: EventPluginContext, count: number) {\n this.hashCode = hashCode;\n this._context = context;\n this._count = count;\n }\n\n public incrementCount(count: number) {\n this._count += count;\n }\n\n public resubmit() {\n this._context.event.count = this._count;\n this._context.client.config.queue.enqueue(this._context.event);\n }\n\n public updateDate(date) {\n if (date > this._context.event.date) {\n this._context.event.date = date;\n }\n }\n}\n\n \n\nexport class EnvironmentInfoPlugin implements IEventPlugin {\n public priority: number = 80;\n public name: string = 'EnvironmentInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ENVIRONMENT_KEY: string = '@environment'; // optimization for minifier.\n\n const collector = context.client.config.environmentInfoCollector;\n if (!context.event.data[ENVIRONMENT_KEY] && collector) {\n const environmentInfo: IEnvironmentInfo = collector.getEnvironmentInfo(context);\n if (!!environmentInfo) {\n context.event.data[ENVIRONMENT_KEY] = environmentInfo;\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class ErrorPlugin implements IEventPlugin {\n public priority: number = 30;\n public name: string = 'ErrorPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ERROR_KEY: string = '@error'; // optimization for minifier.\n const ignoredProperties: string[] = [\n 'arguments',\n 'column',\n 'columnNumber',\n 'description',\n 'fileName',\n 'message',\n 'name',\n 'number',\n 'line',\n 'lineNumber',\n 'opera#sourceloc',\n 'sourceId',\n 'sourceURL',\n 'stack',\n 'stackArray',\n 'stacktrace'\n ];\n\n const exception = context.contextData.getException();\n if (!!exception) {\n context.event.type = 'error';\n\n if (!context.event.data[ERROR_KEY]) {\n const config = context.client.config;\n const parser = config.errorParser;\n if (!parser) {\n throw new Error('No error parser was defined.');\n }\n\n const result = parser.parse(context, exception);\n if (!!result) {\n const additionalData = JSON.parse(Utils.stringify(exception, config.dataExclusions.concat(ignoredProperties)));\n if (!Utils.isEmpty(additionalData)) {\n if (!result.data) {\n result.data = {};\n }\n result.data['@ext'] = additionalData;\n }\n\n context.event.data[ERROR_KEY] = result;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class EventExclusionPlugin implements IEventPlugin {\n public priority: number = 45;\n public name: string = 'EventExclusionPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n function getLogLevel(level: string): number {\n switch ((level || '').toLowerCase().trim()) {\n case 'trace':\n case 'true':\n case '1':\n case 'yes':\n return 0;\n case 'debug':\n return 1;\n case 'info':\n return 2;\n case 'warn':\n return 3;\n case 'error':\n return 4;\n case 'fatal':\n return 5;\n case 'off':\n case 'false':\n case '0':\n case 'no':\n return 6;\n default:\n return -1;\n }\n }\n\n function getMinLogLevel(settings: object, loggerName: string = '*'): number {\n return getLogLevel(getTypeAndSourceSetting(settings, 'log', loggerName, 'Trace') + '');\n }\n\n // tslint:disable-next-line:ban-types\n function getTypeAndSourceSetting(settings: Object = {}, type: string, source: string, defaultValue?: string|boolean): string|boolean {\n if (!type) {\n return defaultValue;\n }\n\n const isLog = type === 'log';\n const sourcePrefix = `@@${type}:`;\n\n const value = settings[sourcePrefix + source];\n if (value) {\n return !isLog ? Utils.toBoolean(value) : value;\n }\n\n // check for wildcard match\n for (const key in settings) {\n if (Utils.startsWith(key.toLowerCase(), sourcePrefix.toLowerCase()) && Utils.isMatch(source, [key.substring(sourcePrefix.length)])) {\n return !isLog ? Utils.toBoolean(settings[key]) : settings[key];\n }\n }\n\n return defaultValue;\n }\n\n const ev = context.event;\n const log = context.log;\n const settings = context.client.config.settings;\n\n if (ev.type === 'log') {\n const minLogLevel = getMinLogLevel(settings, ev.source);\n const logLevel = getLogLevel(ev.data['@level']);\n\n if (logLevel >= 0 && (logLevel > 5 || logLevel < minLogLevel)) {\n log.info('Cancelling log event due to minimum log level.');\n context.cancelled = true;\n }\n } else if (ev.type === 'error') {\n let error: IInnerError = ev.data['@error'];\n while (!context.cancelled && error) {\n if (getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) {\n log.info(`Cancelling error from excluded exception type: ${error.type}`);\n context.cancelled = true;\n }\n\n error = error.inner;\n }\n } else if (getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) {\n log.info(`Cancelling event from excluded type: ${ev.type} and source: ${ev.source}`);\n context.cancelled = true;\n }\n\n next && next();\n }\n}\n\n \n\nexport class ModuleInfoPlugin implements IEventPlugin {\n public priority: number = 50;\n public name: string = 'ModuleInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ERROR_KEY: string = '@error'; // optimization for minifier.\n\n const collector = context.client.config.moduleCollector;\n if (context.event.data[ERROR_KEY] && !context.event.data['@error'].modules && !!collector) {\n const modules: IModule[] = collector.getModules(context);\n if (modules && modules.length > 0) {\n context.event.data[ERROR_KEY].modules = modules;\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class RequestInfoPlugin implements IEventPlugin {\n public priority: number = 70;\n public name: string = 'RequestInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const REQUEST_KEY: string = '@request'; // optimization for minifier.\n\n const config = context.client.config;\n const collector = config.requestInfoCollector;\n if (!context.event.data[REQUEST_KEY] && !!collector) {\n const requestInfo: IRequestInfo = collector.getRequestInfo(context);\n if (!!requestInfo) {\n if (Utils.isMatch(requestInfo.user_agent, config.userAgentBotPatterns)) {\n context.log.info('Cancelling event as the request user agent matches a known bot pattern');\n context.cancelled = true;\n } else {\n context.event.data[REQUEST_KEY] = requestInfo;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class SubmissionMethodPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = 'SubmissionMethodPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const submissionMethod: string = context.contextData.getSubmissionMethod();\n if (!!submissionMethod) {\n context.event.data['@submission_method'] = submissionMethod;\n }\n\n next && next();\n }\n}\n\n \n\nexport class InMemoryStorage implements IStorage {\n private maxItems: number;\n private items: IStorageItem[] = [];\n private lastTimestamp: number = 0;\n\n constructor(maxItems: number) {\n this.maxItems = maxItems;\n }\n\n public save(value: any): number {\n if (!value) {\n return null;\n }\n\n const items = this.items;\n const timestamp = Math.max(Date.now(), this.lastTimestamp + 1);\n const item = { timestamp, value };\n\n if (items.push(item) > this.maxItems) {\n items.shift();\n }\n\n this.lastTimestamp = timestamp;\n return item.timestamp;\n }\n\n public get(limit?: number): IStorageItem[] {\n return this.items.slice(0, limit);\n }\n\n public remove(timestamp: number): void {\n const items = this.items;\n for (let i = 0; i < items.length; i++) {\n if (items[i].timestamp === timestamp) {\n items.splice(i, 1);\n return;\n }\n }\n }\n\n public clear(): void {\n this.items = [];\n }\n}\n\nexport interface IClientConfiguration {\n settings: object;\n version: number;\n}\n\n \n\nexport abstract class KeyValueStorageBase implements IStorage {\n private maxItems: number;\n private items: number[];\n private lastTimestamp: number = 0;\n\n constructor(maxItems) {\n this.maxItems = maxItems;\n }\n\n public save(value: any, single?: boolean): number {\n if (!value) {\n return null;\n }\n\n this.ensureIndex();\n\n const items = this.items;\n const timestamp = Math.max(Date.now(), this.lastTimestamp + 1);\n const key = this.getKey(timestamp);\n const json = JSON.stringify(value);\n\n try {\n this.write(key, json);\n this.lastTimestamp = timestamp;\n if (items.push(timestamp) > this.maxItems) {\n this.delete(this.getKey(items.shift()));\n }\n } catch (e) {\n return null;\n }\n\n return timestamp;\n }\n\n public get(limit?: number): IStorageItem[] {\n this.ensureIndex();\n\n return this.items.slice(0, limit)\n .map((timestamp) => {\n // Read and parse item for this timestamp\n const key = this.getKey(timestamp);\n try {\n const json = this.read(key);\n const value = JSON.parse(json, parseDate);\n return { timestamp, value };\n } catch (error) {\n // Something went wrong - try to delete the cause.\n this.safeDelete(key);\n return null;\n }\n })\n .filter((item) => item != null);\n }\n\n public remove(timestamp: number): void {\n this.ensureIndex();\n\n const items = this.items;\n const index = items.indexOf(timestamp);\n if (index >= 0) {\n const key = this.getKey(timestamp);\n this.safeDelete(key);\n items.splice(index, 1);\n }\n }\n\n public clear(): void {\n this.items.forEach((item) => this.safeDelete(this.getKey(item)));\n this.items = [];\n }\n\n protected abstract write(key: string, value: string): void;\n protected abstract read(key: string): string;\n protected abstract readAllKeys(): string[];\n protected abstract delete(key: string);\n protected abstract getKey(timestamp: number): string;\n protected abstract getTimestamp(key: string): number;\n\n private ensureIndex() {\n if (!this.items) {\n this.items = this.createIndex();\n this.lastTimestamp = Math.max(0, ...this.items) + 1;\n }\n }\n\n private safeDelete(key: string): void {\n try {\n this.delete(key);\n } catch (error) {\n }\n }\n\n private createIndex() {\n try {\n const keys = this.readAllKeys();\n return keys.map((key) => {\n try {\n const timestamp = this.getTimestamp(key);\n if (!timestamp) {\n this.safeDelete(key);\n return null;\n }\n return timestamp;\n } catch (error) {\n this.safeDelete(key);\n return null;\n }\n }).filter((timestamp) => timestamp != null)\n .sort((a, b) => a - b);\n } catch (error) {\n return [];\n }\n }\n}\n\nfunction parseDate(key, value) {\n const dateRegx = /\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)/g;\n if (typeof value === 'string') {\n const a = dateRegx.exec(value);\n if (a) {\n return new Date(value);\n }\n }\n return value;\n}\n\n \n\nexport class BrowserStorage extends KeyValueStorageBase {\n private prefix: string;\n\n public static isAvailable(): boolean {\n try {\n const storage = window.localStorage;\n const x = '__storage_test__';\n storage.setItem(x, x);\n storage.removeItem(x);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(namespace: string, prefix: string = 'com.exceptionless.', maxItems: number = 20) {\n super(maxItems);\n\n this.prefix = prefix + namespace + '-';\n }\n\n public write(key: string, value: string) {\n window.localStorage.setItem(key, value);\n }\n\n public read(key: string) {\n return window.localStorage.getItem(key);\n }\n\n public readAllKeys() {\n return Object.keys(window.localStorage)\n .filter((key) => key.indexOf(this.prefix) === 0);\n }\n\n public delete(key: string) {\n window.localStorage.removeItem(key);\n }\n\n public getKey(timestamp) {\n return this.prefix + timestamp;\n }\n\n public getTimestamp(key) {\n return parseInt(key.substr(this.prefix.length), 10);\n }\n}\n\n \n\nexport class DefaultErrorParser implements IErrorParser {\n public parse(context: EventPluginContext, exception: Error): IError {\n function getParameters(parameters: string | string[]): IParameter[] {\n const params: string[] = (typeof parameters === 'string' ? [parameters] : parameters) || [];\n\n const result: IParameter[] = [];\n for (const param of params) {\n result.push({ name: param });\n }\n\n return result;\n }\n\n function getStackFrames(stackFrames: TraceKit.StackFrame[]): IStackFrame[] {\n const ANONYMOUS: string = '<anonymous>';\n const frames: IStackFrame[] = [];\n\n for (const frame of stackFrames) {\n frames.push({\n name: (frame.func || ANONYMOUS).replace('?', ANONYMOUS),\n parameters: getParameters(frame.args),\n file_name: frame.url,\n line_number: frame.line || 0,\n column: frame.column || 0\n });\n }\n\n return frames;\n }\n\n const TRACEKIT_STACK_TRACE_KEY: string = '@@_TraceKit.StackTrace'; // optimization for minifier.\n\n const stackTrace: TraceKit.StackTrace = !!context.contextData[TRACEKIT_STACK_TRACE_KEY]\n ? context.contextData[TRACEKIT_STACK_TRACE_KEY]\n : TraceKit.computeStackTrace(exception, 25);\n\n if (!stackTrace) {\n throw new Error('Unable to parse the exceptions stack trace.');\n }\n\n const message = typeof(exception) === 'string' ? exception as any : undefined;\n return {\n type: stackTrace.name || 'Error',\n message: stackTrace.message || exception.message || message,\n stack_trace: getStackFrames(stackTrace.stack || [])\n };\n }\n}\n\n \n\nexport class DefaultModuleCollector implements IModuleCollector {\n public getModules(context: EventPluginContext): IModule[] {\n if (!document || !document.getElementsByTagName) {\n return null;\n }\n\n const modules: IModule[] = [];\n const scripts: NodeListOf<HTMLScriptElement> = document.getElementsByTagName('script');\n if (scripts && scripts.length > 0) {\n for (let index = 0; index < scripts.length; index++) {\n if (scripts[index].src) {\n modules.push({\n module_id: index,\n name: scripts[index].src.split('?')[0],\n version: Utils.parseVersion(scripts[index].src)\n });\n } else if (!!scripts[index].innerHTML) {\n modules.push({\n module_id: index,\n name: 'Script Tag',\n version: Utils.getHashCode(scripts[index].innerHTML).toString()\n });\n }\n }\n }\n\n return modules;\n }\n}\n\n \n\nexport class DefaultRequestInfoCollector implements IRequestInfoCollector {\n public getRequestInfo(context: EventPluginContext): IRequestInfo {\n if (!document || !navigator || !location) {\n return null;\n }\n\n const exclusions = context.client.config.dataExclusions;\n const requestInfo: IRequestInfo = {\n user_agent: navigator.userAgent,\n is_secure: location.protocol === 'https:',\n host: location.hostname,\n port: location.port && location.port !== '' ? parseInt(location.port, 10) : 80,\n path: location.pathname,\n // client_ip_address: 'TODO',\n cookies: Utils.getCookies(document.cookie, exclusions),\n query_string: Utils.parseQueryString(location.search.substring(1), exclusions)\n };\n\n if (document.referrer && document.referrer !== '') {\n requestInfo.referrer = document.referrer;\n }\n\n return requestInfo;\n }\n}\n\n \n\nexport class BrowserStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(prefix?: string, maxQueueItems: number = 250) {\n this.queue = new BrowserStorage('q', prefix, maxQueueItems);\n this.settings = new BrowserStorage('settings', prefix, 1);\n }\n\n}\n\n \n\n// tslint:disable-next-line:prefer-const\ndeclare var XDomainRequest: { new (); create(); };\n\nexport class DefaultSubmissionAdapter implements ISubmissionAdapter {\n public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) {\n // TODO: Handle sending events when app is exiting with send beacon.\n const TIMEOUT: string = 'timeout'; // optimization for minifier.\n const LOADED: string = 'loaded'; // optimization for minifier.\n const WITH_CREDENTIALS: string = 'withCredentials'; // optimization for minifier.\n\n let isCompleted: boolean = false;\n let useSetTimeout: boolean = false;\n function complete(mode: string, xhr: XMLHttpRequest) {\n function parseResponseHeaders(headerStr) {\n function trim(value) {\n return value.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n\n const headers = {};\n const headerPairs = (headerStr || '').split('\\u000d\\u000a');\n for (const headerPair of headerPairs) {\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n const separator = headerPair.indexOf('\\u003a\\u0020');\n if (separator > 0) {\n headers[trim(headerPair.substring(0, separator).toLowerCase())] = headerPair.substring(separator + 2);\n }\n }\n\n return headers;\n }\n\n if (isCompleted) {\n return;\n }\n\n isCompleted = true;\n\n let message: string = xhr.statusText;\n const responseText: string = xhr.responseText;\n let status: number = xhr.status;\n\n if (mode === TIMEOUT || status === 0) {\n message = 'Unable to connect to server.';\n status = 0;\n } else if (mode === LOADED && !status) {\n status = request.method === 'POST' ? 202 : 200;\n } else if (status < 200 || status > 299) {\n const responseBody: any = (xhr as any).responseBody;\n if (!!responseBody && !!responseBody.message) {\n message = responseBody.message;\n } else if (!!responseText && responseText.indexOf('message') !== -1) {\n try {\n message = JSON.parse(responseText).message;\n } catch (e) {\n message = responseText;\n }\n }\n }\n\n callback && callback(status || 500, message || '', responseText, parseResponseHeaders(xhr.getAllResponseHeaders && xhr.getAllResponseHeaders()));\n }\n\n function createRequest(userAgent: string, method: string, url: string): XMLHttpRequest {\n let xhr: any = new XMLHttpRequest();\n if (WITH_CREDENTIALS in xhr) {\n xhr.open(method, url, true);\n\n xhr.setRequestHeader('X-Exceptionless-Client', userAgent);\n if (method === 'POST') {\n xhr.setRequestHeader('Content-Type', 'application/json');\n }\n } else if (typeof XDomainRequest !== 'undefined') {\n useSetTimeout = true;\n xhr = new XDomainRequest();\n xhr.open(method, location.protocol === 'http:' ? url.replace('https:', 'http:') : url);\n } else {\n xhr = null;\n }\n\n if (xhr) {\n xhr.timeout = 10000;\n }\n\n return xhr;\n }\n\n const url = `${request.url}${(request.url.indexOf('?') === -1 ? '?' : '&')}access_token=${encodeURIComponent(request.apiKey)}`;\n const xhr = createRequest(request.userAgent, request.method || 'POST', url);\n if (!xhr) {\n return (callback && callback(503, 'CORS not supported.'));\n }\n\n if (WITH_CREDENTIALS in xhr) {\n xhr.onreadystatechange = () => {\n // xhr not ready.\n if (xhr.readyState !== 4) {\n return;\n }\n\n complete(LOADED, xhr);\n };\n }\n\n xhr.onprogress = () => { };\n xhr.ontimeout = () => complete(TIMEOUT, xhr);\n xhr.onerror = () => complete('error', xhr);\n xhr.onload = () => complete(LOADED, xhr);\n\n if (useSetTimeout) {\n setTimeout(() => xhr.send(request.data), 500);\n } else {\n xhr.send(request.data);\n }\n }\n}\n\n \n\n(function init() {\n function getDefaultsSettingsFromScriptTag(): IConfigurationSettings {\n if (!document || !document.getElementsByTagName) {\n return null;\n }\n\n const scripts = document.getElementsByTagName('script');\n // tslint:disable-next-line:prefer-for-of\n for (let index = 0; index < scripts.length; index++) {\n if (scripts[index].src && scripts[index].src.indexOf('/exceptionless') > -1) {\n return Utils.parseQueryString(scripts[index].src.split('?').pop());\n }\n }\n return null;\n }\n\n function processUnhandledException(stackTrace: TraceKit.StackTrace, options?: any): void {\n const builder = ExceptionlessClient.default.createUnhandledException(new Error(stackTrace.message || (options || {}).status || 'Script error'), 'onerror');\n builder.pluginContextData['@@_TraceKit.StackTrace'] = stackTrace;\n builder.submit();\n }\n\n if (typeof document === 'undefined') {\n return;\n }\n\n /*\n TODO: We currently are unable to parse string exceptions.\n function processJQueryAjaxError(event, xhr, settings, error:string): void {\n let client = ExceptionlessClient.default;\n if (xhr.status === 404) {\n client.submitNotFound(settings.url);\n } else if (xhr.status !== 401) {\n client.createUnhandledException(error, 'JQuery.ajaxError')\n .setSource(settings.url)\n .setProperty('status', xhr.status)\n .setProperty('request', settings.data)\n .setProperty('response', xhr.responseText && xhr.responseText.slice && xhr.responseText.slice(0, 1024))\n .submit();\n }\n }\n */\n\n Configuration.prototype.useLocalStorage = function() {\n if (BrowserStorage.isAvailable()) {\n this.storage = new BrowserStorageProvider();\n SettingsManager.applySavedServerSettings(this);\n this.changed();\n }\n };\n\n const defaults = Configuration.defaults;\n const settings = getDefaultsSettingsFromScriptTag();\n if (settings && (settings.apiKey || settings.serverUrl)) {\n defaults.apiKey = settings.apiKey;\n defaults.serverUrl = settings.serverUrl;\n }\n\n defaults.errorParser = new DefaultErrorParser();\n defaults.moduleCollector = new DefaultModuleCollector();\n defaults.requestInfoCollector = new DefaultRequestInfoCollector();\n defaults.submissionAdapter = new DefaultSubmissionAdapter();\n\n TraceKit.report.subscribe(processUnhandledException);\n TraceKit.extendToAsynchronousCallbacks();\n\n // window && window.addEventListener && window.addEventListener('beforeunload', function () {\n // ExceptionlessClient.default.config.queue.process(true);\n // });\n\n // if (typeof $ !== 'undefined' && $(document)) {\n // $(document).ajaxError(processJQueryAjaxError);\n // }\n\n (Error as any).stackTraceLimit = Infinity;\n})();\n\n// tslint:disable-next-line:prefer-const\ndeclare var $;\n\n"]} \ No newline at end of file diff --git a/dist/exceptionless.min.js b/dist/exceptionless.min.js deleted file mode 100644 index 6be60bdf..00000000 --- a/dist/exceptionless.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function r(e){return void 0===e}if(e){var i={},o=e.TraceKit,s=[].slice,a="?",u=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;i.noConflict=function(){return e.TraceKit=o,i},i.wrap=function(e){return function(){try{return e.apply(this,arguments)}catch(e){throw i.report(e),e}}},i.report=function(){function t(e,t,r){var o=null;if(!t||i.collectWindowErrors){for(var s in f)if(n(f,s))try{f[s](e,t,r)}catch(e){o=e}if(o)throw o}}function r(e,n,r,o,a){if(h)i.computeStackTrace.augmentStackTraceWithInitialElement(h,n,r,e),s();else if(a)t(i.computeStackTrace(a),!0,a);else{var l,f={url:n,line:r,column:o},p=e;if("[object String]"==={}.toString.call(e)){var g=e.match(u);g&&(l=g[1],p=g[2])}f.func=i.computeStackTrace.guessFunctionName(f.url,f.line),f.context=i.computeStackTrace.gatherContext(f.url,f.line),t({name:l,message:p,mode:"onerror",stack:[f]},!0,null)}return!!c&&c.apply(this,arguments)}function o(){!0!==l&&(c=e.onerror,e.onerror=r,l=!0)}function s(){var e=h,n=p;h=null,p=null,t(e,!1,n)}function a(e){if(h){if(p===e)return;s()}var t=i.computeStackTrace(e);throw h=t,p=e,setTimeout(function(){p===e&&s()},t.incomplete?2e3:0),e}var c,l,f=[],p=null,h=null;return a.subscribe=function(e){o(),f.push(e)},a.unsubscribe=function(t){for(var n=f.length-1;n>=0;--n)f[n]===t&&f.splice(n,1);0===f.length&&(e.onerror=c,l=!1)},a}(),i.computeStackTrace=function(){function t(t){if(!i.remoteFetching)return"";try{var n=function(){try{return new e.XMLHttpRequest}catch(t){return new e.ActiveXObject("Microsoft.XMLHTTP")}}();return n.open("GET",t,!1),n.send(""),n.responseText}catch(e){return""}}function o(r){if("string"!=typeof r)return[];if(!n(x,r)){var i="",o="";try{o=e.document.domain}catch(e){}var s=/(.*)\:\/\/([^:\/]+)([:\d]*)\/{0,1}([\s\S]*)/.exec(r);s&&s[2]===o&&(i=t(r)),x[r]=i?i.split("\n"):[]}return x[r]}function s(e,t){var n,i=/function ([^(]*)\(([^)]*)\)/,s=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,u="",c=o(e);if(!c.length)return a;for(var l=0;l<10;++l)if(u=c[t-l]+u,!r(u)){if(n=s.exec(u))return n[1];if(n=i.exec(u))return n[1]}return a}function u(e,t){var n=o(e);if(!n.length)return null;var s=[],a=Math.floor(i.linesOfContext/2),u=a+i.linesOfContext%2,c=Math.max(0,t-a-1),l=Math.min(n.length,t+u-1);t-=1;for(var f=c;f<l;++f)r(n[f])||s.push(n[f]);return s.length>0?s:null}function c(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function l(e){return c(e).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function f(e,t){for(var n,r,i=0,s=t.length;i<s;++i)if((n=o(t[i])).length&&(n=n.join("\n"),r=e.exec(n)))return{url:t[i],line:n.substring(0,r.index).split("\n").length,column:r.index-n.lastIndexOf("\n",r.index)-1};return null}function p(e,t,n){var r,i=o(t),s=new RegExp("\\b"+c(e)+"\\b");return n-=1,i&&i.length>n&&(r=s.exec(i[n]))?r.index:null}function h(t){if(!r(e&&e.document)){for(var n,i,o,s,a=[e.location.href],u=e.document.getElementsByTagName("script"),p=""+t,h=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,g=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,d=0;d<u.length;++d){var v=u[d];v.src&&a.push(v.src)}if(o=h.exec(p)){var m=o[1]?"\\s+"+o[1]:"",y=o[2].split(",").join("\\s*,\\s*");n=c(o[3]).replace(/;$/,";?"),i=new RegExp("function"+m+"\\s*\\(\\s*"+y+"\\s*\\)\\s*{\\s*"+n+"\\s*}")}else i=new RegExp(c(p).replace(/\s+/g,"\\s+"));if(s=f(i,a))return s;if(o=g.exec(p)){var b=o[1];if(n=l(o[2]),i=new RegExp("on"+b+"=[\\'\"]\\s*"+n+"\\s*[\\'\"]","i"),s=f(i,a[0]))return s;if(i=new RegExp(n),s=f(i,a))return s}return null}}function g(e){if(!e.stack)return null;for(var t,n,i,o=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,c=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,l=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,f=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,h=/\((\S*)(?::(\d+))(?::(\d+))\)/,g=e.stack.split("\n"),d=[],v=/^(.*) is undefined$/.exec(e.message),m=0,y=g.length;m<y;++m){if(n=o.exec(g[m])){var b=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(t=h.exec(n[2]))&&(n[2]=t[1],n[3]=t[2],n[4]=t[3]),i={url:b?null:n[2],func:n[1]||a,args:b?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=l.exec(g[m]))i={url:n[2],func:n[1]||a,args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=c.exec(g[m])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(t=f.exec(n[3]))?(n[3]=t[1],n[4]=t[2],n[5]=null):0!==m||n[5]||r(e.columnNumber)||(d[0].column=e.columnNumber+1),i={url:n[3],func:n[1]||a,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!i.func&&i.line&&(i.func=s(i.url,i.line)),i.context=i.line?u(i.url,i.line):null,d.push(i)}return d.length?(d[0]&&d[0].line&&!d[0].column&&v&&(d[0].column=p(v[1],d[0].url,d[0].line)),{mode:"stack",name:e.name,message:e.message,stack:d}):null}function d(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),a=[],c=0;c<o.length;c+=2){var l=null;if((n=r.exec(o[c]))?l={url:n[2],line:+n[1],column:null,func:n[3],args:[]}:(n=i.exec(o[c]))&&(l={url:n[6],line:+n[1],column:+n[2],func:n[3]||n[4],args:n[5]?n[5].split(","):[]}),l){if(!l.func&&l.line&&(l.func=s(l.url,l.line)),l.line)try{l.context=u(l.url,l.line)}catch(e){}l.context||(l.context=[o[c+1]]),a.push(l)}}return a.length?{mode:"stacktrace",name:e.name,message:e.message,stack:a}:null}}function v(t){var r=t.message.split("\n");if(r.length<4)return null;var i,a=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,c=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,p=/^\s*Line (\d+) of function script\s*$/i,h=[],g=e&&e.document&&e.document.getElementsByTagName("script"),d=[];for(var v in g)n(g,v)&&!g[v].src&&d.push(g[v]);for(var m=2;m<r.length;m+=2){var y=null;if(i=a.exec(r[m]))y={url:i[2],func:i[3],args:[],line:+i[1],column:null};else if(i=c.exec(r[m])){y={url:i[3],func:i[4],args:[],line:+i[1],column:null};var b=+i[1],S=d[i[2]-1];if(S){var x=o(y.url);if(x){var _=(x=x.join("\n")).indexOf(S.innerText);_>=0&&(y.line=b+x.substring(0,_).split("\n").length)}}}else if(i=p.exec(r[m])){var w=e.location.href.replace(/#.*$/,""),E=f(new RegExp(l(r[m+1])),[w]);y={url:w,func:"",args:[],line:E?E.line:i[1],column:null}}if(y){y.func||(y.func=s(y.url,y.line));var I=u(y.url,y.line),P=I?I[Math.floor(I.length/2)]:null;I&&P.replace(/^\s*/,"")===r[m+1].replace(/^\s*/,"")?y.context=I:y.context=[r[m+1]],h.push(y)}}return h.length?{mode:"multiline",name:t.name,message:r[0],stack:h}:null}function m(e,t,n,r){var i={url:t,line:n};if(i.url&&i.line){e.incomplete=!1,i.func||(i.func=s(i.url,i.line)),i.context||(i.context=u(i.url,i.line));var o=/ '([^']+)' /.exec(r);if(o&&(i.column=p(o[1],i.url,i.line)),e.stack.length>0&&e.stack[0].url===i.url){if(e.stack[0].line===i.line)return!1;if(!e.stack[0].line&&e.stack[0].func===i.func)return e.stack[0].line=i.line,e.stack[0].context=i.context,!1}return e.stack.unshift(i),e.partial=!0,!0}return e.incomplete=!0,!1}function y(e,t){for(var n,r,o,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,c=[],l={},f=!1,g=y.caller;g&&!f;g=g.caller)if(g!==b&&g!==i.report){if(r={url:null,func:a,args:[],line:null,column:null},g.name?r.func=g.name:(n=u.exec(g.toString()))&&(r.func=n[1]),void 0===r.func)try{r.func=n.input.substring(0,n.input.indexOf("{"))}catch(e){}if(o=h(g)){r.url=o.url,r.line=o.line,r.func===a&&(r.func=s(r.url,r.line));var d=/ '([^']+)' /.exec(e.message||e.description);d&&(r.column=p(d[1],o.url,o.line))}l[""+g]?f=!0:l[""+g]=!0,c.push(r)}t&&c.splice(0,t);var v={mode:"callers",name:e.name,message:e.message,stack:c};return m(v,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),v}function b(e,t){var n=null;t=null==t?0:+t;try{if(n=d(e))return n}catch(e){if(S)throw e}try{if(n=g(e))return n}catch(e){if(S)throw e}try{if(n=v(e))return n}catch(e){if(S)throw e}try{if(n=y(e,t+1))return n}catch(e){if(S)throw e}return{name:e.name,message:e.message,mode:"failed"}}var S=!1,x={};return b.augmentStackTraceWithInitialElement=m,b.computeStackTraceFromStackProp=g,b.guessFunctionName=s,b.gatherContext=u,b.ofCaller=function(e){e=1+(null==e?0:+e);try{throw new Error}catch(t){return b(t,e+1)}},b.getSource=o,b}(),i.extendToAsynchronousCallbacks=function(){var t=function(t){var n=e[t];e[t]=function(){var e=s.call(arguments),t=e[0];return"function"==typeof t&&(e[0]=i.wrap(t)),n.apply?n.apply(this,e):n(e[0],e[1])}};t("setTimeout"),t("setInterval")},i.remoteFetching||(i.remoteFetching=!0),i.collectWindowErrors||(i.collectWindowErrors=!0),(!i.linesOfContext||i.linesOfContext<1)&&(i.linesOfContext=11),"function"==typeof define&&define.amd?define("TraceKit",[],i):"undefined"!=typeof module&&module.exports&&e.module!==module?module.exports=i:e.TraceKit=i}}("undefined"!=typeof window?window:global);var exports,require;!function(e,t){"function"==typeof define&&define.amd?define("exceptionless",["require","exports","TraceKit"],t):"object"==typeof exports?module.exports=t(require,exports,require("TraceKit")):e.exceptionless=t(require,exports,e.TraceKit)}(this,function(e,t,n){function r(e,t){var n=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/g;return"string"==typeof t&&n.exec(t)?new Date(t):t}if(!t)var t={};var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){this._lastReferenceId=null}return e.prototype.getLast=function(){return this._lastReferenceId},e.prototype.clearLast=function(){this._lastReferenceId=null},e.prototype.setLast=function(e){this._lastReferenceId=e},e}();t.DefaultLastReferenceIdManager=o;var s=function(){function e(){}return e.prototype.trace=function(e){this.log("debug",e)},e.prototype.info=function(e){this.log("info",e)},e.prototype.warn=function(e){this.log("warn",e)},e.prototype.error=function(e){this.log("error",e)},e.prototype.log=function(e,t){if(console){var n="["+e+"] Exceptionless: "+t;console[e]?console[e](n):console.log&&console.log(n)}},e}();t.ConsoleLog=s;var a=function(){function e(){}return e.prototype.trace=function(e){},e.prototype.info=function(e){},e.prototype.warn=function(e){},e.prototype.error=function(e){},e}();t.NullLog=a;var u=function(){function e(e){void 0===e&&(e=3e4),this.priority=100,this.name="HeartbeatPlugin",this._interval=e}return e.prototype.run=function(e,t){clearInterval(this._intervalId);var n=e.event.data["@user"];n&&n.identity&&(this._intervalId=setInterval(function(){return e.client.submitSessionHeartbeat(n.identity)},this._interval)),t&&t()},e}();t.HeartbeatPlugin=u;var c=function(){function e(){this.priority=20,this.name="ReferenceIdPlugin"}return e.prototype.run=function(e,t){e.event.reference_id&&0!==e.event.reference_id.length||"error"!==e.event.type||(e.event.reference_id=d.guid().replace("-","").substring(0,10)),t&&t()},e}();t.ReferenceIdPlugin=c;var l=function(){function e(e,t,n){this.client=e,this.event=t,this.contextData=n||new b}return Object.defineProperty(e.prototype,"log",{get:function(){return this.client.config.log},enumerable:!0,configurable:!0}),e}();t.EventPluginContext=l;var f=function(){function e(){}return e.run=function(e,t){var n=function(n,r){return function(){try{e.cancelled||n.run(e,r)}catch(t){e.cancelled=!0,e.log.error("Error running plugin '"+n.name+"': "+t.message+". Discarding Event.")}e.cancelled&&t&&t(e)}},r=e.client.config.plugins,i=[];t&&(i[r.length]=n({name:"cb",priority:9007199254740992,run:t},null));for(var o=r.length-1;o>-1;o--)i[o]=n(r[o],t||o<r.length-1?i[o+1]:null);i[0]()},e.addDefaultPlugins=function(e){e.addPlugin(new w),e.addPlugin(new T),e.addPlugin(new E),e.addPlugin(new C),e.addPlugin(new k),e.addPlugin(new q),e.addPlugin(new P),e.addPlugin(new R)},e}();t.EventPluginManager=f;var p=function(){function e(e){this._handlers=[],this._processingQueue=!1,this._config=e}return e.prototype.enqueue=function(e){var t=this._config,n=t.log;if(t.enabled)if(t.isValid)if(this.areQueuedItemsDiscarded())n.info("Queue items are currently being discarded. The event will not be queued.");else{this.ensureQueueTimer();var r=t.storage.queue.save(e),i="type="+e.type+" "+(e.reference_id?"refid="+e.reference_id:"");r?n.info("Enqueuing event: "+r+" "+i):n.error("Could not enqueue event "+i)}else n.info("Invalid Api Key. The event will not be queued.");else n.info("Configuration is disabled. The event will not be queued.")},e.prototype.process=function(e){var t=this,n=this._config,r=n.log;if(!this._processingQueue)if(r.info("Processing queue..."),n.enabled)if(n.isValid){this._processingQueue=!0,this.ensureQueueTimer();try{var i=n.storage.queue.get(n.submissionBatchSize);if(!i||0===i.length)return void(this._processingQueue=!1);r.info("Sending "+i.length+" events to "+n.serverUrl+"."),n.submissionClient.postEvents(i.map(function(e){return e.value}),n,function(e){t.processSubmissionResponse(e,i),t.eventsPosted(i.map(function(e){return e.value}),e),r.info("Finished processing queue."),t._processingQueue=!1},e)}catch(e){r.error("Error processing queue: "+e),this.suspendProcessing(),this._processingQueue=!1}}else r.info("Invalid Api Key. The queue will not be processed.");else r.info("Configuration is disabled. The queue will not be processed.")},e.prototype.suspendProcessing=function(e,t,n){var r=this._config;(!e||e<=0)&&(e=5),r.log.info("Suspending processing for "+e+" minutes."),this._suspendProcessingUntil=new Date((new Date).getTime()+6e4*e),t&&(this._discardQueuedItemsUntil=this._suspendProcessingUntil),n&&r.storage.queue.clear()},e.prototype.onEventsPosted=function(e){!!e&&this._handlers.push(e)},e.prototype.eventsPosted=function(e,t){for(var n=0,r=this._handlers;n<r.length;n++){var i=r[n];try{i(e,t)}catch(e){this._config.log.error("Error calling onEventsPosted handler: "+e)}}},e.prototype.areQueuedItemsDiscarded=function(){return this._discardQueuedItemsUntil&&this._discardQueuedItemsUntil>new Date},e.prototype.ensureQueueTimer=function(){var e=this;this._queueTimer||(this._queueTimer=setInterval(function(){return e.onProcessQueue()},1e4))},e.prototype.isQueueProcessingSuspended=function(){return this._suspendProcessingUntil&&this._suspendProcessingUntil>new Date},e.prototype.onProcessQueue=function(){this.isQueueProcessingSuspended()||this._processingQueue||this.process()},e.prototype.processSubmissionResponse=function(e,t){var n=this._config,r=n.log;if(e.success)return r.info("Sent "+t.length+" events."),void this.removeEvents(t);if(e.serviceUnavailable)return r.error("Server returned service unavailable."),void this.suspendProcessing();if(e.paymentRequired)return r.info("Too many events have been submitted, please upgrade your plan."),void this.suspendProcessing(null,!0,!0);if(e.unableToAuthenticate)return r.info("Unable to authenticate, please check your configuration. The event will not be submitted."),this.suspendProcessing(15),void this.removeEvents(t);if(e.notFound||e.badRequest)return r.error("Error while trying to submit data: "+e.message),this.suspendProcessing(240),void this.removeEvents(t);if(e.requestEntityTooLarge){var i="Event submission discarded for being too large.";n.submissionBatchSize>1?(r.error(i+" Retrying with smaller batch size."),n.submissionBatchSize=Math.max(1,Math.round(n.submissionBatchSize/1.5))):(r.error(i+" The event will not be submitted."),this.removeEvents(t))}else e.success||(r.error("Error submitting events: "+(e.message||"Please check the network tab for more info.")),this.suspendProcessing())},e.prototype.removeEvents=function(e){for(var t=0;t<(e||[]).length;t++)this._config.storage.queue.remove(e[t].timestamp)},e}();t.DefaultEventQueue=p;var h=function(){return function(e){void 0===e&&(e=250),this.queue=new U(e),this.settings=new U(1)}}();t.InMemoryStorageProvider=h;var g=function(){function e(){this.configurationVersionHeader="x-exceptionless-configversion"}return e.prototype.postEvents=function(e,t,n,r){var i=JSON.stringify(e),o=this.createRequest(t,"POST",t.serverUrl+"/api/v2/events",i),s=this.createSubmissionCallback(t,n);return t.submissionAdapter.sendRequest(o,s,r)},e.prototype.postUserDescription=function(e,t,n,r){var i=n.serverUrl+"/api/v2/events/by-ref/"+encodeURIComponent(e)+"/user-description",o=JSON.stringify(t),s=this.createRequest(n,"POST",i,o),a=this.createSubmissionCallback(n,r);return n.submissionAdapter.sendRequest(s,a)},e.prototype.getSettings=function(e,t,n){var r=this.createRequest(e,"GET",e.serverUrl+"/api/v2/projects/config?v="+t);return e.submissionAdapter.sendRequest(r,function(t,r,i,o){if(200!==t)return n(new x(!1,null,-1,null,r));var s;try{s=JSON.parse(i)}catch(t){e.log.error("Unable to parse settings: '"+i+"'")}if(!s||isNaN(s.version))return n(new x(!1,null,-1,null,"Invalid configuration settings."));n(new x(!0,s.settings||{},s.version))})},e.prototype.sendHeartbeat=function(e,t,n){var r=this.createRequest(n,"GET",n.heartbeatServerUrl+"/api/v2/events/session/heartbeat?id="+e+"&close="+t);n.submissionAdapter.sendRequest(r)},e.prototype.createRequest=function(e,t,n,r){return void 0===r&&(r=null),{method:t,url:n,data:r,apiKey:e.apiKey,userAgent:e.userAgent}},e.prototype.createSubmissionCallback=function(e,t){var n=this;return function(r,i,o,s){var a=s&&parseInt(s[n.configurationVersionHeader],10);v.checkVersion(a,e),t(new m(r,i))}},e}();t.DefaultSubmissionClient=g;var d=function(){function e(){}return e.addRange=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(e||(e=[]),!t||0===t.length)return e;for(var r=0,i=t;r<i.length;r++){var o=i[r];o&&e.indexOf(o)<0&&e.push(o)}return e},e.getHashCode=function(e){if(!e||0===e.length)return 0;for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t},e.getCookies=function(t,n){for(var r={},i=0,o=(t||"").split("; ");i<o.length;i++){var s=o[i].split("=");e.isMatch(s[0],n)||(r[s[0]]=s[1])}return e.isEmpty(r)?null:r},e.guid=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},e.merge=function(e,t){var n={};for(var r in e||{})e[r]&&(n[r]=e[r]);for(var r in t||{})t[r]&&(n[r]=t[r]);return n},e.parseVersion=function(e){if(!e)return null;var t=/(v?((\d+)\.(\d+)(\.(\d+))?)(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?)/.exec(e);return t&&t.length>0?t[0]:null},e.parseQueryString=function(t,n){if(!t||0===t.length)return null;var r=t.split("&");if(0===r.length)return null;for(var i={},o=0,s=r;o<s.length;o++){var a=s[o].split("=");e.isMatch(a[0],n)||(i[decodeURIComponent(a[0])]=decodeURIComponent(a[1]))}return e.isEmpty(i)?null:i},e.randomNumber=function(){return Math.floor(9007199254740992*Math.random())},e.isMatch=function(t,n,r){if(void 0===r&&(r=!0),!t||"string"!=typeof t)return!1;var i=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;return t=(r?t.toLowerCase():t).replace(i,""),(n||[]).some(function(n){if("string"!=typeof n)return!1;if((n=(r?n.toLowerCase():n).replace(i,"")).length<=0)return!1;var o="*"===n[0];o&&(n=n.slice(1));var s="*"===n[n.length-1];return s&&(n=n.substring(0,n.length-1)),o&&s?n.length<=t.length&&-1!==t.indexOf(n,0):o?e.endsWith(t,n):s?e.startsWith(t,n):t===n})},e.isEmpty=function(e){return null===e||"object"==typeof e&&0===Object.keys(e).length},e.startsWith=function(e,t){return e.substring(0,t.length)===t},e.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},e.stringify=function(t,n,r){function i(t,n){var r=[];return JSON.stringify(t,function(t,i){if(!e.isMatch(t,n)){if("object"==typeof i&&i){if(-1!==r.indexOf(i))return;r.push(i)}return i}})}if("[object Object]"==={}.toString.call(t)){var o={};for(var s in t)t[s]!==t&&(o[s]=t[s]);return i(o,n)}if("[object Array]"==={}.toString.call(t)){for(var a=[],u=0;u<t.length;u++)a[u]=JSON.parse(i(t[u],n));return JSON.stringify(a)}return i(t,n)},e.toBoolean=function(e,t){if(void 0===t&&(t=!1),"boolean"==typeof e)return e;if(null===e||"number"!=typeof e&&"string"!=typeof e)return t;switch((e+"").toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case null:return!1}return t},e}();t.Utils=d;var v=function(){function e(){}return e.onChanged=function(e){!!e&&this._handlers.push(e)},e.applySavedServerSettings=function(e){if(e&&e.isValid){var t=this.getSavedServerSettings(e);e.log.info("Applying saved settings: v"+t.version),e.settings=d.merge(e.settings,t.settings),this.changed(e)}},e.getVersion=function(e){return e&&e.isValid?this.getSavedServerSettings(e).version||0:0},e.checkVersion=function(e,t){var n=this.getVersion(t);e<=n||(t.log.info("Updating settings from v"+n+" to v"+e),this.updateSettings(t,n))},e.updateSettings=function(t,n){var r=this;if(t&&t.enabled){t.isValid?((!n||n<0)&&(n=this.getVersion(t)),t.log.info("Checking for updated settings from: v"+n+"."),t.submissionClient.getSettings(t,n,function(n){if(t&&n&&n.success&&n.settings){t.settings=d.merge(t.settings,n.settings);var i=e.getSavedServerSettings(t);for(var o in i)n.settings[o]||delete t.settings[o];var s={version:n.settingsVersion,settings:n.settings};t.storage.settings.save(s),t.log.info("Updated settings: v"+s.version),r.changed(t)}else t.log.warn("Unable to update settings: "+n.message)})):t.log.error("Unable to update settings: ApiKey is not set.")}},e.changed=function(e){for(var t=0,n=this._handlers;t<n.length;t++){var r=n[t];try{r(e)}catch(t){e.log.error("Error calling onChanged handler: "+t)}}},e.getSavedServerSettings=function(e){var t=e.storage.settings.get()[0];return t&&t.value&&t.value.version&&t.value.settings?t.value:{version:0,settings:{}}},e}();v._handlers=[],t.SettingsManager=v;var m=function(){return function(e,t){this.success=!1,this.badRequest=!1,this.serviceUnavailable=!1,this.paymentRequired=!1,this.unableToAuthenticate=!1,this.notFound=!1,this.requestEntityTooLarge=!1,this.statusCode=e,this.message=t,this.success=e>=200&&e<=299,this.badRequest=400===e,this.serviceUnavailable=503===e,this.paymentRequired=402===e,this.unableToAuthenticate=401===e||403===e,this.notFound=404===e,this.requestEntityTooLarge=413===e}}();t.SubmissionResponse=m;var y=function(){function e(e,t){var n=this;this.config=new S("object"==typeof e?e:{apiKey:e,serverUrl:t}),this.updateSettingsTimer(5e3),this.config.onChanged(function(e){return n.updateSettingsTimer(n._timeoutId>0?5e3:0)}),this.config.queue.onEventsPosted(function(e,t){return n.updateSettingsTimer()})}return e.prototype.createException=function(e){var t=new b;return t.setException(e),this.createEvent(t).setType("error")},e.prototype.submitException=function(e,t){this.createException(e).submit(t)},e.prototype.createUnhandledException=function(e,t){var n=this.createException(e);return n.pluginContextData.markAsUnhandledError(),n.pluginContextData.setSubmissionMethod(t),n},e.prototype.submitUnhandledException=function(e,t,n){this.createUnhandledException(e,t).submit(n)},e.prototype.createFeatureUsage=function(e){return this.createEvent().setType("usage").setSource(e)},e.prototype.submitFeatureUsage=function(e,t){this.createFeatureUsage(e).submit(t)},e.prototype.createLog=function(e,t,n){var r=this.createEvent().setType("log");if(n)r=r.setSource(e).setMessage(t).setProperty("@level",n);else if(t)r=r.setSource(e).setMessage(t);else{r=r.setMessage(e);try{var i=this.createLog.caller;r=r.setSource(i&&i.caller&&i.caller.name)}catch(e){this.config.log.trace("Unable to resolve log source: "+e.message)}}return r},e.prototype.submitLog=function(e,t,n,r){this.createLog(e,t,n).submit(r)},e.prototype.createNotFound=function(e){return this.createEvent().setType("404").setSource(e)},e.prototype.submitNotFound=function(e,t){this.createNotFound(e).submit(t)},e.prototype.createSessionStart=function(){return this.createEvent().setType("session")},e.prototype.submitSessionStart=function(e){this.createSessionStart().submit(e)},e.prototype.submitSessionEnd=function(e){e&&(this.config.log.info("Submitting session end: "+e),this.config.submissionClient.sendHeartbeat(e,!0,this.config))},e.prototype.submitSessionHeartbeat=function(e){e&&(this.config.log.info("Submitting session heartbeat: "+e),this.config.submissionClient.sendHeartbeat(e,!1,this.config))},e.prototype.createEvent=function(e){return new _({date:new Date},this,e)},e.prototype.submitEvent=function(e,t,n){function r(e){return e&&(e.cancelled=!0),!!n&&n(e)}var i=new l(this,e,t);return e?this.config.enabled?(e.data||(e.data={}),e.tags&&e.tags.length||(e.tags=[]),void f.run(i,function(e){var t=e.client.config,r=e.event;e.cancelled||(r.type&&0!==r.type.length||(r.type="log"),r.date||(r.date=new Date),t.queue.enqueue(r),r.reference_id&&r.reference_id.length>0&&(e.log.info("Setting last reference id '"+r.reference_id+"'"),t.lastReferenceIdManager.setLast(r.reference_id))),!!n&&n(e)})):(this.config.log.info("Event submission is currently disabled."),r(i)):r(i)},e.prototype.updateUserEmailAndDescription=function(e,t,n,r){var i=this;if(!(e&&t&&n&&this.config.enabled))return!!r&&r(new m(500,"cancelled"));var o={email_address:t,description:n};this.config.submissionClient.postUserDescription(e,o,this.config,function(t){t.success||i.config.log.error("Failed to submit user email and description for event '"+e+"': "+t.statusCode+" "+t.message),!!r&&r(t)})},e.prototype.getLastReferenceId=function(){return this.config.lastReferenceIdManager.getLast()},e.prototype.updateSettingsTimer=function(e){var t=this;this.config.log.info("Updating settings timer with delay: "+e),this._timeoutId=clearTimeout(this._timeoutId),this._timeoutId=clearInterval(this._intervalId);var n=this.config.updateSettingsWhenIdleInterval;if(n>0){var r=function(){return v.updateSettings(t.config)};e>0&&(this._timeoutId=setTimeout(r,e)),this._intervalId=setInterval(r,n)}},Object.defineProperty(e,"default",{get:function(){return null===e._instance&&(e._instance=new e(null)),e._instance},enumerable:!0,configurable:!0}),e}();y._instance=null,t.ExceptionlessClient=y;var b=function(){function e(){}return e.prototype.setException=function(e){e&&(this["@@_Exception"]=e)},Object.defineProperty(e.prototype,"hasException",{get:function(){return!!this["@@_Exception"]},enumerable:!0,configurable:!0}),e.prototype.getException=function(){return this["@@_Exception"]||null},e.prototype.markAsUnhandledError=function(){this["@@_IsUnhandledError"]=!0},Object.defineProperty(e.prototype,"isUnhandledError",{get:function(){return!!this["@@_IsUnhandledError"]},enumerable:!0,configurable:!0}),e.prototype.setSubmissionMethod=function(e){e&&(this["@@_SubmissionMethod"]=e)},e.prototype.getSubmissionMethod=function(){return this["@@_SubmissionMethod"]||null},e}();t.ContextData=b;var S=function(){function e(t){function n(e){return"function"==typeof e?e(this):e}this.defaultTags=[],this.defaultData={},this.enabled=!0,this.lastReferenceIdManager=new o,this.settings={},this._serverUrl="https://collector.exceptionless.io",this._heartbeatServerUrl="https://heartbeat.exceptionless.io",this._updateSettingsWhenIdleInterval=12e4,this._dataExclusions=[],this._userAgentBotPatterns=[],this._plugins=[],this._handlers=[],t=d.merge(e.defaults,t),this.log=n(t.log)||new a,this.apiKey=t.apiKey,this.serverUrl=t.serverUrl,this.heartbeatServerUrl=t.heartbeatServerUrl,this.updateSettingsWhenIdleInterval=t.updateSettingsWhenIdleInterval,this.environmentInfoCollector=n(t.environmentInfoCollector),this.errorParser=n(t.errorParser),this.lastReferenceIdManager=n(t.lastReferenceIdManager)||new o,this.moduleCollector=n(t.moduleCollector),this.requestInfoCollector=n(t.requestInfoCollector),this.submissionBatchSize=n(t.submissionBatchSize)||50,this.submissionAdapter=n(t.submissionAdapter),this.submissionClient=n(t.submissionClient)||new g,this.storage=n(t.storage)||new h,this.queue=n(t.queue)||new p(this),v.applySavedServerSettings(this),f.addDefaultPlugins(this)}return Object.defineProperty(e.prototype,"apiKey",{get:function(){return this._apiKey},set:function(e){this._apiKey=e||null,this.log.info("apiKey: "+this._apiKey),this.changed()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return!!this.apiKey&&this.apiKey.length>=10},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"serverUrl",{get:function(){return this._serverUrl},set:function(e){e&&(this._serverUrl=e,this._heartbeatServerUrl=e,this.log.info("serverUrl: "+e),this.changed())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"heartbeatServerUrl",{get:function(){return this._heartbeatServerUrl},set:function(e){e&&(this._heartbeatServerUrl=e,this.log.info("heartbeatServerUrl: "+e),this.changed())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateSettingsWhenIdleInterval",{get:function(){return this._updateSettingsWhenIdleInterval},set:function(e){"number"==typeof e&&(e<=0?e=-1:e>0&&e<15e3&&(e=15e3),this._updateSettingsWhenIdleInterval=e,this.log.info("updateSettingsWhenIdleInterval: "+e),this.changed())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataExclusions",{get:function(){var e=this.settings["@@DataExclusions"];return this._dataExclusions.concat(e&&e.split(",")||[])},enumerable:!0,configurable:!0}),e.prototype.addDataExclusions=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._dataExclusions=d.addRange.apply(d,[this._dataExclusions].concat(e))},Object.defineProperty(e.prototype,"userAgentBotPatterns",{get:function(){var e=this.settings["@@UserAgentBotPatterns"];return this._userAgentBotPatterns.concat(e&&e.split(",")||[])},enumerable:!0,configurable:!0}),e.prototype.addUserAgentBotPatterns=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userAgentBotPatterns=d.addRange.apply(d,[this._userAgentBotPatterns].concat(e))},Object.defineProperty(e.prototype,"plugins",{get:function(){return this._plugins.sort(function(e,t){return e.priority<t.priority?-1:e.priority>t.priority?1:0})},enumerable:!0,configurable:!0}),e.prototype.addPlugin=function(e,t,n){var r=n?{name:e,priority:t,run:n}:e;if(r&&r.run){r.name||(r.name=d.guid()),r.priority||(r.priority=0);for(var i=!1,o=this._plugins,s=0,a=o;s<a.length;s++)if(a[s].name===r.name){i=!0;break}i||o.push(r)}else this.log.error("Add plugin failed: Run method not defined")},e.prototype.removePlugin=function(e){var t="string"==typeof e?e:e.name;if(t){for(var n=this._plugins,r=0;r<n.length;r++)if(n[r].name===t){n.splice(r,1);break}}else this.log.error("Remove plugin failed: Plugin name not defined")},e.prototype.setVersion=function(e){e&&(this.defaultData["@version"]=e)},e.prototype.setUserIdentity=function(e,t){var n="string"!=typeof e?e:{identity:e,name:t},r=!n||!n.identity&&!n.name;r?delete this.defaultData["@user"]:this.defaultData["@user"]=n,this.log.info("user identity: "+(r?"null":n.identity))},Object.defineProperty(e.prototype,"userAgent",{get:function(){return"exceptionless-js/1.5.4"},enumerable:!0,configurable:!0}),e.prototype.useSessions=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=3e4),e&&this.addPlugin(new u(t))},e.prototype.useReferenceIds=function(){this.addPlugin(new c)},e.prototype.useLocalStorage=function(){},e.prototype.useDebugLogger=function(){this.log=new s},e.prototype.onChanged=function(e){!!e&&this._handlers.push(e)},e.prototype.changed=function(){for(var e=0,t=this._handlers;e<t.length;e++){var n=t[e];try{n(this)}catch(e){this.log.error("Error calling onChanged handler: "+e)}}},Object.defineProperty(e,"defaults",{get:function(){return null===e._defaultSettings&&(e._defaultSettings={}),e._defaultSettings},enumerable:!0,configurable:!0}),e}();S._defaultSettings=null,t.Configuration=S;var x=function(){return function(e,t,n,r,i){void 0===n&&(n=-1),void 0===r&&(r=null),void 0===i&&(i=null),this.success=!1,this.settingsVersion=-1,this.success=e,this.settings=t,this.settingsVersion=n,this.exception=r,this.message=i}}();t.SettingsResponse=x;var _=function(){function e(e,t,n){this._validIdentifierErrorMessage="must contain between 8 and 100 alphanumeric or '-' characters.",this.target=e,this.client=t,this.pluginContextData=n||new b}return e.prototype.setType=function(e){return e&&(this.target.type=e),this},e.prototype.setSource=function(e){return e&&(this.target.source=e),this},e.prototype.setReferenceId=function(e){if(!this.isValidIdentifier(e))throw new Error("ReferenceId "+this._validIdentifierErrorMessage);return this.target.reference_id=e,this},e.prototype.setEventReference=function(e,t){if(!e)throw new Error("Invalid name");if(!t||!this.isValidIdentifier(t))throw new Error("Id "+this._validIdentifierErrorMessage);return this.setProperty("@ref:"+e,t),this},e.prototype.setMessage=function(e){return e&&(this.target.message=e),this},e.prototype.setGeo=function(e,t){if(e<-90||e>90)throw new Error("Must be a valid latitude value between -90.0 and 90.0.");if(t<-180||t>180)throw new Error("Must be a valid longitude value between -180.0 and 180.0.");return this.target.geo=e+","+t,this},e.prototype.setUserIdentity=function(e,t){var n="string"!=typeof e?e:{identity:e,name:t};return n&&(n.identity||n.name)?(this.setProperty("@user",n),this):this},e.prototype.setUserDescription=function(e,t){return e&&t&&this.setProperty("@user_description",{email_address:e,description:t}),this},e.prototype.setManualStackingInfo=function(e,t){if(e){var n={signature_data:e};t&&(n.title=t),this.setProperty("@stack",n)}return this},e.prototype.setManualStackingKey=function(e,t){if(e){var n={ManualStackingKey:e};this.setManualStackingInfo(n,t)}return this},e.prototype.setValue=function(e){return e&&(this.target.value=e),this},e.prototype.addTags=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.target.tags=d.addRange.apply(d,[this.target.tags].concat(e)),this},e.prototype.setProperty=function(e,t,n,r){if(!e||void 0===t||null==t)return this;this.target.data||(this.target.data={});var i=JSON.parse(d.stringify(t,this.client.config.dataExclusions.concat(r||[]),n));return d.isEmpty(i)||(this.target.data[e]=i),this},e.prototype.markAsCritical=function(e){return e&&this.addTags("Critical"),this},e.prototype.addRequestInfo=function(e){return e&&(this.pluginContextData["@request"]=e),this},e.prototype.submit=function(e){this.client.submitEvent(this.target,this.pluginContextData,e)},e.prototype.isValidIdentifier=function(e){if(!e)return!0;if(e.length<8||e.length>100)return!1;for(var t=0;t<e.length;t++){var n=e.charCodeAt(t),r=n>=48&&n<=57,i=n>=65&&n<=90||n>=97&&n<=122,o=45===n;if(!r&&!i&&!o)return!1}return!0},e}();t.EventBuilder=_;var w=function(){function e(){this.priority=10,this.name="ConfigurationDefaultsPlugin"}return e.prototype.run=function(e,t){for(var n=e.client.config,r=0,i=n.defaultTags||[];r<i.length;r++){var o=i[r];o&&e.event.tags.indexOf(o)<0&&e.event.tags.push(o)}var s=n.defaultData||{};for(var a in s)if(s[a]){var u=JSON.parse(d.stringify(s[a],n.dataExclusions));d.isEmpty(u)||(e.event.data[a]=u)}t&&t()},e}();t.ConfigurationDefaultsPlugin=w;var E=function(){function e(e,t){void 0===e&&(e=function(){return Date.now()}),void 0===t&&(t=3e4);var n=this;this.priority=1010,this.name="DuplicateCheckerPlugin",this._mergedEvents=[],this._processedHashcodes=[],this._getCurrentTime=e,this._interval=t,setInterval(function(){for(;n._mergedEvents.length>0;)n._mergedEvents.shift().resubmit()},t)}return e.prototype.run=function(e,t){var n=this,r=function(e){for(var t=0;e;)e.message&&e.message.length&&(t+=397*t^d.getHashCode(e.message)),e.stack_trace&&e.stack_trace.length&&(t+=397*t^d.getHashCode(JSON.stringify(e.stack_trace))),e=e.inner;return t}(e.event.data["@error"]);if(r){var i=e.event.count||1,o=this._getCurrentTime(),s=this._mergedEvents.filter(function(e){return e.hashCode===r})[0];if(s&&(s.incrementCount(i),s.updateDate(e.event.date),e.log.info("Ignoring duplicate event with hash: "+r),e.cancelled=!0),!e.cancelled&&this._processedHashcodes.some(function(e){return e.hash===r&&e.timestamp>=o-n._interval})&&(e.log.trace("Adding event with hash: "+r),this._mergedEvents.push(new I(r,e,i)),e.cancelled=!0),!e.cancelled)for(e.log.trace("Enqueueing event with hash: "+r+"to cache."),this._processedHashcodes.push({hash:r,timestamp:o});this._processedHashcodes.length>50;)this._processedHashcodes.shift()}t&&t()},e}();t.DuplicateCheckerPlugin=E;var I=function(){function e(e,t,n){this.hashCode=e,this._context=t,this._count=n}return e.prototype.incrementCount=function(e){this._count+=e},e.prototype.resubmit=function(){this._context.event.count=this._count,this._context.client.config.queue.enqueue(this._context.event)},e.prototype.updateDate=function(e){e>this._context.event.date&&(this._context.event.date=e)},e}(),P=function(){function e(){this.priority=80,this.name="EnvironmentInfoPlugin"}return e.prototype.run=function(e,t){var n=e.client.config.environmentInfoCollector;if(!e.event.data["@environment"]&&n){var r=n.getEnvironmentInfo(e);r&&(e.event.data["@environment"]=r)}t&&t()},e}();t.EnvironmentInfoPlugin=P;var T=function(){function e(){this.priority=30,this.name="ErrorPlugin"}return e.prototype.run=function(e,t){var n=["arguments","column","columnNumber","description","fileName","message","name","number","line","lineNumber","opera#sourceloc","sourceId","sourceURL","stack","stackArray","stacktrace"],r=e.contextData.getException();if(r&&(e.event.type="error",!e.event.data["@error"])){var i=e.client.config,o=i.errorParser;if(!o)throw new Error("No error parser was defined.");var s=o.parse(e,r);if(s){var a=JSON.parse(d.stringify(r,i.dataExclusions.concat(n)));d.isEmpty(a)||(s.data||(s.data={}),s.data["@ext"]=a),e.event.data["@error"]=s}}t&&t()},e}();t.ErrorPlugin=T;var C=function(){function e(){this.priority=45,this.name="EventExclusionPlugin"}return e.prototype.run=function(e,t){function n(e){switch((e||"").toLowerCase().trim()){case"trace":case"true":case"1":case"yes":return 0;case"debug":return 1;case"info":return 2;case"warn":return 3;case"error":return 4;case"fatal":return 5;case"off":case"false":case"0":case"no":return 6;default:return-1}}function r(e,t,n,r){if(void 0===e&&(e={}),!t)return r;var i="log"===t,o="@@"+t+":",s=e[o+n];if(s)return i?s:d.toBoolean(s);for(var a in e)if(d.startsWith(a.toLowerCase(),o.toLowerCase())&&d.isMatch(n,[a.substring(o.length)]))return i?e[a]:d.toBoolean(e[a]);return r}var i=e.event,o=e.log,s=e.client.config.settings;if("log"===i.type){var a=function(e,t){return void 0===t&&(t="*"),n(r(e,"log",t,"Trace")+"")}(s,i.source),u=n(i.data["@level"]);u>=0&&(u>5||u<a)&&(o.info("Cancelling log event due to minimum log level."),e.cancelled=!0)}else if("error"===i.type)for(var c=i.data["@error"];!e.cancelled&&c;)!1===r(s,i.type,c.type,!0)&&(o.info("Cancelling error from excluded exception type: "+c.type),e.cancelled=!0),c=c.inner;else!1===r(s,i.type,i.source,!0)&&(o.info("Cancelling event from excluded type: "+i.type+" and source: "+i.source),e.cancelled=!0);t&&t()},e}();t.EventExclusionPlugin=C;var k=function(){function e(){this.priority=50,this.name="ModuleInfoPlugin"}return e.prototype.run=function(e,t){var n=e.client.config.moduleCollector;if(e.event.data["@error"]&&!e.event.data["@error"].modules&&n){var r=n.getModules(e);r&&r.length>0&&(e.event.data["@error"].modules=r)}t&&t()},e}();t.ModuleInfoPlugin=k;var q=function(){function e(){this.priority=70,this.name="RequestInfoPlugin"}return e.prototype.run=function(e,t){var n=e.client.config,r=n.requestInfoCollector;if(!e.event.data["@request"]&&r){var i=r.getRequestInfo(e);i&&(d.isMatch(i.user_agent,n.userAgentBotPatterns)?(e.log.info("Cancelling event as the request user agent matches a known bot pattern"),e.cancelled=!0):e.event.data["@request"]=i)}t&&t()},e}();t.RequestInfoPlugin=q;var R=function(){function e(){this.priority=100,this.name="SubmissionMethodPlugin"}return e.prototype.run=function(e,t){var n=e.contextData.getSubmissionMethod();n&&(e.event.data["@submission_method"]=n),t&&t()},e}();t.SubmissionMethodPlugin=R;var U=function(){function e(e){this.items=[],this.lastTimestamp=0,this.maxItems=e}return e.prototype.save=function(e){if(!e)return null;var t=this.items,n=Math.max(Date.now(),this.lastTimestamp+1),r={timestamp:n,value:e};return t.push(r)>this.maxItems&&t.shift(),this.lastTimestamp=n,r.timestamp},e.prototype.get=function(e){return this.items.slice(0,e)},e.prototype.remove=function(e){for(var t=this.items,n=0;n<t.length;n++)if(t[n].timestamp===e)return void t.splice(n,1)},e.prototype.clear=function(){this.items=[]},e}();t.InMemoryStorage=U;var O=function(){function e(e){this.lastTimestamp=0,this.maxItems=e}return e.prototype.save=function(e,t){if(!e)return null;this.ensureIndex();var n=this.items,r=Math.max(Date.now(),this.lastTimestamp+1),i=this.getKey(r),o=JSON.stringify(e);try{this.write(i,o),this.lastTimestamp=r,n.push(r)>this.maxItems&&this.delete(this.getKey(n.shift()))}catch(e){return null}return r},e.prototype.get=function(e){var t=this;return this.ensureIndex(),this.items.slice(0,e).map(function(e){var n=t.getKey(e);try{var i=t.read(n);return{timestamp:e,value:JSON.parse(i,r)}}catch(e){return t.safeDelete(n),null}}).filter(function(e){return null!=e})},e.prototype.remove=function(e){this.ensureIndex();var t=this.items,n=t.indexOf(e);if(n>=0){var r=this.getKey(e);this.safeDelete(r),t.splice(n,1)}},e.prototype.clear=function(){var e=this;this.items.forEach(function(t){return e.safeDelete(e.getKey(t))}),this.items=[]},e.prototype.ensureIndex=function(){this.items||(this.items=this.createIndex(),this.lastTimestamp=Math.max.apply(Math,[0].concat(this.items))+1)},e.prototype.safeDelete=function(e){try{this.delete(e)}catch(e){}},e.prototype.createIndex=function(){var e=this;try{return this.readAllKeys().map(function(t){try{var n=e.getTimestamp(t);return n||(e.safeDelete(t),null)}catch(n){return e.safeDelete(t),null}}).filter(function(e){return null!=e}).sort(function(e,t){return e-t})}catch(e){return[]}},e}();t.KeyValueStorageBase=O;var M=function(e){function t(t,n,r){void 0===n&&(n="com.exceptionless."),void 0===r&&(r=20);var i=e.call(this,r)||this;return i.prefix=n+t+"-",i}return i(t,e),t.isAvailable=function(){try{var e=window.localStorage,t="__storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(e){return!1}},t.prototype.write=function(e,t){window.localStorage.setItem(e,t)},t.prototype.read=function(e){return window.localStorage.getItem(e)},t.prototype.readAllKeys=function(){var e=this;return Object.keys(window.localStorage).filter(function(t){return 0===t.indexOf(e.prefix)})},t.prototype.delete=function(e){window.localStorage.removeItem(e)},t.prototype.getKey=function(e){return this.prefix+e},t.prototype.getTimestamp=function(e){return parseInt(e.substr(this.prefix.length),10)},t}(O);t.BrowserStorage=M;var A=function(){function e(){}return e.prototype.parse=function(e,t){function r(e){for(var t=[],n=0,r=("string"==typeof e?[e]:e)||[];n<r.length;n++){var i=r[n];t.push({name:i})}return t}var i=e.contextData["@@_TraceKit.StackTrace"]?e.contextData["@@_TraceKit.StackTrace"]:n.computeStackTrace(t,25);if(!i)throw new Error("Unable to parse the exceptions stack trace.");var o="string"==typeof t?t:void 0;return{type:i.name||"Error",message:i.message||t.message||o,stack_trace:function(e){for(var t=[],n=0,i=e;n<i.length;n++){var o=i[n];t.push({name:(o.func||"<anonymous>").replace("?","<anonymous>"),parameters:r(o.args),file_name:o.url,line_number:o.line||0,column:o.column||0})}return t}(i.stack||[])}},e}();t.DefaultErrorParser=A;var D=function(){function e(){}return e.prototype.getModules=function(e){if(!document||!document.getElementsByTagName)return null;var t=[],n=document.getElementsByTagName("script");if(n&&n.length>0)for(var r=0;r<n.length;r++)n[r].src?t.push({module_id:r,name:n[r].src.split("?")[0],version:d.parseVersion(n[r].src)}):n[r].innerHTML&&t.push({module_id:r,name:"Script Tag",version:d.getHashCode(n[r].innerHTML).toString()});return t},e}();t.DefaultModuleCollector=D;var K=function(){function e(){}return e.prototype.getRequestInfo=function(e){if(!document||!navigator||!location)return null;var t=e.client.config.dataExclusions,n={user_agent:navigator.userAgent,is_secure:"https:"===location.protocol,host:location.hostname,port:location.port&&""!==location.port?parseInt(location.port,10):80,path:location.pathname,cookies:d.getCookies(document.cookie,t),query_string:d.parseQueryString(location.search.substring(1),t)};return document.referrer&&""!==document.referrer&&(n.referrer=document.referrer),n},e}();t.DefaultRequestInfoCollector=K;var F=function(){return function(e,t){void 0===t&&(t=250),this.queue=new M("q",e,t),this.settings=new M("settings",e,1)}}();t.BrowserStorageProvider=F;var j=function(){function e(){}return e.prototype.sendRequest=function(e,t,n){function r(n,r){if(!a){a=!0;var s=r.statusText,u=r.responseText,c=r.status;if(n===i||0===c)s="Unable to connect to server.",c=0;else if(n!==o||c){if(c<200||c>299){var l=r.responseBody;if(l&&l.message)s=l.message;else if(u&&-1!==u.indexOf("message"))try{s=JSON.parse(u).message}catch(e){s=u}}}else c="POST"===e.method?202:200;t&&t(c||500,s||"",u,function(e){for(var t={},n=0,r=(e||"").split("\r\n");n<r.length;n++){var i=r[n],o=i.indexOf(": ");o>0&&(t[i.substring(0,o).toLowerCase().replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")]=i.substring(o+2))}return t}(r.getAllResponseHeaders&&r.getAllResponseHeaders()))}}var i="timeout",o="loaded",s="withCredentials",a=!1,u=!1,c=e.url+(-1===e.url.indexOf("?")?"?":"&")+"access_token="+encodeURIComponent(e.apiKey),l=function(e,t,n){var r=new XMLHttpRequest;return s in r?(r.open(t,n,!0),r.setRequestHeader("X-Exceptionless-Client",e),"POST"===t&&r.setRequestHeader("Content-Type","application/json")):"undefined"!=typeof XDomainRequest?(u=!0,(r=new XDomainRequest).open(t,"http:"===location.protocol?n.replace("https:","http:"):n)):r=null,r&&(r.timeout=1e4),r}(e.userAgent,e.method||"POST",c);if(!l)return t&&t(503,"CORS not supported.");s in l&&(l.onreadystatechange=function(){4===l.readyState&&r(o,l)}),l.onprogress=function(){},l.ontimeout=function(){return r(i,l)},l.onerror=function(){return r("error",l)},l.onload=function(){return r(o,l)},u?setTimeout(function(){return l.send(e.data)},500):l.send(e.data)},e}();return t.DefaultSubmissionAdapter=j,function(){if("undefined"!=typeof document){S.prototype.useLocalStorage=function(){M.isAvailable()&&(this.storage=new F,v.applySavedServerSettings(this),this.changed())};var e=S.defaults,t=function(){if(!document||!document.getElementsByTagName)return null;for(var e=document.getElementsByTagName("script"),t=0;t<e.length;t++)if(e[t].src&&e[t].src.indexOf("/exceptionless")>-1)return d.parseQueryString(e[t].src.split("?").pop());return null}();t&&(t.apiKey||t.serverUrl)&&(e.apiKey=t.apiKey,e.serverUrl=t.serverUrl),e.errorParser=new A,e.moduleCollector=new D,e.requestInfoCollector=new K,e.submissionAdapter=new j,n.report.subscribe(function(e,t){var n=y.default.createUnhandledException(new Error(e.message||(t||{}).status||"Script error"),"onerror");n.pluginContextData["@@_TraceKit.StackTrace"]=e,n.submit()}),n.extendToAsynchronousCallbacks(),Error.stackTraceLimit=1/0}}(),t}); -//# sourceMappingURL=exceptionless.min.js.map diff --git a/dist/exceptionless.min.js.map b/dist/exceptionless.min.js.map deleted file mode 100644 index 881f176b..00000000 --- a/dist/exceptionless.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["tracekit.js","exceptionless.ts"],"names":["window","undefined","_has","object","key","Object","prototype","hasOwnProperty","call","_isUndefined","what","TraceKit","_oldTraceKit","_slice","slice","UNKNOWN_FUNCTION","ERROR_TYPES_RE","noConflict","wrap","func","apply","this","arguments","e","report","notifyHandlers","stack","isWindowError","error","exception","collectWindowErrors","i","handlers","inner","traceKitWindowOnError","message","url","lineNo","columnNo","errorObj","lastExceptionStack","computeStackTrace","augmentStackTraceWithInitialElement","processLastException","name","location","line","column","msg","toString","groups","match","guessFunctionName","context","gatherContext","mode","_oldOnerrorHandler","installGlobalHandler","_onErrorHandlerInstalled","onerror","_lastExceptionStack","_lastException","lastException","ex","setTimeout","incomplete","subscribe","handler","push","unsubscribe","length","splice","loadSource","remoteFetching","request","XMLHttpRequest","ActiveXObject","open","send","responseText","getSource","sourceCache","source","domain","document","exec","split","m","reFunctionArgNames","reGuessFunction","linesBefore","Math","floor","linesOfContext","linesAfter","start","max","end","min","escapeRegExp","text","replace","escapeCodeAsRegExpForMatchingInsideHTML","body","findSourceInUrls","re","urls","j","join","substring","index","lastIndexOf","findSourceInLine","fragment","RegExp","findSourceByFunctionBody","parts","result","href","scripts","getElementsByTagName","code","codeRE","eventRE","script","src","args","event","computeStackTraceFromStackProp","submatch","element","chrome","gecko","winjs","geckoEval","chromeEval","lines","reference","isNative","indexOf","columnNumber","computeStackTraceFromStacktraceProp","stacktrace","opera10Regex","opera11Regex","exc","computeStackTraceFromOperaMultiLineMessage","lineRE1","lineRE2","lineRE3","inlineScriptBlocks","s","item","relativeLine","pos","innerText","midline","stackInfo","initial","unshift","partial","computeStackTraceByWalkingCallerChain","depth","functionName","funcs","recursion","curr","caller","input","description","sourceURL","fileName","lineNumber","debug","ofCaller","Error","extendToAsynchronousCallbacks","_helper","fnName","originalFn","originalCallback","define","amd","module","exports","global","parseDate","value","dateRegx","__extends","extendStatics","setPrototypeOf","__proto__","Array","d","b","p","__","constructor","create","DefaultLastReferenceIdManager","_lastReferenceId","getLast","clearLast","setLast","eventId","ConsoleLog","trace","log","info","warn","level","console","NullLog","HeartbeatPlugin","heartbeatInterval","priority","_interval","run","next","clearInterval","_intervalId","user","data","identity","setInterval","client","submitSessionHeartbeat","ReferenceIdPlugin","reference_id","type","Utils","guid","EventPluginContext","contextData","ContextData","defineProperty","get","config","callback","plugin","cancelled","plugins","wrappedPlugins","EventPluginManager","addDefaultPlugins","addPlugin","ConfigurationDefaultsPlugin","ErrorPlugin","DuplicateCheckerPlugin","EventExclusionPlugin","ModuleInfoPlugin","RequestInfoPlugin","EnvironmentInfoPlugin","SubmissionMethodPlugin","DefaultEventQueue","_handlers","_processingQueue","_config","enqueue","enabled","isValid","areQueuedItemsDiscarded","ensureQueueTimer","timestamp","storage","queue","save","logText","process","isAppExiting","_this","events_1","submissionBatchSize","serverUrl","submissionClient","postEvents","map","response","processSubmissionResponse","eventsPosted","suspendProcessing","durationInMinutes","discardFutureQueuedItems","clearQueue","_suspendProcessingUntil","Date","getTime","_discardQueuedItemsUntil","clear","onEventsPosted","events","_i","handlers_1","_queueTimer","onProcessQueue","isQueueProcessingSuspended","success","removeEvents","serviceUnavailable","paymentRequired","unableToAuthenticate","notFound","badRequest","requestEntityTooLarge","round","remove","InMemoryStorageProvider","maxQueueItems","InMemoryStorage","settings","DefaultSubmissionClient","configurationVersionHeader","JSON","stringify","createRequest","cb","createSubmissionCallback","submissionAdapter","sendRequest","postUserDescription","referenceId","path","encodeURIComponent","getSettings","version","status","headers","SettingsResponse","parse","isNaN","sendHeartbeat","sessionIdOrUserId","closeSession","heartbeatServerUrl","method","apiKey","userAgent","settingsVersion","parseInt","checkVersion","SubmissionResponse","target","values","_a","values_1","getHashCode","hash","charCodeAt","getCookies","cookies","exclusions","parts_1","cookie","isMatch","isEmpty","s4","random","merge","defaultValues","parseVersion","matches","query","pairs","pairs_1","decodeURIComponent","patterns","ignoreCase","toLowerCase","trim","some","pattern","startsWithWildcard","endsWithWildcard","endsWith","startsWith","keys","prefix","suffix","maxDepth","stringifyImpl","obj","excludedKeys","cache","flattened","prop","defaultValue","SettingsManager","onChanged","applySavedServerSettings","savedSettings","getSavedServerSettings","changed","getVersion","currentVersion","updateSettings","savedServerSettings","newSettings","unableToUpdateMessage","handlers_2","statusCode","ExceptionlessClient","settingsOrApiKey","Configuration","updateSettingsTimer","_timeoutId","createException","pluginContextData","setException","createEvent","setType","submitException","submit","createUnhandledException","submissionMethod","builder","markAsUnhandledError","setSubmissionMethod","submitUnhandledException","createFeatureUsage","feature","setSource","submitFeatureUsage","createLog","sourceOrMessage","setMessage","setProperty","submitLog","createNotFound","resource","submitNotFound","createSessionStart","submitSessionStart","submitSessionEnd","EventBuilder","date","submitEvent","tags","ctx","ev","lastReferenceIdManager","updateUserEmailAndDescription","email","userDescription","email_address","getLastReferenceId","initialDelay","clearTimeout","updateSettingsWhenIdleInterval","interval","_instance","configurable","enumerable","getException","getSubmissionMethod","configSettings","inject","fn","defaultTags","defaultData","_serverUrl","_heartbeatServerUrl","_updateSettingsWhenIdleInterval","_dataExclusions","_userAgentBotPatterns","_plugins","defaults","environmentInfoCollector","errorParser","moduleCollector","requestInfoCollector","_apiKey","concat","addRange","addUserAgentBotPatterns","userAgentBotPatterns","sort","p1","p2","pluginOrName","pluginAction","pluginExists","plugins_1","removePlugin","setVersion","setUserIdentity","userInfoOrIdentity","userInfo","shouldRemove","useSessions","sendHeartbeats","useReferenceIds","useLocalStorage","useDebugLogger","handlers_3","_defaultSettings","_validIdentifierErrorMessage","setReferenceId","isValidIdentifier","setEventReference","id","setGeo","latitude","longitude","geo","setUserDescription","emailAddress","setManualStackingInfo","signatureData","title","signature_data","setManualStackingKey","manualStackingKey","ManualStackingKey","setValue","addTags","excludedPropertyNames","dataExclusions","markAsCritical","critical","addRequestInfo","isDigit","isLetter","isMinus","defaultTags_1","tag","getCurrentTime","now","_mergedEvents","_processedHashcodes","_getCurrentTime","shift","resubmit","hashCode","stack_trace","count","now_1","merged","filter","incrementCount","updateDate","h","MergedEvent","_context","_count","collector","environmentInfo","getEnvironmentInfo","ignoredProperties","parser","additionalData","getTypeAndSourceSetting","isLog","sourcePrefix","toBoolean","loggerName","getLogLevel","logLevel","minLogLevel","modules","getModules","requestInfo","getRequestInfo","user_agent","maxItems","items","lastTimestamp","limit","KeyValueStorageBase","single","ensureIndex","getKey","json","write","delete","read","safeDelete","forEach","createIndex","readAllKeys","getTimestamp","a","_super","BrowserStorage","namespace","isAvailable","localStorage","x","setItem","removeItem","getItem","substr","DefaultErrorParser","getParameters","parameters","params_1","param","stackTrace","stackFrames","frames","stackFrames_1","frame","file_name","line_number","module_id","innerHTML","DefaultModuleCollector","DefaultRequestInfoCollector","navigator","is_secure","protocol","host","hostname","port","pathname","query_string","parseQueryString","search","referrer","BrowserStorageProvider","xhr","isCompleted","statusText","TIMEOUT","LOADED","responseBody","headerStr","headerPairs_1","headerPair","separator","getAllResponseHeaders","WITH_CREDENTIALS","setRequestHeader","XDomainRequest","useSetTimeout","timeout","onreadystatechange","readyState","complete","onprogress","ontimeout","onload","DefaultSubmissionAdapter","pop","options","default"],"mappings":"CAKA,SAAAA,EAAAC,GAuBA,SAAAC,EAAAC,EAAAC,GACA,OAAAC,OAAAC,UAAAC,eAAAC,KAAAL,EAAAC,GAUA,SAAAK,EAAAC,GACA,YAAA,IAAAA,EAlCA,GAAAV,EAAA,CAIA,IAAAW,KACAC,EAAAZ,EAAAW,SAGAE,KAAAC,MACAC,EAAA,IAGAC,EAAA,0GA+BAL,EAAAM,WAAA,WAEA,OADAjB,EAAAW,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.min.js","sourcesContent":["/**\n * https://github.com/csnover/TraceKit\n * @license MIT\n * @namespace TraceKit\n */\n(function(window, undefined) {\nif (!window) {\n return;\n}\n\nvar TraceKit = {};\nvar _oldTraceKit = window.TraceKit;\n\n// global reference to slice\nvar _slice = [].slice;\nvar UNKNOWN_FUNCTION = '?';\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types\nvar ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;\n\n/**\n * A better form of hasOwnProperty<br/>\n * Example: `_has(MainHostObject, property) === true/false`\n *\n * @param {Object} object to check property\n * @param {string} key to check\n * @return {Boolean} true if the object has the key and it is not inherited\n */\nfunction _has(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\n/**\n * Returns true if the parameter is undefined<br/>\n * Example: `_isUndefined(val) === true/false`\n *\n * @param {*} what Value to check\n * @return {Boolean} true if undefined and false otherwise\n */\nfunction _isUndefined(what) {\n return typeof what === 'undefined';\n}\n\n/**\n * Export TraceKit out to another variable<br/>\n * Example: `var TK = TraceKit.noConflict()`\n * @return {Object} The TraceKit object\n * @memberof TraceKit\n */\nTraceKit.noConflict = function noConflict() {\n window.TraceKit = _oldTraceKit;\n return TraceKit;\n};\n\n/**\n * Wrap any function in a TraceKit reporter<br/>\n * Example: `func = TraceKit.wrap(func);`\n *\n * @param {Function} func Function to be wrapped\n * @return {Function} The wrapped func\n * @memberof TraceKit\n */\nTraceKit.wrap = function traceKitWrapper(func) {\n function wrapped() {\n try {\n return func.apply(this, arguments);\n } catch (e) {\n TraceKit.report(e);\n throw e;\n }\n }\n return wrapped;\n};\n\n/**\n * Cross-browser processing of unhandled exceptions\n *\n * Syntax:\n * ```js\n * TraceKit.report.subscribe(function(stackInfo) { ... })\n * TraceKit.report.unsubscribe(function(stackInfo) { ... })\n * TraceKit.report(exception)\n * try { ...code... } catch(ex) { TraceKit.report(ex); }\n * ```\n *\n * Supports:\n * - Firefox: full stack trace with line numbers, plus column number\n * on top frame; column number is not guaranteed\n * - Opera: full stack trace with line and column numbers\n * - Chrome: full stack trace with line and column numbers\n * - Safari: line and column number for the top frame only; some frames\n * may be missing, and column number is not guaranteed\n * - IE: line and column number for the top frame only; some frames\n * may be missing, and column number is not guaranteed\n *\n * In theory, TraceKit should work on all of the following versions:\n * - IE5.5+ (only 8.0 tested)\n * - Firefox 0.9+ (only 3.5+ tested)\n * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require\n * Exceptions Have Stacktrace to be enabled in opera:config)\n * - Safari 3+ (only 4+ tested)\n * - Chrome 1+ (only 5+ tested)\n * - Konqueror 3.5+ (untested)\n *\n * Requires TraceKit.computeStackTrace.\n *\n * Tries to catch all unhandled exceptions and report them to the\n * subscribed handlers. Please note that TraceKit.report will rethrow the\n * exception. This is REQUIRED in order to get a useful stack trace in IE.\n * If the exception does not reach the top of the browser, you will only\n * get a stack trace from the point where TraceKit.report was called.\n *\n * Handlers receive a TraceKit.StackTrace object as described in the\n * TraceKit.computeStackTrace docs.\n *\n * @memberof TraceKit\n * @namespace\n */\nTraceKit.report = (function reportModuleWrapper() {\n var handlers = [],\n lastException = null,\n lastExceptionStack = null;\n\n /**\n * Add a crash handler.\n * @param {Function} handler\n * @memberof TraceKit.report\n */\n function subscribe(handler) {\n installGlobalHandler();\n handlers.push(handler);\n }\n\n /**\n * Remove a crash handler.\n * @param {Function} handler\n * @memberof TraceKit.report\n */\n function unsubscribe(handler) {\n for (var i = handlers.length - 1; i >= 0; --i) {\n if (handlers[i] === handler) {\n handlers.splice(i, 1);\n }\n }\n\n if (handlers.length === 0) {\n window.onerror = _oldOnerrorHandler;\n _onErrorHandlerInstalled = false;\n }\n }\n\n /**\n * Dispatch stack information to all handlers.\n * @param {TraceKit.StackTrace} stack\n * @param {boolean} isWindowError Is this a top-level window error?\n * @param {Error=} error The error that's being handled (if available, null otherwise)\n * @memberof TraceKit.report\n * @throws An exception if an error occurs while calling an handler.\n */\n function notifyHandlers(stack, isWindowError, error) {\n var exception = null;\n if (isWindowError && !TraceKit.collectWindowErrors) {\n return;\n }\n for (var i in handlers) {\n if (_has(handlers, i)) {\n try {\n handlers[i](stack, isWindowError, error);\n } catch (inner) {\n exception = inner;\n }\n }\n }\n\n if (exception) {\n throw exception;\n }\n }\n\n var _oldOnerrorHandler, _onErrorHandlerInstalled;\n\n /**\n * Ensures all global unhandled exceptions are recorded.\n * Supported by Gecko and IE.\n * @param {string} message Error message.\n * @param {string} url URL of script that generated the exception.\n * @param {(number|string)} lineNo The line number at which the error occurred.\n * @param {(number|string)=} columnNo The column number at which the error occurred.\n * @param {Error=} errorObj The actual Error object.\n * @memberof TraceKit.report\n */\n function traceKitWindowOnError(message, url, lineNo, columnNo, errorObj) {\n var stack = null;\n\n if (lastExceptionStack) {\n TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);\n \t processLastException();\n } else if (errorObj) {\n stack = TraceKit.computeStackTrace(errorObj);\n notifyHandlers(stack, true, errorObj);\n } else {\n var location = {\n 'url': url,\n 'line': lineNo,\n 'column': columnNo\n };\n\n var name;\n var msg = message; // must be new var or will modify original `arguments`\n if ({}.toString.call(message) === '[object String]') {\n var groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n msg = groups[2];\n }\n }\n\n location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line);\n location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line);\n stack = {\n 'name': name,\n 'message': msg,\n 'mode': 'onerror',\n 'stack': [location]\n };\n\n notifyHandlers(stack, true, null);\n }\n\n if (_oldOnerrorHandler) {\n return _oldOnerrorHandler.apply(this, arguments);\n }\n\n return false;\n }\n\n /**\n * Install a global onerror handler\n * @memberof TraceKit.report\n */\n function installGlobalHandler() {\n if (_onErrorHandlerInstalled === true) {\n return;\n }\n\n _oldOnerrorHandler = window.onerror;\n window.onerror = traceKitWindowOnError;\n _onErrorHandlerInstalled = true;\n }\n\n /**\n * Process the most recent exception\n * @memberof TraceKit.report\n */\n function processLastException() {\n var _lastExceptionStack = lastExceptionStack,\n _lastException = lastException;\n lastExceptionStack = null;\n lastException = null;\n notifyHandlers(_lastExceptionStack, false, _lastException);\n }\n\n /**\n * Reports an unhandled Error to TraceKit.\n * @param {Error} ex\n * @memberof TraceKit.report\n * @throws An exception if an incomplete stack trace is detected (old IE browsers).\n */\n function report(ex) {\n if (lastExceptionStack) {\n if (lastException === ex) {\n return; // already caught by an inner catch block, ignore\n } else {\n processLastException();\n }\n }\n\n var stack = TraceKit.computeStackTrace(ex);\n lastExceptionStack = stack;\n lastException = ex;\n\n // If the stack trace is incomplete, wait for 2 seconds for\n // slow slow IE to see if onerror occurs or not before reporting\n // this exception; otherwise, we will end up with an incomplete\n // stack trace\n setTimeout(function () {\n if (lastException === ex) {\n processLastException();\n }\n }, (stack.incomplete ? 2000 : 0));\n\n throw ex; // re-throw to propagate to the top level (and cause window.onerror)\n }\n\n report.subscribe = subscribe;\n report.unsubscribe = unsubscribe;\n return report;\n}());\n\n/**\n * An object representing a single stack frame.\n * @typedef {Object} StackFrame\n * @property {string} url The JavaScript or HTML file URL.\n * @property {string} func The function name, or empty for anonymous functions (if guessing did not work).\n * @property {string[]?} args The arguments passed to the function, if known.\n * @property {number=} line The line number, if known.\n * @property {number=} column The column number, if known.\n * @property {string[]} context An array of source code lines; the middle element corresponds to the correct line#.\n * @memberof TraceKit\n */\n\n/**\n * An object representing a JavaScript stack trace.\n * @typedef {Object} StackTrace\n * @property {string} name The name of the thrown exception.\n * @property {string} message The exception error message.\n * @property {TraceKit.StackFrame[]} stack An array of stack frames.\n * @property {string} mode 'stack', 'stacktrace', 'multiline', 'callers', 'onerror', or 'failed' -- method used to collect the stack trace.\n * @memberof TraceKit\n */\n\n/**\n * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript\n *\n * Syntax:\n * ```js\n * s = TraceKit.computeStackTrace.ofCaller([depth])\n * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)\n * ```\n *\n * Supports:\n * - Firefox: full stack trace with line numbers and unreliable column\n * number on top frame\n * - Opera 10: full stack trace with line and column numbers\n * - Opera 9-: full stack trace with line numbers\n * - Chrome: full stack trace with line and column numbers\n * - Safari: line and column number for the topmost stacktrace element\n * only\n * - IE: no line numbers whatsoever\n *\n * Tries to guess names of anonymous functions by looking for assignments\n * in the source code. In IE and Safari, we have to guess source file names\n * by searching for function bodies inside all page scripts. This will not\n * work for scripts that are loaded cross-domain.\n * Here be dragons: some function names may be guessed incorrectly, and\n * duplicate functions may be mismatched.\n *\n * TraceKit.computeStackTrace should only be used for tracing purposes.\n * Logging of unhandled exceptions should be done with TraceKit.report,\n * which builds on top of TraceKit.computeStackTrace and provides better\n * IE support by utilizing the window.onerror event to retrieve information\n * about the top of the stack.\n *\n * Note: In IE and Safari, no stack trace is recorded on the Error object,\n * so computeStackTrace instead walks its *own* chain of callers.\n * This means that:\n * * in Safari, some methods may be missing from the stack trace;\n * * in IE, the topmost function in the stack trace will always be the\n * caller of computeStackTrace.\n *\n * This is okay for tracing (because you are likely to be calling\n * computeStackTrace from the function you want to be the topmost element\n * of the stack trace anyway), but not okay for logging unhandled\n * exceptions (because your catch block will likely be far away from the\n * inner function that actually caused the exception).\n *\n * Tracing example:\n * ```js\n * function trace(message) {\n * var stackInfo = TraceKit.computeStackTrace.ofCaller();\n * var data = message + \"\\n\";\n * for(var i in stackInfo.stack) {\n * var item = stackInfo.stack[i];\n * data += (item.func || '[anonymous]') + \"() in \" + item.url + \":\" + (item.line || '0') + \"\\n\";\n * }\n * if (window.console)\n * console.info(data);\n * else\n * alert(data);\n * }\n * ```\n * @memberof TraceKit\n * @namespace\n */\nTraceKit.computeStackTrace = (function computeStackTraceWrapper() {\n var debug = false,\n sourceCache = {};\n\n /**\n * Attempts to retrieve source code via XMLHttpRequest, which is used\n * to look up anonymous function names.\n * @param {string} url URL of source code.\n * @return {string} Source contents.\n * @memberof TraceKit.computeStackTrace\n */\n function loadSource(url) {\n if (!TraceKit.remoteFetching) { //Only attempt request if remoteFetching is on.\n return '';\n }\n try {\n var getXHR = function() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {\n // explicitly bubble up the exception if not found\n return new window.ActiveXObject('Microsoft.XMLHTTP');\n }\n };\n\n var request = getXHR();\n request.open('GET', url, false);\n request.send('');\n return request.responseText;\n } catch (e) {\n return '';\n }\n }\n\n /**\n * Retrieves source code from the source code cache.\n * @param {string} url URL of source code.\n * @return {Array.<string>} Source contents.\n * @memberof TraceKit.computeStackTrace\n */\n function getSource(url) {\n if (typeof url !== 'string') {\n return [];\n }\n\n if (!_has(sourceCache, url)) {\n // URL needs to be able to fetched within the acceptable domain. Otherwise,\n // cross-domain errors will be triggered.\n /*\n Regex matches:\n 0 - Full Url\n 1 - Protocol\n 2 - Domain\n 3 - Port (Useful for internal applications)\n 4 - Path\n */\n var source = '';\n var domain = '';\n try { domain = window.document.domain; } catch (e) { }\n var match = /(.*)\\:\\/\\/([^:\\/]+)([:\\d]*)\\/{0,1}([\\s\\S]*)/.exec(url);\n if (match && match[2] === domain) {\n source = loadSource(url);\n }\n sourceCache[url] = source ? source.split('\\n') : [];\n }\n\n return sourceCache[url];\n }\n\n /**\n * Tries to use an externally loaded copy of source code to determine\n * the name of a function by looking at the name of the variable it was\n * assigned to, if any.\n * @param {string} url URL of source code.\n * @param {(string|number)} lineNo Line number in source code.\n * @return {string} The function name, if discoverable.\n * @memberof TraceKit.computeStackTrace\n */\n function guessFunctionName(url, lineNo) {\n var reFunctionArgNames = /function ([^(]*)\\(([^)]*)\\)/,\n reGuessFunction = /['\"]?([0-9A-Za-z$_]+)['\"]?\\s*[:=]\\s*(function|eval|new Function)/,\n line = '',\n maxLines = 10,\n source = getSource(url),\n m;\n\n if (!source.length) {\n return UNKNOWN_FUNCTION;\n }\n\n // Walk backwards from the first line in the function until we find the line which\n // matches the pattern above, which is the function definition\n for (var i = 0; i < maxLines; ++i) {\n line = source[lineNo - i] + line;\n\n if (!_isUndefined(line)) {\n if ((m = reGuessFunction.exec(line))) {\n return m[1];\n } else if ((m = reFunctionArgNames.exec(line))) {\n return m[1];\n }\n }\n }\n\n return UNKNOWN_FUNCTION;\n }\n\n /**\n * Retrieves the surrounding lines from where an exception occurred.\n * @param {string} url URL of source code.\n * @param {(string|number)} line Line number in source code to center around for context.\n * @return {?Array.<string>} Lines of source code.\n * @memberof TraceKit.computeStackTrace\n */\n function gatherContext(url, line) {\n var source = getSource(url);\n\n if (!source.length) {\n return null;\n }\n\n var context = [],\n // linesBefore & linesAfter are inclusive with the offending line.\n // if linesOfContext is even, there will be one extra line\n // *before* the offending line.\n linesBefore = Math.floor(TraceKit.linesOfContext / 2),\n // Add one extra line if linesOfContext is odd\n linesAfter = linesBefore + (TraceKit.linesOfContext % 2),\n start = Math.max(0, line - linesBefore - 1),\n end = Math.min(source.length, line + linesAfter - 1);\n\n line -= 1; // convert to 0-based index\n\n for (var i = start; i < end; ++i) {\n if (!_isUndefined(source[i])) {\n context.push(source[i]);\n }\n }\n\n return context.length > 0 ? context : null;\n }\n\n /**\n * Escapes special characters, except for whitespace, in a string to be\n * used inside a regular expression as a string literal.\n * @param {string} text The string.\n * @return {string} The escaped string literal.\n * @memberof TraceKit.computeStackTrace\n */\n function escapeRegExp(text) {\n return text.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#]/g, '\\\\$&');\n }\n\n /**\n * Escapes special characters in a string to be used inside a regular\n * expression as a string literal. Also ensures that HTML entities will\n * be matched the same as their literal friends.\n * @param {string} body The string.\n * @return {string} The escaped string.\n * @memberof TraceKit.computeStackTrace\n */\n function escapeCodeAsRegExpForMatchingInsideHTML(body) {\n return escapeRegExp(body).replace('<', '(?:<|<)').replace('>', '(?:>|>)').replace('&', '(?:&|&)').replace('\"', '(?:\"|")').replace(/\\s+/g, '\\\\s+');\n }\n\n /**\n * Determines where a code fragment occurs in the source code.\n * @param {RegExp} re The function definition.\n * @param {Array.<string>} urls A list of URLs to search.\n * @return {?Object.<string, (string|number)>} An object containing\n * the url, line, and column number of the defined function.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceInUrls(re, urls) {\n var source, m;\n for (var i = 0, j = urls.length; i < j; ++i) {\n if ((source = getSource(urls[i])).length) {\n source = source.join('\\n');\n if ((m = re.exec(source))) {\n\n return {\n 'url': urls[i],\n 'line': source.substring(0, m.index).split('\\n').length,\n 'column': m.index - source.lastIndexOf('\\n', m.index) - 1\n };\n }\n }\n }\n\n return null;\n }\n\n /**\n * Determines at which column a code fragment occurs on a line of the\n * source code.\n * @param {string} fragment The code fragment.\n * @param {string} url The URL to search.\n * @param {(string|number)} line The line number to examine.\n * @return {?number} The column number.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceInLine(fragment, url, line) {\n var source = getSource(url),\n re = new RegExp('\\\\b' + escapeRegExp(fragment) + '\\\\b'),\n m;\n\n line -= 1;\n\n if (source && source.length > line && (m = re.exec(source[line]))) {\n return m.index;\n }\n\n return null;\n }\n\n /**\n * Determines where a function was defined within the source code.\n * @param {(Function|string)} func A function reference or serialized\n * function definition.\n * @return {?Object.<string, (string|number)>} An object containing\n * the url, line, and column number of the defined function.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceByFunctionBody(func) {\n if (_isUndefined(window && window.document)) {\n return;\n }\n\n var urls = [window.location.href],\n scripts = window.document.getElementsByTagName('script'),\n body,\n code = '' + func,\n codeRE = /^function(?:\\s+([\\w$]+))?\\s*\\(([\\w\\s,]*)\\)\\s*\\{\\s*(\\S[\\s\\S]*\\S)\\s*\\}\\s*$/,\n eventRE = /^function on([\\w$]+)\\s*\\(event\\)\\s*\\{\\s*(\\S[\\s\\S]*\\S)\\s*\\}\\s*$/,\n re,\n parts,\n result;\n\n for (var i = 0; i < scripts.length; ++i) {\n var script = scripts[i];\n if (script.src) {\n urls.push(script.src);\n }\n }\n\n if (!(parts = codeRE.exec(code))) {\n re = new RegExp(escapeRegExp(code).replace(/\\s+/g, '\\\\s+'));\n }\n\n // not sure if this is really necessary, but I don’t have a test\n // corpus large enough to confirm that and it was in the original.\n else {\n var name = parts[1] ? '\\\\s+' + parts[1] : '',\n args = parts[2].split(',').join('\\\\s*,\\\\s*');\n\n body = escapeRegExp(parts[3]).replace(/;$/, ';?'); // semicolon is inserted if the function ends with a comment.replace(/\\s+/g, '\\\\s+');\n re = new RegExp('function' + name + '\\\\s*\\\\(\\\\s*' + args + '\\\\s*\\\\)\\\\s*{\\\\s*' + body + '\\\\s*}');\n }\n\n // look for a normal function definition\n if ((result = findSourceInUrls(re, urls))) {\n return result;\n }\n\n // look for an old-school event handler function\n if ((parts = eventRE.exec(code))) {\n var event = parts[1];\n body = escapeCodeAsRegExpForMatchingInsideHTML(parts[2]);\n\n // look for a function defined in HTML as an onXXX handler\n re = new RegExp('on' + event + '=[\\\\\\'\"]\\\\s*' + body + '\\\\s*[\\\\\\'\"]', 'i');\n\n if ((result = findSourceInUrls(re, urls[0]))) {\n return result;\n }\n\n // look for ???\n re = new RegExp(body);\n\n if ((result = findSourceInUrls(re, urls))) {\n return result;\n }\n }\n\n return null;\n }\n\n // Contents of Exception in various browsers.\n //\n // SAFARI:\n // ex.message = Can't find variable: qq\n // ex.line = 59\n // ex.sourceId = 580238192\n // ex.sourceURL = http://...\n // ex.expressionBeginOffset = 96\n // ex.expressionCaretOffset = 98\n // ex.expressionEndOffset = 98\n // ex.name = ReferenceError\n //\n // FIREFOX:\n // ex.message = qq is not defined\n // ex.fileName = http://...\n // ex.lineNumber = 59\n // ex.columnNumber = 69\n // ex.stack = ...stack trace... (see the example below)\n // ex.name = ReferenceError\n //\n // CHROME:\n // ex.message = qq is not defined\n // ex.name = ReferenceError\n // ex.type = not_defined\n // ex.arguments = ['aa']\n // ex.stack = ...stack trace...\n //\n // INTERNET EXPLORER:\n // ex.message = ...\n // ex.name = ReferenceError\n //\n // OPERA:\n // ex.message = ...message... (see the example below)\n // ex.name = ReferenceError\n // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)\n // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'\n\n /**\n * Computes stack trace information from the stack property.\n * Chrome and Gecko use this property.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromStackProp(ex) {\n if (!ex.stack) {\n return null;\n }\n\n var chrome = /^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\/).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i,\n gecko = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i,\n winjs = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i,\n\n // Used to additionally parse URL/line/column from eval frames\n isEval,\n geckoEval = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i,\n chromeEval = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/,\n\n lines = ex.stack.split('\\n'),\n stack = [],\n submatch,\n parts,\n element,\n reference = /^(.*) is undefined$/.exec(ex.message);\n\n for (var i = 0, j = lines.length; i < j; ++i) {\n if ((parts = chrome.exec(lines[i]))) {\n var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n if (isEval && (submatch = chromeEval.exec(parts[2]))) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n parts[3] = submatch[2]; // line\n parts[4] = submatch[3]; // column\n }\n element = {\n 'url': !isNative ? parts[2] : null,\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': isNative ? [parts[2]] : [],\n 'line': parts[3] ? +parts[3] : null,\n 'column': parts[4] ? +parts[4] : null\n };\n } else if ( parts = winjs.exec(lines[i]) ) {\n element = {\n 'url': parts[2],\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': [],\n 'line': +parts[3],\n 'column': parts[4] ? +parts[4] : null\n };\n } else if ((parts = gecko.exec(lines[i]))) {\n isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval && (submatch = geckoEval.exec(parts[3]))) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = null; // no column when eval\n } else if (i === 0 && !parts[5] && !_isUndefined(ex.columnNumber)) {\n // FireFox uses this awesome columnNumber property for its top frame\n // Also note, Firefox's column number is 0-based and everything else expects 1-based,\n // so adding 1\n // NOTE: this hack doesn't work if top-most frame is eval\n stack[0].column = ex.columnNumber + 1;\n }\n element = {\n 'url': parts[3],\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': parts[2] ? parts[2].split(',') : [],\n 'line': parts[4] ? +parts[4] : null,\n 'column': parts[5] ? +parts[5] : null\n };\n } else {\n continue;\n }\n\n if (!element.func && element.line) {\n element.func = guessFunctionName(element.url, element.line);\n }\n\n element.context = element.line ? gatherContext(element.url, element.line) : null;\n stack.push(element);\n }\n\n if (!stack.length) {\n return null;\n }\n\n if (stack[0] && stack[0].line && !stack[0].column && reference) {\n stack[0].column = findSourceInLine(reference[1], stack[0].url, stack[0].line);\n }\n\n return {\n 'mode': 'stack',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n }\n\n /**\n * Computes stack trace information from the stacktrace property.\n * Opera 10+ uses this property.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromStacktraceProp(ex) {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n var stacktrace = ex.stacktrace;\n if (!stacktrace) {\n return;\n }\n\n var opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i,\n opera11Regex = / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^\\)]+))\\((.*)\\))? in (.*):\\s*$/i,\n lines = stacktrace.split('\\n'),\n stack = [],\n parts;\n\n for (var line = 0; line < lines.length; line += 2) {\n var element = null;\n if ((parts = opera10Regex.exec(lines[line]))) {\n element = {\n 'url': parts[2],\n 'line': +parts[1],\n 'column': null,\n 'func': parts[3],\n 'args':[]\n };\n } else if ((parts = opera11Regex.exec(lines[line]))) {\n element = {\n 'url': parts[6],\n 'line': +parts[1],\n 'column': +parts[2],\n 'func': parts[3] || parts[4],\n 'args': parts[5] ? parts[5].split(',') : []\n };\n }\n\n if (element) {\n if (!element.func && element.line) {\n element.func = guessFunctionName(element.url, element.line);\n }\n if (element.line) {\n try {\n element.context = gatherContext(element.url, element.line);\n } catch (exc) {}\n }\n\n if (!element.context) {\n element.context = [lines[line + 1]];\n }\n\n stack.push(element);\n }\n }\n\n if (!stack.length) {\n return null;\n }\n\n return {\n 'mode': 'stacktrace',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n }\n\n /**\n * NOT TESTED.\n * Computes stack trace information from an error message that includes\n * the stack trace.\n * Opera 9 and earlier use this method if the option to show stack\n * traces is turned on in opera:config.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromOperaMultiLineMessage(ex) {\n // TODO: Clean this function up\n // Opera includes a stack trace into the exception message. An example is:\n //\n // Statement on line 3: Undefined variable: undefinedFunc\n // Backtrace:\n // Line 3 of linked script file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.js: In function zzz\n // undefinedFunc(a);\n // Line 7 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function yyy\n // zzz(x, y, z);\n // Line 3 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function xxx\n // yyy(a, a, a);\n // Line 1 of function script\n // try { xxx('hi'); return false; } catch(ex) { TraceKit.report(ex); }\n // ...\n\n var lines = ex.message.split('\\n');\n if (lines.length < 4) {\n return null;\n }\n\n var lineRE1 = /^\\s*Line (\\d+) of linked script ((?:file|https?|blob)\\S+)(?:: in function (\\S+))?\\s*$/i,\n lineRE2 = /^\\s*Line (\\d+) of inline#(\\d+) script in ((?:file|https?|blob)\\S+)(?:: in function (\\S+))?\\s*$/i,\n lineRE3 = /^\\s*Line (\\d+) of function script\\s*$/i,\n stack = [],\n scripts = (window && window.document && window.document.getElementsByTagName('script')),\n inlineScriptBlocks = [],\n parts;\n\n for (var s in scripts) {\n if (_has(scripts, s) && !scripts[s].src) {\n inlineScriptBlocks.push(scripts[s]);\n }\n }\n\n for (var line = 2; line < lines.length; line += 2) {\n var item = null;\n if ((parts = lineRE1.exec(lines[line]))) {\n item = {\n 'url': parts[2],\n 'func': parts[3],\n 'args': [],\n 'line': +parts[1],\n 'column': null\n };\n } else if ((parts = lineRE2.exec(lines[line]))) {\n item = {\n 'url': parts[3],\n 'func': parts[4],\n 'args': [],\n 'line': +parts[1],\n 'column': null // TODO: Check to see if inline#1 (+parts[2]) points to the script number or column number.\n };\n var relativeLine = (+parts[1]); // relative to the start of the <SCRIPT> block\n var script = inlineScriptBlocks[parts[2] - 1];\n if (script) {\n var source = getSource(item.url);\n if (source) {\n source = source.join('\\n');\n var pos = source.indexOf(script.innerText);\n if (pos >= 0) {\n item.line = relativeLine + source.substring(0, pos).split('\\n').length;\n }\n }\n }\n } else if ((parts = lineRE3.exec(lines[line]))) {\n var url = window.location.href.replace(/#.*$/, '');\n var re = new RegExp(escapeCodeAsRegExpForMatchingInsideHTML(lines[line + 1]));\n var src = findSourceInUrls(re, [url]);\n item = {\n 'url': url,\n 'func': '',\n 'args': [],\n 'line': src ? src.line : parts[1],\n 'column': null\n };\n }\n\n if (item) {\n if (!item.func) {\n item.func = guessFunctionName(item.url, item.line);\n }\n var context = gatherContext(item.url, item.line);\n var midline = (context ? context[Math.floor(context.length / 2)] : null);\n if (context && midline.replace(/^\\s*/, '') === lines[line + 1].replace(/^\\s*/, '')) {\n item.context = context;\n } else {\n // if (context) alert(\"Context mismatch. Correct midline:\\n\" + lines[i+1] + \"\\n\\nMidline:\\n\" + midline + \"\\n\\nContext:\\n\" + context.join(\"\\n\") + \"\\n\\nURL:\\n\" + item.url);\n item.context = [lines[line + 1]];\n }\n stack.push(item);\n }\n }\n if (!stack.length) {\n return null; // could not parse multiline exception message as Opera stack trace\n }\n\n return {\n 'mode': 'multiline',\n 'name': ex.name,\n 'message': lines[0],\n 'stack': stack\n };\n }\n\n /**\n * Adds information about the first frame to incomplete stack traces.\n * Safari and IE require this to get complete data on the first frame.\n * @param {TraceKit.StackTrace} stackInfo Stack trace information from\n * one of the compute* methods.\n * @param {string} url The URL of the script that caused an error.\n * @param {(number|string)} lineNo The line number of the script that\n * caused an error.\n * @param {string=} message The error generated by the browser, which\n * hopefully contains the name of the object that caused the error.\n * @return {boolean} Whether or not the stack information was\n * augmented.\n * @memberof TraceKit.computeStackTrace\n */\n function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {\n var initial = {\n 'url': url,\n 'line': lineNo\n };\n\n if (initial.url && initial.line) {\n stackInfo.incomplete = false;\n\n if (!initial.func) {\n initial.func = guessFunctionName(initial.url, initial.line);\n }\n\n if (!initial.context) {\n initial.context = gatherContext(initial.url, initial.line);\n }\n\n var reference = / '([^']+)' /.exec(message);\n if (reference) {\n initial.column = findSourceInLine(reference[1], initial.url, initial.line);\n }\n\n if (stackInfo.stack.length > 0) {\n if (stackInfo.stack[0].url === initial.url) {\n if (stackInfo.stack[0].line === initial.line) {\n return false; // already in stack trace\n } else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) {\n stackInfo.stack[0].line = initial.line;\n stackInfo.stack[0].context = initial.context;\n return false;\n }\n }\n }\n\n stackInfo.stack.unshift(initial);\n stackInfo.partial = true;\n return true;\n } else {\n stackInfo.incomplete = true;\n }\n\n return false;\n }\n\n /**\n * Computes stack trace information by walking the arguments.caller\n * chain at the time the exception occurred. This will cause earlier\n * frames to be missed but is the only way to get any stack trace in\n * Safari and IE. The top frame is restored by\n * {@link augmentStackTraceWithInitialElement}.\n * @param {Error} ex\n * @return {TraceKit.StackTrace=} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceByWalkingCallerChain(ex, depth) {\n var functionName = /function\\s+([_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*)?\\s*\\(/i,\n stack = [],\n funcs = {},\n recursion = false,\n parts,\n item,\n source;\n\n for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) {\n if (curr === computeStackTrace || curr === TraceKit.report) {\n continue;\n }\n\n item = {\n 'url': null,\n 'func': UNKNOWN_FUNCTION,\n 'args': [],\n 'line': null,\n 'column': null\n };\n\n if (curr.name) {\n item.func = curr.name;\n } else if ((parts = functionName.exec(curr.toString()))) {\n item.func = parts[1];\n }\n\n if (typeof item.func === 'undefined') {\n try {\n item.func = parts.input.substring(0, parts.input.indexOf('{'));\n } catch (e) { }\n }\n\n if ((source = findSourceByFunctionBody(curr))) {\n item.url = source.url;\n item.line = source.line;\n\n if (item.func === UNKNOWN_FUNCTION) {\n item.func = guessFunctionName(item.url, item.line);\n }\n\n var reference = / '([^']+)' /.exec(ex.message || ex.description);\n if (reference) {\n item.column = findSourceInLine(reference[1], source.url, source.line);\n }\n }\n\n if (funcs['' + curr]) {\n recursion = true;\n }else{\n funcs['' + curr] = true;\n }\n\n stack.push(item);\n }\n\n if (depth) {\n stack.splice(0, depth);\n }\n\n var result = {\n 'mode': 'callers',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n augmentStackTraceWithInitialElement(result, ex.sourceURL || ex.fileName, ex.line || ex.lineNumber, ex.message || ex.description);\n return result;\n }\n\n /**\n * Computes a stack trace for an exception.\n * @param {Error} ex\n * @param {(string|number)=} depth\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTrace(ex, depth) {\n var stack = null;\n depth = (depth == null ? 0 : +depth);\n\n try {\n // This must be tried first because Opera 10 *destroys*\n // its stacktrace property if you try to access the stack\n // property first!!\n stack = computeStackTraceFromStacktraceProp(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceFromStackProp(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceFromOperaMultiLineMessage(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n return {\n 'name': ex.name,\n 'message': ex.message,\n 'mode': 'failed'\n };\n }\n\n /**\n * Logs a stacktrace starting from the previous call and working down.\n * @param {(number|string)=} depth How many frames deep to trace.\n * @return {TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceOfCaller(depth) {\n depth = (depth == null ? 0 : +depth) + 1; // \"+ 1\" because \"ofCaller\" should drop one frame\n try {\n throw new Error();\n } catch (ex) {\n return computeStackTrace(ex, depth + 1);\n }\n }\n\n computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;\n computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;\n computeStackTrace.guessFunctionName = guessFunctionName;\n computeStackTrace.gatherContext = gatherContext;\n computeStackTrace.ofCaller = computeStackTraceOfCaller;\n computeStackTrace.getSource = getSource;\n\n return computeStackTrace;\n}());\n\n/**\n * Extends support for global error handling for asynchronous browser\n * functions. Adopted from Closure Library's errorhandler.js\n * @memberof TraceKit\n */\nTraceKit.extendToAsynchronousCallbacks = function () {\n var _helper = function _helper(fnName) {\n var originalFn = window[fnName];\n window[fnName] = function traceKitAsyncExtension() {\n // Make a copy of the arguments\n var args = _slice.call(arguments);\n var originalCallback = args[0];\n if (typeof (originalCallback) === 'function') {\n args[0] = TraceKit.wrap(originalCallback);\n }\n // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it\n // also only supports 2 argument and doesn't care what \"this\" is, so we\n // can just call the original function directly.\n if (originalFn.apply) {\n return originalFn.apply(this, args);\n } else {\n return originalFn(args[0], args[1]);\n }\n };\n };\n\n _helper('setTimeout');\n _helper('setInterval');\n};\n\n//Default options:\nif (!TraceKit.remoteFetching) {\n TraceKit.remoteFetching = true;\n}\nif (!TraceKit.collectWindowErrors) {\n TraceKit.collectWindowErrors = true;\n}\nif (!TraceKit.linesOfContext || TraceKit.linesOfContext < 1) {\n // 5 lines before, the offending line, 5 lines after\n TraceKit.linesOfContext = 11;\n}\n\n// UMD export\nif (typeof define === 'function' && define.amd) {\n define('TraceKit', [], TraceKit);\n} else if (typeof module !== 'undefined' && module.exports && window.module !== module) {\n module.exports = TraceKit;\n} else {\n window.TraceKit = TraceKit;\n}\n\n}(typeof window !== 'undefined' ? window : global));\n","import * as TraceKit from 'TraceKit';\nexport interface ILastReferenceIdManager {\n getLast(): string;\n clearLast(): void;\n setLast(eventId: string): void;\n}\n\nexport interface ILog {\n trace(message: string): void;\n info(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n}\n\n \n\nexport class DefaultLastReferenceIdManager implements ILastReferenceIdManager {\n /**\n * Gets the last event's reference id that was submitted to the server.\n * @type {string}\n * @private\n */\n private _lastReferenceId: string = null;\n\n /**\n * Gets the last event's reference id that was submitted to the server.\n * @returns {string}\n */\n public getLast(): string {\n return this._lastReferenceId;\n }\n\n /**\n * Clears the last event's reference id.\n */\n public clearLast(): void {\n this._lastReferenceId = null;\n }\n\n /**\n * Sets the last event's reference id.\n * @param eventId\n */\n public setLast(eventId: string): void {\n this._lastReferenceId = eventId;\n }\n}\n\n \n\nexport class ConsoleLog implements ILog {\n public trace(message: string): void {\n this.log('debug', message);\n }\n\n public info(message: string): void {\n this.log('info', message);\n }\n\n public warn(message: string): void {\n this.log('warn', message);\n }\n\n public error(message: string): void {\n this.log('error', message);\n }\n\n private log(level: string, message: string) {\n if (console) {\n const msg = `[${level}] Exceptionless: ${message}`;\n\n if (console[level]) {\n console[level](msg);\n } else if (console.log) {\n console[`log`](msg);\n }\n }\n }\n}\n\n \n\nexport class NullLog implements ILog {\n public trace(message: string): void { }\n public info(message: string): void { }\n public warn(message: string): void { }\n public error(message: string): void { }\n}\n\nexport interface IUserInfo {\n identity?: string;\n name?: string;\n data?: any;\n}\n\n \n\nexport class HeartbeatPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = 'HeartbeatPlugin';\n\n private _interval: number;\n private _intervalId: any;\n\n constructor(heartbeatInterval: number = 30000) {\n this._interval = heartbeatInterval;\n }\n\n public run(context: EventPluginContext, next?: () => void): void {\n clearInterval(this._intervalId);\n\n const user: IUserInfo = context.event.data['@user'];\n if (user && user.identity) {\n this._intervalId = setInterval(() => context.client.submitSessionHeartbeat(user.identity), this._interval);\n }\n\n next && next();\n }\n}\n\n \n\nexport class ReferenceIdPlugin implements IEventPlugin {\n public priority: number = 20;\n public name: string = 'ReferenceIdPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n if ((!context.event.reference_id || context.event.reference_id.length === 0) && context.event.type === 'error') {\n context.event.reference_id = Utils.guid().replace('-', '').substring(0, 10);\n }\n\n next && next();\n }\n}\n\n \n\nexport class EventPluginContext {\n public cancelled: boolean;\n public client: ExceptionlessClient;\n public event: IEvent;\n public contextData: ContextData;\n\n constructor(client: ExceptionlessClient, event: IEvent, contextData?: ContextData) {\n this.client = client;\n this.event = event;\n this.contextData = contextData ? contextData : new ContextData();\n }\n\n public get log(): ILog {\n return this.client.config.log;\n }\n}\n\n \n\nexport class EventPluginManager {\n public static run(context: EventPluginContext, callback: (context?: EventPluginContext) => void): void {\n const wrap = (plugin: IEventPlugin, next?: () => void): () => void => {\n return () => {\n try {\n if (!context.cancelled) {\n plugin.run(context, next);\n }\n } catch (ex) {\n context.cancelled = true;\n context.log.error(`Error running plugin '${plugin.name}': ${ex.message}. Discarding Event.`);\n }\n\n if (context.cancelled && !!callback) {\n callback(context);\n }\n };\n };\n\n const plugins: IEventPlugin[] = context.client.config.plugins; // optimization for minifier.\n const wrappedPlugins: Array<() => void> = [];\n if (!!callback) {\n wrappedPlugins[plugins.length] = wrap({ name: 'cb', priority: 9007199254740992, run: callback }, null);\n }\n\n for (let index = plugins.length - 1; index > -1; index--) {\n wrappedPlugins[index] = wrap(plugins[index], !!callback || (index < plugins.length - 1) ? wrappedPlugins[index + 1] : null);\n }\n\n wrappedPlugins[0]();\n }\n\n public static addDefaultPlugins(config: Configuration): void {\n config.addPlugin(new ConfigurationDefaultsPlugin());\n config.addPlugin(new ErrorPlugin());\n config.addPlugin(new DuplicateCheckerPlugin());\n config.addPlugin(new EventExclusionPlugin());\n config.addPlugin(new ModuleInfoPlugin());\n config.addPlugin(new RequestInfoPlugin());\n config.addPlugin(new EnvironmentInfoPlugin());\n config.addPlugin(new SubmissionMethodPlugin());\n }\n}\n\n \n\nexport interface IEventPlugin {\n priority?: number;\n name?: string;\n run(context: EventPluginContext, next?: () => void): void;\n}\n\n \n\nexport class DefaultEventQueue implements IEventQueue {\n /**\n * The configuration object.\n * @type {Configuration}\n * @private\n */\n private _config: Configuration;\n\n /**\n * A list of handlers that will be fired when events are submitted.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(events: IEvent[], response: SubmissionResponse) => void> = [];\n\n /**\n * Suspends processing until the specified time.\n * @type {Date}\n * @private\n */\n private _suspendProcessingUntil: Date;\n\n /**\n * Discards queued items until the specified time.\n * @type {Date}\n * @private\n */\n private _discardQueuedItemsUntil: Date;\n\n /**\n * Returns true if the queue is processing.\n * @type {boolean}\n * @private\n */\n private _processingQueue: boolean = false;\n\n /**\n * Processes the queue every xx seconds.\n * @type {Timer}\n * @private\n */\n private _queueTimer: any;\n\n constructor(config: Configuration) {\n this._config = config;\n }\n\n public enqueue(event: IEvent): void {\n const eventWillNotBeQueued: string = 'The event will not be queued.'; // optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (this.areQueuedItemsDiscarded()) {\n log.info(`Queue items are currently being discarded. ${eventWillNotBeQueued}`);\n return;\n }\n\n this.ensureQueueTimer();\n\n const timestamp = config.storage.queue.save(event);\n const logText = `type=${event.type} ${!!event.reference_id ? 'refid=' + event.reference_id : ''}`;\n if (timestamp) {\n log.info(`Enqueuing event: ${timestamp} ${logText}`);\n } else {\n log.error(`Could not enqueue event ${logText}`);\n }\n }\n\n public process(isAppExiting?: boolean): void {\n const queueNotProcessed: string = 'The queue will not be processed.'; // optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (this._processingQueue) {\n return;\n }\n\n log.info('Processing queue...');\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${queueNotProcessed}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${queueNotProcessed}`);\n return;\n }\n\n this._processingQueue = true;\n this.ensureQueueTimer();\n\n try {\n const events = config.storage.queue.get(config.submissionBatchSize);\n if (!events || events.length === 0) {\n this._processingQueue = false;\n return;\n }\n\n log.info(`Sending ${events.length} events to ${config.serverUrl}.`);\n config.submissionClient.postEvents(events.map((e) => e.value), config, (response: SubmissionResponse) => {\n this.processSubmissionResponse(response, events);\n this.eventsPosted(events.map((e) => e.value), response);\n log.info('Finished processing queue.');\n this._processingQueue = false;\n }, isAppExiting);\n } catch (ex) {\n log.error(`Error processing queue: ${ex}`);\n this.suspendProcessing();\n this._processingQueue = false;\n }\n }\n\n public suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void {\n const config: Configuration = this._config; // Optimization for minifier.\n\n if (!durationInMinutes || durationInMinutes <= 0) {\n durationInMinutes = 5;\n }\n\n config.log.info(`Suspending processing for ${durationInMinutes} minutes.`);\n this._suspendProcessingUntil = new Date(new Date().getTime() + (durationInMinutes * 60000));\n\n if (discardFutureQueuedItems) {\n this._discardQueuedItemsUntil = this._suspendProcessingUntil;\n }\n\n if (clearQueue) {\n // Account is over the limit and we want to ensure that the sample size being sent in will contain newer errors.\n config.storage.queue.clear();\n }\n }\n\n public onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void {\n !!handler && this._handlers.push(handler);\n }\n\n private eventsPosted(events: IEvent[], response: SubmissionResponse) {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(events, response);\n } catch (ex) {\n this._config.log.error(`Error calling onEventsPosted handler: ${ex}`);\n }\n }\n }\n\n private areQueuedItemsDiscarded(): boolean {\n return this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date();\n }\n\n private ensureQueueTimer(): void {\n if (!this._queueTimer) {\n this._queueTimer = setInterval(() => this.onProcessQueue(), 10000);\n }\n }\n\n private isQueueProcessingSuspended(): boolean {\n return this._suspendProcessingUntil && this._suspendProcessingUntil > new Date();\n }\n\n private onProcessQueue(): void {\n if (!this.isQueueProcessingSuspended() && !this._processingQueue) {\n this.process();\n }\n }\n\n private processSubmissionResponse(response: SubmissionResponse, events: IStorageItem[]): void {\n const noSubmission: string = 'The event will not be submitted.'; // Optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (response.success) {\n log.info(`Sent ${events.length} events.`);\n this.removeEvents(events);\n return;\n }\n\n if (response.serviceUnavailable) {\n // You are currently over your rate limit or the servers are under stress.\n log.error('Server returned service unavailable.');\n this.suspendProcessing();\n return;\n }\n\n if (response.paymentRequired) {\n // If the organization over the rate limit then discard the event.\n log.info('Too many events have been submitted, please upgrade your plan.');\n this.suspendProcessing(null, true, true);\n return;\n }\n\n if (response.unableToAuthenticate) {\n // The api key was suspended or could not be authorized.\n log.info(`Unable to authenticate, please check your configuration. ${noSubmission}`);\n this.suspendProcessing(15);\n this.removeEvents(events);\n return;\n }\n\n if (response.notFound || response.badRequest) {\n // The service end point could not be found.\n log.error(`Error while trying to submit data: ${response.message}`);\n this.suspendProcessing(60 * 4);\n this.removeEvents(events);\n return;\n }\n\n if (response.requestEntityTooLarge) {\n const message = 'Event submission discarded for being too large.';\n if (config.submissionBatchSize > 1) {\n log.error(`${message} Retrying with smaller batch size.`);\n config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5));\n } else {\n log.error(`${message} ${noSubmission}`);\n this.removeEvents(events);\n }\n\n return;\n }\n\n if (!response.success) {\n log.error(`Error submitting events: ${response.message || 'Please check the network tab for more info.'}`);\n this.suspendProcessing();\n }\n }\n\n private removeEvents(events: IStorageItem[]) {\n for (let index = 0; index < (events || []).length; index++) {\n this._config.storage.queue.remove(events[index].timestamp);\n }\n }\n}\n\n \n\nexport interface IEventQueue {\n enqueue(event: IEvent): void;\n process(isAppExiting?: boolean): void;\n suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void;\n onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void;\n}\n\n \n\nexport interface IEnvironmentInfoCollector {\n getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo;\n}\n\n \n\nexport interface IErrorParser {\n parse(context: EventPluginContext, exception: Error): IError;\n}\n\n \n\nexport interface IModuleCollector {\n getModules(context: EventPluginContext): IModule[];\n}\n\n \n\nexport interface IRequestInfoCollector {\n getRequestInfo(context: EventPluginContext): IRequestInfo;\n}\n\n \n\nexport class InMemoryStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(maxQueueItems: number = 250) {\n this.queue = new InMemoryStorage(maxQueueItems);\n this.settings = new InMemoryStorage(1);\n }\n\n}\n\n \n\nexport interface IStorageProvider {\n queue: IStorage;\n settings: IStorage;\n}\n\n \n\n// tslint:disable-next-line:prefer-const\ndeclare var XDomainRequest: { new (); create(); };\n\nexport class DefaultSubmissionClient implements ISubmissionClient {\n public configurationVersionHeader: string = 'x-exceptionless-configversion';\n\n public postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void {\n const data = JSON.stringify(events);\n const request = this.createRequest(config, 'POST', `${config.serverUrl}/api/v2/events`, data);\n const cb = this.createSubmissionCallback(config, callback);\n\n return config.submissionAdapter.sendRequest(request, cb, isAppExiting);\n }\n\n public postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void {\n const path = `${config.serverUrl}/api/v2/events/by-ref/${encodeURIComponent(referenceId)}/user-description`;\n const data = JSON.stringify(description);\n const request = this.createRequest(config, 'POST', path, data);\n const cb = this.createSubmissionCallback(config, callback);\n\n return config.submissionAdapter.sendRequest(request, cb);\n }\n\n public getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void {\n const request = this.createRequest(config, 'GET', `${config.serverUrl}/api/v2/projects/config?v=${version}`);\n const cb = (status, message, data?, headers?) => {\n if (status !== 200) {\n return callback(new SettingsResponse(false, null, -1, null, message));\n }\n\n let settings: IClientConfiguration;\n try {\n settings = JSON.parse(data);\n } catch (e) {\n config.log.error(`Unable to parse settings: '${data}'`);\n }\n\n if (!settings || isNaN(settings.version)) {\n return callback(new SettingsResponse(false, null, -1, null, 'Invalid configuration settings.'));\n }\n\n callback(new SettingsResponse(true, settings.settings || {}, settings.version));\n };\n\n return config.submissionAdapter.sendRequest(request, cb);\n }\n\n public sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void {\n const request = this.createRequest(config, 'GET', `${config.heartbeatServerUrl}/api/v2/events/session/heartbeat?id=${sessionIdOrUserId}&close=${closeSession}`);\n config.submissionAdapter.sendRequest(request);\n }\n\n private createRequest(config: Configuration, method: string, url: string, data: string = null): SubmissionRequest {\n return {\n method,\n url,\n data,\n apiKey: config.apiKey,\n userAgent: config.userAgent\n };\n }\n\n private createSubmissionCallback(config: Configuration, callback: (response: SubmissionResponse) => void) {\n return (status, message, data?, headers?) => {\n const settingsVersion: number = headers && parseInt(headers[this.configurationVersionHeader], 10);\n SettingsManager.checkVersion(settingsVersion, config);\n\n callback(new SubmissionResponse(status, message));\n };\n }\n}\n\n \n\nexport interface ISubmissionAdapter {\n sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void;\n}\n\n \n\nexport interface ISubmissionClient {\n postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void;\n postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void;\n getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void;\n sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void;\n}\n\nexport class Utils {\n public static addRange<T>(target: T[], ...values: T[]) {\n if (!target) {\n target = [];\n }\n\n if (!values || values.length === 0) {\n return target;\n }\n\n for (const value of values) {\n if (value && target.indexOf(value) < 0) {\n target.push(value);\n }\n }\n\n return target;\n }\n\n public static getHashCode(source: string): number {\n if (!source || source.length === 0) {\n return 0;\n }\n\n let hash: number = 0;\n for (let index = 0; index < source.length; index++) {\n const character = source.charCodeAt(index);\n hash = ((hash << 5) - hash) + character;\n hash |= 0;\n }\n\n return hash;\n }\n\n public static getCookies(cookies: string, exclusions?: string[]): object {\n const result: object = {};\n\n const parts: string[] = (cookies || '').split('; ');\n for (const part of parts) {\n const cookie: string[] = part.split('=');\n if (!Utils.isMatch(cookie[0], exclusions)) {\n result[cookie[0]] = cookie[1];\n }\n }\n\n return !Utils.isEmpty(result) ? result : null;\n }\n\n public static guid(): string {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n }\n\n // tslint:disable-next-line:ban-types\n public static merge(defaultValues: Object, values: Object) {\n const result: object = {};\n\n for (const key in defaultValues || {}) {\n if (!!defaultValues[key]) {\n result[key] = defaultValues[key];\n }\n }\n\n for (const key in values || {}) {\n if (!!values[key]) {\n result[key] = values[key];\n }\n }\n\n return result;\n }\n\n public static parseVersion(source: string): string {\n if (!source) {\n return null;\n }\n\n const versionRegex = /(v?((\\d+)\\.(\\d+)(\\.(\\d+))?)(?:-([\\dA-Za-z\\-]+(?:\\.[\\dA-Za-z\\-]+)*))?(?:\\+([\\dA-Za-z\\-]+(?:\\.[\\dA-Za-z\\-]+)*))?)/;\n const matches = versionRegex.exec(source);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n\n return null;\n }\n\n public static parseQueryString(query: string, exclusions?: string[]) {\n if (!query || query.length === 0) {\n return null;\n }\n\n const pairs: string[] = query.split('&');\n if (pairs.length === 0) {\n return null;\n }\n\n const result: object = {};\n for (const pair of pairs) {\n const parts = pair.split('=');\n if (!Utils.isMatch(parts[0], exclusions)) {\n result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);\n }\n }\n\n return !Utils.isEmpty(result) ? result : null;\n }\n\n public static randomNumber(): number {\n return Math.floor(Math.random() * 9007199254740992);\n }\n\n /**\n * Checks to see if a value matches a pattern.\n * @param input the value to check against the @pattern.\n * @param pattern The pattern to check, supports wild cards (*).\n */\n public static isMatch(input: string, patterns: string[], ignoreCase: boolean = true): boolean {\n if (!input || typeof input !== 'string') {\n return false;\n }\n\n const trim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n input = (ignoreCase ? input.toLowerCase() : input).replace(trim, '');\n\n return (patterns || []).some((pattern) => {\n if (typeof pattern !== 'string') {\n return false;\n }\n\n pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, '');\n if (pattern.length <= 0) {\n return false;\n }\n\n const startsWithWildcard: boolean = pattern[0] === '*';\n if (startsWithWildcard) {\n pattern = pattern.slice(1);\n }\n\n const endsWithWildcard: boolean = pattern[pattern.length - 1] === '*';\n if (endsWithWildcard) {\n pattern = pattern.substring(0, pattern.length - 1);\n }\n\n if (startsWithWildcard && endsWithWildcard) {\n return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1;\n }\n\n if (startsWithWildcard) {\n return Utils.endsWith(input, pattern);\n }\n\n if (endsWithWildcard) {\n return Utils.startsWith(input, pattern);\n }\n\n return input === pattern;\n });\n }\n\n public static isEmpty(input: object) {\n return input === null || (typeof (input) === 'object' && Object.keys(input).length === 0);\n }\n\n public static startsWith(input: string, prefix: string): boolean {\n return input.substring(0, prefix.length) === prefix;\n }\n\n public static endsWith(input: string, suffix: string): boolean {\n return input.indexOf(suffix, input.length - suffix.length) !== -1;\n }\n\n /**\n * Stringifys an object with optional exclusions and max depth.\n * @param data The data object to add.\n * @param exclusions Any property names that should be excluded.\n * @param maxDepth The max depth of the object to include.\n */\n public static stringify(data: any, exclusions?: string[], maxDepth?: number): string {\n function stringifyImpl(obj: any, excludedKeys: string[]): string {\n const cache: string[] = [];\n return JSON.stringify(obj, (key: string, value: any) => {\n if (Utils.isMatch(key, excludedKeys)) {\n return;\n }\n\n if (typeof value === 'object' && !!value) {\n if (cache.indexOf(value) !== -1) {\n // Circular reference found, discard key\n return;\n }\n\n cache.push(value);\n }\n\n return value;\n });\n }\n\n if (({}).toString.call(data) === '[object Object]') {\n const flattened = {};\n /* tslint:disable:forin */\n for (const prop in data) {\n const value = data[prop];\n if (value === data) {\n continue;\n }\n flattened[prop] = data[prop];\n }\n /* tslint:enable:forin */\n\n return stringifyImpl(flattened, exclusions);\n }\n\n if (({}).toString.call(data) === '[object Array]') {\n const result = [];\n for (let index = 0; index < data.length; index++) {\n result[index] = JSON.parse(stringifyImpl(data[index], exclusions));\n }\n\n return JSON.stringify(result);\n }\n\n return stringifyImpl(data, exclusions);\n }\n\n public static toBoolean(input, defaultValue: boolean = false): boolean {\n if (typeof input === 'boolean') {\n return input;\n }\n\n if (input === null || typeof input !== 'number' && typeof input !== 'string') {\n return defaultValue;\n }\n\n switch ((input + '').toLowerCase().trim()) {\n case 'true': case 'yes': case '1': return true;\n case 'false': case 'no': case '0': case null: return false;\n }\n\n return defaultValue;\n }\n}\n\n \n\nexport interface IConfigurationSettings {\n apiKey?: string;\n serverUrl?: string;\n heartbeatServerUrl?: string;\n updateSettingsWhenIdleInterval?: number;\n environmentInfoCollector?: IEnvironmentInfoCollector;\n errorParser?: IErrorParser;\n lastReferenceIdManager?: ILastReferenceIdManager;\n log?: ILog;\n moduleCollector?: IModuleCollector;\n requestInfoCollector?: IRequestInfoCollector;\n submissionBatchSize?: number;\n submissionClient?: ISubmissionClient;\n submissionAdapter?: ISubmissionAdapter;\n storage?: IStorageProvider;\n queue?: IEventQueue;\n}\n\n \n\ninterface ISettingsWithVersion {\n version: number;\n settings: { [key: string]: string };\n}\n\nexport class SettingsManager {\n /**\n * A list of handlers that will be fired when the settings change.\n * @type {Array}\n * @private\n */\n private static _handlers: Array<(config: Configuration) => void> = [];\n\n public static onChanged(handler: (config: Configuration) => void) {\n !!handler && this._handlers.push(handler);\n }\n\n public static applySavedServerSettings(config: Configuration): void {\n if (!config || !config.isValid) {\n return;\n }\n\n const savedSettings = this.getSavedServerSettings(config);\n config.log.info(`Applying saved settings: v${savedSettings.version}`);\n config.settings = Utils.merge(config.settings, savedSettings.settings);\n this.changed(config);\n }\n\n public static getVersion(config: Configuration): number {\n if (!config || !config.isValid) {\n return 0;\n }\n\n const savedSettings = this.getSavedServerSettings(config);\n return savedSettings.version || 0;\n }\n\n public static checkVersion(version: number, config: Configuration): void {\n const currentVersion: number = this.getVersion(config);\n if (version <= currentVersion) {\n return;\n }\n\n config.log.info(`Updating settings from v${currentVersion} to v${version}`);\n this.updateSettings(config, currentVersion);\n }\n\n public static updateSettings(config: Configuration, version?: number): void {\n if (!config || !config.enabled) {\n return;\n }\n\n const unableToUpdateMessage = 'Unable to update settings';\n if (!config.isValid) {\n config.log.error(`${unableToUpdateMessage}: ApiKey is not set.`);\n return;\n }\n\n if (!version || version < 0) {\n version = this.getVersion(config);\n }\n\n config.log.info(`Checking for updated settings from: v${version}.`);\n config.submissionClient.getSettings(config, version, (response: SettingsResponse) => {\n if (!config || !response || !response.success || !response.settings) {\n config.log.warn(`${unableToUpdateMessage}: ${response.message}`);\n return;\n }\n\n config.settings = Utils.merge(config.settings, response.settings);\n\n // TODO: Store snapshot of settings after reading from config and attributes and use that to revert to defaults.\n // Remove any existing server settings that are not in the new server settings.\n const savedServerSettings = SettingsManager.getSavedServerSettings(config);\n for (const key in savedServerSettings) {\n if (response.settings[key]) {\n continue;\n }\n\n delete config.settings[key];\n }\n\n const newSettings: ISettingsWithVersion = {\n version: response.settingsVersion,\n settings: response.settings\n };\n\n config.storage.settings.save(newSettings);\n\n config.log.info(`Updated settings: v${newSettings.version}`);\n this.changed(config);\n });\n }\n\n private static changed(config: Configuration) {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(config);\n } catch (ex) {\n config.log.error(`Error calling onChanged handler: ${ex}`);\n }\n }\n }\n\n private static getSavedServerSettings(config: Configuration): ISettingsWithVersion {\n const item = config.storage.settings.get()[0];\n if (item && item.value && item.value.version && item.value.settings) {\n return item.value;\n }\n\n return { version: 0, settings: {} };\n }\n}\n\nexport interface IEvent {\n type?: string;\n source?: string;\n date?: Date;\n tags?: string[];\n message?: string;\n geo?: string;\n value?: number;\n data?: any;\n reference_id?: string;\n count?: number;\n}\n\nexport class SubmissionResponse {\n public success: boolean = false;\n public badRequest: boolean = false;\n public serviceUnavailable: boolean = false;\n public paymentRequired: boolean = false;\n public unableToAuthenticate: boolean = false;\n public notFound: boolean = false;\n public requestEntityTooLarge: boolean = false;\n public statusCode: number;\n public message: string;\n\n constructor(statusCode: number, message?: string) {\n this.statusCode = statusCode;\n this.message = message;\n\n this.success = statusCode >= 200 && statusCode <= 299;\n this.badRequest = statusCode === 400;\n this.serviceUnavailable = statusCode === 503;\n this.paymentRequired = statusCode === 402;\n this.unableToAuthenticate = statusCode === 401 || statusCode === 403;\n this.notFound = statusCode === 404;\n this.requestEntityTooLarge = statusCode === 413;\n }\n}\n\n \n\nexport class ExceptionlessClient {\n /**\n * The default ExceptionlessClient instance.\n * @type {ExceptionlessClient}\n * @private\n */\n private static _instance: ExceptionlessClient = null;\n\n public config: Configuration;\n\n private _intervalId: any;\n private _timeoutId: any;\n\n constructor();\n constructor(settings: IConfigurationSettings);\n constructor(apiKey: string, serverUrl?: string);\n constructor(settingsOrApiKey?: IConfigurationSettings | string, serverUrl?: string) {\n this.config = typeof settingsOrApiKey === 'object'\n ? new Configuration(settingsOrApiKey)\n : new Configuration({ apiKey: settingsOrApiKey as string, serverUrl });\n\n this.updateSettingsTimer(5000);\n this.config.onChanged((config) => this.updateSettingsTimer(this._timeoutId > 0 ? 5000 : 0));\n this.config.queue.onEventsPosted((events, response) => this.updateSettingsTimer());\n }\n\n public createException(exception: Error): EventBuilder {\n const pluginContextData = new ContextData();\n pluginContextData.setException(exception);\n return this.createEvent(pluginContextData).setType('error');\n }\n\n public submitException(exception: Error, callback?: (context: EventPluginContext) => void): void {\n this.createException(exception).submit(callback);\n }\n\n public createUnhandledException(exception: Error, submissionMethod?: string): EventBuilder {\n const builder = this.createException(exception);\n builder.pluginContextData.markAsUnhandledError();\n builder.pluginContextData.setSubmissionMethod(submissionMethod);\n\n return builder;\n }\n\n public submitUnhandledException(exception: Error, submissionMethod?: string, callback?: (context: EventPluginContext) => void) {\n this.createUnhandledException(exception, submissionMethod).submit(callback);\n }\n\n public createFeatureUsage(feature: string): EventBuilder {\n return this.createEvent().setType('usage').setSource(feature);\n }\n\n public submitFeatureUsage(feature: string, callback?: (context: EventPluginContext) => void): void {\n this.createFeatureUsage(feature).submit(callback);\n }\n\n public createLog(message: string): EventBuilder;\n public createLog(source: string, message: string): EventBuilder;\n public createLog(source: string, message: string, level: string): EventBuilder;\n public createLog(sourceOrMessage: string, message?: string, level?: string): EventBuilder {\n let builder = this.createEvent().setType('log');\n\n if (level) {\n builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty('@level', level);\n } else if (message) {\n builder = builder.setSource(sourceOrMessage).setMessage(message);\n } else {\n builder = builder.setMessage(sourceOrMessage);\n\n try {\n // TODO: Look into using https: //www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/\n const caller: any = this.createLog.caller;\n builder = builder.setSource(caller && caller.caller && caller.caller.name);\n } catch (e) {\n this.config.log.trace('Unable to resolve log source: ' + e.message);\n }\n }\n\n return builder;\n }\n\n public submitLog(message: string): void;\n public submitLog(source: string, message: string): void;\n public submitLog(source: string, message: string, level: string, callback?: (context: EventPluginContext) => void): void;\n public submitLog(sourceOrMessage: string, message?: string, level?: string, callback?: (context: EventPluginContext) => void): void {\n this.createLog(sourceOrMessage, message, level).submit(callback);\n }\n\n public createNotFound(resource: string): EventBuilder {\n return this.createEvent().setType('404').setSource(resource);\n }\n\n public submitNotFound(resource: string, callback?: (context: EventPluginContext) => void): void {\n this.createNotFound(resource).submit(callback);\n }\n\n public createSessionStart(): EventBuilder {\n return this.createEvent().setType('session');\n }\n\n public submitSessionStart(callback?: (context: EventPluginContext) => void): void {\n this.createSessionStart().submit(callback);\n }\n\n public submitSessionEnd(sessionIdOrUserId: string): void {\n if (sessionIdOrUserId) {\n this.config.log.info(`Submitting session end: ${sessionIdOrUserId}`);\n this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, true, this.config);\n }\n }\n\n public submitSessionHeartbeat(sessionIdOrUserId: string): void {\n if (sessionIdOrUserId) {\n this.config.log.info(`Submitting session heartbeat: ${sessionIdOrUserId}`);\n this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, false, this.config);\n }\n }\n\n public createEvent(pluginContextData?: ContextData): EventBuilder {\n return new EventBuilder({ date: new Date() }, this, pluginContextData);\n }\n\n /**\n * Submits the event to be sent to the server.\n * @param event The event data.\n * @param pluginContextData Any contextual data objects to be used by Exceptionless plugins to gather default information for inclusion in the report information.\n * @param callback\n */\n public submitEvent(event: IEvent, pluginContextData?: ContextData, callback?: (context: EventPluginContext) => void): void {\n function cancelled(context: EventPluginContext) {\n if (!!context) {\n context.cancelled = true;\n }\n\n return !!callback && callback(context);\n }\n\n const context = new EventPluginContext(this, event, pluginContextData);\n if (!event) {\n return cancelled(context);\n }\n\n if (!this.config.enabled) {\n this.config.log.info('Event submission is currently disabled.');\n return cancelled(context);\n }\n\n if (!event.data) {\n event.data = {};\n }\n\n if (!event.tags || !event.tags.length) {\n event.tags = [];\n }\n\n EventPluginManager.run(context, (ctx: EventPluginContext) => {\n const config = ctx.client.config;\n const ev = ctx.event;\n\n if (!ctx.cancelled) {\n // ensure all required data\n if (!ev.type || ev.type.length === 0) {\n ev.type = 'log';\n }\n\n if (!ev.date) {\n ev.date = new Date();\n }\n\n config.queue.enqueue(ev);\n\n if (ev.reference_id && ev.reference_id.length > 0) {\n ctx.log.info(`Setting last reference id '${ev.reference_id}'`);\n config.lastReferenceIdManager.setLast(ev.reference_id);\n }\n }\n\n !!callback && callback(ctx);\n });\n }\n\n /**\n * Updates the user's email address and description of an event for the specified reference id.\n * @param referenceId The reference id of the event to update.\n * @param email The user's email address to set on the event.\n * @param description The user's description of the event.\n * @param callback The submission response.\n */\n public updateUserEmailAndDescription(referenceId: string, email: string, description: string, callback?: (response: SubmissionResponse) => void) {\n if (!referenceId || !email || !description || !this.config.enabled) {\n return !!callback && callback(new SubmissionResponse(500, 'cancelled'));\n }\n\n const userDescription: IUserDescription = { email_address: email, description };\n this.config.submissionClient.postUserDescription(referenceId, userDescription, this.config, (response: SubmissionResponse) => {\n if (!response.success) {\n this.config.log.error(`Failed to submit user email and description for event '${referenceId}': ${response.statusCode} ${response.message}`);\n }\n\n !!callback && callback(response);\n });\n }\n\n /**\n * Gets the last event client id that was submitted to the server.\n * @returns {string} The event client id.\n */\n public getLastReferenceId(): string {\n return this.config.lastReferenceIdManager.getLast();\n }\n\n private updateSettingsTimer(initialDelay?: number) {\n this.config.log.info(`Updating settings timer with delay: ${initialDelay}`);\n\n this._timeoutId = clearTimeout(this._timeoutId);\n this._timeoutId = clearInterval(this._intervalId);\n\n const interval = this.config.updateSettingsWhenIdleInterval;\n if (interval > 0) {\n const updateSettings = () => SettingsManager.updateSettings(this.config);\n if (initialDelay > 0) {\n this._timeoutId = setTimeout(updateSettings, initialDelay);\n }\n\n this._intervalId = setInterval(updateSettings, interval);\n }\n }\n\n /**\n * The default ExceptionlessClient instance.\n * @type {ExceptionlessClient}\n */\n public static get default() {\n if (ExceptionlessClient._instance === null) {\n ExceptionlessClient._instance = new ExceptionlessClient(null);\n }\n\n return ExceptionlessClient._instance;\n }\n}\n\nexport class ContextData {\n public setException(exception: Error): void {\n if (exception) {\n this['@@_Exception'] = exception;\n }\n }\n\n public get hasException(): boolean {\n return !!this['@@_Exception'];\n }\n\n public getException(): Error {\n return this['@@_Exception'] || null;\n }\n\n public markAsUnhandledError(): void {\n this['@@_IsUnhandledError'] = true;\n }\n\n public get isUnhandledError(): boolean {\n return !!this['@@_IsUnhandledError'];\n }\n\n public setSubmissionMethod(method: string): void {\n if (method) {\n this['@@_SubmissionMethod'] = method;\n }\n }\n\n public getSubmissionMethod(): string {\n return this['@@_SubmissionMethod'] || null;\n }\n}\n\nexport interface IEnvironmentInfo {\n processor_count?: number;\n total_physical_memory?: number;\n available_physical_memory?: number;\n command_line?: string;\n process_name?: string;\n process_id?: string;\n process_memory_size?: number;\n thread_id?: string;\n architecture?: string;\n o_s_name?: string;\n o_s_version?: string;\n ip_address?: string;\n machine_name?: string;\n install_id?: string;\n runtime_version?: string;\n data?: any;\n}\n\nexport interface IParameter {\n data?: any;\n generic_arguments?: string[];\n\n name?: string;\n type?: string;\n type_namespace?: string;\n}\n\n \n\nexport interface IMethod {\n data?: any;\n generic_arguments?: string[];\n parameters?: IParameter[];\n\n is_signature_target?: boolean;\n declaring_namespace?: string;\n declaring_type?: string;\n name?: string;\n module_id?: number;\n}\n\n \n\nexport interface IStackFrame extends IMethod {\n file_name?: string;\n line_number?: number;\n column?: number;\n}\n\n \n\nexport interface IInnerError {\n message?: string;\n type?: string;\n code?: string;\n data?: any;\n inner?: IInnerError;\n stack_trace?: IStackFrame[];\n target_method?: IMethod;\n}\n\nexport interface IModule {\n data?: any;\n\n module_id?: number;\n name?: string;\n version?: string;\n is_entry?: boolean;\n created_date?: Date;\n modified_date?: Date;\n}\n\n \n\nexport interface IError extends IInnerError {\n modules?: IModule[];\n}\n\nexport interface IRequestInfo {\n user_agent?: string;\n http_method?: string;\n is_secure?: boolean;\n host?: string;\n port?: number;\n path?: string;\n referrer?: string;\n client_ip_address?: string;\n cookies?: any;\n post_data?: any;\n query_string?: any;\n data?: any;\n}\n\nexport interface IStorageItem {\n timestamp: number;\n value: any;\n}\n\n \n\nexport interface IStorage {\n save(value: any): number;\n get(limit?: number): IStorageItem[];\n remove(timestamp: number): void;\n clear(): void;\n}\n\nexport type SubmissionCallback = (status: number, message: string, data?: string, headers?: object) => void;\n\nexport interface SubmissionRequest {\n apiKey: string;\n userAgent: string;\n method: string;\n url: string;\n data: string;\n}\n\n \n\nexport class Configuration implements IConfigurationSettings {\n /**\n * The default configuration settings that are applied to new configuration instances.\n * @type {IConfigurationSettings}\n * @private\n */\n private static _defaultSettings: IConfigurationSettings = null;\n\n /**\n * A default list of tags that will automatically be added to every\n * report submitted to the server.\n *\n * @type {Array}\n */\n public defaultTags: string[] = [];\n\n /**\n * A default list of of extended data objects that will automatically\n * be added to every report submitted to the server.\n *\n * @type {{}}\n */\n public defaultData: object = {};\n\n /**\n * Whether the client is currently enabled or not. If it is disabled,\n * submitted errors will be discarded and no data will be sent to the server.\n *\n * @returns {boolean}\n */\n public enabled: boolean = true;\n\n public environmentInfoCollector: IEnvironmentInfoCollector;\n public errorParser: IErrorParser;\n public lastReferenceIdManager: ILastReferenceIdManager = new DefaultLastReferenceIdManager();\n public log: ILog;\n public moduleCollector: IModuleCollector;\n public requestInfoCollector: IRequestInfoCollector;\n\n /**\n * Maximum number of events that should be sent to the server together in a batch. (Defaults to 50)\n */\n public submissionBatchSize: number;\n public submissionAdapter: ISubmissionAdapter;\n public submissionClient: ISubmissionClient;\n\n /**\n * Contains a dictionary of custom settings that can be used to control\n * the client and will be automatically updated from the server.\n */\n public settings: object = {};\n\n public storage: IStorageProvider;\n\n public queue: IEventQueue;\n\n /**\n * The API key that will be used when sending events to the server.\n * @type {string}\n * @private\n */\n private _apiKey: string;\n\n /**\n * The server url that all events will be sent to.\n * @type {string}\n * @private\n */\n private _serverUrl: string = 'https://collector.exceptionless.io';\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @type {string}\n * @private\n */\n private _heartbeatServerUrl: string = 'https://heartbeat.exceptionless.io';\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @type {number}\n * @private\n */\n private _updateSettingsWhenIdleInterval: number = 120000;\n\n /**\n * A list of exclusion patterns.\n * @type {Array}\n * @private\n */\n private _dataExclusions: string[] = [];\n\n /**\n * A list of user agent patterns.\n * @type {Array}\n * @private\n */\n private _userAgentBotPatterns: string[] = [];\n\n /**\n * The list of plugins that will be used in this configuration.\n * @type {Array}\n * @private\n */\n private _plugins: IEventPlugin[] = [];\n\n /**\n * A list of handlers that will be fired when configuration changes.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(config: Configuration) => void> = [];\n\n constructor(configSettings?: IConfigurationSettings) {\n function inject(fn: any) {\n return typeof fn === 'function' ? fn(this) : fn;\n }\n\n configSettings = Utils.merge(Configuration.defaults, configSettings);\n\n this.log = inject(configSettings.log) || new NullLog();\n this.apiKey = configSettings.apiKey;\n this.serverUrl = configSettings.serverUrl;\n this.heartbeatServerUrl = configSettings.heartbeatServerUrl;\n this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval;\n\n this.environmentInfoCollector = inject(configSettings.environmentInfoCollector);\n this.errorParser = inject(configSettings.errorParser);\n this.lastReferenceIdManager = inject(configSettings.lastReferenceIdManager) || new DefaultLastReferenceIdManager();\n this.moduleCollector = inject(configSettings.moduleCollector);\n this.requestInfoCollector = inject(configSettings.requestInfoCollector);\n this.submissionBatchSize = inject(configSettings.submissionBatchSize) || 50;\n this.submissionAdapter = inject(configSettings.submissionAdapter);\n this.submissionClient = inject(configSettings.submissionClient) || new DefaultSubmissionClient();\n this.storage = inject(configSettings.storage) || new InMemoryStorageProvider();\n this.queue = inject(configSettings.queue) || new DefaultEventQueue(this);\n\n SettingsManager.applySavedServerSettings(this);\n EventPluginManager.addDefaultPlugins(this);\n }\n\n /**\n * The API key that will be used when sending events to the server.\n * @returns {string}\n */\n public get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * The API key that will be used when sending events to the server.\n * @param value\n */\n public set apiKey(value: string) {\n this._apiKey = value || null;\n this.log.info(`apiKey: ${this._apiKey}`);\n this.changed();\n }\n\n /**\n * Returns true if the apiKey is valid.\n * @returns {boolean}\n */\n public get isValid(): boolean {\n return !!this.apiKey && this.apiKey.length >= 10;\n }\n\n /**\n * The server url that all events will be sent to.\n * @returns {string}\n */\n public get serverUrl(): string {\n return this._serverUrl;\n }\n\n /**\n * The server url that all events will be sent to.\n * @param value\n */\n public set serverUrl(value: string) {\n if (!!value) {\n this._serverUrl = value;\n this._heartbeatServerUrl = value;\n this.log.info(`serverUrl: ${value}`);\n this.changed();\n }\n }\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @returns {string}\n */\n public get heartbeatServerUrl(): string {\n return this._heartbeatServerUrl;\n }\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @param value\n */\n public set heartbeatServerUrl(value: string) {\n if (!!value) {\n this._heartbeatServerUrl = value;\n this.log.info(`heartbeatServerUrl: ${value}`);\n this.changed();\n }\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @returns {number}\n */\n public get updateSettingsWhenIdleInterval(): number {\n return this._updateSettingsWhenIdleInterval;\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @param value\n */\n public set updateSettingsWhenIdleInterval(value: number) {\n if (typeof value !== 'number') {\n return;\n }\n\n if (value <= 0) {\n value = -1;\n } else if (value > 0 && value < 15000) {\n value = 15000;\n }\n\n this._updateSettingsWhenIdleInterval = value;\n this.log.info(`updateSettingsWhenIdleInterval: ${value}`);\n this.changed();\n }\n\n /**\n * A list of exclusion patterns that will automatically remove any data that\n * matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties,\n * form fields, cookies and query parameters from the report.\n *\n * @returns {string[]}\n */\n public get dataExclusions(): string[] {\n const exclusions: string = this.settings['@@DataExclusions'];\n return this._dataExclusions.concat(exclusions && exclusions.split(',') || []);\n }\n\n /**\n * Add items to the list of exclusion patterns that will automatically remove any\n * data that matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties, form\n * fields, cookies and query parameters from the report.\n *\n * @param exclusions\n */\n public addDataExclusions(...exclusions: string[]) {\n this._dataExclusions = Utils.addRange<string>(this._dataExclusions, ...exclusions);\n }\n\n /**\n * A list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n *\n * @returns {string[]}\n */\n public get userAgentBotPatterns(): string[] {\n const patterns: string = this.settings['@@UserAgentBotPatterns'];\n return this._userAgentBotPatterns.concat(patterns && patterns.split(',') || []);\n }\n\n /**\n * Add items to the list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n *\n * @param userAgentBotPatterns\n */\n public addUserAgentBotPatterns(...userAgentBotPatterns: string[]) {\n this._userAgentBotPatterns = Utils.addRange<string>(this._userAgentBotPatterns, ...userAgentBotPatterns);\n }\n\n /**\n * The list of plugins that will be used in this configuration.\n * @returns {IEventPlugin[]}\n */\n public get plugins(): IEventPlugin[] {\n return this._plugins.sort((p1: IEventPlugin, p2: IEventPlugin) => {\n return (p1.priority < p2.priority) ? -1 : (p1.priority > p2.priority) ? 1 : 0;\n });\n }\n\n /**\n * Register an plugin to be used in this configuration.\n * @param plugin\n */\n public addPlugin(plugin: IEventPlugin): void;\n\n /**\n * Register an plugin to be used in this configuration.\n * @param name The name used to identify the plugin.\n * @param priority Used to determine plugins priority.\n * @param pluginAction A function that is run.\n */\n public addPlugin(name: string, priority: number, pluginAction: (context: EventPluginContext, next?: () => void) => void): void;\n public addPlugin(pluginOrName: IEventPlugin | string, priority?: number, pluginAction?: (context: EventPluginContext, next?: () => void) => void): void {\n const plugin: IEventPlugin = !!pluginAction ? { name: pluginOrName as string, priority, run: pluginAction } : pluginOrName as IEventPlugin;\n if (!plugin || !plugin.run) {\n this.log.error('Add plugin failed: Run method not defined');\n return;\n }\n\n if (!plugin.name) {\n plugin.name = Utils.guid();\n }\n\n if (!plugin.priority) {\n plugin.priority = 0;\n }\n\n let pluginExists: boolean = false;\n const plugins = this._plugins; // optimization for minifier.\n for (const p of plugins) {\n if (p.name === plugin.name) {\n pluginExists = true;\n break;\n }\n }\n\n if (!pluginExists) {\n plugins.push(plugin);\n }\n }\n\n /**\n * Remove the plugin from this configuration.\n * @param plugin\n */\n public removePlugin(plugin: IEventPlugin): void;\n\n /**\n * Remove an plugin by key from this configuration.\n * @param name\n */\n public removePlugin(pluginOrName: IEventPlugin | string): void {\n const name: string = typeof pluginOrName === 'string' ? pluginOrName : pluginOrName.name;\n if (!name) {\n this.log.error('Remove plugin failed: Plugin name not defined');\n return;\n }\n\n const plugins = this._plugins; // optimization for minifier.\n for (let index = 0; index < plugins.length; index++) {\n if (plugins[index].name === name) {\n plugins.splice(index, 1);\n break;\n }\n }\n }\n\n /**\n * Automatically set the application version for events.\n * @param version\n */\n public setVersion(version: string): void {\n if (!!version) {\n this.defaultData['@version'] = version;\n }\n }\n\n public setUserIdentity(userInfo: IUserInfo): void;\n public setUserIdentity(identity: string): void;\n public setUserIdentity(identity: string, name: string): void;\n public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): void {\n const USER_KEY: string = '@user'; // optimization for minifier.\n const userInfo: IUserInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n\n const shouldRemove: boolean = !userInfo || (!userInfo.identity && !userInfo.name);\n if (shouldRemove) {\n delete this.defaultData[USER_KEY];\n } else {\n this.defaultData[USER_KEY] = userInfo;\n }\n\n this.log.info(`user identity: ${shouldRemove ? 'null' : userInfo.identity}`);\n }\n\n /**\n * Used to identify the client that sent the events to the server.\n * @returns {string}\n */\n public get userAgent(): string {\n return 'exceptionless-js/1.0.0.0';\n }\n\n /**\n * Automatically send a heartbeat to keep the session alive.\n */\n public useSessions(sendHeartbeats: boolean = true, heartbeatInterval: number = 30000): void {\n if (sendHeartbeats) {\n this.addPlugin(new HeartbeatPlugin(heartbeatInterval));\n }\n }\n\n /**\n * Automatically set a reference id for error events.\n */\n public useReferenceIds(): void {\n this.addPlugin(new ReferenceIdPlugin());\n }\n\n public useLocalStorage(): void {\n // This method will be injected via the prototype.\n }\n\n // TODO: Support a min log level.\n public useDebugLogger(): void {\n this.log = new ConsoleLog();\n }\n\n public onChanged(handler: (config: Configuration) => void) {\n !!handler && this._handlers.push(handler);\n }\n\n private changed() {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(this);\n } catch (ex) {\n this.log.error(`Error calling onChanged handler: ${ex}`);\n }\n }\n }\n\n /**\n * The default configuration settings that are applied to new configuration instances.\n * @returns {IConfigurationSettings}\n */\n public static get defaults() {\n if (Configuration._defaultSettings === null) {\n Configuration._defaultSettings = {};\n }\n\n return Configuration._defaultSettings;\n }\n}\n\nexport interface IUserDescription {\n email_address?: string;\n description?: string;\n data?: any;\n}\n\nexport class SettingsResponse {\n public success: boolean = false;\n public settings: any;\n public settingsVersion: number = -1;\n public message: string;\n public exception: any;\n\n constructor(success: boolean, settings: any, settingsVersion: number = -1, exception: any = null, message: string = null) {\n this.success = success;\n this.settings = settings;\n this.settingsVersion = settingsVersion;\n this.exception = exception;\n this.message = message;\n }\n}\n\n \n\nexport class EventBuilder {\n public target: IEvent;\n public client: ExceptionlessClient;\n public pluginContextData: ContextData;\n\n private _validIdentifierErrorMessage: string = 'must contain between 8 and 100 alphanumeric or \\'-\\' characters.'; // optimization for minifier.\n\n constructor(event: IEvent, client: ExceptionlessClient, pluginContextData?: ContextData) {\n this.target = event;\n this.client = client;\n this.pluginContextData = pluginContextData || new ContextData();\n }\n\n public setType(type: string): EventBuilder {\n if (!!type) {\n this.target.type = type;\n }\n\n return this;\n }\n\n public setSource(source: string): EventBuilder {\n if (!!source) {\n this.target.source = source;\n }\n\n return this;\n }\n\n public setReferenceId(referenceId: string): EventBuilder {\n if (!this.isValidIdentifier(referenceId)) {\n throw new Error(`ReferenceId ${this._validIdentifierErrorMessage}`);\n }\n\n this.target.reference_id = referenceId;\n return this;\n }\n\n /**\n * Allows you to reference a parent event by its ReferenceId property. This allows you to have parent and child relationships.\n * @param name Reference name\n * @param id The reference id that points to a specific event\n * @returns {EventBuilder}\n */\n public setEventReference(name: string, id: string): EventBuilder {\n if (!name) {\n throw new Error('Invalid name');\n }\n\n if (!id || !this.isValidIdentifier(id)) {\n throw new Error(`Id ${this._validIdentifierErrorMessage}`);\n }\n\n this.setProperty('@ref:' + name, id);\n return this;\n }\n\n public setMessage(message: string): EventBuilder {\n if (!!message) {\n this.target.message = message;\n }\n\n return this;\n }\n\n public setGeo(latitude: number, longitude: number): EventBuilder {\n if (latitude < -90.0 || latitude > 90.0) {\n throw new Error('Must be a valid latitude value between -90.0 and 90.0.');\n }\n\n if (longitude < -180.0 || longitude > 180.0) {\n throw new Error('Must be a valid longitude value between -180.0 and 180.0.');\n }\n\n this.target.geo = `${latitude},${longitude}`;\n return this;\n }\n\n public setUserIdentity(userInfo: IUserInfo): EventBuilder;\n public setUserIdentity(identity: string): EventBuilder;\n public setUserIdentity(identity: string, name: string): EventBuilder;\n public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): EventBuilder {\n const userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n if (!userInfo || (!userInfo.identity && !userInfo.name)) {\n return this;\n }\n\n this.setProperty('@user', userInfo);\n return this;\n }\n\n /**\n * Sets the user's description of the event.\n *\n * @param emailAddress The email address\n * @param description The user's description of the event.\n * @returns {EventBuilder}\n */\n public setUserDescription(emailAddress: string, description: string): EventBuilder {\n if (emailAddress && description) {\n this.setProperty('@user_description', { email_address: emailAddress, description });\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting manual\n * stacking information.\n * @param signatureData A dictionary of strings to use for stacking.\n * @param title An optional title for the stacking information.\n * @returns {EventBuilder}\n */\n public setManualStackingInfo(signatureData: any, title?: string) {\n if (signatureData) {\n const stack: IManualStackingInfo = { signature_data: signatureData };\n if (title) {\n stack.title = title;\n }\n\n this.setProperty('@stack', stack);\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting the stacking key.\n * @param manualStackingKey The manual stacking key.\n * @param title An optional title for the stacking information.\n * @returns {EventBuilder}\n */\n public setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder {\n if (manualStackingKey) {\n const data = { ManualStackingKey: manualStackingKey };\n this.setManualStackingInfo(data, title);\n }\n\n return this;\n }\n\n public setValue(value: number): EventBuilder {\n if (!!value) {\n this.target.value = value;\n }\n\n return this;\n }\n\n public addTags(...tags: string[]): EventBuilder {\n this.target.tags = Utils.addRange<string>(this.target.tags, ...tags);\n return this;\n }\n\n /**\n * Adds the object to extended data. Uses @excludedPropertyNames\n * to exclude data from being included in the event.\n * @param name The data object to add.\n * @param value The name of the object to add.\n * @param maxDepth The max depth of the object to include.\n * @param excludedPropertyNames Any property names that should be excluded.\n */\n public setProperty(name: string, value: any, maxDepth?: number, excludedPropertyNames?: string[]): EventBuilder {\n if (!name || (value === undefined || value == null)) {\n return this;\n }\n\n if (!this.target.data) {\n this.target.data = {};\n }\n\n const result = JSON.parse(Utils.stringify(value, this.client.config.dataExclusions.concat(excludedPropertyNames || []), maxDepth));\n if (!Utils.isEmpty(result)) {\n this.target.data[name] = result;\n }\n\n return this;\n }\n\n public markAsCritical(critical: boolean): EventBuilder {\n if (critical) {\n this.addTags('Critical');\n }\n\n return this;\n }\n\n public addRequestInfo(request: object): EventBuilder {\n if (!!request) {\n this.pluginContextData['@request'] = request;\n }\n\n return this;\n }\n\n public submit(callback?: (context: EventPluginContext) => void): void {\n this.client.submitEvent(this.target, this.pluginContextData, callback);\n }\n\n private isValidIdentifier(value: string): boolean {\n if (!value) {\n return true;\n }\n\n if (value.length < 8 || value.length > 100) {\n return false;\n }\n\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index);\n const isDigit = (code >= 48) && (code <= 57);\n const isLetter = ((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122));\n const isMinus = code === 45;\n\n if (!(isDigit || isLetter) && !isMinus) {\n return false;\n }\n }\n\n return true;\n }\n}\n\nexport interface IManualStackingInfo {\n title?: string;\n signature_data?: any;\n}\n\n \n\nexport class ConfigurationDefaultsPlugin implements IEventPlugin {\n public priority: number = 10;\n public name: string = 'ConfigurationDefaultsPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const config = context.client.config;\n const defaultTags: string[] = config.defaultTags || [];\n for (const tag of defaultTags) {\n if (!!tag && context.event.tags.indexOf(tag) < 0) {\n context.event.tags.push(tag);\n }\n }\n\n // tslint:disable-next-line:ban-types\n const defaultData: Object = config.defaultData || {};\n for (const key in defaultData) {\n if (!!defaultData[key]) {\n const result = JSON.parse(Utils.stringify(defaultData[key], config.dataExclusions));\n if (!Utils.isEmpty(result)) {\n context.event.data[key] = result;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class DuplicateCheckerPlugin implements IEventPlugin {\n public priority: number = 1010;\n public name: string = 'DuplicateCheckerPlugin';\n\n private _mergedEvents: MergedEvent[] = [];\n private _processedHashcodes: TimestampedHash[] = [];\n private _getCurrentTime: () => number;\n private _interval: number;\n\n constructor(getCurrentTime: () => number = () => Date.now(), interval: number = 30000) {\n this._getCurrentTime = getCurrentTime;\n this._interval = interval;\n\n setInterval(() => {\n while (this._mergedEvents.length > 0) {\n this._mergedEvents.shift().resubmit();\n }\n }, interval);\n }\n\n public run(context: EventPluginContext, next?: () => void): void {\n function getHashCode(error: IInnerError): number {\n let hashCode = 0;\n while (error) {\n if (error.message && error.message.length) {\n hashCode += (hashCode * 397) ^ Utils.getHashCode(error.message);\n }\n if (error.stack_trace && error.stack_trace.length) {\n hashCode += (hashCode * 397) ^ Utils.getHashCode(JSON.stringify(error.stack_trace));\n }\n error = error.inner;\n }\n\n return hashCode;\n }\n\n const error = context.event.data['@error'];\n const hashCode = getHashCode(error);\n if (hashCode) {\n const count = context.event.count || 1;\n const now = this._getCurrentTime();\n\n const merged = this._mergedEvents.filter((s) => s.hashCode === hashCode)[0];\n if (merged) {\n merged.incrementCount(count);\n merged.updateDate(context.event.date);\n context.log.info('Ignoring duplicate event with hash: ' + hashCode);\n context.cancelled = true;\n }\n\n if (!context.cancelled && this._processedHashcodes.some((h) => h.hash === hashCode && h.timestamp >= (now - this._interval))) {\n context.log.trace('Adding event with hash: ' + hashCode);\n this._mergedEvents.push(new MergedEvent(hashCode, context, count));\n context.cancelled = true;\n }\n\n if (!context.cancelled) {\n context.log.trace('Enqueueing event with hash: ' + hashCode + 'to cache.');\n this._processedHashcodes.push({ hash: hashCode, timestamp: now });\n\n // Only keep the last 50 recent errors.\n while (this._processedHashcodes.length > 50) {\n this._processedHashcodes.shift();\n }\n }\n }\n\n next && next();\n }\n}\n\ninterface TimestampedHash {\n hash: number;\n timestamp: number;\n}\n\nclass MergedEvent {\n public hashCode: number;\n private _count: number;\n private _context: EventPluginContext;\n\n constructor(hashCode: number, context: EventPluginContext, count: number) {\n this.hashCode = hashCode;\n this._context = context;\n this._count = count;\n }\n\n public incrementCount(count: number) {\n this._count += count;\n }\n\n public resubmit() {\n this._context.event.count = this._count;\n this._context.client.config.queue.enqueue(this._context.event);\n }\n\n public updateDate(date) {\n if (date > this._context.event.date) {\n this._context.event.date = date;\n }\n }\n}\n\n \n\nexport class EnvironmentInfoPlugin implements IEventPlugin {\n public priority: number = 80;\n public name: string = 'EnvironmentInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ENVIRONMENT_KEY: string = '@environment'; // optimization for minifier.\n\n const collector = context.client.config.environmentInfoCollector;\n if (!context.event.data[ENVIRONMENT_KEY] && collector) {\n const environmentInfo: IEnvironmentInfo = collector.getEnvironmentInfo(context);\n if (!!environmentInfo) {\n context.event.data[ENVIRONMENT_KEY] = environmentInfo;\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class ErrorPlugin implements IEventPlugin {\n public priority: number = 30;\n public name: string = 'ErrorPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ERROR_KEY: string = '@error'; // optimization for minifier.\n const ignoredProperties: string[] = [\n 'arguments',\n 'column',\n 'columnNumber',\n 'description',\n 'fileName',\n 'message',\n 'name',\n 'number',\n 'line',\n 'lineNumber',\n 'opera#sourceloc',\n 'sourceId',\n 'sourceURL',\n 'stack',\n 'stackArray',\n 'stacktrace'\n ];\n\n const exception = context.contextData.getException();\n if (!!exception) {\n context.event.type = 'error';\n\n if (!context.event.data[ERROR_KEY]) {\n const config = context.client.config;\n const parser = config.errorParser;\n if (!parser) {\n throw new Error('No error parser was defined.');\n }\n\n const result = parser.parse(context, exception);\n if (!!result) {\n const additionalData = JSON.parse(Utils.stringify(exception, config.dataExclusions.concat(ignoredProperties)));\n if (!Utils.isEmpty(additionalData)) {\n if (!result.data) {\n result.data = {};\n }\n result.data['@ext'] = additionalData;\n }\n\n context.event.data[ERROR_KEY] = result;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class EventExclusionPlugin implements IEventPlugin {\n public priority: number = 45;\n public name: string = 'EventExclusionPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n function getLogLevel(level: string): number {\n switch ((level || '').toLowerCase().trim()) {\n case 'trace':\n case 'true':\n case '1':\n case 'yes':\n return 0;\n case 'debug':\n return 1;\n case 'info':\n return 2;\n case 'warn':\n return 3;\n case 'error':\n return 4;\n case 'fatal':\n return 5;\n case 'off':\n case 'false':\n case '0':\n case 'no':\n return 6;\n default:\n return -1;\n }\n }\n\n function getMinLogLevel(settings: object, loggerName: string = '*'): number {\n return getLogLevel(getTypeAndSourceSetting(settings, 'log', loggerName, 'Trace') + '');\n }\n\n // tslint:disable-next-line:ban-types\n function getTypeAndSourceSetting(settings: Object = {}, type: string, source: string, defaultValue?: string|boolean): string|boolean {\n if (!type) {\n return defaultValue;\n }\n\n const isLog = type === 'log';\n const sourcePrefix = `@@${type}:`;\n\n const value = settings[sourcePrefix + source];\n if (value) {\n return !isLog ? Utils.toBoolean(value) : value;\n }\n\n // check for wildcard match\n for (const key in settings) {\n if (Utils.startsWith(key.toLowerCase(), sourcePrefix.toLowerCase()) && Utils.isMatch(source, [key.substring(sourcePrefix.length)])) {\n return !isLog ? Utils.toBoolean(settings[key]) : settings[key];\n }\n }\n\n return defaultValue;\n }\n\n const ev = context.event;\n const log = context.log;\n const settings = context.client.config.settings;\n\n if (ev.type === 'log') {\n const minLogLevel = getMinLogLevel(settings, ev.source);\n const logLevel = getLogLevel(ev.data['@level']);\n\n if (logLevel >= 0 && (logLevel > 5 || logLevel < minLogLevel)) {\n log.info('Cancelling log event due to minimum log level.');\n context.cancelled = true;\n }\n } else if (ev.type === 'error') {\n let error: IInnerError = ev.data['@error'];\n while (!context.cancelled && error) {\n if (getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) {\n log.info(`Cancelling error from excluded exception type: ${error.type}`);\n context.cancelled = true;\n }\n\n error = error.inner;\n }\n } else if (getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) {\n log.info(`Cancelling event from excluded type: ${ev.type} and source: ${ev.source}`);\n context.cancelled = true;\n }\n\n next && next();\n }\n}\n\n \n\nexport class ModuleInfoPlugin implements IEventPlugin {\n public priority: number = 50;\n public name: string = 'ModuleInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ERROR_KEY: string = '@error'; // optimization for minifier.\n\n const collector = context.client.config.moduleCollector;\n if (context.event.data[ERROR_KEY] && !context.event.data['@error'].modules && !!collector) {\n const modules: IModule[] = collector.getModules(context);\n if (modules && modules.length > 0) {\n context.event.data[ERROR_KEY].modules = modules;\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class RequestInfoPlugin implements IEventPlugin {\n public priority: number = 70;\n public name: string = 'RequestInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const REQUEST_KEY: string = '@request'; // optimization for minifier.\n\n const config = context.client.config;\n const collector = config.requestInfoCollector;\n if (!context.event.data[REQUEST_KEY] && !!collector) {\n const requestInfo: IRequestInfo = collector.getRequestInfo(context);\n if (!!requestInfo) {\n if (Utils.isMatch(requestInfo.user_agent, config.userAgentBotPatterns)) {\n context.log.info('Cancelling event as the request user agent matches a known bot pattern');\n context.cancelled = true;\n } else {\n context.event.data[REQUEST_KEY] = requestInfo;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class SubmissionMethodPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = 'SubmissionMethodPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const submissionMethod: string = context.contextData.getSubmissionMethod();\n if (!!submissionMethod) {\n context.event.data['@submission_method'] = submissionMethod;\n }\n\n next && next();\n }\n}\n\n \n\nexport class InMemoryStorage implements IStorage {\n private maxItems: number;\n private items: IStorageItem[] = [];\n private lastTimestamp: number = 0;\n\n constructor(maxItems: number) {\n this.maxItems = maxItems;\n }\n\n public save(value: any): number {\n if (!value) {\n return null;\n }\n\n const items = this.items;\n const timestamp = Math.max(Date.now(), this.lastTimestamp + 1);\n const item = { timestamp, value };\n\n if (items.push(item) > this.maxItems) {\n items.shift();\n }\n\n this.lastTimestamp = timestamp;\n return item.timestamp;\n }\n\n public get(limit?: number): IStorageItem[] {\n return this.items.slice(0, limit);\n }\n\n public remove(timestamp: number): void {\n const items = this.items;\n for (let i = 0; i < items.length; i++) {\n if (items[i].timestamp === timestamp) {\n items.splice(i, 1);\n return;\n }\n }\n }\n\n public clear(): void {\n this.items = [];\n }\n}\n\nexport interface IClientConfiguration {\n settings: object;\n version: number;\n}\n\n \n\nexport abstract class KeyValueStorageBase implements IStorage {\n private maxItems: number;\n private items: number[];\n private lastTimestamp: number = 0;\n\n constructor(maxItems) {\n this.maxItems = maxItems;\n }\n\n public save(value: any, single?: boolean): number {\n if (!value) {\n return null;\n }\n\n this.ensureIndex();\n\n const items = this.items;\n const timestamp = Math.max(Date.now(), this.lastTimestamp + 1);\n const key = this.getKey(timestamp);\n const json = JSON.stringify(value);\n\n try {\n this.write(key, json);\n this.lastTimestamp = timestamp;\n if (items.push(timestamp) > this.maxItems) {\n this.delete(this.getKey(items.shift()));\n }\n } catch (e) {\n return null;\n }\n\n return timestamp;\n }\n\n public get(limit?: number): IStorageItem[] {\n this.ensureIndex();\n\n return this.items.slice(0, limit)\n .map((timestamp) => {\n // Read and parse item for this timestamp\n const key = this.getKey(timestamp);\n try {\n const json = this.read(key);\n const value = JSON.parse(json, parseDate);\n return { timestamp, value };\n } catch (error) {\n // Something went wrong - try to delete the cause.\n this.safeDelete(key);\n return null;\n }\n })\n .filter((item) => item != null);\n }\n\n public remove(timestamp: number): void {\n this.ensureIndex();\n\n const items = this.items;\n const index = items.indexOf(timestamp);\n if (index >= 0) {\n const key = this.getKey(timestamp);\n this.safeDelete(key);\n items.splice(index, 1);\n }\n }\n\n public clear(): void {\n this.items.forEach((item) => this.safeDelete(this.getKey(item)));\n this.items = [];\n }\n\n protected abstract write(key: string, value: string): void;\n protected abstract read(key: string): string;\n protected abstract readAllKeys(): string[];\n protected abstract delete(key: string);\n protected abstract getKey(timestamp: number): string;\n protected abstract getTimestamp(key: string): number;\n\n private ensureIndex() {\n if (!this.items) {\n this.items = this.createIndex();\n this.lastTimestamp = Math.max(0, ...this.items) + 1;\n }\n }\n\n private safeDelete(key: string): void {\n try {\n this.delete(key);\n } catch (error) {\n }\n }\n\n private createIndex() {\n try {\n const keys = this.readAllKeys();\n return keys.map((key) => {\n try {\n const timestamp = this.getTimestamp(key);\n if (!timestamp) {\n this.safeDelete(key);\n return null;\n }\n return timestamp;\n } catch (error) {\n this.safeDelete(key);\n return null;\n }\n }).filter((timestamp) => timestamp != null)\n .sort((a, b) => a - b);\n } catch (error) {\n return [];\n }\n }\n}\n\nfunction parseDate(key, value) {\n const dateRegx = /\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)/g;\n if (typeof value === 'string') {\n const a = dateRegx.exec(value);\n if (a) {\n return new Date(value);\n }\n }\n return value;\n}\n\n \n\nexport class BrowserStorage extends KeyValueStorageBase {\n private prefix: string;\n\n public static isAvailable(): boolean {\n try {\n const storage = window.localStorage;\n const x = '__storage_test__';\n storage.setItem(x, x);\n storage.removeItem(x);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(namespace: string, prefix: string = 'com.exceptionless.', maxItems: number = 20) {\n super(maxItems);\n\n this.prefix = prefix + namespace + '-';\n }\n\n public write(key: string, value: string) {\n window.localStorage.setItem(key, value);\n }\n\n public read(key: string) {\n return window.localStorage.getItem(key);\n }\n\n public readAllKeys() {\n return Object.keys(window.localStorage)\n .filter((key) => key.indexOf(this.prefix) === 0);\n }\n\n public delete(key: string) {\n window.localStorage.removeItem(key);\n }\n\n public getKey(timestamp) {\n return this.prefix + timestamp;\n }\n\n public getTimestamp(key) {\n return parseInt(key.substr(this.prefix.length), 10);\n }\n}\n\n \n\nexport class DefaultErrorParser implements IErrorParser {\n public parse(context: EventPluginContext, exception: Error): IError {\n function getParameters(parameters: string | string[]): IParameter[] {\n const params: string[] = (typeof parameters === 'string' ? [parameters] : parameters) || [];\n\n const result: IParameter[] = [];\n for (const param of params) {\n result.push({ name: param });\n }\n\n return result;\n }\n\n function getStackFrames(stackFrames: TraceKit.StackFrame[]): IStackFrame[] {\n const ANONYMOUS: string = '<anonymous>';\n const frames: IStackFrame[] = [];\n\n for (const frame of stackFrames) {\n frames.push({\n name: (frame.func || ANONYMOUS).replace('?', ANONYMOUS),\n parameters: getParameters(frame.args),\n file_name: frame.url,\n line_number: frame.line || 0,\n column: frame.column || 0\n });\n }\n\n return frames;\n }\n\n const TRACEKIT_STACK_TRACE_KEY: string = '@@_TraceKit.StackTrace'; // optimization for minifier.\n\n const stackTrace: TraceKit.StackTrace = !!context.contextData[TRACEKIT_STACK_TRACE_KEY]\n ? context.contextData[TRACEKIT_STACK_TRACE_KEY]\n : TraceKit.computeStackTrace(exception, 25);\n\n if (!stackTrace) {\n throw new Error('Unable to parse the exceptions stack trace.');\n }\n\n const message = typeof(exception) === 'string' ? exception as any : undefined;\n return {\n type: stackTrace.name || 'Error',\n message: stackTrace.message || exception.message || message,\n stack_trace: getStackFrames(stackTrace.stack || [])\n };\n }\n}\n\n \n\nexport class DefaultModuleCollector implements IModuleCollector {\n public getModules(context: EventPluginContext): IModule[] {\n if (!document || !document.getElementsByTagName) {\n return null;\n }\n\n const modules: IModule[] = [];\n const scripts: NodeListOf<HTMLScriptElement> = document.getElementsByTagName('script');\n if (scripts && scripts.length > 0) {\n for (let index = 0; index < scripts.length; index++) {\n if (scripts[index].src) {\n modules.push({\n module_id: index,\n name: scripts[index].src.split('?')[0],\n version: Utils.parseVersion(scripts[index].src)\n });\n } else if (!!scripts[index].innerHTML) {\n modules.push({\n module_id: index,\n name: 'Script Tag',\n version: Utils.getHashCode(scripts[index].innerHTML).toString()\n });\n }\n }\n }\n\n return modules;\n }\n}\n\n \n\nexport class DefaultRequestInfoCollector implements IRequestInfoCollector {\n public getRequestInfo(context: EventPluginContext): IRequestInfo {\n if (!document || !navigator || !location) {\n return null;\n }\n\n const exclusions = context.client.config.dataExclusions;\n const requestInfo: IRequestInfo = {\n user_agent: navigator.userAgent,\n is_secure: location.protocol === 'https:',\n host: location.hostname,\n port: location.port && location.port !== '' ? parseInt(location.port, 10) : 80,\n path: location.pathname,\n // client_ip_address: 'TODO',\n cookies: Utils.getCookies(document.cookie, exclusions),\n query_string: Utils.parseQueryString(location.search.substring(1), exclusions)\n };\n\n if (document.referrer && document.referrer !== '') {\n requestInfo.referrer = document.referrer;\n }\n\n return requestInfo;\n }\n}\n\n \n\nexport class BrowserStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(prefix?: string, maxQueueItems: number = 250) {\n this.queue = new BrowserStorage('q', prefix, maxQueueItems);\n this.settings = new BrowserStorage('settings', prefix, 1);\n }\n\n}\n\n \n\n// tslint:disable-next-line:prefer-const\ndeclare var XDomainRequest: { new (); create(); };\n\nexport class DefaultSubmissionAdapter implements ISubmissionAdapter {\n public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) {\n // TODO: Handle sending events when app is exiting with send beacon.\n const TIMEOUT: string = 'timeout'; // optimization for minifier.\n const LOADED: string = 'loaded'; // optimization for minifier.\n const WITH_CREDENTIALS: string = 'withCredentials'; // optimization for minifier.\n\n let isCompleted: boolean = false;\n let useSetTimeout: boolean = false;\n function complete(mode: string, xhr: XMLHttpRequest) {\n function parseResponseHeaders(headerStr) {\n function trim(value) {\n return value.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n\n const headers = {};\n const headerPairs = (headerStr || '').split('\\u000d\\u000a');\n for (const headerPair of headerPairs) {\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n const separator = headerPair.indexOf('\\u003a\\u0020');\n if (separator > 0) {\n headers[trim(headerPair.substring(0, separator).toLowerCase())] = headerPair.substring(separator + 2);\n }\n }\n\n return headers;\n }\n\n if (isCompleted) {\n return;\n }\n\n isCompleted = true;\n\n let message: string = xhr.statusText;\n const responseText: string = xhr.responseText;\n let status: number = xhr.status;\n\n if (mode === TIMEOUT || status === 0) {\n message = 'Unable to connect to server.';\n status = 0;\n } else if (mode === LOADED && !status) {\n status = request.method === 'POST' ? 202 : 200;\n } else if (status < 200 || status > 299) {\n const responseBody: any = (xhr as any).responseBody;\n if (!!responseBody && !!responseBody.message) {\n message = responseBody.message;\n } else if (!!responseText && responseText.indexOf('message') !== -1) {\n try {\n message = JSON.parse(responseText).message;\n } catch (e) {\n message = responseText;\n }\n }\n }\n\n callback && callback(status || 500, message || '', responseText, parseResponseHeaders(xhr.getAllResponseHeaders && xhr.getAllResponseHeaders()));\n }\n\n function createRequest(userAgent: string, method: string, url: string): XMLHttpRequest {\n let xhr: any = new XMLHttpRequest();\n if (WITH_CREDENTIALS in xhr) {\n xhr.open(method, url, true);\n\n xhr.setRequestHeader('X-Exceptionless-Client', userAgent);\n if (method === 'POST') {\n xhr.setRequestHeader('Content-Type', 'application/json');\n }\n } else if (typeof XDomainRequest !== 'undefined') {\n useSetTimeout = true;\n xhr = new XDomainRequest();\n xhr.open(method, location.protocol === 'http:' ? url.replace('https:', 'http:') : url);\n } else {\n xhr = null;\n }\n\n if (xhr) {\n xhr.timeout = 10000;\n }\n\n return xhr;\n }\n\n const url = `${request.url}${(request.url.indexOf('?') === -1 ? '?' : '&')}access_token=${encodeURIComponent(request.apiKey)}`;\n const xhr = createRequest(request.userAgent, request.method || 'POST', url);\n if (!xhr) {\n return (callback && callback(503, 'CORS not supported.'));\n }\n\n if (WITH_CREDENTIALS in xhr) {\n xhr.onreadystatechange = () => {\n // xhr not ready.\n if (xhr.readyState !== 4) {\n return;\n }\n\n complete(LOADED, xhr);\n };\n }\n\n xhr.onprogress = () => { };\n xhr.ontimeout = () => complete(TIMEOUT, xhr);\n xhr.onerror = () => complete('error', xhr);\n xhr.onload = () => complete(LOADED, xhr);\n\n if (useSetTimeout) {\n setTimeout(() => xhr.send(request.data), 500);\n } else {\n xhr.send(request.data);\n }\n }\n}\n\n \n\n(function init() {\n function getDefaultsSettingsFromScriptTag(): IConfigurationSettings {\n if (!document || !document.getElementsByTagName) {\n return null;\n }\n\n const scripts = document.getElementsByTagName('script');\n // tslint:disable-next-line:prefer-for-of\n for (let index = 0; index < scripts.length; index++) {\n if (scripts[index].src && scripts[index].src.indexOf('/exceptionless') > -1) {\n return Utils.parseQueryString(scripts[index].src.split('?').pop());\n }\n }\n return null;\n }\n\n function processUnhandledException(stackTrace: TraceKit.StackTrace, options?: any): void {\n const builder = ExceptionlessClient.default.createUnhandledException(new Error(stackTrace.message || (options || {}).status || 'Script error'), 'onerror');\n builder.pluginContextData['@@_TraceKit.StackTrace'] = stackTrace;\n builder.submit();\n }\n\n if (typeof document === 'undefined') {\n return;\n }\n\n /*\n TODO: We currently are unable to parse string exceptions.\n function processJQueryAjaxError(event, xhr, settings, error:string): void {\n let client = ExceptionlessClient.default;\n if (xhr.status === 404) {\n client.submitNotFound(settings.url);\n } else if (xhr.status !== 401) {\n client.createUnhandledException(error, 'JQuery.ajaxError')\n .setSource(settings.url)\n .setProperty('status', xhr.status)\n .setProperty('request', settings.data)\n .setProperty('response', xhr.responseText && xhr.responseText.slice && xhr.responseText.slice(0, 1024))\n .submit();\n }\n }\n */\n\n Configuration.prototype.useLocalStorage = function() {\n if (BrowserStorage.isAvailable()) {\n this.storage = new BrowserStorageProvider();\n SettingsManager.applySavedServerSettings(this);\n this.changed();\n }\n };\n\n const defaults = Configuration.defaults;\n const settings = getDefaultsSettingsFromScriptTag();\n if (settings && (settings.apiKey || settings.serverUrl)) {\n defaults.apiKey = settings.apiKey;\n defaults.serverUrl = settings.serverUrl;\n }\n\n defaults.errorParser = new DefaultErrorParser();\n defaults.moduleCollector = new DefaultModuleCollector();\n defaults.requestInfoCollector = new DefaultRequestInfoCollector();\n defaults.submissionAdapter = new DefaultSubmissionAdapter();\n\n TraceKit.report.subscribe(processUnhandledException);\n TraceKit.extendToAsynchronousCallbacks();\n\n // window && window.addEventListener && window.addEventListener('beforeunload', function () {\n // ExceptionlessClient.default.config.queue.process(true);\n // });\n\n // if (typeof $ !== 'undefined' && $(document)) {\n // $(document).ajaxError(processJQueryAjaxError);\n // }\n\n (Error as any).stackTraceLimit = Infinity;\n})();\n\n// tslint:disable-next-line:prefer-const\ndeclare var $;\n\n"]} \ No newline at end of file diff --git a/dist/exceptionless.node.js b/dist/exceptionless.node.js deleted file mode 100644 index 8d7ddc4b..00000000 --- a/dist/exceptionless.node.js +++ /dev/null @@ -1,2169 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var os = require("os"); -var nodestacktrace = require("stack-trace"); -var child = require("child_process"); -var path = require("path"); -var Fs = require("fs"); -var Path = require("path"); -var http = require("http"); -var https = require("https"); -var url = require("url"); -var DefaultLastReferenceIdManager = (function () { - function DefaultLastReferenceIdManager() { - this._lastReferenceId = null; - } - DefaultLastReferenceIdManager.prototype.getLast = function () { - return this._lastReferenceId; - }; - DefaultLastReferenceIdManager.prototype.clearLast = function () { - this._lastReferenceId = null; - }; - DefaultLastReferenceIdManager.prototype.setLast = function (eventId) { - this._lastReferenceId = eventId; - }; - return DefaultLastReferenceIdManager; -}()); -exports.DefaultLastReferenceIdManager = DefaultLastReferenceIdManager; -var ConsoleLog = (function () { - function ConsoleLog() { - } - ConsoleLog.prototype.trace = function (message) { - this.log('debug', message); - }; - ConsoleLog.prototype.info = function (message) { - this.log('info', message); - }; - ConsoleLog.prototype.warn = function (message) { - this.log('warn', message); - }; - ConsoleLog.prototype.error = function (message) { - this.log('error', message); - }; - ConsoleLog.prototype.log = function (level, message) { - if (console) { - var msg = "[" + level + "] Exceptionless: " + message; - if (console[level]) { - console[level](msg); - } - else if (console.log) { - console["log"](msg); - } - } - }; - return ConsoleLog; -}()); -exports.ConsoleLog = ConsoleLog; -var NullLog = (function () { - function NullLog() { - } - NullLog.prototype.trace = function (message) { }; - NullLog.prototype.info = function (message) { }; - NullLog.prototype.warn = function (message) { }; - NullLog.prototype.error = function (message) { }; - return NullLog; -}()); -exports.NullLog = NullLog; -var HeartbeatPlugin = (function () { - function HeartbeatPlugin(heartbeatInterval) { - if (heartbeatInterval === void 0) { heartbeatInterval = 30000; } - this.priority = 100; - this.name = 'HeartbeatPlugin'; - this._interval = heartbeatInterval; - } - HeartbeatPlugin.prototype.run = function (context, next) { - clearInterval(this._intervalId); - var user = context.event.data['@user']; - if (user && user.identity) { - this._intervalId = setInterval(function () { return context.client.submitSessionHeartbeat(user.identity); }, this._interval); - } - next && next(); - }; - return HeartbeatPlugin; -}()); -exports.HeartbeatPlugin = HeartbeatPlugin; -var ReferenceIdPlugin = (function () { - function ReferenceIdPlugin() { - this.priority = 20; - this.name = 'ReferenceIdPlugin'; - } - ReferenceIdPlugin.prototype.run = function (context, next) { - if ((!context.event.reference_id || context.event.reference_id.length === 0) && context.event.type === 'error') { - context.event.reference_id = Utils.guid().replace('-', '').substring(0, 10); - } - next && next(); - }; - return ReferenceIdPlugin; -}()); -exports.ReferenceIdPlugin = ReferenceIdPlugin; -var EventPluginContext = (function () { - function EventPluginContext(client, event, contextData) { - this.client = client; - this.event = event; - this.contextData = contextData ? contextData : new ContextData(); - } - Object.defineProperty(EventPluginContext.prototype, "log", { - get: function () { - return this.client.config.log; - }, - enumerable: true, - configurable: true - }); - return EventPluginContext; -}()); -exports.EventPluginContext = EventPluginContext; -var EventPluginManager = (function () { - function EventPluginManager() { - } - EventPluginManager.run = function (context, callback) { - var wrap = function (plugin, next) { - return function () { - try { - if (!context.cancelled) { - plugin.run(context, next); - } - } - catch (ex) { - context.cancelled = true; - context.log.error("Error running plugin '" + plugin.name + "': " + ex.message + ". Discarding Event."); - } - if (context.cancelled && !!callback) { - callback(context); - } - }; - }; - var plugins = context.client.config.plugins; - var wrappedPlugins = []; - if (!!callback) { - wrappedPlugins[plugins.length] = wrap({ name: 'cb', priority: 9007199254740992, run: callback }, null); - } - for (var index = plugins.length - 1; index > -1; index--) { - wrappedPlugins[index] = wrap(plugins[index], !!callback || (index < plugins.length - 1) ? wrappedPlugins[index + 1] : null); - } - wrappedPlugins[0](); - }; - EventPluginManager.addDefaultPlugins = function (config) { - config.addPlugin(new ConfigurationDefaultsPlugin()); - config.addPlugin(new ErrorPlugin()); - config.addPlugin(new DuplicateCheckerPlugin()); - config.addPlugin(new EventExclusionPlugin()); - config.addPlugin(new ModuleInfoPlugin()); - config.addPlugin(new RequestInfoPlugin()); - config.addPlugin(new EnvironmentInfoPlugin()); - config.addPlugin(new SubmissionMethodPlugin()); - }; - return EventPluginManager; -}()); -exports.EventPluginManager = EventPluginManager; -var DefaultEventQueue = (function () { - function DefaultEventQueue(config) { - this._handlers = []; - this._processingQueue = false; - this._config = config; - } - DefaultEventQueue.prototype.enqueue = function (event) { - var eventWillNotBeQueued = 'The event will not be queued.'; - var config = this._config; - var log = config.log; - if (!config.enabled) { - log.info("Configuration is disabled. " + eventWillNotBeQueued); - return; - } - if (!config.isValid) { - log.info("Invalid Api Key. " + eventWillNotBeQueued); - return; - } - if (this.areQueuedItemsDiscarded()) { - log.info("Queue items are currently being discarded. " + eventWillNotBeQueued); - return; - } - this.ensureQueueTimer(); - var timestamp = config.storage.queue.save(event); - var logText = "type=" + event.type + " " + (!!event.reference_id ? 'refid=' + event.reference_id : ''); - if (timestamp) { - log.info("Enqueuing event: " + timestamp + " " + logText); - } - else { - log.error("Could not enqueue event " + logText); - } - }; - DefaultEventQueue.prototype.process = function (isAppExiting) { - var _this = this; - var queueNotProcessed = 'The queue will not be processed.'; - var config = this._config; - var log = config.log; - if (this._processingQueue) { - return; - } - log.info('Processing queue...'); - if (!config.enabled) { - log.info("Configuration is disabled. " + queueNotProcessed); - return; - } - if (!config.isValid) { - log.info("Invalid Api Key. " + queueNotProcessed); - return; - } - this._processingQueue = true; - this.ensureQueueTimer(); - try { - var events_1 = config.storage.queue.get(config.submissionBatchSize); - if (!events_1 || events_1.length === 0) { - this._processingQueue = false; - return; - } - log.info("Sending " + events_1.length + " events to " + config.serverUrl + "."); - config.submissionClient.postEvents(events_1.map(function (e) { return e.value; }), config, function (response) { - _this.processSubmissionResponse(response, events_1); - _this.eventsPosted(events_1.map(function (e) { return e.value; }), response); - log.info('Finished processing queue.'); - _this._processingQueue = false; - }, isAppExiting); - } - catch (ex) { - log.error("Error processing queue: " + ex); - this.suspendProcessing(); - this._processingQueue = false; - } - }; - DefaultEventQueue.prototype.suspendProcessing = function (durationInMinutes, discardFutureQueuedItems, clearQueue) { - var config = this._config; - if (!durationInMinutes || durationInMinutes <= 0) { - durationInMinutes = 5; - } - config.log.info("Suspending processing for " + durationInMinutes + " minutes."); - this._suspendProcessingUntil = new Date(new Date().getTime() + (durationInMinutes * 60000)); - if (discardFutureQueuedItems) { - this._discardQueuedItemsUntil = this._suspendProcessingUntil; - } - if (clearQueue) { - config.storage.queue.clear(); - } - }; - DefaultEventQueue.prototype.onEventsPosted = function (handler) { - !!handler && this._handlers.push(handler); - }; - DefaultEventQueue.prototype.eventsPosted = function (events, response) { - var handlers = this._handlers; - for (var _i = 0, handlers_1 = handlers; _i < handlers_1.length; _i++) { - var handler = handlers_1[_i]; - try { - handler(events, response); - } - catch (ex) { - this._config.log.error("Error calling onEventsPosted handler: " + ex); - } - } - }; - DefaultEventQueue.prototype.areQueuedItemsDiscarded = function () { - return this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date(); - }; - DefaultEventQueue.prototype.ensureQueueTimer = function () { - var _this = this; - if (!this._queueTimer) { - this._queueTimer = setInterval(function () { return _this.onProcessQueue(); }, 10000); - } - }; - DefaultEventQueue.prototype.isQueueProcessingSuspended = function () { - return this._suspendProcessingUntil && this._suspendProcessingUntil > new Date(); - }; - DefaultEventQueue.prototype.onProcessQueue = function () { - if (!this.isQueueProcessingSuspended() && !this._processingQueue) { - this.process(); - } - }; - DefaultEventQueue.prototype.processSubmissionResponse = function (response, events) { - var noSubmission = 'The event will not be submitted.'; - var config = this._config; - var log = config.log; - if (response.success) { - log.info("Sent " + events.length + " events."); - this.removeEvents(events); - return; - } - if (response.serviceUnavailable) { - log.error('Server returned service unavailable.'); - this.suspendProcessing(); - return; - } - if (response.paymentRequired) { - log.info('Too many events have been submitted, please upgrade your plan.'); - this.suspendProcessing(null, true, true); - return; - } - if (response.unableToAuthenticate) { - log.info("Unable to authenticate, please check your configuration. " + noSubmission); - this.suspendProcessing(15); - this.removeEvents(events); - return; - } - if (response.notFound || response.badRequest) { - log.error("Error while trying to submit data: " + response.message); - this.suspendProcessing(60 * 4); - this.removeEvents(events); - return; - } - if (response.requestEntityTooLarge) { - var message = 'Event submission discarded for being too large.'; - if (config.submissionBatchSize > 1) { - log.error(message + " Retrying with smaller batch size."); - config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5)); - } - else { - log.error(message + " " + noSubmission); - this.removeEvents(events); - } - return; - } - if (!response.success) { - log.error("Error submitting events: " + (response.message || 'Please check the network tab for more info.')); - this.suspendProcessing(); - } - }; - DefaultEventQueue.prototype.removeEvents = function (events) { - for (var index = 0; index < (events || []).length; index++) { - this._config.storage.queue.remove(events[index].timestamp); - } - }; - return DefaultEventQueue; -}()); -exports.DefaultEventQueue = DefaultEventQueue; -var InMemoryStorageProvider = (function () { - function InMemoryStorageProvider(maxQueueItems) { - if (maxQueueItems === void 0) { maxQueueItems = 250; } - this.queue = new InMemoryStorage(maxQueueItems); - this.settings = new InMemoryStorage(1); - } - return InMemoryStorageProvider; -}()); -exports.InMemoryStorageProvider = InMemoryStorageProvider; -var DefaultSubmissionClient = (function () { - function DefaultSubmissionClient() { - this.configurationVersionHeader = 'x-exceptionless-configversion'; - } - DefaultSubmissionClient.prototype.postEvents = function (events, config, callback, isAppExiting) { - var data = JSON.stringify(events); - var request = this.createRequest(config, 'POST', config.serverUrl + "/api/v2/events", data); - var cb = this.createSubmissionCallback(config, callback); - return config.submissionAdapter.sendRequest(request, cb, isAppExiting); - }; - DefaultSubmissionClient.prototype.postUserDescription = function (referenceId, description, config, callback) { - var path = config.serverUrl + "/api/v2/events/by-ref/" + encodeURIComponent(referenceId) + "/user-description"; - var data = JSON.stringify(description); - var request = this.createRequest(config, 'POST', path, data); - var cb = this.createSubmissionCallback(config, callback); - return config.submissionAdapter.sendRequest(request, cb); - }; - DefaultSubmissionClient.prototype.getSettings = function (config, version, callback) { - var request = this.createRequest(config, 'GET', config.serverUrl + "/api/v2/projects/config?v=" + version); - var cb = function (status, message, data, headers) { - if (status !== 200) { - return callback(new SettingsResponse(false, null, -1, null, message)); - } - var settings; - try { - settings = JSON.parse(data); - } - catch (e) { - config.log.error("Unable to parse settings: '" + data + "'"); - } - if (!settings || isNaN(settings.version)) { - return callback(new SettingsResponse(false, null, -1, null, 'Invalid configuration settings.')); - } - callback(new SettingsResponse(true, settings.settings || {}, settings.version)); - }; - return config.submissionAdapter.sendRequest(request, cb); - }; - DefaultSubmissionClient.prototype.sendHeartbeat = function (sessionIdOrUserId, closeSession, config) { - var request = this.createRequest(config, 'GET', config.heartbeatServerUrl + "/api/v2/events/session/heartbeat?id=" + sessionIdOrUserId + "&close=" + closeSession); - config.submissionAdapter.sendRequest(request); - }; - DefaultSubmissionClient.prototype.createRequest = function (config, method, url, data) { - if (data === void 0) { data = null; } - return { - method: method, - url: url, - data: data, - apiKey: config.apiKey, - userAgent: config.userAgent - }; - }; - DefaultSubmissionClient.prototype.createSubmissionCallback = function (config, callback) { - var _this = this; - return function (status, message, data, headers) { - var settingsVersion = headers && parseInt(headers[_this.configurationVersionHeader], 10); - SettingsManager.checkVersion(settingsVersion, config); - callback(new SubmissionResponse(status, message)); - }; - }; - return DefaultSubmissionClient; -}()); -exports.DefaultSubmissionClient = DefaultSubmissionClient; -var Utils = (function () { - function Utils() { - } - Utils.addRange = function (target) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - if (!target) { - target = []; - } - if (!values || values.length === 0) { - return target; - } - for (var _a = 0, values_1 = values; _a < values_1.length; _a++) { - var value = values_1[_a]; - if (value && target.indexOf(value) < 0) { - target.push(value); - } - } - return target; - }; - Utils.getHashCode = function (source) { - if (!source || source.length === 0) { - return 0; - } - var hash = 0; - for (var index = 0; index < source.length; index++) { - var character = source.charCodeAt(index); - hash = ((hash << 5) - hash) + character; - hash |= 0; - } - return hash; - }; - Utils.getCookies = function (cookies, exclusions) { - var result = {}; - var parts = (cookies || '').split('; '); - for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) { - var part = parts_1[_i]; - var cookie = part.split('='); - if (!Utils.isMatch(cookie[0], exclusions)) { - result[cookie[0]] = cookie[1]; - } - } - return !Utils.isEmpty(result) ? result : null; - }; - Utils.guid = function () { - function s4() { - return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); - } - return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); - }; - Utils.merge = function (defaultValues, values) { - var result = {}; - for (var key in defaultValues || {}) { - if (!!defaultValues[key]) { - result[key] = defaultValues[key]; - } - } - for (var key in values || {}) { - if (!!values[key]) { - result[key] = values[key]; - } - } - return result; - }; - Utils.parseVersion = function (source) { - if (!source) { - return null; - } - var versionRegex = /(v?((\d+)\.(\d+)(\.(\d+))?)(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?)/; - var matches = versionRegex.exec(source); - if (matches && matches.length > 0) { - return matches[0]; - } - return null; - }; - Utils.parseQueryString = function (query, exclusions) { - if (!query || query.length === 0) { - return null; - } - var pairs = query.split('&'); - if (pairs.length === 0) { - return null; - } - var result = {}; - for (var _i = 0, pairs_1 = pairs; _i < pairs_1.length; _i++) { - var pair = pairs_1[_i]; - var parts = pair.split('='); - if (!Utils.isMatch(parts[0], exclusions)) { - result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]); - } - } - return !Utils.isEmpty(result) ? result : null; - }; - Utils.randomNumber = function () { - return Math.floor(Math.random() * 9007199254740992); - }; - Utils.isMatch = function (input, patterns, ignoreCase) { - if (ignoreCase === void 0) { ignoreCase = true; } - if (!input || typeof input !== 'string') { - return false; - } - var trim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; - input = (ignoreCase ? input.toLowerCase() : input).replace(trim, ''); - return (patterns || []).some(function (pattern) { - if (typeof pattern !== 'string') { - return false; - } - pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, ''); - if (pattern.length <= 0) { - return false; - } - var startsWithWildcard = pattern[0] === '*'; - if (startsWithWildcard) { - pattern = pattern.slice(1); - } - var endsWithWildcard = pattern[pattern.length - 1] === '*'; - if (endsWithWildcard) { - pattern = pattern.substring(0, pattern.length - 1); - } - if (startsWithWildcard && endsWithWildcard) { - return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1; - } - if (startsWithWildcard) { - return Utils.endsWith(input, pattern); - } - if (endsWithWildcard) { - return Utils.startsWith(input, pattern); - } - return input === pattern; - }); - }; - Utils.isEmpty = function (input) { - return input === null || (typeof (input) === 'object' && Object.keys(input).length === 0); - }; - Utils.startsWith = function (input, prefix) { - return input.substring(0, prefix.length) === prefix; - }; - Utils.endsWith = function (input, suffix) { - return input.indexOf(suffix, input.length - suffix.length) !== -1; - }; - Utils.stringify = function (data, exclusions, maxDepth) { - function stringifyImpl(obj, excludedKeys) { - var cache = []; - return JSON.stringify(obj, function (key, value) { - if (Utils.isMatch(key, excludedKeys)) { - return; - } - if (typeof value === 'object' && !!value) { - if (cache.indexOf(value) !== -1) { - return; - } - cache.push(value); - } - return value; - }); - } - if (({}).toString.call(data) === '[object Object]') { - var flattened = {}; - for (var prop in data) { - var value = data[prop]; - if (value === data) { - continue; - } - flattened[prop] = data[prop]; - } - return stringifyImpl(flattened, exclusions); - } - if (({}).toString.call(data) === '[object Array]') { - var result = []; - for (var index = 0; index < data.length; index++) { - result[index] = JSON.parse(stringifyImpl(data[index], exclusions)); - } - return JSON.stringify(result); - } - return stringifyImpl(data, exclusions); - }; - Utils.toBoolean = function (input, defaultValue) { - if (defaultValue === void 0) { defaultValue = false; } - if (typeof input === 'boolean') { - return input; - } - if (input === null || typeof input !== 'number' && typeof input !== 'string') { - return defaultValue; - } - switch ((input + '').toLowerCase().trim()) { - case 'true': - case 'yes': - case '1': return true; - case 'false': - case 'no': - case '0': - case null: return false; - } - return defaultValue; - }; - return Utils; -}()); -exports.Utils = Utils; -var SettingsManager = (function () { - function SettingsManager() { - } - SettingsManager.onChanged = function (handler) { - !!handler && this._handlers.push(handler); - }; - SettingsManager.applySavedServerSettings = function (config) { - if (!config || !config.isValid) { - return; - } - var savedSettings = this.getSavedServerSettings(config); - config.log.info("Applying saved settings: v" + savedSettings.version); - config.settings = Utils.merge(config.settings, savedSettings.settings); - this.changed(config); - }; - SettingsManager.getVersion = function (config) { - if (!config || !config.isValid) { - return 0; - } - var savedSettings = this.getSavedServerSettings(config); - return savedSettings.version || 0; - }; - SettingsManager.checkVersion = function (version, config) { - var currentVersion = this.getVersion(config); - if (version <= currentVersion) { - return; - } - config.log.info("Updating settings from v" + currentVersion + " to v" + version); - this.updateSettings(config, currentVersion); - }; - SettingsManager.updateSettings = function (config, version) { - var _this = this; - if (!config || !config.enabled) { - return; - } - var unableToUpdateMessage = 'Unable to update settings'; - if (!config.isValid) { - config.log.error(unableToUpdateMessage + ": ApiKey is not set."); - return; - } - if (!version || version < 0) { - version = this.getVersion(config); - } - config.log.info("Checking for updated settings from: v" + version + "."); - config.submissionClient.getSettings(config, version, function (response) { - if (!config || !response || !response.success || !response.settings) { - config.log.warn(unableToUpdateMessage + ": " + response.message); - return; - } - config.settings = Utils.merge(config.settings, response.settings); - var savedServerSettings = SettingsManager.getSavedServerSettings(config); - for (var key in savedServerSettings) { - if (response.settings[key]) { - continue; - } - delete config.settings[key]; - } - var newSettings = { - version: response.settingsVersion, - settings: response.settings - }; - config.storage.settings.save(newSettings); - config.log.info("Updated settings: v" + newSettings.version); - _this.changed(config); - }); - }; - SettingsManager.changed = function (config) { - var handlers = this._handlers; - for (var _i = 0, handlers_2 = handlers; _i < handlers_2.length; _i++) { - var handler = handlers_2[_i]; - try { - handler(config); - } - catch (ex) { - config.log.error("Error calling onChanged handler: " + ex); - } - } - }; - SettingsManager.getSavedServerSettings = function (config) { - var item = config.storage.settings.get()[0]; - if (item && item.value && item.value.version && item.value.settings) { - return item.value; - } - return { version: 0, settings: {} }; - }; - return SettingsManager; -}()); -SettingsManager._handlers = []; -exports.SettingsManager = SettingsManager; -var SubmissionResponse = (function () { - function SubmissionResponse(statusCode, message) { - this.success = false; - this.badRequest = false; - this.serviceUnavailable = false; - this.paymentRequired = false; - this.unableToAuthenticate = false; - this.notFound = false; - this.requestEntityTooLarge = false; - this.statusCode = statusCode; - this.message = message; - this.success = statusCode >= 200 && statusCode <= 299; - this.badRequest = statusCode === 400; - this.serviceUnavailable = statusCode === 503; - this.paymentRequired = statusCode === 402; - this.unableToAuthenticate = statusCode === 401 || statusCode === 403; - this.notFound = statusCode === 404; - this.requestEntityTooLarge = statusCode === 413; - } - return SubmissionResponse; -}()); -exports.SubmissionResponse = SubmissionResponse; -var ExceptionlessClient = (function () { - function ExceptionlessClient(settingsOrApiKey, serverUrl) { - var _this = this; - this.config = typeof settingsOrApiKey === 'object' - ? new Configuration(settingsOrApiKey) - : new Configuration({ apiKey: settingsOrApiKey, serverUrl: serverUrl }); - this.updateSettingsTimer(5000); - this.config.onChanged(function (config) { return _this.updateSettingsTimer(_this._timeoutId > 0 ? 5000 : 0); }); - this.config.queue.onEventsPosted(function (events, response) { return _this.updateSettingsTimer(); }); - } - ExceptionlessClient.prototype.createException = function (exception) { - var pluginContextData = new ContextData(); - pluginContextData.setException(exception); - return this.createEvent(pluginContextData).setType('error'); - }; - ExceptionlessClient.prototype.submitException = function (exception, callback) { - this.createException(exception).submit(callback); - }; - ExceptionlessClient.prototype.createUnhandledException = function (exception, submissionMethod) { - var builder = this.createException(exception); - builder.pluginContextData.markAsUnhandledError(); - builder.pluginContextData.setSubmissionMethod(submissionMethod); - return builder; - }; - ExceptionlessClient.prototype.submitUnhandledException = function (exception, submissionMethod, callback) { - this.createUnhandledException(exception, submissionMethod).submit(callback); - }; - ExceptionlessClient.prototype.createFeatureUsage = function (feature) { - return this.createEvent().setType('usage').setSource(feature); - }; - ExceptionlessClient.prototype.submitFeatureUsage = function (feature, callback) { - this.createFeatureUsage(feature).submit(callback); - }; - ExceptionlessClient.prototype.createLog = function (sourceOrMessage, message, level) { - var builder = this.createEvent().setType('log'); - if (level) { - builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty('@level', level); - } - else if (message) { - builder = builder.setSource(sourceOrMessage).setMessage(message); - } - else { - builder = builder.setMessage(sourceOrMessage); - try { - var caller = this.createLog.caller; - builder = builder.setSource(caller && caller.caller && caller.caller.name); - } - catch (e) { - this.config.log.trace('Unable to resolve log source: ' + e.message); - } - } - return builder; - }; - ExceptionlessClient.prototype.submitLog = function (sourceOrMessage, message, level, callback) { - this.createLog(sourceOrMessage, message, level).submit(callback); - }; - ExceptionlessClient.prototype.createNotFound = function (resource) { - return this.createEvent().setType('404').setSource(resource); - }; - ExceptionlessClient.prototype.submitNotFound = function (resource, callback) { - this.createNotFound(resource).submit(callback); - }; - ExceptionlessClient.prototype.createSessionStart = function () { - return this.createEvent().setType('session'); - }; - ExceptionlessClient.prototype.submitSessionStart = function (callback) { - this.createSessionStart().submit(callback); - }; - ExceptionlessClient.prototype.submitSessionEnd = function (sessionIdOrUserId) { - if (sessionIdOrUserId) { - this.config.log.info("Submitting session end: " + sessionIdOrUserId); - this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, true, this.config); - } - }; - ExceptionlessClient.prototype.submitSessionHeartbeat = function (sessionIdOrUserId) { - if (sessionIdOrUserId) { - this.config.log.info("Submitting session heartbeat: " + sessionIdOrUserId); - this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, false, this.config); - } - }; - ExceptionlessClient.prototype.createEvent = function (pluginContextData) { - return new EventBuilder({ date: new Date() }, this, pluginContextData); - }; - ExceptionlessClient.prototype.submitEvent = function (event, pluginContextData, callback) { - function cancelled(context) { - if (!!context) { - context.cancelled = true; - } - return !!callback && callback(context); - } - var context = new EventPluginContext(this, event, pluginContextData); - if (!event) { - return cancelled(context); - } - if (!this.config.enabled) { - this.config.log.info('Event submission is currently disabled.'); - return cancelled(context); - } - if (!event.data) { - event.data = {}; - } - if (!event.tags || !event.tags.length) { - event.tags = []; - } - EventPluginManager.run(context, function (ctx) { - var config = ctx.client.config; - var ev = ctx.event; - if (!ctx.cancelled) { - if (!ev.type || ev.type.length === 0) { - ev.type = 'log'; - } - if (!ev.date) { - ev.date = new Date(); - } - config.queue.enqueue(ev); - if (ev.reference_id && ev.reference_id.length > 0) { - ctx.log.info("Setting last reference id '" + ev.reference_id + "'"); - config.lastReferenceIdManager.setLast(ev.reference_id); - } - } - !!callback && callback(ctx); - }); - }; - ExceptionlessClient.prototype.updateUserEmailAndDescription = function (referenceId, email, description, callback) { - var _this = this; - if (!referenceId || !email || !description || !this.config.enabled) { - return !!callback && callback(new SubmissionResponse(500, 'cancelled')); - } - var userDescription = { email_address: email, description: description }; - this.config.submissionClient.postUserDescription(referenceId, userDescription, this.config, function (response) { - if (!response.success) { - _this.config.log.error("Failed to submit user email and description for event '" + referenceId + "': " + response.statusCode + " " + response.message); - } - !!callback && callback(response); - }); - }; - ExceptionlessClient.prototype.getLastReferenceId = function () { - return this.config.lastReferenceIdManager.getLast(); - }; - ExceptionlessClient.prototype.updateSettingsTimer = function (initialDelay) { - var _this = this; - this.config.log.info("Updating settings timer with delay: " + initialDelay); - this._timeoutId = clearTimeout(this._timeoutId); - this._timeoutId = clearInterval(this._intervalId); - var interval = this.config.updateSettingsWhenIdleInterval; - if (interval > 0) { - var updateSettings = function () { return SettingsManager.updateSettings(_this.config); }; - if (initialDelay > 0) { - this._timeoutId = setTimeout(updateSettings, initialDelay); - } - this._intervalId = setInterval(updateSettings, interval); - } - }; - Object.defineProperty(ExceptionlessClient, "default", { - get: function () { - if (ExceptionlessClient._instance === null) { - ExceptionlessClient._instance = new ExceptionlessClient(null); - } - return ExceptionlessClient._instance; - }, - enumerable: true, - configurable: true - }); - return ExceptionlessClient; -}()); -ExceptionlessClient._instance = null; -exports.ExceptionlessClient = ExceptionlessClient; -var ContextData = (function () { - function ContextData() { - } - ContextData.prototype.setException = function (exception) { - if (exception) { - this['@@_Exception'] = exception; - } - }; - Object.defineProperty(ContextData.prototype, "hasException", { - get: function () { - return !!this['@@_Exception']; - }, - enumerable: true, - configurable: true - }); - ContextData.prototype.getException = function () { - return this['@@_Exception'] || null; - }; - ContextData.prototype.markAsUnhandledError = function () { - this['@@_IsUnhandledError'] = true; - }; - Object.defineProperty(ContextData.prototype, "isUnhandledError", { - get: function () { - return !!this['@@_IsUnhandledError']; - }, - enumerable: true, - configurable: true - }); - ContextData.prototype.setSubmissionMethod = function (method) { - if (method) { - this['@@_SubmissionMethod'] = method; - } - }; - ContextData.prototype.getSubmissionMethod = function () { - return this['@@_SubmissionMethod'] || null; - }; - return ContextData; -}()); -exports.ContextData = ContextData; -var Configuration = (function () { - function Configuration(configSettings) { - this.defaultTags = []; - this.defaultData = {}; - this.enabled = true; - this.lastReferenceIdManager = new DefaultLastReferenceIdManager(); - this.settings = {}; - this._serverUrl = 'https://collector.exceptionless.io'; - this._heartbeatServerUrl = 'https://heartbeat.exceptionless.io'; - this._updateSettingsWhenIdleInterval = 120000; - this._dataExclusions = []; - this._userAgentBotPatterns = []; - this._plugins = []; - this._handlers = []; - function inject(fn) { - return typeof fn === 'function' ? fn(this) : fn; - } - configSettings = Utils.merge(Configuration.defaults, configSettings); - this.log = inject(configSettings.log) || new NullLog(); - this.apiKey = configSettings.apiKey; - this.serverUrl = configSettings.serverUrl; - this.heartbeatServerUrl = configSettings.heartbeatServerUrl; - this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval; - this.environmentInfoCollector = inject(configSettings.environmentInfoCollector); - this.errorParser = inject(configSettings.errorParser); - this.lastReferenceIdManager = inject(configSettings.lastReferenceIdManager) || new DefaultLastReferenceIdManager(); - this.moduleCollector = inject(configSettings.moduleCollector); - this.requestInfoCollector = inject(configSettings.requestInfoCollector); - this.submissionBatchSize = inject(configSettings.submissionBatchSize) || 50; - this.submissionAdapter = inject(configSettings.submissionAdapter); - this.submissionClient = inject(configSettings.submissionClient) || new DefaultSubmissionClient(); - this.storage = inject(configSettings.storage) || new InMemoryStorageProvider(); - this.queue = inject(configSettings.queue) || new DefaultEventQueue(this); - SettingsManager.applySavedServerSettings(this); - EventPluginManager.addDefaultPlugins(this); - } - Object.defineProperty(Configuration.prototype, "apiKey", { - get: function () { - return this._apiKey; - }, - set: function (value) { - this._apiKey = value || null; - this.log.info("apiKey: " + this._apiKey); - this.changed(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "isValid", { - get: function () { - return !!this.apiKey && this.apiKey.length >= 10; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "serverUrl", { - get: function () { - return this._serverUrl; - }, - set: function (value) { - if (!!value) { - this._serverUrl = value; - this._heartbeatServerUrl = value; - this.log.info("serverUrl: " + value); - this.changed(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "heartbeatServerUrl", { - get: function () { - return this._heartbeatServerUrl; - }, - set: function (value) { - if (!!value) { - this._heartbeatServerUrl = value; - this.log.info("heartbeatServerUrl: " + value); - this.changed(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "updateSettingsWhenIdleInterval", { - get: function () { - return this._updateSettingsWhenIdleInterval; - }, - set: function (value) { - if (typeof value !== 'number') { - return; - } - if (value <= 0) { - value = -1; - } - else if (value > 0 && value < 15000) { - value = 15000; - } - this._updateSettingsWhenIdleInterval = value; - this.log.info("updateSettingsWhenIdleInterval: " + value); - this.changed(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "dataExclusions", { - get: function () { - var exclusions = this.settings['@@DataExclusions']; - return this._dataExclusions.concat(exclusions && exclusions.split(',') || []); - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.addDataExclusions = function () { - var exclusions = []; - for (var _i = 0; _i < arguments.length; _i++) { - exclusions[_i] = arguments[_i]; - } - this._dataExclusions = Utils.addRange.apply(Utils, [this._dataExclusions].concat(exclusions)); - }; - Object.defineProperty(Configuration.prototype, "userAgentBotPatterns", { - get: function () { - var patterns = this.settings['@@UserAgentBotPatterns']; - return this._userAgentBotPatterns.concat(patterns && patterns.split(',') || []); - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.addUserAgentBotPatterns = function () { - var userAgentBotPatterns = []; - for (var _i = 0; _i < arguments.length; _i++) { - userAgentBotPatterns[_i] = arguments[_i]; - } - this._userAgentBotPatterns = Utils.addRange.apply(Utils, [this._userAgentBotPatterns].concat(userAgentBotPatterns)); - }; - Object.defineProperty(Configuration.prototype, "plugins", { - get: function () { - return this._plugins.sort(function (p1, p2) { - return (p1.priority < p2.priority) ? -1 : (p1.priority > p2.priority) ? 1 : 0; - }); - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.addPlugin = function (pluginOrName, priority, pluginAction) { - var plugin = !!pluginAction ? { name: pluginOrName, priority: priority, run: pluginAction } : pluginOrName; - if (!plugin || !plugin.run) { - this.log.error('Add plugin failed: Run method not defined'); - return; - } - if (!plugin.name) { - plugin.name = Utils.guid(); - } - if (!plugin.priority) { - plugin.priority = 0; - } - var pluginExists = false; - var plugins = this._plugins; - for (var _i = 0, plugins_1 = plugins; _i < plugins_1.length; _i++) { - var p = plugins_1[_i]; - if (p.name === plugin.name) { - pluginExists = true; - break; - } - } - if (!pluginExists) { - plugins.push(plugin); - } - }; - Configuration.prototype.removePlugin = function (pluginOrName) { - var name = typeof pluginOrName === 'string' ? pluginOrName : pluginOrName.name; - if (!name) { - this.log.error('Remove plugin failed: Plugin name not defined'); - return; - } - var plugins = this._plugins; - for (var index = 0; index < plugins.length; index++) { - if (plugins[index].name === name) { - plugins.splice(index, 1); - break; - } - } - }; - Configuration.prototype.setVersion = function (version) { - if (!!version) { - this.defaultData['@version'] = version; - } - }; - Configuration.prototype.setUserIdentity = function (userInfoOrIdentity, name) { - var USER_KEY = '@user'; - var userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name: name }; - var shouldRemove = !userInfo || (!userInfo.identity && !userInfo.name); - if (shouldRemove) { - delete this.defaultData[USER_KEY]; - } - else { - this.defaultData[USER_KEY] = userInfo; - } - this.log.info("user identity: " + (shouldRemove ? 'null' : userInfo.identity)); - }; - Object.defineProperty(Configuration.prototype, "userAgent", { - get: function () { - return 'exceptionless-node/1.5.4'; - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.useSessions = function (sendHeartbeats, heartbeatInterval) { - if (sendHeartbeats === void 0) { sendHeartbeats = true; } - if (heartbeatInterval === void 0) { heartbeatInterval = 30000; } - if (sendHeartbeats) { - this.addPlugin(new HeartbeatPlugin(heartbeatInterval)); - } - }; - Configuration.prototype.useReferenceIds = function () { - this.addPlugin(new ReferenceIdPlugin()); - }; - Configuration.prototype.useLocalStorage = function () { - }; - Configuration.prototype.useDebugLogger = function () { - this.log = new ConsoleLog(); - }; - Configuration.prototype.onChanged = function (handler) { - !!handler && this._handlers.push(handler); - }; - Configuration.prototype.changed = function () { - var handlers = this._handlers; - for (var _i = 0, handlers_3 = handlers; _i < handlers_3.length; _i++) { - var handler = handlers_3[_i]; - try { - handler(this); - } - catch (ex) { - this.log.error("Error calling onChanged handler: " + ex); - } - } - }; - Object.defineProperty(Configuration, "defaults", { - get: function () { - if (Configuration._defaultSettings === null) { - Configuration._defaultSettings = {}; - } - return Configuration._defaultSettings; - }, - enumerable: true, - configurable: true - }); - return Configuration; -}()); -Configuration._defaultSettings = null; -exports.Configuration = Configuration; -var SettingsResponse = (function () { - function SettingsResponse(success, settings, settingsVersion, exception, message) { - if (settingsVersion === void 0) { settingsVersion = -1; } - if (exception === void 0) { exception = null; } - if (message === void 0) { message = null; } - this.success = false; - this.settingsVersion = -1; - this.success = success; - this.settings = settings; - this.settingsVersion = settingsVersion; - this.exception = exception; - this.message = message; - } - return SettingsResponse; -}()); -exports.SettingsResponse = SettingsResponse; -var EventBuilder = (function () { - function EventBuilder(event, client, pluginContextData) { - this._validIdentifierErrorMessage = 'must contain between 8 and 100 alphanumeric or \'-\' characters.'; - this.target = event; - this.client = client; - this.pluginContextData = pluginContextData || new ContextData(); - } - EventBuilder.prototype.setType = function (type) { - if (!!type) { - this.target.type = type; - } - return this; - }; - EventBuilder.prototype.setSource = function (source) { - if (!!source) { - this.target.source = source; - } - return this; - }; - EventBuilder.prototype.setReferenceId = function (referenceId) { - if (!this.isValidIdentifier(referenceId)) { - throw new Error("ReferenceId " + this._validIdentifierErrorMessage); - } - this.target.reference_id = referenceId; - return this; - }; - EventBuilder.prototype.setEventReference = function (name, id) { - if (!name) { - throw new Error('Invalid name'); - } - if (!id || !this.isValidIdentifier(id)) { - throw new Error("Id " + this._validIdentifierErrorMessage); - } - this.setProperty('@ref:' + name, id); - return this; - }; - EventBuilder.prototype.setMessage = function (message) { - if (!!message) { - this.target.message = message; - } - return this; - }; - EventBuilder.prototype.setGeo = function (latitude, longitude) { - if (latitude < -90.0 || latitude > 90.0) { - throw new Error('Must be a valid latitude value between -90.0 and 90.0.'); - } - if (longitude < -180.0 || longitude > 180.0) { - throw new Error('Must be a valid longitude value between -180.0 and 180.0.'); - } - this.target.geo = latitude + "," + longitude; - return this; - }; - EventBuilder.prototype.setUserIdentity = function (userInfoOrIdentity, name) { - var userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name: name }; - if (!userInfo || (!userInfo.identity && !userInfo.name)) { - return this; - } - this.setProperty('@user', userInfo); - return this; - }; - EventBuilder.prototype.setUserDescription = function (emailAddress, description) { - if (emailAddress && description) { - this.setProperty('@user_description', { email_address: emailAddress, description: description }); - } - return this; - }; - EventBuilder.prototype.setManualStackingInfo = function (signatureData, title) { - if (signatureData) { - var stack = { signature_data: signatureData }; - if (title) { - stack.title = title; - } - this.setProperty('@stack', stack); - } - return this; - }; - EventBuilder.prototype.setManualStackingKey = function (manualStackingKey, title) { - if (manualStackingKey) { - var data = { ManualStackingKey: manualStackingKey }; - this.setManualStackingInfo(data, title); - } - return this; - }; - EventBuilder.prototype.setValue = function (value) { - if (!!value) { - this.target.value = value; - } - return this; - }; - EventBuilder.prototype.addTags = function () { - var tags = []; - for (var _i = 0; _i < arguments.length; _i++) { - tags[_i] = arguments[_i]; - } - this.target.tags = Utils.addRange.apply(Utils, [this.target.tags].concat(tags)); - return this; - }; - EventBuilder.prototype.setProperty = function (name, value, maxDepth, excludedPropertyNames) { - if (!name || (value === undefined || value == null)) { - return this; - } - if (!this.target.data) { - this.target.data = {}; - } - var result = JSON.parse(Utils.stringify(value, this.client.config.dataExclusions.concat(excludedPropertyNames || []), maxDepth)); - if (!Utils.isEmpty(result)) { - this.target.data[name] = result; - } - return this; - }; - EventBuilder.prototype.markAsCritical = function (critical) { - if (critical) { - this.addTags('Critical'); - } - return this; - }; - EventBuilder.prototype.addRequestInfo = function (request) { - if (!!request) { - this.pluginContextData['@request'] = request; - } - return this; - }; - EventBuilder.prototype.submit = function (callback) { - this.client.submitEvent(this.target, this.pluginContextData, callback); - }; - EventBuilder.prototype.isValidIdentifier = function (value) { - if (!value) { - return true; - } - if (value.length < 8 || value.length > 100) { - return false; - } - for (var index = 0; index < value.length; index++) { - var code = value.charCodeAt(index); - var isDigit = (code >= 48) && (code <= 57); - var isLetter = ((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122)); - var isMinus = code === 45; - if (!(isDigit || isLetter) && !isMinus) { - return false; - } - } - return true; - }; - return EventBuilder; -}()); -exports.EventBuilder = EventBuilder; -var ConfigurationDefaultsPlugin = (function () { - function ConfigurationDefaultsPlugin() { - this.priority = 10; - this.name = 'ConfigurationDefaultsPlugin'; - } - ConfigurationDefaultsPlugin.prototype.run = function (context, next) { - var config = context.client.config; - var defaultTags = config.defaultTags || []; - for (var _i = 0, defaultTags_1 = defaultTags; _i < defaultTags_1.length; _i++) { - var tag = defaultTags_1[_i]; - if (!!tag && context.event.tags.indexOf(tag) < 0) { - context.event.tags.push(tag); - } - } - var defaultData = config.defaultData || {}; - for (var key in defaultData) { - if (!!defaultData[key]) { - var result = JSON.parse(Utils.stringify(defaultData[key], config.dataExclusions)); - if (!Utils.isEmpty(result)) { - context.event.data[key] = result; - } - } - } - next && next(); - }; - return ConfigurationDefaultsPlugin; -}()); -exports.ConfigurationDefaultsPlugin = ConfigurationDefaultsPlugin; -var DuplicateCheckerPlugin = (function () { - function DuplicateCheckerPlugin(getCurrentTime, interval) { - if (getCurrentTime === void 0) { getCurrentTime = function () { return Date.now(); }; } - if (interval === void 0) { interval = 30000; } - var _this = this; - this.priority = 1010; - this.name = 'DuplicateCheckerPlugin'; - this._mergedEvents = []; - this._processedHashcodes = []; - this._getCurrentTime = getCurrentTime; - this._interval = interval; - setInterval(function () { - while (_this._mergedEvents.length > 0) { - _this._mergedEvents.shift().resubmit(); - } - }, interval); - } - DuplicateCheckerPlugin.prototype.run = function (context, next) { - var _this = this; - function getHashCode(error) { - var hashCode = 0; - while (error) { - if (error.message && error.message.length) { - hashCode += (hashCode * 397) ^ Utils.getHashCode(error.message); - } - if (error.stack_trace && error.stack_trace.length) { - hashCode += (hashCode * 397) ^ Utils.getHashCode(JSON.stringify(error.stack_trace)); - } - error = error.inner; - } - return hashCode; - } - var error = context.event.data['@error']; - var hashCode = getHashCode(error); - if (hashCode) { - var count = context.event.count || 1; - var now_1 = this._getCurrentTime(); - var merged = this._mergedEvents.filter(function (s) { return s.hashCode === hashCode; })[0]; - if (merged) { - merged.incrementCount(count); - merged.updateDate(context.event.date); - context.log.info('Ignoring duplicate event with hash: ' + hashCode); - context.cancelled = true; - } - if (!context.cancelled && this._processedHashcodes.some(function (h) { return h.hash === hashCode && h.timestamp >= (now_1 - _this._interval); })) { - context.log.trace('Adding event with hash: ' + hashCode); - this._mergedEvents.push(new MergedEvent(hashCode, context, count)); - context.cancelled = true; - } - if (!context.cancelled) { - context.log.trace('Enqueueing event with hash: ' + hashCode + 'to cache.'); - this._processedHashcodes.push({ hash: hashCode, timestamp: now_1 }); - while (this._processedHashcodes.length > 50) { - this._processedHashcodes.shift(); - } - } - } - next && next(); - }; - return DuplicateCheckerPlugin; -}()); -exports.DuplicateCheckerPlugin = DuplicateCheckerPlugin; -var MergedEvent = (function () { - function MergedEvent(hashCode, context, count) { - this.hashCode = hashCode; - this._context = context; - this._count = count; - } - MergedEvent.prototype.incrementCount = function (count) { - this._count += count; - }; - MergedEvent.prototype.resubmit = function () { - this._context.event.count = this._count; - this._context.client.config.queue.enqueue(this._context.event); - }; - MergedEvent.prototype.updateDate = function (date) { - if (date > this._context.event.date) { - this._context.event.date = date; - } - }; - return MergedEvent; -}()); -var EnvironmentInfoPlugin = (function () { - function EnvironmentInfoPlugin() { - this.priority = 80; - this.name = 'EnvironmentInfoPlugin'; - } - EnvironmentInfoPlugin.prototype.run = function (context, next) { - var ENVIRONMENT_KEY = '@environment'; - var collector = context.client.config.environmentInfoCollector; - if (!context.event.data[ENVIRONMENT_KEY] && collector) { - var environmentInfo = collector.getEnvironmentInfo(context); - if (!!environmentInfo) { - context.event.data[ENVIRONMENT_KEY] = environmentInfo; - } - } - next && next(); - }; - return EnvironmentInfoPlugin; -}()); -exports.EnvironmentInfoPlugin = EnvironmentInfoPlugin; -var ErrorPlugin = (function () { - function ErrorPlugin() { - this.priority = 30; - this.name = 'ErrorPlugin'; - } - ErrorPlugin.prototype.run = function (context, next) { - var ERROR_KEY = '@error'; - var ignoredProperties = [ - 'arguments', - 'column', - 'columnNumber', - 'description', - 'fileName', - 'message', - 'name', - 'number', - 'line', - 'lineNumber', - 'opera#sourceloc', - 'sourceId', - 'sourceURL', - 'stack', - 'stackArray', - 'stacktrace' - ]; - var exception = context.contextData.getException(); - if (!!exception) { - context.event.type = 'error'; - if (!context.event.data[ERROR_KEY]) { - var config = context.client.config; - var parser = config.errorParser; - if (!parser) { - throw new Error('No error parser was defined.'); - } - var result = parser.parse(context, exception); - if (!!result) { - var additionalData = JSON.parse(Utils.stringify(exception, config.dataExclusions.concat(ignoredProperties))); - if (!Utils.isEmpty(additionalData)) { - if (!result.data) { - result.data = {}; - } - result.data['@ext'] = additionalData; - } - context.event.data[ERROR_KEY] = result; - } - } - } - next && next(); - }; - return ErrorPlugin; -}()); -exports.ErrorPlugin = ErrorPlugin; -var EventExclusionPlugin = (function () { - function EventExclusionPlugin() { - this.priority = 45; - this.name = 'EventExclusionPlugin'; - } - EventExclusionPlugin.prototype.run = function (context, next) { - function getLogLevel(level) { - switch ((level || '').toLowerCase().trim()) { - case 'trace': - case 'true': - case '1': - case 'yes': - return 0; - case 'debug': - return 1; - case 'info': - return 2; - case 'warn': - return 3; - case 'error': - return 4; - case 'fatal': - return 5; - case 'off': - case 'false': - case '0': - case 'no': - return 6; - default: - return -1; - } - } - function getMinLogLevel(settings, loggerName) { - if (loggerName === void 0) { loggerName = '*'; } - return getLogLevel(getTypeAndSourceSetting(settings, 'log', loggerName, 'Trace') + ''); - } - function getTypeAndSourceSetting(settings, type, source, defaultValue) { - if (settings === void 0) { settings = {}; } - if (!type) { - return defaultValue; - } - var isLog = type === 'log'; - var sourcePrefix = "@@" + type + ":"; - var value = settings[sourcePrefix + source]; - if (value) { - return !isLog ? Utils.toBoolean(value) : value; - } - for (var key in settings) { - if (Utils.startsWith(key.toLowerCase(), sourcePrefix.toLowerCase()) && Utils.isMatch(source, [key.substring(sourcePrefix.length)])) { - return !isLog ? Utils.toBoolean(settings[key]) : settings[key]; - } - } - return defaultValue; - } - var ev = context.event; - var log = context.log; - var settings = context.client.config.settings; - if (ev.type === 'log') { - var minLogLevel = getMinLogLevel(settings, ev.source); - var logLevel = getLogLevel(ev.data['@level']); - if (logLevel >= 0 && (logLevel > 5 || logLevel < minLogLevel)) { - log.info('Cancelling log event due to minimum log level.'); - context.cancelled = true; - } - } - else if (ev.type === 'error') { - var error = ev.data['@error']; - while (!context.cancelled && error) { - if (getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) { - log.info("Cancelling error from excluded exception type: " + error.type); - context.cancelled = true; - } - error = error.inner; - } - } - else if (getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) { - log.info("Cancelling event from excluded type: " + ev.type + " and source: " + ev.source); - context.cancelled = true; - } - next && next(); - }; - return EventExclusionPlugin; -}()); -exports.EventExclusionPlugin = EventExclusionPlugin; -var ModuleInfoPlugin = (function () { - function ModuleInfoPlugin() { - this.priority = 50; - this.name = 'ModuleInfoPlugin'; - } - ModuleInfoPlugin.prototype.run = function (context, next) { - var ERROR_KEY = '@error'; - var collector = context.client.config.moduleCollector; - if (context.event.data[ERROR_KEY] && !context.event.data['@error'].modules && !!collector) { - var modules = collector.getModules(context); - if (modules && modules.length > 0) { - context.event.data[ERROR_KEY].modules = modules; - } - } - next && next(); - }; - return ModuleInfoPlugin; -}()); -exports.ModuleInfoPlugin = ModuleInfoPlugin; -var RequestInfoPlugin = (function () { - function RequestInfoPlugin() { - this.priority = 70; - this.name = 'RequestInfoPlugin'; - } - RequestInfoPlugin.prototype.run = function (context, next) { - var REQUEST_KEY = '@request'; - var config = context.client.config; - var collector = config.requestInfoCollector; - if (!context.event.data[REQUEST_KEY] && !!collector) { - var requestInfo = collector.getRequestInfo(context); - if (!!requestInfo) { - if (Utils.isMatch(requestInfo.user_agent, config.userAgentBotPatterns)) { - context.log.info('Cancelling event as the request user agent matches a known bot pattern'); - context.cancelled = true; - } - else { - context.event.data[REQUEST_KEY] = requestInfo; - } - } - } - next && next(); - }; - return RequestInfoPlugin; -}()); -exports.RequestInfoPlugin = RequestInfoPlugin; -var SubmissionMethodPlugin = (function () { - function SubmissionMethodPlugin() { - this.priority = 100; - this.name = 'SubmissionMethodPlugin'; - } - SubmissionMethodPlugin.prototype.run = function (context, next) { - var submissionMethod = context.contextData.getSubmissionMethod(); - if (!!submissionMethod) { - context.event.data['@submission_method'] = submissionMethod; - } - next && next(); - }; - return SubmissionMethodPlugin; -}()); -exports.SubmissionMethodPlugin = SubmissionMethodPlugin; -var InMemoryStorage = (function () { - function InMemoryStorage(maxItems) { - this.items = []; - this.lastTimestamp = 0; - this.maxItems = maxItems; - } - InMemoryStorage.prototype.save = function (value) { - if (!value) { - return null; - } - var items = this.items; - var timestamp = Math.max(Date.now(), this.lastTimestamp + 1); - var item = { timestamp: timestamp, value: value }; - if (items.push(item) > this.maxItems) { - items.shift(); - } - this.lastTimestamp = timestamp; - return item.timestamp; - }; - InMemoryStorage.prototype.get = function (limit) { - return this.items.slice(0, limit); - }; - InMemoryStorage.prototype.remove = function (timestamp) { - var items = this.items; - for (var i = 0; i < items.length; i++) { - if (items[i].timestamp === timestamp) { - items.splice(i, 1); - return; - } - } - }; - InMemoryStorage.prototype.clear = function () { - this.items = []; - }; - return InMemoryStorage; -}()); -exports.InMemoryStorage = InMemoryStorage; -var KeyValueStorageBase = (function () { - function KeyValueStorageBase(maxItems) { - this.lastTimestamp = 0; - this.maxItems = maxItems; - } - KeyValueStorageBase.prototype.save = function (value, single) { - if (!value) { - return null; - } - this.ensureIndex(); - var items = this.items; - var timestamp = Math.max(Date.now(), this.lastTimestamp + 1); - var key = this.getKey(timestamp); - var json = JSON.stringify(value); - try { - this.write(key, json); - this.lastTimestamp = timestamp; - if (items.push(timestamp) > this.maxItems) { - this.delete(this.getKey(items.shift())); - } - } - catch (e) { - return null; - } - return timestamp; - }; - KeyValueStorageBase.prototype.get = function (limit) { - var _this = this; - this.ensureIndex(); - return this.items.slice(0, limit) - .map(function (timestamp) { - var key = _this.getKey(timestamp); - try { - var json = _this.read(key); - var value = JSON.parse(json, parseDate); - return { timestamp: timestamp, value: value }; - } - catch (error) { - _this.safeDelete(key); - return null; - } - }) - .filter(function (item) { return item != null; }); - }; - KeyValueStorageBase.prototype.remove = function (timestamp) { - this.ensureIndex(); - var items = this.items; - var index = items.indexOf(timestamp); - if (index >= 0) { - var key = this.getKey(timestamp); - this.safeDelete(key); - items.splice(index, 1); - } - }; - KeyValueStorageBase.prototype.clear = function () { - var _this = this; - this.items.forEach(function (item) { return _this.safeDelete(_this.getKey(item)); }); - this.items = []; - }; - KeyValueStorageBase.prototype.ensureIndex = function () { - if (!this.items) { - this.items = this.createIndex(); - this.lastTimestamp = Math.max.apply(Math, [0].concat(this.items)) + 1; - } - }; - KeyValueStorageBase.prototype.safeDelete = function (key) { - try { - this.delete(key); - } - catch (error) { - } - }; - KeyValueStorageBase.prototype.createIndex = function () { - var _this = this; - try { - var keys = this.readAllKeys(); - return keys.map(function (key) { - try { - var timestamp = _this.getTimestamp(key); - if (!timestamp) { - _this.safeDelete(key); - return null; - } - return timestamp; - } - catch (error) { - _this.safeDelete(key); - return null; - } - }).filter(function (timestamp) { return timestamp != null; }) - .sort(function (a, b) { return a - b; }); - } - catch (error) { - return []; - } - }; - return KeyValueStorageBase; -}()); -exports.KeyValueStorageBase = KeyValueStorageBase; -function parseDate(key, value) { - var dateRegx = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/g; - if (typeof value === 'string') { - var a = dateRegx.exec(value); - if (a) { - return new Date(value); - } - } - return value; -} -var NodeFileStorage = (function (_super) { - __extends(NodeFileStorage, _super); - function NodeFileStorage(namespace, folder, prefix, maxItems, fs) { - if (prefix === void 0) { prefix = 'ex-'; } - if (maxItems === void 0) { maxItems = 20; } - var _this = _super.call(this, maxItems) || this; - if (!folder) { - folder = Path.join(Path.dirname(require.main.filename), '.exceptionless'); - } - var subfolder = Path.join(folder, namespace); - _this.directory = Path.resolve(subfolder); - _this.prefix = prefix; - _this.fs = fs ? fs : Fs; - _this.mkdir(_this.directory); - return _this; - } - NodeFileStorage.prototype.write = function (key, value) { - this.fs.writeFileSync(key, value); - }; - NodeFileStorage.prototype.read = function (key) { - return this.fs.readFileSync(key, 'utf8'); - }; - NodeFileStorage.prototype.readAllKeys = function () { - var _this = this; - return this.fs.readdirSync(this.directory) - .filter(function (file) { return file.indexOf(_this.prefix) === 0; }) - .map(function (file) { return Path.join(_this.directory, file); }); - }; - NodeFileStorage.prototype.delete = function (key) { - this.fs.unlinkSync(key); - }; - NodeFileStorage.prototype.getKey = function (timestamp) { - return Path.join(this.directory, "" + this.prefix + timestamp + ".json"); - }; - NodeFileStorage.prototype.getTimestamp = function (key) { - return parseInt(Path.basename(key, '.json') - .substr(this.prefix.length), 10); - }; - NodeFileStorage.prototype.mkdir = function (path) { - var dirs = path.split(Path.sep); - var root = ''; - while (dirs.length > 0) { - var dir = dirs.shift(); - if (dir === '') { - root = Path.sep; - } - if (!this.fs.existsSync(root + dir)) { - this.fs.mkdirSync(root + dir); - } - root += dir + Path.sep; - } - }; - return NodeFileStorage; -}(KeyValueStorageBase)); -exports.NodeFileStorage = NodeFileStorage; -var NodeEnvironmentInfoCollector = (function () { - function NodeEnvironmentInfoCollector() { - } - NodeEnvironmentInfoCollector.prototype.getEnvironmentInfo = function (context) { - function getIpAddresses() { - var ips = []; - var interfaces = os.networkInterfaces(); - Object.keys(interfaces).forEach(function (name) { - interfaces[name].forEach(function (iface) { - if ('IPv4' === iface.family && !iface.internal) { - ips.push(iface.address); - } - }); - }); - return ips.join(', '); - } - if (!os) { - return null; - } - var environmentInfo = { - processor_count: os.cpus().length, - total_physical_memory: os.totalmem(), - available_physical_memory: os.freemem(), - command_line: process.argv.join(' '), - process_name: (process.title || '').replace(/[\uE000-\uF8FF]/g, ''), - process_id: process.pid + '', - process_memory_size: process.memoryUsage().heapTotal, - architecture: os.arch(), - o_s_name: os.type(), - o_s_version: os.release(), - ip_address: getIpAddresses(), - machine_name: os.hostname(), - runtime_version: process.version, - data: { - loadavg: os.loadavg(), - platform: os.platform(), - tmpdir: os.tmpdir(), - uptime: os.uptime() - } - }; - if (os.endianness) { - environmentInfo.data.endianness = os.endianness(); - } - return environmentInfo; - }; - return NodeEnvironmentInfoCollector; -}()); -exports.NodeEnvironmentInfoCollector = NodeEnvironmentInfoCollector; -var NodeErrorParser = (function () { - function NodeErrorParser() { - } - NodeErrorParser.prototype.parse = function (context, exception) { - function getStackFrames(stackFrames) { - var frames = []; - for (var _i = 0, stackFrames_1 = stackFrames; _i < stackFrames_1.length; _i++) { - var frame = stackFrames_1[_i]; - frames.push({ - name: frame.getMethodName() || frame.getFunctionName(), - file_name: frame.getFileName(), - line_number: frame.getLineNumber() || 0, - column: frame.getColumnNumber() || 0, - declaring_type: frame.getTypeName(), - data: { - is_native: frame.isNative() || (!!frame.filename && frame.filename[0] !== '/' && frame.filename[0] !== '.') - } - }); - } - return frames; - } - if (!nodestacktrace) { - throw new Error('Unable to load the stack trace library.'); - } - var stackFrames = nodestacktrace.parse(exception) || []; - return { - type: exception.name || 'Error', - message: exception.message, - stack_trace: getStackFrames(stackFrames) - }; - }; - return NodeErrorParser; -}()); -exports.NodeErrorParser = NodeErrorParser; -var NodeModuleCollector = (function () { - function NodeModuleCollector() { - this.initialized = false; - this.installedModules = {}; - } - NodeModuleCollector.prototype.getModules = function (context) { - var _this = this; - this.initialize(); - if (!require.main) { - return []; - } - var modulePath = path.dirname(require.main.filename) + '/node_modules/'; - var pathLength = modulePath.length; - var loadedKeys = Object.keys(require.cache); - var loadedModules = {}; - loadedKeys.forEach(function (key) { - var id = key.substr(pathLength); - id = id.substr(0, id.indexOf('/')); - loadedModules[id] = true; - }); - return Object.keys(loadedModules) - .map(function (key) { return _this.installedModules[key]; }) - .filter(function (m) { return m !== undefined; }); - }; - NodeModuleCollector.prototype.initialize = function () { - var _this = this; - if (this.initialized) { - return; - } - this.initialized = true; - var output = child.spawnSync('npm', ['ls', '--depth=0', '--json']).stdout; - if (!output) { - return; - } - var json; - try { - json = JSON.parse(output.toString()); - } - catch (e) { - return; - } - var items = json.dependencies; - if (!items) { - return; - } - var id = 0; - this.installedModules = {}; - Object.keys(items).forEach(function (key) { - var item = items[key]; - var theModule = { - module_id: id++, - name: key, - version: item.version - }; - _this.installedModules[key] = theModule; - }); - }; - return NodeModuleCollector; -}()); -exports.NodeModuleCollector = NodeModuleCollector; -var NodeRequestInfoCollector = (function () { - function NodeRequestInfoCollector() { - } - NodeRequestInfoCollector.prototype.getRequestInfo = function (context) { - var REQUEST_KEY = '@request'; - if (!context.contextData[REQUEST_KEY]) { - return null; - } - var exclusions = context.client.config.dataExclusions; - var request = context.contextData[REQUEST_KEY]; - var requestInfo = { - client_ip_address: request.ip, - user_agent: request.headers['user-agent'], - is_secure: request.secure, - http_method: request.method, - host: request.hostname || request.host, - path: request.path, - post_data: JSON.parse(Utils.stringify(request.body || {}, exclusions)), - cookies: Utils.getCookies(request.headers.cookie, exclusions), - query_string: JSON.parse(Utils.stringify(request.params || {}, exclusions)) - }; - var host = request.headers.host; - var port = host && parseInt(host.slice(host.indexOf(':') + 1), 10); - if (port > 0) { - requestInfo.port = port; - } - return requestInfo; - }; - return NodeRequestInfoCollector; -}()); -exports.NodeRequestInfoCollector = NodeRequestInfoCollector; -var NodeFileStorageProvider = (function () { - function NodeFileStorageProvider(folder, prefix, maxQueueItems) { - if (maxQueueItems === void 0) { maxQueueItems = 250; } - this.queue = new NodeFileStorage('q', folder, prefix, maxQueueItems); - this.settings = new NodeFileStorage('settings', folder, prefix, 1); - } - return NodeFileStorageProvider; -}()); -exports.NodeFileStorageProvider = NodeFileStorageProvider; -var NodeSubmissionAdapter = (function () { - function NodeSubmissionAdapter() { - } - NodeSubmissionAdapter.prototype.sendRequest = function (request, callback, isAppExiting) { - var _this = this; - if (isAppExiting) { - this.sendRequestSync(request, callback); - return; - } - var parsedHost = url.parse(request.url); - var options = { - auth: "client:" + request.apiKey, - headers: {}, - hostname: parsedHost.hostname, - method: request.method, - port: parsedHost.port && parseInt(parsedHost.port, 10), - path: request.url - }; - options.headers['User-Agent'] = request.userAgent; - if (request.method === 'POST') { - options.headers = { - 'Content-Type': 'application/json', - 'Content-Length': Buffer.byteLength(request.data) - }; - } - var protocol = (parsedHost.protocol === 'https' ? https : http); - var clientRequest = protocol.request(options, function (response) { - var body = ''; - response.setEncoding('utf8'); - response.on('data', function (chunk) { return body += chunk; }); - response.on('end', function () { return _this.complete(response, body, response.headers, callback); }); - }); - clientRequest.on('error', function (error) { return callback && callback(500, error.message); }); - clientRequest.end(request.data); - }; - NodeSubmissionAdapter.prototype.complete = function (response, responseBody, responseHeaders, callback) { - var message; - if (response.statusCode === 0) { - message = 'Unable to connect to server.'; - } - else if (response.statusCode < 200 || response.statusCode > 299) { - message = response.statusMessage || response.message; - } - callback && callback(response.statusCode || 500, message, responseBody, responseHeaders); - }; - NodeSubmissionAdapter.prototype.sendRequestSync = function (request, callback) { - var requestJson = JSON.stringify(request); - var res = child.spawnSync(process.execPath, [require.resolve('./submitSync.js')], { - input: requestJson, - stdio: ['pipe', 'pipe', process.stderr] - }); - var out = res.stdout.toString(); - var result = JSON.parse(out); - callback && callback(result.status, result.message, result.data, result.headers); - }; - return NodeSubmissionAdapter; -}()); -exports.NodeSubmissionAdapter = NodeSubmissionAdapter; -(function init() { - if (typeof process === 'undefined') { - return; - } - var defaults = Configuration.defaults; - defaults.environmentInfoCollector = new NodeEnvironmentInfoCollector(); - defaults.errorParser = new NodeErrorParser(); - defaults.moduleCollector = new NodeModuleCollector(); - defaults.requestInfoCollector = new NodeRequestInfoCollector(); - defaults.submissionAdapter = new NodeSubmissionAdapter(); - Configuration.prototype.useLocalStorage = function () { - this.storage = new NodeFileStorageProvider(); - SettingsManager.applySavedServerSettings(this); - this.changed(); - }; - process.addListener('uncaughtException', function (error) { - ExceptionlessClient.default.submitUnhandledException(error, 'uncaughtException'); - }); - process.on('exit', function (code) { - function getExitCodeReason(exitCode) { - if (exitCode === 1) { - return 'Uncaught Fatal Exception'; - } - if (exitCode === 3) { - return 'Internal JavaScript Parse Error'; - } - if (exitCode === 4) { - return 'Internal JavaScript Evaluation Failure'; - } - if (exitCode === 5) { - return 'Fatal Exception'; - } - if (exitCode === 6) { - return 'Non-function Internal Exception Handler '; - } - if (exitCode === 7) { - return 'Internal Exception Handler Run-Time Failure'; - } - if (exitCode === 8) { - return 'Uncaught Exception'; - } - if (exitCode === 9) { - return 'Invalid Argument'; - } - if (exitCode === 10) { - return 'Internal JavaScript Run-Time Failure'; - } - if (exitCode === 12) { - return 'Invalid Debug Argument'; - } - return null; - } - var client = ExceptionlessClient.default; - var message = getExitCodeReason(code); - if (message !== null) { - client.submitLog('exit', message, 'Error'); - } - client.config.queue.process(true); - }); - Error.stackTraceLimit = Infinity; -})(); -//# sourceMappingURL=exceptionless.node.js.map diff --git a/dist/exceptionless.node.js.map b/dist/exceptionless.node.js.map deleted file mode 100644 index ea3f24ba..00000000 --- a/dist/exceptionless.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exceptionless.node.js","sources":["exceptionless.node.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uBAA0B;AAC1B,4CAA+C;AAC/C,qCAAwC;AACxC,2BAA8B;AAC9B,uBAAyB;AACzB,2BAA6B;AAC7B,2BAA8B;AAC9B,6BAAgC;AAChC,yBAA4B;AAgB5B;IAAA;QAMU,qBAAgB,GAAW,IAAI,CAAC;IAwB1C,CAAC;IAlBQ,+CAAO,GAAd;QACE,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAKM,iDAAS,GAAhB;QACE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;IAMM,+CAAO,GAAd,UAAe,OAAe;QAC5B,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;IAClC,CAAC;IACH,oCAAC;AAAD,C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AAC,sCAAsC,CAAC;YAChD,CAAC;YAED,EAAE,CAAC,CAAC,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC;gBACpB,MAAM,CAAC,wBAAwB,CAAC;YAClC,CAAC;YAED,MAAM,CAAC,IAAI,CAAC;QACd,CAAC;QAED,IAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC3C,IAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAExC,EAAE,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC;YACrB,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7C,CAAC;QAED,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC,CAAC,CAAC,CAAC;IAEF,KAAa,CAAC,eAAe,GAAG,QAAQ,CAAC;AAC5C,CAAC,CAAC,EAAE,CAAC","sourcesContent":["import os = require('os');\nimport nodestacktrace = require('stack-trace');\nimport child = require('child_process');\nimport path = require('path');\nimport * as Fs from 'fs';\nimport * as Path from 'path';\nimport http = require('http');\nimport https = require('https');\nimport url = require('url');\nexport interface ILastReferenceIdManager {\n getLast(): string;\n clearLast(): void;\n setLast(eventId: string): void;\n}\n\nexport interface ILog {\n trace(message: string): void;\n info(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n}\n\n \n\nexport class DefaultLastReferenceIdManager implements ILastReferenceIdManager {\n /**\n * Gets the last event's reference id that was submitted to the server.\n * @type {string}\n * @private\n */\n private _lastReferenceId: string = null;\n\n /**\n * Gets the last event's reference id that was submitted to the server.\n * @returns {string}\n */\n public getLast(): string {\n return this._lastReferenceId;\n }\n\n /**\n * Clears the last event's reference id.\n */\n public clearLast(): void {\n this._lastReferenceId = null;\n }\n\n /**\n * Sets the last event's reference id.\n * @param eventId\n */\n public setLast(eventId: string): void {\n this._lastReferenceId = eventId;\n }\n}\n\n \n\nexport class ConsoleLog implements ILog {\n public trace(message: string): void {\n this.log('debug', message);\n }\n\n public info(message: string): void {\n this.log('info', message);\n }\n\n public warn(message: string): void {\n this.log('warn', message);\n }\n\n public error(message: string): void {\n this.log('error', message);\n }\n\n private log(level: string, message: string) {\n if (console) {\n const msg = `[${level}] Exceptionless: ${message}`;\n\n if (console[level]) {\n console[level](msg);\n } else if (console.log) {\n console[`log`](msg);\n }\n }\n }\n}\n\n \n\nexport class NullLog implements ILog {\n public trace(message: string): void { }\n public info(message: string): void { }\n public warn(message: string): void { }\n public error(message: string): void { }\n}\n\nexport interface IUserInfo {\n identity?: string;\n name?: string;\n data?: any;\n}\n\n \n\nexport class HeartbeatPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = 'HeartbeatPlugin';\n\n private _interval: number;\n private _intervalId: any;\n\n constructor(heartbeatInterval: number = 30000) {\n this._interval = heartbeatInterval;\n }\n\n public run(context: EventPluginContext, next?: () => void): void {\n clearInterval(this._intervalId);\n\n const user: IUserInfo = context.event.data['@user'];\n if (user && user.identity) {\n this._intervalId = setInterval(() => context.client.submitSessionHeartbeat(user.identity), this._interval);\n }\n\n next && next();\n }\n}\n\n \n\nexport class ReferenceIdPlugin implements IEventPlugin {\n public priority: number = 20;\n public name: string = 'ReferenceIdPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n if ((!context.event.reference_id || context.event.reference_id.length === 0) && context.event.type === 'error') {\n context.event.reference_id = Utils.guid().replace('-', '').substring(0, 10);\n }\n\n next && next();\n }\n}\n\n \n\nexport class EventPluginContext {\n public cancelled: boolean;\n public client: ExceptionlessClient;\n public event: IEvent;\n public contextData: ContextData;\n\n constructor(client: ExceptionlessClient, event: IEvent, contextData?: ContextData) {\n this.client = client;\n this.event = event;\n this.contextData = contextData ? contextData : new ContextData();\n }\n\n public get log(): ILog {\n return this.client.config.log;\n }\n}\n\n \n\nexport class EventPluginManager {\n public static run(context: EventPluginContext, callback: (context?: EventPluginContext) => void): void {\n const wrap = (plugin: IEventPlugin, next?: () => void): () => void => {\n return () => {\n try {\n if (!context.cancelled) {\n plugin.run(context, next);\n }\n } catch (ex) {\n context.cancelled = true;\n context.log.error(`Error running plugin '${plugin.name}': ${ex.message}. Discarding Event.`);\n }\n\n if (context.cancelled && !!callback) {\n callback(context);\n }\n };\n };\n\n const plugins: IEventPlugin[] = context.client.config.plugins; // optimization for minifier.\n const wrappedPlugins: Array<() => void> = [];\n if (!!callback) {\n wrappedPlugins[plugins.length] = wrap({ name: 'cb', priority: 9007199254740992, run: callback }, null);\n }\n\n for (let index = plugins.length - 1; index > -1; index--) {\n wrappedPlugins[index] = wrap(plugins[index], !!callback || (index < plugins.length - 1) ? wrappedPlugins[index + 1] : null);\n }\n\n wrappedPlugins[0]();\n }\n\n public static addDefaultPlugins(config: Configuration): void {\n config.addPlugin(new ConfigurationDefaultsPlugin());\n config.addPlugin(new ErrorPlugin());\n config.addPlugin(new DuplicateCheckerPlugin());\n config.addPlugin(new EventExclusionPlugin());\n config.addPlugin(new ModuleInfoPlugin());\n config.addPlugin(new RequestInfoPlugin());\n config.addPlugin(new EnvironmentInfoPlugin());\n config.addPlugin(new SubmissionMethodPlugin());\n }\n}\n\n \n\nexport interface IEventPlugin {\n priority?: number;\n name?: string;\n run(context: EventPluginContext, next?: () => void): void;\n}\n\n \n\nexport class DefaultEventQueue implements IEventQueue {\n /**\n * The configuration object.\n * @type {Configuration}\n * @private\n */\n private _config: Configuration;\n\n /**\n * A list of handlers that will be fired when events are submitted.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(events: IEvent[], response: SubmissionResponse) => void> = [];\n\n /**\n * Suspends processing until the specified time.\n * @type {Date}\n * @private\n */\n private _suspendProcessingUntil: Date;\n\n /**\n * Discards queued items until the specified time.\n * @type {Date}\n * @private\n */\n private _discardQueuedItemsUntil: Date;\n\n /**\n * Returns true if the queue is processing.\n * @type {boolean}\n * @private\n */\n private _processingQueue: boolean = false;\n\n /**\n * Processes the queue every xx seconds.\n * @type {Timer}\n * @private\n */\n private _queueTimer: any;\n\n constructor(config: Configuration) {\n this._config = config;\n }\n\n public enqueue(event: IEvent): void {\n const eventWillNotBeQueued: string = 'The event will not be queued.'; // optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (this.areQueuedItemsDiscarded()) {\n log.info(`Queue items are currently being discarded. ${eventWillNotBeQueued}`);\n return;\n }\n\n this.ensureQueueTimer();\n\n const timestamp = config.storage.queue.save(event);\n const logText = `type=${event.type} ${!!event.reference_id ? 'refid=' + event.reference_id : ''}`;\n if (timestamp) {\n log.info(`Enqueuing event: ${timestamp} ${logText}`);\n } else {\n log.error(`Could not enqueue event ${logText}`);\n }\n }\n\n public process(isAppExiting?: boolean): void {\n const queueNotProcessed: string = 'The queue will not be processed.'; // optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (this._processingQueue) {\n return;\n }\n\n log.info('Processing queue...');\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${queueNotProcessed}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${queueNotProcessed}`);\n return;\n }\n\n this._processingQueue = true;\n this.ensureQueueTimer();\n\n try {\n const events = config.storage.queue.get(config.submissionBatchSize);\n if (!events || events.length === 0) {\n this._processingQueue = false;\n return;\n }\n\n log.info(`Sending ${events.length} events to ${config.serverUrl}.`);\n config.submissionClient.postEvents(events.map((e) => e.value), config, (response: SubmissionResponse) => {\n this.processSubmissionResponse(response, events);\n this.eventsPosted(events.map((e) => e.value), response);\n log.info('Finished processing queue.');\n this._processingQueue = false;\n }, isAppExiting);\n } catch (ex) {\n log.error(`Error processing queue: ${ex}`);\n this.suspendProcessing();\n this._processingQueue = false;\n }\n }\n\n public suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void {\n const config: Configuration = this._config; // Optimization for minifier.\n\n if (!durationInMinutes || durationInMinutes <= 0) {\n durationInMinutes = 5;\n }\n\n config.log.info(`Suspending processing for ${durationInMinutes} minutes.`);\n this._suspendProcessingUntil = new Date(new Date().getTime() + (durationInMinutes * 60000));\n\n if (discardFutureQueuedItems) {\n this._discardQueuedItemsUntil = this._suspendProcessingUntil;\n }\n\n if (clearQueue) {\n // Account is over the limit and we want to ensure that the sample size being sent in will contain newer errors.\n config.storage.queue.clear();\n }\n }\n\n public onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void {\n !!handler && this._handlers.push(handler);\n }\n\n private eventsPosted(events: IEvent[], response: SubmissionResponse) {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(events, response);\n } catch (ex) {\n this._config.log.error(`Error calling onEventsPosted handler: ${ex}`);\n }\n }\n }\n\n private areQueuedItemsDiscarded(): boolean {\n return this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date();\n }\n\n private ensureQueueTimer(): void {\n if (!this._queueTimer) {\n this._queueTimer = setInterval(() => this.onProcessQueue(), 10000);\n }\n }\n\n private isQueueProcessingSuspended(): boolean {\n return this._suspendProcessingUntil && this._suspendProcessingUntil > new Date();\n }\n\n private onProcessQueue(): void {\n if (!this.isQueueProcessingSuspended() && !this._processingQueue) {\n this.process();\n }\n }\n\n private processSubmissionResponse(response: SubmissionResponse, events: IStorageItem[]): void {\n const noSubmission: string = 'The event will not be submitted.'; // Optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (response.success) {\n log.info(`Sent ${events.length} events.`);\n this.removeEvents(events);\n return;\n }\n\n if (response.serviceUnavailable) {\n // You are currently over your rate limit or the servers are under stress.\n log.error('Server returned service unavailable.');\n this.suspendProcessing();\n return;\n }\n\n if (response.paymentRequired) {\n // If the organization over the rate limit then discard the event.\n log.info('Too many events have been submitted, please upgrade your plan.');\n this.suspendProcessing(null, true, true);\n return;\n }\n\n if (response.unableToAuthenticate) {\n // The api key was suspended or could not be authorized.\n log.info(`Unable to authenticate, please check your configuration. ${noSubmission}`);\n this.suspendProcessing(15);\n this.removeEvents(events);\n return;\n }\n\n if (response.notFound || response.badRequest) {\n // The service end point could not be found.\n log.error(`Error while trying to submit data: ${response.message}`);\n this.suspendProcessing(60 * 4);\n this.removeEvents(events);\n return;\n }\n\n if (response.requestEntityTooLarge) {\n const message = 'Event submission discarded for being too large.';\n if (config.submissionBatchSize > 1) {\n log.error(`${message} Retrying with smaller batch size.`);\n config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5));\n } else {\n log.error(`${message} ${noSubmission}`);\n this.removeEvents(events);\n }\n\n return;\n }\n\n if (!response.success) {\n log.error(`Error submitting events: ${response.message || 'Please check the network tab for more info.'}`);\n this.suspendProcessing();\n }\n }\n\n private removeEvents(events: IStorageItem[]) {\n for (let index = 0; index < (events || []).length; index++) {\n this._config.storage.queue.remove(events[index].timestamp);\n }\n }\n}\n\n \n\nexport interface IEventQueue {\n enqueue(event: IEvent): void;\n process(isAppExiting?: boolean): void;\n suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void;\n onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void;\n}\n\n \n\nexport interface IEnvironmentInfoCollector {\n getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo;\n}\n\n \n\nexport interface IErrorParser {\n parse(context: EventPluginContext, exception: Error): IError;\n}\n\n \n\nexport interface IModuleCollector {\n getModules(context: EventPluginContext): IModule[];\n}\n\n \n\nexport interface IRequestInfoCollector {\n getRequestInfo(context: EventPluginContext): IRequestInfo;\n}\n\n \n\nexport class InMemoryStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(maxQueueItems: number = 250) {\n this.queue = new InMemoryStorage(maxQueueItems);\n this.settings = new InMemoryStorage(1);\n }\n\n}\n\n \n\nexport interface IStorageProvider {\n queue: IStorage;\n settings: IStorage;\n}\n\n \n\n// tslint:disable-next-line:prefer-const\ndeclare var XDomainRequest: { new (); create(); };\n\nexport class DefaultSubmissionClient implements ISubmissionClient {\n public configurationVersionHeader: string = 'x-exceptionless-configversion';\n\n public postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void {\n const data = JSON.stringify(events);\n const request = this.createRequest(config, 'POST', `${config.serverUrl}/api/v2/events`, data);\n const cb = this.createSubmissionCallback(config, callback);\n\n return config.submissionAdapter.sendRequest(request, cb, isAppExiting);\n }\n\n public postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void {\n const path = `${config.serverUrl}/api/v2/events/by-ref/${encodeURIComponent(referenceId)}/user-description`;\n const data = JSON.stringify(description);\n const request = this.createRequest(config, 'POST', path, data);\n const cb = this.createSubmissionCallback(config, callback);\n\n return config.submissionAdapter.sendRequest(request, cb);\n }\n\n public getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void {\n const request = this.createRequest(config, 'GET', `${config.serverUrl}/api/v2/projects/config?v=${version}`);\n const cb = (status, message, data?, headers?) => {\n if (status !== 200) {\n return callback(new SettingsResponse(false, null, -1, null, message));\n }\n\n let settings: IClientConfiguration;\n try {\n settings = JSON.parse(data);\n } catch (e) {\n config.log.error(`Unable to parse settings: '${data}'`);\n }\n\n if (!settings || isNaN(settings.version)) {\n return callback(new SettingsResponse(false, null, -1, null, 'Invalid configuration settings.'));\n }\n\n callback(new SettingsResponse(true, settings.settings || {}, settings.version));\n };\n\n return config.submissionAdapter.sendRequest(request, cb);\n }\n\n public sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void {\n const request = this.createRequest(config, 'GET', `${config.heartbeatServerUrl}/api/v2/events/session/heartbeat?id=${sessionIdOrUserId}&close=${closeSession}`);\n config.submissionAdapter.sendRequest(request);\n }\n\n private createRequest(config: Configuration, method: string, url: string, data: string = null): SubmissionRequest {\n return {\n method,\n url,\n data,\n apiKey: config.apiKey,\n userAgent: config.userAgent\n };\n }\n\n private createSubmissionCallback(config: Configuration, callback: (response: SubmissionResponse) => void) {\n return (status, message, data?, headers?) => {\n const settingsVersion: number = headers && parseInt(headers[this.configurationVersionHeader], 10);\n SettingsManager.checkVersion(settingsVersion, config);\n\n callback(new SubmissionResponse(status, message));\n };\n }\n}\n\n \n\nexport interface ISubmissionAdapter {\n sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void;\n}\n\n \n\nexport interface ISubmissionClient {\n postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void;\n postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void;\n getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void;\n sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void;\n}\n\nexport class Utils {\n public static addRange<T>(target: T[], ...values: T[]) {\n if (!target) {\n target = [];\n }\n\n if (!values || values.length === 0) {\n return target;\n }\n\n for (const value of values) {\n if (value && target.indexOf(value) < 0) {\n target.push(value);\n }\n }\n\n return target;\n }\n\n public static getHashCode(source: string): number {\n if (!source || source.length === 0) {\n return 0;\n }\n\n let hash: number = 0;\n for (let index = 0; index < source.length; index++) {\n const character = source.charCodeAt(index);\n hash = ((hash << 5) - hash) + character;\n hash |= 0;\n }\n\n return hash;\n }\n\n public static getCookies(cookies: string, exclusions?: string[]): object {\n const result: object = {};\n\n const parts: string[] = (cookies || '').split('; ');\n for (const part of parts) {\n const cookie: string[] = part.split('=');\n if (!Utils.isMatch(cookie[0], exclusions)) {\n result[cookie[0]] = cookie[1];\n }\n }\n\n return !Utils.isEmpty(result) ? result : null;\n }\n\n public static guid(): string {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n }\n\n // tslint:disable-next-line:ban-types\n public static merge(defaultValues: Object, values: Object) {\n const result: object = {};\n\n for (const key in defaultValues || {}) {\n if (!!defaultValues[key]) {\n result[key] = defaultValues[key];\n }\n }\n\n for (const key in values || {}) {\n if (!!values[key]) {\n result[key] = values[key];\n }\n }\n\n return result;\n }\n\n public static parseVersion(source: string): string {\n if (!source) {\n return null;\n }\n\n const versionRegex = /(v?((\\d+)\\.(\\d+)(\\.(\\d+))?)(?:-([\\dA-Za-z\\-]+(?:\\.[\\dA-Za-z\\-]+)*))?(?:\\+([\\dA-Za-z\\-]+(?:\\.[\\dA-Za-z\\-]+)*))?)/;\n const matches = versionRegex.exec(source);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n\n return null;\n }\n\n public static parseQueryString(query: string, exclusions?: string[]) {\n if (!query || query.length === 0) {\n return null;\n }\n\n const pairs: string[] = query.split('&');\n if (pairs.length === 0) {\n return null;\n }\n\n const result: object = {};\n for (const pair of pairs) {\n const parts = pair.split('=');\n if (!Utils.isMatch(parts[0], exclusions)) {\n result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);\n }\n }\n\n return !Utils.isEmpty(result) ? result : null;\n }\n\n public static randomNumber(): number {\n return Math.floor(Math.random() * 9007199254740992);\n }\n\n /**\n * Checks to see if a value matches a pattern.\n * @param input the value to check against the @pattern.\n * @param pattern The pattern to check, supports wild cards (*).\n */\n public static isMatch(input: string, patterns: string[], ignoreCase: boolean = true): boolean {\n if (!input || typeof input !== 'string') {\n return false;\n }\n\n const trim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n input = (ignoreCase ? input.toLowerCase() : input).replace(trim, '');\n\n return (patterns || []).some((pattern) => {\n if (typeof pattern !== 'string') {\n return false;\n }\n\n pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, '');\n if (pattern.length <= 0) {\n return false;\n }\n\n const startsWithWildcard: boolean = pattern[0] === '*';\n if (startsWithWildcard) {\n pattern = pattern.slice(1);\n }\n\n const endsWithWildcard: boolean = pattern[pattern.length - 1] === '*';\n if (endsWithWildcard) {\n pattern = pattern.substring(0, pattern.length - 1);\n }\n\n if (startsWithWildcard && endsWithWildcard) {\n return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1;\n }\n\n if (startsWithWildcard) {\n return Utils.endsWith(input, pattern);\n }\n\n if (endsWithWildcard) {\n return Utils.startsWith(input, pattern);\n }\n\n return input === pattern;\n });\n }\n\n public static isEmpty(input: object) {\n return input === null || (typeof (input) === 'object' && Object.keys(input).length === 0);\n }\n\n public static startsWith(input: string, prefix: string): boolean {\n return input.substring(0, prefix.length) === prefix;\n }\n\n public static endsWith(input: string, suffix: string): boolean {\n return input.indexOf(suffix, input.length - suffix.length) !== -1;\n }\n\n /**\n * Stringifys an object with optional exclusions and max depth.\n * @param data The data object to add.\n * @param exclusions Any property names that should be excluded.\n * @param maxDepth The max depth of the object to include.\n */\n public static stringify(data: any, exclusions?: string[], maxDepth?: number): string {\n function stringifyImpl(obj: any, excludedKeys: string[]): string {\n const cache: string[] = [];\n return JSON.stringify(obj, (key: string, value: any) => {\n if (Utils.isMatch(key, excludedKeys)) {\n return;\n }\n\n if (typeof value === 'object' && !!value) {\n if (cache.indexOf(value) !== -1) {\n // Circular reference found, discard key\n return;\n }\n\n cache.push(value);\n }\n\n return value;\n });\n }\n\n if (({}).toString.call(data) === '[object Object]') {\n const flattened = {};\n /* tslint:disable:forin */\n for (const prop in data) {\n const value = data[prop];\n if (value === data) {\n continue;\n }\n flattened[prop] = data[prop];\n }\n /* tslint:enable:forin */\n\n return stringifyImpl(flattened, exclusions);\n }\n\n if (({}).toString.call(data) === '[object Array]') {\n const result = [];\n for (let index = 0; index < data.length; index++) {\n result[index] = JSON.parse(stringifyImpl(data[index], exclusions));\n }\n\n return JSON.stringify(result);\n }\n\n return stringifyImpl(data, exclusions);\n }\n\n public static toBoolean(input, defaultValue: boolean = false): boolean {\n if (typeof input === 'boolean') {\n return input;\n }\n\n if (input === null || typeof input !== 'number' && typeof input !== 'string') {\n return defaultValue;\n }\n\n switch ((input + '').toLowerCase().trim()) {\n case 'true': case 'yes': case '1': return true;\n case 'false': case 'no': case '0': case null: return false;\n }\n\n return defaultValue;\n }\n}\n\n \n\nexport interface IConfigurationSettings {\n apiKey?: string;\n serverUrl?: string;\n heartbeatServerUrl?: string;\n updateSettingsWhenIdleInterval?: number;\n environmentInfoCollector?: IEnvironmentInfoCollector;\n errorParser?: IErrorParser;\n lastReferenceIdManager?: ILastReferenceIdManager;\n log?: ILog;\n moduleCollector?: IModuleCollector;\n requestInfoCollector?: IRequestInfoCollector;\n submissionBatchSize?: number;\n submissionClient?: ISubmissionClient;\n submissionAdapter?: ISubmissionAdapter;\n storage?: IStorageProvider;\n queue?: IEventQueue;\n}\n\n \n\ninterface ISettingsWithVersion {\n version: number;\n settings: { [key: string]: string };\n}\n\nexport class SettingsManager {\n /**\n * A list of handlers that will be fired when the settings change.\n * @type {Array}\n * @private\n */\n private static _handlers: Array<(config: Configuration) => void> = [];\n\n public static onChanged(handler: (config: Configuration) => void) {\n !!handler && this._handlers.push(handler);\n }\n\n public static applySavedServerSettings(config: Configuration): void {\n if (!config || !config.isValid) {\n return;\n }\n\n const savedSettings = this.getSavedServerSettings(config);\n config.log.info(`Applying saved settings: v${savedSettings.version}`);\n config.settings = Utils.merge(config.settings, savedSettings.settings);\n this.changed(config);\n }\n\n public static getVersion(config: Configuration): number {\n if (!config || !config.isValid) {\n return 0;\n }\n\n const savedSettings = this.getSavedServerSettings(config);\n return savedSettings.version || 0;\n }\n\n public static checkVersion(version: number, config: Configuration): void {\n const currentVersion: number = this.getVersion(config);\n if (version <= currentVersion) {\n return;\n }\n\n config.log.info(`Updating settings from v${currentVersion} to v${version}`);\n this.updateSettings(config, currentVersion);\n }\n\n public static updateSettings(config: Configuration, version?: number): void {\n if (!config || !config.enabled) {\n return;\n }\n\n const unableToUpdateMessage = 'Unable to update settings';\n if (!config.isValid) {\n config.log.error(`${unableToUpdateMessage}: ApiKey is not set.`);\n return;\n }\n\n if (!version || version < 0) {\n version = this.getVersion(config);\n }\n\n config.log.info(`Checking for updated settings from: v${version}.`);\n config.submissionClient.getSettings(config, version, (response: SettingsResponse) => {\n if (!config || !response || !response.success || !response.settings) {\n config.log.warn(`${unableToUpdateMessage}: ${response.message}`);\n return;\n }\n\n config.settings = Utils.merge(config.settings, response.settings);\n\n // TODO: Store snapshot of settings after reading from config and attributes and use that to revert to defaults.\n // Remove any existing server settings that are not in the new server settings.\n const savedServerSettings = SettingsManager.getSavedServerSettings(config);\n for (const key in savedServerSettings) {\n if (response.settings[key]) {\n continue;\n }\n\n delete config.settings[key];\n }\n\n const newSettings: ISettingsWithVersion = {\n version: response.settingsVersion,\n settings: response.settings\n };\n\n config.storage.settings.save(newSettings);\n\n config.log.info(`Updated settings: v${newSettings.version}`);\n this.changed(config);\n });\n }\n\n private static changed(config: Configuration) {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(config);\n } catch (ex) {\n config.log.error(`Error calling onChanged handler: ${ex}`);\n }\n }\n }\n\n private static getSavedServerSettings(config: Configuration): ISettingsWithVersion {\n const item = config.storage.settings.get()[0];\n if (item && item.value && item.value.version && item.value.settings) {\n return item.value;\n }\n\n return { version: 0, settings: {} };\n }\n}\n\nexport interface IEvent {\n type?: string;\n source?: string;\n date?: Date;\n tags?: string[];\n message?: string;\n geo?: string;\n value?: number;\n data?: any;\n reference_id?: string;\n count?: number;\n}\n\nexport class SubmissionResponse {\n public success: boolean = false;\n public badRequest: boolean = false;\n public serviceUnavailable: boolean = false;\n public paymentRequired: boolean = false;\n public unableToAuthenticate: boolean = false;\n public notFound: boolean = false;\n public requestEntityTooLarge: boolean = false;\n public statusCode: number;\n public message: string;\n\n constructor(statusCode: number, message?: string) {\n this.statusCode = statusCode;\n this.message = message;\n\n this.success = statusCode >= 200 && statusCode <= 299;\n this.badRequest = statusCode === 400;\n this.serviceUnavailable = statusCode === 503;\n this.paymentRequired = statusCode === 402;\n this.unableToAuthenticate = statusCode === 401 || statusCode === 403;\n this.notFound = statusCode === 404;\n this.requestEntityTooLarge = statusCode === 413;\n }\n}\n\n \n\nexport class ExceptionlessClient {\n /**\n * The default ExceptionlessClient instance.\n * @type {ExceptionlessClient}\n * @private\n */\n private static _instance: ExceptionlessClient = null;\n\n public config: Configuration;\n\n private _intervalId: any;\n private _timeoutId: any;\n\n constructor();\n constructor(settings: IConfigurationSettings);\n constructor(apiKey: string, serverUrl?: string);\n constructor(settingsOrApiKey?: IConfigurationSettings | string, serverUrl?: string) {\n this.config = typeof settingsOrApiKey === 'object'\n ? new Configuration(settingsOrApiKey)\n : new Configuration({ apiKey: settingsOrApiKey as string, serverUrl });\n\n this.updateSettingsTimer(5000);\n this.config.onChanged((config) => this.updateSettingsTimer(this._timeoutId > 0 ? 5000 : 0));\n this.config.queue.onEventsPosted((events, response) => this.updateSettingsTimer());\n }\n\n public createException(exception: Error): EventBuilder {\n const pluginContextData = new ContextData();\n pluginContextData.setException(exception);\n return this.createEvent(pluginContextData).setType('error');\n }\n\n public submitException(exception: Error, callback?: (context: EventPluginContext) => void): void {\n this.createException(exception).submit(callback);\n }\n\n public createUnhandledException(exception: Error, submissionMethod?: string): EventBuilder {\n const builder = this.createException(exception);\n builder.pluginContextData.markAsUnhandledError();\n builder.pluginContextData.setSubmissionMethod(submissionMethod);\n\n return builder;\n }\n\n public submitUnhandledException(exception: Error, submissionMethod?: string, callback?: (context: EventPluginContext) => void) {\n this.createUnhandledException(exception, submissionMethod).submit(callback);\n }\n\n public createFeatureUsage(feature: string): EventBuilder {\n return this.createEvent().setType('usage').setSource(feature);\n }\n\n public submitFeatureUsage(feature: string, callback?: (context: EventPluginContext) => void): void {\n this.createFeatureUsage(feature).submit(callback);\n }\n\n public createLog(message: string): EventBuilder;\n public createLog(source: string, message: string): EventBuilder;\n public createLog(source: string, message: string, level: string): EventBuilder;\n public createLog(sourceOrMessage: string, message?: string, level?: string): EventBuilder {\n let builder = this.createEvent().setType('log');\n\n if (level) {\n builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty('@level', level);\n } else if (message) {\n builder = builder.setSource(sourceOrMessage).setMessage(message);\n } else {\n builder = builder.setMessage(sourceOrMessage);\n\n try {\n // TODO: Look into using https: //www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/\n const caller: any = this.createLog.caller;\n builder = builder.setSource(caller && caller.caller && caller.caller.name);\n } catch (e) {\n this.config.log.trace('Unable to resolve log source: ' + e.message);\n }\n }\n\n return builder;\n }\n\n public submitLog(message: string): void;\n public submitLog(source: string, message: string): void;\n public submitLog(source: string, message: string, level: string, callback?: (context: EventPluginContext) => void): void;\n public submitLog(sourceOrMessage: string, message?: string, level?: string, callback?: (context: EventPluginContext) => void): void {\n this.createLog(sourceOrMessage, message, level).submit(callback);\n }\n\n public createNotFound(resource: string): EventBuilder {\n return this.createEvent().setType('404').setSource(resource);\n }\n\n public submitNotFound(resource: string, callback?: (context: EventPluginContext) => void): void {\n this.createNotFound(resource).submit(callback);\n }\n\n public createSessionStart(): EventBuilder {\n return this.createEvent().setType('session');\n }\n\n public submitSessionStart(callback?: (context: EventPluginContext) => void): void {\n this.createSessionStart().submit(callback);\n }\n\n public submitSessionEnd(sessionIdOrUserId: string): void {\n if (sessionIdOrUserId) {\n this.config.log.info(`Submitting session end: ${sessionIdOrUserId}`);\n this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, true, this.config);\n }\n }\n\n public submitSessionHeartbeat(sessionIdOrUserId: string): void {\n if (sessionIdOrUserId) {\n this.config.log.info(`Submitting session heartbeat: ${sessionIdOrUserId}`);\n this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, false, this.config);\n }\n }\n\n public createEvent(pluginContextData?: ContextData): EventBuilder {\n return new EventBuilder({ date: new Date() }, this, pluginContextData);\n }\n\n /**\n * Submits the event to be sent to the server.\n * @param event The event data.\n * @param pluginContextData Any contextual data objects to be used by Exceptionless plugins to gather default information for inclusion in the report information.\n * @param callback\n */\n public submitEvent(event: IEvent, pluginContextData?: ContextData, callback?: (context: EventPluginContext) => void): void {\n function cancelled(context: EventPluginContext) {\n if (!!context) {\n context.cancelled = true;\n }\n\n return !!callback && callback(context);\n }\n\n const context = new EventPluginContext(this, event, pluginContextData);\n if (!event) {\n return cancelled(context);\n }\n\n if (!this.config.enabled) {\n this.config.log.info('Event submission is currently disabled.');\n return cancelled(context);\n }\n\n if (!event.data) {\n event.data = {};\n }\n\n if (!event.tags || !event.tags.length) {\n event.tags = [];\n }\n\n EventPluginManager.run(context, (ctx: EventPluginContext) => {\n const config = ctx.client.config;\n const ev = ctx.event;\n\n if (!ctx.cancelled) {\n // ensure all required data\n if (!ev.type || ev.type.length === 0) {\n ev.type = 'log';\n }\n\n if (!ev.date) {\n ev.date = new Date();\n }\n\n config.queue.enqueue(ev);\n\n if (ev.reference_id && ev.reference_id.length > 0) {\n ctx.log.info(`Setting last reference id '${ev.reference_id}'`);\n config.lastReferenceIdManager.setLast(ev.reference_id);\n }\n }\n\n !!callback && callback(ctx);\n });\n }\n\n /**\n * Updates the user's email address and description of an event for the specified reference id.\n * @param referenceId The reference id of the event to update.\n * @param email The user's email address to set on the event.\n * @param description The user's description of the event.\n * @param callback The submission response.\n */\n public updateUserEmailAndDescription(referenceId: string, email: string, description: string, callback?: (response: SubmissionResponse) => void) {\n if (!referenceId || !email || !description || !this.config.enabled) {\n return !!callback && callback(new SubmissionResponse(500, 'cancelled'));\n }\n\n const userDescription: IUserDescription = { email_address: email, description };\n this.config.submissionClient.postUserDescription(referenceId, userDescription, this.config, (response: SubmissionResponse) => {\n if (!response.success) {\n this.config.log.error(`Failed to submit user email and description for event '${referenceId}': ${response.statusCode} ${response.message}`);\n }\n\n !!callback && callback(response);\n });\n }\n\n /**\n * Gets the last event client id that was submitted to the server.\n * @returns {string} The event client id.\n */\n public getLastReferenceId(): string {\n return this.config.lastReferenceIdManager.getLast();\n }\n\n private updateSettingsTimer(initialDelay?: number) {\n this.config.log.info(`Updating settings timer with delay: ${initialDelay}`);\n\n this._timeoutId = clearTimeout(this._timeoutId);\n this._timeoutId = clearInterval(this._intervalId);\n\n const interval = this.config.updateSettingsWhenIdleInterval;\n if (interval > 0) {\n const updateSettings = () => SettingsManager.updateSettings(this.config);\n if (initialDelay > 0) {\n this._timeoutId = setTimeout(updateSettings, initialDelay);\n }\n\n this._intervalId = setInterval(updateSettings, interval);\n }\n }\n\n /**\n * The default ExceptionlessClient instance.\n * @type {ExceptionlessClient}\n */\n public static get default() {\n if (ExceptionlessClient._instance === null) {\n ExceptionlessClient._instance = new ExceptionlessClient(null);\n }\n\n return ExceptionlessClient._instance;\n }\n}\n\nexport class ContextData {\n public setException(exception: Error): void {\n if (exception) {\n this['@@_Exception'] = exception;\n }\n }\n\n public get hasException(): boolean {\n return !!this['@@_Exception'];\n }\n\n public getException(): Error {\n return this['@@_Exception'] || null;\n }\n\n public markAsUnhandledError(): void {\n this['@@_IsUnhandledError'] = true;\n }\n\n public get isUnhandledError(): boolean {\n return !!this['@@_IsUnhandledError'];\n }\n\n public setSubmissionMethod(method: string): void {\n if (method) {\n this['@@_SubmissionMethod'] = method;\n }\n }\n\n public getSubmissionMethod(): string {\n return this['@@_SubmissionMethod'] || null;\n }\n}\n\nexport interface IEnvironmentInfo {\n processor_count?: number;\n total_physical_memory?: number;\n available_physical_memory?: number;\n command_line?: string;\n process_name?: string;\n process_id?: string;\n process_memory_size?: number;\n thread_id?: string;\n architecture?: string;\n o_s_name?: string;\n o_s_version?: string;\n ip_address?: string;\n machine_name?: string;\n install_id?: string;\n runtime_version?: string;\n data?: any;\n}\n\nexport interface IParameter {\n data?: any;\n generic_arguments?: string[];\n\n name?: string;\n type?: string;\n type_namespace?: string;\n}\n\n \n\nexport interface IMethod {\n data?: any;\n generic_arguments?: string[];\n parameters?: IParameter[];\n\n is_signature_target?: boolean;\n declaring_namespace?: string;\n declaring_type?: string;\n name?: string;\n module_id?: number;\n}\n\n \n\nexport interface IStackFrame extends IMethod {\n file_name?: string;\n line_number?: number;\n column?: number;\n}\n\n \n\nexport interface IInnerError {\n message?: string;\n type?: string;\n code?: string;\n data?: any;\n inner?: IInnerError;\n stack_trace?: IStackFrame[];\n target_method?: IMethod;\n}\n\nexport interface IModule {\n data?: any;\n\n module_id?: number;\n name?: string;\n version?: string;\n is_entry?: boolean;\n created_date?: Date;\n modified_date?: Date;\n}\n\n \n\nexport interface IError extends IInnerError {\n modules?: IModule[];\n}\n\nexport interface IRequestInfo {\n user_agent?: string;\n http_method?: string;\n is_secure?: boolean;\n host?: string;\n port?: number;\n path?: string;\n referrer?: string;\n client_ip_address?: string;\n cookies?: any;\n post_data?: any;\n query_string?: any;\n data?: any;\n}\n\nexport interface IStorageItem {\n timestamp: number;\n value: any;\n}\n\n \n\nexport interface IStorage {\n save(value: any): number;\n get(limit?: number): IStorageItem[];\n remove(timestamp: number): void;\n clear(): void;\n}\n\nexport type SubmissionCallback = (status: number, message: string, data?: string, headers?: object) => void;\n\nexport interface SubmissionRequest {\n apiKey: string;\n userAgent: string;\n method: string;\n url: string;\n data: string;\n}\n\n \n\nexport class Configuration implements IConfigurationSettings {\n /**\n * The default configuration settings that are applied to new configuration instances.\n * @type {IConfigurationSettings}\n * @private\n */\n private static _defaultSettings: IConfigurationSettings = null;\n\n /**\n * A default list of tags that will automatically be added to every\n * report submitted to the server.\n *\n * @type {Array}\n */\n public defaultTags: string[] = [];\n\n /**\n * A default list of of extended data objects that will automatically\n * be added to every report submitted to the server.\n *\n * @type {{}}\n */\n public defaultData: object = {};\n\n /**\n * Whether the client is currently enabled or not. If it is disabled,\n * submitted errors will be discarded and no data will be sent to the server.\n *\n * @returns {boolean}\n */\n public enabled: boolean = true;\n\n public environmentInfoCollector: IEnvironmentInfoCollector;\n public errorParser: IErrorParser;\n public lastReferenceIdManager: ILastReferenceIdManager = new DefaultLastReferenceIdManager();\n public log: ILog;\n public moduleCollector: IModuleCollector;\n public requestInfoCollector: IRequestInfoCollector;\n\n /**\n * Maximum number of events that should be sent to the server together in a batch. (Defaults to 50)\n */\n public submissionBatchSize: number;\n public submissionAdapter: ISubmissionAdapter;\n public submissionClient: ISubmissionClient;\n\n /**\n * Contains a dictionary of custom settings that can be used to control\n * the client and will be automatically updated from the server.\n */\n public settings: object = {};\n\n public storage: IStorageProvider;\n\n public queue: IEventQueue;\n\n /**\n * The API key that will be used when sending events to the server.\n * @type {string}\n * @private\n */\n private _apiKey: string;\n\n /**\n * The server url that all events will be sent to.\n * @type {string}\n * @private\n */\n private _serverUrl: string = 'https://collector.exceptionless.io';\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @type {string}\n * @private\n */\n private _heartbeatServerUrl: string = 'https://heartbeat.exceptionless.io';\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @type {number}\n * @private\n */\n private _updateSettingsWhenIdleInterval: number = 120000;\n\n /**\n * A list of exclusion patterns.\n * @type {Array}\n * @private\n */\n private _dataExclusions: string[] = [];\n\n /**\n * A list of user agent patterns.\n * @type {Array}\n * @private\n */\n private _userAgentBotPatterns: string[] = [];\n\n /**\n * The list of plugins that will be used in this configuration.\n * @type {Array}\n * @private\n */\n private _plugins: IEventPlugin[] = [];\n\n /**\n * A list of handlers that will be fired when configuration changes.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(config: Configuration) => void> = [];\n\n constructor(configSettings?: IConfigurationSettings) {\n function inject(fn: any) {\n return typeof fn === 'function' ? fn(this) : fn;\n }\n\n configSettings = Utils.merge(Configuration.defaults, configSettings);\n\n this.log = inject(configSettings.log) || new NullLog();\n this.apiKey = configSettings.apiKey;\n this.serverUrl = configSettings.serverUrl;\n this.heartbeatServerUrl = configSettings.heartbeatServerUrl;\n this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval;\n\n this.environmentInfoCollector = inject(configSettings.environmentInfoCollector);\n this.errorParser = inject(configSettings.errorParser);\n this.lastReferenceIdManager = inject(configSettings.lastReferenceIdManager) || new DefaultLastReferenceIdManager();\n this.moduleCollector = inject(configSettings.moduleCollector);\n this.requestInfoCollector = inject(configSettings.requestInfoCollector);\n this.submissionBatchSize = inject(configSettings.submissionBatchSize) || 50;\n this.submissionAdapter = inject(configSettings.submissionAdapter);\n this.submissionClient = inject(configSettings.submissionClient) || new DefaultSubmissionClient();\n this.storage = inject(configSettings.storage) || new InMemoryStorageProvider();\n this.queue = inject(configSettings.queue) || new DefaultEventQueue(this);\n\n SettingsManager.applySavedServerSettings(this);\n EventPluginManager.addDefaultPlugins(this);\n }\n\n /**\n * The API key that will be used when sending events to the server.\n * @returns {string}\n */\n public get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * The API key that will be used when sending events to the server.\n * @param value\n */\n public set apiKey(value: string) {\n this._apiKey = value || null;\n this.log.info(`apiKey: ${this._apiKey}`);\n this.changed();\n }\n\n /**\n * Returns true if the apiKey is valid.\n * @returns {boolean}\n */\n public get isValid(): boolean {\n return !!this.apiKey && this.apiKey.length >= 10;\n }\n\n /**\n * The server url that all events will be sent to.\n * @returns {string}\n */\n public get serverUrl(): string {\n return this._serverUrl;\n }\n\n /**\n * The server url that all events will be sent to.\n * @param value\n */\n public set serverUrl(value: string) {\n if (!!value) {\n this._serverUrl = value;\n this._heartbeatServerUrl = value;\n this.log.info(`serverUrl: ${value}`);\n this.changed();\n }\n }\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @returns {string}\n */\n public get heartbeatServerUrl(): string {\n return this._heartbeatServerUrl;\n }\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @param value\n */\n public set heartbeatServerUrl(value: string) {\n if (!!value) {\n this._heartbeatServerUrl = value;\n this.log.info(`heartbeatServerUrl: ${value}`);\n this.changed();\n }\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @returns {number}\n */\n public get updateSettingsWhenIdleInterval(): number {\n return this._updateSettingsWhenIdleInterval;\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @param value\n */\n public set updateSettingsWhenIdleInterval(value: number) {\n if (typeof value !== 'number') {\n return;\n }\n\n if (value <= 0) {\n value = -1;\n } else if (value > 0 && value < 15000) {\n value = 15000;\n }\n\n this._updateSettingsWhenIdleInterval = value;\n this.log.info(`updateSettingsWhenIdleInterval: ${value}`);\n this.changed();\n }\n\n /**\n * A list of exclusion patterns that will automatically remove any data that\n * matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties,\n * form fields, cookies and query parameters from the report.\n *\n * @returns {string[]}\n */\n public get dataExclusions(): string[] {\n const exclusions: string = this.settings['@@DataExclusions'];\n return this._dataExclusions.concat(exclusions && exclusions.split(',') || []);\n }\n\n /**\n * Add items to the list of exclusion patterns that will automatically remove any\n * data that matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties, form\n * fields, cookies and query parameters from the report.\n *\n * @param exclusions\n */\n public addDataExclusions(...exclusions: string[]) {\n this._dataExclusions = Utils.addRange<string>(this._dataExclusions, ...exclusions);\n }\n\n /**\n * A list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n *\n * @returns {string[]}\n */\n public get userAgentBotPatterns(): string[] {\n const patterns: string = this.settings['@@UserAgentBotPatterns'];\n return this._userAgentBotPatterns.concat(patterns && patterns.split(',') || []);\n }\n\n /**\n * Add items to the list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n *\n * @param userAgentBotPatterns\n */\n public addUserAgentBotPatterns(...userAgentBotPatterns: string[]) {\n this._userAgentBotPatterns = Utils.addRange<string>(this._userAgentBotPatterns, ...userAgentBotPatterns);\n }\n\n /**\n * The list of plugins that will be used in this configuration.\n * @returns {IEventPlugin[]}\n */\n public get plugins(): IEventPlugin[] {\n return this._plugins.sort((p1: IEventPlugin, p2: IEventPlugin) => {\n return (p1.priority < p2.priority) ? -1 : (p1.priority > p2.priority) ? 1 : 0;\n });\n }\n\n /**\n * Register an plugin to be used in this configuration.\n * @param plugin\n */\n public addPlugin(plugin: IEventPlugin): void;\n\n /**\n * Register an plugin to be used in this configuration.\n * @param name The name used to identify the plugin.\n * @param priority Used to determine plugins priority.\n * @param pluginAction A function that is run.\n */\n public addPlugin(name: string, priority: number, pluginAction: (context: EventPluginContext, next?: () => void) => void): void;\n public addPlugin(pluginOrName: IEventPlugin | string, priority?: number, pluginAction?: (context: EventPluginContext, next?: () => void) => void): void {\n const plugin: IEventPlugin = !!pluginAction ? { name: pluginOrName as string, priority, run: pluginAction } : pluginOrName as IEventPlugin;\n if (!plugin || !plugin.run) {\n this.log.error('Add plugin failed: Run method not defined');\n return;\n }\n\n if (!plugin.name) {\n plugin.name = Utils.guid();\n }\n\n if (!plugin.priority) {\n plugin.priority = 0;\n }\n\n let pluginExists: boolean = false;\n const plugins = this._plugins; // optimization for minifier.\n for (const p of plugins) {\n if (p.name === plugin.name) {\n pluginExists = true;\n break;\n }\n }\n\n if (!pluginExists) {\n plugins.push(plugin);\n }\n }\n\n /**\n * Remove the plugin from this configuration.\n * @param plugin\n */\n public removePlugin(plugin: IEventPlugin): void;\n\n /**\n * Remove an plugin by key from this configuration.\n * @param name\n */\n public removePlugin(pluginOrName: IEventPlugin | string): void {\n const name: string = typeof pluginOrName === 'string' ? pluginOrName : pluginOrName.name;\n if (!name) {\n this.log.error('Remove plugin failed: Plugin name not defined');\n return;\n }\n\n const plugins = this._plugins; // optimization for minifier.\n for (let index = 0; index < plugins.length; index++) {\n if (plugins[index].name === name) {\n plugins.splice(index, 1);\n break;\n }\n }\n }\n\n /**\n * Automatically set the application version for events.\n * @param version\n */\n public setVersion(version: string): void {\n if (!!version) {\n this.defaultData['@version'] = version;\n }\n }\n\n public setUserIdentity(userInfo: IUserInfo): void;\n public setUserIdentity(identity: string): void;\n public setUserIdentity(identity: string, name: string): void;\n public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): void {\n const USER_KEY: string = '@user'; // optimization for minifier.\n const userInfo: IUserInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n\n const shouldRemove: boolean = !userInfo || (!userInfo.identity && !userInfo.name);\n if (shouldRemove) {\n delete this.defaultData[USER_KEY];\n } else {\n this.defaultData[USER_KEY] = userInfo;\n }\n\n this.log.info(`user identity: ${shouldRemove ? 'null' : userInfo.identity}`);\n }\n\n /**\n * Used to identify the client that sent the events to the server.\n * @returns {string}\n */\n public get userAgent(): string {\n return 'exceptionless-js/1.0.0.0';\n }\n\n /**\n * Automatically send a heartbeat to keep the session alive.\n */\n public useSessions(sendHeartbeats: boolean = true, heartbeatInterval: number = 30000): void {\n if (sendHeartbeats) {\n this.addPlugin(new HeartbeatPlugin(heartbeatInterval));\n }\n }\n\n /**\n * Automatically set a reference id for error events.\n */\n public useReferenceIds(): void {\n this.addPlugin(new ReferenceIdPlugin());\n }\n\n public useLocalStorage(): void {\n // This method will be injected via the prototype.\n }\n\n // TODO: Support a min log level.\n public useDebugLogger(): void {\n this.log = new ConsoleLog();\n }\n\n public onChanged(handler: (config: Configuration) => void) {\n !!handler && this._handlers.push(handler);\n }\n\n private changed() {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(this);\n } catch (ex) {\n this.log.error(`Error calling onChanged handler: ${ex}`);\n }\n }\n }\n\n /**\n * The default configuration settings that are applied to new configuration instances.\n * @returns {IConfigurationSettings}\n */\n public static get defaults() {\n if (Configuration._defaultSettings === null) {\n Configuration._defaultSettings = {};\n }\n\n return Configuration._defaultSettings;\n }\n}\n\nexport interface IUserDescription {\n email_address?: string;\n description?: string;\n data?: any;\n}\n\nexport class SettingsResponse {\n public success: boolean = false;\n public settings: any;\n public settingsVersion: number = -1;\n public message: string;\n public exception: any;\n\n constructor(success: boolean, settings: any, settingsVersion: number = -1, exception: any = null, message: string = null) {\n this.success = success;\n this.settings = settings;\n this.settingsVersion = settingsVersion;\n this.exception = exception;\n this.message = message;\n }\n}\n\n \n\nexport class EventBuilder {\n public target: IEvent;\n public client: ExceptionlessClient;\n public pluginContextData: ContextData;\n\n private _validIdentifierErrorMessage: string = 'must contain between 8 and 100 alphanumeric or \\'-\\' characters.'; // optimization for minifier.\n\n constructor(event: IEvent, client: ExceptionlessClient, pluginContextData?: ContextData) {\n this.target = event;\n this.client = client;\n this.pluginContextData = pluginContextData || new ContextData();\n }\n\n public setType(type: string): EventBuilder {\n if (!!type) {\n this.target.type = type;\n }\n\n return this;\n }\n\n public setSource(source: string): EventBuilder {\n if (!!source) {\n this.target.source = source;\n }\n\n return this;\n }\n\n public setReferenceId(referenceId: string): EventBuilder {\n if (!this.isValidIdentifier(referenceId)) {\n throw new Error(`ReferenceId ${this._validIdentifierErrorMessage}`);\n }\n\n this.target.reference_id = referenceId;\n return this;\n }\n\n /**\n * Allows you to reference a parent event by its ReferenceId property. This allows you to have parent and child relationships.\n * @param name Reference name\n * @param id The reference id that points to a specific event\n * @returns {EventBuilder}\n */\n public setEventReference(name: string, id: string): EventBuilder {\n if (!name) {\n throw new Error('Invalid name');\n }\n\n if (!id || !this.isValidIdentifier(id)) {\n throw new Error(`Id ${this._validIdentifierErrorMessage}`);\n }\n\n this.setProperty('@ref:' + name, id);\n return this;\n }\n\n public setMessage(message: string): EventBuilder {\n if (!!message) {\n this.target.message = message;\n }\n\n return this;\n }\n\n public setGeo(latitude: number, longitude: number): EventBuilder {\n if (latitude < -90.0 || latitude > 90.0) {\n throw new Error('Must be a valid latitude value between -90.0 and 90.0.');\n }\n\n if (longitude < -180.0 || longitude > 180.0) {\n throw new Error('Must be a valid longitude value between -180.0 and 180.0.');\n }\n\n this.target.geo = `${latitude},${longitude}`;\n return this;\n }\n\n public setUserIdentity(userInfo: IUserInfo): EventBuilder;\n public setUserIdentity(identity: string): EventBuilder;\n public setUserIdentity(identity: string, name: string): EventBuilder;\n public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): EventBuilder {\n const userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n if (!userInfo || (!userInfo.identity && !userInfo.name)) {\n return this;\n }\n\n this.setProperty('@user', userInfo);\n return this;\n }\n\n /**\n * Sets the user's description of the event.\n *\n * @param emailAddress The email address\n * @param description The user's description of the event.\n * @returns {EventBuilder}\n */\n public setUserDescription(emailAddress: string, description: string): EventBuilder {\n if (emailAddress && description) {\n this.setProperty('@user_description', { email_address: emailAddress, description });\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting manual\n * stacking information.\n * @param signatureData A dictionary of strings to use for stacking.\n * @param title An optional title for the stacking information.\n * @returns {EventBuilder}\n */\n public setManualStackingInfo(signatureData: any, title?: string) {\n if (signatureData) {\n const stack: IManualStackingInfo = { signature_data: signatureData };\n if (title) {\n stack.title = title;\n }\n\n this.setProperty('@stack', stack);\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting the stacking key.\n * @param manualStackingKey The manual stacking key.\n * @param title An optional title for the stacking information.\n * @returns {EventBuilder}\n */\n public setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder {\n if (manualStackingKey) {\n const data = { ManualStackingKey: manualStackingKey };\n this.setManualStackingInfo(data, title);\n }\n\n return this;\n }\n\n public setValue(value: number): EventBuilder {\n if (!!value) {\n this.target.value = value;\n }\n\n return this;\n }\n\n public addTags(...tags: string[]): EventBuilder {\n this.target.tags = Utils.addRange<string>(this.target.tags, ...tags);\n return this;\n }\n\n /**\n * Adds the object to extended data. Uses @excludedPropertyNames\n * to exclude data from being included in the event.\n * @param name The data object to add.\n * @param value The name of the object to add.\n * @param maxDepth The max depth of the object to include.\n * @param excludedPropertyNames Any property names that should be excluded.\n */\n public setProperty(name: string, value: any, maxDepth?: number, excludedPropertyNames?: string[]): EventBuilder {\n if (!name || (value === undefined || value == null)) {\n return this;\n }\n\n if (!this.target.data) {\n this.target.data = {};\n }\n\n const result = JSON.parse(Utils.stringify(value, this.client.config.dataExclusions.concat(excludedPropertyNames || []), maxDepth));\n if (!Utils.isEmpty(result)) {\n this.target.data[name] = result;\n }\n\n return this;\n }\n\n public markAsCritical(critical: boolean): EventBuilder {\n if (critical) {\n this.addTags('Critical');\n }\n\n return this;\n }\n\n public addRequestInfo(request: object): EventBuilder {\n if (!!request) {\n this.pluginContextData['@request'] = request;\n }\n\n return this;\n }\n\n public submit(callback?: (context: EventPluginContext) => void): void {\n this.client.submitEvent(this.target, this.pluginContextData, callback);\n }\n\n private isValidIdentifier(value: string): boolean {\n if (!value) {\n return true;\n }\n\n if (value.length < 8 || value.length > 100) {\n return false;\n }\n\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index);\n const isDigit = (code >= 48) && (code <= 57);\n const isLetter = ((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122));\n const isMinus = code === 45;\n\n if (!(isDigit || isLetter) && !isMinus) {\n return false;\n }\n }\n\n return true;\n }\n}\n\nexport interface IManualStackingInfo {\n title?: string;\n signature_data?: any;\n}\n\n \n\nexport class ConfigurationDefaultsPlugin implements IEventPlugin {\n public priority: number = 10;\n public name: string = 'ConfigurationDefaultsPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const config = context.client.config;\n const defaultTags: string[] = config.defaultTags || [];\n for (const tag of defaultTags) {\n if (!!tag && context.event.tags.indexOf(tag) < 0) {\n context.event.tags.push(tag);\n }\n }\n\n // tslint:disable-next-line:ban-types\n const defaultData: Object = config.defaultData || {};\n for (const key in defaultData) {\n if (!!defaultData[key]) {\n const result = JSON.parse(Utils.stringify(defaultData[key], config.dataExclusions));\n if (!Utils.isEmpty(result)) {\n context.event.data[key] = result;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class DuplicateCheckerPlugin implements IEventPlugin {\n public priority: number = 1010;\n public name: string = 'DuplicateCheckerPlugin';\n\n private _mergedEvents: MergedEvent[] = [];\n private _processedHashcodes: TimestampedHash[] = [];\n private _getCurrentTime: () => number;\n private _interval: number;\n\n constructor(getCurrentTime: () => number = () => Date.now(), interval: number = 30000) {\n this._getCurrentTime = getCurrentTime;\n this._interval = interval;\n\n setInterval(() => {\n while (this._mergedEvents.length > 0) {\n this._mergedEvents.shift().resubmit();\n }\n }, interval);\n }\n\n public run(context: EventPluginContext, next?: () => void): void {\n function getHashCode(error: IInnerError): number {\n let hashCode = 0;\n while (error) {\n if (error.message && error.message.length) {\n hashCode += (hashCode * 397) ^ Utils.getHashCode(error.message);\n }\n if (error.stack_trace && error.stack_trace.length) {\n hashCode += (hashCode * 397) ^ Utils.getHashCode(JSON.stringify(error.stack_trace));\n }\n error = error.inner;\n }\n\n return hashCode;\n }\n\n const error = context.event.data['@error'];\n const hashCode = getHashCode(error);\n if (hashCode) {\n const count = context.event.count || 1;\n const now = this._getCurrentTime();\n\n const merged = this._mergedEvents.filter((s) => s.hashCode === hashCode)[0];\n if (merged) {\n merged.incrementCount(count);\n merged.updateDate(context.event.date);\n context.log.info('Ignoring duplicate event with hash: ' + hashCode);\n context.cancelled = true;\n }\n\n if (!context.cancelled && this._processedHashcodes.some((h) => h.hash === hashCode && h.timestamp >= (now - this._interval))) {\n context.log.trace('Adding event with hash: ' + hashCode);\n this._mergedEvents.push(new MergedEvent(hashCode, context, count));\n context.cancelled = true;\n }\n\n if (!context.cancelled) {\n context.log.trace('Enqueueing event with hash: ' + hashCode + 'to cache.');\n this._processedHashcodes.push({ hash: hashCode, timestamp: now });\n\n // Only keep the last 50 recent errors.\n while (this._processedHashcodes.length > 50) {\n this._processedHashcodes.shift();\n }\n }\n }\n\n next && next();\n }\n}\n\ninterface TimestampedHash {\n hash: number;\n timestamp: number;\n}\n\nclass MergedEvent {\n public hashCode: number;\n private _count: number;\n private _context: EventPluginContext;\n\n constructor(hashCode: number, context: EventPluginContext, count: number) {\n this.hashCode = hashCode;\n this._context = context;\n this._count = count;\n }\n\n public incrementCount(count: number) {\n this._count += count;\n }\n\n public resubmit() {\n this._context.event.count = this._count;\n this._context.client.config.queue.enqueue(this._context.event);\n }\n\n public updateDate(date) {\n if (date > this._context.event.date) {\n this._context.event.date = date;\n }\n }\n}\n\n \n\nexport class EnvironmentInfoPlugin implements IEventPlugin {\n public priority: number = 80;\n public name: string = 'EnvironmentInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ENVIRONMENT_KEY: string = '@environment'; // optimization for minifier.\n\n const collector = context.client.config.environmentInfoCollector;\n if (!context.event.data[ENVIRONMENT_KEY] && collector) {\n const environmentInfo: IEnvironmentInfo = collector.getEnvironmentInfo(context);\n if (!!environmentInfo) {\n context.event.data[ENVIRONMENT_KEY] = environmentInfo;\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class ErrorPlugin implements IEventPlugin {\n public priority: number = 30;\n public name: string = 'ErrorPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ERROR_KEY: string = '@error'; // optimization for minifier.\n const ignoredProperties: string[] = [\n 'arguments',\n 'column',\n 'columnNumber',\n 'description',\n 'fileName',\n 'message',\n 'name',\n 'number',\n 'line',\n 'lineNumber',\n 'opera#sourceloc',\n 'sourceId',\n 'sourceURL',\n 'stack',\n 'stackArray',\n 'stacktrace'\n ];\n\n const exception = context.contextData.getException();\n if (!!exception) {\n context.event.type = 'error';\n\n if (!context.event.data[ERROR_KEY]) {\n const config = context.client.config;\n const parser = config.errorParser;\n if (!parser) {\n throw new Error('No error parser was defined.');\n }\n\n const result = parser.parse(context, exception);\n if (!!result) {\n const additionalData = JSON.parse(Utils.stringify(exception, config.dataExclusions.concat(ignoredProperties)));\n if (!Utils.isEmpty(additionalData)) {\n if (!result.data) {\n result.data = {};\n }\n result.data['@ext'] = additionalData;\n }\n\n context.event.data[ERROR_KEY] = result;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class EventExclusionPlugin implements IEventPlugin {\n public priority: number = 45;\n public name: string = 'EventExclusionPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n function getLogLevel(level: string): number {\n switch ((level || '').toLowerCase().trim()) {\n case 'trace':\n case 'true':\n case '1':\n case 'yes':\n return 0;\n case 'debug':\n return 1;\n case 'info':\n return 2;\n case 'warn':\n return 3;\n case 'error':\n return 4;\n case 'fatal':\n return 5;\n case 'off':\n case 'false':\n case '0':\n case 'no':\n return 6;\n default:\n return -1;\n }\n }\n\n function getMinLogLevel(settings: object, loggerName: string = '*'): number {\n return getLogLevel(getTypeAndSourceSetting(settings, 'log', loggerName, 'Trace') + '');\n }\n\n // tslint:disable-next-line:ban-types\n function getTypeAndSourceSetting(settings: Object = {}, type: string, source: string, defaultValue?: string|boolean): string|boolean {\n if (!type) {\n return defaultValue;\n }\n\n const isLog = type === 'log';\n const sourcePrefix = `@@${type}:`;\n\n const value = settings[sourcePrefix + source];\n if (value) {\n return !isLog ? Utils.toBoolean(value) : value;\n }\n\n // check for wildcard match\n for (const key in settings) {\n if (Utils.startsWith(key.toLowerCase(), sourcePrefix.toLowerCase()) && Utils.isMatch(source, [key.substring(sourcePrefix.length)])) {\n return !isLog ? Utils.toBoolean(settings[key]) : settings[key];\n }\n }\n\n return defaultValue;\n }\n\n const ev = context.event;\n const log = context.log;\n const settings = context.client.config.settings;\n\n if (ev.type === 'log') {\n const minLogLevel = getMinLogLevel(settings, ev.source);\n const logLevel = getLogLevel(ev.data['@level']);\n\n if (logLevel >= 0 && (logLevel > 5 || logLevel < minLogLevel)) {\n log.info('Cancelling log event due to minimum log level.');\n context.cancelled = true;\n }\n } else if (ev.type === 'error') {\n let error: IInnerError = ev.data['@error'];\n while (!context.cancelled && error) {\n if (getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) {\n log.info(`Cancelling error from excluded exception type: ${error.type}`);\n context.cancelled = true;\n }\n\n error = error.inner;\n }\n } else if (getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) {\n log.info(`Cancelling event from excluded type: ${ev.type} and source: ${ev.source}`);\n context.cancelled = true;\n }\n\n next && next();\n }\n}\n\n \n\nexport class ModuleInfoPlugin implements IEventPlugin {\n public priority: number = 50;\n public name: string = 'ModuleInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ERROR_KEY: string = '@error'; // optimization for minifier.\n\n const collector = context.client.config.moduleCollector;\n if (context.event.data[ERROR_KEY] && !context.event.data['@error'].modules && !!collector) {\n const modules: IModule[] = collector.getModules(context);\n if (modules && modules.length > 0) {\n context.event.data[ERROR_KEY].modules = modules;\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class RequestInfoPlugin implements IEventPlugin {\n public priority: number = 70;\n public name: string = 'RequestInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const REQUEST_KEY: string = '@request'; // optimization for minifier.\n\n const config = context.client.config;\n const collector = config.requestInfoCollector;\n if (!context.event.data[REQUEST_KEY] && !!collector) {\n const requestInfo: IRequestInfo = collector.getRequestInfo(context);\n if (!!requestInfo) {\n if (Utils.isMatch(requestInfo.user_agent, config.userAgentBotPatterns)) {\n context.log.info('Cancelling event as the request user agent matches a known bot pattern');\n context.cancelled = true;\n } else {\n context.event.data[REQUEST_KEY] = requestInfo;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class SubmissionMethodPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = 'SubmissionMethodPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const submissionMethod: string = context.contextData.getSubmissionMethod();\n if (!!submissionMethod) {\n context.event.data['@submission_method'] = submissionMethod;\n }\n\n next && next();\n }\n}\n\n \n\nexport class InMemoryStorage implements IStorage {\n private maxItems: number;\n private items: IStorageItem[] = [];\n private lastTimestamp: number = 0;\n\n constructor(maxItems: number) {\n this.maxItems = maxItems;\n }\n\n public save(value: any): number {\n if (!value) {\n return null;\n }\n\n const items = this.items;\n const timestamp = Math.max(Date.now(), this.lastTimestamp + 1);\n const item = { timestamp, value };\n\n if (items.push(item) > this.maxItems) {\n items.shift();\n }\n\n this.lastTimestamp = timestamp;\n return item.timestamp;\n }\n\n public get(limit?: number): IStorageItem[] {\n return this.items.slice(0, limit);\n }\n\n public remove(timestamp: number): void {\n const items = this.items;\n for (let i = 0; i < items.length; i++) {\n if (items[i].timestamp === timestamp) {\n items.splice(i, 1);\n return;\n }\n }\n }\n\n public clear(): void {\n this.items = [];\n }\n}\n\nexport interface IClientConfiguration {\n settings: object;\n version: number;\n}\n\n \n\nexport abstract class KeyValueStorageBase implements IStorage {\n private maxItems: number;\n private items: number[];\n private lastTimestamp: number = 0;\n\n constructor(maxItems) {\n this.maxItems = maxItems;\n }\n\n public save(value: any, single?: boolean): number {\n if (!value) {\n return null;\n }\n\n this.ensureIndex();\n\n const items = this.items;\n const timestamp = Math.max(Date.now(), this.lastTimestamp + 1);\n const key = this.getKey(timestamp);\n const json = JSON.stringify(value);\n\n try {\n this.write(key, json);\n this.lastTimestamp = timestamp;\n if (items.push(timestamp) > this.maxItems) {\n this.delete(this.getKey(items.shift()));\n }\n } catch (e) {\n return null;\n }\n\n return timestamp;\n }\n\n public get(limit?: number): IStorageItem[] {\n this.ensureIndex();\n\n return this.items.slice(0, limit)\n .map((timestamp) => {\n // Read and parse item for this timestamp\n const key = this.getKey(timestamp);\n try {\n const json = this.read(key);\n const value = JSON.parse(json, parseDate);\n return { timestamp, value };\n } catch (error) {\n // Something went wrong - try to delete the cause.\n this.safeDelete(key);\n return null;\n }\n })\n .filter((item) => item != null);\n }\n\n public remove(timestamp: number): void {\n this.ensureIndex();\n\n const items = this.items;\n const index = items.indexOf(timestamp);\n if (index >= 0) {\n const key = this.getKey(timestamp);\n this.safeDelete(key);\n items.splice(index, 1);\n }\n }\n\n public clear(): void {\n this.items.forEach((item) => this.safeDelete(this.getKey(item)));\n this.items = [];\n }\n\n protected abstract write(key: string, value: string): void;\n protected abstract read(key: string): string;\n protected abstract readAllKeys(): string[];\n protected abstract delete(key: string);\n protected abstract getKey(timestamp: number): string;\n protected abstract getTimestamp(key: string): number;\n\n private ensureIndex() {\n if (!this.items) {\n this.items = this.createIndex();\n this.lastTimestamp = Math.max(0, ...this.items) + 1;\n }\n }\n\n private safeDelete(key: string): void {\n try {\n this.delete(key);\n } catch (error) {\n }\n }\n\n private createIndex() {\n try {\n const keys = this.readAllKeys();\n return keys.map((key) => {\n try {\n const timestamp = this.getTimestamp(key);\n if (!timestamp) {\n this.safeDelete(key);\n return null;\n }\n return timestamp;\n } catch (error) {\n this.safeDelete(key);\n return null;\n }\n }).filter((timestamp) => timestamp != null)\n .sort((a, b) => a - b);\n } catch (error) {\n return [];\n }\n }\n}\n\nfunction parseDate(key, value) {\n const dateRegx = /\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)/g;\n if (typeof value === 'string') {\n const a = dateRegx.exec(value);\n if (a) {\n return new Date(value);\n }\n }\n return value;\n}\n\n \n\nexport class NodeFileStorage extends KeyValueStorageBase {\n private directory: string;\n private prefix: string;\n private fs: any;\n\n constructor(namespace: string, folder?: string, prefix: string = 'ex-', maxItems: number = 20, fs?: any) {\n super(maxItems);\n\n if (!folder) {\n folder = Path.join(Path.dirname(require.main.filename), '.exceptionless');\n }\n\n const subfolder = Path.join(folder, namespace);\n this.directory = Path.resolve(subfolder);\n this.prefix = prefix;\n this.fs = fs ? fs : Fs;\n\n this.mkdir(this.directory);\n }\n\n public write(key: string, value: string) {\n this.fs.writeFileSync(key, value);\n }\n\n public read(key: string) {\n return this.fs.readFileSync(key, 'utf8');\n }\n\n public readAllKeys() {\n return this.fs.readdirSync(this.directory)\n .filter((file) => file.indexOf(this.prefix) === 0)\n .map((file) => Path.join(this.directory, file));\n }\n\n public delete(key: string) {\n this.fs.unlinkSync(key);\n }\n\n public getKey(timestamp) {\n return Path.join(this.directory, `${this.prefix}${timestamp}.json`);\n }\n\n public getTimestamp(key) {\n return parseInt(Path.basename(key, '.json')\n .substr(this.prefix.length), 10);\n }\n\n private mkdir(path) {\n const dirs = path.split(Path.sep);\n let root = '';\n\n while (dirs.length > 0) {\n const dir = dirs.shift();\n if (dir === '') {\n root = Path.sep;\n }\n if (!this.fs.existsSync(root + dir)) {\n this.fs.mkdirSync(root + dir);\n }\n root += dir + Path.sep;\n }\n }\n}\n\n \n\nexport class NodeEnvironmentInfoCollector implements IEnvironmentInfoCollector {\n public getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo {\n function getIpAddresses(): string {\n const ips: string[] = [];\n const interfaces = os.networkInterfaces();\n Object.keys(interfaces).forEach((name) => {\n interfaces[name].forEach((iface: any) => {\n if ('IPv4' === iface.family && !iface.internal) {\n ips.push(iface.address);\n }\n });\n });\n\n return ips.join(', ');\n }\n\n if (!os) {\n return null;\n }\n\n const environmentInfo: IEnvironmentInfo = {\n processor_count: os.cpus().length,\n total_physical_memory: os.totalmem(),\n available_physical_memory: os.freemem(),\n command_line: process.argv.join(' '),\n process_name: (process.title || '').replace(/[\\uE000-\\uF8FF]/g, ''),\n process_id: process.pid + '',\n process_memory_size: process.memoryUsage().heapTotal,\n // thread_id: '',\n architecture: os.arch(),\n o_s_name: os.type(),\n o_s_version: os.release(),\n ip_address: getIpAddresses(),\n machine_name: os.hostname(),\n // install_id: '',\n runtime_version: process.version,\n data: {\n loadavg: os.loadavg(),\n platform: os.platform(),\n tmpdir: os.tmpdir(),\n uptime: os.uptime()\n }\n };\n\n if ((os as any).endianness) {\n environmentInfo.data.endianness = (os as any).endianness();\n }\n\n return environmentInfo;\n }\n}\n\n \n\nexport class NodeErrorParser implements IErrorParser {\n public parse(context: EventPluginContext, exception: Error): IError {\n function getStackFrames(stackFrames: any[]): IStackFrame[] {\n const frames: IStackFrame[] = [];\n\n for (const frame of stackFrames) {\n frames.push({\n name: frame.getMethodName() || frame.getFunctionName(),\n // parameters: frame.args,\n file_name: frame.getFileName(),\n line_number: frame.getLineNumber() || 0,\n column: frame.getColumnNumber() || 0,\n declaring_type: frame.getTypeName(),\n data: {\n is_native: frame.isNative() || (!!frame.filename && frame.filename[0] !== '/' && frame.filename[0] !== '.')\n }\n });\n }\n\n return frames;\n }\n\n if (!nodestacktrace) {\n throw new Error('Unable to load the stack trace library.');\n }\n\n const stackFrames = nodestacktrace.parse(exception) || [];\n return {\n type: exception.name || 'Error',\n message: exception.message,\n stack_trace: getStackFrames(stackFrames)\n };\n }\n}\n\n \n\nexport class NodeModuleCollector implements IModuleCollector {\n\n private initialized: boolean = false;\n private installedModules: { [id: string]: IModule } = {};\n\n public getModules(context: EventPluginContext): IModule[] {\n this.initialize();\n\n if (!require.main) {\n return [];\n }\n\n const modulePath = path.dirname(require.main.filename) + '/node_modules/';\n const pathLength = modulePath.length;\n\n const loadedKeys = Object.keys(require.cache);\n const loadedModules = {};\n\n loadedKeys.forEach((key) => {\n let id = key.substr(pathLength);\n id = id.substr(0, id.indexOf('/'));\n loadedModules[id] = true;\n });\n\n return Object.keys(loadedModules)\n .map((key) => this.installedModules[key])\n .filter((m) => m !== undefined);\n }\n\n private initialize() {\n if (this.initialized) {\n return;\n }\n\n this.initialized = true;\n\n const output = child.spawnSync('npm', ['ls', '--depth=0', '--json']).stdout;\n\n if (!output) {\n return;\n }\n\n let json;\n try {\n json = JSON.parse(output.toString());\n } catch (e) {\n return;\n }\n\n const items = json.dependencies;\n if (!items) {\n return;\n }\n\n let id = 0;\n this.installedModules = {};\n\n Object.keys(items).forEach((key) => {\n const item = items[key];\n const theModule: IModule = {\n module_id: id++,\n name: key,\n version: item.version\n };\n\n this.installedModules[key] = theModule;\n });\n }\n}\n\n \n\nexport class NodeRequestInfoCollector implements IRequestInfoCollector {\n public getRequestInfo(context: EventPluginContext): IRequestInfo {\n const REQUEST_KEY: string = '@request'; // optimization for minifier.\n if (!context.contextData[REQUEST_KEY]) {\n return null;\n }\n\n const exclusions = context.client.config.dataExclusions;\n\n // TODO: include referrer\n const request = context.contextData[REQUEST_KEY];\n const requestInfo: IRequestInfo = {\n client_ip_address: request.ip,\n user_agent: request.headers['user-agent'],\n is_secure: request.secure,\n http_method: request.method,\n host: request.hostname || request.host,\n path: request.path,\n post_data: JSON.parse(Utils.stringify(request.body || {}, exclusions)),\n cookies: Utils.getCookies(request.headers.cookie, exclusions),\n query_string: JSON.parse(Utils.stringify(request.params || {}, exclusions))\n };\n\n const host = request.headers.host;\n const port: number = host && parseInt(host.slice(host.indexOf(':') + 1), 10);\n if (port > 0) {\n requestInfo.port = port;\n }\n\n return requestInfo;\n }\n}\n\n \n\nexport class NodeFileStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(folder?: string, prefix?: string, maxQueueItems: number = 250) {\n this.queue = new NodeFileStorage('q', folder, prefix, maxQueueItems);\n this.settings = new NodeFileStorage('settings', folder, prefix, 1);\n }\n}\n\n \n\nexport class NodeSubmissionAdapter implements ISubmissionAdapter {\n public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) {\n if (isAppExiting) {\n this.sendRequestSync(request, callback);\n return;\n }\n\n const parsedHost = url.parse(request.url);\n\n const options: https.RequestOptions = {\n auth: `client:${request.apiKey}`,\n headers: {},\n hostname: parsedHost.hostname,\n method: request.method,\n port: parsedHost.port && parseInt(parsedHost.port, 10),\n path: request.url\n };\n\n options.headers['User-Agent'] = request.userAgent;\n\n if (request.method === 'POST') {\n options.headers = {\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(request.data)\n };\n }\n\n const protocol: any = (parsedHost.protocol === 'https' ? https : http);\n const clientRequest: http.ClientRequest = protocol.request(options, (response: http.IncomingMessage) => {\n let body = '';\n response.setEncoding('utf8');\n response.on('data', (chunk) => body += chunk);\n response.on('end', () => this.complete(response, body, response.headers, callback));\n });\n\n clientRequest.on('error', (error: Error) => callback && callback(500, error.message));\n clientRequest.end(request.data);\n }\n\n private complete(response: http.IncomingMessage, responseBody: string, responseHeaders: object, callback: SubmissionCallback): void {\n let message: string;\n if (response.statusCode === 0) {\n message = 'Unable to connect to server.';\n } else if (response.statusCode < 200 || response.statusCode > 299) {\n message = response.statusMessage || ( response as any).message;\n }\n\n callback && callback(response.statusCode || 500, message, responseBody, responseHeaders);\n }\n\n private sendRequestSync(request: SubmissionRequest, callback: SubmissionCallback): void {\n const requestJson = JSON.stringify(request);\n const res = child.spawnSync(process.execPath, [require.resolve('./submitSync.js')],\n {\n input: requestJson,\n stdio: ['pipe', 'pipe', process.stderr]\n });\n\n const out = res.stdout.toString();\n const result = JSON.parse(out);\n\n callback && callback(result.status, result.message, result.data, result.headers);\n }\n}\n\n \n\n(function init() {\n if (typeof process === 'undefined') {\n return;\n }\n\n const defaults = Configuration.defaults;\n defaults.environmentInfoCollector = new NodeEnvironmentInfoCollector();\n defaults.errorParser = new NodeErrorParser();\n defaults.moduleCollector = new NodeModuleCollector();\n defaults.requestInfoCollector = new NodeRequestInfoCollector();\n defaults.submissionAdapter = new NodeSubmissionAdapter();\n\n Configuration.prototype.useLocalStorage = function() {\n this.storage = new NodeFileStorageProvider();\n SettingsManager.applySavedServerSettings(this);\n this.changed();\n };\n\n process.addListener('uncaughtException', (error: Error) => {\n ExceptionlessClient.default.submitUnhandledException(error, 'uncaughtException');\n });\n\n process.on('exit', (code: number) => {\n /**\n * exit codes: https://nodejs.org/api/process.html#process_event_exit\n * From now on, only synchronous code may run. As soon as this method\n * ends, the application inevitably will exit.\n */\n function getExitCodeReason(exitCode: number): string {\n if (exitCode === 1) {\n return 'Uncaught Fatal Exception';\n }\n\n if (exitCode === 3) {\n return 'Internal JavaScript Parse Error';\n }\n\n if (exitCode === 4) {\n return 'Internal JavaScript Evaluation Failure';\n }\n\n if (exitCode === 5) {\n return 'Fatal Exception';\n }\n\n if (exitCode === 6) {\n return 'Non-function Internal Exception Handler ';\n }\n\n if (exitCode === 7) {\n return 'Internal Exception Handler Run-Time Failure';\n }\n\n if (exitCode === 8) {\n return 'Uncaught Exception';\n }\n\n if (exitCode === 9) {\n return 'Invalid Argument';\n }\n\n if (exitCode === 10) {\n return 'Internal JavaScript Run-Time Failure';\n }\n\n if (exitCode === 12) {\n return 'Invalid Debug Argument';\n }\n\n return null;\n }\n\n const client = ExceptionlessClient.default;\n const message = getExitCodeReason(code);\n\n if (message !== null) {\n client.submitLog('exit', message, 'Error');\n }\n\n client.config.queue.process(true);\n // Application will now exit.\n });\n\n (Error as any).stackTraceLimit = Infinity;\n})();\n\n"],"preExistingComment":"exceptionless.node.js.map"} \ No newline at end of file diff --git a/dist/exceptionless.universal.js b/dist/exceptionless.universal.js deleted file mode 100644 index 91d5e130..00000000 --- a/dist/exceptionless.universal.js +++ /dev/null @@ -1,3769 +0,0 @@ -/** - * https://github.com/csnover/TraceKit - * @license MIT - * @namespace TraceKit - */ -(function(window, undefined) { -if (!window) { - return; -} - -var TraceKit = {}; -var _oldTraceKit = window.TraceKit; - -// global reference to slice -var _slice = [].slice; -var UNKNOWN_FUNCTION = '?'; - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types -var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/; - -/** - * A better form of hasOwnProperty<br/> - * Example: `_has(MainHostObject, property) === true/false` - * - * @param {Object} object to check property - * @param {string} key to check - * @return {Boolean} true if the object has the key and it is not inherited - */ -function _has(object, key) { - return Object.prototype.hasOwnProperty.call(object, key); -} - -/** - * Returns true if the parameter is undefined<br/> - * Example: `_isUndefined(val) === true/false` - * - * @param {*} what Value to check - * @return {Boolean} true if undefined and false otherwise - */ -function _isUndefined(what) { - return typeof what === 'undefined'; -} - -/** - * Export TraceKit out to another variable<br/> - * Example: `var TK = TraceKit.noConflict()` - * @return {Object} The TraceKit object - * @memberof TraceKit - */ -TraceKit.noConflict = function noConflict() { - window.TraceKit = _oldTraceKit; - return TraceKit; -}; - -/** - * Wrap any function in a TraceKit reporter<br/> - * Example: `func = TraceKit.wrap(func);` - * - * @param {Function} func Function to be wrapped - * @return {Function} The wrapped func - * @memberof TraceKit - */ -TraceKit.wrap = function traceKitWrapper(func) { - function wrapped() { - try { - return func.apply(this, arguments); - } catch (e) { - TraceKit.report(e); - throw e; - } - } - return wrapped; -}; - -/** - * Cross-browser processing of unhandled exceptions - * - * Syntax: - * ```js - * TraceKit.report.subscribe(function(stackInfo) { ... }) - * TraceKit.report.unsubscribe(function(stackInfo) { ... }) - * TraceKit.report(exception) - * try { ...code... } catch(ex) { TraceKit.report(ex); } - * ``` - * - * Supports: - * - Firefox: full stack trace with line numbers, plus column number - * on top frame; column number is not guaranteed - * - Opera: full stack trace with line and column numbers - * - Chrome: full stack trace with line and column numbers - * - Safari: line and column number for the top frame only; some frames - * may be missing, and column number is not guaranteed - * - IE: line and column number for the top frame only; some frames - * may be missing, and column number is not guaranteed - * - * In theory, TraceKit should work on all of the following versions: - * - IE5.5+ (only 8.0 tested) - * - Firefox 0.9+ (only 3.5+ tested) - * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require - * Exceptions Have Stacktrace to be enabled in opera:config) - * - Safari 3+ (only 4+ tested) - * - Chrome 1+ (only 5+ tested) - * - Konqueror 3.5+ (untested) - * - * Requires TraceKit.computeStackTrace. - * - * Tries to catch all unhandled exceptions and report them to the - * subscribed handlers. Please note that TraceKit.report will rethrow the - * exception. This is REQUIRED in order to get a useful stack trace in IE. - * If the exception does not reach the top of the browser, you will only - * get a stack trace from the point where TraceKit.report was called. - * - * Handlers receive a TraceKit.StackTrace object as described in the - * TraceKit.computeStackTrace docs. - * - * @memberof TraceKit - * @namespace - */ -TraceKit.report = (function reportModuleWrapper() { - var handlers = [], - lastException = null, - lastExceptionStack = null; - - /** - * Add a crash handler. - * @param {Function} handler - * @memberof TraceKit.report - */ - function subscribe(handler) { - installGlobalHandler(); - handlers.push(handler); - } - - /** - * Remove a crash handler. - * @param {Function} handler - * @memberof TraceKit.report - */ - function unsubscribe(handler) { - for (var i = handlers.length - 1; i >= 0; --i) { - if (handlers[i] === handler) { - handlers.splice(i, 1); - } - } - - if (handlers.length === 0) { - window.onerror = _oldOnerrorHandler; - _onErrorHandlerInstalled = false; - } - } - - /** - * Dispatch stack information to all handlers. - * @param {TraceKit.StackTrace} stack - * @param {boolean} isWindowError Is this a top-level window error? - * @param {Error=} error The error that's being handled (if available, null otherwise) - * @memberof TraceKit.report - * @throws An exception if an error occurs while calling an handler. - */ - function notifyHandlers(stack, isWindowError, error) { - var exception = null; - if (isWindowError && !TraceKit.collectWindowErrors) { - return; - } - for (var i in handlers) { - if (_has(handlers, i)) { - try { - handlers[i](stack, isWindowError, error); - } catch (inner) { - exception = inner; - } - } - } - - if (exception) { - throw exception; - } - } - - var _oldOnerrorHandler, _onErrorHandlerInstalled; - - /** - * Ensures all global unhandled exceptions are recorded. - * Supported by Gecko and IE. - * @param {string} message Error message. - * @param {string} url URL of script that generated the exception. - * @param {(number|string)} lineNo The line number at which the error occurred. - * @param {(number|string)=} columnNo The column number at which the error occurred. - * @param {Error=} errorObj The actual Error object. - * @memberof TraceKit.report - */ - function traceKitWindowOnError(message, url, lineNo, columnNo, errorObj) { - var stack = null; - - if (lastExceptionStack) { - TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message); - processLastException(); - } else if (errorObj) { - stack = TraceKit.computeStackTrace(errorObj); - notifyHandlers(stack, true, errorObj); - } else { - var location = { - 'url': url, - 'line': lineNo, - 'column': columnNo - }; - - var name; - var msg = message; // must be new var or will modify original `arguments` - if ({}.toString.call(message) === '[object String]') { - var groups = message.match(ERROR_TYPES_RE); - if (groups) { - name = groups[1]; - msg = groups[2]; - } - } - - location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line); - location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line); - stack = { - 'name': name, - 'message': msg, - 'mode': 'onerror', - 'stack': [location] - }; - - notifyHandlers(stack, true, null); - } - - if (_oldOnerrorHandler) { - return _oldOnerrorHandler.apply(this, arguments); - } - - return false; - } - - /** - * Install a global onerror handler - * @memberof TraceKit.report - */ - function installGlobalHandler() { - if (_onErrorHandlerInstalled === true) { - return; - } - - _oldOnerrorHandler = window.onerror; - window.onerror = traceKitWindowOnError; - _onErrorHandlerInstalled = true; - } - - /** - * Process the most recent exception - * @memberof TraceKit.report - */ - function processLastException() { - var _lastExceptionStack = lastExceptionStack, - _lastException = lastException; - lastExceptionStack = null; - lastException = null; - notifyHandlers(_lastExceptionStack, false, _lastException); - } - - /** - * Reports an unhandled Error to TraceKit. - * @param {Error} ex - * @memberof TraceKit.report - * @throws An exception if an incomplete stack trace is detected (old IE browsers). - */ - function report(ex) { - if (lastExceptionStack) { - if (lastException === ex) { - return; // already caught by an inner catch block, ignore - } else { - processLastException(); - } - } - - var stack = TraceKit.computeStackTrace(ex); - lastExceptionStack = stack; - lastException = ex; - - // If the stack trace is incomplete, wait for 2 seconds for - // slow slow IE to see if onerror occurs or not before reporting - // this exception; otherwise, we will end up with an incomplete - // stack trace - setTimeout(function () { - if (lastException === ex) { - processLastException(); - } - }, (stack.incomplete ? 2000 : 0)); - - throw ex; // re-throw to propagate to the top level (and cause window.onerror) - } - - report.subscribe = subscribe; - report.unsubscribe = unsubscribe; - return report; -}()); - -/** - * An object representing a single stack frame. - * @typedef {Object} StackFrame - * @property {string} url The JavaScript or HTML file URL. - * @property {string} func The function name, or empty for anonymous functions (if guessing did not work). - * @property {string[]?} args The arguments passed to the function, if known. - * @property {number=} line The line number, if known. - * @property {number=} column The column number, if known. - * @property {string[]} context An array of source code lines; the middle element corresponds to the correct line#. - * @memberof TraceKit - */ - -/** - * An object representing a JavaScript stack trace. - * @typedef {Object} StackTrace - * @property {string} name The name of the thrown exception. - * @property {string} message The exception error message. - * @property {TraceKit.StackFrame[]} stack An array of stack frames. - * @property {string} mode 'stack', 'stacktrace', 'multiline', 'callers', 'onerror', or 'failed' -- method used to collect the stack trace. - * @memberof TraceKit - */ - -/** - * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript - * - * Syntax: - * ```js - * s = TraceKit.computeStackTrace.ofCaller([depth]) - * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below) - * ``` - * - * Supports: - * - Firefox: full stack trace with line numbers and unreliable column - * number on top frame - * - Opera 10: full stack trace with line and column numbers - * - Opera 9-: full stack trace with line numbers - * - Chrome: full stack trace with line and column numbers - * - Safari: line and column number for the topmost stacktrace element - * only - * - IE: no line numbers whatsoever - * - * Tries to guess names of anonymous functions by looking for assignments - * in the source code. In IE and Safari, we have to guess source file names - * by searching for function bodies inside all page scripts. This will not - * work for scripts that are loaded cross-domain. - * Here be dragons: some function names may be guessed incorrectly, and - * duplicate functions may be mismatched. - * - * TraceKit.computeStackTrace should only be used for tracing purposes. - * Logging of unhandled exceptions should be done with TraceKit.report, - * which builds on top of TraceKit.computeStackTrace and provides better - * IE support by utilizing the window.onerror event to retrieve information - * about the top of the stack. - * - * Note: In IE and Safari, no stack trace is recorded on the Error object, - * so computeStackTrace instead walks its *own* chain of callers. - * This means that: - * * in Safari, some methods may be missing from the stack trace; - * * in IE, the topmost function in the stack trace will always be the - * caller of computeStackTrace. - * - * This is okay for tracing (because you are likely to be calling - * computeStackTrace from the function you want to be the topmost element - * of the stack trace anyway), but not okay for logging unhandled - * exceptions (because your catch block will likely be far away from the - * inner function that actually caused the exception). - * - * Tracing example: - * ```js - * function trace(message) { - * var stackInfo = TraceKit.computeStackTrace.ofCaller(); - * var data = message + "\n"; - * for(var i in stackInfo.stack) { - * var item = stackInfo.stack[i]; - * data += (item.func || '[anonymous]') + "() in " + item.url + ":" + (item.line || '0') + "\n"; - * } - * if (window.console) - * console.info(data); - * else - * alert(data); - * } - * ``` - * @memberof TraceKit - * @namespace - */ -TraceKit.computeStackTrace = (function computeStackTraceWrapper() { - var debug = false, - sourceCache = {}; - - /** - * Attempts to retrieve source code via XMLHttpRequest, which is used - * to look up anonymous function names. - * @param {string} url URL of source code. - * @return {string} Source contents. - * @memberof TraceKit.computeStackTrace - */ - function loadSource(url) { - if (!TraceKit.remoteFetching) { //Only attempt request if remoteFetching is on. - return ''; - } - try { - var getXHR = function() { - try { - return new window.XMLHttpRequest(); - } catch (e) { - // explicitly bubble up the exception if not found - return new window.ActiveXObject('Microsoft.XMLHTTP'); - } - }; - - var request = getXHR(); - request.open('GET', url, false); - request.send(''); - return request.responseText; - } catch (e) { - return ''; - } - } - - /** - * Retrieves source code from the source code cache. - * @param {string} url URL of source code. - * @return {Array.<string>} Source contents. - * @memberof TraceKit.computeStackTrace - */ - function getSource(url) { - if (typeof url !== 'string') { - return []; - } - - if (!_has(sourceCache, url)) { - // URL needs to be able to fetched within the acceptable domain. Otherwise, - // cross-domain errors will be triggered. - /* - Regex matches: - 0 - Full Url - 1 - Protocol - 2 - Domain - 3 - Port (Useful for internal applications) - 4 - Path - */ - var source = ''; - var domain = ''; - try { domain = window.document.domain; } catch (e) { } - var match = /(.*)\:\/\/([^:\/]+)([:\d]*)\/{0,1}([\s\S]*)/.exec(url); - if (match && match[2] === domain) { - source = loadSource(url); - } - sourceCache[url] = source ? source.split('\n') : []; - } - - return sourceCache[url]; - } - - /** - * Tries to use an externally loaded copy of source code to determine - * the name of a function by looking at the name of the variable it was - * assigned to, if any. - * @param {string} url URL of source code. - * @param {(string|number)} lineNo Line number in source code. - * @return {string} The function name, if discoverable. - * @memberof TraceKit.computeStackTrace - */ - function guessFunctionName(url, lineNo) { - var reFunctionArgNames = /function ([^(]*)\(([^)]*)\)/, - reGuessFunction = /['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/, - line = '', - maxLines = 10, - source = getSource(url), - m; - - if (!source.length) { - return UNKNOWN_FUNCTION; - } - - // Walk backwards from the first line in the function until we find the line which - // matches the pattern above, which is the function definition - for (var i = 0; i < maxLines; ++i) { - line = source[lineNo - i] + line; - - if (!_isUndefined(line)) { - if ((m = reGuessFunction.exec(line))) { - return m[1]; - } else if ((m = reFunctionArgNames.exec(line))) { - return m[1]; - } - } - } - - return UNKNOWN_FUNCTION; - } - - /** - * Retrieves the surrounding lines from where an exception occurred. - * @param {string} url URL of source code. - * @param {(string|number)} line Line number in source code to center around for context. - * @return {?Array.<string>} Lines of source code. - * @memberof TraceKit.computeStackTrace - */ - function gatherContext(url, line) { - var source = getSource(url); - - if (!source.length) { - return null; - } - - var context = [], - // linesBefore & linesAfter are inclusive with the offending line. - // if linesOfContext is even, there will be one extra line - // *before* the offending line. - linesBefore = Math.floor(TraceKit.linesOfContext / 2), - // Add one extra line if linesOfContext is odd - linesAfter = linesBefore + (TraceKit.linesOfContext % 2), - start = Math.max(0, line - linesBefore - 1), - end = Math.min(source.length, line + linesAfter - 1); - - line -= 1; // convert to 0-based index - - for (var i = start; i < end; ++i) { - if (!_isUndefined(source[i])) { - context.push(source[i]); - } - } - - return context.length > 0 ? context : null; - } - - /** - * Escapes special characters, except for whitespace, in a string to be - * used inside a regular expression as a string literal. - * @param {string} text The string. - * @return {string} The escaped string literal. - * @memberof TraceKit.computeStackTrace - */ - function escapeRegExp(text) { - return text.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g, '\\$&'); - } - - /** - * Escapes special characters in a string to be used inside a regular - * expression as a string literal. Also ensures that HTML entities will - * be matched the same as their literal friends. - * @param {string} body The string. - * @return {string} The escaped string. - * @memberof TraceKit.computeStackTrace - */ - function escapeCodeAsRegExpForMatchingInsideHTML(body) { - return escapeRegExp(body).replace('<', '(?:<|<)').replace('>', '(?:>|>)').replace('&', '(?:&|&)').replace('"', '(?:"|")').replace(/\s+/g, '\\s+'); - } - - /** - * Determines where a code fragment occurs in the source code. - * @param {RegExp} re The function definition. - * @param {Array.<string>} urls A list of URLs to search. - * @return {?Object.<string, (string|number)>} An object containing - * the url, line, and column number of the defined function. - * @memberof TraceKit.computeStackTrace - */ - function findSourceInUrls(re, urls) { - var source, m; - for (var i = 0, j = urls.length; i < j; ++i) { - if ((source = getSource(urls[i])).length) { - source = source.join('\n'); - if ((m = re.exec(source))) { - - return { - 'url': urls[i], - 'line': source.substring(0, m.index).split('\n').length, - 'column': m.index - source.lastIndexOf('\n', m.index) - 1 - }; - } - } - } - - return null; - } - - /** - * Determines at which column a code fragment occurs on a line of the - * source code. - * @param {string} fragment The code fragment. - * @param {string} url The URL to search. - * @param {(string|number)} line The line number to examine. - * @return {?number} The column number. - * @memberof TraceKit.computeStackTrace - */ - function findSourceInLine(fragment, url, line) { - var source = getSource(url), - re = new RegExp('\\b' + escapeRegExp(fragment) + '\\b'), - m; - - line -= 1; - - if (source && source.length > line && (m = re.exec(source[line]))) { - return m.index; - } - - return null; - } - - /** - * Determines where a function was defined within the source code. - * @param {(Function|string)} func A function reference or serialized - * function definition. - * @return {?Object.<string, (string|number)>} An object containing - * the url, line, and column number of the defined function. - * @memberof TraceKit.computeStackTrace - */ - function findSourceByFunctionBody(func) { - if (_isUndefined(window && window.document)) { - return; - } - - var urls = [window.location.href], - scripts = window.document.getElementsByTagName('script'), - body, - code = '' + func, - codeRE = /^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/, - eventRE = /^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/, - re, - parts, - result; - - for (var i = 0; i < scripts.length; ++i) { - var script = scripts[i]; - if (script.src) { - urls.push(script.src); - } - } - - if (!(parts = codeRE.exec(code))) { - re = new RegExp(escapeRegExp(code).replace(/\s+/g, '\\s+')); - } - - // not sure if this is really necessary, but I don’t have a test - // corpus large enough to confirm that and it was in the original. - else { - var name = parts[1] ? '\\s+' + parts[1] : '', - args = parts[2].split(',').join('\\s*,\\s*'); - - body = escapeRegExp(parts[3]).replace(/;$/, ';?'); // semicolon is inserted if the function ends with a comment.replace(/\s+/g, '\\s+'); - re = new RegExp('function' + name + '\\s*\\(\\s*' + args + '\\s*\\)\\s*{\\s*' + body + '\\s*}'); - } - - // look for a normal function definition - if ((result = findSourceInUrls(re, urls))) { - return result; - } - - // look for an old-school event handler function - if ((parts = eventRE.exec(code))) { - var event = parts[1]; - body = escapeCodeAsRegExpForMatchingInsideHTML(parts[2]); - - // look for a function defined in HTML as an onXXX handler - re = new RegExp('on' + event + '=[\\\'"]\\s*' + body + '\\s*[\\\'"]', 'i'); - - if ((result = findSourceInUrls(re, urls[0]))) { - return result; - } - - // look for ??? - re = new RegExp(body); - - if ((result = findSourceInUrls(re, urls))) { - return result; - } - } - - return null; - } - - // Contents of Exception in various browsers. - // - // SAFARI: - // ex.message = Can't find variable: qq - // ex.line = 59 - // ex.sourceId = 580238192 - // ex.sourceURL = http://... - // ex.expressionBeginOffset = 96 - // ex.expressionCaretOffset = 98 - // ex.expressionEndOffset = 98 - // ex.name = ReferenceError - // - // FIREFOX: - // ex.message = qq is not defined - // ex.fileName = http://... - // ex.lineNumber = 59 - // ex.columnNumber = 69 - // ex.stack = ...stack trace... (see the example below) - // ex.name = ReferenceError - // - // CHROME: - // ex.message = qq is not defined - // ex.name = ReferenceError - // ex.type = not_defined - // ex.arguments = ['aa'] - // ex.stack = ...stack trace... - // - // INTERNET EXPLORER: - // ex.message = ... - // ex.name = ReferenceError - // - // OPERA: - // ex.message = ...message... (see the example below) - // ex.name = ReferenceError - // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message) - // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace' - - /** - * Computes stack trace information from the stack property. - * Chrome and Gecko use this property. - * @param {Error} ex - * @return {?TraceKit.StackTrace} Stack trace information. - * @memberof TraceKit.computeStackTrace - */ - function computeStackTraceFromStackProp(ex) { - if (!ex.stack) { - return null; - } - - var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, - gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i, - winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i, - - // Used to additionally parse URL/line/column from eval frames - isEval, - geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, - chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/, - - lines = ex.stack.split('\n'), - stack = [], - submatch, - parts, - element, - reference = /^(.*) is undefined$/.exec(ex.message); - - for (var i = 0, j = lines.length; i < j; ++i) { - if ((parts = chrome.exec(lines[i]))) { - var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line - isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line - if (isEval && (submatch = chromeEval.exec(parts[2]))) { - // throw out eval line/column and use top-most line/column number - parts[2] = submatch[1]; // url - parts[3] = submatch[2]; // line - parts[4] = submatch[3]; // column - } - element = { - 'url': !isNative ? parts[2] : null, - 'func': parts[1] || UNKNOWN_FUNCTION, - 'args': isNative ? [parts[2]] : [], - 'line': parts[3] ? +parts[3] : null, - 'column': parts[4] ? +parts[4] : null - }; - } else if ( parts = winjs.exec(lines[i]) ) { - element = { - 'url': parts[2], - 'func': parts[1] || UNKNOWN_FUNCTION, - 'args': [], - 'line': +parts[3], - 'column': parts[4] ? +parts[4] : null - }; - } else if ((parts = gecko.exec(lines[i]))) { - isEval = parts[3] && parts[3].indexOf(' > eval') > -1; - if (isEval && (submatch = geckoEval.exec(parts[3]))) { - // throw out eval line/column and use top-most line number - parts[3] = submatch[1]; - parts[4] = submatch[2]; - parts[5] = null; // no column when eval - } else if (i === 0 && !parts[5] && !_isUndefined(ex.columnNumber)) { - // FireFox uses this awesome columnNumber property for its top frame - // Also note, Firefox's column number is 0-based and everything else expects 1-based, - // so adding 1 - // NOTE: this hack doesn't work if top-most frame is eval - stack[0].column = ex.columnNumber + 1; - } - element = { - 'url': parts[3], - 'func': parts[1] || UNKNOWN_FUNCTION, - 'args': parts[2] ? parts[2].split(',') : [], - 'line': parts[4] ? +parts[4] : null, - 'column': parts[5] ? +parts[5] : null - }; - } else { - continue; - } - - if (!element.func && element.line) { - element.func = guessFunctionName(element.url, element.line); - } - - element.context = element.line ? gatherContext(element.url, element.line) : null; - stack.push(element); - } - - if (!stack.length) { - return null; - } - - if (stack[0] && stack[0].line && !stack[0].column && reference) { - stack[0].column = findSourceInLine(reference[1], stack[0].url, stack[0].line); - } - - return { - 'mode': 'stack', - 'name': ex.name, - 'message': ex.message, - 'stack': stack - }; - } - - /** - * Computes stack trace information from the stacktrace property. - * Opera 10+ uses this property. - * @param {Error} ex - * @return {?TraceKit.StackTrace} Stack trace information. - * @memberof TraceKit.computeStackTrace - */ - function computeStackTraceFromStacktraceProp(ex) { - // Access and store the stacktrace property before doing ANYTHING - // else to it because Opera is not very good at providing it - // reliably in other circumstances. - var stacktrace = ex.stacktrace; - if (!stacktrace) { - return; - } - - var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i, - opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i, - lines = stacktrace.split('\n'), - stack = [], - parts; - - for (var line = 0; line < lines.length; line += 2) { - var element = null; - if ((parts = opera10Regex.exec(lines[line]))) { - element = { - 'url': parts[2], - 'line': +parts[1], - 'column': null, - 'func': parts[3], - 'args':[] - }; - } else if ((parts = opera11Regex.exec(lines[line]))) { - element = { - 'url': parts[6], - 'line': +parts[1], - 'column': +parts[2], - 'func': parts[3] || parts[4], - 'args': parts[5] ? parts[5].split(',') : [] - }; - } - - if (element) { - if (!element.func && element.line) { - element.func = guessFunctionName(element.url, element.line); - } - if (element.line) { - try { - element.context = gatherContext(element.url, element.line); - } catch (exc) {} - } - - if (!element.context) { - element.context = [lines[line + 1]]; - } - - stack.push(element); - } - } - - if (!stack.length) { - return null; - } - - return { - 'mode': 'stacktrace', - 'name': ex.name, - 'message': ex.message, - 'stack': stack - }; - } - - /** - * NOT TESTED. - * Computes stack trace information from an error message that includes - * the stack trace. - * Opera 9 and earlier use this method if the option to show stack - * traces is turned on in opera:config. - * @param {Error} ex - * @return {?TraceKit.StackTrace} Stack information. - * @memberof TraceKit.computeStackTrace - */ - function computeStackTraceFromOperaMultiLineMessage(ex) { - // TODO: Clean this function up - // Opera includes a stack trace into the exception message. An example is: - // - // Statement on line 3: Undefined variable: undefinedFunc - // Backtrace: - // Line 3 of linked script file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.js: In function zzz - // undefinedFunc(a); - // Line 7 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function yyy - // zzz(x, y, z); - // Line 3 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function xxx - // yyy(a, a, a); - // Line 1 of function script - // try { xxx('hi'); return false; } catch(ex) { TraceKit.report(ex); } - // ... - - var lines = ex.message.split('\n'); - if (lines.length < 4) { - return null; - } - - var lineRE1 = /^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i, - lineRE2 = /^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i, - lineRE3 = /^\s*Line (\d+) of function script\s*$/i, - stack = [], - scripts = (window && window.document && window.document.getElementsByTagName('script')), - inlineScriptBlocks = [], - parts; - - for (var s in scripts) { - if (_has(scripts, s) && !scripts[s].src) { - inlineScriptBlocks.push(scripts[s]); - } - } - - for (var line = 2; line < lines.length; line += 2) { - var item = null; - if ((parts = lineRE1.exec(lines[line]))) { - item = { - 'url': parts[2], - 'func': parts[3], - 'args': [], - 'line': +parts[1], - 'column': null - }; - } else if ((parts = lineRE2.exec(lines[line]))) { - item = { - 'url': parts[3], - 'func': parts[4], - 'args': [], - 'line': +parts[1], - 'column': null // TODO: Check to see if inline#1 (+parts[2]) points to the script number or column number. - }; - var relativeLine = (+parts[1]); // relative to the start of the <SCRIPT> block - var script = inlineScriptBlocks[parts[2] - 1]; - if (script) { - var source = getSource(item.url); - if (source) { - source = source.join('\n'); - var pos = source.indexOf(script.innerText); - if (pos >= 0) { - item.line = relativeLine + source.substring(0, pos).split('\n').length; - } - } - } - } else if ((parts = lineRE3.exec(lines[line]))) { - var url = window.location.href.replace(/#.*$/, ''); - var re = new RegExp(escapeCodeAsRegExpForMatchingInsideHTML(lines[line + 1])); - var src = findSourceInUrls(re, [url]); - item = { - 'url': url, - 'func': '', - 'args': [], - 'line': src ? src.line : parts[1], - 'column': null - }; - } - - if (item) { - if (!item.func) { - item.func = guessFunctionName(item.url, item.line); - } - var context = gatherContext(item.url, item.line); - var midline = (context ? context[Math.floor(context.length / 2)] : null); - if (context && midline.replace(/^\s*/, '') === lines[line + 1].replace(/^\s*/, '')) { - item.context = context; - } else { - // if (context) alert("Context mismatch. Correct midline:\n" + lines[i+1] + "\n\nMidline:\n" + midline + "\n\nContext:\n" + context.join("\n") + "\n\nURL:\n" + item.url); - item.context = [lines[line + 1]]; - } - stack.push(item); - } - } - if (!stack.length) { - return null; // could not parse multiline exception message as Opera stack trace - } - - return { - 'mode': 'multiline', - 'name': ex.name, - 'message': lines[0], - 'stack': stack - }; - } - - /** - * Adds information about the first frame to incomplete stack traces. - * Safari and IE require this to get complete data on the first frame. - * @param {TraceKit.StackTrace} stackInfo Stack trace information from - * one of the compute* methods. - * @param {string} url The URL of the script that caused an error. - * @param {(number|string)} lineNo The line number of the script that - * caused an error. - * @param {string=} message The error generated by the browser, which - * hopefully contains the name of the object that caused the error. - * @return {boolean} Whether or not the stack information was - * augmented. - * @memberof TraceKit.computeStackTrace - */ - function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) { - var initial = { - 'url': url, - 'line': lineNo - }; - - if (initial.url && initial.line) { - stackInfo.incomplete = false; - - if (!initial.func) { - initial.func = guessFunctionName(initial.url, initial.line); - } - - if (!initial.context) { - initial.context = gatherContext(initial.url, initial.line); - } - - var reference = / '([^']+)' /.exec(message); - if (reference) { - initial.column = findSourceInLine(reference[1], initial.url, initial.line); - } - - if (stackInfo.stack.length > 0) { - if (stackInfo.stack[0].url === initial.url) { - if (stackInfo.stack[0].line === initial.line) { - return false; // already in stack trace - } else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) { - stackInfo.stack[0].line = initial.line; - stackInfo.stack[0].context = initial.context; - return false; - } - } - } - - stackInfo.stack.unshift(initial); - stackInfo.partial = true; - return true; - } else { - stackInfo.incomplete = true; - } - - return false; - } - - /** - * Computes stack trace information by walking the arguments.caller - * chain at the time the exception occurred. This will cause earlier - * frames to be missed but is the only way to get any stack trace in - * Safari and IE. The top frame is restored by - * {@link augmentStackTraceWithInitialElement}. - * @param {Error} ex - * @return {TraceKit.StackTrace=} Stack trace information. - * @memberof TraceKit.computeStackTrace - */ - function computeStackTraceByWalkingCallerChain(ex, depth) { - var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i, - stack = [], - funcs = {}, - recursion = false, - parts, - item, - source; - - for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) { - if (curr === computeStackTrace || curr === TraceKit.report) { - continue; - } - - item = { - 'url': null, - 'func': UNKNOWN_FUNCTION, - 'args': [], - 'line': null, - 'column': null - }; - - if (curr.name) { - item.func = curr.name; - } else if ((parts = functionName.exec(curr.toString()))) { - item.func = parts[1]; - } - - if (typeof item.func === 'undefined') { - try { - item.func = parts.input.substring(0, parts.input.indexOf('{')); - } catch (e) { } - } - - if ((source = findSourceByFunctionBody(curr))) { - item.url = source.url; - item.line = source.line; - - if (item.func === UNKNOWN_FUNCTION) { - item.func = guessFunctionName(item.url, item.line); - } - - var reference = / '([^']+)' /.exec(ex.message || ex.description); - if (reference) { - item.column = findSourceInLine(reference[1], source.url, source.line); - } - } - - if (funcs['' + curr]) { - recursion = true; - }else{ - funcs['' + curr] = true; - } - - stack.push(item); - } - - if (depth) { - stack.splice(0, depth); - } - - var result = { - 'mode': 'callers', - 'name': ex.name, - 'message': ex.message, - 'stack': stack - }; - augmentStackTraceWithInitialElement(result, ex.sourceURL || ex.fileName, ex.line || ex.lineNumber, ex.message || ex.description); - return result; - } - - /** - * Computes a stack trace for an exception. - * @param {Error} ex - * @param {(string|number)=} depth - * @memberof TraceKit.computeStackTrace - */ - function computeStackTrace(ex, depth) { - var stack = null; - depth = (depth == null ? 0 : +depth); - - try { - // This must be tried first because Opera 10 *destroys* - // its stacktrace property if you try to access the stack - // property first!! - stack = computeStackTraceFromStacktraceProp(ex); - if (stack) { - return stack; - } - } catch (e) { - if (debug) { - throw e; - } - } - - try { - stack = computeStackTraceFromStackProp(ex); - if (stack) { - return stack; - } - } catch (e) { - if (debug) { - throw e; - } - } - - try { - stack = computeStackTraceFromOperaMultiLineMessage(ex); - if (stack) { - return stack; - } - } catch (e) { - if (debug) { - throw e; - } - } - - try { - stack = computeStackTraceByWalkingCallerChain(ex, depth + 1); - if (stack) { - return stack; - } - } catch (e) { - if (debug) { - throw e; - } - } - - return { - 'name': ex.name, - 'message': ex.message, - 'mode': 'failed' - }; - } - - /** - * Logs a stacktrace starting from the previous call and working down. - * @param {(number|string)=} depth How many frames deep to trace. - * @return {TraceKit.StackTrace} Stack trace information. - * @memberof TraceKit.computeStackTrace - */ - function computeStackTraceOfCaller(depth) { - depth = (depth == null ? 0 : +depth) + 1; // "+ 1" because "ofCaller" should drop one frame - try { - throw new Error(); - } catch (ex) { - return computeStackTrace(ex, depth + 1); - } - } - - computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement; - computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp; - computeStackTrace.guessFunctionName = guessFunctionName; - computeStackTrace.gatherContext = gatherContext; - computeStackTrace.ofCaller = computeStackTraceOfCaller; - computeStackTrace.getSource = getSource; - - return computeStackTrace; -}()); - -/** - * Extends support for global error handling for asynchronous browser - * functions. Adopted from Closure Library's errorhandler.js - * @memberof TraceKit - */ -TraceKit.extendToAsynchronousCallbacks = function () { - var _helper = function _helper(fnName) { - var originalFn = window[fnName]; - window[fnName] = function traceKitAsyncExtension() { - // Make a copy of the arguments - var args = _slice.call(arguments); - var originalCallback = args[0]; - if (typeof (originalCallback) === 'function') { - args[0] = TraceKit.wrap(originalCallback); - } - // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it - // also only supports 2 argument and doesn't care what "this" is, so we - // can just call the original function directly. - if (originalFn.apply) { - return originalFn.apply(this, args); - } else { - return originalFn(args[0], args[1]); - } - }; - }; - - _helper('setTimeout'); - _helper('setInterval'); -}; - -//Default options: -if (!TraceKit.remoteFetching) { - TraceKit.remoteFetching = true; -} -if (!TraceKit.collectWindowErrors) { - TraceKit.collectWindowErrors = true; -} -if (!TraceKit.linesOfContext || TraceKit.linesOfContext < 1) { - // 5 lines before, the offending line, 5 lines after - TraceKit.linesOfContext = 11; -} - -// UMD export -if (typeof define === 'function' && define.amd) { - define('TraceKit', [], TraceKit); -} else if (typeof module !== 'undefined' && module.exports && window.module !== module) { - module.exports = TraceKit; -} else { - window.TraceKit = TraceKit; -} - -}(typeof window !== 'undefined' ? window : global)); - - -var exports, require; -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - define('exceptionless', ["require","exports","TraceKit"], factory); - } else if (typeof exports === 'object') { - module.exports = factory(require, exports, require('TraceKit')); - } else { - root.exceptionless = factory(require, exports, root.TraceKit); - } -}(this, function(require, exports, TraceKit) { -if (!exports) { var exports = {}; } - -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -if (typeof process !== 'undefined') { -var os = require("os"); -var nodestacktrace = require("stack-trace"); -var child = require("child_process"); -var path = require("path"); -var Fs = require("fs"); -var Path = require("path"); -var http = require("http"); -var https = require("https"); -var url = require("url"); -} -var DefaultLastReferenceIdManager = (function () { - function DefaultLastReferenceIdManager() { - this._lastReferenceId = null; - } - DefaultLastReferenceIdManager.prototype.getLast = function () { - return this._lastReferenceId; - }; - DefaultLastReferenceIdManager.prototype.clearLast = function () { - this._lastReferenceId = null; - }; - DefaultLastReferenceIdManager.prototype.setLast = function (eventId) { - this._lastReferenceId = eventId; - }; - return DefaultLastReferenceIdManager; -}()); -exports.DefaultLastReferenceIdManager = DefaultLastReferenceIdManager; -var ConsoleLog = (function () { - function ConsoleLog() { - } - ConsoleLog.prototype.trace = function (message) { - this.log('debug', message); - }; - ConsoleLog.prototype.info = function (message) { - this.log('info', message); - }; - ConsoleLog.prototype.warn = function (message) { - this.log('warn', message); - }; - ConsoleLog.prototype.error = function (message) { - this.log('error', message); - }; - ConsoleLog.prototype.log = function (level, message) { - if (console) { - var msg = "[" + level + "] Exceptionless: " + message; - if (console[level]) { - console[level](msg); - } - else if (console.log) { - console["log"](msg); - } - } - }; - return ConsoleLog; -}()); -exports.ConsoleLog = ConsoleLog; -var NullLog = (function () { - function NullLog() { - } - NullLog.prototype.trace = function (message) { }; - NullLog.prototype.info = function (message) { }; - NullLog.prototype.warn = function (message) { }; - NullLog.prototype.error = function (message) { }; - return NullLog; -}()); -exports.NullLog = NullLog; -var HeartbeatPlugin = (function () { - function HeartbeatPlugin(heartbeatInterval) { - if (heartbeatInterval === void 0) { heartbeatInterval = 30000; } - this.priority = 100; - this.name = 'HeartbeatPlugin'; - this._interval = heartbeatInterval; - } - HeartbeatPlugin.prototype.run = function (context, next) { - clearInterval(this._intervalId); - var user = context.event.data['@user']; - if (user && user.identity) { - this._intervalId = setInterval(function () { return context.client.submitSessionHeartbeat(user.identity); }, this._interval); - } - next && next(); - }; - return HeartbeatPlugin; -}()); -exports.HeartbeatPlugin = HeartbeatPlugin; -var ReferenceIdPlugin = (function () { - function ReferenceIdPlugin() { - this.priority = 20; - this.name = 'ReferenceIdPlugin'; - } - ReferenceIdPlugin.prototype.run = function (context, next) { - if ((!context.event.reference_id || context.event.reference_id.length === 0) && context.event.type === 'error') { - context.event.reference_id = Utils.guid().replace('-', '').substring(0, 10); - } - next && next(); - }; - return ReferenceIdPlugin; -}()); -exports.ReferenceIdPlugin = ReferenceIdPlugin; -var EventPluginContext = (function () { - function EventPluginContext(client, event, contextData) { - this.client = client; - this.event = event; - this.contextData = contextData ? contextData : new ContextData(); - } - Object.defineProperty(EventPluginContext.prototype, "log", { - get: function () { - return this.client.config.log; - }, - enumerable: true, - configurable: true - }); - return EventPluginContext; -}()); -exports.EventPluginContext = EventPluginContext; -var EventPluginManager = (function () { - function EventPluginManager() { - } - EventPluginManager.run = function (context, callback) { - var wrap = function (plugin, next) { - return function () { - try { - if (!context.cancelled) { - plugin.run(context, next); - } - } - catch (ex) { - context.cancelled = true; - context.log.error("Error running plugin '" + plugin.name + "': " + ex.message + ". Discarding Event."); - } - if (context.cancelled && !!callback) { - callback(context); - } - }; - }; - var plugins = context.client.config.plugins; - var wrappedPlugins = []; - if (!!callback) { - wrappedPlugins[plugins.length] = wrap({ name: 'cb', priority: 9007199254740992, run: callback }, null); - } - for (var index = plugins.length - 1; index > -1; index--) { - wrappedPlugins[index] = wrap(plugins[index], !!callback || (index < plugins.length - 1) ? wrappedPlugins[index + 1] : null); - } - wrappedPlugins[0](); - }; - EventPluginManager.addDefaultPlugins = function (config) { - config.addPlugin(new ConfigurationDefaultsPlugin()); - config.addPlugin(new ErrorPlugin()); - config.addPlugin(new DuplicateCheckerPlugin()); - config.addPlugin(new EventExclusionPlugin()); - config.addPlugin(new ModuleInfoPlugin()); - config.addPlugin(new RequestInfoPlugin()); - config.addPlugin(new EnvironmentInfoPlugin()); - config.addPlugin(new SubmissionMethodPlugin()); - }; - return EventPluginManager; -}()); -exports.EventPluginManager = EventPluginManager; -var DefaultEventQueue = (function () { - function DefaultEventQueue(config) { - this._handlers = []; - this._processingQueue = false; - this._config = config; - } - DefaultEventQueue.prototype.enqueue = function (event) { - var eventWillNotBeQueued = 'The event will not be queued.'; - var config = this._config; - var log = config.log; - if (!config.enabled) { - log.info("Configuration is disabled. " + eventWillNotBeQueued); - return; - } - if (!config.isValid) { - log.info("Invalid Api Key. " + eventWillNotBeQueued); - return; - } - if (this.areQueuedItemsDiscarded()) { - log.info("Queue items are currently being discarded. " + eventWillNotBeQueued); - return; - } - this.ensureQueueTimer(); - var timestamp = config.storage.queue.save(event); - var logText = "type=" + event.type + " " + (!!event.reference_id ? 'refid=' + event.reference_id : ''); - if (timestamp) { - log.info("Enqueuing event: " + timestamp + " " + logText); - } - else { - log.error("Could not enqueue event " + logText); - } - }; - DefaultEventQueue.prototype.process = function (isAppExiting) { - var _this = this; - var queueNotProcessed = 'The queue will not be processed.'; - var config = this._config; - var log = config.log; - if (this._processingQueue) { - return; - } - log.info('Processing queue...'); - if (!config.enabled) { - log.info("Configuration is disabled. " + queueNotProcessed); - return; - } - if (!config.isValid) { - log.info("Invalid Api Key. " + queueNotProcessed); - return; - } - this._processingQueue = true; - this.ensureQueueTimer(); - try { - var events_1 = config.storage.queue.get(config.submissionBatchSize); - if (!events_1 || events_1.length === 0) { - this._processingQueue = false; - return; - } - log.info("Sending " + events_1.length + " events to " + config.serverUrl + "."); - config.submissionClient.postEvents(events_1.map(function (e) { return e.value; }), config, function (response) { - _this.processSubmissionResponse(response, events_1); - _this.eventsPosted(events_1.map(function (e) { return e.value; }), response); - log.info('Finished processing queue.'); - _this._processingQueue = false; - }, isAppExiting); - } - catch (ex) { - log.error("Error processing queue: " + ex); - this.suspendProcessing(); - this._processingQueue = false; - } - }; - DefaultEventQueue.prototype.suspendProcessing = function (durationInMinutes, discardFutureQueuedItems, clearQueue) { - var config = this._config; - if (!durationInMinutes || durationInMinutes <= 0) { - durationInMinutes = 5; - } - config.log.info("Suspending processing for " + durationInMinutes + " minutes."); - this._suspendProcessingUntil = new Date(new Date().getTime() + (durationInMinutes * 60000)); - if (discardFutureQueuedItems) { - this._discardQueuedItemsUntil = this._suspendProcessingUntil; - } - if (clearQueue) { - config.storage.queue.clear(); - } - }; - DefaultEventQueue.prototype.onEventsPosted = function (handler) { - !!handler && this._handlers.push(handler); - }; - DefaultEventQueue.prototype.eventsPosted = function (events, response) { - var handlers = this._handlers; - for (var _i = 0, handlers_1 = handlers; _i < handlers_1.length; _i++) { - var handler = handlers_1[_i]; - try { - handler(events, response); - } - catch (ex) { - this._config.log.error("Error calling onEventsPosted handler: " + ex); - } - } - }; - DefaultEventQueue.prototype.areQueuedItemsDiscarded = function () { - return this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date(); - }; - DefaultEventQueue.prototype.ensureQueueTimer = function () { - var _this = this; - if (!this._queueTimer) { - this._queueTimer = setInterval(function () { return _this.onProcessQueue(); }, 10000); - } - }; - DefaultEventQueue.prototype.isQueueProcessingSuspended = function () { - return this._suspendProcessingUntil && this._suspendProcessingUntil > new Date(); - }; - DefaultEventQueue.prototype.onProcessQueue = function () { - if (!this.isQueueProcessingSuspended() && !this._processingQueue) { - this.process(); - } - }; - DefaultEventQueue.prototype.processSubmissionResponse = function (response, events) { - var noSubmission = 'The event will not be submitted.'; - var config = this._config; - var log = config.log; - if (response.success) { - log.info("Sent " + events.length + " events."); - this.removeEvents(events); - return; - } - if (response.serviceUnavailable) { - log.error('Server returned service unavailable.'); - this.suspendProcessing(); - return; - } - if (response.paymentRequired) { - log.info('Too many events have been submitted, please upgrade your plan.'); - this.suspendProcessing(null, true, true); - return; - } - if (response.unableToAuthenticate) { - log.info("Unable to authenticate, please check your configuration. " + noSubmission); - this.suspendProcessing(15); - this.removeEvents(events); - return; - } - if (response.notFound || response.badRequest) { - log.error("Error while trying to submit data: " + response.message); - this.suspendProcessing(60 * 4); - this.removeEvents(events); - return; - } - if (response.requestEntityTooLarge) { - var message = 'Event submission discarded for being too large.'; - if (config.submissionBatchSize > 1) { - log.error(message + " Retrying with smaller batch size."); - config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5)); - } - else { - log.error(message + " " + noSubmission); - this.removeEvents(events); - } - return; - } - if (!response.success) { - log.error("Error submitting events: " + (response.message || 'Please check the network tab for more info.')); - this.suspendProcessing(); - } - }; - DefaultEventQueue.prototype.removeEvents = function (events) { - for (var index = 0; index < (events || []).length; index++) { - this._config.storage.queue.remove(events[index].timestamp); - } - }; - return DefaultEventQueue; -}()); -exports.DefaultEventQueue = DefaultEventQueue; -var InMemoryStorageProvider = (function () { - function InMemoryStorageProvider(maxQueueItems) { - if (maxQueueItems === void 0) { maxQueueItems = 250; } - this.queue = new InMemoryStorage(maxQueueItems); - this.settings = new InMemoryStorage(1); - } - return InMemoryStorageProvider; -}()); -exports.InMemoryStorageProvider = InMemoryStorageProvider; -var DefaultSubmissionClient = (function () { - function DefaultSubmissionClient() { - this.configurationVersionHeader = 'x-exceptionless-configversion'; - } - DefaultSubmissionClient.prototype.postEvents = function (events, config, callback, isAppExiting) { - var data = JSON.stringify(events); - var request = this.createRequest(config, 'POST', config.serverUrl + "/api/v2/events", data); - var cb = this.createSubmissionCallback(config, callback); - return config.submissionAdapter.sendRequest(request, cb, isAppExiting); - }; - DefaultSubmissionClient.prototype.postUserDescription = function (referenceId, description, config, callback) { - var path = config.serverUrl + "/api/v2/events/by-ref/" + encodeURIComponent(referenceId) + "/user-description"; - var data = JSON.stringify(description); - var request = this.createRequest(config, 'POST', path, data); - var cb = this.createSubmissionCallback(config, callback); - return config.submissionAdapter.sendRequest(request, cb); - }; - DefaultSubmissionClient.prototype.getSettings = function (config, version, callback) { - var request = this.createRequest(config, 'GET', config.serverUrl + "/api/v2/projects/config?v=" + version); - var cb = function (status, message, data, headers) { - if (status !== 200) { - return callback(new SettingsResponse(false, null, -1, null, message)); - } - var settings; - try { - settings = JSON.parse(data); - } - catch (e) { - config.log.error("Unable to parse settings: '" + data + "'"); - } - if (!settings || isNaN(settings.version)) { - return callback(new SettingsResponse(false, null, -1, null, 'Invalid configuration settings.')); - } - callback(new SettingsResponse(true, settings.settings || {}, settings.version)); - }; - return config.submissionAdapter.sendRequest(request, cb); - }; - DefaultSubmissionClient.prototype.sendHeartbeat = function (sessionIdOrUserId, closeSession, config) { - var request = this.createRequest(config, 'GET', config.heartbeatServerUrl + "/api/v2/events/session/heartbeat?id=" + sessionIdOrUserId + "&close=" + closeSession); - config.submissionAdapter.sendRequest(request); - }; - DefaultSubmissionClient.prototype.createRequest = function (config, method, url, data) { - if (data === void 0) { data = null; } - return { - method: method, - url: url, - data: data, - apiKey: config.apiKey, - userAgent: config.userAgent - }; - }; - DefaultSubmissionClient.prototype.createSubmissionCallback = function (config, callback) { - var _this = this; - return function (status, message, data, headers) { - var settingsVersion = headers && parseInt(headers[_this.configurationVersionHeader], 10); - SettingsManager.checkVersion(settingsVersion, config); - callback(new SubmissionResponse(status, message)); - }; - }; - return DefaultSubmissionClient; -}()); -exports.DefaultSubmissionClient = DefaultSubmissionClient; -var Utils = (function () { - function Utils() { - } - Utils.addRange = function (target) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - if (!target) { - target = []; - } - if (!values || values.length === 0) { - return target; - } - for (var _a = 0, values_1 = values; _a < values_1.length; _a++) { - var value = values_1[_a]; - if (value && target.indexOf(value) < 0) { - target.push(value); - } - } - return target; - }; - Utils.getHashCode = function (source) { - if (!source || source.length === 0) { - return 0; - } - var hash = 0; - for (var index = 0; index < source.length; index++) { - var character = source.charCodeAt(index); - hash = ((hash << 5) - hash) + character; - hash |= 0; - } - return hash; - }; - Utils.getCookies = function (cookies, exclusions) { - var result = {}; - var parts = (cookies || '').split('; '); - for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) { - var part = parts_1[_i]; - var cookie = part.split('='); - if (!Utils.isMatch(cookie[0], exclusions)) { - result[cookie[0]] = cookie[1]; - } - } - return !Utils.isEmpty(result) ? result : null; - }; - Utils.guid = function () { - function s4() { - return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); - } - return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); - }; - Utils.merge = function (defaultValues, values) { - var result = {}; - for (var key in defaultValues || {}) { - if (!!defaultValues[key]) { - result[key] = defaultValues[key]; - } - } - for (var key in values || {}) { - if (!!values[key]) { - result[key] = values[key]; - } - } - return result; - }; - Utils.parseVersion = function (source) { - if (!source) { - return null; - } - var versionRegex = /(v?((\d+)\.(\d+)(\.(\d+))?)(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?)/; - var matches = versionRegex.exec(source); - if (matches && matches.length > 0) { - return matches[0]; - } - return null; - }; - Utils.parseQueryString = function (query, exclusions) { - if (!query || query.length === 0) { - return null; - } - var pairs = query.split('&'); - if (pairs.length === 0) { - return null; - } - var result = {}; - for (var _i = 0, pairs_1 = pairs; _i < pairs_1.length; _i++) { - var pair = pairs_1[_i]; - var parts = pair.split('='); - if (!Utils.isMatch(parts[0], exclusions)) { - result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]); - } - } - return !Utils.isEmpty(result) ? result : null; - }; - Utils.randomNumber = function () { - return Math.floor(Math.random() * 9007199254740992); - }; - Utils.isMatch = function (input, patterns, ignoreCase) { - if (ignoreCase === void 0) { ignoreCase = true; } - if (!input || typeof input !== 'string') { - return false; - } - var trim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; - input = (ignoreCase ? input.toLowerCase() : input).replace(trim, ''); - return (patterns || []).some(function (pattern) { - if (typeof pattern !== 'string') { - return false; - } - pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, ''); - if (pattern.length <= 0) { - return false; - } - var startsWithWildcard = pattern[0] === '*'; - if (startsWithWildcard) { - pattern = pattern.slice(1); - } - var endsWithWildcard = pattern[pattern.length - 1] === '*'; - if (endsWithWildcard) { - pattern = pattern.substring(0, pattern.length - 1); - } - if (startsWithWildcard && endsWithWildcard) { - return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1; - } - if (startsWithWildcard) { - return Utils.endsWith(input, pattern); - } - if (endsWithWildcard) { - return Utils.startsWith(input, pattern); - } - return input === pattern; - }); - }; - Utils.isEmpty = function (input) { - return input === null || (typeof (input) === 'object' && Object.keys(input).length === 0); - }; - Utils.startsWith = function (input, prefix) { - return input.substring(0, prefix.length) === prefix; - }; - Utils.endsWith = function (input, suffix) { - return input.indexOf(suffix, input.length - suffix.length) !== -1; - }; - Utils.stringify = function (data, exclusions, maxDepth) { - function stringifyImpl(obj, excludedKeys) { - var cache = []; - return JSON.stringify(obj, function (key, value) { - if (Utils.isMatch(key, excludedKeys)) { - return; - } - if (typeof value === 'object' && !!value) { - if (cache.indexOf(value) !== -1) { - return; - } - cache.push(value); - } - return value; - }); - } - if (({}).toString.call(data) === '[object Object]') { - var flattened = {}; - for (var prop in data) { - var value = data[prop]; - if (value === data) { - continue; - } - flattened[prop] = data[prop]; - } - return stringifyImpl(flattened, exclusions); - } - if (({}).toString.call(data) === '[object Array]') { - var result = []; - for (var index = 0; index < data.length; index++) { - result[index] = JSON.parse(stringifyImpl(data[index], exclusions)); - } - return JSON.stringify(result); - } - return stringifyImpl(data, exclusions); - }; - Utils.toBoolean = function (input, defaultValue) { - if (defaultValue === void 0) { defaultValue = false; } - if (typeof input === 'boolean') { - return input; - } - if (input === null || typeof input !== 'number' && typeof input !== 'string') { - return defaultValue; - } - switch ((input + '').toLowerCase().trim()) { - case 'true': - case 'yes': - case '1': return true; - case 'false': - case 'no': - case '0': - case null: return false; - } - return defaultValue; - }; - return Utils; -}()); -exports.Utils = Utils; -var SettingsManager = (function () { - function SettingsManager() { - } - SettingsManager.onChanged = function (handler) { - !!handler && this._handlers.push(handler); - }; - SettingsManager.applySavedServerSettings = function (config) { - if (!config || !config.isValid) { - return; - } - var savedSettings = this.getSavedServerSettings(config); - config.log.info("Applying saved settings: v" + savedSettings.version); - config.settings = Utils.merge(config.settings, savedSettings.settings); - this.changed(config); - }; - SettingsManager.getVersion = function (config) { - if (!config || !config.isValid) { - return 0; - } - var savedSettings = this.getSavedServerSettings(config); - return savedSettings.version || 0; - }; - SettingsManager.checkVersion = function (version, config) { - var currentVersion = this.getVersion(config); - if (version <= currentVersion) { - return; - } - config.log.info("Updating settings from v" + currentVersion + " to v" + version); - this.updateSettings(config, currentVersion); - }; - SettingsManager.updateSettings = function (config, version) { - var _this = this; - if (!config || !config.enabled) { - return; - } - var unableToUpdateMessage = 'Unable to update settings'; - if (!config.isValid) { - config.log.error(unableToUpdateMessage + ": ApiKey is not set."); - return; - } - if (!version || version < 0) { - version = this.getVersion(config); - } - config.log.info("Checking for updated settings from: v" + version + "."); - config.submissionClient.getSettings(config, version, function (response) { - if (!config || !response || !response.success || !response.settings) { - config.log.warn(unableToUpdateMessage + ": " + response.message); - return; - } - config.settings = Utils.merge(config.settings, response.settings); - var savedServerSettings = SettingsManager.getSavedServerSettings(config); - for (var key in savedServerSettings) { - if (response.settings[key]) { - continue; - } - delete config.settings[key]; - } - var newSettings = { - version: response.settingsVersion, - settings: response.settings - }; - config.storage.settings.save(newSettings); - config.log.info("Updated settings: v" + newSettings.version); - _this.changed(config); - }); - }; - SettingsManager.changed = function (config) { - var handlers = this._handlers; - for (var _i = 0, handlers_2 = handlers; _i < handlers_2.length; _i++) { - var handler = handlers_2[_i]; - try { - handler(config); - } - catch (ex) { - config.log.error("Error calling onChanged handler: " + ex); - } - } - }; - SettingsManager.getSavedServerSettings = function (config) { - var item = config.storage.settings.get()[0]; - if (item && item.value && item.value.version && item.value.settings) { - return item.value; - } - return { version: 0, settings: {} }; - }; - return SettingsManager; -}()); -SettingsManager._handlers = []; -exports.SettingsManager = SettingsManager; -var SubmissionResponse = (function () { - function SubmissionResponse(statusCode, message) { - this.success = false; - this.badRequest = false; - this.serviceUnavailable = false; - this.paymentRequired = false; - this.unableToAuthenticate = false; - this.notFound = false; - this.requestEntityTooLarge = false; - this.statusCode = statusCode; - this.message = message; - this.success = statusCode >= 200 && statusCode <= 299; - this.badRequest = statusCode === 400; - this.serviceUnavailable = statusCode === 503; - this.paymentRequired = statusCode === 402; - this.unableToAuthenticate = statusCode === 401 || statusCode === 403; - this.notFound = statusCode === 404; - this.requestEntityTooLarge = statusCode === 413; - } - return SubmissionResponse; -}()); -exports.SubmissionResponse = SubmissionResponse; -var ExceptionlessClient = (function () { - function ExceptionlessClient(settingsOrApiKey, serverUrl) { - var _this = this; - this.config = typeof settingsOrApiKey === 'object' - ? new Configuration(settingsOrApiKey) - : new Configuration({ apiKey: settingsOrApiKey, serverUrl: serverUrl }); - this.updateSettingsTimer(5000); - this.config.onChanged(function (config) { return _this.updateSettingsTimer(_this._timeoutId > 0 ? 5000 : 0); }); - this.config.queue.onEventsPosted(function (events, response) { return _this.updateSettingsTimer(); }); - } - ExceptionlessClient.prototype.createException = function (exception) { - var pluginContextData = new ContextData(); - pluginContextData.setException(exception); - return this.createEvent(pluginContextData).setType('error'); - }; - ExceptionlessClient.prototype.submitException = function (exception, callback) { - this.createException(exception).submit(callback); - }; - ExceptionlessClient.prototype.createUnhandledException = function (exception, submissionMethod) { - var builder = this.createException(exception); - builder.pluginContextData.markAsUnhandledError(); - builder.pluginContextData.setSubmissionMethod(submissionMethod); - return builder; - }; - ExceptionlessClient.prototype.submitUnhandledException = function (exception, submissionMethod, callback) { - this.createUnhandledException(exception, submissionMethod).submit(callback); - }; - ExceptionlessClient.prototype.createFeatureUsage = function (feature) { - return this.createEvent().setType('usage').setSource(feature); - }; - ExceptionlessClient.prototype.submitFeatureUsage = function (feature, callback) { - this.createFeatureUsage(feature).submit(callback); - }; - ExceptionlessClient.prototype.createLog = function (sourceOrMessage, message, level) { - var builder = this.createEvent().setType('log'); - if (level) { - builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty('@level', level); - } - else if (message) { - builder = builder.setSource(sourceOrMessage).setMessage(message); - } - else { - builder = builder.setMessage(sourceOrMessage); - try { - var caller = this.createLog.caller; - builder = builder.setSource(caller && caller.caller && caller.caller.name); - } - catch (e) { - this.config.log.trace('Unable to resolve log source: ' + e.message); - } - } - return builder; - }; - ExceptionlessClient.prototype.submitLog = function (sourceOrMessage, message, level, callback) { - this.createLog(sourceOrMessage, message, level).submit(callback); - }; - ExceptionlessClient.prototype.createNotFound = function (resource) { - return this.createEvent().setType('404').setSource(resource); - }; - ExceptionlessClient.prototype.submitNotFound = function (resource, callback) { - this.createNotFound(resource).submit(callback); - }; - ExceptionlessClient.prototype.createSessionStart = function () { - return this.createEvent().setType('session'); - }; - ExceptionlessClient.prototype.submitSessionStart = function (callback) { - this.createSessionStart().submit(callback); - }; - ExceptionlessClient.prototype.submitSessionEnd = function (sessionIdOrUserId) { - if (sessionIdOrUserId) { - this.config.log.info("Submitting session end: " + sessionIdOrUserId); - this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, true, this.config); - } - }; - ExceptionlessClient.prototype.submitSessionHeartbeat = function (sessionIdOrUserId) { - if (sessionIdOrUserId) { - this.config.log.info("Submitting session heartbeat: " + sessionIdOrUserId); - this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, false, this.config); - } - }; - ExceptionlessClient.prototype.createEvent = function (pluginContextData) { - return new EventBuilder({ date: new Date() }, this, pluginContextData); - }; - ExceptionlessClient.prototype.submitEvent = function (event, pluginContextData, callback) { - function cancelled(context) { - if (!!context) { - context.cancelled = true; - } - return !!callback && callback(context); - } - var context = new EventPluginContext(this, event, pluginContextData); - if (!event) { - return cancelled(context); - } - if (!this.config.enabled) { - this.config.log.info('Event submission is currently disabled.'); - return cancelled(context); - } - if (!event.data) { - event.data = {}; - } - if (!event.tags || !event.tags.length) { - event.tags = []; - } - EventPluginManager.run(context, function (ctx) { - var config = ctx.client.config; - var ev = ctx.event; - if (!ctx.cancelled) { - if (!ev.type || ev.type.length === 0) { - ev.type = 'log'; - } - if (!ev.date) { - ev.date = new Date(); - } - config.queue.enqueue(ev); - if (ev.reference_id && ev.reference_id.length > 0) { - ctx.log.info("Setting last reference id '" + ev.reference_id + "'"); - config.lastReferenceIdManager.setLast(ev.reference_id); - } - } - !!callback && callback(ctx); - }); - }; - ExceptionlessClient.prototype.updateUserEmailAndDescription = function (referenceId, email, description, callback) { - var _this = this; - if (!referenceId || !email || !description || !this.config.enabled) { - return !!callback && callback(new SubmissionResponse(500, 'cancelled')); - } - var userDescription = { email_address: email, description: description }; - this.config.submissionClient.postUserDescription(referenceId, userDescription, this.config, function (response) { - if (!response.success) { - _this.config.log.error("Failed to submit user email and description for event '" + referenceId + "': " + response.statusCode + " " + response.message); - } - !!callback && callback(response); - }); - }; - ExceptionlessClient.prototype.getLastReferenceId = function () { - return this.config.lastReferenceIdManager.getLast(); - }; - ExceptionlessClient.prototype.updateSettingsTimer = function (initialDelay) { - var _this = this; - this.config.log.info("Updating settings timer with delay: " + initialDelay); - this._timeoutId = clearTimeout(this._timeoutId); - this._timeoutId = clearInterval(this._intervalId); - var interval = this.config.updateSettingsWhenIdleInterval; - if (interval > 0) { - var updateSettings = function () { return SettingsManager.updateSettings(_this.config); }; - if (initialDelay > 0) { - this._timeoutId = setTimeout(updateSettings, initialDelay); - } - this._intervalId = setInterval(updateSettings, interval); - } - }; - Object.defineProperty(ExceptionlessClient, "default", { - get: function () { - if (ExceptionlessClient._instance === null) { - ExceptionlessClient._instance = new ExceptionlessClient(null); - } - return ExceptionlessClient._instance; - }, - enumerable: true, - configurable: true - }); - return ExceptionlessClient; -}()); -ExceptionlessClient._instance = null; -exports.ExceptionlessClient = ExceptionlessClient; -var ContextData = (function () { - function ContextData() { - } - ContextData.prototype.setException = function (exception) { - if (exception) { - this['@@_Exception'] = exception; - } - }; - Object.defineProperty(ContextData.prototype, "hasException", { - get: function () { - return !!this['@@_Exception']; - }, - enumerable: true, - configurable: true - }); - ContextData.prototype.getException = function () { - return this['@@_Exception'] || null; - }; - ContextData.prototype.markAsUnhandledError = function () { - this['@@_IsUnhandledError'] = true; - }; - Object.defineProperty(ContextData.prototype, "isUnhandledError", { - get: function () { - return !!this['@@_IsUnhandledError']; - }, - enumerable: true, - configurable: true - }); - ContextData.prototype.setSubmissionMethod = function (method) { - if (method) { - this['@@_SubmissionMethod'] = method; - } - }; - ContextData.prototype.getSubmissionMethod = function () { - return this['@@_SubmissionMethod'] || null; - }; - return ContextData; -}()); -exports.ContextData = ContextData; -var Configuration = (function () { - function Configuration(configSettings) { - this.defaultTags = []; - this.defaultData = {}; - this.enabled = true; - this.lastReferenceIdManager = new DefaultLastReferenceIdManager(); - this.settings = {}; - this._serverUrl = 'https://collector.exceptionless.io'; - this._heartbeatServerUrl = 'https://heartbeat.exceptionless.io'; - this._updateSettingsWhenIdleInterval = 120000; - this._dataExclusions = []; - this._userAgentBotPatterns = []; - this._plugins = []; - this._handlers = []; - function inject(fn) { - return typeof fn === 'function' ? fn(this) : fn; - } - configSettings = Utils.merge(Configuration.defaults, configSettings); - this.log = inject(configSettings.log) || new NullLog(); - this.apiKey = configSettings.apiKey; - this.serverUrl = configSettings.serverUrl; - this.heartbeatServerUrl = configSettings.heartbeatServerUrl; - this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval; - this.environmentInfoCollector = inject(configSettings.environmentInfoCollector); - this.errorParser = inject(configSettings.errorParser); - this.lastReferenceIdManager = inject(configSettings.lastReferenceIdManager) || new DefaultLastReferenceIdManager(); - this.moduleCollector = inject(configSettings.moduleCollector); - this.requestInfoCollector = inject(configSettings.requestInfoCollector); - this.submissionBatchSize = inject(configSettings.submissionBatchSize) || 50; - this.submissionAdapter = inject(configSettings.submissionAdapter); - this.submissionClient = inject(configSettings.submissionClient) || new DefaultSubmissionClient(); - this.storage = inject(configSettings.storage) || new InMemoryStorageProvider(); - this.queue = inject(configSettings.queue) || new DefaultEventQueue(this); - SettingsManager.applySavedServerSettings(this); - EventPluginManager.addDefaultPlugins(this); - } - Object.defineProperty(Configuration.prototype, "apiKey", { - get: function () { - return this._apiKey; - }, - set: function (value) { - this._apiKey = value || null; - this.log.info("apiKey: " + this._apiKey); - this.changed(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "isValid", { - get: function () { - return !!this.apiKey && this.apiKey.length >= 10; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "serverUrl", { - get: function () { - return this._serverUrl; - }, - set: function (value) { - if (!!value) { - this._serverUrl = value; - this._heartbeatServerUrl = value; - this.log.info("serverUrl: " + value); - this.changed(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "heartbeatServerUrl", { - get: function () { - return this._heartbeatServerUrl; - }, - set: function (value) { - if (!!value) { - this._heartbeatServerUrl = value; - this.log.info("heartbeatServerUrl: " + value); - this.changed(); - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "updateSettingsWhenIdleInterval", { - get: function () { - return this._updateSettingsWhenIdleInterval; - }, - set: function (value) { - if (typeof value !== 'number') { - return; - } - if (value <= 0) { - value = -1; - } - else if (value > 0 && value < 15000) { - value = 15000; - } - this._updateSettingsWhenIdleInterval = value; - this.log.info("updateSettingsWhenIdleInterval: " + value); - this.changed(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Configuration.prototype, "dataExclusions", { - get: function () { - var exclusions = this.settings['@@DataExclusions']; - return this._dataExclusions.concat(exclusions && exclusions.split(',') || []); - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.addDataExclusions = function () { - var exclusions = []; - for (var _i = 0; _i < arguments.length; _i++) { - exclusions[_i] = arguments[_i]; - } - this._dataExclusions = Utils.addRange.apply(Utils, [this._dataExclusions].concat(exclusions)); - }; - Object.defineProperty(Configuration.prototype, "userAgentBotPatterns", { - get: function () { - var patterns = this.settings['@@UserAgentBotPatterns']; - return this._userAgentBotPatterns.concat(patterns && patterns.split(',') || []); - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.addUserAgentBotPatterns = function () { - var userAgentBotPatterns = []; - for (var _i = 0; _i < arguments.length; _i++) { - userAgentBotPatterns[_i] = arguments[_i]; - } - this._userAgentBotPatterns = Utils.addRange.apply(Utils, [this._userAgentBotPatterns].concat(userAgentBotPatterns)); - }; - Object.defineProperty(Configuration.prototype, "plugins", { - get: function () { - return this._plugins.sort(function (p1, p2) { - return (p1.priority < p2.priority) ? -1 : (p1.priority > p2.priority) ? 1 : 0; - }); - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.addPlugin = function (pluginOrName, priority, pluginAction) { - var plugin = !!pluginAction ? { name: pluginOrName, priority: priority, run: pluginAction } : pluginOrName; - if (!plugin || !plugin.run) { - this.log.error('Add plugin failed: Run method not defined'); - return; - } - if (!plugin.name) { - plugin.name = Utils.guid(); - } - if (!plugin.priority) { - plugin.priority = 0; - } - var pluginExists = false; - var plugins = this._plugins; - for (var _i = 0, plugins_1 = plugins; _i < plugins_1.length; _i++) { - var p = plugins_1[_i]; - if (p.name === plugin.name) { - pluginExists = true; - break; - } - } - if (!pluginExists) { - plugins.push(plugin); - } - }; - Configuration.prototype.removePlugin = function (pluginOrName) { - var name = typeof pluginOrName === 'string' ? pluginOrName : pluginOrName.name; - if (!name) { - this.log.error('Remove plugin failed: Plugin name not defined'); - return; - } - var plugins = this._plugins; - for (var index = 0; index < plugins.length; index++) { - if (plugins[index].name === name) { - plugins.splice(index, 1); - break; - } - } - }; - Configuration.prototype.setVersion = function (version) { - if (!!version) { - this.defaultData['@version'] = version; - } - }; - Configuration.prototype.setUserIdentity = function (userInfoOrIdentity, name) { - var USER_KEY = '@user'; - var userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name: name }; - var shouldRemove = !userInfo || (!userInfo.identity && !userInfo.name); - if (shouldRemove) { - delete this.defaultData[USER_KEY]; - } - else { - this.defaultData[USER_KEY] = userInfo; - } - this.log.info("user identity: " + (shouldRemove ? 'null' : userInfo.identity)); - }; - Object.defineProperty(Configuration.prototype, "userAgent", { - get: function () { - return 'exceptionless-universal-js/1.5.4'; - }, - enumerable: true, - configurable: true - }); - Configuration.prototype.useSessions = function (sendHeartbeats, heartbeatInterval) { - if (sendHeartbeats === void 0) { sendHeartbeats = true; } - if (heartbeatInterval === void 0) { heartbeatInterval = 30000; } - if (sendHeartbeats) { - this.addPlugin(new HeartbeatPlugin(heartbeatInterval)); - } - }; - Configuration.prototype.useReferenceIds = function () { - this.addPlugin(new ReferenceIdPlugin()); - }; - Configuration.prototype.useLocalStorage = function () { - }; - Configuration.prototype.useDebugLogger = function () { - this.log = new ConsoleLog(); - }; - Configuration.prototype.onChanged = function (handler) { - !!handler && this._handlers.push(handler); - }; - Configuration.prototype.changed = function () { - var handlers = this._handlers; - for (var _i = 0, handlers_3 = handlers; _i < handlers_3.length; _i++) { - var handler = handlers_3[_i]; - try { - handler(this); - } - catch (ex) { - this.log.error("Error calling onChanged handler: " + ex); - } - } - }; - Object.defineProperty(Configuration, "defaults", { - get: function () { - if (Configuration._defaultSettings === null) { - Configuration._defaultSettings = {}; - } - return Configuration._defaultSettings; - }, - enumerable: true, - configurable: true - }); - return Configuration; -}()); -Configuration._defaultSettings = null; -exports.Configuration = Configuration; -var SettingsResponse = (function () { - function SettingsResponse(success, settings, settingsVersion, exception, message) { - if (settingsVersion === void 0) { settingsVersion = -1; } - if (exception === void 0) { exception = null; } - if (message === void 0) { message = null; } - this.success = false; - this.settingsVersion = -1; - this.success = success; - this.settings = settings; - this.settingsVersion = settingsVersion; - this.exception = exception; - this.message = message; - } - return SettingsResponse; -}()); -exports.SettingsResponse = SettingsResponse; -var EventBuilder = (function () { - function EventBuilder(event, client, pluginContextData) { - this._validIdentifierErrorMessage = 'must contain between 8 and 100 alphanumeric or \'-\' characters.'; - this.target = event; - this.client = client; - this.pluginContextData = pluginContextData || new ContextData(); - } - EventBuilder.prototype.setType = function (type) { - if (!!type) { - this.target.type = type; - } - return this; - }; - EventBuilder.prototype.setSource = function (source) { - if (!!source) { - this.target.source = source; - } - return this; - }; - EventBuilder.prototype.setReferenceId = function (referenceId) { - if (!this.isValidIdentifier(referenceId)) { - throw new Error("ReferenceId " + this._validIdentifierErrorMessage); - } - this.target.reference_id = referenceId; - return this; - }; - EventBuilder.prototype.setEventReference = function (name, id) { - if (!name) { - throw new Error('Invalid name'); - } - if (!id || !this.isValidIdentifier(id)) { - throw new Error("Id " + this._validIdentifierErrorMessage); - } - this.setProperty('@ref:' + name, id); - return this; - }; - EventBuilder.prototype.setMessage = function (message) { - if (!!message) { - this.target.message = message; - } - return this; - }; - EventBuilder.prototype.setGeo = function (latitude, longitude) { - if (latitude < -90.0 || latitude > 90.0) { - throw new Error('Must be a valid latitude value between -90.0 and 90.0.'); - } - if (longitude < -180.0 || longitude > 180.0) { - throw new Error('Must be a valid longitude value between -180.0 and 180.0.'); - } - this.target.geo = latitude + "," + longitude; - return this; - }; - EventBuilder.prototype.setUserIdentity = function (userInfoOrIdentity, name) { - var userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name: name }; - if (!userInfo || (!userInfo.identity && !userInfo.name)) { - return this; - } - this.setProperty('@user', userInfo); - return this; - }; - EventBuilder.prototype.setUserDescription = function (emailAddress, description) { - if (emailAddress && description) { - this.setProperty('@user_description', { email_address: emailAddress, description: description }); - } - return this; - }; - EventBuilder.prototype.setManualStackingInfo = function (signatureData, title) { - if (signatureData) { - var stack = { signature_data: signatureData }; - if (title) { - stack.title = title; - } - this.setProperty('@stack', stack); - } - return this; - }; - EventBuilder.prototype.setManualStackingKey = function (manualStackingKey, title) { - if (manualStackingKey) { - var data = { ManualStackingKey: manualStackingKey }; - this.setManualStackingInfo(data, title); - } - return this; - }; - EventBuilder.prototype.setValue = function (value) { - if (!!value) { - this.target.value = value; - } - return this; - }; - EventBuilder.prototype.addTags = function () { - var tags = []; - for (var _i = 0; _i < arguments.length; _i++) { - tags[_i] = arguments[_i]; - } - this.target.tags = Utils.addRange.apply(Utils, [this.target.tags].concat(tags)); - return this; - }; - EventBuilder.prototype.setProperty = function (name, value, maxDepth, excludedPropertyNames) { - if (!name || (value === undefined || value == null)) { - return this; - } - if (!this.target.data) { - this.target.data = {}; - } - var result = JSON.parse(Utils.stringify(value, this.client.config.dataExclusions.concat(excludedPropertyNames || []), maxDepth)); - if (!Utils.isEmpty(result)) { - this.target.data[name] = result; - } - return this; - }; - EventBuilder.prototype.markAsCritical = function (critical) { - if (critical) { - this.addTags('Critical'); - } - return this; - }; - EventBuilder.prototype.addRequestInfo = function (request) { - if (!!request) { - this.pluginContextData['@request'] = request; - } - return this; - }; - EventBuilder.prototype.submit = function (callback) { - this.client.submitEvent(this.target, this.pluginContextData, callback); - }; - EventBuilder.prototype.isValidIdentifier = function (value) { - if (!value) { - return true; - } - if (value.length < 8 || value.length > 100) { - return false; - } - for (var index = 0; index < value.length; index++) { - var code = value.charCodeAt(index); - var isDigit = (code >= 48) && (code <= 57); - var isLetter = ((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122)); - var isMinus = code === 45; - if (!(isDigit || isLetter) && !isMinus) { - return false; - } - } - return true; - }; - return EventBuilder; -}()); -exports.EventBuilder = EventBuilder; -var ConfigurationDefaultsPlugin = (function () { - function ConfigurationDefaultsPlugin() { - this.priority = 10; - this.name = 'ConfigurationDefaultsPlugin'; - } - ConfigurationDefaultsPlugin.prototype.run = function (context, next) { - var config = context.client.config; - var defaultTags = config.defaultTags || []; - for (var _i = 0, defaultTags_1 = defaultTags; _i < defaultTags_1.length; _i++) { - var tag = defaultTags_1[_i]; - if (!!tag && context.event.tags.indexOf(tag) < 0) { - context.event.tags.push(tag); - } - } - var defaultData = config.defaultData || {}; - for (var key in defaultData) { - if (!!defaultData[key]) { - var result = JSON.parse(Utils.stringify(defaultData[key], config.dataExclusions)); - if (!Utils.isEmpty(result)) { - context.event.data[key] = result; - } - } - } - next && next(); - }; - return ConfigurationDefaultsPlugin; -}()); -exports.ConfigurationDefaultsPlugin = ConfigurationDefaultsPlugin; -var DuplicateCheckerPlugin = (function () { - function DuplicateCheckerPlugin(getCurrentTime, interval) { - if (getCurrentTime === void 0) { getCurrentTime = function () { return Date.now(); }; } - if (interval === void 0) { interval = 30000; } - var _this = this; - this.priority = 1010; - this.name = 'DuplicateCheckerPlugin'; - this._mergedEvents = []; - this._processedHashcodes = []; - this._getCurrentTime = getCurrentTime; - this._interval = interval; - setInterval(function () { - while (_this._mergedEvents.length > 0) { - _this._mergedEvents.shift().resubmit(); - } - }, interval); - } - DuplicateCheckerPlugin.prototype.run = function (context, next) { - var _this = this; - function getHashCode(error) { - var hashCode = 0; - while (error) { - if (error.message && error.message.length) { - hashCode += (hashCode * 397) ^ Utils.getHashCode(error.message); - } - if (error.stack_trace && error.stack_trace.length) { - hashCode += (hashCode * 397) ^ Utils.getHashCode(JSON.stringify(error.stack_trace)); - } - error = error.inner; - } - return hashCode; - } - var error = context.event.data['@error']; - var hashCode = getHashCode(error); - if (hashCode) { - var count = context.event.count || 1; - var now_1 = this._getCurrentTime(); - var merged = this._mergedEvents.filter(function (s) { return s.hashCode === hashCode; })[0]; - if (merged) { - merged.incrementCount(count); - merged.updateDate(context.event.date); - context.log.info('Ignoring duplicate event with hash: ' + hashCode); - context.cancelled = true; - } - if (!context.cancelled && this._processedHashcodes.some(function (h) { return h.hash === hashCode && h.timestamp >= (now_1 - _this._interval); })) { - context.log.trace('Adding event with hash: ' + hashCode); - this._mergedEvents.push(new MergedEvent(hashCode, context, count)); - context.cancelled = true; - } - if (!context.cancelled) { - context.log.trace('Enqueueing event with hash: ' + hashCode + 'to cache.'); - this._processedHashcodes.push({ hash: hashCode, timestamp: now_1 }); - while (this._processedHashcodes.length > 50) { - this._processedHashcodes.shift(); - } - } - } - next && next(); - }; - return DuplicateCheckerPlugin; -}()); -exports.DuplicateCheckerPlugin = DuplicateCheckerPlugin; -var MergedEvent = (function () { - function MergedEvent(hashCode, context, count) { - this.hashCode = hashCode; - this._context = context; - this._count = count; - } - MergedEvent.prototype.incrementCount = function (count) { - this._count += count; - }; - MergedEvent.prototype.resubmit = function () { - this._context.event.count = this._count; - this._context.client.config.queue.enqueue(this._context.event); - }; - MergedEvent.prototype.updateDate = function (date) { - if (date > this._context.event.date) { - this._context.event.date = date; - } - }; - return MergedEvent; -}()); -var EnvironmentInfoPlugin = (function () { - function EnvironmentInfoPlugin() { - this.priority = 80; - this.name = 'EnvironmentInfoPlugin'; - } - EnvironmentInfoPlugin.prototype.run = function (context, next) { - var ENVIRONMENT_KEY = '@environment'; - var collector = context.client.config.environmentInfoCollector; - if (!context.event.data[ENVIRONMENT_KEY] && collector) { - var environmentInfo = collector.getEnvironmentInfo(context); - if (!!environmentInfo) { - context.event.data[ENVIRONMENT_KEY] = environmentInfo; - } - } - next && next(); - }; - return EnvironmentInfoPlugin; -}()); -exports.EnvironmentInfoPlugin = EnvironmentInfoPlugin; -var ErrorPlugin = (function () { - function ErrorPlugin() { - this.priority = 30; - this.name = 'ErrorPlugin'; - } - ErrorPlugin.prototype.run = function (context, next) { - var ERROR_KEY = '@error'; - var ignoredProperties = [ - 'arguments', - 'column', - 'columnNumber', - 'description', - 'fileName', - 'message', - 'name', - 'number', - 'line', - 'lineNumber', - 'opera#sourceloc', - 'sourceId', - 'sourceURL', - 'stack', - 'stackArray', - 'stacktrace' - ]; - var exception = context.contextData.getException(); - if (!!exception) { - context.event.type = 'error'; - if (!context.event.data[ERROR_KEY]) { - var config = context.client.config; - var parser = config.errorParser; - if (!parser) { - throw new Error('No error parser was defined.'); - } - var result = parser.parse(context, exception); - if (!!result) { - var additionalData = JSON.parse(Utils.stringify(exception, config.dataExclusions.concat(ignoredProperties))); - if (!Utils.isEmpty(additionalData)) { - if (!result.data) { - result.data = {}; - } - result.data['@ext'] = additionalData; - } - context.event.data[ERROR_KEY] = result; - } - } - } - next && next(); - }; - return ErrorPlugin; -}()); -exports.ErrorPlugin = ErrorPlugin; -var EventExclusionPlugin = (function () { - function EventExclusionPlugin() { - this.priority = 45; - this.name = 'EventExclusionPlugin'; - } - EventExclusionPlugin.prototype.run = function (context, next) { - function getLogLevel(level) { - switch ((level || '').toLowerCase().trim()) { - case 'trace': - case 'true': - case '1': - case 'yes': - return 0; - case 'debug': - return 1; - case 'info': - return 2; - case 'warn': - return 3; - case 'error': - return 4; - case 'fatal': - return 5; - case 'off': - case 'false': - case '0': - case 'no': - return 6; - default: - return -1; - } - } - function getMinLogLevel(settings, loggerName) { - if (loggerName === void 0) { loggerName = '*'; } - return getLogLevel(getTypeAndSourceSetting(settings, 'log', loggerName, 'Trace') + ''); - } - function getTypeAndSourceSetting(settings, type, source, defaultValue) { - if (settings === void 0) { settings = {}; } - if (!type) { - return defaultValue; - } - var isLog = type === 'log'; - var sourcePrefix = "@@" + type + ":"; - var value = settings[sourcePrefix + source]; - if (value) { - return !isLog ? Utils.toBoolean(value) : value; - } - for (var key in settings) { - if (Utils.startsWith(key.toLowerCase(), sourcePrefix.toLowerCase()) && Utils.isMatch(source, [key.substring(sourcePrefix.length)])) { - return !isLog ? Utils.toBoolean(settings[key]) : settings[key]; - } - } - return defaultValue; - } - var ev = context.event; - var log = context.log; - var settings = context.client.config.settings; - if (ev.type === 'log') { - var minLogLevel = getMinLogLevel(settings, ev.source); - var logLevel = getLogLevel(ev.data['@level']); - if (logLevel >= 0 && (logLevel > 5 || logLevel < minLogLevel)) { - log.info('Cancelling log event due to minimum log level.'); - context.cancelled = true; - } - } - else if (ev.type === 'error') { - var error = ev.data['@error']; - while (!context.cancelled && error) { - if (getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) { - log.info("Cancelling error from excluded exception type: " + error.type); - context.cancelled = true; - } - error = error.inner; - } - } - else if (getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) { - log.info("Cancelling event from excluded type: " + ev.type + " and source: " + ev.source); - context.cancelled = true; - } - next && next(); - }; - return EventExclusionPlugin; -}()); -exports.EventExclusionPlugin = EventExclusionPlugin; -var ModuleInfoPlugin = (function () { - function ModuleInfoPlugin() { - this.priority = 50; - this.name = 'ModuleInfoPlugin'; - } - ModuleInfoPlugin.prototype.run = function (context, next) { - var ERROR_KEY = '@error'; - var collector = context.client.config.moduleCollector; - if (context.event.data[ERROR_KEY] && !context.event.data['@error'].modules && !!collector) { - var modules = collector.getModules(context); - if (modules && modules.length > 0) { - context.event.data[ERROR_KEY].modules = modules; - } - } - next && next(); - }; - return ModuleInfoPlugin; -}()); -exports.ModuleInfoPlugin = ModuleInfoPlugin; -var RequestInfoPlugin = (function () { - function RequestInfoPlugin() { - this.priority = 70; - this.name = 'RequestInfoPlugin'; - } - RequestInfoPlugin.prototype.run = function (context, next) { - var REQUEST_KEY = '@request'; - var config = context.client.config; - var collector = config.requestInfoCollector; - if (!context.event.data[REQUEST_KEY] && !!collector) { - var requestInfo = collector.getRequestInfo(context); - if (!!requestInfo) { - if (Utils.isMatch(requestInfo.user_agent, config.userAgentBotPatterns)) { - context.log.info('Cancelling event as the request user agent matches a known bot pattern'); - context.cancelled = true; - } - else { - context.event.data[REQUEST_KEY] = requestInfo; - } - } - } - next && next(); - }; - return RequestInfoPlugin; -}()); -exports.RequestInfoPlugin = RequestInfoPlugin; -var SubmissionMethodPlugin = (function () { - function SubmissionMethodPlugin() { - this.priority = 100; - this.name = 'SubmissionMethodPlugin'; - } - SubmissionMethodPlugin.prototype.run = function (context, next) { - var submissionMethod = context.contextData.getSubmissionMethod(); - if (!!submissionMethod) { - context.event.data['@submission_method'] = submissionMethod; - } - next && next(); - }; - return SubmissionMethodPlugin; -}()); -exports.SubmissionMethodPlugin = SubmissionMethodPlugin; -var InMemoryStorage = (function () { - function InMemoryStorage(maxItems) { - this.items = []; - this.lastTimestamp = 0; - this.maxItems = maxItems; - } - InMemoryStorage.prototype.save = function (value) { - if (!value) { - return null; - } - var items = this.items; - var timestamp = Math.max(Date.now(), this.lastTimestamp + 1); - var item = { timestamp: timestamp, value: value }; - if (items.push(item) > this.maxItems) { - items.shift(); - } - this.lastTimestamp = timestamp; - return item.timestamp; - }; - InMemoryStorage.prototype.get = function (limit) { - return this.items.slice(0, limit); - }; - InMemoryStorage.prototype.remove = function (timestamp) { - var items = this.items; - for (var i = 0; i < items.length; i++) { - if (items[i].timestamp === timestamp) { - items.splice(i, 1); - return; - } - } - }; - InMemoryStorage.prototype.clear = function () { - this.items = []; - }; - return InMemoryStorage; -}()); -exports.InMemoryStorage = InMemoryStorage; -var KeyValueStorageBase = (function () { - function KeyValueStorageBase(maxItems) { - this.lastTimestamp = 0; - this.maxItems = maxItems; - } - KeyValueStorageBase.prototype.save = function (value, single) { - if (!value) { - return null; - } - this.ensureIndex(); - var items = this.items; - var timestamp = Math.max(Date.now(), this.lastTimestamp + 1); - var key = this.getKey(timestamp); - var json = JSON.stringify(value); - try { - this.write(key, json); - this.lastTimestamp = timestamp; - if (items.push(timestamp) > this.maxItems) { - this.delete(this.getKey(items.shift())); - } - } - catch (e) { - return null; - } - return timestamp; - }; - KeyValueStorageBase.prototype.get = function (limit) { - var _this = this; - this.ensureIndex(); - return this.items.slice(0, limit) - .map(function (timestamp) { - var key = _this.getKey(timestamp); - try { - var json = _this.read(key); - var value = JSON.parse(json, parseDate); - return { timestamp: timestamp, value: value }; - } - catch (error) { - _this.safeDelete(key); - return null; - } - }) - .filter(function (item) { return item != null; }); - }; - KeyValueStorageBase.prototype.remove = function (timestamp) { - this.ensureIndex(); - var items = this.items; - var index = items.indexOf(timestamp); - if (index >= 0) { - var key = this.getKey(timestamp); - this.safeDelete(key); - items.splice(index, 1); - } - }; - KeyValueStorageBase.prototype.clear = function () { - var _this = this; - this.items.forEach(function (item) { return _this.safeDelete(_this.getKey(item)); }); - this.items = []; - }; - KeyValueStorageBase.prototype.ensureIndex = function () { - if (!this.items) { - this.items = this.createIndex(); - this.lastTimestamp = Math.max.apply(Math, [0].concat(this.items)) + 1; - } - }; - KeyValueStorageBase.prototype.safeDelete = function (key) { - try { - this.delete(key); - } - catch (error) { - } - }; - KeyValueStorageBase.prototype.createIndex = function () { - var _this = this; - try { - var keys = this.readAllKeys(); - return keys.map(function (key) { - try { - var timestamp = _this.getTimestamp(key); - if (!timestamp) { - _this.safeDelete(key); - return null; - } - return timestamp; - } - catch (error) { - _this.safeDelete(key); - return null; - } - }).filter(function (timestamp) { return timestamp != null; }) - .sort(function (a, b) { return a - b; }); - } - catch (error) { - return []; - } - }; - return KeyValueStorageBase; -}()); -exports.KeyValueStorageBase = KeyValueStorageBase; -function parseDate(key, value) { - var dateRegx = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/g; - if (typeof value === 'string') { - var a = dateRegx.exec(value); - if (a) { - return new Date(value); - } - } - return value; -} -var BrowserStorage = (function (_super) { - __extends(BrowserStorage, _super); - function BrowserStorage(namespace, prefix, maxItems) { - if (prefix === void 0) { prefix = 'com.exceptionless.'; } - if (maxItems === void 0) { maxItems = 20; } - var _this = _super.call(this, maxItems) || this; - _this.prefix = prefix + namespace + '-'; - return _this; - } - BrowserStorage.isAvailable = function () { - try { - var storage = window.localStorage; - var x = '__storage_test__'; - storage.setItem(x, x); - storage.removeItem(x); - return true; - } - catch (e) { - return false; - } - }; - BrowserStorage.prototype.write = function (key, value) { - window.localStorage.setItem(key, value); - }; - BrowserStorage.prototype.read = function (key) { - return window.localStorage.getItem(key); - }; - BrowserStorage.prototype.readAllKeys = function () { - var _this = this; - return Object.keys(window.localStorage) - .filter(function (key) { return key.indexOf(_this.prefix) === 0; }); - }; - BrowserStorage.prototype.delete = function (key) { - window.localStorage.removeItem(key); - }; - BrowserStorage.prototype.getKey = function (timestamp) { - return this.prefix + timestamp; - }; - BrowserStorage.prototype.getTimestamp = function (key) { - return parseInt(key.substr(this.prefix.length), 10); - }; - return BrowserStorage; -}(KeyValueStorageBase)); -exports.BrowserStorage = BrowserStorage; -var DefaultErrorParser = (function () { - function DefaultErrorParser() { - } - DefaultErrorParser.prototype.parse = function (context, exception) { - function getParameters(parameters) { - var params = (typeof parameters === 'string' ? [parameters] : parameters) || []; - var result = []; - for (var _i = 0, params_1 = params; _i < params_1.length; _i++) { - var param = params_1[_i]; - result.push({ name: param }); - } - return result; - } - function getStackFrames(stackFrames) { - var ANONYMOUS = '<anonymous>'; - var frames = []; - for (var _i = 0, stackFrames_1 = stackFrames; _i < stackFrames_1.length; _i++) { - var frame = stackFrames_1[_i]; - frames.push({ - name: (frame.func || ANONYMOUS).replace('?', ANONYMOUS), - parameters: getParameters(frame.args), - file_name: frame.url, - line_number: frame.line || 0, - column: frame.column || 0 - }); - } - return frames; - } - var TRACEKIT_STACK_TRACE_KEY = '@@_TraceKit.StackTrace'; - var stackTrace = !!context.contextData[TRACEKIT_STACK_TRACE_KEY] - ? context.contextData[TRACEKIT_STACK_TRACE_KEY] - : TraceKit.computeStackTrace(exception, 25); - if (!stackTrace) { - throw new Error('Unable to parse the exceptions stack trace.'); - } - var message = typeof (exception) === 'string' ? exception : undefined; - return { - type: stackTrace.name || 'Error', - message: stackTrace.message || exception.message || message, - stack_trace: getStackFrames(stackTrace.stack || []) - }; - }; - return DefaultErrorParser; -}()); -exports.DefaultErrorParser = DefaultErrorParser; -var DefaultModuleCollector = (function () { - function DefaultModuleCollector() { - } - DefaultModuleCollector.prototype.getModules = function (context) { - if (!document || !document.getElementsByTagName) { - return null; - } - var modules = []; - var scripts = document.getElementsByTagName('script'); - if (scripts && scripts.length > 0) { - for (var index = 0; index < scripts.length; index++) { - if (scripts[index].src) { - modules.push({ - module_id: index, - name: scripts[index].src.split('?')[0], - version: Utils.parseVersion(scripts[index].src) - }); - } - else if (!!scripts[index].innerHTML) { - modules.push({ - module_id: index, - name: 'Script Tag', - version: Utils.getHashCode(scripts[index].innerHTML).toString() - }); - } - } - } - return modules; - }; - return DefaultModuleCollector; -}()); -exports.DefaultModuleCollector = DefaultModuleCollector; -var DefaultRequestInfoCollector = (function () { - function DefaultRequestInfoCollector() { - } - DefaultRequestInfoCollector.prototype.getRequestInfo = function (context) { - if (!document || !navigator || !location) { - return null; - } - var exclusions = context.client.config.dataExclusions; - var requestInfo = { - user_agent: navigator.userAgent, - is_secure: location.protocol === 'https:', - host: location.hostname, - port: location.port && location.port !== '' ? parseInt(location.port, 10) : 80, - path: location.pathname, - cookies: Utils.getCookies(document.cookie, exclusions), - query_string: Utils.parseQueryString(location.search.substring(1), exclusions) - }; - if (document.referrer && document.referrer !== '') { - requestInfo.referrer = document.referrer; - } - return requestInfo; - }; - return DefaultRequestInfoCollector; -}()); -exports.DefaultRequestInfoCollector = DefaultRequestInfoCollector; -var BrowserStorageProvider = (function () { - function BrowserStorageProvider(prefix, maxQueueItems) { - if (maxQueueItems === void 0) { maxQueueItems = 250; } - this.queue = new BrowserStorage('q', prefix, maxQueueItems); - this.settings = new BrowserStorage('settings', prefix, 1); - } - return BrowserStorageProvider; -}()); -exports.BrowserStorageProvider = BrowserStorageProvider; -var DefaultSubmissionAdapter = (function () { - function DefaultSubmissionAdapter() { - } - DefaultSubmissionAdapter.prototype.sendRequest = function (request, callback, isAppExiting) { - var TIMEOUT = 'timeout'; - var LOADED = 'loaded'; - var WITH_CREDENTIALS = 'withCredentials'; - var isCompleted = false; - var useSetTimeout = false; - function complete(mode, xhr) { - function parseResponseHeaders(headerStr) { - function trim(value) { - return value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); - } - var headers = {}; - var headerPairs = (headerStr || '').split('\u000d\u000a'); - for (var _i = 0, headerPairs_1 = headerPairs; _i < headerPairs_1.length; _i++) { - var headerPair = headerPairs_1[_i]; - var separator = headerPair.indexOf('\u003a\u0020'); - if (separator > 0) { - headers[trim(headerPair.substring(0, separator).toLowerCase())] = headerPair.substring(separator + 2); - } - } - return headers; - } - if (isCompleted) { - return; - } - isCompleted = true; - var message = xhr.statusText; - var responseText = xhr.responseText; - var status = xhr.status; - if (mode === TIMEOUT || status === 0) { - message = 'Unable to connect to server.'; - status = 0; - } - else if (mode === LOADED && !status) { - status = request.method === 'POST' ? 202 : 200; - } - else if (status < 200 || status > 299) { - var responseBody = xhr.responseBody; - if (!!responseBody && !!responseBody.message) { - message = responseBody.message; - } - else if (!!responseText && responseText.indexOf('message') !== -1) { - try { - message = JSON.parse(responseText).message; - } - catch (e) { - message = responseText; - } - } - } - callback && callback(status || 500, message || '', responseText, parseResponseHeaders(xhr.getAllResponseHeaders && xhr.getAllResponseHeaders())); - } - function createRequest(userAgent, method, url) { - var xhr = new XMLHttpRequest(); - if (WITH_CREDENTIALS in xhr) { - xhr.open(method, url, true); - xhr.setRequestHeader('X-Exceptionless-Client', userAgent); - if (method === 'POST') { - xhr.setRequestHeader('Content-Type', 'application/json'); - } - } - else if (typeof XDomainRequest !== 'undefined') { - useSetTimeout = true; - xhr = new XDomainRequest(); - xhr.open(method, location.protocol === 'http:' ? url.replace('https:', 'http:') : url); - } - else { - xhr = null; - } - if (xhr) { - xhr.timeout = 10000; - } - return xhr; - } - var url = "" + request.url + (request.url.indexOf('?') === -1 ? '?' : '&') + "access_token=" + encodeURIComponent(request.apiKey); - var xhr = createRequest(request.userAgent, request.method || 'POST', url); - if (!xhr) { - return (callback && callback(503, 'CORS not supported.')); - } - if (WITH_CREDENTIALS in xhr) { - xhr.onreadystatechange = function () { - if (xhr.readyState !== 4) { - return; - } - complete(LOADED, xhr); - }; - } - xhr.onprogress = function () { }; - xhr.ontimeout = function () { return complete(TIMEOUT, xhr); }; - xhr.onerror = function () { return complete('error', xhr); }; - xhr.onload = function () { return complete(LOADED, xhr); }; - if (useSetTimeout) { - setTimeout(function () { return xhr.send(request.data); }, 500); - } - else { - xhr.send(request.data); - } - }; - return DefaultSubmissionAdapter; -}()); -exports.DefaultSubmissionAdapter = DefaultSubmissionAdapter; -var NodeFileStorage = (function (_super) { - __extends(NodeFileStorage, _super); - function NodeFileStorage(namespace, folder, prefix, maxItems, fs) { - if (prefix === void 0) { prefix = 'ex-'; } - if (maxItems === void 0) { maxItems = 20; } - var _this = _super.call(this, maxItems) || this; - if (!folder) { - folder = Path.join(Path.dirname(require.main.filename), '.exceptionless'); - } - var subfolder = Path.join(folder, namespace); - _this.directory = Path.resolve(subfolder); - _this.prefix = prefix; - _this.fs = fs ? fs : Fs; - _this.mkdir(_this.directory); - return _this; - } - NodeFileStorage.prototype.write = function (key, value) { - this.fs.writeFileSync(key, value); - }; - NodeFileStorage.prototype.read = function (key) { - return this.fs.readFileSync(key, 'utf8'); - }; - NodeFileStorage.prototype.readAllKeys = function () { - var _this = this; - return this.fs.readdirSync(this.directory) - .filter(function (file) { return file.indexOf(_this.prefix) === 0; }) - .map(function (file) { return Path.join(_this.directory, file); }); - }; - NodeFileStorage.prototype.delete = function (key) { - this.fs.unlinkSync(key); - }; - NodeFileStorage.prototype.getKey = function (timestamp) { - return Path.join(this.directory, "" + this.prefix + timestamp + ".json"); - }; - NodeFileStorage.prototype.getTimestamp = function (key) { - return parseInt(Path.basename(key, '.json') - .substr(this.prefix.length), 10); - }; - NodeFileStorage.prototype.mkdir = function (path) { - var dirs = path.split(Path.sep); - var root = ''; - while (dirs.length > 0) { - var dir = dirs.shift(); - if (dir === '') { - root = Path.sep; - } - if (!this.fs.existsSync(root + dir)) { - this.fs.mkdirSync(root + dir); - } - root += dir + Path.sep; - } - }; - return NodeFileStorage; -}(KeyValueStorageBase)); -exports.NodeFileStorage = NodeFileStorage; -var NodeEnvironmentInfoCollector = (function () { - function NodeEnvironmentInfoCollector() { - } - NodeEnvironmentInfoCollector.prototype.getEnvironmentInfo = function (context) { - function getIpAddresses() { - var ips = []; - var interfaces = os.networkInterfaces(); - Object.keys(interfaces).forEach(function (name) { - interfaces[name].forEach(function (iface) { - if ('IPv4' === iface.family && !iface.internal) { - ips.push(iface.address); - } - }); - }); - return ips.join(', '); - } - if (!os) { - return null; - } - var environmentInfo = { - processor_count: os.cpus().length, - total_physical_memory: os.totalmem(), - available_physical_memory: os.freemem(), - command_line: process.argv.join(' '), - process_name: (process.title || '').replace(/[\uE000-\uF8FF]/g, ''), - process_id: process.pid + '', - process_memory_size: process.memoryUsage().heapTotal, - architecture: os.arch(), - o_s_name: os.type(), - o_s_version: os.release(), - ip_address: getIpAddresses(), - machine_name: os.hostname(), - runtime_version: process.version, - data: { - loadavg: os.loadavg(), - platform: os.platform(), - tmpdir: os.tmpdir(), - uptime: os.uptime() - } - }; - if (os.endianness) { - environmentInfo.data.endianness = os.endianness(); - } - return environmentInfo; - }; - return NodeEnvironmentInfoCollector; -}()); -exports.NodeEnvironmentInfoCollector = NodeEnvironmentInfoCollector; -var NodeErrorParser = (function () { - function NodeErrorParser() { - } - NodeErrorParser.prototype.parse = function (context, exception) { - function getStackFrames(stackFrames) { - var frames = []; - for (var _i = 0, stackFrames_2 = stackFrames; _i < stackFrames_2.length; _i++) { - var frame = stackFrames_2[_i]; - frames.push({ - name: frame.getMethodName() || frame.getFunctionName(), - file_name: frame.getFileName(), - line_number: frame.getLineNumber() || 0, - column: frame.getColumnNumber() || 0, - declaring_type: frame.getTypeName(), - data: { - is_native: frame.isNative() || (!!frame.filename && frame.filename[0] !== '/' && frame.filename[0] !== '.') - } - }); - } - return frames; - } - if (!nodestacktrace) { - throw new Error('Unable to load the stack trace library.'); - } - var stackFrames = nodestacktrace.parse(exception) || []; - return { - type: exception.name || 'Error', - message: exception.message, - stack_trace: getStackFrames(stackFrames) - }; - }; - return NodeErrorParser; -}()); -exports.NodeErrorParser = NodeErrorParser; -var NodeModuleCollector = (function () { - function NodeModuleCollector() { - this.initialized = false; - this.installedModules = {}; - } - NodeModuleCollector.prototype.getModules = function (context) { - var _this = this; - this.initialize(); - if (!require.main) { - return []; - } - var modulePath = path.dirname(require.main.filename) + '/node_modules/'; - var pathLength = modulePath.length; - var loadedKeys = Object.keys(require.cache); - var loadedModules = {}; - loadedKeys.forEach(function (key) { - var id = key.substr(pathLength); - id = id.substr(0, id.indexOf('/')); - loadedModules[id] = true; - }); - return Object.keys(loadedModules) - .map(function (key) { return _this.installedModules[key]; }) - .filter(function (m) { return m !== undefined; }); - }; - NodeModuleCollector.prototype.initialize = function () { - var _this = this; - if (this.initialized) { - return; - } - this.initialized = true; - var output = child.spawnSync('npm', ['ls', '--depth=0', '--json']).stdout; - if (!output) { - return; - } - var json; - try { - json = JSON.parse(output.toString()); - } - catch (e) { - return; - } - var items = json.dependencies; - if (!items) { - return; - } - var id = 0; - this.installedModules = {}; - Object.keys(items).forEach(function (key) { - var item = items[key]; - var theModule = { - module_id: id++, - name: key, - version: item.version - }; - _this.installedModules[key] = theModule; - }); - }; - return NodeModuleCollector; -}()); -exports.NodeModuleCollector = NodeModuleCollector; -var NodeRequestInfoCollector = (function () { - function NodeRequestInfoCollector() { - } - NodeRequestInfoCollector.prototype.getRequestInfo = function (context) { - var REQUEST_KEY = '@request'; - if (!context.contextData[REQUEST_KEY]) { - return null; - } - var exclusions = context.client.config.dataExclusions; - var request = context.contextData[REQUEST_KEY]; - var requestInfo = { - client_ip_address: request.ip, - user_agent: request.headers['user-agent'], - is_secure: request.secure, - http_method: request.method, - host: request.hostname || request.host, - path: request.path, - post_data: JSON.parse(Utils.stringify(request.body || {}, exclusions)), - cookies: Utils.getCookies(request.headers.cookie, exclusions), - query_string: JSON.parse(Utils.stringify(request.params || {}, exclusions)) - }; - var host = request.headers.host; - var port = host && parseInt(host.slice(host.indexOf(':') + 1), 10); - if (port > 0) { - requestInfo.port = port; - } - return requestInfo; - }; - return NodeRequestInfoCollector; -}()); -exports.NodeRequestInfoCollector = NodeRequestInfoCollector; -var NodeFileStorageProvider = (function () { - function NodeFileStorageProvider(folder, prefix, maxQueueItems) { - if (maxQueueItems === void 0) { maxQueueItems = 250; } - this.queue = new NodeFileStorage('q', folder, prefix, maxQueueItems); - this.settings = new NodeFileStorage('settings', folder, prefix, 1); - } - return NodeFileStorageProvider; -}()); -exports.NodeFileStorageProvider = NodeFileStorageProvider; -var NodeSubmissionAdapter = (function () { - function NodeSubmissionAdapter() { - } - NodeSubmissionAdapter.prototype.sendRequest = function (request, callback, isAppExiting) { - var _this = this; - if (isAppExiting) { - this.sendRequestSync(request, callback); - return; - } - var parsedHost = url.parse(request.url); - var options = { - auth: "client:" + request.apiKey, - headers: {}, - hostname: parsedHost.hostname, - method: request.method, - port: parsedHost.port && parseInt(parsedHost.port, 10), - path: request.url - }; - options.headers['User-Agent'] = request.userAgent; - if (request.method === 'POST') { - options.headers = { - 'Content-Type': 'application/json', - 'Content-Length': Buffer.byteLength(request.data) - }; - } - var protocol = (parsedHost.protocol === 'https' ? https : http); - var clientRequest = protocol.request(options, function (response) { - var body = ''; - response.setEncoding('utf8'); - response.on('data', function (chunk) { return body += chunk; }); - response.on('end', function () { return _this.complete(response, body, response.headers, callback); }); - }); - clientRequest.on('error', function (error) { return callback && callback(500, error.message); }); - clientRequest.end(request.data); - }; - NodeSubmissionAdapter.prototype.complete = function (response, responseBody, responseHeaders, callback) { - var message; - if (response.statusCode === 0) { - message = 'Unable to connect to server.'; - } - else if (response.statusCode < 200 || response.statusCode > 299) { - message = response.statusMessage || response.message; - } - callback && callback(response.statusCode || 500, message, responseBody, responseHeaders); - }; - NodeSubmissionAdapter.prototype.sendRequestSync = function (request, callback) { - var requestJson = JSON.stringify(request); - var res = child.spawnSync(process.execPath, [require.resolve('./submitSync.js')], { - input: requestJson, - stdio: ['pipe', 'pipe', process.stderr] - }); - var out = res.stdout.toString(); - var result = JSON.parse(out); - callback && callback(result.status, result.message, result.data, result.headers); - }; - return NodeSubmissionAdapter; -}()); -exports.NodeSubmissionAdapter = NodeSubmissionAdapter; -(function init() { - function getDefaultsSettingsFromScriptTag() { - if (!document || !document.getElementsByTagName) { - return null; - } - var scripts = document.getElementsByTagName('script'); - for (var index = 0; index < scripts.length; index++) { - if (scripts[index].src && scripts[index].src.indexOf('/exceptionless') > -1) { - return Utils.parseQueryString(scripts[index].src.split('?').pop()); - } - } - return null; - } - function processUnhandledException(stackTrace, options) { - var builder = ExceptionlessClient.default.createUnhandledException(new Error(stackTrace.message || (options || {}).status || 'Script error'), 'onerror'); - builder.pluginContextData['@@_TraceKit.StackTrace'] = stackTrace; - builder.submit(); - } - if (typeof document === 'undefined') { - return; - } - Configuration.prototype.useLocalStorage = function () { - if (BrowserStorage.isAvailable()) { - this.storage = new BrowserStorageProvider(); - SettingsManager.applySavedServerSettings(this); - this.changed(); - } - }; - var defaults = Configuration.defaults; - var settings = getDefaultsSettingsFromScriptTag(); - if (settings && (settings.apiKey || settings.serverUrl)) { - defaults.apiKey = settings.apiKey; - defaults.serverUrl = settings.serverUrl; - } - defaults.errorParser = new DefaultErrorParser(); - defaults.moduleCollector = new DefaultModuleCollector(); - defaults.requestInfoCollector = new DefaultRequestInfoCollector(); - defaults.submissionAdapter = new DefaultSubmissionAdapter(); - TraceKit.report.subscribe(processUnhandledException); - TraceKit.extendToAsynchronousCallbacks(); - Error.stackTraceLimit = Infinity; -})(); -(function init() { - if (typeof process === 'undefined') { - return; - } - var defaults = Configuration.defaults; - defaults.environmentInfoCollector = new NodeEnvironmentInfoCollector(); - defaults.errorParser = new NodeErrorParser(); - defaults.moduleCollector = new NodeModuleCollector(); - defaults.requestInfoCollector = new NodeRequestInfoCollector(); - defaults.submissionAdapter = new NodeSubmissionAdapter(); - Configuration.prototype.useLocalStorage = function () { - this.storage = new NodeFileStorageProvider(); - SettingsManager.applySavedServerSettings(this); - this.changed(); - }; - process.addListener('uncaughtException', function (error) { - ExceptionlessClient.default.submitUnhandledException(error, 'uncaughtException'); - }); - process.on('exit', function (code) { - function getExitCodeReason(exitCode) { - if (exitCode === 1) { - return 'Uncaught Fatal Exception'; - } - if (exitCode === 3) { - return 'Internal JavaScript Parse Error'; - } - if (exitCode === 4) { - return 'Internal JavaScript Evaluation Failure'; - } - if (exitCode === 5) { - return 'Fatal Exception'; - } - if (exitCode === 6) { - return 'Non-function Internal Exception Handler '; - } - if (exitCode === 7) { - return 'Internal Exception Handler Run-Time Failure'; - } - if (exitCode === 8) { - return 'Uncaught Exception'; - } - if (exitCode === 9) { - return 'Invalid Argument'; - } - if (exitCode === 10) { - return 'Internal JavaScript Run-Time Failure'; - } - if (exitCode === 12) { - return 'Invalid Debug Argument'; - } - return null; - } - var client = ExceptionlessClient.default; - var message = getExitCodeReason(code); - if (message !== null) { - client.submitLog('exit', message, 'Error'); - } - client.config.queue.process(true); - }); - Error.stackTraceLimit = Infinity; -})(); - -return exports; - -})); - - -//# sourceMappingURL=exceptionless.universal.js.map diff --git a/dist/exceptionless.universal.js.map b/dist/exceptionless.universal.js.map deleted file mode 100644 index f53b6d19..00000000 --- a/dist/exceptionless.universal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["tracekit.js","exceptionless.universal.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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CAA6C,CAAC;YACvD,CAAC;YAED,EAAE,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC;gBACnB,MAAM,CAAC,oBAAoB,CAAC;YAC9B,CAAC;YAED,EAAE,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC;gBACnB,MAAM,CAAC,kBAAkB,CAAC;YAC5B,CAAC;YAED,EAAE,CAAC,CAAC,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC;gBACpB,MAAM,CAAC,sCAAsC,CAAC;YAChD,CAAC;YAED,EAAE,CAAC,CAAC,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC;gBACpB,MAAM,CAAC,wBAAwB,CAAC;YAClC,CAAC;YAED,MAAM,CAAC,IAAI,CAAC;QACd,CAAC;QAED,IAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC3C,IAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAExC,EAAE,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC;YACrB,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7C,CAAC;QAED,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC,CAAC,CAAC,CAAC;IAEF,KAAa,CAAC,eAAe,GAAG,QAAQ,CAAC;AAC5C,CAAC,CAAC,EAAE,CAAC","file":"exceptionless.universal.js","sourcesContent":["/**\n * https://github.com/csnover/TraceKit\n * @license MIT\n * @namespace TraceKit\n */\n(function(window, undefined) {\nif (!window) {\n return;\n}\n\nvar TraceKit = {};\nvar _oldTraceKit = window.TraceKit;\n\n// global reference to slice\nvar _slice = [].slice;\nvar UNKNOWN_FUNCTION = '?';\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types\nvar ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;\n\n/**\n * A better form of hasOwnProperty<br/>\n * Example: `_has(MainHostObject, property) === true/false`\n *\n * @param {Object} object to check property\n * @param {string} key to check\n * @return {Boolean} true if the object has the key and it is not inherited\n */\nfunction _has(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\n/**\n * Returns true if the parameter is undefined<br/>\n * Example: `_isUndefined(val) === true/false`\n *\n * @param {*} what Value to check\n * @return {Boolean} true if undefined and false otherwise\n */\nfunction _isUndefined(what) {\n return typeof what === 'undefined';\n}\n\n/**\n * Export TraceKit out to another variable<br/>\n * Example: `var TK = TraceKit.noConflict()`\n * @return {Object} The TraceKit object\n * @memberof TraceKit\n */\nTraceKit.noConflict = function noConflict() {\n window.TraceKit = _oldTraceKit;\n return TraceKit;\n};\n\n/**\n * Wrap any function in a TraceKit reporter<br/>\n * Example: `func = TraceKit.wrap(func);`\n *\n * @param {Function} func Function to be wrapped\n * @return {Function} The wrapped func\n * @memberof TraceKit\n */\nTraceKit.wrap = function traceKitWrapper(func) {\n function wrapped() {\n try {\n return func.apply(this, arguments);\n } catch (e) {\n TraceKit.report(e);\n throw e;\n }\n }\n return wrapped;\n};\n\n/**\n * Cross-browser processing of unhandled exceptions\n *\n * Syntax:\n * ```js\n * TraceKit.report.subscribe(function(stackInfo) { ... })\n * TraceKit.report.unsubscribe(function(stackInfo) { ... })\n * TraceKit.report(exception)\n * try { ...code... } catch(ex) { TraceKit.report(ex); }\n * ```\n *\n * Supports:\n * - Firefox: full stack trace with line numbers, plus column number\n * on top frame; column number is not guaranteed\n * - Opera: full stack trace with line and column numbers\n * - Chrome: full stack trace with line and column numbers\n * - Safari: line and column number for the top frame only; some frames\n * may be missing, and column number is not guaranteed\n * - IE: line and column number for the top frame only; some frames\n * may be missing, and column number is not guaranteed\n *\n * In theory, TraceKit should work on all of the following versions:\n * - IE5.5+ (only 8.0 tested)\n * - Firefox 0.9+ (only 3.5+ tested)\n * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require\n * Exceptions Have Stacktrace to be enabled in opera:config)\n * - Safari 3+ (only 4+ tested)\n * - Chrome 1+ (only 5+ tested)\n * - Konqueror 3.5+ (untested)\n *\n * Requires TraceKit.computeStackTrace.\n *\n * Tries to catch all unhandled exceptions and report them to the\n * subscribed handlers. Please note that TraceKit.report will rethrow the\n * exception. This is REQUIRED in order to get a useful stack trace in IE.\n * If the exception does not reach the top of the browser, you will only\n * get a stack trace from the point where TraceKit.report was called.\n *\n * Handlers receive a TraceKit.StackTrace object as described in the\n * TraceKit.computeStackTrace docs.\n *\n * @memberof TraceKit\n * @namespace\n */\nTraceKit.report = (function reportModuleWrapper() {\n var handlers = [],\n lastException = null,\n lastExceptionStack = null;\n\n /**\n * Add a crash handler.\n * @param {Function} handler\n * @memberof TraceKit.report\n */\n function subscribe(handler) {\n installGlobalHandler();\n handlers.push(handler);\n }\n\n /**\n * Remove a crash handler.\n * @param {Function} handler\n * @memberof TraceKit.report\n */\n function unsubscribe(handler) {\n for (var i = handlers.length - 1; i >= 0; --i) {\n if (handlers[i] === handler) {\n handlers.splice(i, 1);\n }\n }\n\n if (handlers.length === 0) {\n window.onerror = _oldOnerrorHandler;\n _onErrorHandlerInstalled = false;\n }\n }\n\n /**\n * Dispatch stack information to all handlers.\n * @param {TraceKit.StackTrace} stack\n * @param {boolean} isWindowError Is this a top-level window error?\n * @param {Error=} error The error that's being handled (if available, null otherwise)\n * @memberof TraceKit.report\n * @throws An exception if an error occurs while calling an handler.\n */\n function notifyHandlers(stack, isWindowError, error) {\n var exception = null;\n if (isWindowError && !TraceKit.collectWindowErrors) {\n return;\n }\n for (var i in handlers) {\n if (_has(handlers, i)) {\n try {\n handlers[i](stack, isWindowError, error);\n } catch (inner) {\n exception = inner;\n }\n }\n }\n\n if (exception) {\n throw exception;\n }\n }\n\n var _oldOnerrorHandler, _onErrorHandlerInstalled;\n\n /**\n * Ensures all global unhandled exceptions are recorded.\n * Supported by Gecko and IE.\n * @param {string} message Error message.\n * @param {string} url URL of script that generated the exception.\n * @param {(number|string)} lineNo The line number at which the error occurred.\n * @param {(number|string)=} columnNo The column number at which the error occurred.\n * @param {Error=} errorObj The actual Error object.\n * @memberof TraceKit.report\n */\n function traceKitWindowOnError(message, url, lineNo, columnNo, errorObj) {\n var stack = null;\n\n if (lastExceptionStack) {\n TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);\n \t processLastException();\n } else if (errorObj) {\n stack = TraceKit.computeStackTrace(errorObj);\n notifyHandlers(stack, true, errorObj);\n } else {\n var location = {\n 'url': url,\n 'line': lineNo,\n 'column': columnNo\n };\n\n var name;\n var msg = message; // must be new var or will modify original `arguments`\n if ({}.toString.call(message) === '[object String]') {\n var groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n msg = groups[2];\n }\n }\n\n location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line);\n location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line);\n stack = {\n 'name': name,\n 'message': msg,\n 'mode': 'onerror',\n 'stack': [location]\n };\n\n notifyHandlers(stack, true, null);\n }\n\n if (_oldOnerrorHandler) {\n return _oldOnerrorHandler.apply(this, arguments);\n }\n\n return false;\n }\n\n /**\n * Install a global onerror handler\n * @memberof TraceKit.report\n */\n function installGlobalHandler() {\n if (_onErrorHandlerInstalled === true) {\n return;\n }\n\n _oldOnerrorHandler = window.onerror;\n window.onerror = traceKitWindowOnError;\n _onErrorHandlerInstalled = true;\n }\n\n /**\n * Process the most recent exception\n * @memberof TraceKit.report\n */\n function processLastException() {\n var _lastExceptionStack = lastExceptionStack,\n _lastException = lastException;\n lastExceptionStack = null;\n lastException = null;\n notifyHandlers(_lastExceptionStack, false, _lastException);\n }\n\n /**\n * Reports an unhandled Error to TraceKit.\n * @param {Error} ex\n * @memberof TraceKit.report\n * @throws An exception if an incomplete stack trace is detected (old IE browsers).\n */\n function report(ex) {\n if (lastExceptionStack) {\n if (lastException === ex) {\n return; // already caught by an inner catch block, ignore\n } else {\n processLastException();\n }\n }\n\n var stack = TraceKit.computeStackTrace(ex);\n lastExceptionStack = stack;\n lastException = ex;\n\n // If the stack trace is incomplete, wait for 2 seconds for\n // slow slow IE to see if onerror occurs or not before reporting\n // this exception; otherwise, we will end up with an incomplete\n // stack trace\n setTimeout(function () {\n if (lastException === ex) {\n processLastException();\n }\n }, (stack.incomplete ? 2000 : 0));\n\n throw ex; // re-throw to propagate to the top level (and cause window.onerror)\n }\n\n report.subscribe = subscribe;\n report.unsubscribe = unsubscribe;\n return report;\n}());\n\n/**\n * An object representing a single stack frame.\n * @typedef {Object} StackFrame\n * @property {string} url The JavaScript or HTML file URL.\n * @property {string} func The function name, or empty for anonymous functions (if guessing did not work).\n * @property {string[]?} args The arguments passed to the function, if known.\n * @property {number=} line The line number, if known.\n * @property {number=} column The column number, if known.\n * @property {string[]} context An array of source code lines; the middle element corresponds to the correct line#.\n * @memberof TraceKit\n */\n\n/**\n * An object representing a JavaScript stack trace.\n * @typedef {Object} StackTrace\n * @property {string} name The name of the thrown exception.\n * @property {string} message The exception error message.\n * @property {TraceKit.StackFrame[]} stack An array of stack frames.\n * @property {string} mode 'stack', 'stacktrace', 'multiline', 'callers', 'onerror', or 'failed' -- method used to collect the stack trace.\n * @memberof TraceKit\n */\n\n/**\n * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript\n *\n * Syntax:\n * ```js\n * s = TraceKit.computeStackTrace.ofCaller([depth])\n * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)\n * ```\n *\n * Supports:\n * - Firefox: full stack trace with line numbers and unreliable column\n * number on top frame\n * - Opera 10: full stack trace with line and column numbers\n * - Opera 9-: full stack trace with line numbers\n * - Chrome: full stack trace with line and column numbers\n * - Safari: line and column number for the topmost stacktrace element\n * only\n * - IE: no line numbers whatsoever\n *\n * Tries to guess names of anonymous functions by looking for assignments\n * in the source code. In IE and Safari, we have to guess source file names\n * by searching for function bodies inside all page scripts. This will not\n * work for scripts that are loaded cross-domain.\n * Here be dragons: some function names may be guessed incorrectly, and\n * duplicate functions may be mismatched.\n *\n * TraceKit.computeStackTrace should only be used for tracing purposes.\n * Logging of unhandled exceptions should be done with TraceKit.report,\n * which builds on top of TraceKit.computeStackTrace and provides better\n * IE support by utilizing the window.onerror event to retrieve information\n * about the top of the stack.\n *\n * Note: In IE and Safari, no stack trace is recorded on the Error object,\n * so computeStackTrace instead walks its *own* chain of callers.\n * This means that:\n * * in Safari, some methods may be missing from the stack trace;\n * * in IE, the topmost function in the stack trace will always be the\n * caller of computeStackTrace.\n *\n * This is okay for tracing (because you are likely to be calling\n * computeStackTrace from the function you want to be the topmost element\n * of the stack trace anyway), but not okay for logging unhandled\n * exceptions (because your catch block will likely be far away from the\n * inner function that actually caused the exception).\n *\n * Tracing example:\n * ```js\n * function trace(message) {\n * var stackInfo = TraceKit.computeStackTrace.ofCaller();\n * var data = message + \"\\n\";\n * for(var i in stackInfo.stack) {\n * var item = stackInfo.stack[i];\n * data += (item.func || '[anonymous]') + \"() in \" + item.url + \":\" + (item.line || '0') + \"\\n\";\n * }\n * if (window.console)\n * console.info(data);\n * else\n * alert(data);\n * }\n * ```\n * @memberof TraceKit\n * @namespace\n */\nTraceKit.computeStackTrace = (function computeStackTraceWrapper() {\n var debug = false,\n sourceCache = {};\n\n /**\n * Attempts to retrieve source code via XMLHttpRequest, which is used\n * to look up anonymous function names.\n * @param {string} url URL of source code.\n * @return {string} Source contents.\n * @memberof TraceKit.computeStackTrace\n */\n function loadSource(url) {\n if (!TraceKit.remoteFetching) { //Only attempt request if remoteFetching is on.\n return '';\n }\n try {\n var getXHR = function() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {\n // explicitly bubble up the exception if not found\n return new window.ActiveXObject('Microsoft.XMLHTTP');\n }\n };\n\n var request = getXHR();\n request.open('GET', url, false);\n request.send('');\n return request.responseText;\n } catch (e) {\n return '';\n }\n }\n\n /**\n * Retrieves source code from the source code cache.\n * @param {string} url URL of source code.\n * @return {Array.<string>} Source contents.\n * @memberof TraceKit.computeStackTrace\n */\n function getSource(url) {\n if (typeof url !== 'string') {\n return [];\n }\n\n if (!_has(sourceCache, url)) {\n // URL needs to be able to fetched within the acceptable domain. Otherwise,\n // cross-domain errors will be triggered.\n /*\n Regex matches:\n 0 - Full Url\n 1 - Protocol\n 2 - Domain\n 3 - Port (Useful for internal applications)\n 4 - Path\n */\n var source = '';\n var domain = '';\n try { domain = window.document.domain; } catch (e) { }\n var match = /(.*)\\:\\/\\/([^:\\/]+)([:\\d]*)\\/{0,1}([\\s\\S]*)/.exec(url);\n if (match && match[2] === domain) {\n source = loadSource(url);\n }\n sourceCache[url] = source ? source.split('\\n') : [];\n }\n\n return sourceCache[url];\n }\n\n /**\n * Tries to use an externally loaded copy of source code to determine\n * the name of a function by looking at the name of the variable it was\n * assigned to, if any.\n * @param {string} url URL of source code.\n * @param {(string|number)} lineNo Line number in source code.\n * @return {string} The function name, if discoverable.\n * @memberof TraceKit.computeStackTrace\n */\n function guessFunctionName(url, lineNo) {\n var reFunctionArgNames = /function ([^(]*)\\(([^)]*)\\)/,\n reGuessFunction = /['\"]?([0-9A-Za-z$_]+)['\"]?\\s*[:=]\\s*(function|eval|new Function)/,\n line = '',\n maxLines = 10,\n source = getSource(url),\n m;\n\n if (!source.length) {\n return UNKNOWN_FUNCTION;\n }\n\n // Walk backwards from the first line in the function until we find the line which\n // matches the pattern above, which is the function definition\n for (var i = 0; i < maxLines; ++i) {\n line = source[lineNo - i] + line;\n\n if (!_isUndefined(line)) {\n if ((m = reGuessFunction.exec(line))) {\n return m[1];\n } else if ((m = reFunctionArgNames.exec(line))) {\n return m[1];\n }\n }\n }\n\n return UNKNOWN_FUNCTION;\n }\n\n /**\n * Retrieves the surrounding lines from where an exception occurred.\n * @param {string} url URL of source code.\n * @param {(string|number)} line Line number in source code to center around for context.\n * @return {?Array.<string>} Lines of source code.\n * @memberof TraceKit.computeStackTrace\n */\n function gatherContext(url, line) {\n var source = getSource(url);\n\n if (!source.length) {\n return null;\n }\n\n var context = [],\n // linesBefore & linesAfter are inclusive with the offending line.\n // if linesOfContext is even, there will be one extra line\n // *before* the offending line.\n linesBefore = Math.floor(TraceKit.linesOfContext / 2),\n // Add one extra line if linesOfContext is odd\n linesAfter = linesBefore + (TraceKit.linesOfContext % 2),\n start = Math.max(0, line - linesBefore - 1),\n end = Math.min(source.length, line + linesAfter - 1);\n\n line -= 1; // convert to 0-based index\n\n for (var i = start; i < end; ++i) {\n if (!_isUndefined(source[i])) {\n context.push(source[i]);\n }\n }\n\n return context.length > 0 ? context : null;\n }\n\n /**\n * Escapes special characters, except for whitespace, in a string to be\n * used inside a regular expression as a string literal.\n * @param {string} text The string.\n * @return {string} The escaped string literal.\n * @memberof TraceKit.computeStackTrace\n */\n function escapeRegExp(text) {\n return text.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#]/g, '\\\\$&');\n }\n\n /**\n * Escapes special characters in a string to be used inside a regular\n * expression as a string literal. Also ensures that HTML entities will\n * be matched the same as their literal friends.\n * @param {string} body The string.\n * @return {string} The escaped string.\n * @memberof TraceKit.computeStackTrace\n */\n function escapeCodeAsRegExpForMatchingInsideHTML(body) {\n return escapeRegExp(body).replace('<', '(?:<|<)').replace('>', '(?:>|>)').replace('&', '(?:&|&)').replace('\"', '(?:\"|")').replace(/\\s+/g, '\\\\s+');\n }\n\n /**\n * Determines where a code fragment occurs in the source code.\n * @param {RegExp} re The function definition.\n * @param {Array.<string>} urls A list of URLs to search.\n * @return {?Object.<string, (string|number)>} An object containing\n * the url, line, and column number of the defined function.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceInUrls(re, urls) {\n var source, m;\n for (var i = 0, j = urls.length; i < j; ++i) {\n if ((source = getSource(urls[i])).length) {\n source = source.join('\\n');\n if ((m = re.exec(source))) {\n\n return {\n 'url': urls[i],\n 'line': source.substring(0, m.index).split('\\n').length,\n 'column': m.index - source.lastIndexOf('\\n', m.index) - 1\n };\n }\n }\n }\n\n return null;\n }\n\n /**\n * Determines at which column a code fragment occurs on a line of the\n * source code.\n * @param {string} fragment The code fragment.\n * @param {string} url The URL to search.\n * @param {(string|number)} line The line number to examine.\n * @return {?number} The column number.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceInLine(fragment, url, line) {\n var source = getSource(url),\n re = new RegExp('\\\\b' + escapeRegExp(fragment) + '\\\\b'),\n m;\n\n line -= 1;\n\n if (source && source.length > line && (m = re.exec(source[line]))) {\n return m.index;\n }\n\n return null;\n }\n\n /**\n * Determines where a function was defined within the source code.\n * @param {(Function|string)} func A function reference or serialized\n * function definition.\n * @return {?Object.<string, (string|number)>} An object containing\n * the url, line, and column number of the defined function.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceByFunctionBody(func) {\n if (_isUndefined(window && window.document)) {\n return;\n }\n\n var urls = [window.location.href],\n scripts = window.document.getElementsByTagName('script'),\n body,\n code = '' + func,\n codeRE = /^function(?:\\s+([\\w$]+))?\\s*\\(([\\w\\s,]*)\\)\\s*\\{\\s*(\\S[\\s\\S]*\\S)\\s*\\}\\s*$/,\n eventRE = /^function on([\\w$]+)\\s*\\(event\\)\\s*\\{\\s*(\\S[\\s\\S]*\\S)\\s*\\}\\s*$/,\n re,\n parts,\n result;\n\n for (var i = 0; i < scripts.length; ++i) {\n var script = scripts[i];\n if (script.src) {\n urls.push(script.src);\n }\n }\n\n if (!(parts = codeRE.exec(code))) {\n re = new RegExp(escapeRegExp(code).replace(/\\s+/g, '\\\\s+'));\n }\n\n // not sure if this is really necessary, but I don’t have a test\n // corpus large enough to confirm that and it was in the original.\n else {\n var name = parts[1] ? '\\\\s+' + parts[1] : '',\n args = parts[2].split(',').join('\\\\s*,\\\\s*');\n\n body = escapeRegExp(parts[3]).replace(/;$/, ';?'); // semicolon is inserted if the function ends with a comment.replace(/\\s+/g, '\\\\s+');\n re = new RegExp('function' + name + '\\\\s*\\\\(\\\\s*' + args + '\\\\s*\\\\)\\\\s*{\\\\s*' + body + '\\\\s*}');\n }\n\n // look for a normal function definition\n if ((result = findSourceInUrls(re, urls))) {\n return result;\n }\n\n // look for an old-school event handler function\n if ((parts = eventRE.exec(code))) {\n var event = parts[1];\n body = escapeCodeAsRegExpForMatchingInsideHTML(parts[2]);\n\n // look for a function defined in HTML as an onXXX handler\n re = new RegExp('on' + event + '=[\\\\\\'\"]\\\\s*' + body + '\\\\s*[\\\\\\'\"]', 'i');\n\n if ((result = findSourceInUrls(re, urls[0]))) {\n return result;\n }\n\n // look for ???\n re = new RegExp(body);\n\n if ((result = findSourceInUrls(re, urls))) {\n return result;\n }\n }\n\n return null;\n }\n\n // Contents of Exception in various browsers.\n //\n // SAFARI:\n // ex.message = Can't find variable: qq\n // ex.line = 59\n // ex.sourceId = 580238192\n // ex.sourceURL = http://...\n // ex.expressionBeginOffset = 96\n // ex.expressionCaretOffset = 98\n // ex.expressionEndOffset = 98\n // ex.name = ReferenceError\n //\n // FIREFOX:\n // ex.message = qq is not defined\n // ex.fileName = http://...\n // ex.lineNumber = 59\n // ex.columnNumber = 69\n // ex.stack = ...stack trace... (see the example below)\n // ex.name = ReferenceError\n //\n // CHROME:\n // ex.message = qq is not defined\n // ex.name = ReferenceError\n // ex.type = not_defined\n // ex.arguments = ['aa']\n // ex.stack = ...stack trace...\n //\n // INTERNET EXPLORER:\n // ex.message = ...\n // ex.name = ReferenceError\n //\n // OPERA:\n // ex.message = ...message... (see the example below)\n // ex.name = ReferenceError\n // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)\n // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'\n\n /**\n * Computes stack trace information from the stack property.\n * Chrome and Gecko use this property.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromStackProp(ex) {\n if (!ex.stack) {\n return null;\n }\n\n var chrome = /^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\/).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i,\n gecko = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i,\n winjs = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i,\n\n // Used to additionally parse URL/line/column from eval frames\n isEval,\n geckoEval = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i,\n chromeEval = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/,\n\n lines = ex.stack.split('\\n'),\n stack = [],\n submatch,\n parts,\n element,\n reference = /^(.*) is undefined$/.exec(ex.message);\n\n for (var i = 0, j = lines.length; i < j; ++i) {\n if ((parts = chrome.exec(lines[i]))) {\n var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n if (isEval && (submatch = chromeEval.exec(parts[2]))) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n parts[3] = submatch[2]; // line\n parts[4] = submatch[3]; // column\n }\n element = {\n 'url': !isNative ? parts[2] : null,\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': isNative ? [parts[2]] : [],\n 'line': parts[3] ? +parts[3] : null,\n 'column': parts[4] ? +parts[4] : null\n };\n } else if ( parts = winjs.exec(lines[i]) ) {\n element = {\n 'url': parts[2],\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': [],\n 'line': +parts[3],\n 'column': parts[4] ? +parts[4] : null\n };\n } else if ((parts = gecko.exec(lines[i]))) {\n isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval && (submatch = geckoEval.exec(parts[3]))) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = null; // no column when eval\n } else if (i === 0 && !parts[5] && !_isUndefined(ex.columnNumber)) {\n // FireFox uses this awesome columnNumber property for its top frame\n // Also note, Firefox's column number is 0-based and everything else expects 1-based,\n // so adding 1\n // NOTE: this hack doesn't work if top-most frame is eval\n stack[0].column = ex.columnNumber + 1;\n }\n element = {\n 'url': parts[3],\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': parts[2] ? parts[2].split(',') : [],\n 'line': parts[4] ? +parts[4] : null,\n 'column': parts[5] ? +parts[5] : null\n };\n } else {\n continue;\n }\n\n if (!element.func && element.line) {\n element.func = guessFunctionName(element.url, element.line);\n }\n\n element.context = element.line ? gatherContext(element.url, element.line) : null;\n stack.push(element);\n }\n\n if (!stack.length) {\n return null;\n }\n\n if (stack[0] && stack[0].line && !stack[0].column && reference) {\n stack[0].column = findSourceInLine(reference[1], stack[0].url, stack[0].line);\n }\n\n return {\n 'mode': 'stack',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n }\n\n /**\n * Computes stack trace information from the stacktrace property.\n * Opera 10+ uses this property.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromStacktraceProp(ex) {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n var stacktrace = ex.stacktrace;\n if (!stacktrace) {\n return;\n }\n\n var opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i,\n opera11Regex = / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^\\)]+))\\((.*)\\))? in (.*):\\s*$/i,\n lines = stacktrace.split('\\n'),\n stack = [],\n parts;\n\n for (var line = 0; line < lines.length; line += 2) {\n var element = null;\n if ((parts = opera10Regex.exec(lines[line]))) {\n element = {\n 'url': parts[2],\n 'line': +parts[1],\n 'column': null,\n 'func': parts[3],\n 'args':[]\n };\n } else if ((parts = opera11Regex.exec(lines[line]))) {\n element = {\n 'url': parts[6],\n 'line': +parts[1],\n 'column': +parts[2],\n 'func': parts[3] || parts[4],\n 'args': parts[5] ? parts[5].split(',') : []\n };\n }\n\n if (element) {\n if (!element.func && element.line) {\n element.func = guessFunctionName(element.url, element.line);\n }\n if (element.line) {\n try {\n element.context = gatherContext(element.url, element.line);\n } catch (exc) {}\n }\n\n if (!element.context) {\n element.context = [lines[line + 1]];\n }\n\n stack.push(element);\n }\n }\n\n if (!stack.length) {\n return null;\n }\n\n return {\n 'mode': 'stacktrace',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n }\n\n /**\n * NOT TESTED.\n * Computes stack trace information from an error message that includes\n * the stack trace.\n * Opera 9 and earlier use this method if the option to show stack\n * traces is turned on in opera:config.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromOperaMultiLineMessage(ex) {\n // TODO: Clean this function up\n // Opera includes a stack trace into the exception message. An example is:\n //\n // Statement on line 3: Undefined variable: undefinedFunc\n // Backtrace:\n // Line 3 of linked script file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.js: In function zzz\n // undefinedFunc(a);\n // Line 7 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function yyy\n // zzz(x, y, z);\n // Line 3 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function xxx\n // yyy(a, a, a);\n // Line 1 of function script\n // try { xxx('hi'); return false; } catch(ex) { TraceKit.report(ex); }\n // ...\n\n var lines = ex.message.split('\\n');\n if (lines.length < 4) {\n return null;\n }\n\n var lineRE1 = /^\\s*Line (\\d+) of linked script ((?:file|https?|blob)\\S+)(?:: in function (\\S+))?\\s*$/i,\n lineRE2 = /^\\s*Line (\\d+) of inline#(\\d+) script in ((?:file|https?|blob)\\S+)(?:: in function (\\S+))?\\s*$/i,\n lineRE3 = /^\\s*Line (\\d+) of function script\\s*$/i,\n stack = [],\n scripts = (window && window.document && window.document.getElementsByTagName('script')),\n inlineScriptBlocks = [],\n parts;\n\n for (var s in scripts) {\n if (_has(scripts, s) && !scripts[s].src) {\n inlineScriptBlocks.push(scripts[s]);\n }\n }\n\n for (var line = 2; line < lines.length; line += 2) {\n var item = null;\n if ((parts = lineRE1.exec(lines[line]))) {\n item = {\n 'url': parts[2],\n 'func': parts[3],\n 'args': [],\n 'line': +parts[1],\n 'column': null\n };\n } else if ((parts = lineRE2.exec(lines[line]))) {\n item = {\n 'url': parts[3],\n 'func': parts[4],\n 'args': [],\n 'line': +parts[1],\n 'column': null // TODO: Check to see if inline#1 (+parts[2]) points to the script number or column number.\n };\n var relativeLine = (+parts[1]); // relative to the start of the <SCRIPT> block\n var script = inlineScriptBlocks[parts[2] - 1];\n if (script) {\n var source = getSource(item.url);\n if (source) {\n source = source.join('\\n');\n var pos = source.indexOf(script.innerText);\n if (pos >= 0) {\n item.line = relativeLine + source.substring(0, pos).split('\\n').length;\n }\n }\n }\n } else if ((parts = lineRE3.exec(lines[line]))) {\n var url = window.location.href.replace(/#.*$/, '');\n var re = new RegExp(escapeCodeAsRegExpForMatchingInsideHTML(lines[line + 1]));\n var src = findSourceInUrls(re, [url]);\n item = {\n 'url': url,\n 'func': '',\n 'args': [],\n 'line': src ? src.line : parts[1],\n 'column': null\n };\n }\n\n if (item) {\n if (!item.func) {\n item.func = guessFunctionName(item.url, item.line);\n }\n var context = gatherContext(item.url, item.line);\n var midline = (context ? context[Math.floor(context.length / 2)] : null);\n if (context && midline.replace(/^\\s*/, '') === lines[line + 1].replace(/^\\s*/, '')) {\n item.context = context;\n } else {\n // if (context) alert(\"Context mismatch. Correct midline:\\n\" + lines[i+1] + \"\\n\\nMidline:\\n\" + midline + \"\\n\\nContext:\\n\" + context.join(\"\\n\") + \"\\n\\nURL:\\n\" + item.url);\n item.context = [lines[line + 1]];\n }\n stack.push(item);\n }\n }\n if (!stack.length) {\n return null; // could not parse multiline exception message as Opera stack trace\n }\n\n return {\n 'mode': 'multiline',\n 'name': ex.name,\n 'message': lines[0],\n 'stack': stack\n };\n }\n\n /**\n * Adds information about the first frame to incomplete stack traces.\n * Safari and IE require this to get complete data on the first frame.\n * @param {TraceKit.StackTrace} stackInfo Stack trace information from\n * one of the compute* methods.\n * @param {string} url The URL of the script that caused an error.\n * @param {(number|string)} lineNo The line number of the script that\n * caused an error.\n * @param {string=} message The error generated by the browser, which\n * hopefully contains the name of the object that caused the error.\n * @return {boolean} Whether or not the stack information was\n * augmented.\n * @memberof TraceKit.computeStackTrace\n */\n function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {\n var initial = {\n 'url': url,\n 'line': lineNo\n };\n\n if (initial.url && initial.line) {\n stackInfo.incomplete = false;\n\n if (!initial.func) {\n initial.func = guessFunctionName(initial.url, initial.line);\n }\n\n if (!initial.context) {\n initial.context = gatherContext(initial.url, initial.line);\n }\n\n var reference = / '([^']+)' /.exec(message);\n if (reference) {\n initial.column = findSourceInLine(reference[1], initial.url, initial.line);\n }\n\n if (stackInfo.stack.length > 0) {\n if (stackInfo.stack[0].url === initial.url) {\n if (stackInfo.stack[0].line === initial.line) {\n return false; // already in stack trace\n } else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) {\n stackInfo.stack[0].line = initial.line;\n stackInfo.stack[0].context = initial.context;\n return false;\n }\n }\n }\n\n stackInfo.stack.unshift(initial);\n stackInfo.partial = true;\n return true;\n } else {\n stackInfo.incomplete = true;\n }\n\n return false;\n }\n\n /**\n * Computes stack trace information by walking the arguments.caller\n * chain at the time the exception occurred. This will cause earlier\n * frames to be missed but is the only way to get any stack trace in\n * Safari and IE. The top frame is restored by\n * {@link augmentStackTraceWithInitialElement}.\n * @param {Error} ex\n * @return {TraceKit.StackTrace=} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceByWalkingCallerChain(ex, depth) {\n var functionName = /function\\s+([_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*)?\\s*\\(/i,\n stack = [],\n funcs = {},\n recursion = false,\n parts,\n item,\n source;\n\n for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) {\n if (curr === computeStackTrace || curr === TraceKit.report) {\n continue;\n }\n\n item = {\n 'url': null,\n 'func': UNKNOWN_FUNCTION,\n 'args': [],\n 'line': null,\n 'column': null\n };\n\n if (curr.name) {\n item.func = curr.name;\n } else if ((parts = functionName.exec(curr.toString()))) {\n item.func = parts[1];\n }\n\n if (typeof item.func === 'undefined') {\n try {\n item.func = parts.input.substring(0, parts.input.indexOf('{'));\n } catch (e) { }\n }\n\n if ((source = findSourceByFunctionBody(curr))) {\n item.url = source.url;\n item.line = source.line;\n\n if (item.func === UNKNOWN_FUNCTION) {\n item.func = guessFunctionName(item.url, item.line);\n }\n\n var reference = / '([^']+)' /.exec(ex.message || ex.description);\n if (reference) {\n item.column = findSourceInLine(reference[1], source.url, source.line);\n }\n }\n\n if (funcs['' + curr]) {\n recursion = true;\n }else{\n funcs['' + curr] = true;\n }\n\n stack.push(item);\n }\n\n if (depth) {\n stack.splice(0, depth);\n }\n\n var result = {\n 'mode': 'callers',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n augmentStackTraceWithInitialElement(result, ex.sourceURL || ex.fileName, ex.line || ex.lineNumber, ex.message || ex.description);\n return result;\n }\n\n /**\n * Computes a stack trace for an exception.\n * @param {Error} ex\n * @param {(string|number)=} depth\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTrace(ex, depth) {\n var stack = null;\n depth = (depth == null ? 0 : +depth);\n\n try {\n // This must be tried first because Opera 10 *destroys*\n // its stacktrace property if you try to access the stack\n // property first!!\n stack = computeStackTraceFromStacktraceProp(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceFromStackProp(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceFromOperaMultiLineMessage(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n return {\n 'name': ex.name,\n 'message': ex.message,\n 'mode': 'failed'\n };\n }\n\n /**\n * Logs a stacktrace starting from the previous call and working down.\n * @param {(number|string)=} depth How many frames deep to trace.\n * @return {TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceOfCaller(depth) {\n depth = (depth == null ? 0 : +depth) + 1; // \"+ 1\" because \"ofCaller\" should drop one frame\n try {\n throw new Error();\n } catch (ex) {\n return computeStackTrace(ex, depth + 1);\n }\n }\n\n computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;\n computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;\n computeStackTrace.guessFunctionName = guessFunctionName;\n computeStackTrace.gatherContext = gatherContext;\n computeStackTrace.ofCaller = computeStackTraceOfCaller;\n computeStackTrace.getSource = getSource;\n\n return computeStackTrace;\n}());\n\n/**\n * Extends support for global error handling for asynchronous browser\n * functions. Adopted from Closure Library's errorhandler.js\n * @memberof TraceKit\n */\nTraceKit.extendToAsynchronousCallbacks = function () {\n var _helper = function _helper(fnName) {\n var originalFn = window[fnName];\n window[fnName] = function traceKitAsyncExtension() {\n // Make a copy of the arguments\n var args = _slice.call(arguments);\n var originalCallback = args[0];\n if (typeof (originalCallback) === 'function') {\n args[0] = TraceKit.wrap(originalCallback);\n }\n // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it\n // also only supports 2 argument and doesn't care what \"this\" is, so we\n // can just call the original function directly.\n if (originalFn.apply) {\n return originalFn.apply(this, args);\n } else {\n return originalFn(args[0], args[1]);\n }\n };\n };\n\n _helper('setTimeout');\n _helper('setInterval');\n};\n\n//Default options:\nif (!TraceKit.remoteFetching) {\n TraceKit.remoteFetching = true;\n}\nif (!TraceKit.collectWindowErrors) {\n TraceKit.collectWindowErrors = true;\n}\nif (!TraceKit.linesOfContext || TraceKit.linesOfContext < 1) {\n // 5 lines before, the offending line, 5 lines after\n TraceKit.linesOfContext = 11;\n}\n\n// UMD export\nif (typeof define === 'function' && define.amd) {\n define('TraceKit', [], TraceKit);\n} else if (typeof module !== 'undefined' && module.exports && window.module !== module) {\n module.exports = TraceKit;\n} else {\n window.TraceKit = TraceKit;\n}\n\n}(typeof window !== 'undefined' ? window : global));\n","import * as TraceKit from 'TraceKit';\nimport os = require('os');\nimport nodestacktrace = require('stack-trace');\nimport child = require('child_process');\nimport path = require('path');\nimport * as Fs from 'fs';\nimport * as Path from 'path';\nimport http = require('http');\nimport https = require('https');\nimport url = require('url');\nexport interface ILastReferenceIdManager {\n getLast(): string;\n clearLast(): void;\n setLast(eventId: string): void;\n}\n\nexport interface ILog {\n trace(message: string): void;\n info(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n}\n\n \n\nexport class DefaultLastReferenceIdManager implements ILastReferenceIdManager {\n /**\n * Gets the last event's reference id that was submitted to the server.\n * @type {string}\n * @private\n */\n private _lastReferenceId: string = null;\n\n /**\n * Gets the last event's reference id that was submitted to the server.\n * @returns {string}\n */\n public getLast(): string {\n return this._lastReferenceId;\n }\n\n /**\n * Clears the last event's reference id.\n */\n public clearLast(): void {\n this._lastReferenceId = null;\n }\n\n /**\n * Sets the last event's reference id.\n * @param eventId\n */\n public setLast(eventId: string): void {\n this._lastReferenceId = eventId;\n }\n}\n\n \n\nexport class ConsoleLog implements ILog {\n public trace(message: string): void {\n this.log('debug', message);\n }\n\n public info(message: string): void {\n this.log('info', message);\n }\n\n public warn(message: string): void {\n this.log('warn', message);\n }\n\n public error(message: string): void {\n this.log('error', message);\n }\n\n private log(level: string, message: string) {\n if (console) {\n const msg = `[${level}] Exceptionless: ${message}`;\n\n if (console[level]) {\n console[level](msg);\n } else if (console.log) {\n console[`log`](msg);\n }\n }\n }\n}\n\n \n\nexport class NullLog implements ILog {\n public trace(message: string): void { }\n public info(message: string): void { }\n public warn(message: string): void { }\n public error(message: string): void { }\n}\n\nexport interface IUserInfo {\n identity?: string;\n name?: string;\n data?: any;\n}\n\n \n\nexport class HeartbeatPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = 'HeartbeatPlugin';\n\n private _interval: number;\n private _intervalId: any;\n\n constructor(heartbeatInterval: number = 30000) {\n this._interval = heartbeatInterval;\n }\n\n public run(context: EventPluginContext, next?: () => void): void {\n clearInterval(this._intervalId);\n\n const user: IUserInfo = context.event.data['@user'];\n if (user && user.identity) {\n this._intervalId = setInterval(() => context.client.submitSessionHeartbeat(user.identity), this._interval);\n }\n\n next && next();\n }\n}\n\n \n\nexport class ReferenceIdPlugin implements IEventPlugin {\n public priority: number = 20;\n public name: string = 'ReferenceIdPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n if ((!context.event.reference_id || context.event.reference_id.length === 0) && context.event.type === 'error') {\n context.event.reference_id = Utils.guid().replace('-', '').substring(0, 10);\n }\n\n next && next();\n }\n}\n\n \n\nexport class EventPluginContext {\n public cancelled: boolean;\n public client: ExceptionlessClient;\n public event: IEvent;\n public contextData: ContextData;\n\n constructor(client: ExceptionlessClient, event: IEvent, contextData?: ContextData) {\n this.client = client;\n this.event = event;\n this.contextData = contextData ? contextData : new ContextData();\n }\n\n public get log(): ILog {\n return this.client.config.log;\n }\n}\n\n \n\nexport class EventPluginManager {\n public static run(context: EventPluginContext, callback: (context?: EventPluginContext) => void): void {\n const wrap = (plugin: IEventPlugin, next?: () => void): () => void => {\n return () => {\n try {\n if (!context.cancelled) {\n plugin.run(context, next);\n }\n } catch (ex) {\n context.cancelled = true;\n context.log.error(`Error running plugin '${plugin.name}': ${ex.message}. Discarding Event.`);\n }\n\n if (context.cancelled && !!callback) {\n callback(context);\n }\n };\n };\n\n const plugins: IEventPlugin[] = context.client.config.plugins; // optimization for minifier.\n const wrappedPlugins: Array<() => void> = [];\n if (!!callback) {\n wrappedPlugins[plugins.length] = wrap({ name: 'cb', priority: 9007199254740992, run: callback }, null);\n }\n\n for (let index = plugins.length - 1; index > -1; index--) {\n wrappedPlugins[index] = wrap(plugins[index], !!callback || (index < plugins.length - 1) ? wrappedPlugins[index + 1] : null);\n }\n\n wrappedPlugins[0]();\n }\n\n public static addDefaultPlugins(config: Configuration): void {\n config.addPlugin(new ConfigurationDefaultsPlugin());\n config.addPlugin(new ErrorPlugin());\n config.addPlugin(new DuplicateCheckerPlugin());\n config.addPlugin(new EventExclusionPlugin());\n config.addPlugin(new ModuleInfoPlugin());\n config.addPlugin(new RequestInfoPlugin());\n config.addPlugin(new EnvironmentInfoPlugin());\n config.addPlugin(new SubmissionMethodPlugin());\n }\n}\n\n \n\nexport interface IEventPlugin {\n priority?: number;\n name?: string;\n run(context: EventPluginContext, next?: () => void): void;\n}\n\n \n\nexport class DefaultEventQueue implements IEventQueue {\n /**\n * The configuration object.\n * @type {Configuration}\n * @private\n */\n private _config: Configuration;\n\n /**\n * A list of handlers that will be fired when events are submitted.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(events: IEvent[], response: SubmissionResponse) => void> = [];\n\n /**\n * Suspends processing until the specified time.\n * @type {Date}\n * @private\n */\n private _suspendProcessingUntil: Date;\n\n /**\n * Discards queued items until the specified time.\n * @type {Date}\n * @private\n */\n private _discardQueuedItemsUntil: Date;\n\n /**\n * Returns true if the queue is processing.\n * @type {boolean}\n * @private\n */\n private _processingQueue: boolean = false;\n\n /**\n * Processes the queue every xx seconds.\n * @type {Timer}\n * @private\n */\n private _queueTimer: any;\n\n constructor(config: Configuration) {\n this._config = config;\n }\n\n public enqueue(event: IEvent): void {\n const eventWillNotBeQueued: string = 'The event will not be queued.'; // optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (this.areQueuedItemsDiscarded()) {\n log.info(`Queue items are currently being discarded. ${eventWillNotBeQueued}`);\n return;\n }\n\n this.ensureQueueTimer();\n\n const timestamp = config.storage.queue.save(event);\n const logText = `type=${event.type} ${!!event.reference_id ? 'refid=' + event.reference_id : ''}`;\n if (timestamp) {\n log.info(`Enqueuing event: ${timestamp} ${logText}`);\n } else {\n log.error(`Could not enqueue event ${logText}`);\n }\n }\n\n public process(isAppExiting?: boolean): void {\n const queueNotProcessed: string = 'The queue will not be processed.'; // optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (this._processingQueue) {\n return;\n }\n\n log.info('Processing queue...');\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${queueNotProcessed}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${queueNotProcessed}`);\n return;\n }\n\n this._processingQueue = true;\n this.ensureQueueTimer();\n\n try {\n const events = config.storage.queue.get(config.submissionBatchSize);\n if (!events || events.length === 0) {\n this._processingQueue = false;\n return;\n }\n\n log.info(`Sending ${events.length} events to ${config.serverUrl}.`);\n config.submissionClient.postEvents(events.map((e) => e.value), config, (response: SubmissionResponse) => {\n this.processSubmissionResponse(response, events);\n this.eventsPosted(events.map((e) => e.value), response);\n log.info('Finished processing queue.');\n this._processingQueue = false;\n }, isAppExiting);\n } catch (ex) {\n log.error(`Error processing queue: ${ex}`);\n this.suspendProcessing();\n this._processingQueue = false;\n }\n }\n\n public suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void {\n const config: Configuration = this._config; // Optimization for minifier.\n\n if (!durationInMinutes || durationInMinutes <= 0) {\n durationInMinutes = 5;\n }\n\n config.log.info(`Suspending processing for ${durationInMinutes} minutes.`);\n this._suspendProcessingUntil = new Date(new Date().getTime() + (durationInMinutes * 60000));\n\n if (discardFutureQueuedItems) {\n this._discardQueuedItemsUntil = this._suspendProcessingUntil;\n }\n\n if (clearQueue) {\n // Account is over the limit and we want to ensure that the sample size being sent in will contain newer errors.\n config.storage.queue.clear();\n }\n }\n\n public onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void {\n !!handler && this._handlers.push(handler);\n }\n\n private eventsPosted(events: IEvent[], response: SubmissionResponse) {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(events, response);\n } catch (ex) {\n this._config.log.error(`Error calling onEventsPosted handler: ${ex}`);\n }\n }\n }\n\n private areQueuedItemsDiscarded(): boolean {\n return this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date();\n }\n\n private ensureQueueTimer(): void {\n if (!this._queueTimer) {\n this._queueTimer = setInterval(() => this.onProcessQueue(), 10000);\n }\n }\n\n private isQueueProcessingSuspended(): boolean {\n return this._suspendProcessingUntil && this._suspendProcessingUntil > new Date();\n }\n\n private onProcessQueue(): void {\n if (!this.isQueueProcessingSuspended() && !this._processingQueue) {\n this.process();\n }\n }\n\n private processSubmissionResponse(response: SubmissionResponse, events: IStorageItem[]): void {\n const noSubmission: string = 'The event will not be submitted.'; // Optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (response.success) {\n log.info(`Sent ${events.length} events.`);\n this.removeEvents(events);\n return;\n }\n\n if (response.serviceUnavailable) {\n // You are currently over your rate limit or the servers are under stress.\n log.error('Server returned service unavailable.');\n this.suspendProcessing();\n return;\n }\n\n if (response.paymentRequired) {\n // If the organization over the rate limit then discard the event.\n log.info('Too many events have been submitted, please upgrade your plan.');\n this.suspendProcessing(null, true, true);\n return;\n }\n\n if (response.unableToAuthenticate) {\n // The api key was suspended or could not be authorized.\n log.info(`Unable to authenticate, please check your configuration. ${noSubmission}`);\n this.suspendProcessing(15);\n this.removeEvents(events);\n return;\n }\n\n if (response.notFound || response.badRequest) {\n // The service end point could not be found.\n log.error(`Error while trying to submit data: ${response.message}`);\n this.suspendProcessing(60 * 4);\n this.removeEvents(events);\n return;\n }\n\n if (response.requestEntityTooLarge) {\n const message = 'Event submission discarded for being too large.';\n if (config.submissionBatchSize > 1) {\n log.error(`${message} Retrying with smaller batch size.`);\n config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5));\n } else {\n log.error(`${message} ${noSubmission}`);\n this.removeEvents(events);\n }\n\n return;\n }\n\n if (!response.success) {\n log.error(`Error submitting events: ${response.message || 'Please check the network tab for more info.'}`);\n this.suspendProcessing();\n }\n }\n\n private removeEvents(events: IStorageItem[]) {\n for (let index = 0; index < (events || []).length; index++) {\n this._config.storage.queue.remove(events[index].timestamp);\n }\n }\n}\n\n \n\nexport interface IEventQueue {\n enqueue(event: IEvent): void;\n process(isAppExiting?: boolean): void;\n suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void;\n onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void;\n}\n\n \n\nexport interface IEnvironmentInfoCollector {\n getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo;\n}\n\n \n\nexport interface IErrorParser {\n parse(context: EventPluginContext, exception: Error): IError;\n}\n\n \n\nexport interface IModuleCollector {\n getModules(context: EventPluginContext): IModule[];\n}\n\n \n\nexport interface IRequestInfoCollector {\n getRequestInfo(context: EventPluginContext): IRequestInfo;\n}\n\n \n\nexport class InMemoryStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(maxQueueItems: number = 250) {\n this.queue = new InMemoryStorage(maxQueueItems);\n this.settings = new InMemoryStorage(1);\n }\n\n}\n\n \n\nexport interface IStorageProvider {\n queue: IStorage;\n settings: IStorage;\n}\n\n \n\n// tslint:disable-next-line:prefer-const\ndeclare var XDomainRequest: { new (); create(); };\n\nexport class DefaultSubmissionClient implements ISubmissionClient {\n public configurationVersionHeader: string = 'x-exceptionless-configversion';\n\n public postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void {\n const data = JSON.stringify(events);\n const request = this.createRequest(config, 'POST', `${config.serverUrl}/api/v2/events`, data);\n const cb = this.createSubmissionCallback(config, callback);\n\n return config.submissionAdapter.sendRequest(request, cb, isAppExiting);\n }\n\n public postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void {\n const path = `${config.serverUrl}/api/v2/events/by-ref/${encodeURIComponent(referenceId)}/user-description`;\n const data = JSON.stringify(description);\n const request = this.createRequest(config, 'POST', path, data);\n const cb = this.createSubmissionCallback(config, callback);\n\n return config.submissionAdapter.sendRequest(request, cb);\n }\n\n public getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void {\n const request = this.createRequest(config, 'GET', `${config.serverUrl}/api/v2/projects/config?v=${version}`);\n const cb = (status, message, data?, headers?) => {\n if (status !== 200) {\n return callback(new SettingsResponse(false, null, -1, null, message));\n }\n\n let settings: IClientConfiguration;\n try {\n settings = JSON.parse(data);\n } catch (e) {\n config.log.error(`Unable to parse settings: '${data}'`);\n }\n\n if (!settings || isNaN(settings.version)) {\n return callback(new SettingsResponse(false, null, -1, null, 'Invalid configuration settings.'));\n }\n\n callback(new SettingsResponse(true, settings.settings || {}, settings.version));\n };\n\n return config.submissionAdapter.sendRequest(request, cb);\n }\n\n public sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void {\n const request = this.createRequest(config, 'GET', `${config.heartbeatServerUrl}/api/v2/events/session/heartbeat?id=${sessionIdOrUserId}&close=${closeSession}`);\n config.submissionAdapter.sendRequest(request);\n }\n\n private createRequest(config: Configuration, method: string, url: string, data: string = null): SubmissionRequest {\n return {\n method,\n url,\n data,\n apiKey: config.apiKey,\n userAgent: config.userAgent\n };\n }\n\n private createSubmissionCallback(config: Configuration, callback: (response: SubmissionResponse) => void) {\n return (status, message, data?, headers?) => {\n const settingsVersion: number = headers && parseInt(headers[this.configurationVersionHeader], 10);\n SettingsManager.checkVersion(settingsVersion, config);\n\n callback(new SubmissionResponse(status, message));\n };\n }\n}\n\n \n\nexport interface ISubmissionAdapter {\n sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void;\n}\n\n \n\nexport interface ISubmissionClient {\n postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void;\n postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void;\n getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void;\n sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void;\n}\n\nexport class Utils {\n public static addRange<T>(target: T[], ...values: T[]) {\n if (!target) {\n target = [];\n }\n\n if (!values || values.length === 0) {\n return target;\n }\n\n for (const value of values) {\n if (value && target.indexOf(value) < 0) {\n target.push(value);\n }\n }\n\n return target;\n }\n\n public static getHashCode(source: string): number {\n if (!source || source.length === 0) {\n return 0;\n }\n\n let hash: number = 0;\n for (let index = 0; index < source.length; index++) {\n const character = source.charCodeAt(index);\n hash = ((hash << 5) - hash) + character;\n hash |= 0;\n }\n\n return hash;\n }\n\n public static getCookies(cookies: string, exclusions?: string[]): object {\n const result: object = {};\n\n const parts: string[] = (cookies || '').split('; ');\n for (const part of parts) {\n const cookie: string[] = part.split('=');\n if (!Utils.isMatch(cookie[0], exclusions)) {\n result[cookie[0]] = cookie[1];\n }\n }\n\n return !Utils.isEmpty(result) ? result : null;\n }\n\n public static guid(): string {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n }\n\n // tslint:disable-next-line:ban-types\n public static merge(defaultValues: Object, values: Object) {\n const result: object = {};\n\n for (const key in defaultValues || {}) {\n if (!!defaultValues[key]) {\n result[key] = defaultValues[key];\n }\n }\n\n for (const key in values || {}) {\n if (!!values[key]) {\n result[key] = values[key];\n }\n }\n\n return result;\n }\n\n public static parseVersion(source: string): string {\n if (!source) {\n return null;\n }\n\n const versionRegex = /(v?((\\d+)\\.(\\d+)(\\.(\\d+))?)(?:-([\\dA-Za-z\\-]+(?:\\.[\\dA-Za-z\\-]+)*))?(?:\\+([\\dA-Za-z\\-]+(?:\\.[\\dA-Za-z\\-]+)*))?)/;\n const matches = versionRegex.exec(source);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n\n return null;\n }\n\n public static parseQueryString(query: string, exclusions?: string[]) {\n if (!query || query.length === 0) {\n return null;\n }\n\n const pairs: string[] = query.split('&');\n if (pairs.length === 0) {\n return null;\n }\n\n const result: object = {};\n for (const pair of pairs) {\n const parts = pair.split('=');\n if (!Utils.isMatch(parts[0], exclusions)) {\n result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);\n }\n }\n\n return !Utils.isEmpty(result) ? result : null;\n }\n\n public static randomNumber(): number {\n return Math.floor(Math.random() * 9007199254740992);\n }\n\n /**\n * Checks to see if a value matches a pattern.\n * @param input the value to check against the @pattern.\n * @param pattern The pattern to check, supports wild cards (*).\n */\n public static isMatch(input: string, patterns: string[], ignoreCase: boolean = true): boolean {\n if (!input || typeof input !== 'string') {\n return false;\n }\n\n const trim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n input = (ignoreCase ? input.toLowerCase() : input).replace(trim, '');\n\n return (patterns || []).some((pattern) => {\n if (typeof pattern !== 'string') {\n return false;\n }\n\n pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, '');\n if (pattern.length <= 0) {\n return false;\n }\n\n const startsWithWildcard: boolean = pattern[0] === '*';\n if (startsWithWildcard) {\n pattern = pattern.slice(1);\n }\n\n const endsWithWildcard: boolean = pattern[pattern.length - 1] === '*';\n if (endsWithWildcard) {\n pattern = pattern.substring(0, pattern.length - 1);\n }\n\n if (startsWithWildcard && endsWithWildcard) {\n return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1;\n }\n\n if (startsWithWildcard) {\n return Utils.endsWith(input, pattern);\n }\n\n if (endsWithWildcard) {\n return Utils.startsWith(input, pattern);\n }\n\n return input === pattern;\n });\n }\n\n public static isEmpty(input: object) {\n return input === null || (typeof (input) === 'object' && Object.keys(input).length === 0);\n }\n\n public static startsWith(input: string, prefix: string): boolean {\n return input.substring(0, prefix.length) === prefix;\n }\n\n public static endsWith(input: string, suffix: string): boolean {\n return input.indexOf(suffix, input.length - suffix.length) !== -1;\n }\n\n /**\n * Stringifys an object with optional exclusions and max depth.\n * @param data The data object to add.\n * @param exclusions Any property names that should be excluded.\n * @param maxDepth The max depth of the object to include.\n */\n public static stringify(data: any, exclusions?: string[], maxDepth?: number): string {\n function stringifyImpl(obj: any, excludedKeys: string[]): string {\n const cache: string[] = [];\n return JSON.stringify(obj, (key: string, value: any) => {\n if (Utils.isMatch(key, excludedKeys)) {\n return;\n }\n\n if (typeof value === 'object' && !!value) {\n if (cache.indexOf(value) !== -1) {\n // Circular reference found, discard key\n return;\n }\n\n cache.push(value);\n }\n\n return value;\n });\n }\n\n if (({}).toString.call(data) === '[object Object]') {\n const flattened = {};\n /* tslint:disable:forin */\n for (const prop in data) {\n const value = data[prop];\n if (value === data) {\n continue;\n }\n flattened[prop] = data[prop];\n }\n /* tslint:enable:forin */\n\n return stringifyImpl(flattened, exclusions);\n }\n\n if (({}).toString.call(data) === '[object Array]') {\n const result = [];\n for (let index = 0; index < data.length; index++) {\n result[index] = JSON.parse(stringifyImpl(data[index], exclusions));\n }\n\n return JSON.stringify(result);\n }\n\n return stringifyImpl(data, exclusions);\n }\n\n public static toBoolean(input, defaultValue: boolean = false): boolean {\n if (typeof input === 'boolean') {\n return input;\n }\n\n if (input === null || typeof input !== 'number' && typeof input !== 'string') {\n return defaultValue;\n }\n\n switch ((input + '').toLowerCase().trim()) {\n case 'true': case 'yes': case '1': return true;\n case 'false': case 'no': case '0': case null: return false;\n }\n\n return defaultValue;\n }\n}\n\n \n\nexport interface IConfigurationSettings {\n apiKey?: string;\n serverUrl?: string;\n heartbeatServerUrl?: string;\n updateSettingsWhenIdleInterval?: number;\n environmentInfoCollector?: IEnvironmentInfoCollector;\n errorParser?: IErrorParser;\n lastReferenceIdManager?: ILastReferenceIdManager;\n log?: ILog;\n moduleCollector?: IModuleCollector;\n requestInfoCollector?: IRequestInfoCollector;\n submissionBatchSize?: number;\n submissionClient?: ISubmissionClient;\n submissionAdapter?: ISubmissionAdapter;\n storage?: IStorageProvider;\n queue?: IEventQueue;\n}\n\n \n\ninterface ISettingsWithVersion {\n version: number;\n settings: { [key: string]: string };\n}\n\nexport class SettingsManager {\n /**\n * A list of handlers that will be fired when the settings change.\n * @type {Array}\n * @private\n */\n private static _handlers: Array<(config: Configuration) => void> = [];\n\n public static onChanged(handler: (config: Configuration) => void) {\n !!handler && this._handlers.push(handler);\n }\n\n public static applySavedServerSettings(config: Configuration): void {\n if (!config || !config.isValid) {\n return;\n }\n\n const savedSettings = this.getSavedServerSettings(config);\n config.log.info(`Applying saved settings: v${savedSettings.version}`);\n config.settings = Utils.merge(config.settings, savedSettings.settings);\n this.changed(config);\n }\n\n public static getVersion(config: Configuration): number {\n if (!config || !config.isValid) {\n return 0;\n }\n\n const savedSettings = this.getSavedServerSettings(config);\n return savedSettings.version || 0;\n }\n\n public static checkVersion(version: number, config: Configuration): void {\n const currentVersion: number = this.getVersion(config);\n if (version <= currentVersion) {\n return;\n }\n\n config.log.info(`Updating settings from v${currentVersion} to v${version}`);\n this.updateSettings(config, currentVersion);\n }\n\n public static updateSettings(config: Configuration, version?: number): void {\n if (!config || !config.enabled) {\n return;\n }\n\n const unableToUpdateMessage = 'Unable to update settings';\n if (!config.isValid) {\n config.log.error(`${unableToUpdateMessage}: ApiKey is not set.`);\n return;\n }\n\n if (!version || version < 0) {\n version = this.getVersion(config);\n }\n\n config.log.info(`Checking for updated settings from: v${version}.`);\n config.submissionClient.getSettings(config, version, (response: SettingsResponse) => {\n if (!config || !response || !response.success || !response.settings) {\n config.log.warn(`${unableToUpdateMessage}: ${response.message}`);\n return;\n }\n\n config.settings = Utils.merge(config.settings, response.settings);\n\n // TODO: Store snapshot of settings after reading from config and attributes and use that to revert to defaults.\n // Remove any existing server settings that are not in the new server settings.\n const savedServerSettings = SettingsManager.getSavedServerSettings(config);\n for (const key in savedServerSettings) {\n if (response.settings[key]) {\n continue;\n }\n\n delete config.settings[key];\n }\n\n const newSettings: ISettingsWithVersion = {\n version: response.settingsVersion,\n settings: response.settings\n };\n\n config.storage.settings.save(newSettings);\n\n config.log.info(`Updated settings: v${newSettings.version}`);\n this.changed(config);\n });\n }\n\n private static changed(config: Configuration) {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(config);\n } catch (ex) {\n config.log.error(`Error calling onChanged handler: ${ex}`);\n }\n }\n }\n\n private static getSavedServerSettings(config: Configuration): ISettingsWithVersion {\n const item = config.storage.settings.get()[0];\n if (item && item.value && item.value.version && item.value.settings) {\n return item.value;\n }\n\n return { version: 0, settings: {} };\n }\n}\n\nexport interface IEvent {\n type?: string;\n source?: string;\n date?: Date;\n tags?: string[];\n message?: string;\n geo?: string;\n value?: number;\n data?: any;\n reference_id?: string;\n count?: number;\n}\n\nexport class SubmissionResponse {\n public success: boolean = false;\n public badRequest: boolean = false;\n public serviceUnavailable: boolean = false;\n public paymentRequired: boolean = false;\n public unableToAuthenticate: boolean = false;\n public notFound: boolean = false;\n public requestEntityTooLarge: boolean = false;\n public statusCode: number;\n public message: string;\n\n constructor(statusCode: number, message?: string) {\n this.statusCode = statusCode;\n this.message = message;\n\n this.success = statusCode >= 200 && statusCode <= 299;\n this.badRequest = statusCode === 400;\n this.serviceUnavailable = statusCode === 503;\n this.paymentRequired = statusCode === 402;\n this.unableToAuthenticate = statusCode === 401 || statusCode === 403;\n this.notFound = statusCode === 404;\n this.requestEntityTooLarge = statusCode === 413;\n }\n}\n\n \n\nexport class ExceptionlessClient {\n /**\n * The default ExceptionlessClient instance.\n * @type {ExceptionlessClient}\n * @private\n */\n private static _instance: ExceptionlessClient = null;\n\n public config: Configuration;\n\n private _intervalId: any;\n private _timeoutId: any;\n\n constructor();\n constructor(settings: IConfigurationSettings);\n constructor(apiKey: string, serverUrl?: string);\n constructor(settingsOrApiKey?: IConfigurationSettings | string, serverUrl?: string) {\n this.config = typeof settingsOrApiKey === 'object'\n ? new Configuration(settingsOrApiKey)\n : new Configuration({ apiKey: settingsOrApiKey as string, serverUrl });\n\n this.updateSettingsTimer(5000);\n this.config.onChanged((config) => this.updateSettingsTimer(this._timeoutId > 0 ? 5000 : 0));\n this.config.queue.onEventsPosted((events, response) => this.updateSettingsTimer());\n }\n\n public createException(exception: Error): EventBuilder {\n const pluginContextData = new ContextData();\n pluginContextData.setException(exception);\n return this.createEvent(pluginContextData).setType('error');\n }\n\n public submitException(exception: Error, callback?: (context: EventPluginContext) => void): void {\n this.createException(exception).submit(callback);\n }\n\n public createUnhandledException(exception: Error, submissionMethod?: string): EventBuilder {\n const builder = this.createException(exception);\n builder.pluginContextData.markAsUnhandledError();\n builder.pluginContextData.setSubmissionMethod(submissionMethod);\n\n return builder;\n }\n\n public submitUnhandledException(exception: Error, submissionMethod?: string, callback?: (context: EventPluginContext) => void) {\n this.createUnhandledException(exception, submissionMethod).submit(callback);\n }\n\n public createFeatureUsage(feature: string): EventBuilder {\n return this.createEvent().setType('usage').setSource(feature);\n }\n\n public submitFeatureUsage(feature: string, callback?: (context: EventPluginContext) => void): void {\n this.createFeatureUsage(feature).submit(callback);\n }\n\n public createLog(message: string): EventBuilder;\n public createLog(source: string, message: string): EventBuilder;\n public createLog(source: string, message: string, level: string): EventBuilder;\n public createLog(sourceOrMessage: string, message?: string, level?: string): EventBuilder {\n let builder = this.createEvent().setType('log');\n\n if (level) {\n builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty('@level', level);\n } else if (message) {\n builder = builder.setSource(sourceOrMessage).setMessage(message);\n } else {\n builder = builder.setMessage(sourceOrMessage);\n\n try {\n // TODO: Look into using https: //www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/\n const caller: any = this.createLog.caller;\n builder = builder.setSource(caller && caller.caller && caller.caller.name);\n } catch (e) {\n this.config.log.trace('Unable to resolve log source: ' + e.message);\n }\n }\n\n return builder;\n }\n\n public submitLog(message: string): void;\n public submitLog(source: string, message: string): void;\n public submitLog(source: string, message: string, level: string, callback?: (context: EventPluginContext) => void): void;\n public submitLog(sourceOrMessage: string, message?: string, level?: string, callback?: (context: EventPluginContext) => void): void {\n this.createLog(sourceOrMessage, message, level).submit(callback);\n }\n\n public createNotFound(resource: string): EventBuilder {\n return this.createEvent().setType('404').setSource(resource);\n }\n\n public submitNotFound(resource: string, callback?: (context: EventPluginContext) => void): void {\n this.createNotFound(resource).submit(callback);\n }\n\n public createSessionStart(): EventBuilder {\n return this.createEvent().setType('session');\n }\n\n public submitSessionStart(callback?: (context: EventPluginContext) => void): void {\n this.createSessionStart().submit(callback);\n }\n\n public submitSessionEnd(sessionIdOrUserId: string): void {\n if (sessionIdOrUserId) {\n this.config.log.info(`Submitting session end: ${sessionIdOrUserId}`);\n this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, true, this.config);\n }\n }\n\n public submitSessionHeartbeat(sessionIdOrUserId: string): void {\n if (sessionIdOrUserId) {\n this.config.log.info(`Submitting session heartbeat: ${sessionIdOrUserId}`);\n this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, false, this.config);\n }\n }\n\n public createEvent(pluginContextData?: ContextData): EventBuilder {\n return new EventBuilder({ date: new Date() }, this, pluginContextData);\n }\n\n /**\n * Submits the event to be sent to the server.\n * @param event The event data.\n * @param pluginContextData Any contextual data objects to be used by Exceptionless plugins to gather default information for inclusion in the report information.\n * @param callback\n */\n public submitEvent(event: IEvent, pluginContextData?: ContextData, callback?: (context: EventPluginContext) => void): void {\n function cancelled(context: EventPluginContext) {\n if (!!context) {\n context.cancelled = true;\n }\n\n return !!callback && callback(context);\n }\n\n const context = new EventPluginContext(this, event, pluginContextData);\n if (!event) {\n return cancelled(context);\n }\n\n if (!this.config.enabled) {\n this.config.log.info('Event submission is currently disabled.');\n return cancelled(context);\n }\n\n if (!event.data) {\n event.data = {};\n }\n\n if (!event.tags || !event.tags.length) {\n event.tags = [];\n }\n\n EventPluginManager.run(context, (ctx: EventPluginContext) => {\n const config = ctx.client.config;\n const ev = ctx.event;\n\n if (!ctx.cancelled) {\n // ensure all required data\n if (!ev.type || ev.type.length === 0) {\n ev.type = 'log';\n }\n\n if (!ev.date) {\n ev.date = new Date();\n }\n\n config.queue.enqueue(ev);\n\n if (ev.reference_id && ev.reference_id.length > 0) {\n ctx.log.info(`Setting last reference id '${ev.reference_id}'`);\n config.lastReferenceIdManager.setLast(ev.reference_id);\n }\n }\n\n !!callback && callback(ctx);\n });\n }\n\n /**\n * Updates the user's email address and description of an event for the specified reference id.\n * @param referenceId The reference id of the event to update.\n * @param email The user's email address to set on the event.\n * @param description The user's description of the event.\n * @param callback The submission response.\n */\n public updateUserEmailAndDescription(referenceId: string, email: string, description: string, callback?: (response: SubmissionResponse) => void) {\n if (!referenceId || !email || !description || !this.config.enabled) {\n return !!callback && callback(new SubmissionResponse(500, 'cancelled'));\n }\n\n const userDescription: IUserDescription = { email_address: email, description };\n this.config.submissionClient.postUserDescription(referenceId, userDescription, this.config, (response: SubmissionResponse) => {\n if (!response.success) {\n this.config.log.error(`Failed to submit user email and description for event '${referenceId}': ${response.statusCode} ${response.message}`);\n }\n\n !!callback && callback(response);\n });\n }\n\n /**\n * Gets the last event client id that was submitted to the server.\n * @returns {string} The event client id.\n */\n public getLastReferenceId(): string {\n return this.config.lastReferenceIdManager.getLast();\n }\n\n private updateSettingsTimer(initialDelay?: number) {\n this.config.log.info(`Updating settings timer with delay: ${initialDelay}`);\n\n this._timeoutId = clearTimeout(this._timeoutId);\n this._timeoutId = clearInterval(this._intervalId);\n\n const interval = this.config.updateSettingsWhenIdleInterval;\n if (interval > 0) {\n const updateSettings = () => SettingsManager.updateSettings(this.config);\n if (initialDelay > 0) {\n this._timeoutId = setTimeout(updateSettings, initialDelay);\n }\n\n this._intervalId = setInterval(updateSettings, interval);\n }\n }\n\n /**\n * The default ExceptionlessClient instance.\n * @type {ExceptionlessClient}\n */\n public static get default() {\n if (ExceptionlessClient._instance === null) {\n ExceptionlessClient._instance = new ExceptionlessClient(null);\n }\n\n return ExceptionlessClient._instance;\n }\n}\n\nexport class ContextData {\n public setException(exception: Error): void {\n if (exception) {\n this['@@_Exception'] = exception;\n }\n }\n\n public get hasException(): boolean {\n return !!this['@@_Exception'];\n }\n\n public getException(): Error {\n return this['@@_Exception'] || null;\n }\n\n public markAsUnhandledError(): void {\n this['@@_IsUnhandledError'] = true;\n }\n\n public get isUnhandledError(): boolean {\n return !!this['@@_IsUnhandledError'];\n }\n\n public setSubmissionMethod(method: string): void {\n if (method) {\n this['@@_SubmissionMethod'] = method;\n }\n }\n\n public getSubmissionMethod(): string {\n return this['@@_SubmissionMethod'] || null;\n }\n}\n\nexport interface IEnvironmentInfo {\n processor_count?: number;\n total_physical_memory?: number;\n available_physical_memory?: number;\n command_line?: string;\n process_name?: string;\n process_id?: string;\n process_memory_size?: number;\n thread_id?: string;\n architecture?: string;\n o_s_name?: string;\n o_s_version?: string;\n ip_address?: string;\n machine_name?: string;\n install_id?: string;\n runtime_version?: string;\n data?: any;\n}\n\nexport interface IParameter {\n data?: any;\n generic_arguments?: string[];\n\n name?: string;\n type?: string;\n type_namespace?: string;\n}\n\n \n\nexport interface IMethod {\n data?: any;\n generic_arguments?: string[];\n parameters?: IParameter[];\n\n is_signature_target?: boolean;\n declaring_namespace?: string;\n declaring_type?: string;\n name?: string;\n module_id?: number;\n}\n\n \n\nexport interface IStackFrame extends IMethod {\n file_name?: string;\n line_number?: number;\n column?: number;\n}\n\n \n\nexport interface IInnerError {\n message?: string;\n type?: string;\n code?: string;\n data?: any;\n inner?: IInnerError;\n stack_trace?: IStackFrame[];\n target_method?: IMethod;\n}\n\nexport interface IModule {\n data?: any;\n\n module_id?: number;\n name?: string;\n version?: string;\n is_entry?: boolean;\n created_date?: Date;\n modified_date?: Date;\n}\n\n \n\nexport interface IError extends IInnerError {\n modules?: IModule[];\n}\n\nexport interface IRequestInfo {\n user_agent?: string;\n http_method?: string;\n is_secure?: boolean;\n host?: string;\n port?: number;\n path?: string;\n referrer?: string;\n client_ip_address?: string;\n cookies?: any;\n post_data?: any;\n query_string?: any;\n data?: any;\n}\n\nexport interface IStorageItem {\n timestamp: number;\n value: any;\n}\n\n \n\nexport interface IStorage {\n save(value: any): number;\n get(limit?: number): IStorageItem[];\n remove(timestamp: number): void;\n clear(): void;\n}\n\nexport type SubmissionCallback = (status: number, message: string, data?: string, headers?: object) => void;\n\nexport interface SubmissionRequest {\n apiKey: string;\n userAgent: string;\n method: string;\n url: string;\n data: string;\n}\n\n \n\nexport class Configuration implements IConfigurationSettings {\n /**\n * The default configuration settings that are applied to new configuration instances.\n * @type {IConfigurationSettings}\n * @private\n */\n private static _defaultSettings: IConfigurationSettings = null;\n\n /**\n * A default list of tags that will automatically be added to every\n * report submitted to the server.\n *\n * @type {Array}\n */\n public defaultTags: string[] = [];\n\n /**\n * A default list of of extended data objects that will automatically\n * be added to every report submitted to the server.\n *\n * @type {{}}\n */\n public defaultData: object = {};\n\n /**\n * Whether the client is currently enabled or not. If it is disabled,\n * submitted errors will be discarded and no data will be sent to the server.\n *\n * @returns {boolean}\n */\n public enabled: boolean = true;\n\n public environmentInfoCollector: IEnvironmentInfoCollector;\n public errorParser: IErrorParser;\n public lastReferenceIdManager: ILastReferenceIdManager = new DefaultLastReferenceIdManager();\n public log: ILog;\n public moduleCollector: IModuleCollector;\n public requestInfoCollector: IRequestInfoCollector;\n\n /**\n * Maximum number of events that should be sent to the server together in a batch. (Defaults to 50)\n */\n public submissionBatchSize: number;\n public submissionAdapter: ISubmissionAdapter;\n public submissionClient: ISubmissionClient;\n\n /**\n * Contains a dictionary of custom settings that can be used to control\n * the client and will be automatically updated from the server.\n */\n public settings: object = {};\n\n public storage: IStorageProvider;\n\n public queue: IEventQueue;\n\n /**\n * The API key that will be used when sending events to the server.\n * @type {string}\n * @private\n */\n private _apiKey: string;\n\n /**\n * The server url that all events will be sent to.\n * @type {string}\n * @private\n */\n private _serverUrl: string = 'https://collector.exceptionless.io';\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @type {string}\n * @private\n */\n private _heartbeatServerUrl: string = 'https://heartbeat.exceptionless.io';\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @type {number}\n * @private\n */\n private _updateSettingsWhenIdleInterval: number = 120000;\n\n /**\n * A list of exclusion patterns.\n * @type {Array}\n * @private\n */\n private _dataExclusions: string[] = [];\n\n /**\n * A list of user agent patterns.\n * @type {Array}\n * @private\n */\n private _userAgentBotPatterns: string[] = [];\n\n /**\n * The list of plugins that will be used in this configuration.\n * @type {Array}\n * @private\n */\n private _plugins: IEventPlugin[] = [];\n\n /**\n * A list of handlers that will be fired when configuration changes.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(config: Configuration) => void> = [];\n\n constructor(configSettings?: IConfigurationSettings) {\n function inject(fn: any) {\n return typeof fn === 'function' ? fn(this) : fn;\n }\n\n configSettings = Utils.merge(Configuration.defaults, configSettings);\n\n this.log = inject(configSettings.log) || new NullLog();\n this.apiKey = configSettings.apiKey;\n this.serverUrl = configSettings.serverUrl;\n this.heartbeatServerUrl = configSettings.heartbeatServerUrl;\n this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval;\n\n this.environmentInfoCollector = inject(configSettings.environmentInfoCollector);\n this.errorParser = inject(configSettings.errorParser);\n this.lastReferenceIdManager = inject(configSettings.lastReferenceIdManager) || new DefaultLastReferenceIdManager();\n this.moduleCollector = inject(configSettings.moduleCollector);\n this.requestInfoCollector = inject(configSettings.requestInfoCollector);\n this.submissionBatchSize = inject(configSettings.submissionBatchSize) || 50;\n this.submissionAdapter = inject(configSettings.submissionAdapter);\n this.submissionClient = inject(configSettings.submissionClient) || new DefaultSubmissionClient();\n this.storage = inject(configSettings.storage) || new InMemoryStorageProvider();\n this.queue = inject(configSettings.queue) || new DefaultEventQueue(this);\n\n SettingsManager.applySavedServerSettings(this);\n EventPluginManager.addDefaultPlugins(this);\n }\n\n /**\n * The API key that will be used when sending events to the server.\n * @returns {string}\n */\n public get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * The API key that will be used when sending events to the server.\n * @param value\n */\n public set apiKey(value: string) {\n this._apiKey = value || null;\n this.log.info(`apiKey: ${this._apiKey}`);\n this.changed();\n }\n\n /**\n * Returns true if the apiKey is valid.\n * @returns {boolean}\n */\n public get isValid(): boolean {\n return !!this.apiKey && this.apiKey.length >= 10;\n }\n\n /**\n * The server url that all events will be sent to.\n * @returns {string}\n */\n public get serverUrl(): string {\n return this._serverUrl;\n }\n\n /**\n * The server url that all events will be sent to.\n * @param value\n */\n public set serverUrl(value: string) {\n if (!!value) {\n this._serverUrl = value;\n this._heartbeatServerUrl = value;\n this.log.info(`serverUrl: ${value}`);\n this.changed();\n }\n }\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @returns {string}\n */\n public get heartbeatServerUrl(): string {\n return this._heartbeatServerUrl;\n }\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @param value\n */\n public set heartbeatServerUrl(value: string) {\n if (!!value) {\n this._heartbeatServerUrl = value;\n this.log.info(`heartbeatServerUrl: ${value}`);\n this.changed();\n }\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @returns {number}\n */\n public get updateSettingsWhenIdleInterval(): number {\n return this._updateSettingsWhenIdleInterval;\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @param value\n */\n public set updateSettingsWhenIdleInterval(value: number) {\n if (typeof value !== 'number') {\n return;\n }\n\n if (value <= 0) {\n value = -1;\n } else if (value > 0 && value < 15000) {\n value = 15000;\n }\n\n this._updateSettingsWhenIdleInterval = value;\n this.log.info(`updateSettingsWhenIdleInterval: ${value}`);\n this.changed();\n }\n\n /**\n * A list of exclusion patterns that will automatically remove any data that\n * matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties,\n * form fields, cookies and query parameters from the report.\n *\n * @returns {string[]}\n */\n public get dataExclusions(): string[] {\n const exclusions: string = this.settings['@@DataExclusions'];\n return this._dataExclusions.concat(exclusions && exclusions.split(',') || []);\n }\n\n /**\n * Add items to the list of exclusion patterns that will automatically remove any\n * data that matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties, form\n * fields, cookies and query parameters from the report.\n *\n * @param exclusions\n */\n public addDataExclusions(...exclusions: string[]) {\n this._dataExclusions = Utils.addRange<string>(this._dataExclusions, ...exclusions);\n }\n\n /**\n * A list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n *\n * @returns {string[]}\n */\n public get userAgentBotPatterns(): string[] {\n const patterns: string = this.settings['@@UserAgentBotPatterns'];\n return this._userAgentBotPatterns.concat(patterns && patterns.split(',') || []);\n }\n\n /**\n * Add items to the list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n *\n * @param userAgentBotPatterns\n */\n public addUserAgentBotPatterns(...userAgentBotPatterns: string[]) {\n this._userAgentBotPatterns = Utils.addRange<string>(this._userAgentBotPatterns, ...userAgentBotPatterns);\n }\n\n /**\n * The list of plugins that will be used in this configuration.\n * @returns {IEventPlugin[]}\n */\n public get plugins(): IEventPlugin[] {\n return this._plugins.sort((p1: IEventPlugin, p2: IEventPlugin) => {\n return (p1.priority < p2.priority) ? -1 : (p1.priority > p2.priority) ? 1 : 0;\n });\n }\n\n /**\n * Register an plugin to be used in this configuration.\n * @param plugin\n */\n public addPlugin(plugin: IEventPlugin): void;\n\n /**\n * Register an plugin to be used in this configuration.\n * @param name The name used to identify the plugin.\n * @param priority Used to determine plugins priority.\n * @param pluginAction A function that is run.\n */\n public addPlugin(name: string, priority: number, pluginAction: (context: EventPluginContext, next?: () => void) => void): void;\n public addPlugin(pluginOrName: IEventPlugin | string, priority?: number, pluginAction?: (context: EventPluginContext, next?: () => void) => void): void {\n const plugin: IEventPlugin = !!pluginAction ? { name: pluginOrName as string, priority, run: pluginAction } : pluginOrName as IEventPlugin;\n if (!plugin || !plugin.run) {\n this.log.error('Add plugin failed: Run method not defined');\n return;\n }\n\n if (!plugin.name) {\n plugin.name = Utils.guid();\n }\n\n if (!plugin.priority) {\n plugin.priority = 0;\n }\n\n let pluginExists: boolean = false;\n const plugins = this._plugins; // optimization for minifier.\n for (const p of plugins) {\n if (p.name === plugin.name) {\n pluginExists = true;\n break;\n }\n }\n\n if (!pluginExists) {\n plugins.push(plugin);\n }\n }\n\n /**\n * Remove the plugin from this configuration.\n * @param plugin\n */\n public removePlugin(plugin: IEventPlugin): void;\n\n /**\n * Remove an plugin by key from this configuration.\n * @param name\n */\n public removePlugin(pluginOrName: IEventPlugin | string): void {\n const name: string = typeof pluginOrName === 'string' ? pluginOrName : pluginOrName.name;\n if (!name) {\n this.log.error('Remove plugin failed: Plugin name not defined');\n return;\n }\n\n const plugins = this._plugins; // optimization for minifier.\n for (let index = 0; index < plugins.length; index++) {\n if (plugins[index].name === name) {\n plugins.splice(index, 1);\n break;\n }\n }\n }\n\n /**\n * Automatically set the application version for events.\n * @param version\n */\n public setVersion(version: string): void {\n if (!!version) {\n this.defaultData['@version'] = version;\n }\n }\n\n public setUserIdentity(userInfo: IUserInfo): void;\n public setUserIdentity(identity: string): void;\n public setUserIdentity(identity: string, name: string): void;\n public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): void {\n const USER_KEY: string = '@user'; // optimization for minifier.\n const userInfo: IUserInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n\n const shouldRemove: boolean = !userInfo || (!userInfo.identity && !userInfo.name);\n if (shouldRemove) {\n delete this.defaultData[USER_KEY];\n } else {\n this.defaultData[USER_KEY] = userInfo;\n }\n\n this.log.info(`user identity: ${shouldRemove ? 'null' : userInfo.identity}`);\n }\n\n /**\n * Used to identify the client that sent the events to the server.\n * @returns {string}\n */\n public get userAgent(): string {\n return 'exceptionless-js/1.0.0.0';\n }\n\n /**\n * Automatically send a heartbeat to keep the session alive.\n */\n public useSessions(sendHeartbeats: boolean = true, heartbeatInterval: number = 30000): void {\n if (sendHeartbeats) {\n this.addPlugin(new HeartbeatPlugin(heartbeatInterval));\n }\n }\n\n /**\n * Automatically set a reference id for error events.\n */\n public useReferenceIds(): void {\n this.addPlugin(new ReferenceIdPlugin());\n }\n\n public useLocalStorage(): void {\n // This method will be injected via the prototype.\n }\n\n // TODO: Support a min log level.\n public useDebugLogger(): void {\n this.log = new ConsoleLog();\n }\n\n public onChanged(handler: (config: Configuration) => void) {\n !!handler && this._handlers.push(handler);\n }\n\n private changed() {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(this);\n } catch (ex) {\n this.log.error(`Error calling onChanged handler: ${ex}`);\n }\n }\n }\n\n /**\n * The default configuration settings that are applied to new configuration instances.\n * @returns {IConfigurationSettings}\n */\n public static get defaults() {\n if (Configuration._defaultSettings === null) {\n Configuration._defaultSettings = {};\n }\n\n return Configuration._defaultSettings;\n }\n}\n\nexport interface IUserDescription {\n email_address?: string;\n description?: string;\n data?: any;\n}\n\nexport class SettingsResponse {\n public success: boolean = false;\n public settings: any;\n public settingsVersion: number = -1;\n public message: string;\n public exception: any;\n\n constructor(success: boolean, settings: any, settingsVersion: number = -1, exception: any = null, message: string = null) {\n this.success = success;\n this.settings = settings;\n this.settingsVersion = settingsVersion;\n this.exception = exception;\n this.message = message;\n }\n}\n\n \n\nexport class EventBuilder {\n public target: IEvent;\n public client: ExceptionlessClient;\n public pluginContextData: ContextData;\n\n private _validIdentifierErrorMessage: string = 'must contain between 8 and 100 alphanumeric or \\'-\\' characters.'; // optimization for minifier.\n\n constructor(event: IEvent, client: ExceptionlessClient, pluginContextData?: ContextData) {\n this.target = event;\n this.client = client;\n this.pluginContextData = pluginContextData || new ContextData();\n }\n\n public setType(type: string): EventBuilder {\n if (!!type) {\n this.target.type = type;\n }\n\n return this;\n }\n\n public setSource(source: string): EventBuilder {\n if (!!source) {\n this.target.source = source;\n }\n\n return this;\n }\n\n public setReferenceId(referenceId: string): EventBuilder {\n if (!this.isValidIdentifier(referenceId)) {\n throw new Error(`ReferenceId ${this._validIdentifierErrorMessage}`);\n }\n\n this.target.reference_id = referenceId;\n return this;\n }\n\n /**\n * Allows you to reference a parent event by its ReferenceId property. This allows you to have parent and child relationships.\n * @param name Reference name\n * @param id The reference id that points to a specific event\n * @returns {EventBuilder}\n */\n public setEventReference(name: string, id: string): EventBuilder {\n if (!name) {\n throw new Error('Invalid name');\n }\n\n if (!id || !this.isValidIdentifier(id)) {\n throw new Error(`Id ${this._validIdentifierErrorMessage}`);\n }\n\n this.setProperty('@ref:' + name, id);\n return this;\n }\n\n public setMessage(message: string): EventBuilder {\n if (!!message) {\n this.target.message = message;\n }\n\n return this;\n }\n\n public setGeo(latitude: number, longitude: number): EventBuilder {\n if (latitude < -90.0 || latitude > 90.0) {\n throw new Error('Must be a valid latitude value between -90.0 and 90.0.');\n }\n\n if (longitude < -180.0 || longitude > 180.0) {\n throw new Error('Must be a valid longitude value between -180.0 and 180.0.');\n }\n\n this.target.geo = `${latitude},${longitude}`;\n return this;\n }\n\n public setUserIdentity(userInfo: IUserInfo): EventBuilder;\n public setUserIdentity(identity: string): EventBuilder;\n public setUserIdentity(identity: string, name: string): EventBuilder;\n public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): EventBuilder {\n const userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n if (!userInfo || (!userInfo.identity && !userInfo.name)) {\n return this;\n }\n\n this.setProperty('@user', userInfo);\n return this;\n }\n\n /**\n * Sets the user's description of the event.\n *\n * @param emailAddress The email address\n * @param description The user's description of the event.\n * @returns {EventBuilder}\n */\n public setUserDescription(emailAddress: string, description: string): EventBuilder {\n if (emailAddress && description) {\n this.setProperty('@user_description', { email_address: emailAddress, description });\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting manual\n * stacking information.\n * @param signatureData A dictionary of strings to use for stacking.\n * @param title An optional title for the stacking information.\n * @returns {EventBuilder}\n */\n public setManualStackingInfo(signatureData: any, title?: string) {\n if (signatureData) {\n const stack: IManualStackingInfo = { signature_data: signatureData };\n if (title) {\n stack.title = title;\n }\n\n this.setProperty('@stack', stack);\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting the stacking key.\n * @param manualStackingKey The manual stacking key.\n * @param title An optional title for the stacking information.\n * @returns {EventBuilder}\n */\n public setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder {\n if (manualStackingKey) {\n const data = { ManualStackingKey: manualStackingKey };\n this.setManualStackingInfo(data, title);\n }\n\n return this;\n }\n\n public setValue(value: number): EventBuilder {\n if (!!value) {\n this.target.value = value;\n }\n\n return this;\n }\n\n public addTags(...tags: string[]): EventBuilder {\n this.target.tags = Utils.addRange<string>(this.target.tags, ...tags);\n return this;\n }\n\n /**\n * Adds the object to extended data. Uses @excludedPropertyNames\n * to exclude data from being included in the event.\n * @param name The data object to add.\n * @param value The name of the object to add.\n * @param maxDepth The max depth of the object to include.\n * @param excludedPropertyNames Any property names that should be excluded.\n */\n public setProperty(name: string, value: any, maxDepth?: number, excludedPropertyNames?: string[]): EventBuilder {\n if (!name || (value === undefined || value == null)) {\n return this;\n }\n\n if (!this.target.data) {\n this.target.data = {};\n }\n\n const result = JSON.parse(Utils.stringify(value, this.client.config.dataExclusions.concat(excludedPropertyNames || []), maxDepth));\n if (!Utils.isEmpty(result)) {\n this.target.data[name] = result;\n }\n\n return this;\n }\n\n public markAsCritical(critical: boolean): EventBuilder {\n if (critical) {\n this.addTags('Critical');\n }\n\n return this;\n }\n\n public addRequestInfo(request: object): EventBuilder {\n if (!!request) {\n this.pluginContextData['@request'] = request;\n }\n\n return this;\n }\n\n public submit(callback?: (context: EventPluginContext) => void): void {\n this.client.submitEvent(this.target, this.pluginContextData, callback);\n }\n\n private isValidIdentifier(value: string): boolean {\n if (!value) {\n return true;\n }\n\n if (value.length < 8 || value.length > 100) {\n return false;\n }\n\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index);\n const isDigit = (code >= 48) && (code <= 57);\n const isLetter = ((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122));\n const isMinus = code === 45;\n\n if (!(isDigit || isLetter) && !isMinus) {\n return false;\n }\n }\n\n return true;\n }\n}\n\nexport interface IManualStackingInfo {\n title?: string;\n signature_data?: any;\n}\n\n \n\nexport class ConfigurationDefaultsPlugin implements IEventPlugin {\n public priority: number = 10;\n public name: string = 'ConfigurationDefaultsPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const config = context.client.config;\n const defaultTags: string[] = config.defaultTags || [];\n for (const tag of defaultTags) {\n if (!!tag && context.event.tags.indexOf(tag) < 0) {\n context.event.tags.push(tag);\n }\n }\n\n // tslint:disable-next-line:ban-types\n const defaultData: Object = config.defaultData || {};\n for (const key in defaultData) {\n if (!!defaultData[key]) {\n const result = JSON.parse(Utils.stringify(defaultData[key], config.dataExclusions));\n if (!Utils.isEmpty(result)) {\n context.event.data[key] = result;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class DuplicateCheckerPlugin implements IEventPlugin {\n public priority: number = 1010;\n public name: string = 'DuplicateCheckerPlugin';\n\n private _mergedEvents: MergedEvent[] = [];\n private _processedHashcodes: TimestampedHash[] = [];\n private _getCurrentTime: () => number;\n private _interval: number;\n\n constructor(getCurrentTime: () => number = () => Date.now(), interval: number = 30000) {\n this._getCurrentTime = getCurrentTime;\n this._interval = interval;\n\n setInterval(() => {\n while (this._mergedEvents.length > 0) {\n this._mergedEvents.shift().resubmit();\n }\n }, interval);\n }\n\n public run(context: EventPluginContext, next?: () => void): void {\n function getHashCode(error: IInnerError): number {\n let hashCode = 0;\n while (error) {\n if (error.message && error.message.length) {\n hashCode += (hashCode * 397) ^ Utils.getHashCode(error.message);\n }\n if (error.stack_trace && error.stack_trace.length) {\n hashCode += (hashCode * 397) ^ Utils.getHashCode(JSON.stringify(error.stack_trace));\n }\n error = error.inner;\n }\n\n return hashCode;\n }\n\n const error = context.event.data['@error'];\n const hashCode = getHashCode(error);\n if (hashCode) {\n const count = context.event.count || 1;\n const now = this._getCurrentTime();\n\n const merged = this._mergedEvents.filter((s) => s.hashCode === hashCode)[0];\n if (merged) {\n merged.incrementCount(count);\n merged.updateDate(context.event.date);\n context.log.info('Ignoring duplicate event with hash: ' + hashCode);\n context.cancelled = true;\n }\n\n if (!context.cancelled && this._processedHashcodes.some((h) => h.hash === hashCode && h.timestamp >= (now - this._interval))) {\n context.log.trace('Adding event with hash: ' + hashCode);\n this._mergedEvents.push(new MergedEvent(hashCode, context, count));\n context.cancelled = true;\n }\n\n if (!context.cancelled) {\n context.log.trace('Enqueueing event with hash: ' + hashCode + 'to cache.');\n this._processedHashcodes.push({ hash: hashCode, timestamp: now });\n\n // Only keep the last 50 recent errors.\n while (this._processedHashcodes.length > 50) {\n this._processedHashcodes.shift();\n }\n }\n }\n\n next && next();\n }\n}\n\ninterface TimestampedHash {\n hash: number;\n timestamp: number;\n}\n\nclass MergedEvent {\n public hashCode: number;\n private _count: number;\n private _context: EventPluginContext;\n\n constructor(hashCode: number, context: EventPluginContext, count: number) {\n this.hashCode = hashCode;\n this._context = context;\n this._count = count;\n }\n\n public incrementCount(count: number) {\n this._count += count;\n }\n\n public resubmit() {\n this._context.event.count = this._count;\n this._context.client.config.queue.enqueue(this._context.event);\n }\n\n public updateDate(date) {\n if (date > this._context.event.date) {\n this._context.event.date = date;\n }\n }\n}\n\n \n\nexport class EnvironmentInfoPlugin implements IEventPlugin {\n public priority: number = 80;\n public name: string = 'EnvironmentInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ENVIRONMENT_KEY: string = '@environment'; // optimization for minifier.\n\n const collector = context.client.config.environmentInfoCollector;\n if (!context.event.data[ENVIRONMENT_KEY] && collector) {\n const environmentInfo: IEnvironmentInfo = collector.getEnvironmentInfo(context);\n if (!!environmentInfo) {\n context.event.data[ENVIRONMENT_KEY] = environmentInfo;\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class ErrorPlugin implements IEventPlugin {\n public priority: number = 30;\n public name: string = 'ErrorPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ERROR_KEY: string = '@error'; // optimization for minifier.\n const ignoredProperties: string[] = [\n 'arguments',\n 'column',\n 'columnNumber',\n 'description',\n 'fileName',\n 'message',\n 'name',\n 'number',\n 'line',\n 'lineNumber',\n 'opera#sourceloc',\n 'sourceId',\n 'sourceURL',\n 'stack',\n 'stackArray',\n 'stacktrace'\n ];\n\n const exception = context.contextData.getException();\n if (!!exception) {\n context.event.type = 'error';\n\n if (!context.event.data[ERROR_KEY]) {\n const config = context.client.config;\n const parser = config.errorParser;\n if (!parser) {\n throw new Error('No error parser was defined.');\n }\n\n const result = parser.parse(context, exception);\n if (!!result) {\n const additionalData = JSON.parse(Utils.stringify(exception, config.dataExclusions.concat(ignoredProperties)));\n if (!Utils.isEmpty(additionalData)) {\n if (!result.data) {\n result.data = {};\n }\n result.data['@ext'] = additionalData;\n }\n\n context.event.data[ERROR_KEY] = result;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class EventExclusionPlugin implements IEventPlugin {\n public priority: number = 45;\n public name: string = 'EventExclusionPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n function getLogLevel(level: string): number {\n switch ((level || '').toLowerCase().trim()) {\n case 'trace':\n case 'true':\n case '1':\n case 'yes':\n return 0;\n case 'debug':\n return 1;\n case 'info':\n return 2;\n case 'warn':\n return 3;\n case 'error':\n return 4;\n case 'fatal':\n return 5;\n case 'off':\n case 'false':\n case '0':\n case 'no':\n return 6;\n default:\n return -1;\n }\n }\n\n function getMinLogLevel(settings: object, loggerName: string = '*'): number {\n return getLogLevel(getTypeAndSourceSetting(settings, 'log', loggerName, 'Trace') + '');\n }\n\n // tslint:disable-next-line:ban-types\n function getTypeAndSourceSetting(settings: Object = {}, type: string, source: string, defaultValue?: string|boolean): string|boolean {\n if (!type) {\n return defaultValue;\n }\n\n const isLog = type === 'log';\n const sourcePrefix = `@@${type}:`;\n\n const value = settings[sourcePrefix + source];\n if (value) {\n return !isLog ? Utils.toBoolean(value) : value;\n }\n\n // check for wildcard match\n for (const key in settings) {\n if (Utils.startsWith(key.toLowerCase(), sourcePrefix.toLowerCase()) && Utils.isMatch(source, [key.substring(sourcePrefix.length)])) {\n return !isLog ? Utils.toBoolean(settings[key]) : settings[key];\n }\n }\n\n return defaultValue;\n }\n\n const ev = context.event;\n const log = context.log;\n const settings = context.client.config.settings;\n\n if (ev.type === 'log') {\n const minLogLevel = getMinLogLevel(settings, ev.source);\n const logLevel = getLogLevel(ev.data['@level']);\n\n if (logLevel >= 0 && (logLevel > 5 || logLevel < minLogLevel)) {\n log.info('Cancelling log event due to minimum log level.');\n context.cancelled = true;\n }\n } else if (ev.type === 'error') {\n let error: IInnerError = ev.data['@error'];\n while (!context.cancelled && error) {\n if (getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) {\n log.info(`Cancelling error from excluded exception type: ${error.type}`);\n context.cancelled = true;\n }\n\n error = error.inner;\n }\n } else if (getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) {\n log.info(`Cancelling event from excluded type: ${ev.type} and source: ${ev.source}`);\n context.cancelled = true;\n }\n\n next && next();\n }\n}\n\n \n\nexport class ModuleInfoPlugin implements IEventPlugin {\n public priority: number = 50;\n public name: string = 'ModuleInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ERROR_KEY: string = '@error'; // optimization for minifier.\n\n const collector = context.client.config.moduleCollector;\n if (context.event.data[ERROR_KEY] && !context.event.data['@error'].modules && !!collector) {\n const modules: IModule[] = collector.getModules(context);\n if (modules && modules.length > 0) {\n context.event.data[ERROR_KEY].modules = modules;\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class RequestInfoPlugin implements IEventPlugin {\n public priority: number = 70;\n public name: string = 'RequestInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const REQUEST_KEY: string = '@request'; // optimization for minifier.\n\n const config = context.client.config;\n const collector = config.requestInfoCollector;\n if (!context.event.data[REQUEST_KEY] && !!collector) {\n const requestInfo: IRequestInfo = collector.getRequestInfo(context);\n if (!!requestInfo) {\n if (Utils.isMatch(requestInfo.user_agent, config.userAgentBotPatterns)) {\n context.log.info('Cancelling event as the request user agent matches a known bot pattern');\n context.cancelled = true;\n } else {\n context.event.data[REQUEST_KEY] = requestInfo;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class SubmissionMethodPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = 'SubmissionMethodPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const submissionMethod: string = context.contextData.getSubmissionMethod();\n if (!!submissionMethod) {\n context.event.data['@submission_method'] = submissionMethod;\n }\n\n next && next();\n }\n}\n\n \n\nexport class InMemoryStorage implements IStorage {\n private maxItems: number;\n private items: IStorageItem[] = [];\n private lastTimestamp: number = 0;\n\n constructor(maxItems: number) {\n this.maxItems = maxItems;\n }\n\n public save(value: any): number {\n if (!value) {\n return null;\n }\n\n const items = this.items;\n const timestamp = Math.max(Date.now(), this.lastTimestamp + 1);\n const item = { timestamp, value };\n\n if (items.push(item) > this.maxItems) {\n items.shift();\n }\n\n this.lastTimestamp = timestamp;\n return item.timestamp;\n }\n\n public get(limit?: number): IStorageItem[] {\n return this.items.slice(0, limit);\n }\n\n public remove(timestamp: number): void {\n const items = this.items;\n for (let i = 0; i < items.length; i++) {\n if (items[i].timestamp === timestamp) {\n items.splice(i, 1);\n return;\n }\n }\n }\n\n public clear(): void {\n this.items = [];\n }\n}\n\nexport interface IClientConfiguration {\n settings: object;\n version: number;\n}\n\n \n\nexport abstract class KeyValueStorageBase implements IStorage {\n private maxItems: number;\n private items: number[];\n private lastTimestamp: number = 0;\n\n constructor(maxItems) {\n this.maxItems = maxItems;\n }\n\n public save(value: any, single?: boolean): number {\n if (!value) {\n return null;\n }\n\n this.ensureIndex();\n\n const items = this.items;\n const timestamp = Math.max(Date.now(), this.lastTimestamp + 1);\n const key = this.getKey(timestamp);\n const json = JSON.stringify(value);\n\n try {\n this.write(key, json);\n this.lastTimestamp = timestamp;\n if (items.push(timestamp) > this.maxItems) {\n this.delete(this.getKey(items.shift()));\n }\n } catch (e) {\n return null;\n }\n\n return timestamp;\n }\n\n public get(limit?: number): IStorageItem[] {\n this.ensureIndex();\n\n return this.items.slice(0, limit)\n .map((timestamp) => {\n // Read and parse item for this timestamp\n const key = this.getKey(timestamp);\n try {\n const json = this.read(key);\n const value = JSON.parse(json, parseDate);\n return { timestamp, value };\n } catch (error) {\n // Something went wrong - try to delete the cause.\n this.safeDelete(key);\n return null;\n }\n })\n .filter((item) => item != null);\n }\n\n public remove(timestamp: number): void {\n this.ensureIndex();\n\n const items = this.items;\n const index = items.indexOf(timestamp);\n if (index >= 0) {\n const key = this.getKey(timestamp);\n this.safeDelete(key);\n items.splice(index, 1);\n }\n }\n\n public clear(): void {\n this.items.forEach((item) => this.safeDelete(this.getKey(item)));\n this.items = [];\n }\n\n protected abstract write(key: string, value: string): void;\n protected abstract read(key: string): string;\n protected abstract readAllKeys(): string[];\n protected abstract delete(key: string);\n protected abstract getKey(timestamp: number): string;\n protected abstract getTimestamp(key: string): number;\n\n private ensureIndex() {\n if (!this.items) {\n this.items = this.createIndex();\n this.lastTimestamp = Math.max(0, ...this.items) + 1;\n }\n }\n\n private safeDelete(key: string): void {\n try {\n this.delete(key);\n } catch (error) {\n }\n }\n\n private createIndex() {\n try {\n const keys = this.readAllKeys();\n return keys.map((key) => {\n try {\n const timestamp = this.getTimestamp(key);\n if (!timestamp) {\n this.safeDelete(key);\n return null;\n }\n return timestamp;\n } catch (error) {\n this.safeDelete(key);\n return null;\n }\n }).filter((timestamp) => timestamp != null)\n .sort((a, b) => a - b);\n } catch (error) {\n return [];\n }\n }\n}\n\nfunction parseDate(key, value) {\n const dateRegx = /\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)/g;\n if (typeof value === 'string') {\n const a = dateRegx.exec(value);\n if (a) {\n return new Date(value);\n }\n }\n return value;\n}\n\n \n\nexport class BrowserStorage extends KeyValueStorageBase {\n private prefix: string;\n\n public static isAvailable(): boolean {\n try {\n const storage = window.localStorage;\n const x = '__storage_test__';\n storage.setItem(x, x);\n storage.removeItem(x);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(namespace: string, prefix: string = 'com.exceptionless.', maxItems: number = 20) {\n super(maxItems);\n\n this.prefix = prefix + namespace + '-';\n }\n\n public write(key: string, value: string) {\n window.localStorage.setItem(key, value);\n }\n\n public read(key: string) {\n return window.localStorage.getItem(key);\n }\n\n public readAllKeys() {\n return Object.keys(window.localStorage)\n .filter((key) => key.indexOf(this.prefix) === 0);\n }\n\n public delete(key: string) {\n window.localStorage.removeItem(key);\n }\n\n public getKey(timestamp) {\n return this.prefix + timestamp;\n }\n\n public getTimestamp(key) {\n return parseInt(key.substr(this.prefix.length), 10);\n }\n}\n\n \n\nexport class DefaultErrorParser implements IErrorParser {\n public parse(context: EventPluginContext, exception: Error): IError {\n function getParameters(parameters: string | string[]): IParameter[] {\n const params: string[] = (typeof parameters === 'string' ? [parameters] : parameters) || [];\n\n const result: IParameter[] = [];\n for (const param of params) {\n result.push({ name: param });\n }\n\n return result;\n }\n\n function getStackFrames(stackFrames: TraceKit.StackFrame[]): IStackFrame[] {\n const ANONYMOUS: string = '<anonymous>';\n const frames: IStackFrame[] = [];\n\n for (const frame of stackFrames) {\n frames.push({\n name: (frame.func || ANONYMOUS).replace('?', ANONYMOUS),\n parameters: getParameters(frame.args),\n file_name: frame.url,\n line_number: frame.line || 0,\n column: frame.column || 0\n });\n }\n\n return frames;\n }\n\n const TRACEKIT_STACK_TRACE_KEY: string = '@@_TraceKit.StackTrace'; // optimization for minifier.\n\n const stackTrace: TraceKit.StackTrace = !!context.contextData[TRACEKIT_STACK_TRACE_KEY]\n ? context.contextData[TRACEKIT_STACK_TRACE_KEY]\n : TraceKit.computeStackTrace(exception, 25);\n\n if (!stackTrace) {\n throw new Error('Unable to parse the exceptions stack trace.');\n }\n\n const message = typeof(exception) === 'string' ? exception as any : undefined;\n return {\n type: stackTrace.name || 'Error',\n message: stackTrace.message || exception.message || message,\n stack_trace: getStackFrames(stackTrace.stack || [])\n };\n }\n}\n\n \n\nexport class DefaultModuleCollector implements IModuleCollector {\n public getModules(context: EventPluginContext): IModule[] {\n if (!document || !document.getElementsByTagName) {\n return null;\n }\n\n const modules: IModule[] = [];\n const scripts: NodeListOf<HTMLScriptElement> = document.getElementsByTagName('script');\n if (scripts && scripts.length > 0) {\n for (let index = 0; index < scripts.length; index++) {\n if (scripts[index].src) {\n modules.push({\n module_id: index,\n name: scripts[index].src.split('?')[0],\n version: Utils.parseVersion(scripts[index].src)\n });\n } else if (!!scripts[index].innerHTML) {\n modules.push({\n module_id: index,\n name: 'Script Tag',\n version: Utils.getHashCode(scripts[index].innerHTML).toString()\n });\n }\n }\n }\n\n return modules;\n }\n}\n\n \n\nexport class DefaultRequestInfoCollector implements IRequestInfoCollector {\n public getRequestInfo(context: EventPluginContext): IRequestInfo {\n if (!document || !navigator || !location) {\n return null;\n }\n\n const exclusions = context.client.config.dataExclusions;\n const requestInfo: IRequestInfo = {\n user_agent: navigator.userAgent,\n is_secure: location.protocol === 'https:',\n host: location.hostname,\n port: location.port && location.port !== '' ? parseInt(location.port, 10) : 80,\n path: location.pathname,\n // client_ip_address: 'TODO',\n cookies: Utils.getCookies(document.cookie, exclusions),\n query_string: Utils.parseQueryString(location.search.substring(1), exclusions)\n };\n\n if (document.referrer && document.referrer !== '') {\n requestInfo.referrer = document.referrer;\n }\n\n return requestInfo;\n }\n}\n\n \n\nexport class BrowserStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(prefix?: string, maxQueueItems: number = 250) {\n this.queue = new BrowserStorage('q', prefix, maxQueueItems);\n this.settings = new BrowserStorage('settings', prefix, 1);\n }\n\n}\n\n \n\n// tslint:disable-next-line:prefer-const\ndeclare var XDomainRequest: { new (); create(); };\n\nexport class DefaultSubmissionAdapter implements ISubmissionAdapter {\n public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) {\n // TODO: Handle sending events when app is exiting with send beacon.\n const TIMEOUT: string = 'timeout'; // optimization for minifier.\n const LOADED: string = 'loaded'; // optimization for minifier.\n const WITH_CREDENTIALS: string = 'withCredentials'; // optimization for minifier.\n\n let isCompleted: boolean = false;\n let useSetTimeout: boolean = false;\n function complete(mode: string, xhr: XMLHttpRequest) {\n function parseResponseHeaders(headerStr) {\n function trim(value) {\n return value.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n\n const headers = {};\n const headerPairs = (headerStr || '').split('\\u000d\\u000a');\n for (const headerPair of headerPairs) {\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n const separator = headerPair.indexOf('\\u003a\\u0020');\n if (separator > 0) {\n headers[trim(headerPair.substring(0, separator).toLowerCase())] = headerPair.substring(separator + 2);\n }\n }\n\n return headers;\n }\n\n if (isCompleted) {\n return;\n }\n\n isCompleted = true;\n\n let message: string = xhr.statusText;\n const responseText: string = xhr.responseText;\n let status: number = xhr.status;\n\n if (mode === TIMEOUT || status === 0) {\n message = 'Unable to connect to server.';\n status = 0;\n } else if (mode === LOADED && !status) {\n status = request.method === 'POST' ? 202 : 200;\n } else if (status < 200 || status > 299) {\n const responseBody: any = (xhr as any).responseBody;\n if (!!responseBody && !!responseBody.message) {\n message = responseBody.message;\n } else if (!!responseText && responseText.indexOf('message') !== -1) {\n try {\n message = JSON.parse(responseText).message;\n } catch (e) {\n message = responseText;\n }\n }\n }\n\n callback && callback(status || 500, message || '', responseText, parseResponseHeaders(xhr.getAllResponseHeaders && xhr.getAllResponseHeaders()));\n }\n\n function createRequest(userAgent: string, method: string, url: string): XMLHttpRequest {\n let xhr: any = new XMLHttpRequest();\n if (WITH_CREDENTIALS in xhr) {\n xhr.open(method, url, true);\n\n xhr.setRequestHeader('X-Exceptionless-Client', userAgent);\n if (method === 'POST') {\n xhr.setRequestHeader('Content-Type', 'application/json');\n }\n } else if (typeof XDomainRequest !== 'undefined') {\n useSetTimeout = true;\n xhr = new XDomainRequest();\n xhr.open(method, location.protocol === 'http:' ? url.replace('https:', 'http:') : url);\n } else {\n xhr = null;\n }\n\n if (xhr) {\n xhr.timeout = 10000;\n }\n\n return xhr;\n }\n\n const url = `${request.url}${(request.url.indexOf('?') === -1 ? '?' : '&')}access_token=${encodeURIComponent(request.apiKey)}`;\n const xhr = createRequest(request.userAgent, request.method || 'POST', url);\n if (!xhr) {\n return (callback && callback(503, 'CORS not supported.'));\n }\n\n if (WITH_CREDENTIALS in xhr) {\n xhr.onreadystatechange = () => {\n // xhr not ready.\n if (xhr.readyState !== 4) {\n return;\n }\n\n complete(LOADED, xhr);\n };\n }\n\n xhr.onprogress = () => { };\n xhr.ontimeout = () => complete(TIMEOUT, xhr);\n xhr.onerror = () => complete('error', xhr);\n xhr.onload = () => complete(LOADED, xhr);\n\n if (useSetTimeout) {\n setTimeout(() => xhr.send(request.data), 500);\n } else {\n xhr.send(request.data);\n }\n }\n}\n\n \n\nexport class NodeFileStorage extends KeyValueStorageBase {\n private directory: string;\n private prefix: string;\n private fs: any;\n\n constructor(namespace: string, folder?: string, prefix: string = 'ex-', maxItems: number = 20, fs?: any) {\n super(maxItems);\n\n if (!folder) {\n folder = Path.join(Path.dirname(require.main.filename), '.exceptionless');\n }\n\n const subfolder = Path.join(folder, namespace);\n this.directory = Path.resolve(subfolder);\n this.prefix = prefix;\n this.fs = fs ? fs : Fs;\n\n this.mkdir(this.directory);\n }\n\n public write(key: string, value: string) {\n this.fs.writeFileSync(key, value);\n }\n\n public read(key: string) {\n return this.fs.readFileSync(key, 'utf8');\n }\n\n public readAllKeys() {\n return this.fs.readdirSync(this.directory)\n .filter((file) => file.indexOf(this.prefix) === 0)\n .map((file) => Path.join(this.directory, file));\n }\n\n public delete(key: string) {\n this.fs.unlinkSync(key);\n }\n\n public getKey(timestamp) {\n return Path.join(this.directory, `${this.prefix}${timestamp}.json`);\n }\n\n public getTimestamp(key) {\n return parseInt(Path.basename(key, '.json')\n .substr(this.prefix.length), 10);\n }\n\n private mkdir(path) {\n const dirs = path.split(Path.sep);\n let root = '';\n\n while (dirs.length > 0) {\n const dir = dirs.shift();\n if (dir === '') {\n root = Path.sep;\n }\n if (!this.fs.existsSync(root + dir)) {\n this.fs.mkdirSync(root + dir);\n }\n root += dir + Path.sep;\n }\n }\n}\n\n \n\nexport class NodeEnvironmentInfoCollector implements IEnvironmentInfoCollector {\n public getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo {\n function getIpAddresses(): string {\n const ips: string[] = [];\n const interfaces = os.networkInterfaces();\n Object.keys(interfaces).forEach((name) => {\n interfaces[name].forEach((iface: any) => {\n if ('IPv4' === iface.family && !iface.internal) {\n ips.push(iface.address);\n }\n });\n });\n\n return ips.join(', ');\n }\n\n if (!os) {\n return null;\n }\n\n const environmentInfo: IEnvironmentInfo = {\n processor_count: os.cpus().length,\n total_physical_memory: os.totalmem(),\n available_physical_memory: os.freemem(),\n command_line: process.argv.join(' '),\n process_name: (process.title || '').replace(/[\\uE000-\\uF8FF]/g, ''),\n process_id: process.pid + '',\n process_memory_size: process.memoryUsage().heapTotal,\n // thread_id: '',\n architecture: os.arch(),\n o_s_name: os.type(),\n o_s_version: os.release(),\n ip_address: getIpAddresses(),\n machine_name: os.hostname(),\n // install_id: '',\n runtime_version: process.version,\n data: {\n loadavg: os.loadavg(),\n platform: os.platform(),\n tmpdir: os.tmpdir(),\n uptime: os.uptime()\n }\n };\n\n if ((os as any).endianness) {\n environmentInfo.data.endianness = (os as any).endianness();\n }\n\n return environmentInfo;\n }\n}\n\n \n\nexport class NodeErrorParser implements IErrorParser {\n public parse(context: EventPluginContext, exception: Error): IError {\n function getStackFrames(stackFrames: any[]): IStackFrame[] {\n const frames: IStackFrame[] = [];\n\n for (const frame of stackFrames) {\n frames.push({\n name: frame.getMethodName() || frame.getFunctionName(),\n // parameters: frame.args,\n file_name: frame.getFileName(),\n line_number: frame.getLineNumber() || 0,\n column: frame.getColumnNumber() || 0,\n declaring_type: frame.getTypeName(),\n data: {\n is_native: frame.isNative() || (!!frame.filename && frame.filename[0] !== '/' && frame.filename[0] !== '.')\n }\n });\n }\n\n return frames;\n }\n\n if (!nodestacktrace) {\n throw new Error('Unable to load the stack trace library.');\n }\n\n const stackFrames = nodestacktrace.parse(exception) || [];\n return {\n type: exception.name || 'Error',\n message: exception.message,\n stack_trace: getStackFrames(stackFrames)\n };\n }\n}\n\n \n\nexport class NodeModuleCollector implements IModuleCollector {\n\n private initialized: boolean = false;\n private installedModules: { [id: string]: IModule } = {};\n\n public getModules(context: EventPluginContext): IModule[] {\n this.initialize();\n\n if (!require.main) {\n return [];\n }\n\n const modulePath = path.dirname(require.main.filename) + '/node_modules/';\n const pathLength = modulePath.length;\n\n const loadedKeys = Object.keys(require.cache);\n const loadedModules = {};\n\n loadedKeys.forEach((key) => {\n let id = key.substr(pathLength);\n id = id.substr(0, id.indexOf('/'));\n loadedModules[id] = true;\n });\n\n return Object.keys(loadedModules)\n .map((key) => this.installedModules[key])\n .filter((m) => m !== undefined);\n }\n\n private initialize() {\n if (this.initialized) {\n return;\n }\n\n this.initialized = true;\n\n const output = child.spawnSync('npm', ['ls', '--depth=0', '--json']).stdout;\n\n if (!output) {\n return;\n }\n\n let json;\n try {\n json = JSON.parse(output.toString());\n } catch (e) {\n return;\n }\n\n const items = json.dependencies;\n if (!items) {\n return;\n }\n\n let id = 0;\n this.installedModules = {};\n\n Object.keys(items).forEach((key) => {\n const item = items[key];\n const theModule: IModule = {\n module_id: id++,\n name: key,\n version: item.version\n };\n\n this.installedModules[key] = theModule;\n });\n }\n}\n\n \n\nexport class NodeRequestInfoCollector implements IRequestInfoCollector {\n public getRequestInfo(context: EventPluginContext): IRequestInfo {\n const REQUEST_KEY: string = '@request'; // optimization for minifier.\n if (!context.contextData[REQUEST_KEY]) {\n return null;\n }\n\n const exclusions = context.client.config.dataExclusions;\n\n // TODO: include referrer\n const request = context.contextData[REQUEST_KEY];\n const requestInfo: IRequestInfo = {\n client_ip_address: request.ip,\n user_agent: request.headers['user-agent'],\n is_secure: request.secure,\n http_method: request.method,\n host: request.hostname || request.host,\n path: request.path,\n post_data: JSON.parse(Utils.stringify(request.body || {}, exclusions)),\n cookies: Utils.getCookies(request.headers.cookie, exclusions),\n query_string: JSON.parse(Utils.stringify(request.params || {}, exclusions))\n };\n\n const host = request.headers.host;\n const port: number = host && parseInt(host.slice(host.indexOf(':') + 1), 10);\n if (port > 0) {\n requestInfo.port = port;\n }\n\n return requestInfo;\n }\n}\n\n \n\nexport class NodeFileStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(folder?: string, prefix?: string, maxQueueItems: number = 250) {\n this.queue = new NodeFileStorage('q', folder, prefix, maxQueueItems);\n this.settings = new NodeFileStorage('settings', folder, prefix, 1);\n }\n}\n\n \n\nexport class NodeSubmissionAdapter implements ISubmissionAdapter {\n public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) {\n if (isAppExiting) {\n this.sendRequestSync(request, callback);\n return;\n }\n\n const parsedHost = url.parse(request.url);\n\n const options: https.RequestOptions = {\n auth: `client:${request.apiKey}`,\n headers: {},\n hostname: parsedHost.hostname,\n method: request.method,\n port: parsedHost.port && parseInt(parsedHost.port, 10),\n path: request.url\n };\n\n options.headers['User-Agent'] = request.userAgent;\n\n if (request.method === 'POST') {\n options.headers = {\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(request.data)\n };\n }\n\n const protocol: any = (parsedHost.protocol === 'https' ? https : http);\n const clientRequest: http.ClientRequest = protocol.request(options, (response: http.IncomingMessage) => {\n let body = '';\n response.setEncoding('utf8');\n response.on('data', (chunk) => body += chunk);\n response.on('end', () => this.complete(response, body, response.headers, callback));\n });\n\n clientRequest.on('error', (error: Error) => callback && callback(500, error.message));\n clientRequest.end(request.data);\n }\n\n private complete(response: http.IncomingMessage, responseBody: string, responseHeaders: object, callback: SubmissionCallback): void {\n let message: string;\n if (response.statusCode === 0) {\n message = 'Unable to connect to server.';\n } else if (response.statusCode < 200 || response.statusCode > 299) {\n message = response.statusMessage || ( response as any).message;\n }\n\n callback && callback(response.statusCode || 500, message, responseBody, responseHeaders);\n }\n\n private sendRequestSync(request: SubmissionRequest, callback: SubmissionCallback): void {\n const requestJson = JSON.stringify(request);\n const res = child.spawnSync(process.execPath, [require.resolve('./submitSync.js')],\n {\n input: requestJson,\n stdio: ['pipe', 'pipe', process.stderr]\n });\n\n const out = res.stdout.toString();\n const result = JSON.parse(out);\n\n callback && callback(result.status, result.message, result.data, result.headers);\n }\n}\n\n \n\n(function init() {\n function getDefaultsSettingsFromScriptTag(): IConfigurationSettings {\n if (!document || !document.getElementsByTagName) {\n return null;\n }\n\n const scripts = document.getElementsByTagName('script');\n // tslint:disable-next-line:prefer-for-of\n for (let index = 0; index < scripts.length; index++) {\n if (scripts[index].src && scripts[index].src.indexOf('/exceptionless') > -1) {\n return Utils.parseQueryString(scripts[index].src.split('?').pop());\n }\n }\n return null;\n }\n\n function processUnhandledException(stackTrace: TraceKit.StackTrace, options?: any): void {\n const builder = ExceptionlessClient.default.createUnhandledException(new Error(stackTrace.message || (options || {}).status || 'Script error'), 'onerror');\n builder.pluginContextData['@@_TraceKit.StackTrace'] = stackTrace;\n builder.submit();\n }\n\n if (typeof document === 'undefined') {\n return;\n }\n\n /*\n TODO: We currently are unable to parse string exceptions.\n function processJQueryAjaxError(event, xhr, settings, error:string): void {\n let client = ExceptionlessClient.default;\n if (xhr.status === 404) {\n client.submitNotFound(settings.url);\n } else if (xhr.status !== 401) {\n client.createUnhandledException(error, 'JQuery.ajaxError')\n .setSource(settings.url)\n .setProperty('status', xhr.status)\n .setProperty('request', settings.data)\n .setProperty('response', xhr.responseText && xhr.responseText.slice && xhr.responseText.slice(0, 1024))\n .submit();\n }\n }\n */\n\n Configuration.prototype.useLocalStorage = function() {\n if (BrowserStorage.isAvailable()) {\n this.storage = new BrowserStorageProvider();\n SettingsManager.applySavedServerSettings(this);\n this.changed();\n }\n };\n\n const defaults = Configuration.defaults;\n const settings = getDefaultsSettingsFromScriptTag();\n if (settings && (settings.apiKey || settings.serverUrl)) {\n defaults.apiKey = settings.apiKey;\n defaults.serverUrl = settings.serverUrl;\n }\n\n defaults.errorParser = new DefaultErrorParser();\n defaults.moduleCollector = new DefaultModuleCollector();\n defaults.requestInfoCollector = new DefaultRequestInfoCollector();\n defaults.submissionAdapter = new DefaultSubmissionAdapter();\n\n TraceKit.report.subscribe(processUnhandledException);\n TraceKit.extendToAsynchronousCallbacks();\n\n // window && window.addEventListener && window.addEventListener('beforeunload', function () {\n // ExceptionlessClient.default.config.queue.process(true);\n // });\n\n // if (typeof $ !== 'undefined' && $(document)) {\n // $(document).ajaxError(processJQueryAjaxError);\n // }\n\n (Error as any).stackTraceLimit = Infinity;\n})();\n\n// tslint:disable-next-line:prefer-const\ndeclare var $;\n\n \n\n(function init() {\n if (typeof process === 'undefined') {\n return;\n }\n\n const defaults = Configuration.defaults;\n defaults.environmentInfoCollector = new NodeEnvironmentInfoCollector();\n defaults.errorParser = new NodeErrorParser();\n defaults.moduleCollector = new NodeModuleCollector();\n defaults.requestInfoCollector = new NodeRequestInfoCollector();\n defaults.submissionAdapter = new NodeSubmissionAdapter();\n\n Configuration.prototype.useLocalStorage = function() {\n this.storage = new NodeFileStorageProvider();\n SettingsManager.applySavedServerSettings(this);\n this.changed();\n };\n\n process.addListener('uncaughtException', (error: Error) => {\n ExceptionlessClient.default.submitUnhandledException(error, 'uncaughtException');\n });\n\n process.on('exit', (code: number) => {\n /**\n * exit codes: https://nodejs.org/api/process.html#process_event_exit\n * From now on, only synchronous code may run. As soon as this method\n * ends, the application inevitably will exit.\n */\n function getExitCodeReason(exitCode: number): string {\n if (exitCode === 1) {\n return 'Uncaught Fatal Exception';\n }\n\n if (exitCode === 3) {\n return 'Internal JavaScript Parse Error';\n }\n\n if (exitCode === 4) {\n return 'Internal JavaScript Evaluation Failure';\n }\n\n if (exitCode === 5) {\n return 'Fatal Exception';\n }\n\n if (exitCode === 6) {\n return 'Non-function Internal Exception Handler ';\n }\n\n if (exitCode === 7) {\n return 'Internal Exception Handler Run-Time Failure';\n }\n\n if (exitCode === 8) {\n return 'Uncaught Exception';\n }\n\n if (exitCode === 9) {\n return 'Invalid Argument';\n }\n\n if (exitCode === 10) {\n return 'Internal JavaScript Run-Time Failure';\n }\n\n if (exitCode === 12) {\n return 'Invalid Debug Argument';\n }\n\n return null;\n }\n\n const client = ExceptionlessClient.default;\n const message = getExitCodeReason(code);\n\n if (message !== null) {\n client.submitLog('exit', message, 'Error');\n }\n\n client.config.queue.process(true);\n // Application will now exit.\n });\n\n (Error as any).stackTraceLimit = Infinity;\n})();\n\n \n\n"]} \ No newline at end of file diff --git a/dist/exceptionless.universal.min.js b/dist/exceptionless.universal.min.js deleted file mode 100644 index 073452ec..00000000 --- a/dist/exceptionless.universal.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function r(e){return void 0===e}if(e){var i={},o=e.TraceKit,s=[].slice,a="?",u=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;i.noConflict=function(){return e.TraceKit=o,i},i.wrap=function(e){return function(){try{return e.apply(this,arguments)}catch(e){throw i.report(e),e}}},i.report=function(){function t(e,t,r){var o=null;if(!t||i.collectWindowErrors){for(var s in f)if(n(f,s))try{f[s](e,t,r)}catch(e){o=e}if(o)throw o}}function r(e,n,r,o,a){if(d)i.computeStackTrace.augmentStackTraceWithInitialElement(d,n,r,e),s();else if(a)t(i.computeStackTrace(a),!0,a);else{var l,f={url:n,line:r,column:o},p=e;if("[object String]"==={}.toString.call(e)){var h=e.match(u);h&&(l=h[1],p=h[2])}f.func=i.computeStackTrace.guessFunctionName(f.url,f.line),f.context=i.computeStackTrace.gatherContext(f.url,f.line),t({name:l,message:p,mode:"onerror",stack:[f]},!0,null)}return!!c&&c.apply(this,arguments)}function o(){!0!==l&&(c=e.onerror,e.onerror=r,l=!0)}function s(){var e=d,n=p;d=null,p=null,t(e,!1,n)}function a(e){if(d){if(p===e)return;s()}var t=i.computeStackTrace(e);throw d=t,p=e,setTimeout(function(){p===e&&s()},t.incomplete?2e3:0),e}var c,l,f=[],p=null,d=null;return a.subscribe=function(e){o(),f.push(e)},a.unsubscribe=function(t){for(var n=f.length-1;n>=0;--n)f[n]===t&&f.splice(n,1);0===f.length&&(e.onerror=c,l=!1)},a}(),i.computeStackTrace=function(){function t(t){if(!i.remoteFetching)return"";try{var n=function(){try{return new e.XMLHttpRequest}catch(t){return new e.ActiveXObject("Microsoft.XMLHTTP")}}();return n.open("GET",t,!1),n.send(""),n.responseText}catch(e){return""}}function o(r){if("string"!=typeof r)return[];if(!n(x,r)){var i="",o="";try{o=e.document.domain}catch(e){}var s=/(.*)\:\/\/([^:\/]+)([:\d]*)\/{0,1}([\s\S]*)/.exec(r);s&&s[2]===o&&(i=t(r)),x[r]=i?i.split("\n"):[]}return x[r]}function s(e,t){var n,i=/function ([^(]*)\(([^)]*)\)/,s=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,u="",c=o(e);if(!c.length)return a;for(var l=0;l<10;++l)if(u=c[t-l]+u,!r(u)){if(n=s.exec(u))return n[1];if(n=i.exec(u))return n[1]}return a}function u(e,t){var n=o(e);if(!n.length)return null;var s=[],a=Math.floor(i.linesOfContext/2),u=a+i.linesOfContext%2,c=Math.max(0,t-a-1),l=Math.min(n.length,t+u-1);t-=1;for(var f=c;f<l;++f)r(n[f])||s.push(n[f]);return s.length>0?s:null}function c(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function l(e){return c(e).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function f(e,t){for(var n,r,i=0,s=t.length;i<s;++i)if((n=o(t[i])).length&&(n=n.join("\n"),r=e.exec(n)))return{url:t[i],line:n.substring(0,r.index).split("\n").length,column:r.index-n.lastIndexOf("\n",r.index)-1};return null}function p(e,t,n){var r,i=o(t),s=new RegExp("\\b"+c(e)+"\\b");return n-=1,i&&i.length>n&&(r=s.exec(i[n]))?r.index:null}function d(t){if(!r(e&&e.document)){for(var n,i,o,s,a=[e.location.href],u=e.document.getElementsByTagName("script"),p=""+t,d=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,h=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,g=0;g<u.length;++g){var v=u[g];v.src&&a.push(v.src)}if(o=d.exec(p)){var m=o[1]?"\\s+"+o[1]:"",y=o[2].split(",").join("\\s*,\\s*");n=c(o[3]).replace(/;$/,";?"),i=new RegExp("function"+m+"\\s*\\(\\s*"+y+"\\s*\\)\\s*{\\s*"+n+"\\s*}")}else i=new RegExp(c(p).replace(/\s+/g,"\\s+"));if(s=f(i,a))return s;if(o=h.exec(p)){var b=o[1];if(n=l(o[2]),i=new RegExp("on"+b+"=[\\'\"]\\s*"+n+"\\s*[\\'\"]","i"),s=f(i,a[0]))return s;if(i=new RegExp(n),s=f(i,a))return s}return null}}function h(e){if(!e.stack)return null;for(var t,n,i,o=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,c=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,l=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,f=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,d=/\((\S*)(?::(\d+))(?::(\d+))\)/,h=e.stack.split("\n"),g=[],v=/^(.*) is undefined$/.exec(e.message),m=0,y=h.length;m<y;++m){if(n=o.exec(h[m])){var b=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(t=d.exec(n[2]))&&(n[2]=t[1],n[3]=t[2],n[4]=t[3]),i={url:b?null:n[2],func:n[1]||a,args:b?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=l.exec(h[m]))i={url:n[2],func:n[1]||a,args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=c.exec(h[m])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(t=f.exec(n[3]))?(n[3]=t[1],n[4]=t[2],n[5]=null):0!==m||n[5]||r(e.columnNumber)||(g[0].column=e.columnNumber+1),i={url:n[3],func:n[1]||a,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!i.func&&i.line&&(i.func=s(i.url,i.line)),i.context=i.line?u(i.url,i.line):null,g.push(i)}return g.length?(g[0]&&g[0].line&&!g[0].column&&v&&(g[0].column=p(v[1],g[0].url,g[0].line)),{mode:"stack",name:e.name,message:e.message,stack:g}):null}function g(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),a=[],c=0;c<o.length;c+=2){var l=null;if((n=r.exec(o[c]))?l={url:n[2],line:+n[1],column:null,func:n[3],args:[]}:(n=i.exec(o[c]))&&(l={url:n[6],line:+n[1],column:+n[2],func:n[3]||n[4],args:n[5]?n[5].split(","):[]}),l){if(!l.func&&l.line&&(l.func=s(l.url,l.line)),l.line)try{l.context=u(l.url,l.line)}catch(e){}l.context||(l.context=[o[c+1]]),a.push(l)}}return a.length?{mode:"stacktrace",name:e.name,message:e.message,stack:a}:null}}function v(t){var r=t.message.split("\n");if(r.length<4)return null;var i,a=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,c=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,p=/^\s*Line (\d+) of function script\s*$/i,d=[],h=e&&e.document&&e.document.getElementsByTagName("script"),g=[];for(var v in h)n(h,v)&&!h[v].src&&g.push(h[v]);for(var m=2;m<r.length;m+=2){var y=null;if(i=a.exec(r[m]))y={url:i[2],func:i[3],args:[],line:+i[1],column:null};else if(i=c.exec(r[m])){y={url:i[3],func:i[4],args:[],line:+i[1],column:null};var b=+i[1],S=g[i[2]-1];if(S){var x=o(y.url);if(x){var _=(x=x.join("\n")).indexOf(S.innerText);_>=0&&(y.line=b+x.substring(0,_).split("\n").length)}}}else if(i=p.exec(r[m])){var w=e.location.href.replace(/#.*$/,""),E=f(new RegExp(l(r[m+1])),[w]);y={url:w,func:"",args:[],line:E?E.line:i[1],column:null}}if(y){y.func||(y.func=s(y.url,y.line));var I=u(y.url,y.line),P=I?I[Math.floor(I.length/2)]:null;I&&P.replace(/^\s*/,"")===r[m+1].replace(/^\s*/,"")?y.context=I:y.context=[r[m+1]],d.push(y)}}return d.length?{mode:"multiline",name:t.name,message:r[0],stack:d}:null}function m(e,t,n,r){var i={url:t,line:n};if(i.url&&i.line){e.incomplete=!1,i.func||(i.func=s(i.url,i.line)),i.context||(i.context=u(i.url,i.line));var o=/ '([^']+)' /.exec(r);if(o&&(i.column=p(o[1],i.url,i.line)),e.stack.length>0&&e.stack[0].url===i.url){if(e.stack[0].line===i.line)return!1;if(!e.stack[0].line&&e.stack[0].func===i.func)return e.stack[0].line=i.line,e.stack[0].context=i.context,!1}return e.stack.unshift(i),e.partial=!0,!0}return e.incomplete=!0,!1}function y(e,t){for(var n,r,o,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,c=[],l={},f=!1,h=y.caller;h&&!f;h=h.caller)if(h!==b&&h!==i.report){if(r={url:null,func:a,args:[],line:null,column:null},h.name?r.func=h.name:(n=u.exec(h.toString()))&&(r.func=n[1]),void 0===r.func)try{r.func=n.input.substring(0,n.input.indexOf("{"))}catch(e){}if(o=d(h)){r.url=o.url,r.line=o.line,r.func===a&&(r.func=s(r.url,r.line));var g=/ '([^']+)' /.exec(e.message||e.description);g&&(r.column=p(g[1],o.url,o.line))}l[""+h]?f=!0:l[""+h]=!0,c.push(r)}t&&c.splice(0,t);var v={mode:"callers",name:e.name,message:e.message,stack:c};return m(v,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),v}function b(e,t){var n=null;t=null==t?0:+t;try{if(n=g(e))return n}catch(e){if(S)throw e}try{if(n=h(e))return n}catch(e){if(S)throw e}try{if(n=v(e))return n}catch(e){if(S)throw e}try{if(n=y(e,t+1))return n}catch(e){if(S)throw e}return{name:e.name,message:e.message,mode:"failed"}}var S=!1,x={};return b.augmentStackTraceWithInitialElement=m,b.computeStackTraceFromStackProp=h,b.guessFunctionName=s,b.gatherContext=u,b.ofCaller=function(e){e=1+(null==e?0:+e);try{throw new Error}catch(t){return b(t,e+1)}},b.getSource=o,b}(),i.extendToAsynchronousCallbacks=function(){var t=function(t){var n=e[t];e[t]=function(){var e=s.call(arguments),t=e[0];return"function"==typeof t&&(e[0]=i.wrap(t)),n.apply?n.apply(this,e):n(e[0],e[1])}};t("setTimeout"),t("setInterval")},i.remoteFetching||(i.remoteFetching=!0),i.collectWindowErrors||(i.collectWindowErrors=!0),(!i.linesOfContext||i.linesOfContext<1)&&(i.linesOfContext=11),"function"==typeof define&&define.amd?define("TraceKit",[],i):"undefined"!=typeof module&&module.exports&&e.module!==module?module.exports=i:e.TraceKit=i}}("undefined"!=typeof window?window:global);var exports,require;!function(e,t){"function"==typeof define&&define.amd?define("exceptionless",["require","exports","TraceKit"],t):"object"==typeof exports?module.exports=t(require,exports,require("TraceKit")):e.exceptionless=t(require,exports,e.TraceKit)}(this,function(e,t,n){function r(e,t){var n=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/g;return"string"==typeof t&&n.exec(t)?new Date(t):t}if(!t)var t={};var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();if(Object.defineProperty(t,"__esModule",{value:!0}),e&&"undefined"!=typeof process)var o=e("os"),s=e("stack-trace"),a=e("child_process"),u=e("path"),c=e("fs"),l=e("path"),f=e("http"),p=e("https"),d=e("url");var h=function(){function e(){this._lastReferenceId=null}return e.prototype.getLast=function(){return this._lastReferenceId},e.prototype.clearLast=function(){this._lastReferenceId=null},e.prototype.setLast=function(e){this._lastReferenceId=e},e}();t.DefaultLastReferenceIdManager=h;var g=function(){function e(){}return e.prototype.trace=function(e){this.log("debug",e)},e.prototype.info=function(e){this.log("info",e)},e.prototype.warn=function(e){this.log("warn",e)},e.prototype.error=function(e){this.log("error",e)},e.prototype.log=function(e,t){if(console){var n="["+e+"] Exceptionless: "+t;console[e]?console[e](n):console.log&&console.log(n)}},e}();t.ConsoleLog=g;var v=function(){function e(){}return e.prototype.trace=function(e){},e.prototype.info=function(e){},e.prototype.warn=function(e){},e.prototype.error=function(e){},e}();t.NullLog=v;var m=function(){function e(e){void 0===e&&(e=3e4),this.priority=100,this.name="HeartbeatPlugin",this._interval=e}return e.prototype.run=function(e,t){clearInterval(this._intervalId);var n=e.event.data["@user"];n&&n.identity&&(this._intervalId=setInterval(function(){return e.client.submitSessionHeartbeat(n.identity)},this._interval)),t&&t()},e}();t.HeartbeatPlugin=m;var y=function(){function e(){this.priority=20,this.name="ReferenceIdPlugin"}return e.prototype.run=function(e,t){e.event.reference_id&&0!==e.event.reference_id.length||"error"!==e.event.type||(e.event.reference_id=E.guid().replace("-","").substring(0,10)),t&&t()},e}();t.ReferenceIdPlugin=y;var b=function(){function e(e,t,n){this.client=e,this.event=t,this.contextData=n||new C}return Object.defineProperty(e.prototype,"log",{get:function(){return this.client.config.log},enumerable:!0,configurable:!0}),e}();t.EventPluginContext=b;var S=function(){function e(){}return e.run=function(e,t){var n=function(n,r){return function(){try{e.cancelled||n.run(e,r)}catch(t){e.cancelled=!0,e.log.error("Error running plugin '"+n.name+"': "+t.message+". Discarding Event.")}e.cancelled&&t&&t(e)}},r=e.client.config.plugins,i=[];t&&(i[r.length]=n({name:"cb",priority:9007199254740992,run:t},null));for(var o=r.length-1;o>-1;o--)i[o]=n(r[o],t||o<r.length-1?i[o+1]:null);i[0]()},e.addDefaultPlugins=function(e){e.addPlugin(new U),e.addPlugin(new D),e.addPlugin(new O),e.addPlugin(new N),e.addPlugin(new j),e.addPlugin(new F),e.addPlugin(new A),e.addPlugin(new L)},e}();t.EventPluginManager=S;var x=function(){function e(e){this._handlers=[],this._processingQueue=!1,this._config=e}return e.prototype.enqueue=function(e){var t=this._config,n=t.log;if(t.enabled)if(t.isValid)if(this.areQueuedItemsDiscarded())n.info("Queue items are currently being discarded. The event will not be queued.");else{this.ensureQueueTimer();var r=t.storage.queue.save(e),i="type="+e.type+" "+(e.reference_id?"refid="+e.reference_id:"");r?n.info("Enqueuing event: "+r+" "+i):n.error("Could not enqueue event "+i)}else n.info("Invalid Api Key. The event will not be queued.");else n.info("Configuration is disabled. The event will not be queued.")},e.prototype.process=function(e){var t=this,n=this._config,r=n.log;if(!this._processingQueue)if(r.info("Processing queue..."),n.enabled)if(n.isValid){this._processingQueue=!0,this.ensureQueueTimer();try{var i=n.storage.queue.get(n.submissionBatchSize);if(!i||0===i.length)return void(this._processingQueue=!1);r.info("Sending "+i.length+" events to "+n.serverUrl+"."),n.submissionClient.postEvents(i.map(function(e){return e.value}),n,function(e){t.processSubmissionResponse(e,i),t.eventsPosted(i.map(function(e){return e.value}),e),r.info("Finished processing queue."),t._processingQueue=!1},e)}catch(e){r.error("Error processing queue: "+e),this.suspendProcessing(),this._processingQueue=!1}}else r.info("Invalid Api Key. The queue will not be processed.");else r.info("Configuration is disabled. The queue will not be processed.")},e.prototype.suspendProcessing=function(e,t,n){var r=this._config;(!e||e<=0)&&(e=5),r.log.info("Suspending processing for "+e+" minutes."),this._suspendProcessingUntil=new Date((new Date).getTime()+6e4*e),t&&(this._discardQueuedItemsUntil=this._suspendProcessingUntil),n&&r.storage.queue.clear()},e.prototype.onEventsPosted=function(e){!!e&&this._handlers.push(e)},e.prototype.eventsPosted=function(e,t){for(var n=0,r=this._handlers;n<r.length;n++){var i=r[n];try{i(e,t)}catch(e){this._config.log.error("Error calling onEventsPosted handler: "+e)}}},e.prototype.areQueuedItemsDiscarded=function(){return this._discardQueuedItemsUntil&&this._discardQueuedItemsUntil>new Date},e.prototype.ensureQueueTimer=function(){var e=this;this._queueTimer||(this._queueTimer=setInterval(function(){return e.onProcessQueue()},1e4))},e.prototype.isQueueProcessingSuspended=function(){return this._suspendProcessingUntil&&this._suspendProcessingUntil>new Date},e.prototype.onProcessQueue=function(){this.isQueueProcessingSuspended()||this._processingQueue||this.process()},e.prototype.processSubmissionResponse=function(e,t){var n=this._config,r=n.log;if(e.success)return r.info("Sent "+t.length+" events."),void this.removeEvents(t);if(e.serviceUnavailable)return r.error("Server returned service unavailable."),void this.suspendProcessing();if(e.paymentRequired)return r.info("Too many events have been submitted, please upgrade your plan."),void this.suspendProcessing(null,!0,!0);if(e.unableToAuthenticate)return r.info("Unable to authenticate, please check your configuration. The event will not be submitted."),this.suspendProcessing(15),void this.removeEvents(t);if(e.notFound||e.badRequest)return r.error("Error while trying to submit data: "+e.message),this.suspendProcessing(240),void this.removeEvents(t);if(e.requestEntityTooLarge){var i="Event submission discarded for being too large.";n.submissionBatchSize>1?(r.error(i+" Retrying with smaller batch size."),n.submissionBatchSize=Math.max(1,Math.round(n.submissionBatchSize/1.5))):(r.error(i+" The event will not be submitted."),this.removeEvents(t))}else e.success||(r.error("Error submitting events: "+(e.message||"Please check the network tab for more info.")),this.suspendProcessing())},e.prototype.removeEvents=function(e){for(var t=0;t<(e||[]).length;t++)this._config.storage.queue.remove(e[t].timestamp)},e}();t.DefaultEventQueue=x;var _=function(){return function(e){void 0===e&&(e=250),this.queue=new K(e),this.settings=new K(1)}}();t.InMemoryStorageProvider=_;var w=function(){function e(){this.configurationVersionHeader="x-exceptionless-configversion"}return e.prototype.postEvents=function(e,t,n,r){var i=JSON.stringify(e),o=this.createRequest(t,"POST",t.serverUrl+"/api/v2/events",i),s=this.createSubmissionCallback(t,n);return t.submissionAdapter.sendRequest(o,s,r)},e.prototype.postUserDescription=function(e,t,n,r){var i=n.serverUrl+"/api/v2/events/by-ref/"+encodeURIComponent(e)+"/user-description",o=JSON.stringify(t),s=this.createRequest(n,"POST",i,o),a=this.createSubmissionCallback(n,r);return n.submissionAdapter.sendRequest(s,a)},e.prototype.getSettings=function(e,t,n){var r=this.createRequest(e,"GET",e.serverUrl+"/api/v2/projects/config?v="+t);return e.submissionAdapter.sendRequest(r,function(t,r,i,o){if(200!==t)return n(new q(!1,null,-1,null,r));var s;try{s=JSON.parse(i)}catch(t){e.log.error("Unable to parse settings: '"+i+"'")}if(!s||isNaN(s.version))return n(new q(!1,null,-1,null,"Invalid configuration settings."));n(new q(!0,s.settings||{},s.version))})},e.prototype.sendHeartbeat=function(e,t,n){var r=this.createRequest(n,"GET",n.heartbeatServerUrl+"/api/v2/events/session/heartbeat?id="+e+"&close="+t);n.submissionAdapter.sendRequest(r)},e.prototype.createRequest=function(e,t,n,r){return void 0===r&&(r=null),{method:t,url:n,data:r,apiKey:e.apiKey,userAgent:e.userAgent}},e.prototype.createSubmissionCallback=function(e,t){var n=this;return function(r,i,o,s){var a=s&&parseInt(s[n.configurationVersionHeader],10);I.checkVersion(a,e),t(new P(r,i))}},e}();t.DefaultSubmissionClient=w;var E=function(){function e(){}return e.addRange=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(e||(e=[]),!t||0===t.length)return e;for(var r=0,i=t;r<i.length;r++){var o=i[r];o&&e.indexOf(o)<0&&e.push(o)}return e},e.getHashCode=function(e){if(!e||0===e.length)return 0;for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t},e.getCookies=function(t,n){for(var r={},i=0,o=(t||"").split("; ");i<o.length;i++){var s=o[i].split("=");e.isMatch(s[0],n)||(r[s[0]]=s[1])}return e.isEmpty(r)?null:r},e.guid=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},e.merge=function(e,t){var n={};for(var r in e||{})e[r]&&(n[r]=e[r]);for(var r in t||{})t[r]&&(n[r]=t[r]);return n},e.parseVersion=function(e){if(!e)return null;var t=/(v?((\d+)\.(\d+)(\.(\d+))?)(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?)/.exec(e);return t&&t.length>0?t[0]:null},e.parseQueryString=function(t,n){if(!t||0===t.length)return null;var r=t.split("&");if(0===r.length)return null;for(var i={},o=0,s=r;o<s.length;o++){var a=s[o].split("=");e.isMatch(a[0],n)||(i[decodeURIComponent(a[0])]=decodeURIComponent(a[1]))}return e.isEmpty(i)?null:i},e.randomNumber=function(){return Math.floor(9007199254740992*Math.random())},e.isMatch=function(t,n,r){if(void 0===r&&(r=!0),!t||"string"!=typeof t)return!1;var i=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;return t=(r?t.toLowerCase():t).replace(i,""),(n||[]).some(function(n){if("string"!=typeof n)return!1;if((n=(r?n.toLowerCase():n).replace(i,"")).length<=0)return!1;var o="*"===n[0];o&&(n=n.slice(1));var s="*"===n[n.length-1];return s&&(n=n.substring(0,n.length-1)),o&&s?n.length<=t.length&&-1!==t.indexOf(n,0):o?e.endsWith(t,n):s?e.startsWith(t,n):t===n})},e.isEmpty=function(e){return null===e||"object"==typeof e&&0===Object.keys(e).length},e.startsWith=function(e,t){return e.substring(0,t.length)===t},e.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},e.stringify=function(t,n,r){function i(t,n){var r=[];return JSON.stringify(t,function(t,i){if(!e.isMatch(t,n)){if("object"==typeof i&&i){if(-1!==r.indexOf(i))return;r.push(i)}return i}})}if("[object Object]"==={}.toString.call(t)){var o={};for(var s in t)t[s]!==t&&(o[s]=t[s]);return i(o,n)}if("[object Array]"==={}.toString.call(t)){for(var a=[],u=0;u<t.length;u++)a[u]=JSON.parse(i(t[u],n));return JSON.stringify(a)}return i(t,n)},e.toBoolean=function(e,t){if(void 0===t&&(t=!1),"boolean"==typeof e)return e;if(null===e||"number"!=typeof e&&"string"!=typeof e)return t;switch((e+"").toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case null:return!1}return t},e}();t.Utils=E;var I=function(){function e(){}return e.onChanged=function(e){!!e&&this._handlers.push(e)},e.applySavedServerSettings=function(e){if(e&&e.isValid){var t=this.getSavedServerSettings(e);e.log.info("Applying saved settings: v"+t.version),e.settings=E.merge(e.settings,t.settings),this.changed(e)}},e.getVersion=function(e){return e&&e.isValid?this.getSavedServerSettings(e).version||0:0},e.checkVersion=function(e,t){var n=this.getVersion(t);e<=n||(t.log.info("Updating settings from v"+n+" to v"+e),this.updateSettings(t,n))},e.updateSettings=function(t,n){var r=this;if(t&&t.enabled){t.isValid?((!n||n<0)&&(n=this.getVersion(t)),t.log.info("Checking for updated settings from: v"+n+"."),t.submissionClient.getSettings(t,n,function(n){if(t&&n&&n.success&&n.settings){t.settings=E.merge(t.settings,n.settings);var i=e.getSavedServerSettings(t);for(var o in i)n.settings[o]||delete t.settings[o];var s={version:n.settingsVersion,settings:n.settings};t.storage.settings.save(s),t.log.info("Updated settings: v"+s.version),r.changed(t)}else t.log.warn("Unable to update settings: "+n.message)})):t.log.error("Unable to update settings: ApiKey is not set.")}},e.changed=function(e){for(var t=0,n=this._handlers;t<n.length;t++){var r=n[t];try{r(e)}catch(t){e.log.error("Error calling onChanged handler: "+t)}}},e.getSavedServerSettings=function(e){var t=e.storage.settings.get()[0];return t&&t.value&&t.value.version&&t.value.settings?t.value:{version:0,settings:{}}},e}();I._handlers=[],t.SettingsManager=I;var P=function(){return function(e,t){this.success=!1,this.badRequest=!1,this.serviceUnavailable=!1,this.paymentRequired=!1,this.unableToAuthenticate=!1,this.notFound=!1,this.requestEntityTooLarge=!1,this.statusCode=e,this.message=t,this.success=e>=200&&e<=299,this.badRequest=400===e,this.serviceUnavailable=503===e,this.paymentRequired=402===e,this.unableToAuthenticate=401===e||403===e,this.notFound=404===e,this.requestEntityTooLarge=413===e}}();t.SubmissionResponse=P;var T=function(){function e(e,t){var n=this;this.config=new k("object"==typeof e?e:{apiKey:e,serverUrl:t}),this.updateSettingsTimer(5e3),this.config.onChanged(function(e){return n.updateSettingsTimer(n._timeoutId>0?5e3:0)}),this.config.queue.onEventsPosted(function(e,t){return n.updateSettingsTimer()})}return e.prototype.createException=function(e){var t=new C;return t.setException(e),this.createEvent(t).setType("error")},e.prototype.submitException=function(e,t){this.createException(e).submit(t)},e.prototype.createUnhandledException=function(e,t){var n=this.createException(e);return n.pluginContextData.markAsUnhandledError(),n.pluginContextData.setSubmissionMethod(t),n},e.prototype.submitUnhandledException=function(e,t,n){this.createUnhandledException(e,t).submit(n)},e.prototype.createFeatureUsage=function(e){return this.createEvent().setType("usage").setSource(e)},e.prototype.submitFeatureUsage=function(e,t){this.createFeatureUsage(e).submit(t)},e.prototype.createLog=function(e,t,n){var r=this.createEvent().setType("log");if(n)r=r.setSource(e).setMessage(t).setProperty("@level",n);else if(t)r=r.setSource(e).setMessage(t);else{r=r.setMessage(e);try{var i=this.createLog.caller;r=r.setSource(i&&i.caller&&i.caller.name)}catch(e){this.config.log.trace("Unable to resolve log source: "+e.message)}}return r},e.prototype.submitLog=function(e,t,n,r){this.createLog(e,t,n).submit(r)},e.prototype.createNotFound=function(e){return this.createEvent().setType("404").setSource(e)},e.prototype.submitNotFound=function(e,t){this.createNotFound(e).submit(t)},e.prototype.createSessionStart=function(){return this.createEvent().setType("session")},e.prototype.submitSessionStart=function(e){this.createSessionStart().submit(e)},e.prototype.submitSessionEnd=function(e){e&&(this.config.log.info("Submitting session end: "+e),this.config.submissionClient.sendHeartbeat(e,!0,this.config))},e.prototype.submitSessionHeartbeat=function(e){e&&(this.config.log.info("Submitting session heartbeat: "+e),this.config.submissionClient.sendHeartbeat(e,!1,this.config))},e.prototype.createEvent=function(e){return new R({date:new Date},this,e)},e.prototype.submitEvent=function(e,t,n){function r(e){return e&&(e.cancelled=!0),!!n&&n(e)}var i=new b(this,e,t);return e?this.config.enabled?(e.data||(e.data={}),e.tags&&e.tags.length||(e.tags=[]),void S.run(i,function(e){var t=e.client.config,r=e.event;e.cancelled||(r.type&&0!==r.type.length||(r.type="log"),r.date||(r.date=new Date),t.queue.enqueue(r),r.reference_id&&r.reference_id.length>0&&(e.log.info("Setting last reference id '"+r.reference_id+"'"),t.lastReferenceIdManager.setLast(r.reference_id))),!!n&&n(e)})):(this.config.log.info("Event submission is currently disabled."),r(i)):r(i)},e.prototype.updateUserEmailAndDescription=function(e,t,n,r){var i=this;if(!(e&&t&&n&&this.config.enabled))return!!r&&r(new P(500,"cancelled"));var o={email_address:t,description:n};this.config.submissionClient.postUserDescription(e,o,this.config,function(t){t.success||i.config.log.error("Failed to submit user email and description for event '"+e+"': "+t.statusCode+" "+t.message),!!r&&r(t)})},e.prototype.getLastReferenceId=function(){return this.config.lastReferenceIdManager.getLast()},e.prototype.updateSettingsTimer=function(e){var t=this;this.config.log.info("Updating settings timer with delay: "+e),this._timeoutId=clearTimeout(this._timeoutId),this._timeoutId=clearInterval(this._intervalId);var n=this.config.updateSettingsWhenIdleInterval;if(n>0){var r=function(){return I.updateSettings(t.config)};e>0&&(this._timeoutId=setTimeout(r,e)),this._intervalId=setInterval(r,n)}},Object.defineProperty(e,"default",{get:function(){return null===e._instance&&(e._instance=new e(null)),e._instance},enumerable:!0,configurable:!0}),e}();T._instance=null,t.ExceptionlessClient=T;var C=function(){function e(){}return e.prototype.setException=function(e){e&&(this["@@_Exception"]=e)},Object.defineProperty(e.prototype,"hasException",{get:function(){return!!this["@@_Exception"]},enumerable:!0,configurable:!0}),e.prototype.getException=function(){return this["@@_Exception"]||null},e.prototype.markAsUnhandledError=function(){this["@@_IsUnhandledError"]=!0},Object.defineProperty(e.prototype,"isUnhandledError",{get:function(){return!!this["@@_IsUnhandledError"]},enumerable:!0,configurable:!0}),e.prototype.setSubmissionMethod=function(e){e&&(this["@@_SubmissionMethod"]=e)},e.prototype.getSubmissionMethod=function(){return this["@@_SubmissionMethod"]||null},e}();t.ContextData=C;var k=function(){function e(t){function n(e){return"function"==typeof e?e(this):e}this.defaultTags=[],this.defaultData={},this.enabled=!0,this.lastReferenceIdManager=new h,this.settings={},this._serverUrl="https://collector.exceptionless.io",this._heartbeatServerUrl="https://heartbeat.exceptionless.io",this._updateSettingsWhenIdleInterval=12e4,this._dataExclusions=[],this._userAgentBotPatterns=[],this._plugins=[],this._handlers=[],t=E.merge(e.defaults,t),this.log=n(t.log)||new v,this.apiKey=t.apiKey,this.serverUrl=t.serverUrl,this.heartbeatServerUrl=t.heartbeatServerUrl,this.updateSettingsWhenIdleInterval=t.updateSettingsWhenIdleInterval,this.environmentInfoCollector=n(t.environmentInfoCollector),this.errorParser=n(t.errorParser),this.lastReferenceIdManager=n(t.lastReferenceIdManager)||new h,this.moduleCollector=n(t.moduleCollector),this.requestInfoCollector=n(t.requestInfoCollector),this.submissionBatchSize=n(t.submissionBatchSize)||50,this.submissionAdapter=n(t.submissionAdapter),this.submissionClient=n(t.submissionClient)||new w,this.storage=n(t.storage)||new _,this.queue=n(t.queue)||new x(this),I.applySavedServerSettings(this),S.addDefaultPlugins(this)}return Object.defineProperty(e.prototype,"apiKey",{get:function(){return this._apiKey},set:function(e){this._apiKey=e||null,this.log.info("apiKey: "+this._apiKey),this.changed()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValid",{get:function(){return!!this.apiKey&&this.apiKey.length>=10},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"serverUrl",{get:function(){return this._serverUrl},set:function(e){e&&(this._serverUrl=e,this._heartbeatServerUrl=e,this.log.info("serverUrl: "+e),this.changed())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"heartbeatServerUrl",{get:function(){return this._heartbeatServerUrl},set:function(e){e&&(this._heartbeatServerUrl=e,this.log.info("heartbeatServerUrl: "+e),this.changed())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateSettingsWhenIdleInterval",{get:function(){return this._updateSettingsWhenIdleInterval},set:function(e){"number"==typeof e&&(e<=0?e=-1:e>0&&e<15e3&&(e=15e3),this._updateSettingsWhenIdleInterval=e,this.log.info("updateSettingsWhenIdleInterval: "+e),this.changed())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataExclusions",{get:function(){var e=this.settings["@@DataExclusions"];return this._dataExclusions.concat(e&&e.split(",")||[])},enumerable:!0,configurable:!0}),e.prototype.addDataExclusions=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._dataExclusions=E.addRange.apply(E,[this._dataExclusions].concat(e))},Object.defineProperty(e.prototype,"userAgentBotPatterns",{get:function(){var e=this.settings["@@UserAgentBotPatterns"];return this._userAgentBotPatterns.concat(e&&e.split(",")||[])},enumerable:!0,configurable:!0}),e.prototype.addUserAgentBotPatterns=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userAgentBotPatterns=E.addRange.apply(E,[this._userAgentBotPatterns].concat(e))},Object.defineProperty(e.prototype,"plugins",{get:function(){return this._plugins.sort(function(e,t){return e.priority<t.priority?-1:e.priority>t.priority?1:0})},enumerable:!0,configurable:!0}),e.prototype.addPlugin=function(e,t,n){var r=n?{name:e,priority:t,run:n}:e;if(r&&r.run){r.name||(r.name=E.guid()),r.priority||(r.priority=0);for(var i=!1,o=this._plugins,s=0,a=o;s<a.length;s++)if(a[s].name===r.name){i=!0;break}i||o.push(r)}else this.log.error("Add plugin failed: Run method not defined")},e.prototype.removePlugin=function(e){var t="string"==typeof e?e:e.name;if(t){for(var n=this._plugins,r=0;r<n.length;r++)if(n[r].name===t){n.splice(r,1);break}}else this.log.error("Remove plugin failed: Plugin name not defined")},e.prototype.setVersion=function(e){e&&(this.defaultData["@version"]=e)},e.prototype.setUserIdentity=function(e,t){var n="string"!=typeof e?e:{identity:e,name:t},r=!n||!n.identity&&!n.name;r?delete this.defaultData["@user"]:this.defaultData["@user"]=n,this.log.info("user identity: "+(r?"null":n.identity))},Object.defineProperty(e.prototype,"userAgent",{get:function(){return"exceptionless-universal-js/1.5.4"},enumerable:!0,configurable:!0}),e.prototype.useSessions=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=3e4),e&&this.addPlugin(new m(t))},e.prototype.useReferenceIds=function(){this.addPlugin(new y)},e.prototype.useLocalStorage=function(){},e.prototype.useDebugLogger=function(){this.log=new g},e.prototype.onChanged=function(e){!!e&&this._handlers.push(e)},e.prototype.changed=function(){for(var e=0,t=this._handlers;e<t.length;e++){var n=t[e];try{n(this)}catch(e){this.log.error("Error calling onChanged handler: "+e)}}},Object.defineProperty(e,"defaults",{get:function(){return null===e._defaultSettings&&(e._defaultSettings={}),e._defaultSettings},enumerable:!0,configurable:!0}),e}();k._defaultSettings=null,t.Configuration=k;var q=function(){return function(e,t,n,r,i){void 0===n&&(n=-1),void 0===r&&(r=null),void 0===i&&(i=null),this.success=!1,this.settingsVersion=-1,this.success=e,this.settings=t,this.settingsVersion=n,this.exception=r,this.message=i}}();t.SettingsResponse=q;var R=function(){function e(e,t,n){this._validIdentifierErrorMessage="must contain between 8 and 100 alphanumeric or '-' characters.",this.target=e,this.client=t,this.pluginContextData=n||new C}return e.prototype.setType=function(e){return e&&(this.target.type=e),this},e.prototype.setSource=function(e){return e&&(this.target.source=e),this},e.prototype.setReferenceId=function(e){if(!this.isValidIdentifier(e))throw new Error("ReferenceId "+this._validIdentifierErrorMessage);return this.target.reference_id=e,this},e.prototype.setEventReference=function(e,t){if(!e)throw new Error("Invalid name");if(!t||!this.isValidIdentifier(t))throw new Error("Id "+this._validIdentifierErrorMessage);return this.setProperty("@ref:"+e,t),this},e.prototype.setMessage=function(e){return e&&(this.target.message=e),this},e.prototype.setGeo=function(e,t){if(e<-90||e>90)throw new Error("Must be a valid latitude value between -90.0 and 90.0.");if(t<-180||t>180)throw new Error("Must be a valid longitude value between -180.0 and 180.0.");return this.target.geo=e+","+t,this},e.prototype.setUserIdentity=function(e,t){var n="string"!=typeof e?e:{identity:e,name:t};return n&&(n.identity||n.name)?(this.setProperty("@user",n),this):this},e.prototype.setUserDescription=function(e,t){return e&&t&&this.setProperty("@user_description",{email_address:e,description:t}),this},e.prototype.setManualStackingInfo=function(e,t){if(e){var n={signature_data:e};t&&(n.title=t),this.setProperty("@stack",n)}return this},e.prototype.setManualStackingKey=function(e,t){if(e){var n={ManualStackingKey:e};this.setManualStackingInfo(n,t)}return this},e.prototype.setValue=function(e){return e&&(this.target.value=e),this},e.prototype.addTags=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.target.tags=E.addRange.apply(E,[this.target.tags].concat(e)),this},e.prototype.setProperty=function(e,t,n,r){if(!e||void 0===t||null==t)return this;this.target.data||(this.target.data={});var i=JSON.parse(E.stringify(t,this.client.config.dataExclusions.concat(r||[]),n));return E.isEmpty(i)||(this.target.data[e]=i),this},e.prototype.markAsCritical=function(e){return e&&this.addTags("Critical"),this},e.prototype.addRequestInfo=function(e){return e&&(this.pluginContextData["@request"]=e),this},e.prototype.submit=function(e){this.client.submitEvent(this.target,this.pluginContextData,e)},e.prototype.isValidIdentifier=function(e){if(!e)return!0;if(e.length<8||e.length>100)return!1;for(var t=0;t<e.length;t++){var n=e.charCodeAt(t),r=n>=48&&n<=57,i=n>=65&&n<=90||n>=97&&n<=122,o=45===n;if(!r&&!i&&!o)return!1}return!0},e}();t.EventBuilder=R;var U=function(){function e(){this.priority=10,this.name="ConfigurationDefaultsPlugin"}return e.prototype.run=function(e,t){for(var n=e.client.config,r=0,i=n.defaultTags||[];r<i.length;r++){var o=i[r];o&&e.event.tags.indexOf(o)<0&&e.event.tags.push(o)}var s=n.defaultData||{};for(var a in s)if(s[a]){var u=JSON.parse(E.stringify(s[a],n.dataExclusions));E.isEmpty(u)||(e.event.data[a]=u)}t&&t()},e}();t.ConfigurationDefaultsPlugin=U;var O=function(){function e(e,t){void 0===e&&(e=function(){return Date.now()}),void 0===t&&(t=3e4);var n=this;this.priority=1010,this.name="DuplicateCheckerPlugin",this._mergedEvents=[],this._processedHashcodes=[],this._getCurrentTime=e,this._interval=t,setInterval(function(){for(;n._mergedEvents.length>0;)n._mergedEvents.shift().resubmit()},t)}return e.prototype.run=function(e,t){var n=this,r=function(e){for(var t=0;e;)e.message&&e.message.length&&(t+=397*t^E.getHashCode(e.message)),e.stack_trace&&e.stack_trace.length&&(t+=397*t^E.getHashCode(JSON.stringify(e.stack_trace))),e=e.inner;return t}(e.event.data["@error"]);if(r){var i=e.event.count||1,o=this._getCurrentTime(),s=this._mergedEvents.filter(function(e){return e.hashCode===r})[0];if(s&&(s.incrementCount(i),s.updateDate(e.event.date),e.log.info("Ignoring duplicate event with hash: "+r),e.cancelled=!0),!e.cancelled&&this._processedHashcodes.some(function(e){return e.hash===r&&e.timestamp>=o-n._interval})&&(e.log.trace("Adding event with hash: "+r),this._mergedEvents.push(new M(r,e,i)),e.cancelled=!0),!e.cancelled)for(e.log.trace("Enqueueing event with hash: "+r+"to cache."),this._processedHashcodes.push({hash:r,timestamp:o});this._processedHashcodes.length>50;)this._processedHashcodes.shift()}t&&t()},e}();t.DuplicateCheckerPlugin=O;var M=function(){function e(e,t,n){this.hashCode=e,this._context=t,this._count=n}return e.prototype.incrementCount=function(e){this._count+=e},e.prototype.resubmit=function(){this._context.event.count=this._count,this._context.client.config.queue.enqueue(this._context.event)},e.prototype.updateDate=function(e){e>this._context.event.date&&(this._context.event.date=e)},e}(),A=function(){function e(){this.priority=80,this.name="EnvironmentInfoPlugin"}return e.prototype.run=function(e,t){var n=e.client.config.environmentInfoCollector;if(!e.event.data["@environment"]&&n){var r=n.getEnvironmentInfo(e);r&&(e.event.data["@environment"]=r)}t&&t()},e}();t.EnvironmentInfoPlugin=A;var D=function(){function e(){this.priority=30,this.name="ErrorPlugin"}return e.prototype.run=function(e,t){var n=["arguments","column","columnNumber","description","fileName","message","name","number","line","lineNumber","opera#sourceloc","sourceId","sourceURL","stack","stackArray","stacktrace"],r=e.contextData.getException();if(r&&(e.event.type="error",!e.event.data["@error"])){var i=e.client.config,o=i.errorParser;if(!o)throw new Error("No error parser was defined.");var s=o.parse(e,r);if(s){var a=JSON.parse(E.stringify(r,i.dataExclusions.concat(n)));E.isEmpty(a)||(s.data||(s.data={}),s.data["@ext"]=a),e.event.data["@error"]=s}}t&&t()},e}();t.ErrorPlugin=D;var N=function(){function e(){this.priority=45,this.name="EventExclusionPlugin"}return e.prototype.run=function(e,t){function n(e){switch((e||"").toLowerCase().trim()){case"trace":case"true":case"1":case"yes":return 0;case"debug":return 1;case"info":return 2;case"warn":return 3;case"error":return 4;case"fatal":return 5;case"off":case"false":case"0":case"no":return 6;default:return-1}}function r(e,t,n,r){if(void 0===e&&(e={}),!t)return r;var i="log"===t,o="@@"+t+":",s=e[o+n];if(s)return i?s:E.toBoolean(s);for(var a in e)if(E.startsWith(a.toLowerCase(),o.toLowerCase())&&E.isMatch(n,[a.substring(o.length)]))return i?e[a]:E.toBoolean(e[a]);return r}var i=e.event,o=e.log,s=e.client.config.settings;if("log"===i.type){var a=function(e,t){return void 0===t&&(t="*"),n(r(e,"log",t,"Trace")+"")}(s,i.source),u=n(i.data["@level"]);u>=0&&(u>5||u<a)&&(o.info("Cancelling log event due to minimum log level."),e.cancelled=!0)}else if("error"===i.type)for(var c=i.data["@error"];!e.cancelled&&c;)!1===r(s,i.type,c.type,!0)&&(o.info("Cancelling error from excluded exception type: "+c.type),e.cancelled=!0),c=c.inner;else!1===r(s,i.type,i.source,!0)&&(o.info("Cancelling event from excluded type: "+i.type+" and source: "+i.source),e.cancelled=!0);t&&t()},e}();t.EventExclusionPlugin=N;var j=function(){function e(){this.priority=50,this.name="ModuleInfoPlugin"}return e.prototype.run=function(e,t){var n=e.client.config.moduleCollector;if(e.event.data["@error"]&&!e.event.data["@error"].modules&&n){var r=n.getModules(e);r&&r.length>0&&(e.event.data["@error"].modules=r)}t&&t()},e}();t.ModuleInfoPlugin=j;var F=function(){function e(){this.priority=70,this.name="RequestInfoPlugin"}return e.prototype.run=function(e,t){var n=e.client.config,r=n.requestInfoCollector;if(!e.event.data["@request"]&&r){var i=r.getRequestInfo(e);i&&(E.isMatch(i.user_agent,n.userAgentBotPatterns)?(e.log.info("Cancelling event as the request user agent matches a known bot pattern"),e.cancelled=!0):e.event.data["@request"]=i)}t&&t()},e}();t.RequestInfoPlugin=F;var L=function(){function e(){this.priority=100,this.name="SubmissionMethodPlugin"}return e.prototype.run=function(e,t){var n=e.contextData.getSubmissionMethod();n&&(e.event.data["@submission_method"]=n),t&&t()},e}();t.SubmissionMethodPlugin=L;var K=function(){function e(e){this.items=[],this.lastTimestamp=0,this.maxItems=e}return e.prototype.save=function(e){if(!e)return null;var t=this.items,n=Math.max(Date.now(),this.lastTimestamp+1),r={timestamp:n,value:e};return t.push(r)>this.maxItems&&t.shift(),this.lastTimestamp=n,r.timestamp},e.prototype.get=function(e){return this.items.slice(0,e)},e.prototype.remove=function(e){for(var t=this.items,n=0;n<t.length;n++)if(t[n].timestamp===e)return void t.splice(n,1)},e.prototype.clear=function(){this.items=[]},e}();t.InMemoryStorage=K;var B=function(){function e(e){this.lastTimestamp=0,this.maxItems=e}return e.prototype.save=function(e,t){if(!e)return null;this.ensureIndex();var n=this.items,r=Math.max(Date.now(),this.lastTimestamp+1),i=this.getKey(r),o=JSON.stringify(e);try{this.write(i,o),this.lastTimestamp=r,n.push(r)>this.maxItems&&this.delete(this.getKey(n.shift()))}catch(e){return null}return r},e.prototype.get=function(e){var t=this;return this.ensureIndex(),this.items.slice(0,e).map(function(e){var n=t.getKey(e);try{var i=t.read(n);return{timestamp:e,value:JSON.parse(i,r)}}catch(e){return t.safeDelete(n),null}}).filter(function(e){return null!=e})},e.prototype.remove=function(e){this.ensureIndex();var t=this.items,n=t.indexOf(e);if(n>=0){var r=this.getKey(e);this.safeDelete(r),t.splice(n,1)}},e.prototype.clear=function(){var e=this;this.items.forEach(function(t){return e.safeDelete(e.getKey(t))}),this.items=[]},e.prototype.ensureIndex=function(){this.items||(this.items=this.createIndex(),this.lastTimestamp=Math.max.apply(Math,[0].concat(this.items))+1)},e.prototype.safeDelete=function(e){try{this.delete(e)}catch(e){}},e.prototype.createIndex=function(){var e=this;try{return this.readAllKeys().map(function(t){try{var n=e.getTimestamp(t);return n||(e.safeDelete(t),null)}catch(n){return e.safeDelete(t),null}}).filter(function(e){return null!=e}).sort(function(e,t){return e-t})}catch(e){return[]}},e}();t.KeyValueStorageBase=B;var H=function(e){function t(t,n,r){void 0===n&&(n="com.exceptionless."),void 0===r&&(r=20);var i=e.call(this,r)||this;return i.prefix=n+t+"-",i}return i(t,e),t.isAvailable=function(){try{var e=window.localStorage,t="__storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(e){return!1}},t.prototype.write=function(e,t){window.localStorage.setItem(e,t)},t.prototype.read=function(e){return window.localStorage.getItem(e)},t.prototype.readAllKeys=function(){var e=this;return Object.keys(window.localStorage).filter(function(t){return 0===t.indexOf(e.prefix)})},t.prototype.delete=function(e){window.localStorage.removeItem(e)},t.prototype.getKey=function(e){return this.prefix+e},t.prototype.getTimestamp=function(e){return parseInt(e.substr(this.prefix.length),10)},t}(B);t.BrowserStorage=H;var Q=function(){function e(){}return e.prototype.parse=function(e,t){function r(e){for(var t=[],n=0,r=("string"==typeof e?[e]:e)||[];n<r.length;n++){var i=r[n];t.push({name:i})}return t}var i=e.contextData["@@_TraceKit.StackTrace"]?e.contextData["@@_TraceKit.StackTrace"]:n.computeStackTrace(t,25);if(!i)throw new Error("Unable to parse the exceptions stack trace.");var o="string"==typeof t?t:void 0;return{type:i.name||"Error",message:i.message||t.message||o,stack_trace:function(e){for(var t=[],n=0,i=e;n<i.length;n++){var o=i[n];t.push({name:(o.func||"<anonymous>").replace("?","<anonymous>"),parameters:r(o.args),file_name:o.url,line_number:o.line||0,column:o.column||0})}return t}(i.stack||[])}},e}();t.DefaultErrorParser=Q;var V=function(){function e(){}return e.prototype.getModules=function(e){if(!document||!document.getElementsByTagName)return null;var t=[],n=document.getElementsByTagName("script");if(n&&n.length>0)for(var r=0;r<n.length;r++)n[r].src?t.push({module_id:r,name:n[r].src.split("?")[0],version:E.parseVersion(n[r].src)}):n[r].innerHTML&&t.push({module_id:r,name:"Script Tag",version:E.getHashCode(n[r].innerHTML).toString()});return t},e}();t.DefaultModuleCollector=V;var $=function(){function e(){}return e.prototype.getRequestInfo=function(e){if(!document||!navigator||!location)return null;var t=e.client.config.dataExclusions,n={user_agent:navigator.userAgent,is_secure:"https:"===location.protocol,host:location.hostname,port:location.port&&""!==location.port?parseInt(location.port,10):80,path:location.pathname,cookies:E.getCookies(document.cookie,t),query_string:E.parseQueryString(location.search.substring(1),t)};return document.referrer&&""!==document.referrer&&(n.referrer=document.referrer),n},e}();t.DefaultRequestInfoCollector=$;var J=function(){return function(e,t){void 0===t&&(t=250),this.queue=new H("q",e,t),this.settings=new H("settings",e,1)}}();t.BrowserStorageProvider=J;var z=function(){function e(){}return e.prototype.sendRequest=function(e,t,n){function r(n,r){if(!a){a=!0;var s=r.statusText,u=r.responseText,c=r.status;if(n===i||0===c)s="Unable to connect to server.",c=0;else if(n!==o||c){if(c<200||c>299){var l=r.responseBody;if(l&&l.message)s=l.message;else if(u&&-1!==u.indexOf("message"))try{s=JSON.parse(u).message}catch(e){s=u}}}else c="POST"===e.method?202:200;t&&t(c||500,s||"",u,function(e){for(var t={},n=0,r=(e||"").split("\r\n");n<r.length;n++){var i=r[n],o=i.indexOf(": ");o>0&&(t[i.substring(0,o).toLowerCase().replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")]=i.substring(o+2))}return t}(r.getAllResponseHeaders&&r.getAllResponseHeaders()))}}var i="timeout",o="loaded",s="withCredentials",a=!1,u=!1,c=e.url+(-1===e.url.indexOf("?")?"?":"&")+"access_token="+encodeURIComponent(e.apiKey),l=function(e,t,n){var r=new XMLHttpRequest;return s in r?(r.open(t,n,!0),r.setRequestHeader("X-Exceptionless-Client",e),"POST"===t&&r.setRequestHeader("Content-Type","application/json")):"undefined"!=typeof XDomainRequest?(u=!0,(r=new XDomainRequest).open(t,"http:"===location.protocol?n.replace("https:","http:"):n)):r=null,r&&(r.timeout=1e4),r}(e.userAgent,e.method||"POST",c);if(!l)return t&&t(503,"CORS not supported.");s in l&&(l.onreadystatechange=function(){4===l.readyState&&r(o,l)}),l.onprogress=function(){},l.ontimeout=function(){return r(i,l)},l.onerror=function(){return r("error",l)},l.onload=function(){return r(o,l)},u?setTimeout(function(){return l.send(e.data)},500):l.send(e.data)},e}();t.DefaultSubmissionAdapter=z;var W=function(t){function n(n,r,i,o,s){void 0===i&&(i="ex-"),void 0===o&&(o=20);var a=t.call(this,o)||this;r||(r=l.join(l.dirname(e.main.filename),".exceptionless"));var u=l.join(r,n);return a.directory=l.resolve(u),a.prefix=i,a.fs=s||c,a.mkdir(a.directory),a}return i(n,t),n.prototype.write=function(e,t){this.fs.writeFileSync(e,t)},n.prototype.read=function(e){return this.fs.readFileSync(e,"utf8")},n.prototype.readAllKeys=function(){var e=this;return this.fs.readdirSync(this.directory).filter(function(t){return 0===t.indexOf(e.prefix)}).map(function(t){return l.join(e.directory,t)})},n.prototype.delete=function(e){this.fs.unlinkSync(e)},n.prototype.getKey=function(e){return l.join(this.directory,""+this.prefix+e+".json")},n.prototype.getTimestamp=function(e){return parseInt(l.basename(e,".json").substr(this.prefix.length),10)},n.prototype.mkdir=function(e){for(var t=e.split(l.sep),n="";t.length>0;){var r=t.shift();""===r&&(n=l.sep),this.fs.existsSync(n+r)||this.fs.mkdirSync(n+r),n+=r+l.sep}},n}(B);t.NodeFileStorage=W;var Z=function(){function e(){}return e.prototype.getEnvironmentInfo=function(e){if(!o)return null;var t={processor_count:o.cpus().length,total_physical_memory:o.totalmem(),available_physical_memory:o.freemem(),command_line:process.argv.join(" "),process_name:(process.title||"").replace(/[\uE000-\uF8FF]/g,""),process_id:process.pid+"",process_memory_size:process.memoryUsage().heapTotal,architecture:o.arch(),o_s_name:o.type(),o_s_version:o.release(),ip_address:function(){var e=[],t=o.networkInterfaces();return Object.keys(t).forEach(function(n){t[n].forEach(function(t){"IPv4"!==t.family||t.internal||e.push(t.address)})}),e.join(", ")}(),machine_name:o.hostname(),runtime_version:process.version,data:{loadavg:o.loadavg(),platform:o.platform(),tmpdir:o.tmpdir(),uptime:o.uptime()}};return o.endianness&&(t.data.endianness=o.endianness()),t},e}();t.NodeEnvironmentInfoCollector=Z;var X=function(){function e(){}return e.prototype.parse=function(e,t){if(!s)throw new Error("Unable to load the stack trace library.");var n=s.parse(t)||[];return{type:t.name||"Error",message:t.message,stack_trace:function(e){for(var t=[],n=0,r=e;n<r.length;n++){var i=r[n];t.push({name:i.getMethodName()||i.getFunctionName(),file_name:i.getFileName(),line_number:i.getLineNumber()||0,column:i.getColumnNumber()||0,declaring_type:i.getTypeName(),data:{is_native:i.isNative()||!!i.filename&&"/"!==i.filename[0]&&"."!==i.filename[0]}})}return t}(n)}},e}();t.NodeErrorParser=X;var G=function(){function t(){this.initialized=!1,this.installedModules={}}return t.prototype.getModules=function(t){var n=this;if(this.initialize(),!e.main)return[];var r=(u.dirname(e.main.filename)+"/node_modules/").length,i={};return Object.keys(e.cache).forEach(function(e){var t=e.substr(r);t=t.substr(0,t.indexOf("/")),i[t]=!0}),Object.keys(i).map(function(e){return n.installedModules[e]}).filter(function(e){return void 0!==e})},t.prototype.initialize=function(){var e=this;if(!this.initialized){this.initialized=!0;var t=a.spawnSync("npm",["ls","--depth=0","--json"]).stdout;if(t){var n;try{n=JSON.parse(t.toString())}catch(e){return}var r=n.dependencies;if(r){var i=0;this.installedModules={},Object.keys(r).forEach(function(t){var n=r[t],o={module_id:i++,name:t,version:n.version};e.installedModules[t]=o})}}}},t}();t.NodeModuleCollector=G;var Y=function(){function e(){}return e.prototype.getRequestInfo=function(e){if(!e.contextData["@request"])return null;var t=e.client.config.dataExclusions,n=e.contextData["@request"],r={client_ip_address:n.ip,user_agent:n.headers["user-agent"],is_secure:n.secure,http_method:n.method,host:n.hostname||n.host,path:n.path,post_data:JSON.parse(E.stringify(n.body||{},t)),cookies:E.getCookies(n.headers.cookie,t),query_string:JSON.parse(E.stringify(n.params||{},t))},i=n.headers.host,o=i&&parseInt(i.slice(i.indexOf(":")+1),10);return o>0&&(r.port=o),r},e}();t.NodeRequestInfoCollector=Y;var ee=function(){return function(e,t,n){void 0===n&&(n=250),this.queue=new W("q",e,t,n),this.settings=new W("settings",e,t,1)}}();t.NodeFileStorageProvider=ee;var te=function(){function t(){}return t.prototype.sendRequest=function(e,t,n){var r=this;if(n)this.sendRequestSync(e,t);else{var i=d.parse(e.url),o={auth:"client:"+e.apiKey,headers:{},hostname:i.hostname,method:e.method,port:i.port&&parseInt(i.port,10),path:e.url};o.headers["User-Agent"]=e.userAgent,"POST"===e.method&&(o.headers={"Content-Type":"application/json","Content-Length":Buffer.byteLength(e.data)});var s=("https"===i.protocol?p:f).request(o,function(e){var n="";e.setEncoding("utf8"),e.on("data",function(e){return n+=e}),e.on("end",function(){return r.complete(e,n,e.headers,t)})});s.on("error",function(e){return t&&t(500,e.message)}),s.end(e.data)}},t.prototype.complete=function(e,t,n,r){var i;0===e.statusCode?i="Unable to connect to server.":(e.statusCode<200||e.statusCode>299)&&(i=e.statusMessage||e.message),r&&r(e.statusCode||500,i,t,n)},t.prototype.sendRequestSync=function(t,n){var r=JSON.stringify(t),i=a.spawnSync(process.execPath,[e.resolve("./submitSync.js")],{input:r,stdio:["pipe","pipe",process.stderr]}).stdout.toString(),o=JSON.parse(i);n&&n(o.status,o.message,o.data,o.headers)},t}();return t.NodeSubmissionAdapter=te,function(){if("undefined"!=typeof document){k.prototype.useLocalStorage=function(){H.isAvailable()&&(this.storage=new J,I.applySavedServerSettings(this),this.changed())};var e=k.defaults,t=function(){if(!document||!document.getElementsByTagName)return null;for(var e=document.getElementsByTagName("script"),t=0;t<e.length;t++)if(e[t].src&&e[t].src.indexOf("/exceptionless")>-1)return E.parseQueryString(e[t].src.split("?").pop());return null}();t&&(t.apiKey||t.serverUrl)&&(e.apiKey=t.apiKey,e.serverUrl=t.serverUrl),e.errorParser=new Q,e.moduleCollector=new V,e.requestInfoCollector=new $,e.submissionAdapter=new z,n.report.subscribe(function(e,t){var n=T.default.createUnhandledException(new Error(e.message||(t||{}).status||"Script error"),"onerror");n.pluginContextData["@@_TraceKit.StackTrace"]=e,n.submit()}),n.extendToAsynchronousCallbacks(),Error.stackTraceLimit=1/0}}(),function(){if("undefined"!=typeof process){var e=k.defaults;e.environmentInfoCollector=new Z,e.errorParser=new X,e.moduleCollector=new G,e.requestInfoCollector=new Y,e.submissionAdapter=new te,k.prototype.useLocalStorage=function(){this.storage=new ee,I.applySavedServerSettings(this),this.changed()},process.addListener("uncaughtException",function(e){T.default.submitUnhandledException(e,"uncaughtException")}),process.on("exit",function(e){var t=T.default,n=function(e){return 1===e?"Uncaught Fatal Exception":3===e?"Internal JavaScript Parse Error":4===e?"Internal JavaScript Evaluation Failure":5===e?"Fatal Exception":6===e?"Non-function Internal Exception Handler ":7===e?"Internal Exception Handler Run-Time Failure":8===e?"Uncaught Exception":9===e?"Invalid Argument":10===e?"Internal JavaScript Run-Time Failure":12===e?"Invalid Debug Argument":null}(e);null!==n&&t.submitLog("exit",n,"Error"),t.config.queue.process(!0)}),Error.stackTraceLimit=1/0}}(),t}); -//# sourceMappingURL=exceptionless.universal.min.js.map diff --git a/dist/exceptionless.universal.min.js.map b/dist/exceptionless.universal.min.js.map deleted file mode 100644 index d16954b6..00000000 --- a/dist/exceptionless.universal.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["tracekit.js","exceptionless.universal.ts"],"names":["window","undefined","_has","object","key","Object","prototype","hasOwnProperty","call","_isUndefined","what","TraceKit","_oldTraceKit","_slice","slice","UNKNOWN_FUNCTION","ERROR_TYPES_RE","noConflict","wrap","func","apply","this","arguments","e","report","notifyHandlers","stack","isWindowError","error","exception","collectWindowErrors","i","handlers","inner","traceKitWindowOnError","message","url","lineNo","columnNo","errorObj","lastExceptionStack","computeStackTrace","augmentStackTraceWithInitialElement","processLastException","name","location","line","column","msg","toString","groups","match","guessFunctionName","context","gatherContext","mode","_oldOnerrorHandler","installGlobalHandler","_onErrorHandlerInstalled","onerror","_lastExceptionStack","_lastException","lastException","ex","setTimeout","incomplete","subscribe","handler","push","unsubscribe","length","splice","loadSource","remoteFetching","request","XMLHttpRequest","ActiveXObject","open","send","responseText","getSource","sourceCache","source","domain","document","exec","split","m","reFunctionArgNames","reGuessFunction","linesBefore","Math","floor","linesOfContext","linesAfter","start","max","end","min","escapeRegExp","text","replace","escapeCodeAsRegExpForMatchingInsideHTML","body","findSourceInUrls","re","urls","j","join","substring","index","lastIndexOf","findSourceInLine","fragment","RegExp","findSourceByFunctionBody","parts","result","href","scripts","getElementsByTagName","code","codeRE","eventRE","script","src","args","event","computeStackTraceFromStackProp","submatch","element","chrome","gecko","winjs","geckoEval","chromeEval","lines","reference","isNative","indexOf","columnNumber","computeStackTraceFromStacktraceProp","stacktrace","opera10Regex","opera11Regex","exc","computeStackTraceFromOperaMultiLineMessage","lineRE1","lineRE2","lineRE3","inlineScriptBlocks","s","item","relativeLine","pos","innerText","midline","stackInfo","initial","unshift","partial","computeStackTraceByWalkingCallerChain","depth","functionName","funcs","recursion","curr","caller","input","description","sourceURL","fileName","lineNumber","debug","ofCaller","Error","extendToAsynchronousCallbacks","_helper","fnName","originalFn","originalCallback","define","amd","module","exports","global","parseDate","value","dateRegx","Date","__extends","extendStatics","setPrototypeOf","__proto__","Array","d","b","p","__","constructor","create","require","process","os","child","path","Path","http","DefaultLastReferenceIdManager","_lastReferenceId","getLast","clearLast","setLast","eventId","ConsoleLog","trace","log","info","warn","level","console","NullLog","HeartbeatPlugin","heartbeatInterval","priority","_interval","run","next","clearInterval","_intervalId","user","data","identity","setInterval","client","submitSessionHeartbeat","ReferenceIdPlugin","reference_id","type","Utils","guid","EventPluginContext","contextData","ContextData","defineProperty","config","callback","plugin","cancelled","plugins","wrappedPlugins","EventPluginManager","addDefaultPlugins","addPlugin","ConfigurationDefaultsPlugin","ErrorPlugin","DuplicateCheckerPlugin","EventExclusionPlugin","ModuleInfoPlugin","RequestInfoPlugin","EnvironmentInfoPlugin","SubmissionMethodPlugin","DefaultEventQueue","_handlers","_processingQueue","_config","enqueue","enabled","isValid","areQueuedItemsDiscarded","ensureQueueTimer","timestamp","storage","queue","save","logText","isAppExiting","_this","events_1","get","submissionBatchSize","serverUrl","submissionClient","postEvents","map","response","processSubmissionResponse","eventsPosted","suspendProcessing","durationInMinutes","discardFutureQueuedItems","clearQueue","_suspendProcessingUntil","getTime","_discardQueuedItemsUntil","clear","onEventsPosted","events","_i","handlers_1","_queueTimer","onProcessQueue","isQueueProcessingSuspended","success","removeEvents","serviceUnavailable","paymentRequired","unableToAuthenticate","notFound","badRequest","requestEntityTooLarge","round","remove","maxQueueItems","InMemoryStorage","settings","InMemoryStorageProvider","DefaultSubmissionClient","configurationVersionHeader","JSON","stringify","createRequest","createSubmissionCallback","submissionAdapter","sendRequest","cb","postUserDescription","referenceId","encodeURIComponent","getSettings","version","status","headers","SettingsResponse","parse","isNaN","sendHeartbeat","sessionIdOrUserId","closeSession","heartbeatServerUrl","method","apiKey","userAgent","settingsVersion","parseInt","SubmissionResponse","target","values","_a","values_1","getHashCode","hash","charCodeAt","cookies","exclusions","parts_1","cookie","isMatch","isEmpty","s4","random","merge","defaultValues","parseVersion","matches","query","pairs","pairs_1","decodeURIComponent","patterns","ignoreCase","trim","toLowerCase","some","pattern","startsWithWildcard","endsWithWildcard","endsWith","startsWith","keys","prefix","suffix","maxDepth","stringifyImpl","obj","excludedKeys","cache","flattened","prop","defaultValue","SettingsManager","onChanged","applySavedServerSettings","savedSettings","getSavedServerSettings","changed","getVersion","checkVersion","currentVersion","updateSettings","savedServerSettings","newSettings","unableToUpdateMessage","handlers_2","statusCode","ExceptionlessClient","settingsOrApiKey","Configuration","updateSettingsTimer","_timeoutId","createException","pluginContextData","setException","createEvent","setType","submitException","submit","createUnhandledException","submissionMethod","builder","markAsUnhandledError","setSubmissionMethod","submitUnhandledException","createFeatureUsage","feature","setSource","submitFeatureUsage","createLog","sourceOrMessage","setMessage","setProperty","submitLog","createNotFound","resource","submitNotFound","createSessionStart","submitSessionStart","submitSessionEnd","EventBuilder","date","submitEvent","tags","ctx","ev","lastReferenceIdManager","updateUserEmailAndDescription","email","userDescription","email_address","getLastReferenceId","initialDelay","clearTimeout","interval","updateSettingsWhenIdleInterval","_instance","enumerable","configurable","getException","getSubmissionMethod","configSettings","inject","fn","defaultTags","defaultData","_serverUrl","_heartbeatServerUrl","_updateSettingsWhenIdleInterval","_dataExclusions","_userAgentBotPatterns","_plugins","defaults","environmentInfoCollector","errorParser","moduleCollector","requestInfoCollector","set","_apiKey","concat","addDataExclusions","userAgentBotPatterns","addRange","sort","p1","p2","pluginOrName","pluginAction","pluginExists","plugins_1","removePlugin","setVersion","setUserIdentity","userInfoOrIdentity","shouldRemove","userInfo","useSessions","sendHeartbeats","useReferenceIds","useLocalStorage","useDebugLogger","handlers_3","_defaultSettings","_validIdentifierErrorMessage","setReferenceId","isValidIdentifier","setEventReference","id","setGeo","latitude","longitude","geo","setUserDescription","emailAddress","setManualStackingInfo","signatureData","title","signature_data","setManualStackingKey","manualStackingKey","ManualStackingKey","setValue","addTags","excludedPropertyNames","dataExclusions","markAsCritical","critical","addRequestInfo","isDigit","isLetter","isMinus","defaultTags_1","tag","getCurrentTime","now","_mergedEvents","shift","resubmit","hashCode","stack_trace","count","now_1","_getCurrentTime","merged","filter","incrementCount","updateDate","_processedHashcodes","h","MergedEvent","_context","_count","collector","environmentInfo","getEnvironmentInfo","ignoredProperties","parser","additionalData","getTypeAndSourceSetting","isLog","sourcePrefix","toBoolean","minLogLevel","loggerName","getLogLevel","logLevel","modules","getModules","requestInfo","getRequestInfo","user_agent","maxItems","items","lastTimestamp","limit","KeyValueStorageBase","single","ensureIndex","getKey","json","write","delete","read","safeDelete","forEach","createIndex","readAllKeys","getTimestamp","a","_super","BrowserStorage","namespace","isAvailable","localStorage","x","setItem","removeItem","getItem","substr","DefaultErrorParser","getParameters","parameters","params_1","param","stackTrace","stackFrames","frames","stackFrames_1","frame","file_name","line_number","module_id","innerHTML","DefaultModuleCollector","DefaultRequestInfoCollector","navigator","is_secure","protocol","host","hostname","port","pathname","getCookies","query_string","parseQueryString","search","referrer","BrowserStorageProvider","complete","xhr","isCompleted","statusText","TIMEOUT","LOADED","responseBody","headerStr","headerPairs_1","headerPair","separator","getAllResponseHeaders","WITH_CREDENTIALS","setRequestHeader","XDomainRequest","useSetTimeout","timeout","onreadystatechange","readyState","onprogress","ontimeout","onload","DefaultSubmissionAdapter","NodeFileStorage","folder","fs","dirname","main","filename","subfolder","directory","resolve","Fs","mkdir","writeFileSync","readFileSync","readdirSync","file","unlinkSync","basename","dirs","sep","root","dir","existsSync","mkdirSync","NodeEnvironmentInfoCollector","cpus","totalmem","freemem","argv","process_id","pid","process_memory_size","memoryUsage","heapTotal","architecture","arch","o_s_name","o_s_version","release","ip_address","ips","interfaces","networkInterfaces","iface","family","internal","address","machine_name","runtime_version","loadavg","platform","tmpdir","uptime","endianness","nodestacktrace","stackFrames_2","getMethodName","getFunctionName","getFileName","getLineNumber","getColumnNumber","declaring_type","getTypeName","is_native","NodeErrorParser","NodeModuleCollector","initialized","installedModules","initialize","pathLength","loadedModules","output","spawnSync","stdout","dependencies","theModule","NodeRequestInfoCollector","client_ip_address","ip","secure","http_method","post_data","params","NodeFileStorageProvider","NodeSubmissionAdapter","sendRequestSync","options","auth","parsedHost","Content-Type","Content-Length","Buffer","byteLength","clientRequest","https","setEncoding","on","chunk","responseHeaders","statusMessage","requestJson","out","execPath","stdio","stderr","pop","default","stackTraceLimit","Infinity","addListener","exitCode"],"mappings":"CAKA,SAAAA,EAAAC,GAuBA,SAAAC,EAAAC,EAAAC,GACA,OAAAC,OAAAC,UAAAC,eAAAC,KAAAL,EAAAC,GAUA,SAAAK,EAAAC,GACA,YAAA,IAAAA,EAlCA,GAAAV,EAAA,CAIA,IAAAW,KACAC,EAAAZ,EAAAW,SAGAE,KAAAC,MACAC,EAAA,IAGAC,EAAA,0GA+BAL,EAAAM,WAAA,WAEA,OADAjB,EAAAW,SAAAC,EACAD,GAWAA,EAAAO,KAAA,SAAAC,GASA,OARA,WACA,IACA,OAAAA,EAAAC,MAAAC,KAAAC,WACA,MAAAC,GAEA,MADAZ,EAAAa,OAAAD,GACAA,KAkDAZ,EAAAa,OAAA,WAyCA,SAAAC,EAAAC,EAAAC,EAAAC,GACA,IA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kC,EAAclC,WAE/B6L,EAASE,YAAc,IAAI6H,EAC3B/H,EAASG,gBAAkB,IAAI0I,EAC/B7I,EAASI,qBAAuB,IAAI0I,EACpC9I,EAASnJ,kBAAoB,IAAIqU,EAEjC7nB,EAAAa,OAAc0C,UA7Cd,SAAEwhB,EAAAoI,GAEI,IAAA3T,EAAWd,EAAuB6V,QAAAjV,yBAAA,IAAAlP,MAAA2a,EAAAvjB,UAAA2rB,OAAAnZ,QAAA,gBAAA,WAClCwF,EAAQR,kBAAG,0BAAmC+L,EAChDvL,EAAQH,aA0CLhP,sCACLmkB,gBAAgBC,EAAAA,iBAIlB,GAAoB,oBAAZ1iB,QAAR,CAIA,IAAA4Q,EAAW/D,EAAS+D,WAMlBC,yBAA2B,IAAgByM,IACzCxM,YAAY,IAAOgP,oBACV,IAAAC,IACR/O,qBAAA,IAAA0P,IAEDjZ,kBAAqB,IAAAyZ,KACnBttB,UAAO2e,gBAAA,gBACRjO,QAAA,IAAA2c,KAEWnV,yBAASnX,8BAIrBguB,YAAY,oBAAS,SAAAztB,KACZstB,QAAA5U,yBAAkB1Y,EAAA,+BAG3B4sB,GAAG,OAAC,SAAiB/mB,8BACZ6nB,GACT,OAAC,IAAAA,EAEG,2BAEH,IAAAA,EAEG,kCAEH,IAAAA,EAEG,yCAEH,IAAAA,EAEG,kBAEH,IAAAA,EAEG,2CAEH,IAAAA,EAEU,8CAGE,IAATA,EACU,qBAGG,IAAjBA,EACD,mBAIA,KAAAA,EAEY","file":"exceptionless.universal.min.js","sourcesContent":["/**\n * https://github.com/csnover/TraceKit\n * @license MIT\n * @namespace TraceKit\n */\n(function(window, undefined) {\nif (!window) {\n return;\n}\n\nvar TraceKit = {};\nvar _oldTraceKit = window.TraceKit;\n\n// global reference to slice\nvar _slice = [].slice;\nvar UNKNOWN_FUNCTION = '?';\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types\nvar ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;\n\n/**\n * A better form of hasOwnProperty<br/>\n * Example: `_has(MainHostObject, property) === true/false`\n *\n * @param {Object} object to check property\n * @param {string} key to check\n * @return {Boolean} true if the object has the key and it is not inherited\n */\nfunction _has(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\n/**\n * Returns true if the parameter is undefined<br/>\n * Example: `_isUndefined(val) === true/false`\n *\n * @param {*} what Value to check\n * @return {Boolean} true if undefined and false otherwise\n */\nfunction _isUndefined(what) {\n return typeof what === 'undefined';\n}\n\n/**\n * Export TraceKit out to another variable<br/>\n * Example: `var TK = TraceKit.noConflict()`\n * @return {Object} The TraceKit object\n * @memberof TraceKit\n */\nTraceKit.noConflict = function noConflict() {\n window.TraceKit = _oldTraceKit;\n return TraceKit;\n};\n\n/**\n * Wrap any function in a TraceKit reporter<br/>\n * Example: `func = TraceKit.wrap(func);`\n *\n * @param {Function} func Function to be wrapped\n * @return {Function} The wrapped func\n * @memberof TraceKit\n */\nTraceKit.wrap = function traceKitWrapper(func) {\n function wrapped() {\n try {\n return func.apply(this, arguments);\n } catch (e) {\n TraceKit.report(e);\n throw e;\n }\n }\n return wrapped;\n};\n\n/**\n * Cross-browser processing of unhandled exceptions\n *\n * Syntax:\n * ```js\n * TraceKit.report.subscribe(function(stackInfo) { ... })\n * TraceKit.report.unsubscribe(function(stackInfo) { ... })\n * TraceKit.report(exception)\n * try { ...code... } catch(ex) { TraceKit.report(ex); }\n * ```\n *\n * Supports:\n * - Firefox: full stack trace with line numbers, plus column number\n * on top frame; column number is not guaranteed\n * - Opera: full stack trace with line and column numbers\n * - Chrome: full stack trace with line and column numbers\n * - Safari: line and column number for the top frame only; some frames\n * may be missing, and column number is not guaranteed\n * - IE: line and column number for the top frame only; some frames\n * may be missing, and column number is not guaranteed\n *\n * In theory, TraceKit should work on all of the following versions:\n * - IE5.5+ (only 8.0 tested)\n * - Firefox 0.9+ (only 3.5+ tested)\n * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require\n * Exceptions Have Stacktrace to be enabled in opera:config)\n * - Safari 3+ (only 4+ tested)\n * - Chrome 1+ (only 5+ tested)\n * - Konqueror 3.5+ (untested)\n *\n * Requires TraceKit.computeStackTrace.\n *\n * Tries to catch all unhandled exceptions and report them to the\n * subscribed handlers. Please note that TraceKit.report will rethrow the\n * exception. This is REQUIRED in order to get a useful stack trace in IE.\n * If the exception does not reach the top of the browser, you will only\n * get a stack trace from the point where TraceKit.report was called.\n *\n * Handlers receive a TraceKit.StackTrace object as described in the\n * TraceKit.computeStackTrace docs.\n *\n * @memberof TraceKit\n * @namespace\n */\nTraceKit.report = (function reportModuleWrapper() {\n var handlers = [],\n lastException = null,\n lastExceptionStack = null;\n\n /**\n * Add a crash handler.\n * @param {Function} handler\n * @memberof TraceKit.report\n */\n function subscribe(handler) {\n installGlobalHandler();\n handlers.push(handler);\n }\n\n /**\n * Remove a crash handler.\n * @param {Function} handler\n * @memberof TraceKit.report\n */\n function unsubscribe(handler) {\n for (var i = handlers.length - 1; i >= 0; --i) {\n if (handlers[i] === handler) {\n handlers.splice(i, 1);\n }\n }\n\n if (handlers.length === 0) {\n window.onerror = _oldOnerrorHandler;\n _onErrorHandlerInstalled = false;\n }\n }\n\n /**\n * Dispatch stack information to all handlers.\n * @param {TraceKit.StackTrace} stack\n * @param {boolean} isWindowError Is this a top-level window error?\n * @param {Error=} error The error that's being handled (if available, null otherwise)\n * @memberof TraceKit.report\n * @throws An exception if an error occurs while calling an handler.\n */\n function notifyHandlers(stack, isWindowError, error) {\n var exception = null;\n if (isWindowError && !TraceKit.collectWindowErrors) {\n return;\n }\n for (var i in handlers) {\n if (_has(handlers, i)) {\n try {\n handlers[i](stack, isWindowError, error);\n } catch (inner) {\n exception = inner;\n }\n }\n }\n\n if (exception) {\n throw exception;\n }\n }\n\n var _oldOnerrorHandler, _onErrorHandlerInstalled;\n\n /**\n * Ensures all global unhandled exceptions are recorded.\n * Supported by Gecko and IE.\n * @param {string} message Error message.\n * @param {string} url URL of script that generated the exception.\n * @param {(number|string)} lineNo The line number at which the error occurred.\n * @param {(number|string)=} columnNo The column number at which the error occurred.\n * @param {Error=} errorObj The actual Error object.\n * @memberof TraceKit.report\n */\n function traceKitWindowOnError(message, url, lineNo, columnNo, errorObj) {\n var stack = null;\n\n if (lastExceptionStack) {\n TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);\n \t processLastException();\n } else if (errorObj) {\n stack = TraceKit.computeStackTrace(errorObj);\n notifyHandlers(stack, true, errorObj);\n } else {\n var location = {\n 'url': url,\n 'line': lineNo,\n 'column': columnNo\n };\n\n var name;\n var msg = message; // must be new var or will modify original `arguments`\n if ({}.toString.call(message) === '[object String]') {\n var groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n msg = groups[2];\n }\n }\n\n location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line);\n location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line);\n stack = {\n 'name': name,\n 'message': msg,\n 'mode': 'onerror',\n 'stack': [location]\n };\n\n notifyHandlers(stack, true, null);\n }\n\n if (_oldOnerrorHandler) {\n return _oldOnerrorHandler.apply(this, arguments);\n }\n\n return false;\n }\n\n /**\n * Install a global onerror handler\n * @memberof TraceKit.report\n */\n function installGlobalHandler() {\n if (_onErrorHandlerInstalled === true) {\n return;\n }\n\n _oldOnerrorHandler = window.onerror;\n window.onerror = traceKitWindowOnError;\n _onErrorHandlerInstalled = true;\n }\n\n /**\n * Process the most recent exception\n * @memberof TraceKit.report\n */\n function processLastException() {\n var _lastExceptionStack = lastExceptionStack,\n _lastException = lastException;\n lastExceptionStack = null;\n lastException = null;\n notifyHandlers(_lastExceptionStack, false, _lastException);\n }\n\n /**\n * Reports an unhandled Error to TraceKit.\n * @param {Error} ex\n * @memberof TraceKit.report\n * @throws An exception if an incomplete stack trace is detected (old IE browsers).\n */\n function report(ex) {\n if (lastExceptionStack) {\n if (lastException === ex) {\n return; // already caught by an inner catch block, ignore\n } else {\n processLastException();\n }\n }\n\n var stack = TraceKit.computeStackTrace(ex);\n lastExceptionStack = stack;\n lastException = ex;\n\n // If the stack trace is incomplete, wait for 2 seconds for\n // slow slow IE to see if onerror occurs or not before reporting\n // this exception; otherwise, we will end up with an incomplete\n // stack trace\n setTimeout(function () {\n if (lastException === ex) {\n processLastException();\n }\n }, (stack.incomplete ? 2000 : 0));\n\n throw ex; // re-throw to propagate to the top level (and cause window.onerror)\n }\n\n report.subscribe = subscribe;\n report.unsubscribe = unsubscribe;\n return report;\n}());\n\n/**\n * An object representing a single stack frame.\n * @typedef {Object} StackFrame\n * @property {string} url The JavaScript or HTML file URL.\n * @property {string} func The function name, or empty for anonymous functions (if guessing did not work).\n * @property {string[]?} args The arguments passed to the function, if known.\n * @property {number=} line The line number, if known.\n * @property {number=} column The column number, if known.\n * @property {string[]} context An array of source code lines; the middle element corresponds to the correct line#.\n * @memberof TraceKit\n */\n\n/**\n * An object representing a JavaScript stack trace.\n * @typedef {Object} StackTrace\n * @property {string} name The name of the thrown exception.\n * @property {string} message The exception error message.\n * @property {TraceKit.StackFrame[]} stack An array of stack frames.\n * @property {string} mode 'stack', 'stacktrace', 'multiline', 'callers', 'onerror', or 'failed' -- method used to collect the stack trace.\n * @memberof TraceKit\n */\n\n/**\n * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript\n *\n * Syntax:\n * ```js\n * s = TraceKit.computeStackTrace.ofCaller([depth])\n * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)\n * ```\n *\n * Supports:\n * - Firefox: full stack trace with line numbers and unreliable column\n * number on top frame\n * - Opera 10: full stack trace with line and column numbers\n * - Opera 9-: full stack trace with line numbers\n * - Chrome: full stack trace with line and column numbers\n * - Safari: line and column number for the topmost stacktrace element\n * only\n * - IE: no line numbers whatsoever\n *\n * Tries to guess names of anonymous functions by looking for assignments\n * in the source code. In IE and Safari, we have to guess source file names\n * by searching for function bodies inside all page scripts. This will not\n * work for scripts that are loaded cross-domain.\n * Here be dragons: some function names may be guessed incorrectly, and\n * duplicate functions may be mismatched.\n *\n * TraceKit.computeStackTrace should only be used for tracing purposes.\n * Logging of unhandled exceptions should be done with TraceKit.report,\n * which builds on top of TraceKit.computeStackTrace and provides better\n * IE support by utilizing the window.onerror event to retrieve information\n * about the top of the stack.\n *\n * Note: In IE and Safari, no stack trace is recorded on the Error object,\n * so computeStackTrace instead walks its *own* chain of callers.\n * This means that:\n * * in Safari, some methods may be missing from the stack trace;\n * * in IE, the topmost function in the stack trace will always be the\n * caller of computeStackTrace.\n *\n * This is okay for tracing (because you are likely to be calling\n * computeStackTrace from the function you want to be the topmost element\n * of the stack trace anyway), but not okay for logging unhandled\n * exceptions (because your catch block will likely be far away from the\n * inner function that actually caused the exception).\n *\n * Tracing example:\n * ```js\n * function trace(message) {\n * var stackInfo = TraceKit.computeStackTrace.ofCaller();\n * var data = message + \"\\n\";\n * for(var i in stackInfo.stack) {\n * var item = stackInfo.stack[i];\n * data += (item.func || '[anonymous]') + \"() in \" + item.url + \":\" + (item.line || '0') + \"\\n\";\n * }\n * if (window.console)\n * console.info(data);\n * else\n * alert(data);\n * }\n * ```\n * @memberof TraceKit\n * @namespace\n */\nTraceKit.computeStackTrace = (function computeStackTraceWrapper() {\n var debug = false,\n sourceCache = {};\n\n /**\n * Attempts to retrieve source code via XMLHttpRequest, which is used\n * to look up anonymous function names.\n * @param {string} url URL of source code.\n * @return {string} Source contents.\n * @memberof TraceKit.computeStackTrace\n */\n function loadSource(url) {\n if (!TraceKit.remoteFetching) { //Only attempt request if remoteFetching is on.\n return '';\n }\n try {\n var getXHR = function() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {\n // explicitly bubble up the exception if not found\n return new window.ActiveXObject('Microsoft.XMLHTTP');\n }\n };\n\n var request = getXHR();\n request.open('GET', url, false);\n request.send('');\n return request.responseText;\n } catch (e) {\n return '';\n }\n }\n\n /**\n * Retrieves source code from the source code cache.\n * @param {string} url URL of source code.\n * @return {Array.<string>} Source contents.\n * @memberof TraceKit.computeStackTrace\n */\n function getSource(url) {\n if (typeof url !== 'string') {\n return [];\n }\n\n if (!_has(sourceCache, url)) {\n // URL needs to be able to fetched within the acceptable domain. Otherwise,\n // cross-domain errors will be triggered.\n /*\n Regex matches:\n 0 - Full Url\n 1 - Protocol\n 2 - Domain\n 3 - Port (Useful for internal applications)\n 4 - Path\n */\n var source = '';\n var domain = '';\n try { domain = window.document.domain; } catch (e) { }\n var match = /(.*)\\:\\/\\/([^:\\/]+)([:\\d]*)\\/{0,1}([\\s\\S]*)/.exec(url);\n if (match && match[2] === domain) {\n source = loadSource(url);\n }\n sourceCache[url] = source ? source.split('\\n') : [];\n }\n\n return sourceCache[url];\n }\n\n /**\n * Tries to use an externally loaded copy of source code to determine\n * the name of a function by looking at the name of the variable it was\n * assigned to, if any.\n * @param {string} url URL of source code.\n * @param {(string|number)} lineNo Line number in source code.\n * @return {string} The function name, if discoverable.\n * @memberof TraceKit.computeStackTrace\n */\n function guessFunctionName(url, lineNo) {\n var reFunctionArgNames = /function ([^(]*)\\(([^)]*)\\)/,\n reGuessFunction = /['\"]?([0-9A-Za-z$_]+)['\"]?\\s*[:=]\\s*(function|eval|new Function)/,\n line = '',\n maxLines = 10,\n source = getSource(url),\n m;\n\n if (!source.length) {\n return UNKNOWN_FUNCTION;\n }\n\n // Walk backwards from the first line in the function until we find the line which\n // matches the pattern above, which is the function definition\n for (var i = 0; i < maxLines; ++i) {\n line = source[lineNo - i] + line;\n\n if (!_isUndefined(line)) {\n if ((m = reGuessFunction.exec(line))) {\n return m[1];\n } else if ((m = reFunctionArgNames.exec(line))) {\n return m[1];\n }\n }\n }\n\n return UNKNOWN_FUNCTION;\n }\n\n /**\n * Retrieves the surrounding lines from where an exception occurred.\n * @param {string} url URL of source code.\n * @param {(string|number)} line Line number in source code to center around for context.\n * @return {?Array.<string>} Lines of source code.\n * @memberof TraceKit.computeStackTrace\n */\n function gatherContext(url, line) {\n var source = getSource(url);\n\n if (!source.length) {\n return null;\n }\n\n var context = [],\n // linesBefore & linesAfter are inclusive with the offending line.\n // if linesOfContext is even, there will be one extra line\n // *before* the offending line.\n linesBefore = Math.floor(TraceKit.linesOfContext / 2),\n // Add one extra line if linesOfContext is odd\n linesAfter = linesBefore + (TraceKit.linesOfContext % 2),\n start = Math.max(0, line - linesBefore - 1),\n end = Math.min(source.length, line + linesAfter - 1);\n\n line -= 1; // convert to 0-based index\n\n for (var i = start; i < end; ++i) {\n if (!_isUndefined(source[i])) {\n context.push(source[i]);\n }\n }\n\n return context.length > 0 ? context : null;\n }\n\n /**\n * Escapes special characters, except for whitespace, in a string to be\n * used inside a regular expression as a string literal.\n * @param {string} text The string.\n * @return {string} The escaped string literal.\n * @memberof TraceKit.computeStackTrace\n */\n function escapeRegExp(text) {\n return text.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#]/g, '\\\\$&');\n }\n\n /**\n * Escapes special characters in a string to be used inside a regular\n * expression as a string literal. Also ensures that HTML entities will\n * be matched the same as their literal friends.\n * @param {string} body The string.\n * @return {string} The escaped string.\n * @memberof TraceKit.computeStackTrace\n */\n function escapeCodeAsRegExpForMatchingInsideHTML(body) {\n return escapeRegExp(body).replace('<', '(?:<|<)').replace('>', '(?:>|>)').replace('&', '(?:&|&)').replace('\"', '(?:\"|")').replace(/\\s+/g, '\\\\s+');\n }\n\n /**\n * Determines where a code fragment occurs in the source code.\n * @param {RegExp} re The function definition.\n * @param {Array.<string>} urls A list of URLs to search.\n * @return {?Object.<string, (string|number)>} An object containing\n * the url, line, and column number of the defined function.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceInUrls(re, urls) {\n var source, m;\n for (var i = 0, j = urls.length; i < j; ++i) {\n if ((source = getSource(urls[i])).length) {\n source = source.join('\\n');\n if ((m = re.exec(source))) {\n\n return {\n 'url': urls[i],\n 'line': source.substring(0, m.index).split('\\n').length,\n 'column': m.index - source.lastIndexOf('\\n', m.index) - 1\n };\n }\n }\n }\n\n return null;\n }\n\n /**\n * Determines at which column a code fragment occurs on a line of the\n * source code.\n * @param {string} fragment The code fragment.\n * @param {string} url The URL to search.\n * @param {(string|number)} line The line number to examine.\n * @return {?number} The column number.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceInLine(fragment, url, line) {\n var source = getSource(url),\n re = new RegExp('\\\\b' + escapeRegExp(fragment) + '\\\\b'),\n m;\n\n line -= 1;\n\n if (source && source.length > line && (m = re.exec(source[line]))) {\n return m.index;\n }\n\n return null;\n }\n\n /**\n * Determines where a function was defined within the source code.\n * @param {(Function|string)} func A function reference or serialized\n * function definition.\n * @return {?Object.<string, (string|number)>} An object containing\n * the url, line, and column number of the defined function.\n * @memberof TraceKit.computeStackTrace\n */\n function findSourceByFunctionBody(func) {\n if (_isUndefined(window && window.document)) {\n return;\n }\n\n var urls = [window.location.href],\n scripts = window.document.getElementsByTagName('script'),\n body,\n code = '' + func,\n codeRE = /^function(?:\\s+([\\w$]+))?\\s*\\(([\\w\\s,]*)\\)\\s*\\{\\s*(\\S[\\s\\S]*\\S)\\s*\\}\\s*$/,\n eventRE = /^function on([\\w$]+)\\s*\\(event\\)\\s*\\{\\s*(\\S[\\s\\S]*\\S)\\s*\\}\\s*$/,\n re,\n parts,\n result;\n\n for (var i = 0; i < scripts.length; ++i) {\n var script = scripts[i];\n if (script.src) {\n urls.push(script.src);\n }\n }\n\n if (!(parts = codeRE.exec(code))) {\n re = new RegExp(escapeRegExp(code).replace(/\\s+/g, '\\\\s+'));\n }\n\n // not sure if this is really necessary, but I don’t have a test\n // corpus large enough to confirm that and it was in the original.\n else {\n var name = parts[1] ? '\\\\s+' + parts[1] : '',\n args = parts[2].split(',').join('\\\\s*,\\\\s*');\n\n body = escapeRegExp(parts[3]).replace(/;$/, ';?'); // semicolon is inserted if the function ends with a comment.replace(/\\s+/g, '\\\\s+');\n re = new RegExp('function' + name + '\\\\s*\\\\(\\\\s*' + args + '\\\\s*\\\\)\\\\s*{\\\\s*' + body + '\\\\s*}');\n }\n\n // look for a normal function definition\n if ((result = findSourceInUrls(re, urls))) {\n return result;\n }\n\n // look for an old-school event handler function\n if ((parts = eventRE.exec(code))) {\n var event = parts[1];\n body = escapeCodeAsRegExpForMatchingInsideHTML(parts[2]);\n\n // look for a function defined in HTML as an onXXX handler\n re = new RegExp('on' + event + '=[\\\\\\'\"]\\\\s*' + body + '\\\\s*[\\\\\\'\"]', 'i');\n\n if ((result = findSourceInUrls(re, urls[0]))) {\n return result;\n }\n\n // look for ???\n re = new RegExp(body);\n\n if ((result = findSourceInUrls(re, urls))) {\n return result;\n }\n }\n\n return null;\n }\n\n // Contents of Exception in various browsers.\n //\n // SAFARI:\n // ex.message = Can't find variable: qq\n // ex.line = 59\n // ex.sourceId = 580238192\n // ex.sourceURL = http://...\n // ex.expressionBeginOffset = 96\n // ex.expressionCaretOffset = 98\n // ex.expressionEndOffset = 98\n // ex.name = ReferenceError\n //\n // FIREFOX:\n // ex.message = qq is not defined\n // ex.fileName = http://...\n // ex.lineNumber = 59\n // ex.columnNumber = 69\n // ex.stack = ...stack trace... (see the example below)\n // ex.name = ReferenceError\n //\n // CHROME:\n // ex.message = qq is not defined\n // ex.name = ReferenceError\n // ex.type = not_defined\n // ex.arguments = ['aa']\n // ex.stack = ...stack trace...\n //\n // INTERNET EXPLORER:\n // ex.message = ...\n // ex.name = ReferenceError\n //\n // OPERA:\n // ex.message = ...message... (see the example below)\n // ex.name = ReferenceError\n // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)\n // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'\n\n /**\n * Computes stack trace information from the stack property.\n * Chrome and Gecko use this property.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromStackProp(ex) {\n if (!ex.stack) {\n return null;\n }\n\n var chrome = /^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\/).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i,\n gecko = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i,\n winjs = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i,\n\n // Used to additionally parse URL/line/column from eval frames\n isEval,\n geckoEval = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i,\n chromeEval = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/,\n\n lines = ex.stack.split('\\n'),\n stack = [],\n submatch,\n parts,\n element,\n reference = /^(.*) is undefined$/.exec(ex.message);\n\n for (var i = 0, j = lines.length; i < j; ++i) {\n if ((parts = chrome.exec(lines[i]))) {\n var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n if (isEval && (submatch = chromeEval.exec(parts[2]))) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n parts[3] = submatch[2]; // line\n parts[4] = submatch[3]; // column\n }\n element = {\n 'url': !isNative ? parts[2] : null,\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': isNative ? [parts[2]] : [],\n 'line': parts[3] ? +parts[3] : null,\n 'column': parts[4] ? +parts[4] : null\n };\n } else if ( parts = winjs.exec(lines[i]) ) {\n element = {\n 'url': parts[2],\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': [],\n 'line': +parts[3],\n 'column': parts[4] ? +parts[4] : null\n };\n } else if ((parts = gecko.exec(lines[i]))) {\n isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval && (submatch = geckoEval.exec(parts[3]))) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = null; // no column when eval\n } else if (i === 0 && !parts[5] && !_isUndefined(ex.columnNumber)) {\n // FireFox uses this awesome columnNumber property for its top frame\n // Also note, Firefox's column number is 0-based and everything else expects 1-based,\n // so adding 1\n // NOTE: this hack doesn't work if top-most frame is eval\n stack[0].column = ex.columnNumber + 1;\n }\n element = {\n 'url': parts[3],\n 'func': parts[1] || UNKNOWN_FUNCTION,\n 'args': parts[2] ? parts[2].split(',') : [],\n 'line': parts[4] ? +parts[4] : null,\n 'column': parts[5] ? +parts[5] : null\n };\n } else {\n continue;\n }\n\n if (!element.func && element.line) {\n element.func = guessFunctionName(element.url, element.line);\n }\n\n element.context = element.line ? gatherContext(element.url, element.line) : null;\n stack.push(element);\n }\n\n if (!stack.length) {\n return null;\n }\n\n if (stack[0] && stack[0].line && !stack[0].column && reference) {\n stack[0].column = findSourceInLine(reference[1], stack[0].url, stack[0].line);\n }\n\n return {\n 'mode': 'stack',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n }\n\n /**\n * Computes stack trace information from the stacktrace property.\n * Opera 10+ uses this property.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromStacktraceProp(ex) {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n var stacktrace = ex.stacktrace;\n if (!stacktrace) {\n return;\n }\n\n var opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i,\n opera11Regex = / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^\\)]+))\\((.*)\\))? in (.*):\\s*$/i,\n lines = stacktrace.split('\\n'),\n stack = [],\n parts;\n\n for (var line = 0; line < lines.length; line += 2) {\n var element = null;\n if ((parts = opera10Regex.exec(lines[line]))) {\n element = {\n 'url': parts[2],\n 'line': +parts[1],\n 'column': null,\n 'func': parts[3],\n 'args':[]\n };\n } else if ((parts = opera11Regex.exec(lines[line]))) {\n element = {\n 'url': parts[6],\n 'line': +parts[1],\n 'column': +parts[2],\n 'func': parts[3] || parts[4],\n 'args': parts[5] ? parts[5].split(',') : []\n };\n }\n\n if (element) {\n if (!element.func && element.line) {\n element.func = guessFunctionName(element.url, element.line);\n }\n if (element.line) {\n try {\n element.context = gatherContext(element.url, element.line);\n } catch (exc) {}\n }\n\n if (!element.context) {\n element.context = [lines[line + 1]];\n }\n\n stack.push(element);\n }\n }\n\n if (!stack.length) {\n return null;\n }\n\n return {\n 'mode': 'stacktrace',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n }\n\n /**\n * NOT TESTED.\n * Computes stack trace information from an error message that includes\n * the stack trace.\n * Opera 9 and earlier use this method if the option to show stack\n * traces is turned on in opera:config.\n * @param {Error} ex\n * @return {?TraceKit.StackTrace} Stack information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceFromOperaMultiLineMessage(ex) {\n // TODO: Clean this function up\n // Opera includes a stack trace into the exception message. An example is:\n //\n // Statement on line 3: Undefined variable: undefinedFunc\n // Backtrace:\n // Line 3 of linked script file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.js: In function zzz\n // undefinedFunc(a);\n // Line 7 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function yyy\n // zzz(x, y, z);\n // Line 3 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function xxx\n // yyy(a, a, a);\n // Line 1 of function script\n // try { xxx('hi'); return false; } catch(ex) { TraceKit.report(ex); }\n // ...\n\n var lines = ex.message.split('\\n');\n if (lines.length < 4) {\n return null;\n }\n\n var lineRE1 = /^\\s*Line (\\d+) of linked script ((?:file|https?|blob)\\S+)(?:: in function (\\S+))?\\s*$/i,\n lineRE2 = /^\\s*Line (\\d+) of inline#(\\d+) script in ((?:file|https?|blob)\\S+)(?:: in function (\\S+))?\\s*$/i,\n lineRE3 = /^\\s*Line (\\d+) of function script\\s*$/i,\n stack = [],\n scripts = (window && window.document && window.document.getElementsByTagName('script')),\n inlineScriptBlocks = [],\n parts;\n\n for (var s in scripts) {\n if (_has(scripts, s) && !scripts[s].src) {\n inlineScriptBlocks.push(scripts[s]);\n }\n }\n\n for (var line = 2; line < lines.length; line += 2) {\n var item = null;\n if ((parts = lineRE1.exec(lines[line]))) {\n item = {\n 'url': parts[2],\n 'func': parts[3],\n 'args': [],\n 'line': +parts[1],\n 'column': null\n };\n } else if ((parts = lineRE2.exec(lines[line]))) {\n item = {\n 'url': parts[3],\n 'func': parts[4],\n 'args': [],\n 'line': +parts[1],\n 'column': null // TODO: Check to see if inline#1 (+parts[2]) points to the script number or column number.\n };\n var relativeLine = (+parts[1]); // relative to the start of the <SCRIPT> block\n var script = inlineScriptBlocks[parts[2] - 1];\n if (script) {\n var source = getSource(item.url);\n if (source) {\n source = source.join('\\n');\n var pos = source.indexOf(script.innerText);\n if (pos >= 0) {\n item.line = relativeLine + source.substring(0, pos).split('\\n').length;\n }\n }\n }\n } else if ((parts = lineRE3.exec(lines[line]))) {\n var url = window.location.href.replace(/#.*$/, '');\n var re = new RegExp(escapeCodeAsRegExpForMatchingInsideHTML(lines[line + 1]));\n var src = findSourceInUrls(re, [url]);\n item = {\n 'url': url,\n 'func': '',\n 'args': [],\n 'line': src ? src.line : parts[1],\n 'column': null\n };\n }\n\n if (item) {\n if (!item.func) {\n item.func = guessFunctionName(item.url, item.line);\n }\n var context = gatherContext(item.url, item.line);\n var midline = (context ? context[Math.floor(context.length / 2)] : null);\n if (context && midline.replace(/^\\s*/, '') === lines[line + 1].replace(/^\\s*/, '')) {\n item.context = context;\n } else {\n // if (context) alert(\"Context mismatch. Correct midline:\\n\" + lines[i+1] + \"\\n\\nMidline:\\n\" + midline + \"\\n\\nContext:\\n\" + context.join(\"\\n\") + \"\\n\\nURL:\\n\" + item.url);\n item.context = [lines[line + 1]];\n }\n stack.push(item);\n }\n }\n if (!stack.length) {\n return null; // could not parse multiline exception message as Opera stack trace\n }\n\n return {\n 'mode': 'multiline',\n 'name': ex.name,\n 'message': lines[0],\n 'stack': stack\n };\n }\n\n /**\n * Adds information about the first frame to incomplete stack traces.\n * Safari and IE require this to get complete data on the first frame.\n * @param {TraceKit.StackTrace} stackInfo Stack trace information from\n * one of the compute* methods.\n * @param {string} url The URL of the script that caused an error.\n * @param {(number|string)} lineNo The line number of the script that\n * caused an error.\n * @param {string=} message The error generated by the browser, which\n * hopefully contains the name of the object that caused the error.\n * @return {boolean} Whether or not the stack information was\n * augmented.\n * @memberof TraceKit.computeStackTrace\n */\n function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {\n var initial = {\n 'url': url,\n 'line': lineNo\n };\n\n if (initial.url && initial.line) {\n stackInfo.incomplete = false;\n\n if (!initial.func) {\n initial.func = guessFunctionName(initial.url, initial.line);\n }\n\n if (!initial.context) {\n initial.context = gatherContext(initial.url, initial.line);\n }\n\n var reference = / '([^']+)' /.exec(message);\n if (reference) {\n initial.column = findSourceInLine(reference[1], initial.url, initial.line);\n }\n\n if (stackInfo.stack.length > 0) {\n if (stackInfo.stack[0].url === initial.url) {\n if (stackInfo.stack[0].line === initial.line) {\n return false; // already in stack trace\n } else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) {\n stackInfo.stack[0].line = initial.line;\n stackInfo.stack[0].context = initial.context;\n return false;\n }\n }\n }\n\n stackInfo.stack.unshift(initial);\n stackInfo.partial = true;\n return true;\n } else {\n stackInfo.incomplete = true;\n }\n\n return false;\n }\n\n /**\n * Computes stack trace information by walking the arguments.caller\n * chain at the time the exception occurred. This will cause earlier\n * frames to be missed but is the only way to get any stack trace in\n * Safari and IE. The top frame is restored by\n * {@link augmentStackTraceWithInitialElement}.\n * @param {Error} ex\n * @return {TraceKit.StackTrace=} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceByWalkingCallerChain(ex, depth) {\n var functionName = /function\\s+([_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*)?\\s*\\(/i,\n stack = [],\n funcs = {},\n recursion = false,\n parts,\n item,\n source;\n\n for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) {\n if (curr === computeStackTrace || curr === TraceKit.report) {\n continue;\n }\n\n item = {\n 'url': null,\n 'func': UNKNOWN_FUNCTION,\n 'args': [],\n 'line': null,\n 'column': null\n };\n\n if (curr.name) {\n item.func = curr.name;\n } else if ((parts = functionName.exec(curr.toString()))) {\n item.func = parts[1];\n }\n\n if (typeof item.func === 'undefined') {\n try {\n item.func = parts.input.substring(0, parts.input.indexOf('{'));\n } catch (e) { }\n }\n\n if ((source = findSourceByFunctionBody(curr))) {\n item.url = source.url;\n item.line = source.line;\n\n if (item.func === UNKNOWN_FUNCTION) {\n item.func = guessFunctionName(item.url, item.line);\n }\n\n var reference = / '([^']+)' /.exec(ex.message || ex.description);\n if (reference) {\n item.column = findSourceInLine(reference[1], source.url, source.line);\n }\n }\n\n if (funcs['' + curr]) {\n recursion = true;\n }else{\n funcs['' + curr] = true;\n }\n\n stack.push(item);\n }\n\n if (depth) {\n stack.splice(0, depth);\n }\n\n var result = {\n 'mode': 'callers',\n 'name': ex.name,\n 'message': ex.message,\n 'stack': stack\n };\n augmentStackTraceWithInitialElement(result, ex.sourceURL || ex.fileName, ex.line || ex.lineNumber, ex.message || ex.description);\n return result;\n }\n\n /**\n * Computes a stack trace for an exception.\n * @param {Error} ex\n * @param {(string|number)=} depth\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTrace(ex, depth) {\n var stack = null;\n depth = (depth == null ? 0 : +depth);\n\n try {\n // This must be tried first because Opera 10 *destroys*\n // its stacktrace property if you try to access the stack\n // property first!!\n stack = computeStackTraceFromStacktraceProp(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceFromStackProp(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceFromOperaMultiLineMessage(ex);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n try {\n stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);\n if (stack) {\n return stack;\n }\n } catch (e) {\n if (debug) {\n throw e;\n }\n }\n\n return {\n 'name': ex.name,\n 'message': ex.message,\n 'mode': 'failed'\n };\n }\n\n /**\n * Logs a stacktrace starting from the previous call and working down.\n * @param {(number|string)=} depth How many frames deep to trace.\n * @return {TraceKit.StackTrace} Stack trace information.\n * @memberof TraceKit.computeStackTrace\n */\n function computeStackTraceOfCaller(depth) {\n depth = (depth == null ? 0 : +depth) + 1; // \"+ 1\" because \"ofCaller\" should drop one frame\n try {\n throw new Error();\n } catch (ex) {\n return computeStackTrace(ex, depth + 1);\n }\n }\n\n computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;\n computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;\n computeStackTrace.guessFunctionName = guessFunctionName;\n computeStackTrace.gatherContext = gatherContext;\n computeStackTrace.ofCaller = computeStackTraceOfCaller;\n computeStackTrace.getSource = getSource;\n\n return computeStackTrace;\n}());\n\n/**\n * Extends support for global error handling for asynchronous browser\n * functions. Adopted from Closure Library's errorhandler.js\n * @memberof TraceKit\n */\nTraceKit.extendToAsynchronousCallbacks = function () {\n var _helper = function _helper(fnName) {\n var originalFn = window[fnName];\n window[fnName] = function traceKitAsyncExtension() {\n // Make a copy of the arguments\n var args = _slice.call(arguments);\n var originalCallback = args[0];\n if (typeof (originalCallback) === 'function') {\n args[0] = TraceKit.wrap(originalCallback);\n }\n // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it\n // also only supports 2 argument and doesn't care what \"this\" is, so we\n // can just call the original function directly.\n if (originalFn.apply) {\n return originalFn.apply(this, args);\n } else {\n return originalFn(args[0], args[1]);\n }\n };\n };\n\n _helper('setTimeout');\n _helper('setInterval');\n};\n\n//Default options:\nif (!TraceKit.remoteFetching) {\n TraceKit.remoteFetching = true;\n}\nif (!TraceKit.collectWindowErrors) {\n TraceKit.collectWindowErrors = true;\n}\nif (!TraceKit.linesOfContext || TraceKit.linesOfContext < 1) {\n // 5 lines before, the offending line, 5 lines after\n TraceKit.linesOfContext = 11;\n}\n\n// UMD export\nif (typeof define === 'function' && define.amd) {\n define('TraceKit', [], TraceKit);\n} else if (typeof module !== 'undefined' && module.exports && window.module !== module) {\n module.exports = TraceKit;\n} else {\n window.TraceKit = TraceKit;\n}\n\n}(typeof window !== 'undefined' ? window : global));\n","import * as TraceKit from 'TraceKit';\nimport os = require('os');\nimport nodestacktrace = require('stack-trace');\nimport child = require('child_process');\nimport path = require('path');\nimport * as Fs from 'fs';\nimport * as Path from 'path';\nimport http = require('http');\nimport https = require('https');\nimport url = require('url');\nexport interface ILastReferenceIdManager {\n getLast(): string;\n clearLast(): void;\n setLast(eventId: string): void;\n}\n\nexport interface ILog {\n trace(message: string): void;\n info(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n}\n\n \n\nexport class DefaultLastReferenceIdManager implements ILastReferenceIdManager {\n /**\n * Gets the last event's reference id that was submitted to the server.\n * @type {string}\n * @private\n */\n private _lastReferenceId: string = null;\n\n /**\n * Gets the last event's reference id that was submitted to the server.\n * @returns {string}\n */\n public getLast(): string {\n return this._lastReferenceId;\n }\n\n /**\n * Clears the last event's reference id.\n */\n public clearLast(): void {\n this._lastReferenceId = null;\n }\n\n /**\n * Sets the last event's reference id.\n * @param eventId\n */\n public setLast(eventId: string): void {\n this._lastReferenceId = eventId;\n }\n}\n\n \n\nexport class ConsoleLog implements ILog {\n public trace(message: string): void {\n this.log('debug', message);\n }\n\n public info(message: string): void {\n this.log('info', message);\n }\n\n public warn(message: string): void {\n this.log('warn', message);\n }\n\n public error(message: string): void {\n this.log('error', message);\n }\n\n private log(level: string, message: string) {\n if (console) {\n const msg = `[${level}] Exceptionless: ${message}`;\n\n if (console[level]) {\n console[level](msg);\n } else if (console.log) {\n console[`log`](msg);\n }\n }\n }\n}\n\n \n\nexport class NullLog implements ILog {\n public trace(message: string): void { }\n public info(message: string): void { }\n public warn(message: string): void { }\n public error(message: string): void { }\n}\n\nexport interface IUserInfo {\n identity?: string;\n name?: string;\n data?: any;\n}\n\n \n\nexport class HeartbeatPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = 'HeartbeatPlugin';\n\n private _interval: number;\n private _intervalId: any;\n\n constructor(heartbeatInterval: number = 30000) {\n this._interval = heartbeatInterval;\n }\n\n public run(context: EventPluginContext, next?: () => void): void {\n clearInterval(this._intervalId);\n\n const user: IUserInfo = context.event.data['@user'];\n if (user && user.identity) {\n this._intervalId = setInterval(() => context.client.submitSessionHeartbeat(user.identity), this._interval);\n }\n\n next && next();\n }\n}\n\n \n\nexport class ReferenceIdPlugin implements IEventPlugin {\n public priority: number = 20;\n public name: string = 'ReferenceIdPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n if ((!context.event.reference_id || context.event.reference_id.length === 0) && context.event.type === 'error') {\n context.event.reference_id = Utils.guid().replace('-', '').substring(0, 10);\n }\n\n next && next();\n }\n}\n\n \n\nexport class EventPluginContext {\n public cancelled: boolean;\n public client: ExceptionlessClient;\n public event: IEvent;\n public contextData: ContextData;\n\n constructor(client: ExceptionlessClient, event: IEvent, contextData?: ContextData) {\n this.client = client;\n this.event = event;\n this.contextData = contextData ? contextData : new ContextData();\n }\n\n public get log(): ILog {\n return this.client.config.log;\n }\n}\n\n \n\nexport class EventPluginManager {\n public static run(context: EventPluginContext, callback: (context?: EventPluginContext) => void): void {\n const wrap = (plugin: IEventPlugin, next?: () => void): () => void => {\n return () => {\n try {\n if (!context.cancelled) {\n plugin.run(context, next);\n }\n } catch (ex) {\n context.cancelled = true;\n context.log.error(`Error running plugin '${plugin.name}': ${ex.message}. Discarding Event.`);\n }\n\n if (context.cancelled && !!callback) {\n callback(context);\n }\n };\n };\n\n const plugins: IEventPlugin[] = context.client.config.plugins; // optimization for minifier.\n const wrappedPlugins: Array<() => void> = [];\n if (!!callback) {\n wrappedPlugins[plugins.length] = wrap({ name: 'cb', priority: 9007199254740992, run: callback }, null);\n }\n\n for (let index = plugins.length - 1; index > -1; index--) {\n wrappedPlugins[index] = wrap(plugins[index], !!callback || (index < plugins.length - 1) ? wrappedPlugins[index + 1] : null);\n }\n\n wrappedPlugins[0]();\n }\n\n public static addDefaultPlugins(config: Configuration): void {\n config.addPlugin(new ConfigurationDefaultsPlugin());\n config.addPlugin(new ErrorPlugin());\n config.addPlugin(new DuplicateCheckerPlugin());\n config.addPlugin(new EventExclusionPlugin());\n config.addPlugin(new ModuleInfoPlugin());\n config.addPlugin(new RequestInfoPlugin());\n config.addPlugin(new EnvironmentInfoPlugin());\n config.addPlugin(new SubmissionMethodPlugin());\n }\n}\n\n \n\nexport interface IEventPlugin {\n priority?: number;\n name?: string;\n run(context: EventPluginContext, next?: () => void): void;\n}\n\n \n\nexport class DefaultEventQueue implements IEventQueue {\n /**\n * The configuration object.\n * @type {Configuration}\n * @private\n */\n private _config: Configuration;\n\n /**\n * A list of handlers that will be fired when events are submitted.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(events: IEvent[], response: SubmissionResponse) => void> = [];\n\n /**\n * Suspends processing until the specified time.\n * @type {Date}\n * @private\n */\n private _suspendProcessingUntil: Date;\n\n /**\n * Discards queued items until the specified time.\n * @type {Date}\n * @private\n */\n private _discardQueuedItemsUntil: Date;\n\n /**\n * Returns true if the queue is processing.\n * @type {boolean}\n * @private\n */\n private _processingQueue: boolean = false;\n\n /**\n * Processes the queue every xx seconds.\n * @type {Timer}\n * @private\n */\n private _queueTimer: any;\n\n constructor(config: Configuration) {\n this._config = config;\n }\n\n public enqueue(event: IEvent): void {\n const eventWillNotBeQueued: string = 'The event will not be queued.'; // optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${eventWillNotBeQueued}`);\n return;\n }\n\n if (this.areQueuedItemsDiscarded()) {\n log.info(`Queue items are currently being discarded. ${eventWillNotBeQueued}`);\n return;\n }\n\n this.ensureQueueTimer();\n\n const timestamp = config.storage.queue.save(event);\n const logText = `type=${event.type} ${!!event.reference_id ? 'refid=' + event.reference_id : ''}`;\n if (timestamp) {\n log.info(`Enqueuing event: ${timestamp} ${logText}`);\n } else {\n log.error(`Could not enqueue event ${logText}`);\n }\n }\n\n public process(isAppExiting?: boolean): void {\n const queueNotProcessed: string = 'The queue will not be processed.'; // optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (this._processingQueue) {\n return;\n }\n\n log.info('Processing queue...');\n if (!config.enabled) {\n log.info(`Configuration is disabled. ${queueNotProcessed}`);\n return;\n }\n\n if (!config.isValid) {\n log.info(`Invalid Api Key. ${queueNotProcessed}`);\n return;\n }\n\n this._processingQueue = true;\n this.ensureQueueTimer();\n\n try {\n const events = config.storage.queue.get(config.submissionBatchSize);\n if (!events || events.length === 0) {\n this._processingQueue = false;\n return;\n }\n\n log.info(`Sending ${events.length} events to ${config.serverUrl}.`);\n config.submissionClient.postEvents(events.map((e) => e.value), config, (response: SubmissionResponse) => {\n this.processSubmissionResponse(response, events);\n this.eventsPosted(events.map((e) => e.value), response);\n log.info('Finished processing queue.');\n this._processingQueue = false;\n }, isAppExiting);\n } catch (ex) {\n log.error(`Error processing queue: ${ex}`);\n this.suspendProcessing();\n this._processingQueue = false;\n }\n }\n\n public suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void {\n const config: Configuration = this._config; // Optimization for minifier.\n\n if (!durationInMinutes || durationInMinutes <= 0) {\n durationInMinutes = 5;\n }\n\n config.log.info(`Suspending processing for ${durationInMinutes} minutes.`);\n this._suspendProcessingUntil = new Date(new Date().getTime() + (durationInMinutes * 60000));\n\n if (discardFutureQueuedItems) {\n this._discardQueuedItemsUntil = this._suspendProcessingUntil;\n }\n\n if (clearQueue) {\n // Account is over the limit and we want to ensure that the sample size being sent in will contain newer errors.\n config.storage.queue.clear();\n }\n }\n\n public onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void {\n !!handler && this._handlers.push(handler);\n }\n\n private eventsPosted(events: IEvent[], response: SubmissionResponse) {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(events, response);\n } catch (ex) {\n this._config.log.error(`Error calling onEventsPosted handler: ${ex}`);\n }\n }\n }\n\n private areQueuedItemsDiscarded(): boolean {\n return this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date();\n }\n\n private ensureQueueTimer(): void {\n if (!this._queueTimer) {\n this._queueTimer = setInterval(() => this.onProcessQueue(), 10000);\n }\n }\n\n private isQueueProcessingSuspended(): boolean {\n return this._suspendProcessingUntil && this._suspendProcessingUntil > new Date();\n }\n\n private onProcessQueue(): void {\n if (!this.isQueueProcessingSuspended() && !this._processingQueue) {\n this.process();\n }\n }\n\n private processSubmissionResponse(response: SubmissionResponse, events: IStorageItem[]): void {\n const noSubmission: string = 'The event will not be submitted.'; // Optimization for minifier.\n const config: Configuration = this._config; // Optimization for minifier.\n const log: ILog = config.log; // Optimization for minifier.\n\n if (response.success) {\n log.info(`Sent ${events.length} events.`);\n this.removeEvents(events);\n return;\n }\n\n if (response.serviceUnavailable) {\n // You are currently over your rate limit or the servers are under stress.\n log.error('Server returned service unavailable.');\n this.suspendProcessing();\n return;\n }\n\n if (response.paymentRequired) {\n // If the organization over the rate limit then discard the event.\n log.info('Too many events have been submitted, please upgrade your plan.');\n this.suspendProcessing(null, true, true);\n return;\n }\n\n if (response.unableToAuthenticate) {\n // The api key was suspended or could not be authorized.\n log.info(`Unable to authenticate, please check your configuration. ${noSubmission}`);\n this.suspendProcessing(15);\n this.removeEvents(events);\n return;\n }\n\n if (response.notFound || response.badRequest) {\n // The service end point could not be found.\n log.error(`Error while trying to submit data: ${response.message}`);\n this.suspendProcessing(60 * 4);\n this.removeEvents(events);\n return;\n }\n\n if (response.requestEntityTooLarge) {\n const message = 'Event submission discarded for being too large.';\n if (config.submissionBatchSize > 1) {\n log.error(`${message} Retrying with smaller batch size.`);\n config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5));\n } else {\n log.error(`${message} ${noSubmission}`);\n this.removeEvents(events);\n }\n\n return;\n }\n\n if (!response.success) {\n log.error(`Error submitting events: ${response.message || 'Please check the network tab for more info.'}`);\n this.suspendProcessing();\n }\n }\n\n private removeEvents(events: IStorageItem[]) {\n for (let index = 0; index < (events || []).length; index++) {\n this._config.storage.queue.remove(events[index].timestamp);\n }\n }\n}\n\n \n\nexport interface IEventQueue {\n enqueue(event: IEvent): void;\n process(isAppExiting?: boolean): void;\n suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void;\n onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void;\n}\n\n \n\nexport interface IEnvironmentInfoCollector {\n getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo;\n}\n\n \n\nexport interface IErrorParser {\n parse(context: EventPluginContext, exception: Error): IError;\n}\n\n \n\nexport interface IModuleCollector {\n getModules(context: EventPluginContext): IModule[];\n}\n\n \n\nexport interface IRequestInfoCollector {\n getRequestInfo(context: EventPluginContext): IRequestInfo;\n}\n\n \n\nexport class InMemoryStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(maxQueueItems: number = 250) {\n this.queue = new InMemoryStorage(maxQueueItems);\n this.settings = new InMemoryStorage(1);\n }\n\n}\n\n \n\nexport interface IStorageProvider {\n queue: IStorage;\n settings: IStorage;\n}\n\n \n\n// tslint:disable-next-line:prefer-const\ndeclare var XDomainRequest: { new (); create(); };\n\nexport class DefaultSubmissionClient implements ISubmissionClient {\n public configurationVersionHeader: string = 'x-exceptionless-configversion';\n\n public postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void {\n const data = JSON.stringify(events);\n const request = this.createRequest(config, 'POST', `${config.serverUrl}/api/v2/events`, data);\n const cb = this.createSubmissionCallback(config, callback);\n\n return config.submissionAdapter.sendRequest(request, cb, isAppExiting);\n }\n\n public postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void {\n const path = `${config.serverUrl}/api/v2/events/by-ref/${encodeURIComponent(referenceId)}/user-description`;\n const data = JSON.stringify(description);\n const request = this.createRequest(config, 'POST', path, data);\n const cb = this.createSubmissionCallback(config, callback);\n\n return config.submissionAdapter.sendRequest(request, cb);\n }\n\n public getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void {\n const request = this.createRequest(config, 'GET', `${config.serverUrl}/api/v2/projects/config?v=${version}`);\n const cb = (status, message, data?, headers?) => {\n if (status !== 200) {\n return callback(new SettingsResponse(false, null, -1, null, message));\n }\n\n let settings: IClientConfiguration;\n try {\n settings = JSON.parse(data);\n } catch (e) {\n config.log.error(`Unable to parse settings: '${data}'`);\n }\n\n if (!settings || isNaN(settings.version)) {\n return callback(new SettingsResponse(false, null, -1, null, 'Invalid configuration settings.'));\n }\n\n callback(new SettingsResponse(true, settings.settings || {}, settings.version));\n };\n\n return config.submissionAdapter.sendRequest(request, cb);\n }\n\n public sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void {\n const request = this.createRequest(config, 'GET', `${config.heartbeatServerUrl}/api/v2/events/session/heartbeat?id=${sessionIdOrUserId}&close=${closeSession}`);\n config.submissionAdapter.sendRequest(request);\n }\n\n private createRequest(config: Configuration, method: string, url: string, data: string = null): SubmissionRequest {\n return {\n method,\n url,\n data,\n apiKey: config.apiKey,\n userAgent: config.userAgent\n };\n }\n\n private createSubmissionCallback(config: Configuration, callback: (response: SubmissionResponse) => void) {\n return (status, message, data?, headers?) => {\n const settingsVersion: number = headers && parseInt(headers[this.configurationVersionHeader], 10);\n SettingsManager.checkVersion(settingsVersion, config);\n\n callback(new SubmissionResponse(status, message));\n };\n }\n}\n\n \n\nexport interface ISubmissionAdapter {\n sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void;\n}\n\n \n\nexport interface ISubmissionClient {\n postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void;\n postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void;\n getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void;\n sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void;\n}\n\nexport class Utils {\n public static addRange<T>(target: T[], ...values: T[]) {\n if (!target) {\n target = [];\n }\n\n if (!values || values.length === 0) {\n return target;\n }\n\n for (const value of values) {\n if (value && target.indexOf(value) < 0) {\n target.push(value);\n }\n }\n\n return target;\n }\n\n public static getHashCode(source: string): number {\n if (!source || source.length === 0) {\n return 0;\n }\n\n let hash: number = 0;\n for (let index = 0; index < source.length; index++) {\n const character = source.charCodeAt(index);\n hash = ((hash << 5) - hash) + character;\n hash |= 0;\n }\n\n return hash;\n }\n\n public static getCookies(cookies: string, exclusions?: string[]): object {\n const result: object = {};\n\n const parts: string[] = (cookies || '').split('; ');\n for (const part of parts) {\n const cookie: string[] = part.split('=');\n if (!Utils.isMatch(cookie[0], exclusions)) {\n result[cookie[0]] = cookie[1];\n }\n }\n\n return !Utils.isEmpty(result) ? result : null;\n }\n\n public static guid(): string {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n }\n\n // tslint:disable-next-line:ban-types\n public static merge(defaultValues: Object, values: Object) {\n const result: object = {};\n\n for (const key in defaultValues || {}) {\n if (!!defaultValues[key]) {\n result[key] = defaultValues[key];\n }\n }\n\n for (const key in values || {}) {\n if (!!values[key]) {\n result[key] = values[key];\n }\n }\n\n return result;\n }\n\n public static parseVersion(source: string): string {\n if (!source) {\n return null;\n }\n\n const versionRegex = /(v?((\\d+)\\.(\\d+)(\\.(\\d+))?)(?:-([\\dA-Za-z\\-]+(?:\\.[\\dA-Za-z\\-]+)*))?(?:\\+([\\dA-Za-z\\-]+(?:\\.[\\dA-Za-z\\-]+)*))?)/;\n const matches = versionRegex.exec(source);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n\n return null;\n }\n\n public static parseQueryString(query: string, exclusions?: string[]) {\n if (!query || query.length === 0) {\n return null;\n }\n\n const pairs: string[] = query.split('&');\n if (pairs.length === 0) {\n return null;\n }\n\n const result: object = {};\n for (const pair of pairs) {\n const parts = pair.split('=');\n if (!Utils.isMatch(parts[0], exclusions)) {\n result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);\n }\n }\n\n return !Utils.isEmpty(result) ? result : null;\n }\n\n public static randomNumber(): number {\n return Math.floor(Math.random() * 9007199254740992);\n }\n\n /**\n * Checks to see if a value matches a pattern.\n * @param input the value to check against the @pattern.\n * @param pattern The pattern to check, supports wild cards (*).\n */\n public static isMatch(input: string, patterns: string[], ignoreCase: boolean = true): boolean {\n if (!input || typeof input !== 'string') {\n return false;\n }\n\n const trim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n input = (ignoreCase ? input.toLowerCase() : input).replace(trim, '');\n\n return (patterns || []).some((pattern) => {\n if (typeof pattern !== 'string') {\n return false;\n }\n\n pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, '');\n if (pattern.length <= 0) {\n return false;\n }\n\n const startsWithWildcard: boolean = pattern[0] === '*';\n if (startsWithWildcard) {\n pattern = pattern.slice(1);\n }\n\n const endsWithWildcard: boolean = pattern[pattern.length - 1] === '*';\n if (endsWithWildcard) {\n pattern = pattern.substring(0, pattern.length - 1);\n }\n\n if (startsWithWildcard && endsWithWildcard) {\n return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1;\n }\n\n if (startsWithWildcard) {\n return Utils.endsWith(input, pattern);\n }\n\n if (endsWithWildcard) {\n return Utils.startsWith(input, pattern);\n }\n\n return input === pattern;\n });\n }\n\n public static isEmpty(input: object) {\n return input === null || (typeof (input) === 'object' && Object.keys(input).length === 0);\n }\n\n public static startsWith(input: string, prefix: string): boolean {\n return input.substring(0, prefix.length) === prefix;\n }\n\n public static endsWith(input: string, suffix: string): boolean {\n return input.indexOf(suffix, input.length - suffix.length) !== -1;\n }\n\n /**\n * Stringifys an object with optional exclusions and max depth.\n * @param data The data object to add.\n * @param exclusions Any property names that should be excluded.\n * @param maxDepth The max depth of the object to include.\n */\n public static stringify(data: any, exclusions?: string[], maxDepth?: number): string {\n function stringifyImpl(obj: any, excludedKeys: string[]): string {\n const cache: string[] = [];\n return JSON.stringify(obj, (key: string, value: any) => {\n if (Utils.isMatch(key, excludedKeys)) {\n return;\n }\n\n if (typeof value === 'object' && !!value) {\n if (cache.indexOf(value) !== -1) {\n // Circular reference found, discard key\n return;\n }\n\n cache.push(value);\n }\n\n return value;\n });\n }\n\n if (({}).toString.call(data) === '[object Object]') {\n const flattened = {};\n /* tslint:disable:forin */\n for (const prop in data) {\n const value = data[prop];\n if (value === data) {\n continue;\n }\n flattened[prop] = data[prop];\n }\n /* tslint:enable:forin */\n\n return stringifyImpl(flattened, exclusions);\n }\n\n if (({}).toString.call(data) === '[object Array]') {\n const result = [];\n for (let index = 0; index < data.length; index++) {\n result[index] = JSON.parse(stringifyImpl(data[index], exclusions));\n }\n\n return JSON.stringify(result);\n }\n\n return stringifyImpl(data, exclusions);\n }\n\n public static toBoolean(input, defaultValue: boolean = false): boolean {\n if (typeof input === 'boolean') {\n return input;\n }\n\n if (input === null || typeof input !== 'number' && typeof input !== 'string') {\n return defaultValue;\n }\n\n switch ((input + '').toLowerCase().trim()) {\n case 'true': case 'yes': case '1': return true;\n case 'false': case 'no': case '0': case null: return false;\n }\n\n return defaultValue;\n }\n}\n\n \n\nexport interface IConfigurationSettings {\n apiKey?: string;\n serverUrl?: string;\n heartbeatServerUrl?: string;\n updateSettingsWhenIdleInterval?: number;\n environmentInfoCollector?: IEnvironmentInfoCollector;\n errorParser?: IErrorParser;\n lastReferenceIdManager?: ILastReferenceIdManager;\n log?: ILog;\n moduleCollector?: IModuleCollector;\n requestInfoCollector?: IRequestInfoCollector;\n submissionBatchSize?: number;\n submissionClient?: ISubmissionClient;\n submissionAdapter?: ISubmissionAdapter;\n storage?: IStorageProvider;\n queue?: IEventQueue;\n}\n\n \n\ninterface ISettingsWithVersion {\n version: number;\n settings: { [key: string]: string };\n}\n\nexport class SettingsManager {\n /**\n * A list of handlers that will be fired when the settings change.\n * @type {Array}\n * @private\n */\n private static _handlers: Array<(config: Configuration) => void> = [];\n\n public static onChanged(handler: (config: Configuration) => void) {\n !!handler && this._handlers.push(handler);\n }\n\n public static applySavedServerSettings(config: Configuration): void {\n if (!config || !config.isValid) {\n return;\n }\n\n const savedSettings = this.getSavedServerSettings(config);\n config.log.info(`Applying saved settings: v${savedSettings.version}`);\n config.settings = Utils.merge(config.settings, savedSettings.settings);\n this.changed(config);\n }\n\n public static getVersion(config: Configuration): number {\n if (!config || !config.isValid) {\n return 0;\n }\n\n const savedSettings = this.getSavedServerSettings(config);\n return savedSettings.version || 0;\n }\n\n public static checkVersion(version: number, config: Configuration): void {\n const currentVersion: number = this.getVersion(config);\n if (version <= currentVersion) {\n return;\n }\n\n config.log.info(`Updating settings from v${currentVersion} to v${version}`);\n this.updateSettings(config, currentVersion);\n }\n\n public static updateSettings(config: Configuration, version?: number): void {\n if (!config || !config.enabled) {\n return;\n }\n\n const unableToUpdateMessage = 'Unable to update settings';\n if (!config.isValid) {\n config.log.error(`${unableToUpdateMessage}: ApiKey is not set.`);\n return;\n }\n\n if (!version || version < 0) {\n version = this.getVersion(config);\n }\n\n config.log.info(`Checking for updated settings from: v${version}.`);\n config.submissionClient.getSettings(config, version, (response: SettingsResponse) => {\n if (!config || !response || !response.success || !response.settings) {\n config.log.warn(`${unableToUpdateMessage}: ${response.message}`);\n return;\n }\n\n config.settings = Utils.merge(config.settings, response.settings);\n\n // TODO: Store snapshot of settings after reading from config and attributes and use that to revert to defaults.\n // Remove any existing server settings that are not in the new server settings.\n const savedServerSettings = SettingsManager.getSavedServerSettings(config);\n for (const key in savedServerSettings) {\n if (response.settings[key]) {\n continue;\n }\n\n delete config.settings[key];\n }\n\n const newSettings: ISettingsWithVersion = {\n version: response.settingsVersion,\n settings: response.settings\n };\n\n config.storage.settings.save(newSettings);\n\n config.log.info(`Updated settings: v${newSettings.version}`);\n this.changed(config);\n });\n }\n\n private static changed(config: Configuration) {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(config);\n } catch (ex) {\n config.log.error(`Error calling onChanged handler: ${ex}`);\n }\n }\n }\n\n private static getSavedServerSettings(config: Configuration): ISettingsWithVersion {\n const item = config.storage.settings.get()[0];\n if (item && item.value && item.value.version && item.value.settings) {\n return item.value;\n }\n\n return { version: 0, settings: {} };\n }\n}\n\nexport interface IEvent {\n type?: string;\n source?: string;\n date?: Date;\n tags?: string[];\n message?: string;\n geo?: string;\n value?: number;\n data?: any;\n reference_id?: string;\n count?: number;\n}\n\nexport class SubmissionResponse {\n public success: boolean = false;\n public badRequest: boolean = false;\n public serviceUnavailable: boolean = false;\n public paymentRequired: boolean = false;\n public unableToAuthenticate: boolean = false;\n public notFound: boolean = false;\n public requestEntityTooLarge: boolean = false;\n public statusCode: number;\n public message: string;\n\n constructor(statusCode: number, message?: string) {\n this.statusCode = statusCode;\n this.message = message;\n\n this.success = statusCode >= 200 && statusCode <= 299;\n this.badRequest = statusCode === 400;\n this.serviceUnavailable = statusCode === 503;\n this.paymentRequired = statusCode === 402;\n this.unableToAuthenticate = statusCode === 401 || statusCode === 403;\n this.notFound = statusCode === 404;\n this.requestEntityTooLarge = statusCode === 413;\n }\n}\n\n \n\nexport class ExceptionlessClient {\n /**\n * The default ExceptionlessClient instance.\n * @type {ExceptionlessClient}\n * @private\n */\n private static _instance: ExceptionlessClient = null;\n\n public config: Configuration;\n\n private _intervalId: any;\n private _timeoutId: any;\n\n constructor();\n constructor(settings: IConfigurationSettings);\n constructor(apiKey: string, serverUrl?: string);\n constructor(settingsOrApiKey?: IConfigurationSettings | string, serverUrl?: string) {\n this.config = typeof settingsOrApiKey === 'object'\n ? new Configuration(settingsOrApiKey)\n : new Configuration({ apiKey: settingsOrApiKey as string, serverUrl });\n\n this.updateSettingsTimer(5000);\n this.config.onChanged((config) => this.updateSettingsTimer(this._timeoutId > 0 ? 5000 : 0));\n this.config.queue.onEventsPosted((events, response) => this.updateSettingsTimer());\n }\n\n public createException(exception: Error): EventBuilder {\n const pluginContextData = new ContextData();\n pluginContextData.setException(exception);\n return this.createEvent(pluginContextData).setType('error');\n }\n\n public submitException(exception: Error, callback?: (context: EventPluginContext) => void): void {\n this.createException(exception).submit(callback);\n }\n\n public createUnhandledException(exception: Error, submissionMethod?: string): EventBuilder {\n const builder = this.createException(exception);\n builder.pluginContextData.markAsUnhandledError();\n builder.pluginContextData.setSubmissionMethod(submissionMethod);\n\n return builder;\n }\n\n public submitUnhandledException(exception: Error, submissionMethod?: string, callback?: (context: EventPluginContext) => void) {\n this.createUnhandledException(exception, submissionMethod).submit(callback);\n }\n\n public createFeatureUsage(feature: string): EventBuilder {\n return this.createEvent().setType('usage').setSource(feature);\n }\n\n public submitFeatureUsage(feature: string, callback?: (context: EventPluginContext) => void): void {\n this.createFeatureUsage(feature).submit(callback);\n }\n\n public createLog(message: string): EventBuilder;\n public createLog(source: string, message: string): EventBuilder;\n public createLog(source: string, message: string, level: string): EventBuilder;\n public createLog(sourceOrMessage: string, message?: string, level?: string): EventBuilder {\n let builder = this.createEvent().setType('log');\n\n if (level) {\n builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty('@level', level);\n } else if (message) {\n builder = builder.setSource(sourceOrMessage).setMessage(message);\n } else {\n builder = builder.setMessage(sourceOrMessage);\n\n try {\n // TODO: Look into using https: //www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/\n const caller: any = this.createLog.caller;\n builder = builder.setSource(caller && caller.caller && caller.caller.name);\n } catch (e) {\n this.config.log.trace('Unable to resolve log source: ' + e.message);\n }\n }\n\n return builder;\n }\n\n public submitLog(message: string): void;\n public submitLog(source: string, message: string): void;\n public submitLog(source: string, message: string, level: string, callback?: (context: EventPluginContext) => void): void;\n public submitLog(sourceOrMessage: string, message?: string, level?: string, callback?: (context: EventPluginContext) => void): void {\n this.createLog(sourceOrMessage, message, level).submit(callback);\n }\n\n public createNotFound(resource: string): EventBuilder {\n return this.createEvent().setType('404').setSource(resource);\n }\n\n public submitNotFound(resource: string, callback?: (context: EventPluginContext) => void): void {\n this.createNotFound(resource).submit(callback);\n }\n\n public createSessionStart(): EventBuilder {\n return this.createEvent().setType('session');\n }\n\n public submitSessionStart(callback?: (context: EventPluginContext) => void): void {\n this.createSessionStart().submit(callback);\n }\n\n public submitSessionEnd(sessionIdOrUserId: string): void {\n if (sessionIdOrUserId) {\n this.config.log.info(`Submitting session end: ${sessionIdOrUserId}`);\n this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, true, this.config);\n }\n }\n\n public submitSessionHeartbeat(sessionIdOrUserId: string): void {\n if (sessionIdOrUserId) {\n this.config.log.info(`Submitting session heartbeat: ${sessionIdOrUserId}`);\n this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, false, this.config);\n }\n }\n\n public createEvent(pluginContextData?: ContextData): EventBuilder {\n return new EventBuilder({ date: new Date() }, this, pluginContextData);\n }\n\n /**\n * Submits the event to be sent to the server.\n * @param event The event data.\n * @param pluginContextData Any contextual data objects to be used by Exceptionless plugins to gather default information for inclusion in the report information.\n * @param callback\n */\n public submitEvent(event: IEvent, pluginContextData?: ContextData, callback?: (context: EventPluginContext) => void): void {\n function cancelled(context: EventPluginContext) {\n if (!!context) {\n context.cancelled = true;\n }\n\n return !!callback && callback(context);\n }\n\n const context = new EventPluginContext(this, event, pluginContextData);\n if (!event) {\n return cancelled(context);\n }\n\n if (!this.config.enabled) {\n this.config.log.info('Event submission is currently disabled.');\n return cancelled(context);\n }\n\n if (!event.data) {\n event.data = {};\n }\n\n if (!event.tags || !event.tags.length) {\n event.tags = [];\n }\n\n EventPluginManager.run(context, (ctx: EventPluginContext) => {\n const config = ctx.client.config;\n const ev = ctx.event;\n\n if (!ctx.cancelled) {\n // ensure all required data\n if (!ev.type || ev.type.length === 0) {\n ev.type = 'log';\n }\n\n if (!ev.date) {\n ev.date = new Date();\n }\n\n config.queue.enqueue(ev);\n\n if (ev.reference_id && ev.reference_id.length > 0) {\n ctx.log.info(`Setting last reference id '${ev.reference_id}'`);\n config.lastReferenceIdManager.setLast(ev.reference_id);\n }\n }\n\n !!callback && callback(ctx);\n });\n }\n\n /**\n * Updates the user's email address and description of an event for the specified reference id.\n * @param referenceId The reference id of the event to update.\n * @param email The user's email address to set on the event.\n * @param description The user's description of the event.\n * @param callback The submission response.\n */\n public updateUserEmailAndDescription(referenceId: string, email: string, description: string, callback?: (response: SubmissionResponse) => void) {\n if (!referenceId || !email || !description || !this.config.enabled) {\n return !!callback && callback(new SubmissionResponse(500, 'cancelled'));\n }\n\n const userDescription: IUserDescription = { email_address: email, description };\n this.config.submissionClient.postUserDescription(referenceId, userDescription, this.config, (response: SubmissionResponse) => {\n if (!response.success) {\n this.config.log.error(`Failed to submit user email and description for event '${referenceId}': ${response.statusCode} ${response.message}`);\n }\n\n !!callback && callback(response);\n });\n }\n\n /**\n * Gets the last event client id that was submitted to the server.\n * @returns {string} The event client id.\n */\n public getLastReferenceId(): string {\n return this.config.lastReferenceIdManager.getLast();\n }\n\n private updateSettingsTimer(initialDelay?: number) {\n this.config.log.info(`Updating settings timer with delay: ${initialDelay}`);\n\n this._timeoutId = clearTimeout(this._timeoutId);\n this._timeoutId = clearInterval(this._intervalId);\n\n const interval = this.config.updateSettingsWhenIdleInterval;\n if (interval > 0) {\n const updateSettings = () => SettingsManager.updateSettings(this.config);\n if (initialDelay > 0) {\n this._timeoutId = setTimeout(updateSettings, initialDelay);\n }\n\n this._intervalId = setInterval(updateSettings, interval);\n }\n }\n\n /**\n * The default ExceptionlessClient instance.\n * @type {ExceptionlessClient}\n */\n public static get default() {\n if (ExceptionlessClient._instance === null) {\n ExceptionlessClient._instance = new ExceptionlessClient(null);\n }\n\n return ExceptionlessClient._instance;\n }\n}\n\nexport class ContextData {\n public setException(exception: Error): void {\n if (exception) {\n this['@@_Exception'] = exception;\n }\n }\n\n public get hasException(): boolean {\n return !!this['@@_Exception'];\n }\n\n public getException(): Error {\n return this['@@_Exception'] || null;\n }\n\n public markAsUnhandledError(): void {\n this['@@_IsUnhandledError'] = true;\n }\n\n public get isUnhandledError(): boolean {\n return !!this['@@_IsUnhandledError'];\n }\n\n public setSubmissionMethod(method: string): void {\n if (method) {\n this['@@_SubmissionMethod'] = method;\n }\n }\n\n public getSubmissionMethod(): string {\n return this['@@_SubmissionMethod'] || null;\n }\n}\n\nexport interface IEnvironmentInfo {\n processor_count?: number;\n total_physical_memory?: number;\n available_physical_memory?: number;\n command_line?: string;\n process_name?: string;\n process_id?: string;\n process_memory_size?: number;\n thread_id?: string;\n architecture?: string;\n o_s_name?: string;\n o_s_version?: string;\n ip_address?: string;\n machine_name?: string;\n install_id?: string;\n runtime_version?: string;\n data?: any;\n}\n\nexport interface IParameter {\n data?: any;\n generic_arguments?: string[];\n\n name?: string;\n type?: string;\n type_namespace?: string;\n}\n\n \n\nexport interface IMethod {\n data?: any;\n generic_arguments?: string[];\n parameters?: IParameter[];\n\n is_signature_target?: boolean;\n declaring_namespace?: string;\n declaring_type?: string;\n name?: string;\n module_id?: number;\n}\n\n \n\nexport interface IStackFrame extends IMethod {\n file_name?: string;\n line_number?: number;\n column?: number;\n}\n\n \n\nexport interface IInnerError {\n message?: string;\n type?: string;\n code?: string;\n data?: any;\n inner?: IInnerError;\n stack_trace?: IStackFrame[];\n target_method?: IMethod;\n}\n\nexport interface IModule {\n data?: any;\n\n module_id?: number;\n name?: string;\n version?: string;\n is_entry?: boolean;\n created_date?: Date;\n modified_date?: Date;\n}\n\n \n\nexport interface IError extends IInnerError {\n modules?: IModule[];\n}\n\nexport interface IRequestInfo {\n user_agent?: string;\n http_method?: string;\n is_secure?: boolean;\n host?: string;\n port?: number;\n path?: string;\n referrer?: string;\n client_ip_address?: string;\n cookies?: any;\n post_data?: any;\n query_string?: any;\n data?: any;\n}\n\nexport interface IStorageItem {\n timestamp: number;\n value: any;\n}\n\n \n\nexport interface IStorage {\n save(value: any): number;\n get(limit?: number): IStorageItem[];\n remove(timestamp: number): void;\n clear(): void;\n}\n\nexport type SubmissionCallback = (status: number, message: string, data?: string, headers?: object) => void;\n\nexport interface SubmissionRequest {\n apiKey: string;\n userAgent: string;\n method: string;\n url: string;\n data: string;\n}\n\n \n\nexport class Configuration implements IConfigurationSettings {\n /**\n * The default configuration settings that are applied to new configuration instances.\n * @type {IConfigurationSettings}\n * @private\n */\n private static _defaultSettings: IConfigurationSettings = null;\n\n /**\n * A default list of tags that will automatically be added to every\n * report submitted to the server.\n *\n * @type {Array}\n */\n public defaultTags: string[] = [];\n\n /**\n * A default list of of extended data objects that will automatically\n * be added to every report submitted to the server.\n *\n * @type {{}}\n */\n public defaultData: object = {};\n\n /**\n * Whether the client is currently enabled or not. If it is disabled,\n * submitted errors will be discarded and no data will be sent to the server.\n *\n * @returns {boolean}\n */\n public enabled: boolean = true;\n\n public environmentInfoCollector: IEnvironmentInfoCollector;\n public errorParser: IErrorParser;\n public lastReferenceIdManager: ILastReferenceIdManager = new DefaultLastReferenceIdManager();\n public log: ILog;\n public moduleCollector: IModuleCollector;\n public requestInfoCollector: IRequestInfoCollector;\n\n /**\n * Maximum number of events that should be sent to the server together in a batch. (Defaults to 50)\n */\n public submissionBatchSize: number;\n public submissionAdapter: ISubmissionAdapter;\n public submissionClient: ISubmissionClient;\n\n /**\n * Contains a dictionary of custom settings that can be used to control\n * the client and will be automatically updated from the server.\n */\n public settings: object = {};\n\n public storage: IStorageProvider;\n\n public queue: IEventQueue;\n\n /**\n * The API key that will be used when sending events to the server.\n * @type {string}\n * @private\n */\n private _apiKey: string;\n\n /**\n * The server url that all events will be sent to.\n * @type {string}\n * @private\n */\n private _serverUrl: string = 'https://collector.exceptionless.io';\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @type {string}\n * @private\n */\n private _heartbeatServerUrl: string = 'https://heartbeat.exceptionless.io';\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @type {number}\n * @private\n */\n private _updateSettingsWhenIdleInterval: number = 120000;\n\n /**\n * A list of exclusion patterns.\n * @type {Array}\n * @private\n */\n private _dataExclusions: string[] = [];\n\n /**\n * A list of user agent patterns.\n * @type {Array}\n * @private\n */\n private _userAgentBotPatterns: string[] = [];\n\n /**\n * The list of plugins that will be used in this configuration.\n * @type {Array}\n * @private\n */\n private _plugins: IEventPlugin[] = [];\n\n /**\n * A list of handlers that will be fired when configuration changes.\n * @type {Array}\n * @private\n */\n private _handlers: Array<(config: Configuration) => void> = [];\n\n constructor(configSettings?: IConfigurationSettings) {\n function inject(fn: any) {\n return typeof fn === 'function' ? fn(this) : fn;\n }\n\n configSettings = Utils.merge(Configuration.defaults, configSettings);\n\n this.log = inject(configSettings.log) || new NullLog();\n this.apiKey = configSettings.apiKey;\n this.serverUrl = configSettings.serverUrl;\n this.heartbeatServerUrl = configSettings.heartbeatServerUrl;\n this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval;\n\n this.environmentInfoCollector = inject(configSettings.environmentInfoCollector);\n this.errorParser = inject(configSettings.errorParser);\n this.lastReferenceIdManager = inject(configSettings.lastReferenceIdManager) || new DefaultLastReferenceIdManager();\n this.moduleCollector = inject(configSettings.moduleCollector);\n this.requestInfoCollector = inject(configSettings.requestInfoCollector);\n this.submissionBatchSize = inject(configSettings.submissionBatchSize) || 50;\n this.submissionAdapter = inject(configSettings.submissionAdapter);\n this.submissionClient = inject(configSettings.submissionClient) || new DefaultSubmissionClient();\n this.storage = inject(configSettings.storage) || new InMemoryStorageProvider();\n this.queue = inject(configSettings.queue) || new DefaultEventQueue(this);\n\n SettingsManager.applySavedServerSettings(this);\n EventPluginManager.addDefaultPlugins(this);\n }\n\n /**\n * The API key that will be used when sending events to the server.\n * @returns {string}\n */\n public get apiKey(): string {\n return this._apiKey;\n }\n\n /**\n * The API key that will be used when sending events to the server.\n * @param value\n */\n public set apiKey(value: string) {\n this._apiKey = value || null;\n this.log.info(`apiKey: ${this._apiKey}`);\n this.changed();\n }\n\n /**\n * Returns true if the apiKey is valid.\n * @returns {boolean}\n */\n public get isValid(): boolean {\n return !!this.apiKey && this.apiKey.length >= 10;\n }\n\n /**\n * The server url that all events will be sent to.\n * @returns {string}\n */\n public get serverUrl(): string {\n return this._serverUrl;\n }\n\n /**\n * The server url that all events will be sent to.\n * @param value\n */\n public set serverUrl(value: string) {\n if (!!value) {\n this._serverUrl = value;\n this._heartbeatServerUrl = value;\n this.log.info(`serverUrl: ${value}`);\n this.changed();\n }\n }\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @returns {string}\n */\n public get heartbeatServerUrl(): string {\n return this._heartbeatServerUrl;\n }\n\n /**\n * The heartbeat server url that all heartbeats will be sent to.\n * @param value\n */\n public set heartbeatServerUrl(value: string) {\n if (!!value) {\n this._heartbeatServerUrl = value;\n this.log.info(`heartbeatServerUrl: ${value}`);\n this.changed();\n }\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @returns {number}\n */\n public get updateSettingsWhenIdleInterval(): number {\n return this._updateSettingsWhenIdleInterval;\n }\n\n /**\n * How often the client should check for updated server settings when idle. The default is every 2 minutes.\n * @param value\n */\n public set updateSettingsWhenIdleInterval(value: number) {\n if (typeof value !== 'number') {\n return;\n }\n\n if (value <= 0) {\n value = -1;\n } else if (value > 0 && value < 15000) {\n value = 15000;\n }\n\n this._updateSettingsWhenIdleInterval = value;\n this.log.info(`updateSettingsWhenIdleInterval: ${value}`);\n this.changed();\n }\n\n /**\n * A list of exclusion patterns that will automatically remove any data that\n * matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties,\n * form fields, cookies and query parameters from the report.\n *\n * @returns {string[]}\n */\n public get dataExclusions(): string[] {\n const exclusions: string = this.settings['@@DataExclusions'];\n return this._dataExclusions.concat(exclusions && exclusions.split(',') || []);\n }\n\n /**\n * Add items to the list of exclusion patterns that will automatically remove any\n * data that matches them from any data submitted to the server.\n *\n * For example, entering CreditCard will remove any extended data properties, form\n * fields, cookies and query parameters from the report.\n *\n * @param exclusions\n */\n public addDataExclusions(...exclusions: string[]) {\n this._dataExclusions = Utils.addRange<string>(this._dataExclusions, ...exclusions);\n }\n\n /**\n * A list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n *\n * @returns {string[]}\n */\n public get userAgentBotPatterns(): string[] {\n const patterns: string = this.settings['@@UserAgentBotPatterns'];\n return this._userAgentBotPatterns.concat(patterns && patterns.split(',') || []);\n }\n\n /**\n * Add items to the list of user agent patterns that will cause any event with a matching user agent to not be submitted.\n *\n * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted.\n *\n * @param userAgentBotPatterns\n */\n public addUserAgentBotPatterns(...userAgentBotPatterns: string[]) {\n this._userAgentBotPatterns = Utils.addRange<string>(this._userAgentBotPatterns, ...userAgentBotPatterns);\n }\n\n /**\n * The list of plugins that will be used in this configuration.\n * @returns {IEventPlugin[]}\n */\n public get plugins(): IEventPlugin[] {\n return this._plugins.sort((p1: IEventPlugin, p2: IEventPlugin) => {\n return (p1.priority < p2.priority) ? -1 : (p1.priority > p2.priority) ? 1 : 0;\n });\n }\n\n /**\n * Register an plugin to be used in this configuration.\n * @param plugin\n */\n public addPlugin(plugin: IEventPlugin): void;\n\n /**\n * Register an plugin to be used in this configuration.\n * @param name The name used to identify the plugin.\n * @param priority Used to determine plugins priority.\n * @param pluginAction A function that is run.\n */\n public addPlugin(name: string, priority: number, pluginAction: (context: EventPluginContext, next?: () => void) => void): void;\n public addPlugin(pluginOrName: IEventPlugin | string, priority?: number, pluginAction?: (context: EventPluginContext, next?: () => void) => void): void {\n const plugin: IEventPlugin = !!pluginAction ? { name: pluginOrName as string, priority, run: pluginAction } : pluginOrName as IEventPlugin;\n if (!plugin || !plugin.run) {\n this.log.error('Add plugin failed: Run method not defined');\n return;\n }\n\n if (!plugin.name) {\n plugin.name = Utils.guid();\n }\n\n if (!plugin.priority) {\n plugin.priority = 0;\n }\n\n let pluginExists: boolean = false;\n const plugins = this._plugins; // optimization for minifier.\n for (const p of plugins) {\n if (p.name === plugin.name) {\n pluginExists = true;\n break;\n }\n }\n\n if (!pluginExists) {\n plugins.push(plugin);\n }\n }\n\n /**\n * Remove the plugin from this configuration.\n * @param plugin\n */\n public removePlugin(plugin: IEventPlugin): void;\n\n /**\n * Remove an plugin by key from this configuration.\n * @param name\n */\n public removePlugin(pluginOrName: IEventPlugin | string): void {\n const name: string = typeof pluginOrName === 'string' ? pluginOrName : pluginOrName.name;\n if (!name) {\n this.log.error('Remove plugin failed: Plugin name not defined');\n return;\n }\n\n const plugins = this._plugins; // optimization for minifier.\n for (let index = 0; index < plugins.length; index++) {\n if (plugins[index].name === name) {\n plugins.splice(index, 1);\n break;\n }\n }\n }\n\n /**\n * Automatically set the application version for events.\n * @param version\n */\n public setVersion(version: string): void {\n if (!!version) {\n this.defaultData['@version'] = version;\n }\n }\n\n public setUserIdentity(userInfo: IUserInfo): void;\n public setUserIdentity(identity: string): void;\n public setUserIdentity(identity: string, name: string): void;\n public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): void {\n const USER_KEY: string = '@user'; // optimization for minifier.\n const userInfo: IUserInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n\n const shouldRemove: boolean = !userInfo || (!userInfo.identity && !userInfo.name);\n if (shouldRemove) {\n delete this.defaultData[USER_KEY];\n } else {\n this.defaultData[USER_KEY] = userInfo;\n }\n\n this.log.info(`user identity: ${shouldRemove ? 'null' : userInfo.identity}`);\n }\n\n /**\n * Used to identify the client that sent the events to the server.\n * @returns {string}\n */\n public get userAgent(): string {\n return 'exceptionless-js/1.0.0.0';\n }\n\n /**\n * Automatically send a heartbeat to keep the session alive.\n */\n public useSessions(sendHeartbeats: boolean = true, heartbeatInterval: number = 30000): void {\n if (sendHeartbeats) {\n this.addPlugin(new HeartbeatPlugin(heartbeatInterval));\n }\n }\n\n /**\n * Automatically set a reference id for error events.\n */\n public useReferenceIds(): void {\n this.addPlugin(new ReferenceIdPlugin());\n }\n\n public useLocalStorage(): void {\n // This method will be injected via the prototype.\n }\n\n // TODO: Support a min log level.\n public useDebugLogger(): void {\n this.log = new ConsoleLog();\n }\n\n public onChanged(handler: (config: Configuration) => void) {\n !!handler && this._handlers.push(handler);\n }\n\n private changed() {\n const handlers = this._handlers; // optimization for minifier.\n for (const handler of handlers) {\n try {\n handler(this);\n } catch (ex) {\n this.log.error(`Error calling onChanged handler: ${ex}`);\n }\n }\n }\n\n /**\n * The default configuration settings that are applied to new configuration instances.\n * @returns {IConfigurationSettings}\n */\n public static get defaults() {\n if (Configuration._defaultSettings === null) {\n Configuration._defaultSettings = {};\n }\n\n return Configuration._defaultSettings;\n }\n}\n\nexport interface IUserDescription {\n email_address?: string;\n description?: string;\n data?: any;\n}\n\nexport class SettingsResponse {\n public success: boolean = false;\n public settings: any;\n public settingsVersion: number = -1;\n public message: string;\n public exception: any;\n\n constructor(success: boolean, settings: any, settingsVersion: number = -1, exception: any = null, message: string = null) {\n this.success = success;\n this.settings = settings;\n this.settingsVersion = settingsVersion;\n this.exception = exception;\n this.message = message;\n }\n}\n\n \n\nexport class EventBuilder {\n public target: IEvent;\n public client: ExceptionlessClient;\n public pluginContextData: ContextData;\n\n private _validIdentifierErrorMessage: string = 'must contain between 8 and 100 alphanumeric or \\'-\\' characters.'; // optimization for minifier.\n\n constructor(event: IEvent, client: ExceptionlessClient, pluginContextData?: ContextData) {\n this.target = event;\n this.client = client;\n this.pluginContextData = pluginContextData || new ContextData();\n }\n\n public setType(type: string): EventBuilder {\n if (!!type) {\n this.target.type = type;\n }\n\n return this;\n }\n\n public setSource(source: string): EventBuilder {\n if (!!source) {\n this.target.source = source;\n }\n\n return this;\n }\n\n public setReferenceId(referenceId: string): EventBuilder {\n if (!this.isValidIdentifier(referenceId)) {\n throw new Error(`ReferenceId ${this._validIdentifierErrorMessage}`);\n }\n\n this.target.reference_id = referenceId;\n return this;\n }\n\n /**\n * Allows you to reference a parent event by its ReferenceId property. This allows you to have parent and child relationships.\n * @param name Reference name\n * @param id The reference id that points to a specific event\n * @returns {EventBuilder}\n */\n public setEventReference(name: string, id: string): EventBuilder {\n if (!name) {\n throw new Error('Invalid name');\n }\n\n if (!id || !this.isValidIdentifier(id)) {\n throw new Error(`Id ${this._validIdentifierErrorMessage}`);\n }\n\n this.setProperty('@ref:' + name, id);\n return this;\n }\n\n public setMessage(message: string): EventBuilder {\n if (!!message) {\n this.target.message = message;\n }\n\n return this;\n }\n\n public setGeo(latitude: number, longitude: number): EventBuilder {\n if (latitude < -90.0 || latitude > 90.0) {\n throw new Error('Must be a valid latitude value between -90.0 and 90.0.');\n }\n\n if (longitude < -180.0 || longitude > 180.0) {\n throw new Error('Must be a valid longitude value between -180.0 and 180.0.');\n }\n\n this.target.geo = `${latitude},${longitude}`;\n return this;\n }\n\n public setUserIdentity(userInfo: IUserInfo): EventBuilder;\n public setUserIdentity(identity: string): EventBuilder;\n public setUserIdentity(identity: string, name: string): EventBuilder;\n public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): EventBuilder {\n const userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name };\n if (!userInfo || (!userInfo.identity && !userInfo.name)) {\n return this;\n }\n\n this.setProperty('@user', userInfo);\n return this;\n }\n\n /**\n * Sets the user's description of the event.\n *\n * @param emailAddress The email address\n * @param description The user's description of the event.\n * @returns {EventBuilder}\n */\n public setUserDescription(emailAddress: string, description: string): EventBuilder {\n if (emailAddress && description) {\n this.setProperty('@user_description', { email_address: emailAddress, description });\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting manual\n * stacking information.\n * @param signatureData A dictionary of strings to use for stacking.\n * @param title An optional title for the stacking information.\n * @returns {EventBuilder}\n */\n public setManualStackingInfo(signatureData: any, title?: string) {\n if (signatureData) {\n const stack: IManualStackingInfo = { signature_data: signatureData };\n if (title) {\n stack.title = title;\n }\n\n this.setProperty('@stack', stack);\n }\n\n return this;\n }\n\n /**\n * Changes default stacking behavior by setting the stacking key.\n * @param manualStackingKey The manual stacking key.\n * @param title An optional title for the stacking information.\n * @returns {EventBuilder}\n */\n public setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder {\n if (manualStackingKey) {\n const data = { ManualStackingKey: manualStackingKey };\n this.setManualStackingInfo(data, title);\n }\n\n return this;\n }\n\n public setValue(value: number): EventBuilder {\n if (!!value) {\n this.target.value = value;\n }\n\n return this;\n }\n\n public addTags(...tags: string[]): EventBuilder {\n this.target.tags = Utils.addRange<string>(this.target.tags, ...tags);\n return this;\n }\n\n /**\n * Adds the object to extended data. Uses @excludedPropertyNames\n * to exclude data from being included in the event.\n * @param name The data object to add.\n * @param value The name of the object to add.\n * @param maxDepth The max depth of the object to include.\n * @param excludedPropertyNames Any property names that should be excluded.\n */\n public setProperty(name: string, value: any, maxDepth?: number, excludedPropertyNames?: string[]): EventBuilder {\n if (!name || (value === undefined || value == null)) {\n return this;\n }\n\n if (!this.target.data) {\n this.target.data = {};\n }\n\n const result = JSON.parse(Utils.stringify(value, this.client.config.dataExclusions.concat(excludedPropertyNames || []), maxDepth));\n if (!Utils.isEmpty(result)) {\n this.target.data[name] = result;\n }\n\n return this;\n }\n\n public markAsCritical(critical: boolean): EventBuilder {\n if (critical) {\n this.addTags('Critical');\n }\n\n return this;\n }\n\n public addRequestInfo(request: object): EventBuilder {\n if (!!request) {\n this.pluginContextData['@request'] = request;\n }\n\n return this;\n }\n\n public submit(callback?: (context: EventPluginContext) => void): void {\n this.client.submitEvent(this.target, this.pluginContextData, callback);\n }\n\n private isValidIdentifier(value: string): boolean {\n if (!value) {\n return true;\n }\n\n if (value.length < 8 || value.length > 100) {\n return false;\n }\n\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index);\n const isDigit = (code >= 48) && (code <= 57);\n const isLetter = ((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122));\n const isMinus = code === 45;\n\n if (!(isDigit || isLetter) && !isMinus) {\n return false;\n }\n }\n\n return true;\n }\n}\n\nexport interface IManualStackingInfo {\n title?: string;\n signature_data?: any;\n}\n\n \n\nexport class ConfigurationDefaultsPlugin implements IEventPlugin {\n public priority: number = 10;\n public name: string = 'ConfigurationDefaultsPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const config = context.client.config;\n const defaultTags: string[] = config.defaultTags || [];\n for (const tag of defaultTags) {\n if (!!tag && context.event.tags.indexOf(tag) < 0) {\n context.event.tags.push(tag);\n }\n }\n\n // tslint:disable-next-line:ban-types\n const defaultData: Object = config.defaultData || {};\n for (const key in defaultData) {\n if (!!defaultData[key]) {\n const result = JSON.parse(Utils.stringify(defaultData[key], config.dataExclusions));\n if (!Utils.isEmpty(result)) {\n context.event.data[key] = result;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class DuplicateCheckerPlugin implements IEventPlugin {\n public priority: number = 1010;\n public name: string = 'DuplicateCheckerPlugin';\n\n private _mergedEvents: MergedEvent[] = [];\n private _processedHashcodes: TimestampedHash[] = [];\n private _getCurrentTime: () => number;\n private _interval: number;\n\n constructor(getCurrentTime: () => number = () => Date.now(), interval: number = 30000) {\n this._getCurrentTime = getCurrentTime;\n this._interval = interval;\n\n setInterval(() => {\n while (this._mergedEvents.length > 0) {\n this._mergedEvents.shift().resubmit();\n }\n }, interval);\n }\n\n public run(context: EventPluginContext, next?: () => void): void {\n function getHashCode(error: IInnerError): number {\n let hashCode = 0;\n while (error) {\n if (error.message && error.message.length) {\n hashCode += (hashCode * 397) ^ Utils.getHashCode(error.message);\n }\n if (error.stack_trace && error.stack_trace.length) {\n hashCode += (hashCode * 397) ^ Utils.getHashCode(JSON.stringify(error.stack_trace));\n }\n error = error.inner;\n }\n\n return hashCode;\n }\n\n const error = context.event.data['@error'];\n const hashCode = getHashCode(error);\n if (hashCode) {\n const count = context.event.count || 1;\n const now = this._getCurrentTime();\n\n const merged = this._mergedEvents.filter((s) => s.hashCode === hashCode)[0];\n if (merged) {\n merged.incrementCount(count);\n merged.updateDate(context.event.date);\n context.log.info('Ignoring duplicate event with hash: ' + hashCode);\n context.cancelled = true;\n }\n\n if (!context.cancelled && this._processedHashcodes.some((h) => h.hash === hashCode && h.timestamp >= (now - this._interval))) {\n context.log.trace('Adding event with hash: ' + hashCode);\n this._mergedEvents.push(new MergedEvent(hashCode, context, count));\n context.cancelled = true;\n }\n\n if (!context.cancelled) {\n context.log.trace('Enqueueing event with hash: ' + hashCode + 'to cache.');\n this._processedHashcodes.push({ hash: hashCode, timestamp: now });\n\n // Only keep the last 50 recent errors.\n while (this._processedHashcodes.length > 50) {\n this._processedHashcodes.shift();\n }\n }\n }\n\n next && next();\n }\n}\n\ninterface TimestampedHash {\n hash: number;\n timestamp: number;\n}\n\nclass MergedEvent {\n public hashCode: number;\n private _count: number;\n private _context: EventPluginContext;\n\n constructor(hashCode: number, context: EventPluginContext, count: number) {\n this.hashCode = hashCode;\n this._context = context;\n this._count = count;\n }\n\n public incrementCount(count: number) {\n this._count += count;\n }\n\n public resubmit() {\n this._context.event.count = this._count;\n this._context.client.config.queue.enqueue(this._context.event);\n }\n\n public updateDate(date) {\n if (date > this._context.event.date) {\n this._context.event.date = date;\n }\n }\n}\n\n \n\nexport class EnvironmentInfoPlugin implements IEventPlugin {\n public priority: number = 80;\n public name: string = 'EnvironmentInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ENVIRONMENT_KEY: string = '@environment'; // optimization for minifier.\n\n const collector = context.client.config.environmentInfoCollector;\n if (!context.event.data[ENVIRONMENT_KEY] && collector) {\n const environmentInfo: IEnvironmentInfo = collector.getEnvironmentInfo(context);\n if (!!environmentInfo) {\n context.event.data[ENVIRONMENT_KEY] = environmentInfo;\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class ErrorPlugin implements IEventPlugin {\n public priority: number = 30;\n public name: string = 'ErrorPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ERROR_KEY: string = '@error'; // optimization for minifier.\n const ignoredProperties: string[] = [\n 'arguments',\n 'column',\n 'columnNumber',\n 'description',\n 'fileName',\n 'message',\n 'name',\n 'number',\n 'line',\n 'lineNumber',\n 'opera#sourceloc',\n 'sourceId',\n 'sourceURL',\n 'stack',\n 'stackArray',\n 'stacktrace'\n ];\n\n const exception = context.contextData.getException();\n if (!!exception) {\n context.event.type = 'error';\n\n if (!context.event.data[ERROR_KEY]) {\n const config = context.client.config;\n const parser = config.errorParser;\n if (!parser) {\n throw new Error('No error parser was defined.');\n }\n\n const result = parser.parse(context, exception);\n if (!!result) {\n const additionalData = JSON.parse(Utils.stringify(exception, config.dataExclusions.concat(ignoredProperties)));\n if (!Utils.isEmpty(additionalData)) {\n if (!result.data) {\n result.data = {};\n }\n result.data['@ext'] = additionalData;\n }\n\n context.event.data[ERROR_KEY] = result;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class EventExclusionPlugin implements IEventPlugin {\n public priority: number = 45;\n public name: string = 'EventExclusionPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n function getLogLevel(level: string): number {\n switch ((level || '').toLowerCase().trim()) {\n case 'trace':\n case 'true':\n case '1':\n case 'yes':\n return 0;\n case 'debug':\n return 1;\n case 'info':\n return 2;\n case 'warn':\n return 3;\n case 'error':\n return 4;\n case 'fatal':\n return 5;\n case 'off':\n case 'false':\n case '0':\n case 'no':\n return 6;\n default:\n return -1;\n }\n }\n\n function getMinLogLevel(settings: object, loggerName: string = '*'): number {\n return getLogLevel(getTypeAndSourceSetting(settings, 'log', loggerName, 'Trace') + '');\n }\n\n // tslint:disable-next-line:ban-types\n function getTypeAndSourceSetting(settings: Object = {}, type: string, source: string, defaultValue?: string|boolean): string|boolean {\n if (!type) {\n return defaultValue;\n }\n\n const isLog = type === 'log';\n const sourcePrefix = `@@${type}:`;\n\n const value = settings[sourcePrefix + source];\n if (value) {\n return !isLog ? Utils.toBoolean(value) : value;\n }\n\n // check for wildcard match\n for (const key in settings) {\n if (Utils.startsWith(key.toLowerCase(), sourcePrefix.toLowerCase()) && Utils.isMatch(source, [key.substring(sourcePrefix.length)])) {\n return !isLog ? Utils.toBoolean(settings[key]) : settings[key];\n }\n }\n\n return defaultValue;\n }\n\n const ev = context.event;\n const log = context.log;\n const settings = context.client.config.settings;\n\n if (ev.type === 'log') {\n const minLogLevel = getMinLogLevel(settings, ev.source);\n const logLevel = getLogLevel(ev.data['@level']);\n\n if (logLevel >= 0 && (logLevel > 5 || logLevel < minLogLevel)) {\n log.info('Cancelling log event due to minimum log level.');\n context.cancelled = true;\n }\n } else if (ev.type === 'error') {\n let error: IInnerError = ev.data['@error'];\n while (!context.cancelled && error) {\n if (getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) {\n log.info(`Cancelling error from excluded exception type: ${error.type}`);\n context.cancelled = true;\n }\n\n error = error.inner;\n }\n } else if (getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) {\n log.info(`Cancelling event from excluded type: ${ev.type} and source: ${ev.source}`);\n context.cancelled = true;\n }\n\n next && next();\n }\n}\n\n \n\nexport class ModuleInfoPlugin implements IEventPlugin {\n public priority: number = 50;\n public name: string = 'ModuleInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const ERROR_KEY: string = '@error'; // optimization for minifier.\n\n const collector = context.client.config.moduleCollector;\n if (context.event.data[ERROR_KEY] && !context.event.data['@error'].modules && !!collector) {\n const modules: IModule[] = collector.getModules(context);\n if (modules && modules.length > 0) {\n context.event.data[ERROR_KEY].modules = modules;\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class RequestInfoPlugin implements IEventPlugin {\n public priority: number = 70;\n public name: string = 'RequestInfoPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const REQUEST_KEY: string = '@request'; // optimization for minifier.\n\n const config = context.client.config;\n const collector = config.requestInfoCollector;\n if (!context.event.data[REQUEST_KEY] && !!collector) {\n const requestInfo: IRequestInfo = collector.getRequestInfo(context);\n if (!!requestInfo) {\n if (Utils.isMatch(requestInfo.user_agent, config.userAgentBotPatterns)) {\n context.log.info('Cancelling event as the request user agent matches a known bot pattern');\n context.cancelled = true;\n } else {\n context.event.data[REQUEST_KEY] = requestInfo;\n }\n }\n }\n\n next && next();\n }\n}\n\n \n\nexport class SubmissionMethodPlugin implements IEventPlugin {\n public priority: number = 100;\n public name: string = 'SubmissionMethodPlugin';\n\n public run(context: EventPluginContext, next?: () => void): void {\n const submissionMethod: string = context.contextData.getSubmissionMethod();\n if (!!submissionMethod) {\n context.event.data['@submission_method'] = submissionMethod;\n }\n\n next && next();\n }\n}\n\n \n\nexport class InMemoryStorage implements IStorage {\n private maxItems: number;\n private items: IStorageItem[] = [];\n private lastTimestamp: number = 0;\n\n constructor(maxItems: number) {\n this.maxItems = maxItems;\n }\n\n public save(value: any): number {\n if (!value) {\n return null;\n }\n\n const items = this.items;\n const timestamp = Math.max(Date.now(), this.lastTimestamp + 1);\n const item = { timestamp, value };\n\n if (items.push(item) > this.maxItems) {\n items.shift();\n }\n\n this.lastTimestamp = timestamp;\n return item.timestamp;\n }\n\n public get(limit?: number): IStorageItem[] {\n return this.items.slice(0, limit);\n }\n\n public remove(timestamp: number): void {\n const items = this.items;\n for (let i = 0; i < items.length; i++) {\n if (items[i].timestamp === timestamp) {\n items.splice(i, 1);\n return;\n }\n }\n }\n\n public clear(): void {\n this.items = [];\n }\n}\n\nexport interface IClientConfiguration {\n settings: object;\n version: number;\n}\n\n \n\nexport abstract class KeyValueStorageBase implements IStorage {\n private maxItems: number;\n private items: number[];\n private lastTimestamp: number = 0;\n\n constructor(maxItems) {\n this.maxItems = maxItems;\n }\n\n public save(value: any, single?: boolean): number {\n if (!value) {\n return null;\n }\n\n this.ensureIndex();\n\n const items = this.items;\n const timestamp = Math.max(Date.now(), this.lastTimestamp + 1);\n const key = this.getKey(timestamp);\n const json = JSON.stringify(value);\n\n try {\n this.write(key, json);\n this.lastTimestamp = timestamp;\n if (items.push(timestamp) > this.maxItems) {\n this.delete(this.getKey(items.shift()));\n }\n } catch (e) {\n return null;\n }\n\n return timestamp;\n }\n\n public get(limit?: number): IStorageItem[] {\n this.ensureIndex();\n\n return this.items.slice(0, limit)\n .map((timestamp) => {\n // Read and parse item for this timestamp\n const key = this.getKey(timestamp);\n try {\n const json = this.read(key);\n const value = JSON.parse(json, parseDate);\n return { timestamp, value };\n } catch (error) {\n // Something went wrong - try to delete the cause.\n this.safeDelete(key);\n return null;\n }\n })\n .filter((item) => item != null);\n }\n\n public remove(timestamp: number): void {\n this.ensureIndex();\n\n const items = this.items;\n const index = items.indexOf(timestamp);\n if (index >= 0) {\n const key = this.getKey(timestamp);\n this.safeDelete(key);\n items.splice(index, 1);\n }\n }\n\n public clear(): void {\n this.items.forEach((item) => this.safeDelete(this.getKey(item)));\n this.items = [];\n }\n\n protected abstract write(key: string, value: string): void;\n protected abstract read(key: string): string;\n protected abstract readAllKeys(): string[];\n protected abstract delete(key: string);\n protected abstract getKey(timestamp: number): string;\n protected abstract getTimestamp(key: string): number;\n\n private ensureIndex() {\n if (!this.items) {\n this.items = this.createIndex();\n this.lastTimestamp = Math.max(0, ...this.items) + 1;\n }\n }\n\n private safeDelete(key: string): void {\n try {\n this.delete(key);\n } catch (error) {\n }\n }\n\n private createIndex() {\n try {\n const keys = this.readAllKeys();\n return keys.map((key) => {\n try {\n const timestamp = this.getTimestamp(key);\n if (!timestamp) {\n this.safeDelete(key);\n return null;\n }\n return timestamp;\n } catch (error) {\n this.safeDelete(key);\n return null;\n }\n }).filter((timestamp) => timestamp != null)\n .sort((a, b) => a - b);\n } catch (error) {\n return [];\n }\n }\n}\n\nfunction parseDate(key, value) {\n const dateRegx = /\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)/g;\n if (typeof value === 'string') {\n const a = dateRegx.exec(value);\n if (a) {\n return new Date(value);\n }\n }\n return value;\n}\n\n \n\nexport class BrowserStorage extends KeyValueStorageBase {\n private prefix: string;\n\n public static isAvailable(): boolean {\n try {\n const storage = window.localStorage;\n const x = '__storage_test__';\n storage.setItem(x, x);\n storage.removeItem(x);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(namespace: string, prefix: string = 'com.exceptionless.', maxItems: number = 20) {\n super(maxItems);\n\n this.prefix = prefix + namespace + '-';\n }\n\n public write(key: string, value: string) {\n window.localStorage.setItem(key, value);\n }\n\n public read(key: string) {\n return window.localStorage.getItem(key);\n }\n\n public readAllKeys() {\n return Object.keys(window.localStorage)\n .filter((key) => key.indexOf(this.prefix) === 0);\n }\n\n public delete(key: string) {\n window.localStorage.removeItem(key);\n }\n\n public getKey(timestamp) {\n return this.prefix + timestamp;\n }\n\n public getTimestamp(key) {\n return parseInt(key.substr(this.prefix.length), 10);\n }\n}\n\n \n\nexport class DefaultErrorParser implements IErrorParser {\n public parse(context: EventPluginContext, exception: Error): IError {\n function getParameters(parameters: string | string[]): IParameter[] {\n const params: string[] = (typeof parameters === 'string' ? [parameters] : parameters) || [];\n\n const result: IParameter[] = [];\n for (const param of params) {\n result.push({ name: param });\n }\n\n return result;\n }\n\n function getStackFrames(stackFrames: TraceKit.StackFrame[]): IStackFrame[] {\n const ANONYMOUS: string = '<anonymous>';\n const frames: IStackFrame[] = [];\n\n for (const frame of stackFrames) {\n frames.push({\n name: (frame.func || ANONYMOUS).replace('?', ANONYMOUS),\n parameters: getParameters(frame.args),\n file_name: frame.url,\n line_number: frame.line || 0,\n column: frame.column || 0\n });\n }\n\n return frames;\n }\n\n const TRACEKIT_STACK_TRACE_KEY: string = '@@_TraceKit.StackTrace'; // optimization for minifier.\n\n const stackTrace: TraceKit.StackTrace = !!context.contextData[TRACEKIT_STACK_TRACE_KEY]\n ? context.contextData[TRACEKIT_STACK_TRACE_KEY]\n : TraceKit.computeStackTrace(exception, 25);\n\n if (!stackTrace) {\n throw new Error('Unable to parse the exceptions stack trace.');\n }\n\n const message = typeof(exception) === 'string' ? exception as any : undefined;\n return {\n type: stackTrace.name || 'Error',\n message: stackTrace.message || exception.message || message,\n stack_trace: getStackFrames(stackTrace.stack || [])\n };\n }\n}\n\n \n\nexport class DefaultModuleCollector implements IModuleCollector {\n public getModules(context: EventPluginContext): IModule[] {\n if (!document || !document.getElementsByTagName) {\n return null;\n }\n\n const modules: IModule[] = [];\n const scripts: NodeListOf<HTMLScriptElement> = document.getElementsByTagName('script');\n if (scripts && scripts.length > 0) {\n for (let index = 0; index < scripts.length; index++) {\n if (scripts[index].src) {\n modules.push({\n module_id: index,\n name: scripts[index].src.split('?')[0],\n version: Utils.parseVersion(scripts[index].src)\n });\n } else if (!!scripts[index].innerHTML) {\n modules.push({\n module_id: index,\n name: 'Script Tag',\n version: Utils.getHashCode(scripts[index].innerHTML).toString()\n });\n }\n }\n }\n\n return modules;\n }\n}\n\n \n\nexport class DefaultRequestInfoCollector implements IRequestInfoCollector {\n public getRequestInfo(context: EventPluginContext): IRequestInfo {\n if (!document || !navigator || !location) {\n return null;\n }\n\n const exclusions = context.client.config.dataExclusions;\n const requestInfo: IRequestInfo = {\n user_agent: navigator.userAgent,\n is_secure: location.protocol === 'https:',\n host: location.hostname,\n port: location.port && location.port !== '' ? parseInt(location.port, 10) : 80,\n path: location.pathname,\n // client_ip_address: 'TODO',\n cookies: Utils.getCookies(document.cookie, exclusions),\n query_string: Utils.parseQueryString(location.search.substring(1), exclusions)\n };\n\n if (document.referrer && document.referrer !== '') {\n requestInfo.referrer = document.referrer;\n }\n\n return requestInfo;\n }\n}\n\n \n\nexport class BrowserStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(prefix?: string, maxQueueItems: number = 250) {\n this.queue = new BrowserStorage('q', prefix, maxQueueItems);\n this.settings = new BrowserStorage('settings', prefix, 1);\n }\n\n}\n\n \n\n// tslint:disable-next-line:prefer-const\ndeclare var XDomainRequest: { new (); create(); };\n\nexport class DefaultSubmissionAdapter implements ISubmissionAdapter {\n public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) {\n // TODO: Handle sending events when app is exiting with send beacon.\n const TIMEOUT: string = 'timeout'; // optimization for minifier.\n const LOADED: string = 'loaded'; // optimization for minifier.\n const WITH_CREDENTIALS: string = 'withCredentials'; // optimization for minifier.\n\n let isCompleted: boolean = false;\n let useSetTimeout: boolean = false;\n function complete(mode: string, xhr: XMLHttpRequest) {\n function parseResponseHeaders(headerStr) {\n function trim(value) {\n return value.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n\n const headers = {};\n const headerPairs = (headerStr || '').split('\\u000d\\u000a');\n for (const headerPair of headerPairs) {\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n const separator = headerPair.indexOf('\\u003a\\u0020');\n if (separator > 0) {\n headers[trim(headerPair.substring(0, separator).toLowerCase())] = headerPair.substring(separator + 2);\n }\n }\n\n return headers;\n }\n\n if (isCompleted) {\n return;\n }\n\n isCompleted = true;\n\n let message: string = xhr.statusText;\n const responseText: string = xhr.responseText;\n let status: number = xhr.status;\n\n if (mode === TIMEOUT || status === 0) {\n message = 'Unable to connect to server.';\n status = 0;\n } else if (mode === LOADED && !status) {\n status = request.method === 'POST' ? 202 : 200;\n } else if (status < 200 || status > 299) {\n const responseBody: any = (xhr as any).responseBody;\n if (!!responseBody && !!responseBody.message) {\n message = responseBody.message;\n } else if (!!responseText && responseText.indexOf('message') !== -1) {\n try {\n message = JSON.parse(responseText).message;\n } catch (e) {\n message = responseText;\n }\n }\n }\n\n callback && callback(status || 500, message || '', responseText, parseResponseHeaders(xhr.getAllResponseHeaders && xhr.getAllResponseHeaders()));\n }\n\n function createRequest(userAgent: string, method: string, url: string): XMLHttpRequest {\n let xhr: any = new XMLHttpRequest();\n if (WITH_CREDENTIALS in xhr) {\n xhr.open(method, url, true);\n\n xhr.setRequestHeader('X-Exceptionless-Client', userAgent);\n if (method === 'POST') {\n xhr.setRequestHeader('Content-Type', 'application/json');\n }\n } else if (typeof XDomainRequest !== 'undefined') {\n useSetTimeout = true;\n xhr = new XDomainRequest();\n xhr.open(method, location.protocol === 'http:' ? url.replace('https:', 'http:') : url);\n } else {\n xhr = null;\n }\n\n if (xhr) {\n xhr.timeout = 10000;\n }\n\n return xhr;\n }\n\n const url = `${request.url}${(request.url.indexOf('?') === -1 ? '?' : '&')}access_token=${encodeURIComponent(request.apiKey)}`;\n const xhr = createRequest(request.userAgent, request.method || 'POST', url);\n if (!xhr) {\n return (callback && callback(503, 'CORS not supported.'));\n }\n\n if (WITH_CREDENTIALS in xhr) {\n xhr.onreadystatechange = () => {\n // xhr not ready.\n if (xhr.readyState !== 4) {\n return;\n }\n\n complete(LOADED, xhr);\n };\n }\n\n xhr.onprogress = () => { };\n xhr.ontimeout = () => complete(TIMEOUT, xhr);\n xhr.onerror = () => complete('error', xhr);\n xhr.onload = () => complete(LOADED, xhr);\n\n if (useSetTimeout) {\n setTimeout(() => xhr.send(request.data), 500);\n } else {\n xhr.send(request.data);\n }\n }\n}\n\n \n\nexport class NodeFileStorage extends KeyValueStorageBase {\n private directory: string;\n private prefix: string;\n private fs: any;\n\n constructor(namespace: string, folder?: string, prefix: string = 'ex-', maxItems: number = 20, fs?: any) {\n super(maxItems);\n\n if (!folder) {\n folder = Path.join(Path.dirname(require.main.filename), '.exceptionless');\n }\n\n const subfolder = Path.join(folder, namespace);\n this.directory = Path.resolve(subfolder);\n this.prefix = prefix;\n this.fs = fs ? fs : Fs;\n\n this.mkdir(this.directory);\n }\n\n public write(key: string, value: string) {\n this.fs.writeFileSync(key, value);\n }\n\n public read(key: string) {\n return this.fs.readFileSync(key, 'utf8');\n }\n\n public readAllKeys() {\n return this.fs.readdirSync(this.directory)\n .filter((file) => file.indexOf(this.prefix) === 0)\n .map((file) => Path.join(this.directory, file));\n }\n\n public delete(key: string) {\n this.fs.unlinkSync(key);\n }\n\n public getKey(timestamp) {\n return Path.join(this.directory, `${this.prefix}${timestamp}.json`);\n }\n\n public getTimestamp(key) {\n return parseInt(Path.basename(key, '.json')\n .substr(this.prefix.length), 10);\n }\n\n private mkdir(path) {\n const dirs = path.split(Path.sep);\n let root = '';\n\n while (dirs.length > 0) {\n const dir = dirs.shift();\n if (dir === '') {\n root = Path.sep;\n }\n if (!this.fs.existsSync(root + dir)) {\n this.fs.mkdirSync(root + dir);\n }\n root += dir + Path.sep;\n }\n }\n}\n\n \n\nexport class NodeEnvironmentInfoCollector implements IEnvironmentInfoCollector {\n public getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo {\n function getIpAddresses(): string {\n const ips: string[] = [];\n const interfaces = os.networkInterfaces();\n Object.keys(interfaces).forEach((name) => {\n interfaces[name].forEach((iface: any) => {\n if ('IPv4' === iface.family && !iface.internal) {\n ips.push(iface.address);\n }\n });\n });\n\n return ips.join(', ');\n }\n\n if (!os) {\n return null;\n }\n\n const environmentInfo: IEnvironmentInfo = {\n processor_count: os.cpus().length,\n total_physical_memory: os.totalmem(),\n available_physical_memory: os.freemem(),\n command_line: process.argv.join(' '),\n process_name: (process.title || '').replace(/[\\uE000-\\uF8FF]/g, ''),\n process_id: process.pid + '',\n process_memory_size: process.memoryUsage().heapTotal,\n // thread_id: '',\n architecture: os.arch(),\n o_s_name: os.type(),\n o_s_version: os.release(),\n ip_address: getIpAddresses(),\n machine_name: os.hostname(),\n // install_id: '',\n runtime_version: process.version,\n data: {\n loadavg: os.loadavg(),\n platform: os.platform(),\n tmpdir: os.tmpdir(),\n uptime: os.uptime()\n }\n };\n\n if ((os as any).endianness) {\n environmentInfo.data.endianness = (os as any).endianness();\n }\n\n return environmentInfo;\n }\n}\n\n \n\nexport class NodeErrorParser implements IErrorParser {\n public parse(context: EventPluginContext, exception: Error): IError {\n function getStackFrames(stackFrames: any[]): IStackFrame[] {\n const frames: IStackFrame[] = [];\n\n for (const frame of stackFrames) {\n frames.push({\n name: frame.getMethodName() || frame.getFunctionName(),\n // parameters: frame.args,\n file_name: frame.getFileName(),\n line_number: frame.getLineNumber() || 0,\n column: frame.getColumnNumber() || 0,\n declaring_type: frame.getTypeName(),\n data: {\n is_native: frame.isNative() || (!!frame.filename && frame.filename[0] !== '/' && frame.filename[0] !== '.')\n }\n });\n }\n\n return frames;\n }\n\n if (!nodestacktrace) {\n throw new Error('Unable to load the stack trace library.');\n }\n\n const stackFrames = nodestacktrace.parse(exception) || [];\n return {\n type: exception.name || 'Error',\n message: exception.message,\n stack_trace: getStackFrames(stackFrames)\n };\n }\n}\n\n \n\nexport class NodeModuleCollector implements IModuleCollector {\n\n private initialized: boolean = false;\n private installedModules: { [id: string]: IModule } = {};\n\n public getModules(context: EventPluginContext): IModule[] {\n this.initialize();\n\n if (!require.main) {\n return [];\n }\n\n const modulePath = path.dirname(require.main.filename) + '/node_modules/';\n const pathLength = modulePath.length;\n\n const loadedKeys = Object.keys(require.cache);\n const loadedModules = {};\n\n loadedKeys.forEach((key) => {\n let id = key.substr(pathLength);\n id = id.substr(0, id.indexOf('/'));\n loadedModules[id] = true;\n });\n\n return Object.keys(loadedModules)\n .map((key) => this.installedModules[key])\n .filter((m) => m !== undefined);\n }\n\n private initialize() {\n if (this.initialized) {\n return;\n }\n\n this.initialized = true;\n\n const output = child.spawnSync('npm', ['ls', '--depth=0', '--json']).stdout;\n\n if (!output) {\n return;\n }\n\n let json;\n try {\n json = JSON.parse(output.toString());\n } catch (e) {\n return;\n }\n\n const items = json.dependencies;\n if (!items) {\n return;\n }\n\n let id = 0;\n this.installedModules = {};\n\n Object.keys(items).forEach((key) => {\n const item = items[key];\n const theModule: IModule = {\n module_id: id++,\n name: key,\n version: item.version\n };\n\n this.installedModules[key] = theModule;\n });\n }\n}\n\n \n\nexport class NodeRequestInfoCollector implements IRequestInfoCollector {\n public getRequestInfo(context: EventPluginContext): IRequestInfo {\n const REQUEST_KEY: string = '@request'; // optimization for minifier.\n if (!context.contextData[REQUEST_KEY]) {\n return null;\n }\n\n const exclusions = context.client.config.dataExclusions;\n\n // TODO: include referrer\n const request = context.contextData[REQUEST_KEY];\n const requestInfo: IRequestInfo = {\n client_ip_address: request.ip,\n user_agent: request.headers['user-agent'],\n is_secure: request.secure,\n http_method: request.method,\n host: request.hostname || request.host,\n path: request.path,\n post_data: JSON.parse(Utils.stringify(request.body || {}, exclusions)),\n cookies: Utils.getCookies(request.headers.cookie, exclusions),\n query_string: JSON.parse(Utils.stringify(request.params || {}, exclusions))\n };\n\n const host = request.headers.host;\n const port: number = host && parseInt(host.slice(host.indexOf(':') + 1), 10);\n if (port > 0) {\n requestInfo.port = port;\n }\n\n return requestInfo;\n }\n}\n\n \n\nexport class NodeFileStorageProvider implements IStorageProvider {\n public queue: IStorage;\n public settings: IStorage;\n\n constructor(folder?: string, prefix?: string, maxQueueItems: number = 250) {\n this.queue = new NodeFileStorage('q', folder, prefix, maxQueueItems);\n this.settings = new NodeFileStorage('settings', folder, prefix, 1);\n }\n}\n\n \n\nexport class NodeSubmissionAdapter implements ISubmissionAdapter {\n public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) {\n if (isAppExiting) {\n this.sendRequestSync(request, callback);\n return;\n }\n\n const parsedHost = url.parse(request.url);\n\n const options: https.RequestOptions = {\n auth: `client:${request.apiKey}`,\n headers: {},\n hostname: parsedHost.hostname,\n method: request.method,\n port: parsedHost.port && parseInt(parsedHost.port, 10),\n path: request.url\n };\n\n options.headers['User-Agent'] = request.userAgent;\n\n if (request.method === 'POST') {\n options.headers = {\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(request.data)\n };\n }\n\n const protocol: any = (parsedHost.protocol === 'https' ? https : http);\n const clientRequest: http.ClientRequest = protocol.request(options, (response: http.IncomingMessage) => {\n let body = '';\n response.setEncoding('utf8');\n response.on('data', (chunk) => body += chunk);\n response.on('end', () => this.complete(response, body, response.headers, callback));\n });\n\n clientRequest.on('error', (error: Error) => callback && callback(500, error.message));\n clientRequest.end(request.data);\n }\n\n private complete(response: http.IncomingMessage, responseBody: string, responseHeaders: object, callback: SubmissionCallback): void {\n let message: string;\n if (response.statusCode === 0) {\n message = 'Unable to connect to server.';\n } else if (response.statusCode < 200 || response.statusCode > 299) {\n message = response.statusMessage || ( response as any).message;\n }\n\n callback && callback(response.statusCode || 500, message, responseBody, responseHeaders);\n }\n\n private sendRequestSync(request: SubmissionRequest, callback: SubmissionCallback): void {\n const requestJson = JSON.stringify(request);\n const res = child.spawnSync(process.execPath, [require.resolve('./submitSync.js')],\n {\n input: requestJson,\n stdio: ['pipe', 'pipe', process.stderr]\n });\n\n const out = res.stdout.toString();\n const result = JSON.parse(out);\n\n callback && callback(result.status, result.message, result.data, result.headers);\n }\n}\n\n \n\n(function init() {\n function getDefaultsSettingsFromScriptTag(): IConfigurationSettings {\n if (!document || !document.getElementsByTagName) {\n return null;\n }\n\n const scripts = document.getElementsByTagName('script');\n // tslint:disable-next-line:prefer-for-of\n for (let index = 0; index < scripts.length; index++) {\n if (scripts[index].src && scripts[index].src.indexOf('/exceptionless') > -1) {\n return Utils.parseQueryString(scripts[index].src.split('?').pop());\n }\n }\n return null;\n }\n\n function processUnhandledException(stackTrace: TraceKit.StackTrace, options?: any): void {\n const builder = ExceptionlessClient.default.createUnhandledException(new Error(stackTrace.message || (options || {}).status || 'Script error'), 'onerror');\n builder.pluginContextData['@@_TraceKit.StackTrace'] = stackTrace;\n builder.submit();\n }\n\n if (typeof document === 'undefined') {\n return;\n }\n\n /*\n TODO: We currently are unable to parse string exceptions.\n function processJQueryAjaxError(event, xhr, settings, error:string): void {\n let client = ExceptionlessClient.default;\n if (xhr.status === 404) {\n client.submitNotFound(settings.url);\n } else if (xhr.status !== 401) {\n client.createUnhandledException(error, 'JQuery.ajaxError')\n .setSource(settings.url)\n .setProperty('status', xhr.status)\n .setProperty('request', settings.data)\n .setProperty('response', xhr.responseText && xhr.responseText.slice && xhr.responseText.slice(0, 1024))\n .submit();\n }\n }\n */\n\n Configuration.prototype.useLocalStorage = function() {\n if (BrowserStorage.isAvailable()) {\n this.storage = new BrowserStorageProvider();\n SettingsManager.applySavedServerSettings(this);\n this.changed();\n }\n };\n\n const defaults = Configuration.defaults;\n const settings = getDefaultsSettingsFromScriptTag();\n if (settings && (settings.apiKey || settings.serverUrl)) {\n defaults.apiKey = settings.apiKey;\n defaults.serverUrl = settings.serverUrl;\n }\n\n defaults.errorParser = new DefaultErrorParser();\n defaults.moduleCollector = new DefaultModuleCollector();\n defaults.requestInfoCollector = new DefaultRequestInfoCollector();\n defaults.submissionAdapter = new DefaultSubmissionAdapter();\n\n TraceKit.report.subscribe(processUnhandledException);\n TraceKit.extendToAsynchronousCallbacks();\n\n // window && window.addEventListener && window.addEventListener('beforeunload', function () {\n // ExceptionlessClient.default.config.queue.process(true);\n // });\n\n // if (typeof $ !== 'undefined' && $(document)) {\n // $(document).ajaxError(processJQueryAjaxError);\n // }\n\n (Error as any).stackTraceLimit = Infinity;\n})();\n\n// tslint:disable-next-line:prefer-const\ndeclare var $;\n\n \n\n(function init() {\n if (typeof process === 'undefined') {\n return;\n }\n\n const defaults = Configuration.defaults;\n defaults.environmentInfoCollector = new NodeEnvironmentInfoCollector();\n defaults.errorParser = new NodeErrorParser();\n defaults.moduleCollector = new NodeModuleCollector();\n defaults.requestInfoCollector = new NodeRequestInfoCollector();\n defaults.submissionAdapter = new NodeSubmissionAdapter();\n\n Configuration.prototype.useLocalStorage = function() {\n this.storage = new NodeFileStorageProvider();\n SettingsManager.applySavedServerSettings(this);\n this.changed();\n };\n\n process.addListener('uncaughtException', (error: Error) => {\n ExceptionlessClient.default.submitUnhandledException(error, 'uncaughtException');\n });\n\n process.on('exit', (code: number) => {\n /**\n * exit codes: https://nodejs.org/api/process.html#process_event_exit\n * From now on, only synchronous code may run. As soon as this method\n * ends, the application inevitably will exit.\n */\n function getExitCodeReason(exitCode: number): string {\n if (exitCode === 1) {\n return 'Uncaught Fatal Exception';\n }\n\n if (exitCode === 3) {\n return 'Internal JavaScript Parse Error';\n }\n\n if (exitCode === 4) {\n return 'Internal JavaScript Evaluation Failure';\n }\n\n if (exitCode === 5) {\n return 'Fatal Exception';\n }\n\n if (exitCode === 6) {\n return 'Non-function Internal Exception Handler ';\n }\n\n if (exitCode === 7) {\n return 'Internal Exception Handler Run-Time Failure';\n }\n\n if (exitCode === 8) {\n return 'Uncaught Exception';\n }\n\n if (exitCode === 9) {\n return 'Invalid Argument';\n }\n\n if (exitCode === 10) {\n return 'Internal JavaScript Run-Time Failure';\n }\n\n if (exitCode === 12) {\n return 'Invalid Debug Argument';\n }\n\n return null;\n }\n\n const client = ExceptionlessClient.default;\n const message = getExitCodeReason(code);\n\n if (message !== null) {\n client.submitLog('exit', message, 'Error');\n }\n\n client.config.queue.process(true);\n // Application will now exit.\n });\n\n (Error as any).stackTraceLimit = Infinity;\n})();\n\n \n\n"]} \ No newline at end of file diff --git a/dist/integrations/angular.js b/dist/integrations/angular.js deleted file mode 100644 index 92d10229..00000000 --- a/dist/integrations/angular.js +++ /dev/null @@ -1,108 +0,0 @@ -angular.module('exceptionless', []) - .constant('$ExceptionlessClient', exceptionless.ExceptionlessClient.default) - .factory('exceptionlessHttpInterceptor', ['$location', '$q', '$ExceptionlessClient', function ($location, $q, $ExceptionlessClient) { - return { - responseError: function responseError(response) { - if (response.status === 404) { - $ExceptionlessClient.submitNotFound(response.config.url); - } - else if (response.status !== 401) { - var message = "[" + response.status + "] " + (response.data && response.data.Message ? response.data.Message : response.config.url); - $ExceptionlessClient.createUnhandledException(new Error(message), 'errorHttpInterceptor') - .setSource(response.config.url) - .setProperty('response', response) - .setProperty('referrer', $location.absUrl()) - .submit(); - } - return $q.reject(response); - } - }; - }]) - .config(['$httpProvider', '$provide', '$ExceptionlessClient', function ($httpProvider, $provide, $ExceptionlessClient) { - $httpProvider.interceptors.push('exceptionlessHttpInterceptor'); - $provide.decorator('$exceptionHandler', ['$delegate', function ($delegate) { - return function (exception, cause) { - $delegate(exception, cause); - $ExceptionlessClient.createUnhandledException(exception, '$exceptionHandler').setMessage(cause).submit(); - }; - }]); - $provide.decorator('$log', ['$delegate', function ($delegate) { - function decorateRegularCall(property, logLevel) { - var previousFn = $delegate[property]; - return $delegate[property] = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (angular.mock) { - $delegate[property].logs = []; - } - previousFn.apply(null, args); - if (args[0] && args[0].length > 0) { - $ExceptionlessClient.submitLog(null, args[0], logLevel); - } - }; - } - $delegate.log = decorateRegularCall('log', 'Trace'); - $delegate.info = decorateRegularCall('info', 'Info'); - $delegate.warn = decorateRegularCall('warn', 'Warn'); - $delegate.debug = decorateRegularCall('debug', 'Debug'); - $delegate.error = decorateRegularCall('error', 'Error'); - return $delegate; - }]); - }]) - .run(['$rootScope', '$ExceptionlessClient', function ($rootScope, $ExceptionlessClient) { - $rootScope.$on('$routeChangeSuccess', function (event, next, current) { - if (!current) { - return; - } - $ExceptionlessClient.createFeatureUsage(current.name) - .setProperty('next', next) - .setProperty('current', current) - .submit(); - }); - $rootScope.$on('$routeChangeError', function (event, current, previous, rejection) { - $ExceptionlessClient.createUnhandledException(new Error(rejection), '$routeChangeError') - .setProperty('current', current) - .setProperty('previous', previous) - .submit(); - }); - $rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) { - if (!toState || toState.name === 'otherwise') { - return; - } - $ExceptionlessClient.createFeatureUsage(toState.controller || toState.name) - .setProperty('toState', toState) - .setProperty('toParams', toParams) - .setProperty('fromState', fromState) - .setProperty('fromParams', fromParams) - .submit(); - }); - $rootScope.$on('$stateNotFound', function (event, unfoundState, fromState, fromParams) { - if (!unfoundState) { - return; - } - $ExceptionlessClient.createNotFound(unfoundState.to) - .setProperty('unfoundState', unfoundState) - .setProperty('fromState', fromState) - .setProperty('fromParams', fromParams) - .submit(); - }); - var stateChangeError = '$stateChangeError'; - $rootScope.$on(stateChangeError, function (event, toState, toParams, fromState, fromParams, error) { - if (!error) { - return; - } - var builder = error && error.status === 404 ? $ExceptionlessClient.createNotFound(error.config.url) : $ExceptionlessClient.createUnhandledException(error, stateChangeError); - builder.setSource(stateChangeError) - .setMessage(error && error.statusText) - .setProperty('toState', toState) - .setProperty('toParams', toParams) - .setProperty('fromState', fromState) - .setProperty('fromParams', fromParams) - .submit(); - }); - $rootScope.$on('$destroy', function () { - $ExceptionlessClient.config.queue.process(); - }); - }]); diff --git a/dist/submitSync.js b/dist/submitSync.js deleted file mode 100644 index cdce0345..00000000 --- a/dist/submitSync.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var http = require("http"); -var https = require("https"); -var url = require("url"); -var child = require("child_process"); -var stream = require("stream"); -var string_decoder_1 = require("string_decoder"); -var NodeSubmissionAdapter = (function () { - function NodeSubmissionAdapter() { - } - NodeSubmissionAdapter.prototype.sendRequest = function (request, callback, isAppExiting) { - var _this = this; - if (isAppExiting) { - this.sendRequestSync(request, callback); - return; - } - var parsedHost = url.parse(request.url); - var options = { - auth: "client:" + request.apiKey, - headers: {}, - hostname: parsedHost.hostname, - method: request.method, - port: parsedHost.port && parseInt(parsedHost.port, 10), - path: request.url - }; - options.headers['User-Agent'] = request.userAgent; - if (request.method === 'POST') { - options.headers = { - 'Content-Type': 'application/json', - 'Content-Length': Buffer.byteLength(request.data) - }; - } - var protocol = (parsedHost.protocol === 'https' ? https : http); - var clientRequest = protocol.request(options, function (response) { - var body = ''; - response.setEncoding('utf8'); - response.on('data', function (chunk) { return body += chunk; }); - response.on('end', function () { return _this.complete(response, body, response.headers, callback); }); - }); - clientRequest.on('error', function (error) { return callback && callback(500, error.message); }); - clientRequest.end(request.data); - }; - NodeSubmissionAdapter.prototype.complete = function (response, responseBody, responseHeaders, callback) { - var message; - if (response.statusCode === 0) { - message = 'Unable to connect to server.'; - } - else if (response.statusCode < 200 || response.statusCode > 299) { - message = response.statusMessage || response.message; - } - callback && callback(response.statusCode || 500, message, responseBody, responseHeaders); - }; - NodeSubmissionAdapter.prototype.sendRequestSync = function (request, callback) { - var requestJson = JSON.stringify(request); - var res = child.spawnSync(process.execPath, [require.resolve('./submitSync.js')], { - input: requestJson, - stdio: ['pipe', 'pipe', process.stderr] - }); - var out = res.stdout.toString(); - var result = JSON.parse(out); - callback && callback(result.status, result.message, result.data, result.headers); - }; - return NodeSubmissionAdapter; -}()); -exports.NodeSubmissionAdapter = NodeSubmissionAdapter; -var decoder = new string_decoder_1.StringDecoder('utf8'); -var strings = []; -var jsonStream = new stream.Writable(); -jsonStream._write = function (chunk, encoding, next) { - strings.push(decoder.write(chunk)); - next(); -}; -jsonStream.on('finish', function () { - var json = strings.join(''); - var request = JSON.parse(json); - var adapter = new NodeSubmissionAdapter(); - adapter.sendRequest(request, function (status, message, data, headers) { - var result = { - status: status, - message: message, - data: data, - headers: headers - }; - process.stdout.write(JSON.stringify(result)); - process.exit(0); - }); -}); -process.stdin.pipe(jsonStream); -//# sourceMappingURL=submitSync.js.map diff --git a/dist/submitSync.js.map b/dist/submitSync.js.map deleted file mode 100644 index b5076826..00000000 --- a/dist/submitSync.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"submitSync.js","sources":["submitSync.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,6BAAgC;AAChC,yBAA4B;AAC5B,qCAAwC;AACxC,+BA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AA;YACN,OAAO,SAAA;YACP,IAAI,MAAA;YACJ,OAAO,SAAA;SACR,CAAC;QACF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import http = require('http');\nimport https = require('https');\nimport url = require('url');\nimport child = require('child_process');\nimport * as stream from 'stream';\nimport { StringDecoder } from 'string_decoder';\nexport type SubmissionCallback = (status: number, message: string, data?: string, headers?: object) => void;\n\nexport interface SubmissionRequest {\n apiKey: string;\n userAgent: string;\n method: string;\n url: string;\n data: string;\n}\n\n \n\nexport interface ISubmissionAdapter {\n sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void;\n}\n\n \n\nexport class NodeSubmissionAdapter implements ISubmissionAdapter {\n public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) {\n if (isAppExiting) {\n this.sendRequestSync(request, callback);\n return;\n }\n\n const parsedHost = url.parse(request.url);\n\n const options: https.RequestOptions = {\n auth: `client:${request.apiKey}`,\n headers: {},\n hostname: parsedHost.hostname,\n method: request.method,\n port: parsedHost.port && parseInt(parsedHost.port, 10),\n path: request.url\n };\n\n options.headers['User-Agent'] = request.userAgent;\n\n if (request.method === 'POST') {\n options.headers = {\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(request.data)\n };\n }\n\n const protocol: any = (parsedHost.protocol === 'https' ? https : http);\n const clientRequest: http.ClientRequest = protocol.request(options, (response: http.IncomingMessage) => {\n let body = '';\n response.setEncoding('utf8');\n response.on('data', (chunk) => body += chunk);\n response.on('end', () => this.complete(response, body, response.headers, callback));\n });\n\n clientRequest.on('error', (error: Error) => callback && callback(500, error.message));\n clientRequest.end(request.data);\n }\n\n private complete(response: http.IncomingMessage, responseBody: string, responseHeaders: object, callback: SubmissionCallback): void {\n let message: string;\n if (response.statusCode === 0) {\n message = 'Unable to connect to server.';\n } else if (response.statusCode < 200 || response.statusCode > 299) {\n message = response.statusMessage || ( response as any).message;\n }\n\n callback && callback(response.statusCode || 500, message, responseBody, responseHeaders);\n }\n\n private sendRequestSync(request: SubmissionRequest, callback: SubmissionCallback): void {\n const requestJson = JSON.stringify(request);\n const res = child.spawnSync(process.execPath, [require.resolve('./submitSync.js')],\n {\n input: requestJson,\n stdio: ['pipe', 'pipe', process.stderr]\n });\n\n const out = res.stdout.toString();\n const result = JSON.parse(out);\n\n callback && callback(result.status, result.message, result.data, result.headers);\n }\n}\n\n \n\nconst decoder = new StringDecoder('utf8');\nconst strings: string[] = [];\n\nconst jsonStream = new stream.Writable();\n(jsonStream as any)._write = (chunk: Buffer | string, encoding: string, next: () => void) => {\n strings.push(decoder.write( chunk as Buffer));\n next();\n};\n\njsonStream.on('finish', () => {\n const json = strings.join('');\n const request: SubmissionRequest = JSON.parse(json);\n const adapter = new NodeSubmissionAdapter();\n adapter.sendRequest(request, (status, message, data, headers) => {\n const result = {\n status,\n message,\n data,\n headers\n };\n process.stdout.write(JSON.stringify(result));\n process.exit(0);\n });\n});\n\nprocess.stdin.pipe(jsonStream);\n\n"],"preExistingComment":"submitSync.js.map"} \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..6b267329 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,47 @@ +import eslint from "@eslint/js"; +import { defineConfig } from "eslint/config"; +import eslintConfigPrettier from "eslint-config-prettier"; +import jest from "eslint-plugin-jest"; +import tseslint from "typescript-eslint"; + +export default defineConfig( + { + ignores: ["**/dist/", "**/node_modules/", ".agents/", "example/", "jest-resolver.cjs"] + }, + eslint.configs.recommended, + { + extends: tseslint.configs.recommendedTypeChecked, + languageOptions: { + parserOptions: { + projectService: { + allowDefaultProject: ["eslint.config.mjs"] + }, + tsconfigRootDir: import.meta.dirname + } + }, + rules: { + "@typescript-eslint/no-inferrable-types": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/no-redundant-type-constituents": "off", + "@typescript-eslint/no-duplicate-type-constituents": "off", + "@typescript-eslint/restrict-plus-operands": "off", + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-unused-expressions": ["error", { allowShortCircuit: true }], + "@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: false }] + } + }, + eslintConfigPrettier, + { + files: ["**/test/**/*.ts"], + extends: [jest.configs["flat/recommended"]], + rules: { + "jest/valid-title": "off", + "jest/valid-describe-callback": "off", + "jest/no-export": "off", + "jest/no-done-callback": "warn" + } + } +); diff --git a/example/RequireJS/index.html b/example/RequireJS/index.html deleted file mode 100644 index 123a7069..00000000 --- a/example/RequireJS/index.html +++ /dev/null @@ -1,46 +0,0 @@ -<!DOCTYPE html> -<html> - <head lang="en"> - <meta charset="UTF-8"> - <title>Exceptionless Sample with RequireJS - - - - - - diff --git a/example/SystemJS/index.html b/example/SystemJS/index.html deleted file mode 100644 index 009d04fc..00000000 --- a/example/SystemJS/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Exceptionless Sample with SystemJS - - - - - - diff --git a/example/TypeScript/index.html b/example/TypeScript/index.html deleted file mode 100644 index 531242a9..00000000 --- a/example/TypeScript/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Exceptionless Test - - - - - - diff --git a/example/TypeScript/index.ts b/example/TypeScript/index.ts deleted file mode 100644 index 3551bc62..00000000 --- a/example/TypeScript/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as exceptionless from '../../dist/exceptionless' - -var client = exceptionless.ExceptionlessClient.default; -client.config.serverUrl = 'http://localhost:50000'; -client.config.useDebugLogger(); - -// set some default data -client.config.defaultData['SampleUser'] = { - id:1, - name: 'Blake', - password: '123456', - passwordResetToken: 'a reset token', - myPasswordValue: '123456', - myPassword: '123456', - customValue: 'Password', - value: { - Password: '123456' - } -}; - -client.config.defaultTags.push('Example', 'JavaScript', 'TypeScript'); -client.submitLog('Testing'); diff --git a/example/TypeScript/tsconfig.json b/example/TypeScript/tsconfig.json deleted file mode 100644 index fac851fd..00000000 --- a/example/TypeScript/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "removeComments": true, - "sourceMap": false, - "target": "es5" - }, - "files": [ - "../../dist/exceptionless.d.ts", - "index.ts" - ], - "bundles": { - "angular": { - "files": [ - "../../dist/exceptionless.d.ts", - "index.ts" - ] - } - } -} diff --git a/example/angular/.bowerrc b/example/angular/.bowerrc deleted file mode 100755 index 8c58c8ef..00000000 --- a/example/angular/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "app/bower_components" -} \ No newline at end of file diff --git a/example/angular/README.md b/example/angular/README.md deleted file mode 100755 index 625274ab..00000000 --- a/example/angular/README.md +++ /dev/null @@ -1,9 +0,0 @@ -### Run the Application - -We have preconfigured the project with a simple development web server. The simplest way to start this server is: - -``` -npm start -``` - -Now browse to the app at `http://localhost:8000/index.html`. diff --git a/example/angular/app/app.constants.js b/example/angular/app/app.constants.js deleted file mode 100755 index 48cb1184..00000000 --- a/example/angular/app/app.constants.js +++ /dev/null @@ -1,10 +0,0 @@ -(function () { - 'use strict'; - - var app = angular.module('myApp'); - app.constant('APP_CONSTANTS', { - EXCEPTIONLESS_API_KEY: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', - EXCEPTIONLESS_SERVER_URL: 'http://localhost:50000' - }); -})(); - diff --git a/example/angular/app/app.css b/example/angular/app/app.css deleted file mode 100755 index 7ffe15d8..00000000 --- a/example/angular/app/app.css +++ /dev/null @@ -1,23 +0,0 @@ -.menu { - list-style: none; - border-bottom: 0.1em solid black; - margin-bottom: 2em; - padding: 0 0 0.5em; -} - -.menu:before { - content: "["; -} - -.menu:after { - content: "]"; -} - -.menu > li { - display: inline; -} - -.menu > li + li:before { - content: "|"; - padding-right: 0.3em; -} diff --git a/example/angular/app/app.js b/example/angular/app/app.js deleted file mode 100755 index 7fe104f4..00000000 --- a/example/angular/app/app.js +++ /dev/null @@ -1,22 +0,0 @@ -(function () { - 'use strict'; - - var app = angular.module('myApp', [ - 'exceptionless', - 'myApp.view1', - 'myApp.view2' - ]); - - app.config(function(APP_CONSTANTS, $ExceptionlessClient) { - $ExceptionlessClient.config.apiKey = APP_CONSTANTS.EXCEPTIONLESS_API_KEY; - $ExceptionlessClient.config.serverUrl = APP_CONSTANTS.EXCEPTIONLESS_SERVER_URL; - $ExceptionlessClient.config.useDebugLogger(); - $ExceptionlessClient.config.setUserIdentity('12345678', 'Blake'); - $ExceptionlessClient.config.useSessions(); - $ExceptionlessClient.config.defaultTags.push('Example', 'JavaScript', 'Angular'); - }); - - app.run(function ($log) { - $log.info('App starting up...'); - }); -})(); diff --git a/example/angular/app/components/user.service.js b/example/angular/app/components/user.service.js deleted file mode 100755 index 7de66209..00000000 --- a/example/angular/app/components/user.service.js +++ /dev/null @@ -1,16 +0,0 @@ -(function () { - 'use strict'; - - angular.module('myApp') - .factory('userService', userService); - - function userService($http) { - return { - getAll: getAll - }; - - function getAll() { - return $http.get('http://random_domain_name_that_doesnt_exist.com/api/users'); - } - } -})(); diff --git a/example/angular/app/index.html b/example/angular/app/index.html deleted file mode 100755 index bf4887a2..00000000 --- a/example/angular/app/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Exceptionless Angular Sample App - - - - - - - -

- -
- - - - - - - - - - - - diff --git a/example/angular/app/view1/view1.html b/example/angular/app/view1/view1.html deleted file mode 100755 index 6de0eaaf..00000000 --- a/example/angular/app/view1/view1.html +++ /dev/null @@ -1 +0,0 @@ -

This view throws an exception while loading the controller.

diff --git a/example/angular/app/view1/view1.js b/example/angular/app/view1/view1.js deleted file mode 100755 index 6eaf1cc1..00000000 --- a/example/angular/app/view1/view1.js +++ /dev/null @@ -1,18 +0,0 @@ -(function () { - 'use strict'; - - angular.module('myApp.view1', ['ui.router']) - .config(routerConfig) - .controller('View1Ctrl', function () { - throw "Error occurred inside of View1Ctrl"; - }); - - function routerConfig($stateProvider) { - $stateProvider - .state('view1', { - url: '/view1', - templateUrl: 'view1/view1.html', - controller: 'View1Ctrl' - }); - } -})(); diff --git a/example/angular/app/view2/view2.html b/example/angular/app/view2/view2.html deleted file mode 100755 index e5629bec..00000000 --- a/example/angular/app/view2/view2.html +++ /dev/null @@ -1 +0,0 @@ -

This view throws an $http error trying to get an invalid html resource.

diff --git a/example/angular/app/view2/view2.js b/example/angular/app/view2/view2.js deleted file mode 100755 index de50b2e6..00000000 --- a/example/angular/app/view2/view2.js +++ /dev/null @@ -1,18 +0,0 @@ -(function () { - 'use strict'; - - angular.module('myApp.view2', ['ui.router', 'myApp']) - .config(routerConfig) - .controller('View2Ctrl', function (userService) { - var users = userService.getAll(); - }); - - function routerConfig($stateProvider) { - $stateProvider - .state('view2', { - url: '/view2', - templateUrl: 'view2/view2.html', - controller: 'View2Ctrl' - }); - } -})(); diff --git a/example/angular/bower.json b/example/angular/bower.json deleted file mode 100755 index 07178a4e..00000000 --- a/example/angular/bower.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "exceptionless-angular-example", - "description": "An Exceptionless sample angular app", - "homepage": "https://github.com/exceptionless/Exceptionless.JavaScript", - "private": true, - "dependencies": { - "angular": "^1.5.8", - "angular-loader": "^1.5.8", - "angular-ui-router": "^0.3.1", - "exceptionless": "^1.4.2", - "html5-boilerplate": "^5.3.0" - } -} diff --git a/example/angular/package.json b/example/angular/package.json deleted file mode 100755 index 2c961146..00000000 --- a/example/angular/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "exceptionless-angular-example", - "private": true, - "description": "An Exceptionless sample angular app", - "repository": "https://github.com/exceptionless/Exceptionless.JavaScript", - "devDependencies": { - "bower": "^1.7.7", - "http-server": "^0.9.0" - }, - "scripts": { - "postinstall": "bower install", - - "prestart": "npm install", - "start": "http-server -a localhost -p 8000 -c-1 ./app" - } -} diff --git a/example/browser/index.html b/example/browser/index.html new file mode 100644 index 00000000..9da74706 --- /dev/null +++ b/example/browser/index.html @@ -0,0 +1,40 @@ + + + + + Exceptionless Test + + +

Error Submission

+ + + + + + + + + + + +

Log Submission

+ + + + + + + + +

Diagnostics

+ + +

Benchmark

+ + +

Client Logs

+ + + + + diff --git a/example/browser/index.js b/example/browser/index.js new file mode 100644 index 00000000..df524fbb --- /dev/null +++ b/example/browser/index.js @@ -0,0 +1,265 @@ +import { Exceptionless, prune } from "../../node_modules/@exceptionless/browser/dist/index.bundle.js"; +import "/node_modules/jquery/dist/jquery.js"; + +import { divide } from "./math.js"; +import { TextAreaLogger } from "./text-area-logger.js"; + +await Exceptionless.startup((c) => { + c.useDebugLogger(); + c.services.log = new TextAreaLogger("logs", c.services.log); + + c.apiKey = "LhhP1C9gijpSKCslHHCvwdSIz298twx271nTest"; + c.serverUrl = "https://localhost:5100"; + c.updateSettingsWhenIdleInterval = 15000; + c.usePersistedQueueStorage = true; + c.setUserIdentity("12345678", "Blake"); + c.useSessions(); + + // set some default data + c.defaultData["SampleUser"] = { + id: 1, + name: "Blake", + password: "123456", + passwordResetToken: "a reset token", + myPasswordValue: "123456", + myPassword: "123456", + customValue: "Password", + value: { + Password: "123456" + } + }; + + c.defaultTags.push("Example", "JavaScript"); + c.settings["@@error:MediaError"] = "Off"; +}); + +const registerEventHandlers = () => { + const elements = document.querySelectorAll(".submit-log"); + for (const element of elements) { + element.addEventListener("click", (event) => { + const level = event.target.attributes["data-level"]?.value; + Exceptionless.submitLog("sendEvents", `This is a log message with level: ${level || ""}`, level); + }); + } + + document.querySelector("#submit-error-log-with-error").addEventListener("click", async () => { + const builder = Exceptionless.createLog("Button Click", "Error Log with Error"); + builder.context.setException(new Error("test")); + await builder.submit(); + }); + + document.querySelector("#throw-browser-extension-error").addEventListener("click", () => { + const error = new Error("A Browser Extension Error"); + error.stack = "at () in chrome-extension://bmagokdooijbeehmkpknfglimnifench/firebug-lite.js:line 9716:col 29"; + + throw error; + }); + + document.querySelector("#throw-custom-error").addEventListener("click", () => { + throw new CustomError("A Custom Error", 500); + }); + + document.querySelector("#throw-division-by-zero-error").addEventListener("click", () => { + divide(10, 0); + }); + + document.querySelector("#throw-index-out-of-range").addEventListener("click", () => { + throwIndexOutOfRange(); + }); + + document.querySelector("#throw-index-out-of-range-custom-stacking").addEventListener("click", () => { + throwIndexOutOfRange(1, true); + }); + + document.querySelector("#throw-string-error").addEventListener("click", () => { + throwStringError(); + }); + + document.querySelector("#throw-ignored-error").addEventListener("click", () => { + throw new MediaError("An Ignored Exception Type"); + }); + + document.querySelector("#throw-jquery-ajax-error").addEventListener("click", () => { + $.ajax("http://notexistenturlthrowserror", { + type: "POST", + success: (data, textStatus, jqXHR) => { + console.log({ message: "jQuery.ajax.success", data, textStatus, jqXHR }); + }, + error: (jqXHR, textStatus, errorThrown) => { + console.log({ message: "jQuery.ajax.error", jqXHR, textStatus, errorThrown }); + } + }); + }); + + document.querySelector("#throw-promise-unhandled-rejection").addEventListener("click", () => { + const promiseFn = () => + new Promise(function (_, reject) { + switch (Math.floor(Math.random() * 5)) { + case 0: + reject(0); + break; + case 1: + reject(new Error("Promise rejected error")); + break; + case 2: + reject("Promise rejected string"); + break; + case 3: + reject(); + break; + case 4: + throw new Error("Error thrown from promise"); + } + }); + + promiseFn(); + }); + + document.querySelector("#config-settings-log").addEventListener("click", () => { + Exceptionless.config.services.log.info(JSON.stringify(Exceptionless.config.settings)); + }); + + document.querySelector("#prune-large-object-benchmark").addEventListener("click", () => { + const data = { + str: "hello", + num: 123, + bool: true, + nullVal: null, + undefinedVal: undefined, + arr: [ + "foo", + 42, + { + prop1: "bar", + prop2: true, + prop3: [ + 1, + 2, + { + nestedProp1: "baz", + nestedProp2: false, + nestedObj: {} + } + ] + } + ], + person: { + name: "John", + age: 30, + address: { + street: "123 Main St", + city: "Anytown", + state: "TX", + country: { + name: "United States", + region: { + north: { + name: "North Region", + states: ["New York", "Vermont", "New Hampshire", "Maine"] + }, + south: { + name: "South Region", + states: ["Texas", "Florida", "Georgia", "North Carolina"] + }, + east: { + name: "East Region", + states: ["New York", "Massachusetts", "Connecticut", "New Jersey"] + }, + west: { + name: "West Region", + states: ["California", "Oregon", "Washington", "Arizona"] + } + } + } + } + }, + func: function (x) { + return x * 2; + }, + date: new Date(), + regex: /foo(bar)?/i, + symbol: Symbol("my symbol"), + bigint: 9007199254740991n, + map: new Map([ + [{ id: 1 }, "value associated with an object key"], + ["string key", "value associated with a string key"], + [123, "value associated with a number key"], + [Symbol("symbol key"), "value associated with a symbol key"] + ]), + set: new Set(["foo", 42, { prop: "value" }]) + }; + + const { log } = Exceptionless.config.services; + log.info("Starting pruning of large object"); + + const start = performance.now(); + for (let i = 0; i < 1000; i++) { + prune(data, 3); + } + const end = performance.now(); + + log.info(`Pruning large object took ${end - start} milliseconds`); + }); +}; + +async function throwIndexOutOfRange(indexer, withCustomStacking) { + try { + getNonexistentData(indexer); + } catch (e) { + if (withCustomStacking) { + if (Math.random() < 0.5) { + await Exceptionless.createException(e).setManualStackingKey("MyCustomStackingKey").submit(); + } else { + await Exceptionless.createException(e) + .setManualStackingInfo( + { + File: "index.js", + Function: "throwIndexOutOfRange" + }, + "Custom Index Out Of Range Exception" + ) + .submit(); + } + } else { + await Exceptionless.submitException(e); + } + } +} + +function getNonexistentData(...args) { + /* random comment */ nonexistentArray[args[0]]; // second random comment; +} + +function throwStringError() { + return throwStringErrorImpl("string error message"); +} + +function throwStringErrorImpl(message) { + throw message; +} + +class CustomError extends Error { + constructor(message, code) { + super(message); + this.name = "CustomError"; + this.code = code; // Extra property; + } + + getValue() { + return 5; + } + + getPromiseValue() { + return new Promise((r) => r({ expensive: "call" })); + } + + get getThrowsError() { + throw new Error("Not Implemented"); + } +} + +if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", registerEventHandlers); +} else { + registerEventHandlers(); +} diff --git a/example/math.js b/example/browser/math.js similarity index 68% rename from example/math.js rename to example/browser/math.js index f2317815..5e2a8305 100644 --- a/example/math.js +++ b/example/browser/math.js @@ -1,4 +1,4 @@ -function divide(numerator, denominator) { +export function divide(numerator, denominator) { if (denominator == 0) { throw new Error("Division by zero."); } diff --git a/example/browser/package.json b/example/browser/package.json new file mode 100644 index 00000000..e2fe82d5 --- /dev/null +++ b/example/browser/package.json @@ -0,0 +1,17 @@ +{ + "name": "browser-sample", + "private": true, + "version": "3.0.0-dev", + "description": "Exceptionless Sample Browser App", + "main": "index.js", + "type": "module", + "author": "Exceptionless", + "license": "Apache-2.0", + "publishConfig": { + "access": "restricted" + }, + "dependencies": { + "@exceptionless/browser": "3.0.0-dev", + "jquery": "^4.0.0" + } +} diff --git a/example/browser/text-area-logger.js b/example/browser/text-area-logger.js new file mode 100644 index 00000000..6d20ae04 --- /dev/null +++ b/example/browser/text-area-logger.js @@ -0,0 +1,45 @@ +export class TextAreaLogger { + constructor(elementId, logger) { + if (!elementId) { + throw new Error("elementId is required"); + } + + this.logger = logger; + this.messageBuffer = []; + if (document.readyState === "complete") { + this.element = document.getElementById(elementId); + } else { + document.addEventListener("DOMContentLoaded", () => { + this.element = document.getElementById(elementId); + this.element.innerHTML = this.messageBuffer.join("\n") + this.element.innerHTML; + this.messageBuffer = []; + }); + } + } + + trace(message) { + this.logger?.trace(message); + this.log("debug", message); + } + info(message) { + this.logger?.info(message); + this.log("info", message); + } + warn(message) { + this.logger?.warn(message); + this.log("warn", message); + } + error(message) { + this.logger?.error(message); + this.log("error", message); + } + + log(level, message) { + const formattedMessage = `${new Date().toISOString()} [${level}] ${message}`; + if (this.element) { + this.element.innerHTML += `\n${formattedMessage}`; + } else { + this.messageBuffer.push(formattedMessage); + } + } +} diff --git a/example/express/app.js b/example/express/app.js index 97d0034f..b89a849c 100644 --- a/example/express/app.js +++ b/example/express/app.js @@ -1,57 +1,76 @@ -var express = require('express'); -var app = express(); - -var client = require('../../dist/exceptionless.node').ExceptionlessClient.default; -client.config.apiKey = 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw'; -client.config.serverUrl = 'http://localhost:50000'; -client.config.useDebugLogger(); -client.config.useLocalStorage(); - -// set some default data -client.config.defaultData['SampleUser'] = { - id:1, - name: 'Blake', - password: '123456', - passwordResetToken: 'a reset token', - myPasswordValue: '123456', - myPassword: '123456', - customValue: 'Password', - value: { - Password: '123456' - } -}; +import { Exceptionless, KnownEventDataKeys } from "@exceptionless/node"; +import express from "express"; + +await Exceptionless.startup((c) => { + c.apiKey = "LhhP1C9gijpSKCslHHCvwdSIz298twx271nTest"; + c.serverUrl = "https://localhost:5100"; + c.useDebugLogger(); + c.useLocalStorage(); + c.usePersistedQueueStorage = true; + + c.defaultTags.push("Example", "Node"); -client.config.defaultTags.push('Example', 'Node'); + // set some default data + c.defaultData["SampleUser"] = { + id: 1, + name: "Blake", + password: "123456", + passwordResetToken: "a reset token", + myPasswordValue: "123456", + myPassword: "123456", + customValue: "Password", + value: { + Password: "123456" + } + }; +}); + +const app = express(); +app.get("/", async (req, res) => { + await Exceptionless.submitLog("loading index content"); + res.send("Hello World!"); +}); -app.get('/', function index(req, res) { - client.submitLog('loading index content'); - res.send('Hello World!'); +app.get("/about", async (req, res) => { + await Exceptionless.submitFeatureUsage("about"); + res.send("About"); }); -app.get('/about', function about(req, res) { - client.submitFeatureUsage('about'); - res.send('About'); +app.get("/boom", function boom(req, res) { + throw new Error("Boom!!"); }); -app.get('/boom', function boom(req, res) { - throw new Error('Boom!!'); +app.get("/trycatch", async (req, res) => { + try { + throw new Error("Caught in try/catch"); + } catch (error) { + await Exceptionless.createException(error).setContextProperty(KnownEventDataKeys.RequestInfo, req).submit(); + + res.status(500).send("Error caught in try/catch"); + } }); -app.use(function(err, req, res, next) { - client.createUnhandledException(err, 'express').addRequestInfo(req).submit(); - res.status(500).send('Something broke!'); +app.use(async (err, req, res, next) => { + if (res.headersSent) { + return next(err); + } + + await Exceptionless.createUnhandledException(err, "express").setContextProperty(KnownEventDataKeys.RequestInfo, req).submit(); + + res.status(500).send("Something broke!"); }); -app.use(function(req, res, next) { - client.createNotFound(req.originalUrl).addRequestInfo(req).submit(); - res.status(404).send('Sorry cant find that!'); +app.use(async (req, res) => { + await Exceptionless.createNotFound(req.originalUrl).setContextProperty(KnownEventDataKeys.RequestInfo, req).submit(); + res.status(404).send("Sorry cant find that!"); }); -var server = app.listen(3000, function () { +const server = app.listen(3000, async () => { var host = server.address().address; var port = server.address().port; - var message = 'Example app listening at http://' + host + port; - console.log(message); - client.submitLog('app', message , 'Info'); + var message = "Example app listening at http://" + host + port; + await Exceptionless.submitLog("app", message, "Info"); }); + +export default app; diff --git a/example/express/package-lock.json b/example/express/package-lock.json deleted file mode 100644 index 8980d87d..00000000 --- a/example/express/package-lock.json +++ /dev/null @@ -1,222 +0,0 @@ -{ - "name": "exapp", - "version": "1.0.0", - "lockfileVersion": 1, - "dependencies": { - "accepts": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", - "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=" - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" - }, - "content-type": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz", - "integrity": "sha1-t9ETrueo3Se9IRM8TcJSnfFyHu0=" - }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "debug": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", - "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=" - }, - "depd": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz", - "integrity": "sha1-4b2Cxqq2ztlluXuIsX7T5SjKGMM=" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "encodeurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", - "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=" - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "etag": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz", - "integrity": "sha1-b2Ma7zNtbEY2K1F2QETOIWvjwFE=" - }, - "express": { - "version": "4.15.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.15.3.tgz", - "integrity": "sha1-urZdDwOqgMNYQIly/HAPkWlEtmI=" - }, - "finalhandler": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.3.tgz", - "integrity": "sha1-70fneVDpmXgOhgIqVg4yF+DQzIk=" - }, - "forwarded": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.0.tgz", - "integrity": "sha1-Ge+YdMSuHCl7zweP3mOgm2aoQ2M=" - }, - "fresh": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz", - "integrity": "sha1-9HTKXmqSRtb9jglTz6m5yAWvp44=" - }, - "http-errors": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz", - "integrity": "sha1-X4uO2YrKVFZWv1cplzh/kEpyIlc=" - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "ipaddr.js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.3.0.tgz", - "integrity": "sha1-HgOlL9rYOou7KyXL9JmLTP/NPew=" - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "mime": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=" - }, - "mime-db": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", - "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=" - }, - "mime-types": { - "version": "2.1.15", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", - "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=" - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=" - }, - "parseurl": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", - "integrity": "sha1-yKuMkiO6NIiKpkopeyiFO+wY2lY=" - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "proxy-addr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.4.tgz", - "integrity": "sha1-J+VF9pYKRKYn2bREZ+NcG2tM4vM=" - }, - "qs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" - }, - "send": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/send/-/send-0.15.3.tgz", - "integrity": "sha1-UBP5+ZAj31DRvZiSwZ4979HVMwk=" - }, - "serve-static": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz", - "integrity": "sha1-n0uhni8wMMVH+K+ZEHg47DjVseI=" - }, - "setprototypeof": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" - }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" - }, - "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" - }, - "type-is": { - "version": "1.6.15", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", - "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=" - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "utils-merge": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", - "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=" - }, - "vary": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz", - "integrity": "sha1-Z1Neu2lMHVIldFeYRmUyP1h+jTc=" - } - } -} diff --git a/example/express/package.json b/example/express/package.json index 7bc19f1f..1a05cb81 100644 --- a/example/express/package.json +++ b/example/express/package.json @@ -1,12 +1,21 @@ { - "name": "exapp", - "version": "1.0.0", + "name": "express-sample", + "private": true, + "version": "3.0.0-dev", "description": "Exceptionless Sample Node App", "main": "app.js", + "type": "module", "author": "Exceptionless", "license": "Apache-2.0", + "scripts": { + "dev": "node app.js --enable-source-maps --watch", + "start": "node app.js --enable-source-maps" + }, + "publishConfig": { + "access": "restricted" + }, "dependencies": { - "express": "^4.12.4", - "stack-trace": "0.0.10" + "express": "^5.2.1", + "@exceptionless/node": "3.0.0-dev" } } diff --git a/example/index.html b/example/index.html deleted file mode 100644 index a29474c6..00000000 --- a/example/index.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - Exceptionless Test - - - - - - - - - - - - - - -
-
- - - - - - -
-
- - - diff --git a/example/index.js b/example/index.js deleted file mode 100644 index e5665b7b..00000000 --- a/example/index.js +++ /dev/null @@ -1,76 +0,0 @@ -function getNonexistentData() { - /* random comment */ nonexistentArray[arguments[0]]; // second random comment; -} - -function sendEvents(numberToSends, eventType) { - for (var index = 0; index < numberToSends; index++) { - switch (eventType || getRandomInt(0, 5)) { - case 0: { - throwIndexOutOfRange(); - break; - } - case 1: { - exceptionless.ExceptionlessClient.default.submitLog('sendEvents', 'This is a test trace message', 'trace'); - break; - } - case 2: { - exceptionless.ExceptionlessClient.default.submitLog('sendEvents', 'This is a test debug message', 'debug'); - break; - } - case 3: { - exceptionless.ExceptionlessClient.default.submitLog('sendEvents', 'This is a test info message', 'info'); - break; - } - case 4: { - exceptionless.ExceptionlessClient.default.submitLog('sendEvents', 'This is a test warn message', 'warn'); - break; - } - case 5: { - exceptionless.ExceptionlessClient.default.submitLog('sendEvents', 'This is a test error message', 'error'); - break; - } - } - } -} - -function getRandomInt(min, max) { - exceptionless.ExceptionlessClient.default.submitLog('getting random int min:' + min + ' max:' + max); - return Math.floor(Math.random() * (max - min + 1)) + min; -} - -function throwDivisionByZero() { - return divide(10, 0); -} - -function throwStringError() { - return throwStringErrorImpl('string error message'); -} - -function throwIndexOutOfRange(indexer, withCustomStacking) { - try { - getNonexistentData(indexer); - } catch (e) { - var client = exceptionless.ExceptionlessClient.default; - if (withCustomStacking) { - if (Math.random() < .5) { - client.createException(e).setManualStackingKey('MyCustomStackingKey').submit(); - } else { - client.createException(e).setManualStackingInfo({ - File: 'index.js', - Function: 'throwIndexOutOfRange' - }, 'Custom Index Out Of Range Exception').submit(); - } - } else { - client.submitException(e); - } - } -} - -function throwStringErrorImpl(message) { - throw new Error(message); -} - -function logClientConfigurationSettings() { - var client = exceptionless.ExceptionlessClient.default; - console.log(client.config.settings); -} diff --git a/example/react/.env b/example/react/.env new file mode 100644 index 00000000..6f809cc2 --- /dev/null +++ b/example/react/.env @@ -0,0 +1 @@ +SKIP_PREFLIGHT_CHECK=true diff --git a/example/react/.gitignore b/example/react/.gitignore new file mode 100644 index 00000000..4d29575d --- /dev/null +++ b/example/react/.gitignore @@ -0,0 +1,23 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/example/react/README.md b/example/react/README.md new file mode 100644 index 00000000..c667d694 --- /dev/null +++ b/example/react/README.md @@ -0,0 +1,15 @@ +## Exceptionless React Example + +This example shows how to use the `@exceptionless/react` package. There is both a class component example (App.js) and a function component example with hooks (HooksExampleApp.js). + +The package includes [error boundary support](https://reactjs.org/docs/error-boundaries.html) which means uncaught errors inside your components will automatically be sent to Exceptionless. + +To run locally, follow these steps: + +1. `git clone https://github.com/exceptionless/Exceptionless.JavaScript` +2. `cd Exceptionless.Javascript` +3. `npm install` +4. `cd example/react` +5. `npm start` + +Reference the main `@exceptionless/react` [README](../../packages/react/README.md) here when building your own React app. diff --git a/example/react/index.html b/example/react/index.html new file mode 100644 index 00000000..a12035c4 --- /dev/null +++ b/example/react/index.html @@ -0,0 +1,32 @@ + + + + + + + + + + + + React App + + + +
+ + + + diff --git a/example/react/package.json b/example/react/package.json new file mode 100644 index 00000000..77300265 --- /dev/null +++ b/example/react/package.json @@ -0,0 +1,44 @@ +{ + "name": "react-example", + "private": true, + "version": "3.0.0-dev", + "scripts": { + "start": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^16.3.2", + "@testing-library/user-event": "^14.6.1", + "@vitejs/plugin-react": "^6.0.1", + "vite": "^8.0.2" + }, + "dependencies": { + "@exceptionless/react": "3.0.0-dev", + "react": "^19.2.4", + "react-dom": "^19.2.4" + }, + "type": "module", + "publishConfig": { + "access": "restricted" + } +} diff --git a/example/react/public/favicon.ico b/example/react/public/favicon.ico new file mode 100644 index 00000000..a11777cc Binary files /dev/null and b/example/react/public/favicon.ico differ diff --git a/example/react/public/logo192.png b/example/react/public/logo192.png new file mode 100644 index 00000000..fc44b0a3 Binary files /dev/null and b/example/react/public/logo192.png differ diff --git a/example/react/public/logo512.png b/example/react/public/logo512.png new file mode 100644 index 00000000..a4e47a65 Binary files /dev/null and b/example/react/public/logo512.png differ diff --git a/example/react/public/manifest.json b/example/react/public/manifest.json new file mode 100644 index 00000000..080d6c77 --- /dev/null +++ b/example/react/public/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/example/react/public/robots.txt b/example/react/public/robots.txt new file mode 100644 index 00000000..e9e57dc4 --- /dev/null +++ b/example/react/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/example/react/src/App.css b/example/react/src/App.css new file mode 100644 index 00000000..3674277f --- /dev/null +++ b/example/react/src/App.css @@ -0,0 +1,43 @@ +.App { + text-align: center; +} + +.App-logo { + height: 40vmin; + pointer-events: none; +} + +@media (prefers-reduced-motion: no-preference) { + .App-logo { + animation: App-logo-spin infinite 20s linear; + } +} + +.App-header { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; +} + +.App-link { + color: #61dafb; +} + +.container { + max-width: 85%; + margin: auto; +} + +@keyframes App-logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} diff --git a/example/react/src/App.jsx b/example/react/src/App.jsx new file mode 100644 index 00000000..b98186e3 --- /dev/null +++ b/example/react/src/App.jsx @@ -0,0 +1,89 @@ +import React, { Component } from "react"; +import "./App.css"; +import { Exceptionless, ExceptionlessErrorBoundary } from "@exceptionless/react"; + +class App extends Component { + constructor(props) { + super(props); + this.state = { + error: false, + message: "", + errorInfo: "" + }; + } + async componentDidMount() { + await Exceptionless.startup((c) => { + c.apiKey = "LhhP1C9gijpSKCslHHCvwdSIz298twx271nTest"; + c.serverUrl = "https://localhost:5100"; + c.useDebugLogger(); + + c.defaultTags.push("Example", "React"); + }); + } + + throwErrorInComponent = () => { + this.setState({ error: true }); + }; + + submitMessage = async () => { + const message = "Hello, world!"; + this.setState({ message: "", errorInfo: "" }); + await Exceptionless.submitLog(message); + this.setState({ message }); + }; + + tryCatchExample = async () => { + try { + this.setState({ message: "", errorInfo: "" }); + throw new Error("Caught in the try/catch"); + } catch (error) { + this.setState({ errorInfo: error.message }); + await Exceptionless.submitException(error); + } + }; + + unhandledExceptionExample = () => { + throw new Error("Unhandled exception"); + }; + + renderExample = () => { + if (this.state.error) { + throw new Error("I crashed!"); + } else { + return ( +
+
+
+

Exceptionless React Sample

+

By pressing the button below, an uncaught error will be thrown inside your component. This will automatically be sent to Exceptionless.

+ +
+

Throw an uncaught error and make sure Exceptionless tracks it.

+ +
+

The following buttons simulated handled events outside the component.

+ + {this.state.message && ( +

+ Message sent to Exceptionless: {this.state.message} +

+ )} + + {this.state.errorInfo && ( +

+ Error message sent to Exceptionless: {this.state.errorInfo} +

+ )} +
+
+
+ ); + } + }; + + render() { + return {this.renderExample()}; + } +} + +export default App; diff --git a/example/react/src/HooksExampleApp.js b/example/react/src/HooksExampleApp.js new file mode 100644 index 00000000..02297eb1 --- /dev/null +++ b/example/react/src/HooksExampleApp.js @@ -0,0 +1,61 @@ +import React, { useEffect, useState } from "react"; +import "./App.css"; +import { Exceptionless, ExceptionlessErrorBoundary } from "@exceptionless/react"; + +const HooksExampleApp = () => { + const [error, setError] = useState(false); + useEffect(() => { + startExceptionless(); + }, []); + + const startExceptionless = async () => { + await Exceptionless.startup((c) => { + c.apiKey = "LhhP1C9gijpSKCslHHCvwdSIz298twx271nTest"; + c.serverUrl = "https://localhost:5100"; + c.useDebugLogger(); + + c.defaultTags.push("Example", "React"); + }); + }; + + const throwErrorInComponent = () => { + setError(true); + }; + + const submitMessage = () => { + Exceptionless.submitLog("Hello, world!"); + }; + + const tryCatchExample = () => { + try { + throw new Error("Caught in the try/catch"); + } catch (error) { + Exceptionless.submitException(error); + } + }; + + const renderExample = () => { + if (error) { + throw new Error("I crashed!"); + } else { + return ( +
+
+
+

Exceptionless React Sample

+

By pressing the button below, an uncaught error will be thrown inside your component. This will automatically be sent to Exceptionless.

+ +

The following buttons simulated handled events outside the component.

+ + +
+
+
+ ); + } + }; + + return {renderExample()}; +}; + +export default HooksExampleApp; diff --git a/example/react/src/index.css b/example/react/src/index.css new file mode 100644 index 00000000..79c5d0b5 --- /dev/null +++ b/example/react/src/index.css @@ -0,0 +1,11 @@ +body { + margin: 0; + font-family: + -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +code { + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; +} diff --git a/example/react/src/index.jsx b/example/react/src/index.jsx new file mode 100644 index 00000000..2d72d610 --- /dev/null +++ b/example/react/src/index.jsx @@ -0,0 +1,13 @@ +import React from "react"; +import { createRoot } from "react-dom/client"; +import "./index.css"; +import App from "./App"; + +const container = document.getElementById("root"); +const root = createRoot(container); + +root.render( + + + +); diff --git a/example/react/src/setupTests.js b/example/react/src/setupTests.js new file mode 100644 index 00000000..1dd407a6 --- /dev/null +++ b/example/react/src/setupTests.js @@ -0,0 +1,5 @@ +// jest-dom adds custom jest matchers for asserting on DOM nodes. +// allows you to do things like: +// expect(element).toHaveTextContent(/react/i) +// learn more: https://github.com/testing-library/jest-dom +import "@testing-library/jest-dom"; diff --git a/example/react/vite.config.js b/example/react/vite.config.js new file mode 100644 index 00000000..8af32310 --- /dev/null +++ b/example/react/vite.config.js @@ -0,0 +1,11 @@ +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + base: "", + plugins: [react()], + server: { + open: true, + port: 5174 + } +}); diff --git a/example/svelte-kit/.gitignore b/example/svelte-kit/.gitignore new file mode 100644 index 00000000..6635cf55 --- /dev/null +++ b/example/svelte-kit/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +node_modules +/build +/.svelte-kit +/package +.env +.env.* +!.env.example +vite.config.js.timestamp-* +vite.config.ts.timestamp-* diff --git a/example/svelte-kit/.npmrc b/example/svelte-kit/.npmrc new file mode 100644 index 00000000..b6f27f13 --- /dev/null +++ b/example/svelte-kit/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/example/svelte-kit/README.md b/example/svelte-kit/README.md new file mode 100644 index 00000000..27acad82 --- /dev/null +++ b/example/svelte-kit/README.md @@ -0,0 +1,12 @@ +## Exceptionless Svelte Kit Example + +This example shows how to use the `@exceptionless/browser` package for client side Svelte Kit and `@exceptionless/node` for server side Svelte Kit. These is both +a client side error hook `hooks.client.js` and a server side error hook `hooks.server.js`. + +To run locally, follow these steps: + +1. `git clone https://github.com/exceptionless/Exceptionless.JavaScript` +2. `cd Exceptionless.Javascript` +3. `npm install` +4. `cd example/svelte-kit` +5. `npm run dev -- --open` diff --git a/example/svelte-kit/jsconfig.json b/example/svelte-kit/jsconfig.json new file mode 100644 index 00000000..f1da068b --- /dev/null +++ b/example/svelte-kit/jsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true + } + // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files + // + // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes + // from the referenced tsconfig.json - TypeScript does not merge them in +} diff --git a/example/svelte-kit/package.json b/example/svelte-kit/package.json new file mode 100644 index 00000000..7a435ce3 --- /dev/null +++ b/example/svelte-kit/package.json @@ -0,0 +1,29 @@ +{ + "name": "svelte-kit", + "version": "0.0.1", + "private": true, + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch" + }, + "dependencies": { + "@exceptionless/browser": "3.0.0-dev" + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^7.0.1", + "@sveltejs/kit": "^2.55.0", + "@sveltejs/vite-plugin-svelte": "^7.0.0", + "svelte": "^5.55.0", + "svelte-check": "^4.4.5", + "typescript": "^6.0.2", + "vite": "^8.0.2", + "vitest": "^4.1.1" + }, + "type": "module", + "publishConfig": { + "access": "restricted" + } +} diff --git a/example/svelte-kit/src/app.d.ts b/example/svelte-kit/src/app.d.ts new file mode 100644 index 00000000..899c7e8f --- /dev/null +++ b/example/svelte-kit/src/app.d.ts @@ -0,0 +1,12 @@ +// See https://kit.svelte.dev/docs/types#app +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface Platform {} + } +} + +export {}; diff --git a/example/svelte-kit/src/app.html b/example/svelte-kit/src/app.html new file mode 100644 index 00000000..b009ee26 --- /dev/null +++ b/example/svelte-kit/src/app.html @@ -0,0 +1,12 @@ + + + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ + diff --git a/example/svelte-kit/src/hooks.client.js b/example/svelte-kit/src/hooks.client.js new file mode 100644 index 00000000..e4a2e49c --- /dev/null +++ b/example/svelte-kit/src/hooks.client.js @@ -0,0 +1,17 @@ +import { Exceptionless, toError } from "@exceptionless/browser"; + +Exceptionless.startup((c) => { + c.apiKey = "LhhP1C9gijpSKCslHHCvwdSIz298twx271nTest"; + c.serverUrl = "https://localhost:5100"; + c.useDebugLogger(); + + c.defaultTags.push("Example", "svelte-kit", "client"); +}); + +/** @type {import('@sveltejs/kit').HandleClientError} */ +export async function handleError({ error, event, message, status }) { + console.warn({ error, event, message, source: "client error handler", status }); + await Exceptionless.createException(toError(error ?? message)) + .setProperty("status", status) + .submit(); +} diff --git a/example/svelte-kit/src/hooks.server.js b/example/svelte-kit/src/hooks.server.js new file mode 100644 index 00000000..822bc091 --- /dev/null +++ b/example/svelte-kit/src/hooks.server.js @@ -0,0 +1,15 @@ +import { Exceptionless, toError } from "@exceptionless/node"; + +Exceptionless.startup((c) => { + c.apiKey = "LhhP1C9gijpSKCslHHCvwdSIz298twx271nTest"; + c.serverUrl = "https://localhost:5100"; + c.useDebugLogger(); + + c.defaultTags.push("Example", "svelte-kit", "server"); +}); + +/** @type {import("@sveltejs/kit").HandleServerError} */ +export async function handleError({ error, event }) { + console.log("server error handler"); + await Exceptionless.submitException(toError(error)); +} diff --git a/example/svelte-kit/src/routes/+page.svelte b/example/svelte-kit/src/routes/+page.svelte new file mode 100644 index 00000000..595ad69e --- /dev/null +++ b/example/svelte-kit/src/routes/+page.svelte @@ -0,0 +1,84 @@ + + +
+
+
+

Exceptionless Svelte Sample

+
+

+ Throw an uncaught error and make sure Exceptionless tracks it. +

+ +
+

+ The following buttons simulated handled events outside the + component. +

+ + {#if message} +

+ Message sent to Exceptionless:{" "} + {message} +

+ {/if} + + {#if errorInfo} +

+ Error message sent to Exceptionless:{" "} + {errorInfo} +

+ {/if} +
+
+
+ + diff --git a/example/svelte-kit/static/favicon.png b/example/svelte-kit/static/favicon.png new file mode 100644 index 00000000..825b9e65 Binary files /dev/null and b/example/svelte-kit/static/favicon.png differ diff --git a/example/svelte-kit/svelte.config.js b/example/svelte-kit/svelte.config.js new file mode 100644 index 00000000..c2b930dc --- /dev/null +++ b/example/svelte-kit/svelte.config.js @@ -0,0 +1,10 @@ +import adapter from "@sveltejs/adapter-auto"; + +/** @type {import('@sveltejs/kit').Config} */ +const config = { + kit: { + adapter: adapter() + } +}; + +export default config; diff --git a/example/svelte-kit/vite.config.js b/example/svelte-kit/vite.config.js new file mode 100644 index 00000000..9e118353 --- /dev/null +++ b/example/svelte-kit/vite.config.js @@ -0,0 +1,6 @@ +import { sveltekit } from "@sveltejs/kit/vite"; +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + plugins: [sveltekit()] +}); diff --git a/example/vue/.gitignore b/example/vue/.gitignore new file mode 100644 index 00000000..53f7466a --- /dev/null +++ b/example/vue/.gitignore @@ -0,0 +1,5 @@ +node_modules +.DS_Store +dist +dist-ssr +*.local \ No newline at end of file diff --git a/example/vue/index.html b/example/vue/index.html new file mode 100644 index 00000000..81e28f3d --- /dev/null +++ b/example/vue/index.html @@ -0,0 +1,12 @@ + + + + + + Exceptionless Vue Example + + +
+ + + diff --git a/example/vue/package.json b/example/vue/package.json new file mode 100644 index 00000000..7a4ffb79 --- /dev/null +++ b/example/vue/package.json @@ -0,0 +1,23 @@ +{ + "name": "vue-example", + "private": true, + "version": "3.0.0-dev", + "scripts": { + "dev": "vite", + "build": "vite build", + "serve": "vite preview" + }, + "dependencies": { + "vue": "^3.5.30", + "@exceptionless/vue": "3.0.0-dev" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^6.0.5", + "@vue/compiler-sfc": "^3.5.30", + "vite": "^8.0.2" + }, + "type": "module", + "publishConfig": { + "access": "restricted" + } +} diff --git a/example/vue/public/favicon.ico b/example/vue/public/favicon.ico new file mode 100644 index 00000000..df36fcfb Binary files /dev/null and b/example/vue/public/favicon.ico differ diff --git a/example/vue/src/App.vue b/example/vue/src/App.vue new file mode 100644 index 00000000..72b3d88e --- /dev/null +++ b/example/vue/src/App.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/example/vue/src/components/HelloWorld.vue b/example/vue/src/components/HelloWorld.vue new file mode 100644 index 00000000..7b066b25 --- /dev/null +++ b/example/vue/src/components/HelloWorld.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/example/vue/src/main.js b/example/vue/src/main.js new file mode 100644 index 00000000..8459b14c --- /dev/null +++ b/example/vue/src/main.js @@ -0,0 +1,33 @@ +import { createApp } from "vue"; +import App from "./App.vue"; +import { Exceptionless, ExceptionlessErrorHandler } from "@exceptionless/vue"; + +Exceptionless.startup((c) => { + c.useDebugLogger(); + + c.apiKey = "LhhP1C9gijpSKCslHHCvwdSIz298twx271nTest"; + c.serverUrl = "https://localhost:5100"; + c.updateSettingsWhenIdleInterval = 15000; + c.usePersistedQueueStorage = true; + c.setUserIdentity("12345678", "Blake"); + + // set some default data + c.defaultData["SampleUser"] = { + id: 1, + name: "Blake", + password: "123456", + passwordResetToken: "a reset token", + myPasswordValue: "123456", + myPassword: "123456", + customValue: "Password", + value: { + Password: "123456" + } + }; + + c.defaultTags.push("Example", "JavaScript", "Vue"); +}); + +const app = createApp(App); +app.config.errorHandler = ExceptionlessErrorHandler; +app.mount("#app"); diff --git a/example/vue/vite.config.js b/example/vue/vite.config.js new file mode 100644 index 00000000..d2fd5bed --- /dev/null +++ b/example/vue/vite.config.js @@ -0,0 +1,7 @@ +import { defineConfig } from "vite"; +import vue from "@vitejs/plugin-vue"; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()] +}); diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 458192e8..00000000 --- a/gulpfile.js +++ /dev/null @@ -1,193 +0,0 @@ -var fs = require("fs"); -var pkg = require('./package.json'); -var gulp = require('gulp'); -var $ = require('gulp-load-plugins')({lazy:true }); -var tsProject = require('tsproject'); -var eventStream = require('event-stream'); - -gulp.task('clean', function () { - var del = require('del'); - del.sync(['dist'], { force: true }); -}); - -gulp.task('typescript', function () { - return tsProject.src('src/tsconfig.json').pipe(gulp.dest('dist/temp')); -}); - -gulp.task('typescript.integrations', ['typescript'], function () { - return tsProject.src('src/integrations/tsconfig.json').pipe(gulp.dest('dist/temp')); -}); - -gulp.task('typescript.node', function () { - return tsProject.src('src/tsconfig.node.json').pipe(gulp.dest('dist/temp')); -}); - -gulp.task('typescript.universal', function () { - return tsProject.src('src/tsconfig.universal.json').pipe(gulp.dest('dist/temp')); -}); - -gulp.task('exceptionless.umd', ['typescript', 'typescript.integrations'], function () { - return gulp.src('dist/temp/src/exceptionless.js') - .pipe($.sourcemaps.init({ loadMaps: true })) - .pipe($.wrapUmd({ - exports: 'exports', - globalName: 'exceptionless', - namespace: 'exceptionless', - deps: ['TraceKit'], - template: fs.readFileSync('./umd.template.jst', 'utf8') - })) - .pipe($.sourcemaps.write('.')) - .pipe(gulp.dest('dist/temp')); -}); - -gulp.task('exceptionless.universal.umd', ['typescript.universal'], function () { - return gulp.src('dist/temp/src/exceptionless.universal.js') - .pipe($.sourcemaps.init({ loadMaps: true })) - .pipe($.wrapUmd({ - exports: 'exports', - globalName: 'exceptionless', - namespace: 'exceptionless', - deps: ['TraceKit'], - template: fs.readFileSync('./umd.template.jst', 'utf8') - })) - .pipe($.sourcemaps.write('.')) - .pipe(gulp.dest('dist/temp')); -}); - -gulp.task('exceptionless', ['exceptionless.umd'], function () { - gulp.src('dist/temp/src/exceptionless.d.ts') - .pipe(gulp.dest('dist')); - var integrations = [ - 'dist/temp/src/integrations/angular.js' - ]; - - gulp.src(integrations) - .pipe(gulp.dest('dist/integrations')); - - var files = [ - 'node_modules/tracekit/tracekit.js', - 'dist/temp/exceptionless.js' - ]; - - gulp.src(files) - .pipe($.sourcemaps.init({ loadMaps: true })) - .pipe($.concat('exceptionless.js')) - .pipe($.replace('exceptionless-js/1.0.0.0', 'exceptionless-js/' + pkg.version)) - .pipe($.replace('var TraceKit = require("TraceKit");\n', '')) - .pipe($.sourcemaps.write('.')) - .pipe(gulp.dest('dist')); - - return gulp.src(files) - .pipe($.sourcemaps.init({ loadMaps: true })) - .pipe($.concat('exceptionless.min.js')) - .pipe($.replace('exceptionless-js/1.0.0.0', 'exceptionless-js/' + pkg.version)) - .pipe($.replace('var TraceKit = require("TraceKit");\n', '')) - .pipe($.uglify({ output: { beautify: false } })) - .pipe($.sourcemaps.write('.')) - .pipe(gulp.dest('dist')); -}); - -gulp.task('exceptionless.node', ['typescript.node'], function () { - var files = [ - 'dist/temp/src/exceptionless.node.js', - 'dist/temp/src/submitSync.js' - ]; - - gulp.src(files) - .pipe($.sourcemaps.init({ loadMaps: true })) - .pipe($.replace('exceptionless-js/1.0.0.0', 'exceptionless-node/' + pkg.version)) - .pipe($.sourcemaps.write('.')) - .pipe(gulp.dest('dist')); -}); - -gulp.task('exceptionless.universal', ['exceptionless.universal.umd'], function () { - var files = [ - 'node_modules/tracekit/tracekit.js', - 'dist/temp/exceptionless.universal.js' - ]; - - // NOTE: This is really hacky to replace require statements based on order..... but we need to ensure they are excluded for requirejs. - gulp.src(files) - .pipe($.sourcemaps.init({ loadMaps: true })) - .pipe($.concat('exceptionless.universal.js')) - .pipe($.replace('exceptionless-js/1.0.0.0', 'exceptionless-universal-js/' + pkg.version)) - .pipe($.replace('var TraceKit = require("TraceKit");', 'if (typeof process !== \'undefined\') {')) - .pipe($.replace('var url = require("url");', 'var url = require("url");\n}')) - .pipe($.sourcemaps.write('.')) - .pipe(gulp.dest('dist')); - - return gulp.src(files) - .pipe($.sourcemaps.init({ loadMaps: true })) - .pipe($.concat('exceptionless.universal.min.js')) - .pipe($.replace('exceptionless-js/1.0.0.0', 'exceptionless-universal-js/' + pkg.version)) - .pipe($.replace('var TraceKit = require("TraceKit");', 'if (require && typeof process !== \'undefined\') {')) - .pipe($.replace('var url = require("url");', 'var url = require("url");\n}')) - .pipe($.uglify({ output: { beautify: false } })) - .pipe($.sourcemaps.write('.')) - .pipe(gulp.dest('dist')); -}); - -gulp.task('watch', ['build'], function () { - gulp.watch('src/**/*.ts', ['build']); -}); - -gulp.task('lint', function () { - return gulp.src(['src/**/*.ts']) - .pipe($.tslint({ formatter: 'verbose' })) - .pipe($.tslint.report()); -}); - -gulp.task('build', ['clean', 'lint', 'exceptionless', 'exceptionless.node', 'exceptionless.universal']); - -gulp.task('typescript.test', function () { - return tsProject.src('src/tsconfig.test.json').pipe(gulp.dest('dist/temp')); -}); - -gulp.task('exceptionless.test.umd', ['typescript.test'], function () { - var wrap = function(filename){ - return gulp.src(filename) - .pipe($.sourcemaps.init({ loadMaps: true })) - .pipe($.wrapUmd({ - exports: 'exports', - globalName: 'exceptionless', - namespace: 'exceptionless' - })) - .pipe($.sourcemaps.write('.')) - .pipe(gulp.dest('dist/temp')); - }; - - return eventStream.merge( - wrap('dist/temp/src/exceptionless-nodespec.js'), - wrap('dist/temp/src/exceptionless-browserspec.js')); -}); - -gulp.task('test-node', ['exceptionless.test.umd'], function(done) { - return gulp.src('dist/temp/exceptionless-nodespec.js', { read: false }) - .pipe($.mocha({ - require: ['source-map-support/register'], - timeout: 5000 - })) - .once('end', function () { - process.exit(); - }); -}); - -gulp.task('test-browser', ['exceptionless.test.umd'], function(){ - return gulp - .src('testrunner.html') - .pipe($.mochaPhantomjs()); -}); - -gulp.task('test', function(){ - // test-node calls process.exit(), so run browser tests before node tests - var runSequence = require('run-sequence'); - runSequence('test-browser', 'test-node'); -}); - -gulp.task('format', function () { - return gulp.src(['src/**/*.ts']) - .pipe($.exec('node_modules/typescript-formatter/bin/tsfmt -r <%= file.path %>')) - .pipe($.exec.reporter()); -}); - -gulp.task('default', ['watch', 'build', 'test']); diff --git a/jest-resolver.cjs b/jest-resolver.cjs new file mode 100644 index 00000000..000b3cb0 --- /dev/null +++ b/jest-resolver.cjs @@ -0,0 +1,85 @@ +const path = require("path"); +const fs = require("fs"); + +/** + * Custom jest resolver that handles: + * 1. Package.json "imports" field (#/ subpath imports) — per-package resolution + * 2. TypeScript .js → .ts extension mapping for ESM imports + * + * Replaces jest-ts-webcompat-resolver with full #/ import support. + */ +module.exports = (request, options) => { + // Handle #/ subpath imports by reading the nearest package.json + if (request.startsWith("#/")) { + const packageRoot = findPackageRoot(options.basedir); + if (packageRoot) { + const pkgJson = JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "utf-8")); + if (pkgJson.imports) { + const mapping = pkgJson.imports["#/*"]; + if (mapping) { + const base = typeof mapping === "string" ? mapping : mapping.source || mapping.default; + if (base) { + const prefix = base.replace(/\*$/, ""); + const suffix = request.slice(2); + if (suffix.includes("..") || path.isAbsolute(suffix)) { + throw new Error(`Unsafe import path: ${request}`); + } + const resolved = path.resolve(packageRoot, prefix, suffix); + const normalizedRoot = path.resolve(packageRoot) + path.sep; + if (!resolved.startsWith(normalizedRoot)) { + throw new Error(`Import escapes package root: ${request}`); + } + return resolveWithExtensions(resolved); + } + } + } + } + } + + // Handle .js → .ts extension mapping for TypeScript ESM imports + if (request.endsWith(".js")) { + const tsRequest = request.slice(0, -3) + ".ts"; + try { + return options.defaultResolver(tsRequest, options); + } catch { + // Try .tsx + } + const tsxRequest = request.slice(0, -3) + ".tsx"; + try { + return options.defaultResolver(tsxRequest, options); + } catch { + // Fall through to default + } + } + + return options.defaultResolver(request, options); +}; + +function findPackageRoot(dir) { + let current = dir; + while (current !== path.dirname(current)) { + if (fs.existsSync(path.join(current, "package.json"))) { + const pkg = path.join(current, "package.json"); + const content = JSON.parse(fs.readFileSync(pkg, "utf-8")); + if (content.imports) { + return current; + } + } + current = path.dirname(current); + } + return null; +} + +function resolveWithExtensions(filePath) { + const base = filePath.replace(/\.js$/, ""); + for (const ext of [".ts", ".tsx", ".js"]) { + const fullPath = base + ext; + if (fs.existsSync(fullPath)) { + return fullPath; + } + } + if (fs.existsSync(filePath)) { + return filePath; + } + throw new Error(`Cannot resolve: ${filePath}`); +} diff --git a/package-lock.json b/package-lock.json index 784da808..55e42226 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5592 +1,9894 @@ { - "name": "exceptionless", - "version": "1.5.4", - "lockfileVersion": 1, + "name": "@exceptionless/monorepo", + "version": "3.0.0-dev", + "lockfileVersion": 3, "requires": true, - "dependencies": { - "@gulp-sourcemaps/identity-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-1.0.1.tgz", - "integrity": "sha1-z6I7xYQPkQTOMqZedNt+epdLvuE=", - "dev": true, - "requires": { - "acorn": "5.0.3", - "css": "2.2.1", - "normalize-path": "2.1.1", - "source-map": "0.5.6", - "through2": "2.0.3" - }, + "packages": { + "": { + "name": "@exceptionless/monorepo", + "version": "3.0.0-dev", + "license": "Apache-2.0", + "workspaces": [ + "packages/core", + "packages/browser", + "packages/angularjs", + "packages/node", + "packages/react", + "packages/vue", + "example/*" + ], + "devDependencies": { + "@eslint/js": "^10.0.1", + "eslint": "^10.1.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-jest": "^29.15.0", + "npm-run-all2": "^8.0.4", + "prettier": "^3.8.1", + "rimraf": "^6.1.3", + "typescript": "^6.0.2", + "typescript-eslint": "^8.57.2" + } + }, + "example/browser": { + "name": "browser-sample", + "version": "3.0.0-dev", + "license": "Apache-2.0", "dependencies": { - "acorn": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.0.3.tgz", - "integrity": "sha1-xGDfCEkUY/AozLguqzcwvwEIez0=", - "dev": true - } + "@exceptionless/browser": "3.0.0-dev", + "jquery": "^4.0.0" } }, - "@gulp-sourcemaps/map-sources": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", - "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", - "dev": true, - "requires": { - "normalize-path": "2.1.1", - "through2": "2.0.3" + "example/express": { + "name": "express-sample", + "version": "3.0.0-dev", + "license": "Apache-2.0", + "dependencies": { + "@exceptionless/node": "3.0.0-dev", + "express": "^5.2.1" } }, - "@types/angular": { - "version": "1.6.25", - "resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.6.25.tgz", - "integrity": "sha512-8L9VLUTwbLRzCo9OWk5YQmvDmGCkxhjDIulw7hWIVHa9AV4ojRsbtBdhF06VOgK1mV4U7vej3fw0ivjppZmgTg==", - "dev": true - }, - "@types/angular-mocks": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/@types/angular-mocks/-/angular-mocks-1.5.10.tgz", - "integrity": "sha512-WIqgN3WbAa4zECHaORmg/lmiybFmuneP1CeZsS1sUpzcRPkC8QSecAOlk012JMTlJDpuGK8B8cYjsZsvlPaX6Q==", - "dev": true, - "requires": { - "@types/angular": "1.6.25" + "example/react": { + "name": "react-example", + "version": "3.0.0-dev", + "dependencies": { + "@exceptionless/react": "3.0.0-dev", + "react": "^19.2.4", + "react-dom": "^19.2.4" + }, + "devDependencies": { + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^16.3.2", + "@testing-library/user-event": "^14.6.1", + "@vitejs/plugin-react": "^6.0.1", + "vite": "^8.0.2" } }, - "@types/assertion-error": { - "version": "1.0.30", - "resolved": "https://registry.npmjs.org/@types/assertion-error/-/assertion-error-1.0.30.tgz", - "integrity": "sha1-89DV2i7Ie1FOMNs/+aAYh7VhnCk=", - "dev": true - }, - "@types/chai": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.0.1.tgz", - "integrity": "sha512-DWrdkraJO+KvBB7+Jc6AuDd2+fwV6Z9iK8cqEEoYpcurYrH7GiUZmwjFuQIIWj5HhFz6NsSxdN72YMIHT7Fy2Q==", - "dev": true - }, - "@types/chalk": { - "version": "0.4.31", - "resolved": "https://registry.npmjs.org/@types/chalk/-/chalk-0.4.31.tgz", - "integrity": "sha1-ox10JBprHtu5c8822XooloNKUfk=", - "dev": true - }, - "@types/chokidar": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@types/chokidar/-/chokidar-1.6.0.tgz", - "integrity": "sha1-2xhDNg1UjyZ+84o1+Tj+IkM8Uoc=", - "dev": true, - "requires": { - "@types/node": "8.0.6" - } - }, - "@types/glob": { - "version": "5.0.30", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.30.tgz", - "integrity": "sha1-ECZAnFYlqGiQdGAoCNCCsoZ7ilE=", - "dev": true, - "requires": { - "@types/minimatch": "2.0.29", - "@types/node": "8.0.6" - } - }, - "@types/jquery": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.2.5.tgz", - "integrity": "sha512-7a+LyzJltNLRdLOpWr9ThtXsZgpG9XN6u4Hqi2KZwQMW6SoYSyR/6uMrgZxJ+zfS1N48/R8XKF0HAixVVjQyaQ==", - "dev": true - }, - "@types/lodash": { - "version": "4.14.63", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.63.tgz", - "integrity": "sha1-WsR19Vv9xivIjEI528SC8vO+rZM=", - "dev": true - }, - "@types/minimatch": { - "version": "2.0.29", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-2.0.29.tgz", - "integrity": "sha1-UALhT3Xi1x5WQoHfBDHIwbSio2o=", - "dev": true - }, - "@types/mocha": { - "version": "2.2.41", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.41.tgz", - "integrity": "sha1-4nzwgXFT658nE7LT9saPHhw8pgg=", - "dev": true - }, - "@types/mock-fs": { - "version": "3.6.30", - "resolved": "https://registry.npmjs.org/@types/mock-fs/-/mock-fs-3.6.30.tgz", - "integrity": "sha1-TYElQeh7I1dyYaWqlfcE3T0B5BA=", - "dev": true, - "requires": { - "@types/node": "8.0.6" - } - }, - "@types/node": { - "version": "8.0.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.6.tgz", - "integrity": "sha512-WuMAU8y6bw1I7MKOEtkuoSUsxHhVYkdv4nuqq3sed+Yx2JFFlCj4EoZweu4TkcrKAIuPXAjhGa5ZcROUJbj0AA==", - "dev": true - }, - "@types/sinon": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-2.3.2.tgz", - "integrity": "sha512-92DKsC/9bnsfyBLdY5AP8Zk7LDbwVF0hBHsfQ3IY3kHXEo3NdJA57090wGmzcnITxupyvR3lXk278tPktM6OJw==", - "dev": true - }, - "@types/stack-trace": { - "version": "0.0.28", - "resolved": "https://registry.npmjs.org/@types/stack-trace/-/stack-trace-0.0.28.tgz", - "integrity": "sha1-s+9Php8djmKECMwm1nm5h7bxqs4=", - "dev": true - }, - "@types/vinyl": { - "version": "1.2.30", - "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-1.2.30.tgz", - "integrity": "sha1-kRXAxFxAxXVziQa+n7Tfb1ueUBM=", - "dev": true, - "requires": { - "@types/node": "8.0.6" + "example/svelte-kit": { + "version": "0.0.1", + "dependencies": { + "@exceptionless/browser": "3.0.0-dev" + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^7.0.1", + "@sveltejs/kit": "^2.55.0", + "@sveltejs/vite-plugin-svelte": "^7.0.0", + "svelte": "^5.55.0", + "svelte-check": "^4.4.5", + "typescript": "^6.0.2", + "vite": "^8.0.2", + "vitest": "^4.1.1" + } + }, + "example/vue": { + "name": "vue-example", + "version": "3.0.0-dev", + "dependencies": { + "@exceptionless/vue": "3.0.0-dev", + "vue": "^3.5.30" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^6.0.5", + "@vue/compiler-sfc": "^3.5.30", + "vite": "^8.0.2" } }, - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", - "dev": true - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "anymatch": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", - "integrity": "sha1-o+Uvo5FoyCX/V7AkgSbOWo/5VQc=", + "node_modules/@adobe/css-tools": { + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.4.tgz", + "integrity": "sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==", "dev": true, - "requires": { - "arrify": "1.0.1", - "micromatch": "2.3.11" - } + "license": "MIT" }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", "dev": true, - "requires": { - "arr-flatten": "1.0.3" + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" } }, - "arr-flatten": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.3.tgz", - "integrity": "sha1-onTthawIhJtr14R8RYB0XcUa37E=", - "dev": true - }, - "array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", - "dev": true - }, - "array-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", - "dev": true - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, - "array-slice": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.0.0.tgz", - "integrity": "sha1-5zA08A3MH0CHYAj9IP6ud71LfC8=", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true, - "requires": { - "array-uniq": "1.0.3" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", - "dev": true - }, - "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", - "dev": true - }, - "assertion-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz", - "integrity": "sha1-E8pRXYYgbaC6xm6DTdOX2HWBCUw=", - "dev": true - }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/atob/-/atob-1.1.3.tgz", - "integrity": "sha1-lfE2KbEsOlGl0hWr3OKqnzL4B3M=", - "dev": true - }, - "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", - "dev": true + "license": "ISC" }, - "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", - "dev": true - }, - "babel-code-frame": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", - "integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=", + "node_modules/@babel/code-frame": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", "dev": true, - "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.1" + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" } }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "node_modules/@babel/compat-data": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", + "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" + "license": "MIT", + "engines": { + "node": ">=6.9.0" } }, - "beeper": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", - "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=", - "dev": true - }, - "binary-extensions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz", - "integrity": "sha1-SOyNFt9Dd+rl+liEaCSAr02Vx3Q=", - "dev": true - }, - "binaryextensions": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-1.0.1.tgz", - "integrity": "sha1-HmN0iLNbWL2l9HdL+WpSEqjJB1U=", - "dev": true - }, - "bluebird": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", - "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=", - "dev": true - }, - "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "node_modules/@babel/core": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", + "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", "dev": true, - "requires": { - "hoek": "2.16.3" + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-module-transforms": "^7.28.6", + "@babel/helpers": "^7.28.6", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" + "license": "ISC", + "bin": { + "semver": "bin/semver.js" } }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "node_modules/@babel/generator": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", "dev": true, - "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" } }, - "browser-stdout": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", - "dev": true - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "node_modules/@babel/helper-compilation-targets": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", + "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", "dev": true, - "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" } }, - "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", - "dev": true - }, - "chai": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.0.2.tgz", - "integrity": "sha1-L3MnxN5vOF3XeHmZ4qsCaXoyuDs=", + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, - "requires": { - "assertion-error": "1.0.2", - "check-error": "1.0.2", - "deep-eql": "2.0.2", - "get-func-name": "2.0.0", - "pathval": "1.1.0", - "type-detect": "4.0.3" + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" } }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "license": "ISC", + "bin": { + "semver": "bin/semver.js" } }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", - "dev": true - }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "dev": true, - "requires": { - "anymatch": "1.3.0", - "async-each": "1.0.1", - "fsevents": "1.1.2", - "glob-parent": "2.0.0", - "inherits": "2.0.3", - "is-binary-path": "1.0.1", - "is-glob": "2.0.1", - "path-is-absolute": "1.0.1", - "readdirp": "2.1.0" - } - }, - "cli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", - "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", "dev": true, - "requires": { - "exit": "0.1.2", - "glob": "7.1.2" + "license": "MIT", + "engines": { + "node": ">=6.9.0" } }, - "clone": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", - "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=", - "dev": true - }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", - "dev": true - }, - "clone-stats": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", - "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", - "dev": true - }, - "cloneable-readable": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.0.0.tgz", - "integrity": "sha1-pikNQT8hemEjL5XkWP84QYz7ARc=", + "node_modules/@babel/helper-module-imports": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", + "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", "dev": true, - "requires": { - "inherits": "2.0.3", - "process-nextick-args": "1.0.7", - "through2": "2.0.3" + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" } }, - "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", - "dev": true - }, - "combined-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", + "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", "dev": true, - "requires": { - "delayed-stream": "1.0.0" + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.28.6", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "node_modules/@babel/helper-plugin-utils": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", + "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", "dev": true, - "requires": { - "graceful-readlink": "1.0.1" + "license": "MIT", + "engines": { + "node": ">=6.9.0" } }, - "commandpost": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/commandpost/-/commandpost-1.1.0.tgz", - "integrity": "sha512-9yPICKOPS0+24bMM4kHx7AgTZ1tWw51/eq0BUYqzDodNoiszL3Z0w4JRt/UXd93Aw003tlQlpuERcw7mBlxt9g==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } }, - "concat-stream": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz", - "integrity": "sha1-U/fUPFHF5D+ByP3QMyHGMb5o1hE=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.0.6", - "typedarray": "0.0.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - } - } + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" } }, - "concat-with-sourcemaps": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.4.tgz", - "integrity": "sha1-9Vs74q60dgGxCi1SWcz7cP0vHdY=", + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", "dev": true, - "requires": { - "source-map": "0.5.6" + "license": "MIT", + "engines": { + "node": ">=6.9.0" } }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "node_modules/@babel/helpers": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", + "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", "dev": true, - "requires": { - "date-now": "0.1.4" + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "convert-source-map": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", - "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "4.1.1", - "shebang-command": "1.2.0", - "which": "1.2.14" - }, - "dependencies": { - "lru-cache": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", - "dev": true, - "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" - } - } + "node_modules/@babel/parser": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", + "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" } }, - "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, - "requires": { - "boom": "2.10.1" + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "css": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/css/-/css-2.2.1.tgz", - "integrity": "sha1-c6TIHehdtmTU7mdPfUcIXjstVdw=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "source-map": "0.1.43", - "source-map-resolve": "0.3.1", - "urix": "0.1.0" - }, - "dependencies": { - "source-map": { - "version": "0.1.43", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", - "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", - "dev": true, - "requires": { - "amdefine": "1.0.1" - } - } + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, - "requires": { - "array-find-index": "1.0.2" + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "dargs": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-5.1.0.tgz", - "integrity": "sha1-7H6lDHhWTNNsnV7Bj2Yyn63ieCk=", - "dev": true - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, - "requires": { - "assert-plus": "1.0.0" - }, + "license": "MIT", "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, - "dateformat": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.0.0.tgz", - "integrity": "sha1-J0Pjq7XD/CRi5SfcpEXgTp9N7hc=", - "dev": true - }, - "debug": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.0.tgz", - "integrity": "sha1-vFlryr52F/Edn6FTYe3tVgi4SZs=", + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz", + "integrity": "sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==", "dev": true, - "requires": { - "ms": "0.7.2" + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "debug-fabulous": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-0.1.0.tgz", - "integrity": "sha1-rQ6gel1RkyT7VYQqjzTuWcf4/2w=", + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, - "requires": { - "debug": "2.6.0", - "object-assign": "4.1.0" - }, + "license": "MIT", "dependencies": { - "object-assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", - "integrity": "sha1-ejs9DpgGPUP0wD8uiubNUahog6A=", - "dev": true - } + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "deep-eql": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-2.0.2.tgz", - "integrity": "sha1-sbrAblbwp2d3aG1Qyf63XC7XZ5o=", + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, - "requires": { - "type-detect": "3.0.0" - }, + "license": "MIT", "dependencies": { - "type-detect": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-3.0.0.tgz", - "integrity": "sha1-RtDMhVOrt7E6NSsNbeov1Y8tm1U=", - "dev": true - } + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz", + "integrity": "sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==", "dev": true, - "requires": { - "clone": "1.0.2" + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "del": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz", - "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=", + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, - "requires": { - "globby": "6.1.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.0", - "p-map": "1.1.1", - "pify": "3.0.0", - "rimraf": "2.6.1" + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "deprecated": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz", - "integrity": "sha1-+cmvVGSvoeepcUWKi97yqpTVuxk=", - "dev": true - }, - "detect-file": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz", - "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=", + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, - "requires": { - "fs-exists-sync": "0.1.0" + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "detect-newline": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", - "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", - "dev": true - }, - "diff": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", - "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", - "dev": true - }, - "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, - "requires": { - "domelementtype": "1.1.3", - "entities": "1.1.1" - }, + "license": "MIT", "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - }, - "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", - "dev": true - } + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", - "dev": true - }, - "domhandler": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", - "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, - "requires": { - "domelementtype": "1.3.0" + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, - "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", - "dev": true - }, - "duplexer2": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", - "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, - "requires": { - "readable-stream": "1.1.14" + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "editorconfig": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.13.2.tgz", - "integrity": "sha1-jleSbZ7mmrbLmZ8CfCFxRnrM6zU=", - "dev": true, - "requires": { - "bluebird": "3.5.0", - "commander": "2.9.0", - "lru-cache": "3.2.0", - "sigmund": "1.0.1" - }, - "dependencies": { - "lru-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", - "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", - "dev": true, - "requires": { - "pseudomap": "1.0.2" - } - } + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "end-of-stream": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz", - "integrity": "sha1-jhdyBsPICDfYVjLouTWd/osvbq8=", + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, - "requires": { - "once": "1.3.3" - }, + "license": "MIT", "dependencies": { - "once": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - } + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "entities": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", - "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", - "dev": true - }, - "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz", + "integrity": "sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==", "dev": true, - "requires": { - "is-arrayish": "0.2.1" + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "es5-shim": { - "version": "4.5.9", - "resolved": "https://registry.npmjs.org/es5-shim/-/es5-shim-4.5.9.tgz", - "integrity": "sha1-Kh4rnlg/9f7Qwgo+4svz91IwpcA=", - "dev": true - }, - "es6-promise": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.0.5.tgz", - "integrity": "sha1-eILzCt3lskDM+n99eMVIMwlRrkI=", - "dev": true - }, - "es6-shim": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/es6-shim/-/es6-shim-0.35.3.tgz", - "integrity": "sha1-m/tzY/7//4emzbbNk+QF7DxLbyY=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", - "dev": true, - "requires": { - "duplexer": "0.1.1", - "from": "0.1.7", - "map-stream": "0.1.0", - "pause-stream": "0.0.11", - "split": "0.3.3", - "stream-combiner": "0.0.4", - "through": "2.3.8" - } - }, - "execa": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.6.3.tgz", - "integrity": "sha1-V7aaWU8IF1nGnlNw8NF7nLEWWP4=", + "node_modules/@babel/runtime": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz", + "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==", "dev": true, - "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "license": "MIT", + "engines": { + "node": ">=6.9.0" } }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "node_modules/@babel/template": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", "dev": true, - "requires": { - "is-posix-bracket": "0.1.1" + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" } }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "node_modules/@babel/traverse": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", "dev": true, - "requires": { - "fill-range": "2.2.3" + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" } }, - "expand-tilde": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", - "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", - "dev": true, - "requires": { - "os-homedir": "1.0.2" + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" } }, - "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", - "dev": true + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT" }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "node_modules/@csstools/color-helpers": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", + "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==", "dev": true, - "requires": { - "is-extglob": "1.0.0" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" } }, - "extract-zip": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.5.0.tgz", - "integrity": "sha1-ksz22B73Cp+kwXRxFMzvbYaIpsQ=", + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", "dev": true, - "requires": { - "concat-stream": "1.5.0", - "debug": "0.7.4", - "mkdirp": "0.5.0", - "yauzl": "2.4.1" - }, - "dependencies": { - "debug": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", - "integrity": "sha1-BuHqgILCyxTjmAbiLi9vdX+Srzk=", - "dev": true + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mkdirp": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", - "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, - "extsprintf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", - "dev": true - }, - "fancy-log": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.0.tgz", - "integrity": "sha1-Rb4X0Cu5kX1gzP/UmVyZnmyMmUg=", + "node_modules/@csstools/css-color-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz", + "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==", "dev": true, - "requires": { - "chalk": "1.1.3", - "time-stamp": "1.1.0" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.1.0", + "@csstools/css-calc": "^2.1.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, - "fd-slicer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", - "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", "dev": true, - "requires": { - "pend": "1.2.0" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" } }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } }, - "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "node_modules/@emnapi/core": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz", + "integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==", "dev": true, - "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.0", + "tslib": "^2.4.0" } }, - "find-index": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz", - "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=", - "dev": true + "node_modules/@emnapi/runtime": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz", + "integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz", + "integrity": "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==", "dev": true, - "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" } }, - "findup-sync": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.3.tgz", - "integrity": "sha1-QAQ5Kee8YK3wt/SCfExudaDeyhI=", + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.4.tgz", + "integrity": "sha512-cQPwL2mp2nSmHHJlCyoXgHGhbEPMrEEU5xhkcy3Hs/O7nGZqEpZ2sUtLaL9MORLtDfRvVl2/3PAuEkYZH0Ty8Q==", + "cpu": [ + "ppc64" + ], "dev": true, - "requires": { - "detect-file": "0.1.0", - "is-glob": "2.0.1", - "micromatch": "2.3.11", - "resolve-dir": "0.1.1" + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.4.tgz", + "integrity": "sha512-X9bUgvxiC8CHAGKYufLIHGXPJWnr0OCdR0anD2e21vdvgCI8lIfqFbnoeOz7lBjdrAGUhqLZLcQo6MLhTO2DKQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.4.tgz", + "integrity": "sha512-gdLscB7v75wRfu7QSm/zg6Rx29VLdy9eTr2t44sfTW7CxwAtQghZ4ZnqHk3/ogz7xao0QAgrkradbBzcqFPasw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.4.tgz", + "integrity": "sha512-PzPFnBNVF292sfpfhiyiXCGSn9HZg5BcAz+ivBuSsl6Rk4ga1oEXAamhOXRFyMcjwr2DVtm40G65N3GLeH1Lvw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.4.tgz", + "integrity": "sha512-b7xaGIwdJlht8ZFCvMkpDN6uiSmnxxK56N2GDTMYPr2/gzvfdQN8rTfBsvVKmIVY/X7EM+/hJKEIbbHs9oA4tQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.4.tgz", + "integrity": "sha512-sR+OiKLwd15nmCdqpXMnuJ9W2kpy0KigzqScqHI3Hqwr7IXxBp3Yva+yJwoqh7rE8V77tdoheRYataNKL4QrPw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.4.tgz", + "integrity": "sha512-jnfpKe+p79tCnm4GVav68A7tUFeKQwQyLgESwEAUzyxk/TJr4QdGog9sqWNcUbr/bZt/O/HXouspuQDd9JxFSw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.4.tgz", + "integrity": "sha512-2kb4ceA/CpfUrIcTUl1wrP/9ad9Atrp5J94Lq69w7UwOMolPIGrfLSvAKJp0RTvkPPyn6CIWrNy13kyLikZRZQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.4.tgz", + "integrity": "sha512-aBYgcIxX/wd5n2ys0yESGeYMGF+pv6g0DhZr3G1ZG4jMfruU9Tl1i2Z+Wnj9/KjGz1lTLCcorqE2viePZqj4Eg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.4.tgz", + "integrity": "sha512-7nQOttdzVGth1iz57kxg9uCz57dxQLHWxopL6mYuYthohPKEK0vU0C3O21CcBK6KDlkYVcnDXY099HcCDXd9dA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.4.tgz", + "integrity": "sha512-oPtixtAIzgvzYcKBQM/qZ3R+9TEUd1aNJQu0HhGyqtx6oS7qTpvjheIWBbes4+qu1bNlo2V4cbkISr8q6gRBFA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.4.tgz", + "integrity": "sha512-8mL/vh8qeCoRcFH2nM8wm5uJP+ZcVYGGayMavi8GmRJjuI3g1v6Z7Ni0JJKAJW+m0EtUuARb6Lmp4hMjzCBWzA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.4.tgz", + "integrity": "sha512-1RdrWFFiiLIW7LQq9Q2NES+HiD4NyT8Itj9AUeCl0IVCA459WnPhREKgwrpaIfTOe+/2rdntisegiPWn/r/aAw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.4.tgz", + "integrity": "sha512-tLCwNG47l3sd9lpfyx9LAGEGItCUeRCWeAx6x2Jmbav65nAwoPXfewtAdtbtit/pJFLUWOhpv0FpS6GQAmPrHA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.4.tgz", + "integrity": "sha512-BnASypppbUWyqjd1KIpU4AUBiIhVr6YlHx/cnPgqEkNoVOhHg+YiSVxM1RLfiy4t9cAulbRGTNCKOcqHrEQLIw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.4.tgz", + "integrity": "sha512-+eUqgb/Z7vxVLezG8bVB9SfBie89gMueS+I0xYh2tJdw3vqA/0ImZJ2ROeWwVJN59ihBeZ7Tu92dF/5dy5FttA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.4.tgz", + "integrity": "sha512-S5qOXrKV8BQEzJPVxAwnryi2+Iq5pB40gTEIT69BQONqR7JH1EPIcQ/Uiv9mCnn05jff9umq/5nqzxlqTOg9NA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.4.tgz", + "integrity": "sha512-xHT8X4sb0GS8qTqiwzHqpY00C95DPAq7nAwX35Ie/s+LO9830hrMd3oX0ZMKLvy7vsonee73x0lmcdOVXFzd6Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.4.tgz", + "integrity": "sha512-RugOvOdXfdyi5Tyv40kgQnI0byv66BFgAqjdgtAKqHoZTbTF2QqfQrFwa7cHEORJf6X2ht+l9ABLMP0dnKYsgg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.4.tgz", + "integrity": "sha512-2MyL3IAaTX+1/qP0O1SwskwcwCoOI4kV2IBX1xYnDDqthmq5ArrW94qSIKCAuRraMgPOmG0RDTA74mzYNQA9ow==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.4.tgz", + "integrity": "sha512-u8fg/jQ5aQDfsnIV6+KwLOf1CmJnfu1ShpwqdwC0uA7ZPwFws55Ngc12vBdeUdnuWoQYx/SOQLGDcdlfXhYmXQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.4.tgz", + "integrity": "sha512-JkTZrl6VbyO8lDQO3yv26nNr2RM2yZzNrNHEsj9bm6dOwwu9OYN28CjzZkH57bh4w0I2F7IodpQvUAEd1mbWXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.4.tgz", + "integrity": "sha512-/gOzgaewZJfeJTlsWhvUEmUG4tWEY2Spp5M20INYRg2ZKl9QPO3QEEgPeRtLjEWSW8FilRNacPOg8R1uaYkA6g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.4.tgz", + "integrity": "sha512-Z9SExBg2y32smoDQdf1HRwHRt6vAHLXcxD2uGgO/v2jK7Y718Ix4ndsbNMU/+1Qiem9OiOdaqitioZwxivhXYg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.4.tgz", + "integrity": "sha512-DAyGLS0Jz5G5iixEbMHi5KdiApqHBWMGzTtMiJ72ZOLhbu/bzxgAe8Ue8CTS3n3HbIUHQz/L51yMdGMeoxXNJw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.4.tgz", + "integrity": "sha512-+knoa0BDoeXgkNvvV1vvbZX4+hizelrkwmGJBdT17t8FNPwG2lKemmuMZlmaNQ3ws3DKKCxpb4zRZEIp3UxFCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" } }, - "fined": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", - "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", - "dev": true, - "requires": { - "expand-tilde": "2.0.2", - "is-plain-object": "2.0.3", - "object.defaults": "1.1.0", - "object.pick": "1.2.0", - "parse-filepath": "1.0.1" - }, - "dependencies": { - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "1.0.1" - } - } + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "first-chunk-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", - "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=", - "dev": true + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } }, - "flagged-respawn": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-0.3.2.tgz", - "integrity": "sha1-/xke3c1wiKZ1smEP/8l2vpuAdLU=", - "dev": true + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true + "node_modules/@eslint/config-array": { + "version": "0.23.3", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.3.tgz", + "integrity": "sha512-j+eEWmB6YYLwcNOdlwQ6L2OsptI/LO6lNBuLIqe5R7RetD658HLoF+Mn7LzYmAWWNNzdC6cqP+L6r8ujeYXWLw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.3", + "debug": "^4.3.1", + "minimatch": "^10.2.4" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.5.3.tgz", + "integrity": "sha512-lzGN0onllOZCGroKJmRwY6QcEHxbjBw1gwB8SgRSqK8YbbtEXMvKynsXc3553ckIEBxsbMBU7oOZXKIPGZNeZw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.1.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.1.1.tgz", + "integrity": "sha512-QUPblTtE51/7/Zhfv8BDwO0qkkzQL7P/aWWbqcf4xWLEYn1oKjdO0gglQBB4GAsu7u6wjijbCmzsUTy6mnk6oQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "node_modules/@eslint/object-schema": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.3.tgz", + "integrity": "sha512-iM869Pugn9Nsxbh/YHRqYiqd23AmIbxJOcpUMOuWCVNdoQJ5ZtwL6h3t0bcZzJUlC3Dq9jCFCESBZnX0GTv7iQ==", "dev": true, - "requires": { - "for-in": "1.0.2" + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "forever-agent": { + "node_modules/@eslint/plugin-kit": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.6.1.tgz", + "integrity": "sha512-iH1B076HoAshH1mLpHMgwdGeTs0CYwL0SPMkGuSebZrwBp16v415e9NZXg2jtrqPVQjf6IANe2Vtlr5KswtcZQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.1.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } }, - "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "node_modules/@exceptionless/angularjs": { + "resolved": "packages/angularjs", + "link": true + }, + "node_modules/@exceptionless/browser": { + "resolved": "packages/browser", + "link": true + }, + "node_modules/@exceptionless/core": { + "resolved": "packages/core", + "link": true + }, + "node_modules/@exceptionless/node": { + "resolved": "packages/node", + "link": true + }, + "node_modules/@exceptionless/react": { + "resolved": "packages/react", + "link": true + }, + "node_modules/@exceptionless/vue": { + "resolved": "packages/vue", + "link": true + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "dev": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" } }, - "formatio": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.2.0.tgz", - "integrity": "sha1-87IWfZBoxGmKjVH092CjmlTYGOs=", + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, - "requires": { - "samsam": "1.2.1" + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "dev": true + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, - "fs-exists-sync": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", - "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=", - "dev": true + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } }, - "fs-extra": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", - "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0", - "klaw": "1.3.1" + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - } + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } }, - "fsevents": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, - "optional": true, - "requires": { - "nan": "2.6.2", - "node-pre-gyp": "0.6.36" + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", "dependencies": { - "abbrev": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", - "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", - "dev": true, - "optional": true - }, - "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", - "dev": true, - "optional": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "aproba": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", - "integrity": "sha1-ldNgDwdxCqDpKYxyatXs8urLq6s=", - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", - "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", - "dev": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.2.9" - } - }, - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", - "dev": true, - "optional": true - }, - "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true, + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.3.0.tgz", + "integrity": "sha512-PAwCvFJ4696XP2qZj+LAn1BWjZaJ6RjG6c7/lkMaUJnkyMS34ucuIsfqYvfskVNvUI27R/u4P1HMYFnlVXG/Ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.3.0", + "@types/node": "*", + "chalk": "^4.1.2", + "jest-message-util": "30.3.0", + "jest-util": "30.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/core": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.3.0.tgz", + "integrity": "sha512-U5mVPsBxLSO6xYbf+tgkymLx+iAhvZX43/xI1+ej2ZOPnPdkdO1CzDmFKh2mZBn2s4XZixszHeQnzp1gm/DIxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "30.3.0", + "@jest/pattern": "30.0.1", + "@jest/reporters": "30.3.0", + "@jest/test-result": "30.3.0", + "@jest/transform": "30.3.0", + "@jest/types": "30.3.0", + "@types/node": "*", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "exit-x": "^0.2.2", + "graceful-fs": "^4.2.11", + "jest-changed-files": "30.3.0", + "jest-config": "30.3.0", + "jest-haste-map": "30.3.0", + "jest-message-util": "30.3.0", + "jest-regex-util": "30.0.1", + "jest-resolve": "30.3.0", + "jest-resolve-dependencies": "30.3.0", + "jest-runner": "30.3.0", + "jest-runtime": "30.3.0", + "jest-snapshot": "30.3.0", + "jest-util": "30.3.0", + "jest-validate": "30.3.0", + "jest-watcher": "30.3.0", + "pretty-format": "30.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", - "dev": true, + } + } + }, + "node_modules/@jest/diff-sequences": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.3.0.tgz", + "integrity": "sha512-cG51MVnLq1ecVUaQ3fr6YuuAOitHK1S4WUJHnsPFE/quQr33ADUx1FfrTCpMCRxvy0Yr9BThKpDjSlcTi91tMA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.3.0.tgz", + "integrity": "sha512-SlLSF4Be735yQXyh2+mctBOzNDx5s5uLv88/j8Qn1wH679PDcwy67+YdADn8NJnGjzlXtN62asGH/T4vWOkfaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "30.3.0", + "@jest/types": "30.3.0", + "@types/node": "*", + "jest-mock": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/environment-jsdom-abstract": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/environment-jsdom-abstract/-/environment-jsdom-abstract-30.3.0.tgz", + "integrity": "sha512-0hNFs5N6We3DMCwobzI0ydhkY10sT1tZSC0AAiy+0g2Dt/qEWgrcV5BrMxPczhe41cxW4qm6X+jqZaUdpZIajA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.3.0", + "@jest/fake-timers": "30.3.0", + "@jest/types": "30.3.0", + "@types/jsdom": "^21.1.7", + "@types/node": "*", + "jest-mock": "30.3.0", + "jest-util": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "canvas": "^3.0.0", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "canvas": { "optional": true - }, - "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", - "dev": true, + } + } + }, + "node_modules/@jest/expect": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.3.0.tgz", + "integrity": "sha512-76Nlh4xJxk2D/9URCn3wFi98d2hb19uWE1idLsTt2ywhvdOldbw3S570hBgn25P4ICUZ/cBjybrBex2g17IDbg==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "30.3.0", + "jest-snapshot": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.3.0.tgz", + "integrity": "sha512-j0+W5iQQ8hBh7tHZkTQv3q2Fh/M7Je72cIsYqC4OaktgtO7v1So9UTjp6uPBHIaB6beoF/RRsCgMJKvti0wADA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/get-type": "30.1.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.3.0.tgz", + "integrity": "sha512-WUQDs8SOP9URStX1DzhD425CqbN/HxUYCTwVrT8sTVBfMvFqYt/s61EK5T05qnHu0po6RitXIvP9otZxYDzTGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.3.0", + "@sinonjs/fake-timers": "^15.0.0", + "@types/node": "*", + "jest-message-util": "30.3.0", + "jest-mock": "30.3.0", + "jest-util": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/get-type": { + "version": "30.1.0", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz", + "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.3.0.tgz", + "integrity": "sha512-+owLCBBdfpgL3HU+BD5etr1SvbXpSitJK0is1kiYjJxAAJggYMRQz5hSdd5pq1sSggfxPbw2ld71pt4x5wwViA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.3.0", + "@jest/expect": "30.3.0", + "@jest/types": "30.3.0", + "jest-mock": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/pattern": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.0.1.tgz", + "integrity": "sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-regex-util": "30.0.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.3.0.tgz", + "integrity": "sha512-a09z89S+PkQnL055bVj8+pe2Caed2PBOaczHcXCykW5ngxX9EWx/1uAwncxc/HiU0oZqfwseMjyhxgRjS49qPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "30.3.0", + "@jest/test-result": "30.3.0", + "@jest/transform": "30.3.0", + "@jest/types": "30.3.0", + "@jridgewell/trace-mapping": "^0.3.25", + "@types/node": "*", + "chalk": "^4.1.2", + "collect-v8-coverage": "^1.0.2", + "exit-x": "^0.2.2", + "glob": "^10.5.0", + "graceful-fs": "^4.2.11", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^5.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "30.3.0", + "jest-util": "30.3.0", + "jest-worker": "30.3.0", + "slash": "^3.0.0", + "string-length": "^4.0.2", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { "optional": true - }, - "balanced-match": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "brace-expansion": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz", - "integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=", - "dev": true, - "requires": { - "balanced-match": "0.4.2", - "concat-map": "0.0.1" - } - }, - "buffer-shims": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true, - "optional": true - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "combined-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", - "dev": true, - "optional": true, - "requires": { - "boom": "2.10.1" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, - "optional": true - } - } - }, - "debug": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", - "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", - "dev": true, - "optional": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true, - "optional": true - }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", - "dev": true, - "optional": true - }, - "extsprintf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", - "dev": true, - "optional": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", - "integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=", - "dev": true, - "optional": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "optional": true, - "requires": { - "aproba": "1.1.1", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, - "optional": true - } - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "har-schema": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", - "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", - "dev": true, - "optional": true - }, - "har-validator": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", - "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", - "dev": true, - "optional": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true, - "optional": true - }, - "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", - "dev": true, - "optional": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "ini": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true, - "optional": true - }, - "jodid25519": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", - "integrity": "sha1-BtSRIlUJNBlHfUJWM2BuDpB4KWc=", - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "optional": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true, - "optional": true - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true, - "optional": true - }, - "jsprim": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", - "integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, - "optional": true - } - } - }, - "mime-db": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", - "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=", - "dev": true - }, - "mime-types": { - "version": "2.1.15", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", - "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", - "dev": true, - "requires": { - "mime-db": "1.27.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true, - "optional": true - }, - "node-pre-gyp": { - "version": "0.6.36", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz", - "integrity": "sha1-22BBEst04NR3VU6bUFsXq936t4Y=", - "dev": true, - "optional": true, - "requires": { - "mkdirp": "0.5.1", - "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", - "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" - } - }, - "nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" - } - }, - "npmlog": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.0.tgz", - "integrity": "sha512-ocolIkZYZt8UveuiDS0yAkkIjid1o7lPG8cYm05yNYzBn8ykQtaiPMEGp8fY9tKdDgm8okpdKzkvu1y9hUYugA==", - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true, + } + } + }, + "node_modules/@jest/reporters/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/reporters/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@jest/reporters/node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@jest/reporters/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@jest/reporters/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@jest/reporters/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@jest/schemas": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", + "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.34.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/snapshot-utils": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.3.0.tgz", + "integrity": "sha512-ORbRN9sf5PP82v3FXNSwmO1OTDR2vzR2YTaR+E3VkSBZ8zadQE6IqYdYEeFH1NIkeB2HIGdF02dapb6K0Mj05g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.3.0", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "natural-compare": "^1.4.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.0.1.tgz", + "integrity": "sha512-MIRWMUUR3sdbP36oyNyhbThLHyJ2eEDClPCiHVbrYAe5g3CHRArIVpBw7cdSB5fr+ofSfIb2Tnsw8iEHL0PYQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "callsites": "^3.1.0", + "graceful-fs": "^4.2.11" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.3.0.tgz", + "integrity": "sha512-e/52nJGuD74AKTSe0P4y5wFRlaXP0qmrS17rqOMHeSwm278VyNyXE3gFO/4DTGF9w+65ra3lo3VKj0LBrzmgdQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "30.3.0", + "@jest/types": "30.3.0", + "@types/istanbul-lib-coverage": "^2.0.6", + "collect-v8-coverage": "^1.0.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.3.0.tgz", + "integrity": "sha512-dgbWy9b8QDlQeRZcv7LNF+/jFiiYHTKho1xirauZ7kVwY7avjFF6uTT0RqlgudB5OuIPagFdVtfFMosjVbk1eA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "30.3.0", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.3.0.tgz", + "integrity": "sha512-TLKY33fSLVd/lKB2YI1pH69ijyUblO/BQvCj566YvnwuzoTNr648iE0j22vRvVNk2HsPwByPxATg3MleS3gf5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.27.4", + "@jest/types": "30.3.0", + "@jridgewell/trace-mapping": "^0.3.25", + "babel-plugin-istanbul": "^7.0.1", + "chalk": "^4.1.2", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.3.0", + "jest-regex-util": "30.0.1", + "jest-util": "30.3.0", + "pirates": "^4.0.7", + "slash": "^3.0.0", + "write-file-atomic": "^5.0.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/types": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.3.0.tgz", + "integrity": "sha512-JHm87k7bA33hpBngtU8h6UBub/fqqA9uXfw+21j5Hmk7ooPHlboRNxHq0JcMtC+n8VJGP1mcfnD3Mk+XKe1oSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/pattern": "30.0.1", + "@jest/schemas": "30.0.5", + "@types/istanbul-lib-coverage": "^2.0.6", + "@types/istanbul-reports": "^3.0.4", + "@types/node": "*", + "@types/yargs": "^17.0.33", + "chalk": "^4.1.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz", + "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.4.3", + "@emnapi/runtime": "^1.4.3", + "@tybys/wasm-util": "^0.10.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.122.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.122.0.tgz", + "integrity": "sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.11.tgz", + "integrity": "sha512-SJ+/g+xNnOh6NqYxD0V3uVN4W3VfnrGsC9/hoglicgTNfABFG9JjISvkkU0dNY84MNHLWyOgxP9v9Y9pX4S7+A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.11.tgz", + "integrity": "sha512-7WQgR8SfOPwmDZGFkThUvsmd/nwAWv91oCO4I5LS7RKrssPZmOt7jONN0cW17ydGC1n/+puol1IpoieKqQidmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.11.tgz", + "integrity": "sha512-39Ks6UvIHq4rEogIfQBoBRusj0Q0nPVWIvqmwBLaT6aqQGIakHdESBVOPRRLacy4WwUPIx4ZKzfZ9PMW+IeyUQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.11.tgz", + "integrity": "sha512-jfsm0ZHfhiqrvWjJAmzsqiIFPz5e7mAoCOPBNTcNgkiid/LaFKiq92+0ojH+nmJmKYkre4t71BWXUZDNp7vsag==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.11.tgz", + "integrity": "sha512-zjQaUtSyq1nVe3nxmlSCuR96T1LPlpvmJ0SZy0WJFEsV4kFbXcq2u68L4E6O0XeFj4aex9bEauqjW8UQBeAvfQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.11.tgz", + "integrity": "sha512-WMW1yE6IOnehTcFE9eipFkm3XN63zypWlrJQ2iF7NrQ9b2LDRjumFoOGJE8RJJTJCTBAdmLMnJ8uVitACUUo1Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.11.tgz", + "integrity": "sha512-jfndI9tsfm4APzjNt6QdBkYwre5lRPUgHeDHoI7ydKUuJvz3lZeCfMsI56BZj+7BYqiKsJm7cfd/6KYV7ubrBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.11.tgz", + "integrity": "sha512-ZlFgw46NOAGMgcdvdYwAGu2Q+SLFA9LzbJLW+iyMOJyhj5wk6P3KEE9Gct4xWwSzFoPI7JCdYmYMzVtlgQ+zfw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.11.tgz", + "integrity": "sha512-hIOYmuT6ofM4K04XAZd3OzMySEO4K0/nc9+jmNcxNAxRi6c5UWpqfw3KMFV4MVFWL+jQsSh+bGw2VqmaPMTLyw==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.11.tgz", + "integrity": "sha512-qXBQQO9OvkjjQPLdUVr7Nr2t3QTZI7s4KZtfw7HzBgjbmAPSFwSv4rmET9lLSgq3rH/ndA3ngv3Qb8l2njoPNA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.11.tgz", + "integrity": "sha512-/tpFfoSTzUkH9LPY+cYbqZBDyyX62w5fICq9qzsHLL8uTI6BHip3Q9Uzft0wylk/i8OOwKik8OxW+QAhDmzwmg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.11.tgz", + "integrity": "sha512-mcp3Rio2w72IvdZG0oQ4bM2c2oumtwHfUfKncUM6zGgz0KgPz4YmDPQfnXEiY5t3+KD/i8HG2rOB/LxdmieK2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.11.tgz", + "integrity": "sha512-LXk5Hii1Ph9asuGRjBuz8TUxdc1lWzB7nyfdoRgI0WGPZKmCxvlKk8KfYysqtr4MfGElu/f/pEQRh8fcEgkrWw==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.1.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.1.tgz", + "integrity": "sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1", + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.11.tgz", + "integrity": "sha512-dDwf5otnx0XgRY1yqxOC4ITizcdzS/8cQ3goOWv3jFAo4F+xQYni+hnMuO6+LssHHdJW7+OCVL3CoU4ycnh35Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.11.tgz", + "integrity": "sha512-LN4/skhSggybX71ews7dAj6r2geaMJfm3kMbK2KhFMg9B10AZXnKoLCVVgzhMHL0S+aKtr4p8QbAW8k+w95bAA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.7", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.7.tgz", + "integrity": "sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinclair/typebox": { + "version": "0.34.48", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.48.tgz", + "integrity": "sha512-kKJTNuK3AQOrgjjotVxMrCn1sUJwM76wMszfq1kdU4uYVJjvEWuFQ6HgvLt4Xz3fSmZlTOxJ/Ie13KnIcWQXFA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.1.1.tgz", + "integrity": "sha512-cO5W33JgAPbOh07tvZjUOJ7oWhtaqGHiZw+11DPbyqh2kHTBc3eF/CjJDeQ4205RLQsX6rxCuYOroFQwl7JDRw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sveltejs/acorn-typescript": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.9.tgz", + "integrity": "sha512-lVJX6qEgs/4DOcRTpo56tmKzVPtoWAaVbL4hfO7t7NVwl9AAXzQR6cihesW1BmNMPl+bK6dreu2sOKBP2Q9CIA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^8.9.0" + } + }, + "node_modules/@sveltejs/adapter-auto": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-auto/-/adapter-auto-7.0.1.tgz", + "integrity": "sha512-dvuPm1E7M9NI/+canIQ6KKQDU2AkEefEZ2Dp7cY6uKoPq9Z/PhOXABe526UdW2mN986gjVkuSLkOYIBnS/M2LQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@sveltejs/kit": "^2.0.0" + } + }, + "node_modules/@sveltejs/kit": { + "version": "2.55.0", + "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.55.0.tgz", + "integrity": "sha512-MdFRjevVxmAknf2NbaUkDF16jSIzXMWd4Nfah0Qp8TtQVoSp3bV4jKt8mX7z7qTUTWvgSaxtR0EG5WJf53gcuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@sveltejs/acorn-typescript": "^1.0.5", + "@types/cookie": "^0.6.0", + "acorn": "^8.14.1", + "cookie": "^0.6.0", + "devalue": "^5.6.4", + "esm-env": "^1.2.2", + "kleur": "^4.1.5", + "magic-string": "^0.30.5", + "mrmime": "^2.0.0", + "set-cookie-parser": "^3.0.0", + "sirv": "^3.0.0" + }, + "bin": { + "svelte-kit": "svelte-kit.js" + }, + "engines": { + "node": ">=18.13" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0", + "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0", + "svelte": "^4.0.0 || ^5.0.0-next.0", + "typescript": "^5.3.3", + "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { "optional": true }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, + "typescript": { "optional": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true, + } + } + }, + "node_modules/@sveltejs/vite-plugin-svelte": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-7.0.0.tgz", + "integrity": "sha512-ILXmxC7HAsnkK2eslgPetrqqW1BKSL7LktsFgqzNj83MaivMGZzluWq32m25j2mDOjmSKX7GGWahePhuEs7P/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deepmerge": "^4.3.1", + "magic-string": "^0.30.21", + "obug": "^2.1.0", + "vitefu": "^1.1.2" + }, + "engines": { + "node": "^20.19 || ^22.12 || >=24" + }, + "peerDependencies": { + "svelte": "^5.46.4", + "vite": "^8.0.0-beta.7 || ^8.0.0" + } + }, + "node_modules/@testing-library/jest-dom": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.9.1.tgz", + "integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@adobe/css-tools": "^4.4.0", + "aria-query": "^5.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.6.3", + "picocolors": "^1.1.1", + "redent": "^3.0.0" + }, + "engines": { + "node": ">=14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/@testing-library/react": { + "version": "16.3.2", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.2.tgz", + "integrity": "sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@testing-library/dom": "^10.0.0", + "@types/react": "^18.0.0 || ^19.0.0", + "@types/react-dom": "^18.0.0 || ^19.0.0", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { "optional": true }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true, + "@types/react-dom": { "optional": true - }, - "osenv": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", - "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "performance-now": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", - "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", - "dev": true, + } + } + }, + "node_modules/@testing-library/user-event": { + "version": "14.6.1", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.1.tgz", + "integrity": "sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@testing-library/dom": ">=7.21.4" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/angular": { + "version": "1.8.9", + "resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.8.9.tgz", + "integrity": "sha512-Z0HukqZkx0fotsV3QO00yqU9NzcQI+tMcrum+8MvfB4ePqCawZctF/gz6QiuII+T1ax+LitNoPx/eICTgnF4sg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jsdom": { + "version": "21.1.7", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.7.tgz", + "integrity": "sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz", + "integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/@types/node-localstorage": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/node-localstorage/-/node-localstorage-1.3.3.tgz", + "integrity": "sha512-Wkn5g4eM5x10UNV9Xvl9K6y6m0zorocuJy4WjB5muUdyMZuPbZpSJG3hlhjGHe1HGxbOQO7RcB+jlHcNwkh+Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/react": { + "version": "19.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", + "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@types/stack-trace": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/stack-trace/-/stack-trace-0.0.33.tgz", + "integrity": "sha512-O7in6531Bbvlb2KEsJ0dq0CHZvc3iWSR5ZYMtvGgnHA56VgriAN/AU2LorfmcvAl2xc9N5fbCTRyMRRl8nd74g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.57.2.tgz", + "integrity": "sha512-NZZgp0Fm2IkD+La5PR81sd+g+8oS6JwJje+aRWsDocxHkjyRw0J5L5ZTlN3LI1LlOcGL7ph3eaIUmTXMIjLk0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.57.2", + "@typescript-eslint/type-utils": "8.57.2", + "@typescript-eslint/utils": "8.57.2", + "@typescript-eslint/visitor-keys": "8.57.2", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.57.2", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.57.2.tgz", + "integrity": "sha512-30ScMRHIAD33JJQkgfGW1t8CURZtjc2JpTrq5n2HFhOefbAhb7ucc7xJwdWcrEtqUIYJ73Nybpsggii6GtAHjA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.57.2", + "@typescript-eslint/types": "8.57.2", + "@typescript-eslint/typescript-estree": "8.57.2", + "@typescript-eslint/visitor-keys": "8.57.2", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.57.2.tgz", + "integrity": "sha512-FuH0wipFywXRTHf+bTTjNyuNQQsQC3qh/dYzaM4I4W0jrCqjCVuUh99+xd9KamUfmCGPvbO8NDngo/vsnNVqgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.57.2", + "@typescript-eslint/types": "^8.57.2", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.57.2.tgz", + "integrity": "sha512-snZKH+W4WbWkrBqj4gUNRIGb/jipDW3qMqVJ4C9rzdFc+wLwruxk+2a5D+uoFcKPAqyqEnSb4l2ULuZf95eSkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.57.2", + "@typescript-eslint/visitor-keys": "8.57.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.57.2.tgz", + "integrity": "sha512-3Lm5DSM+DCowsUOJC+YqHHnKEfFh5CoGkj5Z31NQSNF4l5wdOwqGn99wmwN/LImhfY3KJnmordBq/4+VDe2eKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.57.2.tgz", + "integrity": "sha512-Co6ZCShm6kIbAM/s+oYVpKFfW7LBc6FXoPXjTRQ449PPNBY8U0KZXuevz5IFuuUj2H9ss40atTaf9dlGLzbWZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.57.2", + "@typescript-eslint/typescript-estree": "8.57.2", + "@typescript-eslint/utils": "8.57.2", + "debug": "^4.4.3", + "ts-api-utils": "^2.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.57.2.tgz", + "integrity": "sha512-/iZM6FnM4tnx9csuTxspMW4BOSegshwX5oBDznJ7S4WggL7Vczz5d2W11ecc4vRrQMQHXRSxzrCsyG5EsPPTbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.57.2.tgz", + "integrity": "sha512-2MKM+I6g8tJxfSmFKOnHv2t8Sk3T6rF20A1Puk0svLK+uVapDZB/4pfAeB7nE83uAZrU6OxW+HmOd5wHVdXwXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.57.2", + "@typescript-eslint/tsconfig-utils": "8.57.2", + "@typescript-eslint/types": "8.57.2", + "@typescript-eslint/visitor-keys": "8.57.2", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.57.2.tgz", + "integrity": "sha512-krRIbvPK1ju1WBKIefiX+bngPs+odIQUtR7kymzPfo1POVw3jlF+nLkmexdSSd4UCbDcQn+wMBATOOmpBbqgKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.57.2", + "@typescript-eslint/types": "8.57.2", + "@typescript-eslint/typescript-estree": "8.57.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.57.2.tgz", + "integrity": "sha512-zhahknjobV2FiD6Ee9iLbS7OV9zi10rG26odsQdfBO/hjSzUQbkIYgda+iNKK1zNiW2ey+Lf8MU5btN17V3dUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.57.2", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" + }, + "node_modules/@unrs/resolver-binding-android-arm-eabi": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz", + "integrity": "sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@unrs/resolver-binding-android-arm64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz", + "integrity": "sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@unrs/resolver-binding-darwin-arm64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz", + "integrity": "sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@unrs/resolver-binding-darwin-x64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz", + "integrity": "sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@unrs/resolver-binding-freebsd-x64": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz", + "integrity": "sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz", + "integrity": "sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz", + "integrity": "sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz", + "integrity": "sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm64-musl": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz", + "integrity": "sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz", + "integrity": "sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz", + "integrity": "sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz", + "integrity": "sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz", + "integrity": "sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz", + "integrity": "sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-musl": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz", + "integrity": "sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-wasm32-wasi": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz", + "integrity": "sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^0.2.11" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz", + "integrity": "sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz", + "integrity": "sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz", + "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.1.tgz", + "integrity": "sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "1.0.0-rc.7" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { "optional": true }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true, + "babel-plugin-react-compiler": { "optional": true - }, - "qs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", - "dev": true, + } + } + }, + "node_modules/@vitejs/plugin-vue": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-6.0.5.tgz", + "integrity": "sha512-bL3AxKuQySfk1iGcBsQnoRVexTPJq0Z/ixFVM8OhVJAP6ZXXXLtM7NFKWhLl30Kg7uTBqIaPXbh+nuQCuBDedg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "1.0.0-rc.2" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vitejs/plugin-vue/node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.2", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.2.tgz", + "integrity": "sha512-izyXV/v+cHiRfozX62W9htOAvwMo4/bXKDrQ+vom1L1qRuexPock/7VZDAhnpHCLNejd3NJ6hiab+tO0D44Rgw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitest/expect": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.1.tgz", + "integrity": "sha512-xAV0fqBTk44Rn6SjJReEQkHP3RrqbJo6JQ4zZ7/uVOiJZRarBtblzrOfFIZeYUrukp2YD6snZG6IBqhOoHTm+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.1", + "@vitest/utils": "4.1.1", + "chai": "^6.2.2", + "tinyrainbow": "^3.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.1.tgz", + "integrity": "sha512-h3BOylsfsCLPeceuCPAAJ+BvNwSENgJa4hXoXu4im0bs9Lyp4URc4JYK4pWLZ4pG/UQn7AT92K6IByi6rE6g3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "4.1.1", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { "optional": true }, - "rc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", - "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.2.9", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.9.tgz", - "integrity": "sha1-z3jsb0ptHrQ9JkiMrJfwQudLf8g=", - "dev": true, - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.1", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.81.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", - "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", - "dev": true, - "optional": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" - } - }, - "rimraf": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", - "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", - "dev": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", - "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=", - "dev": true - }, - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "dev": true, + "vite": { "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true, + } + } + }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.1.tgz", + "integrity": "sha512-GM+TEQN5WhOygr1lp7skeVjdLPqqWMHsfzXrcHAqZJi/lIVh63H0kaRCY8MDhNWikx19zBUK8ceaLB7X5AH9NQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.1.tgz", + "integrity": "sha512-f7+FPy75vN91QGWsITueq0gedwUZy1fLtHOCMeQpjs8jTekAHeKP80zfDEnhrleviLHzVSDXIWuCIOFn3D3f8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.1", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.1.tgz", + "integrity": "sha512-kMVSgcegWV2FibXEx9p9WIKgje58lcTbXgnJixfcg15iK8nzCXhmalL0ZLtTWLW9PH1+1NEDShiFFedB3tEgWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.1", + "@vitest/utils": "4.1.1", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.1.tgz", + "integrity": "sha512-6Ti/KT5OVaiupdIZEuZN7l3CZcR0cxnxt70Z0//3CtwgObwA6jZhmVBA3yrXSVN3gmwjgd7oDNLlsXz526gpRA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.1.tgz", + "integrity": "sha512-cNxAlaB3sHoCdL6pj6yyUXv9Gry1NHNg0kFTXdvSIZXLHsqKH7chiWOkwJ5s5+d/oMwcoG9T0bKU38JZWKusrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.1", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.30.tgz", + "integrity": "sha512-s3DfdZkcu/qExZ+td75015ljzHc6vE+30cFMGRPROYjqkroYI5NV2X1yAMX9UeyBNWB9MxCfPcsjpLS11nzkkw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@vue/shared": "3.5.30", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.30.tgz", + "integrity": "sha512-eCFYESUEVYHhiMuK4SQTldO3RYxyMR/UQL4KdGD1Yrkfdx4m/HYuZ9jSfPdA+nWJY34VWndiYdW/wZXyiPEB9g==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.30", + "@vue/shared": "3.5.30" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.30.tgz", + "integrity": "sha512-LqmFPDn89dtU9vI3wHJnwaV6GfTRD87AjWpTWpyrdVOObVtjIuSeZr181z5C4PmVx/V3j2p+0f7edFKGRMpQ5A==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@vue/compiler-core": "3.5.30", + "@vue/compiler-dom": "3.5.30", + "@vue/compiler-ssr": "3.5.30", + "@vue/shared": "3.5.30", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.8", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.30.tgz", + "integrity": "sha512-NsYK6OMTnx109PSL2IAyf62JP6EUdk4Dmj6AkWcJGBvN0dQoMYtVekAmdqgTtWQgEJo+Okstbf/1p7qZr5H+bA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.30", + "@vue/shared": "3.5.30" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.30.tgz", + "integrity": "sha512-179YNgKATuwj9gB+66snskRDOitDiuOZqkYia7mHKJaidOMo/WJxHKF8DuGc4V4XbYTJANlfEKb0yxTQotnx4Q==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.30" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.30.tgz", + "integrity": "sha512-e0Z+8PQsUTdwV8TtEsLzUM7SzC7lQwYKePydb7K2ZnmS6jjND+WJXkmmfh/swYzRyfP1EY3fpdesyYoymCzYfg==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.30", + "@vue/shared": "3.5.30" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.30.tgz", + "integrity": "sha512-2UIGakjU4WSQ0T4iwDEW0W7vQj6n7AFn7taqZ9Cvm0Q/RA2FFOziLESrDL4GmtI1wV3jXg5nMoJSYO66egDUBw==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.30", + "@vue/runtime-core": "3.5.30", + "@vue/shared": "3.5.30", + "csstype": "^3.2.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.30.tgz", + "integrity": "sha512-v+R34icapydRwbZRD0sXwtHqrQJv38JuMB4JxbOxd8NEpGLny7cncMp53W9UH/zo4j8eDHjQ1dEJXwzFQknjtQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.30", + "@vue/shared": "3.5.30" + }, + "peerDependencies": { + "vue": "3.5.30" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.30.tgz", + "integrity": "sha512-YXgQ7JjaO18NeK2K9VTbDHaFy62WrObMa6XERNfNOkAhD1F1oDSf3ZJ7K6GqabZ0BvSDHajp8qfS5Sa2I9n8uQ==", + "license": "MIT" + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/babel-jest": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.3.0.tgz", + "integrity": "sha512-gRpauEU2KRrCox5Z296aeVHR4jQ98BCnu0IO332D/xpHNOsIH/bgSRk9k6GbKIbBw8vFeN6ctuu6tV8WOyVfYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "30.3.0", + "@types/babel__core": "^7.20.5", + "babel-plugin-istanbul": "^7.0.1", + "babel-preset-jest": "30.3.0", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "slash": "^3.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.11.0 || ^8.0.0-0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-7.0.1.tgz", + "integrity": "sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==", + "dev": true, + "license": "BSD-3-Clause", + "workspaces": [ + "test/babel-8" + ], + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-instrument": "^6.0.2", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-30.3.0.tgz", + "integrity": "sha512-+TRkByhsws6sfPjVaitzadk1I0F5sPvOVUH5tyTSzhePpsGIVrdeunHSw/C36QeocS95OOk8lunc4rlu5Anwsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/babel__core": "^7.20.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", + "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/babel-preset-jest": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-30.3.0.tgz", + "integrity": "sha512-6ZcUbWHC+dMz2vfzdNwi87Z1gQsLNK2uLuK1Q89R11xdvejcivlYYwDlEv0FHX3VwEXpbBQ9uufB/MUNpZGfhQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "30.3.0", + "babel-preset-current-node-syntax": "^1.2.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.11.0 || ^8.0.0-beta.1" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.10", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.10.tgz", + "integrity": "sha512-sUoJ3IMxx4AyRqO4MLeHlnGDkyXRoUG0/AI9fjK+vS72ekpV0yWVY7O0BVjmBcRtkNcsAO2QDZ4tdKKGoI6YaQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/browser-sample": { + "resolved": "example/browser", + "link": true + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001781", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001781.tgz", + "integrity": "sha512-RdwNCyMsNBftLjW6w01z8bKEvT6e/5tpPVEgtn22TiLGlstHOVecsX2KHFkD5e/vRnIE4EGzpuIODb3mtswtkw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chai": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", + "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ci-info": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", + "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.2.0.tgz", + "integrity": "sha512-4bHTS2YuzUvtoLjdy+98ykbNB5jS0+07EvFNXerqZQJ89F7DI6ET7OQo/HJuW6K0aVsKA9hj9/RVb2kQVOrPDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", + "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", + "dev": true, + "license": "MIT" + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cssstyle": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", + "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^3.2.0", + "rrweb-cssom": "^0.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true, + "license": "MIT" + }, + "node_modules/dedent": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", + "integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/devalue": { + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.6.4.tgz", + "integrity": "sha512-Gp6rDldRsFh/7XuouDbxMH3Mx8GMCcgzIb1pDTvNyn8pZGQ22u+Wa+lGV9dQCltFQ7uVw0MhRyb8XDskNFOReA==", + "dev": true, + "license": "MIT" + }, + "node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.321", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.321.tgz", + "integrity": "sha512-L2C7Q279W2D/J4PLZLk7sebOILDSWos7bMsMNN06rK482umHUrh/3lM8G7IlHFOYip2oAg5nha1rCMxr/rs6ZQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "license": "MIT", + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", + "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==", + "dev": true, + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.4.tgz", + "integrity": "sha512-Rq4vbHnYkK5fws5NF7MYTU68FPRE1ajX7heQ/8QXXWqNgqqJ/GkmmyxIzUnf2Sr/bakf8l54716CcMGHYhMrrQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.4", + "@esbuild/android-arm": "0.27.4", + "@esbuild/android-arm64": "0.27.4", + "@esbuild/android-x64": "0.27.4", + "@esbuild/darwin-arm64": "0.27.4", + "@esbuild/darwin-x64": "0.27.4", + "@esbuild/freebsd-arm64": "0.27.4", + "@esbuild/freebsd-x64": "0.27.4", + "@esbuild/linux-arm": "0.27.4", + "@esbuild/linux-arm64": "0.27.4", + "@esbuild/linux-ia32": "0.27.4", + "@esbuild/linux-loong64": "0.27.4", + "@esbuild/linux-mips64el": "0.27.4", + "@esbuild/linux-ppc64": "0.27.4", + "@esbuild/linux-riscv64": "0.27.4", + "@esbuild/linux-s390x": "0.27.4", + "@esbuild/linux-x64": "0.27.4", + "@esbuild/netbsd-arm64": "0.27.4", + "@esbuild/netbsd-x64": "0.27.4", + "@esbuild/openbsd-arm64": "0.27.4", + "@esbuild/openbsd-x64": "0.27.4", + "@esbuild/openharmony-arm64": "0.27.4", + "@esbuild/sunos-x64": "0.27.4", + "@esbuild/win32-arm64": "0.27.4", + "@esbuild/win32-ia32": "0.27.4", + "@esbuild/win32-x64": "0.27.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.1.0.tgz", + "integrity": "sha512-S9jlY/ELKEUwwQnqWDO+f+m6sercqOPSqXM5Go94l7DOmxHVDgmSFGWEzeE/gwgTAr0W103BWt0QLe/7mabIvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.3", + "@eslint/config-helpers": "^0.5.3", + "@eslint/core": "^1.1.1", + "@eslint/plugin-kit": "^0.6.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^10.2.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-config-prettier": { + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-jest": { + "version": "29.15.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.15.0.tgz", + "integrity": "sha512-ZCGr7vTH2WSo2hrK5oM2RULFmMruQ7W3cX7YfwoTiPfzTGTFBMmrVIz45jZHd++cGKj/kWf02li/RhTGcANJSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "^8.0.0" + }, + "engines": { + "node": "^20.12.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^8.0.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "jest": "*", + "typescript": ">=4.8.4 <6.0.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + }, + "jest": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esm-env": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", + "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/espree": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrap": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.2.4.tgz", + "integrity": "sha512-suICpxAmZ9A8bzJjEl/+rLJiDKC0X4gYWUxT6URAWBLvlXmtbZd5ySMu/N2ZGEtMCAmflUDPSehrP9BQcsGcSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15", + "@typescript-eslint/types": "^8.2.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit-x": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/exit-x/-/exit-x-0.2.2.tgz", + "integrity": "sha512-+I6B/IkJc1o/2tiURyz/ivu/O0nKNEArIUB5O7zBrlDVJr22SCLH3xTeEry428LvFhRzIA1g8izguxJ/gbNcVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.3.0.tgz", + "integrity": "sha512-1zQrciTiQfRdo7qJM1uG4navm8DayFa2TgCSRlzUyNkhcJ6XUZF3hjnpkyr3VhAqPH7i/9GkG7Tv5abz6fqz0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "30.3.0", + "@jest/get-type": "30.1.0", + "jest-matcher-utils": "30.3.0", + "jest-message-util": "30.3.0", + "jest-mock": "30.3.0", + "jest-util": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-sample": { + "resolved": "example/express", + "link": true + }, + "node_modules/express/node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/is-reference": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", + "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.6" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jest": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-30.3.0.tgz", + "integrity": "sha512-AkXIIFcaazymvey2i/+F94XRnM6TsVLZDhBMLsd1Sf/W0wzsvvpjeyUrCZD6HGG4SDYPgDJDBKeiJTBb10WzMg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "30.3.0", + "@jest/types": "30.3.0", + "import-local": "^3.2.0", + "jest-cli": "30.3.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true, + } + } + }, + "node_modules/jest-changed-files": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.3.0.tgz", + "integrity": "sha512-B/7Cny6cV5At6M25EWDgf9S617lHivamL8vl6KEpJqkStauzcG4e+WPfDgMMF+H4FVH4A2PLRyvgDJan4441QA==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.1.1", + "jest-util": "30.3.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-circus": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.3.0.tgz", + "integrity": "sha512-PyXq5szeSfR/4f1lYqCmmQjh0vqDkURUYi9N6whnHjlRz4IUQfMcXkGLeEoiJtxtyPqgUaUUfyQlApXWBSN1RA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.3.0", + "@jest/expect": "30.3.0", + "@jest/test-result": "30.3.0", + "@jest/types": "30.3.0", + "@types/node": "*", + "chalk": "^4.1.2", + "co": "^4.6.0", + "dedent": "^1.6.0", + "is-generator-fn": "^2.1.0", + "jest-each": "30.3.0", + "jest-matcher-utils": "30.3.0", + "jest-message-util": "30.3.0", + "jest-runtime": "30.3.0", + "jest-snapshot": "30.3.0", + "jest-util": "30.3.0", + "p-limit": "^3.1.0", + "pretty-format": "30.3.0", + "pure-rand": "^7.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-cli": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.3.0.tgz", + "integrity": "sha512-l6Tqx+j1fDXJEW5bqYykDQQ7mQg+9mhWXtnj+tQZrTWYHyHoi6Be8HPumDSA+UiX2/2buEgjA58iJzdj146uCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "30.3.0", + "@jest/test-result": "30.3.0", + "@jest/types": "30.3.0", + "chalk": "^4.1.2", + "exit-x": "^0.2.2", + "import-local": "^3.2.0", + "jest-config": "30.3.0", + "jest-util": "30.3.0", + "jest-validate": "30.3.0", + "yargs": "^17.7.2" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { "optional": true - }, - "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", - "dev": true, - "optional": true, - "requires": { - "hoek": "2.16.3" - } - }, - "sshpk": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.0.tgz", - "integrity": "sha1-/yo+T9BEl1Vf7Zezmg/YL6+zozw=", - "dev": true, - "optional": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jodid25519": "1.0.2", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, - "optional": true - } - } - }, - "string_decoder": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", - "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", - "dev": true, + } + } + }, + "node_modules/jest-config": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.3.0.tgz", + "integrity": "sha512-WPMAkMAtNDY9P/oKObtsRG/6KTrhtgPJoBTmk20uDn4Uy6/3EJnnaZJre/FMT1KVRx8cve1r7/FlMIOfRVWL4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.27.4", + "@jest/get-type": "30.1.0", + "@jest/pattern": "30.0.1", + "@jest/test-sequencer": "30.3.0", + "@jest/types": "30.3.0", + "babel-jest": "30.3.0", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "deepmerge": "^4.3.1", + "glob": "^10.5.0", + "graceful-fs": "^4.2.11", + "jest-circus": "30.3.0", + "jest-docblock": "30.2.0", + "jest-environment-node": "30.3.0", + "jest-regex-util": "30.0.1", + "jest-resolve": "30.3.0", + "jest-runner": "30.3.0", + "jest-util": "30.3.0", + "jest-validate": "30.3.0", + "parse-json": "^5.2.0", + "pretty-format": "30.3.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "esbuild-register": ">=3.4.0", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { "optional": true }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, + "esbuild-register": { "optional": true }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.0.tgz", - "integrity": "sha1-I74tf2cagzk3bL2wuP4/3r8xeYQ=", - "dev": true, - "optional": true, - "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.2.9", - "rimraf": "2.6.1", - "tar": "2.2.1", - "uid-number": "0.0.6" - } - }, - "tough-cookie": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", - "dev": true, - "optional": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, + "ts-node": { "optional": true - }, - "uid-number": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", - "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", - "dev": true, + } + } + }, + "node_modules/jest-config/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-config/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/jest-config/node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-config/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/jest-config/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-config/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-diff": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.3.0.tgz", + "integrity": "sha512-n3q4PDQjS4LrKxfWB3Z5KNk1XjXtZTBwQp71OP0Jo03Z6V60x++K5L8k6ZrW8MY8pOFylZvHM0zsjS1RqlHJZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/diff-sequences": "30.3.0", + "@jest/get-type": "30.1.0", + "chalk": "^4.1.2", + "pretty-format": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "30.2.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.2.0.tgz", + "integrity": "sha512-tR/FFgZKS1CXluOQzZvNH3+0z9jXr3ldGSD8bhyuxvlVUwbeLOGynkunvlTMxchC5urrKndYiwCFC0DLVjpOCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-newline": "^3.1.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-each": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.3.0.tgz", + "integrity": "sha512-V8eMndg/aZ+3LnCJgSm13IxS5XSBM22QSZc9BtPK8Dek6pm+hfUNfwBdvsB3d342bo1q7wnSkC38zjX259qZNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/get-type": "30.1.0", + "@jest/types": "30.3.0", + "chalk": "^4.1.2", + "jest-util": "30.3.0", + "pretty-format": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-environment-jsdom": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-30.3.0.tgz", + "integrity": "sha512-RLEOJy6ip1lpw0yqJ8tB3i88FC7VBz7i00Zvl2qF71IdxjS98gC9/0SPWYIBVXHm5hgCYK0PAlSlnHGGy9RoMg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.3.0", + "@jest/environment-jsdom-abstract": "30.3.0", + "jsdom": "^26.1.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "uuid": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", - "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=", - "dev": true, + } + } + }, + "node_modules/jest-environment-node": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.3.0.tgz", + "integrity": "sha512-4i6HItw/JSiJVsC5q0hnKIe/hbYfZLVG9YJ/0pU9Hz2n/9qZe3Rhn5s5CUZA5ORZlcdT/vmAXRMyONXJwPrmYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.3.0", + "@jest/fake-timers": "30.3.0", + "@jest/types": "30.3.0", + "@types/node": "*", + "jest-mock": "30.3.0", + "jest-util": "30.3.0", + "jest-validate": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.3.0.tgz", + "integrity": "sha512-mMi2oqG4KRU0R9QEtscl87JzMXfUhbKaFqOxmjb2CKcbHcUGFrJCBWHmnTiUqi6JcnzoBlO4rWfpdl2k/RfLCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.3.0", + "@types/node": "*", + "anymatch": "^3.1.3", + "fb-watchman": "^2.0.2", + "graceful-fs": "^4.2.11", + "jest-regex-util": "30.0.1", + "jest-util": "30.3.0", + "jest-worker": "30.3.0", + "picomatch": "^4.0.3", + "walker": "^1.0.8" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.3" + } + }, + "node_modules/jest-leak-detector": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.3.0.tgz", + "integrity": "sha512-cuKmUUGIjfXZAiGJ7TbEMx0bcqNdPPI6P1V+7aF+m/FUJqFDxkFR4JqkTu8ZOiU5AaX/x0hZ20KaaIPXQzbMGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/get-type": "30.1.0", + "pretty-format": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.3.0.tgz", + "integrity": "sha512-HEtc9uFQgaUHkC7nLSlQL3Tph4Pjxt/yiPvkIrrDCt9jhoLIgxaubo1G+CFOnmHYMxHwwdaSN7mkIFs6ZK8OhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/get-type": "30.1.0", + "chalk": "^4.1.2", + "jest-diff": "30.3.0", + "pretty-format": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.3.0.tgz", + "integrity": "sha512-Z/j4Bo+4ySJ+JPJN3b2Qbl9hDq3VrXmnjjGEWD/x0BCXeOXPTV1iZYYzl2X8c1MaCOL+ewMyNBcm88sboE6YWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.3.0", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "picomatch": "^4.0.3", + "pretty-format": "30.3.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-mock": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.3.0.tgz", + "integrity": "sha512-OTzICK8CpE+t4ndhKrwlIdbM6Pn8j00lvmSmq5ejiO+KxukbLjgOflKWMn3KE34EZdQm5RqTuKj+5RIEniYhog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.3.0", + "@types/node": "*", + "jest-util": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { "optional": true - }, - "verror": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", - "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", - "dev": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - }, - "wide-align": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", - "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true } } }, - "gaze": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", - "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", + "node_modules/jest-regex-util": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.0.1.tgz", + "integrity": "sha512-jHEQgBXAgc+Gh4g0p3bCevgRCVRkB4VB70zhoAE48gxeSr1hfUOsM/C2WoJgVL7Eyg//hudYENbm3Ne+/dRVVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.3.0.tgz", + "integrity": "sha512-NRtTAHQlpd15F9rUR36jqwelbrDV/dY4vzNte3S2kxCKUJRYNd5/6nTSbYiak1VX5g8IoFF23Uj5TURkUW8O5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.3.0", + "jest-pnp-resolver": "^1.2.3", + "jest-util": "30.3.0", + "jest-validate": "30.3.0", + "slash": "^3.0.0", + "unrs-resolver": "^1.7.11" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.3.0.tgz", + "integrity": "sha512-9ev8s3YN6Hsyz9LV75XUwkCVFlwPbaFn6Wp75qnI0wzAINYWY8Fb3+6y59Rwd3QaS3kKXffHXsZMziMavfz/nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "30.0.1", + "jest-snapshot": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-runner": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.3.0.tgz", + "integrity": "sha512-gDv6C9LGKWDPLia9TSzZwf4h3kMQCqyTpq+95PODnTRDO0g9os48XIYYkS6D236vjpBir2fF63YmJFtqkS5Duw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "30.3.0", + "@jest/environment": "30.3.0", + "@jest/test-result": "30.3.0", + "@jest/transform": "30.3.0", + "@jest/types": "30.3.0", + "@types/node": "*", + "chalk": "^4.1.2", + "emittery": "^0.13.1", + "exit-x": "^0.2.2", + "graceful-fs": "^4.2.11", + "jest-docblock": "30.2.0", + "jest-environment-node": "30.3.0", + "jest-haste-map": "30.3.0", + "jest-leak-detector": "30.3.0", + "jest-message-util": "30.3.0", + "jest-resolve": "30.3.0", + "jest-runtime": "30.3.0", + "jest-util": "30.3.0", + "jest-watcher": "30.3.0", + "jest-worker": "30.3.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-runtime": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.3.0.tgz", + "integrity": "sha512-CgC+hIBJbuh78HEffkhNKcbXAytQViplcl8xupqeIWyKQF50kCQA8J7GeJCkjisC6hpnC9Muf8jV5RdtdFbGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.3.0", + "@jest/fake-timers": "30.3.0", + "@jest/globals": "30.3.0", + "@jest/source-map": "30.0.1", + "@jest/test-result": "30.3.0", + "@jest/transform": "30.3.0", + "@jest/types": "30.3.0", + "@types/node": "*", + "chalk": "^4.1.2", + "cjs-module-lexer": "^2.1.0", + "collect-v8-coverage": "^1.0.2", + "glob": "^10.5.0", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.3.0", + "jest-message-util": "30.3.0", + "jest-mock": "30.3.0", + "jest-regex-util": "30.0.1", + "jest-resolve": "30.3.0", + "jest-snapshot": "30.3.0", + "jest-util": "30.3.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-runtime/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-runtime/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/jest-runtime/node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-runtime/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/jest-runtime/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, - "requires": { - "globule": "0.1.0" + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", - "dev": true + "node_modules/jest-runtime/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "node_modules/jest-snapshot": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.3.0.tgz", + "integrity": "sha512-f14c7atpb4O2DeNhwcvS810Y63wEn8O1HqK/luJ4F6M4NjvxmAKQwBUWjbExUtMxWJQ0wVgmCKymeJK6NZMnfQ==", "dev": true, - "requires": { - "is-property": "1.0.2" + "license": "MIT", + "dependencies": { + "@babel/core": "^7.27.4", + "@babel/generator": "^7.27.5", + "@babel/plugin-syntax-jsx": "^7.27.1", + "@babel/plugin-syntax-typescript": "^7.27.1", + "@babel/types": "^7.27.3", + "@jest/expect-utils": "30.3.0", + "@jest/get-type": "30.1.0", + "@jest/snapshot-utils": "30.3.0", + "@jest/transform": "30.3.0", + "@jest/types": "30.3.0", + "babel-preset-current-node-syntax": "^1.2.0", + "chalk": "^4.1.2", + "expect": "30.3.0", + "graceful-fs": "^4.2.11", + "jest-diff": "30.3.0", + "jest-matcher-utils": "30.3.0", + "jest-message-util": "30.3.0", + "jest-util": "30.3.0", + "pretty-format": "30.3.0", + "semver": "^7.7.2", + "synckit": "^0.11.8" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true + "node_modules/jest-util": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.3.0.tgz", + "integrity": "sha512-/jZDa00a3Sz7rdyu55NLrQCIrbyIkbBxareejQI315f/i8HjYN+ZWsDLLpoQSiUIEIyZF/R8fDg3BmB8AtHttg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.3.0", + "@types/node": "*", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "graceful-fs": "^4.2.11", + "picomatch": "^4.0.3" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true + "node_modules/jest-validate": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.3.0.tgz", + "integrity": "sha512-I/xzC8h5G+SHCb2P2gWkJYrNiTbeL47KvKeW5EzplkyxzBRBw1ssSHlI/jXec0ukH2q7x2zAWQm7015iusg62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/get-type": "30.1.0", + "@jest/types": "30.3.0", + "camelcase": "^6.3.0", + "chalk": "^4.1.2", + "leven": "^3.1.0", + "pretty-format": "30.3.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "node_modules/jest-watcher": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.3.0.tgz", + "integrity": "sha512-PJ1d9ThtTR8aMiBWUdcownq9mDdLXsQzJayTk4kmaBRHKvwNQn+ANveuhEBUyNI2hR1TVhvQ8D5kHubbzBHR/w==", "dev": true, - "requires": { - "assert-plus": "1.0.0" + "license": "MIT", + "dependencies": { + "@jest/test-result": "30.3.0", + "@jest/types": "30.3.0", + "@types/node": "*", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "emittery": "^0.13.1", + "jest-util": "30.3.0", + "string-length": "^4.0.2" }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-worker": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.3.0.tgz", + "integrity": "sha512-DrCKkaQwHexjRUFTmPzs7sHQe0TSj9nvDALKGdwmK5mW9v7j90BudWirKAJHt3QQ9Dhrg1F7DogPzhChppkJpQ==", + "dev": true, + "license": "MIT", "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } + "@types/node": "*", + "@ungap/structured-clone": "^1.3.0", + "jest-util": "30.3.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.1.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "node_modules/jquery": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-4.0.0.tgz", + "integrity": "sha512-TXCHVR3Lb6TZdtw1l3RTLf8RBWVGexdxL6AC8/e0xZKEpBflBsjh9/8LXw+dkNFuOyW9B7iB3O1sP7hS0Kiacg==", + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", "dev": true, - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "2.0.1" - } - }, - "glob-stream": { - "version": "3.1.18", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", - "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", - "dev": true, - "requires": { - "glob": "4.5.3", - "glob2base": "0.0.12", - "minimatch": "2.0.10", - "ordered-read-streams": "0.1.0", - "through2": "0.6.5", - "unique-stream": "1.0.0" - }, - "dependencies": { - "glob": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "2.0.10", - "once": "1.4.0" - } - }, - "minimatch": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } + "node_modules/jsdom": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.1.0.tgz", + "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.5.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.1.1", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.1", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true } } }, - "glob-watcher": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", - "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, - "requires": { - "gaze": "0.5.2" + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" } }, - "glob2base": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", - "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-4.0.0.tgz", + "integrity": "sha512-lR4MXjGNgkJc7tkQ97kb2nuEMnNCyU//XYVH0MKTGcXEiSudQ5MKGKen3C5QubYy0vmq+JGitUg92uuywGEwIA==", "dev": true, - "requires": { - "find-index": "0.1.1" + "license": "MIT", + "engines": { + "node": "^18.17.0 || >=20.5.0" } }, - "global-modules": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", - "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", "dev": true, - "requires": { - "global-prefix": "0.1.5", - "is-windows": "0.2.0" + "license": "MIT", + "engines": { + "node": ">=6" } }, - "global-prefix": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", - "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, - "requires": { - "homedir-polyfill": "1.0.1", - "ini": "1.3.4", - "is-windows": "0.2.0", - "which": "1.2.14" + "license": "MIT", + "engines": { + "node": ">=6" } }, - "globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, - "requires": { - "array-union": "1.0.2", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "globule": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", - "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", - "dev": true, - "requires": { - "glob": "3.1.21", - "lodash": "1.0.2", - "minimatch": "0.2.14" - }, - "dependencies": { - "glob": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", - "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", - "dev": true, - "requires": { - "graceful-fs": "1.2.3", - "inherits": "1.0.2", - "minimatch": "0.2.14" - } - }, - "graceful-fs": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", - "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", - "dev": true - }, - "inherits": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", - "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", - "dev": true - }, - "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", - "dev": true, - "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" - } - } + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "glogg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz", - "integrity": "sha1-f+DxmfV6yQbPUS/urY+Q7kooT8U=", + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], "dev": true, - "requires": { - "sparkles": "1.0.0" + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "graceful-fs": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", - "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], "dev": true, - "requires": { - "natives": "1.1.0" + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true - }, - "growl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", - "dev": true - }, - "gulp": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", - "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", - "dev": true, - "requires": { - "archy": "1.0.0", - "chalk": "1.1.3", - "deprecated": "0.0.1", - "gulp-util": "3.0.8", - "interpret": "1.0.3", - "liftoff": "2.3.0", - "minimist": "1.2.0", - "orchestrator": "0.3.8", - "pretty-hrtime": "1.0.3", - "semver": "4.3.6", - "tildify": "1.2.0", - "v8flags": "2.1.1", - "vinyl-fs": "0.3.14" - } - }, - "gulp-concat": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz", - "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=", - "dev": true, - "requires": { - "concat-with-sourcemaps": "1.0.4", - "through2": "2.0.3", - "vinyl": "2.0.2" - }, - "dependencies": { - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true - }, - "vinyl": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.0.2.tgz", - "integrity": "sha1-CjcT2NTpIhxY8QyhbAEWyeJe2nw=", - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.0.0", - "is-stream": "1.1.0", - "remove-trailing-separator": "1.0.2", - "replace-ext": "1.0.0" - } - } + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "gulp-exec": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/gulp-exec/-/gulp-exec-2.1.3.tgz", - "integrity": "sha1-RgpOyN+GhB0XOLx0lYxo5XaTQtk=", + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], "dev": true, - "requires": { - "gulp-util": "3.0.8", - "gulplog": "1.0.0", - "through2": "2.0.3" + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "gulp-load-plugins": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/gulp-load-plugins/-/gulp-load-plugins-1.5.0.tgz", - "integrity": "sha1-TEGffldk2aDjMGG6uWGPgbc9QXE=", + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], "dev": true, - "requires": { - "array-unique": "0.2.1", - "fancy-log": "1.3.0", - "findup-sync": "0.4.3", - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "micromatch": "2.3.11", - "resolve": "1.3.3" + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "gulp-mocha": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/gulp-mocha/-/gulp-mocha-4.3.1.tgz", - "integrity": "sha1-d5ULQ7z/gWWVdnwHNOD9p9Fz3Nk=", + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/locate-character": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", + "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", + "dev": true, + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, - "requires": { - "dargs": "5.1.0", - "execa": "0.6.3", - "gulp-util": "3.0.8", - "mocha": "3.4.2", - "npm-run-path": "2.0.2", - "through2": "2.0.3" + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "gulp-mocha-phantomjs": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/gulp-mocha-phantomjs/-/gulp-mocha-phantomjs-0.12.1.tgz", - "integrity": "sha1-l2380A+SZN4fgvvHJm5pwae0c4Q=", + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "11.2.7", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.7.tgz", + "integrity": "sha512-aY/R+aEsRelme17KGQa/1ZSIpLpNYYrhcrepKTZgE+W3WM16YMCaPwOHLHsmopZHELU0Ojin1lPVxKR0MihncA==", "dev": true, - "requires": { - "gulp-util": "3.0.8", - "mocha-phantomjs-core": "2.1.1", - "phantomjs-prebuilt": "2.1.14", - "through2": "2.0.3" + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" } }, - "gulp-replace": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-0.6.1.tgz", - "integrity": "sha1-Eb+Mj85TPjPi9qjy9DC5VboL4GY=", + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, - "requires": { - "istextorbinary": "1.0.2", - "readable-stream": "2.3.2", - "replacestream": "4.0.2" + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.2.tgz", - "integrity": "sha1-WgTfBeT1f+Pw3Gj90R3FyXx+b00=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - } + "tmpl": "1.0.5" } }, - "gulp-sourcemaps": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-2.6.0.tgz", - "integrity": "sha1-fMzomaijv8oVk6M0jQ+/Qd0/UeU=", - "dev": true, - "requires": { - "@gulp-sourcemaps/identity-map": "1.0.1", - "@gulp-sourcemaps/map-sources": "1.0.0", - "acorn": "4.0.13", - "convert-source-map": "1.5.0", - "css": "2.2.1", - "debug-fabulous": "0.1.0", - "detect-newline": "2.1.0", - "graceful-fs": "4.1.11", - "source-map": "0.5.6", - "strip-bom-string": "1.0.0", - "through2": "2.0.3", - "vinyl": "1.2.0" + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/mrmime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "gulp-tslint": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/gulp-tslint/-/gulp-tslint-8.1.1.tgz", - "integrity": "sha1-GpBuWfrK6s2pAPO0ErD0bPsKuJ8=", + "node_modules/napi-postinstall": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz", + "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==", "dev": true, - "requires": { - "gulp-util": "3.0.8", - "map-stream": "0.0.7", - "through": "2.3.8" + "license": "MIT", + "bin": { + "napi-postinstall": "lib/cli.js" }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/napi-postinstall" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-localstorage": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-3.0.5.tgz", + "integrity": "sha512-GCwtK33iwVXboZWYcqQHu3aRvXEBwmPkAMRBLeaX86ufhqslyUkLGsi4aW3INEfdQYpUB5M9qtYf3eHvAk2VBg==", + "license": "MIT", "dependencies": { - "map-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", - "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", - "dev": true - } + "write-file-atomic": "^5.0.1" + }, + "engines": { + "node": ">=0.12" } }, - "gulp-uglify": { + "node_modules/node-releases": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz", + "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-3.0.0.tgz", - "integrity": "sha1-DfAzHXKg0wLj434QlIXd3zPG0co=", - "dev": true, - "requires": { - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "lodash": "4.17.4", - "make-error-cause": "1.2.2", - "through2": "2.0.3", - "uglify-js": "3.0.20", - "vinyl-sourcemaps-apply": "0.2.1" - }, - "dependencies": { - "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", - "dev": true - } + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "gulp-util": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", - "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", - "dev": true, - "requires": { - "array-differ": "1.0.0", - "array-uniq": "1.0.3", - "beeper": "1.1.1", - "chalk": "1.1.3", - "dateformat": "2.0.0", - "fancy-log": "1.3.0", - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "lodash._reescape": "3.0.0", - "lodash._reevaluate": "3.0.0", - "lodash._reinterpolate": "3.0.0", - "lodash.template": "3.6.2", - "minimist": "1.2.0", - "multipipe": "0.1.2", - "object-assign": "3.0.0", - "replace-ext": "0.0.1", - "through2": "2.0.3", - "vinyl": "0.5.3" - }, - "dependencies": { - "object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", - "dev": true - } + "node_modules/npm-normalize-package-bin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-4.0.0.tgz", + "integrity": "sha512-TZKxPvItzai9kN9H/TkmCtx/ZN/hvr3vUycjlfmH0ootY9yFBzNOpiXAdIn1Iteqsvk4lQn6B5PTrt+n6h8k/w==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" } }, - "gulp-wrap-umd": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/gulp-wrap-umd/-/gulp-wrap-umd-0.2.1.tgz", - "integrity": "sha1-QwZQ7vVWXpDQ3giI0GT4XKCGcxU=", + "node_modules/npm-run-all2": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-8.0.4.tgz", + "integrity": "sha512-wdbB5My48XKp2ZfJUlhnLVihzeuA1hgBnqB2J9ahV77wLS+/YAJAlN8I+X3DIFIPZ3m5L7nplmlbhNiFDmXRDA==", "dev": true, - "requires": { - "gulp-util": "2.2.20", - "lodash": "2.4.2", - "through2": "0.5.1" - }, + "license": "MIT", "dependencies": { - "ansi-regex": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", - "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=", - "dev": true - }, - "ansi-styles": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", - "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=", - "dev": true - }, - "chalk": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", - "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=", - "dev": true, - "requires": { - "ansi-styles": "1.1.0", - "escape-string-regexp": "1.0.5", - "has-ansi": "0.1.0", - "strip-ansi": "0.3.0", - "supports-color": "0.2.0" - } - }, - "dateformat": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", - "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", - "dev": true, - "requires": { - "get-stdin": "4.0.1", - "meow": "3.7.0" - } - }, - "gulp-util": { - "version": "2.2.20", - "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-2.2.20.tgz", - "integrity": "sha1-1xRuVyiRC9jwR6awseVJvCLb1kw=", - "dev": true, - "requires": { - "chalk": "0.5.1", - "dateformat": "1.0.12", - "lodash._reinterpolate": "2.4.1", - "lodash.template": "2.4.1", - "minimist": "0.2.0", - "multipipe": "0.1.2", - "through2": "0.5.1", - "vinyl": "0.2.3" - } - }, - "has-ansi": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", - "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", - "dev": true, - "requires": { - "ansi-regex": "0.2.1" - } - }, - "lodash": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", - "dev": true - }, - "lodash._reinterpolate": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz", - "integrity": "sha1-TxInqlqHEfxjL1sHofRgequLMiI=", - "dev": true - }, - "lodash.escape": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-2.4.1.tgz", - "integrity": "sha1-LOEsXghNsKV92l5dHu659dF1o7Q=", - "dev": true, - "requires": { - "lodash._escapehtmlchar": "2.4.1", - "lodash._reunescapedhtml": "2.4.1", - "lodash.keys": "2.4.1" - } - }, - "lodash.keys": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", - "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", - "dev": true, - "requires": { - "lodash._isnative": "2.4.1", - "lodash._shimkeys": "2.4.1", - "lodash.isobject": "2.4.1" - } - }, - "lodash.template": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-2.4.1.tgz", - "integrity": "sha1-nmEQB+32KRKal0qzxIuBez4c8g0=", - "dev": true, - "requires": { - "lodash._escapestringchar": "2.4.1", - "lodash._reinterpolate": "2.4.1", - "lodash.defaults": "2.4.1", - "lodash.escape": "2.4.1", - "lodash.keys": "2.4.1", - "lodash.templatesettings": "2.4.1", - "lodash.values": "2.4.1" - } - }, - "lodash.templatesettings": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz", - "integrity": "sha1-6nbHXRHrhtTb6JqDiTu4YZKaxpk=", - "dev": true, - "requires": { - "lodash._reinterpolate": "2.4.1", - "lodash.escape": "2.4.1" - } - }, - "minimist": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.0.tgz", - "integrity": "sha1-Tf/lJdriuGTGbC4jxicdev3s784=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "strip-ansi": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", - "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=", - "dev": true, - "requires": { - "ansi-regex": "0.2.1" - } - }, - "supports-color": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", - "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=", - "dev": true - }, - "through2": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", - "integrity": "sha1-390BLrnHAOIyP9M084rGIqs3Lac=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "3.0.0" - } - }, - "vinyl": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.2.3.tgz", - "integrity": "sha1-vKk4IJWC7FpJrVOKAPofEl5RMlI=", - "dev": true, - "requires": { - "clone-stats": "0.0.1" - } - }, - "xtend": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", - "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=", - "dev": true - } + "ansi-styles": "^6.2.1", + "cross-spawn": "^7.0.6", + "memorystream": "^0.3.1", + "picomatch": "^4.0.2", + "pidtree": "^0.6.0", + "read-package-json-fast": "^4.0.0", + "shell-quote": "^1.7.3", + "which": "^5.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "npm-run-all2": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": "^20.5.0 || >=22.0.0", + "npm": ">= 10" + } + }, + "node_modules/npm-run-all2/node_modules/isexe": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.5.tgz", + "integrity": "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/npm-run-all2/node_modules/which": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", + "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" } }, - "gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, - "requires": { - "glogg": "1.0.0" + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "har-validator": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "node_modules/nwsapi": { + "version": "2.2.23", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz", + "integrity": "sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==", "dev": true, - "requires": { - "chalk": "1.1.3", - "commander": "2.9.0", - "is-my-json-valid": "2.16.0", - "pinkie-promise": "2.0.1" + "license": "MIT" + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "node_modules/obug": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", + "integrity": "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==", "dev": true, - "requires": { - "ansi-regex": "2.1.1" + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT" + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } }, - "has-gulplog": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", - "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, - "requires": { - "sparkles": "1.0.0" + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "hasha": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", - "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, - "requires": { - "is-stream": "1.1.0", - "pinkie-promise": "2.0.1" + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" } }, - "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "homedir-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", - "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, - "requires": { - "parse-passwd": "1.0.0" + "license": "MIT", + "engines": { + "node": ">=6" } }, - "hosted-git-info": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", - "dev": true + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" }, - "htmlparser2": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", - "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, - "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.3.0", - "domutils": "1.5.1", - "entities": "1.0.0", - "readable-stream": "1.1.14" + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "node_modules/parse-json/node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.1" - } + "license": "MIT" }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", "dev": true, - "requires": { - "repeating": "2.0.1" + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "node_modules/parse5/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "ini": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", - "dev": true - }, - "interpret": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", - "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=", - "dev": true + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } }, - "is-absolute": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", - "integrity": "sha1-IN5p89uULvLYe5wto28XIjWxtes=", + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, - "requires": { - "is-relative": "0.2.1", - "is-windows": "0.2.0" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { + "node_modules/path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, - "requires": { - "binary-extensions": "1.8.0" + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "is-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "requires": { - "builtin-modules": "1.1.1" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", "dev": true, - "requires": { - "is-primitive": "2.0.0" + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true + "node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true, - "requires": { - "number-is-nan": "1.0.1" + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", "dev": true, - "requires": { - "is-extglob": "1.0.0" + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" } }, - "is-my-json-valid": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", - "integrity": "sha1-8Hndm/2uZe4gOKrorLyGqxCeNpM=", + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true, - "requires": { - "generate-function": "2.0.0", - "generate-object-property": "1.2.0", - "jsonpointer": "4.0.1", - "xtend": "4.0.1" + "license": "MIT", + "engines": { + "node": ">= 6" } }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, - "requires": { - "kind-of": "3.2.2" + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "is-path-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", - "dev": true - }, - "is-path-in-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", - "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, - "requires": { - "is-path-inside": "1.0.0" + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "is-path-inside": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", - "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, - "requires": { - "path-is-inside": "1.0.2" + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" } }, - "is-plain-object": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.3.tgz", - "integrity": "sha1-wVvz5LZrYtcu+vKSWEhmPsvGGbY=", + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, - "requires": { - "isobject": "3.0.0" + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", "dependencies": { - "isobject": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.0.tgz", - "integrity": "sha1-OVZSF/NmF4nooKDAgNX35rxG4aA=", - "dev": true + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/postcss": { + "version": "8.5.8", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz", + "integrity": "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" } }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", - "dev": true - }, - "is-relative": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", - "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, - "requires": { - "is-unc-path": "0.1.2" + "license": "MIT", + "engines": { + "node": ">= 0.8.0" } }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-unc-path": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", - "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", + "node_modules/prettier": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz", + "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", "dev": true, - "requires": { - "unc-path-regex": "0.1.2" + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-windows": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", - "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "node_modules/pretty-format": { + "version": "30.3.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.3.0.tgz", + "integrity": "sha512-oG4T3wCbfeuvljnyAzhBvpN45E8iOTXCU/TD3zXW80HA3dQ4ahdqMkWGiPWZvjpQwlbyHrPTWUAqUzGzv4l1JQ==", "dev": true, - "requires": { - "isarray": "1.0.0" - }, + "license": "MIT", "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } + "@jest/schemas": "30.0.5", + "ansi-styles": "^5.2.0", + "react-is": "^18.3.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istextorbinary": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-1.0.2.tgz", - "integrity": "sha1-rOGTVNGpoBc+/rEITOD4ewrX3s8=", + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "requires": { - "binaryextensions": "1.0.1", - "textextensions": "1.0.2" + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "js-tokens": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz", - "integrity": "sha1-COnxMkhKLEWjCQfp3E1VZ7fxFNc=", - "dev": true + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, - "optional": true + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "jshint": { - "version": "2.9.5", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz", - "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", - "dev": true, - "requires": { - "cli": "1.0.1", - "console-browserify": "1.1.0", - "exit": "0.1.2", - "htmlparser2": "3.8.3", - "lodash": "3.7.0", - "minimatch": "3.0.4", - "shelljs": "0.3.0", - "strip-json-comments": "1.0.4" - }, - "dependencies": { - "lodash": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.7.0.tgz", - "integrity": "sha1-Nni9irmVBXwHreg27S7wh9qBHUU=", - "dev": true + "node_modules/pure-rand": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" } + ], + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", + "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "json3": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", - "dev": true - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11" - }, - "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true, - "optional": true - } + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" } }, - "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", - "dev": true + "node_modules/react": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", + "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "jsprim": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", - "integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, + "node_modules/react-dom": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz", + "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==", + "license": "MIT", "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.4" } }, - "kew": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", - "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", - "dev": true + "node_modules/react-example": { + "resolved": "example/react", + "link": true }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true, - "requires": { - "is-buffer": "1.1.5" - } + "license": "MIT" }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "node_modules/read-package-json-fast": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-4.0.0.tgz", + "integrity": "sha512-qpt8EwugBWDw2cgE2W+/3oxC+KTez2uSVR8JU9Q36TXPAGCaozfQUs59v4j4GFpWTaw0i6hAZSvOmu1J0uOEUg==", "dev": true, - "requires": { - "graceful-fs": "4.1.11" - }, + "license": "ISC", "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true, - "optional": true - } + "json-parse-even-better-errors": "^4.0.0", + "npm-normalize-package-bin": "^4.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" } }, - "liftoff": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.3.0.tgz", - "integrity": "sha1-qY8v9nGD2Lp8+soQVIvX/wVQs4U=", - "dev": true, - "requires": { - "extend": "3.0.1", - "findup-sync": "0.4.3", - "fined": "1.1.0", - "flagged-respawn": "0.3.2", - "lodash.isplainobject": "4.0.6", - "lodash.isstring": "4.0.1", - "lodash.mapvalues": "4.6.0", - "rechoir": "0.6.2", - "resolve": "1.3.3" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" - }, - "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - } + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, - "lodash": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz", - "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=", - "dev": true - }, - "lodash._baseassign": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", "dev": true, - "requires": { - "lodash._basecopy": "3.0.1", - "lodash.keys": "3.1.2" + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true - }, - "lodash._basecreate": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", - "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", - "dev": true - }, - "lodash._basetostring": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", - "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=", - "dev": true + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "lodash._basevalues": { + "node_modules/resolve-cwd": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", - "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=", - "dev": true - }, - "lodash._escapehtmlchar": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._escapehtmlchar/-/lodash._escapehtmlchar-2.4.1.tgz", - "integrity": "sha1-32fDu2t+jh6DGrSL+geVuSr+iZ0=", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, - "requires": { - "lodash._htmlescapes": "2.4.1" + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" } }, - "lodash._escapestringchar": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._escapestringchar/-/lodash._escapestringchar-2.4.1.tgz", - "integrity": "sha1-7P4iYYoq3lC/7qQ5N+Ud9m8O23I=", - "dev": true - }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", - "dev": true - }, - "lodash._htmlescapes": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._htmlescapes/-/lodash._htmlescapes-2.4.1.tgz", - "integrity": "sha1-MtFL8IRLbeb4tioFG09nwii2JMs=", - "dev": true - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", - "dev": true - }, - "lodash._isnative": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._isnative/-/lodash._isnative-2.4.1.tgz", - "integrity": "sha1-PqZAS3hKe+g2x7V1gOHN95sUgyw=", - "dev": true - }, - "lodash._objecttypes": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz", - "integrity": "sha1-fAt/admKH3ZSn4kLDNsbTf7BHBE=", - "dev": true + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "lodash._reescape": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", - "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=", - "dev": true + "node_modules/rimraf": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", + "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "glob": "^13.0.3", + "package-json-from-dist": "^1.0.1" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, - "lodash._reevaluate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", - "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=", - "dev": true + "node_modules/rolldown": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.11.tgz", + "integrity": "sha512-NRjoKMusSjfRbSYiH3VSumlkgFe7kYAa3pzVOsVYVFY3zb5d7nS+a3KGQ7hJKXuYWbzJKPVQ9Wxq2UvyK+ENpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.122.0", + "@rolldown/pluginutils": "1.0.0-rc.11" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.0-rc.11", + "@rolldown/binding-darwin-arm64": "1.0.0-rc.11", + "@rolldown/binding-darwin-x64": "1.0.0-rc.11", + "@rolldown/binding-freebsd-x64": "1.0.0-rc.11", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.11", + "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.11", + "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.11", + "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.11", + "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.11", + "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.11", + "@rolldown/binding-linux-x64-musl": "1.0.0-rc.11", + "@rolldown/binding-openharmony-arm64": "1.0.0-rc.11", + "@rolldown/binding-wasm32-wasi": "1.0.0-rc.11", + "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.11", + "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.11" + } + }, + "node_modules/rolldown/node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.11.tgz", + "integrity": "sha512-xQO9vbwBecJRv9EUcQ/y0dzSTJgA7Q6UVN7xp6B81+tBGSLVAK03yJ9NkJaUA7JFD91kbjxRSC/mDnmvXzbHoQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true + "node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "dev": true, + "license": "MIT" }, - "lodash._reunescapedhtml": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._reunescapedhtml/-/lodash._reunescapedhtml-2.4.1.tgz", - "integrity": "sha1-dHxPxAED6zu4oJduVx96JlnpO6c=", - "dev": true, - "requires": { - "lodash._htmlescapes": "2.4.1", - "lodash.keys": "2.4.1" - }, - "dependencies": { - "lodash.keys": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", - "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", - "dev": true, - "requires": { - "lodash._isnative": "2.4.1", - "lodash._shimkeys": "2.4.1", - "lodash.isobject": "2.4.1" - } - } + "node_modules/sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" } }, - "lodash._root": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", - "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", - "dev": true + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" }, - "lodash._shimkeys": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz", - "integrity": "sha1-bpzJZm/wgfC1psl4uD4kLmlJ0gM=", + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", "dev": true, - "requires": { - "lodash._objecttypes": "2.4.1" + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" } }, - "lodash.create": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", - "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "dev": true, - "requires": { - "lodash._baseassign": "3.2.0", - "lodash._basecreate": "3.0.3", - "lodash._isiterateecall": "3.0.9" + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "lodash.defaults": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-2.4.1.tgz", - "integrity": "sha1-p+iIXwXmiFEUS24SqPNngCa8TFQ=", - "dev": true, - "requires": { - "lodash._objecttypes": "2.4.1", - "lodash.keys": "2.4.1" - }, - "dependencies": { - "lodash.keys": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", - "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", - "dev": true, - "requires": { - "lodash._isnative": "2.4.1", - "lodash._shimkeys": "2.4.1", - "lodash.isobject": "2.4.1" - } - } + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "lodash.escape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", - "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", - "dev": true, - "requires": { - "lodash._root": "3.0.1" + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "lodash.isarguments": { + "node_modules/set-cookie-parser": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", - "dev": true + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-3.1.0.tgz", + "integrity": "sha512-kjnC1DXBHcxaOaOXBHBeRtltsDG2nUiUni+jP92M9gYdW12rsmx92UsfpH7o5tDRs7I1ZZPSQJQGv3UaRfCiuw==", + "dev": true, + "license": "MIT" }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", - "dev": true + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" }, - "lodash.isobject": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", - "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, - "requires": { - "lodash._objecttypes": "2.4.1" + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", - "dev": true - }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, - "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "lodash.mapvalues": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz", - "integrity": "sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=", - "dev": true - }, - "lodash.restparam": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", - "dev": true - }, - "lodash.template": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", - "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", - "dev": true, - "requires": { - "lodash._basecopy": "3.0.1", - "lodash._basetostring": "3.0.1", - "lodash._basevalues": "3.0.0", - "lodash._isiterateecall": "3.0.9", - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0", - "lodash.keys": "3.1.2", - "lodash.restparam": "3.6.1", - "lodash.templatesettings": "3.1.1" - } - }, - "lodash.templatesettings": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", - "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0" + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "lodash.values": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-2.4.1.tgz", - "integrity": "sha1-q/UUQ2s8twUAFieXjLzzCxKA7qQ=", - "dev": true, - "requires": { - "lodash.keys": "2.4.1" - }, - "dependencies": { - "lodash.keys": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", - "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", - "dev": true, - "requires": { - "lodash._isnative": "2.4.1", - "lodash._shimkeys": "2.4.1", - "lodash.isobject": "2.4.1" - } - } + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "lolex": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-1.6.0.tgz", - "integrity": "sha1-OpoCg0UqR9dDnnJzG54H1zhuSfY=", - "dev": true - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dev": true, - "requires": { - "currently-unhandled": "0.4.1", - "signal-exit": "3.0.2" + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "lru-cache": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", - "dev": true - }, - "make-error": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.0.tgz", - "integrity": "sha1-Uq06M5zPEM5itAQLcI/nByRLi5Y=", - "dev": true - }, - "make-error-cause": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz", - "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=", - "dev": true, - "requires": { - "make-error": "1.3.0" + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", - "dev": true - }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.4.0", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.3" - } - }, - "mime-db": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", - "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=", - "dev": true - }, - "mime-types": { - "version": "2.1.15", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", - "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", - "dev": true, - "requires": { - "mime-db": "1.27.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } + "license": "ISC" }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "node_modules/sirv": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", + "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", "dev": true, - "requires": { - "minimist": "0.0.8" - }, + "license": "MIT", "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" } }, - "mocha": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.4.2.tgz", - "integrity": "sha1-0O9NMyEm2/GNDWQMmzgt1IvpdZQ=", - "dev": true, - "requires": { - "browser-stdout": "1.3.0", - "commander": "2.9.0", - "debug": "2.6.0", - "diff": "3.2.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.1", - "growl": "1.9.2", - "json3": "3.3.2", - "lodash.create": "3.1.1", - "mkdirp": "0.5.1", - "supports-color": "3.1.2" - }, - "dependencies": { - "glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "supports-color": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", - "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", - "dev": true, - "requires": { - "has-flag": "1.0.0" - } - } + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" } }, - "mocha-phantomjs-core": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/mocha-phantomjs-core/-/mocha-phantomjs-core-2.1.1.tgz", - "integrity": "sha1-g7FAC0NyCeDHEPChegSFoVUXn+I=", - "dev": true - }, - "mock-fs": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.4.1.tgz", - "integrity": "sha512-C8aapOvl77Bs18WCkejdLuX2kX8DaqaJ7ZmqUmX9U6HD2g31Pd0tZfNBAEVulmJWKyzUIyutrtxiIoNdXLAYsw==", - "dev": true + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } }, - "ms": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", - "dev": true + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } }, - "multipipe": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", - "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, - "requires": { - "duplexer2": "0.0.2" + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "nan": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz", - "integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U=", + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true, - "optional": true + "license": "BSD-3-Clause" }, - "native-promise-only": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", - "integrity": "sha1-IKMYwwy0X3H+et+/eyHJnBRy7xE=", - "dev": true + "node_modules/stack-generator": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz", + "integrity": "sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==", + "license": "MIT", + "dependencies": { + "stackframe": "^1.3.4" + } }, - "natives": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz", - "integrity": "sha1-6f+EFBimsux6SV6TmYT3jxY+bjE=", - "dev": true + "node_modules/stack-trace": { + "version": "1.0.0-pre2", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-1.0.0-pre2.tgz", + "integrity": "sha512-2ztBJRek8IVofG9DBJqdy2N5kulaacX30Nz7xmkYF6ale9WBVmIy6mFBchvGX7Vx/MyjBhx+Rcxqrj+dbOnQ6A==", + "license": "MIT", + "engines": { + "node": ">=16" + } }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "dev": true, - "requires": { - "hosted-git-info": "2.5.0", - "is-builtin-module": "1.0.0", - "semver": "4.3.6", - "validate-npm-package-license": "3.0.1" + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" } }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true, - "requires": { - "remove-trailing-separator": "1.0.2" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", "dev": true, - "requires": { - "path-key": "2.0.1" - } + "license": "MIT" }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "license": "MIT" }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true + "node_modules/stacktrace-gps": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/stacktrace-gps/-/stacktrace-gps-3.1.2.tgz", + "integrity": "sha512-GcUgbO4Jsqqg6RxfyTHFiPxdPqF+3LFmQhm7MgCuYQOYuWyqxo5pwRPz5d/u6/WYJdEnWfK4r+jGbyD8TSggXQ==", + "license": "MIT", + "dependencies": { + "source-map": "0.5.6", + "stackframe": "^1.3.4" + } }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true + "node_modules/stacktrace-gps/node_modules/source-map": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "integrity": "sha512-MjZkVp0NHr5+TPihLcadqnlVoGIoWo4IBHptutGh9wI3ttUYvCG26HkSuDi+K6lsZ25syXJXcctwgyVCt//xqA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } }, - "object.defaults": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", - "dev": true, - "requires": { - "array-each": "1.0.1", - "array-slice": "1.0.0", - "for-own": "1.0.0", - "isobject": "3.0.0" - }, - "dependencies": { - "for-own": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", - "dev": true, - "requires": { - "for-in": "1.0.2" - } - }, - "isobject": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.0.tgz", - "integrity": "sha1-OVZSF/NmF4nooKDAgNX35rxG4aA=", - "dev": true - } + "node_modules/stacktrace-js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stacktrace-js/-/stacktrace-js-2.0.2.tgz", + "integrity": "sha512-Je5vBeY4S1r/RnLydLl0TBTi3F2qdfWmYsGvtfZgEI+SCprPppaIhQf5nGcal4gI4cGpCV/duLcAzT1np6sQqg==", + "license": "MIT", + "dependencies": { + "error-stack-parser": "^2.0.6", + "stack-generator": "^2.0.5", + "stacktrace-gps": "^3.0.4" } }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" } }, - "object.pick": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.2.0.tgz", - "integrity": "sha1-tTkr7peC2m2ft9avr1OXefEjTCs=", + "node_modules/std-env": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.0.0.tgz", + "integrity": "sha512-zUMPtQ/HBY3/50VbpkupYHbRroTRZJPRLvreamgErJVys0ceuzMkD44J/QjqhHjOzK42GQ3QZIeFG1OYfOtKqQ==", "dev": true, - "requires": { - "isobject": "2.1.0" - } + "license": "MIT" }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, - "requires": { - "wrappy": "1.0.2" + "license": "MIT", + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" } }, - "orchestrator": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz", - "integrity": "sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4=", + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "requires": { - "end-of-stream": "0.1.5", - "sequencify": "0.0.7", - "stream-consume": "0.1.0" + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" } }, - "ordered-read-streams": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz", - "integrity": "sha1-/VZamvjrRHO6abbtijQ1LLVS8SY=", - "dev": true - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-map": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.1.1.tgz", - "integrity": "sha1-BfXkrpegaDcbwqXMhr+9vBnErno=", - "dev": true - }, - "parse-filepath": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.1.tgz", - "integrity": "sha1-FZ1hVdQ5BNFsEO9piRHaHpGWm3M=", + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "requires": { - "is-absolute": "0.2.6", - "map-cache": "0.2.2", - "path-root": "0.1.1" + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" } }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "requires": { - "error-ex": "1.3.1" + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "path": { - "version": "0.12.7", - "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", - "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, - "requires": { - "process": "0.11.10", - "util": "0.10.3" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, - "requires": { - "pinkie-promise": "2.0.1" + "license": "MIT", + "engines": { + "node": ">=6" } }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", - "dev": true - }, - "path-root": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", "dev": true, - "requires": { - "path-root-regex": "0.1.2" + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" } }, - "path-root-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", - "dev": true - }, - "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "requires": { - "isarray": "0.0.1" + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - }, + "license": "MIT", "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", - "dev": true - }, - "pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "node_modules/svelte": { + "version": "5.55.0", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.55.0.tgz", + "integrity": "sha512-SThllKq6TRMBwPtat7ASnm/9CDXnIhBR0NPGw0ujn2DVYx9rVwsPZxDaDQcYGdUz/3BYVsCzdq7pZarRQoGvtw==", "dev": true, - "requires": { - "through": "2.3.8" + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@sveltejs/acorn-typescript": "^1.0.5", + "@types/estree": "^1.0.5", + "@types/trusted-types": "^2.0.7", + "acorn": "^8.12.1", + "aria-query": "5.3.1", + "axobject-query": "^4.1.0", + "clsx": "^2.1.1", + "devalue": "^5.6.4", + "esm-env": "^1.2.1", + "esrap": "^2.2.2", + "is-reference": "^3.0.3", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, + "engines": { + "node": ">=18" } }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "dev": true - }, - "phantomjs-prebuilt": { - "version": "2.1.14", - "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.14.tgz", - "integrity": "sha1-1T0xH8+30dCN2yQBRVjxGIxRbaA=", - "dev": true, - "requires": { - "es6-promise": "4.0.5", - "extract-zip": "1.5.0", - "fs-extra": "1.0.0", - "hasha": "2.2.0", - "kew": "0.7.0", - "progress": "1.1.8", - "request": "2.79.0", - "request-progress": "2.0.1", - "which": "1.2.14" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "node_modules/svelte-check": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.4.5.tgz", + "integrity": "sha512-1bSwIRCvvmSHrlK52fOlZmVtUZgil43jNL/2H18pRpa+eQjzGt6e3zayxhp1S7GajPFKNM/2PMCG+DZFHlG9fw==", "dev": true, - "requires": { - "pinkie": "2.0.4" + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "chokidar": "^4.0.1", + "fdir": "^6.2.0", + "picocolors": "^1.0.0", + "sade": "^1.7.4" + }, + "bin": { + "svelte-check": "bin/svelte-check" + }, + "engines": { + "node": ">= 18.0.0" + }, + "peerDependencies": { + "svelte": "^4.0.0 || ^5.0.0-next.0", + "typescript": ">=5.0.0" } }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "progress": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "qs": { - "version": "6.3.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", - "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", - "dev": true - }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.5" - } - } - } + "node_modules/svelte-kit": { + "resolved": "example/svelte-kit", + "link": true }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "node_modules/svelte/node_modules/aria-query": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz", + "integrity": "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==", "dev": true, - "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" } }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true, - "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" - } + "license": "MIT" }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "node_modules/synckit": { + "version": "0.11.12", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.12.tgz", + "integrity": "sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ==", "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.2.9" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" } }, - "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "minimatch": "3.0.4", - "readable-stream": "2.3.2", - "set-immediate-shim": "1.0.1" - }, + "license": "ISC", "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.2.tgz", - "integrity": "sha1-WgTfBeT1f+Pw3Gj90R3FyXx+b00=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - } + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" } }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "node_modules/test-exclude/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true, - "requires": { - "resolve": "1.3.3" - } + "license": "MIT" }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, - "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "regex-cache": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", - "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, - "requires": { - "is-equal-shallow": "0.1.3", - "is-primitive": "2.0.0" + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "remove-trailing-separator": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", - "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=", - "dev": true - }, - "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", - "dev": true + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "node_modules/tinyexec": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.4.tgz", + "integrity": "sha512-u9r3uZC0bdpGOXtlxUIdwf9pkmvhqJdrVCH9fapQtgy/OeTTMZ1nqH7agtvEfmGui6e1XxjcdrlxvxJvc3sMqw==", "dev": true, - "requires": { - "is-finite": "1.0.2" + "license": "MIT", + "engines": { + "node": ">=18" } }, - "replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", - "dev": true - }, - "replacestream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/replacestream/-/replacestream-4.0.2.tgz", - "integrity": "sha1-DEFAcH5PAyP1DeBEhRcIz1i8N70=", + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", "dev": true, - "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1", - "readable-stream": "2.3.2" - }, + "license": "MIT", "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.2.tgz", - "integrity": "sha1-WgTfBeT1f+Pw3Gj90R3FyXx+b00=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - } + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" } }, - "request": { - "version": "2.79.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", - "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", - "dev": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.11.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "2.0.6", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "qs": "6.3.2", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.4.3", - "uuid": "3.1.0" - } - }, - "request-progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", - "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", + "node_modules/tinyrainbow": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz", + "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", "dev": true, - "requires": { - "throttleit": "1.0.0" + "license": "MIT", + "engines": { + "node": ">=14.0.0" } }, - "requirejs": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.3.tgz", - "integrity": "sha1-qln9OgKH6vQHlZoTgigES13WpqM=", - "dev": true - }, - "resolve": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz", - "integrity": "sha1-ZVkHw0aahoDcLeOidaj91paR8OU=", + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", "dev": true, - "requires": { - "path-parse": "1.0.5" + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" } }, - "resolve-dir": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", - "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", "dev": true, - "requires": { - "expand-tilde": "1.2.2", - "global-modules": "0.2.3" - } + "license": "MIT" }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true, + "license": "BSD-3-Clause" }, - "rewire": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/rewire/-/rewire-2.5.2.tgz", - "integrity": "sha1-ZCfee3/u+n02QBUH62SlOFvFjcc=", - "dev": true + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } }, - "rimraf": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", - "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", "dev": true, - "requires": { - "glob": "7.1.2" + "license": "MIT", + "engines": { + "node": ">=6" } }, - "run-sequence": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/run-sequence/-/run-sequence-1.2.2.tgz", - "integrity": "sha1-UJWgvr6YczsBQL0I3YDsAw3azes=", + "node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", "dev": true, - "requires": { - "chalk": "1.1.3", - "gulp-util": "3.0.8" + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" } }, - "safe-buffer": { + "node_modules/tr46": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } }, - "samsam": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.2.1.tgz", - "integrity": "sha1-7dOQk6MYQ3DLhZJDsr3yVefY6mc=", - "dev": true - }, - "semver": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", - "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", - "dev": true - }, - "sequencify": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/sequencify/-/sequencify-0.0.7.tgz", - "integrity": "sha1-kM/xnQLgcCf9dn9erT57ldHnOAw=", - "dev": true - }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "node_modules/ts-jest": { + "version": "29.4.6", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.6.tgz", + "integrity": "sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==", "dev": true, - "requires": { - "shebang-regex": "1.0.0" + "license": "MIT", + "dependencies": { + "bs-logger": "^0.2.6", + "fast-json-stable-stringify": "^2.1.0", + "handlebars": "^4.7.8", + "json5": "^2.2.3", + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.7.3", + "type-fest": "^4.41.0", + "yargs-parser": "^21.1.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0 || ^30.0.0", + "@jest/types": "^29.0.0 || ^30.0.0", + "babel-jest": "^29.0.0 || ^30.0.0", + "jest": "^29.0.0 || ^30.0.0", + "jest-util": "^29.0.0 || ^30.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/transform": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jest-util": { + "optional": true + } } }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "shelljs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", - "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", - "dev": true - }, - "sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "sinon": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-2.3.6.tgz", - "integrity": "sha1-lTeOfg+XapcS6bRZH/WznnPcPd4=", - "dev": true, - "requires": { - "diff": "3.2.0", - "formatio": "1.2.0", - "lolex": "1.6.0", - "native-promise-only": "0.8.1", - "path-to-regexp": "1.7.0", - "samsam": "1.2.1", - "text-encoding": "0.6.4", - "type-detect": "4.0.3" - } - }, - "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "node_modules/ts-jest/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "dev": true, - "requires": { - "hoek": "2.16.3" + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "source-map": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", - "dev": true + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true }, - "source-map-resolve": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.3.1.tgz", - "integrity": "sha1-YQ9hIqRFuN1RU1oqcbeD38Ekh2E=", + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, - "requires": { - "atob": "1.1.3", - "resolve-url": "0.2.1", - "source-map-url": "0.3.0", - "urix": "0.1.0" + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" } }, - "source-map-support": { - "version": "0.4.15", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.15.tgz", - "integrity": "sha1-AyAt9lwG0r2MfsI2KhkwVv7407E=", + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, - "requires": { - "source-map": "0.5.6" + "license": "MIT", + "engines": { + "node": ">=4" } }, - "source-map-url": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.3.0.tgz", - "integrity": "sha1-fsrxO1e80J2opAxdJp2zN5nUqvk=", - "dev": true - }, - "sparkles": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", - "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", - "dev": true - }, - "spdx-correct": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", - "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, - "requires": { - "spdx-license-ids": "1.2.2" + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "spdx-expression-parse": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", - "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", - "dev": true - }, - "spdx-license-ids": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", - "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", - "dev": true - }, - "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", - "dev": true, - "requires": { - "through": "2.3.8" - } - }, - "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", - "dev": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" } }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" - }, - "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "node_modules/typescript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.2.tgz", + "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==", "dev": true, - "requires": { - "duplexer": "0.1.1" + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" } }, - "stream-consume": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.0.tgz", - "integrity": "sha1-pB6tGm1ggc63n2WwYZAbbY89HQ8=", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "node_modules/typescript-eslint": { + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.57.2.tgz", + "integrity": "sha512-VEPQ0iPgWO/sBaZOU1xo4nuNdODVOajPnTIbog2GKYr31nIlZ0fWPoCQgGfF3ETyBl1vn63F/p50Um9Z4J8O8A==", "dev": true, - "requires": { - "ansi-regex": "2.1.1" + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.57.2", + "@typescript-eslint/parser": "8.57.2", + "@typescript-eslint/typescript-estree": "8.57.2", + "@typescript-eslint/utils": "8.57.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, - "strip-bom": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz", - "integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=", + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", "dev": true, - "requires": { - "first-chunk-stream": "1.0.0", - "is-utf8": "0.2.1" + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" } }, - "strip-bom-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=", - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", "dev": true, - "requires": { - "get-stdin": "4.0.1" - } + "license": "MIT" }, - "strip-json-comments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", - "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", - "dev": true - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "systemjs": { - "version": "0.20.14", - "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-0.20.14.tgz", - "integrity": "sha512-emxZNtgvuJgdTS5dWvq6kgbeY8aDunNTasMWCu6JTxlfS4nSyJ6++YdN07fdoMFpSExOXvcdneFuwLC5LhXGng==", - "dev": true - }, - "text-encoding": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", - "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", - "dev": true - }, - "textextensions": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-1.0.2.tgz", - "integrity": "sha1-ZUhjk+4fK7A5pgy7oFsLaL2VAdI=", - "dev": true - }, - "throttleit": { + "node_modules/unpipe": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", - "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "node_modules/unrs-resolver": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.11.1.tgz", + "integrity": "sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==", "dev": true, - "requires": { - "readable-stream": "2.3.2", - "xtend": "4.0.1" - }, + "hasInstallScript": true, + "license": "MIT", "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.2.tgz", - "integrity": "sha1-WgTfBeT1f+Pw3Gj90R3FyXx+b00=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } + "napi-postinstall": "^0.3.0" + }, + "funding": { + "url": "https://opencollective.com/unrs-resolver" + }, + "optionalDependencies": { + "@unrs/resolver-binding-android-arm-eabi": "1.11.1", + "@unrs/resolver-binding-android-arm64": "1.11.1", + "@unrs/resolver-binding-darwin-arm64": "1.11.1", + "@unrs/resolver-binding-darwin-x64": "1.11.1", + "@unrs/resolver-binding-freebsd-x64": "1.11.1", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.11.1", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.11.1", + "@unrs/resolver-binding-linux-arm64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-arm64-musl": "1.11.1", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-riscv64-musl": "1.11.1", + "@unrs/resolver-binding-linux-s390x-gnu": "1.11.1", + "@unrs/resolver-binding-linux-x64-gnu": "1.11.1", + "@unrs/resolver-binding-linux-x64-musl": "1.11.1", + "@unrs/resolver-binding-wasm32-wasi": "1.11.1", + "@unrs/resolver-binding-win32-arm64-msvc": "1.11.1", + "@unrs/resolver-binding-win32-ia32-msvc": "1.11.1", + "@unrs/resolver-binding-win32-x64-msvc": "1.11.1" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" } }, - "tildify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", - "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, - "requires": { - "os-homedir": "1.0.2" + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" } }, - "time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", - "dev": true - }, - "tough-cookie": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, - "requires": { - "punycode": "1.4.1" + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" } }, - "tracekit": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/tracekit/-/tracekit-0.4.5.tgz", - "integrity": "sha512-LAb1udnpvhpgcx6/gmv7s6RO5lBwQGgAT/1VW0egSNSMvH/3xU3xKLoJ3pc+nkJ5AMv9qgTBnCkrUzbrHmCLpg==", - "dev": true + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", - "dev": true - }, - "tslib": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.7.1.tgz", - "integrity": "sha1-vIAEFkaRkjp5/oN4u+s9ogF1OOw=", - "dev": true - }, - "tslint": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.4.3.tgz", - "integrity": "sha1-dhyEArgONHt3M6BDkKdXslNYBGc=", - "dev": true, - "requires": { - "babel-code-frame": "6.22.0", - "colors": "1.1.2", - "commander": "2.9.0", - "diff": "3.2.0", - "glob": "7.1.2", - "minimatch": "3.0.4", - "resolve": "1.3.3", - "semver": "5.3.0", - "tslib": "1.7.1", - "tsutils": "2.4.0" - }, - "dependencies": { - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "dev": true + "node_modules/vite": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.2.tgz", + "integrity": "sha512-1gFhNi+bHhRE/qKZOJXACm6tX4bA3Isy9KuKF15AgSRuRazNBOJfdDemPBU16/mpMxApDPrWvZ08DcLPEoRnuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.8", + "rolldown": "1.0.0-rc.11", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.0", + "esbuild": "^0.27.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true } } }, - "tsproject": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/tsproject/-/tsproject-2.1.2.tgz", - "integrity": "sha1-DkAXBBBdcFF4iCrEyWaNke7ns7E=", - "dev": true, - "requires": { - "@types/chalk": "0.4.31", - "@types/chokidar": "1.6.0", - "@types/glob": "5.0.30", - "@types/lodash": "4.14.63", - "@types/node": "7.0.14", - "@types/vinyl": "1.2.30", - "chalk": "1.1.3", - "chokidar": "1.7.0", - "glob": "7.1.2", - "lodash": "4.17.4", - "readable-stream": "2.3.2", - "typescript": "2.3.4", - "vinyl": "2.0.2" + "node_modules/vitefu": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.2.tgz", + "integrity": "sha512-zpKATdUbzbsycPFBN71nS2uzBUQiVnFoOrr2rvqv34S1lcAgMKKkjWleLGeiJlZ8lwCXvtWaRn7R3ZC16SYRuw==", + "dev": true, + "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*", + "tests/projects/workspace/packages/*" + ], + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-beta.0" }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.1.tgz", + "integrity": "sha512-yF+o4POL41rpAzj5KVILUxm1GCjKnELvaqmU9TLLUbMfDzuN0UpUR9uaDs+mCtjPe+uYPksXDRLQGGPvj1cTmA==", + "dev": true, + "license": "MIT", "dependencies": { + "@vitest/expect": "4.1.1", + "@vitest/mocker": "4.1.1", + "@vitest/pretty-format": "4.1.1", + "@vitest/runner": "4.1.1", + "@vitest/snapshot": "4.1.1", + "@vitest/spy": "4.1.1", + "@vitest/utils": "4.1.1", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.0.3", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.1", + "@vitest/browser-preview": "4.1.1", + "@vitest/browser-webdriverio": "4.1.1", + "@vitest/ui": "4.1.1", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, "@types/node": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.14.tgz", - "integrity": "sha1-FHD6ACoRMxasnZrRY/xzjHoN4qQ=", - "dev": true + "optional": true }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true + "@vitest/browser-playwright": { + "optional": true }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "@vitest/browser-preview": { + "optional": true }, - "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", - "dev": true + "@vitest/browser-webdriverio": { + "optional": true }, - "readable-stream": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.2.tgz", - "integrity": "sha1-WgTfBeT1f+Pw3Gj90R3FyXx+b00=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } + "@vitest/ui": { + "optional": true }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true + "happy-dom": { + "optional": true }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } + "jsdom": { + "optional": true }, + "vite": { + "optional": false + } + } + }, + "node_modules/vue": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.30.tgz", + "integrity": "sha512-hTHLc6VNZyzzEH/l7PFGjpcTvUgiaPK5mdLkbjrTeWSRcEfxFrv56g/XckIYlE9ckuobsdwqd5mk2g1sBkMewg==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.30", + "@vue/compiler-sfc": "3.5.30", + "@vue/runtime-dom": "3.5.30", + "@vue/server-renderer": "3.5.30", + "@vue/shared": "3.5.30" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { "typescript": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.3.4.tgz", - "integrity": "sha1-PTgyGCgjHkNPKHUUlZw3qCtin0I=", - "dev": true - }, - "vinyl": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.0.2.tgz", - "integrity": "sha1-CjcT2NTpIhxY8QyhbAEWyeJe2nw=", - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.0.0", - "is-stream": "1.1.0", - "remove-trailing-separator": "1.0.2", - "replace-ext": "1.0.0" - } + "optional": true } } }, - "tsutils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.4.0.tgz", - "integrity": "sha1-rUzm26Dlo+2934Ymt8oEB4IYn+o=", - "dev": true + "node_modules/vue-example": { + "resolved": "example/vue", + "link": true }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", - "dev": true + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, - "optional": true + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } }, - "type-detect": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.3.tgz", - "integrity": "sha1-Dj8mcLRAmbC0bChNE2p+9Jx0wuo=", - "dev": true + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } }, - "typescript": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.4.1.tgz", - "integrity": "sha1-w8yxbdqgsjFN4DHn5v7onlujRrw=", - "dev": true + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } }, - "typescript-formatter": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typescript-formatter/-/typescript-formatter-5.2.0.tgz", - "integrity": "sha1-zUUpT3TEzIgPSPgZg6IfsmT28XM=", + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "requires": { - "commandpost": "1.1.0", - "editorconfig": "0.13.2" + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, - "uglify-js": { - "version": "3.0.20", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.0.20.tgz", - "integrity": "sha512-O/c2/N97k1Ms+23VRx6gIAfGdijuW53SlASmXy0FVapK63rQrduHyE+5X6hUtqNiSLLao9Uv6ijotpNe8t991Q==", + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dev": true, - "requires": { - "commander": "2.9.0", - "source-map": "0.5.6" + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" } }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "unique-stream": { + "node_modules/wordwrap": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz", - "integrity": "sha1-1ZpKdUJ0R9mqbJHnAmP40mpLEEs=", - "dev": true + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true, + "license": "MIT" }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } }, - "user-home": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", - "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", - "dev": true + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "requires": { - "inherits": "2.0.1" + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - } + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "util-deprecate": { + "node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" }, - "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", - "dev": true + "node_modules/write-file-atomic": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, - "v8flags": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", - "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ws": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz", + "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==", "dev": true, - "requires": { - "user-home": "1.1.1" + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, - "validate-npm-package-license": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", - "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", "dev": true, - "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.4" + "license": "Apache-2.0", + "engines": { + "node": ">=18" } }, - "verror": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", - "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true, - "requires": { - "extsprintf": "1.0.2" + "license": "MIT" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" } }, - "vinyl": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", - "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - }, - "vinyl-fs": { - "version": "0.3.14", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", - "integrity": "sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY=", - "dev": true, - "requires": { - "defaults": "1.0.3", - "glob-stream": "3.1.18", - "glob-watcher": "0.0.6", - "graceful-fs": "3.0.11", - "mkdirp": "0.5.1", - "strip-bom": "1.0.0", - "through2": "0.6.5", - "vinyl": "0.4.6" - }, - "dependencies": { - "clone": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", - "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - }, - "vinyl": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", - "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", - "dev": true, - "requires": { - "clone": "0.2.0", - "clone-stats": "0.0.1" - } - } + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" } }, - "vinyl-sourcemaps-apply": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", - "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, - "requires": { - "source-map": "0.5.6" + "license": "ISC", + "engines": { + "node": ">=12" } }, - "which": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", - "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "requires": { - "isexe": "2.0.0" + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "node_modules/zimmerframe": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz", + "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==", + "dev": true, + "license": "MIT" }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true + "packages/angularjs": { + "name": "@exceptionless/angularjs", + "version": "3.0.0-dev", + "license": "Apache-2.0", + "dependencies": { + "@exceptionless/browser": "3.0.0-dev" + }, + "devDependencies": { + "@types/angular": "^1.8.9", + "esbuild": "^0.27.4" + } }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true + "packages/browser": { + "name": "@exceptionless/browser", + "version": "3.0.0-dev", + "license": "Apache-2.0", + "dependencies": { + "@exceptionless/core": "3.0.0-dev", + "stacktrace-js": "^2.0.2" + }, + "devDependencies": { + "@jest/globals": "^30.3.0", + "esbuild": "^0.27.4", + "jest": "^30.3.0", + "jest-environment-jsdom": "^30.3.0", + "ts-jest": "^29.4.6" + } + }, + "packages/core": { + "name": "@exceptionless/core", + "version": "3.0.0-dev", + "license": "Apache-2.0", + "devDependencies": { + "@jest/globals": "^30.3.0", + "esbuild": "^0.27.4", + "jest": "^30.3.0", + "jest-environment-jsdom": "^30.3.0", + "ts-jest": "^29.4.6" + } + }, + "packages/node": { + "name": "@exceptionless/node", + "version": "3.0.0-dev", + "license": "Apache-2.0", + "dependencies": { + "@exceptionless/core": "3.0.0-dev", + "node-localstorage": "^3.0.5", + "stack-trace": "^1.0.0-pre2" + }, + "devDependencies": { + "@jest/globals": "^30.3.0", + "@types/node": "^25.5.0", + "@types/node-localstorage": "^1.3.3", + "@types/stack-trace": "^0.0.33", + "esbuild": "^0.27.4", + "jest": "^30.3.0", + "ts-jest": "^29.4.6" + }, + "engines": { + "node": ">=18" + } }, - "yauzl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", - "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", - "dev": true, - "requires": { - "fd-slicer": "1.0.1" + "packages/react": { + "name": "@exceptionless/react", + "version": "3.0.0-dev", + "license": "Apache-2.0", + "dependencies": { + "@exceptionless/browser": "3.0.0-dev" + }, + "devDependencies": { + "@jest/globals": "^30.3.0", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "esbuild": "^0.27.4", + "jest": "^30.3.0", + "ts-jest": "^29.4.6" + } + }, + "packages/vue": { + "name": "@exceptionless/vue", + "version": "3.0.0-dev", + "license": "Apache-2.0", + "dependencies": { + "@exceptionless/browser": "3.0.0-dev" + }, + "devDependencies": { + "esbuild": "^0.27.4" } } } diff --git a/package.json b/package.json index 54e97cdc..781965ba 100644 --- a/package.json +++ b/package.json @@ -1,77 +1,51 @@ { - "name": "exceptionless", - "version": "1.5.4", - "description": "JavaScript client for Exceptionless", + "name": "@exceptionless/monorepo", + "private": true, + "version": "3.0.0-dev", "license": "Apache-2.0", - "browser": "dist/exceptionless.js", - "browserify": "dist/exceptionless.universal.js", - "webpack": "dist/exceptionless.universal.js", - "main": "dist/exceptionless.node.js", - "jspm": { - "main": "dist/exceptionless.js" + "jest": { + "moduleFileExtensions": [ + "js", + "ts" + ], + "moduleNameMapper": { + "^@exceptionless/(.*)$": "/packages/$1/src" + }, + "preset": "ts-jest", + "resolver": "jest-ts-webcompat-resolver" }, - "typings": "dist/exceptionless.d.ts", "scripts": { - "start": "gulp", - "build": "gulp build", - "test": "gulp test" + "clean": "rimraf -g packages/*/dist example/*/dist", + "build": "npm run build --workspaces --if-present", + "watch": "npm run watch --workspaces --if-present", + "lint": "run-s -c lint:eslint lint:prettier", + "lint:eslint": "eslint .", + "lint:prettier": "prettier --check .", + "lint:fix": "eslint . --fix", + "format": "prettier --write .", + "test": "npm test --workspaces --if-present", + "version": "npm --no-git-tag-version --workspaces=true version", + "upgrade": "ncu -i", + "upgrade:workspaces": "ncu -i --workspaces" }, - "keywords": [ - "exceptionless", - "error", - "feature", - "logging", - "tracking", - "reporting" + "workspaces": [ + "packages/core", + "packages/browser", + "packages/angularjs", + "packages/node", + "packages/react", + "packages/vue", + "example/*" ], - "repository": { - "url": "git://github.com/exceptionless/Exceptionless.JavaScript.git", - "type": "git" - }, "devDependencies": { - "@types/angular": "1.6.25", - "@types/angular-mocks": "1.5.10", - "@types/assertion-error": "1.0.30", - "@types/chai": "4.0.1", - "@types/jquery": "3.2.5", - "@types/mocha": "2.2.41", - "@types/mock-fs": "3.6.30", - "@types/node": "8.0.6", - "@types/sinon": "2.3.2", - "@types/stack-trace": "0.0.28", - "chai": "4.0.2", - "del": "3.0.0", - "es5-shim": "4.5.9", - "es6-shim": "0.35.3", - "event-stream": "3.3.4", - "gulp": "3.9.1", - "gulp-concat": "2.6.1", - "gulp-exec": "2.1.3", - "gulp-load-plugins": "1.5.0", - "gulp-mocha": "4.3.1", - "gulp-mocha-phantomjs": "0.12.1", - "gulp-replace": "0.6.1", - "gulp-sourcemaps": "2.6.0", - "gulp-tslint": "8.1.1", - "gulp-uglify": "3.0.0", - "gulp-wrap-umd": "0.2.1", - "jshint": "2.9.5", - "mock-fs": "4.4.1", - "path": "0.12.7", - "requirejs": "2.3.3", - "rewire": "2.5.2", - "rimraf": "2.6.1", - "run-sequence": "1.2.2", - "sinon": "2.3.6", - "source-map-support": "0.4.15", - "systemjs": "0.20.14", - "tracekit": "0.4.5", - "tslint": "5.4.3", - "tsproject": "2.1.2", - "typescript": "2.4.1", - "typescript-formatter": "5.2.0" - }, - "dependencies": { - "stack-trace": "0.0.10" + "@eslint/js": "^10.0.1", + "eslint": "^10.1.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-jest": "^29.15.0", + "npm-run-all2": "^8.0.4", + "prettier": "^3.8.1", + "rimraf": "^6.1.3", + "typescript": "^6.0.2", + "typescript-eslint": "^8.57.2" } } diff --git a/packages/angularjs/LICENSE b/packages/angularjs/LICENSE new file mode 100644 index 00000000..e06d2081 --- /dev/null +++ b/packages/angularjs/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/packages/angularjs/README.md b/packages/angularjs/README.md new file mode 100644 index 00000000..eda1878d --- /dev/null +++ b/packages/angularjs/README.md @@ -0,0 +1,63 @@ +# Exceptionless AngularJS + +This package provides native JavaScript support for AngularJS applications. + +## Getting Started + +To use this package, your must be using ES6 and support ESM modules. + +## Installation + +You can install Exceptionless either in your browser application using a `script` +tag, or you can use the Node Package Manager (npm) to install the package. + +### CDN + +Add the following script tag at the very beginning of your page: + +```html + +``` + +### npm + +1. Install the package by running `npm install @exceptionless/angularjs --save`. +2. Add the following script tag at the very beginning of your page: + +```html + +``` + +## Configuration + +1. Import `exceptionless` angular module like this: `angular.module("app", ["exceptionless"])` +2. Inject `$ExceptionlessClient` and call startup during app startup. + +```js +angular + .module("app", ["exceptionless"]) + .config(function ($ExceptionlessClient) { + await $ExceptionlessClient.startup((c) => { + c.apiKey = "API_KEY_HERE"; + + c.defaultTags.push("Example", "JavaScript", "angularjs"); + }); + }); +``` + +Once that's done, you can use the Exceptionless client anywhere in your app by +importing `$ExceptionlessClient` followed by the method you want to use. For example: + +```js +await $ExceptionlessClient.submitLog("Hello world!"); +``` + +Please see the [docs](https://exceptionless.com/docs/clients/javascript/) for +more information on configuring the client. + +## Support + +If you need help, please contact us via in-app support, +[open an issue](https://github.com/exceptionless/Exceptionless.JavaScript/issues/new) +or [join our chat on Discord](https://discord.gg/6HxgFCx). We’re always here to +help if you have any questions! diff --git a/packages/angularjs/package.json b/packages/angularjs/package.json new file mode 100644 index 00000000..df42fbf2 --- /dev/null +++ b/packages/angularjs/package.json @@ -0,0 +1,50 @@ +{ + "name": "@exceptionless/angularjs", + "version": "3.0.0-dev", + "description": "JavaScript client for Exceptionless", + "author": { + "name": "exceptionless", + "url": "https://exceptionless.com" + }, + "keywords": [ + "exceptionless", + "error", + "feature", + "logging", + "tracking", + "reporting", + "angularjs" + ], + "repository": { + "url": "git://github.com/exceptionless/Exceptionless.JavaScript.git", + "type": "git" + }, + "bugs": { + "url": "https://github.com/exceptionless/Exceptionless.JavaScript/issues" + }, + "license": "Apache-2.0", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "unpkg": "dist/index.bundle.min.js", + "jsdelivr": "dist/index.bundle.min.js", + "exports": { + ".": "./dist/index.js", + "./package.json": "./package.json" + }, + "scripts": { + "build": "tsc -p tsconfig.json && esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --outfile=dist/index.bundle.js && esbuild src/index.ts --bundle --minify --sourcemap --target=es2022 --format=esm --outfile=dist/index.bundle.min.js", + "watch": "tsc -p ../core/tsconfig.json -w --preserveWatchOutput & tsc -p tsconfig.json -w --preserveWatchOutput & esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --watch --outfile=dist/index.bundle.js" + }, + "sideEffects": false, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@types/angular": "^1.8.9", + "esbuild": "^0.27.4" + }, + "dependencies": { + "@exceptionless/browser": "3.0.0-dev" + } +} diff --git a/packages/angularjs/src/index.ts b/packages/angularjs/src/index.ts new file mode 100644 index 00000000..a46bf6a4 --- /dev/null +++ b/packages/angularjs/src/index.ts @@ -0,0 +1,149 @@ +import { BrowserExceptionlessClient, Exceptionless, toError } from "@exceptionless/browser"; + +declare let angular; +angular + .module("exceptionless", []) + .constant("$ExceptionlessClient", Exceptionless) + .factory("exceptionlessHttpInterceptor", [ + "$location", + "$q", + "$ExceptionlessClient", + ($location: ng.ILocationService, $q: ng.IQService, $ExceptionlessClient: BrowserExceptionlessClient) => { + return { + responseError: function responseError(response: ng.IHttpResponse<{ Message?: string }>) { + if (response.status === 404) { + void $ExceptionlessClient.submitNotFound(response.config.url); + } else if (response.status !== 401) { + const message = `[${response.status}] ${response.data?.Message ?? response.config.url}`; + void $ExceptionlessClient + .createUnhandledException(new Error(message), "errorHttpInterceptor") + .setSource(response.config.url) + .setProperty("response", response) + .setProperty("referrer", $location.absUrl()) + .submit(); + } + return $q.reject(response); + } + }; + } + ]) + .config([ + "$httpProvider", + "$provide", + "$ExceptionlessClient", + ($httpProvider: ng.IHttpProvider, $provide: ng.IModule, $ExceptionlessClient: BrowserExceptionlessClient) => { + $httpProvider.interceptors.push("exceptionlessHttpInterceptor"); + $provide.decorator("$exceptionHandler", [ + "$delegate", + ($delegate: (ex: Error, cause: string) => void) => { + return (exception: Error, cause: string) => { + $delegate(exception, cause); + void $ExceptionlessClient.createUnhandledException(exception, "$exceptionHandler").setMessage(cause).submit(); + }; + } + ]); + $provide.decorator("$log", [ + "$delegate", + ($delegate) => { + function decorateRegularCall(property: string, logLevel: string) { + const previousFn = $delegate[property]; + return ($delegate[property] = (...args: string[]) => { + if ((angular as { mock?: unknown }).mock) { + $delegate[property].logs = []; + } + + // eslint-disable-next-line prefer-spread + previousFn.apply(null, args); + if (args[0] && args[0].length > 0) { + void $ExceptionlessClient.submitLog(undefined, args[0], logLevel); + } + }); + } + + $delegate.log = decorateRegularCall("log", "Trace"); + $delegate.info = decorateRegularCall("info", "Info"); + $delegate.warn = decorateRegularCall("warn", "Warn"); + $delegate.debug = decorateRegularCall("debug", "Debug"); + $delegate.error = decorateRegularCall("error", "Error"); + return $delegate; + } + ]); + } + ]) + .run([ + "$rootScope", + "$ExceptionlessClient", + ($rootScope: ng.IRootScopeService, $ExceptionlessClient: BrowserExceptionlessClient) => { + $rootScope.$on("$routeChangeSuccess", (_event, next, current) => { + if (!current) { + return; + } + + void $ExceptionlessClient + .createFeatureUsage(current.name as string) + .setProperty("next", next) + .setProperty("current", current) + .submit(); + }); + + $rootScope.$on("$routeChangeError", (_event, current, previous, rejection) => { + const error: Error = toError(rejection, "Route Change Error"); + void $ExceptionlessClient + .createUnhandledException(error, "$routeChangeError") + .setProperty("current", current) + .setProperty("previous", previous) + .submit(); + }); + + $rootScope.$on("$stateChangeSuccess", (_event, toState, toParams, fromState, fromParams) => { + if (!toState || toState.name === "otherwise") { + return; + } + + void $ExceptionlessClient + .createFeatureUsage((toState.controller || toState.name) as string) + .setProperty("toState", toState) + .setProperty("toParams", toParams) + .setProperty("fromState", fromState) + .setProperty("fromParams", fromParams) + .submit(); + }); + + $rootScope.$on("$stateNotFound", (_event, unfoundState, fromState, fromParams) => { + if (!unfoundState) { + return; + } + + void $ExceptionlessClient + .createNotFound(unfoundState.to as string) + .setProperty("unfoundState", unfoundState) + .setProperty("fromState", fromState) + .setProperty("fromParams", fromParams) + .submit(); + }); + + const stateChangeError = "$stateChangeError"; + $rootScope.$on(stateChangeError, (_event, toState, toParams, fromState, fromParams, error) => { + if (!error) { + return; + } + + const builder = + error && error.status === 404 + ? $ExceptionlessClient.createNotFound(error.config.url as string) + : $ExceptionlessClient.createUnhandledException(error as Error, stateChangeError); + void builder + .setSource(stateChangeError) + .setMessage(error?.statusText as string) + .setProperty("toState", toState) + .setProperty("toParams", toParams) + .setProperty("fromState", fromState) + .setProperty("fromParams", fromParams) + .submit(); + }); + + $rootScope.$on("$destroy", () => { + void $ExceptionlessClient.config.services.queue.process(); + }); + } + ]); diff --git a/packages/angularjs/tsconfig.json b/packages/angularjs/tsconfig.json new file mode 100644 index 00000000..0755c069 --- /dev/null +++ b/packages/angularjs/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "noImplicitAny": false, + "outDir": "dist", + "rootDir": "src", + "strict": false, + "strictNullChecks": true, + "types": ["angular"] + }, + "include": ["src"], + "types": ["angular", "angular-mock"] +} diff --git a/packages/browser/LICENSE b/packages/browser/LICENSE new file mode 100644 index 00000000..e06d2081 --- /dev/null +++ b/packages/browser/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/packages/browser/README.md b/packages/browser/README.md new file mode 100644 index 00000000..2d53c158 --- /dev/null +++ b/packages/browser/README.md @@ -0,0 +1,80 @@ +# Exceptionless Browser + +This package provides native JavaScript support for applications that are built +in vanilla HTML and JS. + +## Getting Started + +To use this package, your must be using ES6 and support ESM modules. + +## Installation + +You can install Exceptionless either in your browser application using a `script` +tag, or you can use the Node Package Manager (npm) to install the package. + +### CDN + +Add the following script tag at the very beginning of your page: + +```html + +``` + +### npm + +1. Install the package by running `npm install @exceptionless/browser --save`. +2. Import Exceptionless and call startup during app startup. + +```js +import { Exceptionless } from "@exceptionless/browser"; + +await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; +}); +``` + +## Configuration + +While your app is starting up, you should call `startup` on the Exceptionless +client. This ensures the client is configured and automatic capturing of +unhandled errors occurs. + +```js +import { Exceptionless } from "@exceptionless/browser"; + +await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; + c.setUserIdentity("12345678", "Blake"); + c.useSessions(); + + // set some default data + c.defaultData["mydata"] = { + myGreeting: "Hello World" + }; + + c.defaultTags.push("Example", "JavaScript", "Browser"); +}); +``` + +Once that's done, you can use the Exceptionless client anywhere in your app by +importing `Exceptionless` followed by the method you want to use. For example: + +```js +await Exceptionless.submitLog("Hello world!"); +``` + +Please see the [docs](https://exceptionless.com/docs/clients/javascript/) for +more information on configuring the client. + +## Support + +If you need help, please contact us via in-app support, +[open an issue](https://github.com/exceptionless/Exceptionless.JavaScript/issues/new) +or [join our chat on Discord](https://discord.gg/6HxgFCx). We’re always here to +help if you have any questions! diff --git a/packages/browser/package.json b/packages/browser/package.json new file mode 100644 index 00000000..fdceec21 --- /dev/null +++ b/packages/browser/package.json @@ -0,0 +1,81 @@ +{ + "name": "@exceptionless/browser", + "version": "3.0.0-dev", + "description": "JavaScript client for Exceptionless", + "author": { + "name": "exceptionless", + "url": "https://exceptionless.com" + }, + "keywords": [ + "exceptionless", + "error", + "feature", + "logging", + "tracking", + "reporting", + "browser" + ], + "repository": { + "url": "git://github.com/exceptionless/Exceptionless.JavaScript.git", + "type": "git" + }, + "bugs": { + "url": "https://github.com/exceptionless/Exceptionless.JavaScript/issues" + }, + "license": "Apache-2.0", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "unpkg": "dist/index.bundle.min.js", + "jsdelivr": "dist/index.bundle.min.js", + "exports": { + ".": "./dist/index.js", + "./package.json": "./package.json" + }, + "imports": { + "#/*": { + "source": "./src/*", + "default": "./dist/*" + } + }, + "jest": { + "moduleFileExtensions": [ + "js", + "ts" + ], + "moduleNameMapper": { + "^@exceptionless/(.*)$": "/../$1/src" + }, + "resolver": "../../jest-resolver.cjs", + "transform": { + "^.+\\.tsx?$": [ + "ts-jest", + { + "diagnostics": false + } + ] + }, + "testEnvironment": "jsdom" + }, + "scripts": { + "build": "tsc -p tsconfig.json && esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --conditions=source --outfile=dist/index.bundle.js && esbuild src/index.ts --bundle --minify --sourcemap --target=es2022 --format=esm --conditions=source --outfile=dist/index.bundle.min.js", + "watch": "tsc -p ../core/tsconfig.json -w --preserveWatchOutput & tsc -p tsconfig.json -w --preserveWatchOutput & esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --conditions=source --watch --outfile=dist/index.bundle.js", + "test": "jest", + "test:watch": "jest --watch" + }, + "sideEffects": false, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@jest/globals": "^30.3.0", + "esbuild": "^0.27.4", + "jest": "^30.3.0", + "jest-environment-jsdom": "^30.3.0", + "ts-jest": "^29.4.6" + }, + "dependencies": { + "@exceptionless/core": "3.0.0-dev", + "stacktrace-js": "^2.0.2" + } +} diff --git a/packages/browser/src/BrowserExceptionlessClient.ts b/packages/browser/src/BrowserExceptionlessClient.ts new file mode 100644 index 00000000..d4f8f3b5 --- /dev/null +++ b/packages/browser/src/BrowserExceptionlessClient.ts @@ -0,0 +1,27 @@ +import { Configuration, ExceptionlessClient, SimpleErrorPlugin } from "@exceptionless/core"; + +import { BrowserErrorPlugin } from "#/plugins/BrowserErrorPlugin.js"; +import { BrowserGlobalHandlerPlugin } from "#/plugins/BrowserGlobalHandlerPlugin.js"; +import { BrowserIgnoreExtensionErrorsPlugin } from "#/plugins/BrowserIgnoreExtensionErrorsPlugin.js"; +import { BrowserLifeCyclePlugin } from "#/plugins/BrowserLifeCyclePlugin.js"; +import { BrowserModuleInfoPlugin } from "#/plugins/BrowserModuleInfoPlugin.js"; +import { BrowserRequestInfoPlugin } from "#/plugins/BrowserRequestInfoPlugin.js"; + +export class BrowserExceptionlessClient extends ExceptionlessClient { + public async startup(configurationOrApiKey?: (config: Configuration) => void | string): Promise { + const config = this.config; + if (configurationOrApiKey && !this._initialized) { + config.useLocalStorage(); + + config.addPlugin(new BrowserGlobalHandlerPlugin()); + config.addPlugin(new BrowserIgnoreExtensionErrorsPlugin()); + config.addPlugin(new BrowserLifeCyclePlugin()); + config.addPlugin(new BrowserModuleInfoPlugin()); + config.addPlugin(new BrowserRequestInfoPlugin()); + config.addPlugin(new BrowserErrorPlugin()); + config.removePlugin(new SimpleErrorPlugin()); + } + + await super.startup(configurationOrApiKey); + } +} diff --git a/packages/browser/src/index.ts b/packages/browser/src/index.ts new file mode 100644 index 00000000..1c9762c4 --- /dev/null +++ b/packages/browser/src/index.ts @@ -0,0 +1,12 @@ +export * from "@exceptionless/core"; + +export { BrowserErrorPlugin } from "#/plugins/BrowserErrorPlugin.js"; +export { BrowserGlobalHandlerPlugin } from "#/plugins/BrowserGlobalHandlerPlugin.js"; +export { BrowserIgnoreExtensionErrorsPlugin } from "#/plugins/BrowserIgnoreExtensionErrorsPlugin.js"; +export { BrowserLifeCyclePlugin } from "#/plugins/BrowserLifeCyclePlugin.js"; +export { BrowserModuleInfoPlugin } from "#/plugins/BrowserModuleInfoPlugin.js"; +export { BrowserRequestInfoPlugin } from "#/plugins/BrowserRequestInfoPlugin.js"; +export { BrowserExceptionlessClient } from "#/BrowserExceptionlessClient.js"; + +import { BrowserExceptionlessClient } from "#/BrowserExceptionlessClient.js"; +export const Exceptionless = new BrowserExceptionlessClient(); diff --git a/packages/browser/src/plugins/BrowserErrorPlugin.ts b/packages/browser/src/plugins/BrowserErrorPlugin.ts new file mode 100644 index 00000000..fcd1105d --- /dev/null +++ b/packages/browser/src/plugins/BrowserErrorPlugin.ts @@ -0,0 +1,90 @@ +import { + ErrorInfo, + EventPluginContext, + IEventPlugin, + IgnoredErrorProperties, + KnownEventDataKeys, + ParameterInfo, + StackFrameInfo, + stringify, + isEmpty +} from "@exceptionless/core"; + +import { fromError, StackFrame } from "stacktrace-js"; + +export class BrowserErrorPlugin implements IEventPlugin { + public priority = 30; + public name = "BrowserErrorPlugin"; + + public async run(context: EventPluginContext): Promise { + const exception = context.eventContext.getException(); + if (exception) { + if (!context.event.type) { + context.event.type = "error"; + } + + if (context.event.data && !context.event.data[KnownEventDataKeys.Error]) { + const result = await this.parse(exception); + if (result) { + const exclusions = context.client.config.dataExclusions.concat(IgnoredErrorProperties); + const additionalData = stringify(exception, exclusions); + if (!isEmpty(additionalData)) { + if (!result.data) { + result.data = {}; + } + + result.data["@ext"] = JSON.parse(additionalData); + } + + context.event.data[KnownEventDataKeys.Error] = result; + } + } + } + } + + public async parse(exception: Error): Promise { + function getParameters(parameters: string | string[]): ParameterInfo[] { + const params: string[] = (typeof parameters === "string" ? [parameters] : parameters) || []; + + const items: ParameterInfo[] = []; + for (const param of params) { + items.push({ name: param }); + } + + return items; + } + + function getStackFrames(stackFrames: StackFrame[]): StackFrameInfo[] { + const ANONYMOUS: string = ""; + const frames: StackFrameInfo[] = []; + + for (const frame of stackFrames) { + const fileName: string = frame.getFileName(); + frames.push({ + name: (frame.getFunctionName() || ANONYMOUS).replace("?", ANONYMOUS), + parameters: getParameters(frame.getArgs()), + file_name: fileName, + line_number: frame.getLineNumber() || 0, + column: frame.getColumnNumber() || 0, + data: { + is_native: frame.getIsNative() || (fileName && fileName[0] !== "/" && fileName[0] !== ".") + } + }); + } + + return frames; + } + + const result: StackFrame[] = exception.stack ? await fromError(exception) : []; + if (!result) { + throw new Error("Unable to parse the exception stack trace"); + } + + // TODO: Test with reference error. + return Promise.resolve({ + type: exception.name || "Error", + message: exception.message, + stack_trace: getStackFrames(result || []) + }); + } +} diff --git a/packages/browser/src/plugins/BrowserGlobalHandlerPlugin.ts b/packages/browser/src/plugins/BrowserGlobalHandlerPlugin.ts new file mode 100644 index 00000000..10b1c279 --- /dev/null +++ b/packages/browser/src/plugins/BrowserGlobalHandlerPlugin.ts @@ -0,0 +1,104 @@ +import { ExceptionlessClient, IEventPlugin, PluginContext, toError } from "@exceptionless/core"; + +declare let $: (document: Document) => { + ajaxError: { + (document: (event: Event, xhr: { responseText: string; status: number }, settings: { data: unknown; url: string }, error: string) => void): void; + }; +}; + +export class BrowserGlobalHandlerPlugin implements IEventPlugin { + public priority: number = 100; + public name: string = "BrowserGlobalHandlerPlugin"; + + private _client: ExceptionlessClient | null = null; + + public startup(context: PluginContext): Promise { + if (this._client || typeof window !== "object") { + return Promise.resolve(); + } + + this._client = context.client; + + // TODO: Discus if we want to unwire this handler in suspend? + window.addEventListener("error", (event) => { + void this._client?.submitUnhandledException(this.getError(event), "onerror"); + }); + + window.addEventListener("unhandledrejection", (event) => { + let reason: unknown = event.reason; + if (!(reason instanceof Error)) { + try { + // Check for reason in legacy CustomEvents (https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) + const detailReason = (<{ detail?: { reason: string } }>event).detail?.reason; + if (detailReason) { + reason = detailReason; + } + } catch (ex) { + this._client?.config.services.log.trace(`Unable to get rejection detail reason: ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + + if (!(reason instanceof Error)) { + try { + const error = event.reason.error; + if (error) { + reason = error; + } + } catch (ex) { + this._client?.config.services.log.trace(`Unable to get rejection error: ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + + const error: Error = toError(reason, "Unhandled rejection"); + void this._client?.submitUnhandledException(error, "onunhandledrejection"); + }); + + if (typeof $ !== "undefined" && $(document)) { + $(document).ajaxError((_: Event, xhr: { responseText: string; status: number }, settings: { data: unknown; url: string }, error: string) => { + if (xhr.status === 404) { + // TODO: Handle async + void this._client?.submitNotFound(settings.url); + } else if (xhr.status !== 401) { + // TODO: Handle async + void this._client + ?.createUnhandledException(toError(error), "JQuery.ajaxError") + .setSource(settings.url) + .setProperty("status", xhr.status) + .setProperty("request", settings.data) + .setProperty("response", xhr.responseText?.slice(0, 1024)) + .submit(); + } + }); + } + + return Promise.resolve(); + } + + private getError(event: ErrorEvent): Error { + const { error, message, filename, lineno, colno } = event; + if (typeof error === "object") { + return error as Error; + } + + let name: string = "Error"; + let msg: string = message || event.error; + if (msg) { + const errorNameRegex: RegExp = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Aggregate|Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i; + const regexResult = errorNameRegex.exec(msg); + if (regexResult) { + const [, errorName, errorMessage] = regexResult; + if (errorName) { + name = errorName; + } + if (errorMessage) { + msg = errorMessage; + } + } + } + + const ex = new Error(msg || "Script error."); + ex.name = name; + ex.stack = `at ${filename || ""}:${!isNaN(lineno) ? lineno : 0}${!isNaN(colno) ? `:${colno}` : ""}`; + return ex; + } +} diff --git a/packages/browser/src/plugins/BrowserIgnoreExtensionErrorsPlugin.ts b/packages/browser/src/plugins/BrowserIgnoreExtensionErrorsPlugin.ts new file mode 100644 index 00000000..4c314a2c --- /dev/null +++ b/packages/browser/src/plugins/BrowserIgnoreExtensionErrorsPlugin.ts @@ -0,0 +1,17 @@ +import { EventPluginContext, IEventPlugin } from "@exceptionless/core"; + +export class BrowserIgnoreExtensionErrorsPlugin implements IEventPlugin { + public priority = 15; + public name = "BrowserIgnoreExtensionErrorsPlugin"; + + public async run(context: EventPluginContext): Promise { + const exception = context.eventContext.getException(); + if (exception?.stack && exception.stack.includes("-extension://")) { + // Handles all extensions like chrome-extension://, moz-extension://, ms-browser-extension://, safari-extension:// + context.log.info("Ignoring event with error stack containing browser extension"); + context.cancelled = true; + } + + return Promise.resolve(); + } +} diff --git a/packages/browser/src/plugins/BrowserLifeCyclePlugin.ts b/packages/browser/src/plugins/BrowserLifeCyclePlugin.ts new file mode 100644 index 00000000..e33ed329 --- /dev/null +++ b/packages/browser/src/plugins/BrowserLifeCyclePlugin.ts @@ -0,0 +1,34 @@ +import { ExceptionlessClient, IEventPlugin, PluginContext } from "@exceptionless/core"; + +export class BrowserLifeCyclePlugin implements IEventPlugin { + public priority: number = 105; + public name: string = "BrowserLifeCyclePlugin"; + + private _client: ExceptionlessClient | null = null; + + public startup(context: PluginContext): Promise { + if (this._client || typeof document !== "object") { + return Promise.resolve(); + } + + this._client = context.client; + + globalThis.addEventListener("beforeunload", () => { + if (this._client?.config.sessionsEnabled) { + void this._client?.submitSessionEnd(); + } + + void this._client?.suspend(); + }); + + document.addEventListener("visibilitychange", () => { + if (document.visibilityState === "visible") { + void this._client?.startup(); + } else { + void this._client?.suspend(); + } + }); + + return Promise.resolve(); + } +} diff --git a/packages/browser/src/plugins/BrowserModuleInfoPlugin.ts b/packages/browser/src/plugins/BrowserModuleInfoPlugin.ts new file mode 100644 index 00000000..1291dd1a --- /dev/null +++ b/packages/browser/src/plugins/BrowserModuleInfoPlugin.ts @@ -0,0 +1,52 @@ +import { EventPluginContext, getHashCode, IEventPlugin, KnownEventDataKeys, ModuleInfo, parseVersion } from "@exceptionless/core"; + +export class BrowserModuleInfoPlugin implements IEventPlugin { + public priority: number = 50; + public name: string = "BrowserModuleInfoPlugin"; + private _modules: ModuleInfo[] | undefined; + + public startup(): Promise { + if (!this._modules) { + this._modules = this.getModules(); + } + + return Promise.resolve(); + } + + public run(context: EventPluginContext): Promise { + const error = context.event.data?.[KnownEventDataKeys.Error]; + if (error && !error?.modules && this._modules?.length) { + error.modules = this._modules; + } + + return Promise.resolve(); + } + + private getModules(): ModuleInfo[] | undefined { + if (typeof document !== "object" || !document.getElementsByTagName) { + return; + } + + const modules: ModuleInfo[] = []; + const scripts: HTMLCollectionOf = document.getElementsByTagName("script"); + if (scripts && scripts.length > 0) { + for (let index = 0; index < scripts.length; index++) { + if (scripts[index].src) { + modules.push({ + module_id: index, + name: scripts[index].src.split("?")[0], + version: parseVersion(scripts[index].src) + }); + } else if (scripts[index].innerHTML) { + modules.push({ + module_id: index, + name: "Script Tag", + version: getHashCode(scripts[index].innerHTML).toString() + }); + } + } + } + + return modules; + } +} diff --git a/packages/browser/src/plugins/BrowserRequestInfoPlugin.ts b/packages/browser/src/plugins/BrowserRequestInfoPlugin.ts new file mode 100644 index 00000000..25b1d12a --- /dev/null +++ b/packages/browser/src/plugins/BrowserRequestInfoPlugin.ts @@ -0,0 +1,52 @@ +import { EventPluginContext, getCookies, IEventPlugin, isMatch, KnownEventDataKeys, parseQueryString, RequestInfo } from "@exceptionless/core"; + +export class BrowserRequestInfoPlugin implements IEventPlugin { + public priority: number = 70; + public name: string = "BrowserRequestInfoPlugin"; + + public run(context: EventPluginContext): Promise { + if (context.event.data && !context.event.data[KnownEventDataKeys.RequestInfo]) { + const requestInfo: RequestInfo | undefined = this.getRequestInfo(context); + if (requestInfo) { + if (isMatch(requestInfo.user_agent, context.client.config.userAgentBotPatterns)) { + context.log.info("Cancelling event as the request user agent matches a known bot pattern"); + context.cancelled = true; + } else { + context.event.data[KnownEventDataKeys.RequestInfo] = requestInfo; + } + } + } + + return Promise.resolve(); + } + + private getRequestInfo(context: EventPluginContext): RequestInfo | undefined { + if (typeof document !== "object" || typeof navigator !== "object" || typeof location !== "object") { + return; + } + + const config = context.client.config; + const exclusions = config.dataExclusions; + const requestInfo: RequestInfo = { + user_agent: navigator.userAgent, + is_secure: location.protocol === "https:", + host: location.hostname, + port: location.port && location.port !== "" ? parseInt(location.port, 10) : 80, + path: location.pathname + }; + + if (config.includeCookies) { + requestInfo.cookies = getCookies(document.cookie, exclusions) as Record; + } + + if (config.includeQueryString) { + requestInfo.query_string = parseQueryString(location.search.substring(1), exclusions); + } + + if (document.referrer && document.referrer !== "") { + requestInfo.referrer = document.referrer; + } + + return requestInfo; + } +} diff --git a/packages/browser/test/plugins/BrowserErrorPlugin.test.ts b/packages/browser/test/plugins/BrowserErrorPlugin.test.ts new file mode 100644 index 00000000..3c6d71f0 --- /dev/null +++ b/packages/browser/test/plugins/BrowserErrorPlugin.test.ts @@ -0,0 +1,141 @@ +import { beforeEach, describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { ErrorInfo, Event, EventContext, EventPluginContext, ExceptionlessClient, KnownEventDataKeys } from "@exceptionless/core"; + +import { CapturedExceptions } from "./../../../core/test/plugins/default/exceptions.js"; +import { BrowserErrorPlugin } from "#/plugins/BrowserErrorPlugin.js"; + +class BaseTestError extends Error { + public name = "NotImplementedError"; + public someProperty = "Test"; +} + +class DerivedTestError extends BaseTestError { + public someOtherProperty = "Test2"; +} + +describe("BrowserErrorPlugin", () => { + const plugin = new BrowserErrorPlugin(); + let context: EventPluginContext; + + beforeEach(() => { + plugin.parse = (exception: Error): Promise => { + return Promise.resolve({ + type: exception.name, + message: exception.message, + stack_trace: [], + modules: [] + }); + }; + + const client: ExceptionlessClient = new ExceptionlessClient(); + const event: Event = { + data: {} + }; + + context = new EventPluginContext(client, event, new EventContext()); + }); + + function processError(error: Error | string | unknown): Promise { + const exception = throwAndCatch(error); + context.eventContext.setException(exception); + return plugin.run(context); + } + + describe("additional data", () => { + describeForCapturedExceptions((exception) => { + test("should ignore default error properties", async () => { + context.eventContext.setException(exception as Error); + await plugin.run(context); + const additionalData = getAdditionalData(context.event); + expect(additionalData).toBeUndefined(); + }); + }); + + test("should add error cause", async () => { + const error = { + someProperty: "Test" + }; + await processError(new Error("Error With Cause", { cause: error })); + const additionalData = getAdditionalData(context.event); + expect(additionalData).not.toBeNull(); + expect(additionalData?.cause).toStrictEqual(error); + }); + + test("should add custom properties to additional data", async () => { + const error = { + someProperty: "Test" + }; + await processError(error); + const additionalData = getAdditionalData(context.event); + expect(additionalData).not.toBeNull(); + expect(additionalData?.someProperty).toBe("Test"); + }); + + test("should support custom exception types", async () => { + await processError(new BaseTestError()); + const additionalData = getAdditionalData(context.event); + expect(additionalData).not.toBeNull(); + expect(additionalData?.someProperty).toBe("Test"); + }); + + test("should support inherited properties", async () => { + await processError(new DerivedTestError()); + const additionalData = getAdditionalData(context.event); + expect(additionalData).not.toBeNull(); + expect(additionalData?.someProperty).toBe("Test"); + expect(additionalData?.someOtherProperty).toBe("Test2"); + }); + + test("shouldn't set empty additional data", async () => { + await processError({}); + const additionalData = getAdditionalData(context.event); + expect(additionalData).toBeUndefined(); + }); + + test("should ignore functions", async () => { + class ErrorWithFunction extends Error { + constructor() { + super("Error with function"); + } + + public someFunction(): number { + return 5; + } + } + const exception = new ErrorWithFunction(); + context.eventContext.setException(exception); + + await plugin.run(context); + + const additionalData = getAdditionalData(context.event); + expect(additionalData).toBeUndefined(); + }); + }); +}); + +function describeForCapturedExceptions(specDefinitions: (exception: Error | unknown) => void) { + const exceptions = >CapturedExceptions; + const keys = Object.getOwnPropertyNames(exceptions); + keys.forEach((key) => { + describe(key, () => specDefinitions(exceptions[key])); + }); +} + +function getError(event: Event): ErrorInfo | undefined { + return event?.data?.[KnownEventDataKeys.Error]; +} + +function getAdditionalData(event: Event): Record | undefined { + const error = getError(event); + return error?.data?.["@ext"] as Record; +} + +function throwAndCatch(error: Error | string | unknown): Error { + try { + throw error; + } catch (exception) { + return exception as Error; + } +} diff --git a/packages/browser/test/plugins/BrowserIgnoreExtensionErrorsPlugin.test.ts b/packages/browser/test/plugins/BrowserIgnoreExtensionErrorsPlugin.test.ts new file mode 100644 index 00000000..04039089 --- /dev/null +++ b/packages/browser/test/plugins/BrowserIgnoreExtensionErrorsPlugin.test.ts @@ -0,0 +1,46 @@ +import { beforeEach, describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { EventContext, EventPluginContext, ExceptionlessClient } from "@exceptionless/core"; + +import { BrowserIgnoreExtensionErrorsPlugin } from "#/plugins/BrowserIgnoreExtensionErrorsPlugin.js"; + +describe("BrowserIgnoreExtensionErrorsPlugin", () => { + let client: ExceptionlessClient; + let plugin: BrowserIgnoreExtensionErrorsPlugin; + + beforeEach(() => { + client = new ExceptionlessClient(); + plugin = new BrowserIgnoreExtensionErrorsPlugin(); + }); + + const run = async (stackTrace?: string | undefined): Promise => { + const error = new Error("Test"); + if (stackTrace) { + error.stack = stackTrace; + } + + const eventContext = new EventContext(); + eventContext.setException(error); + + const context = new EventPluginContext(client, { type: "error" }, eventContext); + + await plugin.run(context); + return context; + }; + + test("should not cancel empty stack trace", async () => { + const context = await run(); + expect(context.cancelled).toBe(false); + }); + + test("should not cancel normal stack trace", async () => { + const context = await run("at t() in https://test/Content/js/Exceptionless/exceptionless.min.js:line 1:col 260"); + expect(context.cancelled).toBe(false); + }); + + test("should cancel browser extension stack trace", async () => { + const context = await run("at Object.initialize() in chrome-extension://bmagokdooijbeehmkpknfglimnifench/firebug-lite.js:line 6289:col 29"); + expect(context.cancelled).toBe(true); + }); +}); diff --git a/packages/browser/tsconfig.json b/packages/browser/tsconfig.json new file mode 100644 index 00000000..88b314ea --- /dev/null +++ b/packages/browser/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "lib": ["DOM", "ES2022"], + "outDir": "dist", + "paths": { + "#/*": ["./src/*"] + }, + "rootDir": "src", + "types": ["jest"] + }, + "include": ["src"] +} diff --git a/packages/core/LICENSE b/packages/core/LICENSE new file mode 100644 index 00000000..e06d2081 --- /dev/null +++ b/packages/core/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 00000000..df5d5164 --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,59 @@ +# Exceptionless Client SDK + +This package contains the default implementations that all other JS clients +build upon. You can use it directly but we recommend using one of the packages +below which automatically wire up to platform specific error handlers and +platform specific plugins. + +- [`@exceptionless/angularjs`](https://github.com/exceptionless/Exceptionless.JavaScript/tree/master/packages/angularjs) +- [`@exceptionless/browser`](https://github.com/exceptionless/Exceptionless.JavaScript/tree/master/packages/browser) +- [`@exceptionless/node`](https://github.com/exceptionless/Exceptionless.JavaScript/tree/master/packages/node) +- [`@exceptionless/react`](https://github.com/exceptionless/Exceptionless.JavaScript/tree/master/packages/react) +- [`@exceptionless/vue`](https://github.com/exceptionless/Exceptionless.JavaScript/tree/master/packages/vue) + +## Getting Started + +To use this package, your must be using ES6 and support ESM modules. + +## Installation + +`npm install @exceptionless/core --save` + +## Configuration + +While your app is starting up, you should call `startup` on the Exceptionless +client. This ensures the client is configured and automatic capturing of +unhandled errors occurs. + +```js +import { Exceptionless } from "@exceptionless/core"; + +await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; + c.setUserIdentity("12345678", "Blake"); + + // set some default data + c.defaultData["mydata"] = { + myGreeting: "Hello World" + }; + + c.defaultTags.push("Example", "JavaScript"); +}); +``` + +Once that's done, you can use the Exceptionless client anywhere in your app by +importing `Exceptionless` followed by the method you want to use. For example: + +```js +await Exceptionless.submitLog("Hello world!"); +``` + +Please see the [docs](https://exceptionless.com/docs/clients/javascript/) for +more information on configuring the client. + +## Support + +If you need help, please contact us via in-app support, +[open an issue](https://github.com/exceptionless/Exceptionless.JavaScript/issues/new) +or [join our chat on Discord](https://discord.gg/6HxgFCx). We’re always here to +help if you have any questions! diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 00000000..5696effd --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,78 @@ +{ + "name": "@exceptionless/core", + "version": "3.0.0-dev", + "description": "JavaScript client for Exceptionless", + "author": { + "name": "exceptionless", + "url": "https://exceptionless.com" + }, + "homepage": "https://exceptionless.com", + "keywords": [ + "exceptionless", + "error", + "feature", + "logging", + "tracking", + "reporting" + ], + "repository": { + "url": "git://github.com/exceptionless/Exceptionless.JavaScript.git", + "type": "git" + }, + "bugs": { + "url": "https://github.com/exceptionless/Exceptionless.JavaScript/issues" + }, + "license": "Apache-2.0", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "unpkg": "dist/index.bundle.min.js", + "jsdelivr": "dist/index.bundle.min.js", + "exports": { + ".": "./dist/index.js", + "./package.json": "./package.json" + }, + "imports": { + "#/*": { + "source": "./src/*", + "default": "./dist/*" + } + }, + "jest": { + "moduleFileExtensions": [ + "js", + "ts" + ], + "moduleNameMapper": { + "^#/(.*)$": "/src/$1", + "^@exceptionless/(.*)$": "/../$1/src" + }, + "resolver": "../../jest-resolver.cjs", + "transform": { + "^.+\\.tsx?$": [ + "ts-jest", + { + "diagnostics": false + } + ] + }, + "testEnvironment": "jsdom" + }, + "scripts": { + "build": "tsc -p tsconfig.json && esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --conditions=source --outfile=dist/index.bundle.js && esbuild src/index.ts --bundle --minify --sourcemap --target=es2022 --format=esm --conditions=source --outfile=dist/index.bundle.min.js", + "watch": "tsc -p tsconfig.json -w --preserveWatchOutput & esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --conditions=source --watch --outfile=dist/index.bundle.js", + "test": "jest", + "test:watch": "jest --watch" + }, + "sideEffects": false, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@jest/globals": "^30.3.0", + "esbuild": "^0.27.4", + "jest": "^30.3.0", + "jest-environment-jsdom": "^30.3.0", + "ts-jest": "^29.4.6" + } +} diff --git a/src/EventBuilder.ts b/packages/core/src/EventBuilder.ts similarity index 56% rename from src/EventBuilder.ts rename to packages/core/src/EventBuilder.ts index ee1cf4c5..8ae29c36 100644 --- a/src/EventBuilder.ts +++ b/packages/core/src/EventBuilder.ts @@ -1,26 +1,26 @@ -import { ExceptionlessClient } from './ExceptionlessClient'; -import { IEvent } from './models/IEvent'; -import { IManualStackingInfo } from './models/IManualStackingInfo'; -import { IUserInfo } from './models/IUserInfo'; -import { ContextData } from './plugins/ContextData'; -import { EventPluginContext } from './plugins/EventPluginContext'; -import { Utils } from './Utils'; +import { ExceptionlessClient } from "#/ExceptionlessClient.js"; +import { Event, EventType, KnownEventDataKeys } from "#/models/Event.js"; +import { ManualStackingInfo } from "#/models/data/ManualStackingInfo.js"; +import { UserInfo } from "#/models/data/UserInfo.js"; +import { EventContext } from "#/models/EventContext.js"; +import { isEmpty, stringify } from "#/Utils.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; export class EventBuilder { - public target: IEvent; + public target: Event; public client: ExceptionlessClient; - public pluginContextData: ContextData; + public context: EventContext; - private _validIdentifierErrorMessage: string = 'must contain between 8 and 100 alphanumeric or \'-\' characters.'; // optimization for minifier. + private _validIdentifierErrorMessage = "must contain between 8 and 100 alphanumeric or '-' characters."; - constructor(event: IEvent, client: ExceptionlessClient, pluginContextData?: ContextData) { + constructor(event: Event, client: ExceptionlessClient, context?: EventContext) { this.target = event; this.client = client; - this.pluginContextData = pluginContextData || new ContextData(); + this.context = context || new EventContext(); } - public setType(type: string): EventBuilder { - if (!!type) { + public setType(type: EventType): EventBuilder { + if (type) { this.target.type = type; } @@ -28,7 +28,7 @@ export class EventBuilder { } public setSource(source: string): EventBuilder { - if (!!source) { + if (source) { this.target.source = source; } @@ -48,23 +48,22 @@ export class EventBuilder { * Allows you to reference a parent event by its ReferenceId property. This allows you to have parent and child relationships. * @param name Reference name * @param id The reference id that points to a specific event - * @returns {EventBuilder} */ public setEventReference(name: string, id: string): EventBuilder { if (!name) { - throw new Error('Invalid name'); + throw new Error("Invalid name"); } if (!id || !this.isValidIdentifier(id)) { throw new Error(`Id ${this._validIdentifierErrorMessage}`); } - this.setProperty('@ref:' + name, id); + this.setProperty("@ref:" + name, id); return this; } - public setMessage(message: string): EventBuilder { - if (!!message) { + public setMessage(message: string | null | undefined): EventBuilder { + if (message) { this.target.message = message; } @@ -73,40 +72,42 @@ export class EventBuilder { public setGeo(latitude: number, longitude: number): EventBuilder { if (latitude < -90.0 || latitude > 90.0) { - throw new Error('Must be a valid latitude value between -90.0 and 90.0.'); + throw new Error("Must be a valid latitude value between -90.0 and 90.0."); } if (longitude < -180.0 || longitude > 180.0) { - throw new Error('Must be a valid longitude value between -180.0 and 180.0.'); + throw new Error("Must be a valid longitude value between -180.0 and 180.0."); } this.target.geo = `${latitude},${longitude}`; return this; } - public setUserIdentity(userInfo: IUserInfo): EventBuilder; + public setUserIdentity(userInfo: UserInfo): EventBuilder; public setUserIdentity(identity: string): EventBuilder; public setUserIdentity(identity: string, name: string): EventBuilder; - public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): EventBuilder { - const userInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name }; + public setUserIdentity(userInfoOrIdentity: UserInfo | string, name?: string): EventBuilder { + const userInfo = typeof userInfoOrIdentity !== "string" ? userInfoOrIdentity : { identity: userInfoOrIdentity, name }; if (!userInfo || (!userInfo.identity && !userInfo.name)) { return this; } - this.setProperty('@user', userInfo); + this.setProperty(KnownEventDataKeys.UserInfo, userInfo); return this; } /** - * Sets the user's description of the event. + * Sets the user"s description of the event. * * @param emailAddress The email address - * @param description The user's description of the event. - * @returns {EventBuilder} + * @param description The user"s description of the event. */ public setUserDescription(emailAddress: string, description: string): EventBuilder { if (emailAddress && description) { - this.setProperty('@user_description', { email_address: emailAddress, description }); + this.setProperty(KnownEventDataKeys.UserDescription, { + email_address: emailAddress, + description + }); } return this; @@ -117,16 +118,15 @@ export class EventBuilder { * stacking information. * @param signatureData A dictionary of strings to use for stacking. * @param title An optional title for the stacking information. - * @returns {EventBuilder} */ - public setManualStackingInfo(signatureData: any, title?: string) { + public setManualStackingInfo(signatureData: Record, title?: string): EventBuilder { if (signatureData) { - const stack: IManualStackingInfo = { signature_data: signatureData }; + const stack: ManualStackingInfo = { signature_data: signatureData }; if (title) { stack.title = title; } - this.setProperty('@stack', stack); + this.setProperty(KnownEventDataKeys.ManualStackingInfo, stack); } return this; @@ -136,7 +136,6 @@ export class EventBuilder { * Changes default stacking behavior by setting the stacking key. * @param manualStackingKey The manual stacking key. * @param title An optional title for the stacking information. - * @returns {EventBuilder} */ public setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder { if (manualStackingKey) { @@ -147,8 +146,12 @@ export class EventBuilder { return this; } + /** + * Sets the event value. + * @param value The value of the event. + */ public setValue(value: number): EventBuilder { - if (!!value) { + if (value) { this.target.value = value; } @@ -156,20 +159,20 @@ export class EventBuilder { } public addTags(...tags: string[]): EventBuilder { - this.target.tags = Utils.addRange(this.target.tags, ...tags); + this.target.tags = [...(this.target.tags || []), ...tags]; return this; } /** * Adds the object to extended data. Uses @excludedPropertyNames * to exclude data from being included in the event. - * @param name The data object to add. - * @param value The name of the object to add. + * @param name The name of the object to add. + * @param value The data object to add. * @param maxDepth The max depth of the object to include. * @param excludedPropertyNames Any property names that should be excluded. */ - public setProperty(name: string, value: any, maxDepth?: number, excludedPropertyNames?: string[]): EventBuilder { - if (!name || (value === undefined || value == null)) { + public setProperty(name: string, value: unknown, maxDepth?: number, excludedPropertyNames?: string[]): EventBuilder { + if (!name || value === undefined || value == null) { return this; } @@ -177,32 +180,30 @@ export class EventBuilder { this.target.data = {}; } - const result = JSON.parse(Utils.stringify(value, this.client.config.dataExclusions.concat(excludedPropertyNames || []), maxDepth)); - if (!Utils.isEmpty(result)) { - this.target.data[name] = result; + const exclusions = this.client.config.dataExclusions.concat(excludedPropertyNames || []); + const json = stringify(value, exclusions, maxDepth); + if (!isEmpty(json)) { + this.target.data[name] = JSON.parse(json); } return this; } - public markAsCritical(critical: boolean): EventBuilder { - if (critical) { - this.addTags('Critical'); - } - + public setContextProperty(name: string, value: unknown): EventBuilder { + this.context[name] = value; return this; } - public addRequestInfo(request: object): EventBuilder { - if (!!request) { - this.pluginContextData['@request'] = request; + public markAsCritical(critical: boolean): EventBuilder { + if (critical) { + this.addTags("Critical"); } return this; } - public submit(callback?: (context: EventPluginContext) => void): void { - this.client.submitEvent(this.target, this.pluginContextData, callback); + public submit(): Promise { + return this.client.submitEvent(this.target, this.context); } private isValidIdentifier(value: string): boolean { @@ -216,8 +217,8 @@ export class EventBuilder { for (let index = 0; index < value.length; index++) { const code = value.charCodeAt(index); - const isDigit = (code >= 48) && (code <= 57); - const isLetter = ((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122)); + const isDigit = code >= 48 && code <= 57; + const isLetter = (code >= 65 && code <= 90) || (code >= 97 && code <= 122); const isMinus = code === 45; if (!(isDigit || isLetter) && !isMinus) { diff --git a/packages/core/src/ExceptionlessClient.ts b/packages/core/src/ExceptionlessClient.ts new file mode 100644 index 00000000..6def0c69 --- /dev/null +++ b/packages/core/src/ExceptionlessClient.ts @@ -0,0 +1,281 @@ +import { Configuration } from "#/configuration/Configuration.js"; +import { SettingsManager } from "#/configuration/SettingsManager.js"; +import { EventBuilder } from "#/EventBuilder.js"; +import { Event, KnownEventDataKeys, LogLevel } from "#/models/Event.js"; +import { UserDescription } from "#/models/data/UserDescription.js"; +import { EventContext } from "#/models/EventContext.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { EventPluginManager } from "#/plugins/EventPluginManager.js"; +import { PluginContext } from "#/plugins/PluginContext.js"; +import { allowProcessToExitWithoutWaitingForTimerOrInterval } from "#/Utils.js"; + +export class ExceptionlessClient { + private _intervalId: ReturnType | undefined; + private _timeoutId: ReturnType | undefined; + protected _initialized = false; + + public constructor(public config: Configuration = new Configuration()) {} + + /** Resume background submission, resume any timers. */ + public async startup(configurationOrApiKey?: (config: Configuration) => void | string): Promise { + if (configurationOrApiKey && !this._initialized) { + this._initialized = true; + + if (typeof configurationOrApiKey === "string") { + this.config.apiKey = configurationOrApiKey; + } else { + configurationOrApiKey(this.config); + } + + this.config.services.queue.onEventsPosted(() => Promise.resolve(this.updateSettingsTimer())); + await SettingsManager.applySavedServerSettings(this.config); + } + + if (!this.config.isValid) { + this.config.services.log.warn("Exceptionless is not configured and will not process events."); + return; + } + + this.updateSettingsTimer(!!configurationOrApiKey); + await EventPluginManager.startup(new PluginContext(this)); + + const { queue } = this.config.services; + await queue.startup(); + if (this.config.usePersistedQueueStorage) { + // TODO: Can we schedule this as part of startup? + await queue.process(); + } + + if (this.config.sessionsEnabled) { + await this.submitSessionStart(); + } + } + + /** Submit events, pause any timers and go into low power mode. */ + public async suspend(): Promise { + await EventPluginManager.suspend(new PluginContext(this)); + const { queue } = this.config.services; + await queue.suspend(); + await queue.process(); + this.suspendSettingsTimer(); + } + + private suspendSettingsTimer(): void { + clearTimeout(this._timeoutId); + this._timeoutId = undefined; + clearInterval(this._intervalId); + this._intervalId = undefined; + } + + public async processQueue(): Promise { + await this.config.services.queue.process(); + } + + private updateSettingsTimer(startingUp: boolean = false) { + this.suspendSettingsTimer(); + + if (!this.config.isValid) { + return; + } + + const interval = this.config.updateSettingsWhenIdleInterval; + if (interval > 0) { + let initialDelay: number = interval; + if (startingUp) { + initialDelay = this.config.settingsVersion > 0 ? 15000 : 5000; + } + + this.config.services.log.info(`Update settings every ${interval}ms (${initialDelay || 0}ms delay)`); + // TODO: Look into better async scheduling.. + const updateSettings = () => void SettingsManager.updateSettings(this.config); + if (initialDelay < interval) { + this._timeoutId = setTimeout(updateSettings, initialDelay); + allowProcessToExitWithoutWaitingForTimerOrInterval(this._timeoutId); + } + + this._intervalId = setInterval(updateSettings, interval); + allowProcessToExitWithoutWaitingForTimerOrInterval(this._intervalId); + } + } + + public createException(exception: Error): EventBuilder { + const pluginContextData = new EventContext(); + pluginContextData.setException(exception); + return this.createEvent(pluginContextData).setType("error"); + } + + public submitException(exception: Error): Promise { + return this.createException(exception).submit(); + } + + public createUnhandledException(exception: Error, submissionMethod?: string): EventBuilder { + const builder = this.createException(exception); + builder.context.markAsUnhandledError(); + builder.context.setSubmissionMethod(submissionMethod || ""); + + return builder; + } + + public submitUnhandledException(exception: Error, submissionMethod?: string): Promise { + return this.createUnhandledException(exception, submissionMethod).submit(); + } + + public createFeatureUsage(feature: string): EventBuilder { + return this.createEvent().setType("usage").setSource(feature); + } + + public submitFeatureUsage(feature: string): Promise { + return this.createFeatureUsage(feature).submit(); + } + + public createLog(message: string): EventBuilder; + public createLog(source: string, message: string): EventBuilder; + public createLog(source: string | undefined, message: string, level: LogLevel): EventBuilder; + public createLog(sourceOrMessage: string, message?: string, level?: LogLevel): EventBuilder { + let builder = this.createEvent().setType("log"); + + if (level) { + builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty(KnownEventDataKeys.Level, level); + } else if (message) { + builder = builder.setSource(sourceOrMessage).setMessage(message); + } else { + builder = builder.setMessage(sourceOrMessage); + + try { + // TODO: Look into using https://www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/ + const caller = this.createLog.caller; + builder = builder.setSource(caller && caller.caller && caller.caller.name); + } catch (ex) { + this.config.services.log.trace(`Unable to resolve log source: ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + + return builder; + } + + public submitLog(message: string): Promise; + public submitLog(source: string, message: string): Promise; + public submitLog(source: string | undefined, message: string, level: LogLevel): Promise; + public submitLog(sourceOrMessage: string, message?: string, level?: LogLevel): Promise { + return this.createLog(sourceOrMessage, message, level).submit(); + } + + public createNotFound(resource: string): EventBuilder { + return this.createEvent().setType("404").setSource(resource); + } + + public submitNotFound(resource: string): Promise { + return this.createNotFound(resource).submit(); + } + + public createSessionStart(): EventBuilder { + return this.createEvent().setType("session"); + } + + public submitSessionStart(): Promise { + return this.createSessionStart().submit(); + } + + public async submitSessionEnd(sessionIdOrUserId?: string): Promise { + const { currentSessionIdentifier, enabled, isValid, services } = this.config; + const sessionId = sessionIdOrUserId || currentSessionIdentifier; + if (sessionId && enabled && isValid) { + services.log.info(`Submitting session end: ${sessionId}`); + await services.submissionClient.submitHeartbeat(sessionId, true); + } + } + + public async submitSessionHeartbeat(sessionIdOrUserId?: string): Promise { + const { currentSessionIdentifier, enabled, isValid, services } = this.config; + const sessionId = sessionIdOrUserId || currentSessionIdentifier; + if (sessionId && enabled && isValid) { + services.log.info(`Submitting session heartbeat: ${sessionId}`); + await services.submissionClient.submitHeartbeat(sessionId, false); + } + } + + public createEvent(context?: EventContext): EventBuilder { + return new EventBuilder({ date: new Date() }, this, context); + } + + /** + * Submits the event to the server. + * + * @param event The event + * @param context Contextual data used by event plugins to enrich the event details + */ + public async submitEvent(event: Event, context?: EventContext): Promise { + const pluginContext = new EventPluginContext(this, event, context ?? new EventContext()); + + if (!event) { + pluginContext.cancelled = true; + return pluginContext; + } + + if (!this.config.enabled || !this.config.isValid) { + this.config.services.log.info("Event submission is currently disabled."); + pluginContext.cancelled = true; + return pluginContext; + } + + if (!event.data) { + event.data = {}; + } + + if (!event.tags || !event.tags.length) { + event.tags = []; + } + + await EventPluginManager.run(pluginContext); + if (pluginContext.cancelled) { + return pluginContext; + } + + const ev = pluginContext.event; + + // ensure all required data + if (!ev.type || ev.type.length === 0) { + ev.type = "log"; + } + + if (!ev.date) { + ev.date = new Date(); + } + + await this.config.services.queue.enqueue(ev); + + if (ev.reference_id && ev.reference_id.length > 0) { + pluginContext.log.info(`Setting last reference id "${ev.reference_id}"`); + this.config.services.lastReferenceIdManager.setLast(ev.reference_id); + } + + return pluginContext; + } + + /** + * Updates the user"s email address and description of an event for the specified reference id. + * @param referenceId The reference id of the event to update. + * @param email The user"s email address to set on the event. + * @param description The user"s description of the event. + * @param callback The submission response. + */ + public async updateUserEmailAndDescription(referenceId: string, email: string, description: string): Promise { + if (!referenceId || !email || !description || !this.config.enabled || !this.config.isValid) { + return; + } + + const userDescription: UserDescription = { email_address: email, description }; + const response = await this.config.services.submissionClient.submitUserDescription(referenceId, userDescription); + if (!response.success) { + this.config.services.log.error(`Failed to submit user email and description for event "${referenceId}": ${response.status} ${response.message}`); + } + } + + /** + * Gets the last event client id that was submitted to the server. + * @returns {string} The event client id. + */ + public getLastReferenceId(): string | null { + return this.config.services.lastReferenceIdManager.getLast(); + } +} diff --git a/packages/core/src/Utils.ts b/packages/core/src/Utils.ts new file mode 100644 index 00000000..c83b99b4 --- /dev/null +++ b/packages/core/src/Utils.ts @@ -0,0 +1,434 @@ +export function getHashCode(source: string): number { + if (!source || source.length === 0) { + return 0; + } + + let hash = 0; + for (let index = 0; index < source.length; index++) { + const character = source.charCodeAt(index); + hash = (hash << 5) - hash + character; + hash |= 0; + } + + return hash; +} + +export function getCookies(cookies: string, exclusions?: string[]): Record | null { + const result: Record = {}; + + const parts: string[] = (cookies || "").split("; "); + for (const part of parts) { + const cookie: string[] = part.split("="); + if (!isMatch(cookie[0], exclusions || [])) { + result[cookie[0]] = cookie[1]; + } + } + + return !isEmpty(result) ? result : null; +} + +export function guid(): string { + function s4() { + return Math.floor((1 + Math.random()) * 0x10000) + .toString(16) + .substring(1); + } + + return s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4(); +} + +export function parseVersion(source: string): string | null { + if (!source) { + return null; + } + + const versionRegex = /(v?((\d+)\.(\d+)(\.(\d+))?)(?:-([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?)/; + const matches = versionRegex.exec(source); + if (matches && matches.length > 0) { + return matches[0]; + } + + return null; +} + +export function parseQueryString(query: string, exclusions?: string[]): Record { + if (!query || query.length === 0) { + return {}; + } + + const pairs: string[] = query.split("&"); + if (pairs.length === 0) { + return {}; + } + + const result: Record = {}; + for (const pair of pairs) { + const parts = pair.split("="); + if (!exclusions || !isMatch(parts[0], exclusions)) { + result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]); + } + } + + return !isEmpty(result) ? result : {}; +} + +export function randomNumber(): number { + return Math.floor(Math.random() * 9007199254740992); +} + +/** + * Checks to see if a value matches a pattern. + * @param input the value to check against the @pattern. + * @param pattern The pattern to check, supports wild cards (*). + */ +export function isMatch(input: string | undefined, patterns: string[], ignoreCase = true): boolean { + if (typeof input !== "string") { + return false; + } + + const trim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; + input = (ignoreCase ? input.toLowerCase() : input).replace(trim, ""); + + return (patterns || []).some((pattern) => { + if (typeof pattern !== "string") { + return false; + } + + if (pattern) { + pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, ""); + } + + if (!pattern) { + return input === undefined || input === null; + } + + if (pattern === "*") { + return true; + } + + if (input === undefined || input === null) { + return false; + } + + const startsWithWildcard: boolean = pattern[0] === "*"; + if (startsWithWildcard) { + pattern = pattern.slice(1); + } + + const endsWithWildcard: boolean = pattern[pattern.length - 1] === "*"; + if (endsWithWildcard) { + pattern = pattern.substring(0, pattern.length - 1); + } + + if (startsWithWildcard && endsWithWildcard) { + return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1; + } + + if (startsWithWildcard) { + return endsWith(input, pattern); + } + + if (endsWithWildcard) { + return startsWith(input, pattern); + } + + return input === pattern; + }); +} + +/** + * Very simple implementation to check primitive types for emptiness. + * - If the input is null or undefined, it will return true. + * - If the input is an array, it will return true if the array is empty. + * - If the input is an object, it will return true if the object has no properties. + * - If the input is a string, it will return true if the string is empty or "{}" or "[]". + * @param input The input to check. + */ +export function isEmpty(input: Record | null | undefined | unknown): input is null | undefined | Record { + if (input === null || input === undefined) { + return true; + } + + if (typeof input === "object") { + if (Array.isArray(input)) { + return input.length === 0; + } + + if (input instanceof Date) { + return false; + } + + return Object.getOwnPropertyNames(input).length === 0; + } + + if (typeof input === "string") { + const trimmedInput = input.trim(); + return trimmedInput.length === 0 || trimmedInput === "{}" || trimmedInput === "[]"; + } + + return false; +} + +export function startsWith(input: string, prefix: string): boolean { + return input.substring(0, prefix.length) === prefix; +} + +export function endsWith(input: string, suffix: string): boolean { + return input.indexOf(suffix, input.length - suffix.length) !== -1; +} + +/** + * This function will prune an object to a certain depth and return a new object. + * The following rules will be applied: + * 1. If the value is null or undefined, it will be returned as is. + * 2. If the value is a function or unsupported type it will be return undefined. + * 3. If the value is an array, it will be pruned to the specified depth. + * 4. If the value is an object, it will be pruned to the specified depth and + * a. If the object is a Circular Reference it will return undefined. + * b. If the object is a Map, it will be converted to an object. Some data loss might occur if map keys are object types as last in wins. + * c. If the object is a Set, it will be converted to an array. + * d. If the object contains prototype properties, they will be picked up. + * e. If the object contains a toJSON function, it will be called and it's value will be normalized. + * f. If the object is is not iterable or cloneable (e.g., WeakMap, WeakSet, etc.), it will return undefined. + * g. If a symbol property is encountered, it will be converted to a string representation and could overwrite existing object keys. + * 5. If the value is an Error, we will treat it as an object. + * 6. If the value is a primitive, it will be returned as is. + * 7. If the value is a Regexp, Symbol we will convert it to the string representation. + * 8. BigInt and other typed arrays will be converted to a string unless number type works. + * 9. All other values will be returned as undefined (E.g., Buffer, DataView, Promises, Generators etc..) + */ +export function prune(value: unknown, depth: number = 10): unknown { + function isUnsupportedType(value: unknown): boolean { + if (value === null || value === undefined) { + return false; + } + + switch (typeof value) { + case "function": + return true; + case "object": + switch (Object.prototype.toString.call(value)) { + case "[object AsyncGenerator]": + case "[object Generator]": + case "[object ArrayBuffer]": + case "[object Buffer]": + case "[object DataView]": + case "[object Promise]": + case "[object WeakMap]": + case "[object WeakSet]": + return true; + } + + // Check for buffer; + if ("writeBigInt64LE" in value) { + return true; + } + + break; + } + + return false; + } + + function normalizeValue(value: unknown): unknown { + function hasToJSONFunction(value: unknown): value is { toJSON: () => unknown } { + return value !== null && typeof value === "object" && typeof (value as { toJSON?: unknown }).toJSON === "function"; + } + + if (typeof value === "bigint") { + return `${value.toString()}n`; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + return value; + } + + if (value instanceof Date) { + return value; + } + + if (value instanceof Map) { + const result: Record = {}; + for (const [key, val] of value) { + result[key] = val; + } + + return result; + } + + if (value instanceof RegExp) { + return value.toString(); + } + + if (value instanceof Set) { + return Array.from(value); + } + + // Check for typed arrays + const TypedArray = Object.getPrototypeOf(Uint8Array); + if (value instanceof TypedArray) { + return Array.from(value as Iterable); + } + + if (hasToJSONFunction(value)) { + // NOTE: We are not checking for circular references or overflow + return normalizeValue(value.toJSON()); + } + + return value; + } + + if (typeof value === "symbol") { + return value.description; + } + + return value; + } + + function pruneImpl( + value: unknown, + maxDepth: number, + currentDepth: number = 10, + seen: WeakSet = new WeakSet(), + parentIsArray: boolean = false + ): unknown { + if (value === null || value === undefined) { + return value; + } + + if (currentDepth > maxDepth) { + return undefined; + } + + if (isUnsupportedType(value)) { + return undefined; + } + + const normalizedValue = normalizeValue(value); + if (typeof normalizedValue === "object") { + if (currentDepth == maxDepth) { + return undefined; + } + + if (Array.isArray(normalizedValue)) { + // Treat an object inside of an array as a single level + const depth: number = parentIsArray ? currentDepth + 1 : currentDepth; + return normalizedValue.map((e) => pruneImpl(e, maxDepth, depth, seen, true)); + } + + if (normalizedValue instanceof Date) { + return normalizedValue; + } + + // Check for circular references + if (Object.prototype.toString.call(normalizedValue) === "[object Object]") { + if (seen.has(normalizedValue as object)) { + return undefined; + } + + seen.add(normalizedValue as object); + } + + const keys = new Set([...Object.getOwnPropertyNames(normalizedValue), ...Object.getOwnPropertySymbols(normalizedValue)]); + // Loop over and add any inherited prototype properties + for (const key in normalizedValue) { + keys.add(key); + } + + type NonSymbolPropertyKey = Exclude; + const result: Record = {}; + for (const key of keys) { + // Normalize the key so Symbols are converted to strings. + const normalizedKey = normalizeValue(key) as NonSymbolPropertyKey; + + const objectValue = (normalizedValue as { [index: PropertyKey]: unknown })[key]; + result[normalizedKey] = pruneImpl(objectValue, maxDepth, currentDepth + 1, seen); + } + + return result; + } + + return normalizedValue; + } + + if (depth < 0) { + return undefined; + } + + return pruneImpl(value, depth, 0); +} + +export function stringify(data: unknown, exclusions?: string[], maxDepth: number = 10): string | undefined { + function stringifyImpl(obj: unknown, excludedKeys: string[]): string { + return JSON.stringify(obj, (key: string, value: unknown) => { + if (isMatch(key, excludedKeys)) { + return; + } + + return value; + }); + } + + if (data === undefined) { + return data; + } + + const prunedData = prune(data, maxDepth); + return stringifyImpl(prunedData, exclusions || []); +} + +export function toBoolean(input: unknown, defaultValue: boolean = false): boolean { + if (typeof input === "boolean") { + return input; + } + + if (input === null || (typeof input !== "number" && typeof input !== "string")) { + return defaultValue; + } + + switch ((input + "").toLowerCase().trim()) { + case "true": + case "yes": + case "1": + return true; + case "false": + case "no": + case "0": + case null: + return false; + } + + return defaultValue; +} + +export function toError(errorOrMessage: unknown, defaultMessage = "Unknown Error"): Error { + if (errorOrMessage === null || errorOrMessage === undefined) { + const error = new Error(defaultMessage); + error.stack = undefined!; + return error; + } + + if (errorOrMessage instanceof Error) { + return errorOrMessage; + } + + if (typeof errorOrMessage === "string") { + const error = new Error(errorOrMessage); + error.stack = undefined!; + return error; + } + + const error = new Error(stringify(errorOrMessage) || defaultMessage); + error.stack = undefined!; + return error; +} + +/** + * Unrefs a timeout or interval. When called, the active Timeout object will not require the Node.js event loop to remain active + */ +export function allowProcessToExitWithoutWaitingForTimerOrInterval(timeoutOrIntervalId: ReturnType | undefined): void { + if (typeof timeoutOrIntervalId === "object" && "unref" in timeoutOrIntervalId) { + (timeoutOrIntervalId as { unref: () => ReturnType }).unref(); + } +} diff --git a/packages/core/src/configuration/Configuration.ts b/packages/core/src/configuration/Configuration.ts new file mode 100644 index 00000000..8992ac65 --- /dev/null +++ b/packages/core/src/configuration/Configuration.ts @@ -0,0 +1,551 @@ +import { DefaultLastReferenceIdManager } from "#/lastReferenceIdManager/DefaultLastReferenceIdManager.js"; +import { ILastReferenceIdManager } from "#/lastReferenceIdManager/ILastReferenceIdManager.js"; +import { ILog } from "#/logging/ILog.js"; +import { ConsoleLog } from "#/logging/ConsoleLog.js"; +import { NullLog } from "#/logging/NullLog.js"; +import { UserInfo } from "#/models/data/UserInfo.js"; +import { HeartbeatPlugin } from "#/plugins/default/HeartbeatPlugin.js"; +import { SessionIdManagementPlugin } from "#/plugins/default/SessionIdManagementPlugin.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { EventPluginManager } from "#/plugins/EventPluginManager.js"; +import { IEventPlugin } from "#/plugins/IEventPlugin.js"; +import { DefaultEventQueue } from "#/queue/DefaultEventQueue.js"; +import { IEventQueue } from "#/queue/IEventQueue.js"; +import { ISubmissionClient } from "#/submission/ISubmissionClient.js"; +import { DefaultSubmissionClient } from "#/submission/DefaultSubmissionClient.js"; +import { guid } from "#/Utils.js"; +import { KnownEventDataKeys } from "#/models/Event.js"; +import { InMemoryStorage } from "#/storage/InMemoryStorage.js"; +import { IStorage } from "#/storage/IStorage.js"; +import { LocalStorage } from "#/storage/LocalStorage.js"; +import { ServerSettings } from "#/configuration/SettingsManager.js"; + +export class Configuration { + constructor() { + this.services = { + lastReferenceIdManager: new DefaultLastReferenceIdManager(), + log: new NullLog(), + storage: new InMemoryStorage(), + queue: new DefaultEventQueue(this), + submissionClient: new DefaultSubmissionClient(this) + }; + + EventPluginManager.addDefaultPlugins(this); + } + + /** + * A default list of tags that will automatically be added to every + * report submitted to the server. + */ + public defaultTags: string[] = []; + + /** + * A default list of of extended data objects that will automatically + * be added to every report submitted to the server. + */ + public defaultData: Record = {}; + + /** + * Whether the client is currently enabled or not. If it is disabled, + * submitted errors will be discarded and no data will be sent to the server. + * + * @returns {boolean} + */ + public enabled = true; + + public services: IConfigurationServices; + + /** + * Maximum number of events that should be sent to the server together in a batch. (Defaults to 50) + */ + public submissionBatchSize = 50; + + /** + * Contains a dictionary of custom settings that can be used to control + * the client and will be automatically updated from the server. + */ + public settings: Record = {}; + public settingsVersion = 0; + + /** + * The API key that will be used when sending events to the server. + */ + public apiKey = ""; + + /** + * The server url that all events will be sent to. + * @type {string} + */ + private _serverUrl = "https://collector.exceptionless.io"; + + /** + * The config server url that all configuration will be retrieved from. + */ + public configServerUrl = "https://config.exceptionless.io"; + + /** + * The heartbeat server url that all heartbeats will be sent to. + */ + public heartbeatServerUrl = "https://heartbeat.exceptionless.io"; + + /** + * How often the client should check for updated server settings when idle. The default is every 2 minutes. + */ + private _updateSettingsWhenIdleInterval = 120000; + + /** + * A list of exclusion patterns. + */ + private _dataExclusions: string[] = []; + + private _includePrivateInformation = true; + private _includeUserName = true; + private _includeMachineName = true; + private _includeIpAddress = true; + private _includeHeaders = true; + private _includeCookies = true; + private _includePostData = true; + private _includeQueryString = true; + + /** + * A list of user agent patterns. + */ + private _userAgentBotPatterns: string[] = []; + + /** + * The list of plugins that will be used in this configuration. + */ + private _plugins: IEventPlugin[] = []; + + /** + * A list of subscribers that will be fired when configuration changes. + */ + private _subscribers: Array<(config: Configuration) => void> = []; + + /** + * Returns true if the apiKey is valid. + */ + public get isValid(): boolean { + return this.apiKey?.length >= 10; + } + + /** + * The server url that all events will be sent to. + */ + public get serverUrl(): string { + return this._serverUrl; + } + + /** + * The server url that all events will be sent to. + */ + public set serverUrl(value: string) { + if (value) { + this._serverUrl = value; + this.configServerUrl = value; + this.heartbeatServerUrl = value; + } + } + + /** + * How often the client should check for updated server settings when idle. The default is every 2 minutes. + */ + public get updateSettingsWhenIdleInterval(): number { + return this._updateSettingsWhenIdleInterval; + } + + /** + * How often the client should check for updated server settings when idle. The default is every 2 minutes. + */ + public set updateSettingsWhenIdleInterval(value: number) { + if (typeof value !== "number") { + return; + } + + if (value <= 0) { + value = -1; + } else if (value > 0 && value < 120000) { + value = 120000; + } + + this._updateSettingsWhenIdleInterval = value; + } + + /** + * A list of exclusion patterns that will automatically remove any data that + * matches them from any data submitted to the server. + * + * For example, entering CreditCard will remove any extended data properties, + * form fields, cookies and query parameters from the report. + */ + public get dataExclusions(): string[] { + // TODO: Known settings keys. + const exclusions: string = this.settings["@@DataExclusions"]; + return this._dataExclusions.concat((exclusions && exclusions.split(",")) || []); + } + + /** + * Add items to the list of exclusion patterns that will automatically remove any + * data that matches them from any data submitted to the server. + * + * For example, entering CreditCard will remove any extended data properties, form + * fields, cookies and query parameters from the report. + */ + public addDataExclusions(...exclusions: string[]): void { + this._dataExclusions = [...this._dataExclusions, ...exclusions]; + } + + /** + * Gets a value indicating whether to include private information about the local machine. + */ + public get includePrivateInformation(): boolean { + return this._includePrivateInformation; + } + + /** + * Sets a value indicating whether to include private information about the local machine + */ + public set includePrivateInformation(value: boolean) { + const val = value === true; + this._includePrivateInformation = val; + this._includeUserName = val; + this._includeMachineName = val; + this._includeIpAddress = val; + this._includeHeaders = val; + this._includeCookies = val; + this._includePostData = val; + this._includeQueryString = val; + } + + /** + * Gets a value indicating whether to include User Name. + */ + public get includeUserName(): boolean { + return this._includeUserName; + } + + /** + * Sets a value indicating whether to include User Name. + */ + public set includeUserName(value: boolean) { + this._includeUserName = value === true; + } + + /** + * Gets a value indicating whether to include MachineName in MachineInfo. + */ + public get includeMachineName(): boolean { + return this._includeMachineName; + } + + /** + * Sets a value indicating whether to include MachineName in MachineInfo. + */ + public set includeMachineName(value: boolean) { + this._includeMachineName = value === true; + } + + /** + * Gets a value indicating whether to include Ip Addresses in MachineInfo and RequestInfo. + */ + public get includeIpAddress(): boolean { + return this._includeIpAddress; + } + + /** + * Sets a value indicating whether to include Ip Addresses in MachineInfo and RequestInfo. + */ + public set includeIpAddress(value: boolean) { + this._includeIpAddress = value === true; + } + + /** + * Gets a value indicating whether to include Headers. + * NOTE: DataExclusions are applied to all Header keys when enabled. + */ + public get includeHeaders(): boolean { + return this._includeHeaders; + } + + /** + * Sets a value indicating whether to include Headers. + * NOTE: DataExclusions are applied to all Headers keys when enabled. + */ + public set includeHeaders(value: boolean) { + this._includeHeaders = value === true; + } + + /** + * Gets a value indicating whether to include Cookies. + * NOTE: DataExclusions are applied to all Cookie keys when enabled. + */ + public get includeCookies(): boolean { + return this._includeCookies; + } + + /** + * Sets a value indicating whether to include Cookies. + * NOTE: DataExclusions are applied to all Cookie keys when enabled. + */ + public set includeCookies(value: boolean) { + this._includeCookies = value === true; + } + + /** + * Gets a value indicating whether to include Form/POST Data. + * NOTE: DataExclusions are only applied to Form data keys when enabled. + */ + public get includePostData(): boolean { + return this._includePostData; + } + + /** + * Sets a value indicating whether to include Form/POST Data. + * NOTE: DataExclusions are only applied to Form data keys when enabled. + */ + public set includePostData(value: boolean) { + this._includePostData = value === true; + } + + /** + * Gets a value indicating whether to include query string information. + * NOTE: DataExclusions are applied to all Query String keys when enabled. + */ + public get includeQueryString(): boolean { + return this._includeQueryString; + } + + /** + * Sets a value indicating whether to include query string information. + * NOTE: DataExclusions are applied to all Query String keys when enabled. + */ + public set includeQueryString(value: boolean) { + this._includeQueryString = value === true; + } + + /** + * A list of user agent patterns that will cause any event with a matching user agent to not be submitted. + * + * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted. + */ + public get userAgentBotPatterns(): string[] { + // TODO: Known settings keys. + const patterns: string = this.settings["@@UserAgentBotPatterns"]; + return this._userAgentBotPatterns.concat((patterns && patterns.split(",")) || []); + } + + /** + * Add items to the list of user agent patterns that will cause any event with a matching user agent to not be submitted. + * + * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted. + */ + public addUserAgentBotPatterns(...userAgentBotPatterns: string[]): void { + this._userAgentBotPatterns = [...this._userAgentBotPatterns, ...userAgentBotPatterns]; + } + + /** + * The list of plugins that will be used in this configuration. + */ + public get plugins(): IEventPlugin[] { + return this._plugins.sort((p1: IEventPlugin, p2: IEventPlugin) => { + if (p1 == null && p2 == null) { + return 0; + } + + if (p1?.priority == null) { + return -1; + } + + if (p2?.priority == null) { + return 1; + } + + if (p1.priority == p2.priority) { + return 0; + } + + return p1.priority > p2.priority ? 1 : -1; + }); + } + + /** + * Register an plugin to be used in this configuration. + */ + public addPlugin(plugin: IEventPlugin): void; + + /** + * Register an plugin to be used in this configuration. + */ + public addPlugin(name: string | undefined, priority: number, pluginAction: (context: EventPluginContext) => Promise): void; + public addPlugin(pluginOrName: IEventPlugin | string | undefined, priority?: number, pluginAction?: (context: EventPluginContext) => Promise): void { + const plugin: IEventPlugin = pluginAction ? { name: pluginOrName as string, priority, run: pluginAction } : (pluginOrName as IEventPlugin); + + if (!plugin || !(plugin.startup || plugin.run)) { + this.services.log.error("Add plugin failed: startup or run method not defined"); + return; + } + + if (!plugin.name) { + plugin.name = guid(); + } + + if (!plugin.priority) { + plugin.priority = 0; + } + + if (!this._plugins.find((f) => f.name === plugin.name)) { + this._plugins.push(plugin); + } + } + + /** + * Remove an plugin by key from this configuration. + */ + public removePlugin(pluginOrName: IEventPlugin | string): void { + const name: string = typeof pluginOrName === "string" ? pluginOrName : pluginOrName.name || ""; + if (!name) { + this.services.log.error("Remove plugin failed: Plugin name not defined"); + return; + } + + const plugins = this._plugins; // optimization for minifier. + for (let index = 0; index < plugins.length; index++) { + if (plugins[index].name === name) { + plugins.splice(index, 1); + break; + } + } + } + + /** + * The application version for events. + */ + public get version(): string { + return this.defaultData[KnownEventDataKeys.Version]; + } + + /** + * Set the application version for events. + */ + public set version(version: string) { + if (version) { + this.defaultData[KnownEventDataKeys.Version] = version; + } else { + delete this.defaultData[KnownEventDataKeys.Version]; + } + } + + /** + * Set the default user identity for all events. + */ + public setUserIdentity(userInfo: UserInfo): void; + public setUserIdentity(identity: string): void; + public setUserIdentity(identity: string, name: string): void; + public setUserIdentity(userInfoOrIdentity: UserInfo | string, name?: string): void { + const userInfo: UserInfo = typeof userInfoOrIdentity !== "string" ? userInfoOrIdentity : { identity: userInfoOrIdentity, name }; + + const shouldRemove: boolean = !userInfo || (!userInfo.identity && !userInfo.name); + if (shouldRemove) { + delete this.defaultData[KnownEventDataKeys.UserInfo]; + } else { + this.defaultData[KnownEventDataKeys.UserInfo] = userInfo; + } + + this.services.log.info(`user identity: ${shouldRemove ? "null" : userInfo.identity}`); + } + + /** + * Used to identify the client that sent the events to the server. + */ + public get userAgent(): string { + return "exceptionless-js/3.0.0-dev"; + } + + /** + * Use localStorage for persisting things like server configuration cache and persisted queue entries (depends on usePersistedQueueStorage). + */ + public useLocalStorage(): void { + if (globalThis?.localStorage) { + this.services.storage = new LocalStorage(); + } + } + + /** + * Writes events to storage on enqueue and removes them when submitted. (Defaults to false) + * This setting only works in environments that supports persisted storage. + * There is also a performance penalty of extra IO/serialization. + */ + public usePersistedQueueStorage: boolean = false; + + /** + * Gets or sets a value indicating whether to automatically send session start, + * session heartbeats and session end events. + */ + public sessionsEnabled = false; + + /** + * Internal property used to track the current session identifier. + */ + public currentSessionIdentifier: string | null = null; + + /** + * + * @param sendHeartbeats Controls whether heartbeat events are sent on an interval. + * @param heartbeatInterval The interval at which heartbeats are sent after the last sent event. The default is 1 minutes. + * @param useSessionIdManagement Allows you to manually control the session id. This is only recommended for single user desktop environments. + */ + public useSessions(sendHeartbeats: boolean = true, heartbeatInterval: number = 60000, useSessionIdManagement: boolean = false) { + this.sessionsEnabled = true; + + if (useSessionIdManagement) { + this.addPlugin(new SessionIdManagementPlugin()); + } + + const plugin = new HeartbeatPlugin(heartbeatInterval); + if (sendHeartbeats) { + this.addPlugin(plugin); + } else { + this.removePlugin(plugin); + } + } + + private originalSettings?: Record; + + public applyServerSettings(serverSettings: ServerSettings): void { + if (!this.originalSettings) { + this.originalSettings = JSON.parse(JSON.stringify(this.settings)) as Record; + } + + this.services.log.trace(`Applying saved settings: v${serverSettings.version}`); + this.settings = Object.assign(this.originalSettings, serverSettings.settings); + this.settingsVersion = serverSettings.version; + this.notifySubscribers(); + } + + // TODO: Support a min log level. + public useDebugLogger(): void { + this.services.log = new ConsoleLog(); + } + + public subscribeServerSettingsChange(handler: (config: Configuration) => void): void { + handler && this._subscribers.push(handler); + } + + private notifySubscribers() { + for (const handler of this._subscribers) { + try { + handler(this); + } catch (ex) { + this.services.log.error(`Error calling subscribe handler: ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + } +} + +interface IConfigurationServices { + lastReferenceIdManager: ILastReferenceIdManager; + log: ILog; + submissionClient: ISubmissionClient; + storage: IStorage; + queue: IEventQueue; +} diff --git a/packages/core/src/configuration/SettingsManager.ts b/packages/core/src/configuration/SettingsManager.ts new file mode 100644 index 00000000..326ed2c3 --- /dev/null +++ b/packages/core/src/configuration/SettingsManager.ts @@ -0,0 +1,75 @@ +import { Configuration } from "#/configuration/Configuration.js"; + +export class ServerSettings { + constructor( + public settings: Record, + public version: number + ) {} +} + +export class SettingsManager { + private static readonly SettingsKey: string = "settings"; + private static _isUpdatingSettings = false; + + public static async applySavedServerSettings(config: Configuration): Promise { + if (!config?.isValid) { + return; + } + + const savedSettings = await this.getSavedServerSettings(config); + if (savedSettings) { + config.applyServerSettings(savedSettings); + } + } + + public static async updateSettings(config: Configuration): Promise { + if (!config?.enabled || this._isUpdatingSettings) { + return; + } + + this._isUpdatingSettings = true; + const { log, storage, submissionClient } = config.services; + + try { + const unableToUpdateMessage = "Unable to update settings"; + if (!config.isValid) { + log.error(`${unableToUpdateMessage}: ApiKey is not set`); + return; + } + + const version = config.settingsVersion; + log.trace(`Checking for updated settings from: v${version}`); + const response = await submissionClient.getSettings(version); + + if (response.status === 304) { + log.trace("Settings are up-to-date"); + return; + } + + if (!response?.success || !response.data) { + log.warn(`${unableToUpdateMessage}: ${response.message}`); + return; + } + + config.applyServerSettings(response.data); + + await storage.setItem(SettingsManager.SettingsKey, JSON.stringify(response.data)); + log.trace(`Updated settings: v${response.data.version}`); + } catch (ex) { + log.error(`Error updating settings: ${ex instanceof Error ? ex.message : ex + ""}`); + } finally { + this._isUpdatingSettings = false; + } + } + + private static async getSavedServerSettings(config: Configuration): Promise { + const { log, storage } = config.services; + try { + const settings = await storage.getItem(SettingsManager.SettingsKey); + return (settings && (JSON.parse(settings) as ServerSettings)) || new ServerSettings({}, 0); + } catch (ex) { + log.error(`Error getting saved settings: ${ex instanceof Error ? ex.message : ex + ""}`); + return new ServerSettings({}, 0); + } + } +} diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts new file mode 100644 index 00000000..45cea14d --- /dev/null +++ b/packages/core/src/index.ts @@ -0,0 +1,65 @@ +export { Configuration } from "#/configuration/Configuration.js"; +export { SettingsManager } from "#/configuration/SettingsManager.js"; + +export { DefaultLastReferenceIdManager } from "#/lastReferenceIdManager/DefaultLastReferenceIdManager.js"; +export type { ILastReferenceIdManager } from "#/lastReferenceIdManager/ILastReferenceIdManager.js"; + +export type { ILog } from "#/logging/ILog.js"; +export { ConsoleLog } from "#/logging/ConsoleLog.js"; +export { NullLog } from "#/logging/NullLog.js"; + +export type { Event, EventType, IEventData, LogLevel } from "#/models/Event.js"; +export { KnownEventDataKeys } from "#/models/Event.js"; +export type { EnvironmentInfo } from "#/models/data/EnvironmentInfo.js"; +export type { ManualStackingInfo } from "#/models/data/ManualStackingInfo.js"; +export type { RequestInfo } from "#/models/data/RequestInfo.js"; +export type { UserDescription } from "#/models/data/UserDescription.js"; +export type { UserInfo } from "#/models/data/UserInfo.js"; +export type { ModuleInfo } from "#/models/data/ModuleInfo.js"; + +export type { SimpleError, ErrorInfo, InnerErrorInfo, MethodInfo, ParameterInfo, StackFrameInfo } from "#/models/data/ErrorInfo.js"; + +export { ConfigurationDefaultsPlugin } from "#/plugins/default/ConfigurationDefaultsPlugin.js"; +export { DuplicateCheckerPlugin } from "#/plugins/default/DuplicateCheckerPlugin.js"; +export { EventExclusionPlugin } from "#/plugins/default/EventExclusionPlugin.js"; +export { HeartbeatPlugin } from "#/plugins/default/HeartbeatPlugin.js"; +export { ReferenceIdPlugin } from "#/plugins/default/ReferenceIdPlugin.js"; +export { SessionIdManagementPlugin } from "#/plugins/default/SessionIdManagementPlugin.js"; +export { IgnoredErrorProperties, SimpleErrorPlugin } from "#/plugins/default/SimpleErrorPlugin.js"; +export { SubmissionMethodPlugin } from "#/plugins/default/SubmissionMethodPlugin.js"; +export { EventContext } from "#/models/EventContext.js"; +export { PluginContext } from "#/plugins/PluginContext.js"; +export { EventPluginContext } from "#/plugins/EventPluginContext.js"; +export { EventPluginManager } from "#/plugins/EventPluginManager.js"; +export type { IEventPlugin } from "#/plugins/IEventPlugin.js"; + +export { DefaultEventQueue } from "#/queue/DefaultEventQueue.js"; +export type { IEventQueue } from "#/queue/IEventQueue.js"; + +export { InMemoryStorage } from "#/storage/InMemoryStorage.js"; +export { LocalStorage } from "#/storage/LocalStorage.js"; +export type { IStorage } from "#/storage/IStorage.js"; + +export type { ISubmissionClient } from "#/submission/ISubmissionClient.js"; +export { Response } from "#/submission/Response.js"; +export type { FetchOptions } from "#/submission/DefaultSubmissionClient.js"; +export { DefaultSubmissionClient } from "#/submission/DefaultSubmissionClient.js"; +export { EventBuilder } from "#/EventBuilder.js"; +export { ExceptionlessClient } from "#/ExceptionlessClient.js"; + +export { + endsWith, + getCookies, + getHashCode, + guid, + isEmpty, + isMatch, + parseQueryString, + parseVersion, + prune, + randomNumber, + startsWith, + stringify, + toBoolean, + toError +} from "#/Utils.js"; diff --git a/src/lastReferenceIdManager/DefaultLastReferenceIdManager.ts b/packages/core/src/lastReferenceIdManager/DefaultLastReferenceIdManager.ts similarity index 71% rename from src/lastReferenceIdManager/DefaultLastReferenceIdManager.ts rename to packages/core/src/lastReferenceIdManager/DefaultLastReferenceIdManager.ts index a32c1e99..7d02d5d9 100644 --- a/src/lastReferenceIdManager/DefaultLastReferenceIdManager.ts +++ b/packages/core/src/lastReferenceIdManager/DefaultLastReferenceIdManager.ts @@ -1,18 +1,15 @@ -import { ILastReferenceIdManager } from './ILastReferenceIdManager'; +import { ILastReferenceIdManager } from "#/lastReferenceIdManager/ILastReferenceIdManager.js"; export class DefaultLastReferenceIdManager implements ILastReferenceIdManager { /** * Gets the last event's reference id that was submitted to the server. - * @type {string} - * @private */ - private _lastReferenceId: string = null; + private _lastReferenceId: string | null = null; /** * Gets the last event's reference id that was submitted to the server. - * @returns {string} */ - public getLast(): string { + public getLast(): string | null { return this._lastReferenceId; } @@ -25,7 +22,6 @@ export class DefaultLastReferenceIdManager implements ILastReferenceIdManager { /** * Sets the last event's reference id. - * @param eventId */ public setLast(eventId: string): void { this._lastReferenceId = eventId; diff --git a/src/lastReferenceIdManager/ILastReferenceIdManager.ts b/packages/core/src/lastReferenceIdManager/ILastReferenceIdManager.ts similarity index 78% rename from src/lastReferenceIdManager/ILastReferenceIdManager.ts rename to packages/core/src/lastReferenceIdManager/ILastReferenceIdManager.ts index 65edf119..84907f35 100644 --- a/src/lastReferenceIdManager/ILastReferenceIdManager.ts +++ b/packages/core/src/lastReferenceIdManager/ILastReferenceIdManager.ts @@ -1,5 +1,5 @@ export interface ILastReferenceIdManager { - getLast(): string; + getLast(): string | null; clearLast(): void; setLast(eventId: string): void; } diff --git a/packages/core/src/logging/ConsoleLog.ts b/packages/core/src/logging/ConsoleLog.ts new file mode 100644 index 00000000..78e7ea75 --- /dev/null +++ b/packages/core/src/logging/ConsoleLog.ts @@ -0,0 +1,31 @@ +import { ILog } from "#/logging/ILog.js"; + +export class ConsoleLog implements ILog { + public trace(message: string): void { + this.log("debug", message); + } + + public info(message: string): void { + this.log("info", message); + } + + public warn(message: string): void { + this.log("warn", message); + } + + public error(message: string): void { + this.log("error", message); + } + + private log(level: keyof Console, message: string) { + if (console) { + const msg = `Exceptionless:${new Date().toISOString()} [${level}] ${message}`; + const logFn = console[level] as (msg: string) => void; + if (logFn) { + logFn(msg); + } else if (console["log"]) { + console["log"](msg); + } + } + } +} diff --git a/src/logging/ILog.ts b/packages/core/src/logging/ILog.ts similarity index 100% rename from src/logging/ILog.ts rename to packages/core/src/logging/ILog.ts diff --git a/packages/core/src/logging/NullLog.ts b/packages/core/src/logging/NullLog.ts new file mode 100644 index 00000000..6e9998de --- /dev/null +++ b/packages/core/src/logging/NullLog.ts @@ -0,0 +1,17 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import { ILog } from "#/logging/ILog.js"; + +export class NullLog implements ILog { + public trace(_: string): void { + /* empty */ + } + public info(_: string): void { + /* empty */ + } + public warn(_: string): void { + /* empty */ + } + public error(_: string): void { + /* empty */ + } +} diff --git a/packages/core/src/models/Event.ts b/packages/core/src/models/Event.ts new file mode 100644 index 00000000..bc3c8186 --- /dev/null +++ b/packages/core/src/models/Event.ts @@ -0,0 +1,60 @@ +import { ErrorInfo, SimpleError } from "#/models/data/ErrorInfo.js"; +import { EnvironmentInfo } from "#/models/data/EnvironmentInfo.js"; +import { RequestInfo } from "#/models/data/RequestInfo.js"; +import { UserInfo } from "#/models/data/UserInfo.js"; +import { UserDescription } from "#/models/data/UserDescription.js"; +import { ManualStackingInfo } from "#/models/data/ManualStackingInfo.js"; + +export type EventType = "error" | "usage" | "log" | "404" | "session" | string; + +export interface Event { + /** The event type (ie. error, log message, feature usage). */ + type?: EventType; + /** The event source (ie. machine name, log name, feature name). */ + source?: string; + /** The date that the event occurred on. */ + date?: Date; + /** A list of tags used to categorize this event. */ + tags?: string[]; + /** The event message. */ + message?: string; + /** The geo coordinates where the event happened. */ + geo?: string; + /** The value of the event if any. */ + value?: number; + /** The number of duplicated events. */ + count?: number; + /** An optional identifier to be used for referencing this event instance at a later time. */ + reference_id?: string; + /** Optional data entries that contain additional information about this event. */ + data?: IEventData; +} + +export enum KnownEventDataKeys { + Error = "@error", + SimpleError = "@simple_error", + RequestInfo = "@request", + TraceLog = "@trace", + EnvironmentInfo = "@environment", + UserInfo = "@user", + UserDescription = "@user_description", + Version = "@version", + Level = "@level", + SubmissionMethod = "@submission_method", + ManualStackingInfo = "@stack" +} + +export type LogLevel = "trace" | "debug" | "info" | "warn" | "error" | "fatal" | string; + +export interface IEventData extends Record { + "@error"?: ErrorInfo; + "@simple_error"?: SimpleError; + "@request"?: RequestInfo; + "@environment"?: EnvironmentInfo; + "@user"?: UserInfo; + "@user_description"?: UserDescription; + "@version"?: string; + "@level"?: LogLevel; + "@submission_method"?: string; + "@stack"?: ManualStackingInfo; +} diff --git a/packages/core/src/models/EventContext.ts b/packages/core/src/models/EventContext.ts new file mode 100644 index 00000000..1629daae --- /dev/null +++ b/packages/core/src/models/EventContext.ts @@ -0,0 +1,41 @@ +const enum KnownContextKeys { + Exception = "@@_Exception", + IsUnhandledError = "@@_IsUnhandledError", + SubmissionMethod = "@@_SubmissionMethod" +} + +export class EventContext implements Record { + [x: string]: unknown; + + public getException(): Error | null { + return (this[KnownContextKeys.Exception] as Error) || null; + } + + public setException(exception: Error): void { + if (exception) { + this[KnownContextKeys.Exception] = exception; + } + } + + public get hasException(): boolean { + return !!this[KnownContextKeys.Exception]; + } + + public markAsUnhandledError(): void { + this[KnownContextKeys.IsUnhandledError] = true; + } + + public get isUnhandledError(): boolean { + return !!this[KnownContextKeys.IsUnhandledError]; + } + + public getSubmissionMethod(): string | null { + return (this[KnownContextKeys.SubmissionMethod] as string) || null; + } + + public setSubmissionMethod(method: string): void { + if (method) { + this[KnownContextKeys.SubmissionMethod] = method; + } + } +} diff --git a/src/models/IEnvironmentInfo.ts b/packages/core/src/models/data/EnvironmentInfo.ts similarity index 85% rename from src/models/IEnvironmentInfo.ts rename to packages/core/src/models/data/EnvironmentInfo.ts index d2b61006..f05f41cd 100644 --- a/src/models/IEnvironmentInfo.ts +++ b/packages/core/src/models/data/EnvironmentInfo.ts @@ -1,4 +1,4 @@ -export interface IEnvironmentInfo { +export interface EnvironmentInfo { processor_count?: number; total_physical_memory?: number; available_physical_memory?: number; @@ -14,5 +14,5 @@ export interface IEnvironmentInfo { machine_name?: string; install_id?: string; runtime_version?: string; - data?: any; + data?: Record; } diff --git a/packages/core/src/models/data/ErrorInfo.ts b/packages/core/src/models/data/ErrorInfo.ts new file mode 100644 index 00000000..b4654729 --- /dev/null +++ b/packages/core/src/models/data/ErrorInfo.ts @@ -0,0 +1,48 @@ +import { ModuleInfo } from "#/models/data/ModuleInfo.js"; + +export interface SimpleError { + message?: string; + type?: string; + stack_trace?: string; + data?: Record; + inner?: SimpleError; +} + +export interface InnerErrorInfo { + message?: string; + type?: string; + code?: string; + data?: Record; + inner?: InnerErrorInfo; + stack_trace?: StackFrameInfo[]; + target_method?: MethodInfo; +} + +export interface ErrorInfo extends InnerErrorInfo { + modules?: ModuleInfo[]; +} + +export interface MethodInfo { + data?: Record; + generic_arguments?: string[]; + parameters?: ParameterInfo[]; + is_signature_target?: boolean; + declaring_namespace?: string; + declaring_type?: string; + name?: string; + module_id?: number; +} + +export interface ParameterInfo { + data?: Record; + generic_arguments?: string[]; + name?: string; + type?: string; + type_namespace?: string; +} + +export interface StackFrameInfo extends MethodInfo { + file_name?: string; + line_number?: number; + column?: number; +} diff --git a/packages/core/src/models/data/ManualStackingInfo.ts b/packages/core/src/models/data/ManualStackingInfo.ts new file mode 100644 index 00000000..93a08d0e --- /dev/null +++ b/packages/core/src/models/data/ManualStackingInfo.ts @@ -0,0 +1,4 @@ +export interface ManualStackingInfo { + title?: string; + signature_data?: Record; +} diff --git a/src/models/IModule.ts b/packages/core/src/models/data/ModuleInfo.ts similarity index 67% rename from src/models/IModule.ts rename to packages/core/src/models/data/ModuleInfo.ts index a52ed727..93144243 100644 --- a/src/models/IModule.ts +++ b/packages/core/src/models/data/ModuleInfo.ts @@ -1,6 +1,5 @@ -export interface IModule { - data?: any; - +export interface ModuleInfo { + data?: Record; module_id?: number; name?: string; version?: string; diff --git a/packages/core/src/models/data/RequestInfo.ts b/packages/core/src/models/data/RequestInfo.ts new file mode 100644 index 00000000..7c87f7f9 --- /dev/null +++ b/packages/core/src/models/data/RequestInfo.ts @@ -0,0 +1,15 @@ +export interface RequestInfo { + user_agent?: string; + http_method?: string; + is_secure?: boolean; + host?: string; + port?: number; + path?: string; + referrer?: string; + client_ip_address?: string; + headers?: Record; + cookies?: Record; + post_data?: Record; + query_string?: Record; + data?: Record; +} diff --git a/packages/core/src/models/data/UserDescription.ts b/packages/core/src/models/data/UserDescription.ts new file mode 100644 index 00000000..c1d0fa63 --- /dev/null +++ b/packages/core/src/models/data/UserDescription.ts @@ -0,0 +1,5 @@ +export interface UserDescription { + email_address?: string; + description: string; + data?: Record; +} diff --git a/packages/core/src/models/data/UserInfo.ts b/packages/core/src/models/data/UserInfo.ts new file mode 100644 index 00000000..5420bfa2 --- /dev/null +++ b/packages/core/src/models/data/UserInfo.ts @@ -0,0 +1,5 @@ +export interface UserInfo { + identity?: string; + name?: string; + data?: Record; +} diff --git a/packages/core/src/plugins/EventPluginContext.ts b/packages/core/src/plugins/EventPluginContext.ts new file mode 100644 index 00000000..15663076 --- /dev/null +++ b/packages/core/src/plugins/EventPluginContext.ts @@ -0,0 +1,20 @@ +import { ExceptionlessClient } from "#/ExceptionlessClient.js"; +import { ILog } from "#/logging/ILog.js"; +import { Event } from "#/models/Event.js"; +import { EventContext } from "#/models/EventContext.js"; + +export class EventPluginContext { + public cancelled: boolean = false; + + constructor( + public client: ExceptionlessClient, + public event: Event, + public eventContext: EventContext + ) { + if (!this.eventContext) this.eventContext = new EventContext(); + } + + public get log(): ILog { + return this.client.config.services.log; + } +} diff --git a/packages/core/src/plugins/EventPluginManager.ts b/packages/core/src/plugins/EventPluginManager.ts new file mode 100644 index 00000000..12d695e2 --- /dev/null +++ b/packages/core/src/plugins/EventPluginManager.ts @@ -0,0 +1,67 @@ +import { Configuration } from "#/configuration/Configuration.js"; +import { ConfigurationDefaultsPlugin } from "#/plugins/default/ConfigurationDefaultsPlugin.js"; +import { DuplicateCheckerPlugin } from "#/plugins/default/DuplicateCheckerPlugin.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { EventExclusionPlugin } from "#/plugins/default/EventExclusionPlugin.js"; +import { PluginContext } from "#/plugins/PluginContext.js"; +import { ReferenceIdPlugin } from "#/plugins/default/ReferenceIdPlugin.js"; +import { SimpleErrorPlugin } from "#/plugins/default/SimpleErrorPlugin.js"; +import { SubmissionMethodPlugin } from "#/plugins/default/SubmissionMethodPlugin.js"; + +export class EventPluginManager { + public static async startup(context: PluginContext): Promise { + for (const plugin of context.client.config.plugins) { + if (!plugin.startup) { + continue; + } + + try { + await plugin.startup(context); + } catch (ex) { + context.log.error(`Error running plugin startup"${plugin.name}": ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + } + + public static async suspend(context: PluginContext): Promise { + for (const plugin of context.client.config.plugins) { + if (!plugin.suspend) { + continue; + } + + try { + await plugin.suspend(context); + } catch (ex) { + context.log.error(`Error running plugin suspend"${plugin.name}": ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + } + + public static async run(context: EventPluginContext): Promise { + for (const plugin of context.client.config.plugins) { + if (context.cancelled) { + break; + } + + if (!plugin.run) { + continue; + } + + try { + await plugin.run(context); + } catch (ex) { + context.cancelled = true; + context.log.error(`Error running plugin "${plugin.name}": ${ex instanceof Error ? ex.message : ex + ""}. Discarding Event.`); + } + } + } + + public static addDefaultPlugins(config: Configuration): void { + config.addPlugin(new ConfigurationDefaultsPlugin()); + config.addPlugin(new SimpleErrorPlugin()); + config.addPlugin(new ReferenceIdPlugin()); + config.addPlugin(new DuplicateCheckerPlugin()); + config.addPlugin(new EventExclusionPlugin()); + config.addPlugin(new SubmissionMethodPlugin()); + } +} diff --git a/packages/core/src/plugins/IEventPlugin.ts b/packages/core/src/plugins/IEventPlugin.ts new file mode 100644 index 00000000..2df5539a --- /dev/null +++ b/packages/core/src/plugins/IEventPlugin.ts @@ -0,0 +1,10 @@ +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { PluginContext } from "#/plugins/PluginContext.js"; + +export interface IEventPlugin { + priority?: number; + name?: string; + startup?(context: PluginContext): Promise; + suspend?(context: PluginContext): Promise; + run?(context: EventPluginContext): Promise; +} diff --git a/packages/core/src/plugins/PluginContext.ts b/packages/core/src/plugins/PluginContext.ts new file mode 100644 index 00000000..48d20b53 --- /dev/null +++ b/packages/core/src/plugins/PluginContext.ts @@ -0,0 +1,10 @@ +import { ExceptionlessClient } from "#/ExceptionlessClient.js"; +import { ILog } from "#/logging/ILog.js"; + +export class PluginContext { + constructor(public client: ExceptionlessClient) {} + + public get log(): ILog { + return this.client.config.services.log; + } +} diff --git a/packages/core/src/plugins/default/ConfigurationDefaultsPlugin.ts b/packages/core/src/plugins/default/ConfigurationDefaultsPlugin.ts new file mode 100644 index 00000000..b5aa15f7 --- /dev/null +++ b/packages/core/src/plugins/default/ConfigurationDefaultsPlugin.ts @@ -0,0 +1,36 @@ +import { isEmpty, stringify } from "#/Utils.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { IEventPlugin } from "#/plugins/IEventPlugin.js"; + +export class ConfigurationDefaultsPlugin implements IEventPlugin { + public priority = 10; + public name = "ConfigurationDefaultsPlugin"; + + public run(context: EventPluginContext): Promise { + const { dataExclusions, defaultData, defaultTags } = context.client.config; + const ev = context.event; + + if (defaultTags) { + ev.tags = [...(ev.tags || []), ...defaultTags]; + } + + if (defaultData) { + if (!ev.data) { + ev.data = {}; + } + + for (const key in defaultData) { + if (ev.data[key] !== undefined || isEmpty(defaultData[key])) { + continue; + } + + const data = stringify(defaultData[key], dataExclusions); + if (!isEmpty(data)) { + ev.data[key] = JSON.parse(data); + } + } + } + + return Promise.resolve(); + } +} diff --git a/packages/core/src/plugins/default/DuplicateCheckerPlugin.ts b/packages/core/src/plugins/default/DuplicateCheckerPlugin.ts new file mode 100644 index 00000000..a0f82ccf --- /dev/null +++ b/packages/core/src/plugins/default/DuplicateCheckerPlugin.ts @@ -0,0 +1,123 @@ +import { InnerErrorInfo } from "#/models/data/ErrorInfo.js"; +import { KnownEventDataKeys } from "#/models/Event.js"; +import { allowProcessToExitWithoutWaitingForTimerOrInterval, getHashCode } from "#/Utils.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { IEventPlugin } from "#/plugins/IEventPlugin.js"; + +export class DuplicateCheckerPlugin implements IEventPlugin { + public priority = 1010; + public name = "DuplicateCheckerPlugin"; + + private _mergedEvents: MergedEvent[] = []; + private _processedHashCodes: TimestampedHash[] = []; + private _getCurrentTime: () => number; + private _intervalId: ReturnType | undefined; + private _interval: number; + + constructor(getCurrentTime: () => number = () => Date.now(), interval: number = 30000) { + this._getCurrentTime = getCurrentTime; + this._interval = interval; + } + + public startup(): Promise { + clearInterval(this._intervalId); + this._intervalId = setInterval(() => void this.submitEvents(), this._interval); + allowProcessToExitWithoutWaitingForTimerOrInterval(this._intervalId); + return Promise.resolve(); + } + + public async suspend(): Promise { + clearInterval(this._intervalId); + this._intervalId = undefined; + await this.submitEvents(); + } + + public run(context: EventPluginContext): Promise { + function calculateHashCode(error: InnerErrorInfo | undefined): number { + let hash = 0; + while (error) { + if (error.message && error.message.length) { + hash += (hash * 397) ^ getHashCode(error.message); + } + if (error.stack_trace && error.stack_trace.length) { + hash += (hash * 397) ^ getHashCode(JSON.stringify(error.stack_trace)); + } + error = error.inner; + } + + return hash; + } + + const error = context.event.data?.[KnownEventDataKeys.Error]; + const hashCode = calculateHashCode(error); + if (hashCode) { + const count = context.event.count || 1; + const now = this._getCurrentTime(); + + const merged = this._mergedEvents.filter((s) => s.hashCode === hashCode)[0]; + if (merged) { + merged.incrementCount(count); + merged.updateDate(context.event.date); + context.log.info("Ignoring duplicate event with hash: " + hashCode); + context.cancelled = true; + } + + if (!context.cancelled && this._processedHashCodes.some((h) => h.hash === hashCode && h.timestamp >= now - this._interval)) { + context.log.trace("Adding event with hash: " + hashCode); + this._mergedEvents.push(new MergedEvent(hashCode, context, count)); + context.cancelled = true; + } + + if (!context.cancelled) { + context.log.trace(`Enqueueing event with hash: ${hashCode} to cache`); + this._processedHashCodes.push({ hash: hashCode, timestamp: now }); + + // Only keep the last 50 recent errors. + while (this._processedHashCodes.length > 50) { + this._processedHashCodes.shift(); + } + } + } + + return Promise.resolve(); + } + + private async submitEvents(): Promise { + while (this._mergedEvents.length > 0) { + await this._mergedEvents.shift()?.resubmit(); + } + } +} + +interface TimestampedHash { + hash: number; + timestamp: number; +} + +class MergedEvent { + public hashCode: number; + private _count: number; + private _context: EventPluginContext; + + constructor(hashCode: number, context: EventPluginContext, count: number) { + this.hashCode = hashCode; + this._context = context; + this._count = count; + } + + public incrementCount(count: number): void { + this._count += count; + } + + public async resubmit(): Promise { + this._context.event.count = this._count; + await this._context.client.config.services.queue.enqueue(this._context.event); + } + + public updateDate(date?: Date): void { + const ev = this._context.event; + if (date && ev.date && date > ev.date) { + ev.date = date; + } + } +} diff --git a/packages/core/src/plugins/default/EventExclusionPlugin.ts b/packages/core/src/plugins/default/EventExclusionPlugin.ts new file mode 100644 index 00000000..262a9bb6 --- /dev/null +++ b/packages/core/src/plugins/default/EventExclusionPlugin.ts @@ -0,0 +1,110 @@ +import { KnownEventDataKeys, LogLevel } from "#/models/Event.js"; +import { isMatch, startsWith, toBoolean } from "#/Utils.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { IEventPlugin } from "#/plugins/IEventPlugin.js"; + +export class EventExclusionPlugin implements IEventPlugin { + public priority = 45; + public name = "EventExclusionPlugin"; + + public run(context: EventPluginContext): Promise { + const ev = context.event; + const log = context.log; + const settings = context.client.config.settings; + + if (ev.type === "log") { + const minLogLevel = this.getMinLogLevel(settings, ev.source); + const logLevel = this.getLogLevel(ev.data && ev.data[KnownEventDataKeys.Level]); + + if (logLevel !== -1 && (logLevel === 6 || logLevel < minLogLevel)) { + log.info("Cancelling log event due to minimum log level."); + context.cancelled = true; + } + } else if (ev.type === "error") { + let error = ev.data && ev.data[KnownEventDataKeys.Error]; + while (!context.cancelled && error) { + if (this.getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) { + log.info(`Cancelling error from excluded exception type: ${error.type}`); + context.cancelled = true; + } + + error = error.inner; + } + } else if (this.getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) { + log.info(`Cancelling event from excluded type: ${ev.type} and source: ${ev.source}`); + context.cancelled = true; + } + + return Promise.resolve(); + } + + public getLogLevel(level: LogLevel | undefined): number { + switch ((level || "").toLowerCase().trim()) { + case "trace": + case "true": + case "1": + case "yes": + return 0; + case "debug": + return 1; + case "info": + return 2; + case "warn": + return 3; + case "error": + return 4; + case "fatal": + return 5; + case "off": + case "false": + case "0": + case "no": + return 6; + default: + return -1; + } + } + + public getMinLogLevel(configSettings: Record, source: string | undefined): number { + return this.getLogLevel(this.getTypeAndSourceSetting(configSettings, "log", source, "other") + ""); + } + + private getTypeAndSourceSetting( + configSettings: Record = {}, + type: string | undefined, + source: string | undefined, + defaultValue: string | boolean + ): string | boolean { + if (!type) { + return defaultValue; + } + + if (!source) { + source = ""; + } + + const isLog: boolean = type === "log"; + const sourcePrefix = `@@${type}:`; + + const value: string = configSettings[sourcePrefix + source]; + if (value) { + return isLog ? value : toBoolean(value); + } + + // sort object keys longest first, then alphabetically. + const sortedKeys = Object.keys(configSettings).sort((a, b) => b.length - a.length || a.localeCompare(b)); + for (const key of sortedKeys) { + if (!startsWith(key.toLowerCase(), sourcePrefix)) { + continue; + } + + // check for wildcard match + const cleanKey: string = key.substring(sourcePrefix.length); + if (isMatch(source, [cleanKey])) { + return isLog ? configSettings[key] : toBoolean(configSettings[key]); + } + } + + return defaultValue; + } +} diff --git a/packages/core/src/plugins/default/HeartbeatPlugin.ts b/packages/core/src/plugins/default/HeartbeatPlugin.ts new file mode 100644 index 00000000..34023c97 --- /dev/null +++ b/packages/core/src/plugins/default/HeartbeatPlugin.ts @@ -0,0 +1,56 @@ +import { KnownEventDataKeys } from "#/models/Event.js"; +import { allowProcessToExitWithoutWaitingForTimerOrInterval } from "#/Utils.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { IEventPlugin } from "#/plugins/IEventPlugin.js"; + +export class HeartbeatPlugin implements IEventPlugin { + public priority = 100; + public name = "HeartbeatPlugin"; + + private _interval: number; + private _intervalId: ReturnType | undefined; + + constructor(heartbeatInterval: number = 60000) { + this._interval = heartbeatInterval >= 30000 ? heartbeatInterval : 60000; + } + + public startup(): Promise { + clearInterval(this._intervalId); + this._intervalId = undefined; + // TODO: Do we want to send a heartbeat for the last user? + return Promise.resolve(); + } + + public suspend(): Promise { + clearInterval(this._intervalId); + this._intervalId = undefined; + return Promise.resolve(); + } + + public run(context: EventPluginContext): Promise { + if (this._interval <= 0) { + return Promise.resolve(); + } + + clearInterval(this._intervalId); + this._intervalId = undefined; + + const { config } = context.client; + if (!config.currentSessionIdentifier) { + const user = context.event.data?.[KnownEventDataKeys.UserInfo]; + if (!user?.identity) { + return Promise.resolve(); + } + + config.currentSessionIdentifier = user.identity; + } + + if (config.currentSessionIdentifier) { + this._intervalId = setInterval(() => void context.client.submitSessionHeartbeat(config.currentSessionIdentifier), this._interval); + + allowProcessToExitWithoutWaitingForTimerOrInterval(this._intervalId); + } + + return Promise.resolve(); + } +} diff --git a/packages/core/src/plugins/default/ReferenceIdPlugin.ts b/packages/core/src/plugins/default/ReferenceIdPlugin.ts new file mode 100644 index 00000000..7cd3cc1b --- /dev/null +++ b/packages/core/src/plugins/default/ReferenceIdPlugin.ts @@ -0,0 +1,17 @@ +import { guid } from "#/Utils.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { IEventPlugin } from "#/plugins/IEventPlugin.js"; + +export class ReferenceIdPlugin implements IEventPlugin { + public priority = 20; + public name = "ReferenceIdPlugin"; + + public run(context: EventPluginContext): Promise { + if (!context.event.reference_id && context.event.type === "error") { + // PERF: Optimize identifier creation. + context.event.reference_id = guid().replaceAll("-", "").substring(0, 10); + } + + return Promise.resolve(); + } +} diff --git a/packages/core/src/plugins/default/SessionIdManagementPlugin.ts b/packages/core/src/plugins/default/SessionIdManagementPlugin.ts new file mode 100644 index 00000000..4719484a --- /dev/null +++ b/packages/core/src/plugins/default/SessionIdManagementPlugin.ts @@ -0,0 +1,29 @@ +import { guid } from "#/Utils.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { IEventPlugin } from "#/plugins/IEventPlugin.js"; + +export class SessionIdManagementPlugin implements IEventPlugin { + public priority = 25; + public name = "SessionIdManagementPlugin"; + + public run(context: EventPluginContext): Promise { + const ev = context.event; + const isSessionStart: boolean = ev.type === "session"; + const { config } = context.client; + if (isSessionStart || !config.currentSessionIdentifier) { + config.currentSessionIdentifier = guid().replaceAll("-", ""); + } + + if (isSessionStart) { + ev.reference_id = config.currentSessionIdentifier; + } else { + if (!ev.data) { + ev.data = {}; + } + + ev.data["@ref:session"] = config.currentSessionIdentifier; + } + + return Promise.resolve(); + } +} diff --git a/packages/core/src/plugins/default/SimpleErrorPlugin.ts b/packages/core/src/plugins/default/SimpleErrorPlugin.ts new file mode 100644 index 00000000..b3d61fab --- /dev/null +++ b/packages/core/src/plugins/default/SimpleErrorPlugin.ts @@ -0,0 +1,57 @@ +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { IEventPlugin } from "#/plugins/IEventPlugin.js"; +import { isEmpty, stringify } from "#/Utils.js"; +import { SimpleError } from "#/models/data/ErrorInfo.js"; +import { KnownEventDataKeys } from "#/models/Event.js"; + +export const IgnoredErrorProperties: string[] = [ + "arguments", + "column", + "columnNumber", + "description", + "fileName", + "message", + "name", + "number", + "line", + "lineNumber", + "opera#sourceloc", + "sourceId", + "sourceURL", + "stack", + "stackArray", + "stacktrace" +]; + +export class SimpleErrorPlugin implements IEventPlugin { + public priority = 30; + public name = "SimpleErrorPlugin"; + + public async run(context: EventPluginContext): Promise { + const exception = context.eventContext.getException(); + if (exception) { + if (!context.event.type) { + context.event.type = "error"; + } + + if (context.event.data && !context.event.data[KnownEventDataKeys.SimpleError]) { + const error = { + type: exception.name || "Error", + message: exception.message, + stack_trace: exception.stack, + data: {} + }; + + const exclusions = context.client.config.dataExclusions.concat(IgnoredErrorProperties); + const additionalData = stringify(exception, exclusions); + if (!isEmpty(additionalData)) { + error.data!["@ext"] = JSON.parse(additionalData); + } + + context.event.data[KnownEventDataKeys.SimpleError] = error; + } + } + + return Promise.resolve(); + } +} diff --git a/packages/core/src/plugins/default/SubmissionMethodPlugin.ts b/packages/core/src/plugins/default/SubmissionMethodPlugin.ts new file mode 100644 index 00000000..55f5c13c --- /dev/null +++ b/packages/core/src/plugins/default/SubmissionMethodPlugin.ts @@ -0,0 +1,17 @@ +import { KnownEventDataKeys } from "#/models/Event.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { IEventPlugin } from "#/plugins/IEventPlugin.js"; + +export class SubmissionMethodPlugin implements IEventPlugin { + public priority = 100; + public name = "SubmissionMethodPlugin"; + + public run(context: EventPluginContext): Promise { + const submissionMethod = context.eventContext.getSubmissionMethod(); + if (submissionMethod && context.event.data) { + context.event.data[KnownEventDataKeys.SubmissionMethod] = submissionMethod; + } + + return Promise.resolve(); + } +} diff --git a/packages/core/src/queue/DefaultEventQueue.ts b/packages/core/src/queue/DefaultEventQueue.ts new file mode 100644 index 00000000..7cc84eb6 --- /dev/null +++ b/packages/core/src/queue/DefaultEventQueue.ts @@ -0,0 +1,322 @@ +import { Configuration } from "#/configuration/Configuration.js"; +import { ILog } from "#/logging/ILog.js"; +import { Event } from "#/models/Event.js"; +import { IEventQueue } from "#/queue/IEventQueue.js"; +import { Response } from "#/submission/Response.js"; +import { allowProcessToExitWithoutWaitingForTimerOrInterval } from "#/Utils.js"; + +interface EventQueueItem { + file: string; + event: Event; +} + +export class DefaultEventQueue implements IEventQueue { + /** + * A list of handlers that will be fired when events are submitted. + * @type {Array} + * @private + */ + private _handlers: Array<(events: Event[], response: Response) => Promise> = []; + + /** + * Suspends processing until the specified time. + * @type {Date} + * @private + */ + private _suspendProcessingUntil?: Date; + + /** + * Discards queued items until the specified time. + * @type {Date} + * @private + */ + private _discardQueuedItemsUntil?: Date; + + /** + * Returns true if the queue is processing. + * @type {boolean} + * @private + */ + private _processingQueue = false; + + /** + * Processes the queue every xx seconds. + * @type {Interval} + * @private + */ + private _queueIntervalId: ReturnType | undefined; + + private readonly QUEUE_PREFIX: string = "q:"; + private _lastFileTimestamp = 0; + private _queue: EventQueueItem[] = []; + private _loadPersistedEvents = true; + + constructor( + private config: Configuration, + private maxItems: number = 250 + ) {} + + public async enqueue(event: Event): Promise { + const eventWillNotBeQueued = "The event will not be queued."; + const config: Configuration = this.config; + const log: ILog = config.services.log; + + if (!config.enabled) { + log.info(`Configuration is disabled. ${eventWillNotBeQueued}`); + return; + } + + if (!config.isValid) { + log.info(`Invalid Api Key. ${eventWillNotBeQueued}`); + return; + } + + if (this.areQueuedItemsDiscarded()) { + log.info(`Queue items are currently being discarded. ${eventWillNotBeQueued}`); + return; + } + + const file = await this.enqueueEvent(event); + const logText = `type=${event.type} reference_id=${event.reference_id} source=${event.source} message=${event.message}`; + log.info(`Enqueued event: ${file} (${logText})`); + } + + public async process(): Promise { + const queueNotProcessed = "The queue will not be processed"; + const { log } = this.config.services; + + if (this._processingQueue) { + return; + } + + log.trace("Processing queue..."); + if (!this.config.enabled) { + log.info(`Configuration is disabled: ${queueNotProcessed}`); + return; + } + + if (!this.config.isValid) { + log.info(`Invalid Api Key: ${queueNotProcessed}`); + return; + } + + this._processingQueue = true; + try { + if (this._loadPersistedEvents) { + if (this.config.usePersistedQueueStorage) { + await this.loadEvents(); + } + + this._loadPersistedEvents = false; + } + + const items = this._queue.slice(0, this.config.submissionBatchSize); + if (!items || items.length === 0) { + this._processingQueue = false; + return; + } + + log.info(`Sending ${items.length} events to ${this.config.serverUrl}`); + const events = items.map((i) => i.event); + const response = await this.config.services.submissionClient.submitEvents(events); + await this.processSubmissionResponse(response, items); + await this.eventsPosted(events, response); + log.trace("Finished processing queue"); + this._processingQueue = false; + } catch (ex) { + log.error(`Error processing queue: ${ex instanceof Error ? ex.message : ex + ""}`); + await this.suspendProcessing(); + this._processingQueue = false; + } + } + + public startup(): Promise { + if (!this._queueIntervalId) { + // TODO: Fix awaiting promise. + this._queueIntervalId = setInterval(() => void this.onProcessQueue(), 10000); + allowProcessToExitWithoutWaitingForTimerOrInterval(this._queueIntervalId); + } + + return Promise.resolve(); + } + + public suspend(): Promise { + clearInterval(this._queueIntervalId); + this._queueIntervalId = undefined; + return Promise.resolve(); + } + + public async suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): Promise { + const config: Configuration = this.config; // Optimization for minifier. + + const currentDate = new Date(); + if (!durationInMinutes || durationInMinutes <= 0) { + durationInMinutes = Math.ceil(currentDate.getMinutes() / 15) * 15 - currentDate.getMinutes(); + } + + config.services.log.info(`Suspending processing for ${durationInMinutes} minutes.`); + this._suspendProcessingUntil = new Date(currentDate.getTime() + durationInMinutes * 60000); + + if (discardFutureQueuedItems) { + this._discardQueuedItemsUntil = this._suspendProcessingUntil; + } + + if (clearQueue) { + // Account is over the limit and we want to ensure that the sample size being sent in will contain newer errors. + await this.removeEvents(this._queue); + } + } + + // TODO: See if this makes sense. + public onEventsPosted(handler: (events: Event[], response: Response) => Promise): void { + handler && this._handlers.push(handler); + } + + private async eventsPosted(events: Event[], response: Response): Promise { + const handlers = this._handlers; + for (const handler of handlers) { + try { + await handler(events, response); + } catch (ex) { + this.config.services.log.error(`Error calling onEventsPosted handler: ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + } + + private areQueuedItemsDiscarded(): boolean { + return (this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date()) || false; + } + + private isQueueProcessingSuspended(): boolean { + return (this._suspendProcessingUntil && this._suspendProcessingUntil > new Date()) || false; + } + + private async onProcessQueue(): Promise { + if (!this.isQueueProcessingSuspended() && !this._processingQueue) { + await this.process(); + } + } + + private async processSubmissionResponse(response: Response, items: EventQueueItem[]): Promise { + const noSubmission = "The event will not be submitted"; + const config: Configuration = this.config; + const log: ILog = config.services.log; + + if (response.status === 202) { + log.info(`Sent ${items.length} events`); + await this.removeEvents(items); + return; + } + + if (response.status === 429 || response.rateLimitRemaining === 0 || response.status === 503) { + // You are currently over your rate limit or the servers are under stress. + log.error("Server returned service unavailable"); + await this.suspendProcessing(); + return; + } + + if (response.status === 402) { + // If the organization over the rate limit then discard the event. + log.info("Too many events have been submitted, please upgrade your plan"); + await this.suspendProcessing(0, true, true); + return; + } + + if (response.status === 401 || response.status === 403) { + // The api key was suspended or could not be authorized. + log.info(`Unable to authenticate, please check your configuration. ${noSubmission}`); + await this.suspendProcessing(15); + await this.removeEvents(items); + return; + } + + if (response.status === 400 || response.status === 404) { + // The service end point could not be found. + log.error(`Error while trying to submit data: ${response.message}`); + await this.suspendProcessing(60 * 4); + await this.removeEvents(items); + return; + } + + if (response.status === 413) { + const message = "Event submission discarded for being too large."; + if (config.submissionBatchSize > 1) { + log.error(`${message} Retrying with smaller batch size.`); + config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5)); + } else { + log.error(`${message} ${noSubmission}`); + await this.removeEvents(items); + } + + return; + } + + log.error(`Error submitting events: ${response.message || "Please check the network tab for more info."}`); + await this.suspendProcessing(); + } + + private async loadEvents(): Promise { + if (this.config.usePersistedQueueStorage) { + const { log, storage } = this.config.services; + + try { + const files: string[] = await storage.keys(); + + for (const file of files) { + if (file?.startsWith(this.QUEUE_PREFIX)) { + const json = await storage.getItem(file); + if (json) this._queue.push({ file, event: JSON.parse(json) as Event }); + } + } + } catch (ex) { + log.error(`Error loading queue items from storage: ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + } + + private async enqueueEvent(event: Event): Promise { + this._lastFileTimestamp = Math.max(Date.now(), this._lastFileTimestamp + 1); + const file = `${this.QUEUE_PREFIX}${this._lastFileTimestamp}.json`; + + const { log, storage } = this.config.services; + const useStorage: boolean = this.config.usePersistedQueueStorage; + if (this._queue.push({ file, event }) > this.maxItems) { + log.trace("Removing oldest queue entry: maxItems exceeded"); + const item = this._queue.shift(); + if (useStorage && item) { + try { + await storage.removeItem(item.file); + } catch (ex) { + log.error(`Error removing oldest queue entry from storage: ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + } + + if (useStorage) { + try { + await storage.setItem(file, JSON.stringify(event)); + } catch (ex) { + log.error(`Error saving queue entry to storage: ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + + return file; + } + + private async removeEvents(items: EventQueueItem[]): Promise { + const files = items.map((i) => i.file); + if (this.config.usePersistedQueueStorage) { + const { log, storage } = this.config.services; + + for (const file of files) { + try { + await storage.removeItem(file); + } catch (ex) { + log.error(`Error removing queue item from storage: ${ex instanceof Error ? ex.message : ex + ""}`); + } + } + } + + this._queue = this._queue.filter((i) => !files.includes(i.file)); + } +} diff --git a/packages/core/src/queue/IEventQueue.ts b/packages/core/src/queue/IEventQueue.ts new file mode 100644 index 00000000..8bf164cd --- /dev/null +++ b/packages/core/src/queue/IEventQueue.ts @@ -0,0 +1,17 @@ +import { Event } from "#/models/Event.js"; +import { Response } from "#/submission/Response.js"; + +export interface IEventQueue { + /** Enqueue an event */ + enqueue(event: Event): Promise; + /** Processes all events in the queue */ + process(): Promise; + /** Starts queue timers */ + startup(): Promise; + /** Suspends queue timers */ + suspend(): Promise; + /** Suspends processing of events for a specific duration */ + suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): Promise; + // TODO: See if this makes sense. + onEventsPosted(handler: (events: Event[], response: Response) => Promise): void; +} diff --git a/packages/core/src/storage/IStorage.ts b/packages/core/src/storage/IStorage.ts new file mode 100644 index 00000000..a58b728b --- /dev/null +++ b/packages/core/src/storage/IStorage.ts @@ -0,0 +1,9 @@ +export interface IStorage { + length(): Promise; + clear(): Promise; + getItem(key: string): Promise; + key(index: number): Promise; + keys(): Promise; + removeItem(key: string): Promise; + setItem(key: string, value: string): Promise; +} diff --git a/packages/core/src/storage/InMemoryStorage.ts b/packages/core/src/storage/InMemoryStorage.ts new file mode 100644 index 00000000..0af75689 --- /dev/null +++ b/packages/core/src/storage/InMemoryStorage.ts @@ -0,0 +1,44 @@ +import { IStorage } from "#/storage/IStorage.js"; + +export class InMemoryStorage implements IStorage { + private items = new Map(); + + public length(): Promise { + return Promise.resolve(this.items.size); + } + + public clear(): Promise { + this.items.clear(); + return Promise.resolve(); + } + + public getItem(key: string): Promise { + const value = this.items.get(key); + return Promise.resolve(value ? value : null); + } + + public async key(index: number): Promise { + if (index < 0) return Promise.resolve(null); + + const keys = await this.keys(); + + if (index > keys.length) return Promise.resolve(null); + + const key = keys[index]; + return Promise.resolve(key ? key : null); + } + + public keys(): Promise { + return Promise.resolve(Array.from(this.items.keys())); + } + + public removeItem(key: string): Promise { + this.items.delete(key); + return Promise.resolve(); + } + + public setItem(key: string, value: string): Promise { + this.items.set(key, value); + return Promise.resolve(); + } +} diff --git a/packages/core/src/storage/LocalStorage.ts b/packages/core/src/storage/LocalStorage.ts new file mode 100644 index 00000000..6e05c4ba --- /dev/null +++ b/packages/core/src/storage/LocalStorage.ts @@ -0,0 +1,53 @@ +import { IStorage } from "#/storage/IStorage.js"; + +export class LocalStorage implements IStorage { + constructor( + private prefix: string = "exceptionless-", + private storage: Storage = globalThis.localStorage + ) {} + + public length(): Promise { + return Promise.resolve(this.getKeys().length); + } + + public clear(): Promise { + for (const key of this.getKeys()) { + this.storage.removeItem(this.getKey(key)); + } + + return Promise.resolve(); + } + + public getItem(key: string): Promise { + return Promise.resolve(this.storage.getItem(this.getKey(key))); + } + + public key(index: number): Promise { + const keys = this.getKeys(); + return Promise.resolve(index < keys.length ? keys[index] : null); + } + + public keys(): Promise { + return Promise.resolve(this.getKeys()); + } + + public removeItem(key: string): Promise { + this.storage.removeItem(this.getKey(key)); + return Promise.resolve(); + } + + public setItem(key: string, value: string): Promise { + this.storage.setItem(this.getKey(key), value); + return Promise.resolve(); + } + + private getKeys(): string[] { + return Object.keys(this.storage) + .filter((key) => key.startsWith(this.prefix)) + .map((key) => key?.substr(this.prefix.length)); + } + + private getKey(key: string): string { + return this.prefix + key; + } +} diff --git a/packages/core/src/submission/DefaultSubmissionClient.ts b/packages/core/src/submission/DefaultSubmissionClient.ts new file mode 100644 index 00000000..f98bb219 --- /dev/null +++ b/packages/core/src/submission/DefaultSubmissionClient.ts @@ -0,0 +1,98 @@ +import { Configuration } from "#/configuration/Configuration.js"; +import { ServerSettings, SettingsManager } from "#/configuration/SettingsManager.js"; +import { Event } from "#/models/Event.js"; +import { UserDescription } from "#/models/data/UserDescription.js"; +import { ISubmissionClient } from "#/submission/ISubmissionClient.js"; +import { Response } from "#/submission/Response.js"; + +export class DefaultSubmissionClient implements ISubmissionClient { + protected readonly RateLimitRemainingHeader: string = "x-ratelimit-remaining"; + protected readonly ConfigurationVersionHeader: string = "x-exceptionless-configversion"; + + public constructor( + protected config: Configuration, + private fetch = globalThis.fetch?.bind(globalThis) + ) {} + + public getSettings(version: number): Promise> { + const url = `${this.config.serverUrl}/api/v2/projects/config?v=${version}`; + return this.apiFetch(url, { + method: "GET" + }); + } + + public async submitEvents(events: Event[]): Promise { + const url = `${this.config.serverUrl}/api/v2/events`; + const response = await this.apiFetch(url, { + method: "POST", + body: JSON.stringify(events) + }); + + await this.updateSettingsVersion(response.settingsVersion); + return response; + } + + public async submitUserDescription(referenceId: string, description: UserDescription): Promise { + const url = `${this.config.serverUrl}/api/v2/events/by-ref/${encodeURIComponent(referenceId)}/user-description`; + + const response = await this.apiFetch(url, { + method: "POST", + body: JSON.stringify(description) + }); + + await this.updateSettingsVersion(response.settingsVersion); + + return response; + } + + public async submitHeartbeat(sessionIdOrUserId: string, closeSession: boolean): Promise> { + const url = `${this.config.heartbeatServerUrl}/api/v2/events/session/heartbeat?id=${sessionIdOrUserId}&close=${closeSession + ""}`; + return await this.apiFetch(url, { + method: "GET" + }); + } + + protected async updateSettingsVersion(serverSettingsVersion: number): Promise { + if (isNaN(serverSettingsVersion)) { + this.config.services.log.error("No config version header was returned."); + } else if (serverSettingsVersion > this.config.settingsVersion) { + await SettingsManager.updateSettings(this.config); + } + } + + protected async apiFetch(url: string, options: FetchOptions): Promise> { + // TODO: Figure out how to set a 10000 timeout. + const requestOptions: RequestInit = { + method: options.method, + headers: { + Accept: "application/json", + Authorization: `Bearer ${this.config.apiKey}`, + "User-Agent": this.config.userAgent + }, + body: options.body ?? null + }; + + // TODO: Can we properly calculate content size? + if (options.method === "POST" && this.isHeaders(requestOptions.headers)) { + requestOptions.headers["Content-Type"] = "application/json"; + } + + const response = await this.fetch(url, requestOptions); + const rateLimitRemaining: number = parseInt(response.headers.get(this.RateLimitRemainingHeader) || "", 10); + const settingsVersion: number = parseInt(response.headers.get(this.ConfigurationVersionHeader) || "", 10); + + const responseText = await response.text(); + const data = responseText && responseText.length > 0 ? (JSON.parse(responseText) as T) : null; + + return new Response(response.status, response.statusText, rateLimitRemaining, settingsVersion, data); + } + + private isHeaders(headers: HeadersInit | undefined): headers is Record { + return (headers as Record) !== undefined; + } +} + +export interface FetchOptions { + method: "GET" | "POST"; + body?: string; +} diff --git a/packages/core/src/submission/ISubmissionClient.ts b/packages/core/src/submission/ISubmissionClient.ts new file mode 100644 index 00000000..d48ab1e3 --- /dev/null +++ b/packages/core/src/submission/ISubmissionClient.ts @@ -0,0 +1,11 @@ +import { ServerSettings } from "#/configuration/SettingsManager.js"; +import { Event } from "#/models/Event.js"; +import { UserDescription } from "#/models/data/UserDescription.js"; +import { Response } from "#/submission/Response.js"; + +export interface ISubmissionClient { + getSettings(version: number): Promise>; + submitEvents(events: Event[]): Promise; + submitUserDescription(referenceId: string, description: UserDescription): Promise; + submitHeartbeat(sessionIdOrUserId: string, closeSession: boolean): Promise; +} diff --git a/packages/core/src/submission/Response.ts b/packages/core/src/submission/Response.ts new file mode 100644 index 00000000..c448b7e7 --- /dev/null +++ b/packages/core/src/submission/Response.ts @@ -0,0 +1,13 @@ +export class Response { + constructor( + public status: number, + public message: string, + public rateLimitRemaining: number, + public settingsVersion: number, + public data: T + ) {} + + public get success(): boolean { + return this.status >= 200 && this.status <= 299; + } +} diff --git a/packages/core/test/ExceptionlessClient.test.ts b/packages/core/test/ExceptionlessClient.test.ts new file mode 100644 index 00000000..2da150bf --- /dev/null +++ b/packages/core/test/ExceptionlessClient.test.ts @@ -0,0 +1,108 @@ +import { describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { ExceptionlessClient } from "#/ExceptionlessClient.js"; +import { KnownEventDataKeys } from "#/models/Event.js"; +import { ReferenceIdPlugin } from "#/plugins/default/ReferenceIdPlugin.js"; + +describe("ExceptionlessClient", () => { + test("should use event reference ids", async () => { + const error = createException(); + + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + + expect(client.config.plugins).not.toBeNull(); + while (client.config.plugins.length > 0) { + client.config.removePlugin(client.config.plugins[0]); + } + + const { lastReferenceIdManager } = client.config.services; + expect(lastReferenceIdManager.getLast()).toBeNull(); + + let context = await client.submitException(error); + expect(context.event.reference_id).toBeUndefined(); + expect(lastReferenceIdManager.getLast()).toBeNull(); + + client.config.addPlugin(new ReferenceIdPlugin()); + expect(client.config.plugins.length).toBe(1); + + context = await client.submitException(error); + expect(context.event.reference_id).not.toBeUndefined(); + const lastReference = lastReferenceIdManager.getLast(); + expect(context.event.reference_id).toBe(lastReference); + + context = await client.submitException(error); + expect(context.event.reference_id).not.toBeUndefined(); + expect(context.event.reference_id).not.toBe(lastReference); + expect(context.event.reference_id).toBe(lastReferenceIdManager.getLast()); + }); + + test("should accept undefined source", () => { + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + + const builder = client.createLog(undefined, "Unit Test message", "trace"); + + expect(builder.target.source).toBeUndefined(); + expect(builder.target.message).toBe("Unit Test message"); + expect(builder.target.data?.[KnownEventDataKeys.Level]).toBe("trace"); + }); + + test("should accept source and message", () => { + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + + const builder = client.createLog("ExceptionlessClient", "Unit Test message"); + + expect(builder.target.source).toBe("ExceptionlessClient"); + expect(builder.target.message).toBe("Unit Test message"); + expect(builder.target.data).toBeUndefined(); + }); + + test("should accept source and message and level", () => { + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + const builder = client.createLog("source", "Unit Test message", "info"); + + expect(builder.target.source).toBe("source"); + expect(builder.target.message).toBe("Unit Test message"); + expect(builder.target.data?.[KnownEventDataKeys.Level]).toBe("info"); + }); + + test("should allow construction via a configuration object", () => { + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + client.config.serverUrl = "https://localhost:5100"; + + expect(client.config.apiKey).toBe("UNIT_TEST_API_KEY"); + expect(client.config.serverUrl).toBe("https://localhost:5100"); + }); + + test("should allow construction via a constructor", async () => { + const client = new ExceptionlessClient(); + + await client.startup((c) => { + c.apiKey = "UNIT_TEST_API_KEY"; + c.serverUrl = "https://localhost:5100"; + c.updateSettingsWhenIdleInterval = -1; + }); + + await client.suspend(); + expect(client.config.apiKey).toBe("UNIT_TEST_API_KEY"); + expect(client.config.serverUrl).toBe("https://localhost:5100"); + }); + + function createException(): ReferenceError { + function throwError() { + throw new ReferenceError("This is a test"); + } + try { + throwError(); + } catch (e) { + return e as ReferenceError; + } + + return new ReferenceError("No Stack Trace"); + } +}); diff --git a/packages/core/test/Utils.test.ts b/packages/core/test/Utils.test.ts new file mode 100644 index 00000000..84035b53 --- /dev/null +++ b/packages/core/test/Utils.test.ts @@ -0,0 +1,834 @@ +import { describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { endsWith, isEmpty, isMatch, parseVersion, prune, startsWith, stringify, toBoolean } from "#/Utils.js"; + +describe("Utils", () => { + function getObjectWithInheritedProperties(): unknown { + const Foo = function () { + // @ts-expect-error TS2683 + this.a = "a"; + }; + + const Bar = function () { + // @ts-expect-error TS2683 + this.b = "b"; + }; + // @ts-expect-error TS7009 + Bar.prototype = new Foo(); + // @ts-expect-error TS7009 + return new Bar(); + } + + describe("prune", () => { + test("circular reference", () => { + type Circular = { property: string; circularRef?: Circular }; + const circular: Circular = { property: "string" }; + circular.circularRef = circular; + + const expected = { property: "string", circularRef: undefined }; + const actual = prune(circular); + expect(actual).toStrictEqual(expected); + }); + + test("circular array reference", () => { + type Circular = { property: string; circularRef?: Circular; list?: Circular[] }; + const circular: Circular = { property: "string" }; + circular.circularRef = circular; + circular.list = [circular]; + + const expected = { property: "string", circularRef: undefined, list: [undefined] }; + const actual = prune(circular); + expect(actual).toStrictEqual(expected); + }); + + test("array reference removes duplicated object references", () => { + type PropertyObject = { property: string }; + const propObject: PropertyObject = { property: "string" }; + + const expected = [{ property: "string" }, undefined]; + const actual = prune([propObject, propObject]); + expect(actual).toStrictEqual(expected); + }); + + test("array cloned no object references", () => { + const expected = [{ property: "string" }, { property: "string" }]; + const actual = prune([{ property: "string" }, { property: "string" }]); + expect(actual).toStrictEqual(expected); + }); + + describe("should prune data types", () => { + // NOTE: we do not have coverage for globalThis. + + const primitiveValues = { + undefined: undefined, + null: null, + string: "string", + number: 1, + Infinity: Infinity, + "-Infinity": -Infinity, + NaN: NaN, + boolean: true + }; + + Object.entries(primitiveValues).forEach(([key, value]) => { + test(`for ${key}`, () => { + const actual = prune(value, 1); + const expected = value; + expect(actual).toBe(expected); + }); + }); + + const typedArrayValues = { + Int8Array: new Int8Array([1]), + Uint8Array: new Uint8Array([1]), + Uint8ClampedArray: new Uint8ClampedArray([1]), + Int16Array: new Int16Array([1]), + Uint16Array: new Uint16Array([1]), + Int32Array: new Int32Array([1]), + Uint32Array: new Uint32Array([1]), + Float32Array: new Float32Array([1]), + Float64Array: new Float64Array([1]) + }; + + Object.entries(typedArrayValues).forEach(([key, value]) => { + test(`for ${key}`, () => { + const actual = prune(value, 1); + + if (Array.isArray(actual)) { + expect(actual.length).toBe(1); + expect(actual).toContain(1); + } else { + throw new Error("actual is not an array"); + } + }); + }); + + const bigIntTypedArrayValues = { + BigInt64Array: new BigInt64Array([1n]), + BigUint64Array: new BigUint64Array([1n]) + }; + + Object.entries(bigIntTypedArrayValues).forEach(([key, value]) => { + test(`for ${key}`, () => { + const actual = prune(value, 1); + + if (Array.isArray(actual)) { + expect(actual.length).toBe(1); + expect(actual).toContain("1n"); + } else { + throw new Error("actual is not an array"); + } + }); + }); + + // NOTE: Buffer could be supported as it specifies a toJSON method + const unsupportedValues = { + "Async Generator": (async function* () { + await Promise.resolve(1); + yield 1; + })(), + ArrayBuffer: new ArrayBuffer(1), + Buffer: Buffer.from("buffer"), + DataView: new DataView(new ArrayBuffer(1)), + function: () => { + return undefined; + }, + Generator: (function* () { + yield 1; + })(), + Promise: Promise.resolve(1) + }; + + Object.entries(unsupportedValues).forEach(([key, value]) => { + test(`for ${key}`, () => { + const actual = prune(value, 1); + expect(actual).toBeUndefined(); + }); + }); + + test("for Array", () => { + const expected = [{ a: undefined }, [undefined], 1]; + const actual = prune([{ a: { b: 2 } }, [[]], 1], 1); + expect(actual).toStrictEqual(expected); + }); + + test("for BigInt", () => { + const expected = "1n"; + const actual = prune(BigInt(1), 1); + expect(actual).toStrictEqual(expected); + }); + + test("for Date", () => { + const date = new Date(); + const actual = prune(date, 1); + expect(actual).toStrictEqual(date); + }); + + test("for Error", () => { + try { + throw new Error("error"); + } catch (error) { + if (error instanceof Error) { + const expected = { message: error.message, stack: error.stack }; + const actual = prune(error, 1); + expect(actual).toStrictEqual(expected); + } + } + }); + + test("for Map", () => { + const expected = { + "123": 123, + "[object Object]": { + a2: undefined, + b2: 1 + }, + "string key": "string key", + symbol: ["symbol key"] + }; + + const actual = prune( + new Map([ + // NOTE: this value is lost due to being converted to ["[object Object]", { a: { b: 2 }, b: 1 }] + [{ id: 1 }, { a: { b: 2 }, b: 1 }], + [{ id: 2 }, { a2: { b2: 2 }, b2: 1 }], + ["string key", "string key"], + [123, 123], + [Symbol("symbol"), ["symbol key"]] + ]), + 2 + ); + + expect(actual).toStrictEqual(expected); + }); + + test("for Object", () => { + const expected = { a: undefined, b: 1 }; + const actual = prune({ a: { b: 2 }, b: 1 }, 1); + expect(actual).toStrictEqual(expected); + }); + + test("for RegExp", () => { + const expected = "/regex/"; + const actual = prune(/regex/, 1); + expect(actual).toStrictEqual(expected); + }); + + test("for Set", () => { + const expected = [{ a: undefined, b: 1 }, 1]; + const actual = prune(new Set([{ a: { b: 2 }, b: 1 }, 1]), 1); + expect(actual).toStrictEqual(expected); + }); + + test("for Symbol", () => { + const expected = "symbol"; + const actual = prune(Symbol("symbol"), 1); + expect(actual).toStrictEqual(expected); + }); + + test("for WeakMap", () => { + const actual = prune(new WeakMap([[{}, { a: { b: 2 } }]]), 2); + expect(actual).toBeUndefined(); + }); + + test("for WeakSet", () => { + const actual = prune(new WeakSet([{ a: { b: 2 } }]), 2); + expect(actual).toBeUndefined(); + }); + + test("should handle toJSON", () => { + const expected = { test: "test" }; + const actual = prune({ + number: 1, + toJSON() { + return { + test: "test" + }; + } + }); + + expect(actual).toStrictEqual(expected); + }); + }); + + test("should respect maxDepth", () => { + const value = { + ao: { + bo: { + cn: 1, + co: { + do: {} + } + }, + ba: [ + { + cn: 1, + co: { + do: {} + } + } + ], + bn: 1 + } + }; + + expect(prune(value, 1)).toStrictEqual({ ao: undefined }); + expect(prune(value, 2)).toStrictEqual({ ao: { bo: undefined, ba: undefined, bn: 1 } }); + expect(prune(value, 3)).toStrictEqual({ ao: { bo: { cn: 1, co: undefined }, ba: [{ cn: 1, co: undefined }], bn: 1 } }); + expect(prune(value, 4)).toStrictEqual({ ao: { bo: { cn: 1, co: { do: undefined } }, ba: [{ cn: 1, co: { do: undefined } }], bn: 1 } }); + expect(prune(value, 5)).toStrictEqual({ ao: { bo: { cn: 1, co: { do: {} } }, ba: [{ cn: 1, co: { do: {} } }], bn: 1 } }); + }); + + test("should prune inherited properties", () => { + const expected = { + a: "a", + b: "b" + }; + + const actual = prune(getObjectWithInheritedProperties(), 1); + expect(actual).toStrictEqual(expected); + }); + }); + + describe("stringify", () => { + test("event error", () => { + const error = { + type: "error", + data: { + "@error": { + type: "Error", + message: "string error message", + stack_trace: [ + { + name: "throwStringErrorImpl", + parameters: [], + file_name: "http://localhost/index.js", + line_number: 22, + column: 9 + }, + { + name: "throwStringError", + parameters: [], + file_name: "http://localhost/index.js", + line_number: 10, + column: 10 + }, + { + name: "HTMLButtonElement.onclick", + parameters: [], + file_name: "http://localhost/", + line_number: 22, + column: 10 + } + ] + }, + "@submission_method": "onerror" + }, + tags: [] + }; + + expect(stringify(error)).toBe(JSON.stringify(error)); + }); + + test("circular reference", () => { + type Circular = { property: string; circularRef?: Circular }; + const circular: Circular = { property: "string" }; + circular.circularRef = circular; + + const expected = JSON.stringify({ property: "string", circularRef: undefined }); + const actual = stringify(circular); + expect(actual).toStrictEqual(expected); + }); + + test("circular array reference", () => { + type Circular = { property: string; circularRef?: Circular; list?: Circular[] }; + const circular: Circular = { property: "string" }; + circular.circularRef = circular; + circular.list = [circular]; + + const expected = JSON.stringify({ property: "string", circularRef: undefined, list: [undefined] }); + const actual = stringify(circular); + expect(actual).toStrictEqual(expected); + }); + + describe("should serialize data types", () => { + const primitiveValues = { + undefined: undefined, + null: null, + string: "string", + number: 1, + Infinity: Infinity, + "-Infinity": -Infinity, + NaN: NaN, + boolean: true + }; + + Object.entries(primitiveValues).forEach(([key, value]) => { + test(`for ${key}`, () => { + const actual = stringify(value, [], 1); + const expected = JSON.stringify(value); + expect(actual).toStrictEqual(expected); + }); + }); + + const typedArrayValues = { + Int8Array: new Int8Array([1]), + Uint8Array: new Uint8Array([1]), + Uint8ClampedArray: new Uint8ClampedArray([1]), + Int16Array: new Int16Array([1]), + Uint16Array: new Uint16Array([1]), + Int32Array: new Int32Array([1]), + Uint32Array: new Uint32Array([1]), + Float32Array: new Float32Array([1]), + Float64Array: new Float64Array([1]) + }; + + Object.entries(typedArrayValues).forEach(([key, value]) => { + test(`for ${key}`, () => { + const actual = stringify(value, [], 1); + const expected = JSON.stringify([1]); + expect(actual).toStrictEqual(expected); + }); + }); + + const bigIntTypedArrayValues = { + BigInt64Array: new BigInt64Array([1n]), + BigUint64Array: new BigUint64Array([1n]) + }; + + Object.entries(bigIntTypedArrayValues).forEach(([key, value]) => { + test(`for ${key}`, () => { + const actual = stringify(value, [], 1); + const expected = JSON.stringify(["1n"]); + expect(actual).toStrictEqual(expected); + }); + }); + + // NOTE: Buffer could be supported as it specifies a toJSON method + const unsupportedValues = { + "Async Generator": (async function* () { + await Promise.resolve(1); + yield 1; + })(), + ArrayBuffer: new ArrayBuffer(1), + Buffer: Buffer.from("buffer"), + DataView: new DataView(new ArrayBuffer(1)), + function: () => { + return undefined; + }, + Generator: (function* () { + yield 1; + })(), + Promise: Promise.resolve(1) + }; + + Object.entries(unsupportedValues).forEach(([key, value]) => { + test(`for ${key}`, () => { + const actual = stringify(value, [], 1); + expect(actual).toBeUndefined(); + }); + }); + + test("for Array", () => { + const expected = JSON.stringify([{ a: undefined }, [undefined], 1]); + const actual = stringify([{ a: { b: 2 } }, [[]], 1], [], 1); + expect(actual).toStrictEqual(expected); + }); + + test("for BigInt", () => { + const expected = JSON.stringify("1n"); + const actual = stringify(BigInt(1), [], 1); + expect(actual).toStrictEqual(expected); + }); + + test("for Date", () => { + const date = new Date(); + const expected = JSON.stringify(date); + const actual = stringify(date, [], 1); + expect(actual).toStrictEqual(expected); + }); + + test("for Error", () => { + try { + throw new Error("error"); + } catch (error) { + if (error instanceof Error) { + const expected = JSON.stringify({ stack: error.stack, message: error.message }); + const actual = stringify(error, [], 1); + expect(actual).toStrictEqual(expected); + } + } + }); + + test("for Map", () => { + const expected = JSON.stringify({ + "123": 123, + "[object Object]": { + a2: undefined, + b2: 1 + }, + "string key": "string key", + symbol: ["symbol key"] + }); + + const actual = stringify( + new Map([ + // NOTE: this value is lost due to being converted to ["[object Object]", { a: { b: 2 }, b: 1 }] + [{ id: 1 }, { a: { b: 2 }, b: 1 }], + [{ id: 2 }, { a2: { b2: 2 }, b2: 1 }], + ["string key", "string key"], + [123, 123], + [Symbol("symbol"), ["symbol key"]] + ]), + [], + 2 + ); + + expect(actual).toStrictEqual(expected); + }); + + test("for Object", () => { + const expected = JSON.stringify({ a: undefined, b: 1 }); + const actual = stringify({ a: { b: 2 }, b: 1 }, [], 1); + expect(actual).toStrictEqual(expected); + }); + + test("for RegExp", () => { + const expected = JSON.stringify("/regex/"); + const actual = stringify(/regex/, [], 1); + expect(actual).toStrictEqual(expected); + }); + + test("for Set", () => { + const expected = JSON.stringify([{ a: undefined, b: 1 }, 1]); + const actual = stringify(new Set([{ a: { b: 2 }, b: 1 }, 1]), [], 1); + expect(actual).toStrictEqual(expected); + }); + + test("for Symbol", () => { + const expected = JSON.stringify("symbol"); + const actual = stringify(Symbol("symbol"), [], 1); + expect(actual).toStrictEqual(expected); + }); + + test("for WeakMap", () => { + const actual = stringify(new WeakMap([[{}, { a: { b: 2 } }]]), [], 2); + expect(actual).toBeUndefined(); + }); + + test("for WeakSet", () => { + const actual = stringify(new WeakSet([{ a: { b: 2 } }]), [], 2); + expect(actual).toBeUndefined(); + }); + }); + + test("should handle toJSON", () => { + const value = { + number: 1, + toJSON() { + return { + test: "test" + }; + } + }; + + const expected = JSON.stringify(value); + const actual = stringify(value); + expect(actual).toStrictEqual(expected); + }); + + test("should respect maxDepth", () => { + const value = { + ao: { + bo: { + cn: 1, + co: { + do: {} + } + }, + ba: [ + { + cn: 1, + co: { + do: {} + } + } + ], + bn: 1 + } + }; + + expect(stringify(value, [], 1)).toStrictEqual(JSON.stringify({ ao: undefined })); + expect(stringify(value, [], 2)).toStrictEqual(JSON.stringify({ ao: { bo: undefined, ba: undefined, bn: 1 } })); + expect(stringify(value, [], 3)).toStrictEqual(JSON.stringify({ ao: { bo: { cn: 1, co: undefined }, ba: [{ cn: 1, co: undefined }], bn: 1 } })); + expect(stringify(value, [], 4)).toStrictEqual( + JSON.stringify({ ao: { bo: { cn: 1, co: { do: undefined } }, ba: [{ cn: 1, co: { do: undefined } }], bn: 1 } }) + ); + expect(stringify(value, [], 5)).toStrictEqual(JSON.stringify({ ao: { bo: { cn: 1, co: { do: {} } }, ba: [{ cn: 1, co: { do: {} } }], bn: 1 } })); + }); + + test("should serialize inherited properties", () => { + const expected = { + a: "a", + b: "b" + }; + + const actual = JSON.parse(stringify(getObjectWithInheritedProperties()) as string) as unknown; + expect(actual).toEqual(expected); + }); + + describe("with exclude pattern", () => { + const user = { + id: 1, + name: "Blake", + password: "123456", + passwordResetToken: "a reset token", + myPassword: "123456", + myPasswordValue: "123456", + customValue: "Password", + value: { + Password: "123456" + } + }; + + test("pAssword", () => { + expect(stringify(user, ["pAssword"])).toBe( + JSON.stringify({ + id: 1, + name: "Blake", + passwordResetToken: "a reset token", + myPassword: "123456", + myPasswordValue: "123456", + customValue: "Password", + value: {} + }) + ); + }); + + test("*password", () => { + expect(stringify(user, ["*password"])).toBe( + JSON.stringify({ id: 1, name: "Blake", passwordResetToken: "a reset token", myPasswordValue: "123456", customValue: "Password", value: {} }) + ); + }); + + test("password*", () => { + expect(stringify(user, ["password*"])).toBe( + JSON.stringify({ id: 1, name: "Blake", myPassword: "123456", myPasswordValue: "123456", customValue: "Password", value: {} }) + ); + }); + + test("*password*", () => { + JSON.stringify(expect(stringify(user, ["*password*"])).toBe(JSON.stringify({ id: 1, name: "Blake", customValue: "Password", value: {} }))); + }); + + test("*Password*", () => { + JSON.stringify(expect(stringify(user, ["*Password*"])).toBe(JSON.stringify({ id: 1, name: "Blake", customValue: "Password", value: {} }))); + }); + + test("*Address", () => { + const event = { type: "usage", source: "about" }; + expect(stringify(event, ["*Address"])).toBe(JSON.stringify(event)); + }); + }); + }); + + test("should parse version from url", () => { + expect(parseVersion("https://code.jquery.com/jquery-2.1.3.js")).toBe("2.1.3"); + expect(parseVersion("//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css")).toBe("3.3.4"); + expect(parseVersion("https://cdnjs.cloudflare.com/ajax/libs/1140/2.0/1140.css")).toBe("2.0"); + expect(parseVersion("https://cdnjs.cloudflare.com/ajax/libs/Base64/0.3.0/base64.min.js")).toBe("0.3.0"); + expect(parseVersion("https://cdnjs.cloudflare.com/ajax/libs/angular-google-maps/2.1.0-X.10/angular-google-maps.min.js")).toBe("2.1.0-X.10"); + expect(parseVersion("https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/2.1.8-M1/swagger-ui.min.js")).toBe("2.1.8-M1"); + expect(parseVersion("https://cdnjs.cloudflare.com/BLAH/BLAH.min.js")).toBeNull(); + }); + + describe("isEmpty", () => { + const emptyValues = { + undefined: undefined, + null: null, + "empty string": "", + "whitespace string": " ", + "{} string": "{}", + "[] string": "[]", + "empty object": {}, + "empty array": [] + }; + + Object.entries(emptyValues).forEach(([key, value]) => { + test(`for ${key}`, () => { + expect(isEmpty(value)).toBe(true); + }); + }); + + const values = { + Date: new Date(), + number: 1, + string: "string", + object: { a: 1 }, + array: [1] + }; + + Object.entries(values).forEach(([key, value]) => { + test(`for ${key}`, () => { + expect(isEmpty(value)).toBe(false); + }); + }); + }); + + describe("isMatch", () => { + test('input: blake patterns ["pAssword"]', () => { + expect(isMatch("blake", ["pAssword"])).toBe(false); + }); + + test('input: pAssword patterns ["pAssword"]', () => { + expect(isMatch("pAssword", ["pAssword"])).toBe(true); + }); + + test('input: passwordResetToken patterns ["pAssword"]', () => { + expect(isMatch("passwordResetToken", ["pAssword"])).toBe(false); + }); + + test('input: myPassword patterns ["pAssword"]', () => { + expect(isMatch("myPassword", ["pAssword"])).toBe(false); + }); + + test('input: blake patterns [" * pAssword"]', () => { + expect(isMatch("blake", ["*pAssword"])).toBe(false); + }); + + test('input: pAssword patterns [" * pAssword"]', () => { + expect(isMatch("pAssword", ["*pAssword"])).toBe(true); + }); + + test('input: passwordResetToken patterns [" * pAssword"]', () => { + expect(isMatch("passwordResetToken", ["*pAssword"])).toBe(false); + }); + + test('input: myPassword patterns [" * pAssword"]', () => { + expect(isMatch("myPassword", ["*pAssword"])).toBe(true); + }); + + test('input: blake patterns ["pAssword * "]', () => { + expect(isMatch("blake", ["pAssword*"])).toBe(false); + }); + + test('input: pAssword patterns ["pAssword * "]', () => { + expect(isMatch("pAssword", ["pAssword*"])).toBe(true); + }); + + test('input: passwordResetToken patterns ["pAssword * "]', () => { + expect(isMatch("passwordResetToken", ["pAssword*"])).toBe(true); + }); + + test('input: myPassword patterns ["pAssword * "]', () => { + expect(isMatch("myPassword", ["pAssword*"])).toBe(false); + }); + + test('input: blake patterns [" * pAssword * "]', () => { + expect(isMatch("blake", ["*pAssword*"])).toBe(false); + }); + + test('input: pAssword patterns [" * pAssword * "]', () => { + expect(isMatch("pAssword", ["*pAssword*"])).toBe(true); + }); + + test('input: passwordResetToken patterns [" * pAssword * "]', () => { + expect(isMatch("passwordResetToken", ["*pAssword*"])).toBe(true); + }); + + test('input: myPassword patterns [" * pAssword * "]', () => { + expect(isMatch("myPassword", ["*pAssword*"])).toBe(true); + }); + }); + + describe("startsWith", () => { + test("input: blake prefix: blake", () => { + expect(startsWith("blake", "blake")).toBe(true); + }); + + test("input: blake prefix: bl", () => { + expect(startsWith("blake", "bl")).toBe(true); + }); + + test("input: blake prefix: Blake", () => { + expect(startsWith("blake", "Blake")).toBe(false); + }); + + test("input: @@log:* prefix: @@log:", () => { + expect(startsWith("@@log:*", "@@log:")).toBe(true); + }); + + test("input: test prefix: noPattern", () => { + expect(startsWith("test", "noPattern")).toBe(false); + }); + }); + + describe("endsWith", () => { + test("input: blake suffix: blake", () => { + expect(endsWith("blake", "blake")).toBe(true); + }); + + test("input: blake suffix: ake", () => { + expect(endsWith("blake", "ake")).toBe(true); + }); + + test("input: blake suffix: Blake", () => { + expect(endsWith("blake", "Blake")).toBe(false); + }); + + test("input: @@log:* suffix: log:*", () => { + expect(endsWith("@@log:*", "log:*")).toBe(true); + }); + + test("input: test suffix: noPattern", () => { + expect(endsWith("test", "noPattern")).toBe(false); + }); + }); + + describe("toBoolean", () => { + test("input: blake", () => { + expect(toBoolean("blake")).toBe(false); + }); + + test("input: 0", () => { + expect(toBoolean("0")).toBe(false); + }); + + test("input: no", () => { + expect(toBoolean("no")).toBe(false); + }); + + test("input: false", () => { + expect(toBoolean("false")).toBe(false); + }); + + test("input: false (boolean)", () => { + expect(toBoolean(false)).toBe(false); + }); + + test("input: undefined", () => { + expect(toBoolean(undefined)).toBe(false); + }); + + test("input: null", () => { + expect(toBoolean(null)).toBe(false); + }); + + test("input: 1", () => { + expect(toBoolean("1")).toBe(true); + }); + + test("input: yes", () => { + expect(toBoolean("yes")).toBe(true); + }); + + test("input: true", () => { + expect(toBoolean("true")).toBe(true); + }); + + test("input: true (boolean)", () => { + expect(toBoolean(true)).toBe(true); + }); + }); +}); diff --git a/packages/core/test/configuration/Configuration.test.ts b/packages/core/test/configuration/Configuration.test.ts new file mode 100644 index 00000000..50cf5821 --- /dev/null +++ b/packages/core/test/configuration/Configuration.test.ts @@ -0,0 +1,100 @@ +import { describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { Configuration } from "#/configuration/Configuration.js"; + +describe("Configuration", () => { + test("should override configuration defaults", () => { + let config = new Configuration(); + expect(config.apiKey).toEqual(""); + + config.apiKey = "UNIT_TEST_API_KEY"; + expect(config.apiKey).toBe("UNIT_TEST_API_KEY"); + expect(config.includePrivateInformation).toBe(true); + expect(config.includeUserName).toBe(true); + expect(config.includeMachineName).toBe(true); + expect(config.includeIpAddress).toBe(true); + expect(config.includeCookies).toBe(true); + expect(config.includePostData).toBe(true); + expect(config.includeQueryString).toBe(true); + + config = new Configuration(); + config.includePrivateInformation = false; + expect(config.includePrivateInformation).toBe(false); + expect(config.includeUserName).toBe(false); + expect(config.includeMachineName).toBe(false); + expect(config.includeIpAddress).toBe(false); + expect(config.includeCookies).toBe(false); + expect(config.includePostData).toBe(false); + expect(config.includeQueryString).toBe(false); + + config.includeMachineName = true; + expect(config.includePrivateInformation).toBe(false); + expect(config.includeUserName).toBe(false); + expect(config.includeMachineName).toBe(true); + expect(config.includeIpAddress).toBe(false); + expect(config.includeCookies).toBe(false); + expect(config.includePostData).toBe(false); + expect(config.includeQueryString).toBe(false); + }); + + test("should not add duplicate plugin", () => { + const config = new Configuration(); + config.apiKey = "UNIT_TEST_API_KEY"; + + expect(config.plugins).not.toBeNull(); + while (config.plugins.length > 0) { + config.removePlugin(config.plugins[0]); + } + + config.addPlugin("test", 20, () => Promise.resolve()); + config.addPlugin("test", 20, () => Promise.resolve()); + expect(config.plugins.length).toBe(1); + }); + + test("should generate plugin name and priority", () => { + const config = new Configuration(); + config.apiKey = "UNIT_TEST_API_KEY"; + + expect(config.plugins).not.toBeNull(); + while (config.plugins.length > 0) { + config.removePlugin(config.plugins[0]); + } + + config.addPlugin(undefined, NaN, () => Promise.resolve()); + expect(config.plugins.length).toBe(1); + expect(config.plugins[0].name).not.toBeNull(); + expect(config.plugins[0].priority).toBe(0); + }); + + test("should sort plugins by priority", () => { + const config = new Configuration(); + config.apiKey = "UNIT_TEST_API_KEY"; + + expect(config.plugins).not.toBeNull(); + while (config.plugins.length > 0) { + config.removePlugin(config.plugins[0]); + } + + config.addPlugin("3", 3, () => Promise.resolve()); + config.addPlugin("1", 1, () => Promise.resolve()); + config.addPlugin("2", 2, () => Promise.resolve()); + expect(config.plugins.length).toBe(3); + expect(config.plugins[0].priority).toBe(1); + expect(config.plugins[1].priority).toBe(2); + expect(config.plugins[2].priority).toBe(3); + }); + + test("should call subscribe handler", (done) => { + const config = new Configuration(); + expect(config.settings.someValue).toBeUndefined(); + + config.subscribeServerSettingsChange((c: Configuration) => { + expect(c.settings.someValue).toBe("UNIT_TEST_API_KEY"); + expect(config.settings.someValue).toBe("UNIT_TEST_API_KEY"); + done(); + }); + + config.applyServerSettings({ settings: { someValue: "UNIT_TEST_API_KEY" }, version: 2 }); + }); +}); diff --git a/packages/core/test/helpers.ts b/packages/core/test/helpers.ts new file mode 100644 index 00000000..441a64d9 --- /dev/null +++ b/packages/core/test/helpers.ts @@ -0,0 +1,3 @@ +export function delay(ms: number): Promise { + return new Promise((r) => setTimeout(r, ms)); +} diff --git a/packages/core/test/plugins/EventPluginManager.test.ts b/packages/core/test/plugins/EventPluginManager.test.ts new file mode 100644 index 00000000..76b92c39 --- /dev/null +++ b/packages/core/test/plugins/EventPluginManager.test.ts @@ -0,0 +1,128 @@ +import { describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { EventContext } from "#/models/EventContext.js"; +import { ExceptionlessClient } from "#/ExceptionlessClient.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { EventPluginManager } from "#/plugins/EventPluginManager.js"; +import { delay } from "../helpers.js"; + +describe("EventPluginManager", () => { + test("should add items to the event.", async () => { + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + + const context = new EventPluginContext(client, {}, new EventContext()); + expect(context.event.source).toBeUndefined(); + expect(context.event.geo).toBeUndefined(); + + expect(client.config.plugins).not.toBeNull(); + while (client.config.plugins.length > 0) { + client.config.removePlugin(client.config.plugins[0]); + } + + client.config.addPlugin("1", 1, async (ctx: EventPluginContext) => { + await delay(25); + ctx.event.source = "plugin 1"; + }); + + client.config.addPlugin("2", 2, (ctx: EventPluginContext) => { + ctx.event.geo = "43.5775,88.4472"; + return Promise.resolve(); + }); + + await EventPluginManager.run(context); + expect(context.cancelled).toBe(false); + expect(context.event.source).toBe("plugin 1"); + expect(context.event.geo).toBe("43.5775,88.4472"); + }); + + test("setting cancel should stop plugin execution.", async () => { + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + + const context = new EventPluginContext(client, {}, new EventContext()); + expect(client.config.plugins).not.toBeNull(); + while (client.config.plugins.length > 0) { + client.config.removePlugin(client.config.plugins[0]); + } + + client.config.addPlugin("1", 1, (ctx: EventPluginContext) => { + ctx.cancelled = true; + return Promise.resolve(); + }); + + client.config.addPlugin("2", 2, () => { + throw new Error("Plugin should not be called due to cancellation"); + }); + + await EventPluginManager.run(context); + expect(context.cancelled).toBe(true); + }); + + test("throwing error should stop plugin execution.", async () => { + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + const context = new EventPluginContext(client, {}, new EventContext()); + + expect(client.config.plugins).not.toBeNull(); + while (client.config.plugins.length > 0) { + client.config.removePlugin(client.config.plugins[0]); + } + + client.config.addPlugin("1", 1, () => { + throw new Error("Random Error"); + }); + + client.config.addPlugin("2", 2, () => { + throw new Error("Plugin should not be called due to cancellation"); + }); + + await EventPluginManager.run(context); + expect(context.cancelled).toBe(true); + }); + + test("should cancel via timeout.", async () => { + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + const context = new EventPluginContext(client, {}, new EventContext()); + + expect(client.config.plugins).not.toBeNull(); + while (client.config.plugins.length > 0) { + client.config.removePlugin(client.config.plugins[0]); + } + + client.config.addPlugin("1", 1, async () => { + await delay(25); + }); + + client.config.addPlugin("2", 2, () => { + throw new Error("Plugin should not be called due to cancellation"); + }); + + await EventPluginManager.run(context); + expect(context.cancelled).toBe(true); + }); + + test("should ensure config plugins are not wrapped.", async () => { + const client = new ExceptionlessClient(); + client.config.apiKey = "UNIT_TEST_API_KEY"; + const context = new EventPluginContext(client, {}, new EventContext()); + + expect(client.config.plugins).not.toBeNull(); + while (client.config.plugins.length > 0) { + client.config.removePlugin(client.config.plugins[0]); + } + + client.config.addPlugin("1", 1, () => { + return Promise.resolve(); + }); + + expect(client.config.plugins[0].name).toBe("1"); + expect(client.config.plugins.length).toBe(1); + + await EventPluginManager.run(context); + expect(client.config.plugins[0].name).toBe("1"); + expect(client.config.plugins.length).toBe(1); + }); +}); diff --git a/packages/core/test/plugins/default/ConfigurationDefaultsPlugin.test.ts b/packages/core/test/plugins/default/ConfigurationDefaultsPlugin.test.ts new file mode 100644 index 00000000..23a42008 --- /dev/null +++ b/packages/core/test/plugins/default/ConfigurationDefaultsPlugin.test.ts @@ -0,0 +1,65 @@ +import { describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { ExceptionlessClient } from "#/ExceptionlessClient.js"; +import { Event } from "#/models/Event.js"; +import { ConfigurationDefaultsPlugin } from "#/plugins/default/ConfigurationDefaultsPlugin.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { EventContext } from "#/models/EventContext.js"; + +describe("ConfigurationDefaultsPlugin", () => { + describe("should add default", () => { + const userDataKey: string = "user"; + const user = { + id: 1, + name: "Blake", + password: "123456", + passwordResetToken: "a reset token", + myPassword: "123456", + myPasswordValue: "123456", + customValue: "Password", + value: { + Password: "123456" + } + }; + + const defaultTags: string[] = ["tag1", "tag2"]; + + const run = async (dataExclusions?: string[] | undefined): Promise => { + const client = new ExceptionlessClient(); + client.config.defaultTags.push(...defaultTags); + client.config.defaultData[userDataKey] = user; + + if (dataExclusions) { + client.config.addDataExclusions(...dataExclusions); + } + + const ev: Event = { type: "log", source: "test", data: {} }; + + const context = new EventPluginContext(client, ev, new EventContext()); + const plugin = new ConfigurationDefaultsPlugin(); + await plugin.run(context); + + return context.event; + }; + + test("tags", async () => { + const ev = await run(); + expect(ev.tags).toStrictEqual(defaultTags); + }); + + test("user", async () => { + const ev = await run(); + expect(ev.data).toBeDefined(); + expect(ev.data && ev.data[userDataKey]).toStrictEqual(user); + }); + + test("pruned user", async () => { + const ev = await run(["*password*"]); + expect(ev.data).toBeDefined(); + + const expected = { id: 1, name: "Blake", customValue: "Password", value: {} }; + expect(ev.data && ev.data[userDataKey]).toStrictEqual(expected); + }); + }); +}); diff --git a/packages/core/test/plugins/default/DuplicateCheckerPlugin.test.ts b/packages/core/test/plugins/default/DuplicateCheckerPlugin.test.ts new file mode 100644 index 00000000..53eae065 --- /dev/null +++ b/packages/core/test/plugins/default/DuplicateCheckerPlugin.test.ts @@ -0,0 +1,107 @@ +import { beforeEach, describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { DuplicateCheckerPlugin } from "#/plugins/default/DuplicateCheckerPlugin.js"; +import { ExceptionlessClient } from "#/ExceptionlessClient.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { InnerErrorInfo, StackFrameInfo } from "#/models/data/ErrorInfo.js"; +import { delay } from "../../helpers.js"; +import { EventContext } from "#/models/EventContext.js"; + +const Exception1StackTrace = [ + { + file_name: "index.js", + line_number: 0, + column: 50, + is_signature_target: true, + name: "createException" + }, + { + file_name: "index.js", + line_number: 5, + column: 25, + is_signature_target: false, + name: "throwError" + } +]; + +const Exception2StackTrace = [ + { + file_name: "index.js", + line_number: 0, + column: 50, + is_signature_target: true, + name: "createException2" + }, + { + file_name: "index.js", + line_number: 5, + column: 25, + is_signature_target: false, + name: "throwError2" + } +]; + +describe("DuplicateCheckerPlugin", () => { + let now: number = 0; + let client: ExceptionlessClient; + let plugin: DuplicateCheckerPlugin; + + beforeEach(() => { + client = new ExceptionlessClient(); + plugin = new DuplicateCheckerPlugin(() => now, 50); + }); + + const run = async (stackTrace?: StackFrameInfo[]): Promise => { + // TODO: Generate unique stack traces based on test data. + const context = new EventPluginContext( + client, + { + type: "error", + data: { + "@error": { + type: "ReferenceError", + message: "This is a test", + stack_trace: stackTrace + } + } + }, + new EventContext() + ); + + await plugin.run(context); + return context; + }; + + test("should ignore duplicate within window", async () => { + await run(Exception1StackTrace); + + const contextOfSecondRun = await run(Exception1StackTrace); + expect(contextOfSecondRun.cancelled).toBe(true); + await delay(100); + setTimeout(() => { + expect(contextOfSecondRun.event.count).toBe(1); + }, 100); + }); + + test("should ignore error without stack", async () => { + await run(); + const contextOfSecondRun = await run(); + expect(contextOfSecondRun.cancelled).toBe(true); + }); + + test("shouldn't ignore different stack within window", async () => { + await run(Exception1StackTrace); + const contextOfSecondRun = await run(Exception2StackTrace); + + expect(contextOfSecondRun.cancelled).not.toBe(true); + }); + + test("shouldn't ignore duplicate after window", async () => { + await run(Exception1StackTrace); + + now = 3000; + const contextOfSecondRun = await run(Exception1StackTrace); + expect(contextOfSecondRun.cancelled).not.toBe(true); + }); +}); diff --git a/packages/core/test/plugins/default/EventExclusionPlugin.test.ts b/packages/core/test/plugins/default/EventExclusionPlugin.test.ts new file mode 100644 index 00000000..8c4e5807 --- /dev/null +++ b/packages/core/test/plugins/default/EventExclusionPlugin.test.ts @@ -0,0 +1,224 @@ +import { describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { ExceptionlessClient } from "#/ExceptionlessClient.js"; +import { Event, EventType, KnownEventDataKeys, LogLevel } from "#/models/Event.js"; +import { InnerErrorInfo } from "#/models/data/ErrorInfo.js"; +import { EventExclusionPlugin } from "#/plugins/default/EventExclusionPlugin.js"; +import { EventPluginContext } from "#/plugins/EventPluginContext.js"; +import { EventContext } from "#/models/EventContext.js"; + +describe("EventExclusionPlugin", () => { + describe("should exclude log levels", () => { + const run = async ( + source: string | undefined, + level: LogLevel | null | undefined, + settingKey: string | null | undefined, + settingValue: string | null | undefined + ): Promise => { + const client = new ExceptionlessClient(); + if (typeof settingKey == "string") { + client.config.settings[settingKey] = settingValue as string; + } + + const ev: Event = { type: "log", source, data: {} }; + if (ev.data && level) { + ev.data[KnownEventDataKeys.Level] = level; + } + + const context = new EventPluginContext(client, ev, new EventContext()); + const plugin = new EventExclusionPlugin(); + await plugin.run(context); + + return context.cancelled; + }; + + test("", async () => expect(await run(undefined, null, null, null)).toBe(false)); + test("Test", async () => expect(await run("Test", null, null, null)).toBe(false)); + test("[trace] Test", async () => expect(await run("Test", "trace", null, null)).toBe(false)); + test("[Off] Test", async () => expect(await run("Test", "Off", null, null)).toBe(true)); + test("[Abc] Test", async () => expect(await run("Test", "Abc", null, null)).toBe(false)); + test("[trace] (source min level: Off", async () => expect(await run(undefined, "trace", "@@log:", "Off")).toBe(true)); + test("[trace] (global min level: Off", async () => expect(await run(undefined, "trace", "@@log:*", "Off")).toBe(true)); + test("[trace] (source min level: Off", async () => expect(await run(undefined, "trace", "@@log:", "Off")).toBe(true)); + test("[trace] (global min level: Off", async () => expect(await run(undefined, "trace", "@@log:*", "Off")).toBe(true)); + test("[trace] (source min level: Off", async () => expect(await run("", "trace", "@@log:", "Off")).toBe(true)); // Becomes Global Log Level + test("[trace] (global min level: Off", async () => expect(await run("", "trace", "@@log:*", "Off")).toBe(true)); + test("[trace] Test (source min level: false)", async () => expect(await run("Test", "trace", "@@log:Test", "false")).toBe(true)); + test("[trace] Test (source min level: no)", async () => expect(await run("Test", "trace", "@@log:Test", "no")).toBe(true)); + test("[trace] Test (source min level: 0)", async () => expect(await run("Test", "trace", "@@log:Test", "0")).toBe(true)); + test("[trace] Test (source min level: true)", async () => expect(await run("Test", "trace", "@@log:Test", "true")).toBe(false)); + test("[trace] Test (source min level: yes)", async () => expect(await run("Test", "trace", "@@log:Test", "yes")).toBe(false)); + test("[trace] Test (source min level: 1)", async () => expect(await run("Test", "trace", "@@log:Test", "1")).toBe(false)); + test("[trace] Test (source min level: debug)", async () => expect(await run("Test", "trace", "@@log:Test", "debug")).toBe(true)); + test("[info] Test (source min level: debug)", async () => expect(await run("Test", "info", "@@log:Test", "debug")).toBe(false)); + test("[trace] Test (global min level: debug)", async () => expect(await run("Test", "trace", "@@log:*", "debug")).toBe(true)); + test("[warn] Test (global min level: debug)", async () => expect(await run("Test", "warn", "@@log:*", "debug")).toBe(false)); + }); + + describe("should exclude log levels with info default", () => { + const run = async ( + source: string | undefined, + level: LogLevel | null | undefined, + settingKey: string | null | undefined, + settingValue: string | null | undefined + ): Promise => { + const client = new ExceptionlessClient(); + client.config.settings["@@log:*"] = "info"; + if (typeof settingKey === "string") { + client.config.settings[settingKey] = settingValue as string; + } + + const ev: Event = { type: "log", source, data: {} }; + if (ev.data && level) { + ev.data[KnownEventDataKeys.Level] = level; + } + + const context = new EventPluginContext(client, ev, new EventContext()); + const plugin = new EventExclusionPlugin(); + await plugin.run(context); + + return context.cancelled; + }; + + test("", async () => expect(await run(undefined, null, null, null)).toBe(false)); + test("Test", async () => expect(await run("Test", null, null, null)).toBe(false)); + test("[trace] Test", async () => expect(await run("Test", "trace", null, null)).toBe(true)); + test("[warn] Test", async () => expect(await run("Test", "warn", null, null)).toBe(false)); + test("[error] Test (source min level: debug)", async () => expect(await run("Test", "error", "@@log:Test", "debug")).toBe(false)); + test("[debug] Test (source min level: debug)", async () => expect(await run("Test", "debug", "@@log:Test", "debug")).toBe(false)); + }); + + describe("should resolve null and undefined log source levels in reverse settings order", () => { + const plugin = new EventExclusionPlugin(); + const settings: Record = { "@@log:": "info", "@@log:*": "debug" }; + + test(" (global min level: info)", () => expect(plugin.getMinLogLevel(settings, undefined)).toBe(2)); + test(" (source min level: info)", () => expect(plugin.getMinLogLevel(settings, "")).toBe(2)); + test("* (global min level: debug)", () => expect(plugin.getMinLogLevel(settings, "*")).toBe(1)); + }); + + describe("should resolve log source levels and respect settings order", () => { + const plugin = new EventExclusionPlugin(); + const settings = { "@@log:*": "debug", "@@log:": "info" }; + + test(" (source min level: info)", () => expect(plugin.getMinLogLevel(settings, "")).toBe(2)); + test("* (global min level: debug)", () => expect(plugin.getMinLogLevel(settings, "*")).toBe(1)); + }); + + describe("should fallback to global log level setting", () => { + const plugin = new EventExclusionPlugin(); + const settings = { + "@@log:*": "Fatal" + }; + + test(" (source min level: off)", () => expect(plugin.getMinLogLevel(settings, undefined)).toBe(5)); + test(" (source min level: off)", () => expect(plugin.getMinLogLevel(settings, "")).toBe(5)); + test("* (source min level: off)", () => expect(plugin.getMinLogLevel(settings, "*")).toBe(5)); + test("abc (source min level: off)", () => expect(plugin.getMinLogLevel(settings, "abc")).toBe(5)); + }); + + describe("should respect min log levels settings order with global settings", () => { + const plugin = new EventExclusionPlugin(); + const settings = { + "@@log:*": "Fatal", + "@@log:": "debug", + "@@log:abc*": "Off", + "@@log:abc.de*": "debug", + "@@log:abc.def*": "info", + "@@log:abc.def.ghi": "trace" + }; + + test(" (source min level: debug)", () => expect(plugin.getMinLogLevel(settings, undefined)).toBe(1)); + test(" (source min level: debug)", () => expect(plugin.getMinLogLevel(settings, "")).toBe(1)); + test("fallback (global min level: debug)", () => expect(plugin.getMinLogLevel(settings, "fallback")).toBe(5)); + test("abc (source min level: off)", () => expect(plugin.getMinLogLevel(settings, "abc")).toBe(6)); + test("abc.def (source min level: info)", () => expect(plugin.getMinLogLevel(settings, "abc.def")).toBe(2)); + test("abc.def.random (source min level: info)", () => expect(plugin.getMinLogLevel(settings, "abc.def.random")).toBe(2)); + test("abc.def.ghi (source min level: trace)", () => expect(plugin.getMinLogLevel(settings, "abc.def.ghi")).toBe(0)); + }); + + describe("should respect min log levels settings order", () => { + const plugin = new EventExclusionPlugin(); + const settings = { + "@@log:abc.def.ghi": "trace", + "@@log:abc.def*": "info", + "@@log:abc*": "Off" + }; + + test("abc (source min level: off)", () => expect(plugin.getMinLogLevel(settings, "abc")).toBe(6)); + test("abc.def (source min level: info)", () => expect(plugin.getMinLogLevel(settings, "abc.def")).toBe(2)); + test("abc.def.ghi (source min level: trace)", () => expect(plugin.getMinLogLevel(settings, "abc.def.ghi")).toBe(0)); + }); + + describe("should exclude source type", () => { + const run = async ( + type: EventType | null | undefined, + source: string | undefined, + settingKey: string | null | undefined, + settingValue: string | null | undefined + ): Promise => { + const client = new ExceptionlessClient(); + + if (typeof settingKey === "string") { + client.config.settings[settingKey] = settingValue as string; + } + + const context = new EventPluginContext(client, { type: type, source, data: {} }, new EventContext()); + const plugin = new EventExclusionPlugin(); + await plugin.run(context); + + return context.cancelled; + }; + + test("", async () => expect(await run(null, undefined, null, null)).toBe(false)); + test("usage=", async () => expect(await run("usage", undefined, null, null)).toBe(false)); + test("usage=test", async () => expect(await run("usage", "test", null, null)).toBe(false)); + test("usage=test on", async () => expect(await run("usage", "test", "@@usage:Test", "true")).toBe(false)); + test("usage=test off", async () => expect(await run("usage", "test", "@@usage:Test", "false")).toBe(true)); + test("usage=test (global off)", async () => expect(await run("usage", "test", "@@usage:*", "false")).toBe(true)); + test("404=/unknown (global off)", async () => expect(await run("404", "/unknown", "@@404:*", "false")).toBe(true)); + test("404=/unknown on", async () => expect(await run("404", "/unknown", "@@404:/unknown", "true")).toBe(false)); + test("404=/unknown off", async () => expect(await run("404", "/unknown", "@@404:/unknown", "false")).toBe(true)); + test("404= off", async () => expect(await run("404", undefined, "@@404:*", "false")).toBe(true)); + test("404= empty off", async () => expect(await run("404", undefined, "@@404:", "false")).toBe(true)); + test("404= global off", async () => expect(await run("404", undefined, "@@404:*", "false")).toBe(true)); + test("404= empty off", async () => expect(await run("404", undefined, "@@404:", "false")).toBe(true)); + test("404= off", async () => expect(await run("404", "", "@@404:", "false")).toBe(true)); + }); + + describe("should exclude exception type", () => { + const run = async (settingKey: string | null | undefined): Promise => { + const client = new ExceptionlessClient(); + + if (typeof settingKey === "string") { + client.config.settings[settingKey] = "false"; + } + + const context = new EventPluginContext( + client, + { + type: "error", + data: { + "@error": { + type: "ReferenceError", + message: "This is a test", + stack_trace: [] + } + } + }, + new EventContext() + ); + + const plugin = new EventExclusionPlugin(); + await plugin.run(context); + return context.cancelled; + }; + + test("", async () => expect(await run(null)).toBe(false)); + test("@@error:Error", async () => expect(await run("@@error:Error")).toBe(false)); + test("@@error:ReferenceError", async () => expect(await run("@@error:ReferenceError")).toBe(true)); + test("@@error:*Error", async () => expect(await run("@@error:*Error")).toBe(true)); + test("@@error:*", async () => expect(await run("@@error:*")).toBe(true)); + }); +}); diff --git a/packages/core/test/plugins/default/exceptions.ts b/packages/core/test/plugins/default/exceptions.ts new file mode 100644 index 00000000..cb3a21da --- /dev/null +++ b/packages/core/test/plugins/default/exceptions.ts @@ -0,0 +1,283 @@ +export const CapturedExceptions = { + OPERA_854: { + message: + "Statement on line 44: Type mismatch (usually a non-object value used where an object is required)\n" + + "Backtrace:\n" + + " Line 44 of linked script http://path/to/file.js\n" + + " this.undef();\n" + + " Line 31 of linked script http://path/to/file.js\n" + + " ex = ex || this.createException();\n" + + " Line 18 of linked script http://path/to/file.js\n" + + " CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n" + + " Line 4 of inline#1 script in http://path/to/file.js\n" + + " printTrace(printStackTrace());\n" + + " Line 7 of inline#1 script in http://path/to/file.js\n" + + " bar(n - 1);\n" + + " Line 11 of inline#1 script in http://path/to/file.js\n" + + " bar(2);\n" + + " Line 15 of inline#1 script in http://path/to/file.js\n" + + " foo();\n" + + "", + "opera#sourceloc": 44 + }, + OPERA_902: { + message: + "Statement on line 44: Type mismatch (usually a non-object value used where an object is required)\n" + + "Backtrace:\n" + + " Line 44 of linked script http://path/to/file.js\n" + + " this.undef();\n" + + " Line 31 of linked script http://path/to/file.js\n" + + " ex = ex || this.createException();\n" + + " Line 18 of linked script http://path/to/file.js\n" + + " CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n" + + " Line 4 of inline#1 script in http://path/to/file.js\n" + + " printTrace(printStackTrace());\n" + + " Line 7 of inline#1 script in http://path/to/file.js\n" + + " bar(n - 1);\n" + + " Line 11 of inline#1 script in http://path/to/file.js\n" + + " bar(2);\n" + + " Line 15 of inline#1 script in http://path/to/file.js\n" + + " foo();\n" + + "", + "opera#sourceloc": 44 + }, + OPERA_927: { + message: + "Statement on line 43: Type mismatch (usually a non-object value used where an object is required)\n" + + "Backtrace:\n" + + " Line 43 of linked script http://path/to/file.js\n" + + " bar(n - 1);\n" + + " Line 31 of linked script http://path/to/file.js\n" + + " bar(2);\n" + + " Line 18 of linked script http://path/to/file.js\n" + + " foo();\n" + + "", + "opera#sourceloc": 43 + }, + OPERA_964: { + message: + "Statement on line 42: Type mismatch (usually non-object value supplied where object required)\n" + + "Backtrace:\n" + + " Line 42 of linked script http://path/to/file.js\n" + + " this.undef();\n" + + " Line 27 of linked script http://path/to/file.js\n" + + " ex = ex || this.createException();\n" + + " Line 18 of linked script http://path/to/file.js: In function printStackTrace\n" + + " CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n" + + " Line 4 of inline#1 script in http://path/to/file.js: In function bar\n" + + " printTrace(printStackTrace());\n" + + " Line 7 of inline#1 script in http://path/to/file.js: In function bar\n" + + " bar(n - 1);\n" + + " Line 11 of inline#1 script in http://path/to/file.js: In function foo\n" + + " bar(2);\n" + + " Line 15 of inline#1 script in http://path/to/file.js\n" + + " foo();\n" + + "", + "opera#sourceloc": 42, + stacktrace: + " ... Line 27 of linked script http://path/to/file.js\n" + + " ex = ex || this.createException();\n" + + " Line 18 of linked script http://path/to/file.js: In function printStackTrace\n" + + " CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n" + + " Line 4 of inline#1 script in http://path/to/file.js: In function bar\n" + + " printTrace(printStackTrace());\n" + + " Line 7 of inline#1 script in http://path/to/file.js: In function bar\n" + + " bar(n - 1);\n" + + " Line 11 of inline#1 script in http://path/to/file.js: In function foo\n" + + " bar(2);\n" + + " Line 15 of inline#1 script in http://path/to/file.js\n" + + " foo();\n" + + "" + }, + OPERA_10: { + message: "Statement on line 42: Type mismatch (usually non-object value supplied where object required)", + "opera#sourceloc": 42, + stacktrace: + " Line 42 of linked script http://path/to/file.js\n" + + " this.undef();\n" + + " Line 27 of linked script http://path/to/file.js\n" + + " ex = ex || this.createException();\n" + + " Line 18 of linked script http://path/to/file.js: In function printStackTrace\n" + + " CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n" + + " Line 4 of inline#1 script in http://path/to/file.js: In function bar\n" + + " printTrace(printStackTrace());\n" + + " Line 7 of inline#1 script in http://path/to/file.js: In function bar\n" + + " bar(n - 1);\n" + + " Line 11 of inline#1 script in http://path/to/file.js: In function foo\n" + + " bar(2);\n" + + " Line 15 of inline#1 script in http://path/to/file.js\n" + + " foo();\n" + + "" + }, + OPERA_11: { + message: '"this.undef" is not a function', + stack: + "([arguments not available])@http://path/to/file.js:27\n" + + "bar([arguments not available])@http://domain.com:1234/path/to/file.js:18\n" + + "foo([arguments not available])@http://domain.com:1234/path/to/file.js:11\n" + + "@http://path/to/file.js:15\n" + + "Error created at @http://path/to/file.js:15", + stacktrace: + "Error thrown at line 42, column 12 in () in http://path/to/file.js:\n" + + " this.undef();\n" + + "called from line 27, column 8 in (ex) in http://path/to/file.js:\n" + + " ex = ex || this.createException();\n" + + "called from line 18, column 4 in printStackTrace(options) in http://path/to/file.js:\n" + + " CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n" + + "called from line 4, column 5 in bar(n) in http://path/to/file.js:\n" + + " printTrace(printStackTrace());\n" + + "called from line 7, column 4 in bar(n) in http://path/to/file.js:\n" + + " bar(n - 1);\n" + + "called from line 11, column 4 in foo() in http://path/to/file.js:\n" + + " bar(2);\n" + + "called from line 15, column 3 in http://path/to/file.js:\n" + + " foo();" + }, + OPERA_12: { + message: 'Cannot convert "x" to object', + stack: + "([arguments not available])@http://localhost:8000/ExceptionLab.html:48\n" + + "dumpException3([arguments not available])@http://localhost:8000/ExceptionLab.html:46\n" + + "([arguments not available])@http://localhost:8000/ExceptionLab.html:1", + stacktrace: + "Error thrown at line 48, column 12 in (x) in http://localhost:8000/ExceptionLab.html:\n" + + " x.undef();\n" + + "called from line 46, column 8 in dumpException3() in http://localhost:8000/ExceptionLab.html:\n" + + " dumpException((function(x) {\n" + + "called from line 1, column 0 in (event) in http://localhost:8000/ExceptionLab.html:\n" + + " dumpException3();" + }, + OPERA_25: { + message: 'Cannot read property "undef" of null', + name: "TypeError", + stack: + 'TypeError: Cannot read property "undef" of null\n' + + " at http://path/to/file.js:47:22\n" + + " at foo (http://path/to/file.js:52:15)\n" + + " at bar (http://path/to/file.js:108:168)" + }, + CHROME_15: { + arguments: ["undef"], + message: 'Object # has no method "undef"', + stack: + 'TypeError: Object # has no method "undef"\n' + + " at bar (http://path/to/file.js:13:17)\n" + + " at bar (http://path/to/file.js:16:5)\n" + + " at foo (http://path/to/file.js:20:5)\n" + + " at http://path/to/file.js:24:4" + }, + CHROME_36: { + message: "Default error", + name: "Error", + stack: + "Error: Default error\n" + + " at dumpExceptionError (http://localhost:8080/file.js:41:27)\n" + + " at HTMLButtonElement.onclick (http://localhost:8080/file.js:107:146)" + }, + FIREFOX_3: { + fileName: "http://127.0.0.1:8000/js/stacktrace.js", + lineNumber: 44, + message: "this.undef is not a function", + name: "TypeError", + stack: + "()@http://127.0.0.1:8000/js/stacktrace.js:44\n" + + "(null)@http://127.0.0.1:8000/js/stacktrace.js:31\n" + + "printStackTrace()@http://127.0.0.1:8000/js/stacktrace.js:18\n" + + "bar(1)@http://127.0.0.1:8000/js/file.js:13\n" + + "bar(2)@http://127.0.0.1:8000/js/file.js:16\n" + + "foo()@http://127.0.0.1:8000/js/file.js:20\n" + + "@http://127.0.0.1:8000/js/file.js:24\n" + + "" + }, + FIREFOX_7: { + fileName: "file:///G:/js/stacktrace.js", + lineNumber: 44, + stack: + "()@file:///G:/js/stacktrace.js:44\n" + + "(null)@file:///G:/js/stacktrace.js:31\n" + + "printStackTrace()@file:///G:/js/stacktrace.js:18\n" + + "bar(1)@file:///G:/js/file.js:13\n" + + "bar(2)@file:///G:/js/file.js:16\n" + + "foo()@file:///G:/js/file.js:20\n" + + "@file:///G:/js/file.js:24\n" + + "" + }, + FIREFOX_14: { + message: "x is null", + stack: "@http://path/to/file.js:48\n" + "dumpException3@http://path/to/file.js:52\n" + "onclick@http://path/to/file.js:1\n" + "", + fileName: "http://path/to/file.js", + lineNumber: 48 + }, + FIREFOX_31: { + message: "Default error", + name: "Error", + stack: "foo@http://path/to/file.js:41:13\n" + "bar@http://path/to/file.js:1:1\n" + "", + fileName: "http://path/to/file.js", + lineNumber: 41, + columnNumber: 12 + }, + SAFARI_6: { + message: '"null" is not an object (evaluating "x.undef")', + stack: "@http://path/to/file.js:48\n" + "dumpException3@http://path/to/file.js:52\n" + "onclick@http://path/to/file.js:82\n" + "[native code]", + line: 48, + sourceURL: "http://path/to/file.js" + }, + SAFARI_7: { + message: '"null" is not an object (evaluating "x.undef")', + name: "TypeError", + stack: "http://path/to/file.js:48:22\n" + "foo@http://path/to/file.js:52:15\n" + "bar@http://path/to/file.js:108:107", + line: 47, + sourceURL: "http://path/to/file.js" + }, + SAFARI_8: { + message: 'null is not an object (evaluating "x.undef")', + name: "TypeError", + stack: "http://path/to/file.js:47:22\n" + "foo@http://path/to/file.js:52:15\n" + "bar@http://path/to/file.js:108:23", + line: 47, + column: 22, + sourceURL: "http://path/to/file.js" + }, + SAFARI_8_EVAL: { + message: 'Can"t find variable: getExceptionProps', + name: "ReferenceError", + stack: "eval code\n" + "eval@[native code]\n" + "foo@http://path/to/file.js:58:21\n" + "bar@http://path/to/file.js:109:91", + line: 1, + column: 18 + }, + IE_9: { + message: 'Unable to get property "undef" of undefined or null reference', + description: 'Unable to get property "undef" of undefined or null reference' + }, + IE_10: { + message: 'Unable to get property "undef" of undefined or null reference', + stack: + 'TypeError: Unable to get property "undef" of undefined or null reference\n' + + " at Anonymous function (http://path/to/file.js:48:13)\n" + + " at foo (http://path/to/file.js:46:9)\n" + + " at bar (http://path/to/file.js:82:1)", + description: 'Unable to get property "undef" of undefined or null reference', + number: -2146823281 + }, + IE_11: { + message: 'Unable to get property "undef" of undefined or null reference', + name: "TypeError", + stack: + 'TypeError: Unable to get property "undef" of undefined or null reference\n' + + " at Anonymous function (http://path/to/file.js:47:21)\n" + + " at foo (http://path/to/file.js:45:13)\n" + + " at bar (http://path/to/file.js:108:1)", + description: 'Unable to get property "undef" of undefined or null reference', + number: -2146823281 + }, + IE_11_EVAL: { + message: '"getExceptionProps" is undefined', + name: "ReferenceError", + stack: + 'ReferenceError: "getExceptionProps" is undefined\n' + + " at eval code (eval code:1:1)\n" + + " at foo (http://path/to/file.js:58:17)\n" + + " at bar (http://path/to/file.js:109:1)", + description: '"getExceptionProps" is undefined', + number: -2146823279 + } +}; diff --git a/packages/core/test/queue/DefaultEventQueue.test.ts b/packages/core/test/queue/DefaultEventQueue.test.ts new file mode 100644 index 00000000..15638e38 --- /dev/null +++ b/packages/core/test/queue/DefaultEventQueue.test.ts @@ -0,0 +1,75 @@ +import { afterEach, beforeEach, describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { Configuration } from "#/configuration/Configuration.js"; +import { Event } from "#/models/Event.js"; +import { DefaultEventQueue } from "#/queue/DefaultEventQueue.js"; +import { delay } from "../helpers.js"; + +describe("DefaultEventQueue", () => { + let config: Configuration; + + beforeEach(async () => { + config = new Configuration(); + config.apiKey = "UNIT_TEST_API_KEY"; + config.serverUrl = "http://server.localhost:5000"; + config.usePersistedQueueStorage = true; + + expect(await config.services.storage.length()).toBe(0); + }); + + afterEach(async () => { + const queue = config.services.queue; + await queue.suspend(); + }); + + test("should enqueue event", async () => { + const event: Event = { type: "log", reference_id: "123454321" }; + await config.services.queue.enqueue(event); + expect(await config.services.storage.length()).toBe(1); + }); + + test("should process queue", async () => { + const event: Event = { type: "log", reference_id: "123454321" }; + await config.services.queue.enqueue(event); + expect(await config.services.storage.length()).toBe(1); + await config.services.queue.process(); + + config.services.queue.onEventsPosted(async () => { + expect((config.services.queue as { _suspendProcessingUntil?: Date })._suspendProcessingUntil).toBeUndefined(); + expect(await config.services.storage.length()).toBe(0); + }); + }); + + test("should discard event submission", async () => { + await config.services.queue.suspendProcessing(1, true); + + const event: Event = { type: "log", reference_id: "123454321" }; + await config.services.queue.enqueue(event); + expect(await config.services.storage.length()).toBe(0); + }); + + test("should suspend processing", async () => { + await config.services.queue.suspendProcessing(0.0001); + + const event: Event = { type: "log", reference_id: "123454321" }; + await config.services.queue.enqueue(event); + expect(await config.services.storage.length()).toBe(1); + + await delay(25); + if (!(config.services.queue as { _suspendProcessingUntil?: Date })._suspendProcessingUntil) { + expect(await config.services.storage.length()).toBe(0); + } else { + expect(await config.services.storage.length()).toBe(1); + } + }); + + test("should respect max items", async () => { + config.services.queue = new DefaultEventQueue(config, 1); + const event: Event = { type: "log", reference_id: "123454321" }; + for (let index = 0; index < 2; index++) { + await config.services.queue.enqueue(event); + expect(await config.services.storage.length()).toBe(1); + } + }); +}); diff --git a/packages/core/test/storage/InMemoryStorage.test.ts b/packages/core/test/storage/InMemoryStorage.test.ts new file mode 100644 index 00000000..143aae96 --- /dev/null +++ b/packages/core/test/storage/InMemoryStorage.test.ts @@ -0,0 +1,5 @@ +import { InMemoryStorage } from "#/storage/InMemoryStorage.js"; +import { IStorage } from "#/storage/IStorage.js"; +import { describeStorage } from "./StorageTestBase.js"; + +describeStorage("InMemoryStorage", (): IStorage => new InMemoryStorage()); diff --git a/packages/core/test/storage/LocalStorage.test.ts b/packages/core/test/storage/LocalStorage.test.ts new file mode 100644 index 00000000..9eb71a71 --- /dev/null +++ b/packages/core/test/storage/LocalStorage.test.ts @@ -0,0 +1,9 @@ +import { IStorage } from "#/storage/IStorage.js"; +import { describeStorage } from "./StorageTestBase.js"; +import { LocalStorage } from "#/storage/LocalStorage.js"; + +function resetLocalStorage() { + localStorage.clear(); +} + +describeStorage("LocalStorage", (): IStorage => new LocalStorage(), resetLocalStorage, resetLocalStorage); diff --git a/packages/core/test/storage/StorageTestBase.ts b/packages/core/test/storage/StorageTestBase.ts new file mode 100644 index 00000000..acf7e8c6 --- /dev/null +++ b/packages/core/test/storage/StorageTestBase.ts @@ -0,0 +1,91 @@ +import { afterEach, beforeEach, describe, test } from "@jest/globals"; +import { expect } from "expect"; + +import { IStorage } from "#/storage/IStorage.js"; + +export function describeStorage(name: string, storageFactory: () => IStorage, afterEachCallback?: () => void, beforeEachCallback?: () => void): void { + describe(name, () => { + if (beforeEachCallback) { + beforeEach(beforeEachCallback); + } + + if (afterEachCallback) { + afterEach(afterEachCallback); + } + + test("can save item", async () => { + const storage = storageFactory(); + expect(await storage.length()).toBe(0); + expect(await storage.keys()).toEqual([]); + expect(await storage.key(0)).toBeNull(); + + const file: string = "event.json"; + const value: string = "test"; + + await storage.setItem(file, value); + expect(await storage.length()).toBe(1); + expect(await storage.getItem(file)).toEqual(value); + expect(await storage.keys()).toEqual([file]); + expect(await storage.key(0)).toEqual(file); + }); + + test("can remove item", async () => { + const storage = storageFactory(); + expect(await storage.length()).toBe(0); + expect(await storage.keys()).toEqual([]); + expect(await storage.key(0)).toBeNull(); + + const file: string = "event.json"; + const value: string = "test"; + + await storage.setItem(file, value); + expect(await storage.length()).toBe(1); + expect(await storage.keys()).toEqual([file]); + expect(await storage.key(0)).toEqual(file); + + await storage.removeItem(file); + expect(await storage.length()).toBe(0); + expect(await storage.keys()).toEqual([]); + expect(await storage.key(0)).toBeNull(); + }); + + test("can clear", async () => { + const storage = storageFactory(); + expect(await storage.length()).toBe(0); + expect(await storage.keys()).toEqual([]); + expect(await storage.key(0)).toBeNull(); + + await storage.setItem("event.json", "test"); + expect(await storage.length()).toBe(1); + + await storage.clear(); + expect(await storage.length()).toBe(0); + expect(await storage.keys()).toEqual([]); + expect(await storage.key(0)).toBeNull(); + }); + + test("can handle missing files", async () => { + const storage = storageFactory(); + expect(await storage.length()).toBe(0); + expect(await storage.keys()).toEqual([]); + expect(await storage.key(0)).toBeNull(); + + const file: string = "event.json"; + const value: string = "test"; + + await storage.setItem(file, value); + expect(await storage.length()).toBe(1); + expect(await storage.keys()).toEqual([file]); + expect(await storage.key(0)).toEqual(file); + + await storage.removeItem("random.json"); + expect(await storage.length()).toBe(1); + expect(await storage.keys()).toEqual([file]); + expect(await storage.key(0)).toEqual(file); + + expect(await storage.key(1)).toBeNull(); + expect(await storage.getItem("random.json")).toBeNull(); + }); + // what to do about null or undefined keys? + }); +} diff --git a/packages/core/test/submission/TestSubmissionClient.test.ts b/packages/core/test/submission/TestSubmissionClient.test.ts new file mode 100644 index 00000000..7e534d8a --- /dev/null +++ b/packages/core/test/submission/TestSubmissionClient.test.ts @@ -0,0 +1,110 @@ +import { describe, jest, test } from "@jest/globals"; +import { expect } from "expect"; + +import { Configuration } from "#/configuration/Configuration.js"; +import { ServerSettings } from "#/configuration/SettingsManager.js"; +import { Event } from "#/models/Event.js"; +import { UserDescription } from "#/models/data/UserDescription.js"; +import { Response } from "#/submission/Response.js"; +import { TestSubmissionClient } from "./TestSubmissionClient.js"; +import { FetchOptions } from "#/submission/DefaultSubmissionClient.js"; + +describe("TestSubmissionClient", () => { + const config: Configuration = new Configuration(); + config.apiKey = "UNIT_TEST_API_KEY"; + config.serverUrl = "http://server.localhost:5000"; + config.configServerUrl = "http://config.localhost:5000"; + config.heartbeatServerUrl = "http://heartbeat.localhost:5000"; + + test("should submit events", async () => { + const apiFetchMock = jest + .fn<(url: string, options: FetchOptions) => Promise>>() + .mockReturnValueOnce(Promise.resolve(new Response(202, "", NaN, NaN, undefined))); + + const events: Event[] = [{ type: "log", message: "From js client", reference_id: "123454321" }]; + const client = new TestSubmissionClient(config, apiFetchMock); + await client.submitEvents(events); + expect(apiFetchMock).toHaveBeenCalledTimes(1); + expect(apiFetchMock.mock.calls[0][0]).toBe(`${config.serverUrl}/api/v2/events`); + expect(apiFetchMock.mock.calls[0][1]).toEqual({ + method: "POST", + body: JSON.stringify(events) + }); + }); + + test("should submit invalid object data", async () => { + const apiFetchMock = jest + .fn<(url: string, options: FetchOptions) => Promise>>() + .mockReturnValueOnce(Promise.resolve(new Response(202, "", NaN, NaN, undefined))); + + const events: Event[] = [ + { + type: "log", + message: "From js client", + reference_id: "123454321", + data: { + name: "blake", + age: () => { + throw new Error("Test"); + } + } + } + ]; + + const client = new TestSubmissionClient(config, apiFetchMock); + await client.submitEvents(events); + expect(apiFetchMock).toHaveBeenCalledTimes(1); + expect(apiFetchMock.mock.calls[0][0]).toBe(`${config.serverUrl}/api/v2/events`); + expect(apiFetchMock.mock.calls[0][1]).toEqual({ + method: "POST", + body: JSON.stringify(events) + }); + }); + + test("should submit user description", async () => { + const apiFetchMock = jest + .fn<(url: string, options: FetchOptions) => Promise>>() + .mockReturnValueOnce(Promise.resolve(new Response(202, "", NaN, 1, undefined))) + .mockReturnValueOnce(Promise.resolve(new Response(202, "", NaN, NaN, JSON.stringify(new ServerSettings({}, 1))))); + + const description: UserDescription = { + email_address: "norply@exceptionless.io", + description: "unit test" + }; + + const client = (config.services.submissionClient = new TestSubmissionClient(config, apiFetchMock)); + await client.submitUserDescription("123454321", description); + expect(apiFetchMock).toHaveBeenCalledTimes(2); + expect(apiFetchMock.mock.calls[0][0]).toBe(`${config.serverUrl}/api/v2/events/by-ref/123454321/user-description`); + expect(apiFetchMock.mock.calls[0][1]).toEqual({ + method: "POST", + body: JSON.stringify(description) + }); + expect(apiFetchMock.mock.calls[1][0]).toBe(`${config.serverUrl}/api/v2/projects/config?v=0`); + expect(apiFetchMock.mock.calls[1][1]).toEqual({ method: "GET" }); + }); + + test("should submit heartbeat", async () => { + const apiFetchMock = jest + .fn<(url: string, options: FetchOptions) => Promise>>() + .mockReturnValueOnce(Promise.resolve(new Response(200, "", NaN, NaN, undefined))); + + const client = new TestSubmissionClient(config, apiFetchMock); + await client.submitHeartbeat("sessionId", true); + expect(apiFetchMock).toHaveBeenCalledTimes(1); + expect(apiFetchMock.mock.calls[0][0]).toBe(`${config.heartbeatServerUrl}/api/v2/events/session/heartbeat?id=sessionId&close=true`); + expect(apiFetchMock.mock.calls[0][1]).toEqual({ method: "GET" }); + }); + + test("should get project settings", async () => { + const apiFetchMock = jest + .fn<(url: string, options: FetchOptions) => Promise>>() + .mockReturnValueOnce(Promise.resolve(new Response(200, "", NaN, NaN, JSON.stringify(new ServerSettings({}, 1))))); + + const client = new TestSubmissionClient(config, apiFetchMock); + await client.getSettings(0); + expect(apiFetchMock).toHaveBeenCalledTimes(1); + expect(apiFetchMock.mock.calls[0][0]).toBe(`${config.serverUrl}/api/v2/projects/config?v=0`); + expect(apiFetchMock.mock.calls[0][1]).toEqual({ method: "GET" }); + }); +}); diff --git a/packages/core/test/submission/TestSubmissionClient.ts b/packages/core/test/submission/TestSubmissionClient.ts new file mode 100644 index 00000000..70cf1e0f --- /dev/null +++ b/packages/core/test/submission/TestSubmissionClient.ts @@ -0,0 +1,23 @@ +import { Configuration } from "#/configuration/Configuration.js"; +import { DefaultSubmissionClient, FetchOptions } from "#/submission/DefaultSubmissionClient.js"; +import { Response } from "#/submission/Response.js"; + +export type ApiFetchMock = (url: string, options: FetchOptions) => Promise>; + +export class TestSubmissionClient extends DefaultSubmissionClient { + public constructor( + protected config: Configuration, + protected apiFetchMock: ApiFetchMock + ) { + super(config); + } + + protected async apiFetch(url: string, options: FetchOptions): Promise> { + if (!this.apiFetchMock) { + throw new Error("Missing mock"); + } + + const response = await this.apiFetchMock(url, options); + return response as Response; + } +} diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 00000000..4f4fd36d --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "paths": { + "#/*": ["./src/*"] + }, + "rootDir": "src", + "types": ["jest"] + }, + "include": ["src"] +} diff --git a/packages/node/LICENSE b/packages/node/LICENSE new file mode 100644 index 00000000..e06d2081 --- /dev/null +++ b/packages/node/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/packages/node/README.md b/packages/node/README.md new file mode 100644 index 00000000..4884cbed --- /dev/null +++ b/packages/node/README.md @@ -0,0 +1,59 @@ +# Exceptionless NodeJS + +Using Exceptionless in the NodeJS environment is similar to using it in other +JavaScript environments. + +## Getting Started + +To use this package, your must be using ES6 and Node 18+. + +## Installation + +`npm install @exceptionless/node --save` + +## Configuration + +While your app is starting up, you should call `startup` on the Exceptionless +client. This ensures the client is configured and automatic capturing of +unhandled errors occurs. + +```js +import { Exceptionless } from "@exceptionless/node"; + +await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; + + // set some default data + c.defaultData["mydata"] = { + myGreeting: "Hello World" + }; + + c.defaultTags.push("Example", "JavaScript", "Node"); +}); +``` + +Once that's done, you can use the Exceptionless client anywhere in your app by +importing `Exceptionless` followed by the method you want to use. For example: + +```js +await Exceptionless.submitLog("Hello world!"); +``` + +Please see the [docs](https://exceptionless.com/docs/clients/javascript/) for +more information on configuring the client. + +### Source Maps + +For improved stack traces launch your Node app with the +[`--enable-source-maps` command line option](https://nodejs.org/docs/latest-v18.x/api/cli.html#--enable-source-maps). + +```sh +node app.js --enable-source-maps +``` + +## Support + +If you need help, please contact us via in-app support, +[open an issue](https://github.com/exceptionless/Exceptionless.JavaScript/issues/new) +or [join our chat on Discord](https://discord.gg/6HxgFCx). We’re always here to +help if you have any questions! diff --git a/packages/node/package.json b/packages/node/package.json new file mode 100644 index 00000000..21b6ea62 --- /dev/null +++ b/packages/node/package.json @@ -0,0 +1,87 @@ +{ + "name": "@exceptionless/node", + "version": "3.0.0-dev", + "description": "JavaScript client for Exceptionless", + "author": { + "name": "exceptionless", + "url": "https://exceptionless.com" + }, + "keywords": [ + "exceptionless", + "error", + "feature", + "logging", + "tracking", + "reporting", + "node" + ], + "repository": { + "url": "git://github.com/exceptionless/Exceptionless.JavaScript.git", + "type": "git" + }, + "bugs": { + "url": "https://github.com/exceptionless/Exceptionless.JavaScript/issues" + }, + "license": "Apache-2.0", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "unpkg": "dist/index.bundle.min.js", + "jsdelivr": "dist/index.bundle.min.js", + "exports": { + ".": "./dist/index.js", + "./package.json": "./package.json" + }, + "imports": { + "#/*": { + "source": "./src/*", + "default": "./dist/*" + } + }, + "engines": { + "node": ">=24" + }, + "jest": { + "moduleFileExtensions": [ + "js", + "ts" + ], + "moduleNameMapper": { + "^@exceptionless/(.*)$": "/../$1/src" + }, + "resolver": "../../jest-resolver.cjs", + "transform": { + "^.+\\.tsx?$": [ + "ts-jest", + { + "diagnostics": false + } + ] + }, + "testEnvironment": "node" + }, + "scripts": { + "build": "tsc -p tsconfig.json && esbuild src/index.ts --bundle --sourcemap --platform=node --format=esm --conditions=source --outfile=dist/index.bundle.js", + "watch": "tsc -p ../core/tsconfig.json -w --preserveWatchOutput & tsc -p tsconfig.json -w --preserveWatchOutput & esbuild src/index.ts --bundle --platform=node --sourcemap --format=esm --conditions=source --watch --outfile=dist/index.bundle.js", + "test": "jest", + "test:watch": "jest --watch" + }, + "sideEffects": false, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@jest/globals": "^30.3.0", + "@types/node": "^25.5.0", + "@types/node-localstorage": "^1.3.3", + "@types/stack-trace": "^0.0.33", + "esbuild": "^0.27.4", + "jest": "^30.3.0", + "ts-jest": "^29.4.6" + }, + "dependencies": { + "@exceptionless/core": "3.0.0-dev", + "node-localstorage": "^3.0.5", + "stack-trace": "^1.0.0-pre2" + } +} diff --git a/packages/node/src/NodeExceptionlessClient.ts b/packages/node/src/NodeExceptionlessClient.ts new file mode 100644 index 00000000..908eed7e --- /dev/null +++ b/packages/node/src/NodeExceptionlessClient.ts @@ -0,0 +1,36 @@ +import { Configuration, ExceptionlessClient, LocalStorage, SimpleErrorPlugin } from "@exceptionless/core"; + +import { LocalStorage as LocalStoragePolyfill } from "node-localstorage"; + +import { NodeErrorPlugin } from "#/plugins/NodeErrorPlugin.js"; +import { NodeEnvironmentInfoPlugin } from "#/plugins/NodeEnvironmentInfoPlugin.js"; +import { NodeGlobalHandlerPlugin } from "#/plugins/NodeGlobalHandlerPlugin.js"; +import { NodeLifeCyclePlugin } from "#/plugins/NodeLifeCyclePlugin.js"; +import { NodeRequestInfoPlugin } from "#/plugins/NodeRequestInfoPlugin.js"; +import { NodeWrapFunctions } from "#/plugins/NodeWrapFunctions.js"; + +export class NodeExceptionlessClient extends ExceptionlessClient { + public async startup(configurationOrApiKey?: (config: Configuration) => void | string): Promise { + const config = this.config; + + if (configurationOrApiKey && !this._initialized) { + try { + const storage = new LocalStorage(undefined, new LocalStoragePolyfill(process.cwd() + "/.exceptionless")); + config.useLocalStorage = () => storage; + config.services.storage = storage; + } catch (ex) { + this.config.services.log.info(`Error configuring localStorage polyfill: ${ex instanceof Error ? ex.message : ex + ""}`); + } + + config.addPlugin(new NodeEnvironmentInfoPlugin()); + config.addPlugin(new NodeGlobalHandlerPlugin()); + config.addPlugin(new NodeLifeCyclePlugin()); + config.addPlugin(new NodeRequestInfoPlugin()); + config.addPlugin(new NodeWrapFunctions()); + config.addPlugin(new NodeErrorPlugin()); + config.removePlugin(new SimpleErrorPlugin()); + } + + await super.startup(configurationOrApiKey); + } +} diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts new file mode 100644 index 00000000..68b12e8e --- /dev/null +++ b/packages/node/src/index.ts @@ -0,0 +1,13 @@ +export * from "@exceptionless/core"; + +export { NodeErrorPlugin } from "#/plugins/NodeErrorPlugin.js"; +export { NodeEnvironmentInfoPlugin } from "#/plugins/NodeEnvironmentInfoPlugin.js"; +export { NodeGlobalHandlerPlugin } from "#/plugins/NodeGlobalHandlerPlugin.js"; +export { NodeLifeCyclePlugin } from "#/plugins/NodeLifeCyclePlugin.js"; +export { NodeRequestInfoPlugin } from "#/plugins/NodeRequestInfoPlugin.js"; +export { NodeWrapFunctions } from "#/plugins/NodeWrapFunctions.js"; +export { NodeExceptionlessClient } from "#/NodeExceptionlessClient.js"; + +import { NodeExceptionlessClient } from "#/NodeExceptionlessClient.js"; + +export const Exceptionless = new NodeExceptionlessClient(); diff --git a/packages/node/src/plugins/NodeEnvironmentInfoPlugin.ts b/packages/node/src/plugins/NodeEnvironmentInfoPlugin.ts new file mode 100644 index 00000000..92b62b42 --- /dev/null +++ b/packages/node/src/plugins/NodeEnvironmentInfoPlugin.ts @@ -0,0 +1,91 @@ +import { argv, memoryUsage, pid, title, version } from "process"; + +import { arch, cpus, endianness, freemem, hostname, loadavg, networkInterfaces, platform, release, tmpdir, totalmem, type, uptime } from "os"; + +import { EnvironmentInfo, EventPluginContext, IEventPlugin, KnownEventDataKeys } from "@exceptionless/core"; + +export class NodeEnvironmentInfoPlugin implements IEventPlugin { + public priority: number = 80; + public name: string = "NodeEnvironmentInfoPlugin"; + private _environmentInfo: EnvironmentInfo | undefined; + + public run(context: EventPluginContext): Promise { + if (context.event.data && !context.event.data[KnownEventDataKeys.EnvironmentInfo]) { + const info: EnvironmentInfo | undefined = this.getEnvironmentInfo(context); + if (info) { + context.event.data[KnownEventDataKeys.EnvironmentInfo] = info; + } + } + + return Promise.resolve(); + } + + private getEnvironmentInfo(context: EventPluginContext): EnvironmentInfo | undefined { + function getIpAddresses(): string { + const ips: string[] = []; + + for (const ni of Object.values(networkInterfaces())) { + for (const network of ni || []) { + if (!network.internal && "IPv4" === network.family) { + ips.push(network.address); + } + } + } + + return ips.join(", "); + } + + function populateMemoryAndUptimeInfo(ei: EnvironmentInfo) { + ei.process_memory_size = memoryUsage().heapTotal; + ei.total_physical_memory = totalmem(); + ei.available_physical_memory = freemem(); + (ei.data as Record).loadavg = loadavg(); + (ei.data as Record).uptime = uptime(); + } + + if (!cpus) { + return; + } + + if (this._environmentInfo) { + populateMemoryAndUptimeInfo(this._environmentInfo); + return this._environmentInfo; + } + + const info: EnvironmentInfo = { + processor_count: cpus().length, + command_line: argv.join(" "), + process_name: (title || "").replace(/[\uE000-\uF8FF]/g, ""), + process_id: pid + "", + process_memory_size: memoryUsage().heapTotal, + // thread_id: "", + architecture: arch(), + o_s_name: type(), + o_s_version: release(), + // install_id: "", + runtime_version: version, + data: { + platform: platform(), + tmpdir: tmpdir() + } + }; + + const config = context.client.config; + if (config.includeMachineName) { + info.machine_name = hostname(); + } + + if (config.includeIpAddress) { + info.ip_address = getIpAddresses(); + } + + if (endianness) { + (info.data as Record).endianness = endianness(); + } + + populateMemoryAndUptimeInfo(info); + + this._environmentInfo = info; + return this._environmentInfo; + } +} diff --git a/packages/node/src/plugins/NodeErrorPlugin.ts b/packages/node/src/plugins/NodeErrorPlugin.ts new file mode 100644 index 00000000..7baa4709 --- /dev/null +++ b/packages/node/src/plugins/NodeErrorPlugin.ts @@ -0,0 +1,86 @@ +import { + IEventPlugin, + ErrorInfo, + EventPluginContext, + KnownEventDataKeys, + IgnoredErrorProperties, + isEmpty, + StackFrameInfo, + stringify +} from "@exceptionless/core"; + +import { parse as fromError } from "stack-trace"; + +export class NodeErrorPlugin implements IEventPlugin { + public priority = 30; + public name = "NodeErrorPlugin"; + + public async run(context: EventPluginContext): Promise { + const exception = context.eventContext.getException(); + if (exception) { + if (!context.event.type) { + context.event.type = "error"; + } + + if (context.event.data && !context.event.data[KnownEventDataKeys.Error]) { + const result = await this.parse(exception); + if (result) { + const exclusions = context.client.config.dataExclusions.concat(IgnoredErrorProperties); + const additionalData = stringify(exception, exclusions); + if (!isEmpty(additionalData)) { + if (!result.data) { + result.data = {}; + } + + result.data["@ext"] = JSON.parse(additionalData); + } + + context.event.data[KnownEventDataKeys.Error] = result; + } + } + } + } + + private parse(exception: Error): Promise { + type stackFrameShape = { + methodName: string; + functionName: string; + fileName: string; + lineNumber: number; + columnNumber: number; + typeName: string; + native: boolean; + }; + + function getStackFrames(stackFrames: stackFrameShape[]): StackFrameInfo[] { + const frames: StackFrameInfo[] = []; + + for (const frame of stackFrames) { + frames.push({ + name: frame.methodName || frame.functionName, + parameters: [], // TODO: See if there is a way to get this. + file_name: frame.fileName, + line_number: frame.lineNumber || 0, + column: frame.columnNumber || 0, + declaring_type: frame.typeName, + data: { + is_native: frame.native || (frame.fileName && frame.fileName[0] !== "/" && frame.fileName[0] !== ".") + } + }); + } + + return frames; + } + + const result = exception.stack ? fromError(exception) : []; + if (!result) { + throw new Error("Unable to parse the exception stack trace"); + } + + return Promise.resolve({ + type: exception.name || "Error", + message: exception.message, + stack_trace: getStackFrames((result) || []) // TODO: Update type definition. + }); + } +} diff --git a/packages/node/src/plugins/NodeGlobalHandlerPlugin.ts b/packages/node/src/plugins/NodeGlobalHandlerPlugin.ts new file mode 100644 index 00000000..9c7fdd41 --- /dev/null +++ b/packages/node/src/plugins/NodeGlobalHandlerPlugin.ts @@ -0,0 +1,28 @@ +import { ExceptionlessClient, IEventPlugin, PluginContext, toError } from "@exceptionless/core"; + +export class NodeGlobalHandlerPlugin implements IEventPlugin { + public priority: number = 100; + public name: string = "NodeGlobalHandlerPlugin"; + + private _client: ExceptionlessClient | null = null; + + public startup(context: PluginContext): Promise { + if (this._client) { + return Promise.resolve(); + } + + this._client = context.client; + Error.stackTraceLimit = 50; + + process.addListener("uncaughtException", (error: Error) => { + void this._client?.submitUnhandledException(error, "uncaughtException"); + }); + + process.addListener("unhandledRejection", (reason: unknown) => { + const error: Error = toError(reason, "Unhandled rejection"); + void this._client?.submitUnhandledException(error, "unhandledRejection"); + }); + + return Promise.resolve(); + } +} diff --git a/packages/node/src/plugins/NodeLifeCyclePlugin.ts b/packages/node/src/plugins/NodeLifeCyclePlugin.ts new file mode 100644 index 00000000..0d0af3af --- /dev/null +++ b/packages/node/src/plugins/NodeLifeCyclePlugin.ts @@ -0,0 +1,90 @@ +import { ExceptionlessClient, IEventPlugin, PluginContext } from "@exceptionless/core"; + +export class NodeLifeCyclePlugin implements IEventPlugin { + public priority: number = 105; + public name: string = "NodeLifeCyclePlugin"; + + private _client: ExceptionlessClient | null = null; + + public startup(context: PluginContext): Promise { + if (this._client) { + return Promise.resolve(); + } + + this._client = context.client; + + let processingBeforeExit: boolean = false; + process.on("beforeExit", (code: number) => { + // NOTE: We need to check if we are already processing a beforeExit event + // as async work will cause the runtime to call this handler again. + if (processingBeforeExit) { + return; + } + + processingBeforeExit = true; + + const message = this.getExitCodeReason(code); + if (message) { + void this._client?.submitLog("beforeExit", message, "Error"); + } + + if (this._client?.config.sessionsEnabled) { + void this._client?.submitSessionEnd(); + } + + void this._client?.suspend(); + // Application will now exit. + }); + + return Promise.resolve(); + } + + /** + * exit codes: https://nodejs.org/api/process.html#process_event_exit + * From now on, only synchronous code may run. As soon as this method + * ends, the application inevitably will exit. + */ + private getExitCodeReason(exitCode: number): string | null { + if (exitCode === 1) { + return "Uncaught Fatal Exception"; + } + + if (exitCode === 3) { + return "Internal JavaScript Parse Error"; + } + + if (exitCode === 4) { + return "Internal JavaScript Evaluation Failure"; + } + + if (exitCode === 5) { + return "Fatal Exception"; + } + + if (exitCode === 6) { + return "Non-function Internal Exception Handler "; + } + + if (exitCode === 7) { + return "Internal Exception Handler Run-Time Failure"; + } + + if (exitCode === 8) { + return "Uncaught Exception"; + } + + if (exitCode === 9) { + return "Invalid Argument"; + } + + if (exitCode === 10) { + return "Internal JavaScript Run-Time Failure"; + } + + if (exitCode === 12) { + return "Invalid Debug Argument"; + } + + return null; + } +} diff --git a/packages/node/src/plugins/NodeRequestInfoPlugin.ts b/packages/node/src/plugins/NodeRequestInfoPlugin.ts new file mode 100644 index 00000000..251bab54 --- /dev/null +++ b/packages/node/src/plugins/NodeRequestInfoPlugin.ts @@ -0,0 +1,99 @@ +import { EventPluginContext, getCookies, IEventPlugin, isEmpty, isMatch, KnownEventDataKeys, RequestInfo, stringify } from "@exceptionless/core"; + +export class NodeRequestInfoPlugin implements IEventPlugin { + public priority: number = 70; + public name: string = "NodeRequestInfoPlugin"; + + public run(context: EventPluginContext): Promise { + if (context.event.data && !context.event.data[KnownEventDataKeys.RequestInfo]) { + const requestInfo: RequestInfo | undefined = this.getRequestInfo(context); + if (requestInfo) { + if (isMatch(requestInfo.user_agent, context.client.config.userAgentBotPatterns)) { + context.log.info("Cancelling event as the request user agent matches a known bot pattern"); + context.cancelled = true; + } else { + context.event.data[KnownEventDataKeys.RequestInfo] = requestInfo; + } + } + } + + return Promise.resolve(); + } + + private getRequestInfo(context: EventPluginContext): RequestInfo | undefined { + // TODO: Move this into a known keys. + const REQUEST_KEY: string = "@request"; + if (!context.eventContext[REQUEST_KEY]) { + return; + } + + const config = context.client.config; + const exclusions = config.dataExclusions; + + type requestShape = { + method: string; + secure: boolean; + ip: string; + hostname: string; + path: string; + headers: Record; + params: Record; + body?: object; + }; + + const request = context.eventContext[REQUEST_KEY] as requestShape; + const requestInfo: RequestInfo = { + user_agent: request.headers["user-agent"], + http_method: request.method, + is_secure: request.secure, + host: request.hostname, + path: request.path, + referrer: request.headers.referer + }; + + const host = request.headers.host; + const port: number = (host && parseInt(host.slice(host.indexOf(":") + 1), 10)) || 0; + if (port > 0) { + requestInfo.port = port; + } + + if (config.includeIpAddress) { + requestInfo.client_ip_address = request.ip; + } + + if (config.includeCookies) { + requestInfo.cookies = getCookies(request.headers.cookie, exclusions) as Record; + } + + if (config.includeHeaders) { + const ignoredHeaders = ["Authorization", "Cookie", "Host", "Method", "Path", "Proxy-Authorization", "Referer", "User-Agent"]; + + const json = stringify(request.headers, [...ignoredHeaders, ...exclusions]); + if (!isEmpty(json)) { + const headers: Record = {}; + const parsedHeaders = JSON.parse(json) as Record; + for (const key in parsedHeaders) { + headers[key] = parsedHeaders[key].split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/).map((value) => value.trim()); + } + + requestInfo.headers = headers; + } + } + + if (config.includeQueryString) { + const json = stringify(request.params, exclusions); + if (!isEmpty(json)) { + requestInfo.query_string = JSON.parse(json) as Record; + } + } + + if (config.includePostData) { + const json = stringify(request.body, exclusions); + if (!isEmpty(json)) { + requestInfo.post_data = JSON.parse(json) as Record; + } + } + + return requestInfo; + } +} diff --git a/packages/node/src/plugins/NodeWrapFunctions.ts b/packages/node/src/plugins/NodeWrapFunctions.ts new file mode 100644 index 00000000..e4d5eb70 --- /dev/null +++ b/packages/node/src/plugins/NodeWrapFunctions.ts @@ -0,0 +1,20 @@ +import { ExceptionlessClient, IEventPlugin, PluginContext } from "@exceptionless/core"; + +export class NodeWrapFunctions implements IEventPlugin { + public priority: number = 110; + public name: string = "NodeWrapFunctions"; + + private _client: ExceptionlessClient | null = null; + + public startup(context: PluginContext): Promise { + if (this._client) { + return Promise.resolve(); + } + + this._client = context.client; + + // TODO: TraceKit.extendToAsynchronousCallbacks(); + + return Promise.resolve(); + } +} diff --git a/packages/node/src/storage/NodeDirectoryStorage.ts b/packages/node/src/storage/NodeDirectoryStorage.ts new file mode 100644 index 00000000..3cd1eace --- /dev/null +++ b/packages/node/src/storage/NodeDirectoryStorage.ts @@ -0,0 +1,72 @@ +import { IStorage } from "@exceptionless/core"; + +import { mkdirSync } from "fs"; +import { readdir, readFile, unlink, writeFile } from "fs/promises"; +import { dirname, join, resolve } from "path"; +import { argv } from "process"; + +export class NodeDirectoryStorage implements IStorage { + private directory: string; + + constructor(directory?: string) { + if (!directory) { + this.directory = argv && argv.length > 1 ? join(dirname(argv[1]), ".exceptionless") : ".exceptionless"; + } else { + this.directory = resolve(directory); + } + + mkdirSync(this.directory, { recursive: true }); + } + + public async length(): Promise { + const keys = await this.keys(); + return keys.length; + } + + public async clear(): Promise { + for (const key of await this.keys()) { + await this.removeItem(key); + } + + return Promise.resolve(); + } + + public async getItem(key: string): Promise { + try { + return await readFile(join(this.directory, key), "utf8"); + } catch (ex) { + if (this.isNodeError(ex) && ex.code === "ENOENT") { + return null; + } + + throw ex; + } + } + + public async key(index: number): Promise { + const keys = await this.keys(); + return Promise.resolve(index < keys.length ? keys[index] : null); + } + + public async keys(): Promise { + return await readdir(this.directory); + } + + public async removeItem(key: string): Promise { + try { + await unlink(join(this.directory, key)); + } catch (ex) { + if (this.isNodeError(ex) && ex.code !== "ENOENT") { + throw ex; + } + } + } + + public async setItem(key: string, value: string): Promise { + await writeFile(join(this.directory, key), value); + } + + private isNodeError(error: unknown): error is NodeJS.ErrnoException { + return typeof error === "object"; + } +} diff --git a/packages/node/test/storage/NodeDirectoryStorage.test.ts b/packages/node/test/storage/NodeDirectoryStorage.test.ts new file mode 100644 index 00000000..0d5679ed --- /dev/null +++ b/packages/node/test/storage/NodeDirectoryStorage.test.ts @@ -0,0 +1,13 @@ +import { IStorage } from "@exceptionless/core"; +import { describeStorage } from "../../../core/test/storage/StorageTestBase.js"; +import { NodeDirectoryStorage } from "#/storage/NodeDirectoryStorage.js"; +import { mkdirSync, rmSync } from "fs"; + +const directory: string = "./test/data"; + +function resetStorageDirectory() { + rmSync(directory, { recursive: true, force: true }); + mkdirSync(directory); +} + +describeStorage("NodeDirectoryStorage", (): IStorage => new NodeDirectoryStorage(directory), resetStorageDirectory, resetStorageDirectory); diff --git a/packages/node/tsconfig.json b/packages/node/tsconfig.json new file mode 100644 index 00000000..cb2b8485 --- /dev/null +++ b/packages/node/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "lib": ["ES2022"], + "outDir": "dist", + "paths": { + "#/*": ["./src/*"] + }, + "rootDir": "src", + "types": ["node", "jest"] + }, + "include": ["src"] +} diff --git a/packages/react/LICENSE b/packages/react/LICENSE new file mode 100644 index 00000000..e06d2081 --- /dev/null +++ b/packages/react/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/packages/react/README.md b/packages/react/README.md new file mode 100644 index 00000000..39b9573c --- /dev/null +++ b/packages/react/README.md @@ -0,0 +1,73 @@ +# Exceptionless React + +The Exceptionless React package provides a native way to handle errors and events in React. This means errors inside your components, which tend to crash your entire app, can be sent to Exceptionless and you can be alerted. Additionally, you can use this package to catch errors throughout your non-component functions such as in Redux actions, utility functions, etc. + +## Getting Started + +To use this package, your must be using ES6 and support ESM modules. + +## Install + +`npm install @exceptionless/react --save` + +## Configuration + +While your app is starting up, you should call `startup` on the Exceptionless +client. This ensures the client is configured and automatic capturing of +unhandled errors occurs. + +```jsx +import { Exceptionless, ExceptionlessErrorBoundary } from "@exceptionless/react"; + +class App extends Component { + async componentDidMount() { + await Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; + c.setUserIdentity("12345678", "Blake"); + + c.defaultTags.push("Example", "React"); + }); + } + + render() { + return ( + +
// YOUR APP COMPONENTS HERE
+
+ ); + } +} + +export default App; +``` + +## Handling Events + +While errors within the components themselves are automatically sent to Exceptionless, you will still want to handle events that happen outside the components. + +Because the Exceptionless client is a singleton, it is available anywhere in your app where you import it. Here's an example from a file we'll call `utilities.js`. + +```js +export const myUtilityFunction = async () => { + try { + // Handle successful run of code + } catch (e) { + // If there's an error, send it to Exceptionless + await Exceptionless.submitException(e); + } +}; +``` + +You can also sent events and logs that are not errors by simply calling the built-in methods on the Exceptionless class: + +```js +await Exceptionless.submitLog("Hello, world!"); +await Exceptionless.submitFeatureUsage("New Shopping Cart Feature"); +``` + +Please see the [docs](https://exceptionless.com/docs/clients/javascript/) for +more information on configuring the client. + +## Support + +If you need help, please contact us via in-app support, [open an issue](https://github.com/exceptionless/Exceptionless.JavaScript/issues/new) or [join our chat on Discord](https://discord.gg/6HxgFCx). We’re always here to help if you have any questions! diff --git a/packages/react/package.json b/packages/react/package.json new file mode 100644 index 00000000..212a17ed --- /dev/null +++ b/packages/react/package.json @@ -0,0 +1,60 @@ +{ + "name": "@exceptionless/react", + "version": "3.0.0-dev", + "description": "JavaScript client for Exceptionless", + "author": { + "name": "exceptionless", + "url": "https://exceptionless.com" + }, + "keywords": [ + "exceptionless", + "error", + "feature", + "logging", + "tracking", + "reporting", + "react" + ], + "repository": { + "url": "git://github.com/exceptionless/Exceptionless.JavaScript.git", + "type": "git" + }, + "bugs": { + "url": "https://github.com/exceptionless/Exceptionless.JavaScript/issues" + }, + "license": "Apache-2.0", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "unpkg": "dist/index.bundle.min.js", + "jsdelivr": "dist/index.bundle.min.js", + "exports": { + ".": "./dist/index.js", + "./package.json": "./package.json" + }, + "imports": { + "#/*": { + "source": "./src/*", + "default": "./dist/*" + } + }, + "scripts": { + "build": "tsc -p tsconfig.json && esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --conditions=source --outfile=dist/index.bundle.js && esbuild src/index.ts --bundle --minify --sourcemap --target=es2022 --format=esm --conditions=source --outfile=dist/index.bundle.min.js", + "watch": "tsc -p ../core/tsconfig.json -w --preserveWatchOutput & tsc -p tsconfig.json -w --preserveWatchOutput & esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --conditions=source --watch --outfile=dist/index.bundle.js" + }, + "sideEffects": false, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@jest/globals": "^30.3.0", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "esbuild": "^0.27.4", + "jest": "^30.3.0", + "ts-jest": "^29.4.6" + }, + "dependencies": { + "@exceptionless/browser": "3.0.0-dev" + } +} diff --git a/packages/react/src/ExceptionlessErrorBoundary.tsx b/packages/react/src/ExceptionlessErrorBoundary.tsx new file mode 100644 index 00000000..a8e9b74e --- /dev/null +++ b/packages/react/src/ExceptionlessErrorBoundary.tsx @@ -0,0 +1,20 @@ +import { Component, PropsWithChildren } from "react"; +import { Exceptionless } from "@exceptionless/browser"; + +type ErrorState = { + hasError: boolean; +}; + +export class ExceptionlessErrorBoundary extends Component { + constructor(props: Readonly> | Record) { + super(props); + } + + async componentDidCatch(error: Error, errorInfo: unknown) { + await Exceptionless.createException(error).setProperty("errorInfo", errorInfo).submit(); + } + + render() { + return this.props.children; + } +} diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts new file mode 100644 index 00000000..dac75e27 --- /dev/null +++ b/packages/react/src/index.ts @@ -0,0 +1,3 @@ +export * from "@exceptionless/browser"; + +export { ExceptionlessErrorBoundary } from "#/ExceptionlessErrorBoundary.js"; diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json new file mode 100644 index 00000000..39d7399f --- /dev/null +++ b/packages/react/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "lib": ["DOM", "ES2022"], + "outDir": "dist", + "paths": { + "#/*": ["./src/*"] + }, + "rootDir": "src", + "jsx": "react" + }, + "include": ["src"] +} diff --git a/packages/vue/README.md b/packages/vue/README.md new file mode 100644 index 00000000..6c46c371 --- /dev/null +++ b/packages/vue/README.md @@ -0,0 +1,77 @@ +# Exceptionless vue + +The Exceptionless Vue package provides a native way to handle errors and events +in Vue. This means errors inside your components, which tend to crash your +entire app, can be sent to Exceptionless and you can be alerted. Additionally, +you can use this package to catch errors throughout your non-component functions +such as in utility functions, etc. + +## Getting Started + +To use this package, your must be using ES6 and support ESM modules. + +## Install + +`npm install @exceptionless/vue --save` + +## Configuration + +While your app is starting up, you should call `startup` on the Exceptionless +client. This ensures the client is configured and automatic capturing of +unhandled errors occurs. Below is from an example vue applications `main.js` file. + +```js +import { createApp } from "vue"; +import App from "./App.vue"; +import { Exceptionless, ExceptionlessErrorHandler } from "@exceptionless/vue"; + +Exceptionless.startup((c) => { + c.apiKey = "API_KEY_HERE"; + c.setUserIdentity("12345678", "Blake"); + + c.defaultTags.push("Example", "Vue"); +}); + +const app = createApp(App); +// Set the global vue error handler. +app.config.errorHandler = ExceptionlessErrorHandler; +app.mount("#app"); +``` + +## Handling Events + +While errors within the components themselves are automatically sent to +Exceptionless, you will still want to handle events that happen outside the +components. + +Because the Exceptionless client is a singleton, it is available anywhere in +your app where you import it. Here's an example from a file we'll call `utilities.js`. + +```js +export const myUtilityFunction = async () => { + try { + // Handle successful run of code + } catch (e) { + // If there's an error, send it to Exceptionless + await Exceptionless.submitException(e); + } +}; +``` + +You can also sent events and logs that are not errors by simply calling the +built-in methods on the Exceptionless class: + +```js +await Exceptionless.submitLog("Hello, world!"); +await Exceptionless.submitFeatureUsage("New Shopping Cart Feature"); +``` + +Please see the [docs](https://exceptionless.com/docs/clients/javascript/) for +more information on configuring the client. + +## Support + +If you need help, please contact us via in-app support, +[open an issue](https://github.com/exceptionless/Exceptionless.JavaScript/issues/new) +or [join our chat on Discord](https://discord.gg/6HxgFCx). We’re always here to +help if you have any questions! diff --git a/packages/vue/package.json b/packages/vue/package.json new file mode 100644 index 00000000..6676f3d3 --- /dev/null +++ b/packages/vue/package.json @@ -0,0 +1,49 @@ +{ + "name": "@exceptionless/vue", + "version": "3.0.0-dev", + "description": "JavaScript client for Exceptionless", + "author": { + "name": "exceptionless", + "url": "https://exceptionless.com" + }, + "keywords": [ + "exceptionless", + "error", + "feature", + "logging", + "tracking", + "reporting", + "vue" + ], + "repository": { + "url": "git://github.com/exceptionless/Exceptionless.JavaScript.git", + "type": "git" + }, + "bugs": { + "url": "https://github.com/exceptionless/Exceptionless.JavaScript/issues" + }, + "license": "Apache-2.0", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "unpkg": "dist/index.bundle.min.js", + "jsdelivr": "dist/index.bundle.min.js", + "exports": { + ".": "./dist/index.js", + "./package.json": "./package.json" + }, + "scripts": { + "build": "tsc -p tsconfig.json && esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --outfile=dist/index.bundle.js && esbuild src/index.ts --bundle --minify --sourcemap --target=es2022 --format=esm --outfile=dist/index.bundle.min.js", + "watch": "tsc -p tsconfig.json -w --preserveWatchOutput & esbuild src/index.ts --bundle --sourcemap --target=es2022 --format=esm --watch --outfile=dist/index.bundle.js" + }, + "sideEffects": false, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "esbuild": "^0.27.4" + }, + "dependencies": { + "@exceptionless/browser": "3.0.0-dev" + } +} diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts new file mode 100644 index 00000000..fd18a215 --- /dev/null +++ b/packages/vue/src/index.ts @@ -0,0 +1,13 @@ +export * from "@exceptionless/browser"; +import { Exceptionless } from "@exceptionless/browser"; + +/** + * https://vuejs.org/v2/api/#errorHandler + * https://v3.vuejs.org/api/application-config.html#errorhandler + * @param err + * @param vm + * @param info + */ +export const ExceptionlessErrorHandler = async (err: Error, vm: unknown, info: unknown): Promise => { + await Exceptionless.createException(err).setProperty("vm", vm).setProperty("info", info).submit(); +}; diff --git a/packages/vue/tsconfig.json b/packages/vue/tsconfig.json new file mode 100644 index 00000000..0b196d33 --- /dev/null +++ b/packages/vue/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "lib": ["DOM", "ES2022"], + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"] +} diff --git a/skills-lock.json b/skills-lock.json new file mode 100644 index 00000000..8c9cc7ac --- /dev/null +++ b/skills-lock.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "skills": { + "agent-browser": { + "source": "vercel-labs/agent-browser", + "sourceType": "github", + "computedHash": "939c70dd51a234b3ebefc935a06a24f2a6558e7a1be1dfdf72cd372aee8b88f0" + } + } +} diff --git a/src/.jshintrc b/src/.jshintrc deleted file mode 100644 index ed00a3cb..00000000 --- a/src/.jshintrc +++ /dev/null @@ -1,31 +0,0 @@ -{ - "curly": false, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "sub": true, - "undef": true, - "boss": true, - "eqnull": true, - "browser": true, - "smarttabs": true, - "globals": { - "jQuery": true, - "angular": true, - "console": true, - "$": true, - "_": true, - "moment": true, - "describe": true, - "beforeEach": true, - "module": true, - "inject": true, - "it": true, - "expect": true, - "xdescribe": true, - "xit": true, - "spyOn": true - } -} diff --git a/src/ExceptionlessClient-spec.ts b/src/ExceptionlessClient-spec.ts deleted file mode 100644 index 27dc86ca..00000000 --- a/src/ExceptionlessClient-spec.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { expect } from 'chai'; -import * as sinon from 'sinon'; -import { ExceptionlessClient } from './ExceptionlessClient'; -import { EventPluginContext } from './plugins/EventPluginContext'; - -describe('ExceptionlessClient', () => { - let xhr: any; - - beforeEach(() => { - xhr = sinon.useFakeXMLHttpRequest(); - }); - - afterEach(() => { - xhr.restore(); - }); - - it('should use event reference ids', (done) => { - const error = createException(); - - const client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000'); - expect(client.config.lastReferenceIdManager.getLast()).to.be.null; - client.submitException(error, (context: EventPluginContext) => { - expect(client.config.lastReferenceIdManager.getLast()).to.be.null; - }); - - const numberOfPlugins = client.config.plugins.length; - client.config.useReferenceIds(); - expect(client.config.plugins.length).to.equal(numberOfPlugins + 1); - - client.submitException(error, (context: EventPluginContext) => { - if (!context.cancelled) { - expect(client.config.lastReferenceIdManager.getLast()).not.to.be.null; - } else { - expect(client.config.lastReferenceIdManager.getLast()).to.be.null; - } - - done(); - done = () => { }; - }); - }); - - it('should accept null source', () => { - const client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000'); - const builder = client.createLog(null, 'Unit Test message', 'Trace'); - - expect(builder.target.source).to.be.undefined; - expect(builder.target.message).to.equal('Unit Test message'); - expect(builder.target.data['@level']).to.equal('Trace'); - }); - - it('should accept source and message', () => { - const client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000'); - const builder = client.createLog('ExceptionlessClient', 'Unit Test message'); - - expect(builder.target.source).to.equal('ExceptionlessClient'); - expect(builder.target.message).to.equal('Unit Test message'); - expect(builder.target.data).to.be.undefined; - }); - - it('should accept source and message and level', () => { - const client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000'); - const builder = client.createLog('source', 'Unit Test message', 'Info'); - - expect(builder.target.source).to.equal('source'); - expect(builder.target.message).to.equal('Unit Test message'); - expect(builder.target.data['@level']).to.equal('Info'); - }); - - it('should allow construction via apiKey and serverUrl parameters', () => { - const client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000'); - - expect(client.config.apiKey).to.equal('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw'); - expect(client.config.serverUrl).to.equal('http://localhost:50000'); - }); - - it('should allow construction via a configuration object', () => { - const client = new ExceptionlessClient({ - apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', - serverUrl: 'http://localhost:50000' - }); - - expect(client.config.apiKey).to.equal('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw'); - expect(client.config.serverUrl).to.equal('http://localhost:50000'); - }); - - function createException() { - function throwError() { - throw new ReferenceError('This is a test'); - } - try { - throwError(); - } catch (e) { - return e; - } - } -}); diff --git a/src/ExceptionlessClient.ts b/src/ExceptionlessClient.ts deleted file mode 100644 index 1f530406..00000000 --- a/src/ExceptionlessClient.ts +++ /dev/null @@ -1,251 +0,0 @@ -import { Configuration } from './configuration/Configuration'; -import { IConfigurationSettings } from './configuration/IConfigurationSettings'; -import { SettingsManager } from './configuration/SettingsManager'; -import { EventBuilder } from './EventBuilder'; -import { IEvent } from './models/IEvent'; -import { IUserDescription } from './models/IUserDescription'; -import { ContextData } from './plugins/ContextData'; -import { EventPluginContext } from './plugins/EventPluginContext'; -import { EventPluginManager } from './plugins/EventPluginManager'; -import { SubmissionResponse } from './submission/SubmissionResponse'; - -export class ExceptionlessClient { - /** - * The default ExceptionlessClient instance. - * @type {ExceptionlessClient} - * @private - */ - private static _instance: ExceptionlessClient = null; - - public config: Configuration; - - private _intervalId: any; - private _timeoutId: any; - - constructor(); - constructor(settings: IConfigurationSettings); - constructor(apiKey: string, serverUrl?: string); - constructor(settingsOrApiKey?: IConfigurationSettings | string, serverUrl?: string) { - this.config = typeof settingsOrApiKey === 'object' - ? new Configuration(settingsOrApiKey) - : new Configuration({ apiKey: settingsOrApiKey as string, serverUrl }); - - this.updateSettingsTimer(5000); - this.config.onChanged((config) => this.updateSettingsTimer(this._timeoutId > 0 ? 5000 : 0)); - this.config.queue.onEventsPosted((events, response) => this.updateSettingsTimer()); - } - - public createException(exception: Error): EventBuilder { - const pluginContextData = new ContextData(); - pluginContextData.setException(exception); - return this.createEvent(pluginContextData).setType('error'); - } - - public submitException(exception: Error, callback?: (context: EventPluginContext) => void): void { - this.createException(exception).submit(callback); - } - - public createUnhandledException(exception: Error, submissionMethod?: string): EventBuilder { - const builder = this.createException(exception); - builder.pluginContextData.markAsUnhandledError(); - builder.pluginContextData.setSubmissionMethod(submissionMethod); - - return builder; - } - - public submitUnhandledException(exception: Error, submissionMethod?: string, callback?: (context: EventPluginContext) => void) { - this.createUnhandledException(exception, submissionMethod).submit(callback); - } - - public createFeatureUsage(feature: string): EventBuilder { - return this.createEvent().setType('usage').setSource(feature); - } - - public submitFeatureUsage(feature: string, callback?: (context: EventPluginContext) => void): void { - this.createFeatureUsage(feature).submit(callback); - } - - public createLog(message: string): EventBuilder; - public createLog(source: string, message: string): EventBuilder; - public createLog(source: string, message: string, level: string): EventBuilder; - public createLog(sourceOrMessage: string, message?: string, level?: string): EventBuilder { - let builder = this.createEvent().setType('log'); - - if (level) { - builder = builder.setSource(sourceOrMessage).setMessage(message).setProperty('@level', level); - } else if (message) { - builder = builder.setSource(sourceOrMessage).setMessage(message); - } else { - builder = builder.setMessage(sourceOrMessage); - - try { - // TODO: Look into using https: //www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/ - const caller: any = this.createLog.caller; - builder = builder.setSource(caller && caller.caller && caller.caller.name); - } catch (e) { - this.config.log.trace('Unable to resolve log source: ' + e.message); - } - } - - return builder; - } - - public submitLog(message: string): void; - public submitLog(source: string, message: string): void; - public submitLog(source: string, message: string, level: string, callback?: (context: EventPluginContext) => void): void; - public submitLog(sourceOrMessage: string, message?: string, level?: string, callback?: (context: EventPluginContext) => void): void { - this.createLog(sourceOrMessage, message, level).submit(callback); - } - - public createNotFound(resource: string): EventBuilder { - return this.createEvent().setType('404').setSource(resource); - } - - public submitNotFound(resource: string, callback?: (context: EventPluginContext) => void): void { - this.createNotFound(resource).submit(callback); - } - - public createSessionStart(): EventBuilder { - return this.createEvent().setType('session'); - } - - public submitSessionStart(callback?: (context: EventPluginContext) => void): void { - this.createSessionStart().submit(callback); - } - - public submitSessionEnd(sessionIdOrUserId: string): void { - if (sessionIdOrUserId) { - this.config.log.info(`Submitting session end: ${sessionIdOrUserId}`); - this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, true, this.config); - } - } - - public submitSessionHeartbeat(sessionIdOrUserId: string): void { - if (sessionIdOrUserId) { - this.config.log.info(`Submitting session heartbeat: ${sessionIdOrUserId}`); - this.config.submissionClient.sendHeartbeat(sessionIdOrUserId, false, this.config); - } - } - - public createEvent(pluginContextData?: ContextData): EventBuilder { - return new EventBuilder({ date: new Date() }, this, pluginContextData); - } - - /** - * Submits the event to be sent to the server. - * @param event The event data. - * @param pluginContextData Any contextual data objects to be used by Exceptionless plugins to gather default information for inclusion in the report information. - * @param callback - */ - public submitEvent(event: IEvent, pluginContextData?: ContextData, callback?: (context: EventPluginContext) => void): void { - function cancelled(context: EventPluginContext) { - if (!!context) { - context.cancelled = true; - } - - return !!callback && callback(context); - } - - const context = new EventPluginContext(this, event, pluginContextData); - if (!event) { - return cancelled(context); - } - - if (!this.config.enabled) { - this.config.log.info('Event submission is currently disabled.'); - return cancelled(context); - } - - if (!event.data) { - event.data = {}; - } - - if (!event.tags || !event.tags.length) { - event.tags = []; - } - - EventPluginManager.run(context, (ctx: EventPluginContext) => { - const config = ctx.client.config; - const ev = ctx.event; - - if (!ctx.cancelled) { - // ensure all required data - if (!ev.type || ev.type.length === 0) { - ev.type = 'log'; - } - - if (!ev.date) { - ev.date = new Date(); - } - - config.queue.enqueue(ev); - - if (ev.reference_id && ev.reference_id.length > 0) { - ctx.log.info(`Setting last reference id '${ev.reference_id}'`); - config.lastReferenceIdManager.setLast(ev.reference_id); - } - } - - !!callback && callback(ctx); - }); - } - - /** - * Updates the user's email address and description of an event for the specified reference id. - * @param referenceId The reference id of the event to update. - * @param email The user's email address to set on the event. - * @param description The user's description of the event. - * @param callback The submission response. - */ - public updateUserEmailAndDescription(referenceId: string, email: string, description: string, callback?: (response: SubmissionResponse) => void) { - if (!referenceId || !email || !description || !this.config.enabled) { - return !!callback && callback(new SubmissionResponse(500, 'cancelled')); - } - - const userDescription: IUserDescription = { email_address: email, description }; - this.config.submissionClient.postUserDescription(referenceId, userDescription, this.config, (response: SubmissionResponse) => { - if (!response.success) { - this.config.log.error(`Failed to submit user email and description for event '${referenceId}': ${response.statusCode} ${response.message}`); - } - - !!callback && callback(response); - }); - } - - /** - * Gets the last event client id that was submitted to the server. - * @returns {string} The event client id. - */ - public getLastReferenceId(): string { - return this.config.lastReferenceIdManager.getLast(); - } - - private updateSettingsTimer(initialDelay?: number) { - this.config.log.info(`Updating settings timer with delay: ${initialDelay}`); - - this._timeoutId = clearTimeout(this._timeoutId); - this._timeoutId = clearInterval(this._intervalId); - - const interval = this.config.updateSettingsWhenIdleInterval; - if (interval > 0) { - const updateSettings = () => SettingsManager.updateSettings(this.config); - if (initialDelay > 0) { - this._timeoutId = setTimeout(updateSettings, initialDelay); - } - - this._intervalId = setInterval(updateSettings, interval); - } - } - - /** - * The default ExceptionlessClient instance. - * @type {ExceptionlessClient} - */ - public static get default() { - if (ExceptionlessClient._instance === null) { - ExceptionlessClient._instance = new ExceptionlessClient(null); - } - - return ExceptionlessClient._instance; - } -} diff --git a/src/Utils-spec.ts b/src/Utils-spec.ts deleted file mode 100644 index 6b99200f..00000000 --- a/src/Utils-spec.ts +++ /dev/null @@ -1,319 +0,0 @@ -import { expect } from 'chai'; -import { Utils } from './Utils'; - -describe('Utils', () => { - it('should add range', () => { - let target: string[]; - expect(Utils.addRange(target)).to.eql([]); - expect(target).to.be.undefined; - - expect(Utils.addRange(target, '1', '2')).to.eql(['1', '2']); - expect(Utils.addRange(target, '1', '2')).to.eql(['1', '2']); - - target = ['3']; - expect(Utils.addRange(target, '1', '2')).to.eql(['3', '1', '2']); - expect(target).to.eql(['3', '1', '2']); - }); - - describe('stringify', () => { - const user: any = { - id: 1, - name: 'Blake', - password: '123456', - passwordResetToken: 'a reset token', - myPassword: '123456', - myPasswordValue: '123456', - customValue: 'Password', - value: { - Password: '123456' - } - }; - - it('array', () => { - const error = { - type: 'error', - data: { - '@error': { - type: 'Error', - message: 'string error message', - stack_trace: [ - { - name: 'throwStringErrorImpl', - parameters: [], - file_name: 'http://localhost/index.js', - line_number: 22, - column: 9 - }, - { - name: 'throwStringError', - parameters: [], - file_name: 'http://localhost/index.js', - line_number: 10, - column: 10 - }, { - name: 'HTMLButtonElement.onclick', - parameters: [], - file_name: 'http://localhost/', - line_number: 22, - column: 10 - }] - }, - '@submission_method': 'onerror' - }, - tags: [] - }; - - expect(Utils.stringify(error)).to.equal(JSON.stringify(error)); - expect(Utils.stringify([error, error])).to.equal(JSON.stringify([error, error])); - }); - - it('circular reference', () => { - const afoo: any = { a: 'foo' }; - afoo.b = afoo; - - expect(Utils.stringify(afoo)).to.equal('{"a":"foo"}'); - expect(Utils.stringify([{ one: afoo, two: afoo }])).to.equal('[{"one":{"a":"foo"}}]'); - }); - - it.skip('deep circular reference', () => { - const a: any = {}; - const b: any = {}; - const c: any = { d: 'test' }; - - a.b = b; - b.c = c; - c.a = a; - - const expected = '{"b":{"c":{"d":"test"}}}'; - - const actual = Utils.stringify(a); - expect(actual).to.equal(expected); - }); - - describe('should behave like JSON.stringify', () => { - [new Date(), 1, true, null, undefined, () => { }, user].forEach((value) => { - it('for ' + typeof (value), () => { - expect(Utils.stringify(value)).to.equal(JSON.stringify(value)); - }); - }); - }); - - it.skip('should respect maxDepth', () => { - const deepObject = { - a: { - b: { - c: { - d: {} - } - } - } - }; - - expect(deepObject).to.equal('TODO'); - }); - - it('should serialize inherited properties', () => { - const Foo = function() { this.a = 'a'; }; - const Bar = function() { this.b = 'b'; }; - Bar.prototype = new Foo(); - const bar = new Bar(); - - const expected = { - a: 'a', - b: 'b' - }; - - const result = JSON.parse(Utils.stringify(bar)); - expect(result).to.eql(expected); - }); - - describe('with exclude pattern', () => { - it('pAssword', () => { - expect(Utils.stringify(user, ['pAssword'])).to.equal('{"id":1,"name":"Blake","passwordResetToken":"a reset token","myPassword":"123456","myPasswordValue":"123456","customValue":"Password","value":{}}'); - }); - - it('*password', () => { - expect(Utils.stringify(user, ['*password'])).to.equal('{"id":1,"name":"Blake","passwordResetToken":"a reset token","myPasswordValue":"123456","customValue":"Password","value":{}}'); - }); - - it('password*', () => { - expect(Utils.stringify(user, ['password*'])).to.equal('{"id":1,"name":"Blake","myPassword":"123456","myPasswordValue":"123456","customValue":"Password","value":{}}'); - }); - - it('*password*', () => { - expect(Utils.stringify(user, ['*password*'])).to.equal('{"id":1,"name":"Blake","customValue":"Password","value":{}}'); - }); - - it('*Address', () => { - const event = { type: 'usage', source: 'about' }; - expect(Utils.stringify(event, ['*Address'])).to.equal(JSON.stringify(event)); - }); - }); - }); - - it('should parse version from url', () => { - expect(Utils.parseVersion('https://code.jquery.com/jquery-2.1.3.js')).to.equal('2.1.3'); - expect(Utils.parseVersion('//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css')).to.equal('3.3.4'); - expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/1140/2.0/1140.css')).to.equal('2.0'); - expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/Base64/0.3.0/base64.min.js')).to.equal('0.3.0'); - expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/angular-google-maps/2.1.0-X.10/angular-google-maps.min.js')).to.equal('2.1.0-X.10'); - expect(Utils.parseVersion('https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/2.1.8-M1/swagger-ui.min.js')).to.equal('2.1.8-M1'); - expect(Utils.parseVersion('https://cdnjs.cloudflare.com/BLAH/BLAH.min.js')).to.equal(null); - }); - - describe('isMatch', () => { - it('input: blake patterns ["pAssword"]', () => { - expect(Utils.isMatch('blake', ['pAssword'])).to.be.false; - }); - - it('input: pAssword patterns ["pAssword"]', () => { - expect(Utils.isMatch('pAssword', ['pAssword'])).to.be.true; - }); - - it('input: passwordResetToken patterns ["pAssword"]', () => { - expect(Utils.isMatch('passwordResetToken', ['pAssword'])).to.be.false; - }); - - it('input: myPassword patterns ["pAssword"]', () => { - expect(Utils.isMatch('myPassword', ['pAssword'])).to.be.false; - }); - - it('input: blake patterns ["*pAssword"]', () => { - expect(Utils.isMatch('blake', ['*pAssword'])).to.be.false; - }); - - it('input: pAssword patterns ["*pAssword"]', () => { - expect(Utils.isMatch('pAssword', ['*pAssword'])).to.be.true; - }); - - it('input: passwordResetToken patterns ["*pAssword"]', () => { - expect(Utils.isMatch('passwordResetToken', ['*pAssword'])).to.be.false; - }); - - it('input: myPassword patterns ["*pAssword"]', () => { - expect(Utils.isMatch('myPassword', ['*pAssword'])).to.be.true; - }); - - it('input: blake patterns ["pAssword*"]', () => { - expect(Utils.isMatch('blake', ['pAssword*'])).to.be.false; - }); - - it('input: pAssword patterns ["pAssword*"]', () => { - expect(Utils.isMatch('pAssword', ['pAssword*'])).to.be.true; - }); - - it('input: passwordResetToken patterns ["pAssword*"]', () => { - expect(Utils.isMatch('passwordResetToken', ['pAssword*'])).to.be.true; - }); - - it('input: myPassword patterns ["pAssword*"]', () => { - expect(Utils.isMatch('myPassword', ['pAssword*'])).to.be.false; - }); - - it('input: blake patterns ["*pAssword*"]', () => { - expect(Utils.isMatch('blake', ['*pAssword*'])).to.be.false; - }); - - it('input: pAssword patterns ["*pAssword*"]', () => { - expect(Utils.isMatch('pAssword', ['*pAssword*'])).to.be.true; - }); - - it('input: passwordResetToken patterns ["*pAssword*"]', () => { - expect(Utils.isMatch('passwordResetToken', ['*pAssword*'])).to.be.true; - }); - - it('input: myPassword patterns ["*pAssword*"]', () => { - expect(Utils.isMatch('myPassword', ['*pAssword*'])).to.be.true; - }); - }); - - describe('startsWith', () => { - it('input: blake prefix: blake', () => { - expect(Utils.startsWith('blake', 'blake')).to.be.true; - }); - - it('input: blake prefix: bl', () => { - expect(Utils.startsWith('blake', 'bl')).to.be.true; - }); - - it('input: blake prefix: Blake', () => { - expect(Utils.startsWith('blake', 'Blake')).to.be.false; - }); - - it('input: @@log:* prefix: @@log:', () => { - expect(Utils.startsWith('@@log:*', '@@log:')).to.be.true; - }); - - it('input: test prefix: nopattern', () => { - expect(Utils.startsWith('test', 'nopattern')).to.be.false; - }); - }); - - describe('endsWith', () => { - it('input: blake suffix: blake', () => { - expect(Utils.endsWith('blake', 'blake')).to.be.true; - }); - - it('input: blake suffix: ake', () => { - expect(Utils.endsWith('blake', 'ake')).to.be.true; - }); - - it('input: blake suffix: Blake', () => { - expect(Utils.endsWith('blake', 'Blake')).to.be.false; - }); - - it('input: @@log:* suffix: log:*', () => { - expect(Utils.endsWith('@@log:*', 'log:*')).to.be.true; - }); - - it('input: test suffix: nopattern', () => { - expect(Utils.endsWith('test', 'nopattern')).to.be.false; - }); - }); - - describe('toBoolean', () => { - it('input: blake', () => { - expect(Utils.toBoolean('blake')).to.be.false; - }); - - it('input: 0', () => { - expect(Utils.toBoolean('0')).to.be.false; - }); - - it('input: no', () => { - expect(Utils.toBoolean('no')).to.be.false; - }); - - it('input: false', () => { - expect(Utils.toBoolean('false')).to.be.false; - }); - - it('input: false', () => { - expect(Utils.toBoolean(false)).to.be.false; - }); - - it('input: undefined', () => { - expect(Utils.toBoolean(undefined)).to.be.false; - }); - - it('input: null', () => { - expect(Utils.toBoolean(null)).to.be.false; - }); - - it('input: 1', () => { - expect(Utils.toBoolean('1')).to.be.true; - }); - - it('input: yes', () => { - expect(Utils.toBoolean('yes')).to.be.true; - }); - - it('input: true', () => { - expect(Utils.toBoolean('true')).to.be.true; - }); - - it('input: true', () => { - expect(Utils.toBoolean(true)).to.be.true; - }); - }); -}); diff --git a/src/Utils.ts b/src/Utils.ts deleted file mode 100644 index 33c88e9c..00000000 --- a/src/Utils.ts +++ /dev/null @@ -1,246 +0,0 @@ -export class Utils { - public static addRange(target: T[], ...values: T[]) { - if (!target) { - target = []; - } - - if (!values || values.length === 0) { - return target; - } - - for (const value of values) { - if (value && target.indexOf(value) < 0) { - target.push(value); - } - } - - return target; - } - - public static getHashCode(source: string): number { - if (!source || source.length === 0) { - return 0; - } - - let hash: number = 0; - for (let index = 0; index < source.length; index++) { - const character = source.charCodeAt(index); - hash = ((hash << 5) - hash) + character; - hash |= 0; - } - - return hash; - } - - public static getCookies(cookies: string, exclusions?: string[]): object { - const result: object = {}; - - const parts: string[] = (cookies || '').split('; '); - for (const part of parts) { - const cookie: string[] = part.split('='); - if (!Utils.isMatch(cookie[0], exclusions)) { - result[cookie[0]] = cookie[1]; - } - } - - return !Utils.isEmpty(result) ? result : null; - } - - public static guid(): string { - function s4() { - return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); - } - - return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); - } - - // tslint:disable-next-line:ban-types - public static merge(defaultValues: Object, values: Object) { - const result: object = {}; - - for (const key in defaultValues || {}) { - if (!!defaultValues[key]) { - result[key] = defaultValues[key]; - } - } - - for (const key in values || {}) { - if (!!values[key]) { - result[key] = values[key]; - } - } - - return result; - } - - public static parseVersion(source: string): string { - if (!source) { - return null; - } - - const versionRegex = /(v?((\d+)\.(\d+)(\.(\d+))?)(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?)/; - const matches = versionRegex.exec(source); - if (matches && matches.length > 0) { - return matches[0]; - } - - return null; - } - - public static parseQueryString(query: string, exclusions?: string[]) { - if (!query || query.length === 0) { - return null; - } - - const pairs: string[] = query.split('&'); - if (pairs.length === 0) { - return null; - } - - const result: object = {}; - for (const pair of pairs) { - const parts = pair.split('='); - if (!Utils.isMatch(parts[0], exclusions)) { - result[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]); - } - } - - return !Utils.isEmpty(result) ? result : null; - } - - public static randomNumber(): number { - return Math.floor(Math.random() * 9007199254740992); - } - - /** - * Checks to see if a value matches a pattern. - * @param input the value to check against the @pattern. - * @param pattern The pattern to check, supports wild cards (*). - */ - public static isMatch(input: string, patterns: string[], ignoreCase: boolean = true): boolean { - if (!input || typeof input !== 'string') { - return false; - } - - const trim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; - input = (ignoreCase ? input.toLowerCase() : input).replace(trim, ''); - - return (patterns || []).some((pattern) => { - if (typeof pattern !== 'string') { - return false; - } - - pattern = (ignoreCase ? pattern.toLowerCase() : pattern).replace(trim, ''); - if (pattern.length <= 0) { - return false; - } - - const startsWithWildcard: boolean = pattern[0] === '*'; - if (startsWithWildcard) { - pattern = pattern.slice(1); - } - - const endsWithWildcard: boolean = pattern[pattern.length - 1] === '*'; - if (endsWithWildcard) { - pattern = pattern.substring(0, pattern.length - 1); - } - - if (startsWithWildcard && endsWithWildcard) { - return pattern.length <= input.length && input.indexOf(pattern, 0) !== -1; - } - - if (startsWithWildcard) { - return Utils.endsWith(input, pattern); - } - - if (endsWithWildcard) { - return Utils.startsWith(input, pattern); - } - - return input === pattern; - }); - } - - public static isEmpty(input: object) { - return input === null || (typeof (input) === 'object' && Object.keys(input).length === 0); - } - - public static startsWith(input: string, prefix: string): boolean { - return input.substring(0, prefix.length) === prefix; - } - - public static endsWith(input: string, suffix: string): boolean { - return input.indexOf(suffix, input.length - suffix.length) !== -1; - } - - /** - * Stringifys an object with optional exclusions and max depth. - * @param data The data object to add. - * @param exclusions Any property names that should be excluded. - * @param maxDepth The max depth of the object to include. - */ - public static stringify(data: any, exclusions?: string[], maxDepth?: number): string { - function stringifyImpl(obj: any, excludedKeys: string[]): string { - const cache: string[] = []; - return JSON.stringify(obj, (key: string, value: any) => { - if (Utils.isMatch(key, excludedKeys)) { - return; - } - - if (typeof value === 'object' && !!value) { - if (cache.indexOf(value) !== -1) { - // Circular reference found, discard key - return; - } - - cache.push(value); - } - - return value; - }); - } - - if (({}).toString.call(data) === '[object Object]') { - const flattened = {}; - /* tslint:disable:forin */ - for (const prop in data) { - const value = data[prop]; - if (value === data) { - continue; - } - flattened[prop] = data[prop]; - } - /* tslint:enable:forin */ - - return stringifyImpl(flattened, exclusions); - } - - if (({}).toString.call(data) === '[object Array]') { - const result = []; - for (let index = 0; index < data.length; index++) { - result[index] = JSON.parse(stringifyImpl(data[index], exclusions)); - } - - return JSON.stringify(result); - } - - return stringifyImpl(data, exclusions); - } - - public static toBoolean(input, defaultValue: boolean = false): boolean { - if (typeof input === 'boolean') { - return input; - } - - if (input === null || typeof input !== 'number' && typeof input !== 'string') { - return defaultValue; - } - - switch ((input + '').toLowerCase().trim()) { - case 'true': case 'yes': case '1': return true; - case 'false': case 'no': case '0': case null: return false; - } - - return defaultValue; - } -} diff --git a/src/configuration/Configuration-spec.ts b/src/configuration/Configuration-spec.ts deleted file mode 100644 index 39aac1ec..00000000 --- a/src/configuration/Configuration-spec.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { expect } from 'chai'; -import { EventPluginContext } from '../plugins/EventPluginContext'; -import { Configuration } from './Configuration'; - -describe('Configuration', () => { - it('should override configuration defaults', () => { - let config = new Configuration(); - expect(config.apiKey).to.equal(null); - - config.apiKey = 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw'; - expect(config.apiKey).to.equal('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw'); - - Configuration.defaults.apiKey = 'test'; - config = new Configuration(); - expect(config.apiKey).to.equal('test'); - - config = new Configuration({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl: 'http://localhost:50000' }); - expect(config.apiKey).to.equal('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw'); - - config = new Configuration({ apiKey: null }); - expect(config.apiKey).to.equal('test'); - }); - - it('should not add duplicate plugin', () => { - const config = new Configuration({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl: 'http://localhost:50000' }); - expect(config.plugins).not.to.equal(null); - while (config.plugins.length > 0) { - config.removePlugin(config.plugins[0]); - } - - config.addPlugin('test', 20, (context: EventPluginContext) => { }); - config.addPlugin('test', 20, (context: EventPluginContext) => { }); - expect(config.plugins.length).to.equal(1); - }); - - it('should generate plugin name and priority', () => { - const config = new Configuration({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl: 'http://localhost:50000' }); - expect(config.plugins).not.to.equal(null); - while (config.plugins.length > 0) { - config.removePlugin(config.plugins[0]); - } - - config.addPlugin(null, null, (context: EventPluginContext) => { }); - expect(config.plugins.length).to.equal(1); - expect(config.plugins[0].name).not.to.equal(null); - expect(config.plugins[0].priority).to.equal(0); - }); - - it('should sort plugins by priority', () => { - const config = new Configuration({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl: 'http://localhost:50000' }); - expect(config.plugins).not.to.equal(null); - while (config.plugins.length > 0) { - config.removePlugin(config.plugins[0]); - } - - config.addPlugin('3', 3, (context: EventPluginContext) => { }); - config.addPlugin('1', 1, (context: EventPluginContext) => { }); - config.addPlugin('2', 2, (context: EventPluginContext) => { }); - expect(config.plugins.length).to.equal(3); - expect(config.plugins[0].priority).to.equal(1); - expect(config.plugins[1].priority).to.equal(2); - expect(config.plugins[2].priority).to.equal(3); - }); -}); diff --git a/src/configuration/Configuration.ts b/src/configuration/Configuration.ts deleted file mode 100644 index 7c23ba8f..00000000 --- a/src/configuration/Configuration.ts +++ /dev/null @@ -1,476 +0,0 @@ -import { DefaultLastReferenceIdManager } from '../lastReferenceIdManager/DefaultLastReferenceIdManager'; -import { ILastReferenceIdManager } from '../lastReferenceIdManager/ILastReferenceIdManager'; -import { ConsoleLog } from '../logging/ConsoleLog'; -import { ILog } from '../logging/ILog'; -import { NullLog } from '../logging/NullLog'; -import { IUserInfo } from '../models/IUserInfo'; -import { HeartbeatPlugin } from '../plugins/default/HeartbeatPlugin'; -import { ReferenceIdPlugin } from '../plugins/default/ReferenceIdPlugin'; -import { EventPluginContext } from '../plugins/EventPluginContext'; -import { EventPluginManager } from '../plugins/EventPluginManager'; -import { IEventPlugin } from '../plugins/IEventPlugin'; -import { DefaultEventQueue } from '../queue/DefaultEventQueue'; -import { IEventQueue } from '../queue/IEventQueue'; -import { IEnvironmentInfoCollector } from '../services/IEnvironmentInfoCollector'; -import { IErrorParser } from '../services/IErrorParser'; -import { IModuleCollector } from '../services/IModuleCollector'; -import { IRequestInfoCollector } from '../services/IRequestInfoCollector'; -import { InMemoryStorageProvider } from '../storage/InMemoryStorageProvider'; -import { IStorageProvider } from '../storage/IStorageProvider'; -import { DefaultSubmissionClient } from '../submission/DefaultSubmissionClient'; -import { ISubmissionAdapter } from '../submission/ISubmissionAdapter'; -import { ISubmissionClient } from '../submission/ISubmissionClient'; -import { Utils } from '../Utils'; -import { IConfigurationSettings } from './IConfigurationSettings'; -import { SettingsManager } from './SettingsManager'; - -export class Configuration implements IConfigurationSettings { - /** - * The default configuration settings that are applied to new configuration instances. - * @type {IConfigurationSettings} - * @private - */ - private static _defaultSettings: IConfigurationSettings = null; - - /** - * A default list of tags that will automatically be added to every - * report submitted to the server. - * - * @type {Array} - */ - public defaultTags: string[] = []; - - /** - * A default list of of extended data objects that will automatically - * be added to every report submitted to the server. - * - * @type {{}} - */ - public defaultData: object = {}; - - /** - * Whether the client is currently enabled or not. If it is disabled, - * submitted errors will be discarded and no data will be sent to the server. - * - * @returns {boolean} - */ - public enabled: boolean = true; - - public environmentInfoCollector: IEnvironmentInfoCollector; - public errorParser: IErrorParser; - public lastReferenceIdManager: ILastReferenceIdManager = new DefaultLastReferenceIdManager(); - public log: ILog; - public moduleCollector: IModuleCollector; - public requestInfoCollector: IRequestInfoCollector; - - /** - * Maximum number of events that should be sent to the server together in a batch. (Defaults to 50) - */ - public submissionBatchSize: number; - public submissionAdapter: ISubmissionAdapter; - public submissionClient: ISubmissionClient; - - /** - * Contains a dictionary of custom settings that can be used to control - * the client and will be automatically updated from the server. - */ - public settings: object = {}; - - public storage: IStorageProvider; - - public queue: IEventQueue; - - /** - * The API key that will be used when sending events to the server. - * @type {string} - * @private - */ - private _apiKey: string; - - /** - * The server url that all events will be sent to. - * @type {string} - * @private - */ - private _serverUrl: string = 'https://collector.exceptionless.io'; - - /** - * The heartbeat server url that all heartbeats will be sent to. - * @type {string} - * @private - */ - private _heartbeatServerUrl: string = 'https://heartbeat.exceptionless.io'; - - /** - * How often the client should check for updated server settings when idle. The default is every 2 minutes. - * @type {number} - * @private - */ - private _updateSettingsWhenIdleInterval: number = 120000; - - /** - * A list of exclusion patterns. - * @type {Array} - * @private - */ - private _dataExclusions: string[] = []; - - /** - * A list of user agent patterns. - * @type {Array} - * @private - */ - private _userAgentBotPatterns: string[] = []; - - /** - * The list of plugins that will be used in this configuration. - * @type {Array} - * @private - */ - private _plugins: IEventPlugin[] = []; - - /** - * A list of handlers that will be fired when configuration changes. - * @type {Array} - * @private - */ - private _handlers: Array<(config: Configuration) => void> = []; - - constructor(configSettings?: IConfigurationSettings) { - function inject(fn: any) { - return typeof fn === 'function' ? fn(this) : fn; - } - - configSettings = Utils.merge(Configuration.defaults, configSettings); - - this.log = inject(configSettings.log) || new NullLog(); - this.apiKey = configSettings.apiKey; - this.serverUrl = configSettings.serverUrl; - this.heartbeatServerUrl = configSettings.heartbeatServerUrl; - this.updateSettingsWhenIdleInterval = configSettings.updateSettingsWhenIdleInterval; - - this.environmentInfoCollector = inject(configSettings.environmentInfoCollector); - this.errorParser = inject(configSettings.errorParser); - this.lastReferenceIdManager = inject(configSettings.lastReferenceIdManager) || new DefaultLastReferenceIdManager(); - this.moduleCollector = inject(configSettings.moduleCollector); - this.requestInfoCollector = inject(configSettings.requestInfoCollector); - this.submissionBatchSize = inject(configSettings.submissionBatchSize) || 50; - this.submissionAdapter = inject(configSettings.submissionAdapter); - this.submissionClient = inject(configSettings.submissionClient) || new DefaultSubmissionClient(); - this.storage = inject(configSettings.storage) || new InMemoryStorageProvider(); - this.queue = inject(configSettings.queue) || new DefaultEventQueue(this); - - SettingsManager.applySavedServerSettings(this); - EventPluginManager.addDefaultPlugins(this); - } - - /** - * The API key that will be used when sending events to the server. - * @returns {string} - */ - public get apiKey(): string { - return this._apiKey; - } - - /** - * The API key that will be used when sending events to the server. - * @param value - */ - public set apiKey(value: string) { - this._apiKey = value || null; - this.log.info(`apiKey: ${this._apiKey}`); - this.changed(); - } - - /** - * Returns true if the apiKey is valid. - * @returns {boolean} - */ - public get isValid(): boolean { - return !!this.apiKey && this.apiKey.length >= 10; - } - - /** - * The server url that all events will be sent to. - * @returns {string} - */ - public get serverUrl(): string { - return this._serverUrl; - } - - /** - * The server url that all events will be sent to. - * @param value - */ - public set serverUrl(value: string) { - if (!!value) { - this._serverUrl = value; - this._heartbeatServerUrl = value; - this.log.info(`serverUrl: ${value}`); - this.changed(); - } - } - - /** - * The heartbeat server url that all heartbeats will be sent to. - * @returns {string} - */ - public get heartbeatServerUrl(): string { - return this._heartbeatServerUrl; - } - - /** - * The heartbeat server url that all heartbeats will be sent to. - * @param value - */ - public set heartbeatServerUrl(value: string) { - if (!!value) { - this._heartbeatServerUrl = value; - this.log.info(`heartbeatServerUrl: ${value}`); - this.changed(); - } - } - - /** - * How often the client should check for updated server settings when idle. The default is every 2 minutes. - * @returns {number} - */ - public get updateSettingsWhenIdleInterval(): number { - return this._updateSettingsWhenIdleInterval; - } - - /** - * How often the client should check for updated server settings when idle. The default is every 2 minutes. - * @param value - */ - public set updateSettingsWhenIdleInterval(value: number) { - if (typeof value !== 'number') { - return; - } - - if (value <= 0) { - value = -1; - } else if (value > 0 && value < 15000) { - value = 15000; - } - - this._updateSettingsWhenIdleInterval = value; - this.log.info(`updateSettingsWhenIdleInterval: ${value}`); - this.changed(); - } - - /** - * A list of exclusion patterns that will automatically remove any data that - * matches them from any data submitted to the server. - * - * For example, entering CreditCard will remove any extended data properties, - * form fields, cookies and query parameters from the report. - * - * @returns {string[]} - */ - public get dataExclusions(): string[] { - const exclusions: string = this.settings['@@DataExclusions']; - return this._dataExclusions.concat(exclusions && exclusions.split(',') || []); - } - - /** - * Add items to the list of exclusion patterns that will automatically remove any - * data that matches them from any data submitted to the server. - * - * For example, entering CreditCard will remove any extended data properties, form - * fields, cookies and query parameters from the report. - * - * @param exclusions - */ - public addDataExclusions(...exclusions: string[]) { - this._dataExclusions = Utils.addRange(this._dataExclusions, ...exclusions); - } - - /** - * A list of user agent patterns that will cause any event with a matching user agent to not be submitted. - * - * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted. - * - * @returns {string[]} - */ - public get userAgentBotPatterns(): string[] { - const patterns: string = this.settings['@@UserAgentBotPatterns']; - return this._userAgentBotPatterns.concat(patterns && patterns.split(',') || []); - } - - /** - * Add items to the list of user agent patterns that will cause any event with a matching user agent to not be submitted. - * - * For example, entering *Bot* will cause any events that contains a user agent of Bot will not be submitted. - * - * @param userAgentBotPatterns - */ - public addUserAgentBotPatterns(...userAgentBotPatterns: string[]) { - this._userAgentBotPatterns = Utils.addRange(this._userAgentBotPatterns, ...userAgentBotPatterns); - } - - /** - * The list of plugins that will be used in this configuration. - * @returns {IEventPlugin[]} - */ - public get plugins(): IEventPlugin[] { - return this._plugins.sort((p1: IEventPlugin, p2: IEventPlugin) => { - return (p1.priority < p2.priority) ? -1 : (p1.priority > p2.priority) ? 1 : 0; - }); - } - - /** - * Register an plugin to be used in this configuration. - * @param plugin - */ - public addPlugin(plugin: IEventPlugin): void; - - /** - * Register an plugin to be used in this configuration. - * @param name The name used to identify the plugin. - * @param priority Used to determine plugins priority. - * @param pluginAction A function that is run. - */ - public addPlugin(name: string, priority: number, pluginAction: (context: EventPluginContext, next?: () => void) => void): void; - public addPlugin(pluginOrName: IEventPlugin | string, priority?: number, pluginAction?: (context: EventPluginContext, next?: () => void) => void): void { - const plugin: IEventPlugin = !!pluginAction ? { name: pluginOrName as string, priority, run: pluginAction } : pluginOrName as IEventPlugin; - if (!plugin || !plugin.run) { - this.log.error('Add plugin failed: Run method not defined'); - return; - } - - if (!plugin.name) { - plugin.name = Utils.guid(); - } - - if (!plugin.priority) { - plugin.priority = 0; - } - - let pluginExists: boolean = false; - const plugins = this._plugins; // optimization for minifier. - for (const p of plugins) { - if (p.name === plugin.name) { - pluginExists = true; - break; - } - } - - if (!pluginExists) { - plugins.push(plugin); - } - } - - /** - * Remove the plugin from this configuration. - * @param plugin - */ - public removePlugin(plugin: IEventPlugin): void; - - /** - * Remove an plugin by key from this configuration. - * @param name - */ - public removePlugin(pluginOrName: IEventPlugin | string): void { - const name: string = typeof pluginOrName === 'string' ? pluginOrName : pluginOrName.name; - if (!name) { - this.log.error('Remove plugin failed: Plugin name not defined'); - return; - } - - const plugins = this._plugins; // optimization for minifier. - for (let index = 0; index < plugins.length; index++) { - if (plugins[index].name === name) { - plugins.splice(index, 1); - break; - } - } - } - - /** - * Automatically set the application version for events. - * @param version - */ - public setVersion(version: string): void { - if (!!version) { - this.defaultData['@version'] = version; - } - } - - public setUserIdentity(userInfo: IUserInfo): void; - public setUserIdentity(identity: string): void; - public setUserIdentity(identity: string, name: string): void; - public setUserIdentity(userInfoOrIdentity: IUserInfo | string, name?: string): void { - const USER_KEY: string = '@user'; // optimization for minifier. - const userInfo: IUserInfo = typeof userInfoOrIdentity !== 'string' ? userInfoOrIdentity : { identity: userInfoOrIdentity, name }; - - const shouldRemove: boolean = !userInfo || (!userInfo.identity && !userInfo.name); - if (shouldRemove) { - delete this.defaultData[USER_KEY]; - } else { - this.defaultData[USER_KEY] = userInfo; - } - - this.log.info(`user identity: ${shouldRemove ? 'null' : userInfo.identity}`); - } - - /** - * Used to identify the client that sent the events to the server. - * @returns {string} - */ - public get userAgent(): string { - return 'exceptionless-js/1.0.0.0'; - } - - /** - * Automatically send a heartbeat to keep the session alive. - */ - public useSessions(sendHeartbeats: boolean = true, heartbeatInterval: number = 30000): void { - if (sendHeartbeats) { - this.addPlugin(new HeartbeatPlugin(heartbeatInterval)); - } - } - - /** - * Automatically set a reference id for error events. - */ - public useReferenceIds(): void { - this.addPlugin(new ReferenceIdPlugin()); - } - - public useLocalStorage(): void { - // This method will be injected via the prototype. - } - - // TODO: Support a min log level. - public useDebugLogger(): void { - this.log = new ConsoleLog(); - } - - public onChanged(handler: (config: Configuration) => void) { - !!handler && this._handlers.push(handler); - } - - private changed() { - const handlers = this._handlers; // optimization for minifier. - for (const handler of handlers) { - try { - handler(this); - } catch (ex) { - this.log.error(`Error calling onChanged handler: ${ex}`); - } - } - } - - /** - * The default configuration settings that are applied to new configuration instances. - * @returns {IConfigurationSettings} - */ - public static get defaults() { - if (Configuration._defaultSettings === null) { - Configuration._defaultSettings = {}; - } - - return Configuration._defaultSettings; - } -} diff --git a/src/configuration/IConfigurationSettings.ts b/src/configuration/IConfigurationSettings.ts deleted file mode 100644 index bb57cdbc..00000000 --- a/src/configuration/IConfigurationSettings.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { ILastReferenceIdManager } from '../lastReferenceIdManager/ILastReferenceIdManager'; -import { ILog } from '../logging/ILog'; -import { IEventQueue } from '../queue/IEventQueue'; -import { IEnvironmentInfoCollector } from '../services/IEnvironmentInfoCollector'; -import { IErrorParser } from '../services/IErrorParser'; -import { IModuleCollector } from '../services/IModuleCollector'; -import { IRequestInfoCollector } from '../services/IRequestInfoCollector'; -import { IStorageProvider } from '../storage/IStorageProvider'; -import { ISubmissionAdapter } from '../submission/ISubmissionAdapter'; -import { ISubmissionClient } from '../submission/ISubmissionClient'; - -export interface IConfigurationSettings { - apiKey?: string; - serverUrl?: string; - heartbeatServerUrl?: string; - updateSettingsWhenIdleInterval?: number; - environmentInfoCollector?: IEnvironmentInfoCollector; - errorParser?: IErrorParser; - lastReferenceIdManager?: ILastReferenceIdManager; - log?: ILog; - moduleCollector?: IModuleCollector; - requestInfoCollector?: IRequestInfoCollector; - submissionBatchSize?: number; - submissionClient?: ISubmissionClient; - submissionAdapter?: ISubmissionAdapter; - storage?: IStorageProvider; - queue?: IEventQueue; -} diff --git a/src/configuration/SettingsManager-spec.ts b/src/configuration/SettingsManager-spec.ts deleted file mode 100644 index 8b08df99..00000000 --- a/src/configuration/SettingsManager-spec.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { expect } from 'chai'; -import { Configuration } from './Configuration'; -import { SettingsManager } from './SettingsManager'; - -describe('SettingsManager', () => { - it('should call changed handler', (done) => { - const config = new Configuration({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw' }); - - SettingsManager.onChanged((configuration: Configuration) => { - expect(configuration.settings).not.to.be.undefined; - done(); - }); - - SettingsManager.applySavedServerSettings(config); - (SettingsManager as any)._handlers = []; - }); -}); diff --git a/src/configuration/SettingsManager.ts b/src/configuration/SettingsManager.ts deleted file mode 100644 index 426b6eca..00000000 --- a/src/configuration/SettingsManager.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { SettingsResponse } from '../submission/SettingsResponse'; -import { Utils } from '../Utils'; -import { Configuration } from './Configuration'; - -interface ISettingsWithVersion { - version: number; - settings: { [key: string]: string }; -} - -export class SettingsManager { - /** - * A list of handlers that will be fired when the settings change. - * @type {Array} - * @private - */ - private static _handlers: Array<(config: Configuration) => void> = []; - - public static onChanged(handler: (config: Configuration) => void) { - !!handler && this._handlers.push(handler); - } - - public static applySavedServerSettings(config: Configuration): void { - if (!config || !config.isValid) { - return; - } - - const savedSettings = this.getSavedServerSettings(config); - config.log.info(`Applying saved settings: v${savedSettings.version}`); - config.settings = Utils.merge(config.settings, savedSettings.settings); - this.changed(config); - } - - public static getVersion(config: Configuration): number { - if (!config || !config.isValid) { - return 0; - } - - const savedSettings = this.getSavedServerSettings(config); - return savedSettings.version || 0; - } - - public static checkVersion(version: number, config: Configuration): void { - const currentVersion: number = this.getVersion(config); - if (version <= currentVersion) { - return; - } - - config.log.info(`Updating settings from v${currentVersion} to v${version}`); - this.updateSettings(config, currentVersion); - } - - public static updateSettings(config: Configuration, version?: number): void { - if (!config || !config.enabled) { - return; - } - - const unableToUpdateMessage = 'Unable to update settings'; - if (!config.isValid) { - config.log.error(`${unableToUpdateMessage}: ApiKey is not set.`); - return; - } - - if (!version || version < 0) { - version = this.getVersion(config); - } - - config.log.info(`Checking for updated settings from: v${version}.`); - config.submissionClient.getSettings(config, version, (response: SettingsResponse) => { - if (!config || !response || !response.success || !response.settings) { - config.log.warn(`${unableToUpdateMessage}: ${response.message}`); - return; - } - - config.settings = Utils.merge(config.settings, response.settings); - - // TODO: Store snapshot of settings after reading from config and attributes and use that to revert to defaults. - // Remove any existing server settings that are not in the new server settings. - const savedServerSettings = SettingsManager.getSavedServerSettings(config); - for (const key in savedServerSettings) { - if (response.settings[key]) { - continue; - } - - delete config.settings[key]; - } - - const newSettings: ISettingsWithVersion = { - version: response.settingsVersion, - settings: response.settings - }; - - config.storage.settings.save(newSettings); - - config.log.info(`Updated settings: v${newSettings.version}`); - this.changed(config); - }); - } - - private static changed(config: Configuration) { - const handlers = this._handlers; // optimization for minifier. - for (const handler of handlers) { - try { - handler(config); - } catch (ex) { - config.log.error(`Error calling onChanged handler: ${ex}`); - } - } - } - - private static getSavedServerSettings(config: Configuration): ISettingsWithVersion { - const item = config.storage.settings.get()[0]; - if (item && item.value && item.value.version && item.value.settings) { - return item.value; - } - - return { version: 0, settings: {} }; - } -} diff --git a/src/exceptionless.node.ts b/src/exceptionless.node.ts deleted file mode 100644 index 31258c06..00000000 --- a/src/exceptionless.node.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { Configuration } from './configuration/Configuration'; -import { SettingsManager } from './configuration/SettingsManager'; -import { ExceptionlessClient } from './ExceptionlessClient'; -import { NodeEnvironmentInfoCollector } from './services/NodeEnvironmentInfoCollector'; -import { NodeErrorParser } from './services/NodeErrorParser'; -import { NodeModuleCollector } from './services/NodeModuleCollector'; -import { NodeRequestInfoCollector } from './services/NodeRequestInfoCollector'; -import { NodeFileStorageProvider } from './storage/NodeFileStorageProvider'; -import { NodeSubmissionAdapter } from './submission/NodeSubmissionAdapter'; - -(function init() { - if (typeof process === 'undefined') { - return; - } - - const defaults = Configuration.defaults; - defaults.environmentInfoCollector = new NodeEnvironmentInfoCollector(); - defaults.errorParser = new NodeErrorParser(); - defaults.moduleCollector = new NodeModuleCollector(); - defaults.requestInfoCollector = new NodeRequestInfoCollector(); - defaults.submissionAdapter = new NodeSubmissionAdapter(); - - Configuration.prototype.useLocalStorage = function() { - this.storage = new NodeFileStorageProvider(); - SettingsManager.applySavedServerSettings(this); - this.changed(); - }; - - process.addListener('uncaughtException', (error: Error) => { - ExceptionlessClient.default.submitUnhandledException(error, 'uncaughtException'); - }); - - process.on('exit', (code: number) => { - /** - * exit codes: https://nodejs.org/api/process.html#process_event_exit - * From now on, only synchronous code may run. As soon as this method - * ends, the application inevitably will exit. - */ - function getExitCodeReason(exitCode: number): string { - if (exitCode === 1) { - return 'Uncaught Fatal Exception'; - } - - if (exitCode === 3) { - return 'Internal JavaScript Parse Error'; - } - - if (exitCode === 4) { - return 'Internal JavaScript Evaluation Failure'; - } - - if (exitCode === 5) { - return 'Fatal Exception'; - } - - if (exitCode === 6) { - return 'Non-function Internal Exception Handler '; - } - - if (exitCode === 7) { - return 'Internal Exception Handler Run-Time Failure'; - } - - if (exitCode === 8) { - return 'Uncaught Exception'; - } - - if (exitCode === 9) { - return 'Invalid Argument'; - } - - if (exitCode === 10) { - return 'Internal JavaScript Run-Time Failure'; - } - - if (exitCode === 12) { - return 'Invalid Debug Argument'; - } - - return null; - } - - const client = ExceptionlessClient.default; - const message = getExitCodeReason(code); - - if (message !== null) { - client.submitLog('exit', message, 'Error'); - } - - client.config.queue.process(true); - // Application will now exit. - }); - - (Error as any).stackTraceLimit = Infinity; -})(); diff --git a/src/exceptionless.ts b/src/exceptionless.ts deleted file mode 100644 index f40c63d8..00000000 --- a/src/exceptionless.ts +++ /dev/null @@ -1,92 +0,0 @@ -import * as TraceKit from 'TraceKit'; -import { Configuration } from './configuration/Configuration'; -import { IConfigurationSettings } from './configuration/IConfigurationSettings'; -import { SettingsManager } from './configuration/SettingsManager'; -import { ExceptionlessClient } from './ExceptionlessClient'; -import { DefaultErrorParser } from './services/DefaultErrorParser'; -import { DefaultModuleCollector } from './services/DefaultModuleCollector'; -import { DefaultRequestInfoCollector } from './services/DefaultRequestInfoCollector'; -import { BrowserStorage } from './storage/BrowserStorage'; -import { BrowserStorageProvider } from './storage/BrowserStorageProvider'; -import { DefaultSubmissionAdapter } from './submission/DefaultSubmissionAdapter'; -import { Utils } from './Utils'; - -(function init() { - function getDefaultsSettingsFromScriptTag(): IConfigurationSettings { - if (!document || !document.getElementsByTagName) { - return null; - } - - const scripts = document.getElementsByTagName('script'); - // tslint:disable-next-line:prefer-for-of - for (let index = 0; index < scripts.length; index++) { - if (scripts[index].src && scripts[index].src.indexOf('/exceptionless') > -1) { - return Utils.parseQueryString(scripts[index].src.split('?').pop()); - } - } - return null; - } - - function processUnhandledException(stackTrace: TraceKit.StackTrace, options?: any): void { - const builder = ExceptionlessClient.default.createUnhandledException(new Error(stackTrace.message || (options || {}).status || 'Script error'), 'onerror'); - builder.pluginContextData['@@_TraceKit.StackTrace'] = stackTrace; - builder.submit(); - } - - if (typeof document === 'undefined') { - return; - } - - /* - TODO: We currently are unable to parse string exceptions. - function processJQueryAjaxError(event, xhr, settings, error:string): void { - let client = ExceptionlessClient.default; - if (xhr.status === 404) { - client.submitNotFound(settings.url); - } else if (xhr.status !== 401) { - client.createUnhandledException(error, 'JQuery.ajaxError') - .setSource(settings.url) - .setProperty('status', xhr.status) - .setProperty('request', settings.data) - .setProperty('response', xhr.responseText && xhr.responseText.slice && xhr.responseText.slice(0, 1024)) - .submit(); - } - } - */ - - Configuration.prototype.useLocalStorage = function() { - if (BrowserStorage.isAvailable()) { - this.storage = new BrowserStorageProvider(); - SettingsManager.applySavedServerSettings(this); - this.changed(); - } - }; - - const defaults = Configuration.defaults; - const settings = getDefaultsSettingsFromScriptTag(); - if (settings && (settings.apiKey || settings.serverUrl)) { - defaults.apiKey = settings.apiKey; - defaults.serverUrl = settings.serverUrl; - } - - defaults.errorParser = new DefaultErrorParser(); - defaults.moduleCollector = new DefaultModuleCollector(); - defaults.requestInfoCollector = new DefaultRequestInfoCollector(); - defaults.submissionAdapter = new DefaultSubmissionAdapter(); - - TraceKit.report.subscribe(processUnhandledException); - TraceKit.extendToAsynchronousCallbacks(); - - // window && window.addEventListener && window.addEventListener('beforeunload', function () { - // ExceptionlessClient.default.config.queue.process(true); - // }); - - // if (typeof $ !== 'undefined' && $(document)) { - // $(document).ajaxError(processJQueryAjaxError); - // } - - (Error as any).stackTraceLimit = Infinity; -})(); - -// tslint:disable-next-line:prefer-const -declare var $; diff --git a/src/exceptionless.universal.ts b/src/exceptionless.universal.ts deleted file mode 100644 index 63e77071..00000000 --- a/src/exceptionless.universal.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as ExceptionlessBrowser from './exceptionless'; -import * as ExceptionlessNode from './exceptionless.node'; diff --git a/src/integrations/angular.ts b/src/integrations/angular.ts deleted file mode 100644 index 0f727195..00000000 --- a/src/integrations/angular.ts +++ /dev/null @@ -1,118 +0,0 @@ -// Update once ts issue is fixed: https://github.com/Microsoft/TypeScript/issues/2192 -// import * as exceptionless from '../../dist/exceptionless' -declare var exceptionless; - -angular.module('exceptionless', []) - .constant('$ExceptionlessClient', exceptionless.ExceptionlessClient.default) - .factory('exceptionlessHttpInterceptor', ['$location', '$q', '$ExceptionlessClient', ($location, $q, $ExceptionlessClient) => { - return { - responseError: function responseError(response) { - if (response.status === 404) { - $ExceptionlessClient.submitNotFound(response.config.url); - } else if (response.status !== 401) { - const message = `[${response.status}] ${(response.data && response.data.Message ? response.data.Message : response.config.url)}`; - $ExceptionlessClient.createUnhandledException(new Error(message), 'errorHttpInterceptor') - .setSource(response.config.url) - .setProperty('response', response) - .setProperty('referrer', $location.absUrl()) - .submit(); - } - return $q.reject(response); - } - }; - }]) - .config(['$httpProvider', '$provide', '$ExceptionlessClient', ($httpProvider, $provide, $ExceptionlessClient) => { - $httpProvider.interceptors.push('exceptionlessHttpInterceptor'); - $provide.decorator('$exceptionHandler', ['$delegate', ($delegate) => { - return (exception, cause) => { - $delegate(exception, cause); - $ExceptionlessClient.createUnhandledException(exception, '$exceptionHandler').setMessage(cause).submit(); - }; - }]); - $provide.decorator('$log', ['$delegate', ($delegate) => { - function decorateRegularCall(property, logLevel) { - const previousFn = $delegate[property]; - return $delegate[property] = (...args) => { - if (angular.mock) { - // Needed to support angular-mocks. - $delegate[property].logs = []; - } - previousFn.apply(null, args); - if (args[0] && args[0].length > 0) { - $ExceptionlessClient.submitLog(null, args[0], logLevel); - } - }; - } - - $delegate.log = decorateRegularCall('log', 'Trace'); - $delegate.info = decorateRegularCall('info', 'Info'); - $delegate.warn = decorateRegularCall('warn', 'Warn'); - $delegate.debug = decorateRegularCall('debug', 'Debug'); - $delegate.error = decorateRegularCall('error', 'Error'); - return $delegate; - }]); - }]) - .run(['$rootScope', '$ExceptionlessClient', ($rootScope, $ExceptionlessClient) => { - $rootScope.$on('$routeChangeSuccess', (event, next, current) => { - if (!current) { - return; - } - - $ExceptionlessClient.createFeatureUsage(current.name) - .setProperty('next', next) - .setProperty('current', current) - .submit(); - }); - - $rootScope.$on('$routeChangeError', (event, current, previous, rejection) => { - $ExceptionlessClient.createUnhandledException(new Error(rejection), '$routeChangeError') - .setProperty('current', current) - .setProperty('previous', previous) - .submit(); - }); - - $rootScope.$on('$stateChangeSuccess', (event, toState, toParams, fromState, fromParams) => { - if (!toState || toState.name === 'otherwise') { - return; - } - - $ExceptionlessClient.createFeatureUsage(toState.controller || toState.name) - .setProperty('toState', toState) - .setProperty('toParams', toParams) - .setProperty('fromState', fromState) - .setProperty('fromParams', fromParams) - .submit(); - }); - - $rootScope.$on('$stateNotFound', (event, unfoundState, fromState, fromParams) => { - if (!unfoundState) { - return; - } - - $ExceptionlessClient.createNotFound(unfoundState.to) - .setProperty('unfoundState', unfoundState) - .setProperty('fromState', fromState) - .setProperty('fromParams', fromParams) - .submit(); - }); - - const stateChangeError = '$stateChangeError'; - $rootScope.$on(stateChangeError, (event, toState, toParams, fromState, fromParams, error) => { - if (!error) { - return; - } - - const builder = error && error.status === 404 ? $ExceptionlessClient.createNotFound(error.config.url) : $ExceptionlessClient.createUnhandledException(error, stateChangeError); - builder.setSource(stateChangeError) - .setMessage(error && error.statusText) - .setProperty('toState', toState) - .setProperty('toParams', toParams) - .setProperty('fromState', fromState) - .setProperty('fromParams', fromParams) - .submit(); - }); - - $rootScope.$on('$destroy', () => { - $ExceptionlessClient.config.queue.process(); - }); - }]); diff --git a/src/integrations/tsconfig.json b/src/integrations/tsconfig.json deleted file mode 100644 index 8ea2e2a7..00000000 --- a/src/integrations/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "removeComments": true, - "sourceMap": false, - "target": "es5" - }, - "files": [ - "../../node_modules/@types/angular/index.d.ts", - "../../node_modules/@types/angular-mocks/index.d.ts", - "../../node_modules/@types/angular-mocks/mocks.d.ts", - "../../node_modules/@types/jquery/index.d.ts", - "angular.ts" - ], - "bundles": { - "angular": { - "files": [ - "../../node_modules/@types/angular/index.d.ts", - "../../node_modules/@types/angular-mocks/index.d.ts", - "../../node_modules/@types/angular-mocks/mocks.d.ts", - "../../node_modules/@types/jquery/index.d.ts", - "angular.ts" - ] - } - } -} diff --git a/src/logging/ConsoleLog.ts b/src/logging/ConsoleLog.ts deleted file mode 100644 index e81bd543..00000000 --- a/src/logging/ConsoleLog.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ILog } from './ILog'; - -export class ConsoleLog implements ILog { - public trace(message: string): void { - this.log('debug', message); - } - - public info(message: string): void { - this.log('info', message); - } - - public warn(message: string): void { - this.log('warn', message); - } - - public error(message: string): void { - this.log('error', message); - } - - private log(level: string, message: string) { - if (console) { - const msg = `[${level}] Exceptionless: ${message}`; - - if (console[level]) { - console[level](msg); - } else if (console.log) { - console[`log`](msg); - } - } - } -} diff --git a/src/logging/NullLog.ts b/src/logging/NullLog.ts deleted file mode 100644 index 881a1d92..00000000 --- a/src/logging/NullLog.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ILog } from './ILog'; - -export class NullLog implements ILog { - public trace(message: string): void { } - public info(message: string): void { } - public warn(message: string): void { } - public error(message: string): void { } -} diff --git a/src/models/IClientConfiguration.ts b/src/models/IClientConfiguration.ts deleted file mode 100644 index d4ec94b3..00000000 --- a/src/models/IClientConfiguration.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IClientConfiguration { - settings: object; - version: number; -} diff --git a/src/models/IError.ts b/src/models/IError.ts deleted file mode 100644 index 6fd6e6cd..00000000 --- a/src/models/IError.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IInnerError } from './IInnerError'; -import { IModule } from './IModule'; - -export interface IError extends IInnerError { - modules?: IModule[]; -} diff --git a/src/models/IEvent.ts b/src/models/IEvent.ts deleted file mode 100644 index 99a6f5b5..00000000 --- a/src/models/IEvent.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface IEvent { - type?: string; - source?: string; - date?: Date; - tags?: string[]; - message?: string; - geo?: string; - value?: number; - data?: any; - reference_id?: string; - count?: number; -} diff --git a/src/models/IInnerError.ts b/src/models/IInnerError.ts deleted file mode 100644 index cf113912..00000000 --- a/src/models/IInnerError.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { IMethod } from './IMethod'; -import { IStackFrame } from './IStackFrame'; - -export interface IInnerError { - message?: string; - type?: string; - code?: string; - data?: any; - inner?: IInnerError; - stack_trace?: IStackFrame[]; - target_method?: IMethod; -} diff --git a/src/models/IManualStackingInfo.ts b/src/models/IManualStackingInfo.ts deleted file mode 100644 index c7915c96..00000000 --- a/src/models/IManualStackingInfo.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IManualStackingInfo { - title?: string; - signature_data?: any; -} diff --git a/src/models/IMethod.ts b/src/models/IMethod.ts deleted file mode 100644 index 4a3b681b..00000000 --- a/src/models/IMethod.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IParameter } from './IParameter'; - -export interface IMethod { - data?: any; - generic_arguments?: string[]; - parameters?: IParameter[]; - - is_signature_target?: boolean; - declaring_namespace?: string; - declaring_type?: string; - name?: string; - module_id?: number; -} diff --git a/src/models/IParameter.ts b/src/models/IParameter.ts deleted file mode 100644 index b570e483..00000000 --- a/src/models/IParameter.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface IParameter { - data?: any; - generic_arguments?: string[]; - - name?: string; - type?: string; - type_namespace?: string; -} diff --git a/src/models/IRequestInfo.ts b/src/models/IRequestInfo.ts deleted file mode 100644 index bd740410..00000000 --- a/src/models/IRequestInfo.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface IRequestInfo { - user_agent?: string; - http_method?: string; - is_secure?: boolean; - host?: string; - port?: number; - path?: string; - referrer?: string; - client_ip_address?: string; - cookies?: any; - post_data?: any; - query_string?: any; - data?: any; -} diff --git a/src/models/IStackFrame.ts b/src/models/IStackFrame.ts deleted file mode 100644 index 46558800..00000000 --- a/src/models/IStackFrame.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IMethod } from './IMethod'; - -export interface IStackFrame extends IMethod { - file_name?: string; - line_number?: number; - column?: number; -} diff --git a/src/models/IUserDescription.ts b/src/models/IUserDescription.ts deleted file mode 100644 index 7f21a7b4..00000000 --- a/src/models/IUserDescription.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface IUserDescription { - email_address?: string; - description?: string; - data?: any; -} diff --git a/src/models/IUserInfo.ts b/src/models/IUserInfo.ts deleted file mode 100644 index 44c85e9f..00000000 --- a/src/models/IUserInfo.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface IUserInfo { - identity?: string; - name?: string; - data?: any; -} diff --git a/src/plugins/ContextData.ts b/src/plugins/ContextData.ts deleted file mode 100644 index 122546f1..00000000 --- a/src/plugins/ContextData.ts +++ /dev/null @@ -1,33 +0,0 @@ -export class ContextData { - public setException(exception: Error): void { - if (exception) { - this['@@_Exception'] = exception; - } - } - - public get hasException(): boolean { - return !!this['@@_Exception']; - } - - public getException(): Error { - return this['@@_Exception'] || null; - } - - public markAsUnhandledError(): void { - this['@@_IsUnhandledError'] = true; - } - - public get isUnhandledError(): boolean { - return !!this['@@_IsUnhandledError']; - } - - public setSubmissionMethod(method: string): void { - if (method) { - this['@@_SubmissionMethod'] = method; - } - } - - public getSubmissionMethod(): string { - return this['@@_SubmissionMethod'] || null; - } -} diff --git a/src/plugins/EventPluginContext.ts b/src/plugins/EventPluginContext.ts deleted file mode 100644 index 9ddc76d2..00000000 --- a/src/plugins/EventPluginContext.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ExceptionlessClient } from '../ExceptionlessClient'; -import { ILog } from '../logging/ILog'; -import { IEvent } from '../models/IEvent'; -import { ContextData } from './ContextData'; - -export class EventPluginContext { - public cancelled: boolean; - public client: ExceptionlessClient; - public event: IEvent; - public contextData: ContextData; - - constructor(client: ExceptionlessClient, event: IEvent, contextData?: ContextData) { - this.client = client; - this.event = event; - this.contextData = contextData ? contextData : new ContextData(); - } - - public get log(): ILog { - return this.client.config.log; - } -} diff --git a/src/plugins/EventPluginManager-spec.ts b/src/plugins/EventPluginManager-spec.ts deleted file mode 100644 index c919d261..00000000 --- a/src/plugins/EventPluginManager-spec.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { expect } from 'chai'; -import { ExceptionlessClient } from '../ExceptionlessClient'; -import { ContextData } from './ContextData'; -import { EventPluginContext } from './EventPluginContext'; -import { EventPluginManager } from './EventPluginManager'; - -describe('EventPluginManager', () => { - it('should add items to the event.', (done) => { - const client = new ExceptionlessClient({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl: 'http://localhost:50000' }); - const context = new EventPluginContext(client, {}, new ContextData()); - expect(context.event.source).to.be.undefined; - expect(context.event.geo).to.be.undefined; - - expect(client.config.plugins).not.to.equal(null); - while (client.config.plugins.length > 0) { - client.config.removePlugin(client.config.plugins[0]); - } - - client.config.addPlugin('1', 1, (ctx: EventPluginContext, next?: () => void) => { - setTimeout(() => { - ctx.event.source = 'plugin 1'; - - if (next) { - next(); - } - }, 25); - }); - - client.config.addPlugin('2', 2, (ctx: EventPluginContext, next?: () => void) => { - ctx.event.geo = '43.5775,88.4472'; - - if (next) { - next(); - } - }); - - EventPluginManager.run(context, (ctx?: EventPluginContext) => { - expect(ctx.cancelled).to.be.undefined; - expect(ctx.event.source).to.equal('plugin 1'); - expect(ctx.event.geo).to.equal('43.5775,88.4472'); - - done(); - }); - }); - - it('setting cancel should stop plugin execution.', (done) => { - const client = new ExceptionlessClient({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl: 'http://localhost:50000' }); - const context = new EventPluginContext(client, {}, new ContextData()); - - expect(client.config.plugins).not.to.equal(null); - while (client.config.plugins.length > 0) { - client.config.removePlugin(client.config.plugins[0]); - } - - client.config.addPlugin('1', 1, (ctx: EventPluginContext, next?: () => void) => { - ctx.cancelled = true; - - if (next) { - next(); - } - }); - - client.config.addPlugin('2', 2, () => { - // Fail this test as this plugin should not be called. - expect(false).to.equal(true); - }); - - EventPluginManager.run(context, (ctx?: EventPluginContext) => { - expect(ctx.cancelled).to.equal(true); - done(); - done = () => { }; - }); - }); - - it('throwing error should stop plugin execution.', (done) => { - const client = new ExceptionlessClient({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl: 'http://localhost:50000' }); - const context = new EventPluginContext(client, {}, new ContextData()); - - expect(client.config.plugins).not.to.equal(null); - while (client.config.plugins.length > 0) { - client.config.removePlugin(client.config.plugins[0]); - } - - client.config.addPlugin('1', 1, () => { - throw new Error('Random Error'); - }); - - client.config.addPlugin('2', 2, () => { - // Fail this test as this plugin should not be called. - expect(false).to.equal(true); - }); - - EventPluginManager.run(context, (ctx?: EventPluginContext) => { - expect(ctx.cancelled).to.equal(true); - done(); - }); - }); - - it('throwing async error should stop plugin execution.', (done) => { - const client = new ExceptionlessClient({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl: 'http://localhost:50000' }); - const context = new EventPluginContext(client, {}, new ContextData()); - - expect(client.config.plugins).not.to.equal(null); - while (client.config.plugins.length > 0) { - client.config.removePlugin(client.config.plugins[0]); - } - - client.config.addPlugin('1', 1, (ctx: EventPluginContext, next?: () => void) => { - // NOTE: Currently you have to catch it and set cancelled. - setTimeout(() => { - try { - throw new Error('Random Error'); - } catch (e) { - ctx.cancelled = true; - } - - if (next) { - next(); - } - }, 25); - }); - - client.config.addPlugin('2', 2, () => { - // Fail this test as this plugin should not be called. - expect(false).to.equal(true); - }); - - EventPluginManager.run(context, (ctx?: EventPluginContext) => { - expect(ctx.cancelled).to.equal(true); - done(); - }); - }); - - it('should cancel via timeout.', (done) => { - const client = new ExceptionlessClient({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl: 'http://localhost:50000' }); - const context = new EventPluginContext(client, {}, new ContextData()); - - expect(client.config.plugins).not.to.equal(null); - while (client.config.plugins.length > 0) { - client.config.removePlugin(client.config.plugins[0]); - } - - client.config.addPlugin('1', 1, (ctx: EventPluginContext, next?: () => void) => { - setTimeout(done, 25); - }); - - client.config.addPlugin('2', 2, () => { - // Fail this test as this plugin should not be called. - expect(false).to.equal(true); - }); - - EventPluginManager.run(context, (ctx?: EventPluginContext) => { - // Fail this test as this callback should not be called. - expect(false).to.equal(true); - }); - }); - - it('should ensure config plugins are not wrapped.', () => { - const client = new ExceptionlessClient({ apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl: 'http://localhost:50000' }); - const context = new EventPluginContext(client, {}, new ContextData()); - - expect(client.config.plugins).not.to.equal(null); - while (client.config.plugins.length > 0) { - client.config.removePlugin(client.config.plugins[0]); - } - - client.config.addPlugin('1', 1, (ctx: EventPluginContext, next?: () => void) => { - if (next) { - next(); - } - }); - - expect(client.config.plugins[0].name).to.equal('1'); - expect(client.config.plugins.length).to.equal(1); - EventPluginManager.run(context, (ctx?: EventPluginContext) => { - expect(client.config.plugins[0].name).to.equal('1'); - }); - expect(client.config.plugins.length).to.equal(1); - - EventPluginManager.run(context, (ctx?: EventPluginContext) => { - expect(client.config.plugins[0].name).to.equal('1'); - }); - expect(client.config.plugins.length).to.equal(1); - }); -}); diff --git a/src/plugins/EventPluginManager.ts b/src/plugins/EventPluginManager.ts deleted file mode 100644 index 97e056d3..00000000 --- a/src/plugins/EventPluginManager.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { Configuration } from '../configuration/Configuration'; -import { ConfigurationDefaultsPlugin } from './default/ConfigurationDefaultsPlugin'; -import { DuplicateCheckerPlugin } from './default/DuplicateCheckerPlugin'; -import { EnvironmentInfoPlugin } from './default/EnvironmentInfoPlugin'; -import { ErrorPlugin } from './default/ErrorPlugin'; -import { EventExclusionPlugin } from './default/EventExclusionPlugin'; -import { ModuleInfoPlugin } from './default/ModuleInfoPlugin'; -import { RequestInfoPlugin } from './default/RequestInfoPlugin'; -import { SubmissionMethodPlugin } from './default/SubmissionMethodPlugin'; -import { EventPluginContext } from './EventPluginContext'; -import { IEventPlugin } from './IEventPlugin'; - -export class EventPluginManager { - public static run(context: EventPluginContext, callback: (context?: EventPluginContext) => void): void { - const wrap = (plugin: IEventPlugin, next?: () => void): () => void => { - return () => { - try { - if (!context.cancelled) { - plugin.run(context, next); - } - } catch (ex) { - context.cancelled = true; - context.log.error(`Error running plugin '${plugin.name}': ${ex.message}. Discarding Event.`); - } - - if (context.cancelled && !!callback) { - callback(context); - } - }; - }; - - const plugins: IEventPlugin[] = context.client.config.plugins; // optimization for minifier. - const wrappedPlugins: Array<() => void> = []; - if (!!callback) { - wrappedPlugins[plugins.length] = wrap({ name: 'cb', priority: 9007199254740992, run: callback }, null); - } - - for (let index = plugins.length - 1; index > -1; index--) { - wrappedPlugins[index] = wrap(plugins[index], !!callback || (index < plugins.length - 1) ? wrappedPlugins[index + 1] : null); - } - - wrappedPlugins[0](); - } - - public static addDefaultPlugins(config: Configuration): void { - config.addPlugin(new ConfigurationDefaultsPlugin()); - config.addPlugin(new ErrorPlugin()); - config.addPlugin(new DuplicateCheckerPlugin()); - config.addPlugin(new EventExclusionPlugin()); - config.addPlugin(new ModuleInfoPlugin()); - config.addPlugin(new RequestInfoPlugin()); - config.addPlugin(new EnvironmentInfoPlugin()); - config.addPlugin(new SubmissionMethodPlugin()); - } -} diff --git a/src/plugins/IEventPlugin.ts b/src/plugins/IEventPlugin.ts deleted file mode 100644 index 6759d0c6..00000000 --- a/src/plugins/IEventPlugin.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { EventPluginContext } from './EventPluginContext'; -import { IEventPlugin } from './IEventPlugin'; - -export interface IEventPlugin { - priority?: number; - name?: string; - run(context: EventPluginContext, next?: () => void): void; -} diff --git a/src/plugins/default/ConfigurationDefaultsPlugin.ts b/src/plugins/default/ConfigurationDefaultsPlugin.ts deleted file mode 100644 index 7cd47f60..00000000 --- a/src/plugins/default/ConfigurationDefaultsPlugin.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Utils } from '../../Utils'; -import { EventPluginContext } from '../EventPluginContext'; -import { IEventPlugin } from '../IEventPlugin'; - -export class ConfigurationDefaultsPlugin implements IEventPlugin { - public priority: number = 10; - public name: string = 'ConfigurationDefaultsPlugin'; - - public run(context: EventPluginContext, next?: () => void): void { - const config = context.client.config; - const defaultTags: string[] = config.defaultTags || []; - for (const tag of defaultTags) { - if (!!tag && context.event.tags.indexOf(tag) < 0) { - context.event.tags.push(tag); - } - } - - // tslint:disable-next-line:ban-types - const defaultData: Object = config.defaultData || {}; - for (const key in defaultData) { - if (!!defaultData[key]) { - const result = JSON.parse(Utils.stringify(defaultData[key], config.dataExclusions)); - if (!Utils.isEmpty(result)) { - context.event.data[key] = result; - } - } - } - - next && next(); - } -} diff --git a/src/plugins/default/DuplicateCheckerPlugin-spec.ts b/src/plugins/default/DuplicateCheckerPlugin-spec.ts deleted file mode 100644 index f2db0666..00000000 --- a/src/plugins/default/DuplicateCheckerPlugin-spec.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { expect } from 'chai'; -import { ExceptionlessClient } from '../../ExceptionlessClient'; -import { EventPluginContext } from '../EventPluginContext'; -import { DuplicateCheckerPlugin } from './DuplicateCheckerPlugin'; - -describe('DuplicateCheckerPlugin', () => { - let now: number = 0; - let client: ExceptionlessClient; - let plugin: DuplicateCheckerPlugin; - - beforeEach(() => { - client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000'); - plugin = new DuplicateCheckerPlugin(() => now, 50); - }); - - function run(exception: Error) { - const errorParser = client.config.errorParser; - const context = new EventPluginContext(client, { type: 'error', data: {} }); - context.event.data['@error'] = errorParser.parse(context, exception); - - plugin.run(context); - - return context; - } - - it('should ignore duplicate within window', (done) => { - const exception = createException(); - run(exception); - - const contextOfSecondRun = run(exception); - expect(contextOfSecondRun.cancelled).to.be.true; - setTimeout(() => { - - expect(contextOfSecondRun.event.count).to.equal(1); - - done(); - }, 100); - - }); - - it('should ignore error without stack', () => { - const exception = new ReferenceError('This is a test'); - delete exception.stack; - - run(exception); - const contextOfSecondRun = run(exception); - expect(contextOfSecondRun.cancelled).to.be.true; - }); - - it('shouldn\'t ignore different stack within window', () => { - const exception1 = createException(); - run(exception1); - const exception2 = createException2(); - const contextOfSecondRun = run(exception2); - - expect(contextOfSecondRun.cancelled).not.to.be.true; - }); - - it('shouldn\'t ignore duplicate after window', () => { - const exception = createException(); - run(exception); - - now = 3000; - const contextOfSecondRun = run(exception); - expect(contextOfSecondRun.cancelled).not.to.be.true; - }); -}); - -function createException() { - function throwError() { - throw new ReferenceError('This is a test'); - } - try { - throwError(); - } catch (e) { - return e; - } -} - -function createException2() { - function throwError2() { - throw new ReferenceError('This is a test'); - } - try { - throwError2(); - } catch (e) { - return e; - } -} diff --git a/src/plugins/default/DuplicateCheckerPlugin.ts b/src/plugins/default/DuplicateCheckerPlugin.ts deleted file mode 100644 index 1f19b43d..00000000 --- a/src/plugins/default/DuplicateCheckerPlugin.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { IInnerError } from '../../models/IInnerError'; -import { Utils } from '../../Utils'; -import { EventPluginContext } from '../EventPluginContext'; -import { IEventPlugin } from '../IEventPlugin'; - -export class DuplicateCheckerPlugin implements IEventPlugin { - public priority: number = 1010; - public name: string = 'DuplicateCheckerPlugin'; - - private _mergedEvents: MergedEvent[] = []; - private _processedHashcodes: TimestampedHash[] = []; - private _getCurrentTime: () => number; - private _interval: number; - - constructor(getCurrentTime: () => number = () => Date.now(), interval: number = 30000) { - this._getCurrentTime = getCurrentTime; - this._interval = interval; - - setInterval(() => { - while (this._mergedEvents.length > 0) { - this._mergedEvents.shift().resubmit(); - } - }, interval); - } - - public run(context: EventPluginContext, next?: () => void): void { - function getHashCode(error: IInnerError): number { - let hashCode = 0; - while (error) { - if (error.message && error.message.length) { - hashCode += (hashCode * 397) ^ Utils.getHashCode(error.message); - } - if (error.stack_trace && error.stack_trace.length) { - hashCode += (hashCode * 397) ^ Utils.getHashCode(JSON.stringify(error.stack_trace)); - } - error = error.inner; - } - - return hashCode; - } - - const error = context.event.data['@error']; - const hashCode = getHashCode(error); - if (hashCode) { - const count = context.event.count || 1; - const now = this._getCurrentTime(); - - const merged = this._mergedEvents.filter((s) => s.hashCode === hashCode)[0]; - if (merged) { - merged.incrementCount(count); - merged.updateDate(context.event.date); - context.log.info('Ignoring duplicate event with hash: ' + hashCode); - context.cancelled = true; - } - - if (!context.cancelled && this._processedHashcodes.some((h) => h.hash === hashCode && h.timestamp >= (now - this._interval))) { - context.log.trace('Adding event with hash: ' + hashCode); - this._mergedEvents.push(new MergedEvent(hashCode, context, count)); - context.cancelled = true; - } - - if (!context.cancelled) { - context.log.trace('Enqueueing event with hash: ' + hashCode + 'to cache.'); - this._processedHashcodes.push({ hash: hashCode, timestamp: now }); - - // Only keep the last 50 recent errors. - while (this._processedHashcodes.length > 50) { - this._processedHashcodes.shift(); - } - } - } - - next && next(); - } -} - -interface TimestampedHash { - hash: number; - timestamp: number; -} - -class MergedEvent { - public hashCode: number; - private _count: number; - private _context: EventPluginContext; - - constructor(hashCode: number, context: EventPluginContext, count: number) { - this.hashCode = hashCode; - this._context = context; - this._count = count; - } - - public incrementCount(count: number) { - this._count += count; - } - - public resubmit() { - this._context.event.count = this._count; - this._context.client.config.queue.enqueue(this._context.event); - } - - public updateDate(date) { - if (date > this._context.event.date) { - this._context.event.date = date; - } - } -} diff --git a/src/plugins/default/EnvironmentInfoPlugin.ts b/src/plugins/default/EnvironmentInfoPlugin.ts deleted file mode 100644 index 484ef836..00000000 --- a/src/plugins/default/EnvironmentInfoPlugin.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { IEnvironmentInfo } from '../../models/IEnvironmentInfo'; -import { EventPluginContext } from '../EventPluginContext'; -import { IEventPlugin } from '../IEventPlugin'; - -export class EnvironmentInfoPlugin implements IEventPlugin { - public priority: number = 80; - public name: string = 'EnvironmentInfoPlugin'; - - public run(context: EventPluginContext, next?: () => void): void { - const ENVIRONMENT_KEY: string = '@environment'; // optimization for minifier. - - const collector = context.client.config.environmentInfoCollector; - if (!context.event.data[ENVIRONMENT_KEY] && collector) { - const environmentInfo: IEnvironmentInfo = collector.getEnvironmentInfo(context); - if (!!environmentInfo) { - context.event.data[ENVIRONMENT_KEY] = environmentInfo; - } - } - - next && next(); - } -} diff --git a/src/plugins/default/ErrorPlugin-spec-exceptions.ts b/src/plugins/default/ErrorPlugin-spec-exceptions.ts deleted file mode 100644 index 3fde3dc7..00000000 --- a/src/plugins/default/ErrorPlugin-spec-exceptions.ts +++ /dev/null @@ -1,301 +0,0 @@ -export let CapturedExceptions: any = {}; - -CapturedExceptions.OPERA_854 = { - 'message': 'Statement on line 44: Type mismatch (usually a non-object value used where an object is required)\n' + - 'Backtrace:\n' + - ' Line 44 of linked script http://path/to/file.js\n' + - ' this.undef();\n' + - ' Line 31 of linked script http://path/to/file.js\n' + - ' ex = ex || this.createException();\n' + - ' Line 18 of linked script http://path/to/file.js\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - ' Line 4 of inline#1 script in http://path/to/file.js\n' + - ' printTrace(printStackTrace());\n' + - ' Line 7 of inline#1 script in http://path/to/file.js\n' + - ' bar(n - 1);\n' + - ' Line 11 of inline#1 script in http://path/to/file.js\n' + - ' bar(2);\n' + - ' Line 15 of inline#1 script in http://path/to/file.js\n' + - ' foo();\n' + - '', - 'opera#sourceloc': 44 -}; - -CapturedExceptions.OPERA_902 = { - 'message': 'Statement on line 44: Type mismatch (usually a non-object value used where an object is required)\n' + - 'Backtrace:\n' + - ' Line 44 of linked script http://path/to/file.js\n' + - ' this.undef();\n' + - ' Line 31 of linked script http://path/to/file.js\n' + - ' ex = ex || this.createException();\n' + - ' Line 18 of linked script http://path/to/file.js\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - ' Line 4 of inline#1 script in http://path/to/file.js\n' + - ' printTrace(printStackTrace());\n' + - ' Line 7 of inline#1 script in http://path/to/file.js\n' + - ' bar(n - 1);\n' + - ' Line 11 of inline#1 script in http://path/to/file.js\n' + - ' bar(2);\n' + - ' Line 15 of inline#1 script in http://path/to/file.js\n' + - ' foo();\n' + - '', - 'opera#sourceloc': 44 -}; - -CapturedExceptions.OPERA_927 = { - 'message': 'Statement on line 43: Type mismatch (usually a non-object value used where an object is required)\n' + - 'Backtrace:\n' + - ' Line 43 of linked script http://path/to/file.js\n' + - ' bar(n - 1);\n' + - ' Line 31 of linked script http://path/to/file.js\n' + - ' bar(2);\n' + - ' Line 18 of linked script http://path/to/file.js\n' + - ' foo();\n' + - '', - 'opera#sourceloc': 43 -}; - -CapturedExceptions.OPERA_964 = { - 'message': 'Statement on line 42: Type mismatch (usually non-object value supplied where object required)\n' + - 'Backtrace:\n' + - ' Line 42 of linked script http://path/to/file.js\n' + - ' this.undef();\n' + - ' Line 27 of linked script http://path/to/file.js\n' + - ' ex = ex || this.createException();\n' + - ' Line 18 of linked script http://path/to/file.js: In function printStackTrace\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - ' Line 4 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' printTrace(printStackTrace());\n' + - ' Line 7 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' bar(n - 1);\n' + - ' Line 11 of inline#1 script in http://path/to/file.js: In function foo\n' + - ' bar(2);\n' + - ' Line 15 of inline#1 script in http://path/to/file.js\n' + - ' foo();\n' + - '', - 'opera#sourceloc': 42, - 'stacktrace': ' ... Line 27 of linked script http://path/to/file.js\n' + - ' ex = ex || this.createException();\n' + - ' Line 18 of linked script http://path/to/file.js: In function printStackTrace\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - ' Line 4 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' printTrace(printStackTrace());\n' + - ' Line 7 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' bar(n - 1);\n' + - ' Line 11 of inline#1 script in http://path/to/file.js: In function foo\n' + - ' bar(2);\n' + - ' Line 15 of inline#1 script in http://path/to/file.js\n' + - ' foo();\n' + - '' -}; - -CapturedExceptions.OPERA_10 = { - 'message': 'Statement on line 42: Type mismatch (usually non-object value supplied where object required)', - 'opera#sourceloc': 42, - 'stacktrace': ' Line 42 of linked script http://path/to/file.js\n' + - ' this.undef();\n' + - ' Line 27 of linked script http://path/to/file.js\n' + - ' ex = ex || this.createException();\n' + - ' Line 18 of linked script http://path/to/file.js: In function printStackTrace\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - ' Line 4 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' printTrace(printStackTrace());\n' + - ' Line 7 of inline#1 script in http://path/to/file.js: In function bar\n' + - ' bar(n - 1);\n' + - ' Line 11 of inline#1 script in http://path/to/file.js: In function foo\n' + - ' bar(2);\n' + - ' Line 15 of inline#1 script in http://path/to/file.js\n' + - ' foo();\n' + - '' -}; - -CapturedExceptions.OPERA_11 = { - message: '\'this.undef\' is not a function', - stack: '([arguments not available])@http://path/to/file.js:27\n' + - 'bar([arguments not available])@http://domain.com:1234/path/to/file.js:18\n' + - 'foo([arguments not available])@http://domain.com:1234/path/to/file.js:11\n' + - '@http://path/to/file.js:15\n' + - 'Error created at @http://path/to/file.js:15', - stacktrace: 'Error thrown at line 42, column 12 in () in http://path/to/file.js:\n' + - ' this.undef();\n' + - 'called from line 27, column 8 in (ex) in http://path/to/file.js:\n' + - ' ex = ex || this.createException();\n' + - 'called from line 18, column 4 in printStackTrace(options) in http://path/to/file.js:\n' + - ' CapturedExceptions.p = new printStackTrace.implementation(), result = p.run(ex);\n' + - 'called from line 4, column 5 in bar(n) in http://path/to/file.js:\n' + - ' printTrace(printStackTrace());\n' + - 'called from line 7, column 4 in bar(n) in http://path/to/file.js:\n' + - ' bar(n - 1);\n' + - 'called from line 11, column 4 in foo() in http://path/to/file.js:\n' + - ' bar(2);\n' + - 'called from line 15, column 3 in http://path/to/file.js:\n' + - ' foo();' -}; - -CapturedExceptions.OPERA_12 = { - message: 'Cannot convert \'x\' to object', - stack: '([arguments not available])@http://localhost:8000/ExceptionLab.html:48\n' + - 'dumpException3([arguments not available])@http://localhost:8000/ExceptionLab.html:46\n' + - '([arguments not available])@http://localhost:8000/ExceptionLab.html:1', - stacktrace: 'Error thrown at line 48, column 12 in (x) in http://localhost:8000/ExceptionLab.html:\n' + - ' x.undef();\n' + - 'called from line 46, column 8 in dumpException3() in http://localhost:8000/ExceptionLab.html:\n' + - ' dumpException((function(x) {\n' + - 'called from line 1, column 0 in (event) in http://localhost:8000/ExceptionLab.html:\n' + - ' dumpException3();' -}; - -CapturedExceptions.OPERA_25 = { - message: 'Cannot read property \'undef\' of null', - name: 'TypeError', - stack: 'TypeError: Cannot read property \'undef\' of null\n' + - ' at http://path/to/file.js:47:22\n' + - ' at foo (http://path/to/file.js:52:15)\n' + - ' at bar (http://path/to/file.js:108:168)' -}; - -CapturedExceptions.CHROME_15 = { - arguments: ['undef'], - message: 'Object # has no method \'undef\'', - stack: 'TypeError: Object # has no method \'undef\'\n' + - ' at bar (http://path/to/file.js:13:17)\n' + - ' at bar (http://path/to/file.js:16:5)\n' + - ' at foo (http://path/to/file.js:20:5)\n' + - ' at http://path/to/file.js:24:4' -}; - -CapturedExceptions.CHROME_36 = { - message: 'Default error', - name: 'Error', - stack: 'Error: Default error\n' + - ' at dumpExceptionError (http://localhost:8080/file.js:41:27)\n' + - ' at HTMLButtonElement.onclick (http://localhost:8080/file.js:107:146)' -}; - -CapturedExceptions.FIREFOX_3 = { - fileName: 'http://127.0.0.1:8000/js/stacktrace.js', - lineNumber: 44, - message: 'this.undef is not a function', - name: 'TypeError', - stack: '()@http://127.0.0.1:8000/js/stacktrace.js:44\n' + - '(null)@http://127.0.0.1:8000/js/stacktrace.js:31\n' + - 'printStackTrace()@http://127.0.0.1:8000/js/stacktrace.js:18\n' + - 'bar(1)@http://127.0.0.1:8000/js/file.js:13\n' + - 'bar(2)@http://127.0.0.1:8000/js/file.js:16\n' + - 'foo()@http://127.0.0.1:8000/js/file.js:20\n' + - '@http://127.0.0.1:8000/js/file.js:24\n' + - '' -}; - -CapturedExceptions.FIREFOX_7 = { - fileName: 'file:///G:/js/stacktrace.js', - lineNumber: 44, - stack: '()@file:///G:/js/stacktrace.js:44\n' + - '(null)@file:///G:/js/stacktrace.js:31\n' + - 'printStackTrace()@file:///G:/js/stacktrace.js:18\n' + - 'bar(1)@file:///G:/js/file.js:13\n' + - 'bar(2)@file:///G:/js/file.js:16\n' + - 'foo()@file:///G:/js/file.js:20\n' + - '@file:///G:/js/file.js:24\n' + - '' -}; - -CapturedExceptions.FIREFOX_14 = { - message: 'x is null', - stack: '@http://path/to/file.js:48\n' + - 'dumpException3@http://path/to/file.js:52\n' + - 'onclick@http://path/to/file.js:1\n' + - '', - fileName: 'http://path/to/file.js', - lineNumber: 48 -}; - -CapturedExceptions.FIREFOX_31 = { - message: 'Default error', - name: 'Error', - stack: 'foo@http://path/to/file.js:41:13\n' + - 'bar@http://path/to/file.js:1:1\n' + - '', - fileName: 'http://path/to/file.js', - lineNumber: 41, - columnNumber: 12 -}; - -CapturedExceptions.SAFARI_6 = { - message: '\'null\' is not an object (evaluating \'x.undef\')', - stack: '@http://path/to/file.js:48\n' + - 'dumpException3@http://path/to/file.js:52\n' + - 'onclick@http://path/to/file.js:82\n' + - '[native code]', - line: 48, - sourceURL: 'http://path/to/file.js' -}; - -CapturedExceptions.SAFARI_7 = { - message: '\'null\' is not an object (evaluating \'x.undef\')', - name: 'TypeError', - stack: 'http://path/to/file.js:48:22\n' + - 'foo@http://path/to/file.js:52:15\n' + - 'bar@http://path/to/file.js:108:107', - line: 47, - sourceURL: 'http://path/to/file.js' -}; - -CapturedExceptions.SAFARI_8 = { - message: 'null is not an object (evaluating \'x.undef\')', - name: 'TypeError', - stack: 'http://path/to/file.js:47:22\n' + - 'foo@http://path/to/file.js:52:15\n' + - 'bar@http://path/to/file.js:108:23', - line: 47, - column: 22, - sourceURL: 'http://path/to/file.js' -}; - -CapturedExceptions.SAFARI_8_EVAL = { - message: 'Can\'t find variable: getExceptionProps', - name: 'ReferenceError', - stack: 'eval code\n' + - 'eval@[native code]\n' + - 'foo@http://path/to/file.js:58:21\n' + - 'bar@http://path/to/file.js:109:91', - line: 1, - column: 18 -}; - -CapturedExceptions.IE_9 = { - message: 'Unable to get property \'undef\' of undefined or null reference', - description: 'Unable to get property \'undef\' of undefined or null reference' -}; - -CapturedExceptions.IE_10 = { - message: 'Unable to get property \'undef\' of undefined or null reference', - stack: 'TypeError: Unable to get property \'undef\' of undefined or null reference\n' + - ' at Anonymous function (http://path/to/file.js:48:13)\n' + - ' at foo (http://path/to/file.js:46:9)\n' + - ' at bar (http://path/to/file.js:82:1)', - description: 'Unable to get property \'undef\' of undefined or null reference', - number: -2146823281 -}; - -CapturedExceptions.IE_11 = { - message: 'Unable to get property \'undef\' of undefined or null reference', - name: 'TypeError', - stack: 'TypeError: Unable to get property \'undef\' of undefined or null reference\n' + - ' at Anonymous function (http://path/to/file.js:47:21)\n' + - ' at foo (http://path/to/file.js:45:13)\n' + - ' at bar (http://path/to/file.js:108:1)', - description: 'Unable to get property \'undef\' of undefined or null reference', - number: -2146823281 -}; - -CapturedExceptions.IE_11_EVAL = { - message: '\'getExceptionProps\' is undefined', - name: 'ReferenceError', - stack: 'ReferenceError: \'getExceptionProps\' is undefined\n' + - ' at eval code (eval code:1:1)\n' + - ' at foo (http://path/to/file.js:58:17)\n' + - ' at bar (http://path/to/file.js:109:1)', - description: '\'getExceptionProps\' is undefined', - number: -2146823279 -}; diff --git a/src/plugins/default/ErrorPlugin-spec.ts b/src/plugins/default/ErrorPlugin-spec.ts deleted file mode 100644 index 0d41e55c..00000000 --- a/src/plugins/default/ErrorPlugin-spec.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { IEvent } from '../../models/IEvent'; -import { ContextData } from '../ContextData'; -import { EventPluginContext } from '../EventPluginContext'; - -import { expect } from 'chai'; -import { ErrorPlugin } from './ErrorPlugin'; -import { CapturedExceptions } from './ErrorPlugin-spec-exceptions'; -import { createFixture } from './EventPluginTestFixture'; - -function BaseTestError() { - this.name = 'NotImplementedError'; - this.someProperty = 'Test'; -} - -BaseTestError.prototype = new Error(); - -function DerivedTestError() { - this.someOtherProperty = 'Test2'; -} - -DerivedTestError.prototype = new BaseTestError(); - -describe('ErrorPlugin', () => { - const target = new ErrorPlugin(); - let contextData: ContextData; - let context: EventPluginContext; - let client: any; - let event: IEvent; - - beforeEach(() => { - ({ - contextData, - context, - client, - event - } = createFixture()); - }); - - function processError(error) { - const exception = throwAndCatch(error); - contextData.setException(exception); - target.run(context); - } - - describe('additional data', () => { - describeForCapturedExceptions((exception) => { - it('should ignore default error properties', () => { - contextData.setException(exception); - target.run(context); - const additionalData = getAdditionalData(event); - expect(additionalData).to.be.null; - }); - - }); - - it('should add custom properties to additional data', () => { - const error = { - someProperty: 'Test' - }; - processError(error); - const additionalData = getAdditionalData(event); - expect(additionalData).not.to.be.null; - expect(additionalData.someProperty).to.equal('Test'); - }); - - it('should support custom exception types', () => { - processError(new BaseTestError()); - const additionalData = getAdditionalData(event); - expect(additionalData).not.to.be.null; - expect(additionalData.someProperty).to.equal('Test'); - }); - - it('should support inherited properties', () => { - processError(new DerivedTestError()); - const additionalData = getAdditionalData(event); - expect(additionalData).not.to.be.null; - expect(additionalData.someProperty).to.equal('Test'); - expect(additionalData.someOtherProperty).to.equal('Test2'); - }); - - it('shouldn\'t set empty additional data', () => { - processError({}); - const additionalData = getAdditionalData(event); - expect(additionalData).to.be.null; - }); - - it('should ignore functions', () => { - const exception: any = new Error('Error with function'); - exception.someFunction = () => { }; - contextData.setException(exception); - - target.run(context); - - const additionalData = getAdditionalData(event); - expect(additionalData).to.be.null; - }); - }); -}); - -function describeForCapturedExceptions(specDefinitions: (exception: any) => void) { - const keys = Object.getOwnPropertyNames(CapturedExceptions); - keys.forEach((key) => { - const exception = CapturedExceptions[key]; - describe(key, () => { specDefinitions(exception); }); - }); -} - -function getError(event: IEvent) { - if (event && event.data && event.data['@error']) { - return event.data['@error']; - } - return null; -} - -function getAdditionalData(event: IEvent) { - const error = getError(event); - if (error && error.data && error.data['@ext']) { - return error.data['@ext']; - } - return null; -} - -function throwAndCatch(error: any): Error { - try { - throw error; - } catch (exception) { - return exception; - } -} diff --git a/src/plugins/default/ErrorPlugin.ts b/src/plugins/default/ErrorPlugin.ts deleted file mode 100644 index 1eaff290..00000000 --- a/src/plugins/default/ErrorPlugin.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Utils } from '../../Utils'; -import { EventPluginContext } from '../EventPluginContext'; -import { IEventPlugin } from '../IEventPlugin'; - -export class ErrorPlugin implements IEventPlugin { - public priority: number = 30; - public name: string = 'ErrorPlugin'; - - public run(context: EventPluginContext, next?: () => void): void { - const ERROR_KEY: string = '@error'; // optimization for minifier. - const ignoredProperties: string[] = [ - 'arguments', - 'column', - 'columnNumber', - 'description', - 'fileName', - 'message', - 'name', - 'number', - 'line', - 'lineNumber', - 'opera#sourceloc', - 'sourceId', - 'sourceURL', - 'stack', - 'stackArray', - 'stacktrace' - ]; - - const exception = context.contextData.getException(); - if (!!exception) { - context.event.type = 'error'; - - if (!context.event.data[ERROR_KEY]) { - const config = context.client.config; - const parser = config.errorParser; - if (!parser) { - throw new Error('No error parser was defined.'); - } - - const result = parser.parse(context, exception); - if (!!result) { - const additionalData = JSON.parse(Utils.stringify(exception, config.dataExclusions.concat(ignoredProperties))); - if (!Utils.isEmpty(additionalData)) { - if (!result.data) { - result.data = {}; - } - result.data['@ext'] = additionalData; - } - - context.event.data[ERROR_KEY] = result; - } - } - } - - next && next(); - } -} diff --git a/src/plugins/default/EventExclusionPlugin-spec.ts b/src/plugins/default/EventExclusionPlugin-spec.ts deleted file mode 100644 index e31e9a25..00000000 --- a/src/plugins/default/EventExclusionPlugin-spec.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { expect } from 'chai'; -import { ExceptionlessClient } from '../../ExceptionlessClient'; -import { IEvent } from '../../models/IEvent'; -import { DefaultErrorParser } from '../../services/DefaultErrorParser'; -import { EventPluginContext } from '../EventPluginContext'; -import { EventExclusionPlugin } from './EventExclusionPlugin'; - -describe('EventExclusionPlugin', () => { - describe('should exclude log levels', () => { - function run(source: string, level: string, settingKey: string, settingValue: string): boolean { - const client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000'); - if (settingKey) { - client.config.settings[settingKey] = settingValue; - } - - const ev: IEvent = { type: 'log', source, data: {} }; - if (level) { - ev.data['@level'] = level; - } - - const context = new EventPluginContext(client, ev); - const plugin = new EventExclusionPlugin(); - plugin.run(context); - - return !!context.cancelled; - } - - it('', () => expect(run(null, null, null, null)).to.be.false); - it('Test', () => expect(run('Test', null, null, null)).to.be.false); - it('[Trace] Test', () => expect(run('Test', 'Trace', null, null)).to.be.false); - it('[Off] Test', () => expect(run('Test', 'Off', null, null)).to.be.true); - it('[Abc] Test', () => expect(run('Test', 'Abc', null, null)).to.be.false); - it('[Off] Test', () => expect(run('Test', 'Off', null, null)).to.be.true); - it('[Trace] Test (source min level: false)', () => expect(run('Test', 'Trace', '@@log:Test', 'false')).to.be.true); - it('[Trace] Test (source min level: no)', () => expect(run('Test', 'Trace', '@@log:Test', 'no')).to.be.true); - it('[Trace] Test (source min level: 0)', () => expect(run('Test', 'Trace', '@@log:Test', '0')).to.be.true); - it('[Trace] Test (source min level: true)', () => expect(run('Test', 'Trace', '@@log:Test', 'true')).to.be.false); - it('[Trace] Test (source min level: yes)', () => expect(run('Test', 'Trace', '@@log:Test', 'yes')).to.be.false); - it('[Trace] Test (source min level: 1)', () => expect(run('Test', 'Trace', '@@log:Test', '1')).to.be.false); - it('[Trace] Test (source min level: Debug)', () => expect(run('Test', 'Trace', '@@log:Test', 'Debug')).to.be.true); - it('[Info] Test (source min level: Debug)', () => expect(run('Test', 'Info', '@@log:Test', 'Debug')).to.be.false); - it('[Trace] Test (global min level: Debug)', () => expect(run('Test', 'Trace', '@@log:*', 'Debug')).to.be.true); - it('[Warn] Test (global min level: Debug)', () => expect(run('Test', 'Warn', '@@log:*', 'Debug')).to.be.false); - }); - - describe('should exclude log levels with info default:', () => { - function run(source: string, level: string, settingKey: string, settingValue: string): boolean { - const client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000'); - client.config.settings['@@log:*'] = 'Info'; - if (settingKey) { - client.config.settings[settingKey] = settingValue; - } - - const ev: IEvent = { type: 'log', source, data: {} }; - if (level) { - ev.data['@level'] = level; - } - - const context = new EventPluginContext(client, ev); - const plugin = new EventExclusionPlugin(); - plugin.run(context); - - return !!context.cancelled; - } - - it('', () => expect(run(null, null, null, null)).to.be.false); - it('Test', () => expect(run('Test', null, null, null)).to.be.false); - it('[Trace] Test', () => expect(run('Test', 'Trace', null, null)).to.be.true); - it('[Warn] Test', () => expect(run('Test', 'Warn', null, null)).to.be.false); - it('[Error] Test (source min level: Debug)', () => expect(run('Test', 'Error', '@@log:Test', 'Debug')).to.be.false); - it('[Debug] Test (source min level: Debug)', () => expect(run('Test', 'Debug', '@@log:Test', 'Debug')).to.be.false); - }); - - describe('should exclude source type', () => { - function run(type: string, source: string, settingKey: string, settingValue: string|boolean): boolean { - const client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000'); - if (settingKey) { - client.config.settings[settingKey] = settingValue; - } - - const context = new EventPluginContext(client, { type, source, data: {} }); - const plugin = new EventExclusionPlugin(); - plugin.run(context); - - return !!context.cancelled; - } - - it('', () => expect(run(null, null, null, null)).to.be.false); - it('', () => expect(run('usage', null, null, null)).to.be.false); - it('', () => expect(run('usage', 'test', null, null)).to.be.false); - it('', () => expect(run('usage', 'test', '@@usage:Test', true)).to.be.false); - it('', () => expect(run('usage', 'test', '@@usage:Test', false)).to.be.true); - it('', () => expect(run('usage', 'test', '@@usage:*', false)).to.be.true); - it('', () => expect(run('404', '/unknown', '@@404:*', false)).to.be.true); - it('', () => expect(run('404', '/unknown', '@@404:/unknown', false)).to.be.true); - it('', () => expect(run('404', '/unknown', '@@404:/unknown', true)).to.be.false); - }); - - describe('should exclude exception type:', () => { - function createException() { - function throwError() { - throw new ReferenceError('This is a test'); - } - - try { - throwError(); - } catch (e) { - return e; - } - } - - function run(settingKey: string): boolean { - const client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000'); - if (settingKey) { - client.config.settings[settingKey] = false; - } - - const errorParser = new DefaultErrorParser(); - const context = new EventPluginContext(client, { type: 'error', data: { } }); - context.event.data['@error'] = errorParser.parse(context, createException()); - - const plugin = new EventExclusionPlugin(); - plugin.run(context); - - return !!context.cancelled; - } - - it('', () => expect(run(null)).to.be.false); - it('@@error:Error', () => expect(run('@@error:Error')).to.be.false); - it('@@error:ReferenceError', () => expect(run('@@error:ReferenceError')).to.be.true); - it('@@error:*Error', () => expect(run('@@error:*Error')).to.be.true); - it('@@error:*', () => expect(run('@@error:*')).to.be.true); - }); -}); diff --git a/src/plugins/default/EventExclusionPlugin.ts b/src/plugins/default/EventExclusionPlugin.ts deleted file mode 100644 index 837d6a0a..00000000 --- a/src/plugins/default/EventExclusionPlugin.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { IInnerError } from '../../models/IInnerError'; -import { Utils } from '../../Utils'; -import { EventPluginContext } from '../EventPluginContext'; -import { IEventPlugin } from '../IEventPlugin'; - -export class EventExclusionPlugin implements IEventPlugin { - public priority: number = 45; - public name: string = 'EventExclusionPlugin'; - - public run(context: EventPluginContext, next?: () => void): void { - function getLogLevel(level: string): number { - switch ((level || '').toLowerCase().trim()) { - case 'trace': - case 'true': - case '1': - case 'yes': - return 0; - case 'debug': - return 1; - case 'info': - return 2; - case 'warn': - return 3; - case 'error': - return 4; - case 'fatal': - return 5; - case 'off': - case 'false': - case '0': - case 'no': - return 6; - default: - return -1; - } - } - - function getMinLogLevel(settings: object, loggerName: string = '*'): number { - return getLogLevel(getTypeAndSourceSetting(settings, 'log', loggerName, 'Trace') + ''); - } - - // tslint:disable-next-line:ban-types - function getTypeAndSourceSetting(settings: Object = {}, type: string, source: string, defaultValue?: string|boolean): string|boolean { - if (!type) { - return defaultValue; - } - - const isLog = type === 'log'; - const sourcePrefix = `@@${type}:`; - - const value = settings[sourcePrefix + source]; - if (value) { - return !isLog ? Utils.toBoolean(value) : value; - } - - // check for wildcard match - for (const key in settings) { - if (Utils.startsWith(key.toLowerCase(), sourcePrefix.toLowerCase()) && Utils.isMatch(source, [key.substring(sourcePrefix.length)])) { - return !isLog ? Utils.toBoolean(settings[key]) : settings[key]; - } - } - - return defaultValue; - } - - const ev = context.event; - const log = context.log; - const settings = context.client.config.settings; - - if (ev.type === 'log') { - const minLogLevel = getMinLogLevel(settings, ev.source); - const logLevel = getLogLevel(ev.data['@level']); - - if (logLevel >= 0 && (logLevel > 5 || logLevel < minLogLevel)) { - log.info('Cancelling log event due to minimum log level.'); - context.cancelled = true; - } - } else if (ev.type === 'error') { - let error: IInnerError = ev.data['@error']; - while (!context.cancelled && error) { - if (getTypeAndSourceSetting(settings, ev.type, error.type, true) === false) { - log.info(`Cancelling error from excluded exception type: ${error.type}`); - context.cancelled = true; - } - - error = error.inner; - } - } else if (getTypeAndSourceSetting(settings, ev.type, ev.source, true) === false) { - log.info(`Cancelling event from excluded type: ${ev.type} and source: ${ev.source}`); - context.cancelled = true; - } - - next && next(); - } -} diff --git a/src/plugins/default/EventPluginTestFixture.ts b/src/plugins/default/EventPluginTestFixture.ts deleted file mode 100644 index d56fa595..00000000 --- a/src/plugins/default/EventPluginTestFixture.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { IEvent } from '../../models/IEvent'; -import { IErrorParser } from '../../services/IErrorParser'; -import { ContextData } from '../ContextData'; -import { EventPluginContext } from '../EventPluginContext'; - -// TODO: This should use the real object instances and inject the error parser. -export function createFixture() { - let contextData: ContextData; - let context: EventPluginContext; - let errorParser: IErrorParser; - let client: any; - let event: IEvent; - - errorParser = { - parse: (c: EventPluginContext, exception: Error) => ({ - type: exception.name, - message: exception.message, - stack_trace: ( exception as any).testStack || null - }) - }; - client = { - config: { - dataExclusions: [], - errorParser, - log: { - info: () => { } - } - } - }; - event = { - data: {} - }; - contextData = new ContextData(); - context = new EventPluginContext(client, event, contextData); - - return { - contextData, - context, - client, - event - }; -} diff --git a/src/plugins/default/HeartbeatPlugin.ts b/src/plugins/default/HeartbeatPlugin.ts deleted file mode 100644 index 730a1136..00000000 --- a/src/plugins/default/HeartbeatPlugin.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { IUserInfo } from '../../models/IUserInfo'; -import { EventPluginContext } from '../EventPluginContext'; -import { IEventPlugin } from '../IEventPlugin'; - -export class HeartbeatPlugin implements IEventPlugin { - public priority: number = 100; - public name: string = 'HeartbeatPlugin'; - - private _interval: number; - private _intervalId: any; - - constructor(heartbeatInterval: number = 30000) { - this._interval = heartbeatInterval; - } - - public run(context: EventPluginContext, next?: () => void): void { - clearInterval(this._intervalId); - - const user: IUserInfo = context.event.data['@user']; - if (user && user.identity) { - this._intervalId = setInterval(() => context.client.submitSessionHeartbeat(user.identity), this._interval); - } - - next && next(); - } -} diff --git a/src/plugins/default/ModuleInfoPlugin.ts b/src/plugins/default/ModuleInfoPlugin.ts deleted file mode 100644 index c163c847..00000000 --- a/src/plugins/default/ModuleInfoPlugin.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { IModule } from '../../models/IModule'; -import { EventPluginContext } from '../EventPluginContext'; -import { IEventPlugin } from '../IEventPlugin'; - -export class ModuleInfoPlugin implements IEventPlugin { - public priority: number = 50; - public name: string = 'ModuleInfoPlugin'; - - public run(context: EventPluginContext, next?: () => void): void { - const ERROR_KEY: string = '@error'; // optimization for minifier. - - const collector = context.client.config.moduleCollector; - if (context.event.data[ERROR_KEY] && !context.event.data['@error'].modules && !!collector) { - const modules: IModule[] = collector.getModules(context); - if (modules && modules.length > 0) { - context.event.data[ERROR_KEY].modules = modules; - } - } - - next && next(); - } -} diff --git a/src/plugins/default/ReferenceIdPlugin.ts b/src/plugins/default/ReferenceIdPlugin.ts deleted file mode 100644 index 7b2b6f42..00000000 --- a/src/plugins/default/ReferenceIdPlugin.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Utils } from '../../Utils'; -import { EventPluginContext } from '../EventPluginContext'; -import { IEventPlugin } from '../IEventPlugin'; - -export class ReferenceIdPlugin implements IEventPlugin { - public priority: number = 20; - public name: string = 'ReferenceIdPlugin'; - - public run(context: EventPluginContext, next?: () => void): void { - if ((!context.event.reference_id || context.event.reference_id.length === 0) && context.event.type === 'error') { - context.event.reference_id = Utils.guid().replace('-', '').substring(0, 10); - } - - next && next(); - } -} diff --git a/src/plugins/default/RequestInfoPlugin.ts b/src/plugins/default/RequestInfoPlugin.ts deleted file mode 100644 index f0ac0a9f..00000000 --- a/src/plugins/default/RequestInfoPlugin.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { IRequestInfo } from '../../models/IRequestInfo'; -import { Utils } from '../../Utils'; -import { EventPluginContext } from '../EventPluginContext'; -import { IEventPlugin } from '../IEventPlugin'; - -export class RequestInfoPlugin implements IEventPlugin { - public priority: number = 70; - public name: string = 'RequestInfoPlugin'; - - public run(context: EventPluginContext, next?: () => void): void { - const REQUEST_KEY: string = '@request'; // optimization for minifier. - - const config = context.client.config; - const collector = config.requestInfoCollector; - if (!context.event.data[REQUEST_KEY] && !!collector) { - const requestInfo: IRequestInfo = collector.getRequestInfo(context); - if (!!requestInfo) { - if (Utils.isMatch(requestInfo.user_agent, config.userAgentBotPatterns)) { - context.log.info('Cancelling event as the request user agent matches a known bot pattern'); - context.cancelled = true; - } else { - context.event.data[REQUEST_KEY] = requestInfo; - } - } - } - - next && next(); - } -} diff --git a/src/plugins/default/SubmissionMethodPlugin.ts b/src/plugins/default/SubmissionMethodPlugin.ts deleted file mode 100644 index cb00a4cc..00000000 --- a/src/plugins/default/SubmissionMethodPlugin.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { EventPluginContext } from '../EventPluginContext'; -import { IEventPlugin } from '../IEventPlugin'; - -export class SubmissionMethodPlugin implements IEventPlugin { - public priority: number = 100; - public name: string = 'SubmissionMethodPlugin'; - - public run(context: EventPluginContext, next?: () => void): void { - const submissionMethod: string = context.contextData.getSubmissionMethod(); - if (!!submissionMethod) { - context.event.data['@submission_method'] = submissionMethod; - } - - next && next(); - } -} diff --git a/src/queue/DefaultEventQueue-spec.ts b/src/queue/DefaultEventQueue-spec.ts deleted file mode 100644 index 952a0c37..00000000 --- a/src/queue/DefaultEventQueue-spec.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { expect } from 'chai'; -import * as sinon from 'sinon'; -import { Configuration } from '../configuration/Configuration'; -import { IEvent } from '../models/IEvent'; -import { SubmissionResponse } from '../submission/SubmissionResponse'; - -describe('DefaultEventQueue', () => { - - let config: Configuration; - let xhr: any; - - beforeEach(() => { - xhr = sinon.useFakeXMLHttpRequest(); - - config = getConfiguration(); - }); - - afterEach(() => { - const queue = config.queue as any; - clearInterval(queue._queueTimer); - config = null; - xhr.restore(); - }); - - function getConfiguration(): Configuration { - const result: Configuration = new Configuration({ - apiKey: 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', - serverUrl: 'http://localhost:50000' - }); - - expect(result.storage.queue.get().length).to.equal(0); - return result; - } - - it('should enqueue event', () => { - const event: IEvent = { type: 'log', reference_id: '123454321' }; - config.queue.enqueue(event); - expect(config.storage.queue.get().length).to.equal(1); - }); - - it('should process queue', () => { - const event: IEvent = { type: 'log', reference_id: '123454321' }; - config.queue.enqueue(event); - expect(config.storage.queue.get().length).to.equal(1); - config.queue.process(); - - config.queue.onEventsPosted((events: IEvent[], response: SubmissionResponse) => { - expect(( config.queue as any)._suspendProcessingUntil).to.be.undefined; - - expect(config.storage.queue.get().length).to.equal(0); - }); - }); - - it('should discard event submission', () => { - config.queue.suspendProcessing(1, true); - - const event: IEvent = { type: 'log', reference_id: '123454321' }; - config.queue.enqueue(event); - expect(config.storage.queue.get().length).to.equal(0); - }); - - it('should suspend processing', (done) => { - config.queue.suspendProcessing(.0001); - - const event: IEvent = { type: 'log', reference_id: '123454321' }; - config.queue.enqueue(event); - expect(config.storage.queue.get().length).to.equal(1); - - setTimeout(() => { - if (!( config.queue as any)._suspendProcessingUntil) { - expect(config.storage.queue.get().length).to.equal(0); - } else { - expect(config.storage.queue.get().length).to.equal(1); - } - - done(); - }); - }); -}); diff --git a/src/queue/DefaultEventQueue.ts b/src/queue/DefaultEventQueue.ts deleted file mode 100644 index 5271c65b..00000000 --- a/src/queue/DefaultEventQueue.ts +++ /dev/null @@ -1,250 +0,0 @@ -import { Configuration } from '../configuration/Configuration'; -import { ILog } from '../logging/ILog'; -import { IEvent } from '../models/IEvent'; -import { IEventQueue } from '../queue/IEventQueue'; -import { IStorageItem } from '../storage/IStorageItem'; -import { SubmissionResponse } from '../submission/SubmissionResponse'; - -export class DefaultEventQueue implements IEventQueue { - /** - * The configuration object. - * @type {Configuration} - * @private - */ - private _config: Configuration; - - /** - * A list of handlers that will be fired when events are submitted. - * @type {Array} - * @private - */ - private _handlers: Array<(events: IEvent[], response: SubmissionResponse) => void> = []; - - /** - * Suspends processing until the specified time. - * @type {Date} - * @private - */ - private _suspendProcessingUntil: Date; - - /** - * Discards queued items until the specified time. - * @type {Date} - * @private - */ - private _discardQueuedItemsUntil: Date; - - /** - * Returns true if the queue is processing. - * @type {boolean} - * @private - */ - private _processingQueue: boolean = false; - - /** - * Processes the queue every xx seconds. - * @type {Timer} - * @private - */ - private _queueTimer: any; - - constructor(config: Configuration) { - this._config = config; - } - - public enqueue(event: IEvent): void { - const eventWillNotBeQueued: string = 'The event will not be queued.'; // optimization for minifier. - const config: Configuration = this._config; // Optimization for minifier. - const log: ILog = config.log; // Optimization for minifier. - - if (!config.enabled) { - log.info(`Configuration is disabled. ${eventWillNotBeQueued}`); - return; - } - - if (!config.isValid) { - log.info(`Invalid Api Key. ${eventWillNotBeQueued}`); - return; - } - - if (this.areQueuedItemsDiscarded()) { - log.info(`Queue items are currently being discarded. ${eventWillNotBeQueued}`); - return; - } - - this.ensureQueueTimer(); - - const timestamp = config.storage.queue.save(event); - const logText = `type=${event.type} ${!!event.reference_id ? 'refid=' + event.reference_id : ''}`; - if (timestamp) { - log.info(`Enqueuing event: ${timestamp} ${logText}`); - } else { - log.error(`Could not enqueue event ${logText}`); - } - } - - public process(isAppExiting?: boolean): void { - const queueNotProcessed: string = 'The queue will not be processed.'; // optimization for minifier. - const config: Configuration = this._config; // Optimization for minifier. - const log: ILog = config.log; // Optimization for minifier. - - if (this._processingQueue) { - return; - } - - log.info('Processing queue...'); - if (!config.enabled) { - log.info(`Configuration is disabled. ${queueNotProcessed}`); - return; - } - - if (!config.isValid) { - log.info(`Invalid Api Key. ${queueNotProcessed}`); - return; - } - - this._processingQueue = true; - this.ensureQueueTimer(); - - try { - const events = config.storage.queue.get(config.submissionBatchSize); - if (!events || events.length === 0) { - this._processingQueue = false; - return; - } - - log.info(`Sending ${events.length} events to ${config.serverUrl}.`); - config.submissionClient.postEvents(events.map((e) => e.value), config, (response: SubmissionResponse) => { - this.processSubmissionResponse(response, events); - this.eventsPosted(events.map((e) => e.value), response); - log.info('Finished processing queue.'); - this._processingQueue = false; - }, isAppExiting); - } catch (ex) { - log.error(`Error processing queue: ${ex}`); - this.suspendProcessing(); - this._processingQueue = false; - } - } - - public suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void { - const config: Configuration = this._config; // Optimization for minifier. - - if (!durationInMinutes || durationInMinutes <= 0) { - durationInMinutes = 5; - } - - config.log.info(`Suspending processing for ${durationInMinutes} minutes.`); - this._suspendProcessingUntil = new Date(new Date().getTime() + (durationInMinutes * 60000)); - - if (discardFutureQueuedItems) { - this._discardQueuedItemsUntil = this._suspendProcessingUntil; - } - - if (clearQueue) { - // Account is over the limit and we want to ensure that the sample size being sent in will contain newer errors. - config.storage.queue.clear(); - } - } - - public onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void { - !!handler && this._handlers.push(handler); - } - - private eventsPosted(events: IEvent[], response: SubmissionResponse) { - const handlers = this._handlers; // optimization for minifier. - for (const handler of handlers) { - try { - handler(events, response); - } catch (ex) { - this._config.log.error(`Error calling onEventsPosted handler: ${ex}`); - } - } - } - - private areQueuedItemsDiscarded(): boolean { - return this._discardQueuedItemsUntil && this._discardQueuedItemsUntil > new Date(); - } - - private ensureQueueTimer(): void { - if (!this._queueTimer) { - this._queueTimer = setInterval(() => this.onProcessQueue(), 10000); - } - } - - private isQueueProcessingSuspended(): boolean { - return this._suspendProcessingUntil && this._suspendProcessingUntil > new Date(); - } - - private onProcessQueue(): void { - if (!this.isQueueProcessingSuspended() && !this._processingQueue) { - this.process(); - } - } - - private processSubmissionResponse(response: SubmissionResponse, events: IStorageItem[]): void { - const noSubmission: string = 'The event will not be submitted.'; // Optimization for minifier. - const config: Configuration = this._config; // Optimization for minifier. - const log: ILog = config.log; // Optimization for minifier. - - if (response.success) { - log.info(`Sent ${events.length} events.`); - this.removeEvents(events); - return; - } - - if (response.serviceUnavailable) { - // You are currently over your rate limit or the servers are under stress. - log.error('Server returned service unavailable.'); - this.suspendProcessing(); - return; - } - - if (response.paymentRequired) { - // If the organization over the rate limit then discard the event. - log.info('Too many events have been submitted, please upgrade your plan.'); - this.suspendProcessing(null, true, true); - return; - } - - if (response.unableToAuthenticate) { - // The api key was suspended or could not be authorized. - log.info(`Unable to authenticate, please check your configuration. ${noSubmission}`); - this.suspendProcessing(15); - this.removeEvents(events); - return; - } - - if (response.notFound || response.badRequest) { - // The service end point could not be found. - log.error(`Error while trying to submit data: ${response.message}`); - this.suspendProcessing(60 * 4); - this.removeEvents(events); - return; - } - - if (response.requestEntityTooLarge) { - const message = 'Event submission discarded for being too large.'; - if (config.submissionBatchSize > 1) { - log.error(`${message} Retrying with smaller batch size.`); - config.submissionBatchSize = Math.max(1, Math.round(config.submissionBatchSize / 1.5)); - } else { - log.error(`${message} ${noSubmission}`); - this.removeEvents(events); - } - - return; - } - - if (!response.success) { - log.error(`Error submitting events: ${response.message || 'Please check the network tab for more info.'}`); - this.suspendProcessing(); - } - } - - private removeEvents(events: IStorageItem[]) { - for (let index = 0; index < (events || []).length; index++) { - this._config.storage.queue.remove(events[index].timestamp); - } - } -} diff --git a/src/queue/IEventQueue.ts b/src/queue/IEventQueue.ts deleted file mode 100644 index ba929a96..00000000 --- a/src/queue/IEventQueue.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { IEvent } from '../models/IEvent'; -import { SubmissionResponse } from '../submission/SubmissionResponse'; - -export interface IEventQueue { - enqueue(event: IEvent): void; - process(isAppExiting?: boolean): void; - suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void; - onEventsPosted(handler: (events: IEvent[], response: SubmissionResponse) => void): void; -} diff --git a/src/services/DefaultErrorParser.ts b/src/services/DefaultErrorParser.ts deleted file mode 100644 index 69f8e36b..00000000 --- a/src/services/DefaultErrorParser.ts +++ /dev/null @@ -1,55 +0,0 @@ -import * as TraceKit from 'TraceKit'; -import { IError } from '../models/IError'; -import { IParameter } from '../models/IParameter'; -import { IStackFrame } from '../models/IStackFrame'; -import { EventPluginContext } from '../plugins/EventPluginContext'; -import { IErrorParser } from './IErrorParser'; - -export class DefaultErrorParser implements IErrorParser { - public parse(context: EventPluginContext, exception: Error): IError { - function getParameters(parameters: string | string[]): IParameter[] { - const params: string[] = (typeof parameters === 'string' ? [parameters] : parameters) || []; - - const result: IParameter[] = []; - for (const param of params) { - result.push({ name: param }); - } - - return result; - } - - function getStackFrames(stackFrames: TraceKit.StackFrame[]): IStackFrame[] { - const ANONYMOUS: string = ''; - const frames: IStackFrame[] = []; - - for (const frame of stackFrames) { - frames.push({ - name: (frame.func || ANONYMOUS).replace('?', ANONYMOUS), - parameters: getParameters(frame.args), - file_name: frame.url, - line_number: frame.line || 0, - column: frame.column || 0 - }); - } - - return frames; - } - - const TRACEKIT_STACK_TRACE_KEY: string = '@@_TraceKit.StackTrace'; // optimization for minifier. - - const stackTrace: TraceKit.StackTrace = !!context.contextData[TRACEKIT_STACK_TRACE_KEY] - ? context.contextData[TRACEKIT_STACK_TRACE_KEY] - : TraceKit.computeStackTrace(exception, 25); - - if (!stackTrace) { - throw new Error('Unable to parse the exceptions stack trace.'); - } - - const message = typeof(exception) === 'string' ? exception as any : undefined; - return { - type: stackTrace.name || 'Error', - message: stackTrace.message || exception.message || message, - stack_trace: getStackFrames(stackTrace.stack || []) - }; - } -} diff --git a/src/services/DefaultModuleCollector.ts b/src/services/DefaultModuleCollector.ts deleted file mode 100644 index 8eeafee5..00000000 --- a/src/services/DefaultModuleCollector.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { IModule } from '../models/IModule'; -import { EventPluginContext } from '../plugins/EventPluginContext'; -import { Utils } from '../Utils'; -import { IModuleCollector } from './IModuleCollector'; - -export class DefaultModuleCollector implements IModuleCollector { - public getModules(context: EventPluginContext): IModule[] { - if (!document || !document.getElementsByTagName) { - return null; - } - - const modules: IModule[] = []; - const scripts: NodeListOf = document.getElementsByTagName('script'); - if (scripts && scripts.length > 0) { - for (let index = 0; index < scripts.length; index++) { - if (scripts[index].src) { - modules.push({ - module_id: index, - name: scripts[index].src.split('?')[0], - version: Utils.parseVersion(scripts[index].src) - }); - } else if (!!scripts[index].innerHTML) { - modules.push({ - module_id: index, - name: 'Script Tag', - version: Utils.getHashCode(scripts[index].innerHTML).toString() - }); - } - } - } - - return modules; - } -} diff --git a/src/services/DefaultRequestInfoCollector.ts b/src/services/DefaultRequestInfoCollector.ts deleted file mode 100644 index afa45ad8..00000000 --- a/src/services/DefaultRequestInfoCollector.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { IRequestInfo } from '../models/IRequestInfo'; -import { EventPluginContext } from '../plugins/EventPluginContext'; -import { Utils } from '../Utils'; -import { IRequestInfoCollector } from './IRequestInfoCollector'; - -export class DefaultRequestInfoCollector implements IRequestInfoCollector { - public getRequestInfo(context: EventPluginContext): IRequestInfo { - if (!document || !navigator || !location) { - return null; - } - - const exclusions = context.client.config.dataExclusions; - const requestInfo: IRequestInfo = { - user_agent: navigator.userAgent, - is_secure: location.protocol === 'https:', - host: location.hostname, - port: location.port && location.port !== '' ? parseInt(location.port, 10) : 80, - path: location.pathname, - // client_ip_address: 'TODO', - cookies: Utils.getCookies(document.cookie, exclusions), - query_string: Utils.parseQueryString(location.search.substring(1), exclusions) - }; - - if (document.referrer && document.referrer !== '') { - requestInfo.referrer = document.referrer; - } - - return requestInfo; - } -} diff --git a/src/services/IEnvironmentInfoCollector.ts b/src/services/IEnvironmentInfoCollector.ts deleted file mode 100644 index 3991a2af..00000000 --- a/src/services/IEnvironmentInfoCollector.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IEnvironmentInfo } from '../models/IEnvironmentInfo'; -import { EventPluginContext } from '../plugins/EventPluginContext'; - -export interface IEnvironmentInfoCollector { - getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo; -} diff --git a/src/services/IErrorParser.ts b/src/services/IErrorParser.ts deleted file mode 100644 index 94a575a2..00000000 --- a/src/services/IErrorParser.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IError } from '../models/IError'; -import { EventPluginContext } from '../plugins/EventPluginContext'; - -export interface IErrorParser { - parse(context: EventPluginContext, exception: Error): IError; -} diff --git a/src/services/IModuleCollector.ts b/src/services/IModuleCollector.ts deleted file mode 100644 index 822d509c..00000000 --- a/src/services/IModuleCollector.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IModule } from '../models/IModule'; -import { EventPluginContext } from '../plugins/EventPluginContext'; - -export interface IModuleCollector { - getModules(context: EventPluginContext): IModule[]; -} diff --git a/src/services/IRequestInfoCollector.ts b/src/services/IRequestInfoCollector.ts deleted file mode 100644 index 595f9ef8..00000000 --- a/src/services/IRequestInfoCollector.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IRequestInfo } from '../models/IRequestInfo'; -import { EventPluginContext } from '../plugins/EventPluginContext'; - -export interface IRequestInfoCollector { - getRequestInfo(context: EventPluginContext): IRequestInfo; -} diff --git a/src/services/NodeEnvironmentInfoCollector.ts b/src/services/NodeEnvironmentInfoCollector.ts deleted file mode 100644 index a49880c3..00000000 --- a/src/services/NodeEnvironmentInfoCollector.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { IEnvironmentInfo } from '../models/IEnvironmentInfo'; -import { EventPluginContext } from '../plugins/EventPluginContext'; -import { IEnvironmentInfoCollector } from './IEnvironmentInfoCollector'; - -import os = require('os'); - -export class NodeEnvironmentInfoCollector implements IEnvironmentInfoCollector { - public getEnvironmentInfo(context: EventPluginContext): IEnvironmentInfo { - function getIpAddresses(): string { - const ips: string[] = []; - const interfaces = os.networkInterfaces(); - Object.keys(interfaces).forEach((name) => { - interfaces[name].forEach((iface: any) => { - if ('IPv4' === iface.family && !iface.internal) { - ips.push(iface.address); - } - }); - }); - - return ips.join(', '); - } - - if (!os) { - return null; - } - - const environmentInfo: IEnvironmentInfo = { - processor_count: os.cpus().length, - total_physical_memory: os.totalmem(), - available_physical_memory: os.freemem(), - command_line: process.argv.join(' '), - process_name: (process.title || '').replace(/[\uE000-\uF8FF]/g, ''), - process_id: process.pid + '', - process_memory_size: process.memoryUsage().heapTotal, - // thread_id: '', - architecture: os.arch(), - o_s_name: os.type(), - o_s_version: os.release(), - ip_address: getIpAddresses(), - machine_name: os.hostname(), - // install_id: '', - runtime_version: process.version, - data: { - loadavg: os.loadavg(), - platform: os.platform(), - tmpdir: os.tmpdir(), - uptime: os.uptime() - } - }; - - if ((os as any).endianness) { - environmentInfo.data.endianness = (os as any).endianness(); - } - - return environmentInfo; - } -} diff --git a/src/services/NodeErrorParser.ts b/src/services/NodeErrorParser.ts deleted file mode 100644 index 15177291..00000000 --- a/src/services/NodeErrorParser.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { IError } from '../models/IError'; -import { IStackFrame } from '../models/IStackFrame'; -import { EventPluginContext } from '../plugins/EventPluginContext'; -import { IErrorParser } from './IErrorParser'; - -import nodestacktrace = require('stack-trace'); - -export class NodeErrorParser implements IErrorParser { - public parse(context: EventPluginContext, exception: Error): IError { - function getStackFrames(stackFrames: any[]): IStackFrame[] { - const frames: IStackFrame[] = []; - - for (const frame of stackFrames) { - frames.push({ - name: frame.getMethodName() || frame.getFunctionName(), - // parameters: frame.args, - file_name: frame.getFileName(), - line_number: frame.getLineNumber() || 0, - column: frame.getColumnNumber() || 0, - declaring_type: frame.getTypeName(), - data: { - is_native: frame.isNative() || (!!frame.filename && frame.filename[0] !== '/' && frame.filename[0] !== '.') - } - }); - } - - return frames; - } - - if (!nodestacktrace) { - throw new Error('Unable to load the stack trace library.'); - } - - const stackFrames = nodestacktrace.parse(exception) || []; - return { - type: exception.name || 'Error', - message: exception.message, - stack_trace: getStackFrames(stackFrames) - }; - } -} diff --git a/src/services/NodeModuleCollector.ts b/src/services/NodeModuleCollector.ts deleted file mode 100644 index da4161fb..00000000 --- a/src/services/NodeModuleCollector.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { IModule } from '../models/IModule'; -import { EventPluginContext } from '../plugins/EventPluginContext'; -import { IModuleCollector } from './IModuleCollector'; - -import child = require('child_process'); -import path = require('path'); - -export class NodeModuleCollector implements IModuleCollector { - - private initialized: boolean = false; - private installedModules: { [id: string]: IModule } = {}; - - public getModules(context: EventPluginContext): IModule[] { - this.initialize(); - - if (!require.main) { - return []; - } - - const modulePath = path.dirname(require.main.filename) + '/node_modules/'; - const pathLength = modulePath.length; - - const loadedKeys = Object.keys(require.cache); - const loadedModules = {}; - - loadedKeys.forEach((key) => { - let id = key.substr(pathLength); - id = id.substr(0, id.indexOf('/')); - loadedModules[id] = true; - }); - - return Object.keys(loadedModules) - .map((key) => this.installedModules[key]) - .filter((m) => m !== undefined); - } - - private initialize() { - if (this.initialized) { - return; - } - - this.initialized = true; - - const output = child.spawnSync('npm', ['ls', '--depth=0', '--json']).stdout; - - if (!output) { - return; - } - - let json; - try { - json = JSON.parse(output.toString()); - } catch (e) { - return; - } - - const items = json.dependencies; - if (!items) { - return; - } - - let id = 0; - this.installedModules = {}; - - Object.keys(items).forEach((key) => { - const item = items[key]; - const theModule: IModule = { - module_id: id++, - name: key, - version: item.version - }; - - this.installedModules[key] = theModule; - }); - } -} diff --git a/src/services/NodeRequestInfoCollector.ts b/src/services/NodeRequestInfoCollector.ts deleted file mode 100644 index f23f7152..00000000 --- a/src/services/NodeRequestInfoCollector.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { IRequestInfo } from '../models/IRequestInfo'; -import { EventPluginContext } from '../plugins/EventPluginContext'; -import { Utils } from '../Utils'; -import { IRequestInfoCollector } from './IRequestInfoCollector'; - -export class NodeRequestInfoCollector implements IRequestInfoCollector { - public getRequestInfo(context: EventPluginContext): IRequestInfo { - const REQUEST_KEY: string = '@request'; // optimization for minifier. - if (!context.contextData[REQUEST_KEY]) { - return null; - } - - const exclusions = context.client.config.dataExclusions; - - // TODO: include referrer - const request = context.contextData[REQUEST_KEY]; - const requestInfo: IRequestInfo = { - client_ip_address: request.ip, - user_agent: request.headers['user-agent'], - is_secure: request.secure, - http_method: request.method, - host: request.hostname || request.host, - path: request.path, - post_data: JSON.parse(Utils.stringify(request.body || {}, exclusions)), - cookies: Utils.getCookies(request.headers.cookie, exclusions), - query_string: JSON.parse(Utils.stringify(request.params || {}, exclusions)) - }; - - const host = request.headers.host; - const port: number = host && parseInt(host.slice(host.indexOf(':') + 1), 10); - if (port > 0) { - requestInfo.port = port; - } - - return requestInfo; - } -} diff --git a/src/storage/BrowserStorage.ts b/src/storage/BrowserStorage.ts deleted file mode 100644 index 72242ed2..00000000 --- a/src/storage/BrowserStorage.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { KeyValueStorageBase } from './KeyValueStorageBase'; - -export class BrowserStorage extends KeyValueStorageBase { - private prefix: string; - - public static isAvailable(): boolean { - try { - const storage = window.localStorage; - const x = '__storage_test__'; - storage.setItem(x, x); - storage.removeItem(x); - return true; - } catch (e) { - return false; - } - } - - constructor(namespace: string, prefix: string = 'com.exceptionless.', maxItems: number = 20) { - super(maxItems); - - this.prefix = prefix + namespace + '-'; - } - - public write(key: string, value: string) { - window.localStorage.setItem(key, value); - } - - public read(key: string) { - return window.localStorage.getItem(key); - } - - public readAllKeys() { - return Object.keys(window.localStorage) - .filter((key) => key.indexOf(this.prefix) === 0); - } - - public delete(key: string) { - window.localStorage.removeItem(key); - } - - public getKey(timestamp) { - return this.prefix + timestamp; - } - - public getTimestamp(key) { - return parseInt(key.substr(this.prefix.length), 10); - } -} diff --git a/src/storage/BrowserStorageProvider.ts b/src/storage/BrowserStorageProvider.ts deleted file mode 100644 index 8591957a..00000000 --- a/src/storage/BrowserStorageProvider.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { BrowserStorage } from './BrowserStorage'; -import { IStorage } from './IStorage'; -import { IStorageProvider } from './IStorageProvider'; - -export class BrowserStorageProvider implements IStorageProvider { - public queue: IStorage; - public settings: IStorage; - - constructor(prefix?: string, maxQueueItems: number = 250) { - this.queue = new BrowserStorage('q', prefix, maxQueueItems); - this.settings = new BrowserStorage('settings', prefix, 1); - } - -} diff --git a/src/storage/IStorage.ts b/src/storage/IStorage.ts deleted file mode 100644 index 6803d6f2..00000000 --- a/src/storage/IStorage.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IStorageItem } from './IStorageItem'; - -export interface IStorage { - save(value: any): number; - get(limit?: number): IStorageItem[]; - remove(timestamp: number): void; - clear(): void; -} diff --git a/src/storage/IStorageItem.ts b/src/storage/IStorageItem.ts deleted file mode 100644 index f8e5756e..00000000 --- a/src/storage/IStorageItem.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IStorageItem { - timestamp: number; - value: any; -} diff --git a/src/storage/IStorageProvider.ts b/src/storage/IStorageProvider.ts deleted file mode 100644 index 3bb90447..00000000 --- a/src/storage/IStorageProvider.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IStorage } from './IStorage'; - -export interface IStorageProvider { - queue: IStorage; - settings: IStorage; -} diff --git a/src/storage/InMemoryStorage.ts b/src/storage/InMemoryStorage.ts deleted file mode 100644 index d835c3d8..00000000 --- a/src/storage/InMemoryStorage.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { IStorage } from './IStorage'; -import { IStorageItem } from './IStorageItem'; - -export class InMemoryStorage implements IStorage { - private maxItems: number; - private items: IStorageItem[] = []; - private lastTimestamp: number = 0; - - constructor(maxItems: number) { - this.maxItems = maxItems; - } - - public save(value: any): number { - if (!value) { - return null; - } - - const items = this.items; - const timestamp = Math.max(Date.now(), this.lastTimestamp + 1); - const item = { timestamp, value }; - - if (items.push(item) > this.maxItems) { - items.shift(); - } - - this.lastTimestamp = timestamp; - return item.timestamp; - } - - public get(limit?: number): IStorageItem[] { - return this.items.slice(0, limit); - } - - public remove(timestamp: number): void { - const items = this.items; - for (let i = 0; i < items.length; i++) { - if (items[i].timestamp === timestamp) { - items.splice(i, 1); - return; - } - } - } - - public clear(): void { - this.items = []; - } -} diff --git a/src/storage/InMemoryStorageProvider.ts b/src/storage/InMemoryStorageProvider.ts deleted file mode 100644 index 62acf06c..00000000 --- a/src/storage/InMemoryStorageProvider.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { InMemoryStorage } from './InMemoryStorage'; -import { IStorage } from './IStorage'; -import { IStorageProvider } from './IStorageProvider'; - -export class InMemoryStorageProvider implements IStorageProvider { - public queue: IStorage; - public settings: IStorage; - - constructor(maxQueueItems: number = 250) { - this.queue = new InMemoryStorage(maxQueueItems); - this.settings = new InMemoryStorage(1); - } - -} diff --git a/src/storage/KeyValueStorageBase.ts b/src/storage/KeyValueStorageBase.ts deleted file mode 100644 index a2874649..00000000 --- a/src/storage/KeyValueStorageBase.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { IStorage } from './IStorage'; -import { IStorageItem } from './IStorageItem'; - -export abstract class KeyValueStorageBase implements IStorage { - private maxItems: number; - private items: number[]; - private lastTimestamp: number = 0; - - constructor(maxItems) { - this.maxItems = maxItems; - } - - public save(value: any, single?: boolean): number { - if (!value) { - return null; - } - - this.ensureIndex(); - - const items = this.items; - const timestamp = Math.max(Date.now(), this.lastTimestamp + 1); - const key = this.getKey(timestamp); - const json = JSON.stringify(value); - - try { - this.write(key, json); - this.lastTimestamp = timestamp; - if (items.push(timestamp) > this.maxItems) { - this.delete(this.getKey(items.shift())); - } - } catch (e) { - return null; - } - - return timestamp; - } - - public get(limit?: number): IStorageItem[] { - this.ensureIndex(); - - return this.items.slice(0, limit) - .map((timestamp) => { - // Read and parse item for this timestamp - const key = this.getKey(timestamp); - try { - const json = this.read(key); - const value = JSON.parse(json, parseDate); - return { timestamp, value }; - } catch (error) { - // Something went wrong - try to delete the cause. - this.safeDelete(key); - return null; - } - }) - .filter((item) => item != null); - } - - public remove(timestamp: number): void { - this.ensureIndex(); - - const items = this.items; - const index = items.indexOf(timestamp); - if (index >= 0) { - const key = this.getKey(timestamp); - this.safeDelete(key); - items.splice(index, 1); - } - } - - public clear(): void { - this.items.forEach((item) => this.safeDelete(this.getKey(item))); - this.items = []; - } - - protected abstract write(key: string, value: string): void; - protected abstract read(key: string): string; - protected abstract readAllKeys(): string[]; - protected abstract delete(key: string); - protected abstract getKey(timestamp: number): string; - protected abstract getTimestamp(key: string): number; - - private ensureIndex() { - if (!this.items) { - this.items = this.createIndex(); - this.lastTimestamp = Math.max(0, ...this.items) + 1; - } - } - - private safeDelete(key: string): void { - try { - this.delete(key); - } catch (error) { - } - } - - private createIndex() { - try { - const keys = this.readAllKeys(); - return keys.map((key) => { - try { - const timestamp = this.getTimestamp(key); - if (!timestamp) { - this.safeDelete(key); - return null; - } - return timestamp; - } catch (error) { - this.safeDelete(key); - return null; - } - }).filter((timestamp) => timestamp != null) - .sort((a, b) => a - b); - } catch (error) { - return []; - } - } -} - -function parseDate(key, value) { - const dateRegx = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/g; - if (typeof value === 'string') { - const a = dateRegx.exec(value); - if (a) { - return new Date(value); - } - } - return value; -} diff --git a/src/storage/NodeFileStorage.ts b/src/storage/NodeFileStorage.ts deleted file mode 100644 index 8a009d29..00000000 --- a/src/storage/NodeFileStorage.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { KeyValueStorageBase } from './KeyValueStorageBase'; - -import * as Fs from 'fs'; -import * as Path from 'path'; - -export class NodeFileStorage extends KeyValueStorageBase { - private directory: string; - private prefix: string; - private fs: any; - - constructor(namespace: string, folder?: string, prefix: string = 'ex-', maxItems: number = 20, fs?: any) { - super(maxItems); - - if (!folder) { - folder = Path.join(Path.dirname(require.main.filename), '.exceptionless'); - } - - const subfolder = Path.join(folder, namespace); - this.directory = Path.resolve(subfolder); - this.prefix = prefix; - this.fs = fs ? fs : Fs; - - this.mkdir(this.directory); - } - - public write(key: string, value: string) { - this.fs.writeFileSync(key, value); - } - - public read(key: string) { - return this.fs.readFileSync(key, 'utf8'); - } - - public readAllKeys() { - return this.fs.readdirSync(this.directory) - .filter((file) => file.indexOf(this.prefix) === 0) - .map((file) => Path.join(this.directory, file)); - } - - public delete(key: string) { - this.fs.unlinkSync(key); - } - - public getKey(timestamp) { - return Path.join(this.directory, `${this.prefix}${timestamp}.json`); - } - - public getTimestamp(key) { - return parseInt(Path.basename(key, '.json') - .substr(this.prefix.length), 10); - } - - private mkdir(path) { - const dirs = path.split(Path.sep); - let root = ''; - - while (dirs.length > 0) { - const dir = dirs.shift(); - if (dir === '') { - root = Path.sep; - } - if (!this.fs.existsSync(root + dir)) { - this.fs.mkdirSync(root + dir); - } - root += dir + Path.sep; - } - } -} diff --git a/src/storage/NodeFileStorageProvider.ts b/src/storage/NodeFileStorageProvider.ts deleted file mode 100644 index 9cc74dc3..00000000 --- a/src/storage/NodeFileStorageProvider.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IStorage } from './IStorage'; -import { IStorageProvider } from './IStorageProvider'; -import { NodeFileStorage } from './NodeFileStorage'; - -export class NodeFileStorageProvider implements IStorageProvider { - public queue: IStorage; - public settings: IStorage; - - constructor(folder?: string, prefix?: string, maxQueueItems: number = 250) { - this.queue = new NodeFileStorage('q', folder, prefix, maxQueueItems); - this.settings = new NodeFileStorage('settings', folder, prefix, 1); - } -} diff --git a/src/storage/Storage-nodespec.ts b/src/storage/Storage-nodespec.ts deleted file mode 100644 index 6af156c3..00000000 --- a/src/storage/Storage-nodespec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import * as mockFs from 'mock-fs'; -import { NodeFileStorage } from './NodeFileStorage'; -import { describeStorage } from './Storage-spec'; - -let mockedFs; - -const nodeFileStorageFactory = (maxItems?) => { - return new NodeFileStorage('test', './fileStorage', 'ex-', maxItems, mockedFs); -}; - -const nodeFileStorageInitializer = () => { - mockedFs = mockFs({ - fileStorage: {} - }); -}; - -describeStorage('NodeFileStorage', - nodeFileStorageFactory, - nodeFileStorageInitializer, - true -); diff --git a/src/storage/Storage-spec.ts b/src/storage/Storage-spec.ts deleted file mode 100644 index e76385dd..00000000 --- a/src/storage/Storage-spec.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { expect } from 'chai'; -import { IEvent } from '../models/IEvent'; -import { InMemoryStorage } from './InMemoryStorage'; -import { IStorage } from './IStorage'; -import { IStorageItem } from './IStorageItem'; - -describeStorage('InMemoryStorage', (maxItems = 250) => { - return new InMemoryStorage(maxItems); -}); - -export function describeStorage(name: string, - storageFactory: (maxItems?: number) => IStorage, - beforeEachCallback?: () => void, - recreateStorage: boolean = false) { - describe(name, () => { - if (beforeEachCallback) { - beforeEach(beforeEachCallback); - } - - it('should save events', () => { - let storage = storageFactory(); - const key = 'ex-q-'; - const event1: IEvent = { type: 'log', reference_id: key + '123454321' }; - const event2: IEvent = { type: 'log', reference_id: key + '098765432' }; - expect(storage.get().length).to.equal(0); - storage.save(event1); - expect(storage.get().length).to.equal(1); - - if (recreateStorage) { - storage = storageFactory(); - } - - storage.save(event2); - expect(storage.get().length).to.equal(2); - }); - - it('should get saved events', () => { - let storage = storageFactory(); - const key = 'ex-q-'; - const event1: IEvent = { type: 'log', reference_id: key + '11' }; - const event2: IEvent = { type: 'log', reference_id: key + '12' }; - const event3: IEvent = { type: 'log', reference_id: key + '13' }; - const event4: IEvent = { type: 'log', reference_id: key + '14' }; - const event5: IEvent = { type: 'log', reference_id: key + '15' }; - const event6: IEvent = { type: 'log', reference_id: key + '16' }; - expect(storage.get().length).to.equal(0); - - const ts1 = storage.save(event1); - const ts2 = storage.save(event2); - storage.save(event3); - storage.save(event4); - storage.save(event5); - storage.save(event6); - expect(storage.get().length).to.equal(6); - - if (recreateStorage) { - storage = storageFactory(); - } - - expect(storage.get().length).to.equal(6); - storage.remove(ts1); - expect(storage.get().length).to.equal(5); - - expect(storage.get()[0].value).to.eql(event2); - storage.remove(ts2); - expect(storage.get().length).to.equal(4); - - let events = storage.get(2); - expect(events.length).to.equal(2); - expect(events[0].value).not.to.equal(events[1].value); - storage.remove(events[0].timestamp); - storage.remove(events[1].timestamp); - expect(storage.get().length).to.equal(2); - - events = storage.get(); - expect(events.length).to.equal(2); - expect(events[0].value).not.to.equal(events[1].value); - }); - - it('should clear all events', () => { - let storage = storageFactory(); - const key = 'ex-q-'; - const event1: IEvent = { type: 'log', reference_id: key + '11' }; - const event2: IEvent = { type: 'log', reference_id: key + '12' }; - const event3: IEvent = { type: 'log', reference_id: key + '13' }; - const event4: IEvent = { type: 'log', reference_id: key + '14' }; - const event5: IEvent = { type: 'log', reference_id: key + '15' }; - const event6: IEvent = { type: 'log', reference_id: key + '16' }; - expect(storage.get().length).to.equal(0); - - const ts1 = storage.save(event1); - storage.save(event2); - storage.save(event3); - storage.save(event4); - storage.save(event5); - storage.save(event6); - expect(storage.get().length).to.equal(6); - - if (recreateStorage) { - storage = storageFactory(); - } - - storage.remove(ts1); - expect(storage.get().length).to.equal(5); - - storage.clear(); - - expect(storage.get().length).to.equal(0); - }); - - it('should get with limit', () => { - let storage = storageFactory(250); - for (let index: number = 0; index < 260; index++) { - storage.save({ type: 'log', reference_id: index.toString() }); - } - - if (recreateStorage) { - storage = storageFactory(250); - } - - expect(storage.get().length).to.equal(250); - expect(storage.get(1).length).to.equal(1); - }); - - it('should get the oldest events', () => { - function getDate(baseDate: Date, offset: number) { - return new Date(baseDate.getTime() + (offset * 60000)); - } - - const DATE: Date = new Date(); - let storage = storageFactory(); - for (let index: number = 0; index < 10; index++) { - storage.save({ - date: getDate(DATE, index), - type: 'log', - reference_id: index.toString() - }); - - expect(storage.get().length).to.equal(index + 1); - } - - if (recreateStorage) { - storage = storageFactory(); - } - - let offset: number = 0; - let events: IStorageItem[] = storage.get(2); - while (events && events.length > 0) { - expect(2).to.equal(events.length); - for (let ei = 0; ei < 2; ei++) { - expect(getDate(DATE, offset++)).to.eql(events[ei].value.date); - storage.remove(events[ei].timestamp); - } - - events = storage.get(2); - } - }); - - it('should respect max items limit', () => { - let storage = storageFactory(5); - const timestamps = []; - for (let index: number = 0; index < 5; index++) { - timestamps.push(storage.save({ type: 'log', reference_id: index.toString() })); - } - - let events: IStorageItem[] = storage.get(); - expect(events.length).to.equal(5); - expect(events[0].timestamp).to.equal(timestamps[0]); - storage.save({ type: 'log', reference_id: '6' }); - - if (recreateStorage) { - storage = storageFactory(5); - } - - events = storage.get(); - expect(events.length).to.equal(5); - expect(events[0].timestamp).to.equal(timestamps[1]); - }); - - }); -} diff --git a/src/submission/DefaultSubmissionAdapter.ts b/src/submission/DefaultSubmissionAdapter.ts deleted file mode 100644 index f9fd7d63..00000000 --- a/src/submission/DefaultSubmissionAdapter.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { ISubmissionAdapter } from './ISubmissionAdapter'; -import { SubmissionCallback } from './SubmissionCallback'; -import { SubmissionRequest } from './SubmissionRequest'; - -// tslint:disable-next-line:prefer-const -declare var XDomainRequest: { new (); create(); }; - -export class DefaultSubmissionAdapter implements ISubmissionAdapter { - public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) { - // TODO: Handle sending events when app is exiting with send beacon. - const TIMEOUT: string = 'timeout'; // optimization for minifier. - const LOADED: string = 'loaded'; // optimization for minifier. - const WITH_CREDENTIALS: string = 'withCredentials'; // optimization for minifier. - - let isCompleted: boolean = false; - let useSetTimeout: boolean = false; - function complete(mode: string, xhr: XMLHttpRequest) { - function parseResponseHeaders(headerStr) { - function trim(value) { - return value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); - } - - const headers = {}; - const headerPairs = (headerStr || '').split('\u000d\u000a'); - for (const headerPair of headerPairs) { - // Can't use split() here because it does the wrong thing - // if the header value has the string ": " in it. - const separator = headerPair.indexOf('\u003a\u0020'); - if (separator > 0) { - headers[trim(headerPair.substring(0, separator).toLowerCase())] = headerPair.substring(separator + 2); - } - } - - return headers; - } - - if (isCompleted) { - return; - } - - isCompleted = true; - - let message: string = xhr.statusText; - const responseText: string = xhr.responseText; - let status: number = xhr.status; - - if (mode === TIMEOUT || status === 0) { - message = 'Unable to connect to server.'; - status = 0; - } else if (mode === LOADED && !status) { - status = request.method === 'POST' ? 202 : 200; - } else if (status < 200 || status > 299) { - const responseBody: any = (xhr as any).responseBody; - if (!!responseBody && !!responseBody.message) { - message = responseBody.message; - } else if (!!responseText && responseText.indexOf('message') !== -1) { - try { - message = JSON.parse(responseText).message; - } catch (e) { - message = responseText; - } - } - } - - callback && callback(status || 500, message || '', responseText, parseResponseHeaders(xhr.getAllResponseHeaders && xhr.getAllResponseHeaders())); - } - - function createRequest(userAgent: string, method: string, url: string): XMLHttpRequest { - let xhr: any = new XMLHttpRequest(); - if (WITH_CREDENTIALS in xhr) { - xhr.open(method, url, true); - - xhr.setRequestHeader('X-Exceptionless-Client', userAgent); - if (method === 'POST') { - xhr.setRequestHeader('Content-Type', 'application/json'); - } - } else if (typeof XDomainRequest !== 'undefined') { - useSetTimeout = true; - xhr = new XDomainRequest(); - xhr.open(method, location.protocol === 'http:' ? url.replace('https:', 'http:') : url); - } else { - xhr = null; - } - - if (xhr) { - xhr.timeout = 10000; - } - - return xhr; - } - - const url = `${request.url}${(request.url.indexOf('?') === -1 ? '?' : '&')}access_token=${encodeURIComponent(request.apiKey)}`; - const xhr = createRequest(request.userAgent, request.method || 'POST', url); - if (!xhr) { - return (callback && callback(503, 'CORS not supported.')); - } - - if (WITH_CREDENTIALS in xhr) { - xhr.onreadystatechange = () => { - // xhr not ready. - if (xhr.readyState !== 4) { - return; - } - - complete(LOADED, xhr); - }; - } - - xhr.onprogress = () => { }; - xhr.ontimeout = () => complete(TIMEOUT, xhr); - xhr.onerror = () => complete('error', xhr); - xhr.onload = () => complete(LOADED, xhr); - - if (useSetTimeout) { - setTimeout(() => xhr.send(request.data), 500); - } else { - xhr.send(request.data); - } - } -} diff --git a/src/submission/DefaultSubmissionClient-spec.ts b/src/submission/DefaultSubmissionClient-spec.ts deleted file mode 100644 index e2edf30a..00000000 --- a/src/submission/DefaultSubmissionClient-spec.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { expect } from 'chai'; -import { Configuration } from '../configuration/Configuration'; -import { IEvent } from '../models/IEvent'; -import { IUserDescription } from '../models/IUserDescription'; -import { DefaultSubmissionClient } from './DefaultSubmissionClient'; -import { ISubmissionAdapter } from './ISubmissionAdapter'; -import { ISubmissionClient } from './ISubmissionClient'; -import { SubmissionCallback } from './SubmissionCallback'; -import { SubmissionRequest } from './SubmissionRequest'; - -class TestAdapter implements ISubmissionAdapter { - private request; - private checks: Array<(request: SubmissionRequest) => void > = []; - private callback: SubmissionCallback; - private status = 202; - private message = null; - private data; - private headers; - - constructor(check: (request: SubmissionRequest) => void) { - this.checks.push(check); - } - - public withResponse(status: number, message: string, data?: string, headers?: any) { - this.status = status; - this.message = message; - this.data = data; - this.headers = headers; - return this; - } - - public withCheck(check: (request: SubmissionRequest) => void) { - this.checks.push(check); - return this; - } - - public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) { - this.request = request; - this.callback = callback; - - if (isAppExiting) { - this.done(); - } - } - - public done() { - if (!this.request) { - expect.fail('sendRequest hasn\'t been called.'); - return; - } - - this.checks.forEach((c) => c(this.request)); - this.callback && this.callback(this.status, this.message, this.data, this.headers); - } -} - -describe('DefaultSubmissionClient', () => { - let adapter: TestAdapter; - let config: Configuration; - let submissionClient: ISubmissionClient; - - beforeEach(() => { - const apiKey = 'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw'; - const serverUrl = 'http://localhost:50000'; - - submissionClient = new DefaultSubmissionClient(); - - config = new Configuration({ - apiKey, - serverUrl - }); - - adapter = new TestAdapter((r) => { - expect(r.apiKey).to.equal(apiKey); - }); - - config.submissionAdapter = adapter; - }); - - it('should submit events', (done) => { - const events = [{ type: 'log', message: 'From js client', reference_id: '123454321' }]; - - adapter.withCheck((r) => { - expect(r.data).to.equal(JSON.stringify(events)); - expect(r.method).to.equal('POST'); - expect(r.url).to.equal(`${config.serverUrl}/api/v2/events`); - }); - - submissionClient.postEvents(events, config, () => done()); - - adapter.done(); - }); - - it('should submit invalid object data', (done) => { - const events: IEvent[] = [{ - type: 'log', message: 'From js client', reference_id: '123454321', data: { - name: 'blake', - age: () => { throw new Error('Test'); } - } - }]; - - adapter.withCheck((r) => { - expect(r.data).to.equal(JSON.stringify(events)); - expect(r.method).to.equal('POST'); - expect(r.url).to.equal(`${config.serverUrl}/api/v2/events`); - }); - - submissionClient.postEvents(events, config, () => done()); - - adapter.done(); - }); - - it('should submit user description', (done) => { - const description: IUserDescription = { - email_address: 'norply@exceptionless.io', - description: 'unit test' - }; - - adapter.withCheck((r) => { - expect(r.data).to.equal(JSON.stringify(description)); - expect(r.method).to.equal('POST'); - expect(r.url).to.equal(`${config.serverUrl}/api/v2/events/by-ref/123454321/user-description`); - }); - - submissionClient.postUserDescription('123454321', description, config, () => done()); - - adapter.done(); - }); - - it('should get project settings', (done) => { - adapter.withResponse(200, null, JSON.stringify({ version: 1 })); - - submissionClient.getSettings(config, 0, (response) => { - expect(response.success).to.be.true; - expect(response.message).to.be.null; - expect(response.settings).not.to.be.null; - expect(response.settingsVersion).to.be.greaterThan(-1); - - done(); - }); - - adapter.done(); - }); -}); diff --git a/src/submission/DefaultSubmissionClient.ts b/src/submission/DefaultSubmissionClient.ts deleted file mode 100644 index 08d3ca57..00000000 --- a/src/submission/DefaultSubmissionClient.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { Configuration } from '../configuration/Configuration'; -import { SettingsManager } from '../configuration/SettingsManager'; -import { IClientConfiguration } from '../models/IClientConfiguration'; -import { IEvent } from '../models/IEvent'; -import { IUserDescription } from '../models/IUserDescription'; -import { ISubmissionClient } from './ISubmissionClient'; -import { SettingsResponse } from './SettingsResponse'; -import { SubmissionRequest } from './SubmissionRequest'; -import { SubmissionResponse } from './SubmissionResponse'; - -// tslint:disable-next-line:prefer-const -declare var XDomainRequest: { new (); create(); }; - -export class DefaultSubmissionClient implements ISubmissionClient { - public configurationVersionHeader: string = 'x-exceptionless-configversion'; - - public postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void { - const data = JSON.stringify(events); - const request = this.createRequest(config, 'POST', `${config.serverUrl}/api/v2/events`, data); - const cb = this.createSubmissionCallback(config, callback); - - return config.submissionAdapter.sendRequest(request, cb, isAppExiting); - } - - public postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void { - const path = `${config.serverUrl}/api/v2/events/by-ref/${encodeURIComponent(referenceId)}/user-description`; - const data = JSON.stringify(description); - const request = this.createRequest(config, 'POST', path, data); - const cb = this.createSubmissionCallback(config, callback); - - return config.submissionAdapter.sendRequest(request, cb); - } - - public getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void { - const request = this.createRequest(config, 'GET', `${config.serverUrl}/api/v2/projects/config?v=${version}`); - const cb = (status, message, data?, headers?) => { - if (status !== 200) { - return callback(new SettingsResponse(false, null, -1, null, message)); - } - - let settings: IClientConfiguration; - try { - settings = JSON.parse(data); - } catch (e) { - config.log.error(`Unable to parse settings: '${data}'`); - } - - if (!settings || isNaN(settings.version)) { - return callback(new SettingsResponse(false, null, -1, null, 'Invalid configuration settings.')); - } - - callback(new SettingsResponse(true, settings.settings || {}, settings.version)); - }; - - return config.submissionAdapter.sendRequest(request, cb); - } - - public sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void { - const request = this.createRequest(config, 'GET', `${config.heartbeatServerUrl}/api/v2/events/session/heartbeat?id=${sessionIdOrUserId}&close=${closeSession}`); - config.submissionAdapter.sendRequest(request); - } - - private createRequest(config: Configuration, method: string, url: string, data: string = null): SubmissionRequest { - return { - method, - url, - data, - apiKey: config.apiKey, - userAgent: config.userAgent - }; - } - - private createSubmissionCallback(config: Configuration, callback: (response: SubmissionResponse) => void) { - return (status, message, data?, headers?) => { - const settingsVersion: number = headers && parseInt(headers[this.configurationVersionHeader], 10); - SettingsManager.checkVersion(settingsVersion, config); - - callback(new SubmissionResponse(status, message)); - }; - } -} diff --git a/src/submission/ISubmissionAdapter.ts b/src/submission/ISubmissionAdapter.ts deleted file mode 100644 index f69547d1..00000000 --- a/src/submission/ISubmissionAdapter.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { SubmissionCallback } from './SubmissionCallback'; -import { SubmissionRequest } from './SubmissionRequest'; - -export interface ISubmissionAdapter { - sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void; -} diff --git a/src/submission/ISubmissionClient.ts b/src/submission/ISubmissionClient.ts deleted file mode 100644 index 7bba4969..00000000 --- a/src/submission/ISubmissionClient.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Configuration } from '../configuration/Configuration'; -import { IEvent } from '../models/IEvent'; -import { IUserDescription } from '../models/IUserDescription'; -import { SettingsResponse } from './SettingsResponse'; -import { SubmissionResponse } from './SubmissionResponse'; - -export interface ISubmissionClient { - postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void; - postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void; - getSettings(config: Configuration, version: number, callback: (response: SettingsResponse) => void): void; - sendHeartbeat(sessionIdOrUserId: string, closeSession: boolean, config: Configuration): void; -} diff --git a/src/submission/NodeSubmissionAdapter.ts b/src/submission/NodeSubmissionAdapter.ts deleted file mode 100644 index 55c99387..00000000 --- a/src/submission/NodeSubmissionAdapter.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { ISubmissionAdapter } from './ISubmissionAdapter'; -import { SubmissionCallback } from './SubmissionCallback'; -import { SubmissionRequest } from './SubmissionRequest'; - -import http = require('http'); -import https = require('https'); -import url = require('url'); -import child = require('child_process'); - -export class NodeSubmissionAdapter implements ISubmissionAdapter { - public sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean) { - if (isAppExiting) { - this.sendRequestSync(request, callback); - return; - } - - const parsedHost = url.parse(request.url); - - const options: https.RequestOptions = { - auth: `client:${request.apiKey}`, - headers: {}, - hostname: parsedHost.hostname, - method: request.method, - port: parsedHost.port && parseInt(parsedHost.port, 10), - path: request.url - }; - - options.headers['User-Agent'] = request.userAgent; - - if (request.method === 'POST') { - options.headers = { - 'Content-Type': 'application/json', - 'Content-Length': Buffer.byteLength(request.data) - }; - } - - const protocol: any = (parsedHost.protocol === 'https' ? https : http); - const clientRequest: http.ClientRequest = protocol.request(options, (response: http.IncomingMessage) => { - let body = ''; - response.setEncoding('utf8'); - response.on('data', (chunk) => body += chunk); - response.on('end', () => this.complete(response, body, response.headers, callback)); - }); - - clientRequest.on('error', (error: Error) => callback && callback(500, error.message)); - clientRequest.end(request.data); - } - - private complete(response: http.IncomingMessage, responseBody: string, responseHeaders: object, callback: SubmissionCallback): void { - let message: string; - if (response.statusCode === 0) { - message = 'Unable to connect to server.'; - } else if (response.statusCode < 200 || response.statusCode > 299) { - message = response.statusMessage || ( response as any).message; - } - - callback && callback(response.statusCode || 500, message, responseBody, responseHeaders); - } - - private sendRequestSync(request: SubmissionRequest, callback: SubmissionCallback): void { - const requestJson = JSON.stringify(request); - const res = child.spawnSync(process.execPath, [require.resolve('./submitSync.js')], - { - input: requestJson, - stdio: ['pipe', 'pipe', process.stderr] - }); - - const out = res.stdout.toString(); - const result = JSON.parse(out); - - callback && callback(result.status, result.message, result.data, result.headers); - } -} diff --git a/src/submission/SettingsResponse.ts b/src/submission/SettingsResponse.ts deleted file mode 100644 index c9adc2b1..00000000 --- a/src/submission/SettingsResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -export class SettingsResponse { - public success: boolean = false; - public settings: any; - public settingsVersion: number = -1; - public message: string; - public exception: any; - - constructor(success: boolean, settings: any, settingsVersion: number = -1, exception: any = null, message: string = null) { - this.success = success; - this.settings = settings; - this.settingsVersion = settingsVersion; - this.exception = exception; - this.message = message; - } -} diff --git a/src/submission/SubmissionCallback.ts b/src/submission/SubmissionCallback.ts deleted file mode 100644 index f6873ecc..00000000 --- a/src/submission/SubmissionCallback.ts +++ /dev/null @@ -1 +0,0 @@ -export type SubmissionCallback = (status: number, message: string, data?: string, headers?: object) => void; diff --git a/src/submission/SubmissionRequest.ts b/src/submission/SubmissionRequest.ts deleted file mode 100644 index 293eec3e..00000000 --- a/src/submission/SubmissionRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface SubmissionRequest { - apiKey: string; - userAgent: string; - method: string; - url: string; - data: string; -} diff --git a/src/submission/SubmissionResponse.ts b/src/submission/SubmissionResponse.ts deleted file mode 100644 index af593315..00000000 --- a/src/submission/SubmissionResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -export class SubmissionResponse { - public success: boolean = false; - public badRequest: boolean = false; - public serviceUnavailable: boolean = false; - public paymentRequired: boolean = false; - public unableToAuthenticate: boolean = false; - public notFound: boolean = false; - public requestEntityTooLarge: boolean = false; - public statusCode: number; - public message: string; - - constructor(statusCode: number, message?: string) { - this.statusCode = statusCode; - this.message = message; - - this.success = statusCode >= 200 && statusCode <= 299; - this.badRequest = statusCode === 400; - this.serviceUnavailable = statusCode === 503; - this.paymentRequired = statusCode === 402; - this.unableToAuthenticate = statusCode === 401 || statusCode === 403; - this.notFound = statusCode === 404; - this.requestEntityTooLarge = statusCode === 413; - } -} diff --git a/src/submitSync.ts b/src/submitSync.ts deleted file mode 100644 index cb5c2a6e..00000000 --- a/src/submitSync.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { NodeSubmissionAdapter } from './submission/NodeSubmissionAdapter'; -import { SubmissionRequest } from './submission/SubmissionRequest'; - -import * as stream from 'stream'; -import { StringDecoder } from 'string_decoder'; - -const decoder = new StringDecoder('utf8'); -const strings: string[] = []; - -const jsonStream = new stream.Writable(); -(jsonStream as any)._write = (chunk: Buffer | string, encoding: string, next: () => void) => { - strings.push(decoder.write( chunk as Buffer)); - next(); -}; - -jsonStream.on('finish', () => { - const json = strings.join(''); - const request: SubmissionRequest = JSON.parse(json); - const adapter = new NodeSubmissionAdapter(); - adapter.sendRequest(request, (status, message, data, headers) => { - const result = { - status, - message, - data, - headers - }; - process.stdout.write(JSON.stringify(result)); - process.exit(0); - }); -}); - -process.stdin.pipe(jsonStream); diff --git a/src/tsconfig.json b/src/tsconfig.json deleted file mode 100644 index 0d0e9561..00000000 --- a/src/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "module": "commonjs", - "removeComments": true, - "sourceMap": true, - "target": "es5" - }, - "bundles": { - "exceptionless": { - "files": [ - "exceptionless.ts" - ] - } - } -} diff --git a/src/tsconfig.node.json b/src/tsconfig.node.json deleted file mode 100644 index 0a707ffb..00000000 --- a/src/tsconfig.node.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "module": "commonjs", - "removeComments": true, - "sourceMap": true, - "target": "es5" - }, - "bundles": { - "exceptionless.node": { - "files": [ - "../node_modules/@types/node/index.d.ts", - "../node_modules/@types/stack-trace/index.d.ts", - - "exceptionless.node.ts" - ] - }, - "submitSync": { - "files": [ - "../node_modules/@types/node/index.d.ts", - - "submitSync.ts" - ] - } - } -} diff --git a/src/tsconfig.test.json b/src/tsconfig.test.json deleted file mode 100644 index 91803b7d..00000000 --- a/src/tsconfig.test.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "module": "commonjs", - "removeComments": true, - "sourceMap": true, - "target": "es5" - }, - "bundles": { - "exceptionless-nodespec": { - "files": [ - "../node_modules/@types/mocha/index.d.ts", - "../node_modules/@types/chai/index.d.ts", - "../node_modules/@types/node/index.d.ts", - "../node_modules/@types/stack-trace/index.d.ts", - - "exceptionless.node.ts", - - "**/*-spec.ts", - "**/*-nodespec.ts" - ] - }, - "exceptionless-browserspec": { - "files": [ - "../node_modules/@types/mocha/index.d.ts", - "../node_modules/@types/chai/index.d.ts", - - "exceptionless.ts", - - "**/*-spec.ts", - "**/*-browserspec.ts" - ] - } - } -} diff --git a/src/tsconfig.universal.json b/src/tsconfig.universal.json deleted file mode 100644 index 8bb714a3..00000000 --- a/src/tsconfig.universal.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "module": "commonjs", - "removeComments": true, - "sourceMap": true, - "target": "es5" - }, - "bundles": { - "exceptionless.universal": { - "files": [ - "../node_modules/@types/node/index.d.ts", - "../node_modules/@types/stack-trace/index.d.ts", - - "exceptionless.universal.ts" - ] - }, - "submitSync": { - "files": [ - "../node_modules/@types/node/index.d.ts", - - "submitSync.ts" - ] - } - } -} diff --git a/test.config.js b/test.config.js deleted file mode 100644 index ed5a0195..00000000 --- a/test.config.js +++ /dev/null @@ -1,19 +0,0 @@ -require.config({ - baseUrl: 'node_modules', - paths: { - chai: 'chai/chai', - sinon: 'sinon/pkg/sinon', - TraceKit: 'tracekit/tracekit' - } -}); - -require(['../dist/temp/exceptionless-browserspec' ], function () { - if (typeof mochaPhantomJS !== "undefined") { - mochaPhantomJS.run(); - } - else { - - console.log('running mocha'); - mocha.run(); - } -}); diff --git a/testrunner.html b/testrunner.html deleted file mode 100644 index a00569f9..00000000 --- a/testrunner.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Mocha - - - - - - -
-

Index

-
-
-
- - - - - \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..6af4fc27 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "exactOptionalPropertyTypes": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "lib": ["DOM", "ES2022"], + "module": "ESNext", + "moduleResolution": "Bundler", + "noImplicitAny": true, + "noImplicitThis": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "pretty": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "target": "ES2022", + "useUnknownInCatchVariables": true + } +} diff --git a/tslint.json b/tslint.json deleted file mode 100644 index cb0f8961..00000000 --- a/tslint.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "lintOptions": { - "typeCheck": true - }, - "extends": "tslint:latest", - "rules": { - "ban": [true, - ["describe", "only"], - ["it", "only"] - ], - - "callable-types": true, - "interface-name": [false], - "interface-over-type-literal": true, - "max-classes-per-file": [false], - "max-line-length": [true, 220], - "member-ordering": [true, - "public-before-private", - "static-before-instance", - "variables-before-functions" - ], - "no-angle-bracket-type-assertion": true, - "no-bitwise": false, - "no-default-export": true, - "no-empty": false, - "no-empty-interface": true, - "no-string-throw": true, - "no-switch-case-fall-through": true, - "no-unused-expression": false, - "object-literal-sort-keys": false, - "prefer-const": true, - "quotemark": [true, "single", "avoid-escape"], - "switch-default": false, - "trailing-comma": [true, { - "singleline": "never", - "multiline": "never" - }], - "unified-signatures": false, - "variable-name": [true, - "ban-keywords", - "check-format", - "allow-leading-underscore", - "allow-pascal-case" - ] - } -} diff --git a/umd.template.jst b/umd.template.jst deleted file mode 100644 index 49eea2d7..00000000 --- a/umd.template.jst +++ /dev/null @@ -1,28 +0,0 @@ -<% -var stdDeps = ['require', 'exports']; - -var amdDeps = stdDeps.concat(_.pluck(deps, 'amdName')); -var cjsDeps = _.without(_.pluck(deps, 'cjsName'), stdDeps); -cjsDeps = cjsDeps ? stdDeps.concat(_.map(cjsDeps, function(dep) { return "require('" + dep + "')" })) : stdDeps; - -var depNames = deps ? stdDeps.concat(_.pluck(deps, 'paramName')) : stdDeps; -var globalDeps = deps ? stdDeps.concat(_.map(deps, function(dep) { return 'root.' + dep.globalName })) : stdDeps; -%> -var exports, require; -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - define('<%= namespace %>', <%= amdDeps ? JSON.stringify(amdDeps) + ', ' : '[], ' %>factory); - } else if (typeof exports === 'object') { - module.exports = factory(<%= cjsDeps.join(', ') %>); - } else { - root.<%= namespace %> = factory(<%= globalDeps.join(', ') %>); - } -}(this, function(<%= depNames.join(', ') %>) { -if (!exports) { var exports = {}; } -<% if (exports) { %> -<%= contents %> -return <%= exports %>; -<% } else { %> -return <%= contents %>; -<% } %> -}));