@livechat/developer-studio-api 5.2.0-beta.v1 → 5.2.0-beta.v3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-NCXZIYUE.mjs +9808 -0
- package/dist/events-DluLBHoq.d.mts +13026 -0
- package/dist/events-DluLBHoq.d.ts +13026 -0
- package/dist/index.d.mts +463 -13480
- package/dist/index.d.ts +463 -13480
- package/dist/index.mjs +194 -9617
- package/dist/workflow-contracts.d.mts +5 -0
- package/dist/workflow-contracts.d.ts +5 -0
- package/dist/workflow-contracts.js +2274 -0
- package/dist/workflow-contracts.mjs +52 -0
- package/package.json +17 -3
|
@@ -0,0 +1,2274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __export = (target, all) => {
|
|
26
|
+
for (var name in all)
|
|
27
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
|
+
};
|
|
29
|
+
var __copyProps = (to, from, except, desc) => {
|
|
30
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
31
|
+
for (let key of __getOwnPropNames(from))
|
|
32
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
33
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
|
+
}
|
|
35
|
+
return to;
|
|
36
|
+
};
|
|
37
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
38
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
39
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
40
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
41
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
42
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
43
|
+
mod
|
|
44
|
+
));
|
|
45
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
46
|
+
var __async = (__this, __arguments, generator) => {
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
var fulfilled = (value) => {
|
|
49
|
+
try {
|
|
50
|
+
step(generator.next(value));
|
|
51
|
+
} catch (e) {
|
|
52
|
+
reject(e);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var rejected = (value) => {
|
|
56
|
+
try {
|
|
57
|
+
step(generator.throw(value));
|
|
58
|
+
} catch (e) {
|
|
59
|
+
reject(e);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
63
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// src/apis/integrations/text/platform/workflow/contracts.ts
|
|
68
|
+
var contracts_exports = {};
|
|
69
|
+
__export(contracts_exports, {
|
|
70
|
+
CredentialStatus: () => CredentialStatus,
|
|
71
|
+
CredentialType: () => CredentialType,
|
|
72
|
+
CredentialTypeDisplayNameMapping: () => CredentialTypeDisplayNameMapping,
|
|
73
|
+
OauthCredentialGrantType: () => OauthCredentialGrantType,
|
|
74
|
+
SortBy: () => SortBy,
|
|
75
|
+
SortOrder: () => SortOrder,
|
|
76
|
+
TRIGGER_REFERENCE_NAME: () => TRIGGER_REFERENCE_NAME,
|
|
77
|
+
WorkflowConditionTaskFieldType: () => WorkflowConditionTaskFieldType,
|
|
78
|
+
WorkflowConditionTaskLogic: () => WorkflowConditionTaskLogic,
|
|
79
|
+
WorkflowConditionTaskOperator: () => WorkflowConditionTaskOperator,
|
|
80
|
+
WorkflowConditionTaskOperatorGroup: () => WorkflowConditionTaskOperatorGroup,
|
|
81
|
+
WorkflowConditionTaskOperatorValueType: () => WorkflowConditionTaskOperatorValueType,
|
|
82
|
+
WorkflowCustomTaskName: () => WorkflowCustomTaskName,
|
|
83
|
+
WorkflowExecutionDefinitionStatus: () => WorkflowExecutionDefinitionStatus,
|
|
84
|
+
WorkflowExecutionStatus: () => WorkflowExecutionStatus,
|
|
85
|
+
WorkflowExecutionTaskStatus: () => WorkflowExecutionTaskStatus,
|
|
86
|
+
WorkflowItemKind: () => WorkflowItemKind,
|
|
87
|
+
WorkflowTaskType: () => WorkflowTaskType,
|
|
88
|
+
WorkflowTemplateCategory: () => WorkflowTemplateCategory,
|
|
89
|
+
WorkflowTriggerType: () => WorkflowTriggerType,
|
|
90
|
+
getWorkflowApiCrmConfig: () => getWorkflowApiCrmConfig,
|
|
91
|
+
isFilter: () => isFilter,
|
|
92
|
+
isFilterGroup: () => isFilterGroup,
|
|
93
|
+
serializeFilters: () => serializeFilters
|
|
94
|
+
});
|
|
95
|
+
module.exports = __toCommonJS(contracts_exports);
|
|
96
|
+
|
|
97
|
+
// src/apis/integrations/text/platform/workflow/_contracts/filters/helpers.ts
|
|
98
|
+
var isFilterGroup = (filter) => {
|
|
99
|
+
return "filters" in filter && "operator" in filter;
|
|
100
|
+
};
|
|
101
|
+
var isFilter = (filter) => {
|
|
102
|
+
return "field" in filter && "operator" in filter && "value" in filter;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// src/apis/integrations/text/platform/workflow/_contracts/filters/serialize.ts
|
|
106
|
+
var convertValueToString = (value) => {
|
|
107
|
+
if (typeof value === "string") {
|
|
108
|
+
return `"${value}"`;
|
|
109
|
+
}
|
|
110
|
+
if (value === null) {
|
|
111
|
+
return "null";
|
|
112
|
+
}
|
|
113
|
+
return value.toString();
|
|
114
|
+
};
|
|
115
|
+
var filterToString = (filter) => {
|
|
116
|
+
if (isFilterGroup(filter)) {
|
|
117
|
+
return `(${serializeFilters([filter])})`;
|
|
118
|
+
} else if (isFilter(filter)) {
|
|
119
|
+
return `${filter.field} ${filter.operator} ${convertValueToString(filter.value)}`;
|
|
120
|
+
}
|
|
121
|
+
return "";
|
|
122
|
+
};
|
|
123
|
+
var serializeFilters = (filters) => {
|
|
124
|
+
if (filters.length === 0) {
|
|
125
|
+
return "";
|
|
126
|
+
}
|
|
127
|
+
if (filters.length === 1 && filters[0] && isFilterGroup(filters[0])) {
|
|
128
|
+
const group = filters[0];
|
|
129
|
+
return group.filters.map(filterToString).filter(Boolean).join(` ${group.operator} `);
|
|
130
|
+
}
|
|
131
|
+
return filters.map(filterToString).filter(Boolean).join(" and ");
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// src/apis/integrations/text/platform/workflow/_contracts/sorting/types.ts
|
|
135
|
+
var SortOrder = {
|
|
136
|
+
Ascending: "asc",
|
|
137
|
+
Descending: "desc"
|
|
138
|
+
};
|
|
139
|
+
var SortBy = {
|
|
140
|
+
Name: "name",
|
|
141
|
+
CreatedOn: "created_at",
|
|
142
|
+
CreatedBy: "created_by",
|
|
143
|
+
Runs: "executions.completed",
|
|
144
|
+
Status: "active"
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// src/apis/integrations/text/platform/workflow/credentials/_contracts/dtos/credential.ts
|
|
148
|
+
var CredentialStatus = /* @__PURE__ */ ((CredentialStatus2) => {
|
|
149
|
+
CredentialStatus2["Connected"] = "connected";
|
|
150
|
+
CredentialStatus2["Disconnected"] = "disconnected";
|
|
151
|
+
CredentialStatus2["Stale"] = "stale";
|
|
152
|
+
return CredentialStatus2;
|
|
153
|
+
})(CredentialStatus || {});
|
|
154
|
+
var CredentialType = /* @__PURE__ */ ((CredentialType2) => {
|
|
155
|
+
CredentialType2["General"] = "general";
|
|
156
|
+
CredentialType2["ApiKey"] = "api_key";
|
|
157
|
+
CredentialType2["BasicAuth"] = "basic_auth";
|
|
158
|
+
CredentialType2["OAuth2"] = "oauth2";
|
|
159
|
+
CredentialType2["TextAuth"] = "text_auth";
|
|
160
|
+
return CredentialType2;
|
|
161
|
+
})(CredentialType || {});
|
|
162
|
+
var CredentialTypeDisplayNameMapping = {
|
|
163
|
+
["general" /* General */]: "General",
|
|
164
|
+
["api_key" /* ApiKey */]: "API Key",
|
|
165
|
+
["basic_auth" /* BasicAuth */]: "Basic Auth",
|
|
166
|
+
["oauth2" /* OAuth2 */]: "OAuth2",
|
|
167
|
+
["text_auth" /* TextAuth */]: "Text"
|
|
168
|
+
};
|
|
169
|
+
var OauthCredentialGrantType = /* @__PURE__ */ ((OauthCredentialGrantType2) => {
|
|
170
|
+
OauthCredentialGrantType2["AuthorizationCode"] = "authorization_code";
|
|
171
|
+
OauthCredentialGrantType2["Implicit"] = "implicit";
|
|
172
|
+
OauthCredentialGrantType2["PKCE"] = "pkce";
|
|
173
|
+
OauthCredentialGrantType2["ClientCredentials"] = "client_credentials";
|
|
174
|
+
return OauthCredentialGrantType2;
|
|
175
|
+
})(OauthCredentialGrantType || {});
|
|
176
|
+
|
|
177
|
+
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/tasks/base.ts
|
|
178
|
+
var WorkflowTaskType = {
|
|
179
|
+
http: "HTTP",
|
|
180
|
+
switch: "SWITCH",
|
|
181
|
+
forkJoin: "FORK_JOIN",
|
|
182
|
+
terminate: "TERMINATE",
|
|
183
|
+
join: "JOIN",
|
|
184
|
+
wait: "WAIT",
|
|
185
|
+
simple: "SIMPLE",
|
|
186
|
+
doWhile: "DO_WHILE",
|
|
187
|
+
inline: "INLINE",
|
|
188
|
+
transform: "JSON_JQ_TRANSFORM"
|
|
189
|
+
};
|
|
190
|
+
var WorkflowCustomTaskName = {
|
|
191
|
+
// SWITCH
|
|
192
|
+
condition: `${WorkflowTaskType.switch}_IF`,
|
|
193
|
+
switchCase: `${WorkflowTaskType.switch}_CASE`,
|
|
194
|
+
// SIMPLE
|
|
195
|
+
action: "action",
|
|
196
|
+
awaitAgent: "await",
|
|
197
|
+
notifyAgent: "notify_ai_agent",
|
|
198
|
+
reasoning: "reasoning",
|
|
199
|
+
// DO WHILE
|
|
200
|
+
loop: `${WorkflowTaskType.doWhile}_LOOP`,
|
|
201
|
+
forEach: `${WorkflowTaskType.doWhile}_FOR_EACH`,
|
|
202
|
+
// INLINE
|
|
203
|
+
script: `${WorkflowTaskType.inline}_SCRIPT`,
|
|
204
|
+
// JQ TRANSFORM
|
|
205
|
+
convert: `${WorkflowTaskType.transform}_CONVERT`,
|
|
206
|
+
construct: `${WorkflowTaskType.transform}_CONSTRUCT`
|
|
207
|
+
};
|
|
208
|
+
var WorkflowExecutionTaskStatus = /* @__PURE__ */ ((WorkflowExecutionTaskStatus2) => {
|
|
209
|
+
WorkflowExecutionTaskStatus2["Completed"] = "COMPLETED";
|
|
210
|
+
WorkflowExecutionTaskStatus2["CompletedWithError"] = "COMPLETED_WITH_ERRORS";
|
|
211
|
+
WorkflowExecutionTaskStatus2["Failed"] = "FAILED";
|
|
212
|
+
WorkflowExecutionTaskStatus2["FailedWithTerminalErrors"] = "FAILED_WITH_TERMINAL_ERROR";
|
|
213
|
+
WorkflowExecutionTaskStatus2["Scheduled"] = "SCHEDULED";
|
|
214
|
+
WorkflowExecutionTaskStatus2["TimedOut"] = "TIMED_OUT";
|
|
215
|
+
WorkflowExecutionTaskStatus2["InProgress"] = "IN_PROGRESS";
|
|
216
|
+
WorkflowExecutionTaskStatus2["Skipped"] = "SKIPPED";
|
|
217
|
+
WorkflowExecutionTaskStatus2["Canceled"] = "CANCELED";
|
|
218
|
+
WorkflowExecutionTaskStatus2["NotExecuted"] = "NOT_EXECUTED";
|
|
219
|
+
return WorkflowExecutionTaskStatus2;
|
|
220
|
+
})(WorkflowExecutionTaskStatus || {});
|
|
221
|
+
|
|
222
|
+
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/tasks/switch/variants/condition.ts
|
|
223
|
+
var WorkflowConditionTaskLogic = /* @__PURE__ */ ((WorkflowConditionTaskLogic2) => {
|
|
224
|
+
WorkflowConditionTaskLogic2["AND"] = "AND";
|
|
225
|
+
WorkflowConditionTaskLogic2["OR"] = "OR";
|
|
226
|
+
return WorkflowConditionTaskLogic2;
|
|
227
|
+
})(WorkflowConditionTaskLogic || {});
|
|
228
|
+
var WorkflowConditionTaskOperator = /* @__PURE__ */ ((WorkflowConditionTaskOperator2) => {
|
|
229
|
+
WorkflowConditionTaskOperator2["GeneralEmpty"] = "g_empty";
|
|
230
|
+
WorkflowConditionTaskOperator2["GeneralNotEmpty"] = "g_nempty";
|
|
231
|
+
WorkflowConditionTaskOperator2["NumberEqual"] = "n_eq";
|
|
232
|
+
WorkflowConditionTaskOperator2["NumberNotEqual"] = "n_neq";
|
|
233
|
+
WorkflowConditionTaskOperator2["NumberIn"] = "n_in";
|
|
234
|
+
WorkflowConditionTaskOperator2["NumberNotIn"] = "n_nin";
|
|
235
|
+
WorkflowConditionTaskOperator2["NumberGreaterThan"] = "n_gt";
|
|
236
|
+
WorkflowConditionTaskOperator2["NumberGreaterOrEqual"] = "n_gte";
|
|
237
|
+
WorkflowConditionTaskOperator2["NumberLessThan"] = "n_lt";
|
|
238
|
+
WorkflowConditionTaskOperator2["NumberLessOrEqual"] = "n_lte";
|
|
239
|
+
WorkflowConditionTaskOperator2["StringEqual"] = "s_eq";
|
|
240
|
+
WorkflowConditionTaskOperator2["StringNotEqual"] = "s_neq";
|
|
241
|
+
WorkflowConditionTaskOperator2["StringIn"] = "s_in";
|
|
242
|
+
WorkflowConditionTaskOperator2["StringNotIn"] = "s_nin";
|
|
243
|
+
WorkflowConditionTaskOperator2["StringContains"] = "s_contains";
|
|
244
|
+
WorkflowConditionTaskOperator2["StringNotContains"] = "s_not_contains";
|
|
245
|
+
WorkflowConditionTaskOperator2["StringStartsWith"] = "s_starts_with";
|
|
246
|
+
WorkflowConditionTaskOperator2["StringEndsWith"] = "s_ends_with";
|
|
247
|
+
WorkflowConditionTaskOperator2["StringRegex"] = "s_regex";
|
|
248
|
+
WorkflowConditionTaskOperator2["StringLengthEqual"] = "s_length_eq";
|
|
249
|
+
WorkflowConditionTaskOperator2["StringLengthGreaterThan"] = "s_length_gt";
|
|
250
|
+
WorkflowConditionTaskOperator2["StringLengthLessThan"] = "s_length_lt";
|
|
251
|
+
WorkflowConditionTaskOperator2["DateTimeEqual"] = "dt_eq";
|
|
252
|
+
WorkflowConditionTaskOperator2["DateTimeNotEqual"] = "dt_neq";
|
|
253
|
+
WorkflowConditionTaskOperator2["DateTimeBefore"] = "dt_before";
|
|
254
|
+
WorkflowConditionTaskOperator2["DateTimeAfter"] = "dt_after";
|
|
255
|
+
WorkflowConditionTaskOperator2["BooleanEqual"] = "b_eq";
|
|
256
|
+
WorkflowConditionTaskOperator2["BooleanNotEqual"] = "b_neq";
|
|
257
|
+
WorkflowConditionTaskOperator2["ArrayContains"] = "a_contains";
|
|
258
|
+
WorkflowConditionTaskOperator2["ArrayNotContains"] = "a_not_contains";
|
|
259
|
+
WorkflowConditionTaskOperator2["ArrayLengthEqual"] = "a_length_eq";
|
|
260
|
+
WorkflowConditionTaskOperator2["ArrayLengthGreaterThan"] = "a_length_gt";
|
|
261
|
+
WorkflowConditionTaskOperator2["ArrayLengthLessThan"] = "a_length_lt";
|
|
262
|
+
WorkflowConditionTaskOperator2["ArrayLengthGreaterOrEqual"] = "a_length_gte";
|
|
263
|
+
WorkflowConditionTaskOperator2["ArrayLengthLessOrEqual"] = "a_length_lte";
|
|
264
|
+
return WorkflowConditionTaskOperator2;
|
|
265
|
+
})(WorkflowConditionTaskOperator || {});
|
|
266
|
+
var WorkflowConditionTaskOperatorValueType = /* @__PURE__ */ ((WorkflowConditionTaskOperatorValueType2) => {
|
|
267
|
+
WorkflowConditionTaskOperatorValueType2["Null"] = "null";
|
|
268
|
+
WorkflowConditionTaskOperatorValueType2["String"] = "string";
|
|
269
|
+
WorkflowConditionTaskOperatorValueType2["Number"] = "number";
|
|
270
|
+
WorkflowConditionTaskOperatorValueType2["Boolean"] = "boolean";
|
|
271
|
+
WorkflowConditionTaskOperatorValueType2["Datetime"] = "datetime";
|
|
272
|
+
WorkflowConditionTaskOperatorValueType2["ArrayString"] = "array-string";
|
|
273
|
+
WorkflowConditionTaskOperatorValueType2["ArrayNumber"] = "array-number";
|
|
274
|
+
WorkflowConditionTaskOperatorValueType2["ArrayItem"] = "array-item";
|
|
275
|
+
return WorkflowConditionTaskOperatorValueType2;
|
|
276
|
+
})(WorkflowConditionTaskOperatorValueType || {});
|
|
277
|
+
var WorkflowConditionTaskOperatorGroup = /* @__PURE__ */ ((WorkflowConditionTaskOperatorGroup2) => {
|
|
278
|
+
WorkflowConditionTaskOperatorGroup2["General"] = "general";
|
|
279
|
+
WorkflowConditionTaskOperatorGroup2["String"] = "string";
|
|
280
|
+
WorkflowConditionTaskOperatorGroup2["Number"] = "number";
|
|
281
|
+
WorkflowConditionTaskOperatorGroup2["Boolean"] = "boolean";
|
|
282
|
+
WorkflowConditionTaskOperatorGroup2["Datetime"] = "datetime";
|
|
283
|
+
WorkflowConditionTaskOperatorGroup2["Array"] = "array";
|
|
284
|
+
return WorkflowConditionTaskOperatorGroup2;
|
|
285
|
+
})(WorkflowConditionTaskOperatorGroup || {});
|
|
286
|
+
var WorkflowConditionTaskFieldType = /* @__PURE__ */ ((WorkflowConditionTaskFieldType2) => {
|
|
287
|
+
WorkflowConditionTaskFieldType2["String"] = "string";
|
|
288
|
+
WorkflowConditionTaskFieldType2["Number"] = "number";
|
|
289
|
+
WorkflowConditionTaskFieldType2["Integer"] = "integer";
|
|
290
|
+
WorkflowConditionTaskFieldType2["Boolean"] = "boolean";
|
|
291
|
+
WorkflowConditionTaskFieldType2["Array"] = "array";
|
|
292
|
+
return WorkflowConditionTaskFieldType2;
|
|
293
|
+
})(WorkflowConditionTaskFieldType || {});
|
|
294
|
+
|
|
295
|
+
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/triggers/base.ts
|
|
296
|
+
var WorkflowTriggerType = {
|
|
297
|
+
manual: "manual_only",
|
|
298
|
+
agent: "ai_agent",
|
|
299
|
+
recurring: "recurring",
|
|
300
|
+
oneTime: "one_time",
|
|
301
|
+
webhook: "webhook",
|
|
302
|
+
webhookManual: "webhook_manual"
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflowElement.ts
|
|
306
|
+
var TRIGGER_REFERENCE_NAME = "trigger";
|
|
307
|
+
|
|
308
|
+
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflowExecution.ts
|
|
309
|
+
var WorkflowExecutionStatus = /* @__PURE__ */ ((WorkflowExecutionStatus2) => {
|
|
310
|
+
WorkflowExecutionStatus2["Succeeded"] = "succeeded";
|
|
311
|
+
WorkflowExecutionStatus2["Failed"] = "failed";
|
|
312
|
+
WorkflowExecutionStatus2["Pending"] = "pending";
|
|
313
|
+
return WorkflowExecutionStatus2;
|
|
314
|
+
})(WorkflowExecutionStatus || {});
|
|
315
|
+
var WorkflowExecutionDefinitionStatus = /* @__PURE__ */ ((WorkflowExecutionDefinitionStatus2) => {
|
|
316
|
+
WorkflowExecutionDefinitionStatus2["Completed"] = "COMPLETED";
|
|
317
|
+
WorkflowExecutionDefinitionStatus2["Failed"] = "FAILED";
|
|
318
|
+
WorkflowExecutionDefinitionStatus2["Running"] = "RUNNING";
|
|
319
|
+
return WorkflowExecutionDefinitionStatus2;
|
|
320
|
+
})(WorkflowExecutionDefinitionStatus || {});
|
|
321
|
+
|
|
322
|
+
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflowItem.ts
|
|
323
|
+
var WorkflowItemKind = /* @__PURE__ */ ((WorkflowItemKind2) => {
|
|
324
|
+
WorkflowItemKind2["Task"] = "task";
|
|
325
|
+
WorkflowItemKind2["Trigger"] = "trigger";
|
|
326
|
+
return WorkflowItemKind2;
|
|
327
|
+
})(WorkflowItemKind || {});
|
|
328
|
+
|
|
329
|
+
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflowTemplate.ts
|
|
330
|
+
var WorkflowTemplateCategory = /* @__PURE__ */ ((WorkflowTemplateCategory2) => {
|
|
331
|
+
WorkflowTemplateCategory2["NotificationAndAlerts"] = "Notifications & alerts";
|
|
332
|
+
WorkflowTemplateCategory2["SalesManagement"] = "Sales management";
|
|
333
|
+
WorkflowTemplateCategory2["LeadCollection"] = "Lead collection";
|
|
334
|
+
WorkflowTemplateCategory2["ChatManagement"] = "Chat management";
|
|
335
|
+
WorkflowTemplateCategory2["CustomerExperience"] = "Customer experience";
|
|
336
|
+
return WorkflowTemplateCategory2;
|
|
337
|
+
})(WorkflowTemplateCategory || {});
|
|
338
|
+
|
|
339
|
+
// src/constants/app/templates/repository.ts
|
|
340
|
+
var appRepositoryTemplates = {
|
|
341
|
+
nextjs: {
|
|
342
|
+
id: "nextjs",
|
|
343
|
+
description: "Uses the most popular and versatile features from our SDKs:",
|
|
344
|
+
tags: ["Auth", "Webhooks", "Agent App SDK", "Moments"],
|
|
345
|
+
name: "Fullstack Next.js template",
|
|
346
|
+
repository: {
|
|
347
|
+
name: "livechat/developer-app-template-nextjs",
|
|
348
|
+
target: "nextjs"
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
vite: {
|
|
352
|
+
id: "vite",
|
|
353
|
+
name: "Vite template",
|
|
354
|
+
description: "Implements the same base functionalities as the Next.js template except for webhooks:",
|
|
355
|
+
tags: ["Auth", "Agent App SDK", "Moments"],
|
|
356
|
+
repository: {
|
|
357
|
+
name: "livechat/developer-app-template-vite",
|
|
358
|
+
target: "browser"
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
saas: {
|
|
362
|
+
id: "saas",
|
|
363
|
+
name: "Nextjs SaaS boilerplate",
|
|
364
|
+
description: "CRM-like app with key-value storage and simple UI. Authorization and payments fully set up.",
|
|
365
|
+
tags: [],
|
|
366
|
+
repository: {
|
|
367
|
+
name: "livechat/developer-app-template-saas",
|
|
368
|
+
target: "nextjs"
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
// src/constants/app/templates/app.ts
|
|
374
|
+
var appBaseTemplates = {
|
|
375
|
+
"tag-master": {
|
|
376
|
+
id: "tag-master",
|
|
377
|
+
name: "Tag Master",
|
|
378
|
+
category: { name: "Agent App Widget" },
|
|
379
|
+
description: "Create, view, and delete tags and canned responses in an easy and predictable way.",
|
|
380
|
+
tags: ["Accounts SDK", "NextJS", "Configuration API"],
|
|
381
|
+
link: "https://github.com/bstopyra/tag-master-template",
|
|
382
|
+
icons: {},
|
|
383
|
+
repository: {
|
|
384
|
+
name: "bstopyra/tag-master-template",
|
|
385
|
+
target: "node"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
progress: {
|
|
389
|
+
id: "progress",
|
|
390
|
+
name: "Progress",
|
|
391
|
+
category: { name: "Agent App Widget" },
|
|
392
|
+
description: "Creates reports based on data from chats: ratings, chatting time, response time.",
|
|
393
|
+
tags: ["Accounts SDK", "NextJS", "Reports API"],
|
|
394
|
+
link: "https://github.com/livechat/progress-app",
|
|
395
|
+
icons: {},
|
|
396
|
+
repository: {
|
|
397
|
+
name: "livechat/progress-app",
|
|
398
|
+
target: "node"
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
supervisor: {
|
|
402
|
+
id: "supervisor",
|
|
403
|
+
name: "Supervisor",
|
|
404
|
+
category: { name: "Agent App Widget" },
|
|
405
|
+
description: "Monitor statistics of your team, such as chat ratings, response times, and chatting times.",
|
|
406
|
+
tags: ["Accounts SDK", "NextJS", "Reports API"],
|
|
407
|
+
link: "https://github.com/livechat/supervisor-app",
|
|
408
|
+
icons: {},
|
|
409
|
+
repository: {
|
|
410
|
+
name: "livechat/supervisor-app",
|
|
411
|
+
target: "node"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
popup: {
|
|
415
|
+
id: "popup",
|
|
416
|
+
name: "Popup app",
|
|
417
|
+
category: { name: "Agent App Widget" },
|
|
418
|
+
description: "Learn the ropes of the popup authorization flow from the Accounts SDK.",
|
|
419
|
+
tags: ["Accounts SDK", "Popup flow", "Widget"],
|
|
420
|
+
link: "https://github.com/livechat/sample-app-popup-auth",
|
|
421
|
+
icons: {},
|
|
422
|
+
repository: {
|
|
423
|
+
name: "livechat/sample-app-popup-auth",
|
|
424
|
+
target: "node"
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
redirect: {
|
|
428
|
+
id: "redirect",
|
|
429
|
+
name: "Redirect app",
|
|
430
|
+
category: { name: "Agent App Widget" },
|
|
431
|
+
description: "See how to implement the redirect authorization flow from the Accounts SDK.",
|
|
432
|
+
tags: ["Accounts SDK", "Redirect flow", "Widget"],
|
|
433
|
+
link: "https://github.com/livechat/sample-app-redirect-auth",
|
|
434
|
+
icons: {},
|
|
435
|
+
repository: {
|
|
436
|
+
name: "livechat/sample-app-redirect-auth",
|
|
437
|
+
target: "node"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
var appTemplates = {
|
|
442
|
+
saas: {
|
|
443
|
+
id: "saas",
|
|
444
|
+
name: "Nextjs SaaS boilerplate",
|
|
445
|
+
category: { name: "Agent App Widget" },
|
|
446
|
+
description: "CRM-like app with key-value storage and simple UI. Authorization and payments fully set up.",
|
|
447
|
+
tags: ["UI", "Auth", "Payments", "Analytics"],
|
|
448
|
+
template: true,
|
|
449
|
+
manifest: {
|
|
450
|
+
name: "Nextjs SaaS boilerplate",
|
|
451
|
+
product: "livechat",
|
|
452
|
+
blocks: {
|
|
453
|
+
repository: {
|
|
454
|
+
provider: "github",
|
|
455
|
+
name: "livechat/developer-app-template-saas",
|
|
456
|
+
branch: "main",
|
|
457
|
+
target: "nextjs"
|
|
458
|
+
},
|
|
459
|
+
deployment: {
|
|
460
|
+
provider: "vercel",
|
|
461
|
+
url: ""
|
|
462
|
+
},
|
|
463
|
+
authorization: {
|
|
464
|
+
type: "javascript_app",
|
|
465
|
+
redirectUri: ""
|
|
466
|
+
},
|
|
467
|
+
widgets: {
|
|
468
|
+
"chat-details": {
|
|
469
|
+
placement: "plugin",
|
|
470
|
+
url: "/livechat/details"
|
|
471
|
+
},
|
|
472
|
+
fullscreen: {
|
|
473
|
+
placement: "fullscreen",
|
|
474
|
+
url: "/livechat/fullscreen"
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
monetization: {
|
|
478
|
+
frequency: "monthly",
|
|
479
|
+
charge: "organization",
|
|
480
|
+
price: 500,
|
|
481
|
+
trialDays: 7
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
var allAppTemplates = __spreadValues(__spreadValues(__spreadValues({}, appRepositoryTemplates), appBaseTemplates), appTemplates);
|
|
488
|
+
|
|
489
|
+
// src/constants/auth/headers.ts
|
|
490
|
+
var PROXY_AUTHORIZATION_HEADER = "Proxy-Authorization";
|
|
491
|
+
var ACCOUNT_ID_HEADER = "X-Account-ID";
|
|
492
|
+
var ORGANIZATION_ID_HEADER = "X-Organization-ID";
|
|
493
|
+
|
|
494
|
+
// src/apis/integrations/text/instance.ts
|
|
495
|
+
var import_axios30 = __toESM(require("axios"));
|
|
496
|
+
|
|
497
|
+
// src/types/api/client.ts
|
|
498
|
+
var ApiClient = class {
|
|
499
|
+
constructor(config, authorization) {
|
|
500
|
+
this.config = config;
|
|
501
|
+
this.authorization = authorization;
|
|
502
|
+
}
|
|
503
|
+
updateConfig(config) {
|
|
504
|
+
this.config = __spreadValues(__spreadValues({}, this.config), config);
|
|
505
|
+
}
|
|
506
|
+
updateAuthorization(authorization) {
|
|
507
|
+
this.authorization = __spreadValues(__spreadValues({}, this.authorization), authorization);
|
|
508
|
+
}
|
|
509
|
+
fetch(url, customConfig, customOptions) {
|
|
510
|
+
return __async(this, null, function* () {
|
|
511
|
+
var _a, _b, _c;
|
|
512
|
+
const authorization = (_a = customConfig == null ? void 0 : customConfig.authorization) != null ? _a : this.authorization;
|
|
513
|
+
if ((customConfig == null ? void 0 : customConfig.ensureAuthorization) && !authorization) {
|
|
514
|
+
throw new this.UnauthorizedError();
|
|
515
|
+
}
|
|
516
|
+
const options = __spreadValues(__spreadValues({}, this.options), customOptions);
|
|
517
|
+
const response = yield fetch(`${this.config.baseURL}${url}`, __spreadProps(__spreadValues({}, options), {
|
|
518
|
+
headers: __spreadValues(__spreadValues({}, options.headers), authorization ? {
|
|
519
|
+
Authorization: `${(_b = authorization.tokenType) != null ? _b : "Bearer"} ${authorization.token}`
|
|
520
|
+
} : void 0)
|
|
521
|
+
}));
|
|
522
|
+
const responseText = yield response.text();
|
|
523
|
+
if (!response.ok) {
|
|
524
|
+
const errorData = responseText ? JSON.parse(responseText) : {};
|
|
525
|
+
const error = new this.Error(
|
|
526
|
+
(_c = customConfig == null ? void 0 : customConfig.customErrorMessage) != null ? _c : response.statusText,
|
|
527
|
+
errorData,
|
|
528
|
+
response.status
|
|
529
|
+
);
|
|
530
|
+
if (response.status === 401) {
|
|
531
|
+
throw new this.UnauthorizedError();
|
|
532
|
+
}
|
|
533
|
+
throw error;
|
|
534
|
+
}
|
|
535
|
+
const data = responseText ? JSON.parse(responseText) : {};
|
|
536
|
+
return __spreadProps(__spreadValues({}, response), {
|
|
537
|
+
data
|
|
538
|
+
});
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
get(url, config, options) {
|
|
542
|
+
return __async(this, null, function* () {
|
|
543
|
+
return this.fetch(url, config, __spreadProps(__spreadValues({}, options), {
|
|
544
|
+
method: "GET"
|
|
545
|
+
}));
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
post(url, body, customConfig, customOptions) {
|
|
549
|
+
return __async(this, null, function* () {
|
|
550
|
+
return this.fetch(url, customConfig, __spreadProps(__spreadValues({}, customOptions), {
|
|
551
|
+
method: "POST",
|
|
552
|
+
body: body instanceof URLSearchParams ? body : JSON.stringify(body)
|
|
553
|
+
}));
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
patch(url, body, customConfig, customOptions) {
|
|
557
|
+
return __async(this, null, function* () {
|
|
558
|
+
return this.fetch(url, customConfig, __spreadProps(__spreadValues({}, customOptions), {
|
|
559
|
+
method: "PATCH",
|
|
560
|
+
body: body instanceof URLSearchParams ? body : JSON.stringify(body)
|
|
561
|
+
}));
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
put(url, body, customConfig, customOptions) {
|
|
565
|
+
return __async(this, null, function* () {
|
|
566
|
+
return this.fetch(url, customConfig, __spreadProps(__spreadValues({}, customOptions), {
|
|
567
|
+
method: "PUT",
|
|
568
|
+
body: body instanceof URLSearchParams ? body : JSON.stringify(body)
|
|
569
|
+
}));
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
delete(url, body, config, options) {
|
|
573
|
+
return __async(this, null, function* () {
|
|
574
|
+
return this.fetch(url, config, __spreadProps(__spreadValues({}, options), {
|
|
575
|
+
method: "DELETE",
|
|
576
|
+
body: body instanceof URLSearchParams ? body : JSON.stringify(body)
|
|
577
|
+
}));
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
// src/types/api/errors.ts
|
|
583
|
+
var ApiErrorBase = class extends Error {
|
|
584
|
+
constructor(message, data, code) {
|
|
585
|
+
super(message);
|
|
586
|
+
this.message = message;
|
|
587
|
+
this.data = data;
|
|
588
|
+
this.code = code;
|
|
589
|
+
this.kind = "error";
|
|
590
|
+
}
|
|
591
|
+
withCustomMessage(message) {
|
|
592
|
+
return new this.constructor(message, this.data, this.code);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
var UnauthorizeApiError = class extends Error {
|
|
596
|
+
constructor(source, message = "Unauthorized API call") {
|
|
597
|
+
super(message);
|
|
598
|
+
this.source = source;
|
|
599
|
+
this.message = message;
|
|
600
|
+
this.kind = "unauthorized";
|
|
601
|
+
this.code = 401;
|
|
602
|
+
}
|
|
603
|
+
withCustomMessage(_message) {
|
|
604
|
+
return this;
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
// src/utils/integrations/getIntegrationFlowUrl.ts
|
|
609
|
+
var import_uuid = require("uuid");
|
|
610
|
+
|
|
611
|
+
// src/apis/integrations/bigcommerce/api.ts
|
|
612
|
+
var import_axios2 = __toESM(require("axios"));
|
|
613
|
+
|
|
614
|
+
// src/apis/integrations/bigcommerce/instance.ts
|
|
615
|
+
var import_axios = __toESM(require("axios"));
|
|
616
|
+
var BigCommerceApiError = class extends ApiErrorBase {
|
|
617
|
+
constructor() {
|
|
618
|
+
super(...arguments);
|
|
619
|
+
this.name = "bigcommerce";
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
var bigCommerceClientInstance = import_axios.default.create();
|
|
623
|
+
bigCommerceClientInstance.interceptors.response.use(
|
|
624
|
+
(r) => r,
|
|
625
|
+
(error) => {
|
|
626
|
+
var _a, _b, _c, _d;
|
|
627
|
+
if (import_axios.default.isAxiosError(error)) {
|
|
628
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
629
|
+
throw new UnauthorizeApiError("bigcommerce");
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
return Promise.reject(
|
|
633
|
+
new BigCommerceApiError(
|
|
634
|
+
error.message,
|
|
635
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
636
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
637
|
+
)
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
);
|
|
641
|
+
|
|
642
|
+
// src/apis/integrations/github/api.ts
|
|
643
|
+
var import_axios5 = __toESM(require("axios"));
|
|
644
|
+
|
|
645
|
+
// src/apis/integrations/github/instance.ts
|
|
646
|
+
var import_axios3 = __toESM(require("axios"));
|
|
647
|
+
var githubClientInstance = import_axios3.default.create({
|
|
648
|
+
baseURL: "https://api.github.com",
|
|
649
|
+
headers: {
|
|
650
|
+
Accept: "application/vnd.github+json",
|
|
651
|
+
"Content-Type": "application/json"
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
githubClientInstance.interceptors.response.use(
|
|
655
|
+
(r) => r,
|
|
656
|
+
(error) => {
|
|
657
|
+
var _a;
|
|
658
|
+
if (import_axios3.default.isAxiosError(error)) {
|
|
659
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
660
|
+
throw new UnauthorizeApiError("github");
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
throw error;
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
|
|
667
|
+
// src/apis/integrations/github/repository/api.ts
|
|
668
|
+
var import_axios4 = require("axios");
|
|
669
|
+
|
|
670
|
+
// src/apis/integrations/hubspot/instance.ts
|
|
671
|
+
var import_axios6 = __toESM(require("axios"));
|
|
672
|
+
var HubspotApiError = class extends ApiErrorBase {
|
|
673
|
+
constructor() {
|
|
674
|
+
super(...arguments);
|
|
675
|
+
this.name = "hubspot";
|
|
676
|
+
}
|
|
677
|
+
};
|
|
678
|
+
var hubspotClientInstance = import_axios6.default.create({
|
|
679
|
+
baseURL: "https://api.hubapi.com",
|
|
680
|
+
headers: {
|
|
681
|
+
"Content-Type": "application/json"
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
hubspotClientInstance.interceptors.response.use(
|
|
685
|
+
(r) => r,
|
|
686
|
+
(error) => {
|
|
687
|
+
var _a, _b, _c, _d;
|
|
688
|
+
if (import_axios6.default.isAxiosError(error)) {
|
|
689
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
690
|
+
throw new UnauthorizeApiError("hubspot");
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
return Promise.reject(
|
|
694
|
+
new HubspotApiError(
|
|
695
|
+
error.message,
|
|
696
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
697
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
698
|
+
)
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
);
|
|
702
|
+
|
|
703
|
+
// src/apis/integrations/mailchimp/api.ts
|
|
704
|
+
var import_axios8 = __toESM(require("axios"));
|
|
705
|
+
|
|
706
|
+
// src/apis/integrations/mailchimp/instance.ts
|
|
707
|
+
var import_axios7 = __toESM(require("axios"));
|
|
708
|
+
var MailchimpApiError = class extends ApiErrorBase {
|
|
709
|
+
constructor() {
|
|
710
|
+
super(...arguments);
|
|
711
|
+
this.name = "mailchimp";
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
var mailchimpClientInstance = import_axios7.default.create({
|
|
715
|
+
headers: {
|
|
716
|
+
"Content-Type": "application/json"
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
mailchimpClientInstance.interceptors.response.use(
|
|
720
|
+
(r) => r,
|
|
721
|
+
(error) => {
|
|
722
|
+
var _a, _b, _c, _d;
|
|
723
|
+
if (import_axios7.default.isAxiosError(error)) {
|
|
724
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
725
|
+
throw new UnauthorizeApiError("mailchimp");
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
return Promise.reject(
|
|
729
|
+
new MailchimpApiError(
|
|
730
|
+
error.message,
|
|
731
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
732
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
733
|
+
)
|
|
734
|
+
);
|
|
735
|
+
}
|
|
736
|
+
);
|
|
737
|
+
|
|
738
|
+
// src/apis/integrations/neon/api.ts
|
|
739
|
+
var import_axios10 = __toESM(require("axios"));
|
|
740
|
+
|
|
741
|
+
// src/apis/integrations/neon/instance.ts
|
|
742
|
+
var import_axios9 = __toESM(require("axios"));
|
|
743
|
+
var neonClientInstance = import_axios9.default.create({
|
|
744
|
+
baseURL: "https://console.neon.tech/api/v2",
|
|
745
|
+
headers: {
|
|
746
|
+
"Content-Type": "application/json"
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
neonClientInstance.interceptors.response.use(
|
|
750
|
+
(r) => r,
|
|
751
|
+
(error) => {
|
|
752
|
+
var _a;
|
|
753
|
+
if (import_axios9.default.isAxiosError(error)) {
|
|
754
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
755
|
+
throw new UnauthorizeApiError("neon");
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
throw error;
|
|
759
|
+
}
|
|
760
|
+
);
|
|
761
|
+
|
|
762
|
+
// src/apis/integrations/netlify/api.ts
|
|
763
|
+
var import_axios13 = __toESM(require("axios"));
|
|
764
|
+
|
|
765
|
+
// src/apis/integrations/netlify/account/api.ts
|
|
766
|
+
var import_axios12 = require("axios");
|
|
767
|
+
|
|
768
|
+
// src/apis/integrations/netlify/instance.ts
|
|
769
|
+
var import_axios11 = __toESM(require("axios"));
|
|
770
|
+
var netlifyClientInstance = import_axios11.default.create({
|
|
771
|
+
baseURL: "https://api.netlify.com/api/v1",
|
|
772
|
+
headers: {
|
|
773
|
+
"Content-Type": "application/json"
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
netlifyClientInstance.interceptors.response.use(
|
|
777
|
+
(r) => r,
|
|
778
|
+
(error) => {
|
|
779
|
+
var _a;
|
|
780
|
+
if (import_axios11.default.isAxiosError(error)) {
|
|
781
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
782
|
+
throw new UnauthorizeApiError("netlify");
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
throw error;
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
|
|
789
|
+
// src/apis/integrations/openai/api.ts
|
|
790
|
+
var import_axios14 = __toESM(require("axios"));
|
|
791
|
+
|
|
792
|
+
// src/apis/integrations/planetscale/api.ts
|
|
793
|
+
var import_axios16 = __toESM(require("axios"));
|
|
794
|
+
|
|
795
|
+
// src/apis/integrations/planetscale/instance.ts
|
|
796
|
+
var import_axios15 = __toESM(require("axios"));
|
|
797
|
+
var planetScaleClientInstance = import_axios15.default.create({
|
|
798
|
+
baseURL: "https://api.planetscale.com",
|
|
799
|
+
headers: {
|
|
800
|
+
"Content-Type": "application/json"
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
planetScaleClientInstance.interceptors.response.use(
|
|
804
|
+
(r) => r,
|
|
805
|
+
(error) => {
|
|
806
|
+
var _a;
|
|
807
|
+
if (import_axios15.default.isAxiosError(error)) {
|
|
808
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
809
|
+
throw new UnauthorizeApiError("planetscale");
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
throw error;
|
|
813
|
+
}
|
|
814
|
+
);
|
|
815
|
+
|
|
816
|
+
// src/apis/integrations/salesforce/api.ts
|
|
817
|
+
var import_axios17 = __toESM(require("axios"));
|
|
818
|
+
|
|
819
|
+
// src/apis/integrations/shopify/api.ts
|
|
820
|
+
var import_axios19 = __toESM(require("axios"));
|
|
821
|
+
|
|
822
|
+
// src/apis/integrations/shopify/instance.ts
|
|
823
|
+
var import_axios18 = __toESM(require("axios"));
|
|
824
|
+
var ShopifyApiError = class extends ApiErrorBase {
|
|
825
|
+
constructor() {
|
|
826
|
+
super(...arguments);
|
|
827
|
+
this.name = "shopify";
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
var shopifyClientInstance = import_axios18.default.create();
|
|
831
|
+
shopifyClientInstance.interceptors.response.use(
|
|
832
|
+
(r) => r,
|
|
833
|
+
(error) => {
|
|
834
|
+
var _a, _b, _c, _d;
|
|
835
|
+
if (import_axios18.default.isAxiosError(error)) {
|
|
836
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
837
|
+
throw new UnauthorizeApiError("shopify");
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
return Promise.reject(
|
|
841
|
+
new ShopifyApiError(
|
|
842
|
+
error.message,
|
|
843
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
844
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
845
|
+
)
|
|
846
|
+
);
|
|
847
|
+
}
|
|
848
|
+
);
|
|
849
|
+
|
|
850
|
+
// src/apis/integrations/slack/instance.ts
|
|
851
|
+
var import_axios20 = __toESM(require("axios"));
|
|
852
|
+
var SlackApiError = class extends ApiErrorBase {
|
|
853
|
+
constructor() {
|
|
854
|
+
super(...arguments);
|
|
855
|
+
this.name = "slack";
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
var slackClientInstance = import_axios20.default.create({
|
|
859
|
+
baseURL: "https://slack.com/api",
|
|
860
|
+
headers: {
|
|
861
|
+
"Content-Type": "application/json"
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
slackClientInstance.interceptors.response.use(
|
|
865
|
+
(r) => {
|
|
866
|
+
if (!r.data.ok) {
|
|
867
|
+
throw new SlackApiError(
|
|
868
|
+
`Slack API Error ${r.data.error}`,
|
|
869
|
+
r.data,
|
|
870
|
+
r.status
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
return r;
|
|
874
|
+
},
|
|
875
|
+
(error) => {
|
|
876
|
+
var _a, _b, _c, _d;
|
|
877
|
+
if (import_axios20.default.isAxiosError(error)) {
|
|
878
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
879
|
+
throw new UnauthorizeApiError("slack");
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
return Promise.reject(
|
|
883
|
+
new SlackApiError(
|
|
884
|
+
error.message,
|
|
885
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
886
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
887
|
+
)
|
|
888
|
+
);
|
|
889
|
+
}
|
|
890
|
+
);
|
|
891
|
+
|
|
892
|
+
// src/utils/misc/url/build.ts
|
|
893
|
+
var buildUrlFromSegments = (segments, basePath, baseUrl = "") => segments.length ? `${baseUrl}${basePath}/${segments.map(encodeURIComponent).join("/")}` : basePath;
|
|
894
|
+
|
|
895
|
+
// src/apis/integrations/vercel/instance.ts
|
|
896
|
+
var import_axios21 = __toESM(require("axios"));
|
|
897
|
+
var vercelClientInstance = import_axios21.default.create({
|
|
898
|
+
baseURL: "https://api.vercel.com"
|
|
899
|
+
});
|
|
900
|
+
vercelClientInstance.interceptors.response.use(
|
|
901
|
+
(r) => r,
|
|
902
|
+
(error) => {
|
|
903
|
+
var _a, _b;
|
|
904
|
+
if (import_axios21.default.isAxiosError(error)) {
|
|
905
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 403) {
|
|
906
|
+
throw new UnauthorizeApiError("vercel");
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
throw error;
|
|
910
|
+
}
|
|
911
|
+
);
|
|
912
|
+
|
|
913
|
+
// src/apis/platform/accounts/instance.ts
|
|
914
|
+
var AccountsApiError = class extends ApiErrorBase {
|
|
915
|
+
constructor() {
|
|
916
|
+
super(...arguments);
|
|
917
|
+
this.name = "accounts";
|
|
918
|
+
}
|
|
919
|
+
};
|
|
920
|
+
var UnauthorizeAccountsApiError = class extends UnauthorizeApiError {
|
|
921
|
+
constructor(message) {
|
|
922
|
+
super("accounts", message);
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
var AccountApiClient = class extends ApiClient {
|
|
926
|
+
constructor() {
|
|
927
|
+
super(...arguments);
|
|
928
|
+
this.UnauthorizedError = UnauthorizeAccountsApiError;
|
|
929
|
+
this.Error = AccountsApiError;
|
|
930
|
+
this.options = {
|
|
931
|
+
headers: {
|
|
932
|
+
"Content-Type": "application/json"
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
var platformAccountsClientInstance = new AccountApiClient({
|
|
938
|
+
baseURL: "https://accounts.labs.livechatinc.com"
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
// src/apis/platform/billing/instance.ts
|
|
942
|
+
var import_axios22 = __toESM(require("axios"));
|
|
943
|
+
var billingClientInstance = import_axios22.default.create({
|
|
944
|
+
baseURL: "https://billing.labs.livechatinc.com"
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
// src/apis/platform/cdp/events/_contracts/payloads/events.ts
|
|
948
|
+
var import_zod = require("zod");
|
|
949
|
+
var customerMetadataZod = import_zod.z.object({
|
|
950
|
+
organization_id: import_zod.z.string(),
|
|
951
|
+
customer_id: import_zod.z.string(),
|
|
952
|
+
master_id: import_zod.z.string()
|
|
953
|
+
});
|
|
954
|
+
var cdpCustomerEventMessageZod = import_zod.z.discriminatedUnion("type", [
|
|
955
|
+
import_zod.z.object({
|
|
956
|
+
id: import_zod.z.string(),
|
|
957
|
+
type: import_zod.z.literal("customer_email_set" /* EmailSet */),
|
|
958
|
+
data: customerMetadataZod.extend({
|
|
959
|
+
email: import_zod.z.string()
|
|
960
|
+
}).passthrough()
|
|
961
|
+
}),
|
|
962
|
+
import_zod.z.object({
|
|
963
|
+
id: import_zod.z.string(),
|
|
964
|
+
type: import_zod.z.literal("customer_properties_values_updated" /* PropertiesValuesUpdated */),
|
|
965
|
+
data: customerMetadataZod.extend({
|
|
966
|
+
customer_properties: import_zod.z.record(
|
|
967
|
+
import_zod.z.object({
|
|
968
|
+
value: import_zod.z.unknown(),
|
|
969
|
+
last_updated_at: import_zod.z.string(),
|
|
970
|
+
last_updated_agent_account_id: import_zod.z.string().optional(),
|
|
971
|
+
last_updated_agent_client_id: import_zod.z.string().optional()
|
|
972
|
+
}).passthrough()
|
|
973
|
+
)
|
|
974
|
+
}).passthrough()
|
|
975
|
+
})
|
|
976
|
+
]);
|
|
977
|
+
|
|
978
|
+
// src/apis/platform/console/instance.ts
|
|
979
|
+
var import_axios23 = __toESM(require("axios"));
|
|
980
|
+
var REGION = {
|
|
981
|
+
FRA: "fra",
|
|
982
|
+
DAL: "dal",
|
|
983
|
+
FRA_A: "fra-a",
|
|
984
|
+
FRA_B: "fra-b"
|
|
985
|
+
};
|
|
986
|
+
var supportedRegions = Object.values(REGION);
|
|
987
|
+
var ConsoleApiError = class _ConsoleApiError extends ApiErrorBase {
|
|
988
|
+
constructor() {
|
|
989
|
+
super(...arguments);
|
|
990
|
+
this.name = "console";
|
|
991
|
+
}
|
|
992
|
+
static notFound(message) {
|
|
993
|
+
return new _ConsoleApiError(
|
|
994
|
+
message != null ? message : "Not found",
|
|
995
|
+
{
|
|
996
|
+
errorCode: "not_found",
|
|
997
|
+
errorMessage: "Not found"
|
|
998
|
+
},
|
|
999
|
+
404
|
|
1000
|
+
);
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
1003
|
+
var consoleClientInstance = import_axios23.default.create({
|
|
1004
|
+
baseURL: "https://platform.labs.text.com/console/api",
|
|
1005
|
+
headers: {
|
|
1006
|
+
"Content-Type": "application/json"
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
consoleClientInstance.interceptors.response.use(
|
|
1010
|
+
(response) => response,
|
|
1011
|
+
(error) => {
|
|
1012
|
+
var _a, _b;
|
|
1013
|
+
const apiError = (_a = error.response) == null ? void 0 : _a.data;
|
|
1014
|
+
if ((apiError == null ? void 0 : apiError.kind) === "unauthorized") {
|
|
1015
|
+
return Promise.reject(new UnauthorizeApiError(apiError.source));
|
|
1016
|
+
} else if ((apiError == null ? void 0 : apiError.kind) === "error") {
|
|
1017
|
+
const data = (_b = error.response) == null ? void 0 : _b.data;
|
|
1018
|
+
return Promise.reject(
|
|
1019
|
+
new ConsoleApiError(data.message, data.data, data.code)
|
|
1020
|
+
);
|
|
1021
|
+
}
|
|
1022
|
+
return Promise.reject(error);
|
|
1023
|
+
}
|
|
1024
|
+
);
|
|
1025
|
+
|
|
1026
|
+
// src/apis/platform/dps/instance.ts
|
|
1027
|
+
var import_axios24 = __toESM(require("axios"));
|
|
1028
|
+
var DpsApiError = class extends ApiErrorBase {
|
|
1029
|
+
constructor() {
|
|
1030
|
+
super(...arguments);
|
|
1031
|
+
this.name = "dps";
|
|
1032
|
+
}
|
|
1033
|
+
};
|
|
1034
|
+
var dpsClientInstance = import_axios24.default.create({
|
|
1035
|
+
baseURL: "https://dev-platform.labs.livechatinc.com"
|
|
1036
|
+
});
|
|
1037
|
+
dpsClientInstance.interceptors.response.use(
|
|
1038
|
+
(response) => response,
|
|
1039
|
+
(error) => {
|
|
1040
|
+
var _a, _b, _c, _d;
|
|
1041
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 403) {
|
|
1042
|
+
return Promise.reject(new UnauthorizeApiError("accounts"));
|
|
1043
|
+
}
|
|
1044
|
+
return Promise.reject(
|
|
1045
|
+
new DpsApiError(
|
|
1046
|
+
error.message,
|
|
1047
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
1048
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
1049
|
+
)
|
|
1050
|
+
);
|
|
1051
|
+
}
|
|
1052
|
+
);
|
|
1053
|
+
|
|
1054
|
+
// src/apis/products/helpdesk/_contracts/dtos/ticket.ts
|
|
1055
|
+
var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
1056
|
+
TicketStatus2["Open"] = "open";
|
|
1057
|
+
TicketStatus2["Pending"] = "pending";
|
|
1058
|
+
TicketStatus2["OnHold"] = "onhold";
|
|
1059
|
+
TicketStatus2["Solved"] = "solved";
|
|
1060
|
+
TicketStatus2["Closed"] = "closed";
|
|
1061
|
+
return TicketStatus2;
|
|
1062
|
+
})(TicketStatus || {});
|
|
1063
|
+
var TicketPriority = /* @__PURE__ */ ((TicketPriority2) => {
|
|
1064
|
+
TicketPriority2[TicketPriority2["Low"] = -10] = "Low";
|
|
1065
|
+
TicketPriority2[TicketPriority2["Medium"] = 0] = "Medium";
|
|
1066
|
+
TicketPriority2[TicketPriority2["High"] = 10] = "High";
|
|
1067
|
+
TicketPriority2[TicketPriority2["Urgent"] = 20] = "Urgent";
|
|
1068
|
+
return TicketPriority2;
|
|
1069
|
+
})(TicketPriority || {});
|
|
1070
|
+
|
|
1071
|
+
// src/apis/products/helpdesk/instance.ts
|
|
1072
|
+
var import_axios25 = __toESM(require("axios"));
|
|
1073
|
+
var HelpDeskApiError = class extends ApiErrorBase {
|
|
1074
|
+
constructor() {
|
|
1075
|
+
super(...arguments);
|
|
1076
|
+
this.name = "helpdesk";
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
var helpdeskClientInstance = import_axios25.default.create({
|
|
1080
|
+
baseURL: "https://api.labs.helpdesk.com"
|
|
1081
|
+
});
|
|
1082
|
+
helpdeskClientInstance.interceptors.response.use(
|
|
1083
|
+
(response) => response,
|
|
1084
|
+
(error) => {
|
|
1085
|
+
var _a, _b, _c, _d;
|
|
1086
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
1087
|
+
return Promise.reject(new UnauthorizeApiError("accounts"));
|
|
1088
|
+
}
|
|
1089
|
+
return Promise.reject(
|
|
1090
|
+
new HelpDeskApiError(
|
|
1091
|
+
error.message,
|
|
1092
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
1093
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
1094
|
+
)
|
|
1095
|
+
);
|
|
1096
|
+
}
|
|
1097
|
+
);
|
|
1098
|
+
|
|
1099
|
+
// src/apis/products/livechat/instance.ts
|
|
1100
|
+
var import_axios26 = __toESM(require("axios"));
|
|
1101
|
+
var REGION2 = {
|
|
1102
|
+
FRA: "fra",
|
|
1103
|
+
DAL: "dal",
|
|
1104
|
+
FRA_A: "fra-a",
|
|
1105
|
+
FRA_B: "fra-b"
|
|
1106
|
+
};
|
|
1107
|
+
var supportedRegions2 = Object.values(REGION2);
|
|
1108
|
+
var LivechatApiError = class extends ApiErrorBase {
|
|
1109
|
+
constructor() {
|
|
1110
|
+
super(...arguments);
|
|
1111
|
+
this.name = "livechat";
|
|
1112
|
+
}
|
|
1113
|
+
};
|
|
1114
|
+
var livechatClientInstance = import_axios26.default.create({
|
|
1115
|
+
baseURL: "https://api.labs.livechatinc.com"
|
|
1116
|
+
});
|
|
1117
|
+
livechatClientInstance.interceptors.response.use(
|
|
1118
|
+
(response) => response,
|
|
1119
|
+
(error) => {
|
|
1120
|
+
var _a, _b, _c, _d;
|
|
1121
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
1122
|
+
return Promise.reject(new UnauthorizeApiError("accounts"));
|
|
1123
|
+
}
|
|
1124
|
+
return Promise.reject(
|
|
1125
|
+
new LivechatApiError(
|
|
1126
|
+
error.message,
|
|
1127
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
1128
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
1129
|
+
)
|
|
1130
|
+
);
|
|
1131
|
+
}
|
|
1132
|
+
);
|
|
1133
|
+
|
|
1134
|
+
// src/apis/text-intelligence/workflows/adapter/admin/events/notifications/_contracts/dtos/notification.ts
|
|
1135
|
+
var import_zod2 = require("zod");
|
|
1136
|
+
var integrationNotificationZods = {
|
|
1137
|
+
notification: import_zod2.z.object({
|
|
1138
|
+
id: import_zod2.z.string(),
|
|
1139
|
+
jobId: import_zod2.z.string().nullable(),
|
|
1140
|
+
subscription_id: import_zod2.z.string(),
|
|
1141
|
+
organization_id: import_zod2.z.string(),
|
|
1142
|
+
user_id: import_zod2.z.string().nullable(),
|
|
1143
|
+
source: import_zod2.z.string().nullable(),
|
|
1144
|
+
sourceKey: import_zod2.z.string().nullable(),
|
|
1145
|
+
target: import_zod2.z.string(),
|
|
1146
|
+
targetKey: import_zod2.z.string(),
|
|
1147
|
+
eventName: import_zod2.z.string(),
|
|
1148
|
+
callback: import_zod2.z.string(),
|
|
1149
|
+
status: import_zod2.z.string(),
|
|
1150
|
+
statusCode: import_zod2.z.number().nullable(),
|
|
1151
|
+
attempts: import_zod2.z.number(),
|
|
1152
|
+
error: import_zod2.z.string().nullable(),
|
|
1153
|
+
enqueuedAt: import_zod2.z.string(),
|
|
1154
|
+
completedAt: import_zod2.z.string()
|
|
1155
|
+
})
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1158
|
+
// src/apis/text-intelligence/workflows/adapter/admin/events/notifications/_contracts/requests/notifications.ts
|
|
1159
|
+
var import_zod3 = require("zod");
|
|
1160
|
+
var integrationNotificationRequestZods = {
|
|
1161
|
+
getNotifications: import_zod3.z.object({
|
|
1162
|
+
target: import_zod3.z.string().optional(),
|
|
1163
|
+
status: import_zod3.z.string().optional(),
|
|
1164
|
+
eventName: import_zod3.z.string().optional(),
|
|
1165
|
+
search: import_zod3.z.string().optional(),
|
|
1166
|
+
page: import_zod3.z.number().optional(),
|
|
1167
|
+
size: import_zod3.z.number().optional(),
|
|
1168
|
+
order_by: import_zod3.z.enum([
|
|
1169
|
+
"id",
|
|
1170
|
+
"status",
|
|
1171
|
+
"target",
|
|
1172
|
+
"eventName",
|
|
1173
|
+
"completedAt",
|
|
1174
|
+
"organization_id",
|
|
1175
|
+
"user_id"
|
|
1176
|
+
]).optional(),
|
|
1177
|
+
order: import_zod3.z.enum(["asc", "desc"]).optional()
|
|
1178
|
+
})
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
// src/apis/text-intelligence/workflows/adapter/admin/events/subscriptions/_contracts/dtos/subscription.ts
|
|
1182
|
+
var import_zod4 = require("zod");
|
|
1183
|
+
var integrationSubscriptionZods = {
|
|
1184
|
+
subscription: import_zod4.z.object({
|
|
1185
|
+
id: import_zod4.z.string(),
|
|
1186
|
+
organization_id: import_zod4.z.string(),
|
|
1187
|
+
user_id: import_zod4.z.string(),
|
|
1188
|
+
callback: import_zod4.z.string(),
|
|
1189
|
+
source: import_zod4.z.string(),
|
|
1190
|
+
sourceKey: import_zod4.z.string(),
|
|
1191
|
+
target: import_zod4.z.string(),
|
|
1192
|
+
targets: import_zod4.z.array(
|
|
1193
|
+
import_zod4.z.object({
|
|
1194
|
+
id: import_zod4.z.string(),
|
|
1195
|
+
target: import_zod4.z.string(),
|
|
1196
|
+
targetKey: import_zod4.z.string()
|
|
1197
|
+
})
|
|
1198
|
+
).optional(),
|
|
1199
|
+
event: import_zod4.z.unknown(),
|
|
1200
|
+
orphaned_at: import_zod4.z.string().datetime().nullable(),
|
|
1201
|
+
orphaned_reason: import_zod4.z.string().nullable(),
|
|
1202
|
+
orphaned_last_hit: import_zod4.z.string().datetime().nullable(),
|
|
1203
|
+
orphaned_hit_count: import_zod4.z.number()
|
|
1204
|
+
}),
|
|
1205
|
+
stats: import_zod4.z.object({
|
|
1206
|
+
totalSubscriptions: import_zod4.z.number(),
|
|
1207
|
+
uniqueOrganizations: import_zod4.z.number(),
|
|
1208
|
+
uniqueUsers: import_zod4.z.number(),
|
|
1209
|
+
byTarget: import_zod4.z.array(import_zod4.z.object({ target: import_zod4.z.string(), count: import_zod4.z.number() })),
|
|
1210
|
+
bySource: import_zod4.z.array(import_zod4.z.object({ source: import_zod4.z.string(), count: import_zod4.z.number() })),
|
|
1211
|
+
topOrganizations: import_zod4.z.array(
|
|
1212
|
+
import_zod4.z.object({ organizationId: import_zod4.z.string(), count: import_zod4.z.number() })
|
|
1213
|
+
),
|
|
1214
|
+
topCallbackDomains: import_zod4.z.array(
|
|
1215
|
+
import_zod4.z.object({ domain: import_zod4.z.string(), count: import_zod4.z.number() })
|
|
1216
|
+
)
|
|
1217
|
+
})
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
// src/apis/text-intelligence/workflows/adapter/admin/events/subscriptions/_contracts/requests/subscriptions.ts
|
|
1221
|
+
var import_zod5 = require("zod");
|
|
1222
|
+
var integrationSubscriptionRequestZods = {
|
|
1223
|
+
getSubscriptions: import_zod5.z.object({
|
|
1224
|
+
target: import_zod5.z.string().optional(),
|
|
1225
|
+
source: import_zod5.z.string().optional(),
|
|
1226
|
+
search: import_zod5.z.string().optional(),
|
|
1227
|
+
orphaned: import_zod5.z.boolean().optional(),
|
|
1228
|
+
page: import_zod5.z.number().optional(),
|
|
1229
|
+
size: import_zod5.z.number().optional(),
|
|
1230
|
+
order_by: import_zod5.z.enum([
|
|
1231
|
+
"id",
|
|
1232
|
+
"source",
|
|
1233
|
+
"target",
|
|
1234
|
+
"organization_id",
|
|
1235
|
+
"user_id",
|
|
1236
|
+
"orphaned_at"
|
|
1237
|
+
]).optional(),
|
|
1238
|
+
order: import_zod5.z.enum(["asc", "desc"]).optional()
|
|
1239
|
+
})
|
|
1240
|
+
};
|
|
1241
|
+
|
|
1242
|
+
// src/apis/text-intelligence/workflows/adapter/instance.ts
|
|
1243
|
+
var import_axios27 = __toESM(require("axios"));
|
|
1244
|
+
var REGION3 = {
|
|
1245
|
+
FRA: "fra",
|
|
1246
|
+
DAL: "dal",
|
|
1247
|
+
FRA_A: "fra-a",
|
|
1248
|
+
FRA_B: "fra-b"
|
|
1249
|
+
};
|
|
1250
|
+
var supportedRegions3 = Object.values(REGION3);
|
|
1251
|
+
var AdapterApiError = class _AdapterApiError extends ApiErrorBase {
|
|
1252
|
+
constructor() {
|
|
1253
|
+
super(...arguments);
|
|
1254
|
+
this.name = "adapter";
|
|
1255
|
+
}
|
|
1256
|
+
static notFound(message) {
|
|
1257
|
+
return new _AdapterApiError(
|
|
1258
|
+
message != null ? message : "Not found",
|
|
1259
|
+
{
|
|
1260
|
+
errorCode: "not_found",
|
|
1261
|
+
errorMessage: "Not found"
|
|
1262
|
+
},
|
|
1263
|
+
404
|
|
1264
|
+
);
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
var adapterClientInstance = import_axios27.default.create({
|
|
1268
|
+
baseURL: "https://platform.labs.text.com/console-adapter/api",
|
|
1269
|
+
headers: {
|
|
1270
|
+
"Content-Type": "application/json"
|
|
1271
|
+
}
|
|
1272
|
+
});
|
|
1273
|
+
adapterClientInstance.interceptors.response.use(
|
|
1274
|
+
(response) => response,
|
|
1275
|
+
(error) => {
|
|
1276
|
+
var _a, _b;
|
|
1277
|
+
const apiError = (_a = error.response) == null ? void 0 : _a.data;
|
|
1278
|
+
if ((apiError == null ? void 0 : apiError.kind) === "unauthorized") {
|
|
1279
|
+
return Promise.reject(new UnauthorizeApiError(apiError.source));
|
|
1280
|
+
} else if ((apiError == null ? void 0 : apiError.kind) === "error") {
|
|
1281
|
+
const data = (_b = error.response) == null ? void 0 : _b.data;
|
|
1282
|
+
return Promise.reject(
|
|
1283
|
+
new AdapterApiError(data.message, data.data, data.code)
|
|
1284
|
+
);
|
|
1285
|
+
}
|
|
1286
|
+
return Promise.reject(error);
|
|
1287
|
+
}
|
|
1288
|
+
);
|
|
1289
|
+
|
|
1290
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/_contracts/dtos/names.ts
|
|
1291
|
+
var IntegrationNames = /* @__PURE__ */ ((IntegrationNames2) => {
|
|
1292
|
+
IntegrationNames2["Accounts"] = "accounts";
|
|
1293
|
+
IntegrationNames2["GitHub"] = "github";
|
|
1294
|
+
IntegrationNames2["Netlify"] = "netlify";
|
|
1295
|
+
IntegrationNames2["Vercel"] = "vercel";
|
|
1296
|
+
IntegrationNames2["PlanetScale"] = "planetscale";
|
|
1297
|
+
IntegrationNames2["Neon"] = "neon";
|
|
1298
|
+
IntegrationNames2["Mailchimp"] = "mailchimp";
|
|
1299
|
+
IntegrationNames2["Shopify"] = "shopify";
|
|
1300
|
+
IntegrationNames2["HubSpot"] = "hubspot";
|
|
1301
|
+
IntegrationNames2["BigCommerce"] = "bigcommerce";
|
|
1302
|
+
IntegrationNames2["OpenAI"] = "openai";
|
|
1303
|
+
IntegrationNames2["Text"] = "text";
|
|
1304
|
+
IntegrationNames2["LiveChat"] = "text-livechat";
|
|
1305
|
+
IntegrationNames2["HelpDesk"] = "text-helpdesk";
|
|
1306
|
+
IntegrationNames2["Slack"] = "slack";
|
|
1307
|
+
IntegrationNames2["Salesforce"] = "salesforce";
|
|
1308
|
+
IntegrationNames2["Klaviyo"] = "klaviyo";
|
|
1309
|
+
return IntegrationNames2;
|
|
1310
|
+
})(IntegrationNames || {});
|
|
1311
|
+
var IntegrationDisplayNames = /* @__PURE__ */ ((IntegrationDisplayNames2) => {
|
|
1312
|
+
IntegrationDisplayNames2["Accounts"] = "Accounts";
|
|
1313
|
+
IntegrationDisplayNames2["GitHub"] = "Github";
|
|
1314
|
+
IntegrationDisplayNames2["Netlify"] = "Netlify";
|
|
1315
|
+
IntegrationDisplayNames2["Vercel"] = "Vercel";
|
|
1316
|
+
IntegrationDisplayNames2["PlanetScale"] = "Planetscale";
|
|
1317
|
+
IntegrationDisplayNames2["Neon"] = "Neon";
|
|
1318
|
+
IntegrationDisplayNames2["Mailchimp"] = "Mailchimp";
|
|
1319
|
+
IntegrationDisplayNames2["Shopify"] = "Shopify";
|
|
1320
|
+
IntegrationDisplayNames2["HubSpot"] = "Hubspot";
|
|
1321
|
+
IntegrationDisplayNames2["BigCommerce"] = "BigCommerce";
|
|
1322
|
+
IntegrationDisplayNames2["OpenAI"] = "OpenAI";
|
|
1323
|
+
IntegrationDisplayNames2["Text"] = "Text";
|
|
1324
|
+
IntegrationDisplayNames2["LiveChat"] = "LiveChat";
|
|
1325
|
+
IntegrationDisplayNames2["HelpDesk"] = "HelpDesk";
|
|
1326
|
+
IntegrationDisplayNames2["Slack"] = "Slack";
|
|
1327
|
+
IntegrationDisplayNames2["Salesforce"] = "Salesforce";
|
|
1328
|
+
IntegrationDisplayNames2["Klaviyo"] = "Klaviyo";
|
|
1329
|
+
return IntegrationDisplayNames2;
|
|
1330
|
+
})(IntegrationDisplayNames || {});
|
|
1331
|
+
var IntegrationDisplayNameToNameMap = Object.keys(IntegrationNames).reduce(
|
|
1332
|
+
(acc, key) => {
|
|
1333
|
+
acc[IntegrationDisplayNames[key]] = IntegrationNames[key];
|
|
1334
|
+
return acc;
|
|
1335
|
+
},
|
|
1336
|
+
{}
|
|
1337
|
+
);
|
|
1338
|
+
var IntegrationNameToDisplayMap = Object.keys(IntegrationNames).reduce(
|
|
1339
|
+
(acc, key) => {
|
|
1340
|
+
acc[IntegrationNames[key]] = IntegrationDisplayNames[key];
|
|
1341
|
+
return acc;
|
|
1342
|
+
},
|
|
1343
|
+
{}
|
|
1344
|
+
);
|
|
1345
|
+
|
|
1346
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/_contracts/requests/events.ts
|
|
1347
|
+
var import_zod16 = require("zod");
|
|
1348
|
+
|
|
1349
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/bigcommerce/_contracts/requests/events.ts
|
|
1350
|
+
var import_zod7 = require("zod");
|
|
1351
|
+
|
|
1352
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/common/events/_contracts/requests/events.ts
|
|
1353
|
+
var import_zod6 = require("zod");
|
|
1354
|
+
var integrationEventBase = import_zod6.z.object({
|
|
1355
|
+
version: import_zod6.z.string().optional()
|
|
1356
|
+
});
|
|
1357
|
+
var integrationEventsCoreZods = {
|
|
1358
|
+
sourceName: import_zod6.z.enum(["apps", "workflows"]),
|
|
1359
|
+
get source() {
|
|
1360
|
+
return import_zod6.z.object({
|
|
1361
|
+
sourceName: this.sourceName,
|
|
1362
|
+
sourceKey: import_zod6.z.string()
|
|
1363
|
+
});
|
|
1364
|
+
},
|
|
1365
|
+
get authorization() {
|
|
1366
|
+
return import_zod6.z.object({
|
|
1367
|
+
headers: import_zod6.z.record(import_zod6.z.string()).optional(),
|
|
1368
|
+
query_params: import_zod6.z.record(import_zod6.z.string()).optional(),
|
|
1369
|
+
data: import_zod6.z.record(import_zod6.z.string()).optional()
|
|
1370
|
+
});
|
|
1371
|
+
},
|
|
1372
|
+
withCore(schema) {
|
|
1373
|
+
return this.source.and(schema).and(
|
|
1374
|
+
import_zod6.z.object({
|
|
1375
|
+
authorization: this.authorization.optional()
|
|
1376
|
+
})
|
|
1377
|
+
);
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
|
|
1381
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/bigcommerce/_contracts/requests/events.ts
|
|
1382
|
+
var BigCommerceEventNames = /* @__PURE__ */ ((BigCommerceEventNames2) => {
|
|
1383
|
+
BigCommerceEventNames2["CartCreated"] = "cart_created";
|
|
1384
|
+
BigCommerceEventNames2["CartUpdated"] = "cart_updated";
|
|
1385
|
+
BigCommerceEventNames2["OrderCreated"] = "order_created";
|
|
1386
|
+
BigCommerceEventNames2["OrderUpdated"] = "order_updated";
|
|
1387
|
+
BigCommerceEventNames2["ProductCreated"] = "product_created";
|
|
1388
|
+
BigCommerceEventNames2["ProductUpdated"] = "product_updated";
|
|
1389
|
+
return BigCommerceEventNames2;
|
|
1390
|
+
})(BigCommerceEventNames || {});
|
|
1391
|
+
var bigcommerceEventsZods = {
|
|
1392
|
+
provider: import_zod7.z.literal("bigcommerce" /* BigCommerce */),
|
|
1393
|
+
eventName: import_zod7.z.nativeEnum(BigCommerceEventNames),
|
|
1394
|
+
events: {
|
|
1395
|
+
cartCreated: integrationEventBase.extend({
|
|
1396
|
+
name: import_zod7.z.literal("cart_created" /* CartCreated */)
|
|
1397
|
+
}),
|
|
1398
|
+
cartUpdated: integrationEventBase.extend({
|
|
1399
|
+
name: import_zod7.z.literal("cart_updated" /* CartUpdated */)
|
|
1400
|
+
}),
|
|
1401
|
+
orderCreated: integrationEventBase.extend({
|
|
1402
|
+
name: import_zod7.z.literal("order_created" /* OrderCreated */)
|
|
1403
|
+
}),
|
|
1404
|
+
orderUpdated: integrationEventBase.extend({
|
|
1405
|
+
name: import_zod7.z.literal("order_updated" /* OrderUpdated */)
|
|
1406
|
+
}),
|
|
1407
|
+
productCreated: integrationEventBase.extend({
|
|
1408
|
+
name: import_zod7.z.literal("product_created" /* ProductCreated */)
|
|
1409
|
+
}),
|
|
1410
|
+
productUpdated: integrationEventBase.extend({
|
|
1411
|
+
name: import_zod7.z.literal("product_updated" /* ProductUpdated */)
|
|
1412
|
+
})
|
|
1413
|
+
},
|
|
1414
|
+
get event() {
|
|
1415
|
+
return import_zod7.z.discriminatedUnion("name", [
|
|
1416
|
+
this.events.cartCreated,
|
|
1417
|
+
this.events.cartUpdated,
|
|
1418
|
+
this.events.orderCreated,
|
|
1419
|
+
this.events.orderUpdated,
|
|
1420
|
+
this.events.productCreated,
|
|
1421
|
+
this.events.productUpdated
|
|
1422
|
+
]);
|
|
1423
|
+
},
|
|
1424
|
+
get subscribe() {
|
|
1425
|
+
return integrationEventsCoreZods.withCore(
|
|
1426
|
+
import_zod7.z.object({
|
|
1427
|
+
event: this.event,
|
|
1428
|
+
callback: import_zod7.z.string()
|
|
1429
|
+
})
|
|
1430
|
+
);
|
|
1431
|
+
},
|
|
1432
|
+
get subscribeContent() {
|
|
1433
|
+
return import_zod7.z.object({
|
|
1434
|
+
provider: this.provider,
|
|
1435
|
+
event: this.event,
|
|
1436
|
+
callback: import_zod7.z.string()
|
|
1437
|
+
});
|
|
1438
|
+
},
|
|
1439
|
+
get unsubscribe() {
|
|
1440
|
+
return integrationEventsCoreZods.withCore(
|
|
1441
|
+
import_zod7.z.object({
|
|
1442
|
+
event: this.event
|
|
1443
|
+
})
|
|
1444
|
+
);
|
|
1445
|
+
},
|
|
1446
|
+
get unsubscribeContent() {
|
|
1447
|
+
return import_zod7.z.object({
|
|
1448
|
+
provider: this.provider,
|
|
1449
|
+
event: this.event
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/hubspot/_contracts/requests/events.ts
|
|
1455
|
+
var import_zod8 = require("zod");
|
|
1456
|
+
var HubspotEventNames = /* @__PURE__ */ ((HubspotEventNames2) => {
|
|
1457
|
+
HubspotEventNames2["ContactCreated"] = "contact_created";
|
|
1458
|
+
HubspotEventNames2["ContactDeleted"] = "contact_deleted";
|
|
1459
|
+
return HubspotEventNames2;
|
|
1460
|
+
})(HubspotEventNames || {});
|
|
1461
|
+
var hubspotEventsZods = {
|
|
1462
|
+
provider: import_zod8.z.literal("hubspot" /* HubSpot */),
|
|
1463
|
+
eventName: import_zod8.z.nativeEnum(HubspotEventNames),
|
|
1464
|
+
events: {
|
|
1465
|
+
contactCreated: integrationEventBase.extend({
|
|
1466
|
+
name: import_zod8.z.literal("contact_created" /* ContactCreated */)
|
|
1467
|
+
}),
|
|
1468
|
+
contactDeleted: integrationEventBase.extend({
|
|
1469
|
+
name: import_zod8.z.literal("contact_deleted" /* ContactDeleted */)
|
|
1470
|
+
})
|
|
1471
|
+
},
|
|
1472
|
+
get event() {
|
|
1473
|
+
return import_zod8.z.discriminatedUnion("name", [
|
|
1474
|
+
this.events.contactCreated,
|
|
1475
|
+
this.events.contactDeleted
|
|
1476
|
+
]);
|
|
1477
|
+
},
|
|
1478
|
+
get subscribe() {
|
|
1479
|
+
return integrationEventsCoreZods.withCore(
|
|
1480
|
+
import_zod8.z.object({
|
|
1481
|
+
event: this.event,
|
|
1482
|
+
callback: import_zod8.z.string()
|
|
1483
|
+
})
|
|
1484
|
+
);
|
|
1485
|
+
},
|
|
1486
|
+
get subscribeContent() {
|
|
1487
|
+
return import_zod8.z.object({
|
|
1488
|
+
provider: this.provider,
|
|
1489
|
+
event: this.event,
|
|
1490
|
+
callback: import_zod8.z.string()
|
|
1491
|
+
});
|
|
1492
|
+
},
|
|
1493
|
+
get unsubscribe() {
|
|
1494
|
+
return integrationEventsCoreZods.withCore(
|
|
1495
|
+
import_zod8.z.object({
|
|
1496
|
+
event: this.event
|
|
1497
|
+
})
|
|
1498
|
+
);
|
|
1499
|
+
},
|
|
1500
|
+
get unsubscribeContent() {
|
|
1501
|
+
return import_zod8.z.object({
|
|
1502
|
+
provider: this.provider,
|
|
1503
|
+
event: this.event
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1508
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/mailchimp/_contracts/requests/events.ts
|
|
1509
|
+
var import_zod9 = require("zod");
|
|
1510
|
+
var MailchimpEventNames = /* @__PURE__ */ ((MailchimpEventNames2) => {
|
|
1511
|
+
MailchimpEventNames2["Subscribed"] = "subscribed";
|
|
1512
|
+
MailchimpEventNames2["Unsubscribed"] = "unsubscribed";
|
|
1513
|
+
return MailchimpEventNames2;
|
|
1514
|
+
})(MailchimpEventNames || {});
|
|
1515
|
+
var mailchimpEventsZods = {
|
|
1516
|
+
provider: import_zod9.z.literal("mailchimp" /* Mailchimp */),
|
|
1517
|
+
eventName: import_zod9.z.nativeEnum(MailchimpEventNames),
|
|
1518
|
+
events: {
|
|
1519
|
+
subscribed: integrationEventBase.extend({
|
|
1520
|
+
listId: import_zod9.z.string(),
|
|
1521
|
+
name: import_zod9.z.literal("subscribed" /* Subscribed */)
|
|
1522
|
+
}),
|
|
1523
|
+
unsubscribed: integrationEventBase.extend({
|
|
1524
|
+
listId: import_zod9.z.string(),
|
|
1525
|
+
name: import_zod9.z.literal("unsubscribed" /* Unsubscribed */)
|
|
1526
|
+
})
|
|
1527
|
+
},
|
|
1528
|
+
get event() {
|
|
1529
|
+
return import_zod9.z.discriminatedUnion("name", [
|
|
1530
|
+
this.events.subscribed,
|
|
1531
|
+
this.events.unsubscribed
|
|
1532
|
+
]);
|
|
1533
|
+
},
|
|
1534
|
+
get subscribe() {
|
|
1535
|
+
return integrationEventsCoreZods.withCore(
|
|
1536
|
+
import_zod9.z.object({
|
|
1537
|
+
event: this.event,
|
|
1538
|
+
callback: import_zod9.z.string()
|
|
1539
|
+
})
|
|
1540
|
+
);
|
|
1541
|
+
},
|
|
1542
|
+
get subscribeContent() {
|
|
1543
|
+
return import_zod9.z.object({
|
|
1544
|
+
provider: this.provider,
|
|
1545
|
+
event: this.event,
|
|
1546
|
+
callback: import_zod9.z.string()
|
|
1547
|
+
});
|
|
1548
|
+
},
|
|
1549
|
+
get unsubscribe() {
|
|
1550
|
+
return integrationEventsCoreZods.withCore(
|
|
1551
|
+
import_zod9.z.object({
|
|
1552
|
+
event: import_zod9.z.object({
|
|
1553
|
+
listId: import_zod9.z.string(),
|
|
1554
|
+
name: this.eventName
|
|
1555
|
+
})
|
|
1556
|
+
})
|
|
1557
|
+
);
|
|
1558
|
+
},
|
|
1559
|
+
get unsubscribeContent() {
|
|
1560
|
+
return import_zod9.z.object({
|
|
1561
|
+
provider: this.provider,
|
|
1562
|
+
event: this.event
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
};
|
|
1566
|
+
|
|
1567
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/shopify/_contracts/requests/events.ts
|
|
1568
|
+
var import_zod10 = require("zod");
|
|
1569
|
+
var ShopifyEventNames = /* @__PURE__ */ ((ShopifyEventNames2) => {
|
|
1570
|
+
ShopifyEventNames2["OrderCreated"] = "order_created";
|
|
1571
|
+
return ShopifyEventNames2;
|
|
1572
|
+
})(ShopifyEventNames || {});
|
|
1573
|
+
var shopifyEventsZods = {
|
|
1574
|
+
provider: import_zod10.z.literal("shopify" /* Shopify */),
|
|
1575
|
+
eventName: import_zod10.z.nativeEnum(ShopifyEventNames),
|
|
1576
|
+
events: {
|
|
1577
|
+
orderCreated: integrationEventBase.extend({
|
|
1578
|
+
name: import_zod10.z.literal("order_created" /* OrderCreated */)
|
|
1579
|
+
})
|
|
1580
|
+
},
|
|
1581
|
+
get event() {
|
|
1582
|
+
return import_zod10.z.discriminatedUnion("name", [this.events.orderCreated]);
|
|
1583
|
+
},
|
|
1584
|
+
get subscribe() {
|
|
1585
|
+
return integrationEventsCoreZods.withCore(
|
|
1586
|
+
import_zod10.z.object({
|
|
1587
|
+
event: this.event,
|
|
1588
|
+
callback: import_zod10.z.string()
|
|
1589
|
+
})
|
|
1590
|
+
);
|
|
1591
|
+
},
|
|
1592
|
+
get subscribeContent() {
|
|
1593
|
+
return import_zod10.z.object({
|
|
1594
|
+
provider: this.provider,
|
|
1595
|
+
event: this.event,
|
|
1596
|
+
callback: import_zod10.z.string()
|
|
1597
|
+
});
|
|
1598
|
+
},
|
|
1599
|
+
get unsubscribe() {
|
|
1600
|
+
return integrationEventsCoreZods.withCore(
|
|
1601
|
+
import_zod10.z.object({
|
|
1602
|
+
event: import_zod10.z.object({
|
|
1603
|
+
name: this.eventName
|
|
1604
|
+
})
|
|
1605
|
+
})
|
|
1606
|
+
);
|
|
1607
|
+
},
|
|
1608
|
+
get unsubscribeContent() {
|
|
1609
|
+
return import_zod10.z.object({
|
|
1610
|
+
provider: this.provider,
|
|
1611
|
+
event: this.event
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1614
|
+
};
|
|
1615
|
+
|
|
1616
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/slack/_contracts/requests/events.ts
|
|
1617
|
+
var import_zod11 = require("zod");
|
|
1618
|
+
var SlackEventNames = /* @__PURE__ */ ((SlackEventNames2) => {
|
|
1619
|
+
SlackEventNames2["ChannelNewMessagePosted"] = "channel_new_message_posted";
|
|
1620
|
+
SlackEventNames2["MemberNewMention"] = "member_new_mention";
|
|
1621
|
+
SlackEventNames2["ReactionAdded"] = "reaction_added";
|
|
1622
|
+
return SlackEventNames2;
|
|
1623
|
+
})(SlackEventNames || {});
|
|
1624
|
+
var slackEventsZods = {
|
|
1625
|
+
provider: import_zod11.z.literal("slack" /* Slack */),
|
|
1626
|
+
eventName: import_zod11.z.nativeEnum(SlackEventNames),
|
|
1627
|
+
events: {
|
|
1628
|
+
channelNewMessagePosted: integrationEventBase.extend({
|
|
1629
|
+
name: import_zod11.z.literal("channel_new_message_posted" /* ChannelNewMessagePosted */),
|
|
1630
|
+
channelId: import_zod11.z.string(),
|
|
1631
|
+
userId: import_zod11.z.string().optional()
|
|
1632
|
+
}),
|
|
1633
|
+
memberNewMention: integrationEventBase.extend({
|
|
1634
|
+
name: import_zod11.z.literal("member_new_mention" /* MemberNewMention */),
|
|
1635
|
+
userId: import_zod11.z.string()
|
|
1636
|
+
}),
|
|
1637
|
+
reactionAdded: integrationEventBase.extend({
|
|
1638
|
+
name: import_zod11.z.literal("reaction_added" /* ReactionAdded */),
|
|
1639
|
+
userId: import_zod11.z.string().optional(),
|
|
1640
|
+
channelId: import_zod11.z.string().optional(),
|
|
1641
|
+
reaction: import_zod11.z.string().optional(),
|
|
1642
|
+
messageAuthorId: import_zod11.z.string().optional()
|
|
1643
|
+
})
|
|
1644
|
+
},
|
|
1645
|
+
get event() {
|
|
1646
|
+
return import_zod11.z.discriminatedUnion("name", [
|
|
1647
|
+
this.events.channelNewMessagePosted,
|
|
1648
|
+
this.events.memberNewMention,
|
|
1649
|
+
this.events.reactionAdded
|
|
1650
|
+
]);
|
|
1651
|
+
},
|
|
1652
|
+
get subscribe() {
|
|
1653
|
+
return integrationEventsCoreZods.withCore(
|
|
1654
|
+
import_zod11.z.object({
|
|
1655
|
+
event: this.event,
|
|
1656
|
+
callback: import_zod11.z.string()
|
|
1657
|
+
})
|
|
1658
|
+
);
|
|
1659
|
+
},
|
|
1660
|
+
get subscribeContent() {
|
|
1661
|
+
return import_zod11.z.object({
|
|
1662
|
+
provider: this.provider,
|
|
1663
|
+
event: this.event,
|
|
1664
|
+
callback: import_zod11.z.string()
|
|
1665
|
+
});
|
|
1666
|
+
},
|
|
1667
|
+
get unsubscribe() {
|
|
1668
|
+
return integrationEventsCoreZods.withCore(
|
|
1669
|
+
import_zod11.z.object({
|
|
1670
|
+
event: import_zod11.z.object({
|
|
1671
|
+
name: this.eventName
|
|
1672
|
+
})
|
|
1673
|
+
})
|
|
1674
|
+
);
|
|
1675
|
+
},
|
|
1676
|
+
get unsubscribeContent() {
|
|
1677
|
+
return import_zod11.z.object({
|
|
1678
|
+
provider: this.provider,
|
|
1679
|
+
event: this.event
|
|
1680
|
+
});
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
|
|
1684
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/domains/customer.ts
|
|
1685
|
+
var import_zod12 = require("zod");
|
|
1686
|
+
var TextCustomerEventNames = /* @__PURE__ */ ((TextCustomerEventNames2) => {
|
|
1687
|
+
TextCustomerEventNames2["EmailSet"] = "customer_email_set";
|
|
1688
|
+
TextCustomerEventNames2["PropertiesValuesUpdated"] = "customer_properties_values_updated";
|
|
1689
|
+
return TextCustomerEventNames2;
|
|
1690
|
+
})(TextCustomerEventNames || {});
|
|
1691
|
+
var textCustomerEventsZods = {
|
|
1692
|
+
eventName: import_zod12.z.nativeEnum(TextCustomerEventNames),
|
|
1693
|
+
events: {
|
|
1694
|
+
emailSet: integrationEventBase.extend({
|
|
1695
|
+
name: import_zod12.z.literal("customer_email_set" /* EmailSet */),
|
|
1696
|
+
filters: import_zod12.z.array(import_zod12.z.string().min(1)).min(1).optional()
|
|
1697
|
+
}),
|
|
1698
|
+
propertiesValuesUpdated: integrationEventBase.extend({
|
|
1699
|
+
name: import_zod12.z.literal("customer_properties_values_updated" /* PropertiesValuesUpdated */),
|
|
1700
|
+
properties: import_zod12.z.array(
|
|
1701
|
+
import_zod12.z.object({
|
|
1702
|
+
id: import_zod12.z.string().min(1),
|
|
1703
|
+
to: import_zod12.z.union([import_zod12.z.string(), import_zod12.z.number(), import_zod12.z.boolean()]).optional()
|
|
1704
|
+
})
|
|
1705
|
+
).optional()
|
|
1706
|
+
})
|
|
1707
|
+
},
|
|
1708
|
+
get event() {
|
|
1709
|
+
return import_zod12.z.discriminatedUnion("name", [
|
|
1710
|
+
this.events.emailSet,
|
|
1711
|
+
this.events.propertiesValuesUpdated
|
|
1712
|
+
]);
|
|
1713
|
+
},
|
|
1714
|
+
get subscribe() {
|
|
1715
|
+
return integrationEventsCoreZods.withCore(
|
|
1716
|
+
import_zod12.z.object({
|
|
1717
|
+
event: this.event,
|
|
1718
|
+
callback: import_zod12.z.string()
|
|
1719
|
+
})
|
|
1720
|
+
);
|
|
1721
|
+
},
|
|
1722
|
+
get unsubscribe() {
|
|
1723
|
+
return integrationEventsCoreZods.withCore(
|
|
1724
|
+
import_zod12.z.object({
|
|
1725
|
+
event: import_zod12.z.object({
|
|
1726
|
+
name: this.eventName
|
|
1727
|
+
})
|
|
1728
|
+
})
|
|
1729
|
+
);
|
|
1730
|
+
}
|
|
1731
|
+
};
|
|
1732
|
+
|
|
1733
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/helpdesk.ts
|
|
1734
|
+
var import_zod13 = require("zod");
|
|
1735
|
+
var TextHelpDeskEventNames = /* @__PURE__ */ ((TextHelpDeskEventNames2) => {
|
|
1736
|
+
TextHelpDeskEventNames2["TicketCreated"] = "ticket_created";
|
|
1737
|
+
TextHelpDeskEventNames2["TicketUpdated"] = "ticket_updated";
|
|
1738
|
+
TextHelpDeskEventNames2["TicketStatusChanged"] = "ticket_status_changed";
|
|
1739
|
+
TextHelpDeskEventNames2["TicketPriorityChanged"] = "ticket_priority_changed";
|
|
1740
|
+
TextHelpDeskEventNames2["TicketTagsChanged"] = "ticket_tags_added";
|
|
1741
|
+
TextHelpDeskEventNames2["TicketFollowersChanged"] = "ticket_followers_added";
|
|
1742
|
+
TextHelpDeskEventNames2["TicketAssignmentChanged"] = "ticket_assignment_added";
|
|
1743
|
+
TextHelpDeskEventNames2["TicketCustomFieldsChanged"] = "ticket_custom_fields_changed";
|
|
1744
|
+
TextHelpDeskEventNames2["TicketMessageAdded"] = "ticket_message_added";
|
|
1745
|
+
return TextHelpDeskEventNames2;
|
|
1746
|
+
})(TextHelpDeskEventNames || {});
|
|
1747
|
+
var assignmentZod = import_zod13.z.object({
|
|
1748
|
+
agent: import_zod13.z.string().optional(),
|
|
1749
|
+
team: import_zod13.z.string().optional()
|
|
1750
|
+
});
|
|
1751
|
+
var baseFiltersZod = import_zod13.z.object({
|
|
1752
|
+
assignment: assignmentZod.optional(),
|
|
1753
|
+
mailbox: import_zod13.z.string().optional()
|
|
1754
|
+
});
|
|
1755
|
+
var textHelpDeskEventsZods = {
|
|
1756
|
+
provider: import_zod13.z.literal("text-helpdesk" /* HelpDesk */),
|
|
1757
|
+
eventName: import_zod13.z.nativeEnum(TextHelpDeskEventNames),
|
|
1758
|
+
events: {
|
|
1759
|
+
ticketCreated: integrationEventBase.extend({
|
|
1760
|
+
name: import_zod13.z.literal("ticket_created" /* TicketCreated */)
|
|
1761
|
+
}).extend(baseFiltersZod.shape),
|
|
1762
|
+
ticketUpdated: integrationEventBase.extend({
|
|
1763
|
+
name: import_zod13.z.literal("ticket_updated" /* TicketUpdated */)
|
|
1764
|
+
}).extend(baseFiltersZod.shape),
|
|
1765
|
+
ticketStatusChanged: integrationEventBase.extend({
|
|
1766
|
+
name: import_zod13.z.literal("ticket_status_changed" /* TicketStatusChanged */),
|
|
1767
|
+
status: import_zod13.z.object({
|
|
1768
|
+
from: import_zod13.z.array(import_zod13.z.nativeEnum(TicketStatus)).optional(),
|
|
1769
|
+
to: import_zod13.z.array(import_zod13.z.nativeEnum(TicketStatus)).optional()
|
|
1770
|
+
}).optional()
|
|
1771
|
+
}).extend(baseFiltersZod.shape),
|
|
1772
|
+
ticketPriorityChanged: integrationEventBase.extend({
|
|
1773
|
+
name: import_zod13.z.literal("ticket_priority_changed" /* TicketPriorityChanged */),
|
|
1774
|
+
priority: import_zod13.z.object({
|
|
1775
|
+
from: import_zod13.z.array(import_zod13.z.nativeEnum(TicketPriority)).optional(),
|
|
1776
|
+
to: import_zod13.z.array(import_zod13.z.nativeEnum(TicketPriority)).optional()
|
|
1777
|
+
}).optional()
|
|
1778
|
+
}).extend(baseFiltersZod.shape),
|
|
1779
|
+
ticketTagsChanged: integrationEventBase.extend({
|
|
1780
|
+
name: import_zod13.z.literal("ticket_tags_added" /* TicketTagsChanged */),
|
|
1781
|
+
tags: import_zod13.z.object({
|
|
1782
|
+
from: import_zod13.z.array(import_zod13.z.string()).optional(),
|
|
1783
|
+
to: import_zod13.z.array(import_zod13.z.string()).optional()
|
|
1784
|
+
}).optional()
|
|
1785
|
+
}).extend(baseFiltersZod.shape),
|
|
1786
|
+
ticketFollowersChanged: integrationEventBase.extend({
|
|
1787
|
+
name: import_zod13.z.literal("ticket_followers_added" /* TicketFollowersChanged */),
|
|
1788
|
+
from: import_zod13.z.array(import_zod13.z.string()).optional(),
|
|
1789
|
+
to: import_zod13.z.array(import_zod13.z.string()).optional()
|
|
1790
|
+
}).extend(baseFiltersZod.shape),
|
|
1791
|
+
ticketAssignmentChanged: integrationEventBase.extend({
|
|
1792
|
+
name: import_zod13.z.literal("ticket_assignment_added" /* TicketAssignmentChanged */),
|
|
1793
|
+
from: import_zod13.z.array(assignmentZod).optional(),
|
|
1794
|
+
to: import_zod13.z.array(assignmentZod).optional()
|
|
1795
|
+
}).extend(baseFiltersZod.shape),
|
|
1796
|
+
ticketCustomFieldsChanged: integrationEventBase.extend({
|
|
1797
|
+
name: import_zod13.z.literal("ticket_custom_fields_changed" /* TicketCustomFieldsChanged */),
|
|
1798
|
+
customFields: import_zod13.z.array(
|
|
1799
|
+
import_zod13.z.object({
|
|
1800
|
+
id: import_zod13.z.string().min(1),
|
|
1801
|
+
from: import_zod13.z.string().min(1).optional(),
|
|
1802
|
+
to: import_zod13.z.string().min(1).optional()
|
|
1803
|
+
})
|
|
1804
|
+
).optional()
|
|
1805
|
+
}).extend(baseFiltersZod.shape),
|
|
1806
|
+
ticketMessageAdded: import_zod13.z.discriminatedUnion("version", [
|
|
1807
|
+
import_zod13.z.object({
|
|
1808
|
+
name: import_zod13.z.literal("ticket_message_added" /* TicketMessageAdded */),
|
|
1809
|
+
version: import_zod13.z.undefined()
|
|
1810
|
+
}).extend(baseFiltersZod.shape),
|
|
1811
|
+
import_zod13.z.object({
|
|
1812
|
+
name: import_zod13.z.literal("ticket_message_added" /* TicketMessageAdded */),
|
|
1813
|
+
version: import_zod13.z.literal("v1"),
|
|
1814
|
+
from: import_zod13.z.enum(["anyone", "agent", "requester"]).optional(),
|
|
1815
|
+
privacy: import_zod13.z.enum(["any", "public", "private"]).optional(),
|
|
1816
|
+
filters: import_zod13.z.array(import_zod13.z.string()).optional(),
|
|
1817
|
+
caseInsensitive: import_zod13.z.boolean().optional(),
|
|
1818
|
+
matchWholeWords: import_zod13.z.boolean().optional()
|
|
1819
|
+
}).extend(baseFiltersZod.shape)
|
|
1820
|
+
])
|
|
1821
|
+
},
|
|
1822
|
+
get event() {
|
|
1823
|
+
return import_zod13.z.union([
|
|
1824
|
+
this.events.ticketCreated,
|
|
1825
|
+
this.events.ticketUpdated,
|
|
1826
|
+
this.events.ticketStatusChanged,
|
|
1827
|
+
this.events.ticketPriorityChanged,
|
|
1828
|
+
this.events.ticketTagsChanged,
|
|
1829
|
+
this.events.ticketFollowersChanged,
|
|
1830
|
+
this.events.ticketAssignmentChanged,
|
|
1831
|
+
this.events.ticketMessageAdded,
|
|
1832
|
+
this.events.ticketCustomFieldsChanged
|
|
1833
|
+
]);
|
|
1834
|
+
},
|
|
1835
|
+
get subscribe() {
|
|
1836
|
+
return integrationEventsCoreZods.withCore(
|
|
1837
|
+
import_zod13.z.object({
|
|
1838
|
+
event: this.event,
|
|
1839
|
+
callback: import_zod13.z.string()
|
|
1840
|
+
})
|
|
1841
|
+
);
|
|
1842
|
+
},
|
|
1843
|
+
get subscribeContent() {
|
|
1844
|
+
return import_zod13.z.object({
|
|
1845
|
+
provider: this.provider,
|
|
1846
|
+
event: this.event,
|
|
1847
|
+
callback: import_zod13.z.string()
|
|
1848
|
+
});
|
|
1849
|
+
},
|
|
1850
|
+
get unsubscribe() {
|
|
1851
|
+
return integrationEventsCoreZods.withCore(
|
|
1852
|
+
import_zod13.z.object({
|
|
1853
|
+
event: this.event
|
|
1854
|
+
})
|
|
1855
|
+
);
|
|
1856
|
+
},
|
|
1857
|
+
get unsubscribeContent() {
|
|
1858
|
+
return import_zod13.z.object({
|
|
1859
|
+
provider: this.provider,
|
|
1860
|
+
event: this.event
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
|
|
1865
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/livechat.ts
|
|
1866
|
+
var import_zod14 = require("zod");
|
|
1867
|
+
var TextLivechatEventNames = /* @__PURE__ */ ((TextLivechatEventNames2) => {
|
|
1868
|
+
TextLivechatEventNames2["ChatStarted"] = "chat_started";
|
|
1869
|
+
TextLivechatEventNames2["ChatEnded"] = "chat_ended";
|
|
1870
|
+
TextLivechatEventNames2["ChatTransferred"] = "chat_transferred";
|
|
1871
|
+
TextLivechatEventNames2["ChatTagged"] = "chat_tagged";
|
|
1872
|
+
TextLivechatEventNames2["ChatRated"] = "chat_rated";
|
|
1873
|
+
TextLivechatEventNames2["ChatCommented"] = "chat_commented";
|
|
1874
|
+
TextLivechatEventNames2["ChatMessage"] = "chat_message";
|
|
1875
|
+
TextLivechatEventNames2["UserAddedToChat"] = "user_added_to_chat";
|
|
1876
|
+
TextLivechatEventNames2["UserRemovedFromChat"] = "user_removed_from_chat";
|
|
1877
|
+
TextLivechatEventNames2["CustomerLeftChat"] = "customer_left_chat";
|
|
1878
|
+
TextLivechatEventNames2["ChatIdle"] = "chat_idle";
|
|
1879
|
+
TextLivechatEventNames2["ProductCardEvent"] = "product_card_event";
|
|
1880
|
+
return TextLivechatEventNames2;
|
|
1881
|
+
})(TextLivechatEventNames || {});
|
|
1882
|
+
var CustomerLeftChatReason = /* @__PURE__ */ ((CustomerLeftChatReason2) => {
|
|
1883
|
+
CustomerLeftChatReason2["Manual"] = "manual";
|
|
1884
|
+
CustomerLeftChatReason2["Disconnected"] = "disconnected";
|
|
1885
|
+
CustomerLeftChatReason2["Inactive"] = "inactive";
|
|
1886
|
+
return CustomerLeftChatReason2;
|
|
1887
|
+
})(CustomerLeftChatReason || {});
|
|
1888
|
+
var TextLivechatProductCardEventType = /* @__PURE__ */ ((TextLivechatProductCardEventType2) => {
|
|
1889
|
+
TextLivechatProductCardEventType2["ViewProduct"] = "view_product";
|
|
1890
|
+
TextLivechatProductCardEventType2["AddToCart"] = "add_to_cart";
|
|
1891
|
+
return TextLivechatProductCardEventType2;
|
|
1892
|
+
})(TextLivechatProductCardEventType || {});
|
|
1893
|
+
var textLivechatEventsZods = {
|
|
1894
|
+
provider: import_zod14.z.literal("text-livechat" /* LiveChat */),
|
|
1895
|
+
eventName: import_zod14.z.nativeEnum(TextLivechatEventNames),
|
|
1896
|
+
events: {
|
|
1897
|
+
chatStarted: integrationEventBase.extend({
|
|
1898
|
+
name: import_zod14.z.literal("chat_started" /* ChatStarted */),
|
|
1899
|
+
targetAgentId: import_zod14.z.string().optional()
|
|
1900
|
+
}),
|
|
1901
|
+
chatEnded: integrationEventBase.extend({
|
|
1902
|
+
name: import_zod14.z.literal("chat_ended" /* ChatEnded */)
|
|
1903
|
+
}),
|
|
1904
|
+
chatTransferred: integrationEventBase.extend({
|
|
1905
|
+
name: import_zod14.z.literal("chat_transferred" /* ChatTransferred */),
|
|
1906
|
+
targetGroups: import_zod14.z.array(import_zod14.z.number()).optional(),
|
|
1907
|
+
targetAgents: import_zod14.z.array(import_zod14.z.string()).optional()
|
|
1908
|
+
}),
|
|
1909
|
+
chatTagged: integrationEventBase.extend({
|
|
1910
|
+
name: import_zod14.z.literal("chat_tagged" /* ChatTagged */),
|
|
1911
|
+
tag: import_zod14.z.string().optional(),
|
|
1912
|
+
exact: import_zod14.z.boolean().optional()
|
|
1913
|
+
}),
|
|
1914
|
+
chatRated: integrationEventBase.extend({
|
|
1915
|
+
name: import_zod14.z.literal("chat_rated" /* ChatRated */),
|
|
1916
|
+
rating: import_zod14.z.enum(["good", "bad", "all"]).optional()
|
|
1917
|
+
}),
|
|
1918
|
+
chatCommented: integrationEventBase.extend({
|
|
1919
|
+
name: import_zod14.z.literal("chat_commented" /* ChatCommented */)
|
|
1920
|
+
}),
|
|
1921
|
+
chatMessage: import_zod14.z.discriminatedUnion("version", [
|
|
1922
|
+
import_zod14.z.object({
|
|
1923
|
+
name: import_zod14.z.literal("chat_message" /* ChatMessage */),
|
|
1924
|
+
version: import_zod14.z.undefined(),
|
|
1925
|
+
filter: import_zod14.z.string().optional(),
|
|
1926
|
+
caseInsensitive: import_zod14.z.boolean().optional(),
|
|
1927
|
+
matchWholeWords: import_zod14.z.boolean().optional()
|
|
1928
|
+
}),
|
|
1929
|
+
import_zod14.z.object({
|
|
1930
|
+
name: import_zod14.z.literal("chat_message" /* ChatMessage */),
|
|
1931
|
+
version: import_zod14.z.literal("v1"),
|
|
1932
|
+
filters: import_zod14.z.array(import_zod14.z.string()),
|
|
1933
|
+
caseInsensitive: import_zod14.z.boolean().optional(),
|
|
1934
|
+
matchWholeWords: import_zod14.z.boolean().optional()
|
|
1935
|
+
})
|
|
1936
|
+
]),
|
|
1937
|
+
userAddedToChat: integrationEventBase.extend({
|
|
1938
|
+
name: import_zod14.z.literal("user_added_to_chat" /* UserAddedToChat */),
|
|
1939
|
+
userType: import_zod14.z.enum(["agent", "customer"]).optional(),
|
|
1940
|
+
targetAgentId: import_zod14.z.string().optional()
|
|
1941
|
+
}),
|
|
1942
|
+
userRemovedFromChat: integrationEventBase.extend({
|
|
1943
|
+
name: import_zod14.z.literal("user_removed_from_chat" /* UserRemovedFromChat */)
|
|
1944
|
+
}),
|
|
1945
|
+
customerLeftChat: integrationEventBase.extend({
|
|
1946
|
+
name: import_zod14.z.literal("customer_left_chat" /* CustomerLeftChat */),
|
|
1947
|
+
reasons: import_zod14.z.array(import_zod14.z.nativeEnum(CustomerLeftChatReason)).optional()
|
|
1948
|
+
}),
|
|
1949
|
+
chatIdle: integrationEventBase.extend({
|
|
1950
|
+
name: import_zod14.z.literal("chat_idle" /* ChatIdle */)
|
|
1951
|
+
}),
|
|
1952
|
+
productCardEvent: integrationEventBase.extend({
|
|
1953
|
+
name: import_zod14.z.literal("product_card_event" /* ProductCardEvent */),
|
|
1954
|
+
type: import_zod14.z.nativeEnum(TextLivechatProductCardEventType),
|
|
1955
|
+
product_id: import_zod14.z.string().optional()
|
|
1956
|
+
})
|
|
1957
|
+
},
|
|
1958
|
+
get event() {
|
|
1959
|
+
return import_zod14.z.union([
|
|
1960
|
+
this.events.chatStarted,
|
|
1961
|
+
this.events.chatEnded,
|
|
1962
|
+
this.events.chatTransferred,
|
|
1963
|
+
this.events.chatTagged,
|
|
1964
|
+
this.events.chatRated,
|
|
1965
|
+
this.events.chatCommented,
|
|
1966
|
+
this.events.chatMessage,
|
|
1967
|
+
this.events.userAddedToChat,
|
|
1968
|
+
this.events.userRemovedFromChat,
|
|
1969
|
+
this.events.customerLeftChat,
|
|
1970
|
+
this.events.chatIdle,
|
|
1971
|
+
this.events.productCardEvent
|
|
1972
|
+
]);
|
|
1973
|
+
},
|
|
1974
|
+
get subscribe() {
|
|
1975
|
+
return integrationEventsCoreZods.withCore(
|
|
1976
|
+
import_zod14.z.object({
|
|
1977
|
+
event: this.event,
|
|
1978
|
+
callback: import_zod14.z.string()
|
|
1979
|
+
})
|
|
1980
|
+
);
|
|
1981
|
+
},
|
|
1982
|
+
get subscribeContent() {
|
|
1983
|
+
return import_zod14.z.object({
|
|
1984
|
+
provider: this.provider,
|
|
1985
|
+
event: this.event,
|
|
1986
|
+
callback: import_zod14.z.string()
|
|
1987
|
+
});
|
|
1988
|
+
},
|
|
1989
|
+
get unsubscribe() {
|
|
1990
|
+
return integrationEventsCoreZods.withCore(
|
|
1991
|
+
import_zod14.z.object({
|
|
1992
|
+
event: this.event
|
|
1993
|
+
})
|
|
1994
|
+
);
|
|
1995
|
+
},
|
|
1996
|
+
get unsubscribeContent() {
|
|
1997
|
+
return import_zod14.z.object({
|
|
1998
|
+
provider: this.provider,
|
|
1999
|
+
event: this.event
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
2002
|
+
};
|
|
2003
|
+
|
|
2004
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/text.ts
|
|
2005
|
+
var import_zod15 = require("zod");
|
|
2006
|
+
var textEventsZods = {
|
|
2007
|
+
provider: import_zod15.z.literal("text" /* Text */),
|
|
2008
|
+
get event() {
|
|
2009
|
+
return textCustomerEventsZods.event;
|
|
2010
|
+
},
|
|
2011
|
+
get subscribe() {
|
|
2012
|
+
return integrationEventsCoreZods.withCore(
|
|
2013
|
+
import_zod15.z.object({
|
|
2014
|
+
event: this.event,
|
|
2015
|
+
callback: import_zod15.z.string()
|
|
2016
|
+
})
|
|
2017
|
+
);
|
|
2018
|
+
},
|
|
2019
|
+
get subscribeContent() {
|
|
2020
|
+
return import_zod15.z.object({
|
|
2021
|
+
provider: this.provider,
|
|
2022
|
+
event: this.event,
|
|
2023
|
+
callback: import_zod15.z.string()
|
|
2024
|
+
});
|
|
2025
|
+
},
|
|
2026
|
+
get unsubscribe() {
|
|
2027
|
+
return integrationEventsCoreZods.withCore(
|
|
2028
|
+
import_zod15.z.object({
|
|
2029
|
+
event: this.event
|
|
2030
|
+
})
|
|
2031
|
+
);
|
|
2032
|
+
},
|
|
2033
|
+
get unsubscribeContent() {
|
|
2034
|
+
return import_zod15.z.object({
|
|
2035
|
+
provider: this.provider,
|
|
2036
|
+
event: this.event
|
|
2037
|
+
});
|
|
2038
|
+
}
|
|
2039
|
+
};
|
|
2040
|
+
|
|
2041
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/_contracts/requests/events.ts
|
|
2042
|
+
var integrationEventsZods = {
|
|
2043
|
+
providerName: import_zod16.z.enum([
|
|
2044
|
+
"text" /* Text */,
|
|
2045
|
+
"text-livechat" /* LiveChat */,
|
|
2046
|
+
"text-helpdesk" /* HelpDesk */,
|
|
2047
|
+
"mailchimp" /* Mailchimp */,
|
|
2048
|
+
"shopify" /* Shopify */,
|
|
2049
|
+
"hubspot" /* HubSpot */,
|
|
2050
|
+
"slack" /* Slack */,
|
|
2051
|
+
"bigcommerce" /* BigCommerce */
|
|
2052
|
+
]),
|
|
2053
|
+
get event() {
|
|
2054
|
+
return textEventsZods.event.or(textLivechatEventsZods.event).or(textHelpDeskEventsZods.event).or(shopifyEventsZods.event).or(mailchimpEventsZods.event).or(hubspotEventsZods.event).or(bigcommerceEventsZods.event).or(slackEventsZods.event);
|
|
2055
|
+
},
|
|
2056
|
+
get subscribe() {
|
|
2057
|
+
return integrationEventsCoreZods.withCore(
|
|
2058
|
+
import_zod16.z.discriminatedUnion("provider", [
|
|
2059
|
+
textEventsZods.subscribeContent,
|
|
2060
|
+
textLivechatEventsZods.subscribeContent,
|
|
2061
|
+
textHelpDeskEventsZods.subscribeContent,
|
|
2062
|
+
shopifyEventsZods.subscribeContent,
|
|
2063
|
+
mailchimpEventsZods.subscribeContent,
|
|
2064
|
+
hubspotEventsZods.subscribeContent,
|
|
2065
|
+
slackEventsZods.subscribeContent,
|
|
2066
|
+
bigcommerceEventsZods.subscribeContent
|
|
2067
|
+
])
|
|
2068
|
+
);
|
|
2069
|
+
},
|
|
2070
|
+
get unsubscribe() {
|
|
2071
|
+
return integrationEventsCoreZods.withCore(
|
|
2072
|
+
import_zod16.z.discriminatedUnion("provider", [
|
|
2073
|
+
textEventsZods.unsubscribeContent,
|
|
2074
|
+
textLivechatEventsZods.unsubscribeContent,
|
|
2075
|
+
textHelpDeskEventsZods.unsubscribeContent,
|
|
2076
|
+
shopifyEventsZods.unsubscribeContent,
|
|
2077
|
+
mailchimpEventsZods.unsubscribeContent,
|
|
2078
|
+
hubspotEventsZods.unsubscribeContent,
|
|
2079
|
+
slackEventsZods.unsubscribeContent,
|
|
2080
|
+
bigcommerceEventsZods.unsubscribeContent
|
|
2081
|
+
])
|
|
2082
|
+
);
|
|
2083
|
+
}
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
// src/apis/text-intelligence/workflows/workflow/instance.ts
|
|
2087
|
+
var import_axios28 = __toESM(require("axios"));
|
|
2088
|
+
var REGION4 = {
|
|
2089
|
+
FRA: "fra",
|
|
2090
|
+
DAL: "dal",
|
|
2091
|
+
FRA_A: "fra-a",
|
|
2092
|
+
FRA_B: "fra-b"
|
|
2093
|
+
};
|
|
2094
|
+
var supportedRegions4 = Object.values(REGION4);
|
|
2095
|
+
var WorkflowsApiError = class _WorkflowsApiError extends ApiErrorBase {
|
|
2096
|
+
constructor() {
|
|
2097
|
+
super(...arguments);
|
|
2098
|
+
this.name = "workflows";
|
|
2099
|
+
}
|
|
2100
|
+
static notFound(message) {
|
|
2101
|
+
return new _WorkflowsApiError(
|
|
2102
|
+
message != null ? message : "Not found",
|
|
2103
|
+
{
|
|
2104
|
+
errorCode: "not_found",
|
|
2105
|
+
errorMessage: "Not found"
|
|
2106
|
+
},
|
|
2107
|
+
404
|
|
2108
|
+
);
|
|
2109
|
+
}
|
|
2110
|
+
};
|
|
2111
|
+
var workflowsClientInstance = import_axios28.default.create({
|
|
2112
|
+
baseURL: "https://platform.labs.text.com/workflows/api",
|
|
2113
|
+
headers: {
|
|
2114
|
+
"Content-Type": "application/json"
|
|
2115
|
+
}
|
|
2116
|
+
});
|
|
2117
|
+
workflowsClientInstance.interceptors.response.use(
|
|
2118
|
+
(response) => response,
|
|
2119
|
+
(error) => {
|
|
2120
|
+
var _a, _b;
|
|
2121
|
+
const apiError = (_a = error.response) == null ? void 0 : _a.data;
|
|
2122
|
+
if ((apiError == null ? void 0 : apiError.kind) === "unauthorized") {
|
|
2123
|
+
return Promise.reject(new UnauthorizeApiError(apiError.source));
|
|
2124
|
+
} else if ((apiError == null ? void 0 : apiError.kind) === "error") {
|
|
2125
|
+
const data = (_b = error.response) == null ? void 0 : _b.data;
|
|
2126
|
+
return Promise.reject(
|
|
2127
|
+
new WorkflowsApiError(data.message, data.data, data.code)
|
|
2128
|
+
);
|
|
2129
|
+
}
|
|
2130
|
+
return Promise.reject(error);
|
|
2131
|
+
}
|
|
2132
|
+
);
|
|
2133
|
+
|
|
2134
|
+
// src/apis/integrations/text/platform/workflow/resources/api.ts
|
|
2135
|
+
var integrationNameToProduct = {
|
|
2136
|
+
["text-helpdesk" /* HelpDesk */]: "helpdesk",
|
|
2137
|
+
["text-livechat" /* LiveChat */]: "livechat"
|
|
2138
|
+
};
|
|
2139
|
+
|
|
2140
|
+
// src/apis/integrations/vercel/api.ts
|
|
2141
|
+
var import_axios29 = __toESM(require("axios"));
|
|
2142
|
+
|
|
2143
|
+
// src/apis/platform/accounts/accounts/api.ts
|
|
2144
|
+
var urls = (withBaseUrl = false) => {
|
|
2145
|
+
const getUrl = (segments = []) => buildUrlFromSegments(
|
|
2146
|
+
segments,
|
|
2147
|
+
"/v2/accounts",
|
|
2148
|
+
withBaseUrl ? platformAccountsClientInstance.config.baseURL : void 0
|
|
2149
|
+
);
|
|
2150
|
+
return {
|
|
2151
|
+
getAccounts: () => getUrl(),
|
|
2152
|
+
getAccount: (id) => getUrl([id]),
|
|
2153
|
+
getMeAccount: () => getUrl(["me"])
|
|
2154
|
+
};
|
|
2155
|
+
};
|
|
2156
|
+
var api = {
|
|
2157
|
+
getAccounts(authorization) {
|
|
2158
|
+
return __async(this, null, function* () {
|
|
2159
|
+
return platformAccountsClientInstance.get(
|
|
2160
|
+
urls().getAccounts(),
|
|
2161
|
+
{
|
|
2162
|
+
authorization,
|
|
2163
|
+
customErrorMessage: "Accounts couldn't be fetched."
|
|
2164
|
+
}
|
|
2165
|
+
);
|
|
2166
|
+
});
|
|
2167
|
+
},
|
|
2168
|
+
getAccount(accountId, authorization) {
|
|
2169
|
+
return __async(this, null, function* () {
|
|
2170
|
+
return platformAccountsClientInstance.get(
|
|
2171
|
+
urls().getAccount(accountId),
|
|
2172
|
+
{
|
|
2173
|
+
authorization,
|
|
2174
|
+
customErrorMessage: "Account couldn't be fetched."
|
|
2175
|
+
}
|
|
2176
|
+
);
|
|
2177
|
+
});
|
|
2178
|
+
},
|
|
2179
|
+
getMeAccount(authorization) {
|
|
2180
|
+
return __async(this, null, function* () {
|
|
2181
|
+
return platformAccountsClientInstance.get(
|
|
2182
|
+
"/v2/accounts/me",
|
|
2183
|
+
{
|
|
2184
|
+
authorization,
|
|
2185
|
+
customErrorMessage: "Me account couldn't be fetched."
|
|
2186
|
+
}
|
|
2187
|
+
);
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
};
|
|
2191
|
+
var platformAccountsAccountApi = __spreadProps(__spreadValues({}, api), {
|
|
2192
|
+
meta: {
|
|
2193
|
+
urls
|
|
2194
|
+
}
|
|
2195
|
+
});
|
|
2196
|
+
|
|
2197
|
+
// src/apis/integrations/text/instance.ts
|
|
2198
|
+
var TextApiError = class extends ApiErrorBase {
|
|
2199
|
+
constructor() {
|
|
2200
|
+
super(...arguments);
|
|
2201
|
+
this.name = "text";
|
|
2202
|
+
}
|
|
2203
|
+
};
|
|
2204
|
+
var textClientInstance = import_axios30.default.create({
|
|
2205
|
+
baseURL: "https://api.labs.text.com"
|
|
2206
|
+
});
|
|
2207
|
+
textClientInstance.interceptors.response.use(
|
|
2208
|
+
(r) => r,
|
|
2209
|
+
(error) => {
|
|
2210
|
+
var _a, _b, _c, _d;
|
|
2211
|
+
if (import_axios30.default.isAxiosError(error)) {
|
|
2212
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2213
|
+
throw new UnauthorizeApiError("text");
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
return Promise.reject(
|
|
2217
|
+
new TextApiError(
|
|
2218
|
+
error.message,
|
|
2219
|
+
(_b = error.response) == null ? void 0 : _b.data,
|
|
2220
|
+
(_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
|
|
2221
|
+
)
|
|
2222
|
+
);
|
|
2223
|
+
}
|
|
2224
|
+
);
|
|
2225
|
+
function getTextClientConfig(options = {}) {
|
|
2226
|
+
var _a;
|
|
2227
|
+
const currentHeaders = textClientInstance.defaults.headers;
|
|
2228
|
+
const config = {
|
|
2229
|
+
authorization: (_a = options.token ? `Bearer ${options.token}` : void 0) != null ? _a : currentHeaders.Authorization
|
|
2230
|
+
};
|
|
2231
|
+
return __spreadProps(__spreadValues({}, options.baseUrl ? { baseURL: options.baseUrl } : {}), {
|
|
2232
|
+
headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
// src/apis/integrations/text/platform/workflow/workflows/internal/crm/instance.ts
|
|
2237
|
+
function getWorkflowApiCrmConfig(authorization) {
|
|
2238
|
+
var _a, _b, _c, _d;
|
|
2239
|
+
const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2240
|
+
ensureAuthorizationToken: true
|
|
2241
|
+
}));
|
|
2242
|
+
return __spreadProps(__spreadValues({}, config), {
|
|
2243
|
+
headers: __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (_a = config.headers) != null ? _a : {}), ((_b = authorization == null ? void 0 : authorization.internal) == null ? void 0 : _b.token) ? {
|
|
2244
|
+
[PROXY_AUTHORIZATION_HEADER]: `Bearer ${authorization.internal.token}`
|
|
2245
|
+
} : {}), ((_c = authorization == null ? void 0 : authorization.internal) == null ? void 0 : _c.organizationId) ? { [ORGANIZATION_ID_HEADER]: authorization.internal.organizationId } : {}), ((_d = authorization == null ? void 0 : authorization.internal) == null ? void 0 : _d.accountId) ? { [ACCOUNT_ID_HEADER]: authorization.internal.accountId } : {})
|
|
2246
|
+
});
|
|
2247
|
+
}
|
|
2248
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2249
|
+
0 && (module.exports = {
|
|
2250
|
+
CredentialStatus,
|
|
2251
|
+
CredentialType,
|
|
2252
|
+
CredentialTypeDisplayNameMapping,
|
|
2253
|
+
OauthCredentialGrantType,
|
|
2254
|
+
SortBy,
|
|
2255
|
+
SortOrder,
|
|
2256
|
+
TRIGGER_REFERENCE_NAME,
|
|
2257
|
+
WorkflowConditionTaskFieldType,
|
|
2258
|
+
WorkflowConditionTaskLogic,
|
|
2259
|
+
WorkflowConditionTaskOperator,
|
|
2260
|
+
WorkflowConditionTaskOperatorGroup,
|
|
2261
|
+
WorkflowConditionTaskOperatorValueType,
|
|
2262
|
+
WorkflowCustomTaskName,
|
|
2263
|
+
WorkflowExecutionDefinitionStatus,
|
|
2264
|
+
WorkflowExecutionStatus,
|
|
2265
|
+
WorkflowExecutionTaskStatus,
|
|
2266
|
+
WorkflowItemKind,
|
|
2267
|
+
WorkflowTaskType,
|
|
2268
|
+
WorkflowTemplateCategory,
|
|
2269
|
+
WorkflowTriggerType,
|
|
2270
|
+
getWorkflowApiCrmConfig,
|
|
2271
|
+
isFilter,
|
|
2272
|
+
isFilterGroup,
|
|
2273
|
+
serializeFilters
|
|
2274
|
+
});
|