@signalhouse-sms/sdk 1.13.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,325 @@
1
+ /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+ /**
7
+ * Compliance cases under /compliance. Signal House opens a case when a carrier suspends one of your objects, a carrier
8
+ * escalates a message, or Signal House needs something from you. You read your cases, answer their requirements and
9
+ * upload files; only Signal House opens, works and closes them. Staff methods are under `admin` (enableAdmin).
10
+ */
11
+ export class Compliance {
12
+ /**
13
+ * Keep the JSON and multipart clients every compliance request goes through.
14
+ * @param {any} client - The JSON request client
15
+ * @param {any} multipartClient - The multipart request client, for file uploads
16
+ * @param {boolean} [enableAdmin] - Whether the staff methods under `admin` are available
17
+ */
18
+ constructor(client: any, multipartClient: any, enableAdmin?: boolean);
19
+ client: any;
20
+ multipartClient: any;
21
+ enableAdmin: boolean;
22
+ admin: {
23
+ /**
24
+ * Log an alert by hand: a reading, a notice or a block. Blocks (and a Sev-0 carrier ticket) need signalhouse_admin.
25
+ * @async
26
+ * @roles signalhouse_admin, signalhouse_user
27
+ * @param {Object} params - The alert
28
+ * @param {Object} params.data - `{ form, type, subject: { kind, id }, ... }`: the intake input without a raw payload
29
+ * @param {RequestOptions} [params.options] - Additional options for the request
30
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ logged, recovered, updated, unmatched, duplicate }`
31
+ */
32
+ logAlert: ({ data, options }: {
33
+ data: any;
34
+ options?: RequestOptions;
35
+ }) => Promise<SdkResponse<any>>;
36
+ /**
37
+ * Lift a block by hand. signalhouse_admin only.
38
+ * @async
39
+ * @roles signalhouse_admin
40
+ * @param {Object} params - The lift
41
+ * @param {string} params.alertId - The block alert (ALR-…)
42
+ * @param {string} [params.note] - Why it lifted
43
+ * @param {string} [params.occurredAt] - When the source says it lifted (ISO 8601)
44
+ * @param {RequestOptions} [params.options] - Additional options for the request
45
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ alertId, recoveredAt, caseId, caseClosed, closeReason }`
46
+ */
47
+ liftBlock: ({ alertId, note, occurredAt, options }: {
48
+ alertId: string;
49
+ note?: string;
50
+ occurredAt?: string;
51
+ options?: RequestOptions;
52
+ }) => Promise<SdkResponse<any>>;
53
+ /**
54
+ * List alerts, with the inbox counts.
55
+ * @async
56
+ * @roles signalhouse_admin, signalhouse_user
57
+ * @param {Object} [params] - Filters: type, form, severity, channel, source, subjectKind, subjectId, number, groupId, subgroupId, campaignId, caseId, inbox, open, blocks, slackPending, from, to, page, limit
58
+ * @param {RequestOptions} [params.options] - Additional options for the request
59
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, counts: { inCase, inbox, noted } }`
60
+ */
61
+ getAlerts: ({ options, ...filters }?: {
62
+ options?: RequestOptions;
63
+ }) => Promise<SdkResponse<any>>;
64
+ /**
65
+ * Get one alert with its raw payload, escalation chain, case summary and timeline.
66
+ * @async
67
+ * @roles signalhouse_admin, signalhouse_user
68
+ * @param {Object} params - The lookup
69
+ * @param {string} params.alertId - The alert (ALR-…)
70
+ * @param {RequestOptions} [params.options] - Additional options for the request
71
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the alert with `chain`, `case` and `timeline`
72
+ */
73
+ getAlert: ({ alertId, options }: {
74
+ alertId: string;
75
+ options?: RequestOptions;
76
+ }) => Promise<SdkResponse<any>>;
77
+ /**
78
+ * Work an inbox alert: `{ action: "assign", caseId }`, `{ action: "assign", object: { objectType, objectId } }` or `{ action: "note", note }`.
79
+ * @async
80
+ * @roles signalhouse_admin, signalhouse_user
81
+ * @param {Object} params - The action
82
+ * @param {string} params.alertId - The inbox alert (ALR-…)
83
+ * @param {Object} params.data - The action body
84
+ * @param {RequestOptions} [params.options] - Additional options for the request
85
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the alert after the action
86
+ */
87
+ triageAlert: ({ alertId, data, options }: {
88
+ alertId: string;
89
+ data: any;
90
+ options?: RequestOptions;
91
+ }) => Promise<SdkResponse<any>>;
92
+ /**
93
+ * Open a case by hand to send the customer a notice; its requirements go out at once. 409 when the object already has an open case.
94
+ * @async
95
+ * @roles signalhouse_admin, signalhouse_user
96
+ * @param {Object} params - The case
97
+ * @param {Object} params.data - `{ objectType, objectId, reasonTemplate, reason?, customerNote?, requirements: [{ kind, text }], fixByDays? }`
98
+ * @param {RequestOptions} [params.options] - Additional options for the request
99
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
100
+ */
101
+ openCase: ({ data, options }: {
102
+ data: any;
103
+ options?: RequestOptions;
104
+ }) => Promise<SdkResponse<any>>;
105
+ /**
106
+ * Take, give or release ownership (assigneeUserId, null to release), and edit reasonTemplate, reason and customerNote.
107
+ * @async
108
+ * @roles signalhouse_admin, signalhouse_user
109
+ * @param {Object} params - The change
110
+ * @param {string} params.caseId - The case (CASE-…)
111
+ * @param {Object} params.data - `{ assigneeUserId?, reasonTemplate?, reason?, customerNote? }`
112
+ * @param {RequestOptions} [params.options] - Additional options for the request
113
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
114
+ */
115
+ updateCase: ({ caseId, data, options }: {
116
+ caseId: string;
117
+ data: any;
118
+ options?: RequestOptions;
119
+ }) => Promise<SdkResponse<any>>;
120
+ /**
121
+ * Send requirements the first time, or add more; either hands the case to the customer.
122
+ * @async
123
+ * @roles signalhouse_admin, signalhouse_user
124
+ * @param {Object} params - The requirements
125
+ * @param {string} params.caseId - The case (CASE-…)
126
+ * @param {Array<{kind: string, text: string}>} params.requirements - RECORDS, CAMPAIGN_EDIT, NUMBER_ACTION or CONFIRM, with the text
127
+ * @param {number} [params.fixByDays] - Days until they are due, 1-14 (default 5)
128
+ * @param {RequestOptions} [params.options] - Additional options for the request
129
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
130
+ */
131
+ sendRequirements: ({ caseId, requirements, fixByDays, options }: {
132
+ caseId: string;
133
+ requirements: Array<{
134
+ kind: string;
135
+ text: string;
136
+ }>;
137
+ fixByDays?: number;
138
+ options?: RequestOptions;
139
+ }) => Promise<SdkResponse<any>>;
140
+ /**
141
+ * Record that the lift request went upstream. The case must hold an open carrier suspension or provider pause.
142
+ * @async
143
+ * @roles signalhouse_admin, signalhouse_user
144
+ * @param {Object} params - The request
145
+ * @param {string} params.caseId - The case (CASE-…)
146
+ * @param {string} [params.note] - What was sent
147
+ * @param {RequestOptions} [params.options] - Additional options for the request
148
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
149
+ */
150
+ requestLift: ({ caseId, note, options }: {
151
+ caseId: string;
152
+ note?: string;
153
+ options?: RequestOptions;
154
+ }) => Promise<SdkResponse<any>>;
155
+ /**
156
+ * Close a case. Lift its open blocks first.
157
+ * @async
158
+ * @roles signalhouse_admin, signalhouse_user
159
+ * @param {Object} params - The close
160
+ * @param {string} params.caseId - The case (CASE-…)
161
+ * @param {string} params.closeReason - CUSTOMER_REMEDIATED, SUSPENDED_BY_CARRIER, LIFTED, LABEL_REMOVED, TRACEBACK_ANSWERED, FALSE_POSITIVE or CLEARED
162
+ * @param {string} [params.closeNote] - Why
163
+ * @param {RequestOptions} [params.options] - Additional options for the request
164
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the closed case
165
+ */
166
+ closeCase: ({ caseId, closeReason, closeNote, options }: {
167
+ caseId: string;
168
+ closeReason: string;
169
+ closeNote?: string;
170
+ options?: RequestOptions;
171
+ }) => Promise<SdkResponse<any>>;
172
+ /**
173
+ * Email the customer a reminder of the requirements still open.
174
+ * @async
175
+ * @roles signalhouse_admin, signalhouse_user
176
+ * @param {Object} params - The reminder
177
+ * @param {string} params.caseId - The case (CASE-…)
178
+ * @param {RequestOptions} [params.options] - Additional options for the request
179
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
180
+ */
181
+ remindCase: ({ caseId, options }: {
182
+ caseId: string;
183
+ options?: RequestOptions;
184
+ }) => Promise<SdkResponse<any>>;
185
+ /**
186
+ * Add a staff note, or an email to or from the upstream, to a case's history.
187
+ * @async
188
+ * @roles signalhouse_admin, signalhouse_user
189
+ * @param {Object} params - The note
190
+ * @param {string} params.caseId - The case (CASE-…)
191
+ * @param {string} params.kind - STAFF, EMAIL_IN or EMAIL_OUT
192
+ * @param {string} params.text - The note
193
+ * @param {{from?: string, to?: string, subject?: string, body?: string}} [params.email] - The email, on EMAIL_IN and EMAIL_OUT
194
+ * @param {RequestOptions} [params.options] - Additional options for the request
195
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the staff view of the case
196
+ */
197
+ addCaseNote: ({ caseId, kind, text, email, options }: {
198
+ caseId: string;
199
+ kind: string;
200
+ text: string;
201
+ email?: {
202
+ from?: string;
203
+ to?: string;
204
+ subject?: string;
205
+ body?: string;
206
+ };
207
+ options?: RequestOptions;
208
+ }) => Promise<SdkResponse<any>>;
209
+ /**
210
+ * Get a group's strikes in the last 90 days, the block periods behind them, and whether an open case carries the review flag.
211
+ * @async
212
+ * @roles signalhouse_admin, signalhouse_user
213
+ * @param {Object} params - The lookup
214
+ * @param {string} params.groupId - The group
215
+ * @param {RequestOptions} [params.options] - Additional options for the request
216
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ groupId, windowDays, strikes, reviewDue, periods }`
217
+ */
218
+ getStrikes: ({ groupId, options }: {
219
+ groupId: string;
220
+ options?: RequestOptions;
221
+ }) => Promise<SdkResponse<any>>;
222
+ };
223
+ /**
224
+ * List the compliance cases you can see, newest first. `counts.waitingOnYou` is the open cases with requirements still to answer
225
+ * @async
226
+ * @roles api, admin, developer, billing, user
227
+ * @param {Object} [params] - Filters
228
+ * @param {string} [params.groupId] - A group you can view; defaults to your active group
229
+ * @param {string} [params.status] - OPEN, LIFT_REQUESTED or CLOSED
230
+ * @param {string} [params.stage] - new, customer, ready, lift_requested or closed
231
+ * @param {string} [params.objectType] - CAMPAIGN, BRAND, NUMBER, RCS_AGENT or SUBGROUP
232
+ * @param {string} [params.objectId] - The object's id
233
+ * @param {string} [params.subgroupId] - Only cases in this subgroup
234
+ * @param {boolean} [params.suspended] - true for cases with an open suspension or hold, false for the rest
235
+ * @param {string} [params.from] - Opened on or after this ISO 8601 time
236
+ * @param {string} [params.to] - Opened on or before this ISO 8601 time
237
+ * @param {string} [params.sort] - createdAt (default), fixBy or severity
238
+ * @param {number} [params.page] - Page number, from 1
239
+ * @param {number} [params.limit] - Cases per page, 1-200
240
+ * @param {RequestOptions} [params.options] - Additional options for the request
241
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ data, total, page, limit, totalPages, counts: { open, waitingOnYou } }`
242
+ */
243
+ getCases({ groupId, status, stage, objectType, objectId, subgroupId, suspended, from, to, sort, page, limit, options }?: {
244
+ groupId?: string;
245
+ status?: string;
246
+ stage?: string;
247
+ objectType?: string;
248
+ objectId?: string;
249
+ subgroupId?: string;
250
+ suspended?: boolean;
251
+ from?: string;
252
+ to?: string;
253
+ sort?: string;
254
+ page?: number;
255
+ limit?: number;
256
+ options?: RequestOptions;
257
+ }): Promise<SdkResponse<any>>;
258
+ /**
259
+ * Get one compliance case: its stage, suspensions, tickets and requirements
260
+ * @async
261
+ * @roles api, admin, developer, billing, user
262
+ * @param {Object} params - The lookup
263
+ * @param {string} params.caseId - The case (CASE-…)
264
+ * @param {RequestOptions} [params.options] - Additional options for the request
265
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the case
266
+ */
267
+ getCase({ caseId, options }: {
268
+ caseId: string;
269
+ options?: RequestOptions;
270
+ }): Promise<SdkResponse<any>>;
271
+ /**
272
+ * Answer one requirement with a note, files, or both. A RECORDS requirement needs a file or a note
273
+ * @async
274
+ * @roles api, admin, developer, user
275
+ * @param {Object} params - The answer
276
+ * @param {string} params.caseId - The case (CASE-…)
277
+ * @param {string} params.requirementId - The requirement (CASE-…-n)
278
+ * @param {string} [params.answer] - What you did, up to 2,000 characters
279
+ * @param {string[]} [params.fileIds] - Up to 10 fileIds from uploadFile, on this case
280
+ * @param {RequestOptions} [params.options] - Additional options for the request
281
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the case
282
+ */
283
+ answerRequirement({ caseId, requirementId, answer, fileIds, options }: {
284
+ caseId: string;
285
+ requirementId: string;
286
+ answer?: string;
287
+ fileIds?: string[];
288
+ options?: RequestOptions;
289
+ }): Promise<SdkResponse<any>>;
290
+ /**
291
+ * Upload a file to a compliance case (CSV, XLSX, PDF, PNG, JPG or TXT, up to 10 MB). Pass the returned fileId in
292
+ * fileIds when you answer the requirement
293
+ * @async
294
+ * @roles api, admin, developer, user
295
+ * @param {Object} params - The upload
296
+ * @param {string} params.caseId - The case the file answers
297
+ * @param {string} [params.requirementId] - The requirement the file answers
298
+ * @param {Blob|File} params.file - The file, as a Blob/File
299
+ * @param {string} [params.fileName] - Multipart filename; required for a CSV/TXT Blob without a name
300
+ * @param {RequestOptions} [params.options] - Additional options for the request
301
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ fileId, fileName, mimeType, size }`
302
+ */
303
+ uploadFile({ caseId, requirementId, file, fileName, options }: {
304
+ caseId: string;
305
+ requirementId?: string;
306
+ file: Blob | File;
307
+ fileName?: string;
308
+ options?: RequestOptions;
309
+ }): Promise<SdkResponse<any>>;
310
+ /**
311
+ * Download a compliance file
312
+ * @async
313
+ * @roles api, admin, developer, billing, user
314
+ * @param {Object} params - The lookup
315
+ * @param {string} params.fileId - The fileId uploadFile returned
316
+ * @param {RequestOptions} [params.options] - Additional options for the request
317
+ * @returns {Promise<SdkResponse<ArrayBuffer>>} A promise that resolves to the file bytes as an ArrayBuffer
318
+ */
319
+ getFile({ fileId, options }: {
320
+ fileId: string;
321
+ options?: RequestOptions;
322
+ }): Promise<SdkResponse<ArrayBuffer>>;
323
+ }
324
+ export type RequestOptions = import("../SignalHouseSDK.js").RequestOptions;
325
+ export type SdkResponse<T> = import("../SignalHouseSDK.js").SdkResponse<T>;
@@ -0,0 +1,116 @@
1
+ /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+ /**
7
+ * Contracts domain: the staff queue for pricing read from signed PandaDoc contracts. Every method lives under
8
+ * the admin namespace, present only when the SDK is created with `enableAdmin: true`. JS SDK only by design.
9
+ */
10
+ export class Contracts {
11
+ constructor(client: any, enableAdmin: any);
12
+ client: any;
13
+ enableAdmin: any;
14
+ admin: {
15
+ /**
16
+ * List contracts for the staff queue, newest first. Staff-only.
17
+ * @async
18
+ * @roles signalhouse
19
+ * @param {Object} [params]
20
+ * @param {string|string[]} [params.status] - One status, or several (an array or a comma-separated string)
21
+ * @param {string} [params.groupId] - Only this group's contracts, newest signed first
22
+ * @param {number} [params.page] - Page number (default 1)
23
+ * @param {number} [params.limit] - Contracts per page (default 25, max 100)
24
+ * @param {RequestOptions} [params.options] - Additional options for the request
25
+ * @returns {Promise<SdkResponse<any>>} - `{ data, total, page, limit }`; each contract carries `pandadocUrl`
26
+ */
27
+ getContracts: ({ status, groupId, page, limit, options }?: {
28
+ status?: string | string[];
29
+ groupId?: string;
30
+ page?: number;
31
+ limit?: number;
32
+ options?: RequestOptions;
33
+ }) => Promise<SdkResponse<any>>;
34
+ /**
35
+ * Get one contract: issues, diff, signers, a PandaDoc link and, when it has no group, a suggested one. Staff-only.
36
+ * @async
37
+ * @roles signalhouse
38
+ * @param {Object} params
39
+ * @param {string} params.contractId - The contract's ID
40
+ * @param {RequestOptions} [params.options] - Additional options for the request
41
+ * @returns {Promise<SdkResponse<any>>} - The contract with `pandadocUrl` and `suggestedGroup`
42
+ */
43
+ getContract: ({ contractId, options }: {
44
+ contractId: string;
45
+ options?: RequestOptions;
46
+ }) => Promise<SdkResponse<any>>;
47
+ /**
48
+ * Link a contract to a group by hand; the document is then read again against that group. The link resets the contract's
49
+ * status, so a scheduled contract loses its schedule. Staff-only.
50
+ * @async
51
+ * @roles signalhouse
52
+ * @param {Object} params
53
+ * @param {string} params.contractId - The contract's ID
54
+ * @param {string} params.groupId - The group the contract is for
55
+ * @param {RequestOptions} [params.options] - Additional options for the request
56
+ * @returns {Promise<SdkResponse<any>>} - The contract after the re-read
57
+ */
58
+ linkContractGroup: ({ contractId, groupId, options }: {
59
+ contractId: string;
60
+ groupId: string;
61
+ options?: RequestOptions;
62
+ }) => Promise<SdkResponse<any>>;
63
+ /**
64
+ * Apply a contract's pricing to its group now (staff approval). A contract dated in the future is scheduled instead.
65
+ * Staff-only.
66
+ * @async
67
+ * @roles signalhouse
68
+ * @param {Object} params
69
+ * @param {string} params.contractId - The contract's ID
70
+ * @param {string} params.expectedUpdatedAt - The `updatedAt` of the contract as reviewed; a changed contract gets a 409
71
+ * @param {string} params.expectedGroupId - The group the contract was reviewed for
72
+ * @param {?number} [params.expectedPlanCharge] - The immediate charge shown from `applyPreview`, in microdollars; a plan
73
+ * create that would charge anything else is refused before charging
74
+ * @param {RequestOptions} [params.options] - Additional options for the request
75
+ * @returns {Promise<SdkResponse<any>>} - The contract after the apply
76
+ */
77
+ applyContract: ({ contractId, expectedUpdatedAt, expectedGroupId, expectedPlanCharge, options }: {
78
+ contractId: string;
79
+ expectedUpdatedAt: string;
80
+ expectedGroupId: string;
81
+ expectedPlanCharge?: number | null;
82
+ options?: RequestOptions;
83
+ }) => Promise<SdkResponse<any>>;
84
+ /**
85
+ * Reject a contract so it is never applied. Staff-only.
86
+ * @async
87
+ * @roles signalhouse
88
+ * @param {Object} params
89
+ * @param {string} params.contractId - The contract's ID
90
+ * @param {string} params.reason - Why it is rejected
91
+ * @param {RequestOptions} [params.options] - Additional options for the request
92
+ * @returns {Promise<SdkResponse<any>>} - The rejected contract
93
+ */
94
+ rejectContract: ({ contractId, reason, options }: {
95
+ contractId: string;
96
+ reason: string;
97
+ options?: RequestOptions;
98
+ }) => Promise<SdkResponse<any>>;
99
+ /**
100
+ * Read a contract from PandaDoc again and re-parse it. Not allowed while scheduled, or once pricing is being written or has been applied.
101
+ * Staff-only.
102
+ * @async
103
+ * @roles signalhouse
104
+ * @param {Object} params
105
+ * @param {string} params.contractId - The contract's ID
106
+ * @param {RequestOptions} [params.options] - Additional options for the request
107
+ * @returns {Promise<SdkResponse<any>>} - The contract after the re-read
108
+ */
109
+ reparseContract: ({ contractId, options }: {
110
+ contractId: string;
111
+ options?: RequestOptions;
112
+ }) => Promise<SdkResponse<any>>;
113
+ };
114
+ }
115
+ export type RequestOptions = import("../SignalHouseSDK.js").RequestOptions;
116
+ export type SdkResponse<T> = import("../SignalHouseSDK.js").SdkResponse<T>;
@@ -524,7 +524,7 @@ export class RcsMessages {
524
524
  * @param {string} [params.expireTime] - ISO-8601 time the RCS message expires
525
525
  * @param {RcsMessageFallback} [params.fallback] - The fallback to price; its from is optional here, and with none the leg is priced on the channel of the agent's linked campaign
526
526
  * @param {RequestOptions} [params.options] - Additional options for the request
527
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to { billingClass, segments, recipientCount, rcsLeg, fallbackLeg, totals, balance, issues, warnings }; rcsLeg.mediaSurcharge is the carrier's surcharge on media over 5 MB for one recipient, and rcsLeg.cost already holds it for every recipient; rcsLeg.cost is null with the fallback mode sms_only; a message over 100 MB adds a MEDIA_TOO_LARGE issue.
527
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { billingClass, segments, recipientCount, rcsLeg, fallbackLeg, totals, balance, issues, warnings }; rcsLeg.mediaSurcharge is the carrier's surcharge on media over 5 MB for one recipient, and rcsLeg.cost already holds it for every recipient; rcsLeg.cost is null with the fallback mode sms_only; a message over 100 MB adds a MEDIA_TOO_LARGE issue, and an external media URL that redirects adds a MEDIA_REDIRECT issue.
528
528
  */
529
529
  estimate({ agentId, recipients, recipientCount, templateId, templateVersion, content, contentFormat, trafficType, ttlSeconds, expireTime, fallback, options }: {
530
530
  agentId: string;
@@ -45,6 +45,36 @@ export class Subgroups {
45
45
  constructor(client: any, enableAdmin: any);
46
46
  client: any;
47
47
  enableAdmin: any;
48
+ admin: {
49
+ /**
50
+ * Link (or, with ghlLocationId: null, unlink) a GoHighLevel location to a subgroup. At most
51
+ * one subgroup may hold a given ghlLocationId; linking it here steals it from any other
52
+ * subgroup that currently holds it. Intended for ghl-app/backend's write-through right after
53
+ * it locally claims a location -> subgroup link.
54
+ * @async
55
+ * @roles signalhouse_api, signalhouse_admin
56
+ * @param {Object} params - The parameters for linking a GHL location
57
+ * @param {string} params.subgroupId - The subgroup to link
58
+ * @param {string|null} params.ghlLocationId - The GHL location ID to link, or null to unlink
59
+ * @param {string|null} [params.ghlLocationName] - Display name of the GHL location. Omit to leave the
60
+ * subgroup's currently stored name untouched (only when ghlLocationId is unchanged - otherwise
61
+ * cleared to null); always cleared to null when unlinking
62
+ * @param {Date|string} [params.claimedAt] - When this link was locally claimed by the caller.
63
+ * Required when linking (ghlLocationId is non-null) - used to detect and reject a delayed/
64
+ * out-of-order push whose claim has since been superseded by a newer one recorded elsewhere.
65
+ * Ignored when unlinking.
66
+ * @param {RequestOptions} [params.options] - Additional options for the request
67
+ * @throws {Error} Throws an error if the subgroupId parameter is missing
68
+ * @returns {Promise<SdkResponse<any>>} - The updated subgroup object returned from the server
69
+ */
70
+ linkGhlLocation: ({ subgroupId, ghlLocationId, ghlLocationName, claimedAt, options }: {
71
+ subgroupId: string;
72
+ ghlLocationId: string | null;
73
+ ghlLocationName?: string | null;
74
+ claimedAt?: Date | string;
75
+ options?: RequestOptions;
76
+ }) => Promise<SdkResponse<any>>;
77
+ };
48
78
  /**
49
79
  * Get a list of subgroups with optional filters
50
80
  * @async
@@ -114,6 +144,27 @@ export class Subgroups {
114
144
  updateData: UpdateSubgroupData;
115
145
  options?: RequestOptions;
116
146
  }): Promise<SdkResponse<any>>;
147
+ /**
148
+ * Resolve the mapping between a GoHighLevel location and a Signal House subgroup, in either
149
+ * direction. Provide exactly one of ghlLocationId or subgroupId. groupId is optional - customer
150
+ * roles default to their own accessible group(s) and are rejected if they name a group they don't
151
+ * belong to; a subgroupId/ghlLocationId that belongs to a different group than the caller's returns
152
+ * a 404, identical to a nonexistent one.
153
+ * @async
154
+ * @roles api, admin, developer, billing, user
155
+ * @param {Object} params - The parameters for the lookup
156
+ * @param {string} [params.groupId] - Restrict the lookup to an accessible group ID
157
+ * @param {string} [params.ghlLocationId] - GHL location ID to resolve to its subgroup (mutually exclusive with subgroupId)
158
+ * @param {string} [params.subgroupId] - Subgroup ID to resolve to its GHL location (mutually exclusive with ghlLocationId)
159
+ * @param {RequestOptions} [params.options] - Additional options for the request
160
+ * @returns {Promise<SdkResponse<any>>} - `{ groupId, subgroupId, subgroupName, ghlLocationId, ghlLocationName }`
161
+ */
162
+ lookupGhlLocation({ groupId, ghlLocationId, subgroupId, options }?: {
163
+ groupId?: string;
164
+ ghlLocationId?: string;
165
+ subgroupId?: string;
166
+ options?: RequestOptions;
167
+ }): Promise<SdkResponse<any>>;
117
168
  /**
118
169
  * Delete a subgroup by its ID (mark as inactive)
119
170
  * @async
@@ -138,7 +138,7 @@ export class Templates {
138
138
  }): Promise<SdkResponse<SavedTemplate>>;
139
139
  /**
140
140
  * Publish a template's current draft; no draft returns 409 NO_DRAFT, a draft changed mid-publish returns 409 DRAFT_CHANGED (publish again) and an incomplete draft returns 400 TEMPLATE_INVALID
141
- * A block whose text or image the Moderation API flags is an error with code CONTENT_POLICY_FLAGGED, whose message names the category ("Content moderation flagged this text: spam"). The check passes when the Moderation API fails.
141
+ * A block whose text or image the Moderation API flags is an error with code CONTENT_POLICY_FLAGGED, whose message names the category ("Content moderation flagged this text: spam"). The check passes when the Moderation API fails. An image URL with a variable is moderated at send instead, with its value filled in, and a refused image blocks the recipient with MODERATION.
142
142
  * @async
143
143
  * @roles api, admin, developer
144
144
  * @param {Object} params - The parameters for publishing a template
@@ -190,7 +190,7 @@ export class Templates {
190
190
  }): Promise<SdkResponse<Page<VersionSummary>>>;
191
191
  /**
192
192
  * Validate an unsaved body or a stored version without writing anything
193
- * Validate runs the publish checks, the content policy check included: a block whose text or image the Moderation API flags is an error with code CONTENT_POLICY_FLAGGED. Saving a draft does not run that check.
193
+ * Validate runs the publish checks, the content policy check included: a block whose text or image the Moderation API flags is an error with code CONTENT_POLICY_FLAGGED. An image URL with a variable is moderated at send instead, with its value filled in, and a refused image blocks the recipient with MODERATION. Saving a draft does not run that check.
194
194
  * @async
195
195
  * @roles api, admin, developer, billing, user
196
196
  * @param {Object} params - The parameters for validation; pass exactly one of body or version
@@ -242,7 +242,9 @@ export class Templates {
242
242
  options?: RequestOptions;
243
243
  }): Promise<SdkResponse<GeocodeResult>>;
244
244
  /**
245
- * Upload a media file for use in template bodies; returns its public URL. 503 when media storage is not configured
245
+ * Upload a media file for use in template bodies; returns its public URL. An image over 1920 px on its longest edge or over
246
+ * 5,000,000 bytes is compressed to both, and one over the MMS size limit also gets an MMS copy in variants.mms. 503 when
247
+ * media storage is not configured
246
248
  * @async
247
249
  * @roles api, admin, developer
248
250
  * @param {Object} params - The parameters for the upload
@@ -266,6 +268,13 @@ export type SdkResponse<T> = import("../SignalHouseSDK.js").SdkResponse<T>;
266
268
  * version when one exists, otherwise the draft; an explicit selector never falls back (404 when missing).
267
269
  */
268
270
  export type VersionSelector = number | "draft" | "published";
271
+ /**
272
+ * A declared placeholder. Placeholders go in text, card titles and descriptions, button labels and fallback text. A url
273
+ * variable may fill a whole link or media URL, and any variable may fill a URL's path, query or fragment, percent-encoded. A
274
+ * dial number takes one phoneNumber variable and a calendar time one dateTime variable, each for the whole field. A calendar
275
+ * title and description and postbackData take text. A location's address and label take none. The send checks each filled
276
+ * field and blocks a recipient whose field fails with CONTENT_INVALID.
277
+ */
269
278
  export type RcsVariable = {
270
279
  /**
271
280
  * - Placeholder key used as {{key}} (/^[a-z][a-z0-9_]{0,63}$/)
@@ -280,11 +289,17 @@ export type RcsVariable = {
280
289
  */
281
290
  type: "text" | "number" | "dateTime" | "phoneNumber" | "url";
282
291
  /**
283
- * - Whether a send must supply a value
292
+ * - Without missingPolicy: whether a recipient with no value and no default is blocked
284
293
  */
285
294
  required: boolean;
286
295
  /**
287
- * - Value used when none is supplied
296
+ * - What a recipient with no value gets: the default (empty when none),
297
+ * a VARIABLE_MISSING block, or the send without each block that uses the variable. Omitted keeps the older rule: the
298
+ * default, else VARIABLE_MISSING when required, else empty. An empty value, or one of only spaces, counts as no value
299
+ */
300
+ missingPolicy?: "default" | "block" | "drop";
301
+ /**
302
+ * - Value used when none is supplied, by the default policy or with no policy
288
303
  */
289
304
  default?: string;
290
305
  /**
@@ -537,6 +552,16 @@ export type MediaAsset = {
537
552
  * - Pixel height, when known
538
553
  */
539
554
  height: number | null;
555
+ /**
556
+ * - An image over the MMS size limit has an MMS copy, which an
557
+ * MMS fallback leg sends; {} otherwise
558
+ */
559
+ variants: {
560
+ mms?: {
561
+ url: string;
562
+ bytes: number;
563
+ };
564
+ };
540
565
  /**
541
566
  * - ISO timestamp
542
567
  */
@@ -624,11 +649,14 @@ export type Capabilities = {
624
649
  charsPerLine: number;
625
650
  };
626
651
  /**
627
- * - Upload constraints
652
+ * - Upload
653
+ * constraints; an image over maxImageEdge or imageTargetBytes is compressed to both
628
654
  */
629
655
  media: {
630
656
  maxUploadBytes: number;
631
657
  mimeTypes: string[];
658
+ maxImageEdge: number;
659
+ imageTargetBytes: number;
632
660
  };
633
661
  /**
634
662
  * - Whether this server resolves VIEW_LOCATION addresses (geocodeAddress answers 503 when false)
@@ -8,6 +8,7 @@
8
8
  * - `sdk.voice.sipProfiles` — SIP profile / endpoint (single registerable UA).
9
9
  * - `sdk.voice.programmableVoiceProfiles` — Programmable Voice Profile (route a set of numbers through Signal House).
10
10
  * - `sdk.voice.numberRoutes` — Per-number inbound route (overrides the profile and subgroup settings).
11
+ * - `sdk.voice.callFlows` — Call flows: customer-built call trees a number or profile can run.
11
12
  * - `sdk.voice.calls` — Twilio-compat programmatic call control (create/hangup/etc.).
12
13
  * - `sdk.voice.callLogs` — Account-scoped call history: list/get + presigned recording.
13
14
  * - `sdk.voice.globalVoiceSettings` — Account-wide voice defaults (accepted regions, max spend, E911).
@@ -28,6 +29,7 @@ export class Voice {
28
29
  tokens: Tokens;
29
30
  analytics: Analytics;
30
31
  outboundVoice: OutboundVoice;
32
+ callFlows: CallFlows;
31
33
  }
32
34
  import { SipTrunks } from "./voice/SipTrunks.js";
33
35
  import { SipProfiles } from "./voice/SipProfiles.js";
@@ -39,3 +41,4 @@ import { GlobalVoiceSettings } from "./voice/GlobalVoiceSettings.js";
39
41
  import { Tokens } from "./voice/Tokens.js";
40
42
  import { Analytics } from "./voice/Analytics.js";
41
43
  import { OutboundVoice } from "./voice/OutboundVoice.js";
44
+ import { CallFlows } from "./voice/CallFlows.js";