outbound-sdk 0.2.0 → 0.4.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/dist/alerts/index.js +50 -19
- package/dist/alerts/plugin.d.ts +20 -3
- package/dist/audit/index.js +2 -2
- package/dist/benchmarks/index.js +5 -5
- package/dist/budget/index.d.ts +3 -2
- package/dist/budget/index.js +11 -10
- package/dist/cards/content.d.ts +6 -1
- package/dist/cards/format.d.ts +17 -2
- package/dist/cards/index.d.ts +1 -1
- package/dist/cards/index.js +297 -132
- package/dist/cards/parts.d.ts +9 -2
- package/dist/cards/render.d.ts +20 -3
- package/dist/chunks/{chunk-U2D34ARZ.js → chunk-2D42TQFU.js} +3 -3
- package/dist/chunks/chunk-4PA526S7.js +17 -0
- package/dist/chunks/{chunk-6CVZOUHB.js → chunk-5CFO3CXG.js} +24 -0
- package/dist/chunks/{chunk-XNFESPZH.js → chunk-5FVKRIEJ.js} +168 -31
- package/dist/chunks/{chunk-PMSSUWD7.js → chunk-7LNJJ2RO.js} +217 -58
- package/dist/chunks/{chunk-XC6CZP73.js → chunk-7ZDS6SZD.js} +7 -1
- package/dist/chunks/{chunk-SBIZDCRY.js → chunk-A6WVOCA4.js} +4 -4
- package/dist/chunks/{chunk-VQSCHOBV.js → chunk-BLCJHP5H.js} +11 -4
- package/dist/chunks/{chunk-4PSO6JEK.js → chunk-BOWXGMN3.js} +6 -21
- package/dist/chunks/{chunk-DJ2IUQEU.js → chunk-C4LS2HNV.js} +3 -3
- package/dist/chunks/{chunk-AFU5E5QB.js → chunk-E6DSDCPI.js} +98 -69
- package/dist/chunks/{chunk-IPUYZD4O.js → chunk-GFDNRWR3.js} +1 -1
- package/dist/chunks/{chunk-PURHK3JU.js → chunk-IZFTTMJP.js} +4 -4
- package/dist/chunks/{chunk-E7JHLNLG.js → chunk-J7DDZ4C2.js} +15 -2
- package/dist/chunks/{chunk-FKH5N47I.js → chunk-K4USHN4C.js} +1 -1
- package/dist/chunks/chunk-LVQUSKEX.js +17 -0
- package/dist/chunks/{chunk-YOTW5ESM.js → chunk-PQSTQKRD.js} +2 -2
- package/dist/chunks/chunk-PTZO4QXR.js +15 -0
- package/dist/chunks/{chunk-LVYG7XZJ.js → chunk-QAKJ76HB.js} +1 -1
- package/dist/chunks/chunk-QGRZDTX4.js +26 -0
- package/dist/chunks/{chunk-R3Y56YVF.js → chunk-Y5RAJ6PZ.js} +2 -2
- package/dist/chunks/{chunk-RCZ7ZZFU.js → chunk-ZFVHM5JI.js} +3 -3
- package/dist/chunks/{chunk-UAT3JSJZ.js → chunk-ZOAG2C6V.js} +2 -2
- package/dist/cli/bin.js +17 -13
- package/dist/cli/commands.d.ts +11 -0
- package/dist/cli/index.js +17 -13
- package/dist/cli/mcp.d.ts +5 -0
- package/dist/cli/version.d.ts +2 -0
- package/dist/clients/index.d.ts +1 -1
- package/dist/clients/index.js +35 -10
- package/dist/clients/plugin.d.ts +9 -2
- package/dist/combine/index.js +7 -6
- package/dist/exporter/index.d.ts +5 -2
- package/dist/exporter/index.js +2 -2
- package/dist/failover/index.js +3 -3
- package/dist/fixtures/index.js +5 -4
- package/dist/heyreach/client.d.ts +2 -0
- package/dist/heyreach/index.js +71 -39
- package/dist/heyreach/map.d.ts +5 -2
- package/dist/identity/index.js +33 -17
- package/dist/identity/plugin.d.ts +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -10
- package/dist/insights/campaign.d.ts +3 -0
- package/dist/insights/capped.d.ts +29 -0
- package/dist/insights/copy/copy-audit.d.ts +2 -0
- package/dist/insights/copy/copy-reuse.d.ts +27 -3
- package/dist/insights/copy/index.d.ts +8 -8
- package/dist/insights/copy/reply-timing.d.ts +8 -0
- package/dist/insights/copy/reuse-base.d.ts +32 -0
- package/dist/insights/copy/shared.d.ts +39 -15
- package/dist/insights/copy/step-funnel.d.ts +16 -5
- package/dist/insights/copy/variant-test.d.ts +19 -8
- package/dist/insights/define.d.ts +56 -2
- package/dist/insights/fields.d.ts +16 -0
- package/dist/insights/index.d.ts +2 -1
- package/dist/insights/index.js +1494 -730
- package/dist/insights/inputs.generated.d.ts +951 -0
- package/dist/insights/ops/campaign-diagnosis.d.ts +3 -1
- package/dist/insights/ops/campaign-ranking.d.ts +12 -4
- package/dist/insights/ops/channel-mix.d.ts +2 -1
- package/dist/insights/ops/client-report.d.ts +18 -5
- package/dist/insights/ops/index.d.ts +6 -2
- package/dist/insights/ops/period-comparison.d.ts +14 -3
- package/dist/insights/ops/pipeline-forecast.d.ts +14 -4
- package/dist/insights/ops/shared.d.ts +29 -24
- package/dist/insights/ops/tag-rollup.d.ts +2 -1
- package/dist/insights/people/account-summary.d.ts +13 -0
- package/dist/insights/people/dropped-replies.d.ts +8 -0
- package/dist/insights/people/find.d.ts +7 -1
- package/dist/insights/people/hot-leads.d.ts +16 -1
- package/dist/insights/people/person-summary.d.ts +6 -0
- package/dist/insights/people/read.d.ts +26 -10
- package/dist/insights/people/suppression-check.d.ts +11 -2
- package/dist/insights/plugin.d.ts +7 -5
- package/dist/insights/ref.d.ts +6 -0
- package/dist/insights/registry.d.ts +28 -16
- package/dist/insights/senders/bounce-watch.d.ts +25 -8
- package/dist/insights/senders/capacity-sends.d.ts +22 -0
- package/dist/insights/senders/domain-health.d.ts +10 -4
- package/dist/insights/senders/index.d.ts +14 -6
- package/dist/insights/senders/read.d.ts +15 -14
- package/dist/insights/senders/sender-capacity.d.ts +5 -13
- package/dist/insights/senders/sender-load.d.ts +2 -0
- package/dist/insights/stats.d.ts +8 -0
- package/dist/insights/tools.d.ts +3 -2
- package/dist/instantly/client.d.ts +2 -0
- package/dist/instantly/index.js +44 -29
- package/dist/instantly/map.d.ts +6 -2
- package/dist/internal/engine/request.d.ts +5 -0
- package/dist/internal/entities.d.ts +3 -20
- package/dist/internal/errors.d.ts +44 -0
- package/dist/internal/fields.d.ts +1 -1
- package/dist/internal/json.d.ts +9 -2
- package/dist/internal/lists.d.ts +24 -0
- package/dist/internal/numbers.d.ts +8 -0
- package/dist/internal/outbound/collections.d.ts +4 -0
- package/dist/internal/outbound/create.d.ts +24 -3
- package/dist/internal/outbound/outbound.d.ts +13 -1
- package/dist/internal/outbound/validate.d.ts +4 -0
- package/dist/internal/outbound/walker.d.ts +3 -2
- package/dist/internal/plural.d.ts +12 -0
- package/dist/internal/renamed.d.ts +28 -0
- package/dist/internal/vocabulary.d.ts +20 -0
- package/dist/loader/index.js +5 -5
- package/dist/memory/adapter.d.ts +7 -0
- package/dist/memory/demo-stats.d.ts +3 -0
- package/dist/memory/demo.d.ts +14 -3
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.js +200 -95
- package/dist/providers/index.d.ts +72 -0
- package/dist/providers/index.js +3 -1
- package/dist/reconcile/index.js +5 -4
- package/dist/redact/index.js +10 -4
- package/dist/redact/plugin.d.ts +7 -0
- package/dist/smartlead/index.js +102 -49
- package/dist/smartlead/shared.d.ts +13 -0
- package/dist/sync/index.js +2 -2
- package/dist/tools/ai-sdk.js +8 -6
- package/dist/tools/campaign-tools.d.ts +1 -1
- package/dist/tools/claude-agent.js +8 -6
- package/dist/tools/index.js +9 -7
- package/dist/tools/input-problem.d.ts +8 -0
- package/dist/tools/registry.d.ts +7 -2
- package/dist/tools/shared.d.ts +7 -0
- package/dist/tracing/index.js +2 -2
- package/dist/webhooks/index.js +10 -9
- package/package.json +1 -1
package/dist/memory/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
emptyCounts,
|
|
3
3
|
sumCounts
|
|
4
|
-
} from "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-PQSTQKRD.js";
|
|
5
5
|
import {
|
|
6
6
|
profileSlug
|
|
7
7
|
} from "../chunks/chunk-NAWZ73QS.js";
|
|
@@ -12,22 +12,24 @@ import {
|
|
|
12
12
|
recordBase,
|
|
13
13
|
refTo,
|
|
14
14
|
refsTo
|
|
15
|
-
} from "../chunks/chunk-
|
|
15
|
+
} from "../chunks/chunk-2D42TQFU.js";
|
|
16
16
|
import {
|
|
17
|
-
SCHEMA_VERSION,
|
|
18
17
|
leadProgressSchema
|
|
19
|
-
} from "../chunks/chunk-
|
|
18
|
+
} from "../chunks/chunk-BOWXGMN3.js";
|
|
19
|
+
import {
|
|
20
|
+
SCHEMA_VERSION
|
|
21
|
+
} from "../chunks/chunk-QGRZDTX4.js";
|
|
20
22
|
import {
|
|
21
23
|
assertWorkspaceId,
|
|
22
24
|
makeRef
|
|
23
|
-
} from "../chunks/chunk-
|
|
25
|
+
} from "../chunks/chunk-QAKJ76HB.js";
|
|
24
26
|
import {
|
|
25
27
|
OutboundError,
|
|
26
28
|
makeErrorMapper
|
|
27
|
-
} from "../chunks/chunk-
|
|
29
|
+
} from "../chunks/chunk-J7DDZ4C2.js";
|
|
28
30
|
import {
|
|
29
31
|
isNumber
|
|
30
|
-
} from "../chunks/chunk-
|
|
32
|
+
} from "../chunks/chunk-BLCJHP5H.js";
|
|
31
33
|
|
|
32
34
|
// src/memory/account.ts
|
|
33
35
|
var base = (identity, sourceId) => recordBase(identity, sourceId, null);
|
|
@@ -127,13 +129,13 @@ var toCampaign = (identity, seed) => ({
|
|
|
127
129
|
status: seed.status ?? "active",
|
|
128
130
|
tags: [...seed.tags ?? []]
|
|
129
131
|
});
|
|
130
|
-
var toSteps = (steps, channel) => steps.map((
|
|
131
|
-
action:
|
|
132
|
-
branch:
|
|
133
|
-
delayDays:
|
|
132
|
+
var toSteps = (steps, channel) => steps.map((step2, index) => ({
|
|
133
|
+
action: step2.action ?? (channel === "linkedin" ? "message" : "email"),
|
|
134
|
+
branch: step2.branch ?? null,
|
|
135
|
+
delayDays: step2.delayDays ?? null,
|
|
134
136
|
index,
|
|
135
|
-
parentIndex:
|
|
136
|
-
variants:
|
|
137
|
+
parentIndex: step2.parentIndex ?? (index === 0 ? null : index - 1),
|
|
138
|
+
variants: step2.variants.map((variant, variantIndex) => ({
|
|
137
139
|
body: variant.body ?? null,
|
|
138
140
|
contentHash: stableId(variant.subject, variant.body),
|
|
139
141
|
subject: variant.subject ?? null,
|
|
@@ -590,6 +592,7 @@ var memory = (options = {}) => {
|
|
|
590
592
|
...accountReads(store),
|
|
591
593
|
capabilities,
|
|
592
594
|
costs: {},
|
|
595
|
+
fields: options.fields,
|
|
593
596
|
// Nothing is rate limited in memory; the numbers only keep the engine's math defined.
|
|
594
597
|
limits: {
|
|
595
598
|
source: "in-memory adapter, not a vendor limit",
|
|
@@ -609,10 +612,139 @@ var memory = (options = {}) => {
|
|
|
609
612
|
};
|
|
610
613
|
};
|
|
611
614
|
|
|
615
|
+
// src/memory/demo-stats.ts
|
|
616
|
+
var FOUNDERS = [
|
|
617
|
+
[15, 1, 15, 0, 14, 1, 1, 26, 1],
|
|
618
|
+
[14, 1, 16, 1, 15, 0, 1, 24, 0],
|
|
619
|
+
[16, 2, 14, 0, 15, 1, 2, 27, 1],
|
|
620
|
+
// The bounce spike.
|
|
621
|
+
[15, 1, 15, 0, 16, 0, 1, 22, 9],
|
|
622
|
+
[15, 0, 15, 1, 14, 1, 1, 25, 0],
|
|
623
|
+
[16, 1, 14, 0, 15, 0, 1, 26, 1],
|
|
624
|
+
[14, 1, 16, 0, 15, 1, 1, 23, 0],
|
|
625
|
+
// The week before: the same sends, and fewer replies (8 of 314, against
|
|
626
|
+
// 13 of 314 in the week above), so a weekly comparison has a change to show.
|
|
627
|
+
[15, 1, 15, 1, 14, 0, 2, 25, 1],
|
|
628
|
+
[16, 0, 15, 0, 15, 1, 0, 24, 0],
|
|
629
|
+
[15, 0, 14, 0, 16, 1, 1, 26, 1],
|
|
630
|
+
[14, 1, 15, 0, 15, 0, 1, 23, 0],
|
|
631
|
+
[15, 1, 16, 0, 14, 0, 1, 25, 1],
|
|
632
|
+
[16, 0, 15, 0, 15, 0, 0, 24, 0],
|
|
633
|
+
[15, 1, 14, 1, 15, 0, 1, 26, 1],
|
|
634
|
+
[14, 2, 15, 0, 16, 0, 1, 23, 0],
|
|
635
|
+
[15, 1, 16, 0, 15, 1, 1, 25, 1],
|
|
636
|
+
[16, 0, 14, 1, 14, 0, 0, 24, 0],
|
|
637
|
+
[15, 1, 15, 0, 15, 1, 1, 26, 1],
|
|
638
|
+
[14, 1, 16, 0, 16, 0, 1, 23, 0],
|
|
639
|
+
[15, 1, 15, 0, 15, 1, 1, 25, 1],
|
|
640
|
+
[16, 0, 14, 1, 14, 0, 0, 24, 0]
|
|
641
|
+
];
|
|
642
|
+
var AGENCIES = [
|
|
643
|
+
[30, 1, 20, 0, 0, 18, 3],
|
|
644
|
+
[31, 0, 19, 0, 0, 17, 2],
|
|
645
|
+
[29, 0, 21, 1, 0, 19, 3],
|
|
646
|
+
[30, 1, 20, 0, 1, 18, 3],
|
|
647
|
+
[31, 0, 19, 1, 0, 17, 2],
|
|
648
|
+
[29, 1, 21, 0, 0, 19, 3],
|
|
649
|
+
[30, 0, 20, 1, 1, 18, 2],
|
|
650
|
+
// The week before: 3 replies from 350 sends, against 6 in the week above.
|
|
651
|
+
[30, 1, 20, 0, 0, 17, 3],
|
|
652
|
+
[31, 0, 19, 1, 0, 19, 2],
|
|
653
|
+
[29, 0, 21, 0, 0, 18, 3],
|
|
654
|
+
[30, 0, 20, 0, 0, 17, 2],
|
|
655
|
+
[31, 0, 19, 0, 0, 19, 3],
|
|
656
|
+
[29, 0, 21, 1, 1, 18, 2],
|
|
657
|
+
[30, 0, 20, 0, 0, 17, 3],
|
|
658
|
+
[31, 0, 19, 0, 0, 19, 2],
|
|
659
|
+
[29, 1, 21, 0, 0, 18, 3],
|
|
660
|
+
[30, 0, 20, 0, 0, 17, 2],
|
|
661
|
+
[30, 0, 20, 0, 0, 19, 3],
|
|
662
|
+
[31, 2, 19, 1, 1, 18, 2],
|
|
663
|
+
[29, 0, 21, 0, 0, 17, 3],
|
|
664
|
+
[30, 1, 20, 1, 0, 19, 2]
|
|
665
|
+
];
|
|
666
|
+
var sumOf = (values) => values.reduce((sum, value) => sum + value, 0);
|
|
667
|
+
var rowsOf = (campaignId, date, steps, { bounced, opened, positive }) => {
|
|
668
|
+
const sent = sumOf(steps.map((step2) => step2.sent));
|
|
669
|
+
return [
|
|
670
|
+
{
|
|
671
|
+
campaignId,
|
|
672
|
+
counts: {
|
|
673
|
+
bounced,
|
|
674
|
+
// Step 0 is the first touch, so its sends are the leads contacted.
|
|
675
|
+
contacted: sumOf(
|
|
676
|
+
steps.flatMap((step2) => step2.stepIndex === 0 ? [step2.sent] : [])
|
|
677
|
+
),
|
|
678
|
+
delivered: sent - bounced,
|
|
679
|
+
opened,
|
|
680
|
+
positive,
|
|
681
|
+
replied: sumOf(steps.map((step2) => step2.replied)),
|
|
682
|
+
sent
|
|
683
|
+
},
|
|
684
|
+
date
|
|
685
|
+
},
|
|
686
|
+
...steps.map(({ replied, sent: stepSent, stepIndex, variantKey }) => ({
|
|
687
|
+
campaignId,
|
|
688
|
+
counts: { replied, sent: stepSent },
|
|
689
|
+
date,
|
|
690
|
+
stepIndex,
|
|
691
|
+
variantKey
|
|
692
|
+
}))
|
|
693
|
+
];
|
|
694
|
+
};
|
|
695
|
+
var step = (stepIndex, variantKey, sent, replied) => ({ replied, sent, stepIndex, variantKey });
|
|
696
|
+
var demoStats = (day) => [
|
|
697
|
+
...FOUNDERS.flatMap(
|
|
698
|
+
([
|
|
699
|
+
a,
|
|
700
|
+
aReplied,
|
|
701
|
+
b,
|
|
702
|
+
bReplied,
|
|
703
|
+
follow,
|
|
704
|
+
followReplied,
|
|
705
|
+
positive,
|
|
706
|
+
opened,
|
|
707
|
+
bounced
|
|
708
|
+
], index) => rowsOf(
|
|
709
|
+
"cmp_founders",
|
|
710
|
+
day(index + 1),
|
|
711
|
+
[
|
|
712
|
+
step(0, "A", a, aReplied),
|
|
713
|
+
step(0, "B", b, bReplied),
|
|
714
|
+
step(1, "A", follow, followReplied)
|
|
715
|
+
],
|
|
716
|
+
{ bounced, opened, positive }
|
|
717
|
+
)
|
|
718
|
+
),
|
|
719
|
+
...AGENCIES.flatMap(
|
|
720
|
+
([first, firstReplied, follow, followReplied, positive, opened, bounced], index) => rowsOf(
|
|
721
|
+
"cmp_agencies",
|
|
722
|
+
day(index + 1),
|
|
723
|
+
[
|
|
724
|
+
step(0, "A", first, firstReplied),
|
|
725
|
+
step(1, "A", follow, followReplied)
|
|
726
|
+
],
|
|
727
|
+
{ bounced, opened, positive }
|
|
728
|
+
)
|
|
729
|
+
)
|
|
730
|
+
];
|
|
731
|
+
|
|
612
732
|
// src/memory/demo.ts
|
|
613
|
-
var
|
|
733
|
+
var DAY = 864e5;
|
|
734
|
+
var clockAt = (now) => {
|
|
735
|
+
const today = Math.floor(now / DAY) * DAY;
|
|
736
|
+
const day = (days) => new Date(today - days * DAY).toISOString().slice(0, 10);
|
|
737
|
+
return {
|
|
738
|
+
at: (days, time) => `${day(days)}T${time}:00.000Z`,
|
|
739
|
+
day
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
var campaigns = ({
|
|
743
|
+
at,
|
|
744
|
+
day
|
|
745
|
+
}) => [
|
|
614
746
|
{
|
|
615
|
-
createdAt: "
|
|
747
|
+
createdAt: at(23, "09:00"),
|
|
616
748
|
id: "cmp_founders",
|
|
617
749
|
name: "Q4 SaaS founders",
|
|
618
750
|
settings: {
|
|
@@ -628,7 +760,7 @@ var campaigns = [
|
|
|
628
760
|
to: "17:00"
|
|
629
761
|
}
|
|
630
762
|
],
|
|
631
|
-
startDate:
|
|
763
|
+
startDate: day(21),
|
|
632
764
|
stopOnAutoReply: false,
|
|
633
765
|
stopOnReply: true,
|
|
634
766
|
trackClicks: false,
|
|
@@ -652,14 +784,14 @@ var campaigns = [
|
|
|
652
784
|
{
|
|
653
785
|
delayDays: 3,
|
|
654
786
|
variants: [
|
|
655
|
-
{ body: "Following up on my note.", subject: "
|
|
787
|
+
{ body: "Following up on my note.", subject: "Following up" }
|
|
656
788
|
]
|
|
657
789
|
}
|
|
658
790
|
],
|
|
659
791
|
tags: ["client-a"]
|
|
660
792
|
},
|
|
661
793
|
{
|
|
662
|
-
createdAt: "
|
|
794
|
+
createdAt: at(30, "09:00"),
|
|
663
795
|
id: "cmp_agencies",
|
|
664
796
|
name: "Agency owners",
|
|
665
797
|
status: "paused",
|
|
@@ -669,20 +801,27 @@ var campaigns = [
|
|
|
669
801
|
variants: [
|
|
670
802
|
{ body: "Hello {{firstName}}.", subject: "Idea for {{company}}" }
|
|
671
803
|
]
|
|
804
|
+
},
|
|
805
|
+
// The same follow-up as "Q4 SaaS founders", so copy_reuse has copy to compare.
|
|
806
|
+
{
|
|
807
|
+
delayDays: 4,
|
|
808
|
+
variants: [
|
|
809
|
+
{ body: "Following up on my note.", subject: "Following up" }
|
|
810
|
+
]
|
|
672
811
|
}
|
|
673
812
|
],
|
|
674
813
|
tags: ["client-b"]
|
|
675
814
|
}
|
|
676
815
|
];
|
|
677
|
-
var leads = [
|
|
816
|
+
var leads = ({ at }) => [
|
|
678
817
|
{
|
|
679
818
|
campaignId: "cmp_founders",
|
|
680
819
|
company: "Example Co",
|
|
681
|
-
createdAt: "
|
|
820
|
+
createdAt: at(15, "10:00"),
|
|
682
821
|
email: "person1@example.com",
|
|
683
822
|
engagement: {
|
|
684
|
-
lastContactedAt: "
|
|
685
|
-
lastRepliedAt: "
|
|
823
|
+
lastContactedAt: at(3, "14:00"),
|
|
824
|
+
lastRepliedAt: at(2, "09:30"),
|
|
686
825
|
opens: 2,
|
|
687
826
|
replies: 1,
|
|
688
827
|
stepIndex: 0
|
|
@@ -698,7 +837,7 @@ var leads = [
|
|
|
698
837
|
{
|
|
699
838
|
campaignId: "cmp_founders",
|
|
700
839
|
company: "Sample Ltd",
|
|
701
|
-
createdAt: "
|
|
840
|
+
createdAt: at(14, "10:00"),
|
|
702
841
|
email: "person2@example.com",
|
|
703
842
|
firstName: "Sam",
|
|
704
843
|
id: "lead_2",
|
|
@@ -710,7 +849,7 @@ var leads = [
|
|
|
710
849
|
{
|
|
711
850
|
campaignId: "cmp_agencies",
|
|
712
851
|
company: "Demo Agency",
|
|
713
|
-
createdAt: "
|
|
852
|
+
createdAt: at(25, "10:00"),
|
|
714
853
|
email: "person3@example.com",
|
|
715
854
|
firstName: "Dana",
|
|
716
855
|
id: "lead_3",
|
|
@@ -719,7 +858,7 @@ var leads = [
|
|
|
719
858
|
title: "Owner"
|
|
720
859
|
}
|
|
721
860
|
];
|
|
722
|
-
var messages = [
|
|
861
|
+
var messages = ({ at }) => [
|
|
723
862
|
{
|
|
724
863
|
body: "Hi Alex, saw your launch.",
|
|
725
864
|
campaignId: "cmp_founders",
|
|
@@ -727,7 +866,7 @@ var messages = [
|
|
|
727
866
|
id: "msg_1",
|
|
728
867
|
leadId: "lead_1",
|
|
729
868
|
senderId: "mbx_1",
|
|
730
|
-
sentAt: "
|
|
869
|
+
sentAt: at(3, "14:00"),
|
|
731
870
|
stepIndex: 0,
|
|
732
871
|
subject: "Quick question",
|
|
733
872
|
threadId: "thr_1",
|
|
@@ -742,7 +881,7 @@ var messages = [
|
|
|
742
881
|
isAuto: false,
|
|
743
882
|
leadId: "lead_1",
|
|
744
883
|
senderId: "mbx_1",
|
|
745
|
-
sentAt: "
|
|
884
|
+
sentAt: at(2, "09:30"),
|
|
746
885
|
subject: "Re: Quick question",
|
|
747
886
|
threadId: "thr_1"
|
|
748
887
|
},
|
|
@@ -753,19 +892,19 @@ var messages = [
|
|
|
753
892
|
id: "msg_3",
|
|
754
893
|
leadId: "lead_2",
|
|
755
894
|
senderId: "mbx_2",
|
|
756
|
-
sentAt: "
|
|
895
|
+
sentAt: at(3, "14:05"),
|
|
757
896
|
stepIndex: 0,
|
|
758
897
|
subject: "Congrats",
|
|
759
898
|
variantKey: "B"
|
|
760
899
|
}
|
|
761
900
|
];
|
|
762
|
-
var senders = [
|
|
901
|
+
var senders = ({ at }) => [
|
|
763
902
|
{
|
|
764
903
|
address: "outreach1@example.com",
|
|
765
904
|
campaignIds: ["cmp_founders"],
|
|
766
905
|
dailyLimit: 40,
|
|
767
906
|
health: {
|
|
768
|
-
checkedAt: "
|
|
907
|
+
checkedAt: at(2, "00:00"),
|
|
769
908
|
connected: true,
|
|
770
909
|
dkim: true,
|
|
771
910
|
dmarc: true,
|
|
@@ -782,7 +921,7 @@ var senders = [
|
|
|
782
921
|
campaignIds: ["cmp_founders", "cmp_agencies"],
|
|
783
922
|
dailyLimit: 40,
|
|
784
923
|
health: {
|
|
785
|
-
checkedAt: "
|
|
924
|
+
checkedAt: at(2, "00:00"),
|
|
786
925
|
connected: true,
|
|
787
926
|
dkim: false,
|
|
788
927
|
dmarc: true,
|
|
@@ -796,71 +935,37 @@ var senders = [
|
|
|
796
935
|
warmup: { enabled: true, score: 88 }
|
|
797
936
|
}
|
|
798
937
|
];
|
|
799
|
-
var
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
bounced: 1,
|
|
804
|
-
contacted: 50,
|
|
805
|
-
delivered: 49,
|
|
806
|
-
opened: 30,
|
|
807
|
-
positive: 2,
|
|
808
|
-
replied: 4,
|
|
809
|
-
sent: 50
|
|
810
|
-
},
|
|
811
|
-
date: "2026-10-05"
|
|
812
|
-
},
|
|
813
|
-
{
|
|
814
|
-
campaignId: "cmp_founders",
|
|
815
|
-
counts: {
|
|
816
|
-
bounced: 0,
|
|
817
|
-
contacted: 40,
|
|
818
|
-
delivered: 40,
|
|
819
|
-
opened: 22,
|
|
820
|
-
positive: 1,
|
|
821
|
-
replied: 3,
|
|
822
|
-
sent: 40
|
|
823
|
-
},
|
|
824
|
-
date: "2026-10-06"
|
|
825
|
-
},
|
|
826
|
-
{
|
|
827
|
-
campaignId: "cmp_agencies",
|
|
828
|
-
counts: {
|
|
829
|
-
bounced: 4,
|
|
830
|
-
contacted: 60,
|
|
831
|
-
delivered: 56,
|
|
832
|
-
opened: 18,
|
|
833
|
-
positive: 0,
|
|
834
|
-
replied: 1,
|
|
835
|
-
sent: 60
|
|
836
|
-
},
|
|
837
|
-
date: "2026-10-05"
|
|
938
|
+
var demoData = (options = {}) => {
|
|
939
|
+
const now = options.now === void 0 ? Date.now() : new Date(options.now).getTime();
|
|
940
|
+
if (Number.isNaN(now)) {
|
|
941
|
+
throw new TypeError(`demoData: now is not a date: ${String(options.now)}`);
|
|
838
942
|
}
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
}
|
|
943
|
+
const clock = clockAt(now);
|
|
944
|
+
return {
|
|
945
|
+
blocklist: [{ id: "blk_1", value: "competitor.example" }],
|
|
946
|
+
campaigns: campaigns(clock),
|
|
947
|
+
leads: leads(clock),
|
|
948
|
+
lists: [
|
|
949
|
+
{
|
|
950
|
+
createdAt: clock.at(24, "09:00"),
|
|
951
|
+
id: "lst_founders",
|
|
952
|
+
name: "SaaS founders"
|
|
953
|
+
}
|
|
954
|
+
],
|
|
955
|
+
messages: messages(clock),
|
|
956
|
+
senders: senders(clock),
|
|
957
|
+
stats: demoStats(clock.day),
|
|
958
|
+
tags: [{ description: "Work for client A", id: "tag_a", name: "client-a" }],
|
|
959
|
+
webhooks: [
|
|
960
|
+
{
|
|
961
|
+
events: ["reply_received"],
|
|
962
|
+
id: "wh_1",
|
|
963
|
+
name: "Replies",
|
|
964
|
+
url: "https://hooks.example.com/replies"
|
|
965
|
+
}
|
|
966
|
+
]
|
|
967
|
+
};
|
|
968
|
+
};
|
|
864
969
|
export {
|
|
865
970
|
demoData,
|
|
866
971
|
memory
|
|
@@ -16,7 +16,79 @@ export interface ProviderInfo {
|
|
|
16
16
|
/** The vendor's API documentation. */
|
|
17
17
|
readonly docsUrl: string | null;
|
|
18
18
|
}
|
|
19
|
+
declare const CATALOG: readonly [{
|
|
20
|
+
readonly channels: readonly ["email"];
|
|
21
|
+
readonly docsUrl: "https://developer.instantly.ai/";
|
|
22
|
+
readonly envVars: readonly [{
|
|
23
|
+
readonly description: "API V2 key. The all:read scope is enough.";
|
|
24
|
+
readonly name: "INSTANTLY_API_KEY";
|
|
25
|
+
readonly required: true;
|
|
26
|
+
}, {
|
|
27
|
+
readonly description: "A label for this client or workspace.";
|
|
28
|
+
readonly name: "INSTANTLY_WORKSPACE_ID";
|
|
29
|
+
readonly required: false;
|
|
30
|
+
}];
|
|
31
|
+
readonly id: "instantly";
|
|
32
|
+
readonly maturity: "beta";
|
|
33
|
+
readonly name: "Instantly";
|
|
34
|
+
readonly note: "Its reads were run, read-only, against one live workspace. Fixtures are built from the documentation.";
|
|
35
|
+
}, {
|
|
36
|
+
readonly channels: readonly ["email"];
|
|
37
|
+
readonly docsUrl: "https://api.smartlead.ai";
|
|
38
|
+
readonly envVars: readonly [{
|
|
39
|
+
readonly description: "API key. It is sent as a query parameter.";
|
|
40
|
+
readonly name: "SMARTLEAD_API_KEY";
|
|
41
|
+
readonly required: true;
|
|
42
|
+
}, {
|
|
43
|
+
readonly description: "A label for this client or workspace.";
|
|
44
|
+
readonly name: "SMARTLEAD_WORKSPACE_ID";
|
|
45
|
+
readonly required: false;
|
|
46
|
+
}];
|
|
47
|
+
readonly id: "smartlead";
|
|
48
|
+
readonly maturity: "unverified";
|
|
49
|
+
readonly name: "Smartlead";
|
|
50
|
+
readonly note: "Never run against a live account. Written from the public documentation and tested offline only.";
|
|
51
|
+
}, {
|
|
52
|
+
readonly channels: readonly ["linkedin"];
|
|
53
|
+
readonly docsUrl: "https://docs.heyreach.io/hey-reach-api.md";
|
|
54
|
+
readonly envVars: readonly [{
|
|
55
|
+
readonly description: "A workspace API key.";
|
|
56
|
+
readonly name: "HEYREACH_API_KEY";
|
|
57
|
+
readonly required: true;
|
|
58
|
+
}, {
|
|
59
|
+
readonly description: "A label for this client or workspace.";
|
|
60
|
+
readonly name: "HEYREACH_WORKSPACE_ID";
|
|
61
|
+
readonly required: false;
|
|
62
|
+
}];
|
|
63
|
+
readonly id: "heyreach";
|
|
64
|
+
readonly maturity: "beta";
|
|
65
|
+
readonly name: "HeyReach";
|
|
66
|
+
readonly note: "Its reads were run, read-only, against one live workspace. Fixtures are built from the documentation.";
|
|
67
|
+
}, {
|
|
68
|
+
readonly channels: readonly ["email", "linkedin"];
|
|
69
|
+
readonly docsUrl: null;
|
|
70
|
+
readonly envVars: readonly [];
|
|
71
|
+
readonly id: "memory";
|
|
72
|
+
readonly maturity: "stable";
|
|
73
|
+
readonly name: "In-memory (tests and demos)";
|
|
74
|
+
readonly note: "Holds data in memory. For tests and demos; there is no vendor behind it.";
|
|
75
|
+
}];
|
|
76
|
+
/** The id of a provider in the catalog: `instantly`, `smartlead`, `heyreach` or `memory`. */
|
|
77
|
+
export type ProviderId = (typeof CATALOG)[number]["id"];
|
|
19
78
|
export declare const providers: readonly ProviderInfo[];
|
|
79
|
+
/**
|
|
80
|
+
* Whether a value is a provider id from the catalog, for checking a name that
|
|
81
|
+
* arrives as a string from a flag or an environment variable. A provider
|
|
82
|
+
* added to the catalog is accepted without a change here.
|
|
83
|
+
*
|
|
84
|
+
* ```ts
|
|
85
|
+
* if (value === ALL_PROVIDERS || isProviderId(value)) {
|
|
86
|
+
* await fromEnv({ provider: value });
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export declare const isProviderId: (value: unknown) => value is ProviderId;
|
|
20
91
|
export declare const findProvider: (id: string) => ProviderInfo | undefined;
|
|
21
92
|
/** The variable `outbound-sdk/loader` reads to pick an adapter. */
|
|
22
93
|
export declare const PROVIDER_ENV = "OUTBOUND_SDK_PROVIDER";
|
|
94
|
+
export {};
|
package/dist/providers/index.js
CHANGED
package/dist/reconcile/index.js
CHANGED
|
@@ -41,11 +41,12 @@ var checkEvents = async (outbound, check) => {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
var checkDeletions = async (outbound, check) => {
|
|
44
|
-
const { campaignId } = check;
|
|
44
|
+
const { campaignId, deadline, maxRequests, retries, signal, timeout } = check;
|
|
45
|
+
const options = { deadline, maxRequests, retries, signal, timeout };
|
|
45
46
|
const walks = {
|
|
46
|
-
campaigns: () => outbound.campaigns.listAll(
|
|
47
|
-
leads: () => outbound.leads.listAll({ ...
|
|
48
|
-
senders: () => outbound.senders.listAll({ ...
|
|
47
|
+
campaigns: () => outbound.campaigns.listAll(options),
|
|
48
|
+
leads: () => outbound.leads.listAll({ ...options, campaignId }),
|
|
49
|
+
senders: () => outbound.senders.listAll({ ...options, campaignId })
|
|
49
50
|
};
|
|
50
51
|
const listed = /* @__PURE__ */ new Set();
|
|
51
52
|
for await (const record of walks[check.collection]()) {
|
package/dist/redact/index.js
CHANGED
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
makeRef,
|
|
9
9
|
parseRef
|
|
10
|
-
} from "../chunks/chunk-
|
|
10
|
+
} from "../chunks/chunk-QAKJ76HB.js";
|
|
11
11
|
import {
|
|
12
12
|
OutboundError
|
|
13
|
-
} from "../chunks/chunk-
|
|
13
|
+
} from "../chunks/chunk-J7DDZ4C2.js";
|
|
14
14
|
import {
|
|
15
15
|
isJsonArray,
|
|
16
16
|
isJsonObject,
|
|
17
17
|
isString
|
|
18
|
-
} from "../chunks/chunk-
|
|
18
|
+
} from "../chunks/chunk-BLCJHP5H.js";
|
|
19
19
|
|
|
20
20
|
// src/redact/plugin.ts
|
|
21
21
|
var ALL_FIELDS = [
|
|
@@ -179,7 +179,13 @@ var redact = (options = {}) => {
|
|
|
179
179
|
data: redactEventData(masks, event.data),
|
|
180
180
|
raw: null
|
|
181
181
|
}),
|
|
182
|
-
extend: () => ({
|
|
182
|
+
extend: () => ({
|
|
183
|
+
redacted: {
|
|
184
|
+
fields: [...fields].toSorted(),
|
|
185
|
+
hash: (value) => masks.replace(value) ?? MASK,
|
|
186
|
+
strategy
|
|
187
|
+
}
|
|
188
|
+
}),
|
|
183
189
|
name: "redact",
|
|
184
190
|
wrap: async (operation, next) => {
|
|
185
191
|
const output = await next(operation);
|
package/dist/redact/plugin.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ export interface RedactExtension {
|
|
|
16
16
|
readonly redacted: {
|
|
17
17
|
readonly fields: readonly RedactField[];
|
|
18
18
|
readonly strategy: "hash" | "mask";
|
|
19
|
+
/**
|
|
20
|
+
* What this redact writes in place of `value` in a masked field: the
|
|
21
|
+
* stable token under `hash`, so a caller can find a known address among
|
|
22
|
+
* hashed records without the records holding it; `[redacted]` under
|
|
23
|
+
* `mask`.
|
|
24
|
+
*/
|
|
25
|
+
readonly hash: (value: string) => string;
|
|
19
26
|
};
|
|
20
27
|
}
|
|
21
28
|
/** Masks emails, names, companies, LinkedIn URLs, custom fields and message text. */
|