ab-ecosystem-cpass 1.0.0 → 1.0.6
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/README.md +121 -21
- package/dist/client.d.ts +38 -0
- package/dist/client.js +49 -5
- package/dist/client.js.map +1 -1
- package/dist/http.d.ts +15 -0
- package/dist/http.js +21 -1
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/bytes.d.ts +38 -0
- package/dist/internal/bytes.js +84 -0
- package/dist/internal/bytes.js.map +1 -0
- package/dist/internal/device.d.ts +24 -0
- package/dist/internal/device.js +91 -0
- package/dist/internal/device.js.map +1 -0
- package/dist/internal/md5.d.ts +4 -0
- package/dist/internal/md5.js +109 -0
- package/dist/internal/md5.js.map +1 -0
- package/dist/internal/receiver-file.d.ts +106 -0
- package/dist/internal/receiver-file.js +128 -0
- package/dist/internal/receiver-file.js.map +1 -0
- package/dist/realtime/client.d.ts +85 -0
- package/dist/realtime/client.js +126 -0
- package/dist/realtime/client.js.map +1 -0
- package/dist/realtime/events.d.ts +147 -0
- package/dist/realtime/events.js +3 -0
- package/dist/realtime/events.js.map +1 -0
- package/dist/realtime/inbox.d.ts +173 -0
- package/dist/realtime/inbox.js +263 -0
- package/dist/realtime/inbox.js.map +1 -0
- package/dist/realtime/index.d.ts +16 -0
- package/dist/realtime/index.js +37 -0
- package/dist/realtime/index.js.map +1 -0
- package/dist/resources/audience/contacts.d.ts +19 -3
- package/dist/resources/audience/contacts.js +19 -3
- package/dist/resources/audience/contacts.js.map +1 -1
- package/dist/resources/audience/inbox-media.d.ts +92 -0
- package/dist/resources/audience/inbox-media.js +127 -0
- package/dist/resources/audience/inbox-media.js.map +1 -0
- package/dist/resources/audience/notifications.d.ts +171 -0
- package/dist/resources/audience/notifications.js +215 -0
- package/dist/resources/audience/notifications.js.map +1 -0
- package/dist/resources/audience/scheduled-messages.d.ts +234 -0
- package/dist/resources/audience/scheduled-messages.js +259 -0
- package/dist/resources/audience/scheduled-messages.js.map +1 -0
- package/dist/resources/campaign-audience.d.ts +132 -0
- package/dist/resources/campaign-audience.js +224 -0
- package/dist/resources/campaign-audience.js.map +1 -0
- package/dist/resources/campaign-report-exports.d.ts +14 -0
- package/dist/resources/campaign-report-exports.js +28 -0
- package/dist/resources/campaign-report-exports.js.map +1 -0
- package/dist/resources/campaign-reports.d.ts +15 -0
- package/dist/resources/campaign-reports.js +25 -0
- package/dist/resources/campaign-reports.js.map +1 -0
- package/dist/resources/campaigns.d.ts +239 -0
- package/dist/resources/campaigns.js +300 -0
- package/dist/resources/campaigns.js.map +1 -0
- package/dist/types/audience.d.ts +93 -1
- package/dist/types/campaign.d.ts +229 -0
- package/dist/types/campaign.js +3 -0
- package/dist/types/campaign.js.map +1 -0
- package/dist/types/contact-filter.d.ts +3 -2
- package/dist/types/contact-filter.js +3 -2
- package/dist/types/contact-filter.js.map +1 -1
- package/dist/types/inbox.d.ts +391 -0
- package/dist/types/inbox.js +16 -0
- package/dist/types/inbox.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/scheduled-message.d.ts +221 -0
- package/dist/types/scheduled-message.js +16 -0
- package/dist/types/scheduled-message.js.map +1 -0
- package/docs/audience/contacts.md +34 -4
- package/docs/audience/notifications.md +263 -0
- package/docs/audience/scheduled-messages.md +557 -0
- package/docs/campaign/campaigns.md +489 -0
- package/docs/contact-filter.md +2 -1
- package/docs/inbox/chats.md +356 -0
- package/docs/inbox/connection.md +171 -0
- package/docs/inbox/media.md +202 -0
- package/docs/inbox/messages.md +338 -0
- package/docs/inbox/referrals.md +72 -0
- package/docs/inbox/sessions.md +74 -0
- package/package.json +28 -2
package/README.md
CHANGED
|
@@ -122,9 +122,9 @@ await crm.billing.list('all', {
|
|
|
122
122
|
|
|
123
123
|
### The contact filter
|
|
124
124
|
|
|
125
|
-
One condition DSL is shared by
|
|
126
|
-
`Segment`, a CRM trigger's `filters`,
|
|
127
|
-
its own page: **[contact filter](docs/contact-filter.md)**.
|
|
125
|
+
One condition DSL is shared by five places: `contacts.list({ filter })`, a saved
|
|
126
|
+
`Segment`, a CRM trigger's `filters`, an export's `config.filter`, and a
|
|
127
|
+
scheduled message's `conditions`. It has its own page: **[contact filter](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/contact-filter.md)**.
|
|
128
128
|
|
|
129
129
|
### Scoping
|
|
130
130
|
|
|
@@ -161,30 +161,130 @@ the paths), `404 not_found`, `409 conflict` for a name or slug already taken.
|
|
|
161
161
|
|
|
162
162
|
## Modules
|
|
163
163
|
|
|
164
|
+
One page per resource, every action with its payload, query and response. The
|
|
165
|
+
same pages ship inside the package, so they are readable offline at
|
|
166
|
+
`node_modules/ab-ecosystem-cpass/docs/`.
|
|
167
|
+
|
|
164
168
|
### Audience — `/v1/audience`
|
|
165
169
|
|
|
166
170
|
| Resource | Page | Actions |
|
|
167
171
|
| --- | --- | --- |
|
|
168
|
-
| `crm.contacts` | [contacts](docs/audience/contacts.md) | `list` `get` `create` `update` `delete` `iterate` |
|
|
169
|
-
| `crm.contactTags` | [contact tags](docs/audience/contact-tags.md) | `list` `get` `create` `update` `delete` |
|
|
170
|
-
| `crm.contactNotes` | [contact notes](docs/audience/contact-notes.md) | `list` `get` `create` `update` `delete` |
|
|
171
|
-
| `crm.customFields` | [custom fields](docs/audience/custom-fields.md) | `list` `get` `create` `update` `delete` |
|
|
172
|
-
| `crm.segments` | [segments](docs/audience/segments.md) | `list` `get` `create` `update` `delete` |
|
|
173
|
-
| `crm.crmTriggers` | [CRM triggers](docs/audience/crm-triggers.md) | `list` `get` `create` `update` `delete` `logs` |
|
|
174
|
-
| `crm.imports` | [import history](docs/audience/imports.md) | `list` `get` `create` `delete` |
|
|
175
|
-
| `crm.exports` | [export history](docs/audience/exports.md) | `list` `get` `create` `delete` |
|
|
176
|
-
| `crm.webhooks` | [audience webhooks](docs/audience/webhooks.md) | `list` `get` `create` `update` `delete` |
|
|
172
|
+
| `crm.contacts` | [contacts](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/contacts.md) | `list` `get` `create` `update` `delete` `iterate` |
|
|
173
|
+
| `crm.contactTags` | [contact tags](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/contact-tags.md) | `list` `get` `create` `update` `delete` |
|
|
174
|
+
| `crm.contactNotes` | [contact notes](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/contact-notes.md) | `list` `get` `create` `update` `delete` |
|
|
175
|
+
| `crm.customFields` | [custom fields](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/custom-fields.md) | `list` `get` `create` `update` `delete` |
|
|
176
|
+
| `crm.segments` | [segments](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/segments.md) | `list` `get` `create` `update` `delete` |
|
|
177
|
+
| `crm.crmTriggers` | [CRM triggers](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/crm-triggers.md) | `list` `get` `create` `update` `delete` `logs` |
|
|
178
|
+
| `crm.imports` | [import history](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/imports.md) | `list` `get` `create` `delete` |
|
|
179
|
+
| `crm.exports` | [export history](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/exports.md) | `list` `get` `create` `delete` |
|
|
180
|
+
| `crm.webhooks` | [audience webhooks](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/webhooks.md) | `list` `get` `create` `update` `delete` |
|
|
181
|
+
| `crm.scheduledMessages` | [scheduled messages](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/scheduled-messages.md) | `list` `get` `create` `createSeries` `createRepeating` `reschedule` `cancel` `cancelSeries` `sendNow` |
|
|
182
|
+
| `crm.notifications` | [push notifications](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/audience/notifications.md) | `subscribe` `unsubscribe` `devices` — the devices a user wants notified |
|
|
177
183
|
|
|
178
184
|
### Channels — `/v1/channels`
|
|
179
185
|
|
|
180
186
|
| Resource | Page | Actions |
|
|
181
187
|
| --- | --- | --- |
|
|
182
|
-
| `crm.channels` | [channels](docs/channels/channels.md) | `list` `get` `updateDetails` `disable` `rotateToken` `getProp` `setProp` |
|
|
183
|
-
| — | [channel properties](docs/channels/channel-props.md) | every `prop` `getProp`/`setProp` accepts |
|
|
184
|
-
| `crm.templates` | [templates](docs/channels/templates.md) | `list` `get` `create` `update` `delete` `sync` |
|
|
185
|
-
| `crm.channelWebhooks` | [channel webhooks](docs/channels/webhooks.md) | `list` `get` `create` `update` `delete` |
|
|
186
|
-
| `crm.billing` | [conversation billing](docs/channels/billing.md) | `list` `stats` |
|
|
187
|
-
| `crm.wallet` | [wallet ledger](docs/channels/wallet.md) | `list` |
|
|
188
|
-
| `crm.activity` | [activity log](docs/channels/activity.md) | `list` |
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
| `crm.channels` | [channels](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/channels/channels.md) | `list` `get` `updateDetails` `disable` `rotateToken` `getProp` `setProp` |
|
|
189
|
+
| — | [channel properties](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/channels/channel-props.md) | every `prop` `getProp`/`setProp` accepts |
|
|
190
|
+
| `crm.templates` | [templates](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/channels/templates.md) | `list` `get` `create` `update` `delete` `sync` |
|
|
191
|
+
| `crm.channelWebhooks` | [channel webhooks](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/channels/webhooks.md) | `list` `get` `create` `update` `delete` |
|
|
192
|
+
| `crm.billing` | [conversation billing](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/channels/billing.md) | `list` `stats` |
|
|
193
|
+
| `crm.wallet` | [wallet ledger](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/channels/wallet.md) | `list` |
|
|
194
|
+
| `crm.activity` | [activity log](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/channels/activity.md) | `list` |
|
|
195
|
+
|
|
196
|
+
### Live chat inbox — Socket.IO
|
|
197
|
+
|
|
198
|
+
A separate transport, not the REST gateway: the inbox is a socket connection with
|
|
199
|
+
its own origin. Install `socket.io-client` alongside the SDK and import the
|
|
200
|
+
`/realtime` subpath — nothing resolves it if you only use the REST client.
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
import { Inbox } from 'ab-ecosystem-cpass/realtime';
|
|
204
|
+
|
|
205
|
+
const inbox = new Inbox({ url: 'https://inbox.example.com', clientId, token: () => accessToken });
|
|
206
|
+
await inbox.ready();
|
|
207
|
+
|
|
208
|
+
const { contacts } = await inbox.chats.list({ filter: { assignment: 'me', unread: 'unread' } });
|
|
209
|
+
inbox.on('message.received', (message) => append(message));
|
|
210
|
+
|
|
211
|
+
// Media: upload straight to storage, then send the link.
|
|
212
|
+
const link = await crm.inboxMedia.upload(file, { kind: 'image' });
|
|
213
|
+
await inbox.messages.sendMedia({ channel, contact, kind: 'image', link, caption: 'Your order' });
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
| Resource | Page | Actions |
|
|
217
|
+
| --- | --- | --- |
|
|
218
|
+
| — | [connecting](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/inbox/connection.md) | handshake, requests vs pushes, rooms, errors, permissions |
|
|
219
|
+
| `inbox.chats` | [chats](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/inbox/chats.md) | `list` `get` `delete` `transfer` `bulkTransfer` `archive` `unarchive` `block` `markAsRead` `markAsUnread` `pauseAutomation` `resumeAutomation` `close` `done` `pauseTimer` `updateTags` `update` `assignBot` |
|
|
220
|
+
| `inbox.messages` | [messages](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/inbox/messages.md) | `list` `get` `send` `sendMedia` `delete` `retryDownload` |
|
|
221
|
+
| `crm.inboxMedia` | [media](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/inbox/media.md) | `upload` `createUpload` — presigned uploads straight to storage |
|
|
222
|
+
| `inbox.referrals` | [referrals](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/inbox/referrals.md) | click-to-WhatsApp ad payloads |
|
|
223
|
+
| `inbox.sessions` | [chat sessions](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/inbox/sessions.md) | per-channel reply windows |
|
|
224
|
+
|
|
225
|
+
Requests are promises; pushes are what other agents and contacts did. The same
|
|
226
|
+
event name can be both — an archive you performed and one another agent performed
|
|
227
|
+
arrive identically, so one handler per kind of change is enough.
|
|
228
|
+
|
|
229
|
+
## Campaigns
|
|
230
|
+
|
|
231
|
+
One message sent to many people. The audience is a single `filters` field with
|
|
232
|
+
five modes, chosen by the **shape** of the array: `[]` for every contact, a list
|
|
233
|
+
of filter conditions for a segment, `[{numbers, hash}]` for a bulk list,
|
|
234
|
+
`[{type: 'channel'|'template', ...}]` for a group campaign split into buckets, or
|
|
235
|
+
`[{type: 'status'|'selection', ...}]` to re-target an earlier campaign.
|
|
236
|
+
|
|
237
|
+
`createBulk` is the one worth knowing about. Hand it numbers or a CSV and it does
|
|
238
|
+
the whole bulk path — the recipient list does not travel inside the campaign,
|
|
239
|
+
because a million numbers is not a request body:
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
const { campaign, receivers, skipped, duplicates } = await crm.campaigns.createBulk({
|
|
243
|
+
name: 'Diwali offer',
|
|
244
|
+
audience: { csv: await file.text(), recipientColumn: 'phone' },
|
|
245
|
+
messages: [{ channel: { id: channelId }, message: template }],
|
|
246
|
+
});
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
It parses the input, encrypts the list under a per-file secret, uploads it
|
|
250
|
+
through a presigned URL, and creates the campaign pointing at the file. Every
|
|
251
|
+
CSV column becomes a per-recipient template variable. Rows with no usable number
|
|
252
|
+
and repeated numbers are dropped and **counted** — `skipped` and `duplicates` —
|
|
253
|
+
rather than passed over silently.
|
|
254
|
+
|
|
255
|
+
`createGroup` is the bucketed form: it splits recipients across channels or
|
|
256
|
+
templates, uploading one file per bucket.
|
|
257
|
+
|
|
258
|
+
```ts
|
|
259
|
+
await crm.campaigns.createGroup({
|
|
260
|
+
name: 'Diwali offer',
|
|
261
|
+
distributeBy: 'channel',
|
|
262
|
+
buckets: [
|
|
263
|
+
{ channel: channelA, audience: { rows: north, recipientColumn: 'phone' } },
|
|
264
|
+
{ channel: channelB, audience: { rows: south, recipientColumn: 'phone' } },
|
|
265
|
+
],
|
|
266
|
+
messages: [{ channel: { id: channelA }, message: template }],
|
|
267
|
+
});
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Note that `campaign.receivers` is `0` on a campaign you just created: the
|
|
271
|
+
audience is resolved when the campaign sends, not when it is built. The
|
|
272
|
+
`receivers` on the result is the count written into the file, and it is the one
|
|
273
|
+
to show a user.
|
|
274
|
+
|
|
275
|
+
| Resource | Page | Actions |
|
|
276
|
+
| --- | --- | --- |
|
|
277
|
+
| `crm.campaigns` | [campaigns](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/campaign/campaigns.md) | `list` `get` `create` `createBulk` `createGroup` `uploadReceivers` `update` `schedule` `cancel` `delete` |
|
|
278
|
+
| `crm.campaignReports` | [campaigns](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/campaign/campaigns.md#campaign-reports) | `list` `getByCampaign` |
|
|
279
|
+
| `crm.campaignReportExports` | [campaigns](https://github.com/udghatan-dev/crm-sdk/blob/main/packages/sdk-js/docs/campaign/campaigns.md#campaign-reports) | `list` `get` `create` |
|
|
280
|
+
|
|
281
|
+
The audience helpers are exported too, so a UI can show "12,480 recipients, 3
|
|
282
|
+
duplicates dropped" before anything is uploaded:
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
import { parseDelimited, resolveAudience } from 'ab-ecosystem-cpass';
|
|
286
|
+
|
|
287
|
+
const { headers } = parseDelimited(text);
|
|
288
|
+
const { receivers, skipped, duplicates } = resolveAudience({ csv: text, recipientColumn });
|
|
289
|
+
```
|
|
290
|
+
|
package/dist/client.d.ts
CHANGED
|
@@ -8,12 +8,18 @@ import { CrmTriggers } from './resources/audience/crm-triggers';
|
|
|
8
8
|
import { Imports } from './resources/audience/import-history';
|
|
9
9
|
import { Exports } from './resources/audience/export-history';
|
|
10
10
|
import { Webhooks } from './resources/audience/webhooks';
|
|
11
|
+
import { ScheduledMessages } from './resources/audience/scheduled-messages';
|
|
12
|
+
import { InboxMedia } from './resources/audience/inbox-media';
|
|
13
|
+
import { Notifications } from './resources/audience/notifications';
|
|
11
14
|
import { Channels } from './resources/channels/channels';
|
|
12
15
|
import { Templates } from './resources/channels/templates';
|
|
13
16
|
import { ChannelWebhooks } from './resources/channels/webhooks';
|
|
14
17
|
import { Billing } from './resources/channels/billing';
|
|
15
18
|
import { Wallet } from './resources/channels/wallet';
|
|
16
19
|
import { Activity } from './resources/channels/activity';
|
|
20
|
+
import { Campaigns } from './resources/campaigns';
|
|
21
|
+
import { CampaignReports } from './resources/campaign-reports';
|
|
22
|
+
import { CampaignReportExports } from './resources/campaign-report-exports';
|
|
17
23
|
/**
|
|
18
24
|
* One client for the whole gateway. Construct it once and share it: it holds no
|
|
19
25
|
* per-request state, and every resource below runs over the same HTTP client,
|
|
@@ -45,6 +51,25 @@ export declare class CrmClient {
|
|
|
45
51
|
readonly exports: Exports;
|
|
46
52
|
/** Audience webhooks: subscriptions to contact events. */
|
|
47
53
|
readonly webhooks: Webhooks;
|
|
54
|
+
/**
|
|
55
|
+
* Scheduled messages: a send with a time, and a condition checked just before
|
|
56
|
+
* it goes out -- which is what lets a drip stop itself when a lead converts.
|
|
57
|
+
*/
|
|
58
|
+
readonly scheduledMessages: ScheduledMessages;
|
|
59
|
+
/**
|
|
60
|
+
* Chat media: presigned uploads straight to object storage.
|
|
61
|
+
*
|
|
62
|
+
* The only part of the inbox that is HTTP rather than socket, because an
|
|
63
|
+
* upload is a request with an answer. `upload()` returns the permanent link to
|
|
64
|
+
* pass to `inbox.messages.sendMedia()`.
|
|
65
|
+
*/
|
|
66
|
+
readonly inboxMedia: InboxMedia;
|
|
67
|
+
/**
|
|
68
|
+
* Push notification subscriptions: the browsers and apps a user wants
|
|
69
|
+
* notified. `subscribe()` after the browser hands you a Firebase registration
|
|
70
|
+
* token, `unsubscribe()` on logout.
|
|
71
|
+
*/
|
|
72
|
+
readonly notifications: Notifications;
|
|
48
73
|
/** Channels, and the provider properties that hang off them. */
|
|
49
74
|
readonly channels: Channels;
|
|
50
75
|
/** WhatsApp message templates, per channel. */
|
|
@@ -57,5 +82,18 @@ export declare class CrmClient {
|
|
|
57
82
|
readonly wallet: Wallet;
|
|
58
83
|
/** Channel activity feed. */
|
|
59
84
|
readonly activity: Activity;
|
|
85
|
+
/**
|
|
86
|
+
* Campaigns: a message sent to many people at once.
|
|
87
|
+
*
|
|
88
|
+
* `createBulk()` is the one to reach for when you hold the recipients
|
|
89
|
+
* yourself -- numbers or a CSV. It encrypts the list, uploads it, and creates
|
|
90
|
+
* the campaign pointing at the file, which is otherwise several steps a caller
|
|
91
|
+
* has to get exactly right.
|
|
92
|
+
*/
|
|
93
|
+
readonly campaigns: Campaigns;
|
|
94
|
+
/** Per-campaign delivery metrics. */
|
|
95
|
+
readonly campaignReports: CampaignReports;
|
|
96
|
+
/** Report extracts as CSV or XLSX, generated asynchronously. */
|
|
97
|
+
readonly campaignReportExports: CampaignReportExports;
|
|
60
98
|
constructor(options: ClientOptions);
|
|
61
99
|
}
|
package/dist/client.js
CHANGED
|
@@ -12,6 +12,9 @@ const crm_triggers_1 = require("./resources/audience/crm-triggers");
|
|
|
12
12
|
const import_history_1 = require("./resources/audience/import-history");
|
|
13
13
|
const export_history_1 = require("./resources/audience/export-history");
|
|
14
14
|
const webhooks_1 = require("./resources/audience/webhooks");
|
|
15
|
+
const scheduled_messages_1 = require("./resources/audience/scheduled-messages");
|
|
16
|
+
const inbox_media_1 = require("./resources/audience/inbox-media");
|
|
17
|
+
const notifications_1 = require("./resources/audience/notifications");
|
|
15
18
|
// Channels
|
|
16
19
|
const channels_1 = require("./resources/channels/channels");
|
|
17
20
|
const templates_1 = require("./resources/channels/templates");
|
|
@@ -19,11 +22,10 @@ const webhooks_2 = require("./resources/channels/webhooks");
|
|
|
19
22
|
const billing_1 = require("./resources/channels/billing");
|
|
20
23
|
const wallet_1 = require("./resources/channels/wallet");
|
|
21
24
|
const activity_1 = require("./resources/channels/activity");
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// import { CampaignReportExports } from './resources/campaign-report-exports';
|
|
25
|
+
// Campaign
|
|
26
|
+
const campaigns_1 = require("./resources/campaigns");
|
|
27
|
+
const campaign_reports_1 = require("./resources/campaign-reports");
|
|
28
|
+
const campaign_report_exports_1 = require("./resources/campaign-report-exports");
|
|
27
29
|
/**
|
|
28
30
|
* One client for the whole gateway. Construct it once and share it: it holds no
|
|
29
31
|
* per-request state, and every resource below runs over the same HTTP client,
|
|
@@ -56,6 +58,25 @@ class CrmClient {
|
|
|
56
58
|
exports;
|
|
57
59
|
/** Audience webhooks: subscriptions to contact events. */
|
|
58
60
|
webhooks;
|
|
61
|
+
/**
|
|
62
|
+
* Scheduled messages: a send with a time, and a condition checked just before
|
|
63
|
+
* it goes out -- which is what lets a drip stop itself when a lead converts.
|
|
64
|
+
*/
|
|
65
|
+
scheduledMessages;
|
|
66
|
+
/**
|
|
67
|
+
* Chat media: presigned uploads straight to object storage.
|
|
68
|
+
*
|
|
69
|
+
* The only part of the inbox that is HTTP rather than socket, because an
|
|
70
|
+
* upload is a request with an answer. `upload()` returns the permanent link to
|
|
71
|
+
* pass to `inbox.messages.sendMedia()`.
|
|
72
|
+
*/
|
|
73
|
+
inboxMedia;
|
|
74
|
+
/**
|
|
75
|
+
* Push notification subscriptions: the browsers and apps a user wants
|
|
76
|
+
* notified. `subscribe()` after the browser hands you a Firebase registration
|
|
77
|
+
* token, `unsubscribe()` on logout.
|
|
78
|
+
*/
|
|
79
|
+
notifications;
|
|
59
80
|
// -- Channels -------------------------------------------------------------
|
|
60
81
|
/** Channels, and the provider properties that hang off them. */
|
|
61
82
|
channels;
|
|
@@ -69,6 +90,20 @@ class CrmClient {
|
|
|
69
90
|
wallet;
|
|
70
91
|
/** Channel activity feed. */
|
|
71
92
|
activity;
|
|
93
|
+
// -- Campaign -------------------------------------------------------------
|
|
94
|
+
/**
|
|
95
|
+
* Campaigns: a message sent to many people at once.
|
|
96
|
+
*
|
|
97
|
+
* `createBulk()` is the one to reach for when you hold the recipients
|
|
98
|
+
* yourself -- numbers or a CSV. It encrypts the list, uploads it, and creates
|
|
99
|
+
* the campaign pointing at the file, which is otherwise several steps a caller
|
|
100
|
+
* has to get exactly right.
|
|
101
|
+
*/
|
|
102
|
+
campaigns;
|
|
103
|
+
/** Per-campaign delivery metrics. */
|
|
104
|
+
campaignReports;
|
|
105
|
+
/** Report extracts as CSV or XLSX, generated asynchronously. */
|
|
106
|
+
campaignReportExports;
|
|
72
107
|
constructor(options) {
|
|
73
108
|
const http = new http_1.HttpClient(options);
|
|
74
109
|
this.contacts = new contacts_1.Contacts(http);
|
|
@@ -80,12 +115,21 @@ class CrmClient {
|
|
|
80
115
|
this.imports = new import_history_1.Imports(http);
|
|
81
116
|
this.exports = new export_history_1.Exports(http);
|
|
82
117
|
this.webhooks = new webhooks_1.Webhooks(http);
|
|
118
|
+
this.scheduledMessages = new scheduled_messages_1.ScheduledMessages(http);
|
|
119
|
+
this.inboxMedia = new inbox_media_1.InboxMedia(http);
|
|
120
|
+
this.notifications = new notifications_1.Notifications(http);
|
|
83
121
|
this.channels = new channels_1.Channels(http);
|
|
84
122
|
this.templates = new templates_1.Templates(http);
|
|
85
123
|
this.channelWebhooks = new webhooks_2.ChannelWebhooks(http);
|
|
86
124
|
this.billing = new billing_1.Billing(http);
|
|
87
125
|
this.wallet = new wallet_1.Wallet(http);
|
|
88
126
|
this.activity = new activity_1.Activity(http);
|
|
127
|
+
// Campaigns build their own uploader over the same HTTP client: a bulk
|
|
128
|
+
// audience is uploaded through the media endpoint before the campaign is
|
|
129
|
+
// created.
|
|
130
|
+
this.campaigns = new campaigns_1.Campaigns(http);
|
|
131
|
+
this.campaignReports = new campaign_reports_1.CampaignReports(http);
|
|
132
|
+
this.campaignReportExports = new campaign_report_exports_1.CampaignReportExports(http);
|
|
89
133
|
}
|
|
90
134
|
}
|
|
91
135
|
exports.CrmClient = CrmClient;
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,iCAAwD;AAExD,WAAW;AACX,4DAAyD;AACzD,oEAAgE;AAChE,sEAAkE;AAClE,sEAAkE;AAClE,4DAAyD;AACzD,oEAAgE;AAChE,wEAA8D;AAC9D,wEAA8D;AAC9D,4DAAyD;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,iCAAwD;AAExD,WAAW;AACX,4DAAyD;AACzD,oEAAgE;AAChE,sEAAkE;AAClE,sEAAkE;AAClE,4DAAyD;AACzD,oEAAgE;AAChE,wEAA8D;AAC9D,wEAA8D;AAC9D,4DAAyD;AACzD,gFAA4E;AAC5E,kEAA8D;AAC9D,sEAAmE;AAEnE,WAAW;AACX,4DAAyD;AACzD,8DAA2D;AAC3D,4DAAgE;AAChE,0DAAuD;AACvD,wDAAqD;AACrD,4DAAyD;AAEzD,WAAW;AACX,qDAAkD;AAClD,mEAA+D;AAC/D,iFAA4E;AAE5E;;;;;;;;;;;GAWG;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readonly options;
|
|
33
33
|
private readonly gatewayUrl;
|
|
34
34
|
constructor(options: ClientOptions);
|
|
35
|
+
/**
|
|
36
|
+
* The fetch this client was built with, bound to the global object.
|
|
37
|
+
*
|
|
38
|
+
* Exposed for the one call that must not go through `request`: a presigned
|
|
39
|
+
* upload goes straight to object storage, and sending our bearer token or an
|
|
40
|
+
* extra header with it would both leak the credential to a third party and
|
|
41
|
+
* break a signature that covers exactly the headers it was issued for.
|
|
42
|
+
*
|
|
43
|
+
* Bound, and that is not tidiness. A browser's `fetch` is a method of `Window`
|
|
44
|
+
* and refuses any other receiver -- so reading it off this getter and calling it
|
|
45
|
+
* as `client.fetchImpl(url)` invokes it with the `HttpClient` as `this` and
|
|
46
|
+
* fails with `Illegal invocation`. Binding here makes the property safe to call
|
|
47
|
+
* however it is reached, rather than leaving every call site to remember.
|
|
48
|
+
*/
|
|
49
|
+
get fetchImpl(): typeof fetch;
|
|
35
50
|
/** Resolves the bearer token, failing here rather than sending an unauthenticated call. */
|
|
36
51
|
private token;
|
|
37
52
|
request<T>(method: string, path: string, init?: RequestInitOptions): Promise<T>;
|
package/dist/http.js
CHANGED
|
@@ -30,6 +30,24 @@ class HttpClient {
|
|
|
30
30
|
}
|
|
31
31
|
this.gatewayUrl = options.gatewayUrl.trim().replace(/\/+$/, '');
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* The fetch this client was built with, bound to the global object.
|
|
35
|
+
*
|
|
36
|
+
* Exposed for the one call that must not go through `request`: a presigned
|
|
37
|
+
* upload goes straight to object storage, and sending our bearer token or an
|
|
38
|
+
* extra header with it would both leak the credential to a third party and
|
|
39
|
+
* break a signature that covers exactly the headers it was issued for.
|
|
40
|
+
*
|
|
41
|
+
* Bound, and that is not tidiness. A browser's `fetch` is a method of `Window`
|
|
42
|
+
* and refuses any other receiver -- so reading it off this getter and calling it
|
|
43
|
+
* as `client.fetchImpl(url)` invokes it with the `HttpClient` as `this` and
|
|
44
|
+
* fails with `Illegal invocation`. Binding here makes the property safe to call
|
|
45
|
+
* however it is reached, rather than leaving every call site to remember.
|
|
46
|
+
*/
|
|
47
|
+
get fetchImpl() {
|
|
48
|
+
const impl = this.options.fetch;
|
|
49
|
+
return impl ? impl.bind(globalThis) : fetch.bind(globalThis);
|
|
50
|
+
}
|
|
33
51
|
/** Resolves the bearer token, failing here rather than sending an unauthenticated call. */
|
|
34
52
|
async token() {
|
|
35
53
|
const token = typeof this.options.authToken === 'function'
|
|
@@ -48,7 +66,9 @@ class HttpClient {
|
|
|
48
66
|
url.searchParams.set(key, queryValue(value));
|
|
49
67
|
}
|
|
50
68
|
const origin = this.options.origin ?? browserOrigin();
|
|
51
|
-
|
|
69
|
+
// Bound for the same reason as `fetchImpl`: a detached `fetch` must still be
|
|
70
|
+
// called with the global as its receiver.
|
|
71
|
+
const send = this.fetchImpl;
|
|
52
72
|
const response = await send(url.toString(), {
|
|
53
73
|
method,
|
|
54
74
|
headers: {
|
package/dist/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":";;;AAAA,qCAAuD;AAkCvD;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAc,EAAU,EAAE,CAC5C,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAEpE,MAAM,aAAa,GAAG,GAAuB,EAAE,CAC7C,OAAO,UAAU,KAAK,WAAW;IACjC,OAAQ,UAAiD,CAAC,QAAQ,EAAE,MAAM,KAAK,QAAQ;IACrF,CAAC,CAAE,UAA0D,CAAC,QAAQ,CAAC,MAAM;IAC7E,CAAC,CAAC,SAAS,CAAC;AAEhB,MAAa,UAAU;IAGQ;IAFZ,UAAU,CAAS;IAEpC,YAA6B,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;QACjD,IA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AAM,CAAC;SAC9D,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE;YAAE,MAAM,MAAM,oBAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACjE,OAAO,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAM,CAAC;IAC5E,CAAC;CACF;AA5ED,gCA4EC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,17 @@ export { CrmTriggers } from './resources/audience/crm-triggers';
|
|
|
12
12
|
export { Imports } from './resources/audience/import-history';
|
|
13
13
|
export { Exports } from './resources/audience/export-history';
|
|
14
14
|
export { Webhooks } from './resources/audience/webhooks';
|
|
15
|
+
export { Notifications } from './resources/audience/notifications';
|
|
16
|
+
export { InboxMedia, type UploadMediaOptions, type UploadMediaSource, } from './resources/audience/inbox-media';
|
|
17
|
+
export { Campaigns, type CreateBulkCampaignInput, type BulkCampaignResult, type CreateGroupCampaignInput, type GroupBucket, type GroupBucketResult, type GroupCampaignResult, type ReceiverUploader, } from './resources/campaigns';
|
|
18
|
+
export { CampaignReports } from './resources/campaign-reports';
|
|
19
|
+
export { CampaignReportExports } from './resources/campaign-report-exports';
|
|
20
|
+
/**
|
|
21
|
+
* The audience helpers, exported because they are useful before a campaign
|
|
22
|
+
* exists: a UI can parse a CSV, show "12,480 recipients, 3 duplicates dropped",
|
|
23
|
+
* and let someone confirm before anything is uploaded.
|
|
24
|
+
*/
|
|
25
|
+
export { MAX_BULK_RECEIVERS, buildReceivers, normaliseColumn, normaliseNumbers, parseDelimited, resolveAudience, type BulkAudienceInput, type CampaignReceiver, type ResolvedAudience, } from './resources/campaign-audience';
|
|
15
26
|
export { Channels, type SetPropOptions } from './resources/channels/channels';
|
|
16
27
|
export { Templates } from './resources/channels/templates';
|
|
17
28
|
export { ChannelWebhooks } from './resources/channels/webhooks';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Activity = exports.Wallet = exports.Billing = exports.ChannelWebhooks = exports.Templates = exports.Channels = exports.Webhooks = exports.Exports = exports.Imports = exports.CrmTriggers = exports.Segments = exports.CustomFields = exports.ContactNotes = exports.ContactTags = exports.Contacts = exports.CHANNELS = exports.AUDIENCE = void 0;
|
|
17
|
+
exports.Activity = exports.Wallet = exports.Billing = exports.ChannelWebhooks = exports.Templates = exports.Channels = exports.resolveAudience = exports.parseDelimited = exports.normaliseNumbers = exports.normaliseColumn = exports.buildReceivers = exports.MAX_BULK_RECEIVERS = exports.CampaignReportExports = exports.CampaignReports = exports.Campaigns = exports.InboxMedia = exports.Notifications = exports.Webhooks = exports.Exports = exports.Imports = exports.CrmTriggers = exports.Segments = exports.CustomFields = exports.ContactNotes = exports.ContactTags = exports.Contacts = exports.CHANNELS = exports.AUDIENCE = void 0;
|
|
18
18
|
__exportStar(require("./client"), exports);
|
|
19
19
|
__exportStar(require("./http"), exports);
|
|
20
20
|
__exportStar(require("./errors"), exports);
|
|
@@ -41,6 +41,29 @@ var export_history_1 = require("./resources/audience/export-history");
|
|
|
41
41
|
Object.defineProperty(exports, "Exports", { enumerable: true, get: function () { return export_history_1.Exports; } });
|
|
42
42
|
var webhooks_1 = require("./resources/audience/webhooks");
|
|
43
43
|
Object.defineProperty(exports, "Webhooks", { enumerable: true, get: function () { return webhooks_1.Webhooks; } });
|
|
44
|
+
var notifications_1 = require("./resources/audience/notifications");
|
|
45
|
+
Object.defineProperty(exports, "Notifications", { enumerable: true, get: function () { return notifications_1.Notifications; } });
|
|
46
|
+
var inbox_media_1 = require("./resources/audience/inbox-media");
|
|
47
|
+
Object.defineProperty(exports, "InboxMedia", { enumerable: true, get: function () { return inbox_media_1.InboxMedia; } });
|
|
48
|
+
// Campaign
|
|
49
|
+
var campaigns_1 = require("./resources/campaigns");
|
|
50
|
+
Object.defineProperty(exports, "Campaigns", { enumerable: true, get: function () { return campaigns_1.Campaigns; } });
|
|
51
|
+
var campaign_reports_1 = require("./resources/campaign-reports");
|
|
52
|
+
Object.defineProperty(exports, "CampaignReports", { enumerable: true, get: function () { return campaign_reports_1.CampaignReports; } });
|
|
53
|
+
var campaign_report_exports_1 = require("./resources/campaign-report-exports");
|
|
54
|
+
Object.defineProperty(exports, "CampaignReportExports", { enumerable: true, get: function () { return campaign_report_exports_1.CampaignReportExports; } });
|
|
55
|
+
/**
|
|
56
|
+
* The audience helpers, exported because they are useful before a campaign
|
|
57
|
+
* exists: a UI can parse a CSV, show "12,480 recipients, 3 duplicates dropped",
|
|
58
|
+
* and let someone confirm before anything is uploaded.
|
|
59
|
+
*/
|
|
60
|
+
var campaign_audience_1 = require("./resources/campaign-audience");
|
|
61
|
+
Object.defineProperty(exports, "MAX_BULK_RECEIVERS", { enumerable: true, get: function () { return campaign_audience_1.MAX_BULK_RECEIVERS; } });
|
|
62
|
+
Object.defineProperty(exports, "buildReceivers", { enumerable: true, get: function () { return campaign_audience_1.buildReceivers; } });
|
|
63
|
+
Object.defineProperty(exports, "normaliseColumn", { enumerable: true, get: function () { return campaign_audience_1.normaliseColumn; } });
|
|
64
|
+
Object.defineProperty(exports, "normaliseNumbers", { enumerable: true, get: function () { return campaign_audience_1.normaliseNumbers; } });
|
|
65
|
+
Object.defineProperty(exports, "parseDelimited", { enumerable: true, get: function () { return campaign_audience_1.parseDelimited; } });
|
|
66
|
+
Object.defineProperty(exports, "resolveAudience", { enumerable: true, get: function () { return campaign_audience_1.resolveAudience; } });
|
|
44
67
|
// Channels
|
|
45
68
|
var channels_1 = require("./resources/channels/channels");
|
|
46
69
|
Object.defineProperty(exports, "Channels", { enumerable: true, get: function () { return channels_1.Channels; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB;AACzB,0CAAwB;AAExB,2CAAuD;AAA9C,iGAAA,QAAQ,OAAA;AAAE,iGAAA,QAAQ,OAAA;AAE3B,WAAW;AACX,0DAAyD;AAAhD,oGAAA,QAAQ,OAAA;AACjB,kEAAgE;AAAvD,2GAAA,WAAW,OAAA;AACpB,oEAAkE;AAAzD,6GAAA,YAAY,OAAA;AACrB,oEAAkE;AAAzD,6GAAA,YAAY,OAAA;AACrB,0DAAyD;AAAhD,oGAAA,QAAQ,OAAA;AACjB,kEAAgE;AAAvD,2GAAA,WAAW,OAAA;AACpB,sEAA8D;AAArD,yGAAA,OAAO,OAAA;AAChB,sEAA8D;AAArD,yGAAA,OAAO,OAAA;AAChB,0DAAyD;AAAhD,oGAAA,QAAQ,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB;AACzB,0CAAwB;AAExB,2CAAuD;AAA9C,iGAAA,QAAQ,OAAA;AAAE,iGAAA,QAAQ,OAAA;AAE3B,WAAW;AACX,0DAAyD;AAAhD,oGAAA,QAAQ,OAAA;AACjB,kEAAgE;AAAvD,2GAAA,WAAW,OAAA;AACpB,oEAAkE;AAAzD,6GAAA,YAAY,OAAA;AACrB,oEAAkE;AAAzD,6GAAA,YAAY,OAAA;AACrB,0DAAyD;AAAhD,oGAAA,QAAQ,OAAA;AACjB,kEAAgE;AAAvD,2GAAA,WAAW,OAAA;AACpB,sEAA8D;AAArD,yGAAA,OAAO,OAAA;AAChB,sEAA8D;AAArD,yGAAA,OAAO,OAAA;AAChB,0DAAyD;AAAhD,oGAAA,QAAQ,OAAA;AACjB,oEAAmE;AAA1D,8GAAA,aAAa,OAAA;AACtB,gEAI0C;AAHxC,yGAAA,UAAU,OAAA;AAKZ,WAAW;AACX,mDAS+B;AAR7B,sGAAA,SAAS,OAAA;AASX,iEAA+D;AAAtD,mHAAA,eAAe,OAAA;AACxB,+EAA4E;AAAnE,gIAAA,qBAAqB,OAAA;AAC9B;;;;GAIG;AACH,mEAUuC;AATrC,uHAAA,kBAAkB,OAAA;AAClB,mHAAA,cAAc,OAAA;AACd,oHAAA,eAAe,OAAA;AACf,qHAAA,gBAAgB,OAAA;AAChB,mHAAA,cAAc,OAAA;AACd,oHAAA,eAAe,OAAA;AAMjB,WAAW;AACX,0DAA8E;AAArE,oGAAA,QAAQ,OAAA;AACjB,4DAA2D;AAAlD,sGAAA,SAAS,OAAA;AAClB,0DAAgE;AAAvD,2GAAA,eAAe,OAAA;AACxB,wDAAuD;AAA9C,kGAAA,OAAO,OAAA;AAChB,sDAAqD;AAA5C,gGAAA,MAAM,OAAA;AACf,0DAAyD;AAAhD,oGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Byte and text conversions, written out rather than taken from a platform.
|
|
3
|
+
*
|
|
4
|
+
* This SDK runs in a browser and in Node, and the obvious helpers differ between
|
|
5
|
+
* them: `btoa` is browser-first and deprecated in Node, `Buffer` does not exist
|
|
6
|
+
* in a browser, and feature-detecting between the two puts an environment branch
|
|
7
|
+
* in the middle of something that has to produce identical bytes everywhere.
|
|
8
|
+
* These are a few lines each and have no such branch.
|
|
9
|
+
*/
|
|
10
|
+
/** UTF-8 bytes of a string. `TextEncoder` is global in Node 18+ and every browser. */
|
|
11
|
+
export declare const utf8: (value: string) => Uint8Array;
|
|
12
|
+
/**
|
|
13
|
+
* A standalone `ArrayBuffer` holding a copy of these bytes.
|
|
14
|
+
*
|
|
15
|
+
* Web Crypto takes `BufferSource`, and a `Uint8Array` is not always one as far as
|
|
16
|
+
* the type system is concerned: since TypeScript 5.7 the array is generic in its
|
|
17
|
+
* backing buffer, and the `ArrayBufferLike` that `TextEncoder` hands back could
|
|
18
|
+
* in principle be a `SharedArrayBuffer`, which `BufferSource` excludes. Copying
|
|
19
|
+
* into a buffer of known provenance settles it without an assertion, and without
|
|
20
|
+
* putting a generic type parameter into the emitted declarations -- which would
|
|
21
|
+
* make this package fail to typecheck for anyone on an older compiler.
|
|
22
|
+
*/
|
|
23
|
+
export declare const toArrayBuffer: (bytes: Uint8Array) => ArrayBuffer;
|
|
24
|
+
/** Standard base64, with padding -- the form `CryptoJS`'s default formatter emits. */
|
|
25
|
+
export declare const toBase64: (bytes: Uint8Array) => string;
|
|
26
|
+
/** Lower-case hex, two characters per byte. */
|
|
27
|
+
export declare const toHex: (bytes: Uint8Array) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Cryptographically random bytes.
|
|
30
|
+
*
|
|
31
|
+
* `crypto.getRandomValues` is the one API that is present and seeded properly in
|
|
32
|
+
* both environments -- global in Node 18+ and in browsers. `Math.random` is not
|
|
33
|
+
* an acceptable substitute here: the value it would produce is the key under
|
|
34
|
+
* which a customer's phone numbers are encrypted.
|
|
35
|
+
*/
|
|
36
|
+
export declare const randomBytes: (length: number) => Uint8Array;
|
|
37
|
+
/** Web Crypto, or a clear error naming what is missing rather than a `TypeError`. */
|
|
38
|
+
export declare const subtle: () => SubtleCrypto;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Byte and text conversions, written out rather than taken from a platform.
|
|
4
|
+
*
|
|
5
|
+
* This SDK runs in a browser and in Node, and the obvious helpers differ between
|
|
6
|
+
* them: `btoa` is browser-first and deprecated in Node, `Buffer` does not exist
|
|
7
|
+
* in a browser, and feature-detecting between the two puts an environment branch
|
|
8
|
+
* in the middle of something that has to produce identical bytes everywhere.
|
|
9
|
+
* These are a few lines each and have no such branch.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.subtle = exports.randomBytes = exports.toHex = exports.toBase64 = exports.toArrayBuffer = exports.utf8 = void 0;
|
|
13
|
+
/** UTF-8 bytes of a string. `TextEncoder` is global in Node 18+ and every browser. */
|
|
14
|
+
const utf8 = (value) => new TextEncoder().encode(value);
|
|
15
|
+
exports.utf8 = utf8;
|
|
16
|
+
/**
|
|
17
|
+
* A standalone `ArrayBuffer` holding a copy of these bytes.
|
|
18
|
+
*
|
|
19
|
+
* Web Crypto takes `BufferSource`, and a `Uint8Array` is not always one as far as
|
|
20
|
+
* the type system is concerned: since TypeScript 5.7 the array is generic in its
|
|
21
|
+
* backing buffer, and the `ArrayBufferLike` that `TextEncoder` hands back could
|
|
22
|
+
* in principle be a `SharedArrayBuffer`, which `BufferSource` excludes. Copying
|
|
23
|
+
* into a buffer of known provenance settles it without an assertion, and without
|
|
24
|
+
* putting a generic type parameter into the emitted declarations -- which would
|
|
25
|
+
* make this package fail to typecheck for anyone on an older compiler.
|
|
26
|
+
*/
|
|
27
|
+
const toArrayBuffer = (bytes) => {
|
|
28
|
+
const buffer = new ArrayBuffer(bytes.length);
|
|
29
|
+
new Uint8Array(buffer).set(bytes);
|
|
30
|
+
return buffer;
|
|
31
|
+
};
|
|
32
|
+
exports.toArrayBuffer = toArrayBuffer;
|
|
33
|
+
const BASE64_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
34
|
+
/** Standard base64, with padding -- the form `CryptoJS`'s default formatter emits. */
|
|
35
|
+
const toBase64 = (bytes) => {
|
|
36
|
+
let out = '';
|
|
37
|
+
for (let i = 0; i < bytes.length; i += 3) {
|
|
38
|
+
const a = bytes[i];
|
|
39
|
+
const b = bytes[i + 1];
|
|
40
|
+
const c = bytes[i + 2];
|
|
41
|
+
out += BASE64_ALPHABET[a >> 2];
|
|
42
|
+
out += BASE64_ALPHABET[((a & 0x03) << 4) | ((b ?? 0) >> 4)];
|
|
43
|
+
out += b === undefined ? '=' : BASE64_ALPHABET[((b & 0x0f) << 2) | ((c ?? 0) >> 6)];
|
|
44
|
+
out += c === undefined ? '=' : BASE64_ALPHABET[c & 0x3f];
|
|
45
|
+
}
|
|
46
|
+
return out;
|
|
47
|
+
};
|
|
48
|
+
exports.toBase64 = toBase64;
|
|
49
|
+
/** Lower-case hex, two characters per byte. */
|
|
50
|
+
const toHex = (bytes) => {
|
|
51
|
+
let out = '';
|
|
52
|
+
for (const byte of bytes)
|
|
53
|
+
out += byte.toString(16).padStart(2, '0');
|
|
54
|
+
return out;
|
|
55
|
+
};
|
|
56
|
+
exports.toHex = toHex;
|
|
57
|
+
/**
|
|
58
|
+
* Cryptographically random bytes.
|
|
59
|
+
*
|
|
60
|
+
* `crypto.getRandomValues` is the one API that is present and seeded properly in
|
|
61
|
+
* both environments -- global in Node 18+ and in browsers. `Math.random` is not
|
|
62
|
+
* an acceptable substitute here: the value it would produce is the key under
|
|
63
|
+
* which a customer's phone numbers are encrypted.
|
|
64
|
+
*/
|
|
65
|
+
const randomBytes = (length) => {
|
|
66
|
+
const source = globalThis.crypto;
|
|
67
|
+
if (!source?.getRandomValues) {
|
|
68
|
+
throw new Error('No cryptographic random source: globalThis.crypto.getRandomValues is unavailable. ' +
|
|
69
|
+
'This SDK needs Node 18+ or a browser with Web Crypto.');
|
|
70
|
+
}
|
|
71
|
+
return source.getRandomValues(new Uint8Array(length));
|
|
72
|
+
};
|
|
73
|
+
exports.randomBytes = randomBytes;
|
|
74
|
+
/** Web Crypto, or a clear error naming what is missing rather than a `TypeError`. */
|
|
75
|
+
const subtle = () => {
|
|
76
|
+
const source = globalThis.crypto;
|
|
77
|
+
if (!source?.subtle) {
|
|
78
|
+
throw new Error('Web Crypto is unavailable: globalThis.crypto.subtle is missing. ' +
|
|
79
|
+
'Encrypting campaign receivers needs Node 18+ or a secure browser context (https or localhost).');
|
|
80
|
+
}
|
|
81
|
+
return source.subtle;
|
|
82
|
+
};
|
|
83
|
+
exports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