@bodhveda/js 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +116 -2
- package/dist/cjs/bodhveda.d.ts +82 -1
- package/dist/cjs/bodhveda.d.ts.map +1 -1
- package/dist/cjs/bodhveda.js +44 -0
- package/dist/cjs/bodhveda.js.map +1 -1
- package/dist/cjs/routes.d.ts +10 -0
- package/dist/cjs/routes.d.ts.map +1 -1
- package/dist/cjs/routes.js +12 -0
- package/dist/cjs/routes.js.map +1 -1
- package/dist/cjs/types.d.ts +145 -7
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/bodhveda.d.ts +82 -1
- package/dist/esm/bodhveda.d.ts.map +1 -1
- package/dist/esm/bodhveda.js +44 -0
- package/dist/esm/bodhveda.js.map +1 -1
- package/dist/esm/routes.d.ts +10 -0
- package/dist/esm/routes.d.ts.map +1 -1
- package/dist/esm/routes.js +12 -0
- package/dist/esm/routes.js.map +1 -1
- package/dist/esm/types.d.ts +145 -7
- package/dist/esm/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ It offers a simpler way to work with Bodhveda APIs in both browser and server en
|
|
|
13
13
|
- [Recipient Notifications](#recipient-notifications)
|
|
14
14
|
- [Recipient Preferences](#recipient-preferences)
|
|
15
15
|
- [Recipient Contacts](#recipient-contacts)
|
|
16
|
+
- [Project Preferences](#project-preferences)
|
|
16
17
|
- [License](#license)
|
|
17
18
|
|
|
18
19
|
## Installation
|
|
@@ -63,7 +64,7 @@ Bodhveda does no templating: you render the subject/HTML/text yourself (e.g. wit
|
|
|
63
64
|
|
|
64
65
|
Email fires only when the `(target, email)` pair is cataloged, the recipient's email
|
|
65
66
|
preference is enabled, and the recipient has a primary email
|
|
66
|
-
[contact](#recipient-contacts).
|
|
67
|
+
[contact](#recipient-contacts).
|
|
67
68
|
|
|
68
69
|
```typescript
|
|
69
70
|
const res = await bodhveda.notifications.send({
|
|
@@ -75,7 +76,23 @@ const res = await bodhveda.notifications.send({
|
|
|
75
76
|
html: "<h1>Your daily digest</h1><p>3 new follow-ups today.</p>",
|
|
76
77
|
},
|
|
77
78
|
});
|
|
78
|
-
// res.notification
|
|
79
|
+
// res.notification.id — the send is accepted (status "enqueued"); the email is
|
|
80
|
+
// resolved asynchronously. Read the outcome back with notifications.get() below.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Get a notification (check the outcome)
|
|
84
|
+
|
|
85
|
+
The send is **asynchronous**: it accepts the notification and returns its id
|
|
86
|
+
(`status: "enqueued"`), then the worker resolves in-app delivery and the email.
|
|
87
|
+
Fetch the notification by id to see the resolved in-app `status` and, when the send
|
|
88
|
+
included an `email` block, the email delivery outcome on `notification.email`.
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
const notification = await bodhveda.notifications.get(res.notification!.id);
|
|
92
|
+
|
|
93
|
+
notification.status; // "delivered" | "muted" | "quota_exceeded" | "failed" | "enqueued"
|
|
94
|
+
notification.email?.status; // "pending" | "sent" | "delivered" | "bounced" | ...
|
|
95
|
+
notification.email?.delivered_at;
|
|
79
96
|
```
|
|
80
97
|
|
|
81
98
|
---
|
|
@@ -231,6 +248,25 @@ await bodhveda.recipients.contacts.create("user-123", {
|
|
|
231
248
|
});
|
|
232
249
|
```
|
|
233
250
|
|
|
251
|
+
`create` is strict — it rejects with a `409` when the contact already exists. To
|
|
252
|
+
keep a recipient's primary address current from a server without a
|
|
253
|
+
list-then-diff, use `setPrimary` instead.
|
|
254
|
+
|
|
255
|
+
### Set the primary contact
|
|
256
|
+
|
|
257
|
+
Idempotently ensure an address is the recipient's **primary** contact for a
|
|
258
|
+
medium — create it if absent, update the existing primary in place if the
|
|
259
|
+
address differs (which resets verification), or no-op if it already matches.
|
|
260
|
+
Returns the resulting primary contact (`200`) in every case, so a "keep the
|
|
261
|
+
primary email current" sync is a single call.
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
await bodhveda.recipients.contacts.setPrimary("user-123", {
|
|
265
|
+
medium: "email",
|
|
266
|
+
address: "alice@example.com",
|
|
267
|
+
});
|
|
268
|
+
```
|
|
269
|
+
|
|
234
270
|
### List contacts
|
|
235
271
|
|
|
236
272
|
```typescript
|
|
@@ -255,6 +291,84 @@ await bodhveda.recipients.contacts.delete("user-123", 1);
|
|
|
255
291
|
|
|
256
292
|
---
|
|
257
293
|
|
|
294
|
+
## Project Preferences
|
|
295
|
+
|
|
296
|
+
The **project preference catalog** declares which `(target, medium)` pairs your
|
|
297
|
+
project may send, and the default a recipient inherits until they set a
|
|
298
|
+
preference of their own. This is different from
|
|
299
|
+
[Recipient Preferences](#recipient-preferences), which are a single recipient's
|
|
300
|
+
own toggles — manage the catalog with `bodhveda.preferences`.
|
|
301
|
+
|
|
302
|
+
Requires a `Full access` API key, and is a **server-side** concern. The project
|
|
303
|
+
is taken from the API key.
|
|
304
|
+
|
|
305
|
+
### List the catalog
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
const catalog = await bodhveda.preferences.list();
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Create a catalog entry
|
|
312
|
+
|
|
313
|
+
Strict — rejects with a `409` when an entry for the same
|
|
314
|
+
`(channel, topic, event, medium)` already exists. `medium` defaults to `in_app`
|
|
315
|
+
when omitted.
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
const entry = await bodhveda.preferences.create({
|
|
319
|
+
channel: "digest",
|
|
320
|
+
topic: "none",
|
|
321
|
+
event: "sent",
|
|
322
|
+
medium: "email",
|
|
323
|
+
name: "Daily digest",
|
|
324
|
+
description: "Receive a daily summary of activity.",
|
|
325
|
+
default_enabled: true,
|
|
326
|
+
});
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Get / update / delete an entry
|
|
330
|
+
|
|
331
|
+
The natural key (`channel`/`topic`/`event`/`medium`) is immutable — `update`
|
|
332
|
+
changes only the name, description and default.
|
|
333
|
+
|
|
334
|
+
```typescript
|
|
335
|
+
const entry = await bodhveda.preferences.get(123);
|
|
336
|
+
|
|
337
|
+
await bodhveda.preferences.update(123, {
|
|
338
|
+
name: "Weekly digest",
|
|
339
|
+
description: "Receive a weekly summary of activity.",
|
|
340
|
+
default_enabled: false,
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
// Un-catalogs the (target, medium).
|
|
344
|
+
await bodhveda.preferences.delete(123);
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Set up a whole catalog at once
|
|
348
|
+
|
|
349
|
+
`upsertMany` declaratively merges an entire catalog in one call — the primitive
|
|
350
|
+
for a one-off "set up my project's preferences" script. Each item is upserted by
|
|
351
|
+
its natural key (new inserted, existing name + description + default updated).
|
|
352
|
+
Entries **not** in the array are left untouched.
|
|
353
|
+
|
|
354
|
+
```typescript
|
|
355
|
+
await bodhveda.preferences.upsertMany([
|
|
356
|
+
{ channel: "digest", topic: "none", event: "sent", medium: "email", name: "Daily digest", default_enabled: true },
|
|
357
|
+
{ channel: "posts", topic: "any", event: "new_comment", medium: "email", name: "Comments", default_enabled: true },
|
|
358
|
+
]);
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Pass `{ prune: true }` to also **delete** entries absent from the array, making
|
|
362
|
+
it the entire desired catalog. Pruning un-catalogs a `(target, medium)`, which
|
|
363
|
+
turns a non-`in_app` medium off for recipients relying on the catalog default —
|
|
364
|
+
so it is opt-in.
|
|
365
|
+
|
|
366
|
+
```typescript
|
|
367
|
+
await bodhveda.preferences.upsertMany(desiredCatalog, { prune: true });
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
258
372
|
## License
|
|
259
373
|
|
|
260
374
|
MIT
|
package/dist/cjs/bodhveda.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ListNotificationsResponse, ListNotificationsRequest, ListPreferencesResponse, SetPreferenceRequest, SetPreferenceResponse, UnreadCountResponse, UpdateNotificationsStateResponse, UpdateNotificationsStateRequest, DeleteNotificationsRequest, DeleteNotificationsResponse, CheckPreferenceRequest, CheckPreferenceResponse, SendNotificationRequest, SendNotificationResponse, CreateRecipientRequest, CreateRecipientResponse, CreateRecipientsBatchRequest, CreateRecipientsBatchResponse, GetRecipientResponse, UpdateRecipientRequest, UpdateRecipientResponse, CreateRecipientContactRequest, CreateRecipientContactResponse, ListRecipientContactsResponse, UpdateRecipientContactRequest, UpdateRecipientContactResponse } from "./types";
|
|
1
|
+
import { ListNotificationsResponse, ListNotificationsRequest, ListPreferencesResponse, SetPreferenceRequest, SetPreferenceResponse, UnreadCountResponse, UpdateNotificationsStateResponse, UpdateNotificationsStateRequest, DeleteNotificationsRequest, DeleteNotificationsResponse, CheckPreferenceRequest, CheckPreferenceResponse, SendNotificationRequest, SendNotificationResponse, GetNotificationResponse, CreateRecipientRequest, CreateRecipientResponse, CreateRecipientsBatchRequest, CreateRecipientsBatchResponse, GetRecipientResponse, UpdateRecipientRequest, UpdateRecipientResponse, CreateRecipientContactRequest, CreateRecipientContactResponse, ListRecipientContactsResponse, UpdateRecipientContactRequest, UpdateRecipientContactResponse, SetPrimaryContactRequest, SetPrimaryContactResponse, ProjectPreference, CreateProjectPreferenceRequest, UpdateProjectPreferenceRequest, UpsertProjectPreferenceItem, UpsertProjectPreferencesOptions } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Options for configuring the Bodhveda SDK.
|
|
4
4
|
*/
|
|
@@ -17,6 +17,12 @@ interface BodhvedaClient {
|
|
|
17
17
|
* Provides access to recipient-related methods.
|
|
18
18
|
*/
|
|
19
19
|
recipients: RecipientsClient;
|
|
20
|
+
/**
|
|
21
|
+
* Provides access to the project preference CATALOG (project-scoped by the
|
|
22
|
+
* API key). Distinct from `recipients.preferences`, which manages a single
|
|
23
|
+
* recipient's own toggles.
|
|
24
|
+
*/
|
|
25
|
+
preferences: ProjectPreferencesClient;
|
|
20
26
|
}
|
|
21
27
|
/**
|
|
22
28
|
* Main class for initializing and interacting with the Bodhveda SDK.
|
|
@@ -24,6 +30,7 @@ interface BodhvedaClient {
|
|
|
24
30
|
export declare class Bodhveda implements BodhvedaClient {
|
|
25
31
|
notifications: NotificationsClient;
|
|
26
32
|
recipients: RecipientsClient;
|
|
33
|
+
preferences: ProjectPreferencesClient;
|
|
27
34
|
/**
|
|
28
35
|
* Creates an instance of the Bodhveda SDK.
|
|
29
36
|
* @param apiKey - The API key for authentication.
|
|
@@ -41,6 +48,15 @@ interface NotificationsClient {
|
|
|
41
48
|
* @returns The response from the API.
|
|
42
49
|
*/
|
|
43
50
|
send(req: SendNotificationRequest): Promise<SendNotificationResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves a single notification by its id. The send API is asynchronous and
|
|
53
|
+
* returns a notification id after accepting the send (status `enqueued`); use
|
|
54
|
+
* this to read back the resolved in-app status and, when the send included an
|
|
55
|
+
* email block, the email delivery outcome ({@link Notification.email}).
|
|
56
|
+
* @param notificationID - The notification id returned by {@link send}.
|
|
57
|
+
* @returns The notification with its resolved status and email outcome.
|
|
58
|
+
*/
|
|
59
|
+
get(notificationID: number): Promise<GetNotificationResponse>;
|
|
44
60
|
}
|
|
45
61
|
/**
|
|
46
62
|
* Interface for interacting with recipients.
|
|
@@ -164,6 +180,16 @@ interface RecipientsContactsClient {
|
|
|
164
180
|
* @returns The response after creating the contact.
|
|
165
181
|
*/
|
|
166
182
|
create(recipientID: string, req: CreateRecipientContactRequest): Promise<CreateRecipientContactResponse>;
|
|
183
|
+
/**
|
|
184
|
+
* Ensures an address is the recipient's PRIMARY contact for a medium
|
|
185
|
+
* (idempotent create-or-update). Use this for a server-side sync that keeps
|
|
186
|
+
* a recipient's primary email current — it is a single call, unlike
|
|
187
|
+
* {@link create} which rejects (409) when the contact already exists.
|
|
188
|
+
* @param recipientID - The unique identifier of the recipient.
|
|
189
|
+
* @param req - The medium and address to make primary.
|
|
190
|
+
* @returns The resulting primary contact.
|
|
191
|
+
*/
|
|
192
|
+
setPrimary(recipientID: string, req: SetPrimaryContactRequest): Promise<SetPrimaryContactResponse>;
|
|
167
193
|
/**
|
|
168
194
|
* Updates a recipient's contact by contact ID.
|
|
169
195
|
* @param recipientID - The unique identifier of the recipient.
|
|
@@ -180,5 +206,60 @@ interface RecipientsContactsClient {
|
|
|
180
206
|
*/
|
|
181
207
|
delete(recipientID: string, contactID: number): Promise<void>;
|
|
182
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Interface for managing the project preference CATALOG — the project-level
|
|
211
|
+
* entries that declare which (target, medium) pairs the project may send and the
|
|
212
|
+
* default a recipient inherits. Project-scoped by the API key.
|
|
213
|
+
*
|
|
214
|
+
* Not to be confused with `recipients.preferences`, which manages one
|
|
215
|
+
* recipient's own toggles.
|
|
216
|
+
*/
|
|
217
|
+
interface ProjectPreferencesClient {
|
|
218
|
+
/**
|
|
219
|
+
* Lists the project's catalog.
|
|
220
|
+
* @returns The catalog entries.
|
|
221
|
+
*/
|
|
222
|
+
list(): Promise<ProjectPreference[]>;
|
|
223
|
+
/**
|
|
224
|
+
* Retrieves a single catalog entry by ID.
|
|
225
|
+
* @param preferenceID - The catalog entry's ID.
|
|
226
|
+
* @returns The catalog entry.
|
|
227
|
+
*/
|
|
228
|
+
get(preferenceID: number): Promise<ProjectPreference>;
|
|
229
|
+
/**
|
|
230
|
+
* Creates a single catalog entry. Strict — rejects with a 409 when an entry
|
|
231
|
+
* for the same (channel, topic, event, medium) already exists. To change an
|
|
232
|
+
* existing entry use {@link update}; to declaratively set a whole catalog use
|
|
233
|
+
* {@link upsertMany}.
|
|
234
|
+
* @param req - The catalog entry to create.
|
|
235
|
+
* @returns The created catalog entry.
|
|
236
|
+
*/
|
|
237
|
+
create(req: CreateProjectPreferenceRequest): Promise<ProjectPreference>;
|
|
238
|
+
/**
|
|
239
|
+
* Updates a catalog entry's name, description and default. The natural key
|
|
240
|
+
* (channel/topic/event/medium) is immutable.
|
|
241
|
+
* @param preferenceID - The catalog entry's ID.
|
|
242
|
+
* @param req - The fields to update.
|
|
243
|
+
* @returns The updated catalog entry.
|
|
244
|
+
*/
|
|
245
|
+
update(preferenceID: number, req: UpdateProjectPreferenceRequest): Promise<ProjectPreference>;
|
|
246
|
+
/**
|
|
247
|
+
* Deletes a catalog entry (un-catalogs the (target, medium)).
|
|
248
|
+
* @param preferenceID - The catalog entry's ID.
|
|
249
|
+
*/
|
|
250
|
+
delete(preferenceID: number): Promise<void>;
|
|
251
|
+
/**
|
|
252
|
+
* Declaratively merges a whole catalog in one call — the primitive for a
|
|
253
|
+
* one-off "set up my project's preferences" script. Each item is upserted by
|
|
254
|
+
* its natural key (new inserted, existing name + description + default
|
|
255
|
+
* updated). By default
|
|
256
|
+
* entries absent from the array are left untouched; pass `{ prune: true }` to
|
|
257
|
+
* also delete them, making the array the entire desired catalog.
|
|
258
|
+
* @param prefs - The desired catalog entries.
|
|
259
|
+
* @param options - Set `prune: true` to remove entries absent from the array.
|
|
260
|
+
* @returns The full resulting catalog.
|
|
261
|
+
*/
|
|
262
|
+
upsertMany(prefs: UpsertProjectPreferenceItem[], options?: UpsertProjectPreferencesOptions): Promise<ProjectPreference[]>;
|
|
263
|
+
}
|
|
183
264
|
export {};
|
|
184
265
|
//# sourceMappingURL=bodhveda.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodhveda.d.ts","sourceRoot":"","sources":["../../src/bodhveda.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gCAAgC,EAChC,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,6BAA6B,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AC;IAEtD;;;;;;;OAOG;IACH,MAAM,CAAC,GAAG,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAExE;;;;;;OAMG;IACH,MAAM,CACF,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,8BAA8B,GACpC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE9B;;;OAGG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C;;;;;;;;;;OAUG;IACH,UAAU,CACN,KAAK,EAAE,2BAA2B,EAAE,EACpC,OAAO,CAAC,EAAE,+BAA+B,GAC1C,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;CACnC"}
|
package/dist/cjs/bodhveda.js
CHANGED
|
@@ -36,6 +36,7 @@ class Bodhveda {
|
|
|
36
36
|
});
|
|
37
37
|
this.notifications = new Notifications(client);
|
|
38
38
|
this.recipients = new Recipients(client);
|
|
39
|
+
this.preferences = new ProjectPreferences(client);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
exports.Bodhveda = Bodhveda;
|
|
@@ -54,6 +55,10 @@ class Notifications {
|
|
|
54
55
|
const response = await this.client.post(routes_1.ROUTES.notifications.send, req);
|
|
55
56
|
return response.data;
|
|
56
57
|
}
|
|
58
|
+
async get(notificationID) {
|
|
59
|
+
const response = await this.client.get(routes_1.ROUTES.notifications.get(notificationID));
|
|
60
|
+
return response.data;
|
|
61
|
+
}
|
|
57
62
|
}
|
|
58
63
|
/**
|
|
59
64
|
* Class for managing recipients.
|
|
@@ -170,6 +175,10 @@ class RecipientsContacts {
|
|
|
170
175
|
const response = await this.client.post(routes_1.ROUTES.recipients.contacts.create(recipientID), req);
|
|
171
176
|
return response.data;
|
|
172
177
|
}
|
|
178
|
+
async setPrimary(recipientID, req) {
|
|
179
|
+
const response = await this.client.put(routes_1.ROUTES.recipients.contacts.setPrimary(recipientID), req);
|
|
180
|
+
return response.data;
|
|
181
|
+
}
|
|
173
182
|
async update(recipientID, contactID, req) {
|
|
174
183
|
const response = await this.client.patch(routes_1.ROUTES.recipients.contacts.update(recipientID, contactID), req);
|
|
175
184
|
return response.data;
|
|
@@ -178,4 +187,39 @@ class RecipientsContacts {
|
|
|
178
187
|
await this.client.delete(routes_1.ROUTES.recipients.contacts.delete(recipientID, contactID));
|
|
179
188
|
}
|
|
180
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Class for managing the project preference catalog.
|
|
192
|
+
*/
|
|
193
|
+
class ProjectPreferences {
|
|
194
|
+
/**
|
|
195
|
+
* Creates an instance of the ProjectPreferences class.
|
|
196
|
+
* @param client - The Axios client instance.
|
|
197
|
+
*/
|
|
198
|
+
constructor(client) {
|
|
199
|
+
this.client = client;
|
|
200
|
+
}
|
|
201
|
+
async list() {
|
|
202
|
+
const response = await this.client.get(routes_1.ROUTES.preferences.list);
|
|
203
|
+
return response.data;
|
|
204
|
+
}
|
|
205
|
+
async get(preferenceID) {
|
|
206
|
+
const response = await this.client.get(routes_1.ROUTES.preferences.get(preferenceID));
|
|
207
|
+
return response.data;
|
|
208
|
+
}
|
|
209
|
+
async create(req) {
|
|
210
|
+
const response = await this.client.post(routes_1.ROUTES.preferences.create, req);
|
|
211
|
+
return response.data;
|
|
212
|
+
}
|
|
213
|
+
async update(preferenceID, req) {
|
|
214
|
+
const response = await this.client.patch(routes_1.ROUTES.preferences.update(preferenceID), req);
|
|
215
|
+
return response.data;
|
|
216
|
+
}
|
|
217
|
+
async delete(preferenceID) {
|
|
218
|
+
await this.client.delete(routes_1.ROUTES.preferences.delete(preferenceID));
|
|
219
|
+
}
|
|
220
|
+
async upsertMany(prefs, options) {
|
|
221
|
+
const response = await this.client.put(routes_1.ROUTES.preferences.upsertMany, prefs, (options === null || options === void 0 ? void 0 : options.prune) ? { params: { prune: true } } : undefined);
|
|
222
|
+
return response.data;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
181
225
|
//# sourceMappingURL=bodhveda.js.map
|
package/dist/cjs/bodhveda.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodhveda.js","sourceRoot":"","sources":["../../src/bodhveda.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyD;
|
|
1
|
+
{"version":3,"file":"bodhveda.js","sourceRoot":"","sources":["../../src/bodhveda.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyD;AAsCzD,qCAAkC;AA6BlC;;GAEG;AACH,MAAa,QAAQ;IAKjB;;;;OAIG;IACH,YAAY,MAAc,EAAE,UAA2B,EAAE;QACrD,MAAM,EAAE,MAAM,GAAG,0BAA0B,EAAE,GAAG,OAAO,CAAC;QAExD,MAAM,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACxB,OAAO,EAAE,MAAM;YACf,OAAO,EAAE;gBACL,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,UAAU,MAAM,EAAE;aACpC;SACJ,CAAC,CAAC;QAEH,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAC5B,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,iDAAiD;QAC9E,CAAC,KAAiB,EAAE,EAAE;;YAClB,IAAI,eAAK,CAAC,YAAY,CAAC,KAAK,CAAC,KAAI,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAA,EAAE,CAAC;gBACpD,MAAM,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAC,2CAA2C;YAC3E,CAAC;iBAAM,CAAC;gBACJ,MAAM,KAAK,CAAC;YAChB,CAAC;QACL,CAAC,CACJ,CAAC;QAEF,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;C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IAAyB,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,MAAM,CACR,YAAoB,EACpB,GAAmC;QAEnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CACpC,eAAM,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,EACvC,GAAG,CACN,CAAC;QACF,OAAO,QAAQ,CAAC,IAAyB,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,YAAoB;QAC7B,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,eAAM,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,UAAU,CACZ,KAAoC,EACpC,OAAyC;QAEzC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAClC,eAAM,CAAC,WAAW,CAAC,UAAU,EAC7B,KAAK,EACL,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAC3D,CAAC;QACF,OAAO,QAAQ,CAAC,IAA2B,CAAC;IAChD,CAAC;CACJ"}
|
package/dist/cjs/routes.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export declare const ROUTES: {
|
|
2
2
|
notifications: {
|
|
3
3
|
send: string;
|
|
4
|
+
get: (notificationID: number) => string;
|
|
5
|
+
};
|
|
6
|
+
preferences: {
|
|
7
|
+
list: string;
|
|
8
|
+
create: string;
|
|
9
|
+
upsertMany: string;
|
|
10
|
+
get: (preferenceID: number) => string;
|
|
11
|
+
update: (preferenceID: number) => string;
|
|
12
|
+
delete: (preferenceID: number) => string;
|
|
4
13
|
};
|
|
5
14
|
recipients: {
|
|
6
15
|
create: string;
|
|
@@ -22,6 +31,7 @@ export declare const ROUTES: {
|
|
|
22
31
|
contacts: {
|
|
23
32
|
list: (recipientID: string) => string;
|
|
24
33
|
create: (recipientID: string) => string;
|
|
34
|
+
setPrimary: (recipientID: string) => string;
|
|
25
35
|
update: (recipientID: string, contactID: number) => string;
|
|
26
36
|
delete: (recipientID: string, contactID: number) => string;
|
|
27
37
|
};
|
package/dist/cjs/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;8BAGW,MAAM;;;;;;4BASR,MAAM;+BACH,MAAM;+BACN,MAAM;;;;;2BAMV,MAAM;8BAEH,MAAM;8BAEN,MAAM;;gCAIJ,MAAM;uCAEC,MAAM;uCAIN,MAAM;kCAEX,MAAM;;;gCAKR,MAAM;+BAEP,MAAM;iCAEJ,MAAM;;;gCAOP,MAAM;kCAEJ,MAAM;sCAEF,MAAM;kCAEV,MAAM,aAAa,MAAM;kCAIzB,MAAM,aAAa,MAAM;;;CAM1D,CAAC"}
|
package/dist/cjs/routes.js
CHANGED
|
@@ -4,6 +4,17 @@ exports.ROUTES = void 0;
|
|
|
4
4
|
exports.ROUTES = {
|
|
5
5
|
notifications: {
|
|
6
6
|
send: "/notifications/send",
|
|
7
|
+
get: (notificationID) => `/notifications/${notificationID}`,
|
|
8
|
+
},
|
|
9
|
+
// Project-scoped preference CATALOG (project comes from the API key). Distinct
|
|
10
|
+
// from recipients.preferences, which is a single recipient's own toggles.
|
|
11
|
+
preferences: {
|
|
12
|
+
list: "/preferences",
|
|
13
|
+
create: "/preferences",
|
|
14
|
+
upsertMany: "/preferences",
|
|
15
|
+
get: (preferenceID) => `/preferences/${preferenceID}`,
|
|
16
|
+
update: (preferenceID) => `/preferences/${preferenceID}`,
|
|
17
|
+
delete: (preferenceID) => `/preferences/${preferenceID}`,
|
|
7
18
|
},
|
|
8
19
|
recipients: {
|
|
9
20
|
create: "/recipients",
|
|
@@ -25,6 +36,7 @@ exports.ROUTES = {
|
|
|
25
36
|
contacts: {
|
|
26
37
|
list: (recipientID) => `/recipients/${encodeURIComponent(recipientID)}/contacts`,
|
|
27
38
|
create: (recipientID) => `/recipients/${encodeURIComponent(recipientID)}/contacts`,
|
|
39
|
+
setPrimary: (recipientID) => `/recipients/${encodeURIComponent(recipientID)}/contacts`,
|
|
28
40
|
update: (recipientID, contactID) => `/recipients/${encodeURIComponent(recipientID)}/contacts/${contactID}`,
|
|
29
41
|
delete: (recipientID, contactID) => `/recipients/${encodeURIComponent(recipientID)}/contacts/${contactID}`,
|
|
30
42
|
},
|
package/dist/cjs/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/routes.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;IAClB,aAAa,EAAE;QACX,IAAI,EAAE,qBAAqB;
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/routes.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;IAClB,aAAa,EAAE;QACX,IAAI,EAAE,qBAAqB;QAC3B,GAAG,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,kBAAkB,cAAc,EAAE;KACtE;IAED,+EAA+E;IAC/E,0EAA0E;IAC1E,WAAW,EAAE;QACT,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,cAAc;QACtB,UAAU,EAAE,cAAc;QAC1B,GAAG,EAAE,CAAC,YAAoB,EAAE,EAAE,CAAC,gBAAgB,YAAY,EAAE;QAC7D,MAAM,EAAE,CAAC,YAAoB,EAAE,EAAE,CAAC,gBAAgB,YAAY,EAAE;QAChE,MAAM,EAAE,CAAC,YAAoB,EAAE,EAAE,CAAC,gBAAgB,YAAY,EAAE;KACnE;IAED,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B,EAAE,EAAE,CAChC,eAAe,kBAAkB,CAAC,WAAW,CAAC,WAAW;YAC7D,MAAM,EAAE,CAAC,WAAmB,EAAE,SAAiB,EAAE,EAAE,CAC/C,eAAe,kBAAkB,CAC7B,WAAW,CACd,aAAa,SAAS,EAAE;YAC7B,MAAM,EAAE,CAAC,WAAmB,EAAE,SAAiB,EAAE,EAAE,CAC/C,eAAe,kBAAkB,CAC7B,WAAW,CACd,aAAa,SAAS,EAAE;SAChC;KACJ;CACJ,CAAC"}
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -14,12 +14,15 @@ export type PreferenceMedium = "in_app" | "email";
|
|
|
14
14
|
/**
|
|
15
15
|
* Represents a preference target, extending the Target interface.
|
|
16
16
|
*/
|
|
17
|
-
export interface
|
|
17
|
+
export interface TargetWithName extends Target {
|
|
18
18
|
/**
|
|
19
19
|
* The medium this preference applies to (`in_app` or `email`).
|
|
20
20
|
*/
|
|
21
21
|
medium?: PreferenceMedium;
|
|
22
|
-
|
|
22
|
+
/** The catalog entry's name, present only when this target is cataloged. */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** The catalog entry's optional description, when it has one. */
|
|
25
|
+
description?: string;
|
|
23
26
|
}
|
|
24
27
|
/**
|
|
25
28
|
* Represents the state of a preference that was just written. It describes the
|
|
@@ -66,7 +69,7 @@ export interface ResolvedPreferenceState {
|
|
|
66
69
|
* Represents a resolved preference with a target and state.
|
|
67
70
|
*/
|
|
68
71
|
export interface Preference {
|
|
69
|
-
target:
|
|
72
|
+
target: TargetWithName;
|
|
70
73
|
state: ResolvedPreferenceState;
|
|
71
74
|
}
|
|
72
75
|
/**
|
|
@@ -85,9 +88,43 @@ export interface Notification {
|
|
|
85
88
|
payload: unknown;
|
|
86
89
|
target: Target;
|
|
87
90
|
state: NotificationState;
|
|
91
|
+
/**
|
|
92
|
+
* The in-app delivery outcome, resolved asynchronously by the worker:
|
|
93
|
+
* `enqueued` (accepted, not yet processed), `delivered`, `muted`
|
|
94
|
+
* (preferences disallow), `quota_exceeded`, or `failed`.
|
|
95
|
+
*/
|
|
96
|
+
status: string;
|
|
88
97
|
broadcast_id: number | null;
|
|
98
|
+
/** When the worker finished processing this notification (all mediums). */
|
|
99
|
+
completed_at?: string;
|
|
89
100
|
created_at: string;
|
|
90
101
|
updated_at: string;
|
|
102
|
+
/**
|
|
103
|
+
* The email-medium delivery outcome, present only when the send included an
|
|
104
|
+
* `email` block. Populated by {@link NotificationsClient.get}; absent on the
|
|
105
|
+
* recipient inbox feed. Use it to learn whether the email sent/delivered/bounced.
|
|
106
|
+
*/
|
|
107
|
+
email?: NotificationEmailDelivery;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The email-medium delivery outcome attached to a notification. Its lifecycle is
|
|
111
|
+
* independent of the in-app `status`: `pending` → `sent` (provider accepted) →
|
|
112
|
+
* `delivered` / `bounced` / `complained` (from provider webhooks), or `failed` /
|
|
113
|
+
* `muted` / `no_contact`.
|
|
114
|
+
*/
|
|
115
|
+
export interface NotificationEmailDelivery {
|
|
116
|
+
status: string;
|
|
117
|
+
failure_reason?: string;
|
|
118
|
+
attempt: number;
|
|
119
|
+
provider?: string;
|
|
120
|
+
provider_message_id?: string;
|
|
121
|
+
address_snapshot?: string;
|
|
122
|
+
sent_at?: string;
|
|
123
|
+
delivered_at?: string;
|
|
124
|
+
bounced_at?: string;
|
|
125
|
+
complained_at?: string;
|
|
126
|
+
opened_at?: string;
|
|
127
|
+
clicked_at?: string;
|
|
91
128
|
}
|
|
92
129
|
/**
|
|
93
130
|
* Represents a broadcast.
|
|
@@ -212,11 +249,20 @@ export interface SendNotificationResponse {
|
|
|
212
249
|
notification: Notification | null;
|
|
213
250
|
broadcast: Broadcast | null;
|
|
214
251
|
/**
|
|
215
|
-
*
|
|
216
|
-
*
|
|
252
|
+
* @deprecated The send is fully asynchronous — the notification is accepted
|
|
253
|
+
* (status `enqueued`) and every medium, including email, is resolved later by
|
|
254
|
+
* the worker. This field is therefore no longer populated on a send response.
|
|
255
|
+
* Read the resolved in-app status and the email outcome back with
|
|
256
|
+
* {@link NotificationsClient.get} (see {@link Notification.email}).
|
|
217
257
|
*/
|
|
218
258
|
deliveries?: NotificationDelivery[];
|
|
219
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* The response of {@link NotificationsClient.get}: a single notification with its
|
|
262
|
+
* resolved in-app {@link Notification.status} and, when the send included an
|
|
263
|
+
* email block, its {@link Notification.email} delivery outcome.
|
|
264
|
+
*/
|
|
265
|
+
export type GetNotificationResponse = Notification;
|
|
220
266
|
/**
|
|
221
267
|
* Represents a request to list notifications.
|
|
222
268
|
*/
|
|
@@ -289,7 +335,7 @@ export interface SetPreferenceRequest {
|
|
|
289
335
|
* Represents the response after setting a preference.
|
|
290
336
|
*/
|
|
291
337
|
export interface SetPreferenceResponse {
|
|
292
|
-
target:
|
|
338
|
+
target: TargetWithName;
|
|
293
339
|
state: PreferenceState;
|
|
294
340
|
}
|
|
295
341
|
/**
|
|
@@ -307,9 +353,86 @@ export interface CheckPreferenceRequest {
|
|
|
307
353
|
* cataloged, or stored at all — any (channel, topic, event) resolves.
|
|
308
354
|
*/
|
|
309
355
|
export interface CheckPreferenceResponse {
|
|
310
|
-
target:
|
|
356
|
+
target: TargetWithName;
|
|
311
357
|
state: ResolvedPreferenceState;
|
|
312
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* A project-level preference — one entry in the project's CATALOG. The catalog
|
|
361
|
+
* declares which (target, medium) pairs a project may send, and supplies the
|
|
362
|
+
* default a recipient inherits until they override it with a toggle of their own.
|
|
363
|
+
*
|
|
364
|
+
* This is distinct from {@link Preference}, which is one recipient's RESOLVED
|
|
365
|
+
* state. Manage the catalog with `bodhveda.preferences`; manage a recipient's
|
|
366
|
+
* own toggles with `bodhveda.recipients.preferences`.
|
|
367
|
+
*/
|
|
368
|
+
export interface ProjectPreference {
|
|
369
|
+
id: number;
|
|
370
|
+
project_id: number;
|
|
371
|
+
target: Target;
|
|
372
|
+
/** The medium this catalog entry gates (`in_app` or `email`). */
|
|
373
|
+
medium: PreferenceMedium;
|
|
374
|
+
/**
|
|
375
|
+
* The project-level default for this (target, medium): whether a recipient
|
|
376
|
+
* who has expressed no preference of their own is delivered to.
|
|
377
|
+
*/
|
|
378
|
+
default_enabled: boolean;
|
|
379
|
+
name: string;
|
|
380
|
+
/** Optional longer blurb for this catalog entry; `null` when unset. */
|
|
381
|
+
description: string | null;
|
|
382
|
+
created_at: string;
|
|
383
|
+
updated_at: string;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Request to create ONE catalog entry. Strict: creating an entry whose
|
|
387
|
+
* (channel, topic, event, medium) already exists rejects with a 409 — use
|
|
388
|
+
* {@link ProjectPreferencesClient.update} to change an existing entry, or
|
|
389
|
+
* {@link ProjectPreferencesClient.upsertMany} to declaratively merge a whole
|
|
390
|
+
* catalog.
|
|
391
|
+
*/
|
|
392
|
+
export interface CreateProjectPreferenceRequest {
|
|
393
|
+
channel: string;
|
|
394
|
+
topic: string;
|
|
395
|
+
event: string;
|
|
396
|
+
/** Defaults to `in_app` when omitted. */
|
|
397
|
+
medium?: PreferenceMedium;
|
|
398
|
+
name: string;
|
|
399
|
+
/**
|
|
400
|
+
* Optional longer blurb (e.g. "Receive notifications about new products,
|
|
401
|
+
* features, and more."). Omitted stores no description.
|
|
402
|
+
*/
|
|
403
|
+
description?: string;
|
|
404
|
+
default_enabled: boolean;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Request to update a catalog entry. The natural key
|
|
408
|
+
* (channel/topic/event/medium) is immutable, so only the name, description and
|
|
409
|
+
* default change.
|
|
410
|
+
*/
|
|
411
|
+
export interface UpdateProjectPreferenceRequest {
|
|
412
|
+
name: string;
|
|
413
|
+
/** Optional; omitted clears the description. */
|
|
414
|
+
description?: string;
|
|
415
|
+
default_enabled: boolean;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* One item of a declarative bulk upsert — the same shape as
|
|
419
|
+
* {@link CreateProjectPreferenceRequest}.
|
|
420
|
+
*/
|
|
421
|
+
export interface UpsertProjectPreferenceItem extends CreateProjectPreferenceRequest {
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Options for {@link ProjectPreferencesClient.upsertMany}.
|
|
425
|
+
*/
|
|
426
|
+
export interface UpsertProjectPreferencesOptions {
|
|
427
|
+
/**
|
|
428
|
+
* When `true`, catalog entries NOT present in the array are DELETED, making
|
|
429
|
+
* the array the project's entire desired catalog. Default `false` (merge):
|
|
430
|
+
* absent entries are left untouched. Pruning un-catalogs a (target, medium),
|
|
431
|
+
* which turns a non-in_app medium off for recipients relying on the catalog
|
|
432
|
+
* default — hence it is opt-in.
|
|
433
|
+
*/
|
|
434
|
+
prune?: boolean;
|
|
435
|
+
}
|
|
313
436
|
/**
|
|
314
437
|
* A delivery transport a recipient contact can be registered for. Only `email`
|
|
315
438
|
* is exercised today; the rest are reserved for future transports.
|
|
@@ -359,5 +482,20 @@ export interface UpdateRecipientContactRequest {
|
|
|
359
482
|
*/
|
|
360
483
|
export interface UpdateRecipientContactResponse extends RecipientContact {
|
|
361
484
|
}
|
|
485
|
+
/**
|
|
486
|
+
* Request to ensure a primary contact for a medium — the body of
|
|
487
|
+
* {@link RecipientsContactsClient.setPrimary}. Idempotent create-or-update:
|
|
488
|
+
* creates the primary if absent, updates the existing primary's address if it
|
|
489
|
+
* differs (which resets verification), or no-ops if it already matches.
|
|
490
|
+
*/
|
|
491
|
+
export interface SetPrimaryContactRequest {
|
|
492
|
+
medium: Medium;
|
|
493
|
+
address: string;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Represents the response after setting a primary contact.
|
|
497
|
+
*/
|
|
498
|
+
export interface SetPrimaryContactResponse extends RecipientContact {
|
|
499
|
+
}
|
|
362
500
|
export {};
|
|
363
501
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/cjs/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,MAAM;IAC1C;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACpC;;;;;;;OAOG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,SAAS,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,uBAAuB,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,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CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,gBAAgB;CAAG;AAE3E;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;CAAG"}
|
package/dist/esm/bodhveda.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ListNotificationsResponse, ListNotificationsRequest, ListPreferencesResponse, SetPreferenceRequest, SetPreferenceResponse, UnreadCountResponse, UpdateNotificationsStateResponse, UpdateNotificationsStateRequest, DeleteNotificationsRequest, DeleteNotificationsResponse, CheckPreferenceRequest, CheckPreferenceResponse, SendNotificationRequest, SendNotificationResponse, CreateRecipientRequest, CreateRecipientResponse, CreateRecipientsBatchRequest, CreateRecipientsBatchResponse, GetRecipientResponse, UpdateRecipientRequest, UpdateRecipientResponse, CreateRecipientContactRequest, CreateRecipientContactResponse, ListRecipientContactsResponse, UpdateRecipientContactRequest, UpdateRecipientContactResponse } from "./types";
|
|
1
|
+
import { ListNotificationsResponse, ListNotificationsRequest, ListPreferencesResponse, SetPreferenceRequest, SetPreferenceResponse, UnreadCountResponse, UpdateNotificationsStateResponse, UpdateNotificationsStateRequest, DeleteNotificationsRequest, DeleteNotificationsResponse, CheckPreferenceRequest, CheckPreferenceResponse, SendNotificationRequest, SendNotificationResponse, GetNotificationResponse, CreateRecipientRequest, CreateRecipientResponse, CreateRecipientsBatchRequest, CreateRecipientsBatchResponse, GetRecipientResponse, UpdateRecipientRequest, UpdateRecipientResponse, CreateRecipientContactRequest, CreateRecipientContactResponse, ListRecipientContactsResponse, UpdateRecipientContactRequest, UpdateRecipientContactResponse, SetPrimaryContactRequest, SetPrimaryContactResponse, ProjectPreference, CreateProjectPreferenceRequest, UpdateProjectPreferenceRequest, UpsertProjectPreferenceItem, UpsertProjectPreferencesOptions } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Options for configuring the Bodhveda SDK.
|
|
4
4
|
*/
|
|
@@ -17,6 +17,12 @@ interface BodhvedaClient {
|
|
|
17
17
|
* Provides access to recipient-related methods.
|
|
18
18
|
*/
|
|
19
19
|
recipients: RecipientsClient;
|
|
20
|
+
/**
|
|
21
|
+
* Provides access to the project preference CATALOG (project-scoped by the
|
|
22
|
+
* API key). Distinct from `recipients.preferences`, which manages a single
|
|
23
|
+
* recipient's own toggles.
|
|
24
|
+
*/
|
|
25
|
+
preferences: ProjectPreferencesClient;
|
|
20
26
|
}
|
|
21
27
|
/**
|
|
22
28
|
* Main class for initializing and interacting with the Bodhveda SDK.
|
|
@@ -24,6 +30,7 @@ interface BodhvedaClient {
|
|
|
24
30
|
export declare class Bodhveda implements BodhvedaClient {
|
|
25
31
|
notifications: NotificationsClient;
|
|
26
32
|
recipients: RecipientsClient;
|
|
33
|
+
preferences: ProjectPreferencesClient;
|
|
27
34
|
/**
|
|
28
35
|
* Creates an instance of the Bodhveda SDK.
|
|
29
36
|
* @param apiKey - The API key for authentication.
|
|
@@ -41,6 +48,15 @@ interface NotificationsClient {
|
|
|
41
48
|
* @returns The response from the API.
|
|
42
49
|
*/
|
|
43
50
|
send(req: SendNotificationRequest): Promise<SendNotificationResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves a single notification by its id. The send API is asynchronous and
|
|
53
|
+
* returns a notification id after accepting the send (status `enqueued`); use
|
|
54
|
+
* this to read back the resolved in-app status and, when the send included an
|
|
55
|
+
* email block, the email delivery outcome ({@link Notification.email}).
|
|
56
|
+
* @param notificationID - The notification id returned by {@link send}.
|
|
57
|
+
* @returns The notification with its resolved status and email outcome.
|
|
58
|
+
*/
|
|
59
|
+
get(notificationID: number): Promise<GetNotificationResponse>;
|
|
44
60
|
}
|
|
45
61
|
/**
|
|
46
62
|
* Interface for interacting with recipients.
|
|
@@ -164,6 +180,16 @@ interface RecipientsContactsClient {
|
|
|
164
180
|
* @returns The response after creating the contact.
|
|
165
181
|
*/
|
|
166
182
|
create(recipientID: string, req: CreateRecipientContactRequest): Promise<CreateRecipientContactResponse>;
|
|
183
|
+
/**
|
|
184
|
+
* Ensures an address is the recipient's PRIMARY contact for a medium
|
|
185
|
+
* (idempotent create-or-update). Use this for a server-side sync that keeps
|
|
186
|
+
* a recipient's primary email current — it is a single call, unlike
|
|
187
|
+
* {@link create} which rejects (409) when the contact already exists.
|
|
188
|
+
* @param recipientID - The unique identifier of the recipient.
|
|
189
|
+
* @param req - The medium and address to make primary.
|
|
190
|
+
* @returns The resulting primary contact.
|
|
191
|
+
*/
|
|
192
|
+
setPrimary(recipientID: string, req: SetPrimaryContactRequest): Promise<SetPrimaryContactResponse>;
|
|
167
193
|
/**
|
|
168
194
|
* Updates a recipient's contact by contact ID.
|
|
169
195
|
* @param recipientID - The unique identifier of the recipient.
|
|
@@ -180,5 +206,60 @@ interface RecipientsContactsClient {
|
|
|
180
206
|
*/
|
|
181
207
|
delete(recipientID: string, contactID: number): Promise<void>;
|
|
182
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Interface for managing the project preference CATALOG — the project-level
|
|
211
|
+
* entries that declare which (target, medium) pairs the project may send and the
|
|
212
|
+
* default a recipient inherits. Project-scoped by the API key.
|
|
213
|
+
*
|
|
214
|
+
* Not to be confused with `recipients.preferences`, which manages one
|
|
215
|
+
* recipient's own toggles.
|
|
216
|
+
*/
|
|
217
|
+
interface ProjectPreferencesClient {
|
|
218
|
+
/**
|
|
219
|
+
* Lists the project's catalog.
|
|
220
|
+
* @returns The catalog entries.
|
|
221
|
+
*/
|
|
222
|
+
list(): Promise<ProjectPreference[]>;
|
|
223
|
+
/**
|
|
224
|
+
* Retrieves a single catalog entry by ID.
|
|
225
|
+
* @param preferenceID - The catalog entry's ID.
|
|
226
|
+
* @returns The catalog entry.
|
|
227
|
+
*/
|
|
228
|
+
get(preferenceID: number): Promise<ProjectPreference>;
|
|
229
|
+
/**
|
|
230
|
+
* Creates a single catalog entry. Strict — rejects with a 409 when an entry
|
|
231
|
+
* for the same (channel, topic, event, medium) already exists. To change an
|
|
232
|
+
* existing entry use {@link update}; to declaratively set a whole catalog use
|
|
233
|
+
* {@link upsertMany}.
|
|
234
|
+
* @param req - The catalog entry to create.
|
|
235
|
+
* @returns The created catalog entry.
|
|
236
|
+
*/
|
|
237
|
+
create(req: CreateProjectPreferenceRequest): Promise<ProjectPreference>;
|
|
238
|
+
/**
|
|
239
|
+
* Updates a catalog entry's name, description and default. The natural key
|
|
240
|
+
* (channel/topic/event/medium) is immutable.
|
|
241
|
+
* @param preferenceID - The catalog entry's ID.
|
|
242
|
+
* @param req - The fields to update.
|
|
243
|
+
* @returns The updated catalog entry.
|
|
244
|
+
*/
|
|
245
|
+
update(preferenceID: number, req: UpdateProjectPreferenceRequest): Promise<ProjectPreference>;
|
|
246
|
+
/**
|
|
247
|
+
* Deletes a catalog entry (un-catalogs the (target, medium)).
|
|
248
|
+
* @param preferenceID - The catalog entry's ID.
|
|
249
|
+
*/
|
|
250
|
+
delete(preferenceID: number): Promise<void>;
|
|
251
|
+
/**
|
|
252
|
+
* Declaratively merges a whole catalog in one call — the primitive for a
|
|
253
|
+
* one-off "set up my project's preferences" script. Each item is upserted by
|
|
254
|
+
* its natural key (new inserted, existing name + description + default
|
|
255
|
+
* updated). By default
|
|
256
|
+
* entries absent from the array are left untouched; pass `{ prune: true }` to
|
|
257
|
+
* also delete them, making the array the entire desired catalog.
|
|
258
|
+
* @param prefs - The desired catalog entries.
|
|
259
|
+
* @param options - Set `prune: true` to remove entries absent from the array.
|
|
260
|
+
* @returns The full resulting catalog.
|
|
261
|
+
*/
|
|
262
|
+
upsertMany(prefs: UpsertProjectPreferenceItem[], options?: UpsertProjectPreferencesOptions): Promise<ProjectPreference[]>;
|
|
263
|
+
}
|
|
183
264
|
export {};
|
|
184
265
|
//# sourceMappingURL=bodhveda.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodhveda.d.ts","sourceRoot":"","sources":["../../src/bodhveda.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gCAAgC,EAChC,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,
|
|
1
|
+
{"version":3,"file":"bodhveda.d.ts","sourceRoot":"","sources":["../../src/bodhveda.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gCAAgC,EAChC,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,8BAA8B,EAC9B,8BAA8B,EAC9B,2BAA2B,EAC3B,+BAA+B,EAClC,MAAM,SAAS,CAAC;AAGjB;;GAEG;AACH,UAAU,eAAe;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,UAAU,cAAc;IACpB;;OAEG;IACH,aAAa,EAAE,mB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MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,6BAA6B,GACnC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAE3C;;;;;OAKG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAgED;;;;;;;GAOG;AACH,UAAU,wBAAwB;IAC9B;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAErC;;;;OAIG;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEtD;;;;;;;OAOG;IACH,MAAM,CAAC,GAAG,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAExE;;;;;;OAMG;IACH,MAAM,CACF,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,8BAA8B,GACpC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE9B;;;OAGG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C;;;;;;;;;;OAUG;IACH,UAAU,CACN,KAAK,EAAE,2BAA2B,EAAE,EACpC,OAAO,CAAC,EAAE,+BAA+B,GAC1C,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;CACnC"}
|
package/dist/esm/bodhveda.js
CHANGED
|
@@ -30,6 +30,7 @@ export class Bodhveda {
|
|
|
30
30
|
});
|
|
31
31
|
this.notifications = new Notifications(client);
|
|
32
32
|
this.recipients = new Recipients(client);
|
|
33
|
+
this.preferences = new ProjectPreferences(client);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
@@ -47,6 +48,10 @@ class Notifications {
|
|
|
47
48
|
const response = await this.client.post(ROUTES.notifications.send, req);
|
|
48
49
|
return response.data;
|
|
49
50
|
}
|
|
51
|
+
async get(notificationID) {
|
|
52
|
+
const response = await this.client.get(ROUTES.notifications.get(notificationID));
|
|
53
|
+
return response.data;
|
|
54
|
+
}
|
|
50
55
|
}
|
|
51
56
|
/**
|
|
52
57
|
* Class for managing recipients.
|
|
@@ -163,6 +168,10 @@ class RecipientsContacts {
|
|
|
163
168
|
const response = await this.client.post(ROUTES.recipients.contacts.create(recipientID), req);
|
|
164
169
|
return response.data;
|
|
165
170
|
}
|
|
171
|
+
async setPrimary(recipientID, req) {
|
|
172
|
+
const response = await this.client.put(ROUTES.recipients.contacts.setPrimary(recipientID), req);
|
|
173
|
+
return response.data;
|
|
174
|
+
}
|
|
166
175
|
async update(recipientID, contactID, req) {
|
|
167
176
|
const response = await this.client.patch(ROUTES.recipients.contacts.update(recipientID, contactID), req);
|
|
168
177
|
return response.data;
|
|
@@ -171,4 +180,39 @@ class RecipientsContacts {
|
|
|
171
180
|
await this.client.delete(ROUTES.recipients.contacts.delete(recipientID, contactID));
|
|
172
181
|
}
|
|
173
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Class for managing the project preference catalog.
|
|
185
|
+
*/
|
|
186
|
+
class ProjectPreferences {
|
|
187
|
+
/**
|
|
188
|
+
* Creates an instance of the ProjectPreferences class.
|
|
189
|
+
* @param client - The Axios client instance.
|
|
190
|
+
*/
|
|
191
|
+
constructor(client) {
|
|
192
|
+
this.client = client;
|
|
193
|
+
}
|
|
194
|
+
async list() {
|
|
195
|
+
const response = await this.client.get(ROUTES.preferences.list);
|
|
196
|
+
return response.data;
|
|
197
|
+
}
|
|
198
|
+
async get(preferenceID) {
|
|
199
|
+
const response = await this.client.get(ROUTES.preferences.get(preferenceID));
|
|
200
|
+
return response.data;
|
|
201
|
+
}
|
|
202
|
+
async create(req) {
|
|
203
|
+
const response = await this.client.post(ROUTES.preferences.create, req);
|
|
204
|
+
return response.data;
|
|
205
|
+
}
|
|
206
|
+
async update(preferenceID, req) {
|
|
207
|
+
const response = await this.client.patch(ROUTES.preferences.update(preferenceID), req);
|
|
208
|
+
return response.data;
|
|
209
|
+
}
|
|
210
|
+
async delete(preferenceID) {
|
|
211
|
+
await this.client.delete(ROUTES.preferences.delete(preferenceID));
|
|
212
|
+
}
|
|
213
|
+
async upsertMany(prefs, options) {
|
|
214
|
+
const response = await this.client.put(ROUTES.preferences.upsertMany, prefs, (options === null || options === void 0 ? void 0 : options.prune) ? { params: { prune: true } } : undefined);
|
|
215
|
+
return response.data;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
174
218
|
//# sourceMappingURL=bodhveda.js.map
|
package/dist/esm/bodhveda.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodhveda.js","sourceRoot":"","sources":["../../src/bodhveda.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"bodhveda.js","sourceRoot":"","sources":["../../src/bodhveda.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAsCzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA6BlC;;GAEG;AACH,MAAM,OAAO,QAAQ;IAKjB;;;;OAIG;IACH,YAAY,MAAc,EAAE,UAA2B,EAAE;QACrD,MAAM,EAAE,MAAM,GAAG,0BAA0B,EAAE,GAAG,OAAO,CAAC;QAExD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;YACxB,OAAO,EAAE,MAAM;YACf,OAAO,EAAE;gBACL,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,UAAU,MAAM,EAAE;aACpC;SACJ,CAAC,CAAC;QAEH,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAC5B,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,iDAAiD;QAC9E,CAAC,KAAiB,EAAE,EAAE;;YAClB,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,KAAI,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,C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|
|
|
1
1
|
export declare const ROUTES: {
|
|
2
2
|
notifications: {
|
|
3
3
|
send: string;
|
|
4
|
+
get: (notificationID: number) => string;
|
|
5
|
+
};
|
|
6
|
+
preferences: {
|
|
7
|
+
list: string;
|
|
8
|
+
create: string;
|
|
9
|
+
upsertMany: string;
|
|
10
|
+
get: (preferenceID: number) => string;
|
|
11
|
+
update: (preferenceID: number) => string;
|
|
12
|
+
delete: (preferenceID: number) => string;
|
|
4
13
|
};
|
|
5
14
|
recipients: {
|
|
6
15
|
create: string;
|
|
@@ -22,6 +31,7 @@ export declare const ROUTES: {
|
|
|
22
31
|
contacts: {
|
|
23
32
|
list: (recipientID: string) => string;
|
|
24
33
|
create: (recipientID: string) => string;
|
|
34
|
+
setPrimary: (recipientID: string) => string;
|
|
25
35
|
update: (recipientID: string, contactID: number) => string;
|
|
26
36
|
delete: (recipientID: string, contactID: number) => string;
|
|
27
37
|
};
|
package/dist/esm/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;8BAGW,MAAM;;;;;;4BASR,MAAM;+BACH,MAAM;+BACN,MAAM;;;;;2BAMV,MAAM;8BAEH,MAAM;8BAEN,MAAM;;gCAIJ,MAAM;uCAEC,MAAM;uCAIN,MAAM;kCAEX,MAAM;;;gCAKR,MAAM;+BAEP,MAAM;iCAEJ,MAAM;;;gCAOP,MAAM;kCAEJ,MAAM;sCAEF,MAAM;kCAEV,MAAM,aAAa,MAAM;kCAIzB,MAAM,aAAa,MAAM;;;CAM1D,CAAC"}
|
package/dist/esm/routes.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
export const ROUTES = {
|
|
2
2
|
notifications: {
|
|
3
3
|
send: "/notifications/send",
|
|
4
|
+
get: (notificationID) => `/notifications/${notificationID}`,
|
|
5
|
+
},
|
|
6
|
+
// Project-scoped preference CATALOG (project comes from the API key). Distinct
|
|
7
|
+
// from recipients.preferences, which is a single recipient's own toggles.
|
|
8
|
+
preferences: {
|
|
9
|
+
list: "/preferences",
|
|
10
|
+
create: "/preferences",
|
|
11
|
+
upsertMany: "/preferences",
|
|
12
|
+
get: (preferenceID) => `/preferences/${preferenceID}`,
|
|
13
|
+
update: (preferenceID) => `/preferences/${preferenceID}`,
|
|
14
|
+
delete: (preferenceID) => `/preferences/${preferenceID}`,
|
|
4
15
|
},
|
|
5
16
|
recipients: {
|
|
6
17
|
create: "/recipients",
|
|
@@ -22,6 +33,7 @@ export const ROUTES = {
|
|
|
22
33
|
contacts: {
|
|
23
34
|
list: (recipientID) => `/recipients/${encodeURIComponent(recipientID)}/contacts`,
|
|
24
35
|
create: (recipientID) => `/recipients/${encodeURIComponent(recipientID)}/contacts`,
|
|
36
|
+
setPrimary: (recipientID) => `/recipients/${encodeURIComponent(recipientID)}/contacts`,
|
|
25
37
|
update: (recipientID, contactID) => `/recipients/${encodeURIComponent(recipientID)}/contacts/${contactID}`,
|
|
26
38
|
delete: (recipientID, contactID) => `/recipients/${encodeURIComponent(recipientID)}/contacts/${contactID}`,
|
|
27
39
|
},
|
package/dist/esm/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/routes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,aAAa,EAAE;QACX,IAAI,EAAE,qBAAqB;
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/routes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,aAAa,EAAE;QACX,IAAI,EAAE,qBAAqB;QAC3B,GAAG,EAAE,CAAC,cAAsB,EAAE,EAAE,CA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E,CACzB,eAAe,kBAAkB,CAAC,WAAW,CAAC,cAAc;YAChE,KAAK,EAAE,CAAC,WAAmB,EAAE,EAAE,CAC3B,eAAe,kBAAkB,CAC7B,WAAW,CACd,oBAAoB;SAC5B;QAED,QAAQ,EAAE;YACN,IAAI,EAAE,CAAC,WAAmB,EAAE,EAAE,CAC1B,eAAe,kBAAkB,CAAC,WAAW,CAAC,WAAW;YAC7D,MAAM,EAAE,CAAC,WAAmB,EAAE,EAAE,CAC5B,eAAe,kBAAkB,CAAC,WAAW,CAAC,WAAW;YAC7D,UAAU,EAAE,CAAC,WAAmB,EAAE,EAAE,CAChC,eAAe,kBAAkB,CAAC,WAAW,CAAC,WAAW;YAC7D,MAAM,EAAE,CAAC,WAAmB,EAAE,SAAiB,EAAE,EAAE,CAC/C,eAAe,kBAAkB,CAC7B,WAAW,CACd,aAAa,SAAS,EAAE;YAC7B,MAAM,EAAE,CAAC,WAAmB,EAAE,SAAiB,EAAE,EAAE,CAC/C,eAAe,kBAAkB,CAC7B,WAAW,CACd,aAAa,SAAS,EAAE;SAChC;KACJ;CACJ,CAAC"}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -14,12 +14,15 @@ export type PreferenceMedium = "in_app" | "email";
|
|
|
14
14
|
/**
|
|
15
15
|
* Represents a preference target, extending the Target interface.
|
|
16
16
|
*/
|
|
17
|
-
export interface
|
|
17
|
+
export interface TargetWithName extends Target {
|
|
18
18
|
/**
|
|
19
19
|
* The medium this preference applies to (`in_app` or `email`).
|
|
20
20
|
*/
|
|
21
21
|
medium?: PreferenceMedium;
|
|
22
|
-
|
|
22
|
+
/** The catalog entry's name, present only when this target is cataloged. */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** The catalog entry's optional description, when it has one. */
|
|
25
|
+
description?: string;
|
|
23
26
|
}
|
|
24
27
|
/**
|
|
25
28
|
* Represents the state of a preference that was just written. It describes the
|
|
@@ -66,7 +69,7 @@ export interface ResolvedPreferenceState {
|
|
|
66
69
|
* Represents a resolved preference with a target and state.
|
|
67
70
|
*/
|
|
68
71
|
export interface Preference {
|
|
69
|
-
target:
|
|
72
|
+
target: TargetWithName;
|
|
70
73
|
state: ResolvedPreferenceState;
|
|
71
74
|
}
|
|
72
75
|
/**
|
|
@@ -85,9 +88,43 @@ export interface Notification {
|
|
|
85
88
|
payload: unknown;
|
|
86
89
|
target: Target;
|
|
87
90
|
state: NotificationState;
|
|
91
|
+
/**
|
|
92
|
+
* The in-app delivery outcome, resolved asynchronously by the worker:
|
|
93
|
+
* `enqueued` (accepted, not yet processed), `delivered`, `muted`
|
|
94
|
+
* (preferences disallow), `quota_exceeded`, or `failed`.
|
|
95
|
+
*/
|
|
96
|
+
status: string;
|
|
88
97
|
broadcast_id: number | null;
|
|
98
|
+
/** When the worker finished processing this notification (all mediums). */
|
|
99
|
+
completed_at?: string;
|
|
89
100
|
created_at: string;
|
|
90
101
|
updated_at: string;
|
|
102
|
+
/**
|
|
103
|
+
* The email-medium delivery outcome, present only when the send included an
|
|
104
|
+
* `email` block. Populated by {@link NotificationsClient.get}; absent on the
|
|
105
|
+
* recipient inbox feed. Use it to learn whether the email sent/delivered/bounced.
|
|
106
|
+
*/
|
|
107
|
+
email?: NotificationEmailDelivery;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The email-medium delivery outcome attached to a notification. Its lifecycle is
|
|
111
|
+
* independent of the in-app `status`: `pending` → `sent` (provider accepted) →
|
|
112
|
+
* `delivered` / `bounced` / `complained` (from provider webhooks), or `failed` /
|
|
113
|
+
* `muted` / `no_contact`.
|
|
114
|
+
*/
|
|
115
|
+
export interface NotificationEmailDelivery {
|
|
116
|
+
status: string;
|
|
117
|
+
failure_reason?: string;
|
|
118
|
+
attempt: number;
|
|
119
|
+
provider?: string;
|
|
120
|
+
provider_message_id?: string;
|
|
121
|
+
address_snapshot?: string;
|
|
122
|
+
sent_at?: string;
|
|
123
|
+
delivered_at?: string;
|
|
124
|
+
bounced_at?: string;
|
|
125
|
+
complained_at?: string;
|
|
126
|
+
opened_at?: string;
|
|
127
|
+
clicked_at?: string;
|
|
91
128
|
}
|
|
92
129
|
/**
|
|
93
130
|
* Represents a broadcast.
|
|
@@ -212,11 +249,20 @@ export interface SendNotificationResponse {
|
|
|
212
249
|
notification: Notification | null;
|
|
213
250
|
broadcast: Broadcast | null;
|
|
214
251
|
/**
|
|
215
|
-
*
|
|
216
|
-
*
|
|
252
|
+
* @deprecated The send is fully asynchronous — the notification is accepted
|
|
253
|
+
* (status `enqueued`) and every medium, including email, is resolved later by
|
|
254
|
+
* the worker. This field is therefore no longer populated on a send response.
|
|
255
|
+
* Read the resolved in-app status and the email outcome back with
|
|
256
|
+
* {@link NotificationsClient.get} (see {@link Notification.email}).
|
|
217
257
|
*/
|
|
218
258
|
deliveries?: NotificationDelivery[];
|
|
219
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* The response of {@link NotificationsClient.get}: a single notification with its
|
|
262
|
+
* resolved in-app {@link Notification.status} and, when the send included an
|
|
263
|
+
* email block, its {@link Notification.email} delivery outcome.
|
|
264
|
+
*/
|
|
265
|
+
export type GetNotificationResponse = Notification;
|
|
220
266
|
/**
|
|
221
267
|
* Represents a request to list notifications.
|
|
222
268
|
*/
|
|
@@ -289,7 +335,7 @@ export interface SetPreferenceRequest {
|
|
|
289
335
|
* Represents the response after setting a preference.
|
|
290
336
|
*/
|
|
291
337
|
export interface SetPreferenceResponse {
|
|
292
|
-
target:
|
|
338
|
+
target: TargetWithName;
|
|
293
339
|
state: PreferenceState;
|
|
294
340
|
}
|
|
295
341
|
/**
|
|
@@ -307,9 +353,86 @@ export interface CheckPreferenceRequest {
|
|
|
307
353
|
* cataloged, or stored at all — any (channel, topic, event) resolves.
|
|
308
354
|
*/
|
|
309
355
|
export interface CheckPreferenceResponse {
|
|
310
|
-
target:
|
|
356
|
+
target: TargetWithName;
|
|
311
357
|
state: ResolvedPreferenceState;
|
|
312
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* A project-level preference — one entry in the project's CATALOG. The catalog
|
|
361
|
+
* declares which (target, medium) pairs a project may send, and supplies the
|
|
362
|
+
* default a recipient inherits until they override it with a toggle of their own.
|
|
363
|
+
*
|
|
364
|
+
* This is distinct from {@link Preference}, which is one recipient's RESOLVED
|
|
365
|
+
* state. Manage the catalog with `bodhveda.preferences`; manage a recipient's
|
|
366
|
+
* own toggles with `bodhveda.recipients.preferences`.
|
|
367
|
+
*/
|
|
368
|
+
export interface ProjectPreference {
|
|
369
|
+
id: number;
|
|
370
|
+
project_id: number;
|
|
371
|
+
target: Target;
|
|
372
|
+
/** The medium this catalog entry gates (`in_app` or `email`). */
|
|
373
|
+
medium: PreferenceMedium;
|
|
374
|
+
/**
|
|
375
|
+
* The project-level default for this (target, medium): whether a recipient
|
|
376
|
+
* who has expressed no preference of their own is delivered to.
|
|
377
|
+
*/
|
|
378
|
+
default_enabled: boolean;
|
|
379
|
+
name: string;
|
|
380
|
+
/** Optional longer blurb for this catalog entry; `null` when unset. */
|
|
381
|
+
description: string | null;
|
|
382
|
+
created_at: string;
|
|
383
|
+
updated_at: string;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Request to create ONE catalog entry. Strict: creating an entry whose
|
|
387
|
+
* (channel, topic, event, medium) already exists rejects with a 409 — use
|
|
388
|
+
* {@link ProjectPreferencesClient.update} to change an existing entry, or
|
|
389
|
+
* {@link ProjectPreferencesClient.upsertMany} to declaratively merge a whole
|
|
390
|
+
* catalog.
|
|
391
|
+
*/
|
|
392
|
+
export interface CreateProjectPreferenceRequest {
|
|
393
|
+
channel: string;
|
|
394
|
+
topic: string;
|
|
395
|
+
event: string;
|
|
396
|
+
/** Defaults to `in_app` when omitted. */
|
|
397
|
+
medium?: PreferenceMedium;
|
|
398
|
+
name: string;
|
|
399
|
+
/**
|
|
400
|
+
* Optional longer blurb (e.g. "Receive notifications about new products,
|
|
401
|
+
* features, and more."). Omitted stores no description.
|
|
402
|
+
*/
|
|
403
|
+
description?: string;
|
|
404
|
+
default_enabled: boolean;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Request to update a catalog entry. The natural key
|
|
408
|
+
* (channel/topic/event/medium) is immutable, so only the name, description and
|
|
409
|
+
* default change.
|
|
410
|
+
*/
|
|
411
|
+
export interface UpdateProjectPreferenceRequest {
|
|
412
|
+
name: string;
|
|
413
|
+
/** Optional; omitted clears the description. */
|
|
414
|
+
description?: string;
|
|
415
|
+
default_enabled: boolean;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* One item of a declarative bulk upsert — the same shape as
|
|
419
|
+
* {@link CreateProjectPreferenceRequest}.
|
|
420
|
+
*/
|
|
421
|
+
export interface UpsertProjectPreferenceItem extends CreateProjectPreferenceRequest {
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Options for {@link ProjectPreferencesClient.upsertMany}.
|
|
425
|
+
*/
|
|
426
|
+
export interface UpsertProjectPreferencesOptions {
|
|
427
|
+
/**
|
|
428
|
+
* When `true`, catalog entries NOT present in the array are DELETED, making
|
|
429
|
+
* the array the project's entire desired catalog. Default `false` (merge):
|
|
430
|
+
* absent entries are left untouched. Pruning un-catalogs a (target, medium),
|
|
431
|
+
* which turns a non-in_app medium off for recipients relying on the catalog
|
|
432
|
+
* default — hence it is opt-in.
|
|
433
|
+
*/
|
|
434
|
+
prune?: boolean;
|
|
435
|
+
}
|
|
313
436
|
/**
|
|
314
437
|
* A delivery transport a recipient contact can be registered for. Only `email`
|
|
315
438
|
* is exercised today; the rest are reserved for future transports.
|
|
@@ -359,5 +482,20 @@ export interface UpdateRecipientContactRequest {
|
|
|
359
482
|
*/
|
|
360
483
|
export interface UpdateRecipientContactResponse extends RecipientContact {
|
|
361
484
|
}
|
|
485
|
+
/**
|
|
486
|
+
* Request to ensure a primary contact for a medium — the body of
|
|
487
|
+
* {@link RecipientsContactsClient.setPrimary}. Idempotent create-or-update:
|
|
488
|
+
* creates the primary if absent, updates the existing primary's address if it
|
|
489
|
+
* differs (which resets verification), or no-ops if it already matches.
|
|
490
|
+
*/
|
|
491
|
+
export interface SetPrimaryContactRequest {
|
|
492
|
+
medium: Medium;
|
|
493
|
+
address: string;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Represents the response after setting a primary contact.
|
|
497
|
+
*/
|
|
498
|
+
export interface SetPrimaryContactResponse extends RecipientContact {
|
|
499
|
+
}
|
|
362
500
|
export {};
|
|
363
501
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,MAAM;IAC1C;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,SAA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;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,gBAAgB;CAAG;AAE3E;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC1C,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,gBAAgB;CAAG;AAE3E;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;CAAG"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bodhveda/js",
|
|
3
3
|
"description": "JavaScript SDK for Bodhveda",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"prepublishOnly": "npm run clean && npm run build"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"axios": "^1.
|
|
43
|
+
"axios": "^1.16.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"typescript": "^5.9.2"
|