Skip to content

📈 Get real-time stocks from TradingView

Rebuild TradingView-API as TypeScript V4 beta (#329)

Mathieu Colmon95b6d0f45dfd
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index c08bbfe..0000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-module.exports = {
- env: {
- commonjs: true,
- es2021: true,
- node: true,
- },
- extends: [
- 'airbnb-base',
- ],
- parser: '@babel/eslint-parser',
- parserOptions: {
- ecmaVersion: 12,
- requireConfigFile: false,
- },
- overrides: [{
- files: ['*.ts'],
- parser: '@typescript-eslint/parser',
- parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
- plugins: ['@typescript-eslint'],
- rules: {
- 'no-unused-vars': 'off',
- '@typescript-eslint/no-unused-vars': 'error',
- 'no-use-before-define': 'off',
- 'no-undef': 'off',
- 'no-void': 'off',
- },
- }, {
- files: ['tests/*.ts'],
- rules: { 'max-classes-per-file': 'off' },
- }],
- rules: {
- 'no-console': 'off',
- 'import/no-extraneous-dependencies': [
- 'error',
- {
- devDependencies: ['./test.js', './tests/**'],
- },
- ],
- 'no-restricted-syntax': 'off',
- 'no-await-in-loop': 'off',
- 'no-continue': 'off',
- 'guard-for-in': 'off',
- },
-};
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 44d89d7..29f7d74 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -12,41 +12,53 @@ on:
- cron: '0 0 * * *'
jobs:
- Tests:
+ # Deterministic checks: no network access to TradingView is needed.
+ Node:
runs-on: ubuntu-latest
-
strategy:
- # TradingView authenticated tests use the same account/session secrets.
- # Running every Node matrix job at once makes the external websocket tests flaky.
- max-parallel: 1
matrix:
- node-version: [14.x, 18.x, 19.x]
-
+ node-version: [20.x, 22.x, 24.x]
steps:
- - uses: actions/checkout@v2
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- - name: Install dependencies
- run: npm ci
- - name: Run tests
- run: npm test -- --run
- env:
- SESSION: ${{ secrets.TW_SESSION }}
- SIGNATURE: ${{ secrets.TW_SIGNATURE }}
+ - run: npm ci
+ - run: npm run typecheck
+ - run: npm run lint
+ - run: npm test
+ - run: npm run build
+ - run: npm run smoke
- Agent-API:
+ Bun:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
- node-version: 20.x
+ node-version: 22.x
cache: 'npm'
+ - uses: oven-sh/setup-bun@v2
- run: npm ci
- - run: npm run build:agent
- - run: npm run lint:agent
- - run: npm test -- --run tests/agent.test.ts
- - run: npm pack --dry-run
+ - run: npm run test:bun
+ - run: npm run build
+ # The smoke test imports the packed tarball under Node and Bun.
+ - run: npm run smoke
+
+ # Talks to TradingView: nightly or manual only, never blocking.
+ Live:
+ if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
+ runs-on: ubuntu-latest
+ continue-on-error: true
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 22.x
+ cache: 'npm'
+ - run: npm ci
+ - run: npm run test:live
+ env:
+ SESSION: ${{ secrets.TW_SESSION }}
+ SIGNATURE: ${{ secrets.TW_SIGNATURE }}
diff --git a/.gitignore b/.gitignore
index a884d38..0be9a47 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
node_modules/
.env
dist/
+coverage/
+*.tgz
diff --git a/.npmignore b/.npmignore
index 74127ac..5d66a55 100644
--- a/.npmignore
+++ b/.npmignore
@@ -1,4 +1,6 @@
node_modules/
.github/
tests/
+examples/
+scripts/
.env
diff --git a/README.md b/README.md
index 18dfc3c..5e6bf75 100644
--- a/README.md
+++ b/README.md
@@ -1,121 +1,130 @@
# TradingView-API
-**Build with market data, from your first chart to a running watcher.** Fetch candles, explore indicators, and turn ideas into working tools. An independent community project, not an official TradingView API.
+**Build with market data, from your first chart to a running watcher.** Fetch candles and quotes, run indicators and strategies, and turn ideas into working tools. An independent community project, not an official TradingView API.
-[Get started](#get-started) · [Explore examples](examples) · [Read the API guide](docs/agent-api.md)
+[Get started](#get-started) · [Explore examples](examples) · [Read the data API guide](docs/data-api.md)
**Language:** English · [Français](docs/README.fr.md) · [Español](docs/README.es.md) · [Português](docs/README.pt.md)
[![Tests](https://github.com/Mathieu2301/TradingView-API/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/Mathieu2301/TradingView-API/actions/workflows/tests.yml) [![npm](https://badgen.net/npm/v/@mathieuc/tradingview)](https://www.npmjs.com/package/@mathieuc/tradingview) [![Stars](https://img.shields.io/github/stars/Mathieu2301/TradingView-API?style=social)](https://github.com/Mathieu2301/TradingView-API)
-![Recorded demonstration: fetchCandles returns 40 daily BTC/USDT candles, visualized as a line chart](assets/readme-demo.gif)
+![Recorded demonstration: a candle request returns 40 daily BTC/USDT candles, visualized as a line chart](assets/readme-demo.gif)
-*An actual `fetchCandles()` result, recorded on 2 October 2026 and visualized for this demo. Prices are not live. The high-level API shown here is a [development preview](docs/agent-api.md), available from source; the [stable npm package](https://www.npmjs.com/package/@mathieuc/tradingview) still uses the `Client` API.*
+*An actual candle request, recorded on 2 October 2026 with the development preview (`fetchCandles`, called `getCandles` in version 4) and visualized for this demo. Prices are not live.*
### One request, real data
-After [building the preview from source](#3-install-manually), try the same request:
+> **V4 beta is currently available from this repository, not from npm.** Build the source as shown below before running this example. The latest npm release is still v3 and does not export `getCandles`.
```js
-const { fetchCandles } = require('./agent.js');
+import { getCandles } from '@mathieuc/tradingview/data';
-fetchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: 'D', limit: 40 })
- .then((candles) => console.log(candles.at(-1))) // time, open, high, low, close, volume
- .catch(console.error);
+const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: 'D', count: 40 });
+console.log(candles.at(-1)); // { time, open, high, low, close, volume }
```
-Prefer to start without code? The setup paths below work for both the stable library and the preview.
+Prefer to start without code? The setup paths below work too.
-## Get started
+> **Version 4 is a breaking rewrite** in TypeScript, with a new API and no compatibility layer. Coming from v3? Read the [migration guide](docs/migration-v4.md). Every v3 feature is still available: see the [coverage matrix](docs/v4-coverage.md). npm versions 3.x keep the previous `Client` API; check the [npm page](https://www.npmjs.com/package/@mathieuc/tradingview) for the version you install.
-Choose the setup that works for you. The current npm release provides the stable `Client` API; the simpler [high-level API](docs/agent-api.md) is a **development preview available from source**, not yet in the npm package.
+## Get started
### 1. Molted.cloud — recommended, no local setup
-[Create an agent on Molted.cloud](https://molted.cloud/) and share this repository with it. Describe what you want to build; the agent can read the docs, set up a workspace, and help you get from an idea to a working project. For example, ask it to build a market-data watcher using the API that is currently available. [See an example on Molted Studio](https://molted.studio/dreams/market-watch-alerts).
+[Create an agent on Molted.cloud](https://molted.cloud/) and share this repository with it. Describe what you want to build; the agent can read the docs, set up a workspace, and help you get from an idea to a working project. For example, ask it to build a market-data watcher with this library. [See an example on Molted Studio](https://molted.studio/dreams/market-watch-alerts).
### 2. Claude Code, Codex, or another coding assistant
Open your project in your preferred coding assistant and give it the [repository link](https://github.com/Mathieu2301/TradingView-API). You can start with:
-> Read the TradingView-API README and the high-level API guide. Install the stable npm package for my project, or use the development preview from source if the high-level API is needed. Build a small example and show me how to run it.
+> Read the TradingView-API README and the data API guide. Build the V4 beta from source, make a small example that fetches candles and watches a quote, and show me how to run it.
The assistant can handle the setup, but you keep the project in your own environment.
### 3. Install manually
-For the **stable release**, add the package to your project:
-
-```bash
-bun add @mathieuc/tradingview
-# Or: npm install @mathieuc/tradingview
-```
-
-For the **high-level API preview**, clone the repository and build it from source (Bun or Node 18+):
+The V4 beta requires Node.js 20 or later, or Bun. **Until the V4 npm release, install it from source:**
```bash
git clone https://github.com/Mathieu2301/TradingView-API.git
cd TradingView-API
-bun install
-bun run build:agent
-# With npm instead: npm ci && npm run build:agent
+npm ci && npm run build
+node examples/candles.js
+# Or use Bun: bun install && bun run build && bun examples/candles.js
```
-Import `./agent.js` from that checkout; the stable npm package does not include this subpath yet. Continue with the [stable library example](#stable-library) or the [high-level API guide](docs/agent-api.md).
+Inside this built checkout, the examples and package self-imports use the V4 API. Running `npm install @mathieuc/tradingview` or `bun add @mathieuc/tradingview` in another project currently installs **v3**, which has the old `Client` API. Do not copy the V4 imports into a project that has v3 installed.
+
+The V4 package is ESM with TypeScript declarations. CommonJS projects can `require()` it on Node 20.19+ or 22.12+, or use `await import()`.
### Want to contribute?
-[Open an issue](https://github.com/Mathieu2301/TradingView-API/issues/new/choose) to discuss a feature or report a bug, or send a pull request. Questions and early ideas are welcome; you do not need a perfect reproduction to start a conversation.
+[Open an issue](https://github.com/Mathieu2301/TradingView-API/issues/new/choose) to discuss a feature or report a bug, or send a pull request. Questions and early ideas are welcome; you do not need a perfect reproduction to start a conversation. `npm run check` runs the type check, lint, tests, build and package smoke test.
-## Stable library
+## Data API
-```js
-const TradingView = require('@mathieuc/tradingview');
-const client = new TradingView.Client();
-const chart = new client.Session.Chart();
-
-chart.onError((...error) => console.error('Chart error:', ...error));
-chart.onUpdate(() => {
- const latest = chart.periods[0];
- if (latest) console.log(latest.close);
+The data API handles connections, sessions, timeouts and cleanup for you. It suits any application: scripts, servers, dashboards, bots or agents.
+
+```ts
+import {
+ getCandles, watchCandles, getQuote, getIndicatorData, searchMarkets,
+} from '@mathieuc/tradingview/data';
+
+// One-shot: resolves with complete data, then releases everything.
+const hourly = await getCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '60', count: 500 });
+const lastWeek = await getCandles({ symbol: 'NASDAQ:AAPL', timeframe: '15', from: new Date(Date.now() - 7 * 86_400_000) });
+const quote = await getQuote('BINANCE:BTCUSDT');
+const [market] = await searchMarkets('ethereum', { type: 'crypto' });
+
+// Watcher: keeps streaming until stopped.
+const watcher = await watchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '1' }, {
+ onData: (candles) => console.log(candles.at(-1)?.close),
+ onError: (error) => console.error(error.code, error.message),
});
-chart.setMarket('BINANCE:BTCUSDT', { timeframe: 'D' });
+await watcher.stop();
-// When your application is finished:
-// chart.delete();
-// await client.end();
+// Indicators and strategies (Pine scripts need an account).
+const { values } = await getIndicatorData({
+ symbol: 'BINANCE:BTCUSDT', indicator: 'STD;RSI', credentials: { session, signature },
+});
```
-The existing `Client`, chart and quote sessions, Pine indicators, replay features and [examples](examples) remain available during the migration.
+| Need | Function |
+| --- | --- |
+| Candles: latest bars, deep history, date ranges, Heikin Ashi/Renko/... | `getCandles`, `watchCandles` |
+| Quotes: last price, change, bid/ask, volume... | `getQuote`, `getQuotes`, `watchQuotes` |
+| Indicator values, drawings and strategy reports | `getIndicatorData`, `watchIndicator` |
+| Symbol metadata | `getSymbolInfo` |
+| Search and ratings | `searchMarkets`, `searchIndicators`, `getTechnicalAnalysis` |
+
+Websocket data functions accept `timeoutMs`, an `AbortSignal`, account `credentials`, and an optional shared `client`. HTTP lookups accept an `AbortSignal` through their options. Errors are `TradingViewError`s with a `code` such as `SYMBOL_ERROR`, `TIMEOUT` or `STUDY_ERROR`. Read the [data API guide](docs/data-api.md) for every option.
-## High-level API — development preview
+## Low-level API
-This first TypeScript slice offers simple data access without managing chart sessions, widgets or deep-history internals. It is useful in any application, whether you write it yourself or with an agent:
+For full control (several charts and studies on one connection, replay mode, raw packets), use the client and sessions directly:
```ts
-import { fetchCandles, watchCandles } from './agent.js';
-
-// One-shot: data arrives through a single await; the connection closes automatically.
-const candles = await fetchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: 'D', limit: 100 });
-console.log(candles.at(-1)?.close);
-
-// Worker: keeps receiving fresh snapshots until stopped.
-const worker = await watchCandles(
- { symbol: 'BINANCE:BTCUSDT', timeframe: '1' },
- { onData: (snapshot) => console.log(snapshot[snapshot.length - 1]?.close),
- onError: console.error },
-);
-// ...later:
-await worker.stop();
-```
+import { TradingViewClient, getIndicator } from '@mathieuc/tradingview';
+
+const client = new TradingViewClient({ credentials: { session, signature } }); // Credentials are optional
+const chart = client.createChart();
-Snapshots are oldest-first, with conventional `high`/`low` fields. The first usable snapshot has a timeout (15 seconds by default), and `AbortSignal` is supported. Keep credentials in your own environment; do not put them in prompts or issues.
+chart.on('update', () => console.log(chart.lastCandle?.close));
+chart.on('error', (error) => console.error(error.message));
+chart.setMarket('BINANCE:BTCUSDT', { timeframe: '60', count: 300 });
+
+const supertrend = chart.createStudy(await getIndicator('STD;Supertrend'));
+supertrend.on('update', () => console.log(supertrend.values.at(-1)));
+
+// When your application is finished:
+await client.close();
+```
-For installation from source, follow [manual setup](#3-install-manually). See the [high-level API guide](docs/agent-api.md) for error handling, lifecycle and provider adapters.
+The [low-level API reference](docs/low-level-api.md) covers charts, replay, studies, quotes, account and layout functions, Pine permissions, custom transports and protocol helpers. The [examples](examples) show each feature.
-## What is next?
+## Accounts and limits
-This repository is being modernized incrementally in TypeScript/Bun while keeping current users working. The first slice is data access; strategy research, backtesting, CLI/MCP and hosted workflows are **planned, not shipped**. Tell us which workflow would save you time in an [issue](https://github.com/Mathieu2301/TradingView-API/issues/new/choose).
+Without an account, TradingView serves limited data: shorter intraday history, no Pine studies, and possibly delayed or substitute feeds. With your `sessionid` and `sessionid_sign` cookies (`credentials`), you get what your account can access. Keep them in environment variables or a secret store; never put them in source files, issues or prompts.
## Project links
diff --git a/agent.d.ts b/agent.d.ts
deleted file mode 100644
index 6b32931..0000000
--- a/agent.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-/** https://github.com/Mathieu2301/TradingView-API
- * https://www.npmjs.com/package/@mathieuc/tradingview */
-export * from './dist/agent';
diff --git a/agent.js b/agent.js
deleted file mode 100644
index 129c101..0000000
--- a/agent.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// https://github.com/Mathieu2301/TradingView-API
-// https://www.npmjs.com/package/@mathieuc/tradingview
-module.exports = require('./dist/agent.js');
diff --git a/agent.ts b/agent.ts
deleted file mode 100644
index 94b047a..0000000
--- a/agent.ts
+++ /dev/null
@@ -1,228 +0,0 @@
-/**
- * Agent-friendly market data API.
- * https://github.com/Mathieu2301/TradingView-API
- * https://www.npmjs.com/package/@mathieuc/tradingview
- */
-
-export interface Candle {
- /** Unix timestamp in seconds. */
- time: number;
- open: number;
- high: number;
- low: number;
- close: number;
- volume: number;
-}
-
-export interface CandleQuery {
- /** Exchange-qualified symbol, for example BINANCE:BTCUSDT. */
- symbol: string;
- /** TradingView resolution, for example 1, 60, D or W. */
- timeframe?: string;
- /** Requested number of historical candles; the source may return fewer. */
- limit?: number;
- /** Maximum wait for the first usable snapshot. Default: 15 seconds. */
- timeoutMs?: number;
- signal?: AbortSignal;
-}
-
-export interface CandleWorker {
- /** Most recent immutable snapshot, oldest candle first. */
- readonly latest: readonly Candle[];
- /** Idempotently release the chart session and connection. */
- stop(): Promise<void>;
-}
-
-export interface CandleHandlers {
- onData(candles: readonly Candle[]): void;
- onError?(error: Error): void;
-}
-
-/** Adapter contract for future sources; no TradingView dependency in callers. */
-export interface MarketDataProvider {
- watchCandles(query: CandleQuery, handlers: CandleHandlers): Promise<CandleWorker>;
-}
-
-interface LegacyBar {
- time: number;
- open: number;
- max: number;
- min: number;
- close: number;
- volume: number;
-}
-
-interface LegacyChart {
- readonly periods: ReadonlyArray<LegacyBar>;
- setMarket(symbol: string, options: { timeframe?: string; range?: number }): void;
- onSymbolLoaded(callback: () => void): void;
- onUpdate(callback: () => void): void;
- onError(callback: (...messages: unknown[]) => void): void;
- delete(): void;
-}
-
-interface LegacyClient {
- Session: { Chart: new () => LegacyChart };
- onDisconnected(callback: () => void): void;
- onError(callback: (...messages: unknown[]) => void): void;
- end(): Promise<void>;
-}
-
-export interface TradingViewProviderOptions {
- /** Passed to the historical Client; credentials stay in the caller's environment. */
- clientOptions?: { token?: string; signature?: string; server?: 'data' | 'prodata' | 'widgetdata' };
- /** Useful for custom transports and isolated tests. */
- clientFactory?: (options: TradingViewProviderOptions['clientOptions']) => LegacyClient;
-}
-
-function asError(messages: unknown[]): Error {
- return new Error(messages.map((value) => (value instanceof Error ? value.message : String(value))).join(' '));
-}
-
-function validate(query: CandleQuery): void {
- if (!query.symbol?.trim()) throw new TypeError('symbol is required');
- if (query.limit !== undefined && (!Number.isInteger(query.limit) || query.limit < 1)) {
- throw new RangeError('limit must be a positive integer');
- }
- if (query.timeoutMs !== undefined && (!Number.isFinite(query.timeoutMs) || query.timeoutMs < 1)) {
- throw new RangeError('timeoutMs must be positive');
- }
-}
-
-/** TradingView transport, isolated from the provider-neutral agent API. */
-export class TradingViewProvider implements MarketDataProvider {
- private readonly options: TradingViewProviderOptions;
-
- constructor(options: TradingViewProviderOptions = {}) {
- this.options = options;
- }
-
- async watchCandles(query: CandleQuery, handlers: CandleHandlers): Promise<CandleWorker> {
- validate(query);
- if (typeof handlers?.onData !== 'function') throw new TypeError('onData must be a function');
- if (query.signal?.aborted) throw query.signal.reason ?? new Error('Aborted');
-
- // The old entry point remains untouched for existing users.
- const createClient = this.options.clientFactory ?? ((options) => {
- // Resolve from dist/ after compilation; the legacy entry stays at package root.
- // eslint-disable-next-line global-require, import/no-unresolved, import/extensions
- const { Client } = require('../main.js') as {
- Client: new (clientOptions?: TradingViewProviderOptions['clientOptions']) => LegacyClient;
- };
- return new Client(options);
- });
- const client = createClient(this.options.clientOptions);
- let chart: LegacyChart;
- try {
- chart = new client.Session.Chart();
- } catch (error) {
- await client.end();
- throw error;
- }
-
- let active = true;
- let settled = false;
- let symbolLoaded = false;
- let latest: readonly Candle[] = [];
- let timer: ReturnType<typeof setTimeout> | undefined;
- let stopPromise: Promise<void> | undefined;
- let resolveReady!: (worker: CandleWorker) => void;
- let rejectReady!: (error: Error) => void;
-
- const stop = (): Promise<void> => {
- if (stopPromise) return stopPromise;
- active = false;
- if (timer) clearTimeout(timer);
- query.signal?.removeEventListener('abort', onAbort);
- stopPromise = (async () => {
- try { chart.delete(); } finally { await client.end(); }
- })();
- return stopPromise;
- };
-
- const worker: CandleWorker = {
- get latest() { return latest; },
- stop,
- };
-
- const fail = (error: Error): void => {
- if (!active) return;
- const beforeReady = !settled;
- settled = true;
- const closing = stop();
- if (beforeReady) {
- void closing.then(() => rejectReady(error), () => rejectReady(error));
- } else {
- try { handlers.onError?.(error); } catch { /* User callback must not prevent cleanup. */ }
- void closing.catch((cleanupError) => {
- try { handlers.onError?.(asError([cleanupError])); } catch { /* Already closing. */ }
- });
- }
- };
-
- const onAbort = (): void => fail(asError([query.signal?.reason ?? 'Aborted']));
- const emit = (): void => {
- if (!active || !symbolLoaded || chart.periods.length === 0) return;
- latest = Object.freeze(chart.periods.map((bar) => Object.freeze({
- time: bar.time,
- open: bar.open,
- high: bar.max,
- low: bar.min,
- close: bar.close,
- volume: bar.volume,
- })).sort((a, b) => a.time - b.time));
- try { handlers.onData(latest); } catch (error) {
- try { handlers.onError?.(asError([error])); } catch { /* Isolate user callbacks. */ }
- }
- if (!settled) {
- settled = true;
- if (timer) clearTimeout(timer);
- resolveReady(worker);
- }
- };
-
- const ready = new Promise<CandleWorker>((resolve, reject) => {
- resolveReady = resolve;
- rejectReady = reject;
- });
-
- chart.onSymbolLoaded(() => { symbolLoaded = true; emit(); });
- chart.onUpdate(emit);
- chart.onError((...messages) => fail(asError(messages)));
- client.onError((...messages) => fail(asError(messages)));
- client.onDisconnected(() => fail(new Error('Market data connection disconnected')));
- query.signal?.addEventListener('abort', onAbort, { once: true });
- timer = setTimeout(() => fail(new Error(`Timed out waiting for ${query.symbol} candles`)), query.timeoutMs ?? 15_000);
- try {
- chart.setMarket(query.symbol, { timeframe: query.timeframe ?? 'D', range: query.limit ?? 100 });
- } catch (error) {
- fail(asError([error]));
- }
- return ready;
- }
-}
-
-/** One-shot fetch; always closes its worker after the first usable snapshot. */
-export async function fetchCandles(
- query: CandleQuery,
- provider: MarketDataProvider = new TradingViewProvider(),
-): Promise<readonly Candle[]> {
- let snapshot: readonly Candle[] = [];
- const worker = await provider.watchCandles(query, {
- onData: (candles) => { snapshot = candles; },
- });
- try {
- return snapshot;
- } finally {
- await worker.stop();
- }
-}
-
-/** Start a real-time worker; call worker.stop() when finished. */
-export function watchCandles(
- query: CandleQuery,
- handlers: CandleHandlers,
- provider: MarketDataProvider = new TradingViewProvider(),
-): Promise<CandleWorker> {
- return provider.watchCandles(query, handlers);
-}
diff --git a/docs/DOCS.md b/docs/DOCS.md
deleted file mode 100644
index 1abb87c..0000000
--- a/docs/DOCS.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Documentation
-
-### All the project is now JSDoc-ed :)
-
-[Repository](https://github.com/Mathieu2301/TradingView-API) · [npm](https://www.npmjs.com/package/@mathieuc/tradingview)
diff --git a/docs/README.es.md b/docs/README.es.md
index 89c73cc..c1bf0af 100644
--- a/docs/README.es.md
+++ b/docs/README.es.md
@@ -6,49 +6,53 @@
**Idioma:** [English](../README.md) · [Français](README.fr.md) · Español · [Português](README.pt.md)
-**Datos de mercado e indicadores para construir tus herramientas.** Empieza con un gráfico y evoluciona hacia actualizaciones en tiempo real y flujos asistidos por agentes de IA. Proyecto comunitario independiente y no oficial.
+**Datos de mercado e indicadores para construir tus herramientas.** Velas, cotizaciones, indicadores y estrategias, en una sola petición o en tiempo real. Proyecto comunitario independiente y no oficial.
> **¿Tienes un problema, una pregunta o una idea? [Abre un issue](https://github.com/Mathieu2301/TradingView-API/issues/new/choose).** No necesitas una reproducción perfecta para preguntar.
+> **La versión 4 es una reescritura completa en TypeScript**, con una nueva API y sin capa de compatibilidad. ¿Vienes de la v3? Lee la [guía de migración](migration-v4.md) (en inglés). Todas las funciones de la v3 siguen disponibles: consulta la [matriz de cobertura](v4-coverage.md). Las versiones npm 3.x mantienen la API `Client` anterior.
+
## Elige cómo empezar
-- **Biblioteca estable:** `npm install @mathieuc/tradingview` y consulta los [ejemplos](../examples).
-- **Con Claude Code, Codex, OpenClaw u otro agente:** comparte la [guía para agentes](agent-api.md) y este repositorio.
+- **Instalación de V4 beta:** clona este repositorio y ejecuta `npm ci && npm run build && node examples/candles.js` (Node.js 20+ o Bun). **npm todavía entrega V3**, no las importaciones V4 de abajo. Consulta los [ejemplos](../examples).
+- **Con Claude Code, Codex, OpenClaw u otro asistente:** comparte este repositorio y la [guía de la API de datos](data-api.md).
- **Sin instalación local:** [Molted](https://molted.cloud/) ofrece un espacio de trabajo con agente alojado que puede trabajar desde este repositorio. Es opcional.
-La nueva API para agentes es una **versión preliminar de desarrollo**: todavía no está publicada en npm.
+## API de datos
+
+```ts
+import { getCandles, watchCandles, getQuote } from '@mathieuc/tradingview/data';
-## API actual
+const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: 'D', count: 100 });
+console.log(candles.at(-1)); // { time, open, high, low, close, volume }, de la más antigua a la más reciente
-```js
-const TradingView = require('@mathieuc/tradingview');
-const client = new TradingView.Client();
-const chart = new client.Session.Chart();
-chart.onError((...error) => console.error(error));
-chart.onUpdate(() => console.log(chart.periods[0]?.close));
-chart.setMarket('BINANCE:BTCUSDT', { timeframe: 'D' });
-// Al terminar: chart.delete(); await client.end();
+const quote = await getQuote('BINANCE:BTCUSDT');
+
+const watcher = await watchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '1' }, {
+ onData: (snapshot) => console.log(snapshot.at(-1)?.close),
+ onError: console.error,
+});
+await watcher.stop();
```
-La API histórica, los indicadores y los ejemplos siguen disponibles durante la migración.
+Cada función gestiona la conexión, el tiempo máximo (`timeoutMs`), la cancelación (`signal`) y la limpieza. Otras funciones: `getQuotes`, `watchQuotes`, `getSymbolInfo`, `getIndicatorData`, `watchIndicator`, `searchMarkets`, `searchIndicators`, `getTechnicalAnalysis`. Detalles: [guía de la API de datos](data-api.md).
-## API para agentes — versión preliminar
+## API de bajo nivel
```ts
-import { fetchCandles, watchCandles } from '@mathieuc/tradingview/agent';
-
-const candles = await fetchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: 'D', limit: 100 });
-const worker = await watchCandles(
- { symbol: 'BINANCE:BTCUSDT', timeframe: '1' },
- { onData: (snapshot) => console.log(snapshot[snapshot.length - 1]), onError: console.error },
-);
-await worker.stop();
+import { TradingViewClient } from '@mathieuc/tradingview';
+
+const client = new TradingViewClient();
+const chart = client.createChart();
+chart.on('update', () => console.log(chart.lastCandle?.close));
+chart.setMarket('BINANCE:BTCUSDT', { timeframe: 'D' });
+// Al terminar: await client.close();
```
-Para probarla **desde el código fuente** (Node 18+ o Bun): `git clone https://github.com/Mathieu2301/TradingView-API.git`, luego `npm ci && npm run build:agent`, e importa `./agent.js` . La ruta de importación de npm anterior solo funcionará tras publicar la próxima versión. Más detalles en la [guía para agentes](agent-api.md).
+Gráficos, modo replay, estudios Pine e integrados, cotizaciones, cuentas, dibujos y permisos Pine: consulta la [referencia de bajo nivel](low-level-api.md) y los [ejemplos](../examples).
-La modernización TypeScript/Bun es gradual. Investigación de estrategias, backtesting, CLI/MCP y flujos alojados están **previstos, no disponibles aún**. [Cuéntanos qué necesitas](https://github.com/Mathieu2301/TradingView-API/issues/new/choose).
+Sin cuenta, TradingView limita los datos (menos historial intradía, sin indicadores Pine). Con tus cookies `sessionid` y `sessionid_sign` (`credentials`), accedes a lo que permite tu cuenta. Guárdalas en variables de entorno, nunca en el código, issues o prompts.
[Repositorio GitHub](https://github.com/Mathieu2301/TradingView-API) · [Paquete npm](https://www.npmjs.com/package/@mathieuc/tradingview) · [Issues](https://github.com/Mathieu2301/TradingView-API/issues/new/choose)
-TradingView es una marca de su propietario. Este proyecto no está afiliado ni respaldado por TradingView. Comprueba los términos y permisos de datos de tu proveedor.
+TradingView es una marca de su propietario. Este proyecto no está afiliado ni respaldado por TradingView. Revisa los términos y permisos de datos de tu proveedor.
diff --git a/docs/README.fr.md b/docs/README.fr.md
index 150734d..e721ee6 100644
--- a/docs/README.fr.md
+++ b/docs/README.fr.md
@@ -6,48 +6,52 @@
**Langue :** [English](../README.md) · Français · [Español](README.es.md) · [Português](README.pt.md)
-**Des données de marché et des indicateurs pour construire vos outils.** Commencez avec un graphique, puis passez aux mises à jour temps réel et aux workflows assistés par agent IA. Projet communautaire indépendant, non officiel.
+**Des données de marché et des indicateurs pour construire vos outils.** Bougies, cotations, indicateurs et stratégies, en une requête ou en temps réel. Projet communautaire indépendant, non officiel.
> **Un problème, une question ou une idée ? [Ouvrez une issue](https://github.com/Mathieu2301/TradingView-API/issues/new/choose).** Pas besoin d'avoir déjà une reproduction parfaite.
+> **La version 4 est une réécriture complète en TypeScript**, avec une nouvelle API et sans couche de compatibilité. Vous venez de la v3 ? Lisez le [guide de migration](migration-v4.md) (en anglais). Toutes les fonctionnalités de la v3 restent disponibles : voir la [matrice de couverture](v4-coverage.md). Les versions npm 3.x gardent l'ancienne API `Client`.
+
## Choisissez votre parcours
-- **Librairie stable aujourd'hui :** `npm install @mathieuc/tradingview` puis consultez les [exemples](../examples).
-- **Avec Claude Code, Codex, OpenClaw ou un autre agent :** donnez-lui le [guide agentique](agent-api.md) et ce dépôt.
+- **Installation de la V4 bêta :** clonez ce dépôt, puis lancez `npm ci && npm run build && node examples/candles.js` (Node.js 20+ ou Bun). **npm fournit encore la V3**, pas les imports V4 ci-dessous. Consultez les [exemples](../examples).
+- **Avec Claude Code, Codex, OpenClaw ou un autre assistant :** donnez-lui ce dépôt et le [guide de l'API de données](data-api.md).
- **Sans installation locale :** [Molted](https://molted.cloud/) propose un espace d'agent hébergé pouvant travailler à partir de ce dépôt. Ce choix est facultatif.
-La nouvelle API agentique est **en préversion de développement** : elle n'est pas encore publiée sur npm.
+## API de données
+
+```ts
+import { getCandles, watchCandles, getQuote } from '@mathieuc/tradingview/data';
-## API actuelle
+const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: 'D', count: 100 });
+console.log(candles.at(-1)); // { time, open, high, low, close, volume }, du plus ancien au plus récent
-```js
-const TradingView = require('@mathieuc/tradingview');
-const client = new TradingView.Client();
-const chart = new client.Session.Chart();
-chart.onError((...error) => console.error(error));
-chart.onUpdate(() => console.log(chart.periods[0]?.close));
-chart.setMarket('BINANCE:BTCUSDT', { timeframe: 'D' });
-// À la fin : chart.delete(); await client.end();
+const quote = await getQuote('BINANCE:BTCUSDT');
+
+const watcher = await watchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '1' }, {
+ onData: (snapshot) => console.log(snapshot.at(-1)?.close),
+ onError: console.error,
+});
+await watcher.stop();
```
-L'API historique, les indicateurs et les exemples restent disponibles pendant la migration.
+Chaque fonction gère la connexion, le délai maximal (`timeoutMs`), l'annulation (`signal`) et le nettoyage. Autres fonctions : `getQuotes`, `watchQuotes`, `getSymbolInfo`, `getIndicatorData`, `watchIndicator`, `searchMarkets`, `searchIndicators`, `getTechnicalAnalysis`. Détails : [guide de l'API de données](data-api.md).
-## API pour agents — préversion
+## API bas niveau
```ts
-import { fetchCandles, watchCandles } from '@mathieuc/tradingview/agent';
-
-const candles = await fetchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: 'D', limit: 100 });
-const worker = await watchCandles(
- { symbol: 'BINANCE:BTCUSDT', timeframe: '1' },
- { onData: (snapshot) => console.log(snapshot[snapshot.length - 1]), onError: console.error },
-);
-await worker.stop();
+import { TradingViewClient } from '@mathieuc/tradingview';
+
+const client = new TradingViewClient();
+const chart = client.createChart();
+chart.on('update', () => console.log(chart.lastCandle?.close));
+chart.setMarket('BINANCE:BTCUSDT', { timeframe: 'D' });
+// À la fin : await client.close();
```
-Pour l'essayer **depuis le code source** (Node 18+ ou Bun) : `git clone https://github.com/Mathieu2301/TradingView-API.git`, puis `npm ci && npm run build:agent`, et importez `./agent.js` . Le sous-chemin npm ci-dessus ne sera disponible qu'après publication de la prochaine version. Détails : [guide agentique](agent-api.md).
+Graphiques, mode replay, études Pine et intégrées, cotations, comptes, dessins et permissions Pine : voir la [référence bas niveau](low-level-api.md) et les [exemples](../examples).
-La modernisation TypeScript/Bun est progressive. Recherche de stratégies, backtests, CLI/MCP et workflows hébergés sont **prévus, pas encore livrés**. [Dites-nous ce dont vous avez besoin](https://github.com/Mathieu2301/TradingView-API/issues/new/choose).
+Sans compte, TradingView limite les données (historique intraday réduit, pas d'indicateurs Pine). Avec vos cookies `sessionid` et `sessionid_sign` (`credentials`), vous accédez à ce que permet votre compte. Gardez-les dans des variables d'environnement, jamais dans le code, les issues ou les prompts.
[Dépôt GitHub](https://github.com/Mathieu2301/TradingView-API) · [Package npm](https://www.npmjs.com/package/@mathieuc/tradingview) · [Issues](https://github.com/Mathieu2301/TradingView-API/issues/new/choose)
diff --git a/docs/README.pt.md b/docs/README.pt.md
index 9ad7b47..9612faa 100644
--- a/docs/README.pt.md
+++ b/docs/README.pt.md
@@ -6,49 +6,53 @@
**Idioma:** [English](../README.md) · [Français](README.fr.md) · [Español](README.es.md) · Português
-**Dados de mercado e indicadores para criar suas ferramentas.** Comece com um gráfico e avance para atualizações em tempo real e fluxos assistidos por agentes de IA. Projeto comunitário independente e não oficial.
+**Dados de mercado e indicadores para construir suas ferramentas.** Candles, cotações, indicadores e estratégias, em uma única requisição ou em tempo real. Projeto comunitário independente e não oficial.
-> **Encontrou um problema, tem uma dúvida ou uma ideia? [Abra uma issue](https://github.com/Mathieu2301/TradingView-API/issues/new/choose).** Não é preciso ter uma reprodução perfeita para perguntar.
+> **Tem um problema, uma dúvida ou uma ideia? [Abra uma issue](https://github.com/Mathieu2301/TradingView-API/issues/new/choose).** Não é preciso ter uma reprodução perfeita para perguntar.
-## Escolha por onde começar
+> **A versão 4 é uma reescrita completa em TypeScript**, com uma nova API e sem camada de compatibilidade. Vindo da v3? Leia o [guia de migração](migration-v4.md) (em inglês). Todos os recursos da v3 continuam disponíveis: veja a [matriz de cobertura](v4-coverage.md). As versões npm 3.x mantêm a API `Client` anterior.
-- **Biblioteca estável:** `npm install @mathieuc/tradingview` e veja os [exemplos](../examples).
-- **Com Claude Code, Codex, OpenClaw ou outro agente:** compartilhe o [guia para agentes](agent-api.md) e este repositório.
-- **Sem instalação local:** [Molted](https://molted.cloud/) oferece um espaço de trabalho com agente hospedado que pode trabalhar a partir deste repositório. É opcional.
+## Escolha como começar
-A nova API para agentes está em **prévia de desenvolvimento**: ainda não foi publicada no npm.
+- **Instalação da V4 beta:** clone este repositório e execute `npm ci && npm run build && node examples/candles.js` (Node.js 20+ ou Bun). **O npm ainda entrega a V3**, não os imports V4 abaixo. Consulte os [exemplos](../examples).
+- **Com Claude Code, Codex, OpenClaw ou outro assistente:** compartilhe este repositório e o [guia da API de dados](data-api.md).
+- **Sem instalação local:** o [Molted](https://molted.cloud/) oferece um espaço de agente hospedado que pode trabalhar a partir deste repositório. É opcional.
-## API atual
+## API de dados
-```js
-const TradingView = require('@mathieuc/tradingview');
-const client = new TradingView.Client();
-const chart = new client.Session.Chart();
-chart.onError((...error) => console.error(error));
-chart.onUpdate(() => console.log(chart.periods[0]?.close));
-chart.setMarket('BINANCE:BTCUSDT', { timeframe: 'D' });
-// Ao terminar: chart.delete(); await client.end();
+```ts
+import { getCandles, watchCandles, getQuote } from '@mathieuc/tradingview/data';
+
+const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: 'D', count: 100 });
+console.log(candles.at(-1)); // { time, open, high, low, close, volume }, do mais antigo ao mais recente
+
+const quote = await getQuote('BINANCE:BTCUSDT');
+
+const watcher = await watchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '1' }, {
+ onData: (snapshot) => console.log(snapshot.at(-1)?.close),
+ onError: console.error,
+});
+await watcher.stop();
```
-A API histórica, os indicadores e os exemplos continuam disponíveis durante a migração.
+Cada função cuida da conexão, do tempo máximo (`timeoutMs`), do cancelamento (`signal`) e da limpeza. Outras funções: `getQuotes`, `watchQuotes`, `getSymbolInfo`, `getIndicatorData`, `watchIndicator`, `searchMarkets`, `searchIndicators`, `getTechnicalAnalysis`. Detalhes: [guia da API de dados](data-api.md).
-## API para agentes — prévia
+## API de baixo nível
```ts
-import { fetchCandles, watchCandles } from '@mathieuc/tradingview/agent';
-
-const candles = await fetchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: 'D', limit: 100 });
-const worker = await watchCandles(
- { symbol: 'BINANCE:BTCUSDT', timeframe: '1' },
- { onData: (snapshot) => console.log(snapshot[snapshot.length - 1]), onError: console.error },
-);
-await worker.stop();
+import { TradingViewClient } from '@mathieuc/tradingview';
+
+const client = new TradingViewClient();
+const chart = client.createChart();
+chart.on('update', () => console.log(chart.lastCandle?.close));
+chart.setMarket('BINANCE:BTCUSDT', { timeframe: 'D' });
+// Ao terminar: await client.close();
```
-Para testar **a partir do código-fonte** (Node 18+ ou Bun): `git clone https://github.com/Mathieu2301/TradingView-API.git`, depois `npm ci && npm run build:agent`, e importe `./agent.js` . O caminho npm acima só estará disponível após a próxima publicação. Mais detalhes no [guia para agentes](agent-api.md).
+Gráficos, modo replay, estudos Pine e integrados, cotações, contas, desenhos e permissões Pine: veja a [referência de baixo nível](low-level-api.md) e os [exemplos](../examples).
-A modernização TypeScript/Bun é gradual. Pesquisa de estratégias, backtests, CLI/MCP e fluxos hospedados estão **planejados, ainda não disponíveis**. [Conte o que você precisa](https://github.com/Mathieu2301/TradingView-API/issues/new/choose).
+Sem conta, o TradingView limita os dados (menos histórico intraday, sem indicadores Pine). Com seus cookies `sessionid` e `sessionid_sign` (`credentials`), você acessa o que sua conta permite. Guarde-os em variáveis de ambiente, nunca no código, em issues ou prompts.
[Repositório GitHub](https://github.com/Mathieu2301/TradingView-API) · [Pacote npm](https://www.npmjs.com/package/@mathieuc/tradingview) · [Issues](https://github.com/Mathieu2301/TradingView-API/issues/new/choose)
-TradingView é uma marca de seu proprietário. Este projeto não é afiliado nem endossado pela TradingView. Verifique os termos e direitos sobre os dados do seu provedor.
+TradingView é uma marca do seu proprietário. Este projeto não é afiliado nem endossado pelo TradingView. Verifique os termos e permissões de dados do seu provedor.
diff --git a/docs/agent-api.md b/docs/agent-api.md
deleted file mode 100644
index 56f8397..0000000
--- a/docs/agent-api.md
+++ /dev/null
@@ -1,55 +0,0 @@
-# High-level API guide (development preview)
-
-[Repository](https://github.com/Mathieu2301/TradingView-API) · [npm package](https://www.npmjs.com/package/@mathieuc/tradingview) · [Open an issue](https://github.com/Mathieu2301/TradingView-API/issues/new/choose)
-
-This is a **development preview** of a simpler data-access layer for any application, not an agent-only interface. It hides chart-session lifecycle and other low-level TradingView details. The temporary `/agent` subpath and `build:agent` script names predate the planned TypeScript/Bun redesign and do not define the final syntax. Build it from source with `npm ci && npm run build:agent`; the current npm release does not include `@mathieuc/tradingview/agent` yet. The historic `require('@mathieuc/tradingview')` API is unchanged.
-
-## One-shot
-
-```ts
-import { fetchCandles } from './agent.js';
-
-const controller = new AbortController();
-const candles = await fetchCandles({
- symbol: 'BINANCE:BTCUSDT',
- timeframe: 'D',
- limit: 100,
- timeoutMs: 15_000,
- signal: controller.signal,
-});
-```
-
-`fetchCandles` returns a chronological array of `{time, open, high, low, close, volume}`. `time` is a Unix timestamp in seconds. It closes the underlying chart session and connection even after a failed first fetch.
-
-## Realtime worker
-
-```ts
-import { watchCandles } from './agent.js';
-
-const worker = await watchCandles(
- { symbol: 'BINANCE:BTCUSDT', timeframe: '1' },
- {
- onData(snapshot) {
- console.log(snapshot[snapshot.length - 1]);
- },
- onError(error) {
- console.error(error);
- },
- },
-);
-
-try {
- // Keep doing work; each update brings a fresh full snapshot.
- console.log(worker.latest);
-} finally {
- await worker.stop(); // Safe to call more than once.
-}
-```
-
-`watchCandles` resolves after the first nonempty snapshot, then continues delivering snapshots. It rejects on initial timeout, chart/client error or disconnect. After startup, errors go to `onError`; the worker closes itself on transport failure. Abort with `signal` or call `stop()` to release resources.
-
-## Providers
-
-`MarketDataProvider` is a small adapter contract. `TradingViewProvider` is the first implementation. Applications can inject another provider into `fetchCandles(query, provider)` or `watchCandles(query, handlers, provider)` without changing their callers. The same interface makes isolated tests possible without network traffic.
-
-Use only accounts and data sources for which you have the necessary permissions. Never paste session cookies or API keys into issues, source files, or agent instructions.
diff --git a/docs/data-api.md b/docs/data-api.md
new file mode 100644
index 0000000..b535161
--- /dev/null
+++ b/docs/data-api.md
@@ -0,0 +1,229 @@
+# Data API guide
+
+[README](../README.md) · [Low-level API](low-level-api.md) · [Migrating from v3](migration-v4.md) · [Examples](../examples)
+
+**V4 beta is currently available from this repository only; the latest npm release is still v3.** Build this checkout before running the examples below.
+
+The data API is the simplest way to use this library, in any application. Each function opens what it needs, waits for complete data, and releases every websocket session (and the connection it opened) before returning, including on errors, timeouts and cancellation.
+
+```ts
+import { getCandles, watchQuotes } from '@mathieuc/tradingview/data';
+```
+
+Everything here is also exported from the root entry (`@mathieuc/tradingview`).
+
+| Function | Returns |
+| --- | --- |
+| `getCandles(query)` | Candles, oldest first |
+| `watchCandles(query, handlers)` | A watcher streaming candle snapshots |
+| `getQuote(query)` / `getQuotes(query)` | Current quote(s) |
+| `watchQuotes(query, handlers)` | A watcher streaming quotes |
+| `getSymbolInfo(query)` | Symbol metadata (exchange, currency, session...) |
+| `getIndicatorData(query)` | Indicator values, drawings and strategy report |
+| `watchIndicator(query, handlers)` | A watcher streaming indicator results |
+| `searchMarkets(text, options?)` | Markets matching a text |
+| `searchIndicators(text, options?)` | Built-in and community indicators |
+| `getTechnicalAnalysis(symbol, options?)` | TradingView technical ratings |
+
+## Candles
+
+```ts
+const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '60', count: 500 });
+const last = candles.at(-1); // { time, open, high, low, close, volume }
+```
+
+`time` is the bar open time in Unix **seconds**. `getCandles('BINANCE:BTCUSDT')` is a shorthand for 100 daily candles.
+
+| Option | Default | Description |
+| --- | --- | --- |
+| `symbol` | required | Exchange-qualified symbol: `BINANCE:BTCUSDT`, `NASDAQ:AAPL`, `FX:EURUSD`... Use `searchMarkets` to find one. |
+| `timeframe` | `'D'` | `1`, `5`, `15`, `60`, `240` (minutes), `D`, `W`, `M`, `1S` (seconds)... |
+| `count` | `100` | Number of most recent bars. Larger counts are loaded in batches automatically (deep history). |
+| `from` | | `Date` or Unix seconds. Loads every bar from this time (deep history); `count` is then ignored. |
+| `to` | now | `Date` or Unix seconds: newest bar time. |
+| `maxCount` | `20000` | Safety cap for `from` ranges. |
+| `chartType` | | `HeikinAshi`, `Renko`, `LineBreak`, `Kagi`, `PointAndFigure` or `Range`. |
+| `chartInputs` | | Inputs for `chartType`, e.g. `{ boxSize: 3, style: 'ATR', atrLength: 14 }`. |
+| `currency` | | Convert prices, e.g. `EUR`. |
+| `session` | | `regular` or `extended`. |
+| `adjustment` | `'splits'` | `splits`, `dividends` or `none`. |
+| `backAdjustment` | | Back-adjust continuous futures. |
+| `timezone` | | Chart timezone (affects daily and longer bar alignment). |
+| `credentials`, `client`, `clientOptions`, `timeoutMs`, `signal` | | See [Connections, timeouts and cancellation](#connections-timeouts-and-cancellation). |
+
+History stops early, without error, when the server has no more bars (`series_completed` reports `data_completed: "end"` or `"limit"`). Anonymous access is limited: in our tests, about 7 000 one-minute bars, and reference times (`to`) in the past were capped. An empty result rejects with `NO_DATA`; when the server reported a limit, the message says so.
+
+## Watching candles
+
+```ts
+const watcher = await watchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '1', count: 50 }, {
+ onData(candles) {
+ console.log(candles.at(-1)?.close);
+ },
+ onError(error) {
+ console.error(error.code, error.message);
+ },
+});
+
+// ...later
+await watcher.stop(); // Idempotent
+```
+
+- The promise resolves once the initial history is loaded; `onData` has already received it.
+- Each snapshot is a frozen array of the `count` most recent bars, oldest first.
+- `watcher.latest` holds the last snapshot, `watcher.symbolInfo` the symbol metadata.
+- `watcher.closed` resolves when the watcher stops: after `stop()`, an aborted `signal`, or a fatal error.
+- Errors before start-up reject the promise. Afterwards they go to `onError`; fatal ones (disconnection, symbol or series errors) also stop the watcher. There is no automatic reconnection: start a new watcher when `closed` resolves if you need one.
+
+`watchCandles` accepts the same chart options as `getCandles`, except `from`, `to` and `maxCount`.
+
+## Quotes
+
+```ts
+const quote = await getQuote('BINANCE:BTCUSDT');
+console.log(quote.lp, quote.chp); // Last price, change in percent
+
+const quotes = await getQuotes({ symbols: ['NASDAQ:AAPL', 'FX:EURUSD'], fields: 'price' });
+console.log(quotes['NASDAQ:AAPL'].lp);
+```
+
+| Option | Default | Description |
+| --- | --- | --- |
+| `symbol` / `symbols` | required | One symbol, or a non-empty list (duplicates are ignored). |
+| `fields` | `'all'` | `all`, `price` (`lp` only), or a list such as `['lp', 'bid', 'ask', 'volume']`. |
+| `session` | `'regular'` | `regular` or `extended`. |
+
+A quote contains the fields TradingView sent: `lp`, `lp_time`, `ch`, `chp`, `bid`, `ask`, `volume`, `open_price`, `high_price`, `low_price`, `prev_close_price`, `description`, `currency_code`... An unknown symbol rejects with `QUOTE_ERROR`.
+
+```ts
+const watcher = await watchQuotes({ symbols: ['BINANCE:BTCUSDT', 'BINANCE:ETHUSDT'] }, {
+ onData(symbol, quote, changes) {
+ console.log(symbol, quote.lp, changes);
+ },
+ onError: console.error,
+});
+console.log(watcher.latest); // Latest quote per symbol
+await watcher.stop();
+```
+
+`watchQuotes` resolves once every symbol has loaded or failed. Failing symbols are reported to `onError` and the others keep streaming; if all fail, the promise rejects.
+
+## Symbol information
+
+```ts
+const info = await getSymbolInfo('NASDAQ:AAPL');
+console.log(info.description, info.currency_code, info.timezone, info.session, info.pricescale);
+```
+
+Anonymous sessions may be served by a substitute feed: for `NASDAQ:AAPL`, `full_name` can be `BATS:AAPL` while `pro_name` stays `NASDAQ:AAPL`.
+
+## Indicators and strategies
+
+```ts
+const rsi = await getIndicatorData({
+ symbol: 'BINANCE:BTCEUR',
+ timeframe: '60',
+ indicator: 'STD;RSI',
+ inputs: { Length: 21 },
+ credentials, // Pine scripts need an account
+});
+console.log(rsi.values.at(-1)); // { $time, RSI: 54.2, ... }
+```
+
+`indicator` accepts:
+
+- a script ID: `STD;RSI` (built-in Pine), `PUB;xxxx` (community), `USER;xxxx` (private); use `searchIndicators` to find IDs, and `version` to pin a version;
+- a built-in study type: `Volume@tv-basicstudies-241`, `VbPFixed@tv-basicstudies-241!`... (works without an account);
+- a `PineIndicator` or `BuiltInIndicator` instance (it is copied, never modified).
+
+`inputs` sets Pine inputs (by input ID `in_0`, number, inline name or internal ID, with type and option validation) or built-in options.
+
+The result contains:
+
+| Field | Description |
+| --- | --- |
+| `indicator` | The indicator definition used. |
+| `candles` | Chart bars, oldest first. |
+| `values` | One row per bar: `$time` plus one key per plot (unnamed or duplicate plots are `plot_N`). The server may compute a few rows before the first returned candle. |
+| `graphics` | Drawings: `labels`, `lines`, `boxes`, `tables` (with `cells`), `polygons`, `horizLines`, `horizHists`, and `raw`. X positions are bars back from the latest loaded bar. |
+| `strategyReport` | For Pine strategies: `performance`, `trades` (most recent first), `history` (equity, drawdown, buy & hold), `currency`, `settings`. Empty for studies. |
+
+Without an account, TradingView refuses Pine studies ("maximum number of studies per chart"): the call rejects with `STUDY_ERROR`. Built-in studies work.
+
+`watchIndicator(query, { onData, onError })` streams the same result on every study update; `watcher.latest` holds the last one.
+
+## Search and technical analysis
+
+```ts
+const markets = await searchMarkets('BINANCE:BTC', { type: 'crypto' });
+// [{ id: 'BINANCE:BTCUSDT', exchange, fullExchange, symbol, description, type, currency, country }, ...]
+
+const indicators = await searchIndicators('RSI');
+// [{ id: 'STD;RSI', version, name, author, image, source, type, access }, ...]
+
+const ratings = await getTechnicalAnalysis('BINANCE:BTCUSDT');
+// { '1': { All, MA, Other }, '5': ..., '1D': ..., '1W': ..., '1M': ... } or null
+```
+
+`searchMarkets` options: `type` (`stock`, `crypto`, `forex`, `futures`, `index`, `cfd`, `economic`...), `exchange`, `offset` (pagination). Ratings range from -2 (strong sell) to 2 (strong buy).
+
+## Connections, timeouts and cancellation
+
+Websocket data functions accept:
+
+| Option | Description |
+| --- | --- |
+| `timeoutMs` | Default 15 000. One-shot functions: whole call. Watchers: until start-up. Rejects with `TIMEOUT`. Raise it for deep history. |
+| `signal` | An `AbortSignal`. Aborting rejects with `ABORTED` (or stops a running watcher). |
+| `credentials` | `{ session, signature }`: your `sessionid` and `sessionid_sign` cookies, for data your account can access. |
+| `clientOptions` | Options for the connection opened by the call (`server`, `transport`, `debug`, `fetch`...). |
+| `client` | Reuse an open `TradingViewClient`. The call only removes its own sessions and leaves the connection open. Useful for many calls in a row. |
+
+```ts
+import { TradingViewClient, getCandles, getQuote } from '@mathieuc/tradingview';
+
+const client = new TradingViewClient({ credentials });
+try {
+ const [candles, quote] = await Promise.all([
+ getCandles({ symbol: 'BINANCE:BTCUSDT', client }),
+ getQuote({ symbol: 'BINANCE:BTCUSDT', client }),
+ ]);
+} finally {
+ await client.close();
+}
+```
+
+Keep credentials in environment variables or a secret store; never put them in source files, issues or prompts.
+
+## Alternate candle providers
+
+The V4 data API remains usable with a source other than TradingView. Implement `MarketDataProvider.watchCandles(query, handlers)`; its worker exposes `latest` and an idempotent `stop()`. Pass the provider to `getCandles(query, provider)` for a one-shot snapshot or `watchCandles(query, handlers, provider)` for streaming. The provider controls its own network access and must resolve only after its first usable snapshot.
+
+```ts
+import { getCandles, type MarketDataProvider } from '@mathieuc/tradingview/data';
+
+declare const myProvider: MarketDataProvider;
+const candles = await getCandles({ symbol: 'CUSTOM:ASSET' }, myProvider);
+```
+
+`TradingViewProvider` implements the same contract and can carry default connection options. The regular `getCandles(query)` and `watchCandles(query, handlers)` calls use TradingView directly, so no provider setup is needed.
+
+## Errors
+
+Every failure is a `TradingViewError` with a `code`:
+
+| Code | Meaning |
+| --- | --- |
+| `INVALID_ARGUMENT` | Invalid query (checked before connecting). |
+| `SYMBOL_ERROR` | Unknown symbol. |
+| `SERIES_ERROR` | Bars refused (for example a chart type or timeframe your account cannot use). |
+| `CRITICAL_ERROR` | Command refused (invalid timeframe, timezone...). |
+| `STUDY_ERROR` | Indicator failed or not allowed. |
+| `QUOTE_ERROR` | Quote refused for a symbol. |
+| `NO_DATA` | No bars in the requested range. |
+| `AUTH_ERROR` | Credentials rejected. |
+| `NOT_FOUND` | Unknown indicator, layout... |
+| `TIMEOUT`, `ABORTED`, `DISCONNECTED`, `CONNECTION_ERROR`, `PROTOCOL_ERROR`, `HTTP_ERROR`, `PARSE_ERROR` | Transport and decoding failures. |
+| `CALLBACK_ERROR` | A watcher callback threw; the stream remains active. |
+
+`error.details` keeps the raw server payload when there is one.
diff --git a/docs/low-level-api.md b/docs/low-level-api.md
new file mode 100644
index 0000000..1aadce4
--- /dev/null
+++ b/docs/low-level-api.md
@@ -0,0 +1,213 @@
+# Low-level API
+
+[README](../README.md) · [Data API](data-api.md) · [Migrating from v3](migration-v4.md) · [Examples](../examples)
+
+Use the low-level API when you need full control: several charts and studies on one connection, replay mode, raw protocol access, or long-lived sessions you manage yourself. The [data API](data-api.md) is built on it.
+
+```ts
+import { TradingViewClient, BuiltInIndicator, getIndicator } from '@mathieuc/tradingview';
+```
+
+## Events
+
+Clients, charts, studies, quote sessions and quote subscriptions share one typed event API:
+
+```ts
+const off = emitter.on('update', (changes) => {}); // Returns an unsubscribe function
+emitter.once('symbolLoaded', (info) => {});
+emitter.off('update', listener);
+emitter.onAny((event, ...args) => {}); // Every event
+```
+
+An `error` event without any listener is written to `console.error`. A throwing listener never breaks the protocol state: its exception is re-thrown asynchronously.
+
+## Client
+
+```ts
+const client = new TradingViewClient({
+ credentials: { session: process.env.SESSION, signature: process.env.SIGNATURE }, // Optional
+});
+await client.ready; // Optional: packets are queued until the connection is ready
+// ...
+await client.close();
+```
+
+| Option | Description |
+| --- | --- |
+| `credentials` | `sessionid` / `sessionid_sign` cookies. The client loads the account (`getUser`) to get the websocket auth token. Without credentials, the session is anonymous. |
+| `authToken` | Websocket auth token (`User.authToken`), to skip the account lookup. |
+| `location` | Page used for the account lookup, e.g. `https://fr.tradingview.com/`. |
+| `server` | `data` (default), `prodata` (paid accounts) or `widgetdata`. |
+| `headers` | Extra websocket headers. |
+| `debug` | `true` logs traffic with `console.log`; a function receives log arguments. |
+| `transport` | Custom websocket transport (proxy, other library, tests). See [Transport](#transport). |
+| `fetch` | Custom `fetch` for the account lookup. |
+| `connectTimeoutMs` | Time allowed to open and authenticate. Default 20 000. |
+
+| Member | Description |
+| --- | --- |
+| `ready` | Promise resolved once the auth token is sent; rejects on credential, connection or timeout failure. |
+| `isOpen`, `isAuthenticated`, `isClosed` | State. |
+| `serverInfo` | Server greeting (`session_id`, `release`, `protocol`...). |
+| `createChart()` | New `ChartSession`. |
+| `createQuoteSession(options)` | New `QuoteSession`. |
+| `send(method, params)` | Sends a raw packet (escape hatch for commands this library does not wrap). |
+| `close()` | Closes the connection; resolves once closed. Sessions are released without errors. |
+
+Events: `open`, `hello` (server greeting), `ready`, `heartbeat` (answered automatically), `packet` (packets addressed to no session), `close` (code, reason), `error`.
+
+If the connection drops unexpectedly, every chart, study and quote subscription emits a `DISCONNECTED` error. The client does not reconnect automatically: create a new client.
+
+## Charts
+
+```ts
+const chart = client.createChart();
+chart.on('symbolLoaded', (info) => console.log(info.description));
+chart.on('update', (changes) => console.log(chart.lastCandle));
+chart.on('error', (error) => console.error(error.code, error.message));
+
+chart.setMarket('BINANCE:BTCEUR', { timeframe: '60', count: 300 });
+```
+
+`setMarket(symbol, options)`:
+
+| Option | Description |
+| --- | --- |
+| `timeframe` | Default `D`. |
+| `count` | Bars to load when the series is created (default 100). **Negative** values load bars *after* `to` instead of before it. |
+| `to` | Reference time (Unix seconds) of the last bar. Sent as `['bar_count', to, count]`. |
+| `adjustment`, `backAdjustment`, `session`, `currency` | As in the data API. |
+| `type`, `inputs` | Custom chart type (`HeikinAshi`, `Renko`, `LineBreak`, `Kagi`, `PointAndFigure`, `Range`) and its inputs. |
+| `replay` | Start replay mode at this Unix time. See [Replay](#replay). |
+
+The first `setMarket` creates the series. Later calls (another symbol, type or replay) modify it and keep its bar count and studies: TradingView only accepts an empty range when modifying a series. Use `fetchMore` or a new chart to load a different amount.
+
+| Member | Description |
+| --- | --- |
+| `candles` | Loaded bars, oldest first: `{ time, open, high, low, close, volume }`. |
+| `lastCandle` | Most recent bar. |
+| `symbolInfo` | Symbol metadata from `symbol_resolved` (with `series_id`). |
+| `timeframe`, `seriesId`, `isReplay`, `isDeleted`, `studies` | State. |
+| `setTimeframe(timeframe)` | Changes the timeframe (keeps studies). Throws `INVALID_STATE` before `setMarket`. |
+| `setTimezone(timezone)` | Changes the chart timezone. |
+| `fetchMore(count)` | Loads older bars (negative: newer bars after a past `to`). |
+| `createStudy(indicator)` | Adds a study. |
+| `delete()` | Deletes the chart and its replay session. Idempotent. |
+
+Events: `symbolLoaded` (info), `update` (list of changed keys: `$prices` and/or study IDs), `seriesLoading`, `seriesCompleted` (`{ status, dataCompleted, turnaround }`: `dataCompleted` is `end` or `limit` when no more history can be loaded), `error`, and the replay events.
+
+### Replay
+
+```ts
+chart.setMarket('BINANCE:BTCEUR', { timeframe: 'D', replay: Math.round(Date.now() / 1000) - 86_400 * 7, count: 1 });
+chart.on('replayEnd', () => console.log('Reached the present'));
+
+await chart.replayStep(1); // One bar forward; resolves when the server confirms
+await chart.replayStart(1000); // Play automatically, one bar per second
+await chart.replayStop();
+```
+
+Replay events: `replayLoaded` (instance ID), `replayPoint` (cursor time), `replayResolution` (resolutions reported by the server), `replayEnd`. Replay methods reject with `INVALID_STATE` outside replay mode, and pending requests reject when the chart is deleted or the market changes.
+
+## Studies
+
+```ts
+const rsi = await getIndicator('STD;RSI', { credentials });
+rsi.setInput('Length', 21);
+const study = chart.createStudy(rsi);
+
+study.on('ready', () => console.log(study.values.at(-1)));
+study.on('update', (changes) => {}); // 'plots', 'graphic', 'report.perf', 'report.trades'...
+study.on('error', (error) => console.error(error.message));
+```
+
+| Member | Description |
+| --- | --- |
+| `values` | Rows `{ $time, <plot>: number }`, oldest first. |
+| `graphics` | Parsed drawings (labels, lines, boxes, tables, polygons, horizontal lines and histograms, `raw`). |
+| `strategyReport` | Strategy `performance`, `trades`, `history`, `currency`, `settings` (decoded from plain or compressed payloads). |
+| `indicator`, `isReady`, `isRemoved` | State. |
+| `setIndicator(indicator)` | Replaces the indicator, e.g. after changing inputs. |
+| `remove()` | Removes the study. Idempotent. |
+
+Events: `loading`, `ready` (`study_completed`), `update`, `error`.
+
+### Indicator definitions
+
+- `getIndicator(id, { version, credentials })` returns a `PineIndicator` from `STD;...`, `PUB;...` or `USER;...` IDs.
+- `PineIndicator`: `id`, `version`, `description`, `shortDescription`, `inputs`, `plots`, `script`, `type`; `setInput(key, value)`, `setInputs(values)`, `findInput(key)`, `setType('StrategyScript@tv-scripting-101!')`, `clone()`.
+- `new BuiltInIndicator(type, options?)`: built-in studies such as `Volume@tv-basicstudies-241` and the volume profiles (`VbPFixed@...`, `VbPSessions@...`, `VbPVisible@...`). `setOption(key, value, force?)` validates names and types for known types unless `force` is true.
+- `parseIndicatorDefinition(result, id, version)` builds a `PineIndicator` from a cached `pine-facade` response.
+
+## Quotes
+
+```ts
+const quotes = client.createQuoteSession({ fields: ['lp', 'bid', 'ask'] }); // or 'all' / 'price'
+const btc = quotes.subscribe('BINANCE:BTCEUR', { session: 'regular' });
+btc.on('data', (quote, changes) => console.log(quote.lp, changes));
+btc.on('loaded', () => {});
+btc.on('error', (error) => {});
+
+btc.close(); // Stops this subscription
+quotes.setFields('all');
+quotes.delete(); // Deletes the session and its subscriptions
+```
+
+Subscriptions to the same symbol and session share one server subscription; the symbol is removed from the server when the last one closes. `btc.data` holds the merged latest values.
+
+## HTTP functions
+
+All accept `{ fetch?, signal?, headers? }`; functions that can use an account also accept `credentials`.
+
+| Function | Description |
+| --- | --- |
+| `searchMarkets(text, { type, exchange, offset })` | Symbol search (v3 endpoint). |
+| `getTechnicalAnalysis(symbol)` | Technical ratings for 1m to 1M periods, or `null`. |
+| `searchIndicators(text)` | Built-in (cached in memory; `clearIndicatorCache()`) and community indicators. |
+| `getIndicator(id, { version, credentials })` | Pine indicator definition. |
+| `getPrivateIndicators(credentials)` | Your saved scripts. |
+| `loginUser({ username, password, remember, userAgent })` | Signs in and returns the account with its cookies. Accounts with 2FA or captcha challenges are not supported. |
+| `getUser(credentials, { location, maxRedirects })` | Account behind session cookies (follows regional redirects, stops loops). |
+| `getChartToken(layoutId, { credentials, userId })` | Chart-storage token for a layout. |
+| `getDrawings(layoutId, { symbol, chartId, credentials, userId })` | Drawings saved in a layout. |
+| `new PinePermissionManager(pineId, { credentials })` | `getUsers(limit, order)`, `addUser(username, expiration?)`, `modifyExpiration(username, expiration?)`, `removeUser(username)` for invite-only scripts you own. |
+
+## Transport
+
+The default transport uses the [`ws`](https://github.com/websockets/ws) package, which works in Node and Bun. To use a proxy or another websocket implementation, pass `transport`:
+
+```ts
+import type { TransportFactory } from '@mathieuc/tradingview';
+
+const transport: TransportFactory = ({ url, origin, headers }, handlers) => {
+ const socket = createMySocket(url, { origin, headers });
+ socket.onopen = () => handlers.onOpen();
+ socket.onmessage = (event) => handlers.onMessage(String(event.data));
+ socket.onclose = (event) => handlers.onClose(event.code, event.reason);
+ socket.onerror = (event) => handlers.onError(new Error(String(event)));
+ return {
+ get isOpen() { return socket.readyState === 1; },
+ send: (data) => socket.send(data),
+ close: () => socket.close(),
+ };
+};
+
+const client = new TradingViewClient({ transport });
+```
+
+The same mechanism lets tests run without network access (see `tests/helpers/fake-server.ts`).
+
+## Protocol helpers
+
+`protocol` exposes the wire format for debugging and custom tooling:
+
+```ts
+import { protocol } from '@mathieuc/tradingview';
+
+protocol.encodePacket('set_auth_token', ['token']); // '~m~36~m~{"m":"set_auth_token","p":["token"]}'
+protocol.decodeFrames(rawMessage); // [{ type: 'packet' | 'heartbeat' | 'data' | 'invalid', ... }]
+protocol.decodeCompressed(base64); // Strategy report payloads (ZIP, zlib, raw deflate, gzip, JSON)
+protocol.createSessionId('cs'); // 'cs_Ab12Cd34Ef56'
+```
+
+Frames are `~m~<length>~m~<payload>`, where the length counts UTF-16 code units; heartbeats are `~h~<id>` and must be echoed (the client does it).
diff --git a/docs/migration-v4.md b/docs/migration-v4.md
new file mode 100644
index 0000000..76e1ab6
--- /dev/null
+++ b/docs/migration-v4.md
@@ -0,0 +1,128 @@
+# Migrating from v3 to v4
+
+[README](../README.md) · [Data API](data-api.md) · [Low-level API](low-level-api.md) · [Coverage matrix](v4-coverage.md)
+
+Version 4 is a complete TypeScript rewrite with **no compatibility layer**. Every v3 capability is still available (see the [coverage matrix](v4-coverage.md)), under a more consistent API. This page shows how to translate v3 code.
+
+## Package
+
+| v3 | v4 |
+| --- | --- |
+| CommonJS: `const TradingView = require('@mathieuc/tradingview')` | ESM: `import { ... } from '@mathieuc/tradingview'`. On Node ≥ 20.19 or ≥ 22.12, `require()` of the ESM package also works. |
+| `agent.js` preview (`fetchCandles`, `watchCandles`) | `@mathieuc/tradingview/data` (`getCandles`, `watchCandles`, quotes, indicators...) |
+| Preview `MarketDataProvider` / `TradingViewProvider` | Provider-neutral candle injection remains: `getCandles(query, provider)`, `watchCandles(query, handlers, provider)` |
+| Node ≥ 14, untyped JSDoc | Node ≥ 20 or Bun, bundled TypeScript declarations |
+| `axios`, `jszip`, `ws` dependencies | `ws` only (HTTP uses the built-in `fetch`) |
+
+## Simplest path: the data API
+
+```js
+// v3
+const client = new TradingView.Client();
+const chart = new client.Session.Chart();
+chart.setMarket('BINANCE:BTCEUR', { timeframe: 'D', range: 100 });
+chart.onUpdate(() => { console.log(chart.periods); client.end(); });
+
+// v4
+import { getCandles } from '@mathieuc/tradingview/data';
+const candles = await getCandles({ symbol: 'BINANCE:BTCEUR', timeframe: 'D', count: 100 });
+```
+
+## Client
+
+| v3 | v4 |
+| --- | --- |
+| `new Client({ token, signature })` | `new TradingViewClient({ credentials: { session, signature } })` |
+| `server`, `location`, `headers` options | Same names |
+| `DEBUG: true` (sets a global flag) | `debug: true` or `debug: (...args) => {}` (per client) |
+| (not available) | `authToken`, `transport`, `fetch`, `connectTimeoutMs`, `client.ready` |
+| `client.onConnected(cb)` | `client.on('open', cb)` |
+| `client.onDisconnected(cb)` | `client.on('close', cb)` |
+| `client.onLogged(cb)` | `client.on('ready', cb)`; the server greeting is `client.on('hello', cb)` / `client.serverInfo` |
+| `client.onPing(cb)` | `client.on('heartbeat', cb)` |
+| `client.onData(cb)` | `client.on('packet', cb)` |
+| `client.onError(cb)` (`(...messages)`) | `client.on('error', (error) => ...)` (`TradingViewError`) |
+| `client.onEvent(cb)` | `client.onAny((event, ...args) => ...)` |
+| `client.isLogged`, `client.isOpen` | `client.isAuthenticated`, `client.isOpen` (and `client.isClosed`) |
+| `client.send(t, p)` / `client.sendQueue()` | `client.send(method, params)`; the queue is flushed automatically |
+| `client.end()` | `await client.close()` (now resolves once actually closed) |
+| `new client.Session.Chart()` | `client.createChart()` |
+| `new client.Session.Quote(options)` | `client.createQuoteSession(options)` |
+
+## Charts
+
+| v3 | v4 |
+| --- | --- |
+| `chart.setMarket(symbol, { range, to, backadjustment, ... })` | `chart.setMarket(symbol, { count, to, backAdjustment, ... })` (`timeframe`, `adjustment`, `session`, `currency`, `type`, `inputs`, `replay` unchanged). The default timeframe is now `D` (v3: `240`). An empty symbol throws instead of loading `BTCEUR`. |
+| `chart.setSeries(timeframe)` | `chart.setTimeframe(timeframe)` (throws `INVALID_STATE` before `setMarket` instead of emitting an error) |
+| `chart.periods` (newest first; `max`/`min`; volume rounded to 2 decimals) | `chart.candles` (**oldest first**; `high`/`low`; raw volume) and `chart.lastCandle` |
+| `chart.infos` | `chart.symbolInfo` |
+| `chart.setTimezone(tz)` | Same (no longer clears loaded bars) |
+| `chart.fetchMore(n)` | Same |
+| `chart.replayStep/Start/Stop()` | Same; they now reject with `INVALID_STATE` outside replay mode instead of never resolving |
+| `chart.onSymbolLoaded(cb)` | `chart.on('symbolLoaded', (info) => ...)` |
+| `chart.onUpdate(cb)` | `chart.on('update', (changes) => ...)` |
+| `chart.onReplayLoaded/Point/Resolution/End(cb)` | `chart.on('replayLoaded' / 'replayPoint' / 'replayResolution' / 'replayEnd', cb)` |
+| `chart.onError(cb)` | `chart.on('error', (error) => ...)` |
+| (not available) | `chart.on('seriesCompleted', ...)`, `chart.on('seriesLoading', ...)` |
+| `new chart.Study(indicator)` | `chart.createStudy(indicator)` |
+| `chart.delete()` | Same (idempotent) |
+
+## Studies
+
+| v3 | v4 |
+| --- | --- |
+| `study.periods` (newest first) | `study.values` (**oldest first**, still keyed by `$time` and plot names) |
+| `study.graphic` | `study.graphics`; `tables[i].cells()` is now the `tables[i].cells` array; `raw()` is now the `raw` object |
+| `study.strategyReport` | Same |
+| `study.instance` | `study.indicator` |
+| `study.setIndicator(indicator)`, `study.remove()` | Same |
+| `study.onReady/onUpdate/onError(cb)` | `study.on('ready' / 'update' / 'error', cb)` (also `loading`) |
+
+## Quotes
+
+| v3 | v4 |
+| --- | --- |
+| `new client.Session.Quote({ fields: 'all' })` | `client.createQuoteSession({ fields: 'all' })` |
+| `{ customFields: ['lp'] }` | `{ fields: ['lp'] }` |
+| `new quoteSession.Market(symbol, session)` | `quoteSession.subscribe(symbol, { session })` |
+| `market.onLoaded/onData/onError/onEvent(cb)` | `subscription.on('loaded' / 'data' / 'error', cb)` / `onAny(cb)`; `data` also receives the changed fields |
+| `market.close()`, `quoteSession.delete()` | `subscription.close()`, `quoteSession.delete()` |
+
+## Indicators
+
+| v3 | v4 |
+| --- | --- |
+| `TradingView.getIndicator(id, version, session, signature)` | `getIndicator(id, { version, credentials })` |
+| `indicator.pineId`, `indicator.pineVersion` | `indicator.id`, `indicator.version` |
+| `indicator.setOption(key, value)` | `indicator.setInput(key, value)` (chainable; also `setInputs({...})`, `clone()`) |
+| `indicator.setType(type)` | Same |
+| `new BuiltInIndicator(type)` + `setOption(key, value, FORCE)` | Same, plus initial options: `new BuiltInIndicator(type, { first_bar_time })` |
+
+## HTTP functions
+
+| v3 | v4 |
+| --- | --- |
+| `searchMarketV3(text, filter, offset)` | `searchMarkets(text, { type, offset, exchange })` |
+| `searchMarket(text, filter)` (deprecated v1 endpoint) | `searchMarkets(text, { type })` |
+| `result.getTA()` | `getTechnicalAnalysis(result.id)` |
+| `getTA(symbol)` (returned `false` without data) | `getTechnicalAnalysis(symbol)` (returns `null`) |
+| `searchIndicator(text)` + `result.get()` | `searchIndicators(text)` + `getIndicator(result.id, { version: result.version })` |
+| `getPrivateIndicators(session, signature)` + `result.get()` | `getPrivateIndicators({ session, signature })` + `getIndicator(result.id, { version, credentials })` |
+| `loginUser(username, password, remember, UA)` | `loginUser({ username, password, remember, userAgent })` |
+| `getUser(session, signature, location)` | `getUser({ session, signature }, { location })` (`id` is now a number) |
+| `getChartToken(layout, { id, session, signature })` | `getChartToken(layout, { userId, credentials: { session, signature } })` |
+| `getDrawings(layout, symbol, { id, session, signature }, chartID)` | `getDrawings(layout, { symbol, chartId, userId, credentials })` |
+| `new PinePermManager(session, signature, pineId)` | `new PinePermissionManager(pineId, { credentials: { session, signature } })` (same methods) |
+
+## Errors
+
+v3 passed lists of strings to `onError` callbacks, or printed them. v4 uses `TradingViewError` everywhere, with a `code` (`SYMBOL_ERROR`, `SERIES_ERROR`, `CRITICAL_ERROR`, `STUDY_ERROR`, `AUTH_ERROR`, `TIMEOUT`...), a readable `message` and the raw server payload in `details`. Study errors are formatted with their context, e.g. `Study error: Invalid value of the 'factor' argument (-1)...`.
+
+## High-level data preview (formerly agent-api)
+
+| Preview (`agent.js`) | v4 |
+| --- | --- |
+| `fetchCandles({ symbol, timeframe, limit, timeoutMs, signal })` | `getCandles({ symbol, timeframe, count, timeoutMs, signal })` |
+| `watchCandles(query, { onData, onError })` → `{ latest, stop() }` | `watchCandles(query, { onData, onError })` → `{ latest, stop(), closed, isActive, symbolInfo }` |
+| `TradingViewProvider` / `MarketDataProvider` injection | Provider injection remains: `getCandles(query, provider)` or `watchCandles(query, handlers, provider)`; `client` and `clientOptions.transport` also work for TradingView |
diff --git a/docs/v4-coverage.md b/docs/v4-coverage.md
new file mode 100644
index 0000000..db34eb8
--- /dev/null
+++ b/docs/v4-coverage.md
@@ -0,0 +1,192 @@
+# v4 coverage matrix
+
+[Migration guide](migration-v4.md) · [Data API](data-api.md) · [Low-level API](low-level-api.md)
+
+This matrix lists every capability of v3 (`main.js`, `src/`, examples, tests) and of the `agent.ts` preview, with its v4 replacement and the evidence that it works.
+
+**Evidence columns**
+
+- **Unit**: deterministic test in `tests/unit/` (`npm test` with Vitest on Node, `npm run test:bun` with Bun's runner; 108 tests, both green). Websocket tests use a scripted fake server (`tests/helpers/fake-server.ts`) or packets captured from TradingView (`tests/fixtures/live-session.json`); HTTP tests use a mocked `fetch`.
+- **Live**: result of `npm run test:live` (`tests/live/`) and examples against TradingView on **2 October 2026**: 16 anonymous tests locally and 21 tests (including five authenticated) in the [manual GitHub Actions run](https://github.com/Mathieu2301/TradingView-API/actions/runs/37075296707):
+ - ✅ verified live anonymously;
+ - 🔒 path or variant not exercised live (often requires a specific account asset); deterministic tests only;
+ - âž– not applicable (no network involved).
+
+Test names are abbreviated as `file › test`.
+
+## Package and tooling
+
+| v3 capability | v4 | Unit evidence | Live |
+| --- | --- | --- | --- |
+| CommonJS entry `require('@mathieuc/tradingview')` (`main.js`) | ESM entry `@mathieuc/tradingview` with `.d.ts`; `require()` works on Node ≥ 20.19/22.12 (require(esm)) | `exports › root entry...`; `scripts/smoke.mjs` (packs the tarball, imports under Node and Bun, `require()` check, strict TS consumer without `@types/node`) | ➖ |
+| `agent.js` / `agent.d.ts` preview entry | `@mathieuc/tradingview/data` subpath | `exports › data entry only exposes...`; smoke test | ➖ |
+| JSDoc types (`src/types.js`: `Timezone`, `TimeFrame`, `MarketSymbol`) | TypeScript types `Timezone`, `Timeframe`, `MarketSymbol` (`src/chart/types.ts`) | `npm run typecheck`; smoke consumer | âž– |
+| `build:agent`, `lint:agent`, `prepack` scripts | `build`, `typecheck`, `lint`, `test`, `test:bun`, `test:live`, `smoke`, `check`, `prepack` | CI workflow | âž– |
+| CI: Node 14/18/19 live tests on every push + nightly; agent job | CI: typecheck, lint, unit tests (Vitest), build and smoke on Node 20/22/24; unit tests with Bun's test runner and smoke on Bun; live tests only nightly/manual, non-blocking | `.github/workflows/tests.yml` | âž– |
+| `docs/DOCS.md` (pointer to JSDoc) | `docs/data-api.md`, `docs/low-level-api.md`, `docs/migration-v4.md`, this matrix | n/a | âž– |
+
+## Protocol and transport
+
+| v3 capability | v4 | Unit evidence | Live |
+| --- | --- | --- | --- |
+| `protocol.parseWSPacket` (frame split, heartbeat as number, invalid JSON warning) | `protocol.decodeFrames` (length-based, UTF-16 lengths, typed frames, lenient fallback, invalid frames reported) | `protocol › decodes several frames...`, `keeps payloads containing frame markers intact`, `reports invalid JSON...`, `falls back to splitting malformed input`, `decodes every message of a captured live session` | ✅ (fixture captured live; UTF-16 lengths checked on Japanese/Korean descriptions) |
+| `protocol.formatWSPacket` | `protocol.encodeFrame`, `encodePacket`, `encodeHeartbeat` | `protocol › encodes packets with UTF-16 lengths` | ✅ |
+| `protocol.parseCompressed` (ZIP via jszip, base64 normalisation, zlib/raw/gzip fallbacks) | `protocol.decodeCompressed` (built-in ZIP reader: stored, deflated, data descriptors, empty entry names; zlib, raw deflate, gzip, plain JSON) and `normaliseBase64`, `readFirstZipEntry` | `protocol › compressed payloads › *` (ZIP fixtures generated independently with Python `zipfile`) | 🔒 live compressed strategy payload not captured; plain report verified |
+| `utils.genSessionID` | `protocol.createSessionId` (crypto-random) | `protocol › ids` | ➖ |
+| `utils.genAuthCookies` | Internal cookie builder used by every HTTP call | `http › * with credentials` (cookie headers asserted) | ➖ |
+| Websocket URL `wss://<server>.tradingview.com/socket.io/websocket?from=chart&type=chart`, Origin and browser headers | Same, in `TradingViewClient`; transport is pluggable (`transport` option, default `ws`) | `client › connects with browser-like headers...` | ✅ Node and Bun (Bun needed the Origin header fix) |
+| Heartbeat (`~h~`) echo, `onPing` | Automatic echo, `heartbeat` event | `client › answers heartbeats...` | ✅ |
+| `protocol_error` → error + close | `PROTOCOL_ERROR` error + close | `client › turns protocol_error into an error event and closes` | ✅ (observed during probes) |
+| Send queue until open and authenticated; `sendQueue()` | Automatic queue and flush | `client › connects ... then flushes queued packets` | ✅ |
+| Packet routing to sessions by ID | Same (`registerSession`) | `client › routes packets to registered sessions`, `routes a captured live session...` | ✅ |
+| `global.TW_DEBUG` / `DEBUG` option | Per-client `debug: true | (...args) => void` | `client › logs traffic through a debug function` | ✅ |
+
+## Client, authentication and events
+
+| v3 capability | v4 | Unit evidence | Live |
+| --- | --- | --- | --- |
+| `new Client()` anonymous (`unauthorized_user_token`) | `new TradingViewClient()` | `client › connects with ... an anonymous token` | ✅ |
+| `token` + `signature` options → `getUser` → `set_auth_token` | `credentials: { session, signature }` (and new `authToken`) | `client › loads the auth token from credentials...`, `uses an explicit auth token` | ✅ (`authenticated › gets the account`, `opens an authenticated connection`) |
+| `location` option | `location` | `client › loads the auth token...` (asserts the regional URL) | 🔒 |
+| `server` option (`data`, `prodata`, `widgetdata`) | `server` | `client › connects with browser-like headers...` (`prodata` URL) | ✅ `data`; 🔒 `prodata` |
+| `headers` option | `headers` | `client › connects with browser-like headers...` | ✅ |
+| Credentials error reported through `onError` | `AUTH_ERROR` (rejects `ready`, `error` event, connection closed, cause passed to sessions) | `client › fails, emits AUTH_ERROR...`, `rejects ready without logging...` | ✅ (fake cookie rejected live in `examples/errors.js`) |
+| `onConnected`, `onDisconnected`, `onLogged`, `onPing`, `onData`, `onError`, `onEvent` | `open`, `close`, `ready`/`hello`, `heartbeat`, `packet`, `error` events and `onAny` | `client › answers heartbeats and emits hello, heartbeat and unrouted packets`, `events › *` | ✅ |
+| `isLogged`, `isOpen` | `isAuthenticated`, `isOpen`, `isClosed`, `serverInfo` | `client › connects ...` | ✅ |
+| `client.send(t, p)` raw packets | `client.send(method, params)` | `client › accepts a raw frame string through send()` | ✅ |
+| `client.end()` | `client.close()` (resolves when closed, idempotent, sessions released silently) | `client › close() is idempotent...`, `chart › intentional close` | ✅ |
+| Disconnection handling | `DISCONNECTED` to charts, studies, quote subscriptions and pending calls | `client › notifies sessions...`, `chart › reports DISCONNECTED...`, `quote › reports DISCONNECTED...`, `data › rejects with DISCONNECTED...` | ➖ (simulated) |
+| (new) Connection timeout | `connectTimeoutMs`, `TIMEOUT` | `client › times out if the connection never opens` | ➖ |
+
+## Charts
+
+| v3 capability | v4 | Unit evidence | Live |
+| --- | --- | --- | --- |
+| `new client.Session.Chart()` / `chart_create_session` | `client.createChart()` | `chart › creates a session, resolves the symbol...` | ✅ |
+| `setMarket(symbol, { timeframe, range })` | `setMarket(symbol, { timeframe, count })` | `chart › creates a session...`; `data › getCandles › *` | ✅ |
+| Candles `chart.periods` (newest first, `max`/`min`) | `chart.candles` (oldest first, `high`/`low`), `lastCandle` | `chart › creates a session...`, `parses a captured live chart session` | ✅ |
+| `to` reference (`['bar_count', to, range]`) | `to` option; `getCandles({ to })` | `chart › encodes market options...`, `data › loads a from/to range...` | ✅ recent past reference with account (`authenticated › uses an account timeframe...`); older history remains server-limited |
+| Negative `range` (bars after `to`), "fake replay" | Negative `count` + `fetchMore(-n)` | `chart › encodes market options...` | ✅ (`sessions › loads bars after a past reference...`, `examples/fake-replay.js`) |
+| `fetchMore(n)` / deep history | `chart.fetchMore(n)`; automatic batching in `getCandles` (`count` or `from`), stops on `data_completed` | `chart › fetches more history...`, `data › loads deep history in batches...`, `stops when the server has no more history` | ✅ (3 000 hourly and 6 600 hourly bars; anonymous cap observed as `data_completed: "limit"`) |
+| (new) From/to date ranges | `getCandles({ from, to, maxCount })` | `data › loads a from/to range...` | ✅ (`from` anonymously, recent past `to` with account) |
+| `adjustment` (`splits`/`dividends`) | `adjustment` | `chart › encodes market options...` | ✅ default; ➖ dividends |
+| `backadjustment` | `backAdjustment` | `chart › encodes market options...`, `data › passes chart options...` | ➖ (encoding only) |
+| `session` (`regular`/`extended`) | `session` | same | âž– (encoding only) |
+| `currency` (`currency-id`) | `currency` | same | âž– (encoding only) |
+| Custom chart types: HeikinAshi, Renko, LineBreak, Kagi, PointAndFigure, Range + `inputs` | `type` + `inputs`; `getCandles({ chartType, chartInputs })` | `chart › encodes market options...`, `modifies the series...` | ✅ all six (`data › gets custom chart types`, `examples/custom-chart-types.js`) |
+| `setSeries(timeframe)` | `setTimeframe(timeframe)` | `chart › modifies the series on later setMarket/setTimeframe calls...` | ✅ (D → 15) |
+| `setSeries` before market → error | `INVALID_STATE` thrown | `chart › modifies the series...` | ✅ (`examples/errors.js`) |
+| `setTimezone(tz)` | `setTimezone(tz)`; `getCandles({ timezone })` | `chart › fetches more history and switches timezone` | ✅ |
+| Custom timeframes (`1S`, `20`...) | Any `Timeframe` string | `data › passes chart options...` | ✅ account timeframe `240`; 🔒 `1S`/`20` not exercised |
+| `onSymbolLoaded`, `chart.infos` | `symbolLoaded` event, `symbolInfo`; `getSymbolInfo()` | `chart › creates a session...`, `data › getSymbolInfo` | ✅ |
+| `onUpdate(changes)` | `update` event | `chart › creates a session...` | ✅ |
+| (new) `series_loading` / `series_completed` | `seriesLoading`, `seriesCompleted` (`dataCompleted: end|limit`) | `chart › fetches more history...` | ✅ |
+| `symbol_error`, `series_error`, `critical_error` → `onError` | `SYMBOL_ERROR`, `SERIES_ERROR`, `CRITICAL_ERROR` | `chart › emits typed errors...` | ✅ (`sessions › reports server errors as typed errors`) |
+| `delete()` | `delete()` (idempotent; also deletes the replay session) | `chart › rejects pending replay requests when deleted...` | ✅ |
+
+## Replay
+
+| v3 capability | v4 | Unit evidence | Live |
+| --- | --- | --- | --- |
+| `setMarket(symbol, { replay })` (replay session, add series, reset) | Same option | `chart › runs replay mode...` | ✅ |
+| `replayStep(n)`, `replayStart(interval)`, `replayStop()` resolved by `replay_ok` | Same; reject with `INVALID_STATE` outside replay and on delete | `chart › runs replay mode...`, `rejects pending replay requests...` | ✅ step (`sessions › replays history step by step`); ➖ start/stop live |
+| `onReplayLoaded`, `onReplayPoint`, `onReplayResolution`, `onReplayEnd` | `replayLoaded`, `replayPoint`, `replayResolution`, `replayEnd` events | `chart › runs replay mode...` | ✅ |
+| Replay `critical_error` | `CRITICAL_ERROR` on the chart; pending replay requests rejected | (code path shared with chart errors) | âž– |
+
+## Studies, indicators and strategies
+
+| v3 capability | v4 | Unit evidence | Live |
+| --- | --- | --- | --- |
+| `new chart.Study(indicator)` with instance check | `chart.createStudy(indicator)` (`INVALID_ARGUMENT` otherwise) | `study › creates a Pine study...`, `modifies and removes a study` | ✅ built-in and public Pine RSI with account |
+| Pine inputs serialisation (`text`, `pineId`, `pineVersion`, `{ v, f, t }`, colours by index) | `PineIndicator.toStudyInputs()` | `indicators › serialises inputs for create_study...` | ✅ public Pine RSI inputs; colour variant unit-tested |
+| `study.periods` with plot names, `plot_N` fallback for unnamed/duplicate plots | `study.values` (oldest first) | `study › creates a Pine study, names plots...`, `chart › parses a captured live chart session` | ✅ (built-in volume rows) |
+| `study.graphic` (labels, lines, boxes, tables + cells, polygons, horizLines, horizHists, raw) and `graphicsCmds` erase/create | `study.graphics` (`cells` array, `raw` object) | `study › reads graphics commands...`, `applies erase commands` | ✅ horizontal histograms (volume profile); 🔒 Pine drawings |
+| Bars-back translation of graphic X indexes | Same | `study › reads graphics commands...` | ✅ |
+| `study.strategyReport` (plain `data.report` and compressed `dataCompressed`; trades, performance, history, currency, settings) | Same | `study › decodes plain and compressed strategy reports`, `reports undecodable strategy reports as PARSE_ERROR` | ✅ Supertrend strategy report with account; compressed variant unit-tested |
+| `study.setIndicator()` (`modify_study`) | Same | `study › modifies and removes a study` | 🔒 |
+| `study.remove()` | Same (idempotent) | same | ✅ |
+| `onReady`, `onUpdate`, `onError`, `study_error` | `ready`, `loading`, `update`, `error` (`STUDY_ERROR`, message formatted with server context) | `study › formats study errors with their context` | ✅ (anonymous Pine refusal reported as `STUDY_ERROR`) |
+| `PineIndicator` getters (`pineId`, `pineVersion`, description, inputs, plots, script, type) and `setType` | `id`, `version`, same others; `setType`, `clone` | `indicators › clones independently...` | ✅ (`sessions › loads Pine indicator definitions`) |
+| `PineIndicator.setOption` (by `in_N`, number, inline name, internal ID; type and option checks) | `setInput`, `setInputs`, `findInput` | `indicators › finds inputs by ID...` | ✅ (definition-level) |
+| `BuiltInIndicator(type)`, defaults for Volume and volume profiles, `setOption(key, value, FORCE)` | Same (+ initial options; time defaults computed per instance instead of at import) | `indicators › BuiltInIndicator › *` | ✅ (`Volume`, `VbPFixed@tv-basicstudies-241!`) |
+| `getIndicator(id, version, session, signature)` (pine-facade translate, input/plot naming) | `getIndicator(id, { version, credentials })`, `parseIndicatorDefinition` | `indicators › parseIndicatorDefinition...`, `http › loads an indicator definition...`, `throws NOT_FOUND...` | ✅ public scripts; 🔒 private/invite-only |
+| (new) One-shot / streaming indicator values | `getIndicatorData`, `watchIndicator` | `data › indicator data › *` | ✅ built-in and one-shot Pine RSI with account; Pine stream unit-tested |
+
+## Quotes
+
+| v3 capability | v4 | Unit evidence | Live |
+| --- | --- | --- | --- |
+| `new client.Session.Quote({ fields: 'all' | 'price', customFields })` | `client.createQuoteSession({ fields: 'all' | 'price' | [...] })`; `setFields()` | `quote › quote fields`, `creates a session with fields...` | ✅ |
+| `new quoteSession.Market(symbol, session)` | `quoteSession.subscribe(symbol, { session })` | `quote › creates a session...` | ✅ |
+| Merged quote data, `onData`, `onLoaded`, `onEvent` | `data` (quote, changes), `loaded`, `onAny`; `subscription.data` | `quote › creates a session...` | ✅ (`sessions › streams quotes through a quote session`) |
+| Quote symbol errors → `onError` | `QUOTE_ERROR` | `quote › reports symbol errors...` | ✅ |
+| Removal of symbols nobody listens to | Same | `quote › reports symbol errors and removes symbols nobody listens to` | ➖ |
+| `market.close()` (shared per symbol) | `subscription.close()` with correct reference counting (v3 never decreased its count) | `quote › shares one server subscription...` | ➖ |
+| `quoteSession.delete()` | Same (idempotent) | same | ✅ |
+| (new) One-shot and streaming quotes | `getQuote`, `getQuotes`, `watchQuotes` | `data › quotes › *` | ✅ |
+
+## HTTP: search, technical analysis, accounts, layouts, permissions
+
+| v3 capability | v4 | Unit evidence | Live |
+| --- | --- | --- | --- |
+| `searchMarketV3(text, filter, offset)` (exchange prefix split) | `searchMarkets(text, { type, offset, exchange })` | `http › queries symbol search v3...` | ✅ (`BINANCE:`, `nasdaq apple` → `NASDAQ:AAPL`) |
+| `searchMarket(text, filter)` (deprecated v1 endpoint) | Replaced by `searchMarkets` (same results, maintained endpoint) | same | ✅ |
+| `result.getTA()` | `getTechnicalAnalysis(result.id)` | `http › requests every period and scales ratings` | ✅ |
+| `getTA(symbol)` (8 periods × All/MA/Other, scaled) | `getTechnicalAnalysis(symbol)` (`null` instead of `false` without data) | `http › getTechnicalAnalysis › *` | ✅ |
+| `searchIndicator(text)` (built-in lists cached + community suggestions, access mapping) | `searchIndicators(text)`, `clearIndicatorCache()` | `http › searches built-in and community indicators` | ✅ |
+| `result.get()` on indicator results | `getIndicator(result.id, { version: result.version })` | `http › loads an indicator definition...` | ✅ |
+| `getPrivateIndicators(session, signature)` | `getPrivateIndicators(credentials)` | `http › lists private indicators with credentials` | ✅ authenticated listing endpoint; actual private item not available |
+| `loginUser(username, password, remember, UA)` | `loginUser({ username, password, remember, userAgent })` (form now URL-encoded) | `http › loginUser posts an encoded form and reads cookies` | 🔒 |
+| `getUser(session, signature, location)` with redirect-loop protection | `getUser(credentials, { location, maxRedirects })` (relative redirects resolved) | `http › getUser parses the account page...`, `getUser stops redirect loops...` | ✅ authenticated success and wrong-cookie rejection |
+| `getChartToken(layout, credentials)` | `getChartToken(layoutId, { userId, credentials })` | `http › gets a chart token...` | 🔒 (needs a layout ID) |
+| `getDrawings(layout, symbol, credentials, chartID)` | `getDrawings(layoutId, { symbol, chartId, userId, credentials })` | `http › lists drawings with merged state` | 🔒 |
+| `PinePermManager(session, signature, pineId)`: `getUsers`, `addUser`, `modifyExpiration`, `removeUser` | `PinePermissionManager(pineId, { credentials })`, same methods | `http › PinePermissionManager › *` | 🔒 (needs an owned invite-only script) |
+| 5xx responses throw; HTTP errors | `HTTP_ERROR` (also wraps network failures) | `http › throws HTTP_ERROR...`, `wraps network failures` | ➖ |
+
+## High-level data API (agent preview)
+
+| Preview capability | v4 | Unit evidence | Live |
+| --- | --- | --- | --- |
+| `fetchCandles({ symbol, timeframe, limit })`, oldest first, `high`/`low` | `getCandles({ symbol, timeframe, count })` (+ deep history, ranges, chart options) | `data › getCandles › *` | ✅ |
+| `watchCandles(query, { onData, onError })`, `worker.latest`, idempotent `stop()` | Same names + `closed`, `isActive`, `symbolInfo` | `data › watchCandles › *` | ✅ |
+| `timeoutMs` (15 s default), `AbortSignal` | Same, for every data function | `data › times out...`, `aborts in flight and before starting`, `stops on abort after start-up` | ✅ |
+| Cleanup of chart and connection on success, failure, timeout, abort and disconnect | Same, plus shared `client` support | `data › returns ... and closes everything`, `shares a client without closing it`, `rejects when a provided client is already closed` | ✅ |
+| Validation before connecting | Same (`INVALID_ARGUMENT`) | `data › rejects invalid queries before connecting` | ➖ |
+| `MarketDataProvider` / `TradingViewProvider` injection | Same provider-neutral candle contract; `getCandles(query, provider)` and `watchCandles(query, handlers, provider)`, plus shared `client` and custom `clientOptions.transport` for TradingView | `data › accepts an alternate candle provider...`; other data tests use an injected transport | ➖ |
+
+## Examples
+
+| v3 example | v4 example |
+| --- | --- |
+| `SimpleChart.js` | `simple-chart.js` (✅ live) |
+| `CustomChartType.js` | `custom-chart-types.js` (✅ live) |
+| `CustomTimeframe.js` | `custom-timeframe.js` (🔒) |
+| `Errors.js` | `errors.js` (✅ live for anonymous cases) |
+| `FakeReplayMode.js` | `fake-replay.js` (✅ live) |
+| `FromToData.js` | `from-to.js` (🔒) |
+| `GetDrawings.js` | `drawings.js` (🔒) |
+| `GraphicIndicator.js` | `graphic-indicator.js` (🔒) |
+| `MultipleSyncFetch.js` | `multiple-indicators.js` (🔒) |
+| `PinePermManage.js` | `pine-permissions.js` (🔒) |
+| `ReplayMode.js` | `replay.js` (✅ live without Pine studies) |
+| `Search.js` | `search.js` (✅ live) |
+| `UserLogin.js` | `user-login.js` (🔒) |
+| `AllPrivateIndicators.js` | `private-indicators.js` (🔒) |
+| `BuiltInIndicator.js` | `builtin-indicator.js` (✅ live) |
+| (new) | `candles.js` (✅), `watch-candles.js`, `quotes.js`, `indicator-data.js`, `quote-session.js` |
+
+## Intentional changes
+
+These v3 behaviours were changed on purpose; none removes a capability.
+
+- Bars and study rows are oldest first; candles use `high`/`low`; volume is no longer rounded to two decimals.
+- `setMarket('')` throws instead of silently loading `BTCEUR`; the default timeframe is `D` instead of `240`.
+- `setTimezone` no longer clears loaded bars (the server does not resend them).
+- Replay methods reject instead of never resolving outside replay mode.
+- Errors are `TradingViewError` objects instead of string lists; unhandled `error` events are still printed, except connection failures that already reject `client.ready`.
+- `searchMarket` (deprecated v1 endpoint) is folded into `searchMarkets`.
+- `result.getTA()` / `result.get()` methods on search results became plain data plus `getTechnicalAnalysis()` / `getIndicator()`.
+
+## Not verified live for this release
+
+The 21-test manual live workflow verified authenticated connection, account lookup, a public Pine RSI, a Supertrend strategy report, the private-indicators listing endpoint, and recent historical `to` with an account. It did **not** verify password login, actual private/invite-only scripts, compressed strategy reports against a live response, older history beyond server limits, second-based/custom timeframes, the `prodata` server, owned layouts/drawings, or Pine permission changes. Those paths have deterministic tests but need the corresponding account assets to verify live. Run `SESSION=... SIGNATURE=... npm run test:live` to repeat the authenticated subset.
diff --git a/eslint.config.js b/eslint.config.js
new file mode 100644
index 0000000..1368c02
--- /dev/null
+++ b/eslint.config.js
@@ -0,0 +1,24 @@
+// @ts-check
+import js from '@eslint/js';
+import tseslint from 'typescript-eslint';
+
+export default tseslint.config(
+ { ignores: ['dist/', 'node_modules/', 'coverage/'] },
+ js.configs.recommended,
+ ...tseslint.configs.recommended,
+ {
+ languageOptions: {
+ globals: {
+ console: 'readonly', process: 'readonly', setTimeout: 'readonly', clearTimeout: 'readonly',
+ setInterval: 'readonly', clearInterval: 'readonly', AbortController: 'readonly', URL: 'readonly',
+ },
+ },
+ rules: {
+ '@typescript-eslint/no-explicit-any': 'off',
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
+ 'no-console': 'off',
+ eqeqeq: ['error', 'always'],
+ 'prefer-const': 'error',
+ },
+ },
+);
diff --git a/examples/AllPrivateIndicators.js b/examples/AllPrivateIndicators.js
deleted file mode 100644
index 5122e5f..0000000
--- a/examples/AllPrivateIndicators.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example creates a chart with all user's private indicators
- */
-
-if (!process.env.SESSION || !process.env.SIGNATURE) {
- throw Error('Please set your sessionid and signature cookies');
-}
-
-const client = new TradingView.Client({
- token: process.env.SESSION,
- signature: process.env.SIGNATURE,
-});
-
-const chart = new client.Session.Chart();
-chart.setMarket('BINANCE:BTCEUR', {
- timeframe: 'D',
-});
-
-(async () => {
- const indicList = await TradingView.getPrivateIndicators(process.argv[2]);
-
- if (!indicList.length) {
- console.error('Your account has no private indicators');
- process.exit(0);
- }
-
- for (const indic of indicList) {
- const privateIndic = await indic.get();
- console.log('Loading indicator', indic.name, '...');
-
- const indicator = new chart.Study(privateIndic);
-
- indicator.onReady(() => {
- console.log('Indicator', indic.name, 'loaded !');
- });
-
- indicator.onUpdate(() => {
- console.log('Plot values', indicator.periods);
- console.log('Strategy report', indicator.strategyReport);
- });
- }
-})();
diff --git a/examples/BuiltInIndicator.js b/examples/BuiltInIndicator.js
deleted file mode 100644
index d805881..0000000
--- a/examples/BuiltInIndicator.js
+++ /dev/null
@@ -1,53 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example tests built-in indicators like volume-based indicators
- */
-
-const volumeProfile = new TradingView.BuiltInIndicator('VbPFixed@tv-basicstudies-241!');
-
-const needAuth = ![
- 'VbPFixed@tv-basicstudies-241',
- 'VbPFixed@tv-basicstudies-241!',
- 'Volume@tv-basicstudies-241',
-].includes(volumeProfile.type);
-
-if (needAuth && (!process.env.SESSION || !process.env.SIGNATURE)) {
- throw Error('Please set your sessionid and signature cookies');
-}
-
-const client = new TradingView.Client(
- needAuth
- ? {
- token: process.env.SESSION,
- signature: process.env.SIGNATURE,
- }
- : {},
-);
-
-const chart = new client.Session.Chart();
-chart.setMarket('BINANCE:BTCEUR', {
- timeframe: '60',
- range: 1,
-});
-
-/* Required or not, depending on the indicator */
-volumeProfile.setOption('first_bar_time', Date.now() - 10 ** 8);
-// volumeProfile.setOption('first_visible_bar_time', Date.now() - 10 ** 8);
-
-const VOL = new chart.Study(volumeProfile);
-VOL.onUpdate(() => {
- VOL.graphic.horizHists
- .filter((h) => h.lastBarTime === 0) // We only keep recent volume infos
- .sort((a, b) => b.priceHigh - a.priceHigh)
- .forEach((h) => {
- console.log(
- `~ ${Math.round((h.priceHigh + h.priceLow) / 2)} € :`,
- `${'_'.repeat(h.rate[0] / 3)}${'_'.repeat(h.rate[1] / 3)}`,
- );
- });
-
- client.end();
-});
diff --git a/examples/CustomChartType.js b/examples/CustomChartType.js
deleted file mode 100644
index 62cf4c3..0000000
--- a/examples/CustomChartType.js
+++ /dev/null
@@ -1,125 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example creates charts of custom types such as 'HeikinAshi', 'Renko',
- * 'LineBreak', 'Kagi', 'PointAndFigure', and 'Range' with default settings.
- */
-
-const client = new TradingView.Client({
- /*
- Token and signature are only required if you want to use
- intraday timeframes (if you have a paid TradingView account)
- */
- token: process.env.SESSION,
- signature: process.env.SIGNATURE,
-});
-
-const chart = new client.Session.Chart();
-
-chart.onError((...err) => {
- console.log('Chart error:', ...err);
- process.exit(1);
-});
-
-chart.onUpdate(() => {
- if (!chart.periods[0]) return;
- console.log('Last period', chart.periods[0]);
-});
-
-/* (0s) Heikin Ashi chart */
-setTimeout(() => {
- console.log('\nSetting chart type to: HeikinAshi');
-
- chart.setMarket('BINANCE:BTCEUR', {
- type: 'HeikinAshi',
- timeframe: 'D',
- });
-}, 0);
-
-/* (5s) Renko chart */
-setTimeout(() => {
- console.log('\nSetting chart type to: Renko');
-
- chart.setMarket('BINANCE:BTCEUR', {
- type: 'Renko',
- timeframe: 'D',
- inputs: {
- source: 'close',
- sources: 'Close',
- boxSize: 3,
- style: 'ATR',
- atrLength: 14,
- wicks: true,
- },
- });
-}, 5000);
-
-/* (10s) Line Break chart */
-setTimeout(() => {
- console.log('\nSetting chart type to: LineBreak');
-
- chart.setMarket('BINANCE:BTCEUR', {
- type: 'LineBreak',
- timeframe: 'D',
- inputs: {
- source: 'close',
- lb: 3,
- },
- });
-}, 10000);
-
-/* (15s) Kagi chart */
-setTimeout(() => {
- console.log('\nSetting chart type to: Kagi');
-
- chart.setMarket('BINANCE:BTCEUR', {
- type: 'Kagi',
- timeframe: 'D',
- inputs: {
- source: 'close',
- style: 'ATR',
- atrLength: 14,
- reversalAmount: 1,
- },
- });
-}, 15000);
-
-/* (20s) Point & Figure chart */
-setTimeout(() => {
- console.log('\nSetting chart type to: PointAndFigure');
-
- chart.setMarket('BINANCE:BTCEUR', {
- type: 'PointAndFigure',
- timeframe: 'D',
- inputs: {
- sources: 'Close',
- reversalAmount: 3,
- boxSize: 1,
- style: 'ATR',
- atrLength: 14,
- oneStepBackBuilding: false,
- },
- });
-}, 20000);
-
-/* (25s) Range chart */
-setTimeout(() => {
- console.log('\nSetting chart type to: Range');
-
- chart.setMarket('BINANCE:BTCEUR', {
- type: 'Range',
- timeframe: 'D',
- inputs: {
- range: 1,
- phantomBars: false,
- },
- });
-}, 25000);
-
-/* (30s) Delete chart, close client */
-setTimeout(() => {
- console.log('\nClosing client...');
- client.end();
-}, 30000);
diff --git a/examples/CustomTimeframe.js b/examples/CustomTimeframe.js
deleted file mode 100644
index 1571784..0000000
--- a/examples/CustomTimeframe.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example tests custom timeframes like 1 second
- */
-
-if (!process.env.SESSION || !process.env.SIGNATURE) {
- throw Error('Please set your sessionid and signature cookies');
-}
-
-const client = new TradingView.Client({
- token: process.env.SESSION,
- signature: process.env.SIGNATURE,
-});
-
-const chart = new client.Session.Chart();
-chart.setTimezone('Europe/Paris');
-
-chart.setMarket('CAPITALCOM:US100', {
- timeframe: '1S',
- range: 10,
-});
-
-chart.onSymbolLoaded(() => {
- console.log(chart.infos.name, 'loaded !');
-});
-
-chart.onUpdate(() => {
- console.log('OK', chart.periods);
- client.end();
-});
diff --git a/examples/Errors.js b/examples/Errors.js
deleted file mode 100644
index 1770e66..0000000
--- a/examples/Errors.js
+++ /dev/null
@@ -1,157 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example tests many types of errors
- */
-
-if (!process.env.SESSION || !process.env.SIGNATURE) {
- throw Error('Please set your sessionid and signature cookies');
-}
-
-// Creates a websocket client
-const client = new TradingView.Client({
- token: process.env.SESSION,
- signature: process.env.SIGNATURE,
-});
-
-const tests = [
- (next) => { /* Testing "Credentials error" */
- console.info('\nTesting "Credentials error" error:');
-
- const client2 = new TradingView.Client({
- token: 'FAKE_CREDENTIALS', // Set wrong credentials
- });
-
- client2.onError((...err) => {
- console.error(' => Client error:', err);
- client2.end();
- next();
- });
- },
-
- (next) => { /* Testing "Invalid symbol" */
- console.info('\nTesting "Invalid symbol" error:');
-
- const chart = new client.Session.Chart();
- chart.onError((...err) => { // Listen for errors
- console.error(' => Chart error:', err);
- chart.delete();
- next();
- });
-
- chart.setMarket('XXXXX'); // Set a wrong market
- },
-
- (next) => { /* Testing "Invalid timezone" */
- console.info('\nTesting "Invalid timezone" error:');
-
- const chart = new client.Session.Chart();
- chart.onError((...err) => { // Listen for errors
- console.error(' => Chart error:', err);
- next();
- });
-
- chart.setMarket('BINANCE:BTCEUR'); // Set a market
- chart.setTimezone('Nowhere/Nowhere'); // Set a fake timezone
- },
-
- (next) => { /* Testing "Custom timeframe" */
- console.info('\nTesting "Custom timeframe" error:');
-
- const chart = new client.Session.Chart();
- chart.onError((...err) => { // Listen for errors
- console.error(' => Chart error:', err);
- chart.delete();
- next();
- });
-
- chart.setMarket('BINANCE:BTCEUR', { // Set a market
- timeframe: '20', // Set a custom timeframe
- /*
- Timeframe '20' isn't available because we are
- not logged in as a premium TradingView account
- */
- });
- },
-
- (next) => { /* Testing "Invalid timeframe" */
- console.info('\nTesting "Invalid timeframe" error:');
-
- const chart = new client.Session.Chart();
- chart.onError((...err) => { // Listen for errors
- console.error(' => Chart error:', err);
- next();
- });
-
- chart.setMarket('BINANCE:BTCEUR', { // Set a market
- timeframe: 'XX', // Set a wrong timeframe
- });
- },
-
- (next) => { /* Testing "Study not auth" */
- console.info('\nTesting "Study not auth" error:');
-
- const chart = new client.Session.Chart();
- chart.onError((...err) => { // Listen for errors
- console.error(' => Chart error:', err);
- next();
- });
-
- chart.setMarket('BINANCE:BTCEUR', { // Set a market
- timeframe: '15',
- type: 'Renko',
- });
-
- chart.onUpdate(() => {
- console.log('DATA', chart.periods[0]);
- });
- },
-
- (next) => { /* Testing "Set the market before" */
- console.info('\nTesting "Set the market before..." error:');
-
- const chart = new client.Session.Chart();
- chart.onError((...err) => { // Listen for errors
- console.error(' => Chart error:', err);
- chart.delete();
- next();
- });
-
- chart.setSeries('15'); // Set series before setting the market
- },
-
- (next) => { /* Testing "Inexistent indicator" */
- console.info('\nTesting "Inexistent indicator" error:');
-
- TradingView.getIndicator('STD;XXXXXXX')
- .catch((err) => {
- console.error(' => API error:', [err.message]);
- next();
- });
- },
-
- async (next) => { /* Testing "Invalid value" */
- console.info('\nTesting "Invalid value" error:');
-
- const chart = new client.Session.Chart();
- chart.setMarket('BINANCE:BTCEUR'); // Set a market
-
- const ST = await TradingView.getIndicator('STD;Supertrend');
- ST.setOption('Factor', -1); // This will cause an error
-
- const Supertrend = new chart.Study(ST);
- Supertrend.onError((...err) => {
- console.error(' => Study error:', err);
- chart.delete();
- next();
- });
- },
-];
-
-(async () => {
- // eslint-disable-next-line no-restricted-syntax, no-await-in-loop
- for (const t of tests) await new Promise(t);
- console.log(`\nTests ${tests.length}/${tests.length} done !`);
-})();
diff --git a/examples/FakeReplayMode.js b/examples/FakeReplayMode.js
deleted file mode 100644
index 09730cb..0000000
--- a/examples/FakeReplayMode.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const { Client } = require('../main');
-
-/**
- * This example tests the fake replay mode which
- * works in intraday even with free plan
- */
-
-console.log('----- Testing FakeReplayMode: -----');
-
-const client = new Client();
-const chart = new client.Session.Chart();
-
-chart.setMarket('BINANCE:BTCEUR', {
- timeframe: '240',
- range: -1, // Range is negative, so 'to' means 'from'
- to: Math.round(Date.now() / 1000) - 86400 * 7, // Seven days before now
- // to: 1600000000,
-});
-
-let interval = NaN;
-
-chart.onUpdate(async () => {
- const times = chart.periods.map((p) => p.time);
-
- const intrval = times[0] - times[1];
- if (Number.isNaN(interval) && times.length >= 2) interval = intrval;
-
- if (!Number.isNaN(interval) && interval !== intrval) {
- throw new Error(`Wrong interval: ${intrval} (should be ${interval})`);
- }
-
- console.log('Next ->', times[0]);
-
- if (times[0] > ((Date.now() / 1000) - 86400 * 1)) {
- await client.end();
- console.log('Done !', times.length);
- }
-
- chart.fetchMore(-2);
-});
diff --git a/examples/FromToData.js b/examples/FromToData.js
deleted file mode 100644
index 9d2b406..0000000
--- a/examples/FromToData.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example tests fetching chart data of a number
- * of candles before or after a timestamp
- */
-
-if (!process.env.SESSION || !process.env.SIGNATURE) {
- throw Error('Please set your sessionid and signature cookies');
-}
-
-const client = new TradingView.Client({
- token: process.env.SESSION,
- signature: process.env.SIGNATURE,
-});
-
-const chart = new client.Session.Chart();
-chart.setMarket('BINANCE:BTCEUR', {
- timeframe: '240',
- range: 2, // Can be positive to get before or negative to get after
- to: 1700000000,
-});
-
-// This works with indicators
-
-TradingView.getIndicator('STD;Supertrend').then(async (indic) => {
- console.log(`Loading '${indic.description}' study...`);
- const SUPERTREND = new chart.Study(indic);
-
- SUPERTREND.onUpdate(() => {
- console.log('Prices periods:', chart.periods);
- console.log('Study periods:', SUPERTREND.periods);
- client.end();
- });
-});
diff --git a/examples/GetDrawings.js b/examples/GetDrawings.js
deleted file mode 100644
index 40457d3..0000000
--- a/examples/GetDrawings.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example tests the getDrawings function
- */
-
-// First parameter must be the layoutID
-// If the layout is private:
-// - Second parameter must be the userid (you can use getUser function)
-// - You should provide your sessionid and signature cookies in .env file
-
-if (!process.argv[2]) throw Error('Please specify a layoutID');
-
-TradingView.getDrawings(process.argv[2], null, {
- session: process.env.SESSION,
- signature: process.env.SIGNATURE,
- id: process.argv[3],
-}).then((drawings) => {
- console.log(`Found ${drawings.length} drawings:`, drawings.map((d) => ({
- id: d.id,
- symbol: d.symbol,
- type: d.type,
- text: d.state.text,
- })));
-}).catch((err) => {
- console.error('Error:', err.message);
-});
diff --git a/examples/GraphicIndicator.js b/examples/GraphicIndicator.js
deleted file mode 100644
index 88a609b..0000000
--- a/examples/GraphicIndicator.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example tests an indicator that sends graphic data such
- * as 'lines', 'labels', 'boxes', 'tables', 'polygons', etc...
- */
-
-if (!process.env.SESSION || !process.env.SIGNATURE) {
- throw Error('Please set your sessionid and signature cookies');
-}
-
-const client = new TradingView.Client({
- token: process.env.SESSION,
- signature: process.env.SIGNATURE,
-});
-
-const chart = new client.Session.Chart();
-chart.setMarket('BINANCE:BTCEUR', {
- timeframe: '5',
- range: 10000,
-});
-
-// TradingView.getIndicator('USER;01efac32df544348810bc843a7515f36').then((indic) => {
-// TradingView.getIndicator('PUB;5xi4DbWeuIQrU0Fx6ZKiI2odDvIW9q2j').then((indic) => {
-TradingView.getIndicator('STD;Zig_Zag').then((indic) => {
- const STD = new chart.Study(indic);
-
- STD.onError((...err) => {
- console.log('Study error:', ...err);
- });
-
- STD.onReady(() => {
- console.log(`STD '${STD.instance.description}' Loaded !`);
- });
-
- STD.onUpdate(() => {
- console.log('Graphic data:', STD.graphic);
- // console.log('Tables:', changes, STD.graphic.tables);
- // console.log('Cells:', STD.graphic.tables[0].cells());
- client.end();
- });
-});
diff --git a/examples/MultipleSyncFetch.js b/examples/MultipleSyncFetch.js
deleted file mode 100644
index a6ee5a0..0000000
--- a/examples/MultipleSyncFetch.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This examples synchronously fetches data from 3 indicators
- */
-
-if (!process.env.SESSION || !process.env.SIGNATURE) {
- throw Error('Please set your sessionid and signature cookies');
-}
-
-const client = new TradingView.Client({
- token: process.env.SESSION,
- signature: process.env.SIGNATURE,
-});
-
-function getIndicData(indicator) {
- const chart = new client.Session.Chart();
- chart.setMarket('BINANCE:DOTUSDT');
- const STD = new chart.Study(indicator);
-
- console.log(`Getting "${indicator.description}"...`);
-
- return new Promise((res) => {
- STD.onUpdate(() => {
- res(STD.periods);
- console.log(`"${indicator.description}" done !`);
- });
- });
-}
-
-(async () => {
- console.log('Getting all indicators...');
-
- const indicData = await Promise.all([
- await TradingView.getIndicator('PUB;3lEKXjKWycY5fFZRYYujEy8fxzRRUyF3'),
- await TradingView.getIndicator('PUB;5nawr3gCESvSHQfOhrLPqQqT4zM23w3X'),
- await TradingView.getIndicator('PUB;vrOJcNRPULteowIsuP6iHn3GIxBJdXwT'),
- ].map(getIndicData));
-
- console.log(indicData);
- console.log('All done !');
-
- client.end();
-})();
diff --git a/examples/PinePermManage.js b/examples/PinePermManage.js
deleted file mode 100644
index 9ac3320..0000000
--- a/examples/PinePermManage.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const { PinePermManager } = require('../main');
-
-/**
- * This example creates a pine permission manager
- * and tests all the available functions
- */
-
-if (!process.env.SESSION || !process.env.SIGNATURE) {
- throw Error('Please set your sessionid and signature cookies');
-}
-
-const pineid = process.argv[2];
-
-if (!pineid) throw Error('Please specify a pine id as first argument');
-
-console.log('Pine ID:', pineid);
-
-const manager = new PinePermManager(
- process.env.SESSION,
- process.env.SIGNATURE,
- pineid,
-);
-
-(async () => {
- console.log('Users:', await manager.getUsers());
-
- console.log('Adding user \'TradingView\'...');
-
- switch (await manager.addUser('TradingView')) {
- case 'ok':
- console.log('Done !');
- break;
- case 'exists':
- console.log('This user is already authorized');
- break;
- default:
- console.error('Unknown error...');
- break;
- }
-
- console.log('Users:', await manager.getUsers());
-
- console.log('Modifying expiration date...');
-
- const newDate = new Date(Date.now() + 24 * 3600000); // Add one day
- if (await manager.modifyExpiration('TradingView', newDate) === 'ok') {
- console.log('Done !');
- } else console.error('Unknown error...');
-
- console.log('Users:', await manager.getUsers());
-
- console.log('Removing expiration date...');
-
- if (await manager.modifyExpiration('TradingView') === 'ok') {
- console.log('Done !');
- } else console.error('Unknown error...');
-
- console.log('Users:', await manager.getUsers());
-
- console.log('Removing user \'TradingView\'...');
-
- if (await manager.removeUser('TradingView') === 'ok') {
- console.log('Done !');
- } else console.error('Unknown error...');
-
- console.log('Users:', await manager.getUsers());
-})();
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 0000000..2754f90
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,35 @@
+# Examples
+
+Build once, then run any example with Node or Bun:
+
+```bash
+npm ci && npm run build
+node examples/candles.js
+bun examples/candles.js # Bun loads .env automatically
+node --env-file=.env examples/indicator-data.js # Examples that need an account
+```
+
+Examples that need an account read the `SESSION` and `SIGNATURE` cookies from the environment (see `.env.sample`). Never commit them.
+
+| Example | API | Account |
+| --- | --- | --- |
+| [candles.js](candles.js) | `getCandles` (count, from/to) | No |
+| [watch-candles.js](watch-candles.js) | `watchCandles` | No |
+| [quotes.js](quotes.js) | `getQuote`, `getQuotes`, `watchQuotes` | No |
+| [indicator-data.js](indicator-data.js) | `getIndicatorData` | Pine scripts only |
+| [search.js](search.js) | `searchMarkets`, `searchIndicators`, `getTechnicalAnalysis` | No |
+| [custom-chart-types.js](custom-chart-types.js) | Heikin Ashi, Renko, Line Break, Kagi, P&F, Range | No (daily) |
+| [errors.js](errors.js) | `TradingViewError` codes | Partly |
+| [simple-chart.js](simple-chart.js) | `TradingViewClient`, `ChartSession` | No |
+| [quote-session.js](quote-session.js) | `QuoteSession` | No |
+| [builtin-indicator.js](builtin-indicator.js) | `BuiltInIndicator`, study graphics | No |
+| [fake-replay.js](fake-replay.js) | Negative counts and `fetchMore` | No |
+| [replay.js](replay.js) | Replay mode with studies | Pine studies only |
+| [custom-timeframe.js](custom-timeframe.js) | Second-based timeframes | Yes |
+| [from-to.js](from-to.js) | Reference times and ranges | Yes |
+| [graphic-indicator.js](graphic-indicator.js) | Labels, lines, boxes, tables | Yes |
+| [multiple-indicators.js](multiple-indicators.js) | Shared connection | Yes |
+| [private-indicators.js](private-indicators.js) | `getPrivateIndicators` | Yes |
+| [drawings.js](drawings.js) | `getDrawings` | Private layouts |
+| [pine-permissions.js](pine-permissions.js) | `PinePermissionManager` | Yes (script owner) |
+| [user-login.js](user-login.js) | `loginUser`, `getUser` | Username/password |
diff --git a/examples/ReplayMode.js b/examples/ReplayMode.js
deleted file mode 100644
index 853f768..0000000
--- a/examples/ReplayMode.js
+++ /dev/null
@@ -1,105 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example tests the real replay mode by fetching
- * indicator data and stores it in a 'periods' variable
- */
-
-if (!process.env.SESSION || !process.env.SIGNATURE) {
- throw Error('Please set your sessionid and signature cookies');
-}
-
-console.log('----- Testing ReplayMode: -----');
-
-const client = new TradingView.Client({
- token: process.env.SESSION,
- signature: process.env.SIGNATURE,
-});
-const chart = new client.Session.Chart();
-
-const config = {
- symbol: 'BINANCE:BTCEUR',
- timeframe: 'D',
- startFrom: Math.round(Date.now() / 1000) - 86400 * 7, // Seven days before now
- // startFrom: 1600000000,
-};
-
-chart.setMarket(config.symbol, {
- timeframe: config.timeframe,
- replay: config.startFrom,
- range: 1,
-});
-
-// chart.onReplayLoaded(() => {
-// console.log('STARTING REPLAY MODE');
-// chart.replayStart(1000);
-
-// // setTimeout(() => {
-// // console.log('STOPPING REPLAY MODE');
-// // chart.replayStop();
-// // }, 7000);
-// });
-
-let loading = 0;
-const indicators = [];
-const periods = {};
-
-let interval = NaN;
-
-async function step() {
- const period = { ...chart.periods[0] };
-
- const times = Object.keys(periods);
- const intrval = times[times.length - 1] - times[times.length - 2];
- if (Number.isNaN(interval) && times.length >= 2) interval = intrval;
-
- if (!Number.isNaN(interval) && interval !== intrval) {
- throw new Error(`Wrong interval: ${intrval} (should be ${interval})`);
- }
-
- indicators.forEach(([n, i]) => {
- const plots = { ...i.periods[0] };
- delete plots.$time;
- period[n] = { plots };
-
- Object.keys(i.graphic).forEach((g) => {
- if (!i.graphic[g].length) return;
- if (!period[n].graphics) period[n].graphics = {};
- period[n].graphics[g] = i.graphic[g];
- });
- });
-
- periods[period.time] = period;
-
- console.log('Next ->', period.time, times.length);
-
- await chart.replayStep(1);
- step();
-}
-
-chart.onReplayEnd(async () => {
- await client.end();
- console.log('Done !', Object.keys(periods).length);
-});
-
-async function addIndicator(name, pineId, options = {}) {
- loading += 1;
-
- const indic = pineId.includes('@')
- ? new TradingView.BuiltInIndicator(pineId)
- : await TradingView.getIndicator(pineId);
- Object.keys(options).forEach((o) => { indic.setOption(o, options[o]); });
-
- const std = new chart.Study(indic);
-
- std.onReady(() => {
- indicators.push([name, std]);
- if (loading === indicators.length) step();
- });
-}
-
-addIndicator('Volume', 'Volume@tv-basicstudies-241');
-addIndicator('EMA_50', 'STD;EMA', { Length: 50 });
-addIndicator('EMA_200', 'STD;EMA', { Length: 200 });
diff --git a/examples/Search.js b/examples/Search.js
deleted file mode 100644
index 724d2dd..0000000
--- a/examples/Search.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example tests the searching functions such
- * as 'searchMarketV3' and 'searchIndicator'
- */
-
-TradingView.searchMarketV3('BINANCE:').then((rs) => {
- console.log('Found Markets:', rs);
-});
-
-TradingView.searchIndicator('RSI').then((rs) => {
- console.log('Found Indicators:', rs);
-});
diff --git a/examples/SimpleChart.js b/examples/SimpleChart.js
deleted file mode 100644
index 7ca8c67..0000000
--- a/examples/SimpleChart.js
+++ /dev/null
@@ -1,65 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example creates a BTCEUR daily chart
- */
-
-const client = new TradingView.Client(); // Creates a websocket client
-
-const chart = new client.Session.Chart(); // Init a Chart session
-
-chart.setMarket('BINANCE:BTCEUR', { // Set the market
- timeframe: 'D',
-});
-
-chart.onError((...err) => { // Listen for errors (can avoid crash)
- console.error('Chart error:', ...err);
- // Do something...
-});
-
-chart.onSymbolLoaded(() => { // When the symbol is successfully loaded
- console.log(`Market "${chart.infos.description}" loaded !`);
-});
-
-chart.onUpdate(() => { // When price changes
- if (!chart.periods[0]) return;
- console.log(`[${chart.infos.description}]: ${chart.periods[0].close} ${chart.infos.currency_id}`);
- // Do something...
-});
-
-// Wait 5 seconds and set the market to BINANCE:ETHEUR
-setTimeout(() => {
- console.log('\nSetting market to BINANCE:ETHEUR...');
- chart.setMarket('BINANCE:ETHEUR', {
- timeframe: 'D',
- });
-}, 5000);
-
-// Wait 10 seconds and set the timeframe to 15 minutes
-setTimeout(() => {
- console.log('\nSetting timeframe to 15 minutes...');
- chart.setSeries('15');
-}, 10000);
-
-// Wait 15 seconds and set the chart type to "Heikin Ashi"
-setTimeout(() => {
- console.log('\nSetting the chart type to "Heikin Ashi"s...');
- chart.setMarket('BINANCE:ETHEUR', {
- timeframe: 'D',
- type: 'HeikinAshi',
- });
-}, 15000);
-
-// Wait 20 seconds and close the chart
-setTimeout(() => {
- console.log('\nClosing the chart...');
- chart.delete();
-}, 20000);
-
-// Wait 25 seconds and close the client
-setTimeout(() => {
- console.log('\nClosing the client...');
- client.end();
-}, 25000);
diff --git a/examples/UserLogin.js b/examples/UserLogin.js
deleted file mode 100644
index cf7a0bd..0000000
--- a/examples/UserLogin.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TradingView = require('../main');
-
-/**
- * This example tests the user login function
- */
-
-if (!process.argv[2]) throw Error('Please specify your username/email');
-if (!process.argv[3]) throw Error('Please specify your password');
-
-TradingView.loginUser(process.argv[2], process.argv[3], false).then((user) => {
- console.log('User:', user);
- console.log('Sessionid:', user.session);
- console.log('Signature:', user.signature);
-}).catch((err) => {
- console.error('Login error:', err.message);
-});
diff --git a/examples/builtin-indicator.js b/examples/builtin-indicator.js
new file mode 100644
index 0000000..551bc3b
--- /dev/null
+++ b/examples/builtin-indicator.js
@@ -0,0 +1,22 @@
+// Built-in studies such as the fixed-range volume profile.
+// Run: npm run build && node examples/builtin-indicator.js
+import { BuiltInIndicator, TradingViewClient } from '@mathieuc/tradingview';
+
+const profile = new BuiltInIndicator('VbPFixed@tv-basicstudies-241!');
+profile.setOption('first_bar_time', Date.now() - 10 ** 8);
+
+const client = new TradingViewClient();
+const chart = client.createChart();
+chart.setMarket('BINANCE:BTCEUR', { timeframe: '60', count: 1 });
+
+const study = chart.createStudy(profile);
+study.on('update', async () => {
+ const rows = study.graphics.horizHists
+ .filter((h) => h.lastBarTime === 0) // Profile that ends on the latest bar
+ .sort((a, b) => b.priceHigh - a.priceHigh);
+ if (!rows.length) return;
+ for (const h of rows) {
+ console.log(`~ ${Math.round((h.priceHigh + h.priceLow) / 2)} € : ${'_'.repeat(h.rate[0] / 3)}${'_'.repeat(h.rate[1] / 3)}`);
+ }
+ await client.close();
+});
diff --git a/examples/candles.js b/examples/candles.js
new file mode 100644
index 0000000..f10d48d
--- /dev/null
+++ b/examples/candles.js
@@ -0,0 +1,15 @@
+// One-shot candles with the high-level data API.
+// Run: npm run build && node examples/candles.js [SYMBOL] [TIMEFRAME]
+import { getCandles } from '@mathieuc/tradingview/data';
+
+const symbol = process.argv[2] ?? 'BINANCE:BTCUSDT';
+const timeframe = process.argv[3] ?? 'D';
+
+// The 100 most recent bars, oldest first. Resources are released automatically.
+const candles = await getCandles({ symbol, timeframe, count: 100 });
+const last = candles.at(-1);
+console.log(`${candles.length} ${timeframe} candles for ${symbol}; last close ${last.close} at ${new Date(last.time * 1000).toISOString()}`);
+
+// Every 4-hour bar of the last 7 days (history is loaded as deep as needed).
+const week = await getCandles({ symbol, timeframe: '240', from: new Date(Date.now() - 7 * 86_400_000) });
+console.log(`${week.length} 4h candles since ${new Date(week[0].time * 1000).toISOString()}`);
diff --git a/examples/custom-chart-types.js b/examples/custom-chart-types.js
new file mode 100644
index 0000000..16f23ca
--- /dev/null
+++ b/examples/custom-chart-types.js
@@ -0,0 +1,17 @@
+// Custom bar types: Heikin Ashi, Renko, Line Break, Kagi, Point & Figure and Range.
+// Run: npm run build && node examples/custom-chart-types.js
+import { getCandles } from '@mathieuc/tradingview/data';
+
+const types = {
+ HeikinAshi: {},
+ Renko: { source: 'close', sources: 'Close', boxSize: 3, style: 'ATR', atrLength: 14, wicks: true },
+ LineBreak: { source: 'close', lb: 3 },
+ Kagi: { source: 'close', style: 'ATR', atrLength: 14, reversalAmount: 1 },
+ PointAndFigure: { sources: 'Close', reversalAmount: 3, boxSize: 1, style: 'ATR', atrLength: 14, oneStepBackBuilding: false },
+ Range: { range: 1, phantomBars: false },
+};
+
+for (const [chartType, chartInputs] of Object.entries(types)) {
+ const candles = await getCandles({ symbol: 'BINANCE:BTCEUR', timeframe: 'D', count: 50, chartType, chartInputs });
+ console.log(chartType.padEnd(15), `${candles.length} bars, last close ${candles.at(-1)?.close}`);
+}
diff --git a/examples/custom-timeframe.js b/examples/custom-timeframe.js
new file mode 100644
index 0000000..f827055
--- /dev/null
+++ b/examples/custom-timeframe.js
@@ -0,0 +1,14 @@
+// Second-based and other custom timeframes need an account with access to them.
+// Run: npm run build && node --env-file=.env examples/custom-timeframe.js
+import { getCandles } from '@mathieuc/tradingview/data';
+
+if (!process.env.SESSION || !process.env.SIGNATURE) throw new Error('Please set your SESSION and SIGNATURE cookies');
+
+const candles = await getCandles({
+ symbol: 'CAPITALCOM:US100',
+ timeframe: '1S',
+ count: 10,
+ timezone: 'Europe/Paris',
+ credentials: { session: process.env.SESSION, signature: process.env.SIGNATURE },
+});
+console.log(candles);
diff --git a/examples/drawings.js b/examples/drawings.js
new file mode 100644
index 0000000..e851a16
--- /dev/null
+++ b/examples/drawings.js
@@ -0,0 +1,16 @@
+// Drawings of a saved layout (the ID in tradingview.com/chart/<ID>/).
+// Private layouts need credentials and your user ID (see examples/user-login.js).
+// Run: npm run build && node --env-file=.env examples/drawings.js <layoutId> [userId]
+import { getDrawings } from '@mathieuc/tradingview';
+
+const [layoutId, userId] = process.argv.slice(2);
+if (!layoutId) throw new Error('Please specify a layout ID');
+
+const drawings = await getDrawings(layoutId, {
+ credentials: process.env.SESSION ? { session: process.env.SESSION, signature: process.env.SIGNATURE } : undefined,
+ userId: userId ? Number(userId) : undefined,
+});
+
+console.log(`Found ${drawings.length} drawings:`, drawings.map((d) => ({
+ id: d.id, symbol: d.symbol, type: d.type, text: d.state?.text,
+})));
diff --git a/examples/errors.js b/examples/errors.js
new file mode 100644
index 0000000..4ef1295
--- /dev/null
+++ b/examples/errors.js
@@ -0,0 +1,44 @@
+// Every error is a TradingViewError with a `code`.
+// Run: npm run build && node --env-file=.env examples/errors.js
+import {
+ getCandles, getIndicator, getIndicatorData, TradingViewClient, TradingViewError,
+} from '@mathieuc/tradingview';
+
+const credentials = process.env.SESSION
+ ? { session: process.env.SESSION, signature: process.env.SIGNATURE }
+ : undefined;
+
+async function show(title, run) {
+ try {
+ await run();
+ console.log(`${title}: no error`);
+ } catch (error) {
+ if (!(error instanceof TradingViewError)) throw error;
+ console.log(`${title}: [${error.code}] ${error.message}`);
+ }
+}
+
+await show('Wrong credentials', () => new TradingViewClient({ credentials: { session: 'FAKE' } }).ready);
+await show('Invalid symbol', () => getCandles('XXXXX'));
+await show('Invalid timeframe', () => getCandles({ symbol: 'BINANCE:BTCEUR', timeframe: 'XX' }));
+await show('Premium chart type without account', () => getCandles({ symbol: 'BINANCE:BTCEUR', timeframe: '15', chartType: 'Renko' }));
+await show('Inexistent indicator', () => getIndicator('STD;XXXXXXX'));
+await show('Timeout', () => getCandles({ symbol: 'BINANCE:BTCEUR', timeoutMs: 1 }));
+
+// Low-level sessions report errors through their `error` event.
+const client = new TradingViewClient();
+const chart = client.createChart();
+await show('Invalid timezone', () => new Promise((resolve, reject) => {
+ chart.on('error', reject);
+ chart.setMarket('BINANCE:BTCEUR');
+ chart.setTimezone('Nowhere/Nowhere');
+ setTimeout(resolve, 5_000);
+}));
+await show('Timeframe before market', async () => client.createChart().setTimeframe('15'));
+await client.close();
+
+if (credentials) {
+ const supertrend = await getIndicator('STD;Supertrend');
+ supertrend.setInput('Factor', -1);
+ await show('Invalid study input', () => getIndicatorData({ symbol: 'BINANCE:BTCEUR', indicator: supertrend, credentials }));
+}
diff --git a/examples/fake-replay.js b/examples/fake-replay.js
new file mode 100644
index 0000000..988710d
--- /dev/null
+++ b/examples/fake-replay.js
@@ -0,0 +1,24 @@
+// "Fake replay": walk forward from a past date by loading newer bars, which
+// also works on intraday timeframes without an account.
+// Run: npm run build && node examples/fake-replay.js
+import { TradingViewClient } from '@mathieuc/tradingview';
+
+const client = new TradingViewClient();
+const chart = client.createChart();
+
+chart.setMarket('BINANCE:BTCEUR', {
+ timeframe: '240',
+ count: -1, // Negative: load bars after `to` instead of before
+ to: Math.round(Date.now() / 1000) - 86_400 * 7, // Seven days ago
+});
+
+chart.on('seriesCompleted', async () => {
+ const last = chart.lastCandle;
+ console.log('Next ->', last && new Date(last.time * 1000).toISOString(), `(${chart.candles.length} bars)`);
+ if (!last || last.time > Date.now() / 1000 - 86_400) {
+ await client.close();
+ console.log('Done');
+ return;
+ }
+ chart.fetchMore(-2); // Two newer bars
+});
diff --git a/examples/from-to.js b/examples/from-to.js
new file mode 100644
index 0000000..9038abb
--- /dev/null
+++ b/examples/from-to.js
@@ -0,0 +1,25 @@
+// Bars before or after a reference time, with an indicator on the same chart.
+// The reference time needs an account with enough history access.
+// Run: npm run build && node --env-file=.env examples/from-to.js
+import { getCandles, getIndicator, TradingViewClient } from '@mathieuc/tradingview';
+
+if (!process.env.SESSION || !process.env.SIGNATURE) throw new Error('Please set your SESSION and SIGNATURE cookies');
+const credentials = { session: process.env.SESSION, signature: process.env.SIGNATURE };
+
+// High level: every 4h bar between two dates.
+const range = await getCandles({
+ symbol: 'BINANCE:BTCEUR', timeframe: '240', from: new Date('2023-11-01'), to: new Date('2023-11-14'), credentials,
+});
+console.log(`${range.length} bars from ${new Date(range[0].time * 1000).toISOString()}`);
+
+// Low level: 2 bars before a timestamp (negative counts load bars after it) and a study.
+const client = new TradingViewClient({ credentials });
+const chart = client.createChart();
+chart.setMarket('BINANCE:BTCEUR', { timeframe: '240', count: 2, to: 1_700_000_000 });
+
+const supertrend = chart.createStudy(await getIndicator('STD;Supertrend'));
+supertrend.on('ready', async () => {
+ console.log('Prices:', chart.candles);
+ console.log('Study:', supertrend.values.slice(-2));
+ await client.close();
+});
diff --git a/examples/graphic-indicator.js b/examples/graphic-indicator.js
new file mode 100644
index 0000000..f5aae80
--- /dev/null
+++ b/examples/graphic-indicator.js
@@ -0,0 +1,18 @@
+// Indicators that draw labels, lines, boxes, tables, polygons...
+// Run: npm run build && node --env-file=.env examples/graphic-indicator.js
+import { getIndicatorData } from '@mathieuc/tradingview/data';
+
+if (!process.env.SESSION || !process.env.SIGNATURE) throw new Error('Please set your SESSION and SIGNATURE cookies');
+
+const { indicator, graphics } = await getIndicatorData({
+ symbol: 'BINANCE:BTCEUR',
+ timeframe: '5',
+ count: 1_000,
+ indicator: 'STD;Zig_Zag',
+ credentials: { session: process.env.SESSION, signature: process.env.SIGNATURE },
+});
+
+console.log(`'${indicator.description}' graphics:`);
+console.log('Lines:', graphics.lines.slice(0, 5)); // x positions are bars back from the latest bar
+console.log('Labels:', graphics.labels.slice(0, 5));
+console.log('Tables:', graphics.tables.map((t) => t.cells.map((row) => row.map((cell) => cell.text))));
diff --git a/examples/indicator-data.js b/examples/indicator-data.js
new file mode 100644
index 0000000..bcaf7bf
--- /dev/null
+++ b/examples/indicator-data.js
@@ -0,0 +1,23 @@
+// Indicator values with the high-level data API.
+// Pine indicators (STD;..., PUB;..., USER;...) need an account: set SESSION and SIGNATURE.
+// Run: npm run build && node --env-file=.env examples/indicator-data.js
+import { getIndicatorData } from '@mathieuc/tradingview/data';
+
+const credentials = process.env.SESSION
+ ? { session: process.env.SESSION, signature: process.env.SIGNATURE }
+ : undefined;
+
+// A built-in study works without an account.
+const volume = await getIndicatorData({ symbol: 'BINANCE:BTCEUR', indicator: 'Volume@tv-basicstudies-241', count: 5 });
+console.log('Volume rows:', volume.values);
+
+if (credentials) {
+ const rsi = await getIndicatorData({
+ symbol: 'BINANCE:BTCEUR',
+ timeframe: '60',
+ indicator: 'STD;RSI',
+ inputs: { Length: 21 }, // Input ID, number, inline name or internal ID
+ credentials,
+ });
+ console.log('Last RSI row:', rsi.values.at(-1));
+} else console.log('Set SESSION and SIGNATURE to run a Pine indicator');
diff --git a/examples/multiple-indicators.js b/examples/multiple-indicators.js
new file mode 100644
index 0000000..63283e1
--- /dev/null
+++ b/examples/multiple-indicators.js
@@ -0,0 +1,16 @@
+// Several indicators in parallel over one shared connection.
+// Run: npm run build && node --env-file=.env examples/multiple-indicators.js
+import { getIndicatorData, TradingViewClient } from '@mathieuc/tradingview';
+
+if (!process.env.SESSION || !process.env.SIGNATURE) throw new Error('Please set your SESSION and SIGNATURE cookies');
+const credentials = { session: process.env.SESSION, signature: process.env.SIGNATURE };
+
+const client = new TradingViewClient({ credentials });
+try {
+ const results = await Promise.all(['STD;RSI', 'STD;MACD', 'STD;Bollinger_Bands'].map((indicator) => (
+ getIndicatorData({ symbol: 'BINANCE:DOTUSDT', indicator, client, credentials })
+ )));
+ for (const { indicator, values } of results) console.log(indicator.description, values.at(-1));
+} finally {
+ await client.close();
+}
diff --git a/examples/pine-permissions.js b/examples/pine-permissions.js
new file mode 100644
index 0000000..4f99bcd
--- /dev/null
+++ b/examples/pine-permissions.js
@@ -0,0 +1,18 @@
+// Manage who can use an invite-only script you own.
+// Run: npm run build && node --env-file=.env examples/pine-permissions.js <PUB;pineId>
+import { PinePermissionManager } from '@mathieuc/tradingview';
+
+if (!process.env.SESSION || !process.env.SIGNATURE) throw new Error('Please set your SESSION and SIGNATURE cookies');
+const pineId = process.argv[2];
+if (!pineId) throw new Error('Please specify a Pine ID as first argument');
+
+const manager = new PinePermissionManager(pineId, {
+ credentials: { session: process.env.SESSION, signature: process.env.SIGNATURE },
+});
+
+console.log('Users:', await manager.getUsers());
+console.log("Adding 'TradingView':", await manager.addUser('TradingView')); // 'ok' or 'exists'
+console.log('Expiring tomorrow:', await manager.modifyExpiration('TradingView', new Date(Date.now() + 86_400_000)));
+console.log('Removing expiration:', await manager.modifyExpiration('TradingView'));
+console.log('Removing user:', await manager.removeUser('TradingView'));
+console.log('Users:', await manager.getUsers());
diff --git a/examples/private-indicators.js b/examples/private-indicators.js
new file mode 100644
index 0000000..d1614f2
--- /dev/null
+++ b/examples/private-indicators.js
@@ -0,0 +1,27 @@
+// Run every private (saved) indicator of your account on a chart.
+// Run: npm run build && node --env-file=.env examples/private-indicators.js
+import { getIndicator, getPrivateIndicators, TradingViewClient } from '@mathieuc/tradingview';
+
+if (!process.env.SESSION || !process.env.SIGNATURE) throw new Error('Please set your SESSION and SIGNATURE cookies');
+const credentials = { session: process.env.SESSION, signature: process.env.SIGNATURE };
+
+const list = await getPrivateIndicators(credentials);
+if (!list.length) {
+ console.log('Your account has no private indicators');
+ process.exit(0);
+}
+
+const client = new TradingViewClient({ credentials });
+const chart = client.createChart();
+chart.setMarket('BINANCE:BTCEUR', { timeframe: 'D' });
+
+for (const item of list) {
+ const study = chart.createStudy(await getIndicator(item.id, { version: item.version, credentials }));
+ study.on('error', (error) => console.error(item.name, error.message));
+ study.on('ready', () => {
+ console.log(item.name, 'last values:', study.values.at(-1));
+ if (study.strategyReport.performance.all) console.log(item.name, 'strategy:', study.strategyReport.performance.all);
+ });
+}
+
+setTimeout(() => client.close(), 15_000);
diff --git a/examples/quote-session.js b/examples/quote-session.js
new file mode 100644
index 0000000..4d25185
--- /dev/null
+++ b/examples/quote-session.js
@@ -0,0 +1,17 @@
+// Low-level quote session: several symbols sharing one subscription list.
+// Run: npm run build && node examples/quote-session.js
+import { TradingViewClient } from '@mathieuc/tradingview';
+
+const client = new TradingViewClient();
+const quotes = client.createQuoteSession({ fields: ['lp', 'ch', 'chp', 'volume'] });
+
+for (const symbol of ['BINANCE:BTCEUR', 'BINANCE:ETHEUR']) {
+ const subscription = quotes.subscribe(symbol);
+ subscription.on('data', (quote, changes) => console.log(symbol, changes));
+ subscription.on('error', (error) => console.error(symbol, error.message));
+}
+
+setTimeout(async () => {
+ quotes.delete();
+ await client.close();
+}, 10_000);
diff --git a/examples/quotes.js b/examples/quotes.js
new file mode 100644
index 0000000..ea4da55
--- /dev/null
+++ b/examples/quotes.js
@@ -0,0 +1,15 @@
+// Quotes with the high-level data API.
+// Run: npm run build && node examples/quotes.js
+import { getQuote, getQuotes, watchQuotes } from '@mathieuc/tradingview/data';
+
+const btc = await getQuote('BINANCE:BTCUSDT');
+console.log('BTC/USDT', btc.lp, `${btc.chp}%`);
+
+const prices = await getQuotes({ symbols: ['NASDAQ:AAPL', 'NASDAQ:MSFT', 'FX:EURUSD'], fields: 'price' });
+for (const [symbol, quote] of Object.entries(prices)) console.log(symbol, quote.lp);
+
+const watcher = await watchQuotes({ symbols: ['BINANCE:BTCUSDT', 'BINANCE:ETHUSDT'], fields: ['lp', 'chp'] }, {
+ onData: (symbol, quote) => console.log(symbol, quote.lp),
+ onError: (error) => console.error(error.message),
+});
+setTimeout(() => watcher.stop(), 15_000);
diff --git a/examples/replay.js b/examples/replay.js
new file mode 100644
index 0000000..d48b46c
--- /dev/null
+++ b/examples/replay.js
@@ -0,0 +1,36 @@
+// Replay mode: step through history bar by bar with indicators.
+// Run: npm run build && node --env-file=.env examples/replay.js
+import { BuiltInIndicator, getIndicator, TradingViewClient } from '@mathieuc/tradingview';
+
+const credentials = process.env.SESSION
+ ? { session: process.env.SESSION, signature: process.env.SIGNATURE }
+ : undefined;
+
+const client = new TradingViewClient({ credentials });
+const chart = client.createChart();
+chart.setMarket('BINANCE:BTCEUR', {
+ timeframe: 'D',
+ replay: Math.round(Date.now() / 1000) - 86_400 * 7, // Start seven days ago
+ count: 1,
+});
+
+const studies = { Volume: chart.createStudy(new BuiltInIndicator('Volume@tv-basicstudies-241')) };
+if (credentials) {
+ const ema = await getIndicator('STD;EMA');
+ studies.EMA_50 = chart.createStudy(ema.clone().setInput('Length', 50));
+}
+
+let ended = false;
+chart.on('replayEnd', () => { ended = true; });
+await new Promise((resolve) => { chart.once('replayLoaded', resolve); });
+
+while (!ended) {
+ await chart.replayStep(1);
+ const bar = chart.lastCandle;
+ const values = Object.fromEntries(Object.entries(studies).map(([name, study]) => [name, study.values.at(-1)]));
+ console.log(bar && new Date(bar.time * 1000).toISOString(), bar?.close, values);
+}
+
+// chart.replayStart(1000) plays automatically; chart.replayStop() pauses.
+await client.close();
+console.log('Done');
diff --git a/examples/search.js b/examples/search.js
new file mode 100644
index 0000000..42b7b3e
--- /dev/null
+++ b/examples/search.js
@@ -0,0 +1,11 @@
+// Market search, indicator search and technical ratings.
+// Run: npm run build && node examples/search.js
+import { getTechnicalAnalysis, searchIndicators, searchMarkets } from '@mathieuc/tradingview';
+
+const markets = await searchMarkets('BINANCE:BTC', { type: 'crypto' });
+console.log('Markets:', markets.slice(0, 5).map((m) => `${m.id} (${m.description})`));
+
+const indicators = await searchIndicators('RSI');
+console.log('Indicators:', indicators.slice(0, 5).map((i) => `${i.id} - ${i.name} [${i.access}]`));
+
+console.log('Daily ratings for', markets[0].id, (await getTechnicalAnalysis(markets[0].id))?.['1D']);
diff --git a/examples/simple-chart.js b/examples/simple-chart.js
new file mode 100644
index 0000000..8c790d4
--- /dev/null
+++ b/examples/simple-chart.js
@@ -0,0 +1,36 @@
+// Low-level chart session: change market, timeframe and chart type on one chart.
+// Run: npm run build && node examples/simple-chart.js
+import { TradingViewClient } from '@mathieuc/tradingview';
+
+const client = new TradingViewClient();
+const chart = client.createChart();
+
+chart.on('error', (error) => console.error('Chart error:', error.code, error.message));
+chart.on('symbolLoaded', (info) => console.log(`Market "${info.description}" loaded`));
+chart.on('update', () => {
+ const last = chart.lastCandle;
+ if (last) console.log(`[${chart.symbolInfo?.description}] ${last.close} ${chart.symbolInfo?.currency_id}`);
+});
+
+chart.setMarket('BINANCE:BTCEUR', { timeframe: 'D' });
+
+setTimeout(() => {
+ console.log('\nSetting market to BINANCE:ETHEUR...');
+ chart.setMarket('BINANCE:ETHEUR', { timeframe: 'D' });
+}, 5_000);
+
+setTimeout(() => {
+ console.log('\nSetting timeframe to 15 minutes...');
+ chart.setTimeframe('15');
+}, 10_000);
+
+setTimeout(() => {
+ console.log('\nSetting the chart type to Heikin Ashi...');
+ chart.setMarket('BINANCE:ETHEUR', { timeframe: 'D', type: 'HeikinAshi' });
+}, 15_000);
+
+setTimeout(async () => {
+ console.log('\nClosing...');
+ chart.delete();
+ await client.close();
+}, 20_000);
diff --git a/examples/user-login.js b/examples/user-login.js
new file mode 100644
index 0000000..e90f9a3
--- /dev/null
+++ b/examples/user-login.js
@@ -0,0 +1,15 @@
+// Sign in to get session cookies (accounts with 2FA/captcha are not supported).
+// Never commit or share the printed cookies.
+// Run: npm run build && node examples/user-login.js <username/email> <password>
+import { getUser, loginUser } from '@mathieuc/tradingview';
+
+const [username, password] = process.argv.slice(2);
+if (!username || !password) throw new Error('Usage: node examples/user-login.js <username/email> <password>');
+
+const user = await loginUser({ username, password, remember: false });
+console.log('Signed in as', user.username, `(id ${user.id})`);
+console.log('Put these in .env as SESSION and SIGNATURE:', { session: user.session, signature: user.signature });
+
+// Later, the account can be loaded from the cookies alone:
+const again = await getUser({ session: user.session, signature: user.signature });
+console.log('Reloaded', again.username);
diff --git a/examples/watch-candles.js b/examples/watch-candles.js
new file mode 100644
index 0000000..d5d9b0c
--- /dev/null
+++ b/examples/watch-candles.js
@@ -0,0 +1,16 @@
+// Real-time candles with the high-level data API.
+// Run: npm run build && node examples/watch-candles.js
+import { watchCandles } from '@mathieuc/tradingview/data';
+
+const watcher = await watchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '1', count: 10 }, {
+ onData: (candles) => {
+ const last = candles.at(-1);
+ console.log(new Date(last.time * 1000).toISOString(), 'close', last.close);
+ },
+ onError: (error) => console.error('Watcher error:', error.code, error.message),
+});
+
+console.log(`Watching ${watcher.symbolInfo?.description}... (stops after 30 seconds)`);
+setTimeout(() => watcher.stop(), 30_000);
+await watcher.closed;
+console.log('Stopped');
diff --git a/llms.txt b/llms.txt
index 059fe8d..b5c411e 100644
--- a/llms.txt
+++ b/llms.txt
@@ -2,11 +2,22 @@
# https://github.com/Mathieu2301/TradingView-API
# https://www.npmjs.com/package/@mathieuc/tradingview
-Independent community library for market data and indicators. Not an official TradingView API.
-Stable npm entry point: require('@mathieuc/tradingview').
-Development-preview agent API: agent.ts / agent.js, built with npm run build:agent.
-One-shot: fetchCandles({ symbol, timeframe?, limit?, timeoutMs?, signal? }).
-Realtime: await watchCandles(query, { onData, onError? }); await worker.stop().
-Full guide: docs/agent-api.md. Human guide: README.md. Examples: examples/.
-MCP, CLI, backtesting and hosted trading API are not shipped. Do not claim otherwise.
+Independent community library for TradingView market data. Not an official TradingView API.
+Version 4 beta: TypeScript, ESM, Node >= 20 or Bun. Breaking rewrite of v3 (no compatibility layer). Currently available from repository source only; npm still serves v3.
+
+Simple data API (import from '@mathieuc/tradingview/data' or the root entry):
+- getCandles({ symbol, timeframe?, count?, from?, to?, chartType?, ... }) -> Candle[] oldest first, time in Unix seconds.
+- watchCandles(query, { onData, onError? }) -> watcher { latest, stop(), closed }.
+- getQuote(symbol), getQuotes({ symbols }), watchQuotes({ symbols }, { onData }).
+- getSymbolInfo(symbol), getIndicatorData({ symbol, indicator, inputs? }), watchIndicator(...).
+- searchMarkets(text), searchIndicators(text), getTechnicalAnalysis(symbol).
+- Websocket data calls accept timeoutMs, signal (AbortSignal), credentials ({ session, signature }) and client (shared TradingViewClient). HTTP lookups accept signal in options.
+- Candle calls can use a custom MarketDataProvider; TradingViewProvider is the default source adapter.
+- Errors are TradingViewError with a code (SYMBOL_ERROR, TIMEOUT, STUDY_ERROR, NO_DATA...).
+
+Low-level API: TradingViewClient, client.createChart() (ChartSession: setMarket, setTimeframe, fetchMore, replay, createStudy), client.createQuoteSession(), PineIndicator, BuiltInIndicator, HTTP functions (loginUser, getUser, getIndicator, getPrivateIndicators, getDrawings, PinePermissionManager).
+
+Pine studies need a TradingView account (session cookies). Built-in studies and candles/quotes work anonymously, with history limits.
+Docs: docs/data-api.md, docs/low-level-api.md, docs/migration-v4.md, docs/v4-coverage.md. Examples: examples/.
+No CLI, MCP server, backtesting engine or hosted trading API is shipped. Do not claim otherwise.
Questions and bugs: https://github.com/Mathieu2301/TradingView-API/issues/new/choose
diff --git a/main.js b/main.js
deleted file mode 100644
index c1b7a9a..0000000
--- a/main.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const miscRequests = require('./src/miscRequests');
-const Client = require('./src/client');
-const BuiltInIndicator = require('./src/classes/BuiltInIndicator');
-const PineIndicator = require('./src/classes/PineIndicator');
-const PinePermManager = require('./src/classes/PinePermManager');
-
-module.exports = { ...miscRequests };
-module.exports.Client = Client;
-module.exports.BuiltInIndicator = BuiltInIndicator;
-module.exports.PineIndicator = PineIndicator;
-module.exports.PinePermManager = PinePermManager;
diff --git a/package-lock.json b/package-lock.json
index f298d5d..ad65af0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,532 +1,50 @@
{
"name": "@mathieuc/tradingview",
- "version": "3.5.2",
- "lockfileVersion": 2,
+ "version": "4.0.0-beta.0",
+ "lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@mathieuc/tradingview",
- "version": "3.5.2",
+ "version": "4.0.0-beta.0",
"license": "ISC",
"dependencies": {
- "axios": "^1.5.0",
- "jszip": "^3.7.1",
- "ws": "^7.4.3"
+ "ws": "^8.18.0"
},
"devDependencies": {
- "@babel/eslint-parser": "^7.15.7",
- "@mathieuc/console": "^1.0.1",
- "@types/node": "^20.19.43",
- "@typescript-eslint/eslint-plugin": "^5.62.0",
- "@typescript-eslint/parser": "^5.62.0",
- "dotenv": "^16.3.1",
- "eslint": "^7.25.0",
- "eslint-config-airbnb-base": "^14.2.1",
- "eslint-plugin-import": "^2.22.1",
- "typescript": "^5.9.3",
- "vitest": "^0.31.4"
+ "@eslint/js": "^9.39.0",
+ "@types/node": "^22.20.5",
+ "@types/ws": "^8.18.1",
+ "eslint": "^9.39.0",
+ "typescript": "~5.9.3",
+ "typescript-eslint": "^8.46.0",
+ "vitest": "^3.2.4"
},
"engines": {
- "node": ">=14.0.0"
- }
- },
- "node_modules/@babel/code-frame": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
- "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==",
- "dev": true,
- "dependencies": {
- "@babel/highlight": "^7.10.4"
- }
- },
- "node_modules/@babel/compat-data": {
- "version": "7.15.0",
- "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz",
- "integrity": "sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==",
- "dev": true,
- "peer": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/core": {
- "version": "7.15.5",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.5.tgz",
- "integrity": "sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "@babel/code-frame": "^7.14.5",
- "@babel/generator": "^7.15.4",
- "@babel/helper-compilation-targets": "^7.15.4",
- "@babel/helper-module-transforms": "^7.15.4",
- "@babel/helpers": "^7.15.4",
- "@babel/parser": "^7.15.5",
- "@babel/template": "^7.15.4",
- "@babel/traverse": "^7.15.4",
- "@babel/types": "^7.15.4",
- "convert-source-map": "^1.7.0",
- "debug": "^4.1.0",
- "gensync": "^1.0.0-beta.2",
- "json5": "^2.1.2",
- "semver": "^6.3.0",
- "source-map": "^0.5.0"
- },
- "engines": {
- "node": ">=6.9.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/babel"
- }
- },
- "node_modules/@babel/core/node_modules/@babel/code-frame": {
- "version": "7.14.5",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz",
- "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "@babel/highlight": "^7.14.5"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "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,
- "license": "ISC",
- "peer": true,
- "bin": {
- "semver": "bin/semver.js"
- }
- },
- "node_modules/@babel/eslint-parser": {
- "version": "7.15.7",
- "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.15.7.tgz",
- "integrity": "sha512-yJkHyomClm6A2Xzb8pdAo4HzYMSXFn1O5zrCYvbFP0yQFvHueLedV8WiEno8yJOKStjUXzBZzJFeWQ7b3YMsqQ==",
- "dev": true,
- "dependencies": {
- "eslint-scope": "^5.1.1",
- "eslint-visitor-keys": "^2.1.0",
- "semver": "^6.3.0"
- },
- "engines": {
- "node": "^10.13.0 || ^12.13.0 || >=14.0.0"
- },
- "peerDependencies": {
- "@babel/core": ">=7.11.0",
- "eslint": ">=7.5.0"
- }
- },
- "node_modules/@babel/eslint-parser/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,
- "license": "ISC",
- "bin": {
- "semver": "bin/semver.js"
- }
- },
- "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,
- "license": "MIT",
- "peer": true,
- "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"
- }
- },
- "node_modules/@babel/helper-compilation-targets": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz",
- "integrity": "sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "@babel/compat-data": "^7.15.0",
- "@babel/helper-validator-option": "^7.14.5",
- "browserslist": "^4.16.6",
- "semver": "^6.3.0"
- },
- "engines": {
- "node": ">=6.9.0"
- },
- "peerDependencies": {
- "@babel/core": "^7.0.0"
- }
- },
- "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,
- "license": "ISC",
- "peer": true,
- "bin": {
- "semver": "bin/semver.js"
- }
- },
- "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,
- "license": "MIT",
- "peer": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-member-expression-to-functions": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz",
- "integrity": "sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "@babel/types": "^7.15.4"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-module-imports": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz",
- "integrity": "sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "@babel/types": "^7.15.4"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-module-transforms": {
- "version": "7.15.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz",
- "integrity": "sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "@babel/helper-module-imports": "^7.15.4",
- "@babel/helper-replace-supers": "^7.15.4",
- "@babel/helper-simple-access": "^7.15.4",
- "@babel/helper-split-export-declaration": "^7.15.4",
- "@babel/helper-validator-identifier": "^7.15.7",
- "@babel/template": "^7.15.4",
- "@babel/traverse": "^7.15.4",
- "@babel/types": "^7.15.6"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-optimise-call-expression": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz",
- "integrity": "sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "@babel/types": "^7.15.4"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-replace-supers": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz",
- "integrity": "sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "@babel/helper-member-expression-to-functions": "^7.15.4",
- "@babel/helper-optimise-call-expression": "^7.15.4",
- "@babel/traverse": "^7.15.4",
- "@babel/types": "^7.15.4"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-simple-access": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz",
- "integrity": "sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "@babel/types": "^7.15.4"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-split-export-declaration": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz",
- "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "@babel/types": "^7.15.4"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "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==",
- "dev": true,
- "license": "MIT",
- "peer": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "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==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-validator-option": {
- "version": "7.14.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz",
- "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==",
- "dev": true,
- "peer": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helpers": {
- "version": "7.28.6",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz",
- "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==",
- "dev": true,
- "license": "MIT",
- "peer": true,
- "dependencies": {
- "@babel/template": "^7.28.6",
- "@babel/types": "^7.28.6"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/highlight": {
- "version": "7.14.5",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz",
- "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==",
- "dev": true,
- "dependencies": {
- "@babel/helper-validator-identifier": "^7.14.5",
- "chalk": "^2.0.0",
- "js-tokens": "^4.0.0"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/highlight/node_modules/ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "dependencies": {
- "color-convert": "^1.9.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/chalk": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dev": true,
- "dependencies": {
- "color-name": "1.1.3"
- }
- },
- "node_modules/@babel/highlight/node_modules/color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
- "dev": true
- },
- "node_modules/@babel/highlight/node_modules/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,
- "engines": {
- "node": ">=0.8.0"
- }
- },
- "node_modules/@babel/highlight/node_modules/has-flag": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/supports-color": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
- "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
- "dev": true,
- "dependencies": {
- "has-flag": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/parser": {
- "version": "7.29.0",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz",
- "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==",
- "dev": true,
- "license": "MIT",
- "peer": true,
- "dependencies": {
- "@babel/types": "^7.29.0"
- },
- "bin": {
- "parser": "bin/babel-parser.js"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "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,
- "license": "MIT",
- "peer": true,
- "dependencies": {
- "@babel/code-frame": "^7.28.6",
- "@babel/parser": "^7.28.6",
- "@babel/types": "^7.28.6"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/template/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,
- "license": "MIT",
- "peer": true,
- "dependencies": {
- "@babel/helper-validator-identifier": "^7.28.5",
- "js-tokens": "^4.0.0",
- "picocolors": "^1.1.1"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "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,
- "license": "MIT",
- "peer": true,
- "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"
- }
- },
- "node_modules/@babel/traverse/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,
- "license": "MIT",
- "peer": true,
- "dependencies": {
- "@babel/helper-validator-identifier": "^7.28.5",
- "js-tokens": "^4.0.0",
- "picocolors": "^1.1.1"
- },
- "engines": {
- "node": ">=6.9.0"
+ "node": ">=20.0.0"
}
},
- "node_modules/@babel/types": {
- "version": "7.29.0",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
- "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz",
+ "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==",
+ "cpu": [
+ "ppc64"
+ ],
"dev": true,
"license": "MIT",
- "peer": true,
- "dependencies": {
- "@babel/helper-string-parser": "^7.27.1",
- "@babel/helper-validator-identifier": "^7.28.5"
- },
+ "optional": true,
+ "os": [
+ "aix"
+ ],
"engines": {
- "node": ">=6.9.0"
+ "node": ">=18"
}
},
"node_modules/@esbuild/android-arm": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz",
- "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz",
+ "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==",
"cpu": [
"arm"
],
@@ -537,13 +55,13 @@
"android"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/android-arm64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz",
- "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz",
+ "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==",
"cpu": [
"arm64"
],
@@ -554,13 +72,13 @@
"android"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/android-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz",
- "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz",
+ "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==",
"cpu": [
"x64"
],
@@ -571,13 +89,13 @@
"android"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/darwin-arm64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz",
- "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz",
+ "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==",
"cpu": [
"arm64"
],
@@ -588,13 +106,13 @@
"darwin"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/darwin-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz",
- "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz",
+ "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==",
"cpu": [
"x64"
],
@@ -605,13 +123,13 @@
"darwin"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/freebsd-arm64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz",
- "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz",
+ "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==",
"cpu": [
"arm64"
],
@@ -622,13 +140,13 @@
"freebsd"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/freebsd-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz",
- "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz",
+ "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==",
"cpu": [
"x64"
],
@@ -639,13 +157,13 @@
"freebsd"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-arm": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz",
- "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz",
+ "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==",
"cpu": [
"arm"
],
@@ -656,13 +174,13 @@
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-arm64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz",
- "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz",
+ "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==",
"cpu": [
"arm64"
],
@@ -673,13 +191,13 @@
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-ia32": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz",
- "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz",
+ "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==",
"cpu": [
"ia32"
],
@@ -690,13 +208,13 @@
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-loong64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz",
- "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz",
+ "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==",
"cpu": [
"loong64"
],
@@ -707,13 +225,13 @@
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-mips64el": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz",
- "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz",
+ "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==",
"cpu": [
"mips64el"
],
@@ -724,13 +242,13 @@
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-ppc64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz",
- "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz",
+ "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==",
"cpu": [
"ppc64"
],
@@ -741,13 +259,13 @@
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-riscv64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz",
- "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz",
+ "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==",
"cpu": [
"riscv64"
],
@@ -758,13 +276,13 @@
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-s390x": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz",
- "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz",
+ "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==",
"cpu": [
"s390x"
],
@@ -775,13 +293,13 @@
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz",
- "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz",
+ "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==",
"cpu": [
"x64"
],
@@ -792,15 +310,15 @@
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
- "node_modules/@esbuild/netbsd-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz",
- "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==",
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz",
+ "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==",
"cpu": [
- "x64"
+ "arm64"
],
"dev": true,
"license": "MIT",
@@ -809,13 +327,13 @@
"netbsd"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
- "node_modules/@esbuild/openbsd-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz",
- "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==",
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz",
+ "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==",
"cpu": [
"x64"
],
@@ -823,50 +341,101 @@
"license": "MIT",
"optional": true,
"os": [
- "openbsd"
+ "netbsd"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
- "node_modules/@esbuild/sunos-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz",
- "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==",
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz",
+ "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==",
"cpu": [
- "x64"
+ "arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
- "sunos"
+ "openbsd"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
- "node_modules/@esbuild/win32-arm64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz",
- "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==",
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz",
+ "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==",
"cpu": [
- "arm64"
+ "x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
- "win32"
+ "openbsd"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz",
+ "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz",
+ "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz",
+ "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
"node_modules/@esbuild/win32-ia32": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz",
- "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz",
+ "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==",
"cpu": [
"ia32"
],
@@ -877,13 +446,13 @@
"win32"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/win32-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz",
- "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz",
+ "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==",
"cpu": [
"x64"
],
@@ -894,7 +463,7 @@
"win32"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@eslint-community/eslint-utils": {
@@ -939,7284 +508,2597 @@
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
- "node_modules/@eslint/eslintrc": {
- "version": "0.4.3",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz",
- "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==",
+ "node_modules/@eslint/config-array": {
+ "version": "0.21.2",
+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz",
+ "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==",
"dev": true,
+ "license": "Apache-2.0",
"dependencies": {
- "ajv": "^6.12.4",
- "debug": "^4.1.1",
- "espree": "^7.3.0",
- "globals": "^13.9.0",
- "ignore": "^4.0.6",
- "import-fresh": "^3.2.1",
- "js-yaml": "^3.13.1",
- "minimatch": "^3.0.4",
- "strip-json-comments": "^3.1.1"
+ "@eslint/object-schema": "^2.1.7",
+ "debug": "^4.3.1",
+ "minimatch": "^3.1.5"
},
"engines": {
- "node": "^10.12.0 || >=12.0.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@humanwhocodes/config-array": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz",
- "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==",
+ "node_modules/@eslint/config-helpers": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
+ "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
"dev": true,
+ "license": "Apache-2.0",
"dependencies": {
- "@humanwhocodes/object-schema": "^1.2.0",
- "debug": "^4.1.1",
- "minimatch": "^3.0.4"
+ "@eslint/core": "^0.17.0"
},
"engines": {
- "node": ">=10.10.0"
- }
- },
- "node_modules/@humanwhocodes/object-schema": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz",
- "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==",
- "dev": true
- },
- "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",
- "peer": true,
- "dependencies": {
- "@jridgewell/sourcemap-codec": "^1.5.0",
- "@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",
- "peer": true,
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/@jridgewell/sourcemap-codec": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
- "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
- "dev": true,
- "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",
- "peer": true,
- "dependencies": {
- "@jridgewell/resolve-uri": "^3.1.0",
- "@jridgewell/sourcemap-codec": "^1.4.14"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@mathieuc/console": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@mathieuc/console/-/console-1.0.1.tgz",
- "integrity": "sha512-5bSZojJFnxW5rJvipePACJUkIpQBbpQNyImIutEaERO6xkTuMGH3JrW6lxfPddY9vHIbNr+lBjPsCo9Zg3I/eQ==",
- "dev": true
- },
- "node_modules/@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
+ "node_modules/@eslint/core": {
+ "version": "0.17.0",
+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
+ "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
"dev": true,
- "license": "MIT",
+ "license": "Apache-2.0",
"dependencies": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
+ "@types/json-schema": "^7.0.15"
},
"engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 8"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@nodelib/fs.walk": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
- "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "node_modules/@eslint/eslintrc": {
+ "version": "3.3.7",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.7.tgz",
+ "integrity": "sha512-F42g89Qd5oAWtp0k0nnSrjziAKza7w8SVT4mStc18LZMaRb4J1HQAHLCalEtDCxrTuksx7NU9qsmeLwpOfPqWw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
+ "ajv": "^6.14.0",
+ "debug": "^4.3.2",
+ "espree": "^10.0.1",
+ "globals": "^14.0.0",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^4.3.2",
+ "minimatch": "^3.1.5",
+ "strip-json-comments": "^3.1.1"
},
"engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@types/chai": {
- "version": "4.3.5",
- "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz",
- "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==",
- "dev": true
- },
- "node_modules/@types/chai-subset": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz",
- "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==",
- "dev": true,
- "dependencies": {
- "@types/chai": "*"
- }
- },
- "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": "20.19.43",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz",
- "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "undici-types": "~6.21.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "node_modules/@types/semver": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.8.0.tgz",
- "integrity": "sha512-1mAINjtQCXXeLkJ9ehXkwOcBpqtLxiVtKhpUf83DdRNdQKV0iXZpaHYqRr7nj+wvxuJzoAmAwXI+sCNMv1CzLQ==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@typescript-eslint/eslint-plugin": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz",
- "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==",
+ "node_modules/@eslint/js": {
+ "version": "9.39.5",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.5.tgz",
+ "integrity": "sha512-QywQuszQh77pIXCsq998c8hbhSTI/azTty1Z6N53dmAudKHhy573j3yvRLsX2BSp8YpLtoCEG8E9DJe+8zUh4A==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "@eslint-community/regexpp": "^4.4.0",
- "@typescript-eslint/scope-manager": "5.62.0",
- "@typescript-eslint/type-utils": "5.62.0",
- "@typescript-eslint/utils": "5.62.0",
- "debug": "^4.3.4",
- "graphemer": "^1.4.0",
- "ignore": "^5.2.0",
- "natural-compare-lite": "^1.4.0",
- "semver": "^7.3.7",
- "tsutils": "^3.21.0"
- },
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "@typescript-eslint/parser": "^5.0.0",
- "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "url": "https://eslint.org/donate"
}
},
- "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
- "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
+ "node_modules/@eslint/object-schema": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
+ "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
"dev": true,
- "license": "MIT",
+ "license": "Apache-2.0",
"engines": {
- "node": ">= 4"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@typescript-eslint/parser": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
- "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==",
+ "node_modules/@eslint/plugin-kit": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
+ "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
"dev": true,
- "license": "BSD-2-Clause",
+ "license": "Apache-2.0",
"dependencies": {
- "@typescript-eslint/scope-manager": "5.62.0",
- "@typescript-eslint/types": "5.62.0",
- "@typescript-eslint/typescript-estree": "5.62.0",
- "debug": "^4.3.4"
+ "@eslint/core": "^0.17.0",
+ "levn": "^0.4.1"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@typescript-eslint/scope-manager": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz",
- "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==",
+ "node_modules/@humanfs/core": {
+ "version": "0.19.2",
+ "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz",
+ "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==",
"dev": true,
- "license": "MIT",
+ "license": "Apache-2.0",
"dependencies": {
- "@typescript-eslint/types": "5.62.0",
- "@typescript-eslint/visitor-keys": "5.62.0"
+ "@humanfs/types": "^0.15.0"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
+ "node": ">=18.18.0"
}
},
- "node_modules/@typescript-eslint/type-utils": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz",
- "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==",
+ "node_modules/@humanfs/node": {
+ "version": "0.16.8",
+ "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz",
+ "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==",
"dev": true,
- "license": "MIT",
+ "license": "Apache-2.0",
"dependencies": {
- "@typescript-eslint/typescript-estree": "5.62.0",
- "@typescript-eslint/utils": "5.62.0",
- "debug": "^4.3.4",
- "tsutils": "^3.21.0"
+ "@humanfs/core": "^0.19.2",
+ "@humanfs/types": "^0.15.0",
+ "@humanwhocodes/retry": "^0.4.0"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "*"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "node": ">=18.18.0"
}
},
- "node_modules/@typescript-eslint/types": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz",
- "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==",
+ "node_modules/@humanfs/types": {
+ "version": "0.15.0",
+ "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz",
+ "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==",
"dev": true,
- "license": "MIT",
+ "license": "Apache-2.0",
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
+ "node": ">=18.18.0"
}
},
- "node_modules/@typescript-eslint/typescript-estree": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz",
- "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==",
+ "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,
- "license": "BSD-2-Clause",
- "dependencies": {
- "@typescript-eslint/types": "5.62.0",
- "@typescript-eslint/visitor-keys": "5.62.0",
- "debug": "^4.3.4",
- "globby": "^11.1.0",
- "is-glob": "^4.0.3",
- "semver": "^7.3.7",
- "tsutils": "^3.21.0"
- },
+ "license": "Apache-2.0",
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": ">=12.22"
},
"funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
}
},
- "node_modules/@typescript-eslint/utils": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz",
- "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==",
+ "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": "MIT",
- "dependencies": {
- "@eslint-community/eslint-utils": "^4.2.0",
- "@types/json-schema": "^7.0.9",
- "@types/semver": "^7.3.12",
- "@typescript-eslint/scope-manager": "5.62.0",
- "@typescript-eslint/types": "5.62.0",
- "@typescript-eslint/typescript-estree": "5.62.0",
- "eslint-scope": "^5.1.1",
- "semver": "^7.3.7"
- },
+ "license": "Apache-2.0",
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": ">=18.18"
},
"funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
}
},
- "node_modules/@typescript-eslint/visitor-keys": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz",
- "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==",
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
+ "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
"dev": true,
- "license": "MIT",
- "dependencies": {
- "@typescript-eslint/types": "5.62.0",
- "eslint-visitor-keys": "^3.3.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- }
+ "license": "MIT"
},
- "node_modules/@typescript-eslint/visitor-keys/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==",
+ "node_modules/@napi-rs/lzma-linux-x64-gnu": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz",
+ "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==",
+ "cpu": [
+ "x64"
+ ],
"dev": true,
- "license": "Apache-2.0",
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
+ "node": "^22.20 || ^24.12 || >=25"
}
},
- "node_modules/@vitest/expect": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.31.4.tgz",
- "integrity": "sha512-tibyx8o7GUyGHZGyPgzwiaPaLDQ9MMuCOrc03BYT0nryUuhLbL7NV2r/q98iv5STlwMgaKuFJkgBW/8iPKwlSg==",
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.64.0.tgz",
+ "integrity": "sha512-FLLpX941CD/7aBvX3GqLGBM9OvY5PGXTryPJkG5r5/OuBpZpV5k45Uo3RxAvqd35tsyc3hH1bhtz921IKzoIzg==",
+ "cpu": [
+ "arm"
+ ],
"dev": true,
"license": "MIT",
- "dependencies": {
- "@vitest/spy": "0.31.4",
- "@vitest/utils": "0.31.4",
- "chai": "^4.3.7"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
+ "optional": true,
+ "os": [
+ "android"
+ ]
},
- "node_modules/@vitest/expect/node_modules/@vitest/utils": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.4.tgz",
- "integrity": "sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ==",
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.64.0.tgz",
+ "integrity": "sha512-iI32XM/jnDYJsvx5ai/za/7gWO9XoSeFFtU06/ZCaRgyilfJOjaopD3nOpk2WrTCGOyeDt4hleUiGOAnd5tHNg==",
+ "cpu": [
+ "arm64"
+ ],
"dev": true,
"license": "MIT",
- "dependencies": {
- "concordance": "^5.0.4",
- "loupe": "^2.3.6",
- "pretty-format": "^27.5.1"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
+ "optional": true,
+ "os": [
+ "android"
+ ]
},
- "node_modules/@vitest/runner": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.31.4.tgz",
- "integrity": "sha512-Wgm6UER+gwq6zkyrm5/wbpXGF+g+UBB78asJlFkIOwyse0pz8lZoiC6SW5i4gPnls/zUcPLWS7Zog0LVepXnpg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@vitest/utils": "0.31.4",
- "concordance": "^5.0.4",
- "p-limit": "^4.0.0",
- "pathe": "^1.1.0"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/@vitest/runner/node_modules/@vitest/utils": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.4.tgz",
- "integrity": "sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "concordance": "^5.0.4",
- "loupe": "^2.3.6",
- "pretty-format": "^27.5.1"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/@vitest/runner/node_modules/p-limit": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz",
- "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "yocto-queue": "^1.0.0"
- },
- "engines": {
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/@vitest/snapshot": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.31.4.tgz",
- "integrity": "sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "magic-string": "^0.30.0",
- "pathe": "^1.1.0",
- "pretty-format": "^27.5.1"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/@vitest/spy": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.31.4.tgz",
- "integrity": "sha512-3ei5ZH1s3aqbEyftPAzSuunGICRuhE+IXOmpURFdkm5ybUADk+viyQfejNk6q8M5QGX8/EVKw+QWMEP3DTJDag==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "tinyspy": "^2.1.0"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/acorn": {
- "version": "7.4.1",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
- "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
- "dev": true,
- "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,
- "peerDependencies": {
- "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
- }
- },
- "node_modules/acorn-walk": {
- "version": "8.2.0",
- "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
- "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
- "dev": true,
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "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-colors": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
- "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "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,
- "engines": {
- "node": ">=8"
- }
- },
- "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,
- "dependencies": {
- "color-convert": "^2.0.1"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
- }
- },
- "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,
- "dependencies": {
- "sprintf-js": "~1.0.2"
- }
- },
- "node_modules/array-includes": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz",
- "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.0-next.2",
- "get-intrinsic": "^1.1.1",
- "is-string": "^1.0.5"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/array-union": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
- "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/array.prototype.flat": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz",
- "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.0-next.1"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/assertion-error": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
- "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": "*"
- }
- },
- "node_modules/astral-regex": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
- "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/asynckit": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
- "license": "MIT"
- },
- "node_modules/axios": {
- "version": "1.13.6",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz",
- "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==",
- "license": "MIT",
- "dependencies": {
- "follow-redirects": "^1.15.11",
- "form-data": "^4.0.5",
- "proxy-from-env": "^1.1.0"
- }
- },
- "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
- },
- "node_modules/blueimp-md5": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
- "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==",
- "dev": true
- },
- "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,
- "license": "MIT",
- "dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "node_modules/braces": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
- "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "fill-range": "^7.1.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/browserslist": {
- "version": "4.17.2",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.2.tgz",
- "integrity": "sha512-jSDZyqJmkKMEMi7SZAgX5UltFdR5NAO43vY0AwTpu4X3sGH7GLLQ83KiUomgrnvZRCeW0yPPnKqnxPqQOER9zQ==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "caniuse-lite": "^1.0.30001261",
- "electron-to-chromium": "^1.3.854",
- "escalade": "^3.1.1",
- "nanocolors": "^0.2.12",
- "node-releases": "^1.1.76"
- },
- "bin": {
- "browserslist": "cli.js"
- },
- "engines": {
- "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/browserslist"
- }
- },
- "node_modules/cac": {
- "version": "6.7.14",
- "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
- "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/call-bind": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
- "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
- "dev": true,
- "dependencies": {
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "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/callsites": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
- "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/caniuse-lite": {
- "version": "1.0.30001263",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001263.tgz",
- "integrity": "sha512-doiV5dft6yzWO1WwU19kt8Qz8R0/8DgEziz6/9n2FxUasteZNwNNYSmJO3GLBH8lCVE73AB1RPDPAeYbcO5Cvw==",
- "dev": true,
- "peer": true,
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/browserslist"
- }
- },
- "node_modules/chai": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz",
- "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "assertion-error": "^1.1.0",
- "check-error": "^1.0.3",
- "deep-eql": "^4.1.3",
- "get-func-name": "^2.0.2",
- "loupe": "^2.3.6",
- "pathval": "^1.1.1",
- "type-detect": "^4.1.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/chalk": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
- "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
- "dev": true,
- "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/check-error": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz",
- "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "get-func-name": "^2.0.2"
- },
- "engines": {
- "node": "*"
- }
- },
- "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,
- "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
- },
- "node_modules/combined-stream": {
- "version": "1.0.8",
- "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
- "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
- "license": "MIT",
- "dependencies": {
- "delayed-stream": "~1.0.0"
- },
- "engines": {
- "node": ">= 0.8"
- }
- },
- "node_modules/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/concordance": {
- "version": "5.0.4",
- "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz",
- "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==",
- "dev": true,
- "dependencies": {
- "date-time": "^3.1.0",
- "esutils": "^2.0.3",
- "fast-diff": "^1.2.0",
- "js-string-escape": "^1.0.1",
- "lodash": "^4.17.15",
- "md5-hex": "^3.0.1",
- "semver": "^7.3.2",
- "well-known-symbols": "^2.0.0"
- },
- "engines": {
- "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14"
- }
- },
- "node_modules/confbox": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz",
- "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/confusing-browser-globals": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz",
- "integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==",
- "dev": true
- },
- "node_modules/convert-source-map": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
- "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "safe-buffer": "~5.1.1"
- }
- },
- "node_modules/core-util-is": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
- "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
- },
- "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/date-time": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz",
- "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==",
- "dev": true,
- "dependencies": {
- "time-zone": "^1.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/debug": {
- "version": "4.3.4",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
- "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
- "dev": true,
- "dependencies": {
- "ms": "2.1.2"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/deep-eql": {
- "version": "4.1.4",
- "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz",
- "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "type-detect": "^4.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/deep-is": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
- "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
- "dev": true
- },
- "node_modules/define-properties": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
- "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
- "dev": true,
- "dependencies": {
- "object-keys": "^1.0.12"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/delayed-stream": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
- "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
- "license": "MIT",
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/dir-glob": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
- "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "path-type": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/dir-glob/node_modules/path-type": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
- "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/doctrine": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
- "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
- "dev": true,
- "dependencies": {
- "esutils": "^2.0.2"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/dotenv": {
- "version": "16.3.1",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
- "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
- "dev": true,
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/motdotla/dotenv?sponsor=1"
- }
- },
- "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/electron-to-chromium": {
- "version": "1.3.857",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.857.tgz",
- "integrity": "sha512-a5kIr2lajm4bJ5E4D3fp8Y/BRB0Dx2VOcCRE5Gtb679mXIME/OFhWler8Gy2ksrf8gFX+EFCSIGA33FB3gqYpg==",
- "dev": true,
- "peer": true
- },
- "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
- },
- "node_modules/enquirer": {
- "version": "2.3.6",
- "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
- "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
- "dev": true,
- "dependencies": {
- "ansi-colors": "^4.1.1"
- },
- "engines": {
- "node": ">=8.6"
- }
- },
- "node_modules/error-ex": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
- "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
- "dev": true,
- "dependencies": {
- "is-arrayish": "^0.2.1"
- }
- },
- "node_modules/es-abstract": {
- "version": "1.18.3",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz",
- "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "es-to-primitive": "^1.2.1",
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.2",
- "is-callable": "^1.2.3",
- "is-negative-zero": "^2.0.1",
- "is-regex": "^1.1.3",
- "is-string": "^1.0.6",
- "object-inspect": "^1.10.3",
- "object-keys": "^1.1.1",
- "object.assign": "^4.1.2",
- "string.prototype.trimend": "^1.0.4",
- "string.prototype.trimstart": "^1.0.4",
- "unbox-primitive": "^1.0.1"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "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-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/es-set-tostringtag": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
- "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
- "license": "MIT",
- "dependencies": {
- "es-errors": "^1.3.0",
- "get-intrinsic": "^1.2.6",
- "has-tostringtag": "^1.0.2",
- "hasown": "^2.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/es-to-primitive": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
- "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
- "dev": true,
- "dependencies": {
- "is-callable": "^1.1.4",
- "is-date-object": "^1.0.1",
- "is-symbol": "^1.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/esbuild": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz",
- "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==",
- "dev": true,
- "hasInstallScript": true,
- "license": "MIT",
- "bin": {
- "esbuild": "bin/esbuild"
- },
- "engines": {
- "node": ">=12"
- },
- "optionalDependencies": {
- "@esbuild/android-arm": "0.18.20",
- "@esbuild/android-arm64": "0.18.20",
- "@esbuild/android-x64": "0.18.20",
- "@esbuild/darwin-arm64": "0.18.20",
- "@esbuild/darwin-x64": "0.18.20",
- "@esbuild/freebsd-arm64": "0.18.20",
- "@esbuild/freebsd-x64": "0.18.20",
- "@esbuild/linux-arm": "0.18.20",
- "@esbuild/linux-arm64": "0.18.20",
- "@esbuild/linux-ia32": "0.18.20",
- "@esbuild/linux-loong64": "0.18.20",
- "@esbuild/linux-mips64el": "0.18.20",
- "@esbuild/linux-ppc64": "0.18.20",
- "@esbuild/linux-riscv64": "0.18.20",
- "@esbuild/linux-s390x": "0.18.20",
- "@esbuild/linux-x64": "0.18.20",
- "@esbuild/netbsd-x64": "0.18.20",
- "@esbuild/openbsd-x64": "0.18.20",
- "@esbuild/sunos-x64": "0.18.20",
- "@esbuild/win32-arm64": "0.18.20",
- "@esbuild/win32-ia32": "0.18.20",
- "@esbuild/win32-x64": "0.18.20"
- }
- },
- "node_modules/escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
- "dev": true,
- "peer": true,
- "engines": {
- "node": ">=6"
- }
- },
- "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,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/eslint": {
- "version": "7.31.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.31.0.tgz",
- "integrity": "sha512-vafgJpSh2ia8tnTkNUkwxGmnumgckLh5aAbLa1xRmIn9+owi8qBNGKL+B881kNKNTy7FFqTEkpNkUvmw0n6PkA==",
- "dev": true,
- "dependencies": {
- "@babel/code-frame": "7.12.11",
- "@eslint/eslintrc": "^0.4.3",
- "@humanwhocodes/config-array": "^0.5.0",
- "ajv": "^6.10.0",
- "chalk": "^4.0.0",
- "cross-spawn": "^7.0.2",
- "debug": "^4.0.1",
- "doctrine": "^3.0.0",
- "enquirer": "^2.3.5",
- "escape-string-regexp": "^4.0.0",
- "eslint-scope": "^5.1.1",
- "eslint-utils": "^2.1.0",
- "eslint-visitor-keys": "^2.0.0",
- "espree": "^7.3.1",
- "esquery": "^1.4.0",
- "esutils": "^2.0.2",
- "fast-deep-equal": "^3.1.3",
- "file-entry-cache": "^6.0.1",
- "functional-red-black-tree": "^1.0.1",
- "glob-parent": "^5.1.2",
- "globals": "^13.6.0",
- "ignore": "^4.0.6",
- "import-fresh": "^3.0.0",
- "imurmurhash": "^0.1.4",
- "is-glob": "^4.0.0",
- "js-yaml": "^3.13.1",
- "json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.4.1",
- "lodash.merge": "^4.6.2",
- "minimatch": "^3.0.4",
- "natural-compare": "^1.4.0",
- "optionator": "^0.9.1",
- "progress": "^2.0.0",
- "regexpp": "^3.1.0",
- "semver": "^7.2.1",
- "strip-ansi": "^6.0.0",
- "strip-json-comments": "^3.1.0",
- "table": "^6.0.9",
- "text-table": "^0.2.0",
- "v8-compile-cache": "^2.0.3"
- },
- "bin": {
- "eslint": "bin/eslint.js"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint-config-airbnb-base": {
- "version": "14.2.1",
- "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz",
- "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==",
- "dev": true,
- "dependencies": {
- "confusing-browser-globals": "^1.0.10",
- "object.assign": "^4.1.2",
- "object.entries": "^1.1.2"
- },
- "engines": {
- "node": ">= 6"
- },
- "peerDependencies": {
- "eslint": "^5.16.0 || ^6.8.0 || ^7.2.0",
- "eslint-plugin-import": "^2.22.1"
- }
- },
- "node_modules/eslint-import-resolver-node": {
- "version": "0.3.4",
- "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz",
- "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==",
- "dev": true,
- "dependencies": {
- "debug": "^2.6.9",
- "resolve": "^1.13.1"
- }
- },
- "node_modules/eslint-import-resolver-node/node_modules/debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dev": true,
- "dependencies": {
- "ms": "2.0.0"
- }
- },
- "node_modules/eslint-import-resolver-node/node_modules/ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
- "dev": true
- },
- "node_modules/eslint-module-utils": {
- "version": "2.6.1",
- "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz",
- "integrity": "sha512-ZXI9B8cxAJIH4nfkhTwcRTEAnrVfobYqwjWy/QMCZ8rHkZHFjf9yO4BzpiF9kCSfNlMG54eKigISHpX0+AaT4A==",
- "dev": true,
- "dependencies": {
- "debug": "^3.2.7",
- "pkg-dir": "^2.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/eslint-module-utils/node_modules/debug": {
- "version": "3.2.7",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
- "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
- "dev": true,
- "dependencies": {
- "ms": "^2.1.1"
- }
- },
- "node_modules/eslint-plugin-import": {
- "version": "2.23.4",
- "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.23.4.tgz",
- "integrity": "sha512-6/wP8zZRsnQFiR3iaPFgh5ImVRM1WN5NUWfTIRqwOdeiGJlBcSk82o1FEVq8yXmy4lkIzTo7YhHCIxlU/2HyEQ==",
- "dev": true,
- "dependencies": {
- "array-includes": "^3.1.3",
- "array.prototype.flat": "^1.2.4",
- "debug": "^2.6.9",
- "doctrine": "^2.1.0",
- "eslint-import-resolver-node": "^0.3.4",
- "eslint-module-utils": "^2.6.1",
- "find-up": "^2.0.0",
- "has": "^1.0.3",
- "is-core-module": "^2.4.0",
- "minimatch": "^3.0.4",
- "object.values": "^1.1.3",
- "pkg-up": "^2.0.0",
- "read-pkg-up": "^3.0.0",
- "resolve": "^1.20.0",
- "tsconfig-paths": "^3.9.0"
- },
- "engines": {
- "node": ">=4"
- },
- "peerDependencies": {
- "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0"
- }
- },
- "node_modules/eslint-plugin-import/node_modules/debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dev": true,
- "dependencies": {
- "ms": "2.0.0"
- }
- },
- "node_modules/eslint-plugin-import/node_modules/doctrine": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
- "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
- "dev": true,
- "dependencies": {
- "esutils": "^2.0.2"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/eslint-plugin-import/node_modules/ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
- "dev": true
- },
- "node_modules/eslint-scope": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
- "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
- "dev": true,
- "dependencies": {
- "esrecurse": "^4.3.0",
- "estraverse": "^4.1.1"
- },
- "engines": {
- "node": ">=8.0.0"
- }
- },
- "node_modules/eslint-utils": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
- "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
- "dev": true,
- "dependencies": {
- "eslint-visitor-keys": "^1.1.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/mysticatea"
- }
- },
- "node_modules/eslint-utils/node_modules/eslint-visitor-keys": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
- "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/eslint-visitor-keys": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
- "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
- "dev": true,
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/espree": {
- "version": "7.3.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
- "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
- "dev": true,
- "dependencies": {
- "acorn": "^7.4.0",
- "acorn-jsx": "^5.3.1",
- "eslint-visitor-keys": "^1.3.0"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/espree/node_modules/eslint-visitor-keys": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
- "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "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,
- "bin": {
- "esparse": "bin/esparse.js",
- "esvalidate": "bin/esvalidate.js"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/esquery": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz",
- "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.1.0"
- },
- "engines": {
- "node": ">=0.10"
- }
- },
- "node_modules/esquery/node_modules/estraverse": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
- "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
- "dev": true,
- "engines": {
- "node": ">=4.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,
- "dependencies": {
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/esrecurse/node_modules/estraverse": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
- "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
- "dev": true,
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/estraverse": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
- "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
- "dev": true,
- "engines": {
- "node": ">=4.0"
- }
- },
- "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,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "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
- },
- "node_modules/fast-diff": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz",
- "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==",
- "dev": true
- },
- "node_modules/fast-glob": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
- "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@nodelib/fs.stat": "^2.0.2",
- "@nodelib/fs.walk": "^1.2.3",
- "glob-parent": "^5.1.2",
- "merge2": "^1.3.0",
- "micromatch": "^4.0.8"
- },
- "engines": {
- "node": ">=8.6.0"
- }
- },
- "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
- },
- "node_modules/fast-levenshtein": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
- "dev": true
- },
- "node_modules/fast-uri": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
- "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/fastify"
- },
- {
- "type": "opencollective",
- "url": "https://opencollective.com/fastify"
- }
- ],
- "license": "BSD-3-Clause"
- },
- "node_modules/fastq": {
- "version": "1.20.3",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz",
- "integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "reusify": "^1.0.4"
- }
- },
- "node_modules/file-entry-cache": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
- "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
- "dev": true,
- "dependencies": {
- "flat-cache": "^3.0.4"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/fill-range": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
- "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "to-regex-range": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/find-up": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
- "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
- "dev": true,
- "dependencies": {
- "locate-path": "^2.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/flat-cache": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
- "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
- "dev": true,
- "dependencies": {
- "flatted": "^3.1.0",
- "rimraf": "^3.0.2"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/flatted": {
- "version": "3.2.7",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
- "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==",
- "dev": true
- },
- "node_modules/follow-redirects": {
- "version": "1.15.11",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
- "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
- "funding": [
- {
- "type": "individual",
- "url": "https://github.com/sponsors/RubenVerborgh"
- }
- ],
- "license": "MIT",
- "engines": {
- "node": ">=4.0"
- },
- "peerDependenciesMeta": {
- "debug": {
- "optional": true
- }
- }
- },
- "node_modules/form-data": {
- "version": "4.0.5",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
- "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
- "license": "MIT",
- "dependencies": {
- "asynckit": "^0.4.0",
- "combined-stream": "^1.0.8",
- "es-set-tostringtag": "^2.1.0",
- "hasown": "^2.0.2",
- "mime-types": "^2.1.12"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/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/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/functional-red-black-tree": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
- "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
- "dev": true
- },
- "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,
- "peer": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/get-func-name": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz",
- "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": "*"
- }
- },
- "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-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/glob": {
- "version": "7.1.7",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
- "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
- "dev": true,
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/glob-parent": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
- "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/globals": {
- "version": "13.10.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz",
- "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==",
- "dev": true,
- "dependencies": {
- "type-fest": "^0.20.2"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/globby": {
- "version": "11.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
- "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "array-union": "^2.1.0",
- "dir-glob": "^3.0.1",
- "fast-glob": "^3.2.9",
- "ignore": "^5.2.0",
- "merge2": "^1.4.1",
- "slash": "^3.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/globby/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/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.6",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
- "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==",
- "dev": true
- },
- "node_modules/graphemer": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
- "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/has": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
- "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
- "dev": true,
- "dependencies": {
- "function-bind": "^1.1.1"
- },
- "engines": {
- "node": ">= 0.4.0"
- }
- },
- "node_modules/has-bigints": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz",
- "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==",
- "dev": true,
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "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,
- "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/has-tostringtag": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
- "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
- "license": "MIT",
- "dependencies": {
- "has-symbols": "^1.0.3"
- },
- "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/hosted-git-info": {
- "version": "2.8.9",
- "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
- "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
- "dev": true
- },
- "node_modules/ignore": {
- "version": "4.0.6",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
- "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
- "dev": true,
- "engines": {
- "node": ">= 4"
- }
- },
- "node_modules/immediate": {
- "version": "3.0.6",
- "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
- "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
- },
- "node_modules/import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
- "dev": true,
- "dependencies": {
- "parent-module": "^1.0.0",
- "resolve-from": "^4.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "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": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
- "dev": true,
- "engines": {
- "node": ">=0.8.19"
- }
- },
- "node_modules/inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
- "dev": true,
- "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=="
- },
- "node_modules/is-arrayish": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
- "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
- "dev": true
- },
- "node_modules/is-bigint": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz",
- "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==",
- "dev": true,
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-boolean-object": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz",
- "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-callable": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz",
- "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==",
- "dev": true,
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-core-module": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.5.0.tgz",
- "integrity": "sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==",
- "dev": true,
- "dependencies": {
- "has": "^1.0.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-date-object": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz",
- "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==",
- "dev": true,
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
- "dev": true,
- "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,
- "engines": {
- "node": ">=8"
- }
- },
- "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-negative-zero": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
- "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==",
- "dev": true,
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=0.12.0"
- }
- },
- "node_modules/is-number-object": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz",
- "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==",
- "dev": true,
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-regex": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz",
- "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "has-symbols": "^1.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-string": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz",
- "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==",
- "dev": true,
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/is-symbol": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
- "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
- "dev": true,
- "dependencies": {
- "has-symbols": "^1.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/isarray": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
- "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
- },
- "node_modules/isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
- "dev": true
- },
- "node_modules/js-string-escape": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz",
- "integrity": "sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==",
- "dev": true,
- "engines": {
- "node": ">= 0.8"
- }
- },
- "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
- },
- "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,
- "license": "MIT",
- "dependencies": {
- "argparse": "^1.0.7",
- "esprima": "^4.0.0"
- },
- "bin": {
- "js-yaml": "bin/js-yaml.js"
- }
- },
- "node_modules/jsesc": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
- "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
- "dev": true,
- "license": "MIT",
- "peer": true,
- "bin": {
- "jsesc": "bin/jsesc"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/json-parse-better-errors": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
- "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
- "dev": true
- },
- "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
- },
- "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": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
- "dev": true
- },
- "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,
- "bin": {
- "json5": "lib/cli.js"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/jszip": {
- "version": "3.8.0",
- "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.8.0.tgz",
- "integrity": "sha512-cnpQrXvFSLdsR9KR5/x7zdf6c3m8IhZfZzSblFEHSqBaVwD2nvJ4CuCKLyvKvwBgZm08CgfSoiTBQLm5WW9hGw==",
- "dependencies": {
- "lie": "~3.3.0",
- "pako": "~1.0.2",
- "readable-stream": "~2.3.6",
- "set-immediate-shim": "~1.0.1"
- }
- },
- "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,
- "dependencies": {
- "prelude-ls": "^1.2.1",
- "type-check": "~0.4.0"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/lie": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
- "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
- "dependencies": {
- "immediate": "~3.0.5"
- }
- },
- "node_modules/load-json-file": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
- "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
- "dev": true,
- "dependencies": {
- "graceful-fs": "^4.1.2",
- "parse-json": "^4.0.0",
- "pify": "^3.0.0",
- "strip-bom": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/local-pkg": {
- "version": "0.4.3",
- "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz",
- "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==",
- "dev": true,
- "engines": {
- "node": ">=14"
- },
- "funding": {
- "url": "https://github.com/sponsors/antfu"
- }
- },
- "node_modules/locate-path": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
- "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
- "dev": true,
- "dependencies": {
- "p-locate": "^2.0.0",
- "path-exists": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/lodash": {
- "version": "4.17.23",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
- "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/lodash.clonedeep": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
- "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=",
- "dev": true
- },
- "node_modules/lodash.merge": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
- "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
- "dev": true
- },
- "node_modules/lodash.truncate": {
- "version": "4.4.2",
- "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz",
- "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=",
- "dev": true
- },
- "node_modules/loupe": {
- "version": "2.3.6",
- "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz",
- "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==",
- "dev": true,
- "dependencies": {
- "get-func-name": "^2.0.0"
- }
- },
- "node_modules/magic-string": {
- "version": "0.30.11",
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz",
- "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@jridgewell/sourcemap-codec": "^1.5.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/md5-hex": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz",
- "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==",
- "dev": true,
- "dependencies": {
- "blueimp-md5": "^2.10.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/merge2": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
- "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/micromatch": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
- "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "braces": "^3.0.3",
- "picomatch": "^2.3.1"
- },
- "engines": {
- "node": ">=8.6"
- }
- },
- "node_modules/mime-db": {
- "version": "1.52.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
- "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
- "license": "MIT",
- "engines": {
- "node": ">= 0.6"
- }
- },
- "node_modules/mime-types": {
- "version": "2.1.35",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
- "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
- "license": "MIT",
- "dependencies": {
- "mime-db": "1.52.0"
- },
- "engines": {
- "node": ">= 0.6"
- }
- },
- "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": "*"
- }
- },
- "node_modules/minimist": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
- "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
- "dev": true
- },
- "node_modules/mlly": {
- "version": "1.7.1",
- "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.1.tgz",
- "integrity": "sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "acorn": "^8.11.3",
- "pathe": "^1.1.2",
- "pkg-types": "^1.1.1",
- "ufo": "^1.5.3"
- }
- },
- "node_modules/mlly/node_modules/acorn": {
- "version": "8.12.1",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
- "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
- "dev": true,
- "license": "MIT",
- "bin": {
- "acorn": "bin/acorn"
- },
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
- "dev": true
- },
- "node_modules/nanocolors": {
- "version": "0.2.12",
- "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.2.12.tgz",
- "integrity": "sha512-SFNdALvzW+rVlzqexid6epYdt8H9Zol7xDoQarioEFcFN0JHo4CYNztAxmtfgGTVRCmFlEOqqhBpoFGKqSAMug==",
- "dev": true,
- "peer": true
- },
- "node_modules/nanoid": {
- "version": "3.3.11",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
- "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
- "dev": true,
- "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"
- }
- },
- "node_modules/natural-compare": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
- "dev": true
- },
- "node_modules/natural-compare-lite": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.1.tgz",
- "integrity": "sha512-8Mz06azhPqiDlxhUaUTjBhNAbib/1MoPr89kgmuV6Ir8ICT2/Q/XSYg6VfL3fq2x8MpSQX8sqyI/NeZ5GsGyXA==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/node-releases": {
- "version": "1.1.77",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.77.tgz",
- "integrity": "sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ==",
- "dev": true,
- "peer": true
- },
- "node_modules/normalize-package-data": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
- "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
- "dev": true,
- "dependencies": {
- "hosted-git-info": "^2.1.4",
- "resolve": "^1.10.0",
- "semver": "2 || 3 || 4 || 5",
- "validate-npm-package-license": "^3.0.1"
- }
- },
- "node_modules/normalize-package-data/node_modules/semver": {
- "version": "5.7.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
- "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
- "dev": true,
- "license": "ISC",
- "bin": {
- "semver": "bin/semver"
- }
- },
- "node_modules/object-inspect": {
- "version": "1.11.0",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
- "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==",
- "dev": true,
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/object-keys": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
- "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
- "dev": true,
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/object.assign": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
- "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3",
- "has-symbols": "^1.0.1",
- "object-keys": "^1.1.1"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/object.entries": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.4.tgz",
- "integrity": "sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.2"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
- "node_modules/object.values": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz",
- "integrity": "sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.2"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
- "dev": true,
- "dependencies": {
- "wrappy": "1"
- }
- },
- "node_modules/optionator": {
- "version": "0.9.1",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
- "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
- "dev": true,
- "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.3"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/p-limit": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
- "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
- "dev": true,
- "dependencies": {
- "p-try": "^1.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/p-locate": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
- "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
- "dev": true,
- "dependencies": {
- "p-limit": "^1.1.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/p-try": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
- "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/pako": {
- "version": "1.0.11",
- "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
- "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
- },
- "node_modules/parent-module": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
- "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
- "dev": true,
- "dependencies": {
- "callsites": "^3.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/parse-json": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
- "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
- "dev": true,
- "dependencies": {
- "error-ex": "^1.3.1",
- "json-parse-better-errors": "^1.0.1"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/path-exists": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
- "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/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,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "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,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/path-parse": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
- "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
- "dev": true
- },
- "node_modules/path-type": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
- "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
- "dev": true,
- "dependencies": {
- "pify": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/pathe": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
- "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/pathval": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz",
- "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": "*"
- }
- },
- "node_modules/picocolors": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
- "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
- "dev": true,
- "license": "ISC"
- },
- "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/pify": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
- "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/pkg-dir": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
- "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
- "dev": true,
- "dependencies": {
- "find-up": "^2.1.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/pkg-types": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.2.0.tgz",
- "integrity": "sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "confbox": "^0.1.7",
- "mlly": "^1.7.1",
- "pathe": "^1.1.2"
- }
- },
- "node_modules/pkg-up": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz",
- "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=",
- "dev": true,
- "dependencies": {
- "find-up": "^2.1.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/postcss": {
- "version": "8.4.45",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.45.tgz",
- "integrity": "sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==",
- "dev": true,
- "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.7",
- "picocolors": "^1.0.1",
- "source-map-js": "^1.2.0"
- },
- "engines": {
- "node": "^10 || ^12 || >=14"
- }
- },
- "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,
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/pretty-format": {
- "version": "27.5.1",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz",
- "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
- "dev": true,
- "dependencies": {
- "ansi-regex": "^5.0.1",
- "ansi-styles": "^5.0.0",
- "react-is": "^17.0.1"
- },
- "engines": {
- "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
- }
- },
- "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,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
- }
- },
- "node_modules/process-nextick-args": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
- "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
- },
- "node_modules/progress": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
- "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
- "dev": true,
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/proxy-from-env": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
- "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
- },
- "node_modules/punycode": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
- "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/queue-microtask": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
- "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "license": "MIT"
- },
- "node_modules/react-is": {
- "version": "17.0.2",
- "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
- "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
- "dev": true
- },
- "node_modules/read-pkg": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
- "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
- "dev": true,
- "dependencies": {
- "load-json-file": "^4.0.0",
- "normalize-package-data": "^2.3.2",
- "path-type": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/read-pkg-up": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz",
- "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=",
- "dev": true,
- "dependencies": {
- "find-up": "^2.0.0",
- "read-pkg": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/readable-stream": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
- "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
- "dependencies": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
- }
- },
- "node_modules/regexpp": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
- "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
- "dev": true,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/mysticatea"
- }
- },
- "node_modules/require-from-string": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
- "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/resolve": {
- "version": "1.20.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
- "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
- "dev": true,
- "dependencies": {
- "is-core-module": "^2.2.0",
- "path-parse": "^1.0.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/resolve-from": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
- "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/reusify": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
- "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "iojs": ">=1.0.0",
- "node": ">=0.10.0"
- }
- },
- "node_modules/rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
- "dev": true,
- "dependencies": {
- "glob": "^7.1.3"
- },
- "bin": {
- "rimraf": "bin.js"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/rollup": {
- "version": "3.30.0",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.30.0.tgz",
- "integrity": "sha512-kQvGasUgN+AlWGliFn2POSajRQEsULVYFGTvOZmK06d7vCD+YhZztt70kGk3qaeAXeWYL5eO7zx+rAubBc55eA==",
- "dev": true,
- "license": "MIT",
- "bin": {
- "rollup": "dist/bin/rollup"
- },
- "engines": {
- "node": ">=14.18.0",
- "npm": ">=8.0.0"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.2"
- }
- },
- "node_modules/run-parallel": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
- "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "license": "MIT",
- "dependencies": {
- "queue-microtask": "^1.2.2"
- }
- },
- "node_modules/safe-buffer": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
- "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
- },
- "node_modules/semver": {
- "version": "7.7.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
- "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
- "dev": true,
- "license": "ISC",
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/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=",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "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,
- "dependencies": {
- "shebang-regex": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "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,
- "engines": {
- "node": ">=8"
- }
- },
- "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
- },
- "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"
- }
- },
- "node_modules/slice-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
- "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^4.0.0",
- "astral-regex": "^2.0.0",
- "is-fullwidth-code-point": "^3.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/slice-ansi?sponsor=1"
- }
- },
- "node_modules/source-map": {
- "version": "0.5.7",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
- "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
- "dev": true,
- "peer": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "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==",
- "dev": true,
- "license": "BSD-3-Clause",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/spdx-correct": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
- "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
- "dev": true,
- "dependencies": {
- "spdx-expression-parse": "^3.0.0",
- "spdx-license-ids": "^3.0.0"
- }
- },
- "node_modules/spdx-exceptions": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
- "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
- "dev": true
- },
- "node_modules/spdx-expression-parse": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
- "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
- "dev": true,
- "dependencies": {
- "spdx-exceptions": "^2.1.0",
- "spdx-license-ids": "^3.0.0"
- }
- },
- "node_modules/spdx-license-ids": {
- "version": "3.0.9",
- "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz",
- "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==",
- "dev": true
- },
- "node_modules/sprintf-js": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
- "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
- "dev": true
- },
- "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
- },
- "node_modules/std-env": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz",
- "integrity": "sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==",
- "dev": true
- },
- "node_modules/string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "dependencies": {
- "safe-buffer": "~5.1.0"
- }
- },
- "node_modules/string-width": {
- "version": "4.2.2",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
- "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
- "dev": true,
- "dependencies": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/string.prototype.trimend": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz",
- "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/string.prototype.trimstart": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz",
- "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==",
- "dev": true,
- "dependencies": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/strip-ansi": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
- "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
- "dev": true,
- "dependencies": {
- "ansi-regex": "^5.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-bom": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
- "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "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,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/strip-literal": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.1.tgz",
- "integrity": "sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==",
- "dev": true,
- "dependencies": {
- "acorn": "^8.8.2"
- },
- "funding": {
- "url": "https://github.com/sponsors/antfu"
- }
- },
- "node_modules/strip-literal/node_modules/acorn": {
- "version": "8.8.2",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
- "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
- "dev": true,
- "bin": {
- "acorn": "bin/acorn"
- },
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "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,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/table": {
- "version": "6.7.1",
- "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz",
- "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==",
- "dev": true,
- "dependencies": {
- "ajv": "^8.0.1",
- "lodash.clonedeep": "^4.5.0",
- "lodash.truncate": "^4.4.2",
- "slice-ansi": "^4.0.0",
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.0"
- },
- "engines": {
- "node": ">=10.0.0"
- }
- },
- "node_modules/table/node_modules/ajv": {
- "version": "8.18.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz",
- "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "fast-deep-equal": "^3.1.3",
- "fast-uri": "^3.0.1",
- "json-schema-traverse": "^1.0.0",
- "require-from-string": "^2.0.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
- }
- },
- "node_modules/table/node_modules/json-schema-traverse": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
- "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
- "dev": true
- },
- "node_modules/text-table": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
- "dev": true
- },
- "node_modules/time-zone": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz",
- "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/tinybench": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz",
- "integrity": "sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==",
- "dev": true
- },
- "node_modules/tinypool": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.5.0.tgz",
- "integrity": "sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==",
- "dev": true,
- "engines": {
- "node": ">=14.0.0"
- }
- },
- "node_modules/tinyspy": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz",
- "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=14.0.0"
- }
- },
- "node_modules/to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "is-number": "^7.0.0"
- },
- "engines": {
- "node": ">=8.0"
- }
- },
- "node_modules/tsconfig-paths": {
- "version": "3.10.1",
- "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz",
- "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==",
- "dev": true,
- "dependencies": {
- "json5": "^2.2.0",
- "minimist": "^1.2.0",
- "strip-bom": "^3.0.0"
- }
- },
- "node_modules/tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
- "dev": true,
- "license": "0BSD"
- },
- "node_modules/tsutils": {
- "version": "3.21.0",
- "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz",
- "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "tslib": "^1.8.1"
- },
- "engines": {
- "node": ">= 6"
- },
- "peerDependencies": {
- "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
- }
- },
- "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,
- "dependencies": {
- "prelude-ls": "^1.2.1"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/type-detect": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz",
- "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/typescript": {
- "version": "5.9.3",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
- "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
- "dev": true,
- "license": "Apache-2.0",
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=14.17"
- }
- },
- "node_modules/ufo": {
- "version": "1.5.4",
- "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.4.tgz",
- "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/unbox-primitive": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
- "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
- "dev": true,
- "dependencies": {
- "function-bind": "^1.1.1",
- "has-bigints": "^1.0.1",
- "has-symbols": "^1.0.2",
- "which-boxed-primitive": "^1.0.2"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/undici-types": {
- "version": "6.21.0",
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
- "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
- "dev": true,
- "license": "MIT"
- },
- "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,
- "dependencies": {
- "punycode": "^2.1.0"
- }
- },
- "node_modules/util-deprecate": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
- },
- "node_modules/v8-compile-cache": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
- "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==",
- "dev": true
- },
- "node_modules/validate-npm-package-license": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
- "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
- "dev": true,
- "dependencies": {
- "spdx-correct": "^3.0.0",
- "spdx-expression-parse": "^3.0.0"
- }
- },
- "node_modules/vite": {
- "version": "4.5.14",
- "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.14.tgz",
- "integrity": "sha512-+v57oAaoYNnO3hIu5Z/tJRZjq5aHM2zDve9YZ8HngVHbhk66RStobhb1sqPMIPEleV6cNKYK4eGrAbE9Ulbl2g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "esbuild": "^0.18.10",
- "postcss": "^8.4.27",
- "rollup": "^3.27.1"
- },
- "bin": {
- "vite": "bin/vite.js"
- },
- "engines": {
- "node": "^14.18.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://github.com/vitejs/vite?sponsor=1"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.2"
- },
- "peerDependencies": {
- "@types/node": ">= 14",
- "less": "*",
- "lightningcss": "^1.21.0",
- "sass": "*",
- "stylus": "*",
- "sugarss": "*",
- "terser": "^5.4.0"
- },
- "peerDependenciesMeta": {
- "@types/node": {
- "optional": true
- },
- "less": {
- "optional": true
- },
- "lightningcss": {
- "optional": true
- },
- "sass": {
- "optional": true
- },
- "stylus": {
- "optional": true
- },
- "sugarss": {
- "optional": true
- },
- "terser": {
- "optional": true
- }
- }
- },
- "node_modules/vite-node": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.31.4.tgz",
- "integrity": "sha512-uzL377GjJtTbuc5KQxVbDu2xfU/x0wVjUtXQR2ihS21q/NK6ROr4oG0rsSkBBddZUVCwzfx22in76/0ZZHXgkQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "cac": "^6.7.14",
- "debug": "^4.3.4",
- "mlly": "^1.2.0",
- "pathe": "^1.1.0",
- "picocolors": "^1.0.0",
- "vite": "^3.0.0 || ^4.0.0"
- },
- "bin": {
- "vite-node": "vite-node.mjs"
- },
- "engines": {
- "node": ">=v14.18.0"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/vitest": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.31.4.tgz",
- "integrity": "sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/chai": "^4.3.5",
- "@types/chai-subset": "^1.3.3",
- "@types/node": "*",
- "@vitest/expect": "0.31.4",
- "@vitest/runner": "0.31.4",
- "@vitest/snapshot": "0.31.4",
- "@vitest/spy": "0.31.4",
- "@vitest/utils": "0.31.4",
- "acorn": "^8.8.2",
- "acorn-walk": "^8.2.0",
- "cac": "^6.7.14",
- "chai": "^4.3.7",
- "concordance": "^5.0.4",
- "debug": "^4.3.4",
- "local-pkg": "^0.4.3",
- "magic-string": "^0.30.0",
- "pathe": "^1.1.0",
- "picocolors": "^1.0.0",
- "std-env": "^3.3.2",
- "strip-literal": "^1.0.1",
- "tinybench": "^2.5.0",
- "tinypool": "^0.5.0",
- "vite": "^3.0.0 || ^4.0.0",
- "vite-node": "0.31.4",
- "why-is-node-running": "^2.2.2"
- },
- "bin": {
- "vitest": "vitest.mjs"
- },
- "engines": {
- "node": ">=v14.18.0"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- },
- "peerDependencies": {
- "@edge-runtime/vm": "*",
- "@vitest/browser": "*",
- "@vitest/ui": "*",
- "happy-dom": "*",
- "jsdom": "*",
- "playwright": "*",
- "safaridriver": "*",
- "webdriverio": "*"
- },
- "peerDependenciesMeta": {
- "@edge-runtime/vm": {
- "optional": true
- },
- "@vitest/browser": {
- "optional": true
- },
- "@vitest/ui": {
- "optional": true
- },
- "happy-dom": {
- "optional": true
- },
- "jsdom": {
- "optional": true
- },
- "playwright": {
- "optional": true
- },
- "safaridriver": {
- "optional": true
- },
- "webdriverio": {
- "optional": true
- }
- }
- },
- "node_modules/vitest/node_modules/@vitest/utils": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.4.tgz",
- "integrity": "sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "concordance": "^5.0.4",
- "loupe": "^2.3.6",
- "pretty-format": "^27.5.1"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/vitest/node_modules/acorn": {
- "version": "8.8.2",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
- "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
- "dev": true,
- "bin": {
- "acorn": "bin/acorn"
- },
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/well-known-symbols": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz",
- "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "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,
- "dependencies": {
- "isexe": "^2.0.0"
- },
- "bin": {
- "node-which": "bin/node-which"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/which-boxed-primitive": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
- "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
- "dev": true,
- "dependencies": {
- "is-bigint": "^1.0.1",
- "is-boolean-object": "^1.1.0",
- "is-number-object": "^1.0.4",
- "is-string": "^1.0.5",
- "is-symbol": "^1.0.3"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/why-is-node-running": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz",
- "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==",
- "dev": true,
- "dependencies": {
- "siginfo": "^2.0.0",
- "stackback": "0.0.2"
- },
- "bin": {
- "why-is-node-running": "cli.js"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "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"
- }
- },
- "node_modules/wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
- "dev": true
- },
- "node_modules/ws": {
- "version": "7.5.10",
- "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
- "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
- "license": "MIT",
- "engines": {
- "node": ">=8.3.0"
- },
- "peerDependencies": {
- "bufferutil": "^4.0.1",
- "utf-8-validate": "^5.0.2"
- },
- "peerDependenciesMeta": {
- "bufferutil": {
- "optional": true
- },
- "utf-8-validate": {
- "optional": true
- }
- }
- },
- "node_modules/yocto-queue": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz",
- "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=12.20"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- }
- },
- "dependencies": {
- "@babel/code-frame": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
- "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==",
- "dev": true,
- "requires": {
- "@babel/highlight": "^7.10.4"
- }
- },
- "@babel/compat-data": {
- "version": "7.15.0",
- "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz",
- "integrity": "sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==",
- "dev": true,
- "peer": true
- },
- "@babel/core": {
- "version": "7.15.5",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.5.tgz",
- "integrity": "sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg==",
- "dev": true,
- "peer": true,
- "requires": {
- "@babel/code-frame": "^7.14.5",
- "@babel/generator": "^7.15.4",
- "@babel/helper-compilation-targets": "^7.15.4",
- "@babel/helper-module-transforms": "^7.15.4",
- "@babel/helpers": "^7.15.4",
- "@babel/parser": "^7.15.5",
- "@babel/template": "^7.15.4",
- "@babel/traverse": "^7.15.4",
- "@babel/types": "^7.15.4",
- "convert-source-map": "^1.7.0",
- "debug": "^4.1.0",
- "gensync": "^1.0.0-beta.2",
- "json5": "^2.1.2",
- "semver": "^6.3.0",
- "source-map": "^0.5.0"
- },
- "dependencies": {
- "@babel/code-frame": {
- "version": "7.14.5",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz",
- "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==",
- "dev": true,
- "peer": true,
- "requires": {
- "@babel/highlight": "^7.14.5"
- }
- },
- "semver": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
- "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
- "dev": true,
- "peer": true
- }
- }
- },
- "@babel/eslint-parser": {
- "version": "7.15.7",
- "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.15.7.tgz",
- "integrity": "sha512-yJkHyomClm6A2Xzb8pdAo4HzYMSXFn1O5zrCYvbFP0yQFvHueLedV8WiEno8yJOKStjUXzBZzJFeWQ7b3YMsqQ==",
- "dev": true,
- "requires": {
- "eslint-scope": "^5.1.1",
- "eslint-visitor-keys": "^2.1.0",
- "semver": "^6.3.0"
- },
- "dependencies": {
- "semver": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
- "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
- "dev": true
- }
- }
- },
- "@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,
- "peer": true,
- "requires": {
- "@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"
- }
- },
- "@babel/helper-compilation-targets": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz",
- "integrity": "sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ==",
- "dev": true,
- "peer": true,
- "requires": {
- "@babel/compat-data": "^7.15.0",
- "@babel/helper-validator-option": "^7.14.5",
- "browserslist": "^4.16.6",
- "semver": "^6.3.0"
- },
- "dependencies": {
- "semver": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
- "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
- "dev": true,
- "peer": true
- }
- }
- },
- "@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,
- "peer": true
- },
- "@babel/helper-member-expression-to-functions": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz",
- "integrity": "sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA==",
- "dev": true,
- "peer": true,
- "requires": {
- "@babel/types": "^7.15.4"
- }
- },
- "@babel/helper-module-imports": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz",
- "integrity": "sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==",
- "dev": true,
- "peer": true,
- "requires": {
- "@babel/types": "^7.15.4"
- }
- },
- "@babel/helper-module-transforms": {
- "version": "7.15.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz",
- "integrity": "sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw==",
- "dev": true,
- "peer": true,
- "requires": {
- "@babel/helper-module-imports": "^7.15.4",
- "@babel/helper-replace-supers": "^7.15.4",
- "@babel/helper-simple-access": "^7.15.4",
- "@babel/helper-split-export-declaration": "^7.15.4",
- "@babel/helper-validator-identifier": "^7.15.7",
- "@babel/template": "^7.15.4",
- "@babel/traverse": "^7.15.4",
- "@babel/types": "^7.15.6"
- }
- },
- "@babel/helper-optimise-call-expression": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz",
- "integrity": "sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw==",
- "dev": true,
- "peer": true,
- "requires": {
- "@babel/types": "^7.15.4"
- }
- },
- "@babel/helper-replace-supers": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz",
- "integrity": "sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw==",
- "dev": true,
- "peer": true,
- "requires": {
- "@babel/helper-member-expression-to-functions": "^7.15.4",
- "@babel/helper-optimise-call-expression": "^7.15.4",
- "@babel/traverse": "^7.15.4",
- "@babel/types": "^7.15.4"
- }
- },
- "@babel/helper-simple-access": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz",
- "integrity": "sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg==",
- "dev": true,
- "peer": true,
- "requires": {
- "@babel/types": "^7.15.4"
- }
- },
- "@babel/helper-split-export-declaration": {
- "version": "7.15.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz",
- "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==",
- "dev": true,
- "peer": true,
- "requires": {
- "@babel/types": "^7.15.4"
- }
- },
- "@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==",
- "dev": true,
- "peer": true
- },
- "@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==",
- "dev": true
- },
- "@babel/helper-validator-option": {
- "version": "7.14.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz",
- "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==",
- "dev": true,
- "peer": true
- },
- "@babel/helpers": {
- "version": "7.28.6",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz",
- "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==",
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.64.0.tgz",
+ "integrity": "sha512-dRBZlbt2sEtF8Mn4MODThze9fIPdDoOhVSlXMAKy5dQbOYK9pOOoPY4Fat3OTtr0+8zbJo5TTZwlsfxY/kDNJg==",
+ "cpu": [
+ "arm64"
+ ],
"dev": true,
- "peer": true,
- "requires": {
- "@babel/template": "^7.28.6",
- "@babel/types": "^7.28.6"
- }
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
},
- "@babel/highlight": {
- "version": "7.14.5",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz",
- "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==",
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.64.0.tgz",
+ "integrity": "sha512-Y3whrJOMucfkhgNkvcM93M6j8C53iEAMmPMYD99C6G1kUy4ELigLWk9ar2/4aCBSRgsql0zdlOemLgW2m5GZgQ==",
+ "cpu": [
+ "x64"
+ ],
"dev": true,
- "requires": {
- "@babel/helper-validator-identifier": "^7.14.5",
- "chalk": "^2.0.0",
- "js-tokens": "^4.0.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "requires": {
- "color-convert": "^1.9.0"
- }
- },
- "chalk": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- }
- },
- "color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dev": true,
- "requires": {
- "color-name": "1.1.3"
- }
- },
- "color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
- "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
- },
- "has-flag": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
- "dev": true
- },
- "supports-color": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
- "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
- "dev": true,
- "requires": {
- "has-flag": "^3.0.0"
- }
- }
- }
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
},
- "@babel/parser": {
- "version": "7.29.0",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz",
- "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==",
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.64.0.tgz",
+ "integrity": "sha512-S6S1GEzPjFF6IONYJX3AKt/799+8RgBgCcwRnUo+Ep1IvBxUbw5M51iU0TDdK2NWWVnSvCQ8yi6Em0fGASMOng==",
+ "cpu": [
+ "arm64"
+ ],
"dev": true,
- "peer": true,
- "requires": {
- "@babel/types": "^7.29.0"
- }
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
},
- "@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==",
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.64.0.tgz",
+ "integrity": "sha512-Ed1DPoFENkXj4IGzSB12SesV40iP6LxCCrbTIkSGIQBpOOxpBM+0kj62lmaeIHfMWTDoddqTOtqc7s8LYfn+Pw==",
+ "cpu": [
+ "x64"
+ ],
"dev": true,
- "peer": true,
- "requires": {
- "@babel/code-frame": "^7.28.6",
- "@babel/parser": "^7.28.6",
- "@babel/types": "^7.28.6"
- },
- "dependencies": {
- "@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,
- "peer": true,
- "requires": {
- "@babel/helper-validator-identifier": "^7.28.5",
- "js-tokens": "^4.0.0",
- "picocolors": "^1.1.1"
- }
- }
- }
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
},
- "@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==",
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.64.0.tgz",
+ "integrity": "sha512-J/6xhutJPtFyIkmHdf4olOdHHKH5kOJNumojdWn+Elv5ICEYTVOa362Vw27TxsK0BLzb1le3EDlO3UbvFK1lnQ==",
+ "cpu": [
+ "arm"
+ ],
"dev": true,
- "peer": true,
- "requires": {
- "@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"
- },
- "dependencies": {
- "@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,
- "peer": true,
- "requires": {
- "@babel/helper-validator-identifier": "^7.28.5",
- "js-tokens": "^4.0.0",
- "picocolors": "^1.1.1"
- }
- }
- }
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@babel/types": {
- "version": "7.29.0",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
- "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.64.0.tgz",
+ "integrity": "sha512-G4L/Nnx59d2LvDoV/P4S5lZ7oVLT6hodOHMacqjiq2LL2gts86KbkEBTYL53+fBt0odhf7XPIbIATGoYiJctxg==",
+ "cpu": [
+ "arm"
+ ],
"dev": true,
- "peer": true,
- "requires": {
- "@babel/helper-string-parser": "^7.27.1",
- "@babel/helper-validator-identifier": "^7.28.5"
- }
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/android-arm": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz",
- "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==",
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.64.0.tgz",
+ "integrity": "sha512-zF16pvJDEUksGYRbfnXne7pdklAyj2XDmJeYKgP93oq0cUyX9Y8O7lUo1R+IY1GagP/YBvCEDCe7eEcAKpw//g==",
+ "cpu": [
+ "arm64"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/android-arm64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz",
- "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==",
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.64.0.tgz",
+ "integrity": "sha512-nIggWn8n+w12+R5lsV+PYYoUY8vuObxPAQqJI7WES+9v0qspYuAHoZMfYM0yLxlipasT5BY9ht5W8t5c/rSCkg==",
+ "cpu": [
+ "arm64"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/android-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz",
- "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==",
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.64.0.tgz",
+ "integrity": "sha512-WLOTiHPzszP0dxIMsHpFeDSOSB5I49Mj8K4+yKE3H1X/D0JRG5XZ5jrctJLMjnUc/LUzaKiwq6EHWNJ8pup8PA==",
+ "cpu": [
+ "loong64"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/darwin-arm64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz",
- "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==",
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.64.0.tgz",
+ "integrity": "sha512-35RK9aRhh7g7Pmeu5gQ01aCvrhXzj9LoBE6xtUcEH1ns+nyTaSzxSpADmBQINu4QiTDGvmQYwo1j5hlg1rRXFw==",
+ "cpu": [
+ "loong64"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/darwin-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz",
- "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==",
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.64.0.tgz",
+ "integrity": "sha512-RqTfnpoTjuWfPAmqK5p2edt2AMCDJWm6oTn7sKfmyx+6tRga0ip05SJ977o6udTcIiDeF/CJMUfkaN4gtWt6Aw==",
+ "cpu": [
+ "ppc64"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/freebsd-arm64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz",
- "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==",
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.64.0.tgz",
+ "integrity": "sha512-RQjZPigjxFvFZDijG6rjlSXxhRaTf9zLYVpGK+lVcga64oMqP1GbgVqCb46eHTTceSIgp89Ja0y5aPe3GFBYHg==",
+ "cpu": [
+ "ppc64"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/freebsd-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz",
- "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==",
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.64.0.tgz",
+ "integrity": "sha512-tjL58mgQcTRnDRpeky+Sth1MKQeYi2Ct6r3Luq9E5aTSjnM/i/JbozqZkKqp9thM5+oDSZxo+05f9kdQedfTGA==",
+ "cpu": [
+ "riscv64"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/linux-arm": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz",
- "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==",
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.64.0.tgz",
+ "integrity": "sha512-ictoRyVaoZ8C67myHef+8hhCa6IplXJJ/xUCkVCxziV4zxMZh+jvhkhGsPBLqj1S72fnqD0QH5zL4lcaa4X7DQ==",
+ "cpu": [
+ "riscv64"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/linux-arm64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz",
- "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==",
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.64.0.tgz",
+ "integrity": "sha512-8aVvZ2hfr9RLFzBQkQNmYeHLDja8fLeQAmLt757zdKN/B+8L809KlLJKctQjS22wZotptV8G6o7fVPuAs8S1tQ==",
+ "cpu": [
+ "s390x"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/linux-ia32": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz",
- "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==",
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.64.0.tgz",
+ "integrity": "sha512-2dEF8GAcDKwshUfydD+GhosppNyBzhVUHkdFF3CXd3FpOkzj/RZzF5aoEtzklujklT5qFVRU2GK/cFeLaTNKVg==",
+ "cpu": [
+ "x64"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/linux-loong64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz",
- "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==",
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.64.0.tgz",
+ "integrity": "sha512-3XHTvoo2hKkh0MiOfS7SkhHjMaaWF7P4F3drocZZaho/Z8w7h/jpnuBHm91BOQLfvrKHs1yR+zir4E8RI3XzTQ==",
+ "cpu": [
+ "x64"
+ ],
"dev": true,
- "optional": true
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "@esbuild/linux-mips64el": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz",
- "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==",
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.64.0.tgz",
+ "integrity": "sha512-HKtkzodL4a3KFWDXDoO61cRynAWTR3LnAE0oGtfG9lcNFpNuVYUFOByxDgNqEvic9rvaQbAj+SFwTEWDptRaIw==",
+ "cpu": [
+ "x64"
+ ],
"dev": true,
- "optional": true
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
},
- "@esbuild/linux-ppc64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz",
- "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==",
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.64.0.tgz",
+ "integrity": "sha512-JBsxqiY16uyyCujtoC3s7zL+SrYyNElptD7K4V+KUoJ2V8/XG3hPWpheK+SuPwNh1cikJvIZmIdsrYXvD6PLJw==",
+ "cpu": [
+ "arm64"
+ ],
"dev": true,
- "optional": true
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
},
- "@esbuild/linux-riscv64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz",
- "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==",
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.64.0.tgz",
+ "integrity": "sha512-S5Qrijh37qhnUYQ0ay8WN3LuWeKjow7wTUyCOPMZtnXiBXYXdsZETI6ZLfYnQAKovltckPLBFdNeD61P2rJc7g==",
+ "cpu": [
+ "arm64"
+ ],
"dev": true,
- "optional": true
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
},
- "@esbuild/linux-s390x": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz",
- "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==",
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.64.0.tgz",
+ "integrity": "sha512-zbZ6iMmLFEsCtTdc2/y1F/cDFVNNCPF7Ae8PCT/wdPE//hGwYp6r+MyCLMFX+kOeIe09Pz6ASfnnfpSTN1FJQQ==",
+ "cpu": [
+ "ia32"
+ ],
"dev": true,
- "optional": true
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
},
- "@esbuild/linux-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz",
- "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==",
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.64.0.tgz",
+ "integrity": "sha512-L6Hw69oNpuYaOr1zCG30v0/DqKYCSRwodPGwIcVZ/6f8SOzq9rxtL/xNVI5MO4wjli+Ko0ErK9uHJL3mNPt8wQ==",
+ "cpu": [
+ "x64"
+ ],
"dev": true,
- "optional": true
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
},
- "@esbuild/netbsd-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz",
- "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==",
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.64.0.tgz",
+ "integrity": "sha512-nl+CTWIgOGszQmUz/kanfgrfFZ4qiwxKIfT/ryl3N3Ewk5tqizmYtNXiqb7Bu/fDtNgu1kyxdFiAUJNur3iysg==",
+ "cpu": [
+ "x64"
+ ],
"dev": true,
- "optional": true
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
},
- "@esbuild/openbsd-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz",
- "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==",
+ "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,
- "optional": true
+ "license": "MIT",
+ "dependencies": {
+ "@types/deep-eql": "*",
+ "assertion-error": "^2.0.1"
+ }
},
- "@esbuild/sunos-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz",
- "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==",
+ "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,
- "optional": true
+ "license": "MIT"
},
- "@esbuild/win32-arm64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz",
- "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==",
+ "node_modules/@types/estree": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
"dev": true,
- "optional": true
+ "license": "MIT"
},
- "@esbuild/win32-ia32": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz",
- "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==",
+ "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,
- "optional": true
+ "license": "MIT"
},
- "@esbuild/win32-x64": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz",
- "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==",
+ "node_modules/@types/node": {
+ "version": "22.20.5",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz",
+ "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==",
"dev": true,
- "optional": true
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~6.21.0"
+ }
},
- "@eslint-community/eslint-utils": {
- "version": "4.10.1",
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz",
- "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==",
+ "node_modules/@types/ws": {
+ "version": "8.18.2",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.2.tgz",
+ "integrity": "sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w==",
"dev": true,
- "requires": {
- "eslint-visitor-keys": "^3.4.3"
- },
+ "license": "MIT",
"dependencies": {
- "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
- }
+ "@types/node": "*"
}
},
- "@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
- },
- "@eslint/eslintrc": {
- "version": "0.4.3",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz",
- "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==",
- "dev": true,
- "requires": {
- "ajv": "^6.12.4",
- "debug": "^4.1.1",
- "espree": "^7.3.0",
- "globals": "^13.9.0",
- "ignore": "^4.0.6",
- "import-fresh": "^3.2.1",
- "js-yaml": "^3.13.1",
- "minimatch": "^3.0.4",
- "strip-json-comments": "^3.1.1"
+ "node_modules/@typescript-eslint/eslint-plugin": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.71.0.tgz",
+ "integrity": "sha512-pqcS9c1HxZTHt7End4nXqd0s5lJrrFzrgCkKFJrsbUnaL6M3+6oBFZaslg6Gjsl3argl2DDRFROnXARaZ2e4Nw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/regexpp": "^4.12.2",
+ "@typescript-eslint/scope-manager": "8.71.0",
+ "@typescript-eslint/type-utils": "8.71.0",
+ "@typescript-eslint/utils": "8.71.0",
+ "@typescript-eslint/visitor-keys": "8.71.0",
+ "ignore": "^7.0.5",
+ "natural-compare": "^1.4.0",
+ "ts-api-utils": "^2.5.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.71.0",
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.1.0"
}
},
- "@humanwhocodes/config-array": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz",
- "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==",
+ "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
+ "version": "7.0.12",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.12.tgz",
+ "integrity": "sha512-/8UvqAPU9DGTI9k4mxtf49U37Isfwr8Uts96+SBHIkFxPJnHS0Ew4f00sM4Scd8V8EjM0jUNtVDdv1kPdt35lg==",
"dev": true,
- "requires": {
- "@humanwhocodes/object-schema": "^1.2.0",
- "debug": "^4.1.1",
- "minimatch": "^3.0.4"
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
}
},
- "@humanwhocodes/object-schema": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz",
- "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==",
- "dev": true
- },
- "@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==",
+ "node_modules/@typescript-eslint/parser": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.71.0.tgz",
+ "integrity": "sha512-CG4nPk1f2zc8yw4pALqHsFYH2hdo+h1T9daSp21+Hnxi9LOE3GT9hAfTKJCBXVNM2GmYs1eMEP615wPoeOgk3A==",
"dev": true,
- "peer": true,
- "requires": {
- "@jridgewell/sourcemap-codec": "^1.5.0",
- "@jridgewell/trace-mapping": "^0.3.24"
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/scope-manager": "8.71.0",
+ "@typescript-eslint/types": "8.71.0",
+ "@typescript-eslint/typescript-estree": "8.71.0",
+ "@typescript-eslint/visitor-keys": "8.71.0",
+ "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.1.0"
}
},
- "@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==",
+ "node_modules/@typescript-eslint/project-service": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.71.0.tgz",
+ "integrity": "sha512-aABjw5rjBacYONVPaPiWOCjJu0vEF4a25iQuodlmQYL1trtLZ0X/y+2Vzl3BKI1odM4LnwLE1oUDXYp1wzx1TQ==",
"dev": true,
- "peer": true
- },
- "@jridgewell/sourcemap-codec": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
- "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
- "dev": true
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/tsconfig-utils": "^8.71.0",
+ "@typescript-eslint/types": "^8.71.0",
+ "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.1.0"
+ }
},
- "@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==",
+ "node_modules/@typescript-eslint/scope-manager": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.71.0.tgz",
+ "integrity": "sha512-gWF0BhUcnjZxSpLE8ngS/59n2SB0J3YqRxvX1+2aoRJk9hNtHSLOV+TcarFiOr5ipXm3yc1QrI4c9YZc8zyCxw==",
"dev": true,
- "peer": true,
- "requires": {
- "@jridgewell/resolve-uri": "^3.1.0",
- "@jridgewell/sourcemap-codec": "^1.4.14"
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.71.0",
+ "@typescript-eslint/visitor-keys": "8.71.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
}
},
- "@mathieuc/console": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@mathieuc/console/-/console-1.0.1.tgz",
- "integrity": "sha512-5bSZojJFnxW5rJvipePACJUkIpQBbpQNyImIutEaERO6xkTuMGH3JrW6lxfPddY9vHIbNr+lBjPsCo9Zg3I/eQ==",
- "dev": true
- },
- "@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
+ "node_modules/@typescript-eslint/tsconfig-utils": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.71.0.tgz",
+ "integrity": "sha512-Z1UlWHADEK2Mlb9NpWfDeSjqoZ5EyrOv4R3eQpbkzqn/EwaIdOpXXupEA1+0ZIOSJSZZDBHG0BrQyN8zUG6Pwg==",
"dev": true,
- "requires": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
+ "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.1.0"
}
},
- "@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
- "dev": true
- },
- "@nodelib/fs.walk": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
- "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "node_modules/@typescript-eslint/type-utils": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.71.0.tgz",
+ "integrity": "sha512-i8uO1qbdxeKgRnS5sCRt6On3/nfo2d2DwQe3Yvjx543zLy7r8ySqRuPPiIIXAhS03U0v5NfAFx+rUgxFzKKwNw==",
"dev": true,
- "requires": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.71.0",
+ "@typescript-eslint/typescript-estree": "8.71.0",
+ "@typescript-eslint/utils": "8.71.0",
+ "debug": "^4.4.3",
+ "ts-api-utils": "^2.5.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.1.0"
}
},
- "@types/chai": {
- "version": "4.3.5",
- "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz",
- "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==",
- "dev": true
- },
- "@types/chai-subset": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz",
- "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==",
+ "node_modules/@typescript-eslint/types": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.71.0.tgz",
+ "integrity": "sha512-cJ4OoxPGWvFnBTnSZyaU+qJzGTqPTGJY+gDchj6cRyLRdmIdt4rcsE4twj+zPfrNiWuVi38wijHzShL++Z9atQ==",
"dev": true,
- "requires": {
- "@types/chai": "*"
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
}
},
- "@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
+ "node_modules/@typescript-eslint/typescript-estree": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.71.0.tgz",
+ "integrity": "sha512-PEEF4G5sLLWAS5BpPrUvms4ySZkiBQQZM4z+3ReI46axK5Vqr/vXBQatJQIZZOYdGyPUAKTtsrWzpqKuU+3DEw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/project-service": "8.71.0",
+ "@typescript-eslint/tsconfig-utils": "8.71.0",
+ "@typescript-eslint/types": "8.71.0",
+ "@typescript-eslint/visitor-keys": "8.71.0",
+ "debug": "^4.4.3",
+ "minimatch": "^10.2.2",
+ "semver": "^7.7.3",
+ "tinyglobby": "^0.2.15",
+ "ts-api-utils": "^2.5.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.1.0"
+ }
},
- "@types/node": {
- "version": "20.19.43",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz",
- "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==",
+ "node_modules/@typescript-eslint/typescript-estree/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,
- "requires": {
- "undici-types": "~6.21.0"
+ "license": "MIT",
+ "engines": {
+ "node": "18 || 20 || >=22"
}
},
- "@types/semver": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.8.0.tgz",
- "integrity": "sha512-1mAINjtQCXXeLkJ9ehXkwOcBpqtLxiVtKhpUf83DdRNdQKV0iXZpaHYqRr7nj+wvxuJzoAmAwXI+sCNMv1CzLQ==",
- "dev": true
- },
- "@typescript-eslint/eslint-plugin": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz",
- "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==",
- "dev": true,
- "requires": {
- "@eslint-community/regexpp": "^4.4.0",
- "@typescript-eslint/scope-manager": "5.62.0",
- "@typescript-eslint/type-utils": "5.62.0",
- "@typescript-eslint/utils": "5.62.0",
- "debug": "^4.3.4",
- "graphemer": "^1.4.0",
- "ignore": "^5.2.0",
- "natural-compare-lite": "^1.4.0",
- "semver": "^7.3.7",
- "tsutils": "^3.21.0"
- },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
+ "version": "5.0.12",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz",
+ "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==",
+ "dev": true,
+ "license": "MIT",
"dependencies": {
- "ignore": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
- "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
- "dev": true
- }
+ "balanced-match": "^4.0.2"
+ },
+ "engines": {
+ "node": "20 || >=22"
}
},
- "@typescript-eslint/parser": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
- "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==",
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
+ "version": "10.2.6",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
+ "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
"dev": true,
- "requires": {
- "@typescript-eslint/scope-manager": "5.62.0",
- "@typescript-eslint/types": "5.62.0",
- "@typescript-eslint/typescript-estree": "5.62.0",
- "debug": "^4.3.4"
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "brace-expansion": "^5.0.8"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
- "@typescript-eslint/scope-manager": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz",
- "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==",
+ "node_modules/@typescript-eslint/utils": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.71.0.tgz",
+ "integrity": "sha512-pKR/tEMVrXZG23UFKUn5BQf3zfmfk7KQceI2cGzywZ5nxM5Eu3hEJU1utjWzydtzBbcJAQhHN8iPCxobHpPcZQ==",
"dev": true,
- "requires": {
- "@typescript-eslint/types": "5.62.0",
- "@typescript-eslint/visitor-keys": "5.62.0"
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.9.1",
+ "@typescript-eslint/scope-manager": "8.71.0",
+ "@typescript-eslint/types": "8.71.0",
+ "@typescript-eslint/typescript-estree": "8.71.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.1.0"
}
},
- "@typescript-eslint/type-utils": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz",
- "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==",
+ "node_modules/@typescript-eslint/visitor-keys": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.71.0.tgz",
+ "integrity": "sha512-8eQ9R218XORK+KLosnf4bu/QsUXvUyVwTbArg7/0NMB1Pu87OJKvj4nhFblkYE8gQV73mW1dx1ptlPCkwRGa7A==",
"dev": true,
- "requires": {
- "@typescript-eslint/typescript-estree": "5.62.0",
- "@typescript-eslint/utils": "5.62.0",
- "debug": "^4.3.4",
- "tsutils": "^3.21.0"
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.71.0",
+ "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"
}
},
- "@typescript-eslint/types": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz",
- "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==",
- "dev": true
- },
- "@typescript-eslint/typescript-estree": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz",
- "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==",
+ "node_modules/@typescript-eslint/visitor-keys/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,
- "requires": {
- "@typescript-eslint/types": "5.62.0",
- "@typescript-eslint/visitor-keys": "5.62.0",
- "debug": "^4.3.4",
- "globby": "^11.1.0",
- "is-glob": "^4.0.3",
- "semver": "^7.3.7",
- "tsutils": "^3.21.0"
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^20.19.0 || ^22.13.0 || >=24"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "@typescript-eslint/utils": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz",
- "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==",
+ "node_modules/@vitest/expect": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.7.tgz",
+ "integrity": "sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==",
"dev": true,
- "requires": {
- "@eslint-community/eslint-utils": "^4.2.0",
- "@types/json-schema": "^7.0.9",
- "@types/semver": "^7.3.12",
- "@typescript-eslint/scope-manager": "5.62.0",
- "@typescript-eslint/types": "5.62.0",
- "@typescript-eslint/typescript-estree": "5.62.0",
- "eslint-scope": "^5.1.1",
- "semver": "^7.3.7"
+ "license": "MIT",
+ "dependencies": {
+ "@types/chai": "^5.2.2",
+ "@vitest/spy": "3.2.7",
+ "@vitest/utils": "3.2.7",
+ "chai": "^5.2.0",
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
}
},
- "@typescript-eslint/visitor-keys": {
- "version": "5.62.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz",
- "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==",
+ "node_modules/@vitest/mocker": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.7.tgz",
+ "integrity": "sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==",
"dev": true,
- "requires": {
- "@typescript-eslint/types": "5.62.0",
- "eslint-visitor-keys": "^3.3.0"
- },
+ "license": "MIT",
"dependencies": {
- "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
+ "@vitest/spy": "3.2.7",
+ "estree-walker": "^3.0.3",
+ "magic-string": "^0.30.17"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "msw": "^2.4.9",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "msw": {
+ "optional": true
+ },
+ "vite": {
+ "optional": true
}
}
},
- "@vitest/expect": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.31.4.tgz",
- "integrity": "sha512-tibyx8o7GUyGHZGyPgzwiaPaLDQ9MMuCOrc03BYT0nryUuhLbL7NV2r/q98iv5STlwMgaKuFJkgBW/8iPKwlSg==",
+ "node_modules/@vitest/pretty-format": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.7.tgz",
+ "integrity": "sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==",
"dev": true,
- "requires": {
- "@vitest/spy": "0.31.4",
- "@vitest/utils": "0.31.4",
- "chai": "^4.3.7"
- },
+ "license": "MIT",
"dependencies": {
- "@vitest/utils": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.4.tgz",
- "integrity": "sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ==",
- "dev": true,
- "requires": {
- "concordance": "^5.0.4",
- "loupe": "^2.3.6",
- "pretty-format": "^27.5.1"
- }
- }
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
}
},
- "@vitest/runner": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.31.4.tgz",
- "integrity": "sha512-Wgm6UER+gwq6zkyrm5/wbpXGF+g+UBB78asJlFkIOwyse0pz8lZoiC6SW5i4gPnls/zUcPLWS7Zog0LVepXnpg==",
+ "node_modules/@vitest/runner": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.7.tgz",
+ "integrity": "sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==",
"dev": true,
- "requires": {
- "@vitest/utils": "0.31.4",
- "concordance": "^5.0.4",
- "p-limit": "^4.0.0",
- "pathe": "^1.1.0"
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/utils": "3.2.7",
+ "pathe": "^2.0.3",
+ "strip-literal": "^3.0.0"
},
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/snapshot": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.7.tgz",
+ "integrity": "sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==",
+ "dev": true,
+ "license": "MIT",
"dependencies": {
- "@vitest/utils": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.4.tgz",
- "integrity": "sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ==",
- "dev": true,
- "requires": {
- "concordance": "^5.0.4",
- "loupe": "^2.3.6",
- "pretty-format": "^27.5.1"
- }
- },
- "p-limit": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz",
- "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==",
- "dev": true,
- "requires": {
- "yocto-queue": "^1.0.0"
- }
- }
+ "@vitest/pretty-format": "3.2.7",
+ "magic-string": "^0.30.17",
+ "pathe": "^2.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
}
},
- "@vitest/snapshot": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.31.4.tgz",
- "integrity": "sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA==",
+ "node_modules/@vitest/spy": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.7.tgz",
+ "integrity": "sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==",
"dev": true,
- "requires": {
- "magic-string": "^0.30.0",
- "pathe": "^1.1.0",
- "pretty-format": "^27.5.1"
+ "license": "MIT",
+ "dependencies": {
+ "tinyspy": "^4.0.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
}
},
- "@vitest/spy": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.31.4.tgz",
- "integrity": "sha512-3ei5ZH1s3aqbEyftPAzSuunGICRuhE+IXOmpURFdkm5ybUADk+viyQfejNk6q8M5QGX8/EVKw+QWMEP3DTJDag==",
+ "node_modules/@vitest/utils": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.7.tgz",
+ "integrity": "sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==",
"dev": true,
- "requires": {
- "tinyspy": "^2.1.0"
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/pretty-format": "3.2.7",
+ "loupe": "^3.1.4",
+ "tinyrainbow": "^2.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
}
},
- "acorn": {
- "version": "7.4.1",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
- "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
- "dev": true
+ "node_modules/acorn": {
+ "version": "8.18.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz",
+ "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
},
- "acorn-jsx": {
+ "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,
- "requires": {}
- },
- "acorn-walk": {
- "version": "8.2.0",
- "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
- "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
- "dev": true
+ "license": "MIT",
+ "peerDependencies": {
+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ }
},
- "ajv": {
- "version": "6.14.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz",
- "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==",
+ "node_modules/ajv": {
+ "version": "6.15.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz",
+ "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==",
"dev": true,
- "requires": {
+ "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"
}
},
- "ansi-colors": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
- "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
- "dev": true
- },
- "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
- },
- "ansi-styles": {
+ "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": {
+ "license": "MIT",
+ "dependencies": {
"color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
- "argparse": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
- "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
- "dev": true,
- "requires": {
- "sprintf-js": "~1.0.2"
- }
- },
- "array-includes": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz",
- "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==",
- "dev": true,
- "requires": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.0-next.2",
- "get-intrinsic": "^1.1.1",
- "is-string": "^1.0.5"
- }
- },
- "array-union": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
- "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
- "dev": true
- },
- "array.prototype.flat": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz",
- "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==",
+ "node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true,
- "requires": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.0-next.1"
- }
- },
- "assertion-error": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
- "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
- "dev": true
- },
- "astral-regex": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
- "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
- "dev": true
+ "license": "Python-2.0"
},
- "asynckit": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
- },
- "axios": {
- "version": "1.13.6",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz",
- "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==",
- "requires": {
- "follow-redirects": "^1.15.11",
- "form-data": "^4.0.5",
- "proxy-from-env": "^1.1.0"
- }
- },
- "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
- },
- "blueimp-md5": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
- "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==",
- "dev": true
- },
- "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==",
+ "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,
- "requires": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
}
},
- "braces": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
- "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
+ "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": {
- "fill-range": "^7.1.1"
- }
+ "license": "MIT"
},
- "browserslist": {
- "version": "4.17.2",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.2.tgz",
- "integrity": "sha512-jSDZyqJmkKMEMi7SZAgX5UltFdR5NAO43vY0AwTpu4X3sGH7GLLQ83KiUomgrnvZRCeW0yPPnKqnxPqQOER9zQ==",
+ "node_modules/brace-expansion": {
+ "version": "1.1.21",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz",
+ "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==",
"dev": true,
- "peer": true,
- "requires": {
- "caniuse-lite": "^1.0.30001261",
- "electron-to-chromium": "^1.3.854",
- "escalade": "^3.1.1",
- "nanocolors": "^0.2.12",
- "node-releases": "^1.1.76"
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
}
},
- "cac": {
+ "node_modules/cac": {
"version": "6.7.14",
"resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
"integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
- "dev": true
- },
- "call-bind": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
- "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"dev": true,
- "requires": {
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2"
- }
- },
- "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==",
- "requires": {
- "es-errors": "^1.3.0",
- "function-bind": "^1.1.2"
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
}
},
- "callsites": {
+ "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
- },
- "caniuse-lite": {
- "version": "1.0.30001263",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001263.tgz",
- "integrity": "sha512-doiV5dft6yzWO1WwU19kt8Qz8R0/8DgEziz6/9n2FxUasteZNwNNYSmJO3GLBH8lCVE73AB1RPDPAeYbcO5Cvw==",
"dev": true,
- "peer": true
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
},
- "chai": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz",
- "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==",
+ "node_modules/chai": {
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz",
+ "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==",
"dev": true,
- "requires": {
- "assertion-error": "^1.1.0",
- "check-error": "^1.0.3",
- "deep-eql": "^4.1.3",
- "get-func-name": "^2.0.2",
- "loupe": "^2.3.6",
- "pathval": "^1.1.1",
- "type-detect": "^4.1.0"
+ "license": "MIT",
+ "dependencies": {
+ "assertion-error": "^2.0.1",
+ "check-error": "^2.1.1",
+ "deep-eql": "^5.0.1",
+ "loupe": "^3.1.0",
+ "pathval": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=18"
}
},
- "chalk": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
- "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+ "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,
- "requires": {
+ "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"
}
},
- "check-error": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz",
- "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==",
+ "node_modules/check-error": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz",
+ "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==",
"dev": true,
- "requires": {
- "get-func-name": "^2.0.2"
+ "license": "MIT",
+ "engines": {
+ "node": ">= 16"
}
},
- "color-convert": {
+ "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,
- "requires": {
+ "license": "MIT",
+ "dependencies": {
"color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
}
},
- "color-name": {
+ "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
- },
- "combined-stream": {
- "version": "1.0.8",
- "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
- "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
- "requires": {
- "delayed-stream": "~1.0.0"
- }
+ "dev": true,
+ "license": "MIT"
},
- "concat-map": {
+ "node_modules/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
- },
- "concordance": {
- "version": "5.0.4",
- "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz",
- "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==",
- "dev": true,
- "requires": {
- "date-time": "^3.1.0",
- "esutils": "^2.0.3",
- "fast-diff": "^1.2.0",
- "js-string-escape": "^1.0.1",
- "lodash": "^4.17.15",
- "md5-hex": "^3.0.1",
- "semver": "^7.3.2",
- "well-known-symbols": "^2.0.0"
- }
- },
- "confbox": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz",
- "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==",
- "dev": true
- },
- "confusing-browser-globals": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz",
- "integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==",
- "dev": true
- },
- "convert-source-map": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
- "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==",
- "dev": true,
- "peer": true,
- "requires": {
- "safe-buffer": "~5.1.1"
- }
- },
- "core-util-is": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
- "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
- },
- "cross-spawn": {
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "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,
- "requires": {
+ "license": "MIT",
+ "dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
}
},
- "date-time": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz",
- "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==",
+ "node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
"dev": true,
- "requires": {
- "time-zone": "^1.0.0"
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
}
},
- "debug": {
- "version": "4.3.4",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
- "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+ "node_modules/deep-eql": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz",
+ "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
"dev": true,
- "requires": {
- "ms": "2.1.2"
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
}
},
- "deep-eql": {
- "version": "4.1.4",
- "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz",
- "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==",
+ "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,
- "requires": {
- "type-detect": "^4.0.0"
- }
- },
- "deep-is": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
- "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
- "dev": true
+ "license": "MIT"
},
- "define-properties": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
- "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
+ "node_modules/es-module-lexer": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz",
+ "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==",
"dev": true,
- "requires": {
- "object-keys": "^1.0.12"
- }
- },
- "delayed-stream": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
- "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
+ "license": "MIT"
},
- "dir-glob": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
- "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
+ "node_modules/esbuild": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz",
+ "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==",
"dev": true,
- "requires": {
- "path-type": "^4.0.0"
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
},
- "dependencies": {
- "path-type": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
- "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
- "dev": true
- }
- }
- },
- "doctrine": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
- "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2"
- }
- },
- "dotenv": {
- "version": "16.3.1",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
- "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
- "dev": true
- },
- "dunder-proto": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
- "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
- "requires": {
- "call-bind-apply-helpers": "^1.0.1",
- "es-errors": "^1.3.0",
- "gopd": "^1.2.0"
- }
- },
- "electron-to-chromium": {
- "version": "1.3.857",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.857.tgz",
- "integrity": "sha512-a5kIr2lajm4bJ5E4D3fp8Y/BRB0Dx2VOcCRE5Gtb679mXIME/OFhWler8Gy2ksrf8gFX+EFCSIGA33FB3gqYpg==",
- "dev": true,
- "peer": true
- },
- "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
- },
- "enquirer": {
- "version": "2.3.6",
- "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
- "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
- "dev": true,
- "requires": {
- "ansi-colors": "^4.1.1"
- }
- },
- "error-ex": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
- "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
- "dev": true,
- "requires": {
- "is-arrayish": "^0.2.1"
- }
- },
- "es-abstract": {
- "version": "1.18.3",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz",
- "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==",
- "dev": true,
- "requires": {
- "call-bind": "^1.0.2",
- "es-to-primitive": "^1.2.1",
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.2",
- "is-callable": "^1.2.3",
- "is-negative-zero": "^2.0.1",
- "is-regex": "^1.1.3",
- "is-string": "^1.0.6",
- "object-inspect": "^1.10.3",
- "object-keys": "^1.1.1",
- "object.assign": "^4.1.2",
- "string.prototype.trimend": "^1.0.4",
- "string.prototype.trimstart": "^1.0.4",
- "unbox-primitive": "^1.0.1"
- }
- },
- "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=="
- },
- "es-errors": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
- "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="
- },
- "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==",
- "requires": {
- "es-errors": "^1.3.0"
- }
- },
- "es-set-tostringtag": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
- "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
- "requires": {
- "es-errors": "^1.3.0",
- "get-intrinsic": "^1.2.6",
- "has-tostringtag": "^1.0.2",
- "hasown": "^2.0.2"
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.28.2",
+ "@esbuild/android-arm": "0.28.2",
+ "@esbuild/android-arm64": "0.28.2",
+ "@esbuild/android-x64": "0.28.2",
+ "@esbuild/darwin-arm64": "0.28.2",
+ "@esbuild/darwin-x64": "0.28.2",
+ "@esbuild/freebsd-arm64": "0.28.2",
+ "@esbuild/freebsd-x64": "0.28.2",
+ "@esbuild/linux-arm": "0.28.2",
+ "@esbuild/linux-arm64": "0.28.2",
+ "@esbuild/linux-ia32": "0.28.2",
+ "@esbuild/linux-loong64": "0.28.2",
+ "@esbuild/linux-mips64el": "0.28.2",
+ "@esbuild/linux-ppc64": "0.28.2",
+ "@esbuild/linux-riscv64": "0.28.2",
+ "@esbuild/linux-s390x": "0.28.2",
+ "@esbuild/linux-x64": "0.28.2",
+ "@esbuild/netbsd-arm64": "0.28.2",
+ "@esbuild/netbsd-x64": "0.28.2",
+ "@esbuild/openbsd-arm64": "0.28.2",
+ "@esbuild/openbsd-x64": "0.28.2",
+ "@esbuild/openharmony-arm64": "0.28.2",
+ "@esbuild/sunos-x64": "0.28.2",
+ "@esbuild/win32-arm64": "0.28.2",
+ "@esbuild/win32-ia32": "0.28.2",
+ "@esbuild/win32-x64": "0.28.2"
}
},
- "es-to-primitive": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
- "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
- "dev": true,
- "requires": {
- "is-callable": "^1.1.4",
- "is-date-object": "^1.0.1",
- "is-symbol": "^1.0.2"
- }
- },
- "esbuild": {
- "version": "0.18.20",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz",
- "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==",
- "dev": true,
- "requires": {
- "@esbuild/android-arm": "0.18.20",
- "@esbuild/android-arm64": "0.18.20",
- "@esbuild/android-x64": "0.18.20",
- "@esbuild/darwin-arm64": "0.18.20",
- "@esbuild/darwin-x64": "0.18.20",
- "@esbuild/freebsd-arm64": "0.18.20",
- "@esbuild/freebsd-x64": "0.18.20",
- "@esbuild/linux-arm": "0.18.20",
- "@esbuild/linux-arm64": "0.18.20",
- "@esbuild/linux-ia32": "0.18.20",
- "@esbuild/linux-loong64": "0.18.20",
- "@esbuild/linux-mips64el": "0.18.20",
- "@esbuild/linux-ppc64": "0.18.20",
- "@esbuild/linux-riscv64": "0.18.20",
- "@esbuild/linux-s390x": "0.18.20",
- "@esbuild/linux-x64": "0.18.20",
- "@esbuild/netbsd-x64": "0.18.20",
- "@esbuild/openbsd-x64": "0.18.20",
- "@esbuild/sunos-x64": "0.18.20",
- "@esbuild/win32-arm64": "0.18.20",
- "@esbuild/win32-ia32": "0.18.20",
- "@esbuild/win32-x64": "0.18.20"
- }
- },
- "escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
- "dev": true,
- "peer": true
- },
- "escape-string-regexp": {
+ "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
- },
- "eslint": {
- "version": "7.31.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.31.0.tgz",
- "integrity": "sha512-vafgJpSh2ia8tnTkNUkwxGmnumgckLh5aAbLa1xRmIn9+owi8qBNGKL+B881kNKNTy7FFqTEkpNkUvmw0n6PkA==",
- "dev": true,
- "requires": {
- "@babel/code-frame": "7.12.11",
- "@eslint/eslintrc": "^0.4.3",
- "@humanwhocodes/config-array": "^0.5.0",
- "ajv": "^6.10.0",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/eslint": {
+ "version": "9.39.5",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.5.tgz",
+ "integrity": "sha512-DgZS62aPLXKlnxILS/AYCoRvHaZeXceIzlXPkkGGzJWSow1aEk0lbTlxUSlyjC8jcaKxAdOnTDz+o1JFSBsyjw==",
+ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.8.0",
+ "@eslint-community/regexpp": "^4.12.1",
+ "@eslint/config-array": "^0.21.2",
+ "@eslint/config-helpers": "^0.4.2",
+ "@eslint/core": "^0.17.0",
+ "@eslint/eslintrc": "^3.3.6",
+ "@eslint/js": "9.39.5",
+ "@eslint/plugin-kit": "^0.4.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",
"chalk": "^4.0.0",
- "cross-spawn": "^7.0.2",
- "debug": "^4.0.1",
- "doctrine": "^3.0.0",
- "enquirer": "^2.3.5",
+ "cross-spawn": "^7.0.6",
+ "debug": "^4.3.2",
"escape-string-regexp": "^4.0.0",
- "eslint-scope": "^5.1.1",
- "eslint-utils": "^2.1.0",
- "eslint-visitor-keys": "^2.0.0",
- "espree": "^7.3.1",
- "esquery": "^1.4.0",
+ "eslint-scope": "^8.4.0",
+ "eslint-visitor-keys": "^4.2.1",
+ "espree": "^10.4.0",
+ "esquery": "^1.5.0",
"esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3",
- "file-entry-cache": "^6.0.1",
- "functional-red-black-tree": "^1.0.1",
- "glob-parent": "^5.1.2",
- "globals": "^13.6.0",
- "ignore": "^4.0.6",
- "import-fresh": "^3.0.0",
+ "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",
- "js-yaml": "^3.13.1",
"json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.4.1",
"lodash.merge": "^4.6.2",
- "minimatch": "^3.0.4",
+ "minimatch": "^3.1.5",
"natural-compare": "^1.4.0",
- "optionator": "^0.9.1",
- "progress": "^2.0.0",
- "regexpp": "^3.1.0",
- "semver": "^7.2.1",
- "strip-ansi": "^6.0.0",
- "strip-json-comments": "^3.1.0",
- "table": "^6.0.9",
- "text-table": "^0.2.0",
- "v8-compile-cache": "^2.0.3"
- }
- },
- "eslint-config-airbnb-base": {
- "version": "14.2.1",
- "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz",
- "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==",
- "dev": true,
- "requires": {
- "confusing-browser-globals": "^1.0.10",
- "object.assign": "^4.1.2",
- "object.entries": "^1.1.2"
- }
- },
- "eslint-import-resolver-node": {
- "version": "0.3.4",
- "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz",
- "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==",
- "dev": true,
- "requires": {
- "debug": "^2.6.9",
- "resolve": "^1.13.1"
+ "optionator": "^0.9.3"
},
- "dependencies": {
- "debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dev": true,
- "requires": {
- "ms": "2.0.0"
- }
- },
- "ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
- "dev": true
- }
- }
- },
- "eslint-module-utils": {
- "version": "2.6.1",
- "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz",
- "integrity": "sha512-ZXI9B8cxAJIH4nfkhTwcRTEAnrVfobYqwjWy/QMCZ8rHkZHFjf9yO4BzpiF9kCSfNlMG54eKigISHpX0+AaT4A==",
- "dev": true,
- "requires": {
- "debug": "^3.2.7",
- "pkg-dir": "^2.0.0"
+ "bin": {
+ "eslint": "bin/eslint.js"
},
- "dependencies": {
- "debug": {
- "version": "3.2.7",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
- "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
- "dev": true,
- "requires": {
- "ms": "^2.1.1"
- }
- }
- }
- },
- "eslint-plugin-import": {
- "version": "2.23.4",
- "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.23.4.tgz",
- "integrity": "sha512-6/wP8zZRsnQFiR3iaPFgh5ImVRM1WN5NUWfTIRqwOdeiGJlBcSk82o1FEVq8yXmy4lkIzTo7YhHCIxlU/2HyEQ==",
- "dev": true,
- "requires": {
- "array-includes": "^3.1.3",
- "array.prototype.flat": "^1.2.4",
- "debug": "^2.6.9",
- "doctrine": "^2.1.0",
- "eslint-import-resolver-node": "^0.3.4",
- "eslint-module-utils": "^2.6.1",
- "find-up": "^2.0.0",
- "has": "^1.0.3",
- "is-core-module": "^2.4.0",
- "minimatch": "^3.0.4",
- "object.values": "^1.1.3",
- "pkg-up": "^2.0.0",
- "read-pkg-up": "^3.0.0",
- "resolve": "^1.20.0",
- "tsconfig-paths": "^3.9.0"
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
- "dependencies": {
- "debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dev": true,
- "requires": {
- "ms": "2.0.0"
- }
- },
- "doctrine": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
- "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2"
- }
- },
- "ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
- "dev": true
+ "funding": {
+ "url": "https://eslint.org/donate"
+ },
+ "peerDependencies": {
+ "jiti": "*"
+ },
+ "peerDependenciesMeta": {
+ "jiti": {
+ "optional": true
}
}
},
- "eslint-scope": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
- "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
+ "node_modules/eslint-scope": {
+ "version": "8.4.0",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",
+ "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
"dev": true,
- "requires": {
+ "license": "BSD-2-Clause",
+ "dependencies": {
"esrecurse": "^4.3.0",
- "estraverse": "^4.1.1"
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "eslint-utils": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
- "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
+ "node_modules/eslint-visitor-keys": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
"dev": true,
- "requires": {
- "eslint-visitor-keys": "^1.1.0"
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
- "dependencies": {
- "eslint-visitor-keys": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
- "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
- "dev": true
- }
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "eslint-visitor-keys": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
- "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
- "dev": true
- },
- "espree": {
- "version": "7.3.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
- "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==",
+ "node_modules/espree": {
+ "version": "10.4.0",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
+ "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
"dev": true,
- "requires": {
- "acorn": "^7.4.0",
- "acorn-jsx": "^5.3.1",
- "eslint-visitor-keys": "^1.3.0"
- },
+ "license": "BSD-2-Clause",
"dependencies": {
- "eslint-visitor-keys": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
- "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
- "dev": true
- }
+ "acorn": "^8.15.0",
+ "acorn-jsx": "^5.3.2",
+ "eslint-visitor-keys": "^4.2.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "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
- },
- "esquery": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz",
- "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
+ "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,
- "requires": {
+ "license": "BSD-3-Clause",
+ "dependencies": {
"estraverse": "^5.1.0"
},
- "dependencies": {
- "estraverse": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
- "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
- "dev": true
- }
+ "engines": {
+ "node": ">=0.10"
}
},
- "esrecurse": {
+ "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,
- "requires": {
+ "license": "BSD-2-Clause",
+ "dependencies": {
"estraverse": "^5.2.0"
},
- "dependencies": {
- "estraverse": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
- "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
- "dev": true
- }
+ "engines": {
+ "node": ">=4.0"
}
},
- "estraverse": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
- "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
- "dev": true
+ "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": "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"
+ }
},
- "esutils": {
+ "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
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/expect-type": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz",
+ "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=12.0.0"
+ }
},
- "fast-deep-equal": {
+ "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
- },
- "fast-diff": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz",
- "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==",
- "dev": true
- },
- "fast-glob": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
- "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"dev": true,
- "requires": {
- "@nodelib/fs.stat": "^2.0.2",
- "@nodelib/fs.walk": "^1.2.3",
- "glob-parent": "^5.1.2",
- "merge2": "^1.3.0",
- "micromatch": "^4.0.8"
- }
+ "license": "MIT"
},
- "fast-json-stable-stringify": {
+ "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
+ "dev": true,
+ "license": "MIT"
},
- "fast-levenshtein": {
+ "node_modules/fast-levenshtein": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
- "dev": true
- },
- "fast-uri": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
- "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",
- "dev": true
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+ "dev": true,
+ "license": "MIT"
},
- "fastq": {
- "version": "1.20.3",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz",
- "integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==",
+ "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,
- "requires": {
- "reusify": "^1.0.4"
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
}
},
- "file-entry-cache": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
- "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
+ "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,
- "requires": {
- "flat-cache": "^3.0.4"
+ "license": "MIT",
+ "dependencies": {
+ "flat-cache": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=16.0.0"
}
},
- "fill-range": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
- "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
+ "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,
- "requires": {
- "to-regex-range": "^5.0.1"
+ "license": "MIT",
+ "dependencies": {
+ "locate-path": "^6.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "find-up": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
- "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
+ "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,
- "requires": {
- "locate-path": "^2.0.0"
+ "license": "MIT",
+ "dependencies": {
+ "flatted": "^3.2.9",
+ "keyv": "^4.5.4"
+ },
+ "engines": {
+ "node": ">=16"
}
},
- "flat-cache": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
- "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "node_modules/flatted": {
+ "version": "3.4.4",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz",
+ "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==",
"dev": true,
- "requires": {
- "flatted": "^3.1.0",
- "rimraf": "^3.0.2"
- }
+ "license": "ISC"
},
- "flatted": {
- "version": "3.2.7",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
- "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==",
- "dev": true
- },
- "follow-redirects": {
- "version": "1.15.11",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
- "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ=="
- },
- "form-data": {
- "version": "4.0.5",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
- "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
- "requires": {
- "asynckit": "^0.4.0",
- "combined-stream": "^1.0.8",
- "es-set-tostringtag": "^2.1.0",
- "hasown": "^2.0.2",
- "mime-types": "^2.1.12"
- }
- },
- "fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
- "dev": true
- },
- "fsevents": {
+ "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,
- "optional": true
- },
- "function-bind": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
- "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="
- },
- "functional-red-black-tree": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
- "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
- "dev": true
- },
- "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,
- "peer": true
- },
- "get-func-name": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz",
- "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==",
- "dev": true
- },
- "get-intrinsic": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
- "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
- "requires": {
- "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"
- }
- },
- "get-proto": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
- "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
- "requires": {
- "dunder-proto": "^1.0.1",
- "es-object-atoms": "^1.0.0"
- }
- },
- "glob": {
- "version": "7.1.7",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
- "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
- "dev": true,
- "requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
- "glob-parent": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
- "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
- "requires": {
- "is-glob": "^4.0.1"
- }
- },
- "globals": {
- "version": "13.10.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz",
- "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==",
- "dev": true,
- "requires": {
- "type-fest": "^0.20.2"
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
- "globby": {
- "version": "11.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
- "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
+ "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,
- "requires": {
- "array-union": "^2.1.0",
- "dir-glob": "^3.0.1",
- "fast-glob": "^3.2.9",
- "ignore": "^5.2.0",
- "merge2": "^1.4.1",
- "slash": "^3.0.0"
- },
+ "license": "ISC",
"dependencies": {
- "ignore": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
- "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
- "dev": true
- }
+ "is-glob": "^4.0.3"
+ },
+ "engines": {
+ "node": ">=10.13.0"
}
},
- "gopd": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
- "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="
- },
- "graceful-fs": {
- "version": "4.2.6",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
- "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==",
- "dev": true
- },
- "graphemer": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
- "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
- "dev": true
- },
- "has": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
- "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "node_modules/globals": {
+ "version": "14.0.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
+ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
"dev": true,
- "requires": {
- "function-bind": "^1.1.1"
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "has-bigints": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz",
- "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==",
- "dev": true
- },
- "has-flag": {
+ "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
- },
- "has-symbols": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
- "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="
- },
- "has-tostringtag": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
- "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
- "requires": {
- "has-symbols": "^1.0.3"
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
}
},
- "hasown": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
- "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
- "requires": {
- "function-bind": "^1.1.2"
+ "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"
}
},
- "hosted-git-info": {
- "version": "2.8.9",
- "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
- "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
- "dev": true
- },
- "ignore": {
- "version": "4.0.6",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
- "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
- "dev": true
- },
- "immediate": {
- "version": "3.0.6",
- "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
- "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
- },
- "import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "node_modules/import-fresh": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
"dev": true,
- "requires": {
+ "license": "MIT",
+ "dependencies": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "imurmurhash": {
+ "node_modules/imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
- "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
- "dev": true
- },
- "inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
- "dev": true,
- "requires": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
- },
- "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-bigint": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz",
- "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==",
- "dev": true
- },
- "is-boolean-object": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz",
- "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
"dev": true,
- "requires": {
- "call-bind": "^1.0.2"
- }
- },
- "is-callable": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz",
- "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==",
- "dev": true
- },
- "is-core-module": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.5.0.tgz",
- "integrity": "sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==",
- "dev": true,
- "requires": {
- "has": "^1.0.3"
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.8.19"
}
},
- "is-date-object": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz",
- "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==",
- "dev": true
- },
- "is-extglob": {
+ "node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
- "dev": true
- },
- "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
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
},
- "is-glob": {
+ "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,
- "requires": {
+ "license": "MIT",
+ "dependencies": {
"is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
}
},
- "is-negative-zero": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
- "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==",
- "dev": true
- },
- "is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true
- },
- "is-number-object": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz",
- "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==",
- "dev": true
- },
- "is-regex": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz",
- "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==",
- "dev": true,
- "requires": {
- "call-bind": "^1.0.2",
- "has-symbols": "^1.0.2"
- }
- },
- "is-string": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz",
- "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==",
- "dev": true
- },
- "is-symbol": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
- "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
- "dev": true,
- "requires": {
- "has-symbols": "^1.0.2"
- }
- },
- "isarray": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
- "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
- },
- "isexe": {
+ "node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
- "dev": true
- },
- "js-string-escape": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz",
- "integrity": "sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==",
- "dev": true
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+ "dev": true,
+ "license": "ISC"
},
- "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
+ "node_modules/js-tokens": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz",
+ "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==",
+ "dev": true,
+ "license": "MIT"
},
- "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==",
+ "node_modules/js-yaml": {
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
"dev": true,
- "requires": {
- "argparse": "^1.0.7",
- "esprima": "^4.0.0"
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/puzrin"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/nodeca"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
}
},
- "jsesc": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
- "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
+ "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,
- "peer": true
- },
- "json-parse-better-errors": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
- "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
- "dev": true
+ "license": "MIT"
},
- "json-schema-traverse": {
+ "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
+ "dev": true,
+ "license": "MIT"
},
- "json-stable-stringify-without-jsonify": {
+ "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": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
- "dev": true
- },
- "json5": {
- "version": "2.2.3",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
- "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
- "dev": true
- },
- "jszip": {
- "version": "3.8.0",
- "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.8.0.tgz",
- "integrity": "sha512-cnpQrXvFSLdsR9KR5/x7zdf6c3m8IhZfZzSblFEHSqBaVwD2nvJ4CuCKLyvKvwBgZm08CgfSoiTBQLm5WW9hGw==",
- "requires": {
- "lie": "~3.3.0",
- "pako": "~1.0.2",
- "readable-stream": "~2.3.6",
- "set-immediate-shim": "~1.0.1"
- }
- },
- "levn": {
+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "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/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": {
+ "license": "MIT",
+ "dependencies": {
"prelude-ls": "^1.2.1",
"type-check": "~0.4.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
}
},
- "lie": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
- "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
- "requires": {
- "immediate": "~3.0.5"
- }
- },
- "load-json-file": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
- "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.2",
- "parse-json": "^4.0.0",
- "pify": "^3.0.0",
- "strip-bom": "^3.0.0"
- }
- },
- "local-pkg": {
- "version": "0.4.3",
- "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz",
- "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==",
- "dev": true
- },
- "locate-path": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
- "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
+ "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": {
- "p-locate": "^2.0.0",
- "path-exists": "^3.0.0"
+ "license": "MIT",
+ "dependencies": {
+ "p-locate": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "lodash": {
- "version": "4.17.23",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
- "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
- "dev": true
- },
- "lodash.clonedeep": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
- "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=",
- "dev": true
- },
- "lodash.merge": {
+ "node_modules/lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
- "dev": true
- },
- "lodash.truncate": {
- "version": "4.4.2",
- "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz",
- "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=",
- "dev": true
- },
- "loupe": {
- "version": "2.3.6",
- "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz",
- "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==",
- "dev": true,
- "requires": {
- "get-func-name": "^2.0.0"
- }
- },
- "magic-string": {
- "version": "0.30.11",
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz",
- "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==",
- "dev": true,
- "requires": {
- "@jridgewell/sourcemap-codec": "^1.5.0"
- }
- },
- "math-intrinsics": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
- "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="
- },
- "md5-hex": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz",
- "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==",
- "dev": true,
- "requires": {
- "blueimp-md5": "^2.10.0"
- }
- },
- "merge2": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
- "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
- "dev": true
- },
- "micromatch": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
- "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
- "dev": true,
- "requires": {
- "braces": "^3.0.3",
- "picomatch": "^2.3.1"
- }
- },
- "mime-db": {
- "version": "1.52.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
- "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
- },
- "mime-types": {
- "version": "2.1.35",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
- "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
- "requires": {
- "mime-db": "1.52.0"
- }
- },
- "minimatch": {
- "version": "3.1.5",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
- "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
- "dev": true,
- "requires": {
- "brace-expansion": "^1.1.7"
- }
- },
- "minimist": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
- "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
- "dev": true
- },
- "mlly": {
- "version": "1.7.1",
- "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.1.tgz",
- "integrity": "sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==",
- "dev": true,
- "requires": {
- "acorn": "^8.11.3",
- "pathe": "^1.1.2",
- "pkg-types": "^1.1.1",
- "ufo": "^1.5.3"
- },
- "dependencies": {
- "acorn": {
- "version": "8.12.1",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
- "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
- "dev": true
- }
- }
- },
- "ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
- "dev": true
- },
- "nanocolors": {
- "version": "0.2.12",
- "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.2.12.tgz",
- "integrity": "sha512-SFNdALvzW+rVlzqexid6epYdt8H9Zol7xDoQarioEFcFN0JHo4CYNztAxmtfgGTVRCmFlEOqqhBpoFGKqSAMug==",
"dev": true,
- "peer": true
- },
- "nanoid": {
- "version": "3.3.11",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
- "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
- "dev": true
- },
- "natural-compare": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
- "dev": true
- },
- "natural-compare-lite": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.1.tgz",
- "integrity": "sha512-8Mz06azhPqiDlxhUaUTjBhNAbib/1MoPr89kgmuV6Ir8ICT2/Q/XSYg6VfL3fq2x8MpSQX8sqyI/NeZ5GsGyXA==",
- "dev": true
+ "license": "MIT"
},
- "node-releases": {
- "version": "1.1.77",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.77.tgz",
- "integrity": "sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ==",
+ "node_modules/loupe": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",
+ "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==",
"dev": true,
- "peer": true
+ "license": "MIT"
},
- "normalize-package-data": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
- "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
+ "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==",
"dev": true,
- "requires": {
- "hosted-git-info": "^2.1.4",
- "resolve": "^1.10.0",
- "semver": "2 || 3 || 4 || 5",
- "validate-npm-package-license": "^3.0.1"
- },
+ "license": "MIT",
"dependencies": {
- "semver": {
- "version": "5.7.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
- "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
- "dev": true
- }
+ "@jridgewell/sourcemap-codec": "^1.5.5"
}
},
- "object-inspect": {
- "version": "1.11.0",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
- "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==",
- "dev": true
- },
- "object-keys": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
- "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
- "dev": true
- },
- "object.assign": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
- "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
+ "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,
- "requires": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3",
- "has-symbols": "^1.0.1",
- "object-keys": "^1.1.1"
+ "license": "ISC",
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
}
},
- "object.entries": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.4.tgz",
- "integrity": "sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA==",
+ "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==",
"dev": true,
- "requires": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.2"
- }
+ "license": "MIT"
},
- "object.values": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz",
- "integrity": "sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==",
+ "node_modules/nanoid": {
+ "version": "3.3.19",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.19.tgz",
+ "integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==",
"dev": true,
- "requires": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.2"
+ "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"
}
},
- "once": {
+ "node_modules/natural-compare": {
"version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
"dev": true,
- "requires": {
- "wrappy": "1"
- }
+ "license": "MIT"
},
- "optionator": {
- "version": "0.9.1",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
- "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "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": {
+ "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.3"
+ "word-wrap": "^1.2.5"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
}
},
- "p-limit": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
- "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
+ "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": {
- "p-try": "^1.0.0"
+ "license": "MIT",
+ "dependencies": {
+ "yocto-queue": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "p-locate": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
- "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
+ "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,
- "requires": {
- "p-limit": "^1.1.0"
+ "license": "MIT",
+ "dependencies": {
+ "p-limit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "p-try": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
- "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
- "dev": true
- },
- "pako": {
- "version": "1.0.11",
- "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
- "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
- },
- "parent-module": {
+ "node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dev": true,
- "requires": {
+ "license": "MIT",
+ "dependencies": {
"callsites": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
}
},
- "parse-json": {
+ "node_modules/path-exists": {
"version": "4.0.0",
- "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
- "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true,
- "requires": {
- "error-ex": "^1.3.1",
- "json-parse-better-errors": "^1.0.1"
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
}
},
- "path-exists": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
- "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
- "dev": true
- },
- "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-key": {
+ "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
- },
- "path-parse": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
- "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
- "dev": true
- },
- "path-type": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
- "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
"dev": true,
- "requires": {
- "pify": "^3.0.0"
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
}
},
- "pathe": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
- "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==",
- "dev": true
+ "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,
+ "license": "MIT"
},
- "pathval": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz",
- "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==",
- "dev": true
+ "node_modules/pathval": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz",
+ "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.16"
+ }
},
- "picocolors": {
+ "node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
- "dev": true
- },
- "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
- },
- "pify": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
- "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
- "dev": true
- },
- "pkg-dir": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
- "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
- "dev": true,
- "requires": {
- "find-up": "^2.1.0"
- }
- },
- "pkg-types": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.2.0.tgz",
- "integrity": "sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==",
"dev": true,
- "requires": {
- "confbox": "^0.1.7",
- "mlly": "^1.7.1",
- "pathe": "^1.1.2"
- }
+ "license": "ISC"
},
- "pkg-up": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz",
- "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=",
+ "node_modules/picomatch": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",
+ "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",
"dev": true,
- "requires": {
- "find-up": "^2.1.0"
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
}
},
- "postcss": {
- "version": "8.4.45",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.45.tgz",
- "integrity": "sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==",
+ "node_modules/postcss": {
+ "version": "8.5.28",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz",
+ "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==",
"dev": true,
- "requires": {
- "nanoid": "^3.3.7",
- "picocolors": "^1.0.1",
- "source-map-js": "^1.2.0"
+ "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.18",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
}
},
- "prelude-ls": {
+ "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
- },
- "pretty-format": {
- "version": "27.5.1",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz",
- "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
- "dev": true,
- "requires": {
- "ansi-regex": "^5.0.1",
- "ansi-styles": "^5.0.0",
- "react-is": "^17.0.1"
- },
- "dependencies": {
- "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
- }
- }
- },
- "process-nextick-args": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
- "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
- },
- "progress": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
- "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
- "dev": true
- },
- "proxy-from-env": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
- "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
- },
- "punycode": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
- "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
- "dev": true
- },
- "queue-microtask": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
- "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
- "dev": true
- },
- "react-is": {
- "version": "17.0.2",
- "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
- "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
- "dev": true
- },
- "read-pkg": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
- "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
"dev": true,
- "requires": {
- "load-json-file": "^4.0.0",
- "normalize-package-data": "^2.3.2",
- "path-type": "^3.0.0"
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8.0"
}
},
- "read-pkg-up": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz",
- "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=",
- "dev": true,
- "requires": {
- "find-up": "^2.0.0",
- "read-pkg": "^3.0.0"
- }
- },
- "readable-stream": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
- "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
- "requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
- }
- },
- "regexpp": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
- "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
- "dev": true
- },
- "require-from-string": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
- "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
- "dev": true
- },
- "resolve": {
- "version": "1.20.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
- "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
+ "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,
- "requires": {
- "is-core-module": "^2.2.0",
- "path-parse": "^1.0.6"
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
}
},
- "resolve-from": {
+ "node_modules/resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
- "dev": true
- },
- "reusify": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
- "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
- "dev": true
- },
- "rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"dev": true,
- "requires": {
- "glob": "^7.1.3"
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
}
},
- "rollup": {
- "version": "3.30.0",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.30.0.tgz",
- "integrity": "sha512-kQvGasUgN+AlWGliFn2POSajRQEsULVYFGTvOZmK06d7vCD+YhZztt70kGk3qaeAXeWYL5eO7zx+rAubBc55eA==",
+ "node_modules/rollup": {
+ "version": "4.64.0",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.64.0.tgz",
+ "integrity": "sha512-gjA/kFeDfffII8COoPsvLPvE16hWDTEc1+0QKQNKUkuV8iJjqsC4xXs8/FzuL0v9EV39kuxTbAgcFoTRyy2TGQ==",
"dev": true,
- "requires": {
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.9"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@napi-rs/lzma-linux-x64-gnu": "1.5.1",
+ "@rollup/rollup-android-arm-eabi": "4.64.0",
+ "@rollup/rollup-android-arm64": "4.64.0",
+ "@rollup/rollup-darwin-arm64": "4.64.0",
+ "@rollup/rollup-darwin-x64": "4.64.0",
+ "@rollup/rollup-freebsd-arm64": "4.64.0",
+ "@rollup/rollup-freebsd-x64": "4.64.0",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.64.0",
+ "@rollup/rollup-linux-arm-musleabihf": "4.64.0",
+ "@rollup/rollup-linux-arm64-gnu": "4.64.0",
+ "@rollup/rollup-linux-arm64-musl": "4.64.0",
+ "@rollup/rollup-linux-loong64-gnu": "4.64.0",
+ "@rollup/rollup-linux-loong64-musl": "4.64.0",
+ "@rollup/rollup-linux-ppc64-gnu": "4.64.0",
+ "@rollup/rollup-linux-ppc64-musl": "4.64.0",
+ "@rollup/rollup-linux-riscv64-gnu": "4.64.0",
+ "@rollup/rollup-linux-riscv64-musl": "4.64.0",
+ "@rollup/rollup-linux-s390x-gnu": "4.64.0",
+ "@rollup/rollup-linux-x64-gnu": "4.64.0",
+ "@rollup/rollup-linux-x64-musl": "4.64.0",
+ "@rollup/rollup-openbsd-x64": "4.64.0",
+ "@rollup/rollup-openharmony-arm64": "4.64.0",
+ "@rollup/rollup-win32-arm64-msvc": "4.64.0",
+ "@rollup/rollup-win32-ia32-msvc": "4.64.0",
+ "@rollup/rollup-win32-x64-gnu": "4.64.0",
+ "@rollup/rollup-win32-x64-msvc": "4.64.0",
"fsevents": "~2.3.2"
}
},
- "run-parallel": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
- "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
+ "node_modules/semver": {
+ "version": "7.8.5",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
"dev": true,
- "requires": {
- "queue-microtask": "^1.2.2"
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
}
},
- "safe-buffer": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
- "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
- },
- "semver": {
- "version": "7.7.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
- "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
- "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="
- },
- "shebang-command": {
+ "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": {
+ "license": "MIT",
+ "dependencies": {
"shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
}
},
- "shebang-regex": {
+ "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
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
},
- "siginfo": {
+ "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
- },
- "slash": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
- "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
- "dev": true
- },
- "slice-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
- "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "^4.0.0",
- "astral-regex": "^2.0.0",
- "is-fullwidth-code-point": "^3.0.0"
- }
- },
- "source-map": {
- "version": "0.5.7",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
- "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true,
- "peer": true
- },
- "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==",
- "dev": true
- },
- "spdx-correct": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
- "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
- "dev": true,
- "requires": {
- "spdx-expression-parse": "^3.0.0",
- "spdx-license-ids": "^3.0.0"
- }
- },
- "spdx-exceptions": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
- "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
- "dev": true
+ "license": "ISC"
},
- "spdx-expression-parse": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
- "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
+ "node_modules/source-map-js": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
+ "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",
"dev": true,
- "requires": {
- "spdx-exceptions": "^2.1.0",
- "spdx-license-ids": "^3.0.0"
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
}
},
- "spdx-license-ids": {
- "version": "3.0.9",
- "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz",
- "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==",
- "dev": true
- },
- "sprintf-js": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
- "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
- "dev": true
- },
- "stackback": {
+ "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
- },
- "std-env": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz",
- "integrity": "sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==",
- "dev": true
- },
- "string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "requires": {
- "safe-buffer": "~5.1.0"
- }
- },
- "string-width": {
- "version": "4.2.2",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
- "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
- "dev": true,
- "requires": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.0"
- }
- },
- "string.prototype.trimend": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz",
- "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==",
"dev": true,
- "requires": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3"
- }
+ "license": "MIT"
},
- "string.prototype.trimstart": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz",
- "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==",
+ "node_modules/std-env": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz",
+ "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==",
"dev": true,
- "requires": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3"
- }
+ "license": "MIT"
},
- "strip-ansi": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
- "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+ "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": {
- "ansi-regex": "^5.0.0"
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "strip-bom": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
- "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
- "dev": true
- },
- "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
- },
- "strip-literal": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.1.tgz",
- "integrity": "sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==",
+ "node_modules/strip-literal": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz",
+ "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==",
"dev": true,
- "requires": {
- "acorn": "^8.8.2"
- },
+ "license": "MIT",
"dependencies": {
- "acorn": {
- "version": "8.8.2",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
- "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
- "dev": true
- }
+ "js-tokens": "^9.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
}
},
- "supports-color": {
+ "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": {
+ "license": "MIT",
+ "dependencies": {
"has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
}
},
- "table": {
- "version": "6.7.1",
- "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz",
- "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==",
+ "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,
- "requires": {
- "ajv": "^8.0.1",
- "lodash.clonedeep": "^4.5.0",
- "lodash.truncate": "^4.4.2",
- "slice-ansi": "^4.0.0",
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.0"
- },
- "dependencies": {
- "ajv": {
- "version": "8.18.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz",
- "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==",
- "dev": true,
- "requires": {
- "fast-deep-equal": "^3.1.3",
- "fast-uri": "^3.0.1",
- "json-schema-traverse": "^1.0.0",
- "require-from-string": "^2.0.2"
- }
- },
- "json-schema-traverse": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
- "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
- "dev": true
- }
- }
+ "license": "MIT"
},
- "text-table": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
- "dev": true
+ "node_modules/tinyexec": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz",
+ "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==",
+ "dev": true,
+ "license": "MIT"
},
- "time-zone": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz",
- "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==",
- "dev": true
+ "node_modules/tinyglobby": {
+ "version": "0.2.17",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
},
- "tinybench": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz",
- "integrity": "sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==",
- "dev": true
- },
- "tinypool": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.5.0.tgz",
- "integrity": "sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==",
- "dev": true
- },
- "tinyspy": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz",
- "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==",
- "dev": true
- },
- "to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "node_modules/tinypool": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz",
+ "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==",
"dev": true,
- "requires": {
- "is-number": "^7.0.0"
+ "license": "MIT",
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
}
},
- "tsconfig-paths": {
- "version": "3.10.1",
- "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz",
- "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==",
+ "node_modules/tinyrainbow": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz",
+ "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==",
"dev": true,
- "requires": {
- "json5": "^2.2.0",
- "minimist": "^1.2.0",
- "strip-bom": "^3.0.0"
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
}
},
- "tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
- "dev": true
+ "node_modules/tinyspy": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.6.tgz",
+ "integrity": "sha512-u8KszXvGfU68hVcZpRHKG28T0krMuv2G5nDhiHaMLen/gIuFEgIJhaJuO69qjnXg5paSrbPMFfx3brNuN8eVSg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
},
- "tsutils": {
- "version": "3.21.0",
- "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz",
- "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==",
+ "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,
- "requires": {
- "tslib": "^1.8.1"
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.12"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4"
}
},
- "type-check": {
+ "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": {
+ "license": "MIT",
+ "dependencies": {
"prelude-ls": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
}
},
- "type-detect": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz",
- "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==",
- "dev": true
- },
- "type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true
- },
- "typescript": {
+ "node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
- "dev": true
- },
- "ufo": {
- "version": "1.5.4",
- "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.4.tgz",
- "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==",
- "dev": true
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
},
- "unbox-primitive": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
- "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
+ "node_modules/typescript-eslint": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.71.0.tgz",
+ "integrity": "sha512-fBdHYiqQ14RW6mOMXD14Svn82ZsCYAoQSzGRzyEjR59S5A2Krh/l7fGTOQ7iCr8gGy/mHVXtEF7s5fgjEdV0Pw==",
"dev": true,
- "requires": {
- "function-bind": "^1.1.1",
- "has-bigints": "^1.0.1",
- "has-symbols": "^1.0.2",
- "which-boxed-primitive": "^1.0.2"
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/eslint-plugin": "8.71.0",
+ "@typescript-eslint/parser": "8.71.0",
+ "@typescript-eslint/typescript-estree": "8.71.0",
+ "@typescript-eslint/utils": "8.71.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.1.0"
}
},
- "undici-types": {
+ "node_modules/undici-types": {
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
- "uri-js": {
+ "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": {
+ "license": "BSD-2-Clause",
+ "dependencies": {
"punycode": "^2.1.0"
}
},
- "util-deprecate": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
- },
- "v8-compile-cache": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
- "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==",
- "dev": true
- },
- "validate-npm-package-license": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
- "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
+ "node_modules/vite": {
+ "version": "7.3.6",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.6.tgz",
+ "integrity": "sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==",
"dev": true,
- "requires": {
- "spdx-correct": "^3.0.0",
- "spdx-expression-parse": "^3.0.0"
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "^0.27.0 || ^0.28.0",
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.3",
+ "postcss": "^8.5.6",
+ "rollup": "^4.43.0",
+ "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",
+ "jiti": ">=1.21.0",
+ "less": "^4.0.0",
+ "lightningcss": "^1.21.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
+ },
+ "jiti": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
}
},
- "vite": {
- "version": "4.5.14",
- "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.14.tgz",
- "integrity": "sha512-+v57oAaoYNnO3hIu5Z/tJRZjq5aHM2zDve9YZ8HngVHbhk66RStobhb1sqPMIPEleV6cNKYK4eGrAbE9Ulbl2g==",
+ "node_modules/vite-node": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz",
+ "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==",
"dev": true,
- "requires": {
- "esbuild": "^0.18.10",
- "fsevents": "~2.3.2",
- "postcss": "^8.4.27",
- "rollup": "^3.27.1"
+ "license": "MIT",
+ "dependencies": {
+ "cac": "^6.7.14",
+ "debug": "^4.4.1",
+ "es-module-lexer": "^1.7.0",
+ "pathe": "^2.0.3",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0"
+ },
+ "bin": {
+ "vite-node": "vite-node.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
}
},
- "vite-node": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.31.4.tgz",
- "integrity": "sha512-uzL377GjJtTbuc5KQxVbDu2xfU/x0wVjUtXQR2ihS21q/NK6ROr4oG0rsSkBBddZUVCwzfx22in76/0ZZHXgkQ==",
- "dev": true,
- "requires": {
- "cac": "^6.7.14",
- "debug": "^4.3.4",
- "mlly": "^1.2.0",
- "pathe": "^1.1.0",
- "picocolors": "^1.0.0",
- "vite": "^3.0.0 || ^4.0.0"
- }
- },
- "vitest": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.31.4.tgz",
- "integrity": "sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==",
- "dev": true,
- "requires": {
- "@types/chai": "^4.3.5",
- "@types/chai-subset": "^1.3.3",
- "@types/node": "*",
- "@vitest/expect": "0.31.4",
- "@vitest/runner": "0.31.4",
- "@vitest/snapshot": "0.31.4",
- "@vitest/spy": "0.31.4",
- "@vitest/utils": "0.31.4",
- "acorn": "^8.8.2",
- "acorn-walk": "^8.2.0",
- "cac": "^6.7.14",
- "chai": "^4.3.7",
- "concordance": "^5.0.4",
- "debug": "^4.3.4",
- "local-pkg": "^0.4.3",
- "magic-string": "^0.30.0",
- "pathe": "^1.1.0",
- "picocolors": "^1.0.0",
- "std-env": "^3.3.2",
- "strip-literal": "^1.0.1",
- "tinybench": "^2.5.0",
- "tinypool": "^0.5.0",
- "vite": "^3.0.0 || ^4.0.0",
- "vite-node": "0.31.4",
- "why-is-node-running": "^2.2.2"
+ "node_modules/vitest": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.7.tgz",
+ "integrity": "sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/chai": "^5.2.2",
+ "@vitest/expect": "3.2.7",
+ "@vitest/mocker": "3.2.7",
+ "@vitest/pretty-format": "^3.2.7",
+ "@vitest/runner": "3.2.7",
+ "@vitest/snapshot": "3.2.7",
+ "@vitest/spy": "3.2.7",
+ "@vitest/utils": "3.2.7",
+ "chai": "^5.2.0",
+ "debug": "^4.4.1",
+ "expect-type": "^1.2.1",
+ "magic-string": "^0.30.17",
+ "pathe": "^2.0.3",
+ "picomatch": "^4.0.2",
+ "std-env": "^3.9.0",
+ "tinybench": "^2.9.0",
+ "tinyexec": "^0.3.2",
+ "tinyglobby": "^0.2.14",
+ "tinypool": "^1.1.1",
+ "tinyrainbow": "^2.0.0",
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0",
+ "vite-node": "3.2.4",
+ "why-is-node-running": "^2.3.0"
},
- "dependencies": {
- "@vitest/utils": {
- "version": "0.31.4",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.4.tgz",
- "integrity": "sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ==",
- "dev": true,
- "requires": {
- "concordance": "^5.0.4",
- "loupe": "^2.3.6",
- "pretty-format": "^27.5.1"
- }
+ "bin": {
+ "vitest": "vitest.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "@edge-runtime/vm": "*",
+ "@types/debug": "^4.1.12",
+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
+ "@vitest/browser": "3.2.7",
+ "@vitest/ui": "3.2.7",
+ "happy-dom": "*",
+ "jsdom": "*"
+ },
+ "peerDependenciesMeta": {
+ "@edge-runtime/vm": {
+ "optional": true
+ },
+ "@types/debug": {
+ "optional": true
+ },
+ "@types/node": {
+ "optional": true
+ },
+ "@vitest/browser": {
+ "optional": true
+ },
+ "@vitest/ui": {
+ "optional": true
},
- "acorn": {
- "version": "8.8.2",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
- "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
- "dev": true
+ "happy-dom": {
+ "optional": true
+ },
+ "jsdom": {
+ "optional": true
}
}
},
- "well-known-symbols": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz",
- "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==",
- "dev": true
- },
- "which": {
+ "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": {
+ "license": "ISC",
+ "dependencies": {
"isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
}
},
- "which-boxed-primitive": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
- "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
- "dev": true,
- "requires": {
- "is-bigint": "^1.0.1",
- "is-boolean-object": "^1.1.0",
- "is-number-object": "^1.0.4",
- "is-string": "^1.0.5",
- "is-symbol": "^1.0.3"
- }
- },
- "why-is-node-running": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz",
- "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==",
+ "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": {
+ "license": "MIT",
+ "dependencies": {
"siginfo": "^2.0.0",
"stackback": "0.0.2"
+ },
+ "bin": {
+ "why-is-node-running": "cli.js"
+ },
+ "engines": {
+ "node": ">=8"
}
},
- "word-wrap": {
+ "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
- },
- "wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
- "dev": true
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
},
- "ws": {
- "version": "7.5.10",
- "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
- "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
- "requires": {}
+ "node_modules/ws": {
+ "version": "8.22.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.0.tgz",
+ "integrity": "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==",
+ "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
+ }
+ }
},
- "yocto-queue": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz",
- "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==",
- "dev": true
+ "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,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
}
}
}
diff --git a/package.json b/package.json
index 860e15f..a30b834 100644
--- a/package.json
+++ b/package.json
@@ -1,52 +1,74 @@
{
"name": "@mathieuc/tradingview",
- "version": "3.5.2",
- "description": "Tradingview instant stocks API, indicator alerts, trading bot, and more !",
- "main": "main.js",
+ "version": "4.0.0-beta.0",
+ "description": "TradingView market data for JavaScript and TypeScript: candles, quotes, indicators and strategies, with a simple data API and full low-level access.",
+ "type": "module",
+ "main": "./dist/index.js",
+ "types": "./dist/index.d.ts",
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.ts",
+ "import": "./dist/index.js",
+ "default": "./dist/index.js"
+ },
+ "./data": {
+ "types": "./dist/data/index.d.ts",
+ "import": "./dist/data/index.js",
+ "default": "./dist/data/index.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "files": [
+ "dist",
+ "README.md",
+ "docs"
+ ],
+ "sideEffects": false,
"scripts": {
- "test": "vitest",
- "example": "node --env-file=.env",
- "example:dev": "nodemon --env-file=.env",
- "build:agent": "tsc -p tsconfig.agent.json",
- "prepack": "npm run build:agent",
- "lint:agent": "eslint agent.ts tests/agent.test.ts"
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
+ "typecheck": "tsc -p tsconfig.json --noEmit",
+ "lint": "eslint .",
+ "test": "vitest run",
+ "test:bun": "bun test tests/unit",
+ "test:watch": "vitest",
+ "test:live": "vitest run --config vitest.live.config.ts",
+ "smoke": "node scripts/smoke.mjs",
+ "check": "npm run typecheck && npm run lint && npm test && npm run build && npm run smoke",
+ "prepack": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Mathieu2301/TradingView-API.git"
},
"engines": {
- "node": ">=14.0.0"
+ "node": ">=20.0.0"
},
"keywords": [
- "tradingwiew",
- "market",
+ "tradingview",
+ "market-data",
+ "candles",
+ "quotes",
"stocks",
"crypto",
"forex",
"indicator",
- "bitcoin",
+ "pine",
+ "websocket",
"api"
],
"author": "Mathieu Colmon",
"license": "ISC",
"dependencies": {
- "axios": "^1.5.0",
- "jszip": "^3.7.1",
- "ws": "^7.4.3"
+ "ws": "^8.18.0"
},
"devDependencies": {
- "@babel/eslint-parser": "^7.15.7",
- "@mathieuc/console": "^1.0.1",
- "@types/node": "^20.19.43",
- "@typescript-eslint/eslint-plugin": "^5.62.0",
- "@typescript-eslint/parser": "^5.62.0",
- "dotenv": "^16.3.1",
- "eslint": "^7.25.0",
- "eslint-config-airbnb-base": "^14.2.1",
- "eslint-plugin-import": "^2.22.1",
- "typescript": "^5.9.3",
- "vitest": "^0.31.4"
+ "@eslint/js": "^9.39.0",
+ "@types/node": "^22.20.5",
+ "@types/ws": "^8.18.1",
+ "eslint": "^9.39.0",
+ "typescript": "~5.9.3",
+ "typescript-eslint": "^8.46.0",
+ "vitest": "^3.2.4"
},
"homepage": "https://github.com/Mathieu2301/TradingView-API#readme",
"bugs": {
diff --git a/scripts/smoke.mjs b/scripts/smoke.mjs
new file mode 100644
index 0000000..4eba87d
--- /dev/null
+++ b/scripts/smoke.mjs
@@ -0,0 +1,86 @@
+#!/usr/bin/env node
+// Packs the library, installs the tarball in a temporary project and checks
+// that both entry points load (ESM + type declarations) under Node and Bun.
+// Network is not required: no TradingView call is made.
+import { execFileSync, spawnSync } from 'node:child_process';
+import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join, resolve } from 'node:path';
+
+const root = resolve(import.meta.dirname ?? new URL('.', import.meta.url).pathname, '..');
+const run = (cmd, args, cwd) => {
+ try {
+ return execFileSync(cmd, args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] }).toString();
+ } catch (error) {
+ process.stderr.write(`${error.stdout ?? ''}${error.stderr ?? ''}`);
+ throw new Error(`Command failed: ${cmd} ${args.join(' ')}`);
+ }
+};
+
+const dir = mkdtempSync(join(tmpdir(), 'tv-smoke-'));
+try {
+ const packed = JSON.parse(run('npm', ['pack', '--json', '--pack-destination', dir], root))[0];
+ const files = packed.files.map((f) => f.path);
+ for (const required of ['dist/index.js', 'dist/index.d.ts', 'dist/data/index.js', 'dist/data/index.d.ts', 'README.md']) {
+ if (!files.includes(required)) throw new Error(`Missing ${required} in package`);
+ }
+ if (files.some((f) => f.startsWith('src/') || f.startsWith('tests/'))) throw new Error('Sources or tests leaked into package');
+ console.log(`packed ${packed.filename} (${files.length} files, ${packed.size} bytes)`);
+
+ writeFileSync(join(dir, 'package.json'), JSON.stringify({ name: 'smoke', private: true, type: 'module' }));
+ run('npm', ['install', '--no-audit', '--no-fund', '--ignore-scripts', join(dir, packed.filename)], dir);
+
+ const check = `
+ import * as tv from '@mathieuc/tradingview';
+ import { getCandles, watchQuotes, TradingViewError, TradingViewProvider } from '@mathieuc/tradingview/data';
+ const pkg = JSON.parse(await (await import('node:fs/promises')).readFile(new URL(import.meta.resolve('@mathieuc/tradingview/package.json')), 'utf8'));
+ if (typeof tv.TradingViewClient !== 'function' || typeof getCandles !== 'function' || typeof watchQuotes !== 'function' || typeof TradingViewProvider !== 'function') throw new Error('exports missing');
+ if (tv.getCandles !== getCandles) throw new Error('entry points disagree');
+ const frame = tv.protocol.encodePacket('set_auth_token', ['x']);
+ if (tv.protocol.decodeFrames(frame)[0].packet.m !== 'set_auth_token') throw new Error('protocol roundtrip failed');
+ const error = await getCandles({ symbol: '' }).catch((e) => e);
+ if (!(error instanceof TradingViewError) || error.code !== 'INVALID_ARGUMENT') throw new Error('validation failed');
+ console.log('ok', pkg.version, typeof Bun === 'undefined' ? 'node ' + process.version : 'bun ' + Bun.version);
+ `;
+ writeFileSync(join(dir, 'check.mjs'), check);
+ process.stdout.write(run('node', ['check.mjs'], dir));
+
+ // CommonJS consumers can require() the ESM build on Node >= 20.19 / 22.12.
+ const [major, minor] = process.versions.node.split('.').map(Number);
+ if (major > 22 || (major === 22 && minor >= 12) || (major === 20 && minor >= 19)) {
+ writeFileSync(join(dir, 'check.cjs'), `
+ const { getCandles } = require('@mathieuc/tradingview/data');
+ const { TradingViewClient } = require('@mathieuc/tradingview');
+ if (typeof getCandles !== 'function' || typeof TradingViewClient !== 'function') throw new Error('require failed');
+ console.log('require ok');
+ `);
+ process.stdout.write(run('node', ['check.cjs'], dir));
+ } else console.log(`require(esm) not supported by Node ${process.version}: skipped`);
+
+ const bun = spawnSync('bun', ['--version']);
+ if (bun.status === 0) process.stdout.write(run('bun', ['check.mjs'], dir));
+ else console.log('bun not installed: skipped');
+
+ // Type declarations resolve for a TypeScript consumer.
+ const tsc = join(root, 'node_modules', 'typescript', 'bin', 'tsc');
+ writeFileSync(join(dir, 'consumer.ts'), `
+ import { getCandles, TradingViewProvider, type Candle, type MarketDataProvider } from '@mathieuc/tradingview/data';
+ import { TradingViewClient, type StudyValue } from '@mathieuc/tradingview';
+ const candles: Promise<Candle[]> = getCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '60', count: 10 });
+ const client = new TradingViewClient();
+ const chart = client.createChart();
+ chart.on('update', (changes: string[]) => console.log(changes, chart.candles.at(-1)?.close));
+ const row: StudyValue = { $time: 1 };
+ const provider: MarketDataProvider = new TradingViewProvider();
+ void candles; void row; void provider;
+ `);
+ writeFileSync(join(dir, 'tsconfig.json'), JSON.stringify({
+ compilerOptions: { module: 'NodeNext', moduleResolution: 'NodeNext', target: 'ES2022', strict: true, noEmit: true, types: [], lib: ['ES2022', 'DOM'] },
+ files: ['consumer.ts'],
+ }));
+ run('node', [tsc, '-p', 'tsconfig.json'], dir);
+ console.log('types ok');
+ JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'));
+} finally {
+ rmSync(dir, { recursive: true, force: true });
+}
diff --git a/src/chart/chart-session.ts b/src/chart/chart-session.ts
new file mode 100644
index 0000000..2cca817
--- /dev/null
+++ b/src/chart/chart-session.ts
@@ -0,0 +1,452 @@
+import type { TradingViewClient, SessionHandler } from '../client/client.js';
+import { TradingViewError } from '../errors.js';
+import { Emitter } from '../events.js';
+import type { Indicator } from '../indicators/index.js';
+import type { ServerPacket } from '../protocol/framing.js';
+import { createSessionId } from '../protocol/ids.js';
+import { Study, type StudyBridge } from './study.js';
+import {
+ CHART_TYPE_STUDIES,
+ type Adjustment, type Candle, type ChartType, type ChartTypeInputs, type SymbolInfo,
+ type Timeframe, type Timezone, type TradingSession,
+} from './types.js';
+
+export interface MarketOptions {
+ /** Bar resolution. Default: `D`. */
+ timeframe?: Timeframe;
+ /**
+ * Number of bars to load when the series is created. Default: 100.
+ * Negative values load bars *after* `to` instead of before it.
+ * Only the first `setMarket` of a chart creates the series; later calls
+ * keep the loaded bar count (use `fetchMore` or a new chart).
+ */
+ count?: number;
+ /** Reference time (Unix seconds) of the last bar to load. Default: now. */
+ to?: number;
+ /** Price adjustment. Default: `splits`. */
+ adjustment?: Adjustment;
+ /** Back-adjust continuous futures contracts. */
+ backAdjustment?: boolean;
+ /** Trading session (`regular` or `extended`). */
+ session?: TradingSession;
+ /** Convert prices to a currency, e.g. `EUR`. */
+ currency?: string;
+ /** Custom bar type (Heikin Ashi, Renko...). */
+ type?: ChartType;
+ /** Inputs for the custom bar type. */
+ inputs?: ChartTypeInputs;
+ /** Starts replay mode at this Unix time (seconds). */
+ replay?: number;
+}
+
+/** `series_completed` details. */
+export interface SeriesCompletedInfo {
+ /** `streaming` for live data, `replay` in replay mode. */
+ status: 'streaming' | 'replay' | (string & {});
+ /**
+ * Set when no more history can be loaded: `end` (start of history) or
+ * `limit` (account limit).
+ */
+ dataCompleted?: 'end' | 'limit' | (string & {});
+ /** Request turnaround ID (`s1`, `s2`...). */
+ turnaround: string;
+ raw: unknown;
+}
+
+export interface ChartEvents {
+ [event: string]: unknown[];
+ /** Symbol metadata was resolved. */
+ symbolLoaded: [info: SymbolInfo];
+ /** Bars or studies changed. `changes` lists `$prices` and/or study IDs. */
+ update: [changes: string[]];
+ /** The server started loading bars. */
+ seriesLoading: [];
+ /** The requested bars were loaded. Realtime updates continue afterwards. */
+ seriesCompleted: [info: SeriesCompletedInfo];
+ /** The replay session is ready. */
+ replayLoaded: [instanceId: string];
+ /** The replay cursor moved (Unix seconds). */
+ replayPoint: [time: number];
+ /** Resolutions reported by the replay server. */
+ replayResolution: [resolution: string, stepResolution: string];
+ /** The replay reached the present. */
+ replayEnd: [];
+ error: [error: TradingViewError];
+}
+
+interface PendingRequest {
+ resolve: () => void;
+ reject: (error: TradingViewError) => void;
+}
+
+/**
+ * A chart: one symbol series plus any number of studies, with optional
+ * replay mode. Create it with `client.createChart()`.
+ */
+export class ChartSession extends Emitter<ChartEvents> {
+ readonly id = createSessionId('cs');
+
+ readonly replayId = createSessionId('rs');
+
+ readonly client: TradingViewClient;
+
+ readonly #candles = new Map<number, Candle>();
+
+ /** Bar index (`i`) → bar time, used to position study graphics. */
+ readonly #barIndexes = new Map<number, number>();
+
+ readonly #studies = new Map<string, Study>();
+
+ readonly #replayRequests = new Map<string, PendingRequest>();
+
+ #symbolInfo?: SymbolInfo;
+
+ #seriesCount = 0;
+
+ #seriesCreated = false;
+
+ #turnaround = 0;
+
+ #timeframe: Timeframe = 'D';
+
+ #replayMode = false;
+
+ #deleted = false;
+
+ constructor(client: TradingViewClient) {
+ super();
+ this.client = client;
+ const chartHandler: SessionHandler = {
+ onPacket: (packet) => this.#onChartPacket(packet),
+ onClose: (error, expected) => this.#onClientClose(error, expected),
+ };
+ client.registerSession(this.id, chartHandler);
+ client.registerSession(this.replayId, { onPacket: (packet) => this.#onReplayPacket(packet) });
+ client.send('chart_create_session', [this.id]);
+ }
+
+ /** Loaded bars, oldest first. */
+ get candles(): Candle[] {
+ return [...this.#candles.values()].sort((a, b) => a.time - b.time);
+ }
+
+ /** Most recent bar. */
+ get lastCandle(): Candle | undefined {
+ let last: Candle | undefined;
+ for (const candle of this.#candles.values()) if (!last || candle.time > last.time) last = candle;
+ return last;
+ }
+
+ /** Symbol metadata, once resolved. */
+ get symbolInfo(): SymbolInfo | undefined {
+ return this.#symbolInfo;
+ }
+
+ /** Current timeframe. */
+ get timeframe(): Timeframe {
+ return this.#timeframe;
+ }
+
+ /** Current series ID (`ser_1`, `ser_2`...), or undefined before `setMarket`. */
+ get seriesId(): string | undefined {
+ return this.#seriesCount ? `ser_${this.#seriesCount}` : undefined;
+ }
+
+ /** True when the chart is in replay mode. */
+ get isReplay(): boolean {
+ return this.#replayMode;
+ }
+
+ /** True after `delete()` or when the connection closed. */
+ get isDeleted(): boolean {
+ return this.#deleted;
+ }
+
+ /** Studies currently on this chart. */
+ get studies(): Study[] {
+ return [...this.#studies.values()];
+ }
+
+ /** Loads a symbol, optionally with a custom bar type or in replay mode. */
+ setMarket(symbol: string, options: MarketOptions = {}): void {
+ this.#assertAlive();
+ if (!symbol) throw new TradingViewError('INVALID_ARGUMENT', 'A symbol is required');
+ this.#candles.clear();
+ this.#barIndexes.clear();
+ this.#symbolInfo = undefined;
+ const timeframe = options.timeframe ?? 'D';
+
+ if (this.#replayMode) {
+ this.#replayMode = false;
+ this.#rejectReplayRequests(new TradingViewError('INVALID_STATE', 'Replay session replaced'));
+ this.client.send('replay_delete_session', [this.replayId]);
+ }
+
+ const symbolInit: Record<string, unknown> = {
+ symbol,
+ adjustment: options.adjustment ?? 'splits',
+ };
+ if (options.backAdjustment) symbolInit.backadjustment = 'default';
+ if (options.session) symbolInit.session = options.session;
+ if (options.currency) symbolInit['currency-id'] = options.currency;
+
+ if (options.replay !== undefined) {
+ this.#replayMode = true;
+ this.client.send('replay_create_session', [this.replayId]);
+ this.client.send('replay_add_series', [
+ this.replayId, 'req_replay_addseries', `=${JSON.stringify(symbolInit)}`, timeframe,
+ ]);
+ this.client.send('replay_reset', [this.replayId, 'req_replay_reset', options.replay]);
+ }
+
+ let chartInit: Record<string, unknown> = symbolInit;
+ if (options.type || options.replay !== undefined) {
+ chartInit = { symbol: symbolInit };
+ if (options.replay !== undefined) chartInit.replay = this.replayId;
+ if (options.type) {
+ const study = CHART_TYPE_STUDIES[options.type];
+ if (!study) throw new TradingViewError('INVALID_ARGUMENT', `Unknown chart type '${options.type}'`);
+ chartInit.type = study;
+ chartInit.inputs = { ...options.inputs };
+ }
+ }
+
+ this.#seriesCount += 1;
+ this.client.send('resolve_symbol', [this.id, `ser_${this.#seriesCount}`, `=${JSON.stringify(chartInit)}`]);
+ this.#sendSeries(timeframe, options.count ?? 100, options.to);
+ }
+
+ /** Changes the timeframe of the loaded symbol, keeping studies. */
+ setTimeframe(timeframe: Timeframe): void {
+ this.#assertAlive();
+ if (!this.#seriesCount) {
+ throw new TradingViewError('INVALID_STATE', 'Please set the market before setting the timeframe');
+ }
+ this.#candles.clear();
+ this.#barIndexes.clear();
+ this.#sendSeries(timeframe, 100);
+ }
+
+ #sendSeries(timeframe: Timeframe, count: number, to?: number): void {
+ this.#timeframe = timeframe;
+ this.#turnaround += 1;
+ const range = to === undefined ? count : ['bar_count', to, count];
+ this.client.send(this.#seriesCreated ? 'modify_series' : 'create_series', [
+ this.id, '$prices', `s${this.#turnaround}`, `ser_${this.#seriesCount}`, timeframe,
+ // modify_series only accepts an empty range: the bar count is kept.
+ this.#seriesCreated ? '' : range,
+ ]);
+ this.#seriesCreated = true;
+ }
+
+ /** Changes the chart timezone. */
+ setTimezone(timezone: Timezone): void {
+ this.#assertAlive();
+ this.client.send('switch_timezone', [this.id, timezone]);
+ }
+
+ /**
+ * Loads more history. Positive values load older bars; negative values
+ * load newer bars after a past `to` reference.
+ */
+ fetchMore(count = 1): void {
+ this.#assertAlive();
+ this.client.send('request_more_data', [this.id, '$prices', count]);
+ }
+
+ /** Moves the replay forward by `count` bars. */
+ replayStep(count = 1): Promise<void> {
+ return this.#replayRequest('replay_step', 'rsq_step', [count]);
+ }
+
+ /** Plays the replay automatically, one bar every `intervalMs`. */
+ replayStart(intervalMs = 1000): Promise<void> {
+ return this.#replayRequest('replay_start', 'rsq_start', [intervalMs]);
+ }
+
+ /** Pauses automatic replay. */
+ replayStop(): Promise<void> {
+ return this.#replayRequest('replay_stop', 'rsq_stop', []);
+ }
+
+ #replayRequest(method: string, prefix: string, params: unknown[]): Promise<void> {
+ if (this.#deleted) return Promise.reject(new TradingViewError('INVALID_STATE', 'The chart is deleted'));
+ if (!this.#replayMode) {
+ return Promise.reject(new TradingViewError('INVALID_STATE', 'No replay session: use setMarket(symbol, { replay })'));
+ }
+ const requestId = createSessionId(prefix);
+ return new Promise<void>((resolve, reject) => {
+ this.#replayRequests.set(requestId, { resolve, reject });
+ this.client.send(method, [this.replayId, requestId, ...params]);
+ });
+ }
+
+ /** Adds a study (Pine or built-in indicator) to this chart. */
+ createStudy(indicator: Indicator): Study {
+ this.#assertAlive();
+ const bridge: StudyBridge = {
+ chartId: this.id,
+ send: (method, params) => this.client.send(method, params),
+ barsBack: () => this.#barsBack(),
+ log: (...args) => this.client.log(...args),
+ unregister: (id) => { this.#studies.delete(id); },
+ };
+ const study = new Study(bridge, indicator);
+ this.#studies.set(study.id, study);
+ study.create();
+ return study;
+ }
+
+ /** Deletes the chart (and its replay session). Idempotent. */
+ delete(): void {
+ if (this.#deleted) return;
+ if (!this.client.isClosed) {
+ if (this.#replayMode) this.client.send('replay_delete_session', [this.replayId]);
+ this.client.send('chart_delete_session', [this.id]);
+ }
+ this.#dispose(new TradingViewError('INVALID_STATE', 'The chart was deleted'));
+ }
+
+ #dispose(error: TradingViewError, notify = false): void {
+ this.#deleted = true;
+ this.#replayMode = false;
+ this.client.unregisterSession(this.id);
+ this.client.unregisterSession(this.replayId);
+ this.#rejectReplayRequests(error);
+ for (const study of this.#studies.values()) study.dispose(notify ? error : undefined);
+ this.#studies.clear();
+ }
+
+ #onClientClose(error: TradingViewError, expected: boolean): void {
+ if (this.#deleted) return;
+ this.#dispose(error, !expected);
+ if (!expected) this.emit('error', error);
+ }
+
+ #assertAlive(): void {
+ if (this.#deleted) throw new TradingViewError('INVALID_STATE', 'The chart is deleted');
+ }
+
+ #rejectReplayRequests(error: TradingViewError): void {
+ for (const request of this.#replayRequests.values()) request.reject(error);
+ this.#replayRequests.clear();
+ }
+
+ /** Bar index → bars back from the most recent loaded bar. */
+ #barsBack(): Map<number, number> {
+ const result = new Map<number, number>();
+ [...this.#barIndexes.entries()]
+ .sort((a, b) => b[1] - a[1])
+ .forEach(([index], position) => result.set(index, position));
+ return result;
+ }
+
+ #onChartPacket(packet: ServerPacket): void {
+ this.client.log('chart', this.id, packet);
+ const [, target] = packet.p;
+
+ if (typeof target === 'string' && this.#studies.has(target)) {
+ this.#studies.get(target)?.onPacket(packet);
+ return;
+ }
+
+ switch (packet.m) {
+ case 'symbol_resolved':
+ this.#symbolInfo = { series_id: target as string, ...(packet.p[2] as object) } as SymbolInfo;
+ this.emit('symbolLoaded', this.#symbolInfo);
+ return;
+
+ case 'timescale_update':
+ case 'du': {
+ const data = (packet.p[1] ?? {}) as Record<string, any>;
+ const changes: string[] = [];
+ for (const key of Object.keys(data)) {
+ changes.push(key);
+ if (key === '$prices') this.#updateCandles(data.$prices);
+ else this.#studies.get(key)?.onData(data[key]);
+ }
+ this.emit('update', changes);
+ return;
+ }
+
+ case 'series_loading':
+ this.emit('seriesLoading');
+ return;
+
+ case 'series_completed': {
+ const details = (packet.p[4] ?? {}) as Record<string, unknown>;
+ this.emit('seriesCompleted', {
+ status: String(packet.p[2] ?? ''),
+ dataCompleted: details.data_completed as string | undefined,
+ turnaround: String(packet.p[3] ?? ''),
+ raw: packet.p,
+ });
+ return;
+ }
+
+ case 'symbol_error':
+ this.emit('error', new TradingViewError('SYMBOL_ERROR', `(${String(target)}) Symbol error: ${String(packet.p[2])}`, {
+ details: packet.p,
+ }));
+ return;
+
+ case 'series_error':
+ this.emit('error', new TradingViewError('SERIES_ERROR', `Series error: ${String(packet.p[3])}`, {
+ details: packet.p,
+ }));
+ return;
+
+ case 'critical_error':
+ this.emit('error', new TradingViewError('CRITICAL_ERROR', `Critical error: ${String(packet.p[1])}`, {
+ details: packet.p,
+ }));
+ return;
+
+ default:
+ }
+ }
+
+ #updateCandles(prices: any): void {
+ for (const bar of prices?.s ?? []) {
+ const [time, open, high, low, close, volume] = bar.v as number[];
+ this.#barIndexes.set(bar.i, time);
+ this.#candles.set(time, {
+ time, open, high, low, close, volume: volume ?? 0,
+ });
+ }
+ }
+
+ #onReplayPacket(packet: ServerPacket): void {
+ this.client.log('replay', this.replayId, packet);
+ switch (packet.m) {
+ case 'replay_ok': {
+ const requestId = String(packet.p[1]);
+ this.#replayRequests.get(requestId)?.resolve();
+ this.#replayRequests.delete(requestId);
+ return;
+ }
+ case 'replay_instance_id':
+ this.emit('replayLoaded', String(packet.p[1]));
+ return;
+ case 'replay_point':
+ this.emit('replayPoint', Number(packet.p[1]));
+ return;
+ case 'replay_resolutions':
+ this.emit('replayResolution', String(packet.p[1]), String(packet.p[2]));
+ return;
+ case 'replay_data_end':
+ this.emit('replayEnd');
+ return;
+ case 'critical_error':
+ case 'replay_error': {
+ const error = new TradingViewError('CRITICAL_ERROR', `Replay error: ${String(packet.p[1])}`, {
+ details: packet.p,
+ });
+ this.#rejectReplayRequests(error);
+ this.emit('error', error);
+ return;
+ }
+ default:
+ }
+ }
+}
diff --git a/src/chart/graphicParser.js b/src/chart/graphicParser.js
deleted file mode 100644
index 5235dbf..0000000
--- a/src/chart/graphicParser.js
+++ /dev/null
@@ -1,310 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const TRANSLATOR = {
- /** @typedef {'right' | 'left' | 'both' | 'none'} ExtendValue */
- extend: {
- r: 'right',
- l: 'left',
- b: 'both',
- n: 'none',
- },
-
- /** @typedef {'price' | 'abovebar' | 'belowbar'} yLocValue */
- yLoc: {
- pr: 'price',
- ab: 'abovebar',
- bl: 'belowbar',
- },
-
- /**
- * @typedef {'none' | 'xcross' | 'cross' | 'triangleup'
- * | 'triangledown' | 'flag' | 'circle' | 'arrowup'
- * | 'arrowdown' | 'label_up' | 'label_down' | 'label_left'
- * | 'label_right' | 'label_lower_left' | 'label_lower_right'
- * | 'label_upper_left' | 'label_upper_right' | 'label_center'
- * | 'square' | 'diamond'
- * } LabelStyleValue
- * */
- labelStyle: {
- n: 'none',
- xcr: 'xcross',
- cr: 'cross',
- tup: 'triangleup',
- tdn: 'triangledown',
- flg: 'flag',
- cir: 'circle',
- aup: 'arrowup',
- adn: 'arrowdown',
- lup: 'label_up',
- ldn: 'label_down',
- llf: 'label_left',
- lrg: 'label_right',
- llwlf: 'label_lower_left',
- llwrg: 'label_lower_right',
- luplf: 'label_upper_left',
- luprg: 'label_upper_right',
- lcn: 'label_center',
- sq: 'square',
- dia: 'diamond',
- },
-
- /**
- * @typedef {'solid' | 'dotted' | 'dashed'| 'arrow_left'
- * | 'arrow_right' | 'arrow_both'} LineStyleValue
- */
- lineStyle: {
- sol: 'solid',
- dot: 'dotted',
- dsh: 'dashed',
- al: 'arrow_left',
- ar: 'arrow_right',
- ab: 'arrow_both',
- },
-
- /** @typedef {'solid' | 'dotted' | 'dashed'} BoxStyleValue */
- boxStyle: {
- sol: 'solid',
- dot: 'dotted',
- dsh: 'dashed',
- },
-};
-
-/**
- * @typedef {'auto' | 'huge' | 'large'
- * | 'normal' | 'small' | 'tiny'} SizeValue
- */
-/** @typedef {'top' | 'center' | 'bottom'} VAlignValue */
-/** @typedef {'left' | 'center' | 'right'} HAlignValue */
-/** @typedef {'none' | 'auto'} TextWrapValue */
-/**
- * @typedef {'top_left' | 'top_center' | 'top_right'
- * | 'middle_left' | 'middle_center' | 'middle_right'
- * | 'bottom_left' | 'bottom_center' | 'bottom_right'
- * } TablePositionValue
- */
-
-/**
- * @typedef {Object} GraphicLabel
- * @prop {number} id Drawing ID
- * @prop {number} x Label x position
- * @prop {number} y Label y position
- * @prop {yLocValue} yLoc yLoc mode
- * @prop {string} text Label text
- * @prop {LabelStyleValue} style Label style
- * @prop {number} color
- * @prop {number} textColor
- * @prop {SizeValue} size Label size
- * @prop {HAlignValue} textAlign Text horizontal align
- * @prop {string} toolTip Tooltip text
- */
-
-/**
- * @typedef {Object} GraphicLine
- * @prop {number} id Drawing ID
- * @prop {number} x1 First x position
- * @prop {number} y1 First y position
- * @prop {number} x2 Second x position
- * @prop {number} y2 Second y position
- * @prop {ExtendValue} extend Horizontal extend
- * @prop {LineStyleValue} style Line style
- * @prop {number} color Line color
- * @prop {number} width Line width
- */
-
-/**
- * @typedef {Object} GraphicBox
- * @prop {number} id Drawing ID
- * @prop {number} x1 First x position
- * @prop {number} y1 First y position
- * @prop {number} x2 Second x position
- * @prop {number} y2 Second y position
- * @prop {number} color Box color
- * @prop {number} bgColor Background color
- * @prop {ExtendValue} extend Horizontal extend
- * @prop {BoxStyleValue} style Box style
- * @prop {number} width Box width
- * @prop {string} text Text
- * @prop {SizeValue} textSize Text size
- * @prop {number} textColor Text color
- * @prop {VAlignValue} textVAlign Text vertical align
- * @prop {HAlignValue} textHAlign Text horizontal align
- * @prop {TextWrapValue} textWrap Text wrap
- */
-
-/**
- * @typedef {Object} TableCell
- * @prop {number} id Drawing ID
- * @prop {string} text Cell text
- * @prop {number} width Cell width
- * @prop {number} height Cell height
- * @prop {number} textColor Text color
- * @prop {HAlignValue} textHAlign Text horizontal align
- * @prop {VAlignValue} textVAlign Text Vertical align
- * @prop {SizeValue} textSize Text size
- * @prop {number} bgColor Background color
- */
-
-/**
- * @typedef {Object} GraphicTable
- * @prop {number} id Drawing ID
- * @prop {TablePositionValue} position Table position
- * @prop {number} rows Number of rows
- * @prop {number} columns Number of columns
- * @prop {number} bgColor Background color
- * @prop {number} frameColor Frame color
- * @prop {number} frameWidth Frame width
- * @prop {number} borderColor Border color
- * @prop {number} borderWidth Border width
- * @prop {() => TableCell[][]} cells Table cells matrix
- */
-
-/**
- * @typedef {Object} GraphicHorizline
- * @prop {number} id Drawing ID
- * @prop {number} level Y position of the line
- * @prop {number} startIndex Start index of the line (`chart.periods[line.startIndex]`)
- * @prop {number} endIndex End index of the line (`chart.periods[line.endIndex]`)
- * @prop {boolean} extendRight Is the line extended to the right
- * @prop {boolean} extendLeft Is the line extended to the left
- */
-
-/**
- * @typedef {Object} GraphicPoint
- * @prop {number} index X position of the point
- * @prop {number} level Y position of the point
- */
-
-/**
- * @typedef {Object} GraphicPolygon
- * @prop {number} id Drawing ID
- * @prop {GraphicPoint[]} points List of polygon points
- */
-
-/**
- * @typedef {Object} GraphicHorizHist
- * @prop {number} id Drawing ID
- * @prop {number} priceLow Low Y position
- * @prop {number} priceHigh High Y position
- * @prop {number} firstBarTime First X position
- * @prop {number} lastBarTime Last X position
- * @prop {number[]} rate List of values
- */
-
-/**
- * @typedef {Object} GraphicData List of drawings indexed by type
- * @prop {GraphicLabel[]} labels List of labels drawings
- * @prop {GraphicLine[]} lines List of lines drawings
- * @prop {GraphicBox[]} boxes List of boxes drawings
- * @prop {GraphicTable[]} tables List of tables drawings
- * @prop {GraphicPolygon[]} polygons List of polygons drawings
- * @prop {GraphicHorizHist[]} horizHists List of horizontal histograms drawings
- * @prop {GraphicHorizline[]} horizLines List of horizontal lines drawings
- */
-
-/**
- * @param {Object} rawGraphic Raw graphic data
- * @param {Object} indexes Drawings xPos indexes
- * @returns {GraphicData}
- */
-module.exports = function graphicParse(rawGraphic = {}, indexes = []) {
- // console.log('indexes', indexes);
- return {
- labels: Object.values(rawGraphic.dwglabels ?? {}).map((l) => ({
- id: l.id,
- x: indexes[l.x],
- y: l.y,
- yLoc: TRANSLATOR.yLoc[l.yl] ?? l.yl,
- text: l.t,
- style: TRANSLATOR.labelStyle[l.st] ?? l.st,
- color: l.ci,
- textColor: l.tci,
- size: l.sz,
- textAlign: l.ta,
- toolTip: l.tt,
- })),
-
- lines: Object.values(rawGraphic.dwglines ?? {}).map((l) => ({
- id: l.id,
- x1: indexes[l.x1],
- y1: l.y1,
- x2: indexes[l.x2],
- y2: l.y2,
- extend: TRANSLATOR.extend[l.ex] ?? l.ex,
- style: TRANSLATOR.lineStyle[l.st] ?? l.st,
- color: l.ci,
- width: l.w,
- })),
-
- boxes: Object.values(rawGraphic.dwgboxes ?? {}).map((b) => ({
- id: b.id,
- x1: indexes[b.x1],
- y1: b.y1,
- x2: indexes[b.x2],
- y2: b.y2,
- color: b.c,
- bgColor: b.bc,
- extend: TRANSLATOR.extend[b.ex] ?? b.ex,
- style: TRANSLATOR.boxStyle[b.st] ?? b.st,
- width: b.w,
- text: b.t,
- textSize: b.ts,
- textColor: b.tc,
- textVAlign: b.tva,
- textHAlign: b.tha,
- textWrap: b.tw,
- })),
-
- tables: Object.values(rawGraphic.dwgtables ?? {}).map((t) => ({
- id: t.id,
- position: t.pos,
- rows: t.rows,
- columns: t.cols,
- bgColor: t.bgc,
- frameColor: t.frmc,
- frameWidth: t.frmw,
- borderColor: t.brdc,
- borderWidth: t.brdw,
- cells: () => {
- const matrix = [];
- Object.values(rawGraphic.dwgtablecells ?? {}).forEach((cell) => {
- if (cell.tid !== t.id) return;
- if (!matrix[cell.row]) matrix[cell.row] = [];
- matrix[cell.row][cell.col] = {
- id: cell.id,
- text: cell.t,
- width: cell.w,
- height: cell.h,
- textColor: cell.tc,
- textHAlign: cell.tha,
- textVAlign: cell.tva,
- textSize: cell.ts,
- bgColor: cell.bgc,
- };
- });
- return matrix;
- },
- })),
-
- horizLines: Object.values(rawGraphic.horizlines ?? {}).map((h) => ({
- ...h,
- startIndex: indexes[h.startIndex],
- endIndex: indexes[h.endIndex],
- })),
-
- polygons: Object.values(rawGraphic.polygons ?? {}).map((p) => ({
- ...p,
- points: p.points.map((pt) => ({
- ...pt,
- index: indexes[pt.index],
- })),
- })),
-
- horizHists: Object.values(rawGraphic.hhists ?? {}).map((h) => ({
- ...h,
- firstBarTime: indexes[h.firstBarTime],
- lastBarTime: indexes[h.lastBarTime],
- })),
-
- raw: () => rawGraphic,
- };
-};
diff --git a/src/chart/graphics.ts b/src/chart/graphics.ts
new file mode 100644
index 0000000..071f890
--- /dev/null
+++ b/src/chart/graphics.ts
@@ -0,0 +1,299 @@
+/** Raw graphics as sent by TradingView, indexed by type then drawing ID. */
+export type RawGraphics = Record<string, Record<string, any>>;
+
+export type ExtendValue = 'right' | 'left' | 'both' | 'none';
+export type YLocValue = 'price' | 'abovebar' | 'belowbar';
+export type LabelStyleValue =
+ | 'none' | 'xcross' | 'cross' | 'triangleup' | 'triangledown' | 'flag' | 'circle'
+ | 'arrowup' | 'arrowdown' | 'label_up' | 'label_down' | 'label_left' | 'label_right'
+ | 'label_lower_left' | 'label_lower_right' | 'label_upper_left' | 'label_upper_right'
+ | 'label_center' | 'square' | 'diamond';
+export type LineStyleValue = 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';
+export type BoxStyleValue = 'solid' | 'dotted' | 'dashed';
+export type SizeValue = 'auto' | 'huge' | 'large' | 'normal' | 'small' | 'tiny';
+export type VAlignValue = 'top' | 'center' | 'bottom';
+export type HAlignValue = 'left' | 'center' | 'right';
+export type TextWrapValue = 'none' | 'auto';
+export type TablePositionValue =
+ | 'top_left' | 'top_center' | 'top_right'
+ | 'middle_left' | 'middle_center' | 'middle_right'
+ | 'bottom_left' | 'bottom_center' | 'bottom_right';
+
+const TRANSLATOR = {
+ extend: {
+ r: 'right', l: 'left', b: 'both', n: 'none',
+ } as Record<string, ExtendValue>,
+ yLoc: { pr: 'price', ab: 'abovebar', bl: 'belowbar' } as Record<string, YLocValue>,
+ labelStyle: {
+ n: 'none',
+ xcr: 'xcross',
+ cr: 'cross',
+ tup: 'triangleup',
+ tdn: 'triangledown',
+ flg: 'flag',
+ cir: 'circle',
+ aup: 'arrowup',
+ adn: 'arrowdown',
+ lup: 'label_up',
+ ldn: 'label_down',
+ llf: 'label_left',
+ lrg: 'label_right',
+ llwlf: 'label_lower_left',
+ llwrg: 'label_lower_right',
+ luplf: 'label_upper_left',
+ luprg: 'label_upper_right',
+ lcn: 'label_center',
+ sq: 'square',
+ dia: 'diamond',
+ } as Record<string, LabelStyleValue>,
+ lineStyle: {
+ sol: 'solid', dot: 'dotted', dsh: 'dashed', al: 'arrow_left', ar: 'arrow_right', ab: 'arrow_both',
+ } as Record<string, LineStyleValue>,
+ boxStyle: { sol: 'solid', dot: 'dotted', dsh: 'dashed' } as Record<string, BoxStyleValue>,
+};
+
+/**
+ * X positions are expressed in bars back from the most recent bar loaded on
+ * the chart (0 = latest bar). They are `undefined` when the bar is not loaded.
+ */
+export interface GraphicLabel {
+ id: number;
+ x: number | undefined;
+ y: number;
+ yLoc: YLocValue;
+ text: string;
+ style: LabelStyleValue;
+ color: number;
+ textColor: number;
+ size: SizeValue;
+ textAlign: HAlignValue;
+ toolTip: string;
+}
+
+export interface GraphicLine {
+ id: number;
+ x1: number | undefined;
+ y1: number;
+ x2: number | undefined;
+ y2: number;
+ extend: ExtendValue;
+ style: LineStyleValue;
+ color: number;
+ width: number;
+}
+
+export interface GraphicBox {
+ id: number;
+ x1: number | undefined;
+ y1: number;
+ x2: number | undefined;
+ y2: number;
+ color: number;
+ bgColor: number;
+ extend: ExtendValue;
+ style: BoxStyleValue;
+ width: number;
+ text: string;
+ textSize: SizeValue;
+ textColor: number;
+ textVAlign: VAlignValue;
+ textHAlign: HAlignValue;
+ textWrap: TextWrapValue;
+}
+
+export interface TableCell {
+ id: number;
+ text: string;
+ width: number;
+ height: number;
+ textColor: number;
+ textHAlign: HAlignValue;
+ textVAlign: VAlignValue;
+ textSize: SizeValue;
+ bgColor: number;
+}
+
+export interface GraphicTable {
+ id: number;
+ position: TablePositionValue;
+ rows: number;
+ columns: number;
+ bgColor: number;
+ frameColor: number;
+ frameWidth: number;
+ borderColor: number;
+ borderWidth: number;
+ /** Cells as a `[row][column]` matrix. */
+ cells: TableCell[][];
+}
+
+export interface GraphicHorizLine {
+ id: number;
+ level: number;
+ startIndex: number | undefined;
+ endIndex: number | undefined;
+ extendRight: boolean;
+ extendLeft: boolean;
+ [key: string]: unknown;
+}
+
+export interface GraphicPoint {
+ index: number | undefined;
+ level: number;
+ [key: string]: unknown;
+}
+
+export interface GraphicPolygon {
+ id: number;
+ points: GraphicPoint[];
+ [key: string]: unknown;
+}
+
+export interface GraphicHorizHist {
+ id: number;
+ priceLow: number;
+ priceHigh: number;
+ firstBarTime: number | undefined;
+ lastBarTime: number | undefined;
+ rate: number[];
+ [key: string]: unknown;
+}
+
+/** Drawings produced by an indicator, grouped by type. */
+export interface GraphicsData {
+ labels: GraphicLabel[];
+ lines: GraphicLine[];
+ boxes: GraphicBox[];
+ tables: GraphicTable[];
+ polygons: GraphicPolygon[];
+ horizLines: GraphicHorizLine[];
+ horizHists: GraphicHorizHist[];
+ /** Unparsed graphics, including types this parser does not know. */
+ raw: RawGraphics;
+}
+
+/**
+ * Converts raw indicator graphics into readable objects.
+ * @param indexes Maps graphic X indexes to "bars back" positions.
+ */
+export function parseGraphics(raw: RawGraphics = {}, indexes: ReadonlyArray<number | undefined> = []): GraphicsData {
+ const values = (type: string) => Object.values(raw[type] ?? {});
+ const x = (index: number) => indexes[index];
+
+ return {
+ labels: values('dwglabels').map((l) => ({
+ id: l.id,
+ x: x(l.x),
+ y: l.y,
+ yLoc: TRANSLATOR.yLoc[l.yl] ?? l.yl,
+ text: l.t,
+ style: TRANSLATOR.labelStyle[l.st] ?? l.st,
+ color: l.ci,
+ textColor: l.tci,
+ size: l.sz,
+ textAlign: l.ta,
+ toolTip: l.tt,
+ })),
+
+ lines: values('dwglines').map((l) => ({
+ id: l.id,
+ x1: x(l.x1),
+ y1: l.y1,
+ x2: x(l.x2),
+ y2: l.y2,
+ extend: TRANSLATOR.extend[l.ex] ?? l.ex,
+ style: TRANSLATOR.lineStyle[l.st] ?? l.st,
+ color: l.ci,
+ width: l.w,
+ })),
+
+ boxes: values('dwgboxes').map((b) => ({
+ id: b.id,
+ x1: x(b.x1),
+ y1: b.y1,
+ x2: x(b.x2),
+ y2: b.y2,
+ color: b.c,
+ bgColor: b.bc,
+ extend: TRANSLATOR.extend[b.ex] ?? b.ex,
+ style: TRANSLATOR.boxStyle[b.st] ?? b.st,
+ width: b.w,
+ text: b.t,
+ textSize: b.ts,
+ textColor: b.tc,
+ textVAlign: b.tva,
+ textHAlign: b.tha,
+ textWrap: b.tw,
+ })),
+
+ tables: values('dwgtables').map((t) => {
+ const cells: TableCell[][] = [];
+ for (const cell of values('dwgtablecells')) {
+ if (cell.tid !== t.id) continue;
+ cells[cell.row] ??= [];
+ cells[cell.row][cell.col] = {
+ id: cell.id,
+ text: cell.t,
+ width: cell.w,
+ height: cell.h,
+ textColor: cell.tc,
+ textHAlign: cell.tha,
+ textVAlign: cell.tva,
+ textSize: cell.ts,
+ bgColor: cell.bgc,
+ };
+ }
+ return {
+ id: t.id,
+ position: t.pos,
+ rows: t.rows,
+ columns: t.cols,
+ bgColor: t.bgc,
+ frameColor: t.frmc,
+ frameWidth: t.frmw,
+ borderColor: t.brdc,
+ borderWidth: t.brdw,
+ cells,
+ };
+ }),
+
+ horizLines: values('horizlines').map((h) => ({
+ ...h,
+ startIndex: x(h.startIndex),
+ endIndex: x(h.endIndex),
+ })),
+
+ polygons: values('polygons').map((p) => ({
+ ...p,
+ points: (p.points ?? []).map((point: any) => ({ ...point, index: x(point.index) })),
+ })),
+
+ horizHists: values('hhists').map((h) => ({
+ ...h,
+ firstBarTime: x(h.firstBarTime),
+ lastBarTime: x(h.lastBarTime),
+ })),
+
+ raw,
+ };
+}
+
+/** Applies `graphicsCmds` (erase then create) to raw graphics in place. */
+export function applyGraphicsCommands(graphics: RawGraphics, commands: any): void {
+ for (const instruction of commands?.erase ?? []) {
+ if (instruction.action === 'all') {
+ if (!instruction.type) {
+ for (const type of Object.keys(graphics)) graphics[type] = {};
+ } else delete graphics[instruction.type];
+ } else if (instruction.action === 'one' && instruction.type) {
+ delete graphics[instruction.type]?.[instruction.id];
+ }
+ }
+
+ for (const [type, groups] of Object.entries<any[]>(commands?.create ?? {})) {
+ graphics[type] ??= {};
+ for (const group of groups ?? []) {
+ for (const item of group.data ?? []) graphics[type][item.id] = item;
+ }
+ }
+}
diff --git a/src/chart/index.ts b/src/chart/index.ts
new file mode 100644
index 0000000..b8c58ad
--- /dev/null
+++ b/src/chart/index.ts
@@ -0,0 +1,24 @@
+export { ChartSession } from './chart-session.js';
+export type {
+ ChartEvents, MarketOptions, SeriesCompletedInfo,
+} from './chart-session.js';
+export { Study } from './study.js';
+export type { StudyChange, StudyEvents, StudyValue } from './study.js';
+export {
+ applyGraphicsCommands, parseGraphics,
+} from './graphics.js';
+export type {
+ BoxStyleValue, ExtendValue, GraphicBox, GraphicHorizHist, GraphicHorizLine, GraphicLabel, GraphicLine,
+ GraphicPoint, GraphicPolygon, GraphicTable, GraphicsData, HAlignValue, LabelStyleValue, LineStyleValue,
+ RawGraphics, SizeValue, TableCell, TablePositionValue, TextWrapValue, VAlignValue, YLocValue,
+} from './graphics.js';
+export { mergeStrategyReport, parseTrades } from './strategy.js';
+export type {
+ FromTo, PerformanceReport, RelAbsValue, StrategyReport, StrategyReportChange, TradeReport,
+} from './strategy.js';
+export { timeframeSeconds } from './timeframes.js';
+export { CHART_TYPE_STUDIES } from './types.js';
+export type {
+ Adjustment, Candle, ChartType, ChartTypeInputs, MarketSymbol, Subsession, SymbolInfo,
+ Timeframe, Timezone, TradingSession,
+} from './types.js';
diff --git a/src/chart/session.js b/src/chart/session.js
deleted file mode 100644
index 7bb772c..0000000
--- a/src/chart/session.js
+++ /dev/null
@@ -1,555 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const { genSessionID } = require('../utils');
-
-const studyConstructor = require('./study');
-
-/**
- * @typedef {'HeikinAshi' | 'Renko' | 'LineBreak' | 'Kagi' | 'PointAndFigure'
- * | 'Range'} ChartType Custom chart type
- */
-
-const ChartTypes = {
- HeikinAshi: 'BarSetHeikenAshi@tv-basicstudies-60!',
- Renko: 'BarSetRenko@tv-prostudies-40!',
- LineBreak: 'BarSetPriceBreak@tv-prostudies-34!',
- Kagi: 'BarSetKagi@tv-prostudies-34!',
- PointAndFigure: 'BarSetPnF@tv-prostudies-34!',
- Range: 'BarSetRange@tv-basicstudies-72!',
-};
-
-/**
- * @typedef {Object} ChartInputs Custom chart type
- * @prop {number} [atrLength] Renko/Kagi/PointAndFigure ATR length
- * @prop {'open' | 'high' | 'low' | 'close' | 'hl2'
- * | 'hlc3' | 'ohlc4'} [source] Renko/LineBreak/Kagi source
- * @prop {'ATR' | string} [style] Renko/Kagi/PointAndFigure style
- * @prop {number} [boxSize] Renko/PointAndFigure box size
- * @prop {number} [reversalAmount] Kagi/PointAndFigure reversal amount
- * @prop {'Close'} [sources] Renko/PointAndFigure sources
- * @prop {boolean} [wicks] Renko wicks
- * @prop {number} [lb] LineBreak Line break
- * @prop {boolean} [oneStepBackBuilding] PointAndFigure oneStepBackBuilding
- * @prop {boolean} [phantomBars] Range phantom bars
- * @prop {number} [range] Range range
- */
-
-/** @typedef {Object<string, Function[]>} StudyListeners */
-
-/**
- * @typedef {Object} ChartSessionBridge
- * @prop {string} sessionID
- * @prop {StudyListeners} studyListeners
- * @prop {Object<number, number>} indexes
- * @prop {import('../client').SendPacket} send
-*/
-
-/**
- * @typedef {'seriesLoaded' | 'symbolLoaded' | 'update' | 'error'} ChartEvent
- */
-
-/**
- * @typedef {Object} PricePeriod
- * @prop {number} time Period timestamp
- * @prop {number} open Period open value
- * @prop {number} close Period close value
- * @prop {number} max Period max value
- * @prop {number} min Period min value
- * @prop {number} volume Period volume value
- */
-
-/**
- * @typedef {Object} Subsession
- * @prop {string} id Subsession ID (ex: 'regular')
- * @prop {string} description Subsession description (ex: 'Regular')
- * @prop {boolean} private If private
- * @prop {string} session Session (ex: '24x7')
- * @prop {string} session-correction Session correction
- * @prop {string} session-display Session display (ex: '24x7')
- */
-
-/**
- * @typedef {Object} MarketInfos
- * @prop {string} series_id Used series (ex: 'ser_1')
- * @prop {string} base_currency Base currency (ex: 'BTC')
- * @prop {string} base_currency_id Base currency ID (ex: 'XTVCBTC')
- * @prop {string} name Market short name (ex: 'BTCEUR')
- * @prop {string} full_name Market full name (ex: 'COINBASE:BTCEUR')
- * @prop {string} pro_name Market pro name (ex: 'COINBASE:BTCEUR')
- * @prop {string} description Market symbol description (ex: 'BTC/EUR')
- * @prop {string} short_description Market symbol short description (ex: 'BTC/EUR')
- * @prop {string} exchange Market exchange (ex: 'COINBASE')
- * @prop {string} listed_exchange Market exchange (ex: 'COINBASE')
- * @prop {string} provider_id Values provider ID (ex: 'coinbase')
- * @prop {string} currency_id Used currency ID (ex: 'EUR')
- * @prop {string} currency_code Used currency code (ex: 'EUR')
- * @prop {string} variable_tick_size Variable tick size
- * @prop {number} pricescale Price scale
- * @prop {number} pointvalue Point value
- * @prop {string} session Session (ex: '24x7')
- * @prop {string} session_display Session display (ex: '24x7')
- * @prop {string} type Market type (ex: 'crypto')
- * @prop {boolean} has_intraday If intraday values are available
- * @prop {boolean} fractional If market is fractional
- * @prop {boolean} is_tradable If the market is curently tradable
- * @prop {number} minmov Minimum move value
- * @prop {number} minmove2 Minimum move value 2
- * @prop {string} timezone Used timezone
- * @prop {boolean} is_replayable If the replay mode is available
- * @prop {boolean} has_adjustment If the adjustment mode is enabled
- * @prop {boolean} has_extended_hours Has extended hours
- * @prop {string} bar_source Bar source
- * @prop {string} bar_transform Bar transform
- * @prop {boolean} bar_fillgaps Bar fill gaps
- * @prop {string} allowed_adjustment Allowed adjustment (ex: 'none')
- * @prop {string} subsession_id Subsession ID (ex: 'regular')
- * @prop {string} pro_perm Pro permission (ex: '')
- * @prop {[]} base_name Base name (ex: ['COINBASE:BTCEUR'])
- * @prop {[]} legs Legs (ex: ['COINBASE:BTCEUR'])
- * @prop {Subsession[]} subsessions Sub sessions
- * @prop {[]} typespecs Typespecs (ex: [])
- * @prop {[]} resolutions Resolutions (ex: [])
- * @prop {[]} aliases Aliases (ex: [])
- * @prop {[]} alternatives Alternatives (ex: [])
- */
-
-/**
- * @param {import('../client').ClientBridge} client
- */
-module.exports = (client) => class ChartSession {
- #chartSessionID = genSessionID('cs');
-
- #replaySessionID = genSessionID('rs');
-
- #replayMode = false;
-
- /** @type {Object<string, (): any>} */
- #replayOKCB = {};
-
- /** Parent client */
- #client = client;
-
- /** @type {StudyListeners} */
- #studyListeners = {};
-
- /**
- * Table of periods values indexed by timestamp
- * @type {Object<number, PricePeriod[]>}
- */
- #periods = {};
-
- /** @return {PricePeriod[]} List of periods values */
- get periods() {
- return Object.values(this.#periods).sort((a, b) => b.time - a.time);
- }
-
- /**
- * Current market infos
- * @type {MarketInfos}
- */
- #infos = {};
-
- /** @return {MarketInfos} Current market infos */
- get infos() {
- return this.#infos;
- }
-
- #callbacks = {
- seriesLoaded: [],
- symbolLoaded: [],
- update: [],
-
- replayLoaded: [],
- replayPoint: [],
- replayResolution: [],
- replayEnd: [],
-
- event: [],
- error: [],
- };
-
- /**
- * @param {ChartEvent} ev Client event
- * @param {...{}} data Packet data
- */
- #handleEvent(ev, ...data) {
- this.#callbacks[ev].forEach((e) => e(...data));
- this.#callbacks.event.forEach((e) => e(ev, ...data));
- }
-
- #handleError(...msgs) {
- if (this.#callbacks.error.length === 0) console.error(...msgs);
- else this.#handleEvent('error', ...msgs);
- }
-
- constructor() {
- this.#client.sessions[this.#chartSessionID] = {
- type: 'chart',
- onData: (packet) => {
- if (global.TW_DEBUG) console.log('§90§30§106 CHART SESSION §0 DATA', packet);
-
- if (typeof packet.data[1] === 'string' && this.#studyListeners[packet.data[1]]) {
- this.#studyListeners[packet.data[1]](packet);
- return;
- }
-
- if (packet.type === 'symbol_resolved') {
- this.#infos = {
- series_id: packet.data[1],
- ...packet.data[2],
- };
-
- this.#handleEvent('symbolLoaded');
- return;
- }
-
- if (['timescale_update', 'du'].includes(packet.type)) {
- const changes = [];
-
- Object.keys(packet.data[1]).forEach((k) => {
- changes.push(k);
- if (k === '$prices') {
- const periods = packet.data[1].$prices;
- if (!periods || !periods.s) return;
-
- periods.s.forEach((p) => {
- [this.#chartSession.indexes[p.i]] = p.v;
- this.#periods[p.v[0]] = {
- time: p.v[0],
- open: p.v[1],
- close: p.v[4],
- max: p.v[2],
- min: p.v[3],
- volume: Math.round(p.v[5] * 100) / 100,
- };
- });
-
- return;
- }
-
- if (this.#studyListeners[k]) this.#studyListeners[k](packet);
- });
-
- this.#handleEvent('update', changes);
- return;
- }
-
- if (packet.type === 'symbol_error') {
- this.#handleError(`(${packet.data[1]}) Symbol error:`, packet.data[2]);
- return;
- }
-
- if (packet.type === 'series_error') {
- this.#handleError('Series error:', packet.data[3]);
- return;
- }
-
- if (packet.type === 'critical_error') {
- const [, name, description] = packet.data;
- this.#handleError('Critical error:', name, description);
- }
- },
- };
-
- this.#client.sessions[this.#replaySessionID] = {
- type: 'replay',
- onData: (packet) => {
- if (global.TW_DEBUG) console.log('§90§30§106 REPLAY SESSION §0 DATA', packet);
-
- if (packet.type === 'replay_ok') {
- if (this.#replayOKCB[packet.data[1]]) {
- this.#replayOKCB[packet.data[1]]();
- delete this.#replayOKCB[packet.data[1]];
- }
- return;
- }
-
- if (packet.type === 'replay_instance_id') {
- this.#handleEvent('replayLoaded', packet.data[1]);
- return;
- }
-
- if (packet.type === 'replay_point') {
- this.#handleEvent('replayPoint', packet.data[1]);
- return;
- }
-
- if (packet.type === 'replay_resolutions') {
- this.#handleEvent('replayResolution', packet.data[1], packet.data[2]);
- return;
- }
-
- if (packet.type === 'replay_data_end') {
- this.#handleEvent('replayEnd');
- return;
- }
-
- if (packet.type === 'critical_error') {
- const [, name, description] = packet.data;
- this.#handleError('Critical error:', name, description);
- }
- },
- };
-
- this.#client.send('chart_create_session', [this.#chartSessionID]);
- }
-
- #seriesCreated = false;
-
- #currentSeries = 0;
-
- /**
- * @param {import('../types').TimeFrame} timeframe Chart period timeframe
- * @param {number} [range] Number of loaded periods/candles (Default: 100)
- * @param {number} [reference] Reference candle timestamp (Default is now)
- */
- setSeries(timeframe = '240', range = 100, reference = null) {
- if (!this.#currentSeries) {
- this.#handleError('Please set the market before setting series');
- return;
- }
-
- const calcRange = !reference ? range : ['bar_count', reference, range];
-
- this.#periods = {};
-
- this.#client.send(`${this.#seriesCreated ? 'modify' : 'create'}_series`, [
- this.#chartSessionID,
- '$prices',
- 's1',
- `ser_${this.#currentSeries}`,
- timeframe,
- this.#seriesCreated ? '' : calcRange,
- ]);
-
- this.#seriesCreated = true;
- }
-
- /**
- * Set the chart market
- * @param {string} symbol Market symbol
- * @param {Object} [options] Chart options
- * @param {import('../types').TimeFrame} [options.timeframe] Chart period timeframe
- * @param {number} [options.range] Number of loaded periods/candles (Default: 100)
- * @param {number} [options.to] Last candle timestamp (Default is now)
- * @param {'splits' | 'dividends'} [options.adjustment] Market adjustment
- * @param {boolean} [options.backadjustment] Market backadjustment of futures contracts
- * @param {'regular' | 'extended'} [options.session] Chart session
- * @param {'EUR' | 'USD' | string} [options.currency] Chart currency
- * @param {ChartType} [options.type] Chart custom type
- * @param {ChartInputs} [options.inputs] Chart custom inputs
- * @param {number} [options.replay] Replay mode starting point (Timestamp)
- */
- setMarket(symbol, options = {}) {
- this.#periods = {};
-
- if (this.#replayMode) {
- this.#replayMode = false;
- this.#client.send('replay_delete_session', [this.#replaySessionID]);
- }
-
- const symbolInit = {
- symbol: symbol || 'BTCEUR',
- adjustment: options.adjustment || 'splits',
- };
-
- if (options.backadjustment) symbolInit.backadjustment = 'default';
- if (options.session) symbolInit.session = options.session;
- if (options.currency) symbolInit['currency-id'] = options.currency;
-
- if (options.replay) {
- if (!this.#replayMode) {
- this.#replayMode = true;
- this.#client.send('replay_create_session', [this.#replaySessionID]);
- }
-
- this.#client.send('replay_add_series', [
- this.#replaySessionID,
- 'req_replay_addseries',
- `=${JSON.stringify(symbolInit)}`,
- options.timeframe,
- ]);
-
- this.#client.send('replay_reset', [
- this.#replaySessionID,
- 'req_replay_reset',
- options.replay,
- ]);
- }
-
- const complex = options.type || options.replay;
- const chartInit = complex ? {} : symbolInit;
-
- if (complex) {
- if (options.replay) chartInit.replay = this.#replaySessionID;
- chartInit.symbol = symbolInit;
- chartInit.type = ChartTypes[options.type];
- if (options.type) chartInit.inputs = { ...options.inputs };
- }
-
- this.#currentSeries += 1;
-
- this.#client.send('resolve_symbol', [
- this.#chartSessionID,
- `ser_${this.#currentSeries}`,
- `=${JSON.stringify(chartInit)}`,
- ]);
-
- this.setSeries(options.timeframe, options.range, options.to);
- }
-
- /**
- * Set the chart timezone
- * @param {import('../types').Timezone} timezone New timezone
- */
- setTimezone(timezone) {
- this.#periods = {};
- this.#client.send('switch_timezone', [this.#chartSessionID, timezone]);
- }
-
- /**
- * Fetch x additional previous periods/candles values
- * @param {number} number Number of additional periods/candles you want to fetch
- */
- fetchMore(number = 1) {
- this.#client.send('request_more_data', [this.#chartSessionID, '$prices', number]);
- }
-
- /**
- * Fetch x additional previous periods/candles values
- * @param {number} number Number of additional periods/candles you want to fetch
- * @returns {Promise} Raise when the data has been fetched
- */
- replayStep(number = 1) {
- return new Promise((cb) => {
- if (!this.#replayMode) {
- this.#handleError('No replay session');
- return;
- }
-
- const reqID = genSessionID('rsq_step');
- this.#client.send('replay_step', [this.#replaySessionID, reqID, number]);
- this.#replayOKCB[reqID] = () => { cb(); };
- });
- }
-
- /**
- * Start fetching a new period/candle every x ms
- * @param {number} interval Number of additional periods/candles you want to fetch
- * @returns {Promise} Raise when the replay mode starts
- */
- replayStart(interval = 1000) {
- return new Promise((cb) => {
- if (!this.#replayMode) {
- this.#handleError('No replay session');
- return;
- }
-
- const reqID = genSessionID('rsq_start');
- this.#client.send('replay_start', [this.#replaySessionID, reqID, interval]);
- this.#replayOKCB[reqID] = () => { cb(); };
- });
- }
-
- /**
- * Stop fetching a new period/candle every x ms
- * @returns {Promise} Raise when the replay mode stops
- */
- replayStop() {
- return new Promise((cb) => {
- if (!this.#replayMode) {
- this.#handleError('No replay session');
- return;
- }
-
- const reqID = genSessionID('rsq_stop');
- this.#client.send('replay_stop', [this.#replaySessionID, reqID]);
- this.#replayOKCB[reqID] = () => { cb(); };
- });
- }
-
- /**
- * When a symbol is loaded
- * @param {() => void} cb
- * @event
- */
- onSymbolLoaded(cb) {
- this.#callbacks.symbolLoaded.push(cb);
- }
-
- /**
- * When a chart update happens
- * @param {(changes: ('$prices' | string)[]) => void} cb
- * @event
- */
- onUpdate(cb) {
- this.#callbacks.update.push(cb);
- }
-
- /**
- * When the replay session is ready
- * @param {() => void} cb
- * @event
- */
- onReplayLoaded(cb) {
- this.#callbacks.replayLoaded.push(cb);
- }
-
- /**
- * When the replay session has new resolution
- * @param {(
- * timeframe: import('../types').TimeFrame,
- * index: number,
- * ) => void} cb
- * @event
- */
- onReplayResolution(cb) {
- this.#callbacks.replayResolution.push(cb);
- }
-
- /**
- * When the replay session ends
- * @param {() => void} cb
- * @event
- */
- onReplayEnd(cb) {
- this.#callbacks.replayEnd.push(cb);
- }
-
- /**
- * When the replay session cursor has moved
- * @param {(index: number) => void} cb
- * @event
- */
- onReplayPoint(cb) {
- this.#callbacks.replayPoint.push(cb);
- }
-
- /**
- * When chart error happens
- * @param {(...any) => void} cb Callback
- * @event
- */
- onError(cb) {
- this.#callbacks.error.push(cb);
- }
-
- /** @type {ChartSessionBridge} */
- #chartSession = {
- sessionID: this.#chartSessionID,
- studyListeners: this.#studyListeners,
- indexes: {},
- send: (t, p) => this.#client.send(t, p),
- };
-
- Study = studyConstructor(this.#chartSession);
-
- /** Delete the chart session */
- delete() {
- if (this.#replayMode) this.#client.send('replay_delete_session', [this.#replaySessionID]);
- this.#client.send('chart_delete_session', [this.#chartSessionID]);
- delete this.#client.sessions[this.#chartSessionID];
- delete this.#client.sessions[this.#replaySessionID];
- this.#replayMode = false;
- }
-};
diff --git a/src/chart/strategy.ts b/src/chart/strategy.ts
new file mode 100644
index 0000000..c2a81d7
--- /dev/null
+++ b/src/chart/strategy.ts
@@ -0,0 +1,140 @@
+/** A value with absolute and percent forms. */
+export interface RelAbsValue {
+ v: number;
+ p: number;
+}
+
+export interface TradeReport {
+ entry: { name: string; type: 'long' | 'short'; value: number; time: number };
+ /** `name` is '' for exits that are not explicit. */
+ exit: { name: string; value: number; time: number };
+ quantity: number;
+ profit: RelAbsValue;
+ cumulative: RelAbsValue;
+ runup: RelAbsValue;
+ drawdown: RelAbsValue;
+}
+
+export interface PerformanceReport {
+ avgBarsInTrade: number;
+ avgBarsInWinTrade: number;
+ avgBarsInLossTrade: number;
+ avgTrade: number;
+ avgTradePercent: number;
+ avgLosTrade: number;
+ avgLosTradePercent: number;
+ avgWinTrade: number;
+ avgWinTradePercent: number;
+ commissionPaid: number;
+ grossLoss: number;
+ grossLossPercent: number;
+ grossProfit: number;
+ grossProfitPercent: number;
+ largestLosTrade: number;
+ largestLosTradePercent: number;
+ largestWinTrade: number;
+ largestWinTradePercent: number;
+ marginCalls: number;
+ maxContractsHeld: number;
+ netProfit: number;
+ netProfitPercent: number;
+ numberOfLosingTrades: number;
+ numberOfWiningTrades: number;
+ percentProfitable: number;
+ profitFactor: number;
+ ratioAvgWinAvgLoss: number;
+ totalOpenTrades: number;
+ totalTrades: number;
+ [key: string]: number;
+}
+
+export interface FromTo {
+ from: number;
+ to: number;
+}
+
+/** Report sent by Pine strategies (backtest results computed by TradingView). */
+export interface StrategyReport {
+ currency?: string;
+ settings?: { dateRange?: { backtest?: FromTo; trade?: FromTo }; [key: string]: unknown };
+ /** Trades, most recent first. */
+ trades: TradeReport[];
+ history: {
+ buyHold?: number[];
+ buyHoldPercent?: number[];
+ drawDown?: number[];
+ drawDownPercent?: number[];
+ equity?: number[];
+ equityPercent?: number[];
+ };
+ performance: {
+ all?: PerformanceReport;
+ long?: PerformanceReport;
+ short?: PerformanceReport;
+ buyHoldReturn?: number;
+ buyHoldReturnPercent?: number;
+ maxDrawDown?: number;
+ maxDrawDownPercent?: number;
+ openPL?: number;
+ openPLPercent?: number;
+ sharpeRatio?: number;
+ sortinoRatio?: number;
+ [key: string]: unknown;
+ };
+}
+
+export type StrategyReportChange =
+ | 'report.currency' | 'report.settings' | 'report.perf' | 'report.trades' | 'report.history';
+
+/** Converts raw trades (oldest first) into readable trades (most recent first). */
+export function parseTrades(trades: any[]): TradeReport[] {
+ return [...trades].reverse().map((t) => ({
+ entry: {
+ name: t.e?.c,
+ type: String(t.e?.tp ?? '').startsWith('s') ? 'short' : 'long',
+ value: t.e?.p,
+ time: t.e?.tm,
+ },
+ exit: { name: t.x?.c, value: t.x?.p, time: t.x?.tm },
+ quantity: t.q,
+ profit: t.tp,
+ cumulative: t.cp,
+ runup: t.rn,
+ drawdown: t.dd,
+ }));
+}
+
+/** Merges a raw report into `target`; returns the changed parts. */
+export function mergeStrategyReport(target: StrategyReport, report: any): StrategyReportChange[] {
+ const changes: StrategyReportChange[] = [];
+ if (!report || typeof report !== 'object') return changes;
+
+ if (report.currency) {
+ target.currency = report.currency;
+ changes.push('report.currency');
+ }
+ if (report.settings) {
+ target.settings = report.settings;
+ changes.push('report.settings');
+ }
+ if (report.performance) {
+ target.performance = report.performance;
+ changes.push('report.perf');
+ }
+ if (report.trades) {
+ target.trades = parseTrades(report.trades);
+ changes.push('report.trades');
+ }
+ if (report.equity) {
+ target.history = {
+ buyHold: report.buyHold,
+ buyHoldPercent: report.buyHoldPercent,
+ drawDown: report.drawDown,
+ drawDownPercent: report.drawDownPercent,
+ equity: report.equity,
+ equityPercent: report.equityPercent,
+ };
+ changes.push('report.history');
+ }
+ return changes;
+}
diff --git a/src/chart/study.js b/src/chart/study.js
deleted file mode 100644
index b1c4737..0000000
--- a/src/chart/study.js
+++ /dev/null
@@ -1,447 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const { genSessionID } = require('../utils');
-const { parseCompressed } = require('../protocol');
-const graphicParser = require('./graphicParser');
-
-const PineIndicator = require('../classes/PineIndicator');
-const BuiltInIndicator = require('../classes/BuiltInIndicator');
-
-/**
- * Get pine inputs
- * @param {PineIndicator | BuiltInIndicator} options
- */
-function getInputs(options) {
- if (options instanceof PineIndicator) {
- const pineInputs = { text: options.script };
-
- if (options.pineId) pineInputs.pineId = options.pineId;
- if (options.pineVersion) pineInputs.pineVersion = options.pineVersion;
-
- Object.keys(options.inputs).forEach((inputID, n) => {
- const input = options.inputs[inputID];
-
- pineInputs[inputID] = {
- v: (input.type !== 'color') ? input.value : n,
- f: input.isFake,
- t: input.type,
- };
- });
-
- return pineInputs;
- }
-
- return options.options;
-}
-
-const parseTrades = (trades) => trades.reverse().map((t) => ({
- entry: {
- name: t.e.c,
- type: (t.e.tp[0] === 's' ? 'short' : 'long'),
- value: t.e.p,
- time: t.e.tm,
- },
- exit: {
- name: t.x.c,
- value: t.x.p,
- time: t.x.tm,
- },
- quantity: t.q,
- profit: t.tp,
- cumulative: t.cp,
- runup: t.rn,
- drawdown: t.dd,
-}));
-
-// const historyParser = (history) => history.reverse().map((h) => ({
-
-/**
- * @typedef {Object} TradeReport Trade report
-
- * @prop {Object} entry Trade entry
- * @prop {string} entry.name Trade name
- * @prop {'long' | 'short'} entry.type Entry type (long/short)
- * @prop {number} entry.value Entry price value
- * @prop {number} entry.time Entry timestamp
-
- * @prop {Object} exit Trade exit
- * @prop {'' | string} exit.name Trade name ('' if false exit)
- * @prop {number} exit.value Exit price value
- * @prop {number} exit.time Exit timestamp
-
- * @prop {number} quantity Trade quantity
- * @prop {RelAbsValue} profit Trade profit
- * @prop {RelAbsValue} cumulative Trade cummulative profit
- * @prop {RelAbsValue} runup Trade run-up
- * @prop {RelAbsValue} drawdown Trade drawdown
- */
-
-/**
- * @typedef {Object} PerfReport
- * @prop {number} avgBarsInTrade Average bars in trade
- * @prop {number} avgBarsInWinTrade Average bars in winning trade
- * @prop {number} avgBarsInLossTrade Average bars in losing trade
- * @prop {number} avgTrade Average trade gain
- * @prop {number} avgTradePercent Average trade performace
- * @prop {number} avgLosTrade Average losing trade gain
- * @prop {number} avgLosTradePercent Average losing trade performace
- * @prop {number} avgWinTrade Average winning trade gain
- * @prop {number} avgWinTradePercent Average winning trade performace
- * @prop {number} commissionPaid Commission paid
- * @prop {number} grossLoss Gross loss value
- * @prop {number} grossLossPercent Gross loss percent
- * @prop {number} grossProfit Gross profit
- * @prop {number} grossProfitPercent Gross profit percent
- * @prop {number} largestLosTrade Largest losing trade gain
- * @prop {number} largestLosTradePercent Largent losing trade performance (percentage)
- * @prop {number} largestWinTrade Largest winning trade gain
- * @prop {number} largestWinTradePercent Largest winning trade performance (percentage)
- * @prop {number} marginCalls Margin calls
- * @prop {number} maxContractsHeld Max Contracts Held
- * @prop {number} netProfit Net profit
- * @prop {number} netProfitPercent Net performance (percentage)
- * @prop {number} numberOfLosingTrades Number of losing trades
- * @prop {number} numberOfWiningTrades Number of winning trades
- * @prop {number} percentProfitable Strategy winrate
- * @prop {number} profitFactor Profit factor
- * @prop {number} ratioAvgWinAvgLoss Ratio Average Win / Average Loss
- * @prop {number} totalOpenTrades Total open trades
- * @prop {number} totalTrades Total trades
-*/
-
-/**
- * @typedef {Object} FromTo
- * @prop {number} from From timestamp
- * @prop {number} to To timestamp
- */
-
-/**
- * @typedef {Object} StrategyReport
- * @prop {'EUR' | 'USD' | 'JPY' | '' | 'CHF'} [currency] Selected currency
- * @prop {Object} [settings] Backtester settings
- * @prop {Object} [settings.dateRange] Backtester date range
- * @prop {FromTo} [settings.dateRange.backtest] Date range for backtest
- * @prop {FromTo} [settings.dateRange.trade] Date range for trade
- * @prop {TradeReport[]} trades Trade list starting by the last
- * @prop {Object} history History Chart value
- * @prop {number[]} [history.buyHold] Buy hold values
- * @prop {number[]} [history.buyHoldPercent] Buy hold percent values
- * @prop {number[]} [history.drawDown] Drawdown values
- * @prop {number[]} [history.drawDownPercent] Drawdown percent values
- * @prop {number[]} [history.equity] Equity values
- * @prop {number[]} [history.equityPercent] Equity percent values
- * @prop {Object} performance Strategy performance
- * @prop {PerfReport} [performance.all] Strategy long/short performances
- * @prop {PerfReport} [performance.long] Strategy long performances
- * @prop {PerfReport} [performance.short] Strategy short performances
- * @prop {number} [performance.buyHoldReturn] Strategy Buy & Hold Return
- * @prop {number} [performance.buyHoldReturnPercent] Strategy Buy & Hold Return percent
- * @prop {number} [performance.maxDrawDown] Strategy max drawdown
- * @prop {number} [performance.maxDrawDownPercent] Strategy max drawdown percent
- * @prop {number} [performance.openPL] Strategy Open P&L (Profit And Loss)
- * @prop {number} [performance.openPLPercent] Strategy Open P&L (Profit And Loss) percent
- * @prop {number} [performance.sharpeRatio] Strategy Sharpe Ratio
- * @prop {number} [performance.sortinoRatio] Strategy Sortino Ratio
- */
-
-/**
- * @param {import('./session').ChartSessionBridge} chartSession
- */
-module.exports = (chartSession) => class ChartStudy {
- #studID = genSessionID('st');
-
- #studyListeners = chartSession.studyListeners;
-
- /**
- * Table of periods values indexed by timestamp
- * @type {Object<number, {}[]>}
- */
- #periods = {};
-
- /** @return {{}[]} List of periods values */
- get periods() {
- return Object.values(this.#periods).sort((a, b) => b.$time - a.$time);
- }
-
- /**
- * List of graphic xPos indexes
- * @type {number[]}
- */
- #indexes = [];
-
- /**
- * Table of graphic drawings indexed by type and ID
- * @type {Object<string, Object<number, {}>>}
- */
- #graphic = {};
-
- /**
- * Table of graphic drawings indexed by type
- * @return {import('./graphicParser').GraphicData}
- */
- get graphic() {
- const translator = {};
-
- Object.keys(chartSession.indexes)
- .sort((a, b) => chartSession.indexes[b] - chartSession.indexes[a])
- .forEach((r, n) => { translator[r] = n; });
-
- const indexes = this.#indexes.map((i) => translator[i]);
- return graphicParser(this.#graphic, indexes);
- }
-
- /** @type {StrategyReport} */
- #strategyReport = {
- trades: [],
- history: {},
- performance: {},
- };
-
- /** @return {StrategyReport} Get the strategy report if available */
- get strategyReport() {
- return this.#strategyReport;
- }
-
- #callbacks = {
- studyCompleted: [],
- update: [],
-
- event: [],
- error: [],
- };
-
- /**
- * @param {ChartEvent} ev Client event
- * @param {...{}} data Packet data
- */
- #handleEvent(ev, ...data) {
- this.#callbacks[ev].forEach((e) => e(...data));
- this.#callbacks.event.forEach((e) => e(ev, ...data));
- }
-
- #handleError(...msgs) {
- if (this.#callbacks.error.length === 0) console.error(...msgs);
- else this.#handleEvent('error', ...msgs);
- }
-
- /**
- * @param {PineIndicator | BuiltInIndicator} indicator Indicator object instance
- */
- constructor(indicator) {
- if (!(indicator instanceof PineIndicator) && !(indicator instanceof BuiltInIndicator)) {
- throw new Error(`Indicator argument must be an instance of PineIndicator or BuiltInIndicator.
- Please use 'TradingView.getIndicator(...)' function.`);
- }
-
- /** @type {PineIndicator | BuiltInIndicator} Indicator instance */
- this.instance = indicator;
-
- this.#studyListeners[this.#studID] = async (packet) => {
- if (global.TW_DEBUG) console.log('§90§30§105 STUDY §0 DATA', packet);
-
- if (packet.type === 'study_completed') {
- this.#handleEvent('studyCompleted');
- return;
- }
-
- if (['timescale_update', 'du'].includes(packet.type)) {
- const changes = [];
- const data = packet.data[1][this.#studID];
-
- if (data && data.st && data.st[0]) {
- data.st.forEach((p) => {
- const period = {};
-
- p.v.forEach((plot, i) => {
- if (!this.instance.plots) {
- period[i === 0 ? '$time' : `plot_${i - 1}`] = plot;
- return;
- }
- const plotName = (i === 0 ? '$time' : this.instance.plots[`plot_${i - 1}`]);
- if (plotName && !period[plotName]) period[plotName] = plot;
- else period[`plot_${i - 1}`] = plot;
- });
-
- this.#periods[p.v[0]] = period;
- });
-
- changes.push('plots');
- }
-
- if (data.ns && data.ns.d) {
- const parsed = JSON.parse(data.ns.d);
-
- if (parsed.graphicsCmds) {
- if (parsed.graphicsCmds.erase) {
- parsed.graphicsCmds.erase.forEach((instruction) => {
- // console.log('Erase', instruction);
- if (instruction.action === 'all') {
- if (!instruction.type) {
- Object.keys(this.#graphic).forEach((drawType) => {
- this.#graphic[drawType] = {};
- });
- } else delete this.#graphic[instruction.type];
- return;
- }
-
- if (instruction.action === 'one') {
- delete this.#graphic[instruction.type][instruction.id];
- }
- // Can an 'instruction' contains other things ?
- });
- }
-
- if (parsed.graphicsCmds.create) {
- Object.keys(parsed.graphicsCmds.create).forEach((drawType) => {
- if (!this.#graphic[drawType]) this.#graphic[drawType] = {};
- parsed.graphicsCmds.create[drawType].forEach((group) => {
- group.data.forEach((item) => {
- this.#graphic[drawType][item.id] = item;
- });
- });
- });
- }
-
- // console.log('graphicsCmds', Object.keys(parsed.graphicsCmds));
- // Can 'graphicsCmds' contains other things ?
-
- changes.push('graphic');
- }
-
- const updateStrategyReport = (report) => {
- if (report.currency) {
- this.#strategyReport.currency = report.currency;
- changes.push('report.currency');
- }
-
- if (report.settings) {
- this.#strategyReport.settings = report.settings;
- changes.push('report.settings');
- }
-
- if (report.performance) {
- this.#strategyReport.performance = report.performance;
- changes.push('report.perf');
- }
-
- if (report.trades) {
- this.#strategyReport.trades = parseTrades(report.trades);
- changes.push('report.trades');
- }
-
- if (report.equity) {
- this.#strategyReport.history = {
- buyHold: report.buyHold,
- buyHoldPercent: report.buyHoldPercent,
- drawDown: report.drawDown,
- drawDownPercent: report.drawDownPercent,
- equity: report.equity,
- equityPercent: report.equityPercent,
- };
- changes.push('report.history');
- }
- };
-
- if (parsed.dataCompressed) {
- try {
- const compressedData = await parseCompressed(parsed.dataCompressed);
- if (compressedData && compressedData.report) {
- updateStrategyReport(compressedData.report);
- }
- } catch (error) {
- this.#handleError(
- 'Unable to parse compressed strategy report:',
- error.message || error,
- );
- }
- }
-
- if (parsed.data && parsed.data.report) updateStrategyReport(parsed.data.report);
- }
-
- if (data.ns.indexes && typeof data.ns.indexes === 'object') {
- this.#indexes = data.ns.indexes;
- }
-
- this.#handleEvent('update', changes);
- return;
- }
-
- if (packet.type === 'study_error') {
- this.#handleError(packet.data[3], packet.data[4]);
- }
- };
-
- chartSession.send('create_study', [
- chartSession.sessionID,
- `${this.#studID}`,
- 'st1',
- '$prices',
- this.instance.type,
- getInputs(this.instance),
- ]);
- }
-
- /**
- * @param {PineIndicator | BuiltInIndicator} indicator Indicator instance
- */
- setIndicator(indicator) {
- if (!(indicator instanceof PineIndicator) && !(indicator instanceof BuiltInIndicator)) {
- throw new Error(`Indicator argument must be an instance of PineIndicator or BuiltInIndicator.
- Please use 'TradingView.getIndicator(...)' function.`);
- }
-
- this.instance = indicator;
-
- chartSession.send('modify_study', [
- chartSession.sessionID,
- `${this.#studID}`,
- 'st1',
- getInputs(this.instance),
- ]);
- }
-
- /**
- * When the indicator is ready
- * @param {() => void} cb
- * @event
- */
- onReady(cb) {
- this.#callbacks.studyCompleted.push(cb);
- }
-
- /**
- * @typedef {'plots' | 'report.currency'
- * | 'report.settings' | 'report.perf'
- * | 'report.trades' | 'report.history'
- * | 'graphic'
- * } UpdateChangeType
- */
-
- /**
- * When an indicator update happens
- * @param {(changes: UpdateChangeType[]) => void} cb
- * @event
- */
- onUpdate(cb) {
- this.#callbacks.update.push(cb);
- }
-
- /**
- * When indicator error happens
- * @param {(...any) => void} cb Callback
- * @event
- */
- onError(cb) {
- this.#callbacks.error.push(cb);
- }
-
- /** Remove the study */
- remove() {
- chartSession.send('remove_study', [
- chartSession.sessionID,
- this.#studID,
- ]);
- delete this.#studyListeners[this.#studID];
- }
-};
diff --git a/src/chart/study.ts b/src/chart/study.ts
new file mode 100644
index 0000000..af8617f
--- /dev/null
+++ b/src/chart/study.ts
@@ -0,0 +1,227 @@
+import { TradingViewError } from '../errors.js';
+import { Emitter } from '../events.js';
+import { BuiltInIndicator } from '../indicators/builtin-indicator.js';
+import type { Indicator } from '../indicators/index.js';
+import { PineIndicator } from '../indicators/pine-indicator.js';
+import { decodeCompressed } from '../protocol/compression.js';
+import type { ServerPacket } from '../protocol/framing.js';
+import { createSessionId } from '../protocol/ids.js';
+import {
+ applyGraphicsCommands, parseGraphics, type GraphicsData, type RawGraphics,
+} from './graphics.js';
+import {
+ mergeStrategyReport, type StrategyReport, type StrategyReportChange,
+} from './strategy.js';
+
+/** One study row: `$time` (Unix seconds) plus one entry per plot. */
+export interface StudyValue {
+ $time: number;
+ [plot: string]: number;
+}
+
+export type StudyChange = 'plots' | 'graphic' | StrategyReportChange;
+
+export interface StudyEvents {
+ [event: string]: unknown[];
+ /** The server started (re)computing the study. */
+ loading: [];
+ /** The study finished computing over the loaded bars. */
+ ready: [];
+ update: [changes: StudyChange[]];
+ error: [error: TradingViewError];
+}
+
+/** @internal Link between a study and its chart. */
+export interface StudyBridge {
+ chartId: string;
+ send(method: string, params: unknown[]): void;
+ barsBack(): Map<number, number>;
+ log(...args: unknown[]): void;
+ unregister(id: string): void;
+}
+
+function assertIndicator(indicator: unknown): asserts indicator is Indicator {
+ if (!(indicator instanceof PineIndicator) && !(indicator instanceof BuiltInIndicator)) {
+ throw new TradingViewError(
+ 'INVALID_ARGUMENT',
+ 'The indicator must be a PineIndicator (see getIndicator) or a BuiltInIndicator',
+ );
+ }
+}
+
+/** Formats a `study_error` payload into a readable message. */
+function studyErrorMessage(error: unknown): string {
+ if (error && typeof error === 'object' && 'error' in error) {
+ const { error: template, ctx } = error as { error: unknown; ctx?: Record<string, unknown> };
+ if (typeof template === 'string') {
+ return template.replace(/\{(\w+)\}/g, (all: string, key: string) => (ctx && key in ctx ? String(ctx[key]) : all));
+ }
+ }
+ return typeof error === 'string' ? error : JSON.stringify(error);
+}
+
+/** An indicator running on a chart. Create it with `chart.createStudy(indicator)`. */
+export class Study extends Emitter<StudyEvents> {
+ readonly id = createSessionId('st');
+
+ readonly #bridge: StudyBridge;
+
+ readonly #values = new Map<number, StudyValue>();
+
+ readonly #graphics: RawGraphics = {};
+
+ #graphicIndexes: number[] = [];
+
+ #strategyReport: StrategyReport = { trades: [], history: {}, performance: {} };
+
+ #indicator: Indicator;
+
+ #removed = false;
+
+ #ready = false;
+
+ /** @internal Use `chart.createStudy()`. */
+ constructor(bridge: StudyBridge, indicator: Indicator) {
+ super();
+ assertIndicator(indicator);
+ this.#bridge = bridge;
+ this.#indicator = indicator;
+ }
+
+ /** @internal */
+ create(): void {
+ this.#bridge.send('create_study', [
+ this.#bridge.chartId, this.id, 'st1', '$prices', this.#indicator.type, this.#indicator.toStudyInputs(),
+ ]);
+ }
+
+ /** The indicator definition running in this study. */
+ get indicator(): Indicator {
+ return this.#indicator;
+ }
+
+ /** True after the first `study_completed`. */
+ get isReady(): boolean {
+ return this.#ready;
+ }
+
+ /** True after `remove()` or when the chart is gone. */
+ get isRemoved(): boolean {
+ return this.#removed;
+ }
+
+ /** Plot values, oldest first. */
+ get values(): StudyValue[] {
+ return [...this.#values.values()].sort((a, b) => a.$time - b.$time);
+ }
+
+ /** Drawings (labels, lines, boxes, tables...) produced by the indicator. */
+ get graphics(): GraphicsData {
+ const barsBack = this.#bridge.barsBack();
+ return parseGraphics(this.#graphics, this.#graphicIndexes.map((index) => barsBack.get(index)));
+ }
+
+ /** Strategy report (Pine strategies only). */
+ get strategyReport(): StrategyReport {
+ return this.#strategyReport;
+ }
+
+ /** Replaces the indicator (typically the same script with new inputs). */
+ setIndicator(indicator: Indicator): void {
+ assertIndicator(indicator);
+ if (this.#removed) throw new TradingViewError('INVALID_STATE', 'The study is removed');
+ this.#indicator = indicator;
+ this.#bridge.send('modify_study', [this.#bridge.chartId, this.id, 'st1', indicator.toStudyInputs()]);
+ }
+
+ /** Removes the study from the chart. Idempotent. */
+ remove(): void {
+ if (this.#removed) return;
+ this.#bridge.send('remove_study', [this.#bridge.chartId, this.id]);
+ this.#removed = true;
+ this.#bridge.unregister(this.id);
+ }
+
+ /** @internal Called when the chart or connection is gone; `error` is reported if set. */
+ dispose(error?: TradingViewError): void {
+ if (this.#removed) return;
+ this.#removed = true;
+ if (error) this.emit('error', error);
+ }
+
+ /** @internal Packets addressed to this study (`study_*`). */
+ onPacket(packet: ServerPacket): void {
+ this.#bridge.log('study', this.id, packet);
+ switch (packet.m) {
+ case 'study_loading':
+ this.emit('loading');
+ return;
+ case 'study_completed':
+ this.#ready = true;
+ this.emit('ready');
+ return;
+ case 'study_error':
+ this.emit('error', new TradingViewError('STUDY_ERROR', `Study error: ${studyErrorMessage(packet.p[3])}`, {
+ details: packet.p.slice(3),
+ }));
+ return;
+ default:
+ }
+ }
+
+ /** @internal Data from `timescale_update` / `du`. */
+ onData(data: any): void {
+ if (!data || typeof data !== 'object') return;
+ const changes: StudyChange[] = [];
+
+ if (Array.isArray(data.st) && data.st.length > 0) {
+ const { plots } = this.#indicator instanceof PineIndicator ? this.#indicator : { plots: undefined };
+ for (const row of data.st) {
+ const value = {} as StudyValue;
+ (row.v as number[]).forEach((plot, i) => {
+ if (i === 0) {
+ value.$time = plot;
+ return;
+ }
+ const name = plots?.[`plot_${i - 1}`];
+ if (name && !(name in value)) value[name] = plot;
+ else value[`plot_${i - 1}`] = plot;
+ });
+ this.#values.set(value.$time, value);
+ }
+ changes.push('plots');
+ }
+
+ const ns = data.ns;
+ if (ns?.d) {
+ let parsed: any;
+ try {
+ parsed = JSON.parse(ns.d);
+ } catch (error) {
+ this.emit('error', new TradingViewError('PARSE_ERROR', 'Unable to parse study data', { cause: error }));
+ }
+
+ if (parsed?.graphicsCmds) {
+ applyGraphicsCommands(this.#graphics, parsed.graphicsCmds);
+ changes.push('graphic');
+ }
+
+ if (parsed?.dataCompressed) {
+ try {
+ const decoded = decodeCompressed(parsed.dataCompressed) as any;
+ changes.push(...mergeStrategyReport(this.#strategyReport, decoded?.report));
+ } catch (error) {
+ this.emit('error', new TradingViewError('PARSE_ERROR', 'Unable to parse compressed strategy report', {
+ cause: error,
+ }));
+ }
+ }
+
+ if (parsed?.data?.report) changes.push(...mergeStrategyReport(this.#strategyReport, parsed.data.report));
+ }
+
+ if (Array.isArray(ns?.indexes)) this.#graphicIndexes = ns.indexes;
+
+ this.emit('update', changes);
+ }
+}
diff --git a/src/chart/timeframes.ts b/src/chart/timeframes.ts
new file mode 100644
index 0000000..3852cb5
--- /dev/null
+++ b/src/chart/timeframes.ts
@@ -0,0 +1,22 @@
+import type { Timeframe } from './types.js';
+
+/**
+ * Approximate duration of one bar in seconds, or `undefined` for
+ * resolutions that are not time-based (ticks, ranges...).
+ * Months count as 30 days.
+ */
+export function timeframeSeconds(timeframe: Timeframe): number | undefined {
+ const match = /^(\d*)([SDWM]?)$/i.exec(String(timeframe).trim());
+ if (!match) return undefined;
+ const [, amountText, unitText] = match;
+ const amount = amountText ? Number(amountText) : 1;
+ if (!Number.isFinite(amount) || amount <= 0) return undefined;
+ switch (unitText.toUpperCase()) {
+ case '': return amountText ? amount * 60 : undefined;
+ case 'S': return amount;
+ case 'D': return amount * 86_400;
+ case 'W': return amount * 604_800;
+ case 'M': return amount * 2_592_000;
+ default: return undefined;
+ }
+}
diff --git a/src/chart/types.ts b/src/chart/types.ts
new file mode 100644
index 0000000..7620027
--- /dev/null
+++ b/src/chart/types.ts
@@ -0,0 +1,150 @@
+/**
+ * Exchange-qualified symbol such as `BINANCE:BTCEUR` or `NASDAQ:AAPL`.
+ * A bare ticker (`BTCEUR`) lets TradingView pick an exchange.
+ */
+export type MarketSymbol = string;
+
+/**
+ * Bar resolution: minutes (`1`, `5`, `60`, `240`), seconds (`1S`), or
+ * days/weeks/months (`D`, `1D`, `W`, `M`...). Custom values such as `20`
+ * or `1S` need an account with access to them.
+ */
+export type Timeframe =
+ | '1S' | '5S' | '10S' | '15S' | '30S'
+ | '1' | '3' | '5' | '15' | '30' | '45'
+ | '60' | '120' | '180' | '240'
+ | '1D' | '1W' | '1M' | 'D' | 'W' | 'M' | '3M' | '6M' | '12M'
+ | (string & {});
+
+/** Chart timezone. `exchange` uses the exchange timezone. Any IANA name TradingView supports is accepted. */
+export type Timezone =
+ | 'Etc/UTC' | 'exchange'
+ | 'Pacific/Honolulu' | 'America/Juneau' | 'America/Los_Angeles'
+ | 'America/Phoenix' | 'America/Vancouver' | 'US/Mountain'
+ | 'America/El_Salvador' | 'America/Bogota' | 'America/Chicago'
+ | 'America/Lima' | 'America/Mexico_City' | 'America/Caracas'
+ | 'America/New_York' | 'America/Toronto' | 'America/Argentina/Buenos_Aires'
+ | 'America/Santiago' | 'America/Sao_Paulo' | 'Atlantic/Reykjavik'
+ | 'Europe/Dublin' | 'Africa/Lagos' | 'Europe/Lisbon' | 'Europe/London'
+ | 'Europe/Amsterdam' | 'Europe/Belgrade' | 'Europe/Berlin'
+ | 'Europe/Brussels' | 'Europe/Copenhagen' | 'Africa/Johannesburg'
+ | 'Africa/Cairo' | 'Europe/Luxembourg' | 'Europe/Madrid' | 'Europe/Malta'
+ | 'Europe/Oslo' | 'Europe/Paris' | 'Europe/Rome' | 'Europe/Stockholm'
+ | 'Europe/Warsaw' | 'Europe/Zurich' | 'Europe/Athens' | 'Asia/Bahrain'
+ | 'Europe/Helsinki' | 'Europe/Istanbul' | 'Asia/Jerusalem' | 'Asia/Kuwait'
+ | 'Europe/Moscow' | 'Asia/Qatar' | 'Europe/Riga' | 'Asia/Riyadh'
+ | 'Europe/Tallinn' | 'Europe/Vilnius' | 'Asia/Tehran' | 'Asia/Dubai'
+ | 'Asia/Muscat' | 'Asia/Ashkhabad' | 'Asia/Kolkata' | 'Asia/Almaty'
+ | 'Asia/Bangkok' | 'Asia/Jakarta' | 'Asia/Ho_Chi_Minh' | 'Asia/Chongqing'
+ | 'Asia/Hong_Kong' | 'Australia/Perth' | 'Asia/Shanghai' | 'Asia/Singapore'
+ | 'Asia/Taipei' | 'Asia/Seoul' | 'Asia/Tokyo' | 'Australia/Brisbane'
+ | 'Australia/Adelaide' | 'Australia/Sydney' | 'Pacific/Norfolk'
+ | 'Pacific/Auckland' | 'Pacific/Fakaofo' | 'Pacific/Chatham'
+ | (string & {});
+
+/** Custom bar types computed by TradingView. */
+export type ChartType = 'HeikinAshi' | 'Renko' | 'LineBreak' | 'Kagi' | 'PointAndFigure' | 'Range';
+
+/** Server study used for each chart type. */
+export const CHART_TYPE_STUDIES: Record<ChartType, string> = {
+ HeikinAshi: 'BarSetHeikenAshi@tv-basicstudies-60!',
+ Renko: 'BarSetRenko@tv-prostudies-40!',
+ LineBreak: 'BarSetPriceBreak@tv-prostudies-34!',
+ Kagi: 'BarSetKagi@tv-prostudies-34!',
+ PointAndFigure: 'BarSetPnF@tv-prostudies-34!',
+ Range: 'BarSetRange@tv-basicstudies-72!',
+};
+
+/** Inputs for custom chart types. */
+export interface ChartTypeInputs {
+ /** Renko/Kagi/PointAndFigure ATR length. */
+ atrLength?: number;
+ /** Renko/LineBreak/Kagi source. */
+ source?: 'open' | 'high' | 'low' | 'close' | 'hl2' | 'hlc3' | 'ohlc4';
+ /** Renko/Kagi/PointAndFigure style. */
+ style?: 'ATR' | (string & {});
+ /** Renko/PointAndFigure box size. */
+ boxSize?: number;
+ /** Kagi/PointAndFigure reversal amount. */
+ reversalAmount?: number;
+ /** Renko/PointAndFigure sources. */
+ sources?: 'Close' | (string & {});
+ /** Renko wicks. */
+ wicks?: boolean;
+ /** LineBreak number of lines. */
+ lb?: number;
+ /** PointAndFigure one-step-back building. */
+ oneStepBackBuilding?: boolean;
+ /** Range phantom bars. */
+ phantomBars?: boolean;
+ /** Range size. */
+ range?: number;
+ [input: string]: unknown;
+}
+
+/** Price adjustment. */
+export type Adjustment = 'splits' | 'dividends' | 'none' | (string & {});
+
+/** Trading session. */
+export type TradingSession = 'regular' | 'extended' | (string & {});
+
+/** One bar. `time` is the bar open time as a Unix timestamp in seconds. */
+export interface Candle {
+ time: number;
+ open: number;
+ high: number;
+ low: number;
+ close: number;
+ volume: number;
+}
+
+export interface Subsession {
+ id: string;
+ description: string;
+ private: boolean;
+ session: string;
+ 'session-correction': string;
+ 'session-display': string;
+}
+
+/** Symbol metadata from `symbol_resolved`. Fields vary by market; unknown ones are kept. */
+export interface SymbolInfo {
+ /** Series ID used by this chart (`ser_1`). */
+ series_id: string;
+ name: string;
+ full_name: string;
+ pro_name: string;
+ description: string;
+ short_description: string;
+ exchange: string;
+ listed_exchange: string;
+ provider_id: string;
+ base_currency?: string;
+ base_currency_id?: string;
+ currency_id: string;
+ currency_code: string;
+ type: string;
+ timezone: string;
+ session: string;
+ session_display?: string;
+ subsession_id?: string;
+ subsessions?: Subsession[];
+ pricescale: number;
+ pointvalue?: number;
+ minmov: number;
+ minmove2?: number;
+ fractional: boolean;
+ has_intraday: boolean;
+ has_adjustment?: boolean;
+ has_extended_hours?: boolean;
+ is_tradable: boolean;
+ is_replayable?: boolean;
+ allowed_adjustment?: string;
+ variable_tick_size?: string;
+ pro_perm?: string;
+ typespecs?: string[];
+ resolutions?: string[];
+ aliases?: string[];
+ alternatives?: string[];
+ [key: string]: unknown;
+}
diff --git a/src/classes/BuiltInIndicator.js b/src/classes/BuiltInIndicator.js
deleted file mode 100644
index 6de9bf7..0000000
--- a/src/classes/BuiltInIndicator.js
+++ /dev/null
@@ -1,139 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-/**
- * @typedef {'Volume@tv-basicstudies-241'
- * | 'VbPFixed@tv-basicstudies-241'
- * | 'VbPFixed@tv-basicstudies-241!'
- * | 'VbPFixed@tv-volumebyprice-53!'
- * | 'VbPSessions@tv-volumebyprice-53'
- * | 'VbPSessionsRough@tv-volumebyprice-53!'
- * | 'VbPSessionsDetailed@tv-volumebyprice-53!'
- * | 'VbPVisible@tv-volumebyprice-53'} BuiltInIndicatorType Built-in indicator type
- */
-
-/**
- * @typedef {'rowsLayout' | 'rows' | 'volume'
- * | 'vaVolume' | 'subscribeRealtime'
- * | 'first_bar_time' | 'first_visible_bar_time'
- * | 'last_bar_time' | 'last_visible_bar_time'
- * | 'extendPocRight'} BuiltInIndicatorOption Built-in indicator Option
- */
-
-const defaultValues = {
- 'Volume@tv-basicstudies-241': {
- length: 20,
- col_prev_close: false,
- },
- 'VbPFixed@tv-basicstudies-241': {
- rowsLayout: 'Number Of Rows',
- rows: 24,
- volume: 'Up/Down',
- vaVolume: 70,
- subscribeRealtime: false,
- first_bar_time: NaN,
- last_bar_time: Date.now(),
- extendToRight: false,
- mapRightBoundaryToBarStartTime: true,
- },
- 'VbPFixed@tv-basicstudies-241!': {
- rowsLayout: 'Number Of Rows',
- rows: 24,
- volume: 'Up/Down',
- vaVolume: 70,
- subscribeRealtime: false,
- first_bar_time: NaN,
- last_bar_time: Date.now(),
- },
- 'VbPFixed@tv-volumebyprice-53!': {
- rowsLayout: 'Number Of Rows',
- rows: 24,
- volume: 'Up/Down',
- vaVolume: 70,
- subscribeRealtime: false,
- first_bar_time: NaN,
- last_bar_time: Date.now(),
- },
- 'VbPSessions@tv-volumebyprice-53': {
- rowsLayout: 'Number Of Rows',
- rows: 24,
- volume: 'Up/Down',
- vaVolume: 70,
- extendPocRight: false,
- },
- 'VbPSessionsRough@tv-volumebyprice-53!': {
- volume: 'Up/Down',
- vaVolume: 70,
- },
- 'VbPSessionsDetailed@tv-volumebyprice-53!': {
- volume: 'Up/Down',
- vaVolume: 70,
- subscribeRealtime: false,
- first_visible_bar_time: NaN,
- last_visible_bar_time: Date.now(),
- },
- 'VbPVisible@tv-volumebyprice-53': {
- rowsLayout: 'Number Of Rows',
- rows: 24,
- volume: 'Up/Down',
- vaVolume: 70,
- subscribeRealtime: false,
- first_visible_bar_time: NaN,
- last_visible_bar_time: Date.now(),
- },
-};
-
-/** @class */
-module.exports = class BuiltInIndicator {
- /** @type {BuiltInIndicatorType} */
- #type;
-
- /** @return {BuiltInIndicatorType} Indicator script */
- get type() {
- return this.#type;
- }
-
- /** @type {Object<string, any>} */
- #options = {};
-
- /** @return {Object<string, any>} Indicator script */
- get options() {
- return this.#options;
- }
-
- /**
- * @param {BuiltInIndicatorType} type Buit-in indocator raw type
- */
- constructor(type = '') {
- if (!type) throw new Error(`Wrong buit-in indicator type "${type}".`);
-
- this.#type = type;
- if (defaultValues[type]) this.#options = { ...defaultValues[type] };
- }
-
- /**
- * Set an option
- * @param {BuiltInIndicatorOption} key The option you want to change
- * @param {*} value The new value of the property
- * @param {boolean} FORCE Ignore type and key verifications
- */
- setOption(key, value, FORCE = false) {
- if (FORCE) {
- this.#options[key] = value;
- return;
- }
-
- if (defaultValues[this.#type] && defaultValues[this.#type][key] !== undefined) {
- const requiredType = typeof defaultValues[this.#type][key];
- const valType = typeof value;
- if (requiredType !== valType) {
- throw new Error(`Wrong '${key}' value type '${valType}' (must be '${requiredType}')`);
- }
- }
-
- if (defaultValues[this.#type] && defaultValues[this.#type][key] === undefined) {
- throw new Error(`Option '${key}' is denied with '${this.#type}' indicator`);
- }
-
- this.#options[key] = value;
- }
-};
diff --git a/src/classes/PineIndicator.js b/src/classes/PineIndicator.js
deleted file mode 100644
index a23c396..0000000
--- a/src/classes/PineIndicator.js
+++ /dev/null
@@ -1,134 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-/**
- * @typedef {Object} IndicatorInput
- * @property {string} name Input name
- * @property {string} inline Input inline name
- * @property {string} [internalID] Input internal ID
- * @property {string} [tooltip] Input tooltip
- * @property {'text' | 'source' | 'integer'
- * | 'float' | 'resolution' | 'bool' | 'color'
- * } type Input type
- * @property {string | number | boolean} value Input default value
- * @property {boolean} isHidden If the input is hidden
- * @property {boolean} isFake If the input is fake
- * @property {string[]} [options] Input options if the input is a select
- */
-
-/**
- * @typedef {Object} Indicator
- * @property {string} pineId Indicator ID
- * @property {string} pineVersion Indicator version
- * @property {string} description Indicator description
- * @property {string} shortDescription Indicator short description
- * @property {Object<string, IndicatorInput>} inputs Indicator inputs
- * @property {Object<string, string>} plots Indicator plots
- * @property {string} script Indicator script
- */
-
-/**
- * @typedef {'Script@tv-scripting-101!'
- * | 'StrategyScript@tv-scripting-101!'} IndicatorType Indicator type
- */
-
-/** @class */
-module.exports = class PineIndicator {
- #options;
-
- /** @type {IndicatorType} */
- #type = 'Script@tv-scripting-101!';
-
- /** @param {Indicator} options Indicator */
- constructor(options) {
- this.#options = options;
- }
-
- /** @return {string} Indicator ID */
- get pineId() {
- return this.#options.pineId;
- }
-
- /** @return {string} Indicator version */
- get pineVersion() {
- return this.#options.pineVersion;
- }
-
- /** @return {string} Indicator description */
- get description() {
- return this.#options.description;
- }
-
- /** @return {string} Indicator short description */
- get shortDescription() {
- return this.#options.shortDescription;
- }
-
- /** @return {Object<string, IndicatorInput>} Indicator inputs */
- get inputs() {
- return this.#options.inputs;
- }
-
- /** @return {Object<string, string>} Indicator plots */
- get plots() {
- return this.#options.plots;
- }
-
- /** @return {IndicatorType} Indicator script */
- get type() {
- return this.#type;
- }
-
- /**
- * Set the indicator type
- * @param {IndicatorType} type Indicator type
- */
- setType(type = 'Script@tv-scripting-101!') {
- this.#type = type;
- }
-
- /** @return {string} Indicator script */
- get script() {
- return this.#options.script;
- }
-
- /**
- * Set an option
- * @param {number | string} key The key can be ID of the property (`in_{ID}`),
- * the inline name or the internalID.
- * @param {*} value The new value of the property
- */
- setOption(key, value) {
- let propI = '';
-
- if (this.#options.inputs[`in_${key}`]) propI = `in_${key}`;
- else if (this.#options.inputs[key]) propI = key;
- else {
- propI = Object.keys(this.#options.inputs).find((I) => (
- this.#options.inputs[I].inline === key
- || this.#options.inputs[I].internalID === key
- ));
- }
-
- if (propI && this.#options.inputs[propI]) {
- const input = this.#options.inputs[propI];
-
- const types = {
- bool: 'Boolean',
- integer: 'Number',
- float: 'Number',
- text: 'String',
- };
-
- // eslint-disable-next-line valid-typeof
- if (types[input.type] && typeof value !== types[input.type].toLowerCase()) {
- throw new Error(`Input '${input.name}' (${propI}) must be a ${types[input.type]} !`);
- }
-
- if (input.options && !input.options.includes(value)) {
- throw new Error(`Input '${input.name}' (${propI}) must be one of these values:`, input.options);
- }
-
- input.value = value;
- } else throw new Error(`Input '${key}' not found (${propI}).`);
- }
-};
diff --git a/src/classes/PinePermManager.js b/src/classes/PinePermManager.js
deleted file mode 100644
index 9a49357..0000000
--- a/src/classes/PinePermManager.js
+++ /dev/null
@@ -1,161 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const axios = require('axios');
-const { genAuthCookies } = require('../utils');
-
-/**
- * @typedef {Object} AuthorizationUser
- * @prop {id} id User id
- * @prop {string} username User's username
- * @prop {string} userpic User's profile picture URL
- * @prop {string} expiration Authorization expiration date
- * @prop {string} created Authorization creation date
- */
-
-/** @class */
-class PinePermManager {
- sessionId;
-
- pineId;
-
- /**
- * Creates a PinePermManager instance
- * @param {string} sessionId Token from `sessionid` cookie
- * @param {string} signature Signature cookie
- * @param {string} pineId Indicator ID (Like: PUB;XXXXXXXXXXXXXXXXXXXXX)
- */
- constructor(sessionId, signature, pineId) {
- if (!sessionId) throw new Error('Please provide a SessionID');
- if (!signature) throw new Error('Please provide a Signature');
- if (!pineId) throw new Error('Please provide a PineID');
- this.sessionId = sessionId;
- this.signature = signature;
- this.pineId = pineId;
- }
-
- /**
- * Get list of authorized users
- * @param {number} limit Fetching limit
- * @param {'user__username'
- * | '-user__username'
- * | 'created' | 'created'
- * | 'expiration,user__username'
- * | '-expiration,user__username'
- * } order Fetching order
- * @returns {Promise<AuthorizationUser[]>}
- */
- async getUsers(limit = 10, order = '-created') {
- try {
- const { data } = await axios.post(
- `https://www.tradingview.com/pine_perm/list_users/?limit=${limit}&order_by=${order}`,
- `pine_id=${this.pineId.replace(/;/g, '%3B')}`,
- {
- headers: {
- origin: 'https://www.tradingview.com',
- 'Content-Type': 'application/x-www-form-urlencoded',
- cookie: genAuthCookies(this.sessionId, this.signature),
- },
- },
- );
-
- return data.results;
- } catch (e) {
- throw new Error(e.response.data.detail || 'Wrong credentials or pineId');
- }
- }
-
- /**
- * Adds an user to the authorized list
- * @param {string} username User's username
- * @param {Date} [expiration] Expiration date
- * @returns {Promise<'ok' | 'exists' | null>}
- */
- async addUser(username, expiration = null) {
- try {
- const { data } = await axios.post(
- 'https://www.tradingview.com/pine_perm/add/',
- `pine_id=${
- this.pineId.replace(/;/g, '%3B')
- }&username_recip=${
- username
- }${
- expiration && expiration instanceof Date
- ? `&expiration=${expiration.toISOString()}`
- : ''
- }`,
- {
- headers: {
- origin: 'https://www.tradingview.com',
- 'Content-Type': 'application/x-www-form-urlencoded',
- cookie: genAuthCookies(this.sessionId, this.signature),
- },
- },
- );
-
- return data.status;
- } catch (e) {
- throw new Error(e.response.data.detail || 'Wrong credentials or pineId');
- }
- }
-
- /**
- * Modify an authorization expiration date
- * @param {string} username User's username
- * @param {Date} [expiration] New expiration date
- * @returns {Promise<'ok' | null>}
- */
- async modifyExpiration(username, expiration = null) {
- try {
- const { data } = await axios.post(
- 'https://www.tradingview.com/pine_perm/modify_user_expiration/',
- `pine_id=${
- this.pineId.replace(/;/g, '%3B')
- }&username_recip=${
- username
- }${
- expiration && expiration instanceof Date
- ? `&expiration=${expiration.toISOString()}`
- : ''
- }`,
- {
- headers: {
- origin: 'https://www.tradingview.com',
- 'Content-Type': 'application/x-www-form-urlencoded',
- cookie: genAuthCookies(this.sessionId, this.signature),
- },
- },
- );
-
- return data.status;
- } catch (e) {
- throw new Error(e.response.data.detail || 'Wrong credentials or pineId');
- }
- }
-
- /**
- * Removes an user to the authorized list
- * @param {string} username User's username
- * @returns {Promise<'ok' | null>}
- */
- async removeUser(username) {
- try {
- const { data } = await axios.post(
- 'https://www.tradingview.com/pine_perm/remove/',
- `pine_id=${this.pineId.replace(/;/g, '%3B')}&username_recip=${username}`,
- {
- headers: {
- origin: 'https://www.tradingview.com',
- 'Content-Type': 'application/x-www-form-urlencoded',
- cookie: genAuthCookies(this.sessionId, this.signature),
- },
- },
- );
-
- return data.status;
- } catch (e) {
- throw new Error(e.response.data.detail || 'Wrong credentials or pineId');
- }
- }
-}
-
-module.exports = PinePermManager;
diff --git a/src/client.js b/src/client.js
deleted file mode 100644
index ad8f18b..0000000
--- a/src/client.js
+++ /dev/null
@@ -1,310 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const WebSocket = require('ws');
-
-const misc = require('./miscRequests');
-const protocol = require('./protocol');
-
-const quoteSessionGenerator = require('./quote/session');
-const chartSessionGenerator = require('./chart/session');
-
-/**
- * @typedef {Object} Session
- * @prop {'quote' | 'chart' | 'replay'} type Session type
- * @prop {(data: {}) => null} onData When there is a data
- */
-
-/** @typedef {Object<string, Session>} SessionList Session list */
-
-/**
- * @callback SendPacket Send a custom packet
- * @param {string} t Packet type
- * @param {string[]} p Packet data
- * @returns {void}
-*/
-
-/**
- * @typedef {Object} ClientBridge
- * @prop {SessionList} sessions
- * @prop {SendPacket} send
- */
-
-/**
- * @typedef { 'connected' | 'disconnected'
- * | 'logged' | 'ping' | 'data'
- * | 'error' | 'event'
- * } ClientEvent
- */
-
-/** @class */
-module.exports = class Client {
- #ws;
-
- #logged = false;
-
- /** If the client is logged in */
- get isLogged() {
- return this.#logged;
- }
-
- /** If the cient was closed */
- get isOpen() {
- return this.#ws.readyState === this.#ws.OPEN;
- }
-
- /** @type {SessionList} */
- #sessions = {};
-
- #callbacks = {
- connected: [],
- disconnected: [],
- logged: [],
- ping: [],
- data: [],
-
- error: [],
- event: [],
- };
-
- /**
- * @param {ClientEvent} ev Client event
- * @param {...{}} data Packet data
- */
- #handleEvent(ev, ...data) {
- this.#callbacks[ev].forEach((e) => e(...data));
- this.#callbacks.event.forEach((e) => e(ev, ...data));
- }
-
- #handleError(...msgs) {
- if (this.#callbacks.error.length === 0) console.error(...msgs);
- else this.#handleEvent('error', ...msgs);
- }
-
- /**
- * When client is connected
- * @param {() => void} cb Callback
- * @event onConnected
- */
- onConnected(cb) {
- this.#callbacks.connected.push(cb);
- }
-
- /**
- * When client is disconnected
- * @param {() => void} cb Callback
- * @event onDisconnected
- */
- onDisconnected(cb) {
- this.#callbacks.disconnected.push(cb);
- }
-
- /**
- * @typedef {Object} SocketSession
- * @prop {string} session_id Socket session ID
- * @prop {number} timestamp Session start timestamp
- * @prop {number} timestampMs Session start milliseconds timestamp
- * @prop {string} release Release
- * @prop {string} studies_metadata_hash Studies metadata hash
- * @prop {'json' | string} protocol Used protocol
- * @prop {string} javastudies Javastudies
- * @prop {number} auth_scheme_vsn Auth scheme type
- * @prop {string} via Socket IP
- */
-
- /**
- * When client is logged
- * @param {(SocketSession: SocketSession) => void} cb Callback
- * @event onLogged
- */
- onLogged(cb) {
- this.#callbacks.logged.push(cb);
- }
-
- /**
- * When server is pinging the client
- * @param {(i: number) => void} cb Callback
- * @event onPing
- */
- onPing(cb) {
- this.#callbacks.ping.push(cb);
- }
-
- /**
- * When unparsed data is received
- * @param {(...{}) => void} cb Callback
- * @event onData
- */
- onData(cb) {
- this.#callbacks.data.push(cb);
- }
-
- /**
- * When a client error happens
- * @param {(...{}) => void} cb Callback
- * @event onError
- */
- onError(cb) {
- this.#callbacks.error.push(cb);
- }
-
- /**
- * When a client event happens
- * @param {(...{}) => void} cb Callback
- * @event onEvent
- */
- onEvent(cb) {
- this.#callbacks.event.push(cb);
- }
-
- #parsePacket(str) {
- if (!this.isOpen) return;
-
- protocol.parseWSPacket(str).forEach((packet) => {
- if (global.TW_DEBUG) console.log('§90§30§107 CLIENT §0 PACKET', packet);
- if (typeof packet === 'number') { // Ping
- this.#ws.send(protocol.formatWSPacket(`~h~${packet}`));
- this.#handleEvent('ping', packet);
- return;
- }
-
- if (packet.m === 'protocol_error') { // Error
- this.#handleError('Client critical error:', packet.p);
- this.#ws.close();
- return;
- }
-
- if (packet.m && packet.p) { // Normal packet
- const parsed = {
- type: packet.m,
- data: packet.p,
- };
-
- const session = packet.p[0];
-
- if (session && this.#sessions[session]) {
- this.#sessions[session].onData(parsed);
- return;
- }
- }
-
- if (!this.#logged) {
- this.#handleEvent('logged', packet);
- return;
- }
-
- this.#handleEvent('data', packet);
- });
- }
-
- #sendQueue = [];
-
- /** @type {SendPacket} Send a custom packet */
- send(t, p = []) {
- this.#sendQueue.push(protocol.formatWSPacket({ m: t, p }));
- this.sendQueue();
- }
-
- /** Send all waiting packets */
- sendQueue() {
- while (this.isOpen && this.#logged && this.#sendQueue.length > 0) {
- const packet = this.#sendQueue.shift();
- this.#ws.send(packet);
- if (global.TW_DEBUG) console.log('§90§30§107 > §0', packet);
- }
- }
-
- /**
- * @typedef {Object} ClientOptions
- * @prop {string} [token] User auth token (in 'sessionid' cookie)
- * @prop {string} [signature] User auth token signature (in 'sessionid_sign' cookie)
- * @prop {boolean} [DEBUG] Enable debug mode
- * @prop {'data' | 'prodata' | 'widgetdata'} [server] Server type
- * @prop {string} [location] Auth page location (For france: https://fr.tradingview.com/)
- * @prop {Object<string, string>} [headers] Custom WebSocket headers
- */
-
- /**
- * Client object
- * @param {ClientOptions} clientOptions TradingView client options
- */
- constructor(clientOptions = {}) {
- if (clientOptions.DEBUG) global.TW_DEBUG = clientOptions.DEBUG;
-
- const server = clientOptions.server || 'data';
- const defaultHeaders = {
- // eslint-disable-next-line max-len
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
- 'Accept-Language': 'en-US,en;q=0.9',
- 'Cache-Control': 'no-cache',
- Pragma: 'no-cache',
- };
-
- this.#ws = new WebSocket(`wss://${server}.tradingview.com/socket.io/websocket?from=chart&type=chart`, {
- origin: 'https://www.tradingview.com',
- headers: { ...defaultHeaders, ...clientOptions.headers },
- });
-
- if (clientOptions.token) {
- misc.getUser(
- clientOptions.token,
- clientOptions.signature ? clientOptions.signature : '',
- clientOptions.location ? clientOptions.location : 'https://tradingview.com',
- ).then((user) => {
- this.#sendQueue.unshift(protocol.formatWSPacket({
- m: 'set_auth_token',
- p: [user.authToken],
- }));
- this.#logged = true;
- this.sendQueue();
- }).catch((err) => {
- this.#handleError('Credentials error:', err.message);
- });
- } else {
- this.#sendQueue.unshift(protocol.formatWSPacket({
- m: 'set_auth_token',
- p: ['unauthorized_user_token'],
- }));
- this.#logged = true;
- this.sendQueue();
- }
-
- this.#ws.on('open', () => {
- this.#handleEvent('connected');
- this.sendQueue();
- });
-
- this.#ws.on('close', () => {
- this.#logged = false;
- this.#handleEvent('disconnected');
- });
-
- this.#ws.on('error', (err) => {
- this.#handleError('WebSocket error:', err.message);
- });
-
- this.#ws.on('message', (data) => this.#parsePacket(data));
- }
-
- /** @type {ClientBridge} */
- #clientBridge = {
- sessions: this.#sessions,
- send: (t, p) => this.send(t, p),
- };
-
- /** @namespace Session */
- Session = {
- Quote: quoteSessionGenerator(this.#clientBridge),
- Chart: chartSessionGenerator(this.#clientBridge),
- };
-
- /**
- * Close the websocket connection
- * @return {Promise<void>} When websocket is closed
- */
- end() {
- return new Promise((cb) => {
- if (this.#ws.readyState) this.#ws.close();
- cb();
- });
- }
-};
diff --git a/src/client/client.ts b/src/client/client.ts
new file mode 100644
index 0000000..d790411
--- /dev/null
+++ b/src/client/client.ts
@@ -0,0 +1,330 @@
+import { TradingViewError, toTradingViewError } from '../errors.js';
+import { Emitter } from '../events.js';
+import { getUser } from '../http/account.js';
+import { DEFAULT_USER_AGENT, type Credentials } from '../http/request.js';
+import {
+ decodeFrames, encodeHeartbeat, encodePacket, type ServerHello, type ServerPacket,
+} from '../protocol/framing.js';
+import { wsTransport, type Transport, type TransportFactory } from './transport.js';
+import { ChartSession } from '../chart/chart-session.js';
+import { QuoteSession, type QuoteSessionOptions } from '../quote/quote-session.js';
+
+/** Websocket server. `prodata` is used by paid accounts, `widgetdata` by widgets. */
+export type ServerName = 'data' | 'prodata' | 'widgetdata' | (string & {});
+
+export type DebugOption = boolean | ((...args: unknown[]) => void);
+
+export interface ClientOptions {
+ /** Account cookies. Without them, the client uses anonymous (delayed/limited) access. */
+ credentials?: Credentials;
+ /** Websocket auth token (`User.authToken`). Skips the account lookup done with `credentials`. */
+ authToken?: string;
+ /** Websocket server. Default: `data`. */
+ server?: ServerName;
+ /** Page used to load the account from `credentials`, e.g. `https://fr.tradingview.com/`. */
+ location?: string;
+ /** Extra websocket headers. */
+ headers?: Record<string, string>;
+ /** Logs packets: `true` uses `console.log`, a function receives the log arguments. */
+ debug?: DebugOption;
+ /** Custom websocket transport (proxies, tests). */
+ transport?: TransportFactory;
+ /** Custom `fetch` for the account lookup. */
+ fetch?: typeof fetch;
+ /** Time allowed to open and authenticate the connection. Default: 20 000 ms. */
+ connectTimeoutMs?: number;
+}
+
+export interface ClientEvents {
+ [event: string]: unknown[];
+ /** The websocket is open. */
+ open: [];
+ /** The server greeting was received. */
+ hello: [hello: ServerHello];
+ /** The auth token was sent; queued packets are now flowing. */
+ ready: [];
+ /** A server heartbeat was received (the client answers automatically). */
+ heartbeat: [id: number];
+ /** A packet not addressed to any session of this client. */
+ packet: [packet: ServerPacket];
+ /** The websocket closed. */
+ close: [code?: number, reason?: string];
+ error: [error: TradingViewError];
+}
+
+/** @internal Implemented by chart, replay and quote sessions. */
+export interface SessionHandler {
+ onPacket(packet: ServerPacket): void;
+ /** `expected` is true when the connection was closed with `client.close()`. */
+ onClose?(error: TradingViewError, expected: boolean): void;
+}
+
+/**
+ * One websocket connection to TradingView. Chart and quote sessions are
+ * multiplexed over it.
+ *
+ * The connection opens immediately; packets are queued until it is open and
+ * authenticated. Always call `close()` when you are done.
+ */
+export class TradingViewClient extends Emitter<ClientEvents> {
+ readonly #transport: Transport;
+
+ readonly #sessions = new Map<string, SessionHandler>();
+
+ readonly #queue: string[] = [];
+
+ readonly #log?: (...args: unknown[]) => void;
+
+ readonly ready: Promise<void>;
+
+ #authenticated = false;
+
+ #authToken?: string;
+
+ #closed = false;
+
+ #closing = false;
+
+ #closeRequested = false;
+
+ #failure?: TradingViewError;
+
+ #hello?: ServerHello;
+
+ #resolveReady!: () => void;
+
+ #rejectReady!: (error: TradingViewError) => void;
+
+ #readyTimer?: ReturnType<typeof setTimeout>;
+
+ #closeWaiters: Array<() => void> = [];
+
+ constructor(options: ClientOptions = {}) {
+ super();
+ if (options.debug === true) this.#log = (...args) => console.log('[tradingview]', ...args);
+ else if (typeof options.debug === 'function') this.#log = options.debug;
+
+ this.ready = new Promise<void>((resolve, reject) => {
+ this.#resolveReady = resolve;
+ this.#rejectReady = reject;
+ });
+ this.ready.catch(() => { /* Surfaced through the error event too. */ });
+
+ const timeout = options.connectTimeoutMs ?? 20_000;
+ this.#readyTimer = setTimeout(() => {
+ this.#fail(new TradingViewError('TIMEOUT', `Connection not ready after ${timeout} ms`));
+ }, timeout);
+
+ const server = options.server ?? 'data';
+ const factory = options.transport ?? wsTransport;
+ this.#transport = factory({
+ url: `wss://${server}.tradingview.com/socket.io/websocket?from=chart&type=chart`,
+ origin: 'https://www.tradingview.com',
+ headers: {
+ 'User-Agent': DEFAULT_USER_AGENT,
+ 'Accept-Language': 'en-US,en;q=0.9',
+ 'Cache-Control': 'no-cache',
+ Pragma: 'no-cache',
+ ...options.headers,
+ },
+ }, {
+ onOpen: () => this.#onOpen(),
+ onMessage: (data) => this.#onMessage(data),
+ onClose: (code, reason) => this.#onClose(code, reason),
+ onError: (error) => {
+ if (this.#closing) return;
+ this.#fail(new TradingViewError('CONNECTION_ERROR', `WebSocket error: ${error.message}`, { cause: error }));
+ },
+ });
+
+ if (options.authToken) {
+ this.#authToken = options.authToken;
+ } else if (options.credentials?.session) {
+ getUser(options.credentials, { location: options.location, fetch: options.fetch })
+ .then((user) => {
+ if (this.#closed) return;
+ this.#authToken = user.authToken;
+ this.#authenticate();
+ })
+ .catch((error) => {
+ this.#fail(new TradingViewError('AUTH_ERROR', `Credentials error: ${toTradingViewError(error).message}`, {
+ cause: error,
+ }));
+ });
+ } else {
+ this.#authToken = 'unauthorized_user_token';
+ }
+ }
+
+ /** True while the websocket is open. */
+ get isOpen(): boolean {
+ return !this.#closed && this.#transport.isOpen;
+ }
+
+ /** True once the auth token has been sent. */
+ get isAuthenticated(): boolean {
+ return this.#authenticated;
+ }
+
+ /** True after `close()` or a disconnection. */
+ get isClosed(): boolean {
+ return this.#closed;
+ }
+
+ /** Server greeting, once received. */
+ get serverInfo(): ServerHello | undefined {
+ return this.#hello;
+ }
+
+ /** Creates a chart session on this connection. */
+ createChart(): ChartSession {
+ return new ChartSession(this);
+ }
+
+ /** Creates a quote session on this connection. */
+ createQuoteSession(options: QuoteSessionOptions = {}): QuoteSession {
+ return new QuoteSession(this, options);
+ }
+
+ /**
+ * Sends a raw packet. Packets are queued until the connection is ready.
+ * Prefer session methods; this is an escape hatch for unsupported commands.
+ */
+ send(method: string, params: readonly unknown[] = []): void {
+ if (this.#closed) {
+ throw new TradingViewError('INVALID_STATE', `Cannot send '${method}': the client is closed`);
+ }
+ this.#queue.push(encodePacket(method, params));
+ this.#flush();
+ }
+
+ /** @internal Registers a session to receive its packets. */
+ registerSession(id: string, handler: SessionHandler): void {
+ this.#sessions.set(id, handler);
+ }
+
+ /** @internal */
+ unregisterSession(id: string): void {
+ this.#sessions.delete(id);
+ }
+
+ /** @internal Debug logger shared with sessions. */
+ log(...args: unknown[]): void {
+ this.#log?.(...args);
+ }
+
+ /** Closes the connection. Resolves once the websocket is closed. Idempotent. */
+ close(): Promise<void> {
+ if (this.#closed) return Promise.resolve();
+ return new Promise<void>((resolve) => {
+ this.#closeWaiters.push(resolve);
+ this.#closeRequested = true;
+ if (this.#closing) return;
+ this.#closing = true;
+ // Do not hang if the server never acknowledges the close.
+ setTimeout(() => this.#onClose(1000, 'Close timeout'), 3_000).unref?.();
+ this.#transport.close();
+ });
+ }
+
+ #onOpen(): void {
+ this.#log?.('open');
+ this.emit('open');
+ this.#authenticate();
+ }
+
+ #authenticate(): void {
+ if (this.#authenticated || !this.#authToken || !this.#transport.isOpen || this.#closing) return;
+ this.#transport.send(encodePacket('set_auth_token', [this.#authToken]));
+ this.#authenticated = true;
+ clearTimeout(this.#readyTimer);
+ this.#resolveReady();
+ this.emit('ready');
+ this.#flush();
+ }
+
+ #flush(): void {
+ while (this.#authenticated && this.#transport.isOpen && this.#queue.length > 0) {
+ const packet = this.#queue.shift() as string;
+ this.#log?.('send', packet);
+ this.#transport.send(packet);
+ }
+ }
+
+ #onMessage(data: string): void {
+ if (this.#closed) return;
+ for (const frame of decodeFrames(data)) {
+ if (frame.type === 'heartbeat') {
+ if (this.#transport.isOpen) this.#transport.send(encodeHeartbeat(frame.id));
+ this.emit('heartbeat', frame.id);
+ continue;
+ }
+ if (frame.type === 'invalid') {
+ this.#log?.('invalid frame', frame.raw);
+ continue;
+ }
+ if (frame.type === 'data') {
+ this.#log?.('data', frame.data);
+ const hello = frame.data as ServerHello;
+ if (hello && typeof hello === 'object' && 'session_id' in hello) {
+ this.#hello = hello;
+ this.emit('hello', hello);
+ }
+ continue;
+ }
+
+ const { packet } = frame;
+ this.#log?.('packet', packet);
+ if (packet.m === 'protocol_error') {
+ this.emit('error', new TradingViewError('PROTOCOL_ERROR', `Protocol error: ${String(packet.p[0] ?? '')}`, {
+ details: packet.p,
+ }));
+ this.#transport.close();
+ continue;
+ }
+
+ const sessionId = packet.p[0];
+ const session = typeof sessionId === 'string' ? this.#sessions.get(sessionId) : undefined;
+ if (session) session.onPacket(packet);
+ else this.emit('packet', packet);
+ }
+ }
+
+ #fail(error: TradingViewError): void {
+ if (this.#closed) return;
+ clearTimeout(this.#readyTimer);
+ const wasReady = this.#authenticated;
+ this.#failure ??= error;
+ this.#rejectReady(error);
+ // Before readiness, `ready` rejects with this error: only notify explicit listeners.
+ if (wasReady || this.hasListeners('error')) this.emit('error', error);
+ if (!wasReady || error.code === 'AUTH_ERROR' || error.code === 'CONNECTION_ERROR') {
+ this.#closing = true;
+ this.#transport.close();
+ // Some transports never emit close after a failed handshake.
+ setTimeout(() => this.#onClose(undefined, error.message), 3_000).unref?.();
+ }
+ }
+
+ #onClose(code?: number, reason?: string): void {
+ if (this.#closed) return;
+ this.#closed = true;
+ this.#authenticated = false;
+ clearTimeout(this.#readyTimer);
+ this.#log?.('close', code, reason);
+
+ const cause = this.#failure;
+ const why = cause?.message ?? reason;
+ const error = new TradingViewError('DISCONNECTED', `Connection closed${why ? `: ${why}` : ''}`, {
+ details: { code, reason },
+ cause,
+ });
+ this.#rejectReady(error);
+ for (const session of [...this.#sessions.values()]) session.onClose?.(error, this.#closeRequested);
+ this.#sessions.clear();
+ this.#queue.length = 0;
+
+ this.emit('close', code, reason);
+ for (const resolve of this.#closeWaiters.splice(0)) resolve();
+ }
+}
diff --git a/src/client/index.ts b/src/client/index.ts
new file mode 100644
index 0000000..8c239ab
--- /dev/null
+++ b/src/client/index.ts
@@ -0,0 +1,8 @@
+export { TradingViewClient } from './client.js';
+export type {
+ ClientEvents, ClientOptions, DebugOption, ServerName, SessionHandler,
+} from './client.js';
+export { wsTransport } from './transport.js';
+export type {
+ Transport, TransportFactory, TransportHandlers, TransportRequest,
+} from './transport.js';
diff --git a/src/client/transport.ts b/src/client/transport.ts
new file mode 100644
index 0000000..a9872d4
--- /dev/null
+++ b/src/client/transport.ts
@@ -0,0 +1,64 @@
+import WebSocket from 'ws';
+
+/** Callbacks a transport must call. */
+export interface TransportHandlers {
+ onOpen(): void;
+ onMessage(data: string): void;
+ onClose(code?: number, reason?: string): void;
+ onError(error: Error): void;
+}
+
+/** Minimal websocket abstraction used by `TradingViewClient`. */
+export interface Transport {
+ /** True when the connection is open and can send. */
+ readonly isOpen: boolean;
+ send(data: string): void;
+ /** Starts a graceful close. `onClose` must be called once closed. */
+ close(): void;
+}
+
+export interface TransportRequest {
+ url: string;
+ origin: string;
+ headers: Record<string, string>;
+}
+
+/**
+ * Creates a transport. The default uses the `ws` package (Node and Bun).
+ * Provide your own to use a proxy, another websocket library or a test double.
+ */
+export type TransportFactory = (request: TransportRequest, handlers: TransportHandlers) => Transport;
+
+function toText(data: WebSocket.RawData): string {
+ if (typeof data === 'string') return data;
+ if (Array.isArray(data)) return Buffer.concat(data).toString('utf8');
+ if (data instanceof ArrayBuffer) return Buffer.from(data).toString('utf8');
+ return data.toString('utf8');
+}
+
+/** Default transport based on the `ws` package. */
+export const wsTransport: TransportFactory = (request, handlers) => {
+ // Bun's `ws` implementation ignores the `origin` option: also send it as a header.
+ const socket = new WebSocket(request.url, {
+ origin: request.origin,
+ headers: { Origin: request.origin, ...request.headers },
+ });
+ socket.on('open', () => handlers.onOpen());
+ socket.on('message', (data) => handlers.onMessage(toText(data)));
+ socket.on('close', (code, reason) => handlers.onClose(code, reason.toString()));
+ socket.on('error', (error) => handlers.onError(error));
+
+ return {
+ get isOpen() {
+ return socket.readyState === WebSocket.OPEN;
+ },
+ send(data) {
+ socket.send(data);
+ },
+ close() {
+ if (socket.readyState === WebSocket.CLOSED) return;
+ if (socket.readyState === WebSocket.CONNECTING) socket.terminate();
+ else socket.close();
+ },
+ };
+};
diff --git a/src/data/candles.ts b/src/data/candles.ts
new file mode 100644
index 0000000..7af4358
--- /dev/null
+++ b/src/data/candles.ts
@@ -0,0 +1,140 @@
+import type { Candle, SymbolInfo } from '../chart/types.js';
+import { TradingViewError } from '../errors.js';
+import type { CandleSourceWorker, MarketDataProvider } from './provider.js';
+import {
+ loadHistory, noDataError, openMarket, planHistory, selectCandles,
+ type ChartQuery, type RangeQuery,
+} from './history.js';
+import {
+ runOperation, startWatcher, type OperationOptions, type WatchHandlers, type Watcher,
+} from './operation.js';
+
+export interface CandleQuery extends ChartQuery, RangeQuery, OperationOptions {}
+
+/**
+ * Fetches candles once, oldest first, then releases every resource.
+ *
+ * - `{ symbol, timeframe, count }`: the `count` most recent bars (deep history
+ * is loaded automatically when `count` exceeds one server batch).
+ * - `{ symbol, timeframe, from, to }`: every bar in the range.
+ *
+ * @example
+ * const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '60', count: 500 });
+ */
+export function getCandles(query: CandleQuery | string, provider?: MarketDataProvider): Promise<Candle[]> {
+ const options: CandleQuery = typeof query === 'string' ? { symbol: query } : query;
+ let plan: ReturnType<typeof planHistory>;
+ try {
+ plan = planHistory(options);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ if (provider) {
+ return (async () => {
+ let snapshot: readonly Candle[] = [];
+ const worker = await provider.watchCandles(options, {
+ onData: (candles) => { snapshot = candles; },
+ });
+ try {
+ return [...(snapshot.length ? snapshot : worker.latest)];
+ } finally {
+ await worker.stop();
+ }
+ })();
+ }
+
+ return runOperation<Candle[]>(options, `getCandles(${plan.symbol})`, ({ client, resolve, reject }) => {
+ const chart = client.createChart();
+ chart.on('error', reject);
+ loadHistory(chart, plan, true, (info) => {
+ const candles = selectCandles(chart.candles, plan);
+ if (candles.length === 0) reject(noDataError(plan.symbol, info));
+ else resolve(candles);
+ });
+ openMarket(chart, plan);
+ return () => chart.delete();
+ });
+}
+
+export type WatchCandlesQuery = ChartQuery & OperationOptions;
+
+export interface CandleHandlers extends WatchHandlers {
+ /** Receives a fresh immutable snapshot (oldest first) on every update. */
+ onData(candles: readonly Candle[]): void;
+}
+
+export interface CandleWatcher extends Watcher {
+ /** Latest snapshot, oldest first (at most `count` bars). */
+ readonly latest: readonly Candle[];
+ /** Symbol metadata. */
+ readonly symbolInfo: SymbolInfo | undefined;
+}
+
+/**
+ * Streams candles in real time. Resolves once the initial history is loaded
+ * (and already passed to `onData`); call `stop()` when finished.
+ *
+ * @example
+ * const watcher = await watchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '1' }, {
+ * onData: (candles) => console.log(candles.at(-1)?.close),
+ * });
+ * await watcher.stop();
+ */
+export function watchCandles(query: WatchCandlesQuery, handlers: CandleHandlers): Promise<CandleWatcher>;
+export function watchCandles(
+ query: WatchCandlesQuery, handlers: CandleHandlers, provider: MarketDataProvider,
+): Promise<CandleSourceWorker>;
+export function watchCandles(
+ query: WatchCandlesQuery, handlers: CandleHandlers, provider?: MarketDataProvider,
+): Promise<CandleWatcher | CandleSourceWorker> {
+ let plan: ReturnType<typeof planHistory>;
+ try {
+ if (typeof handlers?.onData !== 'function') throw new TradingViewError('INVALID_ARGUMENT', 'onData must be a function');
+ plan = planHistory({ ...query, from: undefined, to: undefined });
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ if (provider) return provider.watchCandles(query, handlers);
+
+ let latest: readonly Candle[] = Object.freeze([]);
+ let symbolInfo: SymbolInfo | undefined;
+
+ return startWatcher(query, `watchCandles(${plan.symbol})`, handlers, (ctx) => {
+ const chart = ctx.client.createChart();
+ let started = false;
+
+ const publish = () => {
+ latest = Object.freeze(selectCandles(chart.candles, plan).map((candle) => Object.freeze({ ...candle })));
+ try {
+ handlers.onData(latest);
+ } catch (error) {
+ ctx.warn(new TradingViewError('CALLBACK_ERROR', 'onData callback threw', { cause: error }));
+ }
+ };
+
+ chart.on('error', (error) => ctx.fail(error));
+ chart.on('symbolLoaded', (info) => { symbolInfo = info; });
+ chart.on('update', (changes) => {
+ if (started && ctx.isActive() && changes.includes('$prices')) publish();
+ });
+ loadHistory(chart, plan, false, (info) => {
+ if (chart.candles.length === 0) {
+ ctx.fail(noDataError(plan.symbol, info));
+ return;
+ }
+ started = true;
+ publish();
+ ctx.ready();
+ });
+ openMarket(chart, plan);
+ return () => chart.delete();
+ }, (base) => ({
+ stop: base.stop,
+ closed: base.closed,
+ get isActive() { return base.isActive; },
+ get latest() { return latest; },
+ get symbolInfo() { return symbolInfo; },
+ }));
+}
diff --git a/src/data/history.ts b/src/data/history.ts
new file mode 100644
index 0000000..67614fb
--- /dev/null
+++ b/src/data/history.ts
@@ -0,0 +1,165 @@
+import type { ChartSession, MarketOptions, SeriesCompletedInfo } from '../chart/chart-session.js';
+import { timeframeSeconds } from '../chart/timeframes.js';
+import type {
+ Adjustment, Candle, ChartType, ChartTypeInputs, Timeframe, Timezone, TradingSession,
+} from '../chart/types.js';
+import { TradingViewError } from '../errors.js';
+import { toUnixSeconds, validateSymbol } from './operation.js';
+
+/** Chart settings shared by candle and indicator queries. */
+export interface ChartQuery {
+ /** Exchange-qualified symbol, e.g. `BINANCE:BTCUSDT`. */
+ symbol: string;
+ /** Bar resolution (`1`, `15`, `60`, `240`, `D`, `W`, `M`, `1S`...). Default: `D`. */
+ timeframe?: Timeframe;
+ /** Number of most recent bars. Default: 100. */
+ count?: number;
+ /** Custom bar type: `HeikinAshi`, `Renko`, `LineBreak`, `Kagi`, `PointAndFigure` or `Range`. */
+ chartType?: ChartType;
+ /** Inputs for `chartType`. */
+ chartInputs?: ChartTypeInputs;
+ /** Convert prices to this currency, e.g. `EUR`. */
+ currency?: string;
+ /** `regular` or `extended` trading session. */
+ session?: TradingSession;
+ /** Price adjustment. Default: `splits`. */
+ adjustment?: Adjustment;
+ /** Back-adjust continuous futures contracts. */
+ backAdjustment?: boolean;
+ /** Chart timezone (affects how daily and longer bars are aligned). */
+ timezone?: Timezone;
+}
+
+/** Historical range options. */
+export interface RangeQuery {
+ /**
+ * Oldest bar time (Date or Unix seconds). When set, history is loaded back
+ * to this time (deep history) and `count` is ignored.
+ */
+ from?: number | Date;
+ /** Newest bar time (Date or Unix seconds). Default: now. */
+ to?: number | Date;
+ /** Safety cap on bars loaded for a `from` range. Default: 20 000. */
+ maxCount?: number;
+}
+
+export interface HistoryPlan {
+ symbol: string;
+ market: MarketOptions;
+ timezone?: Timezone;
+ count: number;
+ from?: number;
+ to?: number;
+ maxCount: number;
+}
+
+const MAX_CHUNK = 5_000;
+
+function positiveInteger(value: number | undefined, name: string, fallback: number): number {
+ const result = value ?? fallback;
+ if (!Number.isInteger(result) || result < 1) {
+ throw new TradingViewError('INVALID_ARGUMENT', `${name} must be a positive integer`);
+ }
+ return result;
+}
+
+/** Validates a query and computes how many bars to request first. */
+export function planHistory(query: ChartQuery & RangeQuery): HistoryPlan {
+ const symbol = validateSymbol(query.symbol);
+ const count = positiveInteger(query.count, 'count', 100);
+ const maxCount = positiveInteger(query.maxCount, 'maxCount', 20_000);
+ const from = toUnixSeconds(query.from, 'from');
+ const to = toUnixSeconds(query.to, 'to');
+ if (from !== undefined && to !== undefined && from > to) {
+ throw new TradingViewError('INVALID_ARGUMENT', 'from must be before to');
+ }
+ const timeframe = query.timeframe ?? 'D';
+
+ let initial = Math.min(count, MAX_CHUNK);
+ if (from !== undefined) {
+ const step = timeframeSeconds(timeframe);
+ const end = to ?? Math.floor(Date.now() / 1000);
+ initial = step ? Math.ceil((end - from) / step) + 2 : 1_000;
+ initial = Math.max(1, Math.min(initial, maxCount, MAX_CHUNK));
+ }
+
+ return {
+ symbol,
+ count,
+ from,
+ to,
+ maxCount,
+ timezone: query.timezone,
+ market: {
+ timeframe,
+ count: initial,
+ to,
+ type: query.chartType,
+ inputs: query.chartInputs,
+ currency: query.currency,
+ session: query.session,
+ adjustment: query.adjustment,
+ backAdjustment: query.backAdjustment,
+ },
+ };
+}
+
+/** Selects the requested bars from everything loaded on a chart. */
+export function selectCandles(candles: Candle[], plan: Pick<HistoryPlan, 'from' | 'to' | 'count'>): Candle[] {
+ let result = candles;
+ if (plan.to !== undefined) result = result.filter((candle) => candle.time <= (plan.to as number));
+ if (plan.from !== undefined) return result.filter((candle) => candle.time >= (plan.from as number));
+ return result.slice(-plan.count);
+}
+
+/** Opens the market on a chart according to a plan. */
+export function openMarket(chart: ChartSession, plan: HistoryPlan): void {
+ if (plan.timezone) chart.setTimezone(plan.timezone);
+ chart.setMarket(plan.symbol, plan.market);
+}
+
+/**
+ * Loads history: after each `series_completed`, requests more bars until the
+ * plan is satisfied or the server has no more data. `onDone` receives the
+ * last completion info.
+ */
+export function loadHistory(
+ chart: ChartSession,
+ plan: HistoryPlan,
+ deep: boolean,
+ onDone: (info: SeriesCompletedInfo) => void,
+): () => void {
+ let previousSize = -1;
+ let done = false;
+
+ return chart.on('seriesCompleted', (info) => {
+ if (done) return;
+ const candles = chart.candles;
+ const inRange = plan.to === undefined ? candles : candles.filter((c) => c.time <= (plan.to as number));
+ const target = plan.from !== undefined ? plan.maxCount : plan.count;
+ const satisfied = plan.from !== undefined
+ ? (inRange[0] !== undefined && inRange[0].time <= plan.from)
+ : inRange.length >= plan.count;
+ const exhausted = info.dataCompleted !== undefined || candles.length <= previousSize;
+
+ if (!deep || satisfied || exhausted || candles.length >= target) {
+ done = true;
+ onDone(info);
+ return;
+ }
+
+ previousSize = candles.length;
+ const missing = plan.from !== undefined ? MAX_CHUNK : plan.count - inRange.length;
+ chart.fetchMore(Math.max(1, Math.min(missing, MAX_CHUNK, target - candles.length)));
+ });
+}
+
+/** Error for an empty result, with the server's reason when known. */
+export function noDataError(symbol: string, info?: SeriesCompletedInfo): TradingViewError {
+ const reason = info?.dataCompleted === 'limit'
+ ? ' (the server reported an access limit: this range or timeframe may need an account with access)'
+ : '';
+ return new TradingViewError('NO_DATA', `No candles available for ${symbol} in the requested range${reason}`, {
+ details: info?.raw,
+ });
+}
diff --git a/src/data/index.ts b/src/data/index.ts
new file mode 100644
index 0000000..d381f95
--- /dev/null
+++ b/src/data/index.ts
@@ -0,0 +1,45 @@
+/**
+ * High-level data API: one-shot functions and watchers that manage
+ * connections, sessions, timeouts and cleanup for you.
+ *
+ * @module @mathieuc/tradingview/data
+ */
+export { getCandles, watchCandles } from './candles.js';
+export type {
+ CandleHandlers, CandleQuery, CandleWatcher, WatchCandlesQuery,
+} from './candles.js';
+export { TradingViewProvider } from './provider.js';
+export type { CandleSourceWorker, MarketDataProvider } from './provider.js';
+export { getQuote, getQuotes, watchQuotes } from './quotes.js';
+export type {
+ QuoteHandlers, QuoteOptions, QuoteQuery, QuotesQuery, QuoteWatcher,
+} from './quotes.js';
+export { getSymbolInfo } from './symbols.js';
+export type { SymbolInfoQuery } from './symbols.js';
+export { getIndicatorData, watchIndicator } from './indicators.js';
+export type {
+ IndicatorData, IndicatorHandlers, IndicatorQuery, IndicatorWatcher,
+} from './indicators.js';
+export type { ChartQuery, RangeQuery } from './history.js';
+export { DEFAULT_TIMEOUT_MS } from './operation.js';
+export type {
+ ConnectionOptions, OperationOptions, WatchHandlers, Watcher,
+} from './operation.js';
+
+// Plain HTTP lookups are already one-shot; they are part of the data API too.
+export {
+ getTechnicalAnalysis, searchIndicators, searchMarkets,
+} from '../http/index.js';
+export type {
+ Credentials, IndicatorSearchResult, MarketSearchResult, SearchMarketsOptions, TechnicalAnalysis, TechnicalRating,
+} from '../http/index.js';
+
+export { TradingViewError } from '../errors.js';
+export type { TradingViewErrorCode } from '../errors.js';
+export type {
+ Candle, ChartType, ChartTypeInputs, SymbolInfo, Timeframe, Timezone,
+} from '../chart/types.js';
+export type { QuoteData, QuoteField } from '../quote/fields.js';
+export type { StudyValue } from '../chart/study.js';
+export type { GraphicsData } from '../chart/graphics.js';
+export type { StrategyReport } from '../chart/strategy.js';
diff --git a/src/data/indicators.ts b/src/data/indicators.ts
new file mode 100644
index 0000000..fc2af9b
--- /dev/null
+++ b/src/data/indicators.ts
@@ -0,0 +1,198 @@
+import type { ChartSession } from '../chart/chart-session.js';
+import type { GraphicsData } from '../chart/graphics.js';
+import type { StrategyReport } from '../chart/strategy.js';
+import type { Study, StudyValue } from '../chart/study.js';
+import type { Candle } from '../chart/types.js';
+import { TradingViewError, toTradingViewError } from '../errors.js';
+import { getIndicator } from '../http/indicators.js';
+import { BuiltInIndicator } from '../indicators/builtin-indicator.js';
+import type { Indicator } from '../indicators/index.js';
+import { PineIndicator } from '../indicators/pine-indicator.js';
+import {
+ loadHistory, noDataError, openMarket, planHistory, selectCandles,
+ type ChartQuery, type HistoryPlan,
+} from './history.js';
+import {
+ runOperation, startWatcher, throwIfAborted, type OperationOptions, type WatchHandlers, type Watcher,
+} from './operation.js';
+
+export interface IndicatorQuery extends ChartQuery, OperationOptions {
+ /**
+ * Indicator to run: a script ID (`STD;RSI`, `PUB;xxxx`, `USER;xxxx`), a
+ * built-in study type (`Volume@tv-basicstudies-241`), or an instance.
+ */
+ indicator: string | Indicator;
+ /** Script version when `indicator` is a script ID. Default: `last`. */
+ version?: string;
+ /** Input values (Pine) or options (built-in) to apply. */
+ inputs?: Record<string, unknown>;
+ /** Newest bar time (Date or Unix seconds). Default: now. */
+ to?: number | Date;
+}
+
+export interface IndicatorData {
+ indicator: Indicator;
+ /** Chart bars, oldest first. */
+ candles: Candle[];
+ /**
+ * Plot values, oldest first. The server may compute a few rows before the
+ * first returned candle.
+ */
+ values: StudyValue[];
+ /** Drawings (labels, lines, boxes, tables...). */
+ graphics: GraphicsData;
+ /** Strategy report (strategies only; otherwise empty). */
+ strategyReport: StrategyReport;
+}
+
+/** Resolves an indicator ID or instance and applies inputs. */
+export async function resolveIndicator(query: IndicatorQuery): Promise<Indicator> {
+ const { indicator, inputs } = query;
+ let resolved: Indicator;
+ if (indicator instanceof PineIndicator) resolved = indicator.clone();
+ else if (indicator instanceof BuiltInIndicator) resolved = new BuiltInIndicator(indicator.type, indicator.options);
+ else if (typeof indicator === 'string' && indicator.trim()) {
+ resolved = indicator.includes('@')
+ ? new BuiltInIndicator(indicator)
+ : await getIndicator(indicator, {
+ version: query.version,
+ credentials: query.credentials,
+ signal: query.signal,
+ fetch: query.clientOptions?.fetch,
+ });
+ } else {
+ throw new TradingViewError('INVALID_ARGUMENT', 'indicator must be a script ID, a built-in type or an indicator instance');
+ }
+
+ for (const [key, value] of Object.entries(inputs ?? {})) {
+ if (resolved instanceof PineIndicator) resolved.setInput(key, value);
+ else resolved.setOption(key, value);
+ }
+ return resolved;
+}
+
+function snapshot(chart: ChartSession, study: Study, plan: HistoryPlan): IndicatorData {
+ return {
+ indicator: study.indicator,
+ candles: selectCandles(chart.candles, plan),
+ values: study.values,
+ graphics: study.graphics,
+ strategyReport: structuredClone(study.strategyReport),
+ };
+}
+
+/**
+ * Runs history loading and the study together; calls `onReady` once both
+ * the bars and the study computation are complete.
+ */
+function trackReadiness(
+ chart: ChartSession,
+ study: Study,
+ plan: HistoryPlan,
+ deep: boolean,
+ onReady: () => void,
+ onEmpty: (error: TradingViewError) => void,
+): void {
+ let historyDone = false;
+ let studyLoading = true;
+ let fired = false;
+ const check = () => {
+ if (fired || !historyDone || studyLoading) return;
+ fired = true;
+ onReady();
+ };
+ study.on('loading', () => { studyLoading = true; });
+ study.on('ready', () => { studyLoading = false; check(); });
+ loadHistory(chart, plan, deep, (info) => {
+ if (chart.candles.length === 0) {
+ fired = true;
+ onEmpty(noDataError(plan.symbol, info));
+ return;
+ }
+ historyDone = true;
+ check();
+ });
+}
+
+function prepare(query: IndicatorQuery): HistoryPlan {
+ return planHistory({ ...query, from: undefined });
+}
+
+/**
+ * Runs an indicator or strategy once and returns its values, drawings and
+ * strategy report.
+ *
+ * @example
+ * const { values } = await getIndicatorData({ symbol: 'BINANCE:BTCUSDT', indicator: 'STD;RSI' });
+ */
+export async function getIndicatorData(query: IndicatorQuery): Promise<IndicatorData> {
+ const plan = prepare(query);
+ throwIfAborted(query.signal);
+ const indicator = await resolveIndicator(query).catch((error) => {
+ throw toTradingViewError(error, 'NOT_FOUND');
+ });
+
+ return runOperation<IndicatorData>(query, `getIndicatorData(${plan.symbol})`, ({ client, resolve, reject }) => {
+ const chart = client.createChart();
+ chart.on('error', reject);
+ openMarket(chart, plan);
+ const study = chart.createStudy(indicator);
+ study.on('error', reject);
+ trackReadiness(chart, study, plan, true, () => resolve(snapshot(chart, study, plan)), reject);
+ return () => chart.delete();
+ });
+}
+
+export interface IndicatorHandlers extends WatchHandlers {
+ /** Receives a fresh result on every study update. */
+ onData(data: IndicatorData): void;
+}
+
+export interface IndicatorWatcher extends Watcher {
+ /** Latest result. */
+ readonly latest: IndicatorData | undefined;
+}
+
+/** Streams an indicator in real time. Call `stop()` when finished. */
+export async function watchIndicator(query: IndicatorQuery, handlers: IndicatorHandlers): Promise<IndicatorWatcher> {
+ if (typeof handlers?.onData !== 'function') throw new TradingViewError('INVALID_ARGUMENT', 'onData must be a function');
+ const plan = prepare({ ...query, to: undefined });
+ throwIfAborted(query.signal);
+ const indicator = await resolveIndicator(query).catch((error) => {
+ throw toTradingViewError(error, 'NOT_FOUND');
+ });
+
+ let latest: IndicatorData | undefined;
+
+ return startWatcher(query, `watchIndicator(${plan.symbol})`, handlers, (ctx) => {
+ const chart = ctx.client.createChart();
+ let started = false;
+ const publish = () => {
+ latest = snapshot(chart, study, plan);
+ try {
+ handlers.onData(latest);
+ } catch (error) {
+ ctx.warn(new TradingViewError('CALLBACK_ERROR', 'onData callback threw', { cause: error }));
+ }
+ };
+
+ chart.on('error', (error) => ctx.fail(error));
+ openMarket(chart, plan);
+ const study = chart.createStudy(indicator);
+ study.on('error', (error) => ctx.fail(error));
+ study.on('update', () => {
+ if (started && ctx.isActive()) publish();
+ });
+ trackReadiness(chart, study, plan, false, () => {
+ started = true;
+ publish();
+ ctx.ready();
+ }, (error) => ctx.fail(error));
+ return () => chart.delete();
+ }, (base) => ({
+ stop: base.stop,
+ closed: base.closed,
+ get isActive() { return base.isActive; },
+ get latest() { return latest; },
+ }));
+}
diff --git a/src/data/operation.ts b/src/data/operation.ts
new file mode 100644
index 0000000..2de0e46
--- /dev/null
+++ b/src/data/operation.ts
@@ -0,0 +1,287 @@
+import { TradingViewClient, type ClientOptions } from '../client/client.js';
+import { TradingViewError, toTradingViewError } from '../errors.js';
+import type { Credentials } from '../http/request.js';
+
+/** How high-level functions connect to TradingView. */
+export interface ConnectionOptions {
+ /**
+ * Reuse an existing connection. It is left open afterwards; only the
+ * sessions created by the call are removed. Without it, each call opens and
+ * closes its own connection.
+ */
+ client?: TradingViewClient;
+ /** Account cookies, for data your account can access. Ignored with `client`. */
+ credentials?: Credentials;
+ /** Other options for the connection opened by the call. Ignored with `client`. */
+ clientOptions?: Omit<ClientOptions, 'credentials'>;
+}
+
+export interface OperationOptions extends ConnectionOptions {
+ /**
+ * Maximum wait in milliseconds. One-shot functions: for the whole call.
+ * Watchers: until the first data. Default: 15 000.
+ */
+ timeoutMs?: number;
+ /** Cancels the call (and stops a watcher). */
+ signal?: AbortSignal;
+}
+
+export const DEFAULT_TIMEOUT_MS = 15_000;
+
+function abortError(signal: AbortSignal): TradingViewError {
+ const { reason } = signal;
+ const message = reason instanceof Error ? reason.message : reason ? String(reason) : 'Aborted';
+ return new TradingViewError('ABORTED', message, { cause: reason });
+}
+
+export function validateTimeout(timeoutMs: number | undefined): number {
+ const value = timeoutMs ?? DEFAULT_TIMEOUT_MS;
+ if (!Number.isFinite(value) || value <= 0) {
+ throw new TradingViewError('INVALID_ARGUMENT', 'timeoutMs must be a positive number');
+ }
+ return value;
+}
+
+export function validateSymbol(symbol: unknown): string {
+ if (typeof symbol !== 'string' || !symbol.trim()) {
+ throw new TradingViewError('INVALID_ARGUMENT', 'symbol is required');
+ }
+ return symbol.trim();
+}
+
+export function throwIfAborted(signal?: AbortSignal): void {
+ if (signal?.aborted) throw abortError(signal);
+}
+
+interface Connection {
+ client: TradingViewClient;
+ release(): Promise<void>;
+}
+
+function connect(options: ConnectionOptions): Connection {
+ if (options.client) {
+ if (options.client.isClosed) throw new TradingViewError('INVALID_STATE', 'The provided client is closed');
+ return { client: options.client, release: async () => {} };
+ }
+ const client = new TradingViewClient({ ...options.clientOptions, credentials: options.credentials });
+ return { client, release: () => client.close() };
+}
+
+export interface OperationContext<T> {
+ client: TradingViewClient;
+ resolve(value: T): void;
+ reject(error: unknown): void;
+}
+
+type Cleanup = (() => void) | void;
+
+/**
+ * Runs a one-shot operation with timeout, abort and guaranteed cleanup:
+ * sessions are removed and an owned connection is closed before settling.
+ */
+export function runOperation<T>(
+ options: OperationOptions,
+ description: string,
+ start: (context: OperationContext<T>) => Cleanup,
+): Promise<T> {
+ let timeoutMs: number;
+ let connection: Connection;
+ try {
+ timeoutMs = validateTimeout(options.timeoutMs);
+ throwIfAborted(options.signal);
+ connection = connect(options);
+ } catch (error) {
+ return Promise.reject(toTradingViewError(error, 'INVALID_ARGUMENT'));
+ }
+
+ const { client } = connection;
+ const { signal } = options;
+
+ return new Promise<T>((resolve, reject) => {
+ let settled = false;
+ let cleanup: Cleanup;
+ const unsubscribers: Array<() => void> = [];
+
+ const finish = (error: TradingViewError | undefined, value?: T) => {
+ if (settled) return;
+ settled = true;
+ clearTimeout(timer);
+ signal?.removeEventListener('abort', onAbort);
+ for (const off of unsubscribers) off();
+ try {
+ cleanup?.();
+ } catch {
+ // Cleanup must never hide the result.
+ }
+ connection.release().catch(() => {}).then(() => {
+ if (error) reject(error);
+ else resolve(value as T);
+ });
+ };
+
+ const onAbort = () => finish(abortError(signal as AbortSignal));
+ const timer = setTimeout(() => {
+ finish(new TradingViewError('TIMEOUT', `${description} timed out after ${timeoutMs} ms`));
+ }, timeoutMs);
+
+ signal?.addEventListener('abort', onAbort, { once: true });
+ unsubscribers.push(
+ client.on('error', (error) => finish(error)),
+ client.on('close', () => finish(new TradingViewError('DISCONNECTED', `Connection closed during ${description}`))),
+ );
+
+ try {
+ cleanup = start({
+ client,
+ resolve: (value) => finish(undefined, value),
+ reject: (error) => finish(toTradingViewError(error)),
+ });
+ } catch (error) {
+ finish(toTradingViewError(error, 'INVALID_ARGUMENT'));
+ }
+ });
+}
+
+/** A running watcher. */
+export interface Watcher {
+ /** Stops the watcher and releases its sessions/connection. Idempotent. */
+ stop(): Promise<void>;
+ /** Resolves when the watcher has stopped (after `stop()`, abort or a fatal error). */
+ readonly closed: Promise<void>;
+ /** True until the watcher stops. */
+ readonly isActive: boolean;
+}
+
+export interface WatchHandlers {
+ /** Errors after start-up. Fatal errors also stop the watcher. */
+ onError?(error: TradingViewError): void;
+}
+
+export interface WatchContext {
+ client: TradingViewClient;
+ /** Marks the watcher as started (resolves the start promise). */
+ ready(): void;
+ /** Before start-up: rejects. After: reports to `onError` and stops. */
+ fail(error: unknown): void;
+ /** Reports a non-fatal error to `onError`. */
+ warn(error: unknown): void;
+ isActive(): boolean;
+}
+
+/**
+ * Starts a watcher. The returned promise resolves once `ready()` is called
+ * and rejects on timeout, abort or failure before that.
+ */
+export function startWatcher<W extends Watcher>(
+ options: OperationOptions,
+ description: string,
+ handlers: WatchHandlers,
+ start: (context: WatchContext) => Cleanup,
+ build: (base: Watcher) => W,
+): Promise<W> {
+ let timeoutMs: number;
+ let connection: Connection;
+ try {
+ timeoutMs = validateTimeout(options.timeoutMs);
+ throwIfAborted(options.signal);
+ connection = connect(options);
+ } catch (error) {
+ return Promise.reject(toTradingViewError(error, 'INVALID_ARGUMENT'));
+ }
+
+ const { client } = connection;
+ const { signal } = options;
+
+ let active = true;
+ let started = false;
+ let cleanup: Cleanup;
+ let stopPromise: Promise<void> | undefined;
+ let resolveClosed!: () => void;
+ const closed = new Promise<void>((resolve) => { resolveClosed = resolve; });
+ const unsubscribers: Array<() => void> = [];
+ let resolveStart!: (watcher: W) => void;
+ let rejectStart!: (error: TradingViewError) => void;
+ const startPromise = new Promise<W>((resolve, reject) => {
+ resolveStart = resolve;
+ rejectStart = reject;
+ });
+
+ const report = (error: TradingViewError) => {
+ try {
+ handlers.onError?.(error);
+ } catch (listenerError) {
+ console.error('[tradingview] onError callback threw:', listenerError);
+ }
+ };
+
+ const stop = (): Promise<void> => {
+ if (stopPromise) return stopPromise;
+ active = false;
+ clearTimeout(timer);
+ signal?.removeEventListener('abort', onAbort);
+ for (const off of unsubscribers) off();
+ try {
+ cleanup?.();
+ } catch {
+ // Ignore cleanup failures.
+ }
+ stopPromise = connection.release().catch(() => {}).then(() => resolveClosed());
+ return stopPromise;
+ };
+
+ const fail = (raw: unknown) => {
+ if (!active) return;
+ const error = toTradingViewError(raw);
+ const closing = stop();
+ if (!started) closing.then(() => rejectStart(error));
+ else report(error);
+ };
+
+ const watcher = build({
+ stop,
+ closed,
+ get isActive() {
+ return active;
+ },
+ });
+
+ const onAbort = () => fail(abortError(signal as AbortSignal));
+ const timer = setTimeout(() => {
+ if (!started) fail(new TradingViewError('TIMEOUT', `${description} timed out after ${timeoutMs} ms`));
+ }, timeoutMs);
+
+ signal?.addEventListener('abort', onAbort, { once: true });
+ unsubscribers.push(
+ client.on('error', (error) => fail(error)),
+ client.on('close', () => fail(new TradingViewError('DISCONNECTED', `Connection closed during ${description}`))),
+ );
+
+ try {
+ cleanup = start({
+ client,
+ ready: () => {
+ if (!active || started) return;
+ started = true;
+ clearTimeout(timer);
+ resolveStart(watcher);
+ },
+ fail,
+ warn: (error) => {
+ if (active) report(toTradingViewError(error));
+ },
+ isActive: () => active,
+ });
+ } catch (error) {
+ fail(error);
+ }
+
+ return startPromise;
+}
+
+/** Converts a Date or Unix time (seconds) into Unix seconds. */
+export function toUnixSeconds(value: number | Date | undefined, name: string): number | undefined {
+ if (value === undefined) return undefined;
+ const seconds = value instanceof Date ? Math.floor(value.getTime() / 1000) : value;
+ if (!Number.isFinite(seconds)) throw new TradingViewError('INVALID_ARGUMENT', `${name} must be a Date or Unix seconds`);
+ return seconds;
+}
diff --git a/src/data/provider.ts b/src/data/provider.ts
new file mode 100644
index 0000000..bed602c
--- /dev/null
+++ b/src/data/provider.ts
@@ -0,0 +1,28 @@
+import type { Candle } from '../chart/types.js';
+import { watchCandles, type CandleHandlers, type WatchCandlesQuery } from './candles.js';
+import type { ConnectionOptions } from './operation.js';
+
+/** Minimum lifecycle required of a streaming candle source. */
+export interface CandleSourceWorker {
+ /** First usable snapshot and subsequent updates, oldest first. */
+ readonly latest: readonly Candle[];
+ /** Releases resources. Safe to call more than once. */
+ stop(): Promise<void>;
+}
+
+/**
+ * Source-neutral candle contract. Applications can provide another market
+ * data source without emulating TradingView's charts or websocket protocol.
+ */
+export interface MarketDataProvider {
+ watchCandles(query: WatchCandlesQuery, handlers: CandleHandlers): Promise<CandleSourceWorker>;
+}
+
+/** Default candle source backed by TradingView, with optional connection defaults. */
+export class TradingViewProvider implements MarketDataProvider {
+ constructor(private readonly connection: ConnectionOptions = {}) {}
+
+ watchCandles(query: WatchCandlesQuery, handlers: CandleHandlers): Promise<CandleSourceWorker> {
+ return watchCandles({ ...this.connection, ...query }, handlers);
+ }
+}
diff --git a/src/data/quotes.ts b/src/data/quotes.ts
new file mode 100644
index 0000000..6ee3115
--- /dev/null
+++ b/src/data/quotes.ts
@@ -0,0 +1,143 @@
+import type { TradingSession } from '../chart/types.js';
+import { TradingViewError } from '../errors.js';
+import type { QuoteData, QuoteField, QuoteFieldPreset } from '../quote/fields.js';
+import type { QuoteSubscription } from '../quote/quote-session.js';
+import {
+ runOperation, startWatcher, validateSymbol,
+ type OperationOptions, type WatchHandlers, type Watcher,
+} from './operation.js';
+
+export interface QuoteOptions extends OperationOptions {
+ /** `all` (default), `price`, or a list of fields. */
+ fields?: QuoteFieldPreset | readonly QuoteField[];
+ /** Trading session. Default: `regular`. */
+ session?: TradingSession;
+}
+
+export interface QuoteQuery extends QuoteOptions {
+ symbol: string;
+}
+
+export interface QuotesQuery extends QuoteOptions {
+ symbols: readonly string[];
+}
+
+function validateSymbols(symbols: unknown): string[] {
+ if (!Array.isArray(symbols) || symbols.length === 0) {
+ throw new TradingViewError('INVALID_ARGUMENT', 'symbols must be a non-empty array');
+ }
+ return [...new Set(symbols.map(validateSymbol))];
+}
+
+/** Gets quotes for several symbols at once, keyed by symbol. */
+export function getQuotes(query: QuotesQuery | readonly string[]): Promise<Record<string, QuoteData>> {
+ const options: QuotesQuery = Array.isArray(query) ? { symbols: query } : query as QuotesQuery;
+ let symbols: string[];
+ try {
+ symbols = validateSymbols(options.symbols);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ return runOperation<Record<string, QuoteData>>(options, `getQuotes(${symbols.join(', ')})`, ({ client, resolve, reject }) => {
+ const session = client.createQuoteSession({ fields: options.fields });
+ const results: Record<string, QuoteData> = {};
+ let pending = symbols.length;
+ for (const symbol of symbols) {
+ const sub = session.subscribe(symbol, { session: options.session });
+ sub.on('error', reject);
+ sub.once('loaded', () => {
+ results[symbol] = sub.data;
+ pending -= 1;
+ if (pending === 0) resolve(results);
+ });
+ }
+ return () => session.delete();
+ });
+}
+
+/** Gets the current quote of a symbol (last price, change, volume...). */
+export async function getQuote(query: QuoteQuery | string): Promise<QuoteData> {
+ const options: QuoteQuery = typeof query === 'string' ? { symbol: query } : query;
+ const symbol = validateSymbol(options.symbol);
+ const quotes = await getQuotes({ ...options, symbols: [symbol] });
+ return quotes[symbol];
+}
+
+export interface QuoteHandlers extends WatchHandlers {
+ /** Receives the merged quote and the fields that changed. */
+ onData(symbol: string, quote: QuoteData, changes: QuoteData): void;
+}
+
+export interface QuoteWatcher extends Watcher {
+ /** Latest quote per symbol. */
+ readonly latest: Readonly<Record<string, QuoteData>>;
+}
+
+/**
+ * Streams quotes for one or more symbols. Resolves once every symbol has
+ * loaded (or failed: failures go to `onError`; if every symbol fails, the
+ * promise rejects). Call `stop()` when finished.
+ */
+export function watchQuotes(query: QuotesQuery, handlers: QuoteHandlers): Promise<QuoteWatcher> {
+ let symbols: string[];
+ try {
+ if (typeof handlers?.onData !== 'function') throw new TradingViewError('INVALID_ARGUMENT', 'onData must be a function');
+ symbols = validateSymbols(query.symbols);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ const latest: Record<string, QuoteData> = {};
+
+ return startWatcher(query, `watchQuotes(${symbols.join(', ')})`, handlers, (ctx) => {
+ const session = ctx.client.createQuoteSession({ fields: query.fields });
+ const settled = new Set<string>();
+ const errors: TradingViewError[] = [];
+ let loaded = 0;
+
+ const settle = (symbol: string, ok: boolean) => {
+ if (settled.has(symbol)) return;
+ settled.add(symbol);
+ if (ok) loaded += 1;
+ if (settled.size < symbols.length) return;
+ if (loaded === 0) ctx.fail(errors[0]);
+ else {
+ for (const error of errors) ctx.warn(error);
+ ctx.ready();
+ }
+ };
+
+ const subscriptions: QuoteSubscription[] = symbols.map((symbol) => {
+ const sub = session.subscribe(symbol, { session: query.session });
+ sub.on('data', (quote, changes) => {
+ latest[symbol] = quote;
+ if (!ctx.isActive()) return;
+ try {
+ handlers.onData(symbol, quote, changes);
+ } catch (error) {
+ ctx.warn(new TradingViewError('CALLBACK_ERROR', 'onData callback threw', { cause: error }));
+ }
+ });
+ sub.on('loaded', () => settle(symbol, true));
+ sub.on('error', (error) => {
+ if (error.code === 'DISCONNECTED') return; // Reported by the watcher itself.
+ if (settled.size < symbols.length && !settled.has(symbol)) {
+ errors.push(error);
+ settle(symbol, false);
+ } else ctx.warn(error);
+ });
+ return sub;
+ });
+
+ return () => {
+ for (const sub of subscriptions) sub.close();
+ session.delete();
+ };
+ }, (base) => ({
+ stop: base.stop,
+ closed: base.closed,
+ get isActive() { return base.isActive; },
+ get latest() { return { ...latest }; },
+ }));
+}
diff --git a/src/data/symbols.ts b/src/data/symbols.ts
new file mode 100644
index 0000000..43549f4
--- /dev/null
+++ b/src/data/symbols.ts
@@ -0,0 +1,27 @@
+import type { SymbolInfo, TradingSession } from '../chart/types.js';
+import { runOperation, validateSymbol, type OperationOptions } from './operation.js';
+
+export interface SymbolInfoQuery extends OperationOptions {
+ symbol: string;
+ session?: TradingSession;
+ currency?: string;
+}
+
+/** Resolves a symbol: exchange, currency, session, price scale, type... */
+export function getSymbolInfo(query: SymbolInfoQuery | string): Promise<SymbolInfo> {
+ const options: SymbolInfoQuery = typeof query === 'string' ? { symbol: query } : query;
+ let symbol: string;
+ try {
+ symbol = validateSymbol(options.symbol);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+
+ return runOperation<SymbolInfo>(options, `getSymbolInfo(${symbol})`, ({ client, resolve, reject }) => {
+ const chart = client.createChart();
+ chart.on('error', reject);
+ chart.on('symbolLoaded', resolve);
+ chart.setMarket(symbol, { count: 1, session: options.session, currency: options.currency });
+ return () => chart.delete();
+ });
+}
diff --git a/src/errors.ts b/src/errors.ts
new file mode 100644
index 0000000..90ac42b
--- /dev/null
+++ b/src/errors.ts
@@ -0,0 +1,75 @@
+/** Machine-readable error categories raised by this library. */
+export type TradingViewErrorCode =
+ /** The server rejected a websocket packet and closed the connection. */
+ | 'PROTOCOL_ERROR'
+ /** The websocket could not be opened or failed. */
+ | 'CONNECTION_ERROR'
+ /** The websocket closed while an operation was still waiting for data. */
+ | 'DISCONNECTED'
+ /** Credentials were rejected or the account could not be loaded. */
+ | 'AUTH_ERROR'
+ /** `symbol_error`: the symbol could not be resolved. */
+ | 'SYMBOL_ERROR'
+ /** `series_error`: the series could not be loaded (permissions, timeframe...). */
+ | 'SERIES_ERROR'
+ /** `critical_error`: the server rejected a chart or replay command. */
+ | 'CRITICAL_ERROR'
+ /** `study_error`: an indicator failed on the server. */
+ | 'STUDY_ERROR'
+ /** A quote symbol returned an error status. */
+ | 'QUOTE_ERROR'
+ /** A strategy report or compressed payload could not be decoded. */
+ | 'PARSE_ERROR'
+ /** A method was called in a state where it cannot work. */
+ | 'INVALID_STATE'
+ /** An argument is invalid. */
+ | 'INVALID_ARGUMENT'
+ /** An HTTP endpoint answered with an unexpected status or payload. */
+ | 'HTTP_ERROR'
+ /** The requested resource does not exist or is not accessible. */
+ | 'NOT_FOUND'
+ /** The server answered but returned no usable data. */
+ | 'NO_DATA'
+ /** An operation did not complete in time. */
+ | 'TIMEOUT'
+ /** An operation was cancelled through an `AbortSignal`. */
+ | 'ABORTED'
+ /** A user-supplied callback threw while processing data. */
+ | 'CALLBACK_ERROR';
+
+export interface TradingViewErrorOptions {
+ /** Raw details sent by the server, when available. */
+ details?: unknown;
+ cause?: unknown;
+}
+
+/** Every error produced by this library is a `TradingViewError`. */
+export class TradingViewError extends Error {
+ override readonly name = 'TradingViewError';
+
+ readonly code: TradingViewErrorCode;
+
+ /** Raw details sent by the server, when available. */
+ readonly details: unknown;
+
+ constructor(code: TradingViewErrorCode, message: string, options: TradingViewErrorOptions = {}) {
+ super(message, options.cause === undefined ? undefined : { cause: options.cause });
+ this.code = code;
+ this.details = options.details;
+ }
+}
+
+/** Normalises any thrown value into a `TradingViewError`. */
+export function toTradingViewError(
+ error: unknown,
+ fallbackCode: TradingViewErrorCode = 'CONNECTION_ERROR',
+): TradingViewError {
+ if (error instanceof TradingViewError) return error;
+ if (error instanceof Error) {
+ if (error.name === 'AbortError') {
+ return new TradingViewError('ABORTED', error.message || 'Aborted', { cause: error });
+ }
+ return new TradingViewError(fallbackCode, error.message, { cause: error });
+ }
+ return new TradingViewError(fallbackCode, String(error), { details: error });
+}
diff --git a/src/events.ts b/src/events.ts
new file mode 100644
index 0000000..8bf7cb9
--- /dev/null
+++ b/src/events.ts
@@ -0,0 +1,89 @@
+type EventMap = { [event: string]: unknown[] };
+
+export type Listener<Args extends unknown[]> = (...args: Args) => void;
+
+/** Unsubscribes the listener it was returned for. */
+export type Unsubscribe = () => void;
+
+/** Catch-all listener: receives the event name, then the event arguments. */
+export type AnyListener<Events extends EventMap> = (
+ ...args: { [K in keyof Events & string]: [event: K, ...args: Events[K]] }[keyof Events & string]
+) => void;
+
+/**
+ * Small typed event emitter shared by clients, sessions and studies.
+ *
+ * Listener exceptions are reported without interrupting other listeners or
+ * crashing the host process. An `error` event without any
+ * listener is written to `console.error` instead of being silently dropped.
+ */
+export class Emitter<Events extends EventMap> {
+ readonly #listeners = new Map<keyof Events, Set<Listener<any>>>();
+
+ readonly #anyListeners = new Set<AnyListener<Events>>();
+
+ /** Adds a listener and returns a function that removes it. */
+ on<K extends keyof Events & string>(event: K, listener: Listener<Events[K]>): Unsubscribe {
+ let set = this.#listeners.get(event);
+ if (!set) {
+ set = new Set();
+ this.#listeners.set(event, set);
+ }
+ set.add(listener);
+ return () => this.off(event, listener);
+ }
+
+ /** Adds a listener called at most once. */
+ once<K extends keyof Events & string>(event: K, listener: Listener<Events[K]>): Unsubscribe {
+ const wrapper: Listener<Events[K]> = (...args) => {
+ this.off(event, wrapper);
+ listener(...args);
+ };
+ return this.on(event, wrapper);
+ }
+
+ /** Removes a listener. */
+ off<K extends keyof Events & string>(event: K, listener: Listener<Events[K]>): void {
+ this.#listeners.get(event)?.delete(listener);
+ }
+
+ /** Listens to every event; receives the event name first. */
+ onAny(listener: AnyListener<Events>): Unsubscribe {
+ this.#anyListeners.add(listener);
+ return () => { this.#anyListeners.delete(listener); };
+ }
+
+ /** Number of listeners for an event (catch-all listeners excluded). */
+ listenerCount(event: keyof Events & string): number {
+ return this.#listeners.get(event)?.size ?? 0;
+ }
+
+ /** True when the event has a listener, including catch-all listeners. */
+ protected hasListeners(event: keyof Events & string): boolean {
+ return this.listenerCount(event) > 0 || this.#anyListeners.size > 0;
+ }
+
+ /** Removes every listener. */
+ protected removeAllListeners(): void {
+ this.#listeners.clear();
+ this.#anyListeners.clear();
+ }
+
+ protected emit<K extends keyof Events & string>(event: K, ...args: Events[K]): void {
+ const set = this.#listeners.get(event);
+ if (event === 'error' && !set?.size && !this.#anyListeners.size) {
+ console.error('[tradingview]', ...args);
+ return;
+ }
+ for (const listener of [...(set ?? [])]) Emitter.#call(() => listener(...args));
+ for (const listener of [...this.#anyListeners]) Emitter.#call(() => (listener as (...a: unknown[]) => void)(event, ...args));
+ }
+
+ static #call(fn: () => void): void {
+ try {
+ fn();
+ } catch (error) {
+ console.error('[tradingview] Listener threw:', error);
+ }
+ }
+}
diff --git a/src/http/account.ts b/src/http/account.ts
new file mode 100644
index 0000000..24f9acb
--- /dev/null
+++ b/src/http/account.ts
@@ -0,0 +1,176 @@
+import { platform, arch, release } from 'node:os';
+
+import { TradingViewError } from '../errors.js';
+import {
+ getSetCookies, request, type Credentials, type HttpOptions,
+} from './request.js';
+
+/** A TradingView account. */
+export interface User {
+ id: number;
+ username: string;
+ firstName: string;
+ lastName: string;
+ reputation: number;
+ following: number;
+ followers: number;
+ notifications: { user: number; following: number };
+ /** `sessionid` cookie. Keep it secret. */
+ session: string;
+ /** `sessionid_sign` cookie. Keep it secret. */
+ signature: string;
+ sessionHash: string;
+ privateChannel: string;
+ /** Websocket auth token. Keep it secret. */
+ authToken: string;
+ joinDate: Date;
+}
+
+export interface LoginOptions extends HttpOptions {
+ username: string;
+ password: string;
+ /** Keep the session alive longer. Default: true. */
+ remember?: boolean;
+ /** Custom user agent prefix. */
+ userAgent?: string;
+}
+
+/**
+ * Signs in with a username/email and password and returns the account with
+ * its session cookies. Accounts with 2FA or captcha challenges are not supported.
+ */
+export async function loginUser(options: LoginOptions): Promise<User> {
+ const remember = options.remember ?? true;
+ const userAgent = options.userAgent ?? 'TWAPI/4.0';
+ const { data, headers } = await request('https://www.tradingview.com/accounts/signin/', {
+ method: 'POST',
+ form: { username: options.username, password: options.password, remember: remember ? 'on' : undefined },
+ headers: {
+ referer: 'https://www.tradingview.com',
+ 'user-agent': `${userAgent} (${release()}; ${platform()}; ${arch()})`,
+ },
+ }, options);
+
+ if (!data || typeof data !== 'object') {
+ throw new TradingViewError('AUTH_ERROR', 'Unexpected sign-in response');
+ }
+ if (data.error) throw new TradingViewError('AUTH_ERROR', String(data.error), { details: data });
+ if (!data.user) throw new TradingViewError('AUTH_ERROR', 'Sign-in response has no user', { details: data });
+
+ return userFromLogin(data.user, headers);
+}
+
+function cookieValue(headers: Headers, name: string): string {
+ for (const line of getSetCookies(headers)) {
+ const found = new RegExp(`(?:^|[;\\s])${name}=([^;]*)`).exec(line);
+ if (found) return found[1];
+ }
+ return '';
+}
+
+function textOrEmpty(value: unknown): string {
+ return String(value ?? '');
+}
+
+function numberOrZero(value: unknown): number {
+ return Number(value ?? 0);
+}
+
+function userFromLogin(user: any, headers: Headers): User {
+ return {
+ id: numberOrZero(user.id),
+ username: user.username,
+ firstName: textOrEmpty(user.first_name),
+ lastName: textOrEmpty(user.last_name),
+ reputation: numberOrZero(user.reputation),
+ following: numberOrZero(user.following),
+ followers: numberOrZero(user.followers),
+ notifications: {
+ user: numberOrZero(user.notification_count?.user),
+ following: numberOrZero(user.notification_count?.following),
+ },
+ session: cookieValue(headers, 'sessionid'),
+ signature: cookieValue(headers, 'sessionid_sign'),
+ sessionHash: textOrEmpty(user.session_hash),
+ privateChannel: textOrEmpty(user.private_channel),
+ authToken: textOrEmpty(user.auth_token),
+ joinDate: new Date(user.date_joined),
+ };
+}
+
+export interface GetUserOptions extends HttpOptions {
+ /** Page used to read the account, for example `https://fr.tradingview.com/`. */
+ location?: string;
+ /** Maximum number of redirects to follow. Default: 5. */
+ maxRedirects?: number;
+}
+
+function match(page: string, pattern: RegExp): string | undefined {
+ return pattern.exec(page)?.[1];
+}
+
+function pageNumber(page: string, pattern: RegExp): number {
+ return parseFloat(match(page, pattern) ?? '0') || 0;
+}
+
+function pageText(page: string, pattern: RegExp): string {
+ return match(page, pattern) ?? '';
+}
+
+function trustedAccountLocation(location: string): string {
+ let url: URL;
+ try {
+ url = new URL(location);
+ } catch {
+ throw new TradingViewError('AUTH_ERROR', 'Invalid account page URL');
+ }
+ if (url.protocol !== 'https:' || !/(^|\.)tradingview\.com$/i.test(url.hostname)) {
+ throw new TradingViewError('AUTH_ERROR', 'Account page redirects outside TradingView');
+ }
+ return url.toString();
+}
+
+/** Parses the account embedded in a TradingView HTML page. */
+export function parseUserPage(page: string, credentials: Credentials): User {
+ return {
+ id: pageNumber(page, /"id":([0-9]{1,10}),/),
+ username: pageText(page, /"username":"(.*?)"/),
+ firstName: pageText(page, /"first_name":"(.*?)"/),
+ lastName: pageText(page, /"last_name":"(.*?)"/),
+ reputation: pageNumber(page, /"reputation":(.*?),/),
+ following: pageNumber(page, /,"following":([0-9]*?),/),
+ followers: pageNumber(page, /,"followers":([0-9]*?),/),
+ notifications: {
+ following: pageNumber(page, /"notification_count":\{"following":([0-9]*),/),
+ user: pageNumber(page, /"notification_count":\{"following":[0-9]*,"user":([0-9]*)/),
+ },
+ session: credentials.session,
+ signature: credentials.signature ?? '',
+ sessionHash: pageText(page, /"session_hash":"(.*?)"/),
+ privateChannel: pageText(page, /"private_channel":"(.*?)"/),
+ authToken: pageText(page, /"auth_token":"(.*?)"/),
+ joinDate: new Date(pageText(page, /"date_joined":"(.*?)"/) || 0),
+ };
+}
+
+/** Loads the account behind `sessionid` (and `sessionid_sign`) cookies. */
+export async function getUser(credentials: Credentials, options: GetUserOptions = {}): Promise<User> {
+ if (!credentials?.session) throw new TradingViewError('INVALID_ARGUMENT', 'A session cookie is required');
+ const maxRedirects = options.maxRedirects ?? 5;
+ let location = trustedAccountLocation(options.location ?? 'https://www.tradingview.com/');
+
+ for (let redirects = 0; ; redirects += 1) {
+ const { text, headers } = await request(location, { credentials, redirect: 'manual' }, options);
+ if (text.includes('auth_token')) return parseUserPage(text, credentials);
+
+ const next = headers.get('location');
+ const resolved = next ? new URL(next, location).toString() : undefined;
+ if (!resolved || resolved === location) {
+ throw new TradingViewError('AUTH_ERROR', 'Wrong or expired sessionid/signature');
+ }
+ if (redirects >= maxRedirects) {
+ throw new TradingViewError('AUTH_ERROR', 'Too many redirects (possible WAF or geo-restriction)');
+ }
+ location = trustedAccountLocation(resolved);
+ }
+}
diff --git a/src/http/index.ts b/src/http/index.ts
new file mode 100644
index 0000000..f289c55
--- /dev/null
+++ b/src/http/index.ts
@@ -0,0 +1,17 @@
+export type { AuthHttpOptions, Credentials, HttpOptions } from './request.js';
+export { getUser, loginUser } from './account.js';
+export type { GetUserOptions, LoginOptions, User } from './account.js';
+export { getTechnicalAnalysis, searchMarkets } from './market.js';
+export type {
+ MarketSearchResult, MarketType, SearchMarketsOptions, TechnicalAnalysis, TechnicalAnalysisPeriod, TechnicalRating,
+} from './market.js';
+export {
+ clearIndicatorCache, getIndicator, getPrivateIndicators, parseIndicatorDefinition, searchIndicators,
+} from './indicators.js';
+export type { GetIndicatorOptions, IndicatorAccess, IndicatorSearchResult } from './indicators.js';
+export { getChartToken, getDrawings } from './layouts.js';
+export type {
+ Drawing, DrawingPoint, GetDrawingsOptions, LayoutOptions,
+} from './layouts.js';
+export { PinePermissionManager } from './pine-permissions.js';
+export type { AuthorizedUser, AuthorizedUserOrder, PinePermissionOptions } from './pine-permissions.js';
diff --git a/src/http/indicators.ts b/src/http/indicators.ts
new file mode 100644
index 0000000..75cfcdf
--- /dev/null
+++ b/src/http/indicators.ts
@@ -0,0 +1,185 @@
+import { TradingViewError } from '../errors.js';
+import { PineIndicator, type PineInput } from '../indicators/pine-indicator.js';
+import {
+ request, type AuthHttpOptions, type Credentials, type HttpOptions,
+} from './request.js';
+
+export type IndicatorAccess = 'open_source' | 'closed_source' | 'invite_only' | 'private' | 'other';
+
+/** An indicator returned by `searchIndicators` or `getPrivateIndicators`. */
+export interface IndicatorSearchResult {
+ /** Script ID to pass to `getIndicator`. */
+ id: string;
+ version: string;
+ name: string;
+ author: { id: number; username: string };
+ /** Chart image ID: `https://www.tradingview.com/i/<image>`. */
+ image: string;
+ /** Pine source, when public. */
+ source: string;
+ type: 'study' | 'strategy' | (string & {});
+ access: IndicatorAccess;
+}
+
+let builtInCache: Promise<any[]> | undefined;
+
+async function loadBuiltIns(options: HttpOptions): Promise<any[]> {
+ const lists = await Promise.all(['standard', 'candlestick', 'fundamental'].map(async (filter) => {
+ const { data } = await request('https://pine-facade.tradingview.com/pine-facade/list', { query: { filter } }, options);
+ return Array.isArray(data) ? data : [];
+ }));
+ return lists.flat();
+}
+
+/** Clears the in-memory list of built-in indicators used by `searchIndicators`. */
+export function clearIndicatorCache(): void {
+ builtInCache = undefined;
+}
+
+const normalise = (value = '') => value.toUpperCase().replace(/[^A-Z]/g, '');
+
+/** Searches built-in and community indicators. */
+export async function searchIndicators(query = '', options: HttpOptions = {}): Promise<IndicatorSearchResult[]> {
+ // Custom fetch implementations (tests, proxies) must not share the process-wide cache.
+ const builtInsPromise = options.fetch ? loadBuiltIns(options) : (builtInCache ??= loadBuiltIns(options));
+ const [builtIns, community] = await Promise.all([
+ builtInsPromise.catch((error) => {
+ if (!options.fetch) builtInCache = undefined;
+ throw error;
+ }),
+ request('https://www.tradingview.com/pubscripts-suggest-json', { query: { search: query } }, options),
+ ]);
+
+ const needle = normalise(query);
+ const kind = (ind: any) => ind.extra?.kind ?? 'study';
+
+ return [
+ ...builtIns
+ .filter((ind) => normalise(ind.scriptName).includes(needle)
+ || normalise(ind.extra?.shortDescription).includes(needle))
+ .map((ind): IndicatorSearchResult => ({
+ id: ind.scriptIdPart,
+ version: String(ind.version),
+ name: ind.scriptName,
+ author: { id: Number(ind.userId ?? -1), username: '@TRADINGVIEW@' },
+ image: '',
+ source: '',
+ type: kind(ind),
+ access: 'closed_source',
+ })),
+ ...(community.data?.results ?? []).map((ind: any): IndicatorSearchResult => ({
+ id: ind.scriptIdPart,
+ version: String(ind.version),
+ name: ind.scriptName,
+ author: { id: Number(ind.author?.id ?? -1), username: ind.author?.username ?? '' },
+ image: ind.imageUrl ?? '',
+ source: ind.scriptSource ?? '',
+ type: kind(ind),
+ access: (['open_source', 'closed_source', 'invite_only'] as const)[ind.access - 1] ?? 'other',
+ })),
+ ];
+}
+
+export interface GetIndicatorOptions extends AuthHttpOptions {
+ /** Script version. Default: `last`. */
+ version?: string;
+}
+
+const sanitise = (value: string) => value.replace(/ /g, '_').replace(/[^a-zA-Z0-9_]/g, '');
+
+function parseInputs(items: any[]): Record<string, PineInput> {
+ const inputs: Record<string, PineInput> = {};
+ for (const input of items) {
+ if (['text', 'pineId', 'pineVersion'].includes(input.id)) continue;
+ const inlineName = sanitise(String(input.name ?? input.id));
+ inputs[input.id] = {
+ name: input.name,
+ inline: input.inline || inlineName,
+ internalID: input.internalID || inlineName,
+ tooltip: input.tooltip,
+ type: input.type,
+ value: input.defval,
+ isHidden: !!input.isHidden,
+ isFake: !!input.isFake,
+ ...(input.options ? { options: input.options } : {}),
+ };
+ }
+ return inputs;
+}
+
+function parsePlots(styles: Record<string, any>, items: any[]): Record<string, string> {
+ const plots: Record<string, string> = {};
+ for (const [plotId, style] of Object.entries(styles)) {
+ const title = sanitise(String(style.title ?? plotId));
+ const titles = Object.values(plots);
+ if (titles.includes(title)) {
+ let i = 2;
+ while (titles.includes(`${title}_${i}`)) i += 1;
+ plots[plotId] = `${title}_${i}`;
+ } else plots[plotId] = title;
+ }
+ for (const plot of items) {
+ if (!plot.target) continue;
+ plots[plot.id] = `${plots[plot.target] ?? plot.target}_${plot.type}`;
+ }
+ return plots;
+}
+
+/** Converts a `pine-facade/translate` result into a `PineIndicator`. */
+export function parseIndicatorDefinition(result: any, id: string, version: string): PineIndicator {
+ const meta = result.metaInfo;
+ return new PineIndicator({
+ id: meta.scriptIdPart || id,
+ version: meta.pine?.version || version,
+ description: meta.description,
+ shortDescription: meta.shortDescription,
+ inputs: parseInputs(meta.inputs),
+ plots: parsePlots(meta.styles ?? {}, meta.plots ?? []),
+ script: result.ilTemplate,
+ });
+}
+
+/**
+ * Loads an indicator definition (`STD;RSI`, `PUB;xxxx`, `USER;xxxx`...).
+ * Private and invite-only scripts need credentials with access.
+ */
+export async function getIndicator(id: string, options: GetIndicatorOptions = {}): Promise<PineIndicator> {
+ const version = options.version ?? 'last';
+ const encodedId = id.replace(/ |%/g, '%25');
+ const { data } = await request(
+ `https://pine-facade.tradingview.com/pine-facade/translate/${encodedId}/${version}`,
+ { credentials: options.credentials },
+ options,
+ );
+
+ if (!data?.success || !data.result?.metaInfo?.inputs) {
+ throw new TradingViewError('NOT_FOUND', `Inexistent or unsupported indicator: "${data?.reason}"`, { details: data });
+ }
+ return parseIndicatorDefinition(data.result, encodedId, version);
+}
+
+/** Lists the private (saved) indicators of an account. */
+export async function getPrivateIndicators(
+ credentials: Credentials,
+ options: HttpOptions = {},
+): Promise<IndicatorSearchResult[]> {
+ const { data } = await request('https://pine-facade.tradingview.com/pine-facade/list', {
+ query: { filter: 'saved' },
+ credentials,
+ }, options);
+
+ if (!Array.isArray(data)) {
+ throw new TradingViewError('AUTH_ERROR', 'Unable to list private indicators (check credentials)', { details: data });
+ }
+
+ return data.map((ind: any): IndicatorSearchResult => ({
+ id: ind.scriptIdPart,
+ version: String(ind.version),
+ name: ind.scriptName,
+ author: { id: -1, username: '@ME@' },
+ image: ind.imageUrl ?? '',
+ source: ind.scriptSource ?? '',
+ type: ind.extra?.kind ?? 'study',
+ access: 'private',
+ }));
+}
diff --git a/src/http/layouts.ts b/src/http/layouts.ts
new file mode 100644
index 0000000..543bf4e
--- /dev/null
+++ b/src/http/layouts.ts
@@ -0,0 +1,62 @@
+import { TradingViewError } from '../errors.js';
+import { request, type AuthHttpOptions } from './request.js';
+
+export interface LayoutOptions extends AuthHttpOptions {
+ /** Account ID (`User.id`), required with credentials for private layouts. */
+ userId?: number;
+}
+
+/** Gets a chart-storage token for a layout (the ID in `tradingview.com/chart/<ID>/`). */
+export async function getChartToken(layoutId: string, options: LayoutOptions = {}): Promise<string> {
+ const authenticated = Boolean(options.credentials?.session && options.userId);
+ const { data } = await request('https://www.tradingview.com/chart-token', {
+ query: { image_url: layoutId, user_id: authenticated ? options.userId : -1 },
+ credentials: authenticated ? options.credentials : undefined,
+ }, options);
+
+ if (!data?.token) throw new TradingViewError('NOT_FOUND', 'Wrong layout or credentials', { details: data });
+ return data.token;
+}
+
+export interface DrawingPoint {
+ time_t: number;
+ price: number;
+ offset: number;
+ [key: string]: unknown;
+}
+
+/** A user drawing stored in a layout. State properties are merged at the top level. */
+export interface Drawing {
+ id: string;
+ symbol: string;
+ ownerSource: string;
+ serverUpdateTime: string;
+ currencyId: string;
+ unitId: unknown;
+ type: string;
+ points: DrawingPoint[];
+ zorder: number;
+ linkKey: string;
+ state: Record<string, any>;
+ [key: string]: unknown;
+}
+
+export interface GetDrawingsOptions extends LayoutOptions {
+ /** Only returns drawings for this symbol. */
+ symbol?: string;
+ /** Chart ID inside the layout. Default: `_shared`. */
+ chartId?: string;
+}
+
+/** Lists the drawings of a layout. */
+export async function getDrawings(layoutId: string, options: GetDrawingsOptions = {}): Promise<Drawing[]> {
+ const token = await getChartToken(layoutId, options);
+ const { data } = await request(`https://charts-storage.tradingview.com/charts-storage/get/layout/${layoutId}/sources`, {
+ query: { chart_id: options.chartId ?? '_shared', jwt: token, symbol: options.symbol ?? '' },
+ }, options);
+
+ if (!data?.payload) {
+ throw new TradingViewError('NOT_FOUND', 'Wrong layout, user credentials, or chart id', { details: data });
+ }
+ return Object.values<any>(data.payload.sources ?? {}).map((drawing) => ({ ...drawing, ...drawing.state }));
+}
diff --git a/src/http/market.ts b/src/http/market.ts
new file mode 100644
index 0000000..e43b114
--- /dev/null
+++ b/src/http/market.ts
@@ -0,0 +1,111 @@
+import { TradingViewError } from '../errors.js';
+import { request, type HttpOptions } from './request.js';
+
+export type MarketType =
+ | 'stock' | 'futures' | 'forex' | 'cfd' | 'crypto' | 'index' | 'economic' | 'bond' | 'fund' | (string & {});
+
+/** One market returned by `searchMarkets`. */
+export interface MarketSearchResult {
+ /** Exchange-qualified symbol, usable everywhere in this library (`BINANCE:BTCEUR`). */
+ id: string;
+ /** Short exchange name (`BINANCE`). */
+ exchange: string;
+ /** Exchange name as sent by TradingView. */
+ fullExchange: string;
+ symbol: string;
+ description: string;
+ type: string;
+ currency?: string;
+ country?: string;
+}
+
+export interface SearchMarketsOptions extends HttpOptions {
+ /** Restricts results to a market type. */
+ type?: MarketType;
+ /** Pagination offset. */
+ offset?: number;
+ /** Restricts results to an exchange. `searchMarkets('BINANCE:BTC')` sets it too. */
+ exchange?: string;
+}
+
+const ORIGIN = { origin: 'https://www.tradingview.com' };
+
+/** Searches markets by keywords, `EXCHANGE:` prefix or `EXCHANGE:SYMBOL`. */
+export async function searchMarkets(query: string, options: SearchMarketsOptions = {}): Promise<MarketSearchResult[]> {
+ const parts = query.toUpperCase().split(':');
+ const text = parts.length === 2 ? parts[1] : query.toUpperCase();
+ const exchange = options.exchange ?? (parts.length === 2 ? parts[0] : undefined);
+
+ const { data, status } = await request('https://symbol-search.tradingview.com/symbol_search/v3/', {
+ query: {
+ text, exchange, search_type: options.type ?? '', start: options.offset ?? 0,
+ },
+ headers: ORIGIN,
+ }, options);
+
+ if (!data || !Array.isArray(data.symbols)) {
+ throw new TradingViewError('HTTP_ERROR', `Unexpected market search response (HTTP ${status})`, { details: data });
+ }
+
+ return data.symbols.map((s: any): MarketSearchResult => {
+ const shortExchange = String(s.exchange ?? '').split(' ')[0];
+ const symbol = String(s.symbol ?? '').replace(/<\/?em>/g, '');
+ return {
+ id: s.prefix ? `${s.prefix}:${symbol}` : `${shortExchange.toUpperCase()}:${symbol}`,
+ exchange: shortExchange,
+ fullExchange: s.exchange,
+ symbol,
+ description: String(s.description ?? '').replace(/<\/?em>/g, ''),
+ type: s.type,
+ currency: s.currency_code,
+ country: s.country,
+ };
+ });
+}
+
+/**
+ * TradingView technical ratings, from -1 (strong sell) to 1 (strong buy).
+ * `All` is the summary, `MA` the moving averages and `Other` the oscillators.
+ */
+export interface TechnicalRating {
+ Other: number;
+ All: number;
+ MA: number;
+}
+
+export type TechnicalAnalysisPeriod = '1' | '5' | '15' | '60' | '240' | '1D' | '1W' | '1M';
+
+export type TechnicalAnalysis = Record<TechnicalAnalysisPeriod, TechnicalRating>;
+
+const TA_PERIODS: TechnicalAnalysisPeriod[] = ['1', '5', '15', '60', '240', '1D', '1W', '1M'];
+const TA_INDICATORS = ['Recommend.Other', 'Recommend.All', 'Recommend.MA'];
+
+/**
+ * Gets technical ratings for every period from the TradingView scanner.
+ * Returns `null` when the scanner has no data for the symbol.
+ *
+ * Values are scaled like the historical API: `round(raw * 1000) / 500`,
+ * which maps the scanner range [-1, 1] to [-2, 2].
+ */
+export async function getTechnicalAnalysis(symbol: string, options: HttpOptions = {}): Promise<TechnicalAnalysis | null> {
+ const columns = TA_PERIODS.flatMap((period) => TA_INDICATORS.map((name) => (
+ period === '1D' ? name : `${name}|${period}`
+ )));
+
+ const { data } = await request('https://scanner.tradingview.com/global/scan', {
+ method: 'POST',
+ json: { symbols: { tickers: [symbol] }, columns },
+ }, options);
+
+ const values: unknown[] | undefined = data?.data?.[0]?.d;
+ if (!values) return null;
+
+ const result = {} as TechnicalAnalysis;
+ values.forEach((value, index) => {
+ const [name, period = '1D'] = columns[index].split('|');
+ const key = name.split('.').pop() as keyof TechnicalRating;
+ result[period as TechnicalAnalysisPeriod] ??= {} as TechnicalRating;
+ result[period as TechnicalAnalysisPeriod][key] = Math.round(Number(value) * 1000) / 500;
+ });
+ return result;
+}
diff --git a/src/http/pine-permissions.ts b/src/http/pine-permissions.ts
new file mode 100644
index 0000000..316b20c
--- /dev/null
+++ b/src/http/pine-permissions.ts
@@ -0,0 +1,83 @@
+import { TradingViewError } from '../errors.js';
+import { request, type Credentials, type HttpOptions } from './request.js';
+
+/** A user allowed to use an invite-only script. */
+export interface AuthorizedUser {
+ id: number;
+ username: string;
+ userpic: string;
+ /** ISO date, or null when the access does not expire. */
+ expiration: string | null;
+ created: string;
+ [key: string]: unknown;
+}
+
+export type AuthorizedUserOrder =
+ | 'user__username' | '-user__username'
+ | 'created' | '-created'
+ | 'expiration,user__username' | '-expiration,user__username';
+
+export interface PinePermissionOptions extends HttpOptions {
+ credentials: Credentials;
+}
+
+/** Manages who can use an invite-only Pine script you own. */
+export class PinePermissionManager {
+ readonly pineId: string;
+
+ readonly #credentials: Credentials;
+
+ readonly #options: HttpOptions;
+
+ constructor(pineId: string, options: PinePermissionOptions) {
+ if (!pineId) throw new TradingViewError('INVALID_ARGUMENT', 'A Pine ID is required');
+ if (!options?.credentials?.session) throw new TradingViewError('INVALID_ARGUMENT', 'A session cookie is required');
+ if (!options.credentials.signature) throw new TradingViewError('INVALID_ARGUMENT', 'A session signature is required');
+ this.pineId = pineId;
+ this.#credentials = options.credentials;
+ this.#options = { fetch: options.fetch, signal: options.signal, headers: options.headers };
+ }
+
+ async #post(path: string, form: Record<string, string | undefined>, query?: Record<string, string | number>) {
+ const { status, data } = await request(`https://www.tradingview.com/pine_perm/${path}`, {
+ method: 'POST',
+ query,
+ form: { pine_id: this.pineId, ...form },
+ credentials: this.#credentials,
+ headers: { origin: 'https://www.tradingview.com' },
+ }, this.#options);
+
+ if (status >= 400) {
+ throw new TradingViewError(status === 404 ? 'NOT_FOUND' : 'HTTP_ERROR', data?.detail ?? 'Wrong credentials or pineId', {
+ details: data,
+ });
+ }
+ return data;
+ }
+
+ /** Lists authorized users. */
+ async getUsers(limit = 10, order: AuthorizedUserOrder = '-created'): Promise<AuthorizedUser[]> {
+ const data = await this.#post('list_users/', {}, { limit, order_by: order });
+ return data?.results ?? [];
+ }
+
+ /** Authorizes a user, optionally until a date. */
+ async addUser(username: string, expiration?: Date): Promise<'ok' | 'exists' | (string & {})> {
+ const data = await this.#post('add/', { username_recip: username, expiration: expiration?.toISOString() });
+ return data?.status;
+ }
+
+ /** Changes (or removes, without date) the expiration of a user's access. */
+ async modifyExpiration(username: string, expiration?: Date): Promise<'ok' | (string & {})> {
+ const data = await this.#post('modify_user_expiration/', {
+ username_recip: username, expiration: expiration?.toISOString(),
+ });
+ return data?.status;
+ }
+
+ /** Revokes a user's access. */
+ async removeUser(username: string): Promise<'ok' | (string & {})> {
+ const data = await this.#post('remove/', { username_recip: username });
+ return data?.status;
+ }
+}
diff --git a/src/http/request.ts b/src/http/request.ts
new file mode 100644
index 0000000..491e69a
--- /dev/null
+++ b/src/http/request.ts
@@ -0,0 +1,126 @@
+import { TradingViewError, toTradingViewError } from '../errors.js';
+
+/** TradingView account cookies. Keep them secret. */
+export interface Credentials {
+ /** Value of the `sessionid` cookie. */
+ session: string;
+ /** Value of the `sessionid_sign` cookie. */
+ signature?: string;
+}
+
+/** Options accepted by every HTTP function. */
+export interface HttpOptions {
+ /** Custom `fetch` implementation (tests, proxies). Defaults to the global `fetch`. */
+ fetch?: typeof fetch;
+ /** Cancels the request. */
+ signal?: AbortSignal;
+ /** Extra request headers. */
+ headers?: Record<string, string>;
+}
+
+/** HTTP options for endpoints that can use an account. */
+export interface AuthHttpOptions extends HttpOptions {
+ credentials?: Credentials;
+}
+
+export const DEFAULT_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 '
+ + '(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
+
+/** Builds the `cookie` header value for credentials. */
+export function authCookies(credentials?: Credentials | null): string {
+ if (!credentials?.session) return '';
+ if (!credentials.signature) return `sessionid=${credentials.session}`;
+ return `sessionid=${credentials.session};sessionid_sign=${credentials.signature}`;
+}
+
+export interface RequestInit {
+ method?: 'GET' | 'POST';
+ query?: Record<string, string | number | boolean | undefined | null>;
+ form?: Record<string, string | number | undefined | null>;
+ json?: unknown;
+ credentials?: Credentials | null;
+ headers?: Record<string, string>;
+ redirect?: 'follow' | 'manual';
+}
+
+export interface HttpResponse {
+ status: number;
+ headers: Headers;
+ url: string;
+ text: string;
+ /** Parsed JSON body, or `undefined` when the body is not JSON. */
+ data: any;
+}
+
+function requestUrl(url: string, query: RequestInit['query']): URL {
+ const target = new URL(url);
+ for (const [key, value] of Object.entries(query ?? {})) {
+ if (value !== undefined && value !== null) target.searchParams.set(key, String(value));
+ }
+ return target;
+}
+
+function requestBody(init: RequestInit, headers: Record<string, string>): string | undefined {
+ if (init.form) {
+ const form = new URLSearchParams();
+ for (const [key, value] of Object.entries(init.form)) {
+ if (value !== undefined && value !== null) form.set(key, String(value));
+ }
+ headers['content-type'] = 'application/x-www-form-urlencoded';
+ return form.toString();
+ }
+ if (init.json !== undefined) {
+ headers['content-type'] = 'application/json';
+ return JSON.stringify(init.json);
+ }
+ return undefined;
+}
+
+function responseData(text: string): unknown {
+ try {
+ return text ? JSON.parse(text) : undefined;
+ } catch {
+ return undefined;
+ }
+}
+
+/** Performs a request. Like the historical client, 5xx statuses throw. */
+export async function request(url: string, init: RequestInit, options: HttpOptions = {}): Promise<HttpResponse> {
+ const target = requestUrl(url, init.query);
+ const headers: Record<string, string> = { ...options.headers, ...init.headers };
+ const cookie = authCookies(init.credentials);
+ if (cookie) headers.cookie = cookie;
+ const body = requestBody(init, headers);
+
+ const fetchImpl = options.fetch ?? globalThis.fetch;
+ let response: Response;
+ try {
+ response = await fetchImpl(target.toString(), {
+ method: init.method ?? (body === undefined ? 'GET' : 'POST'),
+ headers,
+ body,
+ redirect: init.redirect ?? 'follow',
+ signal: options.signal,
+ });
+ } catch (error) {
+ throw toTradingViewError(error, 'HTTP_ERROR');
+ }
+
+ const text = await response.text();
+ if (response.status >= 500) {
+ throw new TradingViewError('HTTP_ERROR', `${target.host} answered HTTP ${response.status}`, {
+ details: { status: response.status, body: text.slice(0, 500) },
+ });
+ }
+ return {
+ status: response.status, headers: response.headers, url: target.toString(), text, data: responseData(text),
+ };
+}
+
+/** Reads every `set-cookie` header, across runtimes. */
+export function getSetCookies(headers: Headers): string[] {
+ const withGetter = headers as Headers & { getSetCookie?: () => string[] };
+ if (typeof withGetter.getSetCookie === 'function') return withGetter.getSetCookie();
+ const raw = headers.get('set-cookie');
+ return raw ? raw.split(/,(?=\s*[^;,=\s]+=)/) : [];
+}
diff --git a/src/index.ts b/src/index.ts
new file mode 100644
index 0000000..77db07e
--- /dev/null
+++ b/src/index.ts
@@ -0,0 +1,21 @@
+/**
+ * TradingView-API v4.
+ *
+ * - High-level data API (also available from `@mathieuc/tradingview/data`):
+ * `getCandles`, `watchCandles`, `getQuote`, `watchQuotes`, `getIndicatorData`...
+ * - Low-level API: `TradingViewClient`, chart and quote sessions, studies.
+ * - HTTP API: search, technical analysis, indicators, accounts, layouts.
+ *
+ * Independent community project, not affiliated with TradingView.
+ */
+export * from './data/index.js';
+export * from './client/index.js';
+export * from './chart/index.js';
+export * from './quote/index.js';
+export * from './indicators/index.js';
+export * from './http/index.js';
+export * as protocol from './protocol/index.js';
+export { Emitter } from './events.js';
+export type { AnyListener, Listener, Unsubscribe } from './events.js';
+export { TradingViewError, toTradingViewError } from './errors.js';
+export type { TradingViewErrorCode, TradingViewErrorOptions } from './errors.js';
diff --git a/src/indicators/builtin-indicator.ts b/src/indicators/builtin-indicator.ts
new file mode 100644
index 0000000..b97fd08
--- /dev/null
+++ b/src/indicators/builtin-indicator.ts
@@ -0,0 +1,98 @@
+import { TradingViewError } from '../errors.js';
+
+/** Known built-in (non-Pine) study types. Any other type string is accepted too. */
+export type BuiltInIndicatorType =
+ | 'Volume@tv-basicstudies-241'
+ | 'VbPFixed@tv-basicstudies-241'
+ | 'VbPFixed@tv-basicstudies-241!'
+ | 'VbPFixed@tv-volumebyprice-53!'
+ | 'VbPSessions@tv-volumebyprice-53'
+ | 'VbPSessionsRough@tv-volumebyprice-53!'
+ | 'VbPSessionsDetailed@tv-volumebyprice-53!'
+ | 'VbPVisible@tv-volumebyprice-53'
+ | (string & {});
+
+export type BuiltInIndicatorOption =
+ | 'length' | 'col_prev_close'
+ | 'rowsLayout' | 'rows' | 'volume' | 'vaVolume' | 'subscribeRealtime'
+ | 'first_bar_time' | 'first_visible_bar_time' | 'last_bar_time' | 'last_visible_bar_time'
+ | 'extendToRight' | 'mapRightBoundaryToBarStartTime' | 'extendPocRight' | (string & {});
+
+function defaultOptions(type: string): Record<string, unknown> | undefined {
+ const now = Date.now();
+ const profile = {
+ rowsLayout: 'Number Of Rows', rows: 24, volume: 'Up/Down', vaVolume: 70,
+ };
+ switch (type) {
+ case 'Volume@tv-basicstudies-241':
+ return { length: 20, col_prev_close: false };
+ case 'VbPFixed@tv-basicstudies-241':
+ return {
+ ...profile,
+ subscribeRealtime: false,
+ first_bar_time: NaN,
+ last_bar_time: now,
+ extendToRight: false,
+ mapRightBoundaryToBarStartTime: true,
+ };
+ case 'VbPFixed@tv-basicstudies-241!':
+ case 'VbPFixed@tv-volumebyprice-53!':
+ return {
+ ...profile, subscribeRealtime: false, first_bar_time: NaN, last_bar_time: now,
+ };
+ case 'VbPSessions@tv-volumebyprice-53':
+ return { ...profile, extendPocRight: false };
+ case 'VbPSessionsRough@tv-volumebyprice-53!':
+ return { volume: 'Up/Down', vaVolume: 70 };
+ case 'VbPSessionsDetailed@tv-volumebyprice-53!':
+ return {
+ volume: 'Up/Down', vaVolume: 70, subscribeRealtime: false, first_visible_bar_time: NaN, last_visible_bar_time: now,
+ };
+ case 'VbPVisible@tv-volumebyprice-53':
+ return {
+ ...profile, subscribeRealtime: false, first_visible_bar_time: NaN, last_visible_bar_time: now,
+ };
+ default:
+ return undefined;
+ }
+}
+
+/** A built-in TradingView study such as Volume or Volume Profile. */
+export class BuiltInIndicator {
+ readonly type: BuiltInIndicatorType;
+
+ readonly options: Record<string, unknown>;
+
+ readonly #defaults: Record<string, unknown> | undefined;
+
+ constructor(type: BuiltInIndicatorType, options: Record<string, unknown> = {}) {
+ if (!type) throw new TradingViewError('INVALID_ARGUMENT', 'A built-in indicator type is required');
+ this.type = type;
+ this.#defaults = defaultOptions(type);
+ this.options = { ...this.#defaults };
+ for (const [key, value] of Object.entries(options)) this.setOption(key, value);
+ }
+
+ /**
+ * Changes an option. For known types, the key and value type are validated
+ * unless `force` is true.
+ */
+ setOption(key: BuiltInIndicatorOption, value: unknown, force = false): this {
+ if (!force && this.#defaults) {
+ if (!(key in this.#defaults)) {
+ throw new TradingViewError('INVALID_ARGUMENT', `Option '${key}' is not allowed for '${this.type}'`);
+ }
+ const expected = typeof this.#defaults[key];
+ if (typeof value !== expected) {
+ throw new TradingViewError('INVALID_ARGUMENT', `Option '${key}' must be a ${expected}`);
+ }
+ }
+ this.options[key] = value;
+ return this;
+ }
+
+ /** Parameters sent with `create_study` / `modify_study`. */
+ toStudyInputs(): Record<string, unknown> {
+ return { ...this.options };
+ }
+}
diff --git a/src/indicators/index.ts b/src/indicators/index.ts
new file mode 100644
index 0000000..6793f49
--- /dev/null
+++ b/src/indicators/index.ts
@@ -0,0 +1,12 @@
+export { PineIndicator } from './pine-indicator.js';
+export type {
+ PineIndicatorDefinition, PineInput, PineInputType, PineStudyType,
+} from './pine-indicator.js';
+export { BuiltInIndicator } from './builtin-indicator.js';
+export type { BuiltInIndicatorOption, BuiltInIndicatorType } from './builtin-indicator.js';
+
+import type { BuiltInIndicator } from './builtin-indicator.js';
+import type { PineIndicator } from './pine-indicator.js';
+
+/** Anything that can run as a study on a chart. */
+export type Indicator = PineIndicator | BuiltInIndicator;
diff --git a/src/indicators/pine-indicator.ts b/src/indicators/pine-indicator.ts
new file mode 100644
index 0000000..2b72a06
--- /dev/null
+++ b/src/indicators/pine-indicator.ts
@@ -0,0 +1,161 @@
+import { TradingViewError } from '../errors.js';
+
+/** Pine input types sent by TradingView. */
+export type PineInputType =
+ | 'text' | 'source' | 'integer' | 'float' | 'resolution' | 'bool' | 'color'
+ | 'session' | 'symbol' | 'time' | 'price' | 'textarea' | (string & {});
+
+export interface PineInput {
+ /** Display name. */
+ name: string;
+ /** Name usable with `setInput` (inline name or sanitised display name). */
+ inline: string;
+ /** Internal ID, when the script defines one. */
+ internalID?: string;
+ tooltip?: string;
+ type: PineInputType;
+ value: unknown;
+ isHidden: boolean;
+ isFake: boolean;
+ /** Allowed values for select inputs. */
+ options?: unknown[];
+}
+
+/** Study type used to create the indicator on a chart. */
+export type PineStudyType = 'Script@tv-scripting-101!' | 'StrategyScript@tv-scripting-101!';
+
+export interface PineIndicatorDefinition {
+ /** Script ID, like `STD;RSI`, `PUB;xxxx` or `USER;xxxx`. */
+ id: string;
+ version: string;
+ description: string;
+ shortDescription: string;
+ /** Inputs indexed by input ID (`in_0`, `in_1`...). */
+ inputs: Record<string, PineInput>;
+ /** Plot names indexed by plot ID (`plot_0`...). */
+ plots: Record<string, string>;
+ /** Compiled script (IL template) sent to the chart. */
+ script: string;
+ /** Study type. Defaults to `Script@tv-scripting-101!`. */
+ type?: PineStudyType;
+}
+
+const INPUT_TYPES: Record<string, 'boolean' | 'number' | 'string'> = {
+ bool: 'boolean',
+ integer: 'number',
+ float: 'number',
+ text: 'string',
+};
+
+/** A Pine script (built-in, public, invite-only or private) ready to run on a chart. */
+export class PineIndicator {
+ readonly id: string;
+
+ readonly version: string;
+
+ readonly description: string;
+
+ readonly shortDescription: string;
+
+ readonly inputs: Record<string, PineInput>;
+
+ readonly plots: Record<string, string>;
+
+ readonly script: string;
+
+ #type: PineStudyType;
+
+ constructor(definition: PineIndicatorDefinition) {
+ this.id = definition.id;
+ this.version = definition.version;
+ this.description = definition.description;
+ this.shortDescription = definition.shortDescription;
+ this.inputs = structuredClone(definition.inputs);
+ this.plots = { ...definition.plots };
+ this.script = definition.script;
+ this.#type = definition.type ?? 'Script@tv-scripting-101!';
+ }
+
+ /** Study type used to create the indicator on a chart. */
+ get type(): PineStudyType {
+ return this.#type;
+ }
+
+ /** Changes the study type, for example to run a strategy as `StrategyScript`. */
+ setType(type: PineStudyType): this {
+ this.#type = type;
+ return this;
+ }
+
+ /** Finds the input ID for an input ID (`in_0`), its number (`0`), inline name or internal ID. */
+ findInput(key: string | number): string | undefined {
+ if (this.inputs[`in_${key}`]) return `in_${key}`;
+ if (this.inputs[key]) return String(key);
+ return Object.keys(this.inputs).find((id) => (
+ this.inputs[id].inline === key || this.inputs[id].internalID === key
+ ));
+ }
+
+ /**
+ * Changes an input value, with type and option validation.
+ * @param key Input ID (`in_0`), number (`0`), inline name or internal ID.
+ */
+ setInput(key: string | number, value: unknown): this {
+ const id = this.findInput(key);
+ if (!id) throw new TradingViewError('INVALID_ARGUMENT', `Input '${key}' not found`);
+ const input = this.inputs[id];
+
+ const expected = INPUT_TYPES[input.type];
+ if (expected && typeof value !== expected) {
+ throw new TradingViewError('INVALID_ARGUMENT', `Input '${input.name}' (${id}) must be a ${expected}`);
+ }
+ if (input.options && !input.options.includes(value)) {
+ throw new TradingViewError(
+ 'INVALID_ARGUMENT',
+ `Input '${input.name}' (${id}) must be one of: ${input.options.map(String).join(', ')}`,
+ { details: input.options },
+ );
+ }
+
+ input.value = value;
+ return this;
+ }
+
+ /** Changes several inputs at once. */
+ setInputs(values: Record<string, unknown>): this {
+ for (const [key, value] of Object.entries(values)) this.setInput(key, value);
+ return this;
+ }
+
+ /** Independent copy, so one definition can run with different inputs. */
+ clone(): PineIndicator {
+ return new PineIndicator({
+ id: this.id,
+ version: this.version,
+ description: this.description,
+ shortDescription: this.shortDescription,
+ inputs: this.inputs,
+ plots: this.plots,
+ script: this.script,
+ type: this.#type,
+ });
+ }
+
+ /** Parameters sent with `create_study` / `modify_study`. */
+ toStudyInputs(): Record<string, unknown> {
+ const inputs: Record<string, unknown> = { text: this.script };
+ if (this.id) inputs.pineId = this.id;
+ if (this.version) inputs.pineVersion = this.version;
+
+ Object.keys(this.inputs).forEach((id, index) => {
+ const input = this.inputs[id];
+ inputs[id] = {
+ // TradingView expects colour inputs as their position, not their value.
+ v: input.type !== 'color' ? input.value : index,
+ f: input.isFake,
+ t: input.type,
+ };
+ });
+ return inputs;
+ }
+}
diff --git a/src/miscRequests.js b/src/miscRequests.js
deleted file mode 100644
index ca1153a..0000000
--- a/src/miscRequests.js
+++ /dev/null
@@ -1,615 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const os = require('os');
-const axios = require('axios');
-
-const PineIndicator = require('./classes/PineIndicator');
-const { genAuthCookies } = require('./utils');
-
-const validateStatus = (status) => status < 500;
-
-const indicators = ['Recommend.Other', 'Recommend.All', 'Recommend.MA'];
-const builtInIndicList = [];
-
-async function fetchScanData(tickers = [], columns = []) {
- const { data } = await axios.post(
- 'https://scanner.tradingview.com/global/scan',
- {
- symbols: { tickers },
- columns,
- },
- { validateStatus },
- );
-
- return data;
-}
-
-/** @typedef {number} advice */
-
-/**
- * @typedef {{
- * Other: advice,
- * All: advice,
- * MA: advice
- * }} Period
- */
-
-/**
- * @typedef {{
- * '1': Period,
- * '5': Period,
- * '15': Period,
- * '60': Period,
- * '240': Period,
- * '1D': Period,
- * '1W': Period,
- * '1M': Period
- * }} Periods
- */
-
-module.exports = {
- /**
- * Get technical analysis
- * @function getTA
- * @param {string} id Full market id (Example: COINBASE:BTCEUR)
- * @returns {Promise<Periods>} results
- */
- async getTA(id) {
- const advice = {};
-
- const cols = ['1', '5', '15', '60', '240', '1D', '1W', '1M']
- .map((t) => indicators.map((i) => (t !== '1D' ? `${i}|${t}` : i)))
- .flat();
-
- const rs = await fetchScanData([id], cols);
- if (!rs.data || !rs.data[0]) return false;
-
- rs.data[0].d.forEach((val, i) => {
- const [name, period] = cols[i].split('|');
- const pName = period || '1D';
- if (!advice[pName]) advice[pName] = {};
- advice[pName][name.split('.').pop()] = Math.round(val * 1000) / 500;
- });
-
- return advice;
- },
-
- /**
- * @typedef {Object} SearchMarketResult
- * @prop {string} id Market full symbol
- * @prop {string} exchange Market exchange name
- * @prop {string} fullExchange Market exchange full name
- * @prop {string} symbol Market symbol
- * @prop {string} description Market name
- * @prop {string} type Market type
- * @prop {() => Promise<Periods>} getTA Get market technical analysis
- */
-
- /**
- * Find a symbol (deprecated)
- * @function searchMarket
- * @param {string} search Keywords
- * @param {'stock'
- * | 'futures' | 'forex' | 'cfd'
- * | 'crypto' | 'index' | 'economic'
- * } [filter] Caterogy filter
- * @returns {Promise<SearchMarketResult[]>} Search results
- * @deprecated Use searchMarketV3 instead
- */
- async searchMarket(search, filter = '') {
- const { data } = await axios.get(
- 'https://symbol-search.tradingview.com/symbol_search',
- {
- params: {
- text: search.replace(/ /g, '%20'),
- type: filter,
- },
- headers: {
- origin: 'https://www.tradingview.com',
- },
- validateStatus,
- },
- );
-
- return data.map((s) => {
- const exchange = s.exchange.split(' ')[0];
- const id = `${exchange}:${s.symbol}`;
-
- return {
- id,
- exchange,
- fullExchange: s.exchange,
- symbol: s.symbol,
- description: s.description,
- type: s.type,
- getTA: () => this.getTA(id),
- };
- });
- },
-
- /**
- * Find a symbol
- * @function searchMarketV3
- * @param {string} search Keywords
- * @param {'stock'
- * | 'futures' | 'forex' | 'cfd'
- * | 'crypto' | 'index' | 'economic'
- * } [filter] Caterogy filter
- * @param {number} offset Pagination offset
- * @returns {Promise<SearchMarketResult[]>} Search results
- */
- async searchMarketV3(search, filter = '', offset = 0) {
- const splittedSearch = search.toUpperCase().replace(/ /g, '+').split(':');
-
- const request = await axios.get(
- 'https://symbol-search.tradingview.com/symbol_search/v3',
- {
- params: {
- exchange: (splittedSearch.length === 2
- ? splittedSearch[0]
- : undefined
- ),
- text: splittedSearch.pop(),
- search_type: filter,
- start: offset,
- },
- headers: {
- origin: 'https://www.tradingview.com',
- },
- validateStatus,
- },
- );
-
- const { data } = request;
-
- return data.symbols.map((s) => {
- const exchange = s.exchange.split(' ')[0];
- const id = s.prefix ? `${s.prefix}:${s.symbol}` : `${exchange.toUpperCase()}:${s.symbol}`;
-
- return {
- id,
- exchange,
- fullExchange: s.exchange,
- symbol: s.symbol,
- description: s.description,
- type: s.type,
- getTA: () => this.getTA(id),
- };
- });
- },
-
- /**
- * @typedef {Object} SearchIndicatorResult
- * @prop {string} id Script ID
- * @prop {string} version Script version
- * @prop {string} name Script complete name
- * @prop {{ id: number, username: string }} author Author user ID
- * @prop {string} image Image ID https://tradingview.com/i/${image}
- * @prop {string | ''} source Script source (if available)
- * @prop {'study' | 'strategy'} type Script type (study / strategy)
- * @prop {'open_source' | 'closed_source' | 'invite_only'
- * | 'private' | 'other'} access Script access type
- * @prop {() => Promise<PineIndicator>} get Get the full indicator informations
- */
-
- /**
- * Find an indicator
- * @function searchIndicator
- * @param {string} search Keywords
- * @returns {Promise<SearchIndicatorResult[]>} Search results
- */
- async searchIndicator(search = '') {
- if (!builtInIndicList.length) {
- await Promise.all(['standard', 'candlestick', 'fundamental'].map(async (type) => {
- const { data } = await axios.get(
- 'https://pine-facade.tradingview.com/pine-facade/list',
- {
- params: {
- filter: type,
- },
- validateStatus,
- },
- );
- builtInIndicList.push(...data);
- }));
- }
-
- const { data } = await axios.get(
- 'https://www.tradingview.com/pubscripts-suggest-json',
- {
- params: {
- search: search.replace(/ /g, '%20'),
- },
- validateStatus,
- },
- );
-
- function norm(str = '') {
- return str.toUpperCase().replace(/[^A-Z]/g, '');
- }
-
- return [
- ...builtInIndicList.filter((i) => (
- norm(i.scriptName).includes(norm(search))
- || norm(i.extra.shortDescription).includes(norm(search))
- )).map((ind) => ({
- id: ind.scriptIdPart,
- version: ind.version,
- name: ind.scriptName,
- author: {
- id: ind.userId,
- username: '@TRADINGVIEW@',
- },
- image: '',
- access: 'closed_source',
- source: '',
- type: (ind.extra && ind.extra.kind) ? ind.extra.kind : 'study',
- get() {
- return module.exports.getIndicator(ind.scriptIdPart, ind.version);
- },
- })),
-
- ...data.results.map((ind) => ({
- id: ind.scriptIdPart,
- version: ind.version,
- name: ind.scriptName,
- author: {
- id: ind.author.id,
- username: ind.author.username,
- },
- image: ind.imageUrl,
- access: ['open_source', 'closed_source', 'invite_only'][ind.access - 1] || 'other',
- source: ind.scriptSource,
- type: (ind.extra && ind.extra.kind) ? ind.extra.kind : 'study',
- get() {
- return module.exports.getIndicator(ind.scriptIdPart, ind.version);
- },
- })),
- ];
- },
-
- /**
- * Get an indicator
- * @function getIndicator
- * @param {string} id Indicator ID (Like: PUB;XXXXXXXXXXXXXXXXXXXXX)
- * @param {'last' | string} [version] Wanted version of the indicator
- * @param {string} [session] User 'sessionid' cookie
- * @param {string} [signature] User 'sessionid_sign' cookie
- * @returns {Promise<PineIndicator>} Indicator
- */
- async getIndicator(id, version = 'last', session = '', signature = '') {
- const indicID = id.replace(/ |%/g, '%25');
-
- const { data } = await axios.get(
- `https://pine-facade.tradingview.com/pine-facade/translate/${indicID}/${version}`,
- {
- headers: {
- cookie: genAuthCookies(session, signature),
- },
- validateStatus,
- },
- );
-
- if (!data.success || !data.result.metaInfo || !data.result.metaInfo.inputs) {
- throw new Error(`Inexistent or unsupported indicator: "${data.reason}"`);
- }
-
- const inputs = {};
-
- data.result.metaInfo.inputs.forEach((input) => {
- if (['text', 'pineId', 'pineVersion'].includes(input.id)) return;
-
- const inlineName = input.name.replace(/ /g, '_').replace(/[^a-zA-Z0-9_]/g, '');
-
- inputs[input.id] = {
- name: input.name,
- inline: input.inline || inlineName,
- internalID: input.internalID || inlineName,
- tooltip: input.tooltip,
-
- type: input.type,
- value: input.defval,
- isHidden: !!input.isHidden,
- isFake: !!input.isFake,
- };
-
- if (input.options) inputs[input.id].options = input.options;
- });
-
- const plots = {};
-
- Object.keys(data.result.metaInfo.styles).forEach((plotId) => {
- const plotTitle = data
- .result
- .metaInfo
- .styles[plotId]
- .title
- .replace(/ /g, '_')
- .replace(/[^a-zA-Z0-9_]/g, '');
-
- const titles = Object.values(plots);
-
- if (titles.includes(plotTitle)) {
- let i = 2;
- while (titles.includes(`${plotTitle}_${i}`)) i += 1;
- plots[plotId] = `${plotTitle}_${i}`;
- } else plots[plotId] = plotTitle;
- });
-
- data.result.metaInfo.plots.forEach((plot) => {
- if (!plot.target) return;
- plots[plot.id] = `${plots[plot.target] ?? plot.target}_${plot.type}`;
- });
-
- return new PineIndicator({
- pineId: data.result.metaInfo.scriptIdPart || indicID,
- pineVersion: data.result.metaInfo.pine.version || version,
- description: data.result.metaInfo.description,
- shortDescription: data.result.metaInfo.shortDescription,
- inputs,
- plots,
- script: data.result.ilTemplate,
- });
- },
-
- /**
- * @typedef {Object} User Instance of User
- * @prop {number} id User ID
- * @prop {string} username User username
- * @prop {string} firstName User first name
- * @prop {string} lastName User last name
- * @prop {number} reputation User reputation
- * @prop {number} following Number of following accounts
- * @prop {number} followers Number of followers
- * @prop {Object} notifications User's notifications
- * @prop {number} notifications.user User notifications
- * @prop {number} notifications.following Notification from following accounts
- * @prop {string} session User session
- * @prop {string} sessionHash User session hash
- * @prop {string} signature User session signature
- * @prop {string} privateChannel User private channel
- * @prop {string} authToken User auth token
- * @prop {Date} joinDate Account creation date
- */
-
- /**
- * Get user and sessionid from username/email and password
- * @function loginUser
- * @param {string} username User username/email
- * @param {string} password User password
- * @param {boolean} [remember] Remember the session (default: false)
- * @param {string} [UA] Custom UserAgent
- * @returns {Promise<User>} Token
- */
- async loginUser(username, password, remember = true, UA = 'TWAPI/3.0') {
- const { data, headers } = await axios.post(
- 'https://www.tradingview.com/accounts/signin/',
- `username=${username}&password=${password}${remember ? '&remember=on' : ''}`,
- {
- headers: {
- referer: 'https://www.tradingview.com',
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'User-agent': `${UA} (${os.version()}; ${os.platform()}; ${os.arch()})`,
- },
- validateStatus,
- },
- );
-
- const cookies = headers['set-cookie'];
-
- if (data.error) throw new Error(data.error);
-
- const sessionCookie = cookies.find((c) => c.includes('sessionid='));
- const session = (sessionCookie.match(/sessionid=(.*?);/) ?? [])[1];
-
- const signCookie = cookies.find((c) => c.includes('sessionid_sign='));
- const signature = (signCookie.match(/sessionid_sign=(.*?);/) ?? [])[1];
-
- return {
- id: data.user.id,
- username: data.user.username,
- firstName: data.user.first_name,
- lastName: data.user.last_name,
- reputation: data.user.reputation,
- following: data.user.following,
- followers: data.user.followers,
- notifications: data.user.notification_count,
- session,
- signature,
- sessionHash: data.user.session_hash,
- privateChannel: data.user.private_channel,
- authToken: data.user.auth_token,
- joinDate: new Date(data.user.date_joined),
- };
- },
-
- /**
- * Get user from 'sessionid' cookie
- * @function getUser
- * @param {string} session User 'sessionid' cookie
- * @param {string} [signature] User 'sessionid_sign' cookie
- * @param {string} [location] Auth page location (For france: https://fr.tradingview.com/)
- * @returns {Promise<User>} Token
- */
- async getUser(session, signature = '', location = 'https://www.tradingview.com/', redirectCount = 0) {
- if (redirectCount > 5) {
- throw new Error('Too many redirects - possible WAF or geo-restriction');
- }
-
- const { data, headers } = await axios.get(location, {
- headers: {
- cookie: genAuthCookies(session, signature),
- },
- maxRedirects: 0,
- validateStatus,
- });
-
- if (data.includes('auth_token')) {
- return {
- id: /"id":([0-9]{1,10}),/.exec(data)?.[1],
- username: /"username":"(.*?)"/.exec(data)?.[1],
- firstName: /"first_name":"(.*?)"/.exec(data)?.[1],
- lastName: /"last_name":"(.*?)"/.exec(data)?.[1],
- reputation: parseFloat(/"reputation":(.*?),/.exec(data)?.[1] || 0),
- following: parseFloat(/,"following":([0-9]*?),/.exec(data)?.[1] || 0),
- followers: parseFloat(/,"followers":([0-9]*?),/.exec(data)?.[1] || 0),
- notifications: {
- following: parseFloat(/"notification_count":\{"following":([0-9]*),/.exec(data)?.[1] ?? 0),
- user: parseFloat(/"notification_count":\{"following":[0-9]*,"user":([0-9]*)/.exec(data)?.[1] ?? 0),
- },
- session,
- signature,
- sessionHash: /"session_hash":"(.*?)"/.exec(data)?.[1],
- privateChannel: /"private_channel":"(.*?)"/.exec(data)?.[1],
- authToken: /"auth_token":"(.*?)"/.exec(data)?.[1],
- joinDate: new Date(/"date_joined":"(.*?)"/.exec(data)?.[1] || 0),
- };
- }
-
- if (headers.location !== location) {
- return this.getUser(session, signature, headers.location, redirectCount + 1);
- }
-
- throw new Error('Wrong or expired sessionid/signature');
- },
-
- /**
- * Get user's private indicators from a 'sessionid' cookie
- * @function getPrivateIndicators
- * @param {string} session User 'sessionid' cookie
- * @param {string} [signature] User 'sessionid_sign' cookie
- * @returns {Promise<SearchIndicatorResult[]>} Search results
- */
- async getPrivateIndicators(session, signature = '') {
- const { data } = await axios.get(
- 'https://pine-facade.tradingview.com/pine-facade/list',
- {
- headers: {
- cookie: genAuthCookies(session, signature),
- },
- params: {
- filter: 'saved',
- },
- validateStatus,
- },
- );
-
- return data.map((ind) => ({
- id: ind.scriptIdPart,
- version: ind.version,
- name: ind.scriptName,
- author: {
- id: -1,
- username: '@ME@',
- },
- image: ind.imageUrl,
- access: 'private',
- source: ind.scriptSource,
- type: (ind.extra && ind.extra.kind) ? ind.extra.kind : 'study',
- get() {
- return module.exports.getIndicator(
- ind.scriptIdPart,
- ind.version,
- session,
- signature,
- );
- },
- }));
- },
-
- /**
- * User credentials
- * @typedef {Object} UserCredentials
- * @prop {number} id User ID
- * @prop {string} session User session ('sessionid' cookie)
- * @prop {string} [signature] User session signature ('sessionid_sign' cookie)
- */
-
- /**
- * Get a chart token from a layout ID and the user credentials if the layout is not public
- * @function getChartToken
- * @param {string} layout The layout ID found in the layout URL (Like: 'XXXXXXXX')
- * @param {UserCredentials} [credentials] User credentials (id + session + [signature])
- * @returns {Promise<string>} Token
- */
- async getChartToken(layout, credentials = {}) {
- const { id, session, signature } = (
- credentials.id && credentials.session
- ? credentials
- : { id: -1, session: null, signature: null }
- );
-
- const { data } = await axios.get(
- 'https://www.tradingview.com/chart-token',
- {
- headers: {
- cookie: genAuthCookies(session, signature),
- },
- params: {
- image_url: layout,
- user_id: id,
- },
- validateStatus,
- },
- );
-
- if (!data.token) throw new Error('Wrong layout or credentials');
-
- return data.token;
- },
-
- /**
- * @typedef {Object} DrawingPoint Drawing poitn
- * @prop {number} time_t Point X time position
- * @prop {number} price Point Y price position
- * @prop {number} offset Point offset
- */
-
- /**
- * @typedef {Object} Drawing
- * @prop {string} id Drawing ID (Like: 'XXXXXX')
- * @prop {string} symbol Layout market symbol (Like: 'BINANCE:BUCEUR')
- * @prop {string} ownerSource Owner user ID (Like: 'XXXXXX')
- * @prop {string} serverUpdateTime Drawing last update timestamp
- * @prop {string} currencyId Currency ID (Like: 'EUR')
- * @prop {any} unitId Unit ID
- * @prop {string} type Drawing type
- * @prop {DrawingPoint[]} points List of drawing points
- * @prop {number} zorder Drawing Z order
- * @prop {string} linkKey Drawing link key
- * @prop {Object} state Drawing state
- */
-
- /**
- * Get a chart token from a layout ID and the user credentials if the layout is not public
- * @function getDrawings
- * @param {string} layout The layout ID found in the layout URL (Like: 'XXXXXXXX')
- * @param {string | ''} [symbol] Market filter (Like: 'BINANCE:BTCEUR')
- * @param {UserCredentials} [credentials] User credentials (id + session + [signature])
- * @param {number} [chartID] Chart ID
- * @returns {Promise<Drawing[]>} Drawings
- */
- async getDrawings(layout, symbol = '', credentials = {}, chartID = '_shared') {
- const chartToken = await module.exports.getChartToken(layout, credentials);
-
- const { data } = await axios.get(
- `https://charts-storage.tradingview.com/charts-storage/get/layout/${
- layout
- }/sources`,
- {
- params: {
- chart_id: chartID,
- jwt: chartToken,
- symbol,
- },
- validateStatus,
- },
- );
-
- if (!data.payload) throw new Error('Wrong layout, user credentials, or chart id.');
-
- return Object.values(data.payload.sources || {}).map((drawing) => ({
- ...drawing, ...drawing.state,
- }));
- },
-};
diff --git a/src/protocol.js b/src/protocol.js
deleted file mode 100644
index 1c94e0a..0000000
--- a/src/protocol.js
+++ /dev/null
@@ -1,106 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const zlib = require('zlib');
-const JSZip = require('jszip');
-
-/**
- * @typedef {Object} TWPacket
- * @prop {string} [m] Packet type
- * @prop {[session: string, {}]} [p] Packet data
- */
-
-const cleanerRgx = /~h~/g;
-const splitterRgx = /~m~[0-9]{1,}~m~/g;
-
-/**
- * Normalise base64 data received from TradingView.
- * TradingView occasionally omits padding and may use URL-safe characters.
- * @param {string} data Base64 payload
- * @returns {string} Normalised base64 payload
- */
-function normaliseBase64(data) {
- const normalised = data.replace(/-/g, '+').replace(/_/g, '/');
- return normalised.padEnd(normalised.length + ((4 - (normalised.length % 4)) % 4), '=');
-}
-
-/**
- * Parse JSON from a decoded buffer, optionally trying common compression wrappers.
- * @param {Buffer} buffer Decoded compressed payload
- * @returns {Object | undefined} Parsed JSON when a format matches
- */
-function parseDecodedCompressed(buffer) {
- const readers = [
- () => buffer,
- () => zlib.inflateSync(buffer),
- () => zlib.inflateRawSync(buffer),
- () => zlib.gunzipSync(buffer),
- ];
-
- for (const read of readers) {
- try {
- return JSON.parse(read().toString('utf8'));
- } catch (error) {
- // Try the next known TradingView payload format.
- }
- }
-
- return undefined;
-}
-
-module.exports = {
- /**
- * Parse websocket packet
- * @function parseWSPacket
- * @param {string} str Websocket raw data
- * @returns {TWPacket[]} TradingView packets
- */
- parseWSPacket(str) {
- return str.replace(cleanerRgx, '').split(splitterRgx)
- .map((p) => {
- if (!p) return false;
- try {
- return JSON.parse(p);
- } catch (error) {
- console.warn('Cant parse', p);
- return false;
- }
- })
- .filter((p) => p);
- },
-
- /**
- * Format websocket packet
- * @function formatWSPacket
- * @param {TWPacket} packet TradingView packet
- * @returns {string} Websocket raw data
- */
- formatWSPacket(packet) {
- const msg = typeof packet === 'object'
- ? JSON.stringify(packet)
- : packet;
- return `~m~${msg.length}~m~${msg}`;
- },
-
- /**
- * Parse compressed data
- * @function parseCompressed
- * @param {string} data Compressed data
- * @returns {Promise<{}>} Parsed data
- */
- async parseCompressed(data) {
- const normalised = normaliseBase64(data);
- const zip = new JSZip();
-
- try {
- const archive = await zip.loadAsync(normalised, { base64: true });
- const file = archive.file('') || archive.file(/.*/)[0];
- if (!file) throw new Error('Compressed payload does not contain a file');
- return JSON.parse(await file.async('text'));
- } catch (zipError) {
- const decoded = Buffer.from(normalised, 'base64');
- const parsed = parseDecodedCompressed(decoded);
- if (parsed) return parsed;
- throw zipError;
- }
- },
-};
diff --git a/src/protocol/compression.ts b/src/protocol/compression.ts
new file mode 100644
index 0000000..11dd758
--- /dev/null
+++ b/src/protocol/compression.ts
@@ -0,0 +1,88 @@
+import { gunzipSync, inflateRawSync, inflateSync } from 'node:zlib';
+
+import { TradingViewError } from '../errors.js';
+
+/**
+ * TradingView sends large strategy reports as base64 data (`dataCompressed`).
+ * The payload is usually a ZIP archive with a single entry, but zlib, raw
+ * deflate, gzip and plain JSON have also been observed. Base64 may be URL-safe
+ * and unpadded.
+ */
+
+/** Normalises URL-safe and unpadded base64. */
+export function normaliseBase64(data: string): string {
+ const normalised = data.replace(/-/g, '+').replace(/_/g, '/').replace(/\s/g, '');
+ return normalised.padEnd(normalised.length + ((4 - (normalised.length % 4)) % 4), '=');
+}
+
+const LOCAL_FILE_HEADER = 0x04034b50;
+const CENTRAL_DIRECTORY_HEADER = 0x02014b50;
+const END_OF_CENTRAL_DIRECTORY = 0x06054b50;
+
+function inflateEntry(method: number, data: Buffer): Buffer {
+ if (method === 0) return data;
+ if (method === 8) return inflateRawSync(data);
+ throw new Error(`Unsupported ZIP compression method ${method}`);
+}
+
+/** Reads the first file of a ZIP archive (stored or deflated). */
+export function readFirstZipEntry(archive: Uint8Array): Uint8Array {
+ const buffer = Buffer.from(archive.buffer, archive.byteOffset, archive.byteLength);
+ // Prefer the central directory: local headers may omit sizes (data descriptors).
+ for (let eocd = buffer.length - 22; eocd >= Math.max(0, buffer.length - 0xffff - 22); eocd -= 1) {
+ if (buffer.readUInt32LE(eocd) !== END_OF_CENTRAL_DIRECTORY) continue;
+ const entries = buffer.readUInt16LE(eocd + 10);
+ let cursor = buffer.readUInt32LE(eocd + 16);
+ for (let i = 0; i < entries; i += 1) {
+ if (buffer.readUInt32LE(cursor) !== CENTRAL_DIRECTORY_HEADER) break;
+ const method = buffer.readUInt16LE(cursor + 10);
+ const compressedSize = buffer.readUInt32LE(cursor + 20);
+ const nameLength = buffer.readUInt16LE(cursor + 28);
+ const extraLength = buffer.readUInt16LE(cursor + 30);
+ const commentLength = buffer.readUInt16LE(cursor + 32);
+ const localOffset = buffer.readUInt32LE(cursor + 42);
+ const name = buffer.toString('utf8', cursor + 46, cursor + 46 + nameLength);
+ cursor += 46 + nameLength + extraLength + commentLength;
+ if (name.endsWith('/')) continue; // Directory entry.
+
+ const localNameLength = buffer.readUInt16LE(localOffset + 26);
+ const localExtraLength = buffer.readUInt16LE(localOffset + 28);
+ const start = localOffset + 30 + localNameLength + localExtraLength;
+ return inflateEntry(method, buffer.subarray(start, start + compressedSize));
+ }
+ break;
+ }
+
+ // No usable central directory: fall back to the first local header.
+ if (buffer.length >= 30 && buffer.readUInt32LE(0) === LOCAL_FILE_HEADER) {
+ const method = buffer.readUInt16LE(8);
+ const compressedSize = buffer.readUInt32LE(18);
+ const start = 30 + buffer.readUInt16LE(26) + buffer.readUInt16LE(28);
+ const end = compressedSize > 0 ? start + compressedSize : buffer.length;
+ return inflateEntry(method, buffer.subarray(start, end));
+ }
+
+ throw new Error('Not a ZIP archive');
+}
+
+/** Decodes a TradingView compressed payload into JSON. */
+export function decodeCompressed(data: string): unknown {
+ const buffer = Buffer.from(normaliseBase64(data), 'base64');
+ const readers: Array<() => Uint8Array> = [
+ () => readFirstZipEntry(buffer),
+ () => buffer,
+ () => inflateSync(buffer),
+ () => inflateRawSync(buffer),
+ () => gunzipSync(buffer),
+ ];
+
+ let lastError: unknown;
+ for (const read of readers) {
+ try {
+ return JSON.parse(Buffer.from(read()).toString('utf8'));
+ } catch (error) {
+ lastError = error;
+ }
+ }
+ throw new TradingViewError('PARSE_ERROR', 'Unable to decode compressed payload', { cause: lastError });
+}
diff --git a/src/protocol/framing.ts b/src/protocol/framing.ts
new file mode 100644
index 0000000..a786d11
--- /dev/null
+++ b/src/protocol/framing.ts
@@ -0,0 +1,111 @@
+/**
+ * TradingView websocket framing.
+ *
+ * Every websocket message contains one or more frames: `~m~<length>~m~<payload>`.
+ * The length counts UTF-16 code units (JavaScript string length). Payloads are
+ * either JSON packets or heartbeats (`~h~<id>`), which the client must echo.
+ */
+
+/** A JSON packet sent by the server: `m` is the method, `p` its parameters. */
+export interface ServerPacket {
+ m: string;
+ p: unknown[];
+ /** Server timestamp in seconds. */
+ t?: number;
+ /** Server timestamp in milliseconds. */
+ t_ms?: number;
+}
+
+/** Greeting sent by the server right after the websocket opens. */
+export interface ServerHello {
+ session_id: string;
+ timestamp: number;
+ timestampMs: number;
+ release: string;
+ studies_metadata_hash: string;
+ auth_scheme_vsn: number;
+ protocol: 'json' | string;
+ via: string;
+ javastudies: string[];
+ [key: string]: unknown;
+}
+
+export type Frame =
+ /** Heartbeat to echo back with `encodeHeartbeat(id)`. */
+ | { type: 'heartbeat'; id: number }
+ /** Method packet (`{ m, p }`). */
+ | { type: 'packet'; packet: ServerPacket }
+ /** Any other JSON payload (for example the server greeting). */
+ | { type: 'data'; data: unknown }
+ /** A payload that could not be parsed. */
+ | { type: 'invalid'; raw: string; error: unknown };
+
+const HEADER = '~m~';
+const HEARTBEAT = '~h~';
+
+function decodePayload(raw: string): Frame {
+ if (raw.startsWith(HEARTBEAT)) {
+ const id = Number(raw.slice(HEARTBEAT.length));
+ if (Number.isFinite(id)) return { type: 'heartbeat', id };
+ return { type: 'invalid', raw, error: new Error('Invalid heartbeat') };
+ }
+
+ let data: unknown;
+ try {
+ data = JSON.parse(raw);
+ } catch (error) {
+ return { type: 'invalid', raw, error };
+ }
+
+ if (data && typeof data === 'object' && typeof (data as ServerPacket).m === 'string') {
+ const packet = data as ServerPacket;
+ return { type: 'packet', packet: { ...packet, p: Array.isArray(packet.p) ? packet.p : [] } };
+ }
+ return { type: 'data', data };
+}
+
+/** Lenient fallback for malformed input: split on frame headers. */
+function splitFrames(input: string): string[] {
+ return input.split(/~m~\d+~m~/).filter((part) => part.length > 0);
+}
+
+/** Decodes a raw websocket message into frames. */
+export function decodeFrames(input: string): Frame[] {
+ const payloads: string[] = [];
+ let position = 0;
+
+ while (position < input.length) {
+ if (!input.startsWith(HEADER, position)) {
+ payloads.push(...splitFrames(input.slice(position)));
+ break;
+ }
+ const lengthStart = position + HEADER.length;
+ const lengthEnd = input.indexOf(HEADER, lengthStart);
+ const length = Number(input.slice(lengthStart, lengthEnd));
+ if (lengthEnd < 0 || !Number.isInteger(length) || length < 0) {
+ payloads.push(...splitFrames(input.slice(position)));
+ break;
+ }
+ const start = lengthEnd + HEADER.length;
+ payloads.push(input.slice(start, start + length));
+ position = start + length;
+ }
+
+ return payloads.map(decodePayload);
+}
+
+/** Encodes one frame. Objects are JSON-encoded. */
+export function encodeFrame(payload: string | object): string {
+ const body = typeof payload === 'string' ? payload : JSON.stringify(payload);
+ return `${HEADER}${body.length}${HEADER}${body}`;
+}
+
+/** Encodes a client packet (`{ m: method, p: params }`). */
+export function encodePacket(method: string, params: readonly unknown[] = []): string {
+ return encodeFrame({ m: method, p: params });
+}
+
+/** Encodes the reply to a server heartbeat. */
+export function encodeHeartbeat(id: number): string {
+ return encodeFrame(`${HEARTBEAT}${id}`);
+}
diff --git a/src/protocol/ids.ts b/src/protocol/ids.ts
new file mode 100644
index 0000000..a27cdc6
--- /dev/null
+++ b/src/protocol/ids.ts
@@ -0,0 +1,10 @@
+const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+
+/** Creates a random session or request ID such as `cs_Ab12Cd34Ef56`. */
+export function createSessionId(prefix = 'xs'): string {
+ const bytes = new Uint8Array(12);
+ globalThis.crypto.getRandomValues(bytes);
+ let id = '';
+ for (const byte of bytes) id += ALPHABET[byte % ALPHABET.length];
+ return `${prefix}_${id}`;
+}
diff --git a/src/protocol/index.ts b/src/protocol/index.ts
new file mode 100644
index 0000000..4ed8dc0
--- /dev/null
+++ b/src/protocol/index.ts
@@ -0,0 +1,6 @@
+export {
+ decodeFrames, encodeFrame, encodeHeartbeat, encodePacket,
+} from './framing.js';
+export type { Frame, ServerHello, ServerPacket } from './framing.js';
+export { decodeCompressed, normaliseBase64, readFirstZipEntry } from './compression.js';
+export { createSessionId } from './ids.js';
diff --git a/src/quote/fields.ts b/src/quote/fields.ts
new file mode 100644
index 0000000..245258e
--- /dev/null
+++ b/src/quote/fields.ts
@@ -0,0 +1,69 @@
+/** Quote fields TradingView can stream. Other field names are accepted too. */
+export type QuoteField =
+ | 'base-currency-logoid' | 'ch' | 'chp' | 'currency-logoid' | 'provider_id'
+ | 'currency_code' | 'current_session' | 'description'
+ | 'exchange' | 'format' | 'fractional' | 'is_tradable'
+ | 'language' | 'local_description' | 'logoid' | 'lp'
+ | 'lp_time' | 'minmov' | 'minmove2' | 'original_name'
+ | 'pricescale' | 'pro_name' | 'short_name' | 'type'
+ | 'update_mode' | 'volume' | 'ask' | 'bid' | 'fundamentals'
+ | 'high_price' | 'low_price' | 'open_price' | 'prev_close_price'
+ | 'rch' | 'rchp' | 'rtc' | 'rtc_time' | 'status' | 'industry'
+ | 'basic_eps_net_income' | 'beta_1_year' | 'market_cap_basic'
+ | 'earnings_per_share_basic_ttm' | 'price_earnings_ttm'
+ | 'sector' | 'dividends_yield' | 'timezone' | 'country_code'
+ | (string & {});
+
+/** `all` requests every known field, `price` only the last price (`lp`). */
+export type QuoteFieldPreset = 'all' | 'price';
+
+export const ALL_QUOTE_FIELDS: readonly QuoteField[] = [
+ 'base-currency-logoid', 'ch', 'chp', 'currency-logoid',
+ 'currency_code', 'current_session', 'description',
+ 'exchange', 'format', 'fractional', 'is_tradable',
+ 'language', 'local_description', 'logoid', 'lp',
+ 'lp_time', 'minmov', 'minmove2', 'original_name',
+ 'pricescale', 'pro_name', 'short_name', 'type',
+ 'update_mode', 'volume', 'ask', 'bid', 'fundamentals',
+ 'high_price', 'low_price', 'open_price', 'prev_close_price',
+ 'rch', 'rchp', 'rtc', 'rtc_time', 'status', 'industry',
+ 'basic_eps_net_income', 'beta_1_year', 'market_cap_basic',
+ 'earnings_per_share_basic_ttm', 'price_earnings_ttm',
+ 'sector', 'dividends_yield', 'timezone', 'country_code',
+ 'provider_id',
+];
+
+/** Resolves a preset or explicit list into field names. */
+export function resolveQuoteFields(fields: QuoteFieldPreset | readonly QuoteField[] = 'all'): QuoteField[] {
+ if (Array.isArray(fields)) return fields.length ? [...fields] : [...ALL_QUOTE_FIELDS];
+ return fields === 'price' ? ['lp'] : [...ALL_QUOTE_FIELDS];
+}
+
+/**
+ * Latest quote values. Only requested fields that TradingView sent are
+ * present; numbers are raw server values.
+ */
+export interface QuoteData {
+ /** Last price. */
+ lp?: number;
+ /** Time of the last price (Unix seconds). */
+ lp_time?: number;
+ /** Change since previous close. */
+ ch?: number;
+ /** Change since previous close, in percent. */
+ chp?: number;
+ bid?: number;
+ ask?: number;
+ volume?: number;
+ open_price?: number;
+ high_price?: number;
+ low_price?: number;
+ prev_close_price?: number;
+ description?: string;
+ short_name?: string;
+ pro_name?: string;
+ exchange?: string;
+ currency_code?: string;
+ type?: string;
+ [field: string]: unknown;
+}
diff --git a/src/quote/index.ts b/src/quote/index.ts
new file mode 100644
index 0000000..9e7a1d6
--- /dev/null
+++ b/src/quote/index.ts
@@ -0,0 +1,6 @@
+export { QuoteSession, QuoteSubscription, quoteSymbolKey } from './quote-session.js';
+export type {
+ QuoteSessionEvents, QuoteSessionOptions, QuoteSubscriptionEvents, QuoteSubscriptionOptions,
+} from './quote-session.js';
+export { ALL_QUOTE_FIELDS, resolveQuoteFields } from './fields.js';
+export type { QuoteData, QuoteField, QuoteFieldPreset } from './fields.js';
diff --git a/src/quote/market.js b/src/quote/market.js
deleted file mode 100644
index 6537b25..0000000
--- a/src/quote/market.js
+++ /dev/null
@@ -1,134 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-/**
- * @typedef {'loaded' | 'data' | 'error'} MarketEvent
- */
-
-/**
- * @param {import('./session').QuoteSessionBridge} quoteSession
- */
-
-module.exports = (quoteSession) => class QuoteMarket {
- #symbolListeners = quoteSession.symbolListeners;
-
- #symbol;
-
- #session;
-
- #symbolKey;
-
- #symbolListenerID = 0;
-
- #lastData = {};
-
- #callbacks = {
- loaded: [],
- data: [],
-
- event: [],
- error: [],
- };
-
- /**
- * @param {MarketEvent} ev Client event
- * @param {...{}} data Packet data
- */
- #handleEvent(ev, ...data) {
- this.#callbacks[ev].forEach((e) => e(...data));
- this.#callbacks.event.forEach((e) => e(ev, ...data));
- }
-
- #handleError(...msgs) {
- if (this.#callbacks.error.length === 0) console.error(...msgs);
- else this.#handleEvent('error', ...msgs);
- }
-
- /**
- * @param {string} symbol Market symbol (like: 'BTCEUR' or 'KRAKEN:BTCEUR')
- * @param {string} session Market session (like: 'regular' or 'extended')
- */
- constructor(symbol, session = 'regular') {
- this.#symbol = symbol;
- this.#session = session;
- this.#symbolKey = `=${JSON.stringify({ session, symbol })}`;
-
- if (!this.#symbolListeners[this.#symbolKey]) {
- this.#symbolListeners[this.#symbolKey] = [];
- quoteSession.send('quote_add_symbols', [
- quoteSession.sessionID,
- this.#symbolKey,
- ]);
- }
-
- this.#symbolListenerID = this.#symbolListeners[this.#symbolKey].length;
-
- this.#symbolListeners[this.#symbolKey][this.#symbolListenerID] = (packet) => {
- if (global.TW_DEBUG) console.log('§90§30§105 MARKET §0 DATA', packet);
-
- if (packet.type === 'qsd' && packet.data[1].s === 'ok') {
- this.#lastData = {
- ...this.#lastData,
- ...packet.data[1].v,
- };
- this.#handleEvent('data', this.#lastData);
- return;
- }
-
- if (packet.type === 'quote_completed') {
- this.#handleEvent('loaded');
- return;
- }
-
- if (packet.type === 'qsd' && packet.data[1].s === 'error') {
- this.#handleError('Market error', packet.data);
- }
- };
- }
-
- /**
- * When quote market is loaded
- * @param {() => void} cb Callback
- * @event
- */
- onLoaded(cb) {
- this.#callbacks.loaded.push(cb);
- }
-
- /**
- * When quote data is received
- * @param {(data: {}) => void} cb Callback
- * @event
- */
- onData(cb) {
- this.#callbacks.data.push(cb);
- }
-
- /**
- * When quote event happens
- * @param {(...any) => void} cb Callback
- * @event
- */
- onEvent(cb) {
- this.#callbacks.event.push(cb);
- }
-
- /**
- * When quote error happens
- * @param {(...any) => void} cb Callback
- * @event
- */
- onError(cb) {
- this.#callbacks.error.push(cb);
- }
-
- /** Close this listener */
- close() {
- if (this.#symbolListeners[this.#symbolKey].length <= 1) {
- quoteSession.send('quote_remove_symbols', [
- quoteSession.sessionID,
- this.#symbolKey,
- ]);
- }
- delete this.#symbolListeners[this.#symbolKey][this.#symbolListenerID];
- }
-};
diff --git a/src/quote/quote-session.ts b/src/quote/quote-session.ts
new file mode 100644
index 0000000..41652bb
--- /dev/null
+++ b/src/quote/quote-session.ts
@@ -0,0 +1,240 @@
+import type { TradingViewClient } from '../client/client.js';
+import { TradingViewError } from '../errors.js';
+import { Emitter } from '../events.js';
+import type { TradingSession } from '../chart/types.js';
+import type { ServerPacket } from '../protocol/framing.js';
+import { createSessionId } from '../protocol/ids.js';
+import {
+ resolveQuoteFields, type QuoteData, type QuoteField, type QuoteFieldPreset,
+} from './fields.js';
+
+export interface QuoteSessionOptions {
+ /** `all` (default), `price`, or an explicit list of fields. */
+ fields?: QuoteFieldPreset | readonly QuoteField[];
+}
+
+export interface QuoteSubscriptionOptions {
+ /** Trading session. Default: `regular`. */
+ session?: TradingSession;
+}
+
+export interface QuoteSubscriptionEvents {
+ [event: string]: unknown[];
+ /** Initial values were received. */
+ loaded: [];
+ /** New values. `quote` is the merged snapshot, `changes` only the new fields. */
+ data: [quote: QuoteData, changes: QuoteData];
+ error: [error: TradingViewError];
+}
+
+export interface QuoteSessionEvents {
+ [event: string]: unknown[];
+ error: [error: TradingViewError];
+}
+
+/** Key identifying a symbol + session in quote packets. */
+export function quoteSymbolKey(symbol: string, session: TradingSession = 'regular'): string {
+ return `=${JSON.stringify({ session, symbol })}`;
+}
+
+/** Live quotes for one symbol. Create it with `quoteSession.subscribe()`. */
+export class QuoteSubscription extends Emitter<QuoteSubscriptionEvents> {
+ readonly symbol: string;
+
+ readonly session: TradingSession;
+
+ /** @internal */
+ readonly key: string;
+
+ readonly #onClose: (subscription: QuoteSubscription) => void;
+
+ #data: QuoteData = {};
+
+ #loaded = false;
+
+ #closed = false;
+
+ /** @internal Use `quoteSession.subscribe()`. */
+ constructor(symbol: string, session: TradingSession, onClose: (subscription: QuoteSubscription) => void) {
+ super();
+ this.symbol = symbol;
+ this.session = session;
+ this.key = quoteSymbolKey(symbol, session);
+ this.#onClose = onClose;
+ }
+
+ /** Latest merged values. */
+ get data(): QuoteData {
+ return { ...this.#data };
+ }
+
+ /** True after the initial values were received. */
+ get isLoaded(): boolean {
+ return this.#loaded;
+ }
+
+ get isClosed(): boolean {
+ return this.#closed;
+ }
+
+ /** Stops receiving quotes for this subscription. Idempotent. */
+ close(): void {
+ if (this.#closed) return;
+ this.#closed = true;
+ this.#onClose(this);
+ }
+
+ /** @internal Copies the state of a loaded subscription to the same symbol. */
+ seed(source: QuoteSubscription): void {
+ if (!source.isLoaded) return;
+ queueMicrotask(() => {
+ if (this.#closed || this.#loaded) return;
+ this.#data = source.data;
+ this.#loaded = true;
+ this.emit('data', this.data, this.data);
+ this.emit('loaded');
+ });
+ }
+
+ /** @internal */
+ handlePacket(packet: ServerPacket): void {
+ if (this.#closed) return;
+ if (packet.m === 'quote_completed') {
+ this.#loaded = true;
+ this.emit('loaded');
+ return;
+ }
+ const payload = packet.p[1] as { s?: string; v?: QuoteData; errmsg?: string };
+ if (payload?.s === 'ok') {
+ const changes = { ...payload.v };
+ this.#data = { ...this.#data, ...changes };
+ this.emit('data', this.data, changes);
+ } else if (payload?.s === 'error') {
+ this.emit('error', new TradingViewError('QUOTE_ERROR', `Quote error (${this.symbol}): ${payload.errmsg ?? 'unknown'}`, {
+ details: packet.p,
+ }));
+ }
+ }
+
+ /** @internal */
+ handleClose(error: TradingViewError, expected: boolean): void {
+ if (this.#closed) return;
+ this.#closed = true;
+ if (!expected) this.emit('error', error);
+ }
+}
+
+/**
+ * A set of live quote subscriptions sharing the same fields.
+ * Create it with `client.createQuoteSession()`.
+ */
+export class QuoteSession extends Emitter<QuoteSessionEvents> {
+ readonly id = createSessionId('qs');
+
+ readonly client: TradingViewClient;
+
+ readonly #subscriptions = new Map<string, Set<QuoteSubscription>>();
+
+ #fields: QuoteField[];
+
+ #deleted = false;
+
+ constructor(client: TradingViewClient, options: QuoteSessionOptions = {}) {
+ super();
+ this.client = client;
+ this.#fields = resolveQuoteFields(options.fields);
+ client.registerSession(this.id, {
+ onPacket: (packet) => this.#onPacket(packet),
+ onClose: (error, expected) => this.#onClientClose(error, expected),
+ });
+ client.send('quote_create_session', [this.id]);
+ client.send('quote_set_fields', [this.id, ...this.#fields]);
+ }
+
+ /** Requested fields. */
+ get fields(): readonly QuoteField[] {
+ return this.#fields;
+ }
+
+ get isDeleted(): boolean {
+ return this.#deleted;
+ }
+
+ /** Changes the requested fields for every subscription. */
+ setFields(fields: QuoteFieldPreset | readonly QuoteField[]): void {
+ this.#assertAlive();
+ this.#fields = resolveQuoteFields(fields);
+ this.client.send('quote_set_fields', [this.id, ...this.#fields]);
+ }
+
+ /**
+ * Subscribes to a symbol. Several subscriptions to the same symbol share
+ * one server subscription.
+ */
+ subscribe(symbol: string, options: QuoteSubscriptionOptions = {}): QuoteSubscription {
+ this.#assertAlive();
+ if (!symbol) throw new TradingViewError('INVALID_ARGUMENT', 'A symbol is required');
+ const subscription = new QuoteSubscription(symbol, options.session ?? 'regular', (sub) => this.#release(sub));
+ let set = this.#subscriptions.get(subscription.key);
+ if (!set) {
+ set = new Set();
+ this.#subscriptions.set(subscription.key, set);
+ this.client.send('quote_add_symbols', [this.id, subscription.key]);
+ } else {
+ const loaded = [...set].find((sub) => sub.isLoaded);
+ if (loaded) subscription.seed(loaded);
+ }
+ set.add(subscription);
+ return subscription;
+ }
+
+ /** Deletes the session and all its subscriptions. Idempotent. */
+ delete(): void {
+ if (this.#deleted) return;
+ this.#deleted = true;
+ if (!this.client.isClosed) this.client.send('quote_delete_session', [this.id]);
+ this.client.unregisterSession(this.id);
+ for (const set of this.#subscriptions.values()) for (const sub of set) sub.close();
+ this.#subscriptions.clear();
+ }
+
+ #release(subscription: QuoteSubscription): void {
+ const set = this.#subscriptions.get(subscription.key);
+ if (!set?.delete(subscription)) return;
+ if (set.size === 0) {
+ this.#subscriptions.delete(subscription.key);
+ if (!this.#deleted && !this.client.isClosed) {
+ this.client.send('quote_remove_symbols', [this.id, subscription.key]);
+ }
+ }
+ }
+
+ #assertAlive(): void {
+ if (this.#deleted) throw new TradingViewError('INVALID_STATE', 'The quote session is deleted');
+ }
+
+ #onClientClose(error: TradingViewError, expected: boolean): void {
+ if (this.#deleted) return;
+ this.#deleted = true;
+ if (!expected) this.emit('error', error);
+ for (const set of this.#subscriptions.values()) for (const sub of set) sub.handleClose(error, expected);
+ this.#subscriptions.clear();
+ }
+
+ #onPacket(packet: ServerPacket): void {
+ this.client.log('quote', this.id, packet);
+ let key: string | undefined;
+ if (packet.m === 'quote_completed') key = String(packet.p[1]);
+ else if (packet.m === 'qsd') key = (packet.p[1] as { n?: string })?.n;
+ else return;
+ if (key === undefined) return;
+
+ const set = this.#subscriptions.get(key);
+ if (!set) {
+ // Data for a symbol nobody listens to anymore.
+ if (!this.#deleted && !this.client.isClosed) this.client.send('quote_remove_symbols', [this.id, key]);
+ return;
+ }
+ for (const sub of [...set]) sub.handlePacket(packet);
+ }
+}
diff --git a/src/quote/session.js b/src/quote/session.js
deleted file mode 100644
index fe71e17..0000000
--- a/src/quote/session.js
+++ /dev/null
@@ -1,127 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-const { genSessionID } = require('../utils');
-
-const quoteMarketConstructor = require('./market');
-
-/** @typedef {Object<string, Function[]>} SymbolListeners */
-
-/**
- * @typedef {Object} QuoteSessionBridge
- * @prop {string} sessionID
- * @prop {SymbolListeners} symbolListeners
- * @prop {import('../client').SendPacket} send
-*/
-
-/**
- * @typedef {'base-currency-logoid'
- * | 'ch' | 'chp' | 'currency-logoid' | 'provider_id'
- * | 'currency_code' | 'current_session' | 'description'
- * | 'exchange' | 'format' | 'fractional' | 'is_tradable'
- * | 'language' | 'local_description' | 'logoid' | 'lp'
- * | 'lp_time' | 'minmov' | 'minmove2' | 'original_name'
- * | 'pricescale' | 'pro_name' | 'short_name' | 'type'
- * | 'update_mode' | 'volume' | 'ask' | 'bid' | 'fundamentals'
- * | 'high_price' | 'low_price' | 'open_price' | 'prev_close_price'
- * | 'rch' | 'rchp' | 'rtc' | 'rtc_time' | 'status' | 'industry'
- * | 'basic_eps_net_income' | 'beta_1_year' | 'market_cap_basic'
- * | 'earnings_per_share_basic_ttm' | 'price_earnings_ttm'
- * | 'sector' | 'dividends_yield' | 'timezone' | 'country_code'
- * } quoteField Quote data field
- */
-
-/** @param {'all' | 'price'} fieldsType */
-function getQuoteFields(fieldsType) {
- if (fieldsType === 'price') {
- return ['lp'];
- }
-
- return [
- 'base-currency-logoid', 'ch', 'chp', 'currency-logoid',
- 'currency_code', 'current_session', 'description',
- 'exchange', 'format', 'fractional', 'is_tradable',
- 'language', 'local_description', 'logoid', 'lp',
- 'lp_time', 'minmov', 'minmove2', 'original_name',
- 'pricescale', 'pro_name', 'short_name', 'type',
- 'update_mode', 'volume', 'ask', 'bid', 'fundamentals',
- 'high_price', 'low_price', 'open_price', 'prev_close_price',
- 'rch', 'rchp', 'rtc', 'rtc_time', 'status', 'industry',
- 'basic_eps_net_income', 'beta_1_year', 'market_cap_basic',
- 'earnings_per_share_basic_ttm', 'price_earnings_ttm',
- 'sector', 'dividends_yield', 'timezone', 'country_code',
- 'provider_id',
- ];
-}
-
-/**
- * @param {import('../client').ClientBridge} client
- */
-module.exports = (client) => class QuoteSession {
- #sessionID = genSessionID('qs');
-
- /** Parent client */
- #client = client;
-
- /** @type {SymbolListeners} */
- #symbolListeners = {};
-
- /**
- * @typedef {Object} quoteSessionOptions Quote Session options
- * @prop {'all' | 'price'} [fields] Asked quote fields
- * @prop {quoteField[]} [customFields] List of asked quote fields
- */
-
- /**
- * @param {quoteSessionOptions} options Quote settings options
- */
- constructor(options = {}) {
- this.#client.sessions[this.#sessionID] = {
- type: 'quote',
- onData: (packet) => {
- if (global.TW_DEBUG) console.log('§90§30§102 QUOTE SESSION §0 DATA', packet);
-
- if (packet.type === 'quote_completed') {
- const symbolKey = packet.data[1];
- if (!this.#symbolListeners[symbolKey]) {
- this.#client.send('quote_remove_symbols', [this.#sessionID, symbolKey]);
- return;
- }
- this.#symbolListeners[symbolKey].forEach((h) => h(packet));
- }
-
- if (packet.type === 'qsd') {
- const symbolKey = packet.data[1].n;
- if (!this.#symbolListeners[symbolKey]) {
- this.#client.send('quote_remove_symbols', [this.#sessionID, symbolKey]);
- return;
- }
- this.#symbolListeners[symbolKey].forEach((h) => h(packet));
- }
- },
- };
-
- const fields = (options.customFields && options.customFields.length > 0
- ? options.customFields
- : getQuoteFields(options.fields)
- );
-
- this.#client.send('quote_create_session', [this.#sessionID]);
- this.#client.send('quote_set_fields', [this.#sessionID, ...fields]);
- }
-
- /** @type {QuoteSessionBridge} */
- #quoteSession = {
- sessionID: this.#sessionID,
- symbolListeners: this.#symbolListeners,
- send: (t, p) => this.#client.send(t, p),
- };
-
- /** @constructor */
- Market = quoteMarketConstructor(this.#quoteSession);
-
- /** Delete the quote session */
- delete() {
- this.#client.send('quote_delete_session', [this.#sessionID]);
- delete this.#client.sessions[this.#sessionID];
- }
-};
diff --git a/src/types.js b/src/types.js
deleted file mode 100644
index 20d4a9a..0000000
--- a/src/types.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-/**
- * @typedef {string} MarketSymbol Market symbol (like: 'BTCEUR' or 'KRAKEN:BTCEUR')
- */
-
-/**
- * @typedef {'Etc/UTC' | 'exchange'
- * | 'Pacific/Honolulu' | 'America/Juneau' | 'America/Los_Angeles'
- * | 'America/Phoenix' | 'America/Vancouver' | 'US/Mountain'
- * | 'America/El_Salvador' | 'America/Bogota' | 'America/Chicago'
- * | 'America/Lima' | 'America/Mexico_City' | 'America/Caracas'
- * | 'America/New_York' | 'America/Toronto' | 'America/Argentina/Buenos_Aires'
- * | 'America/Santiago' | 'America/Sao_Paulo' | 'Atlantic/Reykjavik'
- * | 'Europe/Dublin' | 'Africa/Lagos' | 'Europe/Lisbon' | 'Europe/London'
- * | 'Europe/Amsterdam' | 'Europe/Belgrade' | 'Europe/Berlin'
- * | 'Europe/Brussels' | 'Europe/Copenhagen' | 'Africa/Johannesburg'
- * | 'Africa/Cairo' | 'Europe/Luxembourg' | 'Europe/Madrid' | 'Europe/Malta'
- * | 'Europe/Oslo' | 'Europe/Paris' | 'Europe/Rome' | 'Europe/Stockholm'
- * | 'Europe/Warsaw' | 'Europe/Zurich' | 'Europe/Athens' | 'Asia/Bahrain'
- * | 'Europe/Helsinki' | 'Europe/Istanbul' | 'Asia/Jerusalem' | 'Asia/Kuwait'
- * | 'Europe/Moscow' | 'Asia/Qatar' | 'Europe/Riga' | 'Asia/Riyadh'
- * | 'Europe/Tallinn' | 'Europe/Vilnius' | 'Asia/Tehran' | 'Asia/Dubai'
- * | 'Asia/Muscat' | 'Asia/Ashkhabad' | 'Asia/Kolkata' | 'Asia/Almaty'
- * | 'Asia/Bangkok' | 'Asia/Jakarta' | 'Asia/Ho_Chi_Minh' | 'Asia/Chongqing'
- * | 'Asia/Hong_Kong' | 'Australia/Perth' | 'Asia/Shanghai' | 'Asia/Singapore'
- * | 'Asia/Taipei' | 'Asia/Seoul' | 'Asia/Tokyo' | 'Australia/Brisbane'
- * | 'Australia/Adelaide' | 'Australia/Sydney' | 'Pacific/Norfolk'
- * | 'Pacific/Auckland' | 'Pacific/Fakaofo' | 'Pacific/Chatham'} Timezone (Chart) timezone
- */
-
-/**
- * @typedef {'1' | '3' | '5' | '15' | '30'
- * | '45' | '60' | '120' | '180' | '240'
- * | '1D' | '1W' | '1M' | 'D' | 'W' | 'M'} TimeFrame
- */
-
-module.exports = {};
diff --git a/src/utils.js b/src/utils.js
deleted file mode 100644
index 7be89f8..0000000
--- a/src/utils.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-module.exports = {
- /**
- * Generates a session id
- * @function genSessionID
- * @param {String} type Session type
- * @returns {string}
- */
- genSessionID(type = 'xs') {
- let r = '';
- const c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
- for (let i = 0; i < 12; i += 1) r += c.charAt(Math.floor(Math.random() * c.length));
- return `${type}_${r}`;
- },
-
- genAuthCookies(sessionId = '', signature = '') {
- if (!sessionId) return '';
- if (!signature) return `sessionid=${sessionId}`;
- return `sessionid=${sessionId};sessionid_sign=${signature}`;
- },
-};
diff --git a/tests/agent.test.ts b/tests/agent.test.ts
deleted file mode 100644
index c3722ae..0000000
--- a/tests/agent.test.ts
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * https://github.com/Mathieu2301/TradingView-API
- * https://www.npmjs.com/package/@mathieuc/tradingview
- */
-import {
- describe, expect, it, vi,
-} from 'vitest';
-import { fetchCandles, TradingViewProvider, watchCandles } from '../agent.ts';
-
-const bar = (time: number, close: number) => ({
- time, open: close - 1, max: close + 1, min: close - 2, close, volume: 3,
-});
-
-function transport() {
- let chart: any;
- let client: any;
- class Chart {
- periods: ReturnType<typeof bar>[] = [];
-
- symbolLoaded?: () => void;
-
- update?: () => void;
-
- error?: (...messages: unknown[]) => void;
-
- delete = vi.fn();
-
- setMarket = vi.fn();
-
- onSymbolLoaded(cb: () => void) { this.symbolLoaded = cb; }
-
- onUpdate(cb: () => void) { this.update = cb; }
-
- onError(cb: (...messages: unknown[]) => void) { this.error = cb; }
-
- constructor() { chart = this; }
- }
- class Client {
- Session = { Chart };
-
- disconnected?: () => void;
-
- error?: (...messages: unknown[]) => void;
-
- end = vi.fn(async () => {});
-
- onDisconnected(cb: () => void) { this.disconnected = cb; }
-
- onError(cb: (...messages: unknown[]) => void) { this.error = cb; }
-
- constructor() { client = this; }
- }
- const provider = new TradingViewProvider({ clientFactory: () => new Client() as any });
- return {
- provider,
- get chart() { return chart as Chart; },
- get client() { return client as Client; },
- };
-}
-
-describe('agent-friendly candles API', () => {
- it('fetches one snapshot and releases both resources', async () => {
- const fake = transport();
- const pending = fetchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: 'D', limit: 2 }, fake.provider);
- fake.chart.periods = [bar(200, 20), bar(100, 10)];
- fake.chart.symbolLoaded?.();
- const candles = await pending;
- expect(candles).toEqual([
- {
- time: 100, open: 9, high: 11, low: 8, close: 10, volume: 3,
- },
- {
- time: 200, open: 19, high: 21, low: 18, close: 20, volume: 3,
- },
- ]);
- expect(fake.chart.setMarket).toHaveBeenCalledWith('BINANCE:BTCUSDT', { timeframe: 'D', range: 2 });
- expect(fake.chart.delete).toHaveBeenCalledTimes(1);
- expect(fake.client.end).toHaveBeenCalledTimes(1);
- });
-
- it('keeps a worker running until an idempotent stop', async () => {
- const fake = transport();
- const received: number[] = [];
- const pending = watchCandles({ symbol: 'BINANCE:BTCUSDT' }, {
- onData: (candles) => received.push(candles[candles.length - 1].close),
- }, fake.provider);
- fake.chart.symbolLoaded?.();
- fake.chart.periods = [bar(100, 10)];
- fake.chart.update?.();
- const worker = await pending;
- expect(worker.latest[worker.latest.length - 1]?.close).toBe(10);
- fake.chart.periods = [bar(200, 20)];
- fake.chart.update?.();
- expect(received).toEqual([10, 20]);
- await Promise.all([worker.stop(), worker.stop()]);
- fake.chart.update?.();
- expect(received).toEqual([10, 20]);
- expect(fake.chart.delete).toHaveBeenCalledTimes(1);
- expect(fake.client.end).toHaveBeenCalledTimes(1);
- });
-
- it('times out and cleans up if the first snapshot never arrives', async () => {
- const fake = transport();
- const pending = fetchCandles({ symbol: 'BINANCE:BTCUSDT', timeoutMs: 5 }, fake.provider);
- await expect(pending).rejects.toThrow('Timed out');
- expect(fake.chart.delete).toHaveBeenCalledTimes(1);
- expect(fake.client.end).toHaveBeenCalledTimes(1);
- });
-
- it('rejects and cleans up on disconnect before the first snapshot', async () => {
- const fake = transport();
- const pending = fetchCandles({ symbol: 'BINANCE:BTCUSDT' }, fake.provider);
- fake.client.disconnected?.();
- await expect(pending).rejects.toThrow('disconnected');
- expect(fake.chart.delete).toHaveBeenCalledTimes(1);
- });
-
- const abortTest = typeof AbortController === 'undefined' ? it.skip : it;
- abortTest('aborts a pending request and releases the transport', async () => {
- const fake = transport();
- const controller = new AbortController();
- const pending = fetchCandles({ symbol: 'BINANCE:BTCUSDT', signal: controller.signal }, fake.provider);
- controller.abort();
- await expect(pending).rejects.toThrow(/abort/i);
- expect(fake.chart.delete).toHaveBeenCalledTimes(1);
- expect(fake.client.end).toHaveBeenCalledTimes(1);
- });
-
- it('rejects invalid requests before opening a connection', async () => {
- const fake = transport();
- await expect(fetchCandles({ symbol: '', limit: 0 }, fake.provider)).rejects.toThrow('symbol');
- expect(fake.client).toBeUndefined();
- });
-});
diff --git a/tests/allErrors.test.ts b/tests/allErrors.test.ts
deleted file mode 100644
index eb8f28d..0000000
--- a/tests/allErrors.test.ts
+++ /dev/null
@@ -1,250 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-import { describe, it, expect } from 'vitest';
-import TradingView from '../main';
-
-const token = <string>process.env.SESSION;
-const signature = <string>process.env.SIGNATURE;
-
-describe('AllErrors', () => {
- const waitForError = (instance: any, next = () => {}) => new Promise<string[]>((resolve) => {
- instance.onError((...error: string[]) => resolve(error));
- next();
- });
-
- it.skip('throws an error when an invalid token is set', async () => {
- console.log('Testing "Credentials error" error:');
-
- const client = new TradingView.Client({
- token: 'FAKE_CREDENTIALS', // Set wrong credentials
- });
-
- const error = await waitForError(client);
- console.log('=> Client error:', error);
-
- expect(error).toBeDefined();
- expect(error[0]).toBe('Credentials error:');
- expect(error[1]).toBe('Wrong or expired sessionid/signature');
- expect(error.length).toBe(2);
- });
-
- it('throws an error when an invalid symbol is set', async () => {
- console.log('Testing "invalid symbol" error:');
-
- const client = new TradingView.Client();
- const chart = new client.Session.Chart();
-
- const error = await waitForError(
- chart,
- () => chart.setMarket('XXXXX'),
- );
-
- console.log('=> Chart error:', error);
-
- expect(error).toBeDefined();
- expect(error[0]).toBe('(ser_1) Symbol error:');
- expect(error[1]).toBe('invalid symbol');
- expect(error.length).toBe(2);
- });
-
- it('throws an error when an invalid timezome is set', async () => {
- console.log('Testing "invalid timezone" error:');
-
- const client = new TradingView.Client();
- const chart = new client.Session.Chart();
- chart.setMarket('BINANCE:BTCEUR');
-
- const error = await waitForError(
- chart,
- // @ts-expect-error
- () => chart.setTimezone('Nowhere/Nowhere'),
- );
-
- console.log('=> Chart error:', error);
-
- expect(error).toBeDefined();
- expect(error[0]).toBe('Critical error:');
- expect(error[1]).toBe('invalid timezone');
- expect(error[2]).toBe('method: switch_timezone. args: "[Nowhere/Nowhere]"');
- expect(error.length).toBe(3);
- });
-
- it.skip('throws an error when a custom timeframe is set without premium', async () => {
- console.log('Testing "custom timeframe" error:');
-
- const client = new TradingView.Client();
- const chart = new client.Session.Chart();
-
- const error = await waitForError(
- chart,
- () => chart.setMarket('BINANCE:BTCEUR', { // Set a market
- // @ts-expect-error
- timeframe: '20', // Set a custom timeframe
- /*
- Timeframe '20' isn't available because we are
- not logged in as a premium TradingView account
- */
- }),
- );
-
- console.log('=> Chart error:', error);
-
- expect(error).toBeDefined();
- expect(error[0]).toBe('Series error:');
- expect(error[1]).toBe('custom_resolution');
- expect(error.length).toBe(2);
- });
-
- it('throws an error when an invalid timeframe is set', async () => {
- console.log('Testing "Invalid timeframe" error:');
-
- const client = new TradingView.Client();
- const chart = new client.Session.Chart();
-
- const error = await waitForError(
- chart,
- () => chart.setMarket('BINANCE:BTCEUR', { // Set a market
- // @ts-expect-error
- timeframe: 'XX', // Set an invalid timeframe
- }),
- );
-
- console.log('=> Chart error:', error);
-
- expect(error).toBeDefined();
- expect(error[0]).toBe('Critical error:');
- expect(error[1]).toBe('invalid parameters');
- expect(error[2]).toBe('method: create_series. args: "[$prices, s1, ser_1, XX, 100]"');
- expect(error.length).toBe(3);
- });
-
- it('throws an error when a premium chart type is set without premium', async () => {
- console.log('Testing "Study not auth" error:');
-
- const client = new TradingView.Client();
- const chart = new client.Session.Chart();
-
- const error = await waitForError(
- chart,
- () => chart.setMarket('BINANCE:BTCEUR', { // Set a market
- timeframe: '15',
- type: 'Renko',
- }),
- );
-
- console.log('=> Chart error:', error);
-
- expect(error).toBeDefined();
- expect(error[0]).toBe('Series error:');
- expect(error[1]).toMatch(/study_not_auth:BarSetRenko@tv-prostudies-\d+/);
- expect(error.length).toBe(2);
- });
-
- it('throws an error when series is edited before market is set', async () => {
- console.log('Testing "Set the market before..." error:');
-
- const client = new TradingView.Client();
- const chart = new client.Session.Chart();
-
- const error = await waitForError(
- chart,
- () => chart.setSeries('15'),
- );
- console.log('=> Chart error:', error);
-
- expect(error).toBeDefined();
- expect(error[0]).toBe('Please set the market before setting series');
- expect(error.length).toBe(1);
- });
-
- it('throws an error when getting a non-existent indicator', async () => {
- console.log('Testing "Inexistent indicator" error:');
-
- expect(
- TradingView.getIndicator('STD;XXXXXXX'),
- ).rejects.toThrow('Inexistent or unsupported indicator: "undefined"');
- });
-
- it.skipIf(
- !token || !signature,
- )('throws an error when setting an invalid study option value', async () => {
- console.log('Testing "Invalid value" error:');
-
- const client = new TradingView.Client({ token, signature });
- const chart = new client.Session.Chart();
-
- chart.setMarket('BINANCE:BTCEUR'); // Set a market
-
- const ST = await TradingView.getIndicator('STD;Supertrend');
- ST.setOption('Factor', -1); // This will cause an error
-
- const Supertrend = new chart.Study(ST);
-
- const error = await waitForError(Supertrend);
- console.log('=> Study error:', error);
-
- expect(error).toEqual([
- {
- ctx: {
- argName: 'factor',
- bar_index: 0,
- code: 'RE10001',
- funName: '\'supertrend\'',
- op: '>',
- value: -1,
- },
- error: 'Error on bar {bar_index}: Invalid value of the \'{argName}\' argument ({value}) in the \'{funName}\' function. It must be {op} 0.',
- stack_trace: [{ n: '#main', p: 7 }],
- },
- 'undefined',
- ]);
-
- console.log('OK');
- });
-
- it.skipIf(
- !token || !signature,
- ).skip('throws an error when getting user data without signature', async () => {
- console.log('Testing "Wrong or expired sessionid/signature" error using getUser method:');
-
- console.log('Trying with signaure');
- const userInfo = await TradingView.getUser(token, signature);
-
- console.log('Result:', {
- id: userInfo.id,
- username: userInfo.username,
- firstName: userInfo.firstName,
- lastName: userInfo.lastName,
- following: userInfo.following,
- followers: userInfo.followers,
- notifications: userInfo.notifications,
- joinDate: userInfo.joinDate,
- });
-
- expect(userInfo).toBeDefined();
- expect(userInfo.id).toBeDefined();
-
- console.log('Trying without signaure');
- expect(
- TradingView.getUser(token),
- ).rejects.toThrow('Wrong or expired sessionid/signature');
-
- console.log('OK');
- });
-
- it.skipIf(
- !token || !signature,
- ).skip('throws an error when creating an authenticated client without signature', async () => {
- console.log('Testing "Wrong or expired sessionid/signature" error using client:');
-
- const client = new TradingView.Client({ token });
-
- const error = await waitForError(client);
- console.log('=> Client error:', error);
-
- expect(error).toBeDefined();
- expect(error[0]).toBe('Credentials error:');
- expect(error[1]).toBe('Wrong or expired sessionid/signature');
- expect(error.length).toBe(2);
- });
-});
diff --git a/tests/authenticated.test.ts b/tests/authenticated.test.ts
deleted file mode 100644
index 4fcdda0..0000000
--- a/tests/authenticated.test.ts
+++ /dev/null
@@ -1,101 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-import { describe, it, expect } from 'vitest';
-import TradingView from '../main';
-import utils from './utils';
-
-const token = process.env.SESSION as string;
-const signature = process.env.SIGNATURE as string;
-
-describe.skipIf(!token || !signature)('Authenticated actions', () => {
- it('gets user info', async () => {
- console.log('Testing getUser method');
-
- const userInfo = await TradingView.getUser(token, signature);
-
- console.log('User:', {
- id: userInfo.id,
- username: userInfo.username,
- firstName: userInfo.firstName,
- lastName: userInfo.lastName,
- following: userInfo.following,
- followers: userInfo.followers,
- notifications: userInfo.notifications,
- joinDate: userInfo.joinDate,
- });
-
- expect(userInfo).toBeDefined();
- expect(userInfo.id).toBeDefined();
- expect(userInfo.username).toBeDefined();
- expect(userInfo.following).toBeDefined();
- expect(userInfo.followers).toBeDefined();
- expect(userInfo.notifications).toBeDefined();
- expect(userInfo.notifications.following).toBeDefined();
- expect(userInfo.notifications.user).toBeDefined();
- expect(userInfo.joinDate).toBeDefined();
-
- expect(userInfo.session).toBe(token);
- expect(userInfo.signature).toBe(signature);
- });
-
- const userIndicators: any[] = [];
-
- it('gets user indicators', async () => {
- console.log('Testing getPrivateIndicators method');
-
- userIndicators.push(...await TradingView.getPrivateIndicators(token));
- console.log('Indicators:', userIndicators.map((i) => i.name));
-
- expect(userIndicators.length).toBeGreaterThan(0);
- });
-
- it('creates a chart with all user indicators', async () => {
- console.log('Creating logged client');
- const client = new TradingView.Client({ token, signature });
- const chart = new client.Session.Chart();
-
- console.log('Setting market to BINANCE:BTCEUR...');
- chart.setMarket('BINANCE:BTCEUR', { timeframe: 'D' });
-
- // Limit to 3 indicators for testing
- const testedIndicators = userIndicators.slice(0, 3);
-
- const checked = new Set();
- async function check(item) {
- checked.add(item);
- console.log('Checked:', [...checked], `(${checked.size}/${testedIndicators.length + 1})`);
- }
-
- chart.onUpdate(async () => {
- console.log('Market data:', {
- name: chart.infos.pro_name,
- description: chart.infos.short_description,
- exchange: chart.infos.exchange,
- price: chart.periods[0].close,
- });
-
- await check(Symbol.for('PRICE'));
- });
-
- console.log('Loading indicators...');
- for (const indic of testedIndicators) {
- const privateIndic = await indic.get();
- console.log(`[${indic.name}] Loading indicator...`);
-
- const indicator = new chart.Study(privateIndic);
-
- indicator.onReady(() => {
- console.log(`[${indic.name}] Indicator loaded !`);
- });
-
- indicator.onUpdate(async () => {
- console.log(`[${indic.name}] Last plot:`, indicator.periods[0]);
- await check(indic.id);
- });
- }
-
- while (checked.size < testedIndicators.length + 1) await utils.wait(100);
-
- console.log('All indicators loaded !');
- }, 10000);
-});
diff --git a/tests/builtInIndicator.test.ts b/tests/builtInIndicator.test.ts
deleted file mode 100644
index 1e9951d..0000000
--- a/tests/builtInIndicator.test.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-import { describe, it, expect } from 'vitest';
-import TradingView from '../main';
-import utils from './utils';
-
-describe('BuiltInIndicator', () => {
- let client: TradingView.Client;
- let chart: InstanceType<typeof client.Session.Chart>;
-
- it('creates a client', async () => {
- client = new TradingView.Client();
- expect(client).toBeDefined();
- });
-
- it('creates a chart', async () => {
- chart = new client.Session.Chart();
- expect(chart).toBeDefined();
- });
-
- it('sets market', async () => {
- chart.setMarket('BINANCE:BTCEUR', {
- timeframe: '60',
- });
-
- await new Promise((resolve) => {
- chart.onSymbolLoaded(() => {
- console.log('Chart loaded');
- resolve(true);
- });
- });
-
- expect(chart.infos.full_name).toBe('BINANCE:BTCEUR');
- });
-
- it('gets volume profile', async () => {
- const volumeProfile = new TradingView.BuiltInIndicator('VbPFixed@tv-basicstudies-241!');
- volumeProfile.setOption('first_bar_time', Date.now() - 10 ** 8);
-
- const VOL = new chart.Study(volumeProfile);
-
- while (!VOL.graphic?.horizHists?.length) await utils.wait(100);
- expect(VOL.graphic?.horizHists).toBeDefined();
-
- const hists = VOL.graphic.horizHists
- .filter((h) => h.lastBarTime === 0) // We only keep recent volume infos
- .sort((a, b) => b.priceHigh - a.priceHigh);
-
- expect(hists.length).toBeGreaterThan(15);
-
- for (const hist of hists) {
- console.log(
- `~ ${Math.round((hist.priceHigh + hist.priceLow) / 2)} € :`,
- `${'_'.repeat(hist.rate[0] / 3)}${'_'.repeat(hist.rate[1] / 3)}`,
- );
- }
- });
-
- it('removes chart', () => {
- console.log('Closing the chart...');
- chart.delete();
- });
-
- it('removes client', async () => {
- console.log('Closing the client...');
- await client.end();
- });
-});
diff --git a/tests/customChartTypes.test.ts b/tests/customChartTypes.test.ts
deleted file mode 100644
index 10b6535..0000000
--- a/tests/customChartTypes.test.ts
+++ /dev/null
@@ -1,169 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-import { describe, it, expect } from 'vitest';
-import TradingView from '../main';
-import utils from './utils';
-
-describe('CustomChartTypes', () => {
- let client: TradingView.Client;
- let chart: InstanceType<typeof client.Session.Chart>;
-
- it('creates a client', async () => {
- client = new TradingView.Client();
- expect(client).toBeDefined();
- });
-
- it('creates a chart', async () => {
- chart = new client.Session.Chart();
- expect(chart).toBeDefined();
- });
-
- it('sets chart type to HeikinAshi', async () => {
- console.log('Setting chart type to: HeikinAshi');
-
- chart.setMarket('BINANCE:BTCEUR', {
- type: 'HeikinAshi',
- timeframe: 'D',
- });
-
- while (
- chart.infos.full_name !== 'BINANCE:BTCEUR'
- || !chart.periods.length
- ) await utils.wait(100);
-
- expect(chart.infos.full_name).toBe('BINANCE:BTCEUR');
- expect(chart.periods.length).toBe(100);
- expect(
- utils.calculateTimeGap(chart.periods),
- ).toBe(86400);
- });
-
- it('sets chart type to Renko', async () => {
- console.log('Setting chart type to: Renko');
-
- chart.setMarket('BINANCE:ETHEUR', {
- type: 'Renko',
- timeframe: 'D',
- inputs: {
- source: 'close',
- sources: 'Close',
- boxSize: 3,
- style: 'ATR',
- atrLength: 14,
- wicks: true,
- },
- });
-
- while (
- chart.infos.full_name !== 'BINANCE:ETHEUR'
- || !chart.periods.length
- ) await utils.wait(100);
-
- expect(chart.infos.full_name).toBe('BINANCE:ETHEUR');
- });
-
- it('sets chart type to LineBreak', async () => {
- console.log('Setting chart type to: LineBreak');
-
- chart.setMarket('BINANCE:BTCEUR', {
- type: 'LineBreak',
- timeframe: 'D',
- inputs: {
- source: 'close',
- lb: 3,
- },
- });
-
- while (
- chart.infos.full_name !== 'BINANCE:BTCEUR'
- || !chart.periods.length
- ) await utils.wait(100);
-
- expect(chart.infos.full_name).toBe('BINANCE:BTCEUR');
- expect(chart.periods.length).toBeGreaterThan(0);
- });
-
- it('sets chart type to Kagi', async () => {
- console.log('Setting chart type to: Kagi');
-
- chart.setMarket('BINANCE:ETHEUR', {
- type: 'Kagi',
- timeframe: 'D',
- inputs: {
- source: 'close',
- style: 'ATR',
- atrLength: 14,
- reversalAmount: 1,
- },
- });
-
- while (
- chart.infos.full_name !== 'BINANCE:ETHEUR'
- || !chart.periods.length
- ) await utils.wait(100);
-
- expect(chart.infos.full_name).toBe('BINANCE:ETHEUR');
- expect(chart.periods.length).toBeGreaterThan(0);
- });
-
- it('sets chart type to PointAndFigure', async () => {
- console.log('Setting chart type to: PointAndFigure');
-
- chart.setMarket('BINANCE:BTCEUR', {
- type: 'PointAndFigure',
- timeframe: 'D',
- inputs: {
- sources: 'Close',
- reversalAmount: 3,
- boxSize: 1,
- style: 'ATR',
- atrLength: 14,
- oneStepBackBuilding: false,
- },
- });
-
- while (
- chart.infos.full_name !== 'BINANCE:BTCEUR'
- || !chart.periods.length
- ) await utils.wait(100);
-
- expect(chart.infos.full_name).toBe('BINANCE:BTCEUR');
- expect(chart.periods.length).toBeGreaterThan(0);
- });
-
- it('sets chart type to Range', async () => {
- console.log('Setting chart type to: Range');
-
- chart.setMarket('BINANCE:ETHEUR', {
- type: 'Range',
- timeframe: 'D',
- inputs: {
- range: 1,
- phantomBars: false,
- },
- });
-
- while (
- chart.infos.full_name !== 'BINANCE:ETHEUR'
- || !chart.periods.length
- ) await utils.wait(100);
-
- expect(chart.infos.full_name).toBe('BINANCE:ETHEUR');
- expect(chart.periods.length).toBeGreaterThanOrEqual(99);
- expect(chart.periods.length).toBeLessThanOrEqual(102);
- });
-
- it('closes chart', async () => {
- console.log('Waiting 1 second...');
- await utils.wait(1000);
- console.log('Closing the chart...');
- chart.delete();
- });
-
- it('closes client', async () => {
- console.log('Waiting 1 second...');
- await utils.wait(1000);
- console.log('Closing the client...');
- await client.end();
- });
-});
diff --git a/tests/fixtures/compressed-report.json b/tests/fixtures/compressed-report.json
new file mode 100644
index 0000000..fee2dd9
--- /dev/null
+++ b/tests/fixtures/compressed-report.json
@@ -0,0 +1,114 @@
+{
+ "zipDeflated": "UEsDBBQAAAAIAAAAIQDv7s2LOAEAACQDAAAAAAAAjVI7b8MgEP4rEXNUAaqbqHMjdegQpe1kZSD22bFqQ4Jxk8jyfy/nF9iSpbIA30PHd1xNNFyUNuR1VZOo0hpk9LAXsvs+kPWKGC1iKC0Q1gQ6EbIfSqYtfcFbDnjGI6MU0QKPG+pWY9G7s+/umRktbGrZvjyPliuCQ5ma/LYVeh99YiiJliktHcUdxZGLY8eNFGWN5SZBP8/YnDFpCf95tpfUNSbw5WzDt5OUfDElDWYxuRczmOdk0xZ4MV0HKG+aI95AJ0oXQkZdYJHn7W6UEfnX8PHok2D2WiWZactjkwhcq8zgpIS2JD+OyB50BBKFoX3D2pZryVP1eFd53OuZB/kGK0cm1uL2pm6yx5iPzeT2z5AtwZhMpmX7/lgYOAiZdqlOIvoxUHYTnmhVDDOlMEwzzPgCjesPUEsBAhQDFAAAAAgAAAAhAO/uzYs4AQAAJAMAAAAAAAAAAAAAAAAAAIABAAAAAFBLBQYAAAAAAQABAC4AAABWAQAAAAA=",
+ "zipStored": "UEsDBBQAAAAAAK0CQ13v7s2LJAMAACQDAAALAAAAcmVwb3J0Lmpzb257InJlcG9ydCI6IHsiY3VycmVuY3kiOiAiRVVSIiwgInRyYWRlcyI6IFt7ImUiOiB7ImMiOiAiTG9uZyIsICJ0cCI6ICJsZSIsICJwIjogMTAwLCAidG0iOiAxNzAwMDAwMDAwMDAwfSwgIngiOiB7ImMiOiAiRXhpdCIsICJwIjogMTEwLCAidG0iOiAxNzAwMDg2NDAwMDAwfSwgInEiOiAxLCAidHAiOiB7InYiOiAxMCwgInAiOiAwLjF9LCAiY3AiOiB7InYiOiAxMCwgInAiOiAwLjF9LCAicm4iOiB7InYiOiAxMiwgInAiOiAwLjEyfSwgImRkIjogeyJ2IjogMSwgInAiOiAwLjAxfX0sIHsiZSI6IHsiYyI6ICJTaG9ydCIsICJ0cCI6ICJzZSIsICJwIjogMTEwLCAidG0iOiAxNzAwMDg2NDAwMDAwfSwgIngiOiB7ImMiOiAiIiwgInAiOiAxMDUsICJ0bSI6IDE3MDAxNzI4MDAwMDB9LCAicSI6IDIsICJ0cCI6IHsidiI6IDEwLCAicCI6IDAuMDV9LCAiY3AiOiB7InYiOiAyMCwgInAiOiAwLjE1fSwgInJuIjogeyJ2IjogMTEsICJwIjogMC4xfSwgImRkIjogeyJ2IjogMiwgInAiOiAwLjAyfX1dLCAicGVyZm9ybWFuY2UiOiB7ImFsbCI6IHsidG90YWxUcmFkZXMiOiAyLCAibmV0UHJvZml0IjogMjB9fSwgImVxdWl0eSI6IFsxLCAyXSwgImVxdWl0eVBlcmNlbnQiOiBbMC4xLCAwLjJdLCAiYnV5SG9sZCI6IFsxLCAxXSwgImJ1eUhvbGRQZXJjZW50IjogWzAsIDBdLCAiZHJhd0Rvd24iOiBbMCwgMV0sICJkcmF3RG93blBlcmNlbnQiOiBbMCwgMC4wMV0sICJzZXR0aW5ncyI6IHsiZGF0ZVJhbmdlIjogeyJiYWNrdGVzdCI6IHsiZnJvbSI6IDEsICJ0byI6IDJ9LCAidHJhZGUiOiB7ImZyb20iOiAxLCAidG8iOiAyfX19fX1QSwECFAMUAAAAAACtAkNd7-7NiyQDAAAkAwAACwAAAAAAAAAAAAAAgAEAAAAAcmVwb3J0Lmpzb25QSwUGAAAAAAEAAQA5AAAATQMAAAAA",
+ "zipStreamed": "UEsDBBQACAAIAAAAIQAAAAAAAAAAAAAAAAANAAAAc3RyZWFtZWQuanNvbo1SO2/DIBD+KxFzVAGqm6hzI3XoEKXtZGUg9tmxakOCcZPI8n8v5xfYkqWyAN9Dx3dcTTRclDbkdVWTqNIaZPSwF7L7PpD1ihgtYigtENYEOhGyH0qmLX3BWw54xiOjFNECjxvqVmPRu7Pv7pkZLWxq2b48j5YrgkOZmvy2FXoffWIoiZYpLR3FHcWRi2PHjRRljeUmQT/P2JwxaQn/ebaX1DUm8OVsw7eTlHwxJQ1mMbkXM5jnZNMWeDFdByhvmiPeQCdKF0JGXWCR5+1ulBH51/Dx6JNg9lolmWnLY5MIXKvM4KSEtiQ/jsgedAQShaF9w9qWa8lT9XhXedzrmQf5BitHJtbi9qZusseYj83k9s+QLcGYTKZl+/5YGDgImXapTiL6MVB2E55oVQwzpTBMM8z4Ao3rD1BLBwjv7s2LOAEAACQDAABQSwECFAMUAAgACAAAACEA7+7NizgBAAAkAwAADQAAAAAAAAAAAAAAgAEAAAAAc3RyZWFtZWQuanNvblBLBQYAAAAAAQABADsAAABzAQAAAAA=",
+ "report": {
+ "report": {
+ "currency": "EUR",
+ "trades": [
+ {
+ "e": {
+ "c": "Long",
+ "tp": "le",
+ "p": 100,
+ "tm": 1700000000000
+ },
+ "x": {
+ "c": "Exit",
+ "p": 110,
+ "tm": 1700086400000
+ },
+ "q": 1,
+ "tp": {
+ "v": 10,
+ "p": 0.1
+ },
+ "cp": {
+ "v": 10,
+ "p": 0.1
+ },
+ "rn": {
+ "v": 12,
+ "p": 0.12
+ },
+ "dd": {
+ "v": 1,
+ "p": 0.01
+ }
+ },
+ {
+ "e": {
+ "c": "Short",
+ "tp": "se",
+ "p": 110,
+ "tm": 1700086400000
+ },
+ "x": {
+ "c": "",
+ "p": 105,
+ "tm": 1700172800000
+ },
+ "q": 2,
+ "tp": {
+ "v": 10,
+ "p": 0.05
+ },
+ "cp": {
+ "v": 20,
+ "p": 0.15
+ },
+ "rn": {
+ "v": 11,
+ "p": 0.1
+ },
+ "dd": {
+ "v": 2,
+ "p": 0.02
+ }
+ }
+ ],
+ "performance": {
+ "all": {
+ "totalTrades": 2,
+ "netProfit": 20
+ }
+ },
+ "equity": [
+ 1,
+ 2
+ ],
+ "equityPercent": [
+ 0.1,
+ 0.2
+ ],
+ "buyHold": [
+ 1,
+ 1
+ ],
+ "buyHoldPercent": [
+ 0,
+ 0
+ ],
+ "drawDown": [
+ 0,
+ 1
+ ],
+ "drawDownPercent": [
+ 0,
+ 0.01
+ ],
+ "settings": {
+ "dateRange": {
+ "backtest": {
+ "from": 1,
+ "to": 2
+ },
+ "trade": {
+ "from": 1,
+ "to": 2
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/fixtures/live-session.json b/tests/fixtures/live-session.json
new file mode 100644
index 0000000..ccfb412
--- /dev/null
+++ b/tests/fixtures/live-session.json
@@ -0,0 +1,9 @@
+{
+ "capturedAt": "2026-10-02",
+ "note": "Raw websocket messages captured from data.tradingview.com (anonymous session, IPs and node names scrubbed).",
+ "messages": [
+ "~m~287~m~{\"session_id\":\"0.242654836.0_fra2-charts-free-3-tvbs-nc6xj-7\",\"timestamp\":1790979659,\"timestampMs\":1790979659908,\"release\":\"release_210-6\",\"studies_metadata_hash\":\"62eeb3bdbf646818a34271f65845b8e331bffdf9\",\"auth_scheme_vsn\":2,\"protocol\":\"json\",\"via\":\"0.0.0.0:443\",\"javastudies\":[\"3.66\"]}",
+ "~m~92~m~{\"m\":\"series_loading\",\"p\":[\"cs_fixture\",\"$prices\",\"s1\"],\"t\":1790979659,\"t_ms\":1790979659978}~m~98~m~{\"m\":\"study_loading\",\"p\":[\"cs_fixture\",\"st_fixture\",\"s1_st1\"],\"t\":1790979659,\"t_ms\":1790979659978}~m~100~m~{\"m\":\"symbol_error\",\"p\":[\"cs_fixture\",\"ser_2\",\"invalid symbol\"],\"t\":1790979659,\"t_ms\":1790979659978}~m~1396~m~{\"m\":\"symbol_resolved\",\"p\":[\"cs_fixture\",\"ser_1\",{\"source2\":{\"country\":\"MT\",\"description\":\"Binance\",\"exchange-type\":\"exchange\",\"id\":\"BINANCE\",\"name\":\"Binance\",\"url\":\"https://www.binance.com/en\"},\"currency_code\":\"EUR\",\"source_id\":\"BINANCE\",\"subsession_id\":\"regular\",\"provider_id\":\"binance\",\"base_currency_id\":\"XTVCBTC\",\"base_currency\":\"BTC\",\"currency_id\":\"EUR\",\"format\":\"price\",\"formatter\":\"price\",\"pro_perm\":\"\",\"volume_type\":\"base\",\"measure\":\"price\",\"allowed_adjustment\":\"none\",\"short_description\":\"Bitcoin / Euro\",\"variable_tick_size\":\"\",\"name\":\"BTCEUR\",\"full_name\":\"BINANCE:BTCEUR\",\"pro_name\":\"BINANCE:BTCEUR\",\"base_name\":[\"BINANCE:BTCEUR\"],\"description\":\"Bitcoin / Euro\",\"exchange\":\"Binance\",\"pricescale\":100,\"pointvalue\":1.0,\"minmov\":1,\"session\":\"24x7\",\"session_display\":\"24x7\",\"subsessions\":[{\"description\":\"Regular Trading Hours\",\"id\":\"regular\",\"private\":false,\"session\":\"24x7\",\"session-display\":\"24x7\"}],\"type\":\"spot\",\"typespecs\":[\"crypto\",\"defi\"],\"has_intraday\":true,\"fractional\":false,\"listed_exchange\":\"BINANCE\",\"legs\":[\"BINANCE:BTCEUR\"],\"is_tradable\":true,\"minmove2\":0,\"timezone\":\"Etc/UTC\",\"aliases\":[],\"alternatives\":[],\"is_replayable\":true,\"has_adjustment\":false,\"has_extended_hours\":false,\"bar_source\":\"trade\",\"bar_transform\":\"none\",\"bar_fillgaps\":false,\"visible_plots_set\":\"ohlcv\",\"is-tickbars-available\":true,\"exchange_listed_name\":\"Binance\"}],\"t\":1790979659,\"t_ms\":1790979659978}~m~93~m~{\"m\":\"qsd\",\"p\":[\"qs_fixture\",{\"n\":\"XXXX:NOPE\",\"s\":\"error\",\"errmsg\":\"no_such_symbol\",\"v\":{}}]}~m~202~m~{\"m\":\"qsd\",\"p\":[\"qs_fixture\",{\"n\":\"={\\\"session\\\":\\\"regular\\\",\\\"symbol\\\":\\\"BINANCE:BTCEUR\\\"}\",\"s\":\"ok\",\"v\":{\"lp\":75178.78,\"ch\":-242.61,\"chp\":-0.32,\"currency_code\":\"EUR\",\"description\":\"Bitcoin / Euro\"}}]}~m~101~m~{\"m\":\"quote_completed\",\"p\":[\"qs_fixture\",\"={\\\"session\\\":\\\"regular\\\",\\\"symbol\\\":\\\"BINANCE:BTCEUR\\\"}\"]}~m~610~m~{\"m\":\"timescale_update\",\"p\":[\"cs_fixture\",{\"$prices\":{\"node\":\"node-1\",\"s\":[{\"i\":0,\"v\":[1790726400.0,73751.55,75338.83,73060.28,73776.08,166.32674]},{\"i\":1,\"v\":[1790812800.0,73760.52,75867.96,73571.43,75421.39,116.79389]},{\"i\":2,\"v\":[1790899200.0,75421.38,77527.86,74556.09,75178.78,157.95473]}],\"ns\":{\"d\":\"\",\"indexes\":[]},\"t\":\"s1\",\"lbs\":{\"bar_close_time\":1790985600}}},{\"index\":0,\"zoffset\":0,\"changes\":[1790726400.0,1790812800.0,1790899200.0],\"marks\":[[40,1790726400,0],[60,1790812800,1],[40,1790899200,2]],\"index_diff\":[],\"last_session_switches\":{\"$prices\":{\"market\":2}}}],\"t\":1790979659,\"t_ms\":1790979659978}~m~129~m~{\"m\":\"series_completed\",\"p\":[\"cs_fixture\",\"$prices\",\"streaming\",\"s1\",{\"rt_update_period\":5}],\"t\":1790979659,\"t_ms\":1790979659978}",
+ "~m~6894~m~{\"m\":\"du\",\"p\":[\"cs_fixture\",{\"st_fixture\":{\"node\":\"node-1\",\"st\":[{\"i\":-1000100,\"v\":[1782086400.0,314.26784,0.0,416.7083029999934]},{\"i\":-1000099,\"v\":[1782172800.0,308.85093,1.0,400.7396189999934]},{\"i\":-1000098,\"v\":[1782259200.0,604.91685,1.0,384.7950479999934]},{\"i\":-1000097,\"v\":[1782345600.0,660.55005,1.0,359.3979844999934]},{\"i\":-1000096,\"v\":[1782432000.0,555.0531,0.0,363.1692169999934]},{\"i\":-1000095,\"v\":[1782518400.0,202.39982,1.0,348.17806049999336]},{\"i\":-1000094,\"v\":[1782604800.0,200.07738,1.0,334.20980399999337]},{\"i\":-1000093,\"v\":[1782691200.0,452.47816,0.0,335.42223199999336]},{\"i\":-1000092,\"v\":[1782777600.0,485.31164,1.0,341.69674949999336]},{\"i\":-1000091,\"v\":[1782864000.0,415.85269,0.0,343.53745749999337]},{\"i\":-1000090,\"v\":[1782950400.0,356.22721,0.0,345.30574799999334]},{\"i\":-1000089,\"v\":[1783036800.0,171.49161,0.0,344.7438404999933]},{\"i\":-1000088,\"v\":[1783123200.0,109.03875,0.0,339.28039049999336]},{\"i\":-1000087,\"v\":[1783209600.0,132.18896,0.0,328.93449999999336]},{\"i\":-1000086,\"v\":[1783296000.0,278.80132,0.0,328.96022199999334]},{\"i\":-1000085,\"v\":[1783382400.0,219.15633,1.0,316.68649449999333]},{\"i\":-1000084,\"v\":[1783468800.0,221.01863,1.0,309.8515199999933]},{\"i\":-1000083,\"v\":[1783555200.0,240.92762,0.0,311.7236794999933]},{\"i\":-1000082,\"v\":[1783641600.0,235.33039,0.0,315.2301769999933]},{\"i\":-1000081,\"v\":[1783728000.0,86.67756,1.0,312.5308419999933]},{\"i\":-1000080,\"v\":[1783814400.0,73.37167,0.0,300.4860334999933]},{\"i\":-1000079,\"v\":[1783900800.0,223.72827,1.0,296.2299004999933]},{\"i\":-1000078,\"v\":[1783987200.0,298.99134,0.0,280.9336249999933]},{\"i\":-1000077,\"v\":[1784073600.0,169.1149,1.0,256.3618674999933]},{\"i\":-1000076,\"v\":[1784160000.0,128.56437,1.0,235.0374309999933]},{\"i\":-1000075,\"v\":[1784246400.0,169.95414,0.0,233.41514699999328]},{\"i\":-1000074,\"v\":[1784332800.0,44.21605,0.0,225.6220804999933]},{\"i\":-1000073,\"v\":[1784419200.0,70.04911,1.0,206.50062799999333]},{\"i\":-1000072,\"v\":[1784505600.0,185.23312,0.0,191.49670199999332]},{\"i\":-1000071,\"v\":[1784592000.0,136.40445,0.0,177.5242899999933]},{\"i\":-1000070,\"v\":[1784678400.0,105.99584,1.0,165.01272149999332]},{\"i\":-1000069,\"v\":[1784764800.0,112.4234,1.0,162.05931099999333]},{\"i\":-1000068,\"v\":[1784851200.0,152.56794,1.0,164.2357704999933]},{\"i\":-1000067,\"v\":[1784937600.0,34.81845,0.0,159.36724499999332]},{\"i\":-1000066,\"v\":[1785024000.0,58.53384,0.0,148.35387099999332]},{\"i\":-1000065,\"v\":[1785110400.0,110.45032,1.0,142.91857049999334]},{\"i\":-1000064,\"v\":[1785196800.0,122.01201,0.0,137.96823949999333]},{\"i\":-1000063,\"v\":[1785283200.0,187.35924,1.0,135.2898204999933]},{\"i\":-1000062,\"v\":[1785369600.0,108.59241,0.0,128.95292149999332]},{\"i\":-1000061,\"v\":[1785456000.0,136.97771,1.0,131.46792899999332]},{\"i\":-1000060,\"v\":[1785542400.0,41.26488,1.0,129.86258949999333]},{\"i\":-1000059,\"v\":[1785628800.0,64.2865,0.0,121.89050099999334]},{\"i\":-1000058,\"v\":[1785715200.0,92.66999,0.0,111.57443349999332]},{\"i\":-1000057,\"v\":[1785801600.0,86.22642,0.0,107.43000949999332]},{\"i\":-1000056,\"v\":[1785888000.0,114.98824,0.0,106.75120299999332]},{\"i\":-1000055,\"v\":[1785974400.0,75.59058,1.0,102.03302499999333]},{\"i\":-1000054,\"v\":[1786060800.0,107.77397,0.0,105.21092099999332]},{\"i\":-1000053,\"v\":[1786147200.0,23.19833,0.0,102.86838199999333]},{\"i\":-1000052,\"v\":[1786233600.0,38.07175,1.0,95.51031349999333]},{\"i\":-1000051,\"v\":[1786320000.0,66.8245,1.0,92.03131599999332]},{\"i\":-1000050,\"v\":[1786406400.0,74.54355,1.0,90.45870149999334]},{\"i\":-1000049,\"v\":[1786492800.0,78.91413,1.0,88.78323799999335]},{\"i\":-1000048,\"v\":[1786579200.0,90.24032,1.0,85.66685699999334]},{\"i\":-1000047,\"v\":[1786665600.0,56.72889,1.0,86.76237899999335]},{\"i\":-1000046,\"v\":[1786752000.0,38.12159,0.0,85.74176649999335]},{\"i\":-1000045,\"v\":[1786838400.0,45.11256,1.0,82.47487849999335]},{\"i\":-1000044,\"v\":[1786924800.0,96.58296,0.0,81.20342599999336]},{\"i\":-1000043,\"v\":[1787011200.0,70.52471,0.0,75.36169949999335]},{\"i\":-1000042,\"v\":[1787097600.0,244.36526,0.0,82.15034199999334]},{\"i\":-1000041,\"v\":[1787184000.0,301.4398,0.0,90.37344649999336]},{\"i\":-1000040,\"v\":[1787270400.0,473.70268,0.0,111.99533649999337]},{\"i\":-1000039,\"v\":[1787356800.0,229.61448,1.0,120.26173549999336]},{\"i\":-1000038,\"v\":[1787443200.0,252.83728,0.0,128.2700999999934]},{\"i\":-1000037,\"v\":[1787529600.0,246.20562,0.0,136.2690599999934]},{\"i\":-1000036,\"v\":[1787616000.0,265.30803,1.0,143.7850494999934]},{\"i\":-1000035,\"v\":[1787702400.0,132.97895,0.0,146.65446799999341]},{\"i\":-1000034,\"v\":[1787788800.0,130.95896,0.0,147.8137174999934]},{\"i\":-1000033,\"v\":[1787875200.0,179.69362,1.0,155.6384819999934]},{\"i\":-1000032,\"v\":[1787961600.0,42.96414,0.0,155.8831014999934]},{\"i\":-1000031,\"v\":[1788048000.0,85.19647,1.0,156.80169999999336]},{\"i\":-1000030,\"v\":[1788134400.0,128.89978,0.0,159.51951149999337]},{\"i\":-1000029,\"v\":[1788220800.0,115.62526,1.0,161.35506799999337]},{\"i\":-1000028,\"v\":[1788307200.0,99.74556,1.0,161.83032999999335]},{\"i\":-1000027,\"v\":[1788393600.0,198.95988,0.0,168.94187949999338]},{\"i\":-1000026,\"v\":[1788480000.0,135.97103,1.0,173.83435149999337]},{\"i\":-1000025,\"v\":[1788566400.0,37.00853,0.0,173.42914999999337]},{\"i\":-1000024,\"v\":[1788652800.0,50.38944,0.0,171.11947399999335]},{\"i\":-1000023,\"v\":[1788739200.0,67.13035,1.0,170.94975599999333]},{\"i\":-1000022,\"v\":[1788825600.0,97.79093,1.0,163.62103949999334]},{\"i\":-1000021,\"v\":[1788912000.0,88.70502,1.0,152.98430049999334]},{\"i\":-1000020,\"v\":[1788998400.0,98.78055,1.0,134.23819399999334]},{\"i\":-1000019,\"v\":[1789084800.0,128.79632,0.0,129.1972859999933]},{\"i\":-1000018,\"v\":[1789171200.0,31.31463,0.0,118.12115349999331]},{\"i\":-1000017,\"v\":[1789257600.0,51.75132,1.0,108.39843849999329]},{\"i\":-1000016,\"v\":[1789344000.0,134.32908,0.0,101.8494909999933]},{\"i\":-1000015,\"v\":[1789430400.0,133.62841,1.0,101.8819639999933]},{\"i\":-1000014,\"v\":[1789516800.0,123.23694,0.0,101.4958629999933]},{\"i\":-1000013,\"v\":[1789603200.0,83.81282,0.0,96.70182299999331]},{\"i\":-1000012,\"v\":[1789689600.0,174.88465,0.0,103.29784849999331]},{\"i\":-1000011,\"v\":[1789776000.0,60.58564,0.0,102.06730699999329]},{\"i\":-1000010,\"v\":[1789862400.0,87.18115,1.0,99.9813754999933]},{\"i\":-1000009,\"v\":[1789948800.0,347.73927,0.0,111.58707599999329]},{\"i\":-1000008,\"v\":[1790035200.0,175.42794,1.0,115.3711949999933]},{\"i\":-1000007,\"v\":[1790121600.0,141.29384,1.0,112.4878929999933]},{\"i\":-1000006,\"v\":[1790208000.0,123.57429,0.0,111.86805599999329]},{\"i\":-1000005,\"v\":[1790294400.0,109.69167,1.0,115.5022129999933]},{\"i\":-1000004,\"v\":[1790380800.0,40.80811,0.0,115.0231464999933]},{\"i\":-1000003,\"v\":[1790467200.0,65.57089,0.0,114.9451734999933]},{\"i\":-1000002,\"v\":[1790553600.0,128.34749,1.0,116.4730014999933]},{\"i\":-1000001,\"v\":[1790640000.0,93.60096,0.0,116.71779849999332]},{\"i\":0,\"v\":[1790726400.0,166.32674,0.0,120.09510799999332]},{\"i\":1,\"v\":[1790812800.0,116.79389,0.0,119.49498649999332]},{\"i\":2,\"v\":[1790899200.0,157.95473,1.0,125.82699149999333]}],\"ns\":{\"d\":\"\",\"indexes\":[]},\"t\":\"s1_st1\"}}]}~m~100~m~{\"m\":\"study_completed\",\"p\":[\"cs_fixture\",\"st_fixture\",\"s1_st1\"],\"t\":1790979660,\"t_ms\":1790979660137}"
+ ]
+}
diff --git a/tests/getUser-redirect.test.ts b/tests/getUser-redirect.test.ts
deleted file mode 100644
index a64def0..0000000
--- a/tests/getUser-redirect.test.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-import { describe, it, expect } from 'vitest';
-
-describe('getUser redirect protection', () => {
- it('should not loop infinitely on repeated redirects', async () => {
- // Monkey-patch axios in the require cache to simulate redirect loop
- let callCount = 0;
- const axiosMock = {
- get: async (url: string) => {
- callCount += 1;
- const isA = url === 'https://www.tradingview.com/';
- return {
- data: '<html>no auth here</html>',
- headers: {
- location: isA
- ? 'https://www.tradingview.com/accounts/signin/'
- : 'https://www.tradingview.com/',
- },
- };
- },
- };
-
- const axiosPath = require.resolve('axios');
- const originalModule = require.cache[axiosPath];
- require.cache[axiosPath] = {
- id: axiosPath,
- filename: axiosPath,
- loaded: true,
- exports: axiosMock,
- } as any;
-
- const miscPath = require.resolve('../src/miscRequests');
- delete require.cache[miscPath];
-
- try {
- // eslint-disable-next-line global-require
- const misc = require('../src/miscRequests');
- await expect(
- misc.getUser('fake_session', 'fake_signature'),
- ).rejects.toThrow('Too many redirects');
-
- expect(callCount).toBeGreaterThan(0);
- expect(callCount).toBeLessThanOrEqual(10);
- } finally {
- if (originalModule) require.cache[axiosPath] = originalModule;
- else delete require.cache[axiosPath];
- delete require.cache[miscPath];
- }
- }, 5000);
-});
diff --git a/tests/helpers/fake-server.ts b/tests/helpers/fake-server.ts
new file mode 100644
index 0000000..ffc61fd
--- /dev/null
+++ b/tests/helpers/fake-server.ts
@@ -0,0 +1,367 @@
+import type {
+ Transport, TransportFactory, TransportHandlers, TransportRequest,
+} from '../../src/client/transport.js';
+import { decodeFrames, encodeFrame } from '../../src/protocol/framing.js';
+
+export interface SentPacket {
+ m: string;
+ p: any[];
+}
+
+type Handler = (connection: FakeConnection, packet: SentPacket) => boolean | void;
+
+/** In-memory websocket connection driven by `FakeServer`. */
+export class FakeConnection implements Transport {
+ isOpen = false;
+
+ closed = false;
+
+ readonly sent: SentPacket[] = [];
+
+ readonly raw: string[] = [];
+
+ readonly heartbeats: number[] = [];
+
+ constructor(
+ readonly server: FakeServer,
+ readonly request: TransportRequest,
+ readonly handlers: TransportHandlers,
+ ) {}
+
+ open(): void {
+ this.isOpen = true;
+ this.handlers.onOpen();
+ }
+
+ send(data: string): void {
+ if (!this.isOpen) throw new Error('FakeConnection: send while closed');
+ this.raw.push(data);
+ for (const frame of decodeFrames(data)) {
+ if (frame.type === 'heartbeat') this.heartbeats.push(frame.id);
+ if (frame.type !== 'packet') continue;
+ const packet = { m: frame.packet.m, p: frame.packet.p as any[] };
+ this.sent.push(packet);
+ this.server.handle(this, packet);
+ }
+ }
+
+ close(): void {
+ if (this.closed) return;
+ this.closed = true;
+ this.isOpen = false;
+ setTimeout(() => this.handlers.onClose(1000, ''), 0);
+ }
+
+ /** Server → client: one websocket message containing these frames. */
+ push(...payloads: Array<object | string>): void {
+ if (this.closed) return;
+ this.handlers.onMessage(payloads.map((payload) => encodeFrame(payload)).join(''));
+ }
+
+ /** Server → client, asynchronously (like the network). */
+ pushLater(...payloads: Array<object | string>): void {
+ setTimeout(() => this.push(...payloads), 0);
+ }
+
+ /** Simulates a server-side disconnection. */
+ drop(code = 1006, reason = 'Connection lost'): void {
+ if (this.closed) return;
+ this.closed = true;
+ this.isOpen = false;
+ this.handlers.onClose(code, reason);
+ }
+
+ /** Packets sent with a method. */
+ packets(method: string): SentPacket[] {
+ return this.sent.filter((packet) => packet.m === method);
+ }
+}
+
+export interface FakeMarketOptions {
+ /** Bars available per symbol. Default: 1000. */
+ history?: number;
+ /** Maximum bars returned per request (simulates server batches). */
+ batchLimit?: number;
+ /** Reason sent when history is exhausted. Default: `end`. */
+ endReason?: 'end' | 'limit';
+ /** Seconds between bars. Default: 86 400. */
+ step?: number;
+ /** Time of the newest bar. Default: 1 800 000 000 rounded to `step`. */
+ now?: number;
+ /** Symbols answered with `symbol_error`. */
+ invalidSymbols?: string[];
+ /** Plot count produced by studies. Default: 1. */
+ studyPlots?: number;
+ /** `ns.d` payload sent with study data (graphics, reports). */
+ studyNs?: (studyType: string) => object | undefined;
+ /** Error payload sent instead of study data. */
+ studyError?: unknown;
+ /** Number of replay steps before `replay_data_end`. Default: 3. */
+ replaySteps?: number;
+}
+
+interface ChartState {
+ symbols: Map<string, string>;
+ seriesId?: string;
+ symbol?: string;
+ loaded: number;
+ firstPosition: number;
+ studies: Map<string, string>;
+}
+
+/**
+ * Scriptable fake of the TradingView websocket server. Supports charts,
+ * deep history, studies, quotes and replay with deterministic data.
+ */
+export class FakeServer {
+ readonly connections: FakeConnection[] = [];
+
+ autoOpen = true;
+
+ /** When false, chart/quote commands get no answer (timeout tests). */
+ respond = true;
+
+ readonly options: Required<Omit<FakeMarketOptions, 'batchLimit' | 'studyNs' | 'studyError'>>
+ & Pick<FakeMarketOptions, 'batchLimit' | 'studyNs' | 'studyError'>;
+
+ readonly #handlers = new Map<string, Handler>();
+
+ readonly #charts = new Map<string, ChartState>();
+
+ readonly #replaySteps = new Map<string, number>();
+
+ constructor(options: FakeMarketOptions = {}) {
+ const step = options.step ?? 86_400;
+ this.options = {
+ history: options.history ?? 1000,
+ batchLimit: options.batchLimit,
+ endReason: options.endReason ?? 'end',
+ step,
+ now: options.now ?? Math.floor(1_800_000_000 / step) * step,
+ invalidSymbols: options.invalidSymbols ?? ['XXXXX'],
+ studyPlots: options.studyPlots ?? 1,
+ studyNs: options.studyNs,
+ studyError: options.studyError,
+ replaySteps: options.replaySteps ?? 3,
+ };
+ }
+
+ readonly transport: TransportFactory = (request, handlers) => {
+ const connection = new FakeConnection(this, request, handlers);
+ this.connections.push(connection);
+ if (this.autoOpen) setTimeout(() => connection.open(), 0);
+ return connection;
+ };
+
+ get last(): FakeConnection {
+ const connection = this.connections.at(-1);
+ if (!connection) throw new Error('No connection yet');
+ return connection;
+ }
+
+ /** Overrides the answer to a method. Return `false` to fall back to the default. */
+ on(method: string, handler: Handler): void {
+ this.#handlers.set(method, handler);
+ }
+
+ /** Bar time at a position in the full history (0 = oldest). */
+ barTime(position: number): number {
+ return this.options.now - (this.options.history - 1 - position) * this.options.step;
+ }
+
+ bar(position: number): number[] {
+ const close = 100 + position;
+ return [this.barTime(position), close - 1, close + 2, close - 3, close, 10 + position];
+ }
+
+ handle(connection: FakeConnection, packet: SentPacket): void {
+ const custom = this.#handlers.get(packet.m);
+ if (custom && custom(connection, packet) !== false) return;
+ if (!this.respond) return;
+ const method = `on_${packet.m}` as keyof this;
+ const fn = this[method];
+ if (typeof fn === 'function') fn.call(this, connection, packet.p);
+ }
+
+ #symbolOf(init: string): string {
+ const parsed = JSON.parse(init.slice(1));
+ return typeof parsed.symbol === 'string' ? parsed.symbol : parsed.symbol.symbol;
+ }
+
+ #pricesUpdate(chart: string, from: number, to: number, state: ChartState) {
+ const bars = [];
+ for (let position = from; position < to; position += 1) {
+ bars.push({ i: position - state.firstPosition, v: this.bar(position) });
+ }
+ return { m: 'timescale_update', p: [chart, { $prices: { s: bars, ns: { d: '', indexes: [] }, t: 's1' } }, {}] };
+ }
+
+ #studyUpdate(chart: string, studyId: string, type: string, state: ChartState) {
+ if (this.options.studyError !== undefined) {
+ return { m: 'study_error', p: [chart, studyId, 's1_st1', this.options.studyError, 'node'] };
+ }
+ const first = this.options.history - state.loaded;
+ const rows = [];
+ for (let position = first; position < this.options.history; position += 1) {
+ const values = Array.from({ length: this.options.studyPlots }, (_, plot) => position + plot / 10);
+ rows.push({ i: position - state.firstPosition, v: [this.barTime(position), ...values] });
+ }
+ const ns = this.options.studyNs?.(type);
+ return {
+ m: 'du',
+ p: [chart, { [studyId]: { st: rows, ns: { d: ns ? JSON.stringify(ns) : '', indexes: ns ? [0, 1, 2] : [] } } }],
+ };
+ }
+
+ #completed(chart: string, state: ChartState, status = 'streaming') {
+ const details: Record<string, unknown> = { rt_update_period: 5 };
+ if (state.loaded >= this.options.history) details.data_completed = this.options.endReason;
+ return { m: 'series_completed', p: [chart, '$prices', status, 's1', details] };
+ }
+
+ on_chart_create_session(_c: FakeConnection, [chart]: any[]) {
+ this.#charts.set(chart, {
+ symbols: new Map(), loaded: 0, firstPosition: 0, studies: new Map(),
+ });
+ }
+
+ on_resolve_symbol(c: FakeConnection, [chart, seriesId, init]: any[]) {
+ const state = this.#charts.get(chart);
+ if (!state) return;
+ const symbol = this.#symbolOf(init);
+ if (this.options.invalidSymbols.includes(symbol)) {
+ c.pushLater({ m: 'symbol_error', p: [chart, seriesId, 'invalid symbol'] });
+ return;
+ }
+ state.symbols.set(seriesId, symbol);
+ c.pushLater({
+ m: 'symbol_resolved',
+ p: [chart, seriesId, {
+ name: symbol.split(':').pop(), full_name: symbol, pro_name: symbol, description: `Fake ${symbol}`,
+ exchange: symbol.split(':')[0], currency_code: 'EUR', type: 'spot', pricescale: 100, minmov: 1,
+ timezone: 'Etc/UTC', session: '24x7', has_intraday: true, fractional: false, is_tradable: true,
+ }],
+ });
+ }
+
+ on_create_series(c: FakeConnection, [chart, , , seriesId, , range]: any[]) {
+ const state = this.#charts.get(chart);
+ if (!state || !state.symbols.has(seriesId)) return;
+ const count = Array.isArray(range) ? Math.abs(range[2]) : range;
+ state.seriesId = seriesId;
+ state.loaded = Math.min(count, this.options.history, this.options.batchLimit ?? Infinity);
+ state.firstPosition = this.options.history - state.loaded;
+ c.pushLater(
+ { m: 'series_loading', p: [chart, '$prices', 's1'] },
+ this.#pricesUpdate(chart, state.firstPosition, this.options.history, state),
+ this.#completed(chart, state),
+ );
+ }
+
+ on_modify_series(c: FakeConnection, [chart, , , seriesId]: any[]) {
+ const state = this.#charts.get(chart);
+ if (!state || !state.symbols.has(seriesId)) return;
+ c.pushLater(
+ this.#pricesUpdate(chart, this.options.history - state.loaded, this.options.history, state),
+ this.#completed(chart, state),
+ );
+ }
+
+ on_request_more_data(c: FakeConnection, [chart, , count]: any[]) {
+ const state = this.#charts.get(chart);
+ if (!state) return;
+ const add = Math.max(0, Math.min(count, this.options.batchLimit ?? Infinity, this.options.history - state.loaded));
+ const first = this.options.history - state.loaded - add;
+ const end = this.options.history - state.loaded;
+ state.loaded += add;
+ const payloads: object[] = [{ m: 'series_loading', p: [chart, '$prices', 's1'] }];
+ if (add > 0) payloads.push(this.#pricesUpdate(chart, first, end, state));
+ for (const [studyId, type] of state.studies) {
+ payloads.push(
+ { m: 'study_loading', p: [chart, studyId, 's1_st1'] },
+ this.#studyUpdate(chart, studyId, type, state),
+ { m: 'study_completed', p: [chart, studyId, 's1_st1'] },
+ );
+ }
+ payloads.push(this.#completed(chart, state));
+ c.pushLater(...payloads);
+ }
+
+ on_create_study(c: FakeConnection, [chart, studyId, , , type]: any[]) {
+ const state = this.#charts.get(chart);
+ if (!state) return;
+ state.studies.set(studyId, type);
+ const update = this.#studyUpdate(chart, studyId, type, state);
+ c.pushLater(
+ { m: 'study_loading', p: [chart, studyId, 's1_st1'] },
+ update,
+ ...(update.m === 'study_error' ? [] : [{ m: 'study_completed', p: [chart, studyId, 's1_st1'] }]),
+ );
+ }
+
+ on_quote_add_symbols(c: FakeConnection, [session, ...keys]: any[]) {
+ for (const key of keys) {
+ const symbol = key.startsWith('=') ? JSON.parse(key.slice(1)).symbol : key;
+ if (this.options.invalidSymbols.includes(symbol)) {
+ c.pushLater({ m: 'qsd', p: [session, { n: key, s: 'error', errmsg: 'no_such_symbol', v: {} }] });
+ continue;
+ }
+ c.pushLater(
+ {
+ m: 'qsd',
+ p: [session, {
+ n: key, s: 'ok', v: { lp: 100, ch: 1, description: `Fake ${symbol}`, currency_code: 'EUR' },
+ }],
+ },
+ { m: 'quote_completed', p: [session, key] },
+ );
+ }
+ }
+
+ on_replay_add_series(c: FakeConnection, [replay, request]: any[]) {
+ c.pushLater({ m: 'replay_ok', p: [replay, request] });
+ }
+
+ on_replay_reset(c: FakeConnection, [replay, request, time]: any[]) {
+ this.#replaySteps.set(replay, 0);
+ c.pushLater(
+ { m: 'replay_instance_id', p: [replay, 'replay-instance-1'] },
+ { m: 'replay_ok', p: [replay, request] },
+ { m: 'replay_point', p: [replay, time] },
+ { m: 'replay_resolutions', p: [replay, '1D', '1S'] },
+ );
+ }
+
+ on_replay_step(c: FakeConnection, [replay, request, count]: any[]) {
+ const steps = (this.#replaySteps.get(replay) ?? 0) + count;
+ this.#replaySteps.set(replay, steps);
+ const payloads: object[] = [
+ { m: 'replay_ok', p: [replay, request] },
+ { m: 'replay_point', p: [replay, this.barTime(steps)] },
+ ];
+ if (steps >= this.options.replaySteps) payloads.push({ m: 'replay_data_end', p: [replay] });
+ c.pushLater(...payloads);
+ }
+
+ on_replay_start(c: FakeConnection, [replay, request]: any[]) {
+ c.pushLater({ m: 'replay_ok', p: [replay, request] });
+ }
+
+ on_replay_stop(c: FakeConnection, [replay, request]: any[]) {
+ c.pushLater({ m: 'replay_ok', p: [replay, request] });
+ }
+}
+
+/** Waits for pending timers/microtasks (fake server answers use `setTimeout(0)`). */
+export const flush = (rounds = 3) => (async () => {
+ for (let i = 0; i < rounds; i += 1) await new Promise((resolve) => { setTimeout(resolve, 0); });
+})();
+
+/** Polls until `predicate` is true. */
+export async function until(predicate: () => boolean, timeoutMs = 2_000): Promise<void> {
+ const start = Date.now();
+ while (!predicate()) {
+ if (Date.now() - start > timeoutMs) throw new Error('until: timed out');
+ await new Promise((resolve) => { setTimeout(resolve, 1); });
+ }
+}
diff --git a/tests/helpers/indicators.ts b/tests/helpers/indicators.ts
new file mode 100644
index 0000000..fc40d53
--- /dev/null
+++ b/tests/helpers/indicators.ts
@@ -0,0 +1,19 @@
+import { PineIndicator } from '../../src/indicators/pine-indicator.js';
+
+/** Small Pine indicator definition used across tests. */
+export function makePine() {
+ return new PineIndicator({
+ id: 'PUB;test',
+ version: '3.0',
+ description: 'Test indicator',
+ shortDescription: 'TEST',
+ script: 'bmI9Ii...IL',
+ inputs: {
+ in_0: { name: 'Length', inline: 'Length', internalID: 'length', type: 'integer', value: 14, isHidden: false, isFake: false },
+ in_1: { name: 'Source', inline: 'Source', internalID: 'src', type: 'source', value: 'close', isHidden: false, isFake: false, options: ['close', 'open'] },
+ in_2: { name: 'Color', inline: 'Color', internalID: 'color', type: 'color', value: '#ff0000', isHidden: false, isFake: true },
+ in_3: { name: 'Show', inline: 'Show', type: 'bool', value: true, isHidden: false, isFake: false },
+ },
+ plots: { plot_0: 'Value', plot_1: 'Value', plot_2: 'Signal' },
+ });
+}
diff --git a/tests/indicators.test.ts b/tests/indicators.test.ts
deleted file mode 100644
index a9ab74c..0000000
--- a/tests/indicators.test.ts
+++ /dev/null
@@ -1,170 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-import { describe, it, expect } from 'vitest';
-import TradingView from '../main';
-
-const token = <string>process.env.SESSION;
-const signature = <string>process.env.SIGNATURE;
-
-describe('Indicators', () => {
- const indicators: { [name: string]: TradingView.PineIndicator } = {};
-
- it('gets Supertrend strategy', async () => {
- indicators.SuperTrend = await TradingView.getIndicator('STD;Supertrend%Strategy');
- expect(indicators.SuperTrend).toBeDefined();
- expect(indicators.SuperTrend.description).toMatch(/^Supertrend strategy$/i);
-
- indicators.SuperTrend.setOption('commission_type', 'percent');
- indicators.SuperTrend.setOption('commission_value', 0);
- indicators.SuperTrend.setOption('initial_capital', 25000);
- indicators.SuperTrend.setOption('default_qty_value', 20);
- indicators.SuperTrend.setOption('default_qty_type', 'percent_of_equity');
- indicators.SuperTrend.setOption('currency', 'EUR');
- indicators.SuperTrend.setOption('pyramiding', 10);
-
- expect(indicators.SuperTrend).toBeDefined();
- });
-
- it('gets MarketCipher B study', async () => {
- indicators.CipherB = await TradingView.getIndicator('PUB;uA35GeckoTA2EfgI63SD2WCSmca4njxp');
- expect(indicators.CipherB).toBeDefined();
- expect(indicators.CipherB.description).toBe('VuManChu B Divergences');
-
- indicators.CipherB.setOption('Show_WT_Hidden_Divergences', true);
- indicators.CipherB.setOption('Show_Stoch_Regular_Divergences', true);
- indicators.CipherB.setOption('Show_Stoch_Hidden_Divergences', true);
-
- expect(indicators.CipherB).toBeDefined();
- });
-
- let client: TradingView.Client;
- let chart: InstanceType<typeof client.Session.Chart>;
-
- const noAuth = !token || !signature;
-
- it.skipIf(noAuth)('creates a client', async () => {
- client = new TradingView.Client({ token, signature });
- expect(client).toBeDefined();
- });
-
- it.skipIf(noAuth)('creates a chart', async () => {
- chart = new client.Session.Chart();
- expect(chart).toBeDefined();
- });
-
- it.skipIf(noAuth)('sets market', async () => {
- chart.setMarket('BINANCE:BTCEUR', {
- timeframe: '60',
- });
-
- await new Promise((resolve) => {
- chart.onSymbolLoaded(() => {
- console.log('Chart loaded');
- resolve(true);
- });
- });
-
- expect(chart.infos.full_name).toBe('BINANCE:BTCEUR');
- });
-
- it.skipIf(noAuth)('gets performance data from SuperTrend strategy', async () => {
- const SuperTrend = new chart.Study(indicators.SuperTrend);
-
- let QTY = 10;
- let done = false;
- let retryTimer: NodeJS.Timeout | undefined;
- const stopRetries = () => {
- done = true;
- if (retryTimer) clearTimeout(retryTimer);
- retryTimer = undefined;
- };
- const perfResult = await new Promise((resolve) => {
- SuperTrend.onUpdate(() => {
- if (done) return;
-
- // SuperTrend is a strategy so it sends a strategy report
- const perfReport = SuperTrend.strategyReport.performance;
-
- console.log('Performances:', {
- total: {
- trades: perfReport?.all?.totalTrades,
- perf: `${Math.round((
- perfReport?.all?.netProfitPercent || 0
- ) * 10000) / 100} %`,
- },
- buy: {
- trades: perfReport?.long?.totalTrades,
- perf: `${Math.round((
- perfReport?.long?.netProfitPercent || 0
- ) * 10000) / 100} %`,
- },
- sell: {
- trades: perfReport?.short?.totalTrades,
- perf: `${Math.round((
- perfReport?.short?.netProfitPercent || 0
- ) * 10000) / 100} %`,
- },
- });
-
- if (perfReport?.all?.totalTrades !== undefined && QTY >= 50) {
- stopRetries();
- resolve(true);
- return;
- }
-
- QTY += 10;
- console.log('TRY WITH', QTY, '%');
- if (retryTimer) clearTimeout(retryTimer);
- retryTimer = setTimeout(() => {
- retryTimer = undefined;
- if (done) return;
-
- indicators.SuperTrend.setOption('default_qty_value', QTY);
- SuperTrend.setIndicator(indicators.SuperTrend);
- }, 1000);
- });
- });
-
- expect(perfResult).toBe(true);
-
- stopRetries();
- SuperTrend.remove();
- }, 30000);
-
- it.skipIf(noAuth)('gets data from MarketCipher B study', async () => {
- const CipherB = new chart.Study(indicators.CipherB);
-
- const lastResult: any = await new Promise((resolve) => {
- CipherB.onUpdate(() => {
- const lastPeriod = CipherB.periods[0];
-
- if (lastPeriod?.VWAP !== undefined && lastPeriod?.rsiMFI !== undefined) {
- resolve(lastPeriod);
- }
- });
- });
-
- console.log('MarketCipher B last values:', {
- VWAP: Math.round(lastResult.VWAP * 1000) / 1000,
- moneyFlow: (lastResult.rsiMFI >= 0) ? 'POSITIVE' : 'NEGATIVE',
- buyCircle: lastResult.Buy_and_sell_circle && lastResult.VWAP > 0,
- sellCircle: lastResult.Buy_and_sell_circle && lastResult.VWAP < 0,
- });
-
- expect(lastResult.VWAP).toBeTypeOf('number');
- expect(lastResult.rsiMFI).toBeTypeOf('number');
- expect(lastResult.Buy_and_sell_circle).toBeTypeOf('number');
-
- CipherB.remove();
- }, 30000);
-
- it.skipIf(noAuth)('removes chart', () => {
- console.log('Closing the chart...');
- chart.delete();
- });
-
- it.skipIf(noAuth)('removes client', async () => {
- console.log('Closing the client...');
- await client.end();
- });
-});
diff --git a/tests/live/authenticated.test.ts b/tests/live/authenticated.test.ts
new file mode 100644
index 0000000..03d1eb6
--- /dev/null
+++ b/tests/live/authenticated.test.ts
@@ -0,0 +1,51 @@
+import { describe, expect, it } from 'vitest';
+import {
+ getCandles, getIndicator, getIndicatorData, getPrivateIndicators, getUser, TradingViewClient,
+} from '../../src/index.js';
+import { credentials, LIVE } from './env.js';
+
+// Needs SESSION and SIGNATURE cookies of a TradingView account.
+describe.skipIf(!LIVE || !credentials)('live: authenticated', () => {
+ const auth = credentials as NonNullable<typeof credentials>;
+
+ it('gets the account', async () => {
+ const user = await getUser(auth);
+ expect(user.id).toBeGreaterThan(0);
+ expect(user.username).toBeTruthy();
+ expect(user.authToken).toBeTruthy();
+ expect(user.session).toBe(auth.session);
+ });
+
+ it('opens an authenticated connection', async () => {
+ const client = new TradingViewClient({ credentials: auth });
+ await client.ready;
+ expect(client.isAuthenticated).toBe(true);
+ await client.close();
+ });
+
+ it('runs a Pine study and a strategy report', async () => {
+ const rsi = await getIndicatorData({ symbol: 'BINANCE:BTCEUR', indicator: 'STD;RSI', credentials: auth, timeoutMs: 30_000 });
+ expect(rsi.values.length).toBeGreaterThan(0);
+
+ const strategy = await getIndicator('STD;Supertrend%Strategy');
+ strategy.setInput('commission_type', 'percent').setInput('default_qty_value', 20);
+ const result = await getIndicatorData({
+ symbol: 'BINANCE:BTCEUR', timeframe: '60', indicator: strategy, credentials: auth, timeoutMs: 30_000,
+ });
+ expect(result.strategyReport.performance.all?.totalTrades).toBeTypeOf('number');
+ });
+
+ it('lists private indicators', async () => {
+ const list = await getPrivateIndicators(auth);
+ expect(Array.isArray(list)).toBe(true);
+ });
+
+ it('uses an account timeframe with a recent historical reference', async () => {
+ // Older references can be refused with data_completed=limit even for paid accounts.
+ const to = Math.floor(Date.now() / 1000) - 7 * 86_400;
+ const candles = await getCandles({ symbol: 'BINANCE:BTCEUR', timeframe: '240', count: 2, to, credentials: auth });
+ expect(candles).toHaveLength(2);
+ expect(candles.at(-1)?.time).toBeLessThanOrEqual(to);
+ expect(candles[1].time - candles[0].time).toBe(4 * 3_600);
+ });
+});
diff --git a/tests/live/data.test.ts b/tests/live/data.test.ts
new file mode 100644
index 0000000..e6f53da
--- /dev/null
+++ b/tests/live/data.test.ts
@@ -0,0 +1,78 @@
+import { describe, expect, it } from 'vitest';
+import {
+ getCandles, getQuote, getQuotes, getSymbolInfo, getTechnicalAnalysis, searchIndicators, searchMarkets,
+ watchCandles, watchQuotes, getIndicatorData,
+} from '../../src/data/index.js';
+import { LIVE, minGap } from './env.js';
+
+describe.skipIf(!LIVE)('live: high-level data API', () => {
+ it('gets daily candles', async () => {
+ const candles = await getCandles({ symbol: 'BINANCE:BTCEUR', timeframe: 'D', count: 20 });
+ expect(candles).toHaveLength(20);
+ expect(minGap(candles.map((c) => c.time))).toBe(86_400);
+ expect(candles[0].time).toBeLessThan(candles[19].time);
+ });
+
+ it('loads deep history and a from/to range', async () => {
+ const deep = await getCandles({ symbol: 'BINANCE:BTCEUR', timeframe: '60', count: 3_000, timeoutMs: 30_000 });
+ expect(deep.length).toBeGreaterThanOrEqual(3_000);
+ const from = Math.floor(Date.now() / 1000) - 7 * 86_400;
+ const range = await getCandles({ symbol: 'BINANCE:BTCEUR', timeframe: '240', from });
+ expect(range[0].time).toBeGreaterThanOrEqual(from);
+ expect(range.length).toBeGreaterThanOrEqual(40);
+ });
+
+ it('gets custom chart types', async () => {
+ for (const chartType of ['HeikinAshi', 'Renko', 'LineBreak', 'Kagi', 'PointAndFigure', 'Range'] as const) {
+ const candles = await getCandles({ symbol: 'BINANCE:BTCEUR', timeframe: 'D', count: 10, chartType });
+ expect(candles.length, chartType).toBeGreaterThan(0);
+ }
+ });
+
+ it('watches candles and stops cleanly', async () => {
+ let updates = 0;
+ const watcher = await watchCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '1', count: 5 }, {
+ onData: () => { updates += 1; },
+ });
+ expect(watcher.latest).toHaveLength(5);
+ expect(updates).toBeGreaterThanOrEqual(1);
+ await watcher.stop();
+ expect(watcher.isActive).toBe(false);
+ });
+
+ it('gets and watches quotes', async () => {
+ const quote = await getQuote('BINANCE:BTCEUR');
+ expect(typeof quote.lp).toBe('number');
+ const quotes = await getQuotes({ symbols: ['BINANCE:BTCEUR', 'NASDAQ:AAPL'], fields: 'price' });
+ expect(Object.keys(quotes).sort()).toEqual(['BINANCE:BTCEUR', 'NASDAQ:AAPL']);
+ const watcher = await watchQuotes({ symbols: ['BINANCE:BTCUSDT'] }, { onData: () => {} });
+ expect(watcher.latest['BINANCE:BTCUSDT']?.lp).toBeTypeOf('number');
+ await watcher.stop();
+ });
+
+ it('reports errors with codes', async () => {
+ await expect(getCandles('XXXXX')).rejects.toMatchObject({ code: 'SYMBOL_ERROR' });
+ await expect(getQuote('XXXX:NOPE')).rejects.toMatchObject({ code: 'QUOTE_ERROR' });
+ await expect(getCandles({ symbol: 'BINANCE:BTCEUR', timeframe: 'XX' })).rejects.toMatchObject({ code: 'CRITICAL_ERROR' });
+ });
+
+ it('resolves symbol info', async () => {
+ // Anonymous sessions may be served by a substitute feed (full_name BATS:AAPL); pro_name stays NASDAQ:AAPL.
+ expect(await getSymbolInfo('NASDAQ:AAPL')).toMatchObject({ pro_name: 'NASDAQ:AAPL', currency_code: 'USD' });
+ });
+
+ it('runs a built-in study without an account', async () => {
+ const { values } = await getIndicatorData({ symbol: 'BINANCE:BTCEUR', indicator: 'Volume@tv-basicstudies-241', count: 10 });
+ expect(values.at(-1)?.plot_0).toBeTypeOf('number');
+ });
+
+ it('searches markets and indicators, and gets technical analysis', async () => {
+ expect((await searchMarkets('BINANCE:')).length).toBeGreaterThan(10);
+ expect((await searchMarkets('nasdaq apple'))[0]?.id).toBe('NASDAQ:AAPL');
+ expect((await searchIndicators('RSI')).length).toBeGreaterThan(10);
+ const ta = await getTechnicalAnalysis('BINANCE:BTCUSD');
+ for (const period of ['1', '5', '15', '60', '240', '1D', '1W', '1M'] as const) {
+ expect(ta?.[period]).toMatchObject({ Other: expect.any(Number), All: expect.any(Number), MA: expect.any(Number) });
+ }
+ });
+});
diff --git a/tests/live/env.ts b/tests/live/env.ts
new file mode 100644
index 0000000..eaa4923
--- /dev/null
+++ b/tests/live/env.ts
@@ -0,0 +1,18 @@
+import type { Credentials } from '../../src/index.js';
+
+/** Live tests only run with TV_LIVE=1 (`npm run test:live`). */
+export const LIVE = process.env.TV_LIVE === '1';
+
+/** Authenticated live tests also need SESSION and SIGNATURE cookies. */
+export const credentials: Credentials | undefined = process.env.SESSION && process.env.SIGNATURE
+ ? { session: process.env.SESSION, signature: process.env.SIGNATURE }
+ : undefined;
+
+export const wait = (ms: number) => new Promise((resolve) => { setTimeout(resolve, ms); });
+
+/** Smallest gap between consecutive candle times. */
+export function minGap(times: number[]): number {
+ let gap = Infinity;
+ for (let i = 1; i < times.length; i += 1) gap = Math.min(gap, times[i] - times[i - 1]);
+ return gap;
+}
diff --git a/tests/live/sessions.test.ts b/tests/live/sessions.test.ts
new file mode 100644
index 0000000..2f796a4
--- /dev/null
+++ b/tests/live/sessions.test.ts
@@ -0,0 +1,105 @@
+import { describe, expect, it } from 'vitest';
+import {
+ BuiltInIndicator, getIndicator, TradingViewClient, type TradingViewError,
+} from '../../src/index.js';
+import { LIVE, minGap, wait } from './env.js';
+
+describe.skipIf(!LIVE)('live: low-level sessions', () => {
+ it('changes market, timeframe, timezone and chart type on one chart', async () => {
+ const client = new TradingViewClient();
+ const chart = client.createChart();
+ const completed = () => new Promise((resolve) => { chart.once('seriesCompleted', resolve); });
+
+ chart.setMarket('BINANCE:BTCEUR', { timeframe: 'D' });
+ await completed();
+ expect(chart.symbolInfo?.full_name).toBe('BINANCE:BTCEUR');
+ expect(minGap(chart.candles.map((c) => c.time))).toBe(86_400);
+
+ chart.setTimeframe('15');
+ await completed();
+ expect(minGap(chart.candles.map((c) => c.time))).toBe(900);
+
+ chart.setTimezone('Europe/Paris');
+ chart.setMarket('BINANCE:ETHEUR', { timeframe: 'D', type: 'HeikinAshi' });
+ await completed();
+ expect(chart.symbolInfo?.full_name).toBe('BINANCE:ETHEUR');
+
+ chart.fetchMore(50);
+ await completed();
+ expect(chart.candles.length).toBeGreaterThan(100);
+ chart.delete();
+ await client.close();
+ });
+
+ it('loads bars after a past reference with a negative count', async () => {
+ const client = new TradingViewClient();
+ const chart = client.createChart();
+ chart.setMarket('BINANCE:BTCEUR', { timeframe: '240', count: -1, to: Math.round(Date.now() / 1000) - 86_400 * 7 });
+ await new Promise((resolve) => { chart.once('seriesCompleted', resolve); });
+ expect(chart.candles.length).toBeGreaterThan(0);
+ await client.close();
+ });
+
+ it('reports server errors as typed errors', async () => {
+ const client = new TradingViewClient();
+ const errorOf = (setup: (chart: ReturnType<typeof client.createChart>) => void) => new Promise<TradingViewError>((resolve) => {
+ const chart = client.createChart();
+ chart.on('error', resolve);
+ setup(chart);
+ });
+ expect((await errorOf((c) => c.setMarket('XXXXX'))).code).toBe('SYMBOL_ERROR');
+ expect((await errorOf((c) => { c.setMarket('BINANCE:BTCEUR'); c.setTimezone('Nowhere/Nowhere'); })).message)
+ .toBe('Critical error: invalid timezone');
+ expect((await errorOf((c) => c.setMarket('BINANCE:BTCEUR', { timeframe: 'XX' }))).code).toBe('CRITICAL_ERROR');
+ const premium = await errorOf((c) => c.setMarket('BINANCE:BTCEUR', { timeframe: '15', type: 'Renko' }));
+ expect(premium.code).toBe('SERIES_ERROR');
+ expect(premium.message).toMatch(/study_not_auth/);
+ await client.close();
+ });
+
+ it('streams quotes through a quote session', async () => {
+ const client = new TradingViewClient();
+ const session = client.createQuoteSession({ fields: 'all' });
+ const btc = session.subscribe('BINANCE:BTCEUR');
+ await new Promise<void>((resolve) => { btc.once('loaded', () => resolve()); });
+ expect(Object.keys(btc.data)).toEqual(expect.arrayContaining(['lp', 'ch', 'chp', 'description', 'currency_code', 'bid', 'ask']));
+ btc.close();
+ session.delete();
+ await client.close();
+ });
+
+ it('replays history step by step', async () => {
+ const client = new TradingViewClient();
+ const chart = client.createChart();
+ chart.setMarket('BINANCE:BTCEUR', { timeframe: 'D', replay: Math.round(Date.now() / 1000) - 86_400 * 5, count: 1 });
+ await new Promise((resolve) => { chart.once('replayLoaded', resolve); });
+ let ended = false;
+ chart.once('replayEnd', () => { ended = true; });
+ for (let i = 0; i < 20 && !ended; i += 1) await chart.replayStep(1);
+ await wait(500);
+ expect(ended).toBe(true);
+ expect(minGap(chart.candles.map((c) => c.time))).toBe(86_400);
+ await client.close();
+ });
+
+ it('reads a volume profile built-in study with graphics', async () => {
+ const client = new TradingViewClient();
+ const chart = client.createChart();
+ chart.setMarket('BINANCE:BTCEUR', { timeframe: '60' });
+ const profile = new BuiltInIndicator('VbPFixed@tv-basicstudies-241!');
+ profile.setOption('first_bar_time', Date.now() - 10 ** 8);
+ const study = chart.createStudy(profile);
+ for (let i = 0; i < 100 && !study.graphics.horizHists.length; i += 1) await wait(100);
+ expect(study.graphics.horizHists.length).toBeGreaterThan(5);
+ study.remove();
+ expect(chart.studies).toEqual([]);
+ await client.close();
+ });
+
+ it('loads Pine indicator definitions', async () => {
+ const strategy = await getIndicator('STD;Supertrend%Strategy');
+ expect(strategy.description).toMatch(/supertrend strategy/i);
+ strategy.setInput('commission_type', 'percent').setInput('initial_capital', 25_000);
+ await expect(getIndicator('STD;XXXXXXX')).rejects.toMatchObject({ code: 'NOT_FOUND' });
+ });
+});
diff --git a/tests/quoteSession.test.ts b/tests/quoteSession.test.ts
deleted file mode 100644
index 9577ca8..0000000
--- a/tests/quoteSession.test.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-import { describe, it, expect } from 'vitest';
-import TradingView from '../main';
-
-describe('Quote session', () => {
- let client: TradingView.Client;
- let quoteSession: any;
- let BTC: any;
-
- it('creates client', () => {
- client = new TradingView.Client();
- expect(client).toBeDefined();
- });
-
- it('creates quote session', () => {
- quoteSession = new client.Session.Quote({ fields: 'all' });
- expect(quoteSession).toBeDefined();
- });
-
- it('asks for market BTCEUR', () => {
- BTC = new quoteSession.Market('BTCEUR');
- expect(BTC).toBeDefined();
-
- expect(new Promise((resolve) => {
- BTC.onLoaded(() => {
- console.log('BTCEUR quote loaded');
- resolve(true);
- });
- })).resolves.toBe(true);
- });
-
- it('data has all properties', () => {
- expect(new Promise((resolve) => {
- BTC.onData((data) => {
- const rsKeys = Object.keys(data);
- console.log('BTCEUR data received');
- if (rsKeys.length <= 2) return;
- resolve(rsKeys.sort());
- });
- })).resolves.toEqual(
- [
- 'ask', 'bid', 'format',
- 'volume', 'update_mode', 'type', 'timezone',
- 'short_name', 'rtc_time', 'rtc', 'rchp', 'ch',
- 'rch', 'provider_id', 'pro_name', 'pricescale',
- 'prev_close_price', 'original_name', 'lp',
- 'open_price', 'minmove2', 'minmov', 'lp_time',
- 'low_price', 'is_tradable', 'high_price',
- 'fractional', 'exchange', 'description',
- 'current_session', 'currency_code', 'chp',
- 'currency-logoid', 'base-currency-logoid',
- ].sort(),
- );
- });
-
- it('closes quote session', () => {
- BTC.close();
- });
-
- it('closes client', () => {
- client.end();
- });
-});
diff --git a/tests/replayMode.test.ts b/tests/replayMode.test.ts
deleted file mode 100644
index d9edc4e..0000000
--- a/tests/replayMode.test.ts
+++ /dev/null
@@ -1,129 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-import { describe, it, expect } from 'vitest';
-import TradingView from '../main';
-import utils from './utils';
-
-describe('ReplayMode', () => {
- let client: TradingView.Client;
- let chart: InstanceType<typeof client.Session.Chart>;
-
- it('creates a client', async () => {
- client = new TradingView.Client();
- expect(client).toBeDefined();
- });
-
- it('creates a chart', async () => {
- chart = new client.Session.Chart();
- expect(chart).toBeDefined();
- });
-
- it('sets market', async () => {
- chart.setMarket('BINANCE:BTCEUR', {
- timeframe: 'D',
- replay: Math.round(Date.now() / 1000) - 86400 * 10,
- range: 1,
- });
-
- await new Promise((resolve) => {
- chart.onSymbolLoaded(() => {
- console.log('Chart loaded');
- resolve(true);
- });
- });
-
- expect(chart.infos.full_name).toBe('BINANCE:BTCEUR');
- });
-
- it('steps forward manually', async () => {
- let finished = false;
-
- async function step() {
- if (finished) return;
- await chart.replayStep(1);
- await utils.wait(100);
- console.log('Replay step');
- step();
- }
- step();
-
- chart.onReplayPoint((p: number) => {
- console.log('Last point ->', p);
- });
-
- chart.onReplayEnd(async () => {
- console.log('Replay end');
- finished = true;
- });
-
- await new Promise((resolve) => {
- chart.onReplayEnd(() => {
- finished = true;
- resolve(true);
- });
- });
-
- expect(
- utils.calculateTimeGap(chart.periods),
- ).toBe(24 * 60 * 60);
-
- expect(chart.periods.length).toBeGreaterThanOrEqual(6);
- expect(chart.periods.length).toBeLessThanOrEqual(11);
- });
-
- it('sets market', async () => {
- chart.setMarket('BINANCE:BTCEUR', {
- timeframe: 'D',
- replay: Math.round(Date.now() / 1000) - 86400 * 10,
- range: 1,
- });
-
- await new Promise((r) => {
- chart.onSymbolLoaded(() => r(true));
- });
- console.log('Chart loaded');
-
- expect(chart.infos.full_name).toBe('BINANCE:BTCEUR');
- });
-
- it.skip('steps forward automatically', async () => {
- console.log('Play replay mode');
- await chart.replayStart(200);
-
- chart.onUpdate(() => {
- console.log('Point ->', chart.periods[0].time);
- });
-
- const msg = await Promise.race([
- new Promise((r) => {
- chart.onReplayEnd(() => r('Replay end'));
- }),
- new Promise((r) => {
- setTimeout(() => r('Timeout'), 9000);
- }),
- ]);
-
- console.log(msg);
-
- expect(
- utils.calculateTimeGap(chart.periods),
- ).toBe(24 * 60 * 60);
-
- expect(chart.periods.length).toBeGreaterThanOrEqual(7);
- expect(chart.periods.length).toBeLessThanOrEqual(11);
- });
-
- it('closes chart', async () => {
- console.log('Waiting 1 second...');
- await utils.wait(1000);
- console.log('Closing the chart...');
- chart.delete();
- });
-
- it('closes client', async () => {
- console.log('Waiting 1 second...');
- await utils.wait(1000);
- console.log('Closing the client...');
- await client.end();
- });
-});
diff --git a/tests/search.test.ts b/tests/search.test.ts
deleted file mode 100644
index de94eef..0000000
--- a/tests/search.test.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-import { describe, it, expect } from 'vitest';
-import { searchMarket, searchIndicator, searchMarketV3 } from '../main';
-
-describe('Search functions', () => {
- it('market search (old): "BINANCE:" has results', async () => {
- console.log('Searching market: "BINANCE:"');
- const markets = await searchMarket('BINANCE:');
- console.log('Found', markets.length, 'markets');
-
- expect(markets.length).toBeGreaterThan(10);
- });
-
- it('market search: "BINANCE:" has results', async () => {
- console.log('Searching market: "BINANCE:"');
- const markets = await searchMarketV3('BINANCE:');
- console.log('Found', markets.length, 'markets');
-
- expect(markets.length).toBeGreaterThan(10);
- });
-
- it('indicator search: "RSI" has results', async () => {
- console.log('Searching indicator: "RSI"');
- const indicators = await searchIndicator('RSI');
- console.log('Found', indicators.length, 'indicators');
-
- expect(indicators.length).toBeGreaterThan(10);
- });
-});
-
-describe('Technical Analysis', () => {
- const SEARCHES = {
- // search text: expected first result
- 'binance:BTCUSD': 'BINANCE:BTCUSD',
- 'nasdaq apple': 'NASDAQ:AAPL',
- };
-
- for (const marketName in SEARCHES) {
- it(`gets TA for '${marketName}'`, async () => {
- const foundMarkets = await searchMarketV3(marketName);
- const firstResult = foundMarkets[0];
-
- console.log(`Market search first result for '${marketName}':`, firstResult);
-
- expect(firstResult).toBeDefined();
- expect(firstResult.id).toBe(SEARCHES[marketName]);
-
- const ta = await firstResult.getTA();
- expect(ta).toBeDefined();
-
- for (const period of ['1', '5', '15', '60', '240', '1D', '1W', '1M']) {
- expect(ta[period]).toBeDefined();
- expect(ta[period].Other).toBeDefined();
- expect(ta[period].All).toBeDefined();
- expect(ta[period].MA).toBeDefined();
- }
- });
- }
-});
diff --git a/tests/simpleChart.test.ts b/tests/simpleChart.test.ts
deleted file mode 100644
index 396129a..0000000
--- a/tests/simpleChart.test.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-import { describe, it, expect } from 'vitest';
-import TradingView from '../main';
-import utils from './utils';
-
-describe('Simple chart session', async () => {
- let client: TradingView.Client;
- let chart: InstanceType<typeof client.Session.Chart>;
-
- it('creates a client', () => {
- client = new TradingView.Client();
- expect(client).toBeDefined();
- });
-
- it('creates a chart session', () => {
- chart = new client.Session.Chart();
- expect(chart).toBeDefined();
- });
-
- it('sets market', async () => {
- chart.setMarket('BINANCE:BTCEUR', {
- timeframe: 'D',
- });
-
- while (
- chart.infos.full_name !== 'BINANCE:BTCEUR'
- || chart.periods.length < 10
- ) await utils.wait(100);
-
- expect(chart.infos.full_name).toBe('BINANCE:BTCEUR');
- expect(
- utils.calculateTimeGap(chart.periods),
- ).toBe(24 * 60 * 60);
- });
-
- it('sets timeframe', async () => {
- console.log('Waiting 1 second...');
- await utils.wait(1000);
-
- console.log('Setting timeframe to 15 minutes...');
- chart.setSeries('15');
-
- while (chart.periods.length < 10) await utils.wait(100);
- console.log('Chart timeframe set');
-
- expect(
- utils.calculateTimeGap(chart.periods),
- ).toBe(15 * 60);
- });
-
- it('sets chart type', async () => {
- console.log('Waiting 1 second...');
- await utils.wait(1000);
-
- console.log('Setting the chart type to "Heikin Ashi"...');
- chart.setMarket('BINANCE:ETHEUR', {
- timeframe: 'D',
- type: 'HeikinAshi',
- });
-
- while (chart.infos.full_name !== 'BINANCE:ETHEUR') await utils.wait(100);
-
- console.log('Chart type set');
- expect(chart.infos.full_name).toBe('BINANCE:ETHEUR');
- });
-
- it('closes chart', async () => {
- console.log('Waiting 1 second...');
- await utils.wait(1000);
- console.log('Closing the chart...');
- chart.delete();
- });
-
- it('closes client', async () => {
- console.log('Waiting 1 second...');
- await utils.wait(1000);
- console.log('Closing the client...');
- await client.end();
- });
-});
diff --git a/tests/unit/chart.test.ts b/tests/unit/chart.test.ts
new file mode 100644
index 0000000..2df8ea9
--- /dev/null
+++ b/tests/unit/chart.test.ts
@@ -0,0 +1,234 @@
+import { readFileSync } from 'node:fs';
+import { describe, expect, it } from 'vitest';
+import { TradingViewClient } from '../../src/client/client.js';
+import { BuiltInIndicator } from '../../src/indicators/builtin-indicator.js';
+import { decodeFrames } from '../../src/protocol/framing.js';
+import { FakeServer, flush, until } from '../helpers/fake-server.js';
+
+const live = JSON.parse(readFileSync(new URL('../fixtures/live-session.json', import.meta.url), 'utf8'));
+
+async function setup(options: ConstructorParameters<typeof FakeServer>[0] = {}) {
+ const server = new FakeServer(options);
+ const client = new TradingViewClient({ transport: server.transport });
+ await client.ready;
+ return { server, client, connection: server.last };
+}
+
+describe('ChartSession', () => {
+ it('creates a session, resolves the symbol and loads candles oldest first', async () => {
+ const { server, client, connection } = await setup({ history: 50 });
+ const chart = client.createChart();
+ const events: string[] = [];
+ chart.onAny((event) => { events.push(event); });
+ chart.setMarket('BINANCE:BTCEUR', { timeframe: '240', count: 3 });
+ await until(() => events.includes('seriesCompleted'));
+
+ expect(connection.packets('chart_create_session')[0].p).toEqual([chart.id]);
+ expect(connection.packets('resolve_symbol')[0].p).toEqual([
+ chart.id, 'ser_1', '={"symbol":"BINANCE:BTCEUR","adjustment":"splits"}',
+ ]);
+ expect(connection.packets('create_series')[0].p).toEqual([chart.id, '$prices', 's1', 'ser_1', '240', 3]);
+ expect(chart.symbolInfo).toMatchObject({ series_id: 'ser_1', full_name: 'BINANCE:BTCEUR' });
+ expect(chart.candles.map((c) => c.time)).toEqual([server.barTime(47), server.barTime(48), server.barTime(49)]);
+ expect(chart.lastCandle).toEqual({
+ time: server.barTime(49), open: 148, high: 151, low: 146, close: 149, volume: 59,
+ });
+ expect(events).toEqual(['symbolLoaded', 'seriesLoading', 'update', 'seriesCompleted']);
+ expect(chart.seriesId).toBe('ser_1');
+ expect(chart.timeframe).toBe('240');
+ await client.close();
+ });
+
+ it('encodes market options, custom chart types and bar_count ranges', async () => {
+ const { client, connection } = await setup();
+ const chart = client.createChart();
+ chart.setMarket('CME:ES1!', {
+ timeframe: 'D',
+ count: 10,
+ to: 1_700_000_000,
+ adjustment: 'dividends',
+ backAdjustment: true,
+ session: 'extended',
+ currency: 'EUR',
+ type: 'Renko',
+ inputs: { boxSize: 3, style: 'ATR' },
+ });
+ const [init] = connection.packets('resolve_symbol');
+ expect(JSON.parse(init.p[2].slice(1))).toEqual({
+ symbol: {
+ symbol: 'CME:ES1!', adjustment: 'dividends', backadjustment: 'default', session: 'extended', 'currency-id': 'EUR',
+ },
+ type: 'BarSetRenko@tv-prostudies-40!',
+ inputs: { boxSize: 3, style: 'ATR' },
+ });
+ expect(connection.packets('create_series')[0].p[5]).toEqual(['bar_count', 1_700_000_000, 10]);
+ expect(() => chart.setMarket('X', { type: 'Nope' as any })).toThrow(/Unknown chart type/);
+ await client.close();
+ });
+
+ it('modifies the series on later setMarket/setTimeframe calls and keeps the bar count', async () => {
+ const { client, connection } = await setup();
+ const chart = client.createChart();
+ expect(() => chart.setTimeframe('15')).toThrow(expect.objectContaining({ code: 'INVALID_STATE' }));
+ chart.setMarket('BINANCE:BTCEUR');
+ chart.setMarket('BINANCE:ETHEUR', { timeframe: '60', type: 'HeikinAshi' });
+ chart.setTimeframe('15');
+ expect(connection.packets('modify_series').map((p) => p.p)).toEqual([
+ [chart.id, '$prices', 's2', 'ser_2', '60', ''],
+ [chart.id, '$prices', 's3', 'ser_2', '15', ''],
+ ]);
+ expect(JSON.parse(connection.packets('resolve_symbol')[1].p[2].slice(1))).toEqual({
+ symbol: { symbol: 'BINANCE:ETHEUR', adjustment: 'splits' }, type: 'BarSetHeikenAshi@tv-basicstudies-60!', inputs: {},
+ });
+ await client.close();
+ });
+
+ it('fetches more history and switches timezone', async () => {
+ const { client, connection } = await setup({ history: 20 });
+ const chart = client.createChart();
+ const completions: Array<string | undefined> = [];
+ chart.on('seriesCompleted', (info) => completions.push(info.dataCompleted));
+ chart.setTimezone('Europe/Paris');
+ chart.setMarket('BINANCE:BTCEUR', { count: 5 });
+ await until(() => completions.length === 1);
+ chart.fetchMore(30);
+ await until(() => completions.length === 2);
+ expect(connection.packets('switch_timezone')[0].p).toEqual([chart.id, 'Europe/Paris']);
+ expect(connection.packets('request_more_data')[0].p).toEqual([chart.id, '$prices', 30]);
+ expect(chart.candles).toHaveLength(20);
+ expect(completions).toEqual([undefined, 'end']);
+ await client.close();
+ });
+
+ it('emits typed errors for symbol, series and critical errors', async () => {
+ const { client, connection } = await setup();
+ const chart = client.createChart();
+ const errors: string[] = [];
+ chart.on('error', (error) => errors.push(`${error.code}: ${error.message}`));
+ chart.setMarket('XXXXX');
+ await until(() => errors.length === 1);
+ connection.push(
+ { m: 'series_error', p: [chart.id, '$prices', 's1', 'custom_resolution'] },
+ { m: 'critical_error', p: [chart.id, 'invalid timezone', 'method: switch_timezone'] },
+ );
+ expect(errors).toEqual([
+ 'SYMBOL_ERROR: (ser_1) Symbol error: invalid symbol',
+ 'SERIES_ERROR: Series error: custom_resolution',
+ 'CRITICAL_ERROR: Critical error: invalid timezone',
+ ]);
+ await client.close();
+ });
+
+ it('runs replay mode with step/start/stop and replay events', async () => {
+ const { client, connection } = await setup({ replaySteps: 2 });
+ const chart = client.createChart();
+ await expect(chart.replayStep()).rejects.toMatchObject({ code: 'INVALID_STATE' });
+ const events: unknown[][] = [];
+ chart.onAny((event, ...args) => { if (event.startsWith('replay')) events.push([event, ...args]); });
+ chart.setMarket('BINANCE:BTCEUR', { timeframe: 'D', replay: 1_700_000_000, count: 1 });
+ expect(chart.isReplay).toBe(true);
+
+ expect(connection.packets('replay_create_session')[0].p).toEqual([chart.replayId]);
+ expect(connection.packets('replay_add_series')[0].p).toEqual([
+ chart.replayId, 'req_replay_addseries', '={"symbol":"BINANCE:BTCEUR","adjustment":"splits"}', 'D',
+ ]);
+ expect(connection.packets('replay_reset')[0].p).toEqual([chart.replayId, 'req_replay_reset', 1_700_000_000]);
+ expect(JSON.parse(connection.packets('resolve_symbol')[0].p[2].slice(1))).toEqual({
+ symbol: { symbol: 'BINANCE:BTCEUR', adjustment: 'splits' }, replay: chart.replayId,
+ });
+
+ await chart.replayStep(1);
+ await chart.replayStart(200);
+ await chart.replayStop();
+ await chart.replayStep(1);
+ await flush();
+ expect(events.map(([event]) => event)).toEqual([
+ 'replayLoaded', 'replayPoint', 'replayResolution', 'replayPoint', 'replayPoint', 'replayEnd',
+ ]);
+ expect(events[2]).toEqual(['replayResolution', '1D', '1S']);
+ expect(connection.packets('replay_start')[0].p[2]).toBe(200);
+
+ chart.setMarket('BINANCE:BTCEUR');
+ expect(chart.isReplay).toBe(false);
+ expect(connection.packets('replay_delete_session')).toHaveLength(1);
+ await client.close();
+ });
+
+ it('rejects pending replay requests when deleted, and delete() is idempotent', async () => {
+ const { server, client, connection } = await setup();
+ server.on('replay_step', () => true); // Never answer.
+ const chart = client.createChart();
+ chart.setMarket('BINANCE:BTCEUR', { replay: 1_700_000_000 });
+ const step = chart.replayStep();
+ chart.delete();
+ chart.delete();
+ await expect(step).rejects.toMatchObject({ code: 'INVALID_STATE' });
+ expect(connection.packets('chart_delete_session')).toHaveLength(1);
+ expect(connection.packets('replay_delete_session')).toHaveLength(1);
+ expect(chart.isDeleted).toBe(true);
+ expect(() => chart.setMarket('X')).toThrow(/deleted/);
+ await client.close();
+ });
+
+ it('reports DISCONNECTED to charts and studies when the connection drops', async () => {
+ const { client, connection } = await setup();
+ const chart = client.createChart();
+ chart.setMarket('BINANCE:BTCEUR');
+ const study = chart.createStudy(new BuiltInIndicator('Volume@tv-basicstudies-241'));
+ const errors: string[] = [];
+ chart.on('error', (e) => errors.push(`chart:${e.code}`));
+ study.on('error', (e) => errors.push(`study:${e.code}`));
+ connection.drop();
+ expect(errors.sort()).toEqual(['chart:DISCONNECTED', 'study:DISCONNECTED']);
+ expect(chart.isDeleted).toBe(true);
+ expect(study.isRemoved).toBe(true);
+ });
+
+ it('parses a captured live chart session', async () => {
+ const { client, connection } = await setup();
+ const chart = client.createChart();
+ const study = chart.createStudy(new BuiltInIndicator('Volume@tv-basicstudies-241'));
+ const errors: string[] = [];
+ chart.on('error', (error) => errors.push(error.message));
+ let ready = false;
+ study.on('ready', () => { ready = true; });
+
+ // Replay the capture with this chart's and study's random IDs.
+ for (const message of live.messages) {
+ for (const frame of decodeFrames(message)) {
+ if (frame.type !== 'packet') continue;
+ const json = JSON.stringify(frame.packet)
+ .replaceAll('cs_fixture', chart.id).replaceAll('st_fixture', study.id);
+ connection.push(JSON.parse(json));
+ }
+ }
+
+ expect(chart.symbolInfo).toMatchObject({ full_name: 'BINANCE:BTCEUR', currency_code: 'EUR', series_id: 'ser_1' });
+ expect(chart.candles).toHaveLength(3);
+ for (const candle of chart.candles) {
+ expect(candle.high).toBeGreaterThanOrEqual(Math.max(candle.open, candle.close));
+ expect(candle.low).toBeLessThanOrEqual(Math.min(candle.open, candle.close));
+ }
+ expect(study.values.length).toBeGreaterThan(3);
+ expect(Object.keys(study.values[0])).toEqual(['$time', 'plot_0', 'plot_1', 'plot_2']);
+ expect(ready).toBe(true);
+ expect(errors).toEqual(['(ser_2) Symbol error: invalid symbol']);
+ await client.close();
+ });
+});
+
+describe('intentional close', () => {
+ it('does not report errors for sessions when client.close() is called', async () => {
+ const { client } = await setup();
+ const chart = client.createChart();
+ chart.setMarket('BINANCE:BTCEUR');
+ const study = chart.createStudy(new BuiltInIndicator('Volume@tv-basicstudies-241'));
+ const quotes = client.createQuoteSession();
+ const sub = quotes.subscribe('BINANCE:BTCEUR');
+ const errors: unknown[] = [];
+ for (const emitter of [chart, study, quotes, sub]) emitter.on('error', (e: unknown) => errors.push(e));
+ await client.close();
+ expect(errors).toEqual([]);
+ expect(chart.isDeleted && study.isRemoved && quotes.isDeleted && sub.isClosed).toBe(true);
+ });
+});
diff --git a/tests/unit/client.test.ts b/tests/unit/client.test.ts
new file mode 100644
index 0000000..f5332ad
--- /dev/null
+++ b/tests/unit/client.test.ts
@@ -0,0 +1,170 @@
+import { readFileSync } from 'node:fs';
+import { describe, expect, it, vi } from 'vitest';
+import { TradingViewClient } from '../../src/client/client.js';
+import { encodeFrame, encodePacket } from '../../src/protocol/framing.js';
+import { FakeServer, flush, until } from '../helpers/fake-server.js';
+
+const live = JSON.parse(readFileSync(new URL('../fixtures/live-session.json', import.meta.url), 'utf8'));
+
+function setup(options: ConstructorParameters<typeof TradingViewClient>[0] = {}) {
+ const server = new FakeServer();
+ const client = new TradingViewClient({ transport: server.transport, ...options });
+ return { server, client };
+}
+
+describe('TradingViewClient', () => {
+ it('connects with browser-like headers and an anonymous token, then flushes queued packets', async () => {
+ const { server, client } = setup({ server: 'prodata', headers: { 'X-Test': '1' } });
+ client.send('custom_method', ['a']);
+ expect(server.last.raw).toEqual([]);
+ await client.ready;
+ expect(server.last.request.url).toBe('wss://prodata.tradingview.com/socket.io/websocket?from=chart&type=chart');
+ expect(server.last.request.origin).toBe('https://www.tradingview.com');
+ expect(server.last.request.headers).toMatchObject({ 'X-Test': '1', 'User-Agent': expect.stringContaining('Mozilla') });
+ expect(server.last.raw).toEqual([
+ encodePacket('set_auth_token', ['unauthorized_user_token']),
+ encodePacket('custom_method', ['a']),
+ ]);
+ expect(client.isOpen).toBe(true);
+ expect(client.isAuthenticated).toBe(true);
+ await client.close();
+ });
+
+ it('uses an explicit auth token', async () => {
+ const { server, client } = setup({ authToken: 'secret-token' });
+ await client.ready;
+ expect(server.last.sent[0]).toEqual({ m: 'set_auth_token', p: ['secret-token'] });
+ await client.close();
+ });
+
+ it('loads the auth token from credentials with the account lookup', async () => {
+ const fetch = vi.fn(async () => new Response('<script>{"id":1,"username":"me","auth_token":"from-account"}</script>'));
+ const { server, client } = setup({ credentials: { session: 's', signature: 'sig' }, fetch: fetch as any, location: 'https://fr.tradingview.com/' });
+ await client.ready;
+ expect(fetch).toHaveBeenCalledWith('https://fr.tradingview.com/', expect.objectContaining({
+ headers: expect.objectContaining({ cookie: 'sessionid=s;sessionid_sign=sig' }),
+ redirect: 'manual',
+ }));
+ expect(server.last.sent[0]).toEqual({ m: 'set_auth_token', p: ['from-account'] });
+ await client.close();
+ });
+
+ it('fails, emits AUTH_ERROR and closes when credentials are rejected', async () => {
+ const fetch = vi.fn(async () => new Response('no token here', { status: 200 }));
+ const { server, client } = setup({ credentials: { session: 'bad' }, fetch: fetch as any });
+ const errors: string[] = [];
+ client.on('error', (error) => errors.push(error.code));
+ await expect(client.ready).rejects.toMatchObject({ code: 'AUTH_ERROR' });
+ await until(() => client.isClosed);
+ expect(errors).toEqual(['AUTH_ERROR']);
+ expect(server.last.closed).toBe(true);
+ });
+
+ it('rejects ready without logging when nobody listens, and passes the cause to sessions', async () => {
+ const spy = vi.spyOn(console, 'error').mockImplementation(() => {});
+ const fetch = vi.fn(async () => new Response('no token'));
+ const { client } = setup({ credentials: { session: 'bad' }, fetch: fetch as any });
+ const onClose = vi.fn();
+ client.registerSession('cs_z', { onPacket: () => {}, onClose });
+ await expect(client.ready).rejects.toMatchObject({ code: 'AUTH_ERROR' });
+ await until(() => client.isClosed);
+ expect(spy).not.toHaveBeenCalled();
+ expect(onClose.mock.calls[0][0]).toMatchObject({
+ code: 'DISCONNECTED', message: expect.stringContaining('Credentials error'), cause: expect.objectContaining({ code: 'AUTH_ERROR' }),
+ });
+ spy.mockRestore();
+ });
+
+ it('answers heartbeats and emits hello, heartbeat and unrouted packets', async () => {
+ const { server, client } = setup();
+ const events: string[] = [];
+ client.onAny((event) => { events.push(event); });
+ await client.ready;
+ server.last.push({ session_id: 'srv', protocol: 'json' }, '~h~12', { m: 'unknown_packet', p: ['nobody'] });
+ expect(server.last.heartbeats).toEqual([12]);
+ expect(client.serverInfo?.session_id).toBe('srv');
+ expect(events).toEqual(['open', 'ready', 'hello', 'heartbeat', 'packet']);
+ await client.close();
+ });
+
+ it('routes packets to registered sessions', async () => {
+ const { server, client } = setup();
+ const received: unknown[] = [];
+ client.registerSession('cs_x', { onPacket: (packet) => received.push(packet) });
+ await client.ready;
+ server.last.push({ m: 'series_loading', p: ['cs_x', '$prices', 's1'] });
+ expect(received).toEqual([{ m: 'series_loading', p: ['cs_x', '$prices', 's1'] }]);
+ await client.close();
+ });
+
+ it('turns protocol_error into an error event and closes', async () => {
+ const { server, client } = setup();
+ await client.ready;
+ const error = new Promise((resolve) => { client.on('error', resolve); });
+ server.last.push({ m: 'protocol_error', p: ['wrong data'] });
+ await expect(error).resolves.toMatchObject({ code: 'PROTOCOL_ERROR', message: 'Protocol error: wrong data' });
+ await until(() => client.isClosed);
+ });
+
+ it('notifies sessions and rejects readiness when the connection drops', async () => {
+ const server = new FakeServer();
+ server.autoOpen = false;
+ const client = new TradingViewClient({ transport: server.transport });
+ const onClose = vi.fn();
+ client.registerSession('cs_y', { onPacket: () => {}, onClose });
+ const closed = new Promise((resolve) => { client.on('close', (code) => resolve(code)); });
+ server.last.drop(1006, 'gone');
+ await expect(client.ready).rejects.toMatchObject({ code: 'DISCONNECTED' });
+ await expect(closed).resolves.toBe(1006);
+ expect(onClose).toHaveBeenCalledWith(expect.objectContaining({ code: 'DISCONNECTED' }), false);
+ expect(() => client.send('late')).toThrow(/closed/);
+ });
+
+ it('times out if the connection never opens', async () => {
+ const server = new FakeServer();
+ server.autoOpen = false;
+ const client = new TradingViewClient({ transport: server.transport, connectTimeoutMs: 10 });
+ client.on('error', () => {});
+ await expect(client.ready).rejects.toMatchObject({ code: 'TIMEOUT' });
+ });
+
+ it('close() is idempotent and waits for the socket to close', async () => {
+ const { client } = setup();
+ await client.ready;
+ await Promise.all([client.close(), client.close()]);
+ expect(client.isClosed).toBe(true);
+ await client.close();
+ });
+
+ it('logs traffic through a debug function', async () => {
+ const lines: unknown[][] = [];
+ const { client } = setup({ debug: (...args) => lines.push(args) });
+ await client.ready;
+ client.send('ping_me');
+ await flush();
+ expect(lines.some(([kind]) => kind === 'send')).toBe(true);
+ await client.close();
+ });
+
+ it('routes a captured live session to chart and quote sessions', async () => {
+ const { server, client } = setup();
+ const chartPackets: string[] = [];
+ const quotePackets: string[] = [];
+ client.registerSession('cs_fixture', { onPacket: (p) => chartPackets.push(p.m) });
+ client.registerSession('qs_fixture', { onPacket: (p) => quotePackets.push(p.m) });
+ await client.ready;
+ for (const message of live.messages) server.last.handlers.onMessage(message);
+ expect(chartPackets).toEqual(expect.arrayContaining(['symbol_resolved', 'timescale_update', 'series_completed', 'du', 'symbol_error']));
+ expect(quotePackets).toEqual(expect.arrayContaining(['qsd', 'quote_completed']));
+ expect(client.serverInfo?.protocol).toBe('json');
+ await client.close();
+ });
+
+ it('accepts a raw frame string through send()', async () => {
+ const { server, client } = setup();
+ await client.ready;
+ client.send('quote_fast_symbols', ['qs_1', 'A']);
+ expect(server.last.raw.at(-1)).toBe(encodeFrame({ m: 'quote_fast_symbols', p: ['qs_1', 'A'] }));
+ await client.close();
+ });
+});
diff --git a/tests/unit/data.test.ts b/tests/unit/data.test.ts
new file mode 100644
index 0000000..42ee1bc
--- /dev/null
+++ b/tests/unit/data.test.ts
@@ -0,0 +1,403 @@
+import { describe, expect, it, vi } from 'vitest';
+import { TradingViewClient } from '../../src/client/client.js';
+import {
+ getCandles, getIndicatorData, getQuote, getQuotes, getSymbolInfo, TradingViewProvider,
+ watchCandles, watchIndicator, watchQuotes, type MarketDataProvider,
+} from '../../src/data/index.js';
+import { BuiltInIndicator } from '../../src/indicators/builtin-indicator.js';
+import { FakeServer, flush, until } from '../helpers/fake-server.js';
+import { makePine } from '../helpers/indicators.js';
+
+function fake(options: ConstructorParameters<typeof FakeServer>[0] = {}) {
+ const server = new FakeServer(options);
+ return { server, clientOptions: { transport: server.transport } };
+}
+
+describe('getCandles', () => {
+ it('returns the most recent candles oldest first and closes everything', async () => {
+ const { server, clientOptions } = fake({ history: 500 });
+ const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', timeframe: '60', count: 3, clientOptions });
+ expect(candles.map((c) => c.close)).toEqual([597, 598, 599]);
+ expect(candles[0]).toEqual({
+ time: server.barTime(497), open: 596, high: 599, low: 594, close: 597, volume: 507,
+ });
+ const connection = server.last;
+ expect(connection.packets('create_series')[0].p.slice(4)).toEqual(['60', 3]);
+ expect(connection.packets('chart_delete_session')).toHaveLength(1);
+ expect(connection.closed).toBe(true);
+ });
+
+ it('accepts a symbol string with defaults (daily, 100 bars)', async () => {
+ const { server, clientOptions } = fake();
+ // String shorthand cannot carry clientOptions: inject through a shared client instead.
+ const client = new TradingViewClient(clientOptions);
+ const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', client });
+ expect(candles).toHaveLength(100);
+ expect(server.last.packets('create_series')[0].p.slice(4)).toEqual(['D', 100]);
+ expect(client.isClosed).toBe(false);
+ expect(server.last.packets('chart_delete_session')).toHaveLength(1);
+ await client.close();
+ });
+
+ it('accepts an alternate candle provider and stops its one-shot worker', async () => {
+ const snapshot = [{ time: 1, open: 2, high: 3, low: 1, close: 2.5, volume: 4 }];
+ const stop = vi.fn(async () => {});
+ const provider: MarketDataProvider = {
+ watchCandles: vi.fn(async (_query, handlers) => {
+ handlers.onData(snapshot);
+ return { latest: snapshot, stop };
+ }),
+ };
+ expect(await getCandles({ symbol: 'CUSTOM:ASSET' }, provider)).toEqual(snapshot);
+ expect(stop).toHaveBeenCalledTimes(1);
+ const seen: number[] = [];
+ const worker = await watchCandles({ symbol: 'CUSTOM:ASSET' }, {
+ onData: (candles) => seen.push(candles[0].close),
+ }, provider);
+ expect(worker.latest).toEqual(snapshot);
+ expect(seen).toEqual([2.5]);
+ await worker.stop();
+ expect(stop).toHaveBeenCalledTimes(2);
+
+ const { server, clientOptions } = fake();
+ const tradingView = new TradingViewProvider({ clientOptions });
+ const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', count: 2 }, tradingView);
+ expect(candles).toHaveLength(2);
+ expect(server.last.closed).toBe(true);
+ });
+
+ it('loads deep history in batches until count is reached', async () => {
+ const { server, clientOptions } = fake({ history: 12_000, batchLimit: 5_000 });
+ const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', count: 11_000, clientOptions });
+ expect(candles).toHaveLength(11_000);
+ expect(candles[0].time).toBe(server.barTime(1_000));
+ expect(server.last.packets('create_series')[0].p[5]).toBe(5_000);
+ expect(server.last.packets('request_more_data').map((p) => p.p[2])).toEqual([5_000, 1_000]);
+ });
+
+ it('stops when the server has no more history', async () => {
+ const { server, clientOptions } = fake({ history: 120, batchLimit: 50, endReason: 'limit' });
+ const candles = await getCandles({ symbol: 'BINANCE:BTCUSDT', count: 1_000, clientOptions });
+ expect(candles).toHaveLength(120);
+ expect(server.last.packets('request_more_data')).toHaveLength(2);
+ });
+
+ it('loads a from/to range, accepting Dates and Unix seconds', async () => {
+ const { server, clientOptions } = fake({ history: 1_000, batchLimit: 100, step: 3_600 });
+ const from = new Date(server.barTime(700) * 1000);
+ const to = server.barTime(750);
+ const candles = await getCandles({
+ symbol: 'BINANCE:BTCUSDT', timeframe: '60', from, to, clientOptions,
+ });
+ expect(candles[0].time).toBe(server.barTime(700));
+ expect(candles.at(-1)?.time).toBe(to);
+ expect(candles).toHaveLength(51);
+ // Initial request sized from the range, then deep history until `from` is reached.
+ const [create] = server.last.packets('create_series');
+ expect(create.p[5][0]).toBe('bar_count');
+ expect(create.p[5][1]).toBe(to);
+ expect(server.last.packets('request_more_data').length).toBeGreaterThan(0);
+ });
+
+ it('passes chart options (type, currency, session, adjustment, timezone)', async () => {
+ const { server, clientOptions } = fake();
+ await getCandles({
+ symbol: 'NASDAQ:AAPL',
+ chartType: 'HeikinAshi',
+ chartInputs: { foo: 1 },
+ currency: 'EUR',
+ session: 'extended',
+ adjustment: 'dividends',
+ backAdjustment: true,
+ timezone: 'Europe/Paris',
+ count: 2,
+ clientOptions,
+ });
+ const connection = server.last;
+ expect(connection.packets('switch_timezone')[0].p[1]).toBe('Europe/Paris');
+ expect(JSON.parse(connection.packets('resolve_symbol')[0].p[2].slice(1))).toEqual({
+ symbol: {
+ symbol: 'NASDAQ:AAPL', adjustment: 'dividends', backadjustment: 'default', session: 'extended', 'currency-id': 'EUR',
+ },
+ type: 'BarSetHeikenAshi@tv-basicstudies-60!',
+ inputs: { foo: 1 },
+ });
+ });
+
+ it('rejects invalid queries before connecting', async () => {
+ const { server, clientOptions } = fake();
+ await expect(getCandles({ symbol: '', clientOptions })).rejects.toMatchObject({ code: 'INVALID_ARGUMENT' });
+ await expect(getCandles({ symbol: 'A', count: 0, clientOptions })).rejects.toThrow('count');
+ await expect(getCandles({ symbol: 'A', from: 10, to: 5, clientOptions })).rejects.toThrow('from');
+ await expect(getCandles({ symbol: 'A', timeoutMs: -1, clientOptions })).rejects.toThrow('timeoutMs');
+ expect(server.connections).toHaveLength(0);
+ });
+
+ it('rejects symbol errors and empty results with clear codes', async () => {
+ const { clientOptions } = fake();
+ await expect(getCandles({ symbol: 'XXXXX', clientOptions })).rejects.toMatchObject({ code: 'SYMBOL_ERROR' });
+ const empty = fake({ history: 0, endReason: 'limit' });
+ await expect(getCandles({ symbol: 'A', clientOptions: empty.clientOptions }))
+ .rejects.toMatchObject({ code: 'NO_DATA', message: expect.stringContaining('access limit') });
+ });
+
+ it('times out and releases the connection', async () => {
+ const { server, clientOptions } = fake();
+ server.respond = false;
+ await expect(getCandles({ symbol: 'A', timeoutMs: 20, clientOptions })).rejects.toMatchObject({ code: 'TIMEOUT' });
+ expect(server.last.closed).toBe(true);
+ });
+
+ it('aborts in flight and before starting', async () => {
+ const { server, clientOptions } = fake();
+ server.respond = false;
+ const controller = new AbortController();
+ const pending = getCandles({ symbol: 'A', signal: controller.signal, clientOptions });
+ controller.abort(new Error('user cancelled'));
+ await expect(pending).rejects.toMatchObject({ code: 'ABORTED', message: 'user cancelled' });
+ expect(server.last.closed).toBe(true);
+ await expect(getCandles({ symbol: 'A', signal: controller.signal, clientOptions })).rejects.toMatchObject({ code: 'ABORTED' });
+ expect(server.connections).toHaveLength(1);
+ });
+
+ it('rejects with DISCONNECTED when the connection drops', async () => {
+ const { server, clientOptions } = fake();
+ server.respond = false;
+ const pending = getCandles({ symbol: 'A', clientOptions });
+ await until(() => server.connections[0]?.isOpen);
+ server.last.drop();
+ await expect(pending).rejects.toMatchObject({ code: 'DISCONNECTED' });
+ });
+
+ it('rejects when a provided client is already closed', async () => {
+ const { clientOptions } = fake();
+ const client = new TradingViewClient(clientOptions);
+ await client.close();
+ await expect(getCandles({ symbol: 'A', client })).rejects.toMatchObject({ code: 'INVALID_STATE' });
+ });
+});
+
+describe('watchCandles', () => {
+ it('starts after the history, streams updates and stops idempotently', async () => {
+ const { server, clientOptions } = fake({ history: 10 });
+ const snapshots: number[][] = [];
+ const watcher = await watchCandles({ symbol: 'BINANCE:BTCUSDT', count: 3, clientOptions }, {
+ onData: (candles) => snapshots.push(candles.map((c) => c.close)),
+ });
+ expect(watcher.isActive).toBe(true);
+ expect(watcher.latest.map((c) => c.close)).toEqual([107, 108, 109]);
+ expect(Object.isFrozen(watcher.latest) && Object.isFrozen(watcher.latest[0])).toBe(true);
+ expect(watcher.symbolInfo?.full_name).toBe('BINANCE:BTCUSDT');
+
+ const chartId = server.last.packets('chart_create_session')[0].p[0];
+ server.last.push({ m: 'du', p: [chartId, { $prices: { s: [{ i: 10, v: [server.barTime(9) + 86_400, 1, 2, 0, 1.5, 1] }] } }] });
+ expect(snapshots).toEqual([[107, 108, 109], [108, 109, 1.5]]);
+
+ await Promise.all([watcher.stop(), watcher.stop()]);
+ await watcher.closed;
+ expect(watcher.isActive).toBe(false);
+ server.last.push({ m: 'du', p: [chartId, { $prices: { s: [] } }] });
+ expect(snapshots).toHaveLength(2);
+ expect(server.last.closed).toBe(true);
+ });
+
+ it('reports fatal errors after start-up to onError and stops', async () => {
+ const { server, clientOptions } = fake();
+ const errors: string[] = [];
+ const watcher = await watchCandles({ symbol: 'A', clientOptions }, { onData: () => {}, onError: (e) => errors.push(e.code) });
+ server.last.drop();
+ await watcher.closed;
+ expect(errors).toEqual(['DISCONNECTED']);
+ expect(watcher.isActive).toBe(false);
+ });
+
+ it('reports user callback failures without stopping the stream', async () => {
+ const { server, clientOptions } = fake();
+ const errors: string[] = [];
+ const watcher = await watchCandles({ symbol: 'A', clientOptions }, {
+ onData: () => { throw new Error('consumer bug'); },
+ onError: (error) => errors.push(error.code),
+ });
+ expect(errors).toEqual(['CALLBACK_ERROR']);
+ expect(watcher.isActive).toBe(true);
+ await watcher.stop();
+ expect(server.last.closed).toBe(true);
+ });
+
+ it('stops on abort after start-up', async () => {
+ const { server, clientOptions } = fake();
+ const controller = new AbortController();
+ const errors: string[] = [];
+ const watcher = await watchCandles({ symbol: 'A', signal: controller.signal, clientOptions }, {
+ onData: () => {}, onError: (e) => errors.push(e.code),
+ });
+ controller.abort();
+ await watcher.closed;
+ expect(errors).toEqual(['ABORTED']);
+ expect(server.last.closed).toBe(true);
+ });
+
+ it('rejects start-up failures and validates handlers', async () => {
+ const { server, clientOptions } = fake();
+ await expect(watchCandles({ symbol: 'XXXXX', clientOptions }, { onData: () => {} })).rejects.toMatchObject({ code: 'SYMBOL_ERROR' });
+ expect(server.last.closed).toBe(true);
+ await expect(watchCandles({ symbol: 'A', clientOptions }, {} as any)).rejects.toThrow('onData');
+ server.respond = false;
+ await expect(watchCandles({ symbol: 'A', timeoutMs: 10, clientOptions }, { onData: () => {} })).rejects.toMatchObject({ code: 'TIMEOUT' });
+ });
+
+ it('shares a client without closing it', async () => {
+ const { server, clientOptions } = fake();
+ const client = new TradingViewClient(clientOptions);
+ const a = await watchCandles({ symbol: 'A', client }, { onData: () => {} });
+ const b = await watchCandles({ symbol: 'B', client }, { onData: () => {} });
+ await a.stop();
+ await b.stop();
+ expect(server.connections).toHaveLength(1);
+ expect(server.last.packets('chart_delete_session')).toHaveLength(2);
+ expect(client.isClosed).toBe(false);
+ await client.close();
+ });
+});
+
+describe('quotes', () => {
+ it('getQuote and getQuotes return merged data', async () => {
+ const { server, clientOptions } = fake();
+ expect(await getQuote({ symbol: 'BINANCE:BTCUSDT', fields: 'price', clientOptions })).toMatchObject({ lp: 100 });
+ expect(server.last.packets('quote_set_fields')[0].p.slice(1)).toEqual(['lp']);
+ expect(server.last.closed).toBe(true);
+ const quotes = await getQuotes({ symbols: ['A', 'B', 'A'], clientOptions });
+ expect(Object.keys(quotes)).toEqual(['A', 'B']);
+ expect(server.last.packets('quote_delete_session')).toHaveLength(1);
+ });
+
+ it('rejects quote errors', async () => {
+ const { clientOptions } = fake();
+ await expect(getQuote({ symbol: 'XXXXX', clientOptions })).rejects.toMatchObject({ code: 'QUOTE_ERROR' });
+ await expect(getQuotes({ symbols: [], clientOptions })).rejects.toMatchObject({ code: 'INVALID_ARGUMENT' });
+ });
+
+ it('watchQuotes streams symbols and reports per-symbol failures', async () => {
+ const { server, clientOptions } = fake();
+ const seen: string[] = [];
+ const errors: string[] = [];
+ const watcher = await watchQuotes({ symbols: ['A', 'XXXXX'], clientOptions }, {
+ onData: (symbol, quote) => seen.push(`${symbol}:${quote.lp}`),
+ onError: (e) => errors.push(e.code),
+ });
+ expect(seen).toEqual(['A:100']);
+ expect(errors).toEqual(['QUOTE_ERROR']);
+ expect(Object.keys(watcher.latest)).toEqual(['A']);
+ const sessionId = server.last.packets('quote_create_session')[0].p[0];
+ const key = server.last.packets('quote_add_symbols')[0].p[1];
+ server.last.push({ m: 'qsd', p: [sessionId, { n: key, s: 'ok', v: { lp: 101 } }] });
+ expect(seen).toEqual(['A:100', 'A:101']);
+ await watcher.stop();
+ expect(server.last.closed).toBe(true);
+ });
+
+ it('watchQuotes rejects when every symbol fails', async () => {
+ const { clientOptions } = fake();
+ await expect(watchQuotes({ symbols: ['XXXXX'], clientOptions }, { onData: () => {} })).rejects.toMatchObject({ code: 'QUOTE_ERROR' });
+ });
+});
+
+describe('getSymbolInfo', () => {
+ it('resolves symbol metadata', async () => {
+ const { server, clientOptions } = fake();
+ const info = await getSymbolInfo({ symbol: 'NASDAQ:AAPL', clientOptions });
+ expect(info).toMatchObject({ full_name: 'NASDAQ:AAPL', currency_code: 'EUR', series_id: 'ser_1' });
+ expect(server.last.closed).toBe(true);
+ await expect(getSymbolInfo({ symbol: 'XXXXX', clientOptions })).rejects.toMatchObject({ code: 'SYMBOL_ERROR' });
+ });
+});
+
+describe('indicator data', () => {
+ it('runs a built-in study from its type string', async () => {
+ const { server, clientOptions } = fake({ history: 20, studyPlots: 2 });
+ const data = await getIndicatorData({
+ symbol: 'A', indicator: 'Volume@tv-basicstudies-241', inputs: { length: 5 }, count: 4, clientOptions,
+ });
+ expect(server.last.packets('create_study')[0].p[4]).toBe('Volume@tv-basicstudies-241');
+ expect(server.last.packets('create_study')[0].p[5]).toEqual({ length: 5, col_prev_close: false });
+ expect(data.candles).toHaveLength(4);
+ expect(data.values.at(-1)).toEqual({ $time: server.barTime(19), plot_0: 19, plot_1: 19.1 });
+ expect(data.indicator).toBeInstanceOf(BuiltInIndicator);
+ expect(server.last.closed).toBe(true);
+ });
+
+ it('loads a Pine indicator by ID with credentials, applies inputs and returns reports', async () => {
+ const { server, clientOptions } = fake({
+ history: 10,
+ studyNs: () => ({ data: { report: { performance: { all: { totalTrades: 3 } } } } }),
+ });
+ const pine = makePine();
+ const fetch = vi.fn(async () => new Response(JSON.stringify({
+ success: true,
+ result: {
+ ilTemplate: pine.script,
+ metaInfo: {
+ scriptIdPart: 'PUB;test',
+ description: 'Test',
+ shortDescription: 'T',
+ pine: { version: '3.0' },
+ inputs: [{ id: 'in_0', name: 'Length', defval: 14, type: 'integer' }],
+ styles: { plot_0: { title: 'Value' } },
+ plots: [],
+ },
+ },
+ })));
+ const data = await getIndicatorData({
+ symbol: 'A',
+ indicator: 'PUB;test',
+ inputs: { Length: 30 },
+ credentials: { session: 's' },
+ clientOptions: { ...clientOptions, authToken: 'tok', fetch: fetch as any },
+ });
+ expect(fetch).toHaveBeenCalledWith(
+ 'https://pine-facade.tradingview.com/pine-facade/translate/PUB;test/last',
+ expect.objectContaining({ headers: expect.objectContaining({ cookie: 'sessionid=s' }) }),
+ );
+ expect(server.last.packets('create_study')[0].p[5].in_0).toEqual({ v: 30, f: false, t: 'integer' });
+ expect(data.values.at(-1)).toMatchObject({ Value: 9 });
+ expect(data.strategyReport.performance.all?.totalTrades).toBe(3);
+ });
+
+ it('does not mutate a provided indicator instance and loads more bars for the study', async () => {
+ const { server, clientOptions } = fake({ history: 300, batchLimit: 100 });
+ const pine = makePine();
+ const data = await getIndicatorData({
+ symbol: 'A', indicator: pine, inputs: { length: 50 }, count: 250, clientOptions,
+ });
+ expect(pine.inputs.in_0.value).toBe(14);
+ expect(data.candles).toHaveLength(250);
+ expect(data.values).toHaveLength(250);
+ expect(server.last.packets('request_more_data').length).toBe(2);
+ });
+
+ it('rejects study errors and unknown indicators', async () => {
+ const { clientOptions } = fake({ studyError: 'study not auth' });
+ await expect(getIndicatorData({ symbol: 'A', indicator: makePine(), clientOptions }))
+ .rejects.toMatchObject({ code: 'STUDY_ERROR', message: 'Study error: study not auth' });
+ await expect(getIndicatorData({ symbol: 'A', indicator: '', clientOptions })).rejects.toMatchObject({ code: 'INVALID_ARGUMENT' });
+ const fetch = vi.fn(async () => new Response(JSON.stringify({ success: false, reason: 'nope' })));
+ await expect(getIndicatorData({ symbol: 'A', indicator: 'STD;Nope', clientOptions: { ...clientOptions, fetch: fetch as any } }))
+ .rejects.toMatchObject({ code: 'NOT_FOUND' });
+ });
+
+ it('watchIndicator streams study updates', async () => {
+ const { server, clientOptions } = fake({ history: 10 });
+ const values: number[] = [];
+ const watcher = await watchIndicator({ symbol: 'A', indicator: makePine(), count: 5, clientOptions }, {
+ onData: (data) => values.push(data.values.at(-1)?.Value as number),
+ });
+ const chartId = server.last.packets('chart_create_session')[0].p[0];
+ const studyId = server.last.packets('create_study')[0].p[1];
+ server.last.push({ m: 'du', p: [chartId, { [studyId]: { st: [{ i: 9, v: [server.barTime(9), 42] }], ns: { d: '' } } }] });
+ await flush();
+ expect(values).toEqual([9, 42]);
+ expect(watcher.latest?.values.at(-1)?.Value).toBe(42);
+ await watcher.stop();
+ expect(server.last.closed).toBe(true);
+ });
+});
diff --git a/tests/unit/events.test.ts b/tests/unit/events.test.ts
new file mode 100644
index 0000000..918f0d6
--- /dev/null
+++ b/tests/unit/events.test.ts
@@ -0,0 +1,48 @@
+import {
+ afterEach, describe, expect, it, vi,
+} from 'vitest';
+import { Emitter } from '../../src/events.js';
+
+type Events = { [k: string]: unknown[]; tick: [n: number]; error: [error: Error] };
+
+class TestEmitter extends Emitter<Events> {
+ fire<K extends keyof Events & string>(event: K, ...args: Events[K]) {
+ this.emit(event, ...args);
+ }
+}
+
+afterEach(() => { vi.restoreAllMocks(); });
+
+describe('Emitter', () => {
+ it('supports on, once, off, onAny and unsubscribe functions', () => {
+ const emitter = new TestEmitter();
+ const seen: string[] = [];
+ const off = emitter.on('tick', (n) => seen.push(`on${n}`));
+ emitter.once('tick', (n) => seen.push(`once${n}`));
+ const offAny = emitter.onAny((event, ...args) => { seen.push(`any:${event}:${args[0]}`); });
+ emitter.fire('tick', 1);
+ emitter.fire('tick', 2);
+ off();
+ offAny();
+ emitter.fire('tick', 3);
+ expect(seen).toEqual(['on1', 'once1', 'any:tick:1', 'on2', 'any:tick:2']);
+ expect(emitter.listenerCount('tick')).toBe(0);
+ });
+
+ it('logs unhandled errors instead of dropping them', () => {
+ const spy = vi.spyOn(console, 'error').mockImplementation(() => {});
+ new TestEmitter().fire('error', new Error('boom'));
+ expect(spy).toHaveBeenCalledWith('[tradingview]', new Error('boom'));
+ });
+
+ it('isolates throwing listeners from the emitter', () => {
+ const emitter = new TestEmitter();
+ const after = vi.fn();
+ const logged = vi.spyOn(console, 'error').mockImplementation(() => {});
+ emitter.on('tick', () => { throw new Error('listener bug'); });
+ emitter.on('tick', after);
+ emitter.fire('tick', 1);
+ expect(after).toHaveBeenCalledWith(1);
+ expect(logged).toHaveBeenCalledWith('[tradingview] Listener threw:', expect.objectContaining({ message: 'listener bug' }));
+ });
+});
diff --git a/tests/unit/exports.test.ts b/tests/unit/exports.test.ts
new file mode 100644
index 0000000..eaebc7b
--- /dev/null
+++ b/tests/unit/exports.test.ts
@@ -0,0 +1,29 @@
+import { describe, expect, it } from 'vitest';
+import * as root from '../../src/index.js';
+import * as data from '../../src/data/index.js';
+
+describe('public API', () => {
+ it('root entry exposes the high-level, low-level and HTTP APIs', () => {
+ expect(Object.keys(root).sort()).toEqual([
+ 'ALL_QUOTE_FIELDS', 'BuiltInIndicator', 'CHART_TYPE_STUDIES', 'ChartSession', 'DEFAULT_TIMEOUT_MS', 'Emitter',
+ 'PineIndicator', 'PinePermissionManager', 'QuoteSession', 'QuoteSubscription', 'Study', 'TradingViewClient',
+ 'TradingViewError', 'TradingViewProvider', 'applyGraphicsCommands', 'clearIndicatorCache', 'getCandles', 'getChartToken', 'getDrawings',
+ 'getIndicator', 'getIndicatorData', 'getPrivateIndicators', 'getQuote', 'getQuotes', 'getSymbolInfo',
+ 'getTechnicalAnalysis', 'getUser', 'loginUser', 'mergeStrategyReport', 'parseGraphics', 'parseIndicatorDefinition',
+ 'parseTrades', 'protocol', 'quoteSymbolKey', 'resolveQuoteFields', 'searchIndicators', 'searchMarkets',
+ 'timeframeSeconds', 'toTradingViewError', 'watchCandles', 'watchIndicator', 'watchQuotes', 'wsTransport',
+ ]);
+ expect(Object.keys(root.protocol).sort()).toEqual([
+ 'createSessionId', 'decodeCompressed', 'decodeFrames', 'encodeFrame', 'encodeHeartbeat', 'encodePacket',
+ 'normaliseBase64', 'readFirstZipEntry',
+ ]);
+ });
+
+ it('data entry only exposes the simplified data API', () => {
+ expect(Object.keys(data).sort()).toEqual([
+ 'DEFAULT_TIMEOUT_MS', 'TradingViewError', 'TradingViewProvider', 'getCandles', 'getIndicatorData', 'getQuote', 'getQuotes', 'getSymbolInfo',
+ 'getTechnicalAnalysis', 'searchIndicators', 'searchMarkets', 'watchCandles', 'watchIndicator', 'watchQuotes',
+ ]);
+ expect(data.getCandles).toBe(root.getCandles);
+ });
+});
diff --git a/tests/unit/http.test.ts b/tests/unit/http.test.ts
new file mode 100644
index 0000000..37ae6cc
--- /dev/null
+++ b/tests/unit/http.test.ts
@@ -0,0 +1,292 @@
+import { describe, expect, it, vi } from 'vitest';
+import {
+ getChartToken, getDrawings, getIndicator, getPrivateIndicators, getTechnicalAnalysis, getUser, loginUser,
+ PinePermissionManager, searchIndicators, searchMarkets,
+} from '../../src/http/index.js';
+
+type Route = (url: URL, init: RequestInit) => Response | Promise<Response>;
+
+/** Mock fetch that records calls and answers through `route`. */
+function mockFetch(route: Route) {
+ const calls: Array<{ url: URL; init: RequestInit }> = [];
+ const fetch = vi.fn(async (input: string, init: RequestInit = {}) => {
+ const url = new URL(input);
+ calls.push({ url, init });
+ return route(url, init);
+ });
+ return { fetch: fetch as unknown as typeof globalThis.fetch, calls };
+}
+
+const json = (body: unknown, init: ResponseInit = {}) => {
+ const headers = new Headers(init.headers);
+ headers.set('content-type', 'application/json');
+ return new Response(JSON.stringify(body), { ...init, headers });
+};
+
+describe('searchMarkets', () => {
+ it('queries symbol search v3 with exchange prefixes, filters and pagination', async () => {
+ const { fetch, calls } = mockFetch(() => json({
+ symbols: [
+ { symbol: '<em>BTC</em>USD', exchange: 'Binance', description: 'Bitcoin / <em>US</em> Dollar', type: 'spot', currency_code: 'USD' },
+ { symbol: 'AAPL', exchange: 'NASDAQ Stock Market', prefix: 'NASDAQ', description: 'Apple', type: 'stock', country: 'US' },
+ ],
+ }));
+ const results = await searchMarkets('binance:btc usd', { type: 'crypto', offset: 50, fetch });
+ expect(calls[0].url.origin + calls[0].url.pathname).toBe('https://symbol-search.tradingview.com/symbol_search/v3/');
+ expect(Object.fromEntries(calls[0].url.searchParams)).toEqual({
+ text: 'BTC USD', exchange: 'BINANCE', search_type: 'crypto', start: '50',
+ });
+ expect((calls[0].init.headers as any).origin).toBe('https://www.tradingview.com');
+ expect(results).toEqual([
+ {
+ id: 'BINANCE:BTCUSD', exchange: 'Binance', fullExchange: 'Binance', symbol: 'BTCUSD', description: 'Bitcoin / US Dollar', type: 'spot', currency: 'USD', country: undefined,
+ },
+ {
+ id: 'NASDAQ:AAPL', exchange: 'NASDAQ', fullExchange: 'NASDAQ Stock Market', symbol: 'AAPL', description: 'Apple', type: 'stock', currency: undefined, country: 'US',
+ },
+ ]);
+ });
+
+ it('throws HTTP_ERROR for unexpected payloads and 5xx statuses', async () => {
+ await expect(searchMarkets('x', { fetch: mockFetch(() => json({ nope: true })).fetch })).rejects.toMatchObject({ code: 'HTTP_ERROR' });
+ await expect(searchMarkets('x', { fetch: mockFetch(() => new Response('down', { status: 503 })).fetch }))
+ .rejects.toMatchObject({ code: 'HTTP_ERROR', message: expect.stringContaining('503') });
+ });
+
+ it('wraps network failures', async () => {
+ const fetch = vi.fn(async () => { throw new TypeError('fetch failed'); }) as any;
+ await expect(searchMarkets('x', { fetch })).rejects.toMatchObject({ code: 'HTTP_ERROR', message: 'fetch failed' });
+ });
+});
+
+describe('getTechnicalAnalysis', () => {
+ it('requests every period and scales ratings', async () => {
+ const { fetch, calls } = mockFetch(async (_url, init) => {
+ const body = JSON.parse(init.body as string);
+ return json({ data: [{ s: 'BINANCE:BTCUSD', d: body.columns.map((_: string, i: number) => (i % 3) / 4 - 0.25) }] });
+ });
+ const ta = await getTechnicalAnalysis('BINANCE:BTCUSD', { fetch });
+ const body = JSON.parse(calls[0].init.body as string);
+ expect(body.symbols).toEqual({ tickers: ['BINANCE:BTCUSD'] });
+ expect(body.columns.slice(0, 3)).toEqual(['Recommend.Other|1', 'Recommend.All|1', 'Recommend.MA|1']);
+ expect(body.columns).toContain('Recommend.All');
+ expect(Object.keys(ta ?? {})).toEqual(['1', '5', '15', '60', '240', '1D', '1W', '1M']);
+ expect(ta?.['1D']).toEqual({ Other: -0.5, All: 0, MA: 0.5 });
+ });
+
+ it('returns null without data', async () => {
+ expect(await getTechnicalAnalysis('X', { fetch: mockFetch(() => json({ data: [] })).fetch })).toBeNull();
+ });
+});
+
+describe('indicators', () => {
+ const builtIn = (name: string) => ({
+ scriptIdPart: `STD;${name}`, version: 1, scriptName: name, userId: 7, extra: { kind: 'study', shortDescription: name },
+ });
+
+ it('searches built-in and community indicators', async () => {
+ const { fetch, calls } = mockFetch((url) => {
+ if (url.pathname.endsWith('/list')) {
+ const filter = url.searchParams.get('filter');
+ return json(filter === 'standard' ? [builtIn('Relative Strength Index'), builtIn('MACD')] : []);
+ }
+ return json({
+ results: [{
+ scriptIdPart: 'PUB;abc', version: 2, scriptName: 'My RSI', author: { id: 3, username: 'bob' }, imageUrl: 'img', access: 3, scriptSource: '', extra: { kind: 'strategy' },
+ }],
+ });
+ });
+ const results = await searchIndicators('relative strength', { fetch });
+ expect(calls.map((c) => c.url.searchParams.get('filter') ?? c.url.searchParams.get('search'))).toEqual([
+ 'standard', 'candlestick', 'fundamental', 'relative strength',
+ ]);
+ expect(results).toEqual([
+ {
+ id: 'STD;Relative Strength Index', version: '1', name: 'Relative Strength Index', author: { id: 7, username: '@TRADINGVIEW@' }, image: '', source: '', type: 'study', access: 'closed_source',
+ },
+ {
+ id: 'PUB;abc', version: '2', name: 'My RSI', author: { id: 3, username: 'bob' }, image: 'img', source: '', type: 'strategy', access: 'invite_only',
+ },
+ ]);
+ });
+
+ it('loads an indicator definition with credentials and encodes the ID', async () => {
+ const { fetch, calls } = mockFetch(() => json({
+ success: true,
+ result: {
+ ilTemplate: 'IL',
+ metaInfo: {
+ scriptIdPart: 'STD;Supertrend%Strategy', description: 'Supertrend Strategy', shortDescription: 'ST', pine: { version: '5.0' }, inputs: [], styles: {}, plots: [],
+ },
+ },
+ }));
+ const indicator = await getIndicator('STD;Supertrend%Strategy', { version: '5.0', credentials: { session: 's' }, fetch });
+ expect(calls[0].url.toString()).toBe('https://pine-facade.tradingview.com/pine-facade/translate/STD;Supertrend%25Strategy/5.0');
+ expect((calls[0].init.headers as any).cookie).toBe('sessionid=s');
+ expect(indicator.description).toBe('Supertrend Strategy');
+ });
+
+ it('throws NOT_FOUND for unknown indicators', async () => {
+ const { fetch } = mockFetch(() => json({ success: false, reason: 'not found' }));
+ await expect(getIndicator('STD;XXXXXXX', { fetch })).rejects.toMatchObject({
+ code: 'NOT_FOUND', message: 'Inexistent or unsupported indicator: "not found"',
+ });
+ });
+
+ it('lists private indicators with credentials', async () => {
+ const { fetch, calls } = mockFetch(() => json([{ scriptIdPart: 'USER;1', version: 4, scriptName: 'Mine', imageUrl: '', scriptSource: 'src' }]));
+ const list = await getPrivateIndicators({ session: 's', signature: 'g' }, { fetch });
+ expect(calls[0].url.searchParams.get('filter')).toBe('saved');
+ expect((calls[0].init.headers as any).cookie).toBe('sessionid=s;sessionid_sign=g');
+ expect(list).toEqual([{
+ id: 'USER;1', version: '4', name: 'Mine', author: { id: -1, username: '@ME@' }, image: '', source: 'src', type: 'study', access: 'private',
+ }]);
+ await expect(getPrivateIndicators({ session: 'bad' }, { fetch: mockFetch(() => json({ detail: 'no' })).fetch }))
+ .rejects.toMatchObject({ code: 'AUTH_ERROR' });
+ });
+});
+
+describe('accounts', () => {
+ const page = '<script>window.user = {"id":42,"username":"alice","first_name":"Alice","last_name":"L","reputation":1.5,"following":3,"followers":4,'
+ + '"notification_count":{"following":5,"user":6},"session_hash":"h","private_channel":"pc","auth_token":"tok","date_joined":"2020-01-02T03:04:05Z"}</script>';
+
+ it('getUser parses the account page and follows redirects', async () => {
+ const { fetch, calls } = mockFetch((url) => (url.hostname === 'www.tradingview.com'
+ ? new Response('', { status: 302, headers: { location: 'https://fr.tradingview.com/' } })
+ : new Response(page)));
+ const user = await getUser({ session: 's', signature: 'g' }, { fetch });
+ expect(calls.map((c) => c.url.hostname)).toEqual(['www.tradingview.com', 'fr.tradingview.com']);
+ expect(calls[0].init.redirect).toBe('manual');
+ expect(user).toEqual({
+ id: 42,
+ username: 'alice',
+ firstName: 'Alice',
+ lastName: 'L',
+ reputation: 1.5,
+ following: 3,
+ followers: 4,
+ notifications: { following: 5, user: 6 },
+ session: 's',
+ signature: 'g',
+ sessionHash: 'h',
+ privateChannel: 'pc',
+ authToken: 'tok',
+ joinDate: new Date('2020-01-02T03:04:05Z'),
+ });
+ });
+
+ it('getUser stops redirect loops and rejects wrong sessions', async () => {
+ const loop = mockFetch((url) => new Response('', {
+ status: 302,
+ headers: { location: url.pathname === '/' ? 'https://www.tradingview.com/accounts/signin/' : 'https://www.tradingview.com/' },
+ }));
+ await expect(getUser({ session: 's' }, { fetch: loop.fetch })).rejects.toThrow('Too many redirects');
+ expect(loop.calls.length).toBe(6);
+ await expect(getUser({ session: 's' }, { fetch: mockFetch(() => new Response('no')).fetch }))
+ .rejects.toThrow('Wrong or expired sessionid/signature');
+ await expect(getUser({ session: '' })).rejects.toMatchObject({ code: 'INVALID_ARGUMENT' });
+ });
+
+ it('never forwards account cookies to a non-TradingView redirect or initial URL', async () => {
+ const redirected = mockFetch(() => new Response('', {
+ status: 302,
+ headers: { location: 'https://tradingview.com.evil.example/collect' },
+ }));
+ await expect(getUser({ session: 'secret' }, { fetch: redirected.fetch }))
+ .rejects.toMatchObject({ code: 'AUTH_ERROR' });
+ expect(redirected.calls).toHaveLength(1);
+
+ const initial = mockFetch(() => new Response(page));
+ await expect(getUser({ session: 'secret' }, {
+ location: 'http://www.tradingview.com/', fetch: initial.fetch,
+ })).rejects.toMatchObject({ code: 'AUTH_ERROR' });
+ expect(initial.calls).toHaveLength(0);
+ });
+
+ it('loginUser posts an encoded form and reads cookies', async () => {
+ const { fetch, calls } = mockFetch(() => json({
+ user: {
+ id: 1, username: 'bob', first_name: 'B', last_name: '', reputation: 0, following: 0, followers: 0, notification_count: { user: 1, following: 2 }, session_hash: 'h', private_channel: 'p', auth_token: 't', date_joined: '2021-01-01',
+ },
+ }, {
+ headers: [
+ ['set-cookie', 'sessionid=abc; Path=/; HttpOnly'],
+ ['set-cookie', 'sessionid_sign=def; Path=/'],
+ ] as any,
+ }));
+ const user = await loginUser({ username: '[email protected]', password: 'p&ss=1', fetch });
+ expect(calls[0].init.body).toBe('username=bob%40x.com&password=p%26ss%3D1&remember=on');
+ expect((calls[0].init.headers as any)['content-type']).toBe('application/x-www-form-urlencoded');
+ expect(user).toMatchObject({
+ id: 1, session: 'abc', signature: 'def', authToken: 't', notifications: { user: 1, following: 2 },
+ });
+ const noRemember = mockFetch(() => json({ error: 'Invalid username or password' }));
+ await expect(loginUser({ username: 'a', password: 'b', remember: false, fetch: noRemember.fetch }))
+ .rejects.toMatchObject({ code: 'AUTH_ERROR', message: 'Invalid username or password' });
+ expect(noRemember.calls[0].init.body).toBe('username=a&password=b');
+ });
+});
+
+describe('layouts', () => {
+ it('gets a chart token anonymously or with credentials', async () => {
+ const { fetch, calls } = mockFetch(() => json({ token: 'jwt' }));
+ expect(await getChartToken('AbCd', { fetch })).toBe('jwt');
+ expect(Object.fromEntries(calls[0].url.searchParams)).toEqual({ image_url: 'AbCd', user_id: '-1' });
+ expect((calls[0].init.headers as any).cookie).toBeUndefined();
+ await getChartToken('AbCd', { fetch, userId: 9, credentials: { session: 's', signature: 'g' } });
+ expect(calls[1].url.searchParams.get('user_id')).toBe('9');
+ expect((calls[1].init.headers as any).cookie).toBe('sessionid=s;sessionid_sign=g');
+ await expect(getChartToken('bad', { fetch: mockFetch(() => json({})).fetch })).rejects.toMatchObject({ code: 'NOT_FOUND' });
+ });
+
+ it('lists drawings with merged state', async () => {
+ const { fetch, calls } = mockFetch((url) => (url.pathname === '/chart-token'
+ ? json({ token: 'jwt' })
+ : json({ payload: { sources: { a: { id: 'a', symbol: 'BINANCE:BTCEUR', type: 'LineToolTrendLine', state: { text: 'hi', color: 'red' } } } } })));
+ const drawings = await getDrawings('AbCd', { symbol: 'BINANCE:BTCEUR', chartId: '1', fetch });
+ expect(calls[1].url.toString()).toBe(
+ 'https://charts-storage.tradingview.com/charts-storage/get/layout/AbCd/sources?chart_id=1&jwt=jwt&symbol=BINANCE%3ABTCEUR',
+ );
+ expect(drawings).toEqual([{
+ id: 'a', symbol: 'BINANCE:BTCEUR', type: 'LineToolTrendLine', state: { text: 'hi', color: 'red' }, text: 'hi', color: 'red',
+ }]);
+ const noPayload = mockFetch((url) => (url.pathname === '/chart-token' ? json({ token: 'jwt' }) : json({})));
+ await expect(getDrawings('AbCd', { fetch: noPayload.fetch })).rejects.toMatchObject({ code: 'NOT_FOUND' });
+ });
+});
+
+describe('PinePermissionManager', () => {
+ it('requires a Pine ID and full credentials', () => {
+ expect(() => new PinePermissionManager('', { credentials: { session: 's', signature: 'g' } })).toThrow(/Pine ID/);
+ expect(() => new PinePermissionManager('PUB;1', { credentials: { session: 's' } })).toThrow(/signature/);
+ });
+
+ it('lists, adds, modifies and removes authorized users', async () => {
+ const { fetch, calls } = mockFetch((url) => {
+ if (url.pathname.endsWith('list_users/')) return json({ results: [{ id: 1, username: 'bob' }] });
+ return json({ status: url.pathname.includes('add') ? 'exists' : 'ok' });
+ });
+ const manager = new PinePermissionManager('PUB;abc', { credentials: { session: 's', signature: 'g' }, fetch });
+ const expiration = new Date('2030-01-01T00:00:00Z');
+ expect(await manager.getUsers(5, 'user__username')).toEqual([{ id: 1, username: 'bob' }]);
+ expect(await manager.addUser('bob', expiration)).toBe('exists');
+ expect(await manager.modifyExpiration('bob')).toBe('ok');
+ expect(await manager.removeUser('bob')).toBe('ok');
+
+ expect(calls.map((c) => c.url.pathname + c.url.search)).toEqual([
+ '/pine_perm/list_users/?limit=5&order_by=user__username',
+ '/pine_perm/add/',
+ '/pine_perm/modify_user_expiration/',
+ '/pine_perm/remove/',
+ ]);
+ expect(calls[1].init.body).toBe('pine_id=PUB%3Babc&username_recip=bob&expiration=2030-01-01T00%3A00%3A00.000Z');
+ expect(calls[2].init.body).toBe('pine_id=PUB%3Babc&username_recip=bob');
+ expect(calls[0].init.headers).toMatchObject({ cookie: 'sessionid=s;sessionid_sign=g', origin: 'https://www.tradingview.com' });
+ });
+
+ it('surfaces API error details', async () => {
+ const { fetch } = mockFetch(() => json({ detail: 'You are not the owner' }, { status: 403 }));
+ const manager = new PinePermissionManager('PUB;abc', { credentials: { session: 's', signature: 'g' }, fetch });
+ await expect(manager.getUsers()).rejects.toMatchObject({ code: 'HTTP_ERROR', message: 'You are not the owner' });
+ });
+});
diff --git a/tests/unit/indicators.test.ts b/tests/unit/indicators.test.ts
new file mode 100644
index 0000000..46f65d7
--- /dev/null
+++ b/tests/unit/indicators.test.ts
@@ -0,0 +1,92 @@
+import { describe, expect, it } from 'vitest';
+import { BuiltInIndicator } from '../../src/indicators/builtin-indicator.js';
+import { parseIndicatorDefinition } from '../../src/http/indicators.js';
+import { makePine } from '../helpers/indicators.js';
+
+describe('PineIndicator', () => {
+ it('serialises inputs for create_study (colours are sent by position)', () => {
+ const pine = makePine();
+ expect(pine.type).toBe('Script@tv-scripting-101!');
+ expect(pine.toStudyInputs()).toEqual({
+ text: 'bmI9Ii...IL',
+ pineId: 'PUB;test',
+ pineVersion: '3.0',
+ in_0: { v: 14, f: false, t: 'integer' },
+ in_1: { v: 'close', f: false, t: 'source' },
+ in_2: { v: 2, f: true, t: 'color' },
+ in_3: { v: true, f: false, t: 'bool' },
+ });
+ });
+
+ it('finds inputs by ID, number, inline name or internal ID and validates values', () => {
+ const pine = makePine();
+ pine.setInput('in_0', 20).setInput(0, 21).setInput('Length', 22).setInput('length', 23);
+ expect(pine.inputs.in_0.value).toBe(23);
+ pine.setInputs({ src: 'open', Show: false });
+ expect(pine.inputs.in_1.value).toBe('open');
+ expect(() => pine.setInput('length', '5')).toThrow(/must be a number/);
+ expect(() => pine.setInput('src', 'hl2')).toThrow(/must be one of: close, open/);
+ expect(() => pine.setInput('missing', 1)).toThrow(/not found/);
+ });
+
+ it('clones independently and changes study type', () => {
+ const pine = makePine();
+ const copy = pine.clone().setType('StrategyScript@tv-scripting-101!');
+ copy.setInput('length', 99);
+ expect(pine.inputs.in_0.value).toBe(14);
+ expect(pine.type).toBe('Script@tv-scripting-101!');
+ expect(copy.type).toBe('StrategyScript@tv-scripting-101!');
+ });
+});
+
+describe('BuiltInIndicator', () => {
+ it('starts from defaults and validates option names and types', () => {
+ const volume = new BuiltInIndicator('Volume@tv-basicstudies-241');
+ expect(volume.toStudyInputs()).toEqual({ length: 20, col_prev_close: false });
+ volume.setOption('length', 50);
+ expect(() => volume.setOption('length', '50')).toThrow(/must be a number/);
+ expect(() => volume.setOption('rows', 1)).toThrow(/not allowed/);
+ volume.setOption('rows', 1, true);
+ expect(volume.options.rows).toBe(1);
+ });
+
+ it('computes time defaults at construction and accepts unknown types', () => {
+ const before = Date.now();
+ const profile = new BuiltInIndicator('VbPFixed@tv-basicstudies-241!', { first_bar_time: 123 });
+ expect(profile.options.last_bar_time).toBeGreaterThanOrEqual(before);
+ expect(profile.options.first_bar_time).toBe(123);
+ const custom = new BuiltInIndicator('Custom@tv-basicstudies-1', { anything: 'x' });
+ expect(custom.options).toEqual({ anything: 'x' });
+ expect(() => new BuiltInIndicator('')).toThrow(/required/);
+ });
+});
+
+describe('parseIndicatorDefinition', () => {
+ it('builds inputs and unique plot names from pine-facade metadata', () => {
+ const indicator = parseIndicatorDefinition({
+ ilTemplate: 'IL',
+ metaInfo: {
+ scriptIdPart: 'STD;Test',
+ description: 'Test',
+ shortDescription: 'T',
+ pine: { version: '12.0' },
+ inputs: [
+ { id: 'text', name: 'text', defval: 'x', type: 'text' },
+ { id: 'pineId', name: 'pineId', defval: 'x', type: 'text' },
+ { id: 'in_0', name: 'Fast length!', defval: 9, type: 'integer', options: undefined },
+ { id: 'in_1', name: 'Mode', inline: 'mode', internalID: 'modeId', defval: 'A', type: 'text', options: ['A', 'B'], isHidden: true },
+ ],
+ styles: { plot_0: { title: 'MA line' }, plot_1: { title: 'MA line' }, plot_2: { title: 'MA line' } },
+ plots: [{ id: 'plot_3', type: 'colorer', target: 'plot_0' }, { id: 'plot_0', type: 'line' }],
+ },
+ }, 'STD%3BTest', 'last');
+ expect(indicator.id).toBe('STD;Test');
+ expect(indicator.version).toBe('12.0');
+ expect(Object.keys(indicator.inputs)).toEqual(['in_0', 'in_1']);
+ expect(indicator.inputs.in_0).toMatchObject({ inline: 'Fast_length', internalID: 'Fast_length', value: 9 });
+ expect(indicator.inputs.in_1).toMatchObject({ inline: 'mode', internalID: 'modeId', isHidden: true, options: ['A', 'B'] });
+ expect(indicator.plots).toEqual({
+ plot_0: 'MA_line', plot_1: 'MA_line_2', plot_2: 'MA_line_3', plot_3: 'MA_line_colorer',
+ });
+ });
+});
diff --git a/tests/unit/protocol.test.ts b/tests/unit/protocol.test.ts
new file mode 100644
index 0000000..8e7d41b
--- /dev/null
+++ b/tests/unit/protocol.test.ts
@@ -0,0 +1,105 @@
+import { readFileSync } from 'node:fs';
+import { deflateRawSync, deflateSync, gzipSync } from 'node:zlib';
+import { describe, expect, it } from 'vitest';
+import {
+ createSessionId, decodeCompressed, decodeFrames, encodeFrame, encodeHeartbeat, encodePacket, normaliseBase64,
+} from '../../src/protocol/index.js';
+import { TradingViewError } from '../../src/errors.js';
+
+const live = JSON.parse(readFileSync(new URL('../fixtures/live-session.json', import.meta.url), 'utf8'));
+const compressed = JSON.parse(readFileSync(new URL('../fixtures/compressed-report.json', import.meta.url), 'utf8'));
+
+describe('framing', () => {
+ it('encodes packets with UTF-16 lengths', () => {
+ expect(encodePacket('set_auth_token', ['token'])).toBe('~m~36~m~{"m":"set_auth_token","p":["token"]}');
+ expect(encodeFrame('é€')).toBe('~m~2~m~é€');
+ expect(encodeHeartbeat(42)).toBe('~m~5~m~~h~42');
+ });
+
+ it('decodes several frames, heartbeats and the greeting', () => {
+ const message = encodeFrame({ session_id: 'abc', protocol: 'json' })
+ + encodeFrame('~h~7')
+ + encodePacket('qsd', ['qs_1', { n: 'X', s: 'ok', v: { lp: 1 } }]);
+ expect(decodeFrames(message)).toEqual([
+ { type: 'data', data: { session_id: 'abc', protocol: 'json' } },
+ { type: 'heartbeat', id: 7 },
+ { type: 'packet', packet: { m: 'qsd', p: ['qs_1', { n: 'X', s: 'ok', v: { lp: 1 } }] } },
+ ]);
+ });
+
+ it('keeps payloads containing frame markers intact', () => {
+ const tricky = { m: 'qsd', p: ['qs_1', { description: 'weird ~m~12~m~ text', unicode: '日本語' }] };
+ const [frame] = decodeFrames(encodeFrame(tricky));
+ expect(frame).toEqual({ type: 'packet', packet: tricky });
+ });
+
+ it('reports invalid JSON instead of throwing', () => {
+ const [frame] = decodeFrames('~m~5~m~{nope');
+ expect(frame.type).toBe('invalid');
+ });
+
+ it('falls back to splitting malformed input', () => {
+ const frames = decodeFrames('garbage~m~4~m~~h~1');
+ expect(frames.map((f) => f.type)).toEqual(['invalid', 'heartbeat']);
+ });
+
+ it('defaults a missing packet parameter list to []', () => {
+ expect(decodeFrames(encodeFrame({ m: 'protocol_error' }))).toEqual([
+ { type: 'packet', packet: { m: 'protocol_error', p: [] } },
+ ]);
+ });
+
+ it('decodes every message of a captured live session', () => {
+ const frames = live.messages.flatMap((message: string) => decodeFrames(message));
+ expect(frames.some((frame: any) => frame.type === 'invalid')).toBe(false);
+ const methods = frames.filter((f: any) => f.type === 'packet').map((f: any) => f.packet.m);
+ expect(methods).toEqual(expect.arrayContaining([
+ 'series_loading', 'symbol_resolved', 'timescale_update', 'series_completed',
+ 'du', 'study_completed', 'qsd', 'quote_completed', 'symbol_error',
+ ]));
+ });
+});
+
+describe('compressed payloads', () => {
+ const json = JSON.stringify(compressed.report);
+
+ it('reads a deflated ZIP with an empty entry name (TradingView format)', () => {
+ expect(decodeCompressed(compressed.zipDeflated)).toEqual(compressed.report);
+ });
+
+ it('reads a stored ZIP encoded as unpadded URL-safe base64', () => {
+ expect(decodeCompressed(compressed.zipStored)).toEqual(compressed.report);
+ });
+
+ it('reads a streamed ZIP that uses data descriptors', () => {
+ expect(decodeCompressed(compressed.zipStreamed)).toEqual(compressed.report);
+ });
+
+ it('reads zlib, raw deflate, gzip and plain JSON payloads', () => {
+ for (const buffer of [deflateSync(json), deflateRawSync(json), gzipSync(json), Buffer.from(json)]) {
+ expect(decodeCompressed(buffer.toString('base64'))).toEqual(compressed.report);
+ }
+ });
+
+ it('throws a PARSE_ERROR for unknown data', () => {
+ expect(() => decodeCompressed('bm90IGpzb24')).toThrow(TradingViewError);
+ try {
+ decodeCompressed('bm90IGpzb24');
+ } catch (error) {
+ expect((error as TradingViewError).code).toBe('PARSE_ERROR');
+ }
+ });
+
+ it('normalises base64', () => {
+ expect(normaliseBase64('a-_b')).toBe('a+/b');
+ expect(normaliseBase64('abcde')).toBe('abcde===');
+ });
+});
+
+describe('ids', () => {
+ it('creates prefixed random IDs', () => {
+ const id = createSessionId('cs');
+ expect(id).toMatch(/^cs_[A-Za-z0-9]{12}$/);
+ expect(createSessionId('cs')).not.toBe(id);
+ });
+});
diff --git a/tests/unit/quote.test.ts b/tests/unit/quote.test.ts
new file mode 100644
index 0000000..121256a
--- /dev/null
+++ b/tests/unit/quote.test.ts
@@ -0,0 +1,94 @@
+import { describe, expect, it } from 'vitest';
+import { TradingViewClient } from '../../src/client/client.js';
+import { ALL_QUOTE_FIELDS, resolveQuoteFields } from '../../src/quote/fields.js';
+import { quoteSymbolKey } from '../../src/quote/quote-session.js';
+import { FakeServer, flush, until } from '../helpers/fake-server.js';
+
+async function setup() {
+ const server = new FakeServer();
+ const client = new TradingViewClient({ transport: server.transport });
+ await client.ready;
+ return { server, client, connection: server.last };
+}
+
+describe('quote fields', () => {
+ it('resolves presets and explicit lists', () => {
+ expect(resolveQuoteFields('price')).toEqual(['lp']);
+ expect(resolveQuoteFields()).toEqual(ALL_QUOTE_FIELDS);
+ expect(resolveQuoteFields([])).toEqual(ALL_QUOTE_FIELDS);
+ expect(resolveQuoteFields(['lp', 'bid'])).toEqual(['lp', 'bid']);
+ });
+});
+
+describe('QuoteSession', () => {
+ it('creates a session with fields and streams merged data', async () => {
+ const { client, connection } = await setup();
+ const session = client.createQuoteSession({ fields: ['lp', 'ch'] });
+ const sub = session.subscribe('BINANCE:BTCEUR');
+ const events: unknown[][] = [];
+ sub.onAny((event, ...args) => { events.push([event, ...args]); });
+ await until(() => sub.isLoaded);
+
+ expect(connection.packets('quote_create_session')[0].p).toEqual([session.id]);
+ expect(connection.packets('quote_set_fields')[0].p).toEqual([session.id, 'lp', 'ch']);
+ expect(connection.packets('quote_add_symbols')[0].p).toEqual([session.id, quoteSymbolKey('BINANCE:BTCEUR')]);
+
+ connection.push({ m: 'qsd', p: [session.id, { n: sub.key, s: 'ok', v: { lp: 101 } }] });
+ expect(sub.data).toMatchObject({ lp: 101, ch: 1, description: 'Fake BINANCE:BTCEUR' });
+ expect(events.map(([event]) => event)).toEqual(['data', 'loaded', 'data']);
+ expect(events[2][2]).toEqual({ lp: 101 });
+
+ session.setFields('price');
+ expect(connection.packets('quote_set_fields')[1].p).toEqual([session.id, 'lp']);
+ await client.close();
+ });
+
+ it('shares one server subscription per symbol and session, with reference counting', async () => {
+ const { client, connection } = await setup();
+ const session = client.createQuoteSession();
+ const a = session.subscribe('BINANCE:BTCEUR');
+ await until(() => a.isLoaded);
+ const b = session.subscribe('BINANCE:BTCEUR');
+ const extended = session.subscribe('BINANCE:BTCEUR', { session: 'extended' });
+ await until(() => b.isLoaded && extended.isLoaded);
+ expect(b.data.lp).toBe(100);
+ expect(connection.packets('quote_add_symbols')).toHaveLength(2);
+
+ a.close();
+ expect(connection.packets('quote_remove_symbols')).toHaveLength(0);
+ b.close();
+ b.close();
+ expect(connection.packets('quote_remove_symbols').map((p) => p.p)).toEqual([[session.id, quoteSymbolKey('BINANCE:BTCEUR')]]);
+ session.delete();
+ session.delete();
+ expect(connection.packets('quote_delete_session')).toHaveLength(1);
+ expect(extended.isClosed).toBe(true);
+ expect(() => session.subscribe('X')).toThrow(/deleted/);
+ await client.close();
+ });
+
+ it('reports symbol errors and removes symbols nobody listens to', async () => {
+ const { client, connection } = await setup();
+ const session = client.createQuoteSession();
+ const bad = session.subscribe('XXXXX');
+ const error = await new Promise<any>((resolve) => { bad.on('error', resolve); });
+ expect(error).toMatchObject({ code: 'QUOTE_ERROR', message: 'Quote error (XXXXX): no_such_symbol' });
+
+ connection.push({ m: 'qsd', p: [session.id, { n: 'orphan', s: 'ok', v: {} }] });
+ await flush();
+ expect(connection.packets('quote_remove_symbols').at(-1)?.p).toEqual([session.id, 'orphan']);
+ await client.close();
+ });
+
+ it('reports DISCONNECTED to subscriptions on unexpected disconnection', async () => {
+ const { client, connection } = await setup();
+ const session = client.createQuoteSession();
+ const sub = session.subscribe('BINANCE:BTCEUR');
+ const errors: string[] = [];
+ sub.on('error', (e) => errors.push(e.code));
+ session.on('error', (e) => errors.push(`session:${e.code}`));
+ connection.drop();
+ expect(errors).toEqual(['session:DISCONNECTED', 'DISCONNECTED']);
+ expect(client.isClosed).toBe(true);
+ });
+});
diff --git a/tests/unit/study.test.ts b/tests/unit/study.test.ts
new file mode 100644
index 0000000..3fdf754
--- /dev/null
+++ b/tests/unit/study.test.ts
@@ -0,0 +1,155 @@
+import { readFileSync } from 'node:fs';
+import { describe, expect, it } from 'vitest';
+import { TradingViewClient } from '../../src/client/client.js';
+import { applyGraphicsCommands, parseGraphics } from '../../src/chart/graphics.js';
+import { BuiltInIndicator } from '../../src/indicators/builtin-indicator.js';
+import { FakeServer, until } from '../helpers/fake-server.js';
+import { makePine } from '../helpers/indicators.js';
+
+const compressed = JSON.parse(readFileSync(new URL('../fixtures/compressed-report.json', import.meta.url), 'utf8'));
+
+async function setup(options: ConstructorParameters<typeof FakeServer>[0] = {}) {
+ const server = new FakeServer({ history: 10, ...options });
+ const client = new TradingViewClient({ transport: server.transport });
+ await client.ready;
+ const chart = client.createChart();
+ chart.setMarket('BINANCE:BTCEUR', { count: 5 });
+ return { server, client, chart, connection: server.last };
+}
+
+describe('Study', () => {
+ it('creates a Pine study, names plots and keeps duplicates under plot_N', async () => {
+ const { client, chart, connection, server } = await setup({ studyPlots: 3 });
+ const pine = makePine();
+ const study = chart.createStudy(pine);
+ const events: string[] = [];
+ study.onAny((event) => { events.push(event); });
+ await until(() => study.isReady);
+
+ expect(connection.packets('create_study')[0].p).toEqual([
+ chart.id, study.id, 'st1', '$prices', 'Script@tv-scripting-101!', pine.toStudyInputs(),
+ ]);
+ expect(study.values).toHaveLength(5);
+ expect(study.values.at(-1)).toEqual({
+ $time: server.barTime(9), Value: 9, plot_1: 9.1, Signal: 9.2,
+ });
+ expect(events).toEqual(['loading', 'update', 'ready']);
+ expect(chart.studies).toEqual([study]);
+ await client.close();
+ });
+
+ it('modifies and removes a study', async () => {
+ const { client, chart, connection } = await setup();
+ const study = chart.createStudy(new BuiltInIndicator('Volume@tv-basicstudies-241'));
+ const updated = new BuiltInIndicator('Volume@tv-basicstudies-241', { length: 50 });
+ study.setIndicator(updated);
+ expect(connection.packets('modify_study')[0].p).toEqual([chart.id, study.id, 'st1', { length: 50, col_prev_close: false }]);
+ expect(study.indicator).toBe(updated);
+ expect(() => study.setIndicator({} as any)).toThrow(/PineIndicator/);
+ study.remove();
+ study.remove();
+ expect(connection.packets('remove_study')).toEqual([{ m: 'remove_study', p: [chart.id, study.id] }]);
+ expect(chart.studies).toEqual([]);
+ expect(() => chart.createStudy('STD;RSI' as any)).toThrow(/PineIndicator/);
+ await client.close();
+ });
+
+ it('formats study errors with their context', async () => {
+ const { client, chart } = await setup({
+ studyError: {
+ error: "Invalid value of the '{argName}' argument ({value}) in the '{funName}' function.",
+ ctx: { argName: 'factor', value: -1, funName: 'supertrend' },
+ },
+ });
+ const study = chart.createStudy(makePine());
+ const error = await new Promise<any>((resolve) => { study.on('error', resolve); });
+ expect(error.code).toBe('STUDY_ERROR');
+ expect(error.message).toBe("Study error: Invalid value of the 'factor' argument (-1) in the 'supertrend' function.");
+ await client.close();
+ });
+
+ it('reads graphics commands and positions them in bars back from the latest bar', async () => {
+ const { client, chart, server } = await setup({
+ studyNs: () => ({
+ graphicsCmds: {
+ create: {
+ dwglabels: [{ data: [{ id: 1, x: 0, y: 10, yl: 'ab', t: 'Hi', st: 'lup', ci: 1, tci: 2, sz: 'small', ta: 'center', tt: 'tip' }] }],
+ dwglines: [{ data: [{ id: 2, x1: 1, y1: 1, x2: 2, y2: 2, ex: 'r', st: 'dsh', ci: 3, w: 1 }] }],
+ dwgboxes: [{ data: [{ id: 3, x1: 0, y1: 1, x2: 2, y2: 0, c: 1, bc: 2, ex: 'n', st: 'dot', w: 2, t: 'Box', ts: 'auto', tc: 3, tva: 'top', tha: 'left', tw: 'none' }] }],
+ dwgtables: [{ data: [{ id: 4, pos: 'top_right', rows: 1, cols: 2, bgc: 1, frmc: 2, frmw: 1, brdc: 3, brdw: 1 }] }],
+ dwgtablecells: [{ data: [
+ { id: 5, tid: 4, row: 0, col: 1, t: 'B', w: 0, h: 0, tc: 1, tha: 'center', tva: 'center', ts: 'auto', bgc: 2 },
+ { id: 6, tid: 4, row: 0, col: 0, t: 'A', w: 0, h: 0, tc: 1, tha: 'center', tva: 'center', ts: 'auto', bgc: 2 },
+ ] }],
+ hhists: [{ data: [{ id: 7, priceLow: 1, priceHigh: 2, firstBarTime: 0, lastBarTime: 2, rate: [1, 2] }] }],
+ horizlines: [{ data: [{ id: 8, level: 5, startIndex: 0, endIndex: 1, extendLeft: false, extendRight: true }] }],
+ polygons: [{ data: [{ id: 9, points: [{ index: 1, level: 3 }] }] }],
+ },
+ },
+ }),
+ });
+ const study = chart.createStudy(makePine());
+ await until(() => study.isReady && chart.candles.length === 5);
+ // Fake graphic indexes [0, 1, 2] map to bar indexes 0..2 = the 5th, 4th and 3rd most recent bars.
+ const { graphics } = study;
+ expect(graphics.labels).toEqual([{
+ id: 1, x: 4, y: 10, yLoc: 'abovebar', text: 'Hi', style: 'label_up', color: 1, textColor: 2, size: 'small', textAlign: 'center', toolTip: 'tip',
+ }]);
+ expect(graphics.lines[0]).toMatchObject({ x1: 3, x2: 2, extend: 'right', style: 'dashed' });
+ expect(graphics.boxes[0]).toMatchObject({ x1: 4, x2: 2, extend: 'none', style: 'dotted', text: 'Box' });
+ expect(graphics.tables[0]).toMatchObject({ position: 'top_right', columns: 2 });
+ expect(graphics.tables[0].cells.map((row) => row.map((cell) => cell.text))).toEqual([['A', 'B']]);
+ expect(graphics.horizHists[0]).toMatchObject({ firstBarTime: 4, lastBarTime: 2, rate: [1, 2] });
+ expect(graphics.horizLines[0]).toMatchObject({ startIndex: 4, endIndex: 3, extendRight: true });
+ expect(graphics.polygons[0].points).toEqual([{ index: 3, level: 3 }]);
+ expect(Object.keys(graphics.raw)).toContain('dwglabels');
+ expect(server.options.history).toBe(10);
+ await client.close();
+ });
+
+ it('applies erase commands', () => {
+ const raw: any = {};
+ applyGraphicsCommands(raw, { create: { dwglabels: [{ data: [{ id: 1 }, { id: 2 }] }], dwglines: [{ data: [{ id: 3 }] }] } });
+ applyGraphicsCommands(raw, { erase: [{ action: 'one', type: 'dwglabels', id: 1 }, { action: 'one', id: 99 }] });
+ expect(Object.keys(raw.dwglabels)).toEqual(['2']);
+ applyGraphicsCommands(raw, { erase: [{ action: 'all', type: 'dwglines' }] });
+ expect(raw.dwglines).toBeUndefined();
+ applyGraphicsCommands(raw, { erase: [{ action: 'all' }] });
+ expect(raw).toEqual({ dwglabels: {} });
+ expect(parseGraphics(raw).labels).toEqual([]);
+ });
+
+ it('decodes plain and compressed strategy reports', async () => {
+ const plainReport = { report: { currency: 'USD', performance: { all: { totalTrades: 1 } } } };
+ for (const ns of [{ data: plainReport }, { dataCompressed: compressed.zipDeflated }]) {
+ const { client, chart } = await setup({ studyNs: () => ns });
+ const study = chart.createStudy(makePine().setType('StrategyScript@tv-scripting-101!'));
+ const changes: string[][] = [];
+ study.on('update', (c) => changes.push(c));
+ await until(() => study.isReady);
+ if ('data' in ns) {
+ expect(study.strategyReport).toMatchObject({ currency: 'USD', performance: { all: { totalTrades: 1 } } });
+ expect(changes[0]).toEqual(['plots', 'report.currency', 'report.perf']);
+ } else {
+ const report = study.strategyReport;
+ expect(report.currency).toBe('EUR');
+ expect(report.settings?.dateRange?.backtest).toEqual({ from: 1, to: 2 });
+ expect(report.trades.map((t) => t.entry.type)).toEqual(['short', 'long']);
+ expect(report.trades[0]).toMatchObject({
+ entry: { name: 'Short', value: 110 }, exit: { name: '', value: 105 }, quantity: 2, profit: { v: 10, p: 0.05 },
+ });
+ expect(report.history.equity).toEqual([1, 2]);
+ expect(changes[0]).toEqual(['plots', 'report.currency', 'report.settings', 'report.perf', 'report.trades', 'report.history']);
+ }
+ await client.close();
+ }
+ });
+
+ it('reports undecodable strategy reports as PARSE_ERROR', async () => {
+ const { client, chart } = await setup({ studyNs: () => ({ dataCompressed: 'bm90IGpzb24' }) });
+ const study = chart.createStudy(makePine());
+ const error = await new Promise<any>((resolve) => { study.on('error', resolve); });
+ expect(error.code).toBe('PARSE_ERROR');
+ await client.close();
+ });
+});
diff --git a/tests/utils.ts b/tests/utils.ts
deleted file mode 100644
index 5292503..0000000
--- a/tests/utils.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-export const wait = (ms: number) => (
- new Promise((resolve) => { setTimeout(resolve, ms); })
-);
-
-export function calculateTimeGap(periods: { time: number }[]) {
- let minTimeGap = Infinity;
-
- for (let i = 1; i < periods.length; i += 1) {
- minTimeGap = Math.min(
- minTimeGap,
- periods[i - 1].time - periods[i].time,
- );
- }
-
- return minTimeGap;
-}
-
-export default {
- wait,
- calculateTimeGap,
-};
diff --git a/tsconfig.agent.json b/tsconfig.agent.json
deleted file mode 100644
index 93edc68..0000000
--- a/tsconfig.agent.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "compilerOptions": {
- "target": "ES2020",
- "module": "CommonJS",
- "moduleResolution": "Node",
- "lib": ["ES2022", "DOM"],
- "types": ["node"],
- "strict": true,
- "declaration": true,
- "outDir": "dist",
- "skipLibCheck": true
- },
- "include": ["agent.ts"]
-}
diff --git a/tsconfig.build.json b/tsconfig.build.json
new file mode 100644
index 0000000..45cd82f
--- /dev/null
+++ b/tsconfig.build.json
@@ -0,0 +1,13 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "rootDir": "src",
+ "outDir": "dist",
+ "noEmit": false,
+ "sourceMap": false,
+ "declarationMap": false
+ },
+ "include": [
+ "src"
+ ]
+}
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..ed11ecb
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,25 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "NodeNext",
+ "moduleResolution": "NodeNext",
+ "lib": ["ES2023"],
+ "types": ["node"],
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noImplicitOverride": true,
+ "noFallthroughCasesInSwitch": true,
+ "exactOptionalPropertyTypes": false,
+ "isolatedModules": true,
+ "verbatimModuleSyntax": true,
+ "allowImportingTsExtensions": false,
+ "skipLibCheck": true,
+ "declaration": true,
+ "declarationMap": true,
+ "sourceMap": true,
+ "outDir": "dist",
+ "rootDir": "."
+ },
+ "include": ["src", "tests", "vitest.config.ts", "vitest.live.config.ts"]
+}
diff --git a/vite.config.js b/vite.config.js
deleted file mode 100644
index 04522e3..0000000
--- a/vite.config.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Project: https://github.com/Mathieu2301/TradingView-API
-// Package: https://www.npmjs.com/package/@mathieuc/tradingview
-module.exports = {
- test: {
- testTimeout: 10000,
- retry: 3,
- setupFiles: 'dotenv/config',
- },
-};
diff --git a/vitest.config.ts b/vitest.config.ts
new file mode 100644
index 0000000..fde5f80
--- /dev/null
+++ b/vitest.config.ts
@@ -0,0 +1,8 @@
+import { defineConfig } from 'vitest/config';
+
+export default defineConfig({
+ test: {
+ include: ['tests/unit/**/*.test.ts'],
+ testTimeout: 5_000,
+ },
+});
diff --git a/vitest.live.config.ts b/vitest.live.config.ts
new file mode 100644
index 0000000..774bbfe
--- /dev/null
+++ b/vitest.live.config.ts
@@ -0,0 +1,14 @@
+import { defineConfig } from 'vitest/config';
+
+// Live tests talk to TradingView servers. They are opt-in (`npm run test:live`)
+// and never part of the default deterministic suite.
+export default defineConfig({
+ test: {
+ include: ['tests/live/**/*.test.ts'],
+ testTimeout: 60_000,
+ hookTimeout: 30_000,
+ retry: 1,
+ fileParallelism: false,
+ env: { TV_LIVE: '1' },
+ },
+});