@signalhouse-sms/sdk 1.12.0 → 1.14.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,72 @@
1
+ /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+
7
+ /**
8
+ * Carrier phone-number checks under /verify: SIM Swap and Number Verify. Every check the carrier answers is billed to
9
+ * the group's wallet (402 on insufficient funds); a check the carrier cannot run for the number is a 422 and is not charged.
10
+ */
11
+ export class Verify {
12
+ /**
13
+ * Keep the JSON client every verify request goes through.
14
+ * @param {any} client - The JSON request client
15
+ * @param {boolean} [enableAdmin] - Whether admin-scoped behaviors are enabled
16
+ */
17
+ constructor(client, enableAdmin) {
18
+ this.client = client;
19
+ this.enableAdmin = enableAdmin;
20
+ }
21
+
22
+ /**
23
+ * Check whether a number's SIM card changed recently, as reported by its carrier. Billed once when the check answers;
24
+ * 422 when the check is not available for the number (not charged)
25
+ * @async
26
+ * @roles api, admin, developer
27
+ * @param {Object} params - The check
28
+ * @param {string} params.phoneNumber - The number to check, in international format (e.g. "+12025550123")
29
+ * @param {number} [params.maxAge] - Lookback window in hours, 1-2400; the carrier's default when omitted
30
+ * @param {boolean} [params.includeSwapDate] - Also return the latest SIM change date (no extra charge; default false)
31
+ * @param {RequestOptions} [params.options] - Additional options for the request
32
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ checkId, phoneNumber, swapped, maxAge, latestSimChange?, cost }`
33
+ */
34
+ async checkSimSwap({ phoneNumber, maxAge, includeSwapDate, options = {} }) {
35
+ this.client._require({ phoneNumber });
36
+ const body = { phoneNumber, ...(maxAge !== undefined && { maxAge }), ...(includeSwapDate !== undefined && { includeSwapDate }) };
37
+ return this.client(`/verify/sim-swap`, { method: "POST", body, ...options });
38
+ }
39
+
40
+ /**
41
+ * Start a Number Verify check. The end user's phone must open the returned `authorizationUrl` on mobile data (Wi-Fi off)
42
+ * within 10 minutes; the carrier then confirms whether the phone's own number matches. Read the result with
43
+ * getNumberVerification. Billed only when the check is answered (VERIFIED or NOT_VERIFIED)
44
+ * @async
45
+ * @roles api, admin, developer
46
+ * @param {Object} params - The check
47
+ * @param {string} params.phoneNumber - The number to verify, in international format (e.g. "+12025550123")
48
+ * @param {string} [params.devicePhoneNumber] - The phone's own number, sent to the carrier as a login hint
49
+ * @param {string} [params.redirectUrl] - An https URL the end user's browser is sent to after the check, with `?checkId=…`
50
+ * @param {RequestOptions} [params.options] - Additional options for the request
51
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ checkId, phoneNumber, status: "PENDING", authorizationUrl, expiresAt }`
52
+ */
53
+ async startNumberVerification({ phoneNumber, devicePhoneNumber, redirectUrl, options = {} }) {
54
+ this.client._require({ phoneNumber });
55
+ const body = { phoneNumber, ...(devicePhoneNumber !== undefined && { devicePhoneNumber }), ...(redirectUrl !== undefined && { redirectUrl }) };
56
+ return this.client(`/verify/number`, { method: "POST", body, ...options });
57
+ }
58
+
59
+ /**
60
+ * Get a Number Verify check's status and result. A PENDING check past its expiresAt reads as EXPIRED
61
+ * @async
62
+ * @roles api, admin, developer, billing, user
63
+ * @param {Object} params - The lookup
64
+ * @param {string} params.checkId - The check ID (e.g. NVC…)
65
+ * @param {RequestOptions} [params.options] - Additional options for the request
66
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ checkId, phoneNumber, status, devicePhoneNumberVerified, failureReason, createdAt, expiresAt, completedAt, cost }`
67
+ */
68
+ async getNumberVerification({ checkId, options = {} }) {
69
+ this.client._require({ checkId });
70
+ return this.client(`/verify/number/${encodeURIComponent(checkId)}`, { method: "GET", ...options });
71
+ }
72
+ }
@@ -30,6 +30,9 @@ export class SignalHouseSDK {
30
30
  webhooks: Webhooks;
31
31
  voice: Voice;
32
32
  agents: Agents;
33
+ audit: Audit;
34
+ contracts: Contracts;
35
+ verify: Verify;
33
36
  /**
34
37
  * Client for API requests
35
38
  * @private
@@ -115,3 +118,6 @@ import { Notifications } from "./domains/Notifications.js";
115
118
  import { Webhooks } from "./domains/Webhooks.js";
116
119
  import { Voice } from "./domains/Voice.js";
117
120
  import { Agents } from "./domains/Agents.js";
121
+ import { Audit } from "./domains/Audit.js";
122
+ import { Contracts } from "./domains/Contracts.js";
123
+ import { Verify } from "./domains/Verify.js";
@@ -0,0 +1,39 @@
1
+ /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+ /**
7
+ * Audit domain: the staff read of who changed a registration or a message template, and what changed. Every method lives
8
+ * under the admin namespace, present only when the SDK is created with `enableAdmin: true`.
9
+ */
10
+ export class Audit {
11
+ constructor(client: any, enableAdmin: any);
12
+ client: any;
13
+ enableAdmin: any;
14
+ admin: {
15
+ /**
16
+ * Get audit events, newest first: one registration's or template's, or a group's. Staff-only.
17
+ * @async
18
+ * @roles signalhouse
19
+ * @param {Object} params
20
+ * @param {("registration"|"template")} [params.entityType] - The entity type; required with entityId
21
+ * @param {string} [params.entityId] - The registration id or template id
22
+ * @param {string} [params.groupId] - The owning group; required when entityId is omitted
23
+ * @param {number} [params.page] - Page number (default 1)
24
+ * @param {number} [params.limit] - Events per page (default 25, max 100)
25
+ * @param {RequestOptions} [params.options] - Additional options for the request
26
+ * @returns {Promise<SdkResponse<any>>} - `{ data, total, page, limit }`; each event is `{ _id, occurredAt, actor: { type, userId, role }, entity: { type, id, groupId }, action, changes: [{ path, from, to }] }`
27
+ */
28
+ getAuditEvents: ({ entityType, entityId, groupId, page, limit, options }?: {
29
+ entityType?: ("registration" | "template");
30
+ entityId?: string;
31
+ groupId?: string;
32
+ page?: number;
33
+ limit?: number;
34
+ options?: RequestOptions;
35
+ }) => Promise<SdkResponse<any>>;
36
+ };
37
+ }
38
+ export type RequestOptions = import("../SignalHouseSDK.js").RequestOptions;
39
+ export type SdkResponse<T> = import("../SignalHouseSDK.js").SdkResponse<T>;
@@ -483,6 +483,20 @@ export class Brands {
483
483
  brandId: BrandLookupId;
484
484
  options?: RequestOptions;
485
485
  }): Promise<SdkResponse<any[]>>;
486
+ /**
487
+ * Get TCR's identity feedback for a brand: why TCR could not verify it (status UNVERIFIED)
488
+ * @async
489
+ * @roles api, admin, developer, billing, user
490
+ * @param {Object} params - The parameters for getting the feedback
491
+ * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, record `_id`, or internal reference).
492
+ * @param {RequestOptions} [params.options] - Additional options for the request
493
+ * @throws {Error} Throws an error if the brandId parameter is missing
494
+ * @returns {Promise<SdkResponse<Object>>} BrandFeedback: { brandId, category: [{ id, displayName, description, fields, errors: [{ code, message }] }] }
495
+ */
496
+ getBrandFeedback({ brandId, options }: {
497
+ brandId: BrandLookupId;
498
+ options?: RequestOptions;
499
+ }): Promise<SdkResponse<any>>;
486
500
  /**
487
501
  * Submit a brand identity status appeal with supporting documentation
488
502
  * @async
@@ -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>;
@@ -127,7 +127,7 @@ export class Messages {
127
127
  * @param {string} params.id - The message ID
128
128
  * @param {RequestOptions} [params.options] - Additional options for the request
129
129
  * @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
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
131
131
  */
132
132
  getMessage({ id, options }: {
133
133
  id: string;
@@ -490,6 +490,32 @@ export class Messages {
490
490
  regionScopes?: any[] | string;
491
491
  options?: RequestOptions;
492
492
  }): Promise<SdkResponse<any>>;
493
+ /**
494
+ * Export the group's consent ledger, newest first: one append-only record per opt-out or opt-in a recipient gave (a STOP
495
+ * or START keyword, or the confirmation of an opt-out link). It records only; sends do not read it.
496
+ * @async
497
+ * @roles api, admin, developer, billing, user
498
+ * @param {Object} params - The parameters for exporting consent records
499
+ * @param {string} params.groupId - The group whose records to read
500
+ * @param {string} [params.recipientPhoneNumber] - One handset, in any spelling; matched on its digits
501
+ * @param {string} [params.startDate] - Earliest occurredAt, ISO-8601; a bare date is its whole UTC day, a timestamp is bound as sent
502
+ * @param {string} [params.endDate] - Latest occurredAt, ISO-8601; a bare date is its whole UTC day, a timestamp is bound as sent
503
+ * @param {number} [params.page] - Page number (default 1)
504
+ * @param {number} [params.limit] - Records per page (default 100, max 500)
505
+ * @param {RequestOptions} [params.options] - Additional options for the request
506
+ * @returns {Promise<SdkResponse<any>>} - `{ data, total, page, limit }`. Each record carries groupId, subgroupId, recipientPhoneNumber (the handset),
507
+ * phoneNumber (the business number or RCS agent id that received it), scope `{ type: CAMPAIGN|AGENT|SUBGROUP, id }`,
508
+ * clearedScopes (for OPT_IN, every `{ type, id }` the START cleared; empty for OPT_OUT), action (OPT_OUT or OPT_IN), source (KEYWORD or LINK), keyword, messageType (SMS, MMS or RCS), messageId, actor `{ type: "RECIPIENT" }`, occurredAt and createdAt.
509
+ */
510
+ getConsentRecords({ groupId, recipientPhoneNumber, startDate, endDate, page, limit, options }: {
511
+ groupId: string;
512
+ recipientPhoneNumber?: string;
513
+ startDate?: string;
514
+ endDate?: string;
515
+ page?: number;
516
+ limit?: number;
517
+ options?: RequestOptions;
518
+ }): Promise<SdkResponse<any>>;
493
519
  /**
494
520
  * Send an SMS message to one or more recipient phone numbers
495
521
  *
@@ -43,6 +43,15 @@
43
43
  * @property {string} [email] - An individual's business email
44
44
  * @property {string} [mobile] - Mobile number, E.164
45
45
  */
46
+ /**
47
+ * Where one prefilled field's value came from. The agent's `autofill` holds one per field, keyed by its path
48
+ * (`consent.optInDetails`); the API marks a field `edited` once its value changes.
49
+ * @typedef {Object} RcsAgentAutofillMarker
50
+ * @property {("brand"|"campaign"|"landing")} source - The record the value came from
51
+ * @property {string|null} [sourceId] - That record's id (brand ID, campaign ID or landing page ID)
52
+ * @property {string} [at] - When the field was filled (ISO 8601; default now)
53
+ * @property {boolean} [edited] - Whether the value changed since (default false)
54
+ */
46
55
  /**
47
56
  * One recipient of an RCS send.
48
57
  * @typedef {Object} RcsRecipient
@@ -100,10 +109,11 @@ export class RcsAgents {
100
109
  * @param {{ mode?: string, channel?: string, from?: string }|null} [params.defaultFallback] - Fallback mode (auto, rcs_only, sms_only, none), channel (auto, sms, mms) and from, a number on the linked campaign
101
110
  * @param {string[]} [params.excludedCarriers] - [] or ["T_MOBILE"] (the carrier partner's carrier name)
102
111
  * @param {string[]} [params.testers] - Tester numbers (up to 200), invited once the agent exists at the carrier
112
+ * @param {Object<string, RcsAgentAutofillMarker>} [params.autofill] - Where the fields you prefilled came from, by path (`consent.optInDetails`); the API adds its own for what it fills
103
113
  * @param {RequestOptions} [params.options] - Additional options for the request
104
114
  * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent (status DRAFT)
105
115
  */
106
- create({ brandId, campaignId, agent, consent, contact, useCase, billingCategory, defaultFallback, excludedCarriers, testers, options }: {
116
+ create({ brandId, campaignId, agent, consent, contact, useCase, billingCategory, defaultFallback, excludedCarriers, testers, autofill, options }: {
107
117
  brandId: string;
108
118
  campaignId?: string | null;
109
119
  agent?: RcsAgentProfile;
@@ -118,6 +128,9 @@ export class RcsAgents {
118
128
  } | null;
119
129
  excludedCarriers?: string[];
120
130
  testers?: string[];
131
+ autofill?: {
132
+ [x: string]: RcsAgentAutofillMarker;
133
+ };
121
134
  options?: RequestOptions;
122
135
  }): Promise<SdkResponse<any>>;
123
136
  /**
@@ -152,7 +165,7 @@ export class RcsAgents {
152
165
  * @param {Object} params - The lookup
153
166
  * @param {string} params.agentId - The agent ID (e.g. RCSA7K2M1QZ8RP)
154
167
  * @param {RequestOptions} [params.options] - Additional options for the request
155
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent
168
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent; googleAgentId is Google's id for it, null until Google has created the agent
156
169
  */
157
170
  get({ agentId, options }: {
158
171
  agentId: string;
@@ -160,9 +173,11 @@ export class RcsAgents {
160
173
  }): Promise<SdkResponse<any>>;
161
174
  /**
162
175
  * Edit an agent while it may change: a draft, a Signal House rejection, a request for changes, or an agent in
163
- * testing (the change is pushed to the carrier partner). `agent`, `consent` and `contact` merge field by field;
164
- * every other key replaces; campaignId: null unlinks the campaign. 409 in any other status; brandId is locked once
165
- * the agent exists at the partner and billingCategory once a launch was requested.
176
+ * testing (the change is pushed to the carrier partner). After a carrier rejected a launch other carriers took
177
+ * (PARTIALLY_LAUNCHED with a REJECTED carrier), only `consent` and `contact` may change, and nothing is pushed: send
178
+ * them with requestCarrierUpdate. `agent`, `consent` and `contact` merge field by field; every other key replaces;
179
+ * campaignId: null unlinks the campaign. 409 in any other status; brandId is locked once the agent exists at the
180
+ * partner and billingCategory once a launch was requested.
166
181
  * @async
167
182
  * @roles api, admin, developer, billing, user
168
183
  * @param {Object} params - The edit
@@ -177,10 +192,11 @@ export class RcsAgents {
177
192
  * @param {Object|null} [params.defaultFallback] - The fallback
178
193
  * @param {string[]} [params.excludedCarriers] - [] or ["T_MOBILE"] (the carrier partner's carrier name)
179
194
  * @param {string[]} [params.testers] - Tester numbers
195
+ * @param {Object<string, RcsAgentAutofillMarker>} [params.autofill] - Replaces the prefill markers; omitted, the stored ones are kept and a changed field's marker turns edited
180
196
  * @param {RequestOptions} [params.options] - Additional options for the request
181
197
  * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent
182
198
  */
183
- update({ agentId, brandId, campaignId, agent, consent, contact, useCase, billingCategory, defaultFallback, excludedCarriers, testers, options }: {
199
+ update({ agentId, brandId, campaignId, agent, consent, contact, useCase, billingCategory, defaultFallback, excludedCarriers, testers, autofill, options }: {
184
200
  agentId: string;
185
201
  brandId?: string;
186
202
  campaignId?: string | null;
@@ -192,12 +208,17 @@ export class RcsAgents {
192
208
  defaultFallback?: any | null;
193
209
  excludedCarriers?: string[];
194
210
  testers?: string[];
211
+ autofill?: {
212
+ [x: string]: RcsAgentAutofillMarker;
213
+ };
195
214
  options?: RequestOptions;
196
215
  }): Promise<SdkResponse<any>>;
197
216
  /**
198
217
  * Check an agent against the next gate on its path without writing: before it exists at the carrier partner, what
199
218
  * creating it needs (the full profile, useCase, a billingCategory); after that, what the launch request needs
200
219
  * (a VERIFIED brand, the campaign, the full consent with the video, the contact)
220
+ * The launch gate also runs the carriers' copy rules; each error carries the carrier partner's key as `code`, for
221
+ * example OPT_IN_MSG_RATE_DISCL_MISSING.
201
222
  * @async
202
223
  * @roles api, admin, developer, billing, user
203
224
  * @param {Object} params - The lookup
@@ -213,6 +234,8 @@ export class RcsAgents {
213
234
  * Submit a draft: create the agent at the carrier partner, with no review first. It needs the full profile, a
214
235
  * useCase and a billingCategory; otherwise a 400 whose details carry { code: "REGISTRATION_INCOMPLETE",
215
236
  * errors, warnings }. The agent moves to AGENT_CREATING, then IN_TESTING once the partner reports it ready.
237
+ * A group that has not finished account verification gets a 403 with code GROUP_UNVERIFIED, and a rejected one a 403
238
+ * with code GROUP_REJECTED; a pending verification passes.
216
239
  * @async
217
240
  * @roles api, admin, developer, billing, user
218
241
  * @param {Object} params - The submission
@@ -228,7 +251,9 @@ export class RcsAgents {
228
251
  * Request the agent's launch: the launch requirements are checked and the agent goes to Signal House review (status
229
252
  * PENDING_REVIEW), whose approval files the launch with the carrier partner. Allowed from IN_TESTING, REJECTED and
230
253
  * CARRIER_REJECTED (409 otherwise); a failed requirement is a 400 whose details carry { code:
231
- * "REGISTRATION_INCOMPLETE", errors, warnings }. Sends POST /registration/:agentId/launch: the agent is a registration.
254
+ * "REGISTRATION_INCOMPLETE", errors, warnings }, and a copy-rule error carries the carrier partner's key as its `code`
255
+ * (for example OPT_IN_MSG_RATE_DISCL_MISSING). A group that has not finished account verification gets a 403 with code
256
+ * GROUP_UNVERIFIED, and a rejected one a 403 with code GROUP_REJECTED. Sends POST /registration/:agentId/launch: the agent is a registration.
232
257
  * The request charges the agent's launch fees: a wallet that cannot cover them gets a 402, and the agent stays where it is. When any fee is due the request must set acknowledgeFees: true, or it gets a 400 with code FEE_ACKNOWLEDGEMENT_REQUIRED and nothing is held; a launch with nothing due needs no acknowledgement. The agent's launchFees quotes what the next request charges.
233
258
  * When the agent's brand vertical is healthcare or insurance, the launch needs the protected health information (PHI) disclosure acknowledged: send acknowledgePhi: true, or the request gets a 400 REGISTRATION_INCOMPLETE whose errors name consent.phiAcknowledgement. The API records the acknowledgement as consent.phiAcknowledgement { acknowledgedAt, acknowledgedBy } from the caller; the client sends only the boolean, and an agent update cannot set it. Once recorded, a later launch request needs no new acknowledgement.
234
259
  * @async
@@ -246,6 +271,23 @@ export class RcsAgents {
246
271
  acknowledgePhi?: boolean;
247
272
  options?: RequestOptions;
248
273
  }): Promise<SdkResponse<any>>;
274
+ /**
275
+ * Send Signal House the corrected launch answers after a carrier rejected a launch other carriers took. The carrier
276
+ * partner takes no change through its API once a carrier launched, so Signal House emails it the update; edit
277
+ * `consent` and `contact` first. The agent's carrierUpdate reads REQUESTED for the rejected carriers, then SENT once
278
+ * Signal House sent it. 409 when no carrier is REJECTED after a partial launch, or an update already waits.
279
+ * Sends POST /registration/:agentId/carrier-update: the agent is a registration.
280
+ * @async
281
+ * @roles api, admin, developer, billing, user
282
+ * @param {Object} params - The request
283
+ * @param {string} params.agentId - The agent ID
284
+ * @param {RequestOptions} [params.options] - Additional options for the request
285
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the agent's registration, with data.carrierUpdate
286
+ */
287
+ requestCarrierUpdate({ agentId, options }: {
288
+ agentId: string;
289
+ options?: RequestOptions;
290
+ }): Promise<SdkResponse<any>>;
249
291
  /**
250
292
  * Archive an agent. One the carrier partner created stops sending at once and stays ARCHIVE_PENDING until Signal House confirms the partner cancelled it, then ARCHIVED. Archiving cannot be undone; an agent already ARCHIVE_PENDING answers 409.
251
293
  * @async
@@ -259,6 +301,24 @@ export class RcsAgents {
259
301
  agentId: string;
260
302
  options?: RequestOptions;
261
303
  }): Promise<SdkResponse<any>>;
304
+ /**
305
+ * Make the links that start a chat with the agent: an sms: deep link in Google's format, and a short link that redirects to it,
306
+ * to print as a QR code. With the agent's defaultFallback.from, the deep link names that number, so a handset that cannot reach
307
+ * the agent texts it instead. The same request returns the same short link. The links work for approved testers until a carrier
308
+ * launches the agent; before Google has created the agent the request answers 409 with code GOOGLE_AGENT_PENDING.
309
+ * @async
310
+ * @roles api, admin, developer, billing, user
311
+ * @param {Object} params - The request
312
+ * @param {string} params.agentId - The agent ID
313
+ * @param {string} [params.body] - The message the chat opens with, prefilled on the handset (max 1,000 characters)
314
+ * @param {RequestOptions} [params.options] - Additional options for the request
315
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { googleAgentId, deepLink, shortLink }
316
+ */
317
+ createEntryPoints({ agentId, body, options }: {
318
+ agentId: string;
319
+ body?: string;
320
+ options?: RequestOptions;
321
+ }): Promise<SdkResponse<any>>;
262
322
  /**
263
323
  * Resend a tester's expired invitation, which starts a new 24 hours for the tester to accept it. The number must be
264
324
  * a tester on the agent (404) and its invitation must be EXPIRED (409); up to 20 invitations go out a day (429).
@@ -364,6 +424,50 @@ export class RcsMessages {
364
424
  simulate?: ("not_capable" | "ttl_expired" | "delivered" | "read");
365
425
  options?: RequestOptions;
366
426
  }): Promise<SdkResponse<any>>;
427
+ /**
428
+ * Send an RCS message to up to 10,000 recipients in the background. The request runs the send's request checks, splits the
429
+ * recipients into chunks of 100, queues each chunk and answers 202. Every message carries the shared bulkId; track progress with
430
+ * the messages list filtered by bulkId (GET /message?bulkId=) and per-message webhooks. A chunk the wallet cannot cover, or that is
431
+ * refused after acceptance, gets BLOCKED messages with blockReason INSUFFICIENT_FUNDS or SEND_REFUSED; a chunk that keeps failing
432
+ * gets SEND_FAILED. Pass options.idempotencyKey to make a retry safe (same bulkId, no duplicate sends); a retry without one may
433
+ * send duplicates.
434
+ * @async
435
+ * @roles api, admin, developer, billing, user
436
+ * @param {Object} params - The send; the same fields as send
437
+ * @param {string} params.agentId - The agent that sends (RCSA…)
438
+ * @param {RcsRecipient[]} params.recipients - Up to 10,000 recipients
439
+ * @param {string} [params.templateId] - A template to send; exactly one of templateId or content
440
+ * @param {number} [params.templateVersion] - A published version of templateId; needs templateId. Pinned when the batch is accepted
441
+ * @param {Object} [params.content] - Inline content; exactly one of templateId or content
442
+ * @param {string} [params.contentFormat] - content.v1 (default) or google.rcs
443
+ * @param {("AUTHENTICATION"|"TRANSACTION"|"SERVICEREQUEST"|"ACKNOWLEDGEMENT"|"PROMOTION")} [params.trafficType] - Required on a MULTI_USE agent when the template sets none
444
+ * @param {number} [params.ttlSeconds] - Seconds each RCS message may wait for delivery, from when its chunk is sent; at most one of ttlSeconds or expireTime
445
+ * @param {string} [params.expireTime] - ISO-8601 time the RCS messages expire
446
+ * @param {RcsMessageFallback} [params.fallback] - The fallback for this send
447
+ * @param {string} [params.statusCallbackUrl] - URL that receives each message's events
448
+ * @param {boolean} [params.enableShortlink] - Shorten the links in the message
449
+ * @param {boolean} [params.isTest] - Send as a test; approved testers only
450
+ * @param {("not_capable"|"ttl_expired"|"delivered"|"read")} [params.simulate] - Simulate this outcome; approved testers only
451
+ * @param {RequestOptions} [params.options] - Additional options for the request
452
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { bulkId, status: "ACCEPTED", recipientCount } (202). Every message of the batch carries bulkId. A recipient from 19999990000 to 19999990359 makes the whole request a simulation, as on send
453
+ */
454
+ sendBatch({ agentId, recipients, templateId, templateVersion, content, contentFormat, trafficType, ttlSeconds, expireTime, fallback, statusCallbackUrl, enableShortlink, isTest, simulate, options }: {
455
+ agentId: string;
456
+ recipients: RcsRecipient[];
457
+ templateId?: string;
458
+ templateVersion?: number;
459
+ content?: any;
460
+ contentFormat?: string;
461
+ trafficType?: ("AUTHENTICATION" | "TRANSACTION" | "SERVICEREQUEST" | "ACKNOWLEDGEMENT" | "PROMOTION");
462
+ ttlSeconds?: number;
463
+ expireTime?: string;
464
+ fallback?: RcsMessageFallback;
465
+ statusCallbackUrl?: string;
466
+ enableShortlink?: boolean;
467
+ isTest?: boolean;
468
+ simulate?: ("not_capable" | "ttl_expired" | "delivered" | "read");
469
+ options?: RequestOptions;
470
+ }): Promise<SdkResponse<any>>;
367
471
  /**
368
472
  * Check a send without writing anything. Takes the same parameters as send.
369
473
  * @async
@@ -420,7 +524,7 @@ export class RcsMessages {
420
524
  * @param {string} [params.expireTime] - ISO-8601 time the RCS message expires
421
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
422
526
  * @param {RequestOptions} [params.options] - Additional options for the request
423
- * @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.
424
528
  */
425
529
  estimate({ agentId, recipients, recipientCount, templateId, templateVersion, content, contentFormat, trafficType, ttlSeconds, expireTime, fallback, options }: {
426
530
  agentId: string;
@@ -489,7 +593,7 @@ export class RcsMessages {
489
593
  * @param {Object} params - The lookup
490
594
  * @param {string} params.messageId - The message ID
491
595
  * @param {RequestOptions} [params.options] - Additional options for the request
492
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to the message; an unknown ID is a 404
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
493
597
  */
494
598
  get({ messageId, options }: {
495
599
  messageId: string;
@@ -516,7 +620,7 @@ export class RcsMessages {
516
620
  * @param {string} [params.deliveredChannel] - Filter by the channel that delivered the message (rcs, sms, mms)
517
621
  * @param {boolean} [params.isTest] - true for test messages only, false to leave them out
518
622
  * @param {RequestOptions} [params.options] - Additional options for the request
519
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to the list of messages
623
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the list of messages; a settled RCS message carries carrierFeeMicros
520
624
  */
521
625
  list({ groupId, from, to, agentId, status, page, limit, templateId, templateVersion, bulkId, fallbackReason, billingClass, deliveredChannel, isTest, options }: {
522
626
  groupId: string;
@@ -671,6 +775,28 @@ export type RcsAgentContact = {
671
775
  */
672
776
  mobile?: string;
673
777
  };
778
+ /**
779
+ * Where one prefilled field's value came from. The agent's `autofill` holds one per field, keyed by its path
780
+ * (`consent.optInDetails`); the API marks a field `edited` once its value changes.
781
+ */
782
+ export type RcsAgentAutofillMarker = {
783
+ /**
784
+ * - The record the value came from
785
+ */
786
+ source: ("brand" | "campaign" | "landing");
787
+ /**
788
+ * - That record's id (brand ID, campaign ID or landing page ID)
789
+ */
790
+ sourceId?: string | null;
791
+ /**
792
+ * - When the field was filled (ISO 8601; default now)
793
+ */
794
+ at?: string;
795
+ /**
796
+ * - Whether the value changed since (default false)
797
+ */
798
+ edited?: boolean;
799
+ };
674
800
  /**
675
801
  * One recipient of an RCS send.
676
802
  */
@@ -129,6 +129,47 @@ export class Registrations {
129
129
  registrationId: string;
130
130
  options?: RequestOptions;
131
131
  }) => Promise<SdkResponse<any>>;
132
+ /**
133
+ * Mark an RCS agent's requested carrier update as sent, once staff emailed it to the carrier partner (signalhouse only)
134
+ * @async
135
+ * @roles signalhouse
136
+ * @param {Object} params - The parameters for the update
137
+ * @param {string} params.registrationId - The agent's registration ID (e.g. RCSA7K2M1QZ8RP)
138
+ * @param {RequestOptions} [params.options] - Additional options for the request
139
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to the registration, as staff read it; 409 when no update is REQUESTED
140
+ */
141
+ markCarrierUpdateSent: ({ registrationId, options }: {
142
+ registrationId: string;
143
+ options?: RequestOptions;
144
+ }) => Promise<SdkResponse<any>>;
145
+ /**
146
+ * Add an internal comment to a registration of any type; comments are append-only and never reach the customer (signalhouse only)
147
+ * @async
148
+ * @roles signalhouse
149
+ * @param {Object} params - The parameters for the comment
150
+ * @param {string} params.registrationId - The registration ID (e.g. RCSA7K2M1QZ8RP)
151
+ * @param {string} params.comment - The comment, 1 to 2,000 characters
152
+ * @param {RequestOptions} [params.options] - Additional options for the request
153
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { comment, createdAt, createdBy, createdByRole }
154
+ */
155
+ addComment: ({ registrationId, comment, options }: {
156
+ registrationId: string;
157
+ comment: string;
158
+ options?: RequestOptions;
159
+ }) => Promise<SdkResponse<any>>;
160
+ /**
161
+ * List a registration's internal comments, newest first (signalhouse only)
162
+ * @async
163
+ * @roles signalhouse
164
+ * @param {Object} params - The parameters for the read
165
+ * @param {string} params.registrationId - The registration ID (e.g. RCSA7K2M1QZ8RP)
166
+ * @param {RequestOptions} [params.options] - Additional options for the request
167
+ * @returns {Promise<SdkResponse<any>>} A promise that resolves to { comments: [{ comment, createdAt, createdBy, createdByRole }] }
168
+ */
169
+ getComments: ({ registrationId, options }: {
170
+ registrationId: string;
171
+ options?: RequestOptions;
172
+ }) => Promise<SdkResponse<any>>;
132
173
  };
133
174
  /**
134
175
  * Get the registration types a region offers and whether each can be acquired right now
@@ -251,7 +292,8 @@ export class Registrations {
251
292
  * Submit a draft. A type Signal House reviews goes to SIGNAL_HOUSE_REVIEW; a type it does not (RCS_AGENT) goes to
252
293
  * SUBMITTING and is filed with the provider at once. A draft that fails a requirement gets a 400 whose details carry
253
294
  * { code: "REGISTRATION_INCOMPLETE", errors, warnings }; a second submit, or one of a registration the provider
254
- * already holds, gets a 409.
295
+ * already holds, gets a 409. An RCS agent whose group has not finished account verification gets a 403 with code
296
+ * GROUP_UNVERIFIED, and one whose group is rejected a 403 with code GROUP_REJECTED.
255
297
  * @async
256
298
  * @roles api, admin, developer, billing, user
257
299
  * @param {Object} params - The parameters for the submission
@@ -268,7 +310,9 @@ export class Registrations {
268
310
  * are checked and the registration goes to SIGNAL_HOUSE_REVIEW, whose approval files the provider's launch request.
269
311
  * Allowed while the provider reports the agent ready for testing, after a Signal House rejection, or after every
270
312
  * carrier refused an earlier launch (409 otherwise); a failed requirement is a 400 whose details carry
271
- * { code: "REGISTRATION_INCOMPLETE", errors, warnings }.
313
+ * { code: "REGISTRATION_INCOMPLETE", errors, warnings }; an RCS agent's copy-rule error carries the carrier partner's key
314
+ * as its `code` (for example OPT_IN_MSG_RATE_DISCL_MISSING). An RCS agent whose group has not finished account
315
+ * verification gets a 403 with code GROUP_UNVERIFIED, and one whose group is rejected a 403 with code GROUP_REJECTED.
272
316
  * An RCS agent's launch request charges its launch fees: a wallet that cannot cover them gets a 402, and nothing changes. When any fee is due the request must set acknowledgeFees: true, or it gets a 400 with code FEE_ACKNOWLEDGEMENT_REQUIRED and nothing is held; a launch with nothing due needs no acknowledgement.
273
317
  * When the agent's brand vertical is healthcare or insurance, the launch needs the protected health information (PHI) disclosure acknowledged: send acknowledgePhi: true, or the request gets a 400 REGISTRATION_INCOMPLETE whose errors name consent.phiAcknowledgement. The API records the acknowledgement as consent.phiAcknowledgement { acknowledgedAt, acknowledgedBy } from the caller; the client sends only the boolean, and an agent update cannot set it. Once recorded, a later launch request needs no new acknowledgement.
274
318
  * @async