rocketride 1.0.6 → 1.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 +2 -2
- package/dist/cjs/account.js +284 -0
- package/dist/cjs/account.js.map +1 -0
- package/dist/cjs/billing.js +171 -0
- package/dist/cjs/billing.js.map +1 -0
- package/dist/cjs/client.js +1226 -756
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/constants.js +10 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/core/DAPBase.js +4 -1
- package/dist/cjs/core/DAPBase.js.map +1 -1
- package/dist/cjs/core/DAPClient.js +121 -50
- package/dist/cjs/core/DAPClient.js.map +1 -1
- package/dist/cjs/core/TransportBase.js +0 -10
- package/dist/cjs/core/TransportBase.js.map +1 -1
- package/dist/cjs/core/TransportWebSocket.js +30 -19
- package/dist/cjs/core/TransportWebSocket.js.map +1 -1
- package/dist/cjs/database.js +121 -0
- package/dist/cjs/database.js.map +1 -0
- package/dist/cjs/deploy.js +108 -0
- package/dist/cjs/deploy.js.map +1 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/schema/Question.js +2 -0
- package/dist/cjs/schema/Question.js.map +1 -1
- package/dist/cjs/types/account.js +26 -0
- package/dist/cjs/types/account.js.map +1 -0
- package/dist/cjs/types/billing.js +26 -0
- package/dist/cjs/types/billing.js.map +1 -0
- package/dist/cjs/types/client.js +14 -0
- package/dist/cjs/types/client.js.map +1 -1
- package/dist/cjs/types/cprofile.js +26 -0
- package/dist/cjs/types/cprofile.js.map +1 -0
- package/dist/cjs/types/dashboard.js +26 -0
- package/dist/cjs/types/dashboard.js.map +1 -0
- package/dist/cjs/types/deploy.js +26 -0
- package/dist/cjs/types/deploy.js.map +1 -0
- package/dist/cjs/types/events.js +5 -1
- package/dist/cjs/types/events.js.map +1 -1
- package/dist/cjs/types/index.js +6 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/service.js +85 -0
- package/dist/cjs/types/service.js.map +1 -0
- package/dist/cli/cli/rocketride.js +335 -113
- package/dist/cli/cli/rocketride.js.map +1 -1
- package/dist/cli/client/account.js +284 -0
- package/dist/cli/client/account.js.map +1 -0
- package/dist/cli/client/billing.js +171 -0
- package/dist/cli/client/billing.js.map +1 -0
- package/dist/cli/client/client.js +1226 -756
- package/dist/cli/client/client.js.map +1 -1
- package/dist/cli/client/constants.js +10 -1
- package/dist/cli/client/constants.js.map +1 -1
- package/dist/cli/client/core/DAPBase.js +4 -1
- package/dist/cli/client/core/DAPBase.js.map +1 -1
- package/dist/cli/client/core/DAPClient.js +121 -50
- package/dist/cli/client/core/DAPClient.js.map +1 -1
- package/dist/cli/client/core/TransportBase.js +0 -10
- package/dist/cli/client/core/TransportBase.js.map +1 -1
- package/dist/cli/client/core/TransportWebSocket.js +30 -19
- package/dist/cli/client/core/TransportWebSocket.js.map +1 -1
- package/dist/cli/client/database.js +121 -0
- package/dist/cli/client/database.js.map +1 -0
- package/dist/cli/client/deploy.js +108 -0
- package/dist/cli/client/deploy.js.map +1 -0
- package/dist/cli/client/index.js +4 -0
- package/dist/cli/client/index.js.map +1 -1
- package/dist/cli/client/schema/Question.js +2 -0
- package/dist/cli/client/schema/Question.js.map +1 -1
- package/dist/cli/client/types/account.js +26 -0
- package/dist/cli/client/types/account.js.map +1 -0
- package/dist/cli/client/types/billing.js +26 -0
- package/dist/cli/client/types/billing.js.map +1 -0
- package/dist/cli/client/types/client.js +14 -0
- package/dist/cli/client/types/client.js.map +1 -1
- package/dist/cli/client/types/cprofile.js +26 -0
- package/dist/cli/client/types/cprofile.js.map +1 -0
- package/dist/cli/client/types/dashboard.js +26 -0
- package/dist/cli/client/types/dashboard.js.map +1 -0
- package/dist/cli/client/types/deploy.js +26 -0
- package/dist/cli/client/types/deploy.js.map +1 -0
- package/dist/cli/client/types/events.js +5 -1
- package/dist/cli/client/types/events.js.map +1 -1
- package/dist/cli/client/types/index.js +6 -0
- package/dist/cli/client/types/index.js.map +1 -1
- package/dist/cli/client/types/service.js +85 -0
- package/dist/cli/client/types/service.js.map +1 -0
- package/dist/esm/account.js +280 -0
- package/dist/esm/account.js.map +1 -0
- package/dist/esm/billing.js +167 -0
- package/dist/esm/billing.js.map +1 -0
- package/dist/esm/client.js +1226 -756
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/constants.js +9 -0
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/core/DAPBase.js +4 -1
- package/dist/esm/core/DAPBase.js.map +1 -1
- package/dist/esm/core/DAPClient.js +121 -50
- package/dist/esm/core/DAPClient.js.map +1 -1
- package/dist/esm/core/TransportBase.js +0 -10
- package/dist/esm/core/TransportBase.js.map +1 -1
- package/dist/esm/core/TransportWebSocket.js +30 -19
- package/dist/esm/core/TransportWebSocket.js.map +1 -1
- package/dist/esm/database.js +117 -0
- package/dist/esm/database.js.map +1 -0
- package/dist/esm/deploy.js +104 -0
- package/dist/esm/deploy.js.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/schema/Question.js +2 -0
- package/dist/esm/schema/Question.js.map +1 -1
- package/dist/esm/types/account.js +25 -0
- package/dist/esm/types/account.js.map +1 -0
- package/dist/esm/types/billing.js +25 -0
- package/dist/esm/types/billing.js.map +1 -0
- package/dist/esm/types/client.js +13 -1
- package/dist/esm/types/client.js.map +1 -1
- package/dist/esm/types/cprofile.js +25 -0
- package/dist/esm/types/cprofile.js.map +1 -0
- package/dist/esm/types/dashboard.js +25 -0
- package/dist/esm/types/dashboard.js.map +1 -0
- package/dist/esm/types/deploy.js +25 -0
- package/dist/esm/types/deploy.js.map +1 -0
- package/dist/esm/types/events.js +5 -1
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/types/index.js +6 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/service.js +82 -0
- package/dist/esm/types/service.js.map +1 -0
- package/dist/types/account.d.ts +209 -0
- package/dist/types/account.d.ts.map +1 -0
- package/dist/types/billing.d.ts +135 -0
- package/dist/types/billing.d.ts.map +1 -0
- package/dist/types/client.d.ts +568 -285
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/constants.d.ts +9 -0
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/core/DAPBase.d.ts.map +1 -1
- package/dist/types/core/DAPClient.d.ts +89 -7
- package/dist/types/core/DAPClient.d.ts.map +1 -1
- package/dist/types/core/TransportBase.d.ts +1 -11
- package/dist/types/core/TransportBase.d.ts.map +1 -1
- package/dist/types/core/TransportWebSocket.d.ts +14 -11
- package/dist/types/core/TransportWebSocket.d.ts.map +1 -1
- package/dist/types/database.d.ts +90 -0
- package/dist/types/database.d.ts.map +1 -0
- package/dist/types/deploy.d.ts +90 -0
- package/dist/types/deploy.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/schema/Question.d.ts +3 -1
- package/dist/types/schema/Question.d.ts.map +1 -1
- package/dist/types/types/account.d.ts +171 -0
- package/dist/types/types/account.d.ts.map +1 -0
- package/dist/types/types/billing.d.ts +115 -0
- package/dist/types/types/billing.d.ts.map +1 -0
- package/dist/types/types/client.d.ts +241 -1
- package/dist/types/types/client.d.ts.map +1 -1
- package/dist/types/types/cprofile.d.ts +67 -0
- package/dist/types/types/cprofile.d.ts.map +1 -0
- package/dist/types/types/dashboard.d.ts +198 -0
- package/dist/types/types/dashboard.d.ts.map +1 -0
- package/dist/types/types/deploy.d.ts +48 -0
- package/dist/types/types/deploy.d.ts.map +1 -0
- package/dist/types/types/events.d.ts +90 -95
- package/dist/types/types/events.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +6 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/pipeline.d.ts +10 -2
- package/dist/types/types/pipeline.d.ts.map +1 -1
- package/dist/types/types/service.d.ts +189 -0
- package/dist/types/types/service.d.ts.map +1 -0
- package/dist/types/types/task.d.ts +5 -1
- package/dist/types/types/task.d.ts.map +1 -1
- package/package.json +12 -7
package/dist/types/client.d.ts
CHANGED
|
@@ -22,9 +22,13 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
import { DAPClient } from './core/DAPClient.js';
|
|
25
|
-
import { DAPMessage, RocketRideClientConfig } from './types/index.js';
|
|
26
|
-
import { TASK_STATUS, UPLOAD_RESULT, PIPELINE_RESULT, PipelineConfig } from './types/index.js';
|
|
25
|
+
import { DAPMessage, RocketRideClientConfig, ConnectResult, ServerInfoResult } from './types/index.js';
|
|
26
|
+
import { TASK_STATUS, UPLOAD_RESULT, PIPELINE_RESULT, PipelineConfig, DashboardResponse, ServicesResponse, ServiceDefinition, ValidationResult, CProfileStatusResponse, CProfileStopResponse, CProfileReportResponse } from './types/index.js';
|
|
27
27
|
import { Question } from './schema/Question.js';
|
|
28
|
+
import { AccountApi } from './account.js';
|
|
29
|
+
import { BillingApi } from './billing.js';
|
|
30
|
+
import { DatabaseApi } from './database.js';
|
|
31
|
+
import { DeployApi } from './deploy.js';
|
|
28
32
|
/**
|
|
29
33
|
* Streaming data pipe for sending large datasets to RocketRide pipelines.
|
|
30
34
|
*
|
|
@@ -91,7 +95,8 @@ export declare class DataPipe {
|
|
|
91
95
|
* unique pipe ID that is used for subsequent operations.
|
|
92
96
|
*
|
|
93
97
|
* @returns This DataPipe instance (for method chaining)
|
|
94
|
-
* @throws Error if the pipe is already opened
|
|
98
|
+
* @throws Error if the pipe is already opened
|
|
99
|
+
* @throws PipeException if the server rejects the open request
|
|
95
100
|
*/
|
|
96
101
|
open(): Promise<DataPipe>;
|
|
97
102
|
/**
|
|
@@ -101,7 +106,8 @@ export declare class DataPipe {
|
|
|
101
106
|
* multiple times to stream large datasets. The pipe must be opened first.
|
|
102
107
|
*
|
|
103
108
|
* @param buffer - Data to write, must be a Uint8Array
|
|
104
|
-
* @throws Error if the pipe is not opened
|
|
109
|
+
* @throws Error if the pipe is not opened or buffer is invalid
|
|
110
|
+
* @throws PipeException if the server reports a write failure
|
|
105
111
|
*/
|
|
106
112
|
write(buffer: Uint8Array): Promise<void>;
|
|
107
113
|
/**
|
|
@@ -112,7 +118,7 @@ export declare class DataPipe {
|
|
|
112
118
|
* the pipe cannot be reopened or written to again.
|
|
113
119
|
*
|
|
114
120
|
* @returns The processing result from the server, or undefined if already closed
|
|
115
|
-
* @throws
|
|
121
|
+
* @throws PipeException if the server reports a failure while finalizing the pipe
|
|
116
122
|
*/
|
|
117
123
|
close(): Promise<PIPELINE_RESULT | undefined>;
|
|
118
124
|
}
|
|
@@ -134,9 +140,23 @@ export declare class DataPipe {
|
|
|
134
140
|
* - Server connectivity testing (ping)
|
|
135
141
|
* - Full TypeScript type safety
|
|
136
142
|
*/
|
|
143
|
+
/**
|
|
144
|
+
* Identifies a monitor subscription key.
|
|
145
|
+
*
|
|
146
|
+
* - `{ token }` — monitors a specific running task by its session token.
|
|
147
|
+
* - `{ projectId, source }` — monitors a project/source regardless of task.
|
|
148
|
+
*/
|
|
149
|
+
export type MonitorKey = {
|
|
150
|
+
token: string;
|
|
151
|
+
} | {
|
|
152
|
+
projectId: string;
|
|
153
|
+
source: string;
|
|
154
|
+
pipeId?: number;
|
|
155
|
+
};
|
|
137
156
|
export declare class RocketRideClient extends DAPClient {
|
|
138
157
|
private _uri;
|
|
139
158
|
private _apikey?;
|
|
159
|
+
private _wsPath?;
|
|
140
160
|
private _env;
|
|
141
161
|
private _callerOnEvent?;
|
|
142
162
|
private _callerOnConnected?;
|
|
@@ -147,14 +167,23 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
147
167
|
private _nextChatId;
|
|
148
168
|
/** Maps pipe_id → SSE callback for pipe-scoped real-time event dispatch. */
|
|
149
169
|
readonly _ssePipeCallbacks: Map<number, (type: string, data: Record<string, unknown>) => Promise<void>>;
|
|
170
|
+
private _desiredState;
|
|
171
|
+
private _authenticated;
|
|
150
172
|
private _persist;
|
|
151
|
-
private
|
|
152
|
-
private _manualDisconnect;
|
|
153
|
-
private _maxRetryTime?;
|
|
154
|
-
private _retryStartTime?;
|
|
173
|
+
private _reconnectTimer?;
|
|
155
174
|
private _currentReconnectDelay;
|
|
156
|
-
/**
|
|
157
|
-
private
|
|
175
|
+
/** Reference-counted monitor subscriptions: keyString → Map<eventType, refCount> */
|
|
176
|
+
private _monitorKeys;
|
|
177
|
+
/** Lazily-created account API namespace. */
|
|
178
|
+
private _account?;
|
|
179
|
+
/** Lazily-created billing API namespace. */
|
|
180
|
+
private _billing?;
|
|
181
|
+
/** Lazily-created database API namespace. */
|
|
182
|
+
private _database?;
|
|
183
|
+
/** Lazily-created deploy API namespace. */
|
|
184
|
+
private _deploy?;
|
|
185
|
+
/** Optional trace callback for observing all call() traffic. */
|
|
186
|
+
private _onTrace?;
|
|
158
187
|
/**
|
|
159
188
|
* Creates a new RocketRideClient instance.
|
|
160
189
|
*
|
|
@@ -209,6 +238,27 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
209
238
|
* passing it to the client or doing your own validation.
|
|
210
239
|
*/
|
|
211
240
|
static normalizeUri(uri: string): string;
|
|
241
|
+
/**
|
|
242
|
+
* Probe a server for its capabilities without authenticating.
|
|
243
|
+
*
|
|
244
|
+
* Creates a temporary public connection and sends an
|
|
245
|
+
* ``rrext_public_probe`` command. The server responds with version,
|
|
246
|
+
* capabilities, platform, and public apps without requiring credentials.
|
|
247
|
+
*
|
|
248
|
+
* @param uri - Server URI (e.g. ``"localhost:5565"``, ``"https://cloud.rocketride.ai"``)
|
|
249
|
+
* @param timeout - Optional timeout in ms for the entire operation
|
|
250
|
+
* @returns Server info including version and capability tags
|
|
251
|
+
* @throws Error if the server is unreachable or does not support probes
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* ```typescript
|
|
255
|
+
* const info = await RocketRideClient.getServerInfo('localhost:5565');
|
|
256
|
+
* if (info.capabilities.includes('saas')) {
|
|
257
|
+
* // Show cloud sign-in options
|
|
258
|
+
* }
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
static getServerInfo(uri: string, timeout?: number): Promise<ServerInfoResult>;
|
|
212
262
|
/**
|
|
213
263
|
* Normalize a user-provided URI into a fully-formed WebSocket address.
|
|
214
264
|
* Builds on normalizeUri, then converts to ws/wss and appends /task/service.
|
|
@@ -223,61 +273,137 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
223
273
|
*/
|
|
224
274
|
private _setAuth;
|
|
225
275
|
/**
|
|
226
|
-
*
|
|
276
|
+
* Create transport if needed and open the WebSocket. No auth.
|
|
227
277
|
*/
|
|
228
|
-
private
|
|
278
|
+
private _internalAttach;
|
|
229
279
|
/**
|
|
230
|
-
*
|
|
231
|
-
*
|
|
280
|
+
* Send the ``auth`` DAP command over the open transport.
|
|
281
|
+
* Sets ``_authenticated`` and ``_connectResult`` on success.
|
|
282
|
+
* Throws ``AuthenticationException`` on failure (transport stays open).
|
|
232
283
|
*/
|
|
233
|
-
private
|
|
284
|
+
private _internalLogin;
|
|
234
285
|
/**
|
|
235
|
-
*
|
|
236
|
-
|
|
286
|
+
* Send the ``deauth`` DAP command to revert to unauthenticated.
|
|
287
|
+
*/
|
|
288
|
+
private _internalLogout;
|
|
289
|
+
/**
|
|
290
|
+
* Close the transport. Triggers onDisconnected via the transport callback.
|
|
237
291
|
*/
|
|
238
292
|
private _internalDisconnect;
|
|
239
293
|
/**
|
|
240
|
-
*
|
|
241
|
-
* reschedule with exponential backoff. Used by persist-mode connect() and
|
|
242
|
-
* by the reconnect timer.
|
|
294
|
+
* Clear the reconnect timer if active.
|
|
243
295
|
*/
|
|
244
|
-
private
|
|
296
|
+
private _clearReconnectTimer;
|
|
245
297
|
/**
|
|
246
|
-
*
|
|
298
|
+
* Reconnect engine driven by ``_desiredState``.
|
|
299
|
+
*
|
|
300
|
+
* Schedules a timer that re-attaches (and re-logins if the user had
|
|
301
|
+
* been authenticated). Checks ``_desiredState`` after every await so
|
|
302
|
+
* user actions mid-reconnect are respected immediately.
|
|
303
|
+
*
|
|
304
|
+
* Linear backoff: 250ms → 500ms → ... → 15 000ms cap.
|
|
247
305
|
*/
|
|
248
306
|
private _scheduleReconnect;
|
|
307
|
+
/**
|
|
308
|
+
* Attach to a RocketRide server (open WebSocket, no auth).
|
|
309
|
+
*
|
|
310
|
+
* If ``uri`` is provided and differs from the current URI, detaches
|
|
311
|
+
* first. If already attached to the same URI, this is a no-op.
|
|
312
|
+
*
|
|
313
|
+
* After attach, public APIs (``rrext_public_*``) are available.
|
|
314
|
+
*
|
|
315
|
+
* @param uri - Server URI override. Updates the stored URI if provided.
|
|
316
|
+
* @param options - Optional timeout for the WebSocket handshake.
|
|
317
|
+
*/
|
|
318
|
+
attach(uri?: string, options?: {
|
|
319
|
+
timeout?: number;
|
|
320
|
+
}): Promise<void>;
|
|
321
|
+
/**
|
|
322
|
+
* Detach from the server (close WebSocket, cancel reconnection).
|
|
323
|
+
*
|
|
324
|
+
* Sets ``_desiredState`` to ``'detached'`` so the reconnect engine
|
|
325
|
+
* stops and ``onDisconnected`` does not restart it.
|
|
326
|
+
*/
|
|
327
|
+
detach(): Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* True when the WebSocket transport is connected (regardless of auth).
|
|
330
|
+
*/
|
|
331
|
+
isAttached(): boolean;
|
|
332
|
+
/**
|
|
333
|
+
* Authenticate over an attached transport.
|
|
334
|
+
*
|
|
335
|
+
* If ``uri`` is provided and differs, detaches and re-attaches first.
|
|
336
|
+
* If ``auth`` is provided and differs from the current credential,
|
|
337
|
+
* logs out (best-effort) before logging in with the new credential.
|
|
338
|
+
* If already authenticated with the same credential, this is a no-op.
|
|
339
|
+
*
|
|
340
|
+
* @param credential - API key, rr_ token, or PKCE code object.
|
|
341
|
+
* @param options - Optional URI override and/or timeout.
|
|
342
|
+
* @returns ConnectResult with user identity on success.
|
|
343
|
+
* @throws AuthenticationException on auth failure (transport stays attached).
|
|
344
|
+
*/
|
|
345
|
+
login(credential?: string | {
|
|
346
|
+
code: string;
|
|
347
|
+
verifier: string;
|
|
348
|
+
redirectUri: string;
|
|
349
|
+
}, options?: {
|
|
350
|
+
uri?: string;
|
|
351
|
+
timeout?: number;
|
|
352
|
+
}): Promise<ConnectResult>;
|
|
353
|
+
/**
|
|
354
|
+
* Deauthenticate: sends ``deauth`` to the server, clears client auth state.
|
|
355
|
+
* The transport stays attached — public APIs continue to work.
|
|
356
|
+
*/
|
|
357
|
+
logout(): Promise<void>;
|
|
358
|
+
/**
|
|
359
|
+
* True when the auth handshake has succeeded on the current connection.
|
|
360
|
+
*/
|
|
361
|
+
isAuthenticated(): boolean;
|
|
249
362
|
/**
|
|
250
363
|
* Check if the client is currently connected to the RocketRide server.
|
|
364
|
+
* Equivalent to ``isAttached()`` — kept for backward compatibility.
|
|
251
365
|
*/
|
|
252
366
|
isConnected(): boolean;
|
|
253
367
|
/**
|
|
254
|
-
* Connect to the RocketRide server.
|
|
368
|
+
* Connect to the RocketRide server and authenticate in a single call.
|
|
255
369
|
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* (
|
|
259
|
-
*
|
|
370
|
+
* Backward-compatible wrapper around ``attach()`` + ``login()``.
|
|
371
|
+
* Sends the credential as the first DAP message and returns the full
|
|
372
|
+
* ConnectResult (user identity + organizations + teams) on success.
|
|
373
|
+
*
|
|
374
|
+
* @param credential - API key / Zitadel access_token / rr_ user token / PKCE code object.
|
|
375
|
+
* @param options - Optional overrides: uri and/or timeout.
|
|
260
376
|
*/
|
|
261
|
-
connect(
|
|
377
|
+
connect(credential?: string | {
|
|
378
|
+
code: string;
|
|
379
|
+
verifier: string;
|
|
380
|
+
redirectUri: string;
|
|
381
|
+
}, options?: {
|
|
262
382
|
uri?: string;
|
|
263
|
-
auth?: string;
|
|
264
383
|
timeout?: number;
|
|
265
|
-
}): Promise<
|
|
384
|
+
}): Promise<ConnectResult>;
|
|
385
|
+
/**
|
|
386
|
+
* Get the ConnectResult from the last successful connect().
|
|
387
|
+
* Returns undefined if not connected or not yet authenticated.
|
|
388
|
+
*/
|
|
389
|
+
getAccountInfo(): ConnectResult | undefined;
|
|
390
|
+
/**
|
|
391
|
+
* Returns the ID of the user's primary organization.
|
|
392
|
+
*/
|
|
393
|
+
getOrgId(): string | undefined;
|
|
266
394
|
/**
|
|
267
395
|
* Disconnect from the RocketRide server and stop automatic reconnection.
|
|
268
|
-
*
|
|
269
|
-
* Should be called when finished with the client to clean up resources.
|
|
396
|
+
* Backward-compatible wrapper around ``logout()`` + ``detach()``.
|
|
270
397
|
*/
|
|
271
398
|
disconnect(): Promise<void>;
|
|
272
399
|
/**
|
|
273
|
-
* Update
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}): Promise<void>;
|
|
400
|
+
* Update the environment variables used for pipeline substitution.
|
|
401
|
+
*
|
|
402
|
+
* The env dictionary is used by {@link use} and {@link validate} to replace
|
|
403
|
+
// ============================================================================
|
|
404
|
+
// PING METHODS
|
|
405
|
+
// ============================================================================
|
|
406
|
+
|
|
281
407
|
/**
|
|
282
408
|
* Test connectivity to the RocketRide server.
|
|
283
409
|
*
|
|
@@ -286,17 +412,6 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
286
412
|
* and measuring response times.
|
|
287
413
|
*/
|
|
288
414
|
ping(token?: string): Promise<void>;
|
|
289
|
-
/**
|
|
290
|
-
* Substitute environment variables in a string.
|
|
291
|
-
* Replaces ${ROCKETRIDE_*} patterns with values from client's env dictionary.
|
|
292
|
-
* If variable is not found, leaves it unchanged.
|
|
293
|
-
*/
|
|
294
|
-
private substituteEnvVars;
|
|
295
|
-
/**
|
|
296
|
-
* Recursively process an object/array to substitute environment variables.
|
|
297
|
-
* Only processes string values, leaving other types unchanged.
|
|
298
|
-
*/
|
|
299
|
-
private processEnvSubstitution;
|
|
300
415
|
/**
|
|
301
416
|
* Load Node.js fs/promises at runtime without static imports.
|
|
302
417
|
* This keeps browser bundles free of Node built-ins while preserving Node features.
|
|
@@ -334,7 +449,7 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
334
449
|
validate(options: {
|
|
335
450
|
pipeline: PipelineConfig | Record<string, unknown>;
|
|
336
451
|
source?: string;
|
|
337
|
-
}): Promise<
|
|
452
|
+
}): Promise<ValidationResult>;
|
|
338
453
|
/**
|
|
339
454
|
* Start an RocketRide pipeline for processing data.
|
|
340
455
|
*
|
|
@@ -389,6 +504,12 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
389
504
|
ttl?: number;
|
|
390
505
|
/** Pipeline trace level. When set, captures every lane write and invoke call in the response under '_trace'. */
|
|
391
506
|
pipelineTraceLevel?: 'none' | 'metadata' | 'summary' | 'full';
|
|
507
|
+
/** Optional display name for the task (e.g. shown in dashboard). */
|
|
508
|
+
name?: string;
|
|
509
|
+
/** ROCKETRIDE_* environment overrides merged on top of server-side env. */
|
|
510
|
+
env?: Record<string, string>;
|
|
511
|
+
/** Team ID to run the task under. Defaults to the user's default team. */
|
|
512
|
+
teamId?: string;
|
|
392
513
|
}): Promise<Record<string, unknown> & {
|
|
393
514
|
token: string;
|
|
394
515
|
}>;
|
|
@@ -396,10 +517,56 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
396
517
|
* Terminate a running pipeline.
|
|
397
518
|
*/
|
|
398
519
|
terminate(token: string): Promise<void>;
|
|
520
|
+
/**
|
|
521
|
+
* Restart a running pipeline with a new configuration.
|
|
522
|
+
*
|
|
523
|
+
* Looks up the existing task by project/source, terminates it, and
|
|
524
|
+
* starts a new execution in one server round-trip.
|
|
525
|
+
*
|
|
526
|
+
* @param options.token - Existing task token (optional, resolved server-side if omitted).
|
|
527
|
+
* @param options.projectId - The project identifier.
|
|
528
|
+
* @param options.source - The source component identifier.
|
|
529
|
+
* @param options.pipeline - The pipeline configuration to restart with.
|
|
530
|
+
*/
|
|
531
|
+
restart(options: {
|
|
532
|
+
token?: string;
|
|
533
|
+
projectId: string;
|
|
534
|
+
source: string;
|
|
535
|
+
pipeline: Record<string, unknown>;
|
|
536
|
+
}): Promise<void>;
|
|
399
537
|
/**
|
|
400
538
|
* Get the current status of a running pipeline.
|
|
539
|
+
*
|
|
540
|
+
* By default this call is bounded to 15s so callers/tests don't hang forever if the engine
|
|
541
|
+
* stops responding mid-request (especially important in CI). Pass `{ timeout: false }` to
|
|
542
|
+
* restore the previous behavior of using only the client-level request timeout (if any).
|
|
543
|
+
*/
|
|
544
|
+
getTaskStatus(token: string, options?: {
|
|
545
|
+
timeout?: number | false;
|
|
546
|
+
}): Promise<TASK_STATUS>;
|
|
547
|
+
/**
|
|
548
|
+
* Resolve a running task's token from its project ID and source component.
|
|
549
|
+
*
|
|
550
|
+
* The token is required for operations like terminate and restart.
|
|
551
|
+
* Returns undefined if no task is currently running for the given project/source.
|
|
552
|
+
*
|
|
553
|
+
* @param options.projectId - The project identifier.
|
|
554
|
+
* @param options.source - The source component identifier.
|
|
401
555
|
*/
|
|
402
|
-
|
|
556
|
+
getTaskToken(options: {
|
|
557
|
+
projectId: string;
|
|
558
|
+
source: string;
|
|
559
|
+
}): Promise<string | undefined>;
|
|
560
|
+
/**
|
|
561
|
+
* Returns the unresolved pipeline for a running task.
|
|
562
|
+
*
|
|
563
|
+
* The pipeline is returned exactly as stored — ${ROCKETRIDE_*} placeholders are
|
|
564
|
+
* NOT substituted, so no secrets are included in the response.
|
|
565
|
+
*
|
|
566
|
+
* @param token - Task token returned by {@link getTaskToken}.
|
|
567
|
+
* @returns The unresolved pipeline dict, or undefined if the task is not found.
|
|
568
|
+
*/
|
|
569
|
+
getTaskPipeline(token: string): Promise<Record<string, unknown> | undefined>;
|
|
403
570
|
/** Return objinfo with size set; never 0 (parse filter skips "empty"). */
|
|
404
571
|
private _objinfoWithSize;
|
|
405
572
|
/**
|
|
@@ -472,295 +639,343 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
472
639
|
*/
|
|
473
640
|
onConnectError(error: Error): Promise<void>;
|
|
474
641
|
/**
|
|
475
|
-
* Handle connected
|
|
642
|
+
* Handle transport-level connected event.
|
|
643
|
+
*
|
|
644
|
+
* With the attach/login split, this fires when the WebSocket opens
|
|
645
|
+
* (before auth). The ``_internalLogin`` method handles the auth
|
|
646
|
+
* notification separately, so this is intentionally minimal.
|
|
476
647
|
*/
|
|
477
648
|
onConnected(connectionInfo: string): Promise<void>;
|
|
478
649
|
/**
|
|
479
|
-
* Handle
|
|
480
|
-
*
|
|
481
|
-
*
|
|
650
|
+
* Handle transport disconnection.
|
|
651
|
+
*
|
|
652
|
+
* Clears transport and auth state, notifies the user callback,
|
|
653
|
+
* then consults ``_desiredState`` to decide whether to reconnect.
|
|
482
654
|
*/
|
|
483
655
|
onDisconnected(reason: string, hasError: boolean): Promise<void>;
|
|
484
656
|
/**
|
|
485
657
|
* Subscribe to specific types of events from the server.
|
|
658
|
+
* @deprecated Use {@link addMonitor} / {@link removeMonitor} instead.
|
|
486
659
|
*/
|
|
487
660
|
setEvents(token: string, eventTypes: string[], pipeId?: number): Promise<void>;
|
|
488
661
|
/**
|
|
489
|
-
*
|
|
662
|
+
* Add a monitor subscription. If the key already exists, the new types are
|
|
663
|
+
* merged via reference counting and the merged set is sent to the server.
|
|
490
664
|
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
|
|
665
|
+
* @param key - Monitor key: `{ token }` for a running task, or `{ projectId, source }` for a project.
|
|
666
|
+
* @param types - Event types to subscribe to (e.g. `['summary', 'flow']`).
|
|
667
|
+
*/
|
|
668
|
+
addMonitor(key: MonitorKey, types: string[]): Promise<void>;
|
|
669
|
+
/**
|
|
670
|
+
* Remove a monitor subscription. Decrements reference counts for the given
|
|
671
|
+
* types. Only unsubscribes a type from the server when its count reaches 0.
|
|
494
672
|
*
|
|
495
|
-
* @param
|
|
496
|
-
* @param
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
*
|
|
673
|
+
* @param key - Monitor key (must match the key used in addMonitor).
|
|
674
|
+
* @param types - Event types to unsubscribe from.
|
|
675
|
+
*/
|
|
676
|
+
removeMonitor(key: MonitorKey, types: string[]): Promise<void>;
|
|
677
|
+
/**
|
|
678
|
+
* Send the merged type list for a monitor key to the server.
|
|
679
|
+
*/
|
|
680
|
+
private _syncMonitor;
|
|
681
|
+
/**
|
|
682
|
+
* Replay all active monitor subscriptions to the server.
|
|
683
|
+
* Called automatically after reconnection.
|
|
684
|
+
*/
|
|
685
|
+
private _resubscribeAllMonitors;
|
|
686
|
+
/**
|
|
687
|
+
* Convert a MonitorKey to a stable string for map lookup.
|
|
688
|
+
*/
|
|
689
|
+
private _monitorKeyToString;
|
|
690
|
+
/**
|
|
691
|
+
* Reverse a key-string back to a MonitorKey (for resubscribeAll).
|
|
692
|
+
*/
|
|
693
|
+
private _monitorStringToKey;
|
|
694
|
+
/**
|
|
695
|
+
* Persist a pipeline configuration as a named template in the account store.
|
|
501
696
|
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
* name: 'Data Processor',
|
|
509
|
-
* source: 'source_1',
|
|
510
|
-
* components: [...]
|
|
511
|
-
* }
|
|
512
|
-
* });
|
|
513
|
-
* console.log(`Saved version: ${result.version}`);
|
|
514
|
-
*
|
|
515
|
-
* // Update existing project with version check
|
|
516
|
-
* const existing = await client.getProject({ projectId: 'proj-123' });
|
|
517
|
-
* existing.name = 'Updated Name';
|
|
518
|
-
* const updated = await client.saveProject({
|
|
519
|
-
* projectId: 'proj-123',
|
|
520
|
-
* pipeline: existing,
|
|
521
|
-
* expectedVersion: existing.version
|
|
522
|
-
* });
|
|
523
|
-
* ```
|
|
697
|
+
* Templates are stored as JSON files under `.templates/<templateId>.json`.
|
|
698
|
+
* Saving a template with an existing ID overwrites the previous version.
|
|
699
|
+
*
|
|
700
|
+
* @param options.templateId - Unique identifier for the template (no path separators)
|
|
701
|
+
* @param options.pipeline - Pipeline configuration object to save
|
|
702
|
+
* @throws Error if templateId is invalid or pipeline is not a non-empty object
|
|
524
703
|
*/
|
|
525
|
-
|
|
526
|
-
|
|
704
|
+
saveTemplate(options: {
|
|
705
|
+
templateId: string;
|
|
527
706
|
pipeline: Record<string, any>;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
707
|
+
}): Promise<void>;
|
|
708
|
+
/**
|
|
709
|
+
* Retrieve a previously saved pipeline template from the account store.
|
|
710
|
+
*
|
|
711
|
+
* @param options.templateId - Unique identifier of the template to retrieve
|
|
712
|
+
* @returns The pipeline configuration object that was saved
|
|
713
|
+
* @throws Error if the template does not exist or templateId is invalid
|
|
714
|
+
*/
|
|
715
|
+
getTemplate(options: {
|
|
716
|
+
templateId: string;
|
|
717
|
+
}): Promise<Record<string, any>>;
|
|
718
|
+
/**
|
|
719
|
+
* Delete a pipeline template from the account store.
|
|
720
|
+
*
|
|
721
|
+
* @param options.templateId - Unique identifier of the template to delete
|
|
722
|
+
* @throws Error if the template does not exist or templateId is invalid
|
|
723
|
+
*/
|
|
724
|
+
deleteTemplate(options: {
|
|
725
|
+
templateId: string;
|
|
726
|
+
}): Promise<void>;
|
|
534
727
|
/**
|
|
535
|
-
*
|
|
728
|
+
* List all pipeline templates stored in the account store.
|
|
536
729
|
*
|
|
537
|
-
*
|
|
538
|
-
*
|
|
539
|
-
*
|
|
730
|
+
* Reads the `.templates` directory, parses each `.json` file, and extracts
|
|
731
|
+
* a summary for each template. Files that cannot be parsed are silently
|
|
732
|
+
* skipped so a single corrupt template does not break the entire listing.
|
|
540
733
|
*
|
|
541
|
-
* @
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
|
|
734
|
+
* @returns Array of template summaries sorted in directory-listing order.
|
|
735
|
+
* Each entry contains the template ID, display name, source components,
|
|
736
|
+
* and total component count.
|
|
737
|
+
*/
|
|
738
|
+
getAllTemplates(): Promise<Array<{
|
|
739
|
+
id: string;
|
|
740
|
+
name: string;
|
|
741
|
+
sources: any[];
|
|
742
|
+
totalComponents: number;
|
|
743
|
+
}>>;
|
|
744
|
+
/**
|
|
745
|
+
* Persist a pipeline execution log to the account store.
|
|
545
746
|
*
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
* try {
|
|
550
|
-
* const project = await client.getProject({ projectId: 'proj-123' });
|
|
551
|
-
* console.log(`Project: ${project.name}`);
|
|
552
|
-
* console.log(`Version: ${project.version}`);
|
|
553
|
-
* } catch (error) {
|
|
554
|
-
* if (error.message.includes('NOT_FOUND')) {
|
|
555
|
-
* console.log("Project doesn't exist");
|
|
556
|
-
* }
|
|
557
|
-
* }
|
|
747
|
+
* Logs are stored under `.logs/<projectId>/<source>-<startTime>.log`.
|
|
748
|
+
* The filename is derived from `contents.body.startTime` so logs are
|
|
749
|
+
* naturally sortable by execution start time.
|
|
558
750
|
*
|
|
559
|
-
*
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
* pipeline: project,
|
|
565
|
-
* expectedVersion: project.version
|
|
566
|
-
* });
|
|
567
|
-
* ```
|
|
751
|
+
* @param options.projectId - Project identifier that owns this log
|
|
752
|
+
* @param options.source - Source component identifier the log is associated with
|
|
753
|
+
* @param options.contents - Log payload; must contain `body.startTime`
|
|
754
|
+
* @returns The generated filename (e.g. `"ingest-1714000000000.log"`)
|
|
755
|
+
* @throws Error if any ID is invalid, contents is not an object, or startTime is missing
|
|
568
756
|
*/
|
|
569
|
-
|
|
757
|
+
saveLog(options: {
|
|
570
758
|
projectId: string;
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
version: string;
|
|
575
|
-
}>;
|
|
759
|
+
source: string;
|
|
760
|
+
contents: Record<string, any>;
|
|
761
|
+
}): Promise<string>;
|
|
576
762
|
/**
|
|
577
|
-
*
|
|
763
|
+
* Retrieve a previously saved pipeline execution log from the account store.
|
|
578
764
|
*
|
|
579
|
-
*
|
|
580
|
-
*
|
|
581
|
-
*
|
|
765
|
+
* @param options.projectId - Project identifier that owns the log
|
|
766
|
+
* @param options.name - Filename of the log (as returned by saveLog)
|
|
767
|
+
* @returns The log payload that was saved
|
|
768
|
+
* @throws Error if the log does not exist or projectId is invalid
|
|
769
|
+
*/
|
|
770
|
+
getLog(options: {
|
|
771
|
+
projectId: string;
|
|
772
|
+
name: string;
|
|
773
|
+
}): Promise<Record<string, any>>;
|
|
774
|
+
/**
|
|
775
|
+
* Delete a pipeline execution log from the account store.
|
|
582
776
|
*
|
|
583
|
-
* @param options -
|
|
584
|
-
* @param options.
|
|
585
|
-
* @
|
|
586
|
-
|
|
587
|
-
|
|
777
|
+
* @param options.projectId - Project identifier that owns the log
|
|
778
|
+
* @param options.name - Filename of the log to delete
|
|
779
|
+
* @throws Error if the log does not exist or projectId is invalid
|
|
780
|
+
*/
|
|
781
|
+
deleteLog(options: {
|
|
782
|
+
projectId: string;
|
|
783
|
+
name: string;
|
|
784
|
+
}): Promise<void>;
|
|
785
|
+
/**
|
|
786
|
+
* List pipeline execution logs stored for a project, optionally filtered by source.
|
|
588
787
|
*
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
*
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
* });
|
|
598
|
-
* console.log('Project deleted successfully');
|
|
599
|
-
* } catch (error) {
|
|
600
|
-
* if (error.message.includes('CONFLICT')) {
|
|
601
|
-
* console.log('Project was modified, deletion cancelled');
|
|
602
|
-
* }
|
|
603
|
-
* }
|
|
604
|
-
* ```
|
|
788
|
+
* Results are sorted ascending by `modified` timestamp so the oldest log
|
|
789
|
+
* appears first. The caller can page through or slice the array as needed.
|
|
790
|
+
*
|
|
791
|
+
* @param options.projectId - Project identifier whose logs to list
|
|
792
|
+
* @param options.source - Optional source component filter; when set, only logs
|
|
793
|
+
* whose filename starts with `<source>-` are returned
|
|
794
|
+
* @returns Array of log name and optional modified timestamp, sorted oldest-first
|
|
795
|
+
* @throws Error if projectId (or source when provided) is invalid
|
|
605
796
|
*/
|
|
606
|
-
|
|
797
|
+
listLogs(options: {
|
|
607
798
|
projectId: string;
|
|
608
|
-
|
|
609
|
-
}): Promise<{
|
|
610
|
-
|
|
611
|
-
|
|
799
|
+
source?: string;
|
|
800
|
+
}): Promise<Array<{
|
|
801
|
+
name: string;
|
|
802
|
+
modified?: number;
|
|
803
|
+
}>>;
|
|
804
|
+
/**
|
|
805
|
+
* Open a file handle for reading or writing.
|
|
806
|
+
*
|
|
807
|
+
* @param path - Relative path within the account store
|
|
808
|
+
* @param mode - 'r' for read, 'w' for write (default: 'r')
|
|
809
|
+
* @param offset - Initial byte offset (read mode only)
|
|
810
|
+
* @returns Object with 'handle' (string). Read mode also includes 'size' (number).
|
|
811
|
+
*/
|
|
812
|
+
fsOpen(path: string, mode?: 'r' | 'w'): Promise<{
|
|
813
|
+
handle: string;
|
|
814
|
+
size?: number;
|
|
612
815
|
}>;
|
|
613
816
|
/**
|
|
614
|
-
*
|
|
817
|
+
* Read data from an open read handle.
|
|
615
818
|
*
|
|
616
|
-
*
|
|
617
|
-
*
|
|
819
|
+
* @param handle - Handle ID returned by fsOpen
|
|
820
|
+
* @param offset - Byte offset to read from
|
|
821
|
+
* @param length - Max bytes to read (default 4 MB). Empty Uint8Array indicates EOF.
|
|
822
|
+
* @returns The bytes read
|
|
823
|
+
*/
|
|
824
|
+
fsRead(handle: string, offset?: number, length?: number): Promise<Uint8Array>;
|
|
825
|
+
/**
|
|
826
|
+
* Write data to an open write handle.
|
|
618
827
|
*
|
|
619
|
-
* @
|
|
620
|
-
* @
|
|
828
|
+
* @param handle - Handle ID returned by fsOpen
|
|
829
|
+
* @param data - Raw bytes to write
|
|
830
|
+
* @returns Number of bytes written
|
|
831
|
+
*/
|
|
832
|
+
fsWrite(handle: string, data: Uint8Array): Promise<number>;
|
|
833
|
+
/**
|
|
834
|
+
* Close a file handle.
|
|
621
835
|
*
|
|
622
|
-
* @
|
|
623
|
-
*
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
*
|
|
628
|
-
* console.log(`- ${project.id}: ${project.name} (${project.totalComponents} components)`);
|
|
629
|
-
* for (const source of project.sources) {
|
|
630
|
-
* console.log(` * ${source.name} (${source.provider})`);
|
|
631
|
-
* }
|
|
632
|
-
* }
|
|
836
|
+
* @param handle - Handle ID returned by fsOpen
|
|
837
|
+
* @param mode - 'r' or 'w' (must match the mode used in fsOpen)
|
|
838
|
+
*/
|
|
839
|
+
fsClose(handle: string, mode: 'r' | 'w'): Promise<void>;
|
|
840
|
+
/**
|
|
841
|
+
* Delete a file.
|
|
633
842
|
*
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
|
|
637
|
-
|
|
843
|
+
* @param path - Relative path within the account store
|
|
844
|
+
* @throws Error if file does not exist or delete fails
|
|
845
|
+
*/
|
|
846
|
+
fsDelete(path: string): Promise<void>;
|
|
847
|
+
/**
|
|
848
|
+
* List immediate children of a directory.
|
|
849
|
+
*
|
|
850
|
+
* @param path - Relative directory path (default: account root)
|
|
851
|
+
* @returns Directory entries with name and type (file or dir)
|
|
638
852
|
*/
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
projects: Array<{
|
|
642
|
-
id: string;
|
|
853
|
+
fsListDir(path?: string): Promise<{
|
|
854
|
+
entries: Array<{
|
|
643
855
|
name: string;
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
name: string;
|
|
648
|
-
}>;
|
|
649
|
-
totalComponents: number;
|
|
856
|
+
type: 'file' | 'dir';
|
|
857
|
+
size?: number;
|
|
858
|
+
modified?: number;
|
|
650
859
|
}>;
|
|
651
860
|
count: number;
|
|
652
861
|
}>;
|
|
653
862
|
/**
|
|
654
|
-
*
|
|
863
|
+
* Create a directory.
|
|
655
864
|
*
|
|
656
|
-
*
|
|
657
|
-
|
|
658
|
-
|
|
865
|
+
* @param path - Relative directory path
|
|
866
|
+
*/
|
|
867
|
+
fsMkdir(path: string): Promise<void>;
|
|
868
|
+
/**
|
|
869
|
+
* Remove a directory.
|
|
659
870
|
*
|
|
660
|
-
* @param
|
|
661
|
-
* @param
|
|
662
|
-
* @
|
|
663
|
-
* @param options.expectedVersion - Expected current version for atomic updates (optional)
|
|
664
|
-
* @returns Promise resolving to save result with success status, templateId, and new version
|
|
665
|
-
* @throws Error if save fails due to version mismatch, storage error, or invalid input
|
|
871
|
+
* @param path - Relative directory path
|
|
872
|
+
* @param recursive - If true, delete contents recursively (default: false)
|
|
873
|
+
* @throws Error if directory is not empty (when recursive is false) or delete fails
|
|
666
874
|
*/
|
|
667
|
-
|
|
668
|
-
templateId: string;
|
|
669
|
-
pipeline: Record<string, any>;
|
|
670
|
-
expectedVersion?: string;
|
|
671
|
-
}): Promise<{
|
|
672
|
-
success: boolean;
|
|
673
|
-
template_id: string;
|
|
674
|
-
version: string;
|
|
675
|
-
}>;
|
|
875
|
+
fsRmdir(path: string, recursive?: boolean): Promise<void>;
|
|
676
876
|
/**
|
|
677
|
-
*
|
|
877
|
+
* Get file or directory metadata.
|
|
878
|
+
*
|
|
879
|
+
* @param path - Relative path within the account store
|
|
880
|
+
* @returns Metadata including existence, type, size (bytes), and modified epoch timestamp (for files)
|
|
678
881
|
*/
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
version: string;
|
|
882
|
+
fsStat(path: string): Promise<{
|
|
883
|
+
exists: boolean;
|
|
884
|
+
type?: 'file' | 'dir';
|
|
885
|
+
size?: number;
|
|
886
|
+
modified?: number;
|
|
685
887
|
}>;
|
|
686
888
|
/**
|
|
687
|
-
*
|
|
889
|
+
* Rename a file or directory.
|
|
890
|
+
*
|
|
891
|
+
* On object stores this is implemented as copy + delete. For directories,
|
|
892
|
+
* all contents are moved recursively.
|
|
893
|
+
*
|
|
894
|
+
* @param oldPath - Current relative path within the account store
|
|
895
|
+
* @param newPath - New relative path within the account store
|
|
896
|
+
* @throws Error if oldPath does not exist or rename fails
|
|
688
897
|
*/
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
898
|
+
fsRename(oldPath: string, newPath: string): Promise<void>;
|
|
899
|
+
/** Read a file as a UTF-8 string. */
|
|
900
|
+
fsReadString(path: string): Promise<string>;
|
|
901
|
+
/** Write a UTF-8 string to a file. */
|
|
902
|
+
fsWriteString(path: string, text: string): Promise<void>;
|
|
903
|
+
/** Read a JSON file. */
|
|
904
|
+
fsReadJson<T = any>(path: string): Promise<T>;
|
|
905
|
+
/** Write an object as JSON. */
|
|
906
|
+
fsWriteJson(path: string, obj: any): Promise<void>;
|
|
696
907
|
/**
|
|
697
|
-
*
|
|
908
|
+
* Characters that are illegal in store paths and IDs on all supported
|
|
909
|
+
* platforms (Windows, Linux, macOS, and object-storage back-ends).
|
|
910
|
+
*
|
|
911
|
+
* `\x00` is the null byte; the rest are shell/filesystem metacharacters
|
|
912
|
+
* that would cause ambiguous or dangerous behaviour in path construction.
|
|
698
913
|
*/
|
|
699
|
-
|
|
700
|
-
success: boolean;
|
|
701
|
-
templates: Array<{
|
|
702
|
-
id: string;
|
|
703
|
-
name: string;
|
|
704
|
-
sources: Array<{
|
|
705
|
-
id: string;
|
|
706
|
-
provider: string;
|
|
707
|
-
name: string;
|
|
708
|
-
}>;
|
|
709
|
-
totalComponents: number;
|
|
710
|
-
}>;
|
|
711
|
-
count: number;
|
|
712
|
-
}>;
|
|
914
|
+
private static readonly INVALID_PATH_CHARS;
|
|
713
915
|
/**
|
|
714
|
-
*
|
|
916
|
+
* Validate a relative path intended for the account file store.
|
|
917
|
+
*
|
|
918
|
+
* Splits the path on `/` (after normalising backslashes) and checks every
|
|
919
|
+
* segment for path-traversal attempts (`..`) and forbidden characters.
|
|
920
|
+
* Empty segments (from leading/trailing/double slashes) are skipped because
|
|
921
|
+
* they carry no security risk on the server side.
|
|
922
|
+
*
|
|
923
|
+
* @param path - Relative path to validate (e.g. `.templates/my-pipe.json`)
|
|
924
|
+
* @throws Error if any segment is `..` or contains illegal characters
|
|
715
925
|
*/
|
|
716
|
-
|
|
717
|
-
projectId: string;
|
|
718
|
-
source: string;
|
|
719
|
-
contents: Record<string, any>;
|
|
720
|
-
}): Promise<{
|
|
721
|
-
success: boolean;
|
|
722
|
-
filename: string;
|
|
723
|
-
}>;
|
|
926
|
+
private validateStorePath;
|
|
724
927
|
/**
|
|
725
|
-
*
|
|
928
|
+
* Validate a single identifier (projectId, source, templateId, etc.) used
|
|
929
|
+
* to construct store paths.
|
|
930
|
+
*
|
|
931
|
+
* IDs must be non-empty strings that contain no path separators and no
|
|
932
|
+
* characters from the forbidden set. This prevents an ID from escaping its
|
|
933
|
+
* intended directory when interpolated into a path.
|
|
934
|
+
*
|
|
935
|
+
* @param value - The identifier string to validate
|
|
936
|
+
* @param name - Human-readable field name used in error messages (e.g. `"projectId"`)
|
|
937
|
+
* @throws Error if value is empty, contains path separators, or contains illegal characters
|
|
726
938
|
*/
|
|
727
|
-
|
|
728
|
-
projectId: string;
|
|
729
|
-
source: string;
|
|
730
|
-
startTime: number;
|
|
731
|
-
}): Promise<{
|
|
732
|
-
success: boolean;
|
|
733
|
-
contents: Record<string, any>;
|
|
734
|
-
}>;
|
|
939
|
+
private validateId;
|
|
735
940
|
/**
|
|
736
|
-
*
|
|
941
|
+
* Retrieve a server dashboard snapshot.
|
|
942
|
+
*
|
|
943
|
+
* Returns the current state of all connections, tasks, and aggregate
|
|
944
|
+
* metrics from the server. Requires 'task.monitor' permission.
|
|
945
|
+
*
|
|
946
|
+
* @returns DashboardResponse containing overview, connections, and tasks
|
|
737
947
|
*/
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
total_pages: number;
|
|
749
|
-
}>;
|
|
948
|
+
getDashboard(): Promise<DashboardResponse>;
|
|
949
|
+
/**
|
|
950
|
+
* Start a cProfile profiling session on the server process or a pipeline.
|
|
951
|
+
*
|
|
952
|
+
* @param target - Task token to profile a pipeline subprocess, or
|
|
953
|
+
* undefined/null to profile the server process itself.
|
|
954
|
+
* @param session - Optional human-readable session name.
|
|
955
|
+
* @returns Status object with session info and start time.
|
|
956
|
+
*/
|
|
957
|
+
cprofileStart(target?: string | null, session?: string): Promise<CProfileStatusResponse>;
|
|
750
958
|
/**
|
|
751
|
-
*
|
|
959
|
+
* Stop the active cProfile profiling session.
|
|
752
960
|
*
|
|
753
|
-
*
|
|
754
|
-
*
|
|
755
|
-
|
|
961
|
+
* @param target - Task token if profiling a pipeline, or undefined for server.
|
|
962
|
+
* @returns Result with session name and runtime.
|
|
963
|
+
*/
|
|
964
|
+
cprofileStop(target?: string | null): Promise<CProfileStopResponse>;
|
|
965
|
+
/**
|
|
966
|
+
* Get the current cProfile profiling status.
|
|
756
967
|
*
|
|
757
|
-
* @param
|
|
758
|
-
* @
|
|
759
|
-
* @param token - Optional task/session token
|
|
760
|
-
* @param timeout - Optional per-request timeout in ms
|
|
761
|
-
* @returns The response DAPMessage from the server
|
|
968
|
+
* @param target - Task token if querying a pipeline, or undefined for server.
|
|
969
|
+
* @returns Status indicating active/inactive, owner, runtime.
|
|
762
970
|
*/
|
|
763
|
-
|
|
971
|
+
cprofileStatus(target?: string | null): Promise<CProfileStatusResponse>;
|
|
972
|
+
/**
|
|
973
|
+
* Get the full cProfile report from the last completed session.
|
|
974
|
+
*
|
|
975
|
+
* @param target - Task token if querying a pipeline, or undefined for server.
|
|
976
|
+
* @returns Object containing the full pstats text report.
|
|
977
|
+
*/
|
|
978
|
+
cprofileReport(target?: string | null): Promise<CProfileReportResponse>;
|
|
764
979
|
/**
|
|
765
980
|
* Async disposal support for 'await using' pattern.
|
|
766
981
|
* Equivalent to Python's __aexit__
|
|
@@ -797,7 +1012,7 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
797
1012
|
* }
|
|
798
1013
|
* ```
|
|
799
1014
|
*/
|
|
800
|
-
getServices(): Promise<
|
|
1015
|
+
getServices(): Promise<ServicesResponse>;
|
|
801
1016
|
/**
|
|
802
1017
|
* Retrieve a specific service definition from the server.
|
|
803
1018
|
*
|
|
@@ -820,7 +1035,7 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
820
1035
|
* }
|
|
821
1036
|
* ```
|
|
822
1037
|
*/
|
|
823
|
-
getService(service: string): Promise<
|
|
1038
|
+
getService(service: string): Promise<ServiceDefinition | undefined>;
|
|
824
1039
|
/**
|
|
825
1040
|
* Get connection information (TypeScript-specific convenience)
|
|
826
1041
|
*/
|
|
@@ -833,6 +1048,74 @@ export declare class RocketRideClient extends DAPClient {
|
|
|
833
1048
|
* Get API key (for debugging/validation)
|
|
834
1049
|
*/
|
|
835
1050
|
getApiKey(): string | undefined;
|
|
1051
|
+
/**
|
|
1052
|
+
* Lazily-initialised account API namespace.
|
|
1053
|
+
*
|
|
1054
|
+
* Provides typed methods for managing the authenticated user's profile,
|
|
1055
|
+
* API keys, organization, members, and teams.
|
|
1056
|
+
*
|
|
1057
|
+
* @example
|
|
1058
|
+
* ```typescript
|
|
1059
|
+
* const profile = await client.account.getProfile();
|
|
1060
|
+
* ```
|
|
1061
|
+
*/
|
|
1062
|
+
get account(): AccountApi;
|
|
1063
|
+
/**
|
|
1064
|
+
* Lazily-initialised billing API namespace.
|
|
1065
|
+
*
|
|
1066
|
+
* Provides typed methods for managing subscriptions, Stripe checkout
|
|
1067
|
+
* sessions, billing portal access, and compute credit wallets.
|
|
1068
|
+
*
|
|
1069
|
+
* @example
|
|
1070
|
+
* ```typescript
|
|
1071
|
+
* const details = await client.billing.getDetails(orgId);
|
|
1072
|
+
* ```
|
|
1073
|
+
*/
|
|
1074
|
+
get billing(): BillingApi;
|
|
1075
|
+
/**
|
|
1076
|
+
* Lazily-initialised database API namespace.
|
|
1077
|
+
*
|
|
1078
|
+
* Provides direct SQL/Cypher execution against database pipelines, bypassing
|
|
1079
|
+
* the LLM translation layer that {@link RocketRideClient.chat} uses.
|
|
1080
|
+
*
|
|
1081
|
+
* @example
|
|
1082
|
+
* ```typescript
|
|
1083
|
+
* const result = await client.database.query({ token, sql: 'SELECT 1' });
|
|
1084
|
+
* ```
|
|
1085
|
+
*/
|
|
1086
|
+
get database(): DatabaseApi;
|
|
1087
|
+
/**
|
|
1088
|
+
* Lazily-initialised deploy API namespace.
|
|
1089
|
+
*
|
|
1090
|
+
* Provides typed methods for managing server-side pipeline deployments:
|
|
1091
|
+
* add, remove, list, status, and update.
|
|
1092
|
+
*
|
|
1093
|
+
* @example
|
|
1094
|
+
* ```typescript
|
|
1095
|
+
* const rec = await client.deploy.add(pipeline, { schedule: '0/15 * * * *' });
|
|
1096
|
+
* ```
|
|
1097
|
+
*/
|
|
1098
|
+
get deploy(): DeployApi;
|
|
1099
|
+
/**
|
|
1100
|
+
* Sends a DAP command, unwraps the response body, and throws on failure.
|
|
1101
|
+
*
|
|
1102
|
+
* This is the single public entry point for all typed DAP operations.
|
|
1103
|
+
* The {@link AccountApi} and {@link BillingApi} namespaces delegate here.
|
|
1104
|
+
*
|
|
1105
|
+
* If an `onTrace` callback was provided in the constructor config, it is
|
|
1106
|
+
* invoked before the request (TraceType.Request) and after completion
|
|
1107
|
+
* (TraceType.Success or TraceType.Error).
|
|
1108
|
+
*
|
|
1109
|
+
* @param command - DAP command name (e.g. "rrext_account_me").
|
|
1110
|
+
* @param args - Key/value arguments forwarded in the request.
|
|
1111
|
+
* @param options - Optional token (for task-scoped calls) and timeout in ms.
|
|
1112
|
+
* @returns The `body` field of a successful DAP response.
|
|
1113
|
+
* @throws Error if the server signals failure.
|
|
1114
|
+
*/
|
|
1115
|
+
call<T = any>(command: string, args?: Record<string, unknown>, options?: {
|
|
1116
|
+
token?: string;
|
|
1117
|
+
timeout?: number;
|
|
1118
|
+
}): Promise<T>;
|
|
836
1119
|
}
|
|
837
1120
|
export { RocketRideClient as default };
|
|
838
1121
|
//# sourceMappingURL=client.d.ts.map
|