@livechat/platform-workflows 0.0.50 → 0.0.52
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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +538 -462
- package/dist/index.mjs +531 -461
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -484,20 +484,22 @@ module.exports = __toCommonJS(src_exports);
|
|
|
484
484
|
|
|
485
485
|
// src/config.ts
|
|
486
486
|
var import_developer_studio_ui_react = require("@livechat/developer-studio-ui-react");
|
|
487
|
-
var
|
|
487
|
+
var configBase = {
|
|
488
488
|
env: "labs"
|
|
489
489
|
};
|
|
490
|
+
var config = getWorkflowsConfig(configBase);
|
|
490
491
|
function setWorkflowsConfig(newConfig) {
|
|
491
|
-
|
|
492
|
+
configBase = __spreadValues(__spreadValues({}, configBase), newConfig);
|
|
492
493
|
(0, import_developer_studio_ui_react.setConfig)({
|
|
493
|
-
env:
|
|
494
|
-
basePath:
|
|
494
|
+
env: configBase.env,
|
|
495
|
+
basePath: configBase.basePath
|
|
495
496
|
});
|
|
497
|
+
config = getWorkflowsConfig(configBase);
|
|
496
498
|
}
|
|
497
|
-
function getWorkflowsConfig() {
|
|
498
|
-
const isProd =
|
|
499
|
-
const coreConfig = (0, import_developer_studio_ui_react.getConfig)();
|
|
500
|
-
return __spreadProps(__spreadValues(__spreadValues({}, coreConfig),
|
|
499
|
+
function getWorkflowsConfig(base) {
|
|
500
|
+
const isProd = base.env === "prod";
|
|
501
|
+
const coreConfig = (0, import_developer_studio_ui_react.getConfig)(base);
|
|
502
|
+
return __spreadProps(__spreadValues(__spreadValues({}, coreConfig), configBase), {
|
|
501
503
|
// Authorization
|
|
502
504
|
accountsClientId: isProd ? "381b682538d896b6a25f54caf1805650" : "bc52b2c51dc4a5c2491ca49eaa7354d0",
|
|
503
505
|
// Workflows
|
|
@@ -510,7 +512,7 @@ function getWorkflowsConfig() {
|
|
|
510
512
|
});
|
|
511
513
|
}
|
|
512
514
|
var getWorkflowsEnv = (key) => {
|
|
513
|
-
return
|
|
515
|
+
return config[key];
|
|
514
516
|
};
|
|
515
517
|
|
|
516
518
|
// ../../../node_modules/.pnpm/@emotion+react@11.13.3_@types+react@18.2.5_react@18.2.0/node_modules/@emotion/react/dist/emotion-element-b4c8b265.esm.js
|
|
@@ -1858,7 +1860,7 @@ var LoginError_default = LoginErrorPage;
|
|
|
1858
1860
|
var import_react_router_dom27 = require("react-router-dom");
|
|
1859
1861
|
|
|
1860
1862
|
// src/views/Flows/Definitions/index.tsx
|
|
1861
|
-
var
|
|
1863
|
+
var import_react108 = require("react");
|
|
1862
1864
|
var import_react_router_dom25 = require("react-router-dom");
|
|
1863
1865
|
var import_developer_studio_ui_react44 = require("@livechat/developer-studio-ui-react");
|
|
1864
1866
|
|
|
@@ -1993,7 +1995,7 @@ var PRODUCT_NAMES = {
|
|
|
1993
1995
|
};
|
|
1994
1996
|
|
|
1995
1997
|
// src/views/Flows/Definitions/Mocks/System/index.ts
|
|
1996
|
-
var systemTaskConfigs = {
|
|
1998
|
+
var systemTaskConfigs = () => ({
|
|
1997
1999
|
[import_developer_studio_api2.WorkflowDefinitionTaskType.http]: {
|
|
1998
2000
|
key: import_developer_studio_api2.WorkflowDefinitionTaskType.http,
|
|
1999
2001
|
type: "other",
|
|
@@ -2064,7 +2066,7 @@ var systemTaskConfigs = {
|
|
|
2064
2066
|
},
|
|
2065
2067
|
specification: {}
|
|
2066
2068
|
}
|
|
2067
|
-
};
|
|
2069
|
+
});
|
|
2068
2070
|
var workflowForkTask = {
|
|
2069
2071
|
name: "fork",
|
|
2070
2072
|
type: "FORK_JOIN",
|
|
@@ -2122,7 +2124,7 @@ var workflowHttpTask = {
|
|
|
2122
2124
|
}
|
|
2123
2125
|
}
|
|
2124
2126
|
};
|
|
2125
|
-
var systemTaskTemplates = {
|
|
2127
|
+
var systemTaskTemplates = () => ({
|
|
2126
2128
|
[import_developer_studio_api2.WorkflowDefinitionTaskType.http]: workflowHttpTask,
|
|
2127
2129
|
[import_developer_studio_api2.WorkflowDefinitionTaskType.switch]: workflowSwitchTask,
|
|
2128
2130
|
[import_developer_studio_api2.WorkflowDefinitionTaskType.forkJoin]: workflowForkTask,
|
|
@@ -2132,8 +2134,8 @@ var systemTaskTemplates = {
|
|
|
2132
2134
|
[import_developer_studio_api2.WorkflowDefinitionTaskType.addNode]: workflowAddNodeTask,
|
|
2133
2135
|
[import_developer_studio_api2.WorkflowDefinitionTaskType.addTrigger]: workflowAddTriggerTask,
|
|
2134
2136
|
[import_developer_studio_api2.WorkflowDefinitionTaskType.trigger]: workflowTriggerTask
|
|
2135
|
-
};
|
|
2136
|
-
var systemTriggerConfigs = {
|
|
2137
|
+
});
|
|
2138
|
+
var systemTriggerConfigs = () => ({
|
|
2137
2139
|
["scheduled" /* Scheduled */]: {
|
|
2138
2140
|
key: "scheduled" /* Scheduled */,
|
|
2139
2141
|
type: "system",
|
|
@@ -2173,8 +2175,8 @@ var systemTriggerConfigs = {
|
|
|
2173
2175
|
output: {}
|
|
2174
2176
|
}
|
|
2175
2177
|
}
|
|
2176
|
-
};
|
|
2177
|
-
var systemTriggerTemplates = {
|
|
2178
|
+
});
|
|
2179
|
+
var systemTriggerTemplates = () => ({
|
|
2178
2180
|
["manual" /* Manual */]: {
|
|
2179
2181
|
type: "manual_only"
|
|
2180
2182
|
},
|
|
@@ -2182,7 +2184,7 @@ var systemTriggerTemplates = {
|
|
|
2182
2184
|
type: "recurring",
|
|
2183
2185
|
schedule: "* * * * *"
|
|
2184
2186
|
}
|
|
2185
|
-
};
|
|
2187
|
+
});
|
|
2186
2188
|
|
|
2187
2189
|
// src/views/Flows/Definitions/Mocks/BigCommerce/index.ts
|
|
2188
2190
|
var bigCommerceProductBody = {
|
|
@@ -2520,7 +2522,7 @@ var bigCommerceCustomerResponse = {
|
|
|
2520
2522
|
}
|
|
2521
2523
|
}
|
|
2522
2524
|
};
|
|
2523
|
-
var bigCommerceTaskConfigs = {
|
|
2525
|
+
var bigCommerceTaskConfigs = () => ({
|
|
2524
2526
|
["BIGCOMMERCE_CREATE_BLOG_POST" /* CreateBlogPost */]: {
|
|
2525
2527
|
key: "BIGCOMMERCE_CREATE_BLOG_POST" /* CreateBlogPost */,
|
|
2526
2528
|
type: import_developer_studio_api3.WorkflowDefinitionTaskType.http,
|
|
@@ -2886,8 +2888,8 @@ var bigCommerceTaskConfigs = {
|
|
|
2886
2888
|
})
|
|
2887
2889
|
}
|
|
2888
2890
|
}
|
|
2889
|
-
};
|
|
2890
|
-
var bigCommerceTaskTemplates = {
|
|
2891
|
+
});
|
|
2892
|
+
var bigCommerceTaskTemplates = () => ({
|
|
2891
2893
|
["BIGCOMMERCE_CREATE_BLOG_POST" /* CreateBlogPost */]: __spreadProps(__spreadValues({}, workflowHttpTask), {
|
|
2892
2894
|
name: "BIGCOMMERCE_CREATE_BLOG_POST" /* CreateBlogPost */,
|
|
2893
2895
|
taskReferenceName: "bigcommerce_create_blog_post",
|
|
@@ -3055,7 +3057,7 @@ var bigCommerceTaskTemplates = {
|
|
|
3055
3057
|
})
|
|
3056
3058
|
})
|
|
3057
3059
|
})
|
|
3058
|
-
};
|
|
3060
|
+
});
|
|
3059
3061
|
var BigCommerceTriggerNames = {
|
|
3060
3062
|
CartCreated: `${import_developer_studio_api3.IntegrationNames.BigCommerce}-${import_developer_studio_api3.BigCommerceEventNames.CartCreated}`,
|
|
3061
3063
|
CartUpdated: `${import_developer_studio_api3.IntegrationNames.BigCommerce}-${import_developer_studio_api3.BigCommerceEventNames.CartUpdated}`,
|
|
@@ -3064,7 +3066,7 @@ var BigCommerceTriggerNames = {
|
|
|
3064
3066
|
ProductCreated: `${import_developer_studio_api3.IntegrationNames.BigCommerce}-${import_developer_studio_api3.BigCommerceEventNames.ProductCreated}`,
|
|
3065
3067
|
ProductUpdated: `${import_developer_studio_api3.IntegrationNames.BigCommerce}-${import_developer_studio_api3.BigCommerceEventNames.ProductUpdated}`
|
|
3066
3068
|
};
|
|
3067
|
-
var bigcommerceTriggerConfigs = {
|
|
3069
|
+
var bigcommerceTriggerConfigs = () => ({
|
|
3068
3070
|
[BigCommerceTriggerNames.CartCreated]: {
|
|
3069
3071
|
key: BigCommerceTriggerNames.CartCreated,
|
|
3070
3072
|
name: import_developer_studio_api3.BigCommerceEventNames.CartCreated,
|
|
@@ -3221,8 +3223,8 @@ var bigcommerceTriggerConfigs = {
|
|
|
3221
3223
|
}
|
|
3222
3224
|
}
|
|
3223
3225
|
}
|
|
3224
|
-
};
|
|
3225
|
-
var bigcommerceTriggerTemplates = {
|
|
3226
|
+
});
|
|
3227
|
+
var bigcommerceTriggerTemplates = () => ({
|
|
3226
3228
|
[BigCommerceTriggerNames.CartCreated]: {
|
|
3227
3229
|
type: "webhook",
|
|
3228
3230
|
webhook: {
|
|
@@ -3325,7 +3327,7 @@ var bigcommerceTriggerTemplates = {
|
|
|
3325
3327
|
}
|
|
3326
3328
|
}
|
|
3327
3329
|
}
|
|
3328
|
-
};
|
|
3330
|
+
});
|
|
3329
3331
|
|
|
3330
3332
|
// src/views/Flows/Definitions/Mocks/HelpDesk/index.ts
|
|
3331
3333
|
var import_developer_studio_api4 = require("@livechat/developer-studio-api");
|
|
@@ -3481,7 +3483,7 @@ var helpdeskTicketInput = {
|
|
|
3481
3483
|
title: "Transaction ID"
|
|
3482
3484
|
}
|
|
3483
3485
|
};
|
|
3484
|
-
var helpdeskTaskConfigs = {
|
|
3486
|
+
var helpdeskTaskConfigs = () => ({
|
|
3485
3487
|
["HELPDESK_ADD_FOLLOWERS_TO_TICKET" /* AddFollowersToTicket */]: {
|
|
3486
3488
|
key: "HELPDESK_ADD_FOLLOWERS_TO_TICKET" /* AddFollowersToTicket */,
|
|
3487
3489
|
type: import_developer_studio_api4.WorkflowDefinitionTaskType.http,
|
|
@@ -3730,8 +3732,8 @@ var helpdeskTaskConfigs = {
|
|
|
3730
3732
|
output: helpdeskTicketResponse
|
|
3731
3733
|
}
|
|
3732
3734
|
}
|
|
3733
|
-
};
|
|
3734
|
-
var helpdeskTaskTemplates = {
|
|
3735
|
+
});
|
|
3736
|
+
var helpdeskTaskTemplates = () => ({
|
|
3735
3737
|
["HELPDESK_CREATE_TICKET" /* CreateTicket */]: __spreadProps(__spreadValues({}, workflowHttpTask), {
|
|
3736
3738
|
name: "HELPDESK_CREATE_TICKET" /* CreateTicket */,
|
|
3737
3739
|
taskReferenceName: "helpdesk_create_ticket",
|
|
@@ -3850,7 +3852,7 @@ var helpdeskTaskTemplates = {
|
|
|
3850
3852
|
})
|
|
3851
3853
|
})
|
|
3852
3854
|
})
|
|
3853
|
-
};
|
|
3855
|
+
});
|
|
3854
3856
|
|
|
3855
3857
|
// src/views/Flows/Definitions/Mocks/HubSpot/index.ts
|
|
3856
3858
|
var import_developer_studio_api5 = require("@livechat/developer-studio-api");
|
|
@@ -3887,7 +3889,7 @@ var hubspotContactBody = {
|
|
|
3887
3889
|
properties: hubspotContactProperties
|
|
3888
3890
|
}
|
|
3889
3891
|
};
|
|
3890
|
-
var hubspotTaskConfigs = {
|
|
3892
|
+
var hubspotTaskConfigs = () => ({
|
|
3891
3893
|
["HUBSPOT_CREATE_CONTACT" /* CreateContact */]: {
|
|
3892
3894
|
key: "HUBSPOT_CREATE_CONTACT" /* CreateContact */,
|
|
3893
3895
|
type: import_developer_studio_api5.WorkflowDefinitionTaskType.http,
|
|
@@ -4007,8 +4009,8 @@ var hubspotTaskConfigs = {
|
|
|
4007
4009
|
})
|
|
4008
4010
|
}
|
|
4009
4011
|
}
|
|
4010
|
-
};
|
|
4011
|
-
var hubspotTaskTemplates = {
|
|
4012
|
+
});
|
|
4013
|
+
var hubspotTaskTemplates = () => ({
|
|
4012
4014
|
["HUBSPOT_CREATE_CONTACT" /* CreateContact */]: __spreadProps(__spreadValues({}, workflowHttpTask), {
|
|
4013
4015
|
name: "HUBSPOT_CREATE_CONTACT" /* CreateContact */,
|
|
4014
4016
|
taskReferenceName: "hubspot_create_contact",
|
|
@@ -4088,12 +4090,12 @@ var hubspotTaskTemplates = {
|
|
|
4088
4090
|
})
|
|
4089
4091
|
})
|
|
4090
4092
|
})
|
|
4091
|
-
};
|
|
4093
|
+
});
|
|
4092
4094
|
var HubSpotTriggerNames = {
|
|
4093
4095
|
ContactCreated: `${import_developer_studio_api5.IntegrationNames.HubSpot}-${import_developer_studio_api5.HubspotEventNames.ContactCreated}`,
|
|
4094
4096
|
ContactDeleted: `${import_developer_studio_api5.IntegrationNames.HubSpot}-${import_developer_studio_api5.HubspotEventNames.ContactDeleted}`
|
|
4095
4097
|
};
|
|
4096
|
-
var hubspotTriggerConfigs = {
|
|
4098
|
+
var hubspotTriggerConfigs = () => ({
|
|
4097
4099
|
[HubSpotTriggerNames.ContactCreated]: {
|
|
4098
4100
|
key: HubSpotTriggerNames.ContactCreated,
|
|
4099
4101
|
name: import_developer_studio_api5.HubspotEventNames.ContactCreated,
|
|
@@ -4132,8 +4134,8 @@ var hubspotTriggerConfigs = {
|
|
|
4132
4134
|
}
|
|
4133
4135
|
}
|
|
4134
4136
|
}
|
|
4135
|
-
};
|
|
4136
|
-
var hubSpotTriggerTemplates = {
|
|
4137
|
+
});
|
|
4138
|
+
var hubSpotTriggerTemplates = () => ({
|
|
4137
4139
|
[HubSpotTriggerNames.ContactCreated]: {
|
|
4138
4140
|
type: "webhook",
|
|
4139
4141
|
webhook: {
|
|
@@ -4162,7 +4164,7 @@ var hubSpotTriggerTemplates = {
|
|
|
4162
4164
|
}
|
|
4163
4165
|
}
|
|
4164
4166
|
}
|
|
4165
|
-
};
|
|
4167
|
+
});
|
|
4166
4168
|
|
|
4167
4169
|
// src/views/Flows/Definitions/Mocks/LiveChat/index.ts
|
|
4168
4170
|
var import_developer_studio_api6 = require("@livechat/developer-studio-api");
|
|
@@ -4730,7 +4732,7 @@ var webhookSpecs = {
|
|
|
4730
4732
|
}
|
|
4731
4733
|
}
|
|
4732
4734
|
};
|
|
4733
|
-
var livechatTaskConfigs = {
|
|
4735
|
+
var livechatTaskConfigs = () => ({
|
|
4734
4736
|
["LIVECHAT_TRANSFER_CHAT" /* TransferChat */]: {
|
|
4735
4737
|
key: "LIVECHAT_TRANSFER_CHAT" /* TransferChat */,
|
|
4736
4738
|
type: import_developer_studio_api6.WorkflowDefinitionTaskType.http,
|
|
@@ -4935,8 +4937,8 @@ var livechatTaskConfigs = {
|
|
|
4935
4937
|
})
|
|
4936
4938
|
}
|
|
4937
4939
|
}
|
|
4938
|
-
};
|
|
4939
|
-
var livechatTaskTemplates = {
|
|
4940
|
+
});
|
|
4941
|
+
var livechatTaskTemplates = () => ({
|
|
4940
4942
|
["LIVECHAT_TAG_CHAT" /* TagChat */]: __spreadProps(__spreadValues({}, workflowHttpTask), {
|
|
4941
4943
|
name: "LIVECHAT_TAG_CHAT" /* TagChat */,
|
|
4942
4944
|
taskReferenceName: "livechat_tag_chat",
|
|
@@ -5034,7 +5036,7 @@ var livechatTaskTemplates = {
|
|
|
5034
5036
|
})
|
|
5035
5037
|
})
|
|
5036
5038
|
})
|
|
5037
|
-
};
|
|
5039
|
+
});
|
|
5038
5040
|
var TextLiveChatTriggerNames = {
|
|
5039
5041
|
ChatStarted: `${import_developer_studio_api6.IntegrationNames.Text}-${PRODUCT_TYPE.LC}-${import_developer_studio_api6.TextLivechatEventNames.ChatStarted}`,
|
|
5040
5042
|
ChatEnded: `${import_developer_studio_api6.IntegrationNames.Text}-${PRODUCT_TYPE.LC}-${import_developer_studio_api6.TextLivechatEventNames.ChatEnded}`,
|
|
@@ -5046,7 +5048,7 @@ var TextLiveChatTriggerNames = {
|
|
|
5046
5048
|
UserAddedToChat: `${import_developer_studio_api6.IntegrationNames.Text}-${PRODUCT_TYPE.LC}-${import_developer_studio_api6.TextLivechatEventNames.UserAddedToChat}`,
|
|
5047
5049
|
UserRemovedFromChat: `${import_developer_studio_api6.IntegrationNames.Text}-${PRODUCT_TYPE.LC}-${import_developer_studio_api6.TextLivechatEventNames.UserRemovedFromChat}`
|
|
5048
5050
|
};
|
|
5049
|
-
var livechatTriggerConfigs = {
|
|
5051
|
+
var livechatTriggerConfigs = () => ({
|
|
5050
5052
|
[TextLiveChatTriggerNames.ChatStarted]: {
|
|
5051
5053
|
key: TextLiveChatTriggerNames.ChatStarted,
|
|
5052
5054
|
name: import_developer_studio_api6.TextLivechatEventNames.ChatStarted,
|
|
@@ -5208,8 +5210,8 @@ var livechatTriggerConfigs = {
|
|
|
5208
5210
|
output: webhookSpecs.chat_tagged.output
|
|
5209
5211
|
}
|
|
5210
5212
|
}
|
|
5211
|
-
};
|
|
5212
|
-
var livechatTriggerTemplates = {
|
|
5213
|
+
});
|
|
5214
|
+
var livechatTriggerTemplates = () => ({
|
|
5213
5215
|
[TextLiveChatTriggerNames.ChatEnded]: {
|
|
5214
5216
|
type: "webhook",
|
|
5215
5217
|
webhook: {
|
|
@@ -5322,7 +5324,7 @@ var livechatTriggerTemplates = {
|
|
|
5322
5324
|
}
|
|
5323
5325
|
}
|
|
5324
5326
|
}
|
|
5325
|
-
};
|
|
5327
|
+
});
|
|
5326
5328
|
|
|
5327
5329
|
// src/views/Flows/Definitions/Mocks/MailChimp/index.ts
|
|
5328
5330
|
var import_developer_studio_api7 = require("@livechat/developer-studio-api");
|
|
@@ -5508,7 +5510,7 @@ var webhookSpecs2 = {
|
|
|
5508
5510
|
}
|
|
5509
5511
|
}
|
|
5510
5512
|
};
|
|
5511
|
-
var mailchimpTaskConfigs = {
|
|
5513
|
+
var mailchimpTaskConfigs = () => ({
|
|
5512
5514
|
["MAILCHIMP_ADD_SUBSCRIBER" /* AddSubscriber */]: {
|
|
5513
5515
|
key: "MAILCHIMP_ADD_SUBSCRIBER" /* AddSubscriber */,
|
|
5514
5516
|
type: import_developer_studio_api7.WorkflowDefinitionTaskType.http,
|
|
@@ -6573,8 +6575,8 @@ var mailchimpTaskConfigs = {
|
|
|
6573
6575
|
})
|
|
6574
6576
|
}
|
|
6575
6577
|
}
|
|
6576
|
-
};
|
|
6577
|
-
var mailchimpTaskTemplates = {
|
|
6578
|
+
});
|
|
6579
|
+
var mailchimpTaskTemplates = () => ({
|
|
6578
6580
|
["MAILCHIMP_ADD_SUBSCRIBER" /* AddSubscriber */]: __spreadProps(__spreadValues({}, workflowHttpTask), {
|
|
6579
6581
|
name: "MAILCHIMP_ADD_SUBSCRIBER" /* AddSubscriber */,
|
|
6580
6582
|
taskReferenceName: "mailchimp_add_contact",
|
|
@@ -6885,12 +6887,12 @@ var mailchimpTaskTemplates = {
|
|
|
6885
6887
|
})
|
|
6886
6888
|
})
|
|
6887
6889
|
})
|
|
6888
|
-
};
|
|
6890
|
+
});
|
|
6889
6891
|
var MailchimpTriggerNames = {
|
|
6890
6892
|
Subscribed: `${import_developer_studio_api7.IntegrationNames.Mailchimp}-${import_developer_studio_api7.MailchimpEventNames.Subscribed}`,
|
|
6891
6893
|
Unsubscribed: `${import_developer_studio_api7.IntegrationNames.Mailchimp}-${import_developer_studio_api7.MailchimpEventNames.Unsubscribed}`
|
|
6892
6894
|
};
|
|
6893
|
-
var mailchimpTriggerConfigs = {
|
|
6895
|
+
var mailchimpTriggerConfigs = () => ({
|
|
6894
6896
|
[MailchimpTriggerNames.Subscribed]: {
|
|
6895
6897
|
key: MailchimpTriggerNames.Subscribed,
|
|
6896
6898
|
name: import_developer_studio_api7.MailchimpEventNames.Subscribed,
|
|
@@ -6945,8 +6947,8 @@ var mailchimpTriggerConfigs = {
|
|
|
6945
6947
|
output: webhookSpecs2.new_unsubscriber.output
|
|
6946
6948
|
}
|
|
6947
6949
|
}
|
|
6948
|
-
};
|
|
6949
|
-
var mailchimpTriggerTemplates = {
|
|
6950
|
+
});
|
|
6951
|
+
var mailchimpTriggerTemplates = () => ({
|
|
6950
6952
|
[MailchimpTriggerNames.Subscribed]: {
|
|
6951
6953
|
type: "webhook",
|
|
6952
6954
|
webhook: {
|
|
@@ -6983,11 +6985,11 @@ var mailchimpTriggerTemplates = {
|
|
|
6983
6985
|
}
|
|
6984
6986
|
}
|
|
6985
6987
|
}
|
|
6986
|
-
};
|
|
6988
|
+
});
|
|
6987
6989
|
|
|
6988
6990
|
// src/views/Flows/Definitions/Mocks/OpenAI/index.ts
|
|
6989
6991
|
var import_developer_studio_api8 = require("@livechat/developer-studio-api");
|
|
6990
|
-
var openAiTaskConfigs = {
|
|
6992
|
+
var openAiTaskConfigs = () => ({
|
|
6991
6993
|
["OPENAI_EXTRACT_ORDER_REQUEST" /* ExtractOrderRequest */]: {
|
|
6992
6994
|
key: "OPENAI_EXTRACT_ORDER_REQUEST" /* ExtractOrderRequest */,
|
|
6993
6995
|
type: import_developer_studio_api8.WorkflowDefinitionTaskType.http,
|
|
@@ -7228,8 +7230,8 @@ var openAiTaskConfigs = {
|
|
|
7228
7230
|
})
|
|
7229
7231
|
}
|
|
7230
7232
|
}
|
|
7231
|
-
};
|
|
7232
|
-
var openAiTaskTemplates = {
|
|
7233
|
+
});
|
|
7234
|
+
var openAiTaskTemplates = () => ({
|
|
7233
7235
|
["OPENAI_EXTRACT_ORDER_REQUEST" /* ExtractOrderRequest */]: __spreadProps(__spreadValues({}, workflowHttpTask), {
|
|
7234
7236
|
name: "OPENAI_EXTRACT_ORDER_REQUEST" /* ExtractOrderRequest */,
|
|
7235
7237
|
taskReferenceName: "openai_extract_order_request",
|
|
@@ -7319,7 +7321,7 @@ var openAiTaskTemplates = {
|
|
|
7319
7321
|
})
|
|
7320
7322
|
})
|
|
7321
7323
|
})
|
|
7322
|
-
};
|
|
7324
|
+
});
|
|
7323
7325
|
|
|
7324
7326
|
// src/views/Flows/Definitions/Mocks/Shopify/index.ts
|
|
7325
7327
|
var import_developer_studio_api9 = require("@livechat/developer-studio-api");
|
|
@@ -7742,7 +7744,7 @@ var webhookSpecs3 = {
|
|
|
7742
7744
|
}
|
|
7743
7745
|
}
|
|
7744
7746
|
};
|
|
7745
|
-
var shopifyTaskConfigs = {
|
|
7747
|
+
var shopifyTaskConfigs = () => ({
|
|
7746
7748
|
["SHOPIFY_CREATE_CUSTOMER" /* CreateCustomer */]: {
|
|
7747
7749
|
key: "SHOPIFY_CREATE_CUSTOMER" /* CreateCustomer */,
|
|
7748
7750
|
type: import_developer_studio_api9.WorkflowDefinitionTaskType.http,
|
|
@@ -7772,9 +7774,7 @@ var shopifyTaskConfigs = {
|
|
|
7772
7774
|
["SHOPIFY_CREATE_ORDER" /* CreateOrder */]: {
|
|
7773
7775
|
key: "SHOPIFY_CREATE_ORDER" /* CreateOrder */,
|
|
7774
7776
|
type: import_developer_studio_api9.WorkflowDefinitionTaskType.http,
|
|
7775
|
-
url: `${getWorkflowsEnv(
|
|
7776
|
-
"workflowsApiUr"
|
|
7777
|
-
)}/functions/create-shopify-order`,
|
|
7777
|
+
url: `${getWorkflowsEnv("workflowsApiUr")}/functions/create-shopify-order`,
|
|
7778
7778
|
customization: {
|
|
7779
7779
|
provider: import_developer_studio_api9.IntegrationNames.Shopify,
|
|
7780
7780
|
product: import_developer_studio_api9.IntegrationDisplayNames.Shopify,
|
|
@@ -7872,9 +7872,7 @@ var shopifyTaskConfigs = {
|
|
|
7872
7872
|
["SHOPIFY_GET_CUSTOMER" /* GetCustomer */]: {
|
|
7873
7873
|
key: "SHOPIFY_GET_CUSTOMER" /* GetCustomer */,
|
|
7874
7874
|
type: import_developer_studio_api9.WorkflowDefinitionTaskType.http,
|
|
7875
|
-
url: `${getWorkflowsEnv(
|
|
7876
|
-
"workflowsApiUr"
|
|
7877
|
-
)}/functions/get-shopify-customer`,
|
|
7875
|
+
url: `${getWorkflowsEnv("workflowsApiUr")}/functions/get-shopify-customer`,
|
|
7878
7876
|
customization: {
|
|
7879
7877
|
provider: import_developer_studio_api9.IntegrationNames.Shopify,
|
|
7880
7878
|
product: import_developer_studio_api9.IntegrationDisplayNames.Shopify,
|
|
@@ -8101,9 +8099,7 @@ var shopifyTaskConfigs = {
|
|
|
8101
8099
|
["SHOPIFY_UPDATE_ORDER" /* UpdateOrder */]: {
|
|
8102
8100
|
type: import_developer_studio_api9.WorkflowDefinitionTaskType.http,
|
|
8103
8101
|
key: "SHOPIFY_UPDATE_ORDER" /* UpdateOrder */,
|
|
8104
|
-
url: `${getWorkflowsEnv(
|
|
8105
|
-
"workflowsApiUr"
|
|
8106
|
-
)}/functions/update-shopify-order`,
|
|
8102
|
+
url: `${getWorkflowsEnv("workflowsApiUr")}/functions/update-shopify-order`,
|
|
8107
8103
|
customization: {
|
|
8108
8104
|
provider: import_developer_studio_api9.IntegrationNames.Shopify,
|
|
8109
8105
|
product: import_developer_studio_api9.IntegrationDisplayNames.Shopify,
|
|
@@ -8198,8 +8194,8 @@ var shopifyTaskConfigs = {
|
|
|
8198
8194
|
})
|
|
8199
8195
|
}
|
|
8200
8196
|
}
|
|
8201
|
-
};
|
|
8202
|
-
var shopifyTaskTemplates = {
|
|
8197
|
+
});
|
|
8198
|
+
var shopifyTaskTemplates = () => ({
|
|
8203
8199
|
["SHOPIFY_CREATE_CUSTOMER" /* CreateCustomer */]: __spreadProps(__spreadValues({}, workflowHttpTask), {
|
|
8204
8200
|
name: "SHOPIFY_CREATE_CUSTOMER" /* CreateCustomer */,
|
|
8205
8201
|
taskReferenceName: "shopify_create_customer",
|
|
@@ -8477,11 +8473,11 @@ var shopifyTaskTemplates = {
|
|
|
8477
8473
|
})
|
|
8478
8474
|
})
|
|
8479
8475
|
})
|
|
8480
|
-
};
|
|
8476
|
+
});
|
|
8481
8477
|
var ShopifyTriggerNames = {
|
|
8482
8478
|
OrderCreated: `${import_developer_studio_api9.IntegrationNames.Shopify}-${import_developer_studio_api9.ShopifyEventNames.OrderCreated}`
|
|
8483
8479
|
};
|
|
8484
|
-
var shopifyTriggerConfigs = {
|
|
8480
|
+
var shopifyTriggerConfigs = () => ({
|
|
8485
8481
|
[ShopifyTriggerNames.OrderCreated]: {
|
|
8486
8482
|
key: ShopifyTriggerNames.OrderCreated,
|
|
8487
8483
|
name: import_developer_studio_api9.ShopifyEventNames.OrderCreated,
|
|
@@ -8498,8 +8494,8 @@ var shopifyTriggerConfigs = {
|
|
|
8498
8494
|
output: webhookSpecs3.new_paid_order.output
|
|
8499
8495
|
}
|
|
8500
8496
|
}
|
|
8501
|
-
};
|
|
8502
|
-
var shopifyTriggerTemplates = {
|
|
8497
|
+
});
|
|
8498
|
+
var shopifyTriggerTemplates = () => ({
|
|
8503
8499
|
[ShopifyTriggerNames.OrderCreated]: {
|
|
8504
8500
|
type: "webhook",
|
|
8505
8501
|
webhook: {
|
|
@@ -8515,33 +8511,49 @@ var shopifyTriggerTemplates = {
|
|
|
8515
8511
|
}
|
|
8516
8512
|
}
|
|
8517
8513
|
}
|
|
8518
|
-
};
|
|
8514
|
+
});
|
|
8519
8515
|
|
|
8520
8516
|
// src/views/Flows/Definitions/api.mocks.ts
|
|
8521
|
-
var
|
|
8522
|
-
|
|
8523
|
-
|
|
8517
|
+
var WorkflowItemsConfiguration = class {
|
|
8518
|
+
constructor() {
|
|
8519
|
+
this.configs = getWorkflowItemConfigs();
|
|
8520
|
+
this.templates = getWorkflowItemTemplates();
|
|
8521
|
+
}
|
|
8522
|
+
static get config() {
|
|
8523
|
+
const instance = this._instance || (this._instance = new this());
|
|
8524
|
+
return instance.configs;
|
|
8525
|
+
}
|
|
8526
|
+
static get templates() {
|
|
8527
|
+
const instance = this._instance || (this._instance = new this());
|
|
8528
|
+
return instance.templates;
|
|
8529
|
+
}
|
|
8524
8530
|
};
|
|
8525
|
-
var
|
|
8531
|
+
var getWorkflowItemConfigs = () => {
|
|
8532
|
+
return {
|
|
8533
|
+
tasks: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, livechatTaskConfigs()), helpdeskTaskConfigs()), mailchimpTaskConfigs()), shopifyTaskConfigs()), hubspotTaskConfigs()), bigCommerceTaskConfigs()), openAiTaskConfigs()), systemTaskConfigs()),
|
|
8534
|
+
triggers: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, livechatTriggerConfigs()), mailchimpTriggerConfigs()), shopifyTriggerConfigs()), hubspotTriggerConfigs()), bigcommerceTriggerConfigs()), systemTriggerConfigs())
|
|
8535
|
+
};
|
|
8536
|
+
};
|
|
8537
|
+
var getWorkflowItemTemplates = () => ({
|
|
8526
8538
|
tasks: {
|
|
8527
|
-
livechat: livechatTaskTemplates,
|
|
8528
|
-
helpdesk: helpdeskTaskTemplates,
|
|
8529
|
-
mailchimp: mailchimpTaskTemplates,
|
|
8530
|
-
hubspot: hubspotTaskTemplates,
|
|
8531
|
-
bigcommerce: bigCommerceTaskTemplates,
|
|
8532
|
-
shopify: shopifyTaskTemplates,
|
|
8533
|
-
openai: openAiTaskTemplates,
|
|
8534
|
-
system: systemTaskTemplates
|
|
8539
|
+
livechat: livechatTaskTemplates(),
|
|
8540
|
+
helpdesk: helpdeskTaskTemplates(),
|
|
8541
|
+
mailchimp: mailchimpTaskTemplates(),
|
|
8542
|
+
hubspot: hubspotTaskTemplates(),
|
|
8543
|
+
bigcommerce: bigCommerceTaskTemplates(),
|
|
8544
|
+
shopify: shopifyTaskTemplates(),
|
|
8545
|
+
openai: openAiTaskTemplates(),
|
|
8546
|
+
system: systemTaskTemplates()
|
|
8535
8547
|
},
|
|
8536
8548
|
triggers: {
|
|
8537
|
-
livechat: livechatTriggerTemplates,
|
|
8538
|
-
mailchimp: mailchimpTriggerTemplates,
|
|
8539
|
-
shopify: shopifyTriggerTemplates,
|
|
8540
|
-
hubspot: hubSpotTriggerTemplates,
|
|
8541
|
-
bigcommerce: bigcommerceTriggerTemplates,
|
|
8542
|
-
system: systemTriggerTemplates
|
|
8549
|
+
livechat: livechatTriggerTemplates(),
|
|
8550
|
+
mailchimp: mailchimpTriggerTemplates(),
|
|
8551
|
+
shopify: shopifyTriggerTemplates(),
|
|
8552
|
+
hubspot: hubSpotTriggerTemplates(),
|
|
8553
|
+
bigcommerce: bigcommerceTriggerTemplates(),
|
|
8554
|
+
system: systemTriggerTemplates()
|
|
8543
8555
|
}
|
|
8544
|
-
};
|
|
8556
|
+
});
|
|
8545
8557
|
|
|
8546
8558
|
// src/views/Flows/Definitions/Common/Builder/config/workflow.ts
|
|
8547
8559
|
var NEW_WORKFLOW_TEMPLATE = {
|
|
@@ -8692,9 +8704,40 @@ var WORKFLOW_TERMINATE_TASK_SCHEMA = {
|
|
|
8692
8704
|
}
|
|
8693
8705
|
}
|
|
8694
8706
|
};
|
|
8695
|
-
var
|
|
8707
|
+
var WORKFLOW_SCHEMA_DEFS = {
|
|
8708
|
+
$defs: {
|
|
8709
|
+
mailchimp_audience: {
|
|
8710
|
+
"x-ref": {
|
|
8711
|
+
request: {
|
|
8712
|
+
url: "http://${credential.server}.mailchimp.com/api/audience",
|
|
8713
|
+
method: "GET",
|
|
8714
|
+
headers: {
|
|
8715
|
+
authorization: "${credential.token}"
|
|
8716
|
+
},
|
|
8717
|
+
body: {}
|
|
8718
|
+
},
|
|
8719
|
+
displayField: "name",
|
|
8720
|
+
valueField: "id"
|
|
8721
|
+
}
|
|
8722
|
+
},
|
|
8723
|
+
mailchimp_campaign: {
|
|
8724
|
+
"x-ref": {
|
|
8725
|
+
request: {
|
|
8726
|
+
url: "http://${credential.server}.mailchimp.com/api/campaign",
|
|
8727
|
+
method: "GET",
|
|
8728
|
+
headers: {
|
|
8729
|
+
authorization: "${credential.token}"
|
|
8730
|
+
},
|
|
8731
|
+
body: {}
|
|
8732
|
+
},
|
|
8733
|
+
displayField: "name",
|
|
8734
|
+
valueField: "id"
|
|
8735
|
+
}
|
|
8736
|
+
}
|
|
8737
|
+
}
|
|
8738
|
+
};
|
|
8739
|
+
var WORKFLOW_SCHEMA = () => ({
|
|
8696
8740
|
$schema: "http://json-schema.org/draft-07/schema",
|
|
8697
|
-
$id: "http://example.com/example.json",
|
|
8698
8741
|
type: "object",
|
|
8699
8742
|
title: "The root schema",
|
|
8700
8743
|
description: "The root schema comprises the entire JSON document.",
|
|
@@ -8840,20 +8883,22 @@ var WORKFLOW_SCHEMA = {
|
|
|
8840
8883
|
},
|
|
8841
8884
|
then: WORKFLOW_HTTP_TASK_SCHEMA()
|
|
8842
8885
|
},
|
|
8843
|
-
...Object.values(
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8886
|
+
...Object.values(WorkflowItemsConfiguration.config.tasks).map(
|
|
8887
|
+
(config2) => {
|
|
8888
|
+
var _a, _b;
|
|
8889
|
+
return {
|
|
8890
|
+
if: {
|
|
8891
|
+
properties: {
|
|
8892
|
+
type: { const: import_developer_studio_api10.WorkflowDefinitionTaskType.http },
|
|
8893
|
+
name: { const: config2.key }
|
|
8894
|
+
}
|
|
8895
|
+
},
|
|
8896
|
+
then: WORKFLOW_HTTP_TASK_SCHEMA(config2.key, {
|
|
8897
|
+
body: (_b = (_a = config2.specification.input) == null ? void 0 : _a.properties) == null ? void 0 : _b.body
|
|
8898
|
+
})
|
|
8899
|
+
};
|
|
8900
|
+
}
|
|
8901
|
+
)
|
|
8857
8902
|
]
|
|
8858
8903
|
}
|
|
8859
8904
|
},
|
|
@@ -8941,92 +8986,65 @@ var WORKFLOW_SCHEMA = {
|
|
|
8941
8986
|
description: "This object holds the declaration of your workflow trigger.",
|
|
8942
8987
|
default: {},
|
|
8943
8988
|
allOf: [
|
|
8944
|
-
...Object.values(
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
8989
|
+
...Object.values(WorkflowItemsConfiguration.config.triggers).map(
|
|
8990
|
+
(config2) => {
|
|
8991
|
+
var _a, _b;
|
|
8992
|
+
if (config2.type === "webhook") {
|
|
8993
|
+
return {
|
|
8994
|
+
if: {
|
|
8995
|
+
properties: {
|
|
8996
|
+
type: { const: config2.type }
|
|
8997
|
+
}
|
|
8998
|
+
},
|
|
8999
|
+
then: {
|
|
9000
|
+
required: ["type", "webhook"],
|
|
9001
|
+
properties: {
|
|
9002
|
+
type: { const: "webhook" },
|
|
9003
|
+
webhook: {
|
|
9004
|
+
if: {
|
|
9005
|
+
properties: {
|
|
9006
|
+
source: { const: config2.customization.provider }
|
|
9007
|
+
}
|
|
9008
|
+
},
|
|
9009
|
+
then: {
|
|
9010
|
+
required: ["source", "event", "headers"],
|
|
9011
|
+
properties: {
|
|
9012
|
+
source: { const: config2.customization.provider },
|
|
9013
|
+
event: {
|
|
9014
|
+
if: {
|
|
9015
|
+
properties: {
|
|
9016
|
+
name: { const: config2.name }
|
|
9017
|
+
}
|
|
9018
|
+
},
|
|
9019
|
+
then: (_a = config2.specification.input) != null ? _a : {}
|
|
9020
|
+
}
|
|
8974
9021
|
}
|
|
8975
9022
|
}
|
|
8976
9023
|
}
|
|
8977
9024
|
}
|
|
8978
9025
|
}
|
|
8979
|
-
}
|
|
8980
|
-
}
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
}
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
}
|
|
9026
|
+
};
|
|
9027
|
+
}
|
|
9028
|
+
if (config2.type === "system") {
|
|
9029
|
+
return {
|
|
9030
|
+
if: {
|
|
9031
|
+
properties: {
|
|
9032
|
+
type: { const: config2.type },
|
|
9033
|
+
name: { const: config2.key }
|
|
9034
|
+
}
|
|
9035
|
+
},
|
|
9036
|
+
then: (_b = config2.specification.input) != null ? _b : {}
|
|
9037
|
+
};
|
|
9038
|
+
}
|
|
9039
|
+
throw new Error("Invalid trigger type");
|
|
8992
9040
|
}
|
|
8993
|
-
|
|
8994
|
-
})
|
|
9041
|
+
)
|
|
8995
9042
|
]
|
|
8996
9043
|
}
|
|
8997
9044
|
},
|
|
8998
9045
|
required: ["definition", "trigger"],
|
|
8999
|
-
$defs:
|
|
9000
|
-
|
|
9001
|
-
"x-ref": {
|
|
9002
|
-
request: {
|
|
9003
|
-
url: "http://${credential.server}.mailchimp.com/api/audience",
|
|
9004
|
-
method: "GET",
|
|
9005
|
-
headers: {
|
|
9006
|
-
authorization: "${credential.token}"
|
|
9007
|
-
},
|
|
9008
|
-
body: {}
|
|
9009
|
-
},
|
|
9010
|
-
displayField: "name",
|
|
9011
|
-
valueField: "id"
|
|
9012
|
-
}
|
|
9013
|
-
},
|
|
9014
|
-
mailchimp_campaign: {
|
|
9015
|
-
"x-ref": {
|
|
9016
|
-
request: {
|
|
9017
|
-
url: "http://${credential.server}.mailchimp.com/api/campaign",
|
|
9018
|
-
method: "GET",
|
|
9019
|
-
headers: {
|
|
9020
|
-
authorization: "${credential.token}"
|
|
9021
|
-
},
|
|
9022
|
-
body: {}
|
|
9023
|
-
},
|
|
9024
|
-
displayField: "name",
|
|
9025
|
-
valueField: "id"
|
|
9026
|
-
}
|
|
9027
|
-
}
|
|
9028
|
-
}
|
|
9029
|
-
};
|
|
9046
|
+
$defs: WORKFLOW_SCHEMA_DEFS.$defs
|
|
9047
|
+
});
|
|
9030
9048
|
var JSON_FILE_NAME = "file:///workflow.json";
|
|
9031
9049
|
function configureMonaco(monaco) {
|
|
9032
9050
|
monaco.languages.typescript.javascriptDefaults.setEagerModelSync(true);
|
|
@@ -9043,7 +9061,7 @@ function configureMonaco(monaco) {
|
|
|
9043
9061
|
// id of the first schema
|
|
9044
9062
|
fileMatch: [modelUri.toString()],
|
|
9045
9063
|
// associate with our model
|
|
9046
|
-
schema: WORKFLOW_SCHEMA
|
|
9064
|
+
schema: WORKFLOW_SCHEMA()
|
|
9047
9065
|
}
|
|
9048
9066
|
]
|
|
9049
9067
|
});
|
|
@@ -9653,7 +9671,7 @@ var workflowBuilderUtils = {
|
|
|
9653
9671
|
return result;
|
|
9654
9672
|
},
|
|
9655
9673
|
getTaskConfig(task2) {
|
|
9656
|
-
return
|
|
9674
|
+
return WorkflowItemsConfiguration.config.tasks[task2.name];
|
|
9657
9675
|
},
|
|
9658
9676
|
getTaskConfigByReference(value) {
|
|
9659
9677
|
const segments = value.split(".");
|
|
@@ -9661,7 +9679,7 @@ var workflowBuilderUtils = {
|
|
|
9661
9679
|
return;
|
|
9662
9680
|
}
|
|
9663
9681
|
const referenceName = segments[0].split("_").slice(0, -1).join("_");
|
|
9664
|
-
const task2 = Object.values(
|
|
9682
|
+
const task2 = Object.values(WorkflowItemsConfiguration.templates).flatMap((x) => Object.values(x)).find((task3) => task3.taskReferenceName === referenceName);
|
|
9665
9683
|
if (!task2) {
|
|
9666
9684
|
return;
|
|
9667
9685
|
}
|
|
@@ -9669,9 +9687,9 @@ var workflowBuilderUtils = {
|
|
|
9669
9687
|
},
|
|
9670
9688
|
getTriggerConfig(trigger) {
|
|
9671
9689
|
if (trigger.type === "webhook" && trigger.webhook) {
|
|
9672
|
-
return
|
|
9690
|
+
return WorkflowItemsConfiguration.config.triggers[`${trigger.webhook.source}-${trigger.webhook.event.name}`];
|
|
9673
9691
|
}
|
|
9674
|
-
const triggers = Object.values(
|
|
9692
|
+
const triggers = Object.values(WorkflowItemsConfiguration.config.triggers);
|
|
9675
9693
|
switch (trigger.type) {
|
|
9676
9694
|
case "recurring":
|
|
9677
9695
|
return triggers.find((x) => x.key === "scheduled" /* Scheduled */);
|
|
@@ -9692,10 +9710,10 @@ var workflowBuilderUtils = {
|
|
|
9692
9710
|
}
|
|
9693
9711
|
};
|
|
9694
9712
|
}
|
|
9695
|
-
const
|
|
9713
|
+
const config2 = workflowBuilderUtils.getTriggerConfig({
|
|
9696
9714
|
type: "manual_only"
|
|
9697
9715
|
});
|
|
9698
|
-
return
|
|
9716
|
+
return config2;
|
|
9699
9717
|
},
|
|
9700
9718
|
getItemConfig(item) {
|
|
9701
9719
|
var _a;
|
|
@@ -10061,7 +10079,7 @@ var getWorkflowValidationErrors = (validationErrors) => {
|
|
|
10061
10079
|
return errors;
|
|
10062
10080
|
};
|
|
10063
10081
|
var getSchemaError = (workflow, frames) => {
|
|
10064
|
-
const validate = ajv.compile(WORKFLOW_SCHEMA);
|
|
10082
|
+
const validate = ajv.compile(WORKFLOW_SCHEMA());
|
|
10065
10083
|
const resolved = __spreadProps(__spreadValues({}, workflow), {
|
|
10066
10084
|
definition: __spreadProps(__spreadValues({}, workflow.definition), {
|
|
10067
10085
|
tasks: workflow.definition.tasks.map(
|
|
@@ -10090,7 +10108,7 @@ var getTasksErrors = (workflow, frames, products) => {
|
|
|
10090
10108
|
var _a;
|
|
10091
10109
|
const globalFrame = frames.global;
|
|
10092
10110
|
const frame = frames.tasks[task2.taskReferenceName];
|
|
10093
|
-
const
|
|
10111
|
+
const config2 = (_a = frame.__meta) == null ? void 0 : _a.config;
|
|
10094
10112
|
const resolvingErrors = workflowBuilderUtils.getMatchesInObject(task2).map((match2) => {
|
|
10095
10113
|
const segments = match2.rawValue.split(".");
|
|
10096
10114
|
const resolved = workflowBuilderUtils.resolveTextByContext(
|
|
@@ -10160,10 +10178,10 @@ var getTasksErrors = (workflow, frames, products) => {
|
|
|
10160
10178
|
params: {}
|
|
10161
10179
|
};
|
|
10162
10180
|
});
|
|
10163
|
-
const activationError =
|
|
10181
|
+
const activationError = config2 && config2.customization.provider.startsWith(import_developer_studio_api15.IntegrationNames.Text) && !products.find(({ product }) => product === config2.customization.product) ? {
|
|
10164
10182
|
instancePath: `/definition/tasks/${index}`,
|
|
10165
10183
|
keyword: "activation",
|
|
10166
|
-
message: `${
|
|
10184
|
+
message: `${config2.customization.product} not activated`,
|
|
10167
10185
|
params: {}
|
|
10168
10186
|
} : void 0;
|
|
10169
10187
|
return [
|
|
@@ -10176,7 +10194,7 @@ var getTasksErrors = (workflow, frames, products) => {
|
|
|
10176
10194
|
var getTriggerErrors = (workflow, frames, products) => {
|
|
10177
10195
|
var _a;
|
|
10178
10196
|
const frame = frames.trigger;
|
|
10179
|
-
const
|
|
10197
|
+
const config2 = (_a = frame == null ? void 0 : frame.__meta) == null ? void 0 : _a.config;
|
|
10180
10198
|
const resolvingErrors = workflowBuilderUtils.getMatchesInObject(workflow.trigger).map((match2) => {
|
|
10181
10199
|
const segments = match2.rawValue.split(".");
|
|
10182
10200
|
const resolved = workflowBuilderUtils.resolveTextByContext(
|
|
@@ -10224,13 +10242,12 @@ var getTriggerErrors = (workflow, frames, products) => {
|
|
|
10224
10242
|
params: {}
|
|
10225
10243
|
};
|
|
10226
10244
|
});
|
|
10227
|
-
const activationError =
|
|
10245
|
+
const activationError = config2 && config2.customization.provider.startsWith(import_developer_studio_api15.IntegrationNames.Text) && !products.find(({ product }) => product === config2.customization.product) ? {
|
|
10228
10246
|
instancePath: `/trigger`,
|
|
10229
10247
|
keyword: "activation",
|
|
10230
|
-
message: `${
|
|
10248
|
+
message: `${config2.customization.product} not activated`,
|
|
10231
10249
|
params: {}
|
|
10232
10250
|
} : void 0;
|
|
10233
|
-
console.log("activationError: ", activationError);
|
|
10234
10251
|
return [
|
|
10235
10252
|
...resolvingErrors,
|
|
10236
10253
|
...connectionErrors,
|
|
@@ -10398,11 +10415,12 @@ function WorkflowContextProviderBase({
|
|
|
10398
10415
|
updaters: { setWorkflow, setAction, setSelection }
|
|
10399
10416
|
} = useWorkflowState(workflow, options2);
|
|
10400
10417
|
const autosaveStateRef = (0, import_react8.useRef)(state);
|
|
10401
|
-
const
|
|
10418
|
+
const autosaveWorkflowRef = (0, import_react8.useRef)(
|
|
10402
10419
|
(0, import_lodash.default)(() => __async(this, null, function* () {
|
|
10403
10420
|
yield save(true);
|
|
10404
10421
|
}), 500)
|
|
10405
|
-
)
|
|
10422
|
+
);
|
|
10423
|
+
const autosaveWorkflow = autosaveWorkflowRef.current;
|
|
10406
10424
|
(0, import_react8.useEffect)(() => {
|
|
10407
10425
|
return () => {
|
|
10408
10426
|
autosaveWorkflow.cancel();
|
|
@@ -10496,16 +10514,16 @@ function WorkflowContextProviderBase({
|
|
|
10496
10514
|
const replaceWorkflow = (0, import_react8.useCallback)(
|
|
10497
10515
|
(workflow2) => {
|
|
10498
10516
|
setWorkflow(workflow2);
|
|
10499
|
-
|
|
10517
|
+
autosaveWorkflowRef.current();
|
|
10500
10518
|
},
|
|
10501
|
-
[
|
|
10519
|
+
[autosaveWorkflowRef, setWorkflow]
|
|
10502
10520
|
);
|
|
10503
10521
|
const changeWorkflow = (0, import_react8.useCallback)(
|
|
10504
10522
|
(change) => {
|
|
10505
10523
|
setWorkflow((prevState) => applyChange(prevState, change(prevState)));
|
|
10506
|
-
|
|
10524
|
+
autosaveWorkflowRef.current();
|
|
10507
10525
|
},
|
|
10508
|
-
[
|
|
10526
|
+
[autosaveWorkflowRef, setWorkflow]
|
|
10509
10527
|
);
|
|
10510
10528
|
const goToAddTrigger = (0, import_react8.useCallback)(() => {
|
|
10511
10529
|
navigate(
|
|
@@ -12577,10 +12595,10 @@ var import_developer_studio_ui_react11 = require("@livechat/developer-studio-ui-
|
|
|
12577
12595
|
function convertToTreeNode(obj, meta, nodeName, path) {
|
|
12578
12596
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
12579
12597
|
const index = (_a = obj.__meta) == null ? void 0 : _a.index;
|
|
12580
|
-
const
|
|
12598
|
+
const config2 = (_b = obj.__meta) == null ? void 0 : _b.config;
|
|
12581
12599
|
const properties = (_c = obj.__meta) == null ? void 0 : _c.properties;
|
|
12582
12600
|
const currentSpec = meta.specification;
|
|
12583
|
-
const customization =
|
|
12601
|
+
const customization = config2 == null ? void 0 : config2.customization;
|
|
12584
12602
|
const node2 = meta.dummy ? {
|
|
12585
12603
|
type: typeof obj,
|
|
12586
12604
|
name: nodeName,
|
|
@@ -12598,7 +12616,7 @@ function convertToTreeNode(obj, meta, nodeName, path) {
|
|
|
12598
12616
|
path: `${path != null ? path : ""}`,
|
|
12599
12617
|
relativePath: meta.baseRelativePath && path && path.startsWith(meta.baseRelativePath) ? path.replace(`${meta.baseRelativePath}.`, "") : "",
|
|
12600
12618
|
children: [],
|
|
12601
|
-
canAddChildren: (_g =
|
|
12619
|
+
canAddChildren: (_g = config2 == null ? void 0 : config2.specification) == null ? void 0 : _g.additionalProperties,
|
|
12602
12620
|
__meta: {
|
|
12603
12621
|
source: {
|
|
12604
12622
|
index: index != null ? index : meta.index,
|
|
@@ -12799,6 +12817,7 @@ function CustomTagsPicker({
|
|
|
12799
12817
|
|
|
12800
12818
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Input.tsx
|
|
12801
12819
|
var import_react24 = require("react");
|
|
12820
|
+
var import_lodash3 = __toESM(require("lodash.debounce"));
|
|
12802
12821
|
var import_design_system_react_components13 = require("@livechat/design-system-react-components");
|
|
12803
12822
|
|
|
12804
12823
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Tag/Icon.tsx
|
|
@@ -13070,64 +13089,64 @@ function TagifyWrapper({
|
|
|
13070
13089
|
};
|
|
13071
13090
|
}, []);
|
|
13072
13091
|
(0, import_react23.useEffect)(() => {
|
|
13073
|
-
tagify.current.off("change"
|
|
13092
|
+
tagify.current.off("change").on("change", onChange);
|
|
13074
13093
|
}, [onChange]);
|
|
13075
13094
|
(0, import_react23.useEffect)(() => {
|
|
13076
|
-
tagify.current.off("input"
|
|
13095
|
+
tagify.current.off("input").on("input", onInput);
|
|
13077
13096
|
}, [onInput]);
|
|
13078
13097
|
(0, import_react23.useEffect)(() => {
|
|
13079
|
-
tagify.current.off("add"
|
|
13098
|
+
tagify.current.off("add").on("add", onAdd);
|
|
13080
13099
|
}, [onAdd]);
|
|
13081
13100
|
(0, import_react23.useEffect)(() => {
|
|
13082
|
-
tagify.current.off("remove"
|
|
13101
|
+
tagify.current.off("remove").on("remove", onRemove);
|
|
13083
13102
|
}, [onRemove]);
|
|
13084
13103
|
(0, import_react23.useEffect)(() => {
|
|
13085
|
-
tagify.current.off("invalid"
|
|
13104
|
+
tagify.current.off("invalid").on("invalid", onInvalid);
|
|
13086
13105
|
}, [onInvalid]);
|
|
13087
13106
|
(0, import_react23.useEffect)(() => {
|
|
13088
|
-
tagify.current.off("keydown"
|
|
13107
|
+
tagify.current.off("keydown").on("keydown", onKeydown);
|
|
13089
13108
|
}, [onKeydown]);
|
|
13090
13109
|
(0, import_react23.useEffect)(() => {
|
|
13091
|
-
tagify.current.off("focus"
|
|
13110
|
+
tagify.current.off("focus").on("focus", onFocus);
|
|
13092
13111
|
}, [onFocus]);
|
|
13093
13112
|
(0, import_react23.useEffect)(() => {
|
|
13094
|
-
tagify.current.off("blur"
|
|
13113
|
+
tagify.current.off("blur").on("blur", onBlur);
|
|
13095
13114
|
}, [onBlur]);
|
|
13096
13115
|
(0, import_react23.useEffect)(() => {
|
|
13097
|
-
tagify.current.off("click"
|
|
13116
|
+
tagify.current.off("click").on("click", onClick);
|
|
13098
13117
|
}, [onClick]);
|
|
13099
13118
|
(0, import_react23.useEffect)(() => {
|
|
13100
|
-
tagify.current.off("edit:input"
|
|
13119
|
+
tagify.current.off("edit:input").on("edit:input", onEditInput);
|
|
13101
13120
|
}, [onEditInput]);
|
|
13102
13121
|
(0, import_react23.useEffect)(() => {
|
|
13103
|
-
tagify.current.off("edit:beforeUpdate"
|
|
13122
|
+
tagify.current.off("edit:beforeUpdate").on("edit:beforeUpdate", onEditBeforeUpdate);
|
|
13104
13123
|
}, [onEditBeforeUpdate]);
|
|
13105
13124
|
(0, import_react23.useEffect)(() => {
|
|
13106
|
-
tagify.current.off("edit:updated"
|
|
13125
|
+
tagify.current.off("edit:updated").on("edit:updated", onEditUpdated);
|
|
13107
13126
|
}, [onEditUpdated]);
|
|
13108
13127
|
(0, import_react23.useEffect)(() => {
|
|
13109
|
-
tagify.current.off("edit:start"
|
|
13128
|
+
tagify.current.off("edit:start").on("edit:start", onEditStart);
|
|
13110
13129
|
}, [onEditStart]);
|
|
13111
13130
|
(0, import_react23.useEffect)(() => {
|
|
13112
|
-
tagify.current.off("edit:keydown"
|
|
13131
|
+
tagify.current.off("edit:keydown").on("edit:keydown", onEditKeydown);
|
|
13113
13132
|
}, [onEditKeydown]);
|
|
13114
13133
|
(0, import_react23.useEffect)(() => {
|
|
13115
|
-
tagify.current.off("dropdown:show"
|
|
13134
|
+
tagify.current.off("dropdown:show").on("dropdown:show", onDropdownShow);
|
|
13116
13135
|
}, [onDropdownShow]);
|
|
13117
13136
|
(0, import_react23.useEffect)(() => {
|
|
13118
|
-
tagify.current.off("dropdown:hide"
|
|
13137
|
+
tagify.current.off("dropdown:hide").on("dropdown:hide", onDropdownHide);
|
|
13119
13138
|
}, [onDropdownHide]);
|
|
13120
13139
|
(0, import_react23.useEffect)(() => {
|
|
13121
|
-
tagify.current.off("dropdown:select"
|
|
13140
|
+
tagify.current.off("dropdown:select").on("dropdown:select", onDropdownSelect);
|
|
13122
13141
|
}, [onDropdownSelect]);
|
|
13123
13142
|
(0, import_react23.useEffect)(() => {
|
|
13124
|
-
tagify.current.off("dropdown:scroll"
|
|
13143
|
+
tagify.current.off("dropdown:scroll").on("dropdown:scroll", onDropdownScroll);
|
|
13125
13144
|
}, [onDropdownScroll]);
|
|
13126
13145
|
(0, import_react23.useEffect)(() => {
|
|
13127
|
-
tagify.current.off("dropdown:noMatch"
|
|
13146
|
+
tagify.current.off("dropdown:noMatch").on("dropdown:noMatch", onDropdownNoMatch);
|
|
13128
13147
|
}, [onDropdownNoMatch]);
|
|
13129
13148
|
(0, import_react23.useEffect)(() => {
|
|
13130
|
-
tagify.current.off("dropdown:updated"
|
|
13149
|
+
tagify.current.off("dropdown:updated").on("dropdown:updated", onDropdownUpdated);
|
|
13131
13150
|
}, [onDropdownUpdated]);
|
|
13132
13151
|
(0, import_react23.useEffect)(() => {
|
|
13133
13152
|
setFocus();
|
|
@@ -13217,11 +13236,11 @@ var createTagFromPath = (path, frame) => {
|
|
|
13217
13236
|
const relativePath = segments.slice(segments[0] === "workflow" ? 2 : 1).join(".");
|
|
13218
13237
|
const contentRelativePath = segments.slice(segments[0] === "workflow" ? segments[2] === "body" ? 3 : 2 : 4).join(".");
|
|
13219
13238
|
const meta = frame ? segments[0] === "workflow" ? segments[1] === "input" ? (_a = frame.workflow.input) == null ? void 0 : _a.__meta : segments[1] === "credentials" ? frame.workflow.credentials.__meta : void 0 : (_b = frame[segments[0]]) == null ? void 0 : _b.__meta : void 0;
|
|
13220
|
-
const
|
|
13221
|
-
const customization = (_d = (_c = meta == null ? void 0 : meta.config) == null ? void 0 : _c.customization) != null ? _d :
|
|
13239
|
+
const config2 = workflowBuilderUtils.getItemConfigByReference(path);
|
|
13240
|
+
const customization = (_d = (_c = meta == null ? void 0 : meta.config) == null ? void 0 : _c.customization) != null ? _d : config2 == null ? void 0 : config2.customization;
|
|
13222
13241
|
const specification = (_i = workflowBuilderUtils.extractByPath(
|
|
13223
13242
|
relativePath.split(".").join(".properties."),
|
|
13224
|
-
(_h = (_f = (_e = meta == null ? void 0 : meta.config) == null ? void 0 : _e.specification) == null ? void 0 : _f.properties) != null ? _h : (_g =
|
|
13243
|
+
(_h = (_f = (_e = meta == null ? void 0 : meta.config) == null ? void 0 : _e.specification) == null ? void 0 : _f.properties) != null ? _h : (_g = config2 == null ? void 0 : config2.specification.output) == null ? void 0 : _g.properties
|
|
13225
13244
|
)) == null ? void 0 : _i[0];
|
|
13226
13245
|
const data = specification ? {
|
|
13227
13246
|
title: (_k = (_j = specification.title) != null ? _j : segments.at(-1)) != null ? _k : "",
|
|
@@ -13335,10 +13354,13 @@ function CustomTagsInput({
|
|
|
13335
13354
|
},
|
|
13336
13355
|
[updateAllIcons]
|
|
13337
13356
|
);
|
|
13338
|
-
const handleChange = (0, import_react24.useCallback)(
|
|
13339
|
-
|
|
13340
|
-
|
|
13341
|
-
|
|
13357
|
+
const handleChange = (0, import_react24.useCallback)(
|
|
13358
|
+
(0, import_lodash3.default)(() => {
|
|
13359
|
+
onChange(getCurrentValue());
|
|
13360
|
+
updateAllIcons();
|
|
13361
|
+
}, 300),
|
|
13362
|
+
[onChange, getCurrentValue, updateAllIcons]
|
|
13363
|
+
);
|
|
13342
13364
|
const handleKeyDown = (0, import_react24.useCallback)(
|
|
13343
13365
|
(e) => {
|
|
13344
13366
|
if (e.detail.event.key !== "Backspace") {
|
|
@@ -14215,7 +14237,7 @@ function CustomSchemaForm(props) {
|
|
|
14215
14237
|
props.onChange(formData);
|
|
14216
14238
|
},
|
|
14217
14239
|
readonly: props.readonly,
|
|
14218
|
-
schema: __spreadProps(__spreadValues({}, (_a = props.schema) != null ? _a : {}), { $defs:
|
|
14240
|
+
schema: __spreadProps(__spreadValues({}, (_a = props.schema) != null ? _a : {}), { $defs: WORKFLOW_SCHEMA_DEFS.$defs }),
|
|
14219
14241
|
showErrorList: false,
|
|
14220
14242
|
templates: customTemplates,
|
|
14221
14243
|
validator: import_validator_ajv8.default,
|
|
@@ -14722,7 +14744,7 @@ function CustomSchemaFormWrapper({
|
|
|
14722
14744
|
preselectedTab,
|
|
14723
14745
|
tabsMetadata
|
|
14724
14746
|
}) {
|
|
14725
|
-
const spec = workflowBuilderUtils.getItemConfig(data);
|
|
14747
|
+
const spec = (0, import_react40.useMemo)(() => workflowBuilderUtils.getItemConfig(data), [data]);
|
|
14726
14748
|
const [selectedTab, setSelectedTab] = (0, import_react40.useState)(
|
|
14727
14749
|
preselectedTab != null ? preselectedTab : !spec || spec.specification.input ? "parameters" : spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? "connection" : void 0
|
|
14728
14750
|
);
|
|
@@ -15105,8 +15127,8 @@ function SwitchNode({
|
|
|
15105
15127
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
15106
15128
|
const sourceNode = nodes.find((node1) => node1.id === (node2 == null ? void 0 : node2.source));
|
|
15107
15129
|
if (sourceNode) {
|
|
15108
|
-
const
|
|
15109
|
-
const output = (_b = (_a =
|
|
15130
|
+
const config2 = workflowBuilderUtils.getTaskConfig(sourceNode.data);
|
|
15131
|
+
const output = (_b = (_a = config2.specification.output) == null ? void 0 : _a.properties) == null ? void 0 : _b.output;
|
|
15110
15132
|
const body = isJSONSchema7(output) && isJSONSchema7((_c = output.properties) == null ? void 0 : _c.response) && isJSONSchema7((_e = (_d = output.properties) == null ? void 0 : _d.response.properties) == null ? void 0 : _e.body) ? (_h = (_g = (_f = output.properties) == null ? void 0 : _f.response) == null ? void 0 : _g.properties) == null ? void 0 : _h.body : void 0;
|
|
15111
15133
|
const inputParameters = (body == null ? void 0 : body.type) === "object" ? body.properties : {};
|
|
15112
15134
|
const formattedInputParameters = {};
|
|
@@ -15697,7 +15719,7 @@ function EditNodeWrapper() {
|
|
|
15697
15719
|
if (!data) {
|
|
15698
15720
|
return /* @__PURE__ */ jsx2(Fragment4, {});
|
|
15699
15721
|
}
|
|
15700
|
-
const
|
|
15722
|
+
const config2 = (_b = frame == null ? void 0 : frame.__meta) == null ? void 0 : _b.config;
|
|
15701
15723
|
const readonly = !workflow.draft;
|
|
15702
15724
|
const contentHandler = () => {
|
|
15703
15725
|
var _a2, _b2;
|
|
@@ -15782,7 +15804,7 @@ function EditNodeWrapper() {
|
|
|
15782
15804
|
);
|
|
15783
15805
|
}
|
|
15784
15806
|
};
|
|
15785
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && ((
|
|
15807
|
+
const revertIconColor = getWorkflowsEnv("isHeadless") && ((config2 == null ? void 0 : config2.customization.icon) === import_developer_studio_api23.IntegrationNames.OpenAI || (config2 == null ? void 0 : config2.customization.icon) === import_developer_studio_api23.IntegrationNames.BigCommerce);
|
|
15786
15808
|
return /* @__PURE__ */ jsxs2(Wrapper3, { children: [
|
|
15787
15809
|
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react20.Row, { center: true, setRowPadding: "12px 24px", spaceBetween: true, children: [
|
|
15788
15810
|
/* @__PURE__ */ jsx2(
|
|
@@ -15792,13 +15814,13 @@ function EditNodeWrapper() {
|
|
|
15792
15814
|
max-width: 80%;
|
|
15793
15815
|
`,
|
|
15794
15816
|
children: /* @__PURE__ */ jsxs2(Title6, { children: [
|
|
15795
|
-
(
|
|
15817
|
+
(config2 == null ? void 0 : config2.customization.product) ? /* @__PURE__ */ jsx2(
|
|
15796
15818
|
ProductIcon_default,
|
|
15797
15819
|
{
|
|
15798
15820
|
center: true,
|
|
15799
15821
|
disabled: false,
|
|
15800
15822
|
height: 10,
|
|
15801
|
-
product:
|
|
15823
|
+
product: config2.customization.icon,
|
|
15802
15824
|
revertColors: revertIconColor,
|
|
15803
15825
|
width: 10
|
|
15804
15826
|
}
|
|
@@ -15815,9 +15837,9 @@ function EditNodeWrapper() {
|
|
|
15815
15837
|
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react20.Column, { noFlexBasis: true, notPadded: true, children: [
|
|
15816
15838
|
/* @__PURE__ */ jsxs2("strong", { children: [
|
|
15817
15839
|
((_c = frame == null ? void 0 : frame.__meta) == null ? void 0 : _c.index) !== void 0 ? `${frame.__meta.index}. ` : "",
|
|
15818
|
-
(_d =
|
|
15840
|
+
(_d = config2 == null ? void 0 : config2.customization.displayName) != null ? _d : data.type === NodeTypes.switch ? "Condition" : data.type === NodeTypes.http ? "Custom HTTP" : data.type === NodeTypes.terminate ? "End workflow" : ""
|
|
15819
15841
|
] }),
|
|
15820
|
-
(_e =
|
|
15842
|
+
(_e = config2 == null ? void 0 : config2.customization.description) != null ? _e : data.type === NodeTypes.switch ? "Conditional execution" : data.type === NodeTypes.http ? "Make an HTTP request" : data.type === NodeTypes.terminate ? "End the workflow" : ""
|
|
15821
15843
|
] })
|
|
15822
15844
|
] })
|
|
15823
15845
|
}
|
|
@@ -16669,7 +16691,7 @@ var import_react77 = require("react");
|
|
|
16669
16691
|
|
|
16670
16692
|
// src/views/Flows/Definitions/Common/One/hooks/use-scroll.ts
|
|
16671
16693
|
var import_react65 = require("react");
|
|
16672
|
-
var
|
|
16694
|
+
var import_lodash4 = __toESM(require("lodash.debounce"));
|
|
16673
16695
|
var useScroll = ({
|
|
16674
16696
|
oneChatFeedRef,
|
|
16675
16697
|
groupedEvents,
|
|
@@ -16725,7 +16747,7 @@ var useScroll = ({
|
|
|
16725
16747
|
currentScrollPosition.current = (_a = container2.scrollTop) != null ? _a : null;
|
|
16726
16748
|
isScrolledToBottom.current = container2.scrollHeight - container2.scrollTop - container2.clientHeight < 1;
|
|
16727
16749
|
};
|
|
16728
|
-
const debouncedScroll = (0,
|
|
16750
|
+
const debouncedScroll = (0, import_lodash4.default)(handleScroll, 200);
|
|
16729
16751
|
return {
|
|
16730
16752
|
handleScroll: debouncedScroll,
|
|
16731
16753
|
handleScrollToBottom: scrollToBottom
|
|
@@ -18923,117 +18945,148 @@ function AddWorkflowTaskOptions({
|
|
|
18923
18945
|
var Options_default = AddWorkflowTaskOptions;
|
|
18924
18946
|
|
|
18925
18947
|
// src/views/Flows/Definitions/Edit/Tasks/Add.tsx
|
|
18926
|
-
var config2 = [
|
|
18927
|
-
// {
|
|
18928
|
-
// name: 'system',
|
|
18929
|
-
// displayName: 'System tasks',
|
|
18930
|
-
// icon: (
|
|
18931
|
-
// <ProductIcon
|
|
18932
|
-
// product={OTHER_TYPES.SYSTEM}
|
|
18933
|
-
// center={undefined}
|
|
18934
|
-
// height={5}
|
|
18935
|
-
// width={5}
|
|
18936
|
-
// disabled={undefined}
|
|
18937
|
-
// />
|
|
18938
|
-
// ),
|
|
18939
|
-
// values: Object.values(systemTaskConfigs).map((x) => ({
|
|
18940
|
-
// key: x.key,
|
|
18941
|
-
// name: x.customization.displayName,
|
|
18942
|
-
// shortDescription: x.customization.shortDescription,
|
|
18943
|
-
// secondaryText: x.customization.description,
|
|
18944
|
-
// })),
|
|
18945
|
-
// },
|
|
18946
|
-
{
|
|
18947
|
-
name: PRODUCT_TYPE.LC,
|
|
18948
|
-
displayName: PRODUCT_NAMES.livechat,
|
|
18949
|
-
icon: /* @__PURE__ */ jsx2(ProductIcon_default, { height: 5, product: PRODUCT_TYPE.LC, width: 5 }),
|
|
18950
|
-
values: Object.values(livechatTaskConfigs).map((x) => ({
|
|
18951
|
-
key: x.key,
|
|
18952
|
-
name: x.customization.displayName,
|
|
18953
|
-
shortDescription: x.customization.shortDescription,
|
|
18954
|
-
secondaryText: x.customization.description
|
|
18955
|
-
}))
|
|
18956
|
-
},
|
|
18957
|
-
{
|
|
18958
|
-
name: PRODUCT_TYPE.HD,
|
|
18959
|
-
displayName: PRODUCT_NAMES.helpdesk,
|
|
18960
|
-
icon: /* @__PURE__ */ jsx2(ProductIcon_default, { center: true, height: 5, product: PRODUCT_TYPE.HD, width: 5 }),
|
|
18961
|
-
values: Object.values(helpdeskTaskConfigs).map((x) => ({
|
|
18962
|
-
key: x.key,
|
|
18963
|
-
name: x.customization.displayName,
|
|
18964
|
-
shortDescription: x.customization.shortDescription,
|
|
18965
|
-
secondaryText: x.customization.description
|
|
18966
|
-
}))
|
|
18967
|
-
},
|
|
18968
|
-
{
|
|
18969
|
-
name: OTHER_PRODUCT_TYPE.OPENAI,
|
|
18970
|
-
displayName: "OpenAI",
|
|
18971
|
-
icon: /* @__PURE__ */ jsx2(ProductIcon_default, { height: 5, product: OTHER_PRODUCT_TYPE.OPENAI, width: 5 }),
|
|
18972
|
-
values: Object.values(openAiTaskConfigs).map((x) => ({
|
|
18973
|
-
key: x.key,
|
|
18974
|
-
name: x.customization.displayName,
|
|
18975
|
-
shortDescription: x.customization.shortDescription,
|
|
18976
|
-
secondaryText: x.customization.description
|
|
18977
|
-
}))
|
|
18978
|
-
},
|
|
18979
|
-
{
|
|
18980
|
-
name: import_developer_studio_api25.IntegrationNames.Mailchimp,
|
|
18981
|
-
displayName: import_developer_studio_api25.IntegrationDisplayNames.Mailchimp,
|
|
18982
|
-
icon: /* @__PURE__ */ jsx2(ProductIcon_default, { height: 5, product: import_developer_studio_api25.IntegrationNames.Mailchimp, width: 5 }),
|
|
18983
|
-
values: Object.values(mailchimpTaskConfigs).map((x) => ({
|
|
18984
|
-
key: x.key,
|
|
18985
|
-
name: x.customization.displayName,
|
|
18986
|
-
shortDescription: x.customization.shortDescription,
|
|
18987
|
-
secondaryText: x.customization.description
|
|
18988
|
-
}))
|
|
18989
|
-
},
|
|
18990
|
-
{
|
|
18991
|
-
name: import_developer_studio_api25.IntegrationNames.HubSpot,
|
|
18992
|
-
displayName: import_developer_studio_api25.IntegrationDisplayNames.HubSpot,
|
|
18993
|
-
icon: /* @__PURE__ */ jsx2(ProductIcon_default, { height: 5, product: import_developer_studio_api25.IntegrationNames.HubSpot, width: 5 }),
|
|
18994
|
-
values: Object.values(hubspotTaskConfigs).map((x) => ({
|
|
18995
|
-
key: x.key,
|
|
18996
|
-
name: x.customization.displayName,
|
|
18997
|
-
shortDescription: x.customization.shortDescription,
|
|
18998
|
-
secondaryText: x.customization.description
|
|
18999
|
-
}))
|
|
19000
|
-
},
|
|
19001
|
-
{
|
|
19002
|
-
name: import_developer_studio_api25.IntegrationNames.BigCommerce,
|
|
19003
|
-
displayName: import_developer_studio_api25.IntegrationDisplayNames.BigCommerce,
|
|
19004
|
-
icon: /* @__PURE__ */ jsx2(
|
|
19005
|
-
ProductIcon_default,
|
|
19006
|
-
{
|
|
19007
|
-
height: 5,
|
|
19008
|
-
product: import_developer_studio_api25.IntegrationNames.BigCommerce,
|
|
19009
|
-
width: 5
|
|
19010
|
-
}
|
|
19011
|
-
),
|
|
19012
|
-
values: Object.values(bigCommerceTaskConfigs).map((x) => ({
|
|
19013
|
-
key: x.key,
|
|
19014
|
-
name: x.customization.displayName,
|
|
19015
|
-
shortDescription: x.customization.shortDescription,
|
|
19016
|
-
secondaryText: x.customization.description
|
|
19017
|
-
}))
|
|
19018
|
-
},
|
|
19019
|
-
{
|
|
19020
|
-
name: import_developer_studio_api25.IntegrationNames.Shopify,
|
|
19021
|
-
displayName: import_developer_studio_api25.IntegrationDisplayNames.Shopify,
|
|
19022
|
-
icon: /* @__PURE__ */ jsx2(ProductIcon_default, { height: 5, product: import_developer_studio_api25.IntegrationNames.Shopify, width: 5 }),
|
|
19023
|
-
values: Object.values(shopifyTaskConfigs).map((x) => ({
|
|
19024
|
-
key: x.key,
|
|
19025
|
-
name: x.customization.displayName,
|
|
19026
|
-
shortDescription: x.customization.shortDescription,
|
|
19027
|
-
secondaryText: x.customization.description
|
|
19028
|
-
}))
|
|
19029
|
-
}
|
|
19030
|
-
];
|
|
19031
18948
|
function AddWorkflowTask({ basePath, onClose }) {
|
|
19032
18949
|
const [search, setSearch] = (0, import_react87.useState)("");
|
|
19033
18950
|
const location = (0, import_react_router_dom12.useLocation)();
|
|
19034
18951
|
const navigate = (0, import_react_router_dom12.useNavigate)();
|
|
19035
18952
|
const params = (0, import_react_router_dom12.useParams)();
|
|
19036
18953
|
const [state, setState] = (0, import_react87.useState)();
|
|
18954
|
+
const config2 = (0, import_react87.useMemo)(
|
|
18955
|
+
() => [
|
|
18956
|
+
// {
|
|
18957
|
+
// name: 'system',
|
|
18958
|
+
// displayName: 'System tasks',
|
|
18959
|
+
// icon: (
|
|
18960
|
+
// <ProductIcon
|
|
18961
|
+
// product={OTHER_TYPES.SYSTEM}
|
|
18962
|
+
// center={undefined}
|
|
18963
|
+
// height={5}
|
|
18964
|
+
// width={5}
|
|
18965
|
+
// disabled={undefined}
|
|
18966
|
+
// />
|
|
18967
|
+
// ),
|
|
18968
|
+
// values: Object.values(systemTaskConfigs()).map((x) => ({
|
|
18969
|
+
// key: x.key,
|
|
18970
|
+
// name: x.customization.displayName,
|
|
18971
|
+
// shortDescription: x.customization.shortDescription,
|
|
18972
|
+
// secondaryText: x.customization.description,
|
|
18973
|
+
// })),
|
|
18974
|
+
// },
|
|
18975
|
+
{
|
|
18976
|
+
name: PRODUCT_TYPE.LC,
|
|
18977
|
+
displayName: PRODUCT_NAMES.livechat,
|
|
18978
|
+
icon: /* @__PURE__ */ jsx2(ProductIcon_default, { height: 5, product: PRODUCT_TYPE.LC, width: 5 }),
|
|
18979
|
+
values: Object.values(livechatTaskConfigs()).map((x) => ({
|
|
18980
|
+
key: x.key,
|
|
18981
|
+
name: x.customization.displayName,
|
|
18982
|
+
shortDescription: x.customization.shortDescription,
|
|
18983
|
+
secondaryText: x.customization.description
|
|
18984
|
+
}))
|
|
18985
|
+
},
|
|
18986
|
+
{
|
|
18987
|
+
name: PRODUCT_TYPE.HD,
|
|
18988
|
+
displayName: PRODUCT_NAMES.helpdesk,
|
|
18989
|
+
icon: /* @__PURE__ */ jsx2(ProductIcon_default, { center: true, height: 5, product: PRODUCT_TYPE.HD, width: 5 }),
|
|
18990
|
+
values: Object.values(helpdeskTaskConfigs()).map((x) => ({
|
|
18991
|
+
key: x.key,
|
|
18992
|
+
name: x.customization.displayName,
|
|
18993
|
+
shortDescription: x.customization.shortDescription,
|
|
18994
|
+
secondaryText: x.customization.description
|
|
18995
|
+
}))
|
|
18996
|
+
},
|
|
18997
|
+
{
|
|
18998
|
+
name: OTHER_PRODUCT_TYPE.OPENAI,
|
|
18999
|
+
displayName: "OpenAI",
|
|
19000
|
+
icon: /* @__PURE__ */ jsx2(
|
|
19001
|
+
ProductIcon_default,
|
|
19002
|
+
{
|
|
19003
|
+
height: 5,
|
|
19004
|
+
product: OTHER_PRODUCT_TYPE.OPENAI,
|
|
19005
|
+
width: 5
|
|
19006
|
+
}
|
|
19007
|
+
),
|
|
19008
|
+
values: Object.values(openAiTaskConfigs()).map((x) => ({
|
|
19009
|
+
key: x.key,
|
|
19010
|
+
name: x.customization.displayName,
|
|
19011
|
+
shortDescription: x.customization.shortDescription,
|
|
19012
|
+
secondaryText: x.customization.description
|
|
19013
|
+
}))
|
|
19014
|
+
},
|
|
19015
|
+
{
|
|
19016
|
+
name: import_developer_studio_api25.IntegrationNames.Mailchimp,
|
|
19017
|
+
displayName: import_developer_studio_api25.IntegrationDisplayNames.Mailchimp,
|
|
19018
|
+
icon: /* @__PURE__ */ jsx2(
|
|
19019
|
+
ProductIcon_default,
|
|
19020
|
+
{
|
|
19021
|
+
height: 5,
|
|
19022
|
+
product: import_developer_studio_api25.IntegrationNames.Mailchimp,
|
|
19023
|
+
width: 5
|
|
19024
|
+
}
|
|
19025
|
+
),
|
|
19026
|
+
values: Object.values(mailchimpTaskConfigs()).map((x) => ({
|
|
19027
|
+
key: x.key,
|
|
19028
|
+
name: x.customization.displayName,
|
|
19029
|
+
shortDescription: x.customization.shortDescription,
|
|
19030
|
+
secondaryText: x.customization.description
|
|
19031
|
+
}))
|
|
19032
|
+
},
|
|
19033
|
+
{
|
|
19034
|
+
name: import_developer_studio_api25.IntegrationNames.HubSpot,
|
|
19035
|
+
displayName: import_developer_studio_api25.IntegrationDisplayNames.HubSpot,
|
|
19036
|
+
icon: /* @__PURE__ */ jsx2(
|
|
19037
|
+
ProductIcon_default,
|
|
19038
|
+
{
|
|
19039
|
+
height: 5,
|
|
19040
|
+
product: import_developer_studio_api25.IntegrationNames.HubSpot,
|
|
19041
|
+
width: 5
|
|
19042
|
+
}
|
|
19043
|
+
),
|
|
19044
|
+
values: Object.values(hubspotTaskConfigs()).map((x) => ({
|
|
19045
|
+
key: x.key,
|
|
19046
|
+
name: x.customization.displayName,
|
|
19047
|
+
shortDescription: x.customization.shortDescription,
|
|
19048
|
+
secondaryText: x.customization.description
|
|
19049
|
+
}))
|
|
19050
|
+
},
|
|
19051
|
+
{
|
|
19052
|
+
name: import_developer_studio_api25.IntegrationNames.BigCommerce,
|
|
19053
|
+
displayName: import_developer_studio_api25.IntegrationDisplayNames.BigCommerce,
|
|
19054
|
+
icon: /* @__PURE__ */ jsx2(
|
|
19055
|
+
ProductIcon_default,
|
|
19056
|
+
{
|
|
19057
|
+
height: 5,
|
|
19058
|
+
product: import_developer_studio_api25.IntegrationNames.BigCommerce,
|
|
19059
|
+
width: 5
|
|
19060
|
+
}
|
|
19061
|
+
),
|
|
19062
|
+
values: Object.values(bigCommerceTaskConfigs()).map((x) => ({
|
|
19063
|
+
key: x.key,
|
|
19064
|
+
name: x.customization.displayName,
|
|
19065
|
+
shortDescription: x.customization.shortDescription,
|
|
19066
|
+
secondaryText: x.customization.description
|
|
19067
|
+
}))
|
|
19068
|
+
},
|
|
19069
|
+
{
|
|
19070
|
+
name: import_developer_studio_api25.IntegrationNames.Shopify,
|
|
19071
|
+
displayName: import_developer_studio_api25.IntegrationDisplayNames.Shopify,
|
|
19072
|
+
icon: /* @__PURE__ */ jsx2(
|
|
19073
|
+
ProductIcon_default,
|
|
19074
|
+
{
|
|
19075
|
+
height: 5,
|
|
19076
|
+
product: import_developer_studio_api25.IntegrationNames.Shopify,
|
|
19077
|
+
width: 5
|
|
19078
|
+
}
|
|
19079
|
+
),
|
|
19080
|
+
values: Object.values(shopifyTaskConfigs()).map((x) => ({
|
|
19081
|
+
key: x.key,
|
|
19082
|
+
name: x.customization.displayName,
|
|
19083
|
+
shortDescription: x.customization.shortDescription,
|
|
19084
|
+
secondaryText: x.customization.description
|
|
19085
|
+
}))
|
|
19086
|
+
}
|
|
19087
|
+
],
|
|
19088
|
+
[]
|
|
19089
|
+
);
|
|
19037
19090
|
const {
|
|
19038
19091
|
addTask,
|
|
19039
19092
|
state: { workflow }
|
|
@@ -19050,7 +19103,8 @@ function AddWorkflowTask({ basePath, onClose }) {
|
|
|
19050
19103
|
state: location.state
|
|
19051
19104
|
});
|
|
19052
19105
|
}
|
|
19053
|
-
const
|
|
19106
|
+
const templates = WorkflowItemsConfiguration.templates;
|
|
19107
|
+
const tasks = params.service ? templates.tasks[params.service] : void 0;
|
|
19054
19108
|
const task2 = params.task && tasks ? tasks[params.task] : void 0;
|
|
19055
19109
|
const suggestions = workflowBuilderUtils.stringifyToObjectKeyArray(
|
|
19056
19110
|
(_d = location.state.frame) != null ? _d : {},
|
|
@@ -19353,86 +19407,110 @@ function AddWorkflowTriggerOptions({
|
|
|
19353
19407
|
var Options_default2 = AddWorkflowTriggerOptions;
|
|
19354
19408
|
|
|
19355
19409
|
// src/views/Flows/Definitions/Edit/Triggers/Add.tsx
|
|
19356
|
-
|
|
19357
|
-
|
|
19358
|
-
|
|
19359
|
-
|
|
19360
|
-
icon: /* @__PURE__ */ jsx2(
|
|
19361
|
-
ProductIcon_default,
|
|
19410
|
+
function AddWorkflowTrigger({ basePath, onClose }) {
|
|
19411
|
+
const [search, setSearch] = (0, import_react90.useState)("");
|
|
19412
|
+
const config2 = (0, import_react90.useMemo)(
|
|
19413
|
+
() => [
|
|
19362
19414
|
{
|
|
19363
|
-
|
|
19364
|
-
|
|
19365
|
-
|
|
19366
|
-
|
|
19367
|
-
|
|
19368
|
-
|
|
19369
|
-
|
|
19370
|
-
|
|
19371
|
-
|
|
19372
|
-
|
|
19373
|
-
|
|
19374
|
-
|
|
19375
|
-
|
|
19376
|
-
|
|
19377
|
-
|
|
19378
|
-
|
|
19379
|
-
|
|
19380
|
-
|
|
19381
|
-
|
|
19382
|
-
|
|
19383
|
-
|
|
19384
|
-
|
|
19385
|
-
|
|
19386
|
-
|
|
19387
|
-
|
|
19388
|
-
|
|
19389
|
-
|
|
19390
|
-
|
|
19391
|
-
|
|
19392
|
-
|
|
19393
|
-
|
|
19394
|
-
|
|
19395
|
-
|
|
19396
|
-
|
|
19397
|
-
|
|
19398
|
-
|
|
19399
|
-
|
|
19400
|
-
|
|
19401
|
-
|
|
19402
|
-
|
|
19403
|
-
|
|
19404
|
-
|
|
19405
|
-
|
|
19406
|
-
|
|
19407
|
-
|
|
19408
|
-
|
|
19409
|
-
|
|
19410
|
-
|
|
19411
|
-
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
|
|
19415
|
-
|
|
19416
|
-
|
|
19417
|
-
|
|
19418
|
-
|
|
19419
|
-
|
|
19420
|
-
|
|
19415
|
+
name: OTHER_TYPES.SYSTEM,
|
|
19416
|
+
displayName: "General",
|
|
19417
|
+
icon: /* @__PURE__ */ jsx2(
|
|
19418
|
+
ProductIcon_default,
|
|
19419
|
+
{
|
|
19420
|
+
center: void 0,
|
|
19421
|
+
disabled: void 0,
|
|
19422
|
+
height: 5,
|
|
19423
|
+
product: OTHER_TYPES.SYSTEM,
|
|
19424
|
+
width: 5
|
|
19425
|
+
}
|
|
19426
|
+
),
|
|
19427
|
+
values: Object.values(systemTriggerConfigs()).map((x) => ({
|
|
19428
|
+
key: x.key,
|
|
19429
|
+
name: x.customization.displayName,
|
|
19430
|
+
secondaryText: x.customization.description
|
|
19431
|
+
}))
|
|
19432
|
+
},
|
|
19433
|
+
{
|
|
19434
|
+
name: PRODUCT_TYPE.LC,
|
|
19435
|
+
displayName: PRODUCT_NAMES.livechat,
|
|
19436
|
+
icon: /* @__PURE__ */ jsx2(ProductIcon_default, { height: 5, product: PRODUCT_TYPE.LC, width: 5 }),
|
|
19437
|
+
values: Object.values(livechatTriggerConfigs()).map((x) => ({
|
|
19438
|
+
key: x.key,
|
|
19439
|
+
name: x.customization.displayName,
|
|
19440
|
+
secondaryText: x.customization.description
|
|
19441
|
+
}))
|
|
19442
|
+
},
|
|
19443
|
+
{
|
|
19444
|
+
name: import_developer_studio_api26.IntegrationNames.Mailchimp,
|
|
19445
|
+
displayName: import_developer_studio_api26.IntegrationDisplayNames.Mailchimp,
|
|
19446
|
+
icon: /* @__PURE__ */ jsx2(
|
|
19447
|
+
ProductIcon_default,
|
|
19448
|
+
{
|
|
19449
|
+
height: 5,
|
|
19450
|
+
product: import_developer_studio_api26.IntegrationNames.Mailchimp,
|
|
19451
|
+
width: 5
|
|
19452
|
+
}
|
|
19453
|
+
),
|
|
19454
|
+
values: Object.values(mailchimpTriggerConfigs()).map((x) => ({
|
|
19455
|
+
key: x.key,
|
|
19456
|
+
name: x.customization.displayName,
|
|
19457
|
+
secondaryText: x.customization.description
|
|
19458
|
+
}))
|
|
19459
|
+
},
|
|
19460
|
+
{
|
|
19461
|
+
name: import_developer_studio_api26.IntegrationNames.Shopify,
|
|
19462
|
+
displayName: import_developer_studio_api26.IntegrationDisplayNames.Shopify,
|
|
19463
|
+
icon: /* @__PURE__ */ jsx2(
|
|
19464
|
+
ProductIcon_default,
|
|
19465
|
+
{
|
|
19466
|
+
height: 5,
|
|
19467
|
+
product: import_developer_studio_api26.IntegrationNames.Shopify,
|
|
19468
|
+
width: 5
|
|
19469
|
+
}
|
|
19470
|
+
),
|
|
19471
|
+
values: Object.values(shopifyTriggerConfigs()).map((x) => ({
|
|
19472
|
+
key: x.key,
|
|
19473
|
+
name: x.customization.displayName,
|
|
19474
|
+
secondaryText: x.customization.description
|
|
19475
|
+
}))
|
|
19476
|
+
},
|
|
19477
|
+
{
|
|
19478
|
+
name: import_developer_studio_api26.IntegrationNames.HubSpot,
|
|
19479
|
+
displayName: import_developer_studio_api26.IntegrationDisplayNames.HubSpot,
|
|
19480
|
+
icon: /* @__PURE__ */ jsx2(
|
|
19481
|
+
ProductIcon_default,
|
|
19482
|
+
{
|
|
19483
|
+
height: 5,
|
|
19484
|
+
product: import_developer_studio_api26.IntegrationNames.HubSpot,
|
|
19485
|
+
width: 5
|
|
19486
|
+
}
|
|
19487
|
+
),
|
|
19488
|
+
values: Object.values(hubspotTriggerConfigs()).map((x) => ({
|
|
19489
|
+
key: x.key,
|
|
19490
|
+
name: x.customization.displayName,
|
|
19491
|
+
secondaryText: x.customization.description
|
|
19492
|
+
}))
|
|
19493
|
+
},
|
|
19421
19494
|
{
|
|
19422
|
-
|
|
19423
|
-
|
|
19424
|
-
|
|
19495
|
+
name: import_developer_studio_api26.IntegrationNames.BigCommerce,
|
|
19496
|
+
displayName: import_developer_studio_api26.IntegrationDisplayNames.BigCommerce,
|
|
19497
|
+
icon: /* @__PURE__ */ jsx2(
|
|
19498
|
+
ProductIcon_default,
|
|
19499
|
+
{
|
|
19500
|
+
height: 5,
|
|
19501
|
+
product: import_developer_studio_api26.IntegrationNames.BigCommerce,
|
|
19502
|
+
width: 5
|
|
19503
|
+
}
|
|
19504
|
+
),
|
|
19505
|
+
values: Object.values(bigcommerceTriggerConfigs()).map((x) => ({
|
|
19506
|
+
key: x.key,
|
|
19507
|
+
name: x.customization.displayName,
|
|
19508
|
+
secondaryText: x.customization.description
|
|
19509
|
+
}))
|
|
19425
19510
|
}
|
|
19426
|
-
|
|
19427
|
-
|
|
19428
|
-
|
|
19429
|
-
name: x.customization.displayName,
|
|
19430
|
-
secondaryText: x.customization.description
|
|
19431
|
-
}))
|
|
19432
|
-
}
|
|
19433
|
-
];
|
|
19434
|
-
function AddWorkflowTrigger({ basePath, onClose }) {
|
|
19435
|
-
const [search, setSearch] = (0, import_react90.useState)("");
|
|
19511
|
+
],
|
|
19512
|
+
[]
|
|
19513
|
+
);
|
|
19436
19514
|
const location = (0, import_react_router_dom13.useLocation)();
|
|
19437
19515
|
const navigate = (0, import_react_router_dom13.useNavigate)();
|
|
19438
19516
|
const params = (0, import_react_router_dom13.useParams)();
|
|
@@ -19445,10 +19523,11 @@ function AddWorkflowTrigger({ basePath, onClose }) {
|
|
|
19445
19523
|
(0, import_react90.useEffect)(() => {
|
|
19446
19524
|
var _a, _b, _c;
|
|
19447
19525
|
if (!params.trigger) {
|
|
19448
|
-
const firstTrigger = (_c = (_b = (_a =
|
|
19526
|
+
const firstTrigger = (_c = (_b = (_a = config2.find((el) => el.name === params.service)) == null ? void 0 : _a.values.sort((a, b) => a.name.localeCompare(b.name))) == null ? void 0 : _b[0]) == null ? void 0 : _c.key;
|
|
19449
19527
|
navigate(`${basePath}/${params.service}/${firstTrigger}`);
|
|
19450
19528
|
}
|
|
19451
|
-
const
|
|
19529
|
+
const templates = WorkflowItemsConfiguration.templates;
|
|
19530
|
+
const triggers = params.service ? templates.triggers[params.service] : void 0;
|
|
19452
19531
|
const trigger = params.trigger && triggers ? triggers[params.trigger] : void 0;
|
|
19453
19532
|
setState({ trigger });
|
|
19454
19533
|
}, [basePath, navigate, params.service, params.trigger]);
|
|
@@ -19517,7 +19596,7 @@ function AddWorkflowTrigger({ basePath, onClose }) {
|
|
|
19517
19596
|
)
|
|
19518
19597
|
}
|
|
19519
19598
|
),
|
|
19520
|
-
|
|
19599
|
+
config2.map(({ name, displayName, icon: icon2, values }) => {
|
|
19521
19600
|
const revertIconColor = getWorkflowsEnv("isHeadless") && (name === import_developer_studio_api26.IntegrationNames.OpenAI || name === import_developer_studio_api26.IntegrationNames.BigCommerce);
|
|
19522
19601
|
if (search) {
|
|
19523
19602
|
if (values.some(
|
|
@@ -19593,7 +19672,7 @@ function AddWorkflowTrigger({ basePath, onClose }) {
|
|
|
19593
19672
|
`,
|
|
19594
19673
|
setColumnPadding: "0 20px 0 16px",
|
|
19595
19674
|
width: 10,
|
|
19596
|
-
children: params.service ?
|
|
19675
|
+
children: params.service ? config2.map(({ name, displayName, values, icon: icon2 }) => {
|
|
19597
19676
|
var _a;
|
|
19598
19677
|
if (((_a = params.service) == null ? void 0 : _a.toLowerCase()) === name.toLowerCase()) {
|
|
19599
19678
|
const options2 = values.map(({ key, name: name2, secondaryText }) => ({
|
|
@@ -20052,12 +20131,13 @@ var Edit_default2 = EditWorkflow;
|
|
|
20052
20131
|
var import_react_router_dom24 = require("react-router-dom");
|
|
20053
20132
|
|
|
20054
20133
|
// src/views/Flows/Templates/Common/Modals/Preview/index.tsx
|
|
20134
|
+
var import_react96 = require("react");
|
|
20055
20135
|
var import_react_router_dom17 = require("react-router-dom");
|
|
20056
20136
|
|
|
20057
20137
|
// src/views/Flows/Templates/api.mocks.tsx
|
|
20058
20138
|
var import_design_system_icons32 = require("@livechat/design-system-icons");
|
|
20059
20139
|
var import_developer_studio_api27 = require("@livechat/developer-studio-api");
|
|
20060
|
-
var
|
|
20140
|
+
var getFlowTemplates = () => [
|
|
20061
20141
|
{
|
|
20062
20142
|
id: "1",
|
|
20063
20143
|
name: "Create HelpDesk tickets with chat summaries when a chat ends",
|
|
@@ -21904,6 +21984,7 @@ function WorkflowTemplatePreview({
|
|
|
21904
21984
|
workflow,
|
|
21905
21985
|
onClose
|
|
21906
21986
|
}) {
|
|
21987
|
+
const flowTemplates = (0, import_react96.useMemo)(() => getFlowTemplates(), []);
|
|
21907
21988
|
const params = (0, import_react_router_dom17.useParams)();
|
|
21908
21989
|
const template = flowTemplates.find((t) => t.id === params.template);
|
|
21909
21990
|
if (!workflow) {
|
|
@@ -21940,18 +22021,18 @@ var Preview_default2 = WorkflowTemplatePreview;
|
|
|
21940
22021
|
var import_react_router_dom21 = require("react-router-dom");
|
|
21941
22022
|
|
|
21942
22023
|
// src/views/Flows/Definitions/List/Modals/Create/Modal.tsx
|
|
21943
|
-
var
|
|
22024
|
+
var import_react101 = require("react");
|
|
21944
22025
|
var import_react_router_dom20 = require("react-router-dom");
|
|
21945
22026
|
var import_design_system_react_components77 = require("@livechat/design-system-react-components");
|
|
21946
22027
|
|
|
21947
22028
|
// src/views/Flows/Definitions/List/Home/Home.tsx
|
|
21948
|
-
var
|
|
22029
|
+
var import_react100 = require("react");
|
|
21949
22030
|
var import_design_system_icons37 = require("@livechat/design-system-icons");
|
|
21950
22031
|
var import_design_system_react_components76 = require("@livechat/design-system-react-components");
|
|
21951
22032
|
var import_developer_studio_ui_react40 = require("@livechat/developer-studio-ui-react");
|
|
21952
22033
|
|
|
21953
22034
|
// src/views/Flows/Templates/Common/Modals/List/Filters/Category.tsx
|
|
21954
|
-
var
|
|
22035
|
+
var import_react97 = require("react");
|
|
21955
22036
|
var import_design_system_icons35 = require("@livechat/design-system-icons");
|
|
21956
22037
|
var import_design_system_react_components72 = require("@livechat/design-system-react-components");
|
|
21957
22038
|
var import_developer_studio_ui_react36 = require("@livechat/developer-studio-ui-react");
|
|
@@ -21959,8 +22040,8 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
21959
22040
|
handleStatus,
|
|
21960
22041
|
status
|
|
21961
22042
|
}) {
|
|
21962
|
-
const [isVisible, setIsVisible] = (0,
|
|
21963
|
-
const getItem = (0,
|
|
22043
|
+
const [isVisible, setIsVisible] = (0, import_react97.useState)(false);
|
|
22044
|
+
const getItem = (0, import_react97.useCallback)(
|
|
21964
22045
|
(key, category, icon2) => ({
|
|
21965
22046
|
key,
|
|
21966
22047
|
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react36.Row, { gap: `var(${import_design_system_react_components72.SpacingToken.Spacing1});`, notPadded: true, children: [
|
|
@@ -22014,7 +22095,7 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
22014
22095
|
var Category_default = WorkflowTemplatesCategoryFilter;
|
|
22015
22096
|
|
|
22016
22097
|
// src/views/Flows/Templates/Common/Modals/List/Filters/Product.tsx
|
|
22017
|
-
var
|
|
22098
|
+
var import_react98 = require("react");
|
|
22018
22099
|
var import_design_system_icons36 = require("@livechat/design-system-icons");
|
|
22019
22100
|
var import_design_system_react_components73 = require("@livechat/design-system-react-components");
|
|
22020
22101
|
var import_developer_studio_ui_react37 = require("@livechat/developer-studio-ui-react");
|
|
@@ -22022,8 +22103,8 @@ function WorkflowTemplatesProductFilter({
|
|
|
22022
22103
|
handleStatus,
|
|
22023
22104
|
status
|
|
22024
22105
|
}) {
|
|
22025
|
-
const [isVisible, setIsVisible] = (0,
|
|
22026
|
-
const getItem = (0,
|
|
22106
|
+
const [isVisible, setIsVisible] = (0, import_react98.useState)(false);
|
|
22107
|
+
const getItem = (0, import_react98.useCallback)(
|
|
22027
22108
|
(key, product, icon2) => ({
|
|
22028
22109
|
key,
|
|
22029
22110
|
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react37.Row, { gap: `var(${import_design_system_react_components73.SpacingToken.Spacing1});`, notPadded: true, children: [
|
|
@@ -22177,8 +22258,9 @@ var Grid = newStyled.div`
|
|
|
22177
22258
|
gap: var(${import_design_system_react_components76.SpacingToken.Spacing3});
|
|
22178
22259
|
`;
|
|
22179
22260
|
function WorkflowsHome({ isOnModal, basePath }) {
|
|
22180
|
-
const [product, setProduct] = (0,
|
|
22181
|
-
const [category, setCategory] = (0,
|
|
22261
|
+
const [product, setProduct] = (0, import_react100.useState)("All");
|
|
22262
|
+
const [category, setCategory] = (0, import_react100.useState)("All");
|
|
22263
|
+
const flowTemplates = (0, import_react100.useMemo)(() => getFlowTemplates(), []);
|
|
22182
22264
|
const filters = [
|
|
22183
22265
|
(template) => product === "All" || template.products.includes(product),
|
|
22184
22266
|
(template) => category === "All" || template.category.includes(category)
|
|
@@ -22216,13 +22298,7 @@ function WorkflowsHome({ isOnModal, basePath }) {
|
|
|
22216
22298
|
notPadded: true,
|
|
22217
22299
|
notPaddedOnMobile: true,
|
|
22218
22300
|
children: [
|
|
22219
|
-
/* @__PURE__ */ jsx2(
|
|
22220
|
-
Scratch_default,
|
|
22221
|
-
{
|
|
22222
|
-
icon: import_design_system_icons37.FiletypeOther,
|
|
22223
|
-
title: "Empty workflow"
|
|
22224
|
-
}
|
|
22225
|
-
),
|
|
22301
|
+
/* @__PURE__ */ jsx2(Scratch_default, { icon: import_design_system_icons37.FiletypeOther, title: "Empty workflow" }),
|
|
22226
22302
|
/* @__PURE__ */ jsx2(
|
|
22227
22303
|
Scratch_default,
|
|
22228
22304
|
{
|
|
@@ -22287,7 +22363,7 @@ var Home_default = WorkflowsHome;
|
|
|
22287
22363
|
// src/views/Flows/Definitions/List/Modals/Create/Modal.tsx
|
|
22288
22364
|
function WorkflowCreateModal({ onClose }) {
|
|
22289
22365
|
const navigate = (0, import_react_router_dom20.useNavigate)();
|
|
22290
|
-
const handleClose = (0,
|
|
22366
|
+
const handleClose = (0, import_react101.useCallback)(() => {
|
|
22291
22367
|
if (onClose) {
|
|
22292
22368
|
onClose();
|
|
22293
22369
|
return;
|
|
@@ -22320,7 +22396,7 @@ function WorkflowCreate() {
|
|
|
22320
22396
|
var Create_default = WorkflowCreate;
|
|
22321
22397
|
|
|
22322
22398
|
// src/views/Flows/Definitions/List/View.tsx
|
|
22323
|
-
var
|
|
22399
|
+
var import_react106 = require("react");
|
|
22324
22400
|
var import_react_router_dom23 = require("react-router-dom");
|
|
22325
22401
|
var import_design_system_react_components81 = require("@livechat/design-system-react-components");
|
|
22326
22402
|
var import_developer_studio_api29 = require("@livechat/developer-studio-api");
|
|
@@ -22331,7 +22407,7 @@ var import_design_system_react_components80 = require("@livechat/design-system-r
|
|
|
22331
22407
|
var import_developer_studio_ui_react42 = require("@livechat/developer-studio-ui-react");
|
|
22332
22408
|
|
|
22333
22409
|
// src/views/Flows/Definitions/List/Grid/Filters/StatusFilter.tsx
|
|
22334
|
-
var
|
|
22410
|
+
var import_react103 = require("react");
|
|
22335
22411
|
var import_design_system_icons38 = require("@livechat/design-system-icons");
|
|
22336
22412
|
var import_design_system_react_components78 = require("@livechat/design-system-react-components");
|
|
22337
22413
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
@@ -22339,7 +22415,7 @@ function WorkflowStatusFilter({
|
|
|
22339
22415
|
handleStatus,
|
|
22340
22416
|
status
|
|
22341
22417
|
}) {
|
|
22342
|
-
const [isVisible, setIsVisible] = (0,
|
|
22418
|
+
const [isVisible, setIsVisible] = (0, import_react103.useState)(false);
|
|
22343
22419
|
const items = [
|
|
22344
22420
|
{
|
|
22345
22421
|
key: "0",
|
|
@@ -22667,7 +22743,7 @@ var markedStyles = css`
|
|
|
22667
22743
|
function WorkflowListView() {
|
|
22668
22744
|
var _a;
|
|
22669
22745
|
const navigate = (0, import_react_router_dom23.useNavigate)();
|
|
22670
|
-
const [state, setState] = (0,
|
|
22746
|
+
const [state, setState] = (0, import_react106.useState)({
|
|
22671
22747
|
filters: {
|
|
22672
22748
|
status: "All",
|
|
22673
22749
|
tasks: "All"
|
|
@@ -22764,7 +22840,7 @@ function Workflows() {
|
|
|
22764
22840
|
const navigate = (0, import_react_router_dom25.useNavigate)();
|
|
22765
22841
|
const { user, isUserFetching } = (0, import_developer_studio_ui_react44.useUserContext)();
|
|
22766
22842
|
const { data: userHasInstalledWorkflows, isLoading: isWorkflowAppLoading } = useFetchUserInstalledWorkflows(user);
|
|
22767
|
-
(0,
|
|
22843
|
+
(0, import_react108.useEffect)(() => {
|
|
22768
22844
|
if (isUserFetching || isWorkflowAppLoading) {
|
|
22769
22845
|
return;
|
|
22770
22846
|
}
|
|
@@ -22789,7 +22865,7 @@ function Workflows() {
|
|
|
22789
22865
|
var Definitions_default = Workflows;
|
|
22790
22866
|
|
|
22791
22867
|
// src/views/Flows/Waitlist/index.tsx
|
|
22792
|
-
var
|
|
22868
|
+
var import_react109 = require("react");
|
|
22793
22869
|
var import_react_router_dom26 = require("react-router-dom");
|
|
22794
22870
|
var import_design_system_icons40 = require("@livechat/design-system-icons");
|
|
22795
22871
|
var import_design_system_react_components82 = require("@livechat/design-system-react-components");
|
|
@@ -22822,7 +22898,7 @@ function Waitlist({ image }) {
|
|
|
22822
22898
|
const { user, isUserFetching } = (0, import_developer_studio_ui_react45.useUserContext)();
|
|
22823
22899
|
const { data: userHasInstalledWorkflows, isLoading: isWorkflowsAppLoading } = useFetchUserInstalledWorkflows(user);
|
|
22824
22900
|
const navigate = (0, import_react_router_dom26.useNavigate)();
|
|
22825
|
-
(0,
|
|
22901
|
+
(0, import_react109.useEffect)(() => {
|
|
22826
22902
|
if (userHasInstalledWorkflows) {
|
|
22827
22903
|
navigate("/workflow/list");
|
|
22828
22904
|
}
|