@signalhousellc/sdk 1.0.67 → 1.0.68

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.
@@ -1,3 +1,9 @@
1
+ /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+
1
7
  /**
2
8
  * @typedef {Object} CreateUserData
3
9
  * @property {string} groupId - The ID of the group to which the user belongs (must start with "G" and be at least 8 characters long)
@@ -61,8 +67,8 @@ export class Users {
61
67
  * @param {string} [params.search] - Search users by email (case-insensitive)
62
68
  * @param {string} [params.sortBy] - Field to sort by (createdAt, email, activeGroupId, companyName, status, _id)
63
69
  * @param {string} [params.sortOrder] - Sort direction (asc, desc)
64
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
65
- * @returns {Promise<Object>} - A promise that resolves to the list of users
70
+ * @param {RequestOptions} [params.options] - Additional options for the request
71
+ * @returns {Promise<SdkResponse<any>>} - A promise that resolves to the list of users
66
72
  */
67
73
  getUsers: async ({ email, userType, page, limit, search, sortBy, sortOrder, options = {} }) => {
68
74
  const filters = { email, userType, page, limit, search, sortBy, sortOrder };
@@ -75,8 +81,8 @@ export class Users {
75
81
  * @roles signalhouse
76
82
  * @param {Object} params - The parameters for creating an internal user
77
83
  * @param {CreateServiceUserData} params.data - The data for the new internal user
78
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
79
- * @returns {Promise<Object>} - A promise that resolves to the created internal user
84
+ * @param {RequestOptions} [params.options] - Additional options for the request
85
+ * @returns {Promise<SdkResponse<any>>} - A promise that resolves to the created internal user
80
86
  */
81
87
  createInternalUser: async ({ data, options = {} }) => {
82
88
  this.client._require({ data: data });
@@ -99,8 +105,8 @@ export class Users {
99
105
  * @param {string} [params.search] - Search users by email (case-insensitive)
100
106
  * @param {string} [params.sortBy] - Field to sort by (createdAt, email, activeGroupId, companyName, status, _id)
101
107
  * @param {string} [params.sortOrder] - Sort direction (asc, desc)
102
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
103
- * @returns {Promise<Object>} - A promise that resolves to the list of users
108
+ * @param {RequestOptions} [params.options] - Additional options for the request
109
+ * @returns {Promise<SdkResponse<any>>} - A promise that resolves to the list of users
104
110
  */
105
111
  async getUsers({ id, groupId, userType, page, limit, search, sortBy, sortOrder, options = {} }) {
106
112
  const filters = { id, groupId, userType, page, limit, search, sortBy, sortOrder };
@@ -114,9 +120,9 @@ export class Users {
114
120
  * @roles api, admin
115
121
  * @param {Object} params - The parameters for creating a user (see CreateUserData typedef for details)
116
122
  * @param {CreateUserData} params.data - The data for the new user
117
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
123
+ * @param {RequestOptions} [params.options] - Additional options for the request
118
124
  * @throws {Error} Throws an error if required fields in the data parameter are missing
119
- * @returns {Promise<Object>} - A promise that resolves to the created user
125
+ * @returns {Promise<SdkResponse<any>>} - A promise that resolves to the created user
120
126
  */
121
127
  async createUser({ data, options = {} }) {
122
128
  this.client._require({ data: data });
@@ -129,9 +135,9 @@ export class Users {
129
135
  * @roles admin, developer
130
136
  * @param {Object} params - The parameters for creating a service user (see CreateServiceUserData typedef for details)
131
137
  * @param {CreateServiceUserData} params.data - The data for the new service user
132
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
138
+ * @param {RequestOptions} [params.options] - Additional options for the request
133
139
  * @throws {Error} Throws an error if required fields in the data parameter are missing
134
- * @returns {Promise<Object>} - A promise that resolves to the created service user
140
+ * @returns {Promise<SdkResponse<any>>} - A promise that resolves to the created service user
135
141
  */
136
142
  async createServiceUser({ data, options = {} }) {
137
143
  this.client._require({ data: data });
@@ -145,9 +151,9 @@ export class Users {
145
151
  * @param {Object} params - The parameters for updating a user (see UpdateUserData typedef for details)
146
152
  * @param {string} params.id - The ID of the user to update
147
153
  * @param {UpdateUserData} params.data - The data to update for the user
148
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
154
+ * @param {RequestOptions} [params.options] - Additional options for the request
149
155
  * @throws {Error} Throws an error if required fields in the data parameter are missing
150
- * @returns {Promise<Object>} - A promise that resolves to the updated user
156
+ * @returns {Promise<SdkResponse<any>>} - A promise that resolves to the updated user
151
157
  */
152
158
  async updateUser({ id, data, options = {} }) {
153
159
  this.client._require({ id, data: data });
@@ -161,9 +167,9 @@ export class Users {
161
167
  * @roles api, admin
162
168
  * @param {Object} params - The parameters for deleting a user
163
169
  * @param {string} params.id - The ID of the user to delete
164
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
170
+ * @param {RequestOptions} [params.options] - Additional options for the request
165
171
  * @throws {Error} Throws an error if the id parameter is missing
166
- * @returns {Promise<Object>} - A promise that resolves to the deleted user
172
+ * @returns {Promise<SdkResponse<any>>} - A promise that resolves to the deleted user
167
173
  */
168
174
  async deleteUser({ id, options = {} }) {
169
175
  this.client._require({ id });
@@ -176,8 +182,8 @@ export class Users {
176
182
  * @async
177
183
  * @roles api, admin, developer, billing, user
178
184
  * @param {Object} [params]
179
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
180
- * @returns {Promise<Object>} The response from the server ({ acceptedTermsOfService: true })
185
+ * @param {RequestOptions} [params.options] - Additional options for the request
186
+ * @returns {Promise<SdkResponse<any>>} The response from the server ({ acceptedTermsOfService: true })
181
187
  */
182
188
  async acceptTermsOfService({ options = {} } = {}) {
183
189
  return this.client(`/user/accept-terms`, { method: "PUT", body: { acceptedTermsOfService: true }, ...options });
@@ -189,8 +195,8 @@ export class Users {
189
195
  * @roles api, admin, self
190
196
  * @param {Object} params
191
197
  * @param {string} params.id - The ID of the user
192
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
193
- * @returns {Promise<Object>} The response from the server
198
+ * @param {RequestOptions} [params.options] - Additional options for the request
199
+ * @returns {Promise<SdkResponse<any>>} The response from the server
194
200
  */
195
201
  async getNotificationPreferences({ id, options = {} }) {
196
202
  this.client._require({ id });
@@ -205,8 +211,8 @@ export class Users {
205
211
  * @param {Object} params
206
212
  * @param {string} params.id - The ID of the user
207
213
  * @param {Array<{name: string, web: boolean, email: boolean}>} params.notificationPreferences - Array of notification preference objects
208
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
209
- * @returns {Promise<Object>} The response from the server
214
+ * @param {RequestOptions} [params.options] - Additional options for the request
215
+ * @returns {Promise<SdkResponse<any>>} The response from the server
210
216
  */
211
217
  async updateNotificationPreferences({ id, notificationPreferences, options = {} }) {
212
218
  this.client._require({ id, notificationPreferences });
@@ -1,3 +1,9 @@
1
+ /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+
1
7
  export class Webhooks {
2
8
  constructor(client, enableAdmin) {
3
9
  this.client = client;
@@ -17,8 +23,8 @@ export class Webhooks {
17
23
  * @param {string} [params.phoneNumber] - Filter by associated phone number (for SMS webhooks)
18
24
  * @param {number} [params.page] - The page number for pagination
19
25
  * @param {number} [params.limit] - The number of items per page for pagination
20
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
21
- * @returns {Promise<Array>} The response from the server
26
+ * @param {RequestOptions} [params.options] - Additional options for the request
27
+ * @returns {Promise<SdkResponse<Array>>} The response from the server
22
28
  */
23
29
  async getWebhooks({ id, groupId, endpointType, phoneNumber, page, limit, options = {} }) {
24
30
  const filters = { id, groupId, endpointType, phoneNumber, page, limit };
@@ -37,9 +43,9 @@ export class Webhooks {
37
43
  * @roles api, admin, developer
38
44
  * @param {Object} params - The parameters for creating a webhook
39
45
  * @param {Object} params.webhookData - The data for the new webhook
40
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
46
+ * @param {RequestOptions} [params.options] - Additional options for the request
41
47
  * @throws {Error} Throws an error if the webhookData parameter is missing or if required fields in webhookData are missing
42
- * @returns {Promise<Object>} The response from the server, including the plaintext `signingSecret` (this one time only)
48
+ * @returns {Promise<SdkResponse<any>>} The response from the server, including the plaintext `signingSecret` (this one time only)
43
49
  */
44
50
  async createWebhook({ webhookData, options = {} }) {
45
51
  this.client._require({ webhookData: webhookData });
@@ -55,9 +61,9 @@ export class Webhooks {
55
61
  * @param {Object} params - The parameters for updating a webhook
56
62
  * @param {string} params.id - The ID of the webhook to update
57
63
  * @param {Object} params.updateData - The data for the webhook to be updated, including fields such as endpoint URL and event types
58
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
64
+ * @param {RequestOptions} [params.options] - Additional options for the request
59
65
  * @throws {Error} Throws an error if the id or updateData parameter is missing
60
- * @returns {Promise<Object>} The response from the server
66
+ * @returns {Promise<SdkResponse<any>>} The response from the server
61
67
  */
62
68
  async updateWebhook({ id, updateData, options = {} }) {
63
69
  this.client._require({ id, updateData });
@@ -71,9 +77,9 @@ export class Webhooks {
71
77
  * @roles api, admin, developer
72
78
  * @param {Object} params - The parameters for deleting a webhook
73
79
  * @param {string} params.id - The ID of the webhook to delete
74
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
80
+ * @param {RequestOptions} [params.options] - Additional options for the request
75
81
  * @throws {Error} Throws an error if the id parameter is missing
76
- * @returns {Promise<Object>} The response from the server
82
+ * @returns {Promise<SdkResponse<any>>} The response from the server
77
83
  */
78
84
  async deleteWebhook({ id, options = {} }) {
79
85
  this.client._require({ id });
@@ -1,3 +1,9 @@
1
+ /** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+
1
7
  /**
2
8
  * @typedef {Object} VoiceAnalyticsFilters
3
9
  * @property {string} [dateFrom] - ISO-8601 lower bound on call start time.
@@ -61,8 +67,8 @@ export class Analytics {
61
67
  * @roles api, admin, developer, billing, user
62
68
  * @param {Object} [params] - Request parameters.
63
69
  * @param {VoiceAnalyticsFilters} [params.filters] - Optional filters. Summary tiles honor every filter except `direction`; breakdowns honor all filters.
64
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
65
- * @returns {Promise<Object>} `{ success, range, outbound: VoiceDirectionSummary, inbound: VoiceDirectionSummary, byDate: VoiceBreakdownBucket[], byNumber: VoiceBreakdownBucket[], byCarrier: VoiceBreakdownBucket[], byChannel: VoiceBreakdownBucket[] }` (byChannel = per-callSource breakdown).
70
+ * @param {RequestOptions} [params.options] - Additional options for the request.
71
+ * @returns {Promise<SdkResponse<any>>} `{ success, range, outbound: VoiceDirectionSummary, inbound: VoiceDirectionSummary, byDate: VoiceBreakdownBucket[], byNumber: VoiceBreakdownBucket[], byCarrier: VoiceBreakdownBucket[], byChannel: VoiceBreakdownBucket[] }` (byChannel = per-callSource breakdown).
66
72
  */
67
73
  async get({ filters = {}, options = {} } = {}) {
68
74
  const query = new URLSearchParams();
@@ -1,3 +1,9 @@
1
+ /** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+
1
7
  /**
2
8
  * @typedef {Object} ListCallLogsFilters
3
9
  * @property {number} [page] - 1-indexed page (default 1).
@@ -40,8 +46,8 @@ export class CallLogs {
40
46
  * @roles api, admin, developer, billing, user
41
47
  * @param {Object} [params] - Request parameters.
42
48
  * @param {ListCallLogsFilters} [params.filters] - Optional filters.
43
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
44
- * @returns {Promise<Object>} `{ success, data: [...call logs], meta: { total, page, limit, totalPages } }`.
49
+ * @param {RequestOptions} [params.options] - Additional options for the request.
50
+ * @returns {Promise<SdkResponse<any>>} `{ success, data: [...call logs], meta: { total, page, limit, totalPages } }`.
45
51
  */
46
52
  async list({ filters = {}, options = {} } = {}) {
47
53
  const query = new URLSearchParams();
@@ -59,9 +65,9 @@ export class CallLogs {
59
65
  * @roles api, admin, developer, billing, user
60
66
  * @param {Object} params - Request parameters.
61
67
  * @param {string} params.id - The call log UUID or callId.
62
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
68
+ * @param {RequestOptions} [params.options] - Additional options for the request.
63
69
  * @throws {Error} If id is missing.
64
- * @returns {Promise<Object>} `{ success, data: { ...call log } }`.
70
+ * @returns {Promise<SdkResponse<any>>} `{ success, data: { ...call log } }`.
65
71
  */
66
72
  async get({ id, options = {} }) {
67
73
  this.client._require({ id });
@@ -76,9 +82,9 @@ export class CallLogs {
76
82
  * @roles api, admin, developer, billing, user
77
83
  * @param {Object} params - Request parameters.
78
84
  * @param {string} params.id - The call log UUID or callId.
79
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
85
+ * @param {RequestOptions} [params.options] - Additional options for the request.
80
86
  * @throws {Error} If id is missing.
81
- * @returns {Promise<Object>} `{ success, data: { callId, url, expiresIn } }`.
87
+ * @returns {Promise<SdkResponse<any>>} `{ success, data: { callId, url, expiresIn } }`.
82
88
  */
83
89
  async getRecording({ id, options = {} }) {
84
90
  this.client._require({ id });
@@ -93,9 +99,9 @@ export class CallLogs {
93
99
  * @param {Object} params - Request parameters.
94
100
  * @param {string} params.id - The call log UUID or callId.
95
101
  * @param {boolean} [params.read=true] - true = read, false = unread.
96
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
102
+ * @param {RequestOptions} [params.options] - Additional options for the request.
97
103
  * @throws {Error} If id is missing.
98
- * @returns {Promise<Object>} `{ success, data: { id, voicemailReadAt } }`.
104
+ * @returns {Promise<SdkResponse<any>>} `{ success, data: { id, voicemailReadAt } }`.
99
105
  */
100
106
  async markVoicemailRead({ id, read = true, options = {} }) {
101
107
  this.client._require({ id });
@@ -1,3 +1,9 @@
1
+ /** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+
1
7
  /**
2
8
  * @typedef {Object} CreateCallData
3
9
  * @property {string} to - Destination phone number in E.164 format (e.g. "+15551234567") or SIP URI.
@@ -48,9 +54,9 @@ export class Calls {
48
54
  * @roles api, admin, developer, billing, user
49
55
  * @param {Object} params - Request parameters.
50
56
  * @param {CreateCallData} params.callData - The call to place.
51
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
57
+ * @param {RequestOptions} [params.options] - Additional options for the request.
52
58
  * @throws {Error} If callData is missing.
53
- * @returns {Promise<Object>} The created call: `{ call_id, status, direction, from, to, created_at }`.
59
+ * @returns {Promise<SdkResponse<any>>} The created call: `{ call_id, status, direction, from, to, created_at }`.
54
60
  */
55
61
  async create({ callData, options = {} }) {
56
62
  this.client._require({ callData });
@@ -63,8 +69,8 @@ export class Calls {
63
69
  * @roles api, admin, developer, billing, user
64
70
  * @param {Object} [params] - Request parameters.
65
71
  * @param {ListCallsFilters} [params.filters] - Optional filters.
66
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
67
- * @returns {Promise<Object>} `{ calls: [...], total, page, limit }`.
72
+ * @param {RequestOptions} [params.options] - Additional options for the request.
73
+ * @returns {Promise<SdkResponse<any>>} `{ calls: [...], total, page, limit }`.
68
74
  */
69
75
  async list({ filters = {}, options = {} } = {}) {
70
76
  const query = new URLSearchParams();
@@ -82,9 +88,9 @@ export class Calls {
82
88
  * @roles api, admin, developer, billing, user
83
89
  * @param {Object} params - Request parameters.
84
90
  * @param {string} params.id - The call log UUID (the value returned as `call_id` from `create`).
85
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
91
+ * @param {RequestOptions} [params.options] - Additional options for the request.
86
92
  * @throws {Error} If id is missing.
87
- * @returns {Promise<Object>} The call log.
93
+ * @returns {Promise<SdkResponse<any>>} The call log.
88
94
  */
89
95
  async get({ id, options = {} }) {
90
96
  this.client._require({ id });
@@ -99,9 +105,9 @@ export class Calls {
99
105
  * @param {Object} params - Request parameters.
100
106
  * @param {string} params.id - The call log UUID.
101
107
  * @param {"NORMAL"|"BUSY"|"NO_ANSWER"|"REJECTED"} [params.reason] - Hangup reason recorded on the call log. Defaults to NORMAL.
102
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
108
+ * @param {RequestOptions} [params.options] - Additional options for the request.
103
109
  * @throws {Error} If id is missing.
104
- * @returns {Promise<Object>} `{ success: boolean, message: string }`.
110
+ * @returns {Promise<SdkResponse<any>>} `{ success: boolean, message: string }`.
105
111
  */
106
112
  async hangup({ id, reason, options = {} }) {
107
113
  this.client._require({ id });
@@ -1,3 +1,9 @@
1
+ /** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+
1
7
  /**
2
8
  * @typedef {Object} GlobalVoiceSettingsData
3
9
  * @property {string[]} [acceptedRegions] - Accepted regions as country calling codes; empty = all allowed.
@@ -23,8 +29,8 @@ export class GlobalVoiceSettings {
23
29
  * @async
24
30
  * @roles api, admin, developer, billing, user
25
31
  * @param {Object} [params] - Request parameters.
26
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
27
- * @returns {Promise<Object>} `{ success, data: { accountId, acceptedRegions, maxSpendPerMinute, e911Enabled, ... } | null }`.
32
+ * @param {RequestOptions} [params.options] - Additional options for the request.
33
+ * @returns {Promise<SdkResponse<any>>} `{ success, data: { accountId, acceptedRegions, maxSpendPerMinute, e911Enabled, ... } | null }`.
28
34
  */
29
35
  async get({ options = {} } = {}) {
30
36
  return this.client(`/voice/api/v1/global-voice-settings`, { method: "GET", ...options });
@@ -37,9 +43,9 @@ export class GlobalVoiceSettings {
37
43
  * @roles api, admin, developer
38
44
  * @param {Object} params - Request parameters.
39
45
  * @param {GlobalVoiceSettingsData} params.settingsData - Fields to set.
40
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
46
+ * @param {RequestOptions} [params.options] - Additional options for the request.
41
47
  * @throws {Error} If settingsData is missing.
42
- * @returns {Promise<Object>} `{ success, data: { ...settings } }`.
48
+ * @returns {Promise<SdkResponse<any>>} `{ success, data: { ...settings } }`.
43
49
  */
44
50
  async update({ settingsData, options = {} }) {
45
51
  this.client._require({ settingsData });
@@ -1,3 +1,9 @@
1
+ /** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+
1
7
  /**
2
8
  * @typedef {Object} CreateProgrammableVoiceProfileData
3
9
  * @property {string} name - Profile name (required).
@@ -49,8 +55,8 @@ export class ProgrammableVoiceProfiles {
49
55
  * @async
50
56
  * @roles api, admin, developer, billing, user
51
57
  * @param {Object} [params] - Request parameters.
52
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
53
- * @returns {Promise<Object>} `{ profiles: [...] }`.
58
+ * @param {RequestOptions} [params.options] - Additional options for the request.
59
+ * @returns {Promise<SdkResponse<any>>} `{ profiles: [...] }`.
54
60
  */
55
61
  async list({ options = {} } = {}) {
56
62
  return this.client(`/voice/api/v1/programmable-voice-profiles`, { method: "GET", ...options });
@@ -62,9 +68,9 @@ export class ProgrammableVoiceProfiles {
62
68
  * @roles api, admin, developer, billing, user
63
69
  * @param {Object} params - Request parameters.
64
70
  * @param {string} params.id - The profile UUID.
65
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
71
+ * @param {RequestOptions} [params.options] - Additional options for the request.
66
72
  * @throws {Error} If id is missing.
67
- * @returns {Promise<Object>} `{ profile: {...} }`.
73
+ * @returns {Promise<SdkResponse<any>>} `{ profile: {...} }`.
68
74
  */
69
75
  async get({ id, options = {} }) {
70
76
  this.client._require({ id });
@@ -78,9 +84,9 @@ export class ProgrammableVoiceProfiles {
78
84
  * @roles api, admin, developer
79
85
  * @param {Object} params - Request parameters.
80
86
  * @param {CreateProgrammableVoiceProfileData} params.profileData - The profile to create.
81
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
87
+ * @param {RequestOptions} [params.options] - Additional options for the request.
82
88
  * @throws {Error} If profileData is missing.
83
- * @returns {Promise<Object>} `{ profile: {...} }`.
89
+ * @returns {Promise<SdkResponse<any>>} `{ profile: {...} }`.
84
90
  */
85
91
  async create({ profileData, options = {} }) {
86
92
  this.client._require({ profileData });
@@ -94,9 +100,9 @@ export class ProgrammableVoiceProfiles {
94
100
  * @param {Object} params - Request parameters.
95
101
  * @param {string} params.id - The profile UUID.
96
102
  * @param {UpdateProgrammableVoiceProfileData} params.updateData - Fields to update.
97
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
103
+ * @param {RequestOptions} [params.options] - Additional options for the request.
98
104
  * @throws {Error} If id or updateData is missing.
99
- * @returns {Promise<Object>} `{ profile: {...} }`.
105
+ * @returns {Promise<SdkResponse<any>>} `{ profile: {...} }`.
100
106
  */
101
107
  async update({ id, updateData, options = {} }) {
102
108
  this.client._require({ id, updateData });
@@ -110,9 +116,9 @@ export class ProgrammableVoiceProfiles {
110
116
  * @roles api, admin, developer
111
117
  * @param {Object} params - Request parameters.
112
118
  * @param {string} params.id - The profile UUID.
113
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
119
+ * @param {RequestOptions} [params.options] - Additional options for the request.
114
120
  * @throws {Error} If id is missing.
115
- * @returns {Promise<Object>} `{ profile: {...} }`.
121
+ * @returns {Promise<SdkResponse<any>>} `{ profile: {...} }`.
116
122
  */
117
123
  async toggleActive({ id, options = {} }) {
118
124
  this.client._require({ id });
@@ -127,9 +133,9 @@ export class ProgrammableVoiceProfiles {
127
133
  * @roles api, admin, developer
128
134
  * @param {Object} params - Request parameters.
129
135
  * @param {string} params.id - The profile UUID.
130
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
136
+ * @param {RequestOptions} [params.options] - Additional options for the request.
131
137
  * @throws {Error} If id is missing.
132
- * @returns {Promise<Object>} `{ message: string }`.
138
+ * @returns {Promise<SdkResponse<any>>} `{ message: string }`.
133
139
  */
134
140
  async delete({ id, options = {} }) {
135
141
  this.client._require({ id });
@@ -146,9 +152,9 @@ export class ProgrammableVoiceProfiles {
146
152
  * @param {Object} params - Request parameters.
147
153
  * @param {string} params.id - The profile UUID.
148
154
  * @param {string} params.e164 - The phone number in E.164 (a leading "+" is optional).
149
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
155
+ * @param {RequestOptions} [params.options] - Additional options for the request.
150
156
  * @throws {Error} If id or e164 is missing.
151
- * @returns {Promise<Object>} `{ profile: {...} }`.
157
+ * @returns {Promise<SdkResponse<any>>} `{ profile: {...} }`.
152
158
  */
153
159
  async assignNumber({ id, e164, options = {} }) {
154
160
  this.client._require({ id, e164 });
@@ -167,9 +173,9 @@ export class ProgrammableVoiceProfiles {
167
173
  * @param {Object} params - Request parameters.
168
174
  * @param {string} params.id - The profile UUID.
169
175
  * @param {string} params.e164 - The phone number in E.164 (a leading "+" is optional).
170
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
176
+ * @param {RequestOptions} [params.options] - Additional options for the request.
171
177
  * @throws {Error} If id or e164 is missing.
172
- * @returns {Promise<Object>} `{ profile: {...} }`.
178
+ * @returns {Promise<SdkResponse<any>>} `{ profile: {...} }`.
173
179
  */
174
180
  async unassignNumber({ id, e164, options = {} }) {
175
181
  this.client._require({ id, e164 });
@@ -1,3 +1,9 @@
1
+ /** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+
1
7
  /**
2
8
  * @typedef {Object} CreateSipProfileData
3
9
  * @property {string} name - Profile name (required).
@@ -37,8 +43,8 @@ export class SipProfiles {
37
43
  * @async
38
44
  * @roles api, admin, developer, billing, user
39
45
  * @param {Object} [params] - Request parameters.
40
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
41
- * @returns {Promise<Object>} `{ sipProfiles: [...] }`.
46
+ * @param {RequestOptions} [params.options] - Additional options for the request.
47
+ * @returns {Promise<SdkResponse<any>>} `{ sipProfiles: [...] }`.
42
48
  */
43
49
  async list({ options = {} } = {}) {
44
50
  return this.client(`/voice/sip-profiles`, { method: "GET", ...options });
@@ -51,9 +57,9 @@ export class SipProfiles {
51
57
  * @roles api, admin, developer, billing, user
52
58
  * @param {Object} params - Request parameters.
53
59
  * @param {string} params.id - The SIP profile UUID.
54
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
60
+ * @param {RequestOptions} [params.options] - Additional options for the request.
55
61
  * @throws {Error} If id is missing.
56
- * @returns {Promise<Object>} `{ sipProfile: {...} }`.
62
+ * @returns {Promise<SdkResponse<any>>} `{ sipProfile: {...} }`.
57
63
  */
58
64
  async get({ id, options = {} }) {
59
65
  this.client._require({ id });
@@ -70,9 +76,9 @@ export class SipProfiles {
70
76
  * @roles api, admin, developer, billing, user
71
77
  * @param {Object} params - Request parameters.
72
78
  * @param {string} params.id - The SIP profile UUID.
73
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
79
+ * @param {RequestOptions} [params.options] - Additional options for the request.
74
80
  * @throws {Error} If id is missing.
75
- * @returns {Promise<Object>} `{ password: string|null }`.
81
+ * @returns {Promise<SdkResponse<any>>} `{ password: string|null }`.
76
82
  */
77
83
  async getPassword({ id, options = {} }) {
78
84
  this.client._require({ id });
@@ -86,8 +92,8 @@ export class SipProfiles {
86
92
  * @async
87
93
  * @roles api, admin, developer, billing, user
88
94
  * @param {Object} [params] - Request parameters.
89
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
90
- * @returns {Promise<Object>} `{ transports: [{ transport, address, port }, ...] }`.
95
+ * @param {RequestOptions} [params.options] - Additional options for the request.
96
+ * @returns {Promise<SdkResponse<any>>} `{ transports: [{ transport, address, port }, ...] }`.
91
97
  */
92
98
  async getTransports({ options = {} } = {}) {
93
99
  return this.client(`/voice/sip-profiles/transports`, { method: "GET", ...options });
@@ -102,9 +108,9 @@ export class SipProfiles {
102
108
  * @roles api, admin, developer, billing, user
103
109
  * @param {Object} params - Request parameters.
104
110
  * @param {CreateSipProfileData} params.profileData - The SIP profile to create.
105
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
111
+ * @param {RequestOptions} [params.options] - Additional options for the request.
106
112
  * @throws {Error} If profileData is missing.
107
- * @returns {Promise<Object>} `{ sipProfile: {...}, password: string, sipServer: string, message: string }`.
113
+ * @returns {Promise<SdkResponse<any>>} `{ sipProfile: {...}, password: string, sipServer: string, message: string }`.
108
114
  */
109
115
  async create({ profileData, options = {} }) {
110
116
  this.client._require({ profileData });
@@ -119,9 +125,9 @@ export class SipProfiles {
119
125
  * @param {Object} params - Request parameters.
120
126
  * @param {string} params.id - The SIP profile UUID.
121
127
  * @param {UpdateSipProfileData} params.updateData - Fields to update.
122
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
128
+ * @param {RequestOptions} [params.options] - Additional options for the request.
123
129
  * @throws {Error} If id or updateData is missing.
124
- * @returns {Promise<Object>} `{ sipProfile: {...} }`.
130
+ * @returns {Promise<SdkResponse<any>>} `{ sipProfile: {...} }`.
125
131
  */
126
132
  async update({ id, updateData, options = {} }) {
127
133
  this.client._require({ id, updateData });
@@ -136,9 +142,9 @@ export class SipProfiles {
136
142
  * @roles api, admin, developer, billing, user
137
143
  * @param {Object} params - Request parameters.
138
144
  * @param {string} params.id - The SIP profile UUID.
139
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
145
+ * @param {RequestOptions} [params.options] - Additional options for the request.
140
146
  * @throws {Error} If id is missing.
141
- * @returns {Promise<Object>} `{ message: string }`.
147
+ * @returns {Promise<SdkResponse<any>>} `{ message: string }`.
142
148
  */
143
149
  async delete({ id, options = {} }) {
144
150
  this.client._require({ id });
@@ -156,9 +162,9 @@ export class SipProfiles {
156
162
  * @param {string} params.id - The SIP profile UUID.
157
163
  * @param {string} [params.e164] - The phone number in E.164 to assign (preferred).
158
164
  * @param {string} [params.phoneNumberId] - Legacy: a voice-backend phone number UUID.
159
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
165
+ * @param {RequestOptions} [params.options] - Additional options for the request.
160
166
  * @throws {Error} If id is missing, or neither e164 nor phoneNumberId is provided.
161
- * @returns {Promise<Object>} `{ sipProfile: {...} }`.
167
+ * @returns {Promise<SdkResponse<any>>} `{ sipProfile: {...} }`.
162
168
  */
163
169
  async assignNumber({ id, e164, phoneNumberId, options = {} }) {
164
170
  this.client._require({ id });
@@ -180,9 +186,9 @@ export class SipProfiles {
180
186
  * @param {string} params.id - The SIP profile UUID.
181
187
  * @param {string} [params.e164] - The phone number in E.164 to unassign (preferred).
182
188
  * @param {string} [params.phoneNumberId] - Legacy: a voice-backend phone number UUID.
183
- * @param {import('../../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
189
+ * @param {RequestOptions} [params.options] - Additional options for the request.
184
190
  * @throws {Error} If id is missing, or neither e164 nor phoneNumberId is provided.
185
- * @returns {Promise<Object>} `{ sipProfile: {...} }`.
191
+ * @returns {Promise<SdkResponse<any>>} `{ sipProfile: {...} }`.
186
192
  */
187
193
  async unassignNumber({ id, e164, phoneNumberId, options = {} }) {
188
194
  this.client._require({ id });