@signalhouse-sms/sdk 1.6.0 → 1.8.0

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.
@@ -158,7 +158,7 @@ export class Groups {
158
158
  * @roles api, admin, developer, billing
159
159
  * @param {Object} params - The parameters for updating a group
160
160
  * @param {string} params.id - The ID of the group to update
161
- * @param {Object} params.groupData - The data for the group, including required fields such as groupName.
161
+ * @param {Object} params.groupData - The data for the group, including required fields such as groupName. A group admin can set requireTwoFactor (boolean) to require 2FA for every member.
162
162
  * Optional CNP fields: cspId (string|null), defaultCnpSubgroupId (string|null)
163
163
  * @param {RequestOptions} [params.options] - Additional options for the request
164
164
  * @throws {Error} Throws an error if the id or groupData parameter is missing
@@ -169,6 +169,102 @@ export class Groups {
169
169
  groupData: any;
170
170
  options?: RequestOptions;
171
171
  }): Promise<SdkResponse<any>>;
172
+ /**
173
+ * Get a group's Enterprise SSO configuration: whether SSO is available, the redirect URL to register at
174
+ * the identity provider, the saved provider (never its client secret), and each claimed domain with the
175
+ * DNS TXT record that verifies it
176
+ * @async
177
+ * @roles admin
178
+ * @param {Object} params
179
+ * @param {string} params.groupId - The group
180
+ * @param {RequestOptions} [params.options] - Additional options for the request
181
+ * @returns {Promise<SdkResponse<any>>} - { groupId, available, callbackUrl, connection, domains }
182
+ */
183
+ getSsoConfiguration({ groupId, options }: {
184
+ groupId: string;
185
+ options?: RequestOptions;
186
+ }): Promise<SdkResponse<any>>;
187
+ /**
188
+ * Create or update a group's OpenID Connect identity provider. Requires a fresh
189
+ * auth.confirmTwoFactorIdentity from the same session
190
+ * @async
191
+ * @roles admin
192
+ * @param {Object} params
193
+ * @param {string} params.groupId - The group
194
+ * @param {string} params.issuer - The provider's https issuer URL
195
+ * @param {string} params.clientId - The client ID registered at the provider
196
+ * @param {string} [params.clientSecret] - The client secret; required the first time, omit to keep the saved one
197
+ * @param {boolean} [params.enabled] - Whether sign-in through the provider is on (default true)
198
+ * @param {RequestOptions} [params.options] - Additional options for the request
199
+ * @returns {Promise<SdkResponse<any>>} - The SSO configuration
200
+ */
201
+ saveSsoConnection({ groupId, issuer, clientId, clientSecret, enabled, options }: {
202
+ groupId: string;
203
+ issuer: string;
204
+ clientId: string;
205
+ clientSecret?: string;
206
+ enabled?: boolean;
207
+ options?: RequestOptions;
208
+ }): Promise<SdkResponse<any>>;
209
+ /**
210
+ * Remove a group's identity provider and its domains, and unlink every account that signed in through it.
211
+ * Requires a fresh auth.confirmTwoFactorIdentity from the same session
212
+ * @async
213
+ * @roles admin
214
+ * @param {Object} params
215
+ * @param {string} params.groupId - The group
216
+ * @param {RequestOptions} [params.options] - Additional options for the request
217
+ * @returns {Promise<SdkResponse<any>>} - The (now empty) SSO configuration
218
+ */
219
+ deleteSsoConnection({ groupId, options }: {
220
+ groupId: string;
221
+ options?: RequestOptions;
222
+ }): Promise<SdkResponse<any>>;
223
+ /**
224
+ * Claim an email domain for a group's SSO; the response includes the DNS TXT record that verifies it
225
+ * @async
226
+ * @roles admin
227
+ * @param {Object} params
228
+ * @param {string} params.groupId - The group
229
+ * @param {string} params.domain - The domain, e.g. "acme.com"
230
+ * @param {RequestOptions} [params.options] - Additional options for the request
231
+ * @returns {Promise<SdkResponse<any>>} - The SSO configuration
232
+ */
233
+ addSsoDomain({ groupId, domain, options }: {
234
+ groupId: string;
235
+ domain: string;
236
+ options?: RequestOptions;
237
+ }): Promise<SdkResponse<any>>;
238
+ /**
239
+ * Verify a claimed domain by its DNS TXT record
240
+ * @async
241
+ * @roles admin
242
+ * @param {Object} params
243
+ * @param {string} params.groupId - The group
244
+ * @param {string} params.domain - The claimed domain
245
+ * @param {RequestOptions} [params.options] - Additional options for the request
246
+ * @returns {Promise<SdkResponse<any>>} - The SSO configuration
247
+ */
248
+ verifySsoDomain({ groupId, domain, options }: {
249
+ groupId: string;
250
+ domain: string;
251
+ options?: RequestOptions;
252
+ }): Promise<SdkResponse<any>>;
253
+ /**
254
+ * Remove a domain from a group's SSO
255
+ * @async
256
+ * @roles admin
257
+ * @param {Object} params
258
+ * @param {string} params.groupId - The group
259
+ * @param {string} params.domain - The domain
260
+ * @param {RequestOptions} [params.options] - Additional options for the request
261
+ * @returns {Promise<SdkResponse<any>>} - The SSO configuration
262
+ */
263
+ removeSsoDomain({ groupId, domain, options }: {
264
+ groupId: string;
265
+ domain: string;
266
+ options?: RequestOptions;
267
+ }): Promise<SdkResponse<any>>;
172
268
  }
173
269
  export type RequestOptions = import("../SignalHouseSDK.js").RequestOptions;
174
270
  export type SdkResponse<T> = import("../SignalHouseSDK.js").SdkResponse<T>;
@@ -108,7 +108,7 @@ export class Messages {
108
108
  * @param {string|string[]} [params.registrationId] - Filter to traffic attributed to these registrations (hourly analytics only; a 400 while hourly reads are off). A phoneNumber filter takes precedence. Accepts a single value or an array.
109
109
  * @param {string|string[]} [params.phoneNumber] - Filter analytics by the phone number involved in the messages. Accepts a single value, an array, or a comma-separated string.
110
110
  * @param {string|string[]} [params.carrier] - Filter analytics by the carrier used for sending. Accepts a single value, an array, or a comma-separated string.
111
- * @param {string|string[]} [params.carrierFamily] - Filter analytics by the recipient's resolved carrier family (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Standard, IceWireless). Accepts a single value, an array, or a comma-separated string. Only accepted where the environment serves hourly analytics; elsewhere any value is rejected with a 400 -- omit the parameter unless it is wanted.
111
+ * @param {string|string[]} [params.carrierFamily] - Filter analytics by the recipient's resolved carrier family (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Standard, IceWireless, Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics). Accepts a single value, an array, or a comma-separated string. Only accepted where the environment serves hourly analytics; elsewhere any value is rejected with a 400 -- omit the parameter unless it is wanted.
112
112
  * @param {string} [params.startDate] - ISO-8601 date or timestamp; bound per dateBounds: a bare date is always that whole UTC day (inclusive); a timestamp is widened to its whole UTC day in "day" mode and bound as the instant it names, in whatever offset it was written, in "exact" mode
113
113
  * @param {string} [params.endDate] - ISO-8601 date or timestamp; bound per dateBounds: a bare date is always that whole UTC day (inclusive); a timestamp is widened to its whole UTC day in "day" mode and bound as the instant it names, in whatever offset it was written, in "exact" mode. In "exact" mode day buckets align to the UTC offset this bound carries, so a client that sends its own midnights gets its own calendar dates back
114
114
  * @param {boolean} [params.matchAny] - When true, the provided campaignId/brandId/phoneNumber filters are OR'd (match ANY) instead of the default most-specific-single behavior. subgroupId stays an AND scope. Opt-in/additive.
@@ -158,7 +158,7 @@ export class Messages {
158
158
  * @param {string|string[]} [params.registrationId] - Filter to traffic attributed to these registrations (hourly analytics only; a 400 while hourly reads are off). A phoneNumber filter takes precedence. Accepts a single value or an array.
159
159
  * @param {string|string[]} [params.phoneNumber] - Filter analytics by the phone number involved in the messages. Accepts a single value, an array, or a comma-separated string.
160
160
  * @param {string|string[]} [params.carrier] - Filter analytics by the carrier used for sending. Accepts a single value, an array, or a comma-separated string.
161
- * @param {string|string[]} [params.carrierFamily] - Filter analytics by the recipient's resolved carrier family (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Standard, IceWireless). Accepts a single value, an array, or a comma-separated string. Only accepted where the environment serves hourly analytics; elsewhere any value is rejected with a 400 -- omit the parameter unless it is wanted.
161
+ * @param {string|string[]} [params.carrierFamily] - Filter analytics by the recipient's resolved carrier family (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Standard, IceWireless, Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics). Accepts a single value, an array, or a comma-separated string. Only accepted where the environment serves hourly analytics; elsewhere any value is rejected with a 400 -- omit the parameter unless it is wanted.
162
162
  * @param {string} [params.startDate] - ISO-8601 date or timestamp. It is bound per dateBounds: a bare date is always that whole UTC day (inclusive); a timestamp is widened to its whole UTC day in "day" mode and bound as the instant it names, in whatever offset it was written, in "exact" mode, then floored to the start of its hour at either granularity, because the hourly cube is keyed by hour and a mid-hour start would drop that hour's bucket.
163
163
  * @param {string} [params.endDate] - ISO-8601 date or timestamp. At day granularity it is bound per dateBounds: a bare date is always that whole UTC day (inclusive); a timestamp is widened to its whole UTC day in "day" mode and bound as the instant it names, in whatever offset it was written, in "exact" mode. In "exact" mode day buckets align to the UTC offset this bound carries, so a client that sends its own midnights gets its own calendar dates back; at hour granularity it is honoured as given.
164
164
  * @param {(string|string[])} [params.messageType] - Message type(s) the SENTIMENT figures are scoped to: SMS, MMS or P2P (single value, array, or comma-separated string). Omit for all scored types. Does NOT narrow the message counts, which are always returned split per type (smsInbound/mmsInbound/p2pInbound) and have no filterable type dimension.
@@ -261,7 +261,7 @@ export class Messages {
261
261
  * @param {string|string[]} [params.registrationId] - Filter to traffic attributed to these registrations (hourly analytics only; a 400 while hourly reads are off). A phoneNumber filter takes precedence. Accepts a single value or an array.
262
262
  * @param {string|string[]} [params.phoneNumber]
263
263
  * @param {string|string[]} [params.carrier]
264
- * @param {string|string[]} [params.carrierFamily] - Resolved carrier family of the recipient (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Standard, IceWireless); single value, array, or comma-separated. Only accepted where the environment serves hourly analytics; elsewhere any value is rejected with a 400 -- omit the parameter unless it is wanted.
264
+ * @param {string|string[]} [params.carrierFamily] - Resolved carrier family of the recipient (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Standard, IceWireless, Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics); single value, array, or comma-separated. Only accepted where the environment serves hourly analytics; elsewhere any value is rejected with a 400 -- omit the parameter unless it is wanted.
265
265
  * @param {string} [params.startDate]
266
266
  * @param {string} [params.endDate]
267
267
  * @param {number} [params.page=1]
@@ -308,7 +308,7 @@ export class Messages {
308
308
  * @param {string|string[]} [params.registrationId] - Filter to traffic attributed to these registrations (hourly analytics only; a 400 while hourly reads are off). A phoneNumber filter takes precedence. Accepts a single value or an array.
309
309
  * @param {string|string[]} [params.phoneNumber]
310
310
  * @param {string|string[]} [params.carrier]
311
- * @param {string|string[]} [params.carrierFamily] - Resolved carrier family of the recipient (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Standard, IceWireless); single value, array, or comma-separated. Only accepted where the environment serves hourly analytics; elsewhere any value is rejected with a 400 -- omit the parameter unless it is wanted.
311
+ * @param {string|string[]} [params.carrierFamily] - Resolved carrier family of the recipient (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Standard, IceWireless, Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics); single value, array, or comma-separated. Only accepted where the environment serves hourly analytics; elsewhere any value is rejected with a 400 -- omit the parameter unless it is wanted.
312
312
  * @param {string} [params.startDate]
313
313
  * @param {string} [params.endDate]
314
314
  * @param {number} [params.page=1]
@@ -401,7 +401,7 @@ export class Messages {
401
401
  * @param {string|string[]} [params.region] - ISO-2 country filter: US, GB or CA (any case of UK/GB/GBR/United Kingdom is accepted for GB); one value, an array, or a comma-separated string; omitted = every region. Only accepted where the environment serves hourly analytics; elsewhere any value is rejected with a 400.
402
402
  * @param {Object[]|string} [params.regionScopes] - Array of OR-ed branches `{ region, channels, brandId?, campaignId?, phoneNumber? }` (channels among tenDLC, virtualLongCode, tollFree, shortCode, p2p); `[]` matches nothing. Sent as JSON unless already a string. Only accepted where the environment serves hourly analytics; elsewhere any value is rejected with a 400.
403
403
  * @param {RequestOptions} [params.options] - Additional options for the request
404
- * @returns {Promise<SdkResponse<any>>} - A promise that resolves to the paginated DNC records. Each record carries senderPhoneNumber — the first business number that received the opt-out (set once, never changed by a later STOP or a campaign move; the same value as phoneNumber) — optOutKeyword — the normalized keyword that revoked consent (e.g. "stop", "opt out"; a repeat opt-out records the most recent word), null for opt-outs recorded before keyword capture shipped — and carrierFamily, the resolved carrier family of the recipient number (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, Standard, IceWireless), copied from the inbound message that triggered the opt-out. campaignId is null on subgroup-scoped records (non-US recipients).
404
+ * @returns {Promise<SdkResponse<any>>} - A promise that resolves to the paginated DNC records. Each record carries senderPhoneNumber — the first business number that received the opt-out (set once, never changed by a later STOP or a campaign move; the same value as phoneNumber) — optOutKeyword — the normalized keyword that revoked consent (e.g. "stop", "opt out"; a repeat opt-out records the most recent word), null for opt-outs recorded before keyword capture shipped — and carrierFamily, the resolved carrier family of the recipient number (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, Standard, IceWireless, Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics), copied from the inbound message that triggered the opt-out. campaignId is null on subgroup-scoped records (non-US recipients).
405
405
  */
406
406
  getDncRecords({ groupId, subgroupId, brandId, campaignId, registrationId, phoneNumber, carrier, startDate, endDate, page, limit, sortField, sortOrder, channel, region, regionScopes, dateBounds, options }: {
407
407
  groupId?: string;
@@ -27,6 +27,7 @@ export class Voice {
27
27
  globalVoiceSettings: GlobalVoiceSettings;
28
28
  tokens: Tokens;
29
29
  analytics: Analytics;
30
+ outboundVoice: OutboundVoice;
30
31
  }
31
32
  import { SipTrunks } from "./voice/SipTrunks.js";
32
33
  import { SipProfiles } from "./voice/SipProfiles.js";
@@ -37,3 +38,4 @@ import { CallLogs } from "./voice/CallLogs.js";
37
38
  import { GlobalVoiceSettings } from "./voice/GlobalVoiceSettings.js";
38
39
  import { Tokens } from "./voice/Tokens.js";
39
40
  import { Analytics } from "./voice/Analytics.js";
41
+ import { OutboundVoice } from "./voice/OutboundVoice.js";
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Outbound voice policy: Signal House staff switches that turn outbound calling off for a group,
3
+ * subgroup, number, SIP trunk, SIP endpoint or softphone user, plus a group's AI-outbound
4
+ * authorization. Staff only; every method lives under the hidden `admin` namespace.
5
+ * Accessed via `sdk.voice.outboundVoice.admin`.
6
+ */
7
+ export class OutboundVoice {
8
+ constructor(client: any, enableAdmin: any);
9
+ client: any;
10
+ enableAdmin: any;
11
+ admin: {
12
+ /**
13
+ * Get the switches that are off in a group, and its AI-outbound authorization.
14
+ * @async
15
+ * @roles signalhouse_admin, signalhouse_api, signalhouse_user
16
+ * @param {Object} params - Request parameters.
17
+ * @param {string} params.groupId - The group to read.
18
+ * @param {RequestOptions} [params.options] - Additional options for the request.
19
+ * @throws {Error} If groupId is missing.
20
+ * @returns {Promise<SdkResponse<any>>} `{ groupId, outboundAiAuthorized, aiAuthorization, blocks: [...] }`.
21
+ */
22
+ getGroupPolicy: ({ groupId, options }: {
23
+ groupId: string;
24
+ options?: RequestOptions;
25
+ }) => Promise<SdkResponse<any>>;
26
+ /**
27
+ * List a group's outbound policy changes, newest first.
28
+ * @async
29
+ * @roles signalhouse_admin, signalhouse_api, signalhouse_user
30
+ * @param {Object} params - Request parameters.
31
+ * @param {string} params.groupId - The group to read.
32
+ * @param {number} [params.limit] - Most rows to return (1-200, default 50).
33
+ * @param {RequestOptions} [params.options] - Additional options for the request.
34
+ * @throws {Error} If groupId is missing.
35
+ * @returns {Promise<SdkResponse<any>>} `{ groupId, events: [...] }`.
36
+ */
37
+ listHistory: ({ groupId, limit, options }: {
38
+ groupId: string;
39
+ limit?: number;
40
+ options?: RequestOptions;
41
+ }) => Promise<SdkResponse<any>>;
42
+ /**
43
+ * Check whether a call with this context may go out, and which switch blocks it if not.
44
+ * @async
45
+ * @roles signalhouse_admin, signalhouse_api, signalhouse_user
46
+ * @param {Object} params - Request parameters.
47
+ * @param {string} params.groupId - The calling group.
48
+ * @param {string} [params.subgroupId] - The calling subgroup, when known.
49
+ * @param {string} [params.e164] - The caller ID, in E.164.
50
+ * @param {string} [params.sipTrunkId] - The SIP trunk the call comes from.
51
+ * @param {string} [params.sipProfileId] - The SIP endpoint the call comes from.
52
+ * @param {string} [params.webrtcIdentity] - The softphone user's requested identity.
53
+ * @param {RequestOptions} [params.options] - Additional options for the request.
54
+ * @throws {Error} If groupId is missing.
55
+ * @returns {Promise<SdkResponse<any>>} `{ allowed, blockedBy }`.
56
+ */
57
+ resolve: ({ groupId, subgroupId, e164, sipTrunkId, sipProfileId, webrtcIdentity, options }: {
58
+ groupId: string;
59
+ subgroupId?: string;
60
+ e164?: string;
61
+ sipTrunkId?: string;
62
+ sipProfileId?: string;
63
+ webrtcIdentity?: string;
64
+ options?: RequestOptions;
65
+ }) => Promise<SdkResponse<any>>;
66
+ /**
67
+ * Turn outbound calling off for one scope. A scope that is already off keeps its original switch.
68
+ * @async
69
+ * @roles signalhouse_admin, signalhouse_api
70
+ * @param {Object} params - Request parameters.
71
+ * @param {string} params.groupId - The group that owns the scope.
72
+ * @param {OutboundScopeType} params.scopeType - What kind of thing is being turned off.
73
+ * @param {string} params.scopeId - The group, subgroup, number, trunk, endpoint or softphone identity.
74
+ * @param {string} params.reason - Why (3-500 characters).
75
+ * @param {RequestOptions} [params.options] - Additional options for the request.
76
+ * @throws {Error} If groupId, scopeType, scopeId or reason is missing.
77
+ * @returns {Promise<SdkResponse<any>>} `{ created, block }`.
78
+ */
79
+ block: ({ groupId, scopeType, scopeId, reason, options }: {
80
+ groupId: string;
81
+ scopeType: OutboundScopeType;
82
+ scopeId: string;
83
+ reason: string;
84
+ options?: RequestOptions;
85
+ }) => Promise<SdkResponse<any>>;
86
+ /**
87
+ * Turn outbound calling back on for one scope.
88
+ * @async
89
+ * @roles signalhouse_admin, signalhouse_api
90
+ * @param {Object} params - Request parameters.
91
+ * @param {string} params.groupId - The group that owns the scope.
92
+ * @param {OutboundScopeType} params.scopeType - What kind of thing is being turned on.
93
+ * @param {string} params.scopeId - The switch's scope id.
94
+ * @param {string} [params.reason] - Optional note for the history.
95
+ * @param {RequestOptions} [params.options] - Additional options for the request.
96
+ * @throws {Error} If groupId, scopeType or scopeId is missing.
97
+ * @returns {Promise<SdkResponse<any>>} `{ removed, block }`.
98
+ */
99
+ unblock: ({ groupId, scopeType, scopeId, reason, options }: {
100
+ groupId: string;
101
+ scopeType: OutboundScopeType;
102
+ scopeId: string;
103
+ reason?: string;
104
+ options?: RequestOptions;
105
+ }) => Promise<SdkResponse<any>>;
106
+ /**
107
+ * Set or clear a group's authorization to place outbound AI-agent calls.
108
+ * @async
109
+ * @roles signalhouse_admin, signalhouse_api
110
+ * @param {Object} params - Request parameters.
111
+ * @param {string} params.groupId - The group to change.
112
+ * @param {boolean} params.authorized - The new value.
113
+ * @param {string} params.reason - Why (3-500 characters).
114
+ * @param {RequestOptions} [params.options] - Additional options for the request.
115
+ * @throws {Error} If groupId, authorized or reason is missing.
116
+ * @returns {Promise<SdkResponse<any>>} `{ groupId, outboundAiAuthorized, changed }`.
117
+ */
118
+ setAiAuthorization: ({ groupId, authorized, reason, options }: {
119
+ groupId: string;
120
+ authorized: boolean;
121
+ reason: string;
122
+ options?: RequestOptions;
123
+ }) => Promise<SdkResponse<any>>;
124
+ };
125
+ }
126
+ export type RequestOptions = import("../../SignalHouseSDK.js").RequestOptions;
127
+ export type SdkResponse<T> = import("../../SignalHouseSDK.js").SdkResponse<T>;
128
+ export type OutboundScopeType = "GROUP" | "SUBGROUP" | "NUMBER" | "TRUNK" | "SIP_PROFILE" | "WEBRTC_IDENTITY";