outbound-sdk 0.2.1 → 0.5.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 (175) 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 +684 -20
  8. package/dist/alerts/plugin.d.ts +20 -3
  9. package/dist/audit/index.js +2 -2
  10. package/dist/benchmarks/index.js +5 -5
  11. package/dist/budget/index.d.ts +5 -2
  12. package/dist/budget/index.js +12 -10
  13. package/dist/cards/content.d.ts +6 -1
  14. package/dist/cards/format.d.ts +17 -2
  15. package/dist/cards/index.d.ts +1 -1
  16. package/dist/cards/index.js +298 -132
  17. package/dist/cards/parts.d.ts +9 -2
  18. package/dist/cards/render.d.ts +20 -3
  19. package/dist/chunks/{chunk-U2D34ARZ.js → chunk-2D42TQFU.js} +3 -3
  20. package/dist/chunks/{chunk-6CVZOUHB.js → chunk-3S32R2MH.js} +53 -63
  21. package/dist/chunks/chunk-4PA526S7.js +17 -0
  22. package/dist/chunks/{chunk-RCZ7ZZFU.js → chunk-5J7GGV62.js} +12 -5
  23. package/dist/chunks/chunk-6TKFISG4.js +676 -0
  24. package/dist/chunks/{chunk-AFU5E5QB.js → chunk-BK5SLY32.js} +104 -84
  25. package/dist/chunks/{chunk-VQSCHOBV.js → chunk-BLCJHP5H.js} +11 -4
  26. package/dist/chunks/{chunk-SBIZDCRY.js → chunk-BN6WCAWX.js} +7 -7
  27. package/dist/chunks/{chunk-4PSO6JEK.js → chunk-BOWXGMN3.js} +6 -21
  28. package/dist/chunks/{chunk-PURHK3JU.js → chunk-EHSJGQ5K.js} +8 -8
  29. package/dist/chunks/{chunk-IPUYZD4O.js → chunk-GFDNRWR3.js} +1 -1
  30. package/dist/chunks/chunk-HPNGSG5E.js +51 -0
  31. package/dist/chunks/chunk-HWHI4LFY.js +102 -0
  32. package/dist/chunks/{chunk-E7JHLNLG.js → chunk-J7DDZ4C2.js} +15 -2
  33. package/dist/chunks/{chunk-DJ2IUQEU.js → chunk-JWGSB7PT.js} +6 -6
  34. package/dist/chunks/{chunk-R3Y56YVF.js → chunk-OLPMBRXM.js} +4 -3
  35. package/dist/chunks/{chunk-YOTW5ESM.js → chunk-PQSTQKRD.js} +2 -2
  36. package/dist/chunks/chunk-PTZO4QXR.js +15 -0
  37. package/dist/chunks/{chunk-LVYG7XZJ.js → chunk-QAKJ76HB.js} +1 -1
  38. package/dist/chunks/chunk-QGRZDTX4.js +26 -0
  39. package/dist/chunks/chunk-WGW3ROLY.js +18 -0
  40. package/dist/chunks/{chunk-XC6CZP73.js → chunk-WH6V3YNN.js} +32 -1
  41. package/dist/chunks/{chunk-P3IJBJUI.js → chunk-X4RDBD4J.js} +296 -62
  42. package/dist/chunks/chunk-XL6LJVHJ.js +71 -0
  43. package/dist/chunks/{chunk-XNFESPZH.js → chunk-YYCT3NGV.js} +200 -39
  44. package/dist/chunks/{chunk-UAT3JSJZ.js → chunk-ZOAG2C6V.js} +2 -2
  45. package/dist/cli/bin.js +19 -30
  46. package/dist/cli/commands.d.ts +11 -0
  47. package/dist/cli/index.d.ts +3 -0
  48. package/dist/cli/index.js +18 -13
  49. package/dist/cli/mcp.d.ts +5 -0
  50. package/dist/cli/update.d.ts +15 -0
  51. package/dist/clients/index.d.ts +1 -1
  52. package/dist/clients/index.js +35 -10
  53. package/dist/clients/plugin.d.ts +9 -2
  54. package/dist/combine/index.js +7 -6
  55. package/dist/emailbison/account.d.ts +7 -0
  56. package/dist/emailbison/adapter.d.ts +5 -0
  57. package/dist/emailbison/capabilities.d.ts +78 -0
  58. package/dist/emailbison/client.d.ts +29 -0
  59. package/dist/emailbison/index.d.ts +30 -0
  60. package/dist/emailbison/index.js +1017 -0
  61. package/dist/emailbison/mail.d.ts +5 -0
  62. package/dist/emailbison/map-mail.d.ts +13 -0
  63. package/dist/emailbison/map-sequence.d.ts +12 -0
  64. package/dist/emailbison/map-stats.d.ts +47 -0
  65. package/dist/emailbison/map.d.ts +24 -0
  66. package/dist/emailbison/native-params.d.ts +5 -0
  67. package/dist/emailbison/native-workspace.d.ts +167 -0
  68. package/dist/emailbison/native.d.ts +327 -0
  69. package/dist/emailbison/stats.d.ts +4 -0
  70. package/dist/emailbison/webhooks.d.ts +2 -0
  71. package/dist/exporter/index.d.ts +5 -2
  72. package/dist/exporter/index.js +2 -2
  73. package/dist/failover/index.js +3 -3
  74. package/dist/fixtures/index.js +10 -9
  75. package/dist/heyreach/capabilities.d.ts +3 -0
  76. package/dist/heyreach/client.d.ts +2 -0
  77. package/dist/heyreach/index.js +83 -51
  78. package/dist/heyreach/map.d.ts +5 -2
  79. package/dist/identity/index.js +33 -17
  80. package/dist/identity/plugin.d.ts +2 -0
  81. package/dist/index.d.ts +2 -2
  82. package/dist/index.js +29 -25
  83. package/dist/insights/campaign.d.ts +3 -0
  84. package/dist/insights/capped.d.ts +29 -0
  85. package/dist/insights/copy/copy-audit.d.ts +2 -0
  86. package/dist/insights/copy/copy-reuse.d.ts +27 -3
  87. package/dist/insights/copy/index.d.ts +8 -8
  88. package/dist/insights/copy/reply-timing.d.ts +8 -0
  89. package/dist/insights/copy/reuse-base.d.ts +32 -0
  90. package/dist/insights/copy/shared.d.ts +39 -15
  91. package/dist/insights/copy/step-funnel.d.ts +16 -5
  92. package/dist/insights/copy/variant-test.d.ts +19 -8
  93. package/dist/insights/cost.d.ts +91 -0
  94. package/dist/insights/define.d.ts +78 -3
  95. package/dist/insights/fields.d.ts +16 -0
  96. package/dist/insights/index.d.ts +6 -4
  97. package/dist/insights/index.js +1816 -748
  98. package/dist/insights/inputs.generated.d.ts +951 -0
  99. package/dist/insights/ops/campaign-diagnosis.d.ts +3 -1
  100. package/dist/insights/ops/campaign-ranking.d.ts +15 -7
  101. package/dist/insights/ops/channel-mix.d.ts +2 -1
  102. package/dist/insights/ops/client-report.d.ts +18 -5
  103. package/dist/insights/ops/index.d.ts +8 -4
  104. package/dist/insights/ops/period-comparison.d.ts +14 -3
  105. package/dist/insights/ops/pipeline-forecast.d.ts +14 -4
  106. package/dist/insights/ops/shared.d.ts +39 -24
  107. package/dist/insights/ops/tag-rollup.d.ts +2 -1
  108. package/dist/insights/people/account-summary.d.ts +13 -0
  109. package/dist/insights/people/dropped-replies.d.ts +8 -0
  110. package/dist/insights/people/find.d.ts +7 -1
  111. package/dist/insights/people/hot-leads.d.ts +16 -1
  112. package/dist/insights/people/person-summary.d.ts +6 -0
  113. package/dist/insights/people/read.d.ts +26 -10
  114. package/dist/insights/people/suppression-check.d.ts +11 -2
  115. package/dist/insights/plugin.d.ts +26 -5
  116. package/dist/insights/ref.d.ts +6 -0
  117. package/dist/insights/registry.d.ts +30 -18
  118. package/dist/insights/run-cap.d.ts +35 -0
  119. package/dist/insights/senders/bounce-watch.d.ts +25 -8
  120. package/dist/insights/senders/capacity-sends.d.ts +22 -0
  121. package/dist/insights/senders/domain-health.d.ts +10 -4
  122. package/dist/insights/senders/index.d.ts +14 -6
  123. package/dist/insights/senders/read.d.ts +15 -14
  124. package/dist/insights/senders/sender-capacity.d.ts +5 -13
  125. package/dist/insights/senders/sender-load.d.ts +2 -0
  126. package/dist/insights/stats.d.ts +8 -0
  127. package/dist/insights/tools.d.ts +13 -2
  128. package/dist/instantly/capabilities.d.ts +13 -0
  129. package/dist/instantly/client.d.ts +2 -0
  130. package/dist/instantly/index.js +77 -49
  131. package/dist/instantly/map.d.ts +6 -2
  132. package/dist/internal/adapter.d.ts +12 -0
  133. package/dist/internal/engine/request.d.ts +5 -0
  134. package/dist/internal/entities.d.ts +3 -20
  135. package/dist/internal/errors.d.ts +44 -0
  136. package/dist/internal/fields.d.ts +1 -1
  137. package/dist/internal/json.d.ts +9 -2
  138. package/dist/internal/lists.d.ts +24 -0
  139. package/dist/internal/numbers.d.ts +8 -0
  140. package/dist/internal/outbound/collections.d.ts +4 -0
  141. package/dist/internal/outbound/create.d.ts +24 -3
  142. package/dist/internal/outbound/outbound.d.ts +18 -2
  143. package/dist/internal/outbound/validate.d.ts +4 -0
  144. package/dist/internal/outbound/walker.d.ts +3 -2
  145. package/dist/internal/plural.d.ts +12 -0
  146. package/dist/internal/renamed.d.ts +28 -0
  147. package/dist/internal/request-cap.d.ts +35 -0
  148. package/dist/internal/vocabulary.d.ts +20 -0
  149. package/dist/loader/index.js +5 -5
  150. package/dist/memory/adapter.d.ts +7 -0
  151. package/dist/memory/demo-stats.d.ts +3 -0
  152. package/dist/memory/demo.d.ts +14 -3
  153. package/dist/memory/index.d.ts +1 -0
  154. package/dist/memory/index.js +209 -104
  155. package/dist/providers/index.d.ts +92 -0
  156. package/dist/providers/index.js +3 -1
  157. package/dist/reconcile/index.js +5 -4
  158. package/dist/redact/index.js +13 -7
  159. package/dist/redact/plugin.d.ts +7 -0
  160. package/dist/smartlead/capabilities.d.ts +5 -0
  161. package/dist/smartlead/index.js +119 -66
  162. package/dist/smartlead/shared.d.ts +13 -0
  163. package/dist/sync/index.js +2 -2
  164. package/dist/tools/ai-sdk.js +10 -6
  165. package/dist/tools/campaign-tools.d.ts +1 -1
  166. package/dist/tools/claude-agent.js +10 -6
  167. package/dist/tools/index.d.ts +2 -2
  168. package/dist/tools/index.js +16 -9
  169. package/dist/tools/input-problem.d.ts +8 -0
  170. package/dist/tools/registry.d.ts +26 -2
  171. package/dist/tools/shared.d.ts +27 -1
  172. package/dist/tracing/index.js +2 -2
  173. package/dist/webhooks/index.js +22 -12
  174. package/package.json +8 -2
  175. package/dist/chunks/chunk-FKH5N47I.js +0 -40
@@ -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>;
@@ -1,2 +1,2 @@
1
1
  export { UNASSIGNED, clients } from "./plugin.ts";
2
- export type { ClientRule, ClientStats, ClientStatsOptions, ClientsExtension, ClientsOptions, } from "./plugin.ts";
2
+ export type { ClientRule, ClientStats, ClientStatsOptions, ClientStatsRead, ClientsExtension, ClientsOptions, } from "./plugin.ts";
@@ -4,11 +4,13 @@ import {
4
4
  import {
5
5
  emptyCounts,
6
6
  sumCounts
7
- } from "../chunks/chunk-YOTW5ESM.js";
8
- import "../chunks/chunk-4PSO6JEK.js";
9
- import "../chunks/chunk-LVYG7XZJ.js";
10
- import "../chunks/chunk-E7JHLNLG.js";
11
- import "../chunks/chunk-VQSCHOBV.js";
7
+ } from "../chunks/chunk-PQSTQKRD.js";
8
+ import "../chunks/chunk-QGRZDTX4.js";
9
+ import {
10
+ parseRef
11
+ } from "../chunks/chunk-QAKJ76HB.js";
12
+ import "../chunks/chunk-J7DDZ4C2.js";
13
+ import "../chunks/chunk-BLCJHP5H.js";
12
14
 
13
15
  // src/clients/plugin.ts
14
16
  var UNASSIGNED = "unassigned";
@@ -23,13 +25,21 @@ var campaignRefOf = (record) => {
23
25
  return "scope" in record && record.scope !== "workspace" && record.scope !== "sender" ? record.scopeRef : null;
24
26
  };
25
27
  var needsCampaign = (rule) => rule.campaignTag !== void 0 || rule.campaignName !== void 0;
26
- var matches = (rule, record, campaign) => (rule.provider === void 0 || rule.provider === record.provider) && (rule.workspaceId === void 0 || rule.workspaceId === record.workspaceId) && (rule.campaignIds === void 0 || campaign !== null && rule.campaignIds.includes(campaign.ref)) && (rule.campaignTag === void 0 || campaign !== null && campaign.tags.includes(rule.campaignTag)) && (rule.campaignName === void 0 || campaign !== null && rule.campaignName.test(campaign.name));
28
+ var namesCampaign = (ids, campaign) => ids.includes(campaign.ref) || ids.includes(parseRef(campaign.ref)?.sourceId ?? campaign.ref);
29
+ var withoutState = (rule) => rule.campaignName === void 0 ? rule : {
30
+ ...rule,
31
+ campaignName: new RegExp(
32
+ rule.campaignName.source,
33
+ rule.campaignName.flags.replaceAll(/[gy]/gu, "")
34
+ )
35
+ };
36
+ var matches = (rule, record, campaign) => (rule.provider === void 0 || rule.provider === record.provider) && (rule.workspaceId === void 0 || rule.workspaceId === record.workspaceId) && (rule.campaignIds === void 0 || campaign !== null && namesCampaign(rule.campaignIds, campaign)) && (rule.campaignTag === void 0 || campaign !== null && campaign.tags.includes(rule.campaignTag)) && (rule.campaignName === void 0 || campaign !== null && rule.campaignName.test(campaign.name));
27
37
  var Assigner = class {
28
38
  #rules;
29
39
  /** Campaigns seen so far, so a lead can be matched by its campaign's tag. */
30
40
  #campaigns = /* @__PURE__ */ new Map();
31
41
  constructor(rules) {
32
- this.#rules = rules;
42
+ this.#rules = rules.map(withoutState);
33
43
  }
34
44
  names() {
35
45
  return [...new Set(this.#rules.map((rule) => rule.client))];
@@ -67,21 +77,32 @@ var Assigner = class {
67
77
  }
68
78
  };
69
79
  var clientStats = async (outbound, options) => {
70
- const campaigns = await outbound.campaigns.listAll(options).toArray();
80
+ const { deadline, maxRequests, retries, signal, timeout } = options;
81
+ const walk = outbound.campaigns.listAll({
82
+ deadline,
83
+ maxRequests,
84
+ retries,
85
+ signal,
86
+ timeout
87
+ });
88
+ const campaigns = await walk.toArray();
71
89
  const byClient = /* @__PURE__ */ new Map();
90
+ let requests = walk.meta?.requests ?? 0;
72
91
  const read = await mapConcurrent(campaigns, async (campaign) => ({
73
92
  campaign,
74
93
  stats: await outbound.campaign(campaign.ref).stats(options)
75
94
  }));
76
95
  for (const { campaign, stats } of read) {
77
96
  const { client } = campaign;
97
+ requests += stats.meta.requests;
78
98
  byClient.set(client, [...byClient.get(client) ?? [], ...stats.rows]);
79
99
  }
80
- return [...byClient.entries()].map(([client, rows]) => ({
100
+ const clientsRead = [...byClient.entries()].map(([client, rows]) => ({
81
101
  campaigns: rows.length,
82
102
  client,
83
103
  counts: rows.length === 0 ? emptyCounts() : sumCounts(rows)
84
104
  })).toSorted((left, right) => left.client.localeCompare(right.client));
105
+ return { clients: clientsRead, requests };
85
106
  };
86
107
  var clients = (options = {}) => {
87
108
  const assigner = new Assigner(options.rules ?? []);
@@ -89,7 +110,11 @@ var clients = (options = {}) => {
89
110
  extend: (outbound) => ({
90
111
  clients: {
91
112
  names: () => assigner.names(),
92
- stats: (statsOptions = {}) => clientStats(outbound, statsOptions)
113
+ read: (statsOptions = {}) => clientStats(outbound, statsOptions),
114
+ stats: async (statsOptions = {}) => {
115
+ const read = await clientStats(outbound, statsOptions);
116
+ return read.clients;
117
+ }
93
118
  }
94
119
  }),
95
120
  name: "clients",
@@ -9,9 +9,9 @@ export interface ClientRule {
9
9
  readonly workspaceId?: string | undefined;
10
10
  /** Campaigns carrying this tag. */
11
11
  readonly campaignTag?: string | undefined;
12
- /** Campaigns by ref. */
12
+ /** Campaigns by ref or by the vendor's own id. */
13
13
  readonly campaignIds?: readonly string[] | undefined;
14
- /** Campaigns whose name matches. */
14
+ /** Campaigns whose name matches. The `g` and `y` flags make no difference. */
15
15
  readonly campaignName?: RegExp | undefined;
16
16
  }
17
17
  export interface ClientsOptions {
@@ -36,7 +36,14 @@ export interface ClientsExtension {
36
36
  * campaigns. It costs one stats request per campaign.
37
37
  */
38
38
  readonly stats: (options?: ClientStatsOptions) => Promise<ClientStats[]>;
39
+ /** `stats()` with the vendor requests it made, listing included. */
40
+ readonly read: (options?: ClientStatsOptions) => Promise<ClientStatsRead>;
39
41
  };
40
42
  }
43
+ export interface ClientStatsRead {
44
+ readonly clients: ClientStats[];
45
+ /** Vendor requests made: the campaign listing and each campaign's stats. */
46
+ readonly requests: number;
47
+ }
41
48
  /** Tags every record with the client it belongs to. */
42
49
  export declare const clients: (options?: ClientsOptions) => OutboundPlugin<ClientsExtension>;
@@ -3,22 +3,23 @@ import {
3
3
  mergeFields,
4
4
  resolveCapabilities,
5
5
  resolveFields
6
- } from "../chunks/chunk-UAT3JSJZ.js";
6
+ } from "../chunks/chunk-ZOAG2C6V.js";
7
7
  import {
8
8
  recordBase
9
- } from "../chunks/chunk-U2D34ARZ.js";
10
- import "../chunks/chunk-4PSO6JEK.js";
9
+ } from "../chunks/chunk-2D42TQFU.js";
10
+ import "../chunks/chunk-BOWXGMN3.js";
11
+ import "../chunks/chunk-QGRZDTX4.js";
11
12
  import {
12
13
  parseRef
13
- } from "../chunks/chunk-LVYG7XZJ.js";
14
+ } from "../chunks/chunk-QAKJ76HB.js";
14
15
  import {
15
16
  OutboundError,
16
17
  makeErrorMapper
17
- } from "../chunks/chunk-E7JHLNLG.js";
18
+ } from "../chunks/chunk-J7DDZ4C2.js";
18
19
  import {
19
20
  count,
20
21
  field
21
- } from "../chunks/chunk-VQSCHOBV.js";
22
+ } from "../chunks/chunk-BLCJHP5H.js";
22
23
 
23
24
  // src/combine/route.ts
24
25
  var COMBINED = "combined";
@@ -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>;