@signalhouse-sms/sdk 1.14.0 → 1.16.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.
@@ -0,0 +1,325 @@
1
+ /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+ /**
7
+ * Compliance cases under /compliance. Signal House opens a case when a carrier suspends one of your objects, a carrier
8
+ * escalates a message, or Signal House needs something from you. You read your cases, answer their requirements and
9
+ * upload files; only Signal House opens, works and closes them. Staff methods are under `admin` (enableAdmin).
10
+ */
11
+ export class Compliance {
12
+ /**
13
+ * Keep the JSON and multipart clients every compliance request goes through.
14
+ * @param {any} client - The JSON request client
15
+ * @param {any} multipartClient - The multipart request client, for file uploads
16
+ * @param {boolean} [enableAdmin] - Whether the staff methods under `admin` are available
17
+ */
18
+ constructor(client: any, multipartClient: any, enableAdmin?: boolean);
19
+ client: any;
20
+ multipartClient: any;
21
+ enableAdmin: boolean;
22
+ admin: {
23
+ /**
24
+ * Log an alert by hand: a reading, a notice or a block. Blocks (and a Sev-0 carrier ticket) need signalhouse_admin.
25
+ * @async
26
+ * @roles signalhouse_admin, signalhouse_user
27
+ * @param {Object} params - The alert
28
+ * @param {Object} params.data - `{ form, type, subject: { kind, id }, ... }`: the intake input without a raw payload
29
+ * @param {RequestOptions} [params.options] - Additional options for the request
30
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ logged, recovered, updated, unmatched, duplicate }`
31
+ */
32
+ logAlert: ({ data, options }: {
33
+ data: any;
34
+ options?: RequestOptions;
35
+ }) => Promise<SdkResponse<any>>;
36
+ /**
37
+ * Lift a block by hand. signalhouse_admin only.
38
+ * @async
39
+ * @roles signalhouse_admin
40
+ * @param {Object} params - The lift
41
+ * @param {string} params.alertId - The block alert (ALR-…)
42
+ * @param {string} [params.note] - Why it lifted
43
+ * @param {string} [params.occurredAt] - When the source says it lifted (ISO 8601)
44
+ * @param {RequestOptions} [params.options] - Additional options for the request
45
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ alertId, recoveredAt, caseId, caseClosed, closeReason }`
46
+ */
47
+ liftBlock: ({ alertId, note, occurredAt, options }: {
48
+ alertId: string;
49
+ note?: string;
50
+ occurredAt?: string;
51
+ options?: RequestOptions;
52
+ }) => Promise<SdkResponse<any>>;
53
+ /**
54
+ * List alerts, with the inbox counts.
55
+ * @async
56
+ * @roles signalhouse_admin, signalhouse_user
57
+ * @param {Object} [params] - Filters: type, form, severity, channel, source, subjectKind, subjectId, number, groupId, subgroupId, campaignId, caseId, inbox, open, blocks, slackPending, from, to, page, limit
58
+ * @param {RequestOptions} [params.options] - Additional options for the request
59
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, counts: { inCase, inbox, noted } }`
60
+ */
61
+ getAlerts: ({ options, ...filters }?: {
62
+ options?: RequestOptions;
63
+ }) => Promise<SdkResponse<any>>;
64
+ /**
65
+ * Get one alert with its raw payload, escalation chain, case summary and timeline.
66
+ * @async
67
+ * @roles signalhouse_admin, signalhouse_user
68
+ * @param {Object} params - The lookup
69
+ * @param {string} params.alertId - The alert (ALR-…)
70
+ * @param {RequestOptions} [params.options] - Additional options for the request
71
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the alert with `chain`, `case` and `timeline`
72
+ */
73
+ getAlert: ({ alertId, options }: {
74
+ alertId: string;
75
+ options?: RequestOptions;
76
+ }) => Promise<SdkResponse<any>>;
77
+ /**
78
+ * Work an inbox alert: `{ action: "assign", caseId }`, `{ action: "assign", object: { objectType, objectId } }` or `{ action: "note", note }`.
79
+ * @async
80
+ * @roles signalhouse_admin, signalhouse_user
81
+ * @param {Object} params - The action
82
+ * @param {string} params.alertId - The inbox alert (ALR-…)
83
+ * @param {Object} params.data - The action body
84
+ * @param {RequestOptions} [params.options] - Additional options for the request
85
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the alert after the action
86
+ */
87
+ triageAlert: ({ alertId, data, options }: {
88
+ alertId: string;
89
+ data: any;
90
+ options?: RequestOptions;
91
+ }) => Promise<SdkResponse<any>>;
92
+ /**
93
+ * Open a case by hand to send the customer a notice; its requirements go out at once. 409 when the object already has an open case.
94
+ * @async
95
+ * @roles signalhouse_admin, signalhouse_user
96
+ * @param {Object} params - The case
97
+ * @param {Object} params.data - `{ objectType, objectId, reasonTemplate, reason?, customerNote?, requirements: [{ kind, text }], fixByDays? }`
98
+ * @param {RequestOptions} [params.options] - Additional options for the request
99
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
100
+ */
101
+ openCase: ({ data, options }: {
102
+ data: any;
103
+ options?: RequestOptions;
104
+ }) => Promise<SdkResponse<any>>;
105
+ /**
106
+ * Take, give or release ownership (assigneeUserId, null to release), and edit reasonTemplate, reason and customerNote.
107
+ * @async
108
+ * @roles signalhouse_admin, signalhouse_user
109
+ * @param {Object} params - The change
110
+ * @param {string} params.caseId - The case (CASE-…)
111
+ * @param {Object} params.data - `{ assigneeUserId?, reasonTemplate?, reason?, customerNote? }`
112
+ * @param {RequestOptions} [params.options] - Additional options for the request
113
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
114
+ */
115
+ updateCase: ({ caseId, data, options }: {
116
+ caseId: string;
117
+ data: any;
118
+ options?: RequestOptions;
119
+ }) => Promise<SdkResponse<any>>;
120
+ /**
121
+ * Send requirements the first time, or add more; either hands the case to the customer.
122
+ * @async
123
+ * @roles signalhouse_admin, signalhouse_user
124
+ * @param {Object} params - The requirements
125
+ * @param {string} params.caseId - The case (CASE-…)
126
+ * @param {Array<{kind: string, text: string}>} params.requirements - RECORDS, CAMPAIGN_EDIT, NUMBER_ACTION or CONFIRM, with the text
127
+ * @param {number} [params.fixByDays] - Days until they are due, 1-14 (default 5)
128
+ * @param {RequestOptions} [params.options] - Additional options for the request
129
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
130
+ */
131
+ sendRequirements: ({ caseId, requirements, fixByDays, options }: {
132
+ caseId: string;
133
+ requirements: Array<{
134
+ kind: string;
135
+ text: string;
136
+ }>;
137
+ fixByDays?: number;
138
+ options?: RequestOptions;
139
+ }) => Promise<SdkResponse<any>>;
140
+ /**
141
+ * Record that the lift request went upstream. The case must hold an open carrier suspension or provider pause.
142
+ * @async
143
+ * @roles signalhouse_admin, signalhouse_user
144
+ * @param {Object} params - The request
145
+ * @param {string} params.caseId - The case (CASE-…)
146
+ * @param {string} [params.note] - What was sent
147
+ * @param {RequestOptions} [params.options] - Additional options for the request
148
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
149
+ */
150
+ requestLift: ({ caseId, note, options }: {
151
+ caseId: string;
152
+ note?: string;
153
+ options?: RequestOptions;
154
+ }) => Promise<SdkResponse<any>>;
155
+ /**
156
+ * Close a case. Lift its open blocks first.
157
+ * @async
158
+ * @roles signalhouse_admin, signalhouse_user
159
+ * @param {Object} params - The close
160
+ * @param {string} params.caseId - The case (CASE-…)
161
+ * @param {string} params.closeReason - CUSTOMER_REMEDIATED, SUSPENDED_BY_CARRIER, LIFTED, LABEL_REMOVED, TRACEBACK_ANSWERED, FALSE_POSITIVE or CLEARED
162
+ * @param {string} [params.closeNote] - Why
163
+ * @param {RequestOptions} [params.options] - Additional options for the request
164
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the closed case
165
+ */
166
+ closeCase: ({ caseId, closeReason, closeNote, options }: {
167
+ caseId: string;
168
+ closeReason: string;
169
+ closeNote?: string;
170
+ options?: RequestOptions;
171
+ }) => Promise<SdkResponse<any>>;
172
+ /**
173
+ * Email the customer a reminder of the requirements still open.
174
+ * @async
175
+ * @roles signalhouse_admin, signalhouse_user
176
+ * @param {Object} params - The reminder
177
+ * @param {string} params.caseId - The case (CASE-…)
178
+ * @param {RequestOptions} [params.options] - Additional options for the request
179
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
180
+ */
181
+ remindCase: ({ caseId, options }: {
182
+ caseId: string;
183
+ options?: RequestOptions;
184
+ }) => Promise<SdkResponse<any>>;
185
+ /**
186
+ * Add a staff note, or an email to or from the upstream, to a case's history.
187
+ * @async
188
+ * @roles signalhouse_admin, signalhouse_user
189
+ * @param {Object} params - The note
190
+ * @param {string} params.caseId - The case (CASE-…)
191
+ * @param {string} params.kind - STAFF, EMAIL_IN or EMAIL_OUT
192
+ * @param {string} params.text - The note
193
+ * @param {{from?: string, to?: string, subject?: string, body?: string}} [params.email] - The email, on EMAIL_IN and EMAIL_OUT
194
+ * @param {RequestOptions} [params.options] - Additional options for the request
195
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
196
+ */
197
+ addCaseNote: ({ caseId, kind, text, email, options }: {
198
+ caseId: string;
199
+ kind: string;
200
+ text: string;
201
+ email?: {
202
+ from?: string;
203
+ to?: string;
204
+ subject?: string;
205
+ body?: string;
206
+ };
207
+ options?: RequestOptions;
208
+ }) => Promise<SdkResponse<any>>;
209
+ /**
210
+ * Get a group's strikes in the last 90 days, the block periods behind them, and whether an open case carries the review flag.
211
+ * @async
212
+ * @roles signalhouse_admin, signalhouse_user
213
+ * @param {Object} params - The lookup
214
+ * @param {string} params.groupId - The group
215
+ * @param {RequestOptions} [params.options] - Additional options for the request
216
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ groupId, windowDays, strikes, reviewDue, periods }`
217
+ */
218
+ getStrikes: ({ groupId, options }: {
219
+ groupId: string;
220
+ options?: RequestOptions;
221
+ }) => Promise<SdkResponse<any>>;
222
+ };
223
+ /**
224
+ * List the compliance cases you can see, newest first. `counts.waitingOnYou` is the open cases with requirements still to answer
225
+ * @async
226
+ * @roles api, admin, developer, billing, user
227
+ * @param {Object} [params] - Filters
228
+ * @param {string} [params.groupId] - A group you can view; defaults to your active group
229
+ * @param {string} [params.status] - OPEN, LIFT_REQUESTED or CLOSED
230
+ * @param {string} [params.stage] - new, customer, ready, lift_requested or closed
231
+ * @param {string} [params.objectType] - CAMPAIGN, BRAND, NUMBER, RCS_AGENT or SUBGROUP
232
+ * @param {string} [params.objectId] - The object's id
233
+ * @param {string} [params.subgroupId] - Only cases in this subgroup
234
+ * @param {boolean} [params.suspended] - true for cases with an open suspension or hold, false for the rest
235
+ * @param {string} [params.from] - Opened on or after this ISO 8601 time
236
+ * @param {string} [params.to] - Opened on or before this ISO 8601 time
237
+ * @param {string} [params.sort] - createdAt (default), fixBy or severity
238
+ * @param {number} [params.page] - Page number, from 1
239
+ * @param {number} [params.limit] - Cases per page, 1-200
240
+ * @param {RequestOptions} [params.options] - Additional options for the request
241
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, counts: { open, waitingOnYou } }`
242
+ */
243
+ getCases({ groupId, status, stage, objectType, objectId, subgroupId, suspended, from, to, sort, page, limit, options }?: {
244
+ groupId?: string;
245
+ status?: string;
246
+ stage?: string;
247
+ objectType?: string;
248
+ objectId?: string;
249
+ subgroupId?: string;
250
+ suspended?: boolean;
251
+ from?: string;
252
+ to?: string;
253
+ sort?: string;
254
+ page?: number;
255
+ limit?: number;
256
+ options?: RequestOptions;
257
+ }): Promise<SdkResponse<any>>;
258
+ /**
259
+ * Get one compliance case: its stage, suspensions, tickets and requirements
260
+ * @async
261
+ * @roles api, admin, developer, billing, user
262
+ * @param {Object} params - The lookup
263
+ * @param {string} params.caseId - The case (CASE-…)
264
+ * @param {RequestOptions} [params.options] - Additional options for the request
265
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the case
266
+ */
267
+ getCase({ caseId, options }: {
268
+ caseId: string;
269
+ options?: RequestOptions;
270
+ }): Promise<SdkResponse<any>>;
271
+ /**
272
+ * Answer one requirement with a note, files, or both. A RECORDS requirement needs a file or a note
273
+ * @async
274
+ * @roles api, admin, developer, user
275
+ * @param {Object} params - The answer
276
+ * @param {string} params.caseId - The case (CASE-…)
277
+ * @param {string} params.requirementId - The requirement (CASE-…-n)
278
+ * @param {string} [params.answer] - What you did, up to 2,000 characters
279
+ * @param {string[]} [params.fileIds] - Up to 10 fileIds from uploadFile, on this case
280
+ * @param {RequestOptions} [params.options] - Additional options for the request
281
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the case
282
+ */
283
+ answerRequirement({ caseId, requirementId, answer, fileIds, options }: {
284
+ caseId: string;
285
+ requirementId: string;
286
+ answer?: string;
287
+ fileIds?: string[];
288
+ options?: RequestOptions;
289
+ }): Promise<SdkResponse<any>>;
290
+ /**
291
+ * Upload a file to a compliance case (CSV, XLSX, PDF, PNG, JPG or TXT, up to 10 MB). Pass the returned fileId in
292
+ * fileIds when you answer the requirement
293
+ * @async
294
+ * @roles api, admin, developer, user
295
+ * @param {Object} params - The upload
296
+ * @param {string} params.caseId - The case the file answers
297
+ * @param {string} [params.requirementId] - The requirement the file answers
298
+ * @param {Blob|File} params.file - The file, as a Blob/File
299
+ * @param {string} [params.fileName] - Multipart filename; required for a CSV/TXT Blob without a name
300
+ * @param {RequestOptions} [params.options] - Additional options for the request
301
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ fileId, fileName, mimeType, size }`
302
+ */
303
+ uploadFile({ caseId, requirementId, file, fileName, options }: {
304
+ caseId: string;
305
+ requirementId?: string;
306
+ file: Blob | File;
307
+ fileName?: string;
308
+ options?: RequestOptions;
309
+ }): Promise<SdkResponse<any>>;
310
+ /**
311
+ * Download a compliance file
312
+ * @async
313
+ * @roles api, admin, developer, billing, user
314
+ * @param {Object} params - The lookup
315
+ * @param {string} params.fileId - The fileId uploadFile returned
316
+ * @param {RequestOptions} [params.options] - Additional options for the request
317
+ * @returns {Promise<SdkResponse<ArrayBuffer>>} A promise that resolves to the file bytes as an ArrayBuffer
318
+ */
319
+ getFile({ fileId, options }: {
320
+ fileId: string;
321
+ options?: RequestOptions;
322
+ }): Promise<SdkResponse<ArrayBuffer>>;
323
+ }
324
+ export type RequestOptions = import("../SignalHouseSDK.js").RequestOptions;
325
+ export type SdkResponse<T> = import("../SignalHouseSDK.js").SdkResponse<T>;
@@ -220,6 +220,70 @@ export class Groups {
220
220
  groupId: string;
221
221
  options?: RequestOptions;
222
222
  }): Promise<SdkResponse<any>>;
223
+ /**
224
+ * Read a group's Ontraport connection status: whether it's connected, and the webhook URL to paste
225
+ * into an Ontraport automation's "Send to a Webhook" step. Never includes the API Key or App ID.
226
+ * @async
227
+ * @roles admin, developer, signalhouse_admin
228
+ * @param {Object} params
229
+ * @param {string} params.groupId - The group
230
+ * @param {RequestOptions} [params.options] - Additional options for the request
231
+ * @returns {Promise<SdkResponse<any>>} - { connected, webhookUrl, enabled }
232
+ */
233
+ getOntraportConnection({ groupId, options }: {
234
+ groupId: string;
235
+ options?: RequestOptions;
236
+ }): Promise<SdkResponse<any>>;
237
+ /**
238
+ * Connect (or reconnect) a group's Ontraport account. The API Key and App ID are verified with a
239
+ * read-only call to Ontraport before anything is stored; a bad pair throws rather than saving.
240
+ * Requires a Signal House Admin to have enabled featureFlags.ontraportIntegration for the group first
241
+ * (opt-in, off by default) - otherwise this throws a validation error.
242
+ * @async
243
+ * @roles admin, developer, signalhouse_admin
244
+ * @param {Object} params
245
+ * @param {string} params.groupId - The group
246
+ * @param {string} params.apiKey - The Ontraport API Key
247
+ * @param {string} params.appId - The Ontraport App ID
248
+ * @param {RequestOptions} [params.options] - Additional options for the request
249
+ * @returns {Promise<SdkResponse<any>>} - { connected, webhookUrl, enabled }
250
+ */
251
+ connectOntraport({ groupId, apiKey, appId, options }: {
252
+ groupId: string;
253
+ apiKey: string;
254
+ appId: string;
255
+ options?: RequestOptions;
256
+ }): Promise<SdkResponse<any>>;
257
+ /**
258
+ * Disconnect (disable) a group's Ontraport account. The webhook stops accepting deliveries
259
+ * immediately; stored credentials and contact links are kept, so reconnecting the same account
260
+ * resumes cleanly. The primary self-service way to kill a leaked webhook URL.
261
+ * @async
262
+ * @roles admin, developer, signalhouse_admin
263
+ * @param {Object} params
264
+ * @param {string} params.groupId - The group
265
+ * @param {RequestOptions} [params.options] - Additional options for the request
266
+ * @returns {Promise<SdkResponse<any>>} - { connected, webhookUrl, enabled }
267
+ */
268
+ disconnectOntraport({ groupId, options }: {
269
+ groupId: string;
270
+ options?: RequestOptions;
271
+ }): Promise<SdkResponse<any>>;
272
+ /**
273
+ * Mint a fresh webhook token for an existing Ontraport connection, immediately invalidating the old
274
+ * URL. A second self-service way to kill a leaked webhook URL, for when the customer wants to keep
275
+ * sending (unlike disconnectOntraport) but needs a new URL to paste into a rebuilt automation.
276
+ * @async
277
+ * @roles admin, developer, signalhouse_admin
278
+ * @param {Object} params
279
+ * @param {string} params.groupId - The group
280
+ * @param {RequestOptions} [params.options] - Additional options for the request
281
+ * @returns {Promise<SdkResponse<any>>} - { connected, webhookUrl, enabled }
282
+ */
283
+ regenerateOntraportWebhookToken({ groupId, options }: {
284
+ groupId: string;
285
+ options?: RequestOptions;
286
+ }): Promise<SdkResponse<any>>;
223
287
  /**
224
288
  * Claim an email domain for a group's SSO; the response includes the DNS TXT record that verifies it
225
289
  * @async
@@ -669,7 +669,7 @@ export class Messages {
669
669
  options?: RequestOptions;
670
670
  }): Promise<SdkResponse<any>>;
671
671
  /**
672
- * Look up the carrier for a phone number. Always performs a fresh lookup (not cached). Billed per request.
672
+ * Look up the carrier for a phone number. Always performs a fresh lookup (not cached). Billed per request. An Australian number on ACMA's list of numbers reserved for TV, film and creative works is refused with a 400 as an invalid number, without a lookup or a charge.
673
673
  * @async
674
674
  * @roles api, admin, developer, billing, user
675
675
  * @param {Object} params - The parameters for looking up a carrier
@@ -45,6 +45,36 @@ export class Subgroups {
45
45
  constructor(client: any, enableAdmin: any);
46
46
  client: any;
47
47
  enableAdmin: any;
48
+ admin: {
49
+ /**
50
+ * Link (or, with ghlLocationId: null, unlink) a GoHighLevel location to a subgroup. At most
51
+ * one subgroup may hold a given ghlLocationId; linking it here steals it from any other
52
+ * subgroup that currently holds it. Intended for ghl-app/backend's write-through right after
53
+ * it locally claims a location -> subgroup link.
54
+ * @async
55
+ * @roles signalhouse_api, signalhouse_admin
56
+ * @param {Object} params - The parameters for linking a GHL location
57
+ * @param {string} params.subgroupId - The subgroup to link
58
+ * @param {string|null} params.ghlLocationId - The GHL location ID to link, or null to unlink
59
+ * @param {string|null} [params.ghlLocationName] - Display name of the GHL location. Omit to leave the
60
+ * subgroup's currently stored name untouched (only when ghlLocationId is unchanged - otherwise
61
+ * cleared to null); always cleared to null when unlinking
62
+ * @param {Date|string} [params.claimedAt] - When this link was locally claimed by the caller.
63
+ * Required when linking (ghlLocationId is non-null) - used to detect and reject a delayed/
64
+ * out-of-order push whose claim has since been superseded by a newer one recorded elsewhere.
65
+ * Ignored when unlinking.
66
+ * @param {RequestOptions} [params.options] - Additional options for the request
67
+ * @throws {Error} Throws an error if the subgroupId parameter is missing
68
+ * @returns {Promise<SdkResponse<any>>} - The updated subgroup object returned from the server
69
+ */
70
+ linkGhlLocation: ({ subgroupId, ghlLocationId, ghlLocationName, claimedAt, options }: {
71
+ subgroupId: string;
72
+ ghlLocationId: string | null;
73
+ ghlLocationName?: string | null;
74
+ claimedAt?: Date | string;
75
+ options?: RequestOptions;
76
+ }) => Promise<SdkResponse<any>>;
77
+ };
48
78
  /**
49
79
  * Get a list of subgroups with optional filters
50
80
  * @async
@@ -114,6 +144,27 @@ export class Subgroups {
114
144
  updateData: UpdateSubgroupData;
115
145
  options?: RequestOptions;
116
146
  }): Promise<SdkResponse<any>>;
147
+ /**
148
+ * Resolve the mapping between a GoHighLevel location and a Signal House subgroup, in either
149
+ * direction. Provide exactly one of ghlLocationId or subgroupId. groupId is optional - customer
150
+ * roles default to their own accessible group(s) and are rejected if they name a group they don't
151
+ * belong to; a subgroupId/ghlLocationId that belongs to a different group than the caller's returns
152
+ * a 404, identical to a nonexistent one.
153
+ * @async
154
+ * @roles api, admin, developer, billing, user
155
+ * @param {Object} params - The parameters for the lookup
156
+ * @param {string} [params.groupId] - Restrict the lookup to an accessible group ID
157
+ * @param {string} [params.ghlLocationId] - GHL location ID to resolve to its subgroup (mutually exclusive with subgroupId)
158
+ * @param {string} [params.subgroupId] - Subgroup ID to resolve to its GHL location (mutually exclusive with ghlLocationId)
159
+ * @param {RequestOptions} [params.options] - Additional options for the request
160
+ * @returns {Promise<SdkResponse<any>>} - `{ groupId, subgroupId, subgroupName, ghlLocationId, ghlLocationName }`
161
+ */
162
+ lookupGhlLocation({ groupId, ghlLocationId, subgroupId, options }?: {
163
+ groupId?: string;
164
+ ghlLocationId?: string;
165
+ subgroupId?: string;
166
+ options?: RequestOptions;
167
+ }): Promise<SdkResponse<any>>;
117
168
  /**
118
169
  * Delete a subgroup by its ID (mark as inactive)
119
170
  * @async
@@ -0,0 +1,163 @@
1
+ /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+ /**
7
+ * Vetting domain: the staff-only brand vetting engine for branded calling. A case runs a brand through automated checks, a
8
+ * rules engine decides it, and staff work only the exception queue. Every method lives under the admin namespace, present
9
+ * only when the SDK is created with `enableAdmin: true`. JS SDK only by design.
10
+ */
11
+ export class Vetting {
12
+ constructor(client: any, enableAdmin: any);
13
+ client: any;
14
+ enableAdmin: any;
15
+ admin: {
16
+ /**
17
+ * Start vetting a brand. The case runs in the background; read it with getVettingCase. Staff-only.
18
+ * @async
19
+ * @roles signalhouse
20
+ * @param {Object} params
21
+ * @param {Object} params.subject - The brand: `{ legalName, entityType?, displayName?, ein?, website?, sector?,
22
+ * authorizer?: { name?, email?, phone? }, billingContact?: { name?, email?, phone? },
23
+ * billingAddress?: { street?, city?, state?, postalCode?, country? }, groupId?, brandId? }`. Only `legalName` is
24
+ * required to start; a case missing any field the checks need is rejected with a cure listing them.
25
+ * @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
26
+ * @param {RequestOptions} [params.options] - Additional options for the request
27
+ * @returns {Promise<SdkResponse<any>>} - `{ caseId, tenantId, status }`, accepted with HTTP 202
28
+ */
29
+ startVettingCase: ({ subject, tenantId, options }: {
30
+ subject: any;
31
+ tenantId?: string;
32
+ options?: RequestOptions;
33
+ }) => Promise<SdkResponse<any>>;
34
+ /**
35
+ * List vetting cases, newest first. Staff-only.
36
+ * @async
37
+ * @roles signalhouse
38
+ * @param {Object} [params]
39
+ * @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
40
+ * @param {("RUNNING"|"DECIDING"|"VERIFIED"|"REJECTED"|"FALLBACK"|"EXCEPTION"|"HUMAN_SIGNOFF")} [params.status] - Only cases in this status
41
+ * @param {number} [params.page] - Page number (default 1)
42
+ * @param {number} [params.limit] - Cases per page (default 25, max 100)
43
+ * @param {RequestOptions} [params.options] - Additional options for the request
44
+ * @returns {Promise<SdkResponse<any>>} - `{ data, total, page, limit }`
45
+ */
46
+ getVettingCases: ({ tenantId, status, page, limit, options }?: {
47
+ tenantId?: string;
48
+ status?: ("RUNNING" | "DECIDING" | "VERIFIED" | "REJECTED" | "FALLBACK" | "EXCEPTION" | "HUMAN_SIGNOFF");
49
+ page?: number;
50
+ limit?: number;
51
+ options?: RequestOptions;
52
+ }) => Promise<SdkResponse<any>>;
53
+ /**
54
+ * Get one vetting case with its steps, decision and history. Staff-only.
55
+ * @async
56
+ * @roles signalhouse
57
+ * @param {Object} params
58
+ * @param {string} params.caseId - The case ID
59
+ * @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
60
+ * @param {RequestOptions} [params.options] - Additional options for the request
61
+ * @returns {Promise<SdkResponse<any>>} - The case
62
+ */
63
+ getVettingCase: ({ caseId, tenantId, options }: {
64
+ caseId: string;
65
+ tenantId?: string;
66
+ options?: RequestOptions;
67
+ }) => Promise<SdkResponse<any>>;
68
+ /**
69
+ * Export every evidence item for a case, oldest first, each with its payload's SHA-256. Staff-only.
70
+ * @async
71
+ * @roles signalhouse
72
+ * @param {Object} params
73
+ * @param {string} params.caseId - The case ID
74
+ * @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
75
+ * @param {RequestOptions} [params.options] - Additional options for the request
76
+ * @returns {Promise<SdkResponse<any>>} - `{ caseId, tenantId, status, decision, exportedAt, evidence }`
77
+ */
78
+ getVettingEvidence: ({ caseId, tenantId, options }: {
79
+ caseId: string;
80
+ tenantId?: string;
81
+ options?: RequestOptions;
82
+ }) => Promise<SdkResponse<any>>;
83
+ /**
84
+ * List the vetting exception queue, oldest first. Staff-only.
85
+ * @async
86
+ * @roles signalhouse
87
+ * @param {Object} [params]
88
+ * @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
89
+ * @param {("OPEN"|"CLAIMED"|"RESOLVED")} [params.status] - Only items in this status
90
+ * @param {("EXCEPTION"|"HUMAN_SIGNOFF"|"QA_SAMPLE")} [params.kind] - Only items of this kind
91
+ * @param {string} [params.reasonCode] - Only items with this reason
92
+ * @param {number} [params.page] - Page number (default 1)
93
+ * @param {number} [params.limit] - Items per page (default 25, max 100)
94
+ * @param {RequestOptions} [params.options] - Additional options for the request
95
+ * @returns {Promise<SdkResponse<any>>} - `{ data, total, page, limit }`
96
+ */
97
+ getVettingExceptions: ({ tenantId, status, kind, reasonCode, page, limit, options }?: {
98
+ tenantId?: string;
99
+ status?: ("OPEN" | "CLAIMED" | "RESOLVED");
100
+ kind?: ("EXCEPTION" | "HUMAN_SIGNOFF" | "QA_SAMPLE");
101
+ reasonCode?: string;
102
+ page?: number;
103
+ limit?: number;
104
+ options?: RequestOptions;
105
+ }) => Promise<SdkResponse<any>>;
106
+ /**
107
+ * Claim an open exception queue item, or take over one whose holder is no longer a Compliance Admin. Only one staff
108
+ * member can hold an item. Compliance Admins only, and never on a case the caller started.
109
+ * @async
110
+ * @roles signalhouse_user holding the COMPLIANCE_ADMIN staff permission (never signalhouse_admin)
111
+ * @param {Object} params
112
+ * @param {string} params.exceptionId - The queue item ID
113
+ * @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
114
+ * @param {RequestOptions} [params.options] - Additional options for the request
115
+ * @returns {Promise<SdkResponse<any>>} - The claimed item
116
+ */
117
+ claimVettingException: ({ exceptionId, tenantId, options }: {
118
+ exceptionId: string;
119
+ tenantId?: string;
120
+ options?: RequestOptions;
121
+ }) => Promise<SdkResponse<any>>;
122
+ /**
123
+ * Resolve a claimed exception queue item and set the case's result by hand. On a QA sample, VERIFY confirms the
124
+ * auto-approval and REJECT overturns it. Compliance Admins only: the one holding the item.
125
+ * @async
126
+ * @roles signalhouse_user holding the COMPLIANCE_ADMIN staff permission (never signalhouse_admin)
127
+ * @param {Object} params
128
+ * @param {string} params.exceptionId - The queue item ID
129
+ * @param {("VERIFY"|"REJECT")} params.outcome - The result
130
+ * @param {string} params.note - Why, kept with the case's evidence
131
+ * @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
132
+ * @param {RequestOptions} [params.options] - Additional options for the request
133
+ * @returns {Promise<SdkResponse<any>>} - `{ exception, case: { caseId, tenantId, status, decision } }`; read the full case with getVettingCase
134
+ */
135
+ resolveVettingException: ({ exceptionId, outcome, note, tenantId, options }: {
136
+ exceptionId: string;
137
+ outcome: ("VERIFY" | "REJECT");
138
+ note: string;
139
+ tenantId?: string;
140
+ options?: RequestOptions;
141
+ }) => Promise<SdkResponse<any>>;
142
+ /**
143
+ * Report vetting outcomes over a period (the last 30 days by default): counts by status, the straight-through rate,
144
+ * and the exception reasons. Staff-only.
145
+ * @async
146
+ * @roles signalhouse
147
+ * @param {Object} [params]
148
+ * @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
149
+ * @param {string} [params.from] - Start of the period (ISO date)
150
+ * @param {string} [params.to] - End of the period (ISO date)
151
+ * @param {RequestOptions} [params.options] - Additional options for the request
152
+ * @returns {Promise<SdkResponse<any>>} - `{ tenantId, from, to, cases: { total, decided, byStatus }, straightThrough: { count, rate }, exceptionReasons }`
153
+ */
154
+ getVettingReport: ({ tenantId, from, to, options }?: {
155
+ tenantId?: string;
156
+ from?: string;
157
+ to?: string;
158
+ options?: RequestOptions;
159
+ }) => Promise<SdkResponse<any>>;
160
+ };
161
+ }
162
+ export type RequestOptions = import("../SignalHouseSDK.js").RequestOptions;
163
+ export type SdkResponse<T> = import("../SignalHouseSDK.js").SdkResponse<T>;
@@ -8,6 +8,7 @@
8
8
  * - `sdk.voice.sipProfiles` — SIP profile / endpoint (single registerable UA).
9
9
  * - `sdk.voice.programmableVoiceProfiles` — Programmable Voice Profile (route a set of numbers through Signal House).
10
10
  * - `sdk.voice.numberRoutes` — Per-number inbound route (overrides the profile and subgroup settings).
11
+ * - `sdk.voice.callFlows` — Call flows: customer-built call trees a number or profile can run.
11
12
  * - `sdk.voice.calls` — Twilio-compat programmatic call control (create/hangup/etc.).
12
13
  * - `sdk.voice.callLogs` — Account-scoped call history: list/get + presigned recording.
13
14
  * - `sdk.voice.globalVoiceSettings` — Account-wide voice defaults (accepted regions, max spend, E911).
@@ -28,6 +29,7 @@ export class Voice {
28
29
  tokens: Tokens;
29
30
  analytics: Analytics;
30
31
  outboundVoice: OutboundVoice;
32
+ callFlows: CallFlows;
31
33
  }
32
34
  import { SipTrunks } from "./voice/SipTrunks.js";
33
35
  import { SipProfiles } from "./voice/SipProfiles.js";
@@ -39,3 +41,4 @@ import { GlobalVoiceSettings } from "./voice/GlobalVoiceSettings.js";
39
41
  import { Tokens } from "./voice/Tokens.js";
40
42
  import { Analytics } from "./voice/Analytics.js";
41
43
  import { OutboundVoice } from "./voice/OutboundVoice.js";
44
+ import { CallFlows } from "./voice/CallFlows.js";