@livechat/platform-workflows 0.0.96 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-I7LVNCZF.mjs +144 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1990 -1652
- package/dist/index.mjs +1378 -1063
- package/dist/tests.d.mts +8 -0
- package/dist/tests.d.ts +8 -0
- package/dist/tests.js +8 -0
- package/dist/tests.mjs +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
__spreadProps,
|
|
8
8
|
__spreadValues,
|
|
9
9
|
__toESM
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-I7LVNCZF.mjs";
|
|
11
11
|
|
|
12
12
|
// ../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js
|
|
13
13
|
var require_react_is_production_min = __commonJS({
|
|
@@ -412,7 +412,6 @@ import { Route as Route7, Routes as Routes7 } from "react-router-dom";
|
|
|
412
412
|
|
|
413
413
|
// src/views/Waitlist/index.tsx
|
|
414
414
|
import { useEffect } from "react";
|
|
415
|
-
import { useNavigate } from "react-router-dom";
|
|
416
415
|
|
|
417
416
|
// ../../../node_modules/.pnpm/@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1/node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js
|
|
418
417
|
import * as React2 from "react";
|
|
@@ -1762,15 +1761,6 @@ import {
|
|
|
1762
1761
|
View
|
|
1763
1762
|
} from "@livechat/developer-studio-ui-react";
|
|
1764
1763
|
|
|
1765
|
-
// src/hooks/workflows.ts
|
|
1766
|
-
import { useMutation, useQuery as useQuery2, useQueryClient } from "@tanstack/react-query";
|
|
1767
|
-
import { api as api2, IntegrationNames } from "@livechat/developer-studio-api";
|
|
1768
|
-
import {
|
|
1769
|
-
useNotificationContext,
|
|
1770
|
-
useUserContext
|
|
1771
|
-
} from "@livechat/developer-studio-ui-react";
|
|
1772
|
-
import { integrationCredentialsQueryKeys } from "@livechat/platform-integrations";
|
|
1773
|
-
|
|
1774
1764
|
// src/hooks/apps.ts
|
|
1775
1765
|
import { useQuery } from "@tanstack/react-query";
|
|
1776
1766
|
import { api } from "@livechat/developer-studio-api";
|
|
@@ -1793,7 +1783,65 @@ var useFetchInstalledApp = (appId, license) => {
|
|
|
1793
1783
|
);
|
|
1794
1784
|
};
|
|
1795
1785
|
|
|
1786
|
+
// src/hooks/navigate.ts
|
|
1787
|
+
import { useModuleRelativeNavigate } from "@livechat/developer-studio-ui-react";
|
|
1788
|
+
function useWorkflowsRelativeNavigate() {
|
|
1789
|
+
const relativeNavigate = useModuleRelativeNavigate(
|
|
1790
|
+
getWorkflowsEnv("subPath")
|
|
1791
|
+
);
|
|
1792
|
+
return relativeNavigate;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
// src/hooks/user.ts
|
|
1796
|
+
import { useMutation, useQuery as useQuery2, useQueryClient } from "@tanstack/react-query";
|
|
1797
|
+
import { api as api2 } from "@livechat/developer-studio-api";
|
|
1798
|
+
var userQueryKeys = {
|
|
1799
|
+
accounts: {
|
|
1800
|
+
account: {
|
|
1801
|
+
getInfo: ["accounts.account.getInfo"]
|
|
1802
|
+
},
|
|
1803
|
+
products: {
|
|
1804
|
+
getOrganizationProducts: ["accounts.products.getOrganizationProducts"]
|
|
1805
|
+
}
|
|
1806
|
+
},
|
|
1807
|
+
dps: {
|
|
1808
|
+
getUser: ["dps.getUser"],
|
|
1809
|
+
getUserIntegrations: ["dps.getUserIntegrations"]
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
var useFetchOrganizationProducts = () => {
|
|
1813
|
+
var _b;
|
|
1814
|
+
const _a = useQuery2(
|
|
1815
|
+
userQueryKeys.accounts.products.getOrganizationProducts,
|
|
1816
|
+
() => api2.platform.accounts.products.getOrganizationProducts()
|
|
1817
|
+
), { data, isLoading } = _a, rest = __objRest(_a, ["data", "isLoading"]);
|
|
1818
|
+
return __spreadValues({ data: (_b = data == null ? void 0 : data.data) != null ? _b : [], isLoading }, rest);
|
|
1819
|
+
};
|
|
1820
|
+
var useUpdateOrganizationProducts = () => {
|
|
1821
|
+
const queryClient = useQueryClient();
|
|
1822
|
+
const { mutateAsync: updateOrganizationProducts, isLoading } = useMutation(
|
|
1823
|
+
({ productName }) => api2.platform.accounts.products.updateOrganizationProducts({
|
|
1824
|
+
product: productName
|
|
1825
|
+
}),
|
|
1826
|
+
{
|
|
1827
|
+
onSuccess: (_2) => {
|
|
1828
|
+
void queryClient.refetchQueries({
|
|
1829
|
+
queryKey: userQueryKeys.accounts.products.getOrganizationProducts
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
);
|
|
1834
|
+
return { updateOrganizationProducts, isLoading };
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1796
1837
|
// src/hooks/workflows.ts
|
|
1838
|
+
import { useMutation as useMutation2, useQuery as useQuery3, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
1839
|
+
import { api as api3, IntegrationNames } from "@livechat/developer-studio-api";
|
|
1840
|
+
import {
|
|
1841
|
+
useNotificationContext,
|
|
1842
|
+
useUserContext
|
|
1843
|
+
} from "@livechat/developer-studio-ui-react";
|
|
1844
|
+
import { integrationCredentialsQueryKeys } from "@livechat/platform-integrations";
|
|
1797
1845
|
var queryKeys = {
|
|
1798
1846
|
workflow: {
|
|
1799
1847
|
base: "workflow",
|
|
@@ -1801,10 +1849,7 @@ var queryKeys = {
|
|
|
1801
1849
|
},
|
|
1802
1850
|
workflows: {
|
|
1803
1851
|
base: "workflows",
|
|
1804
|
-
get: (
|
|
1805
|
-
queryKeys.workflows.base,
|
|
1806
|
-
params
|
|
1807
|
-
]
|
|
1852
|
+
get: () => [queryKeys.workflows.base]
|
|
1808
1853
|
},
|
|
1809
1854
|
workflowExecutions: {
|
|
1810
1855
|
base: ["executions"],
|
|
@@ -1828,21 +1873,13 @@ var useFetchUserInstalledWorkflows = () => {
|
|
|
1828
1873
|
isWorkflowAppLoading: !isSuccess || isUserFetching
|
|
1829
1874
|
};
|
|
1830
1875
|
};
|
|
1831
|
-
var useFetchWorkflows = (
|
|
1876
|
+
var useFetchWorkflows = () => {
|
|
1832
1877
|
const notifications = useNotificationContext();
|
|
1833
|
-
return
|
|
1834
|
-
queryKeys.workflows.get(
|
|
1878
|
+
return useQuery3(
|
|
1879
|
+
queryKeys.workflows.get(),
|
|
1835
1880
|
() => __async(void 0, null, function* () {
|
|
1836
|
-
const workflows = yield
|
|
1837
|
-
return workflows
|
|
1838
|
-
if (params.name) {
|
|
1839
|
-
if (params.name.exact) {
|
|
1840
|
-
return workflow.name === params.name.value;
|
|
1841
|
-
}
|
|
1842
|
-
return workflow.name.toLowerCase().includes(params.name.value.toLowerCase());
|
|
1843
|
-
}
|
|
1844
|
-
return true;
|
|
1845
|
-
});
|
|
1881
|
+
const workflows = yield api3.integrations.text.platform.workflow.workflows.getWorkflows();
|
|
1882
|
+
return workflows;
|
|
1846
1883
|
}),
|
|
1847
1884
|
{
|
|
1848
1885
|
onError: (e) => {
|
|
@@ -1853,10 +1890,10 @@ var useFetchWorkflows = (params) => {
|
|
|
1853
1890
|
};
|
|
1854
1891
|
var useFetchWorkflow = (workflowId) => {
|
|
1855
1892
|
const notifications = useNotificationContext();
|
|
1856
|
-
return
|
|
1893
|
+
return useQuery3(
|
|
1857
1894
|
queryKeys.workflow.get(workflowId),
|
|
1858
1895
|
() => __async(void 0, null, function* () {
|
|
1859
|
-
const workflow = yield
|
|
1896
|
+
const workflow = yield api3.integrations.text.platform.workflow.workflows.getWorkflow(
|
|
1860
1897
|
workflowId
|
|
1861
1898
|
);
|
|
1862
1899
|
return workflow;
|
|
@@ -1871,10 +1908,10 @@ var useFetchWorkflow = (workflowId) => {
|
|
|
1871
1908
|
};
|
|
1872
1909
|
var useFetchWorkflowExecutionList = (workflowId) => {
|
|
1873
1910
|
const notifications = useNotificationContext();
|
|
1874
|
-
return
|
|
1911
|
+
return useQuery3(
|
|
1875
1912
|
queryKeys.workflowExecutions.get(workflowId),
|
|
1876
1913
|
() => __async(void 0, null, function* () {
|
|
1877
|
-
const executions = yield
|
|
1914
|
+
const executions = yield api3.integrations.text.platform.workflow.workflows.getWorkflowExecutionsList(
|
|
1878
1915
|
workflowId
|
|
1879
1916
|
);
|
|
1880
1917
|
return executions;
|
|
@@ -1888,17 +1925,17 @@ var useFetchWorkflowExecutionList = (workflowId) => {
|
|
|
1888
1925
|
);
|
|
1889
1926
|
};
|
|
1890
1927
|
var useCreateWorkflow = () => {
|
|
1891
|
-
const queryClient =
|
|
1928
|
+
const queryClient = useQueryClient2();
|
|
1892
1929
|
const notifications = useNotificationContext();
|
|
1893
1930
|
const { user } = useUserContext();
|
|
1894
|
-
return
|
|
1931
|
+
return useMutation2(
|
|
1895
1932
|
(payload) => __async(void 0, null, function* () {
|
|
1896
1933
|
const workflow = __spreadProps(__spreadValues({}, payload), {
|
|
1897
1934
|
definition: __spreadProps(__spreadValues({}, payload.definition), {
|
|
1898
1935
|
ownerEmail: user == null ? void 0 : user.meta.email
|
|
1899
1936
|
})
|
|
1900
1937
|
});
|
|
1901
|
-
const { data } = yield
|
|
1938
|
+
const { data } = yield api3.integrations.text.platform.workflow.workflows.createWorkflow(
|
|
1902
1939
|
workflow
|
|
1903
1940
|
);
|
|
1904
1941
|
return data.id;
|
|
@@ -1906,9 +1943,7 @@ var useCreateWorkflow = () => {
|
|
|
1906
1943
|
{
|
|
1907
1944
|
onSuccess: (id) => __async(void 0, null, function* () {
|
|
1908
1945
|
var _a;
|
|
1909
|
-
const textCredential = (_a = queryClient.getQueryData(
|
|
1910
|
-
integrationCredentialsQueryKeys.getCredentials()
|
|
1911
|
-
)) == null ? void 0 : _a.find(
|
|
1946
|
+
const textCredential = (_a = queryClient.getQueryData(integrationCredentialsQueryKeys.getCredentials())) == null ? void 0 : _a.find(
|
|
1912
1947
|
(x) => x.provider === IntegrationNames.Text && x.type === "text_auth"
|
|
1913
1948
|
);
|
|
1914
1949
|
if (!textCredential) {
|
|
@@ -1916,7 +1951,7 @@ var useCreateWorkflow = () => {
|
|
|
1916
1951
|
integrationCredentialsQueryKeys.getCredentials()
|
|
1917
1952
|
);
|
|
1918
1953
|
}
|
|
1919
|
-
const workflow = yield
|
|
1954
|
+
const workflow = yield api3.integrations.text.platform.workflow.workflows.getWorkflow(
|
|
1920
1955
|
id
|
|
1921
1956
|
);
|
|
1922
1957
|
queryClient.setQueryData(
|
|
@@ -1932,10 +1967,10 @@ var useCreateWorkflow = () => {
|
|
|
1932
1967
|
);
|
|
1933
1968
|
};
|
|
1934
1969
|
var useCreateWorkflowDraft = () => {
|
|
1935
|
-
const queryClient =
|
|
1970
|
+
const queryClient = useQueryClient2();
|
|
1936
1971
|
const notifications = useNotificationContext();
|
|
1937
1972
|
const { user } = useUserContext();
|
|
1938
|
-
return
|
|
1973
|
+
return useMutation2(
|
|
1939
1974
|
(payload) => __async(void 0, null, function* () {
|
|
1940
1975
|
const workflow = __spreadProps(__spreadValues({}, payload), {
|
|
1941
1976
|
definition: __spreadProps(__spreadValues({}, payload.definition), {
|
|
@@ -1944,7 +1979,7 @@ var useCreateWorkflowDraft = () => {
|
|
|
1944
1979
|
});
|
|
1945
1980
|
const {
|
|
1946
1981
|
data: { id }
|
|
1947
|
-
} = yield
|
|
1982
|
+
} = yield api3.integrations.text.platform.workflow.workflows.createWorkflowDraft(
|
|
1948
1983
|
workflow.id,
|
|
1949
1984
|
workflow
|
|
1950
1985
|
);
|
|
@@ -1952,7 +1987,7 @@ var useCreateWorkflowDraft = () => {
|
|
|
1952
1987
|
}),
|
|
1953
1988
|
{
|
|
1954
1989
|
onSuccess: (id) => __async(void 0, null, function* () {
|
|
1955
|
-
const workflow = yield
|
|
1990
|
+
const workflow = yield api3.integrations.text.platform.workflow.workflows.getWorkflow(
|
|
1956
1991
|
id
|
|
1957
1992
|
);
|
|
1958
1993
|
queryClient.setQueryData(
|
|
@@ -1968,11 +2003,11 @@ var useCreateWorkflowDraft = () => {
|
|
|
1968
2003
|
);
|
|
1969
2004
|
};
|
|
1970
2005
|
var useUpdateWorkflow = () => {
|
|
1971
|
-
const queryClient =
|
|
2006
|
+
const queryClient = useQueryClient2();
|
|
1972
2007
|
const notifications = useNotificationContext();
|
|
1973
|
-
return
|
|
2008
|
+
return useMutation2(
|
|
1974
2009
|
(workflow) => __async(void 0, null, function* () {
|
|
1975
|
-
const { data } = yield
|
|
2010
|
+
const { data } = yield api3.integrations.text.platform.workflow.workflows.updateWorkflow(
|
|
1976
2011
|
workflow.id,
|
|
1977
2012
|
workflow
|
|
1978
2013
|
);
|
|
@@ -1989,11 +2024,11 @@ var useUpdateWorkflow = () => {
|
|
|
1989
2024
|
);
|
|
1990
2025
|
};
|
|
1991
2026
|
var useDeleteWorkflow = () => {
|
|
1992
|
-
const queryClient =
|
|
2027
|
+
const queryClient = useQueryClient2();
|
|
1993
2028
|
const notifications = useNotificationContext();
|
|
1994
|
-
return
|
|
2029
|
+
return useMutation2(
|
|
1995
2030
|
(workflow) => __async(void 0, null, function* () {
|
|
1996
|
-
yield
|
|
2031
|
+
yield api3.integrations.text.platform.workflow.workflows.deleteWorkflow(
|
|
1997
2032
|
workflow.id
|
|
1998
2033
|
);
|
|
1999
2034
|
}),
|
|
@@ -2017,11 +2052,11 @@ var useDeleteWorkflow = () => {
|
|
|
2017
2052
|
);
|
|
2018
2053
|
};
|
|
2019
2054
|
var usePublishWorkflowDraft = () => {
|
|
2020
|
-
const queryClient =
|
|
2055
|
+
const queryClient = useQueryClient2();
|
|
2021
2056
|
const notifications = useNotificationContext();
|
|
2022
|
-
return
|
|
2057
|
+
return useMutation2(
|
|
2023
2058
|
(workflow) => __async(void 0, null, function* () {
|
|
2024
|
-
const { data } = yield
|
|
2059
|
+
const { data } = yield api3.integrations.text.platform.workflow.workflows.publishWorkflowDraft(
|
|
2025
2060
|
workflow.id
|
|
2026
2061
|
);
|
|
2027
2062
|
return { id: data.id };
|
|
@@ -2029,7 +2064,7 @@ var usePublishWorkflowDraft = () => {
|
|
|
2029
2064
|
{
|
|
2030
2065
|
onSuccess: (_2, draft) => __async(void 0, null, function* () {
|
|
2031
2066
|
if (draft.related_workflow_id) {
|
|
2032
|
-
const workflow = yield
|
|
2067
|
+
const workflow = yield api3.integrations.text.platform.workflow.workflows.getWorkflow(
|
|
2033
2068
|
draft.related_workflow_id
|
|
2034
2069
|
);
|
|
2035
2070
|
queryClient.setQueryData(
|
|
@@ -2037,7 +2072,7 @@ var usePublishWorkflowDraft = () => {
|
|
|
2037
2072
|
() => workflow
|
|
2038
2073
|
);
|
|
2039
2074
|
} else {
|
|
2040
|
-
const workflow = yield
|
|
2075
|
+
const workflow = yield api3.integrations.text.platform.workflow.workflows.getWorkflow(
|
|
2041
2076
|
draft.id
|
|
2042
2077
|
);
|
|
2043
2078
|
queryClient.setQueryData(
|
|
@@ -2054,11 +2089,11 @@ var usePublishWorkflowDraft = () => {
|
|
|
2054
2089
|
);
|
|
2055
2090
|
};
|
|
2056
2091
|
var useActivateWorkflow = () => {
|
|
2057
|
-
const queryClient =
|
|
2092
|
+
const queryClient = useQueryClient2();
|
|
2058
2093
|
const notifications = useNotificationContext();
|
|
2059
|
-
return
|
|
2094
|
+
return useMutation2(
|
|
2060
2095
|
(_0) => __async(void 0, [_0], function* ({ id, active }) {
|
|
2061
|
-
yield
|
|
2096
|
+
yield api3.integrations.text.platform.workflow.workflows.toggleWorkflowActivation(
|
|
2062
2097
|
id,
|
|
2063
2098
|
active
|
|
2064
2099
|
);
|
|
@@ -2080,12 +2115,12 @@ var useActivateWorkflow = () => {
|
|
|
2080
2115
|
};
|
|
2081
2116
|
var useExecuteWorkflow = () => {
|
|
2082
2117
|
const notifications = useNotificationContext();
|
|
2083
|
-
return
|
|
2118
|
+
return useMutation2(
|
|
2084
2119
|
(_0) => __async(void 0, [_0], function* ({
|
|
2085
2120
|
workflow,
|
|
2086
2121
|
input
|
|
2087
2122
|
}) {
|
|
2088
|
-
yield
|
|
2123
|
+
yield api3.integrations.text.platform.workflow.workflows.executeWorkflow(
|
|
2089
2124
|
workflow.id,
|
|
2090
2125
|
input
|
|
2091
2126
|
);
|
|
@@ -2099,11 +2134,9 @@ var useExecuteWorkflow = () => {
|
|
|
2099
2134
|
};
|
|
2100
2135
|
var useGenerateAIResponse = () => {
|
|
2101
2136
|
const notifications = useNotificationContext();
|
|
2102
|
-
return
|
|
2137
|
+
return useMutation2(
|
|
2103
2138
|
(payload) => __async(void 0, null, function* () {
|
|
2104
|
-
const response = yield
|
|
2105
|
-
payload
|
|
2106
|
-
);
|
|
2139
|
+
const response = yield api3.integrations.text.ai.generateResponses(payload);
|
|
2107
2140
|
return response;
|
|
2108
2141
|
}),
|
|
2109
2142
|
{
|
|
@@ -2160,10 +2193,10 @@ var imgContainerCss = css`
|
|
|
2160
2193
|
`;
|
|
2161
2194
|
function Waitlist({ image }) {
|
|
2162
2195
|
const { userHasInstalledWorkflows, isWorkflowAppLoading } = useFetchUserInstalledWorkflows();
|
|
2163
|
-
const navigate =
|
|
2196
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
2164
2197
|
useEffect(() => {
|
|
2165
2198
|
if (userHasInstalledWorkflows) {
|
|
2166
|
-
navigate("/
|
|
2199
|
+
navigate("/list");
|
|
2167
2200
|
}
|
|
2168
2201
|
}, [userHasInstalledWorkflows, navigate]);
|
|
2169
2202
|
if (isWorkflowAppLoading) {
|
|
@@ -2235,18 +2268,12 @@ function Waitlist({ image }) {
|
|
|
2235
2268
|
var Waitlist_default = Waitlist;
|
|
2236
2269
|
|
|
2237
2270
|
// src/views/Workflows/index.tsx
|
|
2238
|
-
import { useEffect as
|
|
2239
|
-
import { Navigate as Navigate2, Route as Route6, Routes as Routes6
|
|
2271
|
+
import { useEffect as useEffect22 } from "react";
|
|
2272
|
+
import { Navigate as Navigate2, Route as Route6, Routes as Routes6 } from "react-router-dom";
|
|
2240
2273
|
import { Loader as Loader6 } from "@livechat/developer-studio-ui-react";
|
|
2241
2274
|
|
|
2242
2275
|
// src/views/Workflows/Creator/index.tsx
|
|
2243
|
-
import {
|
|
2244
|
-
Route as Route3,
|
|
2245
|
-
Routes as Routes3,
|
|
2246
|
-
useLocation as useLocation6,
|
|
2247
|
-
useNavigate as useNavigate14,
|
|
2248
|
-
useParams as useParams5
|
|
2249
|
-
} from "react-router-dom";
|
|
2276
|
+
import { Route as Route3, Routes as Routes3, useLocation as useLocation6, useParams as useParams5 } from "react-router-dom";
|
|
2250
2277
|
import {
|
|
2251
2278
|
Loader as Loader3,
|
|
2252
2279
|
useFetchOrganizationProducts as useFetchOrganizationProducts2
|
|
@@ -9192,12 +9219,275 @@ var shopifyTriggerTemplates = () => ({
|
|
|
9192
9219
|
}
|
|
9193
9220
|
});
|
|
9194
9221
|
|
|
9222
|
+
// src/constants/specification/Slack/index.ts
|
|
9223
|
+
import {
|
|
9224
|
+
IntegrationDisplayNames as IntegrationDisplayNames8,
|
|
9225
|
+
IntegrationNames as IntegrationNames9,
|
|
9226
|
+
SlackEventNames
|
|
9227
|
+
} from "@livechat/developer-studio-api";
|
|
9228
|
+
import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType9 } from "@livechat/developer-studio-api/src";
|
|
9229
|
+
var SlackTriggerNames = {
|
|
9230
|
+
ChannelNewMessagePosted: `${IntegrationNames9.Slack}-${SlackEventNames.ChannelNewMessagePosted}`,
|
|
9231
|
+
MemberNewMention: `${IntegrationNames9.Slack}-${SlackEventNames.MemberNewMention}`
|
|
9232
|
+
};
|
|
9233
|
+
var slackTaskConfigs = () => ({
|
|
9234
|
+
["SEND_MESSAGE" /* SendMessage */]: {
|
|
9235
|
+
key: "SEND_MESSAGE" /* SendMessage */,
|
|
9236
|
+
type: WorkflowDefinitionTaskType9.http,
|
|
9237
|
+
url: `${getWorkflowsEnv("workflowsApiUr")}/functions/slack-send-message`,
|
|
9238
|
+
customization: {
|
|
9239
|
+
provider: IntegrationNames9.Slack,
|
|
9240
|
+
product: IntegrationDisplayNames8.Slack,
|
|
9241
|
+
displayName: "Send Slack Message",
|
|
9242
|
+
shortDescription: "Send a message via Slack bot to any public or private channel.",
|
|
9243
|
+
description: "Send a message via Slack bot to any public or private channel."
|
|
9244
|
+
},
|
|
9245
|
+
specification: {
|
|
9246
|
+
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
9247
|
+
type: "object",
|
|
9248
|
+
required: ["channelId", "text"],
|
|
9249
|
+
properties: {
|
|
9250
|
+
channelId: {
|
|
9251
|
+
$ref: "#/$defs/slack_channel_id"
|
|
9252
|
+
},
|
|
9253
|
+
text: {
|
|
9254
|
+
type: "string",
|
|
9255
|
+
title: "Bot message content",
|
|
9256
|
+
description: "This message will appear from your connected Slack bot. @mentions and formatting are supported."
|
|
9257
|
+
}
|
|
9258
|
+
}
|
|
9259
|
+
}),
|
|
9260
|
+
output: WORKFLOW_HTTP_TASK_OUTPUT_SCHEMA({
|
|
9261
|
+
type: "object",
|
|
9262
|
+
properties: {
|
|
9263
|
+
timestamp: {
|
|
9264
|
+
type: "string",
|
|
9265
|
+
title: "Timestamp"
|
|
9266
|
+
},
|
|
9267
|
+
channelId: {
|
|
9268
|
+
type: "string",
|
|
9269
|
+
title: "Channel ID"
|
|
9270
|
+
}
|
|
9271
|
+
}
|
|
9272
|
+
})
|
|
9273
|
+
}
|
|
9274
|
+
},
|
|
9275
|
+
["CREATE_CHANNEL" /* CreateChannel */]: {
|
|
9276
|
+
key: "CREATE_CHANNEL" /* CreateChannel */,
|
|
9277
|
+
type: WorkflowDefinitionTaskType9.http,
|
|
9278
|
+
url: `${getWorkflowsEnv("workflowsApiUr")}/functions/slack-create_channel`,
|
|
9279
|
+
customization: {
|
|
9280
|
+
provider: IntegrationNames9.Slack,
|
|
9281
|
+
product: IntegrationDisplayNames8.Slack,
|
|
9282
|
+
displayName: "Create channel",
|
|
9283
|
+
shortDescription: "Create a new public Slack channel",
|
|
9284
|
+
description: "Create a new public Slack channel"
|
|
9285
|
+
},
|
|
9286
|
+
specification: {
|
|
9287
|
+
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
9288
|
+
type: "object",
|
|
9289
|
+
required: ["channelName"],
|
|
9290
|
+
properties: {
|
|
9291
|
+
channelName: {
|
|
9292
|
+
type: "string",
|
|
9293
|
+
title: "Channel Name",
|
|
9294
|
+
description: "Input must contain only lowercase letters, numbers, hyphens, and underscores (80 characters max)",
|
|
9295
|
+
pattern: "^[a-z0-9-_]{1,80}$",
|
|
9296
|
+
errorMessage: "Input must contain only lowercase letters, numbers, hyphens, and underscores (80 characters max)"
|
|
9297
|
+
}
|
|
9298
|
+
}
|
|
9299
|
+
}),
|
|
9300
|
+
output: WORKFLOW_HTTP_TASK_OUTPUT_SCHEMA({
|
|
9301
|
+
type: "object",
|
|
9302
|
+
properties: {
|
|
9303
|
+
channelName: {
|
|
9304
|
+
type: "string",
|
|
9305
|
+
title: "Channel Name"
|
|
9306
|
+
},
|
|
9307
|
+
channelId: {
|
|
9308
|
+
type: "string",
|
|
9309
|
+
title: "Channel ID"
|
|
9310
|
+
}
|
|
9311
|
+
}
|
|
9312
|
+
})
|
|
9313
|
+
}
|
|
9314
|
+
}
|
|
9315
|
+
});
|
|
9316
|
+
var slackTaskTemplates = () => ({
|
|
9317
|
+
["SEND_MESSAGE" /* SendMessage */]: __spreadProps(__spreadValues({}, workflowHttpTask), {
|
|
9318
|
+
name: "SEND_MESSAGE" /* SendMessage */,
|
|
9319
|
+
taskReferenceName: "slack_send_message",
|
|
9320
|
+
inputParameters: __spreadProps(__spreadValues({}, workflowHttpTask.inputParameters), {
|
|
9321
|
+
http_request: __spreadProps(__spreadValues({}, workflowHttpTask.inputParameters.http_request), {
|
|
9322
|
+
uri: `${getWorkflowsEnv(
|
|
9323
|
+
"workflowsApiUr"
|
|
9324
|
+
)}/functions/slack-send-message`,
|
|
9325
|
+
method: "POST",
|
|
9326
|
+
body: {
|
|
9327
|
+
channelId: "#{channelId}",
|
|
9328
|
+
text: "#{text}"
|
|
9329
|
+
},
|
|
9330
|
+
headers: {
|
|
9331
|
+
Accept: "application/json",
|
|
9332
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
9333
|
+
"x-cred-access-token": "${workflow.credentials.slack.access_token}"
|
|
9334
|
+
}
|
|
9335
|
+
})
|
|
9336
|
+
})
|
|
9337
|
+
}),
|
|
9338
|
+
["CREATE_CHANNEL" /* CreateChannel */]: __spreadProps(__spreadValues({}, workflowHttpTask), {
|
|
9339
|
+
name: "CREATE_CHANNEL" /* CreateChannel */,
|
|
9340
|
+
taskReferenceName: "slack_create_channel",
|
|
9341
|
+
inputParameters: __spreadProps(__spreadValues({}, workflowHttpTask.inputParameters), {
|
|
9342
|
+
http_request: __spreadProps(__spreadValues({}, workflowHttpTask.inputParameters.http_request), {
|
|
9343
|
+
uri: `${getWorkflowsEnv(
|
|
9344
|
+
"workflowsApiUr"
|
|
9345
|
+
)}/functions/slack-create-channel`,
|
|
9346
|
+
method: "POST",
|
|
9347
|
+
body: {
|
|
9348
|
+
channelName: "#{channelName}",
|
|
9349
|
+
isPrivate: "#{isPrivate}"
|
|
9350
|
+
},
|
|
9351
|
+
headers: {
|
|
9352
|
+
Accept: "application/json",
|
|
9353
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
9354
|
+
"x-cred-access-token": "${workflow.credentials.slack.access_token}"
|
|
9355
|
+
}
|
|
9356
|
+
})
|
|
9357
|
+
})
|
|
9358
|
+
})
|
|
9359
|
+
});
|
|
9360
|
+
var slackTriggerConfigs = () => {
|
|
9361
|
+
return {
|
|
9362
|
+
[SlackTriggerNames.ChannelNewMessagePosted]: {
|
|
9363
|
+
key: SlackTriggerNames.ChannelNewMessagePosted,
|
|
9364
|
+
name: SlackEventNames.ChannelNewMessagePosted,
|
|
9365
|
+
type: "webhook",
|
|
9366
|
+
customization: {
|
|
9367
|
+
provider: IntegrationNames9.Slack,
|
|
9368
|
+
product: IntegrationDisplayNames8.Slack,
|
|
9369
|
+
displayName: "New message posted on channel",
|
|
9370
|
+
shortDescription: "Triggers when any message is posted in a specified Slack channel.",
|
|
9371
|
+
description: "Works with all messages, including from bots and integrations."
|
|
9372
|
+
},
|
|
9373
|
+
specification: {
|
|
9374
|
+
input: {
|
|
9375
|
+
type: "object",
|
|
9376
|
+
required: ["channelId"],
|
|
9377
|
+
properties: {
|
|
9378
|
+
channelId: {
|
|
9379
|
+
$ref: "#/$defs/slack_channel_id"
|
|
9380
|
+
}
|
|
9381
|
+
}
|
|
9382
|
+
},
|
|
9383
|
+
output: {
|
|
9384
|
+
type: "object",
|
|
9385
|
+
required: ["text", "sub_type", "channel_id"],
|
|
9386
|
+
properties: {
|
|
9387
|
+
text: {
|
|
9388
|
+
type: "string",
|
|
9389
|
+
title: "Text Message"
|
|
9390
|
+
},
|
|
9391
|
+
sub_type: {
|
|
9392
|
+
type: "string",
|
|
9393
|
+
title: "Sub type of the event"
|
|
9394
|
+
},
|
|
9395
|
+
channel_id: {
|
|
9396
|
+
type: "string",
|
|
9397
|
+
title: "Channel ID"
|
|
9398
|
+
},
|
|
9399
|
+
username: {
|
|
9400
|
+
type: "string",
|
|
9401
|
+
title: "Name of the user"
|
|
9402
|
+
}
|
|
9403
|
+
}
|
|
9404
|
+
}
|
|
9405
|
+
}
|
|
9406
|
+
},
|
|
9407
|
+
[SlackTriggerNames.MemberNewMention]: {
|
|
9408
|
+
key: SlackTriggerNames.MemberNewMention,
|
|
9409
|
+
name: SlackEventNames.MemberNewMention,
|
|
9410
|
+
type: "webhook",
|
|
9411
|
+
customization: {
|
|
9412
|
+
provider: IntegrationNames9.Slack,
|
|
9413
|
+
product: IntegrationDisplayNames8.Slack,
|
|
9414
|
+
displayName: "New Slack mention",
|
|
9415
|
+
shortDescription: "Triggers when a team member is @mentioned in a specified Slack channel.",
|
|
9416
|
+
description: "Select which team member's @mentions should trigger this workflow."
|
|
9417
|
+
},
|
|
9418
|
+
specification: {
|
|
9419
|
+
input: {
|
|
9420
|
+
type: "object",
|
|
9421
|
+
required: ["userId"],
|
|
9422
|
+
properties: {
|
|
9423
|
+
userId: {
|
|
9424
|
+
$ref: "#/$defs/slack_user_id"
|
|
9425
|
+
}
|
|
9426
|
+
}
|
|
9427
|
+
},
|
|
9428
|
+
output: {
|
|
9429
|
+
type: "object",
|
|
9430
|
+
required: ["text", "sub_type", "channel_id"],
|
|
9431
|
+
properties: {
|
|
9432
|
+
text: {
|
|
9433
|
+
type: "string",
|
|
9434
|
+
title: "Text Message"
|
|
9435
|
+
},
|
|
9436
|
+
sub_type: {
|
|
9437
|
+
type: "string",
|
|
9438
|
+
title: "Sub type of the event"
|
|
9439
|
+
},
|
|
9440
|
+
channel_id: {
|
|
9441
|
+
type: "string",
|
|
9442
|
+
title: "Channel ID"
|
|
9443
|
+
},
|
|
9444
|
+
username: {
|
|
9445
|
+
type: "string",
|
|
9446
|
+
title: "Name of the user"
|
|
9447
|
+
}
|
|
9448
|
+
}
|
|
9449
|
+
}
|
|
9450
|
+
}
|
|
9451
|
+
}
|
|
9452
|
+
};
|
|
9453
|
+
};
|
|
9454
|
+
var slackTriggerTemplates = () => ({
|
|
9455
|
+
[SlackTriggerNames.ChannelNewMessagePosted]: {
|
|
9456
|
+
type: "webhook",
|
|
9457
|
+
webhook: {
|
|
9458
|
+
source: IntegrationNames9.Slack,
|
|
9459
|
+
event: {
|
|
9460
|
+
name: SlackEventNames.ChannelNewMessagePosted,
|
|
9461
|
+
channelId: null
|
|
9462
|
+
},
|
|
9463
|
+
headers: {
|
|
9464
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
9465
|
+
"x-adapter-slack-token": ["${workflow.credentials.slack.access_token}"]
|
|
9466
|
+
}
|
|
9467
|
+
}
|
|
9468
|
+
},
|
|
9469
|
+
[SlackTriggerNames.MemberNewMention]: {
|
|
9470
|
+
type: "webhook",
|
|
9471
|
+
webhook: {
|
|
9472
|
+
source: IntegrationNames9.Slack,
|
|
9473
|
+
event: {
|
|
9474
|
+
name: SlackEventNames.MemberNewMention,
|
|
9475
|
+
userId: null
|
|
9476
|
+
},
|
|
9477
|
+
headers: {
|
|
9478
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
9479
|
+
"x-adapter-slack-token": ["${workflow.credentials.slack.access_token}"]
|
|
9480
|
+
}
|
|
9481
|
+
}
|
|
9482
|
+
}
|
|
9483
|
+
});
|
|
9484
|
+
|
|
9195
9485
|
// src/constants/specification/utils.ts
|
|
9196
|
-
import { WorkflowDefinitionTaskType as
|
|
9486
|
+
import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType10 } from "@livechat/developer-studio-api";
|
|
9197
9487
|
var getWorkflowItemConfigs = () => {
|
|
9198
9488
|
return {
|
|
9199
|
-
tasks: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, livechatTaskConfigs()), helpdeskTaskConfigs()), mailchimpTaskConfigs()), shopifyTaskConfigs()), hubspotTaskConfigs()), bigCommerceTaskConfigs()), openAiTaskConfigs()), systemTaskConfigs()),
|
|
9200
|
-
triggers: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, livechatTriggerConfigs()), helpDeskTriggerConfigs()), mailchimpTriggerConfigs()), shopifyTriggerConfigs()), hubspotTriggerConfigs()), bigcommerceTriggerConfigs()), systemTriggerConfigs())
|
|
9489
|
+
tasks: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, livechatTaskConfigs()), helpdeskTaskConfigs()), mailchimpTaskConfigs()), shopifyTaskConfigs()), hubspotTaskConfigs()), bigCommerceTaskConfigs()), openAiTaskConfigs()), systemTaskConfigs()), slackTaskConfigs()),
|
|
9490
|
+
triggers: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, livechatTriggerConfigs()), helpDeskTriggerConfigs()), mailchimpTriggerConfigs()), shopifyTriggerConfigs()), hubspotTriggerConfigs()), slackTriggerConfigs()), bigcommerceTriggerConfigs()), systemTriggerConfigs())
|
|
9201
9491
|
};
|
|
9202
9492
|
};
|
|
9203
9493
|
var getWorkflowItemTemplates = () => ({
|
|
@@ -9209,6 +9499,7 @@ var getWorkflowItemTemplates = () => ({
|
|
|
9209
9499
|
bigcommerce: bigCommerceTaskTemplates(),
|
|
9210
9500
|
shopify: shopifyTaskTemplates(),
|
|
9211
9501
|
openai: openAiTaskTemplates(),
|
|
9502
|
+
slack: slackTaskTemplates(),
|
|
9212
9503
|
system: systemTaskTemplates()
|
|
9213
9504
|
},
|
|
9214
9505
|
triggers: {
|
|
@@ -9217,6 +9508,7 @@ var getWorkflowItemTemplates = () => ({
|
|
|
9217
9508
|
mailchimp: mailchimpTriggerTemplates(),
|
|
9218
9509
|
shopify: shopifyTriggerTemplates(),
|
|
9219
9510
|
hubspot: hubSpotTriggerTemplates(),
|
|
9511
|
+
slack: slackTriggerTemplates(),
|
|
9220
9512
|
bigcommerce: bigcommerceTriggerTemplates(),
|
|
9221
9513
|
system: systemTriggerTemplates()
|
|
9222
9514
|
}
|
|
@@ -9365,7 +9657,7 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9365
9657
|
return {
|
|
9366
9658
|
if: {
|
|
9367
9659
|
properties: {
|
|
9368
|
-
type: { const:
|
|
9660
|
+
type: { const: WorkflowDefinitionTaskType10.http },
|
|
9369
9661
|
name: { const: config2.key }
|
|
9370
9662
|
}
|
|
9371
9663
|
},
|
|
@@ -9501,6 +9793,28 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9501
9793
|
displayField: "name",
|
|
9502
9794
|
valueField: "id"
|
|
9503
9795
|
}
|
|
9796
|
+
},
|
|
9797
|
+
slack_channel_id: {
|
|
9798
|
+
type: "string",
|
|
9799
|
+
title: "Slack Channel",
|
|
9800
|
+
"x-ref": {
|
|
9801
|
+
provider: "slack",
|
|
9802
|
+
product: "slack",
|
|
9803
|
+
name: "channels",
|
|
9804
|
+
displayField: "name",
|
|
9805
|
+
valueField: "id"
|
|
9806
|
+
}
|
|
9807
|
+
},
|
|
9808
|
+
slack_user_id: {
|
|
9809
|
+
type: "string",
|
|
9810
|
+
title: "Username",
|
|
9811
|
+
"x-ref": {
|
|
9812
|
+
provider: "slack",
|
|
9813
|
+
product: "slack",
|
|
9814
|
+
name: "users",
|
|
9815
|
+
displayField: "displayName",
|
|
9816
|
+
valueField: "id"
|
|
9817
|
+
}
|
|
9504
9818
|
}
|
|
9505
9819
|
}
|
|
9506
9820
|
};
|
|
@@ -9731,8 +10045,8 @@ var WORKFLOW_SCHEMA = () => ({
|
|
|
9731
10045
|
|
|
9732
10046
|
// src/constants/templates.ts
|
|
9733
10047
|
import {
|
|
9734
|
-
IntegrationDisplayNames as
|
|
9735
|
-
IntegrationNames as
|
|
10048
|
+
IntegrationDisplayNames as IntegrationDisplayNames9,
|
|
10049
|
+
IntegrationNames as IntegrationNames10,
|
|
9736
10050
|
TextLivechatEventNames as TextLivechatEventNames2,
|
|
9737
10051
|
WorkflowTemplateCategory
|
|
9738
10052
|
} from "@livechat/developer-studio-api";
|
|
@@ -9759,25 +10073,25 @@ var getWorkflowTemplates = () => [
|
|
|
9759
10073
|
id: "1",
|
|
9760
10074
|
name: "Create HelpDesk tickets with chat summaries when a chat ends",
|
|
9761
10075
|
icons: [
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
10076
|
+
IntegrationNames10.LiveChat,
|
|
10077
|
+
IntegrationNames10.OpenAI,
|
|
10078
|
+
IntegrationNames10.HelpDesk
|
|
9765
10079
|
],
|
|
9766
10080
|
list: [
|
|
9767
10081
|
{
|
|
9768
|
-
product:
|
|
10082
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
9769
10083
|
description: "Detects when a chat ends"
|
|
9770
10084
|
},
|
|
9771
10085
|
{
|
|
9772
|
-
product:
|
|
10086
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
9773
10087
|
description: "Pulls the full chat transcript"
|
|
9774
10088
|
},
|
|
9775
10089
|
{
|
|
9776
|
-
product:
|
|
10090
|
+
product: IntegrationDisplayNames9.OpenAI,
|
|
9777
10091
|
description: "Creates a summary of the chat"
|
|
9778
10092
|
},
|
|
9779
10093
|
{
|
|
9780
|
-
product:
|
|
10094
|
+
product: IntegrationDisplayNames9.HelpDesk,
|
|
9781
10095
|
description: "Creates a new ticket with the chat summary. Use the pre-chat survey to pull the customer\u2019s email or provide a custom input"
|
|
9782
10096
|
}
|
|
9783
10097
|
],
|
|
@@ -9788,7 +10102,7 @@ var getWorkflowTemplates = () => [
|
|
|
9788
10102
|
trigger: {
|
|
9789
10103
|
type: "webhook",
|
|
9790
10104
|
webhook: {
|
|
9791
|
-
source:
|
|
10105
|
+
source: IntegrationNames10.LiveChat,
|
|
9792
10106
|
event: {
|
|
9793
10107
|
name: TextLivechatEventNames2.ChatEnded
|
|
9794
10108
|
},
|
|
@@ -9881,9 +10195,9 @@ var getWorkflowTemplates = () => [
|
|
|
9881
10195
|
}
|
|
9882
10196
|
},
|
|
9883
10197
|
products: [
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
10198
|
+
IntegrationDisplayNames9.LiveChat,
|
|
10199
|
+
IntegrationDisplayNames9.OpenAI,
|
|
10200
|
+
IntegrationDisplayNames9.HelpDesk
|
|
9887
10201
|
],
|
|
9888
10202
|
category: WorkflowTemplateCategory.ChatManagement
|
|
9889
10203
|
},
|
|
@@ -9891,30 +10205,30 @@ var getWorkflowTemplates = () => [
|
|
|
9891
10205
|
id: "2",
|
|
9892
10206
|
name: "Create HelpDesk tickets when a competitor is mentioned during a chat",
|
|
9893
10207
|
icons: [
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
10208
|
+
IntegrationNames10.LiveChat,
|
|
10209
|
+
IntegrationNames10.OpenAI,
|
|
10210
|
+
IntegrationNames10.HelpDesk,
|
|
10211
|
+
IntegrationNames10.Mailchimp
|
|
9898
10212
|
],
|
|
9899
10213
|
list: [
|
|
9900
10214
|
{
|
|
9901
|
-
product:
|
|
10215
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
9902
10216
|
description: "Detects when a competitor is mentioned in the chat based on keywords"
|
|
9903
10217
|
},
|
|
9904
10218
|
{
|
|
9905
|
-
product:
|
|
10219
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
9906
10220
|
description: "Pulls the chat transcript data for analysis"
|
|
9907
10221
|
},
|
|
9908
10222
|
{
|
|
9909
|
-
product:
|
|
10223
|
+
product: IntegrationDisplayNames9.OpenAI,
|
|
9910
10224
|
description: "Analyzes the competitor mention in the context of sentiment"
|
|
9911
10225
|
},
|
|
9912
10226
|
{
|
|
9913
|
-
product:
|
|
10227
|
+
product: IntegrationDisplayNames9.HelpDesk,
|
|
9914
10228
|
description: "Creates a notification ticket with the chat details. Use the LiveChat pre-chat survey to pull the customer\u2019s email or provide a custom input"
|
|
9915
10229
|
},
|
|
9916
10230
|
{
|
|
9917
|
-
product:
|
|
10231
|
+
product: IntegrationDisplayNames9.Mailchimp,
|
|
9918
10232
|
description: "Adds a note to the customer in your Mailchimp"
|
|
9919
10233
|
}
|
|
9920
10234
|
],
|
|
@@ -10028,7 +10342,7 @@ var getWorkflowTemplates = () => [
|
|
|
10028
10342
|
trigger: {
|
|
10029
10343
|
type: "webhook",
|
|
10030
10344
|
webhook: {
|
|
10031
|
-
source:
|
|
10345
|
+
source: IntegrationNames10.LiveChat,
|
|
10032
10346
|
event: {
|
|
10033
10347
|
name: TextLivechatEventNames2.ChatMessage,
|
|
10034
10348
|
filter: void 0
|
|
@@ -10042,10 +10356,10 @@ var getWorkflowTemplates = () => [
|
|
|
10042
10356
|
}
|
|
10043
10357
|
},
|
|
10044
10358
|
products: [
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10359
|
+
IntegrationDisplayNames9.LiveChat,
|
|
10360
|
+
IntegrationDisplayNames9.OpenAI,
|
|
10361
|
+
IntegrationDisplayNames9.HelpDesk,
|
|
10362
|
+
IntegrationDisplayNames9.Mailchimp
|
|
10049
10363
|
],
|
|
10050
10364
|
category: WorkflowTemplateCategory.NotificationAndAlerts
|
|
10051
10365
|
},
|
|
@@ -10053,30 +10367,30 @@ var getWorkflowTemplates = () => [
|
|
|
10053
10367
|
id: "3",
|
|
10054
10368
|
name: "Send summarized chat insights to HelpDesk",
|
|
10055
10369
|
icons: [
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10370
|
+
IntegrationNames10.LiveChat,
|
|
10371
|
+
IntegrationNames10.OpenAI,
|
|
10372
|
+
IntegrationNames10.HelpDesk,
|
|
10373
|
+
IntegrationNames10.Mailchimp
|
|
10060
10374
|
],
|
|
10061
10375
|
list: [
|
|
10062
10376
|
{
|
|
10063
|
-
product:
|
|
10377
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10064
10378
|
description: "Detects when a chat ends"
|
|
10065
10379
|
},
|
|
10066
10380
|
{
|
|
10067
|
-
product:
|
|
10381
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10068
10382
|
description: "Pulls the chat transcript data"
|
|
10069
10383
|
},
|
|
10070
10384
|
{
|
|
10071
|
-
product:
|
|
10385
|
+
product: IntegrationDisplayNames9.OpenAI,
|
|
10072
10386
|
description: "Summarizes the chat transcript"
|
|
10073
10387
|
},
|
|
10074
10388
|
{
|
|
10075
|
-
product:
|
|
10389
|
+
product: IntegrationDisplayNames9.HelpDesk,
|
|
10076
10390
|
description: "Creates a ticket with the summarized chat and the customer as the ticket requester. Use the LiveChat pre-chat survey to pull the customer\u2019s email or provide a custom input"
|
|
10077
10391
|
},
|
|
10078
10392
|
{
|
|
10079
|
-
product:
|
|
10393
|
+
product: IntegrationDisplayNames9.Mailchimp,
|
|
10080
10394
|
description: "Adds a custom note to the customer in Mailchimp"
|
|
10081
10395
|
}
|
|
10082
10396
|
],
|
|
@@ -10189,7 +10503,7 @@ var getWorkflowTemplates = () => [
|
|
|
10189
10503
|
trigger: {
|
|
10190
10504
|
type: "webhook",
|
|
10191
10505
|
webhook: {
|
|
10192
|
-
source:
|
|
10506
|
+
source: IntegrationNames10.LiveChat,
|
|
10193
10507
|
event: {
|
|
10194
10508
|
name: TextLivechatEventNames2.ChatEnded
|
|
10195
10509
|
},
|
|
@@ -10202,10 +10516,10 @@ var getWorkflowTemplates = () => [
|
|
|
10202
10516
|
}
|
|
10203
10517
|
},
|
|
10204
10518
|
products: [
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10519
|
+
IntegrationDisplayNames9.LiveChat,
|
|
10520
|
+
IntegrationDisplayNames9.OpenAI,
|
|
10521
|
+
IntegrationDisplayNames9.HelpDesk,
|
|
10522
|
+
IntegrationDisplayNames9.Mailchimp
|
|
10209
10523
|
],
|
|
10210
10524
|
category: WorkflowTemplateCategory.ChatManagement
|
|
10211
10525
|
},
|
|
@@ -10213,30 +10527,30 @@ var getWorkflowTemplates = () => [
|
|
|
10213
10527
|
id: "4",
|
|
10214
10528
|
name: "Send custom campaigns to customers on negative chat sentiment",
|
|
10215
10529
|
icons: [
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10530
|
+
IntegrationNames10.LiveChat,
|
|
10531
|
+
IntegrationNames10.Shopify,
|
|
10532
|
+
IntegrationNames10.OpenAI,
|
|
10533
|
+
IntegrationNames10.Mailchimp
|
|
10220
10534
|
],
|
|
10221
10535
|
list: [
|
|
10222
10536
|
{
|
|
10223
|
-
product:
|
|
10537
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10224
10538
|
description: "Detects when a chat ends"
|
|
10225
10539
|
},
|
|
10226
10540
|
{
|
|
10227
|
-
product:
|
|
10541
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10228
10542
|
description: "Pulls the chat transcript"
|
|
10229
10543
|
},
|
|
10230
10544
|
{
|
|
10231
|
-
product:
|
|
10545
|
+
product: IntegrationDisplayNames9.Shopify,
|
|
10232
10546
|
description: "Pulls customer data from Shopify"
|
|
10233
10547
|
},
|
|
10234
10548
|
{
|
|
10235
|
-
product:
|
|
10549
|
+
product: IntegrationDisplayNames9.OpenAI,
|
|
10236
10550
|
description: "Analyzes the chat sentiment"
|
|
10237
10551
|
},
|
|
10238
10552
|
{
|
|
10239
|
-
product:
|
|
10553
|
+
product: IntegrationDisplayNames9.Mailchimp,
|
|
10240
10554
|
description: "Sends a custom campaign through Mailchimp"
|
|
10241
10555
|
}
|
|
10242
10556
|
],
|
|
@@ -10352,7 +10666,7 @@ var getWorkflowTemplates = () => [
|
|
|
10352
10666
|
trigger: {
|
|
10353
10667
|
type: "webhook",
|
|
10354
10668
|
webhook: {
|
|
10355
|
-
source:
|
|
10669
|
+
source: IntegrationNames10.LiveChat,
|
|
10356
10670
|
event: {
|
|
10357
10671
|
name: TextLivechatEventNames2.ChatEnded
|
|
10358
10672
|
},
|
|
@@ -10365,10 +10679,10 @@ var getWorkflowTemplates = () => [
|
|
|
10365
10679
|
}
|
|
10366
10680
|
},
|
|
10367
10681
|
products: [
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10371
|
-
|
|
10682
|
+
IntegrationDisplayNames9.LiveChat,
|
|
10683
|
+
IntegrationDisplayNames9.Shopify,
|
|
10684
|
+
IntegrationDisplayNames9.OpenAI,
|
|
10685
|
+
IntegrationDisplayNames9.Mailchimp
|
|
10372
10686
|
],
|
|
10373
10687
|
category: WorkflowTemplateCategory.SalesManagement
|
|
10374
10688
|
},
|
|
@@ -10376,29 +10690,29 @@ var getWorkflowTemplates = () => [
|
|
|
10376
10690
|
id: "5",
|
|
10377
10691
|
name: "Add leads to Mailchimp",
|
|
10378
10692
|
icons: [
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10693
|
+
IntegrationNames10.LiveChat,
|
|
10694
|
+
IntegrationNames10.OpenAI,
|
|
10695
|
+
IntegrationNames10.Mailchimp
|
|
10382
10696
|
],
|
|
10383
10697
|
list: [
|
|
10384
10698
|
{
|
|
10385
|
-
product:
|
|
10699
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10386
10700
|
description: "Detects when a chat ends"
|
|
10387
10701
|
},
|
|
10388
10702
|
{
|
|
10389
|
-
product:
|
|
10703
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10390
10704
|
description: "Pulls the chat transcript data"
|
|
10391
10705
|
},
|
|
10392
10706
|
{
|
|
10393
|
-
product:
|
|
10707
|
+
product: IntegrationDisplayNames9.OpenAI,
|
|
10394
10708
|
description: "Analyzes the chat sentiment"
|
|
10395
10709
|
},
|
|
10396
10710
|
{
|
|
10397
|
-
product:
|
|
10711
|
+
product: IntegrationDisplayNames9.Mailchimp,
|
|
10398
10712
|
description: "Adds new subscriber to Mailchimp or updates existing one"
|
|
10399
10713
|
},
|
|
10400
10714
|
{
|
|
10401
|
-
product:
|
|
10715
|
+
product: IntegrationDisplayNames9.Mailchimp,
|
|
10402
10716
|
description: "Adds a custom tag to a subscriber"
|
|
10403
10717
|
}
|
|
10404
10718
|
],
|
|
@@ -10508,7 +10822,7 @@ var getWorkflowTemplates = () => [
|
|
|
10508
10822
|
trigger: {
|
|
10509
10823
|
type: "webhook",
|
|
10510
10824
|
webhook: {
|
|
10511
|
-
source:
|
|
10825
|
+
source: IntegrationNames10.LiveChat,
|
|
10512
10826
|
event: {
|
|
10513
10827
|
name: TextLivechatEventNames2.ChatEnded
|
|
10514
10828
|
},
|
|
@@ -10521,23 +10835,23 @@ var getWorkflowTemplates = () => [
|
|
|
10521
10835
|
}
|
|
10522
10836
|
},
|
|
10523
10837
|
products: [
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10838
|
+
IntegrationDisplayNames9.LiveChat,
|
|
10839
|
+
IntegrationDisplayNames9.OpenAI,
|
|
10840
|
+
IntegrationDisplayNames9.Mailchimp
|
|
10527
10841
|
],
|
|
10528
10842
|
category: WorkflowTemplateCategory.LeadCollection
|
|
10529
10843
|
},
|
|
10530
10844
|
{
|
|
10531
10845
|
id: "6",
|
|
10532
10846
|
name: "Send a welcome message in new chats",
|
|
10533
|
-
icons: [
|
|
10847
|
+
icons: [IntegrationNames10.LiveChat],
|
|
10534
10848
|
list: [
|
|
10535
10849
|
{
|
|
10536
|
-
product:
|
|
10850
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10537
10851
|
description: "Detects when a chat starts"
|
|
10538
10852
|
},
|
|
10539
10853
|
{
|
|
10540
|
-
product:
|
|
10854
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10541
10855
|
description: "Sends a custom message in the chat"
|
|
10542
10856
|
}
|
|
10543
10857
|
],
|
|
@@ -10583,7 +10897,7 @@ var getWorkflowTemplates = () => [
|
|
|
10583
10897
|
trigger: {
|
|
10584
10898
|
type: "webhook",
|
|
10585
10899
|
webhook: {
|
|
10586
|
-
source:
|
|
10900
|
+
source: IntegrationNames10.LiveChat,
|
|
10587
10901
|
event: {
|
|
10588
10902
|
name: TextLivechatEventNames2.ChatStarted
|
|
10589
10903
|
},
|
|
@@ -10595,32 +10909,32 @@ var getWorkflowTemplates = () => [
|
|
|
10595
10909
|
}
|
|
10596
10910
|
}
|
|
10597
10911
|
},
|
|
10598
|
-
products: [
|
|
10912
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
10599
10913
|
category: WorkflowTemplateCategory.CustomerExperience
|
|
10600
10914
|
},
|
|
10601
10915
|
{
|
|
10602
10916
|
id: "7",
|
|
10603
10917
|
name: "Create HelpDesk tickets on bad ratings",
|
|
10604
10918
|
icons: [
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10919
|
+
IntegrationNames10.LiveChat,
|
|
10920
|
+
IntegrationNames10.OpenAI,
|
|
10921
|
+
IntegrationNames10.HelpDesk
|
|
10608
10922
|
],
|
|
10609
10923
|
list: [
|
|
10610
10924
|
{
|
|
10611
|
-
product:
|
|
10925
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10612
10926
|
description: "Detects when a chat receives a bad rating"
|
|
10613
10927
|
},
|
|
10614
10928
|
{
|
|
10615
|
-
product:
|
|
10929
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10616
10930
|
description: "Pulls the chat transcript"
|
|
10617
10931
|
},
|
|
10618
10932
|
{
|
|
10619
|
-
product:
|
|
10933
|
+
product: IntegrationDisplayNames9.OpenAI,
|
|
10620
10934
|
description: "Summarizes the chat"
|
|
10621
10935
|
},
|
|
10622
10936
|
{
|
|
10623
|
-
product:
|
|
10937
|
+
product: IntegrationDisplayNames9.HelpDesk,
|
|
10624
10938
|
description: "Creates a ticket with the chat summary. Use the LiveChat pre-chat survey to pull the customer\u2019s email or provide a custom input"
|
|
10625
10939
|
}
|
|
10626
10940
|
],
|
|
@@ -10712,7 +11026,7 @@ var getWorkflowTemplates = () => [
|
|
|
10712
11026
|
trigger: {
|
|
10713
11027
|
type: "webhook",
|
|
10714
11028
|
webhook: {
|
|
10715
|
-
source:
|
|
11029
|
+
source: IntegrationNames10.LiveChat,
|
|
10716
11030
|
event: {
|
|
10717
11031
|
name: TextLivechatEventNames2.ChatRated,
|
|
10718
11032
|
rating: "bad"
|
|
@@ -10724,31 +11038,31 @@ var getWorkflowTemplates = () => [
|
|
|
10724
11038
|
}
|
|
10725
11039
|
},
|
|
10726
11040
|
products: [
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
11041
|
+
IntegrationDisplayNames9.LiveChat,
|
|
11042
|
+
IntegrationDisplayNames9.OpenAI,
|
|
11043
|
+
IntegrationDisplayNames9.HelpDesk
|
|
10730
11044
|
],
|
|
10731
11045
|
category: WorkflowTemplateCategory.NotificationAndAlerts
|
|
10732
11046
|
},
|
|
10733
11047
|
{
|
|
10734
11048
|
id: "8",
|
|
10735
11049
|
name: "Pull customer order history from Shopify",
|
|
10736
|
-
icons: [
|
|
11050
|
+
icons: [IntegrationNames10.LiveChat, IntegrationNames10.Shopify],
|
|
10737
11051
|
list: [
|
|
10738
11052
|
{
|
|
10739
|
-
product:
|
|
11053
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10740
11054
|
description: "Detects when a chat starts"
|
|
10741
11055
|
},
|
|
10742
11056
|
{
|
|
10743
|
-
product:
|
|
11057
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10744
11058
|
description: "Pulls the chat transcript data"
|
|
10745
11059
|
},
|
|
10746
11060
|
{
|
|
10747
|
-
product:
|
|
11061
|
+
product: IntegrationDisplayNames9.Shopify,
|
|
10748
11062
|
description: "Pulls the customer order history"
|
|
10749
11063
|
},
|
|
10750
11064
|
{
|
|
10751
|
-
product:
|
|
11065
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10752
11066
|
description: "Sends a message with the customer\u2019s order history visible to the agent"
|
|
10753
11067
|
}
|
|
10754
11068
|
],
|
|
@@ -10834,7 +11148,7 @@ var getWorkflowTemplates = () => [
|
|
|
10834
11148
|
trigger: {
|
|
10835
11149
|
type: "webhook",
|
|
10836
11150
|
webhook: {
|
|
10837
|
-
source:
|
|
11151
|
+
source: IntegrationNames10.LiveChat,
|
|
10838
11152
|
event: {
|
|
10839
11153
|
name: TextLivechatEventNames2.ChatStarted
|
|
10840
11154
|
},
|
|
@@ -10845,26 +11159,26 @@ var getWorkflowTemplates = () => [
|
|
|
10845
11159
|
}
|
|
10846
11160
|
},
|
|
10847
11161
|
products: [
|
|
10848
|
-
|
|
10849
|
-
|
|
11162
|
+
IntegrationDisplayNames9.LiveChat,
|
|
11163
|
+
IntegrationDisplayNames9.Shopify
|
|
10850
11164
|
],
|
|
10851
11165
|
category: WorkflowTemplateCategory.SalesManagement
|
|
10852
11166
|
},
|
|
10853
11167
|
{
|
|
10854
11168
|
id: "9",
|
|
10855
11169
|
name: "Add leads to HubSpot",
|
|
10856
|
-
icons: [
|
|
11170
|
+
icons: [IntegrationNames10.LiveChat, IntegrationNames10.HubSpot],
|
|
10857
11171
|
list: [
|
|
10858
11172
|
{
|
|
10859
|
-
product:
|
|
11173
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10860
11174
|
description: "Detects when a chat ends"
|
|
10861
11175
|
},
|
|
10862
11176
|
{
|
|
10863
|
-
product:
|
|
11177
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10864
11178
|
description: "Pulls the chat transcript data"
|
|
10865
11179
|
},
|
|
10866
11180
|
{
|
|
10867
|
-
product:
|
|
11181
|
+
product: IntegrationDisplayNames9.HubSpot,
|
|
10868
11182
|
description: "Creates a new contact in Hubspot"
|
|
10869
11183
|
}
|
|
10870
11184
|
],
|
|
@@ -10932,7 +11246,7 @@ var getWorkflowTemplates = () => [
|
|
|
10932
11246
|
trigger: {
|
|
10933
11247
|
type: "webhook",
|
|
10934
11248
|
webhook: {
|
|
10935
|
-
source:
|
|
11249
|
+
source: IntegrationNames10.LiveChat,
|
|
10936
11250
|
event: {
|
|
10937
11251
|
name: TextLivechatEventNames2.ChatEnded
|
|
10938
11252
|
},
|
|
@@ -10943,26 +11257,26 @@ var getWorkflowTemplates = () => [
|
|
|
10943
11257
|
}
|
|
10944
11258
|
},
|
|
10945
11259
|
products: [
|
|
10946
|
-
|
|
10947
|
-
|
|
11260
|
+
IntegrationDisplayNames9.LiveChat,
|
|
11261
|
+
IntegrationDisplayNames9.HubSpot
|
|
10948
11262
|
],
|
|
10949
11263
|
category: WorkflowTemplateCategory.LeadCollection
|
|
10950
11264
|
},
|
|
10951
11265
|
{
|
|
10952
11266
|
id: "10",
|
|
10953
11267
|
name: "Create HelpDesk tickets when a new chat is started",
|
|
10954
|
-
icons: [
|
|
11268
|
+
icons: [IntegrationNames10.LiveChat, IntegrationNames10.HelpDesk],
|
|
10955
11269
|
list: [
|
|
10956
11270
|
{
|
|
10957
|
-
product:
|
|
11271
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10958
11272
|
description: "Detects when a chat starts"
|
|
10959
11273
|
},
|
|
10960
11274
|
{
|
|
10961
|
-
product:
|
|
11275
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
10962
11276
|
description: "Pulls the chat transcript information"
|
|
10963
11277
|
},
|
|
10964
11278
|
{
|
|
10965
|
-
product:
|
|
11279
|
+
product: IntegrationDisplayNames9.HelpDesk,
|
|
10966
11280
|
description: "Creates a ticket in HelpDesk. Use the LiveChat pre-chat survey to pull the customer\u2019s email or provide a custom input"
|
|
10967
11281
|
}
|
|
10968
11282
|
],
|
|
@@ -11035,7 +11349,7 @@ var getWorkflowTemplates = () => [
|
|
|
11035
11349
|
trigger: {
|
|
11036
11350
|
type: "webhook",
|
|
11037
11351
|
webhook: {
|
|
11038
|
-
source:
|
|
11352
|
+
source: IntegrationNames10.LiveChat,
|
|
11039
11353
|
event: {
|
|
11040
11354
|
name: TextLivechatEventNames2.ChatStarted
|
|
11041
11355
|
},
|
|
@@ -11046,8 +11360,8 @@ var getWorkflowTemplates = () => [
|
|
|
11046
11360
|
}
|
|
11047
11361
|
},
|
|
11048
11362
|
products: [
|
|
11049
|
-
|
|
11050
|
-
|
|
11363
|
+
IntegrationDisplayNames9.LiveChat,
|
|
11364
|
+
IntegrationDisplayNames9.HelpDesk
|
|
11051
11365
|
],
|
|
11052
11366
|
category: WorkflowTemplateCategory.NotificationAndAlerts
|
|
11053
11367
|
},
|
|
@@ -11055,25 +11369,25 @@ var getWorkflowTemplates = () => [
|
|
|
11055
11369
|
id: "11",
|
|
11056
11370
|
name: "Add leads to your marketing platforms",
|
|
11057
11371
|
icons: [
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11372
|
+
IntegrationNames10.LiveChat,
|
|
11373
|
+
IntegrationNames10.HubSpot,
|
|
11374
|
+
IntegrationNames10.Mailchimp
|
|
11061
11375
|
],
|
|
11062
11376
|
list: [
|
|
11063
11377
|
{
|
|
11064
|
-
product:
|
|
11378
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11065
11379
|
description: "Detects when a chat ends"
|
|
11066
11380
|
},
|
|
11067
11381
|
{
|
|
11068
|
-
product:
|
|
11382
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11069
11383
|
description: "Pulls the chat transcript information"
|
|
11070
11384
|
},
|
|
11071
11385
|
{
|
|
11072
|
-
product:
|
|
11386
|
+
product: IntegrationDisplayNames9.HubSpot,
|
|
11073
11387
|
description: "Creates a new contact in Hubspot"
|
|
11074
11388
|
},
|
|
11075
11389
|
{
|
|
11076
|
-
product:
|
|
11390
|
+
product: IntegrationDisplayNames9.Mailchimp,
|
|
11077
11391
|
description: "Adds new subscriber in Mailchimp"
|
|
11078
11392
|
}
|
|
11079
11393
|
],
|
|
@@ -11164,7 +11478,7 @@ var getWorkflowTemplates = () => [
|
|
|
11164
11478
|
trigger: {
|
|
11165
11479
|
type: "webhook",
|
|
11166
11480
|
webhook: {
|
|
11167
|
-
source:
|
|
11481
|
+
source: IntegrationNames10.LiveChat,
|
|
11168
11482
|
event: {
|
|
11169
11483
|
name: TextLivechatEventNames2.ChatEnded
|
|
11170
11484
|
},
|
|
@@ -11175,27 +11489,27 @@ var getWorkflowTemplates = () => [
|
|
|
11175
11489
|
}
|
|
11176
11490
|
},
|
|
11177
11491
|
products: [
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11492
|
+
IntegrationDisplayNames9.LiveChat,
|
|
11493
|
+
IntegrationDisplayNames9.HubSpot,
|
|
11494
|
+
IntegrationDisplayNames9.Mailchimp
|
|
11181
11495
|
],
|
|
11182
11496
|
category: WorkflowTemplateCategory.LeadCollection
|
|
11183
11497
|
},
|
|
11184
11498
|
{
|
|
11185
11499
|
id: "12",
|
|
11186
11500
|
name: "Send review reminders for agents on custom tag added",
|
|
11187
|
-
icons: [
|
|
11501
|
+
icons: [IntegrationNames10.LiveChat],
|
|
11188
11502
|
list: [
|
|
11189
11503
|
{
|
|
11190
|
-
product:
|
|
11504
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11191
11505
|
description: "Detects when agents add a specific tag to an active chat"
|
|
11192
11506
|
},
|
|
11193
11507
|
{
|
|
11194
|
-
product:
|
|
11508
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11195
11509
|
description: "Supervises chat to allow for sending private messages"
|
|
11196
11510
|
},
|
|
11197
11511
|
{
|
|
11198
|
-
product:
|
|
11512
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11199
11513
|
description: "Sends a reminder to ask for a review visible only to the agent"
|
|
11200
11514
|
}
|
|
11201
11515
|
],
|
|
@@ -11264,7 +11578,7 @@ var getWorkflowTemplates = () => [
|
|
|
11264
11578
|
trigger: {
|
|
11265
11579
|
type: "webhook",
|
|
11266
11580
|
webhook: {
|
|
11267
|
-
source:
|
|
11581
|
+
source: IntegrationNames10.LiveChat,
|
|
11268
11582
|
event: {
|
|
11269
11583
|
name: TextLivechatEventNames2.ChatTagged,
|
|
11270
11584
|
tag: void 0,
|
|
@@ -11276,24 +11590,24 @@ var getWorkflowTemplates = () => [
|
|
|
11276
11590
|
}
|
|
11277
11591
|
}
|
|
11278
11592
|
},
|
|
11279
|
-
products: [
|
|
11593
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
11280
11594
|
category: WorkflowTemplateCategory.ChatManagement
|
|
11281
11595
|
},
|
|
11282
11596
|
{
|
|
11283
11597
|
id: "13",
|
|
11284
11598
|
name: "Send chat transcripts to customers",
|
|
11285
|
-
icons: [
|
|
11599
|
+
icons: [IntegrationNames10.LiveChat, IntegrationNames10.HelpDesk],
|
|
11286
11600
|
list: [
|
|
11287
11601
|
{
|
|
11288
|
-
product:
|
|
11602
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11289
11603
|
description: "Detects when a chat ends"
|
|
11290
11604
|
},
|
|
11291
11605
|
{
|
|
11292
|
-
product:
|
|
11606
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11293
11607
|
description: "Pulls the chat transcript"
|
|
11294
11608
|
},
|
|
11295
11609
|
{
|
|
11296
|
-
product:
|
|
11610
|
+
product: IntegrationDisplayNames9.HelpDesk,
|
|
11297
11611
|
description: "Sends the chat transcript to the customer via HelpDesk. Use the LiveChat pre-chat survey to pull the customer\u2019s email or provide a custom input"
|
|
11298
11612
|
}
|
|
11299
11613
|
],
|
|
@@ -11365,7 +11679,7 @@ var getWorkflowTemplates = () => [
|
|
|
11365
11679
|
trigger: {
|
|
11366
11680
|
type: "webhook",
|
|
11367
11681
|
webhook: {
|
|
11368
|
-
source:
|
|
11682
|
+
source: IntegrationNames10.LiveChat,
|
|
11369
11683
|
event: {
|
|
11370
11684
|
name: TextLivechatEventNames2.ChatEnded
|
|
11371
11685
|
},
|
|
@@ -11376,34 +11690,34 @@ var getWorkflowTemplates = () => [
|
|
|
11376
11690
|
}
|
|
11377
11691
|
},
|
|
11378
11692
|
products: [
|
|
11379
|
-
|
|
11380
|
-
|
|
11693
|
+
IntegrationDisplayNames9.LiveChat,
|
|
11694
|
+
IntegrationDisplayNames9.HelpDesk
|
|
11381
11695
|
],
|
|
11382
11696
|
category: WorkflowTemplateCategory.CustomerExperience
|
|
11383
11697
|
},
|
|
11384
11698
|
{
|
|
11385
11699
|
id: "14",
|
|
11386
11700
|
name: "Automatically monitor new chat quality",
|
|
11387
|
-
icons: [
|
|
11701
|
+
icons: [IntegrationNames10.LiveChat],
|
|
11388
11702
|
list: [
|
|
11389
11703
|
{
|
|
11390
|
-
product:
|
|
11704
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11391
11705
|
description: "When a new chat starts, the workflow is triggered"
|
|
11392
11706
|
},
|
|
11393
11707
|
{
|
|
11394
|
-
product:
|
|
11708
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11395
11709
|
description: "The system automatically adds a supervisor (by email) to monitor the chat"
|
|
11396
11710
|
},
|
|
11397
11711
|
{
|
|
11398
|
-
product:
|
|
11712
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11399
11713
|
description: "The chat gets tagged for quality review"
|
|
11400
11714
|
},
|
|
11401
11715
|
{
|
|
11402
|
-
product:
|
|
11716
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11403
11717
|
description: "The supervisor can silently observe the conversation"
|
|
11404
11718
|
}
|
|
11405
11719
|
],
|
|
11406
|
-
products: [
|
|
11720
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
11407
11721
|
category: WorkflowTemplateCategory.ChatManagement,
|
|
11408
11722
|
workflow: {
|
|
11409
11723
|
name: "Automatically monitor new chat quality",
|
|
@@ -11471,7 +11785,7 @@ var getWorkflowTemplates = () => [
|
|
|
11471
11785
|
trigger: {
|
|
11472
11786
|
type: "webhook",
|
|
11473
11787
|
webhook: {
|
|
11474
|
-
source:
|
|
11788
|
+
source: IntegrationNames10.LiveChat,
|
|
11475
11789
|
event: {
|
|
11476
11790
|
name: TextLivechatEventNames2.ChatStarted
|
|
11477
11791
|
},
|
|
@@ -11487,26 +11801,26 @@ var getWorkflowTemplates = () => [
|
|
|
11487
11801
|
{
|
|
11488
11802
|
id: "15",
|
|
11489
11803
|
name: "Tag chats based on keywords",
|
|
11490
|
-
icons: [
|
|
11804
|
+
icons: [IntegrationNames10.LiveChat],
|
|
11491
11805
|
list: [
|
|
11492
11806
|
{
|
|
11493
|
-
product:
|
|
11807
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11494
11808
|
description: "The system monitors every chat message"
|
|
11495
11809
|
},
|
|
11496
11810
|
{
|
|
11497
|
-
product:
|
|
11811
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11498
11812
|
description: "When a specified keyword appears in customer's or agent's message"
|
|
11499
11813
|
},
|
|
11500
11814
|
{
|
|
11501
|
-
product:
|
|
11815
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11502
11816
|
description: "The workflow automatically adds the corresponding tag to the chat"
|
|
11503
11817
|
},
|
|
11504
11818
|
{
|
|
11505
|
-
product:
|
|
11819
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11506
11820
|
description: "This happens in real-time as messages are sent"
|
|
11507
11821
|
}
|
|
11508
11822
|
],
|
|
11509
|
-
products: [
|
|
11823
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
11510
11824
|
category: WorkflowTemplateCategory.ChatManagement,
|
|
11511
11825
|
workflow: {
|
|
11512
11826
|
name: "Tag chats based on keywords",
|
|
@@ -11515,7 +11829,7 @@ var getWorkflowTemplates = () => [
|
|
|
11515
11829
|
trigger: {
|
|
11516
11830
|
type: "webhook",
|
|
11517
11831
|
webhook: {
|
|
11518
|
-
source:
|
|
11832
|
+
source: IntegrationNames10.LiveChat,
|
|
11519
11833
|
event: {
|
|
11520
11834
|
name: TextLivechatEventNames2.ChatMessage,
|
|
11521
11835
|
filter: void 0
|
|
@@ -11569,26 +11883,26 @@ var getWorkflowTemplates = () => [
|
|
|
11569
11883
|
{
|
|
11570
11884
|
id: "16",
|
|
11571
11885
|
name: "Keep customers informed during transfers",
|
|
11572
|
-
icons: [
|
|
11886
|
+
icons: [IntegrationNames10.LiveChat],
|
|
11573
11887
|
list: [
|
|
11574
11888
|
{
|
|
11575
|
-
product:
|
|
11889
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11576
11890
|
description: "When an agent transfers a chat"
|
|
11577
11891
|
},
|
|
11578
11892
|
{
|
|
11579
|
-
product:
|
|
11893
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11580
11894
|
description: "The system automatically sends a custom message to the customer"
|
|
11581
11895
|
},
|
|
11582
11896
|
{
|
|
11583
|
-
product:
|
|
11897
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11584
11898
|
description: "Adds a tracking tag to the chat"
|
|
11585
11899
|
},
|
|
11586
11900
|
{
|
|
11587
|
-
product:
|
|
11901
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11588
11902
|
description: "The new agent sees the transfer history"
|
|
11589
11903
|
}
|
|
11590
11904
|
],
|
|
11591
|
-
products: [
|
|
11905
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
11592
11906
|
category: WorkflowTemplateCategory.ChatManagement,
|
|
11593
11907
|
workflow: {
|
|
11594
11908
|
name: "Keep customers informed during transfers",
|
|
@@ -11597,7 +11911,7 @@ var getWorkflowTemplates = () => [
|
|
|
11597
11911
|
trigger: {
|
|
11598
11912
|
type: "webhook",
|
|
11599
11913
|
webhook: {
|
|
11600
|
-
source:
|
|
11914
|
+
source: IntegrationNames10.LiveChat,
|
|
11601
11915
|
event: {
|
|
11602
11916
|
name: TextLivechatEventNames2.ChatTransferred
|
|
11603
11917
|
},
|
|
@@ -11673,22 +11987,22 @@ var getWorkflowTemplates = () => [
|
|
|
11673
11987
|
{
|
|
11674
11988
|
id: "17",
|
|
11675
11989
|
name: "Auto-respond to chat ratings",
|
|
11676
|
-
icons: [
|
|
11990
|
+
icons: [IntegrationNames10.LiveChat],
|
|
11677
11991
|
list: [
|
|
11678
11992
|
{
|
|
11679
|
-
product:
|
|
11993
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11680
11994
|
description: "Detects when a chat is rated"
|
|
11681
11995
|
},
|
|
11682
11996
|
{
|
|
11683
|
-
product:
|
|
11997
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11684
11998
|
description: "Identifies the rating type (good or bad)"
|
|
11685
11999
|
},
|
|
11686
12000
|
{
|
|
11687
|
-
product:
|
|
12001
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11688
12002
|
description: "Sends a personalized follow-up message based on the rating"
|
|
11689
12003
|
}
|
|
11690
12004
|
],
|
|
11691
|
-
products: [
|
|
12005
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
11692
12006
|
category: WorkflowTemplateCategory.CustomerExperience,
|
|
11693
12007
|
workflow: {
|
|
11694
12008
|
name: "Auto-respond to chat ratings",
|
|
@@ -11697,7 +12011,7 @@ var getWorkflowTemplates = () => [
|
|
|
11697
12011
|
trigger: {
|
|
11698
12012
|
type: "webhook",
|
|
11699
12013
|
webhook: {
|
|
11700
|
-
source:
|
|
12014
|
+
source: IntegrationNames10.LiveChat,
|
|
11701
12015
|
event: {
|
|
11702
12016
|
name: TextLivechatEventNames2.ChatRated,
|
|
11703
12017
|
rating: "good"
|
|
@@ -11751,26 +12065,26 @@ var getWorkflowTemplates = () => [
|
|
|
11751
12065
|
{
|
|
11752
12066
|
id: "18",
|
|
11753
12067
|
name: "Escalate urgent customer issues",
|
|
11754
|
-
icons: [
|
|
12068
|
+
icons: [IntegrationNames10.LiveChat],
|
|
11755
12069
|
list: [
|
|
11756
12070
|
{
|
|
11757
|
-
product:
|
|
12071
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11758
12072
|
description: "Monitors chat messages for sensitive keywords"
|
|
11759
12073
|
},
|
|
11760
12074
|
{
|
|
11761
|
-
product:
|
|
12075
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11762
12076
|
description: "Tags the conversation for tracking and visibility"
|
|
11763
12077
|
},
|
|
11764
12078
|
{
|
|
11765
|
-
product:
|
|
12079
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11766
12080
|
description: "Notifies a supervisor about the critical conversation"
|
|
11767
12081
|
},
|
|
11768
12082
|
{
|
|
11769
|
-
product:
|
|
12083
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11770
12084
|
description: "Sends an alert message as a private notification to the supervisor"
|
|
11771
12085
|
}
|
|
11772
12086
|
],
|
|
11773
|
-
products: [
|
|
12087
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
11774
12088
|
category: WorkflowTemplateCategory.CustomerExperience,
|
|
11775
12089
|
workflow: {
|
|
11776
12090
|
name: "Escalate urgent customer issues",
|
|
@@ -11779,7 +12093,7 @@ var getWorkflowTemplates = () => [
|
|
|
11779
12093
|
trigger: {
|
|
11780
12094
|
type: "webhook",
|
|
11781
12095
|
webhook: {
|
|
11782
|
-
source:
|
|
12096
|
+
source: IntegrationNames10.LiveChat,
|
|
11783
12097
|
event: {
|
|
11784
12098
|
name: TextLivechatEventNames2.ChatMessage,
|
|
11785
12099
|
filter: void 0
|
|
@@ -11878,22 +12192,22 @@ var getWorkflowTemplates = () => [
|
|
|
11878
12192
|
{
|
|
11879
12193
|
id: "19",
|
|
11880
12194
|
name: "Manage chats outside business hours",
|
|
11881
|
-
icons: [
|
|
12195
|
+
icons: [IntegrationNames10.LiveChat],
|
|
11882
12196
|
list: [
|
|
11883
12197
|
{
|
|
11884
|
-
product:
|
|
12198
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11885
12199
|
description: "System checks if chat starts outside business hours"
|
|
11886
12200
|
},
|
|
11887
12201
|
{
|
|
11888
|
-
product:
|
|
12202
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11889
12203
|
description: "Automatically transfers chat to the after-hours team"
|
|
11890
12204
|
},
|
|
11891
12205
|
{
|
|
11892
|
-
product:
|
|
12206
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11893
12207
|
description: "Sends a custom message about after-hours support"
|
|
11894
12208
|
}
|
|
11895
12209
|
],
|
|
11896
|
-
products: [
|
|
12210
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
11897
12211
|
category: WorkflowTemplateCategory.CustomerExperience,
|
|
11898
12212
|
workflow: {
|
|
11899
12213
|
name: "Manage chats outside business hours",
|
|
@@ -11902,7 +12216,7 @@ var getWorkflowTemplates = () => [
|
|
|
11902
12216
|
trigger: {
|
|
11903
12217
|
type: "webhook",
|
|
11904
12218
|
webhook: {
|
|
11905
|
-
source:
|
|
12219
|
+
source: IntegrationNames10.LiveChat,
|
|
11906
12220
|
event: {
|
|
11907
12221
|
name: TextLivechatEventNames2.ChatStarted
|
|
11908
12222
|
},
|
|
@@ -11978,32 +12292,32 @@ var getWorkflowTemplates = () => [
|
|
|
11978
12292
|
{
|
|
11979
12293
|
id: "20",
|
|
11980
12294
|
name: "Smart chat transfer assistant",
|
|
11981
|
-
icons: [
|
|
12295
|
+
icons: [IntegrationNames10.LiveChat, IntegrationNames10.OpenAI],
|
|
11982
12296
|
list: [
|
|
11983
12297
|
{
|
|
11984
|
-
product:
|
|
12298
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11985
12299
|
description: "When a chat is transferred"
|
|
11986
12300
|
},
|
|
11987
12301
|
{
|
|
11988
|
-
product:
|
|
12302
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11989
12303
|
description: "System automatically captures the chat transcript"
|
|
11990
12304
|
},
|
|
11991
12305
|
{
|
|
11992
|
-
product:
|
|
12306
|
+
product: IntegrationDisplayNames9.OpenAI,
|
|
11993
12307
|
description: "Creates a summary of the conversation"
|
|
11994
12308
|
},
|
|
11995
12309
|
{
|
|
11996
|
-
product:
|
|
12310
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
11997
12311
|
description: "Sends a private message to the receiving agent with context"
|
|
11998
12312
|
},
|
|
11999
12313
|
{
|
|
12000
|
-
product:
|
|
12314
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12001
12315
|
description: "Tags the conversation for tracking"
|
|
12002
12316
|
}
|
|
12003
12317
|
],
|
|
12004
12318
|
products: [
|
|
12005
|
-
|
|
12006
|
-
|
|
12319
|
+
IntegrationDisplayNames9.LiveChat,
|
|
12320
|
+
IntegrationDisplayNames9.OpenAI
|
|
12007
12321
|
],
|
|
12008
12322
|
category: WorkflowTemplateCategory.ChatManagement,
|
|
12009
12323
|
workflow: {
|
|
@@ -12013,7 +12327,7 @@ var getWorkflowTemplates = () => [
|
|
|
12013
12327
|
trigger: {
|
|
12014
12328
|
type: "webhook",
|
|
12015
12329
|
webhook: {
|
|
12016
|
-
source:
|
|
12330
|
+
source: IntegrationNames10.LiveChat,
|
|
12017
12331
|
event: {
|
|
12018
12332
|
name: TextLivechatEventNames2.ChatTransferred
|
|
12019
12333
|
},
|
|
@@ -12128,26 +12442,26 @@ var getWorkflowTemplates = () => [
|
|
|
12128
12442
|
{
|
|
12129
12443
|
id: "21",
|
|
12130
12444
|
name: "Recover from negative ratings",
|
|
12131
|
-
icons: [
|
|
12445
|
+
icons: [IntegrationNames10.LiveChat],
|
|
12132
12446
|
list: [
|
|
12133
12447
|
{
|
|
12134
|
-
product:
|
|
12448
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12135
12449
|
description: "Customer provides a negative rating"
|
|
12136
12450
|
},
|
|
12137
12451
|
{
|
|
12138
|
-
product:
|
|
12452
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12139
12453
|
description: "System transfers chat to a senior agent/manager"
|
|
12140
12454
|
},
|
|
12141
12455
|
{
|
|
12142
|
-
product:
|
|
12456
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12143
12457
|
description: "Sends an immediate recovery message to the customer"
|
|
12144
12458
|
},
|
|
12145
12459
|
{
|
|
12146
|
-
product:
|
|
12460
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12147
12461
|
description: "Tags conversation for follow-up"
|
|
12148
12462
|
}
|
|
12149
12463
|
],
|
|
12150
|
-
products: [
|
|
12464
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
12151
12465
|
category: WorkflowTemplateCategory.CustomerExperience,
|
|
12152
12466
|
workflow: {
|
|
12153
12467
|
name: "Recover from negative ratings",
|
|
@@ -12156,7 +12470,7 @@ var getWorkflowTemplates = () => [
|
|
|
12156
12470
|
trigger: {
|
|
12157
12471
|
type: "webhook",
|
|
12158
12472
|
webhook: {
|
|
12159
|
-
source:
|
|
12473
|
+
source: IntegrationNames10.LiveChat,
|
|
12160
12474
|
event: {
|
|
12161
12475
|
name: TextLivechatEventNames2.ChatRated,
|
|
12162
12476
|
rating: "bad"
|
|
@@ -12256,22 +12570,22 @@ var getWorkflowTemplates = () => [
|
|
|
12256
12570
|
{
|
|
12257
12571
|
id: "22",
|
|
12258
12572
|
name: "Automated Chat Transcript Delivery",
|
|
12259
|
-
icons: [
|
|
12573
|
+
icons: [IntegrationNames10.LiveChat],
|
|
12260
12574
|
list: [
|
|
12261
12575
|
{
|
|
12262
|
-
product:
|
|
12576
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12263
12577
|
description: "When a chat conversation is finished by an agent"
|
|
12264
12578
|
},
|
|
12265
12579
|
{
|
|
12266
|
-
product:
|
|
12580
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12267
12581
|
description: "System automatically retrieves the full chat transcript"
|
|
12268
12582
|
},
|
|
12269
12583
|
{
|
|
12270
|
-
product:
|
|
12584
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12271
12585
|
description: "System automatically sends a message in the chat window with the transcript information"
|
|
12272
12586
|
}
|
|
12273
12587
|
],
|
|
12274
|
-
products: [
|
|
12588
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
12275
12589
|
category: WorkflowTemplateCategory.CustomerExperience,
|
|
12276
12590
|
workflow: {
|
|
12277
12591
|
name: "Automated Chat Transcript Delivery",
|
|
@@ -12280,7 +12594,7 @@ var getWorkflowTemplates = () => [
|
|
|
12280
12594
|
trigger: {
|
|
12281
12595
|
type: "webhook",
|
|
12282
12596
|
webhook: {
|
|
12283
|
-
source:
|
|
12597
|
+
source: IntegrationNames10.LiveChat,
|
|
12284
12598
|
event: {
|
|
12285
12599
|
name: TextLivechatEventNames2.ChatEnded
|
|
12286
12600
|
},
|
|
@@ -12351,18 +12665,18 @@ var getWorkflowTemplates = () => [
|
|
|
12351
12665
|
{
|
|
12352
12666
|
id: "23",
|
|
12353
12667
|
name: "Proactive Engagement after Visitor Leaves",
|
|
12354
|
-
icons: [
|
|
12668
|
+
icons: [IntegrationNames10.LiveChat],
|
|
12355
12669
|
list: [
|
|
12356
12670
|
{
|
|
12357
|
-
product:
|
|
12671
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12358
12672
|
description: "Visitor leaves chat window"
|
|
12359
12673
|
},
|
|
12360
12674
|
{
|
|
12361
|
-
product:
|
|
12675
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12362
12676
|
description: "System sends a proactive message to the visitor in the chat window"
|
|
12363
12677
|
}
|
|
12364
12678
|
],
|
|
12365
|
-
products: [
|
|
12679
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
12366
12680
|
category: WorkflowTemplateCategory.CustomerExperience,
|
|
12367
12681
|
workflow: {
|
|
12368
12682
|
name: "Proactive Engagement after Visitor Leaves",
|
|
@@ -12371,7 +12685,7 @@ var getWorkflowTemplates = () => [
|
|
|
12371
12685
|
trigger: {
|
|
12372
12686
|
type: "webhook",
|
|
12373
12687
|
webhook: {
|
|
12374
|
-
source:
|
|
12688
|
+
source: IntegrationNames10.LiveChat,
|
|
12375
12689
|
event: {
|
|
12376
12690
|
name: TextLivechatEventNames2.UserRemovedFromChat
|
|
12377
12691
|
},
|
|
@@ -12424,18 +12738,18 @@ var getWorkflowTemplates = () => [
|
|
|
12424
12738
|
{
|
|
12425
12739
|
id: "24",
|
|
12426
12740
|
name: "Order Issue Auto-Tagger",
|
|
12427
|
-
icons: [
|
|
12741
|
+
icons: [IntegrationNames10.LiveChat],
|
|
12428
12742
|
list: [
|
|
12429
12743
|
{
|
|
12430
|
-
product:
|
|
12744
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12431
12745
|
description: "Customer sends a message containing specific keywords related to order issues"
|
|
12432
12746
|
},
|
|
12433
12747
|
{
|
|
12434
|
-
product:
|
|
12748
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12435
12749
|
description: "System automatically adds the user tag to the chat"
|
|
12436
12750
|
}
|
|
12437
12751
|
],
|
|
12438
|
-
products: [
|
|
12752
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
12439
12753
|
category: WorkflowTemplateCategory.CustomerExperience,
|
|
12440
12754
|
workflow: {
|
|
12441
12755
|
name: "Order Issue Auto-Tagger",
|
|
@@ -12444,7 +12758,7 @@ var getWorkflowTemplates = () => [
|
|
|
12444
12758
|
trigger: {
|
|
12445
12759
|
type: "webhook",
|
|
12446
12760
|
webhook: {
|
|
12447
|
-
source:
|
|
12761
|
+
source: IntegrationNames10.LiveChat,
|
|
12448
12762
|
event: {
|
|
12449
12763
|
name: TextLivechatEventNames2.ChatMessage,
|
|
12450
12764
|
filter: void 0
|
|
@@ -12498,18 +12812,18 @@ var getWorkflowTemplates = () => [
|
|
|
12498
12812
|
{
|
|
12499
12813
|
id: "25",
|
|
12500
12814
|
name: "Intelligent Chat Routing by Product Interest",
|
|
12501
|
-
icons: [
|
|
12815
|
+
icons: [IntegrationNames10.LiveChat],
|
|
12502
12816
|
list: [
|
|
12503
12817
|
{
|
|
12504
|
-
product:
|
|
12818
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12505
12819
|
description: "Customer message contains keywords related to specific product categories"
|
|
12506
12820
|
},
|
|
12507
12821
|
{
|
|
12508
|
-
product:
|
|
12822
|
+
product: IntegrationDisplayNames9.LiveChat,
|
|
12509
12823
|
description: "System transfers the chat to the designated agent group for that product category"
|
|
12510
12824
|
}
|
|
12511
12825
|
],
|
|
12512
|
-
products: [
|
|
12826
|
+
products: [IntegrationDisplayNames9.LiveChat],
|
|
12513
12827
|
category: WorkflowTemplateCategory.ChatManagement,
|
|
12514
12828
|
workflow: {
|
|
12515
12829
|
name: "Intelligent Chat Routing by Product Interest",
|
|
@@ -12518,7 +12832,7 @@ var getWorkflowTemplates = () => [
|
|
|
12518
12832
|
trigger: {
|
|
12519
12833
|
type: "webhook",
|
|
12520
12834
|
webhook: {
|
|
12521
|
-
source:
|
|
12835
|
+
source: IntegrationNames10.LiveChat,
|
|
12522
12836
|
event: {
|
|
12523
12837
|
name: TextLivechatEventNames2.ChatMessage,
|
|
12524
12838
|
filter: void 0
|
|
@@ -12573,7 +12887,7 @@ var getWorkflowTemplates = () => [
|
|
|
12573
12887
|
|
|
12574
12888
|
// src/views/Workflows/Creator/Modals/AddTask/Modal.tsx
|
|
12575
12889
|
import { useEffect as useEffect5, useMemo as useMemo4, useState as useState5 } from "react";
|
|
12576
|
-
import { NavLink, useLocation as useLocation2,
|
|
12890
|
+
import { NavLink, useLocation as useLocation2, useParams as useParams2 } from "react-router-dom";
|
|
12577
12891
|
import {
|
|
12578
12892
|
Button as Button2,
|
|
12579
12893
|
DesignToken as DesignToken4,
|
|
@@ -12584,42 +12898,203 @@ import {
|
|
|
12584
12898
|
SpacingToken as SpacingToken3
|
|
12585
12899
|
} from "@livechat/design-system-react-components";
|
|
12586
12900
|
import {
|
|
12587
|
-
IntegrationDisplayNames as
|
|
12588
|
-
IntegrationNames as
|
|
12901
|
+
IntegrationDisplayNames as IntegrationDisplayNames10,
|
|
12902
|
+
IntegrationNames as IntegrationNames14
|
|
12589
12903
|
} from "@livechat/developer-studio-api";
|
|
12590
12904
|
import {
|
|
12591
12905
|
Column as Column3,
|
|
12592
12906
|
Row as Row2,
|
|
12593
|
-
Text as Text3
|
|
12594
|
-
useUserContext as useUserContext3
|
|
12907
|
+
Text as Text3
|
|
12595
12908
|
} from "@livechat/developer-studio-ui-react";
|
|
12596
12909
|
|
|
12597
|
-
// src/
|
|
12598
|
-
import {
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
|
|
12612
|
-
}
|
|
12613
|
-
|
|
12614
|
-
|
|
12615
|
-
|
|
12616
|
-
|
|
12617
|
-
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
12622
|
-
|
|
12910
|
+
// src/hooks/analytics.ts
|
|
12911
|
+
import { useUserContext as useUserContext2 } from "@livechat/developer-studio-ui-react";
|
|
12912
|
+
|
|
12913
|
+
// src/utils/tracking.ts
|
|
12914
|
+
import * as amplitude from "@amplitude/analytics-browser";
|
|
12915
|
+
var logAmplitudeEvent = (name, payload, user) => {
|
|
12916
|
+
amplitude.init(getWorkflowsEnv("amplitudeKey"), user);
|
|
12917
|
+
amplitude.logEvent(name, payload);
|
|
12918
|
+
};
|
|
12919
|
+
var logSprigEvent = (name, email, payload) => {
|
|
12920
|
+
const sprig = window.Sprig;
|
|
12921
|
+
sprig("identifyAndTrack", {
|
|
12922
|
+
eventName: name,
|
|
12923
|
+
userId: email,
|
|
12924
|
+
properties: payload
|
|
12925
|
+
});
|
|
12926
|
+
};
|
|
12927
|
+
|
|
12928
|
+
// src/utils/journeys/workflows/index.ts
|
|
12929
|
+
var workflowsJourneyFactory = (email) => ({
|
|
12930
|
+
workflow: {
|
|
12931
|
+
create: {
|
|
12932
|
+
actions: {
|
|
12933
|
+
createDraft: (workflowId) => {
|
|
12934
|
+
logAmplitudeEvent(
|
|
12935
|
+
"workflows.workflow.create.click",
|
|
12936
|
+
{
|
|
12937
|
+
original_workflow_id: workflowId
|
|
12938
|
+
},
|
|
12939
|
+
email
|
|
12940
|
+
);
|
|
12941
|
+
}
|
|
12942
|
+
}
|
|
12943
|
+
},
|
|
12944
|
+
edit: {
|
|
12945
|
+
actions: {
|
|
12946
|
+
click: () => {
|
|
12947
|
+
logAmplitudeEvent(
|
|
12948
|
+
"workflows.workflow.edit.click",
|
|
12949
|
+
{
|
|
12950
|
+
source: "list"
|
|
12951
|
+
},
|
|
12952
|
+
email
|
|
12953
|
+
);
|
|
12954
|
+
}
|
|
12955
|
+
}
|
|
12956
|
+
},
|
|
12957
|
+
delete: {
|
|
12958
|
+
actions: {
|
|
12959
|
+
click: (source, createdAt) => {
|
|
12960
|
+
logAmplitudeEvent(
|
|
12961
|
+
"workflows.workflow.delete.click",
|
|
12962
|
+
__spreadValues({
|
|
12963
|
+
source
|
|
12964
|
+
}, source === "builder" && createdAt && {
|
|
12965
|
+
lifetime_duration: Math.floor(
|
|
12966
|
+
((/* @__PURE__ */ new Date()).getTime() - new Date(createdAt).getTime()) / (1e3 * 60) % 60
|
|
12967
|
+
)
|
|
12968
|
+
}),
|
|
12969
|
+
email
|
|
12970
|
+
);
|
|
12971
|
+
}
|
|
12972
|
+
}
|
|
12973
|
+
},
|
|
12974
|
+
list: {
|
|
12975
|
+
loaded: () => {
|
|
12976
|
+
logSprigEvent("workflow-list-loaded", email);
|
|
12977
|
+
}
|
|
12978
|
+
},
|
|
12979
|
+
builder: {
|
|
12980
|
+
loaded: () => {
|
|
12981
|
+
logSprigEvent("workflow-builder-loaded", email);
|
|
12982
|
+
}
|
|
12983
|
+
}
|
|
12984
|
+
},
|
|
12985
|
+
draft: {
|
|
12986
|
+
create: {
|
|
12987
|
+
actions: {
|
|
12988
|
+
click: (source, templateName) => {
|
|
12989
|
+
logAmplitudeEvent(
|
|
12990
|
+
"workflows.draft.create.click",
|
|
12991
|
+
__spreadValues({
|
|
12992
|
+
source
|
|
12993
|
+
}, source === "withTemplate" && { template_name: templateName }),
|
|
12994
|
+
email
|
|
12995
|
+
);
|
|
12996
|
+
logSprigEvent("workflow-draft-create", email, __spreadValues({
|
|
12997
|
+
mode: source
|
|
12998
|
+
}, source === "withTemplate" && { template_name: templateName }));
|
|
12999
|
+
}
|
|
13000
|
+
}
|
|
13001
|
+
},
|
|
13002
|
+
edit: {
|
|
13003
|
+
actions: {
|
|
13004
|
+
click: (source) => {
|
|
13005
|
+
logAmplitudeEvent(
|
|
13006
|
+
"workflows.draft.edit.click",
|
|
13007
|
+
{
|
|
13008
|
+
source
|
|
13009
|
+
},
|
|
13010
|
+
email
|
|
13011
|
+
);
|
|
13012
|
+
},
|
|
13013
|
+
addTrigger: (triggerType, triggerSource) => {
|
|
13014
|
+
logAmplitudeEvent(
|
|
13015
|
+
"workflows.draft.edit.addTrigger",
|
|
13016
|
+
{
|
|
13017
|
+
trigger_type: triggerType,
|
|
13018
|
+
trigger_source: triggerSource
|
|
13019
|
+
},
|
|
13020
|
+
email
|
|
13021
|
+
);
|
|
13022
|
+
},
|
|
13023
|
+
addAction: (actionType, actionProvider) => {
|
|
13024
|
+
logAmplitudeEvent(
|
|
13025
|
+
"workflows.draft.edit.addAction",
|
|
13026
|
+
{
|
|
13027
|
+
action_type: actionType,
|
|
13028
|
+
action_provider: actionProvider
|
|
13029
|
+
},
|
|
13030
|
+
email
|
|
13031
|
+
);
|
|
13032
|
+
}
|
|
13033
|
+
}
|
|
13034
|
+
},
|
|
13035
|
+
publish: {
|
|
13036
|
+
actions: {
|
|
13037
|
+
click: (workflowComplexity) => {
|
|
13038
|
+
logAmplitudeEvent(
|
|
13039
|
+
"workflows.draft.publish.click",
|
|
13040
|
+
{
|
|
13041
|
+
workflow_complexity: workflowComplexity
|
|
13042
|
+
},
|
|
13043
|
+
email
|
|
13044
|
+
);
|
|
13045
|
+
logSprigEvent("workflow-draft-publish", email);
|
|
13046
|
+
}
|
|
13047
|
+
}
|
|
13048
|
+
},
|
|
13049
|
+
delete: {
|
|
13050
|
+
actions: {
|
|
13051
|
+
click: () => {
|
|
13052
|
+
logAmplitudeEvent("workflows.draft.delete.click", void 0, email);
|
|
13053
|
+
}
|
|
13054
|
+
}
|
|
13055
|
+
}
|
|
13056
|
+
},
|
|
13057
|
+
template: {
|
|
13058
|
+
list: {
|
|
13059
|
+
loaded: () => {
|
|
13060
|
+
logSprigEvent("template-list-loaded", email);
|
|
13061
|
+
}
|
|
13062
|
+
}
|
|
13063
|
+
}
|
|
13064
|
+
});
|
|
13065
|
+
|
|
13066
|
+
// src/hooks/analytics.ts
|
|
13067
|
+
function useWorkflowsJourney() {
|
|
13068
|
+
const { user } = useUserContext2();
|
|
13069
|
+
return workflowsJourneyFactory(user == null ? void 0 : user.meta.email);
|
|
13070
|
+
}
|
|
13071
|
+
|
|
13072
|
+
// src/utils/json.ts
|
|
13073
|
+
import { JSONPath } from "jsonpath-plus";
|
|
13074
|
+
var jsonUtils = {
|
|
13075
|
+
HASH_TAG: new RegExp(`(?<!["'])"\\$\\{([\\w.[\\]])*\\}"|\\$\\{([\\w.[\\]])*\\}(?=")|\\$\\{([\\w.[\\]])*\\}`, "g"),
|
|
13076
|
+
HASH_TAG2: new RegExp(`(?<!["'])"#\\{([\\w.[\\]])*\\}"|#\\{([\\w.[\\]])*\\}(?=")|#\\{([\\w.[\\]])*\\}`, "g"),
|
|
13077
|
+
PATH: /^([a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*(\.)?$/g,
|
|
13078
|
+
stringify(json, space = 4) {
|
|
13079
|
+
return JSON.stringify(json, null, space);
|
|
13080
|
+
},
|
|
13081
|
+
escapeTag(value = "") {
|
|
13082
|
+
const valueWithoutQuotes = value.replaceAll('"', "");
|
|
13083
|
+
return valueWithoutQuotes.substring(2, valueWithoutQuotes.length - 1);
|
|
13084
|
+
},
|
|
13085
|
+
getRegex(prefix2 = "$") {
|
|
13086
|
+
return prefix2 === "$" ? jsonUtils.HASH_TAG : jsonUtils.HASH_TAG2;
|
|
13087
|
+
},
|
|
13088
|
+
getMatchesInText(text2, options) {
|
|
13089
|
+
var _a;
|
|
13090
|
+
if (typeof text2 !== "string") {
|
|
13091
|
+
return void 0;
|
|
13092
|
+
}
|
|
13093
|
+
const templates = jsonUtils.getRegex((_a = options == null ? void 0 : options.prefix) != null ? _a : "$").exec(text2);
|
|
13094
|
+
const results = templates == null ? void 0 : templates.filter((match2) => jsonUtils.PATH.exec(jsonUtils.escapeTag(match2))).map(jsonUtils.escapeTag);
|
|
13095
|
+
return results;
|
|
13096
|
+
},
|
|
13097
|
+
getMatchesInObject(input, prefix2 = "$") {
|
|
12623
13098
|
const result = [];
|
|
12624
13099
|
const regex = jsonUtils.getRegex(prefix2);
|
|
12625
13100
|
const search = (item, path = "", instancePath = "") => {
|
|
@@ -12782,130 +13257,6 @@ var jsonUtils = {
|
|
|
12782
13257
|
}
|
|
12783
13258
|
};
|
|
12784
13259
|
|
|
12785
|
-
// src/utils/tracking.ts
|
|
12786
|
-
import * as amplitude from "@amplitude/analytics-browser";
|
|
12787
|
-
var logAmplitudeEvent = (name, payload, user) => {
|
|
12788
|
-
amplitude.init(getWorkflowsEnv("amplitudeKey"), user);
|
|
12789
|
-
amplitude.logEvent(name, payload);
|
|
12790
|
-
};
|
|
12791
|
-
|
|
12792
|
-
// src/utils/amplitude/journeys/workflows/workflows.ts
|
|
12793
|
-
var workflowsBlockAmplitudeJourneyFactory = (email) => ({
|
|
12794
|
-
workflow: {
|
|
12795
|
-
create: {
|
|
12796
|
-
actions: {
|
|
12797
|
-
createDraft: (workflowId) => {
|
|
12798
|
-
logAmplitudeEvent(
|
|
12799
|
-
"workflows.workflow.create.click",
|
|
12800
|
-
{
|
|
12801
|
-
original_workflow_id: workflowId
|
|
12802
|
-
},
|
|
12803
|
-
email
|
|
12804
|
-
);
|
|
12805
|
-
}
|
|
12806
|
-
}
|
|
12807
|
-
},
|
|
12808
|
-
edit: {
|
|
12809
|
-
actions: {
|
|
12810
|
-
click: () => {
|
|
12811
|
-
logAmplitudeEvent(
|
|
12812
|
-
"workflows.workflow.edit.click",
|
|
12813
|
-
{
|
|
12814
|
-
source: "list"
|
|
12815
|
-
},
|
|
12816
|
-
email
|
|
12817
|
-
);
|
|
12818
|
-
}
|
|
12819
|
-
}
|
|
12820
|
-
},
|
|
12821
|
-
delete: {
|
|
12822
|
-
actions: {
|
|
12823
|
-
click: (source, createdAt) => {
|
|
12824
|
-
logAmplitudeEvent(
|
|
12825
|
-
"workflows.workflow.delete.click",
|
|
12826
|
-
__spreadValues({
|
|
12827
|
-
source
|
|
12828
|
-
}, source === "builder" && createdAt && {
|
|
12829
|
-
lifetime_duration: Math.floor(
|
|
12830
|
-
((/* @__PURE__ */ new Date()).getTime() - new Date(createdAt).getTime()) / (1e3 * 60) % 60
|
|
12831
|
-
)
|
|
12832
|
-
}),
|
|
12833
|
-
email
|
|
12834
|
-
);
|
|
12835
|
-
}
|
|
12836
|
-
}
|
|
12837
|
-
}
|
|
12838
|
-
},
|
|
12839
|
-
draft: {
|
|
12840
|
-
create: {
|
|
12841
|
-
actions: {
|
|
12842
|
-
click: (source, templateName) => {
|
|
12843
|
-
logAmplitudeEvent(
|
|
12844
|
-
"workflows.draft.create.click",
|
|
12845
|
-
__spreadValues({
|
|
12846
|
-
source
|
|
12847
|
-
}, source === "withTemplate" && { template_name: templateName }),
|
|
12848
|
-
email
|
|
12849
|
-
);
|
|
12850
|
-
}
|
|
12851
|
-
}
|
|
12852
|
-
},
|
|
12853
|
-
edit: {
|
|
12854
|
-
actions: {
|
|
12855
|
-
click: (source) => {
|
|
12856
|
-
logAmplitudeEvent(
|
|
12857
|
-
"workflows.draft.edit.click",
|
|
12858
|
-
{
|
|
12859
|
-
source
|
|
12860
|
-
},
|
|
12861
|
-
email
|
|
12862
|
-
);
|
|
12863
|
-
},
|
|
12864
|
-
addTrigger: (triggerType, triggerSource) => {
|
|
12865
|
-
logAmplitudeEvent(
|
|
12866
|
-
"workflows.draft.edit.addTrigger",
|
|
12867
|
-
{
|
|
12868
|
-
trigger_type: triggerType,
|
|
12869
|
-
trigger_source: triggerSource
|
|
12870
|
-
},
|
|
12871
|
-
email
|
|
12872
|
-
);
|
|
12873
|
-
},
|
|
12874
|
-
addAction: (actionType, actionProvider) => {
|
|
12875
|
-
logAmplitudeEvent(
|
|
12876
|
-
"workflows.draft.edit.addAction",
|
|
12877
|
-
{
|
|
12878
|
-
action_type: actionType,
|
|
12879
|
-
action_provider: actionProvider
|
|
12880
|
-
},
|
|
12881
|
-
email
|
|
12882
|
-
);
|
|
12883
|
-
}
|
|
12884
|
-
}
|
|
12885
|
-
},
|
|
12886
|
-
publish: {
|
|
12887
|
-
actions: {
|
|
12888
|
-
click: (workflowComplexity) => {
|
|
12889
|
-
logAmplitudeEvent(
|
|
12890
|
-
"workflows.draft.publish.click",
|
|
12891
|
-
{
|
|
12892
|
-
workflow_complexity: workflowComplexity
|
|
12893
|
-
},
|
|
12894
|
-
email
|
|
12895
|
-
);
|
|
12896
|
-
}
|
|
12897
|
-
}
|
|
12898
|
-
},
|
|
12899
|
-
delete: {
|
|
12900
|
-
actions: {
|
|
12901
|
-
click: () => {
|
|
12902
|
-
logAmplitudeEvent("workflows.draft.delete.click", void 0, email);
|
|
12903
|
-
}
|
|
12904
|
-
}
|
|
12905
|
-
}
|
|
12906
|
-
}
|
|
12907
|
-
});
|
|
12908
|
-
|
|
12909
13260
|
// src/views/Workflows/Common/Icons/ProductIcon.tsx
|
|
12910
13261
|
import {
|
|
12911
13262
|
Adjust,
|
|
@@ -12917,10 +13268,11 @@ import {
|
|
|
12917
13268
|
Mailchimp as MailChimpIcon,
|
|
12918
13269
|
Rocket,
|
|
12919
13270
|
ShopifyColored as ShopifyIcon,
|
|
13271
|
+
Slack as SlackIcon,
|
|
12920
13272
|
Time
|
|
12921
13273
|
} from "@livechat/design-system-icons";
|
|
12922
13274
|
import { DesignToken as DesignToken2 } from "@livechat/design-system-react-components";
|
|
12923
|
-
import { IntegrationNames as
|
|
13275
|
+
import { IntegrationNames as IntegrationNames11 } from "@livechat/developer-studio-api";
|
|
12924
13276
|
var defaultIconStyle = ({
|
|
12925
13277
|
disabled,
|
|
12926
13278
|
height,
|
|
@@ -12928,23 +13280,23 @@ var defaultIconStyle = ({
|
|
|
12928
13280
|
noFill,
|
|
12929
13281
|
revertColors
|
|
12930
13282
|
}) => css`
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
13283
|
+
height: var(--spacing-${height});
|
|
13284
|
+
width: var(--spacing-${width});
|
|
13285
|
+
${!noFill && "fill: white;"}
|
|
13286
|
+
${disabled && "opacity: 0.5;"}
|
|
12935
13287
|
|
|
12936
13288
|
path {
|
|
12937
|
-
|
|
12938
|
-
|
|
13289
|
+
${noFill && `stroke: var(${DesignToken2.ContentBasicPrimary})`}
|
|
13290
|
+
}
|
|
12939
13291
|
|
|
12940
|
-
|
|
13292
|
+
${revertColors && `
|
|
12941
13293
|
fill: var(${DesignToken2.ContentBasicPrimary});
|
|
12942
13294
|
path {
|
|
12943
13295
|
fill: var(${DesignToken2.ContentBasicPrimary});
|
|
12944
13296
|
}
|
|
12945
13297
|
|
|
12946
13298
|
`}
|
|
12947
|
-
|
|
13299
|
+
`;
|
|
12948
13300
|
var helpdeskconCss = ({
|
|
12949
13301
|
disabled,
|
|
12950
13302
|
height,
|
|
@@ -13009,11 +13361,11 @@ function ProductIcon({
|
|
|
13009
13361
|
})
|
|
13010
13362
|
}
|
|
13011
13363
|
);
|
|
13012
|
-
case
|
|
13364
|
+
case IntegrationNames11.Mailchimp:
|
|
13013
13365
|
return /* @__PURE__ */ jsx4(MailChimpIcon, { css: defaultIconStyle({ disabled, height, width }) });
|
|
13014
|
-
case
|
|
13366
|
+
case IntegrationNames11.Shopify:
|
|
13015
13367
|
return /* @__PURE__ */ jsx4(ShopifyIcon, { css: defaultIconStyle({ disabled, height, width }) });
|
|
13016
|
-
case
|
|
13368
|
+
case IntegrationNames11.BigCommerce:
|
|
13017
13369
|
return /* @__PURE__ */ jsx4(
|
|
13018
13370
|
BigCommerceIcon,
|
|
13019
13371
|
{
|
|
@@ -13025,9 +13377,11 @@ function ProductIcon({
|
|
|
13025
13377
|
})
|
|
13026
13378
|
}
|
|
13027
13379
|
);
|
|
13028
|
-
case
|
|
13380
|
+
case IntegrationNames11.HubSpot:
|
|
13029
13381
|
return /* @__PURE__ */ jsx4(HubSpotIcon, { css: defaultIconStyle({ disabled, height, width }) });
|
|
13030
|
-
case
|
|
13382
|
+
case IntegrationNames11.Slack:
|
|
13383
|
+
return /* @__PURE__ */ jsx4(SlackIcon, { css: defaultIconStyle({ disabled, height, width }) });
|
|
13384
|
+
case IntegrationNames11.OpenAI:
|
|
13031
13385
|
return /* @__PURE__ */ jsx4(
|
|
13032
13386
|
OpenAiIcon,
|
|
13033
13387
|
{
|
|
@@ -13040,10 +13394,10 @@ function ProductIcon({
|
|
|
13040
13394
|
}
|
|
13041
13395
|
);
|
|
13042
13396
|
case "helpdesk":
|
|
13043
|
-
case
|
|
13397
|
+
case IntegrationNames11.HelpDesk:
|
|
13044
13398
|
return /* @__PURE__ */ jsx4(HelpdeskIcon, { css: helpdeskconCss({ disabled, height, width }) });
|
|
13045
13399
|
case "livechat":
|
|
13046
|
-
case
|
|
13400
|
+
case IntegrationNames11.LiveChat:
|
|
13047
13401
|
default:
|
|
13048
13402
|
return /* @__PURE__ */ jsx4(LivechatIcon, { css: livechatIconStyle({ disabled, height, width }) });
|
|
13049
13403
|
}
|
|
@@ -13059,16 +13413,20 @@ import {
|
|
|
13059
13413
|
useRef as useRef3,
|
|
13060
13414
|
useState as useState4
|
|
13061
13415
|
} from "react";
|
|
13062
|
-
import { useNavigate as useNavigate3 } from "react-router-dom";
|
|
13063
13416
|
import { ReactFlowProvider, useReactFlow } from "reactflow";
|
|
13064
13417
|
import debounce from "lodash.debounce";
|
|
13065
|
-
import { WorkflowDefinitionTaskType as
|
|
13418
|
+
import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType13 } from "@livechat/developer-studio-api";
|
|
13066
13419
|
import { useNotificationContext as useNotificationContext2 } from "@livechat/developer-studio-ui-react";
|
|
13067
13420
|
|
|
13421
|
+
// src/utils/sendMessage.ts
|
|
13422
|
+
var sendMessage = (type) => {
|
|
13423
|
+
window.parent.postMessage({ type }, "*");
|
|
13424
|
+
};
|
|
13425
|
+
|
|
13068
13426
|
// src/views/Workflows/Common/One/contexts/OneMessagesContext.tsx
|
|
13069
13427
|
import { createContext as createContext2, useContext as useContext4, useMemo, useState } from "react";
|
|
13070
13428
|
import { v4 as uuid } from "uuid";
|
|
13071
|
-
import { useUserContext as
|
|
13429
|
+
import { useUserContext as useUserContext3 } from "@livechat/developer-studio-ui-react";
|
|
13072
13430
|
|
|
13073
13431
|
// src/views/Workflows/Common/One/helpers.ts
|
|
13074
13432
|
import { v4 as uuidv4 } from "uuid";
|
|
@@ -13166,7 +13524,7 @@ function OneMessagesProvider({ children }) {
|
|
|
13166
13524
|
const [isError, setIsError] = useState(null);
|
|
13167
13525
|
const [events, setEvents] = useState([getInitialMessage()]);
|
|
13168
13526
|
const generateAiResponseMutation = useGenerateAIResponse();
|
|
13169
|
-
const { user } =
|
|
13527
|
+
const { user } = useUserContext3();
|
|
13170
13528
|
const isLoading = generateAiResponseMutation.isLoading;
|
|
13171
13529
|
const sendMessage2 = (message) => __async(this, null, function* () {
|
|
13172
13530
|
setIsError(null);
|
|
@@ -13269,15 +13627,15 @@ var useOneWidgetContext = () => {
|
|
|
13269
13627
|
};
|
|
13270
13628
|
|
|
13271
13629
|
// src/views/Workflows/Creator/Builder/config.ts
|
|
13272
|
-
import { WorkflowDefinitionTaskType as
|
|
13630
|
+
import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType11 } from "@livechat/developer-studio-api";
|
|
13273
13631
|
var NodeNames = {
|
|
13274
13632
|
// workflow task nodes
|
|
13275
13633
|
addTask: "ADD_TASK",
|
|
13276
|
-
http:
|
|
13277
|
-
forkJoin:
|
|
13278
|
-
switch:
|
|
13279
|
-
terminate:
|
|
13280
|
-
join:
|
|
13634
|
+
http: WorkflowDefinitionTaskType11.http,
|
|
13635
|
+
forkJoin: WorkflowDefinitionTaskType11.forkJoin,
|
|
13636
|
+
switch: WorkflowDefinitionTaskType11.switch,
|
|
13637
|
+
terminate: WorkflowDefinitionTaskType11.terminate,
|
|
13638
|
+
join: WorkflowDefinitionTaskType11.join,
|
|
13281
13639
|
// workflow trigger nodes
|
|
13282
13640
|
addTrigger: "ADD_TRIGGER",
|
|
13283
13641
|
trigger: "TRIGGER"
|
|
@@ -13301,9 +13659,10 @@ var DEFAULT_NODE_HEIGHT = {
|
|
|
13301
13659
|
|
|
13302
13660
|
// src/views/Workflows/Creator/Provider/navigation/hooks.ts
|
|
13303
13661
|
import { useCallback, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
13304
|
-
import { useLocation, useNavigate
|
|
13662
|
+
import { useLocation, useNavigate, useParams } from "react-router-dom";
|
|
13305
13663
|
function useReplaceWorkflowIdInUrl() {
|
|
13306
|
-
const navigate =
|
|
13664
|
+
const navigate = useNavigate();
|
|
13665
|
+
const relativeNavigate = useWorkflowsRelativeNavigate();
|
|
13307
13666
|
const location = useLocation();
|
|
13308
13667
|
const { id } = useParams();
|
|
13309
13668
|
const latestPathRef = useRef2(location.pathname);
|
|
@@ -13313,13 +13672,13 @@ function useReplaceWorkflowIdInUrl() {
|
|
|
13313
13672
|
return useCallback(
|
|
13314
13673
|
(newId) => {
|
|
13315
13674
|
if (!id) {
|
|
13316
|
-
|
|
13675
|
+
relativeNavigate(`/${newId}`);
|
|
13317
13676
|
return;
|
|
13318
13677
|
}
|
|
13319
13678
|
const latestPath = latestPathRef.current.replace(`/${id}`, `/${newId}`);
|
|
13320
13679
|
navigate(latestPath, { replace: true });
|
|
13321
13680
|
},
|
|
13322
|
-
[navigate, id]
|
|
13681
|
+
[navigate, relativeNavigate, id]
|
|
13323
13682
|
);
|
|
13324
13683
|
}
|
|
13325
13684
|
|
|
@@ -13369,7 +13728,7 @@ function useWorkflowData(workflow) {
|
|
|
13369
13728
|
}
|
|
13370
13729
|
|
|
13371
13730
|
// src/views/Workflows/Creator/Provider/state/metadata/contexts/utils.ts
|
|
13372
|
-
import { IntegrationNames as
|
|
13731
|
+
import { IntegrationNames as IntegrationNames12 } from "@livechat/developer-studio-api";
|
|
13373
13732
|
var taskContextHandler = (schema) => {
|
|
13374
13733
|
const generateExample = (schemaInner) => {
|
|
13375
13734
|
if (!isJSONSchema7(schemaInner)) {
|
|
@@ -13559,12 +13918,13 @@ var getWorkflowContexts = (workflow, external) => {
|
|
|
13559
13918
|
credentials: Object.fromEntries(
|
|
13560
13919
|
external.credentials.filter(
|
|
13561
13920
|
(credential) => [
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
|
|
13921
|
+
IntegrationNames12.Text,
|
|
13922
|
+
IntegrationNames12.BigCommerce,
|
|
13923
|
+
IntegrationNames12.HubSpot,
|
|
13924
|
+
IntegrationNames12.Mailchimp,
|
|
13925
|
+
IntegrationNames12.Shopify,
|
|
13926
|
+
IntegrationNames12.OpenAI,
|
|
13927
|
+
IntegrationNames12.Slack
|
|
13568
13928
|
].includes(credential.provider)
|
|
13569
13929
|
).map((credential) => {
|
|
13570
13930
|
if (credential.type === "text_auth") {
|
|
@@ -13633,15 +13993,15 @@ import { useMemo as useMemo3 } from "react";
|
|
|
13633
13993
|
import { useFetchIntegrationCredentialsQuery } from "@livechat/platform-integrations";
|
|
13634
13994
|
|
|
13635
13995
|
// src/views/Workflows/Creator/Provider/state/metadata/utils.ts
|
|
13636
|
-
import { WorkflowDefinitionTaskType as
|
|
13996
|
+
import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType12 } from "@livechat/developer-studio-api";
|
|
13637
13997
|
var flattenTasks = (tasks) => (Array.isArray(tasks) ? tasks : Object.values(tasks)).flatMap((task2) => {
|
|
13638
|
-
if (task2.type ===
|
|
13998
|
+
if (task2.type === WorkflowDefinitionTaskType12.switch) {
|
|
13639
13999
|
return [
|
|
13640
14000
|
task2,
|
|
13641
14001
|
...Object.values(task2.decisionCases).flatMap((a) => flattenTasks(a)),
|
|
13642
14002
|
...task2.defaultCase ? flattenTasks(task2.defaultCase) : []
|
|
13643
14003
|
];
|
|
13644
|
-
} else if (task2.type ===
|
|
14004
|
+
} else if (task2.type === WorkflowDefinitionTaskType12.forkJoin) {
|
|
13645
14005
|
return [task2, ...task2.forkTasks.flatMap((a) => flattenTasks(a))];
|
|
13646
14006
|
}
|
|
13647
14007
|
return [task2];
|
|
@@ -13650,52 +14010,10 @@ var flattenTasks = (tasks) => (Array.isArray(tasks) ? tasks : Object.values(task
|
|
|
13650
14010
|
// src/views/Workflows/Creator/Provider/state/metadata/validation/hooks.ts
|
|
13651
14011
|
import { useCallback as useCallback3, useMemo as useMemo2 } from "react";
|
|
13652
14012
|
|
|
13653
|
-
// src/hooks/user.ts
|
|
13654
|
-
import { useMutation as useMutation2, useQuery as useQuery3, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
13655
|
-
import { api as api3 } from "@livechat/developer-studio-api";
|
|
13656
|
-
var userQueryKeys = {
|
|
13657
|
-
accounts: {
|
|
13658
|
-
account: {
|
|
13659
|
-
getInfo: ["accounts.account.getInfo"]
|
|
13660
|
-
},
|
|
13661
|
-
products: {
|
|
13662
|
-
getOrganizationProducts: ["accounts.products.getOrganizationProducts"]
|
|
13663
|
-
}
|
|
13664
|
-
},
|
|
13665
|
-
dps: {
|
|
13666
|
-
getUser: ["dps.getUser"],
|
|
13667
|
-
getUserIntegrations: ["dps.getUserIntegrations"]
|
|
13668
|
-
}
|
|
13669
|
-
};
|
|
13670
|
-
var useFetchOrganizationProducts = () => {
|
|
13671
|
-
var _b;
|
|
13672
|
-
const _a = useQuery3(
|
|
13673
|
-
userQueryKeys.accounts.products.getOrganizationProducts,
|
|
13674
|
-
() => api3.platform.accounts.products.getOrganizationProducts()
|
|
13675
|
-
), { data, isLoading } = _a, rest = __objRest(_a, ["data", "isLoading"]);
|
|
13676
|
-
return __spreadValues({ data: (_b = data == null ? void 0 : data.data) != null ? _b : [], isLoading }, rest);
|
|
13677
|
-
};
|
|
13678
|
-
var useUpdateOrganizationProducts = () => {
|
|
13679
|
-
const queryClient = useQueryClient2();
|
|
13680
|
-
const { mutateAsync: updateOrganizationProducts, isLoading } = useMutation2(
|
|
13681
|
-
({ productName }) => api3.platform.accounts.products.updateOrganizationProducts({
|
|
13682
|
-
product: productName
|
|
13683
|
-
}),
|
|
13684
|
-
{
|
|
13685
|
-
onSuccess: (_2) => {
|
|
13686
|
-
void queryClient.refetchQueries({
|
|
13687
|
-
queryKey: userQueryKeys.accounts.products.getOrganizationProducts
|
|
13688
|
-
});
|
|
13689
|
-
}
|
|
13690
|
-
}
|
|
13691
|
-
);
|
|
13692
|
-
return { updateOrganizationProducts, isLoading };
|
|
13693
|
-
};
|
|
13694
|
-
|
|
13695
14013
|
// src/views/Workflows/Creator/Provider/state/metadata/validation/utils.ts
|
|
13696
14014
|
import Ajv, { _ } from "ajv";
|
|
13697
14015
|
import AjvWithErrors from "ajv-errors";
|
|
13698
|
-
import { IntegrationNames as
|
|
14016
|
+
import { IntegrationNames as IntegrationNames13 } from "@livechat/developer-studio-api";
|
|
13699
14017
|
var keywords = {
|
|
13700
14018
|
urlWithQueryParams: {
|
|
13701
14019
|
keyword: "queryParams",
|
|
@@ -13842,7 +14160,7 @@ var validateTasks = (workflow, frames, products) => {
|
|
|
13842
14160
|
params: {}
|
|
13843
14161
|
};
|
|
13844
14162
|
});
|
|
13845
|
-
const activationError = (config2 == null ? void 0 : config2.customization.provider.startsWith(
|
|
14163
|
+
const activationError = (config2 == null ? void 0 : config2.customization.provider.startsWith(IntegrationNames13.Text)) && !products.find(({ product }) => product === config2.customization.product) ? {
|
|
13846
14164
|
instancePath: baseInstancePath,
|
|
13847
14165
|
keyword: "activation",
|
|
13848
14166
|
message: `${config2.customization.product} not activated`,
|
|
@@ -13937,7 +14255,7 @@ var validateTrigger = (workflow, frames, products) => {
|
|
|
13937
14255
|
params: {}
|
|
13938
14256
|
};
|
|
13939
14257
|
});
|
|
13940
|
-
const activationError = config2 && config2.customization.provider.startsWith(
|
|
14258
|
+
const activationError = config2 && config2.customization.provider.startsWith(IntegrationNames13.Text) && !products.find(({ product }) => product === config2.customization.product) ? {
|
|
13941
14259
|
instancePath: "/trigger",
|
|
13942
14260
|
keyword: "activation",
|
|
13943
14261
|
message: `${config2.customization.product} not activated`,
|
|
@@ -14303,7 +14621,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14303
14621
|
}) {
|
|
14304
14622
|
var _a, _b;
|
|
14305
14623
|
const { fitView } = useReactFlow();
|
|
14306
|
-
const navigate =
|
|
14624
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
14307
14625
|
const notifications = useNotificationContext2();
|
|
14308
14626
|
const replaceWorkflowId = useReplaceWorkflowIdInUrl();
|
|
14309
14627
|
const createWorkflowAction = useCreateWorkflow();
|
|
@@ -14357,8 +14675,8 @@ function WorkflowCreatorProviderBase({
|
|
|
14357
14675
|
setTimeout(() => {
|
|
14358
14676
|
setSelection(() => {
|
|
14359
14677
|
const isNotEditable = (params == null ? void 0 : params.kind) === "task" && [
|
|
14360
|
-
|
|
14361
|
-
|
|
14678
|
+
WorkflowDefinitionTaskType13.forkJoin,
|
|
14679
|
+
WorkflowDefinitionTaskType13.join
|
|
14362
14680
|
].includes(params.id) || (params == null ? void 0 : params.kind) === "add-trigger" || (params == null ? void 0 : params.kind) === "trigger" && params.id === "manual_only";
|
|
14363
14681
|
return params ? __spreadProps(__spreadValues({}, params), {
|
|
14364
14682
|
isEditable: !isNotEditable
|
|
@@ -14421,6 +14739,17 @@ function WorkflowCreatorProviderBase({
|
|
|
14421
14739
|
},
|
|
14422
14740
|
[autosaveWorkflowRef, setWorkflow]
|
|
14423
14741
|
);
|
|
14742
|
+
useEffect4(() => {
|
|
14743
|
+
if (getWorkflowsEnv("isLiveChatMode")) {
|
|
14744
|
+
sendMessage("closeSideNav" /* CloseSideNav */);
|
|
14745
|
+
const timeoutId = setTimeout(() => {
|
|
14746
|
+
focus();
|
|
14747
|
+
}, 200);
|
|
14748
|
+
return () => {
|
|
14749
|
+
clearTimeout(timeoutId);
|
|
14750
|
+
};
|
|
14751
|
+
}
|
|
14752
|
+
}, [focus]);
|
|
14424
14753
|
const goToAddTrigger = useCallback4(() => {
|
|
14425
14754
|
navigate(
|
|
14426
14755
|
`${basePath}/trigger/${OTHER_TYPES.SYSTEM}/${"manual" /* Manual */}`,
|
|
@@ -14456,13 +14785,14 @@ function WorkflowCreatorProviderBase({
|
|
|
14456
14785
|
const removeTrigger = useCallback4(() => {
|
|
14457
14786
|
var _a2;
|
|
14458
14787
|
const state2 = autosaveStateRef.current;
|
|
14459
|
-
replaceWorkflow(__spreadProps(__spreadValues({}, state2.workflow), {
|
|
14460
|
-
trigger: {}
|
|
14461
|
-
}));
|
|
14462
14788
|
if (((_a2 = state2.selection) == null ? void 0 : _a2.kind) === "trigger") {
|
|
14789
|
+
setSelection(void 0);
|
|
14463
14790
|
toggle();
|
|
14464
14791
|
}
|
|
14465
|
-
|
|
14792
|
+
replaceWorkflow(__spreadProps(__spreadValues({}, state2.workflow), {
|
|
14793
|
+
trigger: {}
|
|
14794
|
+
}));
|
|
14795
|
+
}, [replaceWorkflow, setSelection, toggle]);
|
|
14466
14796
|
const goToAddTask = useCallback4(
|
|
14467
14797
|
(taskReference, parentTaskReference) => {
|
|
14468
14798
|
navigate(`${basePath}/add`, {
|
|
@@ -14497,7 +14827,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14497
14827
|
if (newTasks[0].type === NodeNames.forkJoin) {
|
|
14498
14828
|
const systemTasks = systemTaskTemplates();
|
|
14499
14829
|
newTasks[0].forkTasks = [[], []];
|
|
14500
|
-
newTasks.push(__spreadProps(__spreadValues({}, systemTasks[
|
|
14830
|
+
newTasks.push(__spreadProps(__spreadValues({}, systemTasks[WorkflowDefinitionTaskType13.join]), {
|
|
14501
14831
|
taskReferenceName: `join_${task2.taskReferenceName}_${existingTaskIndex ? Number(existingTaskIndex[1]) + 1 : 1}`
|
|
14502
14832
|
}));
|
|
14503
14833
|
}
|
|
@@ -14604,6 +14934,10 @@ function WorkflowCreatorProviderBase({
|
|
|
14604
14934
|
const removeTask = useCallback4(
|
|
14605
14935
|
(targetTaskReferenceName) => {
|
|
14606
14936
|
var _a2;
|
|
14937
|
+
if (targetTaskReferenceName === ((_a2 = state.selection) == null ? void 0 : _a2.id)) {
|
|
14938
|
+
setSelection(void 0);
|
|
14939
|
+
toggle();
|
|
14940
|
+
}
|
|
14607
14941
|
changeWorkflow((workflow2) => ({
|
|
14608
14942
|
definition: {
|
|
14609
14943
|
tasks: recursiveTaskReducer(
|
|
@@ -14616,11 +14950,8 @@ function WorkflowCreatorProviderBase({
|
|
|
14616
14950
|
)
|
|
14617
14951
|
}
|
|
14618
14952
|
}));
|
|
14619
|
-
if (targetTaskReferenceName === ((_a2 = state.selection) == null ? void 0 : _a2.id)) {
|
|
14620
|
-
toggle();
|
|
14621
|
-
}
|
|
14622
14953
|
},
|
|
14623
|
-
[(_b = state.selection) == null ? void 0 : _b.id, changeWorkflow, toggle]
|
|
14954
|
+
[(_b = state.selection) == null ? void 0 : _b.id, changeWorkflow, setSelection, toggle]
|
|
14624
14955
|
);
|
|
14625
14956
|
const save = useCallback4(
|
|
14626
14957
|
(silent) => __async(this, null, function* () {
|
|
@@ -14704,7 +15035,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14704
15035
|
} else {
|
|
14705
15036
|
yield deleteWorkflowAction.mutateAsync(state2.workflow);
|
|
14706
15037
|
}
|
|
14707
|
-
navigate("/
|
|
15038
|
+
navigate("/list");
|
|
14708
15039
|
notifications.addSuccessToast("Workflow has been removed successfully");
|
|
14709
15040
|
} finally {
|
|
14710
15041
|
setAction("isRemoving", false);
|
|
@@ -14718,7 +15049,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14718
15049
|
}
|
|
14719
15050
|
if (state2.workflow.related_workflow_id) {
|
|
14720
15051
|
if (!(options2 == null ? void 0 : options2.overrideConfirmed)) {
|
|
14721
|
-
navigate(
|
|
15052
|
+
navigate(`/${state2.workflow.id}/edit`);
|
|
14722
15053
|
return;
|
|
14723
15054
|
}
|
|
14724
15055
|
}
|
|
@@ -14732,7 +15063,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14732
15063
|
const draftId = yield createWorkflowDraftAction.mutateAsync(
|
|
14733
15064
|
state2.workflow
|
|
14734
15065
|
);
|
|
14735
|
-
navigate(
|
|
15066
|
+
navigate(`/${draftId}`);
|
|
14736
15067
|
notifications.addSuccessToast(
|
|
14737
15068
|
"Workflow draft has been created successfully"
|
|
14738
15069
|
);
|
|
@@ -14760,7 +15091,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14760
15091
|
}
|
|
14761
15092
|
if (!(options2 == null ? void 0 : options2.confirmed)) {
|
|
14762
15093
|
navigate(
|
|
14763
|
-
|
|
15094
|
+
`/${(_a2 = state2.workflow.id) != null ? _a2 : "new"}/publish`
|
|
14764
15095
|
);
|
|
14765
15096
|
return;
|
|
14766
15097
|
}
|
|
@@ -14770,12 +15101,12 @@ function WorkflowCreatorProviderBase({
|
|
|
14770
15101
|
const { id } = yield publishWorkflowAction.mutateAsync(
|
|
14771
15102
|
state2.workflow
|
|
14772
15103
|
);
|
|
14773
|
-
navigate(
|
|
15104
|
+
navigate(`/${id}`);
|
|
14774
15105
|
} else {
|
|
14775
15106
|
const id = yield createWorkflowAction.mutateAsync(__spreadProps(__spreadValues({}, state2.workflow), {
|
|
14776
15107
|
draft: false
|
|
14777
15108
|
}));
|
|
14778
|
-
navigate(
|
|
15109
|
+
navigate(`/${id}`);
|
|
14779
15110
|
}
|
|
14780
15111
|
notifications.addSuccessToast(
|
|
14781
15112
|
"Workflow draft has been published successfully"
|
|
@@ -14802,16 +15133,16 @@ function WorkflowCreatorProviderBase({
|
|
|
14802
15133
|
yield deleteWorkflowAction.mutateAsync(state2.workflow);
|
|
14803
15134
|
}
|
|
14804
15135
|
if (state2.workflow.related_workflow_id) {
|
|
14805
|
-
navigate(
|
|
15136
|
+
navigate(`/${state2.workflow.related_workflow_id}`);
|
|
14806
15137
|
} else {
|
|
14807
|
-
navigate("/
|
|
15138
|
+
navigate("/list");
|
|
14808
15139
|
}
|
|
14809
15140
|
} else if (state2.workflow.related_workflow_id) {
|
|
14810
15141
|
yield deleteWorkflowAction.mutateAsync({
|
|
14811
15142
|
id: state2.workflow.related_workflow_id,
|
|
14812
15143
|
related_workflow_id: state2.workflow.id
|
|
14813
15144
|
});
|
|
14814
|
-
navigate(
|
|
15145
|
+
navigate(`/${state2.workflow.id}`);
|
|
14815
15146
|
}
|
|
14816
15147
|
notifications.addSuccessToast(
|
|
14817
15148
|
"Workflow draft has been discarded successfully"
|
|
@@ -14973,7 +15304,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
14973
15304
|
var _a;
|
|
14974
15305
|
const [search, setSearch] = useState5("");
|
|
14975
15306
|
const location = useLocation2();
|
|
14976
|
-
const navigate =
|
|
15307
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
14977
15308
|
const params = useParams2();
|
|
14978
15309
|
const [state, setState] = useState5();
|
|
14979
15310
|
const config2 = useMemo4(
|
|
@@ -15007,12 +15338,12 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15007
15338
|
// },
|
|
15008
15339
|
{
|
|
15009
15340
|
name: "livechat",
|
|
15010
|
-
displayName:
|
|
15341
|
+
displayName: IntegrationDisplayNames10.LiveChat,
|
|
15011
15342
|
icon: /* @__PURE__ */ jsx4(
|
|
15012
15343
|
ProductIcon_default,
|
|
15013
15344
|
{
|
|
15014
15345
|
height: 5,
|
|
15015
|
-
product:
|
|
15346
|
+
product: IntegrationNames14.LiveChat,
|
|
15016
15347
|
width: 5
|
|
15017
15348
|
}
|
|
15018
15349
|
),
|
|
@@ -15025,13 +15356,13 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15025
15356
|
},
|
|
15026
15357
|
{
|
|
15027
15358
|
name: "helpdesk",
|
|
15028
|
-
displayName:
|
|
15359
|
+
displayName: IntegrationDisplayNames10.HelpDesk,
|
|
15029
15360
|
icon: /* @__PURE__ */ jsx4(
|
|
15030
15361
|
ProductIcon_default,
|
|
15031
15362
|
{
|
|
15032
15363
|
center: true,
|
|
15033
15364
|
height: 5,
|
|
15034
|
-
product:
|
|
15365
|
+
product: IntegrationNames14.HelpDesk,
|
|
15035
15366
|
width: 5
|
|
15036
15367
|
}
|
|
15037
15368
|
),
|
|
@@ -15043,9 +15374,9 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15043
15374
|
}))
|
|
15044
15375
|
},
|
|
15045
15376
|
{
|
|
15046
|
-
name:
|
|
15047
|
-
displayName:
|
|
15048
|
-
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { height: 5, product:
|
|
15377
|
+
name: IntegrationNames14.OpenAI,
|
|
15378
|
+
displayName: IntegrationDisplayNames10.OpenAI,
|
|
15379
|
+
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { height: 5, product: IntegrationNames14.OpenAI, width: 5 }),
|
|
15049
15380
|
values: Object.values(openAiTaskConfigs()).map((x) => ({
|
|
15050
15381
|
key: x.key,
|
|
15051
15382
|
name: x.customization.displayName,
|
|
@@ -15054,13 +15385,13 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15054
15385
|
}))
|
|
15055
15386
|
},
|
|
15056
15387
|
{
|
|
15057
|
-
name:
|
|
15058
|
-
displayName:
|
|
15388
|
+
name: IntegrationNames14.Mailchimp,
|
|
15389
|
+
displayName: IntegrationDisplayNames10.Mailchimp,
|
|
15059
15390
|
icon: /* @__PURE__ */ jsx4(
|
|
15060
15391
|
ProductIcon_default,
|
|
15061
15392
|
{
|
|
15062
15393
|
height: 5,
|
|
15063
|
-
product:
|
|
15394
|
+
product: IntegrationNames14.Mailchimp,
|
|
15064
15395
|
width: 5
|
|
15065
15396
|
}
|
|
15066
15397
|
),
|
|
@@ -15072,13 +15403,13 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15072
15403
|
}))
|
|
15073
15404
|
},
|
|
15074
15405
|
{
|
|
15075
|
-
name:
|
|
15076
|
-
displayName:
|
|
15406
|
+
name: IntegrationNames14.HubSpot,
|
|
15407
|
+
displayName: IntegrationDisplayNames10.HubSpot,
|
|
15077
15408
|
icon: /* @__PURE__ */ jsx4(
|
|
15078
15409
|
ProductIcon_default,
|
|
15079
15410
|
{
|
|
15080
15411
|
height: 5,
|
|
15081
|
-
product:
|
|
15412
|
+
product: IntegrationNames14.HubSpot,
|
|
15082
15413
|
width: 5
|
|
15083
15414
|
}
|
|
15084
15415
|
),
|
|
@@ -15090,13 +15421,24 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15090
15421
|
}))
|
|
15091
15422
|
},
|
|
15092
15423
|
{
|
|
15093
|
-
name:
|
|
15094
|
-
displayName:
|
|
15424
|
+
name: IntegrationNames14.Slack,
|
|
15425
|
+
displayName: IntegrationDisplayNames10.Slack,
|
|
15426
|
+
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { height: 5, product: IntegrationNames14.Slack, width: 5 }),
|
|
15427
|
+
values: Object.values(slackTaskConfigs()).map((x) => ({
|
|
15428
|
+
key: x.key,
|
|
15429
|
+
name: x.customization.displayName,
|
|
15430
|
+
shortDescription: x.customization.shortDescription,
|
|
15431
|
+
secondaryText: x.customization.description
|
|
15432
|
+
}))
|
|
15433
|
+
},
|
|
15434
|
+
{
|
|
15435
|
+
name: IntegrationNames14.BigCommerce,
|
|
15436
|
+
displayName: IntegrationDisplayNames10.BigCommerce,
|
|
15095
15437
|
icon: /* @__PURE__ */ jsx4(
|
|
15096
15438
|
ProductIcon_default,
|
|
15097
15439
|
{
|
|
15098
15440
|
height: 5,
|
|
15099
|
-
product:
|
|
15441
|
+
product: IntegrationNames14.BigCommerce,
|
|
15100
15442
|
width: 5
|
|
15101
15443
|
}
|
|
15102
15444
|
),
|
|
@@ -15108,13 +15450,13 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15108
15450
|
}))
|
|
15109
15451
|
},
|
|
15110
15452
|
{
|
|
15111
|
-
name:
|
|
15112
|
-
displayName:
|
|
15453
|
+
name: IntegrationNames14.Shopify,
|
|
15454
|
+
displayName: IntegrationDisplayNames10.Shopify,
|
|
15113
15455
|
icon: /* @__PURE__ */ jsx4(
|
|
15114
15456
|
ProductIcon_default,
|
|
15115
15457
|
{
|
|
15116
15458
|
height: 5,
|
|
15117
|
-
product:
|
|
15459
|
+
product: IntegrationNames14.Shopify,
|
|
15118
15460
|
width: 5
|
|
15119
15461
|
}
|
|
15120
15462
|
),
|
|
@@ -15132,10 +15474,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15132
15474
|
addTask,
|
|
15133
15475
|
state: { workflow }
|
|
15134
15476
|
} = useWorkflowCreator();
|
|
15135
|
-
const
|
|
15136
|
-
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
15137
|
-
user == null ? void 0 : user.meta.email
|
|
15138
|
-
);
|
|
15477
|
+
const journey = useWorkflowsJourney();
|
|
15139
15478
|
useEffect5(() => {
|
|
15140
15479
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
15141
15480
|
if (!params.task) {
|
|
@@ -15186,10 +15525,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15186
15525
|
const handleAddTask = (task2) => {
|
|
15187
15526
|
var _a2, _b;
|
|
15188
15527
|
if (task2) {
|
|
15189
|
-
|
|
15190
|
-
task2.type,
|
|
15191
|
-
params.service
|
|
15192
|
-
);
|
|
15528
|
+
journey.draft.edit.actions.addAction(task2.type, params.service);
|
|
15193
15529
|
addTask(
|
|
15194
15530
|
task2,
|
|
15195
15531
|
(_a2 = location.state) == null ? void 0 : _a2.taskReference,
|
|
@@ -15256,7 +15592,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15256
15592
|
}
|
|
15257
15593
|
),
|
|
15258
15594
|
config2.map(({ name, displayName, icon: icon2, values }) => {
|
|
15259
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && (name ===
|
|
15595
|
+
const revertIconColor = getWorkflowsEnv("isHeadless") && (name === IntegrationNames14.OpenAI || name === IntegrationNames14.BigCommerce);
|
|
15260
15596
|
if (search) {
|
|
15261
15597
|
if (values.some(
|
|
15262
15598
|
(el) => el.name.toLowerCase().includes(search.toLowerCase())
|
|
@@ -15273,11 +15609,13 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15273
15609
|
|
|
15274
15610
|
border-radius: var(${RadiusToken2[3]});
|
|
15275
15611
|
width: 100%;
|
|
15612
|
+
|
|
15276
15613
|
:has(.active) {
|
|
15277
15614
|
a {
|
|
15278
15615
|
color: var(${DesignToken4.ActionPrimaryDefault});
|
|
15279
15616
|
}
|
|
15280
15617
|
}
|
|
15618
|
+
|
|
15281
15619
|
&:hover {
|
|
15282
15620
|
background-color: var(${DesignToken4.SurfacePrimaryHover});
|
|
15283
15621
|
cursor: pointer;
|
|
@@ -15286,6 +15624,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15286
15624
|
color: var(${DesignToken4.ActionPrimaryDefault});
|
|
15287
15625
|
}
|
|
15288
15626
|
}
|
|
15627
|
+
|
|
15289
15628
|
${revertIconColor ? `> svg {
|
|
15290
15629
|
fill: var(${DesignToken4.ContentBasicPrimary});
|
|
15291
15630
|
path {
|
|
@@ -15375,7 +15714,7 @@ var Modal_default = AddWorkflowTaskModal;
|
|
|
15375
15714
|
|
|
15376
15715
|
// src/views/Workflows/Creator/Modals/AddTrigger/Modal.tsx
|
|
15377
15716
|
import { useEffect as useEffect6, useMemo as useMemo5, useState as useState6 } from "react";
|
|
15378
|
-
import { NavLink as NavLink2, useLocation as useLocation3,
|
|
15717
|
+
import { NavLink as NavLink2, useLocation as useLocation3, useParams as useParams3 } from "react-router-dom";
|
|
15379
15718
|
import {
|
|
15380
15719
|
Button as Button3,
|
|
15381
15720
|
DesignToken as DesignToken6,
|
|
@@ -15386,14 +15725,13 @@ import {
|
|
|
15386
15725
|
SpacingToken as SpacingToken5
|
|
15387
15726
|
} from "@livechat/design-system-react-components";
|
|
15388
15727
|
import {
|
|
15389
|
-
IntegrationDisplayNames as
|
|
15390
|
-
IntegrationNames as
|
|
15728
|
+
IntegrationDisplayNames as IntegrationDisplayNames11,
|
|
15729
|
+
IntegrationNames as IntegrationNames15
|
|
15391
15730
|
} from "@livechat/developer-studio-api";
|
|
15392
15731
|
import {
|
|
15393
15732
|
Column as Column5,
|
|
15394
15733
|
Row as Row3,
|
|
15395
|
-
Text as Text5
|
|
15396
|
-
useUserContext as useUserContext4
|
|
15734
|
+
Text as Text5
|
|
15397
15735
|
} from "@livechat/developer-studio-ui-react";
|
|
15398
15736
|
|
|
15399
15737
|
// src/views/Workflows/Creator/Modals/AddTrigger/Options.tsx
|
|
@@ -15524,12 +15862,12 @@ function AddWorkflowTriggerModal({
|
|
|
15524
15862
|
},
|
|
15525
15863
|
{
|
|
15526
15864
|
name: "livechat",
|
|
15527
|
-
displayName:
|
|
15865
|
+
displayName: IntegrationDisplayNames11.LiveChat,
|
|
15528
15866
|
icon: /* @__PURE__ */ jsx4(
|
|
15529
15867
|
ProductIcon_default,
|
|
15530
15868
|
{
|
|
15531
15869
|
height: 5,
|
|
15532
|
-
product:
|
|
15870
|
+
product: IntegrationNames15.LiveChat,
|
|
15533
15871
|
width: 5
|
|
15534
15872
|
}
|
|
15535
15873
|
),
|
|
@@ -15541,12 +15879,12 @@ function AddWorkflowTriggerModal({
|
|
|
15541
15879
|
},
|
|
15542
15880
|
{
|
|
15543
15881
|
name: "helpdesk",
|
|
15544
|
-
displayName:
|
|
15882
|
+
displayName: IntegrationDisplayNames11.HelpDesk,
|
|
15545
15883
|
icon: /* @__PURE__ */ jsx4(
|
|
15546
15884
|
ProductIcon_default,
|
|
15547
15885
|
{
|
|
15548
15886
|
height: 5,
|
|
15549
|
-
product:
|
|
15887
|
+
product: IntegrationNames15.HelpDesk,
|
|
15550
15888
|
width: 5
|
|
15551
15889
|
}
|
|
15552
15890
|
),
|
|
@@ -15557,13 +15895,13 @@ function AddWorkflowTriggerModal({
|
|
|
15557
15895
|
}))
|
|
15558
15896
|
},
|
|
15559
15897
|
{
|
|
15560
|
-
name:
|
|
15561
|
-
displayName:
|
|
15898
|
+
name: IntegrationNames15.Mailchimp,
|
|
15899
|
+
displayName: IntegrationDisplayNames11.Mailchimp,
|
|
15562
15900
|
icon: /* @__PURE__ */ jsx4(
|
|
15563
15901
|
ProductIcon_default,
|
|
15564
15902
|
{
|
|
15565
15903
|
height: 5,
|
|
15566
|
-
product:
|
|
15904
|
+
product: IntegrationNames15.Mailchimp,
|
|
15567
15905
|
width: 5
|
|
15568
15906
|
}
|
|
15569
15907
|
),
|
|
@@ -15574,13 +15912,13 @@ function AddWorkflowTriggerModal({
|
|
|
15574
15912
|
}))
|
|
15575
15913
|
},
|
|
15576
15914
|
{
|
|
15577
|
-
name:
|
|
15578
|
-
displayName:
|
|
15915
|
+
name: IntegrationNames15.Shopify,
|
|
15916
|
+
displayName: IntegrationDisplayNames11.Shopify,
|
|
15579
15917
|
icon: /* @__PURE__ */ jsx4(
|
|
15580
15918
|
ProductIcon_default,
|
|
15581
15919
|
{
|
|
15582
15920
|
height: 5,
|
|
15583
|
-
product:
|
|
15921
|
+
product: IntegrationNames15.Shopify,
|
|
15584
15922
|
width: 5
|
|
15585
15923
|
}
|
|
15586
15924
|
),
|
|
@@ -15591,13 +15929,13 @@ function AddWorkflowTriggerModal({
|
|
|
15591
15929
|
}))
|
|
15592
15930
|
},
|
|
15593
15931
|
{
|
|
15594
|
-
name:
|
|
15595
|
-
displayName:
|
|
15932
|
+
name: IntegrationNames15.HubSpot,
|
|
15933
|
+
displayName: IntegrationDisplayNames11.HubSpot,
|
|
15596
15934
|
icon: /* @__PURE__ */ jsx4(
|
|
15597
15935
|
ProductIcon_default,
|
|
15598
15936
|
{
|
|
15599
15937
|
height: 5,
|
|
15600
|
-
product:
|
|
15938
|
+
product: IntegrationNames15.HubSpot,
|
|
15601
15939
|
width: 5
|
|
15602
15940
|
}
|
|
15603
15941
|
),
|
|
@@ -15608,13 +15946,23 @@ function AddWorkflowTriggerModal({
|
|
|
15608
15946
|
}))
|
|
15609
15947
|
},
|
|
15610
15948
|
{
|
|
15611
|
-
name:
|
|
15612
|
-
displayName:
|
|
15949
|
+
name: IntegrationNames15.Slack,
|
|
15950
|
+
displayName: IntegrationDisplayNames11.Slack,
|
|
15951
|
+
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { height: 5, product: IntegrationNames15.Slack, width: 5 }),
|
|
15952
|
+
values: Object.values(slackTriggerConfigs()).map((x) => ({
|
|
15953
|
+
key: x.key,
|
|
15954
|
+
name: x.customization.displayName,
|
|
15955
|
+
secondaryText: x.customization.description
|
|
15956
|
+
}))
|
|
15957
|
+
},
|
|
15958
|
+
{
|
|
15959
|
+
name: IntegrationNames15.BigCommerce,
|
|
15960
|
+
displayName: IntegrationDisplayNames11.BigCommerce,
|
|
15613
15961
|
icon: /* @__PURE__ */ jsx4(
|
|
15614
15962
|
ProductIcon_default,
|
|
15615
15963
|
{
|
|
15616
15964
|
height: 5,
|
|
15617
|
-
product:
|
|
15965
|
+
product: IntegrationNames15.BigCommerce,
|
|
15618
15966
|
width: 5
|
|
15619
15967
|
}
|
|
15620
15968
|
),
|
|
@@ -15628,14 +15976,11 @@ function AddWorkflowTriggerModal({
|
|
|
15628
15976
|
[]
|
|
15629
15977
|
);
|
|
15630
15978
|
const location = useLocation3();
|
|
15631
|
-
const navigate =
|
|
15979
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
15632
15980
|
const params = useParams3();
|
|
15633
15981
|
const [state, setState] = useState6();
|
|
15634
15982
|
const { addTrigger } = useWorkflowCreator();
|
|
15635
|
-
const
|
|
15636
|
-
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
15637
|
-
user == null ? void 0 : user.meta.email
|
|
15638
|
-
);
|
|
15983
|
+
const journey = useWorkflowsJourney();
|
|
15639
15984
|
useEffect6(() => {
|
|
15640
15985
|
var _a, _b;
|
|
15641
15986
|
if (!params.trigger) {
|
|
@@ -15649,7 +15994,7 @@ function AddWorkflowTriggerModal({
|
|
|
15649
15994
|
}, [basePath, navigate, params.service, params.trigger]);
|
|
15650
15995
|
const handleAddTrigger = (trigger) => {
|
|
15651
15996
|
if (trigger) {
|
|
15652
|
-
|
|
15997
|
+
journey.draft.edit.actions.addTrigger(
|
|
15653
15998
|
trigger.type,
|
|
15654
15999
|
trigger.type === "webhook" ? trigger.webhook.source : void 0
|
|
15655
16000
|
);
|
|
@@ -15715,7 +16060,7 @@ function AddWorkflowTriggerModal({
|
|
|
15715
16060
|
}
|
|
15716
16061
|
),
|
|
15717
16062
|
config2.map(({ name, displayName, icon: icon2, values }) => {
|
|
15718
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && (name ===
|
|
16063
|
+
const revertIconColor = getWorkflowsEnv("isHeadless") && (name === IntegrationNames15.OpenAI || name === IntegrationNames15.BigCommerce);
|
|
15719
16064
|
if (search) {
|
|
15720
16065
|
if (values.some(
|
|
15721
16066
|
(el) => el.name.toLowerCase().includes(search.toLowerCase())
|
|
@@ -15784,7 +16129,8 @@ function AddWorkflowTriggerModal({
|
|
|
15784
16129
|
}
|
|
15785
16130
|
)
|
|
15786
16131
|
]
|
|
15787
|
-
}
|
|
16132
|
+
},
|
|
16133
|
+
name
|
|
15788
16134
|
);
|
|
15789
16135
|
})
|
|
15790
16136
|
]
|
|
@@ -15821,7 +16167,7 @@ function AddWorkflowTriggerModal({
|
|
|
15821
16167
|
path: location.pathname,
|
|
15822
16168
|
routeState: location.state
|
|
15823
16169
|
}
|
|
15824
|
-
) });
|
|
16170
|
+
) }, name);
|
|
15825
16171
|
}
|
|
15826
16172
|
return null;
|
|
15827
16173
|
}) : null
|
|
@@ -15842,8 +16188,7 @@ import {
|
|
|
15842
16188
|
Modal as Modal3
|
|
15843
16189
|
} from "@livechat/design-system-react-components";
|
|
15844
16190
|
import {
|
|
15845
|
-
ActionModalContent
|
|
15846
|
-
useUserContext as useUserContext5
|
|
16191
|
+
ActionModalContent
|
|
15847
16192
|
} from "@livechat/developer-studio-ui-react";
|
|
15848
16193
|
function DeleteWorkflowModal({
|
|
15849
16194
|
version,
|
|
@@ -15857,10 +16202,7 @@ function DeleteWorkflowModal({
|
|
|
15857
16202
|
remove,
|
|
15858
16203
|
discardDraft
|
|
15859
16204
|
} = useWorkflowCreator();
|
|
15860
|
-
const
|
|
15861
|
-
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
15862
|
-
user == null ? void 0 : user.meta.email
|
|
15863
|
-
);
|
|
16205
|
+
const journey = useWorkflowsJourney();
|
|
15864
16206
|
return /* @__PURE__ */ jsx4(Modal3, { heading: true, onClose, children: /* @__PURE__ */ jsxs2(
|
|
15865
16207
|
ActionModalContent,
|
|
15866
16208
|
{
|
|
@@ -15873,10 +16215,10 @@ function DeleteWorkflowModal({
|
|
|
15873
16215
|
loading: version === "draft" ? isDiscarding : isRemoving,
|
|
15874
16216
|
onClick: () => {
|
|
15875
16217
|
if (version === "draft") {
|
|
15876
|
-
|
|
16218
|
+
journey.draft.delete.actions.click();
|
|
15877
16219
|
void discardDraft();
|
|
15878
16220
|
} else {
|
|
15879
|
-
|
|
16221
|
+
journey.workflow.delete.actions.click(
|
|
15880
16222
|
"builder",
|
|
15881
16223
|
workflow.created_at
|
|
15882
16224
|
);
|
|
@@ -15907,7 +16249,6 @@ function DeleteWorkflowModal({
|
|
|
15907
16249
|
}
|
|
15908
16250
|
|
|
15909
16251
|
// src/views/Workflows/Creator/Modals/Edit/Modal.tsx
|
|
15910
|
-
import { useNavigate as useNavigate6 } from "react-router-dom";
|
|
15911
16252
|
import { Error as Error3 } from "@livechat/design-system-icons";
|
|
15912
16253
|
import {
|
|
15913
16254
|
Button as Button5,
|
|
@@ -15916,12 +16257,11 @@ import {
|
|
|
15916
16257
|
Modal as Modal4
|
|
15917
16258
|
} from "@livechat/design-system-react-components";
|
|
15918
16259
|
import {
|
|
15919
|
-
ActionModalContent as ActionModalContent2
|
|
15920
|
-
useUserContext as useUserContext6
|
|
16260
|
+
ActionModalContent as ActionModalContent2
|
|
15921
16261
|
} from "@livechat/developer-studio-ui-react";
|
|
15922
16262
|
import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
15923
16263
|
function EditWorkflowModal({ onClose }) {
|
|
15924
|
-
const navigate =
|
|
16264
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
15925
16265
|
const {
|
|
15926
16266
|
state: {
|
|
15927
16267
|
workflow,
|
|
@@ -15929,10 +16269,7 @@ function EditWorkflowModal({ onClose }) {
|
|
|
15929
16269
|
},
|
|
15930
16270
|
createDraft
|
|
15931
16271
|
} = useWorkflowCreator();
|
|
15932
|
-
const
|
|
15933
|
-
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
15934
|
-
user == null ? void 0 : user.meta.email
|
|
15935
|
-
);
|
|
16272
|
+
const journey = useWorkflowsJourney();
|
|
15936
16273
|
return /* @__PURE__ */ jsx8(Modal4, { heading: true, onClose, children: /* @__PURE__ */ jsx8(
|
|
15937
16274
|
ActionModalContent2,
|
|
15938
16275
|
{
|
|
@@ -15942,8 +16279,8 @@ function EditWorkflowModal({ onClose }) {
|
|
|
15942
16279
|
{
|
|
15943
16280
|
kind: "secondary",
|
|
15944
16281
|
onClick: () => {
|
|
15945
|
-
|
|
15946
|
-
navigate(
|
|
16282
|
+
journey.draft.edit.actions.click("existing");
|
|
16283
|
+
navigate(`/${workflow.related_workflow_id}`, {
|
|
15947
16284
|
replace: true
|
|
15948
16285
|
});
|
|
15949
16286
|
},
|
|
@@ -15956,7 +16293,7 @@ function EditWorkflowModal({ onClose }) {
|
|
|
15956
16293
|
kind: "destructive",
|
|
15957
16294
|
loading: isCreating,
|
|
15958
16295
|
onClick: () => {
|
|
15959
|
-
|
|
16296
|
+
journey.draft.edit.actions.click("override");
|
|
15960
16297
|
void createDraft({ overrideConfirmed: true });
|
|
15961
16298
|
},
|
|
15962
16299
|
children: "Overwrite draft"
|
|
@@ -16079,7 +16416,6 @@ var Modal_default3 = ExecuteWorkflowModal;
|
|
|
16079
16416
|
|
|
16080
16417
|
// src/views/Workflows/Creator/Modals/Preview/Modal.tsx
|
|
16081
16418
|
import { useCallback as useCallback16 } from "react";
|
|
16082
|
-
import { useNavigate as useNavigate10 } from "react-router-dom";
|
|
16083
16419
|
|
|
16084
16420
|
// ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1__@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js
|
|
16085
16421
|
import * as React4 from "react";
|
|
@@ -18556,8 +18892,8 @@ function CustomCheckboxWidget(props) {
|
|
|
18556
18892
|
props.onChange(Boolean(items == null ? void 0 : items[0].key));
|
|
18557
18893
|
},
|
|
18558
18894
|
options: [
|
|
18559
|
-
{ key: "true"
|
|
18560
|
-
{ key: "
|
|
18895
|
+
{ key: "true" /* True */, name: "True" },
|
|
18896
|
+
{ key: "" /* False */, name: "False" }
|
|
18561
18897
|
],
|
|
18562
18898
|
selected: [
|
|
18563
18899
|
{
|
|
@@ -18914,7 +19250,7 @@ import {
|
|
|
18914
19250
|
ShadowToken as ShadowToken2,
|
|
18915
19251
|
SpacingToken as SpacingToken16
|
|
18916
19252
|
} from "@livechat/design-system-react-components";
|
|
18917
|
-
import { IntegrationNames as
|
|
19253
|
+
import { IntegrationNames as IntegrationNames16 } from "@livechat/developer-studio-api";
|
|
18918
19254
|
import { Column as Column7 } from "@livechat/developer-studio-ui-react";
|
|
18919
19255
|
var Node2 = newStyled.div`
|
|
18920
19256
|
color: var(${DesignToken16.ContentBasicPrimary});
|
|
@@ -18966,7 +19302,7 @@ function HttpNodeBase({
|
|
|
18966
19302
|
} = useWorkflowCreator();
|
|
18967
19303
|
const frame = frames.tasks[data.taskReferenceName];
|
|
18968
19304
|
const customization = (_b = (_a = frame == null ? void 0 : frame.__meta) == null ? void 0 : _a.config) == null ? void 0 : _b.customization;
|
|
18969
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && ((customization == null ? void 0 : customization.provider) ===
|
|
19305
|
+
const revertIconColor = getWorkflowsEnv("isHeadless") && ((customization == null ? void 0 : customization.provider) === IntegrationNames16.OpenAI || (customization == null ? void 0 : customization.provider) === IntegrationNames16.BigCommerce);
|
|
18970
19306
|
return /* @__PURE__ */ jsxs2(
|
|
18971
19307
|
Node2,
|
|
18972
19308
|
{
|
|
@@ -19048,13 +19384,14 @@ import {
|
|
|
19048
19384
|
TabsList,
|
|
19049
19385
|
TabsWrapper
|
|
19050
19386
|
} from "@livechat/design-system-react-components";
|
|
19051
|
-
import { IntegrationNames as
|
|
19387
|
+
import { IntegrationNames as IntegrationNames17 } from "@livechat/developer-studio-api";
|
|
19052
19388
|
import {
|
|
19053
19389
|
BigCommerceStatus,
|
|
19054
19390
|
HubSpotStatus,
|
|
19055
19391
|
MailchimpStatus,
|
|
19056
19392
|
OpenaiStatus,
|
|
19057
|
-
ShopifyStatus
|
|
19393
|
+
ShopifyStatus,
|
|
19394
|
+
SlackStatus
|
|
19058
19395
|
} from "@livechat/platform-integrations";
|
|
19059
19396
|
|
|
19060
19397
|
// src/views/Workflows/Creator/Builder/Forms/Schema/integrations/Text/index.tsx
|
|
@@ -19066,7 +19403,7 @@ import {
|
|
|
19066
19403
|
Column as Column8,
|
|
19067
19404
|
Row as Row10,
|
|
19068
19405
|
useNotificationContext as useNotificationContext3,
|
|
19069
|
-
useUserContext as
|
|
19406
|
+
useUserContext as useUserContext8
|
|
19070
19407
|
} from "@livechat/developer-studio-ui-react";
|
|
19071
19408
|
import {
|
|
19072
19409
|
TextStatus,
|
|
@@ -19075,7 +19412,7 @@ import {
|
|
|
19075
19412
|
function GlobalAccounts(props) {
|
|
19076
19413
|
const { pathname } = useLocation4();
|
|
19077
19414
|
const notifications = useNotificationContext3();
|
|
19078
|
-
const { user } =
|
|
19415
|
+
const { user } = useUserContext8();
|
|
19079
19416
|
const organizationProductsQuery = useFetchOrganizationProducts();
|
|
19080
19417
|
const {
|
|
19081
19418
|
updateOrganizationProducts,
|
|
@@ -19088,57 +19425,65 @@ function GlobalAccounts(props) {
|
|
|
19088
19425
|
void organizationProductsQuery.refetch();
|
|
19089
19426
|
}, [organizationProductsQuery]);
|
|
19090
19427
|
return /* @__PURE__ */ jsxs2(Column8, { gap: `var(${SpacingToken17.Spacing3})`, notPadded: true, children: [
|
|
19091
|
-
props.product && needToBeActivated ? /* @__PURE__ */ jsxs2(
|
|
19092
|
-
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
|
|
19105
|
-
|
|
19106
|
-
|
|
19107
|
-
|
|
19108
|
-
|
|
19109
|
-
|
|
19110
|
-
|
|
19111
|
-
|
|
19112
|
-
|
|
19113
|
-
|
|
19114
|
-
|
|
19115
|
-
|
|
19116
|
-
|
|
19117
|
-
|
|
19118
|
-
|
|
19119
|
-
|
|
19120
|
-
|
|
19428
|
+
props.product && needToBeActivated ? /* @__PURE__ */ jsxs2(
|
|
19429
|
+
Card,
|
|
19430
|
+
{
|
|
19431
|
+
"data-testId": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.builder.forms.integrations.text.info,
|
|
19432
|
+
light: true,
|
|
19433
|
+
children: [
|
|
19434
|
+
/* @__PURE__ */ jsxs2("p", { children: [
|
|
19435
|
+
"To use ",
|
|
19436
|
+
props.product,
|
|
19437
|
+
" in your workflow, you need an active",
|
|
19438
|
+
" ",
|
|
19439
|
+
props.product,
|
|
19440
|
+
" account."
|
|
19441
|
+
] }),
|
|
19442
|
+
props.product === "HelpDesk" && /* @__PURE__ */ jsx4("p", { children: "We can activate your HelpDesk license on your behalf using your registered email. You`'ll automatically start a 14-day trial." }),
|
|
19443
|
+
/* @__PURE__ */ jsx4("p", { children: "Do you want to proceed?" }),
|
|
19444
|
+
/* @__PURE__ */ jsx4(Row10, { flexEnd: true, notPadded: true, children: /* @__PURE__ */ jsx4(
|
|
19445
|
+
Button15,
|
|
19446
|
+
{
|
|
19447
|
+
"data-testId": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.builder.forms.integrations.text.button,
|
|
19448
|
+
kind: "primary",
|
|
19449
|
+
loading: organizationProductsQuery.isRefetching || isOrganizationProductsUpdating,
|
|
19450
|
+
onClick: () => __async(this, null, function* () {
|
|
19451
|
+
if (!props.product) {
|
|
19452
|
+
return;
|
|
19453
|
+
}
|
|
19454
|
+
try {
|
|
19455
|
+
yield updateOrganizationProducts({
|
|
19456
|
+
productName: props.product
|
|
19457
|
+
});
|
|
19458
|
+
user && void triggerAccountsAction(
|
|
19459
|
+
{
|
|
19460
|
+
action: "activate",
|
|
19461
|
+
data: {
|
|
19462
|
+
redirectTo: {
|
|
19463
|
+
success: pathname
|
|
19464
|
+
}
|
|
19465
|
+
},
|
|
19466
|
+
context: {},
|
|
19467
|
+
onSuccess: refetch
|
|
19468
|
+
},
|
|
19469
|
+
{
|
|
19470
|
+
notifications,
|
|
19471
|
+
user
|
|
19121
19472
|
}
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
|
|
19125
|
-
|
|
19126
|
-
|
|
19127
|
-
notifications,
|
|
19128
|
-
user
|
|
19473
|
+
);
|
|
19474
|
+
} catch (e) {
|
|
19475
|
+
notifications.addErrorToast(
|
|
19476
|
+
`Couldn't activate ${props.product}`
|
|
19477
|
+
);
|
|
19129
19478
|
}
|
|
19130
|
-
)
|
|
19131
|
-
|
|
19132
|
-
|
|
19133
|
-
`Couldn't activate ${props.product}`
|
|
19134
|
-
);
|
|
19479
|
+
}),
|
|
19480
|
+
type: "submit",
|
|
19481
|
+
children: "Start free trial"
|
|
19135
19482
|
}
|
|
19136
|
-
})
|
|
19137
|
-
|
|
19138
|
-
|
|
19139
|
-
|
|
19140
|
-
) })
|
|
19141
|
-
] }) : null,
|
|
19483
|
+
) })
|
|
19484
|
+
]
|
|
19485
|
+
}
|
|
19486
|
+
) : null,
|
|
19142
19487
|
/* @__PURE__ */ jsx4(TextStatus, {})
|
|
19143
19488
|
] });
|
|
19144
19489
|
}
|
|
@@ -19146,13 +19491,14 @@ var Text_default = GlobalAccounts;
|
|
|
19146
19491
|
|
|
19147
19492
|
// src/views/Workflows/Creator/Builder/Forms/Schema/Wrapper.tsx
|
|
19148
19493
|
var componentsMap = {
|
|
19149
|
-
[
|
|
19150
|
-
[
|
|
19151
|
-
[
|
|
19152
|
-
[
|
|
19153
|
-
[
|
|
19154
|
-
[
|
|
19155
|
-
[
|
|
19494
|
+
[IntegrationNames17.HelpDesk]: ({ product }) => /* @__PURE__ */ jsx4(Text_default, { product }),
|
|
19495
|
+
[IntegrationNames17.LiveChat]: ({ product }) => /* @__PURE__ */ jsx4(Text_default, { product }),
|
|
19496
|
+
[IntegrationNames17.Shopify]: () => /* @__PURE__ */ jsx4(ShopifyStatus, {}),
|
|
19497
|
+
[IntegrationNames17.Mailchimp]: () => /* @__PURE__ */ jsx4(MailchimpStatus, {}),
|
|
19498
|
+
[IntegrationNames17.BigCommerce]: () => /* @__PURE__ */ jsx4(BigCommerceStatus, {}),
|
|
19499
|
+
[IntegrationNames17.HubSpot]: () => /* @__PURE__ */ jsx4(HubSpotStatus, {}),
|
|
19500
|
+
[IntegrationNames17.Slack]: () => /* @__PURE__ */ jsx4(SlackStatus, {}),
|
|
19501
|
+
[IntegrationNames17.OpenAI]: () => /* @__PURE__ */ jsx4(OpenaiStatus, {})
|
|
19156
19502
|
};
|
|
19157
19503
|
function CustomSchemaFormWrapper({
|
|
19158
19504
|
data,
|
|
@@ -19980,7 +20326,7 @@ import {
|
|
|
19980
20326
|
ShadowToken as ShadowToken7,
|
|
19981
20327
|
SpacingToken as SpacingToken22
|
|
19982
20328
|
} from "@livechat/design-system-react-components";
|
|
19983
|
-
import { IntegrationNames as
|
|
20329
|
+
import { IntegrationNames as IntegrationNames18 } from "@livechat/developer-studio-api";
|
|
19984
20330
|
import { Column as Column11 } from "@livechat/developer-studio-ui-react";
|
|
19985
20331
|
var Node6 = newStyled.div`
|
|
19986
20332
|
color: var(${DesignToken21.ContentBasicPrimary});
|
|
@@ -20031,7 +20377,7 @@ function TriggerNodeBase({
|
|
|
20031
20377
|
} = useWorkflowCreator();
|
|
20032
20378
|
const frame = frames.trigger;
|
|
20033
20379
|
const customization = (_a = frame == null ? void 0 : frame.__meta) == null ? void 0 : _a.config.customization;
|
|
20034
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && ((customization == null ? void 0 : customization.provider) ===
|
|
20380
|
+
const revertIconColor = getWorkflowsEnv("isHeadless") && ((customization == null ? void 0 : customization.provider) === IntegrationNames18.OpenAI || (customization == null ? void 0 : customization.provider) === IntegrationNames18.BigCommerce);
|
|
20035
20381
|
return /* @__PURE__ */ jsxs2(
|
|
20036
20382
|
Node6,
|
|
20037
20383
|
{
|
|
@@ -20262,7 +20608,7 @@ var Node_default6 = memo9(TriggerNode);
|
|
|
20262
20608
|
|
|
20263
20609
|
// src/views/Workflows/Creator/Builder/Controls/CustomControls.tsx
|
|
20264
20610
|
import { useEffect as useEffect17 } from "react";
|
|
20265
|
-
import { useLocation as useLocation5
|
|
20611
|
+
import { useLocation as useLocation5 } from "react-router-dom";
|
|
20266
20612
|
import { ControlButton, Controls, useReactFlow as useReactFlow2 } from "reactflow";
|
|
20267
20613
|
import {
|
|
20268
20614
|
ArrowAutofitWidth,
|
|
@@ -21461,7 +21807,6 @@ var MarkdownEventRenderer = ({ children }) => /* @__PURE__ */ jsx4(
|
|
|
21461
21807
|
);
|
|
21462
21808
|
|
|
21463
21809
|
// src/views/Workflows/Common/One/components/NavigateButton.tsx
|
|
21464
|
-
import { useNavigate as useNavigate7 } from "react-router-dom";
|
|
21465
21810
|
import { Add as Add7, ArrowForward, OpenInNew } from "@livechat/design-system-icons";
|
|
21466
21811
|
import {
|
|
21467
21812
|
Button as Button19,
|
|
@@ -21483,7 +21828,7 @@ function NavigateButton({
|
|
|
21483
21828
|
kind,
|
|
21484
21829
|
iconPosition
|
|
21485
21830
|
}) {
|
|
21486
|
-
const navigate =
|
|
21831
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
21487
21832
|
const handleButtonClick = () => {
|
|
21488
21833
|
if (isExternal) {
|
|
21489
21834
|
window.open(url, "_blank");
|
|
@@ -22010,7 +22355,7 @@ function CustomControls({
|
|
|
22010
22355
|
previewWorkflow
|
|
22011
22356
|
}) {
|
|
22012
22357
|
var _a;
|
|
22013
|
-
const navigate =
|
|
22358
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
22014
22359
|
const { fitView, zoomIn, zoomOut } = useReactFlow2();
|
|
22015
22360
|
const { toggleOneWidget, isOpen } = useOneWidgetContext();
|
|
22016
22361
|
const {
|
|
@@ -22124,7 +22469,6 @@ var CustomControls_default = CustomControls;
|
|
|
22124
22469
|
|
|
22125
22470
|
// src/views/Workflows/Creator/Builder/Controls/SwitcherControls.tsx
|
|
22126
22471
|
import { useState as useState26 } from "react";
|
|
22127
|
-
import { useNavigate as useNavigate9 } from "react-router-dom";
|
|
22128
22472
|
import { Controls as Controls2 } from "reactflow";
|
|
22129
22473
|
import { SegmentedControl } from "@livechat/design-system-react-components";
|
|
22130
22474
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
@@ -22136,7 +22480,7 @@ function SwitcherControls({
|
|
|
22136
22480
|
const [currentView, setCurrentView] = useState26(
|
|
22137
22481
|
isDraft ? "draft" : "published"
|
|
22138
22482
|
);
|
|
22139
|
-
const navigate =
|
|
22483
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
22140
22484
|
const {
|
|
22141
22485
|
focus,
|
|
22142
22486
|
state: { visibility }
|
|
@@ -22178,7 +22522,7 @@ function SwitcherControls({
|
|
|
22178
22522
|
return;
|
|
22179
22523
|
}
|
|
22180
22524
|
setCurrentView(id);
|
|
22181
|
-
navigate(
|
|
22525
|
+
navigate(`/${relatedWorkflowId}`, {
|
|
22182
22526
|
replace: true
|
|
22183
22527
|
});
|
|
22184
22528
|
setTimeout(() => {
|
|
@@ -22275,7 +22619,7 @@ var Edges_default = CustomEdge_default;
|
|
|
22275
22619
|
import { MarkerType } from "reactflow";
|
|
22276
22620
|
import ElkConstructor from "elkjs";
|
|
22277
22621
|
import { DesignToken as DesignToken30 } from "@livechat/design-system-react-components";
|
|
22278
|
-
import { WorkflowDefinitionTaskType as
|
|
22622
|
+
import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType14 } from "@livechat/developer-studio-api";
|
|
22279
22623
|
var elk = new ElkConstructor({
|
|
22280
22624
|
defaultLayoutOptions: {
|
|
22281
22625
|
"elk.algorithm": "layered",
|
|
@@ -22332,9 +22676,9 @@ var convertToNodes = (tasks) => {
|
|
|
22332
22676
|
);
|
|
22333
22677
|
const { parentSource, parentTargets } = sourceAndTargets != null ? sourceAndTargets : {};
|
|
22334
22678
|
switch (task2.type) {
|
|
22335
|
-
case
|
|
22336
|
-
case
|
|
22337
|
-
case
|
|
22679
|
+
case WorkflowDefinitionTaskType14.terminate:
|
|
22680
|
+
case WorkflowDefinitionTaskType14.http:
|
|
22681
|
+
case WorkflowDefinitionTaskType14.join:
|
|
22338
22682
|
nodes.push(
|
|
22339
22683
|
buildNode(
|
|
22340
22684
|
{
|
|
@@ -22353,7 +22697,7 @@ var convertToNodes = (tasks) => {
|
|
|
22353
22697
|
)
|
|
22354
22698
|
);
|
|
22355
22699
|
return nodes;
|
|
22356
|
-
case
|
|
22700
|
+
case WorkflowDefinitionTaskType14.switch:
|
|
22357
22701
|
nodes.push(
|
|
22358
22702
|
buildNode(
|
|
22359
22703
|
{
|
|
@@ -22420,7 +22764,7 @@ var convertToNodes = (tasks) => {
|
|
|
22420
22764
|
}
|
|
22421
22765
|
);
|
|
22422
22766
|
return nodes;
|
|
22423
|
-
case
|
|
22767
|
+
case WorkflowDefinitionTaskType14.forkJoin:
|
|
22424
22768
|
nodes.push(
|
|
22425
22769
|
buildNode(
|
|
22426
22770
|
{
|
|
@@ -22661,6 +23005,7 @@ function WorkflowBuilder() {
|
|
|
22661
23005
|
previewModalVisible,
|
|
22662
23006
|
setPreviewModalVisible
|
|
22663
23007
|
} = useWorkflowCreator();
|
|
23008
|
+
const journey = useWorkflowsJourney();
|
|
22664
23009
|
const [nodes, setNodes, onNodesChange] = useNodesState(
|
|
22665
23010
|
[]
|
|
22666
23011
|
);
|
|
@@ -22673,13 +23018,14 @@ function WorkflowBuilder() {
|
|
|
22673
23018
|
);
|
|
22674
23019
|
useEffect18(() => {
|
|
22675
23020
|
void (() => __async(this, null, function* () {
|
|
22676
|
-
const { nodes: nodes2, edges: edges2 } = yield convertWorkflowDefinitionToReactflow(
|
|
22677
|
-
workflow
|
|
22678
|
-
);
|
|
23021
|
+
const { nodes: nodes2, edges: edges2 } = yield convertWorkflowDefinitionToReactflow(workflow);
|
|
22679
23022
|
setNodes(nodes2);
|
|
22680
23023
|
setEdges(edges2);
|
|
22681
23024
|
}))();
|
|
22682
23025
|
}, [workflow, setNodes, setEdges, updateTask]);
|
|
23026
|
+
useEffect18(() => {
|
|
23027
|
+
journey.workflow.builder.loaded();
|
|
23028
|
+
}, []);
|
|
22683
23029
|
return /* @__PURE__ */ jsxs7(Fragment8, { children: [
|
|
22684
23030
|
/* @__PURE__ */ jsxs7(
|
|
22685
23031
|
ReactFlow,
|
|
@@ -22803,7 +23149,7 @@ function PreviewWorkflowModal({
|
|
|
22803
23149
|
onApply,
|
|
22804
23150
|
onClose
|
|
22805
23151
|
}) {
|
|
22806
|
-
const navigate =
|
|
23152
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
22807
23153
|
const handleClose = useCallback16(
|
|
22808
23154
|
(target) => {
|
|
22809
23155
|
if (onClose) {
|
|
@@ -22909,6 +23255,11 @@ function PublishWorkflowModal({
|
|
|
22909
23255
|
},
|
|
22910
23256
|
publishDraft
|
|
22911
23257
|
} = useWorkflowCreator();
|
|
23258
|
+
const handlePublish = () => {
|
|
23259
|
+
void publishDraft({
|
|
23260
|
+
confirmed: true
|
|
23261
|
+
});
|
|
23262
|
+
};
|
|
22912
23263
|
return /* @__PURE__ */ jsx15(
|
|
22913
23264
|
Modal7,
|
|
22914
23265
|
{
|
|
@@ -22934,9 +23285,7 @@ function PublishWorkflowModal({
|
|
|
22934
23285
|
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.saveButton,
|
|
22935
23286
|
kind: "primary",
|
|
22936
23287
|
loading: isPublishing,
|
|
22937
|
-
onClick:
|
|
22938
|
-
confirmed: true
|
|
22939
|
-
}),
|
|
23288
|
+
onClick: handlePublish,
|
|
22940
23289
|
children: "Publish workflow"
|
|
22941
23290
|
}
|
|
22942
23291
|
)
|
|
@@ -22958,26 +23307,19 @@ function PublishWorkflowModal({
|
|
|
22958
23307
|
}
|
|
22959
23308
|
|
|
22960
23309
|
// src/views/Workflows/Creator/View.tsx
|
|
22961
|
-
import { useEffect as useEffect20 } from "react";
|
|
22962
23310
|
import { Route as Route2, Routes as Routes2 } from "react-router-dom";
|
|
22963
|
-
import { useReactFlow as useReactFlow3 } from "reactflow";
|
|
22964
23311
|
import {
|
|
22965
23312
|
DesignToken as DesignToken39,
|
|
22966
23313
|
RadiusToken as RadiusToken18,
|
|
22967
|
-
SpacingToken as
|
|
23314
|
+
SpacingToken as SpacingToken34
|
|
22968
23315
|
} from "@livechat/design-system-react-components";
|
|
22969
23316
|
|
|
22970
|
-
// src/utils/sendMessage.ts
|
|
22971
|
-
var sendMessage = (type) => {
|
|
22972
|
-
window.parent.postMessage({ type }, "*");
|
|
22973
|
-
};
|
|
22974
|
-
|
|
22975
23317
|
// src/views/Workflows/Creator/Panels/Details/index.tsx
|
|
22976
23318
|
import { Navigate, Route, Routes } from "react-router-dom";
|
|
22977
23319
|
|
|
22978
23320
|
// src/views/Workflows/Creator/Panels/Details/Panel.tsx
|
|
22979
|
-
import {
|
|
22980
|
-
import { Close as
|
|
23321
|
+
import { useParams as useParams4 } from "react-router-dom";
|
|
23322
|
+
import { Close as Close2 } from "@livechat/design-system-icons";
|
|
22981
23323
|
import {
|
|
22982
23324
|
Button as Button25,
|
|
22983
23325
|
DesignToken as DesignToken36,
|
|
@@ -23155,7 +23497,7 @@ function WorkflowDetailsPanel({
|
|
|
23155
23497
|
onClose
|
|
23156
23498
|
}) {
|
|
23157
23499
|
var _a, _b, _c, _d, _e;
|
|
23158
|
-
const navigate =
|
|
23500
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
23159
23501
|
const { id, tab } = useParams4();
|
|
23160
23502
|
const workflowQuery = useFetchWorkflow(id);
|
|
23161
23503
|
const workflowExecutionsQuery = useFetchWorkflowExecutionList(id);
|
|
@@ -23189,7 +23531,7 @@ function WorkflowDetailsPanel({
|
|
|
23189
23531
|
/* @__PURE__ */ jsx4(
|
|
23190
23532
|
Button25,
|
|
23191
23533
|
{
|
|
23192
|
-
icon: /* @__PURE__ */ jsx4(Icon28, { source:
|
|
23534
|
+
icon: /* @__PURE__ */ jsx4(Icon28, { source: Close2 }),
|
|
23193
23535
|
kind: "text",
|
|
23194
23536
|
onClick: () => {
|
|
23195
23537
|
onClose == null ? void 0 : onClose();
|
|
@@ -23271,9 +23613,8 @@ function WorkflowDetails({
|
|
|
23271
23613
|
|
|
23272
23614
|
// src/views/Workflows/Creator/Panels/Editor/Panel.tsx
|
|
23273
23615
|
import { useRef as useRef9, useState as useState27 } from "react";
|
|
23274
|
-
import { useNavigate as useNavigate12 } from "react-router-dom";
|
|
23275
23616
|
import { Editor } from "@monaco-editor/react";
|
|
23276
|
-
import { Close as
|
|
23617
|
+
import { Close as Close3 } from "@livechat/design-system-icons";
|
|
23277
23618
|
import {
|
|
23278
23619
|
Button as Button26,
|
|
23279
23620
|
Heading as Heading4,
|
|
@@ -23302,7 +23643,7 @@ function configureMonaco(monaco) {
|
|
|
23302
23643
|
});
|
|
23303
23644
|
}
|
|
23304
23645
|
function WorkflowEditorPanel({ onClose }) {
|
|
23305
|
-
const navigate =
|
|
23646
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
23306
23647
|
const {
|
|
23307
23648
|
state: { workflow },
|
|
23308
23649
|
replaceWorkflow,
|
|
@@ -23321,7 +23662,7 @@ function WorkflowEditorPanel({ onClose }) {
|
|
|
23321
23662
|
/* @__PURE__ */ jsx4(
|
|
23322
23663
|
Button26,
|
|
23323
23664
|
{
|
|
23324
|
-
icon: /* @__PURE__ */ jsx4(Icon29, { source:
|
|
23665
|
+
icon: /* @__PURE__ */ jsx4(Icon29, { source: Close3 }),
|
|
23325
23666
|
kind: "text",
|
|
23326
23667
|
onClick: () => {
|
|
23327
23668
|
if (onClose) {
|
|
@@ -23376,16 +23717,16 @@ function WorkflowEditorPanel({ onClose }) {
|
|
|
23376
23717
|
var Panel_default2 = WorkflowEditorPanel;
|
|
23377
23718
|
|
|
23378
23719
|
// src/views/Workflows/Creator/Panels/Element/Panel.tsx
|
|
23379
|
-
import { Automation as Automation2, Close as
|
|
23720
|
+
import { Automation as Automation2, Close as Close4 } from "@livechat/design-system-icons";
|
|
23380
23721
|
import {
|
|
23381
23722
|
Button as Button27,
|
|
23382
23723
|
DesignToken as DesignToken37,
|
|
23383
23724
|
Icon as Icon30,
|
|
23384
23725
|
RadiusToken as RadiusToken17,
|
|
23385
23726
|
ShadowToken as ShadowToken10,
|
|
23386
|
-
SpacingToken as
|
|
23727
|
+
SpacingToken as SpacingToken32
|
|
23387
23728
|
} from "@livechat/design-system-react-components";
|
|
23388
|
-
import { IntegrationNames as
|
|
23729
|
+
import { IntegrationNames as IntegrationNames19 } from "@livechat/developer-studio-api";
|
|
23389
23730
|
import { Column as Column13, Row as Row16 } from "@livechat/developer-studio-ui-react";
|
|
23390
23731
|
import "react-js-cron/dist/styles.css";
|
|
23391
23732
|
var formCss = () => css`
|
|
@@ -23415,7 +23756,7 @@ var Title7 = newStyled.p`
|
|
|
23415
23756
|
gap: 16px;
|
|
23416
23757
|
`;
|
|
23417
23758
|
function WorkflowElementPanel() {
|
|
23418
|
-
var _a, _b, _c, _d
|
|
23759
|
+
var _a, _b, _c, _d;
|
|
23419
23760
|
const {
|
|
23420
23761
|
updateTask,
|
|
23421
23762
|
updateTrigger,
|
|
@@ -23434,8 +23775,8 @@ function WorkflowElementPanel() {
|
|
|
23434
23775
|
data: workflow.trigger,
|
|
23435
23776
|
frame: frames.trigger
|
|
23436
23777
|
} : {
|
|
23437
|
-
data: elements.tasks[
|
|
23438
|
-
frame: frames.tasks[
|
|
23778
|
+
data: elements.tasks[selection.id],
|
|
23779
|
+
frame: frames.tasks[selection.id]
|
|
23439
23780
|
} : {
|
|
23440
23781
|
data: void 0,
|
|
23441
23782
|
frame: void 0
|
|
@@ -23443,7 +23784,7 @@ function WorkflowElementPanel() {
|
|
|
23443
23784
|
if (!data) {
|
|
23444
23785
|
return;
|
|
23445
23786
|
}
|
|
23446
|
-
const config2 = (
|
|
23787
|
+
const config2 = (_a = frame == null ? void 0 : frame.__meta) == null ? void 0 : _a.config;
|
|
23447
23788
|
const readonly = !workflow.draft;
|
|
23448
23789
|
const contentHandler = () => {
|
|
23449
23790
|
switch (data.type) {
|
|
@@ -23543,7 +23884,7 @@ function WorkflowElementPanel() {
|
|
|
23543
23884
|
default:
|
|
23544
23885
|
}
|
|
23545
23886
|
};
|
|
23546
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && (
|
|
23887
|
+
const revertIconColor = getWorkflowsEnv("isHeadless") && (config2.customization.provider === IntegrationNames19.OpenAI || config2.customization.provider === IntegrationNames19.BigCommerce);
|
|
23547
23888
|
return /* @__PURE__ */ jsxs2(
|
|
23548
23889
|
Wrapper4,
|
|
23549
23890
|
{
|
|
@@ -23558,7 +23899,7 @@ function WorkflowElementPanel() {
|
|
|
23558
23899
|
max-width: 85%;
|
|
23559
23900
|
`,
|
|
23560
23901
|
children: /* @__PURE__ */ jsxs2(Title7, { children: [
|
|
23561
|
-
|
|
23902
|
+
config2.customization.product ? /* @__PURE__ */ jsx4(
|
|
23562
23903
|
ProductIcon_default,
|
|
23563
23904
|
{
|
|
23564
23905
|
center: true,
|
|
@@ -23572,7 +23913,7 @@ function WorkflowElementPanel() {
|
|
|
23572
23913
|
Icon30,
|
|
23573
23914
|
{
|
|
23574
23915
|
css: css`
|
|
23575
|
-
width: var(${
|
|
23916
|
+
width: var(${SpacingToken32.Spacing6});
|
|
23576
23917
|
`,
|
|
23577
23918
|
size: "xlarge",
|
|
23578
23919
|
source: Automation2
|
|
@@ -23580,10 +23921,10 @@ function WorkflowElementPanel() {
|
|
|
23580
23921
|
) }),
|
|
23581
23922
|
/* @__PURE__ */ jsxs2(Column13, { noFlexBasis: true, notPadded: true, children: [
|
|
23582
23923
|
/* @__PURE__ */ jsxs2("strong", { children: [
|
|
23583
|
-
((
|
|
23584
|
-
(
|
|
23924
|
+
((_b = frame == null ? void 0 : frame.__meta) == null ? void 0 : _b.index) !== void 0 ? `${frame.__meta.index}. ` : "",
|
|
23925
|
+
(_c = config2.customization.displayName) != null ? _c : data.type === NodeNames.switch ? "Condition" : data.type === NodeNames.http ? "Custom HTTP" : data.type === NodeNames.terminate ? "End workflow" : ""
|
|
23585
23926
|
] }),
|
|
23586
|
-
(
|
|
23927
|
+
(_d = config2.customization.description) != null ? _d : data.type === NodeNames.switch ? "Conditional execution" : data.type === NodeNames.http ? "Make an HTTP request" : data.type === NodeNames.terminate ? "End the workflow" : ""
|
|
23587
23928
|
] })
|
|
23588
23929
|
] })
|
|
23589
23930
|
}
|
|
@@ -23595,7 +23936,7 @@ function WorkflowElementPanel() {
|
|
|
23595
23936
|
onClick: () => {
|
|
23596
23937
|
toggle();
|
|
23597
23938
|
},
|
|
23598
|
-
children: /* @__PURE__ */ jsx4(Icon30, { source:
|
|
23939
|
+
children: /* @__PURE__ */ jsx4(Icon30, { source: Close4 })
|
|
23599
23940
|
}
|
|
23600
23941
|
)
|
|
23601
23942
|
] }),
|
|
@@ -23608,8 +23949,7 @@ var Panel_default3 = WorkflowElementPanel;
|
|
|
23608
23949
|
|
|
23609
23950
|
// src/views/Workflows/Creator/Navbar.tsx
|
|
23610
23951
|
import { useEffect as useEffect19, useRef as useRef10, useState as useState28 } from "react";
|
|
23611
|
-
import {
|
|
23612
|
-
import { ChevronDown as ChevronDown3, Close as Close6 } from "@livechat/design-system-icons";
|
|
23952
|
+
import { ChevronDown as ChevronDown3, Close as Close5 } from "@livechat/design-system-icons";
|
|
23613
23953
|
import {
|
|
23614
23954
|
ActionMenu as ActionMenu2,
|
|
23615
23955
|
Button as Button28,
|
|
@@ -23617,19 +23957,18 @@ import {
|
|
|
23617
23957
|
FormField as FormField3,
|
|
23618
23958
|
Icon as Icon31,
|
|
23619
23959
|
Input as Input5,
|
|
23620
|
-
SpacingToken as
|
|
23960
|
+
SpacingToken as SpacingToken33,
|
|
23621
23961
|
Switch,
|
|
23622
23962
|
Tooltip as Tooltip8
|
|
23623
23963
|
} from "@livechat/design-system-react-components";
|
|
23624
23964
|
import {
|
|
23625
23965
|
Column as Column14,
|
|
23626
23966
|
Row as Row17,
|
|
23627
|
-
useOnClickOutside as useOnClickOutside2
|
|
23628
|
-
useUserContext as useUserContext8
|
|
23967
|
+
useOnClickOutside as useOnClickOutside2
|
|
23629
23968
|
} from "@livechat/developer-studio-ui-react";
|
|
23630
23969
|
function WorkflowCreatorNavbar() {
|
|
23631
23970
|
var _a, _b, _c, _d, _e;
|
|
23632
|
-
const navigate =
|
|
23971
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
23633
23972
|
const {
|
|
23634
23973
|
state: {
|
|
23635
23974
|
workflow,
|
|
@@ -23645,10 +23984,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23645
23984
|
const inputRef = useRef10(null);
|
|
23646
23985
|
const [isNameChanging, setIsNameChanging] = useState28(false);
|
|
23647
23986
|
const [workflowName, setWorkflowName] = useState28(workflow.name);
|
|
23648
|
-
const
|
|
23649
|
-
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
23650
|
-
user == null ? void 0 : user.meta.email
|
|
23651
|
-
);
|
|
23987
|
+
const journey = useWorkflowsJourney();
|
|
23652
23988
|
useEffect19(() => {
|
|
23653
23989
|
setWorkflowName(workflow.name);
|
|
23654
23990
|
}, [workflow.name]);
|
|
@@ -23704,8 +24040,8 @@ function WorkflowCreatorNavbar() {
|
|
|
23704
24040
|
borderBottom: true,
|
|
23705
24041
|
center: true,
|
|
23706
24042
|
css: css`
|
|
23707
|
-
min-height: var(${
|
|
23708
|
-
padding-left: var(${
|
|
24043
|
+
min-height: var(${SpacingToken33.Spacing14});
|
|
24044
|
+
padding-left: var(${SpacingToken33.Spacing4});
|
|
23709
24045
|
`,
|
|
23710
24046
|
flexEnd: true,
|
|
23711
24047
|
lowMargin: true,
|
|
@@ -23717,10 +24053,10 @@ function WorkflowCreatorNavbar() {
|
|
|
23717
24053
|
getWorkflowsEnv("isLiveChatMode") && /* @__PURE__ */ jsx4(
|
|
23718
24054
|
Button28,
|
|
23719
24055
|
{
|
|
23720
|
-
icon: /* @__PURE__ */ jsx4(Icon31, { source:
|
|
24056
|
+
icon: /* @__PURE__ */ jsx4(Icon31, { source: Close5 }),
|
|
23721
24057
|
kind: "plain",
|
|
23722
24058
|
onClick: () => {
|
|
23723
|
-
navigate("/
|
|
24059
|
+
navigate("/list");
|
|
23724
24060
|
sendMessage("openSideNav" /* OpenSideNav */);
|
|
23725
24061
|
}
|
|
23726
24062
|
}
|
|
@@ -23809,7 +24145,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23809
24145
|
}
|
|
23810
24146
|
`,
|
|
23811
24147
|
flexEnd: true,
|
|
23812
|
-
gap: `var(${
|
|
24148
|
+
gap: `var(${SpacingToken33.Spacing3})`,
|
|
23813
24149
|
noWrap: true,
|
|
23814
24150
|
notPadded: true,
|
|
23815
24151
|
children: [
|
|
@@ -23866,7 +24202,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23866
24202
|
kind: "primary",
|
|
23867
24203
|
loading: isPublishing,
|
|
23868
24204
|
onClick: () => {
|
|
23869
|
-
|
|
24205
|
+
journey.draft.publish.actions.click(
|
|
23870
24206
|
workflow.definition.tasks.length
|
|
23871
24207
|
);
|
|
23872
24208
|
void publishDraft();
|
|
@@ -23881,9 +24217,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23881
24217
|
loading: isCreating,
|
|
23882
24218
|
onClick: () => {
|
|
23883
24219
|
if (!workflow.related_workflow_id) {
|
|
23884
|
-
|
|
23885
|
-
workflow.id
|
|
23886
|
-
);
|
|
24220
|
+
journey.workflow.create.actions.createDraft(workflow.id);
|
|
23887
24221
|
}
|
|
23888
24222
|
void createDraft();
|
|
23889
24223
|
},
|
|
@@ -23910,31 +24244,15 @@ var WorkflowCreatorContent = newStyled.div`
|
|
|
23910
24244
|
flex-flow: row nowrap;
|
|
23911
24245
|
border-radius: var(${RadiusToken18.Radius4});
|
|
23912
24246
|
${({ grayBackground }) => grayBackground ? `background-color: var(${DesignToken39.SurfaceSecondaryDefault})` : `background-color: var(${DesignToken39.SurfacePrimaryDefault})`};
|
|
23913
|
-
margin: var(${
|
|
23914
|
-
width: calc(100% - var(${
|
|
23915
|
-
height: calc(100% - var(${
|
|
24247
|
+
margin: var(${SpacingToken34.Spacing4});
|
|
24248
|
+
width: calc(100% - var(${SpacingToken34.Spacing8}));
|
|
24249
|
+
height: calc(100% - var(${SpacingToken34.Spacing8}) - 70px);
|
|
23916
24250
|
`;
|
|
23917
24251
|
function WorkflowCreatorView() {
|
|
23918
24252
|
const {
|
|
23919
24253
|
state: { selection },
|
|
23920
24254
|
focus
|
|
23921
24255
|
} = useWorkflowCreator();
|
|
23922
|
-
const { fitView } = useReactFlow3();
|
|
23923
|
-
useEffect20(() => {
|
|
23924
|
-
if (getWorkflowsEnv("isLiveChatMode")) {
|
|
23925
|
-
sendMessage("closeSideNav" /* CloseSideNav */);
|
|
23926
|
-
const timeoutId = setTimeout(() => {
|
|
23927
|
-
fitView({
|
|
23928
|
-
duration: 400,
|
|
23929
|
-
maxZoom: 1.15,
|
|
23930
|
-
minZoom: 1.15
|
|
23931
|
-
});
|
|
23932
|
-
}, 200);
|
|
23933
|
-
return () => {
|
|
23934
|
-
clearTimeout(timeoutId);
|
|
23935
|
-
};
|
|
23936
|
-
}
|
|
23937
|
-
}, [fitView]);
|
|
23938
24256
|
return /* @__PURE__ */ jsxs2(View2, { children: [
|
|
23939
24257
|
/* @__PURE__ */ jsx4(Navbar_default, {}),
|
|
23940
24258
|
/* @__PURE__ */ jsxs2(WorkflowCreatorContent, { grayBackground: getWorkflowsEnv("isHeadless"), children: [
|
|
@@ -23966,7 +24284,7 @@ function WorkflowCreator() {
|
|
|
23966
24284
|
var _a, _b, _c;
|
|
23967
24285
|
const location = useLocation6();
|
|
23968
24286
|
const { id } = useParams5();
|
|
23969
|
-
const navigate =
|
|
24287
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
23970
24288
|
const workflowQuery = useFetchWorkflow(id === "new" ? void 0 : id);
|
|
23971
24289
|
const credentialsQuery = useFetchIntegrationCredentialsQuery2();
|
|
23972
24290
|
const organizationProducts = useFetchOrganizationProducts2();
|
|
@@ -23981,7 +24299,7 @@ function WorkflowCreator() {
|
|
|
23981
24299
|
if (id !== "new" && !workflowQuery.isSuccess) {
|
|
23982
24300
|
throw new Error("Couldn't load workflow");
|
|
23983
24301
|
}
|
|
23984
|
-
const basePath =
|
|
24302
|
+
const basePath = `/${id}`;
|
|
23985
24303
|
const workflow = id === "new" ? (_c = (_b = location.state) == null ? void 0 : _b.workflow) != null ? _c : NEW_WORKFLOW : workflowQuery.data;
|
|
23986
24304
|
if (!workflow) {
|
|
23987
24305
|
throw new Error("Couldn't load workflow");
|
|
@@ -24110,7 +24428,6 @@ import { useParams as useParams6 } from "react-router-dom";
|
|
|
24110
24428
|
|
|
24111
24429
|
// src/views/Workflows/List/Modals/PreviewTemplate/Modal.tsx
|
|
24112
24430
|
import { useCallback as useCallback17 } from "react";
|
|
24113
|
-
import { useNavigate as useNavigate15 } from "react-router-dom";
|
|
24114
24431
|
import { ArrowBackFilled } from "@livechat/design-system-icons";
|
|
24115
24432
|
import {
|
|
24116
24433
|
Button as Button29,
|
|
@@ -24120,15 +24437,11 @@ import {
|
|
|
24120
24437
|
Modal as Modal8,
|
|
24121
24438
|
ModalHeader as ModalHeader5,
|
|
24122
24439
|
RadiusToken as RadiusToken19,
|
|
24123
|
-
SpacingToken as
|
|
24440
|
+
SpacingToken as SpacingToken36,
|
|
24124
24441
|
Tag as Tag3,
|
|
24125
|
-
Text as
|
|
24442
|
+
Text as Text18
|
|
24126
24443
|
} from "@livechat/design-system-react-components";
|
|
24127
|
-
import {
|
|
24128
|
-
Column as Column15,
|
|
24129
|
-
Row as Row19,
|
|
24130
|
-
useUserContext as useUserContext9
|
|
24131
|
-
} from "@livechat/developer-studio-ui-react";
|
|
24444
|
+
import { Column as Column15, Row as Row19 } from "@livechat/developer-studio-ui-react";
|
|
24132
24445
|
|
|
24133
24446
|
// src/views/Workflows/Common/Icons/TemplateCategoryIcon.tsx
|
|
24134
24447
|
import {
|
|
@@ -24141,8 +24454,8 @@ import {
|
|
|
24141
24454
|
import {
|
|
24142
24455
|
DesignToken as DesignToken40,
|
|
24143
24456
|
Icon as Icon32,
|
|
24144
|
-
SpacingToken as
|
|
24145
|
-
Text as
|
|
24457
|
+
SpacingToken as SpacingToken35,
|
|
24458
|
+
Text as Text17
|
|
24146
24459
|
} from "@livechat/design-system-react-components";
|
|
24147
24460
|
import { WorkflowTemplateCategory as WorkflowTemplateCategory2 } from "@livechat/developer-studio-api";
|
|
24148
24461
|
import { Row as Row18 } from "@livechat/developer-studio-ui-react";
|
|
@@ -24154,7 +24467,7 @@ function WorkflowTemplateCategoryIcon(props) {
|
|
|
24154
24467
|
[WorkflowTemplateCategory2.ChatManagement]: ChatDots,
|
|
24155
24468
|
[WorkflowTemplateCategory2.CustomerExperience]: Smiles
|
|
24156
24469
|
};
|
|
24157
|
-
return /* @__PURE__ */ jsxs2(Row18, { gap: `var(${
|
|
24470
|
+
return /* @__PURE__ */ jsxs2(Row18, { gap: `var(${SpacingToken35.Spacing1})`, noWrap: true, notPadded: true, children: [
|
|
24158
24471
|
/* @__PURE__ */ jsx4(
|
|
24159
24472
|
Icon32,
|
|
24160
24473
|
{
|
|
@@ -24164,7 +24477,7 @@ function WorkflowTemplateCategoryIcon(props) {
|
|
|
24164
24477
|
}
|
|
24165
24478
|
),
|
|
24166
24479
|
/* @__PURE__ */ jsx4(
|
|
24167
|
-
|
|
24480
|
+
Text17,
|
|
24168
24481
|
{
|
|
24169
24482
|
customColor: `var(${DesignToken40.ContentBasicSecondary})`,
|
|
24170
24483
|
noMargin: true,
|
|
@@ -24211,23 +24524,20 @@ var WorkflowBuilderWrapper2 = newStyled.div`
|
|
|
24211
24524
|
`;
|
|
24212
24525
|
var List = newStyled.ol`
|
|
24213
24526
|
margin-block: 0;
|
|
24214
|
-
padding-inline: var(${
|
|
24527
|
+
padding-inline: var(${SpacingToken36.Spacing5});
|
|
24215
24528
|
`;
|
|
24216
24529
|
function WorkflowTemplatePreviewModal({
|
|
24217
24530
|
template,
|
|
24218
24531
|
onClose
|
|
24219
24532
|
}) {
|
|
24220
|
-
const navigate =
|
|
24533
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
24221
24534
|
const {
|
|
24222
24535
|
save,
|
|
24223
24536
|
state: {
|
|
24224
24537
|
actions: { isSaving }
|
|
24225
24538
|
}
|
|
24226
24539
|
} = useWorkflowCreator();
|
|
24227
|
-
const
|
|
24228
|
-
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
24229
|
-
user == null ? void 0 : user.meta.email
|
|
24230
|
-
);
|
|
24540
|
+
const journey = useWorkflowsJourney();
|
|
24231
24541
|
const handleClose = useCallback17(
|
|
24232
24542
|
(target) => {
|
|
24233
24543
|
if (onClose) {
|
|
@@ -24258,16 +24568,13 @@ function WorkflowTemplatePreviewModal({
|
|
|
24258
24568
|
});
|
|
24259
24569
|
};
|
|
24260
24570
|
const handleUseTemplate = () => {
|
|
24261
|
-
|
|
24262
|
-
"withTemplate",
|
|
24263
|
-
template.name
|
|
24264
|
-
);
|
|
24571
|
+
journey.draft.create.actions.click("withTemplate", template.name);
|
|
24265
24572
|
void save();
|
|
24266
24573
|
};
|
|
24267
24574
|
return /* @__PURE__ */ jsx4(
|
|
24268
24575
|
Modal8,
|
|
24269
24576
|
{
|
|
24270
|
-
footer: /* @__PURE__ */ jsxs2(Row19, { flexEnd: true, gap: `var(${
|
|
24577
|
+
footer: /* @__PURE__ */ jsxs2(Row19, { flexEnd: true, gap: `var(${SpacingToken36.Spacing3})`, notPadded: true, children: [
|
|
24271
24578
|
/* @__PURE__ */ jsx4(
|
|
24272
24579
|
Button29,
|
|
24273
24580
|
{
|
|
@@ -24295,7 +24602,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
24295
24602
|
heading: /* @__PURE__ */ jsx4(
|
|
24296
24603
|
ModalHeader5,
|
|
24297
24604
|
{
|
|
24298
|
-
title: /* @__PURE__ */ jsxs2(Row19, { gap: `var(${
|
|
24605
|
+
title: /* @__PURE__ */ jsxs2(Row19, { gap: `var(${SpacingToken36.Spacing3})`, notPadded: true, children: [
|
|
24299
24606
|
/* @__PURE__ */ jsx4(
|
|
24300
24607
|
Button29,
|
|
24301
24608
|
{
|
|
@@ -24316,9 +24623,9 @@ function WorkflowTemplatePreviewModal({
|
|
|
24316
24623
|
Column15,
|
|
24317
24624
|
{
|
|
24318
24625
|
css: css`
|
|
24319
|
-
padding-inline: var(${
|
|
24626
|
+
padding-inline: var(${SpacingToken36.Spacing5});
|
|
24320
24627
|
`,
|
|
24321
|
-
gap: `var(${
|
|
24628
|
+
gap: `var(${SpacingToken36.Spacing5})`,
|
|
24322
24629
|
noFlexBasis: true,
|
|
24323
24630
|
notPadded: true,
|
|
24324
24631
|
children: [
|
|
@@ -24330,26 +24637,26 @@ function WorkflowTemplatePreviewModal({
|
|
|
24330
24637
|
max-width: 280px;
|
|
24331
24638
|
`,
|
|
24332
24639
|
children: [
|
|
24333
|
-
/* @__PURE__ */ jsx4(
|
|
24334
|
-
/* @__PURE__ */ jsx4(
|
|
24335
|
-
/* @__PURE__ */ jsx4(
|
|
24640
|
+
/* @__PURE__ */ jsx4(Text18, { bold: true, size: "md", children: template.name }),
|
|
24641
|
+
/* @__PURE__ */ jsx4(Text18, { size: "md", children: template.workflow.description }),
|
|
24642
|
+
/* @__PURE__ */ jsx4(Text18, { noMargin: true, size: "md", children: "Here's how it works:" }),
|
|
24336
24643
|
/* @__PURE__ */ jsx4(List, { children: template.list.map((item) => /* @__PURE__ */ jsxs2("li", { children: [
|
|
24337
|
-
/* @__PURE__ */ jsxs2(
|
|
24644
|
+
/* @__PURE__ */ jsxs2(Text18, { as: "span", bold: true, noMargin: true, size: "md", children: [
|
|
24338
24645
|
item.product,
|
|
24339
24646
|
":",
|
|
24340
24647
|
" "
|
|
24341
24648
|
] }),
|
|
24342
|
-
/* @__PURE__ */ jsx4(
|
|
24649
|
+
/* @__PURE__ */ jsx4(Text18, { as: "span", noMargin: true, size: "md", children: item.description })
|
|
24343
24650
|
] }, item.product)) })
|
|
24344
24651
|
]
|
|
24345
24652
|
}
|
|
24346
24653
|
),
|
|
24347
24654
|
/* @__PURE__ */ jsxs2("div", { children: [
|
|
24348
24655
|
/* @__PURE__ */ jsx4(
|
|
24349
|
-
|
|
24656
|
+
Text18,
|
|
24350
24657
|
{
|
|
24351
24658
|
css: css`
|
|
24352
|
-
margin-block-end: var(${
|
|
24659
|
+
margin-block-end: var(${SpacingToken36.Spacing1});
|
|
24353
24660
|
`,
|
|
24354
24661
|
customColor: `var(${DesignToken41.ContentBasicSecondary})`,
|
|
24355
24662
|
noMargin: true,
|
|
@@ -24357,7 +24664,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
24357
24664
|
children: "Products used:"
|
|
24358
24665
|
}
|
|
24359
24666
|
),
|
|
24360
|
-
/* @__PURE__ */ jsx4(Row19, { gap: `var(${
|
|
24667
|
+
/* @__PURE__ */ jsx4(Row19, { gap: `var(${SpacingToken36.Spacing1})`, notPadded: true, children: renderProductTags(template.products) })
|
|
24361
24668
|
] })
|
|
24362
24669
|
]
|
|
24363
24670
|
}
|
|
@@ -24407,16 +24714,15 @@ var PreviewTemplate_default = WorkflowTemplatePreview;
|
|
|
24407
24714
|
|
|
24408
24715
|
// src/views/Workflows/List/Modals/Create/Modal.tsx
|
|
24409
24716
|
import { useCallback as useCallback20 } from "react";
|
|
24410
|
-
import { useNavigate as useNavigate18 } from "react-router-dom";
|
|
24411
24717
|
import { Modal as Modal9, ModalHeader as ModalHeader6 } from "@livechat/design-system-react-components";
|
|
24412
24718
|
|
|
24413
24719
|
// src/views/Workflows/List/Home/Home.tsx
|
|
24414
|
-
import { useMemo as useMemo10, useState as useState31 } from "react";
|
|
24720
|
+
import { useEffect as useEffect20, useMemo as useMemo10, useState as useState31 } from "react";
|
|
24415
24721
|
import { FiletypeOther, OneColored } from "@livechat/design-system-icons";
|
|
24416
24722
|
import {
|
|
24417
24723
|
DesignToken as DesignToken43,
|
|
24418
|
-
SpacingToken as
|
|
24419
|
-
Text as
|
|
24724
|
+
SpacingToken as SpacingToken41,
|
|
24725
|
+
Text as Text19
|
|
24420
24726
|
} from "@livechat/design-system-react-components";
|
|
24421
24727
|
import { Column as Column17, Intro as Intro3, Row as Row24 } from "@livechat/developer-studio-ui-react";
|
|
24422
24728
|
|
|
@@ -24434,41 +24740,37 @@ import {
|
|
|
24434
24740
|
ActionMenu as ActionMenu3,
|
|
24435
24741
|
Button as Button30,
|
|
24436
24742
|
Icon as Icon34,
|
|
24437
|
-
SpacingToken as
|
|
24743
|
+
SpacingToken as SpacingToken37
|
|
24438
24744
|
} from "@livechat/design-system-react-components";
|
|
24439
24745
|
import { WorkflowTemplateCategory as WorkflowTemplateCategory3 } from "@livechat/developer-studio-api";
|
|
24440
24746
|
import { Row as Row20 } from "@livechat/developer-studio-ui-react";
|
|
24441
24747
|
function WorkflowTemplatesCategoryFilter({
|
|
24442
|
-
|
|
24443
|
-
|
|
24748
|
+
handleCategory,
|
|
24749
|
+
category
|
|
24444
24750
|
}) {
|
|
24445
|
-
var _a;
|
|
24446
24751
|
const [isVisible, setIsVisible] = useState29(false);
|
|
24447
24752
|
const getItem = useCallback18(
|
|
24448
|
-
(
|
|
24449
|
-
key,
|
|
24450
|
-
element: /* @__PURE__ */ jsxs2(Row20, { gap: `var(${
|
|
24753
|
+
(category2, icon2) => ({
|
|
24754
|
+
key: category2,
|
|
24755
|
+
element: /* @__PURE__ */ jsxs2(Row20, { gap: `var(${SpacingToken37.Spacing1});`, notPadded: true, children: [
|
|
24451
24756
|
icon2 ? /* @__PURE__ */ jsx4(Icon34, { source: icon2 }) : void 0,
|
|
24452
|
-
|
|
24757
|
+
category2
|
|
24453
24758
|
] }),
|
|
24454
24759
|
onClick: () => {
|
|
24455
|
-
|
|
24760
|
+
handleCategory(category2);
|
|
24456
24761
|
setIsVisible(false);
|
|
24457
24762
|
}
|
|
24458
24763
|
}),
|
|
24459
|
-
[
|
|
24764
|
+
[handleCategory]
|
|
24460
24765
|
);
|
|
24461
24766
|
const options = [
|
|
24462
|
-
getItem("
|
|
24463
|
-
getItem(
|
|
24464
|
-
getItem(
|
|
24465
|
-
getItem(
|
|
24466
|
-
getItem(
|
|
24467
|
-
getItem(
|
|
24767
|
+
getItem("All"),
|
|
24768
|
+
getItem(WorkflowTemplateCategory3.NotificationAndAlerts, Notifications2),
|
|
24769
|
+
getItem(WorkflowTemplateCategory3.SalesManagement, CurrencyDollar2),
|
|
24770
|
+
getItem(WorkflowTemplateCategory3.LeadCollection, TargetArrow2),
|
|
24771
|
+
getItem(WorkflowTemplateCategory3.ChatManagement, ChatDots2),
|
|
24772
|
+
getItem(WorkflowTemplateCategory3.CustomerExperience, Smiles2)
|
|
24468
24773
|
];
|
|
24469
|
-
const selectedKey = (_a = options.find(
|
|
24470
|
-
(option) => option.element.props.children[1] === status
|
|
24471
|
-
)) == null ? void 0 : _a.key;
|
|
24472
24774
|
return /* @__PURE__ */ jsx4(
|
|
24473
24775
|
ActionMenu3,
|
|
24474
24776
|
{
|
|
@@ -24477,7 +24779,7 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
24477
24779
|
},
|
|
24478
24780
|
options,
|
|
24479
24781
|
placement: "bottom",
|
|
24480
|
-
selectedOptions:
|
|
24782
|
+
selectedOptions: category ? [category] : [],
|
|
24481
24783
|
triggerRenderer: /* @__PURE__ */ jsxs2(
|
|
24482
24784
|
Button30,
|
|
24483
24785
|
{
|
|
@@ -24488,7 +24790,7 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
24488
24790
|
},
|
|
24489
24791
|
children: [
|
|
24490
24792
|
"Category: ",
|
|
24491
|
-
|
|
24793
|
+
category
|
|
24492
24794
|
]
|
|
24493
24795
|
}
|
|
24494
24796
|
),
|
|
@@ -24512,43 +24814,39 @@ import {
|
|
|
24512
24814
|
ActionMenu as ActionMenu4,
|
|
24513
24815
|
Button as Button31,
|
|
24514
24816
|
Icon as Icon35,
|
|
24515
|
-
SpacingToken as
|
|
24817
|
+
SpacingToken as SpacingToken38
|
|
24516
24818
|
} from "@livechat/design-system-react-components";
|
|
24517
|
-
import { IntegrationDisplayNames as
|
|
24819
|
+
import { IntegrationDisplayNames as IntegrationDisplayNames12 } from "@livechat/developer-studio-api";
|
|
24518
24820
|
import { Row as Row21 } from "@livechat/developer-studio-ui-react";
|
|
24519
24821
|
function WorkflowTemplatesProductFilter({
|
|
24520
|
-
|
|
24521
|
-
|
|
24822
|
+
handleProduct,
|
|
24823
|
+
product
|
|
24522
24824
|
}) {
|
|
24523
|
-
var _a;
|
|
24524
24825
|
const [isVisible, setIsVisible] = useState30(false);
|
|
24525
24826
|
const getItem = useCallback19(
|
|
24526
|
-
(
|
|
24527
|
-
key,
|
|
24528
|
-
element: /* @__PURE__ */ jsxs2(Row21, { gap: `var(${
|
|
24827
|
+
(product2, icon2) => ({
|
|
24828
|
+
key: product2,
|
|
24829
|
+
element: /* @__PURE__ */ jsxs2(Row21, { gap: `var(${SpacingToken38.Spacing1});`, notPadded: true, children: [
|
|
24529
24830
|
icon2 ? /* @__PURE__ */ jsx4(Icon35, { source: icon2 }) : void 0,
|
|
24530
|
-
|
|
24831
|
+
product2
|
|
24531
24832
|
] }),
|
|
24532
24833
|
onClick: () => {
|
|
24533
|
-
|
|
24834
|
+
handleProduct(product2);
|
|
24534
24835
|
setIsVisible(false);
|
|
24535
24836
|
}
|
|
24536
24837
|
}),
|
|
24537
|
-
[
|
|
24838
|
+
[handleProduct]
|
|
24538
24839
|
);
|
|
24539
24840
|
const options = [
|
|
24540
|
-
getItem("
|
|
24541
|
-
getItem(
|
|
24542
|
-
getItem(
|
|
24543
|
-
getItem(
|
|
24544
|
-
getItem(
|
|
24545
|
-
getItem(
|
|
24546
|
-
// getItem(
|
|
24547
|
-
// getItem(
|
|
24841
|
+
getItem("All"),
|
|
24842
|
+
getItem(IntegrationDisplayNames12.LiveChat, LiveChatColored),
|
|
24843
|
+
getItem(IntegrationDisplayNames12.HelpDesk, HelpDeskColored),
|
|
24844
|
+
getItem(IntegrationDisplayNames12.OpenAI, Chatgpt),
|
|
24845
|
+
getItem(IntegrationDisplayNames12.Shopify, ShopifyColored),
|
|
24846
|
+
getItem(IntegrationDisplayNames12.Mailchimp, Mailchimp)
|
|
24847
|
+
// getItem(IntegrationDisplayNames.Stripe, Stripe),
|
|
24848
|
+
// getItem(IntegrationDisplayNames.GoogleSheets, GoogleSheets),
|
|
24548
24849
|
];
|
|
24549
|
-
const selectedKey = (_a = options.find(
|
|
24550
|
-
(option) => option.element.props.children[1] === status
|
|
24551
|
-
)) == null ? void 0 : _a.key;
|
|
24552
24850
|
return /* @__PURE__ */ jsx4(
|
|
24553
24851
|
ActionMenu4,
|
|
24554
24852
|
{
|
|
@@ -24557,7 +24855,7 @@ function WorkflowTemplatesProductFilter({
|
|
|
24557
24855
|
},
|
|
24558
24856
|
options,
|
|
24559
24857
|
placement: "bottom",
|
|
24560
|
-
selectedOptions:
|
|
24858
|
+
selectedOptions: product ? [product] : [],
|
|
24561
24859
|
triggerRenderer: /* @__PURE__ */ jsxs2(
|
|
24562
24860
|
Button31,
|
|
24563
24861
|
{
|
|
@@ -24568,7 +24866,7 @@ function WorkflowTemplatesProductFilter({
|
|
|
24568
24866
|
},
|
|
24569
24867
|
children: [
|
|
24570
24868
|
"Product: ",
|
|
24571
|
-
|
|
24869
|
+
product
|
|
24572
24870
|
]
|
|
24573
24871
|
}
|
|
24574
24872
|
),
|
|
@@ -24579,33 +24877,22 @@ function WorkflowTemplatesProductFilter({
|
|
|
24579
24877
|
var Product_default = WorkflowTemplatesProductFilter;
|
|
24580
24878
|
|
|
24581
24879
|
// src/views/Workflows/List/Home/Cards/Scratch.tsx
|
|
24582
|
-
import { useNavigate as useNavigate16 } from "react-router-dom";
|
|
24583
24880
|
import {
|
|
24584
24881
|
Heading as Heading6,
|
|
24585
24882
|
Icon as Icon36,
|
|
24586
|
-
SpacingToken as
|
|
24883
|
+
SpacingToken as SpacingToken39
|
|
24587
24884
|
} from "@livechat/design-system-react-components";
|
|
24588
|
-
import {
|
|
24589
|
-
BetaTag,
|
|
24590
|
-
Card as Card2,
|
|
24591
|
-
Row as Row22,
|
|
24592
|
-
useUserContext as useUserContext10
|
|
24593
|
-
} from "@livechat/developer-studio-ui-react";
|
|
24885
|
+
import { BetaTag, Card as Card2, Row as Row22 } from "@livechat/developer-studio-ui-react";
|
|
24594
24886
|
function WorkflowScratchCard({
|
|
24595
24887
|
title,
|
|
24596
24888
|
icon: icon2,
|
|
24597
24889
|
openOne
|
|
24598
24890
|
}) {
|
|
24599
|
-
const navigate =
|
|
24600
|
-
const
|
|
24601
|
-
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
24602
|
-
user == null ? void 0 : user.meta.email
|
|
24603
|
-
);
|
|
24891
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
24892
|
+
const journey = useWorkflowsJourney();
|
|
24604
24893
|
const handleClick = () => {
|
|
24605
|
-
|
|
24606
|
-
|
|
24607
|
-
);
|
|
24608
|
-
navigate("/workflow/new", { state: { openOne } });
|
|
24894
|
+
journey.draft.create.actions.click(openOne ? "withAI" : "empty");
|
|
24895
|
+
navigate("/new", { state: { openOne } });
|
|
24609
24896
|
};
|
|
24610
24897
|
return /* @__PURE__ */ jsxs2(Card2, { hover: true, light: true, onClick: handleClick, rounded: true, width: "100%", children: [
|
|
24611
24898
|
/* @__PURE__ */ jsxs2(Row22, { noWrap: true, notPadded: true, spaceBetween: true, children: [
|
|
@@ -24617,7 +24904,7 @@ function WorkflowScratchCard({
|
|
|
24617
24904
|
{
|
|
24618
24905
|
as: "div",
|
|
24619
24906
|
css: css`
|
|
24620
|
-
margin-top: var(${
|
|
24907
|
+
margin-top: var(${SpacingToken39.Spacing2});
|
|
24621
24908
|
`,
|
|
24622
24909
|
size: "xs",
|
|
24623
24910
|
children: title
|
|
@@ -24628,11 +24915,10 @@ function WorkflowScratchCard({
|
|
|
24628
24915
|
var Scratch_default = WorkflowScratchCard;
|
|
24629
24916
|
|
|
24630
24917
|
// src/views/Workflows/List/Home/Cards/Template.tsx
|
|
24631
|
-
import { useNavigate as useNavigate17 } from "react-router-dom";
|
|
24632
24918
|
import {
|
|
24633
24919
|
DesignToken as DesignToken42,
|
|
24634
24920
|
Heading as Heading7,
|
|
24635
|
-
SpacingToken as
|
|
24921
|
+
SpacingToken as SpacingToken40
|
|
24636
24922
|
} from "@livechat/design-system-react-components";
|
|
24637
24923
|
import { Card as Card3, Column as Column16, Row as Row23 } from "@livechat/developer-studio-ui-react";
|
|
24638
24924
|
var IconWrapper2 = newStyled.div`
|
|
@@ -24641,8 +24927,8 @@ var IconWrapper2 = newStyled.div`
|
|
|
24641
24927
|
justify-content: center;
|
|
24642
24928
|
background-color: var(${DesignToken42.SurfaceSecondaryDefault});
|
|
24643
24929
|
border-radius: 50%;
|
|
24644
|
-
width: var(${
|
|
24645
|
-
height: var(${
|
|
24930
|
+
width: var(${SpacingToken40.Spacing7});
|
|
24931
|
+
height: var(${SpacingToken40.Spacing7});
|
|
24646
24932
|
`;
|
|
24647
24933
|
function WorkflowTemplateCard({
|
|
24648
24934
|
id,
|
|
@@ -24650,7 +24936,7 @@ function WorkflowTemplateCard({
|
|
|
24650
24936
|
icons,
|
|
24651
24937
|
category
|
|
24652
24938
|
}) {
|
|
24653
|
-
const navigate =
|
|
24939
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
24654
24940
|
return /* @__PURE__ */ jsx4(
|
|
24655
24941
|
Card3,
|
|
24656
24942
|
{
|
|
@@ -24666,18 +24952,18 @@ function WorkflowTemplateCard({
|
|
|
24666
24952
|
children: /* @__PURE__ */ jsxs2(
|
|
24667
24953
|
Column16,
|
|
24668
24954
|
{
|
|
24669
|
-
gap: `var(${
|
|
24955
|
+
gap: `var(${SpacingToken40.Spacing4})`,
|
|
24670
24956
|
inheritHeight: true,
|
|
24671
24957
|
noFlexBasis: true,
|
|
24672
24958
|
noWrap: true,
|
|
24673
24959
|
notPadded: true,
|
|
24674
24960
|
spaceBetween: true,
|
|
24675
24961
|
children: [
|
|
24676
|
-
/* @__PURE__ */ jsxs2(Column16, { gap: `var(${
|
|
24962
|
+
/* @__PURE__ */ jsxs2(Column16, { gap: `var(${SpacingToken40.Spacing4})`, noFlexBasis: true, notPadded: true, children: [
|
|
24677
24963
|
/* @__PURE__ */ jsx4(TemplateCategoryIcon_default, { category }),
|
|
24678
24964
|
/* @__PURE__ */ jsx4(Heading7, { as: "div", size: "xs", children: name })
|
|
24679
24965
|
] }),
|
|
24680
|
-
/* @__PURE__ */ jsx4(Row23, { gap: `var(${
|
|
24966
|
+
/* @__PURE__ */ jsx4(Row23, { gap: `var(${SpacingToken40.Spacing1})`, noWrap: true, notPadded: true, children: icons.map((icon2, i) => /* @__PURE__ */ jsx4(IconWrapper2, { children: /* @__PURE__ */ jsx4(ProductIcon_default, { height: 5, product: icon2, width: 5 }) }, i.toString())) })
|
|
24681
24967
|
]
|
|
24682
24968
|
}
|
|
24683
24969
|
)
|
|
@@ -24691,12 +24977,13 @@ var Grid = newStyled.div`
|
|
|
24691
24977
|
display: grid;
|
|
24692
24978
|
grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
|
|
24693
24979
|
width: 100%;
|
|
24694
|
-
gap: var(${
|
|
24980
|
+
gap: var(${SpacingToken41.Spacing3});
|
|
24695
24981
|
`;
|
|
24696
24982
|
function WorkflowsHome({ isOnModal }) {
|
|
24697
24983
|
const [product, setProduct] = useState31("All");
|
|
24698
24984
|
const [category, setCategory] = useState31("All");
|
|
24699
24985
|
const flowTemplates = useMemo10(() => getWorkflowTemplates(), []);
|
|
24986
|
+
const journey = useWorkflowsJourney();
|
|
24700
24987
|
const filters = [
|
|
24701
24988
|
(template) => product === "All" || template.products.includes(product),
|
|
24702
24989
|
(template) => category === "All" || template.category.includes(category)
|
|
@@ -24709,10 +24996,13 @@ function WorkflowsHome({ isOnModal }) {
|
|
|
24709
24996
|
}
|
|
24710
24997
|
return true;
|
|
24711
24998
|
});
|
|
24999
|
+
useEffect20(() => {
|
|
25000
|
+
journey.template.list.loaded();
|
|
25001
|
+
}, []);
|
|
24712
25002
|
return /* @__PURE__ */ jsx4(Column17, { notPadded: true, width: 12, children: /* @__PURE__ */ jsx4(Row24, { notPadded: true, verticalCenter: true, children: /* @__PURE__ */ jsxs2(
|
|
24713
25003
|
Column17,
|
|
24714
25004
|
{
|
|
24715
|
-
gap: `var(${
|
|
25005
|
+
gap: `var(${SpacingToken41.Spacing3})`,
|
|
24716
25006
|
noFlexBasis: true,
|
|
24717
25007
|
notPadded: true,
|
|
24718
25008
|
width: 9,
|
|
@@ -24728,7 +25018,7 @@ function WorkflowsHome({ isOnModal }) {
|
|
|
24728
25018
|
Row24,
|
|
24729
25019
|
{
|
|
24730
25020
|
bottomMargin: true,
|
|
24731
|
-
gap: `var(${
|
|
25021
|
+
gap: `var(${SpacingToken41.Spacing3})`,
|
|
24732
25022
|
lowMargin: true,
|
|
24733
25023
|
noWrap: true,
|
|
24734
25024
|
notPadded: true,
|
|
@@ -24753,28 +25043,28 @@ function WorkflowsHome({ isOnModal }) {
|
|
|
24753
25043
|
headerSize: isOnModal ? "xs" : "s"
|
|
24754
25044
|
}
|
|
24755
25045
|
),
|
|
24756
|
-
/* @__PURE__ */ jsxs2(Row24, { gap: `var(${
|
|
25046
|
+
/* @__PURE__ */ jsxs2(Row24, { gap: `var(${SpacingToken41.Spacing2})`, notPadded: true, children: [
|
|
24757
25047
|
/* @__PURE__ */ jsx4(
|
|
24758
25048
|
Product_default,
|
|
24759
25049
|
{
|
|
24760
|
-
|
|
24761
|
-
setProduct(
|
|
25050
|
+
handleProduct: (product2) => {
|
|
25051
|
+
setProduct(product2);
|
|
24762
25052
|
},
|
|
24763
|
-
|
|
25053
|
+
product
|
|
24764
25054
|
}
|
|
24765
25055
|
),
|
|
24766
25056
|
/* @__PURE__ */ jsx4(
|
|
24767
25057
|
Category_default,
|
|
24768
25058
|
{
|
|
24769
|
-
|
|
24770
|
-
|
|
24771
|
-
|
|
24772
|
-
|
|
25059
|
+
category,
|
|
25060
|
+
handleCategory: (category2) => {
|
|
25061
|
+
setCategory(category2);
|
|
25062
|
+
}
|
|
24773
25063
|
}
|
|
24774
25064
|
)
|
|
24775
25065
|
] }),
|
|
24776
25066
|
/* @__PURE__ */ jsx4(Grid, { children: filteredTemplates.length === 0 ? /* @__PURE__ */ jsx4(
|
|
24777
|
-
|
|
25067
|
+
Text19,
|
|
24778
25068
|
{
|
|
24779
25069
|
customColor: `var(${DesignToken43.ContentBasicSecondary})`,
|
|
24780
25070
|
size: "md",
|
|
@@ -24798,7 +25088,7 @@ var Home_default = WorkflowsHome;
|
|
|
24798
25088
|
|
|
24799
25089
|
// src/views/Workflows/List/Modals/Create/Modal.tsx
|
|
24800
25090
|
function WorkflowCreateModal({ onClose }) {
|
|
24801
|
-
const navigate =
|
|
25091
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
24802
25092
|
const handleClose = useCallback20(() => {
|
|
24803
25093
|
if (onClose) {
|
|
24804
25094
|
onClose();
|
|
@@ -24832,12 +25122,11 @@ function WorkflowCreate() {
|
|
|
24832
25122
|
var Create_default = WorkflowCreate;
|
|
24833
25123
|
|
|
24834
25124
|
// src/views/Workflows/List/View.tsx
|
|
24835
|
-
import { useState as useState33 } from "react";
|
|
24836
|
-
import { useNavigate as useNavigate21 } from "react-router-dom";
|
|
25125
|
+
import { useEffect as useEffect21, useState as useState33 } from "react";
|
|
24837
25126
|
import {
|
|
24838
25127
|
Button as Button35,
|
|
24839
25128
|
DesignToken as DesignToken46,
|
|
24840
|
-
SpacingToken as
|
|
25129
|
+
SpacingToken as SpacingToken44
|
|
24841
25130
|
} from "@livechat/design-system-react-components";
|
|
24842
25131
|
import {
|
|
24843
25132
|
Column as Column18,
|
|
@@ -24849,23 +25138,22 @@ import {
|
|
|
24849
25138
|
|
|
24850
25139
|
// src/views/Workflows/Creator/LiveChatNavbar.tsx
|
|
24851
25140
|
import { useCallback as useCallback21 } from "react";
|
|
24852
|
-
import { useNavigate as useNavigate19 } from "react-router-dom";
|
|
24853
25141
|
import { LayoutSidebarLeft } from "@livechat/design-system-icons";
|
|
24854
25142
|
import {
|
|
24855
25143
|
Button as Button32,
|
|
24856
25144
|
DesignToken as DesignToken44,
|
|
24857
25145
|
Heading as Heading8,
|
|
24858
25146
|
Icon as Icon37,
|
|
24859
|
-
SpacingToken as
|
|
25147
|
+
SpacingToken as SpacingToken42
|
|
24860
25148
|
} from "@livechat/design-system-react-components";
|
|
24861
25149
|
var wrapperCss = (hasData) => css`
|
|
24862
25150
|
flex-shrink: 0;
|
|
24863
|
-
height: var(${
|
|
25151
|
+
height: var(${SpacingToken42.Spacing14});
|
|
24864
25152
|
width: 100%;
|
|
24865
25153
|
display: flex;
|
|
24866
|
-
padding: 0 var(${
|
|
25154
|
+
padding: 0 var(${SpacingToken42.Spacing6}) 0 var(${SpacingToken42.Spacing4});
|
|
24867
25155
|
align-items: center;
|
|
24868
|
-
gap: var(${
|
|
25156
|
+
gap: var(${SpacingToken42.Spacing2});
|
|
24869
25157
|
border-bottom: 1px solid var(${DesignToken44.BorderBasicSecondary});
|
|
24870
25158
|
|
|
24871
25159
|
${hasData && `> button:last-of-type {
|
|
@@ -24873,7 +25161,7 @@ var wrapperCss = (hasData) => css`
|
|
|
24873
25161
|
}`}
|
|
24874
25162
|
`;
|
|
24875
25163
|
function LiveChatNavbar() {
|
|
24876
|
-
const navigate =
|
|
25164
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
24877
25165
|
const workflows = useFetchWorkflows({});
|
|
24878
25166
|
const isLoading = workflows.isLoading;
|
|
24879
25167
|
const hasNoData = workflows.isSuccess && workflows.data.length === 0;
|
|
@@ -24980,7 +25268,8 @@ function WorkflowStatusFilter({
|
|
|
24980
25268
|
var StatusFilter_default = WorkflowStatusFilter;
|
|
24981
25269
|
|
|
24982
25270
|
// src/views/Workflows/List/Grid/Table.tsx
|
|
24983
|
-
import {
|
|
25271
|
+
import { useCallback as useCallback22 } from "react";
|
|
25272
|
+
import { useLocation as useLocation7 } from "react-router-dom";
|
|
24984
25273
|
import {
|
|
24985
25274
|
Delete as Delete3,
|
|
24986
25275
|
Info as Info2,
|
|
@@ -24993,31 +25282,28 @@ import {
|
|
|
24993
25282
|
Button as Button34,
|
|
24994
25283
|
DesignToken as DesignToken45,
|
|
24995
25284
|
Icon as Icon39,
|
|
24996
|
-
SpacingToken as
|
|
25285
|
+
SpacingToken as SpacingToken43,
|
|
24997
25286
|
Switch as Switch2,
|
|
24998
25287
|
Tag as Tag4,
|
|
24999
|
-
Text as
|
|
25288
|
+
Text as Text20,
|
|
25000
25289
|
Tooltip as Tooltip9
|
|
25001
25290
|
} from "@livechat/design-system-react-components";
|
|
25002
|
-
import { IntegrationNames as
|
|
25291
|
+
import { IntegrationNames as IntegrationNames20 } from "@livechat/developer-studio-api";
|
|
25003
25292
|
import {
|
|
25004
25293
|
Loader as Loader4,
|
|
25005
25294
|
Row as Row25,
|
|
25006
25295
|
StopPropagation,
|
|
25007
25296
|
Table,
|
|
25008
|
-
useNotificationContext as useNotificationContext5
|
|
25009
|
-
useUserContext as useUserContext11
|
|
25297
|
+
useNotificationContext as useNotificationContext5
|
|
25010
25298
|
} from "@livechat/developer-studio-ui-react";
|
|
25011
25299
|
function WorkflowsTable({ workflowsQuery, state }) {
|
|
25012
25300
|
var _a, _b, _c;
|
|
25013
|
-
const
|
|
25301
|
+
const location = useLocation7();
|
|
25302
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
25014
25303
|
const notifications = useNotificationContext5();
|
|
25015
25304
|
const deleteAction = useDeleteWorkflow();
|
|
25016
25305
|
const activateWorkflowAction = useActivateWorkflow();
|
|
25017
|
-
const
|
|
25018
|
-
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
25019
|
-
user == null ? void 0 : user.meta.email
|
|
25020
|
-
);
|
|
25306
|
+
const journey = useWorkflowsJourney();
|
|
25021
25307
|
const filteredWorkflows = ((_a = workflowsQuery.data) != null ? _a : []).filter((workflow) => !(workflow.draft && workflow.related_workflow_id)).filter((workflow) => {
|
|
25022
25308
|
if (state.filters.status === "Active") return workflow.active;
|
|
25023
25309
|
if (state.filters.status === "Inactive") return !workflow.active;
|
|
@@ -25025,9 +25311,48 @@ function WorkflowsTable({ workflowsQuery, state }) {
|
|
|
25025
25311
|
}).filter(
|
|
25026
25312
|
(workflow) => {
|
|
25027
25313
|
var _a2, _b2, _c2;
|
|
25028
|
-
return workflow.name.toLowerCase().includes((_c2 = (_b2 = (_a2 = state.params) == null ? void 0 : _a2.name) == null ? void 0 : _b2.value) != null ? _c2 : "");
|
|
25314
|
+
return workflow.name.toLowerCase().includes(((_c2 = (_b2 = (_a2 = state.params) == null ? void 0 : _a2.name) == null ? void 0 : _b2.value) != null ? _c2 : "").toLowerCase());
|
|
25029
25315
|
}
|
|
25030
25316
|
);
|
|
25317
|
+
const handleSelect = useCallback22(
|
|
25318
|
+
(workflow) => {
|
|
25319
|
+
journey.workflow.edit.actions.click();
|
|
25320
|
+
navigate(`/${workflow.id}`);
|
|
25321
|
+
},
|
|
25322
|
+
[journey.workflow.edit.actions, navigate]
|
|
25323
|
+
);
|
|
25324
|
+
const handleActivate = useCallback22(
|
|
25325
|
+
(workflow) => __async(this, null, function* () {
|
|
25326
|
+
yield activateWorkflowAction.mutateAsync({
|
|
25327
|
+
id: workflow.id,
|
|
25328
|
+
active: !workflow.active
|
|
25329
|
+
});
|
|
25330
|
+
}),
|
|
25331
|
+
[activateWorkflowAction]
|
|
25332
|
+
);
|
|
25333
|
+
const handleDelete = useCallback22(
|
|
25334
|
+
(workflow) => __async(this, null, function* () {
|
|
25335
|
+
journey.workflow.delete.actions.click("list");
|
|
25336
|
+
yield deleteAction.mutateAsync(workflow);
|
|
25337
|
+
if (location.pathname.includes(`/${workflow.id}`)) {
|
|
25338
|
+
navigate("/");
|
|
25339
|
+
}
|
|
25340
|
+
notifications.addSuccessToast("Workflow has been deleted successfully");
|
|
25341
|
+
}),
|
|
25342
|
+
[
|
|
25343
|
+
journey.workflow.delete.actions,
|
|
25344
|
+
deleteAction,
|
|
25345
|
+
location.pathname,
|
|
25346
|
+
navigate,
|
|
25347
|
+
notifications
|
|
25348
|
+
]
|
|
25349
|
+
);
|
|
25350
|
+
const handleShowDetails = useCallback22(
|
|
25351
|
+
(workflow) => {
|
|
25352
|
+
navigate(`${workflow.id}/info`);
|
|
25353
|
+
},
|
|
25354
|
+
[navigate]
|
|
25355
|
+
);
|
|
25031
25356
|
return /* @__PURE__ */ jsxs2(Table, { flowTable: true, loading: workflowsQuery.isLoading, children: [
|
|
25032
25357
|
/* @__PURE__ */ jsx4("thead", { children: /* @__PURE__ */ jsxs2("tr", { children: [
|
|
25033
25358
|
/* @__PURE__ */ jsx4("th", { children: "Name" }),
|
|
@@ -25037,143 +25362,124 @@ function WorkflowsTable({ workflowsQuery, state }) {
|
|
|
25037
25362
|
/* @__PURE__ */ jsx4("th", {})
|
|
25038
25363
|
] }) }),
|
|
25039
25364
|
/* @__PURE__ */ jsx4("tbody", { children: workflowsQuery.isSuccess && filteredWorkflows.length > 0 ? filteredWorkflows.map((workflow) => {
|
|
25040
|
-
var _a2, _b2, _c2, _d
|
|
25041
|
-
|
|
25042
|
-
|
|
25043
|
-
|
|
25044
|
-
|
|
25045
|
-
|
|
25046
|
-
|
|
25047
|
-
cursor: pointer;
|
|
25365
|
+
var _a2, _b2, _c2, _d;
|
|
25366
|
+
return /* @__PURE__ */ jsxs2(
|
|
25367
|
+
"tr",
|
|
25368
|
+
{
|
|
25369
|
+
css: css`
|
|
25370
|
+
transition: background 0.2s;
|
|
25371
|
+
cursor: pointer;
|
|
25048
25372
|
|
|
25049
|
-
|
|
25050
|
-
|
|
25051
|
-
|
|
25052
|
-
|
|
25053
|
-
|
|
25054
|
-
|
|
25055
|
-
|
|
25056
|
-
|
|
25057
|
-
children: [
|
|
25058
|
-
/* @__PURE__ */ jsx4(
|
|
25059
|
-
|
|
25060
|
-
|
|
25061
|
-
Tag4,
|
|
25062
|
-
{
|
|
25063
|
-
css: css`
|
|
25064
|
-
color: #68afff;
|
|
25065
|
-
flex-shrink: 0;
|
|
25066
|
-
`,
|
|
25067
|
-
kind: "info",
|
|
25068
|
-
size: "small",
|
|
25069
|
-
children: "Has Draft"
|
|
25070
|
-
}
|
|
25071
|
-
) : null
|
|
25072
|
-
] }) }),
|
|
25073
|
-
/* @__PURE__ */ jsx4("td", { width: "40%", children: /* @__PURE__ */ jsx4(Row25, { gap: 12, notPadded: true, children: (_d = workflow.tags) == null ? void 0 : _d.map((tag) => {
|
|
25074
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && (tag.toLowerCase() === "openai" || tag.toLowerCase() === IntegrationNames19.BigCommerce.toLowerCase());
|
|
25075
|
-
return /* @__PURE__ */ jsx4(
|
|
25076
|
-
ProductIcon_default,
|
|
25077
|
-
{
|
|
25078
|
-
center: true,
|
|
25079
|
-
height: 4,
|
|
25080
|
-
product: tag.toLowerCase(),
|
|
25081
|
-
revertColors: revertIconColor,
|
|
25082
|
-
width: 4
|
|
25083
|
-
},
|
|
25084
|
-
tag
|
|
25085
|
-
);
|
|
25086
|
-
}) }) }),
|
|
25087
|
-
/* @__PURE__ */ jsx4("td", { children: /* @__PURE__ */ jsx4(
|
|
25088
|
-
Tooltip9,
|
|
25373
|
+
&:hover {
|
|
25374
|
+
background: var(${DesignToken45.SurfacePrimaryHover});
|
|
25375
|
+
}
|
|
25376
|
+
`,
|
|
25377
|
+
onClick: () => {
|
|
25378
|
+
handleSelect(workflow);
|
|
25379
|
+
},
|
|
25380
|
+
children: [
|
|
25381
|
+
/* @__PURE__ */ jsx4("td", { width: "45%", children: /* @__PURE__ */ jsxs2(Row25, { gap: `var(${SpacingToken43.Spacing2})`, noWrap: true, notPadded: true, children: [
|
|
25382
|
+
/* @__PURE__ */ jsx4(Text20, { noMargin: true, size: "sm", children: workflow.name }),
|
|
25383
|
+
workflow.related_workflow_id ? /* @__PURE__ */ jsx4(
|
|
25384
|
+
Tag4,
|
|
25089
25385
|
{
|
|
25090
|
-
|
|
25091
|
-
|
|
25092
|
-
|
|
25093
|
-
|
|
25094
|
-
|
|
25095
|
-
|
|
25096
|
-
|
|
25097
|
-
`,
|
|
25098
|
-
on: (_e = workflow.active) != null ? _e : false,
|
|
25099
|
-
onChange: (e) => {
|
|
25100
|
-
e.stopPropagation();
|
|
25101
|
-
void activateWorkflowAction.mutateAsync({
|
|
25102
|
-
id: workflow.id,
|
|
25103
|
-
active: !workflow.active
|
|
25104
|
-
});
|
|
25105
|
-
},
|
|
25106
|
-
state: activateWorkflowAction.isLoading && ((_f = activateWorkflowAction.variables) == null ? void 0 : _f.id) === workflow.id ? "loading" : workflow.draft ? "locked" : "regular"
|
|
25107
|
-
}
|
|
25108
|
-
) }),
|
|
25109
|
-
children: workflow.draft ? "Publish the draft to activate this workflow" : workflow.active ? "Deactivate flow" : "Activate flow"
|
|
25386
|
+
css: css`
|
|
25387
|
+
color: #68afff;
|
|
25388
|
+
flex-shrink: 0;
|
|
25389
|
+
`,
|
|
25390
|
+
kind: "info",
|
|
25391
|
+
size: "small",
|
|
25392
|
+
children: "Has Draft"
|
|
25110
25393
|
}
|
|
25111
|
-
)
|
|
25112
|
-
|
|
25113
|
-
|
|
25394
|
+
) : null
|
|
25395
|
+
] }) }),
|
|
25396
|
+
/* @__PURE__ */ jsx4("td", { width: "40%", children: /* @__PURE__ */ jsx4(Row25, { gap: 12, notPadded: true, children: (_a2 = workflow.tags) == null ? void 0 : _a2.map((tag) => {
|
|
25397
|
+
const revertIconColor = getWorkflowsEnv("isHeadless") && (tag.toLowerCase() === "openai" || tag.toLowerCase() === IntegrationNames20.BigCommerce.toLowerCase());
|
|
25398
|
+
return /* @__PURE__ */ jsx4(
|
|
25399
|
+
ProductIcon_default,
|
|
25114
25400
|
{
|
|
25115
|
-
|
|
25116
|
-
|
|
25117
|
-
|
|
25118
|
-
|
|
25119
|
-
|
|
25401
|
+
center: true,
|
|
25402
|
+
height: 4,
|
|
25403
|
+
product: tag.toLowerCase(),
|
|
25404
|
+
revertColors: revertIconColor,
|
|
25405
|
+
width: 4
|
|
25406
|
+
},
|
|
25407
|
+
tag
|
|
25408
|
+
);
|
|
25409
|
+
}) }) }),
|
|
25410
|
+
/* @__PURE__ */ jsx4("td", { children: /* @__PURE__ */ jsx4(
|
|
25411
|
+
Tooltip9,
|
|
25412
|
+
{
|
|
25413
|
+
triggerClassName: "tooltip-trigger",
|
|
25414
|
+
triggerOnHover: true,
|
|
25415
|
+
triggerRenderer: /* @__PURE__ */ jsx4(StopPropagation, { children: /* @__PURE__ */ jsx4(
|
|
25416
|
+
Switch2,
|
|
25417
|
+
{
|
|
25418
|
+
css: css`
|
|
25419
|
+
vertical-align: bottom;
|
|
25420
|
+
`,
|
|
25421
|
+
on: (_b2 = workflow.active) != null ? _b2 : false,
|
|
25422
|
+
onChange: (e) => {
|
|
25423
|
+
e.stopPropagation();
|
|
25424
|
+
void handleActivate(workflow);
|
|
25425
|
+
},
|
|
25426
|
+
state: activateWorkflowAction.isLoading && ((_c2 = activateWorkflowAction.variables) == null ? void 0 : _c2.id) === workflow.id ? "loading" : workflow.draft ? "locked" : "regular"
|
|
25120
25427
|
}
|
|
25428
|
+
) }),
|
|
25429
|
+
children: workflow.draft ? "Publish the draft to activate this workflow" : workflow.active ? "Deactivate flow" : "Activate flow"
|
|
25430
|
+
}
|
|
25431
|
+
) }),
|
|
25432
|
+
/* @__PURE__ */ jsx4("td", { children: !workflow.draft && /* @__PURE__ */ jsx4(
|
|
25433
|
+
Button34,
|
|
25434
|
+
{
|
|
25435
|
+
icon: /* @__PURE__ */ jsx4(Icon39, { source: Info2 }),
|
|
25436
|
+
kind: "plain",
|
|
25437
|
+
onClick: (e) => {
|
|
25438
|
+
e.stopPropagation();
|
|
25439
|
+
handleShowDetails(workflow);
|
|
25121
25440
|
}
|
|
25122
|
-
|
|
25123
|
-
|
|
25124
|
-
|
|
25125
|
-
|
|
25126
|
-
|
|
25127
|
-
|
|
25128
|
-
|
|
25129
|
-
|
|
25130
|
-
|
|
25131
|
-
|
|
25132
|
-
|
|
25133
|
-
|
|
25134
|
-
|
|
25135
|
-
),
|
|
25136
|
-
onClick: () => {
|
|
25137
|
-
navigate(`/workflow/${workflow.id}/execute`);
|
|
25441
|
+
}
|
|
25442
|
+
) }),
|
|
25443
|
+
/* @__PURE__ */ jsx4("td", { align: "right", children: /* @__PURE__ */ jsx4(StopPropagation, { children: /* @__PURE__ */ jsx4(
|
|
25444
|
+
ActionMenu6,
|
|
25445
|
+
{
|
|
25446
|
+
options: [
|
|
25447
|
+
{
|
|
25448
|
+
key: "run",
|
|
25449
|
+
element: /* @__PURE__ */ jsx4(
|
|
25450
|
+
ActionMenuItem2,
|
|
25451
|
+
{
|
|
25452
|
+
leftNode: /* @__PURE__ */ jsx4(Icon39, { source: PlayArrow }),
|
|
25453
|
+
children: "Trigger manually"
|
|
25138
25454
|
}
|
|
25139
|
-
|
|
25140
|
-
{
|
|
25141
|
-
|
|
25142
|
-
element: /* @__PURE__ */ jsx4(
|
|
25143
|
-
ActionMenuItem2,
|
|
25144
|
-
{
|
|
25145
|
-
leftNode: /* @__PURE__ */ jsx4(Icon39, { source: Delete3 }),
|
|
25146
|
-
children: "Delete"
|
|
25147
|
-
}
|
|
25148
|
-
),
|
|
25149
|
-
onClick: () => void (() => __async(this, null, function* () {
|
|
25150
|
-
amplitudeWorkflowsJourney.workflow.delete.actions.click(
|
|
25151
|
-
"list"
|
|
25152
|
-
);
|
|
25153
|
-
yield deleteAction.mutateAsync(workflow);
|
|
25154
|
-
notifications.addSuccessToast(
|
|
25155
|
-
"Workflow has been deleted successfully"
|
|
25156
|
-
);
|
|
25157
|
-
}))()
|
|
25455
|
+
),
|
|
25456
|
+
onClick: () => {
|
|
25457
|
+
navigate(`/${workflow.id}/execute`);
|
|
25158
25458
|
}
|
|
25159
|
-
|
|
25160
|
-
|
|
25161
|
-
|
|
25162
|
-
{
|
|
25163
|
-
|
|
25164
|
-
|
|
25165
|
-
loading: deleteAction.isLoading ? ((_g = deleteAction.variables) == null ? void 0 : _g.id) === workflow.id : void 0,
|
|
25166
|
-
size: "compact"
|
|
25459
|
+
},
|
|
25460
|
+
{
|
|
25461
|
+
key: "delete",
|
|
25462
|
+
element: /* @__PURE__ */ jsx4(ActionMenuItem2, { leftNode: /* @__PURE__ */ jsx4(Icon39, { source: Delete3 }), children: "Delete" }),
|
|
25463
|
+
onClick: () => {
|
|
25464
|
+
void handleDelete(workflow);
|
|
25167
25465
|
}
|
|
25168
|
-
|
|
25169
|
-
|
|
25170
|
-
|
|
25171
|
-
|
|
25172
|
-
|
|
25173
|
-
|
|
25174
|
-
|
|
25175
|
-
|
|
25176
|
-
|
|
25466
|
+
}
|
|
25467
|
+
],
|
|
25468
|
+
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
25469
|
+
Button34,
|
|
25470
|
+
{
|
|
25471
|
+
icon: /* @__PURE__ */ jsx4(Icon39, { source: MoreHoriz2 }),
|
|
25472
|
+
kind: "text",
|
|
25473
|
+
loading: deleteAction.isLoading ? ((_d = deleteAction.variables) == null ? void 0 : _d.id) === workflow.id : void 0,
|
|
25474
|
+
size: "compact"
|
|
25475
|
+
}
|
|
25476
|
+
)
|
|
25477
|
+
}
|
|
25478
|
+
) }) })
|
|
25479
|
+
]
|
|
25480
|
+
},
|
|
25481
|
+
workflow.id
|
|
25482
|
+
);
|
|
25177
25483
|
}) : workflowsQuery.isLoading ? /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { align: "center", colSpan: 6, children: /* @__PURE__ */ jsx4(Loader4, { size: "medium" }) }) }) : /* @__PURE__ */ jsx4(
|
|
25178
25484
|
"tr",
|
|
25179
25485
|
{
|
|
@@ -25181,7 +25487,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
|
|
|
25181
25487
|
background: transparent !important;
|
|
25182
25488
|
color: var(${DesignToken45.ContentBasicSecondary});
|
|
25183
25489
|
`,
|
|
25184
|
-
children: /* @__PURE__ */ jsx4("td", { align: "left", colSpan: 6, children: /* @__PURE__ */ jsxs2(
|
|
25490
|
+
children: /* @__PURE__ */ jsx4("td", { align: "left", colSpan: 6, children: /* @__PURE__ */ jsxs2(Text20, { as: "div", size: "md", children: [
|
|
25185
25491
|
"There are no",
|
|
25186
25492
|
" ",
|
|
25187
25493
|
state.filters.status !== "All" && state.filters.status.toLowerCase(),
|
|
@@ -25253,18 +25559,23 @@ var markedStyles = css`
|
|
|
25253
25559
|
color: var(${DesignToken46.ActionPrimaryDefault});
|
|
25254
25560
|
`;
|
|
25255
25561
|
function WorkflowListView() {
|
|
25256
|
-
|
|
25257
|
-
const navigate =
|
|
25562
|
+
const workflows = useFetchWorkflows();
|
|
25563
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
25564
|
+
const journey = useWorkflowsJourney();
|
|
25258
25565
|
const [state, setState] = useState33({
|
|
25259
25566
|
filters: {
|
|
25260
25567
|
status: "All",
|
|
25261
25568
|
tasks: "All"
|
|
25262
25569
|
}
|
|
25263
25570
|
});
|
|
25264
|
-
const workflows = useFetchWorkflows((_a = state.params) != null ? _a : {});
|
|
25265
25571
|
const isLoading = workflows.isLoading && state.params === void 0;
|
|
25266
25572
|
const hasNoData = workflows.isSuccess && workflows.data.length === 0 && state.params === void 0;
|
|
25267
25573
|
const hasData = !isLoading && !hasNoData;
|
|
25574
|
+
useEffect21(() => {
|
|
25575
|
+
if (hasData) {
|
|
25576
|
+
journey.workflow.list.loaded();
|
|
25577
|
+
}
|
|
25578
|
+
}, [hasData]);
|
|
25268
25579
|
if (isLoading) {
|
|
25269
25580
|
return /* @__PURE__ */ jsx4(Loader5, { stretch: true });
|
|
25270
25581
|
}
|
|
@@ -25280,7 +25591,7 @@ function WorkflowListView() {
|
|
|
25280
25591
|
Row26,
|
|
25281
25592
|
{
|
|
25282
25593
|
center: true,
|
|
25283
|
-
gap: `var(${
|
|
25594
|
+
gap: `var(${SpacingToken44.Spacing2})`,
|
|
25284
25595
|
notPadded: true,
|
|
25285
25596
|
verticalCenter: true,
|
|
25286
25597
|
children: [
|
|
@@ -25311,7 +25622,7 @@ function WorkflowListView() {
|
|
|
25311
25622
|
}
|
|
25312
25623
|
) }) : null
|
|
25313
25624
|
] }),
|
|
25314
|
-
/* @__PURE__ */ jsx4(Row26, { children: /* @__PURE__ */ jsxs2(Column18, { gap: `var(${
|
|
25625
|
+
/* @__PURE__ */ jsx4(Row26, { children: /* @__PURE__ */ jsxs2(Column18, { gap: `var(${SpacingToken44.Spacing10})`, noMaxWidth: true, width: 12, children: [
|
|
25315
25626
|
hasData ? /* @__PURE__ */ jsx4(
|
|
25316
25627
|
Grid_default,
|
|
25317
25628
|
{
|
|
@@ -25329,8 +25640,12 @@ function WorkflowListView() {
|
|
|
25329
25640
|
var View_default2 = WorkflowListView;
|
|
25330
25641
|
|
|
25331
25642
|
// src/views/Workflows/List/index.tsx
|
|
25643
|
+
var wrapperRowStyles = css`
|
|
25644
|
+
overflow: auto;
|
|
25645
|
+
scrollbar-width: none;
|
|
25646
|
+
`;
|
|
25332
25647
|
function WorkflowList() {
|
|
25333
|
-
return /* @__PURE__ */ jsxs2(Row27, { noMaxWidth: true, noWrap: true, notPadded: true, stretch: true, children: [
|
|
25648
|
+
return /* @__PURE__ */ jsxs2(Row27, { css: wrapperRowStyles, noMaxWidth: true, noWrap: true, notPadded: true, stretch: true, children: [
|
|
25334
25649
|
/* @__PURE__ */ jsx4(View_default2, {}),
|
|
25335
25650
|
/* @__PURE__ */ jsxs2(Routes5, { children: [
|
|
25336
25651
|
/* @__PURE__ */ jsx4(Route5, { element: /* @__PURE__ */ jsx4(PreviewTemplate_default, {}), path: "preview/:template" }),
|
|
@@ -25344,14 +25659,14 @@ var List_default2 = WorkflowList;
|
|
|
25344
25659
|
// src/views/Workflows/index.tsx
|
|
25345
25660
|
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
25346
25661
|
function Workflows() {
|
|
25347
|
-
const navigate =
|
|
25662
|
+
const navigate = useWorkflowsRelativeNavigate();
|
|
25348
25663
|
const { userHasInstalledWorkflows, isWorkflowAppLoading } = useFetchUserInstalledWorkflows();
|
|
25349
|
-
|
|
25664
|
+
useEffect22(() => {
|
|
25350
25665
|
if (isWorkflowAppLoading) {
|
|
25351
25666
|
return;
|
|
25352
25667
|
}
|
|
25353
25668
|
if (!userHasInstalledWorkflows) {
|
|
25354
|
-
navigate("/
|
|
25669
|
+
navigate("/waitlist");
|
|
25355
25670
|
}
|
|
25356
25671
|
}, [navigate, isWorkflowAppLoading, userHasInstalledWorkflows]);
|
|
25357
25672
|
if (isWorkflowAppLoading) {
|
|
@@ -25366,7 +25681,7 @@ function Workflows() {
|
|
|
25366
25681
|
var Workflows_default = Workflows;
|
|
25367
25682
|
|
|
25368
25683
|
// src/views/Common/LoginError.tsx
|
|
25369
|
-
import { Button as Button36, SpacingToken as
|
|
25684
|
+
import { Button as Button36, SpacingToken as SpacingToken45 } from "@livechat/design-system-react-components";
|
|
25370
25685
|
import {
|
|
25371
25686
|
Column as Column19,
|
|
25372
25687
|
Intro as Intro5,
|
|
@@ -25378,12 +25693,12 @@ var imgContainerCss2 = css`
|
|
|
25378
25693
|
img {
|
|
25379
25694
|
height: auto;
|
|
25380
25695
|
max-width: 100%;
|
|
25381
|
-
margin-bottom: var(${
|
|
25696
|
+
margin-bottom: var(${SpacingToken45.Spacing10});
|
|
25382
25697
|
}
|
|
25383
25698
|
`;
|
|
25384
25699
|
var paragraphCss = (heading) => css`
|
|
25385
25700
|
${heading ? theme.typography.heading.xs : theme.typography.paragraph.s}
|
|
25386
|
-
margin-top: var(${heading ?
|
|
25701
|
+
margin-top: var(${heading ? SpacingToken45.Spacing10 : SpacingToken45.Spacing2});
|
|
25387
25702
|
`;
|
|
25388
25703
|
var wrapperCss2 = css`
|
|
25389
25704
|
display: flex;
|