@solidactions/sdk 0.1.0
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/.claude/settings.local.json +7 -0
- package/.clavix/outputs/dbos-http-sdk/full-prd.md +142 -0
- package/.clavix/outputs/dbos-http-sdk/quick-prd.md +12 -0
- package/.clavix/outputs/dbos-http-sdk/tasks.md +630 -0
- package/.clavix/outputs/prompts/dbos-http-api-20260110-033219.md +91 -0
- package/.husky/pre-commit +1 -0
- package/.prettierignore +3 -0
- package/.prettierrc +9 -0
- package/CODE_OF_CONDUCT.md +49 -0
- package/CONTRIBUTING.md +47 -0
- package/LICENSE +21 -0
- package/README.md +172 -0
- package/dist/dbos-config.schema.json +132 -0
- package/dist/schemas/system_db_schema.d.ts +73 -0
- package/dist/schemas/system_db_schema.d.ts.map +1 -0
- package/dist/schemas/system_db_schema.js +3 -0
- package/dist/schemas/system_db_schema.js.map +1 -0
- package/dist/src/adminserver.d.ts +79 -0
- package/dist/src/adminserver.d.ts.map +1 -0
- package/dist/src/adminserver.js +495 -0
- package/dist/src/adminserver.js.map +1 -0
- package/dist/src/authdecorators.d.ts +2 -0
- package/dist/src/authdecorators.d.ts.map +1 -0
- package/dist/src/authdecorators.js +48 -0
- package/dist/src/authdecorators.js.map +1 -0
- package/dist/src/cli/cli.d.ts +9 -0
- package/dist/src/cli/cli.d.ts.map +1 -0
- package/dist/src/cli/cli.js +116 -0
- package/dist/src/cli/cli.js.map +1 -0
- package/dist/src/cli/commands.d.ts +3 -0
- package/dist/src/cli/commands.d.ts.map +1 -0
- package/dist/src/cli/commands.js +46 -0
- package/dist/src/cli/commands.js.map +1 -0
- package/dist/src/client.d.ts +85 -0
- package/dist/src/client.d.ts.map +1 -0
- package/dist/src/client.js +186 -0
- package/dist/src/client.js.map +1 -0
- package/dist/src/conductor/conductor.d.ts +28 -0
- package/dist/src/conductor/conductor.d.ts.map +1 -0
- package/dist/src/conductor/conductor.js +376 -0
- package/dist/src/conductor/conductor.js.map +1 -0
- package/dist/src/conductor/protocol.d.ts +238 -0
- package/dist/src/conductor/protocol.d.ts.map +1 -0
- package/dist/src/conductor/protocol.js +353 -0
- package/dist/src/conductor/protocol.js.map +1 -0
- package/dist/src/config.d.ts +91 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +199 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/context.d.ts +62 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +118 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/database_utils.d.ts +17 -0
- package/dist/src/database_utils.d.ts.map +1 -0
- package/dist/src/database_utils.js +53 -0
- package/dist/src/database_utils.js.map +1 -0
- package/dist/src/datasource.d.ts +109 -0
- package/dist/src/datasource.d.ts.map +1 -0
- package/dist/src/datasource.js +204 -0
- package/dist/src/datasource.js.map +1 -0
- package/dist/src/dbos-executor.d.ts +189 -0
- package/dist/src/dbos-executor.d.ts.map +1 -0
- package/dist/src/dbos-executor.js +817 -0
- package/dist/src/dbos-executor.js.map +1 -0
- package/dist/src/dbos.d.ts +519 -0
- package/dist/src/dbos.d.ts.map +1 -0
- package/dist/src/dbos.js +1282 -0
- package/dist/src/dbos.js.map +1 -0
- package/dist/src/debouncer.d.ts +33 -0
- package/dist/src/debouncer.d.ts.map +1 -0
- package/dist/src/debouncer.js +170 -0
- package/dist/src/debouncer.js.map +1 -0
- package/dist/src/debugpoint.d.ts +26 -0
- package/dist/src/debugpoint.d.ts.map +1 -0
- package/dist/src/debugpoint.js +65 -0
- package/dist/src/debugpoint.js.map +1 -0
- package/dist/src/decorators.d.ts +219 -0
- package/dist/src/decorators.d.ts.map +1 -0
- package/dist/src/decorators.js +873 -0
- package/dist/src/decorators.js.map +1 -0
- package/dist/src/error.d.ts +130 -0
- package/dist/src/error.d.ts.map +1 -0
- package/dist/src/error.js +290 -0
- package/dist/src/error.js.map +1 -0
- package/dist/src/http_client.d.ts +82 -0
- package/dist/src/http_client.d.ts.map +1 -0
- package/dist/src/http_client.js +286 -0
- package/dist/src/http_client.js.map +1 -0
- package/dist/src/http_system_database.d.ts +84 -0
- package/dist/src/http_system_database.d.ts.map +1 -0
- package/dist/src/http_system_database.js +429 -0
- package/dist/src/http_system_database.js.map +1 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +53 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/scheduler/crontab.d.ts +14 -0
- package/dist/src/scheduler/crontab.d.ts.map +1 -0
- package/dist/src/scheduler/crontab.js +308 -0
- package/dist/src/scheduler/crontab.js.map +1 -0
- package/dist/src/scheduler/scheduler.d.ts +41 -0
- package/dist/src/scheduler/scheduler.d.ts.map +1 -0
- package/dist/src/scheduler/scheduler.js +165 -0
- package/dist/src/scheduler/scheduler.js.map +1 -0
- package/dist/src/serialization.d.ts +57 -0
- package/dist/src/serialization.d.ts.map +1 -0
- package/dist/src/serialization.js +306 -0
- package/dist/src/serialization.js.map +1 -0
- package/dist/src/solidactions-executor.d.ts +177 -0
- package/dist/src/solidactions-executor.d.ts.map +1 -0
- package/dist/src/solidactions-executor.js +817 -0
- package/dist/src/solidactions-executor.js.map +1 -0
- package/dist/src/solidactions.d.ts +519 -0
- package/dist/src/solidactions.d.ts.map +1 -0
- package/dist/src/solidactions.js +1284 -0
- package/dist/src/solidactions.js.map +1 -0
- package/dist/src/step.d.ts +16 -0
- package/dist/src/step.d.ts.map +1 -0
- package/dist/src/step.js +3 -0
- package/dist/src/step.js.map +1 -0
- package/dist/src/system_database.d.ts +141 -0
- package/dist/src/system_database.d.ts.map +1 -0
- package/dist/src/system_database.js +25 -0
- package/dist/src/system_database.js.map +1 -0
- package/dist/src/telemetry/collector.d.ts +13 -0
- package/dist/src/telemetry/collector.d.ts.map +1 -0
- package/dist/src/telemetry/collector.js +63 -0
- package/dist/src/telemetry/collector.js.map +1 -0
- package/dist/src/telemetry/exporters.d.ts +13 -0
- package/dist/src/telemetry/exporters.d.ts.map +1 -0
- package/dist/src/telemetry/exporters.js +101 -0
- package/dist/src/telemetry/exporters.js.map +1 -0
- package/dist/src/telemetry/logs.d.ts +52 -0
- package/dist/src/telemetry/logs.d.ts.map +1 -0
- package/dist/src/telemetry/logs.js +287 -0
- package/dist/src/telemetry/logs.js.map +1 -0
- package/dist/src/telemetry/traces.d.ts +52 -0
- package/dist/src/telemetry/traces.d.ts.map +1 -0
- package/dist/src/telemetry/traces.js +150 -0
- package/dist/src/telemetry/traces.js.map +1 -0
- package/dist/src/utils.d.ts +26 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +136 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/src/wfqueue.d.ts +64 -0
- package/dist/src/wfqueue.d.ts.map +1 -0
- package/dist/src/wfqueue.js +147 -0
- package/dist/src/wfqueue.js.map +1 -0
- package/dist/src/workflow.d.ts +154 -0
- package/dist/src/workflow.d.ts.map +1 -0
- package/dist/src/workflow.js +99 -0
- package/dist/src/workflow.js.map +1 -0
- package/dist/src/workflow_management.d.ts +15 -0
- package/dist/src/workflow_management.d.ts.map +1 -0
- package/dist/src/workflow_management.js +87 -0
- package/dist/src/workflow_management.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/docs/api-schema.md +1441 -0
- package/docs/migration-guide.md +460 -0
- package/docs/phase-14-changes.md +156 -0
- package/docs/solidsteps-ai-prompt.md +534 -0
- package/eslint.config.cjs +50 -0
- package/package.json +84 -0
- package/solidactions-ai-prompt.md +1504 -0
- package/solidactions-config.schema.json +132 -0
- package/solidactions-test-config.yaml +15 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Product Requirements Document: DBOS HTTP SDK Conversion
|
|
2
|
+
|
|
3
|
+
## Problem & Goal
|
|
4
|
+
|
|
5
|
+
**Problem:** The DBOS TypeScript SDK currently requires direct PostgreSQL database credentials to function. This creates credential management overhead, tight coupling between SDK consumers and the database layer, and security concerns around distributing database access.
|
|
6
|
+
|
|
7
|
+
**Goal:** Replace all direct database operations in the SDK with HTTP API calls. SDK consumers should only need:
|
|
8
|
+
|
|
9
|
+
- An API endpoint URL
|
|
10
|
+
- An API key (auth token)
|
|
11
|
+
|
|
12
|
+
Laravel will serve as the API backend, owning the sole database connection. This decouples SDK users from database infrastructure entirely.
|
|
13
|
+
|
|
14
|
+
## Requirements
|
|
15
|
+
|
|
16
|
+
### Must-Have Features
|
|
17
|
+
|
|
18
|
+
1. **Replace All Postgres Operations with HTTP Calls**
|
|
19
|
+
|
|
20
|
+
- Identify every Postgres read/write operation in the current SDK
|
|
21
|
+
- Create corresponding HTTP endpoints that mirror these operations
|
|
22
|
+
- SDK calls HTTP API instead of direct database queries
|
|
23
|
+
- Preserve all existing functionality (workflow state, step caching, signals, sleeps)
|
|
24
|
+
|
|
25
|
+
2. **API Schema Documentation**
|
|
26
|
+
|
|
27
|
+
- Document all required HTTP endpoints
|
|
28
|
+
- Include request/response schemas for each endpoint
|
|
29
|
+
- Note atomicity requirements (where current code uses transactions)
|
|
30
|
+
- Format: OpenAPI/Swagger or detailed markdown
|
|
31
|
+
|
|
32
|
+
3. **Error Handling (Best Practices)**
|
|
33
|
+
| HTTP Status | SDK Behavior |
|
|
34
|
+
|-------------|--------------|
|
|
35
|
+
| 2xx | Success - return data |
|
|
36
|
+
| 400 Bad Request | Throw validation error (don't retry) |
|
|
37
|
+
| 401 Unauthorized | Throw auth error (don't retry) |
|
|
38
|
+
| 404 Not Found | Throw not found error (don't retry) |
|
|
39
|
+
| 409 Conflict | Throw conflict error (don't retry) |
|
|
40
|
+
| 429 Rate Limited | Retry with backoff (respect Retry-After header) |
|
|
41
|
+
| 5xx Server Error | Retry with exponential backoff |
|
|
42
|
+
| Network Error | Retry with exponential backoff |
|
|
43
|
+
|
|
44
|
+
4. **Retry Logic (Best Practices)**
|
|
45
|
+
|
|
46
|
+
- Exponential backoff with jitter (prevents thundering herd)
|
|
47
|
+
- Maximum 3 retry attempts for transient failures
|
|
48
|
+
- Only retry 5xx errors and network failures (not 4xx client errors)
|
|
49
|
+
- Configurable request timeout
|
|
50
|
+
- Respect `Retry-After` header when present
|
|
51
|
+
|
|
52
|
+
5. **Authentication**
|
|
53
|
+
- API key authentication via `Authorization: Bearer <key>` header
|
|
54
|
+
- Standard Laravel Sanctum / API token pattern
|
|
55
|
+
- SDK accepts API key in configuration
|
|
56
|
+
|
|
57
|
+
### Technical Requirements
|
|
58
|
+
|
|
59
|
+
**SDK Side (TypeScript):**
|
|
60
|
+
|
|
61
|
+
- Remove all direct Postgres/pg dependencies
|
|
62
|
+
- Add HTTP client (fetch or axios)
|
|
63
|
+
- Implement retry logic with exponential backoff
|
|
64
|
+
- Map HTTP errors to appropriate SDK exceptions
|
|
65
|
+
- Configuration: API URL + API key (instead of DB connection string)
|
|
66
|
+
|
|
67
|
+
**API Side (Laravel):**
|
|
68
|
+
|
|
69
|
+
- RESTful endpoints mirroring current DB operations
|
|
70
|
+
- API key authentication (Sanctum or custom)
|
|
71
|
+
- Atomic operations where current SDK uses transactions
|
|
72
|
+
- Proper HTTP status codes for all error conditions
|
|
73
|
+
- JSON request/response format
|
|
74
|
+
|
|
75
|
+
**Transport:**
|
|
76
|
+
|
|
77
|
+
- HTTPS only (TLS required)
|
|
78
|
+
- JSON content type
|
|
79
|
+
- Standard REST conventions
|
|
80
|
+
|
|
81
|
+
## Out of Scope
|
|
82
|
+
|
|
83
|
+
| Excluded | Rationale |
|
|
84
|
+
| ---------------------------------- | ----------------------------------------------- |
|
|
85
|
+
| Backward compatibility (dual-mode) | Clean break - HTTP only, simplifies maintenance |
|
|
86
|
+
| User migration support | Not migrating existing users |
|
|
87
|
+
| New features | 1:1 replacement only, no feature additions |
|
|
88
|
+
| Multi-tenancy in SDK | Laravel handles tenant scoping via API key |
|
|
89
|
+
| WebSocket/real-time support | Not in current SDK, not adding |
|
|
90
|
+
| Batch/bulk operations | Only if already exists in current SDK |
|
|
91
|
+
| SDK-side caching | Keep SDK stateless, caching is server concern |
|
|
92
|
+
| Mobile SDK variants | TypeScript/Node only |
|
|
93
|
+
|
|
94
|
+
## Success Criteria
|
|
95
|
+
|
|
96
|
+
1. **Functional:** SDK can execute all current workflows without database credentials
|
|
97
|
+
2. **Parity:** All existing DBOS functionality works identically over HTTP
|
|
98
|
+
3. **Documentation:** Complete API schema ready for Laravel implementation
|
|
99
|
+
4. **Clean:** All Postgres dependencies removed from SDK
|
|
100
|
+
5. **Robust:** Proper error handling and retry logic for network failures
|
|
101
|
+
|
|
102
|
+
## Implementation Approach
|
|
103
|
+
|
|
104
|
+
### Phase 1: Analysis
|
|
105
|
+
|
|
106
|
+
1. Audit current SDK codebase for all Postgres operations
|
|
107
|
+
2. Document each operation's purpose, inputs, outputs
|
|
108
|
+
3. Identify transaction boundaries (atomicity requirements)
|
|
109
|
+
4. Map current exceptions to HTTP error codes
|
|
110
|
+
|
|
111
|
+
### Phase 2: API Design
|
|
112
|
+
|
|
113
|
+
1. Design HTTP endpoints mirroring DB operations
|
|
114
|
+
2. Create OpenAPI/schema documentation
|
|
115
|
+
3. Define request/response formats
|
|
116
|
+
4. Document atomicity requirements for Laravel
|
|
117
|
+
|
|
118
|
+
### Phase 3: SDK Modification
|
|
119
|
+
|
|
120
|
+
1. Remove Postgres client dependencies
|
|
121
|
+
2. Implement HTTP client with retry logic
|
|
122
|
+
3. Replace all DB calls with HTTP calls
|
|
123
|
+
4. Update configuration (URL + API key)
|
|
124
|
+
5. Map HTTP errors to SDK exceptions
|
|
125
|
+
|
|
126
|
+
### Phase 4: Validation
|
|
127
|
+
|
|
128
|
+
1. Ensure all existing tests pass (with mocked HTTP)
|
|
129
|
+
2. Integration testing against Laravel API
|
|
130
|
+
3. Document removed dependencies
|
|
131
|
+
|
|
132
|
+
## Deliverables
|
|
133
|
+
|
|
134
|
+
1. **Modified SDK** - TypeScript SDK with HTTP transport (no Postgres)
|
|
135
|
+
2. **API Schema Documentation** - Complete endpoint specifications for Laravel
|
|
136
|
+
3. **Migration Guide** - What changed, new configuration format
|
|
137
|
+
4. **Removed Dependencies List** - Postgres packages to remove from package.json
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
_Generated with Clavix Planning Mode_
|
|
142
|
+
_Generated: 2026-01-10T03:35:00Z_
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# DBOS HTTP SDK Conversion - Quick PRD
|
|
2
|
+
|
|
3
|
+
**Goal:** Modify the DBOS TypeScript SDK to replace all direct PostgreSQL database operations with HTTP API calls. The SDK should only require an API endpoint URL and API key for authentication - no database credentials. Laravel will serve as the API backend, owning the sole database connection. This is a clean break with no backward compatibility - HTTP transport only.
|
|
4
|
+
|
|
5
|
+
**Core Requirements:** (1) Replace every Postgres read/write operation with an equivalent HTTP call, preserving all existing functionality (workflow state, step caching, signals, sleeps). (2) Generate comprehensive API schema documentation for Laravel implementation, including request/response formats and atomicity requirements where transactions are currently used. (3) Implement error handling best practices: 4xx errors throw immediately without retry, 5xx and network errors retry with exponential backoff + jitter (max 3 attempts), respect Retry-After headers. (4) Authentication via `Authorization: Bearer <api-key>` header (standard Laravel Sanctum pattern).
|
|
6
|
+
|
|
7
|
+
**Boundaries:** No new features - this is a 1:1 transport layer replacement. No dual-mode support, no user migration, no WebSocket/real-time additions. Multi-tenancy is Laravel's concern (SDK just passes API key, Laravel determines tenant). Deliverables: modified SDK with HTTP transport, complete API schema documentation, and list of removed Postgres dependencies.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
_Generated with Clavix Planning Mode_
|
|
12
|
+
_Generated: 2026-01-10T03:35:00Z_
|