@signalhouse-sms/sdk 1.5.1 → 1.7.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.
@@ -35,11 +35,14 @@ export class Numbers {
35
35
  * @roles signalhouse
36
36
  * @param {Object} params - The parameters for approving the request
37
37
  * @param {string} params.portingId - The _id of the port-in request
38
+ * @param {string} [params.subGroupId] - Subgroup to assign when the request has none yet.
39
+ * Ignored if the request already has a subGroupId -- an existing assignment is never overwritten.
38
40
  * @param {RequestOptions} [params.options] - Additional options for the request
39
41
  * @returns {Promise<SdkResponse<any>>} A promise that resolves to the updated port-in request
40
42
  */
41
- approvePortRequest: ({ portingId, options }: {
43
+ approvePortRequest: ({ portingId, subGroupId, options }: {
42
44
  portingId: string;
45
+ subGroupId?: string;
43
46
  options?: RequestOptions;
44
47
  }) => Promise<SdkResponse<any>>;
45
48
  /**
@@ -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";