@opens/gateways 1.15.14 → 1.15.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -15,6 +15,59 @@ 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
+ * Retrieves the support widget identifier for the current company.
29
+ * @returns The support widget identifier.
30
+ */
31
+ async getSupportWidgetId() {
32
+ const { data } = await this.httpClient.get(
33
+ `${this.baseUrl}/companies/support-widget-id`
34
+ );
35
+ return data;
36
+ }
37
+ /**
38
+ * Updates the support widget identifier for the current company.
39
+ * @param payload - The support widget identifier to set.
40
+ * @returns The updated company support widget data.
41
+ */
42
+ async updateSupportWidgetId(payload) {
43
+ const { data } = await this.httpClient.put(
44
+ `${this.baseUrl}/companies/support-widget-id`,
45
+ payload
46
+ );
47
+ return data;
48
+ }
49
+ /**
50
+ * Retrieves the list of queues configured for the current company.
51
+ * @returns The company queues.
52
+ */
53
+ async getCompanyQueues() {
54
+ const { data } = await this.httpClient.get(`${this.baseUrl}/companies/queues`);
55
+ return data;
56
+ }
57
+ /**
58
+ * Retrieves the current company data along with all its config entries.
59
+ * @returns The company data with its configs.
60
+ */
61
+ async getCompanyConfigs() {
62
+ const { data } = await this.httpClient.get(`${this.baseUrl}/companies/configs`);
63
+ return data;
64
+ }
65
+ async getCompanyConfig(key) {
66
+ const { data } = await this.httpClient.get(
67
+ `${this.baseUrl}/companies/configs/${key}`
68
+ );
69
+ return data;
70
+ }
18
71
  /**
19
72
  * Retrieves the strong password options config for a company.
20
73
  * @param companyId - The unique identifier of the company.
@@ -27,6 +80,44 @@ var CustomerServiceGateway = class {
27
80
  );
28
81
  return data;
29
82
  }
83
+ /**
84
+ * Updates the strong password options config for the current company.
85
+ * @param payload - The strong password policy rules to apply.
86
+ * @returns The updated strong password options company config.
87
+ */
88
+ async updateStrongPasswordOptions(payload) {
89
+ const { data } = await this.httpClient.put(
90
+ `${this.baseUrl}/companies/configs/strong-password-options`,
91
+ payload
92
+ );
93
+ return data;
94
+ }
95
+ /**
96
+ * Updates a boolean company config by key.
97
+ * @param key - The config key to update.
98
+ * @param payload - The boolean value to set.
99
+ * @returns The updated company config entry.
100
+ */
101
+ async updateCompanyBooleanConfig(key, payload) {
102
+ const { data } = await this.httpClient.put(
103
+ `${this.baseUrl}/companies/configs/${key}`,
104
+ payload
105
+ );
106
+ return data;
107
+ }
108
+ /**
109
+ * Updates a string company config by key.
110
+ * @param key - The config key to update.
111
+ * @param payload - The string value to set.
112
+ * @returns The updated company config entry.
113
+ */
114
+ async updateCompanyStringConfig(key, payload) {
115
+ const { data } = await this.httpClient.put(
116
+ `${this.baseUrl}/companies/configs/${key}`,
117
+ payload
118
+ );
119
+ return data;
120
+ }
30
121
  /**
31
122
  * Retrieves a user by login email.
32
123
  * @param email - The user email used as login identifier.
@@ -1058,6 +1149,24 @@ var CallReportGateway = class {
1058
1149
  }
1059
1150
  };
1060
1151
 
1152
+ // src/calls/index.ts
1153
+ var CallsGateway = class {
1154
+ constructor(httpClient, baseUrl) {
1155
+ this.httpClient = httpClient;
1156
+ this.baseUrl = baseUrl;
1157
+ }
1158
+ httpClient;
1159
+ baseUrl;
1160
+ /**
1161
+ * Retrieves all call endpoints and their current status.
1162
+ * @returns The list of call endpoints.
1163
+ */
1164
+ async getEndpoints() {
1165
+ const { data } = await this.httpClient.get(`${this.baseUrl}/endpoints`);
1166
+ return data;
1167
+ }
1168
+ };
1169
+
1061
1170
  // src/cases/index.ts
1062
1171
  var CasesGateway = class {
1063
1172
  constructor(httpClient, baseUrl) {
@@ -1241,10 +1350,11 @@ var SDKGateways = class {
1241
1350
  integrations;
1242
1351
  chatWebservice;
1243
1352
  callReport;
1353
+ calls;
1244
1354
  cases;
1245
1355
  rh;
1246
1356
  accessHub;
1247
- constructor(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations, chatWebservice, callReport, cases, rh, accessHub) {
1357
+ constructor(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations, chatWebservice, callReport, calls, cases, rh, accessHub) {
1248
1358
  this.customerService = customerService;
1249
1359
  this.chatConfig = chatConfig;
1250
1360
  this.campaigns = campaigns;
@@ -1254,6 +1364,7 @@ var SDKGateways = class {
1254
1364
  this.integrations = integrations;
1255
1365
  this.chatWebservice = chatWebservice;
1256
1366
  this.callReport = callReport;
1367
+ this.calls = calls;
1257
1368
  this.cases = cases;
1258
1369
  this.rh = rh;
1259
1370
  this.accessHub = accessHub;
@@ -1274,6 +1385,7 @@ function createClient(params) {
1274
1385
  const integrations = params.services.integrations ? new IntegrationsGateway(httpClient, params.services.integrations.baseUrl) : null;
1275
1386
  const chatWebservice = params.services.chatWebservice ? new ChatWebserviceGateway(httpClient, params.services.chatWebservice.baseUrl) : null;
1276
1387
  const callReport = params.services.callReport ? new CallReportGateway(httpClient, params.services.callReport.baseUrl) : null;
1388
+ const calls = params.services.calls ? new CallsGateway(httpClient, params.services.calls.baseUrl) : null;
1277
1389
  const cases = params.services.cases ? new CasesGateway(httpClient, params.services.cases.baseUrl) : null;
1278
1390
  const rh = params.services.rh ? new RhGateway(httpClient, params.services.rh.baseUrl) : null;
1279
1391
  const accessHub = params.services.accessHub ? new AccessHubGateway(httpClient, params.services.accessHub.baseUrl) : null;
@@ -1287,6 +1399,7 @@ function createClient(params) {
1287
1399
  integrations,
1288
1400
  chatWebservice,
1289
1401
  callReport,
1402
+ calls,
1290
1403
  cases,
1291
1404
  rh,
1292
1405
  accessHub
@@ -1304,6 +1417,7 @@ var SERVICE_GATEWAYS = {
1304
1417
  INTEGRATIONS: "integrations",
1305
1418
  CHAT_WEBSERVICE: "chat-webservice",
1306
1419
  CALL_REPORT: "call-report",
1420
+ CALLS: "calls",
1307
1421
  CASES: "cases",
1308
1422
  RH: "rh",
1309
1423
  ACCESS_HUB: "access-hub"
@@ -1362,6 +1476,9 @@ function gateway(service) {
1362
1476
  if (!sdk.client.callReport)
1363
1477
  throw new Error(`Service 'call-report' is not configured. Provide its baseUrl in configure().`);
1364
1478
  return sdk.client.callReport;
1479
+ case SERVICE_GATEWAYS.CALLS:
1480
+ if (!sdk.client.calls) throw new Error(`Service 'calls' is not configured. Provide its baseUrl in configure().`);
1481
+ return sdk.client.calls;
1365
1482
  case SERVICE_GATEWAYS.CASES:
1366
1483
  if (!sdk.client.cases) throw new Error(`Service 'cases' is not configured. Provide its baseUrl in configure().`);
1367
1484
  return sdk.client.cases;