@boltic/sdk 0.1.2 → 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 +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 +901 -665
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.mjs +902 -666
- package/dist/sdk.mjs.map +1 -1
- package/dist/types/index.d.ts +463 -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,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);
|
|
@@ -183,7 +249,7 @@ export declare class BolticClient {
|
|
|
183
249
|
insert: (data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
184
250
|
insertMany: (records: RecordData[], options?: {
|
|
185
251
|
validation?: boolean;
|
|
186
|
-
}) => Promise<
|
|
252
|
+
}) => Promise<BolticErrorResponse | RecordBulkInsertResponse>;
|
|
187
253
|
findOne: (recordId: string) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
188
254
|
update: (options: RecordUpdateOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
|
|
189
255
|
updateById: (recordId: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
@@ -199,7 +265,7 @@ export declare class BolticClient {
|
|
|
199
265
|
insert: (tableName: string, data: RecordData) => Promise<BolticErrorResponse | BolticSuccessResponse<RecordWithId>>;
|
|
200
266
|
insertMany: (tableName: string, records: RecordData[], options?: {
|
|
201
267
|
validation?: boolean;
|
|
202
|
-
}) => Promise<
|
|
268
|
+
}) => Promise<BolticErrorResponse | RecordBulkInsertResponse>;
|
|
203
269
|
findAll: (tableName: string, options?: RecordQueryOptions) => Promise<BolticErrorResponse | BolticListResponse<RecordWithId>>;
|
|
204
270
|
findOne: (tableName: string, recordId: string, options?: {
|
|
205
271
|
show_decrypted?: boolean;
|
|
@@ -220,6 +286,31 @@ export declare class BolticClient {
|
|
|
220
286
|
textToSQL: (prompt: string, options?: TextToSQLOptions) => Promise<AsyncIterable<string>>;
|
|
221
287
|
executeSQL: (query: string) => Promise<BolticErrorResponse | ExecuteSQLApiResponse>;
|
|
222
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
|
+
};
|
|
223
314
|
getSqlResource(): SqlResource;
|
|
224
315
|
updateApiKey(newApiKey: string): void;
|
|
225
316
|
updateConfig(updates: Partial<ClientConfig>): void;
|
|
@@ -253,15 +344,6 @@ export declare interface BolticErrorResponse {
|
|
|
253
344
|
};
|
|
254
345
|
}
|
|
255
346
|
|
|
256
|
-
declare interface BolticErrorResponse_2 {
|
|
257
|
-
data?: never;
|
|
258
|
-
error: {
|
|
259
|
-
code?: string;
|
|
260
|
-
message?: string;
|
|
261
|
-
meta?: string[];
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
|
|
265
347
|
export declare interface BolticListResponse<T> {
|
|
266
348
|
data: T[];
|
|
267
349
|
pagination?: {
|
|
@@ -279,18 +361,6 @@ export declare interface BolticListResponse<T> {
|
|
|
279
361
|
};
|
|
280
362
|
}
|
|
281
363
|
|
|
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
364
|
export declare interface BolticSuccessResponse<T> {
|
|
295
365
|
data: T;
|
|
296
366
|
message?: string;
|
|
@@ -301,12 +371,7 @@ export declare interface BolticSuccessResponse<T> {
|
|
|
301
371
|
};
|
|
302
372
|
}
|
|
303
373
|
|
|
304
|
-
declare interface
|
|
305
|
-
data: T;
|
|
306
|
-
message?: string;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
declare interface ClientConfig extends EnvironmentConfig {
|
|
374
|
+
export declare interface ClientConfig extends EnvironmentConfig {
|
|
310
375
|
apiKey: string;
|
|
311
376
|
environment: Environment;
|
|
312
377
|
region: Region;
|
|
@@ -417,6 +482,9 @@ export declare function createClient(apiKey: string, options?: ClientOptions): B
|
|
|
417
482
|
*/
|
|
418
483
|
export declare function createErrorWithContext(message: string, context?: Record<string, unknown>): Error;
|
|
419
484
|
|
|
485
|
+
/** Data returned from the get-credentials API */
|
|
486
|
+
export declare type CredentialsListData = Record<string, unknown>;
|
|
487
|
+
|
|
420
488
|
declare interface DatabaseContext {
|
|
421
489
|
databaseId?: string;
|
|
422
490
|
dbInternalName?: string;
|
|
@@ -559,9 +627,9 @@ declare interface DeleteIndexResponse {
|
|
|
559
627
|
message?: string;
|
|
560
628
|
}
|
|
561
629
|
|
|
562
|
-
declare type Environment = 'local' | 'sit' | 'uat' | 'prod';
|
|
630
|
+
export declare type Environment = 'local' | 'sit' | 'uat' | 'prod';
|
|
563
631
|
|
|
564
|
-
declare interface EnvironmentConfig {
|
|
632
|
+
export declare interface EnvironmentConfig {
|
|
565
633
|
baseURL: string;
|
|
566
634
|
timeout: number;
|
|
567
635
|
retryAttempts?: number;
|
|
@@ -570,6 +638,38 @@ declare interface EnvironmentConfig {
|
|
|
570
638
|
|
|
571
639
|
declare type ErrorInterceptor = (error: unknown) => unknown | Promise<unknown>;
|
|
572
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
|
+
|
|
573
673
|
declare interface ExecuteSQLApiResponse {
|
|
574
674
|
data: Record<string, unknown>[];
|
|
575
675
|
count?: number;
|
|
@@ -631,11 +731,102 @@ declare interface FilterParams {
|
|
|
631
731
|
*/
|
|
632
732
|
export declare function formatError(error: unknown): string;
|
|
633
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
|
+
|
|
634
774
|
/**
|
|
635
775
|
* Extracts HTTP status code from axios or fetch errors
|
|
636
776
|
*/
|
|
637
777
|
export declare function getHttpStatusCode(error: unknown): number | null;
|
|
638
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
|
+
|
|
639
830
|
declare interface HttpRequestConfig {
|
|
640
831
|
url: string;
|
|
641
832
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
@@ -667,6 +858,24 @@ declare interface IndexListItem {
|
|
|
667
858
|
created_by?: string;
|
|
668
859
|
}
|
|
669
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
|
+
|
|
670
879
|
declare interface InterceptorManager {
|
|
671
880
|
request: {
|
|
672
881
|
use(interceptor: RequestInterceptor): number;
|
|
@@ -704,6 +913,15 @@ export declare function isListResponse<T>(response: ApiResponse<T>): response is
|
|
|
704
913
|
*/
|
|
705
914
|
export declare function isNetworkError(error: unknown): error is Error;
|
|
706
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
|
+
|
|
707
925
|
declare interface ListIndexesQuery {
|
|
708
926
|
page?: {
|
|
709
927
|
page_no: number;
|
|
@@ -729,6 +947,14 @@ declare interface ListIndexesResponse {
|
|
|
729
947
|
};
|
|
730
948
|
}
|
|
731
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
|
+
|
|
732
958
|
/**
|
|
733
959
|
* Pagination parameters
|
|
734
960
|
*/
|
|
@@ -755,6 +981,17 @@ export declare interface QueryOperator<T = unknown> {
|
|
|
755
981
|
$exists?: boolean;
|
|
756
982
|
}
|
|
757
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
|
+
|
|
758
995
|
/**
|
|
759
996
|
* Record Builder - provides a fluent interface for building record queries and operations
|
|
760
997
|
*/
|
|
@@ -963,11 +1200,37 @@ export declare interface RecordWithId extends RecordData {
|
|
|
963
1200
|
|
|
964
1201
|
export declare type Region = 'asia-south1' | 'us-central1';
|
|
965
1202
|
|
|
1203
|
+
export declare interface RegionHostConfig {
|
|
1204
|
+
host: string;
|
|
1205
|
+
timeout: number;
|
|
1206
|
+
debug?: boolean;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
966
1209
|
declare type RequestInterceptor = (config: HttpRequestConfig) => HttpRequestConfig | Promise<HttpRequestConfig>;
|
|
967
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
|
+
|
|
968
1216
|
declare type ResponseInterceptor = (response: HttpResponse) => HttpResponse | Promise<HttpResponse>;
|
|
969
1217
|
|
|
970
|
-
|
|
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 {
|
|
971
1234
|
service: string;
|
|
972
1235
|
serviceEndpoint?: string;
|
|
973
1236
|
}
|
|
@@ -1236,30 +1499,23 @@ export declare interface TableRecord {
|
|
|
1236
1499
|
source?: 'boltic' | 'copilot';
|
|
1237
1500
|
}
|
|
1238
1501
|
|
|
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;
|
|
1502
|
+
declare class TablesApiClient extends BaseApiClient {
|
|
1503
|
+
constructor(apiKey: string, config?: Omit<BaseApiClientConfig, 'apiKey'>);
|
|
1248
1504
|
/**
|
|
1249
1505
|
* Create a new table
|
|
1250
1506
|
*/
|
|
1251
|
-
createTable(request: TableCreateRequest, options?: TableCreateOptions): Promise<
|
|
1507
|
+
createTable(request: TableCreateRequest, options?: TableCreateOptions): Promise<BolticSuccessResponse<TableCreateResponse> | BolticErrorResponse>;
|
|
1252
1508
|
/**
|
|
1253
1509
|
* List tables with filtering and pagination
|
|
1254
1510
|
*/
|
|
1255
|
-
listTables(options?: TableListOptions): Promise<
|
|
1511
|
+
listTables(options?: TableListOptions): Promise<BolticListResponse<TableRecord> | BolticErrorResponse>;
|
|
1256
1512
|
/**
|
|
1257
1513
|
* Get a specific table by ID
|
|
1258
1514
|
*/
|
|
1259
1515
|
getTable(tableId: string, options?: {
|
|
1260
1516
|
fields?: Array<keyof TableRecord>;
|
|
1261
1517
|
db_id?: string;
|
|
1262
|
-
}): Promise<
|
|
1518
|
+
}): Promise<BolticSuccessResponse<TableRecord> | BolticErrorResponse>;
|
|
1263
1519
|
/**
|
|
1264
1520
|
* Update an existing table
|
|
1265
1521
|
*/
|
|
@@ -1268,28 +1524,15 @@ declare class TablesApiClient {
|
|
|
1268
1524
|
description?: string;
|
|
1269
1525
|
fields?: Array<keyof TableRecord>;
|
|
1270
1526
|
db_id?: string;
|
|
1271
|
-
}): Promise<
|
|
1527
|
+
}): Promise<BolticSuccessResponse<TableRecord> | BolticErrorResponse>;
|
|
1272
1528
|
/**
|
|
1273
1529
|
* Delete a table
|
|
1274
1530
|
*/
|
|
1275
1531
|
deleteTable(tableId: string, options?: {
|
|
1276
1532
|
db_id?: string;
|
|
1277
|
-
}): Promise<
|
|
1533
|
+
}): Promise<BolticSuccessResponse<{
|
|
1278
1534
|
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>;
|
|
1535
|
+
}> | BolticErrorResponse>;
|
|
1293
1536
|
}
|
|
1294
1537
|
|
|
1295
1538
|
declare interface TableUpdateRequest {
|
|
@@ -1323,10 +1566,160 @@ declare interface TokenInfo_2 {
|
|
|
1323
1566
|
isValid: boolean;
|
|
1324
1567
|
}
|
|
1325
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
|
+
|
|
1326
1587
|
export declare const VERSION = "1.0.0";
|
|
1327
1588
|
|
|
1328
1589
|
export declare interface WhereCondition {
|
|
1329
1590
|
[fieldName: string]: unknown | QueryOperator;
|
|
1330
1591
|
}
|
|
1331
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
|
+
|
|
1332
1725
|
export { }
|