@aglyn/plugins-outreach 1.0.0-beta.143
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/LICENSE +201 -0
- package/README.md +93 -0
- package/package.json +52 -0
- package/src/index.d.ts +22 -0
- package/src/index.js +29 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/compliance-section.d.ts +20 -0
- package/src/lib/components/compliance-section.js +291 -0
- package/src/lib/components/compliance-section.js.map +1 -0
- package/src/lib/components/enroll-dialog.d.ts +36 -0
- package/src/lib/components/enroll-dialog.js +656 -0
- package/src/lib/components/enroll-dialog.js.map +1 -0
- package/src/lib/components/enrollments-table.d.ts +28 -0
- package/src/lib/components/enrollments-table.js +375 -0
- package/src/lib/components/enrollments-table.js.map +1 -0
- package/src/lib/components/mailbox-card.d.ts +46 -0
- package/src/lib/components/mailbox-card.js +517 -0
- package/src/lib/components/mailbox-card.js.map +1 -0
- package/src/lib/components/mailboxes-section.d.ts +24 -0
- package/src/lib/components/mailboxes-section.js +258 -0
- package/src/lib/components/mailboxes-section.js.map +1 -0
- package/src/lib/components/outreach-console-page.d.ts +17 -0
- package/src/lib/components/outreach-console-page.js +81 -0
- package/src/lib/components/outreach-console-page.js.map +1 -0
- package/src/lib/components/outreach-console-sections.d.ts +43 -0
- package/src/lib/components/outreach-console-sections.js +55 -0
- package/src/lib/components/outreach-console-sections.js.map +1 -0
- package/src/lib/components/outreach-ui.d.ts +51 -0
- package/src/lib/components/outreach-ui.js +171 -0
- package/src/lib/components/outreach-ui.js.map +1 -0
- package/src/lib/components/send-window-fields.d.ts +25 -0
- package/src/lib/components/send-window-fields.js +178 -0
- package/src/lib/components/send-window-fields.js.map +1 -0
- package/src/lib/components/sequence-detail.d.ts +54 -0
- package/src/lib/components/sequence-detail.js +435 -0
- package/src/lib/components/sequence-detail.js.map +1 -0
- package/src/lib/components/sequence-editor.d.ts +37 -0
- package/src/lib/components/sequence-editor.js +485 -0
- package/src/lib/components/sequence-editor.js.map +1 -0
- package/src/lib/components/sequence-mailbox-picker.d.ts +44 -0
- package/src/lib/components/sequence-mailbox-picker.js +137 -0
- package/src/lib/components/sequence-mailbox-picker.js.map +1 -0
- package/src/lib/components/sequence-preview.d.ts +27 -0
- package/src/lib/components/sequence-preview.js +146 -0
- package/src/lib/components/sequence-preview.js.map +1 -0
- package/src/lib/components/sequence-step-card.d.ts +31 -0
- package/src/lib/components/sequence-step-card.js +326 -0
- package/src/lib/components/sequence-step-card.js.map +1 -0
- package/src/lib/components/sequences-section.d.ts +40 -0
- package/src/lib/components/sequences-section.js +310 -0
- package/src/lib/components/sequences-section.js.map +1 -0
- package/src/lib/components/use-outreach-api.d.ts +38 -0
- package/src/lib/components/use-outreach-api.js +139 -0
- package/src/lib/components/use-outreach-api.js.map +1 -0
- package/src/lib/components/use-outreach-crm.d.ts +50 -0
- package/src/lib/components/use-outreach-crm.js +200 -0
- package/src/lib/components/use-outreach-crm.js.map +1 -0
- package/src/lib/components/use-outreach-data.d.ts +55 -0
- package/src/lib/components/use-outreach-data.js +199 -0
- package/src/lib/components/use-outreach-data.js.map +1 -0
- package/src/lib/components/use-outreach-mailbox-api.d.ts +30 -0
- package/src/lib/components/use-outreach-mailbox-api.js +101 -0
- package/src/lib/components/use-outreach-mailbox-api.js.map +1 -0
- package/src/lib/components/use-outreach-mailboxes.d.ts +22 -0
- package/src/lib/components/use-outreach-mailboxes.js +68 -0
- package/src/lib/components/use-outreach-mailboxes.js.map +1 -0
- package/src/lib/components/use-outreach-settings.d.ts +17 -0
- package/src/lib/components/use-outreach-settings.js +64 -0
- package/src/lib/components/use-outreach-settings.js.map +1 -0
- package/src/lib/constants/api-routes.d.ts +68 -0
- package/src/lib/constants/api-routes.js +57 -0
- package/src/lib/constants/api-routes.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +46 -0
- package/src/lib/constants/bundle-common.js +55 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/constants/runtime-jobs.d.ts +24 -0
- package/src/lib/constants/runtime-jobs.js +24 -0
- package/src/lib/constants/runtime-jobs.js.map +1 -0
- package/src/lib/declarations.console-server.d.ts +38 -0
- package/src/lib/declarations.console-server.js +99 -0
- package/src/lib/declarations.console-server.js.map +1 -0
- package/src/lib/engine/compose.d.ts +86 -0
- package/src/lib/engine/compose.js +212 -0
- package/src/lib/engine/compose.js.map +1 -0
- package/src/lib/engine/delivery-status.d.ts +53 -0
- package/src/lib/engine/delivery-status.js +184 -0
- package/src/lib/engine/delivery-status.js.map +1 -0
- package/src/lib/engine/do-not-contact.d.ts +18 -0
- package/src/lib/engine/do-not-contact.js +34 -0
- package/src/lib/engine/do-not-contact.js.map +1 -0
- package/src/lib/engine/enrollment-state.d.ts +156 -0
- package/src/lib/engine/enrollment-state.js +303 -0
- package/src/lib/engine/enrollment-state.js.map +1 -0
- package/src/lib/engine/gates.d.ts +125 -0
- package/src/lib/engine/gates.js +232 -0
- package/src/lib/engine/gates.js.map +1 -0
- package/src/lib/engine/index.d.ts +28 -0
- package/src/lib/engine/index.js +33 -0
- package/src/lib/engine/index.js.map +1 -0
- package/src/lib/engine/mailbox-health.d.ts +49 -0
- package/src/lib/engine/mailbox-health.js +83 -0
- package/src/lib/engine/mailbox-health.js.map +1 -0
- package/src/lib/engine/opt-out-intent.d.ts +41 -0
- package/src/lib/engine/opt-out-intent.js +220 -0
- package/src/lib/engine/opt-out-intent.js.map +1 -0
- package/src/lib/engine/recipient-country.d.ts +41 -0
- package/src/lib/engine/recipient-country.js +171 -0
- package/src/lib/engine/recipient-country.js.map +1 -0
- package/src/lib/engine/schedule.d.ts +70 -0
- package/src/lib/engine/schedule.js +115 -0
- package/src/lib/engine/schedule.js.map +1 -0
- package/src/lib/engine/sending-capacity.d.ts +96 -0
- package/src/lib/engine/sending-capacity.js +172 -0
- package/src/lib/engine/sending-capacity.js.map +1 -0
- package/src/lib/engine/sequence-validation.d.ts +90 -0
- package/src/lib/engine/sequence-validation.js +291 -0
- package/src/lib/engine/sequence-validation.js.map +1 -0
- package/src/lib/engine/thread-classification.d.ts +78 -0
- package/src/lib/engine/thread-classification.js +224 -0
- package/src/lib/engine/thread-classification.js.map +1 -0
- package/src/lib/engine/thread-message.d.ts +80 -0
- package/src/lib/engine/thread-message.js +143 -0
- package/src/lib/engine/thread-message.js.map +1 -0
- package/src/lib/enrollment/enroll-people.d.ts +81 -0
- package/src/lib/enrollment/enroll-people.js +250 -0
- package/src/lib/enrollment/enroll-people.js.map +1 -0
- package/src/lib/enrollment/gate-lookups.d.ts +32 -0
- package/src/lib/enrollment/gate-lookups.js +154 -0
- package/src/lib/enrollment/gate-lookups.js.map +1 -0
- package/src/lib/mailboxes/mailbox-api.d.ts +126 -0
- package/src/lib/mailboxes/mailbox-api.js +66 -0
- package/src/lib/mailboxes/mailbox-api.js.map +1 -0
- package/src/lib/mailboxes/mailbox-credentials.d.ts +95 -0
- package/src/lib/mailboxes/mailbox-credentials.js +102 -0
- package/src/lib/mailboxes/mailbox-credentials.js.map +1 -0
- package/src/lib/mailboxes/mailbox-erasure.d.ts +69 -0
- package/src/lib/mailboxes/mailbox-erasure.js +148 -0
- package/src/lib/mailboxes/mailbox-erasure.js.map +1 -0
- package/src/lib/mailboxes/mailbox-gate.d.ts +75 -0
- package/src/lib/mailboxes/mailbox-gate.js +98 -0
- package/src/lib/mailboxes/mailbox-gate.js.map +1 -0
- package/src/lib/mailboxes/mailbox-revoke.d.ts +59 -0
- package/src/lib/mailboxes/mailbox-revoke.js +41 -0
- package/src/lib/mailboxes/mailbox-revoke.js.map +1 -0
- package/src/lib/mailboxes/mailbox-routes.d.ts +119 -0
- package/src/lib/mailboxes/mailbox-routes.js +605 -0
- package/src/lib/mailboxes/mailbox-routes.js.map +1 -0
- package/src/lib/mailboxes/mailbox-settings.d.ts +110 -0
- package/src/lib/mailboxes/mailbox-settings.js +212 -0
- package/src/lib/mailboxes/mailbox-settings.js.map +1 -0
- package/src/lib/mailboxes/mailbox-transport.d.ts +64 -0
- package/src/lib/mailboxes/mailbox-transport.js +94 -0
- package/src/lib/mailboxes/mailbox-transport.js.map +1 -0
- package/src/lib/mailboxes/oauth-redirect.d.ts +41 -0
- package/src/lib/mailboxes/oauth-redirect.js +63 -0
- package/src/lib/mailboxes/oauth-redirect.js.map +1 -0
- package/src/lib/mailboxes/oauth-state.d.ts +152 -0
- package/src/lib/mailboxes/oauth-state.js +212 -0
- package/src/lib/mailboxes/oauth-state.js.map +1 -0
- package/src/lib/mailboxes/outreach-config.d.ts +64 -0
- package/src/lib/mailboxes/outreach-config.js +77 -0
- package/src/lib/mailboxes/outreach-config.js.map +1 -0
- package/src/lib/mailboxes/register-mailbox-routes.d.ts +47 -0
- package/src/lib/mailboxes/register-mailbox-routes.js +135 -0
- package/src/lib/mailboxes/register-mailbox-routes.js.map +1 -0
- package/src/lib/model/compliance-settings.d.ts +78 -0
- package/src/lib/model/compliance-settings.js +155 -0
- package/src/lib/model/compliance-settings.js.map +1 -0
- package/src/lib/model/outreach-api.d.ts +210 -0
- package/src/lib/model/outreach-api.js +28 -0
- package/src/lib/model/outreach-api.js.map +1 -0
- package/src/lib/model/outreach.types.d.ts +563 -0
- package/src/lib/model/outreach.types.js +225 -0
- package/src/lib/model/outreach.types.js.map +1 -0
- package/src/lib/model/sequence-draft.d.ts +84 -0
- package/src/lib/model/sequence-draft.js +239 -0
- package/src/lib/model/sequence-draft.js.map +1 -0
- package/src/lib/model/step-preview.d.ts +45 -0
- package/src/lib/model/step-preview.js +98 -0
- package/src/lib/model/step-preview.js.map +1 -0
- package/src/lib/model/stored-records.d.ts +23 -0
- package/src/lib/model/stored-records.js +84 -0
- package/src/lib/model/stored-records.js.map +1 -0
- package/src/lib/plugin.d.ts +46 -0
- package/src/lib/plugin.js +86 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/routes/enroll-routes.d.ts +64 -0
- package/src/lib/routes/enroll-routes.js +350 -0
- package/src/lib/routes/enroll-routes.js.map +1 -0
- package/src/lib/routes/enrollment-routes.d.ts +19 -0
- package/src/lib/routes/enrollment-routes.js +171 -0
- package/src/lib/routes/enrollment-routes.js.map +1 -0
- package/src/lib/routes/platform-deps.d.ts +51 -0
- package/src/lib/routes/platform-deps.js +66 -0
- package/src/lib/routes/platform-deps.js.map +1 -0
- package/src/lib/routes/preview-routes.d.ts +33 -0
- package/src/lib/routes/preview-routes.js +117 -0
- package/src/lib/routes/preview-routes.js.map +1 -0
- package/src/lib/routes/register-routes.d.ts +22 -0
- package/src/lib/routes/register-routes.js +92 -0
- package/src/lib/routes/register-routes.js.map +1 -0
- package/src/lib/routes/route-deps.d.ts +49 -0
- package/src/lib/routes/route-deps.js +27 -0
- package/src/lib/routes/route-deps.js.map +1 -0
- package/src/lib/routes/route-gate.d.ts +94 -0
- package/src/lib/routes/route-gate.js +87 -0
- package/src/lib/routes/route-gate.js.map +1 -0
- package/src/lib/routes/route-http.d.ts +32 -0
- package/src/lib/routes/route-http.js +62 -0
- package/src/lib/routes/route-http.js.map +1 -0
- package/src/lib/routes/sequence-routes.d.ts +32 -0
- package/src/lib/routes/sequence-routes.js +359 -0
- package/src/lib/routes/sequence-routes.js.map +1 -0
- package/src/lib/routes/settings-routes.d.ts +30 -0
- package/src/lib/routes/settings-routes.js +73 -0
- package/src/lib/routes/settings-routes.js.map +1 -0
- package/src/lib/runtime/enrollment-events.d.ts +86 -0
- package/src/lib/runtime/enrollment-events.js +141 -0
- package/src/lib/runtime/enrollment-events.js.map +1 -0
- package/src/lib/runtime/fixtures/fake-gmail.d.ts +121 -0
- package/src/lib/runtime/fixtures/fake-gmail.js +312 -0
- package/src/lib/runtime/fixtures/fake-gmail.js.map +1 -0
- package/src/lib/runtime/mailbox-health-store.d.ts +47 -0
- package/src/lib/runtime/mailbox-health-store.js +168 -0
- package/src/lib/runtime/mailbox-health-store.js.map +1 -0
- package/src/lib/runtime/person-erasure.d.ts +39 -0
- package/src/lib/runtime/person-erasure.js +57 -0
- package/src/lib/runtime/person-erasure.js.map +1 -0
- package/src/lib/runtime/platform-runtime-deps.d.ts +29 -0
- package/src/lib/runtime/platform-runtime-deps.js +98 -0
- package/src/lib/runtime/platform-runtime-deps.js.map +1 -0
- package/src/lib/runtime/runtime-deps.d.ts +77 -0
- package/src/lib/runtime/runtime-deps.js +18 -0
- package/src/lib/runtime/runtime-deps.js.map +1 -0
- package/src/lib/runtime/send-job.d.ts +42 -0
- package/src/lib/runtime/send-job.js +780 -0
- package/src/lib/runtime/send-job.js.map +1 -0
- package/src/lib/runtime/sync-job.d.ts +41 -0
- package/src/lib/runtime/sync-job.js +480 -0
- package/src/lib/runtime/sync-job.js.map +1 -0
- package/src/lib/runtime/timeline.d.ts +67 -0
- package/src/lib/runtime/timeline.js +93 -0
- package/src/lib/runtime/timeline.js.map +1 -0
- package/src/lib/runtime/unsubscribe-link.d.ts +75 -0
- package/src/lib/runtime/unsubscribe-link.js +121 -0
- package/src/lib/runtime/unsubscribe-link.js.map +1 -0
- package/src/lib/runtime/unsubscribe-route.d.ts +24 -0
- package/src/lib/runtime/unsubscribe-route.js +103 -0
- package/src/lib/runtime/unsubscribe-route.js.map +1 -0
- package/src/lib/server.d.ts +53 -0
- package/src/lib/server.js +94 -0
- package/src/lib/server.js.map +1 -0
- package/src/lib/storage/compliance-settings-store.d.ts +44 -0
- package/src/lib/storage/compliance-settings-store.js +78 -0
- package/src/lib/storage/compliance-settings-store.js.map +1 -0
- package/src/lib/storage/do-not-contact-store.d.ts +60 -0
- package/src/lib/storage/do-not-contact-store.js +168 -0
- package/src/lib/storage/do-not-contact-store.js.map +1 -0
- package/src/lib/storage/outreach-records.d.ts +33 -0
- package/src/lib/storage/outreach-records.js +35 -0
- package/src/lib/storage/outreach-records.js.map +1 -0
- package/src/lib/subprocessors.d.ts +48 -0
- package/src/lib/subprocessors.js +70 -0
- package/src/lib/subprocessors.js.map +1 -0
- package/src/lib/transport/gmail-client.d.ts +145 -0
- package/src/lib/transport/gmail-client.js +229 -0
- package/src/lib/transport/gmail-client.js.map +1 -0
- package/src/lib/transport/gmail-errors.d.ts +84 -0
- package/src/lib/transport/gmail-errors.js +138 -0
- package/src/lib/transport/gmail-errors.js.map +1 -0
- package/src/lib/transport/google-oauth.d.ts +138 -0
- package/src/lib/transport/google-oauth.js +247 -0
- package/src/lib/transport/google-oauth.js.map +1 -0
- package/src/lib/transport/http.d.ts +53 -0
- package/src/lib/transport/http.js +79 -0
- package/src/lib/transport/http.js.map +1 -0
- package/src/lib/transport/rfc5322.d.ts +116 -0
- package/src/lib/transport/rfc5322.js +330 -0
- package/src/lib/transport/rfc5322.js.map +1 -0
- package/src/lib/transport/send-message.d.ts +69 -0
- package/src/lib/transport/send-message.js +77 -0
- package/src/lib/transport/send-message.js.map +1 -0
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* THE OUTREACH DOCUMENT MODEL (AGL-2974).
|
|
19
|
+
*
|
|
20
|
+
* One file both halves import — the console reads these documents, the server
|
|
21
|
+
* routes write them — so a field is spelled once. Client-safe: types and
|
|
22
|
+
* constants only, nothing that reaches Firestore.
|
|
23
|
+
*
|
|
24
|
+
* EVERY DOCUMENT HERE IS SERVER-WRITTEN. The Firestore rules let an
|
|
25
|
+
* org-wide member holding `outreach.use` READ the org collections on a
|
|
26
|
+
* workspace that carries `features.outreach`, and refuse every client write,
|
|
27
|
+
* because these documents are the sending engine's state: a client that
|
|
28
|
+
* could write a mailbox could lift its daily cap, and one that could write
|
|
29
|
+
* an enrollment could send a step twice. The credential collection is closed
|
|
30
|
+
* to clients entirely.
|
|
31
|
+
*
|
|
32
|
+
* Lean on purpose. Each type carries what the mailbox and sequence work is
|
|
33
|
+
* known to need and nothing speculative; a field is added where the code
|
|
34
|
+
* that reads it lands. Times are epoch milliseconds throughout, the unit
|
|
35
|
+
* `nextDueAtMs` has to be compared in.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Where Outreach keeps its records.
|
|
39
|
+
*
|
|
40
|
+
* Five collections under the organization, and one at the top level. The
|
|
41
|
+
* org-scoped ones are erased with the org, whose erasure deletes the whole
|
|
42
|
+
* `orgs/{orgId}` tree. The top-level one holds credentials, so it is keyed by
|
|
43
|
+
* an `orgId` FIELD that a path-scoped delete of `orgs/{orgId}` cannot see:
|
|
44
|
+
* the org erasure sweeps it by that field
|
|
45
|
+
* (`libs/tenant/data/admin/src/lib/server/erase.ts` names it as a literal,
|
|
46
|
+
* which the boundary forces, and `outreach.types.spec.ts` holds the two
|
|
47
|
+
* spellings together, along with the rules').
|
|
48
|
+
*/
|
|
49
|
+
export declare const OUTREACH_COLLECTIONS: {
|
|
50
|
+
/** `orgs/{orgId}/outreachMailboxes/{mailboxId}` — a connected mailbox. */
|
|
51
|
+
readonly mailboxes: "outreachMailboxes";
|
|
52
|
+
/** `orgs/{orgId}/outreachSequences/{sequenceId}` — the steps to send. */
|
|
53
|
+
readonly sequences: "outreachSequences";
|
|
54
|
+
/** `orgs/{orgId}/outreachEnrollments/{enrollmentId}` — one person in one sequence. */
|
|
55
|
+
readonly enrollments: "outreachEnrollments";
|
|
56
|
+
/**
|
|
57
|
+
* `orgs/{orgId}/outreachSettings/{settingsId}` — the organization's own
|
|
58
|
+
* Outreach settings, one document per concern. `compliance` holds who
|
|
59
|
+
* every email says sent it and the countries Outreach may send to.
|
|
60
|
+
*/
|
|
61
|
+
readonly settings: "outreachSettings";
|
|
62
|
+
/**
|
|
63
|
+
* `orgs/{orgId}/outreachDoNotContact/{key}` — the addresses Outreach never
|
|
64
|
+
* emails for this organization, keyed by `outreachDoNotContactKey`.
|
|
65
|
+
*/
|
|
66
|
+
readonly doNotContact: "outreachDoNotContact";
|
|
67
|
+
/**
|
|
68
|
+
* `outreachMailboxCredentials/{mailboxId}` — the provider grant behind a
|
|
69
|
+
* mailbox. TOP-LEVEL and closed to every client, staff included, so the
|
|
70
|
+
* token material never shares a readable path with the mailbox it serves.
|
|
71
|
+
*/
|
|
72
|
+
readonly mailboxCredentials: "outreachMailboxCredentials";
|
|
73
|
+
};
|
|
74
|
+
/** The org-scoped collections, by their {@link OUTREACH_COLLECTIONS} key. */
|
|
75
|
+
export type OutreachOrgCollection = Exclude<keyof typeof OUTREACH_COLLECTIONS, 'mailboxCredentials'>;
|
|
76
|
+
/** `orgs/{orgId}/<collection>` for one of the org-scoped collections. */
|
|
77
|
+
export declare function outreachOrgCollectionPath(orgId: string, collection: OutreachOrgCollection): string;
|
|
78
|
+
/** Stamped by the server on every write. */
|
|
79
|
+
export interface OutreachTimestamps {
|
|
80
|
+
createdAtMs: number;
|
|
81
|
+
updatedAtMs: number;
|
|
82
|
+
}
|
|
83
|
+
/** The mail providers a mailbox can be connected through. */
|
|
84
|
+
export declare const OUTREACH_MAILBOX_PROVIDERS: readonly ["google"];
|
|
85
|
+
export type OutreachMailboxProvider = (typeof OUTREACH_MAILBOX_PROVIDERS)[number];
|
|
86
|
+
/**
|
|
87
|
+
* Where a mailbox stands.
|
|
88
|
+
*
|
|
89
|
+
* - `connected` — the grant works and the mailbox may send.
|
|
90
|
+
* - `paused` — a member stopped it; enrollments on it wait.
|
|
91
|
+
* - `reconnect_required` — the provider refused the grant (revoked, expired,
|
|
92
|
+
* password changed); nothing sends until the rep connects it again.
|
|
93
|
+
* - `disconnected` — a member removed it; its credential is gone.
|
|
94
|
+
*/
|
|
95
|
+
export declare const OUTREACH_MAILBOX_STATUSES: readonly ["connected", "paused", "reconnect_required", "disconnected"];
|
|
96
|
+
export type OutreachMailboxStatus = (typeof OUTREACH_MAILBOX_STATUSES)[number];
|
|
97
|
+
/**
|
|
98
|
+
* The hours a mailbox sends in, in its own {@link OutreachMailbox.timezone}.
|
|
99
|
+
* A step that comes due outside the window waits for the next opening.
|
|
100
|
+
*/
|
|
101
|
+
export interface OutreachSendWindow {
|
|
102
|
+
/** Days of the week it sends on, `0` Sunday through `6` Saturday. */
|
|
103
|
+
days: number[];
|
|
104
|
+
/** Minutes after local midnight the window opens, inclusive. */
|
|
105
|
+
startMinute: number;
|
|
106
|
+
/** Minutes after local midnight the window closes, exclusive. */
|
|
107
|
+
endMinute: number;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* One mailbox-local day's sending, as the health panel sums it (AGL-2978).
|
|
111
|
+
*/
|
|
112
|
+
export interface OutreachMailboxDailyHealth {
|
|
113
|
+
sent: number;
|
|
114
|
+
bounces: number;
|
|
115
|
+
replies: number;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The counters a mailbox's sending is judged by.
|
|
119
|
+
*
|
|
120
|
+
* `sentToday` is what `dailyCap` refuses against, and it belongs to one
|
|
121
|
+
* mailbox-local day — `sentOnDay` — so a counter from yesterday is read as
|
|
122
|
+
* zero rather than as today's spend.
|
|
123
|
+
*/
|
|
124
|
+
export interface OutreachMailboxHealth {
|
|
125
|
+
sentToday: number;
|
|
126
|
+
/** The local day (`YYYY-MM-DD` in the mailbox's timezone) `sentToday` counts. */
|
|
127
|
+
sentOnDay: string | null;
|
|
128
|
+
/** Hard bounces on mail this mailbox sent. */
|
|
129
|
+
bounces: number;
|
|
130
|
+
/** Replies detected on Outreach threads. */
|
|
131
|
+
replies: number;
|
|
132
|
+
lastSentAtMs: number | null;
|
|
133
|
+
/** The last provider error, kept until a later send succeeds. */
|
|
134
|
+
lastErrorAtMs: number | null;
|
|
135
|
+
lastErrorCode: string | null;
|
|
136
|
+
/**
|
|
137
|
+
* Per mailbox-local day (`YYYY-MM-DD`), the sends, bounces and replies
|
|
138
|
+
* counted on it (AGL-2978). The Mailboxes panel shows the last seven days
|
|
139
|
+
* summed; the sending runtime increments the day it counts on and may drop
|
|
140
|
+
* days older than a week. Absent, or empty, until the first send.
|
|
141
|
+
*/
|
|
142
|
+
daily?: Record<string, OutreachMailboxDailyHealth>;
|
|
143
|
+
/**
|
|
144
|
+
* The mailbox's most recent sends, newest last, at most
|
|
145
|
+
* `OUTREACH_BOUNCE_RATE_WINDOW_SENDS` of them, each marked when a hard
|
|
146
|
+
* bounce came back for it (AGL-2981): the window the bounce-rate pause is
|
|
147
|
+
* judged over. A send is named by a digest of its `Message-ID`, never by
|
|
148
|
+
* its recipient.
|
|
149
|
+
*/
|
|
150
|
+
recentSends?: OutreachRecentSend[];
|
|
151
|
+
/** When a reply last called this mailbox's email spam (AGL-2981). */
|
|
152
|
+
lastComplaintAtMs?: number | null;
|
|
153
|
+
}
|
|
154
|
+
/** One send in {@link OutreachMailboxHealth.recentSends}. */
|
|
155
|
+
export interface OutreachRecentSend {
|
|
156
|
+
/** A digest of the send's `Message-ID`: what a bounce is matched to. */
|
|
157
|
+
id: string;
|
|
158
|
+
atMs: number;
|
|
159
|
+
bounced: boolean;
|
|
160
|
+
}
|
|
161
|
+
/** Why a mailbox paused itself (AGL-2981): the engine's health decision, kept. */
|
|
162
|
+
export interface OutreachMailboxAutoPause {
|
|
163
|
+
reason: 'bounces_today' | 'bounce_rate' | 'complaint';
|
|
164
|
+
/** The sentence the mailbox's card shows. */
|
|
165
|
+
message: string;
|
|
166
|
+
atMs: number;
|
|
167
|
+
/** For a complaint, when resuming stops being premature; `null` otherwise. */
|
|
168
|
+
untilMs: number | null;
|
|
169
|
+
}
|
|
170
|
+
/** Where a mailbox's reply and bounce sync has read to (AGL-2981). */
|
|
171
|
+
export interface OutreachMailboxSync {
|
|
172
|
+
/** Everything received before this was read by an earlier run, epoch ms. */
|
|
173
|
+
throughMs: number;
|
|
174
|
+
/** Gmail ids of messages outside any enrollment's thread already handled. */
|
|
175
|
+
handledMessageIds: string[];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* An address a connected Google account may send as, which Gmail has
|
|
179
|
+
* verified — its own address, or an alias whose ownership Gmail confirmed
|
|
180
|
+
* (AGL-2978). Only these are offered as a mailbox's `sendAs`.
|
|
181
|
+
*/
|
|
182
|
+
export interface OutreachSendAsAddress {
|
|
183
|
+
email: string;
|
|
184
|
+
/** The name Gmail holds for the address, `''` when it holds none. */
|
|
185
|
+
displayName: string;
|
|
186
|
+
/** The account's own address. */
|
|
187
|
+
isPrimary: boolean;
|
|
188
|
+
/** The address Gmail sends as by default. */
|
|
189
|
+
isDefault: boolean;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* A rep's own mailbox, connected to send Outreach mail
|
|
193
|
+
* (`orgs/{orgId}/outreachMailboxes/{id}`).
|
|
194
|
+
*
|
|
195
|
+
* Its grant lives in {@link OutreachMailboxCredentials} under the same id.
|
|
196
|
+
*/
|
|
197
|
+
export interface OutreachMailbox extends OutreachTimestamps {
|
|
198
|
+
id: string;
|
|
199
|
+
provider: OutreachMailboxProvider;
|
|
200
|
+
/** The account's own address. */
|
|
201
|
+
email: string;
|
|
202
|
+
/** The address mail goes out as: the account's, or an alias it may send as. */
|
|
203
|
+
sendAs: string;
|
|
204
|
+
/**
|
|
205
|
+
* The verified addresses `sendAs` may be, as Gmail listed them at the last
|
|
206
|
+
* connect (AGL-2978). A changed alias shows up here on the next reconnect.
|
|
207
|
+
*/
|
|
208
|
+
sendAsOptions: OutreachSendAsAddress[];
|
|
209
|
+
/** The From name recipients see. */
|
|
210
|
+
displayName: string;
|
|
211
|
+
status: OutreachMailboxStatus;
|
|
212
|
+
/** The most mail it sends in one local day, ramp included. */
|
|
213
|
+
dailyCap: number;
|
|
214
|
+
window: OutreachSendWindow;
|
|
215
|
+
/** IANA zone the window and the day boundary are read in. */
|
|
216
|
+
timezone: string;
|
|
217
|
+
/**
|
|
218
|
+
* When the warm-up ramp began, or `null` for a mailbox sending at its full
|
|
219
|
+
* cap. The ramp is measured from here, not from connection, so a paused
|
|
220
|
+
* mailbox can restart it.
|
|
221
|
+
*/
|
|
222
|
+
rampStartedAtMs: number | null;
|
|
223
|
+
health: OutreachMailboxHealth;
|
|
224
|
+
/** The member who connected it, and whose mail it is. */
|
|
225
|
+
connectedByUid: string;
|
|
226
|
+
/** When the grant behind it was last connected (AGL-2978). */
|
|
227
|
+
connectedAtMs: number;
|
|
228
|
+
/**
|
|
229
|
+
* Set when the mailbox paused ITSELF on its health (AGL-2981), and cleared
|
|
230
|
+
* when a member pauses or resumes it; absent otherwise.
|
|
231
|
+
*/
|
|
232
|
+
autoPause?: OutreachMailboxAutoPause | null;
|
|
233
|
+
/** The reply and bounce sync's place in the mailbox (AGL-2981). */
|
|
234
|
+
sync?: OutreachMailboxSync | null;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* The provider grant behind one mailbox
|
|
238
|
+
* (`outreachMailboxCredentials/{mailboxId}`).
|
|
239
|
+
*
|
|
240
|
+
* Only the fields every reader relies on are declared here; the token
|
|
241
|
+
* material is added by the code that stores it. `orgId` is REQUIRED, not
|
|
242
|
+
* decorative: the org erasure finds these documents by it, and a credential
|
|
243
|
+
* written without one would outlive its workspace.
|
|
244
|
+
*
|
|
245
|
+
* NAME EVERY SEALED FIELD WITH A SECRET WORD — `refreshToken`,
|
|
246
|
+
* `tokenCiphertext`. The personal-data export discloses these documents with
|
|
247
|
+
* secrets redacted, and its redaction reads field names first: a name
|
|
248
|
+
* carrying `token`, `secret` or `credential` is withheld whatever its value,
|
|
249
|
+
* while a neutral name such as `ciphertext` is judged by the value's shape
|
|
250
|
+
* alone and can be disclosed.
|
|
251
|
+
*/
|
|
252
|
+
export interface OutreachMailboxCredentials extends OutreachTimestamps {
|
|
253
|
+
/** The mailbox id, which is also this document's id. */
|
|
254
|
+
id: string;
|
|
255
|
+
orgId: string;
|
|
256
|
+
mailboxId: string;
|
|
257
|
+
provider: OutreachMailboxProvider;
|
|
258
|
+
}
|
|
259
|
+
/** A sequence's lifecycle. Only an `active` sequence advances its enrollments. */
|
|
260
|
+
export declare const OUTREACH_SEQUENCE_STATUSES: readonly ["draft", "active", "paused", "archived"];
|
|
261
|
+
export type OutreachSequenceStatus = (typeof OUTREACH_SEQUENCE_STATUSES)[number];
|
|
262
|
+
/** The most steps one sequence holds, emails and tasks together. */
|
|
263
|
+
export declare const OUTREACH_MAX_STEPS = 8;
|
|
264
|
+
/** The most of those steps that send an email. */
|
|
265
|
+
export declare const OUTREACH_MAX_EMAIL_STEPS = 4;
|
|
266
|
+
/** The longest wait one step may carry, in business days. */
|
|
267
|
+
export declare const OUTREACH_MAX_STEP_DELAY_BUSINESS_DAYS = 30;
|
|
268
|
+
/**
|
|
269
|
+
* The shortest wait before an email that follows an earlier email. The first
|
|
270
|
+
* email may wait `0` — "the next opening of the window", or the same day as
|
|
271
|
+
* a task before it — and so may a task, but each later email waits at least
|
|
272
|
+
* this long after the step before it.
|
|
273
|
+
*/
|
|
274
|
+
export declare const OUTREACH_MIN_EMAIL_FOLLOW_UP_BUSINESS_DAYS = 1;
|
|
275
|
+
/**
|
|
276
|
+
* One email step.
|
|
277
|
+
*
|
|
278
|
+
* Steps are a union on `kind`, so a later kind joins without reshaping the
|
|
279
|
+
* ones already stored.
|
|
280
|
+
*/
|
|
281
|
+
export interface OutreachEmailStep {
|
|
282
|
+
/** Stable within the sequence, so an edit that reorders steps is traceable. */
|
|
283
|
+
id: string;
|
|
284
|
+
kind: 'email';
|
|
285
|
+
/**
|
|
286
|
+
* Business days to wait after the previous step, counted in the mailbox's
|
|
287
|
+
* zone — after enrollment for the first step, where `0` means the next
|
|
288
|
+
* opening of the sending window.
|
|
289
|
+
*/
|
|
290
|
+
delayBusinessDays: number;
|
|
291
|
+
/**
|
|
292
|
+
* The subject, merge fields allowed. Required on the first email and on
|
|
293
|
+
* any email that starts a new thread; an in-thread email is sent as `Re:`
|
|
294
|
+
* the thread's own subject, so its field is not read.
|
|
295
|
+
*/
|
|
296
|
+
subject: string;
|
|
297
|
+
/**
|
|
298
|
+
* Whether the email goes out as a reply in the thread the earlier emails
|
|
299
|
+
* started. True by default for every email after the first; the first
|
|
300
|
+
* email always starts the thread, whatever this says.
|
|
301
|
+
*/
|
|
302
|
+
replyInThread: boolean;
|
|
303
|
+
/** Plain text with merge fields, as its author wrote it; `''` when `templateId` is set. */
|
|
304
|
+
body: string;
|
|
305
|
+
/**
|
|
306
|
+
* A CRM email template (`orgs/{orgId}/crmEmailTemplates/{id}`) whose body
|
|
307
|
+
* is sent instead of `body`, or `null`. Only the body is taken from it: the
|
|
308
|
+
* step's own subject is the one that is sent.
|
|
309
|
+
*/
|
|
310
|
+
templateId: string | null;
|
|
311
|
+
}
|
|
312
|
+
/** The rep's own touches a task step asks for. */
|
|
313
|
+
export declare const OUTREACH_TASK_KINDS: readonly ["linkedin", "call", "todo"];
|
|
314
|
+
export type OutreachTaskKind = (typeof OUTREACH_TASK_KINDS)[number];
|
|
315
|
+
export declare const OUTREACH_TASK_KIND_LABELS: Record<OutreachTaskKind, string>;
|
|
316
|
+
/** One task step: a CRM task for the rep, created when the step comes due. */
|
|
317
|
+
export interface OutreachTaskStep {
|
|
318
|
+
id: string;
|
|
319
|
+
kind: 'task';
|
|
320
|
+
taskKind: OutreachTaskKind;
|
|
321
|
+
/** What the task says, e.g. "Connect on LinkedIn". */
|
|
322
|
+
title: string;
|
|
323
|
+
/** Business days after the previous step; `0` is the same day. */
|
|
324
|
+
delayBusinessDays: number;
|
|
325
|
+
}
|
|
326
|
+
export type OutreachSequenceStep = OutreachEmailStep | OutreachTaskStep;
|
|
327
|
+
/** The countries a new sequence sends to: the United States alone. */
|
|
328
|
+
export declare const OUTREACH_DEFAULT_ALLOWED_COUNTRIES: readonly string[];
|
|
329
|
+
/** Behavior a sequence applies to every enrollment in it. */
|
|
330
|
+
export interface OutreachSequenceSettings {
|
|
331
|
+
/**
|
|
332
|
+
* The hours this sequence sends in, replacing its mailbox's own window;
|
|
333
|
+
* `null` sends in the mailbox's. Read in the mailbox's zone either way.
|
|
334
|
+
*/
|
|
335
|
+
window: OutreachSendWindow | null;
|
|
336
|
+
/**
|
|
337
|
+
* ISO-3166-1 alpha-2 codes a recipient may be in, uppercase. Default
|
|
338
|
+
* {@link OUTREACH_DEFAULT_ALLOWED_COUNTRIES}: Canada, the United Kingdom
|
|
339
|
+
* and most of the EU need a consent basis a cold email does not have.
|
|
340
|
+
*/
|
|
341
|
+
allowedCountries: string[];
|
|
342
|
+
/** Whether a contact who is already a customer may be enrolled. Default `false`. */
|
|
343
|
+
allowCustomers: boolean;
|
|
344
|
+
}
|
|
345
|
+
/** An ordered set of steps sent from one mailbox (`orgs/{orgId}/outreachSequences/{id}`). */
|
|
346
|
+
export interface OutreachSequence extends OutreachTimestamps {
|
|
347
|
+
id: string;
|
|
348
|
+
name: string;
|
|
349
|
+
/** The site whose CRM the enrolled people are records of. */
|
|
350
|
+
hostId: string;
|
|
351
|
+
/**
|
|
352
|
+
* The mailbox every email step is sent from. A setting of the sequence,
|
|
353
|
+
* kept beside `settings` rather than inside it because enrollments and a
|
|
354
|
+
* mailbox's own screens select sequences by it.
|
|
355
|
+
*/
|
|
356
|
+
mailboxId: string;
|
|
357
|
+
steps: OutreachSequenceStep[];
|
|
358
|
+
settings: OutreachSequenceSettings;
|
|
359
|
+
status: OutreachSequenceStatus;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Where one person's run through a sequence stands.
|
|
363
|
+
*
|
|
364
|
+
* `active` sends and `paused` waits. The rest end the sending, and each says
|
|
365
|
+
* why: `finished` sent every step, `replied` heard back, `bounced` reached a
|
|
366
|
+
* mailbox that does not exist, `opted_out` was asked to stop, `stopped` was
|
|
367
|
+
* ended by a member or a gate, `failed` could not be sent. The transitions
|
|
368
|
+
* between them are the engine's (`../engine/enrollment-state.ts`).
|
|
369
|
+
*/
|
|
370
|
+
export declare const OUTREACH_ENROLLMENT_STATUSES: readonly ["active", "paused", "finished", "replied", "bounced", "opted_out", "stopped", "failed"];
|
|
371
|
+
export type OutreachEnrollmentStatus = (typeof OUTREACH_ENROLLMENT_STATUSES)[number];
|
|
372
|
+
/**
|
|
373
|
+
* Why an enrollment is not `active`, recorded beside the status. `finished`
|
|
374
|
+
* needs none; each other status allows the reasons
|
|
375
|
+
* `OUTREACH_STOP_REASONS_BY_STATUS` names.
|
|
376
|
+
*/
|
|
377
|
+
export declare const OUTREACH_STOP_REASONS: readonly ["reply", "hard_bounce", "opt_out_reply", "unsubscribe", "do_not_contact", "gate", "manual", "sequence_archived", "send_failed"];
|
|
378
|
+
export type OutreachStopReason = (typeof OUTREACH_STOP_REASONS)[number];
|
|
379
|
+
/** The statuses a stop reason is recorded with, and the reasons each allows. */
|
|
380
|
+
export declare const OUTREACH_STOP_REASONS_BY_STATUS: Readonly<Record<Exclude<OutreachEnrollmentStatus, 'active' | 'finished'>, readonly OutreachStopReason[]>>;
|
|
381
|
+
/**
|
|
382
|
+
* What a rep confirms before a COLD contact is enrolled — one with no
|
|
383
|
+
* inbound capture behind them — each recorded with who confirmed it and
|
|
384
|
+
* when, because each is a fact only the rep can know:
|
|
385
|
+
*
|
|
386
|
+
* - `us_business_address`: the address is a business address in the US;
|
|
387
|
+
* - `published_or_given`: they or their company published it, or they gave
|
|
388
|
+
* it to us — never guessed from a name or bought on a list;
|
|
389
|
+
* - `verified_deliverable`: a verifier said it accepts mail.
|
|
390
|
+
*/
|
|
391
|
+
export declare const OUTREACH_ATTESTATION_KINDS: readonly ["us_business_address", "published_or_given", "verified_deliverable"];
|
|
392
|
+
export type OutreachAttestationKind = (typeof OUTREACH_ATTESTATION_KINDS)[number];
|
|
393
|
+
/** The sentence a rep ticks for each attestation. */
|
|
394
|
+
export declare const OUTREACH_ATTESTATION_LABELS: Record<OutreachAttestationKind, string>;
|
|
395
|
+
/** One confirmation, as stored. */
|
|
396
|
+
export interface OutreachAttestation {
|
|
397
|
+
/** The member who confirmed it. */
|
|
398
|
+
uid: string;
|
|
399
|
+
atMs: number;
|
|
400
|
+
}
|
|
401
|
+
/** The confirmations an enrollment carries, by kind. */
|
|
402
|
+
export type OutreachAttestations = Partial<Record<OutreachAttestationKind, OutreachAttestation>>;
|
|
403
|
+
/** The longest personal line an enrollment keeps: one sentence, not a letter. */
|
|
404
|
+
export declare const OUTREACH_PERSONAL_LINE_MAX = 300;
|
|
405
|
+
/** One person in one sequence (`orgs/{orgId}/outreachEnrollments/{id}`). */
|
|
406
|
+
export interface OutreachEnrollment extends OutreachTimestamps {
|
|
407
|
+
id: string;
|
|
408
|
+
sequenceId: string;
|
|
409
|
+
/** The CRM contact the person is. */
|
|
410
|
+
contactId: string;
|
|
411
|
+
/**
|
|
412
|
+
* The contact's name as the sending site knew it at enrollment, `''` when
|
|
413
|
+
* it had none — what the enrollments table shows beside the address,
|
|
414
|
+
* without a read of every contact on the page (AGL-2980).
|
|
415
|
+
*/
|
|
416
|
+
contactName: string;
|
|
417
|
+
/** The address the steps go to, normalized, captured at enrollment. */
|
|
418
|
+
email: string;
|
|
419
|
+
hostId: string;
|
|
420
|
+
mailboxId: string;
|
|
421
|
+
/** The index into `steps` of the NEXT step to run. */
|
|
422
|
+
stepIndex: number;
|
|
423
|
+
/** When that step comes due, or `null` when nothing is waiting. */
|
|
424
|
+
nextDueAtMs: number | null;
|
|
425
|
+
status: OutreachEnrollmentStatus;
|
|
426
|
+
/** Why the status is not `active`; `null` while active and once finished. */
|
|
427
|
+
stopReason: OutreachStopReason | null;
|
|
428
|
+
/** Plain-language detail: the gate's reason, the bounce's diagnostic. */
|
|
429
|
+
stopDetail: string | null;
|
|
430
|
+
stoppedAtMs: number | null;
|
|
431
|
+
/** The member who paused or stopped it; `null` when the engine did. */
|
|
432
|
+
stoppedByUid: string | null;
|
|
433
|
+
/**
|
|
434
|
+
* The rep's signal sentence — why this person, now — merged into the
|
|
435
|
+
* steps as `{{enrollment.personalLine}}`. Required for a cold contact.
|
|
436
|
+
*/
|
|
437
|
+
personalLine: string;
|
|
438
|
+
/** Whether the contact was cold (no inbound capture) when enrolled. */
|
|
439
|
+
cold: boolean;
|
|
440
|
+
attestations: OutreachAttestations;
|
|
441
|
+
/** The member who enrolled the person. */
|
|
442
|
+
enrolledByUid: string;
|
|
443
|
+
/** The provider thread the next in-thread email is sent into, once one exists. */
|
|
444
|
+
gmailThreadId: string | null;
|
|
445
|
+
/** Every provider thread this enrollment has sent into, oldest first — what reply sync watches. */
|
|
446
|
+
gmailThreadIds: string[];
|
|
447
|
+
/** The subject the current thread was started with, as sent. */
|
|
448
|
+
threadSubject: string | null;
|
|
449
|
+
/**
|
|
450
|
+
* The `Message-ID`s of the emails sent into the current thread, oldest
|
|
451
|
+
* first, angle brackets included: the next in-thread email answers the
|
|
452
|
+
* last and names them all in `References`.
|
|
453
|
+
*/
|
|
454
|
+
messageIds: string[];
|
|
455
|
+
/** When the last step ran. */
|
|
456
|
+
lastSentAtMs: number | null;
|
|
457
|
+
/**
|
|
458
|
+
* A sending run's hold on the step it is running (AGL-2981): taken in a
|
|
459
|
+
* transaction before the step runs, cleared when it is recorded. Absent
|
|
460
|
+
* or `null` while no run holds one.
|
|
461
|
+
*/
|
|
462
|
+
sendClaim?: OutreachSendClaim | null;
|
|
463
|
+
/** Every step the runtime ran, oldest first (AGL-2981). */
|
|
464
|
+
stepRecords?: OutreachStepRecord[];
|
|
465
|
+
/** Gmail ids of this enrollment's thread messages the sync has handled, the last hundred. */
|
|
466
|
+
syncedMessageIds?: string[];
|
|
467
|
+
}
|
|
468
|
+
/** A sending run's claim on one enrollment's step (AGL-2981). */
|
|
469
|
+
export interface OutreachSendClaim {
|
|
470
|
+
/** The run that holds it. */
|
|
471
|
+
token: string;
|
|
472
|
+
atMs: number;
|
|
473
|
+
stepIndex: number;
|
|
474
|
+
/**
|
|
475
|
+
* The `Message-ID` an email step goes out with, minted before the send, so
|
|
476
|
+
* a claim a run died holding is settled by looking for the message rather
|
|
477
|
+
* than by sending it again. `null` for a task step.
|
|
478
|
+
*/
|
|
479
|
+
messageId: string | null;
|
|
480
|
+
}
|
|
481
|
+
/** One step the runtime ran for an enrollment (AGL-2981). */
|
|
482
|
+
export interface OutreachStepRecord {
|
|
483
|
+
stepIndex: number;
|
|
484
|
+
stepId: string;
|
|
485
|
+
kind: 'email' | 'task';
|
|
486
|
+
atMs: number;
|
|
487
|
+
/** Gmail's id for the sent message. */
|
|
488
|
+
gmailMessageId?: string;
|
|
489
|
+
/** Gmail's thread the message went into. */
|
|
490
|
+
gmailThreadId?: string;
|
|
491
|
+
/** The `Message-ID` it went out with, angle brackets included. */
|
|
492
|
+
messageId?: string;
|
|
493
|
+
/** The subject as sent. */
|
|
494
|
+
subject?: string;
|
|
495
|
+
/** The record system's task for a task step; `null` when none could be filed. */
|
|
496
|
+
taskId?: string | null;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* What every Outreach email's footer says about who sent it — the
|
|
500
|
+
* identification and the postal address CAN-SPAM requires on commercial
|
|
501
|
+
* mail. The composer refuses to write an email without a legal name and a
|
|
502
|
+
* postal address, and a sequence cannot be activated without them.
|
|
503
|
+
*/
|
|
504
|
+
export interface OutreachOrgSettings {
|
|
505
|
+
/** The organization's legal name, as the footer prints it: "Example Co LLC". */
|
|
506
|
+
legalName: string;
|
|
507
|
+
/**
|
|
508
|
+
* The name the solicitation sentence uses when it is not the legal name:
|
|
509
|
+
* "This is a business solicitation from Example Co." `''` uses the legal
|
|
510
|
+
* name.
|
|
511
|
+
*/
|
|
512
|
+
brandName: string;
|
|
513
|
+
/**
|
|
514
|
+
* A valid physical postal address: a street address, a USPS PO box, or a
|
|
515
|
+
* private mailbox registered with the USPS. Line breaks are printed as
|
|
516
|
+
* commas.
|
|
517
|
+
*/
|
|
518
|
+
postalAddress: string;
|
|
519
|
+
}
|
|
520
|
+
/** The id of the compliance document in the `settings` collection. */
|
|
521
|
+
export declare const OUTREACH_COMPLIANCE_SETTINGS_ID = "compliance";
|
|
522
|
+
/**
|
|
523
|
+
* The organization's Outreach compliance settings
|
|
524
|
+
* (`orgs/{orgId}/outreachSettings/compliance`): the footer's sender identity,
|
|
525
|
+
* and the countries Outreach may send to at all.
|
|
526
|
+
*
|
|
527
|
+
* `allowedCountries` is a CEILING over every sequence's own list — a
|
|
528
|
+
* sequence sends only to the countries both name — so narrowing it here
|
|
529
|
+
* narrows every sequence at once, without editing any of them. Default
|
|
530
|
+
* {@link OUTREACH_DEFAULT_ALLOWED_COUNTRIES}.
|
|
531
|
+
*/
|
|
532
|
+
export interface OutreachComplianceSettings extends OutreachOrgSettings {
|
|
533
|
+
/** ISO-3166-1 alpha-2 codes, uppercase, in the order they were chosen. */
|
|
534
|
+
allowedCountries: string[];
|
|
535
|
+
}
|
|
536
|
+
/** The compliance settings as stored, with who changed them last. */
|
|
537
|
+
export interface OutreachComplianceSettingsDocument extends OutreachComplianceSettings {
|
|
538
|
+
/** `0` until the organization first saves them. */
|
|
539
|
+
updatedAtMs: number;
|
|
540
|
+
updatedByUid: string | null;
|
|
541
|
+
}
|
|
542
|
+
/** Why an address is on the list. */
|
|
543
|
+
export declare const OUTREACH_DO_NOT_CONTACT_REASONS: readonly ["manual", "opt_out_reply", "unsubscribe", "hard_bounce"];
|
|
544
|
+
export type OutreachDoNotContactReason = (typeof OUTREACH_DO_NOT_CONTACT_REASONS)[number];
|
|
545
|
+
/** What put an address on the list: a member, or the sending runtime. */
|
|
546
|
+
export declare const OUTREACH_DO_NOT_CONTACT_SOURCES: readonly ["member", "runtime"];
|
|
547
|
+
export type OutreachDoNotContactSource = (typeof OUTREACH_DO_NOT_CONTACT_SOURCES)[number];
|
|
548
|
+
/** One address on the list (`orgs/{orgId}/outreachDoNotContact/{key}`). */
|
|
549
|
+
export interface OutreachDoNotContactEntry {
|
|
550
|
+
/** `outreachDoNotContactKey` of the address, which is also the document id. */
|
|
551
|
+
key: string;
|
|
552
|
+
reason: OutreachDoNotContactReason;
|
|
553
|
+
source: OutreachDoNotContactSource;
|
|
554
|
+
/** The member who added it; `null` when the runtime did. */
|
|
555
|
+
addedByUid: string | null;
|
|
556
|
+
addedAtMs: number;
|
|
557
|
+
/** The enrollment that led here, when one did. */
|
|
558
|
+
enrollmentId: string | null;
|
|
559
|
+
/** That enrollment's sequence. */
|
|
560
|
+
sequenceId: string | null;
|
|
561
|
+
/** Plain-language detail: why the member added it, the bounce's diagnostic. */
|
|
562
|
+
detail: string | null;
|
|
563
|
+
}
|