outbound-sdk 0.4.0 → 0.6.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 (104) hide show
  1. package/README.md +2 -2
  2. package/dist/alerts/check-evaluate.d.ts +53 -0
  3. package/dist/alerts/check-measure.d.ts +100 -0
  4. package/dist/alerts/check-schema.d.ts +184 -0
  5. package/dist/alerts/check-validate.d.ts +18 -0
  6. package/dist/alerts/index.d.ts +7 -0
  7. package/dist/alerts/index.js +635 -2
  8. package/dist/budget/index.d.ts +2 -0
  9. package/dist/budget/index.js +1 -0
  10. package/dist/cards/format.d.ts +1 -1
  11. package/dist/cards/index.js +49 -19
  12. package/dist/cards/parts.d.ts +1 -6
  13. package/dist/chunks/{chunk-7LNJJ2RO.js → chunk-3JOC5DGD.js} +127 -17
  14. package/dist/chunks/chunk-53DCVFUB.js +55 -0
  15. package/dist/chunks/{chunk-E6DSDCPI.js → chunk-BK5SLY32.js} +92 -101
  16. package/dist/chunks/chunk-HPNGSG5E.js +51 -0
  17. package/dist/chunks/chunk-HWHI4LFY.js +102 -0
  18. package/dist/chunks/chunk-MGR6HREO.js +91 -0
  19. package/dist/chunks/{chunk-Y5RAJ6PZ.js → chunk-OLPMBRXM.js} +3 -2
  20. package/dist/chunks/{chunk-IZFTTMJP.js → chunk-PHNQ3WC2.js} +5 -5
  21. package/dist/chunks/chunk-SXGCKCAR.js +678 -0
  22. package/dist/chunks/chunk-TFICTGM2.js +18 -0
  23. package/dist/chunks/{chunk-ZFVHM5JI.js → chunk-UWUPUMM2.js} +11 -4
  24. package/dist/chunks/{chunk-A6WVOCA4.js → chunk-W22SDX6S.js} +4 -4
  25. package/dist/chunks/{chunk-7ZDS6SZD.js → chunk-WH6V3YNN.js} +25 -0
  26. package/dist/chunks/chunk-XL6LJVHJ.js +71 -0
  27. package/dist/chunks/{chunk-5FVKRIEJ.js → chunk-YYCT3NGV.js} +35 -11
  28. package/dist/cli/bin.js +13 -28
  29. package/dist/cli/index.d.ts +3 -0
  30. package/dist/cli/index.js +12 -11
  31. package/dist/cli/output.d.ts +9 -0
  32. package/dist/cli/update.d.ts +15 -0
  33. package/dist/emailbison/account.d.ts +7 -0
  34. package/dist/emailbison/adapter.d.ts +5 -0
  35. package/dist/emailbison/capabilities.d.ts +78 -0
  36. package/dist/emailbison/client.d.ts +29 -0
  37. package/dist/emailbison/index.d.ts +30 -0
  38. package/dist/emailbison/index.js +1018 -0
  39. package/dist/emailbison/mail.d.ts +5 -0
  40. package/dist/emailbison/map-mail.d.ts +13 -0
  41. package/dist/emailbison/map-sequence.d.ts +12 -0
  42. package/dist/emailbison/map-stats.d.ts +47 -0
  43. package/dist/emailbison/map.d.ts +24 -0
  44. package/dist/emailbison/native-params.d.ts +5 -0
  45. package/dist/emailbison/native-workspace.d.ts +167 -0
  46. package/dist/emailbison/native.d.ts +327 -0
  47. package/dist/emailbison/stats.d.ts +4 -0
  48. package/dist/emailbison/webhooks.d.ts +2 -0
  49. package/dist/fixtures/index.js +6 -6
  50. package/dist/heyreach/capabilities.d.ts +3 -0
  51. package/dist/heyreach/index.js +22 -20
  52. package/dist/index.js +19 -18
  53. package/dist/insights/copy/copy-preview.d.ts +58 -0
  54. package/dist/insights/copy/copy-reuse.d.ts +0 -13
  55. package/dist/insights/copy/index.d.ts +9 -0
  56. package/dist/insights/copy/reuse-base.d.ts +0 -2
  57. package/dist/insights/copy/shared.d.ts +3 -8
  58. package/dist/insights/copy/step-funnel.d.ts +1 -12
  59. package/dist/insights/copy/variant-test.d.ts +0 -5
  60. package/dist/insights/cost.d.ts +91 -0
  61. package/dist/insights/define.d.ts +22 -1
  62. package/dist/insights/index.d.ts +4 -3
  63. package/dist/insights/index.js +810 -415
  64. package/dist/insights/inputs.generated.d.ts +21 -24
  65. package/dist/insights/ops/campaign-diagnosis.d.ts +0 -2
  66. package/dist/insights/ops/campaign-ranking.d.ts +3 -3
  67. package/dist/insights/ops/client-report.d.ts +0 -2
  68. package/dist/insights/ops/index.d.ts +2 -6
  69. package/dist/insights/ops/shared.d.ts +10 -2
  70. package/dist/insights/plugin.d.ts +19 -0
  71. package/dist/insights/registry.d.ts +10 -10
  72. package/dist/insights/run-cap.d.ts +35 -0
  73. package/dist/insights/senders/bounce-watch.d.ts +0 -11
  74. package/dist/insights/senders/domain-health.d.ts +0 -7
  75. package/dist/insights/senders/index.d.ts +0 -4
  76. package/dist/insights/senders/sender-load.d.ts +0 -2
  77. package/dist/insights/tools.d.ts +10 -0
  78. package/dist/insights/types.d.ts +1 -1
  79. package/dist/insights/variables.d.ts +33 -0
  80. package/dist/instantly/capabilities.d.ts +13 -0
  81. package/dist/instantly/index.js +43 -28
  82. package/dist/internal/adapter.d.ts +12 -0
  83. package/dist/internal/outbound/outbound.d.ts +5 -1
  84. package/dist/internal/request-cap.d.ts +35 -0
  85. package/dist/loader/index.js +2 -2
  86. package/dist/memory/index.js +10 -10
  87. package/dist/providers/index.d.ts +21 -1
  88. package/dist/providers/index.js +1 -1
  89. package/dist/redact/index.js +4 -4
  90. package/dist/smartlead/capabilities.d.ts +5 -0
  91. package/dist/smartlead/index.js +26 -24
  92. package/dist/tools/ai-sdk.js +5 -3
  93. package/dist/tools/claude-agent.js +5 -3
  94. package/dist/tools/index.d.ts +2 -2
  95. package/dist/tools/index.js +11 -6
  96. package/dist/tools/registry.d.ts +20 -1
  97. package/dist/tools/shared.d.ts +20 -1
  98. package/dist/webhooks/index.js +17 -7
  99. package/package.json +8 -2
  100. package/dist/chunks/chunk-5CFO3CXG.js +0 -176
  101. package/dist/chunks/chunk-K4USHN4C.js +0 -40
  102. package/dist/chunks/chunk-LVQUSKEX.js +0 -17
  103. package/dist/internal/renamed.d.ts +0 -28
  104. package/dist/chunks/{chunk-C4LS2HNV.js → chunk-JWGSB7PT.js} +3 -3
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  readEnv
3
3
  } from "./chunk-GFDNRWR3.js";
4
- import {
5
- PROVIDER_ENV,
6
- providers
7
- } from "./chunk-7ZDS6SZD.js";
8
4
  import {
9
5
  OutboundError
10
6
  } from "./chunk-J7DDZ4C2.js";
7
+ import {
8
+ PROVIDER_ENV,
9
+ providers
10
+ } from "./chunk-WH6V3YNN.js";
11
11
 
12
12
  // src/loader/index.ts
13
13
  var LOADERS = /* @__PURE__ */ new Map([
@@ -32,6 +32,13 @@ var LOADERS = /* @__PURE__ */ new Map([
32
32
  return heyreach();
33
33
  }
34
34
  ],
35
+ [
36
+ "emailbison",
37
+ async () => {
38
+ const { emailbison } = await import("../emailbison/index.js");
39
+ return emailbison();
40
+ }
41
+ ],
35
42
  [
36
43
  "memory",
37
44
  async () => {
@@ -1,10 +1,7 @@
1
1
  import {
2
2
  fromOne,
3
3
  variantKey
4
- } from "./chunk-K4USHN4C.js";
5
- import {
6
- stableId
7
- } from "./chunk-FHKSLCVW.js";
4
+ } from "./chunk-MGR6HREO.js";
8
5
  import {
9
6
  eventData,
10
7
  refTo
@@ -12,6 +9,9 @@ import {
12
9
  import {
13
10
  SCHEMA_VERSION
14
11
  } from "./chunk-QGRZDTX4.js";
12
+ import {
13
+ stableId
14
+ } from "./chunk-FHKSLCVW.js";
15
15
  import {
16
16
  emailAddress,
17
17
  flag,
@@ -60,6 +60,31 @@ var CATALOG = [
60
60
  name: "HeyReach",
61
61
  note: "Its reads were run, read-only, against one live workspace. Fixtures are built from the documentation."
62
62
  },
63
+ {
64
+ channels: ["email"],
65
+ docsUrl: "https://dedi.emailbison.com/api/reference",
66
+ envVars: [
67
+ {
68
+ description: "API key (an api-user key is scoped to one workspace).",
69
+ name: "EMAILBISON_API_KEY",
70
+ required: true
71
+ },
72
+ {
73
+ description: "The URL you log in to EmailBison with. Defaults to https://dedi.emailbison.com.",
74
+ name: "EMAILBISON_BASE_URL",
75
+ required: false
76
+ },
77
+ {
78
+ description: "A label for this client or workspace.",
79
+ name: "EMAILBISON_WORKSPACE_ID",
80
+ required: false
81
+ }
82
+ ],
83
+ id: "emailbison",
84
+ maturity: "unverified",
85
+ name: "EmailBison",
86
+ note: "Never run against a live account. Written from the public documentation and tested offline only."
87
+ },
63
88
  {
64
89
  channels: ["email", "linkedin"],
65
90
  docsUrl: null,
@@ -0,0 +1,71 @@
1
+ // src/internal/lead-fields.ts
2
+ var MAPPABLE = [
3
+ "company",
4
+ "companyLinkedinUrl",
5
+ "linkedinUrl",
6
+ "location",
7
+ "phone",
8
+ "title",
9
+ "website"
10
+ ];
11
+ var fillFromCustom = (lead, map) => {
12
+ const filled = {};
13
+ for (const field of MAPPABLE) {
14
+ const name = map[field];
15
+ const value = name === void 0 ? void 0 : lead.custom[name]?.trim();
16
+ if (lead[field] === null && value !== void 0 && value !== "") {
17
+ filled[field] = value;
18
+ }
19
+ }
20
+ return { ...lead, ...filled };
21
+ };
22
+ var withLeadFields = (readers, map) => {
23
+ if (map === void 0 || Object.keys(map).length === 0) {
24
+ return readers;
25
+ }
26
+ const { getLead, listLeads } = readers;
27
+ const wrapped = {
28
+ ...getLead && {
29
+ getLead: async (id, ctx) => fillFromCustom(await getLead(id, ctx), map)
30
+ },
31
+ ...listLeads && {
32
+ listLeads: async (query, ctx) => {
33
+ const page = await listLeads(query, ctx);
34
+ return {
35
+ items: page.items.map((lead) => fillFromCustom(lead, map)),
36
+ next: page.next
37
+ };
38
+ }
39
+ }
40
+ };
41
+ return { ...readers, ...wrapped };
42
+ };
43
+ var withMappedFields = (declared, map) => {
44
+ const lead = declared.lead === false ? void 0 : declared.lead;
45
+ if (map === void 0 || lead === void 0) {
46
+ return declared;
47
+ }
48
+ const derived = Object.fromEntries(
49
+ MAPPABLE.flatMap(
50
+ (field) => map[field] !== void 0 && lead[field] === false ? [[field, "derived"]] : []
51
+ )
52
+ );
53
+ return { ...declared, lead: { ...lead, ...derived } };
54
+ };
55
+
56
+ // src/internal/page.ts
57
+ var mapPage = (page, toItem) => ({
58
+ items: page.items.map((raw) => toItem(raw)),
59
+ next: page.next
60
+ });
61
+ var flatMapPage = (page, toItems) => ({
62
+ items: page.items.flatMap((raw) => toItems(raw)),
63
+ next: page.next
64
+ });
65
+
66
+ export {
67
+ withLeadFields,
68
+ withMappedFields,
69
+ mapPage,
70
+ flatMapPage
71
+ };
@@ -2,14 +2,8 @@ import {
2
2
  defaultRateLimitStore
3
3
  } from "./chunk-4O2HRTTI.js";
4
4
  import {
5
- plural
6
- } from "./chunk-PTZO4QXR.js";
7
- import {
8
- buildUrl
9
- } from "./chunk-NAWZ73QS.js";
10
- import {
11
- sha256Hex
12
- } from "./chunk-FHKSLCVW.js";
5
+ CAPPED
6
+ } from "./chunk-HPNGSG5E.js";
13
7
  import {
14
8
  CAPABILITY_KEYS,
15
9
  blockEntrySchema,
@@ -25,6 +19,9 @@ import {
25
19
  tagSchema,
26
20
  webhookSubscriptionSchema
27
21
  } from "./chunk-ZOAG2C6V.js";
22
+ import {
23
+ plural
24
+ } from "./chunk-PTZO4QXR.js";
28
25
  import {
29
26
  campaignSchema,
30
27
  leadSchema,
@@ -38,6 +35,12 @@ import {
38
35
  import {
39
36
  sourceIdFor
40
37
  } from "./chunk-QAKJ76HB.js";
38
+ import {
39
+ buildUrl
40
+ } from "./chunk-NAWZ73QS.js";
41
+ import {
42
+ sha256Hex
43
+ } from "./chunk-FHKSLCVW.js";
41
44
  import {
42
45
  OutboundError,
43
46
  redactUrl
@@ -2252,6 +2255,8 @@ var Outbound = class _Outbound {
2252
2255
  #core;
2253
2256
  #options;
2254
2257
  #plugins;
2258
+ // Innermost layers a shared request cap adds; never listed in `plugins`.
2259
+ #layers;
2255
2260
  campaigns;
2256
2261
  senders;
2257
2262
  leads;
@@ -2265,14 +2270,14 @@ var Outbound = class _Outbound {
2265
2270
  webhooks;
2266
2271
  raw;
2267
2272
  native;
2268
- constructor(options, engine = engineFor(options)) {
2273
+ constructor(options, engine = engineFor(options), layers = []) {
2269
2274
  const { adapter } = options;
2270
2275
  const plugins = options.plugins ?? [];
2271
2276
  assertUniquePluginNames(plugins);
2272
2277
  const declared = resolveCapabilities(adapter.capabilities);
2273
2278
  const narrowed = narrowCapabilities(declared, plugins);
2274
2279
  const run = composeOperations(
2275
- plugins,
2280
+ [...plugins, ...layers],
2276
2281
  (operation, info) => dispatch(
2277
2282
  {
2278
2283
  adapter,
@@ -2284,6 +2289,7 @@ var Outbound = class _Outbound {
2284
2289
  );
2285
2290
  this.#options = options;
2286
2291
  this.#plugins = plugins;
2292
+ this.#layers = layers;
2287
2293
  this.#core = {
2288
2294
  adapter,
2289
2295
  allowWrites: options.allowWrites ?? false,
@@ -2392,10 +2398,28 @@ var Outbound = class _Outbound {
2392
2398
  }
2393
2399
  );
2394
2400
  }
2395
- const scoped2 = new _Outbound({ ...this.#options, adapter: member }, engine);
2401
+ const scoped2 = new _Outbound(
2402
+ { ...this.#options, adapter: member },
2403
+ engine,
2404
+ this.#layers
2405
+ );
2396
2406
  installExtensions(scoped2, this.#plugins);
2397
2407
  return scoped2;
2398
2408
  }
2409
+ /** For a cap shared across calls, as insights and tools use. Not public. */
2410
+ get [CAPPED]() {
2411
+ return {
2412
+ costs: this.#core.adapter.costs,
2413
+ guarded: (layer) => {
2414
+ const copy = new _Outbound(this.#options, this.#core.engine, [
2415
+ ...this.#layers,
2416
+ layer
2417
+ ]);
2418
+ installExtensions(copy, this.#plugins);
2419
+ return copy;
2420
+ }
2421
+ };
2422
+ }
2399
2423
  stats(options) {
2400
2424
  return readStats(this.#core, options);
2401
2425
  }
package/dist/cli/bin.js CHANGED
@@ -1,39 +1,24 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- run
4
- } from "../chunks/chunk-7LNJJ2RO.js";
5
- import "../chunks/chunk-Y5RAJ6PZ.js";
6
- import "../chunks/chunk-E6DSDCPI.js";
7
- import "../chunks/chunk-LVQUSKEX.js";
2
+ import "../chunks/chunk-TFICTGM2.js";
3
+ import "../chunks/chunk-3JOC5DGD.js";
4
+ import "../chunks/chunk-OLPMBRXM.js";
5
+ import "../chunks/chunk-BK5SLY32.js";
6
+ import "../chunks/chunk-HWHI4LFY.js";
8
7
  import "../chunks/chunk-4PA526S7.js";
9
8
  import "../chunks/chunk-HZCTYL22.js";
10
- import "../chunks/chunk-5FVKRIEJ.js";
9
+ import "../chunks/chunk-YYCT3NGV.js";
11
10
  import "../chunks/chunk-4O2HRTTI.js";
11
+ import "../chunks/chunk-HPNGSG5E.js";
12
+ import "../chunks/chunk-ZOAG2C6V.js";
12
13
  import "../chunks/chunk-PTZO4QXR.js";
14
+ import "../chunks/chunk-BOWXGMN3.js";
13
15
  import "../chunks/chunk-PQSTQKRD.js";
16
+ import "../chunks/chunk-QGRZDTX4.js";
17
+ import "../chunks/chunk-QAKJ76HB.js";
14
18
  import "../chunks/chunk-NAWZ73QS.js";
15
19
  import "../chunks/chunk-FHKSLCVW.js";
16
- import "../chunks/chunk-ZFVHM5JI.js";
20
+ import "../chunks/chunk-UWUPUMM2.js";
17
21
  import "../chunks/chunk-GFDNRWR3.js";
18
- import "../chunks/chunk-7ZDS6SZD.js";
19
- import "../chunks/chunk-ZOAG2C6V.js";
20
- import "../chunks/chunk-BOWXGMN3.js";
21
- import "../chunks/chunk-QGRZDTX4.js";
22
- import "../chunks/chunk-QAKJ76HB.js";
23
22
  import "../chunks/chunk-J7DDZ4C2.js";
24
23
  import "../chunks/chunk-BLCJHP5H.js";
25
-
26
- // src/cli/bin.ts
27
- import process from "node:process";
28
- import { createInterface } from "node:readline";
29
- process.exitCode = await run(process.argv.slice(2), {
30
- stderr: (text) => {
31
- process.stderr.write(`${text}
32
- `);
33
- },
34
- stdin: () => createInterface({ input: process.stdin }),
35
- stdout: (text) => {
36
- process.stdout.write(`${text}
37
- `);
38
- }
39
- });
24
+ import "../chunks/chunk-WH6V3YNN.js";
@@ -4,6 +4,7 @@ export type { CliConfig } from "./config.ts";
4
4
  export { createMcpServer, PROTOCOL_VERSIONS } from "./mcp.ts";
5
5
  export type { McpServer, McpServerOptions } from "./mcp.ts";
6
6
  export { serveStdio } from "./stdio.ts";
7
+ export type { NpmRunner } from "./update.ts";
7
8
  export type { StdioOptions } from "./stdio.ts";
8
9
  export interface CliIo {
9
10
  readonly stdout: (text: string) => void;
@@ -12,6 +13,8 @@ export interface CliIo {
12
13
  readonly stdin?: (() => AsyncIterable<string> | Iterable<string>) | undefined;
13
14
  /** Replaces the adapter the environment would choose. Meant for tests. */
14
15
  readonly adapter?: Adapter | undefined;
16
+ /** Runs npm for `outbound update` and resolves to its output. Meant for tests. */
17
+ readonly npm?: ((args: readonly string[]) => Promise<string>) | undefined;
15
18
  }
16
19
  /** Runs the CLI. Returns the process exit code. */
17
20
  export declare const run: (argv: readonly string[], io: CliIo) => Promise<number>;
package/dist/cli/index.js CHANGED
@@ -4,27 +4,28 @@ import {
4
4
  defineConfig,
5
5
  run,
6
6
  serveStdio
7
- } from "../chunks/chunk-7LNJJ2RO.js";
8
- import "../chunks/chunk-Y5RAJ6PZ.js";
9
- import "../chunks/chunk-E6DSDCPI.js";
10
- import "../chunks/chunk-LVQUSKEX.js";
7
+ } from "../chunks/chunk-3JOC5DGD.js";
8
+ import "../chunks/chunk-OLPMBRXM.js";
9
+ import "../chunks/chunk-BK5SLY32.js";
10
+ import "../chunks/chunk-HWHI4LFY.js";
11
11
  import "../chunks/chunk-4PA526S7.js";
12
12
  import "../chunks/chunk-HZCTYL22.js";
13
- import "../chunks/chunk-5FVKRIEJ.js";
13
+ import "../chunks/chunk-YYCT3NGV.js";
14
14
  import "../chunks/chunk-4O2HRTTI.js";
15
+ import "../chunks/chunk-HPNGSG5E.js";
16
+ import "../chunks/chunk-ZOAG2C6V.js";
15
17
  import "../chunks/chunk-PTZO4QXR.js";
18
+ import "../chunks/chunk-BOWXGMN3.js";
16
19
  import "../chunks/chunk-PQSTQKRD.js";
20
+ import "../chunks/chunk-QGRZDTX4.js";
21
+ import "../chunks/chunk-QAKJ76HB.js";
17
22
  import "../chunks/chunk-NAWZ73QS.js";
18
23
  import "../chunks/chunk-FHKSLCVW.js";
19
- import "../chunks/chunk-ZFVHM5JI.js";
24
+ import "../chunks/chunk-UWUPUMM2.js";
20
25
  import "../chunks/chunk-GFDNRWR3.js";
21
- import "../chunks/chunk-7ZDS6SZD.js";
22
- import "../chunks/chunk-ZOAG2C6V.js";
23
- import "../chunks/chunk-BOWXGMN3.js";
24
- import "../chunks/chunk-QGRZDTX4.js";
25
- import "../chunks/chunk-QAKJ76HB.js";
26
26
  import "../chunks/chunk-J7DDZ4C2.js";
27
27
  import "../chunks/chunk-BLCJHP5H.js";
28
+ import "../chunks/chunk-WH6V3YNN.js";
28
29
  export {
29
30
  PROTOCOL_VERSIONS,
30
31
  createMcpServer,
@@ -0,0 +1,9 @@
1
+ import type { Json } from "../internal/json.ts";
2
+ /** The CLI's own `--compact` and `--raw`. */
3
+ export interface PrintOptions {
4
+ readonly compact?: boolean | undefined;
5
+ readonly raw?: boolean | undefined;
6
+ }
7
+ /** The answer with `raw` taken off every record in it, at any depth. */
8
+ export declare const withoutRaw: (value: Json) => Json;
9
+ export declare const printAnswer: (write: (text: string) => void, value: Json, options: PrintOptions) => void;
@@ -0,0 +1,15 @@
1
+ /** Runs npm with these arguments and resolves to what it printed. */
2
+ export type NpmRunner = (args: readonly string[]) => Promise<string>;
3
+ export declare const STANDALONE: ReadonlyMap<string, readonly string[]>;
4
+ export declare const runNpm: NpmRunner;
5
+ /** Checks npm for a newer version and updates a global install. */
6
+ export declare const update: (npm: NpmRunner, say: (text: string) => void) => Promise<void>;
7
+ /**
8
+ * Runs `version` (also a bare `--version`) or `update`, and says whether it
9
+ * did. Version comes before help, which is what no command at all prints;
10
+ * `update --help` prints help.
11
+ */
12
+ export declare const runSelf: (name: string | undefined, flags: {
13
+ readonly help?: boolean;
14
+ readonly version?: boolean;
15
+ }, npm: NpmRunner, say: (text: string) => void) => Promise<boolean>;
@@ -0,0 +1,7 @@
1
+ import type { Adapter } from "../internal/adapter.ts";
2
+ import type { EmailBisonClient } from "./client.ts";
3
+ type Readers = Pick<Adapter, "getCampaignSettings" | "getList" | "getSenderHealth" | "getWebhook" | "listBlocklist" | "listLists" | "listTags" | "listWebhooks" | "listWorkspaces">;
4
+ /** The warmup window sender health reads: the last 7 days, in UTC days. */
5
+ export declare const WARMUP_DAYS = 7;
6
+ export declare const accountReaders: (client: EmailBisonClient, now?: () => number) => Readers;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { Adapter } from "../internal/adapter.ts";
2
+ import type { EmailBisonClient } from "./client.ts";
3
+ type Readers = Pick<Adapter, "getCampaign" | "getCampaignSettings" | "getLead" | "getList" | "getSender" | "getSenderHealth" | "getSequence" | "getWebhook" | "listBlocklist" | "listCampaigns" | "listLeads" | "listLists" | "listMessages" | "listReplies" | "listSenders" | "listTags" | "listWebhooks" | "listWorkspaces" | "stats">;
4
+ export declare const readers: (client: EmailBisonClient) => Readers;
5
+ export {};
@@ -0,0 +1,78 @@
1
+ import type { CapabilityDeclaration } from "../internal/capabilities.ts";
2
+ import type { FieldDeclaration } from "../internal/fields.ts";
3
+ import type { LimitDeclaration } from "../internal/limits.ts";
4
+ /**
5
+ * The reference's only server. A customer's own instance is the URL they log
6
+ * in with, so most callers pass `baseUrl` or set `EMAILBISON_BASE_URL`.
7
+ */
8
+ export declare const BASE_URL = "https://dedi.emailbison.com";
9
+ export declare const API_KEY_ENV = "EMAILBISON_API_KEY";
10
+ export declare const BASE_URL_ENV = "EMAILBISON_BASE_URL";
11
+ export declare const WORKSPACE_ENV = "EMAILBISON_WORKSPACE_ID";
12
+ /** Every list answers 15 records per page, and no page size can be asked for. */
13
+ export declare const PAGE_SIZE = 15;
14
+ export declare const capabilities: CapabilityDeclaration;
15
+ export declare const fields: FieldDeclaration;
16
+ export declare const limits: LimitDeclaration;
17
+ export declare const costs: {
18
+ "blocklist.list": {
19
+ pageSize: number;
20
+ perPage: number;
21
+ };
22
+ "campaigns.get": {
23
+ perPage: number;
24
+ };
25
+ "campaigns.list": {
26
+ pageSize: number;
27
+ perPage: number;
28
+ };
29
+ "campaigns.settings": {
30
+ perPage: number;
31
+ };
32
+ "leads.get": {
33
+ perPage: number;
34
+ };
35
+ "leads.list": {
36
+ pageSize: number;
37
+ perPage: number;
38
+ };
39
+ "lists.list": {
40
+ pageSize: number;
41
+ perPage: number;
42
+ };
43
+ "messages.list": {
44
+ pageSize: number;
45
+ perPage: number;
46
+ };
47
+ "replies.list": {
48
+ pageSize: number;
49
+ perPage: number;
50
+ };
51
+ "senders.get": {
52
+ perPage: number;
53
+ };
54
+ "senders.health": {
55
+ perPage: number;
56
+ };
57
+ "senders.list": {
58
+ pageSize: number;
59
+ perPage: number;
60
+ };
61
+ "sequence.get": {
62
+ perPage: number;
63
+ };
64
+ stats: {
65
+ perPage: number;
66
+ };
67
+ "tags.list": {
68
+ perPage: number;
69
+ };
70
+ "webhooks.list": {
71
+ pageSize: number;
72
+ perPage: number;
73
+ };
74
+ "workspaces.list": {
75
+ perPage: number;
76
+ };
77
+ };
78
+ export declare const caveats: readonly string[];
@@ -0,0 +1,29 @@
1
+ import type { AdapterContext, HttpMethod, RawDescriptor } from "../internal/adapter.ts";
2
+ import type { RequestOptions, VendorClient } from "../internal/client.ts";
3
+ import type { Json, JsonObject } from "../internal/json.ts";
4
+ import type { RawPage } from "../internal/page.ts";
5
+ import type { Identity } from "../internal/record.ts";
6
+ export interface ClientOptions {
7
+ readonly apiKey: string;
8
+ readonly baseUrl: string | undefined;
9
+ readonly identity: Identity;
10
+ }
11
+ export interface EmailBisonClient extends VendorClient {
12
+ readonly identity: Identity;
13
+ readonly raw: RawDescriptor;
14
+ /** `data` of an answer that must be one object, or a `Provider` error. */
15
+ readonly one: (body: Json, path: string) => JsonObject;
16
+ /** `data` of an answer that must be a list, or a `Provider` error. */
17
+ readonly rows: (body: Json, path: string) => JsonObject[];
18
+ /** One page of a list, and where the next one starts. */
19
+ readonly page: (ctx: AdapterContext, path: string, next: Json | undefined, options?: PageOptions) => Promise<RawPage>;
20
+ }
21
+ export interface PageOptions extends RequestOptions {
22
+ /** The reference documents cursor pagination for this list. */
23
+ readonly cursor?: boolean | undefined;
24
+ }
25
+ export declare const isSecret: (path: string) => boolean;
26
+ export declare const isRead: (method: HttpMethod, path: string) => boolean;
27
+ /** The keys of a vendor payload that hold a secret, at any depth. */
28
+ export declare const SECRET_KEYS: RegExp;
29
+ export declare const createClient: (options: ClientOptions) => EmailBisonClient;
@@ -0,0 +1,30 @@
1
+ import type { Adapter } from "../internal/adapter.ts";
2
+ import type { CapabilityDeclaration } from "../internal/capabilities.ts";
3
+ import type { LeadFieldMap } from "../internal/lead-fields.ts";
4
+ import type { EmailBisonNative } from "./native.ts";
5
+ export declare const PROVIDER = "emailbison";
6
+ /** The environment variables this adapter reads. */
7
+ export declare const envVars: readonly ["EMAILBISON_API_KEY", "EMAILBISON_BASE_URL", "EMAILBISON_WORKSPACE_ID"];
8
+ export interface EmailBisonOptions {
9
+ /** Defaults to `EMAILBISON_API_KEY`. An `api-user` key is scoped to one workspace. */
10
+ readonly apiKey?: string | undefined;
11
+ /** A label for this client or workspace. Defaults to `EMAILBISON_WORKSPACE_ID`, then `default`. */
12
+ readonly workspaceId?: string | undefined;
13
+ /**
14
+ * The URL you log in to EmailBison with, such as
15
+ * `https://send.example.com`. Defaults to `EMAILBISON_BASE_URL`, then
16
+ * `https://dedi.emailbison.com`.
17
+ */
18
+ readonly baseUrl?: string | undefined;
19
+ /** Overrides what the adapter declares, for example on a key some endpoints refuse. */
20
+ readonly capabilities?: CapabilityDeclaration | undefined;
21
+ /**
22
+ * Which of a lead's custom variables holds a value EmailBison has no field
23
+ * for, for example `{ linkedinUrl: "linkedin_url" }`. Read only where the
24
+ * vendor's own field is empty.
25
+ */
26
+ readonly leadFields?: LeadFieldMap | undefined;
27
+ }
28
+ export { NATIVE } from "./native.ts";
29
+ export type { EmailBisonNative } from "./native.ts";
30
+ export declare const emailbison: (options?: EmailBisonOptions) => Adapter<EmailBisonNative>;