@refoldai/refold-js 10.0.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/.claude/skills/method/SKILL.md +282 -0
- package/.claude/skills/review-pr/SKILL.md +80 -0
- package/.claude/skills/style/SKILL.md +67 -0
- package/.claude/skills/verify/SKILL.md +85 -0
- package/.github/pull_request_template.md +48 -0
- package/.github/workflows/npm-publish.yml +35 -0
- package/.github/workflows/pr-validation.yml +224 -0
- package/CLAUDE.md +127 -0
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +113 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/Refold.html +123 -0
- package/docs/enums/AuthStatus.html +3 -0
- package/docs/enums/AuthType.html +4 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +36 -0
- package/docs/interfaces/Application.html +37 -0
- package/docs/interfaces/Config.html +6 -0
- package/docs/interfaces/ConfigField.html +17 -0
- package/docs/interfaces/ConfigPayload.html +8 -0
- package/docs/interfaces/ConfigWorkflow.html +6 -0
- package/docs/interfaces/ExecuteWorkflowPayload.html +9 -0
- package/docs/interfaces/Execution.html +19 -0
- package/docs/interfaces/ExecutionFilters.html +16 -0
- package/docs/interfaces/GetExecutionsParams.html +19 -0
- package/docs/interfaces/InputField.html +18 -0
- package/docs/interfaces/Label.html +6 -0
- package/docs/interfaces/PublicWorkflow.html +16 -0
- package/docs/interfaces/PublicWorkflowPayload.html +8 -0
- package/docs/interfaces/PublicWorkflowsPayload.html +15 -0
- package/docs/interfaces/RefoldOptions.html +5 -0
- package/docs/interfaces/RuleOptions.html +4 -0
- package/docs/interfaces/UpdateConfigPayload.html +10 -0
- package/docs/interfaces/WorkflowPayload.html +8 -0
- package/docs/interfaces/WorkflowPayloadResponse.html +4 -0
- package/docs/llms.txt +986 -0
- package/docs/modules.html +1 -0
- package/docs/types/ExecutionSource.html +2 -0
- package/docs/types/ExecutionStatus.html +2 -0
- package/docs/types/ExecutionType.html +2 -0
- package/package.json +38 -0
- package/refold.d.ts +556 -0
- package/refold.js +667 -0
- package/refold.ts +1044 -0
- package/tsconfig.json +12 -0
package/refold.d.ts
ADDED
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refold Frontend SDK
|
|
3
|
+
*/
|
|
4
|
+
export declare enum AuthType {
|
|
5
|
+
OAuth2 = "oauth2",
|
|
6
|
+
KeyBased = "keybased"
|
|
7
|
+
}
|
|
8
|
+
export declare enum AuthStatus {
|
|
9
|
+
Active = "active",
|
|
10
|
+
Expired = "expired"
|
|
11
|
+
}
|
|
12
|
+
/** An application in Refold. */
|
|
13
|
+
export interface Application {
|
|
14
|
+
/** Application ID */
|
|
15
|
+
app_id: string;
|
|
16
|
+
/**The application name. */
|
|
17
|
+
name: string;
|
|
18
|
+
/**The application description. */
|
|
19
|
+
description: string;
|
|
20
|
+
/**The application icon. */
|
|
21
|
+
icon: string;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `slug` instead.
|
|
24
|
+
* The application slug for native apps and `custom` for custom apps.
|
|
25
|
+
*/
|
|
26
|
+
type: string | "custom";
|
|
27
|
+
/** The application slug. */
|
|
28
|
+
slug: string;
|
|
29
|
+
/** The categories/tags for the application. */
|
|
30
|
+
tags?: string[];
|
|
31
|
+
/** The supported auth types for the application, and the fields required from the user to connect the application. */
|
|
32
|
+
auth_type_options?: {
|
|
33
|
+
[key in AuthType]: InputField[];
|
|
34
|
+
};
|
|
35
|
+
/** The list of connected accounts for this application */
|
|
36
|
+
connected_accounts?: {
|
|
37
|
+
/** The identifier (username, email, etc.) of the connected account. */
|
|
38
|
+
identifier: unknown;
|
|
39
|
+
/** The auth type used to connect the account. */
|
|
40
|
+
auth_type: AuthType;
|
|
41
|
+
/** The timestamp at which the account was connected. */
|
|
42
|
+
connectedAt: string;
|
|
43
|
+
/** The current status of the connection. */
|
|
44
|
+
status?: AuthStatus;
|
|
45
|
+
}[];
|
|
46
|
+
/**
|
|
47
|
+
* The type of auth used by application.
|
|
48
|
+
* @deprecated Check `auth_type_options` and `connected_accounts` for multiple auth types support.
|
|
49
|
+
*/
|
|
50
|
+
auth_type: "oauth2" | "keybased";
|
|
51
|
+
/**
|
|
52
|
+
* Whether the user has connected the application.
|
|
53
|
+
* @deprecated Check `connected_accounts` for multiple auth types support.
|
|
54
|
+
*/
|
|
55
|
+
connected?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the connection has expired and re-auth is required.
|
|
58
|
+
* @deprecated Check `connected_accounts` for multiple auth types support.
|
|
59
|
+
*/
|
|
60
|
+
reauth_required?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The fields required from the user to connect the application (for `keybased` auth type).
|
|
63
|
+
* @deprecated Check `auth_type_options` for multiple auth types support.
|
|
64
|
+
*/
|
|
65
|
+
auth_input_map?: InputField[];
|
|
66
|
+
}
|
|
67
|
+
/** An Input field to take input from the user. */
|
|
68
|
+
export interface InputField {
|
|
69
|
+
/** Key name of the field. */
|
|
70
|
+
name: string;
|
|
71
|
+
/** Input type of the field. */
|
|
72
|
+
type: string;
|
|
73
|
+
/** Whether the field is required. */
|
|
74
|
+
required: boolean;
|
|
75
|
+
/** Whether the field accepts multiple values. */
|
|
76
|
+
multiple?: boolean;
|
|
77
|
+
/** The placeholder of the field. */
|
|
78
|
+
placeholder: string;
|
|
79
|
+
/** The label of the field. */
|
|
80
|
+
label: string;
|
|
81
|
+
/** The help text for the field. */
|
|
82
|
+
help_text?: string;
|
|
83
|
+
/** The options for the field. */
|
|
84
|
+
options?: {
|
|
85
|
+
name?: string;
|
|
86
|
+
value: string;
|
|
87
|
+
}[];
|
|
88
|
+
}
|
|
89
|
+
/** The payload object for config. */
|
|
90
|
+
export interface ConfigPayload {
|
|
91
|
+
/** The application slug. */
|
|
92
|
+
slug: string;
|
|
93
|
+
/** Unique ID for the config. */
|
|
94
|
+
config_id?: string;
|
|
95
|
+
/** The dynamic label mappings. */
|
|
96
|
+
labels?: Label[];
|
|
97
|
+
}
|
|
98
|
+
/** Label Mapping */
|
|
99
|
+
export interface Label {
|
|
100
|
+
/** The label name. */
|
|
101
|
+
name: string;
|
|
102
|
+
/** The label value. */
|
|
103
|
+
value: string | number | boolean;
|
|
104
|
+
}
|
|
105
|
+
/** The configuration data for an application. */
|
|
106
|
+
export interface UpdateConfigPayload {
|
|
107
|
+
/** The application slug */
|
|
108
|
+
slug: string;
|
|
109
|
+
/** Unique ID for the config. */
|
|
110
|
+
config_id?: string;
|
|
111
|
+
/** A map of application fields and their values. */
|
|
112
|
+
fields: Record<string, string | number | boolean>;
|
|
113
|
+
/** The config workflows data. */
|
|
114
|
+
workflows: WorkflowPayload[];
|
|
115
|
+
}
|
|
116
|
+
/** The workflow. */
|
|
117
|
+
export interface WorkflowPayload {
|
|
118
|
+
/** The ID of the workflow. */
|
|
119
|
+
id: string;
|
|
120
|
+
/** Whether the workflow is enabled. */
|
|
121
|
+
enabled: boolean;
|
|
122
|
+
/** A map of workflow field names and their values. */
|
|
123
|
+
fields: Record<string, string | number | boolean>;
|
|
124
|
+
}
|
|
125
|
+
export interface RefoldOptions {
|
|
126
|
+
/** The base URL of the Refold API. You don't need to set this. */
|
|
127
|
+
baseUrl?: string;
|
|
128
|
+
/** The session token. */
|
|
129
|
+
token?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface RuleOptions {
|
|
132
|
+
rule_column: {
|
|
133
|
+
rhs: {
|
|
134
|
+
name: string;
|
|
135
|
+
type: "text" | "select";
|
|
136
|
+
options?: Label[];
|
|
137
|
+
};
|
|
138
|
+
operator: {
|
|
139
|
+
name: string;
|
|
140
|
+
type: "select";
|
|
141
|
+
options: Label[];
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
conditional_code_stdout?: string[];
|
|
145
|
+
error?: {
|
|
146
|
+
message?: string;
|
|
147
|
+
stack?: string;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/** A public workflow in Refold. */
|
|
151
|
+
export interface PublicWorkflow {
|
|
152
|
+
/**The workflow ID. */
|
|
153
|
+
_id: string;
|
|
154
|
+
/**The workflow name. */
|
|
155
|
+
name: string;
|
|
156
|
+
/**The workflow description. */
|
|
157
|
+
description?: string;
|
|
158
|
+
/**The application's slug in which this workflow exists. */
|
|
159
|
+
slug?: string;
|
|
160
|
+
/**The workflow created at. */
|
|
161
|
+
createdAt: string;
|
|
162
|
+
/**The workflow updated at. */
|
|
163
|
+
updatedAt: string;
|
|
164
|
+
/**Whether the workflow is published. */
|
|
165
|
+
published: boolean;
|
|
166
|
+
}
|
|
167
|
+
/** The payload for creating a public workflow for the linked account. */
|
|
168
|
+
export interface PublicWorkflowPayload {
|
|
169
|
+
/**The workflow name. */
|
|
170
|
+
name: string;
|
|
171
|
+
/**The workflow description. */
|
|
172
|
+
description?: string;
|
|
173
|
+
/** The application slug in which this workflow should be created. */
|
|
174
|
+
slug?: string;
|
|
175
|
+
}
|
|
176
|
+
/** Parameters for filtering and paginating the list of workflows. */
|
|
177
|
+
export interface PublicWorkflowsPayload extends PaginationProps {
|
|
178
|
+
/** Filter workflows by the application slug. */
|
|
179
|
+
slug?: string;
|
|
180
|
+
/** Filter workflows by name (partial match). */
|
|
181
|
+
name?: string;
|
|
182
|
+
/** Filter workflows created on or after this ISO 8601 date string. */
|
|
183
|
+
start_date?: string;
|
|
184
|
+
/** Filter workflows created on or before this ISO 8601 date string. */
|
|
185
|
+
end_date?: string;
|
|
186
|
+
/** Filter by workflow published status. `true` returns only published workflows, `false` returns only drafts. */
|
|
187
|
+
published?: boolean;
|
|
188
|
+
/** Any additional filter keys supported by the API. */
|
|
189
|
+
[key: string]: string | number | boolean | undefined;
|
|
190
|
+
}
|
|
191
|
+
interface PaginationProps {
|
|
192
|
+
page?: number;
|
|
193
|
+
limit?: number;
|
|
194
|
+
}
|
|
195
|
+
/** The current status of a workflow execution. */
|
|
196
|
+
export type ExecutionStatus = "COMPLETED" | "RUNNING" | "ERRORED" | "STOPPED" | "STOPPING" | "TIMED_OUT";
|
|
197
|
+
/** The trigger source that initiated a workflow execution. */
|
|
198
|
+
export type ExecutionSource = "Event" | "Schedule" | "API Call";
|
|
199
|
+
/** Whether a workflow execution runs synchronously (waits for result) or asynchronously (fire-and-forget). */
|
|
200
|
+
export type ExecutionType = "SYNC" | "ASYNC";
|
|
201
|
+
/** Filters for narrowing down the list of workflow executions. */
|
|
202
|
+
export interface ExecutionFilters {
|
|
203
|
+
/** Filter executions by their current status. */
|
|
204
|
+
status?: ExecutionStatus;
|
|
205
|
+
/** Filter executions by workflow name (partial match). */
|
|
206
|
+
workflow_name?: string;
|
|
207
|
+
/** Filter executions by workflow ID. */
|
|
208
|
+
workflow_id?: string;
|
|
209
|
+
/** Filter executions that started on or after this ISO 8601 date string. */
|
|
210
|
+
start_date?: string;
|
|
211
|
+
/** Filter executions that started on or before this ISO 8601 date string. */
|
|
212
|
+
end_date?: string;
|
|
213
|
+
/** Filter by how the execution was invoked — synchronously or asynchronously. */
|
|
214
|
+
execution_type?: ExecutionType;
|
|
215
|
+
/** Filter by the trigger source that initiated the execution. */
|
|
216
|
+
execution_source?: ExecutionSource;
|
|
217
|
+
}
|
|
218
|
+
/** Parameters for filtering and paginating the list of workflow executions. */
|
|
219
|
+
export interface GetExecutionsParams extends PaginationProps, ExecutionFilters {
|
|
220
|
+
/** Any additional filter keys supported by the API. */
|
|
221
|
+
[key: string]: string | number | undefined;
|
|
222
|
+
}
|
|
223
|
+
interface PaginatedResponse<T> {
|
|
224
|
+
docs: T[];
|
|
225
|
+
totalDocs: number;
|
|
226
|
+
limit: number;
|
|
227
|
+
totalPages: number;
|
|
228
|
+
page: number;
|
|
229
|
+
}
|
|
230
|
+
export interface Config {
|
|
231
|
+
slug: string;
|
|
232
|
+
config_id?: string;
|
|
233
|
+
fields?: ConfigField[];
|
|
234
|
+
workflows?: ConfigWorkflow[];
|
|
235
|
+
field_errors?: {
|
|
236
|
+
id: string;
|
|
237
|
+
name: string;
|
|
238
|
+
error: {
|
|
239
|
+
message: string;
|
|
240
|
+
error?: unknown;
|
|
241
|
+
};
|
|
242
|
+
}[];
|
|
243
|
+
}
|
|
244
|
+
export interface ConfigField {
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
field_type: "text" | "date" | "number" | "url" | "email" | "textarea" | "select" | "json" | "map" | "map_v2" | "rule_engine" | string;
|
|
248
|
+
options?: {
|
|
249
|
+
name?: string;
|
|
250
|
+
value: string;
|
|
251
|
+
}[];
|
|
252
|
+
parent?: string;
|
|
253
|
+
labels?: {
|
|
254
|
+
name?: string;
|
|
255
|
+
value: string;
|
|
256
|
+
}[];
|
|
257
|
+
multiple?: boolean;
|
|
258
|
+
required?: boolean;
|
|
259
|
+
hidden?: boolean;
|
|
260
|
+
value?: any;
|
|
261
|
+
/** The placeholder for the field. */
|
|
262
|
+
placeholder?: string;
|
|
263
|
+
/** The help text for the field. */
|
|
264
|
+
help_text?: string;
|
|
265
|
+
/** The page this field is associated with. */
|
|
266
|
+
associated_page?: string;
|
|
267
|
+
}
|
|
268
|
+
export interface ConfigWorkflow {
|
|
269
|
+
id: string;
|
|
270
|
+
name: string;
|
|
271
|
+
description?: string;
|
|
272
|
+
enabled: boolean;
|
|
273
|
+
fields?: ConfigField[];
|
|
274
|
+
}
|
|
275
|
+
export interface WorkflowPayloadResponse {
|
|
276
|
+
payload: Record<string, any>;
|
|
277
|
+
schema?: unknown;
|
|
278
|
+
schema_interpreted?: unknown;
|
|
279
|
+
}
|
|
280
|
+
export interface ExecuteWorkflowPayload {
|
|
281
|
+
/**The workflow id or alias. */
|
|
282
|
+
worklfow: string;
|
|
283
|
+
/** The application's slug this workflow belongs to. */
|
|
284
|
+
slug?: string;
|
|
285
|
+
/** The payload to execute the workflow. */
|
|
286
|
+
payload?: Record<string, any>;
|
|
287
|
+
/** Whether to execute the workflow synchronously. */
|
|
288
|
+
sync_execution?: boolean;
|
|
289
|
+
}
|
|
290
|
+
export interface Execution {
|
|
291
|
+
_id: string;
|
|
292
|
+
id?: string;
|
|
293
|
+
name: string;
|
|
294
|
+
org_id: string;
|
|
295
|
+
associated_application: {
|
|
296
|
+
_id: string;
|
|
297
|
+
name: string;
|
|
298
|
+
icon?: string;
|
|
299
|
+
};
|
|
300
|
+
status: ExecutionStatus;
|
|
301
|
+
associated_workflow: {
|
|
302
|
+
_id: string;
|
|
303
|
+
name: string;
|
|
304
|
+
};
|
|
305
|
+
associated_trigger_application: {
|
|
306
|
+
_id: string;
|
|
307
|
+
name: string;
|
|
308
|
+
icon?: string;
|
|
309
|
+
app_type?: "custom" | string;
|
|
310
|
+
origin_trigger: {
|
|
311
|
+
_id: string;
|
|
312
|
+
name: string;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
trigger_application_event?: string;
|
|
316
|
+
linked_account_id: string;
|
|
317
|
+
environment: "test" | "production";
|
|
318
|
+
config_id: string;
|
|
319
|
+
associated_event_id: string;
|
|
320
|
+
custom_trigger_id?: string;
|
|
321
|
+
custom_application_id?: string;
|
|
322
|
+
completion_percentage?: number;
|
|
323
|
+
nodes?: {
|
|
324
|
+
node_id: string;
|
|
325
|
+
node_name: string;
|
|
326
|
+
node_type: string;
|
|
327
|
+
node_status: "Success" | "Ready" | "Errored" | "Waiting" | "Stopped" | "Rejected" | "Errored_and_Skipped" | "Timed_Out";
|
|
328
|
+
is_batch?: boolean;
|
|
329
|
+
attempts_made: number;
|
|
330
|
+
maximum_attempts: number;
|
|
331
|
+
input_data: unknown;
|
|
332
|
+
latest_output: unknown;
|
|
333
|
+
}[];
|
|
334
|
+
createdAt: string;
|
|
335
|
+
}
|
|
336
|
+
declare class Refold {
|
|
337
|
+
private baseUrl;
|
|
338
|
+
token: string;
|
|
339
|
+
/**
|
|
340
|
+
* Refold Frontend SDK
|
|
341
|
+
* @param {Object} options The options to configure the Refold SDK.
|
|
342
|
+
* @param {String} [options.token] The session token.
|
|
343
|
+
* @param {String} [options.baseUrl=https://app.refold.ai] The base URL of the Refold API.
|
|
344
|
+
*/
|
|
345
|
+
constructor(options?: RefoldOptions);
|
|
346
|
+
/**
|
|
347
|
+
* Returns the org & customer details for the associated token.
|
|
348
|
+
* @private
|
|
349
|
+
* @returns {Promise<unknown>}
|
|
350
|
+
*/
|
|
351
|
+
getAccountDetails(): Promise<unknown>;
|
|
352
|
+
/**
|
|
353
|
+
* Returns the org & customer details for the associated token.
|
|
354
|
+
* @private
|
|
355
|
+
* @returns {Promise<unknown>}
|
|
356
|
+
*/
|
|
357
|
+
updateAccount(payload: Record<string, unknown>): Promise<unknown>;
|
|
358
|
+
/**
|
|
359
|
+
* Returns the list of enabled applications and their details.
|
|
360
|
+
* @returns {Promise<Application[]>} The list of applications.
|
|
361
|
+
*/
|
|
362
|
+
getApp(): Promise<Application[]>;
|
|
363
|
+
/**
|
|
364
|
+
* Returns the application details for the specified application, provided
|
|
365
|
+
* the application is enabled in Refold.
|
|
366
|
+
* @param {String} slug The application slug.
|
|
367
|
+
* @returns {Promise<Application>} The application details.
|
|
368
|
+
*/
|
|
369
|
+
getApp(slug: string): Promise<Application>;
|
|
370
|
+
/**
|
|
371
|
+
* Returns all the enabled apps.
|
|
372
|
+
* @returns {Promise<Application[]>} The list of applications.
|
|
373
|
+
*/
|
|
374
|
+
getApps(): Promise<Application[]>;
|
|
375
|
+
/**
|
|
376
|
+
* Returns the auth URL that users can use to authenticate themselves to the
|
|
377
|
+
* specified application.
|
|
378
|
+
* @private
|
|
379
|
+
* @param {String} slug The application slug.
|
|
380
|
+
* @param {Object.<string, string>} [params] The key value pairs of auth data.
|
|
381
|
+
* @returns {Promise<String>} The auth URL where users can authenticate themselves.
|
|
382
|
+
*/
|
|
383
|
+
private getOAuthUrl;
|
|
384
|
+
/**
|
|
385
|
+
* Handle OAuth for the specified application.
|
|
386
|
+
* @private
|
|
387
|
+
* @param {String} slug The application slug.
|
|
388
|
+
* @param {Object.<string, string>} [params] The key value pairs of auth data.
|
|
389
|
+
* @returns {Promise<Boolean>} Whether the user authenticated.
|
|
390
|
+
*/
|
|
391
|
+
private oauth;
|
|
392
|
+
/**
|
|
393
|
+
* Save auth data for the specified keybased application.
|
|
394
|
+
* @param {String} slug The application slug.
|
|
395
|
+
* @param {Object.<string, string>} [payload] The key value pairs of auth data.
|
|
396
|
+
* @returns {Promise<Boolean>} Whether the auth data was saved successfully.
|
|
397
|
+
*/
|
|
398
|
+
private keybased;
|
|
399
|
+
/**
|
|
400
|
+
* Connects the specified application using the provided authentication type and optional auth data.
|
|
401
|
+
* @param params - The parameters for connecting the application.
|
|
402
|
+
* @param params.slug - The application slug.
|
|
403
|
+
* @param params.type - The authentication type to use. If not provided, it defaults to `keybased` if payload is provided, otherwise `oauth2`.
|
|
404
|
+
* @param params.payload - key-value pairs of authentication data required for the specified auth type.
|
|
405
|
+
* @returns A promise that resolves to true if the connection was successful, otherwise false.
|
|
406
|
+
* @throws Throws an error if the authentication type is invalid or the connection fails.
|
|
407
|
+
*/
|
|
408
|
+
connect({ slug, type, payload, }: {
|
|
409
|
+
slug: string;
|
|
410
|
+
type?: AuthType;
|
|
411
|
+
payload?: Record<string, string>;
|
|
412
|
+
}): Promise<boolean>;
|
|
413
|
+
/**
|
|
414
|
+
* Disconnect the specified application and remove any associated data from Refold.
|
|
415
|
+
* @param {String} slug The application slug.
|
|
416
|
+
* @param {AuthType} [type] The authentication type to use. If not provided, it'll remove all the connected accounts.
|
|
417
|
+
* @returns {Promise<unknown>}
|
|
418
|
+
*/
|
|
419
|
+
disconnect(slug: string, type?: AuthType): Promise<unknown>;
|
|
420
|
+
/**
|
|
421
|
+
* Returns the specified config, or creates one if it doesn't exist.
|
|
422
|
+
* @param {ConfigPayload} payload The payload object for config.
|
|
423
|
+
* @returns {Promise<Config>} The specified config.
|
|
424
|
+
*/
|
|
425
|
+
config(payload: ConfigPayload): Promise<Config>;
|
|
426
|
+
/**
|
|
427
|
+
* Returns the configs created for the specified application.
|
|
428
|
+
* @param {String} slug The application slug.
|
|
429
|
+
* @returns {Promise<{ config_id: string; }[]>} The configs created for the specified application.
|
|
430
|
+
*/
|
|
431
|
+
getConfigs(slug: string): Promise<{
|
|
432
|
+
config_id: string;
|
|
433
|
+
}[]>;
|
|
434
|
+
/**
|
|
435
|
+
* Returns the specified config.
|
|
436
|
+
* @param {String} slug The application slug.
|
|
437
|
+
* @param {String} [configId] The unique ID of the config.
|
|
438
|
+
* @param {Boolean} [excludeOptions] Whether to exclude the options from the fields in the response.
|
|
439
|
+
* @returns {Promise<Config>} The specified config.
|
|
440
|
+
*/
|
|
441
|
+
getConfig(slug: string, configId: string, excludeOptions?: boolean): Promise<Config>;
|
|
442
|
+
/**
|
|
443
|
+
* Update the specified config.
|
|
444
|
+
* @param {UpdateConfigPayload} payload The update payload.
|
|
445
|
+
* @returns {Promise<Config>} The specified config.
|
|
446
|
+
*/
|
|
447
|
+
updateConfig(payload: UpdateConfigPayload): Promise<Config>;
|
|
448
|
+
/**
|
|
449
|
+
* Delete the specified config.
|
|
450
|
+
* @param {String} slug The application slug.
|
|
451
|
+
* @param {String} [configId] The unique ID of the config.
|
|
452
|
+
* @returns {Promise<unknown>}
|
|
453
|
+
*/
|
|
454
|
+
deleteConfig(slug: string, configId?: string): Promise<unknown>;
|
|
455
|
+
/**
|
|
456
|
+
* Returns the specified field of the config.
|
|
457
|
+
* @param {String} slug The application slug.
|
|
458
|
+
* @param {String} fieldId The unique ID of the field.
|
|
459
|
+
* @param {String} [workflowId] The unique ID of the workflow.
|
|
460
|
+
* @param {Record<string, unknown>} [payload] The payload to be sent in the request body.
|
|
461
|
+
* @returns {Promise<Field>} The specified config field.
|
|
462
|
+
*/
|
|
463
|
+
getConfigField(slug: string, fieldId: string, workflowId?: string, payload?: Record<string, unknown>): Promise<Config>;
|
|
464
|
+
/**
|
|
465
|
+
* Update the specified config field value.
|
|
466
|
+
* @param {String} slug The application slug.
|
|
467
|
+
* @param {String} fieldId The unique ID of the field.
|
|
468
|
+
* @param {String | Number | Boolean | null} value The new value for the field.
|
|
469
|
+
* @param {String} [workflowId] The unique ID of the workflow.
|
|
470
|
+
* @returns {Promise<Field>} The updated config field.
|
|
471
|
+
*/
|
|
472
|
+
updateConfigField(slug: string, fieldId: string, value: string | number | boolean | null, workflowId?: string): Promise<Config>;
|
|
473
|
+
/**
|
|
474
|
+
* Delete the specified config field value.
|
|
475
|
+
* @param {String} slug The application slug.
|
|
476
|
+
* @param {String} fieldId The unique ID of the field.
|
|
477
|
+
* @param {String} [workflowId] The unique ID of the workflow.
|
|
478
|
+
* @returns {Promise<unknown>}
|
|
479
|
+
*/
|
|
480
|
+
deleteConfigField(slug: string, fieldId: string, workflowId?: string): Promise<unknown>;
|
|
481
|
+
/**
|
|
482
|
+
* Returns the options for the specified field.
|
|
483
|
+
* @param {String} lhs The selected value of the lhs field.
|
|
484
|
+
* @param {String} slug The application slug.
|
|
485
|
+
* @param {String} fieldId The unique ID of the field.
|
|
486
|
+
* @param {String} [workflowId] The unique ID of the workflow, if this is a workflow field.
|
|
487
|
+
* @returns {Promise<RuleOptions>} The specified rule field's options.
|
|
488
|
+
*/
|
|
489
|
+
getFieldOptions(lhs: string, slug: string, fieldId: string, workflowId?: string): Promise<RuleOptions>;
|
|
490
|
+
/**
|
|
491
|
+
* Returns the private workflows for the specified application.
|
|
492
|
+
* @param {Object} params
|
|
493
|
+
* @param {String} [params.slug]
|
|
494
|
+
* @param {String} [params.name]
|
|
495
|
+
* @param {Number} [params.page]
|
|
496
|
+
* @param {Number} [params.limit]
|
|
497
|
+
* @param {String} [params.start_date] ISO date string — filter workflows created on or after this date.
|
|
498
|
+
* @param {String} [params.end_date] ISO date string — filter workflows created on or before this date.
|
|
499
|
+
* @param {Boolean} [params.published] Filter by workflow published status.
|
|
500
|
+
* @returns
|
|
501
|
+
*/
|
|
502
|
+
getWorkflows({ page, limit, ...rest }?: PublicWorkflowsPayload): Promise<PaginatedResponse<PublicWorkflow>>;
|
|
503
|
+
/**
|
|
504
|
+
* Create a public workflow for the linked account.
|
|
505
|
+
* @param {Object} params
|
|
506
|
+
* @param {String} params.name The workflow name.
|
|
507
|
+
* @param {String} [params.description] The workflow description.
|
|
508
|
+
* @param {String} [params.slug] The application slug in which this workflow should be created.
|
|
509
|
+
* If slug isn't set, the workflow will be created in the organization's default application.
|
|
510
|
+
* @returns {Promise<PublicWorkflow>} The created public workflow.
|
|
511
|
+
*/
|
|
512
|
+
createWorkflow(params: PublicWorkflowPayload): Promise<PublicWorkflow>;
|
|
513
|
+
/**
|
|
514
|
+
* Delete the specified public workflow.
|
|
515
|
+
* @param {String} workflowId The workflow ID.
|
|
516
|
+
* @returns {Promise<unknown>}
|
|
517
|
+
*/
|
|
518
|
+
deleteWorkflow(workflowId: string): Promise<unknown>;
|
|
519
|
+
/**
|
|
520
|
+
* Returns the execution payload for the specified public workflow.
|
|
521
|
+
* @param {String} workflowId The workflow ID.
|
|
522
|
+
* @returns {Promise<WorkflowPayloadResponse>} The workflow payload response.
|
|
523
|
+
*/
|
|
524
|
+
getWorkflowPayload(workflowId: string): Promise<WorkflowPayloadResponse>;
|
|
525
|
+
/**
|
|
526
|
+
* Execute the specified public workflow.
|
|
527
|
+
* @param {ExecuteWorkflowPayload} options The execution payload.
|
|
528
|
+
* @param {String} options.worklfow The workflow id or alias.
|
|
529
|
+
* @param {String} [options.slug] The application's slug this workflow belongs to. Slug is required if you're using workflow alias.
|
|
530
|
+
* @param {Record<string, any>} [options.payload] The execution payload.
|
|
531
|
+
* @returns {Promise<unknown>}
|
|
532
|
+
*/
|
|
533
|
+
executeWorkflow(options: ExecuteWorkflowPayload): Promise<unknown>;
|
|
534
|
+
/**
|
|
535
|
+
* Returns the workflow execution logs for the linked account.
|
|
536
|
+
* @param {Object} [params]
|
|
537
|
+
* @param {Number} [params.page]
|
|
538
|
+
* @param {Number} [params.limit]
|
|
539
|
+
* @param {String} [params.status] - Filter by execution status (COMPLETED, RUNNING, ERRORED, STOPPED, STOPPING, TIMED_OUT)
|
|
540
|
+
* @param {String} [params.workflow_name] - Filter by workflow name
|
|
541
|
+
* @param {String} [params.workflow_id] - Filter by workflow ID
|
|
542
|
+
* @param {String} [params.start_date] - Filter executions after this date
|
|
543
|
+
* @param {String} [params.end_date] - Filter executions before this date
|
|
544
|
+
* @param {String} [params.execution_type] - Filter by execution type (SYNC, ASYNC)
|
|
545
|
+
* @param {String} [params.execution_source] - Filter by execution source (Event, Schedule, API Call)
|
|
546
|
+
* @returns {Promise<PaginatedResponse<Execution>>} The paginated workflow execution logs.
|
|
547
|
+
*/
|
|
548
|
+
getExecutions({ page, limit, ...rest }?: GetExecutionsParams): Promise<PaginatedResponse<Execution>>;
|
|
549
|
+
/**
|
|
550
|
+
* Returns the specified workflow execution log.
|
|
551
|
+
* @param {String} executionId The execution ID.
|
|
552
|
+
* @returns {Promise<Execution>} The specified execution log.
|
|
553
|
+
*/
|
|
554
|
+
getExecution(executionId: string): Promise<Execution>;
|
|
555
|
+
}
|
|
556
|
+
export { Refold };
|