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.
Files changed (271) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +121 -2
  3. package/dist/alerts/index.d.ts +2 -0
  4. package/dist/alerts/index.js +136 -0
  5. package/dist/alerts/plugin.d.ts +58 -0
  6. package/dist/audit/index.d.ts +33 -0
  7. package/dist/audit/index.js +60 -0
  8. package/dist/benchmarks/index.d.ts +29 -0
  9. package/dist/benchmarks/index.js +70 -0
  10. package/dist/budget/index.d.ts +21 -0
  11. package/dist/budget/index.js +50 -0
  12. package/dist/cache/index.d.ts +31 -0
  13. package/dist/cache/index.js +11 -0
  14. package/dist/cards/content.d.ts +43 -0
  15. package/dist/cards/copy-cards.d.ts +2 -0
  16. package/dist/cards/format.d.ts +39 -0
  17. package/dist/cards/index.d.ts +9 -0
  18. package/dist/cards/index.js +2070 -0
  19. package/dist/cards/notify-cards.d.ts +14 -0
  20. package/dist/cards/ops-cards.d.ts +2 -0
  21. package/dist/cards/parts.d.ts +22 -0
  22. package/dist/cards/people-cards.d.ts +2 -0
  23. package/dist/cards/render.d.ts +28 -0
  24. package/dist/cards/sender-cards.d.ts +2 -0
  25. package/dist/cards/slack-rich.d.ts +19 -0
  26. package/dist/cards/slack-text.d.ts +10 -0
  27. package/dist/cards/slack.d.ts +21 -0
  28. package/dist/cards/spec.d.ts +86 -0
  29. package/dist/cards/tool-cards.d.ts +4 -0
  30. package/dist/chunks/chunk-4O2HRTTI.js +75 -0
  31. package/dist/chunks/chunk-7BCYLIDG.js +483 -0
  32. package/dist/chunks/chunk-B7V6EOAC.js +2273 -0
  33. package/dist/chunks/chunk-CMQ5ZHLZ.js +25 -0
  34. package/dist/chunks/chunk-F7MKFVIG.js +43 -0
  35. package/dist/chunks/chunk-FZF6CLPX.js +232 -0
  36. package/dist/chunks/chunk-GPEJG34O.js +53 -0
  37. package/dist/chunks/chunk-HEC7XFFH.js +65 -0
  38. package/dist/chunks/chunk-IBC52BX3.js +24 -0
  39. package/dist/chunks/chunk-LNCOGBMI.js +144 -0
  40. package/dist/chunks/chunk-LOXBLQ3I.js +180 -0
  41. package/dist/chunks/chunk-NAWZ73QS.js +22 -0
  42. package/dist/chunks/chunk-OCV66TS2.js +705 -0
  43. package/dist/chunks/chunk-Q465X22Y.js +548 -0
  44. package/dist/chunks/chunk-QTB747K4.js +100 -0
  45. package/dist/chunks/chunk-QZNNCXXD.js +92 -0
  46. package/dist/chunks/chunk-R6AM4GJR.js +105 -0
  47. package/dist/chunks/chunk-TIJKJJDW.js +6 -0
  48. package/dist/chunks/chunk-VURTOVGI.js +61 -0
  49. package/dist/chunks/chunk-WAM6N4OF.js +269 -0
  50. package/dist/chunks/chunk-WW746NJF.js +94 -0
  51. package/dist/chunks/chunk-XC6CZP73.js +80 -0
  52. package/dist/chunks/chunk-ZGHQYZEH.js +45 -0
  53. package/dist/cli/bin.d.ts +2 -0
  54. package/dist/cli/bin.js +34 -0
  55. package/dist/cli/commands.d.ts +16 -0
  56. package/dist/cli/index.d.ts +13 -0
  57. package/dist/cli/index.js +25 -0
  58. package/dist/cli/mcp.d.ts +14 -0
  59. package/dist/clients/index.d.ts +2 -0
  60. package/dist/clients/index.js +107 -0
  61. package/dist/clients/plugin.d.ts +42 -0
  62. package/dist/combine/account.d.ts +4 -0
  63. package/dist/combine/adapter.d.ts +9 -0
  64. package/dist/combine/index.d.ts +2 -0
  65. package/dist/combine/index.js +345 -0
  66. package/dist/combine/route.d.ts +17 -0
  67. package/dist/exporter/index.d.ts +29 -0
  68. package/dist/exporter/index.js +77 -0
  69. package/dist/failover/index.d.ts +11 -0
  70. package/dist/failover/index.js +45 -0
  71. package/dist/fixtures/index.d.ts +27 -0
  72. package/dist/fixtures/index.js +241 -0
  73. package/dist/fixtures/scrub.d.ts +5 -0
  74. package/dist/heyreach/account.d.ts +11 -0
  75. package/dist/heyreach/adapter.d.ts +5 -0
  76. package/dist/heyreach/capabilities.d.ts +68 -0
  77. package/dist/heyreach/client.d.ts +20 -0
  78. package/dist/heyreach/inbox.d.ts +7 -0
  79. package/dist/heyreach/index.d.ts +18 -0
  80. package/dist/heyreach/index.js +1708 -0
  81. package/dist/heyreach/lookup.d.ts +15 -0
  82. package/dist/heyreach/map-account.d.ts +25 -0
  83. package/dist/heyreach/map-sequence.d.ts +5 -0
  84. package/dist/heyreach/map-stats.d.ts +10 -0
  85. package/dist/heyreach/map.d.ts +35 -0
  86. package/dist/heyreach/native-organization.d.ts +128 -0
  87. package/dist/heyreach/native-voice.d.ts +106 -0
  88. package/dist/heyreach/native.d.ts +496 -0
  89. package/dist/heyreach/paging.d.ts +7 -0
  90. package/dist/heyreach/webhooks.d.ts +2 -0
  91. package/dist/identity/index.d.ts +3 -0
  92. package/dist/identity/index.js +148 -0
  93. package/dist/identity/keys.d.ts +9 -0
  94. package/dist/identity/plugin.d.ts +34 -0
  95. package/dist/index.d.ts +36 -0
  96. package/dist/index.js +119 -0
  97. package/dist/insights/copy/copy-audit.d.ts +55 -0
  98. package/dist/insights/copy/copy-checks.d.ts +44 -0
  99. package/dist/insights/copy/copy-reuse.d.ts +59 -0
  100. package/dist/insights/copy/index.d.ts +67 -0
  101. package/dist/insights/copy/reply-timing.d.ts +63 -0
  102. package/dist/insights/copy/shared.d.ts +53 -0
  103. package/dist/insights/copy/step-funnel.d.ts +66 -0
  104. package/dist/insights/copy/variant-test.d.ts +64 -0
  105. package/dist/insights/define.d.ts +98 -0
  106. package/dist/insights/index.d.ts +10 -0
  107. package/dist/insights/index.js +4873 -0
  108. package/dist/insights/ops/anomalies.d.ts +80 -0
  109. package/dist/insights/ops/campaign-diagnosis.d.ts +39 -0
  110. package/dist/insights/ops/campaign-ranking.d.ts +56 -0
  111. package/dist/insights/ops/channel-mix.d.ts +44 -0
  112. package/dist/insights/ops/client-report.d.ts +76 -0
  113. package/dist/insights/ops/diagnosis-checks.d.ts +48 -0
  114. package/dist/insights/ops/index.d.ts +135 -0
  115. package/dist/insights/ops/period-comparison.d.ts +86 -0
  116. package/dist/insights/ops/pipeline-forecast.d.ts +44 -0
  117. package/dist/insights/ops/shared.d.ts +149 -0
  118. package/dist/insights/ops/tag-rollup.d.ts +32 -0
  119. package/dist/insights/people/account-summary.d.ts +68 -0
  120. package/dist/insights/people/dropped-replies.d.ts +51 -0
  121. package/dist/insights/people/find.d.ts +18 -0
  122. package/dist/insights/people/hot-leads.d.ts +67 -0
  123. package/dist/insights/people/index.d.ts +88 -0
  124. package/dist/insights/people/lead-collisions.d.ts +43 -0
  125. package/dist/insights/people/person-summary.d.ts +46 -0
  126. package/dist/insights/people/personalization-gaps.d.ts +60 -0
  127. package/dist/insights/people/read.d.ts +40 -0
  128. package/dist/insights/people/suppression-check.d.ts +53 -0
  129. package/dist/insights/plugin.d.ts +40 -0
  130. package/dist/insights/registry.d.ts +335 -0
  131. package/dist/insights/senders/bounce-watch.d.ts +70 -0
  132. package/dist/insights/senders/domain-health.d.ts +69 -0
  133. package/dist/insights/senders/index.d.ts +74 -0
  134. package/dist/insights/senders/read.d.ts +37 -0
  135. package/dist/insights/senders/sender-capacity.d.ts +67 -0
  136. package/dist/insights/senders/sender-load.d.ts +52 -0
  137. package/dist/insights/senders/settings-audit.d.ts +48 -0
  138. package/dist/insights/senders/warmup-readiness.d.ts +39 -0
  139. package/dist/insights/stats.d.ts +45 -0
  140. package/dist/insights/tools.d.ts +16 -0
  141. package/dist/insights/types.d.ts +4 -0
  142. package/dist/instantly/adapter-account.d.ts +5 -0
  143. package/dist/instantly/adapter-mail.d.ts +3 -0
  144. package/dist/instantly/adapter.d.ts +7 -0
  145. package/dist/instantly/capabilities.d.ts +83 -0
  146. package/dist/instantly/client.d.ts +29 -0
  147. package/dist/instantly/index.d.ts +20 -0
  148. package/dist/instantly/index.js +2372 -0
  149. package/dist/instantly/map-account.d.ts +23 -0
  150. package/dist/instantly/map-lead.d.ts +18 -0
  151. package/dist/instantly/map-stats.d.ts +22 -0
  152. package/dist/instantly/map.d.ts +24 -0
  153. package/dist/instantly/native-agents-sales.d.ts +161 -0
  154. package/dist/instantly/native-agents.d.ts +156 -0
  155. package/dist/instantly/native-campaigns.d.ts +101 -0
  156. package/dist/instantly/native-leads.d.ts +93 -0
  157. package/dist/instantly/native-params.d.ts +24 -0
  158. package/dist/instantly/native-search.d.ts +82 -0
  159. package/dist/instantly/native-senders.d.ts +182 -0
  160. package/dist/instantly/native-supersearch.d.ts +149 -0
  161. package/dist/instantly/native-workspace.d.ts +170 -0
  162. package/dist/instantly/native.d.ts +1081 -0
  163. package/dist/instantly/pages.d.ts +29 -0
  164. package/dist/instantly/stats.d.ts +5 -0
  165. package/dist/instantly/webhooks.d.ts +2 -0
  166. package/dist/internal/adapter.d.ts +189 -0
  167. package/dist/internal/capabilities.d.ts +86 -0
  168. package/dist/internal/cursor.d.ts +10 -0
  169. package/dist/internal/engine/budget.d.ts +44 -0
  170. package/dist/internal/engine/engine.d.ts +45 -0
  171. package/dist/internal/engine/rate-store.d.ts +25 -0
  172. package/dist/internal/engine/request.d.ts +27 -0
  173. package/dist/internal/engine/retry.d.ts +21 -0
  174. package/dist/internal/engine/runtime.d.ts +13 -0
  175. package/dist/internal/entities-account.d.ts +135 -0
  176. package/dist/internal/entities.d.ts +389 -0
  177. package/dist/internal/env.d.ts +4 -0
  178. package/dist/internal/errors.d.ts +57 -0
  179. package/dist/internal/hooks.d.ts +55 -0
  180. package/dist/internal/json.d.ts +40 -0
  181. package/dist/internal/limits.d.ts +34 -0
  182. package/dist/internal/metrics.d.ts +52 -0
  183. package/dist/internal/native.d.ts +66 -0
  184. package/dist/internal/outbound/api.d.ts +267 -0
  185. package/dist/internal/outbound/collections.d.ts +31 -0
  186. package/dist/internal/outbound/core.d.ts +36 -0
  187. package/dist/internal/outbound/create.d.ts +16 -0
  188. package/dist/internal/outbound/handles.d.ts +7 -0
  189. package/dist/internal/outbound/native.d.ts +4 -0
  190. package/dist/internal/outbound/operation-shared.d.ts +28 -0
  191. package/dist/internal/outbound/operations-account.d.ts +29 -0
  192. package/dist/internal/outbound/operations.d.ts +42 -0
  193. package/dist/internal/outbound/outbound.d.ts +64 -0
  194. package/dist/internal/outbound/plugins.d.ts +40 -0
  195. package/dist/internal/outbound/raw.d.ts +9 -0
  196. package/dist/internal/outbound/specs-account.d.ts +16 -0
  197. package/dist/internal/outbound/specs.d.ts +14 -0
  198. package/dist/internal/outbound/stats.d.ts +7 -0
  199. package/dist/internal/outbound/validate.d.ts +5 -0
  200. package/dist/internal/outbound/walker.d.ts +22 -0
  201. package/dist/internal/record.d.ts +19 -0
  202. package/dist/internal/redact.d.ts +18 -0
  203. package/dist/internal/ref.d.ts +16 -0
  204. package/dist/internal/sha256.d.ts +4 -0
  205. package/dist/internal/text.d.ts +11 -0
  206. package/dist/internal/url.d.ts +9 -0
  207. package/dist/loader/index.d.ts +12 -0
  208. package/dist/loader/index.js +12 -0
  209. package/dist/memory/account-reads.d.ts +5 -0
  210. package/dist/memory/account.d.ts +67 -0
  211. package/dist/memory/adapter.d.ts +16 -0
  212. package/dist/memory/data.d.ts +122 -0
  213. package/dist/memory/demo.d.ts +7 -0
  214. package/dist/memory/index.d.ts +5 -0
  215. package/dist/memory/index.js +792 -0
  216. package/dist/memory/stats.d.ts +6 -0
  217. package/dist/memory/store.d.ts +18 -0
  218. package/dist/providers/index.d.ts +22 -0
  219. package/dist/providers/index.js +10 -0
  220. package/dist/reconcile/index.d.ts +2 -0
  221. package/dist/reconcile/index.js +72 -0
  222. package/dist/reconcile/plugin.d.ts +55 -0
  223. package/dist/redact/index.d.ts +2 -0
  224. package/dist/redact/index.js +192 -0
  225. package/dist/redact/plugin.d.ts +22 -0
  226. package/dist/redis/index.d.ts +41 -0
  227. package/dist/redis/index.js +114 -0
  228. package/dist/smartlead/account.d.ts +5 -0
  229. package/dist/smartlead/adapter.d.ts +5 -0
  230. package/dist/smartlead/capabilities.d.ts +85 -0
  231. package/dist/smartlead/client.d.ts +23 -0
  232. package/dist/smartlead/hmac.d.ts +9 -0
  233. package/dist/smartlead/index.d.ts +17 -0
  234. package/dist/smartlead/index.js +2170 -0
  235. package/dist/smartlead/leads.d.ts +6 -0
  236. package/dist/smartlead/lookup.d.ts +8 -0
  237. package/dist/smartlead/mail.d.ts +5 -0
  238. package/dist/smartlead/map-account.d.ts +22 -0
  239. package/dist/smartlead/map-messages.d.ts +31 -0
  240. package/dist/smartlead/map-stats.d.ts +37 -0
  241. package/dist/smartlead/map.d.ts +52 -0
  242. package/dist/smartlead/native-analytics.d.ts +242 -0
  243. package/dist/smartlead/native-campaigns.d.ts +211 -0
  244. package/dist/smartlead/native-inbox.d.ts +141 -0
  245. package/dist/smartlead/native-params.d.ts +33 -0
  246. package/dist/smartlead/native-services.d.ts +204 -0
  247. package/dist/smartlead/native.d.ts +785 -0
  248. package/dist/smartlead/shared.d.ts +28 -0
  249. package/dist/smartlead/stats.d.ts +5 -0
  250. package/dist/smartlead/webhooks.d.ts +2 -0
  251. package/dist/sync/index.d.ts +2 -0
  252. package/dist/sync/index.js +158 -0
  253. package/dist/sync/plugin.d.ts +58 -0
  254. package/dist/tools/account-tools.d.ts +21 -0
  255. package/dist/tools/ai-sdk.d.ts +8 -0
  256. package/dist/tools/ai-sdk.js +26 -0
  257. package/dist/tools/campaign-tools.d.ts +59 -0
  258. package/dist/tools/claude-agent.d.ts +18 -0
  259. package/dist/tools/claude-agent.js +40 -0
  260. package/dist/tools/index.d.ts +28 -0
  261. package/dist/tools/index.js +20 -0
  262. package/dist/tools/people-tools.d.ts +19 -0
  263. package/dist/tools/registry.d.ts +34 -0
  264. package/dist/tools/shared.d.ts +75 -0
  265. package/dist/tracing/index.d.ts +25 -0
  266. package/dist/tracing/index.js +69 -0
  267. package/dist/webhooks/index.d.ts +3 -0
  268. package/dist/webhooks/index.js +226 -0
  269. package/dist/webhooks/parse.d.ts +41 -0
  270. package/dist/webhooks/secret.d.ts +4 -0
  271. package/package.json +181 -4
@@ -0,0 +1,16 @@
1
+ import type { BlockEntry, CampaignSettings, LeadList, SenderHealth, Tag, WebhookSubscription } from "../entities-account.ts";
2
+ import type { Sequence } from "../entities.ts";
3
+ import type { WebhookFilters } from "./api.ts";
4
+ import type { GetSpec, ListSpec } from "./collections.ts";
5
+ import type { Core } from "./core.ts";
6
+ type NoFilters = Record<never, never>;
7
+ export declare const settingsGet: (core: Core) => GetSpec<CampaignSettings>;
8
+ export declare const healthGet: (core: Core) => GetSpec<SenderHealth>;
9
+ export declare const subsequenceList: (core: Core) => ListSpec<Sequence, {
10
+ readonly campaignId?: string | undefined;
11
+ }>;
12
+ export declare const listList: (core: Core) => ListSpec<LeadList, NoFilters>;
13
+ export declare const blocklistList: (core: Core) => ListSpec<BlockEntry, NoFilters>;
14
+ export declare const tagList: (core: Core) => ListSpec<Tag, NoFilters>;
15
+ export declare const webhookList: (core: Core) => ListSpec<WebhookSubscription, WebhookFilters>;
16
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { Campaign, Lead, Message, Reply, Sender, Sequence, Workspace } from "../entities.ts";
2
+ import type { CampaignFilters, LeadFilters, MessageFilters, ReplyFilters, SenderFilters } from "./api.ts";
3
+ import type { GetSpec, ListSpec } from "./collections.ts";
4
+ import type { Core } from "./core.ts";
5
+ export declare const campaignList: (core: Core) => ListSpec<Campaign, CampaignFilters>;
6
+ export declare const campaignGet: () => GetSpec<Campaign>;
7
+ export declare const sequenceGet: (core: Core) => GetSpec<Sequence>;
8
+ export declare const senderList: (core: Core) => ListSpec<Sender, SenderFilters>;
9
+ export declare const senderGet: (core: Core) => GetSpec<Sender>;
10
+ export declare const leadList: (core: Core) => ListSpec<Lead, LeadFilters>;
11
+ export declare const leadGet: (core: Core) => GetSpec<Lead>;
12
+ export declare const messageList: (core: Core) => ListSpec<Message, MessageFilters>;
13
+ export declare const replyList: (core: Core) => ListSpec<Reply, ReplyFilters>;
14
+ export declare const workspaceList: (core: Core) => ListSpec<Workspace, Record<never, never>>;
@@ -0,0 +1,7 @@
1
+ import type { StatsResult, TopLevelStatsOptions } from "./api.ts";
2
+ import type { Core } from "./core.ts";
3
+ /**
4
+ * Counts for a scope, as totals or one row per day. Async, so a refused
5
+ * input or capability rejects like every other failure of the call.
6
+ */
7
+ export declare const readStats: (core: Core, options?: TopLevelStatsOptions) => Promise<StatsResult>;
@@ -0,0 +1,5 @@
1
+ import type { TimeRange } from "../adapter.ts";
2
+ export declare const normalizeRange: (range: TimeRange) => TimeRange;
3
+ export declare const assertDay: (value: string | undefined, name: string) => string | undefined;
4
+ export declare const assertLimit: (limit: number | undefined) => number | undefined;
5
+ export declare const assertId: (id: string, what: string) => string;
@@ -0,0 +1,22 @@
1
+ import type { CallState } from "../engine/request.ts";
2
+ import type { ListAll, PageResult, ResultMeta } from "./api.ts";
3
+ export interface WalkerOptions<Item> {
4
+ readonly cursor: string | undefined;
5
+ readonly max: number | undefined;
6
+ /** Fetches one page. `state` is shared by every page of the walk. */
7
+ readonly fetchPage: (cursor: string | undefined, state: CallState | undefined) => Promise<{
8
+ readonly page: PageResult<Item>;
9
+ readonly state: CallState;
10
+ }>;
11
+ /** A stable key used to drop records a shifting page returned twice. */
12
+ readonly keyOf: (item: Item) => string | undefined;
13
+ }
14
+ export declare class PageWalker<Item> implements ListAll<Item> {
15
+ #private;
16
+ constructor(options: WalkerOptions<Item>);
17
+ get cursor(): string | undefined;
18
+ get meta(): ResultMeta | undefined;
19
+ get truncated(): boolean;
20
+ [Symbol.asyncIterator](): AsyncGenerator<Item, void, undefined>;
21
+ toArray(): Promise<Item[]>;
22
+ }
@@ -0,0 +1,19 @@
1
+ import type { Json } from "./json.ts";
2
+ /** Which provider and workspace a record belongs to. */
3
+ export interface Identity {
4
+ readonly provider: string;
5
+ readonly workspaceId: string;
6
+ }
7
+ /** The fields every entity shares. Adapters spread this into each record. */
8
+ export declare const recordBase: (identity: Identity, sourceId: string | number, raw: Json) => {
9
+ provider: string;
10
+ raw: Json;
11
+ ref: string;
12
+ schemaVersion: 1;
13
+ sourceId: string;
14
+ workspaceId: string;
15
+ };
16
+ /** A ref to another record of the same provider and workspace, or `null`. */
17
+ export declare const refTo: (identity: Identity, sourceId: string | number | null | undefined) => string | null;
18
+ /** Refs to other records of the same provider and workspace, skipping empty ids. */
19
+ export declare const refsTo: (identity: Identity, sourceIds: readonly (string | number | null | undefined)[]) => string[];
@@ -0,0 +1,18 @@
1
+ export declare const REDACTED_KEY = "[redacted-key]";
2
+ export declare const REDACTED_EMAIL = "[redacted-email]";
3
+ /** Replaces every secret and every email address in `value`. */
4
+ export declare const redactText: (value: string, secrets?: readonly string[]) => string;
5
+ /** A URL safe to log: secrets and emails removed, including from the query. */
6
+ export declare const redactUrl: (url: string, secrets?: readonly string[]) => string;
7
+ /** A plain copy of a cause with every secret and email address removed. */
8
+ export type RedactedJson = boolean | number | string | null | readonly RedactedJson[] | {
9
+ readonly [key: string]: RedactedJson;
10
+ };
11
+ /**
12
+ * What an error keeps as its `cause`: a copy with every secret and email
13
+ * address removed. Loggers print the cause chain, and a vendor's error body
14
+ * or a network error can hold an address or echo the key. A vendor response
15
+ * becomes plain data; another Error becomes a new Error with the same name,
16
+ * message and stack, redacted.
17
+ */
18
+ export declare const redactCause: (cause: unknown, secrets?: readonly string[]) => Error | RedactedJson | undefined;
@@ -0,0 +1,16 @@
1
+ export interface RefParts {
2
+ readonly provider: string;
3
+ readonly workspaceId: string;
4
+ readonly sourceId: string;
5
+ }
6
+ /** Builds `provider:workspaceId:sourceId`. */
7
+ export declare const makeRef: (provider: string, workspaceId: string, sourceId: string | number) => string;
8
+ /** Splits a ref. The source id may itself contain colons. */
9
+ export declare const parseRef: (ref: string) => RefParts | null;
10
+ /**
11
+ * Accepts a ref or a bare vendor id and returns the vendor id for this
12
+ * adapter. A ref that belongs to another provider or workspace is rejected.
13
+ */
14
+ export declare const sourceIdFor: (id: string, provider: string, workspaceId: string) => string;
15
+ /** Workspace labels become part of every ref, so they cannot hold the separator. */
16
+ export declare const assertWorkspaceId: (workspaceId: string, provider: string) => string;
@@ -0,0 +1,4 @@
1
+ /** The SHA-256 digest of a UTF-8 string, as lowercase hex. */
2
+ export declare const sha256Hex: (input: string) => string;
3
+ /** A short stable id derived from the parts, for refs, event ids and cache keys. */
4
+ export declare const stableId: (...parts: (string | number | null | undefined)[]) => string;
@@ -0,0 +1,11 @@
1
+ export declare const looksLikeHtml: (value: string) => boolean;
2
+ /** Converts HTML to readable plain text. */
3
+ export declare const htmlToText: (html: string) => string;
4
+ /** Removes quoted history from a plain-text reply. */
5
+ export declare const stripQuotedHistory: (text: string) => string;
6
+ export interface MessageBody {
7
+ readonly bodyHtml: string | null;
8
+ readonly bodyText: string | null;
9
+ }
10
+ /** Normalizes a vendor body into kept HTML plus derived plain text. */
11
+ export declare const normalizeBody: (body: string | null, includeBody: boolean) => MessageBody;
@@ -0,0 +1,9 @@
1
+ export type QueryValue = string | number | boolean | null | undefined;
2
+ /** Joins a base URL and a path and appends the defined query values. */
3
+ export declare const buildUrl: (baseUrl: string, path: string, query?: Readonly<Record<string, QueryValue>>) => string;
4
+ /**
5
+ * The part of a LinkedIn profile URL that names the person, lowercased, or
6
+ * `null` when the text is not a profile URL. Two URLs for the same person can
7
+ * differ in scheme, host prefix, trailing slash and query; the slug does not.
8
+ */
9
+ export declare const profileSlug: (url: string | null | undefined) => string | null;
@@ -0,0 +1,12 @@
1
+ import type { Adapter } from "../internal/adapter.ts";
2
+ export interface FromEnvOptions {
3
+ /** Overrides `OUTBOUND_SDK_PROVIDER`. */
4
+ readonly provider?: string | undefined;
5
+ }
6
+ /** The provider ids `fromEnv` can load. */
7
+ export declare const loadableProviders: () => string[];
8
+ /**
9
+ * Builds the adapter named by `OUTBOUND_SDK_PROVIDER`, reading its key from
10
+ * that adapter's own environment variables.
11
+ */
12
+ export declare const fromEnv: (options?: FromEnvOptions) => Promise<Adapter>;
@@ -0,0 +1,12 @@
1
+ import {
2
+ fromEnv,
3
+ loadableProviders
4
+ } from "../chunks/chunk-HEC7XFFH.js";
5
+ import "../chunks/chunk-CMQ5ZHLZ.js";
6
+ import "../chunks/chunk-XC6CZP73.js";
7
+ import "../chunks/chunk-LOXBLQ3I.js";
8
+ import "../chunks/chunk-QZNNCXXD.js";
9
+ export {
10
+ fromEnv,
11
+ loadableProviders
12
+ };
@@ -0,0 +1,5 @@
1
+ import type { Adapter } from "../internal/adapter.ts";
2
+ import type { Store } from "./store.ts";
3
+ type AccountReads = Pick<Adapter, "getCampaignSettings" | "getSenderHealth" | "listBlocklist" | "listLists" | "listSubsequences" | "listTags" | "listWebhooks">;
4
+ export declare const accountReads: (store: Store) => AccountReads;
5
+ export {};
@@ -0,0 +1,67 @@
1
+ import type { BlockEntry, CampaignSettings, LeadList, SenderHealth, SendingWindow, Tag, WebhookSubscription } from "../internal/entities-account.ts";
2
+ import type { Identity } from "../internal/record.ts";
3
+ export interface MemorySettings {
4
+ readonly schedule?: readonly Partial<SendingWindow>[];
5
+ readonly dailyLimit?: number;
6
+ readonly dailyNewLeads?: number;
7
+ readonly gapMinutes?: number;
8
+ readonly startDate?: string;
9
+ readonly endDate?: string;
10
+ readonly trackOpens?: boolean;
11
+ readonly trackClicks?: boolean;
12
+ readonly stopOnReply?: boolean;
13
+ readonly stopOnAutoReply?: boolean;
14
+ readonly plainText?: boolean;
15
+ }
16
+ export interface MemoryHealth {
17
+ readonly spf?: boolean;
18
+ readonly dkim?: boolean;
19
+ readonly dmarc?: boolean;
20
+ readonly mx?: boolean;
21
+ readonly connected?: boolean;
22
+ readonly blacklisted?: boolean;
23
+ readonly issues?: readonly string[];
24
+ readonly checkedAt?: string;
25
+ readonly warmup?: {
26
+ readonly sent?: number;
27
+ readonly received?: number;
28
+ readonly inbox?: number;
29
+ readonly spam?: number;
30
+ readonly score?: number;
31
+ };
32
+ }
33
+ export interface MemoryList {
34
+ readonly id: string;
35
+ readonly name?: string;
36
+ readonly kind?: LeadList["kind"];
37
+ readonly createdAt?: string;
38
+ }
39
+ export interface MemoryBlockEntry {
40
+ readonly id: string;
41
+ readonly value: string;
42
+ readonly kind?: BlockEntry["kind"];
43
+ readonly createdAt?: string;
44
+ }
45
+ export interface MemoryTag {
46
+ readonly id: string;
47
+ readonly name?: string;
48
+ readonly description?: string;
49
+ }
50
+ export interface MemoryWebhook {
51
+ readonly id: string;
52
+ readonly url: string;
53
+ readonly name?: string;
54
+ readonly events?: readonly string[];
55
+ readonly active?: boolean;
56
+ readonly campaignId?: string;
57
+ readonly createdAt?: string;
58
+ }
59
+ export declare const toSettings: (identity: Identity, campaignId: string, seed: MemorySettings) => CampaignSettings;
60
+ export declare const toHealth: (identity: Identity, sender: {
61
+ readonly id: string;
62
+ readonly address?: string | undefined;
63
+ }, seed: MemoryHealth) => SenderHealth;
64
+ export declare const toList: (identity: Identity, seed: MemoryList, size: number) => LeadList;
65
+ export declare const toBlockEntry: (identity: Identity, seed: MemoryBlockEntry) => BlockEntry;
66
+ export declare const toTag: (identity: Identity, seed: MemoryTag) => Tag;
67
+ export declare const toWebhook: (identity: Identity, seed: MemoryWebhook) => WebhookSubscription;
@@ -0,0 +1,16 @@
1
+ import type { Adapter } from "../internal/adapter.ts";
2
+ import type { CapabilityDeclaration } from "../internal/capabilities.ts";
3
+ import type { MemoryData } from "./data.ts";
4
+ export interface MemoryOptions {
5
+ readonly data?: MemoryData | undefined;
6
+ /** A label for this workspace. Defaults to `default`. */
7
+ readonly workspaceId?: string | undefined;
8
+ /** The provider name records carry. Defaults to `memory`. */
9
+ readonly name?: string | undefined;
10
+ /** Records per page. Defaults to 50. */
11
+ readonly pageSize?: number | undefined;
12
+ /** Overrides what the adapter declares, to exercise gating and fallbacks. */
13
+ readonly capabilities?: CapabilityDeclaration | undefined;
14
+ }
15
+ /** An adapter over data held in memory. */
16
+ export declare const memory: (options?: MemoryOptions) => Adapter;
@@ -0,0 +1,122 @@
1
+ import type { Campaign, CampaignStatus, Channel, Lead, LeadEngagement, LeadStatus, Message, MetricRow, Reply, ReplyCategory, Sender, SenderStatus, Sequence } from "../internal/entities.ts";
2
+ import type { MetricCounts } from "../internal/metrics.ts";
3
+ import type { Identity } from "../internal/record.ts";
4
+ import type { MemoryBlockEntry, MemoryHealth, MemoryList, MemorySettings, MemoryTag, MemoryWebhook } from "./account.ts";
5
+ export interface MemoryVariant {
6
+ readonly key?: string;
7
+ readonly subject?: string;
8
+ readonly body?: string;
9
+ }
10
+ export interface MemoryStep {
11
+ readonly action?: string;
12
+ readonly delayDays?: number;
13
+ readonly variants: readonly MemoryVariant[];
14
+ /** The step before this one. Defaults to the previous step in the list. */
15
+ readonly parentIndex?: number;
16
+ /** The outcome of the parent's condition that leads here. */
17
+ readonly branch?: string;
18
+ }
19
+ export interface MemorySubsequence {
20
+ readonly id: string;
21
+ readonly name?: string;
22
+ readonly steps: readonly MemoryStep[];
23
+ }
24
+ export interface MemoryCampaign {
25
+ readonly id: string;
26
+ readonly name?: string;
27
+ readonly status?: CampaignStatus;
28
+ readonly channel?: Channel;
29
+ readonly createdAt?: string;
30
+ readonly tags?: readonly string[];
31
+ readonly steps?: readonly MemoryStep[];
32
+ readonly settings?: MemorySettings;
33
+ readonly subsequences?: readonly MemorySubsequence[];
34
+ }
35
+ export interface MemorySender {
36
+ readonly id: string;
37
+ readonly address?: string;
38
+ readonly linkedinUrl?: string;
39
+ readonly name?: string;
40
+ readonly status?: SenderStatus;
41
+ readonly dailyLimit?: number;
42
+ readonly warmup?: {
43
+ readonly enabled: boolean;
44
+ readonly score?: number;
45
+ };
46
+ /** The campaigns this sender is attached to. */
47
+ readonly campaignIds?: readonly string[];
48
+ readonly health?: MemoryHealth;
49
+ }
50
+ export interface MemoryLead {
51
+ readonly id: string;
52
+ readonly campaignId?: string;
53
+ readonly email?: string;
54
+ readonly linkedinUrl?: string;
55
+ readonly firstName?: string;
56
+ readonly lastName?: string;
57
+ readonly company?: string;
58
+ readonly title?: string;
59
+ readonly status?: LeadStatus;
60
+ readonly custom?: Readonly<Record<string, string>>;
61
+ readonly createdAt?: string;
62
+ readonly engagement?: Partial<LeadEngagement>;
63
+ readonly interest?: string;
64
+ readonly tags?: readonly string[];
65
+ /** The saved lists the lead is on. */
66
+ readonly listIds?: readonly string[];
67
+ }
68
+ export interface MemoryMessage {
69
+ readonly id: string;
70
+ readonly direction: "in" | "out";
71
+ readonly sentAt: string;
72
+ readonly campaignId?: string;
73
+ readonly leadId?: string;
74
+ readonly senderId?: string;
75
+ readonly stepIndex?: number;
76
+ readonly variantKey?: string;
77
+ readonly threadId?: string;
78
+ readonly subject?: string;
79
+ readonly body?: string;
80
+ /** Inbound only. */
81
+ readonly category?: ReplyCategory;
82
+ /** Inbound only. */
83
+ readonly isAuto?: boolean;
84
+ }
85
+ export interface MemoryStats {
86
+ /** `YYYY-MM-DD`. */
87
+ readonly date: string;
88
+ readonly campaignId: string;
89
+ /** Set for a per-sender row. */
90
+ readonly senderId?: string;
91
+ /** Set for a per-step row. */
92
+ readonly stepIndex?: number;
93
+ /** Set, with `stepIndex`, for one variant of a step, the way a vendor that splits step stats by variant reports it. */
94
+ readonly variantKey?: string;
95
+ readonly counts: Partial<MetricCounts>;
96
+ }
97
+ export interface MemoryData {
98
+ readonly campaigns?: readonly MemoryCampaign[];
99
+ readonly senders?: readonly MemorySender[];
100
+ readonly leads?: readonly MemoryLead[];
101
+ readonly messages?: readonly MemoryMessage[];
102
+ readonly stats?: readonly MemoryStats[];
103
+ readonly lists?: readonly MemoryList[];
104
+ readonly blocklist?: readonly MemoryBlockEntry[];
105
+ readonly tags?: readonly MemoryTag[];
106
+ readonly webhooks?: readonly MemoryWebhook[];
107
+ }
108
+ export declare const toCampaign: (identity: Identity, seed: MemoryCampaign) => Campaign;
109
+ export declare const toSequence: (identity: Identity, seed: MemoryCampaign) => Sequence;
110
+ export declare const toSubsequence: (identity: Identity, campaign: MemoryCampaign, seed: MemorySubsequence) => Sequence;
111
+ export declare const toSender: (identity: Identity, seed: MemorySender) => Sender;
112
+ export declare const toLead: (identity: Identity, seed: MemoryLead) => Lead;
113
+ export declare const toMessage: (identity: Identity, seed: MemoryMessage, channel: Channel, includeBody: boolean) => Message;
114
+ export declare const toReply: (identity: Identity, seed: MemoryMessage, channel: Channel, includeBody: boolean) => Reply;
115
+ export interface MetricIdentity extends Identity {
116
+ readonly scope: MetricRow["scope"];
117
+ readonly scopeId: string;
118
+ readonly date: string | null;
119
+ readonly stepIndex: number | null;
120
+ readonly variantKey: string | null;
121
+ }
122
+ export declare const toMetricRow: (identity: MetricIdentity, counts: MetricCounts) => MetricRow;
@@ -0,0 +1,7 @@
1
+ import type { MemoryData } from "./data.ts";
2
+ /**
3
+ * A small made-up dataset for demos and docs: two campaigns, two mailboxes,
4
+ * three leads, two days of stats, and one list, tag, webhook and block list
5
+ * entry. No real people or companies.
6
+ */
7
+ export declare const demoData: () => MemoryData;
@@ -0,0 +1,5 @@
1
+ export { memory } from "./adapter.ts";
2
+ export type { MemoryOptions } from "./adapter.ts";
3
+ export type { MemoryBlockEntry, MemoryHealth, MemoryList, MemorySettings, MemoryTag, MemoryWebhook, } from "./account.ts";
4
+ export type { MemoryCampaign, MemoryData, MemoryLead, MemoryMessage, MemorySender, MemoryStats, MemoryStep, MemorySubsequence, MemoryVariant, } from "./data.ts";
5
+ export { demoData } from "./demo.ts";