ab-ecosystem-cpass 1.0.7 → 1.0.8
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 +5 -1
- package/dist/client.d.ts +24 -0
- package/dist/client.js +28 -0
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/audience/canned-replies.d.ts +95 -0
- package/dist/resources/audience/canned-replies.js +112 -0
- package/dist/resources/audience/canned-replies.js.map +1 -0
- package/dist/resources/audience/notifications.d.ts +14 -0
- package/dist/resources/audience/notifications.js +14 -0
- package/dist/resources/audience/notifications.js.map +1 -1
- package/dist/resources/campaign-messages.d.ts +25 -22
- package/dist/resources/campaign-messages.js +34 -27
- package/dist/resources/campaign-messages.js.map +1 -1
- package/dist/resources/data-stores.d.ts +469 -0
- package/dist/resources/data-stores.js +530 -0
- package/dist/resources/data-stores.js.map +1 -0
- package/dist/resources/paths.d.ts +6 -0
- package/dist/resources/paths.js +7 -1
- package/dist/resources/paths.js.map +1 -1
- package/dist/types/campaign.d.ts +11 -5
- package/dist/types/canned-reply.d.ts +124 -0
- package/dist/types/canned-reply.js +6 -0
- package/dist/types/canned-reply.js.map +1 -0
- package/dist/types/datastore.d.ts +260 -0
- package/dist/types/datastore.js +21 -0
- package/dist/types/datastore.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -1
- package/docs/audience/canned-replies.md +302 -0
- package/docs/audience/notifications.md +99 -0
- package/docs/campaign/campaign-messages.md +31 -22
- package/docs/campaign/campaigns.md +1 -1
- package/docs/data-store.md +495 -0
- package/package.json +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canned replies: message payloads an agent sends into a chat without retyping
|
|
3
|
+
* them.
|
|
4
|
+
*
|
|
5
|
+
* Two kinds, and the difference is who gets the last word. A `CANNED` reply
|
|
6
|
+
* sends every message it holds, exactly as stored, in order, the moment it is
|
|
7
|
+
* picked -- so a three-message reply puts three messages on the contact's phone
|
|
8
|
+
* from one keystroke. A `QUICK` reply drops its text into the agent's composer
|
|
9
|
+
* to edit before sending, which is why it holds exactly one text message and
|
|
10
|
+
* nothing else: there is one composer, and nowhere to put an image in it.
|
|
11
|
+
*
|
|
12
|
+
* Declared here rather than imported from `@crm/contracts` so the published
|
|
13
|
+
* package has no private dependencies; kept in step with the zod schemas.
|
|
14
|
+
*/
|
|
15
|
+
import type { JsonObject, ListQuery } from './common';
|
|
16
|
+
import type { MessageContent } from './inbox';
|
|
17
|
+
export type CannedReplyType = 'CANNED' | 'QUICK';
|
|
18
|
+
/**
|
|
19
|
+
* The channel shape the stored payload is written for -- a channel *type*, never
|
|
20
|
+
* a channel id, so one reply works across every number on the account.
|
|
21
|
+
*
|
|
22
|
+
* `whatsapp` is the only value the panel offers today, and the reason is
|
|
23
|
+
* `whatsapp_api` below: a stored message is a literal WhatsApp Cloud API message
|
|
24
|
+
* object, so a reply is only sendable on a channel that speaks that shape.
|
|
25
|
+
*/
|
|
26
|
+
export type CannedReplyChannel = 'whatsapp' | 'sms' | 'email' | 'rcs' | 'webchat';
|
|
27
|
+
/** Most messages one reply may hold. A `CANNED` reply sends all of them. */
|
|
28
|
+
export declare const MAX_CANNED_REPLY_MESSAGES = 10;
|
|
29
|
+
/**
|
|
30
|
+
* The editor's own working copy of a message.
|
|
31
|
+
*
|
|
32
|
+
* Stored and returned verbatim, and never read by the server: it is the form
|
|
33
|
+
* state a composer needs to reopen the message for editing -- which media type
|
|
34
|
+
* was chosen, whether the upload was still local, the button rows before they
|
|
35
|
+
* were flattened into an action. `whatsapp_api` is the authority on what gets
|
|
36
|
+
* sent; this is the authority on what the edit screen shows.
|
|
37
|
+
*
|
|
38
|
+
* Optional. A reply created through the API without one is valid; an editor just
|
|
39
|
+
* opens it in whatever state it can infer from `whatsapp_api`.
|
|
40
|
+
*/
|
|
41
|
+
export type CannedReplyDraft = JsonObject;
|
|
42
|
+
/**
|
|
43
|
+
* One message in a reply, as written by the current editor.
|
|
44
|
+
*
|
|
45
|
+
* `whatsapp_api` is the payload as the provider takes it -- the same object
|
|
46
|
+
* `inbox.messages.send()` accepts as `content`. Only `type` is promised; by
|
|
47
|
+
* convention the body sits under a key of the same name.
|
|
48
|
+
*
|
|
49
|
+
* Variable placeholders in a body are stored **literally**. Substitution happens
|
|
50
|
+
* at the moment of sending, against the contact in front of the agent; there is
|
|
51
|
+
* no contact when a reply is written.
|
|
52
|
+
*/
|
|
53
|
+
export interface CannedReplyMessageV2 {
|
|
54
|
+
version: '2';
|
|
55
|
+
whatsapp_api: MessageContent;
|
|
56
|
+
internal?: CannedReplyDraft;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A message row written before the editor was rewritten.
|
|
60
|
+
*
|
|
61
|
+
* These carry a flat `type` plus a `components` array in template form, and are
|
|
62
|
+
* returned exactly as stored -- synthesising a `whatsapp_api` for them would
|
|
63
|
+
* mean inventing a payload nobody approved. Narrow with
|
|
64
|
+
* `message.version === '2'` before reading `whatsapp_api`; everything else is one
|
|
65
|
+
* of these. New writes are v2 only: there is no way to create one of these
|
|
66
|
+
* through the API.
|
|
67
|
+
*/
|
|
68
|
+
export type CannedReplyMessageLegacy = JsonObject & {
|
|
69
|
+
version?: undefined;
|
|
70
|
+
};
|
|
71
|
+
export type CannedReplyMessage = CannedReplyMessageV2 | CannedReplyMessageLegacy;
|
|
72
|
+
/** A message on the way *in* -- always v2, because that is all a write accepts. */
|
|
73
|
+
export interface CannedReplyMessageInput {
|
|
74
|
+
/** Defaults to `'2'`. The only accepted value. */
|
|
75
|
+
version?: '2';
|
|
76
|
+
whatsapp_api: MessageContent;
|
|
77
|
+
internal?: CannedReplyDraft;
|
|
78
|
+
}
|
|
79
|
+
export interface CreateCannedReplyInput {
|
|
80
|
+
/**
|
|
81
|
+
* What the agent types after `/`. Trimmed, 1..120 characters, unique per
|
|
82
|
+
* account -- a duplicate is a 409, not a silent overwrite.
|
|
83
|
+
*/
|
|
84
|
+
name: string;
|
|
85
|
+
type: CannedReplyType;
|
|
86
|
+
/** Default `'whatsapp'`. */
|
|
87
|
+
channel?: CannedReplyChannel;
|
|
88
|
+
/** 1..{@link MAX_CANNED_REPLY_MESSAGES}. A `QUICK` reply must hold exactly one, of type `text`. */
|
|
89
|
+
messages: CannedReplyMessageInput[];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Any subset of the create body.
|
|
93
|
+
*
|
|
94
|
+
* `messages` is replaced whole, never merged: a reply is an ordered sequence, and
|
|
95
|
+
* there is no sensible way to patch element two of a list whose length is also
|
|
96
|
+
* changing. Send the array you want stored.
|
|
97
|
+
*/
|
|
98
|
+
export type UpdateCannedReplyInput = Partial<CreateCannedReplyInput>;
|
|
99
|
+
/**
|
|
100
|
+
* `search` matches the name, case-insensitively, anywhere in it; the term is
|
|
101
|
+
* escaped, so `(` and `.` are searched for rather than compiled. `type` and
|
|
102
|
+
* `channel` narrow the list -- the chat panel passes both, wanting the replies
|
|
103
|
+
* usable on the channel of the chat that is open.
|
|
104
|
+
*/
|
|
105
|
+
export interface ListCannedRepliesQuery extends ListQuery {
|
|
106
|
+
type?: CannedReplyType;
|
|
107
|
+
channel?: CannedReplyChannel;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A stored reply.
|
|
111
|
+
*
|
|
112
|
+
* `messages` comes back in full from every endpoint, list included. It is the
|
|
113
|
+
* entire point of the record, and a picker that had to fetch each reply before it
|
|
114
|
+
* could show what the reply says would make one request per keystroke.
|
|
115
|
+
*/
|
|
116
|
+
export interface CannedReply {
|
|
117
|
+
id: string;
|
|
118
|
+
name: string;
|
|
119
|
+
type: CannedReplyType;
|
|
120
|
+
channel: CannedReplyChannel;
|
|
121
|
+
messages: CannedReplyMessage[];
|
|
122
|
+
createdAt: string;
|
|
123
|
+
updatedAt: string;
|
|
124
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_CANNED_REPLY_MESSAGES = void 0;
|
|
4
|
+
/** Most messages one reply may hold. A `CANNED` reply sends all of them. */
|
|
5
|
+
exports.MAX_CANNED_REPLY_MESSAGES = 10;
|
|
6
|
+
//# sourceMappingURL=canned-reply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canned-reply.js","sourceRoot":"","sources":["../../src/types/canned-reply.ts"],"names":[],"mappings":";;;AA6BA,4EAA4E;AAC/D,QAAA,yBAAyB,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data Store: a customer's own MongoDB, registered with the platform.
|
|
3
|
+
*
|
|
4
|
+
* Three nested things:
|
|
5
|
+
*
|
|
6
|
+
* 1. **A data store** -- a connection to a database *you* own. The platform
|
|
7
|
+
* holds the credential and nothing else: no copy of the data, no mirror.
|
|
8
|
+
* 2. **A collection** -- a schema you declare, naming a collection inside that
|
|
9
|
+
* database and the fields in it.
|
|
10
|
+
* 3. **Records** -- the documents. They live in your database, and every record
|
|
11
|
+
* call is a live round trip to your cluster.
|
|
12
|
+
*
|
|
13
|
+
* The thing to keep in mind throughout: the platform is not the system of
|
|
14
|
+
* record. Anything else holding those credentials can change the same data, so
|
|
15
|
+
* a read is always current and a schema is a *declaration* rather than a
|
|
16
|
+
* guarantee -- a document may carry fields the schema never mentioned, or lack
|
|
17
|
+
* ones it does.
|
|
18
|
+
*/
|
|
19
|
+
/** The five storage types a field can declare. */
|
|
20
|
+
export type DataStoreFieldType = 'String' | 'Number' | 'Boolean' | 'Date' | 'Array';
|
|
21
|
+
/**
|
|
22
|
+
* One declared field.
|
|
23
|
+
*
|
|
24
|
+
* `name` is **slugged** by the server: punctuation is dropped, spaces and
|
|
25
|
+
* hyphens become underscores, and the result is lowercased, so `"First Name"`
|
|
26
|
+
* comes back as `first_name`. Use the name the response gives you as the key in
|
|
27
|
+
* every record payload -- it is the key the document actually has.
|
|
28
|
+
*/
|
|
29
|
+
export interface DataStoreField {
|
|
30
|
+
name: string;
|
|
31
|
+
type: DataStoreFieldType;
|
|
32
|
+
/** For display. Never used as a key, so it can be whatever reads well. */
|
|
33
|
+
label?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Applied when a record omits the field. `String`, `Number` and `Boolean`
|
|
36
|
+
* only: a `Date` default would have to mean "now", and an `Array` default
|
|
37
|
+
* shared between documents is a trap.
|
|
38
|
+
*/
|
|
39
|
+
default?: string | number | boolean;
|
|
40
|
+
}
|
|
41
|
+
/** The two ways to name a database. */
|
|
42
|
+
export type DataStoreCredentials = {
|
|
43
|
+
type: 'field';
|
|
44
|
+
/** Hostname only: `cluster0.ab12c.mongodb.net`. No scheme, no port, no path. */
|
|
45
|
+
host: string;
|
|
46
|
+
username: string;
|
|
47
|
+
password: string;
|
|
48
|
+
database: string;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'string';
|
|
51
|
+
/**
|
|
52
|
+
* A full connection string. Must name a database --
|
|
53
|
+
* `mongodb+srv://user:pass@host/<database>` -- because a URI without one
|
|
54
|
+
* silently puts every record in a database called `test`.
|
|
55
|
+
*/
|
|
56
|
+
uri: string;
|
|
57
|
+
};
|
|
58
|
+
export interface CreateDataStoreInput {
|
|
59
|
+
title: string;
|
|
60
|
+
credentials: DataStoreCredentials;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Rename, re-point, or both.
|
|
64
|
+
*
|
|
65
|
+
* Credentials are replaced whole or not at all: a host without its matching
|
|
66
|
+
* password is not a partial credential, it is a broken one. New credentials are
|
|
67
|
+
* tested before anything is stored.
|
|
68
|
+
*/
|
|
69
|
+
export interface UpdateDataStoreInput {
|
|
70
|
+
title?: string;
|
|
71
|
+
credentials?: DataStoreCredentials;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A registered data store.
|
|
75
|
+
*
|
|
76
|
+
* **No credential is ever returned.** The password is encrypted at rest and does
|
|
77
|
+
* not come back in any form; `summary` is the connection with its password
|
|
78
|
+
* replaced by `***`, which is what an edit screen needs to show which database
|
|
79
|
+
* it is looking at.
|
|
80
|
+
*/
|
|
81
|
+
export interface DataStore {
|
|
82
|
+
id: string;
|
|
83
|
+
title: string;
|
|
84
|
+
credentialType: 'field' | 'string';
|
|
85
|
+
engine: 'mongodb';
|
|
86
|
+
host: string;
|
|
87
|
+
database: string;
|
|
88
|
+
username: string;
|
|
89
|
+
/** The connection string with the password removed, for display. */
|
|
90
|
+
summary: string;
|
|
91
|
+
/** When the connection was last proven to work: a create, an update, or a test. */
|
|
92
|
+
verifiedAt?: string;
|
|
93
|
+
createdAt: string;
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
}
|
|
96
|
+
/** What `test()` found. */
|
|
97
|
+
export interface DataStoreTestResult {
|
|
98
|
+
ok: boolean;
|
|
99
|
+
/** The database the credential actually lands in. */
|
|
100
|
+
database: string;
|
|
101
|
+
/**
|
|
102
|
+
* Collections already in that database, up to 100, `system.*` excluded.
|
|
103
|
+
*
|
|
104
|
+
* Empty when the database user has no `listCollections` privilege, which a
|
|
105
|
+
* least-privilege credential legitimately may not -- it does not mean the
|
|
106
|
+
* database is empty.
|
|
107
|
+
*/
|
|
108
|
+
collections: string[];
|
|
109
|
+
/** Round-trip milliseconds for the ping. A rough health signal, not a metric. */
|
|
110
|
+
latencyMs: number;
|
|
111
|
+
}
|
|
112
|
+
export interface CreateDataStoreCollectionInput {
|
|
113
|
+
title: string;
|
|
114
|
+
fields: DataStoreField[];
|
|
115
|
+
/**
|
|
116
|
+
* An existing collection to use instead of a new one.
|
|
117
|
+
*
|
|
118
|
+
* Omitted, the server generates `<schema id>_<slugged title>`, which cannot
|
|
119
|
+
* collide with anything already in the database. Supplied, this points at a
|
|
120
|
+
* collection you already have -- which is how a database with data in it gets
|
|
121
|
+
* used rather than duplicated.
|
|
122
|
+
*
|
|
123
|
+
* Immutable once set. A schema points at one collection for its whole life.
|
|
124
|
+
*/
|
|
125
|
+
collection?: string;
|
|
126
|
+
/** Whether the chat panel offers this collection beside a conversation. */
|
|
127
|
+
show_in_chat?: boolean;
|
|
128
|
+
/** Presentation only. Nothing here changes what is stored or queryable. */
|
|
129
|
+
display?: {
|
|
130
|
+
theme?: string;
|
|
131
|
+
fields?: string[];
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Edits to a declaration. `collection` is deliberately not editable.
|
|
136
|
+
*
|
|
137
|
+
* Changing `fields` changes validation and coercion from the next call onward
|
|
138
|
+
* and rewrites nothing already stored. Dropping a field hides the values under
|
|
139
|
+
* that key rather than deleting them; re-declaring it shows them again.
|
|
140
|
+
*/
|
|
141
|
+
export interface UpdateDataStoreCollectionInput {
|
|
142
|
+
title?: string;
|
|
143
|
+
fields?: DataStoreField[];
|
|
144
|
+
show_in_chat?: boolean;
|
|
145
|
+
display?: {
|
|
146
|
+
theme?: string;
|
|
147
|
+
fields?: string[];
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
export interface DataStoreCollection {
|
|
151
|
+
id: string;
|
|
152
|
+
storeId: string;
|
|
153
|
+
title: string;
|
|
154
|
+
/** The collection this reads and writes inside your database. */
|
|
155
|
+
collection: string;
|
|
156
|
+
fields: DataStoreField[];
|
|
157
|
+
showInChat: boolean;
|
|
158
|
+
display: {
|
|
159
|
+
theme?: string;
|
|
160
|
+
fields: string[];
|
|
161
|
+
};
|
|
162
|
+
createdAt: string;
|
|
163
|
+
updatedAt: string;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* One document, as it reads back.
|
|
167
|
+
*
|
|
168
|
+
* **Every stored key is returned**, declared or not: a collection you already
|
|
169
|
+
* had, or one another application also writes to, holds fields this schema has
|
|
170
|
+
* never heard of, and hiding your own data because the declaration is incomplete
|
|
171
|
+
* would be worse than surprising. The schema governs what can be *written*
|
|
172
|
+
* through the API; it does not filter what comes back.
|
|
173
|
+
*
|
|
174
|
+
* `_id` reads back as `id`, and dates as ISO strings.
|
|
175
|
+
*/
|
|
176
|
+
export type DataStoreRecord = Record<string, unknown> & {
|
|
177
|
+
id: string;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* A record body on the way in.
|
|
181
|
+
*
|
|
182
|
+
* Keys must be declared field names. An undeclared key is a **422 naming it**,
|
|
183
|
+
* not a silent drop -- which is the one behaviour here that differs from the
|
|
184
|
+
* legacy endpoint, where a typo meant data quietly went nowhere.
|
|
185
|
+
*
|
|
186
|
+
* `null` clears a field. `id`, `_id`, `created_on` and `updated_on` are the
|
|
187
|
+
* server's: the timestamps are ignored if sent, the ids are refused.
|
|
188
|
+
*/
|
|
189
|
+
export type DataStoreRecordBody = Record<string, unknown>;
|
|
190
|
+
/** Insert one record, or up to 1000. */
|
|
191
|
+
export type InsertDataStoreRecordsInput = {
|
|
192
|
+
record: DataStoreRecordBody;
|
|
193
|
+
records?: never;
|
|
194
|
+
} | {
|
|
195
|
+
records: DataStoreRecordBody[];
|
|
196
|
+
record?: never;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* A Mongo query, as you would write it for the driver.
|
|
200
|
+
*
|
|
201
|
+
* The full language -- `$in`, `$gt`, `$or`, `$regex`, `$elemMatch` -- because it
|
|
202
|
+
* is your database and there is nothing in it you do not already own. Three
|
|
203
|
+
* operators are refused wherever they appear: `$where`, `$function` and
|
|
204
|
+
* `$accumulator`, all of which run JavaScript on your cluster.
|
|
205
|
+
*
|
|
206
|
+
* Operand values are coerced against the declared field type before the query is
|
|
207
|
+
* sent, so `{ created_on: { $gte: '2026-01-01' } }` against a `Date` field
|
|
208
|
+
* matches real dates rather than comparing a string to a date and finding
|
|
209
|
+
* nothing. `id` works as an alias for `_id` and takes the string form.
|
|
210
|
+
*/
|
|
211
|
+
export type DataStoreFilter = Record<string, unknown>;
|
|
212
|
+
/**
|
|
213
|
+
* Paging and ordering for a record list.
|
|
214
|
+
*
|
|
215
|
+
* A type alias rather than an interface deliberately: only aliases of object
|
|
216
|
+
* literals get TypeScript's implicit index signature, which is what lets this
|
|
217
|
+
* be passed as the query record the HTTP client takes. An interface here fails
|
|
218
|
+
* to compile at the call site with a message about a missing index signature.
|
|
219
|
+
*/
|
|
220
|
+
export type ListDataStoreRecordsQuery = {
|
|
221
|
+
page?: number;
|
|
222
|
+
/** 1-100, default 25. */
|
|
223
|
+
rows?: number;
|
|
224
|
+
/** A field name. Defaults to `created_on`. */
|
|
225
|
+
sort?: string;
|
|
226
|
+
/** Defaults to `desc`. */
|
|
227
|
+
order?: 'asc' | 'desc';
|
|
228
|
+
};
|
|
229
|
+
export type SearchDataStoreRecordsInput = ListDataStoreRecordsQuery & {
|
|
230
|
+
filter: DataStoreFilter;
|
|
231
|
+
};
|
|
232
|
+
export interface UpdateDataStoreRecordInput {
|
|
233
|
+
record: DataStoreRecordBody;
|
|
234
|
+
}
|
|
235
|
+
/** The filter cannot be empty: `{}` would rewrite the whole collection. */
|
|
236
|
+
export interface BulkUpdateDataStoreRecordsInput {
|
|
237
|
+
filter: DataStoreFilter;
|
|
238
|
+
update: DataStoreRecordBody;
|
|
239
|
+
}
|
|
240
|
+
/** The filter cannot be empty, for the same reason. */
|
|
241
|
+
export interface BulkDeleteDataStoreRecordsInput {
|
|
242
|
+
filter: DataStoreFilter;
|
|
243
|
+
}
|
|
244
|
+
export interface DataStoreWriteResult {
|
|
245
|
+
/**
|
|
246
|
+
* Documents inserted. Can be fewer than were sent: a batch is unordered, so
|
|
247
|
+
* one document rejected by an index of yours does not abandon the rest.
|
|
248
|
+
*/
|
|
249
|
+
inserted: number;
|
|
250
|
+
/** Ids of the inserted documents, in the order they were sent. */
|
|
251
|
+
ids: string[];
|
|
252
|
+
}
|
|
253
|
+
export interface DataStoreUpdateResult {
|
|
254
|
+
matched: number;
|
|
255
|
+
/** Lower than `matched` when a record already held the values being written. */
|
|
256
|
+
modified: number;
|
|
257
|
+
}
|
|
258
|
+
export interface DataStoreDeleteResult {
|
|
259
|
+
deleted: number;
|
|
260
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Data Store: a customer's own MongoDB, registered with the platform.
|
|
4
|
+
*
|
|
5
|
+
* Three nested things:
|
|
6
|
+
*
|
|
7
|
+
* 1. **A data store** -- a connection to a database *you* own. The platform
|
|
8
|
+
* holds the credential and nothing else: no copy of the data, no mirror.
|
|
9
|
+
* 2. **A collection** -- a schema you declare, naming a collection inside that
|
|
10
|
+
* database and the fields in it.
|
|
11
|
+
* 3. **Records** -- the documents. They live in your database, and every record
|
|
12
|
+
* call is a live round trip to your cluster.
|
|
13
|
+
*
|
|
14
|
+
* The thing to keep in mind throughout: the platform is not the system of
|
|
15
|
+
* record. Anything else holding those credentials can change the same data, so
|
|
16
|
+
* a read is always current and a schema is a *declaration* rather than a
|
|
17
|
+
* guarantee -- a document may carry fields the schema never mentioned, or lack
|
|
18
|
+
* ones it does.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
//# sourceMappingURL=datastore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datastore.js","sourceRoot":"","sources":["../../src/types/datastore.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './common';
|
|
2
2
|
export * from './contact-filter';
|
|
3
3
|
export * from './audience';
|
|
4
|
+
export * from './datastore';
|
|
4
5
|
export * from './channels';
|
|
5
6
|
export * from './inbox';
|
|
7
|
+
export * from './canned-reply';
|
|
6
8
|
export * from './scheduled-message';
|
|
7
9
|
export * from './campaign';
|
package/dist/types/index.js
CHANGED
|
@@ -17,8 +17,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./common"), exports);
|
|
18
18
|
__exportStar(require("./contact-filter"), exports);
|
|
19
19
|
__exportStar(require("./audience"), exports);
|
|
20
|
+
__exportStar(require("./datastore"), exports);
|
|
20
21
|
__exportStar(require("./channels"), exports);
|
|
21
22
|
__exportStar(require("./inbox"), exports);
|
|
23
|
+
// After './inbox': a canned reply's stored payload is a `MessageContent`.
|
|
24
|
+
__exportStar(require("./canned-reply"), exports);
|
|
22
25
|
// After './inbox': a scheduled message's body is a `MessageContent`.
|
|
23
26
|
__exportStar(require("./scheduled-message"), exports);
|
|
24
27
|
// After './contact-filter': a campaign's audience may be a list of its entries.
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,mDAAiC;AACjC,6CAA2B;AAC3B,6CAA2B;AAC3B,0CAAwB;AACxB,qEAAqE;AACrE,sDAAoC;AACpC,gFAAgF;AAChF,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,mDAAiC;AACjC,6CAA2B;AAC3B,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AACxB,0EAA0E;AAC1E,iDAA+B;AAC/B,qEAAqE;AACrE,sDAAoC;AACpC,gFAAgF;AAChF,6CAA2B"}
|