@cobaltio/cobalt-js 8.8.0 → 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/cobalt.d.ts +91 -7
- package/cobalt.js +47 -4
- package/cobalt.ts +124 -9
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Cobalt.html +29 -21
- package/docs/interfaces/Application.html +18 -13
- package/docs/interfaces/CobaltOptions.html +3 -3
- package/docs/interfaces/Config.html +2 -2
- package/docs/interfaces/ConfigField.html +8 -2
- package/docs/interfaces/ConfigPayload.html +4 -4
- package/docs/interfaces/ConfigWorkflow.html +2 -2
- 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 +221 -126
- package/docs/modules.html +1 -1
- package/package.json +1 -1
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,6 +156,13 @@ interface PaginationProps {
|
|
|
134
156
|
page?: number;
|
|
135
157
|
limit?: number;
|
|
136
158
|
}
|
|
159
|
+
interface PaginatedResponse<T> {
|
|
160
|
+
docs: T[];
|
|
161
|
+
totalDocs: number;
|
|
162
|
+
limit: number;
|
|
163
|
+
totalPages: number;
|
|
164
|
+
page: number;
|
|
165
|
+
}
|
|
137
166
|
export interface Config {
|
|
138
167
|
slug: string;
|
|
139
168
|
config_id?: string;
|
|
@@ -165,6 +194,12 @@ export interface ConfigField {
|
|
|
165
194
|
required?: boolean;
|
|
166
195
|
hidden?: boolean;
|
|
167
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;
|
|
168
203
|
}
|
|
169
204
|
export interface ConfigWorkflow {
|
|
170
205
|
id: string;
|
|
@@ -173,6 +208,40 @@ export interface ConfigWorkflow {
|
|
|
173
208
|
enabled: boolean;
|
|
174
209
|
fields?: ConfigField[];
|
|
175
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
|
+
}
|
|
176
245
|
declare class Cobalt {
|
|
177
246
|
private baseUrl;
|
|
178
247
|
token: string;
|
|
@@ -208,7 +277,7 @@ declare class Cobalt {
|
|
|
208
277
|
*/
|
|
209
278
|
getApp(slug: string): Promise<Application>;
|
|
210
279
|
/**
|
|
211
|
-
* Returns all the enabled
|
|
280
|
+
* Returns all the enabled apps.
|
|
212
281
|
* @returns {Promise<Application[]>} The list of applications.
|
|
213
282
|
*/
|
|
214
283
|
getApps(): Promise<Application[]>;
|
|
@@ -277,6 +346,7 @@ declare class Cobalt {
|
|
|
277
346
|
*/
|
|
278
347
|
deleteConfig(slug: string, configId?: string): Promise<unknown>;
|
|
279
348
|
/**
|
|
349
|
+
* @deprecated
|
|
280
350
|
* Create a lead for an ecosystem app.
|
|
281
351
|
* @param {EcosystemLeadPayload} payload The payload object for the lead.
|
|
282
352
|
* @returns {Promise<EcosystemLead>}
|
|
@@ -317,14 +387,14 @@ declare class Cobalt {
|
|
|
317
387
|
*/
|
|
318
388
|
getFieldOptions(lhs: string, slug: string, fieldId: string, workflowId?: string): Promise<RuleOptions>;
|
|
319
389
|
/**
|
|
320
|
-
*
|
|
390
|
+
* Returns the private workflows for the specified application.
|
|
321
391
|
* @param {Object} params
|
|
322
392
|
* @param {String} [params.slug]
|
|
323
393
|
* @param {Number} [params.page]
|
|
324
394
|
* @param {Number} [params.limit]
|
|
325
395
|
* @returns
|
|
326
396
|
*/
|
|
327
|
-
getWorkflows(params?: PublicWorkflowsPayload): Promise<PublicWorkflow
|
|
397
|
+
getWorkflows(params?: PublicWorkflowsPayload): Promise<PaginatedResponse<PublicWorkflow>>;
|
|
328
398
|
/**
|
|
329
399
|
* Create a public workflow for the linked account.
|
|
330
400
|
* @param {Object} params
|
|
@@ -341,5 +411,19 @@ declare class Cobalt {
|
|
|
341
411
|
* @returns {Promise<unknown>}
|
|
342
412
|
*/
|
|
343
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>;
|
|
344
428
|
}
|
|
345
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,7 +517,8 @@ class Cobalt {
|
|
|
515
517
|
const error = yield res.json();
|
|
516
518
|
throw error;
|
|
517
519
|
}
|
|
518
|
-
|
|
520
|
+
const data = yield res.json();
|
|
521
|
+
return (_a = data === null || data === void 0 ? void 0 : data.workflow) !== null && _a !== void 0 ? _a : data;
|
|
519
522
|
});
|
|
520
523
|
}
|
|
521
524
|
/**
|
|
@@ -538,5 +541,45 @@ class Cobalt {
|
|
|
538
541
|
return yield res.json();
|
|
539
542
|
});
|
|
540
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
|
+
}
|
|
581
|
+
return yield res.json();
|
|
582
|
+
});
|
|
583
|
+
}
|
|
541
584
|
}
|
|
542
585
|
exports.Cobalt = Cobalt;
|
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,6 +171,14 @@ interface PaginationProps {
|
|
|
149
171
|
limit?: number;
|
|
150
172
|
}
|
|
151
173
|
|
|
174
|
+
interface PaginatedResponse<T> {
|
|
175
|
+
docs: T[];
|
|
176
|
+
totalDocs: number;
|
|
177
|
+
limit: number;
|
|
178
|
+
totalPages: number;
|
|
179
|
+
page: number;
|
|
180
|
+
}
|
|
181
|
+
|
|
152
182
|
export interface Config {
|
|
153
183
|
slug: string;
|
|
154
184
|
config_id?: string;
|
|
@@ -181,6 +211,12 @@ export interface ConfigField {
|
|
|
181
211
|
required?: boolean;
|
|
182
212
|
hidden?: boolean;
|
|
183
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;
|
|
184
220
|
}
|
|
185
221
|
|
|
186
222
|
export interface ConfigWorkflow {
|
|
@@ -191,6 +227,41 @@ export interface ConfigWorkflow {
|
|
|
191
227
|
fields?: ConfigField[];
|
|
192
228
|
}
|
|
193
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
|
+
|
|
194
265
|
type Field = any;
|
|
195
266
|
|
|
196
267
|
class Cobalt {
|
|
@@ -295,11 +366,11 @@ class Cobalt {
|
|
|
295
366
|
}
|
|
296
367
|
|
|
297
368
|
/**
|
|
298
|
-
* Returns all the enabled
|
|
369
|
+
* Returns all the enabled apps.
|
|
299
370
|
* @returns {Promise<Application[]>} The list of applications.
|
|
300
371
|
*/
|
|
301
372
|
public async getApps(): Promise<Application[]> {
|
|
302
|
-
const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/application
|
|
373
|
+
const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/application`, {
|
|
303
374
|
headers: {
|
|
304
375
|
authorization: `Bearer ${this.token}`,
|
|
305
376
|
},
|
|
@@ -558,6 +629,7 @@ class Cobalt {
|
|
|
558
629
|
}
|
|
559
630
|
|
|
560
631
|
/**
|
|
632
|
+
* @deprecated
|
|
561
633
|
* Create a lead for an ecosystem app.
|
|
562
634
|
* @param {EcosystemLeadPayload} payload The payload object for the lead.
|
|
563
635
|
* @returns {Promise<EcosystemLead>}
|
|
@@ -684,14 +756,14 @@ class Cobalt {
|
|
|
684
756
|
}
|
|
685
757
|
|
|
686
758
|
/**
|
|
687
|
-
*
|
|
759
|
+
* Returns the private workflows for the specified application.
|
|
688
760
|
* @param {Object} params
|
|
689
761
|
* @param {String} [params.slug]
|
|
690
762
|
* @param {Number} [params.page]
|
|
691
763
|
* @param {Number} [params.limit]
|
|
692
764
|
* @returns
|
|
693
765
|
*/
|
|
694
|
-
async getWorkflows(params?: PublicWorkflowsPayload): Promise<PublicWorkflow
|
|
766
|
+
async getWorkflows(params?: PublicWorkflowsPayload): Promise<PaginatedResponse<PublicWorkflow>> {
|
|
695
767
|
const res = await fetch(`${this.baseUrl}/api/v2/public/workflow?page=${params?.page || 1}&limit=${params?.limit || 100}${params?.slug ? `&slug=${params.slug}` : ""}`, {
|
|
696
768
|
headers: {
|
|
697
769
|
authorization: `Bearer ${this.token}`,
|
|
@@ -734,7 +806,8 @@ class Cobalt {
|
|
|
734
806
|
throw error;
|
|
735
807
|
}
|
|
736
808
|
|
|
737
|
-
|
|
809
|
+
const data = await res.json();
|
|
810
|
+
return data?.workflow ?? data;
|
|
738
811
|
}
|
|
739
812
|
|
|
740
813
|
/**
|
|
@@ -757,6 +830,48 @@ class Cobalt {
|
|
|
757
830
|
|
|
758
831
|
return await res.json();
|
|
759
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
|
+
|
|
873
|
+
return await res.json();
|
|
874
|
+
}
|
|
760
875
|
}
|
|
761
876
|
|
|
762
877
|
export { Cobalt };
|
|
@@ -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+1fv21qKbkFhKfVVq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