@qtsurfer/api-client 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -68,8 +68,8 @@ pluggable token stores so callers don't reinvent that plumbing.
68
68
 
69
69
  All operations are exported as standalone functions; every operation accepts an `Options` object and returns `{ data, error, response }`.
70
70
 
71
- The table is exhaustive: `src/generated/` is produced from the OpenAPI spec, so **all 45 operations**
72
- the spec declares are exported. The rows below describe **spec version 0.128.14**, which is versioned
71
+ The table is exhaustive: `src/generated/` is produced from the OpenAPI spec, so **all 48 operations**
72
+ the spec declares are exported. The rows below describe **spec version 0.128.20**, which is versioned
73
73
  independently of this package.
74
74
 
75
75
  | Function | Method | Path | Purpose |
@@ -107,20 +107,23 @@ independently of this package.
107
107
  | `getDatasetUpload` | GET | `/datasets/{datasetId}/uploads/{uploadId}` | Get an upload's ingestion state |
108
108
  | `importDataset` | POST | `/datasets/imports` | Create a dataset by importing external history |
109
109
  | `getDatasetImport` | GET | `/datasets/{datasetId}/imports/{importId}` | Get an import's fetch and ingestion state |
110
- | `startLive` | POST | `/strategy/{strategyId}/live` | Start a compiled strategy on a live feed; optionally simulate fills and equity with `paper` |
110
+ | `startLive` | POST | `/strategy/{strategyId}/live` | Start a compiled strategy on a live feed; optionally set its warm-up replay window with `warmFrom`, simulate fills and equity with `paper`, or request a plain WebSocket stream URL |
111
111
  | `getLive` | GET | `/strategy/{strategyId}/live` | Read a strategy's current or most recent live run |
112
112
  | `stopLive` | DELETE | `/strategy/{strategyId}/live` | Request a strategy's active live run to stop |
113
113
  | `listLive` | GET | `/live` | Page all live runs owned by the authenticated account |
114
114
  | `listPublicLive` | GET | `/live/public` | Page publicly visible live runs |
115
+ | `getLiveRun` | GET | `/live/{runId}` | Read one owned run by its id, including its latest stats and last-change time |
115
116
  | `updateLive` | PATCH | `/live/{runId}` | Change a run's visibility, name, or description |
116
117
  | `updateLiveParams` | PUT | `/live/{runId}/params` | Change parameters while a run stays active |
118
+ | `rotateLiveStream` | POST | `/live/{runId}/stream` | Replace a run's stream URL and retire the old one |
119
+ | `revokeLiveStream` | DELETE | `/live/{runId}/stream` | Permanently revoke a run's stream URL |
117
120
  | `sendLiveCommand` | POST | `/live/{runId}/commands` | Send a command to a running strategy without restarting it |
118
121
  | `getLiveRunSignals` | GET | `/live/{runId}/signals` | Page retained signals by time, instrument, or signal type (`paper` items only when output is `mix`) |
119
122
  | `getLiveRunPaper` | GET | `/live/{runId}/paper` | Read simulated accounts, open positions, equity, and KPIs for a paper-trading run |
120
123
  | `getLiveRunPaperEquity` | GET | `/live/{runId}/paper/equity` | Page the run's retained paper equity curve, optionally by quote currency or start time |
121
124
  | `mintLiveConnectionToken` | POST | `/live/token` | Mint a short-lived Centrifugo connection token |
122
125
 
123
- All generated types (`Exchange`, `InstrumentDetail`, `BacktestJobResult`, `PrepareJobState`, `ResultMap`, `LivePaper`, `LivePaperAccount`, `LivePaperEquityPage`, `SendLiveCommandRequest`, `LiveCommandResult`, etc.) are re-exported from the root.
126
+ All generated types (`Exchange`, `InstrumentDetail`, `BacktestJobResult`, `PrepareJobState`, `ResultMap`, `LiveRunStats`, `LiveRunDetail`, `LiveRunWithStream`, `LiveStreamUrl`, `LiveStreamRevoked`, `LivePaper`, `LivePaperAccount`, `LivePaperEquityPage`, `SendLiveCommandRequest`, `LiveCommandResult`, etc.) are re-exported from the root.
124
127
 
125
128
  `sendLiveCommand` sends a command to every execution behind an owned live run. The strategy must
126
129
  implement the engine's `CommandRequestHandler`; `202` means the command was accepted, not that the
package/dist/index.d.ts CHANGED
@@ -1755,6 +1755,31 @@ type StartLiveRequest = {
1755
1755
  * Request that this run's signals be relayed over its WebSocket channel, from its first signal — in the `sandbox` stage too, where only you can subscribe to it. See the "Live execution" guide.
1756
1756
  */
1757
1757
  relay?: boolean;
1758
+ /**
1759
+ * Ask for a **stream URL**: a secret address that a simple client, or a service that passes your signals
1760
+ * on to others, can open as a plain WebSocket to receive this run's signals as they are produced, one JSON
1761
+ * text frame per signal, with none of the live-execution protocol around it. The URL comes back as
1762
+ * `streamUrl` in the response to this call. Available from the `sandbox` stage on, on the plans that may
1763
+ * broadcast; any other plan gets `429`. It can be asked for **only when the run is started** (not added
1764
+ * later), and it also turns `relay` on. See the "Live execution" guide, "A plain WebSocket stream of a run".
1765
+ *
1766
+ */
1767
+ stream?: boolean;
1768
+ /**
1769
+ * How many seconds before the run's start to replay the market feed from, so the strategy's indicators and
1770
+ * windows have history when its first live tick arrives. `0` replays nothing: the run delivers its first
1771
+ * signal as soon as it is running, but its indicators start empty and the first bar of a window can be
1772
+ * partial. Omitted, the platform replays from the start of the current 15-minute block: between 0 and 900
1773
+ * seconds before the run's start, depending on when it starts (0 if it starts exactly on a quarter hour),
1774
+ * so the first bar of a 15-minute window is complete. The value in effect, the one you sent or the one the
1775
+ * platform chose, is reported back as `warmFrom` on the run. Signals about the replayed time
1776
+ * are not pushed on the run's channel or stream: they describe events from before the run started.
1777
+ * It can be set **only when the run is started**: it is not a parameter of `PUT /live/{runId}/params`, and
1778
+ * changing it means stopping the run and starting it again. Anything that is not an integer from 0 to 3600
1779
+ * is `400`. See the "Live execution" guide, "Warming up".
1780
+ *
1781
+ */
1782
+ warmFrom?: number;
1758
1783
  name?: string;
1759
1784
  description?: string;
1760
1785
  paper?: LivePaperConfig;
@@ -1824,7 +1849,7 @@ type SendLiveCommandRequest = {
1824
1849
  };
1825
1850
  };
1826
1851
  /**
1827
- * A live run's full state, as returned by starting, reading, or stopping it through its strategy.
1852
+ * A live run's full state, as returned by stopping it through its strategy, and the base of the representations returned by starting and by reading it. `warmFrom` is declared by those two (`LiveRunWithStream` and `LiveRunDetail`) and not here, because the response to stopping a run does not carry it.
1828
1853
  */
1829
1854
  type LiveRun = {
1830
1855
  strategyId: StrategyId;
@@ -1887,6 +1912,103 @@ type LiveRun = {
1887
1912
  * The run's paper trading configuration as accepted at start, normalised. Absent when the run has no paper trading.
1888
1913
  */
1889
1914
  paper?: LivePaperConfig;
1915
+ /**
1916
+ * The run's latest counters. Returned by the two reads, `GET /strategy/{strategyId}/live` and
1917
+ * `GET /live/{runId}`; never by starting or stopping a run. Absent until the first snapshot exists
1918
+ * (a run that has just started), and absent is not zero.
1919
+ *
1920
+ */
1921
+ stats?: LiveRunStats;
1922
+ };
1923
+ /**
1924
+ * What a run has been doing, as of its last snapshot. The platform refreshes it about once a minute
1925
+ * while the run is being executed, so `opsPerSecond` is an average over that interval, not an
1926
+ * instantaneous rate.
1927
+ *
1928
+ */
1929
+ type LiveRunStats = {
1930
+ /**
1931
+ * Updates of instruments the run has accepted since it started executing. It can start again from zero if the run is restarted.
1932
+ */
1933
+ processed: number;
1934
+ /**
1935
+ * Updates accepted per second over the last refresh interval. `0` when none arrived.
1936
+ */
1937
+ opsPerSecond: number;
1938
+ /**
1939
+ * How many distinct instruments the run has received an update for.
1940
+ */
1941
+ instrumentsSeen: number;
1942
+ /**
1943
+ * Epoch milliseconds when these counters were last written.
1944
+ */
1945
+ asOfMs: number;
1946
+ /**
1947
+ * Epoch milliseconds of the last snapshot in which `processed` had grown. Absent until the run has
1948
+ * processed anything. A run fed by a source that updates rarely (a funding rate, for example) can
1949
+ * stay flat for hours: that is how such a run behaves, not a fault.
1950
+ *
1951
+ */
1952
+ progressedAtMs?: number;
1953
+ /**
1954
+ * `true` when the run is meant to be running (`desired` is `RUNNING`) and its counters have not
1955
+ * been refreshed for several refresh intervals: the platform has stopped updating them, which is
1956
+ * worth checking against `state`. `false` otherwise. A run whose `processed` is flat is not stale;
1957
+ * `progressedAtMs` is how to tell it apart.
1958
+ *
1959
+ */
1960
+ stale: boolean;
1961
+ };
1962
+ /**
1963
+ * The `warmFrom` in effect for this run, in seconds: the one requested when the run was started or, when none was, the one the platform chose (the distance from the run's start back to the start of the current 15-minute block, 0 to 900). It is never `null`. It is present on every run started since the field exists and absent from a run started before it existed. It never changes while the run exists.
1964
+ */
1965
+ type WarmFrom = number;
1966
+ /**
1967
+ * A run as returned by `GET /live/{runId}`, the full state of `LiveRun` plus when it last changed.
1968
+ */
1969
+ type LiveRunDetail = LiveRun & {
1970
+ warmFrom?: WarmFrom;
1971
+ /**
1972
+ * Epoch milliseconds of the run's last change, from any cause. It only moves forward, so of two reads of the same run the one with the larger value is the newer.
1973
+ */
1974
+ updatedAtMs: number;
1975
+ };
1976
+ /**
1977
+ * A run as `LiveRun` describes it, plus its `warmFrom` (absent only for a run started before the field existed) and its `streamUrl` when it has one. It is what **starting a run** and
1978
+ * `GET /strategy/{strategyId}/live` return: your own run, read with your own credentials. Stopping a run
1979
+ * returns `LiveRun`, which carries neither `warmFrom` nor the URL, and `GET /live/{runId}` returns `LiveRunDetail`, which carries `warmFrom` and never the URL.
1980
+ *
1981
+ */
1982
+ type LiveRunWithStream = LiveRun & {
1983
+ warmFrom?: WarmFrom;
1984
+ /**
1985
+ * The run's secret stream URL (`wss://…`). **Treat it like a password**: anyone who holds it can read
1986
+ * this run's signals, from the sandbox stage on. Present only when the run was started with
1987
+ * `stream: true`, is wanted running, has not had its stream revoked, and your plan still lets you
1988
+ * broadcast; absent otherwise (a plan that lets you broadcast again gets the same URL back). Rotate
1989
+ * it with `POST /live/{runId}/stream` if it leaks, revoke it with `DELETE /live/{runId}/stream`.
1990
+ *
1991
+ */
1992
+ streamUrl?: string;
1993
+ };
1994
+ /**
1995
+ * A run's new stream URL, as returned by `POST /live/{runId}/stream`.
1996
+ */
1997
+ type LiveStreamUrl = {
1998
+ /**
1999
+ * The run's new secret stream URL. The previous one has stopped working.
2000
+ */
2001
+ streamUrl: string;
2002
+ };
2003
+ /**
2004
+ * What `DELETE /live/{runId}/stream` returns.
2005
+ */
2006
+ type LiveStreamRevoked = {
2007
+ runId: string;
2008
+ /**
2009
+ * Always `true`.
2010
+ */
2011
+ revoked: boolean;
1890
2012
  };
1891
2013
  /**
1892
2014
  * A run's state as returned by `PATCH /live/{runId}` — narrower than `LiveRun` (no `strategyId`, `params`, or `desired`), since this endpoint is addressed by `runId` alone.
@@ -3392,9 +3514,9 @@ type GetLiveErrors = {
3392
3514
  type GetLiveError = GetLiveErrors[keyof GetLiveErrors];
3393
3515
  type GetLiveResponses = {
3394
3516
  /**
3395
- * The run's current state
3517
+ * The run's current state, with its `streamUrl` when it has one
3396
3518
  */
3397
- 200: LiveRun;
3519
+ 200: LiveRunWithStream;
3398
3520
  };
3399
3521
  type GetLiveResponse = GetLiveResponses[keyof GetLiveResponses];
3400
3522
  type StartLiveData = {
@@ -3410,7 +3532,7 @@ type StartLiveData = {
3410
3532
  };
3411
3533
  type StartLiveErrors = {
3412
3534
  /**
3413
- * Malformed `sources` (not exactly one entry, missing field, unsupported `type`), a `type` the strategy cannot consume (a ticker strategy with a `kline` source, or the reverse; the message names both), an invalid `visibility`, an invalid `paper` block (an unknown field, a wrong type or an out-of-range value), or no `paper` block for a strategy that listens to its own execution events.
3535
+ * Malformed `sources` (not exactly one entry, missing field, unsupported `type`), a `type` the strategy cannot consume (a ticker strategy with a `kline` source, or the reverse; the message names both), an invalid `visibility`, an invalid `paper` block (an unknown field, a wrong type or an out-of-range value), or no `paper` block for a strategy that listens to its own execution events. A `relay` or `stream` that is not `true` or `false`, or a `stream` where streams are not available yet. A `warmFrom` that is not an integer from 0 to 3600.
3414
3536
  */
3415
3537
  400: ResponseError;
3416
3538
  /**
@@ -3422,9 +3544,10 @@ type StartLiveErrors = {
3422
3544
  */
3423
3545
  409: ResponseError;
3424
3546
  /**
3425
- * Your plan does not include live runs, would exceed your concurrent-run or
3426
- * instrument-count limit, or the platform is at capacity right now. Carries a
3427
- * `Retry-After` header.
3547
+ * One of two kinds. **Your plan** does not include live runs, would exceed your concurrent-run or
3548
+ * instrument-count limit, or does not let you ask for a `stream`: the message names your plan, and
3549
+ * retrying will not help until something changes, so there is no `Retry-After`. Or **the platform is at
3550
+ * capacity** right now: a `Retry-After` header says when to try again.
3428
3551
  *
3429
3552
  */
3430
3553
  429: ResponseError;
@@ -3432,9 +3555,9 @@ type StartLiveErrors = {
3432
3555
  type StartLiveError = StartLiveErrors[keyof StartLiveErrors];
3433
3556
  type StartLiveResponses = {
3434
3557
  /**
3435
- * Started — the run's own state, in the sandbox stage
3558
+ * Started — the run's own state, in the sandbox stage, with its `streamUrl` when you asked for a stream
3436
3559
  */
3437
- 201: LiveRun;
3560
+ 201: LiveRunWithStream;
3438
3561
  };
3439
3562
  type StartLiveResponse = StartLiveResponses[keyof StartLiveResponses];
3440
3563
  type ListLiveData = {
@@ -3495,6 +3618,31 @@ type ListPublicLiveResponses = {
3495
3618
  200: PublicLiveListResponse;
3496
3619
  };
3497
3620
  type ListPublicLiveResponse = ListPublicLiveResponses[keyof ListPublicLiveResponses];
3621
+ type GetLiveRunData = {
3622
+ body?: never;
3623
+ path: {
3624
+ /**
3625
+ * The `runId` from `POST`/`GET`/`DELETE` `.../live`, from `GET /live` or from `GET /live/public`
3626
+ */
3627
+ runId: string;
3628
+ };
3629
+ query?: never;
3630
+ url: "/live/{runId}";
3631
+ };
3632
+ type GetLiveRunErrors = {
3633
+ /**
3634
+ * No such run, or you do not own it — the two look identical on purpose.
3635
+ */
3636
+ 404: ResponseError;
3637
+ };
3638
+ type GetLiveRunError = GetLiveRunErrors[keyof GetLiveRunErrors];
3639
+ type GetLiveRunResponses = {
3640
+ /**
3641
+ * The run
3642
+ */
3643
+ 200: LiveRunDetail;
3644
+ };
3645
+ type GetLiveRunResponse = GetLiveRunResponses[keyof GetLiveRunResponses];
3498
3646
  type UpdateLiveData = {
3499
3647
  body?: UpdateLiveRequest;
3500
3648
  path: {
@@ -3596,6 +3744,64 @@ type SendLiveCommandResponses = {
3596
3744
  202: LiveCommandResult;
3597
3745
  };
3598
3746
  type SendLiveCommandResponse = SendLiveCommandResponses[keyof SendLiveCommandResponses];
3747
+ type RevokeLiveStreamData = {
3748
+ body?: never;
3749
+ path: {
3750
+ runId: string;
3751
+ };
3752
+ query?: never;
3753
+ url: "/live/{runId}/stream";
3754
+ };
3755
+ type RevokeLiveStreamErrors = {
3756
+ /**
3757
+ * No such run, or you do not own it.
3758
+ */
3759
+ 404: ResponseError;
3760
+ /**
3761
+ * The run was started without a stream, so there is nothing to revoke.
3762
+ */
3763
+ 409: ResponseError;
3764
+ };
3765
+ type RevokeLiveStreamError = RevokeLiveStreamErrors[keyof RevokeLiveStreamErrors];
3766
+ type RevokeLiveStreamResponses = {
3767
+ /**
3768
+ * Revoked (or already revoked).
3769
+ */
3770
+ 200: LiveStreamRevoked;
3771
+ };
3772
+ type RevokeLiveStreamResponse = RevokeLiveStreamResponses[keyof RevokeLiveStreamResponses];
3773
+ type RotateLiveStreamData = {
3774
+ body?: never;
3775
+ path: {
3776
+ runId: string;
3777
+ };
3778
+ query?: never;
3779
+ url: "/live/{runId}/stream";
3780
+ };
3781
+ type RotateLiveStreamErrors = {
3782
+ /**
3783
+ * No such run, or you do not own it.
3784
+ */
3785
+ 404: ResponseError;
3786
+ /**
3787
+ * One of three reasons, each its own message: the run was started without a stream; its stream was
3788
+ * revoked (a revoked stream cannot be restored: start the run again with a stream); or the run is stopped.
3789
+ *
3790
+ */
3791
+ 409: ResponseError;
3792
+ /**
3793
+ * Your plan does not let you broadcast a run's signals. The message names your plan; retrying will not help until it changes, so there is no `Retry-After`.
3794
+ */
3795
+ 429: ResponseError;
3796
+ };
3797
+ type RotateLiveStreamError = RotateLiveStreamErrors[keyof RotateLiveStreamErrors];
3798
+ type RotateLiveStreamResponses = {
3799
+ /**
3800
+ * The new URL.
3801
+ */
3802
+ 200: LiveStreamUrl;
3803
+ };
3804
+ type RotateLiveStreamResponse = RotateLiveStreamResponses[keyof RotateLiveStreamResponses];
3599
3805
  type GetLiveRunSignalsData = {
3600
3806
  body?: never;
3601
3807
  path: {
@@ -4316,7 +4522,8 @@ declare const getDatasetImport: <ThrowOnError extends boolean = false>(options:
4316
4522
  * Requests a stop. The run winds down at its own next check-in rather than instantly —
4317
4523
  * poll `GET`/`PATCH` `.../live` and expect `state` to remain `RUNNING` for a short window
4318
4524
  * after `desired` flips to `STOPPED`. Calling this again on an already-stopped run is not an
4319
- * error; it returns the same (unchanged) state.
4525
+ * error; it returns the same (unchanged) state. A stopped run has no stream: its `streamUrl`, if it had one,
4526
+ * stops working and is not in this response.
4320
4527
  *
4321
4528
  */
4322
4529
  declare const stopLive: <ThrowOnError extends boolean = false>(options: Options<StopLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveRun, ResponseError, ThrowOnError>;
@@ -4324,10 +4531,15 @@ declare const stopLive: <ThrowOnError extends boolean = false>(options: Options<
4324
4531
  * Get this strategy's current (or most recent) live run
4325
4532
  * The run you last started for this strategy — its most complete state, including `params`
4326
4533
  * and the promotion `gate` once the sandbox trial has one to report. Returns the run's last
4327
- * known state even after it has stopped; this endpoint never disappears history.
4534
+ * known state even after it has stopped; this endpoint never disappears history. When the run was started
4535
+ * with a `stream`, `streamUrl` is here too while the run is running and your plan allows it.
4536
+ *
4537
+ * While the run is being executed it also carries `stats`, the run's latest counters (updates
4538
+ * processed, rate, instruments seen), refreshed about once a minute. Starting or stopping a run
4539
+ * does not return them; read them here.
4328
4540
  *
4329
4541
  */
4330
- declare const getLive: <ThrowOnError extends boolean = false>(options: Options<GetLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveRun, ResponseError, ThrowOnError>;
4542
+ declare const getLive: <ThrowOnError extends boolean = false>(options: Options<GetLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveRunWithStream, ResponseError, ThrowOnError>;
4331
4543
  /**
4332
4544
  * Start a strategy on a live market feed
4333
4545
  * Starts your strategy against a live market feed. A new run always begins in the **sandbox**
@@ -4363,8 +4575,21 @@ declare const getLive: <ThrowOnError extends boolean = false>(options: Options<G
4363
4575
  * (it overrides `getExecutionCallback()`) has no other execution venue, so it cannot start
4364
4576
  * without a `paper` block.
4365
4577
  *
4578
+ * **Warming up.** Pass `warmFrom` to choose how many seconds before its start the run replays the market
4579
+ * feed from, so that its indicators and windows have history when the first live tick arrives. `0` replays
4580
+ * nothing: the run delivers its first signal as soon as it is running, but its indicators start empty and the
4581
+ * first bar of a window can be partial. Omitted, the platform replays from the start of the current 15-minute
4582
+ * block, which is between 0 and 900 seconds before the run's start, so the first bar of a 15-minute window is
4583
+ * complete. The value in effect, yours or the platform's, comes back as `warmFrom`. It can be set only here,
4584
+ * when the run is started. See the "Live execution" guide, "Warming up".
4585
+ *
4586
+ * **A plain WebSocket stream.** Pass `stream: true` to get a secret URL for this run's signals that a simple
4587
+ * client, or a service that passes them on to others, can open as an ordinary WebSocket, from the sandbox stage
4588
+ * on. The URL is in the response (`streamUrl`) and in `GET /strategy/{strategyId}/live`; treat it like a
4589
+ * password. See the "Live execution" guide.
4590
+ *
4366
4591
  */
4367
- declare const startLive: <ThrowOnError extends boolean = false>(options: Options<StartLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveRun, ResponseError, ThrowOnError>;
4592
+ declare const startLive: <ThrowOnError extends boolean = false>(options: Options<StartLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveRunWithStream, ResponseError, ThrowOnError>;
4368
4593
  /**
4369
4594
  * List your own live runs
4370
4595
  * Every run you have started, in any `stage`, `desired` state, or `visibility` — newest
@@ -4383,6 +4608,22 @@ declare const listLive: <ThrowOnError extends boolean = false>(options?: Options
4383
4608
  *
4384
4609
  */
4385
4610
  declare const listPublicLive: <ThrowOnError extends boolean = false>(options?: Options<ListPublicLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PublicLiveListResponse, ResponseError, ThrowOnError>;
4611
+ /**
4612
+ * Read one of your runs by its id
4613
+ * Owner only, addressed by `runId` directly rather than through its strategy: the run's own
4614
+ * canonical identity, which is what `POST`/`GET`/`DELETE` `.../live`, `GET /live` and
4615
+ * `GET /live/public` all hand out. Use it to re-read one specific run — including one you
4616
+ * stopped long ago or that is no longer your strategy's most recent — without paging through
4617
+ * `GET /live`.
4618
+ *
4619
+ * Returns the same state as `GET /strategy/{strategyId}/live` (`strategyId` is the strategy's
4620
+ * id, and `stats` is there too), plus `updatedAtMs`: when the run last changed, from any cause — a
4621
+ * state change, a promotion, a parameter update, a stop. A refresh of `stats` is not a change of
4622
+ * the run and does not move `updatedAtMs`. A run that is public is reachable by others through
4623
+ * `GET /live/public`, never through this route.
4624
+ *
4625
+ */
4626
+ declare const getLiveRun: <ThrowOnError extends boolean = false>(options: Options<GetLiveRunData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveRunDetail, ResponseError, ThrowOnError>;
4386
4627
  /**
4387
4628
  * Change a run's visibility, name, or description
4388
4629
  * Owner only, addressed by `runId` directly rather than through its strategy — this is a
@@ -4428,6 +4669,27 @@ declare const updateLiveParams: <ThrowOnError extends boolean = false>(options:
4428
4669
  *
4429
4670
  */
4430
4671
  declare const sendLiveCommand: <ThrowOnError extends boolean = false>(options: Options<SendLiveCommandData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveCommandResult, ResponseError, ThrowOnError>;
4672
+ /**
4673
+ * Revoke a run's stream URL
4674
+ * Revokes a run's stream URL **for good**: connections open on it are closed within about 15 seconds and it
4675
+ * answers `404` from then on. The run itself is not touched, and a stream cannot be added to it again; start
4676
+ * the run again with `stream: true` for a new URL. Owner only, and always allowed, whatever your plan or the
4677
+ * run's state. Repeating it is not an error.
4678
+ *
4679
+ */
4680
+ declare const revokeLiveStream: <ThrowOnError extends boolean = false>(options: Options<RevokeLiveStreamData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveStreamRevoked, ResponseError, ThrowOnError>;
4681
+ /**
4682
+ * Rotate a run's stream URL
4683
+ * Gives a run a **new** stream URL and retires the old one: connections open on the old URL are closed
4684
+ * within about 15 seconds and the old URL answers `404` from then on. Use it when the URL may have leaked.
4685
+ * Owner only, and only for a run that is running and was started with `stream: true` (the URL cannot be added
4686
+ * to a run later, and a revoked one cannot be brought back). The plan is checked again: a plan that may not
4687
+ * broadcast gets `429`.
4688
+ *
4689
+ * See the "Live execution" guide, "A plain WebSocket stream of a run".
4690
+ *
4691
+ */
4692
+ declare const rotateLiveStream: <ThrowOnError extends boolean = false>(options: Options<RotateLiveStreamData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveStreamUrl, ResponseError, ThrowOnError>;
4431
4693
  /**
4432
4694
  * Read a run's signals
4433
4695
  * Returns one page of the signals a run has already produced, newest-last, optionally from a
@@ -4502,4 +4764,4 @@ declare const mintLiveConnectionToken: <ThrowOnError extends boolean = false>(op
4502
4764
 
4503
4765
  declare const client: _hey_api_client_fetch.Client;
4504
4766
 
4505
- export { type AcceptedJob, type Account, type AccountLinks, type AccountUsage, type AccountUsageLinks, type AuthTokenError, type AuthTokenResponse, type AuthenticateData, type AuthenticateError, type AuthenticateErrors, type AuthenticateResponse, type AuthenticateResponses, type BacktestJobResult, type CancelBacktestData, type CancelBacktestError, type CancelBacktestErrors, type CancelBacktestResponse, type CancelBacktestResponses, type CancelSweepData, type CancelSweepError, type CancelSweepErrors, type CancelSweepResponse, type CancelSweepResponses, type ClientOptions, type CompileStrategyData, type CompileStrategyError, type CompileStrategyErrors, type CompileStrategyResponse, type CompileStrategyResponses, type CoverageWindow, type CreateDatasetData, type CreateDatasetError, type CreateDatasetErrors, type CreateDatasetResponse, type CreateDatasetResponses, type DataSourceType, type Dataset, type DatasetCreated, type DatasetImportCreated, type DatasetImportDexRequest, type DatasetImportRequest, type DatasetImportState, type DatasetUploadSession, type DatasetUploadState, type DatasetUploadTarget, type DatasetVersion, type DatasetWithLinks, type DeclaredProperty, type DeleteDatasetData, type DeleteDatasetError, type DeleteDatasetErrors, type DeleteDatasetResponse, type DeleteDatasetResponses, type DeleteStrategyData, type DeleteStrategyError, type DeleteStrategyErrors, type DeleteStrategyResponse, type DeleteStrategyResponses, type DownloadKlinesData, type DownloadKlinesError, type DownloadKlinesErrors, type DownloadKlinesResponse, type DownloadKlinesResponses, type DownloadTickersData, type DownloadTickersError, type DownloadTickersErrors, type DownloadTickersResponse, type DownloadTickersResponses, type EquityCurveMeta, type EquityCurveOptions, type EquityCurveOutMode, type EquityCurveRequest, type EquityCurveResult, type EquityPoint, type Exchange, type ExecuteBacktestData, type ExecuteBacktestError, type ExecuteBacktestErrors, type ExecuteBacktestResponse, type ExecuteBacktestResponses, type ExecuteSweepAccepted, type ExecuteSweepData, type ExecuteSweepError, type ExecuteSweepErrors, type ExecuteSweepRequest, type ExecuteSweepResponse, type ExecuteSweepResponses, type ExecuteSweepResult, type FinalizeDatasetUploadData, type FinalizeDatasetUploadError, type FinalizeDatasetUploadErrors, type FinalizeDatasetUploadResponse, type FinalizeDatasetUploadResponses, type GetAccountData, type GetAccountResponse, type GetAccountResponses, type GetAccountUsageData, type GetAccountUsageResponse, type GetAccountUsageResponses, type GetBacktestResultData, type GetBacktestResultError, type GetBacktestResultErrors, type GetBacktestResultResponse, type GetBacktestResultResponses, type GetDatasetData, type GetDatasetError, type GetDatasetErrors, type GetDatasetImportData, type GetDatasetImportError, type GetDatasetImportErrors, type GetDatasetImportResponse, type GetDatasetImportResponses, type GetDatasetResponse, type GetDatasetResponses, type GetDatasetUploadData, type GetDatasetUploadError, type GetDatasetUploadErrors, type GetDatasetUploadResponse, type GetDatasetUploadResponses, type GetLiveData, type GetLiveError, type GetLiveErrors, type GetLiveResponse, type GetLiveResponses, type GetLiveRunPaperData, type GetLiveRunPaperEquityData, type GetLiveRunPaperEquityError, type GetLiveRunPaperEquityErrors, type GetLiveRunPaperEquityResponse, type GetLiveRunPaperEquityResponses, type GetLiveRunPaperError, type GetLiveRunPaperErrors, type GetLiveRunPaperResponse, type GetLiveRunPaperResponses, type GetLiveRunSignalsData, type GetLiveRunSignalsError, type GetLiveRunSignalsErrors, type GetLiveRunSignalsResponse, type GetLiveRunSignalsResponses, type GetPrepareStatusData, type GetPrepareStatusError, type GetPrepareStatusErrors, type GetPrepareStatusResponse, type GetPrepareStatusResponses, type GetStrategyCodeData, type GetStrategyCodeError, type GetStrategyCodeErrors, type GetStrategyCodeResponse, type GetStrategyCodeResponses, type GetStrategyData, type GetStrategyError, type GetStrategyErrors, type GetStrategyResponse, type GetStrategyResponses, type GetSweepResultData, type GetSweepResultError, type GetSweepResultErrors, type GetSweepResultResponse, type GetSweepResultResponses, type GetSweepRunEquityCurveData, type GetSweepRunEquityCurveError, type GetSweepRunEquityCurveErrors, type GetSweepRunEquityCurveResponse, type GetSweepRunEquityCurveResponses, type GetSweepSensitivityData, type GetSweepSensitivityError, type GetSweepSensitivityErrors, type GetSweepSensitivityResponse, type GetSweepSensitivityResponses, type HalLink, type ImportDatasetData, type ImportDatasetError, type ImportDatasetErrors, type ImportDatasetResponse, type ImportDatasetResponses, type Instrument, type InstrumentCoverage, type InstrumentDetail, type InstrumentLinks, type InstrumentListMeta, type InstrumentListResponse, type JobState, type ListDatasetsData, type ListDatasetsResponse, type ListDatasetsResponses, type ListExchangesData, type ListExchangesResponse, type ListExchangesResponses, type ListInstrumentsData, type ListInstrumentsError, type ListInstrumentsErrors, type ListInstrumentsResponse, type ListInstrumentsResponses, type ListLiveData, type ListLiveError, type ListLiveErrors, type ListLiveResponse, type ListLiveResponses, type ListPublicLiveData, type ListPublicLiveError, type ListPublicLiveErrors, type ListPublicLiveResponse, type ListPublicLiveResponses, type ListSegmentInstrumentsData, type ListSegmentInstrumentsError, type ListSegmentInstrumentsErrors, type ListSegmentInstrumentsResponse, type ListSegmentInstrumentsResponses, type ListStrategiesData, type ListStrategiesResponse, type ListStrategiesResponses, type LiveCommandResult, type LiveConnectionToken, type LiveListResponse, type LivePaper, type LivePaperAccount, type LivePaperConfig, type LivePaperEquityPage, type LivePaperEquityPoint, type LivePaperKpi, type LivePaperPosition, type LiveParamsUpdateResult, type LiveRun, type LiveRunCompact, type LiveRunSummary, type LiveSignal, type LiveSignalInstrument, type LiveSignalOrder, type LiveSignalPage, type LiveSource, type MintLiveConnectionTokenData, type MintLiveConnectionTokenResponse, type MintLiveConnectionTokenResponses, type Notice, type OpenDatasetUploadData, type OpenDatasetUploadError, type OpenDatasetUploadErrors, type OpenDatasetUploadResponse, type OpenDatasetUploadResponses, type Options, type PrepareBacktestData, type PrepareBacktestError, type PrepareBacktestErrors, type PrepareBacktestResponse, type PrepareBacktestResponses, type PrepareJobState, type PrepareRequest, type PublicLiveListLinks, type PublicLiveListResponse, type PublicLiveNextLink, type PublicLiveRun, type ResponseError, type ResultMap, type ScalarStrategyParamValue, type SendLiveCommandData, type SendLiveCommandError, type SendLiveCommandErrors, type SendLiveCommandRequest, type SendLiveCommandResponse, type SendLiveCommandResponses, type StartLiveData, type StartLiveError, type StartLiveErrors, type StartLiveRequest, type StartLiveResponse, type StartLiveResponses, type StopLiveData, type StopLiveError, type StopLiveErrors, type StopLiveResponse, type StopLiveResponses, type StrategyId, type StrategyLinks, type StrategyState, type StrategySummary, type SweepAxis, type SweepBaseConfig, type SweepHeatmap, type SweepHeatmapCell, type SweepMarginal, type SweepMarginalPoint, type SweepProgress, type SweepRunRow, type SweepSensitivity, type SweepSpecRequest, type UpdateLiveData, type UpdateLiveError, type UpdateLiveErrors, type UpdateLiveParamsData, type UpdateLiveParamsError, type UpdateLiveParamsErrors, type UpdateLiveParamsRequest, type UpdateLiveParamsResponse, type UpdateLiveParamsResponses, type UpdateLiveRequest, type UpdateLiveResponse, type UpdateLiveResponses, type ValidateStrategyData, type ValidateStrategyError, type ValidateStrategyErrors, type ValidateStrategyResponse, type ValidateStrategyResponses, type WalkForwardAccepted, type WalkForwardFold, type WalkForwardRequest, type WalkForwardResult, authenticate, cancelBacktest, cancelSweep, client, compileStrategy, createDataset, deleteDataset, deleteStrategy, downloadKlines, downloadTickers, executeBacktest, executeSweep, finalizeDatasetUpload, getAccount, getAccountUsage, getBacktestResult, getDataset, getDatasetImport, getDatasetUpload, getLive, getLiveRunPaper, getLiveRunPaperEquity, getLiveRunSignals, getPrepareStatus, getStrategy, getStrategyCode, getSweepResult, getSweepRunEquityCurve, getSweepSensitivity, importDataset, listDatasets, listExchanges, listInstruments, listLive, listPublicLive, listSegmentInstruments, listStrategies, mintLiveConnectionToken, openDatasetUpload, prepareBacktest, sendLiveCommand, startLive, stopLive, updateLive, updateLiveParams, validateStrategy };
4767
+ export { type AcceptedJob, type Account, type AccountLinks, type AccountUsage, type AccountUsageLinks, type AuthTokenError, type AuthTokenResponse, type AuthenticateData, type AuthenticateError, type AuthenticateErrors, type AuthenticateResponse, type AuthenticateResponses, type BacktestJobResult, type CancelBacktestData, type CancelBacktestError, type CancelBacktestErrors, type CancelBacktestResponse, type CancelBacktestResponses, type CancelSweepData, type CancelSweepError, type CancelSweepErrors, type CancelSweepResponse, type CancelSweepResponses, type ClientOptions, type CompileStrategyData, type CompileStrategyError, type CompileStrategyErrors, type CompileStrategyResponse, type CompileStrategyResponses, type CoverageWindow, type CreateDatasetData, type CreateDatasetError, type CreateDatasetErrors, type CreateDatasetResponse, type CreateDatasetResponses, type DataSourceType, type Dataset, type DatasetCreated, type DatasetImportCreated, type DatasetImportDexRequest, type DatasetImportRequest, type DatasetImportState, type DatasetUploadSession, type DatasetUploadState, type DatasetUploadTarget, type DatasetVersion, type DatasetWithLinks, type DeclaredProperty, type DeleteDatasetData, type DeleteDatasetError, type DeleteDatasetErrors, type DeleteDatasetResponse, type DeleteDatasetResponses, type DeleteStrategyData, type DeleteStrategyError, type DeleteStrategyErrors, type DeleteStrategyResponse, type DeleteStrategyResponses, type DownloadKlinesData, type DownloadKlinesError, type DownloadKlinesErrors, type DownloadKlinesResponse, type DownloadKlinesResponses, type DownloadTickersData, type DownloadTickersError, type DownloadTickersErrors, type DownloadTickersResponse, type DownloadTickersResponses, type EquityCurveMeta, type EquityCurveOptions, type EquityCurveOutMode, type EquityCurveRequest, type EquityCurveResult, type EquityPoint, type Exchange, type ExecuteBacktestData, type ExecuteBacktestError, type ExecuteBacktestErrors, type ExecuteBacktestResponse, type ExecuteBacktestResponses, type ExecuteSweepAccepted, type ExecuteSweepData, type ExecuteSweepError, type ExecuteSweepErrors, type ExecuteSweepRequest, type ExecuteSweepResponse, type ExecuteSweepResponses, type ExecuteSweepResult, type FinalizeDatasetUploadData, type FinalizeDatasetUploadError, type FinalizeDatasetUploadErrors, type FinalizeDatasetUploadResponse, type FinalizeDatasetUploadResponses, type GetAccountData, type GetAccountResponse, type GetAccountResponses, type GetAccountUsageData, type GetAccountUsageResponse, type GetAccountUsageResponses, type GetBacktestResultData, type GetBacktestResultError, type GetBacktestResultErrors, type GetBacktestResultResponse, type GetBacktestResultResponses, type GetDatasetData, type GetDatasetError, type GetDatasetErrors, type GetDatasetImportData, type GetDatasetImportError, type GetDatasetImportErrors, type GetDatasetImportResponse, type GetDatasetImportResponses, type GetDatasetResponse, type GetDatasetResponses, type GetDatasetUploadData, type GetDatasetUploadError, type GetDatasetUploadErrors, type GetDatasetUploadResponse, type GetDatasetUploadResponses, type GetLiveData, type GetLiveError, type GetLiveErrors, type GetLiveResponse, type GetLiveResponses, type GetLiveRunData, type GetLiveRunError, type GetLiveRunErrors, type GetLiveRunPaperData, type GetLiveRunPaperEquityData, type GetLiveRunPaperEquityError, type GetLiveRunPaperEquityErrors, type GetLiveRunPaperEquityResponse, type GetLiveRunPaperEquityResponses, type GetLiveRunPaperError, type GetLiveRunPaperErrors, type GetLiveRunPaperResponse, type GetLiveRunPaperResponses, type GetLiveRunResponse, type GetLiveRunResponses, type GetLiveRunSignalsData, type GetLiveRunSignalsError, type GetLiveRunSignalsErrors, type GetLiveRunSignalsResponse, type GetLiveRunSignalsResponses, type GetPrepareStatusData, type GetPrepareStatusError, type GetPrepareStatusErrors, type GetPrepareStatusResponse, type GetPrepareStatusResponses, type GetStrategyCodeData, type GetStrategyCodeError, type GetStrategyCodeErrors, type GetStrategyCodeResponse, type GetStrategyCodeResponses, type GetStrategyData, type GetStrategyError, type GetStrategyErrors, type GetStrategyResponse, type GetStrategyResponses, type GetSweepResultData, type GetSweepResultError, type GetSweepResultErrors, type GetSweepResultResponse, type GetSweepResultResponses, type GetSweepRunEquityCurveData, type GetSweepRunEquityCurveError, type GetSweepRunEquityCurveErrors, type GetSweepRunEquityCurveResponse, type GetSweepRunEquityCurveResponses, type GetSweepSensitivityData, type GetSweepSensitivityError, type GetSweepSensitivityErrors, type GetSweepSensitivityResponse, type GetSweepSensitivityResponses, type HalLink, type ImportDatasetData, type ImportDatasetError, type ImportDatasetErrors, type ImportDatasetResponse, type ImportDatasetResponses, type Instrument, type InstrumentCoverage, type InstrumentDetail, type InstrumentLinks, type InstrumentListMeta, type InstrumentListResponse, type JobState, type ListDatasetsData, type ListDatasetsResponse, type ListDatasetsResponses, type ListExchangesData, type ListExchangesResponse, type ListExchangesResponses, type ListInstrumentsData, type ListInstrumentsError, type ListInstrumentsErrors, type ListInstrumentsResponse, type ListInstrumentsResponses, type ListLiveData, type ListLiveError, type ListLiveErrors, type ListLiveResponse, type ListLiveResponses, type ListPublicLiveData, type ListPublicLiveError, type ListPublicLiveErrors, type ListPublicLiveResponse, type ListPublicLiveResponses, type ListSegmentInstrumentsData, type ListSegmentInstrumentsError, type ListSegmentInstrumentsErrors, type ListSegmentInstrumentsResponse, type ListSegmentInstrumentsResponses, type ListStrategiesData, type ListStrategiesResponse, type ListStrategiesResponses, type LiveCommandResult, type LiveConnectionToken, type LiveListResponse, type LivePaper, type LivePaperAccount, type LivePaperConfig, type LivePaperEquityPage, type LivePaperEquityPoint, type LivePaperKpi, type LivePaperPosition, type LiveParamsUpdateResult, type LiveRun, type LiveRunCompact, type LiveRunDetail, type LiveRunStats, type LiveRunSummary, type LiveRunWithStream, type LiveSignal, type LiveSignalInstrument, type LiveSignalOrder, type LiveSignalPage, type LiveSource, type LiveStreamRevoked, type LiveStreamUrl, type MintLiveConnectionTokenData, type MintLiveConnectionTokenResponse, type MintLiveConnectionTokenResponses, type Notice, type OpenDatasetUploadData, type OpenDatasetUploadError, type OpenDatasetUploadErrors, type OpenDatasetUploadResponse, type OpenDatasetUploadResponses, type Options, type PrepareBacktestData, type PrepareBacktestError, type PrepareBacktestErrors, type PrepareBacktestResponse, type PrepareBacktestResponses, type PrepareJobState, type PrepareRequest, type PublicLiveListLinks, type PublicLiveListResponse, type PublicLiveNextLink, type PublicLiveRun, type ResponseError, type ResultMap, type RevokeLiveStreamData, type RevokeLiveStreamError, type RevokeLiveStreamErrors, type RevokeLiveStreamResponse, type RevokeLiveStreamResponses, type RotateLiveStreamData, type RotateLiveStreamError, type RotateLiveStreamErrors, type RotateLiveStreamResponse, type RotateLiveStreamResponses, type ScalarStrategyParamValue, type SendLiveCommandData, type SendLiveCommandError, type SendLiveCommandErrors, type SendLiveCommandRequest, type SendLiveCommandResponse, type SendLiveCommandResponses, type StartLiveData, type StartLiveError, type StartLiveErrors, type StartLiveRequest, type StartLiveResponse, type StartLiveResponses, type StopLiveData, type StopLiveError, type StopLiveErrors, type StopLiveResponse, type StopLiveResponses, type StrategyId, type StrategyLinks, type StrategyState, type StrategySummary, type SweepAxis, type SweepBaseConfig, type SweepHeatmap, type SweepHeatmapCell, type SweepMarginal, type SweepMarginalPoint, type SweepProgress, type SweepRunRow, type SweepSensitivity, type SweepSpecRequest, type UpdateLiveData, type UpdateLiveError, type UpdateLiveErrors, type UpdateLiveParamsData, type UpdateLiveParamsError, type UpdateLiveParamsErrors, type UpdateLiveParamsRequest, type UpdateLiveParamsResponse, type UpdateLiveParamsResponses, type UpdateLiveRequest, type UpdateLiveResponse, type UpdateLiveResponses, type ValidateStrategyData, type ValidateStrategyError, type ValidateStrategyErrors, type ValidateStrategyResponse, type ValidateStrategyResponses, type WalkForwardAccepted, type WalkForwardFold, type WalkForwardRequest, type WalkForwardResult, type WarmFrom, authenticate, cancelBacktest, cancelSweep, client, compileStrategy, createDataset, deleteDataset, deleteStrategy, downloadKlines, downloadTickers, executeBacktest, executeSweep, finalizeDatasetUpload, getAccount, getAccountUsage, getBacktestResult, getDataset, getDatasetImport, getDatasetUpload, getLive, getLiveRun, getLiveRunPaper, getLiveRunPaperEquity, getLiveRunSignals, getPrepareStatus, getStrategy, getStrategyCode, getSweepResult, getSweepRunEquityCurve, getSweepSensitivity, importDataset, listDatasets, listExchanges, listInstruments, listLive, listPublicLive, listSegmentInstruments, listStrategies, mintLiveConnectionToken, openDatasetUpload, prepareBacktest, revokeLiveStream, rotateLiveStream, sendLiveCommand, startLive, stopLive, updateLive, updateLiveParams, validateStrategy };
package/dist/index.js CHANGED
@@ -459,6 +459,18 @@ var listPublicLive = (options) => {
459
459
  ...options
460
460
  });
461
461
  };
462
+ var getLiveRun = (options) => {
463
+ return (options.client ?? client).get({
464
+ security: [
465
+ {
466
+ scheme: "bearer",
467
+ type: "http"
468
+ }
469
+ ],
470
+ url: "/live/{runId}",
471
+ ...options
472
+ });
473
+ };
462
474
  var updateLive = (options) => {
463
475
  return (options.client ?? client).patch({
464
476
  security: [
@@ -507,6 +519,30 @@ var sendLiveCommand = (options) => {
507
519
  }
508
520
  });
509
521
  };
522
+ var revokeLiveStream = (options) => {
523
+ return (options.client ?? client).delete({
524
+ security: [
525
+ {
526
+ scheme: "bearer",
527
+ type: "http"
528
+ }
529
+ ],
530
+ url: "/live/{runId}/stream",
531
+ ...options
532
+ });
533
+ };
534
+ var rotateLiveStream = (options) => {
535
+ return (options.client ?? client).post({
536
+ security: [
537
+ {
538
+ scheme: "bearer",
539
+ type: "http"
540
+ }
541
+ ],
542
+ url: "/live/{runId}/stream",
543
+ ...options
544
+ });
545
+ };
510
546
  var getLiveRunSignals = (options) => {
511
547
  return (options.client ?? client).get({
512
548
  security: [
@@ -576,6 +612,7 @@ export {
576
612
  getDatasetImport,
577
613
  getDatasetUpload,
578
614
  getLive,
615
+ getLiveRun,
579
616
  getLiveRunPaper,
580
617
  getLiveRunPaperEquity,
581
618
  getLiveRunSignals,
@@ -596,6 +633,8 @@ export {
596
633
  mintLiveConnectionToken,
597
634
  openDatasetUpload,
598
635
  prepareBacktest,
636
+ revokeLiveStream,
637
+ rotateLiveStream,
599
638
  sendLiveCommand,
600
639
  startLive,
601
640
  stopLive,