@invinite-org/data-api-client 6.1.0 → 6.3.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.
Files changed (224) hide show
  1. package/.openapi-generator/FILES +52 -0
  2. package/dist/apis/FilingsApi.d.ts +2 -2
  3. package/dist/apis/FilingsApi.js +2 -2
  4. package/dist/apis/ReferenceApi.d.ts +4 -4
  5. package/dist/apis/ReferenceApi.js +4 -4
  6. package/dist/apis/ScriptsApi.d.ts +148 -0
  7. package/dist/apis/ScriptsApi.js +396 -0
  8. package/dist/apis/index.d.ts +1 -0
  9. package/dist/apis/index.js +1 -0
  10. package/dist/esm/apis/FilingsApi.d.ts +2 -2
  11. package/dist/esm/apis/FilingsApi.js +2 -2
  12. package/dist/esm/apis/ReferenceApi.d.ts +4 -4
  13. package/dist/esm/apis/ReferenceApi.js +4 -4
  14. package/dist/esm/apis/ScriptsApi.d.ts +148 -0
  15. package/dist/esm/apis/ScriptsApi.js +392 -0
  16. package/dist/esm/apis/index.d.ts +1 -0
  17. package/dist/esm/apis/index.js +1 -0
  18. package/dist/esm/models/Alert.d.ts +6 -0
  19. package/dist/esm/models/Alert.js +4 -0
  20. package/dist/esm/models/AlertCondition.d.ts +62 -6
  21. package/dist/esm/models/AlertCondition.js +27 -1
  22. package/dist/esm/models/AlertConditionInput.d.ts +55 -6
  23. package/dist/esm/models/AlertConditionInput.js +24 -1
  24. package/dist/esm/models/AlertTemplate.d.ts +83 -0
  25. package/dist/esm/models/AlertTemplate.js +79 -0
  26. package/dist/esm/models/AlertTemplateInput.d.ts +78 -0
  27. package/dist/esm/models/AlertTemplateInput.js +70 -0
  28. package/dist/esm/models/AlertTrigger.d.ts +1 -1
  29. package/dist/esm/models/AlertTriggerInput.d.ts +1 -1
  30. package/dist/esm/models/Company.d.ts +8 -8
  31. package/dist/esm/models/CompanyListItem.d.ts +1 -1
  32. package/dist/esm/models/CompanyRef.d.ts +1 -1
  33. package/dist/esm/models/CreateScriptRequest.d.ts +44 -0
  34. package/dist/esm/models/CreateScriptRequest.js +49 -0
  35. package/dist/esm/models/CreateScriptVersionRequest.d.ts +32 -0
  36. package/dist/esm/models/CreateScriptVersionRequest.js +43 -0
  37. package/dist/esm/models/IndicatorCondition.d.ts +56 -0
  38. package/dist/esm/models/IndicatorCondition.js +62 -0
  39. package/dist/esm/models/IndicatorConditionInput.d.ts +56 -0
  40. package/dist/esm/models/IndicatorConditionInput.js +62 -0
  41. package/dist/esm/models/IndicatorFilterChild.d.ts +68 -0
  42. package/dist/esm/models/IndicatorFilterChild.js +65 -0
  43. package/dist/esm/models/IndicatorFilterChildInput.d.ts +68 -0
  44. package/dist/esm/models/IndicatorFilterChildInput.js +65 -0
  45. package/dist/esm/models/IndicatorFilterCondition.d.ts +73 -0
  46. package/dist/esm/models/IndicatorFilterCondition.js +74 -0
  47. package/dist/esm/models/IndicatorFilterConditionInput.d.ts +73 -0
  48. package/dist/esm/models/IndicatorFilterConditionInput.js +74 -0
  49. package/dist/esm/models/IndicatorFilterLeaf.d.ts +46 -0
  50. package/dist/esm/models/IndicatorFilterLeaf.js +54 -0
  51. package/dist/esm/models/IndicatorFilterLeafInput.d.ts +46 -0
  52. package/dist/esm/models/IndicatorFilterLeafInput.js +56 -0
  53. package/dist/esm/models/IndicatorFilters.d.ts +47 -0
  54. package/dist/esm/models/IndicatorFilters.js +55 -0
  55. package/dist/esm/models/IndicatorFiltersInput.d.ts +47 -0
  56. package/dist/esm/models/IndicatorFiltersInput.js +55 -0
  57. package/dist/esm/models/IndicatorOperand.d.ts +91 -0
  58. package/dist/esm/models/IndicatorOperand.js +74 -0
  59. package/dist/esm/models/IndicatorOperandInput.d.ts +91 -0
  60. package/dist/esm/models/IndicatorOperandInput.js +74 -0
  61. package/dist/esm/models/IndicatorResolved.d.ts +67 -0
  62. package/dist/esm/models/IndicatorResolved.js +65 -0
  63. package/dist/esm/models/IndicatorResolvedThreshold.d.ts +47 -0
  64. package/dist/esm/models/IndicatorResolvedThreshold.js +55 -0
  65. package/dist/esm/models/IndicatorTemplateRef.d.ts +46 -0
  66. package/dist/esm/models/IndicatorTemplateRef.js +47 -0
  67. package/dist/esm/models/ListAlertTemplates200Response.d.ts +52 -0
  68. package/dist/esm/models/ListAlertTemplates200Response.js +57 -0
  69. package/dist/esm/models/ListScriptVersions200Response.d.ts +52 -0
  70. package/dist/esm/models/ListScriptVersions200Response.js +57 -0
  71. package/dist/esm/models/ListScripts200Response.d.ts +52 -0
  72. package/dist/esm/models/ListScripts200Response.js +57 -0
  73. package/dist/esm/models/Script.d.ts +69 -0
  74. package/dist/esm/models/Script.js +68 -0
  75. package/dist/esm/models/ScriptDiagnostic.d.ts +64 -0
  76. package/dist/esm/models/ScriptDiagnostic.js +66 -0
  77. package/dist/esm/models/ScriptVersion.d.ts +103 -0
  78. package/dist/esm/models/ScriptVersion.js +91 -0
  79. package/dist/esm/models/index.d.ts +25 -0
  80. package/dist/esm/models/index.js +25 -0
  81. package/dist/models/Alert.d.ts +6 -0
  82. package/dist/models/Alert.js +4 -0
  83. package/dist/models/AlertCondition.d.ts +62 -6
  84. package/dist/models/AlertCondition.js +27 -1
  85. package/dist/models/AlertConditionInput.d.ts +55 -6
  86. package/dist/models/AlertConditionInput.js +24 -1
  87. package/dist/models/AlertTemplate.d.ts +83 -0
  88. package/dist/models/AlertTemplate.js +87 -0
  89. package/dist/models/AlertTemplateInput.d.ts +78 -0
  90. package/dist/models/AlertTemplateInput.js +78 -0
  91. package/dist/models/AlertTrigger.d.ts +1 -1
  92. package/dist/models/AlertTriggerInput.d.ts +1 -1
  93. package/dist/models/Company.d.ts +8 -8
  94. package/dist/models/CompanyListItem.d.ts +1 -1
  95. package/dist/models/CompanyRef.d.ts +1 -1
  96. package/dist/models/CreateScriptRequest.d.ts +44 -0
  97. package/dist/models/CreateScriptRequest.js +56 -0
  98. package/dist/models/CreateScriptVersionRequest.d.ts +32 -0
  99. package/dist/models/CreateScriptVersionRequest.js +50 -0
  100. package/dist/models/IndicatorCondition.d.ts +56 -0
  101. package/dist/models/IndicatorCondition.js +70 -0
  102. package/dist/models/IndicatorConditionInput.d.ts +56 -0
  103. package/dist/models/IndicatorConditionInput.js +70 -0
  104. package/dist/models/IndicatorFilterChild.d.ts +68 -0
  105. package/dist/models/IndicatorFilterChild.js +73 -0
  106. package/dist/models/IndicatorFilterChildInput.d.ts +68 -0
  107. package/dist/models/IndicatorFilterChildInput.js +73 -0
  108. package/dist/models/IndicatorFilterCondition.d.ts +73 -0
  109. package/dist/models/IndicatorFilterCondition.js +82 -0
  110. package/dist/models/IndicatorFilterConditionInput.d.ts +73 -0
  111. package/dist/models/IndicatorFilterConditionInput.js +82 -0
  112. package/dist/models/IndicatorFilterLeaf.d.ts +46 -0
  113. package/dist/models/IndicatorFilterLeaf.js +62 -0
  114. package/dist/models/IndicatorFilterLeafInput.d.ts +46 -0
  115. package/dist/models/IndicatorFilterLeafInput.js +64 -0
  116. package/dist/models/IndicatorFilters.d.ts +47 -0
  117. package/dist/models/IndicatorFilters.js +63 -0
  118. package/dist/models/IndicatorFiltersInput.d.ts +47 -0
  119. package/dist/models/IndicatorFiltersInput.js +63 -0
  120. package/dist/models/IndicatorOperand.d.ts +91 -0
  121. package/dist/models/IndicatorOperand.js +82 -0
  122. package/dist/models/IndicatorOperandInput.d.ts +91 -0
  123. package/dist/models/IndicatorOperandInput.js +82 -0
  124. package/dist/models/IndicatorResolved.d.ts +67 -0
  125. package/dist/models/IndicatorResolved.js +73 -0
  126. package/dist/models/IndicatorResolvedThreshold.d.ts +47 -0
  127. package/dist/models/IndicatorResolvedThreshold.js +63 -0
  128. package/dist/models/IndicatorTemplateRef.d.ts +46 -0
  129. package/dist/models/IndicatorTemplateRef.js +54 -0
  130. package/dist/models/ListAlertTemplates200Response.d.ts +52 -0
  131. package/dist/models/ListAlertTemplates200Response.js +64 -0
  132. package/dist/models/ListScriptVersions200Response.d.ts +52 -0
  133. package/dist/models/ListScriptVersions200Response.js +64 -0
  134. package/dist/models/ListScripts200Response.d.ts +52 -0
  135. package/dist/models/ListScripts200Response.js +64 -0
  136. package/dist/models/Script.d.ts +69 -0
  137. package/dist/models/Script.js +75 -0
  138. package/dist/models/ScriptDiagnostic.d.ts +64 -0
  139. package/dist/models/ScriptDiagnostic.js +74 -0
  140. package/dist/models/ScriptVersion.d.ts +103 -0
  141. package/dist/models/ScriptVersion.js +99 -0
  142. package/dist/models/index.d.ts +25 -0
  143. package/dist/models/index.js +25 -0
  144. package/docs/Alert.md +2 -0
  145. package/docs/AlertCondition.md +15 -1
  146. package/docs/AlertConditionInput.md +13 -1
  147. package/docs/AlertTemplate.md +49 -0
  148. package/docs/AlertTemplateInput.md +47 -0
  149. package/docs/CompaniesApi.md +2 -2
  150. package/docs/CreateScriptRequest.md +38 -0
  151. package/docs/CreateScriptVersionRequest.md +34 -0
  152. package/docs/EventsApi.md +2 -2
  153. package/docs/FilingsApi.md +5 -5
  154. package/docs/FinancialsApi.md +12 -12
  155. package/docs/GuidanceApi.md +4 -4
  156. package/docs/HoldingsApi.md +6 -6
  157. package/docs/IPOsApi.md +2 -2
  158. package/docs/IndicatorCondition.md +39 -0
  159. package/docs/IndicatorConditionInput.md +39 -0
  160. package/docs/IndicatorFilterChild.md +41 -0
  161. package/docs/IndicatorFilterChildInput.md +41 -0
  162. package/docs/IndicatorFilterCondition.md +41 -0
  163. package/docs/IndicatorFilterConditionInput.md +41 -0
  164. package/docs/IndicatorFilterLeaf.md +37 -0
  165. package/docs/IndicatorFilterLeafInput.md +37 -0
  166. package/docs/IndicatorFilters.md +37 -0
  167. package/docs/IndicatorFiltersInput.md +37 -0
  168. package/docs/IndicatorOperand.md +47 -0
  169. package/docs/IndicatorOperandInput.md +47 -0
  170. package/docs/IndicatorResolved.md +43 -0
  171. package/docs/IndicatorResolvedThreshold.md +37 -0
  172. package/docs/IndicatorTemplateRef.md +39 -0
  173. package/docs/InsiderTradesApi.md +2 -2
  174. package/docs/InvestorDocumentsApi.md +4 -4
  175. package/docs/ListAlertTemplates200Response.md +41 -0
  176. package/docs/ListScriptVersions200Response.md +41 -0
  177. package/docs/ListScripts200Response.md +41 -0
  178. package/docs/MetricsApi.md +10 -10
  179. package/docs/NewsApi.md +6 -6
  180. package/docs/ReferenceApi.md +8 -8
  181. package/docs/Script.md +46 -0
  182. package/docs/ScriptDiagnostic.md +42 -0
  183. package/docs/ScriptVersion.md +54 -0
  184. package/docs/ScriptsApi.md +588 -0
  185. package/docs/TranscriptsApi.md +2 -2
  186. package/package.json +1 -1
  187. package/src/apis/FilingsApi.ts +2 -2
  188. package/src/apis/ReferenceApi.ts +4 -4
  189. package/src/apis/ScriptsApi.ts +504 -0
  190. package/src/apis/index.ts +1 -0
  191. package/src/models/Alert.ts +9 -0
  192. package/src/models/AlertCondition.ts +99 -7
  193. package/src/models/AlertConditionInput.ts +84 -7
  194. package/src/models/AlertTemplate.ts +148 -0
  195. package/src/models/AlertTemplateInput.ts +130 -0
  196. package/src/models/AlertTrigger.ts +1 -1
  197. package/src/models/AlertTriggerInput.ts +1 -1
  198. package/src/models/Company.ts +8 -8
  199. package/src/models/CompanyListItem.ts +1 -1
  200. package/src/models/CompanyRef.ts +1 -1
  201. package/src/models/CreateScriptRequest.ts +83 -0
  202. package/src/models/CreateScriptVersionRequest.ts +66 -0
  203. package/src/models/IndicatorCondition.ts +106 -0
  204. package/src/models/IndicatorConditionInput.ts +106 -0
  205. package/src/models/IndicatorFilterChild.ts +125 -0
  206. package/src/models/IndicatorFilterChildInput.ts +125 -0
  207. package/src/models/IndicatorFilterCondition.ts +126 -0
  208. package/src/models/IndicatorFilterConditionInput.ts +126 -0
  209. package/src/models/IndicatorFilterLeaf.ts +93 -0
  210. package/src/models/IndicatorFilterLeafInput.ts +95 -0
  211. package/src/models/IndicatorFilters.ts +94 -0
  212. package/src/models/IndicatorFiltersInput.ts +94 -0
  213. package/src/models/IndicatorOperand.ts +139 -0
  214. package/src/models/IndicatorOperandInput.ts +139 -0
  215. package/src/models/IndicatorResolved.ts +120 -0
  216. package/src/models/IndicatorResolvedThreshold.ts +87 -0
  217. package/src/models/IndicatorTemplateRef.ts +82 -0
  218. package/src/models/ListAlertTemplates200Response.ts +108 -0
  219. package/src/models/ListScriptVersions200Response.ts +108 -0
  220. package/src/models/ListScripts200Response.ts +108 -0
  221. package/src/models/Script.ts +128 -0
  222. package/src/models/ScriptDiagnostic.ts +113 -0
  223. package/src/models/ScriptVersion.ts +175 -0
  224. package/src/models/index.ts +25 -0
@@ -0,0 +1,504 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Invinite API
5
+ * Invinite financial data API. Each operation has a base credit cost: `x-credits` is the base cost; responses add 1 credit per started 1,000 rows beyond the first 1,000; `X-Credits-Charged` reports the final debit and `X-Credits-Remaining` what is left of the plan\'s included credits after it. A `304 Not Modified` costs nothing. `GET /v1/me/usage` returns your account\'s usage by day, product family and key (it costs no credits). **Coverage.** Financial data covers US SEC registrants and their US listings; a symbol that is not a US SEC registrant (or a crypto pair such as `X:BTCUSD`) is not a known company and answers 404. A known company with no data in a family (for example no statements yet) answers 404 with `code: not_covered`; an empty page of a covered company stays 200 with an empty list. `GET /v1/companies` lists every known company. ## Webhooks Alerts (`POST /v1/alerts`) deliver their events to your destinations (`POST /v1/destinations`) as [Standard Webhooks](https://github.com/standard-webhooks/standard-webhooks/blob/main/spec/standard-webhooks.md): `alert.fired`, `alert.fired.batch`, `alert.status_changed`, `destination.disabled`, `destination.test`, `account.fire_cap_reached`; see `x-webhooks` for each `data` object. Every event is also on the pull feed `GET /v1/alert-events`. Every delivery is a `POST` with `Content-Type: application/json`, the body `{type, timestamp, data}` (or the destination\'s `body_template`) and the headers `webhook-id` (the event id; a batch: its `bat_…` id), `webhook-timestamp` (unix seconds) and `webhook-signature`: space-separated `v1,<base64 HMAC-SHA256 of <webhook-id>.<webhook-timestamp>.<raw body>>`, keyed with the base64-DECODED bytes of the destination\'s `whsec_…` secret — any Standard Webhooks library verifies it. After `POST /v1/destinations/{id}:rotate-secret` the old secret keeps signing beside the new one for 24 h (two `v1` entries). Reject a timestamp older than 5 minutes. Any 2xx within 10 s acknowledges; redirects are not followed; a body above 256 KB is not sent. A failed attempt is retried after [0, 5 s, 5 min, 30 min, 2 h, 5 h, 10 h, 10 h, 10 h, 34 h] (attempt n waits the n-th step) plus up to 10 % jitter; the delivery is dead after attempt 10. A 410 disables the destination at once; so do 72 h of nothing but failures with at least 10 failed attempts in a row (a `destination.disabled` event on the feed and a mail; `PATCH` with `status: active` re-enables it). Delivery is at-least-once and unordered: dedupe on `webhook-id`, order by `timestamp`. A `batch_webhook` destination receives `alert.fired.batch` with the pending events in `data.events[]` (dedupe on each `data.event_id`). Fires and deliveries cost no credits; two fair-use caps apply instead: at most 60 fires per alert per rolling hour (beyond: suppressed and counted in the next fire\'s `suppressed_since_last`) and per account and UTC day FREE 100 · LITE 5,000 · STANDARD 50,000 · PRO 500,000 fires (beyond: written to the feed with `delivery_skipped: fire_cap`, not delivered; one `account.fire_cap_reached` per day). ## Licensing | Tier | display | redistribute | rag | train | audio | resell | | --- | --- | --- | --- | --- | --- | --- | | FREE | ✓ | – | – | – | – | – | | LITE | ✓ | – | – | – | – | – | | STANDARD | ✓ | – | ✓ | – | – | – | | PRO | ✓ | ✓ | ✓ | – | ✓ | – | Invinite data may be shown and, from PRO, redistributed inside the licensee\'s own product with attribution (\"Source: Invinite\" on screen or in the API response that carries it). It may never be resold, relicensed, white-labelled or offered as a data feed as the licensee\'s own data, at any tier, under any contract. Policy version: 2026-10-draft. Draft — pending counsel sign-off. Audio files carry a forensic watermark that identifies the recording. Audio is subject to per-company takedown and may not be re-hosted. SEC data: Figures and filings originate from SEC EDGAR; the standardisation, mapping and derived metrics are Invinite\'s. News: News text is Invinite\'s own summary of the issuer\'s or the SEC\'s publication (the publisher\'s text and media are never served); the licensee shows the attribution (publisher, source URL and date) next to it; the resale rule applies. PDF documents: Branded PDFs of transcripts and news items are permanent URLs to one shared file per version. They may be shown, downloaded and forwarded unmodified with the notice page intact; the resale rule applies unchanged. News PDFs carry Invinite\'s summary of the issuer\'s or the SEC\'s publication under the attribution stated on their notice page; a PDF disappears when the item is taken down or its source\'s reuse is denied. Every `/v1/_*` data operation carries `x-license`, the minimum use right its data ships with; `GET /status/licensing` serves the same matrix per route, rendered at [data.invinite.com/docs/licensing](https://data.invinite.com/docs/licensing). `/v1/me` and `/v1/me/usage` serve no licensed data and carry none. ## Status [`/status`](/status) reports whether each product family works (a status and its uptime over 7, 30 and 90 days); [`/status/licensing`](/status/licensing) serves the licensing matrix per route. The status routes need no API key and are cached for 5 minutes. The public status page is [status.data.invinite.com](https://status.data.invinite.com): a snapshot of `/status` every 15 minutes plus an external reachability probe of the API. Uptime is the share of requests answered without a server error, measured by the API per product family; a window with too little traffic to judge shows no figure. Status reflects the last 24 hours. Product families: Company, Financials, SEC Filings, Insider Trades, Institutional Ownership, IPOs, Market, Metadata, Earnings Calls, News, WebSocket, Account, Alerts.
6
+ *
7
+ * The version of the OpenAPI document: 2026-11-13
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import * as runtime from '../runtime';
16
+ import {
17
+ type CreateScriptRequest,
18
+ CreateScriptRequestFromJSON,
19
+ CreateScriptRequestToJSON,
20
+ } from '../models/CreateScriptRequest';
21
+ import {
22
+ type CreateScriptVersionRequest,
23
+ CreateScriptVersionRequestFromJSON,
24
+ CreateScriptVersionRequestToJSON,
25
+ } from '../models/CreateScriptVersionRequest';
26
+ import {
27
+ type ListAlertTemplates200Response,
28
+ ListAlertTemplates200ResponseFromJSON,
29
+ ListAlertTemplates200ResponseToJSON,
30
+ } from '../models/ListAlertTemplates200Response';
31
+ import {
32
+ type ListScriptVersions200Response,
33
+ ListScriptVersions200ResponseFromJSON,
34
+ ListScriptVersions200ResponseToJSON,
35
+ } from '../models/ListScriptVersions200Response';
36
+ import {
37
+ type ListScripts200Response,
38
+ ListScripts200ResponseFromJSON,
39
+ ListScripts200ResponseToJSON,
40
+ } from '../models/ListScripts200Response';
41
+ import {
42
+ type Problem,
43
+ ProblemFromJSON,
44
+ ProblemToJSON,
45
+ } from '../models/Problem';
46
+ import {
47
+ type Script,
48
+ ScriptFromJSON,
49
+ ScriptToJSON,
50
+ } from '../models/Script';
51
+ import {
52
+ type ScriptVersion,
53
+ ScriptVersionFromJSON,
54
+ ScriptVersionToJSON,
55
+ } from '../models/ScriptVersion';
56
+
57
+ export interface CreateScriptOperationRequest {
58
+ createScriptRequest: CreateScriptRequest;
59
+ }
60
+
61
+ export interface CreateScriptVersionOperationRequest {
62
+ id: string;
63
+ createScriptVersionRequest: CreateScriptVersionRequest;
64
+ }
65
+
66
+ export interface DeleteScriptRequest {
67
+ id: string;
68
+ }
69
+
70
+ export interface GetScriptRequest {
71
+ id: string;
72
+ }
73
+
74
+ export interface ListAlertTemplatesRequest {
75
+ limit?: number;
76
+ cursor?: string;
77
+ }
78
+
79
+ export interface ListScriptVersionsRequest {
80
+ id: string;
81
+ limit?: number;
82
+ cursor?: string;
83
+ }
84
+
85
+ export interface ListScriptsRequest {
86
+ limit?: number;
87
+ cursor?: string;
88
+ }
89
+
90
+ /**
91
+ *
92
+ */
93
+ export class ScriptsApi extends runtime.BaseAPI {
94
+
95
+ /**
96
+ * Creates request options for createScript without sending the request
97
+ */
98
+ async createScriptRequestOpts(requestParameters: CreateScriptOperationRequest): Promise<runtime.RequestOpts> {
99
+ if (requestParameters['createScriptRequest'] == null) {
100
+ throw new runtime.RequiredError(
101
+ 'createScriptRequest',
102
+ 'Required parameter "createScriptRequest" was null or undefined when calling createScript().'
103
+ );
104
+ }
105
+
106
+ const queryParameters: any = {};
107
+
108
+ const headerParameters: runtime.HTTPHeaders = {};
109
+
110
+ headerParameters['Content-Type'] = 'application/json';
111
+
112
+ if (this.configuration && this.configuration.accessToken) {
113
+ const token = this.configuration.accessToken;
114
+ const tokenString = await token("bearerAuth", []);
115
+
116
+ if (tokenString) {
117
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
118
+ }
119
+ }
120
+
121
+ let urlPath = `/v1/scripts`;
122
+
123
+ return {
124
+ path: urlPath,
125
+ method: 'POST',
126
+ headers: headerParameters,
127
+ query: queryParameters,
128
+ body: CreateScriptRequestToJSON(requestParameters['createScriptRequest']),
129
+ };
130
+ }
131
+
132
+ /**
133
+ * Creates the script and its version 1, compiled server-side (≤ 10 s, one compile per account at a time — a second concurrent upload answers 429 with Retry-After; a busy compiler 503 with Retry-After). A compile error is still a 201: the version has `status: error` and `diagnostics` (line, column, message). Answers 503 `unavailable` while hosted scripts are switched off.
134
+ * Upload a script
135
+ */
136
+ async createScriptRaw(requestParameters: CreateScriptOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Script>> {
137
+ const requestOptions = await this.createScriptRequestOpts(requestParameters);
138
+ const response = await this.request(requestOptions, initOverrides);
139
+
140
+ return new runtime.JSONApiResponse(response, (jsonValue) => ScriptFromJSON(jsonValue));
141
+ }
142
+
143
+ /**
144
+ * Creates the script and its version 1, compiled server-side (≤ 10 s, one compile per account at a time — a second concurrent upload answers 429 with Retry-After; a busy compiler 503 with Retry-After). A compile error is still a 201: the version has `status: error` and `diagnostics` (line, column, message). Answers 503 `unavailable` while hosted scripts are switched off.
145
+ * Upload a script
146
+ */
147
+ async createScript(requestParameters: CreateScriptOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Script> {
148
+ const response = await this.createScriptRaw(requestParameters, initOverrides);
149
+ return await response.value();
150
+ }
151
+
152
+ /**
153
+ * Creates request options for createScriptVersion without sending the request
154
+ */
155
+ async createScriptVersionRequestOpts(requestParameters: CreateScriptVersionOperationRequest): Promise<runtime.RequestOpts> {
156
+ if (requestParameters['id'] == null) {
157
+ throw new runtime.RequiredError(
158
+ 'id',
159
+ 'Required parameter "id" was null or undefined when calling createScriptVersion().'
160
+ );
161
+ }
162
+
163
+ if (requestParameters['createScriptVersionRequest'] == null) {
164
+ throw new runtime.RequiredError(
165
+ 'createScriptVersionRequest',
166
+ 'Required parameter "createScriptVersionRequest" was null or undefined when calling createScriptVersion().'
167
+ );
168
+ }
169
+
170
+ const queryParameters: any = {};
171
+
172
+ const headerParameters: runtime.HTTPHeaders = {};
173
+
174
+ headerParameters['Content-Type'] = 'application/json';
175
+
176
+ if (this.configuration && this.configuration.accessToken) {
177
+ const token = this.configuration.accessToken;
178
+ const tokenString = await token("bearerAuth", []);
179
+
180
+ if (tokenString) {
181
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
182
+ }
183
+ }
184
+
185
+ let urlPath = `/v1/scripts/{id}/versions`;
186
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
187
+
188
+ return {
189
+ path: urlPath,
190
+ method: 'POST',
191
+ headers: headerParameters,
192
+ query: queryParameters,
193
+ body: CreateScriptVersionRequestToJSON(requestParameters['createScriptVersionRequest']),
194
+ };
195
+ }
196
+
197
+ /**
198
+ * Adds the next version of the script (at most 20 per script), compiled like the first. Existing alerts keep their version. Answers 503 `unavailable` while hosted scripts are switched off.
199
+ * Upload a new script version
200
+ */
201
+ async createScriptVersionRaw(requestParameters: CreateScriptVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptVersion>> {
202
+ const requestOptions = await this.createScriptVersionRequestOpts(requestParameters);
203
+ const response = await this.request(requestOptions, initOverrides);
204
+
205
+ return new runtime.JSONApiResponse(response, (jsonValue) => ScriptVersionFromJSON(jsonValue));
206
+ }
207
+
208
+ /**
209
+ * Adds the next version of the script (at most 20 per script), compiled like the first. Existing alerts keep their version. Answers 503 `unavailable` while hosted scripts are switched off.
210
+ * Upload a new script version
211
+ */
212
+ async createScriptVersion(requestParameters: CreateScriptVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptVersion> {
213
+ const response = await this.createScriptVersionRaw(requestParameters, initOverrides);
214
+ return await response.value();
215
+ }
216
+
217
+ /**
218
+ * Creates request options for deleteScript without sending the request
219
+ */
220
+ async deleteScriptRequestOpts(requestParameters: DeleteScriptRequest): Promise<runtime.RequestOpts> {
221
+ if (requestParameters['id'] == null) {
222
+ throw new runtime.RequiredError(
223
+ 'id',
224
+ 'Required parameter "id" was null or undefined when calling deleteScript().'
225
+ );
226
+ }
227
+
228
+ const queryParameters: any = {};
229
+
230
+ const headerParameters: runtime.HTTPHeaders = {};
231
+
232
+ if (this.configuration && this.configuration.accessToken) {
233
+ const token = this.configuration.accessToken;
234
+ const tokenString = await token("bearerAuth", []);
235
+
236
+ if (tokenString) {
237
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
238
+ }
239
+ }
240
+
241
+ let urlPath = `/v1/scripts/{id}`;
242
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
243
+
244
+ return {
245
+ path: urlPath,
246
+ method: 'DELETE',
247
+ headers: headerParameters,
248
+ query: queryParameters,
249
+ };
250
+ }
251
+
252
+ /**
253
+ * Deletes the script and its versions (204). 409 `conflict` while an alert uses one of its versions (delete those alerts first). Answers 503 `unavailable` while hosted scripts are switched off.
254
+ * Delete a script
255
+ */
256
+ async deleteScriptRaw(requestParameters: DeleteScriptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<any>> {
257
+ const requestOptions = await this.deleteScriptRequestOpts(requestParameters);
258
+ const response = await this.request(requestOptions, initOverrides);
259
+
260
+ if (this.isJsonMime(response.headers.get('content-type'))) {
261
+ return new runtime.JSONApiResponse<any>(response);
262
+ } else {
263
+ return new runtime.TextApiResponse(response) as any;
264
+ }
265
+ }
266
+
267
+ /**
268
+ * Deletes the script and its versions (204). 409 `conflict` while an alert uses one of its versions (delete those alerts first). Answers 503 `unavailable` while hosted scripts are switched off.
269
+ * Delete a script
270
+ */
271
+ async deleteScript(requestParameters: DeleteScriptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any> {
272
+ const response = await this.deleteScriptRaw(requestParameters, initOverrides);
273
+ return await response.value();
274
+ }
275
+
276
+ /**
277
+ * Creates request options for getScript without sending the request
278
+ */
279
+ async getScriptRequestOpts(requestParameters: GetScriptRequest): Promise<runtime.RequestOpts> {
280
+ if (requestParameters['id'] == null) {
281
+ throw new runtime.RequiredError(
282
+ 'id',
283
+ 'Required parameter "id" was null or undefined when calling getScript().'
284
+ );
285
+ }
286
+
287
+ const queryParameters: any = {};
288
+
289
+ const headerParameters: runtime.HTTPHeaders = {};
290
+
291
+ if (this.configuration && this.configuration.accessToken) {
292
+ const token = this.configuration.accessToken;
293
+ const tokenString = await token("bearerAuth", []);
294
+
295
+ if (tokenString) {
296
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
297
+ }
298
+ }
299
+
300
+ let urlPath = `/v1/scripts/{id}`;
301
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
302
+
303
+ return {
304
+ path: urlPath,
305
+ method: 'GET',
306
+ headers: headerParameters,
307
+ query: queryParameters,
308
+ };
309
+ }
310
+
311
+ /**
312
+ * One script with its latest version. Answers 503 `unavailable` while hosted scripts are switched off.
313
+ * Get a script
314
+ */
315
+ async getScriptRaw(requestParameters: GetScriptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Script>> {
316
+ const requestOptions = await this.getScriptRequestOpts(requestParameters);
317
+ const response = await this.request(requestOptions, initOverrides);
318
+
319
+ return new runtime.JSONApiResponse(response, (jsonValue) => ScriptFromJSON(jsonValue));
320
+ }
321
+
322
+ /**
323
+ * One script with its latest version. Answers 503 `unavailable` while hosted scripts are switched off.
324
+ * Get a script
325
+ */
326
+ async getScript(requestParameters: GetScriptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Script> {
327
+ const response = await this.getScriptRaw(requestParameters, initOverrides);
328
+ return await response.value();
329
+ }
330
+
331
+ /**
332
+ * Creates request options for listAlertTemplates without sending the request
333
+ */
334
+ async listAlertTemplatesRequestOpts(requestParameters: ListAlertTemplatesRequest): Promise<runtime.RequestOpts> {
335
+ const queryParameters: any = {};
336
+
337
+ if (requestParameters['limit'] != null) {
338
+ queryParameters['limit'] = requestParameters['limit'];
339
+ }
340
+
341
+ if (requestParameters['cursor'] != null) {
342
+ queryParameters['cursor'] = requestParameters['cursor'];
343
+ }
344
+
345
+ const headerParameters: runtime.HTTPHeaders = {};
346
+
347
+ if (this.configuration && this.configuration.accessToken) {
348
+ const token = this.configuration.accessToken;
349
+ const tokenString = await token("bearerAuth", []);
350
+
351
+ if (tokenString) {
352
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
353
+ }
354
+ }
355
+
356
+ let urlPath = `/v1/alert-templates`;
357
+
358
+ return {
359
+ path: urlPath,
360
+ method: 'GET',
361
+ headers: headerParameters,
362
+ query: queryParameters,
363
+ };
364
+ }
365
+
366
+ /**
367
+ * The built-in templates of the `indicator` alert type: key, version, inputs with their defaults, snapshot fidelity and chartlang source. Answers 503 `unavailable` while hosted scripts are switched off.
368
+ * List indicator alert templates
369
+ */
370
+ async listAlertTemplatesRaw(requestParameters: ListAlertTemplatesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListAlertTemplates200Response>> {
371
+ const requestOptions = await this.listAlertTemplatesRequestOpts(requestParameters);
372
+ const response = await this.request(requestOptions, initOverrides);
373
+
374
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListAlertTemplates200ResponseFromJSON(jsonValue));
375
+ }
376
+
377
+ /**
378
+ * The built-in templates of the `indicator` alert type: key, version, inputs with their defaults, snapshot fidelity and chartlang source. Answers 503 `unavailable` while hosted scripts are switched off.
379
+ * List indicator alert templates
380
+ */
381
+ async listAlertTemplates(requestParameters: ListAlertTemplatesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListAlertTemplates200Response> {
382
+ const response = await this.listAlertTemplatesRaw(requestParameters, initOverrides);
383
+ return await response.value();
384
+ }
385
+
386
+ /**
387
+ * Creates request options for listScriptVersions without sending the request
388
+ */
389
+ async listScriptVersionsRequestOpts(requestParameters: ListScriptVersionsRequest): Promise<runtime.RequestOpts> {
390
+ if (requestParameters['id'] == null) {
391
+ throw new runtime.RequiredError(
392
+ 'id',
393
+ 'Required parameter "id" was null or undefined when calling listScriptVersions().'
394
+ );
395
+ }
396
+
397
+ const queryParameters: any = {};
398
+
399
+ if (requestParameters['limit'] != null) {
400
+ queryParameters['limit'] = requestParameters['limit'];
401
+ }
402
+
403
+ if (requestParameters['cursor'] != null) {
404
+ queryParameters['cursor'] = requestParameters['cursor'];
405
+ }
406
+
407
+ const headerParameters: runtime.HTTPHeaders = {};
408
+
409
+ if (this.configuration && this.configuration.accessToken) {
410
+ const token = this.configuration.accessToken;
411
+ const tokenString = await token("bearerAuth", []);
412
+
413
+ if (tokenString) {
414
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
415
+ }
416
+ }
417
+
418
+ let urlPath = `/v1/scripts/{id}/versions`;
419
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
420
+
421
+ return {
422
+ path: urlPath,
423
+ method: 'GET',
424
+ headers: headerParameters,
425
+ query: queryParameters,
426
+ };
427
+ }
428
+
429
+ /**
430
+ * The script\'s versions, oldest first. Answers 503 `unavailable` while hosted scripts are switched off.
431
+ * List script versions
432
+ */
433
+ async listScriptVersionsRaw(requestParameters: ListScriptVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListScriptVersions200Response>> {
434
+ const requestOptions = await this.listScriptVersionsRequestOpts(requestParameters);
435
+ const response = await this.request(requestOptions, initOverrides);
436
+
437
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListScriptVersions200ResponseFromJSON(jsonValue));
438
+ }
439
+
440
+ /**
441
+ * The script\'s versions, oldest first. Answers 503 `unavailable` while hosted scripts are switched off.
442
+ * List script versions
443
+ */
444
+ async listScriptVersions(requestParameters: ListScriptVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListScriptVersions200Response> {
445
+ const response = await this.listScriptVersionsRaw(requestParameters, initOverrides);
446
+ return await response.value();
447
+ }
448
+
449
+ /**
450
+ * Creates request options for listScripts without sending the request
451
+ */
452
+ async listScriptsRequestOpts(requestParameters: ListScriptsRequest): Promise<runtime.RequestOpts> {
453
+ const queryParameters: any = {};
454
+
455
+ if (requestParameters['limit'] != null) {
456
+ queryParameters['limit'] = requestParameters['limit'];
457
+ }
458
+
459
+ if (requestParameters['cursor'] != null) {
460
+ queryParameters['cursor'] = requestParameters['cursor'];
461
+ }
462
+
463
+ const headerParameters: runtime.HTTPHeaders = {};
464
+
465
+ if (this.configuration && this.configuration.accessToken) {
466
+ const token = this.configuration.accessToken;
467
+ const tokenString = await token("bearerAuth", []);
468
+
469
+ if (tokenString) {
470
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
471
+ }
472
+ }
473
+
474
+ let urlPath = `/v1/scripts`;
475
+
476
+ return {
477
+ path: urlPath,
478
+ method: 'GET',
479
+ headers: headerParameters,
480
+ query: queryParameters,
481
+ };
482
+ }
483
+
484
+ /**
485
+ * The account\'s scripts, oldest first, each with its latest version. Answers 503 `unavailable` while hosted scripts are switched off.
486
+ * List scripts
487
+ */
488
+ async listScriptsRaw(requestParameters: ListScriptsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListScripts200Response>> {
489
+ const requestOptions = await this.listScriptsRequestOpts(requestParameters);
490
+ const response = await this.request(requestOptions, initOverrides);
491
+
492
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListScripts200ResponseFromJSON(jsonValue));
493
+ }
494
+
495
+ /**
496
+ * The account\'s scripts, oldest first, each with its latest version. Answers 503 `unavailable` while hosted scripts are switched off.
497
+ * List scripts
498
+ */
499
+ async listScripts(requestParameters: ListScriptsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListScripts200Response> {
500
+ const response = await this.listScriptsRaw(requestParameters, initOverrides);
501
+ return await response.value();
502
+ }
503
+
504
+ }
package/src/apis/index.ts CHANGED
@@ -19,4 +19,5 @@ export * from './InvestorDocumentsApi';
19
19
  export * from './MetricsApi';
20
20
  export * from './NewsApi';
21
21
  export * from './ReferenceApi';
22
+ export * from './ScriptsApi';
22
23
  export * from './TranscriptsApi';
@@ -52,6 +52,12 @@ export interface Alert {
52
52
  * @memberof Alert
53
53
  */
54
54
  status: AlertStatusEnum;
55
+ /**
56
+ * Why the platform disabled the alert (`script_error`: its script aborted on 3 bars in a row); null otherwise
57
+ * @type {string}
58
+ * @memberof Alert
59
+ */
60
+ disabled_reason: string | null;
55
61
  /**
56
62
  *
57
63
  * @type {AlertCondition}
@@ -178,6 +184,7 @@ export function instanceOfAlert(value: object): value is Alert {
178
184
  if (!('id' in value) || value['id'] === undefined) return false;
179
185
  if (!('type' in value) || value['type'] === undefined) return false;
180
186
  if (!('status' in value) || value['status'] === undefined) return false;
187
+ if (!('disabled_reason' in value) || value['disabled_reason'] === undefined) return false;
181
188
  if (!('condition' in value) || value['condition'] === undefined) return false;
182
189
  if (!('trigger' in value) || value['trigger'] === undefined) return false;
183
190
  if (!('destination_ids' in value) || value['destination_ids'] === undefined) return false;
@@ -207,6 +214,7 @@ export function AlertFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ale
207
214
  'id': json['id'],
208
215
  'type': json['type'],
209
216
  'status': json['status'],
217
+ 'disabled_reason': json['disabled_reason'],
210
218
  'condition': AlertConditionFromJSON(json['condition']),
211
219
  'trigger': AlertTriggerFromJSON(json['trigger']),
212
220
  'destination_ids': json['destination_ids'],
@@ -237,6 +245,7 @@ export function AlertToJSONTyped(value?: Alert | null, ignoreDiscriminator: bool
237
245
  'id': value['id'],
238
246
  'type': value['type'],
239
247
  'status': value['status'],
248
+ 'disabled_reason': value['disabled_reason'],
240
249
  'condition': AlertConditionToJSON(value['condition']),
241
250
  'trigger': AlertTriggerToJSON(value['trigger']),
242
251
  'destination_ids': value['destination_ids'],