@opens/gateways 1.15.13 → 1.15.15
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/calls/contracts/index.d.mts +12 -0
- package/dist/calls/contracts/index.d.ts +12 -0
- package/dist/calls/contracts/index.js +19 -0
- package/dist/calls/contracts/index.js.map +1 -0
- package/dist/calls/contracts/index.mjs +1 -0
- package/dist/calls/contracts/index.mjs.map +1 -0
- package/dist/chat-webservice/contracts/index.d.mts +37 -1
- package/dist/chat-webservice/contracts/index.d.ts +37 -1
- package/dist/customer-service/contracts/index.d.mts +104 -12
- package/dist/customer-service/contracts/index.d.ts +104 -12
- package/dist/customer-service/contracts/index.js.map +1 -1
- package/dist/index.d.mts +69 -5
- package/dist/index.d.ts +69 -5
- package/dist/index.js +103 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +103 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -15,6 +15,35 @@ var CustomerServiceGateway = class {
|
|
|
15
15
|
const { data } = await this.httpClient.get(`${this.baseUrl}/companies/search/${companyId}`);
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Updates the current company settings.
|
|
20
|
+
* @param payload - The company fields to update.
|
|
21
|
+
* @returns The updated company data wrapped in a {@link CompanyResponse}.
|
|
22
|
+
*/
|
|
23
|
+
async updateCompany(payload) {
|
|
24
|
+
const { data } = await this.httpClient.put(`${this.baseUrl}/companies`, payload);
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Updates the support widget identifier for the current company.
|
|
29
|
+
* @param payload - The support widget identifier to set.
|
|
30
|
+
* @returns The updated company support widget data.
|
|
31
|
+
*/
|
|
32
|
+
async updateSupportWidgetId(payload) {
|
|
33
|
+
const { data } = await this.httpClient.put(
|
|
34
|
+
`${this.baseUrl}/companies/support-widget-id`,
|
|
35
|
+
payload
|
|
36
|
+
);
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves the list of queues configured for the current company.
|
|
41
|
+
* @returns The company queues.
|
|
42
|
+
*/
|
|
43
|
+
async getCompanyQueues() {
|
|
44
|
+
const { data } = await this.httpClient.get(`${this.baseUrl}/companies/queues`);
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
18
47
|
/**
|
|
19
48
|
* Retrieves the strong password options config for a company.
|
|
20
49
|
* @param companyId - The unique identifier of the company.
|
|
@@ -27,6 +56,44 @@ var CustomerServiceGateway = class {
|
|
|
27
56
|
);
|
|
28
57
|
return data;
|
|
29
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Updates the strong password options config for the current company.
|
|
61
|
+
* @param payload - The strong password policy rules to apply.
|
|
62
|
+
* @returns The updated strong password options company config.
|
|
63
|
+
*/
|
|
64
|
+
async updateStrongPasswordOptions(payload) {
|
|
65
|
+
const { data } = await this.httpClient.put(
|
|
66
|
+
`${this.baseUrl}/companies/configs/strong-password-options`,
|
|
67
|
+
payload
|
|
68
|
+
);
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Updates a boolean company config by key.
|
|
73
|
+
* @param key - The config key to update.
|
|
74
|
+
* @param payload - The boolean value to set.
|
|
75
|
+
* @returns The updated company config entry.
|
|
76
|
+
*/
|
|
77
|
+
async updateCompanyBooleanConfig(key, payload) {
|
|
78
|
+
const { data } = await this.httpClient.put(
|
|
79
|
+
`${this.baseUrl}/companies/configs/${key}`,
|
|
80
|
+
payload
|
|
81
|
+
);
|
|
82
|
+
return data;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Updates a string company config by key.
|
|
86
|
+
* @param key - The config key to update.
|
|
87
|
+
* @param payload - The string value to set.
|
|
88
|
+
* @returns The updated company config entry.
|
|
89
|
+
*/
|
|
90
|
+
async updateCompanyStringConfig(key, payload) {
|
|
91
|
+
const { data } = await this.httpClient.put(
|
|
92
|
+
`${this.baseUrl}/companies/configs/${key}`,
|
|
93
|
+
payload
|
|
94
|
+
);
|
|
95
|
+
return data;
|
|
96
|
+
}
|
|
30
97
|
/**
|
|
31
98
|
* Retrieves a user by login email.
|
|
32
99
|
* @param email - The user email used as login identifier.
|
|
@@ -983,6 +1050,15 @@ var ChatWebserviceGateway = class {
|
|
|
983
1050
|
const { data } = await this.httpClient.post(`${this.baseUrl}/message`, payload);
|
|
984
1051
|
return data;
|
|
985
1052
|
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Creates a forwarded chat message.
|
|
1055
|
+
* @param payload - The message content and forwarding metadata.
|
|
1056
|
+
* @returns The created message.
|
|
1057
|
+
*/
|
|
1058
|
+
async forwardMessage(payload) {
|
|
1059
|
+
const { data } = await this.httpClient.post(`${this.baseUrl}/message/forward`, payload);
|
|
1060
|
+
return data;
|
|
1061
|
+
}
|
|
986
1062
|
/**
|
|
987
1063
|
* Sends a chat message that includes attachments.
|
|
988
1064
|
* @param payload - The message content, attachments, and routing metadata.
|
|
@@ -1049,6 +1125,24 @@ var CallReportGateway = class {
|
|
|
1049
1125
|
}
|
|
1050
1126
|
};
|
|
1051
1127
|
|
|
1128
|
+
// src/calls/index.ts
|
|
1129
|
+
var CallsGateway = class {
|
|
1130
|
+
constructor(httpClient, baseUrl) {
|
|
1131
|
+
this.httpClient = httpClient;
|
|
1132
|
+
this.baseUrl = baseUrl;
|
|
1133
|
+
}
|
|
1134
|
+
httpClient;
|
|
1135
|
+
baseUrl;
|
|
1136
|
+
/**
|
|
1137
|
+
* Retrieves all call endpoints and their current status.
|
|
1138
|
+
* @returns The list of call endpoints.
|
|
1139
|
+
*/
|
|
1140
|
+
async getEndpoints() {
|
|
1141
|
+
const { data } = await this.httpClient.get(`${this.baseUrl}/endpoints`);
|
|
1142
|
+
return data;
|
|
1143
|
+
}
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1052
1146
|
// src/cases/index.ts
|
|
1053
1147
|
var CasesGateway = class {
|
|
1054
1148
|
constructor(httpClient, baseUrl) {
|
|
@@ -1232,10 +1326,11 @@ var SDKGateways = class {
|
|
|
1232
1326
|
integrations;
|
|
1233
1327
|
chatWebservice;
|
|
1234
1328
|
callReport;
|
|
1329
|
+
calls;
|
|
1235
1330
|
cases;
|
|
1236
1331
|
rh;
|
|
1237
1332
|
accessHub;
|
|
1238
|
-
constructor(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations, chatWebservice, callReport, cases, rh, accessHub) {
|
|
1333
|
+
constructor(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations, chatWebservice, callReport, calls, cases, rh, accessHub) {
|
|
1239
1334
|
this.customerService = customerService;
|
|
1240
1335
|
this.chatConfig = chatConfig;
|
|
1241
1336
|
this.campaigns = campaigns;
|
|
@@ -1245,6 +1340,7 @@ var SDKGateways = class {
|
|
|
1245
1340
|
this.integrations = integrations;
|
|
1246
1341
|
this.chatWebservice = chatWebservice;
|
|
1247
1342
|
this.callReport = callReport;
|
|
1343
|
+
this.calls = calls;
|
|
1248
1344
|
this.cases = cases;
|
|
1249
1345
|
this.rh = rh;
|
|
1250
1346
|
this.accessHub = accessHub;
|
|
@@ -1265,6 +1361,7 @@ function createClient(params) {
|
|
|
1265
1361
|
const integrations = params.services.integrations ? new IntegrationsGateway(httpClient, params.services.integrations.baseUrl) : null;
|
|
1266
1362
|
const chatWebservice = params.services.chatWebservice ? new ChatWebserviceGateway(httpClient, params.services.chatWebservice.baseUrl) : null;
|
|
1267
1363
|
const callReport = params.services.callReport ? new CallReportGateway(httpClient, params.services.callReport.baseUrl) : null;
|
|
1364
|
+
const calls = params.services.calls ? new CallsGateway(httpClient, params.services.calls.baseUrl) : null;
|
|
1268
1365
|
const cases = params.services.cases ? new CasesGateway(httpClient, params.services.cases.baseUrl) : null;
|
|
1269
1366
|
const rh = params.services.rh ? new RhGateway(httpClient, params.services.rh.baseUrl) : null;
|
|
1270
1367
|
const accessHub = params.services.accessHub ? new AccessHubGateway(httpClient, params.services.accessHub.baseUrl) : null;
|
|
@@ -1278,6 +1375,7 @@ function createClient(params) {
|
|
|
1278
1375
|
integrations,
|
|
1279
1376
|
chatWebservice,
|
|
1280
1377
|
callReport,
|
|
1378
|
+
calls,
|
|
1281
1379
|
cases,
|
|
1282
1380
|
rh,
|
|
1283
1381
|
accessHub
|
|
@@ -1295,6 +1393,7 @@ var SERVICE_GATEWAYS = {
|
|
|
1295
1393
|
INTEGRATIONS: "integrations",
|
|
1296
1394
|
CHAT_WEBSERVICE: "chat-webservice",
|
|
1297
1395
|
CALL_REPORT: "call-report",
|
|
1396
|
+
CALLS: "calls",
|
|
1298
1397
|
CASES: "cases",
|
|
1299
1398
|
RH: "rh",
|
|
1300
1399
|
ACCESS_HUB: "access-hub"
|
|
@@ -1353,6 +1452,9 @@ function gateway(service) {
|
|
|
1353
1452
|
if (!sdk.client.callReport)
|
|
1354
1453
|
throw new Error(`Service 'call-report' is not configured. Provide its baseUrl in configure().`);
|
|
1355
1454
|
return sdk.client.callReport;
|
|
1455
|
+
case SERVICE_GATEWAYS.CALLS:
|
|
1456
|
+
if (!sdk.client.calls) throw new Error(`Service 'calls' is not configured. Provide its baseUrl in configure().`);
|
|
1457
|
+
return sdk.client.calls;
|
|
1356
1458
|
case SERVICE_GATEWAYS.CASES:
|
|
1357
1459
|
if (!sdk.client.cases) throw new Error(`Service 'cases' is not configured. Provide its baseUrl in configure().`);
|
|
1358
1460
|
return sdk.client.cases;
|