@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,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapHttpError = exports.HttpClient = void 0;
|
|
4
|
+
const error_1 = require("./error");
|
|
5
|
+
/**
|
|
6
|
+
* HTTP Client for SolidActions SDK with retry logic and error handling.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Exponential backoff with jitter for retries
|
|
10
|
+
* - Only retries on 5xx and network errors (not 4xx)
|
|
11
|
+
* - Respects Retry-After header
|
|
12
|
+
* - Configurable timeout and retry count
|
|
13
|
+
*/
|
|
14
|
+
class HttpClient {
|
|
15
|
+
baseUrl;
|
|
16
|
+
apiKey;
|
|
17
|
+
timeout;
|
|
18
|
+
maxRetries;
|
|
19
|
+
retryDelay;
|
|
20
|
+
logger;
|
|
21
|
+
constructor(config, logger) {
|
|
22
|
+
this.baseUrl = config.baseUrl.replace(/\/$/, ''); // Remove trailing slash
|
|
23
|
+
this.apiKey = config.apiKey;
|
|
24
|
+
this.timeout = config.timeout ?? 30000;
|
|
25
|
+
this.maxRetries = config.maxRetries ?? 3;
|
|
26
|
+
this.retryDelay = config.retryDelay ?? 1000;
|
|
27
|
+
this.logger = logger;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Set the logger instance (useful when logger is created after HttpClient)
|
|
31
|
+
*/
|
|
32
|
+
setLogger(logger) {
|
|
33
|
+
this.logger = logger;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Make an HTTP request with retry logic
|
|
37
|
+
*/
|
|
38
|
+
async request(method, path, body, options) {
|
|
39
|
+
const url = `${this.baseUrl}${path.startsWith('/') ? path : `/${path}`}`;
|
|
40
|
+
let lastError;
|
|
41
|
+
for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
|
|
42
|
+
try {
|
|
43
|
+
const response = await this.executeRequest(method, url, body, options);
|
|
44
|
+
// Success - parse and return response
|
|
45
|
+
if (response.ok) {
|
|
46
|
+
const contentType = response.headers.get('content-type');
|
|
47
|
+
if (contentType?.includes('application/json')) {
|
|
48
|
+
return (await response.json());
|
|
49
|
+
}
|
|
50
|
+
// For non-JSON responses, return empty object or text
|
|
51
|
+
const text = await response.text();
|
|
52
|
+
if (text === '') {
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
return JSON.parse(text);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return { data: text };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Handle HTTP errors
|
|
63
|
+
const responseBody = await this.parseErrorBody(response);
|
|
64
|
+
// 4xx errors - don't retry, throw immediately
|
|
65
|
+
if (response.status >= 400 && response.status < 500) {
|
|
66
|
+
this.mapHttpErrorToException(response.status, responseBody);
|
|
67
|
+
}
|
|
68
|
+
// 5xx errors - retry with backoff
|
|
69
|
+
if (response.status >= 500) {
|
|
70
|
+
lastError = new error_1.SolidActionsServerError(responseBody?.message ?? `Server error: ${response.status}`, response.status, responseBody);
|
|
71
|
+
if (attempt < this.maxRetries) {
|
|
72
|
+
const delay = this.calculateRetryDelay(attempt, response);
|
|
73
|
+
this.logger?.warn(`HTTP request failed with status ${response.status}, retrying in ${delay}ms (attempt ${attempt + 1}/${this.maxRetries})`);
|
|
74
|
+
await this.sleep(delay);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
// Max retries exhausted for 5xx - throw the server error
|
|
78
|
+
throw lastError;
|
|
79
|
+
}
|
|
80
|
+
// Unknown error status - throw
|
|
81
|
+
throw new error_1.SolidActionsHttpError(responseBody?.message ?? `HTTP error: ${response.status}`, response.status, responseBody);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
// Handle network errors and other exceptions
|
|
85
|
+
if (error instanceof error_1.SolidActionsHttpError) {
|
|
86
|
+
throw error; // Re-throw HTTP errors (4xx) immediately
|
|
87
|
+
}
|
|
88
|
+
// Network errors - retry with backoff
|
|
89
|
+
if (this.isNetworkError(error)) {
|
|
90
|
+
lastError = new error_1.SolidActionsNetworkError(error instanceof Error ? error.message : 'Network error');
|
|
91
|
+
if (attempt < this.maxRetries) {
|
|
92
|
+
const delay = this.calculateRetryDelay(attempt);
|
|
93
|
+
this.logger?.warn(`Network error during HTTP request, retrying in ${delay}ms (attempt ${attempt + 1}/${this.maxRetries}): ${lastError.message}`);
|
|
94
|
+
await this.sleep(delay);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
// Max retries exhausted for network errors - throw the network error
|
|
98
|
+
throw lastError;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// Unknown error type - throw immediately
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// All retries exhausted
|
|
107
|
+
throw lastError ?? new error_1.SolidActionsNetworkError('Request failed after all retries');
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Convenience methods for common HTTP methods
|
|
111
|
+
*/
|
|
112
|
+
async get(path, options) {
|
|
113
|
+
return this.request('GET', path, undefined, options);
|
|
114
|
+
}
|
|
115
|
+
async post(path, body, options) {
|
|
116
|
+
return this.request('POST', path, body, options);
|
|
117
|
+
}
|
|
118
|
+
async put(path, body, options) {
|
|
119
|
+
return this.request('PUT', path, body, options);
|
|
120
|
+
}
|
|
121
|
+
async delete(path, options) {
|
|
122
|
+
return this.request('DELETE', path, undefined, options);
|
|
123
|
+
}
|
|
124
|
+
async patch(path, body, options) {
|
|
125
|
+
return this.request('PATCH', path, body, options);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Execute a single HTTP request with timeout
|
|
129
|
+
*/
|
|
130
|
+
async executeRequest(method, url, body, options) {
|
|
131
|
+
const controller = new AbortController();
|
|
132
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
133
|
+
try {
|
|
134
|
+
const headers = {
|
|
135
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
136
|
+
'Content-Type': 'application/json',
|
|
137
|
+
Accept: 'application/json',
|
|
138
|
+
...options?.headers,
|
|
139
|
+
};
|
|
140
|
+
// Add worker session ID header if available (for linking operations to workers)
|
|
141
|
+
const workerSessionId = process.env.SOLIDACTIONS_WORKER_SESSION_ID;
|
|
142
|
+
if (workerSessionId) {
|
|
143
|
+
headers['X-Worker-Session-ID'] = workerSessionId;
|
|
144
|
+
}
|
|
145
|
+
const fetchOptions = {
|
|
146
|
+
method,
|
|
147
|
+
headers,
|
|
148
|
+
signal: options?.signal ?? controller.signal,
|
|
149
|
+
};
|
|
150
|
+
if (body !== undefined && method !== 'GET' && method !== 'HEAD') {
|
|
151
|
+
fetchOptions.body = JSON.stringify(body);
|
|
152
|
+
}
|
|
153
|
+
return await fetch(url, fetchOptions);
|
|
154
|
+
}
|
|
155
|
+
finally {
|
|
156
|
+
clearTimeout(timeoutId);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Parse error response body
|
|
161
|
+
*/
|
|
162
|
+
async parseErrorBody(response) {
|
|
163
|
+
try {
|
|
164
|
+
const text = await response.text();
|
|
165
|
+
if (text) {
|
|
166
|
+
return JSON.parse(text);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
// Ignore parse errors
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Map HTTP status codes to appropriate SDK exceptions
|
|
176
|
+
*/
|
|
177
|
+
mapHttpErrorToException(status, body) {
|
|
178
|
+
const message = body?.message ?? `HTTP error ${status}`;
|
|
179
|
+
switch (status) {
|
|
180
|
+
case 400:
|
|
181
|
+
throw new error_1.SolidActionsDataValidationError(message);
|
|
182
|
+
case 401:
|
|
183
|
+
throw new error_1.SolidActionsUnauthorizedError(message);
|
|
184
|
+
case 403:
|
|
185
|
+
throw new error_1.SolidActionsForbiddenError(message);
|
|
186
|
+
case 404:
|
|
187
|
+
// Check if this is a workflow not found error
|
|
188
|
+
if (body?.type === 'workflow_not_found') {
|
|
189
|
+
throw new error_1.SolidActionsNonExistentWorkflowError(message);
|
|
190
|
+
}
|
|
191
|
+
throw new error_1.SolidActionsNotFoundError(message);
|
|
192
|
+
case 409:
|
|
193
|
+
// Workflow conflict
|
|
194
|
+
throw new error_1.SolidActionsWorkflowConflictError(body?.workflowID ?? 'unknown');
|
|
195
|
+
case 429:
|
|
196
|
+
throw new error_1.SolidActionsRateLimitedError(message, body?.retryAfter);
|
|
197
|
+
default:
|
|
198
|
+
if (status >= 500) {
|
|
199
|
+
throw new error_1.SolidActionsServerError(message, status, body);
|
|
200
|
+
}
|
|
201
|
+
throw new error_1.SolidActionsHttpError(message, status, body);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Calculate retry delay with exponential backoff and jitter
|
|
206
|
+
* Formula: delay * 2^attempt + random(0, delay * 0.5)
|
|
207
|
+
*/
|
|
208
|
+
calculateRetryDelay(attempt, response) {
|
|
209
|
+
// Check for Retry-After header
|
|
210
|
+
if (response) {
|
|
211
|
+
const retryAfter = response.headers.get('Retry-After');
|
|
212
|
+
if (retryAfter) {
|
|
213
|
+
// Retry-After can be seconds or HTTP date
|
|
214
|
+
const seconds = parseInt(retryAfter, 10);
|
|
215
|
+
if (!isNaN(seconds)) {
|
|
216
|
+
return seconds * 1000;
|
|
217
|
+
}
|
|
218
|
+
// Try parsing as date
|
|
219
|
+
const date = Date.parse(retryAfter);
|
|
220
|
+
if (!isNaN(date)) {
|
|
221
|
+
return Math.max(0, date - Date.now());
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// Exponential backoff with jitter
|
|
226
|
+
const baseDelay = this.retryDelay * Math.pow(2, attempt);
|
|
227
|
+
const jitter = Math.random() * (this.retryDelay * 0.5);
|
|
228
|
+
return baseDelay + jitter;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Check if an error is a network error
|
|
232
|
+
*/
|
|
233
|
+
isNetworkError(error) {
|
|
234
|
+
if (error instanceof TypeError) {
|
|
235
|
+
// fetch throws TypeError for network errors
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
if (error instanceof Error) {
|
|
239
|
+
const message = error.message.toLowerCase();
|
|
240
|
+
return (message.includes('network') ||
|
|
241
|
+
message.includes('fetch') ||
|
|
242
|
+
message.includes('econnrefused') ||
|
|
243
|
+
message.includes('enotfound') ||
|
|
244
|
+
message.includes('etimedout') ||
|
|
245
|
+
message.includes('abort'));
|
|
246
|
+
}
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Sleep helper
|
|
251
|
+
*/
|
|
252
|
+
sleep(ms) {
|
|
253
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
exports.HttpClient = HttpClient;
|
|
257
|
+
/**
|
|
258
|
+
* Map HTTP response to SDK error (exported for use elsewhere)
|
|
259
|
+
*/
|
|
260
|
+
function mapHttpError(status, body) {
|
|
261
|
+
const message = body?.message ?? `HTTP error ${status}`;
|
|
262
|
+
switch (status) {
|
|
263
|
+
case 400:
|
|
264
|
+
throw new error_1.SolidActionsDataValidationError(message);
|
|
265
|
+
case 401:
|
|
266
|
+
throw new error_1.SolidActionsUnauthorizedError(message);
|
|
267
|
+
case 403:
|
|
268
|
+
throw new error_1.SolidActionsForbiddenError(message);
|
|
269
|
+
case 404:
|
|
270
|
+
if (body?.type === 'workflow_not_found') {
|
|
271
|
+
throw new error_1.SolidActionsNonExistentWorkflowError(message);
|
|
272
|
+
}
|
|
273
|
+
throw new error_1.SolidActionsNotFoundError(message);
|
|
274
|
+
case 409:
|
|
275
|
+
throw new error_1.SolidActionsWorkflowConflictError(body?.workflowID ?? 'unknown');
|
|
276
|
+
case 429:
|
|
277
|
+
throw new error_1.SolidActionsRateLimitedError(message, body?.retryAfter);
|
|
278
|
+
default:
|
|
279
|
+
if (status >= 500) {
|
|
280
|
+
throw new error_1.SolidActionsServerError(message, status, body);
|
|
281
|
+
}
|
|
282
|
+
throw new error_1.SolidActionsHttpError(message, status, body);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
exports.mapHttpError = mapHttpError;
|
|
286
|
+
//# sourceMappingURL=http_client.js.map
|
|
@@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{ SystemDatabase, WorkflowStatusInternal, SystemDatabaseStoredResult, MetricData } from './system_database';
|
|
2
|
+
import { SolidActionsHttpConfig } from './config';
|
|
3
|
+
import { GlobalLogger } from './telemetry/logs';
|
|
4
|
+
import { GetPendingWorkflowsOutput, GetWorkflowsInput, StatusString } from './workflow';
|
|
5
|
+
import { operation_outputs } from '../schemas/system_db_schema';
|
|
6
|
+
import { SolidActionsExternalState } from './solidactions-executor';
|
|
7
|
+
import { SolidActionsSerializer } from './serialization';
|
|
8
|
+
/**
|
|
9
|
+
* HTTP-based implementation of SystemDatabase.
|
|
10
|
+
*
|
|
11
|
+
* This class replaces PostgresSystemDatabase and communicates with
|
|
12
|
+
* the Laravel backend via HTTP API calls instead of direct database access.
|
|
13
|
+
*/
|
|
14
|
+
export declare class HttpSystemDatabase implements SystemDatabase {
|
|
15
|
+
private client;
|
|
16
|
+
private executorID;
|
|
17
|
+
private appVersion;
|
|
18
|
+
private logger;
|
|
19
|
+
private readonly serializer;
|
|
20
|
+
private readonly runningWorkflows;
|
|
21
|
+
private readonly workflowCancellationMap;
|
|
22
|
+
private readonly pollIntervalMs;
|
|
23
|
+
private readonly eventPollIntervalMs;
|
|
24
|
+
constructor(config: SolidActionsHttpConfig, executorID: string, appVersion: string, logger: GlobalLogger, serializer: SolidActionsSerializer);
|
|
25
|
+
getSerializer(): SolidActionsSerializer;
|
|
26
|
+
init(_debugMode?: boolean): Promise<void>;
|
|
27
|
+
destroy(): Promise<void>;
|
|
28
|
+
initWorkflowStatus(initStatus: WorkflowStatusInternal, ownerXid: string | null, options?: {
|
|
29
|
+
isRecoveryRequest?: boolean;
|
|
30
|
+
isDequeuedRequest?: boolean;
|
|
31
|
+
maxRetries?: number;
|
|
32
|
+
}): Promise<{
|
|
33
|
+
status: string;
|
|
34
|
+
shouldExecuteOnThisExecutor: boolean;
|
|
35
|
+
deadlineEpochMS?: number;
|
|
36
|
+
}>;
|
|
37
|
+
recordWorkflowOutput(workflowID: string, status: WorkflowStatusInternal): Promise<void>;
|
|
38
|
+
recordWorkflowError(workflowID: string, status: WorkflowStatusInternal): Promise<void>;
|
|
39
|
+
getWorkflowStatus(workflowID: string, callerID?: string, callerFN?: number): Promise<WorkflowStatusInternal | null>;
|
|
40
|
+
getPendingWorkflows(executorID: string, appVersion: string): Promise<GetPendingWorkflowsOutput[]>;
|
|
41
|
+
listWorkflows(input: GetWorkflowsInput): Promise<WorkflowStatusInternal[]>;
|
|
42
|
+
getOperationResultAndThrowIfCancelled(workflowID: string, functionID: number): Promise<SystemDatabaseStoredResult | undefined>;
|
|
43
|
+
getAllOperationResults(workflowID: string): Promise<operation_outputs[]>;
|
|
44
|
+
recordOperationResult(workflowID: string, functionID: number, functionName: string, checkConflict: boolean, startTimeEpochMs: number, options?: {
|
|
45
|
+
childWorkflowID?: string | null;
|
|
46
|
+
output?: string | null;
|
|
47
|
+
error?: string | null;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
awaitWorkflowResult(workflowID: string, timeoutSeconds?: number, callerID?: string, timerFuncID?: number): Promise<SystemDatabaseStoredResult | undefined>;
|
|
50
|
+
setWorkflowStatus(workflowID: string, status: (typeof StatusString)[keyof typeof StatusString], resetRecoveryAttempts: boolean): Promise<void>;
|
|
51
|
+
cancelWorkflow(workflowID: string): Promise<void>;
|
|
52
|
+
resumeWorkflow(workflowID: string): Promise<void>;
|
|
53
|
+
forkWorkflow(workflowID: string, startStep: number, options?: {
|
|
54
|
+
newWorkflowID?: string;
|
|
55
|
+
applicationVersion?: string;
|
|
56
|
+
timeoutMS?: number;
|
|
57
|
+
}): Promise<string>;
|
|
58
|
+
checkIfCanceled(workflowID: string): Promise<void>;
|
|
59
|
+
registerRunningWorkflow(workflowID: string, workflowPromise: Promise<unknown>): void;
|
|
60
|
+
checkForRunningWorkflow(workflowID: string): boolean;
|
|
61
|
+
awaitRunningWorkflows(): Promise<void>;
|
|
62
|
+
send(workflowID: string, functionID: number, destinationID: string, message: string | null, topic?: string): Promise<void>;
|
|
63
|
+
recv(workflowID: string, functionID: number, timeoutFunctionID: number, topic?: string, timeoutSeconds?: number): Promise<string | null>;
|
|
64
|
+
durableSleepms(workflowID: string, functionID: number, duration: number): Promise<void>;
|
|
65
|
+
setEvent(workflowID: string, functionID: number, key: string, value: string | null): Promise<void>;
|
|
66
|
+
getEvent(workflowID: string, key: string, timeoutSeconds: number, callerWorkflow?: {
|
|
67
|
+
workflowID: string;
|
|
68
|
+
functionID: number;
|
|
69
|
+
timeoutFunctionID: number;
|
|
70
|
+
}): Promise<string | null>;
|
|
71
|
+
getEventDispatchState(service: string, workflowFnName: string, key: string): Promise<SolidActionsExternalState | undefined>;
|
|
72
|
+
upsertEventDispatchState(state: SolidActionsExternalState): Promise<SolidActionsExternalState>;
|
|
73
|
+
writeStreamFromWorkflow(workflowID: string, functionID: number, key: string, value: unknown): Promise<void>;
|
|
74
|
+
writeStreamFromStep(workflowID: string, key: string, value: unknown): Promise<void>;
|
|
75
|
+
closeStream(workflowID: string, functionID: number, key: string): Promise<void>;
|
|
76
|
+
readStream(workflowID: string, key: string, offset: number): Promise<unknown>;
|
|
77
|
+
garbageCollect(cutoffEpochTimestampMs?: number, rowsThreshold?: number): Promise<void>;
|
|
78
|
+
getMetrics(startTime: string, endTime: string): Promise<MetricData[]>;
|
|
79
|
+
checkPatch(workflowID: string, functionID: number, patchName: string, deprecated: boolean): Promise<{
|
|
80
|
+
isPatched: boolean;
|
|
81
|
+
hasEntry: boolean;
|
|
82
|
+
}>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=http_system_database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http_system_database.d.ts","sourceRoot":"","sources":["../../src/http_system_database.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,0BAA0B,EAC1B,UAAU,EAEX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO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