@livechat/platform-workflows 0.1.8 → 0.44.0-beta.v1
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/dist/chunk-6ZQIQVNX.mjs +33594 -0
- package/dist/chunk-OAUPCV3P.mjs +19 -0
- package/dist/config.d.mts +0 -4
- package/dist/config.d.ts +0 -4
- package/dist/config.js +6 -17
- package/dist/config.mjs +1 -2
- package/dist/constants.d.mts +921 -993
- package/dist/constants.d.ts +921 -993
- package/dist/constants.js +31411 -9497
- package/dist/constants.mjs +393 -10773
- package/dist/domain.d.mts +298 -0
- package/dist/domain.d.ts +298 -0
- package/dist/domain.js +35232 -0
- package/dist/domain.mjs +2975 -0
- package/dist/index.css +64 -73
- package/dist/index.d.mts +817 -21
- package/dist/index.d.ts +817 -21
- package/dist/index.js +56780 -21544
- package/dist/index.mjs +58180 -22037
- package/dist/tests.d.mts +140 -10
- package/dist/tests.d.ts +140 -10
- package/dist/tests.js +147 -17
- package/dist/tests.mjs +147 -19
- package/dist/types-BSdHiBvO.d.mts +440 -0
- package/dist/types-BSdHiBvO.d.ts +440 -0
- package/package.json +36 -29
- package/dist/chunk-BW4GCPXP.mjs +0 -20
- package/dist/chunk-EACC5D4G.mjs +0 -113
- package/dist/chunk-I4E63NIC.mjs +0 -24
- package/dist/chunk-OHDSKF3P.mjs +0 -193
- package/dist/chunk-PWFJOGII.mjs +0 -83
- package/dist/chunk-UQO6HYDU.mjs +0 -84
- package/dist/chunk-V3FK4SUN.mjs +0 -1606
- package/dist/chunk-WFVTCU6F.mjs +0 -24
- package/dist/chunk-WNNR3KXF.mjs +0 -1607
- package/dist/chunk-WS4FFM4M.mjs +0 -111
- package/dist/chunk-XIPVJOPR.mjs +0 -1621
- package/dist/chunk-YS3C7NY2.mjs +0 -1623
- package/dist/index-B3GBo8sA.d.mts +0 -98
- package/dist/index-B3GBo8sA.d.ts +0 -98
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { UiSchema } from '@rjsf/utils';
|
|
2
|
+
import { JSONSchema7 } from 'json-schema';
|
|
3
|
+
import { CredentialType, Credential, WorkflowTaskType, WorkflowHttpTask, WorkflowForkJoinTask, WorkflowJoinTask, WorkflowSwitchTask, WorkflowCustomTaskName, WorkflowConditionTask, WorkflowSwitchCaseTask, WorkflowDoWhileTask, WorkflowLoopTask, WorkflowForEachTask, WorkflowTerminateTask, WorkflowWaitTask, WorkflowInlineBaseTask, WorkflowScriptTask, WorkflowConvertTask, WorkflowConstructTask, WorkflowSimpleTask, WorkflowActionTask, WorkflowAwaitTask, WorkflowNotifyAiAgentTask, WorkflowReasoningTask, WorkflowItemKind, WorkflowHttpTaskCore, WorkflowForkJoinTaskCore, WorkflowJoinTaskCore, WorkflowSwitchTaskCore, WorkflowConditionTaskCore, WorkflowSwitchCaseTaskCore, WorkflowDoWhileBaseTaskCore, WorkflowLoopTaskCore, WorkflowForEachTaskCore, WorkflowTerminateTaskCore, WorkflowWaitTaskCore, WorkflowInlineBaseTaskCore, WorkflowScriptTaskCore, WorkflowConvertTaskCore, WorkflowConstructTaskCore, WorkflowSimpleTaskCore, WorkflowActionTaskCore, WorkflowAwaitTaskCore, WorkflowNotifyAiAgentTaskCore, WorkflowReasoningTaskCore, WorkflowTriggerType, WorkflowWebhookTrigger, WorkflowWebhookManualTrigger, WorkflowManualTrigger, WorkflowAgentTrigger, WorkflowRecurringTrigger, WorkflowOneTimeTrigger, WorkflowWebhookTriggerCore, WorkflowWebhookManualTriggerCore, WorkflowManualTriggerCore, WorkflowAgentTriggerCore, WorkflowRecurringTriggerCore, WorkflowOneTimeTriggerCore, ExternalResourceConfig } from '@livechat/developer-studio-api';
|
|
4
|
+
|
|
5
|
+
type CredentialGenericAuthType = 'httpBasicAuth' | 'httpBearerAuth' | 'httpQueryAuth' | 'httpDigestAuth' | 'httpCustomAuth' | 'httpHeaderAuth' | 'oAuth1Api' | 'oAuth2Api';
|
|
6
|
+
interface CredentialField {
|
|
7
|
+
displayName: string;
|
|
8
|
+
name: string;
|
|
9
|
+
type: 'string' | 'number' | 'boolean' | 'options' | 'hidden' | 'notice';
|
|
10
|
+
default?: string | number | boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
readonly?: true;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
doNotInherit?: boolean;
|
|
16
|
+
source?: {
|
|
17
|
+
reference: string;
|
|
18
|
+
};
|
|
19
|
+
typeOptions?: {
|
|
20
|
+
password?: boolean;
|
|
21
|
+
expirable?: boolean;
|
|
22
|
+
url?: boolean;
|
|
23
|
+
rows?: number;
|
|
24
|
+
};
|
|
25
|
+
options?: {
|
|
26
|
+
name: string;
|
|
27
|
+
value: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
}[];
|
|
30
|
+
displayOptions?: {
|
|
31
|
+
show?: Record<string, string[]>;
|
|
32
|
+
hide?: Record<string, string[]>;
|
|
33
|
+
};
|
|
34
|
+
hint?: string;
|
|
35
|
+
}
|
|
36
|
+
interface CredentialAuthenticate {
|
|
37
|
+
type: 'generic' | 'oauth2';
|
|
38
|
+
properties?: {
|
|
39
|
+
headers?: Record<string, string>;
|
|
40
|
+
qs?: Record<string, string>;
|
|
41
|
+
body?: Record<string, string>;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
interface CredentialTest {
|
|
45
|
+
request: {
|
|
46
|
+
baseURL?: string;
|
|
47
|
+
url: string;
|
|
48
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
49
|
+
qs?: Record<string, string | number>;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
declare enum CredentialKind {
|
|
53
|
+
Internal = "internal",
|
|
54
|
+
Custom = "custom"
|
|
55
|
+
}
|
|
56
|
+
interface CredentialTemplate {
|
|
57
|
+
name: string;
|
|
58
|
+
displayName: string;
|
|
59
|
+
provider: string;
|
|
60
|
+
product?: string;
|
|
61
|
+
type: CredentialType;
|
|
62
|
+
properties: CredentialField[];
|
|
63
|
+
documentationUrl?: string;
|
|
64
|
+
extends?: string[];
|
|
65
|
+
authenticate?: CredentialAuthenticate;
|
|
66
|
+
test?: CredentialTest;
|
|
67
|
+
iconUrl?: string | {
|
|
68
|
+
light: string;
|
|
69
|
+
dark: string;
|
|
70
|
+
};
|
|
71
|
+
supportedNodes?: string[];
|
|
72
|
+
genericAuth?: boolean;
|
|
73
|
+
isBuiltIn?: boolean;
|
|
74
|
+
isHidden?: boolean;
|
|
75
|
+
}
|
|
76
|
+
interface CredentialConfig {
|
|
77
|
+
name: string;
|
|
78
|
+
provider: string;
|
|
79
|
+
product?: string;
|
|
80
|
+
kind: CredentialKind;
|
|
81
|
+
type: CredentialType;
|
|
82
|
+
specification: {
|
|
83
|
+
schema: JSONSchema7;
|
|
84
|
+
uiSchema: UiSchema;
|
|
85
|
+
};
|
|
86
|
+
customization: {
|
|
87
|
+
description: string;
|
|
88
|
+
};
|
|
89
|
+
template: Credential;
|
|
90
|
+
metadata: {
|
|
91
|
+
isComplete?: boolean;
|
|
92
|
+
isHidden?: boolean;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare enum WorkflowDomain {
|
|
97
|
+
Chats = "chats",
|
|
98
|
+
Tickets = "tickets",
|
|
99
|
+
Customers = "customers",
|
|
100
|
+
Agents = "agents",
|
|
101
|
+
General = "general"
|
|
102
|
+
}
|
|
103
|
+
interface WorkflowDomainConfig {
|
|
104
|
+
name: string;
|
|
105
|
+
displayName: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface WorkflowTaskCoreMap {
|
|
109
|
+
[WorkflowTaskType.http]: WorkflowHttpTaskCore;
|
|
110
|
+
[WorkflowTaskType.forkJoin]: WorkflowForkJoinTaskCore;
|
|
111
|
+
[WorkflowTaskType.join]: WorkflowJoinTaskCore;
|
|
112
|
+
[WorkflowTaskType.switch]: WorkflowSwitchTaskCore;
|
|
113
|
+
[WorkflowCustomTaskName.condition]: WorkflowConditionTaskCore;
|
|
114
|
+
[WorkflowCustomTaskName.switchCase]: WorkflowSwitchCaseTaskCore;
|
|
115
|
+
[WorkflowTaskType.doWhile]: WorkflowDoWhileBaseTaskCore;
|
|
116
|
+
[WorkflowCustomTaskName.loop]: WorkflowLoopTaskCore;
|
|
117
|
+
[WorkflowCustomTaskName.forEach]: WorkflowForEachTaskCore;
|
|
118
|
+
[WorkflowTaskType.terminate]: WorkflowTerminateTaskCore;
|
|
119
|
+
[WorkflowTaskType.wait]: WorkflowWaitTaskCore;
|
|
120
|
+
[WorkflowTaskType.inline]: WorkflowInlineBaseTaskCore;
|
|
121
|
+
[WorkflowCustomTaskName.script]: WorkflowScriptTaskCore;
|
|
122
|
+
[WorkflowCustomTaskName.convert]: WorkflowConvertTaskCore;
|
|
123
|
+
[WorkflowCustomTaskName.construct]: WorkflowConstructTaskCore;
|
|
124
|
+
[WorkflowTaskType.simple]: WorkflowSimpleTaskCore;
|
|
125
|
+
[WorkflowCustomTaskName.action]: WorkflowActionTaskCore;
|
|
126
|
+
[WorkflowCustomTaskName.awaitAgent]: WorkflowAwaitTaskCore;
|
|
127
|
+
[WorkflowCustomTaskName.notifyAgent]: WorkflowNotifyAiAgentTaskCore;
|
|
128
|
+
[WorkflowCustomTaskName.reasoning]: WorkflowReasoningTaskCore;
|
|
129
|
+
}
|
|
130
|
+
interface WorkflowTaskDefinitionMap {
|
|
131
|
+
[WorkflowTaskType.http]: WorkflowHttpTask;
|
|
132
|
+
[WorkflowTaskType.forkJoin]: WorkflowForkJoinTask;
|
|
133
|
+
[WorkflowTaskType.join]: WorkflowJoinTask;
|
|
134
|
+
[WorkflowTaskType.switch]: WorkflowSwitchTask;
|
|
135
|
+
[WorkflowCustomTaskName.condition]: WorkflowConditionTask;
|
|
136
|
+
[WorkflowCustomTaskName.switchCase]: WorkflowSwitchCaseTask;
|
|
137
|
+
[WorkflowTaskType.doWhile]: WorkflowDoWhileTask;
|
|
138
|
+
[WorkflowCustomTaskName.loop]: WorkflowLoopTask;
|
|
139
|
+
[WorkflowCustomTaskName.forEach]: WorkflowForEachTask;
|
|
140
|
+
[WorkflowTaskType.terminate]: WorkflowTerminateTask;
|
|
141
|
+
[WorkflowTaskType.wait]: WorkflowWaitTask;
|
|
142
|
+
[WorkflowTaskType.inline]: WorkflowInlineBaseTask;
|
|
143
|
+
[WorkflowCustomTaskName.script]: WorkflowScriptTask;
|
|
144
|
+
[WorkflowCustomTaskName.convert]: WorkflowConvertTask;
|
|
145
|
+
[WorkflowCustomTaskName.construct]: WorkflowConstructTask;
|
|
146
|
+
[WorkflowTaskType.simple]: WorkflowSimpleTask;
|
|
147
|
+
[WorkflowCustomTaskName.action]: WorkflowActionTask;
|
|
148
|
+
[WorkflowCustomTaskName.awaitAgent]: WorkflowAwaitTask;
|
|
149
|
+
[WorkflowCustomTaskName.notifyAgent]: WorkflowNotifyAiAgentTask;
|
|
150
|
+
[WorkflowCustomTaskName.reasoning]: WorkflowReasoningTask;
|
|
151
|
+
}
|
|
152
|
+
interface WorkflowTriggerCoreMap {
|
|
153
|
+
[WorkflowTriggerType.webhook]: WorkflowWebhookTriggerCore;
|
|
154
|
+
[WorkflowTriggerType.webhookManual]: WorkflowWebhookManualTriggerCore;
|
|
155
|
+
[WorkflowTriggerType.manual]: WorkflowManualTriggerCore;
|
|
156
|
+
[WorkflowTriggerType.agent]: WorkflowAgentTriggerCore;
|
|
157
|
+
[WorkflowTriggerType.recurring]: WorkflowRecurringTriggerCore;
|
|
158
|
+
[WorkflowTriggerType.oneTime]: WorkflowOneTimeTriggerCore;
|
|
159
|
+
}
|
|
160
|
+
interface WorkflowsTriggerDefinitionMap {
|
|
161
|
+
[WorkflowTriggerType.webhook]: WorkflowWebhookTrigger;
|
|
162
|
+
[WorkflowTriggerType.webhookManual]: WorkflowWebhookManualTrigger;
|
|
163
|
+
[WorkflowTriggerType.manual]: WorkflowManualTrigger;
|
|
164
|
+
[WorkflowTriggerType.agent]: WorkflowAgentTrigger;
|
|
165
|
+
[WorkflowTriggerType.recurring]: WorkflowRecurringTrigger;
|
|
166
|
+
[WorkflowTriggerType.oneTime]: WorkflowOneTimeTrigger;
|
|
167
|
+
}
|
|
168
|
+
type WorkflowItemFlags = {
|
|
169
|
+
isHidden: boolean;
|
|
170
|
+
isRemovable: boolean;
|
|
171
|
+
isSelectable: boolean;
|
|
172
|
+
isEditable: boolean;
|
|
173
|
+
};
|
|
174
|
+
type WorkflowItemBaseMetadata = {
|
|
175
|
+
outputBasePath: string | null;
|
|
176
|
+
inputBasePath: string;
|
|
177
|
+
credentialPath?: string;
|
|
178
|
+
isHidden: boolean;
|
|
179
|
+
};
|
|
180
|
+
type WorkflowItemMetadata = WorkflowItemBaseMetadata;
|
|
181
|
+
declare enum WorkflowItemTag {
|
|
182
|
+
AI = "ai"
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Describes the nature of a task/trigger so consumers (UI, AI agent prompts)
|
|
186
|
+
* can group, filter, and pick icons without inspecting `displayName`.
|
|
187
|
+
*
|
|
188
|
+
* For tasks the value reflects the side-effect the task performs.
|
|
189
|
+
* For triggers it reflects the verb of the event that fires the trigger
|
|
190
|
+
* (or `invoke`/`control` for non-event-driven orchestration triggers).
|
|
191
|
+
*
|
|
192
|
+
* Convention:
|
|
193
|
+
* - `read` — find/get/list/search + pure AI compute returning data
|
|
194
|
+
* - `create` — adds a new entity; trigger: "X was created"
|
|
195
|
+
* - `upsert` — create-or-update
|
|
196
|
+
* - `update` — modifies an existing entity; trigger: "X changed"
|
|
197
|
+
* - `delete` — remove/archive/close/end + "X was removed"
|
|
198
|
+
* - `send` — outbound communication (message, notification, transcript)
|
|
199
|
+
* - `invoke` — side-effectful action that does not fit CRUD
|
|
200
|
+
* (run job, generic HTTP, arbitrary script, notify agent,
|
|
201
|
+
* manually-triggered workflow)
|
|
202
|
+
* - `control` — workflow control-flow primitive (fork/join/cond/switch/loop/
|
|
203
|
+
* wait/terminate) and system trigger orchestration
|
|
204
|
+
*/
|
|
205
|
+
declare enum WorkflowOperation {
|
|
206
|
+
Read = "read",
|
|
207
|
+
Create = "create",
|
|
208
|
+
Upsert = "upsert",
|
|
209
|
+
Update = "update",
|
|
210
|
+
Delete = "delete",
|
|
211
|
+
Send = "send",
|
|
212
|
+
Invoke = "invoke",
|
|
213
|
+
Control = "control"
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Entity the task/trigger acts on. Always namespaced with the provider id
|
|
217
|
+
* (`<provider>:<entity>`, kebab-case) so the same entity name across two
|
|
218
|
+
* providers can't collide.
|
|
219
|
+
*
|
|
220
|
+
* Allowed values come from per-provider `<PROVIDER>_SUBJECTS` constants
|
|
221
|
+
* (e.g. `BIGCOMMERCE_SUBJECTS`, `LIVECHAT_SUBJECTS`) which `satisfies
|
|
222
|
+
* Record<string, \`${IntegrationNames.X}:${string}\`>` so typos and missing
|
|
223
|
+
* namespaces fail to compile. Control-flow primitives and generic HTTP /
|
|
224
|
+
* script tasks leave it `undefined`.
|
|
225
|
+
*/
|
|
226
|
+
type WorkflowSubject = `${string}:${string}`;
|
|
227
|
+
interface WorkflowItemCustomization {
|
|
228
|
+
domain: WorkflowDomain | null;
|
|
229
|
+
provider: string;
|
|
230
|
+
operation: WorkflowOperation;
|
|
231
|
+
subject?: WorkflowSubject;
|
|
232
|
+
product?: string;
|
|
233
|
+
displayName: string;
|
|
234
|
+
description: string;
|
|
235
|
+
shortDescription: string;
|
|
236
|
+
tags?: WorkflowItemTag[];
|
|
237
|
+
icon?: string;
|
|
238
|
+
flags: WorkflowItemFlags;
|
|
239
|
+
}
|
|
240
|
+
interface WorkflowItemSpecificationRef<TType> {
|
|
241
|
+
type: 'single' | 'array' | 'array-element';
|
|
242
|
+
value: TType;
|
|
243
|
+
subject?: WorkflowDomain;
|
|
244
|
+
}
|
|
245
|
+
interface WorkflowItemInputBinding {
|
|
246
|
+
outputPath: string;
|
|
247
|
+
inputPath: string;
|
|
248
|
+
inputFormat?: string;
|
|
249
|
+
}
|
|
250
|
+
interface WorkflowItemSpecification {
|
|
251
|
+
input?: JSONSchema7;
|
|
252
|
+
inputUi?: UiSchema;
|
|
253
|
+
output?: JSONSchema7;
|
|
254
|
+
outputUi?: UiSchema;
|
|
255
|
+
inputReferences?: Record<string, WorkflowItemSpecificationRef<string>[]>;
|
|
256
|
+
inputResources?: Record<string, WorkflowItemSpecificationRef<string>[]>;
|
|
257
|
+
outputReferences?: Record<string, WorkflowItemSpecificationRef<string>[]>;
|
|
258
|
+
outputResources?: Record<string, WorkflowItemSpecificationRef<string>[]>;
|
|
259
|
+
outputBindings?: WorkflowItemInputBinding[];
|
|
260
|
+
}
|
|
261
|
+
interface WorkflowItemSpecifications<TData> {
|
|
262
|
+
default: string;
|
|
263
|
+
latest: string;
|
|
264
|
+
versions: Record<string, WorkflowItemSpecification & {
|
|
265
|
+
metadata: WorkflowItemMetadata;
|
|
266
|
+
template: TData;
|
|
267
|
+
}>;
|
|
268
|
+
}
|
|
269
|
+
type WorkflowItemTemplateBase<TData> = {
|
|
270
|
+
kind: WorkflowItemKind;
|
|
271
|
+
key: string;
|
|
272
|
+
domain: WorkflowDomain | null;
|
|
273
|
+
provider: string;
|
|
274
|
+
operation: WorkflowOperation;
|
|
275
|
+
subject?: WorkflowSubject;
|
|
276
|
+
product?: string;
|
|
277
|
+
name: string;
|
|
278
|
+
displayName: string;
|
|
279
|
+
shortDescription: string;
|
|
280
|
+
description: string;
|
|
281
|
+
icon?: string;
|
|
282
|
+
version?: string;
|
|
283
|
+
metadata: WorkflowItemBaseMetadata;
|
|
284
|
+
specification: WorkflowItemSpecification;
|
|
285
|
+
template: TData;
|
|
286
|
+
};
|
|
287
|
+
interface WorkflowItemConfigBase<TData> {
|
|
288
|
+
key: string;
|
|
289
|
+
kind: WorkflowItemKind;
|
|
290
|
+
customization: WorkflowItemCustomization;
|
|
291
|
+
specifications: WorkflowItemSpecifications<TData>;
|
|
292
|
+
}
|
|
293
|
+
/** Union of all task core types */
|
|
294
|
+
type AnyTaskCore = WorkflowTaskCoreMap[keyof WorkflowTaskCoreMap];
|
|
295
|
+
/** Union of all task definition types */
|
|
296
|
+
type AnyTaskDefinition = WorkflowTaskDefinitionMap[keyof WorkflowTaskDefinitionMap];
|
|
297
|
+
/** Union of all trigger core types */
|
|
298
|
+
type AnyTriggerCore = WorkflowTriggerCoreMap[keyof WorkflowTriggerCoreMap];
|
|
299
|
+
/** Union of all trigger definition types */
|
|
300
|
+
type AnyTriggerDefinition = WorkflowsTriggerDefinitionMap[keyof WorkflowsTriggerDefinitionMap];
|
|
301
|
+
/**
|
|
302
|
+
* Generic task template - use with specific TCore for type safety
|
|
303
|
+
* @example const myTask: WorkflowTaskTemplate<WorkflowHttpTaskCore> = { ... }
|
|
304
|
+
*/
|
|
305
|
+
type WorkflowTaskTemplate<TCore extends AnyTaskCore = AnyTaskCore> = {
|
|
306
|
+
type: WorkflowTaskType;
|
|
307
|
+
} & WorkflowItemTemplateBase<TCore>;
|
|
308
|
+
/**
|
|
309
|
+
* Generic task config - use with specific TDefinition for type safety
|
|
310
|
+
* @example const myConfig: WorkflowTaskConfig<WorkflowHttpTask> = { ... }
|
|
311
|
+
*/
|
|
312
|
+
type WorkflowTaskConfig<TDefinition extends AnyTaskDefinition = AnyTaskDefinition> = {
|
|
313
|
+
kind: typeof WorkflowItemKind.Task;
|
|
314
|
+
} & WorkflowItemConfigBase<TDefinition>;
|
|
315
|
+
/**
|
|
316
|
+
* Generic trigger template - use with specific TCore for type safety
|
|
317
|
+
*/
|
|
318
|
+
type WorkflowTriggerTemplate<TCore extends AnyTriggerCore = AnyTriggerCore> = {
|
|
319
|
+
kind: typeof WorkflowItemKind.Trigger;
|
|
320
|
+
type: keyof WorkflowTriggerCoreMap;
|
|
321
|
+
} & WorkflowItemTemplateBase<TCore>;
|
|
322
|
+
/**
|
|
323
|
+
* Generic trigger config - use with specific TDefinition for type safety
|
|
324
|
+
*/
|
|
325
|
+
type WorkflowTriggerConfig<TDefinition extends AnyTriggerDefinition = AnyTriggerDefinition> = {
|
|
326
|
+
kind: typeof WorkflowItemKind.Trigger;
|
|
327
|
+
} & WorkflowItemConfigBase<TDefinition>;
|
|
328
|
+
type WorkflowItemTemplate = WorkflowTaskTemplate | WorkflowTriggerTemplate;
|
|
329
|
+
type WorkflowItemConfig = WorkflowTaskConfig | WorkflowTriggerConfig;
|
|
330
|
+
/**
|
|
331
|
+
* JSON-serializable subset of WorkflowTaskTemplate<WorkflowHttpTaskCore>.
|
|
332
|
+
*
|
|
333
|
+
* Omits fields that the compiler derives:
|
|
334
|
+
* - kind → always Task
|
|
335
|
+
* - type → always http
|
|
336
|
+
* - name → same as key
|
|
337
|
+
*/
|
|
338
|
+
type DeclarativeWorkflowTaskTemplate = Omit<WorkflowTaskTemplate<WorkflowHttpTaskCore>, 'kind' | 'type' | 'name' | 'metadata'> & {
|
|
339
|
+
metadata?: {
|
|
340
|
+
isHidden?: boolean;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
interface ProviderProductConfig {
|
|
345
|
+
name: string;
|
|
346
|
+
displayName: string;
|
|
347
|
+
icon?: string;
|
|
348
|
+
}
|
|
349
|
+
interface ProviderConfig {
|
|
350
|
+
name: string;
|
|
351
|
+
displayName: string;
|
|
352
|
+
icon?: string;
|
|
353
|
+
isHidden?: boolean;
|
|
354
|
+
products?: Record<string, ProviderProductConfig>;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
declare enum WorkflowRefClass {
|
|
358
|
+
Reference = "reference",
|
|
359
|
+
Resource = "resource"
|
|
360
|
+
}
|
|
361
|
+
declare enum WorkflowReferenceKind {
|
|
362
|
+
Resource = "resource",
|
|
363
|
+
Entity = "entity",
|
|
364
|
+
Property = "property"
|
|
365
|
+
}
|
|
366
|
+
declare enum WorkflowReferenceMatchingStrategy {
|
|
367
|
+
ExactOnly = "exact_only",
|
|
368
|
+
Semantic = "semantic"
|
|
369
|
+
}
|
|
370
|
+
type WorkflowReferenceDefinition = JSONSchema7 & {
|
|
371
|
+
class: WorkflowRefClass.Reference;
|
|
372
|
+
provider: string;
|
|
373
|
+
name: string;
|
|
374
|
+
displayName: string;
|
|
375
|
+
pluralDisplayName: string;
|
|
376
|
+
domain: WorkflowDomain | null;
|
|
377
|
+
product?: string;
|
|
378
|
+
visible: true;
|
|
379
|
+
configs?: {
|
|
380
|
+
dependencies?: Record<string, JSONSchema7>;
|
|
381
|
+
matching?: {
|
|
382
|
+
strategy: WorkflowReferenceMatchingStrategy;
|
|
383
|
+
};
|
|
384
|
+
external?: ExternalResourceConfig;
|
|
385
|
+
};
|
|
386
|
+
} & ({
|
|
387
|
+
kind: WorkflowReferenceKind.Resource;
|
|
388
|
+
resource: {
|
|
389
|
+
name: string;
|
|
390
|
+
path: string;
|
|
391
|
+
};
|
|
392
|
+
} | {
|
|
393
|
+
kind: WorkflowReferenceKind.Property | WorkflowReferenceKind.Entity;
|
|
394
|
+
});
|
|
395
|
+
type WorkflowResourceDefinition = JSONSchema7 & {
|
|
396
|
+
class: WorkflowRefClass.Resource;
|
|
397
|
+
provider: string;
|
|
398
|
+
name: string;
|
|
399
|
+
displayName: string;
|
|
400
|
+
pluralDisplayName: string;
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
interface LightConfiguration {
|
|
404
|
+
providers: Record<string, ProviderConfig>;
|
|
405
|
+
domains: Record<WorkflowDomain, WorkflowDomainConfig>;
|
|
406
|
+
credentials: Record<string, CredentialConfig>;
|
|
407
|
+
items: Record<string, WorkflowItemTemplate>;
|
|
408
|
+
resources: Record<string, WorkflowResourceDefinition>;
|
|
409
|
+
references: Record<string, WorkflowReferenceDefinition>;
|
|
410
|
+
}
|
|
411
|
+
interface Configuration {
|
|
412
|
+
providers: Record<string, ProviderConfig>;
|
|
413
|
+
domains: Record<WorkflowDomain, WorkflowDomainConfig>;
|
|
414
|
+
credentials: Record<string, CredentialConfig>;
|
|
415
|
+
items: Record<string, WorkflowItemConfig>;
|
|
416
|
+
resources: Record<string, WorkflowResourceDefinition>;
|
|
417
|
+
references: Record<string, WorkflowReferenceDefinition>;
|
|
418
|
+
}
|
|
419
|
+
type LightProviderConfiguration = ProviderConfig & {
|
|
420
|
+
defaultCredential?: CredentialConfig;
|
|
421
|
+
credentials: Record<string, CredentialConfig>;
|
|
422
|
+
items: Record<string, WorkflowItemTemplate>;
|
|
423
|
+
resources: Record<string, WorkflowResourceDefinition>;
|
|
424
|
+
};
|
|
425
|
+
type ProviderConfiguration = ProviderConfig & {
|
|
426
|
+
defaultCredential?: CredentialConfig;
|
|
427
|
+
credentials: Record<string, CredentialConfig>;
|
|
428
|
+
items: Record<string, WorkflowItemConfig>;
|
|
429
|
+
resources: Record<string, WorkflowResourceDefinition>;
|
|
430
|
+
};
|
|
431
|
+
interface LightSpecification {
|
|
432
|
+
providers: Record<string, LightProviderConfiguration>;
|
|
433
|
+
raw: LightConfiguration;
|
|
434
|
+
}
|
|
435
|
+
interface Specification {
|
|
436
|
+
providers: Record<string, ProviderConfiguration>;
|
|
437
|
+
raw: Configuration;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export { type WorkflowItemConfigBase as A, type WorkflowItemFlags as B, type CredentialConfig as C, type DeclarativeWorkflowTaskTemplate as D, type WorkflowItemInputBinding as E, WorkflowItemTag as F, type WorkflowItemTemplateBase as G, WorkflowOperation as H, WorkflowRefClass as I, WorkflowReferenceKind as J, WorkflowReferenceMatchingStrategy as K, type LightSpecification as L, type WorkflowSubject as M, type WorkflowTaskCoreMap as N, type WorkflowTaskDefinitionMap as O, type ProviderConfig as P, type WorkflowTriggerCoreMap as Q, type WorkflowsTriggerDefinitionMap as R, type Specification as S, type WorkflowDomainConfig as W, WorkflowDomain as a, type WorkflowTaskTemplate as b, type WorkflowTaskConfig as c, type WorkflowReferenceDefinition as d, type WorkflowResourceDefinition as e, type WorkflowItemSpecificationRef as f, type WorkflowItemConfig as g, type WorkflowItemTemplate as h, type WorkflowItemSpecification as i, type WorkflowItemMetadata as j, type WorkflowItemCustomization as k, type WorkflowItemSpecifications as l, type WorkflowTriggerConfig as m, type WorkflowTriggerTemplate as n, type Configuration as o, type CredentialAuthenticate as p, type CredentialField as q, type CredentialGenericAuthType as r, CredentialKind as s, type CredentialTemplate as t, type CredentialTest as u, type LightConfiguration as v, type LightProviderConfiguration as w, type ProviderConfiguration as x, type ProviderProductConfig as y, type WorkflowItemBaseMetadata as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livechat/platform-workflows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0-beta.v1",
|
|
4
4
|
"description": "Text Platform | Workflows",
|
|
5
5
|
"author": "Wojciech Dudek",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,6 +37,12 @@
|
|
|
37
37
|
"require": "./dist/constants.js",
|
|
38
38
|
"default": "./dist/constants.js"
|
|
39
39
|
},
|
|
40
|
+
"./domain": {
|
|
41
|
+
"types": "./dist/domain.d.ts",
|
|
42
|
+
"import": "./dist/domain.mjs",
|
|
43
|
+
"require": "./dist/domain.js",
|
|
44
|
+
"default": "./dist/domain.js"
|
|
45
|
+
},
|
|
40
46
|
"./config": {
|
|
41
47
|
"types": "./dist/config.d.ts",
|
|
42
48
|
"import": "./dist/config.mjs",
|
|
@@ -57,65 +63,66 @@
|
|
|
57
63
|
"@types/dompurify": "^3.0.5",
|
|
58
64
|
"@types/json-schema": "^7.0.15",
|
|
59
65
|
"@types/node": "^20.5.2",
|
|
60
|
-
"@types/react": "^
|
|
61
|
-
"@types/react-dom": "^
|
|
66
|
+
"@types/react": "^19.0.0",
|
|
67
|
+
"@types/react-dom": "^19.0.0",
|
|
62
68
|
"@types/uuid": "^9.0.7",
|
|
63
69
|
"@types/validator": "^13.7.10",
|
|
64
70
|
"@types/yaireo__tagify": "^4.27.0",
|
|
65
71
|
"babel-plugin-emotion": "11.0.0",
|
|
66
72
|
"esbuild-plugin-svgr": "^3.0.0",
|
|
67
73
|
"esbuild-sass-plugin": "^3.2.0",
|
|
68
|
-
"tsup": "^8.
|
|
74
|
+
"tsup": "^8.5.1",
|
|
69
75
|
"typescript": "^5.1.6",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
76
|
+
"tsconfig": "0.0.5",
|
|
77
|
+
"utils": "0.3.2",
|
|
78
|
+
"eslint-config-custom": "0.0.14"
|
|
73
79
|
},
|
|
74
80
|
"dependencies": {
|
|
75
81
|
"@amplitude/analytics-browser": "^2.11.9",
|
|
76
|
-
"@lexical/react": "^0.19.0",
|
|
77
82
|
"@monaco-editor/react": "^4.6.0",
|
|
78
|
-
"@rjsf/core": "^
|
|
79
|
-
"@rjsf/utils": "^
|
|
80
|
-
"@rjsf/validator-ajv8": "^
|
|
81
|
-
"@types/lodash
|
|
83
|
+
"@rjsf/core": "^6.3.1",
|
|
84
|
+
"@rjsf/utils": "^6.3.1",
|
|
85
|
+
"@rjsf/validator-ajv8": "^6.3.1",
|
|
86
|
+
"@types/lodash-es": "^4.17.12",
|
|
82
87
|
"@yaireo/tagify": "4.32.0",
|
|
83
|
-
"ajv": "^8.
|
|
88
|
+
"ajv": "^8.18.0",
|
|
84
89
|
"ajv-errors": "^3.0.0",
|
|
90
|
+
"ajv-formats": "^3.0.0",
|
|
91
|
+
"ajv-keywords": "^5.1.0",
|
|
85
92
|
"amplitude-js": "^8.21.9",
|
|
86
93
|
"date-fns": "^1.30.1",
|
|
87
|
-
"dompurify": "^3.
|
|
94
|
+
"dompurify": "^3.4.0",
|
|
88
95
|
"elkjs": "^0.9.3",
|
|
89
|
-
"final-form": "^4.20.10",
|
|
90
96
|
"json-schema": "^0.4.0",
|
|
91
97
|
"jsonpath-plus": "^10.1.0",
|
|
92
|
-
"
|
|
93
|
-
"
|
|
98
|
+
"lodash-es": "^4.18.1",
|
|
99
|
+
"mock-json-schema": "^1.1.1",
|
|
94
100
|
"monaco-editor": "^0.52.0",
|
|
95
101
|
"pusher-js": "8.4.0-rc2",
|
|
96
|
-
"react-final-form": "^6.5.9",
|
|
97
102
|
"react-flow-renderer": "^10.3.17",
|
|
98
103
|
"react-js-cron": "^5.0.1",
|
|
99
|
-
"react-markdown": "^
|
|
104
|
+
"react-markdown": "^5.0.3",
|
|
100
105
|
"reactflow": "^11.11.4",
|
|
101
106
|
"uuid": "^9.0.1",
|
|
102
|
-
"validator": "^13.12.0",
|
|
103
107
|
"web-worker": "^1.3.0",
|
|
104
|
-
"@livechat/
|
|
105
|
-
"@livechat/developer-studio-
|
|
106
|
-
"@livechat/
|
|
108
|
+
"@livechat/developer-studio-api": "5.3.0-beta.v1",
|
|
109
|
+
"@livechat/developer-studio-ui-react": "25.0.0-beta.v1",
|
|
110
|
+
"@livechat/platform-integrations": "0.10.2-beta.v1"
|
|
107
111
|
},
|
|
108
112
|
"peerDependencies": {
|
|
109
|
-
"@tanstack/react-query": "4.36.1",
|
|
110
113
|
"@livechat/design-system-icons": "^2.21.0",
|
|
111
|
-
"@livechat/design-system-react-components": "
|
|
112
|
-
"react": "
|
|
113
|
-
"react
|
|
114
|
+
"@livechat/design-system-react-components": "2.32.0",
|
|
115
|
+
"@tanstack/react-query": "4.36.1",
|
|
116
|
+
"react": "^19.0.0",
|
|
117
|
+
"react-dom": "^19.0.0",
|
|
114
118
|
"react-router-dom": "^6.17.0"
|
|
115
119
|
},
|
|
116
120
|
"scripts": {
|
|
117
|
-
"build": "tsup",
|
|
121
|
+
"build": "rm -rf dist && tsup",
|
|
118
122
|
"dev": "npm run build -- --watch",
|
|
119
|
-
"lint": "eslint
|
|
123
|
+
"lint": "eslint",
|
|
124
|
+
"lint:fix": "eslint --fix",
|
|
125
|
+
"typecheck": "tsc --noEmit",
|
|
126
|
+
"knip": "knip"
|
|
120
127
|
}
|
|
121
128
|
}
|
package/dist/chunk-BW4GCPXP.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__spreadValues
|
|
3
|
-
} from "./chunk-I4E63NIC.mjs";
|
|
4
|
-
|
|
5
|
-
// src/config.ts
|
|
6
|
-
var config = {
|
|
7
|
-
config: void 0
|
|
8
|
-
};
|
|
9
|
-
function setWorkflowsConfig(newConfig) {
|
|
10
|
-
config.config = __spreadValues(__spreadValues({}, config.config), newConfig);
|
|
11
|
-
}
|
|
12
|
-
var getWorkflowsEnv = (key) => {
|
|
13
|
-
return config.config[key];
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
config,
|
|
18
|
-
setWorkflowsConfig,
|
|
19
|
-
getWorkflowsEnv
|
|
20
|
-
};
|
package/dist/chunk-EACC5D4G.mjs
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
// src/tests/selectors.ts
|
|
4
|
-
var WORKFLOWS_TEST_SELECTORS = {
|
|
5
|
-
views: {
|
|
6
|
-
workflows: {
|
|
7
|
-
creator: {
|
|
8
|
-
navbar: {
|
|
9
|
-
activateSwitch: "activate-switch",
|
|
10
|
-
publishButton: "publish-btn",
|
|
11
|
-
editButton: "edit-btn"
|
|
12
|
-
},
|
|
13
|
-
builder: {
|
|
14
|
-
nodes: {
|
|
15
|
-
add: {
|
|
16
|
-
task: {
|
|
17
|
-
button: "add-task-btn"
|
|
18
|
-
},
|
|
19
|
-
trigger: {
|
|
20
|
-
button: "add-trigger-btn"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
forms: {
|
|
25
|
-
integrations: {
|
|
26
|
-
text: {
|
|
27
|
-
info: "info-container",
|
|
28
|
-
button: "start-trial-btn"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
modals: {
|
|
34
|
-
addTask: {
|
|
35
|
-
wrapper: "add-task-modal",
|
|
36
|
-
taskCard: (key) => `task-option-${key}`,
|
|
37
|
-
taskCategoryButton: (key) => `task-category-${key}`,
|
|
38
|
-
saveButton: "save-task-btn"
|
|
39
|
-
},
|
|
40
|
-
addTrigger: {
|
|
41
|
-
wrapper: "add-trigger-modal",
|
|
42
|
-
saveButton: "save-trigger-btn",
|
|
43
|
-
triggerCard: (key) => `trigger-option-${key}`,
|
|
44
|
-
triggerCategoryButton: (key) => `trigger-category-${key}`
|
|
45
|
-
},
|
|
46
|
-
publish: {
|
|
47
|
-
wrapper: "publish-workflow-modal",
|
|
48
|
-
saveButton: "publish-workflow-btn",
|
|
49
|
-
cancelButton: "cancel-publish-btn"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
panels: {
|
|
53
|
-
element: {
|
|
54
|
-
wrapper: "element-wrapper"
|
|
55
|
-
},
|
|
56
|
-
details: {
|
|
57
|
-
executions: {
|
|
58
|
-
list: {
|
|
59
|
-
row: "execution-row",
|
|
60
|
-
status: "execution-status"
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
panel: {
|
|
64
|
-
historyTab: "history-tab"
|
|
65
|
-
},
|
|
66
|
-
info: {
|
|
67
|
-
dateCreated: "date-created",
|
|
68
|
-
dateUpdated: "date-updated",
|
|
69
|
-
completedCycles: "completed-cycles",
|
|
70
|
-
failedCycles: "failed-cycles"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
list: {
|
|
76
|
-
grid: {
|
|
77
|
-
table: {
|
|
78
|
-
wrapper: "workflows-table",
|
|
79
|
-
body: "workflows-table-body",
|
|
80
|
-
menuTrigger: "action-menu-trigger",
|
|
81
|
-
activateSwitch: "activate-switch",
|
|
82
|
-
infoButton: "info-btn",
|
|
83
|
-
workflowItem: (id) => `workflow-item-${id}`
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
view: {
|
|
87
|
-
createButton: "create-workflow-btn",
|
|
88
|
-
emptyInfo: "empty-info"
|
|
89
|
-
},
|
|
90
|
-
modals: {
|
|
91
|
-
create: {
|
|
92
|
-
wrapper: "create-workflow-modal"
|
|
93
|
-
},
|
|
94
|
-
previewTemplate: {
|
|
95
|
-
wrapper: "template-preview-modal",
|
|
96
|
-
useButton: "use-template-btn"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
home: {
|
|
100
|
-
cards: {
|
|
101
|
-
template: {
|
|
102
|
-
wrapper: "template-card"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export {
|
|
112
|
-
WORKFLOWS_TEST_SELECTORS
|
|
113
|
-
};
|