@signalhouse-sms/sdk 1.16.0 → 1.17.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/domains/Brands.js +1 -1
- package/src/domains/Campaigns.js +1 -1
- package/src/domains/Compliance.js +42 -8
- package/src/domains/Groups.js +8 -4
- package/src/domains/Messages.js +5 -1
- package/src/domains/Numbers.js +3 -2
- package/src/domains/Rcs.js +1 -1
- package/src/domains/Subgroups.js +7 -6
- package/src/domains/Voice.js +6 -0
- package/src/domains/voice/CallFlows.js +1 -1
- package/src/domains/voice/PushCredentials.js +110 -0
- package/src/domains/voice/PushDevices.js +71 -0
- package/src/domains/voice/Tokens.js +1 -0
- package/types/domains/Brands.d.ts +2 -2
- package/types/domains/Campaigns.d.ts +2 -2
- package/types/domains/Compliance.d.ts +47 -7
- package/types/domains/Groups.d.ts +9 -3
- package/types/domains/Messages.d.ts +5 -1
- package/types/domains/Numbers.d.ts +3 -1
- package/types/domains/Rcs.d.ts +1 -1
- package/types/domains/Subgroups.d.ts +11 -9
- package/types/domains/Voice.d.ts +6 -0
- package/types/domains/voice/CallFlows.d.ts +2 -2
- package/types/domains/voice/PushCredentials.d.ts +144 -0
- package/types/domains/voice/PushDevices.d.ts +85 -0
- package/types/domains/voice/Tokens.d.ts +5 -0
package/package.json
CHANGED
package/src/domains/Brands.js
CHANGED
|
@@ -212,7 +212,7 @@ export class Brands {
|
|
|
212
212
|
* @param {string} [params.status] - The status of the brand to filter by (PENDING_CREATION, PENDING_APPROVAL, UNVERIFIED, VERIFIED, VETTED_VERIFIED, PENDING_DELETE, DELETED)
|
|
213
213
|
* @param {string} [params.registrationType] - Filter by registration type ("TEN_DLC", "TOLL_FREE", or "SHORT_CODE")
|
|
214
214
|
* @param {boolean} [params.currentTollFreeCarrier] - With subgroupId or groupId: when true, return only toll-free brands that a new toll-free campaign in that group can use (those on the group's current toll-free carrier)
|
|
215
|
-
* @param {string} [params.search] -
|
|
215
|
+
* @param {string|string[]} [params.search] - Search terms, each sent as its own `search` key; every term must match. With subgroupId or groupId, free text matches brandId, displayName and companyName; on the staff-only list (no id/subgroupId/groupId) it matches brandId, displayName, companyName, ein, email, groupId, subgroupId and referenceId. `field:term` searches one of those eight fields. Each term is 3 to 100 characters, at most 5 terms.
|
|
216
216
|
* @param {string} [params.sortBy] - Staff-only: createdAt, brandId, displayName, groupId, subgroupId, status, entityType or country
|
|
217
217
|
* @param {"asc"|"desc"} [params.sortOrder] - Staff-only: sort direction (default asc)
|
|
218
218
|
* @param {string} [params.entityType] - Staff-only: exact entity type filter
|
package/src/domains/Campaigns.js
CHANGED
|
@@ -336,7 +336,7 @@ export class Campaigns {
|
|
|
336
336
|
* @param {number} [params.page] - The page number for pagination
|
|
337
337
|
* @param {number} [params.limit] - The number of items per page
|
|
338
338
|
* @param {string} [params.status] - The status of the campaign to filter by
|
|
339
|
-
* @param {string} [params.search] - Search term
|
|
339
|
+
* @param {string|string[]} [params.search] - Search terms, each sent as its own `search` key; every term must match. With brandId, subgroupId or groupId, free text matches campaignId; on the staff-only list (no id/brandId/subgroupId/groupId) it matches campaignId and brandId. `field:term` searches campaignId or brandId. Each term is 3 to 100 characters, at most 5 terms.
|
|
340
340
|
* @param {string} [params.sortBy] - Field to sort by (e.g. "createdAt", "campaignId", "brandId", "groupId", "subgroupId", "usecase", "status")
|
|
341
341
|
* @param {string} [params.sortOrder] - Sort direction ("asc" or "desc")
|
|
342
342
|
* @param {string} [params.registrationType] - Filter by registration type ("TEN_DLC", "TOLL_FREE", or "SHORT_CODE")
|
|
@@ -55,19 +55,44 @@ export class Compliance {
|
|
|
55
55
|
},
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* List alerts,
|
|
58
|
+
* List alerts, newest received first. Each row carries `case: { caseId, status, stage, assigneeUserId, suspended }`,
|
|
59
|
+
* or null with no case. `counts` follows every filter except open, inbox, assignee, suspended and severity.
|
|
59
60
|
* @async
|
|
60
61
|
* @roles signalhouse_admin, signalhouse_user
|
|
61
|
-
* @param {Object} [params] - Filters:
|
|
62
|
+
* @param {Object} [params] - Filters: q (an id, a number or part of the account name, up to 100 characters), type,
|
|
63
|
+
* form, severity (one value or a comma list), channel, source, subjectKind, subjectId, number, groupId,
|
|
64
|
+
* subgroupId, brandId, campaignId, caseId, assignee (a user id, or "none"), suspended, inbox, open, blocks,
|
|
65
|
+
* slackPending, from, to, liftedFrom (blocks lifted on or after this time), page, limit
|
|
62
66
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
63
|
-
* @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, counts: {
|
|
67
|
+
* @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, counts: { all, open,
|
|
68
|
+
* mine, unowned, suspended, resolved, inbox, accounts, openBySeverity, unownedBySeverity } }`
|
|
64
69
|
*/
|
|
65
70
|
getAlerts: async ({ options = {}, ...filters } = {}) => {
|
|
66
71
|
return this.client(`/compliance/alerts${this.client._getQueryString(filters)}`, { method: "GET", ...options });
|
|
67
72
|
},
|
|
68
73
|
|
|
69
74
|
/**
|
|
70
|
-
*
|
|
75
|
+
* List every active customer account, plus any group with open compliance work, with its risk, open alert counts,
|
|
76
|
+
* outbound message count over a window and Signal House's next step. Without groupId, channel keeps the accounts with
|
|
77
|
+
* an open alert on it; subgroupId, brandId, campaignId and number need a groupId and then narrow that account's
|
|
78
|
+
* counts. Risk always covers the whole account. `counts` holds each chip's total over the searched rows.
|
|
79
|
+
* @async
|
|
80
|
+
* @roles signalhouse_admin, signalhouse_user
|
|
81
|
+
* @param {Object} [params] - Filters: search (a string or an array of strings, every one must match; each is free text
|
|
82
|
+
* or `field:term` for groupId, groupName or groupCompanyName, 3 to 100 characters, at most 5), sort (next, account,
|
|
83
|
+
* risk, alerts, suspended, notices or messages), sortOrder (asc or desc), chips (a comma list of waiting, suspended, high, notices, review, inbox),
|
|
84
|
+
* days (7, 30 or 90), groupId, subgroupId, brandId, campaignId, number, channel, page, limit
|
|
85
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
86
|
+
* @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, days, counts: { waiting,
|
|
87
|
+
* suspended, high, notices, review, inbox } }`; each row is `{ groupId, accountName, createdAt, risk, openAlerts, critical,
|
|
88
|
+
* suspended, notices, inbox, reviewDue, messages, nextStep }`
|
|
89
|
+
*/
|
|
90
|
+
getAccounts: async ({ options = {}, ...filters } = {}) => {
|
|
91
|
+
return this.client(`/compliance/accounts${this.client._getQueryString(filters)}`, { method: "GET", ...options });
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Get one alert with its escalation chain, case summary and timeline.
|
|
71
96
|
* @async
|
|
72
97
|
* @roles signalhouse_admin, signalhouse_user
|
|
73
98
|
* @param {Object} params - The lookup
|
|
@@ -223,7 +248,9 @@ export class Compliance {
|
|
|
223
248
|
}
|
|
224
249
|
|
|
225
250
|
/**
|
|
226
|
-
* List the compliance cases you can see, newest first. `counts.waitingOnYou` is the open cases with requirements still to answer
|
|
251
|
+
* List the compliance cases you can see, newest first. `counts.waitingOnYou` is the open cases with requirements still to answer.
|
|
252
|
+
* Staff get `counts: { open, unowned, byStage, overdue, oldestLiftRequestedAt }` instead, which follows every filter except
|
|
253
|
+
* status, stage and open
|
|
227
254
|
* @async
|
|
228
255
|
* @roles api, admin, developer, billing, user
|
|
229
256
|
* @param {Object} [params] - Filters
|
|
@@ -234,16 +261,23 @@ export class Compliance {
|
|
|
234
261
|
* @param {string} [params.objectId] - The object's id
|
|
235
262
|
* @param {string} [params.subgroupId] - Only cases in this subgroup
|
|
236
263
|
* @param {boolean} [params.suspended] - true for cases with an open suspension or hold, false for the rest
|
|
264
|
+
* @param {string} [params.q] - Staff only: a case, group, object, brand, campaign or subgroup id, or part of the account name, up to 100 characters. Ignored for other roles
|
|
265
|
+
* @param {string} [params.brandId] - Staff only: only cases on this brand. Ignored for other roles
|
|
266
|
+
* @param {string} [params.campaignId] - Staff only: only cases on this campaign. Ignored for other roles
|
|
267
|
+
* @param {string} [params.number] - Staff only: digits with the country code; the number's own case and the cases holding an alert on it. Ignored for other roles
|
|
268
|
+
* @param {boolean} [params.open] - Staff only: true for cases that are not closed, false for closed cases. Ignored for other roles
|
|
269
|
+
* @param {string} [params.assignee] - Staff only: the owner's user id, or "none" for unowned cases. Ignored for other roles
|
|
270
|
+
* @param {boolean} [params.reviewDue] - Staff only: true for cases flagged for account review, false for the rest. Ignored for other roles
|
|
237
271
|
* @param {string} [params.from] - Opened on or after this ISO 8601 time
|
|
238
272
|
* @param {string} [params.to] - Opened on or before this ISO 8601 time
|
|
239
273
|
* @param {string} [params.sort] - createdAt (default), fixBy or severity
|
|
240
274
|
* @param {number} [params.page] - Page number, from 1
|
|
241
275
|
* @param {number} [params.limit] - Cases per page, 1-200
|
|
242
276
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
243
|
-
* @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, counts
|
|
277
|
+
* @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, counts }`
|
|
244
278
|
*/
|
|
245
|
-
async getCases({ groupId, status, stage, objectType, objectId, subgroupId, suspended, from, to, sort, page, limit, options = {} } = {}) {
|
|
246
|
-
const query = this.client._getQueryString({ groupId, status, stage, objectType, objectId, subgroupId, suspended, from, to, sort, page, limit });
|
|
279
|
+
async getCases({ groupId, status, stage, objectType, objectId, subgroupId, suspended, q, brandId, campaignId, number, open, assignee, reviewDue, from, to, sort, page, limit, options = {} } = {}) {
|
|
280
|
+
const query = this.client._getQueryString({ groupId, status, stage, objectType, objectId, subgroupId, suspended, q, brandId, campaignId, number, open, assignee, reviewDue, from, to, sort, page, limit });
|
|
247
281
|
return this.client(`/compliance/cases${query}`, { method: "GET", ...options });
|
|
248
282
|
}
|
|
249
283
|
|
package/src/domains/Groups.js
CHANGED
|
@@ -30,17 +30,21 @@ export class Groups {
|
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* Get a list of all groups with optional pagination
|
|
33
|
+
* Get a list of all groups with optional pagination and search
|
|
34
34
|
* @async
|
|
35
35
|
* @roles signalhouse
|
|
36
36
|
* @param {Object} params - The parameters for getting groups
|
|
37
37
|
* @param {number} [params.page] - The page number for pagination
|
|
38
38
|
* @param {number} [params.limit] - The number of items per page
|
|
39
|
+
* @param {string|string[]} [params.search] - One value or several, every one must match. Each is free text, found in
|
|
40
|
+
* the Group ID, group name or company name, or `field:term` to search groupId, groupName or groupCompanyName only.
|
|
41
|
+
* Each term is 3 to 100 characters, and at most 5 values
|
|
42
|
+
* @param {boolean} [params.includeTotal] - With page and limit, return `{ data, total, page, limit, totalPages }`
|
|
39
43
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
40
|
-
* @returns {Promise<SdkResponse<any>>} - The list of groups returned from the server
|
|
44
|
+
* @returns {Promise<SdkResponse<any>>} - The list of groups returned from the server, or the envelope with includeTotal
|
|
41
45
|
*/
|
|
42
|
-
getGroups: async ({ page, limit, options = {} }) => {
|
|
43
|
-
const filters = { page, limit };
|
|
46
|
+
getGroups: async ({ page, limit, search, includeTotal, options = {} }) => {
|
|
47
|
+
const filters = { page, limit, search, includeTotal };
|
|
44
48
|
const queryString = this.client._getQueryString(filters);
|
|
45
49
|
return this.client(`/group${queryString}`, { method: "GET", ...options });
|
|
46
50
|
},
|
package/src/domains/Messages.js
CHANGED
|
@@ -92,6 +92,8 @@ export class Messages {
|
|
|
92
92
|
* @returns {Promise<SdkResponse<any>>} - A promise that resolves to the list of messages. Inbound messages also carry
|
|
93
93
|
* sentimentScore (-100..100, null when unscored), sentimentLabel ("positive"|"neutral"|"negative", null when
|
|
94
94
|
* sentimentScore is null) and sentimentScoredAt. Outbound messages are never scored.
|
|
95
|
+
* Inbound messages also carry inReplyToMessageId: the message the reply answers, absent when there is none. If that
|
|
96
|
+
* message has a parentMessageId, it was an RCS fallback, and the parent is the RCS message you sent.
|
|
95
97
|
*/
|
|
96
98
|
async getMessages({
|
|
97
99
|
id,
|
|
@@ -142,7 +144,7 @@ export class Messages {
|
|
|
142
144
|
* @param {string} params.id - The message ID
|
|
143
145
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
144
146
|
* @throws {Error} Throws an error if the id parameter is missing
|
|
145
|
-
* @returns {Promise<SdkResponse<any>>} - A promise that resolves to the message; an unknown ID is a 404. An RCS message and its fallback leg also carry `costBreakdown`: `{ legs: [{ messageId, channel, billed, billingClass, segments, baseMicros, carrierMicros, rated }] }`, null when it cannot be computed. A settled RCS message also carries `carrierFeeMicros`: the carrier pass-through and media surcharge it was charged
|
|
147
|
+
* @returns {Promise<SdkResponse<any>>} - A promise that resolves to the message; an unknown ID is a 404. An RCS message and its fallback leg also carry `costBreakdown`: `{ legs: [{ messageId, channel, billed, billingClass, segments, baseMicros, carrierMicros, rated }] }`, null when it cannot be computed. A settled RCS message also carries `carrierFeeMicros`: the carrier pass-through and media surcharge it was charged. Inbound messages also carry `inReplyToMessageId`: the message the reply answers, absent when there is none. If that message has a `parentMessageId`, it was an RCS fallback, and the parent is the RCS message you sent
|
|
146
148
|
*/
|
|
147
149
|
async getMessage({ id, options = {} }) {
|
|
148
150
|
this.client._require({ id });
|
|
@@ -499,6 +501,7 @@ export class Messages {
|
|
|
499
501
|
* true server-side (the SignalHouse shortlink system, which mints unique per-recipient links).
|
|
500
502
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
501
503
|
* @returns {Promise<SdkResponse<any>>} - A promise that resolves to the response data from the server
|
|
504
|
+
* @deprecated P2P messaging is retired and the API answers 410. This method will be removed in a future major release.
|
|
502
505
|
*/
|
|
503
506
|
async sendP2P({ recipientPhoneNumbers, messageBody, statusCallbackUrl, groupId, subgroupId, useSignalHouseShortlinks, options = {} }) {
|
|
504
507
|
this.client._require({ recipientPhoneNumbers, messageBody });
|
|
@@ -523,6 +526,7 @@ export class Messages {
|
|
|
523
526
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
524
527
|
* @throws {Error} Throws an error if the batchId parameter is missing
|
|
525
528
|
* @returns {Promise<SdkResponse<any>>} - The P2P batch object returned from the server
|
|
529
|
+
* @deprecated P2P messaging is retired and the API answers 410. This method will be removed in a future major release.
|
|
526
530
|
*/
|
|
527
531
|
async getP2PBatch({ batchId, options = {} }) {
|
|
528
532
|
this.client._require({ batchId });
|
package/src/domains/Numbers.js
CHANGED
|
@@ -88,6 +88,7 @@ export class Numbers {
|
|
|
88
88
|
* @param {string} [params.groupId] - Filter by group ID
|
|
89
89
|
* @param {boolean} [params.currentTollFreeCarrier] - With subgroupId or groupId: when true, return only toll-free numbers that a new toll-free campaign in that group can use (those on the group's current toll-free carrier)
|
|
90
90
|
* @param {boolean} [params.released] - With subgroupId or groupId: when true, return only its released numbers (status RELEASED) instead of its active ones
|
|
91
|
+
* @param {string|string[]} [params.search] - Search terms, each sent as its own `search` key; every term must match. Free text matches phoneNumber and friendlyName; `field:term` searches one of those fields. A term that reads as a phone number (digits, spaces, + ( ) . -) matches the number's digits, so "(512) 555" finds 15125550100. Each term is 3 to 100 characters, at most 5 terms.
|
|
91
92
|
* @param {number} [params.page] - The page number for pagination (default: 1)
|
|
92
93
|
* @param {number} [params.limit] - The number of items per page for pagination (default: 20)
|
|
93
94
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
@@ -110,8 +111,8 @@ export class Numbers {
|
|
|
110
111
|
* or GET /campaign/health.
|
|
111
112
|
* @returns {Promise<SdkResponse<any>>} A promise that resolves to the list of phone numbers
|
|
112
113
|
*/
|
|
113
|
-
async getPhoneNumbers({ phoneNumber, campaignId, registrationId, brandId, subgroupId, groupId, currentTollFreeCarrier, released, page, limit, options = {} }) {
|
|
114
|
-
const filters = { phoneNumber, campaignId, registrationId, brandId, subgroupId, groupId, currentTollFreeCarrier, released, page, limit };
|
|
114
|
+
async getPhoneNumbers({ phoneNumber, campaignId, registrationId, brandId, subgroupId, groupId, currentTollFreeCarrier, released, search, page, limit, options = {} }) {
|
|
115
|
+
const filters = { phoneNumber, campaignId, registrationId, brandId, subgroupId, groupId, currentTollFreeCarrier, released, search, page, limit };
|
|
115
116
|
const queryString = this.client._getQueryString(filters);
|
|
116
117
|
return this.client(`/number${queryString}`, { method: 'GET', ...options });
|
|
117
118
|
}
|
package/src/domains/Rcs.js
CHANGED
|
@@ -552,7 +552,7 @@ export class RcsMessages {
|
|
|
552
552
|
* @param {Object} params - The lookup
|
|
553
553
|
* @param {string} params.messageId - The message ID
|
|
554
554
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
555
|
-
* @returns {Promise<SdkResponse<any>>} A promise that resolves to the message; an unknown ID is a 404. A settled RCS message carries carrierFeeMicros, the carrier pass-through and media surcharge it was charged
|
|
555
|
+
* @returns {Promise<SdkResponse<any>>} A promise that resolves to the message; an unknown ID is a 404. A settled RCS message carries carrierFeeMicros, the carrier pass-through and media surcharge it was charged. An inbound RCS message also carries inReplyToMessageId: the message it answers, absent when there is none
|
|
556
556
|
*/
|
|
557
557
|
async get({ messageId, options = {} }) {
|
|
558
558
|
this.client._require({ messageId });
|
package/src/domains/Subgroups.js
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* @property {string} [country] - The country for the subgroup's address
|
|
20
20
|
* @property {string} [postalCode] - The postal code for the subgroup's address
|
|
21
21
|
* @property {string} [phone] - The phone number for the subgroup
|
|
22
|
-
* @property {string} [carrierIdFamily] -
|
|
23
|
-
* @property {string|null} [carrierIdRegion] -
|
|
22
|
+
* @property {string} [carrierIdFamily] - Deprecated: accepted and stored, with no effect on billing. One of "Default", "ATT", "TMobile", "Verizon", "USCellular", "GoogleVoice", "ClearSky", "Interop". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
23
|
+
* @property {string|null} [carrierIdRegion] - Deprecated: accepted and stored, with no effect on billing. ClearSky region ("PRClaro", "GuamDocomo", "GuamGTA", "GuamITE") or null; only valid when carrierIdFamily is "ClearSky". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
* @property {string} [postalCode] - The postal code for the subgroup's address
|
|
39
39
|
* @property {string} [phone] - The phone number for the subgroup
|
|
40
40
|
* @property {string} [status] - The status of the subgroup (e.g., "active", "inactive")
|
|
41
|
-
* @property {string} [carrierIdFamily] -
|
|
42
|
-
* @property {string|null} [carrierIdRegion] -
|
|
41
|
+
* @property {string} [carrierIdFamily] - Deprecated: accepted and stored, with no effect on billing. One of "Default", "ATT", "TMobile", "Verizon", "USCellular", "GoogleVoice", "ClearSky", "Interop". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
42
|
+
* @property {string|null} [carrierIdRegion] - Deprecated: accepted and stored, with no effect on billing. ClearSky region ("PRClaro", "GuamDocomo", "GuamGTA", "GuamITE") or null; only valid when carrierIdFamily is "ClearSky". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
43
43
|
* @property {boolean} [cnamAutoApply] - Turn caller name (CNAM) auto-apply on or off: eligible numbers get their brand's registered name as the name shown on outbound calls. Requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin or developer role.
|
|
44
44
|
* @property {string|null} [cnamBrandId] - Default caller-ID brand for numbers with no campaign (e.g. voice-only). Must be a verified brand in this subgroup; required when turning auto-apply on in a subgroup with more than one verified brand.
|
|
45
45
|
*/
|
|
@@ -88,13 +88,14 @@ export class Subgroups {
|
|
|
88
88
|
* @param {Object} params - The parameters for getting subgroups
|
|
89
89
|
* @param {string} [params.id] - Filter by subgroup ID
|
|
90
90
|
* @param {string} [params.groupId] - Filter by parent group ID
|
|
91
|
+
* @param {string|string[]} [params.search] - Search terms, each sent as its own `search` key; every term must match. Free text matches subgroupId, subgroupName and subgroupCompanyName; `field:term` searches one of those fields. Each term is 3 to 100 characters, at most 5 terms.
|
|
91
92
|
* @param {number} [params.page] - The page number for pagination
|
|
92
93
|
* @param {number} [params.limit] - The number of items per page for pagination
|
|
93
94
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
94
95
|
* @returns {Promise<SdkResponse<any>>} - The list of subgroups returned from the server
|
|
95
96
|
*/
|
|
96
|
-
async getSubgroups({ id, groupId, page, limit, options = {} }) {
|
|
97
|
-
const filters = { id, groupId, page, limit };
|
|
97
|
+
async getSubgroups({ id, groupId, search, page, limit, options = {} }) {
|
|
98
|
+
const filters = { id, groupId, search, page, limit };
|
|
98
99
|
const queryString = this.client._getQueryString(filters);
|
|
99
100
|
return this.client(`/subgroup${queryString}`, { method: "GET", ...options });
|
|
100
101
|
}
|
package/src/domains/Voice.js
CHANGED
|
@@ -9,6 +9,8 @@ import { Tokens } from "./voice/Tokens.js";
|
|
|
9
9
|
import { Analytics } from "./voice/Analytics.js";
|
|
10
10
|
import { OutboundVoice } from "./voice/OutboundVoice.js";
|
|
11
11
|
import { CallFlows } from "./voice/CallFlows.js";
|
|
12
|
+
import { PushCredentials } from "./voice/PushCredentials.js";
|
|
13
|
+
import { PushDevices } from "./voice/PushDevices.js";
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Voice domain — wraps the Voice service (mounted under /voice on the
|
|
@@ -25,6 +27,8 @@ import { CallFlows } from "./voice/CallFlows.js";
|
|
|
25
27
|
* - `sdk.voice.callLogs` — Account-scoped call history: list/get + presigned recording.
|
|
26
28
|
* - `sdk.voice.globalVoiceSettings` — Account-wide voice defaults (accepted regions, max spend, E911).
|
|
27
29
|
* - `sdk.voice.tokens` — Mint ephemeral SIP credentials for the browser voice SDK.
|
|
30
|
+
* - `sdk.voice.pushCredentials` — Mobile push: the Apple/Firebase credentials that wake your app for calls.
|
|
31
|
+
* - `sdk.voice.pushDevices` — Mobile push: register a device (called by the app with its voice token).
|
|
28
32
|
* - `sdk.voice.analytics` — Aggregated call analytics (summary tiles + byDate/byNumber/byCarrier breakdowns).
|
|
29
33
|
*/
|
|
30
34
|
export class Voice {
|
|
@@ -42,5 +46,7 @@ export class Voice {
|
|
|
42
46
|
this.analytics = new Analytics(client, enableAdmin);
|
|
43
47
|
this.outboundVoice = new OutboundVoice(client, enableAdmin);
|
|
44
48
|
this.callFlows = new CallFlows(client, enableAdmin);
|
|
49
|
+
this.pushCredentials = new PushCredentials(client, enableAdmin);
|
|
50
|
+
this.pushDevices = new PushDevices(client, enableAdmin);
|
|
45
51
|
}
|
|
46
52
|
}
|
|
@@ -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"|"sms"|"ivr"|"fwd_phone"|"voicemail"|"hangup"} type - The step kind. `catalog()` lists the kinds this service can run.
|
|
33
|
+
* @property {"inbound"|"answer"|"play"|"sms"|"ivr"|"ai_agent"|"ai_sms"|"webhook"|"fwd_phone"|"fwd_sip"|"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.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
|
|
2
|
+
/**
|
|
3
|
+
* @template T
|
|
4
|
+
* @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {Object} ApnsCredentialData
|
|
9
|
+
* @property {"apns"} provider - Apple Push Notification service (iOS).
|
|
10
|
+
* @property {string} [name] - A label, up to 100 characters.
|
|
11
|
+
* @property {string} keyId - The 10-character key ID of the APNs auth key (.p8).
|
|
12
|
+
* @property {string} teamId - Your 10-character Apple developer team ID.
|
|
13
|
+
* @property {string} bundleId - Your app's bundle ID. VoIP pushes go to its `.voip` topic.
|
|
14
|
+
* @property {string} privateKey - The contents of the .p8 file.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @typedef {Object} FcmCredentialData
|
|
19
|
+
* @property {"fcm"} provider - Firebase Cloud Messaging (Android).
|
|
20
|
+
* @property {string} [name] - A label, up to 100 characters.
|
|
21
|
+
* @property {string|Object} serviceAccount - The Firebase service account key file, as its JSON text or the parsed object.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Mobile push credentials — the Apple APNs auth key and Firebase service account the Voice service
|
|
26
|
+
* uses to wake your mobile app for incoming calls. One credential per app; secrets are encrypted and
|
|
27
|
+
* never returned (responses show a `fingerprint`). Calls the Voice service mounted under /voice.
|
|
28
|
+
* Accessed via `sdk.voice.pushCredentials`.
|
|
29
|
+
*/
|
|
30
|
+
export class PushCredentials {
|
|
31
|
+
constructor(client, enableAdmin) {
|
|
32
|
+
this.client = client;
|
|
33
|
+
this.enableAdmin = enableAdmin;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* List the account's push credentials (metadata only).
|
|
38
|
+
* @async
|
|
39
|
+
* @roles api, admin, developer, billing, user
|
|
40
|
+
* @param {Object} [params] - Request parameters.
|
|
41
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
42
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: [{ id, provider, name, appId, keyId, teamId, bundleId, projectId, clientEmail, fingerprint, createdAt, updatedAt }] }`.
|
|
43
|
+
*/
|
|
44
|
+
async list({ options = {} } = {}) {
|
|
45
|
+
return this.client(`/voice/api/v1/push-credentials`, { method: "GET", ...options });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get one push credential (metadata only).
|
|
50
|
+
* @async
|
|
51
|
+
* @roles api, admin, developer, billing, user
|
|
52
|
+
* @param {Object} params - Request parameters.
|
|
53
|
+
* @param {string} params.id - The credential ID.
|
|
54
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
55
|
+
* @throws {Error} If id is missing.
|
|
56
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: { ...credential } }`.
|
|
57
|
+
*/
|
|
58
|
+
async get({ id, options = {} }) {
|
|
59
|
+
this.client._require({ id });
|
|
60
|
+
return this.client(`/voice/api/v1/push-credentials/${encodeURIComponent(id)}`, { method: "GET", ...options });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Upload push credentials for one app: an Apple APNs auth key, or a Firebase service account. The
|
|
65
|
+
* key is checked on upload.
|
|
66
|
+
* @async
|
|
67
|
+
* @roles api, admin, developer
|
|
68
|
+
* @param {Object} params - Request parameters.
|
|
69
|
+
* @param {ApnsCredentialData|FcmCredentialData} params.credentialData - The credential.
|
|
70
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
71
|
+
* @throws {Error} If credentialData is missing.
|
|
72
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: { ...credential } }` (201).
|
|
73
|
+
*/
|
|
74
|
+
async create({ credentialData, options = {} }) {
|
|
75
|
+
this.client._require({ credentialData });
|
|
76
|
+
return this.client(`/voice/api/v1/push-credentials`, { method: "POST", body: credentialData, ...options });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Replace a credential's key or service account (and name). Same body as create; the provider
|
|
81
|
+
* cannot change. Registered devices keep working with the new key.
|
|
82
|
+
* @async
|
|
83
|
+
* @roles api, admin, developer
|
|
84
|
+
* @param {Object} params - Request parameters.
|
|
85
|
+
* @param {string} params.id - The credential ID.
|
|
86
|
+
* @param {ApnsCredentialData|FcmCredentialData} params.credentialData - The replacement.
|
|
87
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
88
|
+
* @throws {Error} If id or credentialData is missing.
|
|
89
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: { ...credential } }`.
|
|
90
|
+
*/
|
|
91
|
+
async update({ id, credentialData, options = {} }) {
|
|
92
|
+
this.client._require({ id, credentialData });
|
|
93
|
+
return this.client(`/voice/api/v1/push-credentials/${encodeURIComponent(id)}`, { method: "PUT", body: credentialData, ...options });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Delete a credential and every device registered for that app.
|
|
98
|
+
* @async
|
|
99
|
+
* @roles api, admin, developer
|
|
100
|
+
* @param {Object} params - Request parameters.
|
|
101
|
+
* @param {string} params.id - The credential ID.
|
|
102
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
103
|
+
* @throws {Error} If id is missing.
|
|
104
|
+
* @returns {Promise<SdkResponse<any>>} `{ success }`.
|
|
105
|
+
*/
|
|
106
|
+
async delete({ id, options = {} }) {
|
|
107
|
+
this.client._require({ id });
|
|
108
|
+
return this.client(`/voice/api/v1/push-credentials/${encodeURIComponent(id)}`, { method: "DELETE", ...options });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
|
|
2
|
+
/**
|
|
3
|
+
* @template T
|
|
4
|
+
* @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {Object} RegisterPushDeviceData
|
|
9
|
+
* @property {"apns"|"fcm"} provider - "apns" for iOS (PushKit VoIP token), "fcm" for Android (Firebase registration token).
|
|
10
|
+
* @property {string} deviceToken - The device's push token.
|
|
11
|
+
* @property {"production"|"sandbox"} [environment] - apns only: "sandbox" for development builds. Default "production".
|
|
12
|
+
* @property {string} [appId] - The bundle ID or Firebase project ID; only needed when the account has several apps for the provider.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Mobile push devices — your app registers each device so incoming calls wake it. These methods are
|
|
17
|
+
* called by the app with the user's **voice token** (from `sdk.voice.tokens.create`, minted with a
|
|
18
|
+
* `subgroupId`) as `options.token`, not a dashboard or API key token. The device is tied to that
|
|
19
|
+
* token's identity. Calls the Voice service mounted under /voice. Accessed via `sdk.voice.pushDevices`.
|
|
20
|
+
*/
|
|
21
|
+
export class PushDevices {
|
|
22
|
+
constructor(client, enableAdmin) {
|
|
23
|
+
this.client = client;
|
|
24
|
+
this.enableAdmin = enableAdmin;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Register this device for push. Call it after each token mint and whenever the OS gives the app a
|
|
29
|
+
* new push token. A push token already registered to another user moves to this one.
|
|
30
|
+
* @async
|
|
31
|
+
* @roles voice token
|
|
32
|
+
* @param {Object} params - Request parameters.
|
|
33
|
+
* @param {RegisterPushDeviceData} params.deviceData - The device.
|
|
34
|
+
* @param {RequestOptions} params.options - Must carry the voice token as `token`.
|
|
35
|
+
* @throws {Error} If deviceData is missing.
|
|
36
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: { id, identity, provider, environment, appId, registeredAt } }` (201).
|
|
37
|
+
*/
|
|
38
|
+
async register({ deviceData, options = {} }) {
|
|
39
|
+
this.client._require({ deviceData });
|
|
40
|
+
return this.client(`/voice/api/v1/push-devices`, { method: "POST", body: deviceData, ...options });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Unregister this device, e.g. when the user signs out.
|
|
45
|
+
* @async
|
|
46
|
+
* @roles voice token
|
|
47
|
+
* @param {Object} params - Request parameters.
|
|
48
|
+
* @param {string} params.deviceToken - The device's push token.
|
|
49
|
+
* @param {RequestOptions} params.options - Must carry the voice token as `token`.
|
|
50
|
+
* @throws {Error} If deviceToken is missing.
|
|
51
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: { removed } }`.
|
|
52
|
+
*/
|
|
53
|
+
async unregister({ deviceToken, options = {} }) {
|
|
54
|
+
this.client._require({ deviceToken });
|
|
55
|
+
return this.client(`/voice/api/v1/push-devices/${encodeURIComponent(deviceToken)}`, { method: "DELETE", ...options });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The pushes recently sent to the voice token's user, newest first (kept 7 days), for debugging.
|
|
60
|
+
* @async
|
|
61
|
+
* @roles voice token
|
|
62
|
+
* @param {Object} [params] - Request parameters.
|
|
63
|
+
* @param {number} [params.limit] - How many, 1 to 100 (default 20).
|
|
64
|
+
* @param {RequestOptions} [params.options] - Must carry the voice token as `token`.
|
|
65
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: [{ id, callUuid, provider, kind, status, error, createdAt }] }`.
|
|
66
|
+
*/
|
|
67
|
+
async listDeliveries({ limit, options = {} } = {}) {
|
|
68
|
+
const query = limit !== undefined && limit !== null ? `?limit=${encodeURIComponent(limit)}` : "";
|
|
69
|
+
return this.client(`/voice/api/v1/push-devices/deliveries${query}`, { method: "GET", ...options });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* @typedef {Object} CreateTokenData
|
|
18
18
|
* @property {string} [identity] - Customer-facing logical identity name (e.g. "alice"). Persisted as `requested_identity` so server-initiated `calls.create({to_identity: "alice"})` can resolve it later. Defaults to "anonymous".
|
|
19
19
|
* @property {number} [ttl] - Token TTL in seconds. Clamped to the server's max. Defaults to VOICE_TOKEN_DEFAULT_TTL_SEC.
|
|
20
|
+
* @property {string} [subgroupId] - The subgroup whose inbound calls should ring this identity. Required to receive calls (and to register the device for mobile push).
|
|
20
21
|
* @property {VoiceGrants} [grants] - Capability grants attached to the token.
|
|
21
22
|
*/
|
|
22
23
|
|
|
@@ -196,7 +196,7 @@ export class Brands {
|
|
|
196
196
|
* @param {string} [params.status] - The status of the brand to filter by (PENDING_CREATION, PENDING_APPROVAL, UNVERIFIED, VERIFIED, VETTED_VERIFIED, PENDING_DELETE, DELETED)
|
|
197
197
|
* @param {string} [params.registrationType] - Filter by registration type ("TEN_DLC", "TOLL_FREE", or "SHORT_CODE")
|
|
198
198
|
* @param {boolean} [params.currentTollFreeCarrier] - With subgroupId or groupId: when true, return only toll-free brands that a new toll-free campaign in that group can use (those on the group's current toll-free carrier)
|
|
199
|
-
* @param {string} [params.search] -
|
|
199
|
+
* @param {string|string[]} [params.search] - Search terms, each sent as its own `search` key; every term must match. With subgroupId or groupId, free text matches brandId, displayName and companyName; on the staff-only list (no id/subgroupId/groupId) it matches brandId, displayName, companyName, ein, email, groupId, subgroupId and referenceId. `field:term` searches one of those eight fields. Each term is 3 to 100 characters, at most 5 terms.
|
|
200
200
|
* @param {string} [params.sortBy] - Staff-only: createdAt, brandId, displayName, groupId, subgroupId, status, entityType or country
|
|
201
201
|
* @param {"asc"|"desc"} [params.sortOrder] - Staff-only: sort direction (default asc)
|
|
202
202
|
* @param {string} [params.entityType] - Staff-only: exact entity type filter
|
|
@@ -220,7 +220,7 @@ export class Brands {
|
|
|
220
220
|
status?: string;
|
|
221
221
|
registrationType?: string;
|
|
222
222
|
currentTollFreeCarrier?: boolean;
|
|
223
|
-
search?: string;
|
|
223
|
+
search?: string | string[];
|
|
224
224
|
sortBy?: string;
|
|
225
225
|
sortOrder?: "asc" | "desc";
|
|
226
226
|
entityType?: string;
|
|
@@ -305,7 +305,7 @@ export class Campaigns {
|
|
|
305
305
|
* @param {number} [params.page] - The page number for pagination
|
|
306
306
|
* @param {number} [params.limit] - The number of items per page
|
|
307
307
|
* @param {string} [params.status] - The status of the campaign to filter by
|
|
308
|
-
* @param {string} [params.search] - Search term
|
|
308
|
+
* @param {string|string[]} [params.search] - Search terms, each sent as its own `search` key; every term must match. With brandId, subgroupId or groupId, free text matches campaignId; on the staff-only list (no id/brandId/subgroupId/groupId) it matches campaignId and brandId. `field:term` searches campaignId or brandId. Each term is 3 to 100 characters, at most 5 terms.
|
|
309
309
|
* @param {string} [params.sortBy] - Field to sort by (e.g. "createdAt", "campaignId", "brandId", "groupId", "subgroupId", "usecase", "status")
|
|
310
310
|
* @param {string} [params.sortOrder] - Sort direction ("asc" or "desc")
|
|
311
311
|
* @param {string} [params.registrationType] - Filter by registration type ("TEN_DLC", "TOLL_FREE", or "SHORT_CODE")
|
|
@@ -344,7 +344,7 @@ export class Campaigns {
|
|
|
344
344
|
page?: number;
|
|
345
345
|
limit?: number;
|
|
346
346
|
status?: string;
|
|
347
|
-
search?: string;
|
|
347
|
+
search?: string | string[];
|
|
348
348
|
sortBy?: string;
|
|
349
349
|
sortOrder?: string;
|
|
350
350
|
registrationType?: string;
|
|
@@ -51,18 +51,42 @@ export class Compliance {
|
|
|
51
51
|
options?: RequestOptions;
|
|
52
52
|
}) => Promise<SdkResponse<any>>;
|
|
53
53
|
/**
|
|
54
|
-
* List alerts,
|
|
54
|
+
* List alerts, newest received first. Each row carries `case: { caseId, status, stage, assigneeUserId, suspended }`,
|
|
55
|
+
* or null with no case. `counts` follows every filter except open, inbox, assignee, suspended and severity.
|
|
55
56
|
* @async
|
|
56
57
|
* @roles signalhouse_admin, signalhouse_user
|
|
57
|
-
* @param {Object} [params] - Filters:
|
|
58
|
+
* @param {Object} [params] - Filters: q (an id, a number or part of the account name, up to 100 characters), type,
|
|
59
|
+
* form, severity (one value or a comma list), channel, source, subjectKind, subjectId, number, groupId,
|
|
60
|
+
* subgroupId, brandId, campaignId, caseId, assignee (a user id, or "none"), suspended, inbox, open, blocks,
|
|
61
|
+
* slackPending, from, to, liftedFrom (blocks lifted on or after this time), page, limit
|
|
58
62
|
* @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: {
|
|
63
|
+
* @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, counts: { all, open,
|
|
64
|
+
* mine, unowned, suspended, resolved, inbox, accounts, openBySeverity, unownedBySeverity } }`
|
|
60
65
|
*/
|
|
61
66
|
getAlerts: ({ options, ...filters }?: {
|
|
62
67
|
options?: RequestOptions;
|
|
63
68
|
}) => Promise<SdkResponse<any>>;
|
|
64
69
|
/**
|
|
65
|
-
*
|
|
70
|
+
* List every active customer account, plus any group with open compliance work, with its risk, open alert counts,
|
|
71
|
+
* outbound message count over a window and Signal House's next step. Without groupId, channel keeps the accounts with
|
|
72
|
+
* an open alert on it; subgroupId, brandId, campaignId and number need a groupId and then narrow that account's
|
|
73
|
+
* counts. Risk always covers the whole account. `counts` holds each chip's total over the searched rows.
|
|
74
|
+
* @async
|
|
75
|
+
* @roles signalhouse_admin, signalhouse_user
|
|
76
|
+
* @param {Object} [params] - Filters: search (a string or an array of strings, every one must match; each is free text
|
|
77
|
+
* or `field:term` for groupId, groupName or groupCompanyName, 3 to 100 characters, at most 5), sort (next, account,
|
|
78
|
+
* risk, alerts, suspended, notices or messages), sortOrder (asc or desc), chips (a comma list of waiting, suspended, high, notices, review, inbox),
|
|
79
|
+
* days (7, 30 or 90), groupId, subgroupId, brandId, campaignId, number, channel, page, limit
|
|
80
|
+
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
81
|
+
* @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, days, counts: { waiting,
|
|
82
|
+
* suspended, high, notices, review, inbox } }`; each row is `{ groupId, accountName, createdAt, risk, openAlerts, critical,
|
|
83
|
+
* suspended, notices, inbox, reviewDue, messages, nextStep }`
|
|
84
|
+
*/
|
|
85
|
+
getAccounts: ({ options, ...filters }?: {
|
|
86
|
+
options?: RequestOptions;
|
|
87
|
+
}) => Promise<SdkResponse<any>>;
|
|
88
|
+
/**
|
|
89
|
+
* Get one alert with its escalation chain, case summary and timeline.
|
|
66
90
|
* @async
|
|
67
91
|
* @roles signalhouse_admin, signalhouse_user
|
|
68
92
|
* @param {Object} params - The lookup
|
|
@@ -221,7 +245,9 @@ export class Compliance {
|
|
|
221
245
|
}) => Promise<SdkResponse<any>>;
|
|
222
246
|
};
|
|
223
247
|
/**
|
|
224
|
-
* List the compliance cases you can see, newest first. `counts.waitingOnYou` is the open cases with requirements still to answer
|
|
248
|
+
* List the compliance cases you can see, newest first. `counts.waitingOnYou` is the open cases with requirements still to answer.
|
|
249
|
+
* Staff get `counts: { open, unowned, byStage, overdue, oldestLiftRequestedAt }` instead, which follows every filter except
|
|
250
|
+
* status, stage and open
|
|
225
251
|
* @async
|
|
226
252
|
* @roles api, admin, developer, billing, user
|
|
227
253
|
* @param {Object} [params] - Filters
|
|
@@ -232,15 +258,22 @@ export class Compliance {
|
|
|
232
258
|
* @param {string} [params.objectId] - The object's id
|
|
233
259
|
* @param {string} [params.subgroupId] - Only cases in this subgroup
|
|
234
260
|
* @param {boolean} [params.suspended] - true for cases with an open suspension or hold, false for the rest
|
|
261
|
+
* @param {string} [params.q] - Staff only: a case, group, object, brand, campaign or subgroup id, or part of the account name, up to 100 characters. Ignored for other roles
|
|
262
|
+
* @param {string} [params.brandId] - Staff only: only cases on this brand. Ignored for other roles
|
|
263
|
+
* @param {string} [params.campaignId] - Staff only: only cases on this campaign. Ignored for other roles
|
|
264
|
+
* @param {string} [params.number] - Staff only: digits with the country code; the number's own case and the cases holding an alert on it. Ignored for other roles
|
|
265
|
+
* @param {boolean} [params.open] - Staff only: true for cases that are not closed, false for closed cases. Ignored for other roles
|
|
266
|
+
* @param {string} [params.assignee] - Staff only: the owner's user id, or "none" for unowned cases. Ignored for other roles
|
|
267
|
+
* @param {boolean} [params.reviewDue] - Staff only: true for cases flagged for account review, false for the rest. Ignored for other roles
|
|
235
268
|
* @param {string} [params.from] - Opened on or after this ISO 8601 time
|
|
236
269
|
* @param {string} [params.to] - Opened on or before this ISO 8601 time
|
|
237
270
|
* @param {string} [params.sort] - createdAt (default), fixBy or severity
|
|
238
271
|
* @param {number} [params.page] - Page number, from 1
|
|
239
272
|
* @param {number} [params.limit] - Cases per page, 1-200
|
|
240
273
|
* @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
|
|
274
|
+
* @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, counts }`
|
|
242
275
|
*/
|
|
243
|
-
getCases({ groupId, status, stage, objectType, objectId, subgroupId, suspended, from, to, sort, page, limit, options }?: {
|
|
276
|
+
getCases({ groupId, status, stage, objectType, objectId, subgroupId, suspended, q, brandId, campaignId, number, open, assignee, reviewDue, from, to, sort, page, limit, options }?: {
|
|
244
277
|
groupId?: string;
|
|
245
278
|
status?: string;
|
|
246
279
|
stage?: string;
|
|
@@ -248,6 +281,13 @@ export class Compliance {
|
|
|
248
281
|
objectId?: string;
|
|
249
282
|
subgroupId?: string;
|
|
250
283
|
suspended?: boolean;
|
|
284
|
+
q?: string;
|
|
285
|
+
brandId?: string;
|
|
286
|
+
campaignId?: string;
|
|
287
|
+
number?: string;
|
|
288
|
+
open?: boolean;
|
|
289
|
+
assignee?: string;
|
|
290
|
+
reviewDue?: boolean;
|
|
251
291
|
from?: string;
|
|
252
292
|
to?: string;
|
|
253
293
|
sort?: string;
|
|
@@ -27,18 +27,24 @@ export class Groups {
|
|
|
27
27
|
options?: RequestOptions;
|
|
28
28
|
}) => Promise<SdkResponse<any>>;
|
|
29
29
|
/**
|
|
30
|
-
* Get a list of all groups with optional pagination
|
|
30
|
+
* Get a list of all groups with optional pagination and search
|
|
31
31
|
* @async
|
|
32
32
|
* @roles signalhouse
|
|
33
33
|
* @param {Object} params - The parameters for getting groups
|
|
34
34
|
* @param {number} [params.page] - The page number for pagination
|
|
35
35
|
* @param {number} [params.limit] - The number of items per page
|
|
36
|
+
* @param {string|string[]} [params.search] - One value or several, every one must match. Each is free text, found in
|
|
37
|
+
* the Group ID, group name or company name, or `field:term` to search groupId, groupName or groupCompanyName only.
|
|
38
|
+
* Each term is 3 to 100 characters, and at most 5 values
|
|
39
|
+
* @param {boolean} [params.includeTotal] - With page and limit, return `{ data, total, page, limit, totalPages }`
|
|
36
40
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
37
|
-
* @returns {Promise<SdkResponse<any>>} - The list of groups returned from the server
|
|
41
|
+
* @returns {Promise<SdkResponse<any>>} - The list of groups returned from the server, or the envelope with includeTotal
|
|
38
42
|
*/
|
|
39
|
-
getGroups: ({ page, limit, options }: {
|
|
43
|
+
getGroups: ({ page, limit, search, includeTotal, options }: {
|
|
40
44
|
page?: number;
|
|
41
45
|
limit?: number;
|
|
46
|
+
search?: string | string[];
|
|
47
|
+
includeTotal?: boolean;
|
|
42
48
|
options?: RequestOptions;
|
|
43
49
|
}) => Promise<SdkResponse<any>>;
|
|
44
50
|
/**
|
|
@@ -82,6 +82,8 @@ export class Messages {
|
|
|
82
82
|
* @returns {Promise<SdkResponse<any>>} - A promise that resolves to the list of messages. Inbound messages also carry
|
|
83
83
|
* sentimentScore (-100..100, null when unscored), sentimentLabel ("positive"|"neutral"|"negative", null when
|
|
84
84
|
* sentimentScore is null) and sentimentScoredAt. Outbound messages are never scored.
|
|
85
|
+
* Inbound messages also carry inReplyToMessageId: the message the reply answers, absent when there is none. If that
|
|
86
|
+
* message has a parentMessageId, it was an RCS fallback, and the parent is the RCS message you sent.
|
|
85
87
|
*/
|
|
86
88
|
getMessages({ id, campaignId, brandId, subgroupId, groupId, registrationId, phoneNumber, senderPhoneNumber, recipientPhoneNumber, status, direction, messageType, channel, region, regionScopes, matchAny, carrier, sentimentLabel, errorCode, startDate, endDate, sortField, sortOrder, page, limit, dateBounds, templateId, templateVersion, bulkId, fallbackReason, billingClass, deliveredChannel, isTest, options, }: {
|
|
87
89
|
id?: string;
|
|
@@ -127,7 +129,7 @@ export class Messages {
|
|
|
127
129
|
* @param {string} params.id - The message ID
|
|
128
130
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
129
131
|
* @throws {Error} Throws an error if the id parameter is missing
|
|
130
|
-
* @returns {Promise<SdkResponse<any>>} - A promise that resolves to the message; an unknown ID is a 404. An RCS message and its fallback leg also carry `costBreakdown`: `{ legs: [{ messageId, channel, billed, billingClass, segments, baseMicros, carrierMicros, rated }] }`, null when it cannot be computed. A settled RCS message also carries `carrierFeeMicros`: the carrier pass-through and media surcharge it was charged
|
|
132
|
+
* @returns {Promise<SdkResponse<any>>} - A promise that resolves to the message; an unknown ID is a 404. An RCS message and its fallback leg also carry `costBreakdown`: `{ legs: [{ messageId, channel, billed, billingClass, segments, baseMicros, carrierMicros, rated }] }`, null when it cannot be computed. A settled RCS message also carries `carrierFeeMicros`: the carrier pass-through and media surcharge it was charged. Inbound messages also carry `inReplyToMessageId`: the message the reply answers, absent when there is none. If that message has a `parentMessageId`, it was an RCS fallback, and the parent is the RCS message you sent
|
|
131
133
|
*/
|
|
132
134
|
getMessage({ id, options }: {
|
|
133
135
|
id: string;
|
|
@@ -566,6 +568,7 @@ export class Messages {
|
|
|
566
568
|
* true server-side (the SignalHouse shortlink system, which mints unique per-recipient links).
|
|
567
569
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
568
570
|
* @returns {Promise<SdkResponse<any>>} - A promise that resolves to the response data from the server
|
|
571
|
+
* @deprecated P2P messaging is retired and the API answers 410. This method will be removed in a future major release.
|
|
569
572
|
*/
|
|
570
573
|
sendP2P({ recipientPhoneNumbers, messageBody, statusCallbackUrl, groupId, subgroupId, useSignalHouseShortlinks, options }: {
|
|
571
574
|
recipientPhoneNumbers: string[];
|
|
@@ -585,6 +588,7 @@ export class Messages {
|
|
|
585
588
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
586
589
|
* @throws {Error} Throws an error if the batchId parameter is missing
|
|
587
590
|
* @returns {Promise<SdkResponse<any>>} - The P2P batch object returned from the server
|
|
591
|
+
* @deprecated P2P messaging is retired and the API answers 410. This method will be removed in a future major release.
|
|
588
592
|
*/
|
|
589
593
|
getP2PBatch({ batchId, options }: {
|
|
590
594
|
batchId: string;
|
|
@@ -78,6 +78,7 @@ export class Numbers {
|
|
|
78
78
|
* @param {string} [params.groupId] - Filter by group ID
|
|
79
79
|
* @param {boolean} [params.currentTollFreeCarrier] - With subgroupId or groupId: when true, return only toll-free numbers that a new toll-free campaign in that group can use (those on the group's current toll-free carrier)
|
|
80
80
|
* @param {boolean} [params.released] - With subgroupId or groupId: when true, return only its released numbers (status RELEASED) instead of its active ones
|
|
81
|
+
* @param {string|string[]} [params.search] - Search terms, each sent as its own `search` key; every term must match. Free text matches phoneNumber and friendlyName; `field:term` searches one of those fields. A term that reads as a phone number (digits, spaces, + ( ) . -) matches the number's digits, so "(512) 555" finds 15125550100. Each term is 3 to 100 characters, at most 5 terms.
|
|
81
82
|
* @param {number} [params.page] - The page number for pagination (default: 1)
|
|
82
83
|
* @param {number} [params.limit] - The number of items per page for pagination (default: 20)
|
|
83
84
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
@@ -100,7 +101,7 @@ export class Numbers {
|
|
|
100
101
|
* or GET /campaign/health.
|
|
101
102
|
* @returns {Promise<SdkResponse<any>>} A promise that resolves to the list of phone numbers
|
|
102
103
|
*/
|
|
103
|
-
getPhoneNumbers({ phoneNumber, campaignId, registrationId, brandId, subgroupId, groupId, currentTollFreeCarrier, released, page, limit, options }: {
|
|
104
|
+
getPhoneNumbers({ phoneNumber, campaignId, registrationId, brandId, subgroupId, groupId, currentTollFreeCarrier, released, search, page, limit, options }: {
|
|
104
105
|
phoneNumber?: string;
|
|
105
106
|
campaignId?: string;
|
|
106
107
|
registrationId?: string;
|
|
@@ -109,6 +110,7 @@ export class Numbers {
|
|
|
109
110
|
groupId?: string;
|
|
110
111
|
currentTollFreeCarrier?: boolean;
|
|
111
112
|
released?: boolean;
|
|
113
|
+
search?: string | string[];
|
|
112
114
|
page?: number;
|
|
113
115
|
limit?: number;
|
|
114
116
|
options?: RequestOptions;
|
package/types/domains/Rcs.d.ts
CHANGED
|
@@ -593,7 +593,7 @@ export class RcsMessages {
|
|
|
593
593
|
* @param {Object} params - The lookup
|
|
594
594
|
* @param {string} params.messageId - The message ID
|
|
595
595
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
596
|
-
* @returns {Promise<SdkResponse<any>>} A promise that resolves to the message; an unknown ID is a 404. A settled RCS message carries carrierFeeMicros, the carrier pass-through and media surcharge it was charged
|
|
596
|
+
* @returns {Promise<SdkResponse<any>>} A promise that resolves to the message; an unknown ID is a 404. A settled RCS message carries carrierFeeMicros, the carrier pass-through and media surcharge it was charged. An inbound RCS message also carries inReplyToMessageId: the message it answers, absent when there is none
|
|
597
597
|
*/
|
|
598
598
|
get({ messageId, options }: {
|
|
599
599
|
messageId: string;
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* @property {string} [country] - The country for the subgroup's address
|
|
19
19
|
* @property {string} [postalCode] - The postal code for the subgroup's address
|
|
20
20
|
* @property {string} [phone] - The phone number for the subgroup
|
|
21
|
-
* @property {string} [carrierIdFamily] -
|
|
22
|
-
* @property {string|null} [carrierIdRegion] -
|
|
21
|
+
* @property {string} [carrierIdFamily] - Deprecated: accepted and stored, with no effect on billing. One of "Default", "ATT", "TMobile", "Verizon", "USCellular", "GoogleVoice", "ClearSky", "Interop". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
22
|
+
* @property {string|null} [carrierIdRegion] - Deprecated: accepted and stored, with no effect on billing. ClearSky region ("PRClaro", "GuamDocomo", "GuamGTA", "GuamITE") or null; only valid when carrierIdFamily is "ClearSky". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
23
23
|
*/
|
|
24
24
|
/**
|
|
25
25
|
* @typedef {Object} UpdateSubgroupData
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
* @property {string} [postalCode] - The postal code for the subgroup's address
|
|
37
37
|
* @property {string} [phone] - The phone number for the subgroup
|
|
38
38
|
* @property {string} [status] - The status of the subgroup (e.g., "active", "inactive")
|
|
39
|
-
* @property {string} [carrierIdFamily] -
|
|
40
|
-
* @property {string|null} [carrierIdRegion] -
|
|
39
|
+
* @property {string} [carrierIdFamily] - Deprecated: accepted and stored, with no effect on billing. One of "Default", "ATT", "TMobile", "Verizon", "USCellular", "GoogleVoice", "ClearSky", "Interop". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
40
|
+
* @property {string|null} [carrierIdRegion] - Deprecated: accepted and stored, with no effect on billing. ClearSky region ("PRClaro", "GuamDocomo", "GuamGTA", "GuamITE") or null; only valid when carrierIdFamily is "ClearSky". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
41
41
|
* @property {boolean} [cnamAutoApply] - Turn caller name (CNAM) auto-apply on or off: eligible numbers get their brand's registered name as the name shown on outbound calls. Requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin or developer role.
|
|
42
42
|
* @property {string|null} [cnamBrandId] - Default caller-ID brand for numbers with no campaign (e.g. voice-only). Must be a verified brand in this subgroup; required when turning auto-apply on in a subgroup with more than one verified brand.
|
|
43
43
|
*/
|
|
@@ -82,14 +82,16 @@ export class Subgroups {
|
|
|
82
82
|
* @param {Object} params - The parameters for getting subgroups
|
|
83
83
|
* @param {string} [params.id] - Filter by subgroup ID
|
|
84
84
|
* @param {string} [params.groupId] - Filter by parent group ID
|
|
85
|
+
* @param {string|string[]} [params.search] - Search terms, each sent as its own `search` key; every term must match. Free text matches subgroupId, subgroupName and subgroupCompanyName; `field:term` searches one of those fields. Each term is 3 to 100 characters, at most 5 terms.
|
|
85
86
|
* @param {number} [params.page] - The page number for pagination
|
|
86
87
|
* @param {number} [params.limit] - The number of items per page for pagination
|
|
87
88
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
88
89
|
* @returns {Promise<SdkResponse<any>>} - The list of subgroups returned from the server
|
|
89
90
|
*/
|
|
90
|
-
getSubgroups({ id, groupId, page, limit, options }: {
|
|
91
|
+
getSubgroups({ id, groupId, search, page, limit, options }: {
|
|
91
92
|
id?: string;
|
|
92
93
|
groupId?: string;
|
|
94
|
+
search?: string | string[];
|
|
93
95
|
page?: number;
|
|
94
96
|
limit?: number;
|
|
95
97
|
options?: RequestOptions;
|
|
@@ -236,11 +238,11 @@ export type CreateSubgroupData = {
|
|
|
236
238
|
*/
|
|
237
239
|
phone?: string;
|
|
238
240
|
/**
|
|
239
|
-
* -
|
|
241
|
+
* - Deprecated: accepted and stored, with no effect on billing. One of "Default", "ATT", "TMobile", "Verizon", "USCellular", "GoogleVoice", "ClearSky", "Interop". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
240
242
|
*/
|
|
241
243
|
carrierIdFamily?: string;
|
|
242
244
|
/**
|
|
243
|
-
* -
|
|
245
|
+
* - Deprecated: accepted and stored, with no effect on billing. ClearSky region ("PRClaro", "GuamDocomo", "GuamGTA", "GuamITE") or null; only valid when carrierIdFamily is "ClearSky". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
244
246
|
*/
|
|
245
247
|
carrierIdRegion?: string | null;
|
|
246
248
|
};
|
|
@@ -298,11 +300,11 @@ export type UpdateSubgroupData = {
|
|
|
298
300
|
*/
|
|
299
301
|
status?: string;
|
|
300
302
|
/**
|
|
301
|
-
* -
|
|
303
|
+
* - Deprecated: accepted and stored, with no effect on billing. One of "Default", "ATT", "TMobile", "Verizon", "USCellular", "GoogleVoice", "ClearSky", "Interop". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
302
304
|
*/
|
|
303
305
|
carrierIdFamily?: string;
|
|
304
306
|
/**
|
|
305
|
-
* -
|
|
307
|
+
* - Deprecated: accepted and stored, with no effect on billing. ClearSky region ("PRClaro", "GuamDocomo", "GuamGTA", "GuamITE") or null; only valid when carrierIdFamily is "ClearSky". Setting this field requires signalhouse_api, signalhouse_admin, signalhouse_user, api, admin, developer, or billing role.
|
|
306
308
|
*/
|
|
307
309
|
carrierIdRegion?: string | null;
|
|
308
310
|
/**
|
package/types/domains/Voice.d.ts
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* - `sdk.voice.callLogs` — Account-scoped call history: list/get + presigned recording.
|
|
14
14
|
* - `sdk.voice.globalVoiceSettings` — Account-wide voice defaults (accepted regions, max spend, E911).
|
|
15
15
|
* - `sdk.voice.tokens` — Mint ephemeral SIP credentials for the browser voice SDK.
|
|
16
|
+
* - `sdk.voice.pushCredentials` — Mobile push: the Apple/Firebase credentials that wake your app for calls.
|
|
17
|
+
* - `sdk.voice.pushDevices` — Mobile push: register a device (called by the app with its voice token).
|
|
16
18
|
* - `sdk.voice.analytics` — Aggregated call analytics (summary tiles + byDate/byNumber/byCarrier breakdowns).
|
|
17
19
|
*/
|
|
18
20
|
export class Voice {
|
|
@@ -30,6 +32,8 @@ export class Voice {
|
|
|
30
32
|
analytics: Analytics;
|
|
31
33
|
outboundVoice: OutboundVoice;
|
|
32
34
|
callFlows: CallFlows;
|
|
35
|
+
pushCredentials: PushCredentials;
|
|
36
|
+
pushDevices: PushDevices;
|
|
33
37
|
}
|
|
34
38
|
import { SipTrunks } from "./voice/SipTrunks.js";
|
|
35
39
|
import { SipProfiles } from "./voice/SipProfiles.js";
|
|
@@ -42,3 +46,5 @@ import { Tokens } from "./voice/Tokens.js";
|
|
|
42
46
|
import { Analytics } from "./voice/Analytics.js";
|
|
43
47
|
import { OutboundVoice } from "./voice/OutboundVoice.js";
|
|
44
48
|
import { CallFlows } from "./voice/CallFlows.js";
|
|
49
|
+
import { PushCredentials } from "./voice/PushCredentials.js";
|
|
50
|
+
import { PushDevices } from "./voice/PushDevices.js";
|
|
@@ -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"|"sms"|"ivr"|"fwd_phone"|"voicemail"|"hangup"} type - The step kind. `catalog()` lists the kinds this service can run.
|
|
29
|
+
* @property {"inbound"|"answer"|"play"|"sms"|"ivr"|"ai_agent"|"ai_sms"|"webhook"|"fwd_phone"|"fwd_sip"|"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" | "sms" | "ivr" | "fwd_phone" | "voicemail" | "hangup";
|
|
274
|
+
type: "inbound" | "answer" | "play" | "sms" | "ivr" | "ai_agent" | "ai_sms" | "webhook" | "fwd_phone" | "fwd_sip" | "voicemail" | "hangup";
|
|
275
275
|
/**
|
|
276
276
|
* - Display name.
|
|
277
277
|
*/
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
|
|
2
|
+
/**
|
|
3
|
+
* @template T
|
|
4
|
+
* @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} ApnsCredentialData
|
|
8
|
+
* @property {"apns"} provider - Apple Push Notification service (iOS).
|
|
9
|
+
* @property {string} [name] - A label, up to 100 characters.
|
|
10
|
+
* @property {string} keyId - The 10-character key ID of the APNs auth key (.p8).
|
|
11
|
+
* @property {string} teamId - Your 10-character Apple developer team ID.
|
|
12
|
+
* @property {string} bundleId - Your app's bundle ID. VoIP pushes go to its `.voip` topic.
|
|
13
|
+
* @property {string} privateKey - The contents of the .p8 file.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {Object} FcmCredentialData
|
|
17
|
+
* @property {"fcm"} provider - Firebase Cloud Messaging (Android).
|
|
18
|
+
* @property {string} [name] - A label, up to 100 characters.
|
|
19
|
+
* @property {string|Object} serviceAccount - The Firebase service account key file, as its JSON text or the parsed object.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Mobile push credentials — the Apple APNs auth key and Firebase service account the Voice service
|
|
23
|
+
* uses to wake your mobile app for incoming calls. One credential per app; secrets are encrypted and
|
|
24
|
+
* never returned (responses show a `fingerprint`). Calls the Voice service mounted under /voice.
|
|
25
|
+
* Accessed via `sdk.voice.pushCredentials`.
|
|
26
|
+
*/
|
|
27
|
+
export class PushCredentials {
|
|
28
|
+
constructor(client: any, enableAdmin: any);
|
|
29
|
+
client: any;
|
|
30
|
+
enableAdmin: any;
|
|
31
|
+
/**
|
|
32
|
+
* List the account's push credentials (metadata only).
|
|
33
|
+
* @async
|
|
34
|
+
* @roles api, admin, developer, billing, user
|
|
35
|
+
* @param {Object} [params] - Request parameters.
|
|
36
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
37
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: [{ id, provider, name, appId, keyId, teamId, bundleId, projectId, clientEmail, fingerprint, createdAt, updatedAt }] }`.
|
|
38
|
+
*/
|
|
39
|
+
list({ options }?: {
|
|
40
|
+
options?: RequestOptions;
|
|
41
|
+
}): Promise<SdkResponse<any>>;
|
|
42
|
+
/**
|
|
43
|
+
* Get one push credential (metadata only).
|
|
44
|
+
* @async
|
|
45
|
+
* @roles api, admin, developer, billing, user
|
|
46
|
+
* @param {Object} params - Request parameters.
|
|
47
|
+
* @param {string} params.id - The credential ID.
|
|
48
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
49
|
+
* @throws {Error} If id is missing.
|
|
50
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: { ...credential } }`.
|
|
51
|
+
*/
|
|
52
|
+
get({ id, options }: {
|
|
53
|
+
id: string;
|
|
54
|
+
options?: RequestOptions;
|
|
55
|
+
}): Promise<SdkResponse<any>>;
|
|
56
|
+
/**
|
|
57
|
+
* Upload push credentials for one app: an Apple APNs auth key, or a Firebase service account. The
|
|
58
|
+
* key is checked on upload.
|
|
59
|
+
* @async
|
|
60
|
+
* @roles api, admin, developer
|
|
61
|
+
* @param {Object} params - Request parameters.
|
|
62
|
+
* @param {ApnsCredentialData|FcmCredentialData} params.credentialData - The credential.
|
|
63
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
64
|
+
* @throws {Error} If credentialData is missing.
|
|
65
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: { ...credential } }` (201).
|
|
66
|
+
*/
|
|
67
|
+
create({ credentialData, options }: {
|
|
68
|
+
credentialData: ApnsCredentialData | FcmCredentialData;
|
|
69
|
+
options?: RequestOptions;
|
|
70
|
+
}): Promise<SdkResponse<any>>;
|
|
71
|
+
/**
|
|
72
|
+
* Replace a credential's key or service account (and name). Same body as create; the provider
|
|
73
|
+
* cannot change. Registered devices keep working with the new key.
|
|
74
|
+
* @async
|
|
75
|
+
* @roles api, admin, developer
|
|
76
|
+
* @param {Object} params - Request parameters.
|
|
77
|
+
* @param {string} params.id - The credential ID.
|
|
78
|
+
* @param {ApnsCredentialData|FcmCredentialData} params.credentialData - The replacement.
|
|
79
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
80
|
+
* @throws {Error} If id or credentialData is missing.
|
|
81
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: { ...credential } }`.
|
|
82
|
+
*/
|
|
83
|
+
update({ id, credentialData, options }: {
|
|
84
|
+
id: string;
|
|
85
|
+
credentialData: ApnsCredentialData | FcmCredentialData;
|
|
86
|
+
options?: RequestOptions;
|
|
87
|
+
}): Promise<SdkResponse<any>>;
|
|
88
|
+
/**
|
|
89
|
+
* Delete a credential and every device registered for that app.
|
|
90
|
+
* @async
|
|
91
|
+
* @roles api, admin, developer
|
|
92
|
+
* @param {Object} params - Request parameters.
|
|
93
|
+
* @param {string} params.id - The credential ID.
|
|
94
|
+
* @param {RequestOptions} [params.options] - Additional options for the request.
|
|
95
|
+
* @throws {Error} If id is missing.
|
|
96
|
+
* @returns {Promise<SdkResponse<any>>} `{ success }`.
|
|
97
|
+
*/
|
|
98
|
+
delete({ id, options }: {
|
|
99
|
+
id: string;
|
|
100
|
+
options?: RequestOptions;
|
|
101
|
+
}): Promise<SdkResponse<any>>;
|
|
102
|
+
}
|
|
103
|
+
export type RequestOptions = import("../../SignalHouseSDK.js").RequestOptions;
|
|
104
|
+
export type SdkResponse<T> = import("../../SignalHouseSDK.js").SdkResponse<T>;
|
|
105
|
+
export type ApnsCredentialData = {
|
|
106
|
+
/**
|
|
107
|
+
* - Apple Push Notification service (iOS).
|
|
108
|
+
*/
|
|
109
|
+
provider: "apns";
|
|
110
|
+
/**
|
|
111
|
+
* - A label, up to 100 characters.
|
|
112
|
+
*/
|
|
113
|
+
name?: string;
|
|
114
|
+
/**
|
|
115
|
+
* - The 10-character key ID of the APNs auth key (.p8).
|
|
116
|
+
*/
|
|
117
|
+
keyId: string;
|
|
118
|
+
/**
|
|
119
|
+
* - Your 10-character Apple developer team ID.
|
|
120
|
+
*/
|
|
121
|
+
teamId: string;
|
|
122
|
+
/**
|
|
123
|
+
* - Your app's bundle ID. VoIP pushes go to its `.voip` topic.
|
|
124
|
+
*/
|
|
125
|
+
bundleId: string;
|
|
126
|
+
/**
|
|
127
|
+
* - The contents of the .p8 file.
|
|
128
|
+
*/
|
|
129
|
+
privateKey: string;
|
|
130
|
+
};
|
|
131
|
+
export type FcmCredentialData = {
|
|
132
|
+
/**
|
|
133
|
+
* - Firebase Cloud Messaging (Android).
|
|
134
|
+
*/
|
|
135
|
+
provider: "fcm";
|
|
136
|
+
/**
|
|
137
|
+
* - A label, up to 100 characters.
|
|
138
|
+
*/
|
|
139
|
+
name?: string;
|
|
140
|
+
/**
|
|
141
|
+
* - The Firebase service account key file, as its JSON text or the parsed object.
|
|
142
|
+
*/
|
|
143
|
+
serviceAccount: string | any;
|
|
144
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** @typedef {import('../../SignalHouseSDK.js').RequestOptions} RequestOptions */
|
|
2
|
+
/**
|
|
3
|
+
* @template T
|
|
4
|
+
* @typedef {import('../../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} RegisterPushDeviceData
|
|
8
|
+
* @property {"apns"|"fcm"} provider - "apns" for iOS (PushKit VoIP token), "fcm" for Android (Firebase registration token).
|
|
9
|
+
* @property {string} deviceToken - The device's push token.
|
|
10
|
+
* @property {"production"|"sandbox"} [environment] - apns only: "sandbox" for development builds. Default "production".
|
|
11
|
+
* @property {string} [appId] - The bundle ID or Firebase project ID; only needed when the account has several apps for the provider.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Mobile push devices — your app registers each device so incoming calls wake it. These methods are
|
|
15
|
+
* called by the app with the user's **voice token** (from `sdk.voice.tokens.create`, minted with a
|
|
16
|
+
* `subgroupId`) as `options.token`, not a dashboard or API key token. The device is tied to that
|
|
17
|
+
* token's identity. Calls the Voice service mounted under /voice. Accessed via `sdk.voice.pushDevices`.
|
|
18
|
+
*/
|
|
19
|
+
export class PushDevices {
|
|
20
|
+
constructor(client: any, enableAdmin: any);
|
|
21
|
+
client: any;
|
|
22
|
+
enableAdmin: any;
|
|
23
|
+
/**
|
|
24
|
+
* Register this device for push. Call it after each token mint and whenever the OS gives the app a
|
|
25
|
+
* new push token. A push token already registered to another user moves to this one.
|
|
26
|
+
* @async
|
|
27
|
+
* @roles voice token
|
|
28
|
+
* @param {Object} params - Request parameters.
|
|
29
|
+
* @param {RegisterPushDeviceData} params.deviceData - The device.
|
|
30
|
+
* @param {RequestOptions} params.options - Must carry the voice token as `token`.
|
|
31
|
+
* @throws {Error} If deviceData is missing.
|
|
32
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: { id, identity, provider, environment, appId, registeredAt } }` (201).
|
|
33
|
+
*/
|
|
34
|
+
register({ deviceData, options }: {
|
|
35
|
+
deviceData: RegisterPushDeviceData;
|
|
36
|
+
options: RequestOptions;
|
|
37
|
+
}): Promise<SdkResponse<any>>;
|
|
38
|
+
/**
|
|
39
|
+
* Unregister this device, e.g. when the user signs out.
|
|
40
|
+
* @async
|
|
41
|
+
* @roles voice token
|
|
42
|
+
* @param {Object} params - Request parameters.
|
|
43
|
+
* @param {string} params.deviceToken - The device's push token.
|
|
44
|
+
* @param {RequestOptions} params.options - Must carry the voice token as `token`.
|
|
45
|
+
* @throws {Error} If deviceToken is missing.
|
|
46
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: { removed } }`.
|
|
47
|
+
*/
|
|
48
|
+
unregister({ deviceToken, options }: {
|
|
49
|
+
deviceToken: string;
|
|
50
|
+
options: RequestOptions;
|
|
51
|
+
}): Promise<SdkResponse<any>>;
|
|
52
|
+
/**
|
|
53
|
+
* The pushes recently sent to the voice token's user, newest first (kept 7 days), for debugging.
|
|
54
|
+
* @async
|
|
55
|
+
* @roles voice token
|
|
56
|
+
* @param {Object} [params] - Request parameters.
|
|
57
|
+
* @param {number} [params.limit] - How many, 1 to 100 (default 20).
|
|
58
|
+
* @param {RequestOptions} [params.options] - Must carry the voice token as `token`.
|
|
59
|
+
* @returns {Promise<SdkResponse<any>>} `{ success, data: [{ id, callUuid, provider, kind, status, error, createdAt }] }`.
|
|
60
|
+
*/
|
|
61
|
+
listDeliveries({ limit, options }?: {
|
|
62
|
+
limit?: number;
|
|
63
|
+
options?: RequestOptions;
|
|
64
|
+
}): Promise<SdkResponse<any>>;
|
|
65
|
+
}
|
|
66
|
+
export type RequestOptions = import("../../SignalHouseSDK.js").RequestOptions;
|
|
67
|
+
export type SdkResponse<T> = import("../../SignalHouseSDK.js").SdkResponse<T>;
|
|
68
|
+
export type RegisterPushDeviceData = {
|
|
69
|
+
/**
|
|
70
|
+
* - "apns" for iOS (PushKit VoIP token), "fcm" for Android (Firebase registration token).
|
|
71
|
+
*/
|
|
72
|
+
provider: "apns" | "fcm";
|
|
73
|
+
/**
|
|
74
|
+
* - The device's push token.
|
|
75
|
+
*/
|
|
76
|
+
deviceToken: string;
|
|
77
|
+
/**
|
|
78
|
+
* - apns only: "sandbox" for development builds. Default "production".
|
|
79
|
+
*/
|
|
80
|
+
environment?: "production" | "sandbox";
|
|
81
|
+
/**
|
|
82
|
+
* - The bundle ID or Firebase project ID; only needed when the account has several apps for the provider.
|
|
83
|
+
*/
|
|
84
|
+
appId?: string;
|
|
85
|
+
};
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* @typedef {Object} CreateTokenData
|
|
16
16
|
* @property {string} [identity] - Customer-facing logical identity name (e.g. "alice"). Persisted as `requested_identity` so server-initiated `calls.create({to_identity: "alice"})` can resolve it later. Defaults to "anonymous".
|
|
17
17
|
* @property {number} [ttl] - Token TTL in seconds. Clamped to the server's max. Defaults to VOICE_TOKEN_DEFAULT_TTL_SEC.
|
|
18
|
+
* @property {string} [subgroupId] - The subgroup whose inbound calls should ring this identity. Required to receive calls (and to register the device for mobile push).
|
|
18
19
|
* @property {VoiceGrants} [grants] - Capability grants attached to the token.
|
|
19
20
|
*/
|
|
20
21
|
/**
|
|
@@ -110,6 +111,10 @@ export type CreateTokenData = {
|
|
|
110
111
|
* - Token TTL in seconds. Clamped to the server's max. Defaults to VOICE_TOKEN_DEFAULT_TTL_SEC.
|
|
111
112
|
*/
|
|
112
113
|
ttl?: number;
|
|
114
|
+
/**
|
|
115
|
+
* - The subgroup whose inbound calls should ring this identity. Required to receive calls (and to register the device for mobile push).
|
|
116
|
+
*/
|
|
117
|
+
subgroupId?: string;
|
|
113
118
|
/**
|
|
114
119
|
* - Capability grants attached to the token.
|
|
115
120
|
*/
|