@livechat/platform-workflows 0.0.15 → 0.0.16
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.js +1030 -820
- package/dist/index.mjs +1102 -889
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -262,7 +262,7 @@ var require_react_is_development = __commonJS({
|
|
|
262
262
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
263
263
|
var Element = REACT_ELEMENT_TYPE;
|
|
264
264
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
265
|
-
var
|
|
265
|
+
var Fragment46 = REACT_FRAGMENT_TYPE;
|
|
266
266
|
var Lazy = REACT_LAZY_TYPE;
|
|
267
267
|
var Memo = REACT_MEMO_TYPE;
|
|
268
268
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -321,7 +321,7 @@ var require_react_is_development = __commonJS({
|
|
|
321
321
|
exports2.ContextProvider = ContextProvider;
|
|
322
322
|
exports2.Element = Element;
|
|
323
323
|
exports2.ForwardRef = ForwardRef;
|
|
324
|
-
exports2.Fragment =
|
|
324
|
+
exports2.Fragment = Fragment46;
|
|
325
325
|
exports2.Lazy = Lazy;
|
|
326
326
|
exports2.Memo = Memo;
|
|
327
327
|
exports2.Portal = Portal;
|
|
@@ -1024,7 +1024,7 @@ var import_react_router_dom33 = require("react-router-dom");
|
|
|
1024
1024
|
// src/views/Flows/Definitions/index.tsx
|
|
1025
1025
|
var import_react145 = require("react");
|
|
1026
1026
|
var import_react_router_dom31 = require("react-router-dom");
|
|
1027
|
-
var
|
|
1027
|
+
var import_developer_studio_ui_react59 = require("@livechat/developer-studio-ui-react");
|
|
1028
1028
|
|
|
1029
1029
|
// src/hooks/state/apps/apps.ts
|
|
1030
1030
|
var import_react2 = require("react");
|
|
@@ -1046,11 +1046,12 @@ var appQueryKeys = {
|
|
|
1046
1046
|
getAppVariables: (appId, decrypted) => ["console.getAppVariables", appId, decrypted].filter(
|
|
1047
1047
|
(criteria) => criteria !== void 0
|
|
1048
1048
|
),
|
|
1049
|
-
getAutoReview: (appId) => ["dps.getAutoReview", appId]
|
|
1049
|
+
getAutoReview: (appId) => ["dps.getAutoReview", appId],
|
|
1050
|
+
getAppInstalled: (appId) => ["dps.getAppInstalled", appId]
|
|
1050
1051
|
};
|
|
1051
1052
|
var useFetchInstalledApp = (appId, license) => {
|
|
1052
1053
|
return (0, import_react_query.useQuery)(
|
|
1053
|
-
appQueryKeys.
|
|
1054
|
+
appQueryKeys.getAppInstalled(appId),
|
|
1054
1055
|
() => __async(void 0, null, function* () {
|
|
1055
1056
|
const { data } = yield import_developer_studio_api2.api.platform.dps.applications.application.install.getInstalledApplication(
|
|
1056
1057
|
appId,
|
|
@@ -1087,7 +1088,7 @@ var useFetchUserInstalledWorkflows = (user) => {
|
|
|
1087
1088
|
// src/views/Flows/Definitions/Edit/index.tsx
|
|
1088
1089
|
var import_react127 = require("react");
|
|
1089
1090
|
var import_react_router_dom21 = require("react-router-dom");
|
|
1090
|
-
var
|
|
1091
|
+
var import_developer_studio_ui_react48 = require("@livechat/developer-studio-ui-react");
|
|
1091
1092
|
|
|
1092
1093
|
// src/views/Flows/Definitions/Common/Builder/config/workflow.ts
|
|
1093
1094
|
var import_developer_studio_api11 = require("@livechat/developer-studio-api");
|
|
@@ -8053,7 +8054,7 @@ var import_react9 = require("react");
|
|
|
8053
8054
|
var import_react_router_dom = require("react-router-dom");
|
|
8054
8055
|
var import_reactflow = require("reactflow");
|
|
8055
8056
|
var import_lodash = require("lodash");
|
|
8056
|
-
var
|
|
8057
|
+
var import_developer_studio_api19 = require("@livechat/developer-studio-api");
|
|
8057
8058
|
var import_developer_studio_ui_react6 = require("@livechat/developer-studio-ui-react");
|
|
8058
8059
|
|
|
8059
8060
|
// src/views/Flows/Definitions/hooks.ts
|
|
@@ -9060,9 +9061,63 @@ var getWorkflowFrames = (workflow, credentials) => {
|
|
|
9060
9061
|
// src/views/Flows/Definitions/Common/Builder/Context/state/metadata/hooks.ts
|
|
9061
9062
|
var import_react6 = require("react");
|
|
9062
9063
|
|
|
9064
|
+
// src/hooks/user.ts
|
|
9065
|
+
var import_react_query4 = require("@tanstack/react-query");
|
|
9066
|
+
var import_developer_studio_api16 = require("@livechat/developer-studio-api");
|
|
9067
|
+
var userQueryKeys = {
|
|
9068
|
+
dps: {
|
|
9069
|
+
getUser: ["dps.getUser"],
|
|
9070
|
+
getUserIntegrations: ["dps.getUserIntegrations"]
|
|
9071
|
+
},
|
|
9072
|
+
livechat: {
|
|
9073
|
+
agent: {
|
|
9074
|
+
getUser: ["livechat.agent.getUser"]
|
|
9075
|
+
}
|
|
9076
|
+
},
|
|
9077
|
+
accounts: {
|
|
9078
|
+
account: {
|
|
9079
|
+
getInfo: ["accounts.account.getInfo"]
|
|
9080
|
+
},
|
|
9081
|
+
products: {
|
|
9082
|
+
getOrganizationProducts: ["accounts.products.getOrganizationProducts"]
|
|
9083
|
+
}
|
|
9084
|
+
}
|
|
9085
|
+
};
|
|
9086
|
+
var useFetchUserIntegrationsQuery = () => {
|
|
9087
|
+
return (0, import_react_query4.useQuery)(
|
|
9088
|
+
userQueryKeys.dps.getUserIntegrations,
|
|
9089
|
+
() => import_developer_studio_api16.api.platform.dps.user.getUserIntegrations()
|
|
9090
|
+
);
|
|
9091
|
+
};
|
|
9092
|
+
var useFetchOrganizationProducts = () => {
|
|
9093
|
+
var _b;
|
|
9094
|
+
const _a = (0, import_react_query4.useQuery)(
|
|
9095
|
+
userQueryKeys.accounts.products.getOrganizationProducts,
|
|
9096
|
+
() => import_developer_studio_api16.api.platform.accounts.products.getOrganizationProducts()
|
|
9097
|
+
), { data, isLoading } = _a, rest = __objRest(_a, ["data", "isLoading"]);
|
|
9098
|
+
return __spreadValues({ data: (_b = data == null ? void 0 : data.data) != null ? _b : [], isLoading }, rest);
|
|
9099
|
+
};
|
|
9100
|
+
var useUpdateOrganizationProducts = () => {
|
|
9101
|
+
const queryClient = (0, import_react_query4.useQueryClient)();
|
|
9102
|
+
const { mutateAsync: updateOrganizationProducts, isLoading } = (0, import_react_query4.useMutation)(
|
|
9103
|
+
({ productName }) => import_developer_studio_api16.api.platform.accounts.products.updateOrganizationProducts({
|
|
9104
|
+
product: productName
|
|
9105
|
+
}),
|
|
9106
|
+
{
|
|
9107
|
+
onSuccess: (_) => {
|
|
9108
|
+
queryClient.refetchQueries({
|
|
9109
|
+
queryKey: userQueryKeys.accounts.products.getOrganizationProducts
|
|
9110
|
+
});
|
|
9111
|
+
}
|
|
9112
|
+
}
|
|
9113
|
+
);
|
|
9114
|
+
return { updateOrganizationProducts, isLoading };
|
|
9115
|
+
};
|
|
9116
|
+
|
|
9063
9117
|
// src/views/Flows/Definitions/Common/Builder/Context/state/metadata/validation/utils.ts
|
|
9064
9118
|
var import_ajv = __toESM(require("ajv"));
|
|
9065
9119
|
var import_ajv_errors = __toESM(require("ajv-errors"));
|
|
9120
|
+
var import_developer_studio_api17 = require("@livechat/developer-studio-api");
|
|
9066
9121
|
var ajv = (0, import_ajv_errors.default)(
|
|
9067
9122
|
new import_ajv.default({
|
|
9068
9123
|
strict: false,
|
|
@@ -9084,8 +9139,12 @@ var getWorkflowValidationErrors = (validationErrors) => {
|
|
|
9084
9139
|
if (!fieldErrors.__errors) {
|
|
9085
9140
|
fieldErrors.__errors = [];
|
|
9086
9141
|
}
|
|
9142
|
+
if (!fieldErrors.__errorsExtended) {
|
|
9143
|
+
fieldErrors.__errorsExtended = [];
|
|
9144
|
+
}
|
|
9087
9145
|
if (item.message && item.message !== 'must match "then" schema') {
|
|
9088
9146
|
fieldErrors.__errors.push(item.message);
|
|
9147
|
+
fieldErrors.__errorsExtended.push(item);
|
|
9089
9148
|
}
|
|
9090
9149
|
} else {
|
|
9091
9150
|
if (!current[head]) {
|
|
@@ -9106,7 +9165,7 @@ var getWorkflowValidationErrors = (validationErrors) => {
|
|
|
9106
9165
|
}
|
|
9107
9166
|
return errors;
|
|
9108
9167
|
};
|
|
9109
|
-
var
|
|
9168
|
+
var getSchemaError = (workflow, frames) => {
|
|
9110
9169
|
const validate = ajv.compile(WORKFLOW_SCHEMA);
|
|
9111
9170
|
const resolved = __spreadProps(__spreadValues({}, workflow), {
|
|
9112
9171
|
definition: __spreadProps(__spreadValues({}, workflow.definition), {
|
|
@@ -9128,101 +9187,122 @@ var getWorkflowValidation = (workflow, frames) => {
|
|
|
9128
9187
|
}
|
|
9129
9188
|
) : void 0
|
|
9130
9189
|
});
|
|
9131
|
-
console.log(resolved);
|
|
9132
9190
|
validate(resolved);
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9191
|
+
return validate.errors || [];
|
|
9192
|
+
};
|
|
9193
|
+
var getTasksErrors = (workflow, frames, products) => {
|
|
9194
|
+
return workflow.definition.tasks.flatMap((task2, index) => {
|
|
9195
|
+
var _a;
|
|
9196
|
+
const globalFrame = frames.global;
|
|
9197
|
+
const frame = frames.tasks[task2.taskReferenceName];
|
|
9198
|
+
const config14 = (_a = frame.__meta) == null ? void 0 : _a.config;
|
|
9199
|
+
const resolvingErrors = workflowBuilderUtils.getMatchesInObject(task2).map((match2) => {
|
|
9200
|
+
var _a2, _b;
|
|
9201
|
+
const segments = match2.rawValue.split(".");
|
|
9202
|
+
const resolved = workflowBuilderUtils.resolveTextByContext(
|
|
9203
|
+
match2.value,
|
|
9204
|
+
frame
|
|
9205
|
+
);
|
|
9206
|
+
let message = `Invalid field value`;
|
|
9207
|
+
const params = {};
|
|
9208
|
+
if (!(frame == null ? void 0 : frame[segments[0]])) {
|
|
9209
|
+
if (segments[0]) {
|
|
9210
|
+
if (globalFrame == null ? void 0 : globalFrame[segments[0]]) {
|
|
9211
|
+
message += " - task not accessible";
|
|
9212
|
+
} else {
|
|
9213
|
+
message += " - task not found";
|
|
9152
9214
|
}
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
return error;
|
|
9161
|
-
}
|
|
9162
|
-
if (!resolved2) {
|
|
9163
|
-
let message = `Invalid field value`;
|
|
9164
|
-
if (segments[0] === "workflow") {
|
|
9165
|
-
if (segments[1] === "input") {
|
|
9166
|
-
if (segments[2] === "body") {
|
|
9167
|
-
if (workflow.trigger.type) {
|
|
9168
|
-
message += " - invalid trigger property";
|
|
9169
|
-
} else {
|
|
9170
|
-
message += " - trigger not found";
|
|
9171
|
-
}
|
|
9215
|
+
}
|
|
9216
|
+
} else {
|
|
9217
|
+
if (segments[0] === "workflow") {
|
|
9218
|
+
if (segments[1] === "input") {
|
|
9219
|
+
if (segments[2] === "body") {
|
|
9220
|
+
if (workflow.trigger.type) {
|
|
9221
|
+
message += " - invalid trigger property";
|
|
9172
9222
|
} else {
|
|
9173
|
-
|
|
9174
|
-
message = `Couldn't use manual parameters when trigger is not manual`;
|
|
9175
|
-
} else {
|
|
9176
|
-
message += " - invalid input property";
|
|
9177
|
-
}
|
|
9223
|
+
message += " - trigger not found";
|
|
9178
9224
|
}
|
|
9179
|
-
} else
|
|
9180
|
-
if (
|
|
9181
|
-
|
|
9182
|
-
message += " - invalid credential";
|
|
9183
|
-
} else {
|
|
9184
|
-
if (segments[3]) {
|
|
9185
|
-
message += " - invalid credential property";
|
|
9186
|
-
} else {
|
|
9187
|
-
message += " - unknown credential";
|
|
9188
|
-
}
|
|
9189
|
-
}
|
|
9225
|
+
} else {
|
|
9226
|
+
if (!workflow.trigger.type || workflow.trigger.type === "recurring" || workflow.trigger.type === "webhook") {
|
|
9227
|
+
message = `Couldn't use manual parameters when trigger is not manual`;
|
|
9190
9228
|
} else {
|
|
9229
|
+
message += " - invalid input property";
|
|
9230
|
+
}
|
|
9231
|
+
}
|
|
9232
|
+
} else if (segments[1] === "credentials") {
|
|
9233
|
+
if (segments[2]) {
|
|
9234
|
+
params.subType = segments[1];
|
|
9235
|
+
params.provider = segments[2];
|
|
9236
|
+
if (!((_b = (_a2 = frame == null ? void 0 : frame.workflow) == null ? void 0 : _a2.credentials) == null ? void 0 : _b[segments[2]])) {
|
|
9191
9237
|
message += " - invalid credential";
|
|
9238
|
+
} else {
|
|
9239
|
+
if (segments[3]) {
|
|
9240
|
+
message += " - invalid credential property";
|
|
9241
|
+
} else {
|
|
9242
|
+
message += " - unknown credential";
|
|
9243
|
+
}
|
|
9192
9244
|
}
|
|
9193
9245
|
} else {
|
|
9194
|
-
message += " - invalid
|
|
9246
|
+
message += " - invalid credential";
|
|
9195
9247
|
}
|
|
9196
9248
|
} else {
|
|
9197
|
-
message += " - invalid
|
|
9198
|
-
}
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
message,
|
|
9202
|
-
keyword: "resolver",
|
|
9203
|
-
schemaPath: "",
|
|
9204
|
-
params: {}
|
|
9205
|
-
};
|
|
9206
|
-
return error;
|
|
9249
|
+
message += " - invalid property";
|
|
9250
|
+
}
|
|
9251
|
+
} else {
|
|
9252
|
+
message += " - invalid task property";
|
|
9207
9253
|
}
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9254
|
+
if (resolved) {
|
|
9255
|
+
return void 0;
|
|
9256
|
+
}
|
|
9257
|
+
}
|
|
9258
|
+
return {
|
|
9259
|
+
instancePath: `/definition/tasks/${index}/${match2.instancePath}`,
|
|
9260
|
+
keyword: "resolver",
|
|
9261
|
+
message,
|
|
9262
|
+
params
|
|
9263
|
+
};
|
|
9264
|
+
}).filter(Boolean);
|
|
9265
|
+
const connectionErrors = resolvingErrors.filter((error) => error.params.subType === "credentials").map((error) => {
|
|
9266
|
+
return {
|
|
9267
|
+
instancePath: `/definition/tasks/${index}`,
|
|
9268
|
+
keyword: "connection",
|
|
9269
|
+
message: `Not connected to ${error.params.provider}`,
|
|
9270
|
+
params: {}
|
|
9271
|
+
};
|
|
9272
|
+
});
|
|
9273
|
+
const activationError = config14 && (config14 == null ? void 0 : config14.customization.provider.startsWith(import_developer_studio_api17.IntegrationNames.Text)) && !products.find(({ product }) => product === config14.customization.product) ? {
|
|
9274
|
+
instancePath: `/definition/tasks/${index}`,
|
|
9275
|
+
keyword: "activation",
|
|
9276
|
+
message: `${config14.customization.product} not activated`,
|
|
9277
|
+
params: {}
|
|
9278
|
+
} : void 0;
|
|
9279
|
+
return [
|
|
9280
|
+
...resolvingErrors,
|
|
9281
|
+
...connectionErrors,
|
|
9282
|
+
...activationError ? [activationError] : []
|
|
9283
|
+
];
|
|
9284
|
+
});
|
|
9285
|
+
};
|
|
9286
|
+
var getTriggerErrors = (workflow, frames, products) => {
|
|
9287
|
+
var _a;
|
|
9288
|
+
const frame = frames.trigger;
|
|
9289
|
+
const config14 = (_a = frame == null ? void 0 : frame.__meta) == null ? void 0 : _a.config;
|
|
9290
|
+
const resolvingErrors = workflowBuilderUtils.getMatchesInObject(workflow.trigger).map((match2) => {
|
|
9291
|
+
var _a2, _b;
|
|
9215
9292
|
const segments = match2.rawValue.split(".");
|
|
9216
|
-
const
|
|
9293
|
+
const resolved = workflowBuilderUtils.resolveTextByContext(
|
|
9217
9294
|
match2.value,
|
|
9218
9295
|
frames.trigger
|
|
9219
9296
|
);
|
|
9220
|
-
if (!
|
|
9297
|
+
if (!resolved) {
|
|
9221
9298
|
let message = `Invalid field value`;
|
|
9299
|
+
const params = {};
|
|
9222
9300
|
if (segments[0] === "workflow") {
|
|
9223
9301
|
if (segments[1] === "credentials") {
|
|
9224
9302
|
if (segments[2]) {
|
|
9225
|
-
|
|
9303
|
+
params.subType = segments[1];
|
|
9304
|
+
params.provider = segments[2];
|
|
9305
|
+
if (!((_b = (_a2 = frame == null ? void 0 : frame.workflow) == null ? void 0 : _a2.credentials) == null ? void 0 : _b[segments[2]])) {
|
|
9226
9306
|
message += " - invalid credential";
|
|
9227
9307
|
} else {
|
|
9228
9308
|
if (segments[3]) {
|
|
@@ -9240,22 +9320,43 @@ var getWorkflowValidation = (workflow, frames) => {
|
|
|
9240
9320
|
} else {
|
|
9241
9321
|
message += " - invalid trigger property";
|
|
9242
9322
|
}
|
|
9243
|
-
|
|
9323
|
+
return {
|
|
9244
9324
|
instancePath: `/trigger/${match2.instancePath}`,
|
|
9245
|
-
message,
|
|
9246
9325
|
keyword: "resolver",
|
|
9247
|
-
|
|
9248
|
-
params
|
|
9326
|
+
message,
|
|
9327
|
+
params
|
|
9249
9328
|
};
|
|
9250
|
-
return error;
|
|
9251
9329
|
}
|
|
9252
9330
|
return void 0;
|
|
9331
|
+
}).filter(Boolean);
|
|
9332
|
+
const connectionErrors = resolvingErrors.filter((error) => error.params.subType === "credentials").map((error) => {
|
|
9333
|
+
return {
|
|
9334
|
+
instancePath: `/trigger`,
|
|
9335
|
+
keyword: "connection",
|
|
9336
|
+
message: `Not connected to ${error.params.provider}`,
|
|
9337
|
+
params: {}
|
|
9338
|
+
};
|
|
9253
9339
|
});
|
|
9254
|
-
const
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9340
|
+
const activationError = config14 && (config14 == null ? void 0 : config14.customization.provider.startsWith(import_developer_studio_api17.IntegrationNames.Text)) && !products.find(({ product }) => product === config14.customization.product) ? {
|
|
9341
|
+
instancePath: `/trigger`,
|
|
9342
|
+
keyword: "activation",
|
|
9343
|
+
message: `${config14.customization.product} not activated`,
|
|
9344
|
+
params: {}
|
|
9345
|
+
} : void 0;
|
|
9346
|
+
console.log("activationError: ", activationError);
|
|
9347
|
+
return [
|
|
9348
|
+
...resolvingErrors,
|
|
9349
|
+
...connectionErrors,
|
|
9350
|
+
...activationError ? [activationError] : []
|
|
9351
|
+
];
|
|
9352
|
+
};
|
|
9353
|
+
var getWorkflowValidation = (workflow, frames, products) => {
|
|
9354
|
+
const schemaError = getSchemaError(workflow, frames);
|
|
9355
|
+
const tasksErrors = getTasksErrors(workflow, frames, products);
|
|
9356
|
+
const triggerErrors = getTriggerErrors(workflow, frames, products);
|
|
9357
|
+
const rawErrors = [...triggerErrors, ...tasksErrors, ...schemaError].filter(
|
|
9358
|
+
(rawError) => Boolean(rawError)
|
|
9359
|
+
).map((rawError) => {
|
|
9259
9360
|
var _a;
|
|
9260
9361
|
let message = rawError.message;
|
|
9261
9362
|
if ("missingProperty" in rawError.params) {
|
|
@@ -9272,7 +9373,6 @@ var getWorkflowValidation = (workflow, frames) => {
|
|
|
9272
9373
|
instanceJsonPath.replaceAll("/", "."),
|
|
9273
9374
|
workflow
|
|
9274
9375
|
)) == null ? void 0 : _a[0] : void 0;
|
|
9275
|
-
console.log(value);
|
|
9276
9376
|
if (value === null) {
|
|
9277
9377
|
message = `This field cannot be empty`;
|
|
9278
9378
|
} else {
|
|
@@ -9294,13 +9394,13 @@ var getWorkflowValidation = (workflow, frames) => {
|
|
|
9294
9394
|
default:
|
|
9295
9395
|
break;
|
|
9296
9396
|
}
|
|
9297
|
-
return {
|
|
9397
|
+
return __spreadProps(__spreadValues({}, rawError), {
|
|
9298
9398
|
message,
|
|
9299
9399
|
instancePath: rawError.instancePath.replace(
|
|
9300
9400
|
/tasks\/(\d+)/,
|
|
9301
9401
|
(_, i) => `tasks/${workflow.definition.tasks[i].taskReferenceName}`
|
|
9302
9402
|
)
|
|
9303
|
-
};
|
|
9403
|
+
});
|
|
9304
9404
|
});
|
|
9305
9405
|
const errors = getWorkflowValidationErrors(rawErrors);
|
|
9306
9406
|
return {
|
|
@@ -9313,15 +9413,20 @@ var getWorkflowValidation = (workflow, frames) => {
|
|
|
9313
9413
|
// src/views/Flows/Definitions/Common/Builder/Context/state/metadata/hooks.ts
|
|
9314
9414
|
function useWorkflowMetadata(workflow) {
|
|
9315
9415
|
const credentialsQuery = useFetchIntegrationCredentialsQuery();
|
|
9416
|
+
const organizationProducts = useFetchOrganizationProducts();
|
|
9316
9417
|
const metadata = (0, import_react6.useMemo)(() => {
|
|
9317
|
-
var _a;
|
|
9418
|
+
var _a, _b;
|
|
9318
9419
|
const frames = getWorkflowFrames(workflow, (_a = credentialsQuery.data) != null ? _a : []);
|
|
9319
|
-
const validation = getWorkflowValidation(
|
|
9420
|
+
const validation = getWorkflowValidation(
|
|
9421
|
+
workflow,
|
|
9422
|
+
frames,
|
|
9423
|
+
(_b = organizationProducts.data) != null ? _b : []
|
|
9424
|
+
);
|
|
9320
9425
|
return {
|
|
9321
9426
|
frames,
|
|
9322
9427
|
validation
|
|
9323
9428
|
};
|
|
9324
|
-
}, [workflow, credentialsQuery.data]);
|
|
9429
|
+
}, [workflow, credentialsQuery.data, organizationProducts.data]);
|
|
9325
9430
|
return {
|
|
9326
9431
|
metadata
|
|
9327
9432
|
};
|
|
@@ -9356,14 +9461,14 @@ function useWorkflowState(workflow, options2) {
|
|
|
9356
9461
|
}
|
|
9357
9462
|
|
|
9358
9463
|
// src/views/Flows/Definitions/Common/Builder/Context/utils.ts
|
|
9359
|
-
var
|
|
9464
|
+
var import_developer_studio_api18 = require("@livechat/developer-studio-api");
|
|
9360
9465
|
var flattenTasks = (tasks) => tasks.flatMap((task2) => {
|
|
9361
|
-
if (task2.type ===
|
|
9466
|
+
if (task2.type === import_developer_studio_api18.WorkflowDefinitionTaskType.switch) {
|
|
9362
9467
|
return [
|
|
9363
9468
|
task2,
|
|
9364
9469
|
...Object.values(task2.decisionCases).flatMap((a) => flattenTasks(a))
|
|
9365
9470
|
];
|
|
9366
|
-
} else if (task2.type ===
|
|
9471
|
+
} else if (task2.type === import_developer_studio_api18.WorkflowDefinitionTaskType.forkJoin) {
|
|
9367
9472
|
return [task2, ...task2.forkTasks.flat()];
|
|
9368
9473
|
} else {
|
|
9369
9474
|
return [task2];
|
|
@@ -9371,7 +9476,7 @@ var flattenTasks = (tasks) => tasks.flatMap((task2) => {
|
|
|
9371
9476
|
});
|
|
9372
9477
|
var applyChange = (workflow, change) => {
|
|
9373
9478
|
var _a, _b;
|
|
9374
|
-
let changed = (0,
|
|
9479
|
+
let changed = (0, import_developer_studio_api18.mergeDeep)(workflow, change);
|
|
9375
9480
|
const inputParameters = Array.from(
|
|
9376
9481
|
new Set(
|
|
9377
9482
|
(_b = (_a = workflowBuilderUtils.getMatchesInText(JSON.stringify(changed))) == null ? void 0 : _a.filter((x) => x.includes("workflow.input.") && !x.includes("body")).map((x) => x.replace("workflow.input.", "")).filter((x) => x.length > 0)) != null ? _b : []
|
|
@@ -10714,10 +10819,10 @@ function WorkflowContextProviderBase({
|
|
|
10714
10819
|
setTimeout(() => {
|
|
10715
10820
|
setSelection(() => {
|
|
10716
10821
|
const isNotEditable = (params == null ? void 0 : params.kind) === "task" && [
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10822
|
+
import_developer_studio_api19.WorkflowDefinitionTaskType.forkJoin,
|
|
10823
|
+
import_developer_studio_api19.WorkflowDefinitionTaskType.join,
|
|
10824
|
+
import_developer_studio_api19.WorkflowDefinitionTaskType.addNode,
|
|
10825
|
+
import_developer_studio_api19.WorkflowDefinitionTaskType.addTrigger
|
|
10721
10826
|
].includes(params.id) || (params == null ? void 0 : params.kind) === "add-trigger" || (params == null ? void 0 : params.kind) === "trigger" && params.id === "manual_only";
|
|
10722
10827
|
return params ? __spreadProps(__spreadValues({}, params), {
|
|
10723
10828
|
isEditable: !isNotEditable
|
|
@@ -11488,7 +11593,7 @@ tags.forEach(function(tagName) {
|
|
|
11488
11593
|
// src/views/Flows/Definitions/Common/Modals/Delete.tsx
|
|
11489
11594
|
var import_design_system_icons34 = require("@livechat/design-system-icons");
|
|
11490
11595
|
var import_design_system_react_components66 = require("@livechat/design-system-react-components");
|
|
11491
|
-
var
|
|
11596
|
+
var import_developer_studio_ui_react41 = require("@livechat/developer-studio-ui-react");
|
|
11492
11597
|
|
|
11493
11598
|
// src/utils/tracking.ts
|
|
11494
11599
|
var import_amplitude_js = __toESM(require("amplitude-js"));
|
|
@@ -11701,7 +11806,7 @@ var import_developer_studio_ui_react10 = require("@livechat/developer-studio-ui-
|
|
|
11701
11806
|
// src/views/Flows/Definitions/Common/Icons/ProductIcon.tsx
|
|
11702
11807
|
var import_design_system_icons2 = require("@livechat/design-system-icons");
|
|
11703
11808
|
var import_design_system_react_components2 = require("@livechat/design-system-react-components");
|
|
11704
|
-
var
|
|
11809
|
+
var import_developer_studio_api20 = require("@livechat/developer-studio-api");
|
|
11705
11810
|
var defaultIconStyle = ({
|
|
11706
11811
|
disabled,
|
|
11707
11812
|
height,
|
|
@@ -11792,11 +11897,11 @@ var ProductIcon = ({
|
|
|
11792
11897
|
})
|
|
11793
11898
|
}
|
|
11794
11899
|
);
|
|
11795
|
-
case
|
|
11900
|
+
case import_developer_studio_api20.IntegrationNames.Mailchimp:
|
|
11796
11901
|
return /* @__PURE__ */ jsx4(import_design_system_icons2.Mailchimp, { css: defaultIconStyle({ disabled, height, width }) });
|
|
11797
|
-
case
|
|
11902
|
+
case import_developer_studio_api20.IntegrationNames.Shopify:
|
|
11798
11903
|
return /* @__PURE__ */ jsx4(import_design_system_icons2.ShopifyColored, { css: defaultIconStyle({ disabled, height, width }) });
|
|
11799
|
-
case
|
|
11904
|
+
case import_developer_studio_api20.IntegrationNames.BigCommerce:
|
|
11800
11905
|
return /* @__PURE__ */ jsx4(
|
|
11801
11906
|
import_design_system_icons2.BigCommerceColored,
|
|
11802
11907
|
{
|
|
@@ -11808,7 +11913,7 @@ var ProductIcon = ({
|
|
|
11808
11913
|
})
|
|
11809
11914
|
}
|
|
11810
11915
|
);
|
|
11811
|
-
case
|
|
11916
|
+
case import_developer_studio_api20.IntegrationNames.HubSpot:
|
|
11812
11917
|
return /* @__PURE__ */ jsx4(import_design_system_icons2.Hubspot, { css: defaultIconStyle({ disabled, height, width }) });
|
|
11813
11918
|
case OTHER_PRODUCT_TYPE.OPENAI:
|
|
11814
11919
|
return /* @__PURE__ */ jsx4(
|
|
@@ -12118,11 +12223,10 @@ var WorkflowEditorRaw = () => {
|
|
|
12118
12223
|
var Editor_default = WorkflowEditorRaw;
|
|
12119
12224
|
|
|
12120
12225
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Panels/Edit/Wrapper.tsx
|
|
12121
|
-
var import_react76 = require("react");
|
|
12122
12226
|
var import_design_system_icons22 = require("@livechat/design-system-icons");
|
|
12123
12227
|
var import_design_system_react_components41 = require("@livechat/design-system-react-components");
|
|
12124
|
-
var
|
|
12125
|
-
var
|
|
12228
|
+
var import_developer_studio_api37 = require("@livechat/developer-studio-api");
|
|
12229
|
+
var import_developer_studio_ui_react35 = require("@livechat/developer-studio-ui-react");
|
|
12126
12230
|
|
|
12127
12231
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Nodes/CustomNodes/ForkJoinNode/Base.tsx
|
|
12128
12232
|
var import_react19 = require("react");
|
|
@@ -12133,7 +12237,7 @@ var import_design_system_react_components7 = require("@livechat/design-system-re
|
|
|
12133
12237
|
var import_reactflow2 = require("reactflow");
|
|
12134
12238
|
var import_elkjs = __toESM(require("elkjs"));
|
|
12135
12239
|
var import_design_system_react_components6 = require("@livechat/design-system-react-components");
|
|
12136
|
-
var
|
|
12240
|
+
var import_developer_studio_api21 = require("@livechat/developer-studio-api");
|
|
12137
12241
|
var DEFAULT_NODE_WIDTH = {
|
|
12138
12242
|
[NodeTypes.http]: 180,
|
|
12139
12243
|
[NodeTypes.forkJoin]: 140,
|
|
@@ -12210,19 +12314,19 @@ var customNode = ({
|
|
|
12210
12314
|
};
|
|
12211
12315
|
var getCustomNodeType = (taskType) => {
|
|
12212
12316
|
switch (taskType) {
|
|
12213
|
-
case
|
|
12317
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.http:
|
|
12214
12318
|
return NodeTypes.http;
|
|
12215
|
-
case
|
|
12319
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.forkJoin:
|
|
12216
12320
|
return NodeTypes.forkJoin;
|
|
12217
|
-
case
|
|
12321
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.switch:
|
|
12218
12322
|
return NodeTypes.switch;
|
|
12219
|
-
case
|
|
12323
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.terminate:
|
|
12220
12324
|
return NodeTypes.terminate;
|
|
12221
|
-
case
|
|
12325
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.join:
|
|
12222
12326
|
return NodeTypes.join;
|
|
12223
|
-
case
|
|
12327
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.addNode:
|
|
12224
12328
|
return NodeTypes.addNode;
|
|
12225
|
-
case
|
|
12329
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.trigger:
|
|
12226
12330
|
return NodeTypes.trigger;
|
|
12227
12331
|
default:
|
|
12228
12332
|
return NodeTypes.http;
|
|
@@ -12236,12 +12340,12 @@ var convertToNodes = (tasks, originalTasks, parentIndex = 0, parentTaskReference
|
|
|
12236
12340
|
);
|
|
12237
12341
|
const targets = [];
|
|
12238
12342
|
switch (type) {
|
|
12239
|
-
case
|
|
12240
|
-
case
|
|
12241
|
-
case
|
|
12242
|
-
case
|
|
12243
|
-
case
|
|
12244
|
-
case
|
|
12343
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.terminate:
|
|
12344
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.http:
|
|
12345
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.join:
|
|
12346
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.addNode:
|
|
12347
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.addTrigger:
|
|
12348
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.trigger:
|
|
12245
12349
|
const targetHandler = () => {
|
|
12246
12350
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2;
|
|
12247
12351
|
if (parentTaskReferenceName == null ? void 0 : parentTaskReferenceName.includes("fork")) {
|
|
@@ -12280,7 +12384,7 @@ var convertToNodes = (tasks, originalTasks, parentIndex = 0, parentTaskReference
|
|
|
12280
12384
|
});
|
|
12281
12385
|
nodes.push(node2);
|
|
12282
12386
|
return nodes;
|
|
12283
|
-
case
|
|
12387
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.switch:
|
|
12284
12388
|
Object.keys((_b = workflowTask.decisionCases) != null ? _b : {}).forEach(
|
|
12285
12389
|
(decisionCase) => {
|
|
12286
12390
|
var _a2;
|
|
@@ -12344,7 +12448,7 @@ var convertToNodes = (tasks, originalTasks, parentIndex = 0, parentTaskReference
|
|
|
12344
12448
|
});
|
|
12345
12449
|
}
|
|
12346
12450
|
return nodes;
|
|
12347
|
-
case
|
|
12451
|
+
case import_developer_studio_api21.WorkflowDefinitionTaskType.forkJoin:
|
|
12348
12452
|
(_i = workflowTask.forkTasks) == null ? void 0 : _i.forEach(
|
|
12349
12453
|
(forkTask) => {
|
|
12350
12454
|
forkTask.forEach((task2, index2) => {
|
|
@@ -14817,7 +14921,7 @@ var Node_default = (0, import_react44.memo)(ForkJoinNode);
|
|
|
14817
14921
|
var import_react45 = require("react");
|
|
14818
14922
|
var import_design_system_icons12 = require("@livechat/design-system-icons");
|
|
14819
14923
|
var import_design_system_react_components27 = require("@livechat/design-system-react-components");
|
|
14820
|
-
var
|
|
14924
|
+
var import_developer_studio_api22 = require("@livechat/developer-studio-api");
|
|
14821
14925
|
var import_developer_studio_ui_react19 = require("@livechat/developer-studio-ui-react");
|
|
14822
14926
|
var Node2 = newStyled.div`
|
|
14823
14927
|
background-color: ${({ editing }) => editing ? `var(${import_design_system_react_components27.DesignToken.SurfacePrimaryActive})` : `var(${import_design_system_react_components27.DesignToken.SurfacePrimaryDefault})`};
|
|
@@ -14868,7 +14972,7 @@ var HttpNodeBase = ({
|
|
|
14868
14972
|
} = useWorkflowContext();
|
|
14869
14973
|
const frame = frames.tasks[data.taskReferenceName];
|
|
14870
14974
|
const customization = (_b = (_a = frame == null ? void 0 : frame.__meta) == null ? void 0 : _a.config) == null ? void 0 : _b.customization;
|
|
14871
|
-
const revertIconColor = getWorkflowEnv2("isHeadless") && ((customization == null ? void 0 : customization.icon) ===
|
|
14975
|
+
const revertIconColor = getWorkflowEnv2("isHeadless") && ((customization == null ? void 0 : customization.icon) === import_developer_studio_api22.IntegrationNames.OpenAI || (customization == null ? void 0 : customization.icon) === import_developer_studio_api22.IntegrationNames.BigCommerce);
|
|
14872
14976
|
return /* @__PURE__ */ jsxs2(
|
|
14873
14977
|
Node2,
|
|
14874
14978
|
{
|
|
@@ -14940,30 +15044,27 @@ var HttpNodeBase = ({
|
|
|
14940
15044
|
};
|
|
14941
15045
|
var Base_default2 = HttpNodeBase;
|
|
14942
15046
|
|
|
14943
|
-
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Nodes/CustomNodes/HttpNode/Form.tsx
|
|
14944
|
-
var import_developer_studio_api32 = require("@livechat/developer-studio-api");
|
|
14945
|
-
|
|
14946
15047
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/Wrapper.tsx
|
|
14947
|
-
var
|
|
15048
|
+
var import_react65 = require("react");
|
|
14948
15049
|
var import_design_system_icons19 = require("@livechat/design-system-icons");
|
|
14949
15050
|
var import_design_system_react_components35 = require("@livechat/design-system-react-components");
|
|
14950
|
-
var
|
|
15051
|
+
var import_developer_studio_api35 = require("@livechat/developer-studio-api");
|
|
14951
15052
|
|
|
14952
15053
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/integrations/BigCommerce/index.tsx
|
|
14953
15054
|
var import_react50 = require("react");
|
|
14954
15055
|
var import_react_router_dom6 = require("react-router-dom");
|
|
14955
|
-
var
|
|
15056
|
+
var import_react_query5 = require("@tanstack/react-query");
|
|
14956
15057
|
var import_design_system2 = require("@livechat/design-system");
|
|
14957
15058
|
var import_design_system_icons13 = require("@livechat/design-system-icons");
|
|
14958
15059
|
var import_design_system_react_components29 = require("@livechat/design-system-react-components");
|
|
14959
15060
|
var import_developer_studio_ui_react25 = require("@livechat/developer-studio-ui-react");
|
|
14960
15061
|
|
|
14961
15062
|
// src/hooks/integrations/bigcommerce/credentials.ts
|
|
14962
|
-
var
|
|
15063
|
+
var import_developer_studio_api23 = require("@livechat/developer-studio-api");
|
|
14963
15064
|
var useFetchBigCommerceCredentials = () => {
|
|
14964
15065
|
var _a, _b;
|
|
14965
15066
|
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
14966
|
-
|
|
15067
|
+
import_developer_studio_api23.IntegrationNames.BigCommerce
|
|
14967
15068
|
);
|
|
14968
15069
|
const oauthCredential = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
14969
15070
|
(credential) => credential.type === "oauth2" && credential.data.client_id === getWorkflowEnv("bigcommerceClientId")
|
|
@@ -14981,14 +15082,14 @@ var useFetchBigCommerceCredentials = () => {
|
|
|
14981
15082
|
|
|
14982
15083
|
// src/views/Settings/Integrations/BigCommerce/Action.tsx
|
|
14983
15084
|
var import_react49 = require("react");
|
|
14984
|
-
var
|
|
15085
|
+
var import_developer_studio_api25 = require("@livechat/developer-studio-api");
|
|
14985
15086
|
var import_developer_studio_ui_react24 = require("@livechat/developer-studio-ui-react");
|
|
14986
15087
|
|
|
14987
15088
|
// src/views/Settings/Integrations/Common/IntegrationAction.tsx
|
|
14988
15089
|
var import_react48 = require("react");
|
|
14989
15090
|
var import_react_router_dom5 = require("react-router-dom");
|
|
14990
15091
|
var import_uuid = require("uuid");
|
|
14991
|
-
var
|
|
15092
|
+
var import_developer_studio_api24 = require("@livechat/developer-studio-api");
|
|
14992
15093
|
var import_developer_studio_ui_react23 = require("@livechat/developer-studio-ui-react");
|
|
14993
15094
|
|
|
14994
15095
|
// src/views/Settings/Integrations/Common/IntegrationCallback.tsx
|
|
@@ -15181,43 +15282,52 @@ function IntegrationAction(props) {
|
|
|
15181
15282
|
}
|
|
15182
15283
|
function executeIntegrationAction(props, meta) {
|
|
15183
15284
|
return __async(this, null, function* () {
|
|
15184
|
-
var _a, _b;
|
|
15285
|
+
var _a, _b, _c;
|
|
15185
15286
|
if (!meta.user.profile.id || !props.data) {
|
|
15186
15287
|
return;
|
|
15187
15288
|
}
|
|
15188
15289
|
const serializedActionData = serializeContextState(props.data);
|
|
15189
|
-
if (props.name ===
|
|
15190
|
-
(0
|
|
15191
|
-
|
|
15192
|
-
|
|
15193
|
-
)
|
|
15194
|
-
|
|
15195
|
-
|
|
15290
|
+
if (props.name === import_developer_studio_api24.IntegrationNames.Accounts) {
|
|
15291
|
+
if (((_a = props.trigger) == null ? void 0 : _a.mode) === import_developer_studio_api24.IntegrationModes.Modal) {
|
|
15292
|
+
const result = yield (0, import_developer_studio_ui_react23.getAccountsSDK)().popup({
|
|
15293
|
+
state: serializedActionData
|
|
15294
|
+
}).authorize();
|
|
15295
|
+
if (props.onSuccess && result.access_token) {
|
|
15296
|
+
props.onSuccess(result);
|
|
15297
|
+
}
|
|
15298
|
+
} else {
|
|
15299
|
+
(0, import_developer_studio_ui_react23.getAccountsSDK)().redirect({
|
|
15300
|
+
redirect_uri: `${window.location.origin}${getWorkflowEnv(
|
|
15301
|
+
"publicUrl"
|
|
15302
|
+
)}/settings/integrations/${props.name}/callback/${props.action}`,
|
|
15303
|
+
state: serializedActionData
|
|
15304
|
+
}).authorize();
|
|
15305
|
+
}
|
|
15196
15306
|
} else if (!window.Cypress) {
|
|
15197
|
-
const output = yield (0,
|
|
15307
|
+
const output = yield (0, import_developer_studio_api24.getIntegrationFlowUrl)(
|
|
15198
15308
|
props.name,
|
|
15199
15309
|
props.action,
|
|
15200
|
-
props.trigger.mode ===
|
|
15310
|
+
props.trigger.mode === import_developer_studio_api24.IntegrationModes.Modal ? {
|
|
15201
15311
|
mode: props.trigger.mode
|
|
15202
15312
|
} : {
|
|
15203
|
-
mode:
|
|
15313
|
+
mode: import_developer_studio_api24.IntegrationModes.Redirect,
|
|
15204
15314
|
redirectUrl: `${window.location.origin}${getWorkflowEnv(
|
|
15205
15315
|
"publicUrl"
|
|
15206
15316
|
)}/settings/integrations/${props.name}/callback/${props.action}`
|
|
15207
15317
|
},
|
|
15208
|
-
(
|
|
15318
|
+
(_b = props.context) != null ? _b : {},
|
|
15209
15319
|
serializedActionData,
|
|
15210
15320
|
{
|
|
15211
15321
|
user: {
|
|
15212
15322
|
id: meta.user.profile.id,
|
|
15213
|
-
token: (
|
|
15323
|
+
token: (_c = (0, import_developer_studio_ui_react23.getCookie)("access_token")) != null ? _c : ""
|
|
15214
15324
|
},
|
|
15215
15325
|
urls: {
|
|
15216
15326
|
adapterUrl: `${getWorkflowEnv("adapterUrl")}`
|
|
15217
15327
|
}
|
|
15218
15328
|
}
|
|
15219
15329
|
);
|
|
15220
|
-
if (output && props.trigger.mode ===
|
|
15330
|
+
if (output && props.trigger.mode === import_developer_studio_api24.IntegrationModes.Modal) {
|
|
15221
15331
|
const response = integrationHandlerWrapper(
|
|
15222
15332
|
output,
|
|
15223
15333
|
props.trigger.handler,
|
|
@@ -15247,7 +15357,7 @@ var BigCommerceAction = (props) => {
|
|
|
15247
15357
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
15248
15358
|
IntegrationAction_default,
|
|
15249
15359
|
{
|
|
15250
|
-
name:
|
|
15360
|
+
name: import_developer_studio_api25.IntegrationNames.BigCommerce,
|
|
15251
15361
|
action,
|
|
15252
15362
|
data: props.data,
|
|
15253
15363
|
context: props.context,
|
|
@@ -15255,7 +15365,7 @@ var BigCommerceAction = (props) => {
|
|
|
15255
15365
|
serializedContext: match2.params.context,
|
|
15256
15366
|
executor: props.executor,
|
|
15257
15367
|
trigger: {
|
|
15258
|
-
mode:
|
|
15368
|
+
mode: import_developer_studio_api25.IntegrationModes.Modal,
|
|
15259
15369
|
handler: (output) => bigCommerceActionHandlers(login)[action](output)
|
|
15260
15370
|
},
|
|
15261
15371
|
onSuccess: props.onSuccess
|
|
@@ -15265,9 +15375,9 @@ var BigCommerceAction = (props) => {
|
|
|
15265
15375
|
function triggerBigCommerceAction(props, meta) {
|
|
15266
15376
|
return executeIntegrationAction(
|
|
15267
15377
|
__spreadProps(__spreadValues({}, props), {
|
|
15268
|
-
name:
|
|
15378
|
+
name: import_developer_studio_api25.IntegrationNames.BigCommerce,
|
|
15269
15379
|
trigger: {
|
|
15270
|
-
mode:
|
|
15380
|
+
mode: import_developer_studio_api25.IntegrationModes.Modal,
|
|
15271
15381
|
handler: (output) => bigCommerceActionHandlers(meta.login)[props.action](output)
|
|
15272
15382
|
}
|
|
15273
15383
|
}),
|
|
@@ -15279,7 +15389,7 @@ var bigCommerceActionHandlers = (login) => {
|
|
|
15279
15389
|
authorize: (output) => {
|
|
15280
15390
|
if (output.status === "success" && output.result.token) {
|
|
15281
15391
|
login({
|
|
15282
|
-
source:
|
|
15392
|
+
source: import_developer_studio_api25.IntegrationNames.BigCommerce,
|
|
15283
15393
|
data: { token: output.result.token, shop: output.result.shop }
|
|
15284
15394
|
});
|
|
15285
15395
|
return {
|
|
@@ -15352,7 +15462,7 @@ var noteStyles = css`
|
|
|
15352
15462
|
function BigCommerce() {
|
|
15353
15463
|
var _a, _b;
|
|
15354
15464
|
const { pathname } = (0, import_react_router_dom6.useLocation)();
|
|
15355
|
-
const queryClient = (0,
|
|
15465
|
+
const queryClient = (0, import_react_query5.useQueryClient)();
|
|
15356
15466
|
const credentialsQuery = useFetchBigCommerceCredentials();
|
|
15357
15467
|
const { login } = (0, import_react50.useContext)(AuthContext);
|
|
15358
15468
|
const {
|
|
@@ -15575,16 +15685,16 @@ var BigCommerce_default = (0, import_design_system2.notificationConnect)(BigComm
|
|
|
15575
15685
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/integrations/HubSpot/index.tsx
|
|
15576
15686
|
var import_react53 = require("react");
|
|
15577
15687
|
var import_react_router_dom7 = require("react-router-dom");
|
|
15578
|
-
var
|
|
15688
|
+
var import_react_query6 = require("@tanstack/react-query");
|
|
15579
15689
|
var import_design_system_icons14 = require("@livechat/design-system-icons");
|
|
15580
15690
|
var import_design_system_react_components30 = require("@livechat/design-system-react-components");
|
|
15581
15691
|
|
|
15582
15692
|
// src/hooks/integrations/hubspot/credentials.ts
|
|
15583
|
-
var
|
|
15693
|
+
var import_developer_studio_api26 = require("@livechat/developer-studio-api");
|
|
15584
15694
|
var useFetchHubspotCredentials = () => {
|
|
15585
15695
|
var _a, _b;
|
|
15586
15696
|
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
15587
|
-
|
|
15697
|
+
import_developer_studio_api26.IntegrationNames.HubSpot
|
|
15588
15698
|
);
|
|
15589
15699
|
const oauthCredential = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
15590
15700
|
(credential) => credential.type === "oauth2" && credential.data.client_id === getWorkflowEnv("hubpotClientId")
|
|
@@ -15602,7 +15712,7 @@ var useFetchHubspotCredentials = () => {
|
|
|
15602
15712
|
|
|
15603
15713
|
// src/views/Settings/Integrations/HubSpot/Action.tsx
|
|
15604
15714
|
var import_react52 = require("react");
|
|
15605
|
-
var
|
|
15715
|
+
var import_developer_studio_api27 = require("@livechat/developer-studio-api");
|
|
15606
15716
|
var import_developer_studio_ui_react26 = require("@livechat/developer-studio-ui-react");
|
|
15607
15717
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
15608
15718
|
var HubSpotAction = (props) => {
|
|
@@ -15616,7 +15726,7 @@ var HubSpotAction = (props) => {
|
|
|
15616
15726
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
15617
15727
|
IntegrationAction_default,
|
|
15618
15728
|
{
|
|
15619
|
-
name:
|
|
15729
|
+
name: import_developer_studio_api27.IntegrationNames.HubSpot,
|
|
15620
15730
|
action,
|
|
15621
15731
|
data: props.data,
|
|
15622
15732
|
context: props.context,
|
|
@@ -15624,7 +15734,7 @@ var HubSpotAction = (props) => {
|
|
|
15624
15734
|
serializedContext: match2.params.context,
|
|
15625
15735
|
executor: props.executor,
|
|
15626
15736
|
trigger: {
|
|
15627
|
-
mode:
|
|
15737
|
+
mode: import_developer_studio_api27.IntegrationModes.Modal,
|
|
15628
15738
|
handler: (output) => hubSpotActionHandlers(login)[action](output)
|
|
15629
15739
|
},
|
|
15630
15740
|
onSuccess: props.onSuccess
|
|
@@ -15636,7 +15746,7 @@ var hubSpotActionHandlers = (login) => {
|
|
|
15636
15746
|
authorize: (output) => {
|
|
15637
15747
|
if (output.status === "success" && output.result.token) {
|
|
15638
15748
|
login({
|
|
15639
|
-
source:
|
|
15749
|
+
source: import_developer_studio_api27.IntegrationNames.HubSpot,
|
|
15640
15750
|
data: { token: output.result.token }
|
|
15641
15751
|
});
|
|
15642
15752
|
return {
|
|
@@ -15689,7 +15799,7 @@ var connectionStyles2 = css`
|
|
|
15689
15799
|
var HubSpot = () => {
|
|
15690
15800
|
var _a;
|
|
15691
15801
|
const { pathname } = (0, import_react_router_dom7.useLocation)();
|
|
15692
|
-
const queryClient = (0,
|
|
15802
|
+
const queryClient = (0, import_react_query6.useQueryClient)();
|
|
15693
15803
|
const credentialsQuery = useFetchHubspotCredentials();
|
|
15694
15804
|
const oauthCredential = credentialsQuery.data.internal;
|
|
15695
15805
|
const connected = (_a = credentialsQuery.data.internal) == null ? void 0 : _a.data.connected;
|
|
@@ -15759,16 +15869,16 @@ var HubSpot_default = HubSpot;
|
|
|
15759
15869
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/integrations/Mailchimp/index.tsx
|
|
15760
15870
|
var import_react56 = require("react");
|
|
15761
15871
|
var import_react_router_dom8 = require("react-router-dom");
|
|
15762
|
-
var
|
|
15872
|
+
var import_react_query7 = require("@tanstack/react-query");
|
|
15763
15873
|
var import_design_system_icons15 = require("@livechat/design-system-icons");
|
|
15764
15874
|
var import_design_system_react_components31 = require("@livechat/design-system-react-components");
|
|
15765
15875
|
|
|
15766
15876
|
// src/hooks/integrations/mailchimp/credentials.ts
|
|
15767
|
-
var
|
|
15877
|
+
var import_developer_studio_api28 = require("@livechat/developer-studio-api");
|
|
15768
15878
|
var useFetchMailchimpCredentials = () => {
|
|
15769
15879
|
var _a, _b;
|
|
15770
15880
|
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
15771
|
-
|
|
15881
|
+
import_developer_studio_api28.IntegrationNames.Mailchimp
|
|
15772
15882
|
);
|
|
15773
15883
|
const oauthCredential = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
15774
15884
|
(credential) => credential.type === "oauth2" && credential.data.client_id === getWorkflowEnv("mailchimpClientId")
|
|
@@ -15786,7 +15896,7 @@ var useFetchMailchimpCredentials = () => {
|
|
|
15786
15896
|
|
|
15787
15897
|
// src/views/Settings/Integrations/Mailchimp/Action.tsx
|
|
15788
15898
|
var import_react55 = require("react");
|
|
15789
|
-
var
|
|
15899
|
+
var import_developer_studio_api29 = require("@livechat/developer-studio-api");
|
|
15790
15900
|
var import_developer_studio_ui_react27 = require("@livechat/developer-studio-ui-react");
|
|
15791
15901
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
15792
15902
|
var MailchimpAction = (props) => {
|
|
@@ -15800,7 +15910,7 @@ var MailchimpAction = (props) => {
|
|
|
15800
15910
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
15801
15911
|
IntegrationAction_default,
|
|
15802
15912
|
{
|
|
15803
|
-
name:
|
|
15913
|
+
name: import_developer_studio_api29.IntegrationNames.Mailchimp,
|
|
15804
15914
|
action,
|
|
15805
15915
|
data: props.data,
|
|
15806
15916
|
context: props.context,
|
|
@@ -15808,7 +15918,7 @@ var MailchimpAction = (props) => {
|
|
|
15808
15918
|
serializedContext: match2.params.context,
|
|
15809
15919
|
executor: props.executor,
|
|
15810
15920
|
trigger: {
|
|
15811
|
-
mode:
|
|
15921
|
+
mode: import_developer_studio_api29.IntegrationModes.Modal,
|
|
15812
15922
|
handler: (output) => mailchimpActionHandlers(login)[action](output)
|
|
15813
15923
|
},
|
|
15814
15924
|
onSuccess: props.onSuccess
|
|
@@ -15820,7 +15930,7 @@ var mailchimpActionHandlers = (login) => {
|
|
|
15820
15930
|
authorize: (output) => {
|
|
15821
15931
|
if (output.status === "success" && output.result.token) {
|
|
15822
15932
|
login({
|
|
15823
|
-
source:
|
|
15933
|
+
source: import_developer_studio_api29.IntegrationNames.Mailchimp,
|
|
15824
15934
|
data: { token: output.result.token, server: output.result.server }
|
|
15825
15935
|
});
|
|
15826
15936
|
return {
|
|
@@ -15873,7 +15983,7 @@ var connectionStyles3 = css`
|
|
|
15873
15983
|
var Mailchimp = () => {
|
|
15874
15984
|
var _a;
|
|
15875
15985
|
const { pathname } = (0, import_react_router_dom8.useLocation)();
|
|
15876
|
-
const queryClient = (0,
|
|
15986
|
+
const queryClient = (0, import_react_query7.useQueryClient)();
|
|
15877
15987
|
const credentialsQuery = useFetchMailchimpCredentials();
|
|
15878
15988
|
const oauthCredential = credentialsQuery.data.internal;
|
|
15879
15989
|
const connected = (_a = credentialsQuery.data.internal) == null ? void 0 : _a.data.connected;
|
|
@@ -15942,8 +16052,10 @@ var Mailchimp_default = Mailchimp;
|
|
|
15942
16052
|
|
|
15943
16053
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/integrations/OpenAI/index.tsx
|
|
15944
16054
|
var import_react58 = require("react");
|
|
16055
|
+
var import_react_query8 = require("@tanstack/react-query");
|
|
15945
16056
|
var import_design_system_icons16 = require("@livechat/design-system-icons");
|
|
15946
16057
|
var import_design_system_react_components32 = require("@livechat/design-system-react-components");
|
|
16058
|
+
var import_developer_studio_api30 = require("@livechat/developer-studio-api");
|
|
15947
16059
|
var import_developer_studio_ui_react28 = require("@livechat/developer-studio-ui-react");
|
|
15948
16060
|
var wrapperStyles4 = css`
|
|
15949
16061
|
width: 100%;
|
|
@@ -15977,23 +16089,49 @@ var actionsStyles = css`
|
|
|
15977
16089
|
flex-direction: column;
|
|
15978
16090
|
margin-block-start: var(${import_design_system_react_components32.SpacingToken.Spacing7});
|
|
15979
16091
|
`;
|
|
15980
|
-
|
|
16092
|
+
function OpenAI() {
|
|
15981
16093
|
var _a;
|
|
15982
16094
|
const [loading, setLoading] = (0, import_react58.useState)(false);
|
|
15983
|
-
const [error, setError] = (0, import_react58.useState)(
|
|
16095
|
+
const [error, setError] = (0, import_react58.useState)();
|
|
16096
|
+
const queryClient = (0, import_react_query8.useQueryClient)();
|
|
15984
16097
|
const credentialQuery = useFetchIntegrationCredentialQuery("openai");
|
|
15985
16098
|
const createCredential = useCreateIntegrationCredential();
|
|
15986
16099
|
const updateCredential = useUpdateIntegrationCredential();
|
|
15987
16100
|
const connected = Boolean((_a = credentialQuery.data) == null ? void 0 : _a.name);
|
|
15988
16101
|
const [openAiToken, setOpenAiToken] = (0, import_react58.useState)("");
|
|
15989
|
-
const
|
|
16102
|
+
const refetch = (0, import_react58.useCallback)(() => {
|
|
16103
|
+
credentialQuery.refetch();
|
|
16104
|
+
queryClient.invalidateQueries(
|
|
16105
|
+
integrationCredentialsQueryKeys.getCredentials()
|
|
16106
|
+
);
|
|
16107
|
+
}, [credentialQuery, queryClient]);
|
|
16108
|
+
const validateToken = () => __async(this, null, function* () {
|
|
16109
|
+
setLoading(true);
|
|
16110
|
+
try {
|
|
16111
|
+
const isValid = yield import_developer_studio_api30.api.integrations.openai.verifyToken(openAiToken);
|
|
16112
|
+
if (!isValid) {
|
|
16113
|
+
setError("Invalid API KEY");
|
|
16114
|
+
}
|
|
16115
|
+
return isValid;
|
|
16116
|
+
} catch (e) {
|
|
16117
|
+
setError("Invalid API KEY");
|
|
16118
|
+
return false;
|
|
16119
|
+
} finally {
|
|
16120
|
+
setLoading(false);
|
|
16121
|
+
}
|
|
16122
|
+
});
|
|
16123
|
+
const handleConnect = () => __async(this, null, function* () {
|
|
15990
16124
|
if (!openAiToken) {
|
|
15991
|
-
setError(
|
|
16125
|
+
setError("Cannot be empty");
|
|
16126
|
+
return;
|
|
16127
|
+
}
|
|
16128
|
+
const isValid = yield validateToken();
|
|
16129
|
+
if (!isValid) {
|
|
15992
16130
|
return;
|
|
15993
16131
|
}
|
|
15994
16132
|
try {
|
|
15995
16133
|
setLoading(true);
|
|
15996
|
-
createCredential.mutateAsync({
|
|
16134
|
+
yield createCredential.mutateAsync({
|
|
15997
16135
|
name: "openai",
|
|
15998
16136
|
description: "",
|
|
15999
16137
|
provider: "openai",
|
|
@@ -16002,16 +16140,21 @@ var OpenAI = () => {
|
|
|
16002
16140
|
api_key: openAiToken
|
|
16003
16141
|
}
|
|
16004
16142
|
});
|
|
16143
|
+
refetch();
|
|
16005
16144
|
} catch (error2) {
|
|
16006
|
-
setError(
|
|
16145
|
+
setError(error2.message);
|
|
16007
16146
|
} finally {
|
|
16008
16147
|
setLoading(false);
|
|
16009
16148
|
setOpenAiToken("");
|
|
16010
16149
|
}
|
|
16011
|
-
};
|
|
16012
|
-
const handleUpdate = () => {
|
|
16150
|
+
});
|
|
16151
|
+
const handleUpdate = () => __async(this, null, function* () {
|
|
16013
16152
|
if (!openAiToken) {
|
|
16014
|
-
setError(
|
|
16153
|
+
setError("Cannot be empty");
|
|
16154
|
+
return;
|
|
16155
|
+
}
|
|
16156
|
+
const isValid = yield validateToken();
|
|
16157
|
+
if (!isValid) {
|
|
16015
16158
|
return;
|
|
16016
16159
|
}
|
|
16017
16160
|
try {
|
|
@@ -16025,30 +16168,31 @@ var OpenAI = () => {
|
|
|
16025
16168
|
api_key: openAiToken
|
|
16026
16169
|
}
|
|
16027
16170
|
});
|
|
16171
|
+
refetch();
|
|
16028
16172
|
} catch (error2) {
|
|
16029
|
-
setError(
|
|
16173
|
+
setError(error2.message);
|
|
16030
16174
|
} finally {
|
|
16031
16175
|
setLoading(false);
|
|
16032
16176
|
setOpenAiToken("");
|
|
16033
16177
|
}
|
|
16034
|
-
};
|
|
16178
|
+
});
|
|
16035
16179
|
const handleChange = (e) => {
|
|
16036
16180
|
setOpenAiToken(e.target.value);
|
|
16037
16181
|
if (e.target.value) {
|
|
16038
|
-
setError(
|
|
16182
|
+
setError(void 0);
|
|
16039
16183
|
}
|
|
16040
16184
|
};
|
|
16041
16185
|
return /* @__PURE__ */ jsxs2("div", { css: wrapperStyles4, children: [
|
|
16042
16186
|
/* @__PURE__ */ jsxs2("div", { css: connectionStyles4, children: [
|
|
16043
16187
|
/* @__PURE__ */ jsxs2("span", { children: [
|
|
16044
16188
|
/* @__PURE__ */ jsx4(import_design_system_react_components32.Icon, { source: import_design_system_icons16.Chatgpt }),
|
|
16045
|
-
/* @__PURE__ */ jsx4(import_design_system_react_components32.Text, { size: "lg",
|
|
16189
|
+
/* @__PURE__ */ jsx4(import_design_system_react_components32.Text, { bold: true, size: "lg", children: "OpenAI" })
|
|
16046
16190
|
] }),
|
|
16047
16191
|
connected ? /* @__PURE__ */ jsx4(
|
|
16048
16192
|
import_design_system_react_components32.Tag,
|
|
16049
16193
|
{
|
|
16050
16194
|
kind: "success",
|
|
16051
|
-
leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components32.Icon, { source: import_design_system_icons16.CheckCircle
|
|
16195
|
+
leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components32.Icon, { size: "small", source: import_design_system_icons16.CheckCircle }),
|
|
16052
16196
|
size: "small",
|
|
16053
16197
|
children: "Connected"
|
|
16054
16198
|
}
|
|
@@ -16056,94 +16200,106 @@ var OpenAI = () => {
|
|
|
16056
16200
|
import_design_system_react_components32.Tag,
|
|
16057
16201
|
{
|
|
16058
16202
|
kind: "error",
|
|
16059
|
-
leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components32.Icon, { source: import_design_system_icons16.CloseCircle
|
|
16203
|
+
leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components32.Icon, { size: "small", source: import_design_system_icons16.CloseCircle }),
|
|
16060
16204
|
size: "small",
|
|
16061
16205
|
children: "Not connected"
|
|
16062
16206
|
}
|
|
16063
16207
|
)
|
|
16064
16208
|
] }),
|
|
16065
16209
|
!connected ? /* @__PURE__ */ jsxs2("div", { css: actionsStyles, children: [
|
|
16066
|
-
/* @__PURE__ */ jsx4(import_design_system_react_components32.Text, { size: "sm",
|
|
16067
|
-
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react28.Row, {
|
|
16210
|
+
/* @__PURE__ */ jsx4(import_design_system_react_components32.Text, { css: labelStyles2, size: "sm", children: "API Key" }),
|
|
16211
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react28.Row, { gap: `var(${import_design_system_react_components32.SpacingToken.Spacing2})`, noWrap: true, notPadded: true, children: [
|
|
16068
16212
|
/* @__PURE__ */ jsx4(
|
|
16069
|
-
import_design_system_react_components32.
|
|
16213
|
+
import_design_system_react_components32.FormField,
|
|
16070
16214
|
{
|
|
16071
|
-
value: openAiToken,
|
|
16072
|
-
onChange: (e) => {
|
|
16073
|
-
handleChange(e);
|
|
16074
|
-
},
|
|
16075
|
-
placeholder: "Enter API Key",
|
|
16076
|
-
type: "password",
|
|
16077
|
-
inputSize: "medium",
|
|
16078
|
-
error,
|
|
16079
16215
|
css: css`
|
|
16080
16216
|
width: 100%;
|
|
16081
|
-
|
|
16217
|
+
`,
|
|
16218
|
+
error,
|
|
16219
|
+
children: /* @__PURE__ */ jsx4(
|
|
16220
|
+
import_design_system_react_components32.Input,
|
|
16221
|
+
{
|
|
16222
|
+
error: Boolean(error),
|
|
16223
|
+
inputSize: "medium",
|
|
16224
|
+
onChange: (e) => {
|
|
16225
|
+
handleChange(e);
|
|
16226
|
+
},
|
|
16227
|
+
placeholder: "Enter API Key",
|
|
16228
|
+
type: "password",
|
|
16229
|
+
value: openAiToken
|
|
16230
|
+
}
|
|
16231
|
+
)
|
|
16082
16232
|
}
|
|
16083
16233
|
),
|
|
16084
16234
|
/* @__PURE__ */ jsx4(
|
|
16085
16235
|
import_design_system_react_components32.Button,
|
|
16086
16236
|
{
|
|
16087
|
-
|
|
16237
|
+
disabled: loading,
|
|
16088
16238
|
kind: "secondary",
|
|
16089
|
-
onClick: handleConnect,
|
|
16090
16239
|
loading,
|
|
16091
|
-
|
|
16240
|
+
onClick: handleConnect,
|
|
16241
|
+
size: "medium",
|
|
16092
16242
|
children: "Connect"
|
|
16093
16243
|
}
|
|
16094
16244
|
)
|
|
16095
16245
|
] })
|
|
16096
16246
|
] }) : /* @__PURE__ */ jsxs2("div", { css: actionsStyles, children: [
|
|
16097
|
-
/* @__PURE__ */ jsx4(import_design_system_react_components32.Text, { size: "sm",
|
|
16098
|
-
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react28.Row, {
|
|
16247
|
+
/* @__PURE__ */ jsx4(import_design_system_react_components32.Text, { css: labelStyles2, size: "sm", children: "API Key" }),
|
|
16248
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react28.Row, { gap: `var(${import_design_system_react_components32.SpacingToken.Spacing2})`, noWrap: true, notPadded: true, children: [
|
|
16099
16249
|
/* @__PURE__ */ jsx4(
|
|
16100
|
-
import_design_system_react_components32.
|
|
16250
|
+
import_design_system_react_components32.FormField,
|
|
16101
16251
|
{
|
|
16102
|
-
value: openAiToken,
|
|
16103
|
-
onChange: (e) => {
|
|
16104
|
-
handleChange(e);
|
|
16105
|
-
},
|
|
16106
|
-
placeholder: "Enter API Key",
|
|
16107
|
-
type: "password",
|
|
16108
|
-
inputSize: "medium",
|
|
16109
|
-
error,
|
|
16110
16252
|
css: css`
|
|
16111
16253
|
width: 100%;
|
|
16112
|
-
|
|
16254
|
+
`,
|
|
16255
|
+
error,
|
|
16256
|
+
children: /* @__PURE__ */ jsx4(
|
|
16257
|
+
import_design_system_react_components32.Input,
|
|
16258
|
+
{
|
|
16259
|
+
error: Boolean(error),
|
|
16260
|
+
inputSize: "medium",
|
|
16261
|
+
onChange: (e) => {
|
|
16262
|
+
handleChange(e);
|
|
16263
|
+
},
|
|
16264
|
+
placeholder: "Enter API Key",
|
|
16265
|
+
type: "password",
|
|
16266
|
+
value: openAiToken
|
|
16267
|
+
}
|
|
16268
|
+
)
|
|
16113
16269
|
}
|
|
16114
16270
|
),
|
|
16115
16271
|
/* @__PURE__ */ jsx4(
|
|
16116
16272
|
import_design_system_react_components32.Button,
|
|
16117
16273
|
{
|
|
16118
|
-
|
|
16274
|
+
disabled: loading,
|
|
16119
16275
|
kind: "secondary",
|
|
16120
|
-
onClick: handleUpdate,
|
|
16121
16276
|
loading,
|
|
16122
|
-
|
|
16277
|
+
onClick: handleUpdate,
|
|
16278
|
+
size: "medium",
|
|
16123
16279
|
children: "Update"
|
|
16124
16280
|
}
|
|
16125
16281
|
)
|
|
16126
16282
|
] })
|
|
16127
16283
|
] })
|
|
16128
16284
|
] });
|
|
16129
|
-
}
|
|
16285
|
+
}
|
|
16130
16286
|
var OpenAI_default = OpenAI;
|
|
16131
16287
|
|
|
16132
16288
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/integrations/Shopify/index.tsx
|
|
16133
16289
|
var import_react61 = require("react");
|
|
16134
16290
|
var import_react_router_dom9 = require("react-router-dom");
|
|
16135
|
-
var
|
|
16291
|
+
var import_react_query9 = require("@tanstack/react-query");
|
|
16136
16292
|
var import_design_system3 = require("@livechat/design-system");
|
|
16137
16293
|
var import_design_system_icons17 = require("@livechat/design-system-icons");
|
|
16138
16294
|
var import_design_system_react_components33 = require("@livechat/design-system-react-components");
|
|
16139
16295
|
var import_developer_studio_ui_react30 = require("@livechat/developer-studio-ui-react");
|
|
16140
16296
|
|
|
16141
16297
|
// src/hooks/integrations/shopify/credentials.ts
|
|
16142
|
-
var
|
|
16298
|
+
var import_developer_studio_api31 = require("@livechat/developer-studio-api");
|
|
16143
16299
|
var useFetchShopifyCredentials = () => {
|
|
16144
16300
|
var _a, _b;
|
|
16145
16301
|
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
16146
|
-
|
|
16302
|
+
import_developer_studio_api31.IntegrationNames.Shopify
|
|
16147
16303
|
);
|
|
16148
16304
|
const oauthCredential = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
16149
16305
|
(credential) => credential.type === "oauth2" && credential.data.client_id === getWorkflowEnv("shopifyClientId")
|
|
@@ -16161,7 +16317,7 @@ var useFetchShopifyCredentials = () => {
|
|
|
16161
16317
|
|
|
16162
16318
|
// src/views/Settings/Integrations/Shopify/Action.tsx
|
|
16163
16319
|
var import_react60 = require("react");
|
|
16164
|
-
var
|
|
16320
|
+
var import_developer_studio_api32 = require("@livechat/developer-studio-api");
|
|
16165
16321
|
var import_developer_studio_ui_react29 = require("@livechat/developer-studio-ui-react");
|
|
16166
16322
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
16167
16323
|
var ShopifyAction = (props) => {
|
|
@@ -16175,7 +16331,7 @@ var ShopifyAction = (props) => {
|
|
|
16175
16331
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
16176
16332
|
IntegrationAction_default,
|
|
16177
16333
|
{
|
|
16178
|
-
name:
|
|
16334
|
+
name: import_developer_studio_api32.IntegrationNames.Shopify,
|
|
16179
16335
|
action,
|
|
16180
16336
|
data: props.data,
|
|
16181
16337
|
context: props.context,
|
|
@@ -16183,7 +16339,7 @@ var ShopifyAction = (props) => {
|
|
|
16183
16339
|
serializedContext: match2.params.context,
|
|
16184
16340
|
executor: props.executor,
|
|
16185
16341
|
trigger: {
|
|
16186
|
-
mode:
|
|
16342
|
+
mode: import_developer_studio_api32.IntegrationModes.Modal,
|
|
16187
16343
|
handler: (output) => shopifyActionHandlers(login)[action](output)
|
|
16188
16344
|
},
|
|
16189
16345
|
onSuccess: props.onSuccess
|
|
@@ -16193,9 +16349,9 @@ var ShopifyAction = (props) => {
|
|
|
16193
16349
|
function triggerShopifyAction(props, meta) {
|
|
16194
16350
|
return executeIntegrationAction(
|
|
16195
16351
|
__spreadProps(__spreadValues({}, props), {
|
|
16196
|
-
name:
|
|
16352
|
+
name: import_developer_studio_api32.IntegrationNames.Shopify,
|
|
16197
16353
|
trigger: {
|
|
16198
|
-
mode:
|
|
16354
|
+
mode: import_developer_studio_api32.IntegrationModes.Modal,
|
|
16199
16355
|
handler: (output) => shopifyActionHandlers(meta.login)[props.action](output)
|
|
16200
16356
|
}
|
|
16201
16357
|
}),
|
|
@@ -16207,7 +16363,7 @@ var shopifyActionHandlers = (login) => {
|
|
|
16207
16363
|
authorize: (output) => {
|
|
16208
16364
|
if (output.status === "success" && output.result.token) {
|
|
16209
16365
|
login({
|
|
16210
|
-
source:
|
|
16366
|
+
source: import_developer_studio_api32.IntegrationNames.Shopify,
|
|
16211
16367
|
data: { token: output.result.token, shop: output.result.shop }
|
|
16212
16368
|
});
|
|
16213
16369
|
return {
|
|
@@ -16276,7 +16432,7 @@ var noteStyles2 = css`
|
|
|
16276
16432
|
function Shopify() {
|
|
16277
16433
|
var _a, _b;
|
|
16278
16434
|
const { pathname } = (0, import_react_router_dom9.useLocation)();
|
|
16279
|
-
const queryClient = (0,
|
|
16435
|
+
const queryClient = (0, import_react_query9.useQueryClient)();
|
|
16280
16436
|
const credentialsQuery = useFetchShopifyCredentials();
|
|
16281
16437
|
const { login } = (0, import_react61.useContext)(AuthContext);
|
|
16282
16438
|
const {
|
|
@@ -16497,16 +16653,18 @@ function Shopify() {
|
|
|
16497
16653
|
var Shopify_default = (0, import_design_system3.notificationConnect)(Shopify);
|
|
16498
16654
|
|
|
16499
16655
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/integrations/Text/index.tsx
|
|
16656
|
+
var import_react63 = require("react");
|
|
16500
16657
|
var import_react_router_dom10 = require("react-router-dom");
|
|
16501
16658
|
var import_design_system_icons18 = require("@livechat/design-system-icons");
|
|
16502
16659
|
var import_design_system_react_components34 = require("@livechat/design-system-react-components");
|
|
16660
|
+
var import_developer_studio_ui_react32 = require("@livechat/developer-studio-ui-react");
|
|
16503
16661
|
|
|
16504
16662
|
// src/hooks/integrations/text/credentials.ts
|
|
16505
|
-
var
|
|
16663
|
+
var import_developer_studio_api33 = require("@livechat/developer-studio-api");
|
|
16506
16664
|
var useFetchTextCredentials = () => {
|
|
16507
16665
|
var _a, _b;
|
|
16508
16666
|
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
16509
|
-
|
|
16667
|
+
import_developer_studio_api33.IntegrationNames.Text
|
|
16510
16668
|
);
|
|
16511
16669
|
const textAuth = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
16512
16670
|
(credential) => credential.type === "text_auth"
|
|
@@ -16533,24 +16691,88 @@ var useFetchUserInstalledTextIntegration = (user) => {
|
|
|
16533
16691
|
}, rest);
|
|
16534
16692
|
};
|
|
16535
16693
|
|
|
16536
|
-
// src/views/
|
|
16537
|
-
var
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16548
|
-
|
|
16549
|
-
|
|
16550
|
-
|
|
16551
|
-
|
|
16552
|
-
|
|
16553
|
-
|
|
16694
|
+
// src/views/Settings/Integrations/Accounts/Action.tsx
|
|
16695
|
+
var import_developer_studio_api34 = require("@livechat/developer-studio-api");
|
|
16696
|
+
var import_developer_studio_ui_react31 = require("@livechat/developer-studio-ui-react");
|
|
16697
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
16698
|
+
var AccountsAction = (props) => {
|
|
16699
|
+
var _a;
|
|
16700
|
+
const match2 = (0, import_developer_studio_ui_react31.useMatch)();
|
|
16701
|
+
const action = (_a = props.action) != null ? _a : match2.params.action;
|
|
16702
|
+
if (!action) {
|
|
16703
|
+
throw new Error("Invalid action");
|
|
16704
|
+
}
|
|
16705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
16706
|
+
IntegrationAction_default,
|
|
16707
|
+
{
|
|
16708
|
+
name: import_developer_studio_api34.IntegrationNames.Accounts,
|
|
16709
|
+
action,
|
|
16710
|
+
data: props.data,
|
|
16711
|
+
context: props.context,
|
|
16712
|
+
serializedData: match2.params.data,
|
|
16713
|
+
serializedContext: match2.params.context,
|
|
16714
|
+
executor: props.executor,
|
|
16715
|
+
trigger: {
|
|
16716
|
+
mode: import_developer_studio_api34.IntegrationModes.Modal,
|
|
16717
|
+
handler: (output) => accountsActionHandlers()[action](output)
|
|
16718
|
+
},
|
|
16719
|
+
onSuccess: props.onSuccess
|
|
16720
|
+
}
|
|
16721
|
+
);
|
|
16722
|
+
};
|
|
16723
|
+
function triggerAccountsAction(props, meta) {
|
|
16724
|
+
executeIntegrationAction(
|
|
16725
|
+
__spreadProps(__spreadValues({}, props), {
|
|
16726
|
+
name: import_developer_studio_api34.IntegrationNames.Accounts,
|
|
16727
|
+
trigger: {
|
|
16728
|
+
mode: import_developer_studio_api34.IntegrationModes.Modal,
|
|
16729
|
+
handler: (output) => accountsActionHandlers()[props.action](output)
|
|
16730
|
+
}
|
|
16731
|
+
}),
|
|
16732
|
+
meta
|
|
16733
|
+
);
|
|
16734
|
+
}
|
|
16735
|
+
var accountsActionHandlers = () => {
|
|
16736
|
+
const handlers = {
|
|
16737
|
+
activate: (output) => {
|
|
16738
|
+
if (output.status === "success" && output.result.access_token) {
|
|
16739
|
+
(0, import_developer_studio_ui_react31.setRootData)({
|
|
16740
|
+
access_token: output.result.access_token,
|
|
16741
|
+
scope: output.result.scope,
|
|
16742
|
+
expires_in: output.result.expires_in
|
|
16743
|
+
});
|
|
16744
|
+
return {
|
|
16745
|
+
isValid: true,
|
|
16746
|
+
result: output.result
|
|
16747
|
+
};
|
|
16748
|
+
}
|
|
16749
|
+
return {
|
|
16750
|
+
isValid: false
|
|
16751
|
+
};
|
|
16752
|
+
}
|
|
16753
|
+
};
|
|
16754
|
+
return handlers;
|
|
16755
|
+
};
|
|
16756
|
+
var Action_default5 = AccountsAction;
|
|
16757
|
+
|
|
16758
|
+
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/integrations/Text/index.tsx
|
|
16759
|
+
var wrapperStyles6 = css`
|
|
16760
|
+
width: 100%;
|
|
16761
|
+
display: flex;
|
|
16762
|
+
flex-direction: column;
|
|
16763
|
+
gap: var(${import_design_system_react_components34.SpacingToken.Spacing2});
|
|
16764
|
+
padding: var(${import_design_system_react_components34.SpacingToken.Spacing2}) 0;
|
|
16765
|
+
`;
|
|
16766
|
+
var infoStyles5 = css`
|
|
16767
|
+
font-size: 13px;
|
|
16768
|
+
font-weight: 400;
|
|
16769
|
+
line-height: 16px;
|
|
16770
|
+
color: ${import_design_system_react_components34.DesignToken.ContentBasicSecondary};
|
|
16771
|
+
margin-top: var(${import_design_system_react_components34.SpacingToken.Spacing3});
|
|
16772
|
+
`;
|
|
16773
|
+
var connectionStyles6 = css`
|
|
16774
|
+
background-color: var(${import_design_system_react_components34.DesignToken.SurfaceSecondaryDefault});
|
|
16775
|
+
border-radius: var(${import_design_system_react_components34.RadiusToken.Radius2});
|
|
16554
16776
|
padding: var(${import_design_system_react_components34.SpacingToken.Spacing3});
|
|
16555
16777
|
display: flex;
|
|
16556
16778
|
justify-content: space-between;
|
|
@@ -16565,20 +16787,37 @@ var connectionStyles6 = css`
|
|
|
16565
16787
|
}
|
|
16566
16788
|
}
|
|
16567
16789
|
`;
|
|
16568
|
-
|
|
16790
|
+
function GlobalAccounts(props) {
|
|
16791
|
+
const { pathname } = (0, import_react_router_dom10.useLocation)();
|
|
16792
|
+
const notifications = (0, import_developer_studio_ui_react32.useNotifications)();
|
|
16793
|
+
const {
|
|
16794
|
+
userData: { user }
|
|
16795
|
+
} = (0, import_developer_studio_ui_react32.useRootContext)();
|
|
16569
16796
|
const credentialsQuery = useFetchTextCredentials();
|
|
16797
|
+
const organizationProductsQuery = useFetchOrganizationProducts();
|
|
16798
|
+
const {
|
|
16799
|
+
updateOrganizationProducts,
|
|
16800
|
+
isLoading: isOrganizationProductsUpdating
|
|
16801
|
+
} = useUpdateOrganizationProducts();
|
|
16570
16802
|
const connected = Boolean(credentialsQuery.data.internal);
|
|
16803
|
+
const needToBeActivated = organizationProductsQuery.data ? !organizationProductsQuery.data.find(
|
|
16804
|
+
(product) => product.product === props.product
|
|
16805
|
+
) : void 0;
|
|
16806
|
+
const refetch = (0, import_react63.useCallback)(() => {
|
|
16807
|
+
credentialsQuery.refetch();
|
|
16808
|
+
organizationProductsQuery.refetch();
|
|
16809
|
+
}, [credentialsQuery, organizationProductsQuery]);
|
|
16571
16810
|
return /* @__PURE__ */ jsxs2("div", { css: wrapperStyles6, children: [
|
|
16572
16811
|
/* @__PURE__ */ jsxs2("div", { css: connectionStyles6, children: [
|
|
16573
16812
|
/* @__PURE__ */ jsxs2("span", { children: [
|
|
16574
16813
|
/* @__PURE__ */ jsx4(import_design_system_react_components34.Icon, { source: import_design_system_icons18.TextLogo }),
|
|
16575
|
-
/* @__PURE__ */ jsx4(import_design_system_react_components34.Text, { size: "lg",
|
|
16814
|
+
/* @__PURE__ */ jsx4(import_design_system_react_components34.Text, { bold: true, size: "lg", children: "Text" })
|
|
16576
16815
|
] }),
|
|
16577
16816
|
connected ? /* @__PURE__ */ jsx4(
|
|
16578
16817
|
import_design_system_react_components34.Tag,
|
|
16579
16818
|
{
|
|
16580
16819
|
kind: "success",
|
|
16581
|
-
leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components34.Icon, { source: import_design_system_icons18.CheckCircle
|
|
16820
|
+
leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components34.Icon, { size: "small", source: import_design_system_icons18.CheckCircle }),
|
|
16582
16821
|
size: "small",
|
|
16583
16822
|
children: "Connected"
|
|
16584
16823
|
}
|
|
@@ -16586,12 +16825,61 @@ var GlobalAccounts = () => {
|
|
|
16586
16825
|
import_design_system_react_components34.Tag,
|
|
16587
16826
|
{
|
|
16588
16827
|
kind: "error",
|
|
16589
|
-
leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components34.Icon, { source: import_design_system_icons18.CloseCircle
|
|
16828
|
+
leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components34.Icon, { size: "small", source: import_design_system_icons18.CloseCircle }),
|
|
16590
16829
|
size: "small",
|
|
16591
16830
|
children: "Not connected"
|
|
16592
16831
|
}
|
|
16593
16832
|
) : /* @__PURE__ */ jsx4(import_design_system_react_components34.Loader, { size: "small" })
|
|
16594
16833
|
] }),
|
|
16834
|
+
props.product && needToBeActivated ? /* @__PURE__ */ jsxs2(import_developer_studio_ui_react32.Card, { light: true, children: [
|
|
16835
|
+
/* @__PURE__ */ jsxs2("p", { children: [
|
|
16836
|
+
"To use ",
|
|
16837
|
+
props.product,
|
|
16838
|
+
" in your workflow, you need an active",
|
|
16839
|
+
" ",
|
|
16840
|
+
props.product,
|
|
16841
|
+
"account."
|
|
16842
|
+
] }),
|
|
16843
|
+
props.product === "HelpDesk" && /* @__PURE__ */ jsx4("p", { children: "We can activate your HelpDesk license on your behalf using your registered email. You`'ll automatically start a 14-day trial." }),
|
|
16844
|
+
/* @__PURE__ */ jsx4("p", { children: "Do you want to proceed?" }),
|
|
16845
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react32.Row, { flexEnd: true, notPadded: true, children: /* @__PURE__ */ jsx4(
|
|
16846
|
+
import_design_system_react_components34.Button,
|
|
16847
|
+
{
|
|
16848
|
+
kind: "primary",
|
|
16849
|
+
loading: organizationProductsQuery.isRefetching || isOrganizationProductsUpdating,
|
|
16850
|
+
onClick: () => __async(this, null, function* () {
|
|
16851
|
+
if (!props.product) {
|
|
16852
|
+
return;
|
|
16853
|
+
}
|
|
16854
|
+
try {
|
|
16855
|
+
yield updateOrganizationProducts({
|
|
16856
|
+
productName: props.product
|
|
16857
|
+
});
|
|
16858
|
+
user && triggerAccountsAction(
|
|
16859
|
+
{
|
|
16860
|
+
action: "activate",
|
|
16861
|
+
data: {
|
|
16862
|
+
redirectTo: {
|
|
16863
|
+
success: pathname || "/settings/integrations/shopify/status"
|
|
16864
|
+
}
|
|
16865
|
+
},
|
|
16866
|
+
context: {},
|
|
16867
|
+
onSuccess: refetch
|
|
16868
|
+
},
|
|
16869
|
+
{
|
|
16870
|
+
notifications: notifications.context,
|
|
16871
|
+
user
|
|
16872
|
+
}
|
|
16873
|
+
);
|
|
16874
|
+
} catch (e) {
|
|
16875
|
+
notifications.showError(`Couldn't activate ${props.product}`);
|
|
16876
|
+
}
|
|
16877
|
+
}),
|
|
16878
|
+
type: "submit",
|
|
16879
|
+
children: "Start free trial"
|
|
16880
|
+
}
|
|
16881
|
+
) })
|
|
16882
|
+
] }) : null,
|
|
16595
16883
|
/* @__PURE__ */ jsxs2("p", { css: infoStyles5, children: [
|
|
16596
16884
|
"Text Platform provides a secure connection with Global Accounts. To add, change, or remove the connection,",
|
|
16597
16885
|
" ",
|
|
@@ -16599,17 +16887,17 @@ var GlobalAccounts = () => {
|
|
|
16599
16887
|
"."
|
|
16600
16888
|
] })
|
|
16601
16889
|
] });
|
|
16602
|
-
}
|
|
16890
|
+
}
|
|
16603
16891
|
var Text_default = GlobalAccounts;
|
|
16604
16892
|
|
|
16605
16893
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Forms/Schema/Wrapper.tsx
|
|
16606
16894
|
var componentsMap = {
|
|
16607
|
-
[`${
|
|
16608
|
-
[`${
|
|
16609
|
-
[
|
|
16610
|
-
[
|
|
16611
|
-
[
|
|
16612
|
-
[
|
|
16895
|
+
[`${import_developer_studio_api35.IntegrationNames.Text}-${PRODUCT_TYPE.HD}`]: ({ product }) => /* @__PURE__ */ jsx4(Text_default, { product }),
|
|
16896
|
+
[`${import_developer_studio_api35.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`]: ({ product }) => /* @__PURE__ */ jsx4(Text_default, { product }),
|
|
16897
|
+
[import_developer_studio_api35.IntegrationNames.Shopify]: () => /* @__PURE__ */ jsx4(Shopify_default, {}),
|
|
16898
|
+
[import_developer_studio_api35.IntegrationNames.Mailchimp]: () => /* @__PURE__ */ jsx4(Mailchimp_default, {}),
|
|
16899
|
+
[import_developer_studio_api35.IntegrationNames.BigCommerce]: () => /* @__PURE__ */ jsx4(BigCommerce_default, {}),
|
|
16900
|
+
[import_developer_studio_api35.IntegrationNames.HubSpot]: () => /* @__PURE__ */ jsx4(HubSpot_default, {}),
|
|
16613
16901
|
openai: () => /* @__PURE__ */ jsx4(OpenAI_default, {})
|
|
16614
16902
|
};
|
|
16615
16903
|
var CustomSchemaFormWrapper = ({
|
|
@@ -16620,10 +16908,10 @@ var CustomSchemaFormWrapper = ({
|
|
|
16620
16908
|
}) => {
|
|
16621
16909
|
var _a;
|
|
16622
16910
|
const spec = workflowBuilderUtils.getItemConfig(data);
|
|
16623
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
16911
|
+
const [selectedTab, setSelectedTab] = (0, import_react65.useState)(
|
|
16624
16912
|
preselectedTab != null ? preselectedTab : !spec || (spec == null ? void 0 : spec.specification.input) ? "parameters" : spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? "connection" : void 0
|
|
16625
16913
|
);
|
|
16626
|
-
const tabItems = (0,
|
|
16914
|
+
const tabItems = (0, import_react65.useMemo)(
|
|
16627
16915
|
() => [
|
|
16628
16916
|
!spec || (spec == null ? void 0 : spec.specification.input) ? { id: "parameters", title: "Parameters" } : void 0,
|
|
16629
16917
|
spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? {
|
|
@@ -16635,7 +16923,7 @@ var CustomSchemaFormWrapper = ({
|
|
|
16635
16923
|
),
|
|
16636
16924
|
[spec]
|
|
16637
16925
|
);
|
|
16638
|
-
return /* @__PURE__ */ jsxs2(
|
|
16926
|
+
return /* @__PURE__ */ jsxs2(import_react65.Fragment, { children: [
|
|
16639
16927
|
tabItems.length > 1 ? /* @__PURE__ */ jsx4(
|
|
16640
16928
|
import_design_system_react_components35.TabsWrapper,
|
|
16641
16929
|
{
|
|
@@ -16653,7 +16941,7 @@ var CustomSchemaFormWrapper = ({
|
|
|
16653
16941
|
onClick: () => {
|
|
16654
16942
|
setSelectedTab(id);
|
|
16655
16943
|
},
|
|
16656
|
-
icon: ((_a2 = tabsMetadata == null ? void 0 : tabsMetadata[id]) == null ? void 0 : _a2.hasError) ? /* @__PURE__ */ jsx4(import_design_system_react_components35.Icon, { source: import_design_system_icons19.Error, size: "small", kind: "negative" }) : /* @__PURE__ */ jsx4(
|
|
16944
|
+
icon: ((_a2 = tabsMetadata == null ? void 0 : tabsMetadata[id]) == null ? void 0 : _a2.hasError) ? /* @__PURE__ */ jsx4(import_design_system_react_components35.Icon, { source: import_design_system_icons19.Error, size: "small", kind: "negative" }) : /* @__PURE__ */ jsx4(import_react65.Fragment, {}),
|
|
16657
16945
|
children: title
|
|
16658
16946
|
},
|
|
16659
16947
|
id
|
|
@@ -16661,7 +16949,9 @@ var CustomSchemaFormWrapper = ({
|
|
|
16661
16949
|
}) })
|
|
16662
16950
|
}
|
|
16663
16951
|
) : void 0,
|
|
16664
|
-
spec && selectedTab === "connection" && ((_a = componentsMap[spec.customization.provider]) == null ? void 0 : _a.call(componentsMap, {
|
|
16952
|
+
spec && selectedTab === "connection" && ((_a = componentsMap[spec.customization.provider]) == null ? void 0 : _a.call(componentsMap, {
|
|
16953
|
+
product: spec.customization.product
|
|
16954
|
+
})),
|
|
16665
16955
|
selectedTab === "parameters" && /* @__PURE__ */ jsx4(
|
|
16666
16956
|
"div",
|
|
16667
16957
|
{
|
|
@@ -16682,7 +16972,7 @@ var HttpNodeForm = ({
|
|
|
16682
16972
|
onChange,
|
|
16683
16973
|
readonly
|
|
16684
16974
|
}) => {
|
|
16685
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v
|
|
16975
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
16686
16976
|
const spec = (_a = metadata.frame.__meta) == null ? void 0 : _a.config;
|
|
16687
16977
|
if (data.name === "http") {
|
|
16688
16978
|
return /* @__PURE__ */ jsx4(
|
|
@@ -16710,29 +17000,26 @@ var HttpNodeForm = ({
|
|
|
16710
17000
|
result[key] = value;
|
|
16711
17001
|
return result;
|
|
16712
17002
|
}, {});
|
|
16713
|
-
const
|
|
16714
|
-
|
|
16715
|
-
);
|
|
16716
|
-
const hasConnectionError = Boolean(
|
|
16717
|
-
(_k = (_j = (_i = metadata.errors) == null ? void 0 : _i.inputParameters) == null ? void 0 : _j.http_request) == null ? void 0 : _k.headers
|
|
17003
|
+
const hasConnectionError = (_h = (_g = metadata.errors) == null ? void 0 : _g.__errorsExtended) == null ? void 0 : _h.some(
|
|
17004
|
+
(error) => error.keyword === "connection" || "activation"
|
|
16718
17005
|
);
|
|
16719
17006
|
return /* @__PURE__ */ jsxs2(
|
|
16720
17007
|
Wrapper_default,
|
|
16721
17008
|
{
|
|
16722
17009
|
data,
|
|
16723
|
-
preselectedTab: hasConnectionError
|
|
17010
|
+
preselectedTab: hasConnectionError ? "connection" : void 0,
|
|
16724
17011
|
tabsMetadata: {
|
|
16725
17012
|
connection: {
|
|
16726
|
-
hasError: hasConnectionError
|
|
17013
|
+
hasError: hasConnectionError
|
|
16727
17014
|
}
|
|
16728
17015
|
},
|
|
16729
17016
|
children: [
|
|
16730
|
-
((
|
|
17017
|
+
((_j = (_i = spec == null ? void 0 : spec.specification.input) == null ? void 0 : _i.properties) == null ? void 0 : _j.query) ? /* @__PURE__ */ jsx4(
|
|
16731
17018
|
Form_default,
|
|
16732
17019
|
{
|
|
16733
|
-
schema: (
|
|
17020
|
+
schema: (_l = (_k = spec == null ? void 0 : spec.specification.input) == null ? void 0 : _k.properties) == null ? void 0 : _l.query,
|
|
16734
17021
|
formData: queryParams,
|
|
16735
|
-
formErrors: ((
|
|
17022
|
+
formErrors: ((_o = (_n = (_m = metadata.errors) == null ? void 0 : _m.inputParameters) == null ? void 0 : _n.http_request) == null ? void 0 : _o.uri) ? Object.fromEntries(
|
|
16736
17023
|
Object.entries(queryParams).map((entry) => {
|
|
16737
17024
|
var _a2, _b2, _c2;
|
|
16738
17025
|
return [
|
|
@@ -16756,12 +17043,12 @@ var HttpNodeForm = ({
|
|
|
16756
17043
|
readonly
|
|
16757
17044
|
}
|
|
16758
17045
|
) : void 0,
|
|
16759
|
-
((
|
|
17046
|
+
((_q = (_p = spec == null ? void 0 : spec.specification.input) == null ? void 0 : _p.properties) == null ? void 0 : _q.body) ? /* @__PURE__ */ jsx4(
|
|
16760
17047
|
Form_default,
|
|
16761
17048
|
{
|
|
16762
|
-
schema: (
|
|
17049
|
+
schema: (_s = (_r = spec == null ? void 0 : spec.specification.input) == null ? void 0 : _r.properties) == null ? void 0 : _s.body,
|
|
16763
17050
|
formData: data.inputParameters.http_request.body,
|
|
16764
|
-
formErrors: (
|
|
17051
|
+
formErrors: (_v = (_u = (_t = metadata.errors) == null ? void 0 : _t.inputParameters) == null ? void 0 : _u.http_request) == null ? void 0 : _v.body,
|
|
16765
17052
|
formContext: __spreadProps(__spreadValues({}, metadata), {
|
|
16766
17053
|
data
|
|
16767
17054
|
}),
|
|
@@ -16784,14 +17071,14 @@ var HttpNodeForm = ({
|
|
|
16784
17071
|
var Form_default3 = HttpNodeForm;
|
|
16785
17072
|
|
|
16786
17073
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Nodes/CustomNodes/HttpNode/Node.tsx
|
|
16787
|
-
var
|
|
17074
|
+
var import_react67 = require("react");
|
|
16788
17075
|
var import_reactflow8 = require("reactflow");
|
|
16789
17076
|
function HttpNode({
|
|
16790
17077
|
id,
|
|
16791
17078
|
data
|
|
16792
17079
|
}) {
|
|
16793
17080
|
var _a, _b;
|
|
16794
|
-
const [isHovered, setIsHovered] = (0,
|
|
17081
|
+
const [isHovered, setIsHovered] = (0, import_react67.useState)(false);
|
|
16795
17082
|
const {
|
|
16796
17083
|
removeTask,
|
|
16797
17084
|
goToAddTask,
|
|
@@ -16857,10 +17144,10 @@ function HttpNode({
|
|
|
16857
17144
|
}
|
|
16858
17145
|
);
|
|
16859
17146
|
}
|
|
16860
|
-
var Node_default2 = (0,
|
|
17147
|
+
var Node_default2 = (0, import_react67.memo)(HttpNode);
|
|
16861
17148
|
|
|
16862
17149
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Nodes/CustomNodes/SwitchNode/Base.tsx
|
|
16863
|
-
var
|
|
17150
|
+
var import_react68 = require("react");
|
|
16864
17151
|
var import_design_system_icons20 = require("@livechat/design-system-icons");
|
|
16865
17152
|
var import_design_system_react_components36 = require("@livechat/design-system-react-components");
|
|
16866
17153
|
var Node3 = newStyled.div`
|
|
@@ -16918,7 +17205,7 @@ var SwitchNodeBase = ({
|
|
|
16918
17205
|
const {
|
|
16919
17206
|
state: { selection }
|
|
16920
17207
|
} = useWorkflowContext();
|
|
16921
|
-
return /* @__PURE__ */ jsxs2(
|
|
17208
|
+
return /* @__PURE__ */ jsxs2(import_react68.Fragment, { children: [
|
|
16922
17209
|
top,
|
|
16923
17210
|
/* @__PURE__ */ jsxs2(Node3, { source: Boolean(source), editing: (selection == null ? void 0 : selection.id) === id, children: [
|
|
16924
17211
|
toolbar,
|
|
@@ -16965,7 +17252,7 @@ var SwitchNodeForm = ({
|
|
|
16965
17252
|
var Form_default4 = SwitchNodeForm;
|
|
16966
17253
|
|
|
16967
17254
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Nodes/CustomNodes/SwitchNode/Node.tsx
|
|
16968
|
-
var
|
|
17255
|
+
var import_react70 = require("react");
|
|
16969
17256
|
var import_reactflow9 = require("reactflow");
|
|
16970
17257
|
var import_design_system_react_components37 = require("@livechat/design-system-react-components");
|
|
16971
17258
|
var handlerWrapperCss = css`
|
|
@@ -16988,10 +17275,10 @@ function SwitchNode({
|
|
|
16988
17275
|
id,
|
|
16989
17276
|
data
|
|
16990
17277
|
}) {
|
|
16991
|
-
const [isHovered, setIsHovered] = (0,
|
|
17278
|
+
const [isHovered, setIsHovered] = (0, import_react70.useState)(false);
|
|
16992
17279
|
const { nodes, updateTask, removeTask, goToAddTask } = useWorkflowContext();
|
|
16993
17280
|
const node2 = nodes.find((node3) => node3.id === id);
|
|
16994
|
-
(0,
|
|
17281
|
+
(0, import_react70.useEffect)(() => {
|
|
16995
17282
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
16996
17283
|
const sourceNode = nodes.find((node1) => node1.id === (node2 == null ? void 0 : node2.source));
|
|
16997
17284
|
if (sourceNode) {
|
|
@@ -17021,7 +17308,7 @@ function SwitchNode({
|
|
|
17021
17308
|
}
|
|
17022
17309
|
}, [node2 == null ? void 0 : node2.source]);
|
|
17023
17310
|
if (!node2) {
|
|
17024
|
-
return /* @__PURE__ */ jsx4(
|
|
17311
|
+
return /* @__PURE__ */ jsx4(import_react70.Fragment, {});
|
|
17025
17312
|
}
|
|
17026
17313
|
return /* @__PURE__ */ jsx4(
|
|
17027
17314
|
CustomNodeWrapper,
|
|
@@ -17037,7 +17324,7 @@ function SwitchNode({
|
|
|
17037
17324
|
{
|
|
17038
17325
|
id,
|
|
17039
17326
|
name: data.name,
|
|
17040
|
-
top: /* @__PURE__ */ jsxs2(
|
|
17327
|
+
top: /* @__PURE__ */ jsxs2(import_react70.Fragment, { children: [
|
|
17041
17328
|
/* @__PURE__ */ jsx4(
|
|
17042
17329
|
import_reactflow9.Handle,
|
|
17043
17330
|
{
|
|
@@ -17069,7 +17356,7 @@ function SwitchNode({
|
|
|
17069
17356
|
}
|
|
17070
17357
|
}
|
|
17071
17358
|
),
|
|
17072
|
-
bottom: /* @__PURE__ */ jsxs2(
|
|
17359
|
+
bottom: /* @__PURE__ */ jsxs2(import_react70.Fragment, { children: [
|
|
17073
17360
|
/* @__PURE__ */ jsx4(
|
|
17074
17361
|
import_reactflow9.Handle,
|
|
17075
17362
|
{
|
|
@@ -17099,13 +17386,13 @@ function SwitchNode({
|
|
|
17099
17386
|
}
|
|
17100
17387
|
);
|
|
17101
17388
|
}
|
|
17102
|
-
var Node_default3 = (0,
|
|
17389
|
+
var Node_default3 = (0, import_react70.memo)(SwitchNode);
|
|
17103
17390
|
|
|
17104
17391
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Nodes/CustomNodes/TerminateNode/Base.tsx
|
|
17105
17392
|
var import_design_system_icons21 = require("@livechat/design-system-icons");
|
|
17106
17393
|
var import_design_system_react_components38 = require("@livechat/design-system-react-components");
|
|
17107
|
-
var
|
|
17108
|
-
var
|
|
17394
|
+
var import_developer_studio_ui_react33 = require("@livechat/developer-studio-ui-react");
|
|
17395
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
17109
17396
|
var Node4 = newStyled.div`
|
|
17110
17397
|
background-color: ${({ editing }) => editing ? `var(${import_design_system_react_components38.DesignToken.SurfacePrimaryActive})` : `var(${import_design_system_react_components38.DesignToken.SurfacePrimaryDefault})`};
|
|
17111
17398
|
color: var(${import_design_system_react_components38.DesignToken.ContentBasicPrimary});
|
|
@@ -17148,7 +17435,7 @@ var TerminateNodeBase = ({
|
|
|
17148
17435
|
const {
|
|
17149
17436
|
state: { selection, visibility }
|
|
17150
17437
|
} = useWorkflowContext();
|
|
17151
|
-
return /* @__PURE__ */ (0,
|
|
17438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
17152
17439
|
Node4,
|
|
17153
17440
|
{
|
|
17154
17441
|
hasErrors: visibility.validation && hasErrors,
|
|
@@ -17156,9 +17443,9 @@ var TerminateNodeBase = ({
|
|
|
17156
17443
|
children: [
|
|
17157
17444
|
top,
|
|
17158
17445
|
toolbar,
|
|
17159
|
-
/* @__PURE__ */ (0,
|
|
17160
|
-
/* @__PURE__ */ (0,
|
|
17161
|
-
/* @__PURE__ */ (0,
|
|
17446
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Header5, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Title4, { children: [
|
|
17447
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_design_system_react_components38.Icon, { size: "large", source: import_design_system_icons21.ArrowBarToRight }),
|
|
17448
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_developer_studio_ui_react33.Column, { notPadded: true, children: "END" })
|
|
17162
17449
|
] }) })
|
|
17163
17450
|
]
|
|
17164
17451
|
}
|
|
@@ -17191,13 +17478,13 @@ var TerminateNodeForm = ({
|
|
|
17191
17478
|
var Form_default5 = TerminateNodeForm;
|
|
17192
17479
|
|
|
17193
17480
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Nodes/CustomNodes/TerminateNode/Node.tsx
|
|
17194
|
-
var
|
|
17481
|
+
var import_react72 = require("react");
|
|
17195
17482
|
var import_reactflow10 = require("reactflow");
|
|
17196
17483
|
function TerminateNode({
|
|
17197
17484
|
id,
|
|
17198
17485
|
data
|
|
17199
17486
|
}) {
|
|
17200
|
-
const [isHovered, setIsHovered] = (0,
|
|
17487
|
+
const [isHovered, setIsHovered] = (0, import_react72.useState)(false);
|
|
17201
17488
|
const { removeTask, goToAddTask } = useWorkflowContext();
|
|
17202
17489
|
return /* @__PURE__ */ jsx4(
|
|
17203
17490
|
CustomNodeWrapper,
|
|
@@ -17240,12 +17527,12 @@ function TerminateNode({
|
|
|
17240
17527
|
}
|
|
17241
17528
|
);
|
|
17242
17529
|
}
|
|
17243
|
-
var Node_default4 = (0,
|
|
17530
|
+
var Node_default4 = (0, import_react72.memo)(TerminateNode);
|
|
17244
17531
|
|
|
17245
17532
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Nodes/CustomNodes/TriggerNode/Base.tsx
|
|
17246
17533
|
var import_design_system_react_components39 = require("@livechat/design-system-react-components");
|
|
17247
|
-
var
|
|
17248
|
-
var
|
|
17534
|
+
var import_developer_studio_api36 = require("@livechat/developer-studio-api");
|
|
17535
|
+
var import_developer_studio_ui_react34 = require("@livechat/developer-studio-ui-react");
|
|
17249
17536
|
var Node5 = newStyled.div`
|
|
17250
17537
|
background-color: ${({ editing }) => editing ? `var(${import_design_system_react_components39.DesignToken.SurfacePrimaryActive})` : `var(${import_design_system_react_components39.DesignToken.SurfacePrimaryDefault})`};
|
|
17251
17538
|
color: var(${import_design_system_react_components39.DesignToken.ContentBasicPrimary});
|
|
@@ -17296,7 +17583,7 @@ var TriggerNodeBase = ({
|
|
|
17296
17583
|
} = useWorkflowContext();
|
|
17297
17584
|
const frame = frames.trigger;
|
|
17298
17585
|
const customization = (_a = frame == null ? void 0 : frame.__meta) == null ? void 0 : _a.config.customization;
|
|
17299
|
-
const revertIconColor = getWorkflowEnv2("isHeadless") && ((customization == null ? void 0 : customization.icon) ===
|
|
17586
|
+
const revertIconColor = getWorkflowEnv2("isHeadless") && ((customization == null ? void 0 : customization.icon) === import_developer_studio_api36.IntegrationNames.OpenAI || (customization == null ? void 0 : customization.icon) === import_developer_studio_api36.IntegrationNames.BigCommerce);
|
|
17300
17587
|
return /* @__PURE__ */ jsxs2(
|
|
17301
17588
|
Node5,
|
|
17302
17589
|
{
|
|
@@ -17317,7 +17604,7 @@ var TriggerNodeBase = ({
|
|
|
17317
17604
|
}
|
|
17318
17605
|
),
|
|
17319
17606
|
/* @__PURE__ */ jsxs2(
|
|
17320
|
-
|
|
17607
|
+
import_developer_studio_ui_react34.Column,
|
|
17321
17608
|
{
|
|
17322
17609
|
notPadded: true,
|
|
17323
17610
|
css: css`
|
|
@@ -17355,10 +17642,9 @@ var TriggerNodeBase = ({
|
|
|
17355
17642
|
var Base_default5 = TriggerNodeBase;
|
|
17356
17643
|
|
|
17357
17644
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Nodes/CustomNodes/TriggerNode/Form.tsx
|
|
17358
|
-
var
|
|
17645
|
+
var import_react74 = require("react");
|
|
17359
17646
|
var import_react_js_cron = require("react-js-cron");
|
|
17360
17647
|
var import_design_system_react_components40 = require("@livechat/design-system-react-components");
|
|
17361
|
-
var import_developer_studio_api34 = require("@livechat/developer-studio-api");
|
|
17362
17648
|
var cronCss = css`
|
|
17363
17649
|
width: 100%;
|
|
17364
17650
|
|
|
@@ -17393,7 +17679,7 @@ var cronCss = css`
|
|
|
17393
17679
|
}
|
|
17394
17680
|
`;
|
|
17395
17681
|
var CronWrapper = (props) => {
|
|
17396
|
-
const [state, setState] = (0,
|
|
17682
|
+
const [state, setState] = (0, import_react74.useState)(props.value);
|
|
17397
17683
|
return /* @__PURE__ */ jsx4(
|
|
17398
17684
|
import_react_js_cron.Cron,
|
|
17399
17685
|
{
|
|
@@ -17416,20 +17702,17 @@ var TriggerNodeForm = ({
|
|
|
17416
17702
|
if (data.type === "webhook") {
|
|
17417
17703
|
const _a = data.webhook.event, { name } = _a, formData = __objRest(_a, ["name"]);
|
|
17418
17704
|
const specConfig = (_c = (_b = metadata.frame) == null ? void 0 : _b.__meta) == null ? void 0 : _c.config;
|
|
17419
|
-
const
|
|
17420
|
-
|
|
17421
|
-
);
|
|
17422
|
-
const hasConnectionError = Boolean(
|
|
17423
|
-
(_e = (_d = metadata.error) == null ? void 0 : _d.webhook) == null ? void 0 : _e.headers
|
|
17705
|
+
const hasConnectionError = (_e = (_d = metadata.errors) == null ? void 0 : _d.__errorsExtended) == null ? void 0 : _e.some(
|
|
17706
|
+
(error) => error.keyword === "connection" || "activation"
|
|
17424
17707
|
);
|
|
17425
17708
|
return /* @__PURE__ */ jsx4(
|
|
17426
17709
|
Wrapper_default,
|
|
17427
17710
|
{
|
|
17428
17711
|
data,
|
|
17429
|
-
preselectedTab: hasConnectionError
|
|
17712
|
+
preselectedTab: hasConnectionError ? "connection" : void 0,
|
|
17430
17713
|
tabsMetadata: {
|
|
17431
17714
|
connection: {
|
|
17432
|
-
hasError: hasConnectionError
|
|
17715
|
+
hasError: hasConnectionError
|
|
17433
17716
|
}
|
|
17434
17717
|
},
|
|
17435
17718
|
children: /* @__PURE__ */ jsx4(
|
|
@@ -17438,7 +17721,7 @@ var TriggerNodeForm = ({
|
|
|
17438
17721
|
schema: (_f = specConfig == null ? void 0 : specConfig.specification) == null ? void 0 : _f.input,
|
|
17439
17722
|
formData,
|
|
17440
17723
|
formContext: { frame: metadata.frame, data },
|
|
17441
|
-
formErrors: (_h = (_g = metadata.
|
|
17724
|
+
formErrors: (_h = (_g = metadata.errors) == null ? void 0 : _g.webhook) == null ? void 0 : _h.event,
|
|
17442
17725
|
onChange: (formData2) => {
|
|
17443
17726
|
onChange(__spreadProps(__spreadValues({}, data), {
|
|
17444
17727
|
webhook: __spreadProps(__spreadValues({}, data.webhook), {
|
|
@@ -17465,18 +17748,18 @@ var TriggerNodeForm = ({
|
|
|
17465
17748
|
}
|
|
17466
17749
|
);
|
|
17467
17750
|
}
|
|
17468
|
-
return /* @__PURE__ */ jsx4(
|
|
17751
|
+
return /* @__PURE__ */ jsx4(import_react74.Fragment, {});
|
|
17469
17752
|
};
|
|
17470
17753
|
var Form_default6 = TriggerNodeForm;
|
|
17471
17754
|
|
|
17472
17755
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Nodes/CustomNodes/TriggerNode/Node.tsx
|
|
17473
|
-
var
|
|
17756
|
+
var import_react76 = require("react");
|
|
17474
17757
|
var import_reactflow11 = require("reactflow");
|
|
17475
17758
|
function TriggerNode({
|
|
17476
17759
|
id,
|
|
17477
17760
|
data
|
|
17478
17761
|
}) {
|
|
17479
|
-
const [isHovered, setIsHovered] = (0,
|
|
17762
|
+
const [isHovered, setIsHovered] = (0, import_react76.useState)(false);
|
|
17480
17763
|
const {
|
|
17481
17764
|
goToAddTask,
|
|
17482
17765
|
removeTrigger,
|
|
@@ -17531,7 +17814,7 @@ function TriggerNode({
|
|
|
17531
17814
|
}
|
|
17532
17815
|
);
|
|
17533
17816
|
}
|
|
17534
|
-
var Node_default5 = (0,
|
|
17817
|
+
var Node_default5 = (0, import_react76.memo)(TriggerNode);
|
|
17535
17818
|
|
|
17536
17819
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Panels/Edit/Wrapper.tsx
|
|
17537
17820
|
var import_styles = require("react-js-cron/dist/styles.css");
|
|
@@ -17561,8 +17844,8 @@ var Title6 = newStyled.p`
|
|
|
17561
17844
|
align-items: center;
|
|
17562
17845
|
gap: 16px;
|
|
17563
17846
|
`;
|
|
17564
|
-
|
|
17565
|
-
var _a, _b, _c, _d, _e
|
|
17847
|
+
function EditNodeWrapper() {
|
|
17848
|
+
var _a, _b, _c, _d, _e;
|
|
17566
17849
|
const {
|
|
17567
17850
|
updateTask,
|
|
17568
17851
|
updateTrigger,
|
|
@@ -17581,15 +17864,15 @@ var EditNodeWrapper = () => {
|
|
|
17581
17864
|
frame: frames.trigger
|
|
17582
17865
|
} : {
|
|
17583
17866
|
data: workflow.definition.tasks.find(
|
|
17584
|
-
(task2) => task2.taskReferenceName ===
|
|
17867
|
+
(task2) => task2.taskReferenceName === selection.id
|
|
17585
17868
|
),
|
|
17586
|
-
frame: frames.tasks[(_a = selection
|
|
17869
|
+
frame: frames.tasks[(_a = selection.id) != null ? _a : ""]
|
|
17587
17870
|
} : {
|
|
17588
17871
|
data: void 0,
|
|
17589
17872
|
frame: void 0
|
|
17590
17873
|
};
|
|
17591
17874
|
if (!data) {
|
|
17592
|
-
return /* @__PURE__ */ jsx4(
|
|
17875
|
+
return /* @__PURE__ */ jsx4(Fragment3, {});
|
|
17593
17876
|
}
|
|
17594
17877
|
const config14 = (_b = frame == null ? void 0 : frame.__meta) == null ? void 0 : _b.config;
|
|
17595
17878
|
const readonly = !workflow.draft;
|
|
@@ -17600,8 +17883,8 @@ var EditNodeWrapper = () => {
|
|
|
17600
17883
|
return /* @__PURE__ */ jsx4(
|
|
17601
17884
|
Form_default3,
|
|
17602
17885
|
{
|
|
17603
|
-
id: data.taskReferenceName,
|
|
17604
17886
|
data,
|
|
17887
|
+
id: data.taskReferenceName,
|
|
17605
17888
|
metadata: {
|
|
17606
17889
|
triggerType: workflow.trigger.type,
|
|
17607
17890
|
frame: frames.tasks[data.taskReferenceName],
|
|
@@ -17617,8 +17900,8 @@ var EditNodeWrapper = () => {
|
|
|
17617
17900
|
return /* @__PURE__ */ jsx4(
|
|
17618
17901
|
Form_default4,
|
|
17619
17902
|
{
|
|
17620
|
-
id: data.taskReferenceName,
|
|
17621
17903
|
data,
|
|
17904
|
+
id: data.taskReferenceName,
|
|
17622
17905
|
metadata: {
|
|
17623
17906
|
frame: frames.tasks[data.taskReferenceName]
|
|
17624
17907
|
},
|
|
@@ -17632,8 +17915,8 @@ var EditNodeWrapper = () => {
|
|
|
17632
17915
|
return /* @__PURE__ */ jsx4(
|
|
17633
17916
|
Form_default2,
|
|
17634
17917
|
{
|
|
17635
|
-
id: data.taskReferenceName,
|
|
17636
17918
|
data,
|
|
17919
|
+
id: data.taskReferenceName,
|
|
17637
17920
|
metadata: {
|
|
17638
17921
|
frame: frames.tasks[data.taskReferenceName]
|
|
17639
17922
|
},
|
|
@@ -17647,8 +17930,8 @@ var EditNodeWrapper = () => {
|
|
|
17647
17930
|
return /* @__PURE__ */ jsx4(
|
|
17648
17931
|
Form_default5,
|
|
17649
17932
|
{
|
|
17650
|
-
id: data.taskReferenceName,
|
|
17651
17933
|
data,
|
|
17934
|
+
id: data.taskReferenceName,
|
|
17652
17935
|
metadata: {
|
|
17653
17936
|
frame: frames.tasks[data.taskReferenceName]
|
|
17654
17937
|
},
|
|
@@ -17666,7 +17949,7 @@ var EditNodeWrapper = () => {
|
|
|
17666
17949
|
data,
|
|
17667
17950
|
metadata: {
|
|
17668
17951
|
frame: frames.trigger,
|
|
17669
|
-
|
|
17952
|
+
errors: errors.trigger
|
|
17670
17953
|
},
|
|
17671
17954
|
onChange: (trigger) => {
|
|
17672
17955
|
updateTrigger(trigger);
|
|
@@ -17676,9 +17959,9 @@ var EditNodeWrapper = () => {
|
|
|
17676
17959
|
);
|
|
17677
17960
|
}
|
|
17678
17961
|
};
|
|
17679
|
-
const revertIconColor = getWorkflowEnv2("isHeadless") && ((
|
|
17962
|
+
const revertIconColor = getWorkflowEnv2("isHeadless") && ((config14 == null ? void 0 : config14.customization.icon) === import_developer_studio_api37.IntegrationNames.OpenAI || (config14 == null ? void 0 : config14.customization.icon) === import_developer_studio_api37.IntegrationNames.BigCommerce);
|
|
17680
17963
|
return /* @__PURE__ */ jsxs2(Wrapper3, { children: [
|
|
17681
|
-
/* @__PURE__ */ jsxs2(
|
|
17964
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react35.Row, { center: true, setRowPadding: "12px 24px", spaceBetween: true, children: [
|
|
17682
17965
|
/* @__PURE__ */ jsx4(
|
|
17683
17966
|
Header7,
|
|
17684
17967
|
{
|
|
@@ -17689,40 +17972,47 @@ var EditNodeWrapper = () => {
|
|
|
17689
17972
|
(config14 == null ? void 0 : config14.customization.product) ? /* @__PURE__ */ jsx4(
|
|
17690
17973
|
ProductIcon_default,
|
|
17691
17974
|
{
|
|
17692
|
-
product: config14.customization.icon,
|
|
17693
17975
|
center: true,
|
|
17694
17976
|
disabled: false,
|
|
17695
17977
|
height: 10,
|
|
17696
|
-
|
|
17697
|
-
revertColors: revertIconColor
|
|
17978
|
+
product: config14.customization.icon,
|
|
17979
|
+
revertColors: revertIconColor,
|
|
17980
|
+
width: 10
|
|
17698
17981
|
}
|
|
17699
17982
|
) : /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
|
|
17700
17983
|
import_design_system_react_components41.Icon,
|
|
17701
17984
|
{
|
|
17702
|
-
source: import_design_system_icons22.Automation,
|
|
17703
|
-
size: "xlarge",
|
|
17704
17985
|
css: css`
|
|
17705
17986
|
width: var(${import_design_system_react_components41.SpacingToken.Spacing6});
|
|
17706
|
-
|
|
17987
|
+
`,
|
|
17988
|
+
size: "xlarge",
|
|
17989
|
+
source: import_design_system_icons22.Automation
|
|
17707
17990
|
}
|
|
17708
17991
|
) }),
|
|
17709
|
-
/* @__PURE__ */ jsxs2(
|
|
17992
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react35.Column, { noFlexBasis: true, notPadded: true, children: [
|
|
17710
17993
|
/* @__PURE__ */ jsxs2("strong", { children: [
|
|
17711
|
-
((
|
|
17712
|
-
(
|
|
17994
|
+
((_c = frame == null ? void 0 : frame.__meta) == null ? void 0 : _c.index) !== void 0 ? `${frame.__meta.index}. ` : "",
|
|
17995
|
+
(_d = config14 == null ? void 0 : config14.customization.displayName) != null ? _d : data.type === NodeTypes.switch ? "Condition" : data.type === NodeTypes.http ? "Custom HTTP" : data.type === NodeTypes.terminate ? "End workflow" : ""
|
|
17713
17996
|
] }),
|
|
17714
|
-
(
|
|
17997
|
+
(_e = config14 == null ? void 0 : config14.customization.description) != null ? _e : data.type === NodeTypes.switch ? "Conditional execution" : data.type === NodeTypes.http ? "Make an HTTP request" : data.type === NodeTypes.terminate ? "End the workflow" : ""
|
|
17715
17998
|
] })
|
|
17716
17999
|
] })
|
|
17717
18000
|
}
|
|
17718
18001
|
),
|
|
17719
|
-
/* @__PURE__ */ jsx4(
|
|
17720
|
-
|
|
17721
|
-
|
|
18002
|
+
/* @__PURE__ */ jsx4(
|
|
18003
|
+
import_design_system_react_components41.Button,
|
|
18004
|
+
{
|
|
18005
|
+
kind: "plain",
|
|
18006
|
+
onClick: () => {
|
|
18007
|
+
toggle();
|
|
18008
|
+
},
|
|
18009
|
+
children: /* @__PURE__ */ jsx4(import_design_system_react_components41.Icon, { source: import_design_system_icons22.Close })
|
|
18010
|
+
}
|
|
18011
|
+
)
|
|
17722
18012
|
] }),
|
|
17723
|
-
/* @__PURE__ */ jsx4(
|
|
18013
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react35.Row, { css: formCss, children: contentHandler() })
|
|
17724
18014
|
] });
|
|
17725
|
-
}
|
|
18015
|
+
}
|
|
17726
18016
|
var Wrapper_default2 = EditNodeWrapper;
|
|
17727
18017
|
|
|
17728
18018
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Panels/Edit/index.ts
|
|
@@ -17733,7 +18023,7 @@ var import_react113 = require("react");
|
|
|
17733
18023
|
var import_reactflow18 = __toESM(require("reactflow"));
|
|
17734
18024
|
var import_design_system_icons33 = require("@livechat/design-system-icons");
|
|
17735
18025
|
var import_design_system_react_components64 = require("@livechat/design-system-react-components");
|
|
17736
|
-
var
|
|
18026
|
+
var import_developer_studio_api38 = require("@livechat/developer-studio-api");
|
|
17737
18027
|
|
|
17738
18028
|
// src/views/Flows/Definitions/Common/Modals/Preview.tsx
|
|
17739
18029
|
var import_react78 = require("react");
|
|
@@ -18026,7 +18316,7 @@ var import_react_router_dom14 = require("react-router-dom");
|
|
|
18026
18316
|
var import_reactflow15 = require("reactflow");
|
|
18027
18317
|
var import_design_system_icons32 = require("@livechat/design-system-icons");
|
|
18028
18318
|
var import_design_system_react_components61 = require("@livechat/design-system-react-components");
|
|
18029
|
-
var
|
|
18319
|
+
var import_developer_studio_ui_react40 = require("@livechat/developer-studio-ui-react");
|
|
18030
18320
|
|
|
18031
18321
|
// src/views/Flows/Definitions/Common/One/widget/message-box/OneMessageBox.tsx
|
|
18032
18322
|
var import_react94 = require("react");
|
|
@@ -18199,7 +18489,7 @@ var import_lexical = require("lexical");
|
|
|
18199
18489
|
// src/views/Flows/Definitions/Common/One/contexts/OneMessagesContext.tsx
|
|
18200
18490
|
var import_react87 = require("react");
|
|
18201
18491
|
var import_uuid3 = require("uuid");
|
|
18202
|
-
var
|
|
18492
|
+
var import_developer_studio_ui_react36 = require("@livechat/developer-studio-ui-react");
|
|
18203
18493
|
|
|
18204
18494
|
// src/views/Flows/Definitions/Common/One/helpers.ts
|
|
18205
18495
|
var import_uuid2 = require("uuid");
|
|
@@ -18273,7 +18563,7 @@ var getSources = (sources) => {
|
|
|
18273
18563
|
};
|
|
18274
18564
|
|
|
18275
18565
|
// src/views/Flows/Definitions/Common/One/contexts/OneMessagesContext.tsx
|
|
18276
|
-
var
|
|
18566
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
18277
18567
|
var getInitialMessage = () => [
|
|
18278
18568
|
{
|
|
18279
18569
|
authorId: "live-assistant",
|
|
@@ -18303,7 +18593,7 @@ var OneMessagesProvider = ({
|
|
|
18303
18593
|
const generateAiResponseMutation = useGenerateAIResponse();
|
|
18304
18594
|
const {
|
|
18305
18595
|
userData: { user }
|
|
18306
|
-
} = (0,
|
|
18596
|
+
} = (0, import_developer_studio_ui_react36.useRootContext)();
|
|
18307
18597
|
const isLoading = generateAiResponseMutation.isLoading;
|
|
18308
18598
|
const sendMessage = (message) => __async(void 0, null, function* () {
|
|
18309
18599
|
const config14 = getWorkflowsConfig2();
|
|
@@ -18362,7 +18652,7 @@ var OneMessagesProvider = ({
|
|
|
18362
18652
|
[events, isLoading, isError]
|
|
18363
18653
|
);
|
|
18364
18654
|
const hasAdditionalEvents = events.length !== eventsGroup.length;
|
|
18365
|
-
return /* @__PURE__ */ (0,
|
|
18655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
18366
18656
|
OneMessagesContext.Provider,
|
|
18367
18657
|
{
|
|
18368
18658
|
value: {
|
|
@@ -19431,7 +19721,7 @@ var NavigateButton = ({
|
|
|
19431
19721
|
var import_react106 = require("react");
|
|
19432
19722
|
var import_design_system_icons30 = require("@livechat/design-system-icons");
|
|
19433
19723
|
var import_design_system_react_components57 = require("@livechat/design-system-react-components");
|
|
19434
|
-
var
|
|
19724
|
+
var import_developer_studio_ui_react38 = require("@livechat/developer-studio-ui-react");
|
|
19435
19725
|
|
|
19436
19726
|
// src/views/Flows/Definitions/Common/One/components/ApplyWorkflowButton.tsx
|
|
19437
19727
|
var import_react104 = require("react");
|
|
@@ -19489,12 +19779,12 @@ var ApplyWorkflowButton = ({
|
|
|
19489
19779
|
};
|
|
19490
19780
|
|
|
19491
19781
|
// src/views/Flows/Definitions/Common/One/hooks/use-message-bottom-bar.ts
|
|
19492
|
-
var
|
|
19782
|
+
var import_developer_studio_ui_react37 = require("@livechat/developer-studio-ui-react");
|
|
19493
19783
|
var useMessageBottomBar = (event) => {
|
|
19494
19784
|
const { text: text2, sessionId } = event;
|
|
19495
|
-
const notifications = (0,
|
|
19785
|
+
const notifications = (0, import_developer_studio_ui_react37.useNotifications)();
|
|
19496
19786
|
const handleCopyClick = () => __async(void 0, null, function* () {
|
|
19497
|
-
const isCopied = yield (0,
|
|
19787
|
+
const isCopied = yield (0, import_developer_studio_ui_react37.copyTextToClipboard)(text2);
|
|
19498
19788
|
if (isCopied) {
|
|
19499
19789
|
notifications.showSuccess("Message copied successfully");
|
|
19500
19790
|
} else {
|
|
@@ -19531,7 +19821,7 @@ var OneAssistantMessageBottomBar = ({
|
|
|
19531
19821
|
const numberOfSources = (eventSources == null ? void 0 : eventSources.length) || 0;
|
|
19532
19822
|
const { topSources } = getSources(eventSources);
|
|
19533
19823
|
const { handleCopyClick, handleRateMessageClick } = useMessageBottomBar(event);
|
|
19534
|
-
const sourcesText = `${(0,
|
|
19824
|
+
const sourcesText = `${(0, import_developer_studio_ui_react38.plural)(numberOfSources, "Source", "Sources")}`;
|
|
19535
19825
|
return /* @__PURE__ */ jsxs2("div", { css: bottomBarContainer, children: [
|
|
19536
19826
|
/* @__PURE__ */ jsxs2("div", { css: bottomBar2, children: [
|
|
19537
19827
|
/* @__PURE__ */ jsxs2("div", { children: [
|
|
@@ -19846,12 +20136,12 @@ var OneChatFeedContent = ({
|
|
|
19846
20136
|
// src/views/Flows/Definitions/Common/One/widget/OneWidgetHeader.tsx
|
|
19847
20137
|
var import_design_system_icons31 = require("@livechat/design-system-icons");
|
|
19848
20138
|
var import_design_system_react_components60 = require("@livechat/design-system-react-components");
|
|
19849
|
-
var
|
|
20139
|
+
var import_developer_studio_ui_react39 = require("@livechat/developer-studio-ui-react");
|
|
19850
20140
|
var OneWidgetHeader = () => {
|
|
19851
20141
|
const { toggleOneWidget } = useOneWidgetContext();
|
|
19852
20142
|
return /* @__PURE__ */ jsxs2("div", { css: headerWrapper, children: [
|
|
19853
20143
|
/* @__PURE__ */ jsxs2("div", { children: [
|
|
19854
|
-
/* @__PURE__ */ jsx4(import_design_system_react_components60.Icon, { size: "xlarge", source:
|
|
20144
|
+
/* @__PURE__ */ jsx4(import_design_system_react_components60.Icon, { size: "xlarge", source: import_developer_studio_ui_react39.OneIcon }),
|
|
19855
20145
|
/* @__PURE__ */ jsx4(import_design_system_react_components60.Text, { as: "h2", children: "Copilot" })
|
|
19856
20146
|
] }),
|
|
19857
20147
|
/* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
|
|
@@ -19971,7 +20261,7 @@ var CustomControls = ({
|
|
|
19971
20261
|
}
|
|
19972
20262
|
`,
|
|
19973
20263
|
size: "large",
|
|
19974
|
-
source:
|
|
20264
|
+
source: import_developer_studio_ui_react40.OneIcon
|
|
19975
20265
|
}
|
|
19976
20266
|
)
|
|
19977
20267
|
}
|
|
@@ -20047,7 +20337,7 @@ var import_react110 = require("react");
|
|
|
20047
20337
|
var import_react_router_dom15 = require("react-router-dom");
|
|
20048
20338
|
var import_reactflow16 = require("reactflow");
|
|
20049
20339
|
var import_design_system_react_components62 = require("@livechat/design-system-react-components");
|
|
20050
|
-
var
|
|
20340
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
20051
20341
|
function SwitcherControls({
|
|
20052
20342
|
isDraft,
|
|
20053
20343
|
hasRelatedWorkflow,
|
|
@@ -20090,7 +20380,7 @@ function SwitcherControls({
|
|
|
20090
20380
|
}
|
|
20091
20381
|
};
|
|
20092
20382
|
if (!visibility.switcher || !isDraft && !hasRelatedWorkflow) {
|
|
20093
|
-
return /* @__PURE__ */ (0,
|
|
20383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_react110.Fragment, {});
|
|
20094
20384
|
}
|
|
20095
20385
|
const handleVersionClick = (id) => {
|
|
20096
20386
|
if (id === "draft" && isDraft) {
|
|
@@ -20105,14 +20395,14 @@ function SwitcherControls({
|
|
|
20105
20395
|
});
|
|
20106
20396
|
focus();
|
|
20107
20397
|
};
|
|
20108
|
-
return /* @__PURE__ */ (0,
|
|
20398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
20109
20399
|
import_reactflow16.Controls,
|
|
20110
20400
|
{
|
|
20111
20401
|
showZoom: false,
|
|
20112
20402
|
showInteractive: false,
|
|
20113
20403
|
showFitView: false,
|
|
20114
20404
|
position: "top-center",
|
|
20115
|
-
children: /* @__PURE__ */ (0,
|
|
20405
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
20116
20406
|
import_design_system_react_components62.SegmentedControl,
|
|
20117
20407
|
{
|
|
20118
20408
|
size: "compact",
|
|
@@ -20183,16 +20473,16 @@ var Edges_default = CustomEdge_default;
|
|
|
20183
20473
|
|
|
20184
20474
|
// src/views/Flows/Definitions/Common/Builder/Editors/Visual/Diagram/Diagram.tsx
|
|
20185
20475
|
var import_style = require("reactflow/dist/style.css");
|
|
20186
|
-
var
|
|
20476
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
20187
20477
|
var nodeConfig = {
|
|
20188
|
-
[
|
|
20189
|
-
[
|
|
20190
|
-
[
|
|
20191
|
-
[
|
|
20192
|
-
[
|
|
20193
|
-
[
|
|
20194
|
-
[
|
|
20195
|
-
[
|
|
20478
|
+
[import_developer_studio_api38.WorkflowDefinitionTaskType.http]: Node_default2,
|
|
20479
|
+
[import_developer_studio_api38.WorkflowDefinitionTaskType.forkJoin]: Node_default,
|
|
20480
|
+
[import_developer_studio_api38.WorkflowDefinitionTaskType.switch]: Node_default3,
|
|
20481
|
+
[import_developer_studio_api38.WorkflowDefinitionTaskType.terminate]: Node_default4,
|
|
20482
|
+
[import_developer_studio_api38.WorkflowDefinitionTaskType.join]: Node_default7,
|
|
20483
|
+
[import_developer_studio_api38.WorkflowDefinitionTaskType.addNode]: Node_default6,
|
|
20484
|
+
[import_developer_studio_api38.WorkflowDefinitionTaskType.addTrigger]: Trigger_default,
|
|
20485
|
+
[import_developer_studio_api38.WorkflowDefinitionTaskType.trigger]: Node_default5
|
|
20196
20486
|
};
|
|
20197
20487
|
var nodeTypes = Object.entries(nodeConfig).reduce((result, [key, Node8]) => {
|
|
20198
20488
|
result[key] = Node8;
|
|
@@ -20241,10 +20531,10 @@ var Diagram = ({
|
|
|
20241
20531
|
if (forkNode.data.forkTasks.length > 2) {
|
|
20242
20532
|
const indexHelper = edge.id.split("-");
|
|
20243
20533
|
const pathIndex = indexHelper[indexHelper.length - 1];
|
|
20244
|
-
edge.data.label = /* @__PURE__ */ (0,
|
|
20534
|
+
edge.data.label = /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
20245
20535
|
import_design_system_react_components64.Button,
|
|
20246
20536
|
{
|
|
20247
|
-
icon: /* @__PURE__ */ (0,
|
|
20537
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_design_system_react_components64.Icon, { source: import_design_system_icons33.Delete }),
|
|
20248
20538
|
kind: "plain",
|
|
20249
20539
|
onClick: () => {
|
|
20250
20540
|
forkNode.data.forkTasks.splice(pathIndex, 1);
|
|
@@ -20272,8 +20562,8 @@ var Diagram = ({
|
|
|
20272
20562
|
if (!workflow.draft && isRawEditorVisible) {
|
|
20273
20563
|
onRawEditorToggle && onRawEditorToggle();
|
|
20274
20564
|
}
|
|
20275
|
-
return /* @__PURE__ */ (0,
|
|
20276
|
-
/* @__PURE__ */ (0,
|
|
20565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_react113.Fragment, { children: [
|
|
20566
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
20277
20567
|
import_reactflow18.default,
|
|
20278
20568
|
{
|
|
20279
20569
|
nodes,
|
|
@@ -20286,7 +20576,7 @@ var Diagram = ({
|
|
|
20286
20576
|
return;
|
|
20287
20577
|
}
|
|
20288
20578
|
toggle(
|
|
20289
|
-
node2.type ===
|
|
20579
|
+
node2.type === import_developer_studio_api38.WorkflowDefinitionTaskType.trigger ? {
|
|
20290
20580
|
kind: "trigger",
|
|
20291
20581
|
id: node2.data.type
|
|
20292
20582
|
} : {
|
|
@@ -20307,7 +20597,7 @@ var Diagram = ({
|
|
|
20307
20597
|
},
|
|
20308
20598
|
edgeTypes,
|
|
20309
20599
|
children: [
|
|
20310
|
-
/* @__PURE__ */ (0,
|
|
20600
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
20311
20601
|
SwitcherControls,
|
|
20312
20602
|
{
|
|
20313
20603
|
isDraft: (_a = workflow.draft) != null ? _a : false,
|
|
@@ -20315,7 +20605,7 @@ var Diagram = ({
|
|
|
20315
20605
|
relatedWorkflowId: workflow.related_workflow_id
|
|
20316
20606
|
}
|
|
20317
20607
|
),
|
|
20318
|
-
/* @__PURE__ */ (0,
|
|
20608
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
20319
20609
|
CustomControls_default,
|
|
20320
20610
|
{
|
|
20321
20611
|
isRawEditorVisible,
|
|
@@ -20331,7 +20621,7 @@ var Diagram = ({
|
|
|
20331
20621
|
}
|
|
20332
20622
|
}
|
|
20333
20623
|
),
|
|
20334
|
-
/* @__PURE__ */ (0,
|
|
20624
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
20335
20625
|
import_reactflow18.Background,
|
|
20336
20626
|
{
|
|
20337
20627
|
color: `var(${import_design_system_react_components64.DesignToken.SurfaceSecondaryActive})`,
|
|
@@ -20342,7 +20632,7 @@ var Diagram = ({
|
|
|
20342
20632
|
]
|
|
20343
20633
|
}
|
|
20344
20634
|
),
|
|
20345
|
-
previewModalVisible.isVisible && /* @__PURE__ */ (0,
|
|
20635
|
+
previewModalVisible.isVisible && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
20346
20636
|
Preview_default,
|
|
20347
20637
|
{
|
|
20348
20638
|
onClose: () => {
|
|
@@ -20423,7 +20713,7 @@ var WorkflowBuilder = () => {
|
|
|
20423
20713
|
var Builder_default = WorkflowBuilder;
|
|
20424
20714
|
|
|
20425
20715
|
// src/views/Flows/Definitions/Common/Modals/Delete.tsx
|
|
20426
|
-
var
|
|
20716
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
20427
20717
|
var ModalContent2 = newStyled.div`
|
|
20428
20718
|
display: grid;
|
|
20429
20719
|
align-items: center;
|
|
@@ -20460,12 +20750,12 @@ function WorkflowDeleteModal({
|
|
|
20460
20750
|
} = useWorkflowContext();
|
|
20461
20751
|
const {
|
|
20462
20752
|
userData: { user }
|
|
20463
|
-
} = (0,
|
|
20753
|
+
} = (0, import_developer_studio_ui_react41.useRootContext)();
|
|
20464
20754
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
20465
20755
|
user == null ? void 0 : user.meta.email
|
|
20466
20756
|
);
|
|
20467
|
-
return /* @__PURE__ */ (0,
|
|
20468
|
-
/* @__PURE__ */ (0,
|
|
20757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_design_system_react_components66.Modal, { heading: true, onClose, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(ModalContent2, { children: [
|
|
20758
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
20469
20759
|
import_design_system_react_components66.Icon,
|
|
20470
20760
|
{
|
|
20471
20761
|
source: import_design_system_icons34.Error,
|
|
@@ -20473,20 +20763,20 @@ function WorkflowDeleteModal({
|
|
|
20473
20763
|
customColor: `var(${import_design_system_react_components66.DesignToken.ContentBasicDisabled})`
|
|
20474
20764
|
}
|
|
20475
20765
|
),
|
|
20476
|
-
/* @__PURE__ */ (0,
|
|
20766
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_design_system_react_components66.Heading, { as: "h2", size: "md", children: [
|
|
20477
20767
|
"You are",
|
|
20478
20768
|
" ",
|
|
20479
20769
|
version === "draft" ? `discarding a ${version}` : `deleting a ${version}`
|
|
20480
20770
|
] }),
|
|
20481
|
-
/* @__PURE__ */ (0,
|
|
20771
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_design_system_react_components66.Text, { size: "md", children: [
|
|
20482
20772
|
"You can\u2019t restore a",
|
|
20483
20773
|
" ",
|
|
20484
20774
|
version === "draft" ? `discarded ${version}` : `deleted ${version}`,
|
|
20485
20775
|
". Are you sure you want to continue?"
|
|
20486
20776
|
] }),
|
|
20487
|
-
/* @__PURE__ */ (0,
|
|
20488
|
-
/* @__PURE__ */ (0,
|
|
20489
|
-
/* @__PURE__ */ (0,
|
|
20777
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(ModalFooter, { children: [
|
|
20778
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_design_system_react_components66.Button, { kind: "secondary", onClick: onClose, children: "Cancel" }),
|
|
20779
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
20490
20780
|
import_design_system_react_components66.Button,
|
|
20491
20781
|
{
|
|
20492
20782
|
kind: "destructive",
|
|
@@ -20514,8 +20804,8 @@ function WorkflowDeleteModal({
|
|
|
20514
20804
|
var import_react_router_dom17 = require("react-router-dom");
|
|
20515
20805
|
var import_design_system_icons35 = require("@livechat/design-system-icons");
|
|
20516
20806
|
var import_design_system_react_components67 = require("@livechat/design-system-react-components");
|
|
20517
|
-
var
|
|
20518
|
-
var
|
|
20807
|
+
var import_developer_studio_ui_react42 = require("@livechat/developer-studio-ui-react");
|
|
20808
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
20519
20809
|
var ModalContent3 = newStyled.div`
|
|
20520
20810
|
display: grid;
|
|
20521
20811
|
align-items: center;
|
|
@@ -20549,12 +20839,12 @@ function WorkflowEditModal({ onClose }) {
|
|
|
20549
20839
|
} = useWorkflowContext();
|
|
20550
20840
|
const {
|
|
20551
20841
|
userData: { user }
|
|
20552
|
-
} = (0,
|
|
20842
|
+
} = (0, import_developer_studio_ui_react42.useRootContext)();
|
|
20553
20843
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
20554
20844
|
user == null ? void 0 : user.meta.email
|
|
20555
20845
|
);
|
|
20556
|
-
return /* @__PURE__ */ (0,
|
|
20557
|
-
/* @__PURE__ */ (0,
|
|
20846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_design_system_react_components67.Modal, { heading: true, onClose, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(ModalContent3, { children: [
|
|
20847
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
20558
20848
|
import_design_system_react_components67.Icon,
|
|
20559
20849
|
{
|
|
20560
20850
|
source: import_design_system_icons35.Error,
|
|
@@ -20562,10 +20852,10 @@ function WorkflowEditModal({ onClose }) {
|
|
|
20562
20852
|
customColor: `var(${import_design_system_react_components67.DesignToken.ContentBasicDisabled})`
|
|
20563
20853
|
}
|
|
20564
20854
|
),
|
|
20565
|
-
/* @__PURE__ */ (0,
|
|
20566
|
-
/* @__PURE__ */ (0,
|
|
20567
|
-
/* @__PURE__ */ (0,
|
|
20568
|
-
/* @__PURE__ */ (0,
|
|
20855
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_design_system_react_components67.Heading, { as: "h2", size: "md", children: "You have an existing draft" }),
|
|
20856
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_design_system_react_components67.Text, { size: "md", children: "You already have an existing draft, by editing the published version you can overwrite the current draft for this workflow. Do you want to continue?" }),
|
|
20857
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(ModalFooter2, { children: [
|
|
20858
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
20569
20859
|
import_design_system_react_components67.Button,
|
|
20570
20860
|
{
|
|
20571
20861
|
kind: "secondary",
|
|
@@ -20578,7 +20868,7 @@ function WorkflowEditModal({ onClose }) {
|
|
|
20578
20868
|
children: "Edit existing draft"
|
|
20579
20869
|
}
|
|
20580
20870
|
),
|
|
20581
|
-
/* @__PURE__ */ (0,
|
|
20871
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
20582
20872
|
import_design_system_react_components67.Button,
|
|
20583
20873
|
{
|
|
20584
20874
|
kind: "destructive",
|
|
@@ -20597,7 +20887,7 @@ function WorkflowEditModal({ onClose }) {
|
|
|
20597
20887
|
// src/views/Flows/Definitions/Common/Modals/Publish.tsx
|
|
20598
20888
|
var import_design_system_icons36 = require("@livechat/design-system-icons");
|
|
20599
20889
|
var import_design_system_react_components68 = require("@livechat/design-system-react-components");
|
|
20600
|
-
var
|
|
20890
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
20601
20891
|
var ModalContent4 = newStyled.div`
|
|
20602
20892
|
display: grid;
|
|
20603
20893
|
align-items: center;
|
|
@@ -20629,8 +20919,8 @@ function WorkflowPublishModal({
|
|
|
20629
20919
|
},
|
|
20630
20920
|
publishDraft
|
|
20631
20921
|
} = useWorkflowContext();
|
|
20632
|
-
return /* @__PURE__ */ (0,
|
|
20633
|
-
/* @__PURE__ */ (0,
|
|
20922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_design_system_react_components68.Modal, { heading: true, onClose, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(ModalContent4, { children: [
|
|
20923
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
20634
20924
|
import_design_system_react_components68.Icon,
|
|
20635
20925
|
{
|
|
20636
20926
|
source: import_design_system_icons36.Error,
|
|
@@ -20638,11 +20928,11 @@ function WorkflowPublishModal({
|
|
|
20638
20928
|
customColor: `var(${import_design_system_react_components68.DesignToken.ContentBasicDisabled})`
|
|
20639
20929
|
}
|
|
20640
20930
|
),
|
|
20641
|
-
/* @__PURE__ */ (0,
|
|
20642
|
-
/* @__PURE__ */ (0,
|
|
20643
|
-
/* @__PURE__ */ (0,
|
|
20644
|
-
/* @__PURE__ */ (0,
|
|
20645
|
-
/* @__PURE__ */ (0,
|
|
20931
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_design_system_react_components68.Heading, { as: "h2", size: "md", children: "You are publishing a workflow" }),
|
|
20932
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_design_system_react_components68.Text, { size: "md", children: "Once published, this will be the working version of your workflow and will\xA0be\xA0automatically set to active." }),
|
|
20933
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(ModalFooter3, { children: [
|
|
20934
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_design_system_react_components68.Button, { kind: "secondary", onClick: onClose, children: "Cancel" }),
|
|
20935
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
20646
20936
|
import_design_system_react_components68.Button,
|
|
20647
20937
|
{
|
|
20648
20938
|
kind: "primary",
|
|
@@ -20748,13 +21038,13 @@ var Execute_default = ExecuteWorkflow;
|
|
|
20748
21038
|
var import_react119 = require("react");
|
|
20749
21039
|
var import_react_router_dom18 = require("react-router-dom");
|
|
20750
21040
|
var import_design_system_react_components71 = require("@livechat/design-system-react-components");
|
|
20751
|
-
var
|
|
20752
|
-
var
|
|
21041
|
+
var import_developer_studio_api39 = require("@livechat/developer-studio-api");
|
|
21042
|
+
var import_developer_studio_ui_react44 = require("@livechat/developer-studio-ui-react");
|
|
20753
21043
|
|
|
20754
21044
|
// src/views/Flows/Definitions/Edit/Tasks/Options.tsx
|
|
20755
21045
|
var import_react117 = require("react");
|
|
20756
21046
|
var import_design_system_react_components70 = require("@livechat/design-system-react-components");
|
|
20757
|
-
var
|
|
21047
|
+
var import_developer_studio_ui_react43 = require("@livechat/developer-studio-ui-react");
|
|
20758
21048
|
var itemOptionCss = (active) => css`
|
|
20759
21049
|
display: flex;
|
|
20760
21050
|
align-items: center;
|
|
@@ -20775,7 +21065,7 @@ var itemOptionCss = (active) => css`
|
|
|
20775
21065
|
}
|
|
20776
21066
|
`;
|
|
20777
21067
|
var ItemOption = ({ option, onClick, active }) => {
|
|
20778
|
-
return /* @__PURE__ */ jsx4("div", { css: itemOptionCss(active), onClick, children: /* @__PURE__ */ jsxs2(
|
|
21068
|
+
return /* @__PURE__ */ jsx4("div", { css: itemOptionCss(active), onClick, children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react43.Column, { setColumnPadding: "0", width: 6, children: [
|
|
20779
21069
|
/* @__PURE__ */ jsx4(import_design_system_react_components70.Text, { noMargin: true, children: option.name }),
|
|
20780
21070
|
/* @__PURE__ */ jsx4(
|
|
20781
21071
|
import_design_system_react_components70.Text,
|
|
@@ -20889,9 +21179,9 @@ var config10 = [
|
|
|
20889
21179
|
}))
|
|
20890
21180
|
},
|
|
20891
21181
|
{
|
|
20892
|
-
name:
|
|
20893
|
-
displayName:
|
|
20894
|
-
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product:
|
|
21182
|
+
name: import_developer_studio_api39.IntegrationNames.Mailchimp,
|
|
21183
|
+
displayName: import_developer_studio_api39.IntegrationDisplayNames.Mailchimp,
|
|
21184
|
+
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product: import_developer_studio_api39.IntegrationNames.Mailchimp, height: 5, width: 5 }),
|
|
20895
21185
|
values: Object.values(mailchimpTaskConfigs).map((x) => ({
|
|
20896
21186
|
key: x.key,
|
|
20897
21187
|
name: x.customization.displayName,
|
|
@@ -20900,9 +21190,9 @@ var config10 = [
|
|
|
20900
21190
|
}))
|
|
20901
21191
|
},
|
|
20902
21192
|
{
|
|
20903
|
-
name:
|
|
20904
|
-
displayName:
|
|
20905
|
-
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product:
|
|
21193
|
+
name: import_developer_studio_api39.IntegrationNames.HubSpot,
|
|
21194
|
+
displayName: import_developer_studio_api39.IntegrationDisplayNames.HubSpot,
|
|
21195
|
+
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product: import_developer_studio_api39.IntegrationNames.HubSpot, height: 5, width: 5 }),
|
|
20906
21196
|
values: Object.values(hubspotTaskConfigs).map((x) => ({
|
|
20907
21197
|
key: x.key,
|
|
20908
21198
|
name: x.customization.displayName,
|
|
@@ -20911,12 +21201,12 @@ var config10 = [
|
|
|
20911
21201
|
}))
|
|
20912
21202
|
},
|
|
20913
21203
|
{
|
|
20914
|
-
name:
|
|
20915
|
-
displayName:
|
|
21204
|
+
name: import_developer_studio_api39.IntegrationNames.BigCommerce,
|
|
21205
|
+
displayName: import_developer_studio_api39.IntegrationDisplayNames.BigCommerce,
|
|
20916
21206
|
icon: /* @__PURE__ */ jsx4(
|
|
20917
21207
|
ProductIcon_default,
|
|
20918
21208
|
{
|
|
20919
|
-
product:
|
|
21209
|
+
product: import_developer_studio_api39.IntegrationNames.BigCommerce,
|
|
20920
21210
|
height: 5,
|
|
20921
21211
|
width: 5
|
|
20922
21212
|
}
|
|
@@ -20929,9 +21219,9 @@ var config10 = [
|
|
|
20929
21219
|
}))
|
|
20930
21220
|
},
|
|
20931
21221
|
{
|
|
20932
|
-
name:
|
|
20933
|
-
displayName:
|
|
20934
|
-
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product:
|
|
21222
|
+
name: import_developer_studio_api39.IntegrationNames.Shopify,
|
|
21223
|
+
displayName: import_developer_studio_api39.IntegrationDisplayNames.Shopify,
|
|
21224
|
+
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product: import_developer_studio_api39.IntegrationNames.Shopify, height: 5, width: 5 }),
|
|
20935
21225
|
values: Object.values(shopifyTaskConfigs).map((x) => ({
|
|
20936
21226
|
key: x.key,
|
|
20937
21227
|
name: x.customization.displayName,
|
|
@@ -20953,7 +21243,7 @@ var AddWorkflowTask = ({ basePath, onClose }) => {
|
|
|
20953
21243
|
} = useWorkflowContext();
|
|
20954
21244
|
const {
|
|
20955
21245
|
userData: { user }
|
|
20956
|
-
} = (0,
|
|
21246
|
+
} = (0, import_developer_studio_ui_react44.useRootContext)();
|
|
20957
21247
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
20958
21248
|
user == null ? void 0 : user.meta.email
|
|
20959
21249
|
);
|
|
@@ -21022,7 +21312,7 @@ var AddWorkflowTask = ({ basePath, onClose }) => {
|
|
|
21022
21312
|
width: 650px;
|
|
21023
21313
|
`,
|
|
21024
21314
|
heading: /* @__PURE__ */ jsx4(import_design_system_react_components71.ModalHeader, { title: "Add task" }),
|
|
21025
|
-
footer: /* @__PURE__ */ jsxs2(
|
|
21315
|
+
footer: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react44.Row, { gap: `var(${import_design_system_react_components71.SpacingToken.Spacing2})`, flexEnd: true, notPadded: true, children: [
|
|
21026
21316
|
/* @__PURE__ */ jsx4(import_design_system_react_components71.Button, { size: "medium", kind: "secondary", onClick: onClose, children: "Cancel" }),
|
|
21027
21317
|
/* @__PURE__ */ jsx4(
|
|
21028
21318
|
import_design_system_react_components71.Button,
|
|
@@ -21038,9 +21328,9 @@ var AddWorkflowTask = ({ basePath, onClose }) => {
|
|
|
21038
21328
|
)
|
|
21039
21329
|
] }),
|
|
21040
21330
|
onClose,
|
|
21041
|
-
children: /* @__PURE__ */ jsxs2(
|
|
21331
|
+
children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react44.Row, { notPadded: true, children: [
|
|
21042
21332
|
/* @__PURE__ */ jsxs2(
|
|
21043
|
-
|
|
21333
|
+
import_developer_studio_ui_react44.Column,
|
|
21044
21334
|
{
|
|
21045
21335
|
width: 2,
|
|
21046
21336
|
noWrap: true,
|
|
@@ -21070,7 +21360,7 @@ var AddWorkflowTask = ({ basePath, onClose }) => {
|
|
|
21070
21360
|
}
|
|
21071
21361
|
),
|
|
21072
21362
|
config10.map(({ name, displayName, icon: icon2, values }) => {
|
|
21073
|
-
const revertIconColor = getWorkflowEnv2("isHeadless") && (name === "openai" || name ===
|
|
21363
|
+
const revertIconColor = getWorkflowEnv2("isHeadless") && (name === "openai" || name === import_developer_studio_api39.IntegrationNames.BigCommerce);
|
|
21074
21364
|
if (search) {
|
|
21075
21365
|
if (values.some(
|
|
21076
21366
|
(el) => el.name.toLowerCase().includes(search.toLowerCase())
|
|
@@ -21079,7 +21369,7 @@ var AddWorkflowTask = ({ basePath, onClose }) => {
|
|
|
21079
21369
|
}
|
|
21080
21370
|
}
|
|
21081
21371
|
return /* @__PURE__ */ jsxs2(
|
|
21082
|
-
|
|
21372
|
+
import_developer_studio_ui_react44.Row,
|
|
21083
21373
|
{
|
|
21084
21374
|
center: true,
|
|
21085
21375
|
setRowPadding: `var(${import_design_system_react_components71.SpacingToken.Spacing2})`,
|
|
@@ -21126,7 +21416,7 @@ var AddWorkflowTask = ({ basePath, onClose }) => {
|
|
|
21126
21416
|
css: css`
|
|
21127
21417
|
text-decoration: none;
|
|
21128
21418
|
`,
|
|
21129
|
-
children: /* @__PURE__ */ jsx4(
|
|
21419
|
+
children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react44.Text, { size: "md", children: displayName })
|
|
21130
21420
|
}
|
|
21131
21421
|
)
|
|
21132
21422
|
]
|
|
@@ -21137,7 +21427,7 @@ var AddWorkflowTask = ({ basePath, onClose }) => {
|
|
|
21137
21427
|
}
|
|
21138
21428
|
),
|
|
21139
21429
|
/* @__PURE__ */ jsx4(
|
|
21140
|
-
|
|
21430
|
+
import_developer_studio_ui_react44.Column,
|
|
21141
21431
|
{
|
|
21142
21432
|
css: css`
|
|
21143
21433
|
height: 350px;
|
|
@@ -21154,7 +21444,7 @@ var AddWorkflowTask = ({ basePath, onClose }) => {
|
|
|
21154
21444
|
})).sort((a, b) => a.name.localeCompare(b.name)).filter(
|
|
21155
21445
|
(el) => el.name.toLowerCase().includes(search.toLowerCase())
|
|
21156
21446
|
);
|
|
21157
|
-
return /* @__PURE__ */ jsx4(
|
|
21447
|
+
return /* @__PURE__ */ jsx4(import_developer_studio_ui_react44.Row, { notPadded: true, gap: "4px", children: /* @__PURE__ */ jsx4(
|
|
21158
21448
|
Options_default,
|
|
21159
21449
|
{
|
|
21160
21450
|
options: options2,
|
|
@@ -21182,13 +21472,13 @@ var Add_default = AddWorkflowTask;
|
|
|
21182
21472
|
var import_react123 = require("react");
|
|
21183
21473
|
var import_react_router_dom19 = require("react-router-dom");
|
|
21184
21474
|
var import_design_system_react_components73 = require("@livechat/design-system-react-components");
|
|
21185
|
-
var
|
|
21186
|
-
var
|
|
21475
|
+
var import_developer_studio_api40 = require("@livechat/developer-studio-api");
|
|
21476
|
+
var import_developer_studio_ui_react46 = require("@livechat/developer-studio-ui-react");
|
|
21187
21477
|
|
|
21188
21478
|
// src/views/Flows/Definitions/Edit/Triggers/Options.tsx
|
|
21189
21479
|
var import_react121 = require("react");
|
|
21190
21480
|
var import_design_system_react_components72 = require("@livechat/design-system-react-components");
|
|
21191
|
-
var
|
|
21481
|
+
var import_developer_studio_ui_react45 = require("@livechat/developer-studio-ui-react");
|
|
21192
21482
|
var itemOptionCss2 = (active) => css`
|
|
21193
21483
|
display: flex;
|
|
21194
21484
|
align-items: center;
|
|
@@ -21209,7 +21499,7 @@ var itemOptionCss2 = (active) => css`
|
|
|
21209
21499
|
}
|
|
21210
21500
|
`;
|
|
21211
21501
|
var ItemOption2 = ({ option, onClick, active }) => {
|
|
21212
|
-
return /* @__PURE__ */ jsx4("div", { css: itemOptionCss2(active), onClick, children: /* @__PURE__ */ jsxs2(
|
|
21502
|
+
return /* @__PURE__ */ jsx4("div", { css: itemOptionCss2(active), onClick, children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react45.Column, { setColumnPadding: "0", width: 6, children: [
|
|
21213
21503
|
/* @__PURE__ */ jsx4(import_design_system_react_components72.Text, { noMargin: true, bold: true, children: option.name }),
|
|
21214
21504
|
/* @__PURE__ */ jsx4(
|
|
21215
21505
|
import_design_system_react_components72.Text,
|
|
@@ -21300,9 +21590,9 @@ var config11 = [
|
|
|
21300
21590
|
}))
|
|
21301
21591
|
},
|
|
21302
21592
|
{
|
|
21303
|
-
name:
|
|
21304
|
-
displayName:
|
|
21305
|
-
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product:
|
|
21593
|
+
name: import_developer_studio_api40.IntegrationNames.Mailchimp,
|
|
21594
|
+
displayName: import_developer_studio_api40.IntegrationDisplayNames.Mailchimp,
|
|
21595
|
+
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product: import_developer_studio_api40.IntegrationNames.Mailchimp, height: 5, width: 5 }),
|
|
21306
21596
|
values: Object.values(mailchimpTriggerConfigs).map((x) => ({
|
|
21307
21597
|
key: x.key,
|
|
21308
21598
|
name: x.customization.displayName,
|
|
@@ -21310,9 +21600,9 @@ var config11 = [
|
|
|
21310
21600
|
}))
|
|
21311
21601
|
},
|
|
21312
21602
|
{
|
|
21313
|
-
name:
|
|
21314
|
-
displayName:
|
|
21315
|
-
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product:
|
|
21603
|
+
name: import_developer_studio_api40.IntegrationNames.Shopify,
|
|
21604
|
+
displayName: import_developer_studio_api40.IntegrationDisplayNames.Shopify,
|
|
21605
|
+
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product: import_developer_studio_api40.IntegrationNames.Shopify, height: 5, width: 5 }),
|
|
21316
21606
|
values: Object.values(shopifyTriggerConfigs).map((x) => ({
|
|
21317
21607
|
key: x.key,
|
|
21318
21608
|
name: x.customization.displayName,
|
|
@@ -21320,9 +21610,9 @@ var config11 = [
|
|
|
21320
21610
|
}))
|
|
21321
21611
|
},
|
|
21322
21612
|
{
|
|
21323
|
-
name:
|
|
21324
|
-
displayName:
|
|
21325
|
-
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product:
|
|
21613
|
+
name: import_developer_studio_api40.IntegrationNames.HubSpot,
|
|
21614
|
+
displayName: import_developer_studio_api40.IntegrationDisplayNames.HubSpot,
|
|
21615
|
+
icon: /* @__PURE__ */ jsx4(ProductIcon_default, { product: import_developer_studio_api40.IntegrationNames.HubSpot, height: 5, width: 5 }),
|
|
21326
21616
|
values: Object.values(hubspotTriggerConfigs).map((x) => ({
|
|
21327
21617
|
key: x.key,
|
|
21328
21618
|
name: x.customization.displayName,
|
|
@@ -21330,12 +21620,12 @@ var config11 = [
|
|
|
21330
21620
|
}))
|
|
21331
21621
|
},
|
|
21332
21622
|
{
|
|
21333
|
-
name:
|
|
21334
|
-
displayName:
|
|
21623
|
+
name: import_developer_studio_api40.IntegrationNames.BigCommerce,
|
|
21624
|
+
displayName: import_developer_studio_api40.IntegrationDisplayNames.BigCommerce,
|
|
21335
21625
|
icon: /* @__PURE__ */ jsx4(
|
|
21336
21626
|
ProductIcon_default,
|
|
21337
21627
|
{
|
|
21338
|
-
product:
|
|
21628
|
+
product: import_developer_studio_api40.IntegrationNames.BigCommerce,
|
|
21339
21629
|
height: 5,
|
|
21340
21630
|
width: 5
|
|
21341
21631
|
}
|
|
@@ -21356,7 +21646,7 @@ var AddWorkflowTrigger = ({ basePath, onClose }) => {
|
|
|
21356
21646
|
const { addTrigger } = useWorkflowContext();
|
|
21357
21647
|
const {
|
|
21358
21648
|
userData: { user }
|
|
21359
|
-
} = (0,
|
|
21649
|
+
} = (0, import_developer_studio_ui_react46.useRootContext)();
|
|
21360
21650
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
21361
21651
|
user == null ? void 0 : user.meta.email
|
|
21362
21652
|
);
|
|
@@ -21388,7 +21678,7 @@ var AddWorkflowTrigger = ({ basePath, onClose }) => {
|
|
|
21388
21678
|
width: 650px;
|
|
21389
21679
|
`,
|
|
21390
21680
|
heading: /* @__PURE__ */ jsx4(import_design_system_react_components73.ModalHeader, { title: "Add trigger" }),
|
|
21391
|
-
footer: /* @__PURE__ */ jsxs2(
|
|
21681
|
+
footer: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react46.Row, { gap: `var(${import_design_system_react_components73.SpacingToken.Spacing2})`, flexEnd: true, notPadded: true, children: [
|
|
21392
21682
|
/* @__PURE__ */ jsx4(import_design_system_react_components73.Button, { size: "medium", kind: "secondary", onClick: onClose, children: "Cancel" }),
|
|
21393
21683
|
/* @__PURE__ */ jsx4(
|
|
21394
21684
|
import_design_system_react_components73.Button,
|
|
@@ -21404,9 +21694,9 @@ var AddWorkflowTrigger = ({ basePath, onClose }) => {
|
|
|
21404
21694
|
)
|
|
21405
21695
|
] }),
|
|
21406
21696
|
onClose,
|
|
21407
|
-
children: /* @__PURE__ */ jsxs2(
|
|
21697
|
+
children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react46.Row, { notPadded: true, children: [
|
|
21408
21698
|
/* @__PURE__ */ jsxs2(
|
|
21409
|
-
|
|
21699
|
+
import_developer_studio_ui_react46.Column,
|
|
21410
21700
|
{
|
|
21411
21701
|
width: 2,
|
|
21412
21702
|
noWrap: true,
|
|
@@ -21436,7 +21726,7 @@ var AddWorkflowTrigger = ({ basePath, onClose }) => {
|
|
|
21436
21726
|
}
|
|
21437
21727
|
),
|
|
21438
21728
|
config11.map(({ name, displayName, icon: icon2, values }) => {
|
|
21439
|
-
const revertIconColor = getWorkflowEnv2("isHeadless") && (name ===
|
|
21729
|
+
const revertIconColor = getWorkflowEnv2("isHeadless") && (name === import_developer_studio_api40.IntegrationNames.OpenAI || name === import_developer_studio_api40.IntegrationNames.BigCommerce);
|
|
21440
21730
|
if (search) {
|
|
21441
21731
|
if (values.some(
|
|
21442
21732
|
(el) => el.name.toLowerCase().includes(search.toLowerCase())
|
|
@@ -21445,7 +21735,7 @@ var AddWorkflowTrigger = ({ basePath, onClose }) => {
|
|
|
21445
21735
|
}
|
|
21446
21736
|
}
|
|
21447
21737
|
return /* @__PURE__ */ jsxs2(
|
|
21448
|
-
|
|
21738
|
+
import_developer_studio_ui_react46.Row,
|
|
21449
21739
|
{
|
|
21450
21740
|
setRowPadding: `var(${import_design_system_react_components73.SpacingToken.Spacing2})`,
|
|
21451
21741
|
center: true,
|
|
@@ -21492,7 +21782,7 @@ var AddWorkflowTrigger = ({ basePath, onClose }) => {
|
|
|
21492
21782
|
css: css`
|
|
21493
21783
|
text-decoration: none;
|
|
21494
21784
|
`,
|
|
21495
|
-
children: /* @__PURE__ */ jsx4(
|
|
21785
|
+
children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react46.Text, { size: "md", children: displayName })
|
|
21496
21786
|
}
|
|
21497
21787
|
)
|
|
21498
21788
|
]
|
|
@@ -21503,7 +21793,7 @@ var AddWorkflowTrigger = ({ basePath, onClose }) => {
|
|
|
21503
21793
|
}
|
|
21504
21794
|
),
|
|
21505
21795
|
/* @__PURE__ */ jsx4(
|
|
21506
|
-
|
|
21796
|
+
import_developer_studio_ui_react46.Column,
|
|
21507
21797
|
{
|
|
21508
21798
|
css: css`
|
|
21509
21799
|
height: 350px;
|
|
@@ -21521,7 +21811,7 @@ var AddWorkflowTrigger = ({ basePath, onClose }) => {
|
|
|
21521
21811
|
})).sort((a, b) => a.name.localeCompare(b.name)).filter(
|
|
21522
21812
|
(el) => el.name.toLowerCase().includes(search.toLowerCase())
|
|
21523
21813
|
);
|
|
21524
|
-
return /* @__PURE__ */ jsx4(
|
|
21814
|
+
return /* @__PURE__ */ jsx4(import_developer_studio_ui_react46.Row, { notPadded: true, gap: "4px", children: /* @__PURE__ */ jsx4(
|
|
21525
21815
|
Options_default2,
|
|
21526
21816
|
{
|
|
21527
21817
|
options: options2,
|
|
@@ -21550,7 +21840,7 @@ var import_react125 = require("react");
|
|
|
21550
21840
|
var import_react_router_dom20 = require("react-router-dom");
|
|
21551
21841
|
var import_design_system_icons37 = require("@livechat/design-system-icons");
|
|
21552
21842
|
var import_design_system_react_components74 = require("@livechat/design-system-react-components");
|
|
21553
|
-
var
|
|
21843
|
+
var import_developer_studio_ui_react47 = require("@livechat/developer-studio-ui-react");
|
|
21554
21844
|
var WorkflowBuilderNavbar = () => {
|
|
21555
21845
|
var _a, _b, _c, _d, _e;
|
|
21556
21846
|
const navigate = (0, import_react_router_dom20.useNavigate)();
|
|
@@ -21571,14 +21861,14 @@ var WorkflowBuilderNavbar = () => {
|
|
|
21571
21861
|
const [workflowName, setWorkflowName] = (0, import_react125.useState)(workflow.name);
|
|
21572
21862
|
const {
|
|
21573
21863
|
userData: { user }
|
|
21574
|
-
} = (0,
|
|
21864
|
+
} = (0, import_developer_studio_ui_react47.useRootContext)();
|
|
21575
21865
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
21576
21866
|
user == null ? void 0 : user.meta.email
|
|
21577
21867
|
);
|
|
21578
21868
|
(0, import_react125.useEffect)(() => {
|
|
21579
21869
|
setWorkflowName(workflow.name);
|
|
21580
21870
|
}, [workflow.name]);
|
|
21581
|
-
(0,
|
|
21871
|
+
(0, import_developer_studio_ui_react47.useOnClickOutside)(inputRef, () => {
|
|
21582
21872
|
setIsNameChanging(false);
|
|
21583
21873
|
});
|
|
21584
21874
|
const menuOptions = [
|
|
@@ -21625,7 +21915,7 @@ var WorkflowBuilderNavbar = () => {
|
|
|
21625
21915
|
}));
|
|
21626
21916
|
};
|
|
21627
21917
|
return /* @__PURE__ */ jsxs2(
|
|
21628
|
-
|
|
21918
|
+
import_developer_studio_ui_react47.Row,
|
|
21629
21919
|
{
|
|
21630
21920
|
center: true,
|
|
21631
21921
|
noMaxWidth: true,
|
|
@@ -21652,7 +21942,7 @@ var WorkflowBuilderNavbar = () => {
|
|
|
21652
21942
|
onClick: () => {
|
|
21653
21943
|
navigate("/workflow/list");
|
|
21654
21944
|
},
|
|
21655
|
-
children: /* @__PURE__ */ jsxs2(
|
|
21945
|
+
children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react47.Row, { center: true, notPadded: true, noWrap: true, children: [
|
|
21656
21946
|
/* @__PURE__ */ jsx4(
|
|
21657
21947
|
import_design_system_react_components74.Icon,
|
|
21658
21948
|
{
|
|
@@ -21668,9 +21958,9 @@ var WorkflowBuilderNavbar = () => {
|
|
|
21668
21958
|
] })
|
|
21669
21959
|
}
|
|
21670
21960
|
),
|
|
21671
|
-
/* @__PURE__ */ jsxs2(
|
|
21672
|
-
/* @__PURE__ */ jsx4(
|
|
21673
|
-
/* @__PURE__ */ jsx4(
|
|
21961
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react47.Row, { center: true, noMaxWidth: true, setRowPadding: "4px 16px", spaceBetween: true, children: [
|
|
21962
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react47.Column, {}),
|
|
21963
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react47.Column, { center: true, children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react47.Row, { center: true, verticalCenter: true, noWrap: true, children: [
|
|
21674
21964
|
/* @__PURE__ */ jsx4(
|
|
21675
21965
|
import_design_system_react_components74.FormField,
|
|
21676
21966
|
{
|
|
@@ -21742,8 +22032,8 @@ var WorkflowBuilderNavbar = () => {
|
|
|
21742
22032
|
}
|
|
21743
22033
|
)
|
|
21744
22034
|
] }) }),
|
|
21745
|
-
/* @__PURE__ */ jsx4(
|
|
21746
|
-
|
|
22035
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react47.Column, { setColumnPadding: "0", children: /* @__PURE__ */ jsxs2(
|
|
22036
|
+
import_developer_studio_ui_react47.Row,
|
|
21747
22037
|
{
|
|
21748
22038
|
center: true,
|
|
21749
22039
|
notPadded: true,
|
|
@@ -21857,7 +22147,7 @@ var EditWorkflow = () => {
|
|
|
21857
22147
|
return /* @__PURE__ */ jsx4(import_react127.Fragment, {});
|
|
21858
22148
|
}
|
|
21859
22149
|
if (id !== "new" && workflowQuery.isLoading) {
|
|
21860
|
-
return /* @__PURE__ */ jsx4(
|
|
22150
|
+
return /* @__PURE__ */ jsx4(import_developer_studio_ui_react48.Loader, { stretch: true });
|
|
21861
22151
|
}
|
|
21862
22152
|
if (id !== "new" && !workflowQuery.isSuccess) {
|
|
21863
22153
|
throw new Error("Couldn't load workflow");
|
|
@@ -21978,7 +22268,7 @@ var import_react_router_dom23 = require("react-router-dom");
|
|
|
21978
22268
|
|
|
21979
22269
|
// src/views/Flows/Templates/api.mocks.tsx
|
|
21980
22270
|
var import_design_system_icons38 = require("@livechat/design-system-icons");
|
|
21981
|
-
var
|
|
22271
|
+
var import_developer_studio_api41 = require("@livechat/developer-studio-api");
|
|
21982
22272
|
var config12 = getWorkflowsConfig2();
|
|
21983
22273
|
var flowTemplates = [
|
|
21984
22274
|
{
|
|
@@ -22010,9 +22300,9 @@ var flowTemplates = [
|
|
|
22010
22300
|
trigger: {
|
|
22011
22301
|
type: "webhook",
|
|
22012
22302
|
webhook: {
|
|
22013
|
-
source: `${
|
|
22303
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
22014
22304
|
event: {
|
|
22015
|
-
name:
|
|
22305
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatEnded
|
|
22016
22306
|
},
|
|
22017
22307
|
headers: {
|
|
22018
22308
|
"x-adapter-text-token": [
|
|
@@ -22231,9 +22521,9 @@ var flowTemplates = [
|
|
|
22231
22521
|
trigger: {
|
|
22232
22522
|
type: "webhook",
|
|
22233
22523
|
webhook: {
|
|
22234
|
-
source: `${
|
|
22524
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
22235
22525
|
event: {
|
|
22236
|
-
name:
|
|
22526
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatMessage,
|
|
22237
22527
|
filter: "competitor"
|
|
22238
22528
|
},
|
|
22239
22529
|
headers: {
|
|
@@ -22379,9 +22669,9 @@ var flowTemplates = [
|
|
|
22379
22669
|
trigger: {
|
|
22380
22670
|
type: "webhook",
|
|
22381
22671
|
webhook: {
|
|
22382
|
-
source: `${
|
|
22672
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
22383
22673
|
event: {
|
|
22384
|
-
name:
|
|
22674
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatEnded
|
|
22385
22675
|
},
|
|
22386
22676
|
headers: {
|
|
22387
22677
|
"x-adapter-text-token": [
|
|
@@ -22531,7 +22821,7 @@ var flowTemplates = [
|
|
|
22531
22821
|
webhook: {
|
|
22532
22822
|
source: "text-livechat",
|
|
22533
22823
|
event: {
|
|
22534
|
-
name:
|
|
22824
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatEnded
|
|
22535
22825
|
},
|
|
22536
22826
|
headers: {
|
|
22537
22827
|
"x-adapter-text-token": [
|
|
@@ -22673,9 +22963,9 @@ var flowTemplates = [
|
|
|
22673
22963
|
trigger: {
|
|
22674
22964
|
type: "webhook",
|
|
22675
22965
|
webhook: {
|
|
22676
|
-
source: `${
|
|
22966
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
22677
22967
|
event: {
|
|
22678
|
-
name:
|
|
22968
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatEnded
|
|
22679
22969
|
},
|
|
22680
22970
|
headers: {
|
|
22681
22971
|
"x-adapter-text-token": [
|
|
@@ -22746,9 +23036,9 @@ var flowTemplates = [
|
|
|
22746
23036
|
trigger: {
|
|
22747
23037
|
type: "webhook",
|
|
22748
23038
|
webhook: {
|
|
22749
|
-
source: `${
|
|
23039
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
22750
23040
|
event: {
|
|
22751
|
-
name:
|
|
23041
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatStarted
|
|
22752
23042
|
},
|
|
22753
23043
|
headers: {
|
|
22754
23044
|
"x-adapter-text-token": [
|
|
@@ -22865,9 +23155,9 @@ var flowTemplates = [
|
|
|
22865
23155
|
trigger: {
|
|
22866
23156
|
type: "webhook",
|
|
22867
23157
|
webhook: {
|
|
22868
|
-
source: `${
|
|
23158
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
22869
23159
|
event: {
|
|
22870
|
-
name:
|
|
23160
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatRated,
|
|
22871
23161
|
rating: "bad"
|
|
22872
23162
|
},
|
|
22873
23163
|
headers: {
|
|
@@ -22983,9 +23273,9 @@ var flowTemplates = [
|
|
|
22983
23273
|
trigger: {
|
|
22984
23274
|
type: "webhook",
|
|
22985
23275
|
webhook: {
|
|
22986
|
-
source: `${
|
|
23276
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
22987
23277
|
event: {
|
|
22988
|
-
name:
|
|
23278
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatStarted
|
|
22989
23279
|
},
|
|
22990
23280
|
headers: {
|
|
22991
23281
|
"x-cred-access-token": [
|
|
@@ -23076,9 +23366,9 @@ var flowTemplates = [
|
|
|
23076
23366
|
trigger: {
|
|
23077
23367
|
type: "webhook",
|
|
23078
23368
|
webhook: {
|
|
23079
|
-
source: `${
|
|
23369
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
23080
23370
|
event: {
|
|
23081
|
-
name:
|
|
23371
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatEnded
|
|
23082
23372
|
},
|
|
23083
23373
|
headers: {
|
|
23084
23374
|
"x-cred-access-token": [
|
|
@@ -23174,9 +23464,9 @@ var flowTemplates = [
|
|
|
23174
23464
|
trigger: {
|
|
23175
23465
|
type: "webhook",
|
|
23176
23466
|
webhook: {
|
|
23177
|
-
source: `${
|
|
23467
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
23178
23468
|
event: {
|
|
23179
|
-
name:
|
|
23469
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatStarted
|
|
23180
23470
|
},
|
|
23181
23471
|
headers: {
|
|
23182
23472
|
"x-cred-access-token": [
|
|
@@ -23292,9 +23582,9 @@ var flowTemplates = [
|
|
|
23292
23582
|
trigger: {
|
|
23293
23583
|
type: "webhook",
|
|
23294
23584
|
webhook: {
|
|
23295
|
-
source: `${
|
|
23585
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
23296
23586
|
event: {
|
|
23297
|
-
name:
|
|
23587
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatEnded
|
|
23298
23588
|
},
|
|
23299
23589
|
headers: {
|
|
23300
23590
|
"x-cred-access-token": [
|
|
@@ -23390,9 +23680,9 @@ var flowTemplates = [
|
|
|
23390
23680
|
trigger: {
|
|
23391
23681
|
type: "webhook",
|
|
23392
23682
|
webhook: {
|
|
23393
|
-
source: `${
|
|
23683
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
23394
23684
|
event: {
|
|
23395
|
-
name:
|
|
23685
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatTagged,
|
|
23396
23686
|
tag: void 0,
|
|
23397
23687
|
exact: false
|
|
23398
23688
|
},
|
|
@@ -23489,9 +23779,9 @@ var flowTemplates = [
|
|
|
23489
23779
|
trigger: {
|
|
23490
23780
|
type: "webhook",
|
|
23491
23781
|
webhook: {
|
|
23492
|
-
source: `${
|
|
23782
|
+
source: `${import_developer_studio_api41.IntegrationNames.Text}-${PRODUCT_TYPE.LC}`,
|
|
23493
23783
|
event: {
|
|
23494
|
-
name:
|
|
23784
|
+
name: import_developer_studio_api41.TextLivechatEventNames.ChatEnded
|
|
23495
23785
|
},
|
|
23496
23786
|
headers: {
|
|
23497
23787
|
"x-cred-access-token": [
|
|
@@ -23511,12 +23801,12 @@ var import_react128 = require("react");
|
|
|
23511
23801
|
var import_react_router_dom22 = require("react-router-dom");
|
|
23512
23802
|
var import_design_system_icons40 = require("@livechat/design-system-icons");
|
|
23513
23803
|
var import_design_system_react_components76 = require("@livechat/design-system-react-components");
|
|
23514
|
-
var
|
|
23804
|
+
var import_developer_studio_ui_react50 = require("@livechat/developer-studio-ui-react");
|
|
23515
23805
|
|
|
23516
23806
|
// src/views/Flows/Templates/Common/CategoryIcon.tsx
|
|
23517
23807
|
var import_design_system_icons39 = require("@livechat/design-system-icons");
|
|
23518
23808
|
var import_design_system_react_components75 = require("@livechat/design-system-react-components");
|
|
23519
|
-
var
|
|
23809
|
+
var import_developer_studio_ui_react49 = require("@livechat/developer-studio-ui-react");
|
|
23520
23810
|
var WorkflowTemplateCategoryIcon = (category) => {
|
|
23521
23811
|
const icons = {
|
|
23522
23812
|
["Notifications & alerts" /* notifications_and_alerts */]: import_design_system_icons39.Notifications,
|
|
@@ -23525,7 +23815,7 @@ var WorkflowTemplateCategoryIcon = (category) => {
|
|
|
23525
23815
|
["Chat management" /* chat_management */]: import_design_system_icons39.ChatDots,
|
|
23526
23816
|
["Customer experience" /* customer_experience */]: import_design_system_icons39.Smiles
|
|
23527
23817
|
};
|
|
23528
|
-
return /* @__PURE__ */ jsxs2(
|
|
23818
|
+
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react49.Row, { noWrap: true, notPadded: true, gap: `var(${import_design_system_react_components75.SpacingToken.Spacing1})`, children: [
|
|
23529
23819
|
/* @__PURE__ */ jsx4(
|
|
23530
23820
|
import_design_system_react_components75.Icon,
|
|
23531
23821
|
{
|
|
@@ -23609,7 +23899,7 @@ var WorkflowTemplatePreviewModal = ({
|
|
|
23609
23899
|
} = useWorkflowContext();
|
|
23610
23900
|
const {
|
|
23611
23901
|
userData: { user }
|
|
23612
|
-
} = (0,
|
|
23902
|
+
} = (0, import_developer_studio_ui_react50.useRootContext)();
|
|
23613
23903
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
23614
23904
|
user == null ? void 0 : user.meta.email
|
|
23615
23905
|
);
|
|
@@ -23685,9 +23975,9 @@ var WorkflowTemplatePreviewModal = ({
|
|
|
23685
23975
|
)
|
|
23686
23976
|
] }),
|
|
23687
23977
|
onClose: handleClose,
|
|
23688
|
-
children: /* @__PURE__ */ jsxs2(
|
|
23978
|
+
children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react50.Row, { notPadded: true, noWrap: true, children: [
|
|
23689
23979
|
/* @__PURE__ */ jsxs2(
|
|
23690
|
-
|
|
23980
|
+
import_developer_studio_ui_react50.Column,
|
|
23691
23981
|
{
|
|
23692
23982
|
notPadded: true,
|
|
23693
23983
|
noFlexBasis: true,
|
|
@@ -23731,7 +24021,7 @@ var WorkflowTemplatePreviewModal = ({
|
|
|
23731
24021
|
children: "Products used:"
|
|
23732
24022
|
}
|
|
23733
24023
|
),
|
|
23734
|
-
/* @__PURE__ */ jsx4(
|
|
24024
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react50.Row, { notPadded: true, gap: `var(${import_design_system_react_components76.SpacingToken.Spacing1})`, children: template.products && renderProductTags(template.products) })
|
|
23735
24025
|
] })
|
|
23736
24026
|
]
|
|
23737
24027
|
}
|
|
@@ -23795,13 +24085,13 @@ var import_design_system_react_components82 = require("@livechat/design-system-r
|
|
|
23795
24085
|
var import_react134 = require("react");
|
|
23796
24086
|
var import_design_system_icons43 = require("@livechat/design-system-icons");
|
|
23797
24087
|
var import_design_system_react_components81 = require("@livechat/design-system-react-components");
|
|
23798
|
-
var
|
|
24088
|
+
var import_developer_studio_ui_react55 = require("@livechat/developer-studio-ui-react");
|
|
23799
24089
|
|
|
23800
24090
|
// src/views/Flows/Templates/Common/Modals/List/Filters/Category.tsx
|
|
23801
24091
|
var import_react131 = require("react");
|
|
23802
24092
|
var import_design_system_icons41 = require("@livechat/design-system-icons");
|
|
23803
24093
|
var import_design_system_react_components77 = require("@livechat/design-system-react-components");
|
|
23804
|
-
var
|
|
24094
|
+
var import_developer_studio_ui_react51 = require("@livechat/developer-studio-ui-react");
|
|
23805
24095
|
var WorkflowTemplatesCategoryFilter = ({
|
|
23806
24096
|
handleStatus,
|
|
23807
24097
|
status
|
|
@@ -23810,7 +24100,7 @@ var WorkflowTemplatesCategoryFilter = ({
|
|
|
23810
24100
|
const getItem = (0, import_react131.useCallback)(
|
|
23811
24101
|
(key, category, icon2) => ({
|
|
23812
24102
|
key,
|
|
23813
|
-
element: /* @__PURE__ */ jsxs2(
|
|
24103
|
+
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react51.Row, { notPadded: true, gap: `var(${import_design_system_react_components77.SpacingToken.Spacing1});`, children: [
|
|
23814
24104
|
icon2 ? /* @__PURE__ */ jsx4(import_design_system_react_components77.Icon, { source: icon2 }) : void 0,
|
|
23815
24105
|
category
|
|
23816
24106
|
] }),
|
|
@@ -23864,7 +24154,7 @@ var Category_default = WorkflowTemplatesCategoryFilter;
|
|
|
23864
24154
|
var import_react132 = require("react");
|
|
23865
24155
|
var import_design_system_icons42 = require("@livechat/design-system-icons");
|
|
23866
24156
|
var import_design_system_react_components78 = require("@livechat/design-system-react-components");
|
|
23867
|
-
var
|
|
24157
|
+
var import_developer_studio_ui_react52 = require("@livechat/developer-studio-ui-react");
|
|
23868
24158
|
var WorkflowTemplatesProductFilter = ({
|
|
23869
24159
|
handleStatus,
|
|
23870
24160
|
status
|
|
@@ -23873,7 +24163,7 @@ var WorkflowTemplatesProductFilter = ({
|
|
|
23873
24163
|
const getItem = (0, import_react132.useCallback)(
|
|
23874
24164
|
(key, product, icon2) => ({
|
|
23875
24165
|
key,
|
|
23876
|
-
element: /* @__PURE__ */ jsxs2(
|
|
24166
|
+
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react52.Row, { notPadded: true, gap: `var(${import_design_system_react_components78.SpacingToken.Spacing1});`, children: [
|
|
23877
24167
|
icon2 ? /* @__PURE__ */ jsx4(import_design_system_react_components78.Icon, { source: icon2 }) : void 0,
|
|
23878
24168
|
product
|
|
23879
24169
|
] }),
|
|
@@ -23924,7 +24214,7 @@ var Product_default = WorkflowTemplatesProductFilter;
|
|
|
23924
24214
|
// src/views/Flows/Definitions/List/Home/Cards/Scratch.tsx
|
|
23925
24215
|
var import_react_router_dom24 = require("react-router-dom");
|
|
23926
24216
|
var import_design_system_react_components79 = require("@livechat/design-system-react-components");
|
|
23927
|
-
var
|
|
24217
|
+
var import_developer_studio_ui_react53 = require("@livechat/developer-studio-ui-react");
|
|
23928
24218
|
var WorkflowScratchCard = ({
|
|
23929
24219
|
title,
|
|
23930
24220
|
icon: icon2,
|
|
@@ -23933,7 +24223,7 @@ var WorkflowScratchCard = ({
|
|
|
23933
24223
|
const navigate = (0, import_react_router_dom24.useNavigate)();
|
|
23934
24224
|
const {
|
|
23935
24225
|
userData: { user }
|
|
23936
|
-
} = (0,
|
|
24226
|
+
} = (0, import_developer_studio_ui_react53.useRootContext)();
|
|
23937
24227
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
23938
24228
|
user == null ? void 0 : user.meta.email
|
|
23939
24229
|
);
|
|
@@ -23943,10 +24233,10 @@ var WorkflowScratchCard = ({
|
|
|
23943
24233
|
);
|
|
23944
24234
|
navigate("/workflow/new", { state: { openOne } });
|
|
23945
24235
|
};
|
|
23946
|
-
return /* @__PURE__ */ jsxs2(
|
|
23947
|
-
/* @__PURE__ */ jsxs2(
|
|
24236
|
+
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react53.Card, { light: true, hover: true, rounded: true, width: "100%", onClick: handleClick, children: [
|
|
24237
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react53.Row, { notPadded: true, spaceBetween: true, noWrap: true, children: [
|
|
23948
24238
|
/* @__PURE__ */ jsx4(import_design_system_react_components79.Icon, { source: icon2, kind: "primary", size: "xlarge" }),
|
|
23949
|
-
openOne && /* @__PURE__ */ jsx4(
|
|
24239
|
+
openOne && /* @__PURE__ */ jsx4(import_developer_studio_ui_react53.BetaTag, { darkTag: getWorkflowEnv2("isHeadless"), children: "Beta" })
|
|
23950
24240
|
] }),
|
|
23951
24241
|
/* @__PURE__ */ jsx4(
|
|
23952
24242
|
import_design_system_react_components79.Heading,
|
|
@@ -23966,7 +24256,7 @@ var Scratch_default = WorkflowScratchCard;
|
|
|
23966
24256
|
// src/views/Flows/Definitions/List/Home/Cards/Template.tsx
|
|
23967
24257
|
var import_react_router_dom25 = require("react-router-dom");
|
|
23968
24258
|
var import_design_system_react_components80 = require("@livechat/design-system-react-components");
|
|
23969
|
-
var
|
|
24259
|
+
var import_developer_studio_ui_react54 = require("@livechat/developer-studio-ui-react");
|
|
23970
24260
|
var IconWrapper2 = newStyled.div`
|
|
23971
24261
|
display: flex;
|
|
23972
24262
|
align-items: center;
|
|
@@ -23984,7 +24274,7 @@ var WorkflowTemplateCard = ({
|
|
|
23984
24274
|
}) => {
|
|
23985
24275
|
const navigate = (0, import_react_router_dom25.useNavigate)();
|
|
23986
24276
|
return /* @__PURE__ */ jsx4(
|
|
23987
|
-
|
|
24277
|
+
import_developer_studio_ui_react54.Card,
|
|
23988
24278
|
{
|
|
23989
24279
|
border: true,
|
|
23990
24280
|
noBackground: true,
|
|
@@ -23996,7 +24286,7 @@ var WorkflowTemplateCard = ({
|
|
|
23996
24286
|
navigate(`preview/${id}`);
|
|
23997
24287
|
},
|
|
23998
24288
|
children: /* @__PURE__ */ jsxs2(
|
|
23999
|
-
|
|
24289
|
+
import_developer_studio_ui_react54.Column,
|
|
24000
24290
|
{
|
|
24001
24291
|
notPadded: true,
|
|
24002
24292
|
noFlexBasis: true,
|
|
@@ -24005,11 +24295,11 @@ var WorkflowTemplateCard = ({
|
|
|
24005
24295
|
inheritHeight: true,
|
|
24006
24296
|
gap: `var(${import_design_system_react_components80.SpacingToken.Spacing4})`,
|
|
24007
24297
|
children: [
|
|
24008
|
-
/* @__PURE__ */ jsxs2(
|
|
24298
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react54.Column, { notPadded: true, noFlexBasis: true, gap: `var(${import_design_system_react_components80.SpacingToken.Spacing4})`, children: [
|
|
24009
24299
|
CategoryIcon_default(category),
|
|
24010
24300
|
/* @__PURE__ */ jsx4(import_design_system_react_components80.Heading, { as: "div", size: "xs", children: name })
|
|
24011
24301
|
] }),
|
|
24012
|
-
/* @__PURE__ */ jsx4(
|
|
24302
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react54.Row, { noWrap: true, notPadded: true, gap: `var(${import_design_system_react_components80.SpacingToken.Spacing1})`, children: icons.map((icon2, i) => /* @__PURE__ */ jsx4(IconWrapper2, { children: /* @__PURE__ */ jsx4(import_design_system_react_components80.Icon, { source: icon2, kind: "primary", size: "medium" }) }, i)) })
|
|
24013
24303
|
]
|
|
24014
24304
|
}
|
|
24015
24305
|
)
|
|
@@ -24040,8 +24330,8 @@ var WorkflowsHome = ({ isOnModal, basePath }) => {
|
|
|
24040
24330
|
}
|
|
24041
24331
|
return true;
|
|
24042
24332
|
});
|
|
24043
|
-
return /* @__PURE__ */ jsx4(
|
|
24044
|
-
|
|
24333
|
+
return /* @__PURE__ */ jsx4(import_developer_studio_ui_react55.Column, { width: 12, notPadded: true, children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react55.Row, { verticalCenter: true, notPadded: true, children: /* @__PURE__ */ jsxs2(
|
|
24334
|
+
import_developer_studio_ui_react55.Column,
|
|
24045
24335
|
{
|
|
24046
24336
|
width: 9,
|
|
24047
24337
|
gap: `var(${import_design_system_react_components81.SpacingToken.Spacing3})`,
|
|
@@ -24049,14 +24339,14 @@ var WorkflowsHome = ({ isOnModal, basePath }) => {
|
|
|
24049
24339
|
notPadded: true,
|
|
24050
24340
|
children: [
|
|
24051
24341
|
/* @__PURE__ */ jsx4(
|
|
24052
|
-
|
|
24342
|
+
import_developer_studio_ui_react55.Intro,
|
|
24053
24343
|
{
|
|
24054
24344
|
header: "Start from scratch",
|
|
24055
24345
|
headerSize: isOnModal ? "xs" : "s"
|
|
24056
24346
|
}
|
|
24057
24347
|
),
|
|
24058
24348
|
/* @__PURE__ */ jsxs2(
|
|
24059
|
-
|
|
24349
|
+
import_developer_studio_ui_react55.Row,
|
|
24060
24350
|
{
|
|
24061
24351
|
bottomMargin: true,
|
|
24062
24352
|
lowMargin: true,
|
|
@@ -24084,13 +24374,13 @@ var WorkflowsHome = ({ isOnModal, basePath }) => {
|
|
|
24084
24374
|
}
|
|
24085
24375
|
),
|
|
24086
24376
|
/* @__PURE__ */ jsx4(
|
|
24087
|
-
|
|
24377
|
+
import_developer_studio_ui_react55.Intro,
|
|
24088
24378
|
{
|
|
24089
24379
|
header: "Start with a template",
|
|
24090
24380
|
headerSize: isOnModal ? "xs" : "s"
|
|
24091
24381
|
}
|
|
24092
24382
|
),
|
|
24093
|
-
/* @__PURE__ */ jsxs2(
|
|
24383
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react55.Row, { notPadded: true, gap: `var(${import_design_system_react_components81.SpacingToken.Spacing2})`, children: [
|
|
24094
24384
|
/* @__PURE__ */ jsx4(
|
|
24095
24385
|
Product_default,
|
|
24096
24386
|
{
|
|
@@ -24172,19 +24462,19 @@ var Create_default = WorkflowCreate;
|
|
|
24172
24462
|
var import_react142 = require("react");
|
|
24173
24463
|
var import_react_router_dom29 = require("react-router-dom");
|
|
24174
24464
|
var import_design_system_react_components87 = require("@livechat/design-system-react-components");
|
|
24175
|
-
var
|
|
24176
|
-
var
|
|
24465
|
+
var import_developer_studio_api43 = require("@livechat/developer-studio-api");
|
|
24466
|
+
var import_developer_studio_ui_react58 = require("@livechat/developer-studio-ui-react");
|
|
24177
24467
|
|
|
24178
24468
|
// src/views/Flows/Definitions/List/Grid/Grid.tsx
|
|
24179
24469
|
var import_react140 = require("react");
|
|
24180
24470
|
var import_design_system_react_components86 = require("@livechat/design-system-react-components");
|
|
24181
|
-
var
|
|
24471
|
+
var import_developer_studio_ui_react57 = require("@livechat/developer-studio-ui-react");
|
|
24182
24472
|
|
|
24183
24473
|
// src/views/Flows/Definitions/List/Grid/Filters/StatusFilter.tsx
|
|
24184
24474
|
var import_react138 = require("react");
|
|
24185
24475
|
var import_design_system_icons44 = require("@livechat/design-system-icons");
|
|
24186
24476
|
var import_design_system_react_components83 = require("@livechat/design-system-react-components");
|
|
24187
|
-
var
|
|
24477
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
24188
24478
|
var WorkflowStatusFilter = ({
|
|
24189
24479
|
handleStatus,
|
|
24190
24480
|
status
|
|
@@ -24216,20 +24506,20 @@ var WorkflowStatusFilter = ({
|
|
|
24216
24506
|
}
|
|
24217
24507
|
}
|
|
24218
24508
|
];
|
|
24219
|
-
return /* @__PURE__ */ (0,
|
|
24509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
24220
24510
|
import_design_system_react_components83.ActionMenu,
|
|
24221
24511
|
{
|
|
24222
24512
|
options: items,
|
|
24223
24513
|
placement: "bottom",
|
|
24224
24514
|
visible: isVisible,
|
|
24225
|
-
triggerRenderer: /* @__PURE__ */ (0,
|
|
24515
|
+
triggerRenderer: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
24226
24516
|
import_design_system_react_components83.Button,
|
|
24227
24517
|
{
|
|
24228
24518
|
kind: "secondary",
|
|
24229
24519
|
onClick: () => {
|
|
24230
24520
|
setIsVisible(!isVisible);
|
|
24231
24521
|
},
|
|
24232
|
-
icon: /* @__PURE__ */ (0,
|
|
24522
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_design_system_react_components83.Icon, { source: import_design_system_icons44.ToggleLeft }),
|
|
24233
24523
|
children: [
|
|
24234
24524
|
"Status: ",
|
|
24235
24525
|
status
|
|
@@ -24249,17 +24539,17 @@ var import_react_router_dom28 = require("react-router-dom");
|
|
|
24249
24539
|
var import_design_system_icons45 = require("@livechat/design-system-icons");
|
|
24250
24540
|
var import_design_system_react_components84 = require("@livechat/design-system-react-components");
|
|
24251
24541
|
var import_design_system_react_components85 = require("@livechat/design-system-react-components");
|
|
24252
|
-
var
|
|
24253
|
-
var
|
|
24542
|
+
var import_developer_studio_api42 = require("@livechat/developer-studio-api");
|
|
24543
|
+
var import_developer_studio_ui_react56 = require("@livechat/developer-studio-ui-react");
|
|
24254
24544
|
var WorkflowsTable = ({ workflowsQuery, state }) => {
|
|
24255
24545
|
var _a, _b, _c, _d, _e;
|
|
24256
24546
|
const navigate = (0, import_react_router_dom28.useNavigate)();
|
|
24257
|
-
const notifications = (0,
|
|
24547
|
+
const notifications = (0, import_developer_studio_ui_react56.useNotifications)();
|
|
24258
24548
|
const deleteAction = useDeleteWorkflow();
|
|
24259
24549
|
const activateWorkflowAction = useActivateWorkflow();
|
|
24260
24550
|
const {
|
|
24261
24551
|
userData: { user }
|
|
24262
|
-
} = (0,
|
|
24552
|
+
} = (0, import_developer_studio_ui_react56.useRootContext)();
|
|
24263
24553
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
24264
24554
|
user == null ? void 0 : user.meta.email
|
|
24265
24555
|
);
|
|
@@ -24275,7 +24565,7 @@ var WorkflowsTable = ({ workflowsQuery, state }) => {
|
|
|
24275
24565
|
return workflow.name.toLowerCase().includes((_c2 = (_b2 = (_a2 = state.params) == null ? void 0 : _a2.name) == null ? void 0 : _b2.value) != null ? _c2 : "");
|
|
24276
24566
|
}
|
|
24277
24567
|
);
|
|
24278
|
-
return /* @__PURE__ */ jsxs2(
|
|
24568
|
+
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react56.Table, { loading: workflowsQuery.isLoading, flowTable: true, children: [
|
|
24279
24569
|
/* @__PURE__ */ jsx4("thead", { children: /* @__PURE__ */ jsxs2("tr", { children: [
|
|
24280
24570
|
/* @__PURE__ */ jsx4("th", { children: "Name" }),
|
|
24281
24571
|
/* @__PURE__ */ jsx4("th", { children: "Tasks" }),
|
|
@@ -24302,7 +24592,7 @@ var WorkflowsTable = ({ workflowsQuery, state }) => {
|
|
|
24302
24592
|
}
|
|
24303
24593
|
`,
|
|
24304
24594
|
children: [
|
|
24305
|
-
/* @__PURE__ */ jsx4("td", { width: "45%", children: /* @__PURE__ */ jsxs2(
|
|
24595
|
+
/* @__PURE__ */ jsx4("td", { width: "45%", children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react56.Row, { notPadded: true, gap: `var(${import_design_system_react_components84.SpacingToken.Spacing2})`, children: [
|
|
24306
24596
|
/* @__PURE__ */ jsx4("span", { children: workflow.name }),
|
|
24307
24597
|
workflow.related_workflow_id && /* @__PURE__ */ jsx4(
|
|
24308
24598
|
import_design_system_react_components84.Tag,
|
|
@@ -24316,8 +24606,8 @@ var WorkflowsTable = ({ workflowsQuery, state }) => {
|
|
|
24316
24606
|
}
|
|
24317
24607
|
)
|
|
24318
24608
|
] }) }),
|
|
24319
|
-
/* @__PURE__ */ jsx4("td", { width: "40%", children: /* @__PURE__ */ jsx4(
|
|
24320
|
-
const revertIconColor = getWorkflowEnv2("isHeadless") && (tag.toLowerCase() === "openai" || tag.toLowerCase() ===
|
|
24609
|
+
/* @__PURE__ */ jsx4("td", { width: "40%", children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react56.Row, { notPadded: true, gap: 12, children: (_d2 = workflow.tags) == null ? void 0 : _d2.map((tag) => {
|
|
24610
|
+
const revertIconColor = getWorkflowEnv2("isHeadless") && (tag.toLowerCase() === "openai" || tag.toLowerCase() === import_developer_studio_api42.IntegrationNames.BigCommerce.toLowerCase());
|
|
24321
24611
|
return /* @__PURE__ */ jsx4(
|
|
24322
24612
|
ProductIcon_default,
|
|
24323
24613
|
{
|
|
@@ -24419,7 +24709,7 @@ var WorkflowsTable = ({ workflowsQuery, state }) => {
|
|
|
24419
24709
|
);
|
|
24420
24710
|
}
|
|
24421
24711
|
return null;
|
|
24422
|
-
}) : workflowsQuery.isLoading ? /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { colSpan: 6, align: "center", children: /* @__PURE__ */ jsx4(
|
|
24712
|
+
}) : workflowsQuery.isLoading ? /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { colSpan: 6, align: "center", children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react56.Loader, { size: "medium" }) }) }) : /* @__PURE__ */ jsx4(
|
|
24423
24713
|
"tr",
|
|
24424
24714
|
{
|
|
24425
24715
|
css: css`
|
|
@@ -24449,7 +24739,7 @@ var WorkflowsGrid = ({
|
|
|
24449
24739
|
}) => {
|
|
24450
24740
|
var _a, _b, _c, _d;
|
|
24451
24741
|
return /* @__PURE__ */ jsx4(
|
|
24452
|
-
|
|
24742
|
+
import_developer_studio_ui_react57.Grid,
|
|
24453
24743
|
{
|
|
24454
24744
|
filters: {
|
|
24455
24745
|
left: /* @__PURE__ */ jsx4(import_react140.Fragment, { children: /* @__PURE__ */ jsx4(
|
|
@@ -24511,15 +24801,15 @@ var WorkflowListView = () => {
|
|
|
24511
24801
|
const hasNoData = workflows.isSuccess && workflows.data.length === 0 && state.params === void 0;
|
|
24512
24802
|
const hasData = !isLoading && !hasNoData;
|
|
24513
24803
|
if (isLoading) {
|
|
24514
|
-
return /* @__PURE__ */ jsx4(
|
|
24804
|
+
return /* @__PURE__ */ jsx4(import_developer_studio_ui_react58.Loader, { stretch: true });
|
|
24515
24805
|
}
|
|
24516
|
-
return /* @__PURE__ */ jsxs2(
|
|
24517
|
-
/* @__PURE__ */ jsxs2(
|
|
24518
|
-
/* @__PURE__ */ jsx4(
|
|
24519
|
-
|
|
24806
|
+
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react58.View, { stretch: isLoading, center: hasNoData, children: [
|
|
24807
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react58.Row, { topMargin: true, verticalCenter: hasNoData, children: [
|
|
24808
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react58.Column, { width: hasNoData ? 10 : 8, children: hasNoData ? /* @__PURE__ */ jsx4(import_developer_studio_ui_react58.Row, { notPadded: true, children: /* @__PURE__ */ jsx4(
|
|
24809
|
+
import_developer_studio_ui_react58.Intro,
|
|
24520
24810
|
{
|
|
24521
|
-
header: /* @__PURE__ */ jsx4(
|
|
24522
|
-
|
|
24811
|
+
header: /* @__PURE__ */ jsx4(import_developer_studio_ui_react58.Column, { notPadded: true, stretch: true, children: /* @__PURE__ */ jsxs2(
|
|
24812
|
+
import_developer_studio_ui_react58.Row,
|
|
24523
24813
|
{
|
|
24524
24814
|
notPadded: true,
|
|
24525
24815
|
verticalCenter: true,
|
|
@@ -24537,14 +24827,14 @@ var WorkflowListView = () => {
|
|
|
24537
24827
|
noMaxWidth: true
|
|
24538
24828
|
}
|
|
24539
24829
|
) }) : /* @__PURE__ */ jsx4(
|
|
24540
|
-
|
|
24830
|
+
import_developer_studio_ui_react58.Intro,
|
|
24541
24831
|
{
|
|
24542
24832
|
header: "Your workflows",
|
|
24543
24833
|
body: "Create custom workflows to automate your work.",
|
|
24544
24834
|
bodySize: "s"
|
|
24545
24835
|
}
|
|
24546
24836
|
) }),
|
|
24547
|
-
hasData ? /* @__PURE__ */ jsx4(
|
|
24837
|
+
hasData ? /* @__PURE__ */ jsx4(import_developer_studio_ui_react58.Column, { pullRight: true, children: /* @__PURE__ */ jsx4(
|
|
24548
24838
|
import_design_system_react_components87.Button,
|
|
24549
24839
|
{
|
|
24550
24840
|
kind: "primary",
|
|
@@ -24555,14 +24845,14 @@ var WorkflowListView = () => {
|
|
|
24555
24845
|
}
|
|
24556
24846
|
) }) : null
|
|
24557
24847
|
] }),
|
|
24558
|
-
/* @__PURE__ */ jsx4(
|
|
24848
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react58.Row, { children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react58.Column, { width: 12, noMaxWidth: true, gap: `var(${import_design_system_react_components87.SpacingToken.Spacing10})`, children: [
|
|
24559
24849
|
hasData ? /* @__PURE__ */ jsx4(
|
|
24560
24850
|
Grid_default,
|
|
24561
24851
|
{
|
|
24562
24852
|
workflowQuery: workflows,
|
|
24563
24853
|
state,
|
|
24564
24854
|
onStateChange: (change) => {
|
|
24565
|
-
setState((prevState) => (0,
|
|
24855
|
+
setState((prevState) => (0, import_developer_studio_api43.mergeDeep)(prevState, change));
|
|
24566
24856
|
}
|
|
24567
24857
|
}
|
|
24568
24858
|
) : null,
|
|
@@ -24592,12 +24882,12 @@ var WorkflowList = () => {
|
|
|
24592
24882
|
var List_default2 = WorkflowList;
|
|
24593
24883
|
|
|
24594
24884
|
// src/views/Flows/Definitions/index.tsx
|
|
24595
|
-
var
|
|
24885
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
24596
24886
|
function Workflows() {
|
|
24597
24887
|
const navigate = (0, import_react_router_dom31.useNavigate)();
|
|
24598
24888
|
const {
|
|
24599
24889
|
userData: { user, isLoading: isUserLoading }
|
|
24600
|
-
} = (0,
|
|
24890
|
+
} = (0, import_developer_studio_ui_react59.useRootContext)();
|
|
24601
24891
|
const { data: userHasInstalledWorkflows, isLoading: isWorkflowAppLoading } = useFetchUserInstalledWorkflows(user);
|
|
24602
24892
|
(0, import_react145.useEffect)(() => {
|
|
24603
24893
|
if (isUserLoading || isWorkflowAppLoading) {
|
|
@@ -24612,10 +24902,10 @@ function Workflows() {
|
|
|
24612
24902
|
isWorkflowAppLoading,
|
|
24613
24903
|
userHasInstalledWorkflows
|
|
24614
24904
|
]);
|
|
24615
|
-
return /* @__PURE__ */ (0,
|
|
24616
|
-
/* @__PURE__ */ (0,
|
|
24617
|
-
/* @__PURE__ */ (0,
|
|
24618
|
-
/* @__PURE__ */ (0,
|
|
24905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_react_router_dom31.Routes, { children: [
|
|
24906
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_react_router_dom31.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_react_router_dom31.Navigate, { replace: true, to: "list" }), path: "" }),
|
|
24907
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_react_router_dom31.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(List_default2, {}), path: "list/*" }),
|
|
24908
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_react_router_dom31.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Edit_default2, {}), path: ":id/*" })
|
|
24619
24909
|
] });
|
|
24620
24910
|
}
|
|
24621
24911
|
var Definitions_default = Workflows;
|
|
@@ -24625,7 +24915,7 @@ var import_react146 = require("react");
|
|
|
24625
24915
|
var import_react_router_dom32 = require("react-router-dom");
|
|
24626
24916
|
var import_design_system_icons46 = require("@livechat/design-system-icons");
|
|
24627
24917
|
var import_design_system_react_components88 = require("@livechat/design-system-react-components");
|
|
24628
|
-
var
|
|
24918
|
+
var import_developer_studio_ui_react60 = require("@livechat/developer-studio-ui-react");
|
|
24629
24919
|
|
|
24630
24920
|
// src/assets/flows/workflows-presentation.png
|
|
24631
24921
|
var workflows_presentation_default = "./workflows-presentation-EFFOQNV2.png";
|
|
@@ -24649,7 +24939,7 @@ var imgContainerCss = css`
|
|
|
24649
24939
|
var Waitlist = () => {
|
|
24650
24940
|
const {
|
|
24651
24941
|
userData: { user, isLoading }
|
|
24652
|
-
} = (0,
|
|
24942
|
+
} = (0, import_developer_studio_ui_react60.useRootContext)();
|
|
24653
24943
|
const { data: userHasInstalledWorkflows, isLoading: isWorkflowsAppLoading } = useFetchUserInstalledWorkflows(user);
|
|
24654
24944
|
const navigate = (0, import_react_router_dom32.useNavigate)();
|
|
24655
24945
|
(0, import_react146.useEffect)(() => {
|
|
@@ -24658,14 +24948,14 @@ var Waitlist = () => {
|
|
|
24658
24948
|
}
|
|
24659
24949
|
}, [userHasInstalledWorkflows, navigate]);
|
|
24660
24950
|
if (isLoading || isWorkflowsAppLoading) {
|
|
24661
|
-
return /* @__PURE__ */ jsx4(
|
|
24951
|
+
return /* @__PURE__ */ jsx4(import_developer_studio_ui_react60.Loader, { stretch: true });
|
|
24662
24952
|
}
|
|
24663
|
-
return /* @__PURE__ */ jsxs2(
|
|
24664
|
-
/* @__PURE__ */ jsx4(
|
|
24665
|
-
|
|
24953
|
+
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react60.View, { children: [
|
|
24954
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react60.Row, { topMargin: true, verticalCenter: true, noMaxWidth: true, children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react60.Column, { center: true, children: /* @__PURE__ */ jsx4(
|
|
24955
|
+
import_developer_studio_ui_react60.Intro,
|
|
24666
24956
|
{
|
|
24667
|
-
header: /* @__PURE__ */ jsx4(
|
|
24668
|
-
|
|
24957
|
+
header: /* @__PURE__ */ jsx4(import_developer_studio_ui_react60.Column, { notPadded: true, stretch: true, width: 4, children: /* @__PURE__ */ jsx4(
|
|
24958
|
+
import_developer_studio_ui_react60.Row,
|
|
24669
24959
|
{
|
|
24670
24960
|
notPadded: true,
|
|
24671
24961
|
verticalCenter: true,
|
|
@@ -24679,7 +24969,7 @@ var Waitlist = () => {
|
|
|
24679
24969
|
noMaxWidth: true
|
|
24680
24970
|
}
|
|
24681
24971
|
) }) }),
|
|
24682
|
-
/* @__PURE__ */ jsxs2(
|
|
24972
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react60.Row, { verticalCenter: true, gap: 8, topMargin: true, noMaxWidth: true, children: [
|
|
24683
24973
|
/* @__PURE__ */ jsx4(
|
|
24684
24974
|
import_design_system_react_components88.Button,
|
|
24685
24975
|
{
|
|
@@ -24706,7 +24996,7 @@ var Waitlist = () => {
|
|
|
24706
24996
|
}
|
|
24707
24997
|
)
|
|
24708
24998
|
] }),
|
|
24709
|
-
/* @__PURE__ */ jsxs2(
|
|
24999
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react60.Row, { verticalCenter: true, gap: 8, topMargin: true, lowMargin: true, noMaxWidth: true, children: [
|
|
24710
25000
|
/* @__PURE__ */ jsxs2(import_design_system_react_components88.Text, { css: infoCss, size: "lg", children: [
|
|
24711
25001
|
/* @__PURE__ */ jsx4(import_design_system_react_components88.Icon, { source: import_design_system_icons46.CheckCircle }),
|
|
24712
25002
|
"integrated with popular platforms"
|
|
@@ -24720,7 +25010,7 @@ var Waitlist = () => {
|
|
|
24720
25010
|
"build with ready-made blocks"
|
|
24721
25011
|
] })
|
|
24722
25012
|
] }),
|
|
24723
|
-
/* @__PURE__ */ jsx4(
|
|
25013
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react60.Row, { center: true, verticalCenter: true, noMaxWidth: true, children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react60.Column, { width: 5, center: true, children: /* @__PURE__ */ jsx4("div", { css: imgContainerCss, children: /* @__PURE__ */ jsx4(
|
|
24724
25014
|
"img",
|
|
24725
25015
|
{
|
|
24726
25016
|
alt: "waitlist",
|
|
@@ -24736,11 +25026,11 @@ var Waitlist = () => {
|
|
|
24736
25026
|
var Waitlist_default = Waitlist;
|
|
24737
25027
|
|
|
24738
25028
|
// src/views/Flows/index.tsx
|
|
24739
|
-
var
|
|
25029
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
24740
25030
|
var Flows = () => {
|
|
24741
|
-
return /* @__PURE__ */ (0,
|
|
24742
|
-
/* @__PURE__ */ (0,
|
|
24743
|
-
/* @__PURE__ */ (0,
|
|
25031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_react_router_dom33.Routes, { children: [
|
|
25032
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_react_router_dom33.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Definitions_default, {}) }),
|
|
25033
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_react_router_dom33.Route, { path: "/waitlist", element: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Waitlist_default, {}) })
|
|
24744
25034
|
] });
|
|
24745
25035
|
};
|
|
24746
25036
|
var Flows_default = Flows;
|
|
@@ -24752,68 +25042,16 @@ var import_react_router_dom45 = require("react-router-dom");
|
|
|
24752
25042
|
var import_react_router_dom44 = require("react-router-dom");
|
|
24753
25043
|
var import_design_system_react_components103 = require("@livechat/design-system-react-components");
|
|
24754
25044
|
var import_developer_studio_api70 = require("@livechat/developer-studio-api");
|
|
24755
|
-
var
|
|
25045
|
+
var import_developer_studio_ui_react86 = require("@livechat/developer-studio-ui-react");
|
|
24756
25046
|
|
|
24757
25047
|
// src/views/Settings/Integrations/Accounts/index.tsx
|
|
24758
25048
|
var import_react_router_dom34 = require("react-router-dom");
|
|
24759
25049
|
|
|
24760
|
-
// src/views/Settings/Integrations/Accounts/Action.tsx
|
|
24761
|
-
var import_developer_studio_api42 = require("@livechat/developer-studio-api");
|
|
24762
|
-
var import_developer_studio_ui_react59 = require("@livechat/developer-studio-ui-react");
|
|
24763
|
-
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
24764
|
-
var AccountsAction = (props) => {
|
|
24765
|
-
var _a;
|
|
24766
|
-
const match2 = (0, import_developer_studio_ui_react59.useMatch)();
|
|
24767
|
-
const action = (_a = props.action) != null ? _a : match2.params.action;
|
|
24768
|
-
if (!action) {
|
|
24769
|
-
throw new Error("Invalid action");
|
|
24770
|
-
}
|
|
24771
|
-
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
24772
|
-
IntegrationAction_default,
|
|
24773
|
-
{
|
|
24774
|
-
name: import_developer_studio_api42.IntegrationNames.Accounts,
|
|
24775
|
-
action,
|
|
24776
|
-
data: props.data,
|
|
24777
|
-
context: props.context,
|
|
24778
|
-
serializedData: match2.params.data,
|
|
24779
|
-
serializedContext: match2.params.context,
|
|
24780
|
-
executor: props.executor,
|
|
24781
|
-
trigger: {
|
|
24782
|
-
mode: import_developer_studio_api42.IntegrationModes.Modal,
|
|
24783
|
-
handler: (output) => accountsActionHandlers()[action](output)
|
|
24784
|
-
},
|
|
24785
|
-
onSuccess: props.onSuccess
|
|
24786
|
-
}
|
|
24787
|
-
);
|
|
24788
|
-
};
|
|
24789
|
-
var accountsActionHandlers = () => {
|
|
24790
|
-
const handlers = {
|
|
24791
|
-
activate: (output) => {
|
|
24792
|
-
if (output.status === "success" && output.result.access_token) {
|
|
24793
|
-
(0, import_developer_studio_ui_react59.setRootData)({
|
|
24794
|
-
access_token: output.result.access_token,
|
|
24795
|
-
scope: output.result.scope,
|
|
24796
|
-
expires_in: output.result.expires_in
|
|
24797
|
-
});
|
|
24798
|
-
return {
|
|
24799
|
-
isValid: true,
|
|
24800
|
-
result: output.result
|
|
24801
|
-
};
|
|
24802
|
-
}
|
|
24803
|
-
return {
|
|
24804
|
-
isValid: false
|
|
24805
|
-
};
|
|
24806
|
-
}
|
|
24807
|
-
};
|
|
24808
|
-
return handlers;
|
|
24809
|
-
};
|
|
24810
|
-
var Action_default5 = AccountsAction;
|
|
24811
|
-
|
|
24812
25050
|
// src/views/Settings/Integrations/Accounts/Callback.tsx
|
|
24813
|
-
var
|
|
25051
|
+
var import_developer_studio_ui_react61 = require("@livechat/developer-studio-ui-react");
|
|
24814
25052
|
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
24815
25053
|
var AccountsCallback = () => {
|
|
24816
|
-
const match2 = (0,
|
|
25054
|
+
const match2 = (0, import_developer_studio_ui_react61.useMatch)();
|
|
24817
25055
|
const action = match2.params.action;
|
|
24818
25056
|
if (!action) {
|
|
24819
25057
|
throw new Error("Invalid action");
|
|
@@ -24848,11 +25086,11 @@ var import_react_router_dom35 = require("react-router-dom");
|
|
|
24848
25086
|
|
|
24849
25087
|
// src/views/Settings/Integrations/BigCommerce/Callback.tsx
|
|
24850
25088
|
var import_react148 = require("react");
|
|
24851
|
-
var
|
|
25089
|
+
var import_developer_studio_ui_react62 = require("@livechat/developer-studio-ui-react");
|
|
24852
25090
|
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
24853
25091
|
var BigCommerceCallback = () => {
|
|
24854
25092
|
const { login } = (0, import_react148.useContext)(AuthContext);
|
|
24855
|
-
const match2 = (0,
|
|
25093
|
+
const match2 = (0, import_developer_studio_ui_react62.useMatch)();
|
|
24856
25094
|
const action = match2.params.action;
|
|
24857
25095
|
if (!action) {
|
|
24858
25096
|
throw new Error("Invalid action");
|
|
@@ -24870,14 +25108,14 @@ var Callback_default2 = BigCommerceCallback;
|
|
|
24870
25108
|
var import_react155 = require("react");
|
|
24871
25109
|
var import_design_system_icons48 = require("@livechat/design-system-icons");
|
|
24872
25110
|
var import_design_system_react_components93 = require("@livechat/design-system-react-components");
|
|
24873
|
-
var
|
|
24874
|
-
var
|
|
25111
|
+
var import_developer_studio_api44 = require("@livechat/developer-studio-api");
|
|
25112
|
+
var import_developer_studio_ui_react66 = require("@livechat/developer-studio-ui-react");
|
|
24875
25113
|
|
|
24876
25114
|
// src/views/Settings/Integrations/Common/IntegrationCredentials.tsx
|
|
24877
25115
|
var import_react149 = require("react");
|
|
24878
25116
|
var import_design_system_icons47 = require("@livechat/design-system-icons");
|
|
24879
25117
|
var import_design_system_react_components89 = require("@livechat/design-system-react-components");
|
|
24880
|
-
var
|
|
25118
|
+
var import_developer_studio_ui_react63 = require("@livechat/developer-studio-ui-react");
|
|
24881
25119
|
function IntegrationStatusCredentials({
|
|
24882
25120
|
credentials,
|
|
24883
25121
|
trigger
|
|
@@ -24900,7 +25138,7 @@ function IntegrationStatusCredentials({
|
|
|
24900
25138
|
] }) }),
|
|
24901
25139
|
[trigger, removeCredentialMutation]
|
|
24902
25140
|
);
|
|
24903
|
-
return /* @__PURE__ */ jsxs2(
|
|
25141
|
+
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react63.Table, { children: [
|
|
24904
25142
|
/* @__PURE__ */ jsxs2("tr", { children: [
|
|
24905
25143
|
/* @__PURE__ */ jsx4("th", { children: "Name" }),
|
|
24906
25144
|
/* @__PURE__ */ jsx4("th", { children: "Type" }),
|
|
@@ -24917,7 +25155,7 @@ function IntegrationStatusCredentials({
|
|
|
24917
25155
|
// src/views/Settings/Integrations/Common/IntegrationStatus.tsx
|
|
24918
25156
|
var import_react150 = __toESM(require("react"));
|
|
24919
25157
|
var import_design_system_react_components90 = require("@livechat/design-system-react-components");
|
|
24920
|
-
var
|
|
25158
|
+
var import_developer_studio_ui_react64 = require("@livechat/developer-studio-ui-react");
|
|
24921
25159
|
var infoContainerCss = css`
|
|
24922
25160
|
background-color: var(${import_design_system_react_components90.DesignToken.SurfaceSecondaryDefault});
|
|
24923
25161
|
`;
|
|
@@ -24937,10 +25175,10 @@ var bigImageStyle = css`
|
|
|
24937
25175
|
`;
|
|
24938
25176
|
var IntegrationStatusView = (props) => {
|
|
24939
25177
|
var _a;
|
|
24940
|
-
return /* @__PURE__ */ jsxs2(
|
|
24941
|
-
/* @__PURE__ */ jsx4(
|
|
24942
|
-
/* @__PURE__ */ jsx4(
|
|
24943
|
-
|
|
25178
|
+
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react64.View, { children: [
|
|
25179
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react64.Row, { topMargin: true, children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react64.Column, { width: 6, children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react64.Intro, { header: props.title, body: props.subtitle, bodySize: "s" }) }) }),
|
|
25180
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react64.Row, { topMargin: true, children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react64.Column, { width: 6, children: /* @__PURE__ */ jsx4(
|
|
25181
|
+
import_developer_studio_ui_react64.Card,
|
|
24944
25182
|
{
|
|
24945
25183
|
noPadding: true,
|
|
24946
25184
|
title: props.header,
|
|
@@ -24949,8 +25187,8 @@ var IntegrationStatusView = (props) => {
|
|
|
24949
25187
|
`,
|
|
24950
25188
|
dataCy: props.dataCy,
|
|
24951
25189
|
children: /* @__PURE__ */ jsxs2(import_react150.default.Fragment, { children: [
|
|
24952
|
-
/* @__PURE__ */ jsxs2(
|
|
24953
|
-
/* @__PURE__ */ jsx4(
|
|
25190
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react64.Row, { notPadded: true, css: infoContainerCss, children: [
|
|
25191
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react64.Column, { center: true, width: 2, setColumnPadding: 28, children: props.imgSrc ? /* @__PURE__ */ jsx4(
|
|
24954
25192
|
"img",
|
|
24955
25193
|
{
|
|
24956
25194
|
alt: "",
|
|
@@ -24958,10 +25196,10 @@ var IntegrationStatusView = (props) => {
|
|
|
24958
25196
|
css: bigImageStyle
|
|
24959
25197
|
}
|
|
24960
25198
|
) : /* @__PURE__ */ jsx4("div", { css: bigIconStyle(props.iconColor), children: props.icon }) }),
|
|
24961
|
-
/* @__PURE__ */ jsx4(
|
|
25199
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react64.Column, { setColumnPadding: 28, children: props.description })
|
|
24962
25200
|
] }),
|
|
24963
25201
|
/* @__PURE__ */ jsx4(
|
|
24964
|
-
|
|
25202
|
+
import_developer_studio_ui_react64.Row,
|
|
24965
25203
|
{
|
|
24966
25204
|
setRowPadding: `var(${import_design_system_react_components90.SpacingToken.Spacing5}) var(${import_design_system_react_components90.SpacingToken.Spacing5}) 0 var(${import_design_system_react_components90.SpacingToken.Spacing5}) `,
|
|
24967
25205
|
children: props.children
|
|
@@ -24976,7 +25214,7 @@ var IntegrationStatus_default = IntegrationStatusView;
|
|
|
24976
25214
|
|
|
24977
25215
|
// src/views/Settings/Integrations/Common/IntegrationStatusRow.tsx
|
|
24978
25216
|
var import_design_system_react_components92 = require("@livechat/design-system-react-components");
|
|
24979
|
-
var
|
|
25217
|
+
var import_developer_studio_ui_react65 = require("@livechat/developer-studio-ui-react");
|
|
24980
25218
|
|
|
24981
25219
|
// src/views/Settings/Integrations/Common/IntegrationConnectionStatus.tsx
|
|
24982
25220
|
var import_react152 = require("react");
|
|
@@ -25015,18 +25253,18 @@ var smallIconStyle = css`
|
|
|
25015
25253
|
}
|
|
25016
25254
|
`;
|
|
25017
25255
|
function IntegrationStatusRow(props) {
|
|
25018
|
-
return /* @__PURE__ */ jsxs2(
|
|
25019
|
-
/* @__PURE__ */ jsxs2(
|
|
25020
|
-
/* @__PURE__ */ jsxs2(
|
|
25256
|
+
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react65.Row, { notPadded: true, spaceBetween: true, children: [
|
|
25257
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react65.Column, { notPadded: true, stretch: true, children: [
|
|
25258
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react65.Row, { notPadded: true, stretch: true, center: true, children: [
|
|
25021
25259
|
/* @__PURE__ */ jsx4("div", { css: smallIconStyle, children: props.icon }),
|
|
25022
25260
|
/* @__PURE__ */ jsx4(import_design_system_react_components92.Text, { as: "span", size: "xs", children: props.title })
|
|
25023
25261
|
] }),
|
|
25024
|
-
/* @__PURE__ */ jsxs2(
|
|
25262
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react65.Row, { setRowPadding: "4px 0 0 20px", center: true, stretch: true, children: [
|
|
25025
25263
|
getConnectionStatus(props.isConnected, "connect", props.isLoading),
|
|
25026
25264
|
props.status
|
|
25027
25265
|
] })
|
|
25028
25266
|
] }),
|
|
25029
|
-
/* @__PURE__ */ jsx4(
|
|
25267
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react65.Column, { pullRight: true, stretch: true, children: props.action })
|
|
25030
25268
|
] });
|
|
25031
25269
|
}
|
|
25032
25270
|
|
|
@@ -25036,8 +25274,8 @@ var BigCommerceStatus = () => {
|
|
|
25036
25274
|
const { login } = (0, import_react155.useContext)(AuthContext);
|
|
25037
25275
|
const {
|
|
25038
25276
|
userData: { user }
|
|
25039
|
-
} = (0,
|
|
25040
|
-
const { context: notifications } = (0,
|
|
25277
|
+
} = (0, import_developer_studio_ui_react66.useRootContext)();
|
|
25278
|
+
const { context: notifications } = (0, import_developer_studio_ui_react66.useNotifications)();
|
|
25041
25279
|
const credentialsQuery = useFetchBigCommerceCredentials();
|
|
25042
25280
|
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
25043
25281
|
const [state, setState] = (0, import_react155.useState)();
|
|
@@ -25196,9 +25434,9 @@ var BigCommerceStatus = () => {
|
|
|
25196
25434
|
/* @__PURE__ */ jsxs2(
|
|
25197
25435
|
IntegrationStatus_default,
|
|
25198
25436
|
{
|
|
25199
|
-
title:
|
|
25200
|
-
subtitle: `${
|
|
25201
|
-
header: `${
|
|
25437
|
+
title: import_developer_studio_api44.IntegrationDisplayNames.BigCommerce,
|
|
25438
|
+
subtitle: `${import_developer_studio_api44.IntegrationDisplayNames.BigCommerce} integration`,
|
|
25439
|
+
header: `${import_developer_studio_api44.IntegrationDisplayNames.BigCommerce} integration`,
|
|
25202
25440
|
description: "",
|
|
25203
25441
|
icon: /* @__PURE__ */ jsx4(import_design_system_icons48.BigCommerceColored, {}),
|
|
25204
25442
|
iconColor: true,
|
|
@@ -25264,8 +25502,8 @@ var import_react_router_dom36 = require("react-router-dom");
|
|
|
25264
25502
|
|
|
25265
25503
|
// src/views/Settings/Integrations/GitHub/Action.tsx
|
|
25266
25504
|
var import_react156 = require("react");
|
|
25267
|
-
var
|
|
25268
|
-
var
|
|
25505
|
+
var import_developer_studio_api45 = require("@livechat/developer-studio-api");
|
|
25506
|
+
var import_developer_studio_ui_react67 = require("@livechat/developer-studio-ui-react");
|
|
25269
25507
|
|
|
25270
25508
|
// src/utils/amplitude/journeys/application/blocks/repository.ts
|
|
25271
25509
|
var appRepositoryBlockAmplitudeJourneyFactory = (email) => ({
|
|
@@ -25392,10 +25630,10 @@ var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
|
25392
25630
|
var GitHubAction = (props) => {
|
|
25393
25631
|
var _a;
|
|
25394
25632
|
const { login } = (0, import_react156.useContext)(AuthContext);
|
|
25395
|
-
const match2 = (0,
|
|
25633
|
+
const match2 = (0, import_developer_studio_ui_react67.useMatch)();
|
|
25396
25634
|
const {
|
|
25397
25635
|
userData: { user }
|
|
25398
|
-
} = (0,
|
|
25636
|
+
} = (0, import_developer_studio_ui_react67.useRootContext)();
|
|
25399
25637
|
const action = (_a = props.action) != null ? _a : match2.params.action;
|
|
25400
25638
|
if (!action) {
|
|
25401
25639
|
throw new Error("Invalid action");
|
|
@@ -25403,7 +25641,7 @@ var GitHubAction = (props) => {
|
|
|
25403
25641
|
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
25404
25642
|
IntegrationAction_default,
|
|
25405
25643
|
{
|
|
25406
|
-
name:
|
|
25644
|
+
name: import_developer_studio_api45.IntegrationNames.GitHub,
|
|
25407
25645
|
action,
|
|
25408
25646
|
data: props.data,
|
|
25409
25647
|
context: props.context,
|
|
@@ -25411,7 +25649,7 @@ var GitHubAction = (props) => {
|
|
|
25411
25649
|
serializedContext: match2.params.context,
|
|
25412
25650
|
executor: props.executor,
|
|
25413
25651
|
trigger: {
|
|
25414
|
-
mode:
|
|
25652
|
+
mode: import_developer_studio_api45.IntegrationModes.Modal,
|
|
25415
25653
|
handler: (output) => gitHubActionHandlers(login, user == null ? void 0 : user.meta.email)[action](output)
|
|
25416
25654
|
},
|
|
25417
25655
|
onSuccess: props.onSuccess
|
|
@@ -25424,10 +25662,10 @@ var gitHubActionHandlers = (login, email) => {
|
|
|
25424
25662
|
authorize: (output) => {
|
|
25425
25663
|
if (output.status === "success" && output.result.appToken && output.result.oauthToken) {
|
|
25426
25664
|
amplitudeRepositoryJourney.app.repository.actions.authorize.success(
|
|
25427
|
-
|
|
25665
|
+
import_developer_studio_api45.IntegrationNames.GitHub
|
|
25428
25666
|
);
|
|
25429
25667
|
login({
|
|
25430
|
-
source:
|
|
25668
|
+
source: import_developer_studio_api45.IntegrationNames.GitHub,
|
|
25431
25669
|
data: {
|
|
25432
25670
|
appToken: output.result.appToken,
|
|
25433
25671
|
oauthToken: output.result.oauthToken
|
|
@@ -25451,7 +25689,7 @@ var gitHubActionHandlers = (login, email) => {
|
|
|
25451
25689
|
install: (output) => {
|
|
25452
25690
|
if (output.status === "success" && output.result.installationId) {
|
|
25453
25691
|
amplitudeRepositoryJourney.app.repository.actions.install.success(
|
|
25454
|
-
|
|
25692
|
+
import_developer_studio_api45.IntegrationNames.GitHub
|
|
25455
25693
|
);
|
|
25456
25694
|
return {
|
|
25457
25695
|
isValid: true,
|
|
@@ -25470,15 +25708,15 @@ var Action_default6 = GitHubAction;
|
|
|
25470
25708
|
|
|
25471
25709
|
// src/views/Settings/Integrations/GitHub/Callback.tsx
|
|
25472
25710
|
var import_react157 = require("react");
|
|
25473
|
-
var
|
|
25711
|
+
var import_developer_studio_ui_react68 = require("@livechat/developer-studio-ui-react");
|
|
25474
25712
|
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
25475
25713
|
var GithubCallback = () => {
|
|
25476
25714
|
const { login } = (0, import_react157.useContext)(AuthContext);
|
|
25477
|
-
const match2 = (0,
|
|
25715
|
+
const match2 = (0, import_developer_studio_ui_react68.useMatch)();
|
|
25478
25716
|
const action = match2.params.action;
|
|
25479
25717
|
const {
|
|
25480
25718
|
userData: { user }
|
|
25481
|
-
} = (0,
|
|
25719
|
+
} = (0, import_developer_studio_ui_react68.useRootContext)();
|
|
25482
25720
|
if (!action) {
|
|
25483
25721
|
throw new Error("Invalid action");
|
|
25484
25722
|
}
|
|
@@ -25496,15 +25734,15 @@ var import_react161 = require("react");
|
|
|
25496
25734
|
var import_design_system_icons49 = require("@livechat/design-system-icons");
|
|
25497
25735
|
var import_design_system_react_components94 = require("@livechat/design-system-react-components");
|
|
25498
25736
|
var import_design_system_react_components95 = require("@livechat/design-system-react-components");
|
|
25499
|
-
var
|
|
25500
|
-
var
|
|
25737
|
+
var import_developer_studio_api49 = require("@livechat/developer-studio-api");
|
|
25738
|
+
var import_developer_studio_ui_react69 = require("@livechat/developer-studio-ui-react");
|
|
25501
25739
|
|
|
25502
25740
|
// src/hooks/integrations/github/credentials.ts
|
|
25503
|
-
var
|
|
25741
|
+
var import_developer_studio_api46 = require("@livechat/developer-studio-api");
|
|
25504
25742
|
var useFetchGitHubCredentials = () => {
|
|
25505
25743
|
var _a, _b, _c;
|
|
25506
25744
|
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
25507
|
-
|
|
25745
|
+
import_developer_studio_api46.IntegrationNames.GitHub
|
|
25508
25746
|
);
|
|
25509
25747
|
const appCredential = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
25510
25748
|
(credential) => credential.type === "oauth2" && credential.data.client_id === getWorkflowEnv("githubAppClientId")
|
|
@@ -25528,22 +25766,22 @@ var useFetchGitHubCredentials = () => {
|
|
|
25528
25766
|
|
|
25529
25767
|
// src/hooks/integrations/github/installation.ts
|
|
25530
25768
|
var import_react158 = require("react");
|
|
25531
|
-
var
|
|
25532
|
-
var
|
|
25769
|
+
var import_react_query10 = require("@tanstack/react-query");
|
|
25770
|
+
var import_developer_studio_api47 = require("@livechat/developer-studio-api");
|
|
25533
25771
|
var githubInstallationQueryKeys = {
|
|
25534
25772
|
getInstallations: ["github.getInstallations"],
|
|
25535
25773
|
getIsInstalled: ["github.getIsInstalled"]
|
|
25536
25774
|
};
|
|
25537
25775
|
var useFetchGitHubInstallations = () => {
|
|
25538
25776
|
const { logout } = (0, import_react158.useContext)(AuthContext);
|
|
25539
|
-
return (0,
|
|
25777
|
+
return (0, import_react_query10.useQuery)(
|
|
25540
25778
|
githubInstallationQueryKeys.getInstallations,
|
|
25541
|
-
() =>
|
|
25779
|
+
() => import_developer_studio_api47.api.integrations.github.installation.getInstallations(),
|
|
25542
25780
|
{
|
|
25543
25781
|
retry: false,
|
|
25544
25782
|
onError: (error) => {
|
|
25545
|
-
if (error instanceof
|
|
25546
|
-
logout(
|
|
25783
|
+
if (error instanceof import_developer_studio_api47.UnauthorizeApiError) {
|
|
25784
|
+
logout(import_developer_studio_api47.IntegrationNames.GitHub);
|
|
25547
25785
|
}
|
|
25548
25786
|
}
|
|
25549
25787
|
}
|
|
@@ -25552,8 +25790,8 @@ var useFetchGitHubInstallations = () => {
|
|
|
25552
25790
|
|
|
25553
25791
|
// src/hooks/integrations/github/repository.ts
|
|
25554
25792
|
var import_react159 = require("react");
|
|
25555
|
-
var
|
|
25556
|
-
var
|
|
25793
|
+
var import_react_query11 = require("@tanstack/react-query");
|
|
25794
|
+
var import_developer_studio_api48 = require("@livechat/developer-studio-api");
|
|
25557
25795
|
|
|
25558
25796
|
// src/hooks/integrations/pusher/usePusher.ts
|
|
25559
25797
|
var import_react160 = require("react");
|
|
@@ -25592,7 +25830,7 @@ var GitHubStatus = () => {
|
|
|
25592
25830
|
var _a, _b;
|
|
25593
25831
|
const {
|
|
25594
25832
|
userData: { user }
|
|
25595
|
-
} = (0,
|
|
25833
|
+
} = (0, import_developer_studio_ui_react69.useRootContext)();
|
|
25596
25834
|
const { logout } = (0, import_react161.useContext)(AuthContext);
|
|
25597
25835
|
const credentialsQuery = useFetchGitHubCredentials();
|
|
25598
25836
|
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
@@ -25615,7 +25853,7 @@ var GitHubStatus = () => {
|
|
|
25615
25853
|
}
|
|
25616
25854
|
if (!appCredential && !oauthCredential) {
|
|
25617
25855
|
amplitudeRepositoryJourney.app.repository.actions.authorize.requested(
|
|
25618
|
-
|
|
25856
|
+
import_developer_studio_api49.IntegrationNames.GitHub
|
|
25619
25857
|
);
|
|
25620
25858
|
return;
|
|
25621
25859
|
}
|
|
@@ -25624,7 +25862,7 @@ var GitHubStatus = () => {
|
|
|
25624
25862
|
}
|
|
25625
25863
|
if (!isInstalled) {
|
|
25626
25864
|
amplitudeRepositoryJourney.app.repository.actions.install.requested(
|
|
25627
|
-
|
|
25865
|
+
import_developer_studio_api49.IntegrationNames.GitHub
|
|
25628
25866
|
);
|
|
25629
25867
|
}
|
|
25630
25868
|
}, [
|
|
@@ -25639,7 +25877,7 @@ var GitHubStatus = () => {
|
|
|
25639
25877
|
"my-event",
|
|
25640
25878
|
(data) => {
|
|
25641
25879
|
var _a2;
|
|
25642
|
-
if (data.integration !==
|
|
25880
|
+
if (data.integration !== import_developer_studio_api49.IntegrationNames.GitHub) {
|
|
25643
25881
|
return;
|
|
25644
25882
|
}
|
|
25645
25883
|
if (data.action === "install" && data.userId === (user == null ? void 0 : user.profile.id)) {
|
|
@@ -25649,7 +25887,7 @@ var GitHubStatus = () => {
|
|
|
25649
25887
|
))) {
|
|
25650
25888
|
credentialsQuery.refetch();
|
|
25651
25889
|
gitHubInstallationsQuery.refetch();
|
|
25652
|
-
logout(
|
|
25890
|
+
logout(import_developer_studio_api49.IntegrationNames.GitHub);
|
|
25653
25891
|
}
|
|
25654
25892
|
},
|
|
25655
25893
|
[gitHubInstallationsQuery.data]
|
|
@@ -25668,7 +25906,7 @@ var GitHubStatus = () => {
|
|
|
25668
25906
|
onClick: () => {
|
|
25669
25907
|
if (!(credential == null ? void 0 : credential.data.connected)) {
|
|
25670
25908
|
amplitudeRepositoryJourney.app.repository.actions.authorize.click(
|
|
25671
|
-
|
|
25909
|
+
import_developer_studio_api49.IntegrationNames.GitHub
|
|
25672
25910
|
);
|
|
25673
25911
|
}
|
|
25674
25912
|
confirm();
|
|
@@ -25707,7 +25945,7 @@ var GitHubStatus = () => {
|
|
|
25707
25945
|
loading: gitHubInstallationsQuery.isLoading,
|
|
25708
25946
|
onClick: () => {
|
|
25709
25947
|
amplitudeRepositoryJourney.app.repository.actions.install.click(
|
|
25710
|
-
|
|
25948
|
+
import_developer_studio_api49.IntegrationNames.GitHub
|
|
25711
25949
|
);
|
|
25712
25950
|
confirm();
|
|
25713
25951
|
},
|
|
@@ -25772,11 +26010,11 @@ var GitHubStatus = () => {
|
|
|
25772
26010
|
return /* @__PURE__ */ jsxs2(
|
|
25773
26011
|
IntegrationStatus_default,
|
|
25774
26012
|
{
|
|
25775
|
-
title:
|
|
26013
|
+
title: import_developer_studio_api49.IntegrationDisplayNames.GitHub,
|
|
25776
26014
|
subtitle: "Integrate your GitHub account to be able to link repositories of your apps.",
|
|
25777
26015
|
header: "GitHub integration",
|
|
25778
26016
|
description: "The integration of GitHub and the Developer Console streamlines your development process, enhances collaboration, centralizes the services for building, testing and deploying apps, and helps to efficiently manage your code.",
|
|
25779
|
-
icon: /* @__PURE__ */ jsx4(
|
|
26017
|
+
icon: /* @__PURE__ */ jsx4(import_developer_studio_ui_react69.Github, {}),
|
|
25780
26018
|
iconColor: true,
|
|
25781
26019
|
dataCy: "github-integration-component",
|
|
25782
26020
|
children: [
|
|
@@ -25788,8 +26026,8 @@ var GitHubStatus = () => {
|
|
|
25788
26026
|
(appCredential == null ? void 0 : appCredential.data.connected) && (oauthCredential == null ? void 0 : oauthCredential.data.connected)
|
|
25789
26027
|
),
|
|
25790
26028
|
isLoading: credentialsQuery.isFetching,
|
|
25791
|
-
icon: /* @__PURE__ */ jsx4(
|
|
25792
|
-
action: !credentialsQuery.isFetching && !(appCredential == null ? void 0 : appCredential.name) && !(oauthCredential == null ? void 0 : oauthCredential.name) ? /* @__PURE__ */ jsx4(Connect, {}) : !credentialsQuery.isFetching ? /* @__PURE__ */ jsxs2(
|
|
26029
|
+
icon: /* @__PURE__ */ jsx4(import_developer_studio_ui_react69.Github, {}),
|
|
26030
|
+
action: !credentialsQuery.isFetching && !(appCredential == null ? void 0 : appCredential.name) && !(oauthCredential == null ? void 0 : oauthCredential.name) ? /* @__PURE__ */ jsx4(Connect, {}) : !credentialsQuery.isFetching ? /* @__PURE__ */ jsxs2(import_developer_studio_ui_react69.Row, { notPadded: true, flexEnd: true, gap: `var(${import_design_system_react_components94.SpacingToken.Spacing2})`, children: [
|
|
25793
26031
|
/* @__PURE__ */ jsx4(Install, {}),
|
|
25794
26032
|
/* @__PURE__ */ jsx4(
|
|
25795
26033
|
import_design_system_react_components95.ActionMenu,
|
|
@@ -25869,11 +26107,11 @@ var import_react_router_dom37 = require("react-router-dom");
|
|
|
25869
26107
|
|
|
25870
26108
|
// src/views/Settings/Integrations/HubSpot/Callback.tsx
|
|
25871
26109
|
var import_react162 = require("react");
|
|
25872
|
-
var
|
|
26110
|
+
var import_developer_studio_ui_react70 = require("@livechat/developer-studio-ui-react");
|
|
25873
26111
|
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
25874
26112
|
var HubSpotCallback = () => {
|
|
25875
26113
|
const { login } = (0, import_react162.useContext)(AuthContext);
|
|
25876
|
-
const match2 = (0,
|
|
26114
|
+
const match2 = (0, import_developer_studio_ui_react70.useMatch)();
|
|
25877
26115
|
const action = match2.params.action;
|
|
25878
26116
|
if (!action) {
|
|
25879
26117
|
throw new Error("Invalid action");
|
|
@@ -25891,7 +26129,7 @@ var Callback_default4 = HubSpotCallback;
|
|
|
25891
26129
|
var import_react163 = require("react");
|
|
25892
26130
|
var import_design_system_icons50 = require("@livechat/design-system-icons");
|
|
25893
26131
|
var import_design_system_react_components96 = require("@livechat/design-system-react-components");
|
|
25894
|
-
var
|
|
26132
|
+
var import_developer_studio_api50 = require("@livechat/developer-studio-api");
|
|
25895
26133
|
var HubspotStatus = () => {
|
|
25896
26134
|
const credentialsQuery = useFetchHubspotCredentials();
|
|
25897
26135
|
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
@@ -25934,9 +26172,9 @@ var HubspotStatus = () => {
|
|
|
25934
26172
|
return /* @__PURE__ */ jsxs2(
|
|
25935
26173
|
IntegrationStatus_default,
|
|
25936
26174
|
{
|
|
25937
|
-
title:
|
|
25938
|
-
subtitle: `${
|
|
25939
|
-
header: `${
|
|
26175
|
+
title: import_developer_studio_api50.IntegrationDisplayNames.HubSpot,
|
|
26176
|
+
subtitle: `${import_developer_studio_api50.IntegrationDisplayNames.HubSpot} integration`,
|
|
26177
|
+
header: `${import_developer_studio_api50.IntegrationDisplayNames.HubSpot} integration`,
|
|
25940
26178
|
description: "",
|
|
25941
26179
|
icon: /* @__PURE__ */ jsx4(import_design_system_icons50.Hubspot, {}),
|
|
25942
26180
|
dataCy: "hubpsot-integration-component",
|
|
@@ -26000,11 +26238,11 @@ var import_react_router_dom38 = require("react-router-dom");
|
|
|
26000
26238
|
|
|
26001
26239
|
// src/views/Settings/Integrations/Mailchimp/Callback.tsx
|
|
26002
26240
|
var import_react164 = require("react");
|
|
26003
|
-
var
|
|
26241
|
+
var import_developer_studio_ui_react71 = require("@livechat/developer-studio-ui-react");
|
|
26004
26242
|
var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
26005
26243
|
var MailchimpCallback = () => {
|
|
26006
26244
|
const { login } = (0, import_react164.useContext)(AuthContext);
|
|
26007
|
-
const match2 = (0,
|
|
26245
|
+
const match2 = (0, import_developer_studio_ui_react71.useMatch)();
|
|
26008
26246
|
const action = match2.params.action;
|
|
26009
26247
|
if (!action) {
|
|
26010
26248
|
throw new Error("Invalid action");
|
|
@@ -26022,7 +26260,7 @@ var Callback_default5 = MailchimpCallback;
|
|
|
26022
26260
|
var import_react165 = require("react");
|
|
26023
26261
|
var import_design_system_icons51 = require("@livechat/design-system-icons");
|
|
26024
26262
|
var import_design_system_react_components97 = require("@livechat/design-system-react-components");
|
|
26025
|
-
var
|
|
26263
|
+
var import_developer_studio_api51 = require("@livechat/developer-studio-api");
|
|
26026
26264
|
var MailchimpStatus = () => {
|
|
26027
26265
|
const credentialsQuery = useFetchMailchimpCredentials();
|
|
26028
26266
|
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
@@ -26065,9 +26303,9 @@ var MailchimpStatus = () => {
|
|
|
26065
26303
|
return /* @__PURE__ */ jsxs2(
|
|
26066
26304
|
IntegrationStatus_default,
|
|
26067
26305
|
{
|
|
26068
|
-
title:
|
|
26069
|
-
subtitle: `${
|
|
26070
|
-
header: `${
|
|
26306
|
+
title: import_developer_studio_api51.IntegrationDisplayNames.Mailchimp,
|
|
26307
|
+
subtitle: `${import_developer_studio_api51.IntegrationDisplayNames.Mailchimp} integration`,
|
|
26308
|
+
header: `${import_developer_studio_api51.IntegrationDisplayNames.Mailchimp} integration`,
|
|
26071
26309
|
description: "Integrate Developer Console with Mailchimp to streamline your marketing campaigns, automate email workflows, and enhance your customer engagement with ease. Experience efficient and effective communication, all within a unified platform.",
|
|
26072
26310
|
icon: /* @__PURE__ */ jsx4(import_design_system_icons51.Mailchimp, {}),
|
|
26073
26311
|
dataCy: "mailchimp-integration-component",
|
|
@@ -26131,13 +26369,13 @@ var import_react_router_dom39 = require("react-router-dom");
|
|
|
26131
26369
|
|
|
26132
26370
|
// src/views/Settings/Integrations/Neon/Action.tsx
|
|
26133
26371
|
var import_react166 = require("react");
|
|
26134
|
-
var
|
|
26135
|
-
var
|
|
26372
|
+
var import_developer_studio_api52 = require("@livechat/developer-studio-api");
|
|
26373
|
+
var import_developer_studio_ui_react72 = require("@livechat/developer-studio-ui-react");
|
|
26136
26374
|
var import_jsx_runtime152 = require("react/jsx-runtime");
|
|
26137
26375
|
var NeonAction = (props) => {
|
|
26138
26376
|
var _a;
|
|
26139
26377
|
const { login } = (0, import_react166.useContext)(AuthContext);
|
|
26140
|
-
const match2 = (0,
|
|
26378
|
+
const match2 = (0, import_developer_studio_ui_react72.useMatch)();
|
|
26141
26379
|
const action = (_a = props.action) != null ? _a : match2.params.action;
|
|
26142
26380
|
if (!action) {
|
|
26143
26381
|
throw new Error("Invalid action");
|
|
@@ -26145,7 +26383,7 @@ var NeonAction = (props) => {
|
|
|
26145
26383
|
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
26146
26384
|
IntegrationAction_default,
|
|
26147
26385
|
{
|
|
26148
|
-
name:
|
|
26386
|
+
name: import_developer_studio_api52.IntegrationNames.Neon,
|
|
26149
26387
|
action,
|
|
26150
26388
|
data: props.data,
|
|
26151
26389
|
context: props.context,
|
|
@@ -26153,7 +26391,7 @@ var NeonAction = (props) => {
|
|
|
26153
26391
|
serializedContext: match2.params.context,
|
|
26154
26392
|
executor: props.executor,
|
|
26155
26393
|
trigger: {
|
|
26156
|
-
mode:
|
|
26394
|
+
mode: import_developer_studio_api52.IntegrationModes.Modal,
|
|
26157
26395
|
handler: (output) => {
|
|
26158
26396
|
var _a2;
|
|
26159
26397
|
return neonActionHandlers(login, (_a2 = props.data) == null ? void 0 : _a2.setIsActionLoading)[action](output);
|
|
@@ -26169,7 +26407,7 @@ var neonActionHandlers = (login, setIsActionLoading) => {
|
|
|
26169
26407
|
setIsActionLoading == null ? void 0 : setIsActionLoading(false);
|
|
26170
26408
|
if (output.status === "success" && output.result.token) {
|
|
26171
26409
|
login({
|
|
26172
|
-
source:
|
|
26410
|
+
source: import_developer_studio_api52.IntegrationNames.Neon,
|
|
26173
26411
|
data: { token: output.result.token }
|
|
26174
26412
|
});
|
|
26175
26413
|
return {
|
|
@@ -26188,11 +26426,11 @@ var Action_default7 = NeonAction;
|
|
|
26188
26426
|
|
|
26189
26427
|
// src/views/Settings/Integrations/Neon/Callback.tsx
|
|
26190
26428
|
var import_react167 = require("react");
|
|
26191
|
-
var
|
|
26429
|
+
var import_developer_studio_ui_react73 = require("@livechat/developer-studio-ui-react");
|
|
26192
26430
|
var import_jsx_runtime153 = require("react/jsx-runtime");
|
|
26193
26431
|
var NeonCallback = () => {
|
|
26194
26432
|
const { login } = (0, import_react167.useContext)(AuthContext);
|
|
26195
|
-
const match2 = (0,
|
|
26433
|
+
const match2 = (0, import_developer_studio_ui_react73.useMatch)();
|
|
26196
26434
|
const action = match2.params.action;
|
|
26197
26435
|
if (!action) {
|
|
26198
26436
|
throw new Error("Invalid action");
|
|
@@ -26210,15 +26448,15 @@ var Callback_default6 = NeonCallback;
|
|
|
26210
26448
|
var import_react171 = require("react");
|
|
26211
26449
|
var import_design_system_icons52 = require("@livechat/design-system-icons");
|
|
26212
26450
|
var import_design_system_react_components98 = require("@livechat/design-system-react-components");
|
|
26213
|
-
var
|
|
26214
|
-
var
|
|
26451
|
+
var import_developer_studio_api57 = require("@livechat/developer-studio-api");
|
|
26452
|
+
var import_developer_studio_ui_react74 = require("@livechat/developer-studio-ui-react");
|
|
26215
26453
|
|
|
26216
26454
|
// src/hooks/integrations/neon/credentials.ts
|
|
26217
|
-
var
|
|
26455
|
+
var import_developer_studio_api53 = require("@livechat/developer-studio-api");
|
|
26218
26456
|
var useFetchNeonCredentials = () => {
|
|
26219
26457
|
var _a, _b;
|
|
26220
26458
|
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
26221
|
-
|
|
26459
|
+
import_developer_studio_api53.IntegrationNames.Neon
|
|
26222
26460
|
);
|
|
26223
26461
|
const oauthCredential = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
26224
26462
|
(credential) => credential.type === "oauth2" && credential.data.client_id === getWorkflowEnv("neonClientId")
|
|
@@ -26236,18 +26474,18 @@ var useFetchNeonCredentials = () => {
|
|
|
26236
26474
|
|
|
26237
26475
|
// src/hooks/integrations/neon/databases.ts
|
|
26238
26476
|
var import_react168 = require("react");
|
|
26239
|
-
var
|
|
26240
|
-
var
|
|
26477
|
+
var import_react_query12 = require("@tanstack/react-query");
|
|
26478
|
+
var import_developer_studio_api54 = require("@livechat/developer-studio-api");
|
|
26241
26479
|
|
|
26242
26480
|
// src/hooks/integrations/neon/projects.ts
|
|
26243
26481
|
var import_react169 = require("react");
|
|
26244
|
-
var
|
|
26245
|
-
var
|
|
26482
|
+
var import_react_query13 = require("@tanstack/react-query");
|
|
26483
|
+
var import_developer_studio_api55 = require("@livechat/developer-studio-api");
|
|
26246
26484
|
|
|
26247
26485
|
// src/hooks/integrations/neon/user.ts
|
|
26248
26486
|
var import_react170 = require("react");
|
|
26249
|
-
var
|
|
26250
|
-
var
|
|
26487
|
+
var import_react_query14 = require("@tanstack/react-query");
|
|
26488
|
+
var import_developer_studio_api56 = require("@livechat/developer-studio-api");
|
|
26251
26489
|
|
|
26252
26490
|
// src/views/Settings/Integrations/Neon/Status.tsx
|
|
26253
26491
|
var NeonStatus = () => {
|
|
@@ -26292,11 +26530,11 @@ var NeonStatus = () => {
|
|
|
26292
26530
|
return /* @__PURE__ */ jsxs2(
|
|
26293
26531
|
IntegrationStatus_default,
|
|
26294
26532
|
{
|
|
26295
|
-
title:
|
|
26296
|
-
subtitle: `${
|
|
26297
|
-
header: `${
|
|
26533
|
+
title: import_developer_studio_api57.IntegrationDisplayNames.Neon,
|
|
26534
|
+
subtitle: `${import_developer_studio_api57.IntegrationDisplayNames.Neon} integration`,
|
|
26535
|
+
header: `${import_developer_studio_api57.IntegrationDisplayNames.Neon} integration`,
|
|
26298
26536
|
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.",
|
|
26299
|
-
icon: /* @__PURE__ */ jsx4(
|
|
26537
|
+
icon: /* @__PURE__ */ jsx4(import_developer_studio_ui_react74.Neon, {}),
|
|
26300
26538
|
dataCy: "neon-integration-component",
|
|
26301
26539
|
children: [
|
|
26302
26540
|
/* @__PURE__ */ jsx4(
|
|
@@ -26305,7 +26543,7 @@ var NeonStatus = () => {
|
|
|
26305
26543
|
title: "Text Platform | Developer Console",
|
|
26306
26544
|
isConnected: Boolean(oauthCredential == null ? void 0 : oauthCredential.data.connected),
|
|
26307
26545
|
isLoading: credentialsQuery.isFetching,
|
|
26308
|
-
icon: /* @__PURE__ */ jsx4(
|
|
26546
|
+
icon: /* @__PURE__ */ jsx4(import_developer_studio_ui_react74.Neon, {}),
|
|
26309
26547
|
action: !credentialsQuery.isFetching ? /* @__PURE__ */ jsx4(Connect, { credential: oauthCredential }) : void 0,
|
|
26310
26548
|
status: !credentialsQuery.isFetching && (oauthCredential == null ? void 0 : oauthCredential.name) ? /* @__PURE__ */ jsx4(
|
|
26311
26549
|
import_design_system_react_components98.Button,
|
|
@@ -26352,8 +26590,8 @@ var import_react_router_dom40 = require("react-router-dom");
|
|
|
26352
26590
|
|
|
26353
26591
|
// src/views/Settings/Integrations/Netlify/Action.tsx
|
|
26354
26592
|
var import_react172 = require("react");
|
|
26355
|
-
var
|
|
26356
|
-
var
|
|
26593
|
+
var import_developer_studio_api58 = require("@livechat/developer-studio-api");
|
|
26594
|
+
var import_developer_studio_ui_react75 = require("@livechat/developer-studio-ui-react");
|
|
26357
26595
|
|
|
26358
26596
|
// src/utils/amplitude/journeys/application/blocks/deployment.ts
|
|
26359
26597
|
var appDeploymentBlockAmplitudeJourneyFactory = (email) => ({
|
|
@@ -26473,10 +26711,10 @@ var import_jsx_runtime156 = require("react/jsx-runtime");
|
|
|
26473
26711
|
var NetlifyAction = (props) => {
|
|
26474
26712
|
var _a;
|
|
26475
26713
|
const { login } = (0, import_react172.useContext)(AuthContext);
|
|
26476
|
-
const match2 = (0,
|
|
26714
|
+
const match2 = (0, import_developer_studio_ui_react75.useMatch)();
|
|
26477
26715
|
const {
|
|
26478
26716
|
userData: { user }
|
|
26479
|
-
} = (0,
|
|
26717
|
+
} = (0, import_developer_studio_ui_react75.useRootContext)();
|
|
26480
26718
|
const action = (_a = props.action) != null ? _a : match2.params.action;
|
|
26481
26719
|
if (!action) {
|
|
26482
26720
|
throw new Error("Invalid action");
|
|
@@ -26484,7 +26722,7 @@ var NetlifyAction = (props) => {
|
|
|
26484
26722
|
return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
26485
26723
|
IntegrationAction_default,
|
|
26486
26724
|
{
|
|
26487
|
-
name:
|
|
26725
|
+
name: import_developer_studio_api58.IntegrationNames.Netlify,
|
|
26488
26726
|
action,
|
|
26489
26727
|
data: props.data,
|
|
26490
26728
|
context: props.context,
|
|
@@ -26492,7 +26730,7 @@ var NetlifyAction = (props) => {
|
|
|
26492
26730
|
serializedContext: match2.params.context,
|
|
26493
26731
|
executor: props.executor,
|
|
26494
26732
|
trigger: {
|
|
26495
|
-
mode:
|
|
26733
|
+
mode: import_developer_studio_api58.IntegrationModes.Modal,
|
|
26496
26734
|
handler: (output) => netlifyActionHandlers(login, user == null ? void 0 : user.meta.email)[action](output)
|
|
26497
26735
|
},
|
|
26498
26736
|
onSuccess: props.onSuccess
|
|
@@ -26502,9 +26740,9 @@ var NetlifyAction = (props) => {
|
|
|
26502
26740
|
function triggerNetlifyAction(props, meta) {
|
|
26503
26741
|
return executeIntegrationAction(
|
|
26504
26742
|
__spreadProps(__spreadValues({}, props), {
|
|
26505
|
-
name:
|
|
26743
|
+
name: import_developer_studio_api58.IntegrationNames.Netlify,
|
|
26506
26744
|
trigger: {
|
|
26507
|
-
mode:
|
|
26745
|
+
mode: import_developer_studio_api58.IntegrationModes.Modal,
|
|
26508
26746
|
handler: (output) => netlifyActionHandlers(
|
|
26509
26747
|
meta.login,
|
|
26510
26748
|
meta.user.meta.email
|
|
@@ -26520,10 +26758,10 @@ var netlifyActionHandlers = (login, email) => {
|
|
|
26520
26758
|
authorize: (output) => {
|
|
26521
26759
|
if (output.status === "success" && output.result.token) {
|
|
26522
26760
|
amplitudeDeploymentJourney.app.deployment.actions.authorize.success(
|
|
26523
|
-
|
|
26761
|
+
import_developer_studio_api58.IntegrationNames.Netlify
|
|
26524
26762
|
);
|
|
26525
26763
|
login({
|
|
26526
|
-
source:
|
|
26764
|
+
source: import_developer_studio_api58.IntegrationNames.Netlify,
|
|
26527
26765
|
data: { token: output.result.token }
|
|
26528
26766
|
});
|
|
26529
26767
|
return {
|
|
@@ -26544,7 +26782,7 @@ var netlifyActionHandlers = (login, email) => {
|
|
|
26544
26782
|
install: (output) => {
|
|
26545
26783
|
if (output.status === "success" && output.result.installationId) {
|
|
26546
26784
|
amplitudeDeploymentJourney.app.deployment.actions.install.success(
|
|
26547
|
-
|
|
26785
|
+
import_developer_studio_api58.IntegrationNames.Netlify
|
|
26548
26786
|
);
|
|
26549
26787
|
return {
|
|
26550
26788
|
isValid: true,
|
|
@@ -26563,15 +26801,15 @@ var Action_default8 = NetlifyAction;
|
|
|
26563
26801
|
|
|
26564
26802
|
// src/views/Settings/Integrations/Netlify/Callback.tsx
|
|
26565
26803
|
var import_react173 = require("react");
|
|
26566
|
-
var
|
|
26804
|
+
var import_developer_studio_ui_react76 = require("@livechat/developer-studio-ui-react");
|
|
26567
26805
|
var import_jsx_runtime157 = require("react/jsx-runtime");
|
|
26568
26806
|
var NetlifyCallback = () => {
|
|
26569
|
-
const match2 = (0,
|
|
26807
|
+
const match2 = (0, import_developer_studio_ui_react76.useMatch)();
|
|
26570
26808
|
const { login } = (0, import_react173.useContext)(AuthContext);
|
|
26571
26809
|
const action = match2.params.action;
|
|
26572
26810
|
const {
|
|
26573
26811
|
userData: { user }
|
|
26574
|
-
} = (0,
|
|
26812
|
+
} = (0, import_developer_studio_ui_react76.useRootContext)();
|
|
26575
26813
|
if (!action) {
|
|
26576
26814
|
throw new Error("Invalid action");
|
|
26577
26815
|
}
|
|
@@ -26589,14 +26827,14 @@ var import_react175 = require("react");
|
|
|
26589
26827
|
var import_design_system_icons53 = require("@livechat/design-system-icons");
|
|
26590
26828
|
var import_design_system_react_components99 = require("@livechat/design-system-react-components");
|
|
26591
26829
|
var import_developer_studio_api62 = require("@livechat/developer-studio-api");
|
|
26592
|
-
var
|
|
26830
|
+
var import_developer_studio_ui_react77 = require("@livechat/developer-studio-ui-react");
|
|
26593
26831
|
|
|
26594
26832
|
// src/hooks/integrations/netlify/credentials.ts
|
|
26595
|
-
var
|
|
26833
|
+
var import_developer_studio_api59 = require("@livechat/developer-studio-api");
|
|
26596
26834
|
var useFetchNetlifyCredentials = () => {
|
|
26597
26835
|
var _a, _b;
|
|
26598
26836
|
const credentialsQuery = useFetchIntegrationCredentialsQuery(
|
|
26599
|
-
|
|
26837
|
+
import_developer_studio_api59.IntegrationNames.Netlify
|
|
26600
26838
|
);
|
|
26601
26839
|
const oauthCredential = (_a = credentialsQuery.data) == null ? void 0 : _a.find(
|
|
26602
26840
|
(credential) => credential.type === "oauth2" && credential.data.client_id === getWorkflowEnv("netlifyClientId")
|
|
@@ -26614,21 +26852,21 @@ var useFetchNetlifyCredentials = () => {
|
|
|
26614
26852
|
|
|
26615
26853
|
// src/hooks/integrations/netlify/site.ts
|
|
26616
26854
|
var import_react174 = require("react");
|
|
26617
|
-
var
|
|
26618
|
-
var
|
|
26855
|
+
var import_react_query15 = require("@tanstack/react-query");
|
|
26856
|
+
var import_developer_studio_api60 = require("@livechat/developer-studio-api");
|
|
26619
26857
|
var netlifyDeploymentQueryKeys = {
|
|
26620
26858
|
getSites: ["netlify.getSites"]
|
|
26621
26859
|
};
|
|
26622
26860
|
var useFetchNetlifySitesQuery = (isAuthorized) => {
|
|
26623
26861
|
const { logout } = (0, import_react174.useContext)(AuthContext);
|
|
26624
|
-
return (0,
|
|
26862
|
+
return (0, import_react_query15.useQuery)(
|
|
26625
26863
|
netlifyDeploymentQueryKeys.getSites,
|
|
26626
|
-
() =>
|
|
26864
|
+
() => import_developer_studio_api60.api.integrations.netlify.site.getSites(),
|
|
26627
26865
|
{
|
|
26628
26866
|
retry: false,
|
|
26629
26867
|
onError: (error) => {
|
|
26630
|
-
if (error instanceof
|
|
26631
|
-
logout(
|
|
26868
|
+
if (error instanceof import_developer_studio_api60.UnauthorizeApiError) {
|
|
26869
|
+
logout(import_developer_studio_api60.IntegrationNames.Netlify);
|
|
26632
26870
|
}
|
|
26633
26871
|
},
|
|
26634
26872
|
enabled: isAuthorized
|
|
@@ -26637,39 +26875,11 @@ var useFetchNetlifySitesQuery = (isAuthorized) => {
|
|
|
26637
26875
|
};
|
|
26638
26876
|
|
|
26639
26877
|
// src/hooks/state/user/integrations/netlify.ts
|
|
26640
|
-
var
|
|
26878
|
+
var import_react_query16 = require("@tanstack/react-query");
|
|
26641
26879
|
var import_developer_studio_api61 = require("@livechat/developer-studio-api");
|
|
26642
|
-
|
|
26643
|
-
// src/hooks/user.ts
|
|
26644
|
-
var import_react_query14 = require("@tanstack/react-query");
|
|
26645
|
-
var import_developer_studio_api60 = require("@livechat/developer-studio-api");
|
|
26646
|
-
var userQueryKeys = {
|
|
26647
|
-
dps: {
|
|
26648
|
-
getUser: ["dps.getUser"],
|
|
26649
|
-
getUserIntegrations: ["dps.getUserIntegrations"]
|
|
26650
|
-
},
|
|
26651
|
-
livechat: {
|
|
26652
|
-
agent: {
|
|
26653
|
-
getUser: ["livechat.agent.getUser"]
|
|
26654
|
-
}
|
|
26655
|
-
},
|
|
26656
|
-
accounts: {
|
|
26657
|
-
account: {
|
|
26658
|
-
getInfo: ["accounts.account.getInfo"]
|
|
26659
|
-
}
|
|
26660
|
-
}
|
|
26661
|
-
};
|
|
26662
|
-
var useFetchUserIntegrationsQuery = () => {
|
|
26663
|
-
return (0, import_react_query14.useQuery)(
|
|
26664
|
-
userQueryKeys.dps.getUserIntegrations,
|
|
26665
|
-
() => import_developer_studio_api60.api.platform.dps.user.getUserIntegrations()
|
|
26666
|
-
);
|
|
26667
|
-
};
|
|
26668
|
-
|
|
26669
|
-
// src/hooks/state/user/integrations/netlify.ts
|
|
26670
26880
|
var useUpdateUserNetlifyIntegrationQuery = () => {
|
|
26671
|
-
const queryClient = (0,
|
|
26672
|
-
const { mutateAsync: updateUserNetlifyIntegration, isLoading } = (0,
|
|
26881
|
+
const queryClient = (0, import_react_query16.useQueryClient)();
|
|
26882
|
+
const { mutateAsync: updateUserNetlifyIntegration, isLoading } = (0, import_react_query16.useMutation)(
|
|
26673
26883
|
(userNetlifyIntegration) => import_developer_studio_api61.api.platform.dps.user.updateUserNetlifyIntegration(
|
|
26674
26884
|
userNetlifyIntegration
|
|
26675
26885
|
),
|
|
@@ -26709,9 +26919,9 @@ var NetlifyStatus = () => {
|
|
|
26709
26919
|
var _a, _b, _c, _d;
|
|
26710
26920
|
const {
|
|
26711
26921
|
userData: { user }
|
|
26712
|
-
} = (0,
|
|
26922
|
+
} = (0, import_developer_studio_ui_react77.useRootContext)();
|
|
26713
26923
|
const { state, login } = (0, import_react175.useContext)(AuthContext);
|
|
26714
|
-
const { context: notifications } = (0,
|
|
26924
|
+
const { context: notifications } = (0, import_developer_studio_ui_react77.useNotifications)();
|
|
26715
26925
|
const userIntegrationsQuery = useFetchUserIntegrationsQuery();
|
|
26716
26926
|
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
26717
26927
|
const credentialsQuery = useFetchNetlifyCredentials();
|
|
@@ -26911,7 +27121,7 @@ var NetlifyStatus = () => {
|
|
|
26911
27121
|
subtitle: `${import_developer_studio_api62.IntegrationDisplayNames.Netlify} integration`,
|
|
26912
27122
|
header: `${import_developer_studio_api62.IntegrationDisplayNames.Netlify} integration`,
|
|
26913
27123
|
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.",
|
|
26914
|
-
icon: /* @__PURE__ */ jsx4(
|
|
27124
|
+
icon: /* @__PURE__ */ jsx4(import_developer_studio_ui_react77.Netlify, {}),
|
|
26915
27125
|
dataCy: "netlify-integration-component",
|
|
26916
27126
|
children: [
|
|
26917
27127
|
/* @__PURE__ */ jsx4(
|
|
@@ -26920,8 +27130,8 @@ var NetlifyStatus = () => {
|
|
|
26920
27130
|
title: "Text Platform | Developer Console",
|
|
26921
27131
|
isConnected: Boolean(oauthCredential == null ? void 0 : oauthCredential.data.connected),
|
|
26922
27132
|
isLoading: credentialsQuery.isFetching,
|
|
26923
|
-
icon: /* @__PURE__ */ jsx4(
|
|
26924
|
-
action: !(oauthCredential == null ? void 0 : oauthCredential.data.connected) && !credentialsQuery.isFetching ? /* @__PURE__ */ jsx4(Connect, {}) : !credentialsQuery.isFetching ? /* @__PURE__ */ jsxs2(
|
|
27133
|
+
icon: /* @__PURE__ */ jsx4(import_developer_studio_ui_react77.Netlify, {}),
|
|
27134
|
+
action: !(oauthCredential == null ? void 0 : oauthCredential.data.connected) && !credentialsQuery.isFetching ? /* @__PURE__ */ jsx4(Connect, {}) : !credentialsQuery.isFetching ? /* @__PURE__ */ jsxs2(import_developer_studio_ui_react77.Row, { notPadded: true, flexEnd: true, gap: `var(${import_design_system_react_components99.SpacingToken.Spacing2})`, children: [
|
|
26925
27135
|
!userIntegrationsQuery.isFetching && !isInstalled ? /* @__PURE__ */ jsx4(Install, {}) : void 0,
|
|
26926
27136
|
/* @__PURE__ */ jsx4(
|
|
26927
27137
|
import_design_system_react_components99.ActionMenu,
|
|
@@ -26969,7 +27179,7 @@ var NetlifyStatus = () => {
|
|
|
26969
27179
|
] }) : void 0
|
|
26970
27180
|
}
|
|
26971
27181
|
),
|
|
26972
|
-
oauthCredential && isInstalled && !sitesQuery.isFetching && !doesNetlifySiteHasInstallID ? /* @__PURE__ */ jsx4(
|
|
27182
|
+
oauthCredential && isInstalled && !sitesQuery.isFetching && !doesNetlifySiteHasInstallID ? /* @__PURE__ */ jsx4(import_developer_studio_ui_react77.Row, { setRowPadding: "8px 0 0 26px", children: /* @__PURE__ */ jsxs2("p", { css: notFoundInfoCss, children: [
|
|
26973
27183
|
"In case of GitHub Installation page returns 404,",
|
|
26974
27184
|
" ",
|
|
26975
27185
|
/* @__PURE__ */ jsx4(
|
|
@@ -27018,11 +27228,11 @@ var import_react_router_dom41 = require("react-router-dom");
|
|
|
27018
27228
|
|
|
27019
27229
|
// src/views/Settings/Integrations/Shopify/Callback.tsx
|
|
27020
27230
|
var import_react177 = require("react");
|
|
27021
|
-
var
|
|
27231
|
+
var import_developer_studio_ui_react78 = require("@livechat/developer-studio-ui-react");
|
|
27022
27232
|
var import_jsx_runtime160 = require("react/jsx-runtime");
|
|
27023
27233
|
var ShopifyCallback = () => {
|
|
27024
27234
|
const { login } = (0, import_react177.useContext)(AuthContext);
|
|
27025
|
-
const match2 = (0,
|
|
27235
|
+
const match2 = (0, import_developer_studio_ui_react78.useMatch)();
|
|
27026
27236
|
const action = match2.params.action;
|
|
27027
27237
|
if (!action) {
|
|
27028
27238
|
throw new Error("Invalid action");
|
|
@@ -27042,14 +27252,14 @@ var import_design_system4 = require("@livechat/design-system");
|
|
|
27042
27252
|
var import_design_system_icons54 = require("@livechat/design-system-icons");
|
|
27043
27253
|
var import_design_system_react_components100 = require("@livechat/design-system-react-components");
|
|
27044
27254
|
var import_developer_studio_api63 = require("@livechat/developer-studio-api");
|
|
27045
|
-
var
|
|
27255
|
+
var import_developer_studio_ui_react79 = require("@livechat/developer-studio-ui-react");
|
|
27046
27256
|
var ShopifyStatus = () => {
|
|
27047
27257
|
var _a;
|
|
27048
27258
|
const {
|
|
27049
27259
|
userData: { user }
|
|
27050
|
-
} = (0,
|
|
27260
|
+
} = (0, import_developer_studio_ui_react79.useRootContext)();
|
|
27051
27261
|
const { login } = (0, import_react178.useContext)(AuthContext);
|
|
27052
|
-
const { context: notifications } = (0,
|
|
27262
|
+
const { context: notifications } = (0, import_developer_studio_ui_react79.useNotifications)();
|
|
27053
27263
|
const credentialsQuery = useFetchShopifyCredentials();
|
|
27054
27264
|
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
27055
27265
|
const [state, setState] = (0, import_react178.useState)();
|
|
@@ -27276,12 +27486,12 @@ var import_react_router_dom42 = require("react-router-dom");
|
|
|
27276
27486
|
// src/views/Settings/Integrations/Text/Action.tsx
|
|
27277
27487
|
var import_react179 = require("react");
|
|
27278
27488
|
var import_developer_studio_api64 = require("@livechat/developer-studio-api");
|
|
27279
|
-
var
|
|
27489
|
+
var import_developer_studio_ui_react80 = require("@livechat/developer-studio-ui-react");
|
|
27280
27490
|
var import_jsx_runtime163 = require("react/jsx-runtime");
|
|
27281
27491
|
var TextAction = (props) => {
|
|
27282
27492
|
var _a;
|
|
27283
27493
|
const { login } = (0, import_react179.useContext)(AuthContext);
|
|
27284
|
-
const match2 = (0,
|
|
27494
|
+
const match2 = (0, import_developer_studio_ui_react80.useMatch)();
|
|
27285
27495
|
const action = (_a = props.action) != null ? _a : match2.params.action;
|
|
27286
27496
|
if (!action) {
|
|
27287
27497
|
throw new Error("Invalid action");
|
|
@@ -27328,11 +27538,11 @@ var Action_default9 = TextAction;
|
|
|
27328
27538
|
|
|
27329
27539
|
// src/views/Settings/Integrations/Text/Callback.tsx
|
|
27330
27540
|
var import_react180 = require("react");
|
|
27331
|
-
var
|
|
27541
|
+
var import_developer_studio_ui_react81 = require("@livechat/developer-studio-ui-react");
|
|
27332
27542
|
var import_jsx_runtime164 = require("react/jsx-runtime");
|
|
27333
27543
|
var TextCallback = () => {
|
|
27334
27544
|
const { login } = (0, import_react180.useContext)(AuthContext);
|
|
27335
|
-
const match2 = (0,
|
|
27545
|
+
const match2 = (0, import_developer_studio_ui_react81.useMatch)();
|
|
27336
27546
|
const action = match2.params.action;
|
|
27337
27547
|
if (!action) {
|
|
27338
27548
|
throw new Error("Invalid action");
|
|
@@ -27350,11 +27560,11 @@ var Callback_default9 = TextCallback;
|
|
|
27350
27560
|
var import_react181 = require("react");
|
|
27351
27561
|
var import_design_system_react_components101 = require("@livechat/design-system-react-components");
|
|
27352
27562
|
var import_developer_studio_api65 = require("@livechat/developer-studio-api");
|
|
27353
|
-
var
|
|
27563
|
+
var import_developer_studio_ui_react82 = require("@livechat/developer-studio-ui-react");
|
|
27354
27564
|
var TextStatus = () => {
|
|
27355
27565
|
const {
|
|
27356
27566
|
userData: { user }
|
|
27357
|
-
} = (0,
|
|
27567
|
+
} = (0, import_developer_studio_ui_react82.useRootContext)();
|
|
27358
27568
|
const credentialsQuery = useFetchTextCredentials();
|
|
27359
27569
|
const isInstalledQuery = useFetchUserInstalledTextIntegration(user);
|
|
27360
27570
|
const refetch = (0, import_react181.useCallback)(() => {
|
|
@@ -27401,7 +27611,7 @@ var TextStatus = () => {
|
|
|
27401
27611
|
subtitle: `${import_developer_studio_api65.IntegrationDisplayNames.Text} integration`,
|
|
27402
27612
|
header: `${import_developer_studio_api65.IntegrationDisplayNames.Text} integration`,
|
|
27403
27613
|
description: "",
|
|
27404
|
-
icon: /* @__PURE__ */ jsx4(
|
|
27614
|
+
icon: /* @__PURE__ */ jsx4(import_developer_studio_ui_react82.Logo, {}),
|
|
27405
27615
|
dataCy: "text-integration-component",
|
|
27406
27616
|
children: [
|
|
27407
27617
|
/* @__PURE__ */ jsx4(
|
|
@@ -27410,7 +27620,7 @@ var TextStatus = () => {
|
|
|
27410
27620
|
title: "Text Platform | Developer Console",
|
|
27411
27621
|
isConnected: Boolean(authCredential),
|
|
27412
27622
|
isLoading: credentialsQuery.isFetching,
|
|
27413
|
-
icon: /* @__PURE__ */ jsx4(
|
|
27623
|
+
icon: /* @__PURE__ */ jsx4(import_developer_studio_ui_react82.Logo, {}),
|
|
27414
27624
|
status: !credentialsQuery.isFetching && (authCredential == null ? void 0 : authCredential.name) ? /* @__PURE__ */ jsx4(import_react181.Fragment, { children: !isInstalledQuery.isFetching ? getConnectionStatus(isInstalledQuery.data, "install") : void 0 }) : void 0
|
|
27415
27625
|
}
|
|
27416
27626
|
),
|
|
@@ -27445,15 +27655,15 @@ var import_react_router_dom43 = require("react-router-dom");
|
|
|
27445
27655
|
// src/views/Settings/Integrations/Vercel/Action.tsx
|
|
27446
27656
|
var import_react182 = require("react");
|
|
27447
27657
|
var import_developer_studio_api66 = require("@livechat/developer-studio-api");
|
|
27448
|
-
var
|
|
27658
|
+
var import_developer_studio_ui_react83 = require("@livechat/developer-studio-ui-react");
|
|
27449
27659
|
var import_jsx_runtime167 = require("react/jsx-runtime");
|
|
27450
27660
|
var VercelAction = (props) => {
|
|
27451
27661
|
var _a;
|
|
27452
27662
|
const {
|
|
27453
27663
|
userData: { user }
|
|
27454
|
-
} = (0,
|
|
27664
|
+
} = (0, import_developer_studio_ui_react83.useRootContext)();
|
|
27455
27665
|
const { login } = (0, import_react182.useContext)(AuthContext);
|
|
27456
|
-
const match2 = (0,
|
|
27666
|
+
const match2 = (0, import_developer_studio_ui_react83.useMatch)();
|
|
27457
27667
|
const action = (_a = props.action) != null ? _a : match2.params.action;
|
|
27458
27668
|
if (!action) {
|
|
27459
27669
|
throw new Error("Invalid action");
|
|
@@ -27544,15 +27754,15 @@ var Action_default10 = VercelAction;
|
|
|
27544
27754
|
|
|
27545
27755
|
// src/views/Settings/Integrations/Vercel/Callback.tsx
|
|
27546
27756
|
var import_react183 = require("react");
|
|
27547
|
-
var
|
|
27757
|
+
var import_developer_studio_ui_react84 = require("@livechat/developer-studio-ui-react");
|
|
27548
27758
|
var import_jsx_runtime168 = require("react/jsx-runtime");
|
|
27549
27759
|
var VercelCallback = () => {
|
|
27550
27760
|
const { login } = (0, import_react183.useContext)(AuthContext);
|
|
27551
|
-
const match2 = (0,
|
|
27761
|
+
const match2 = (0, import_developer_studio_ui_react84.useMatch)();
|
|
27552
27762
|
const action = match2.params.action;
|
|
27553
27763
|
const {
|
|
27554
27764
|
userData: { user }
|
|
27555
|
-
} = (0,
|
|
27765
|
+
} = (0, import_developer_studio_ui_react84.useRootContext)();
|
|
27556
27766
|
if (!action) {
|
|
27557
27767
|
throw new Error("Invalid action");
|
|
27558
27768
|
}
|
|
@@ -27570,7 +27780,7 @@ var import_react184 = require("react");
|
|
|
27570
27780
|
var import_design_system_icons55 = require("@livechat/design-system-icons");
|
|
27571
27781
|
var import_design_system_react_components102 = require("@livechat/design-system-react-components");
|
|
27572
27782
|
var import_developer_studio_api69 = require("@livechat/developer-studio-api");
|
|
27573
|
-
var
|
|
27783
|
+
var import_developer_studio_ui_react85 = require("@livechat/developer-studio-ui-react");
|
|
27574
27784
|
|
|
27575
27785
|
// src/hooks/integrations/vercel/credentials.ts
|
|
27576
27786
|
var import_developer_studio_api67 = require("@livechat/developer-studio-api");
|
|
@@ -27594,13 +27804,13 @@ var useFetchVercelCredentials = () => {
|
|
|
27594
27804
|
};
|
|
27595
27805
|
|
|
27596
27806
|
// src/hooks/integrations/vercel/namespace.ts
|
|
27597
|
-
var
|
|
27807
|
+
var import_react_query17 = require("@tanstack/react-query");
|
|
27598
27808
|
var import_developer_studio_api68 = require("@livechat/developer-studio-api");
|
|
27599
27809
|
var vercelNamespacesQueryKeys = {
|
|
27600
27810
|
getInstallations: ["vercel.getNamespaces"]
|
|
27601
27811
|
};
|
|
27602
27812
|
var useFetchVercelNamespaces = (enabled) => {
|
|
27603
|
-
return (0,
|
|
27813
|
+
return (0, import_react_query17.useQuery)(
|
|
27604
27814
|
vercelNamespacesQueryKeys.getInstallations,
|
|
27605
27815
|
() => import_developer_studio_api68.api.integrations.vercel.integrations.getGitNamespaces(),
|
|
27606
27816
|
{
|
|
@@ -27615,9 +27825,9 @@ var VercelStatus = () => {
|
|
|
27615
27825
|
var _a, _b, _c;
|
|
27616
27826
|
const {
|
|
27617
27827
|
userData: { user }
|
|
27618
|
-
} = (0,
|
|
27828
|
+
} = (0, import_developer_studio_ui_react85.useRootContext)();
|
|
27619
27829
|
const { state, login } = (0, import_react184.useContext)(AuthContext);
|
|
27620
|
-
const { context: notifications } = (0,
|
|
27830
|
+
const { context: notifications } = (0, import_developer_studio_ui_react85.useNotifications)();
|
|
27621
27831
|
const removeCredentialMutation = useRemoveIntegrationCredential();
|
|
27622
27832
|
const credentialsQuery = useFetchVercelCredentials();
|
|
27623
27833
|
const namespacesQuery = useFetchVercelNamespaces(
|
|
@@ -27817,7 +28027,7 @@ var VercelStatus = () => {
|
|
|
27817
28027
|
subtitle: `${import_developer_studio_api69.IntegrationDisplayNames.Vercel} integration`,
|
|
27818
28028
|
header: `${import_developer_studio_api69.IntegrationDisplayNames.Vercel} integration`,
|
|
27819
28029
|
description: "Optimize your app deployment with Vercel to enjoy seamless integration, streamlined workflows, and easy collaboration, all without compromising on speed or quality.",
|
|
27820
|
-
icon: /* @__PURE__ */ jsx4(
|
|
28030
|
+
icon: /* @__PURE__ */ jsx4(import_developer_studio_ui_react85.Vercel, {}),
|
|
27821
28031
|
dataCy: "vercel-integration-component",
|
|
27822
28032
|
children: [
|
|
27823
28033
|
/* @__PURE__ */ jsx4(
|
|
@@ -27826,8 +28036,8 @@ var VercelStatus = () => {
|
|
|
27826
28036
|
title: "Text Platform | Developer Console",
|
|
27827
28037
|
isConnected: Boolean(oauthCredential == null ? void 0 : oauthCredential.data.connected),
|
|
27828
28038
|
isLoading: credentialsQuery.isFetching,
|
|
27829
|
-
icon: /* @__PURE__ */ jsx4(
|
|
27830
|
-
action: !(oauthCredential == null ? void 0 : oauthCredential.data.connected) && !credentialsQuery.isFetching ? /* @__PURE__ */ jsx4(Connect, {}) : !credentialsQuery.isFetching ? /* @__PURE__ */ jsxs2(
|
|
28039
|
+
icon: /* @__PURE__ */ jsx4(import_developer_studio_ui_react85.Vercel, {}),
|
|
28040
|
+
action: !(oauthCredential == null ? void 0 : oauthCredential.data.connected) && !credentialsQuery.isFetching ? /* @__PURE__ */ jsx4(Connect, {}) : !credentialsQuery.isFetching ? /* @__PURE__ */ jsxs2(import_developer_studio_ui_react85.Row, { notPadded: true, flexEnd: true, gap: `var(${import_design_system_react_components102.SpacingToken.Spacing2})`, children: [
|
|
27831
28041
|
!namespacesQuery.isFetching && !isInstalled ? /* @__PURE__ */ jsx4(Install, {}) : void 0,
|
|
27832
28042
|
/* @__PURE__ */ jsx4(
|
|
27833
28043
|
import_design_system_react_components102.ActionMenu,
|
|
@@ -27913,7 +28123,7 @@ function IntegrationsSubNavGroup() {
|
|
|
27913
28123
|
const navigate = (0, import_react_router_dom44.useNavigate)();
|
|
27914
28124
|
const {
|
|
27915
28125
|
userData: { user }
|
|
27916
|
-
} = (0,
|
|
28126
|
+
} = (0, import_developer_studio_ui_react86.useRootContext)();
|
|
27917
28127
|
const { data: userHasInstalledWorkflows } = useFetchUserInstalledWorkflows(user);
|
|
27918
28128
|
return /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(
|
|
27919
28129
|
import_design_system_react_components103.SideNavigationGroup,
|