@boltic/sdk 0.1.2 → 0.1.4
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 +191 -146
- package/dist/databases/index.d.ts +214 -93
- package/dist/databases/index.js +1 -1
- package/dist/databases/index.js.map +1 -1
- package/dist/databases/index.mjs +1 -1
- package/dist/databases/index.mjs.map +1 -1
- package/dist/databases/test-client-BEAX5vfC.mjs +2 -0
- package/dist/databases/test-client-BEAX5vfC.mjs.map +1 -0
- package/dist/databases/test-client-BgkvBtst.js +2 -0
- package/dist/databases/test-client-BgkvBtst.js.map +1 -0
- package/dist/databases/testing.d.ts +204 -94
- package/dist/databases/testing.js +1 -1
- package/dist/databases/testing.mjs +1 -1
- package/dist/sdk.js +1531 -765
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.mjs +1532 -766
- package/dist/sdk.mjs.map +1 -1
- package/dist/types/index.d.ts +916 -70
- package/package.json +2 -1
- package/dist/databases/test-client-Bo_BCApL.js +0 -2
- package/dist/databases/test-client-Bo_BCApL.js.map +0 -1
- package/dist/databases/test-client-C9T839dW.mjs +0 -2
- package/dist/databases/test-client-C9T839dW.mjs.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/** A single activity node in the execute request body */
|
|
2
|
+
export declare interface ActivityNode {
|
|
3
|
+
data: {
|
|
4
|
+
type: string;
|
|
5
|
+
name: string;
|
|
6
|
+
properties: ActivityProperties;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Properties describing the activity to execute (dynamic, varies by integration) */
|
|
11
|
+
export declare type ActivityProperties = Record<string, unknown>;
|
|
12
|
+
|
|
13
|
+
/** Result/context payload sent alongside activity nodes */
|
|
14
|
+
export declare interface ActivityResultPayload {
|
|
15
|
+
payload: Record<string, unknown>;
|
|
16
|
+
global_variables: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
|
|
1
19
|
declare interface AddIndexRequest {
|
|
2
20
|
field_names: string[];
|
|
3
21
|
method: 'btree' | 'hash' | 'spgist' | 'gin' | 'brin';
|
|
@@ -39,44 +57,79 @@ declare interface AuthConfig_2 {
|
|
|
39
57
|
|
|
40
58
|
export declare interface AuthHeaders {
|
|
41
59
|
'x-boltic-token': string;
|
|
42
|
-
|
|
43
|
-
[key: string]: string | undefined;
|
|
60
|
+
[key: string]: string;
|
|
44
61
|
}
|
|
45
62
|
|
|
46
63
|
declare interface AuthHeaders_2 {
|
|
47
64
|
'x-boltic-token': string;
|
|
48
|
-
|
|
65
|
+
'x-boltic-service'?: string;
|
|
66
|
+
[key: string]: string | undefined;
|
|
49
67
|
}
|
|
50
68
|
|
|
51
69
|
export declare class AuthManager {
|
|
52
70
|
private config;
|
|
53
71
|
private tokenInfo;
|
|
54
|
-
constructor(config:
|
|
72
|
+
constructor(config: AuthConfig_2);
|
|
55
73
|
private validateApiKey;
|
|
56
|
-
getAuthHeaders():
|
|
74
|
+
getAuthHeaders(): AuthHeaders_2;
|
|
57
75
|
updateApiKey(newApiKey: string): void;
|
|
58
76
|
isAuthenticated(): boolean;
|
|
59
77
|
validateApiKeyAsync(): Promise<boolean>;
|
|
60
|
-
getTokenInfo():
|
|
61
|
-
getServiceHeaders(service?: string):
|
|
78
|
+
getTokenInfo(): TokenInfo_2 | null;
|
|
79
|
+
getServiceHeaders(service?: string): AuthHeaders_2;
|
|
62
80
|
validateForService(): Promise<boolean>;
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
declare class AuthManager_2 {
|
|
66
84
|
private config;
|
|
67
85
|
private tokenInfo;
|
|
68
|
-
constructor(config:
|
|
86
|
+
constructor(config: AuthConfig);
|
|
69
87
|
private validateApiKey;
|
|
70
|
-
getAuthHeaders():
|
|
88
|
+
getAuthHeaders(): AuthHeaders;
|
|
71
89
|
updateApiKey(newApiKey: string): void;
|
|
72
90
|
isAuthenticated(): boolean;
|
|
73
91
|
validateApiKeyAsync(): Promise<boolean>;
|
|
74
|
-
getTokenInfo():
|
|
92
|
+
getTokenInfo(): TokenInfo | null;
|
|
75
93
|
getMaxRetries(): number;
|
|
76
94
|
toString(): string;
|
|
77
95
|
toJSON(): object;
|
|
78
96
|
}
|
|
79
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Base API Client — provides common functionality for all API clients.
|
|
100
|
+
*
|
|
101
|
+
* Subclasses pass a `servicePath` to target different backend services
|
|
102
|
+
* while sharing auth, headers, error handling, and HTTP infrastructure.
|
|
103
|
+
*/
|
|
104
|
+
declare abstract class BaseApiClient {
|
|
105
|
+
protected httpAdapter: HttpAdapter;
|
|
106
|
+
protected config: BaseApiClientConfig;
|
|
107
|
+
protected baseURL: string;
|
|
108
|
+
protected environment: Environment;
|
|
109
|
+
protected region: Region;
|
|
110
|
+
constructor(apiKey: string, config?: Omit<BaseApiClientConfig, 'apiKey'>, servicePath?: string);
|
|
111
|
+
/**
|
|
112
|
+
* Resolve a secondary service URL using the same region/environment
|
|
113
|
+
* but a different service path.
|
|
114
|
+
*/
|
|
115
|
+
protected resolveAdditionalServiceURL(servicePath: string): string;
|
|
116
|
+
protected buildHeaders(): Record<string, string>;
|
|
117
|
+
protected formatErrorResponse(error: unknown, prefix?: string): BolticErrorResponse;
|
|
118
|
+
toString(): string;
|
|
119
|
+
toJSON(): object;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export declare interface BaseApiClientConfig {
|
|
123
|
+
apiKey: string;
|
|
124
|
+
environment?: Environment;
|
|
125
|
+
region?: Region;
|
|
126
|
+
timeout?: number;
|
|
127
|
+
debug?: boolean;
|
|
128
|
+
retryAttempts?: number;
|
|
129
|
+
retryDelay?: number;
|
|
130
|
+
headers?: Record<string, string>;
|
|
131
|
+
}
|
|
132
|
+
|
|
80
133
|
declare class BaseClient {
|
|
81
134
|
private httpAdapter;
|
|
82
135
|
private authManager;
|
|
@@ -96,6 +149,18 @@ declare class BaseClient {
|
|
|
96
149
|
getConfig(): ClientConfig;
|
|
97
150
|
}
|
|
98
151
|
|
|
152
|
+
declare abstract class BaseResource {
|
|
153
|
+
protected client: BaseClient;
|
|
154
|
+
protected basePath: string;
|
|
155
|
+
constructor(client: BaseClient, basePath: string);
|
|
156
|
+
getBasePath(): string;
|
|
157
|
+
protected makeRequest<T>(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, data?: unknown, options?: {
|
|
158
|
+
params?: Record<string, unknown>;
|
|
159
|
+
}): Promise<ApiResponse<T>>;
|
|
160
|
+
protected buildQueryParams(options?: QueryOptions): Record<string, unknown>;
|
|
161
|
+
protected handleResponse<T>(response: ApiResponse<T>): ApiResponse<T>;
|
|
162
|
+
}
|
|
163
|
+
|
|
99
164
|
export declare class BolticClient {
|
|
100
165
|
private configManager;
|
|
101
166
|
private authManager;
|
|
@@ -106,6 +171,8 @@ export declare class BolticClient {
|
|
|
106
171
|
private sqlResource;
|
|
107
172
|
private indexResource;
|
|
108
173
|
private databaseResource;
|
|
174
|
+
private workflowResource;
|
|
175
|
+
private serverlessResource;
|
|
109
176
|
private currentDatabase;
|
|
110
177
|
private clientOptions;
|
|
111
178
|
constructor(apiKey: string, options?: ClientOptions);
|
|
@@ -183,7 +250,7 @@ export declare class BolticClient {
|
|
|
183
250
|
insert: (data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
184
251
|
insertMany: (records: RecordData[], options?: {
|
|
185
252
|
validation?: boolean;
|
|
186
|
-
}) => Promise<
|
|
253
|
+
}) => Promise<BolticErrorResponse | RecordBulkInsertResponse>;
|
|
187
254
|
findOne: (recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
188
255
|
update: (options: RecordUpdateOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
|
|
189
256
|
updateById: (recordId: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
@@ -199,7 +266,7 @@ export declare class BolticClient {
|
|
|
199
266
|
insert: (tableName: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
200
267
|
insertMany: (tableName: string, records: RecordData[], options?: {
|
|
201
268
|
validation?: boolean;
|
|
202
|
-
}) => Promise<
|
|
269
|
+
}) => Promise<BolticErrorResponse | RecordBulkInsertResponse>;
|
|
203
270
|
findAll: (tableName: string, options?: RecordQueryOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
|
|
204
271
|
findOne: (tableName: string, recordId: string, options?: {
|
|
205
272
|
show_decrypted?: boolean;
|
|
@@ -220,6 +287,73 @@ export declare class BolticClient {
|
|
|
220
287
|
textToSQL: (prompt: string, options?: TextToSQLOptions) => Promise<AsyncIterable<string>>;
|
|
221
288
|
executeSQL: (query: string) => Promise<BolticErrorResponse | ExecuteSQLApiResponse>;
|
|
222
289
|
};
|
|
290
|
+
/**
|
|
291
|
+
* Workflow integration operations.
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```typescript
|
|
295
|
+
* // Execute and poll for result
|
|
296
|
+
* const result = await client.workflow.executeIntegration({
|
|
297
|
+
* nodes: [{ id: 'api1', data: { ... }, activity_data: { ... } }],
|
|
298
|
+
* });
|
|
299
|
+
*
|
|
300
|
+
* // Get execution result by ID
|
|
301
|
+
* const exec = await client.workflow.getIntegrationExecuteById('run-uuid');
|
|
302
|
+
*
|
|
303
|
+
* // List integrations
|
|
304
|
+
* const integrations = await client.workflow.getIntegrations();
|
|
305
|
+
* ```
|
|
306
|
+
*/
|
|
307
|
+
get workflow(): {
|
|
308
|
+
executeIntegration: (params: ExecuteIntegrationParams) => Promise<BolticErrorResponse | BolticSuccessResponse<ExecuteActivityResponseData | IntegrationExecutionData>>;
|
|
309
|
+
getIntegrationExecuteById: (executionId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<IntegrationExecutionData>>;
|
|
310
|
+
getIntegrations: (params?: GetIntegrationsParams) => Promise<BolticErrorResponse | BolticSuccessResponse<IntegrationsListData>>;
|
|
311
|
+
getCredentials: (params: GetCredentialsParams) => Promise<BolticErrorResponse | BolticSuccessResponse<CredentialsListData>>;
|
|
312
|
+
getIntegrationResource: (params: GetIntegrationResourceParams) => Promise<BolticErrorResponse | BolticSuccessResponse<IntegrationResourceData>>;
|
|
313
|
+
getIntegrationForm: (params: GetIntegrationFormParams) => Promise<BolticErrorResponse | BolticSuccessResponse<Record<string, unknown> | IntegrationFormJsonSchema>>;
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* Serverless function operations.
|
|
317
|
+
*
|
|
318
|
+
* @example
|
|
319
|
+
* ```typescript
|
|
320
|
+
* // List all serverless functions
|
|
321
|
+
* const list = await client.serverless.list();
|
|
322
|
+
*
|
|
323
|
+
* // Create a new serverless function
|
|
324
|
+
* const fn = await client.serverless.create({
|
|
325
|
+
* Name: 'my-api',
|
|
326
|
+
* Runtime: 'code',
|
|
327
|
+
* CodeOpts: { Language: 'nodejs/20', Code: '...' },
|
|
328
|
+
* Resources: { CPU: 0.1, MemoryMB: 128, MemoryMaxMB: 128 },
|
|
329
|
+
* Scaling: { AutoStop: false, Min: 1, Max: 1, MaxIdleTime: 0 },
|
|
330
|
+
* });
|
|
331
|
+
*
|
|
332
|
+
* // Get a serverless function by ID
|
|
333
|
+
* const details = await client.serverless.get('serverless-id');
|
|
334
|
+
*
|
|
335
|
+
* // Get builds
|
|
336
|
+
* const builds = await client.serverless.getBuilds({ appId: 'id' });
|
|
337
|
+
*
|
|
338
|
+
* // Get runtime logs
|
|
339
|
+
* const logs = await client.serverless.getLogs({ appId: 'id' });
|
|
340
|
+
* ```
|
|
341
|
+
*/
|
|
342
|
+
get serverless(): {
|
|
343
|
+
list: (params?: ListServerlessParams) => Promise<BolticErrorResponse | BolticSuccessResponse<ListServerlessData>>;
|
|
344
|
+
get: (appId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<ServerlessData>>;
|
|
345
|
+
create: (params: CreateServerlessParams) => Promise<BolticErrorResponse | BolticSuccessResponse<ServerlessData>>;
|
|
346
|
+
createAndWait: (params: CreateServerlessParams) => Promise<BolticErrorResponse | BolticSuccessResponse<ServerlessData>>;
|
|
347
|
+
update: (params: UpdateServerlessParams) => Promise<BolticErrorResponse | BolticSuccessResponse<ServerlessData>>;
|
|
348
|
+
updateAndWait: (params: UpdateServerlessParams) => Promise<BolticErrorResponse | BolticSuccessResponse<ServerlessData>>;
|
|
349
|
+
getBuilds: (params: GetBuildsParams) => Promise<BolticErrorResponse | BolticSuccessResponse<GetBuildsData>>;
|
|
350
|
+
getLogs: (params: GetLogsParams) => Promise<BolticErrorResponse | BolticSuccessResponse<GetLogsData>>;
|
|
351
|
+
getBuildLogs: (params: GetBuildLogsParams) => Promise<BolticErrorResponse | BolticSuccessResponse<GetBuildLogsData>>;
|
|
352
|
+
pollStatus: (appId: string, options?: {
|
|
353
|
+
intervalMs?: number;
|
|
354
|
+
maxAttempts?: number;
|
|
355
|
+
}) => Promise<BolticErrorResponse | BolticSuccessResponse<ServerlessData>>;
|
|
356
|
+
};
|
|
223
357
|
getSqlResource(): SqlResource;
|
|
224
358
|
updateApiKey(newApiKey: string): void;
|
|
225
359
|
updateConfig(updates: Partial<ClientConfig>): void;
|
|
@@ -253,15 +387,6 @@ export declare interface BolticErrorResponse {
|
|
|
253
387
|
};
|
|
254
388
|
}
|
|
255
389
|
|
|
256
|
-
declare interface BolticErrorResponse_2 {
|
|
257
|
-
data?: never;
|
|
258
|
-
error: {
|
|
259
|
-
code?: string;
|
|
260
|
-
message?: string;
|
|
261
|
-
meta?: string[];
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
|
|
265
390
|
export declare interface BolticListResponse<T> {
|
|
266
391
|
data: T[];
|
|
267
392
|
pagination?: {
|
|
@@ -279,18 +404,6 @@ export declare interface BolticListResponse<T> {
|
|
|
279
404
|
};
|
|
280
405
|
}
|
|
281
406
|
|
|
282
|
-
declare interface BolticListResponse_2<T = unknown> {
|
|
283
|
-
data: T[];
|
|
284
|
-
pagination?: {
|
|
285
|
-
total_count: number;
|
|
286
|
-
total_pages: number;
|
|
287
|
-
current_page: number;
|
|
288
|
-
per_page: number;
|
|
289
|
-
type: string;
|
|
290
|
-
};
|
|
291
|
-
message?: string;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
407
|
export declare interface BolticSuccessResponse<T> {
|
|
295
408
|
data: T;
|
|
296
409
|
message?: string;
|
|
@@ -301,12 +414,7 @@ export declare interface BolticSuccessResponse<T> {
|
|
|
301
414
|
};
|
|
302
415
|
}
|
|
303
416
|
|
|
304
|
-
declare interface
|
|
305
|
-
data: T;
|
|
306
|
-
message?: string;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
declare interface ClientConfig extends EnvironmentConfig {
|
|
417
|
+
export declare interface ClientConfig extends EnvironmentConfig {
|
|
310
418
|
apiKey: string;
|
|
311
419
|
environment: Environment;
|
|
312
420
|
region: Region;
|
|
@@ -417,6 +525,25 @@ export declare function createClient(apiKey: string, options?: ClientOptions): B
|
|
|
417
525
|
*/
|
|
418
526
|
export declare function createErrorWithContext(message: string, context?: Record<string, unknown>): Error;
|
|
419
527
|
|
|
528
|
+
export declare type CreateServerlessData = ServerlessData;
|
|
529
|
+
|
|
530
|
+
export declare interface CreateServerlessParams {
|
|
531
|
+
Name: string;
|
|
532
|
+
Description?: string;
|
|
533
|
+
Runtime: ServerlessRuntime;
|
|
534
|
+
Env?: Record<string, string>;
|
|
535
|
+
PortMap?: ServerlessPortMap[];
|
|
536
|
+
Scaling?: ServerlessScaling;
|
|
537
|
+
Resources?: ServerlessResources;
|
|
538
|
+
Timeout?: number;
|
|
539
|
+
Validations?: unknown;
|
|
540
|
+
CodeOpts?: ServerlessCodeOpts;
|
|
541
|
+
ContainerOpts?: ServerlessContainerOpts;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/** Data returned from the get-credentials API */
|
|
545
|
+
export declare type CredentialsListData = Record<string, unknown>;
|
|
546
|
+
|
|
420
547
|
declare interface DatabaseContext {
|
|
421
548
|
databaseId?: string;
|
|
422
549
|
dbInternalName?: string;
|
|
@@ -555,13 +682,28 @@ declare const DateFormatEnum: Readonly<{
|
|
|
555
682
|
|
|
556
683
|
declare type DecimalType = '00' | '0.0' | '0.00' | '0.000' | '0.0000' | '0.00000' | '0.000000';
|
|
557
684
|
|
|
685
|
+
/** Default resource allocation for new serverless functions */
|
|
686
|
+
export declare const DEFAULT_RESOURCES: {
|
|
687
|
+
readonly CPU: 0.1;
|
|
688
|
+
readonly MemoryMB: 128;
|
|
689
|
+
readonly MemoryMaxMB: 128;
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
/** Default scaling configuration for new serverless functions */
|
|
693
|
+
export declare const DEFAULT_SCALING: {
|
|
694
|
+
readonly AutoStop: false;
|
|
695
|
+
readonly Min: 1;
|
|
696
|
+
readonly Max: 1;
|
|
697
|
+
readonly MaxIdleTime: 0;
|
|
698
|
+
};
|
|
699
|
+
|
|
558
700
|
declare interface DeleteIndexResponse {
|
|
559
701
|
message?: string;
|
|
560
702
|
}
|
|
561
703
|
|
|
562
|
-
declare type Environment = 'local' | 'sit' | 'uat' | 'prod';
|
|
704
|
+
export declare type Environment = 'local' | 'sit' | 'uat' | 'prod';
|
|
563
705
|
|
|
564
|
-
declare interface EnvironmentConfig {
|
|
706
|
+
export declare interface EnvironmentConfig {
|
|
565
707
|
baseURL: string;
|
|
566
708
|
timeout: number;
|
|
567
709
|
retryAttempts?: number;
|
|
@@ -570,6 +712,38 @@ declare interface EnvironmentConfig {
|
|
|
570
712
|
|
|
571
713
|
declare type ErrorInterceptor = (error: unknown) => unknown | Promise<unknown>;
|
|
572
714
|
|
|
715
|
+
/** Data returned from the execute-activity API */
|
|
716
|
+
export declare interface ExecuteActivityResponseData {
|
|
717
|
+
execution_id: string;
|
|
718
|
+
[key: string]: unknown;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Parameters accepted by `workflow.executeIntegration()`.
|
|
723
|
+
*
|
|
724
|
+
* @remarks
|
|
725
|
+
* When `executeOnly` is `false` (default), the SDK will poll
|
|
726
|
+
* `getIntegrationExecuteById` until the execution reaches a terminal state.
|
|
727
|
+
*/
|
|
728
|
+
export declare interface ExecuteIntegrationParams {
|
|
729
|
+
/**
|
|
730
|
+
* If `true`, return immediately after the execute call without polling.
|
|
731
|
+
* @defaultValue false
|
|
732
|
+
*/
|
|
733
|
+
executeOnly?: boolean;
|
|
734
|
+
/** Activity data describing what to execute. The SDK wraps this into the `nodes[]` structure the API expects. */
|
|
735
|
+
data: {
|
|
736
|
+
type: string;
|
|
737
|
+
name: string;
|
|
738
|
+
properties: ActivityProperties;
|
|
739
|
+
};
|
|
740
|
+
/**
|
|
741
|
+
* Result/context payload for the execute request.
|
|
742
|
+
* Falls back to a sensible default when omitted.
|
|
743
|
+
*/
|
|
744
|
+
result?: ActivityResultPayload;
|
|
745
|
+
}
|
|
746
|
+
|
|
573
747
|
declare interface ExecuteSQLApiResponse {
|
|
574
748
|
data: Record<string, unknown>[];
|
|
575
749
|
count?: number;
|
|
@@ -631,11 +805,146 @@ declare interface FilterParams {
|
|
|
631
805
|
*/
|
|
632
806
|
export declare function formatError(error: unknown): string;
|
|
633
807
|
|
|
808
|
+
/** A single field in the integration form response */
|
|
809
|
+
export declare interface FormField {
|
|
810
|
+
name: string;
|
|
811
|
+
meta: {
|
|
812
|
+
displayType?: string;
|
|
813
|
+
value?: unknown;
|
|
814
|
+
validation?: {
|
|
815
|
+
required?: boolean;
|
|
816
|
+
[key: string]: unknown;
|
|
817
|
+
};
|
|
818
|
+
options?: Array<{
|
|
819
|
+
label: string;
|
|
820
|
+
value: string;
|
|
821
|
+
}>;
|
|
822
|
+
description?: string;
|
|
823
|
+
placeholder?: string;
|
|
824
|
+
displayName?: string;
|
|
825
|
+
config?: Record<string, unknown>;
|
|
826
|
+
htmlProps?: Record<string, unknown>;
|
|
827
|
+
dependencies?: Record<string, unknown>;
|
|
828
|
+
[key: string]: unknown;
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export declare type GetBuildLogsData = ServerlessBuildLogEntry[];
|
|
833
|
+
|
|
834
|
+
export declare interface GetBuildLogsParams {
|
|
835
|
+
/** The serverless function ID. */
|
|
836
|
+
appId: string;
|
|
837
|
+
/** The build ID. */
|
|
838
|
+
buildId: string;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
export declare type GetBuildsData = ServerlessBuild[];
|
|
842
|
+
|
|
843
|
+
export declare interface GetBuildsParams {
|
|
844
|
+
/** The serverless function ID. */
|
|
845
|
+
appId: string;
|
|
846
|
+
/** Page number (1-based). @defaultValue 1 */
|
|
847
|
+
page?: number;
|
|
848
|
+
/** Items per page. @defaultValue 20 */
|
|
849
|
+
limit?: number;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/** Parameters accepted by `workflow.getCredentials()`. */
|
|
853
|
+
export declare interface GetCredentialsParams {
|
|
854
|
+
/** Integration name (e.g. "freshsales"). Automatically uppercased by the SDK. */
|
|
855
|
+
entity: string;
|
|
856
|
+
/**
|
|
857
|
+
* Current page number for pagination.
|
|
858
|
+
* @defaultValue 1
|
|
859
|
+
*/
|
|
860
|
+
current_page?: number;
|
|
861
|
+
/**
|
|
862
|
+
* Number of items per page.
|
|
863
|
+
* @defaultValue 999
|
|
864
|
+
*/
|
|
865
|
+
page_size?: number;
|
|
866
|
+
}
|
|
867
|
+
|
|
634
868
|
/**
|
|
635
869
|
* Extracts HTTP status code from axios or fetch errors
|
|
636
870
|
*/
|
|
637
871
|
export declare function getHttpStatusCode(error: unknown): number | null;
|
|
638
872
|
|
|
873
|
+
/** Parameters accepted by `workflow.getIntegrationForm()`. */
|
|
874
|
+
export declare interface GetIntegrationFormParams {
|
|
875
|
+
/** Integration slug identifier (e.g. "blt-int.asana"). */
|
|
876
|
+
integration_slug: string;
|
|
877
|
+
/** Resource type (e.g. "project", "task"). */
|
|
878
|
+
resource: string;
|
|
879
|
+
/** Operation type (e.g. "create", "update", "read"). */
|
|
880
|
+
operation: string;
|
|
881
|
+
/** Credential secret for the integration. */
|
|
882
|
+
secret: string;
|
|
883
|
+
/**
|
|
884
|
+
* When `true`, returns only the form schema without executing.
|
|
885
|
+
* @defaultValue true
|
|
886
|
+
*/
|
|
887
|
+
getFormOnly?: boolean;
|
|
888
|
+
/**
|
|
889
|
+
* When `true`, the response `data` is returned as a JSON Schema object
|
|
890
|
+
* describing the expected input shape (type, required, default, enum).
|
|
891
|
+
*
|
|
892
|
+
* When `false` or omitted, the response `data` is a flat JSON object
|
|
893
|
+
* with default/fallback values for each field.
|
|
894
|
+
*
|
|
895
|
+
* @defaultValue false
|
|
896
|
+
*/
|
|
897
|
+
asJsonSchema?: boolean;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/** Parameters accepted by `workflow.getIntegrationResource()`. */
|
|
901
|
+
export declare interface GetIntegrationResourceParams {
|
|
902
|
+
/** Integration slug identifier (e.g. "blt-int.asana"). */
|
|
903
|
+
integration_slug: string;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/** Parameters accepted by `workflow.getIntegrations()`. */
|
|
907
|
+
export declare interface GetIntegrationsParams {
|
|
908
|
+
/**
|
|
909
|
+
* Page number for pagination.
|
|
910
|
+
* @defaultValue 1
|
|
911
|
+
*/
|
|
912
|
+
page?: number;
|
|
913
|
+
/**
|
|
914
|
+
* Number of items per page.
|
|
915
|
+
* @defaultValue 999
|
|
916
|
+
*/
|
|
917
|
+
per_page?: number;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
export declare type GetLogsData = ServerlessLogEntry[];
|
|
921
|
+
|
|
922
|
+
export declare interface GetLogsParams {
|
|
923
|
+
/** The serverless function ID. */
|
|
924
|
+
appId: string;
|
|
925
|
+
/** Page number (1-based). @defaultValue 1 */
|
|
926
|
+
page?: number;
|
|
927
|
+
/** Items per page. @defaultValue 50 */
|
|
928
|
+
limit?: number;
|
|
929
|
+
/** Sort direction. @defaultValue 'DESC' */
|
|
930
|
+
sortOrder?: 'ASC' | 'DESC';
|
|
931
|
+
/** Unix epoch start (seconds). Defaults to 24h ago. */
|
|
932
|
+
timestampStart?: number;
|
|
933
|
+
/** Unix epoch end (seconds). Defaults to now. */
|
|
934
|
+
timestampEnd?: number;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
export declare type GetServerlessData = ServerlessData;
|
|
938
|
+
|
|
939
|
+
export declare interface GetServerlessParams {
|
|
940
|
+
/** The serverless function ID. */
|
|
941
|
+
appId: string;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
declare interface HttpAdapter {
|
|
945
|
+
request<T = unknown>(config: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
946
|
+
}
|
|
947
|
+
|
|
639
948
|
declare interface HttpRequestConfig {
|
|
640
949
|
url: string;
|
|
641
950
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
@@ -667,6 +976,24 @@ declare interface IndexListItem {
|
|
|
667
976
|
created_by?: string;
|
|
668
977
|
}
|
|
669
978
|
|
|
979
|
+
/** Data returned from the get-execution-by-id API */
|
|
980
|
+
export declare type IntegrationExecutionData = Record<string, unknown>;
|
|
981
|
+
|
|
982
|
+
/** Data returned from the get-integration-form API */
|
|
983
|
+
export declare type IntegrationFormData = Record<string, unknown>;
|
|
984
|
+
|
|
985
|
+
/** JSON Schema output for an integration form */
|
|
986
|
+
export declare interface IntegrationFormJsonSchema {
|
|
987
|
+
type: 'object';
|
|
988
|
+
properties: Record<string, JsonSchemaProperty>;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/** Data returned from the get-integration-resource API */
|
|
992
|
+
export declare type IntegrationResourceData = Record<string, unknown>;
|
|
993
|
+
|
|
994
|
+
/** Data returned from the get-integrations API */
|
|
995
|
+
export declare type IntegrationsListData = Record<string, unknown>;
|
|
996
|
+
|
|
670
997
|
declare interface InterceptorManager {
|
|
671
998
|
request: {
|
|
672
999
|
use(interceptor: RequestInterceptor): number;
|
|
@@ -704,6 +1031,15 @@ export declare function isListResponse<T>(response: ApiResponse<T>): response is
|
|
|
704
1031
|
*/
|
|
705
1032
|
export declare function isNetworkError(error: unknown): error is Error;
|
|
706
1033
|
|
|
1034
|
+
/** A single property in the generated JSON Schema */
|
|
1035
|
+
export declare interface JsonSchemaProperty {
|
|
1036
|
+
type: string;
|
|
1037
|
+
required?: boolean;
|
|
1038
|
+
default?: unknown;
|
|
1039
|
+
description?: string;
|
|
1040
|
+
enum?: string[];
|
|
1041
|
+
}
|
|
1042
|
+
|
|
707
1043
|
declare interface ListIndexesQuery {
|
|
708
1044
|
page?: {
|
|
709
1045
|
page_no: number;
|
|
@@ -729,6 +1065,32 @@ declare interface ListIndexesResponse {
|
|
|
729
1065
|
};
|
|
730
1066
|
}
|
|
731
1067
|
|
|
1068
|
+
export declare type ListServerlessData = ServerlessData[];
|
|
1069
|
+
|
|
1070
|
+
export declare interface ListServerlessParams {
|
|
1071
|
+
/** Page number (1-based). @defaultValue 1 */
|
|
1072
|
+
page?: number;
|
|
1073
|
+
/** Items per page. @defaultValue 20 */
|
|
1074
|
+
limit?: number;
|
|
1075
|
+
/** Field to sort by. @defaultValue 'CreatedAt' */
|
|
1076
|
+
sortBy?: string;
|
|
1077
|
+
/** Sort direction. @defaultValue 'desc' */
|
|
1078
|
+
sortOrder?: 'asc' | 'desc';
|
|
1079
|
+
/** Search query string to filter by name. */
|
|
1080
|
+
query?: string;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/** Maximum number of status polling attempts before timeout */
|
|
1084
|
+
export declare const MAX_STATUS_POLLING_ATTEMPTS = 60;
|
|
1085
|
+
|
|
1086
|
+
export declare interface PaginationInfo {
|
|
1087
|
+
total_count: number;
|
|
1088
|
+
total_pages: number;
|
|
1089
|
+
current_page: number;
|
|
1090
|
+
per_page: number;
|
|
1091
|
+
type: string;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
732
1094
|
/**
|
|
733
1095
|
* Pagination parameters
|
|
734
1096
|
*/
|
|
@@ -755,6 +1117,17 @@ export declare interface QueryOperator<T = unknown> {
|
|
|
755
1117
|
$exists?: boolean;
|
|
756
1118
|
}
|
|
757
1119
|
|
|
1120
|
+
export declare interface QueryOptions {
|
|
1121
|
+
fields?: string[];
|
|
1122
|
+
sort?: Array<{
|
|
1123
|
+
field: string;
|
|
1124
|
+
order: 'asc' | 'desc';
|
|
1125
|
+
}>;
|
|
1126
|
+
limit?: number;
|
|
1127
|
+
offset?: number;
|
|
1128
|
+
where?: Record<string, unknown>;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
758
1131
|
/**
|
|
759
1132
|
* Record Builder - provides a fluent interface for building record queries and operations
|
|
760
1133
|
*/
|
|
@@ -963,11 +1336,339 @@ export declare interface RecordWithId extends RecordData {
|
|
|
963
1336
|
|
|
964
1337
|
export declare type Region = 'asia-south1' | 'us-central1';
|
|
965
1338
|
|
|
1339
|
+
export declare interface RegionHostConfig {
|
|
1340
|
+
host: string;
|
|
1341
|
+
timeout: number;
|
|
1342
|
+
debug?: boolean;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
966
1345
|
declare type RequestInterceptor = (config: HttpRequestConfig) => HttpRequestConfig | Promise<HttpRequestConfig>;
|
|
967
1346
|
|
|
1347
|
+
/**
|
|
1348
|
+
* Resolve a full service URL from region, environment, and service path.
|
|
1349
|
+
*/
|
|
1350
|
+
export declare function resolveServiceURL(region: Region, environment: Environment, servicePath: string): string;
|
|
1351
|
+
|
|
968
1352
|
declare type ResponseInterceptor = (response: HttpResponse) => HttpResponse | Promise<HttpResponse>;
|
|
969
1353
|
|
|
970
|
-
|
|
1354
|
+
/** Retry configuration for an activity */
|
|
1355
|
+
export declare interface RetryConfig {
|
|
1356
|
+
maximum_attempts: number;
|
|
1357
|
+
backoff_coefficient: number;
|
|
1358
|
+
initial_interval: number;
|
|
1359
|
+
maximum_interval: number;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
export declare class ServerlessApiClient extends BaseApiClient {
|
|
1363
|
+
constructor(apiKey: string, config?: Omit<BaseApiClientConfig, 'apiKey'>);
|
|
1364
|
+
/**
|
|
1365
|
+
* List all serverless functions with optional pagination and search.
|
|
1366
|
+
*/
|
|
1367
|
+
list(params?: ListServerlessParams): Promise<ServerlessResponse<ListServerlessData>>;
|
|
1368
|
+
/**
|
|
1369
|
+
* Get a serverless function by its ID.
|
|
1370
|
+
*/
|
|
1371
|
+
get(appId: string): Promise<ServerlessResponse<GetServerlessData>>;
|
|
1372
|
+
/**
|
|
1373
|
+
* Create a new serverless function.
|
|
1374
|
+
*/
|
|
1375
|
+
create(payload: CreateServerlessParams): Promise<ServerlessResponse<CreateServerlessData>>;
|
|
1376
|
+
/**
|
|
1377
|
+
* Update an existing serverless function.
|
|
1378
|
+
*/
|
|
1379
|
+
update(params: UpdateServerlessParams): Promise<ServerlessResponse<UpdateServerlessData>>;
|
|
1380
|
+
/**
|
|
1381
|
+
* List builds for a serverless function.
|
|
1382
|
+
*/
|
|
1383
|
+
getBuilds(params: GetBuildsParams): Promise<ServerlessResponse<GetBuildsData>>;
|
|
1384
|
+
/**
|
|
1385
|
+
* Get runtime logs for a serverless function.
|
|
1386
|
+
*/
|
|
1387
|
+
getLogs(params: GetLogsParams): Promise<ServerlessResponse<GetLogsData>>;
|
|
1388
|
+
/**
|
|
1389
|
+
* Get build logs for a specific build of a serverless function.
|
|
1390
|
+
*/
|
|
1391
|
+
getBuildLogs(params: GetBuildLogsParams): Promise<ServerlessResponse<GetBuildLogsData>>;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
export declare interface ServerlessApiEndpoint {
|
|
1395
|
+
path: string;
|
|
1396
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
1397
|
+
authenticated: boolean;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
export declare interface ServerlessAppDomain {
|
|
1401
|
+
DomainName: string;
|
|
1402
|
+
BaseUrl?: string;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
export declare interface ServerlessBuild {
|
|
1406
|
+
ID: string;
|
|
1407
|
+
Version?: number;
|
|
1408
|
+
Status?: string;
|
|
1409
|
+
StatusHistory?: ServerlessBuildStatusEntry[];
|
|
1410
|
+
CreatedAt?: string;
|
|
1411
|
+
[key: string]: unknown;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
export declare interface ServerlessBuildLogEntry {
|
|
1415
|
+
Log?: string;
|
|
1416
|
+
Timestamp?: number;
|
|
1417
|
+
Message?: string;
|
|
1418
|
+
[key: string]: unknown;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
export declare interface ServerlessBuildStatusEntry {
|
|
1422
|
+
Status: string;
|
|
1423
|
+
Timestamp?: string;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
export declare interface ServerlessCodeOpts {
|
|
1427
|
+
Language: string;
|
|
1428
|
+
Packages?: string[];
|
|
1429
|
+
Code?: string;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
export declare interface ServerlessConfig {
|
|
1433
|
+
Name: string;
|
|
1434
|
+
Description?: string;
|
|
1435
|
+
Runtime: ServerlessRuntime;
|
|
1436
|
+
Env?: Record<string, string>;
|
|
1437
|
+
PortMap?: ServerlessPortMap[];
|
|
1438
|
+
Scaling?: ServerlessScaling;
|
|
1439
|
+
Resources?: ServerlessResources;
|
|
1440
|
+
Timeout?: number;
|
|
1441
|
+
Validations?: unknown;
|
|
1442
|
+
CodeOpts?: ServerlessCodeOpts;
|
|
1443
|
+
ContainerOpts?: ServerlessContainerOpts;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
export declare interface ServerlessContainerOpts {
|
|
1447
|
+
Image: string;
|
|
1448
|
+
Args?: string[];
|
|
1449
|
+
Command?: string;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
export declare interface ServerlessData {
|
|
1453
|
+
ID: string;
|
|
1454
|
+
ParentID?: string;
|
|
1455
|
+
Status: ServerlessStatus;
|
|
1456
|
+
Config: ServerlessConfig;
|
|
1457
|
+
Links?: {
|
|
1458
|
+
Git?: {
|
|
1459
|
+
Repository?: ServerlessGitRepository;
|
|
1460
|
+
};
|
|
1461
|
+
};
|
|
1462
|
+
AppDomain?: ServerlessAppDomain[];
|
|
1463
|
+
RegionID?: string;
|
|
1464
|
+
CreatedAt?: string;
|
|
1465
|
+
UpdatedAt?: string;
|
|
1466
|
+
[key: string]: unknown;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
export declare interface ServerlessGitRepository {
|
|
1470
|
+
SshURL?: string;
|
|
1471
|
+
HtmlURL?: string;
|
|
1472
|
+
CloneURL?: string;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
export declare interface ServerlessLogEntry {
|
|
1476
|
+
Timestamp?: number;
|
|
1477
|
+
Severity?: string;
|
|
1478
|
+
Log?: string;
|
|
1479
|
+
[key: string]: unknown;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
export declare interface ServerlessPortMap {
|
|
1483
|
+
ContainerPort?: number;
|
|
1484
|
+
HostPort?: number;
|
|
1485
|
+
Protocol?: string;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
export declare class ServerlessResource extends BaseResource {
|
|
1489
|
+
private apiClient;
|
|
1490
|
+
constructor(client: BaseClient);
|
|
1491
|
+
/**
|
|
1492
|
+
* List all serverless functions with optional pagination and search.
|
|
1493
|
+
*
|
|
1494
|
+
* @param params - Optional pagination and filter parameters
|
|
1495
|
+
* @returns Paginated list of serverless functions
|
|
1496
|
+
*
|
|
1497
|
+
* @example
|
|
1498
|
+
* ```typescript
|
|
1499
|
+
* const list = await client.serverless.list();
|
|
1500
|
+
* const filtered = await client.serverless.list({ query: 'my-func', limit: 10 });
|
|
1501
|
+
* ```
|
|
1502
|
+
*/
|
|
1503
|
+
list(params?: ListServerlessParams): Promise<BolticSuccessResponse<ListServerlessData> | BolticErrorResponse>;
|
|
1504
|
+
/**
|
|
1505
|
+
* Get a serverless function by its ID.
|
|
1506
|
+
*
|
|
1507
|
+
* @param appId - The serverless function ID
|
|
1508
|
+
* @returns The serverless function details
|
|
1509
|
+
*
|
|
1510
|
+
* @example
|
|
1511
|
+
* ```typescript
|
|
1512
|
+
* const fn = await client.serverless.get('serverless-id');
|
|
1513
|
+
* ```
|
|
1514
|
+
*/
|
|
1515
|
+
get(appId: string): Promise<BolticSuccessResponse<GetServerlessData> | BolticErrorResponse>;
|
|
1516
|
+
/**
|
|
1517
|
+
* Create a new serverless function.
|
|
1518
|
+
*
|
|
1519
|
+
* Supports three runtime types:
|
|
1520
|
+
* - `code` — deploy code directly (blueprint)
|
|
1521
|
+
* - `git` — deploy from a Git repository
|
|
1522
|
+
* - `container` — deploy a Docker container
|
|
1523
|
+
*
|
|
1524
|
+
* @param params - The serverless creation payload
|
|
1525
|
+
* @returns The created serverless function
|
|
1526
|
+
*
|
|
1527
|
+
* @example
|
|
1528
|
+
* ```typescript
|
|
1529
|
+
* const fn = await client.serverless.create({
|
|
1530
|
+
* Name: 'my-api',
|
|
1531
|
+
* Runtime: 'code',
|
|
1532
|
+
* Resources: { CPU: 0.1, MemoryMB: 128, MemoryMaxMB: 128 },
|
|
1533
|
+
* Scaling: { AutoStop: false, Min: 1, Max: 1, MaxIdleTime: 0 },
|
|
1534
|
+
* CodeOpts: { Language: 'nodejs/20', Code: 'module.exports.handler = ...' },
|
|
1535
|
+
* });
|
|
1536
|
+
* ```
|
|
1537
|
+
*/
|
|
1538
|
+
create(params: CreateServerlessParams): Promise<BolticSuccessResponse<CreateServerlessData> | BolticErrorResponse>;
|
|
1539
|
+
/**
|
|
1540
|
+
* Create a serverless function and poll until it reaches a terminal state.
|
|
1541
|
+
*
|
|
1542
|
+
* Combines `create()` + `pollStatus()` for a simpler workflow.
|
|
1543
|
+
*
|
|
1544
|
+
* @param params - The serverless creation payload
|
|
1545
|
+
* @returns The final serverless state after reaching a terminal status
|
|
1546
|
+
*
|
|
1547
|
+
* @example
|
|
1548
|
+
* ```typescript
|
|
1549
|
+
* const fn = await client.serverless.createAndWait({
|
|
1550
|
+
* Name: 'my-api',
|
|
1551
|
+
* Runtime: 'code',
|
|
1552
|
+
* CodeOpts: { Language: 'nodejs/20', Code: '...' },
|
|
1553
|
+
* Resources: { CPU: 0.1, MemoryMB: 128, MemoryMaxMB: 128 },
|
|
1554
|
+
* Scaling: { AutoStop: false, Min: 1, Max: 1, MaxIdleTime: 0 },
|
|
1555
|
+
* });
|
|
1556
|
+
* ```
|
|
1557
|
+
*/
|
|
1558
|
+
createAndWait(params: CreateServerlessParams): Promise<BolticSuccessResponse<ServerlessData> | BolticErrorResponse>;
|
|
1559
|
+
/**
|
|
1560
|
+
* Update an existing serverless function.
|
|
1561
|
+
*
|
|
1562
|
+
* @param params - The update parameters (appId + partial payload)
|
|
1563
|
+
* @returns The updated serverless function
|
|
1564
|
+
*
|
|
1565
|
+
* @example
|
|
1566
|
+
* ```typescript
|
|
1567
|
+
* const updated = await client.serverless.update({
|
|
1568
|
+
* appId: 'serverless-id',
|
|
1569
|
+
* payload: { Scaling: { AutoStop: true, Min: 0, Max: 3, MaxIdleTime: 300 } },
|
|
1570
|
+
* });
|
|
1571
|
+
* ```
|
|
1572
|
+
*/
|
|
1573
|
+
update(params: UpdateServerlessParams): Promise<BolticSuccessResponse<UpdateServerlessData> | BolticErrorResponse>;
|
|
1574
|
+
/**
|
|
1575
|
+
* Update a serverless function and poll until it reaches a terminal state.
|
|
1576
|
+
*
|
|
1577
|
+
* @param params - The update parameters (appId + partial payload)
|
|
1578
|
+
* @returns The final serverless state after reaching a terminal status
|
|
1579
|
+
*/
|
|
1580
|
+
updateAndWait(params: UpdateServerlessParams): Promise<BolticSuccessResponse<ServerlessData> | BolticErrorResponse>;
|
|
1581
|
+
/**
|
|
1582
|
+
* List builds for a serverless function.
|
|
1583
|
+
*
|
|
1584
|
+
* @param params - The app ID and optional pagination
|
|
1585
|
+
* @returns List of builds
|
|
1586
|
+
*
|
|
1587
|
+
* @example
|
|
1588
|
+
* ```typescript
|
|
1589
|
+
* const builds = await client.serverless.getBuilds({ appId: 'serverless-id' });
|
|
1590
|
+
* ```
|
|
1591
|
+
*/
|
|
1592
|
+
getBuilds(params: GetBuildsParams): Promise<BolticSuccessResponse<GetBuildsData> | BolticErrorResponse>;
|
|
1593
|
+
/**
|
|
1594
|
+
* Get runtime logs for a serverless function.
|
|
1595
|
+
*
|
|
1596
|
+
* @param params - The app ID and optional time range / pagination
|
|
1597
|
+
* @returns Log entries
|
|
1598
|
+
*
|
|
1599
|
+
* @example
|
|
1600
|
+
* ```typescript
|
|
1601
|
+
* const logs = await client.serverless.getLogs({ appId: 'serverless-id' });
|
|
1602
|
+
* const recentLogs = await client.serverless.getLogs({
|
|
1603
|
+
* appId: 'serverless-id',
|
|
1604
|
+
* limit: 100,
|
|
1605
|
+
* sortOrder: 'DESC',
|
|
1606
|
+
* });
|
|
1607
|
+
* ```
|
|
1608
|
+
*/
|
|
1609
|
+
getLogs(params: GetLogsParams): Promise<BolticSuccessResponse<GetLogsData> | BolticErrorResponse>;
|
|
1610
|
+
/**
|
|
1611
|
+
* Get build logs for a specific build.
|
|
1612
|
+
*
|
|
1613
|
+
* @param params - The app ID and build ID
|
|
1614
|
+
* @returns Build log entries
|
|
1615
|
+
*
|
|
1616
|
+
* @example
|
|
1617
|
+
* ```typescript
|
|
1618
|
+
* const logs = await client.serverless.getBuildLogs({
|
|
1619
|
+
* appId: 'serverless-id',
|
|
1620
|
+
* buildId: 'build-id',
|
|
1621
|
+
* });
|
|
1622
|
+
* ```
|
|
1623
|
+
*/
|
|
1624
|
+
getBuildLogs(params: GetBuildLogsParams): Promise<BolticSuccessResponse<GetBuildLogsData> | BolticErrorResponse>;
|
|
1625
|
+
/**
|
|
1626
|
+
* Poll a serverless function until it reaches a terminal status
|
|
1627
|
+
* (running, failed, degraded, or suspended).
|
|
1628
|
+
*
|
|
1629
|
+
* @param appId - The serverless function ID to poll
|
|
1630
|
+
* @param options - Optional polling configuration overrides
|
|
1631
|
+
* @returns The final serverless state or a timeout error
|
|
1632
|
+
*
|
|
1633
|
+
* @example
|
|
1634
|
+
* ```typescript
|
|
1635
|
+
* const result = await client.serverless.pollStatus('serverless-id');
|
|
1636
|
+
* ```
|
|
1637
|
+
*/
|
|
1638
|
+
pollStatus(appId: string, options?: {
|
|
1639
|
+
intervalMs?: number;
|
|
1640
|
+
maxAttempts?: number;
|
|
1641
|
+
}): Promise<BolticSuccessResponse<ServerlessData> | BolticErrorResponse>;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
export declare interface ServerlessResources {
|
|
1645
|
+
CPU: number;
|
|
1646
|
+
MemoryMB: number;
|
|
1647
|
+
MemoryMaxMB: number;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
declare type ServerlessResponse<T> = BolticSuccessResponse<T> | BolticErrorResponse;
|
|
1651
|
+
|
|
1652
|
+
export declare type ServerlessRuntime = 'code' | 'git' | 'container';
|
|
1653
|
+
|
|
1654
|
+
export declare interface ServerlessScaling {
|
|
1655
|
+
AutoStop: boolean;
|
|
1656
|
+
Min: number;
|
|
1657
|
+
Max: number;
|
|
1658
|
+
MaxIdleTime: number;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
export declare type ServerlessStatus = 'running' | 'draft' | 'building' | 'pending' | 'stopped' | 'failed' | 'degraded' | 'suspended';
|
|
1662
|
+
|
|
1663
|
+
/** Well-known service paths used across the SDK */
|
|
1664
|
+
export declare const SERVICE_PATHS: {
|
|
1665
|
+
readonly DATABASES: "/service/sdk/boltic-tables/v1";
|
|
1666
|
+
readonly WORKFLOW_TEMPORAL: "/service/panel/temporal/v1.0";
|
|
1667
|
+
readonly INTEGRATION: "/service/panel/integration/v1";
|
|
1668
|
+
readonly SERVERLESS: "/service/panel/serverless/v1.0";
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1671
|
+
export declare interface ServiceAuthConfig extends AuthConfig_2 {
|
|
971
1672
|
service: string;
|
|
972
1673
|
serviceEndpoint?: string;
|
|
973
1674
|
}
|
|
@@ -1003,6 +1704,9 @@ declare class SqlResource {
|
|
|
1003
1704
|
executeSQL(query: string, dbId?: string): Promise<ExecuteSQLApiResponse | BolticErrorResponse>;
|
|
1004
1705
|
}
|
|
1005
1706
|
|
|
1707
|
+
/** Polling interval in milliseconds between status checks */
|
|
1708
|
+
export declare const STATUS_POLLING_INTERVAL_MS = 5000;
|
|
1709
|
+
|
|
1006
1710
|
/**
|
|
1007
1711
|
* Table Builder - provides a fluent interface for creating tables
|
|
1008
1712
|
*/
|
|
@@ -1236,30 +1940,23 @@ export declare interface TableRecord {
|
|
|
1236
1940
|
source?: 'boltic' | 'copilot';
|
|
1237
1941
|
}
|
|
1238
1942
|
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
*/
|
|
1242
|
-
declare class TablesApiClient {
|
|
1243
|
-
private httpAdapter;
|
|
1244
|
-
private config;
|
|
1245
|
-
private baseURL;
|
|
1246
|
-
constructor(apiKey: string, config?: Omit<TablesApiClientConfig, 'apiKey'>);
|
|
1247
|
-
private getBaseURL;
|
|
1943
|
+
declare class TablesApiClient extends BaseApiClient {
|
|
1944
|
+
constructor(apiKey: string, config?: Omit<BaseApiClientConfig, 'apiKey'>);
|
|
1248
1945
|
/**
|
|
1249
1946
|
* Create a new table
|
|
1250
1947
|
*/
|
|
1251
|
-
createTable(request: TableCreateRequest, options?: TableCreateOptions): Promise<
|
|
1948
|
+
createTable(request: TableCreateRequest, options?: TableCreateOptions): Promise<BolticSuccessResponse<TableCreateResponse> | BolticErrorResponse>;
|
|
1252
1949
|
/**
|
|
1253
1950
|
* List tables with filtering and pagination
|
|
1254
1951
|
*/
|
|
1255
|
-
listTables(options?: TableListOptions): Promise<
|
|
1952
|
+
listTables(options?: TableListOptions): Promise<BolticListResponse<TableRecord> | BolticErrorResponse>;
|
|
1256
1953
|
/**
|
|
1257
1954
|
* Get a specific table by ID
|
|
1258
1955
|
*/
|
|
1259
1956
|
getTable(tableId: string, options?: {
|
|
1260
1957
|
fields?: Array<keyof TableRecord>;
|
|
1261
1958
|
db_id?: string;
|
|
1262
|
-
}): Promise<
|
|
1959
|
+
}): Promise<BolticSuccessResponse<TableRecord> | BolticErrorResponse>;
|
|
1263
1960
|
/**
|
|
1264
1961
|
* Update an existing table
|
|
1265
1962
|
*/
|
|
@@ -1268,28 +1965,15 @@ declare class TablesApiClient {
|
|
|
1268
1965
|
description?: string;
|
|
1269
1966
|
fields?: Array<keyof TableRecord>;
|
|
1270
1967
|
db_id?: string;
|
|
1271
|
-
}): Promise<
|
|
1968
|
+
}): Promise<BolticSuccessResponse<TableRecord> | BolticErrorResponse>;
|
|
1272
1969
|
/**
|
|
1273
1970
|
* Delete a table
|
|
1274
1971
|
*/
|
|
1275
1972
|
deleteTable(tableId: string, options?: {
|
|
1276
1973
|
db_id?: string;
|
|
1277
|
-
}): Promise<
|
|
1974
|
+
}): Promise<BolticSuccessResponse<{
|
|
1278
1975
|
message: string;
|
|
1279
|
-
}> |
|
|
1280
|
-
private buildHeaders;
|
|
1281
|
-
private formatErrorResponse;
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
declare interface TablesApiClientConfig {
|
|
1285
|
-
apiKey: string;
|
|
1286
|
-
environment?: Environment;
|
|
1287
|
-
region?: Region;
|
|
1288
|
-
timeout?: number;
|
|
1289
|
-
debug?: boolean;
|
|
1290
|
-
retryAttempts?: number;
|
|
1291
|
-
retryDelay?: number;
|
|
1292
|
-
headers?: Record<string, string>;
|
|
1976
|
+
}> | BolticErrorResponse>;
|
|
1293
1977
|
}
|
|
1294
1978
|
|
|
1295
1979
|
declare interface TableUpdateRequest {
|
|
@@ -1298,6 +1982,9 @@ declare interface TableUpdateRequest {
|
|
|
1298
1982
|
fields?: Array<keyof TableRecord>;
|
|
1299
1983
|
}
|
|
1300
1984
|
|
|
1985
|
+
/** Serverless statuses that indicate the function has reached a terminal state */
|
|
1986
|
+
export declare const TERMINAL_STATUSES: readonly ["running", "failed", "degraded", "suspended"];
|
|
1987
|
+
|
|
1301
1988
|
declare interface TextToSQLOptions {
|
|
1302
1989
|
currentQuery?: string;
|
|
1303
1990
|
}
|
|
@@ -1323,10 +2010,169 @@ declare interface TokenInfo_2 {
|
|
|
1323
2010
|
isValid: boolean;
|
|
1324
2011
|
}
|
|
1325
2012
|
|
|
2013
|
+
/**
|
|
2014
|
+
* Transform raw form fields into a flat JSON object with default/fallback
|
|
2015
|
+
* values for each field.
|
|
2016
|
+
*
|
|
2017
|
+
* Fields like `secret`, `resource`, and `operation` are skipped by default
|
|
2018
|
+
* since they are already handled by the SDK parameters.
|
|
2019
|
+
*/
|
|
2020
|
+
export declare function transformFormToDefaults(fields: FormField[], skipFields?: Set<string>): Record<string, unknown>;
|
|
2021
|
+
|
|
2022
|
+
/**
|
|
2023
|
+
* Transform raw form fields into a JSON Schema object describing the
|
|
2024
|
+
* expected input shape.
|
|
2025
|
+
*
|
|
2026
|
+
* Fields like `secret`, `resource`, and `operation` are skipped by default
|
|
2027
|
+
* since they are already handled by the SDK parameters.
|
|
2028
|
+
*/
|
|
2029
|
+
export declare function transformFormToJsonSchema(fields: FormField[], skipFields?: Set<string>): IntegrationFormJsonSchema;
|
|
2030
|
+
|
|
2031
|
+
export declare type UpdateServerlessData = ServerlessData;
|
|
2032
|
+
|
|
2033
|
+
export declare interface UpdateServerlessParams {
|
|
2034
|
+
/** The serverless function ID to update. */
|
|
2035
|
+
appId: string;
|
|
2036
|
+
/** The update payload — partial config fields to update. */
|
|
2037
|
+
payload: Partial<CreateServerlessParams>;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
1326
2040
|
export declare const VERSION = "1.0.0";
|
|
1327
2041
|
|
|
1328
2042
|
export declare interface WhereCondition {
|
|
1329
2043
|
[fieldName: string]: unknown | QueryOperator;
|
|
1330
2044
|
}
|
|
1331
2045
|
|
|
2046
|
+
/** @deprecated Use `BolticSuccessResponse<T> | BolticErrorResponse` directly */
|
|
2047
|
+
export declare type WorkflowApiResponse<T> = BolticSuccessResponse<T> | BolticErrorResponse;
|
|
2048
|
+
|
|
2049
|
+
/** @deprecated Use `BolticErrorResponse` directly */
|
|
2050
|
+
export declare type WorkflowErrorResponse = BolticErrorResponse;
|
|
2051
|
+
|
|
2052
|
+
export declare class WorkflowResource extends BaseResource {
|
|
2053
|
+
private apiClient;
|
|
2054
|
+
constructor(client: BaseClient);
|
|
2055
|
+
/**
|
|
2056
|
+
* Execute a workflow integration activity.
|
|
2057
|
+
*
|
|
2058
|
+
* When `executeOnly` is `true`, returns the immediate API response.
|
|
2059
|
+
* When `executeOnly` is `false` (default), polls until a terminal state
|
|
2060
|
+
* is reached and returns the final execution result.
|
|
2061
|
+
*
|
|
2062
|
+
* @param params - Execution parameters
|
|
2063
|
+
* @returns The execute response or the final polled result
|
|
2064
|
+
*
|
|
2065
|
+
* @example
|
|
2066
|
+
* ```typescript
|
|
2067
|
+
* const result = await client.workflow.executeIntegration({
|
|
2068
|
+
* data: { type: 'apiActivity', name: 'api1', properties: { method: 'get', endpoint: '...' } },
|
|
2069
|
+
* });
|
|
2070
|
+
*
|
|
2071
|
+
* const fire = await client.workflow.executeIntegration({
|
|
2072
|
+
* data: { type: 'apiActivity', name: 'api1', properties: { method: 'get', endpoint: '...' } },
|
|
2073
|
+
* executeOnly: true,
|
|
2074
|
+
* });
|
|
2075
|
+
* ```
|
|
2076
|
+
*/
|
|
2077
|
+
executeIntegration(params: ExecuteIntegrationParams): Promise<BolticSuccessResponse<ExecuteActivityResponseData | IntegrationExecutionData> | BolticErrorResponse>;
|
|
2078
|
+
/**
|
|
2079
|
+
* Retrieve the result of a workflow execution by its run/execution ID.
|
|
2080
|
+
*
|
|
2081
|
+
* @param executionId - The execution run ID
|
|
2082
|
+
* @returns The execution data or an error response
|
|
2083
|
+
*
|
|
2084
|
+
* @example
|
|
2085
|
+
* ```typescript
|
|
2086
|
+
* const result = await client.workflow.getIntegrationExecuteById('run-uuid');
|
|
2087
|
+
* ```
|
|
2088
|
+
*/
|
|
2089
|
+
getIntegrationExecuteById(executionId: string): Promise<BolticSuccessResponse<IntegrationExecutionData> | BolticErrorResponse>;
|
|
2090
|
+
/**
|
|
2091
|
+
* Fetch the list of available integrations.
|
|
2092
|
+
*
|
|
2093
|
+
* @param params - Optional pagination parameters (`page`, `per_page`)
|
|
2094
|
+
* @returns The integrations list or an error response
|
|
2095
|
+
*
|
|
2096
|
+
* @example
|
|
2097
|
+
* ```typescript
|
|
2098
|
+
* const list = await client.workflow.getIntegrations();
|
|
2099
|
+
* ```
|
|
2100
|
+
*/
|
|
2101
|
+
getIntegrations(params?: GetIntegrationsParams): Promise<BolticSuccessResponse<IntegrationsListData> | BolticErrorResponse>;
|
|
2102
|
+
/**
|
|
2103
|
+
* Fetch credentials for a given integration entity.
|
|
2104
|
+
*
|
|
2105
|
+
* @param params - Entity name (required), optional `current_page` and `page_size`
|
|
2106
|
+
* @returns The credentials list or an error response
|
|
2107
|
+
*
|
|
2108
|
+
* @example
|
|
2109
|
+
* ```typescript
|
|
2110
|
+
* const creds = await client.workflow.getCredentials({ entity: 'freshsales' });
|
|
2111
|
+
* ```
|
|
2112
|
+
*/
|
|
2113
|
+
getCredentials(params: GetCredentialsParams): Promise<BolticSuccessResponse<CredentialsListData> | BolticErrorResponse>;
|
|
2114
|
+
/**
|
|
2115
|
+
* Fetch the resource/operation schema for an integration.
|
|
2116
|
+
*
|
|
2117
|
+
* Returns the available resources and operations supported by the
|
|
2118
|
+
* specified integration (e.g. which resources like "task", "project"
|
|
2119
|
+
* are available and what operations can be performed on them).
|
|
2120
|
+
*
|
|
2121
|
+
* @param params - Integration slug identifier
|
|
2122
|
+
* @returns The integration resource schema or an error response
|
|
2123
|
+
*
|
|
2124
|
+
* @example
|
|
2125
|
+
* ```typescript
|
|
2126
|
+
* const schema = await client.workflow.getIntegrationResource({
|
|
2127
|
+
* integration_slug: 'blt-int.asana',
|
|
2128
|
+
* });
|
|
2129
|
+
* ```
|
|
2130
|
+
*/
|
|
2131
|
+
getIntegrationResource(params: GetIntegrationResourceParams): Promise<BolticSuccessResponse<IntegrationResourceData> | BolticErrorResponse>;
|
|
2132
|
+
/**
|
|
2133
|
+
* Fetch the form schema (fields) for a specific integration resource + operation.
|
|
2134
|
+
*
|
|
2135
|
+
* By default, returns a flat JSON object with default/fallback values
|
|
2136
|
+
* for each input field. Set `asJsonSchema: true` to get a JSON Schema
|
|
2137
|
+
* object describing the expected input shape instead.
|
|
2138
|
+
*
|
|
2139
|
+
* Fields like `resource` and `operation` are automatically excluded
|
|
2140
|
+
* since they are already handled by the SDK parameters. The `secret`
|
|
2141
|
+
* field is included and populated with the value from `params.secret`.
|
|
2142
|
+
*
|
|
2143
|
+
* @param params - Integration slug, resource, operation, credential secret, and format flag
|
|
2144
|
+
* @returns Transformed form data or an error response
|
|
2145
|
+
*
|
|
2146
|
+
* @example
|
|
2147
|
+
* ```typescript
|
|
2148
|
+
* // Get flat defaults: { name: '', workspace: [], team: '', ... }
|
|
2149
|
+
* const defaults = await client.workflow.getIntegrationForm({
|
|
2150
|
+
* integration_slug: 'blt-int.asana',
|
|
2151
|
+
* resource: 'project',
|
|
2152
|
+
* operation: 'create',
|
|
2153
|
+
* secret: 'credential-secret-here',
|
|
2154
|
+
* });
|
|
2155
|
+
*
|
|
2156
|
+
* // Get JSON Schema: { type: 'object', properties: { name: { type: 'string', ... } } }
|
|
2157
|
+
* const schema = await client.workflow.getIntegrationForm({
|
|
2158
|
+
* integration_slug: 'blt-int.asana',
|
|
2159
|
+
* resource: 'project',
|
|
2160
|
+
* operation: 'create',
|
|
2161
|
+
* secret: 'credential-secret-here',
|
|
2162
|
+
* asJsonSchema: true,
|
|
2163
|
+
* });
|
|
2164
|
+
* ```
|
|
2165
|
+
*/
|
|
2166
|
+
getIntegrationForm(params: GetIntegrationFormParams): Promise<BolticSuccessResponse<Record<string, unknown> | IntegrationFormJsonSchema> | BolticErrorResponse>;
|
|
2167
|
+
/**
|
|
2168
|
+
* Internal polling loop.
|
|
2169
|
+
* Repeatedly calls `getExecutionById` until the response `data` object is
|
|
2170
|
+
* non-empty (execution finished) or max attempts are exhausted.
|
|
2171
|
+
*/
|
|
2172
|
+
private pollExecution;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
/** @deprecated Use `BolticSuccessResponse` directly */
|
|
2176
|
+
export declare type WorkflowSuccessResponse<T> = BolticSuccessResponse<T>;
|
|
2177
|
+
|
|
1332
2178
|
export { }
|