@loxtep/sdk 0.1.0 → 0.1.1
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 +75 -96
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Client for the Loxtep API. Customer-facing surface: **data_products**,
|
|
4
4
|
**flows**, **connections**, **queues**, **quality**, **catalog**, **discovery**,
|
|
5
|
-
**schemas**, **projects**, **domains**, **standards**, **data_contracts
|
|
5
|
+
**schemas**, **projects**, **domains**, **standards**, **data_contracts**,
|
|
6
|
+
**workflows**, **templates**, **connectors**, **instances**, **consumptions**,
|
|
7
|
+
**thesaurus**, **procedures**, **metrics**.
|
|
6
8
|
|
|
7
9
|
**Node.js 22+** is the supported runtime (`engines` in `package.json`). **Live**
|
|
8
10
|
queue/flow writes use the **Loxtep stream** data plane; configure stream bus
|
|
@@ -35,7 +37,7 @@ credentials for SigV4 on both REST and the bus.
|
|
|
35
37
|
|
|
36
38
|
const client = new LoxtepClient({
|
|
37
39
|
api_url: 'https://api.loxtep.com',
|
|
38
|
-
auth: { type: 'jwt', token: process.env.
|
|
40
|
+
auth: { type: 'jwt', token: process.env.LOXTEP_AUTH_TOKEN! },
|
|
39
41
|
});
|
|
40
42
|
|
|
41
43
|
// Write events to a data product
|
|
@@ -77,55 +79,33 @@ credentials for SigV4 on both REST and the bus.
|
|
|
77
79
|
JWT-backed client. Note: `data_products.get_writer` and `get_reader` resolve
|
|
78
80
|
stream config automatically — this is only needed for manual bus access.
|
|
79
81
|
|
|
80
|
-
## Quick start: "Tell me everything about this order"
|
|
81
|
-
|
|
82
|
-
Process Intelligence returns unified context from all connected systems
|
|
83
|
-
(Shopify, Stripe, Gorgias, etc.) for a given entity:
|
|
84
|
-
|
|
85
|
-
```ts
|
|
86
|
-
import { LoxtepClient } from '@loxtep/sdk';
|
|
87
|
-
|
|
88
|
-
const client = new LoxtepClient({
|
|
89
|
-
api_url: 'https://api.loxtep.com',
|
|
90
|
-
auth: { type: 'jwt', token: process.env.LOXTEP_AUTH_TOKEN! },
|
|
91
|
-
organization_id: process.env.LOXTEP_ORGANIZATION_ID,
|
|
92
|
-
credentials: {
|
|
93
|
-
accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? 'cli',
|
|
94
|
-
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? 'cli',
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
// Tell me everything about order #4821
|
|
99
|
-
const context = await client.process_intelligence.getEntityContext(
|
|
100
|
-
client.organization_id!,
|
|
101
|
-
{ entity_type: 'order', entity_id: '4821' }
|
|
102
|
-
);
|
|
103
|
-
console.log(context); // Shopify order + Stripe payments + support tickets, etc.
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
See
|
|
107
|
-
[Process Intelligence API Guide](../../docs/api/process-intelligence-guide.md)
|
|
108
|
-
for full API and MCP tool reference.
|
|
109
|
-
|
|
110
82
|
## API surface
|
|
111
83
|
|
|
112
|
-
- **data_products** – get, list, search, query, list_tables,
|
|
113
|
-
|
|
84
|
+
- **data_products** – get, get_lexicon, list, search, query, list_tables,
|
|
85
|
+
get_queue_info, get_reader_checkpoint, create, stream, replay,
|
|
86
|
+
**get_writer**, **get_reader**, invalidate_cache
|
|
114
87
|
- **flows** – list, get, create, get_writer
|
|
115
|
-
- **
|
|
88
|
+
- **workflows** – listWorkflows, getWorkflowGraph, createWorkflow, deploy
|
|
89
|
+
- **connections** – get, list, create, update, delete, test
|
|
90
|
+
- **connectors** – list, get, create, update, delete, test, getOauthUrl
|
|
116
91
|
- **queues** – get_queue_metadata, get_reader_checkpoint, open_reader,
|
|
117
92
|
open_writer
|
|
118
|
-
- **quality** – list, get
|
|
93
|
+
- **quality** – list, get, create
|
|
119
94
|
- **catalog** – search
|
|
120
|
-
- **discovery** – search
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
- **
|
|
125
|
-
- **
|
|
126
|
-
|
|
127
|
-
- **
|
|
128
|
-
|
|
95
|
+
- **discovery** – search, getEvidence, getLineageImpact, getGovernanceFlags,
|
|
96
|
+
runDiscovery
|
|
97
|
+
- **schemas** – get, list
|
|
98
|
+
- **observe** – status, stream_config
|
|
99
|
+
- **projects** – list, get, create, update, delete, applyTemplate
|
|
100
|
+
- **templates** – list, get
|
|
101
|
+
- **domains** – list, get
|
|
102
|
+
- **standards** – list, get
|
|
103
|
+
- **data_contracts** – list, get
|
|
104
|
+
- **thesaurus** – listTerms, resolveCanonicalKey
|
|
105
|
+
- **consumptions** – list, get, create, update, delete
|
|
106
|
+
- **instances** – list, get, get_stream_config
|
|
107
|
+
- **procedures** – list
|
|
108
|
+
- **metrics** – log, get_reporter
|
|
129
109
|
|
|
130
110
|
## Data product writer and reader
|
|
131
111
|
|
|
@@ -197,68 +177,64 @@ for await (const event of filterStream(
|
|
|
197
177
|
}
|
|
198
178
|
```
|
|
199
179
|
|
|
200
|
-
## Generated API types
|
|
201
|
-
|
|
202
|
-
Types for API request/response shapes (data_product, workflow, connection, etc.)
|
|
203
|
-
are generated from Zod schemas and exported from `@loxtep/sdk`:
|
|
204
|
-
|
|
205
|
-
```ts
|
|
206
|
-
import type { DataProductApi, FlowApi, ConnectionApi } from '@loxtep/sdk';
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
Regenerate after changing `scripts/api-schemas.ts`:
|
|
210
|
-
|
|
211
|
-
```bash
|
|
212
|
-
pnpm run generate:api-types
|
|
213
|
-
```
|
|
214
|
-
|
|
215
180
|
## Documentation
|
|
216
181
|
|
|
217
|
-
- **[
|
|
182
|
+
- **[Getting started](https://github.com/symmatiq/loxtep/blob/main/sdks/nodejs/docs/getting-started.md)** – Zero to first event in
|
|
183
|
+
under 10 minutes.
|
|
184
|
+
- **[Quick reference](https://github.com/symmatiq/loxtep/blob/main/sdks/nodejs/docs/quick-reference.md)** – Single-page cheat sheet.
|
|
185
|
+
- **[Event replay cookbook](https://github.com/symmatiq/loxtep/blob/main/sdks/nodejs/docs/event-replay-cookbook.md)** – Replay events
|
|
218
186
|
from a data product or queue (key differentiator).
|
|
219
|
-
- **[
|
|
187
|
+
- **[Ingestion & export guide](https://github.com/symmatiq/loxtep/blob/main/sdks/nodejs/docs/sdk-ingestion-export-guide.md)** – Deep
|
|
188
|
+
dive into how SDK ingestion and export works.
|
|
189
|
+
- **[MCP + SDK pairing](https://github.com/symmatiq/loxtep/blob/main/sdks/nodejs/docs/sdk-pairing.md)** – one auth story, when MCP vs
|
|
220
190
|
SDK.
|
|
221
|
-
- **[Control vs data plane](docs/sdk-control-vs-data-plane.md)** – REST vs
|
|
191
|
+
- **[Control vs data plane](https://github.com/symmatiq/loxtep/blob/main/sdks/nodejs/docs/sdk-control-vs-data-plane.md)** – REST vs
|
|
222
192
|
Loxtep streams.
|
|
223
|
-
- **[REST SigV4 vs bus](docs/sdk-rest-vs-bus.md)** – never mix secrets.
|
|
224
|
-
- **[MCP → SDK mapping](docs/sdk-mcp-mapping.md)** – agent-oriented table.
|
|
225
|
-
- **[Bus RBAC threat model](docs/sdk-bus-rbac-threat-model.md)** – issuance
|
|
193
|
+
- **[REST SigV4 vs bus](https://github.com/symmatiq/loxtep/blob/main/sdks/nodejs/docs/sdk-rest-vs-bus.md)** – never mix secrets.
|
|
194
|
+
- **[MCP → SDK mapping](https://github.com/symmatiq/loxtep/blob/main/sdks/nodejs/docs/sdk-mcp-mapping.md)** – agent-oriented table.
|
|
195
|
+
- **[Bus RBAC threat model](https://github.com/symmatiq/loxtep/blob/main/sdks/nodejs/docs/sdk-bus-rbac-threat-model.md)** – issuance
|
|
226
196
|
direction.
|
|
227
197
|
- **Typed errors** – `import { … } from '@loxtep/sdk/errors'`.
|
|
228
198
|
- **API reference** – `npm run docs` (Typedoc).
|
|
229
199
|
|
|
230
200
|
## CLI reference
|
|
231
201
|
|
|
232
|
-
| Command | Description
|
|
233
|
-
| ---------------------------------------------------- |
|
|
234
|
-
| `login` | Log in with email/password (prompts if not provided)
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
239
|
-
| `config
|
|
240
|
-
| `config
|
|
241
|
-
| `
|
|
242
|
-
| `data-
|
|
243
|
-
| `
|
|
244
|
-
| `
|
|
245
|
-
| `data-products
|
|
246
|
-
| `data-products
|
|
247
|
-
| `
|
|
248
|
-
| `
|
|
249
|
-
| `
|
|
250
|
-
| `
|
|
251
|
-
| `
|
|
252
|
-
| `
|
|
253
|
-
| `
|
|
254
|
-
| `
|
|
255
|
-
| `
|
|
256
|
-
| `
|
|
257
|
-
| `
|
|
258
|
-
| `
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
202
|
+
| Command | Description |
|
|
203
|
+
| ---------------------------------------------------- | ------------------------------------------------------------------ |
|
|
204
|
+
| `login` | Log in with email/password (prompts if not provided) |
|
|
205
|
+
| `login --browser` | Log in via browser OAuth flow |
|
|
206
|
+
| `logout` | Remove stored credentials |
|
|
207
|
+
| `whoami` | Print current user and organization |
|
|
208
|
+
| `init` | Setup checklist + doc pointers |
|
|
209
|
+
| `config list` | Show api_url, organization_id, project_id, instance_id |
|
|
210
|
+
| `config paths` | Show resolved URLs for auth and SDK path matrix |
|
|
211
|
+
| `config set <key> <value>` | Set api_url \| organization_id \| project_id \| instance_id |
|
|
212
|
+
| `config export --from-data-product <id>` | Print shell exports / JSON for SDK bootstrap |
|
|
213
|
+
| `config export --from-connector <id>` | Print env exports from SDK connector |
|
|
214
|
+
| `bus login` | Explain bus vs JWT (placeholder for future session API) |
|
|
215
|
+
| `data-products list` | List data products |
|
|
216
|
+
| `data-products get <id>` | Get data product by id |
|
|
217
|
+
| `data-products create --name … --domain-id …` | Create data product |
|
|
218
|
+
| `data-products query <id> <SQL>` | Run SQL in data product context (or `--file query.sql`) |
|
|
219
|
+
| `data-products tables <id>` | List tables for data product |
|
|
220
|
+
| `flows list [--project-id <id>]` | List flows (project_id required or from config) |
|
|
221
|
+
| `flows get <id>` | Get flow by id (with nodes) |
|
|
222
|
+
| `flows create --name <n> --project-id <id>` | Create flow (optional: `--template-id`, `--description`) |
|
|
223
|
+
| `workflows list [--project-id <id>]` | List workflows |
|
|
224
|
+
| `workflows deploy --project-id <id>` | Deploy workflow (optional: `--instance-id`, `--version-id`) |
|
|
225
|
+
| `connections list` | List connections |
|
|
226
|
+
| `connections get <id>` | Get connection by id |
|
|
227
|
+
| `connections create --name <n> --type <t> --key <k>` | Create connection |
|
|
228
|
+
| `connections test <id>` | Test connection |
|
|
229
|
+
| `observe status` | Show observability status (bots) |
|
|
230
|
+
| `queue info <data-product-id>` | Queue info by data product id |
|
|
231
|
+
| `queue info --queue <name>` | Queue info by queue name |
|
|
232
|
+
| `queue checkpoint <id> --bot <bot-id>` | Reader checkpoint for data product and bot |
|
|
233
|
+
| `domains list` \| `domains get <id>` | List or get domain |
|
|
234
|
+
| `standards list` \| `standards get <id>` | List or get standard (policy) |
|
|
235
|
+
| `data-contracts list` \| `data-contracts get <id>` | List or get data contract |
|
|
236
|
+
| `metrics rate-limits` | Show rate limit info |
|
|
237
|
+
| `metrics log --id <id> --value <n>` | Log metric (optional `--tags k=v,...`) |
|
|
262
238
|
|
|
263
239
|
Examples:
|
|
264
240
|
|
|
@@ -268,6 +244,9 @@ loxtep whoami
|
|
|
268
244
|
loxtep data-products list
|
|
269
245
|
loxtep flows list --project-id <project-id>
|
|
270
246
|
loxtep flows get <flow-id>
|
|
247
|
+
loxtep workflows list --project-id <project-id>
|
|
248
|
+
loxtep workflows deploy --project-id <id> --instance-id <id>
|
|
249
|
+
loxtep config export --from-connector <connector-id> --format json
|
|
271
250
|
loxtep queue info <data-product-id>
|
|
272
251
|
loxtep data-products query <data-product-id> "SELECT * FROM t LIMIT 10"
|
|
273
252
|
loxtep metrics rate-limits
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loxtep/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Loxtep SDK for Node.js - data products, flows, projects, queues",
|
|
5
5
|
"author": "Loxtep <engineering@loxtep.io>",
|
|
6
6
|
"homepage": "https://loxtep.io",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.io/
|
|
9
|
+
"url": "https://github.io/loxtepinc/loxtep.git",
|
|
10
10
|
"directory": "sdks/nodejs"
|
|
11
11
|
},
|
|
12
12
|
"bugs": {
|
|
13
|
-
"url": "https://github.io/
|
|
13
|
+
"url": "https://github.io/loxtepinc/loxtep/issues"
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"main": "dist/index.js",
|