@signalhouse-sms/sdk 1.15.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.
- package/package.json +1 -1
- package/src/SignalHouseSDK.js +3 -0
- package/src/domains/Auth.js +3 -2
- package/src/domains/Groups.js +68 -0
- package/src/domains/Messages.js +1 -1
- package/src/domains/Vetting.js +159 -0
- package/src/domains/voice/CallFlows.js +1 -1
- package/types/SignalHouseSDK.d.ts +2 -0
- package/types/domains/Auth.d.ts +3 -1
- package/types/domains/Groups.d.ts +64 -0
- package/types/domains/Messages.d.ts +1 -1
- package/types/domains/Vetting.d.ts +163 -0
- package/types/domains/voice/CallFlows.d.ts +2 -2
package/package.json
CHANGED
package/src/SignalHouseSDK.js
CHANGED
|
@@ -51,6 +51,7 @@ import { Audit } from "./domains/Audit.js";
|
|
|
51
51
|
import { Contracts } from "./domains/Contracts.js";
|
|
52
52
|
import { Verify } from "./domains/Verify.js";
|
|
53
53
|
import { Compliance } from "./domains/Compliance.js";
|
|
54
|
+
import { Vetting } from "./domains/Vetting.js";
|
|
54
55
|
|
|
55
56
|
export class SignalHouseSDK {
|
|
56
57
|
/**
|
|
@@ -108,6 +109,8 @@ export class SignalHouseSDK {
|
|
|
108
109
|
this.verify = new Verify(client, this.enableAdmin);
|
|
109
110
|
// Compliance cases under /compliance; staff methods under compliance.admin.
|
|
110
111
|
this.compliance = new Compliance(client, multipartClient, this.enableAdmin);
|
|
112
|
+
// Staff-only brand vetting for branded calling under /vetting; every method sits behind enableAdmin.
|
|
113
|
+
this.vetting = new Vetting(client, this.enableAdmin);
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
/**
|
package/src/domains/Auth.js
CHANGED
|
@@ -88,13 +88,14 @@ export class Auth {
|
|
|
88
88
|
* @param {string} [params.attribution.shLanding] - Marketing-site landing page passed on the register link (sh_landing)
|
|
89
89
|
* @param {string} [params.attribution.shCta] - Marketing-site CTA that sent the visitor (sh_cta)
|
|
90
90
|
* @param {string} [params.attribution.shGuide] - Marketing-site guide the CTA was on (sh_guide)
|
|
91
|
+
* @param {string} [params.captchaToken] - A Cloudflare Turnstile token from the Signal House sign-up page. Required for a password sign-up when the API has Turnstile turned on
|
|
91
92
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
92
93
|
* @returns {Promise<SdkResponse<any>>} The response from the server (contains the JWT token)
|
|
93
94
|
*/
|
|
94
|
-
async register({ businessName, fullName, email, password, oauthTicket, phone, dialCode, country, volume, products, acceptedTermsOfService, psXid, psPartnerKey, attribution, options = {} }) {
|
|
95
|
+
async register({ businessName, fullName, email, password, oauthTicket, phone, dialCode, country, volume, products, acceptedTermsOfService, psXid, psPartnerKey, attribution, captchaToken, options = {} }) {
|
|
95
96
|
return this.client(`/auth/register`, {
|
|
96
97
|
method: "POST",
|
|
97
|
-
body: { businessName, fullName, email, password, oauthTicket, phone, dialCode, country, volume, products, acceptedTermsOfService, psXid, psPartnerKey, attribution },
|
|
98
|
+
body: { businessName, fullName, email, password, oauthTicket, phone, dialCode, country, volume, products, acceptedTermsOfService, psXid, psPartnerKey, attribution, captchaToken },
|
|
98
99
|
...options,
|
|
99
100
|
});
|
|
100
101
|
}
|
package/src/domains/Groups.js
CHANGED
|
@@ -235,6 +235,74 @@ export class Groups {
|
|
|
235
235
|
return this.client(`/group/sso${queryString}`, { method: "DELETE", ...options });
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
/**
|
|
239
|
+
* Read a group's Ontraport connection status: whether it's connected, and the webhook URL to paste
|
|
240
|
+
* into an Ontraport automation's "Send to a Webhook" step. Never includes the API Key or App ID.
|
|
241
|
+
* @async
|
|
242
|
+
* @roles admin, developer, signalhouse_admin
|
|
243
|
+
* @param {Object} params
|
|
244
|
+
* @param {string} params.groupId - The group
|
|
245
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
246
|
+
* @returns {Promise<SdkResponse<any>>} - { connected, webhookUrl, enabled }
|
|
247
|
+
*/
|
|
248
|
+
async getOntraportConnection({ groupId, options = {} }) {
|
|
249
|
+
this.client._require({ groupId });
|
|
250
|
+
const queryString = this.client._getQueryString({ groupId });
|
|
251
|
+
return this.client(`/group/ontraport${queryString}`, { method: "GET", ...options });
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Connect (or reconnect) a group's Ontraport account. The API Key and App ID are verified with a
|
|
256
|
+
* read-only call to Ontraport before anything is stored; a bad pair throws rather than saving.
|
|
257
|
+
* Requires a Signal House Admin to have enabled featureFlags.ontraportIntegration for the group first
|
|
258
|
+
* (opt-in, off by default) - otherwise this throws a validation error.
|
|
259
|
+
* @async
|
|
260
|
+
* @roles admin, developer, signalhouse_admin
|
|
261
|
+
* @param {Object} params
|
|
262
|
+
* @param {string} params.groupId - The group
|
|
263
|
+
* @param {string} params.apiKey - The Ontraport API Key
|
|
264
|
+
* @param {string} params.appId - The Ontraport App ID
|
|
265
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
266
|
+
* @returns {Promise<SdkResponse<any>>} - { connected, webhookUrl, enabled }
|
|
267
|
+
*/
|
|
268
|
+
async connectOntraport({ groupId, apiKey, appId, options = {} }) {
|
|
269
|
+
this.client._require({ groupId, apiKey, appId });
|
|
270
|
+
return this.client(`/group/ontraport`, { method: "PUT", body: { groupId, apiKey, appId }, ...options });
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Disconnect (disable) a group's Ontraport account. The webhook stops accepting deliveries
|
|
275
|
+
* immediately; stored credentials and contact links are kept, so reconnecting the same account
|
|
276
|
+
* resumes cleanly. The primary self-service way to kill a leaked webhook URL.
|
|
277
|
+
* @async
|
|
278
|
+
* @roles admin, developer, signalhouse_admin
|
|
279
|
+
* @param {Object} params
|
|
280
|
+
* @param {string} params.groupId - The group
|
|
281
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
282
|
+
* @returns {Promise<SdkResponse<any>>} - { connected, webhookUrl, enabled }
|
|
283
|
+
*/
|
|
284
|
+
async disconnectOntraport({ groupId, options = {} }) {
|
|
285
|
+
this.client._require({ groupId });
|
|
286
|
+
const queryString = this.client._getQueryString({ groupId });
|
|
287
|
+
return this.client(`/group/ontraport${queryString}`, { method: "DELETE", ...options });
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Mint a fresh webhook token for an existing Ontraport connection, immediately invalidating the old
|
|
292
|
+
* URL. A second self-service way to kill a leaked webhook URL, for when the customer wants to keep
|
|
293
|
+
* sending (unlike disconnectOntraport) but needs a new URL to paste into a rebuilt automation.
|
|
294
|
+
* @async
|
|
295
|
+
* @roles admin, developer, signalhouse_admin
|
|
296
|
+
* @param {Object} params
|
|
297
|
+
* @param {string} params.groupId - The group
|
|
298
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
299
|
+
* @returns {Promise<SdkResponse<any>>} - { connected, webhookUrl, enabled }
|
|
300
|
+
*/
|
|
301
|
+
async regenerateOntraportWebhookToken({ groupId, options = {} }) {
|
|
302
|
+
this.client._require({ groupId });
|
|
303
|
+
return this.client(`/group/ontraport/regenerate-token`, { method: "PUT", body: { groupId }, ...options });
|
|
304
|
+
}
|
|
305
|
+
|
|
238
306
|
/**
|
|
239
307
|
* Claim an email domain for a group's SSO; the response includes the DNS TXT record that verifies it
|
|
240
308
|
* @async
|
package/src/domains/Messages.js
CHANGED
|
@@ -669,7 +669,7 @@ export class Messages {
|
|
|
669
669
|
}
|
|
670
670
|
|
|
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
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
|
|
2
|
+
/**
|
|
3
|
+
* @template T
|
|
4
|
+
* @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Vetting domain: the staff-only brand vetting engine for branded calling. A case runs a brand through automated checks, a
|
|
9
|
+
* rules engine decides it, and staff work only the exception queue. Every method lives under the admin namespace, present
|
|
10
|
+
* only when the SDK is created with `enableAdmin: true`. JS SDK only by design.
|
|
11
|
+
*/
|
|
12
|
+
export class Vetting {
|
|
13
|
+
constructor(client, enableAdmin) {
|
|
14
|
+
this.client = client;
|
|
15
|
+
this.enableAdmin = enableAdmin;
|
|
16
|
+
|
|
17
|
+
// Hidden Admin namespace INSIDE the domain
|
|
18
|
+
if (enableAdmin) {
|
|
19
|
+
this.admin = {
|
|
20
|
+
/**
|
|
21
|
+
* Start vetting a brand. The case runs in the background; read it with getVettingCase. Staff-only.
|
|
22
|
+
* @async
|
|
23
|
+
* @roles signalhouse
|
|
24
|
+
* @param {Object} params
|
|
25
|
+
* @param {Object} params.subject - The brand: `{ legalName, entityType?, displayName?, ein?, website?, sector?,
|
|
26
|
+
* authorizer?: { name?, email?, phone? }, billingContact?: { name?, email?, phone? },
|
|
27
|
+
* billingAddress?: { street?, city?, state?, postalCode?, country? }, groupId?, brandId? }`. Only `legalName` is
|
|
28
|
+
* required to start; a case missing any field the checks need is rejected with a cure listing them.
|
|
29
|
+
* @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
|
|
30
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
31
|
+
* @returns {Promise<SdkResponse<any>>} - `{ caseId, tenantId, status }`, accepted with HTTP 202
|
|
32
|
+
*/
|
|
33
|
+
startVettingCase: async ({ subject, tenantId, options = {} }) => {
|
|
34
|
+
this.client._require({ subject });
|
|
35
|
+
return this.client("/vetting/cases", { method: "POST", body: { subject, ...(tenantId !== undefined ? { tenantId } : {}) }, ...options });
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* List vetting cases, newest first. Staff-only.
|
|
40
|
+
* @async
|
|
41
|
+
* @roles signalhouse
|
|
42
|
+
* @param {Object} [params]
|
|
43
|
+
* @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
|
|
44
|
+
* @param {("RUNNING"|"DECIDING"|"VERIFIED"|"REJECTED"|"FALLBACK"|"EXCEPTION"|"HUMAN_SIGNOFF")} [params.status] - Only cases in this status
|
|
45
|
+
* @param {number} [params.page] - Page number (default 1)
|
|
46
|
+
* @param {number} [params.limit] - Cases per page (default 25, max 100)
|
|
47
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
48
|
+
* @returns {Promise<SdkResponse<any>>} - `{ data, total, page, limit }`
|
|
49
|
+
*/
|
|
50
|
+
getVettingCases: async ({ tenantId, status, page, limit, options = {} } = {}) => {
|
|
51
|
+
const queryString = this.client._getQueryString({ tenantId, status, page, limit });
|
|
52
|
+
return this.client(`/vetting/cases${queryString}`, { method: "GET", ...options });
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get one vetting case with its steps, decision and history. Staff-only.
|
|
57
|
+
* @async
|
|
58
|
+
* @roles signalhouse
|
|
59
|
+
* @param {Object} params
|
|
60
|
+
* @param {string} params.caseId - The case ID
|
|
61
|
+
* @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
|
|
62
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
63
|
+
* @returns {Promise<SdkResponse<any>>} - The case
|
|
64
|
+
*/
|
|
65
|
+
getVettingCase: async ({ caseId, tenantId, options = {} }) => {
|
|
66
|
+
this.client._require({ caseId });
|
|
67
|
+
const queryString = this.client._getQueryString({ tenantId });
|
|
68
|
+
return this.client(`/vetting/cases/${encodeURIComponent(caseId)}${queryString}`, { method: "GET", ...options });
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Export every evidence item for a case, oldest first, each with its payload's SHA-256. Staff-only.
|
|
73
|
+
* @async
|
|
74
|
+
* @roles signalhouse
|
|
75
|
+
* @param {Object} params
|
|
76
|
+
* @param {string} params.caseId - The case ID
|
|
77
|
+
* @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
|
|
78
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
79
|
+
* @returns {Promise<SdkResponse<any>>} - `{ caseId, tenantId, status, decision, exportedAt, evidence }`
|
|
80
|
+
*/
|
|
81
|
+
getVettingEvidence: async ({ caseId, tenantId, options = {} }) => {
|
|
82
|
+
this.client._require({ caseId });
|
|
83
|
+
const queryString = this.client._getQueryString({ tenantId });
|
|
84
|
+
return this.client(`/vetting/cases/${encodeURIComponent(caseId)}/evidence${queryString}`, { method: "GET", ...options });
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* List the vetting exception queue, oldest first. Staff-only.
|
|
89
|
+
* @async
|
|
90
|
+
* @roles signalhouse
|
|
91
|
+
* @param {Object} [params]
|
|
92
|
+
* @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
|
|
93
|
+
* @param {("OPEN"|"CLAIMED"|"RESOLVED")} [params.status] - Only items in this status
|
|
94
|
+
* @param {("EXCEPTION"|"HUMAN_SIGNOFF"|"QA_SAMPLE")} [params.kind] - Only items of this kind
|
|
95
|
+
* @param {string} [params.reasonCode] - Only items with this reason
|
|
96
|
+
* @param {number} [params.page] - Page number (default 1)
|
|
97
|
+
* @param {number} [params.limit] - Items per page (default 25, max 100)
|
|
98
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
99
|
+
* @returns {Promise<SdkResponse<any>>} - `{ data, total, page, limit }`
|
|
100
|
+
*/
|
|
101
|
+
getVettingExceptions: async ({ tenantId, status, kind, reasonCode, page, limit, options = {} } = {}) => {
|
|
102
|
+
const queryString = this.client._getQueryString({ tenantId, status, kind, reasonCode, page, limit });
|
|
103
|
+
return this.client(`/vetting/exceptions${queryString}`, { method: "GET", ...options });
|
|
104
|
+
},
|
|
105
|
+
|
|
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: async ({ exceptionId, tenantId, options = {} }) => {
|
|
118
|
+
this.client._require({ exceptionId });
|
|
119
|
+
return this.client(`/vetting/exceptions/${encodeURIComponent(exceptionId)}/claim`, { method: "POST", body: { ...(tenantId !== undefined ? { tenantId } : {}) }, ...options });
|
|
120
|
+
},
|
|
121
|
+
|
|
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: async ({ exceptionId, outcome, note, tenantId, options = {} }) => {
|
|
136
|
+
this.client._require({ exceptionId, outcome, note });
|
|
137
|
+
return this.client(`/vetting/exceptions/${encodeURIComponent(exceptionId)}/resolve`, { method: "POST", body: { outcome, note, ...(tenantId !== undefined ? { tenantId } : {}) }, ...options });
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Report vetting outcomes over a period (the last 30 days by default): counts by status, the straight-through rate,
|
|
142
|
+
* and the exception reasons. Staff-only.
|
|
143
|
+
* @async
|
|
144
|
+
* @roles signalhouse
|
|
145
|
+
* @param {Object} [params]
|
|
146
|
+
* @param {string} [params.tenantId] - The vetting tenant (default "signalhouse")
|
|
147
|
+
* @param {string} [params.from] - Start of the period (ISO date)
|
|
148
|
+
* @param {string} [params.to] - End of the period (ISO date)
|
|
149
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
150
|
+
* @returns {Promise<SdkResponse<any>>} - `{ tenantId, from, to, cases: { total, decided, byStatus }, straightThrough: { count, rate }, exceptionReasons }`
|
|
151
|
+
*/
|
|
152
|
+
getVettingReport: async ({ tenantId, from, to, options = {} } = {}) => {
|
|
153
|
+
const queryString = this.client._getQueryString({ tenantId, from, to });
|
|
154
|
+
return this.client(`/vetting/report${queryString}`, { method: "GET", ...options });
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
/**
|
|
31
31
|
* @typedef {Object} CallFlowStep
|
|
32
32
|
* @property {string} id - A UUID you generate. It is kept as the step's id, so it stays stable across saves.
|
|
33
|
-
* @property {"inbound"|"answer"|"play"|"ivr"|"fwd_phone"|"voicemail"|"hangup"} type - The step kind. `catalog()` lists the kinds this service can run.
|
|
33
|
+
* @property {"inbound"|"answer"|"play"|"sms"|"ivr"|"fwd_phone"|"voicemail"|"hangup"} type - The step kind. `catalog()` lists the kinds this service can run.
|
|
34
34
|
* @property {string} name - Display name.
|
|
35
35
|
* @property {Object} [config] - The step's settings, which depend on its type.
|
|
36
36
|
* @property {number} [positionX] - Canvas x position, for a visual builder.
|
|
@@ -34,6 +34,7 @@ export class SignalHouseSDK {
|
|
|
34
34
|
contracts: Contracts;
|
|
35
35
|
verify: Verify;
|
|
36
36
|
compliance: Compliance;
|
|
37
|
+
vetting: Vetting;
|
|
37
38
|
/**
|
|
38
39
|
* Client for API requests
|
|
39
40
|
* @private
|
|
@@ -123,3 +124,4 @@ import { Audit } from "./domains/Audit.js";
|
|
|
123
124
|
import { Contracts } from "./domains/Contracts.js";
|
|
124
125
|
import { Verify } from "./domains/Verify.js";
|
|
125
126
|
import { Compliance } from "./domains/Compliance.js";
|
|
127
|
+
import { Vetting } from "./domains/Vetting.js";
|
package/types/domains/Auth.d.ts
CHANGED
|
@@ -81,10 +81,11 @@ export class Auth {
|
|
|
81
81
|
* @param {string} [params.attribution.shLanding] - Marketing-site landing page passed on the register link (sh_landing)
|
|
82
82
|
* @param {string} [params.attribution.shCta] - Marketing-site CTA that sent the visitor (sh_cta)
|
|
83
83
|
* @param {string} [params.attribution.shGuide] - Marketing-site guide the CTA was on (sh_guide)
|
|
84
|
+
* @param {string} [params.captchaToken] - A Cloudflare Turnstile token from the Signal House sign-up page. Required for a password sign-up when the API has Turnstile turned on
|
|
84
85
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
85
86
|
* @returns {Promise<SdkResponse<any>>} The response from the server (contains the JWT token)
|
|
86
87
|
*/
|
|
87
|
-
register({ businessName, fullName, email, password, oauthTicket, phone, dialCode, country, volume, products, acceptedTermsOfService, psXid, psPartnerKey, attribution, options }: {
|
|
88
|
+
register({ businessName, fullName, email, password, oauthTicket, phone, dialCode, country, volume, products, acceptedTermsOfService, psXid, psPartnerKey, attribution, captchaToken, options }: {
|
|
88
89
|
businessName: string;
|
|
89
90
|
fullName: string;
|
|
90
91
|
email: string;
|
|
@@ -106,6 +107,7 @@ export class Auth {
|
|
|
106
107
|
shCta?: string;
|
|
107
108
|
shGuide?: string;
|
|
108
109
|
};
|
|
110
|
+
captchaToken?: string;
|
|
109
111
|
options?: RequestOptions;
|
|
110
112
|
}): Promise<SdkResponse<any>>;
|
|
111
113
|
/**
|
|
@@ -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
|
|
@@ -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>;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
/**
|
|
27
27
|
* @typedef {Object} CallFlowStep
|
|
28
28
|
* @property {string} id - A UUID you generate. It is kept as the step's id, so it stays stable across saves.
|
|
29
|
-
* @property {"inbound"|"answer"|"play"|"ivr"|"fwd_phone"|"voicemail"|"hangup"} type - The step kind. `catalog()` lists the kinds this service can run.
|
|
29
|
+
* @property {"inbound"|"answer"|"play"|"sms"|"ivr"|"fwd_phone"|"voicemail"|"hangup"} type - The step kind. `catalog()` lists the kinds this service can run.
|
|
30
30
|
* @property {string} name - Display name.
|
|
31
31
|
* @property {Object} [config] - The step's settings, which depend on its type.
|
|
32
32
|
* @property {number} [positionX] - Canvas x position, for a visual builder.
|
|
@@ -271,7 +271,7 @@ export type CallFlowStep = {
|
|
|
271
271
|
/**
|
|
272
272
|
* - The step kind. `catalog()` lists the kinds this service can run.
|
|
273
273
|
*/
|
|
274
|
-
type: "inbound" | "answer" | "play" | "ivr" | "fwd_phone" | "voicemail" | "hangup";
|
|
274
|
+
type: "inbound" | "answer" | "play" | "sms" | "ivr" | "fwd_phone" | "voicemail" | "hangup";
|
|
275
275
|
/**
|
|
276
276
|
* - Display name.
|
|
277
277
|
*/
|