@unboundcx/sdk 4.13.116 → 4.13.117

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/index.js CHANGED
@@ -23,6 +23,7 @@ import { DealRegistrationsService } from './services/dealRegistrations.js';
23
23
  import { SipEndpointsService } from './services/sipEndpoints.js';
24
24
  import { RingGroupsService } from './services/ringGroups.js';
25
25
  import { LineGroupsService } from './services/lineGroups.js';
26
+ import { EmergencyService } from './services/emergency.js';
26
27
  import { WebchatService } from './services/webchat.js';
27
28
  import { CobrowseService } from './services/cobrowse.js';
28
29
  import { MessageTemplatesService } from './services/messageTemplates.js';
@@ -124,6 +125,7 @@ class UnboundSDK extends BaseSDK {
124
125
  this.sipEndpoints = new SipEndpointsService(this);
125
126
  this.ringGroups = new RingGroupsService(this);
126
127
  this.lineGroups = new LineGroupsService(this);
128
+ this.emergency = new EmergencyService(this);
127
129
  this.webchat = new WebchatService(this);
128
130
  this.cobrowse = new CobrowseService(this);
129
131
  this.messageTemplates = new MessageTemplatesService(this);
@@ -326,6 +328,7 @@ export { DealRegistrationsService } from './services/dealRegistrations.js';
326
328
  export { SipEndpointsService } from './services/sipEndpoints.js';
327
329
  export { RingGroupsService } from './services/ringGroups.js';
328
330
  export { LineGroupsService } from './services/lineGroups.js';
331
+ export { EmergencyService } from './services/emergency.js';
329
332
  export { WebchatService, WebchatWidgetsService } from './services/webchat.js';
330
333
  export { CobrowseService, CobrowseVisitorService } from './services/cobrowse.js';
331
334
  export { MessageTemplatesService } from './services/messageTemplates.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "4.13.116",
3
+ "version": "4.13.117",
4
4
  "description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,148 @@
1
+ import { internalRequest } from '../base.js';
2
+
3
+ export class EmergencyService {
4
+ constructor(sdk) {
5
+ this.sdk = sdk;
6
+ }
7
+
8
+ async getMyLocation() {
9
+ return await internalRequest(this.sdk, '/emergency/me', 'GET', {});
10
+ }
11
+
12
+ async saveMyLocation(body) {
13
+ this.sdk.validateParams(
14
+ { body },
15
+ { body: { type: 'object', required: true } },
16
+ );
17
+ return await internalRequest(this.sdk, '/emergency/me', 'PUT', { body });
18
+ }
19
+
20
+ async validateAddress(body) {
21
+ this.sdk.validateParams(
22
+ { body },
23
+ { body: { type: 'object', required: true } },
24
+ );
25
+ return await internalRequest(this.sdk, '/emergency/validate', 'POST', {
26
+ body,
27
+ });
28
+ }
29
+
30
+ async listSites() {
31
+ return await internalRequest(this.sdk, '/emergency/sites', 'GET', {});
32
+ }
33
+
34
+ async createSite(body) {
35
+ this.sdk.validateParams(
36
+ { body },
37
+ { body: { type: 'object', required: true } },
38
+ );
39
+ return await internalRequest(this.sdk, '/emergency/sites', 'POST', { body });
40
+ }
41
+
42
+ async updateSite(id, body) {
43
+ this.sdk.validateParams(
44
+ { id, body },
45
+ {
46
+ id: { type: 'string', required: true },
47
+ body: { type: 'object', required: true },
48
+ },
49
+ );
50
+ return await internalRequest(this.sdk, `/emergency/sites/${id}`, 'PATCH', {
51
+ body,
52
+ });
53
+ }
54
+
55
+ async deleteSite(id) {
56
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
57
+ return await internalRequest(this.sdk, `/emergency/sites/${id}`, 'DELETE', {});
58
+ }
59
+
60
+ async addFloor(id, body) {
61
+ this.sdk.validateParams(
62
+ { id, body },
63
+ {
64
+ id: { type: 'string', required: true },
65
+ body: { type: 'object', required: true },
66
+ },
67
+ );
68
+ return await internalRequest(
69
+ this.sdk,
70
+ `/emergency/sites/${id}/floors`,
71
+ 'POST',
72
+ { body },
73
+ );
74
+ }
75
+
76
+ async deleteFloor(id, floorId) {
77
+ this.sdk.validateParams(
78
+ { id, floorId },
79
+ {
80
+ id: { type: 'string', required: true },
81
+ floorId: { type: 'string', required: true },
82
+ },
83
+ );
84
+ return await internalRequest(
85
+ this.sdk,
86
+ `/emergency/sites/${id}/floors/${floorId}`,
87
+ 'DELETE',
88
+ {},
89
+ );
90
+ }
91
+
92
+ async listAlertRules() {
93
+ return await internalRequest(this.sdk, '/emergency/alert-rules', 'GET', {});
94
+ }
95
+
96
+ async createAlertRule(body) {
97
+ this.sdk.validateParams(
98
+ { body },
99
+ { body: { type: 'object', required: true } },
100
+ );
101
+ return await internalRequest(this.sdk, '/emergency/alert-rules', 'POST', {
102
+ body,
103
+ });
104
+ }
105
+
106
+ async updateAlertRule(id, body) {
107
+ this.sdk.validateParams(
108
+ { id, body },
109
+ {
110
+ id: { type: 'string', required: true },
111
+ body: { type: 'object', required: true },
112
+ },
113
+ );
114
+ return await internalRequest(
115
+ this.sdk,
116
+ `/emergency/alert-rules/${id}`,
117
+ 'PATCH',
118
+ { body },
119
+ );
120
+ }
121
+
122
+ async deleteAlertRule(id) {
123
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
124
+ return await internalRequest(
125
+ this.sdk,
126
+ `/emergency/alert-rules/${id}`,
127
+ 'DELETE',
128
+ {},
129
+ );
130
+ }
131
+
132
+ async listPoolNumbers() {
133
+ return await internalRequest(this.sdk, '/emergency/pool', 'GET', {});
134
+ }
135
+
136
+ async markPoolNumber(body) {
137
+ this.sdk.validateParams(
138
+ { body },
139
+ { body: { type: 'object', required: true } },
140
+ );
141
+ return await internalRequest(this.sdk, '/emergency/pool', 'POST', { body });
142
+ }
143
+
144
+ async unmarkPoolNumber(id) {
145
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
146
+ return await internalRequest(this.sdk, `/emergency/pool/${id}`, 'DELETE', {});
147
+ }
148
+ }