@ductape/sdk 0.0.5 → 0.0.6
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 +87 -53
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,58 +1,92 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ductape/sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SDK for building Ductape-powered products. Use a single access key to work with databases, message brokers, storage, sessions, workflows, and more.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
|
-
## 🚀 Why Ductape?
|
|
8
|
-
|
|
9
|
-
- **Composable & Reusable** – Reduce redundancy, accelerate feature development, and integrate databases, message brokers, storage, and third-party services.
|
|
10
|
-
- **Safe Testing** – Validate features in isolated environments for **reliable deployments** and **early issue detection**.
|
|
11
|
-
- **Built-in Monitoring** – Track performance, log issues, and analyze usage patterns in real time.
|
|
12
|
-
|
|
13
|
-
## 🔧 Core Features
|
|
14
|
-
|
|
15
|
-
- **Modular Components** – Seamless integration with databases, messaging, storage, and web services.
|
|
16
|
-
- **Effortless Scaling** – Dynamic resource allocation with minimal backend maintenance.
|
|
17
|
-
- **Streamlined Management** – Define, monitor, and optimize services directly in your codebase.
|
|
18
|
-
|
|
19
|
-
## 🛠 Getting Started
|
|
20
|
-
|
|
21
|
-
### 1️ Install SDK
|
|
22
7
|
```sh
|
|
23
8
|
npm install @ductape/sdk
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
Initialize the client with your **access key** (and optional `env_type`). Then use the namespaced APIs: `messaging`, `storage`, `sessions`, `databases`, etc.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import Ductape from '@ductape/sdk';
|
|
17
|
+
|
|
18
|
+
const ductape = new Ductape({
|
|
19
|
+
accessKey: 'your-access-key',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Message brokers: produce and consume
|
|
23
|
+
await ductape.messaging.produce({
|
|
24
|
+
product: 'my-product',
|
|
25
|
+
env: 'prd',
|
|
26
|
+
event: 'order-events:order-created',
|
|
27
|
+
message: { orderId: '123', amount: 99.99 },
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
await ductape.messaging.consume({
|
|
31
|
+
product: 'my-product',
|
|
32
|
+
env: 'prd',
|
|
33
|
+
event: 'order-events:order-created',
|
|
34
|
+
callback: async (msg) => console.log(msg),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Storage: upload, download, list files
|
|
38
|
+
const uploadResult = await ductape.storage.upload({
|
|
39
|
+
product: 'my-product',
|
|
40
|
+
env: 'prd',
|
|
41
|
+
storage: 'main-storage',
|
|
42
|
+
fileName: 'reports/file.pdf',
|
|
43
|
+
buffer: fileBuffer,
|
|
44
|
+
mimeType: 'application/pdf',
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Sessions: start, verify, refresh
|
|
48
|
+
const session = await ductape.sessions.start({
|
|
49
|
+
product: 'my-product',
|
|
50
|
+
env: 'prd',
|
|
51
|
+
tag: 'user-session',
|
|
52
|
+
data: { userId: 'u1', email: 'user@example.com' },
|
|
53
|
+
});
|
|
54
|
+
// session.token, session.refreshToken, session.sessionId
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## What you can do
|
|
58
|
+
|
|
59
|
+
- **Messaging** - `ductape.messaging.produce()`, `consume()`, `list()`, `fetch()`, `topics.create()`, etc. (Kafka, RabbitMQ, Redis, SQS, Pub/Sub, NATS)
|
|
60
|
+
- **Storage** - `ductape.storage.upload()`, `download()`, `remove()`, `listFiles()`, `getSignedUrl()`, `stats()` (AWS S3, GCP, Azure)
|
|
61
|
+
- **Sessions** - `ductape.sessions.start()`, `verify()`, `refresh()`, `revoke()`, `listActive()` (JWT-based)
|
|
62
|
+
- **Databases** - relational, graph, vector (via `ductape.databases`, `ductape.graph`, `ductape.vector`)
|
|
63
|
+
- **Warehouse** - unified query across relational, graph, and vector (via `ductape.warehouse`)
|
|
64
|
+
- **Caching** - multi-tier cache with product-scoped tags (`ductape.cache`)
|
|
65
|
+
- **Agents** - LLM agents with tools, memory, and multi-agent flows (`ductape.agents`)
|
|
66
|
+
- **Resilience** - quotas, fallbacks, health checks (`ductape.quota`, `ductape.fallback`, `ductape.healthcheck`)
|
|
67
|
+
- **Workflows** - define and run workflows with steps that call actions, storage, messaging, etc.
|
|
68
|
+
- **Jobs** - schedule and run background jobs
|
|
69
|
+
- **Notifications** - email, SMS, push (multiple providers), callbacks
|
|
70
|
+
- **Secrets** - store and resolve secrets per environment
|
|
71
|
+
|
|
72
|
+
## Environment
|
|
73
|
+
|
|
74
|
+
The SDK is intended for **Node.js** (server). Browser use is not supported for broker, storage, and similar operations.
|
|
75
|
+
|
|
76
|
+
## Documentation
|
|
77
|
+
|
|
78
|
+
Full docs: [docs.ductape.app](https://docs.ductape.app)
|
|
79
|
+
|
|
80
|
+
- [Message Brokers](https://docs.ductape.app/message-brokers/overview)
|
|
81
|
+
- [Storage](https://docs.ductape.app/storage/overview)
|
|
82
|
+
- [Sessions](https://docs.ductape.app/sessions/overview)
|
|
83
|
+
- [Databases](https://docs.ductape.app/databases/relational/getting-started)
|
|
84
|
+
- [Warehouse](https://docs.ductape.app/databases/warehouse/getting-started)
|
|
85
|
+
- [Caching](https://docs.ductape.app/caching/overview)
|
|
86
|
+
- [Agents](https://docs.ductape.app/agents/overview)
|
|
87
|
+
- [Resilience](https://docs.ductape.app/resilience/overview)
|
|
88
|
+
- [Workflows](https://docs.ductape.app/workflows/overview)
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT © Ductape Technologies
|