@livechat/platform-workflows 0.0.12 → 0.0.14
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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -10
- package/dist/index.mjs +22 -13
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { ConfigBase, Config } from '@livechat/developer-studio-ui-react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { IntegrationNames, GithubClientAuthorization, NetlifyClientAuthorization, VercelClientAuthorization, NeonClientAuthorization, MailchimpClientAuthorization, ShopifyClientAuthorization, HubspotClientAuthorization, BigCommerceClientAuthorization, TextClientAuthorization } from '@livechat/developer-studio-api';
|
|
4
4
|
|
|
5
|
-
interface WorkflowsConfigBase extends ConfigBase {
|
|
5
|
+
interface WorkflowsConfigBase extends Omit<ConfigBase, "accountsClientId"> {
|
|
6
6
|
publicUrl: string;
|
|
7
7
|
isHeadless?: boolean;
|
|
8
8
|
}
|
|
@@ -26,7 +26,7 @@ type WorkflowsConfig = WorkflowsConfigBase & Config & {
|
|
|
26
26
|
};
|
|
27
27
|
declare function setWorkflowsConfig(newConfig: Partial<WorkflowsConfigBase>): void;
|
|
28
28
|
declare function getWorkflowsConfig(): WorkflowsConfig;
|
|
29
|
-
declare const getWorkflowEnv: <T extends "
|
|
29
|
+
declare const getWorkflowEnv: <T extends "accountsClientId" | "env" | "publicUrl" | "isHeadless" | "bigcommerceClientId" | "githubAppClientId" | "githubOauthClientId" | "hubpotClientId" | "mailchimpClientId" | "neonClientId" | "netlifyClientId" | "shopifyClientId" | "vercelClientId" | "textClientId" | "workflowsAppId" | "workflowsWebhooksAppId" | "aiAgentId" | "pusherKey" | "amplitudeKey" | "accountsUrl" | "platformUrl" | "adapterUrl" | "workflowsApiUr" | "dpsApiUrl" | "billingApiUrl" | "adapterApiUrl" | "livechatApiUrl" | "textApiUrl">(key: T) => WorkflowsConfig[T];
|
|
30
30
|
|
|
31
31
|
type AuthSource = IntegrationNames.Accounts | IntegrationNames.GitHub | IntegrationNames.Vercel | IntegrationNames.Netlify | IntegrationNames.Neon | IntegrationNames.Mailchimp | IntegrationNames.Shopify | IntegrationNames.HubSpot | IntegrationNames.BigCommerce | IntegrationNames.Text;
|
|
32
32
|
interface AuthState {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ConfigBase, Config } from '@livechat/developer-studio-ui-react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { IntegrationNames, GithubClientAuthorization, NetlifyClientAuthorization, VercelClientAuthorization, NeonClientAuthorization, MailchimpClientAuthorization, ShopifyClientAuthorization, HubspotClientAuthorization, BigCommerceClientAuthorization, TextClientAuthorization } from '@livechat/developer-studio-api';
|
|
4
4
|
|
|
5
|
-
interface WorkflowsConfigBase extends ConfigBase {
|
|
5
|
+
interface WorkflowsConfigBase extends Omit<ConfigBase, "accountsClientId"> {
|
|
6
6
|
publicUrl: string;
|
|
7
7
|
isHeadless?: boolean;
|
|
8
8
|
}
|
|
@@ -26,7 +26,7 @@ type WorkflowsConfig = WorkflowsConfigBase & Config & {
|
|
|
26
26
|
};
|
|
27
27
|
declare function setWorkflowsConfig(newConfig: Partial<WorkflowsConfigBase>): void;
|
|
28
28
|
declare function getWorkflowsConfig(): WorkflowsConfig;
|
|
29
|
-
declare const getWorkflowEnv: <T extends "
|
|
29
|
+
declare const getWorkflowEnv: <T extends "accountsClientId" | "env" | "publicUrl" | "isHeadless" | "bigcommerceClientId" | "githubAppClientId" | "githubOauthClientId" | "hubpotClientId" | "mailchimpClientId" | "neonClientId" | "netlifyClientId" | "shopifyClientId" | "vercelClientId" | "textClientId" | "workflowsAppId" | "workflowsWebhooksAppId" | "aiAgentId" | "pusherKey" | "amplitudeKey" | "accountsUrl" | "platformUrl" | "adapterUrl" | "workflowsApiUr" | "dpsApiUrl" | "billingApiUrl" | "adapterApiUrl" | "livechatApiUrl" | "textApiUrl">(key: T) => WorkflowsConfig[T];
|
|
30
30
|
|
|
31
31
|
type AuthSource = IntegrationNames.Accounts | IntegrationNames.GitHub | IntegrationNames.Vercel | IntegrationNames.Netlify | IntegrationNames.Neon | IntegrationNames.Mailchimp | IntegrationNames.Shopify | IntegrationNames.HubSpot | IntegrationNames.BigCommerce | IntegrationNames.Text;
|
|
32
32
|
interface AuthState {
|
package/dist/index.js
CHANGED
|
@@ -492,11 +492,14 @@ var config = {
|
|
|
492
492
|
};
|
|
493
493
|
function setWorkflowsConfig(newConfig) {
|
|
494
494
|
config = __spreadValues(__spreadValues({}, config), newConfig);
|
|
495
|
+
(0, import_developer_studio_ui_react.setConfig)({
|
|
496
|
+
env: newConfig.env
|
|
497
|
+
});
|
|
495
498
|
}
|
|
496
499
|
function getWorkflowsConfig() {
|
|
497
500
|
const isProd = config.env === "prod";
|
|
498
501
|
const coreConfig = (0, import_developer_studio_ui_react.getConfig)();
|
|
499
|
-
return __spreadProps(__spreadValues(__spreadValues({},
|
|
502
|
+
return __spreadProps(__spreadValues(__spreadValues({}, coreConfig), config), {
|
|
500
503
|
// Authorization
|
|
501
504
|
accountsClientId: isProd ? "381b682538d896b6a25f54caf1805650" : "bc52b2c51dc4a5c2491ca49eaa7354d0",
|
|
502
505
|
bigcommerceClientId: isProd ? "af8s9yyeub656rb4iavnpi73l9doy5u" : "epcwshxqf6azf8hr6mvif4gaqyoa4y0",
|
|
@@ -24590,26 +24593,31 @@ var List_default2 = WorkflowList;
|
|
|
24590
24593
|
|
|
24591
24594
|
// src/views/Flows/Definitions/index.tsx
|
|
24592
24595
|
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
24593
|
-
|
|
24596
|
+
function Workflows() {
|
|
24594
24597
|
const navigate = (0, import_react_router_dom31.useNavigate)();
|
|
24595
24598
|
const {
|
|
24596
|
-
userData: { user, isLoading }
|
|
24599
|
+
userData: { user, isLoading: isUserLoading }
|
|
24597
24600
|
} = (0, import_developer_studio_ui_react57.useRootContext)();
|
|
24598
|
-
const { data: userHasInstalledWorkflows } = useFetchUserInstalledWorkflows(user);
|
|
24601
|
+
const { data: userHasInstalledWorkflows, isLoading: isWorkflowAppLoading } = useFetchUserInstalledWorkflows(user);
|
|
24599
24602
|
(0, import_react145.useEffect)(() => {
|
|
24600
|
-
if (
|
|
24603
|
+
if (isUserLoading || isWorkflowAppLoading) {
|
|
24601
24604
|
return;
|
|
24602
24605
|
}
|
|
24603
24606
|
if (!userHasInstalledWorkflows) {
|
|
24604
24607
|
navigate("/");
|
|
24605
24608
|
}
|
|
24606
|
-
}, [
|
|
24609
|
+
}, [
|
|
24610
|
+
navigate,
|
|
24611
|
+
isUserLoading,
|
|
24612
|
+
isWorkflowAppLoading,
|
|
24613
|
+
userHasInstalledWorkflows
|
|
24614
|
+
]);
|
|
24607
24615
|
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_react_router_dom31.Routes, { children: [
|
|
24608
|
-
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react_router_dom31.Route, {
|
|
24609
|
-
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react_router_dom31.Route, {
|
|
24610
|
-
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react_router_dom31.Route, {
|
|
24616
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react_router_dom31.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react_router_dom31.Navigate, { replace: true, to: "list" }), path: "" }),
|
|
24617
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react_router_dom31.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(List_default2, {}), path: "list/*" }),
|
|
24618
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react_router_dom31.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Edit_default2, {}), path: ":id/*" })
|
|
24611
24619
|
] });
|
|
24612
|
-
}
|
|
24620
|
+
}
|
|
24613
24621
|
var Definitions_default = Workflows;
|
|
24614
24622
|
|
|
24615
24623
|
// src/views/Flows/Waitlist/index.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -466,7 +466,8 @@ var require_extends = __commonJS({
|
|
|
466
466
|
|
|
467
467
|
// src/config.ts
|
|
468
468
|
import {
|
|
469
|
-
getConfig
|
|
469
|
+
getConfig,
|
|
470
|
+
setConfig
|
|
470
471
|
} from "@livechat/developer-studio-ui-react";
|
|
471
472
|
var config = {
|
|
472
473
|
env: "labs",
|
|
@@ -474,11 +475,14 @@ var config = {
|
|
|
474
475
|
};
|
|
475
476
|
function setWorkflowsConfig(newConfig) {
|
|
476
477
|
config = __spreadValues(__spreadValues({}, config), newConfig);
|
|
478
|
+
setConfig({
|
|
479
|
+
env: newConfig.env
|
|
480
|
+
});
|
|
477
481
|
}
|
|
478
482
|
function getWorkflowsConfig() {
|
|
479
483
|
const isProd = config.env === "prod";
|
|
480
484
|
const coreConfig = getConfig();
|
|
481
|
-
return __spreadProps(__spreadValues(__spreadValues({},
|
|
485
|
+
return __spreadProps(__spreadValues(__spreadValues({}, coreConfig), config), {
|
|
482
486
|
// Authorization
|
|
483
487
|
accountsClientId: isProd ? "381b682538d896b6a25f54caf1805650" : "bc52b2c51dc4a5c2491ca49eaa7354d0",
|
|
484
488
|
bigcommerceClientId: isProd ? "af8s9yyeub656rb4iavnpi73l9doy5u" : "epcwshxqf6azf8hr6mvif4gaqyoa4y0",
|
|
@@ -25188,26 +25192,31 @@ var List_default2 = WorkflowList;
|
|
|
25188
25192
|
|
|
25189
25193
|
// src/views/Flows/Definitions/index.tsx
|
|
25190
25194
|
import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
25191
|
-
|
|
25195
|
+
function Workflows() {
|
|
25192
25196
|
const navigate = useNavigate20();
|
|
25193
25197
|
const {
|
|
25194
|
-
userData: { user, isLoading }
|
|
25198
|
+
userData: { user, isLoading: isUserLoading }
|
|
25195
25199
|
} = useRootContext14();
|
|
25196
|
-
const { data: userHasInstalledWorkflows } = useFetchUserInstalledWorkflows(user);
|
|
25200
|
+
const { data: userHasInstalledWorkflows, isLoading: isWorkflowAppLoading } = useFetchUserInstalledWorkflows(user);
|
|
25197
25201
|
useEffect21(() => {
|
|
25198
|
-
if (
|
|
25202
|
+
if (isUserLoading || isWorkflowAppLoading) {
|
|
25199
25203
|
return;
|
|
25200
25204
|
}
|
|
25201
25205
|
if (!userHasInstalledWorkflows) {
|
|
25202
25206
|
navigate("/");
|
|
25203
25207
|
}
|
|
25204
|
-
}, [
|
|
25208
|
+
}, [
|
|
25209
|
+
navigate,
|
|
25210
|
+
isUserLoading,
|
|
25211
|
+
isWorkflowAppLoading,
|
|
25212
|
+
userHasInstalledWorkflows
|
|
25213
|
+
]);
|
|
25205
25214
|
return /* @__PURE__ */ jsxs11(Routes5, { children: [
|
|
25206
|
-
/* @__PURE__ */ jsx22(Route5, {
|
|
25207
|
-
/* @__PURE__ */ jsx22(Route5, {
|
|
25208
|
-
/* @__PURE__ */ jsx22(Route5, {
|
|
25215
|
+
/* @__PURE__ */ jsx22(Route5, { element: /* @__PURE__ */ jsx22(Navigate2, { replace: true, to: "list" }), path: "" }),
|
|
25216
|
+
/* @__PURE__ */ jsx22(Route5, { element: /* @__PURE__ */ jsx22(List_default2, {}), path: "list/*" }),
|
|
25217
|
+
/* @__PURE__ */ jsx22(Route5, { element: /* @__PURE__ */ jsx22(Edit_default2, {}), path: ":id/*" })
|
|
25209
25218
|
] });
|
|
25210
|
-
}
|
|
25219
|
+
}
|
|
25211
25220
|
var Definitions_default = Workflows;
|
|
25212
25221
|
|
|
25213
25222
|
// src/views/Flows/Waitlist/index.tsx
|
|
@@ -25548,7 +25557,7 @@ function IntegrationStatusCredentials({
|
|
|
25548
25557
|
}
|
|
25549
25558
|
|
|
25550
25559
|
// src/views/Settings/Integrations/Common/IntegrationStatus.tsx
|
|
25551
|
-
import
|
|
25560
|
+
import React25 from "react";
|
|
25552
25561
|
import {
|
|
25553
25562
|
DesignToken as DesignToken51,
|
|
25554
25563
|
SpacingToken as SpacingToken51
|
|
@@ -25590,7 +25599,7 @@ var IntegrationStatusView = (props) => {
|
|
|
25590
25599
|
width: 100%;
|
|
25591
25600
|
`,
|
|
25592
25601
|
dataCy: props.dataCy,
|
|
25593
|
-
children: /* @__PURE__ */ jsxs2(
|
|
25602
|
+
children: /* @__PURE__ */ jsxs2(React25.Fragment, { children: [
|
|
25594
25603
|
/* @__PURE__ */ jsxs2(Row25, { notPadded: true, css: infoContainerCss, children: [
|
|
25595
25604
|
/* @__PURE__ */ jsx4(Column19, { center: true, width: 2, setColumnPadding: 28, children: props.imgSrc ? /* @__PURE__ */ jsx4(
|
|
25596
25605
|
"img",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livechat/platform-workflows",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Text Platform | Workflows",
|
|
5
5
|
"author": "Wojciech Dudek",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"postcss-modules": "^6.0.0",
|
|
41
41
|
"tsup": "^8.0.0",
|
|
42
42
|
"typescript": "^5.1.6",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
43
|
+
"eslint-config-custom": "0.0.10",
|
|
44
|
+
"tsconfig": "0.0.1"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@lexical/react": "^0.19.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"validator": "^13.12.0",
|
|
79
79
|
"web-worker": "^1.3.0",
|
|
80
80
|
"@livechat/developer-studio-api": "3.3.6",
|
|
81
|
-
"@livechat/developer-studio-ui-react": "0.0.
|
|
81
|
+
"@livechat/developer-studio-ui-react": "0.0.54"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"@tanstack/react-query": "4.36.1",
|