@tidelight/sdk 0.1.1 → 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.
Files changed (3) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +46 -31
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
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
+
3
7
  ## 0.1.1
4
8
 
5
9
  - Publish the coordinated package set at `0.1.1` with no API contract changes.
package/README.md CHANGED
@@ -1,51 +1,66 @@
1
- # Tidelight TypeScript SDK
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
- Official TypeScript client for supported Tidelight Intelligence Cloud v1 market, asynchronous company research, and webhook endpoints. Research calls require `research:run`; webhook calls require `alerts:manage`.
8
+ ---
4
9
 
5
- Install with `npm install @tidelight/sdk`. Keep the API key on your server.
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
- Build locally with `npm run build` in this directory.
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({ limit: 20, underlyingTicker: "AAPL" });
14
- for (const instrument of page.data) console.log(instrument.symbol, instrument.underlying_ticker);
26
+ const page = await client.listTokenizedEquities({
27
+ limit: 20,
28
+ underlyingTicker: "AAPL",
29
+ });
15
30
 
16
- for await (const instrument of client.tokenizedEquities({ limit: 50 })) {
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
- const accepted = await client.startCompanyResearch("NVDA", crypto.randomUUID());
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
- const created = await client.createWebhook({
25
- name: "Research events",
26
- url: "https://your-service.example/tidelight",
27
- events: ["research.job.completed", "research.job.failed"],
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
- Webhook mutations are not retried automatically because the API does not yet accept webhook idempotency keys; this avoids duplicate endpoint creation or secret rotation after an ambiguous timeout. Webhook destination reachability and DNS safety are checked by the API. A client-side HTTPS check is not an authorization to deliver to a destination.
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
- The client retries network errors, 429, and transient 5xx statuses at most twice by default. It enforces a 10 second request timeout and returns `TidelightApiError` with status, code, and request ID.
46
+ ## Reliability and security
39
47
 
40
- ## Run the asynchronous research example
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
- From a mother-repository checkout:
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 --prefix sdk/typescript
46
- npm test --prefix sdk/typescript
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 example calls the SDK company snapshot job flow and prints a result only after the API reports `complete`. It preserves job and request IDs and never prints the key. CI injects a mock transport and makes no network calls. A live run requires `research:run` and consumes project quota (10 jobs per rolling hour).
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidelight/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "Official TypeScript client for Tidelight Intelligence Cloud API v1.",
6
6
  "homepage": "https://tidelight.app/developers/packages/sdk",