@livechat/platform-workflows 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +350 -650
- package/dist/index.mjs +298 -618
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -490,7 +490,6 @@ function getWorkflowsConfig() {
|
|
|
490
490
|
githubOauthClientId: isProd ? "ebbb08fa2c26d3e7911d" : "bcffd61bd0edd23bca45",
|
|
491
491
|
hubpotClientId: isProd ? "0ea9fd9a-711f-46c5-b2d3-2eded08c9e4e" : "9364c554-2d76-4bd8-afe0-a376779391fb",
|
|
492
492
|
mailchimpClientId: isProd ? "422176034316" : "909176593632",
|
|
493
|
-
neonClientId: isProd ? "textdotcom" : "textdotcom",
|
|
494
493
|
netlifyClientId: isProd ? "qUoHYb2DdVwKxot9Gc7URTdsZQYHYaumykjkv5K3_Mw" : "vDmNXNN9rTkZJtCwOHot2IKOherrm8t7gGA5kStotlo",
|
|
495
494
|
shopifyClientId: isProd ? "8eea1c48bad9a2172515036a332ee612" : "406be223b8445696dfe64d86c17eb3ed",
|
|
496
495
|
vercelClientId: isProd ? "oac_0nV7q5jDmCQKqpwEdGljaaLp" : "oac_bgwv72AO8fJWj8I9qIROY7wI",
|
|
@@ -516,7 +515,6 @@ import {
|
|
|
516
515
|
updateGithubClient,
|
|
517
516
|
updateHubspotClient,
|
|
518
517
|
updateMailchimpClient,
|
|
519
|
-
updateNeonClient,
|
|
520
518
|
updateNetlifyClient,
|
|
521
519
|
updatePlatformAdapterClient,
|
|
522
520
|
updateShopifyClient,
|
|
@@ -540,10 +538,6 @@ function AuthProvider({ children }) {
|
|
|
540
538
|
raw: {},
|
|
541
539
|
data: {}
|
|
542
540
|
},
|
|
543
|
-
neon: {
|
|
544
|
-
raw: {},
|
|
545
|
-
data: {}
|
|
546
|
-
},
|
|
547
541
|
mailchimp: {
|
|
548
542
|
raw: {},
|
|
549
543
|
data: {}
|
|
@@ -591,12 +585,6 @@ function AuthProvider({ children }) {
|
|
|
591
585
|
},
|
|
592
586
|
data: {}
|
|
593
587
|
},
|
|
594
|
-
neon: {
|
|
595
|
-
raw: {
|
|
596
|
-
token: JSON.parse(localStorage.getItem("neon.token") || '""')
|
|
597
|
-
},
|
|
598
|
-
data: {}
|
|
599
|
-
},
|
|
600
588
|
mailchimp: {
|
|
601
589
|
raw: {
|
|
602
590
|
token: JSON.parse(localStorage.getItem("mailchimp.token") || '""'),
|
|
@@ -690,22 +678,6 @@ function AuthProvider({ children }) {
|
|
|
690
678
|
}));
|
|
691
679
|
break;
|
|
692
680
|
}
|
|
693
|
-
case IntegrationNames.Neon: {
|
|
694
|
-
localStorage.setItem(`neon.token`, JSON.stringify(data.token));
|
|
695
|
-
updateNeonClient(data.token);
|
|
696
|
-
updatePlatformAdapterClient({
|
|
697
|
-
neon: data
|
|
698
|
-
});
|
|
699
|
-
setState((prevState) => __spreadProps(__spreadValues({}, prevState), {
|
|
700
|
-
neon: __spreadProps(__spreadValues({}, prevState.neon), {
|
|
701
|
-
raw: data,
|
|
702
|
-
data: {
|
|
703
|
-
isAuthorized: Boolean(data.token)
|
|
704
|
-
}
|
|
705
|
-
})
|
|
706
|
-
}));
|
|
707
|
-
break;
|
|
708
|
-
}
|
|
709
681
|
case IntegrationNames.Mailchimp: {
|
|
710
682
|
localStorage.setItem(`mailchimp.token`, JSON.stringify(data.token));
|
|
711
683
|
localStorage.setItem(`mailchimp.server`, JSON.stringify(data.server));
|
|
@@ -826,17 +798,6 @@ function AuthProvider({ children }) {
|
|
|
826
798
|
}));
|
|
827
799
|
break;
|
|
828
800
|
}
|
|
829
|
-
case IntegrationNames.Neon: {
|
|
830
|
-
localStorage.removeItem(`neon.token`);
|
|
831
|
-
setState((prevState) => __spreadProps(__spreadValues({}, prevState), {
|
|
832
|
-
neon: __spreadProps(__spreadValues({}, prevState.neon), {
|
|
833
|
-
raw: __spreadProps(__spreadValues({}, prevState.neon.raw), {
|
|
834
|
-
token: void 0
|
|
835
|
-
})
|
|
836
|
-
})
|
|
837
|
-
}));
|
|
838
|
-
break;
|
|
839
|
-
}
|
|
840
801
|
case IntegrationNames.Mailchimp: {
|
|
841
802
|
localStorage.removeItem(`mailchimp.token`);
|
|
842
803
|
localStorage.removeItem(`mailchimp.server`);
|
|
@@ -912,9 +873,6 @@ function AuthProvider({ children }) {
|
|
|
912
873
|
if (state.vercel.raw.token) {
|
|
913
874
|
updateVercelClient(state.vercel.raw.token);
|
|
914
875
|
}
|
|
915
|
-
if (state.neon.raw.token) {
|
|
916
|
-
updateNeonClient(state.neon.raw.token);
|
|
917
|
-
}
|
|
918
876
|
if (state.mailchimp.raw.token) {
|
|
919
877
|
updateMailchimpClient(state.mailchimp.raw.token);
|
|
920
878
|
}
|
|
@@ -934,7 +892,6 @@ function AuthProvider({ children }) {
|
|
|
934
892
|
github: state.github.raw,
|
|
935
893
|
netlify: state.netlify.raw,
|
|
936
894
|
vercel: state.vercel.raw,
|
|
937
|
-
neon: state.neon.raw,
|
|
938
895
|
mailchimp: state.mailchimp.raw,
|
|
939
896
|
shopify: state.shopify.raw,
|
|
940
897
|
hubspot: state.hubspot.raw,
|
|
@@ -957,11 +914,6 @@ function AuthProvider({ children }) {
|
|
|
957
914
|
isAuthorized: Boolean(prevState.vercel.raw.token)
|
|
958
915
|
})
|
|
959
916
|
}),
|
|
960
|
-
neon: __spreadProps(__spreadValues({}, prevState.neon), {
|
|
961
|
-
data: __spreadProps(__spreadValues({}, prevState.neon.data), {
|
|
962
|
-
isAuthorized: Boolean(prevState.neon.raw.token)
|
|
963
|
-
})
|
|
964
|
-
}),
|
|
965
917
|
mailchimp: __spreadProps(__spreadValues({}, prevState.mailchimp), {
|
|
966
918
|
data: __spreadProps(__spreadValues({}, prevState.mailchimp.data), {
|
|
967
919
|
isAuthorized: Boolean(prevState.mailchimp.raw.token) && Boolean(prevState.mailchimp.raw.server)
|
|
@@ -992,7 +944,6 @@ function AuthProvider({ children }) {
|
|
|
992
944
|
state.github.raw,
|
|
993
945
|
state.netlify.raw,
|
|
994
946
|
state.vercel.raw,
|
|
995
|
-
state.neon.raw,
|
|
996
947
|
state.mailchimp.raw,
|
|
997
948
|
state.shopify.raw,
|
|
998
949
|
state.hubspot.raw,
|
|
@@ -1127,7 +1078,6 @@ function getWorkflowsConfig2() {
|
|
|
1127
1078
|
githubOauthClientId: isProd ? "ebbb08fa2c26d3e7911d" : "bcffd61bd0edd23bca45",
|
|
1128
1079
|
hubpotClientId: isProd ? "0ea9fd9a-711f-46c5-b2d3-2eded08c9e4e" : "9364c554-2d76-4bd8-afe0-a376779391fb",
|
|
1129
1080
|
mailchimpClientId: isProd ? "422176034316" : "909176593632",
|
|
1130
|
-
neonClientId: isProd ? "textdotcom" : "textdotcom",
|
|
1131
1081
|
netlifyClientId: isProd ? "qUoHYb2DdVwKxot9Gc7URTdsZQYHYaumykjkv5K3_Mw" : "vDmNXNN9rTkZJtCwOHot2IKOherrm8t7gGA5kStotlo",
|
|
1132
1082
|
shopifyClientId: isProd ? "8eea1c48bad9a2172515036a332ee612" : "406be223b8445696dfe64d86c17eb3ed",
|
|
1133
1083
|
vercelClientId: isProd ? "oac_0nV7q5jDmCQKqpwEdGljaaLp" : "oac_bgwv72AO8fJWj8I9qIROY7wI",
|
|
@@ -25537,11 +25487,6 @@ import {
|
|
|
25537
25487
|
useRootContext as useRootContext16,
|
|
25538
25488
|
View as View3
|
|
25539
25489
|
} from "@livechat/developer-studio-ui-react";
|
|
25540
|
-
|
|
25541
|
-
// src/assets/flows/workflows-presentation.png
|
|
25542
|
-
var workflows_presentation_default = "./workflows-presentation-EFFOQNV2.png";
|
|
25543
|
-
|
|
25544
|
-
// src/views/Flows/Waitlist/index.tsx
|
|
25545
25490
|
var config13 = getWorkflowsConfig2();
|
|
25546
25491
|
var infoCss = css`
|
|
25547
25492
|
display: flex;
|
|
@@ -25552,12 +25497,22 @@ var infoCss = css`
|
|
|
25552
25497
|
}
|
|
25553
25498
|
`;
|
|
25554
25499
|
var imgContainerCss = css`
|
|
25555
|
-
|
|
25500
|
+
position: relative;
|
|
25556
25501
|
display: flex;
|
|
25557
25502
|
justify-content: center;
|
|
25558
25503
|
margin-top: var(${SpacingToken50.Spacing10});
|
|
25504
|
+
|
|
25505
|
+
img {
|
|
25506
|
+
height: auto;
|
|
25507
|
+
max-width: 100%;
|
|
25508
|
+
margin-bottom: var(${SpacingToken50.Spacing10});
|
|
25509
|
+
|
|
25510
|
+
@media (min-width: 1080px) {
|
|
25511
|
+
margin-bottom: 0;
|
|
25512
|
+
}
|
|
25513
|
+
}
|
|
25559
25514
|
`;
|
|
25560
|
-
|
|
25515
|
+
function Waitlist({ image }) {
|
|
25561
25516
|
const {
|
|
25562
25517
|
userData: { user, isLoading }
|
|
25563
25518
|
} = useRootContext16();
|
|
@@ -25572,52 +25527,52 @@ var Waitlist = () => {
|
|
|
25572
25527
|
return /* @__PURE__ */ jsx4(Loader11, { stretch: true });
|
|
25573
25528
|
}
|
|
25574
25529
|
return /* @__PURE__ */ jsxs2(View3, { children: [
|
|
25575
|
-
/* @__PURE__ */ jsx4(Row25, {
|
|
25530
|
+
/* @__PURE__ */ jsx4(Row25, { noMaxWidth: true, topMargin: true, verticalCenter: true, children: /* @__PURE__ */ jsx4(Column18, { center: true, children: /* @__PURE__ */ jsx4(
|
|
25576
25531
|
Intro5,
|
|
25577
25532
|
{
|
|
25533
|
+
body: "No-code setup to streamline tasks you would otherwise do manually",
|
|
25534
|
+
center: true,
|
|
25578
25535
|
header: /* @__PURE__ */ jsx4(Column18, { notPadded: true, stretch: true, width: 4, children: /* @__PURE__ */ jsx4(
|
|
25579
25536
|
Row25,
|
|
25580
25537
|
{
|
|
25581
|
-
notPadded: true,
|
|
25582
|
-
verticalCenter: true,
|
|
25583
25538
|
center: true,
|
|
25584
25539
|
gap: `var(${SpacingToken50.Spacing2})`,
|
|
25540
|
+
notPadded: true,
|
|
25541
|
+
verticalCenter: true,
|
|
25585
25542
|
children: "Connect all of your tools and fully automate manual, routine tasks."
|
|
25586
25543
|
}
|
|
25587
25544
|
) }),
|
|
25588
|
-
body: "No-code setup to streamline tasks you would otherwise do manually",
|
|
25589
|
-
center: true,
|
|
25590
25545
|
noMaxWidth: true
|
|
25591
25546
|
}
|
|
25592
25547
|
) }) }),
|
|
25593
|
-
/* @__PURE__ */ jsxs2(Row25, {
|
|
25548
|
+
/* @__PURE__ */ jsxs2(Row25, { gap: 8, noMaxWidth: true, topMargin: true, verticalCenter: true, children: [
|
|
25594
25549
|
/* @__PURE__ */ jsx4(
|
|
25595
25550
|
Button39,
|
|
25596
25551
|
{
|
|
25597
|
-
kind: "high-contrast",
|
|
25598
|
-
href: config13.platformUrl + "/workflows#join",
|
|
25599
25552
|
css: css`
|
|
25600
25553
|
&:hover {
|
|
25601
25554
|
color: var(${DesignToken50.ContentInvertPrimary});
|
|
25602
25555
|
}
|
|
25603
25556
|
`,
|
|
25604
|
-
|
|
25557
|
+
href: `${config13.platformUrl}/workflows#join`,
|
|
25558
|
+
kind: "high-contrast",
|
|
25605
25559
|
rel: "noopener noreferrer",
|
|
25560
|
+
target: "_blank",
|
|
25606
25561
|
children: "Join waitlist"
|
|
25607
25562
|
}
|
|
25608
25563
|
),
|
|
25609
25564
|
/* @__PURE__ */ jsx4(
|
|
25610
25565
|
Button39,
|
|
25611
25566
|
{
|
|
25567
|
+
href: `${config13.platformUrl}/workflows`,
|
|
25612
25568
|
kind: "plain",
|
|
25613
|
-
href: config13.platformUrl + "/workflows",
|
|
25614
|
-
target: "_blank",
|
|
25615
25569
|
rel: "noopener noreferrer",
|
|
25570
|
+
target: "_blank",
|
|
25616
25571
|
children: "Learn more"
|
|
25617
25572
|
}
|
|
25618
25573
|
)
|
|
25619
25574
|
] }),
|
|
25620
|
-
/* @__PURE__ */ jsxs2(Row25, {
|
|
25575
|
+
/* @__PURE__ */ jsxs2(Row25, { gap: 8, lowMargin: true, noMaxWidth: true, topMargin: true, verticalCenter: true, children: [
|
|
25621
25576
|
/* @__PURE__ */ jsxs2(Text29, { css: infoCss, size: "lg", children: [
|
|
25622
25577
|
/* @__PURE__ */ jsx4(Icon45, { source: CheckCircle8 }),
|
|
25623
25578
|
"integrated with popular platforms"
|
|
@@ -25631,39 +25586,29 @@ var Waitlist = () => {
|
|
|
25631
25586
|
"build with ready-made blocks"
|
|
25632
25587
|
] })
|
|
25633
25588
|
] }),
|
|
25634
|
-
/* @__PURE__ */ jsx4(Row25, { center: true,
|
|
25635
|
-
"img",
|
|
25636
|
-
{
|
|
25637
|
-
alt: "waitlist",
|
|
25638
|
-
src: workflows_presentation_default,
|
|
25639
|
-
css: css`
|
|
25640
|
-
height: 460px;
|
|
25641
|
-
margin-bottom: var(${SpacingToken50.Spacing7});
|
|
25642
|
-
`
|
|
25643
|
-
}
|
|
25644
|
-
) }) }) })
|
|
25589
|
+
/* @__PURE__ */ jsx4(Row25, { center: true, noMaxWidth: true, verticalCenter: true, children: /* @__PURE__ */ jsx4(Column18, { center: true, width: 5, children: /* @__PURE__ */ jsx4("div", { css: imgContainerCss, children: image }) }) })
|
|
25645
25590
|
] });
|
|
25646
|
-
}
|
|
25591
|
+
}
|
|
25647
25592
|
var Waitlist_default = Waitlist;
|
|
25648
25593
|
|
|
25649
25594
|
// src/views/Flows/index.tsx
|
|
25650
25595
|
import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
25651
|
-
|
|
25596
|
+
function Flows({ waitlistImage }) {
|
|
25652
25597
|
return /* @__PURE__ */ jsxs12(Routes6, { children: [
|
|
25653
|
-
/* @__PURE__ */ jsx24(Route6, {
|
|
25654
|
-
/* @__PURE__ */ jsx24(Route6, {
|
|
25598
|
+
/* @__PURE__ */ jsx24(Route6, { element: /* @__PURE__ */ jsx24(Definitions_default, {}), path: "*" }),
|
|
25599
|
+
/* @__PURE__ */ jsx24(Route6, { element: /* @__PURE__ */ jsx24(Waitlist_default, { image: waitlistImage }), path: "/waitlist" })
|
|
25655
25600
|
] });
|
|
25656
|
-
}
|
|
25601
|
+
}
|
|
25657
25602
|
var Flows_default = Flows;
|
|
25658
25603
|
|
|
25659
25604
|
// src/views/Settings/index.tsx
|
|
25660
|
-
import { Navigate as
|
|
25605
|
+
import { Navigate as Navigate12, Route as Route17, Routes as Routes17 } from "react-router-dom";
|
|
25661
25606
|
|
|
25662
25607
|
// src/views/Settings/Integrations/index.tsx
|
|
25663
25608
|
import {
|
|
25664
|
-
Navigate as
|
|
25665
|
-
Route as
|
|
25666
|
-
Routes as
|
|
25609
|
+
Navigate as Navigate11,
|
|
25610
|
+
Route as Route16,
|
|
25611
|
+
Routes as Routes16,
|
|
25667
25612
|
useLocation as useLocation12,
|
|
25668
25613
|
useNavigate as useNavigate22
|
|
25669
25614
|
} from "react-router-dom";
|
|
@@ -25672,8 +25617,8 @@ import {
|
|
|
25672
25617
|
SideNavigationItem
|
|
25673
25618
|
} from "@livechat/design-system-react-components";
|
|
25674
25619
|
import {
|
|
25675
|
-
IntegrationDisplayNames as
|
|
25676
|
-
IntegrationNames as
|
|
25620
|
+
IntegrationDisplayNames as IntegrationDisplayNames15,
|
|
25621
|
+
IntegrationNames as IntegrationNames44
|
|
25677
25622
|
} from "@livechat/developer-studio-api";
|
|
25678
25623
|
import { useRootContext as useRootContext29 } from "@livechat/developer-studio-ui-react";
|
|
25679
25624
|
|
|
@@ -27057,257 +27002,17 @@ var MailchimpIntegration = () => {
|
|
|
27057
27002
|
};
|
|
27058
27003
|
var Mailchimp_default2 = MailchimpIntegration;
|
|
27059
27004
|
|
|
27060
|
-
// src/views/Settings/Integrations/
|
|
27005
|
+
// src/views/Settings/Integrations/Netlify/index.tsx
|
|
27061
27006
|
import { Navigate as Navigate7, Route as Route12, Routes as Routes12 } from "react-router-dom";
|
|
27062
27007
|
|
|
27063
|
-
// src/views/Settings/Integrations/
|
|
27008
|
+
// src/views/Settings/Integrations/Netlify/Action.tsx
|
|
27064
27009
|
import { useContext as useContext30 } from "react";
|
|
27065
27010
|
import {
|
|
27066
27011
|
IntegrationModes as IntegrationModes8,
|
|
27067
27012
|
IntegrationNames as IntegrationNames36
|
|
27068
27013
|
} from "@livechat/developer-studio-api";
|
|
27069
|
-
import { useMatch as useMatch12 } from "@livechat/developer-studio-ui-react";
|
|
27070
|
-
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
27071
|
-
var NeonAction = (props) => {
|
|
27072
|
-
var _a;
|
|
27073
|
-
const { login } = useContext30(AuthContext);
|
|
27074
|
-
const match2 = useMatch12();
|
|
27075
|
-
const action = (_a = props.action) != null ? _a : match2.params.action;
|
|
27076
|
-
if (!action) {
|
|
27077
|
-
throw new Error("Invalid action");
|
|
27078
|
-
}
|
|
27079
|
-
return /* @__PURE__ */ jsx36(
|
|
27080
|
-
IntegrationAction_default,
|
|
27081
|
-
{
|
|
27082
|
-
name: IntegrationNames36.Neon,
|
|
27083
|
-
action,
|
|
27084
|
-
data: props.data,
|
|
27085
|
-
context: props.context,
|
|
27086
|
-
serializedData: match2.params.data,
|
|
27087
|
-
serializedContext: match2.params.context,
|
|
27088
|
-
executor: props.executor,
|
|
27089
|
-
trigger: {
|
|
27090
|
-
mode: IntegrationModes8.Modal,
|
|
27091
|
-
handler: (output) => {
|
|
27092
|
-
var _a2;
|
|
27093
|
-
return neonActionHandlers(login, (_a2 = props.data) == null ? void 0 : _a2.setIsActionLoading)[action](output);
|
|
27094
|
-
}
|
|
27095
|
-
},
|
|
27096
|
-
onSuccess: props.onSuccess
|
|
27097
|
-
}
|
|
27098
|
-
);
|
|
27099
|
-
};
|
|
27100
|
-
var neonActionHandlers = (login, setIsActionLoading) => {
|
|
27101
|
-
const handlers = {
|
|
27102
|
-
authorize: (output) => {
|
|
27103
|
-
setIsActionLoading == null ? void 0 : setIsActionLoading(false);
|
|
27104
|
-
if (output.status === "success" && output.result.token) {
|
|
27105
|
-
login({
|
|
27106
|
-
source: IntegrationNames36.Neon,
|
|
27107
|
-
data: { token: output.result.token }
|
|
27108
|
-
});
|
|
27109
|
-
return {
|
|
27110
|
-
isValid: true,
|
|
27111
|
-
result: output.result
|
|
27112
|
-
};
|
|
27113
|
-
}
|
|
27114
|
-
return {
|
|
27115
|
-
isValid: false
|
|
27116
|
-
};
|
|
27117
|
-
}
|
|
27118
|
-
};
|
|
27119
|
-
return handlers;
|
|
27120
|
-
};
|
|
27121
|
-
var Action_default7 = NeonAction;
|
|
27122
|
-
|
|
27123
|
-
// src/views/Settings/Integrations/Neon/Callback.tsx
|
|
27124
|
-
import { useContext as useContext31 } from "react";
|
|
27125
|
-
import { useMatch as useMatch13 } from "@livechat/developer-studio-ui-react";
|
|
27126
|
-
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
27127
|
-
var NeonCallback = () => {
|
|
27128
|
-
const { login } = useContext31(AuthContext);
|
|
27129
|
-
const match2 = useMatch13();
|
|
27130
|
-
const action = match2.params.action;
|
|
27131
|
-
if (!action) {
|
|
27132
|
-
throw new Error("Invalid action");
|
|
27133
|
-
}
|
|
27134
|
-
return /* @__PURE__ */ jsx37(
|
|
27135
|
-
IntegrationCallback_default,
|
|
27136
|
-
{
|
|
27137
|
-
handler: (output) => neonActionHandlers(login)[action](output)
|
|
27138
|
-
}
|
|
27139
|
-
);
|
|
27140
|
-
};
|
|
27141
|
-
var Callback_default6 = NeonCallback;
|
|
27142
|
-
|
|
27143
|
-
// src/views/Settings/Integrations/Neon/Status.tsx
|
|
27144
|
-
import { useCallback as useCallback31 } from "react";
|
|
27145
|
-
import { Delete as Delete10 } from "@livechat/design-system-icons";
|
|
27146
|
-
import { Button as Button45, Icon as Icon51 } from "@livechat/design-system-react-components";
|
|
27147
|
-
import {
|
|
27148
|
-
IntegrationDisplayNames as IntegrationDisplayNames11
|
|
27149
|
-
} from "@livechat/developer-studio-api";
|
|
27150
|
-
import { Neon as NeonIcon } from "@livechat/developer-studio-ui-react";
|
|
27151
|
-
|
|
27152
|
-
// src/hooks/integrations/neon/credentials.ts
|
|
27153
|
-
import {
|
|
27154
|
-
IntegrationNames as IntegrationNames37
|
|
27155
|
-
} from "@livechat/developer-studio-api";
|
|
27156
|
-
var useFetchNeonCredentials = () => {
|
|
27157
|
-
var _a, _b;
|
|
27158
|
-
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
27159
|
-
IntegrationNames37.Neon
|
|
27160
|
-
);
|
|
27161
|
-
const oauthCredential = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
27162
|
-
(credential) => credential.type === "oauth2" && credential.data.client_id === getWorkflowEnv("neonClientId")
|
|
27163
|
-
);
|
|
27164
|
-
const otherCredentials = (_b = credentialsQuery.data) == null ? void 0 : _b.filter(
|
|
27165
|
-
(credential) => credential !== oauthCredential
|
|
27166
|
-
);
|
|
27167
|
-
return __spreadProps(__spreadValues({}, credentialsQuery), {
|
|
27168
|
-
data: {
|
|
27169
|
-
internal: oauthCredential,
|
|
27170
|
-
other: otherCredentials
|
|
27171
|
-
}
|
|
27172
|
-
});
|
|
27173
|
-
};
|
|
27174
|
-
|
|
27175
|
-
// src/hooks/integrations/neon/databases.ts
|
|
27176
|
-
import { useContext as useContext32 } from "react";
|
|
27177
|
-
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
27178
|
-
import {
|
|
27179
|
-
api as api8,
|
|
27180
|
-
IntegrationNames as IntegrationNames38,
|
|
27181
|
-
UnauthorizeApiError as UnauthorizeApiError4
|
|
27182
|
-
} from "@livechat/developer-studio-api";
|
|
27183
|
-
|
|
27184
|
-
// src/hooks/integrations/neon/projects.ts
|
|
27185
|
-
import { useContext as useContext33 } from "react";
|
|
27186
|
-
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
27187
|
-
import {
|
|
27188
|
-
api as api9,
|
|
27189
|
-
IntegrationNames as IntegrationNames39,
|
|
27190
|
-
UnauthorizeApiError as UnauthorizeApiError5
|
|
27191
|
-
} from "@livechat/developer-studio-api";
|
|
27192
|
-
|
|
27193
|
-
// src/hooks/integrations/neon/user.ts
|
|
27194
|
-
import { useContext as useContext34 } from "react";
|
|
27195
|
-
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
|
27196
27014
|
import {
|
|
27197
|
-
|
|
27198
|
-
IntegrationNames as IntegrationNames40,
|
|
27199
|
-
UnauthorizeApiError as UnauthorizeApiError6
|
|
27200
|
-
} from "@livechat/developer-studio-api";
|
|
27201
|
-
|
|
27202
|
-
// src/views/Settings/Integrations/Neon/Status.tsx
|
|
27203
|
-
var NeonStatus = () => {
|
|
27204
|
-
const credentialsQuery = useFetchNeonCredentials();
|
|
27205
|
-
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
27206
|
-
const refetch = useCallback31(() => {
|
|
27207
|
-
credentialsQuery.refetch();
|
|
27208
|
-
}, [credentialsQuery]);
|
|
27209
|
-
const oauthCredential = credentialsQuery.data.internal;
|
|
27210
|
-
const otherCredentials = credentialsQuery.data.other;
|
|
27211
|
-
const Connect = useCallback31(
|
|
27212
|
-
({ credential }) => /* @__PURE__ */ jsx4(
|
|
27213
|
-
Action_default7,
|
|
27214
|
-
{
|
|
27215
|
-
action: "authorize",
|
|
27216
|
-
executor: {
|
|
27217
|
-
type: "manual",
|
|
27218
|
-
render: (confirm) => /* @__PURE__ */ jsx4(
|
|
27219
|
-
Button45,
|
|
27220
|
-
{
|
|
27221
|
-
kind: (credential == null ? void 0 : credential.data.connected) ? "secondary" : "primary",
|
|
27222
|
-
onClick: confirm,
|
|
27223
|
-
iconPosition: "right",
|
|
27224
|
-
"data-cy": "neon-connect-button",
|
|
27225
|
-
children: (credential == null ? void 0 : credential.data.connected) ? "Reconnect" : "Connect"
|
|
27226
|
-
}
|
|
27227
|
-
)
|
|
27228
|
-
},
|
|
27229
|
-
data: {
|
|
27230
|
-
redirectTo: {
|
|
27231
|
-
success: "/settings/integrations/neon/status"
|
|
27232
|
-
}
|
|
27233
|
-
},
|
|
27234
|
-
context: {
|
|
27235
|
-
credentialId: credential == null ? void 0 : credential.name
|
|
27236
|
-
},
|
|
27237
|
-
onSuccess: refetch
|
|
27238
|
-
}
|
|
27239
|
-
),
|
|
27240
|
-
[refetch]
|
|
27241
|
-
);
|
|
27242
|
-
return /* @__PURE__ */ jsxs2(
|
|
27243
|
-
IntegrationStatus_default,
|
|
27244
|
-
{
|
|
27245
|
-
title: IntegrationDisplayNames11.Neon,
|
|
27246
|
-
subtitle: `${IntegrationDisplayNames11.Neon} integration`,
|
|
27247
|
-
header: `${IntegrationDisplayNames11.Neon} integration`,
|
|
27248
|
-
description: "Integrate Developer Console with Neon to enjoy simplified web development with a platform for storing your apps data. Experience faster, scalable, and more secure workflow.",
|
|
27249
|
-
icon: /* @__PURE__ */ jsx4(NeonIcon, {}),
|
|
27250
|
-
dataCy: "neon-integration-component",
|
|
27251
|
-
children: [
|
|
27252
|
-
/* @__PURE__ */ jsx4(
|
|
27253
|
-
IntegrationStatusRow,
|
|
27254
|
-
{
|
|
27255
|
-
title: "Text Platform | Developer Console",
|
|
27256
|
-
isConnected: Boolean(oauthCredential == null ? void 0 : oauthCredential.data.connected),
|
|
27257
|
-
isLoading: credentialsQuery.isFetching,
|
|
27258
|
-
icon: /* @__PURE__ */ jsx4(NeonIcon, {}),
|
|
27259
|
-
action: !credentialsQuery.isFetching ? /* @__PURE__ */ jsx4(Connect, { credential: oauthCredential }) : void 0,
|
|
27260
|
-
status: !credentialsQuery.isFetching && (oauthCredential == null ? void 0 : oauthCredential.name) ? /* @__PURE__ */ jsx4(
|
|
27261
|
-
Button45,
|
|
27262
|
-
{
|
|
27263
|
-
size: "xcompact",
|
|
27264
|
-
icon: /* @__PURE__ */ jsx4(Icon51, { source: Delete10, size: "small" }),
|
|
27265
|
-
onClick: () => {
|
|
27266
|
-
if (oauthCredential.name) {
|
|
27267
|
-
removeCredentialMutation.mutateAsync(oauthCredential);
|
|
27268
|
-
}
|
|
27269
|
-
},
|
|
27270
|
-
kind: "plain"
|
|
27271
|
-
}
|
|
27272
|
-
) : void 0
|
|
27273
|
-
}
|
|
27274
|
-
),
|
|
27275
|
-
!credentialsQuery.isFetching && (otherCredentials == null ? void 0 : otherCredentials.length) ? /* @__PURE__ */ jsx4(
|
|
27276
|
-
IntegrationStatusCredentials,
|
|
27277
|
-
{
|
|
27278
|
-
credentials: otherCredentials.filter(Boolean),
|
|
27279
|
-
trigger: Connect
|
|
27280
|
-
}
|
|
27281
|
-
) : void 0
|
|
27282
|
-
]
|
|
27283
|
-
}
|
|
27284
|
-
);
|
|
27285
|
-
};
|
|
27286
|
-
var Status_default5 = NeonStatus;
|
|
27287
|
-
|
|
27288
|
-
// src/views/Settings/Integrations/Neon/index.tsx
|
|
27289
|
-
import { jsx as jsx38, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
27290
|
-
var NeonIntegration = () => {
|
|
27291
|
-
return /* @__PURE__ */ jsxs18(Routes12, { children: [
|
|
27292
|
-
/* @__PURE__ */ jsx38(Route12, { path: "/", element: /* @__PURE__ */ jsx38(Navigate7, { to: "status", replace: true }) }),
|
|
27293
|
-
/* @__PURE__ */ jsx38(Route12, { path: "/status", element: /* @__PURE__ */ jsx38(Status_default5, {}) }),
|
|
27294
|
-
/* @__PURE__ */ jsx38(Route12, { path: "/action/:action/:data?/:context?", element: /* @__PURE__ */ jsx38(Action_default7, {}) }),
|
|
27295
|
-
/* @__PURE__ */ jsx38(Route12, { path: "/callback/:action", element: /* @__PURE__ */ jsx38(Callback_default6, {}) })
|
|
27296
|
-
] });
|
|
27297
|
-
};
|
|
27298
|
-
var Neon_default = NeonIntegration;
|
|
27299
|
-
|
|
27300
|
-
// src/views/Settings/Integrations/Netlify/index.tsx
|
|
27301
|
-
import { Navigate as Navigate8, Route as Route13, Routes as Routes13 } from "react-router-dom";
|
|
27302
|
-
|
|
27303
|
-
// src/views/Settings/Integrations/Netlify/Action.tsx
|
|
27304
|
-
import { useContext as useContext35 } from "react";
|
|
27305
|
-
import {
|
|
27306
|
-
IntegrationModes as IntegrationModes9,
|
|
27307
|
-
IntegrationNames as IntegrationNames41
|
|
27308
|
-
} from "@livechat/developer-studio-api";
|
|
27309
|
-
import {
|
|
27310
|
-
useMatch as useMatch14,
|
|
27015
|
+
useMatch as useMatch12,
|
|
27311
27016
|
useRootContext as useRootContext21
|
|
27312
27017
|
} from "@livechat/developer-studio-ui-react";
|
|
27313
27018
|
|
|
@@ -27425,11 +27130,11 @@ var appDeploymentBlockAmplitudeJourneyFactory = (email) => ({
|
|
|
27425
27130
|
});
|
|
27426
27131
|
|
|
27427
27132
|
// src/views/Settings/Integrations/Netlify/Action.tsx
|
|
27428
|
-
import { jsx as
|
|
27133
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
27429
27134
|
var NetlifyAction = (props) => {
|
|
27430
27135
|
var _a;
|
|
27431
|
-
const { login } =
|
|
27432
|
-
const match2 =
|
|
27136
|
+
const { login } = useContext30(AuthContext);
|
|
27137
|
+
const match2 = useMatch12();
|
|
27433
27138
|
const {
|
|
27434
27139
|
userData: { user }
|
|
27435
27140
|
} = useRootContext21();
|
|
@@ -27437,10 +27142,10 @@ var NetlifyAction = (props) => {
|
|
|
27437
27142
|
if (!action) {
|
|
27438
27143
|
throw new Error("Invalid action");
|
|
27439
27144
|
}
|
|
27440
|
-
return /* @__PURE__ */
|
|
27145
|
+
return /* @__PURE__ */ jsx36(
|
|
27441
27146
|
IntegrationAction_default,
|
|
27442
27147
|
{
|
|
27443
|
-
name:
|
|
27148
|
+
name: IntegrationNames36.Netlify,
|
|
27444
27149
|
action,
|
|
27445
27150
|
data: props.data,
|
|
27446
27151
|
context: props.context,
|
|
@@ -27448,7 +27153,7 @@ var NetlifyAction = (props) => {
|
|
|
27448
27153
|
serializedContext: match2.params.context,
|
|
27449
27154
|
executor: props.executor,
|
|
27450
27155
|
trigger: {
|
|
27451
|
-
mode:
|
|
27156
|
+
mode: IntegrationModes8.Modal,
|
|
27452
27157
|
handler: (output) => netlifyActionHandlers(login, user == null ? void 0 : user.meta.email)[action](output)
|
|
27453
27158
|
},
|
|
27454
27159
|
onSuccess: props.onSuccess
|
|
@@ -27458,9 +27163,9 @@ var NetlifyAction = (props) => {
|
|
|
27458
27163
|
function triggerNetlifyAction(props, meta) {
|
|
27459
27164
|
return executeIntegrationAction(
|
|
27460
27165
|
__spreadProps(__spreadValues({}, props), {
|
|
27461
|
-
name:
|
|
27166
|
+
name: IntegrationNames36.Netlify,
|
|
27462
27167
|
trigger: {
|
|
27463
|
-
mode:
|
|
27168
|
+
mode: IntegrationModes8.Modal,
|
|
27464
27169
|
handler: (output) => netlifyActionHandlers(
|
|
27465
27170
|
meta.login,
|
|
27466
27171
|
meta.user.meta.email
|
|
@@ -27476,10 +27181,10 @@ var netlifyActionHandlers = (login, email) => {
|
|
|
27476
27181
|
authorize: (output) => {
|
|
27477
27182
|
if (output.status === "success" && output.result.token) {
|
|
27478
27183
|
amplitudeDeploymentJourney.app.deployment.actions.authorize.success(
|
|
27479
|
-
|
|
27184
|
+
IntegrationNames36.Netlify
|
|
27480
27185
|
);
|
|
27481
27186
|
login({
|
|
27482
|
-
source:
|
|
27187
|
+
source: IntegrationNames36.Netlify,
|
|
27483
27188
|
data: { token: output.result.token }
|
|
27484
27189
|
});
|
|
27485
27190
|
return {
|
|
@@ -27500,7 +27205,7 @@ var netlifyActionHandlers = (login, email) => {
|
|
|
27500
27205
|
install: (output) => {
|
|
27501
27206
|
if (output.status === "success" && output.result.installationId) {
|
|
27502
27207
|
amplitudeDeploymentJourney.app.deployment.actions.install.success(
|
|
27503
|
-
|
|
27208
|
+
IntegrationNames36.Netlify
|
|
27504
27209
|
);
|
|
27505
27210
|
return {
|
|
27506
27211
|
isValid: true,
|
|
@@ -27515,15 +27220,15 @@ var netlifyActionHandlers = (login, email) => {
|
|
|
27515
27220
|
};
|
|
27516
27221
|
return handlers;
|
|
27517
27222
|
};
|
|
27518
|
-
var
|
|
27223
|
+
var Action_default7 = NetlifyAction;
|
|
27519
27224
|
|
|
27520
27225
|
// src/views/Settings/Integrations/Netlify/Callback.tsx
|
|
27521
|
-
import { useContext as
|
|
27522
|
-
import { useMatch as
|
|
27523
|
-
import { jsx as
|
|
27226
|
+
import { useContext as useContext31 } from "react";
|
|
27227
|
+
import { useMatch as useMatch13, useRootContext as useRootContext22 } from "@livechat/developer-studio-ui-react";
|
|
27228
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
27524
27229
|
var NetlifyCallback = () => {
|
|
27525
|
-
const match2 =
|
|
27526
|
-
const { login } =
|
|
27230
|
+
const match2 = useMatch13();
|
|
27231
|
+
const { login } = useContext31(AuthContext);
|
|
27527
27232
|
const action = match2.params.action;
|
|
27528
27233
|
const {
|
|
27529
27234
|
userData: { user }
|
|
@@ -27531,28 +27236,28 @@ var NetlifyCallback = () => {
|
|
|
27531
27236
|
if (!action) {
|
|
27532
27237
|
throw new Error("Invalid action");
|
|
27533
27238
|
}
|
|
27534
|
-
return /* @__PURE__ */
|
|
27239
|
+
return /* @__PURE__ */ jsx37(
|
|
27535
27240
|
IntegrationCallback_default,
|
|
27536
27241
|
{
|
|
27537
27242
|
handler: (output) => netlifyActionHandlers(login, user == null ? void 0 : user.meta.email)[action](output)
|
|
27538
27243
|
}
|
|
27539
27244
|
);
|
|
27540
27245
|
};
|
|
27541
|
-
var
|
|
27246
|
+
var Callback_default6 = NetlifyCallback;
|
|
27542
27247
|
|
|
27543
27248
|
// src/views/Settings/Integrations/Netlify/Status.tsx
|
|
27544
|
-
import { Fragment as Fragment42, useCallback as
|
|
27545
|
-
import { ChevronDown as ChevronDown5, ChevronUp as ChevronUp3, Delete as
|
|
27249
|
+
import { Fragment as Fragment42, useCallback as useCallback31, useContext as useContext33, useEffect as useEffect25, useState as useState42 } from "react";
|
|
27250
|
+
import { ChevronDown as ChevronDown5, ChevronUp as ChevronUp3, Delete as Delete10 } from "@livechat/design-system-icons";
|
|
27546
27251
|
import {
|
|
27547
27252
|
ActionMenu as ActionMenu8,
|
|
27548
|
-
Button as
|
|
27253
|
+
Button as Button45,
|
|
27549
27254
|
DesignToken as DesignToken54,
|
|
27550
|
-
Icon as
|
|
27255
|
+
Icon as Icon51,
|
|
27551
27256
|
SpacingToken as SpacingToken55
|
|
27552
27257
|
} from "@livechat/design-system-react-components";
|
|
27553
27258
|
import {
|
|
27554
|
-
IntegrationDisplayNames as
|
|
27555
|
-
IntegrationNames as
|
|
27259
|
+
IntegrationDisplayNames as IntegrationDisplayNames11,
|
|
27260
|
+
IntegrationNames as IntegrationNames39
|
|
27556
27261
|
} from "@livechat/developer-studio-api";
|
|
27557
27262
|
import {
|
|
27558
27263
|
Netlify as NetlifyIcon,
|
|
@@ -27563,12 +27268,12 @@ import {
|
|
|
27563
27268
|
|
|
27564
27269
|
// src/hooks/integrations/netlify/credentials.ts
|
|
27565
27270
|
import {
|
|
27566
|
-
IntegrationNames as
|
|
27271
|
+
IntegrationNames as IntegrationNames37
|
|
27567
27272
|
} from "@livechat/developer-studio-api";
|
|
27568
27273
|
var useFetchNetlifyCredentials = () => {
|
|
27569
27274
|
var _a, _b;
|
|
27570
27275
|
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
27571
|
-
|
|
27276
|
+
IntegrationNames37.Netlify
|
|
27572
27277
|
);
|
|
27573
27278
|
const oauthCredential = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
27574
27279
|
(credential) => credential.type === "oauth2" && credential.data.client_id === getWorkflowEnv("netlifyClientId")
|
|
@@ -27585,26 +27290,26 @@ var useFetchNetlifyCredentials = () => {
|
|
|
27585
27290
|
};
|
|
27586
27291
|
|
|
27587
27292
|
// src/hooks/integrations/netlify/site.ts
|
|
27588
|
-
import { useContext as
|
|
27589
|
-
import { useQuery as
|
|
27293
|
+
import { useContext as useContext32 } from "react";
|
|
27294
|
+
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
27590
27295
|
import {
|
|
27591
|
-
api as
|
|
27592
|
-
IntegrationNames as
|
|
27593
|
-
UnauthorizeApiError as
|
|
27296
|
+
api as api8,
|
|
27297
|
+
IntegrationNames as IntegrationNames38,
|
|
27298
|
+
UnauthorizeApiError as UnauthorizeApiError4
|
|
27594
27299
|
} from "@livechat/developer-studio-api";
|
|
27595
27300
|
var netlifyDeploymentQueryKeys = {
|
|
27596
27301
|
getSites: ["netlify.getSites"]
|
|
27597
27302
|
};
|
|
27598
27303
|
var useFetchNetlifySitesQuery = (isAuthorized) => {
|
|
27599
|
-
const { logout } =
|
|
27600
|
-
return
|
|
27304
|
+
const { logout } = useContext32(AuthContext);
|
|
27305
|
+
return useQuery7(
|
|
27601
27306
|
netlifyDeploymentQueryKeys.getSites,
|
|
27602
|
-
() =>
|
|
27307
|
+
() => api8.integrations.netlify.site.getSites(),
|
|
27603
27308
|
{
|
|
27604
27309
|
retry: false,
|
|
27605
27310
|
onError: (error) => {
|
|
27606
|
-
if (error instanceof
|
|
27607
|
-
logout(
|
|
27311
|
+
if (error instanceof UnauthorizeApiError4) {
|
|
27312
|
+
logout(IntegrationNames38.Netlify);
|
|
27608
27313
|
}
|
|
27609
27314
|
},
|
|
27610
27315
|
enabled: isAuthorized
|
|
@@ -27615,12 +27320,12 @@ var useFetchNetlifySitesQuery = (isAuthorized) => {
|
|
|
27615
27320
|
// src/hooks/state/user/integrations/netlify.ts
|
|
27616
27321
|
import { useMutation as useMutation5, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
|
|
27617
27322
|
import {
|
|
27618
|
-
api as
|
|
27323
|
+
api as api9
|
|
27619
27324
|
} from "@livechat/developer-studio-api";
|
|
27620
27325
|
var useUpdateUserNetlifyIntegrationQuery = () => {
|
|
27621
27326
|
const queryClient = useQueryClient10();
|
|
27622
27327
|
const { mutateAsync: updateUserNetlifyIntegration, isLoading } = useMutation5(
|
|
27623
|
-
(userNetlifyIntegration) =>
|
|
27328
|
+
(userNetlifyIntegration) => api9.platform.dps.user.updateUserNetlifyIntegration(
|
|
27624
27329
|
userNetlifyIntegration
|
|
27625
27330
|
),
|
|
27626
27331
|
{
|
|
@@ -27660,7 +27365,7 @@ var NetlifyStatus = () => {
|
|
|
27660
27365
|
const {
|
|
27661
27366
|
userData: { user }
|
|
27662
27367
|
} = useRootContext23();
|
|
27663
|
-
const { state, login } =
|
|
27368
|
+
const { state, login } = useContext33(AuthContext);
|
|
27664
27369
|
const { context: notifications } = useNotifications13();
|
|
27665
27370
|
const userIntegrationsQuery = useFetchUserIntegrationsQuery();
|
|
27666
27371
|
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
@@ -27671,7 +27376,7 @@ var NetlifyStatus = () => {
|
|
|
27671
27376
|
const amplitudeDeploymentJourney = appDeploymentBlockAmplitudeJourneyFactory(
|
|
27672
27377
|
user == null ? void 0 : user.meta.email
|
|
27673
27378
|
);
|
|
27674
|
-
const refetch =
|
|
27379
|
+
const refetch = useCallback31(() => {
|
|
27675
27380
|
credentialsQuery.refetch();
|
|
27676
27381
|
userIntegrationsQuery.refetch();
|
|
27677
27382
|
sitesQuery.refetch();
|
|
@@ -27690,7 +27395,7 @@ var NetlifyStatus = () => {
|
|
|
27690
27395
|
}
|
|
27691
27396
|
if (!(oauthCredential == null ? void 0 : oauthCredential.data.connected)) {
|
|
27692
27397
|
amplitudeDeploymentJourney.app.deployment.actions.authorize.requested(
|
|
27693
|
-
|
|
27398
|
+
IntegrationNames39.Netlify
|
|
27694
27399
|
);
|
|
27695
27400
|
return;
|
|
27696
27401
|
}
|
|
@@ -27699,7 +27404,7 @@ var NetlifyStatus = () => {
|
|
|
27699
27404
|
}
|
|
27700
27405
|
if (!isInstalled) {
|
|
27701
27406
|
amplitudeDeploymentJourney.app.deployment.actions.install.requested(
|
|
27702
|
-
|
|
27407
|
+
IntegrationNames39.Netlify
|
|
27703
27408
|
);
|
|
27704
27409
|
}
|
|
27705
27410
|
}, [credentialsQuery, oauthCredential, userIntegrationsQuery, isInstalled]);
|
|
@@ -27707,7 +27412,7 @@ var NetlifyStatus = () => {
|
|
|
27707
27412
|
"my-channel",
|
|
27708
27413
|
"my-event",
|
|
27709
27414
|
(data) => {
|
|
27710
|
-
if (data.userId !== (user == null ? void 0 : user.profile.id) || data.integration !==
|
|
27415
|
+
if (data.userId !== (user == null ? void 0 : user.profile.id) || data.integration !== IntegrationNames39.Netlify) {
|
|
27711
27416
|
return;
|
|
27712
27417
|
}
|
|
27713
27418
|
if (data.action === "authorize" || data.action === "install") {
|
|
@@ -27716,21 +27421,21 @@ var NetlifyStatus = () => {
|
|
|
27716
27421
|
},
|
|
27717
27422
|
[refetch]
|
|
27718
27423
|
);
|
|
27719
|
-
const Connect =
|
|
27424
|
+
const Connect = useCallback31(
|
|
27720
27425
|
({ credential }) => /* @__PURE__ */ jsx4(
|
|
27721
|
-
|
|
27426
|
+
Action_default7,
|
|
27722
27427
|
{
|
|
27723
27428
|
action: "authorize",
|
|
27724
27429
|
executor: {
|
|
27725
27430
|
type: "manual",
|
|
27726
27431
|
render: (confirm) => /* @__PURE__ */ jsx4(
|
|
27727
|
-
|
|
27432
|
+
Button45,
|
|
27728
27433
|
{
|
|
27729
27434
|
kind: (credential == null ? void 0 : credential.data.connected) ? "secondary" : "primary",
|
|
27730
27435
|
onClick: () => {
|
|
27731
27436
|
if (!(credential == null ? void 0 : credential.data.connected)) {
|
|
27732
27437
|
amplitudeDeploymentJourney.app.deployment.actions.authorize.click(
|
|
27733
|
-
|
|
27438
|
+
IntegrationNames39.Netlify
|
|
27734
27439
|
);
|
|
27735
27440
|
}
|
|
27736
27441
|
confirm();
|
|
@@ -27755,23 +27460,23 @@ var NetlifyStatus = () => {
|
|
|
27755
27460
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27756
27461
|
[refetch]
|
|
27757
27462
|
);
|
|
27758
|
-
const Install =
|
|
27463
|
+
const Install = useCallback31(
|
|
27759
27464
|
() => {
|
|
27760
27465
|
var _a2;
|
|
27761
27466
|
return /* @__PURE__ */ jsx4(
|
|
27762
|
-
|
|
27467
|
+
Action_default7,
|
|
27763
27468
|
{
|
|
27764
27469
|
action: "install",
|
|
27765
27470
|
executor: {
|
|
27766
27471
|
type: "manual",
|
|
27767
27472
|
render: (confirm) => /* @__PURE__ */ jsx4(
|
|
27768
|
-
|
|
27473
|
+
Button45,
|
|
27769
27474
|
{
|
|
27770
27475
|
kind: userIntegrationsQuery.isLoading ? "text" : isInstalled ? "secondary" : "primary",
|
|
27771
27476
|
loading: userIntegrationsQuery.isLoading,
|
|
27772
27477
|
onClick: () => {
|
|
27773
27478
|
amplitudeDeploymentJourney.app.deployment.actions.install.click(
|
|
27774
|
-
|
|
27479
|
+
IntegrationNames39.Netlify
|
|
27775
27480
|
);
|
|
27776
27481
|
confirm();
|
|
27777
27482
|
},
|
|
@@ -27786,7 +27491,7 @@ var NetlifyStatus = () => {
|
|
|
27786
27491
|
}
|
|
27787
27492
|
},
|
|
27788
27493
|
context: {
|
|
27789
|
-
credentialId:
|
|
27494
|
+
credentialId: IntegrationNames39.Netlify,
|
|
27790
27495
|
token: (_a2 = state.netlify.raw.token) != null ? _a2 : "",
|
|
27791
27496
|
showInstruction: !isInstalled ? true : void 0
|
|
27792
27497
|
},
|
|
@@ -27857,9 +27562,9 @@ var NetlifyStatus = () => {
|
|
|
27857
27562
|
return /* @__PURE__ */ jsxs2(
|
|
27858
27563
|
IntegrationStatus_default,
|
|
27859
27564
|
{
|
|
27860
|
-
title:
|
|
27861
|
-
subtitle: `${
|
|
27862
|
-
header: `${
|
|
27565
|
+
title: IntegrationDisplayNames11.Netlify,
|
|
27566
|
+
subtitle: `${IntegrationDisplayNames11.Netlify} integration`,
|
|
27567
|
+
header: `${IntegrationDisplayNames11.Netlify} integration`,
|
|
27863
27568
|
description: "Integrate Developer Console with Netlify to enjoy simplified web development with a platform for building, deploying, and managing your projects. Experience faster, scalable, and more secure workflow.",
|
|
27864
27569
|
icon: /* @__PURE__ */ jsx4(NetlifyIcon, {}),
|
|
27865
27570
|
dataCy: "netlify-integration-component",
|
|
@@ -27879,13 +27584,13 @@ var NetlifyStatus = () => {
|
|
|
27879
27584
|
visible: isDropdownVisible,
|
|
27880
27585
|
placement: "bottom",
|
|
27881
27586
|
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
27882
|
-
|
|
27587
|
+
Button45,
|
|
27883
27588
|
{
|
|
27884
27589
|
kind: "secondary",
|
|
27885
27590
|
onClick: () => {
|
|
27886
27591
|
setIsDropdownVisible(!isDropdownVisible);
|
|
27887
27592
|
},
|
|
27888
|
-
icon: isDropdownVisible ? /* @__PURE__ */ jsx4(
|
|
27593
|
+
icon: isDropdownVisible ? /* @__PURE__ */ jsx4(Icon51, { source: ChevronUp3 }) : /* @__PURE__ */ jsx4(Icon51, { source: ChevronDown5 }),
|
|
27889
27594
|
iconPosition: "right",
|
|
27890
27595
|
children: "Settings"
|
|
27891
27596
|
}
|
|
@@ -27904,10 +27609,10 @@ var NetlifyStatus = () => {
|
|
|
27904
27609
|
userIntegrationsQuery.isFetching
|
|
27905
27610
|
) : void 0,
|
|
27906
27611
|
/* @__PURE__ */ jsx4(
|
|
27907
|
-
|
|
27612
|
+
Button45,
|
|
27908
27613
|
{
|
|
27909
27614
|
size: "xcompact",
|
|
27910
|
-
icon: /* @__PURE__ */ jsx4(
|
|
27615
|
+
icon: /* @__PURE__ */ jsx4(Icon51, { source: Delete10, size: "small" }),
|
|
27911
27616
|
onClick: () => {
|
|
27912
27617
|
if (oauthCredential.name) {
|
|
27913
27618
|
removeCredentialMutation.mutateAsync(oauthCredential);
|
|
@@ -27943,63 +27648,63 @@ var NetlifyStatus = () => {
|
|
|
27943
27648
|
}
|
|
27944
27649
|
);
|
|
27945
27650
|
};
|
|
27946
|
-
var
|
|
27651
|
+
var Status_default5 = NetlifyStatus;
|
|
27947
27652
|
|
|
27948
27653
|
// src/views/Settings/Integrations/Netlify/index.tsx
|
|
27949
|
-
import { jsx as
|
|
27654
|
+
import { jsx as jsx38, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
27950
27655
|
var NetlifyIntegration = () => {
|
|
27951
|
-
return /* @__PURE__ */
|
|
27952
|
-
/* @__PURE__ */
|
|
27953
|
-
/* @__PURE__ */
|
|
27954
|
-
/* @__PURE__ */
|
|
27955
|
-
|
|
27656
|
+
return /* @__PURE__ */ jsxs18(Routes12, { children: [
|
|
27657
|
+
/* @__PURE__ */ jsx38(Route12, { path: "/", element: /* @__PURE__ */ jsx38(Navigate7, { to: "status", replace: true }) }),
|
|
27658
|
+
/* @__PURE__ */ jsx38(Route12, { path: "/status", element: /* @__PURE__ */ jsx38(Status_default5, {}) }),
|
|
27659
|
+
/* @__PURE__ */ jsx38(
|
|
27660
|
+
Route12,
|
|
27956
27661
|
{
|
|
27957
27662
|
path: "/action/:action/:data?/:context?",
|
|
27958
|
-
element: /* @__PURE__ */
|
|
27663
|
+
element: /* @__PURE__ */ jsx38(Action_default7, {})
|
|
27959
27664
|
}
|
|
27960
27665
|
),
|
|
27961
|
-
/* @__PURE__ */
|
|
27666
|
+
/* @__PURE__ */ jsx38(Route12, { path: "/callback/:action", element: /* @__PURE__ */ jsx38(Callback_default6, {}) })
|
|
27962
27667
|
] });
|
|
27963
27668
|
};
|
|
27964
27669
|
var Netlify_default = NetlifyIntegration;
|
|
27965
27670
|
|
|
27966
27671
|
// src/views/Settings/Integrations/Shopify/index.tsx
|
|
27967
|
-
import { Navigate as
|
|
27672
|
+
import { Navigate as Navigate8, Route as Route13, Routes as Routes13 } from "react-router-dom";
|
|
27968
27673
|
|
|
27969
27674
|
// src/views/Settings/Integrations/Shopify/Callback.tsx
|
|
27970
|
-
import { useContext as
|
|
27971
|
-
import { useMatch as
|
|
27972
|
-
import { jsx as
|
|
27675
|
+
import { useContext as useContext34 } from "react";
|
|
27676
|
+
import { useMatch as useMatch14 } from "@livechat/developer-studio-ui-react";
|
|
27677
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
27973
27678
|
var ShopifyCallback = () => {
|
|
27974
|
-
const { login } =
|
|
27975
|
-
const match2 =
|
|
27679
|
+
const { login } = useContext34(AuthContext);
|
|
27680
|
+
const match2 = useMatch14();
|
|
27976
27681
|
const action = match2.params.action;
|
|
27977
27682
|
if (!action) {
|
|
27978
27683
|
throw new Error("Invalid action");
|
|
27979
27684
|
}
|
|
27980
|
-
return /* @__PURE__ */
|
|
27685
|
+
return /* @__PURE__ */ jsx39(
|
|
27981
27686
|
IntegrationCallback_default,
|
|
27982
27687
|
{
|
|
27983
27688
|
handler: (output) => shopifyActionHandlers(login)[action](output)
|
|
27984
27689
|
}
|
|
27985
27690
|
);
|
|
27986
27691
|
};
|
|
27987
|
-
var
|
|
27692
|
+
var Callback_default7 = ShopifyCallback;
|
|
27988
27693
|
|
|
27989
27694
|
// src/views/Settings/Integrations/Shopify/Status.tsx
|
|
27990
|
-
import { Fragment as Fragment43, useCallback as
|
|
27695
|
+
import { Fragment as Fragment43, useCallback as useCallback32, useContext as useContext35, useState as useState43 } from "react";
|
|
27991
27696
|
import { notificationConnect as notificationConnect3 } from "@livechat/design-system";
|
|
27992
|
-
import { Delete as
|
|
27697
|
+
import { Delete as Delete11, ShopifyColored as ShopifyColored3 } from "@livechat/design-system-icons";
|
|
27993
27698
|
import {
|
|
27994
|
-
Button as
|
|
27699
|
+
Button as Button46,
|
|
27995
27700
|
Form as Form3,
|
|
27996
27701
|
FormField as FormField6,
|
|
27997
|
-
Icon as
|
|
27702
|
+
Icon as Icon52,
|
|
27998
27703
|
Input as Input10,
|
|
27999
27704
|
Modal as Modal13
|
|
28000
27705
|
} from "@livechat/design-system-react-components";
|
|
28001
27706
|
import {
|
|
28002
|
-
IntegrationDisplayNames as
|
|
27707
|
+
IntegrationDisplayNames as IntegrationDisplayNames12
|
|
28003
27708
|
} from "@livechat/developer-studio-api";
|
|
28004
27709
|
import {
|
|
28005
27710
|
useNotifications as useNotifications14,
|
|
@@ -28010,17 +27715,17 @@ var ShopifyStatus = () => {
|
|
|
28010
27715
|
const {
|
|
28011
27716
|
userData: { user }
|
|
28012
27717
|
} = useRootContext24();
|
|
28013
|
-
const { login } =
|
|
27718
|
+
const { login } = useContext35(AuthContext);
|
|
28014
27719
|
const { context: notifications } = useNotifications14();
|
|
28015
27720
|
const credentialsQuery = useFetchShopifyCredentials();
|
|
28016
27721
|
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
28017
27722
|
const [state, setState] = useState43();
|
|
28018
|
-
const refetch =
|
|
27723
|
+
const refetch = useCallback32(() => {
|
|
28019
27724
|
credentialsQuery.refetch();
|
|
28020
27725
|
}, [credentialsQuery]);
|
|
28021
27726
|
const oauthCredential = credentialsQuery.data.internal;
|
|
28022
27727
|
const otherCredentials = credentialsQuery.data.other;
|
|
28023
|
-
const triggerConnect =
|
|
27728
|
+
const triggerConnect = useCallback32(
|
|
28024
27729
|
(shop) => {
|
|
28025
27730
|
user && triggerShopifyAction(
|
|
28026
27731
|
{
|
|
@@ -28045,14 +27750,14 @@ var ShopifyStatus = () => {
|
|
|
28045
27750
|
},
|
|
28046
27751
|
[login, refetch, notifications, user]
|
|
28047
27752
|
);
|
|
28048
|
-
const toggleModal =
|
|
27753
|
+
const toggleModal = useCallback32((isVisible) => {
|
|
28049
27754
|
setState((prevState) => __spreadProps(__spreadValues({}, prevState), {
|
|
28050
27755
|
modal: {
|
|
28051
27756
|
isVisible
|
|
28052
27757
|
}
|
|
28053
27758
|
}));
|
|
28054
27759
|
}, []);
|
|
28055
|
-
const updateShop =
|
|
27760
|
+
const updateShop = useCallback32((shop) => {
|
|
28056
27761
|
setState(
|
|
28057
27762
|
(prevState) => {
|
|
28058
27763
|
var _a2;
|
|
@@ -28064,7 +27769,7 @@ var ShopifyStatus = () => {
|
|
|
28064
27769
|
}
|
|
28065
27770
|
);
|
|
28066
27771
|
}, []);
|
|
28067
|
-
const submit =
|
|
27772
|
+
const submit = useCallback32(() => {
|
|
28068
27773
|
var _a2, _b;
|
|
28069
27774
|
setState(
|
|
28070
27775
|
(prevState) => {
|
|
@@ -28081,11 +27786,11 @@ var ShopifyStatus = () => {
|
|
|
28081
27786
|
triggerConnect(state.modal.shop);
|
|
28082
27787
|
}
|
|
28083
27788
|
}, [state == null ? void 0 : state.modal, toggleModal, triggerConnect]);
|
|
28084
|
-
const Connect =
|
|
27789
|
+
const Connect = useCallback32(
|
|
28085
27790
|
({ credential }) => {
|
|
28086
27791
|
if (!credential) {
|
|
28087
27792
|
return /* @__PURE__ */ jsx4(
|
|
28088
|
-
|
|
27793
|
+
Button46,
|
|
28089
27794
|
{
|
|
28090
27795
|
kind: "primary",
|
|
28091
27796
|
onClick: () => {
|
|
@@ -28104,7 +27809,7 @@ var ShopifyStatus = () => {
|
|
|
28104
27809
|
executor: {
|
|
28105
27810
|
type: "manual",
|
|
28106
27811
|
render: (confirm) => /* @__PURE__ */ jsx4(
|
|
28107
|
-
|
|
27812
|
+
Button46,
|
|
28108
27813
|
{
|
|
28109
27814
|
kind: (credential == null ? void 0 : credential.data.connected) ? "secondary" : "primary",
|
|
28110
27815
|
onClick: () => {
|
|
@@ -28144,7 +27849,7 @@ var ShopifyStatus = () => {
|
|
|
28144
27849
|
children: /* @__PURE__ */ jsx4(
|
|
28145
27850
|
Form3,
|
|
28146
27851
|
{
|
|
28147
|
-
formFooter: /* @__PURE__ */ jsx4(
|
|
27852
|
+
formFooter: /* @__PURE__ */ jsx4(Button46, { kind: "primary", onClick: submit, iconPosition: "right", children: "Connect" }),
|
|
28148
27853
|
helperText: "Enter your shopify shop name",
|
|
28149
27854
|
labelText: "Shop",
|
|
28150
27855
|
children: /* @__PURE__ */ jsx4(FormField6, { labelText: "Shop", children: /* @__PURE__ */ jsx4(
|
|
@@ -28170,9 +27875,9 @@ var ShopifyStatus = () => {
|
|
|
28170
27875
|
/* @__PURE__ */ jsxs2(
|
|
28171
27876
|
IntegrationStatus_default,
|
|
28172
27877
|
{
|
|
28173
|
-
title:
|
|
28174
|
-
subtitle: `${
|
|
28175
|
-
header: `${
|
|
27878
|
+
title: IntegrationDisplayNames12.Shopify,
|
|
27879
|
+
subtitle: `${IntegrationDisplayNames12.Shopify} integration`,
|
|
27880
|
+
header: `${IntegrationDisplayNames12.Shopify} integration`,
|
|
28176
27881
|
description: "Enhance your e-commerce capabilities with Shopify integration in Developer Console. Simplify your store management, boost your sales, and create a seamless shopping experience for your customers, all while ensuring a robust and scalable workflow.",
|
|
28177
27882
|
icon: /* @__PURE__ */ jsx4(ShopifyColored3, {}),
|
|
28178
27883
|
dataCy: "shopify-integration-component",
|
|
@@ -28186,10 +27891,10 @@ var ShopifyStatus = () => {
|
|
|
28186
27891
|
icon: /* @__PURE__ */ jsx4(ShopifyColored3, {}),
|
|
28187
27892
|
action: !credentialsQuery.isFetching ? /* @__PURE__ */ jsx4(Connect, { credential: oauthCredential }) : void 0,
|
|
28188
27893
|
status: !credentialsQuery.isFetching && (oauthCredential == null ? void 0 : oauthCredential.name) ? /* @__PURE__ */ jsx4(
|
|
28189
|
-
|
|
27894
|
+
Button46,
|
|
28190
27895
|
{
|
|
28191
27896
|
size: "xcompact",
|
|
28192
|
-
icon: /* @__PURE__ */ jsx4(
|
|
27897
|
+
icon: /* @__PURE__ */ jsx4(Icon52, { source: Delete11, size: "small" }),
|
|
28193
27898
|
onClick: () => {
|
|
28194
27899
|
if (oauthCredential.name) {
|
|
28195
27900
|
removeCredentialMutation.mutateAsync(oauthCredential);
|
|
@@ -28212,49 +27917,49 @@ var ShopifyStatus = () => {
|
|
|
28212
27917
|
)
|
|
28213
27918
|
] });
|
|
28214
27919
|
};
|
|
28215
|
-
var
|
|
27920
|
+
var Status_default6 = notificationConnect3(ShopifyStatus);
|
|
28216
27921
|
|
|
28217
27922
|
// src/views/Settings/Integrations/Shopify/index.tsx
|
|
28218
|
-
import { jsx as
|
|
27923
|
+
import { jsx as jsx40, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
28219
27924
|
var ShopifyIntegration = () => {
|
|
28220
|
-
return /* @__PURE__ */
|
|
28221
|
-
/* @__PURE__ */
|
|
28222
|
-
/* @__PURE__ */
|
|
28223
|
-
/* @__PURE__ */
|
|
28224
|
-
|
|
27925
|
+
return /* @__PURE__ */ jsxs19(Routes13, { children: [
|
|
27926
|
+
/* @__PURE__ */ jsx40(Route13, { path: "/", element: /* @__PURE__ */ jsx40(Navigate8, { to: "status", replace: true }) }),
|
|
27927
|
+
/* @__PURE__ */ jsx40(Route13, { path: "/status", element: /* @__PURE__ */ jsx40(Status_default6, {}) }),
|
|
27928
|
+
/* @__PURE__ */ jsx40(
|
|
27929
|
+
Route13,
|
|
28225
27930
|
{
|
|
28226
27931
|
path: "/action/:action/:data?/:context?",
|
|
28227
|
-
element: /* @__PURE__ */
|
|
27932
|
+
element: /* @__PURE__ */ jsx40(Action_default4, {})
|
|
28228
27933
|
}
|
|
28229
27934
|
),
|
|
28230
|
-
/* @__PURE__ */
|
|
27935
|
+
/* @__PURE__ */ jsx40(Route13, { path: "/callback/:action", element: /* @__PURE__ */ jsx40(Callback_default7, {}) })
|
|
28231
27936
|
] });
|
|
28232
27937
|
};
|
|
28233
27938
|
var Shopify_default2 = ShopifyIntegration;
|
|
28234
27939
|
|
|
28235
27940
|
// src/views/Settings/Integrations/Text/index.tsx
|
|
28236
|
-
import { Navigate as
|
|
27941
|
+
import { Navigate as Navigate9, Route as Route14, Routes as Routes14 } from "react-router-dom";
|
|
28237
27942
|
|
|
28238
27943
|
// src/views/Settings/Integrations/Text/Action.tsx
|
|
28239
|
-
import { useContext as
|
|
27944
|
+
import { useContext as useContext36 } from "react";
|
|
28240
27945
|
import {
|
|
28241
|
-
IntegrationModes as
|
|
28242
|
-
IntegrationNames as
|
|
27946
|
+
IntegrationModes as IntegrationModes9,
|
|
27947
|
+
IntegrationNames as IntegrationNames40
|
|
28243
27948
|
} from "@livechat/developer-studio-api";
|
|
28244
|
-
import { useMatch as
|
|
28245
|
-
import { jsx as
|
|
27949
|
+
import { useMatch as useMatch15 } from "@livechat/developer-studio-ui-react";
|
|
27950
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
28246
27951
|
var TextAction = (props) => {
|
|
28247
27952
|
var _a;
|
|
28248
|
-
const { login } =
|
|
28249
|
-
const match2 =
|
|
27953
|
+
const { login } = useContext36(AuthContext);
|
|
27954
|
+
const match2 = useMatch15();
|
|
28250
27955
|
const action = (_a = props.action) != null ? _a : match2.params.action;
|
|
28251
27956
|
if (!action) {
|
|
28252
27957
|
throw new Error("Invalid action");
|
|
28253
27958
|
}
|
|
28254
|
-
return /* @__PURE__ */
|
|
27959
|
+
return /* @__PURE__ */ jsx41(
|
|
28255
27960
|
IntegrationAction_default,
|
|
28256
27961
|
{
|
|
28257
|
-
name:
|
|
27962
|
+
name: IntegrationNames40.Text,
|
|
28258
27963
|
action,
|
|
28259
27964
|
data: props.data,
|
|
28260
27965
|
context: props.context,
|
|
@@ -28262,7 +27967,7 @@ var TextAction = (props) => {
|
|
|
28262
27967
|
serializedContext: match2.params.context,
|
|
28263
27968
|
executor: props.executor,
|
|
28264
27969
|
trigger: {
|
|
28265
|
-
mode:
|
|
27970
|
+
mode: IntegrationModes9.Modal,
|
|
28266
27971
|
handler: (output) => textActionHandlers(login)[action](output)
|
|
28267
27972
|
},
|
|
28268
27973
|
onSuccess: props.onSuccess
|
|
@@ -28274,7 +27979,7 @@ var textActionHandlers = (login) => {
|
|
|
28274
27979
|
authorize: (output) => {
|
|
28275
27980
|
if (output.status === "success" && output.result.token) {
|
|
28276
27981
|
login({
|
|
28277
|
-
source:
|
|
27982
|
+
source: IntegrationNames40.Text,
|
|
28278
27983
|
data: { token: output.result.token }
|
|
28279
27984
|
});
|
|
28280
27985
|
return {
|
|
@@ -28289,33 +27994,33 @@ var textActionHandlers = (login) => {
|
|
|
28289
27994
|
};
|
|
28290
27995
|
return handlers;
|
|
28291
27996
|
};
|
|
28292
|
-
var
|
|
27997
|
+
var Action_default8 = TextAction;
|
|
28293
27998
|
|
|
28294
27999
|
// src/views/Settings/Integrations/Text/Callback.tsx
|
|
28295
|
-
import { useContext as
|
|
28296
|
-
import { useMatch as
|
|
28297
|
-
import { jsx as
|
|
28000
|
+
import { useContext as useContext37 } from "react";
|
|
28001
|
+
import { useMatch as useMatch16 } from "@livechat/developer-studio-ui-react";
|
|
28002
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
28298
28003
|
var TextCallback = () => {
|
|
28299
|
-
const { login } =
|
|
28300
|
-
const match2 =
|
|
28004
|
+
const { login } = useContext37(AuthContext);
|
|
28005
|
+
const match2 = useMatch16();
|
|
28301
28006
|
const action = match2.params.action;
|
|
28302
28007
|
if (!action) {
|
|
28303
28008
|
throw new Error("Invalid action");
|
|
28304
28009
|
}
|
|
28305
|
-
return /* @__PURE__ */
|
|
28010
|
+
return /* @__PURE__ */ jsx42(
|
|
28306
28011
|
IntegrationCallback_default,
|
|
28307
28012
|
{
|
|
28308
28013
|
handler: (output) => textActionHandlers(login)[action](output)
|
|
28309
28014
|
}
|
|
28310
28015
|
);
|
|
28311
28016
|
};
|
|
28312
|
-
var
|
|
28017
|
+
var Callback_default8 = TextCallback;
|
|
28313
28018
|
|
|
28314
28019
|
// src/views/Settings/Integrations/Text/Status.tsx
|
|
28315
|
-
import { Fragment as Fragment44, useCallback as
|
|
28316
|
-
import { Button as
|
|
28020
|
+
import { Fragment as Fragment44, useCallback as useCallback33 } from "react";
|
|
28021
|
+
import { Button as Button47 } from "@livechat/design-system-react-components";
|
|
28317
28022
|
import {
|
|
28318
|
-
IntegrationDisplayNames as
|
|
28023
|
+
IntegrationDisplayNames as IntegrationDisplayNames13
|
|
28319
28024
|
} from "@livechat/developer-studio-api";
|
|
28320
28025
|
import {
|
|
28321
28026
|
Logo as TextIcon,
|
|
@@ -28327,21 +28032,21 @@ var TextStatus = () => {
|
|
|
28327
28032
|
} = useRootContext25();
|
|
28328
28033
|
const credentialsQuery = useFetchTextCredentials();
|
|
28329
28034
|
const isInstalledQuery = useFetchUserInstalledTextIntegration(user);
|
|
28330
|
-
const refetch =
|
|
28035
|
+
const refetch = useCallback33(() => {
|
|
28331
28036
|
credentialsQuery.refetch();
|
|
28332
28037
|
isInstalledQuery.refetch();
|
|
28333
28038
|
}, [credentialsQuery, isInstalledQuery]);
|
|
28334
28039
|
const authCredential = credentialsQuery.data.internal;
|
|
28335
28040
|
const otherCredentials = credentialsQuery.data.other;
|
|
28336
|
-
const Connect =
|
|
28041
|
+
const Connect = useCallback33(
|
|
28337
28042
|
({ credential }) => /* @__PURE__ */ jsx4(
|
|
28338
|
-
|
|
28043
|
+
Action_default8,
|
|
28339
28044
|
{
|
|
28340
28045
|
action: "authorize",
|
|
28341
28046
|
executor: {
|
|
28342
28047
|
type: "manual",
|
|
28343
28048
|
render: (confirm) => /* @__PURE__ */ jsx4(
|
|
28344
|
-
|
|
28049
|
+
Button47,
|
|
28345
28050
|
{
|
|
28346
28051
|
kind: (credential == null ? void 0 : credential.data.connected) ? "secondary" : "primary",
|
|
28347
28052
|
onClick: confirm,
|
|
@@ -28367,9 +28072,9 @@ var TextStatus = () => {
|
|
|
28367
28072
|
return /* @__PURE__ */ jsxs2(
|
|
28368
28073
|
IntegrationStatus_default,
|
|
28369
28074
|
{
|
|
28370
|
-
title:
|
|
28371
|
-
subtitle: `${
|
|
28372
|
-
header: `${
|
|
28075
|
+
title: IntegrationDisplayNames13.Text,
|
|
28076
|
+
subtitle: `${IntegrationDisplayNames13.Text} integration`,
|
|
28077
|
+
header: `${IntegrationDisplayNames13.Text} integration`,
|
|
28373
28078
|
description: "",
|
|
28374
28079
|
icon: /* @__PURE__ */ jsx4(TextIcon, {}),
|
|
28375
28080
|
dataCy: "text-integration-component",
|
|
@@ -28395,49 +28100,49 @@ var TextStatus = () => {
|
|
|
28395
28100
|
}
|
|
28396
28101
|
);
|
|
28397
28102
|
};
|
|
28398
|
-
var
|
|
28103
|
+
var Status_default7 = TextStatus;
|
|
28399
28104
|
|
|
28400
28105
|
// src/views/Settings/Integrations/Text/index.tsx
|
|
28401
|
-
import { jsx as
|
|
28106
|
+
import { jsx as jsx43, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
28402
28107
|
var TextIntegration = () => {
|
|
28403
|
-
return /* @__PURE__ */
|
|
28404
|
-
/* @__PURE__ */
|
|
28405
|
-
/* @__PURE__ */
|
|
28406
|
-
/* @__PURE__ */
|
|
28407
|
-
/* @__PURE__ */
|
|
28108
|
+
return /* @__PURE__ */ jsxs20(Routes14, { children: [
|
|
28109
|
+
/* @__PURE__ */ jsx43(Route14, { path: "/", element: /* @__PURE__ */ jsx43(Navigate9, { to: "status", replace: true }) }),
|
|
28110
|
+
/* @__PURE__ */ jsx43(Route14, { path: "/status", element: /* @__PURE__ */ jsx43(Status_default7, {}) }),
|
|
28111
|
+
/* @__PURE__ */ jsx43(Route14, { path: "/action/:action/:data?/:context?", element: /* @__PURE__ */ jsx43(Action_default8, {}) }),
|
|
28112
|
+
/* @__PURE__ */ jsx43(Route14, { path: "/callback/:action", element: /* @__PURE__ */ jsx43(Callback_default8, {}) })
|
|
28408
28113
|
] });
|
|
28409
28114
|
};
|
|
28410
28115
|
var Text_default2 = TextIntegration;
|
|
28411
28116
|
|
|
28412
28117
|
// src/views/Settings/Integrations/Vercel/index.tsx
|
|
28413
|
-
import { Navigate as
|
|
28118
|
+
import { Navigate as Navigate10, Route as Route15, Routes as Routes15 } from "react-router-dom";
|
|
28414
28119
|
|
|
28415
28120
|
// src/views/Settings/Integrations/Vercel/Action.tsx
|
|
28416
|
-
import { useContext as
|
|
28121
|
+
import { useContext as useContext38 } from "react";
|
|
28417
28122
|
import {
|
|
28418
|
-
IntegrationModes as
|
|
28419
|
-
IntegrationNames as
|
|
28123
|
+
IntegrationModes as IntegrationModes10,
|
|
28124
|
+
IntegrationNames as IntegrationNames41
|
|
28420
28125
|
} from "@livechat/developer-studio-api";
|
|
28421
28126
|
import {
|
|
28422
|
-
useMatch as
|
|
28127
|
+
useMatch as useMatch17,
|
|
28423
28128
|
useRootContext as useRootContext26
|
|
28424
28129
|
} from "@livechat/developer-studio-ui-react";
|
|
28425
|
-
import { jsx as
|
|
28130
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
28426
28131
|
var VercelAction = (props) => {
|
|
28427
28132
|
var _a;
|
|
28428
28133
|
const {
|
|
28429
28134
|
userData: { user }
|
|
28430
28135
|
} = useRootContext26();
|
|
28431
|
-
const { login } =
|
|
28432
|
-
const match2 =
|
|
28136
|
+
const { login } = useContext38(AuthContext);
|
|
28137
|
+
const match2 = useMatch17();
|
|
28433
28138
|
const action = (_a = props.action) != null ? _a : match2.params.action;
|
|
28434
28139
|
if (!action) {
|
|
28435
28140
|
throw new Error("Invalid action");
|
|
28436
28141
|
}
|
|
28437
|
-
return /* @__PURE__ */
|
|
28142
|
+
return /* @__PURE__ */ jsx44(
|
|
28438
28143
|
IntegrationAction_default,
|
|
28439
28144
|
{
|
|
28440
|
-
name:
|
|
28145
|
+
name: IntegrationNames41.Vercel,
|
|
28441
28146
|
action,
|
|
28442
28147
|
data: props.data,
|
|
28443
28148
|
context: props.context,
|
|
@@ -28445,7 +28150,7 @@ var VercelAction = (props) => {
|
|
|
28445
28150
|
serializedContext: match2.params.context,
|
|
28446
28151
|
executor: props.executor,
|
|
28447
28152
|
trigger: {
|
|
28448
|
-
mode:
|
|
28153
|
+
mode: IntegrationModes10.Modal,
|
|
28449
28154
|
handler: (output) => vercelActionHandlers(login, user == null ? void 0 : user.meta.email)[action](output)
|
|
28450
28155
|
},
|
|
28451
28156
|
onSuccess: props.onSuccess
|
|
@@ -28456,9 +28161,9 @@ function triggerVercelAction(props, meta) {
|
|
|
28456
28161
|
return __async(this, null, function* () {
|
|
28457
28162
|
return executeIntegrationAction(
|
|
28458
28163
|
__spreadProps(__spreadValues({}, props), {
|
|
28459
|
-
name:
|
|
28164
|
+
name: IntegrationNames41.Vercel,
|
|
28460
28165
|
trigger: {
|
|
28461
|
-
mode:
|
|
28166
|
+
mode: IntegrationModes10.Modal,
|
|
28462
28167
|
handler: (output) => vercelActionHandlers(
|
|
28463
28168
|
meta.login,
|
|
28464
28169
|
meta.user.meta.email
|
|
@@ -28477,10 +28182,10 @@ var vercelActionHandlers = (login, email) => {
|
|
|
28477
28182
|
authorize: (output) => {
|
|
28478
28183
|
if (output.status === "success" && output.result.token) {
|
|
28479
28184
|
amplitudeDeploymentJourney.app.deployment.actions.authorize.success(
|
|
28480
|
-
|
|
28185
|
+
IntegrationNames41.Vercel
|
|
28481
28186
|
);
|
|
28482
28187
|
login({
|
|
28483
|
-
source:
|
|
28188
|
+
source: IntegrationNames41.Vercel,
|
|
28484
28189
|
data: { token: output.result.token }
|
|
28485
28190
|
});
|
|
28486
28191
|
return {
|
|
@@ -28501,7 +28206,7 @@ var vercelActionHandlers = (login, email) => {
|
|
|
28501
28206
|
install: (output) => {
|
|
28502
28207
|
if (output.status === "success" && output.result.installationId) {
|
|
28503
28208
|
amplitudeDeploymentJourney.app.deployment.actions.install.success(
|
|
28504
|
-
|
|
28209
|
+
IntegrationNames41.Vercel
|
|
28505
28210
|
);
|
|
28506
28211
|
return {
|
|
28507
28212
|
isValid: true,
|
|
@@ -28516,15 +28221,15 @@ var vercelActionHandlers = (login, email) => {
|
|
|
28516
28221
|
};
|
|
28517
28222
|
return handlers;
|
|
28518
28223
|
};
|
|
28519
|
-
var
|
|
28224
|
+
var Action_default9 = VercelAction;
|
|
28520
28225
|
|
|
28521
28226
|
// src/views/Settings/Integrations/Vercel/Callback.tsx
|
|
28522
|
-
import { useContext as
|
|
28523
|
-
import { useMatch as
|
|
28524
|
-
import { jsx as
|
|
28227
|
+
import { useContext as useContext39 } from "react";
|
|
28228
|
+
import { useMatch as useMatch18, useRootContext as useRootContext27 } from "@livechat/developer-studio-ui-react";
|
|
28229
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
28525
28230
|
var VercelCallback = () => {
|
|
28526
|
-
const { login } =
|
|
28527
|
-
const match2 =
|
|
28231
|
+
const { login } = useContext39(AuthContext);
|
|
28232
|
+
const match2 = useMatch18();
|
|
28528
28233
|
const action = match2.params.action;
|
|
28529
28234
|
const {
|
|
28530
28235
|
userData: { user }
|
|
@@ -28532,27 +28237,27 @@ var VercelCallback = () => {
|
|
|
28532
28237
|
if (!action) {
|
|
28533
28238
|
throw new Error("Invalid action");
|
|
28534
28239
|
}
|
|
28535
|
-
return /* @__PURE__ */
|
|
28240
|
+
return /* @__PURE__ */ jsx45(
|
|
28536
28241
|
IntegrationCallback_default,
|
|
28537
28242
|
{
|
|
28538
28243
|
handler: (output) => vercelActionHandlers(login, user == null ? void 0 : user.meta.email)[action](output)
|
|
28539
28244
|
}
|
|
28540
28245
|
);
|
|
28541
28246
|
};
|
|
28542
|
-
var
|
|
28247
|
+
var Callback_default9 = VercelCallback;
|
|
28543
28248
|
|
|
28544
28249
|
// src/views/Settings/Integrations/Vercel/Status.tsx
|
|
28545
|
-
import { Fragment as Fragment45, useCallback as
|
|
28546
|
-
import { ChevronDown as ChevronDown6, ChevronUp as ChevronUp4, Delete as
|
|
28250
|
+
import { Fragment as Fragment45, useCallback as useCallback34, useContext as useContext40, useEffect as useEffect26, useState as useState44 } from "react";
|
|
28251
|
+
import { ChevronDown as ChevronDown6, ChevronUp as ChevronUp4, Delete as Delete12 } from "@livechat/design-system-icons";
|
|
28547
28252
|
import {
|
|
28548
28253
|
ActionMenu as ActionMenu9,
|
|
28549
|
-
Button as
|
|
28550
|
-
Icon as
|
|
28254
|
+
Button as Button48,
|
|
28255
|
+
Icon as Icon53,
|
|
28551
28256
|
SpacingToken as SpacingToken56
|
|
28552
28257
|
} from "@livechat/design-system-react-components";
|
|
28553
28258
|
import {
|
|
28554
|
-
IntegrationDisplayNames as
|
|
28555
|
-
IntegrationNames as
|
|
28259
|
+
IntegrationDisplayNames as IntegrationDisplayNames14,
|
|
28260
|
+
IntegrationNames as IntegrationNames43
|
|
28556
28261
|
} from "@livechat/developer-studio-api";
|
|
28557
28262
|
import {
|
|
28558
28263
|
Row as Row30,
|
|
@@ -28563,12 +28268,12 @@ import {
|
|
|
28563
28268
|
|
|
28564
28269
|
// src/hooks/integrations/vercel/credentials.ts
|
|
28565
28270
|
import {
|
|
28566
|
-
IntegrationNames as
|
|
28271
|
+
IntegrationNames as IntegrationNames42
|
|
28567
28272
|
} from "@livechat/developer-studio-api";
|
|
28568
28273
|
var useFetchVercelCredentials = () => {
|
|
28569
28274
|
var _a, _b;
|
|
28570
28275
|
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
28571
|
-
|
|
28276
|
+
IntegrationNames42.Vercel
|
|
28572
28277
|
);
|
|
28573
28278
|
const oauthCredential = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
28574
28279
|
(credential) => credential.type === "oauth2" && credential.data.client_id === getWorkflowEnv("vercelClientId")
|
|
@@ -28585,15 +28290,15 @@ var useFetchVercelCredentials = () => {
|
|
|
28585
28290
|
};
|
|
28586
28291
|
|
|
28587
28292
|
// src/hooks/integrations/vercel/namespace.ts
|
|
28588
|
-
import { useQuery as
|
|
28589
|
-
import { api as
|
|
28293
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
28294
|
+
import { api as api10 } from "@livechat/developer-studio-api";
|
|
28590
28295
|
var vercelNamespacesQueryKeys = {
|
|
28591
28296
|
getInstallations: ["vercel.getNamespaces"]
|
|
28592
28297
|
};
|
|
28593
28298
|
var useFetchVercelNamespaces = (enabled) => {
|
|
28594
|
-
return
|
|
28299
|
+
return useQuery8(
|
|
28595
28300
|
vercelNamespacesQueryKeys.getInstallations,
|
|
28596
|
-
() =>
|
|
28301
|
+
() => api10.integrations.vercel.integrations.getGitNamespaces(),
|
|
28597
28302
|
{
|
|
28598
28303
|
retry: false,
|
|
28599
28304
|
enabled
|
|
@@ -28607,7 +28312,7 @@ var VercelStatus = () => {
|
|
|
28607
28312
|
const {
|
|
28608
28313
|
userData: { user }
|
|
28609
28314
|
} = useRootContext28();
|
|
28610
|
-
const { state, login } =
|
|
28315
|
+
const { state, login } = useContext40(AuthContext);
|
|
28611
28316
|
const { context: notifications } = useNotifications15();
|
|
28612
28317
|
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
28613
28318
|
const credentialsQuery = useFetchVercelCredentials();
|
|
@@ -28623,7 +28328,7 @@ var VercelStatus = () => {
|
|
|
28623
28328
|
const amplitudeDeploymentJourney = appDeploymentBlockAmplitudeJourneyFactory(
|
|
28624
28329
|
user == null ? void 0 : user.meta.email
|
|
28625
28330
|
);
|
|
28626
|
-
const refetch =
|
|
28331
|
+
const refetch = useCallback34(() => {
|
|
28627
28332
|
credentialsQuery.refetch();
|
|
28628
28333
|
namespacesQuery.refetch();
|
|
28629
28334
|
}, [credentialsQuery, namespacesQuery]);
|
|
@@ -28633,7 +28338,7 @@ var VercelStatus = () => {
|
|
|
28633
28338
|
}
|
|
28634
28339
|
if (!(oauthCredential == null ? void 0 : oauthCredential.data.connected)) {
|
|
28635
28340
|
amplitudeDeploymentJourney.app.deployment.actions.authorize.requested(
|
|
28636
|
-
|
|
28341
|
+
IntegrationNames43.Vercel
|
|
28637
28342
|
);
|
|
28638
28343
|
return;
|
|
28639
28344
|
}
|
|
@@ -28642,7 +28347,7 @@ var VercelStatus = () => {
|
|
|
28642
28347
|
}
|
|
28643
28348
|
if (!isInstalled) {
|
|
28644
28349
|
amplitudeDeploymentJourney.app.deployment.actions.install.requested(
|
|
28645
|
-
|
|
28350
|
+
IntegrationNames43.Vercel
|
|
28646
28351
|
);
|
|
28647
28352
|
}
|
|
28648
28353
|
}, [credentialsQuery, oauthCredential, namespacesQuery, isInstalled]);
|
|
@@ -28650,7 +28355,7 @@ var VercelStatus = () => {
|
|
|
28650
28355
|
"my-channel",
|
|
28651
28356
|
"my-event",
|
|
28652
28357
|
(data) => {
|
|
28653
|
-
if (data.userId !== (user == null ? void 0 : user.profile.id) || data.integration !==
|
|
28358
|
+
if (data.userId !== (user == null ? void 0 : user.profile.id) || data.integration !== IntegrationNames43.Vercel) {
|
|
28654
28359
|
return;
|
|
28655
28360
|
}
|
|
28656
28361
|
if (data.action === "authorize" || data.action === "install") {
|
|
@@ -28659,21 +28364,21 @@ var VercelStatus = () => {
|
|
|
28659
28364
|
},
|
|
28660
28365
|
[refetch]
|
|
28661
28366
|
);
|
|
28662
|
-
const Connect =
|
|
28367
|
+
const Connect = useCallback34(
|
|
28663
28368
|
({ credential }) => /* @__PURE__ */ jsx4(
|
|
28664
|
-
|
|
28369
|
+
Action_default9,
|
|
28665
28370
|
{
|
|
28666
28371
|
action: "authorize",
|
|
28667
28372
|
executor: {
|
|
28668
28373
|
type: "manual",
|
|
28669
28374
|
render: (confirm) => /* @__PURE__ */ jsx4(
|
|
28670
|
-
|
|
28375
|
+
Button48,
|
|
28671
28376
|
{
|
|
28672
28377
|
kind: (credential == null ? void 0 : credential.data.connected) ? "secondary" : "primary",
|
|
28673
28378
|
onClick: () => {
|
|
28674
28379
|
if (!(credential == null ? void 0 : credential.data.connected)) {
|
|
28675
28380
|
amplitudeDeploymentJourney.app.deployment.actions.authorize.click(
|
|
28676
|
-
|
|
28381
|
+
IntegrationNames43.Vercel
|
|
28677
28382
|
);
|
|
28678
28383
|
}
|
|
28679
28384
|
confirm();
|
|
@@ -28698,23 +28403,23 @@ var VercelStatus = () => {
|
|
|
28698
28403
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28699
28404
|
[refetch]
|
|
28700
28405
|
);
|
|
28701
|
-
const Install =
|
|
28406
|
+
const Install = useCallback34(
|
|
28702
28407
|
() => {
|
|
28703
28408
|
var _a2;
|
|
28704
28409
|
return /* @__PURE__ */ jsx4(
|
|
28705
|
-
|
|
28410
|
+
Action_default9,
|
|
28706
28411
|
{
|
|
28707
28412
|
action: "install",
|
|
28708
28413
|
executor: {
|
|
28709
28414
|
type: "manual",
|
|
28710
28415
|
render: (confirm) => /* @__PURE__ */ jsx4(
|
|
28711
|
-
|
|
28416
|
+
Button48,
|
|
28712
28417
|
{
|
|
28713
28418
|
kind: namespacesQuery.isLoading ? "text" : isInstalled ? "secondary" : "primary",
|
|
28714
28419
|
loading: namespacesQuery.isLoading,
|
|
28715
28420
|
onClick: () => {
|
|
28716
28421
|
amplitudeDeploymentJourney.app.deployment.actions.install.click(
|
|
28717
|
-
|
|
28422
|
+
IntegrationNames43.Vercel
|
|
28718
28423
|
);
|
|
28719
28424
|
confirm();
|
|
28720
28425
|
},
|
|
@@ -28729,7 +28434,7 @@ var VercelStatus = () => {
|
|
|
28729
28434
|
}
|
|
28730
28435
|
},
|
|
28731
28436
|
context: {
|
|
28732
|
-
credentialId:
|
|
28437
|
+
credentialId: IntegrationNames43.Vercel,
|
|
28733
28438
|
token: (_a2 = state.vercel.raw.token) != null ? _a2 : "",
|
|
28734
28439
|
showInstruction: !isInstalled ? true : void 0
|
|
28735
28440
|
},
|
|
@@ -28804,9 +28509,9 @@ var VercelStatus = () => {
|
|
|
28804
28509
|
return /* @__PURE__ */ jsxs2(
|
|
28805
28510
|
IntegrationStatus_default,
|
|
28806
28511
|
{
|
|
28807
|
-
title:
|
|
28808
|
-
subtitle: `${
|
|
28809
|
-
header: `${
|
|
28512
|
+
title: IntegrationDisplayNames14.Vercel,
|
|
28513
|
+
subtitle: `${IntegrationDisplayNames14.Vercel} integration`,
|
|
28514
|
+
header: `${IntegrationDisplayNames14.Vercel} integration`,
|
|
28810
28515
|
description: "Optimize your app deployment with Vercel to enjoy seamless integration, streamlined workflows, and easy collaboration, all without compromising on speed or quality.",
|
|
28811
28516
|
icon: /* @__PURE__ */ jsx4(VercelIcon, {}),
|
|
28812
28517
|
dataCy: "vercel-integration-component",
|
|
@@ -28826,13 +28531,13 @@ var VercelStatus = () => {
|
|
|
28826
28531
|
visible: isDropdownVisible,
|
|
28827
28532
|
placement: "bottom",
|
|
28828
28533
|
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
28829
|
-
|
|
28534
|
+
Button48,
|
|
28830
28535
|
{
|
|
28831
28536
|
kind: "secondary",
|
|
28832
28537
|
onClick: () => {
|
|
28833
28538
|
setIsDropdownVisible(!isDropdownVisible);
|
|
28834
28539
|
},
|
|
28835
|
-
icon: isDropdownVisible ? /* @__PURE__ */ jsx4(
|
|
28540
|
+
icon: isDropdownVisible ? /* @__PURE__ */ jsx4(Icon53, { source: ChevronUp4 }) : /* @__PURE__ */ jsx4(Icon53, { source: ChevronDown6 }),
|
|
28836
28541
|
iconPosition: "right",
|
|
28837
28542
|
children: "Settings"
|
|
28838
28543
|
}
|
|
@@ -28851,10 +28556,10 @@ var VercelStatus = () => {
|
|
|
28851
28556
|
namespacesQuery.isFetching
|
|
28852
28557
|
) : void 0,
|
|
28853
28558
|
/* @__PURE__ */ jsx4(
|
|
28854
|
-
|
|
28559
|
+
Button48,
|
|
28855
28560
|
{
|
|
28856
28561
|
size: "xcompact",
|
|
28857
|
-
icon: /* @__PURE__ */ jsx4(
|
|
28562
|
+
icon: /* @__PURE__ */ jsx4(Icon53, { source: Delete12, size: "small" }),
|
|
28858
28563
|
onClick: () => {
|
|
28859
28564
|
if (oauthCredential.name) {
|
|
28860
28565
|
removeCredentialMutation.mutateAsync(oauthCredential);
|
|
@@ -28877,28 +28582,28 @@ var VercelStatus = () => {
|
|
|
28877
28582
|
}
|
|
28878
28583
|
);
|
|
28879
28584
|
};
|
|
28880
|
-
var
|
|
28585
|
+
var Status_default8 = VercelStatus;
|
|
28881
28586
|
|
|
28882
28587
|
// src/views/Settings/Integrations/Vercel/index.tsx
|
|
28883
|
-
import { jsx as
|
|
28588
|
+
import { jsx as jsx46, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
28884
28589
|
var VercelIntegration = () => {
|
|
28885
|
-
return /* @__PURE__ */
|
|
28886
|
-
/* @__PURE__ */
|
|
28887
|
-
/* @__PURE__ */
|
|
28888
|
-
/* @__PURE__ */
|
|
28889
|
-
|
|
28590
|
+
return /* @__PURE__ */ jsxs21(Routes15, { children: [
|
|
28591
|
+
/* @__PURE__ */ jsx46(Route15, { path: "/", element: /* @__PURE__ */ jsx46(Navigate10, { to: "status", replace: true }) }),
|
|
28592
|
+
/* @__PURE__ */ jsx46(Route15, { path: "/status", element: /* @__PURE__ */ jsx46(Status_default8, {}) }),
|
|
28593
|
+
/* @__PURE__ */ jsx46(
|
|
28594
|
+
Route15,
|
|
28890
28595
|
{
|
|
28891
28596
|
path: "/action/:action/:data?/:context?",
|
|
28892
|
-
element: /* @__PURE__ */
|
|
28597
|
+
element: /* @__PURE__ */ jsx46(Action_default9, {})
|
|
28893
28598
|
}
|
|
28894
28599
|
),
|
|
28895
|
-
/* @__PURE__ */
|
|
28600
|
+
/* @__PURE__ */ jsx46(Route15, { path: "/callback/:action", element: /* @__PURE__ */ jsx46(Callback_default9, {}) })
|
|
28896
28601
|
] });
|
|
28897
28602
|
};
|
|
28898
28603
|
var Vercel_default = VercelIntegration;
|
|
28899
28604
|
|
|
28900
28605
|
// src/views/Settings/Integrations/index.tsx
|
|
28901
|
-
import { jsx as
|
|
28606
|
+
import { jsx as jsx47, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
28902
28607
|
function IntegrationsSubNavGroup() {
|
|
28903
28608
|
const { pathname } = useLocation12();
|
|
28904
28609
|
const navigate = useNavigate22();
|
|
@@ -28906,7 +28611,7 @@ function IntegrationsSubNavGroup() {
|
|
|
28906
28611
|
userData: { user }
|
|
28907
28612
|
} = useRootContext29();
|
|
28908
28613
|
const { data: userHasInstalledWorkflows } = useFetchUserInstalledWorkflows(user);
|
|
28909
|
-
return /* @__PURE__ */
|
|
28614
|
+
return /* @__PURE__ */ jsxs22(
|
|
28910
28615
|
SideNavigationGroup,
|
|
28911
28616
|
{
|
|
28912
28617
|
className: "navigation-group",
|
|
@@ -28914,108 +28619,96 @@ function IntegrationsSubNavGroup() {
|
|
|
28914
28619
|
label: "Integrations",
|
|
28915
28620
|
shouldOpenOnInit: pathname.includes("integrations"),
|
|
28916
28621
|
children: [
|
|
28917
|
-
/* @__PURE__ */
|
|
28622
|
+
/* @__PURE__ */ jsx47(
|
|
28918
28623
|
SideNavigationItem,
|
|
28919
28624
|
{
|
|
28920
|
-
"data-testid": `${
|
|
28625
|
+
"data-testid": `${IntegrationNames44.GitHub}-option`,
|
|
28921
28626
|
isActive: pathname.includes("/settings/integrations/github"),
|
|
28922
|
-
label:
|
|
28627
|
+
label: IntegrationDisplayNames15.GitHub,
|
|
28923
28628
|
onClick: () => {
|
|
28924
28629
|
navigate("/settings/integrations/github");
|
|
28925
28630
|
},
|
|
28926
28631
|
shouldKeepIconSpace: false
|
|
28927
28632
|
}
|
|
28928
28633
|
),
|
|
28929
|
-
/* @__PURE__ */
|
|
28634
|
+
/* @__PURE__ */ jsx47(
|
|
28930
28635
|
SideNavigationItem,
|
|
28931
28636
|
{
|
|
28932
|
-
"data-testid": `${
|
|
28637
|
+
"data-testid": `${IntegrationNames44.Netlify}-option`,
|
|
28933
28638
|
isActive: pathname.includes("/settings/integrations/netlify"),
|
|
28934
|
-
label:
|
|
28639
|
+
label: IntegrationDisplayNames15.Netlify,
|
|
28935
28640
|
onClick: () => {
|
|
28936
28641
|
navigate("/settings/integrations/netlify");
|
|
28937
28642
|
},
|
|
28938
28643
|
shouldKeepIconSpace: false
|
|
28939
28644
|
}
|
|
28940
28645
|
),
|
|
28941
|
-
/* @__PURE__ */
|
|
28646
|
+
/* @__PURE__ */ jsx47(
|
|
28942
28647
|
SideNavigationItem,
|
|
28943
28648
|
{
|
|
28944
|
-
"data-testid": `${
|
|
28649
|
+
"data-testid": `${IntegrationNames44.Vercel}-option`,
|
|
28945
28650
|
isActive: pathname.includes("/settings/integrations/vercel"),
|
|
28946
|
-
label:
|
|
28651
|
+
label: IntegrationDisplayNames15.Vercel,
|
|
28947
28652
|
onClick: () => {
|
|
28948
28653
|
navigate("/settings/integrations/vercel");
|
|
28949
28654
|
},
|
|
28950
28655
|
shouldKeepIconSpace: false
|
|
28951
28656
|
}
|
|
28952
28657
|
),
|
|
28953
|
-
/* @__PURE__ */
|
|
28658
|
+
userHasInstalledWorkflows ? /* @__PURE__ */ jsx47(
|
|
28954
28659
|
SideNavigationItem,
|
|
28955
28660
|
{
|
|
28956
|
-
"data-testid": `${
|
|
28957
|
-
isActive: pathname.includes("/settings/integrations/neon"),
|
|
28958
|
-
label: IntegrationDisplayNames16.Neon,
|
|
28959
|
-
onClick: () => {
|
|
28960
|
-
navigate("/settings/integrations/neon");
|
|
28961
|
-
},
|
|
28962
|
-
shouldKeepIconSpace: false
|
|
28963
|
-
}
|
|
28964
|
-
),
|
|
28965
|
-
userHasInstalledWorkflows ? /* @__PURE__ */ jsx50(
|
|
28966
|
-
SideNavigationItem,
|
|
28967
|
-
{
|
|
28968
|
-
"data-testid": `${IntegrationNames49.Mailchimp}-option`,
|
|
28661
|
+
"data-testid": `${IntegrationNames44.Mailchimp}-option`,
|
|
28969
28662
|
isActive: pathname.includes("/settings/integrations/mailchimp"),
|
|
28970
|
-
label:
|
|
28663
|
+
label: IntegrationDisplayNames15.Mailchimp,
|
|
28971
28664
|
onClick: () => {
|
|
28972
28665
|
navigate("/settings/integrations/mailchimp");
|
|
28973
28666
|
},
|
|
28974
28667
|
shouldKeepIconSpace: false
|
|
28975
28668
|
}
|
|
28976
28669
|
) : void 0,
|
|
28977
|
-
userHasInstalledWorkflows ? /* @__PURE__ */
|
|
28670
|
+
userHasInstalledWorkflows ? /* @__PURE__ */ jsx47(
|
|
28978
28671
|
SideNavigationItem,
|
|
28979
28672
|
{
|
|
28980
|
-
"data-testid": `${
|
|
28673
|
+
"data-testid": `${IntegrationNames44.Shopify}-option`,
|
|
28981
28674
|
isActive: pathname.includes("/settings/integrations/shopify"),
|
|
28982
|
-
label:
|
|
28675
|
+
label: IntegrationDisplayNames15.Shopify,
|
|
28983
28676
|
onClick: () => {
|
|
28984
28677
|
navigate("/settings/integrations/shopify");
|
|
28985
28678
|
},
|
|
28986
28679
|
shouldKeepIconSpace: false
|
|
28987
28680
|
}
|
|
28988
28681
|
) : void 0,
|
|
28989
|
-
userHasInstalledWorkflows ? /* @__PURE__ */
|
|
28682
|
+
userHasInstalledWorkflows ? /* @__PURE__ */ jsx47(
|
|
28990
28683
|
SideNavigationItem,
|
|
28991
28684
|
{
|
|
28992
|
-
"data-testid": `${
|
|
28685
|
+
"data-testid": `${IntegrationNames44.HubSpot}-option`,
|
|
28993
28686
|
isActive: pathname.includes("/settings/integrations/hubspot"),
|
|
28994
|
-
label:
|
|
28687
|
+
label: IntegrationDisplayNames15.HubSpot,
|
|
28995
28688
|
onClick: () => {
|
|
28996
28689
|
navigate("/settings/integrations/hubspot");
|
|
28997
28690
|
},
|
|
28998
28691
|
shouldKeepIconSpace: false
|
|
28999
28692
|
}
|
|
29000
28693
|
) : void 0,
|
|
29001
|
-
userHasInstalledWorkflows ? /* @__PURE__ */
|
|
28694
|
+
userHasInstalledWorkflows ? /* @__PURE__ */ jsx47(
|
|
29002
28695
|
SideNavigationItem,
|
|
29003
28696
|
{
|
|
29004
|
-
"data-testid": `${
|
|
28697
|
+
"data-testid": `${IntegrationNames44.BigCommerce}-option`,
|
|
29005
28698
|
isActive: pathname.includes("/settings/integrations/bigcommerce"),
|
|
29006
|
-
label:
|
|
28699
|
+
label: IntegrationDisplayNames15.BigCommerce,
|
|
29007
28700
|
onClick: () => {
|
|
29008
28701
|
navigate("/settings/integrations/bigcommerce");
|
|
29009
28702
|
},
|
|
29010
28703
|
shouldKeepIconSpace: false
|
|
29011
28704
|
}
|
|
29012
28705
|
) : void 0,
|
|
29013
|
-
userHasInstalledWorkflows ? /* @__PURE__ */
|
|
28706
|
+
userHasInstalledWorkflows ? /* @__PURE__ */ jsx47(
|
|
29014
28707
|
SideNavigationItem,
|
|
29015
28708
|
{
|
|
29016
|
-
"data-testid": `${
|
|
28709
|
+
"data-testid": `${IntegrationNames44.Text}-option`,
|
|
29017
28710
|
isActive: pathname.includes("/settings/integrations/text"),
|
|
29018
|
-
label:
|
|
28711
|
+
label: IntegrationDisplayNames15.Text,
|
|
29019
28712
|
onClick: () => {
|
|
29020
28713
|
navigate("/settings/integrations/text/status");
|
|
29021
28714
|
},
|
|
@@ -29027,37 +28720,36 @@ function IntegrationsSubNavGroup() {
|
|
|
29027
28720
|
);
|
|
29028
28721
|
}
|
|
29029
28722
|
function Integrations() {
|
|
29030
|
-
return /* @__PURE__ */
|
|
29031
|
-
/* @__PURE__ */
|
|
29032
|
-
/* @__PURE__ */
|
|
29033
|
-
/* @__PURE__ */
|
|
29034
|
-
/* @__PURE__ */
|
|
29035
|
-
/* @__PURE__ */
|
|
29036
|
-
/* @__PURE__ */
|
|
29037
|
-
/* @__PURE__ */
|
|
29038
|
-
/* @__PURE__ */
|
|
29039
|
-
/* @__PURE__ */
|
|
29040
|
-
/* @__PURE__ */
|
|
29041
|
-
/* @__PURE__ */ jsx50(Route17, { element: /* @__PURE__ */ jsx50(Accounts_default, {}), path: "/accounts/*" })
|
|
28723
|
+
return /* @__PURE__ */ jsxs22(Routes16, { children: [
|
|
28724
|
+
/* @__PURE__ */ jsx47(Route16, { element: /* @__PURE__ */ jsx47(Navigate11, { replace: true, to: "github" }), path: "/" }),
|
|
28725
|
+
/* @__PURE__ */ jsx47(Route16, { element: /* @__PURE__ */ jsx47(GitHub_default, {}), path: "/github/*" }),
|
|
28726
|
+
/* @__PURE__ */ jsx47(Route16, { element: /* @__PURE__ */ jsx47(Netlify_default, {}), path: "/netlify/*" }),
|
|
28727
|
+
/* @__PURE__ */ jsx47(Route16, { element: /* @__PURE__ */ jsx47(Vercel_default, {}), path: "/vercel/*" }),
|
|
28728
|
+
/* @__PURE__ */ jsx47(Route16, { element: /* @__PURE__ */ jsx47(Mailchimp_default2, {}), path: "/mailchimp/*" }),
|
|
28729
|
+
/* @__PURE__ */ jsx47(Route16, { element: /* @__PURE__ */ jsx47(Shopify_default2, {}), path: "/shopify/*" }),
|
|
28730
|
+
/* @__PURE__ */ jsx47(Route16, { element: /* @__PURE__ */ jsx47(HubSpot_default2, {}), path: "/hubspot/*" }),
|
|
28731
|
+
/* @__PURE__ */ jsx47(Route16, { element: /* @__PURE__ */ jsx47(BigCommerce_default2, {}), path: "/bigcommerce/*" }),
|
|
28732
|
+
/* @__PURE__ */ jsx47(Route16, { element: /* @__PURE__ */ jsx47(Text_default2, {}), path: "/text/*" }),
|
|
28733
|
+
/* @__PURE__ */ jsx47(Route16, { element: /* @__PURE__ */ jsx47(Accounts_default, {}), path: "/accounts/*" })
|
|
29042
28734
|
] });
|
|
29043
28735
|
}
|
|
29044
28736
|
var Integrations_default = Integrations;
|
|
29045
28737
|
|
|
29046
28738
|
// src/views/Settings/index.tsx
|
|
29047
|
-
import { jsx as
|
|
28739
|
+
import { jsx as jsx48, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
29048
28740
|
function SettingsSubNav() {
|
|
29049
|
-
return /* @__PURE__ */
|
|
28741
|
+
return /* @__PURE__ */ jsx48(IntegrationsSubNavGroup, {});
|
|
29050
28742
|
}
|
|
29051
28743
|
function Settings() {
|
|
29052
|
-
return /* @__PURE__ */
|
|
29053
|
-
/* @__PURE__ */
|
|
29054
|
-
/* @__PURE__ */
|
|
28744
|
+
return /* @__PURE__ */ jsxs23(Routes17, { children: [
|
|
28745
|
+
/* @__PURE__ */ jsx48(Route17, { element: /* @__PURE__ */ jsx48(Navigate12, { replace: true, to: "integrations" }), path: "/" }),
|
|
28746
|
+
/* @__PURE__ */ jsx48(Route17, { element: /* @__PURE__ */ jsx48(Integrations_default, {}), path: "/integrations/*" })
|
|
29055
28747
|
] });
|
|
29056
28748
|
}
|
|
29057
28749
|
var Settings_default = Settings;
|
|
29058
28750
|
|
|
29059
28751
|
// src/views/Common/LoginError.tsx
|
|
29060
|
-
import { Button as
|
|
28752
|
+
import { Button as Button49, SpacingToken as SpacingToken57 } from "@livechat/design-system-react-components";
|
|
29061
28753
|
import {
|
|
29062
28754
|
Column as Column21,
|
|
29063
28755
|
Intro as Intro7,
|
|
@@ -29066,11 +28758,6 @@ import {
|
|
|
29066
28758
|
theme,
|
|
29067
28759
|
useRootContext as useRootContext30
|
|
29068
28760
|
} from "@livechat/developer-studio-ui-react";
|
|
29069
|
-
|
|
29070
|
-
// src/assets/flows/workflows-welcome.png
|
|
29071
|
-
var workflows_welcome_default = "./workflows-welcome-N73H5YQR.png";
|
|
29072
|
-
|
|
29073
|
-
// src/views/Common/LoginError.tsx
|
|
29074
28761
|
var imgContainerCss2 = css`
|
|
29075
28762
|
width: 100%;
|
|
29076
28763
|
display: flex;
|
|
@@ -29088,26 +28775,19 @@ var wrapperCss = css`
|
|
|
29088
28775
|
height: 100vh;
|
|
29089
28776
|
width: 100%;
|
|
29090
28777
|
`;
|
|
29091
|
-
function LoginErrorPage(
|
|
28778
|
+
function LoginErrorPage({
|
|
28779
|
+
errorImage,
|
|
28780
|
+
welcomeImage
|
|
28781
|
+
}) {
|
|
29092
28782
|
const { authorize } = useRootContext30();
|
|
29093
28783
|
if (getWorkflowEnv("isHeadless")) {
|
|
29094
28784
|
return /* @__PURE__ */ jsxs2("div", { css: wrapperCss, children: [
|
|
29095
|
-
/* @__PURE__ */ jsx4(Row31, { center: true, noMaxWidth: true, verticalCenter: true, children: /* @__PURE__ */ jsx4(Column21, { center: true, width: 10, children: /* @__PURE__ */ jsx4("div", { css: imgContainerCss2, children:
|
|
29096
|
-
"img",
|
|
29097
|
-
{
|
|
29098
|
-
alt: "",
|
|
29099
|
-
css: css`
|
|
29100
|
-
width: 600px;
|
|
29101
|
-
margin-bottom: var(${SpacingToken57.Spacing7});
|
|
29102
|
-
`,
|
|
29103
|
-
src: workflows_welcome_default
|
|
29104
|
-
}
|
|
29105
|
-
) }) }) }),
|
|
28785
|
+
/* @__PURE__ */ jsx4(Row31, { center: true, noMaxWidth: true, verticalCenter: true, children: /* @__PURE__ */ jsx4(Column21, { center: true, width: 10, children: /* @__PURE__ */ jsx4("div", { css: imgContainerCss2, children: welcomeImage }) }) }),
|
|
29106
28786
|
/* @__PURE__ */ jsx4(Row31, { center: true, noMaxWidth: true, verticalCenter: true, children: /* @__PURE__ */ jsxs2(Column21, { center: true, width: 10, children: [
|
|
29107
28787
|
/* @__PURE__ */ jsx4(Intro7, { center: true, header: "Welcome to Workflows!", headerSize: "m" }),
|
|
29108
28788
|
/* @__PURE__ */ jsx4("p", { css: paragraphCss(false), children: "You're using a browser that required additional login to access Workflows" }),
|
|
29109
28789
|
/* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
|
|
29110
|
-
|
|
28790
|
+
Button49,
|
|
29111
28791
|
{
|
|
29112
28792
|
kind: "primary",
|
|
29113
28793
|
onClick: () => {
|
|
@@ -29119,7 +28799,7 @@ function LoginErrorPage() {
|
|
|
29119
28799
|
] }) })
|
|
29120
28800
|
] });
|
|
29121
28801
|
}
|
|
29122
|
-
return /* @__PURE__ */ jsx4(DefaultLoginErrorPage, {});
|
|
28802
|
+
return /* @__PURE__ */ jsx4(DefaultLoginErrorPage, { image: errorImage });
|
|
29123
28803
|
}
|
|
29124
28804
|
var LoginError_default = LoginErrorPage;
|
|
29125
28805
|
export {
|