outbound-sdk 0.1.0 → 0.2.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 (145) hide show
  1. package/README.md +0 -2
  2. package/dist/alerts/index.js +5 -1
  3. package/dist/audit/index.js +2 -2
  4. package/dist/benchmarks/index.js +5 -3
  5. package/dist/budget/index.js +31 -10
  6. package/dist/cache/index.js +2 -2
  7. package/dist/cards/index.js +1 -1
  8. package/dist/chunks/{chunk-WAM6N4OF.js → chunk-4PSO6JEK.js} +107 -19
  9. package/dist/chunks/chunk-6CVZOUHB.js +152 -0
  10. package/dist/chunks/{chunk-OCV66TS2.js → chunk-AFU5E5QB.js} +17 -8
  11. package/dist/chunks/{chunk-R6AM4GJR.js → chunk-DJ2IUQEU.js} +24 -18
  12. package/dist/chunks/{chunk-LOXBLQ3I.js → chunk-E7JHLNLG.js} +9 -2
  13. package/dist/chunks/{chunk-LNCOGBMI.js → chunk-FHKSLCVW.js} +13 -3
  14. package/dist/chunks/chunk-FKH5N47I.js +40 -0
  15. package/dist/chunks/chunk-HZCTYL22.js +29 -0
  16. package/dist/chunks/{chunk-CMQ5ZHLZ.js → chunk-IPUYZD4O.js} +1 -1
  17. package/dist/chunks/{chunk-VURTOVGI.js → chunk-IVH3NMQZ.js} +1 -1
  18. package/dist/chunks/{chunk-ZGHQYZEH.js → chunk-LVYG7XZJ.js} +1 -1
  19. package/dist/chunks/chunk-NAKXLBA6.js +30 -0
  20. package/dist/chunks/{chunk-7BCYLIDG.js → chunk-PMSSUWD7.js} +186 -33
  21. package/dist/chunks/{chunk-Q465X22Y.js → chunk-PURHK3JU.js} +93 -209
  22. package/dist/chunks/{chunk-F7MKFVIG.js → chunk-R3Y56YVF.js} +2 -2
  23. package/dist/chunks/chunk-RCZ7ZZFU.js +92 -0
  24. package/dist/chunks/chunk-SBIZDCRY.js +106 -0
  25. package/dist/chunks/{chunk-IBC52BX3.js → chunk-U2D34ARZ.js} +20 -3
  26. package/dist/chunks/chunk-UAT3JSJZ.js +331 -0
  27. package/dist/chunks/{chunk-QZNNCXXD.js → chunk-VQSCHOBV.js} +20 -1
  28. package/dist/chunks/{chunk-B7V6EOAC.js → chunk-XNFESPZH.js} +160 -126
  29. package/dist/chunks/{chunk-WW746NJF.js → chunk-YOTW5ESM.js} +25 -1
  30. package/dist/cli/bin.js +14 -13
  31. package/dist/cli/commands.d.ts +3 -0
  32. package/dist/cli/config.d.ts +22 -0
  33. package/dist/cli/index.d.ts +5 -1
  34. package/dist/cli/index.js +20 -15
  35. package/dist/cli/stdio.d.ts +9 -0
  36. package/dist/clients/index.js +13 -3
  37. package/dist/combine/account.d.ts +1 -1
  38. package/dist/combine/index.js +90 -15
  39. package/dist/combine/route.d.ts +7 -0
  40. package/dist/exporter/index.js +2 -2
  41. package/dist/failover/index.js +4 -4
  42. package/dist/fixtures/index.js +40 -21
  43. package/dist/heyreach/account.d.ts +1 -1
  44. package/dist/heyreach/adapter.d.ts +1 -1
  45. package/dist/heyreach/capabilities.d.ts +2 -0
  46. package/dist/heyreach/client.d.ts +3 -5
  47. package/dist/heyreach/index.d.ts +7 -0
  48. package/dist/heyreach/index.js +428 -205
  49. package/dist/heyreach/leads.d.ts +4 -0
  50. package/dist/heyreach/map-account.d.ts +7 -1
  51. package/dist/heyreach/map-stats.d.ts +8 -5
  52. package/dist/heyreach/map.d.ts +3 -1
  53. package/dist/heyreach/webhooks.d.ts +1 -0
  54. package/dist/identity/index.js +22 -11
  55. package/dist/index.d.ts +1 -4
  56. package/dist/index.js +29 -17
  57. package/dist/insights/copy/index.d.ts +2 -2
  58. package/dist/insights/copy/variant-test.d.ts +2 -2
  59. package/dist/insights/index.js +248 -184
  60. package/dist/insights/ops/anomalies.d.ts +3 -3
  61. package/dist/insights/ops/index.d.ts +2 -2
  62. package/dist/insights/ops/shared.d.ts +7 -1
  63. package/dist/insights/registry.d.ts +4 -4
  64. package/dist/instantly/adapter-account.d.ts +1 -1
  65. package/dist/instantly/capabilities.d.ts +2 -0
  66. package/dist/instantly/client.d.ts +4 -9
  67. package/dist/instantly/index.d.ts +7 -0
  68. package/dist/instantly/index.js +410 -155
  69. package/dist/instantly/map-account.d.ts +20 -5
  70. package/dist/instantly/map-stats.d.ts +9 -6
  71. package/dist/instantly/map.d.ts +0 -2
  72. package/dist/instantly/native-agents-sales.d.ts +41 -41
  73. package/dist/instantly/native-agents.d.ts +44 -44
  74. package/dist/instantly/native-campaigns.d.ts +21 -21
  75. package/dist/instantly/native-leads.d.ts +12 -12
  76. package/dist/instantly/native-params.d.ts +2 -19
  77. package/dist/instantly/native-search.d.ts +10 -10
  78. package/dist/instantly/native-senders.d.ts +56 -56
  79. package/dist/instantly/native-supersearch.d.ts +33 -33
  80. package/dist/instantly/native-workspace.d.ts +45 -45
  81. package/dist/instantly/native.d.ts +262 -262
  82. package/dist/instantly/webhooks.d.ts +1 -0
  83. package/dist/internal/adapter.d.ts +24 -2
  84. package/dist/internal/capabilities.d.ts +18 -0
  85. package/dist/internal/client.d.ts +15 -0
  86. package/dist/internal/concurrency.d.ts +8 -0
  87. package/dist/internal/engine/request.d.ts +7 -0
  88. package/dist/internal/entities-account.d.ts +73 -3
  89. package/dist/internal/entities.d.ts +116 -12
  90. package/dist/internal/errors.d.ts +6 -1
  91. package/dist/internal/fields.d.ts +462 -0
  92. package/dist/internal/json.d.ts +9 -0
  93. package/dist/internal/lead-fields.d.ts +21 -0
  94. package/dist/internal/lead-status.d.ts +13 -0
  95. package/dist/internal/metrics.d.ts +14 -2
  96. package/dist/internal/native.d.ts +15 -0
  97. package/dist/internal/outbound/api.d.ts +29 -4
  98. package/dist/internal/outbound/operations-account.d.ts +12 -0
  99. package/dist/internal/outbound/outbound.d.ts +6 -3
  100. package/dist/internal/outbound/specs-account.d.ts +5 -1
  101. package/dist/internal/page.d.ts +14 -0
  102. package/dist/internal/record.d.ts +17 -0
  103. package/dist/internal/records.d.ts +7 -0
  104. package/dist/internal/sequence.d.ts +14 -0
  105. package/dist/internal/sha256.d.ts +2 -0
  106. package/dist/loader/index.d.ts +14 -2
  107. package/dist/loader/index.js +8 -4
  108. package/dist/memory/account-reads.d.ts +1 -1
  109. package/dist/memory/account.d.ts +15 -1
  110. package/dist/memory/data.d.ts +17 -2
  111. package/dist/memory/index.js +110 -35
  112. package/dist/redact/index.js +11 -6
  113. package/dist/redact/plugin.d.ts +1 -1
  114. package/dist/smartlead/account.d.ts +1 -1
  115. package/dist/smartlead/adapter.d.ts +1 -1
  116. package/dist/smartlead/capabilities.d.ts +2 -0
  117. package/dist/smartlead/client.d.ts +6 -11
  118. package/dist/smartlead/hmac.d.ts +0 -2
  119. package/dist/smartlead/index.d.ts +7 -0
  120. package/dist/smartlead/index.js +731 -572
  121. package/dist/smartlead/leads.d.ts +4 -1
  122. package/dist/smartlead/map-account.d.ts +17 -5
  123. package/dist/smartlead/map-stats.d.ts +9 -10
  124. package/dist/smartlead/map.d.ts +15 -5
  125. package/dist/smartlead/native-analytics.d.ts +87 -87
  126. package/dist/smartlead/native-campaigns.d.ts +64 -64
  127. package/dist/smartlead/native-inbox.d.ts +51 -51
  128. package/dist/smartlead/native-params.d.ts +2 -23
  129. package/dist/smartlead/native-services.d.ts +34 -34
  130. package/dist/smartlead/native.d.ts +236 -236
  131. package/dist/smartlead/shared.d.ts +6 -5
  132. package/dist/smartlead/webhooks.d.ts +1 -0
  133. package/dist/sync/index.js +3 -3
  134. package/dist/tools/ai-sdk.js +7 -5
  135. package/dist/tools/campaign-tools.d.ts +1 -1
  136. package/dist/tools/claude-agent.js +7 -5
  137. package/dist/tools/index.js +8 -6
  138. package/dist/tracing/index.js +2 -2
  139. package/dist/webhooks/index.js +10 -9
  140. package/package.json +1 -1
  141. package/dist/chunks/chunk-FZF6CLPX.js +0 -232
  142. package/dist/chunks/chunk-GPEJG34O.js +0 -53
  143. package/dist/chunks/chunk-HEC7XFFH.js +0 -65
  144. package/dist/chunks/chunk-QTB747K4.js +0 -100
  145. package/dist/chunks/chunk-TIJKJJDW.js +0 -6
@@ -3,19 +3,19 @@ import {
3
3
  } from "../chunks/chunk-NAWZ73QS.js";
4
4
  import {
5
5
  stableId
6
- } from "../chunks/chunk-LNCOGBMI.js";
6
+ } from "../chunks/chunk-FHKSLCVW.js";
7
7
  import {
8
8
  makeRef,
9
9
  parseRef
10
- } from "../chunks/chunk-ZGHQYZEH.js";
10
+ } from "../chunks/chunk-LVYG7XZJ.js";
11
11
  import {
12
12
  OutboundError
13
- } from "../chunks/chunk-LOXBLQ3I.js";
13
+ } from "../chunks/chunk-E7JHLNLG.js";
14
14
  import {
15
15
  isJsonArray,
16
16
  isJsonObject,
17
17
  isString
18
- } from "../chunks/chunk-QZNNCXXD.js";
18
+ } from "../chunks/chunk-VQSCHOBV.js";
19
19
 
20
20
  // src/redact/plugin.ts
21
21
  var ALL_FIELDS = [
@@ -25,6 +25,7 @@ var ALL_FIELDS = [
25
25
  "email",
26
26
  "linkedin",
27
27
  "name",
28
+ "phone",
28
29
  "subject"
29
30
  ];
30
31
  var MASK = "[redacted]";
@@ -101,12 +102,16 @@ var redactFields = (masks, record) => {
101
102
  return {
102
103
  ...record,
103
104
  company: maskIf(masks, "company", record.company),
105
+ // The company's LinkedIn page and its website name the company too.
106
+ companyLinkedinUrl: maskIf(masks, "company", record.companyLinkedinUrl),
104
107
  custom: maskCustom(masks, record.custom),
105
108
  email: maskIf(masks, "email", record.email),
106
109
  firstName: maskIf(masks, "name", record.firstName),
107
110
  lastName: maskIf(masks, "name", record.lastName),
108
111
  linkedinUrl: maskIf(masks, "linkedin", record.linkedinUrl),
109
- raw: null
112
+ phone: maskIf(masks, "phone", record.phone),
113
+ raw: null,
114
+ website: maskIf(masks, "company", record.website)
110
115
  };
111
116
  }
112
117
  if ("value" in record) {
@@ -117,7 +122,7 @@ var redactFields = (masks, record) => {
117
122
  value: blocked === void 0 ? record.value : maskIf(masks, blocked, record.value) ?? MASK
118
123
  };
119
124
  }
120
- if ("steps" in record || "schedule" in record || "dns" in record || "size" in record || "url" in record || "description" in record) {
125
+ if ("steps" in record || "inProgress" in record || "nextRunAt" in record || "schedule" in record || "dns" in record || "size" in record || "url" in record || "description" in record) {
121
126
  return { ...record, raw: null };
122
127
  }
123
128
  if ("kind" in record) {
@@ -1,5 +1,5 @@
1
1
  import type { OutboundPlugin } from "../internal/outbound/plugins.ts";
2
- export type RedactField = "body" | "company" | "custom" | "email" | "linkedin" | "name" | "subject";
2
+ export type RedactField = "body" | "company" | "custom" | "email" | "linkedin" | "name" | "phone" | "subject";
3
3
  export interface RedactOptions {
4
4
  /** What to mask. Defaults to everything. */
5
5
  readonly fields?: readonly RedactField[] | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { Adapter } from "../internal/adapter.ts";
2
2
  import type { SmartleadClient } from "./client.ts";
3
- type AccountReaders = Pick<Adapter, "getCampaignSettings" | "getSenderHealth" | "listBlocklist" | "listLists" | "listSubsequences" | "listTags" | "listWebhooks">;
3
+ type AccountReaders = Pick<Adapter, "getCampaignProgress" | "getCampaignSettings" | "getList" | "getSenderHealth" | "getWebhook" | "listBlocklist" | "listLists" | "listPlacementTests" | "listSubsequences" | "listTags" | "listWebhooks">;
4
4
  export declare const accountReaders: (client: SmartleadClient) => AccountReaders;
5
5
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { Adapter } from "../internal/adapter.ts";
2
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">;
3
+ type Readers = Pick<Adapter, "getCampaign" | "getCampaignProgress" | "getCampaignSettings" | "getLead" | "getList" | "getSender" | "getSenderHealth" | "getSequence" | "getWebhook" | "listBlocklist" | "listCampaigns" | "listLeads" | "listLists" | "listMessages" | "listPlacementTests" | "listReplies" | "listSenders" | "listSubsequences" | "listTags" | "listWebhooks" | "listWorkspaces" | "stats">;
4
4
  export declare const readers: (client: SmartleadClient) => Readers;
5
5
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { CapabilityDeclaration } from "../internal/capabilities.ts";
2
+ import type { FieldDeclaration } from "../internal/fields.ts";
2
3
  import type { LimitDeclaration } from "../internal/limits.ts";
3
4
  export declare const BASE_URL = "https://server.smartlead.ai/api/v1";
4
5
  export declare const API_KEY_ENV = "SMARTLEAD_API_KEY";
@@ -18,6 +19,7 @@ export declare const BLOCKLIST_PAGE_SIZE = 1000;
18
19
  /** The master inbox returns at most 20 threads per page. */
19
20
  export declare const INBOX_PAGE_SIZE = 20;
20
21
  export declare const capabilities: CapabilityDeclaration;
22
+ export declare const fields: FieldDeclaration;
21
23
  export declare const limits: LimitDeclaration;
22
24
  export declare const costs: {
23
25
  "blocklist.list": {
@@ -1,22 +1,17 @@
1
- import type { AdapterContext, HttpMethod, RawDescriptor } from "../internal/adapter.ts";
2
- import type { Json, JsonObject } from "../internal/json.ts";
1
+ import type { HttpMethod, RawDescriptor } from "../internal/adapter.ts";
2
+ import type { VendorClient } from "../internal/client.ts";
3
3
  import type { Identity } from "../internal/record.ts";
4
- import type { QueryValue } from "../internal/url.ts";
5
4
  export interface ClientOptions {
6
5
  readonly apiKey: string;
7
6
  readonly baseUrl: string | undefined;
8
7
  readonly identity: Identity;
9
8
  }
10
- export interface RequestOptions {
11
- readonly query?: Readonly<Record<string, QueryValue>> | undefined;
12
- readonly lane?: string | undefined;
13
- }
14
- export interface SmartleadClient {
9
+ export type { RequestOptions } from "../internal/client.ts";
10
+ export interface SmartleadClient extends VendorClient {
15
11
  readonly identity: Identity;
16
12
  readonly raw: RawDescriptor;
17
- readonly get: (ctx: AdapterContext, path: string, options?: RequestOptions) => Promise<Json>;
18
- /** Only for the reads Smartlead serves over POST; see `READ_POSTS`. */
19
- readonly post: (ctx: AdapterContext, path: string, body: JsonObject, options?: RequestOptions) => Promise<Json>;
13
+ /** SmartDelivery, the placement-test service: its own host, the same key. */
14
+ readonly delivery: VendorClient;
20
15
  }
21
16
  export declare const isSecret: (path: string, query: URLSearchParams) => boolean;
22
17
  export declare const isRead: (method: HttpMethod, path: string) => boolean;
@@ -1,5 +1,3 @@
1
- /** The SHA-256 digest of `bytes`, as 32 bytes. */
2
- export declare const sha256: (bytes: Uint8Array) => Uint8Array;
3
1
  /** HMAC-SHA256 of `message` under `key` (RFC 2104), as 32 bytes. */
4
2
  export declare const hmacSha256: (key: Uint8Array, message: Uint8Array) => Uint8Array;
5
3
  /** Decodes standard base64, or `null` when the text is not valid base64. */
@@ -1,5 +1,6 @@
1
1
  import type { Adapter } from "../internal/adapter.ts";
2
2
  import type { CapabilityDeclaration } from "../internal/capabilities.ts";
3
+ import type { LeadFieldMap } from "../internal/lead-fields.ts";
3
4
  import type { SmartleadNative } from "./native.ts";
4
5
  export declare const PROVIDER = "smartlead";
5
6
  /** The environment variables this adapter reads. */
@@ -12,6 +13,12 @@ export interface SmartleadOptions {
12
13
  readonly baseUrl?: string | undefined;
13
14
  /** Overrides what the adapter declares, for example on a key some endpoints refuse. */
14
15
  readonly capabilities?: CapabilityDeclaration | undefined;
16
+ /**
17
+ * Which of a lead's custom fields holds a value this vendor has no field
18
+ * for, for example `{ title: "job_title" }`. Read only where the vendor's
19
+ * own field is empty.
20
+ */
21
+ readonly leadFields?: LeadFieldMap | undefined;
15
22
  }
16
23
  export type { SmartleadNative } from "./native.ts";
17
24
  export declare const smartlead: (options?: SmartleadOptions) => Adapter<SmartleadNative>;