@cobaltio/cobalt-js 8.7.2 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/cobalt.d.ts +136 -8
- package/cobalt.js +66 -3
- package/cobalt.ts +186 -9
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Cobalt.html +36 -25
- package/docs/index.html +9 -1
- package/docs/interfaces/Application.html +18 -13
- package/docs/interfaces/CobaltOptions.html +3 -3
- package/docs/interfaces/Config.html +6 -0
- package/docs/interfaces/ConfigField.html +17 -0
- package/docs/interfaces/ConfigPayload.html +4 -4
- package/docs/interfaces/ConfigWorkflow.html +6 -0
- package/docs/interfaces/EcosystemLead.html +6 -6
- package/docs/interfaces/EcosystemLeadPayload.html +5 -5
- package/docs/interfaces/Execution.html +17 -0
- package/docs/interfaces/InputField.html +13 -7
- package/docs/interfaces/Label.html +3 -3
- package/docs/interfaces/PublicWorkflow.html +4 -4
- package/docs/interfaces/PublicWorkflowPayload.html +4 -4
- package/docs/interfaces/PublicWorkflowsPayload.html +2 -2
- package/docs/interfaces/RuleOptions.html +2 -2
- package/docs/interfaces/UpdateConfigPayload.html +5 -5
- package/docs/interfaces/WorkflowPayload.html +4 -4
- package/docs/llms.txt +837 -0
- package/docs/modules.html +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -56,4 +56,8 @@ cobalt.token = "COBALT_SESSION_TOKEN";
|
|
|
56
56
|
|
|
57
57
|
# Documentation
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
- You can read the [SDK documentation here](https://gocobalt.github.io/cobalt-js).
|
|
60
|
+
|
|
61
|
+
- [`llms.txt`](https://gocobalt.github.io/cobalt-js/llms.txt)
|
|
62
|
+
|
|
63
|
+
This documentation is also available in [llms.txt](https://llmstxt.org) format, which is a simple markdown standard that LLMs can consume easily.
|
package/cobalt.d.ts
CHANGED
|
@@ -3,16 +3,21 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/** An application in Cobalt. */
|
|
5
5
|
export interface Application {
|
|
6
|
+
/** Application ID */
|
|
7
|
+
app_id: string;
|
|
6
8
|
/**The application name. */
|
|
7
9
|
name: string;
|
|
8
10
|
/**The application description. */
|
|
9
11
|
description: string;
|
|
10
12
|
/**The application icon. */
|
|
11
13
|
icon: string;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `slug` instead.
|
|
16
|
+
* The application slug for native apps and `custom` for custom apps.
|
|
17
|
+
*/
|
|
18
|
+
type: string | "custom";
|
|
19
|
+
/** The application slug. */
|
|
20
|
+
slug: string;
|
|
16
21
|
/**The type of auth used by application. */
|
|
17
22
|
auth_type: "oauth2" | "keybased";
|
|
18
23
|
/** Whether the user has connected the application. */
|
|
@@ -21,6 +26,8 @@ export interface Application {
|
|
|
21
26
|
reauth_required?: boolean;
|
|
22
27
|
/** The fields required from the user to connect the application (for `keybased` auth type). */
|
|
23
28
|
auth_input_map?: InputField[];
|
|
29
|
+
/** The categories/tags for the application. */
|
|
30
|
+
tags?: string[];
|
|
24
31
|
}
|
|
25
32
|
/** An Input field to take input from the user. */
|
|
26
33
|
export interface InputField {
|
|
@@ -30,10 +37,19 @@ export interface InputField {
|
|
|
30
37
|
type: string;
|
|
31
38
|
/** Whether the field is required. */
|
|
32
39
|
required: boolean;
|
|
40
|
+
/** Whether the field accepts multiple values. */
|
|
41
|
+
multiple?: boolean;
|
|
33
42
|
/** The placeholder of the field. */
|
|
34
43
|
placeholder: string;
|
|
35
44
|
/** The label of the field. */
|
|
36
45
|
label: string;
|
|
46
|
+
/** The help text for the field. */
|
|
47
|
+
help_text?: string;
|
|
48
|
+
/** The options for the field. */
|
|
49
|
+
options?: {
|
|
50
|
+
name?: string;
|
|
51
|
+
value: string;
|
|
52
|
+
}[];
|
|
37
53
|
}
|
|
38
54
|
/** The payload object for config. */
|
|
39
55
|
export interface ConfigPayload {
|
|
@@ -77,6 +93,9 @@ export interface CobaltOptions {
|
|
|
77
93
|
/** The session token. */
|
|
78
94
|
token?: string;
|
|
79
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* @deprecated
|
|
98
|
+
*/
|
|
80
99
|
export interface EcosystemLead {
|
|
81
100
|
_id: string;
|
|
82
101
|
name?: string;
|
|
@@ -84,6 +103,9 @@ export interface EcosystemLead {
|
|
|
84
103
|
description?: string;
|
|
85
104
|
created_at: string;
|
|
86
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated
|
|
108
|
+
*/
|
|
87
109
|
export interface EcosystemLeadPayload {
|
|
88
110
|
slug: string;
|
|
89
111
|
name?: string;
|
|
@@ -134,7 +156,92 @@ interface PaginationProps {
|
|
|
134
156
|
page?: number;
|
|
135
157
|
limit?: number;
|
|
136
158
|
}
|
|
137
|
-
|
|
159
|
+
interface PaginatedResponse<T> {
|
|
160
|
+
docs: T[];
|
|
161
|
+
totalDocs: number;
|
|
162
|
+
limit: number;
|
|
163
|
+
totalPages: number;
|
|
164
|
+
page: number;
|
|
165
|
+
}
|
|
166
|
+
export interface Config {
|
|
167
|
+
slug: string;
|
|
168
|
+
config_id?: string;
|
|
169
|
+
fields?: ConfigField[];
|
|
170
|
+
workflows?: ConfigWorkflow[];
|
|
171
|
+
field_errors?: {
|
|
172
|
+
id: string;
|
|
173
|
+
name: string;
|
|
174
|
+
error: {
|
|
175
|
+
message: string;
|
|
176
|
+
error?: unknown;
|
|
177
|
+
};
|
|
178
|
+
}[];
|
|
179
|
+
}
|
|
180
|
+
export interface ConfigField {
|
|
181
|
+
id: string;
|
|
182
|
+
name: string;
|
|
183
|
+
field_type: "text" | "date" | "number" | "url" | "email" | "textarea" | "select" | "json" | "map" | "map_v2" | "rule_engine" | string;
|
|
184
|
+
options?: {
|
|
185
|
+
name?: string;
|
|
186
|
+
value: string;
|
|
187
|
+
}[];
|
|
188
|
+
parent?: string;
|
|
189
|
+
labels?: {
|
|
190
|
+
name?: string;
|
|
191
|
+
value: string;
|
|
192
|
+
}[];
|
|
193
|
+
multiple?: boolean;
|
|
194
|
+
required?: boolean;
|
|
195
|
+
hidden?: boolean;
|
|
196
|
+
value?: any;
|
|
197
|
+
/** The placeholder for the field. */
|
|
198
|
+
placeholder?: string;
|
|
199
|
+
/** The help text for the field. */
|
|
200
|
+
help_text?: string;
|
|
201
|
+
/** The page this field is associated with. */
|
|
202
|
+
associated_page?: string;
|
|
203
|
+
}
|
|
204
|
+
export interface ConfigWorkflow {
|
|
205
|
+
id: string;
|
|
206
|
+
name: string;
|
|
207
|
+
description?: string;
|
|
208
|
+
enabled: boolean;
|
|
209
|
+
fields?: ConfigField[];
|
|
210
|
+
}
|
|
211
|
+
export interface Execution {
|
|
212
|
+
_id: string;
|
|
213
|
+
id?: string;
|
|
214
|
+
name: string;
|
|
215
|
+
org_id: string;
|
|
216
|
+
associated_application: {
|
|
217
|
+
_id: string;
|
|
218
|
+
name: string;
|
|
219
|
+
icon?: string;
|
|
220
|
+
};
|
|
221
|
+
status: "COMPLETED" | "RUNNING" | "ERRORED" | "STOPPED" | "STOPPING" | "TIMED_OUT";
|
|
222
|
+
associated_workflow: {
|
|
223
|
+
_id: string;
|
|
224
|
+
name: string;
|
|
225
|
+
};
|
|
226
|
+
associated_trigger_application: {
|
|
227
|
+
_id: string;
|
|
228
|
+
name: string;
|
|
229
|
+
icon?: string;
|
|
230
|
+
app_type?: "custom" | string;
|
|
231
|
+
origin_trigger: {
|
|
232
|
+
_id: string;
|
|
233
|
+
name: string;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
trigger_application_event?: string;
|
|
237
|
+
linked_account_id: string;
|
|
238
|
+
environment: "test" | "production";
|
|
239
|
+
config_id: string;
|
|
240
|
+
associated_event_id: string;
|
|
241
|
+
custom_trigger_id?: string;
|
|
242
|
+
custom_application_id?: string;
|
|
243
|
+
createdAt: string;
|
|
244
|
+
}
|
|
138
245
|
declare class Cobalt {
|
|
139
246
|
private baseUrl;
|
|
140
247
|
token: string;
|
|
@@ -170,7 +277,7 @@ declare class Cobalt {
|
|
|
170
277
|
*/
|
|
171
278
|
getApp(slug: string): Promise<Application>;
|
|
172
279
|
/**
|
|
173
|
-
* Returns all the enabled
|
|
280
|
+
* Returns all the enabled apps.
|
|
174
281
|
* @returns {Promise<Application[]>} The list of applications.
|
|
175
282
|
*/
|
|
176
283
|
getApps(): Promise<Application[]>;
|
|
@@ -239,6 +346,7 @@ declare class Cobalt {
|
|
|
239
346
|
*/
|
|
240
347
|
deleteConfig(slug: string, configId?: string): Promise<unknown>;
|
|
241
348
|
/**
|
|
349
|
+
* @deprecated
|
|
242
350
|
* Create a lead for an ecosystem app.
|
|
243
351
|
* @param {EcosystemLeadPayload} payload The payload object for the lead.
|
|
244
352
|
* @returns {Promise<EcosystemLead>}
|
|
@@ -279,14 +387,14 @@ declare class Cobalt {
|
|
|
279
387
|
*/
|
|
280
388
|
getFieldOptions(lhs: string, slug: string, fieldId: string, workflowId?: string): Promise<RuleOptions>;
|
|
281
389
|
/**
|
|
282
|
-
*
|
|
390
|
+
* Returns the private workflows for the specified application.
|
|
283
391
|
* @param {Object} params
|
|
284
392
|
* @param {String} [params.slug]
|
|
285
393
|
* @param {Number} [params.page]
|
|
286
394
|
* @param {Number} [params.limit]
|
|
287
395
|
* @returns
|
|
288
396
|
*/
|
|
289
|
-
getWorkflows(params?: PublicWorkflowsPayload): Promise<PublicWorkflow
|
|
397
|
+
getWorkflows(params?: PublicWorkflowsPayload): Promise<PaginatedResponse<PublicWorkflow>>;
|
|
290
398
|
/**
|
|
291
399
|
* Create a public workflow for the linked account.
|
|
292
400
|
* @param {Object} params
|
|
@@ -297,5 +405,25 @@ declare class Cobalt {
|
|
|
297
405
|
* @returns {Promise<PublicWorkflow>} The created public workflow.
|
|
298
406
|
*/
|
|
299
407
|
createWorkflow(params: PublicWorkflowPayload): Promise<PublicWorkflow>;
|
|
408
|
+
/**
|
|
409
|
+
* Delete the specified public workflow.
|
|
410
|
+
* @param {String} workflowId The workflow ID.
|
|
411
|
+
* @returns {Promise<unknown>}
|
|
412
|
+
*/
|
|
413
|
+
deleteWorkflow(workflowId: string): Promise<unknown>;
|
|
414
|
+
/**
|
|
415
|
+
* Returns the workflow execution logs for the linked account.
|
|
416
|
+
* @param {Object} [params]
|
|
417
|
+
* @param {Number} [params.page]
|
|
418
|
+
* @param {Number} [params.limit]
|
|
419
|
+
* @returns {Promise<PaginatedResponse<Execution>>} The paginated workflow execution logs.
|
|
420
|
+
*/
|
|
421
|
+
getExecutions({ page, limit }?: PaginationProps): Promise<PaginatedResponse<Execution>>;
|
|
422
|
+
/**
|
|
423
|
+
* Returns the specified workflow execution log.
|
|
424
|
+
* @param {String} executionId The execution ID.
|
|
425
|
+
* @returns {Promise<Execution>} The specified execution log.
|
|
426
|
+
*/
|
|
427
|
+
getExecution(executionId: string): Promise<Execution>;
|
|
300
428
|
}
|
|
301
429
|
export { Cobalt };
|
package/cobalt.js
CHANGED
|
@@ -94,12 +94,12 @@ class Cobalt {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
|
-
* Returns all the enabled
|
|
97
|
+
* Returns all the enabled apps.
|
|
98
98
|
* @returns {Promise<Application[]>} The list of applications.
|
|
99
99
|
*/
|
|
100
100
|
getApps() {
|
|
101
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
const res = yield fetch(`${this.baseUrl}/api/v2/f-sdk/application
|
|
102
|
+
const res = yield fetch(`${this.baseUrl}/api/v2/f-sdk/application`, {
|
|
103
103
|
headers: {
|
|
104
104
|
authorization: `Bearer ${this.token}`,
|
|
105
105
|
},
|
|
@@ -346,6 +346,7 @@ class Cobalt {
|
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
348
|
/**
|
|
349
|
+
* @deprecated
|
|
349
350
|
* Create a lead for an ecosystem app.
|
|
350
351
|
* @param {EcosystemLeadPayload} payload The payload object for the lead.
|
|
351
352
|
* @returns {Promise<EcosystemLead>}
|
|
@@ -467,7 +468,7 @@ class Cobalt {
|
|
|
467
468
|
});
|
|
468
469
|
}
|
|
469
470
|
/**
|
|
470
|
-
*
|
|
471
|
+
* Returns the private workflows for the specified application.
|
|
471
472
|
* @param {Object} params
|
|
472
473
|
* @param {String} [params.slug]
|
|
473
474
|
* @param {Number} [params.page]
|
|
@@ -498,6 +499,7 @@ class Cobalt {
|
|
|
498
499
|
* @returns {Promise<PublicWorkflow>} The created public workflow.
|
|
499
500
|
*/
|
|
500
501
|
createWorkflow(params) {
|
|
502
|
+
var _a;
|
|
501
503
|
return __awaiter(this, void 0, void 0, function* () {
|
|
502
504
|
const res = yield fetch(`${this.baseUrl}/api/v2/public/workflow`, {
|
|
503
505
|
method: "POST",
|
|
@@ -515,6 +517,67 @@ class Cobalt {
|
|
|
515
517
|
const error = yield res.json();
|
|
516
518
|
throw error;
|
|
517
519
|
}
|
|
520
|
+
const data = yield res.json();
|
|
521
|
+
return (_a = data === null || data === void 0 ? void 0 : data.workflow) !== null && _a !== void 0 ? _a : data;
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Delete the specified public workflow.
|
|
526
|
+
* @param {String} workflowId The workflow ID.
|
|
527
|
+
* @returns {Promise<unknown>}
|
|
528
|
+
*/
|
|
529
|
+
deleteWorkflow(workflowId) {
|
|
530
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
531
|
+
const res = yield fetch(`${this.baseUrl}/api/v2/public/workflow/${workflowId}`, {
|
|
532
|
+
method: "DELETE",
|
|
533
|
+
headers: {
|
|
534
|
+
authorization: `Bearer ${this.token}`,
|
|
535
|
+
},
|
|
536
|
+
});
|
|
537
|
+
if (res.status >= 400 && res.status < 600) {
|
|
538
|
+
const error = yield res.json();
|
|
539
|
+
throw error;
|
|
540
|
+
}
|
|
541
|
+
return yield res.json();
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Returns the workflow execution logs for the linked account.
|
|
546
|
+
* @param {Object} [params]
|
|
547
|
+
* @param {Number} [params.page]
|
|
548
|
+
* @param {Number} [params.limit]
|
|
549
|
+
* @returns {Promise<PaginatedResponse<Execution>>} The paginated workflow execution logs.
|
|
550
|
+
*/
|
|
551
|
+
getExecutions({ page = 1, limit = 10 } = {}) {
|
|
552
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
553
|
+
const res = yield fetch(`${this.baseUrl}/api/v2/public/execution?page=${page}&limit=${limit}`, {
|
|
554
|
+
headers: {
|
|
555
|
+
authorization: `Bearer ${this.token}`,
|
|
556
|
+
},
|
|
557
|
+
});
|
|
558
|
+
if (res.status >= 400 && res.status < 600) {
|
|
559
|
+
const error = yield res.json();
|
|
560
|
+
throw error;
|
|
561
|
+
}
|
|
562
|
+
return yield res.json();
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Returns the specified workflow execution log.
|
|
567
|
+
* @param {String} executionId The execution ID.
|
|
568
|
+
* @returns {Promise<Execution>} The specified execution log.
|
|
569
|
+
*/
|
|
570
|
+
getExecution(executionId) {
|
|
571
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
572
|
+
const res = yield fetch(`${this.baseUrl}/api/v2/public/execution/${executionId}`, {
|
|
573
|
+
headers: {
|
|
574
|
+
authorization: `Bearer ${this.token}`,
|
|
575
|
+
},
|
|
576
|
+
});
|
|
577
|
+
if (res.status >= 400 && res.status < 600) {
|
|
578
|
+
const error = yield res.json();
|
|
579
|
+
throw error;
|
|
580
|
+
}
|
|
518
581
|
return yield res.json();
|
|
519
582
|
});
|
|
520
583
|
}
|
package/cobalt.ts
CHANGED
|
@@ -4,16 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
/** An application in Cobalt. */
|
|
6
6
|
export interface Application {
|
|
7
|
+
/** Application ID */
|
|
8
|
+
app_id: string;
|
|
7
9
|
/**The application name. */
|
|
8
10
|
name: string;
|
|
9
11
|
/**The application description. */
|
|
10
12
|
description: string;
|
|
11
13
|
/**The application icon. */
|
|
12
14
|
icon: string;
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `slug` instead.
|
|
17
|
+
* The application slug for native apps and `custom` for custom apps.
|
|
18
|
+
*/
|
|
19
|
+
type: string | "custom";
|
|
20
|
+
/** The application slug. */
|
|
21
|
+
slug: string;
|
|
17
22
|
/**The type of auth used by application. */
|
|
18
23
|
auth_type: "oauth2" | "keybased";
|
|
19
24
|
/** Whether the user has connected the application. */
|
|
@@ -22,6 +27,8 @@ export interface Application {
|
|
|
22
27
|
reauth_required?: boolean;
|
|
23
28
|
/** The fields required from the user to connect the application (for `keybased` auth type). */
|
|
24
29
|
auth_input_map?: InputField[];
|
|
30
|
+
/** The categories/tags for the application. */
|
|
31
|
+
tags?: string[];
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
/** An Input field to take input from the user. */
|
|
@@ -32,10 +39,19 @@ export interface InputField {
|
|
|
32
39
|
type: string;
|
|
33
40
|
/** Whether the field is required. */
|
|
34
41
|
required: boolean;
|
|
42
|
+
/** Whether the field accepts multiple values. */
|
|
43
|
+
multiple?: boolean;
|
|
35
44
|
/** The placeholder of the field. */
|
|
36
45
|
placeholder: string;
|
|
37
46
|
/** The label of the field. */
|
|
38
47
|
label: string;
|
|
48
|
+
/** The help text for the field. */
|
|
49
|
+
help_text?: string;
|
|
50
|
+
/** The options for the field. */
|
|
51
|
+
options?: {
|
|
52
|
+
name?: string;
|
|
53
|
+
value: string;
|
|
54
|
+
}[];
|
|
39
55
|
}
|
|
40
56
|
|
|
41
57
|
/** The payload object for config. */
|
|
@@ -85,6 +101,9 @@ export interface CobaltOptions {
|
|
|
85
101
|
token?: string;
|
|
86
102
|
}
|
|
87
103
|
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated
|
|
106
|
+
*/
|
|
88
107
|
export interface EcosystemLead {
|
|
89
108
|
_id: string;
|
|
90
109
|
name?: string;
|
|
@@ -93,6 +112,9 @@ export interface EcosystemLead {
|
|
|
93
112
|
created_at: string;
|
|
94
113
|
}
|
|
95
114
|
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated
|
|
117
|
+
*/
|
|
96
118
|
export interface EcosystemLeadPayload {
|
|
97
119
|
slug: string;
|
|
98
120
|
name?: string;
|
|
@@ -149,7 +171,97 @@ interface PaginationProps {
|
|
|
149
171
|
limit?: number;
|
|
150
172
|
}
|
|
151
173
|
|
|
152
|
-
|
|
174
|
+
interface PaginatedResponse<T> {
|
|
175
|
+
docs: T[];
|
|
176
|
+
totalDocs: number;
|
|
177
|
+
limit: number;
|
|
178
|
+
totalPages: number;
|
|
179
|
+
page: number;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface Config {
|
|
183
|
+
slug: string;
|
|
184
|
+
config_id?: string;
|
|
185
|
+
fields?: ConfigField[];
|
|
186
|
+
workflows?: ConfigWorkflow[];
|
|
187
|
+
field_errors?: {
|
|
188
|
+
id: string;
|
|
189
|
+
name: string;
|
|
190
|
+
error: {
|
|
191
|
+
message: string;
|
|
192
|
+
error?: unknown;
|
|
193
|
+
};
|
|
194
|
+
}[];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface ConfigField {
|
|
198
|
+
id: string;
|
|
199
|
+
name: string;
|
|
200
|
+
field_type: "text" | "date" | "number" | "url" | "email" | "textarea" | "select" | "json" | "map" | "map_v2" | "rule_engine" | string;
|
|
201
|
+
options?: {
|
|
202
|
+
name?: string;
|
|
203
|
+
value: string;
|
|
204
|
+
}[];
|
|
205
|
+
parent?: string;
|
|
206
|
+
labels?: {
|
|
207
|
+
name?: string;
|
|
208
|
+
value: string;
|
|
209
|
+
}[];
|
|
210
|
+
multiple?: boolean;
|
|
211
|
+
required?: boolean;
|
|
212
|
+
hidden?: boolean;
|
|
213
|
+
value?: any;
|
|
214
|
+
/** The placeholder for the field. */
|
|
215
|
+
placeholder?: string;
|
|
216
|
+
/** The help text for the field. */
|
|
217
|
+
help_text?: string;
|
|
218
|
+
/** The page this field is associated with. */
|
|
219
|
+
associated_page?: string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface ConfigWorkflow {
|
|
223
|
+
id: string;
|
|
224
|
+
name: string;
|
|
225
|
+
description?: string;
|
|
226
|
+
enabled: boolean;
|
|
227
|
+
fields?: ConfigField[];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface Execution {
|
|
231
|
+
_id: string;
|
|
232
|
+
id?: string;
|
|
233
|
+
name: string;
|
|
234
|
+
org_id: string;
|
|
235
|
+
associated_application: {
|
|
236
|
+
_id: string;
|
|
237
|
+
name: string;
|
|
238
|
+
icon?: string;
|
|
239
|
+
},
|
|
240
|
+
status: "COMPLETED" | "RUNNING" | "ERRORED" | "STOPPED" | "STOPPING" | "TIMED_OUT",
|
|
241
|
+
associated_workflow: {
|
|
242
|
+
_id: string;
|
|
243
|
+
name: string;
|
|
244
|
+
},
|
|
245
|
+
associated_trigger_application: {
|
|
246
|
+
_id: string;
|
|
247
|
+
name: string;
|
|
248
|
+
icon?: string;
|
|
249
|
+
app_type?: "custom" | string;
|
|
250
|
+
origin_trigger: {
|
|
251
|
+
_id: string;
|
|
252
|
+
name: string;
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
trigger_application_event?: string;
|
|
256
|
+
linked_account_id: string;
|
|
257
|
+
environment: "test" | "production";
|
|
258
|
+
config_id: string;
|
|
259
|
+
associated_event_id: string;
|
|
260
|
+
custom_trigger_id?: string;
|
|
261
|
+
custom_application_id?: string;
|
|
262
|
+
createdAt: string;
|
|
263
|
+
}
|
|
264
|
+
|
|
153
265
|
type Field = any;
|
|
154
266
|
|
|
155
267
|
class Cobalt {
|
|
@@ -254,11 +366,11 @@ class Cobalt {
|
|
|
254
366
|
}
|
|
255
367
|
|
|
256
368
|
/**
|
|
257
|
-
* Returns all the enabled
|
|
369
|
+
* Returns all the enabled apps.
|
|
258
370
|
* @returns {Promise<Application[]>} The list of applications.
|
|
259
371
|
*/
|
|
260
372
|
public async getApps(): Promise<Application[]> {
|
|
261
|
-
const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/application
|
|
373
|
+
const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/application`, {
|
|
262
374
|
headers: {
|
|
263
375
|
authorization: `Bearer ${this.token}`,
|
|
264
376
|
},
|
|
@@ -517,6 +629,7 @@ class Cobalt {
|
|
|
517
629
|
}
|
|
518
630
|
|
|
519
631
|
/**
|
|
632
|
+
* @deprecated
|
|
520
633
|
* Create a lead for an ecosystem app.
|
|
521
634
|
* @param {EcosystemLeadPayload} payload The payload object for the lead.
|
|
522
635
|
* @returns {Promise<EcosystemLead>}
|
|
@@ -643,14 +756,14 @@ class Cobalt {
|
|
|
643
756
|
}
|
|
644
757
|
|
|
645
758
|
/**
|
|
646
|
-
*
|
|
759
|
+
* Returns the private workflows for the specified application.
|
|
647
760
|
* @param {Object} params
|
|
648
761
|
* @param {String} [params.slug]
|
|
649
762
|
* @param {Number} [params.page]
|
|
650
763
|
* @param {Number} [params.limit]
|
|
651
764
|
* @returns
|
|
652
765
|
*/
|
|
653
|
-
async getWorkflows(params?: PublicWorkflowsPayload): Promise<PublicWorkflow
|
|
766
|
+
async getWorkflows(params?: PublicWorkflowsPayload): Promise<PaginatedResponse<PublicWorkflow>> {
|
|
654
767
|
const res = await fetch(`${this.baseUrl}/api/v2/public/workflow?page=${params?.page || 1}&limit=${params?.limit || 100}${params?.slug ? `&slug=${params.slug}` : ""}`, {
|
|
655
768
|
headers: {
|
|
656
769
|
authorization: `Bearer ${this.token}`,
|
|
@@ -693,6 +806,70 @@ class Cobalt {
|
|
|
693
806
|
throw error;
|
|
694
807
|
}
|
|
695
808
|
|
|
809
|
+
const data = await res.json();
|
|
810
|
+
return data?.workflow ?? data;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Delete the specified public workflow.
|
|
815
|
+
* @param {String} workflowId The workflow ID.
|
|
816
|
+
* @returns {Promise<unknown>}
|
|
817
|
+
*/
|
|
818
|
+
async deleteWorkflow(workflowId: string): Promise<unknown> {
|
|
819
|
+
const res = await fetch(`${this.baseUrl}/api/v2/public/workflow/${workflowId}`, {
|
|
820
|
+
method: "DELETE",
|
|
821
|
+
headers: {
|
|
822
|
+
authorization: `Bearer ${this.token}`,
|
|
823
|
+
},
|
|
824
|
+
});
|
|
825
|
+
|
|
826
|
+
if (res.status >= 400 && res.status < 600) {
|
|
827
|
+
const error = await res.json();
|
|
828
|
+
throw error;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
return await res.json();
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Returns the workflow execution logs for the linked account.
|
|
836
|
+
* @param {Object} [params]
|
|
837
|
+
* @param {Number} [params.page]
|
|
838
|
+
* @param {Number} [params.limit]
|
|
839
|
+
* @returns {Promise<PaginatedResponse<Execution>>} The paginated workflow execution logs.
|
|
840
|
+
*/
|
|
841
|
+
async getExecutions({ page = 1, limit = 10 }: PaginationProps = {}): Promise<PaginatedResponse<Execution>> {
|
|
842
|
+
const res = await fetch(`${this.baseUrl}/api/v2/public/execution?page=${page}&limit=${limit}`, {
|
|
843
|
+
headers: {
|
|
844
|
+
authorization: `Bearer ${this.token}`,
|
|
845
|
+
},
|
|
846
|
+
});
|
|
847
|
+
|
|
848
|
+
if (res.status >= 400 && res.status < 600) {
|
|
849
|
+
const error = await res.json();
|
|
850
|
+
throw error;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
return await res.json();
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Returns the specified workflow execution log.
|
|
858
|
+
* @param {String} executionId The execution ID.
|
|
859
|
+
* @returns {Promise<Execution>} The specified execution log.
|
|
860
|
+
*/
|
|
861
|
+
async getExecution(executionId: string): Promise<Execution> {
|
|
862
|
+
const res = await fetch(`${this.baseUrl}/api/v2/public/execution/${executionId}`, {
|
|
863
|
+
headers: {
|
|
864
|
+
authorization: `Bearer ${this.token}`,
|
|
865
|
+
},
|
|
866
|
+
});
|
|
867
|
+
|
|
868
|
+
if (res.status >= 400 && res.status < 600) {
|
|
869
|
+
const error = await res.json();
|
|
870
|
+
throw error;
|
|
871
|
+
}
|
|
872
|
+
|
|
696
873
|
return await res.json();
|
|
697
874
|
}
|
|
698
875
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.navigationData = "
|
|
1
|
+
window.navigationData = "eJyVk9FKwzAUht/lXBeHA0V6J6IgDByCeCFepMmpC8uS0JzihvjuslW3FpOT7Lb/939pTpK3LyDcEtRw5xphCCrwglZQgzQiBAyz4fvFijYGKlhrq6C+nN98V8fmrfdGS0Ha2VNdW8KuFRLDbJRPNfOr65FmWOjJ77kQFU0IXmVb/ZFw7KN8+UGjUYzhkOc1S7EzTnCiXyKvenXdujXuk3H9IZzsXrqwC4SbBSb+a0L8U1XDzYAaFPoOpSBUkPJz24+B56+2Rdknb94x5QbyaH1P6eM+xZxkIRo00f4h4arLvjFasqc7Rcpl3PijZLk6lLtDgfy5N8g9/VHOaV68EoT5pxfhOG3JPLOTfP8BOa3d9A=="
|
package/docs/assets/search.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
window.searchData = "
|
|
1
|
+
window.searchData = "eJytnduO4zYSht9Ffet0zKOovguCLBAgwAYL7O6FMWh4bKXHiNr22vJMgsG8+4I62FVkkSrLczWDFlk/Dx+LpaIkfy1Ohy/n4mX1tfhzt98WL0K6RbFfv9fFS/Hz4eO6aYtFcTk1xUuxadbnc33+sf/z86f2vSkW41+Ll6L4thitGCGvVjaH/bk9XTbt4ZQz9YTLAbOL4rg+1fv21qKbkFhKfVVqD3/W+6zGWIJpXS61g/34Y/c21YW+yEz7+3qTHe6nW5lZCqd63da/bA7nv89t/f5bvd7m1bry9Vi+6cvPV/7v4fTnH83hC0P0y63oHL1t3dRt/fP0jPUFH5o3qP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