outbound-sdk 0.6.0 → 0.7.1
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/dist/alerts/check-schema.d.ts +1 -1
- package/dist/alerts/index.js +6 -6
- package/dist/audit/index.js +2 -2
- package/dist/benchmarks/index.js +4 -4
- package/dist/budget/index.js +2 -2
- package/dist/cards/index.js +54 -44
- package/dist/chunks/{chunk-BLCJHP5H.js → chunk-45TXPJW7.js} +1 -0
- package/dist/chunks/chunk-4AVYRVN5.js +239 -0
- package/dist/chunks/{chunk-YYCT3NGV.js → chunk-65YAGEWZ.js} +24 -7
- package/dist/chunks/{chunk-3JOC5DGD.js → chunk-6NSCPTOY.js} +488 -127
- package/dist/chunks/{chunk-W22SDX6S.js → chunk-7I3EPR23.js} +3 -3
- package/dist/chunks/{chunk-MGR6HREO.js → chunk-BNDHEDHD.js} +2 -2
- package/dist/chunks/chunk-DNPNTD5W.js +81 -0
- package/dist/chunks/{chunk-53DCVFUB.js → chunk-FALWG5U3.js} +1 -0
- package/dist/chunks/{chunk-OLPMBRXM.js → chunk-GL7BABF2.js} +2 -2
- package/dist/chunks/{chunk-ZOAG2C6V.js → chunk-HIAK2GCI.js} +9 -2
- package/dist/chunks/{chunk-SXGCKCAR.js → chunk-I7DXXGNZ.js} +40 -9
- package/dist/chunks/{chunk-BK5SLY32.js → chunk-JRL3QRBS.js} +264 -76
- package/dist/chunks/{chunk-PHNQ3WC2.js → chunk-KTYTE2BU.js} +4 -3
- package/dist/chunks/{chunk-JWGSB7PT.js → chunk-LD6F46UT.js} +2 -2
- package/dist/chunks/{chunk-2D42TQFU.js → chunk-LVZGIKNF.js} +2 -2
- package/dist/chunks/{chunk-PQSTQKRD.js → chunk-M2VXGLLZ.js} +35 -2
- package/dist/chunks/{chunk-UWUPUMM2.js → chunk-MW4C6LTN.js} +2 -2
- package/dist/chunks/chunk-OK3GAZMT.js +51 -0
- package/dist/chunks/{chunk-BOWXGMN3.js → chunk-POBAY3TI.js} +80 -4
- package/dist/chunks/{chunk-J7DDZ4C2.js → chunk-QFC4ZHD3.js} +1 -1
- package/dist/chunks/{chunk-TFICTGM2.js → chunk-T5MJMW3R.js} +1 -1
- package/dist/chunks/{chunk-GFDNRWR3.js → chunk-UFQ4WMLU.js} +1 -1
- package/dist/chunks/{chunk-QAKJ76HB.js → chunk-YW6FFVSZ.js} +1 -1
- package/dist/cli/bin.js +14 -14
- package/dist/cli/by-name.d.ts +28 -0
- package/dist/cli/commands.d.ts +2 -1
- package/dist/cli/config.d.ts +3 -2
- package/dist/cli/envelope.d.ts +50 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.js +13 -13
- package/dist/cli/listing.d.ts +13 -0
- package/dist/cli/native.d.ts +4 -0
- package/dist/cli/options.d.ts +88 -0
- package/dist/cli/output.d.ts +13 -1
- package/dist/cli/suggest.d.ts +10 -0
- package/dist/cli/update.d.ts +25 -2
- package/dist/clients/index.js +6 -6
- package/dist/combine/index.js +7 -7
- package/dist/emailbison/capabilities.d.ts +1 -0
- package/dist/emailbison/index.js +38 -14
- package/dist/emailbison/map-stats.d.ts +10 -0
- package/dist/exporter/index.js +2 -2
- package/dist/failover/index.js +2 -2
- package/dist/fixtures/index.js +4 -4
- package/dist/heyreach/capabilities.d.ts +3 -0
- package/dist/heyreach/index.js +34 -12
- package/dist/heyreach/map-account.d.ts +2 -2
- package/dist/identity/index.js +2 -2
- package/dist/index.js +9 -7
- package/dist/insights/copy/audit-samples.d.ts +24 -0
- package/dist/insights/copy/audit-variant.d.ts +34 -0
- package/dist/insights/copy/copy-audit.d.ts +26 -12
- package/dist/insights/copy/copy-preview.d.ts +16 -3
- package/dist/insights/copy/index.d.ts +6 -0
- package/dist/insights/copy/reply-timing.d.ts +4 -0
- package/dist/insights/copy/shared.d.ts +4 -1
- package/dist/insights/copy/step-funnel.d.ts +20 -6
- package/dist/insights/copy/variant-test.d.ts +2 -3
- package/dist/insights/index.js +1138 -589
- package/dist/insights/inputs.generated.d.ts +47 -11
- package/dist/insights/ops/campaign-diagnosis.d.ts +2 -0
- package/dist/insights/ops/diagnosis-checks.d.ts +20 -1
- package/dist/insights/ops/index.d.ts +2 -0
- package/dist/insights/ops/pipeline-forecast.d.ts +17 -6
- package/dist/insights/people/account-summary.d.ts +14 -1
- package/dist/insights/people/auto-replies.d.ts +14 -0
- package/dist/insights/people/dropped-replies.d.ts +1 -1
- package/dist/insights/people/hot-leads.d.ts +5 -1
- package/dist/insights/people/index.d.ts +4 -0
- package/dist/insights/people/lead-collisions.d.ts +11 -2
- package/dist/insights/people/person-summary.d.ts +19 -3
- package/dist/insights/people/personalization-gaps.d.ts +14 -8
- package/dist/insights/people/suppression-check.d.ts +9 -0
- package/dist/insights/registry.d.ts +12 -0
- package/dist/insights/step.d.ts +15 -0
- package/dist/insights/variables.d.ts +2 -0
- package/dist/instantly/capabilities.d.ts +4 -0
- package/dist/instantly/index.js +263 -53
- package/dist/instantly/map-stats.d.ts +4 -0
- package/dist/instantly/stats-tracking.d.ts +19 -0
- package/dist/instantly/thread.d.ts +9 -0
- package/dist/internal/adapter.d.ts +5 -0
- package/dist/internal/auto-reply.d.ts +20 -0
- package/dist/internal/capabilities.d.ts +2 -0
- package/dist/internal/entities-account.d.ts +1 -0
- package/dist/internal/entities.d.ts +79 -2
- package/dist/internal/fields.d.ts +37 -1
- package/dist/internal/metrics.d.ts +23 -1
- package/dist/internal/outbound/api.d.ts +2 -0
- package/dist/internal/records.d.ts +2 -2
- package/dist/internal/reply-people.d.ts +37 -0
- package/dist/internal/runway.d.ts +42 -0
- package/dist/internal/sender-screen.d.ts +9 -0
- package/dist/internal/tracking.d.ts +33 -0
- package/dist/loader/index.js +4 -4
- package/dist/memory/data.d.ts +2 -1
- package/dist/memory/index.js +23 -12
- package/dist/redact/index.js +3 -3
- package/dist/smartlead/capabilities.d.ts +4 -0
- package/dist/smartlead/index.js +152 -38
- package/dist/smartlead/map-account.d.ts +3 -0
- package/dist/smartlead/stats-tracking.d.ts +22 -0
- package/dist/sync/index.js +2 -2
- package/dist/tools/ai-sdk.js +8 -7
- package/dist/tools/by-name.d.ts +18 -0
- package/dist/tools/campaign-tools.d.ts +6 -2
- package/dist/tools/claude-agent.js +8 -7
- package/dist/tools/index.js +9 -8
- package/dist/tools/shared.d.ts +7 -0
- package/dist/tracing/index.js +2 -2
- package/dist/webhooks/index.js +12 -11
- package/package.json +1 -1
- package/dist/chunks/chunk-HWHI4LFY.js +0 -102
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fromOne,
|
|
3
3
|
variantKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BNDHEDHD.js";
|
|
5
5
|
import {
|
|
6
6
|
eventData,
|
|
7
7
|
refTo
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LVZGIKNF.js";
|
|
9
9
|
import {
|
|
10
10
|
SCHEMA_VERSION
|
|
11
11
|
} from "./chunk-QGRZDTX4.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isString,
|
|
20
20
|
text,
|
|
21
21
|
timestamp
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-45TXPJW7.js";
|
|
23
23
|
|
|
24
24
|
// src/instantly/webhooks.ts
|
|
25
25
|
var EVENT_TYPES = /* @__PURE__ */ new Map([
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
} from "./chunk-FHKSLCVW.js";
|
|
7
7
|
import {
|
|
8
8
|
OutboundError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QFC4ZHD3.js";
|
|
10
10
|
import {
|
|
11
11
|
count,
|
|
12
12
|
isJsonArray,
|
|
13
13
|
isJsonObject
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-45TXPJW7.js";
|
|
15
15
|
|
|
16
16
|
// src/internal/sequence.ts
|
|
17
17
|
var variantKey = (index) => String.fromCodePoint(65 + index);
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OutboundError
|
|
3
|
+
} from "./chunk-QFC4ZHD3.js";
|
|
4
|
+
|
|
5
|
+
// src/internal/tracking.ts
|
|
6
|
+
var recorded = (campaign, metric) => (metric === "opens" ? campaign.opened : campaign.clicked) ?? 0;
|
|
7
|
+
var stateOf = (flags) => {
|
|
8
|
+
if (flags.every(Boolean)) {
|
|
9
|
+
return "on";
|
|
10
|
+
}
|
|
11
|
+
return flags.some(Boolean) ? "mixed" : "off";
|
|
12
|
+
};
|
|
13
|
+
var judge = (campaigns, metric) => {
|
|
14
|
+
const sending = campaigns.filter((campaign) => campaign.sent !== 0);
|
|
15
|
+
const flags = sending.map((campaign) => campaign.flags[metric]);
|
|
16
|
+
if (flags.length === 0 || flags.some((flag) => flag === null)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
measured: sending.every(
|
|
21
|
+
(campaign) => campaign.flags[metric] === true || recorded(campaign, metric) > 0
|
|
22
|
+
),
|
|
23
|
+
state: stateOf(flags.filter((flag) => flag !== null))
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
var sumOf = (values) => {
|
|
27
|
+
let total = null;
|
|
28
|
+
for (const value of values) {
|
|
29
|
+
if (value !== null && value !== void 0) {
|
|
30
|
+
total = (total ?? 0) + value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return total;
|
|
34
|
+
};
|
|
35
|
+
var ownTracking = (flags, rows) => ({
|
|
36
|
+
clicked: sumOf(rows.flatMap((row) => [row.clicked, row.clickedTotal])),
|
|
37
|
+
flags,
|
|
38
|
+
opened: sumOf(rows.flatMap((row) => [row.opened, row.openedTotal])),
|
|
39
|
+
sent: null
|
|
40
|
+
});
|
|
41
|
+
var unmeasured = (verdict) => verdict !== null && !verdict.measured;
|
|
42
|
+
var applyTracking = (rows, campaigns) => {
|
|
43
|
+
if (campaigns === null) {
|
|
44
|
+
return [...rows];
|
|
45
|
+
}
|
|
46
|
+
const opens = judge(campaigns, "opens");
|
|
47
|
+
const clicks = judge(campaigns, "clicks");
|
|
48
|
+
if (opens === null && clicks === null) {
|
|
49
|
+
return [...rows];
|
|
50
|
+
}
|
|
51
|
+
const tracking = {
|
|
52
|
+
clicks: clicks?.state ?? null,
|
|
53
|
+
opens: opens?.state ?? null
|
|
54
|
+
};
|
|
55
|
+
const noOpens = unmeasured(opens);
|
|
56
|
+
const noClicks = unmeasured(clicks);
|
|
57
|
+
return rows.map((row) => ({
|
|
58
|
+
...row,
|
|
59
|
+
clicked: noClicks ? null : row.clicked,
|
|
60
|
+
clickedTotal: noClicks ? null : row.clickedTotal,
|
|
61
|
+
opened: noOpens ? null : row.opened,
|
|
62
|
+
openedTotal: noOpens ? null : row.openedTotal,
|
|
63
|
+
tracking
|
|
64
|
+
}));
|
|
65
|
+
};
|
|
66
|
+
var unlessFailed = async (read) => {
|
|
67
|
+
try {
|
|
68
|
+
return await read();
|
|
69
|
+
} catch (error) {
|
|
70
|
+
if (error instanceof OutboundError) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
ownTracking,
|
|
79
|
+
applyTracking,
|
|
80
|
+
unlessFailed
|
|
81
|
+
};
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
senderSchema,
|
|
12
12
|
sequenceSchema,
|
|
13
13
|
workspaceSchema
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-POBAY3TI.js";
|
|
15
15
|
import {
|
|
16
16
|
OutboundError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QFC4ZHD3.js";
|
|
18
18
|
|
|
19
19
|
// src/internal/capabilities.ts
|
|
20
20
|
var NO_CAPABILITIES = {
|
|
@@ -27,6 +27,7 @@ var NO_CAPABILITIES = {
|
|
|
27
27
|
"events.parse": false,
|
|
28
28
|
"events.verify": false,
|
|
29
29
|
"leads.byCampaign": false,
|
|
30
|
+
"leads.byDomain": false,
|
|
30
31
|
"leads.engagement": false,
|
|
31
32
|
"leads.get": false,
|
|
32
33
|
"leads.list": false,
|
|
@@ -163,6 +164,12 @@ var campaignProgressSchema = z.object({
|
|
|
163
164
|
leads: count,
|
|
164
165
|
/** Leads still waiting for their first step. */
|
|
165
166
|
notStarted: count,
|
|
167
|
+
/**
|
|
168
|
+
* Leads the vendor decided never to send to, for example ones an exclusion
|
|
169
|
+
* rule kept out. Optional, so progress built or stored before the field
|
|
170
|
+
* existed still matches the schema.
|
|
171
|
+
*/
|
|
172
|
+
skipped: count.optional(),
|
|
166
173
|
/** Leads taken out of the sequence before its end. */
|
|
167
174
|
stopped: count
|
|
168
175
|
});
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
detectAutoReply
|
|
3
|
+
} from "./chunk-OK3GAZMT.js";
|
|
1
4
|
import {
|
|
2
5
|
createVendorClient,
|
|
3
6
|
leadStanding,
|
|
4
7
|
listIn
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BNDHEDHD.js";
|
|
6
9
|
import {
|
|
7
10
|
normalizeBody
|
|
8
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FALWG5U3.js";
|
|
9
12
|
import {
|
|
10
13
|
eventData,
|
|
11
14
|
eventTypesOf,
|
|
12
15
|
recordBase,
|
|
13
16
|
refTo
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LVZGIKNF.js";
|
|
15
18
|
import {
|
|
16
19
|
SCHEMA_VERSION
|
|
17
20
|
} from "./chunk-QGRZDTX4.js";
|
|
@@ -20,7 +23,7 @@ import {
|
|
|
20
23
|
} from "./chunk-FHKSLCVW.js";
|
|
21
24
|
import {
|
|
22
25
|
requireObject
|
|
23
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-QFC4ZHD3.js";
|
|
24
27
|
import {
|
|
25
28
|
count,
|
|
26
29
|
emailAddress,
|
|
@@ -34,7 +37,7 @@ import {
|
|
|
34
37
|
text,
|
|
35
38
|
timestamp,
|
|
36
39
|
withoutKeys
|
|
37
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-45TXPJW7.js";
|
|
38
41
|
|
|
39
42
|
// src/emailbison/capabilities.ts
|
|
40
43
|
var BASE_URL = "https://dedi.emailbison.com";
|
|
@@ -125,25 +128,43 @@ var fields = {
|
|
|
125
128
|
linkedinUrl: false,
|
|
126
129
|
location: false,
|
|
127
130
|
phone: false,
|
|
131
|
+
recipientMailProvider: false,
|
|
128
132
|
tags: false,
|
|
129
133
|
website: false
|
|
130
134
|
},
|
|
131
135
|
// A sent email names its step by id, not by place.
|
|
132
|
-
message
|
|
136
|
+
// A message is not marked automatic; a reply is.
|
|
137
|
+
message: {
|
|
138
|
+
isAuto: false,
|
|
139
|
+
isAutoSource: false,
|
|
140
|
+
stepIndex: false,
|
|
141
|
+
variantKey: false
|
|
142
|
+
},
|
|
133
143
|
metricRow: {
|
|
134
144
|
clicked: false,
|
|
135
145
|
clickedTotal: false,
|
|
146
|
+
completed: false,
|
|
136
147
|
connectionsAccepted: false,
|
|
137
148
|
connectionsSent: false,
|
|
138
149
|
contentHash: false,
|
|
139
150
|
delivered: false,
|
|
140
151
|
inmailsSent: false,
|
|
152
|
+
leads: false,
|
|
153
|
+
opportunities: false,
|
|
154
|
+
opportunityValue: false,
|
|
155
|
+
repliedAutoTotal: false,
|
|
156
|
+
repliedTotal: false,
|
|
141
157
|
repliedAuto: false,
|
|
142
158
|
// No read says which timezone its days are in.
|
|
143
159
|
timezone: false
|
|
144
160
|
},
|
|
145
161
|
placementTest: false,
|
|
146
|
-
reply: {
|
|
162
|
+
reply: {
|
|
163
|
+
// A fixed rule reads the sender, subject and body when automated_reply is missing.
|
|
164
|
+
leftCompany: "derived",
|
|
165
|
+
stepIndex: false,
|
|
166
|
+
variantKey: false
|
|
167
|
+
},
|
|
147
168
|
sender: { linkedinUrl: false },
|
|
148
169
|
// Only the main sequence is read, and it has no name.
|
|
149
170
|
sequence: { name: false },
|
|
@@ -182,7 +203,8 @@ var costs = {
|
|
|
182
203
|
"senders.list": { pageSize: PAGE_SIZE, perPage: 1 },
|
|
183
204
|
"sequence.get": { perPage: 1 },
|
|
184
205
|
// Step rows cost two: the campaign's stats, then its steps.
|
|
185
|
-
|
|
206
|
+
// A campaign or its steps add the campaign, for its open tracking.
|
|
207
|
+
stats: { perPage: 1, perPageAtMost: 3 },
|
|
186
208
|
"tags.list": { perPage: 1 },
|
|
187
209
|
"webhooks.list": { pageSize: PAGE_SIZE, perPage: 1 },
|
|
188
210
|
"workspaces.list": { perPage: 1 }
|
|
@@ -324,12 +346,20 @@ var categoryOf = (raw) => {
|
|
|
324
346
|
var toReply = (identity, raw, includeBody) => {
|
|
325
347
|
const category = categoryOf(raw);
|
|
326
348
|
const read = flag(raw.read);
|
|
349
|
+
const vendor = flag(raw.automated_reply);
|
|
350
|
+
const verdict = detectAutoReply({
|
|
351
|
+
body: bodyOf(raw),
|
|
352
|
+
from: text(raw.from_email_address),
|
|
353
|
+
subject: text(raw.subject) ?? text(raw.email_subject)
|
|
354
|
+
});
|
|
327
355
|
return {
|
|
328
356
|
...inboxFields(identity, raw, includeBody),
|
|
329
357
|
category,
|
|
330
358
|
categorySource: category === "unknown" ? null : "vendor",
|
|
331
359
|
direction: "in",
|
|
332
|
-
isAuto:
|
|
360
|
+
isAuto: vendor ?? verdict.isAuto,
|
|
361
|
+
isAutoSource: vendor === null ? "rule" : "vendor",
|
|
362
|
+
leftCompany: verdict.leftCompany,
|
|
333
363
|
unread: read === null ? null : !read
|
|
334
364
|
};
|
|
335
365
|
};
|
|
@@ -494,6 +524,7 @@ var toLead = (identity, raw, campaignId = null) => {
|
|
|
494
524
|
linkedinUrl: null,
|
|
495
525
|
location: null,
|
|
496
526
|
phone: null,
|
|
527
|
+
recipientMailProvider: null,
|
|
497
528
|
tags: [],
|
|
498
529
|
title: text(raw.title),
|
|
499
530
|
website: null
|