@boltic/sdk 0.1.1 → 0.1.3
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 +192 -154
- 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 +915 -711
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.mjs +916 -712
- package/dist/sdk.mjs.map +1 -1
- package/dist/types/index.d.ts +464 -83
- 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,7 @@ export declare class BolticClient {
|
|
|
106
171
|
private sqlResource;
|
|
107
172
|
private indexResource;
|
|
108
173
|
private databaseResource;
|
|
174
|
+
private workflowResource;
|
|
109
175
|
private currentDatabase;
|
|
110
176
|
private clientOptions;
|
|
111
177
|
constructor(apiKey: string, options?: ClientOptions);
|
|
@@ -154,10 +220,6 @@ export declare class BolticClient {
|
|
|
154
220
|
message: string;
|
|
155
221
|
}>>;
|
|
156
222
|
rename: (oldName: string, newName: string) => Promise<BolticSuccessResponse<TableRecord>>;
|
|
157
|
-
setAccess: (request: {
|
|
158
|
-
table_name: string;
|
|
159
|
-
is_shared: boolean;
|
|
160
|
-
}) => Promise<BolticSuccessResponse<TableRecord>>;
|
|
161
223
|
};
|
|
162
224
|
get columns(): {
|
|
163
225
|
create: (tableName: string, column: FieldDefinition) => Promise<BolticErrorResponse | BolticSuccessResponse<ColumnRecord>>;
|
|
@@ -187,7 +249,7 @@ export declare class BolticClient {
|
|
|
187
249
|
insert: (data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
188
250
|
insertMany: (records: RecordData[], options?: {
|
|
189
251
|
validation?: boolean;
|
|
190
|
-
}) => Promise<
|
|
252
|
+
}) => Promise<BolticErrorResponse | RecordBulkInsertResponse>;
|
|
191
253
|
findOne: (recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
192
254
|
update: (options: RecordUpdateOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
|
|
193
255
|
updateById: (recordId: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
@@ -203,7 +265,7 @@ export declare class BolticClient {
|
|
|
203
265
|
insert: (tableName: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
204
266
|
insertMany: (tableName: string, records: RecordData[], options?: {
|
|
205
267
|
validation?: boolean;
|
|
206
|
-
}) => Promise<
|
|
268
|
+
}) => Promise<BolticErrorResponse | RecordBulkInsertResponse>;
|
|
207
269
|
findAll: (tableName: string, options?: RecordQueryOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
|
|
208
270
|
findOne: (tableName: string, recordId: string, options?: {
|
|
209
271
|
show_decrypted?: boolean;
|
|
@@ -224,6 +286,31 @@ export declare class BolticClient {
|
|
|
224
286
|
textToSQL: (prompt: string, options?: TextToSQLOptions) => Promise<AsyncIterable<string>>;
|
|
225
287
|
executeSQL: (query: string) => Promise<BolticErrorResponse | ExecuteSQLApiResponse>;
|
|
226
288
|
};
|
|
289
|
+
/**
|
|
290
|
+
* Workflow integration operations.
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```typescript
|
|
294
|
+
* // Execute and poll for result
|
|
295
|
+
* const result = await client.workflow.executeIntegration({
|
|
296
|
+
* nodes: [{ id: 'api1', data: { ... }, activity_data: { ... } }],
|
|
297
|
+
* });
|
|
298
|
+
*
|
|
299
|
+
* // Get execution result by ID
|
|
300
|
+
* const exec = await client.workflow.getIntegrationExecuteById('run-uuid');
|
|
301
|
+
*
|
|
302
|
+
* // List integrations
|
|
303
|
+
* const integrations = await client.workflow.getIntegrations();
|
|
304
|
+
* ```
|
|
305
|
+
*/
|
|
306
|
+
get workflow(): {
|
|
307
|
+
executeIntegration: (params: ExecuteIntegrationParams) => Promise<BolticErrorResponse | BolticSuccessResponse<ExecuteActivityResponseData | IntegrationExecutionData>>;
|
|
308
|
+
getIntegrationExecuteById: (executionId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<IntegrationExecutionData>>;
|
|
309
|
+
getIntegrations: (params?: GetIntegrationsParams) => Promise<BolticErrorResponse | BolticSuccessResponse<IntegrationsListData>>;
|
|
310
|
+
getCredentials: (params: GetCredentialsParams) => Promise<BolticErrorResponse | BolticSuccessResponse<CredentialsListData>>;
|
|
311
|
+
getIntegrationResource: (params: GetIntegrationResourceParams) => Promise<BolticErrorResponse | BolticSuccessResponse<IntegrationResourceData>>;
|
|
312
|
+
getIntegrationForm: (params: GetIntegrationFormParams) => Promise<BolticErrorResponse | BolticSuccessResponse<Record<string, unknown> | IntegrationFormJsonSchema>>;
|
|
313
|
+
};
|
|
227
314
|
getSqlResource(): SqlResource;
|
|
228
315
|
updateApiKey(newApiKey: string): void;
|
|
229
316
|
updateConfig(updates: Partial<ClientConfig>): void;
|
|
@@ -257,15 +344,6 @@ export declare interface BolticErrorResponse {
|
|
|
257
344
|
};
|
|
258
345
|
}
|
|
259
346
|
|
|
260
|
-
declare interface BolticErrorResponse_2 {
|
|
261
|
-
data?: never;
|
|
262
|
-
error: {
|
|
263
|
-
code?: string;
|
|
264
|
-
message?: string;
|
|
265
|
-
meta?: string[];
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
347
|
export declare interface BolticListResponse<T> {
|
|
270
348
|
data: T[];
|
|
271
349
|
pagination?: {
|
|
@@ -283,18 +361,6 @@ export declare interface BolticListResponse<T> {
|
|
|
283
361
|
};
|
|
284
362
|
}
|
|
285
363
|
|
|
286
|
-
declare interface BolticListResponse_2<T = unknown> {
|
|
287
|
-
data: T[];
|
|
288
|
-
pagination?: {
|
|
289
|
-
total_count: number;
|
|
290
|
-
total_pages: number;
|
|
291
|
-
current_page: number;
|
|
292
|
-
per_page: number;
|
|
293
|
-
type: string;
|
|
294
|
-
};
|
|
295
|
-
message?: string;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
364
|
export declare interface BolticSuccessResponse<T> {
|
|
299
365
|
data: T;
|
|
300
366
|
message?: string;
|
|
@@ -305,12 +371,7 @@ export declare interface BolticSuccessResponse<T> {
|
|
|
305
371
|
};
|
|
306
372
|
}
|
|
307
373
|
|
|
308
|
-
declare interface
|
|
309
|
-
data: T;
|
|
310
|
-
message?: string;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
declare interface ClientConfig extends EnvironmentConfig {
|
|
374
|
+
export declare interface ClientConfig extends EnvironmentConfig {
|
|
314
375
|
apiKey: string;
|
|
315
376
|
environment: Environment;
|
|
316
377
|
region: Region;
|
|
@@ -421,6 +482,9 @@ export declare function createClient(apiKey: string, options?: ClientOptions): B
|
|
|
421
482
|
*/
|
|
422
483
|
export declare function createErrorWithContext(message: string, context?: Record<string, unknown>): Error;
|
|
423
484
|
|
|
485
|
+
/** Data returned from the get-credentials API */
|
|
486
|
+
export declare type CredentialsListData = Record<string, unknown>;
|
|
487
|
+
|
|
424
488
|
declare interface DatabaseContext {
|
|
425
489
|
databaseId?: string;
|
|
426
490
|
dbInternalName?: string;
|
|
@@ -563,9 +627,9 @@ declare interface DeleteIndexResponse {
|
|
|
563
627
|
message?: string;
|
|
564
628
|
}
|
|
565
629
|
|
|
566
|
-
declare type Environment = 'local' | 'sit' | 'uat' | 'prod';
|
|
630
|
+
export declare type Environment = 'local' | 'sit' | 'uat' | 'prod';
|
|
567
631
|
|
|
568
|
-
declare interface EnvironmentConfig {
|
|
632
|
+
export declare interface EnvironmentConfig {
|
|
569
633
|
baseURL: string;
|
|
570
634
|
timeout: number;
|
|
571
635
|
retryAttempts?: number;
|
|
@@ -574,6 +638,38 @@ declare interface EnvironmentConfig {
|
|
|
574
638
|
|
|
575
639
|
declare type ErrorInterceptor = (error: unknown) => unknown | Promise<unknown>;
|
|
576
640
|
|
|
641
|
+
/** Data returned from the execute-activity API */
|
|
642
|
+
export declare interface ExecuteActivityResponseData {
|
|
643
|
+
execution_id: string;
|
|
644
|
+
[key: string]: unknown;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Parameters accepted by `workflow.executeIntegration()`.
|
|
649
|
+
*
|
|
650
|
+
* @remarks
|
|
651
|
+
* When `executeOnly` is `false` (default), the SDK will poll
|
|
652
|
+
* `getIntegrationExecuteById` until the execution reaches a terminal state.
|
|
653
|
+
*/
|
|
654
|
+
export declare interface ExecuteIntegrationParams {
|
|
655
|
+
/**
|
|
656
|
+
* If `true`, return immediately after the execute call without polling.
|
|
657
|
+
* @defaultValue false
|
|
658
|
+
*/
|
|
659
|
+
executeOnly?: boolean;
|
|
660
|
+
/** Activity data describing what to execute. The SDK wraps this into the `nodes[]` structure the API expects. */
|
|
661
|
+
data: {
|
|
662
|
+
type: string;
|
|
663
|
+
name: string;
|
|
664
|
+
properties: ActivityProperties;
|
|
665
|
+
};
|
|
666
|
+
/**
|
|
667
|
+
* Result/context payload for the execute request.
|
|
668
|
+
* Falls back to a sensible default when omitted.
|
|
669
|
+
*/
|
|
670
|
+
result?: ActivityResultPayload;
|
|
671
|
+
}
|
|
672
|
+
|
|
577
673
|
declare interface ExecuteSQLApiResponse {
|
|
578
674
|
data: Record<string, unknown>[];
|
|
579
675
|
count?: number;
|
|
@@ -635,11 +731,102 @@ declare interface FilterParams {
|
|
|
635
731
|
*/
|
|
636
732
|
export declare function formatError(error: unknown): string;
|
|
637
733
|
|
|
734
|
+
/** A single field in the integration form response */
|
|
735
|
+
export declare interface FormField {
|
|
736
|
+
name: string;
|
|
737
|
+
meta: {
|
|
738
|
+
displayType?: string;
|
|
739
|
+
value?: unknown;
|
|
740
|
+
validation?: {
|
|
741
|
+
required?: boolean;
|
|
742
|
+
[key: string]: unknown;
|
|
743
|
+
};
|
|
744
|
+
options?: Array<{
|
|
745
|
+
label: string;
|
|
746
|
+
value: string;
|
|
747
|
+
}>;
|
|
748
|
+
description?: string;
|
|
749
|
+
placeholder?: string;
|
|
750
|
+
displayName?: string;
|
|
751
|
+
config?: Record<string, unknown>;
|
|
752
|
+
htmlProps?: Record<string, unknown>;
|
|
753
|
+
dependencies?: Record<string, unknown>;
|
|
754
|
+
[key: string]: unknown;
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/** Parameters accepted by `workflow.getCredentials()`. */
|
|
759
|
+
export declare interface GetCredentialsParams {
|
|
760
|
+
/** Integration name (e.g. "freshsales"). Automatically uppercased by the SDK. */
|
|
761
|
+
entity: string;
|
|
762
|
+
/**
|
|
763
|
+
* Current page number for pagination.
|
|
764
|
+
* @defaultValue 1
|
|
765
|
+
*/
|
|
766
|
+
current_page?: number;
|
|
767
|
+
/**
|
|
768
|
+
* Number of items per page.
|
|
769
|
+
* @defaultValue 999
|
|
770
|
+
*/
|
|
771
|
+
page_size?: number;
|
|
772
|
+
}
|
|
773
|
+
|
|
638
774
|
/**
|
|
639
775
|
* Extracts HTTP status code from axios or fetch errors
|
|
640
776
|
*/
|
|
641
777
|
export declare function getHttpStatusCode(error: unknown): number | null;
|
|
642
778
|
|
|
779
|
+
/** Parameters accepted by `workflow.getIntegrationForm()`. */
|
|
780
|
+
export declare interface GetIntegrationFormParams {
|
|
781
|
+
/** Integration slug identifier (e.g. "blt-int.asana"). */
|
|
782
|
+
integration_slug: string;
|
|
783
|
+
/** Resource type (e.g. "project", "task"). */
|
|
784
|
+
resource: string;
|
|
785
|
+
/** Operation type (e.g. "create", "update", "read"). */
|
|
786
|
+
operation: string;
|
|
787
|
+
/** Credential secret for the integration. */
|
|
788
|
+
secret: string;
|
|
789
|
+
/**
|
|
790
|
+
* When `true`, returns only the form schema without executing.
|
|
791
|
+
* @defaultValue true
|
|
792
|
+
*/
|
|
793
|
+
getFormOnly?: boolean;
|
|
794
|
+
/**
|
|
795
|
+
* When `true`, the response `data` is returned as a JSON Schema object
|
|
796
|
+
* describing the expected input shape (type, required, default, enum).
|
|
797
|
+
*
|
|
798
|
+
* When `false` or omitted, the response `data` is a flat JSON object
|
|
799
|
+
* with default/fallback values for each field.
|
|
800
|
+
*
|
|
801
|
+
* @defaultValue false
|
|
802
|
+
*/
|
|
803
|
+
asJsonSchema?: boolean;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/** Parameters accepted by `workflow.getIntegrationResource()`. */
|
|
807
|
+
export declare interface GetIntegrationResourceParams {
|
|
808
|
+
/** Integration slug identifier (e.g. "blt-int.asana"). */
|
|
809
|
+
integration_slug: string;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/** Parameters accepted by `workflow.getIntegrations()`. */
|
|
813
|
+
export declare interface GetIntegrationsParams {
|
|
814
|
+
/**
|
|
815
|
+
* Page number for pagination.
|
|
816
|
+
* @defaultValue 1
|
|
817
|
+
*/
|
|
818
|
+
page?: number;
|
|
819
|
+
/**
|
|
820
|
+
* Number of items per page.
|
|
821
|
+
* @defaultValue 999
|
|
822
|
+
*/
|
|
823
|
+
per_page?: number;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
declare interface HttpAdapter {
|
|
827
|
+
request<T = unknown>(config: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
828
|
+
}
|
|
829
|
+
|
|
643
830
|
declare interface HttpRequestConfig {
|
|
644
831
|
url: string;
|
|
645
832
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
@@ -671,6 +858,24 @@ declare interface IndexListItem {
|
|
|
671
858
|
created_by?: string;
|
|
672
859
|
}
|
|
673
860
|
|
|
861
|
+
/** Data returned from the get-execution-by-id API */
|
|
862
|
+
export declare type IntegrationExecutionData = Record<string, unknown>;
|
|
863
|
+
|
|
864
|
+
/** Data returned from the get-integration-form API */
|
|
865
|
+
export declare type IntegrationFormData = Record<string, unknown>;
|
|
866
|
+
|
|
867
|
+
/** JSON Schema output for an integration form */
|
|
868
|
+
export declare interface IntegrationFormJsonSchema {
|
|
869
|
+
type: 'object';
|
|
870
|
+
properties: Record<string, JsonSchemaProperty>;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/** Data returned from the get-integration-resource API */
|
|
874
|
+
export declare type IntegrationResourceData = Record<string, unknown>;
|
|
875
|
+
|
|
876
|
+
/** Data returned from the get-integrations API */
|
|
877
|
+
export declare type IntegrationsListData = Record<string, unknown>;
|
|
878
|
+
|
|
674
879
|
declare interface InterceptorManager {
|
|
675
880
|
request: {
|
|
676
881
|
use(interceptor: RequestInterceptor): number;
|
|
@@ -708,6 +913,15 @@ export declare function isListResponse<T>(response: ApiResponse<T>): response is
|
|
|
708
913
|
*/
|
|
709
914
|
export declare function isNetworkError(error: unknown): error is Error;
|
|
710
915
|
|
|
916
|
+
/** A single property in the generated JSON Schema */
|
|
917
|
+
export declare interface JsonSchemaProperty {
|
|
918
|
+
type: string;
|
|
919
|
+
required?: boolean;
|
|
920
|
+
default?: unknown;
|
|
921
|
+
description?: string;
|
|
922
|
+
enum?: string[];
|
|
923
|
+
}
|
|
924
|
+
|
|
711
925
|
declare interface ListIndexesQuery {
|
|
712
926
|
page?: {
|
|
713
927
|
page_no: number;
|
|
@@ -733,6 +947,14 @@ declare interface ListIndexesResponse {
|
|
|
733
947
|
};
|
|
734
948
|
}
|
|
735
949
|
|
|
950
|
+
export declare interface PaginationInfo {
|
|
951
|
+
total_count: number;
|
|
952
|
+
total_pages: number;
|
|
953
|
+
current_page: number;
|
|
954
|
+
per_page: number;
|
|
955
|
+
type: string;
|
|
956
|
+
}
|
|
957
|
+
|
|
736
958
|
/**
|
|
737
959
|
* Pagination parameters
|
|
738
960
|
*/
|
|
@@ -759,6 +981,17 @@ export declare interface QueryOperator<T = unknown> {
|
|
|
759
981
|
$exists?: boolean;
|
|
760
982
|
}
|
|
761
983
|
|
|
984
|
+
export declare interface QueryOptions {
|
|
985
|
+
fields?: string[];
|
|
986
|
+
sort?: Array<{
|
|
987
|
+
field: string;
|
|
988
|
+
order: 'asc' | 'desc';
|
|
989
|
+
}>;
|
|
990
|
+
limit?: number;
|
|
991
|
+
offset?: number;
|
|
992
|
+
where?: Record<string, unknown>;
|
|
993
|
+
}
|
|
994
|
+
|
|
762
995
|
/**
|
|
763
996
|
* Record Builder - provides a fluent interface for building record queries and operations
|
|
764
997
|
*/
|
|
@@ -967,11 +1200,37 @@ export declare interface RecordWithId extends RecordData {
|
|
|
967
1200
|
|
|
968
1201
|
export declare type Region = 'asia-south1' | 'us-central1';
|
|
969
1202
|
|
|
1203
|
+
export declare interface RegionHostConfig {
|
|
1204
|
+
host: string;
|
|
1205
|
+
timeout: number;
|
|
1206
|
+
debug?: boolean;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
970
1209
|
declare type RequestInterceptor = (config: HttpRequestConfig) => HttpRequestConfig | Promise<HttpRequestConfig>;
|
|
971
1210
|
|
|
1211
|
+
/**
|
|
1212
|
+
* Resolve a full service URL from region, environment, and service path.
|
|
1213
|
+
*/
|
|
1214
|
+
export declare function resolveServiceURL(region: Region, environment: Environment, servicePath: string): string;
|
|
1215
|
+
|
|
972
1216
|
declare type ResponseInterceptor = (response: HttpResponse) => HttpResponse | Promise<HttpResponse>;
|
|
973
1217
|
|
|
974
|
-
|
|
1218
|
+
/** Retry configuration for an activity */
|
|
1219
|
+
export declare interface RetryConfig {
|
|
1220
|
+
maximum_attempts: number;
|
|
1221
|
+
backoff_coefficient: number;
|
|
1222
|
+
initial_interval: number;
|
|
1223
|
+
maximum_interval: number;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/** Well-known service paths used across the SDK */
|
|
1227
|
+
export declare const SERVICE_PATHS: {
|
|
1228
|
+
readonly DATABASES: "/service/sdk/boltic-tables/v1";
|
|
1229
|
+
readonly WORKFLOW_TEMPORAL: "/service/panel/temporal/v1.0";
|
|
1230
|
+
readonly INTEGRATION: "/service/panel/integration/v1";
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
export declare interface ServiceAuthConfig extends AuthConfig_2 {
|
|
975
1234
|
service: string;
|
|
976
1235
|
serviceEndpoint?: string;
|
|
977
1236
|
}
|
|
@@ -1013,7 +1272,6 @@ declare class SqlResource {
|
|
|
1013
1272
|
declare class TableBuilder {
|
|
1014
1273
|
private tableName;
|
|
1015
1274
|
private description?;
|
|
1016
|
-
private isPublic;
|
|
1017
1275
|
private fields;
|
|
1018
1276
|
private tablesApiClient?;
|
|
1019
1277
|
constructor(options: TableBuilderOptions, tablesApiClient?: TablesApiClient);
|
|
@@ -1025,10 +1283,6 @@ declare class TableBuilder {
|
|
|
1025
1283
|
* Set table description
|
|
1026
1284
|
*/
|
|
1027
1285
|
describe(description: string): TableBuilder;
|
|
1028
|
-
/**
|
|
1029
|
-
* Set if table is public
|
|
1030
|
-
*/
|
|
1031
|
-
public(isPublic?: boolean): TableBuilder;
|
|
1032
1286
|
/**
|
|
1033
1287
|
* Add a text field
|
|
1034
1288
|
*/
|
|
@@ -1197,7 +1451,6 @@ declare interface TableCreateResponse {
|
|
|
1197
1451
|
declare interface TableListOptions extends TableQueryOptions {
|
|
1198
1452
|
page?: number;
|
|
1199
1453
|
pageSize?: number;
|
|
1200
|
-
isShared?: boolean;
|
|
1201
1454
|
db_id?: string;
|
|
1202
1455
|
}
|
|
1203
1456
|
|
|
@@ -1207,7 +1460,6 @@ declare interface TableQueryOptions {
|
|
|
1207
1460
|
name?: string;
|
|
1208
1461
|
db_id?: string;
|
|
1209
1462
|
resource_id?: string;
|
|
1210
|
-
is_public?: boolean;
|
|
1211
1463
|
created_by?: string;
|
|
1212
1464
|
created_at?: {
|
|
1213
1465
|
$gte?: string;
|
|
@@ -1236,6 +1488,7 @@ export declare interface TableRecord {
|
|
|
1236
1488
|
type?: string;
|
|
1237
1489
|
parent_table_id?: string;
|
|
1238
1490
|
is_deleted: boolean;
|
|
1491
|
+
/** @deprecated All tables are now public by default. This field is always true and ineffective. */
|
|
1239
1492
|
is_public: boolean;
|
|
1240
1493
|
created_by: string;
|
|
1241
1494
|
created_at: string;
|
|
@@ -1246,67 +1499,45 @@ export declare interface TableRecord {
|
|
|
1246
1499
|
source?: 'boltic' | 'copilot';
|
|
1247
1500
|
}
|
|
1248
1501
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
*/
|
|
1252
|
-
declare class TablesApiClient {
|
|
1253
|
-
private httpAdapter;
|
|
1254
|
-
private config;
|
|
1255
|
-
private baseURL;
|
|
1256
|
-
constructor(apiKey: string, config?: Omit<TablesApiClientConfig, 'apiKey'>);
|
|
1257
|
-
private getBaseURL;
|
|
1502
|
+
declare class TablesApiClient extends BaseApiClient {
|
|
1503
|
+
constructor(apiKey: string, config?: Omit<BaseApiClientConfig, 'apiKey'>);
|
|
1258
1504
|
/**
|
|
1259
1505
|
* Create a new table
|
|
1260
1506
|
*/
|
|
1261
|
-
createTable(request: TableCreateRequest, options?: TableCreateOptions): Promise<
|
|
1507
|
+
createTable(request: TableCreateRequest, options?: TableCreateOptions): Promise<BolticSuccessResponse<TableCreateResponse> | BolticErrorResponse>;
|
|
1262
1508
|
/**
|
|
1263
1509
|
* List tables with filtering and pagination
|
|
1264
1510
|
*/
|
|
1265
|
-
listTables(options?: TableListOptions): Promise<
|
|
1511
|
+
listTables(options?: TableListOptions): Promise<BolticListResponse<TableRecord> | BolticErrorResponse>;
|
|
1266
1512
|
/**
|
|
1267
1513
|
* Get a specific table by ID
|
|
1268
1514
|
*/
|
|
1269
1515
|
getTable(tableId: string, options?: {
|
|
1270
1516
|
fields?: Array<keyof TableRecord>;
|
|
1271
1517
|
db_id?: string;
|
|
1272
|
-
}): Promise<
|
|
1518
|
+
}): Promise<BolticSuccessResponse<TableRecord> | BolticErrorResponse>;
|
|
1273
1519
|
/**
|
|
1274
1520
|
* Update an existing table
|
|
1275
1521
|
*/
|
|
1276
1522
|
updateTable(tableId: string, updates: {
|
|
1277
1523
|
name?: string;
|
|
1278
1524
|
description?: string;
|
|
1279
|
-
is_shared?: boolean;
|
|
1280
1525
|
fields?: Array<keyof TableRecord>;
|
|
1281
1526
|
db_id?: string;
|
|
1282
|
-
}): Promise<
|
|
1527
|
+
}): Promise<BolticSuccessResponse<TableRecord> | BolticErrorResponse>;
|
|
1283
1528
|
/**
|
|
1284
1529
|
* Delete a table
|
|
1285
1530
|
*/
|
|
1286
1531
|
deleteTable(tableId: string, options?: {
|
|
1287
1532
|
db_id?: string;
|
|
1288
|
-
}): Promise<
|
|
1533
|
+
}): Promise<BolticSuccessResponse<{
|
|
1289
1534
|
message: string;
|
|
1290
|
-
}> |
|
|
1291
|
-
private buildHeaders;
|
|
1292
|
-
private formatErrorResponse;
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
declare interface TablesApiClientConfig {
|
|
1296
|
-
apiKey: string;
|
|
1297
|
-
environment?: Environment;
|
|
1298
|
-
region?: Region;
|
|
1299
|
-
timeout?: number;
|
|
1300
|
-
debug?: boolean;
|
|
1301
|
-
retryAttempts?: number;
|
|
1302
|
-
retryDelay?: number;
|
|
1303
|
-
headers?: Record<string, string>;
|
|
1535
|
+
}> | BolticErrorResponse>;
|
|
1304
1536
|
}
|
|
1305
1537
|
|
|
1306
1538
|
declare interface TableUpdateRequest {
|
|
1307
1539
|
name?: string;
|
|
1308
1540
|
description?: string;
|
|
1309
|
-
is_shared?: boolean;
|
|
1310
1541
|
fields?: Array<keyof TableRecord>;
|
|
1311
1542
|
}
|
|
1312
1543
|
|
|
@@ -1335,10 +1566,160 @@ declare interface TokenInfo_2 {
|
|
|
1335
1566
|
isValid: boolean;
|
|
1336
1567
|
}
|
|
1337
1568
|
|
|
1569
|
+
/**
|
|
1570
|
+
* Transform raw form fields into a flat JSON object with default/fallback
|
|
1571
|
+
* values for each field.
|
|
1572
|
+
*
|
|
1573
|
+
* Fields like `secret`, `resource`, and `operation` are skipped by default
|
|
1574
|
+
* since they are already handled by the SDK parameters.
|
|
1575
|
+
*/
|
|
1576
|
+
export declare function transformFormToDefaults(fields: FormField[], skipFields?: Set<string>): Record<string, unknown>;
|
|
1577
|
+
|
|
1578
|
+
/**
|
|
1579
|
+
* Transform raw form fields into a JSON Schema object describing the
|
|
1580
|
+
* expected input shape.
|
|
1581
|
+
*
|
|
1582
|
+
* Fields like `secret`, `resource`, and `operation` are skipped by default
|
|
1583
|
+
* since they are already handled by the SDK parameters.
|
|
1584
|
+
*/
|
|
1585
|
+
export declare function transformFormToJsonSchema(fields: FormField[], skipFields?: Set<string>): IntegrationFormJsonSchema;
|
|
1586
|
+
|
|
1338
1587
|
export declare const VERSION = "1.0.0";
|
|
1339
1588
|
|
|
1340
1589
|
export declare interface WhereCondition {
|
|
1341
1590
|
[fieldName: string]: unknown | QueryOperator;
|
|
1342
1591
|
}
|
|
1343
1592
|
|
|
1593
|
+
/** @deprecated Use `BolticSuccessResponse<T> | BolticErrorResponse` directly */
|
|
1594
|
+
export declare type WorkflowApiResponse<T> = BolticSuccessResponse<T> | BolticErrorResponse;
|
|
1595
|
+
|
|
1596
|
+
/** @deprecated Use `BolticErrorResponse` directly */
|
|
1597
|
+
export declare type WorkflowErrorResponse = BolticErrorResponse;
|
|
1598
|
+
|
|
1599
|
+
export declare class WorkflowResource extends BaseResource {
|
|
1600
|
+
private apiClient;
|
|
1601
|
+
constructor(client: BaseClient);
|
|
1602
|
+
/**
|
|
1603
|
+
* Execute a workflow integration activity.
|
|
1604
|
+
*
|
|
1605
|
+
* When `executeOnly` is `true`, returns the immediate API response.
|
|
1606
|
+
* When `executeOnly` is `false` (default), polls until a terminal state
|
|
1607
|
+
* is reached and returns the final execution result.
|
|
1608
|
+
*
|
|
1609
|
+
* @param params - Execution parameters
|
|
1610
|
+
* @returns The execute response or the final polled result
|
|
1611
|
+
*
|
|
1612
|
+
* @example
|
|
1613
|
+
* ```typescript
|
|
1614
|
+
* const result = await client.workflow.executeIntegration({
|
|
1615
|
+
* data: { type: 'apiActivity', name: 'api1', properties: { method: 'get', endpoint: '...' } },
|
|
1616
|
+
* });
|
|
1617
|
+
*
|
|
1618
|
+
* const fire = await client.workflow.executeIntegration({
|
|
1619
|
+
* data: { type: 'apiActivity', name: 'api1', properties: { method: 'get', endpoint: '...' } },
|
|
1620
|
+
* executeOnly: true,
|
|
1621
|
+
* });
|
|
1622
|
+
* ```
|
|
1623
|
+
*/
|
|
1624
|
+
executeIntegration(params: ExecuteIntegrationParams): Promise<BolticSuccessResponse<ExecuteActivityResponseData | IntegrationExecutionData> | BolticErrorResponse>;
|
|
1625
|
+
/**
|
|
1626
|
+
* Retrieve the result of a workflow execution by its run/execution ID.
|
|
1627
|
+
*
|
|
1628
|
+
* @param executionId - The execution run ID
|
|
1629
|
+
* @returns The execution data or an error response
|
|
1630
|
+
*
|
|
1631
|
+
* @example
|
|
1632
|
+
* ```typescript
|
|
1633
|
+
* const result = await client.workflow.getIntegrationExecuteById('run-uuid');
|
|
1634
|
+
* ```
|
|
1635
|
+
*/
|
|
1636
|
+
getIntegrationExecuteById(executionId: string): Promise<BolticSuccessResponse<IntegrationExecutionData> | BolticErrorResponse>;
|
|
1637
|
+
/**
|
|
1638
|
+
* Fetch the list of available integrations.
|
|
1639
|
+
*
|
|
1640
|
+
* @param params - Optional pagination parameters (`page`, `per_page`)
|
|
1641
|
+
* @returns The integrations list or an error response
|
|
1642
|
+
*
|
|
1643
|
+
* @example
|
|
1644
|
+
* ```typescript
|
|
1645
|
+
* const list = await client.workflow.getIntegrations();
|
|
1646
|
+
* ```
|
|
1647
|
+
*/
|
|
1648
|
+
getIntegrations(params?: GetIntegrationsParams): Promise<BolticSuccessResponse<IntegrationsListData> | BolticErrorResponse>;
|
|
1649
|
+
/**
|
|
1650
|
+
* Fetch credentials for a given integration entity.
|
|
1651
|
+
*
|
|
1652
|
+
* @param params - Entity name (required), optional `current_page` and `page_size`
|
|
1653
|
+
* @returns The credentials list or an error response
|
|
1654
|
+
*
|
|
1655
|
+
* @example
|
|
1656
|
+
* ```typescript
|
|
1657
|
+
* const creds = await client.workflow.getCredentials({ entity: 'freshsales' });
|
|
1658
|
+
* ```
|
|
1659
|
+
*/
|
|
1660
|
+
getCredentials(params: GetCredentialsParams): Promise<BolticSuccessResponse<CredentialsListData> | BolticErrorResponse>;
|
|
1661
|
+
/**
|
|
1662
|
+
* Fetch the resource/operation schema for an integration.
|
|
1663
|
+
*
|
|
1664
|
+
* Returns the available resources and operations supported by the
|
|
1665
|
+
* specified integration (e.g. which resources like "task", "project"
|
|
1666
|
+
* are available and what operations can be performed on them).
|
|
1667
|
+
*
|
|
1668
|
+
* @param params - Integration slug identifier
|
|
1669
|
+
* @returns The integration resource schema or an error response
|
|
1670
|
+
*
|
|
1671
|
+
* @example
|
|
1672
|
+
* ```typescript
|
|
1673
|
+
* const schema = await client.workflow.getIntegrationResource({
|
|
1674
|
+
* integration_slug: 'blt-int.asana',
|
|
1675
|
+
* });
|
|
1676
|
+
* ```
|
|
1677
|
+
*/
|
|
1678
|
+
getIntegrationResource(params: GetIntegrationResourceParams): Promise<BolticSuccessResponse<IntegrationResourceData> | BolticErrorResponse>;
|
|
1679
|
+
/**
|
|
1680
|
+
* Fetch the form schema (fields) for a specific integration resource + operation.
|
|
1681
|
+
*
|
|
1682
|
+
* By default, returns a flat JSON object with default/fallback values
|
|
1683
|
+
* for each input field. Set `asJsonSchema: true` to get a JSON Schema
|
|
1684
|
+
* object describing the expected input shape instead.
|
|
1685
|
+
*
|
|
1686
|
+
* Fields like `resource` and `operation` are automatically excluded
|
|
1687
|
+
* since they are already handled by the SDK parameters. The `secret`
|
|
1688
|
+
* field is included and populated with the value from `params.secret`.
|
|
1689
|
+
*
|
|
1690
|
+
* @param params - Integration slug, resource, operation, credential secret, and format flag
|
|
1691
|
+
* @returns Transformed form data or an error response
|
|
1692
|
+
*
|
|
1693
|
+
* @example
|
|
1694
|
+
* ```typescript
|
|
1695
|
+
* // Get flat defaults: { name: '', workspace: [], team: '', ... }
|
|
1696
|
+
* const defaults = await client.workflow.getIntegrationForm({
|
|
1697
|
+
* integration_slug: 'blt-int.asana',
|
|
1698
|
+
* resource: 'project',
|
|
1699
|
+
* operation: 'create',
|
|
1700
|
+
* secret: 'credential-secret-here',
|
|
1701
|
+
* });
|
|
1702
|
+
*
|
|
1703
|
+
* // Get JSON Schema: { type: 'object', properties: { name: { type: 'string', ... } } }
|
|
1704
|
+
* const schema = await client.workflow.getIntegrationForm({
|
|
1705
|
+
* integration_slug: 'blt-int.asana',
|
|
1706
|
+
* resource: 'project',
|
|
1707
|
+
* operation: 'create',
|
|
1708
|
+
* secret: 'credential-secret-here',
|
|
1709
|
+
* asJsonSchema: true,
|
|
1710
|
+
* });
|
|
1711
|
+
* ```
|
|
1712
|
+
*/
|
|
1713
|
+
getIntegrationForm(params: GetIntegrationFormParams): Promise<BolticSuccessResponse<Record<string, unknown> | IntegrationFormJsonSchema> | BolticErrorResponse>;
|
|
1714
|
+
/**
|
|
1715
|
+
* Internal polling loop.
|
|
1716
|
+
* Repeatedly calls `getExecutionById` until the response `data` object is
|
|
1717
|
+
* non-empty (execution finished) or max attempts are exhausted.
|
|
1718
|
+
*/
|
|
1719
|
+
private pollExecution;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
/** @deprecated Use `BolticSuccessResponse` directly */
|
|
1723
|
+
export declare type WorkflowSuccessResponse<T> = BolticSuccessResponse<T>;
|
|
1724
|
+
|
|
1344
1725
|
export { }
|