outbound-sdk 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +121 -2
- package/dist/alerts/index.d.ts +2 -0
- package/dist/alerts/index.js +136 -0
- package/dist/alerts/plugin.d.ts +58 -0
- package/dist/audit/index.d.ts +33 -0
- package/dist/audit/index.js +60 -0
- package/dist/benchmarks/index.d.ts +29 -0
- package/dist/benchmarks/index.js +70 -0
- package/dist/budget/index.d.ts +21 -0
- package/dist/budget/index.js +50 -0
- package/dist/cache/index.d.ts +31 -0
- package/dist/cache/index.js +11 -0
- package/dist/cards/content.d.ts +43 -0
- package/dist/cards/copy-cards.d.ts +2 -0
- package/dist/cards/format.d.ts +39 -0
- package/dist/cards/index.d.ts +9 -0
- package/dist/cards/index.js +2070 -0
- package/dist/cards/notify-cards.d.ts +14 -0
- package/dist/cards/ops-cards.d.ts +2 -0
- package/dist/cards/parts.d.ts +22 -0
- package/dist/cards/people-cards.d.ts +2 -0
- package/dist/cards/render.d.ts +28 -0
- package/dist/cards/sender-cards.d.ts +2 -0
- package/dist/cards/slack-rich.d.ts +19 -0
- package/dist/cards/slack-text.d.ts +10 -0
- package/dist/cards/slack.d.ts +21 -0
- package/dist/cards/spec.d.ts +86 -0
- package/dist/cards/tool-cards.d.ts +4 -0
- package/dist/chunks/chunk-4O2HRTTI.js +75 -0
- package/dist/chunks/chunk-7BCYLIDG.js +483 -0
- package/dist/chunks/chunk-B7V6EOAC.js +2273 -0
- package/dist/chunks/chunk-CMQ5ZHLZ.js +25 -0
- package/dist/chunks/chunk-F7MKFVIG.js +43 -0
- package/dist/chunks/chunk-FZF6CLPX.js +232 -0
- package/dist/chunks/chunk-GPEJG34O.js +53 -0
- package/dist/chunks/chunk-HEC7XFFH.js +65 -0
- package/dist/chunks/chunk-IBC52BX3.js +24 -0
- package/dist/chunks/chunk-LNCOGBMI.js +144 -0
- package/dist/chunks/chunk-LOXBLQ3I.js +180 -0
- package/dist/chunks/chunk-NAWZ73QS.js +22 -0
- package/dist/chunks/chunk-OCV66TS2.js +705 -0
- package/dist/chunks/chunk-Q465X22Y.js +548 -0
- package/dist/chunks/chunk-QTB747K4.js +100 -0
- package/dist/chunks/chunk-QZNNCXXD.js +92 -0
- package/dist/chunks/chunk-R6AM4GJR.js +105 -0
- package/dist/chunks/chunk-TIJKJJDW.js +6 -0
- package/dist/chunks/chunk-VURTOVGI.js +61 -0
- package/dist/chunks/chunk-WAM6N4OF.js +269 -0
- package/dist/chunks/chunk-WW746NJF.js +94 -0
- package/dist/chunks/chunk-XC6CZP73.js +80 -0
- package/dist/chunks/chunk-ZGHQYZEH.js +45 -0
- package/dist/cli/bin.d.ts +2 -0
- package/dist/cli/bin.js +34 -0
- package/dist/cli/commands.d.ts +16 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.js +25 -0
- package/dist/cli/mcp.d.ts +14 -0
- package/dist/clients/index.d.ts +2 -0
- package/dist/clients/index.js +107 -0
- package/dist/clients/plugin.d.ts +42 -0
- package/dist/combine/account.d.ts +4 -0
- package/dist/combine/adapter.d.ts +9 -0
- package/dist/combine/index.d.ts +2 -0
- package/dist/combine/index.js +345 -0
- package/dist/combine/route.d.ts +17 -0
- package/dist/exporter/index.d.ts +29 -0
- package/dist/exporter/index.js +77 -0
- package/dist/failover/index.d.ts +11 -0
- package/dist/failover/index.js +45 -0
- package/dist/fixtures/index.d.ts +27 -0
- package/dist/fixtures/index.js +241 -0
- package/dist/fixtures/scrub.d.ts +5 -0
- package/dist/heyreach/account.d.ts +11 -0
- package/dist/heyreach/adapter.d.ts +5 -0
- package/dist/heyreach/capabilities.d.ts +68 -0
- package/dist/heyreach/client.d.ts +20 -0
- package/dist/heyreach/inbox.d.ts +7 -0
- package/dist/heyreach/index.d.ts +18 -0
- package/dist/heyreach/index.js +1708 -0
- package/dist/heyreach/lookup.d.ts +15 -0
- package/dist/heyreach/map-account.d.ts +25 -0
- package/dist/heyreach/map-sequence.d.ts +5 -0
- package/dist/heyreach/map-stats.d.ts +10 -0
- package/dist/heyreach/map.d.ts +35 -0
- package/dist/heyreach/native-organization.d.ts +128 -0
- package/dist/heyreach/native-voice.d.ts +106 -0
- package/dist/heyreach/native.d.ts +496 -0
- package/dist/heyreach/paging.d.ts +7 -0
- package/dist/heyreach/webhooks.d.ts +2 -0
- package/dist/identity/index.d.ts +3 -0
- package/dist/identity/index.js +148 -0
- package/dist/identity/keys.d.ts +9 -0
- package/dist/identity/plugin.d.ts +34 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +119 -0
- package/dist/insights/copy/copy-audit.d.ts +55 -0
- package/dist/insights/copy/copy-checks.d.ts +44 -0
- package/dist/insights/copy/copy-reuse.d.ts +59 -0
- package/dist/insights/copy/index.d.ts +67 -0
- package/dist/insights/copy/reply-timing.d.ts +63 -0
- package/dist/insights/copy/shared.d.ts +53 -0
- package/dist/insights/copy/step-funnel.d.ts +66 -0
- package/dist/insights/copy/variant-test.d.ts +64 -0
- package/dist/insights/define.d.ts +98 -0
- package/dist/insights/index.d.ts +10 -0
- package/dist/insights/index.js +4873 -0
- package/dist/insights/ops/anomalies.d.ts +80 -0
- package/dist/insights/ops/campaign-diagnosis.d.ts +39 -0
- package/dist/insights/ops/campaign-ranking.d.ts +56 -0
- package/dist/insights/ops/channel-mix.d.ts +44 -0
- package/dist/insights/ops/client-report.d.ts +76 -0
- package/dist/insights/ops/diagnosis-checks.d.ts +48 -0
- package/dist/insights/ops/index.d.ts +135 -0
- package/dist/insights/ops/period-comparison.d.ts +86 -0
- package/dist/insights/ops/pipeline-forecast.d.ts +44 -0
- package/dist/insights/ops/shared.d.ts +149 -0
- package/dist/insights/ops/tag-rollup.d.ts +32 -0
- package/dist/insights/people/account-summary.d.ts +68 -0
- package/dist/insights/people/dropped-replies.d.ts +51 -0
- package/dist/insights/people/find.d.ts +18 -0
- package/dist/insights/people/hot-leads.d.ts +67 -0
- package/dist/insights/people/index.d.ts +88 -0
- package/dist/insights/people/lead-collisions.d.ts +43 -0
- package/dist/insights/people/person-summary.d.ts +46 -0
- package/dist/insights/people/personalization-gaps.d.ts +60 -0
- package/dist/insights/people/read.d.ts +40 -0
- package/dist/insights/people/suppression-check.d.ts +53 -0
- package/dist/insights/plugin.d.ts +40 -0
- package/dist/insights/registry.d.ts +335 -0
- package/dist/insights/senders/bounce-watch.d.ts +70 -0
- package/dist/insights/senders/domain-health.d.ts +69 -0
- package/dist/insights/senders/index.d.ts +74 -0
- package/dist/insights/senders/read.d.ts +37 -0
- package/dist/insights/senders/sender-capacity.d.ts +67 -0
- package/dist/insights/senders/sender-load.d.ts +52 -0
- package/dist/insights/senders/settings-audit.d.ts +48 -0
- package/dist/insights/senders/warmup-readiness.d.ts +39 -0
- package/dist/insights/stats.d.ts +45 -0
- package/dist/insights/tools.d.ts +16 -0
- package/dist/insights/types.d.ts +4 -0
- package/dist/instantly/adapter-account.d.ts +5 -0
- package/dist/instantly/adapter-mail.d.ts +3 -0
- package/dist/instantly/adapter.d.ts +7 -0
- package/dist/instantly/capabilities.d.ts +83 -0
- package/dist/instantly/client.d.ts +29 -0
- package/dist/instantly/index.d.ts +20 -0
- package/dist/instantly/index.js +2372 -0
- package/dist/instantly/map-account.d.ts +23 -0
- package/dist/instantly/map-lead.d.ts +18 -0
- package/dist/instantly/map-stats.d.ts +22 -0
- package/dist/instantly/map.d.ts +24 -0
- package/dist/instantly/native-agents-sales.d.ts +161 -0
- package/dist/instantly/native-agents.d.ts +156 -0
- package/dist/instantly/native-campaigns.d.ts +101 -0
- package/dist/instantly/native-leads.d.ts +93 -0
- package/dist/instantly/native-params.d.ts +24 -0
- package/dist/instantly/native-search.d.ts +82 -0
- package/dist/instantly/native-senders.d.ts +182 -0
- package/dist/instantly/native-supersearch.d.ts +149 -0
- package/dist/instantly/native-workspace.d.ts +170 -0
- package/dist/instantly/native.d.ts +1081 -0
- package/dist/instantly/pages.d.ts +29 -0
- package/dist/instantly/stats.d.ts +5 -0
- package/dist/instantly/webhooks.d.ts +2 -0
- package/dist/internal/adapter.d.ts +189 -0
- package/dist/internal/capabilities.d.ts +86 -0
- package/dist/internal/cursor.d.ts +10 -0
- package/dist/internal/engine/budget.d.ts +44 -0
- package/dist/internal/engine/engine.d.ts +45 -0
- package/dist/internal/engine/rate-store.d.ts +25 -0
- package/dist/internal/engine/request.d.ts +27 -0
- package/dist/internal/engine/retry.d.ts +21 -0
- package/dist/internal/engine/runtime.d.ts +13 -0
- package/dist/internal/entities-account.d.ts +135 -0
- package/dist/internal/entities.d.ts +389 -0
- package/dist/internal/env.d.ts +4 -0
- package/dist/internal/errors.d.ts +57 -0
- package/dist/internal/hooks.d.ts +55 -0
- package/dist/internal/json.d.ts +40 -0
- package/dist/internal/limits.d.ts +34 -0
- package/dist/internal/metrics.d.ts +52 -0
- package/dist/internal/native.d.ts +66 -0
- package/dist/internal/outbound/api.d.ts +267 -0
- package/dist/internal/outbound/collections.d.ts +31 -0
- package/dist/internal/outbound/core.d.ts +36 -0
- package/dist/internal/outbound/create.d.ts +16 -0
- package/dist/internal/outbound/handles.d.ts +7 -0
- package/dist/internal/outbound/native.d.ts +4 -0
- package/dist/internal/outbound/operation-shared.d.ts +28 -0
- package/dist/internal/outbound/operations-account.d.ts +29 -0
- package/dist/internal/outbound/operations.d.ts +42 -0
- package/dist/internal/outbound/outbound.d.ts +64 -0
- package/dist/internal/outbound/plugins.d.ts +40 -0
- package/dist/internal/outbound/raw.d.ts +9 -0
- package/dist/internal/outbound/specs-account.d.ts +16 -0
- package/dist/internal/outbound/specs.d.ts +14 -0
- package/dist/internal/outbound/stats.d.ts +7 -0
- package/dist/internal/outbound/validate.d.ts +5 -0
- package/dist/internal/outbound/walker.d.ts +22 -0
- package/dist/internal/record.d.ts +19 -0
- package/dist/internal/redact.d.ts +18 -0
- package/dist/internal/ref.d.ts +16 -0
- package/dist/internal/sha256.d.ts +4 -0
- package/dist/internal/text.d.ts +11 -0
- package/dist/internal/url.d.ts +9 -0
- package/dist/loader/index.d.ts +12 -0
- package/dist/loader/index.js +12 -0
- package/dist/memory/account-reads.d.ts +5 -0
- package/dist/memory/account.d.ts +67 -0
- package/dist/memory/adapter.d.ts +16 -0
- package/dist/memory/data.d.ts +122 -0
- package/dist/memory/demo.d.ts +7 -0
- package/dist/memory/index.d.ts +5 -0
- package/dist/memory/index.js +792 -0
- package/dist/memory/stats.d.ts +6 -0
- package/dist/memory/store.d.ts +18 -0
- package/dist/providers/index.d.ts +22 -0
- package/dist/providers/index.js +10 -0
- package/dist/reconcile/index.d.ts +2 -0
- package/dist/reconcile/index.js +72 -0
- package/dist/reconcile/plugin.d.ts +55 -0
- package/dist/redact/index.d.ts +2 -0
- package/dist/redact/index.js +192 -0
- package/dist/redact/plugin.d.ts +22 -0
- package/dist/redis/index.d.ts +41 -0
- package/dist/redis/index.js +114 -0
- package/dist/smartlead/account.d.ts +5 -0
- package/dist/smartlead/adapter.d.ts +5 -0
- package/dist/smartlead/capabilities.d.ts +85 -0
- package/dist/smartlead/client.d.ts +23 -0
- package/dist/smartlead/hmac.d.ts +9 -0
- package/dist/smartlead/index.d.ts +17 -0
- package/dist/smartlead/index.js +2170 -0
- package/dist/smartlead/leads.d.ts +6 -0
- package/dist/smartlead/lookup.d.ts +8 -0
- package/dist/smartlead/mail.d.ts +5 -0
- package/dist/smartlead/map-account.d.ts +22 -0
- package/dist/smartlead/map-messages.d.ts +31 -0
- package/dist/smartlead/map-stats.d.ts +37 -0
- package/dist/smartlead/map.d.ts +52 -0
- package/dist/smartlead/native-analytics.d.ts +242 -0
- package/dist/smartlead/native-campaigns.d.ts +211 -0
- package/dist/smartlead/native-inbox.d.ts +141 -0
- package/dist/smartlead/native-params.d.ts +33 -0
- package/dist/smartlead/native-services.d.ts +204 -0
- package/dist/smartlead/native.d.ts +785 -0
- package/dist/smartlead/shared.d.ts +28 -0
- package/dist/smartlead/stats.d.ts +5 -0
- package/dist/smartlead/webhooks.d.ts +2 -0
- package/dist/sync/index.d.ts +2 -0
- package/dist/sync/index.js +158 -0
- package/dist/sync/plugin.d.ts +58 -0
- package/dist/tools/account-tools.d.ts +21 -0
- package/dist/tools/ai-sdk.d.ts +8 -0
- package/dist/tools/ai-sdk.js +26 -0
- package/dist/tools/campaign-tools.d.ts +59 -0
- package/dist/tools/claude-agent.d.ts +18 -0
- package/dist/tools/claude-agent.js +40 -0
- package/dist/tools/index.d.ts +28 -0
- package/dist/tools/index.js +20 -0
- package/dist/tools/people-tools.d.ts +19 -0
- package/dist/tools/registry.d.ts +34 -0
- package/dist/tools/shared.d.ts +75 -0
- package/dist/tracing/index.d.ts +25 -0
- package/dist/tracing/index.js +69 -0
- package/dist/webhooks/index.d.ts +3 -0
- package/dist/webhooks/index.js +226 -0
- package/dist/webhooks/parse.d.ts +41 -0
- package/dist/webhooks/secret.d.ts +4 -0
- package/package.json +181 -4
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { StatsQuery } from "../internal/adapter.ts";
|
|
2
|
+
import type { MetricRow } from "../internal/entities.ts";
|
|
3
|
+
import type { Identity } from "../internal/record.ts";
|
|
4
|
+
import type { MemoryStats } from "./data.ts";
|
|
5
|
+
/** Aggregates seeded rows the way a vendor's analytics endpoint would. */
|
|
6
|
+
export declare const queryStats: (identity: Identity, seeds: readonly MemoryStats[], query: StatsQuery) => MetricRow[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Page, PageQuery } from "../internal/adapter.ts";
|
|
2
|
+
import type { CapabilityDeclaration } from "../internal/capabilities.ts";
|
|
3
|
+
import type { Channel } from "../internal/entities.ts";
|
|
4
|
+
import { OutboundError } from "../internal/errors.ts";
|
|
5
|
+
import type { Identity } from "../internal/record.ts";
|
|
6
|
+
import type { MemoryCampaign, MemoryData } from "./data.ts";
|
|
7
|
+
export declare const paginate: <Item>(items: readonly Item[], query: PageQuery, pageSize: number) => Page<Item>;
|
|
8
|
+
export declare const notFound: (provider: string, what: string, id: string) => OutboundError;
|
|
9
|
+
export interface Store {
|
|
10
|
+
readonly identity: Identity;
|
|
11
|
+
readonly data: MemoryData;
|
|
12
|
+
readonly pageSize: number;
|
|
13
|
+
readonly capabilities: CapabilityDeclaration;
|
|
14
|
+
readonly channelOf: (campaignId: string | undefined) => Channel;
|
|
15
|
+
/** Whether a campaign, a stats row, a lead, a message or a sender names this campaign id. */
|
|
16
|
+
readonly mentionsCampaign: (campaignId: string | undefined) => boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const findCampaign: (store: Store, id: string) => MemoryCampaign;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ProviderEnvVar {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly required: boolean;
|
|
4
|
+
readonly description: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ProviderInfo {
|
|
7
|
+
/** The provider id records carry, and the subpath: `outbound-sdk/<id>`. */
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly channels: readonly ("email" | "linkedin")[];
|
|
11
|
+
/** `stable` once checked against live credentials. */
|
|
12
|
+
readonly maturity: "beta" | "stable" | "unverified";
|
|
13
|
+
/** What that maturity rests on, in one plain sentence. */
|
|
14
|
+
readonly note: string;
|
|
15
|
+
readonly envVars: readonly ProviderEnvVar[];
|
|
16
|
+
/** The vendor's API documentation. */
|
|
17
|
+
readonly docsUrl: string | null;
|
|
18
|
+
}
|
|
19
|
+
export declare const providers: readonly ProviderInfo[];
|
|
20
|
+
export declare const findProvider: (id: string) => ProviderInfo | undefined;
|
|
21
|
+
/** The variable `outbound-sdk/loader` reads to pick an adapter. */
|
|
22
|
+
export declare const PROVIDER_ENV = "OUTBOUND_SDK_PROVIDER";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// src/reconcile/plugin.ts
|
|
2
|
+
var MESSAGE_EVENTS = /* @__PURE__ */ new Set([
|
|
3
|
+
"message.sent",
|
|
4
|
+
"reply.received",
|
|
5
|
+
"linkedin.message_sent",
|
|
6
|
+
"linkedin.message_received"
|
|
7
|
+
]);
|
|
8
|
+
var unwrap = (entry) => "event" in entry ? entry : { event: entry };
|
|
9
|
+
var lateEvents = (received, lateAfterMs) => received.flatMap(({ event, receivedAt }) => {
|
|
10
|
+
if (receivedAt === void 0 || event.occurredAt === null) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
const delayMs = Date.parse(receivedAt) - Date.parse(event.occurredAt);
|
|
14
|
+
return delayMs > lateAfterMs ? [{ delayMs, event }] : [];
|
|
15
|
+
});
|
|
16
|
+
var checkEvents = async (outbound, check) => {
|
|
17
|
+
const received = check.events.map(unwrap);
|
|
18
|
+
const comparable = received.filter(
|
|
19
|
+
({ event }) => MESSAGE_EVENTS.has(event.type) && event.messageRef !== null
|
|
20
|
+
);
|
|
21
|
+
const listed = await outbound.messages.listAll({
|
|
22
|
+
campaignId: check.campaignId,
|
|
23
|
+
deadline: check.deadline,
|
|
24
|
+
maxRequests: check.maxRequests,
|
|
25
|
+
signal: check.signal,
|
|
26
|
+
since: check.since,
|
|
27
|
+
until: check.until
|
|
28
|
+
}).toArray();
|
|
29
|
+
const listedRefs = new Set(listed.map((message) => message.ref));
|
|
30
|
+
const announced = new Set(comparable.map(({ event }) => event.messageRef));
|
|
31
|
+
const unmatchedEvents = comparable.flatMap(
|
|
32
|
+
({ event }) => event.messageRef !== null && !listedRefs.has(event.messageRef) ? [event] : []
|
|
33
|
+
);
|
|
34
|
+
return {
|
|
35
|
+
checked: comparable.length,
|
|
36
|
+
late: lateEvents(received, (check.lateAfterMinutes ?? 5) * 6e4),
|
|
37
|
+
matched: comparable.length - unmatchedEvents.length,
|
|
38
|
+
missingEvents: listed.filter((message) => !announced.has(message.ref)),
|
|
39
|
+
uncheckable: received.length - comparable.length,
|
|
40
|
+
unmatchedEvents
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
var checkDeletions = async (outbound, check) => {
|
|
44
|
+
const { campaignId } = check;
|
|
45
|
+
const walks = {
|
|
46
|
+
campaigns: () => outbound.campaigns.listAll(check),
|
|
47
|
+
leads: () => outbound.leads.listAll({ ...check, campaignId }),
|
|
48
|
+
senders: () => outbound.senders.listAll({ ...check, campaignId })
|
|
49
|
+
};
|
|
50
|
+
const listed = /* @__PURE__ */ new Set();
|
|
51
|
+
for await (const record of walks[check.collection]()) {
|
|
52
|
+
listed.add(record.ref);
|
|
53
|
+
}
|
|
54
|
+
const known = new Set(check.known);
|
|
55
|
+
return {
|
|
56
|
+
added: [...listed].filter((ref) => !known.has(ref)),
|
|
57
|
+
deleted: [...known].filter((ref) => !listed.has(ref)),
|
|
58
|
+
listed: listed.size
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
var reconcile = () => ({
|
|
62
|
+
extend: (outbound) => ({
|
|
63
|
+
reconcile: {
|
|
64
|
+
deletions: (check) => checkDeletions(outbound, check),
|
|
65
|
+
events: (check) => checkEvents(outbound, check)
|
|
66
|
+
}
|
|
67
|
+
}),
|
|
68
|
+
name: "reconcile"
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
reconcile
|
|
72
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { OperationOptions } from "../internal/engine/engine.ts";
|
|
2
|
+
import type { Message, OutboundEvent } from "../internal/entities.ts";
|
|
3
|
+
import type { OutboundPlugin } from "../internal/outbound/plugins.ts";
|
|
4
|
+
export interface ReceivedEvent {
|
|
5
|
+
readonly event: OutboundEvent;
|
|
6
|
+
/** When your endpoint received it, ISO 8601 UTC. Needed to detect late delivery. */
|
|
7
|
+
readonly receivedAt?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface EventCheck extends OperationOptions {
|
|
10
|
+
/** The events your webhook endpoint received in the window. */
|
|
11
|
+
readonly events: readonly (OutboundEvent | ReceivedEvent)[];
|
|
12
|
+
/** The window to compare, ISO 8601 UTC. */
|
|
13
|
+
readonly since: string;
|
|
14
|
+
readonly until?: string | undefined;
|
|
15
|
+
readonly campaignId?: string | undefined;
|
|
16
|
+
/** An event received this long after it happened counts as late. Defaults to 5 minutes. */
|
|
17
|
+
readonly lateAfterMinutes?: number | undefined;
|
|
18
|
+
}
|
|
19
|
+
export interface EventReport {
|
|
20
|
+
/** Events that name a message and could be compared. */
|
|
21
|
+
readonly checked: number;
|
|
22
|
+
readonly matched: number;
|
|
23
|
+
/** Events naming a message the vendor does not list. */
|
|
24
|
+
readonly unmatchedEvents: readonly OutboundEvent[];
|
|
25
|
+
/** Messages the vendor lists that no event announced: a webhook never arrived. */
|
|
26
|
+
readonly missingEvents: readonly Message[];
|
|
27
|
+
readonly late: readonly {
|
|
28
|
+
readonly event: OutboundEvent;
|
|
29
|
+
readonly delayMs: number;
|
|
30
|
+
}[];
|
|
31
|
+
/** Events with no message ref, which cannot be compared. */
|
|
32
|
+
readonly uncheckable: number;
|
|
33
|
+
}
|
|
34
|
+
export interface DeletionCheck extends OperationOptions {
|
|
35
|
+
readonly collection: "campaigns" | "leads" | "senders";
|
|
36
|
+
/** The refs you hold from an earlier sync. */
|
|
37
|
+
readonly known: Iterable<string>;
|
|
38
|
+
readonly campaignId?: string | undefined;
|
|
39
|
+
}
|
|
40
|
+
export interface DeletionReport {
|
|
41
|
+
/** Refs you hold that the vendor no longer lists. */
|
|
42
|
+
readonly deleted: readonly string[];
|
|
43
|
+
/** Refs the vendor lists that you do not hold yet. */
|
|
44
|
+
readonly added: readonly string[];
|
|
45
|
+
readonly listed: number;
|
|
46
|
+
}
|
|
47
|
+
export interface ReconcileExtension {
|
|
48
|
+
readonly reconcile: {
|
|
49
|
+
readonly events: (check: EventCheck) => Promise<EventReport>;
|
|
50
|
+
/** Lists the whole collection, so it costs as much as a full sync. */
|
|
51
|
+
readonly deletions: (check: DeletionCheck) => Promise<DeletionReport>;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** Compares received webhooks and held records with what the vendor lists. */
|
|
55
|
+
export declare const reconcile: () => OutboundPlugin<ReconcileExtension>;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import {
|
|
2
|
+
profileSlug
|
|
3
|
+
} from "../chunks/chunk-NAWZ73QS.js";
|
|
4
|
+
import {
|
|
5
|
+
stableId
|
|
6
|
+
} from "../chunks/chunk-LNCOGBMI.js";
|
|
7
|
+
import {
|
|
8
|
+
makeRef,
|
|
9
|
+
parseRef
|
|
10
|
+
} from "../chunks/chunk-ZGHQYZEH.js";
|
|
11
|
+
import {
|
|
12
|
+
OutboundError
|
|
13
|
+
} from "../chunks/chunk-LOXBLQ3I.js";
|
|
14
|
+
import {
|
|
15
|
+
isJsonArray,
|
|
16
|
+
isJsonObject,
|
|
17
|
+
isString
|
|
18
|
+
} from "../chunks/chunk-QZNNCXXD.js";
|
|
19
|
+
|
|
20
|
+
// src/redact/plugin.ts
|
|
21
|
+
var ALL_FIELDS = [
|
|
22
|
+
"body",
|
|
23
|
+
"company",
|
|
24
|
+
"custom",
|
|
25
|
+
"email",
|
|
26
|
+
"linkedin",
|
|
27
|
+
"name",
|
|
28
|
+
"subject"
|
|
29
|
+
];
|
|
30
|
+
var MASK = "[redacted]";
|
|
31
|
+
var replacer = (strategy) => (value) => {
|
|
32
|
+
if (value === null) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return strategy === "mask" ? MASK : `redacted:${stableId(value).slice(0, 16)}`;
|
|
36
|
+
};
|
|
37
|
+
var maskIf = (masks, field, value) => masks.has(field) ? masks.replace(value) : value;
|
|
38
|
+
var maskCustom = (masks, custom) => masks.has("custom") ? Object.fromEntries(
|
|
39
|
+
Object.keys(custom).map((key) => [
|
|
40
|
+
key,
|
|
41
|
+
masks.replace(custom[key] ?? "") ?? MASK
|
|
42
|
+
])
|
|
43
|
+
) : { ...custom };
|
|
44
|
+
var EMAIL_IN_ID = /[^\s@:/]+@[^\s@:/]+\.[^\s@:/]+/gu;
|
|
45
|
+
var maskId = (masks, id) => {
|
|
46
|
+
const slug = masks.has("linkedin") ? profileSlug(id) : null;
|
|
47
|
+
if (slug !== null) {
|
|
48
|
+
return masks.replace(slug) ?? MASK;
|
|
49
|
+
}
|
|
50
|
+
return masks.has("email") ? id.replaceAll(
|
|
51
|
+
EMAIL_IN_ID,
|
|
52
|
+
(address) => masks.replace(address.toLowerCase()) ?? MASK
|
|
53
|
+
) : id;
|
|
54
|
+
};
|
|
55
|
+
var maskRef = (masks, ref) => {
|
|
56
|
+
const parts = parseRef(ref);
|
|
57
|
+
return parts === null ? maskId(masks, ref) : makeRef(parts.provider, parts.workspaceId, maskId(masks, parts.sourceId));
|
|
58
|
+
};
|
|
59
|
+
var KEY_FIELDS = ["email", "linkedin"];
|
|
60
|
+
var maskKey = (masks, key) => {
|
|
61
|
+
const field = KEY_FIELDS.find((name) => key.startsWith(`${name}:`));
|
|
62
|
+
return field === void 0 || !masks.has(field) ? key : `${field}:${masks.replace(key.slice(field.length + 1)) ?? MASK}`;
|
|
63
|
+
};
|
|
64
|
+
var maskEach = (value, mask) => {
|
|
65
|
+
if (isString(value)) {
|
|
66
|
+
return mask(value);
|
|
67
|
+
}
|
|
68
|
+
return isJsonArray(value) ? value.map((item) => isString(item) ? mask(item) : item) : value;
|
|
69
|
+
};
|
|
70
|
+
var maskIdentifiers = (masks, item) => {
|
|
71
|
+
const changed = {};
|
|
72
|
+
for (const [key, value] of Object.entries(item)) {
|
|
73
|
+
if (key === "sourceId") {
|
|
74
|
+
changed[key] = maskEach(value, (id) => maskId(masks, id));
|
|
75
|
+
} else if (key === "ref" || key.endsWith("Ref") || key.endsWith("Refs")) {
|
|
76
|
+
changed[key] = maskEach(value, (ref) => maskRef(masks, ref));
|
|
77
|
+
} else if (key === "personKey" || key === "personKeys") {
|
|
78
|
+
changed[key] = maskEach(value, (personKey) => maskKey(masks, personKey));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return { ...item, ...changed };
|
|
82
|
+
};
|
|
83
|
+
var BLOCK_FIELDS = /* @__PURE__ */ new Map([
|
|
84
|
+
["email", "email"],
|
|
85
|
+
["linkedin", "linkedin"]
|
|
86
|
+
]);
|
|
87
|
+
var redactFields = (masks, record) => {
|
|
88
|
+
if ("scope" in record) {
|
|
89
|
+
return record;
|
|
90
|
+
}
|
|
91
|
+
if ("direction" in record) {
|
|
92
|
+
return {
|
|
93
|
+
...record,
|
|
94
|
+
bodyHtml: maskIf(masks, "body", record.bodyHtml),
|
|
95
|
+
bodyText: maskIf(masks, "body", record.bodyText),
|
|
96
|
+
raw: null,
|
|
97
|
+
subject: maskIf(masks, "subject", record.subject)
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if ("custom" in record) {
|
|
101
|
+
return {
|
|
102
|
+
...record,
|
|
103
|
+
company: maskIf(masks, "company", record.company),
|
|
104
|
+
custom: maskCustom(masks, record.custom),
|
|
105
|
+
email: maskIf(masks, "email", record.email),
|
|
106
|
+
firstName: maskIf(masks, "name", record.firstName),
|
|
107
|
+
lastName: maskIf(masks, "name", record.lastName),
|
|
108
|
+
linkedinUrl: maskIf(masks, "linkedin", record.linkedinUrl),
|
|
109
|
+
raw: null
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if ("value" in record) {
|
|
113
|
+
const blocked = BLOCK_FIELDS.get(record.kind);
|
|
114
|
+
return {
|
|
115
|
+
...record,
|
|
116
|
+
raw: null,
|
|
117
|
+
value: blocked === void 0 ? record.value : maskIf(masks, blocked, record.value) ?? MASK
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if ("steps" in record || "schedule" in record || "dns" in record || "size" in record || "url" in record || "description" in record) {
|
|
121
|
+
return { ...record, raw: null };
|
|
122
|
+
}
|
|
123
|
+
if ("kind" in record) {
|
|
124
|
+
return {
|
|
125
|
+
...record,
|
|
126
|
+
address: maskIf(masks, "email", record.address),
|
|
127
|
+
linkedinUrl: maskIf(masks, "linkedin", record.linkedinUrl),
|
|
128
|
+
name: maskIf(masks, "name", record.name),
|
|
129
|
+
raw: null
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
if ("tags" in record || "name" in record) {
|
|
133
|
+
return { ...record, raw: null };
|
|
134
|
+
}
|
|
135
|
+
throw new OutboundError(
|
|
136
|
+
"Unsupported",
|
|
137
|
+
"The redact plugin does not recognise this record, so it will not pass it through"
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
var redactRecord = (masks, record) => maskIdentifiers(masks, redactFields(masks, record));
|
|
141
|
+
var EVENT_FIELDS = /* @__PURE__ */ new Map([
|
|
142
|
+
["leadEmail", "email"],
|
|
143
|
+
["leadName", "name"],
|
|
144
|
+
["linkedinUrl", "linkedin"],
|
|
145
|
+
["subject", "subject"],
|
|
146
|
+
["text", "body"]
|
|
147
|
+
]);
|
|
148
|
+
var redactEventData = (masks, data) => {
|
|
149
|
+
const result = {};
|
|
150
|
+
for (const [key, value] of Object.entries(data)) {
|
|
151
|
+
const field = EVENT_FIELDS.get(key);
|
|
152
|
+
if (field === void 0) {
|
|
153
|
+
result[key] = isJsonObject(value) || Array.isArray(value) ? MASK : value;
|
|
154
|
+
} else {
|
|
155
|
+
result[key] = isString(value) ? maskIf(masks, field, value) : null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
};
|
|
160
|
+
var redact = (options = {}) => {
|
|
161
|
+
const fields = new Set(options.fields ?? ALL_FIELDS);
|
|
162
|
+
const strategy = options.strategy ?? "mask";
|
|
163
|
+
const masks = {
|
|
164
|
+
has: (field) => fields.has(field),
|
|
165
|
+
replace: replacer(strategy)
|
|
166
|
+
};
|
|
167
|
+
return {
|
|
168
|
+
// Asking for bodies while they are being removed is a contradiction, so
|
|
169
|
+
// the capability is turned off and the request is refused up front.
|
|
170
|
+
// A native read returns the vendor's payload untouched, so it is turned off.
|
|
171
|
+
capabilities: (capabilities) => fields.has("body") ? { ...capabilities, "messages.body": false, native: false } : { ...capabilities, native: false },
|
|
172
|
+
event: (event) => maskIdentifiers(masks, {
|
|
173
|
+
...event,
|
|
174
|
+
data: redactEventData(masks, event.data),
|
|
175
|
+
raw: null
|
|
176
|
+
}),
|
|
177
|
+
extend: () => ({ redacted: { fields: [...fields].toSorted(), strategy } }),
|
|
178
|
+
name: "redact",
|
|
179
|
+
wrap: async (operation, next) => {
|
|
180
|
+
const output = await next(operation);
|
|
181
|
+
return {
|
|
182
|
+
...output,
|
|
183
|
+
items: output.items.map((record) => redactRecord(masks, record))
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
export {
|
|
189
|
+
ALL_FIELDS,
|
|
190
|
+
MASK,
|
|
191
|
+
redact
|
|
192
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { OutboundPlugin } from "../internal/outbound/plugins.ts";
|
|
2
|
+
export type RedactField = "body" | "company" | "custom" | "email" | "linkedin" | "name" | "subject";
|
|
3
|
+
export interface RedactOptions {
|
|
4
|
+
/** What to mask. Defaults to everything. */
|
|
5
|
+
readonly fields?: readonly RedactField[] | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* `mask` replaces a value with `[redacted]`. `hash` replaces it with a
|
|
8
|
+
* stable token, so the same person can still be counted and joined.
|
|
9
|
+
*/
|
|
10
|
+
readonly strategy?: "hash" | "mask" | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare const ALL_FIELDS: readonly RedactField[];
|
|
13
|
+
export declare const MASK = "[redacted]";
|
|
14
|
+
/** What `redact` adds to the instance, so other plugins and tools can see what is masked. */
|
|
15
|
+
export interface RedactExtension {
|
|
16
|
+
readonly redacted: {
|
|
17
|
+
readonly fields: readonly RedactField[];
|
|
18
|
+
readonly strategy: "hash" | "mask";
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Masks emails, names, companies, LinkedIn URLs, custom fields and message text. */
|
|
22
|
+
export declare const redact: (options?: RedactOptions) => OutboundPlugin<RedactExtension>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { RateLimitStore } from "../internal/engine/rate-store.ts";
|
|
2
|
+
/** What a Redis script can answer with. */
|
|
3
|
+
export type RedisReply = number | string | null | readonly RedisReply[];
|
|
4
|
+
/**
|
|
5
|
+
* Runs a Lua script on Redis and resolves with its reply.
|
|
6
|
+
*
|
|
7
|
+
* - ioredis: `(script, keys, args) => redis.eval(script, keys.length, ...keys, ...args)`
|
|
8
|
+
* - node-redis: `(script, keys, args) => client.eval(script, { keys, arguments: args })`
|
|
9
|
+
* - Upstash: `(script, keys, args) => redis.eval(script, keys, args)`
|
|
10
|
+
*/
|
|
11
|
+
export type RedisEvaluate = (script: string, keys: readonly string[], args: readonly string[]) => Promise<RedisReply>;
|
|
12
|
+
export interface RedisRateLimitOptions {
|
|
13
|
+
readonly evaluate: RedisEvaluate;
|
|
14
|
+
/** Prepended to every key. Defaults to `outbound-sdk:rate`. */
|
|
15
|
+
readonly prefix?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Called when Redis cannot be reached. The request is then counted in this
|
|
18
|
+
* process only, so a Redis outage slows nothing down and still limits each
|
|
19
|
+
* process on its own.
|
|
20
|
+
*/
|
|
21
|
+
readonly onError?: ((cause: Error) => void) | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A rate budget kept in Redis, so every process, worker or serverless
|
|
25
|
+
* invocation on one credential draws on the same budget.
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* createOutbound({
|
|
29
|
+
* adapter: instantly(),
|
|
30
|
+
* rateLimitStore: redisRateLimitStore({
|
|
31
|
+
* evaluate: (script, keys, args) =>
|
|
32
|
+
* redis.eval(script, keys.length, ...keys, ...args),
|
|
33
|
+
* }),
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Request times come from each process's own clock, so keep the machines'
|
|
38
|
+
* clocks in step (NTP does). If Redis cannot be reached the request is
|
|
39
|
+
* counted in this process only and `onError` is told.
|
|
40
|
+
*/
|
|
41
|
+
export declare const redisRateLimitStore: (options: RedisRateLimitOptions) => RateLimitStore;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MemoryRateLimitStore
|
|
3
|
+
} from "../chunks/chunk-4O2HRTTI.js";
|
|
4
|
+
|
|
5
|
+
// src/redis/index.ts
|
|
6
|
+
var RESERVE = `
|
|
7
|
+
local now = tonumber(ARGV[1])
|
|
8
|
+
local paused = tonumber(redis.call('GET', KEYS[2]) or '0')
|
|
9
|
+
if paused > now then return paused - now end
|
|
10
|
+
local longest = 0
|
|
11
|
+
local wait = 0
|
|
12
|
+
for i = 3, #ARGV, 2 do
|
|
13
|
+
local per = tonumber(ARGV[i])
|
|
14
|
+
local limit = tonumber(ARGV[i + 1])
|
|
15
|
+
if per > longest then longest = per end
|
|
16
|
+
local used = redis.call('ZCOUNT', KEYS[1], '(' .. (now - per), '+inf')
|
|
17
|
+
if used >= limit then
|
|
18
|
+
local blocker = redis.call('ZREVRANGE', KEYS[1], limit - 1, limit - 1, 'WITHSCORES')
|
|
19
|
+
local w = tonumber(blocker[2] or now) + per - now
|
|
20
|
+
if w < 1 then w = 1 end
|
|
21
|
+
if w > wait then wait = w end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
if wait > 0 then return wait end
|
|
25
|
+
redis.call('ZREMRANGEBYSCORE', KEYS[1], '-inf', now - longest)
|
|
26
|
+
redis.call('ZADD', KEYS[1], now, ARGV[2])
|
|
27
|
+
redis.call('PEXPIRE', KEYS[1], longest + 1000)
|
|
28
|
+
return 0
|
|
29
|
+
`;
|
|
30
|
+
var PAUSE = `
|
|
31
|
+
local current = tonumber(redis.call('GET', KEYS[1]) or '0')
|
|
32
|
+
local wanted = tonumber(ARGV[1])
|
|
33
|
+
if wanted > current then
|
|
34
|
+
redis.call('SET', KEYS[1], ARGV[1], 'PX', math.max(1, wanted - tonumber(ARGV[2])))
|
|
35
|
+
end
|
|
36
|
+
return 0
|
|
37
|
+
`;
|
|
38
|
+
var USAGE = `
|
|
39
|
+
local now = tonumber(ARGV[1])
|
|
40
|
+
local used = {}
|
|
41
|
+
for i = 2, #ARGV do
|
|
42
|
+
used[#used + 1] = redis.call('ZCOUNT', KEYS[1], '(' .. (now - tonumber(ARGV[i])), '+inf')
|
|
43
|
+
end
|
|
44
|
+
return used
|
|
45
|
+
`;
|
|
46
|
+
var DEFAULT_PREFIX = "outbound-sdk:rate";
|
|
47
|
+
var toError = (cause) => cause instanceof Error ? cause : new Error(String(cause));
|
|
48
|
+
var toCount = (reply) => {
|
|
49
|
+
const value = Number(reply);
|
|
50
|
+
return Number.isFinite(value) ? value : 0;
|
|
51
|
+
};
|
|
52
|
+
var sequence = 0;
|
|
53
|
+
var member = (now) => {
|
|
54
|
+
sequence = (sequence + 1) % Number.MAX_SAFE_INTEGER;
|
|
55
|
+
return `${now}-${sequence}-${Math.random().toString(36).slice(2)}`;
|
|
56
|
+
};
|
|
57
|
+
var redisRateLimitStore = (options) => {
|
|
58
|
+
const { evaluate, onError } = options;
|
|
59
|
+
const prefix = options.prefix ?? DEFAULT_PREFIX;
|
|
60
|
+
const local = new MemoryRateLimitStore();
|
|
61
|
+
const log = (key) => `${prefix}:{${key}}:log`;
|
|
62
|
+
const pauseKey = (key) => `${prefix}:{${key}}:pause`;
|
|
63
|
+
const guarded = async (remote, fallback) => {
|
|
64
|
+
try {
|
|
65
|
+
return await remote();
|
|
66
|
+
} catch (error) {
|
|
67
|
+
onError?.(toError(error));
|
|
68
|
+
return await fallback();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
pause: (key, until) => guarded(
|
|
73
|
+
async () => {
|
|
74
|
+
await evaluate(
|
|
75
|
+
PAUSE,
|
|
76
|
+
[pauseKey(key)],
|
|
77
|
+
[String(until), String(Date.now())]
|
|
78
|
+
);
|
|
79
|
+
},
|
|
80
|
+
() => local.pause(key, until)
|
|
81
|
+
),
|
|
82
|
+
reserve: (key, windows, now) => guarded(
|
|
83
|
+
async () => toCount(
|
|
84
|
+
await evaluate(
|
|
85
|
+
RESERVE,
|
|
86
|
+
[log(key), pauseKey(key)],
|
|
87
|
+
[
|
|
88
|
+
String(now),
|
|
89
|
+
member(now),
|
|
90
|
+
...windows.flatMap((window) => [
|
|
91
|
+
String(window.perMs),
|
|
92
|
+
String(window.requests)
|
|
93
|
+
])
|
|
94
|
+
]
|
|
95
|
+
)
|
|
96
|
+
),
|
|
97
|
+
() => local.reserve(key, windows, now)
|
|
98
|
+
),
|
|
99
|
+
usage: (key, windows, now) => guarded(
|
|
100
|
+
async () => {
|
|
101
|
+
const reply = await evaluate(
|
|
102
|
+
USAGE,
|
|
103
|
+
[log(key)],
|
|
104
|
+
[String(now), ...windows.map((window) => String(window.perMs))]
|
|
105
|
+
);
|
|
106
|
+
return Array.isArray(reply) ? windows.map((_window, index) => toCount(reply[index] ?? 0)) : windows.map(() => 0);
|
|
107
|
+
},
|
|
108
|
+
() => local.usage(key, windows, now)
|
|
109
|
+
)
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export {
|
|
113
|
+
redisRateLimitStore
|
|
114
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Adapter } from "../internal/adapter.ts";
|
|
2
|
+
import type { SmartleadClient } from "./client.ts";
|
|
3
|
+
type AccountReaders = Pick<Adapter, "getCampaignSettings" | "getSenderHealth" | "listBlocklist" | "listLists" | "listSubsequences" | "listTags" | "listWebhooks">;
|
|
4
|
+
export declare const accountReaders: (client: SmartleadClient) => AccountReaders;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Adapter } from "../internal/adapter.ts";
|
|
2
|
+
import type { SmartleadClient } from "./client.ts";
|
|
3
|
+
type Readers = Pick<Adapter, "getCampaign" | "getCampaignSettings" | "getLead" | "getSender" | "getSenderHealth" | "getSequence" | "listBlocklist" | "listCampaigns" | "listLeads" | "listLists" | "listMessages" | "listReplies" | "listSenders" | "listSubsequences" | "listTags" | "listWebhooks" | "listWorkspaces" | "stats">;
|
|
4
|
+
export declare const readers: (client: SmartleadClient) => Readers;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { CapabilityDeclaration } from "../internal/capabilities.ts";
|
|
2
|
+
import type { LimitDeclaration } from "../internal/limits.ts";
|
|
3
|
+
export declare const BASE_URL = "https://server.smartlead.ai/api/v1";
|
|
4
|
+
export declare const API_KEY_ENV = "SMARTLEAD_API_KEY";
|
|
5
|
+
export declare const WORKSPACE_ENV = "SMARTLEAD_WORKSPACE_ID";
|
|
6
|
+
/** `GET /campaigns/all-leads-activities` has its own 10 per 60 seconds limit. */
|
|
7
|
+
export declare const ACTIVITIES_LANE = "all-leads-activities";
|
|
8
|
+
/** The native reads of these two endpoints use the lanes; no normalized read does. */
|
|
9
|
+
export declare const LEAD_STATISTICS_LANE = "leads-statistics";
|
|
10
|
+
export declare const DOMAIN_HEALTH_LANE = "domain-wise-health";
|
|
11
|
+
/** Email accounts and a campaign's leads: at most 100 per page. */
|
|
12
|
+
export declare const PAGE_SIZE = 100;
|
|
13
|
+
/** The activity feed allows 1,000 lead rows per page; 100 is its default. */
|
|
14
|
+
export declare const ACTIVITIES_PAGE_SIZE = 100;
|
|
15
|
+
export declare const ACTIVITIES_MAX_PAGE_SIZE = 1000;
|
|
16
|
+
/** The block list allows 1,000 entries per page; 100 is its default. */
|
|
17
|
+
export declare const BLOCKLIST_PAGE_SIZE = 1000;
|
|
18
|
+
/** The master inbox returns at most 20 threads per page. */
|
|
19
|
+
export declare const INBOX_PAGE_SIZE = 20;
|
|
20
|
+
export declare const capabilities: CapabilityDeclaration;
|
|
21
|
+
export declare const limits: LimitDeclaration;
|
|
22
|
+
export declare const costs: {
|
|
23
|
+
"blocklist.list": {
|
|
24
|
+
pageSize: number;
|
|
25
|
+
perPage: number;
|
|
26
|
+
};
|
|
27
|
+
"campaigns.get": {
|
|
28
|
+
perPage: number;
|
|
29
|
+
};
|
|
30
|
+
"campaigns.list": {
|
|
31
|
+
perPage: number;
|
|
32
|
+
};
|
|
33
|
+
"campaigns.settings": {
|
|
34
|
+
perPage: number;
|
|
35
|
+
};
|
|
36
|
+
"leads.get": {
|
|
37
|
+
perPage: number;
|
|
38
|
+
};
|
|
39
|
+
"leads.list": {
|
|
40
|
+
pageSize: number;
|
|
41
|
+
perPage: number;
|
|
42
|
+
};
|
|
43
|
+
"lists.list": {
|
|
44
|
+
pageSize: number;
|
|
45
|
+
perPage: number;
|
|
46
|
+
};
|
|
47
|
+
"messages.list": {
|
|
48
|
+
pageSize: number;
|
|
49
|
+
perPage: number;
|
|
50
|
+
};
|
|
51
|
+
"replies.list": {
|
|
52
|
+
pageSize: number;
|
|
53
|
+
perPage: number;
|
|
54
|
+
};
|
|
55
|
+
"senders.get": {
|
|
56
|
+
perPage: number;
|
|
57
|
+
};
|
|
58
|
+
"senders.health": {
|
|
59
|
+
perPage: number;
|
|
60
|
+
};
|
|
61
|
+
"senders.list": {
|
|
62
|
+
pageSize: number;
|
|
63
|
+
perPage: number;
|
|
64
|
+
};
|
|
65
|
+
"sequence.get": {
|
|
66
|
+
perPage: number;
|
|
67
|
+
};
|
|
68
|
+
"sequence.subsequences": {
|
|
69
|
+
pageSize: number;
|
|
70
|
+
perPage: number;
|
|
71
|
+
};
|
|
72
|
+
stats: {
|
|
73
|
+
perPage: number;
|
|
74
|
+
};
|
|
75
|
+
"tags.list": {
|
|
76
|
+
perPage: number;
|
|
77
|
+
};
|
|
78
|
+
"webhooks.list": {
|
|
79
|
+
perPage: number;
|
|
80
|
+
};
|
|
81
|
+
"workspaces.list": {
|
|
82
|
+
perPage: number;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export declare const caveats: readonly string[];
|