@loxtep/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.
Files changed (2) hide show
  1. package/README.md +73 -100
  2. 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.LOXTEP_TOKEN },
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, create, stream,
113
- replay, **get_writer**, **get_reader**, invalidate_cache
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
- - **connections** – list, get, create, test
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 (access-filtered catalog search with optional
121
- evidence/lineage), getEvidence, getLineageImpact, getGovernanceFlags,
122
- runDiscovery (all call `POST /ai/mcp/tools/call`; results are access-filtered
123
- when user context is present)
124
- - **schemas** – get (data product schema)
125
- - **observe** – `status`, **`stream_config`** (proxied bus resource names for
126
- SDK `streams`)
127
- - **projects**, **domains**, **standards**, **data_contracts** – list, get (full
128
- CRUD where applicable)
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,58 @@ 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
- - **[Event replay cookbook](docs/event-replay-cookbook.md)** – Replay events
218
- from a data product or queue (key differentiator).
219
- - **[MCP + SDK pairing](docs/sdk-pairing.md)** – one auth story, when MCP vs
220
- SDK.
221
- - **[Control vs data plane](docs/sdk-control-vs-data-plane.md)** – REST vs
222
- 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
226
- direction.
182
+ - **Getting started** – Zero to first event in under 10 minutes.
183
+ - **Quick reference** Single-page cheat sheet.
184
+ - **Event replay cookbook** – Replay events from a data product or queue.
185
+ - **Ingestion & export guide** – Deep dive into how SDK ingestion and export works.
186
+ - **MCP + SDK pairing** – One auth story, when MCP vs SDK.
187
+ - **Control vs data plane** – REST vs Loxtep streams.
188
+ - **REST SigV4 vs bus** – Never mix secrets.
189
+ - **MCP → SDK mapping** – Agent-oriented table.
190
+ - **Bus RBAC threat model** – Issuance direction.
227
191
  - **Typed errors** – `import { … } from '@loxtep/sdk/errors'`.
228
192
  - **API reference** – `npm run docs` (Typedoc).
229
193
 
230
194
  ## CLI reference
231
195
 
232
- | Command | Description |
233
- | ---------------------------------------------------- | ----------------------------------------------------------- |
234
- | `login` | Log in with email/password (prompts if not provided) |
235
- | `logout` | Remove stored credentials |
236
- | `whoami` | Print current user and organization |
237
- | `init` | Setup checklist + doc pointers |
238
- | `config list` | Show api_url, organization_id, project_id, instance_id |
239
- | `config set <key> <value>` | Set api_url \| organization_id \| project_id \| instance_id |
240
- | `config export --from-data-product <id>` | Print shell exports / JSON for SDK bootstrap |
241
- | `bus login` | Explain bus vs JWT (placeholder for future session API) |
242
- | `data-products list` | List data products |
243
- | `data-products get <id>` | Get data product by id |
244
- | `data-products create --name --domain-id …` | Create data product |
245
- | `data-products query <id> <SQL>` | Run SQL in data product context (or `--file query.sql`) |
246
- | `data-products tables <id>` | List tables for data product |
247
- | `flows list [--project-id <id>]` | List flows (project_id required or from config) |
248
- | `flows get <id>` | Get flow by id (with nodes) |
249
- | `flows create --name <n> --project-id <id>` | Create flow (optional: `--template-id`, `--description`) |
250
- | `connections list` | List connections |
251
- | `connections get <id>` | Get connection by id |
252
- | `connections create --name <n> --type <t> --key <k>` | Create connection |
253
- | `connections test <id>` | Test connection |
254
- | `queue info <data-product-id>` | Queue info by data product id |
255
- | `queue info --queue <name>` | Queue info by queue name |
256
- | `queue checkpoint <id> --bot <bot-id>` | Reader checkpoint for data product and bot |
257
- | `domains list` \| `domains get <id>` | List or get domain |
258
- | `standards list` \| `standards get <id>` | List or get standard (policy) |
259
- | `data-contracts list` \| `data-contracts get <id>` | List or get data contract |
260
- | `metrics rate-limits` | Show rate limit info |
261
- | `metrics log --id <id> --value <n>` | Log metric (optional `--tags k=v,...`) |
196
+ | Command | Description |
197
+ | ---------------------------------------------------- | ------------------------------------------------------------------ |
198
+ | `login` | Log in with email/password (prompts if not provided) |
199
+ | `login --browser` | Log in via browser OAuth flow |
200
+ | `logout` | Remove stored credentials |
201
+ | `whoami` | Print current user and organization |
202
+ | `init` | Setup checklist + doc pointers |
203
+ | `config list` | Show api_url, organization_id, project_id, instance_id |
204
+ | `config paths` | Show resolved URLs for auth and SDK path matrix |
205
+ | `config set <key> <value>` | Set api_url \| organization_id \| project_id \| instance_id |
206
+ | `config export --from-data-product <id>` | Print shell exports / JSON for SDK bootstrap |
207
+ | `config export --from-connector <id>` | Print env exports from SDK connector |
208
+ | `bus login` | Explain bus vs JWT (placeholder for future session API) |
209
+ | `data-products list` | List data products |
210
+ | `data-products get <id>` | Get data product by id |
211
+ | `data-products create --name … --domain-id …` | Create data product |
212
+ | `data-products query <id> <SQL>` | Run SQL in data product context (or `--file query.sql`) |
213
+ | `data-products tables <id>` | List tables for data product |
214
+ | `flows list [--project-id <id>]` | List flows (project_id required or from config) |
215
+ | `flows get <id>` | Get flow by id (with nodes) |
216
+ | `flows create --name <n> --project-id <id>` | Create flow (optional: `--template-id`, `--description`) |
217
+ | `workflows list [--project-id <id>]` | List workflows |
218
+ | `workflows deploy --project-id <id>` | Deploy workflow (optional: `--instance-id`, `--version-id`) |
219
+ | `connections list` | List connections |
220
+ | `connections get <id>` | Get connection by id |
221
+ | `connections create --name <n> --type <t> --key <k>` | Create connection |
222
+ | `connections test <id>` | Test connection |
223
+ | `observe status` | Show observability status (bots) |
224
+ | `queue info <data-product-id>` | Queue info by data product id |
225
+ | `queue info --queue <name>` | Queue info by queue name |
226
+ | `queue checkpoint <id> --bot <bot-id>` | Reader checkpoint for data product and bot |
227
+ | `domains list` \| `domains get <id>` | List or get domain |
228
+ | `standards list` \| `standards get <id>` | List or get standard (policy) |
229
+ | `data-contracts list` \| `data-contracts get <id>` | List or get data contract |
230
+ | `metrics rate-limits` | Show rate limit info |
231
+ | `metrics log --id <id> --value <n>` | Log metric (optional `--tags k=v,...`) |
262
232
 
263
233
  Examples:
264
234
 
@@ -268,6 +238,9 @@ loxtep whoami
268
238
  loxtep data-products list
269
239
  loxtep flows list --project-id <project-id>
270
240
  loxtep flows get <flow-id>
241
+ loxtep workflows list --project-id <project-id>
242
+ loxtep workflows deploy --project-id <id> --instance-id <id>
243
+ loxtep config export --from-connector <connector-id> --format json
271
244
  loxtep queue info <data-product-id>
272
245
  loxtep data-products query <data-product-id> "SELECT * FROM t LIMIT 10"
273
246
  loxtep metrics rate-limits
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@loxtep/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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/loxtep/loxtep.git",
9
+ "url": "https://github.io/loxtepinc/loxtep.git",
10
10
  "directory": "sdks/nodejs"
11
11
  },
12
12
  "bugs": {
13
- "url": "https://github.io/loxtep/loxtep/issues"
13
+ "url": "https://github.io/loxtepinc/loxtep/issues"
14
14
  },
15
15
  "type": "module",
16
16
  "main": "dist/index.js",