@tidelight/sdk 0.1.0 → 0.1.2
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/CHANGELOG.md +8 -0
- package/README.md +46 -31
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
- Publish the current tested client with registry-facing documentation aligned to the supported API and release path.
|
|
6
|
+
|
|
7
|
+
## 0.1.1
|
|
8
|
+
|
|
9
|
+
- Publish the coordinated package set at `0.1.1` with no API contract changes.
|
|
10
|
+
|
|
3
11
|
## 0.1.0
|
|
4
12
|
|
|
5
13
|
- Add a typed TypeScript client for supported Tidelight API v1 market, research job, and webhook operations.
|
package/README.md
CHANGED
|
@@ -1,51 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://tidelight.app/tidelight-mark.svg" alt="Tidelight" width="56" height="56" />
|
|
3
|
+
<h1>Tidelight TypeScript SDK</h1>
|
|
4
|
+
<p><strong>Typed access to Tidelight Intelligence Cloud API v1.</strong></p>
|
|
5
|
+
<p><a href="https://tidelight.app">Product</a> · <a href="https://dev.tidelight.app/api">API guide</a> · <a href="https://github.com/TidelightOrg/tidelight">Mother repository</a></p>
|
|
6
|
+
</div>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
---
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
The official TypeScript / JavaScript client supports tokenized-equity market listings, asynchronous company research jobs, and research webhooks. It preserves provider provenance and API error context, with bounded polling, timeouts, and retries.
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install @tidelight/sdk@0.1.2
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Keep the project API key in trusted server code. Never expose it in a browser bundle or client-side application.
|
|
19
|
+
|
|
20
|
+
## Quickstart
|
|
8
21
|
|
|
9
22
|
```ts
|
|
10
23
|
import { TidelightClient } from "@tidelight/sdk";
|
|
11
24
|
|
|
12
25
|
const client = new TidelightClient({ apiKey: process.env.TIDELIGHT_API_KEY! });
|
|
13
|
-
const page = await client.listTokenizedEquities({
|
|
14
|
-
|
|
26
|
+
const page = await client.listTokenizedEquities({
|
|
27
|
+
limit: 20,
|
|
28
|
+
underlyingTicker: "AAPL",
|
|
29
|
+
});
|
|
15
30
|
|
|
16
|
-
for
|
|
17
|
-
console.log(instrument.symbol);
|
|
31
|
+
for (const instrument of page.data) {
|
|
32
|
+
console.log(instrument.symbol, instrument.underlying_ticker);
|
|
18
33
|
}
|
|
34
|
+
```
|
|
19
35
|
|
|
20
|
-
|
|
21
|
-
const result = await client.waitForResearchJob(accepted.job_id, { intervalMs: 2000, timeoutMs: 120000 });
|
|
22
|
-
if (result.status === "complete") console.log(result.result);
|
|
36
|
+
## Supported workflows
|
|
23
37
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (!created.signing_secret) throw new Error("The create response did not include its one-time signing secret.");
|
|
30
|
-
// TODO: Persist created.signing_secret with your approved secrets manager before
|
|
31
|
-
// finishing setup. Do not print it. It cannot be recovered by listing the endpoint.
|
|
32
|
-
const deliveries = await client.listWebhookDeliveries();
|
|
33
|
-
console.log(deliveries.deliveries);
|
|
34
|
-
```
|
|
38
|
+
| Workflow | Scope | Client methods |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| Tokenized-equity spot listings and pagination | `market:read` | `listTokenizedEquities`, `tokenizedEquities` |
|
|
41
|
+
| Company research snapshots | `research:run` | `startCompanyResearch`, `getResearchJob`, `cancelResearchJob`, `waitForResearchJob` |
|
|
42
|
+
| Research webhooks and delivery history | `alerts:manage` | `createWebhook`, `updateWebhook`, `listWebhooks`, `listWebhookDeliveries` |
|
|
35
43
|
|
|
36
|
-
|
|
44
|
+
A tokenized-equity spot instrument is not a direct share or a stock perpetual. Market data availability follows the service's provider terms gate. The client returns that decision without inventing substitute data.
|
|
37
45
|
|
|
38
|
-
|
|
46
|
+
## Reliability and security
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
Requests have a 10-second default timeout. Network errors, `429`, and transient `5xx` responses receive at most two bounded retries by default. Webhook mutations are not automatically retried because the API does not accept webhook idempotency keys. Errors retain the HTTP status, stable API code, and request ID; raw provider bodies and API keys are not returned.
|
|
41
49
|
|
|
42
|
-
|
|
50
|
+
Webhook creation and secret rotation return a one-time signing secret. **TODO: Persist** it in your approved secret manager immediately. Do not print it; it cannot be recovered by listing the endpoint.
|
|
51
|
+
|
|
52
|
+
## Build and test from source
|
|
43
53
|
|
|
44
54
|
```sh
|
|
45
|
-
npm ci
|
|
46
|
-
npm test
|
|
47
|
-
export TIDELIGHT_API_KEY='tl_test_…'
|
|
48
|
-
node sdk/typescript/examples/research.mjs NVDA
|
|
55
|
+
npm ci
|
|
56
|
+
npm test
|
|
49
57
|
```
|
|
50
58
|
|
|
51
|
-
The
|
|
59
|
+
The SDK source is maintained in [`sdk/typescript`](https://github.com/TidelightOrg/tidelight/tree/main/sdk/typescript) in the mother repository. The standalone [TypeScript repository](https://github.com/TidelightOrg/tidelight-sdk) is a synchronized source mirror. Make source changes in the mother repository.
|
|
60
|
+
|
|
61
|
+
## Further reading
|
|
62
|
+
|
|
63
|
+
- [API reference](https://dev.tidelight.app/api)
|
|
64
|
+
- [OpenAPI contract](https://github.com/TidelightOrg/tidelight/blob/main/docs/tic-openapi.yaml)
|
|
65
|
+
- [Changelog](./CHANGELOG.md)
|
|
66
|
+
- [Security policy](https://github.com/TidelightOrg/tidelight/security/policy)
|
package/package.json
CHANGED