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
@@ -1,10 +1,10 @@
1
1
  import { z } from "zod";
2
2
  import type { DayCounts, DayRange } from "./shared.ts";
3
3
  declare const metricSchema: z.ZodEnum<{
4
+ positive: "positive";
4
5
  bounced: "bounced";
5
6
  replied: "replied";
6
7
  unsubscribed: "unsubscribed";
7
- positive: "positive";
8
8
  clicked: "clicked";
9
9
  contacted: "contacted";
10
10
  opened: "opened";
@@ -66,14 +66,14 @@ export declare const anomalies: import("../define.ts").InsightDefinition<"anomal
66
66
  baseline_days: number;
67
67
  campaign: string | null;
68
68
  days: number;
69
- metrics: ("bounced" | "replied" | "unsubscribed" | "positive" | "clicked" | "contacted" | "opened" | "sent")[];
69
+ metrics: ("positive" | "bounced" | "replied" | "unsubscribed" | "clicked" | "contacted" | "opened" | "sent")[];
70
70
  min_baseline_points: number;
71
71
  threshold: number;
72
72
  }, Anomalies, {
73
73
  baseline_days?: number | undefined;
74
74
  campaign?: string | null | undefined;
75
75
  days?: number | undefined;
76
- metrics?: ("bounced" | "replied" | "unsubscribed" | "positive" | "clicked" | "contacted" | "opened" | "sent")[] | undefined;
76
+ metrics?: ("positive" | "bounced" | "replied" | "unsubscribed" | "clicked" | "contacted" | "opened" | "sent")[] | undefined;
77
77
  min_baseline_points?: number | undefined;
78
78
  threshold?: number | undefined;
79
79
  }>;
@@ -36,14 +36,14 @@ export declare const OPS_INSIGHTS: readonly [import("../define.ts").InsightDefin
36
36
  baseline_days: number;
37
37
  campaign: string | null;
38
38
  days: number;
39
- metrics: ("bounced" | "replied" | "unsubscribed" | "positive" | "clicked" | "contacted" | "opened" | "sent")[];
39
+ metrics: ("positive" | "bounced" | "replied" | "unsubscribed" | "clicked" | "contacted" | "opened" | "sent")[];
40
40
  min_baseline_points: number;
41
41
  threshold: number;
42
42
  }, import("./anomalies.ts").Anomalies, {
43
43
  baseline_days?: number | undefined;
44
44
  campaign?: string | null | undefined;
45
45
  days?: number | undefined;
46
- metrics?: ("bounced" | "replied" | "unsubscribed" | "positive" | "clicked" | "contacted" | "opened" | "sent")[] | undefined;
46
+ metrics?: ("positive" | "bounced" | "replied" | "unsubscribed" | "clicked" | "contacted" | "opened" | "sent")[] | undefined;
47
47
  min_baseline_points?: number | undefined;
48
48
  threshold?: number | undefined;
49
49
  }>, import("../define.ts").InsightDefinition<"periodComparison", {
@@ -134,7 +134,13 @@ export interface ListInput extends OpenRange {
134
134
  readonly max_campaigns: number;
135
135
  readonly statuses: readonly CampaignStatus[];
136
136
  }
137
- /** Every campaign in the given states with its totals for the range: one stats request each. */
137
+ /**
138
+ * Every campaign in the given states with its totals for the range: one
139
+ * stats request for all of them where the vendor reports every campaign in
140
+ * one call with every count, otherwise one request each. A campaign the
141
+ * one-call report leaves out is read on its own, so it is never shown as
142
+ * having no counts when it has some.
143
+ */
138
144
  export declare const readCampaignTotals: (context: InsightContext, input: ListInput) => Promise<CampaignTotals[]>;
139
145
  export interface DayCounts {
140
146
  /** `YYYY-MM-DD`. */
@@ -93,14 +93,14 @@ export declare const INSIGHTS: readonly [import("./define.ts").InsightDefinition
93
93
  alpha: number;
94
94
  campaign: string;
95
95
  from: string | null;
96
- metric: "replied" | "positive" | "clicked" | "opened";
96
+ metric: "positive" | "replied" | "clicked" | "opened";
97
97
  min_sent: number;
98
98
  to: string | null;
99
99
  }, import("./copy/variant-test.ts").VariantTest, {
100
100
  campaign: string;
101
101
  alpha?: number | undefined;
102
102
  from?: string | null | undefined;
103
- metric?: "replied" | "positive" | "clicked" | "opened" | undefined;
103
+ metric?: "positive" | "replied" | "clicked" | "opened" | undefined;
104
104
  min_sent?: number | undefined;
105
105
  to?: string | null | undefined;
106
106
  }>, import("./define.ts").InsightDefinition<"copyAudit", {
@@ -243,14 +243,14 @@ export declare const INSIGHTS: readonly [import("./define.ts").InsightDefinition
243
243
  baseline_days: number;
244
244
  campaign: string | null;
245
245
  days: number;
246
- metrics: ("bounced" | "replied" | "unsubscribed" | "positive" | "clicked" | "contacted" | "opened" | "sent")[];
246
+ metrics: ("positive" | "bounced" | "replied" | "unsubscribed" | "clicked" | "contacted" | "opened" | "sent")[];
247
247
  min_baseline_points: number;
248
248
  threshold: number;
249
249
  }, import("./ops/anomalies.ts").Anomalies, {
250
250
  baseline_days?: number | undefined;
251
251
  campaign?: string | null | undefined;
252
252
  days?: number | undefined;
253
- metrics?: ("bounced" | "replied" | "unsubscribed" | "positive" | "clicked" | "contacted" | "opened" | "sent")[] | undefined;
253
+ metrics?: ("positive" | "bounced" | "replied" | "unsubscribed" | "clicked" | "contacted" | "opened" | "sent")[] | undefined;
254
254
  min_baseline_points?: number | undefined;
255
255
  threshold?: number | undefined;
256
256
  }>, import("./define.ts").InsightDefinition<"periodComparison", {
@@ -1,5 +1,5 @@
1
1
  import type { Adapter } from "../internal/adapter.ts";
2
2
  import type { InstantlyClient } 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: InstantlyClient) => AccountReaders;
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://api.instantly.ai/api/v2";
4
5
  export declare const API_KEY_ENV = "INSTANTLY_API_KEY";
@@ -13,6 +14,7 @@ export declare const LOCAL_SEARCH_LANE = "localBusinessSearch";
13
14
  /** How many pages of tag assignments are read for one page of campaigns. */
14
15
  export declare const TAG_PAGES = 10;
15
16
  export declare const capabilities: CapabilityDeclaration;
17
+ export declare const fields: FieldDeclaration;
16
18
  export declare const limits: LimitDeclaration;
17
19
  export declare const costs: {
18
20
  "blocklist.list": {
@@ -1,7 +1,7 @@
1
1
  import type { AdapterContext, HttpMethod, RawDescriptor } from "../internal/adapter.ts";
2
- import type { Json, JsonObject } from "../internal/json.ts";
2
+ import type { RequestOptions, VendorClient } from "../internal/client.ts";
3
+ import type { JsonObject } from "../internal/json.ts";
3
4
  import type { Identity } from "../internal/record.ts";
4
- import type { QueryValue } from "../internal/url.ts";
5
5
  export interface ClientOptions {
6
6
  readonly apiKey: string;
7
7
  readonly baseUrl: string | undefined;
@@ -10,15 +10,10 @@ export interface ClientOptions {
10
10
  readonly identity: Identity;
11
11
  readonly readTags: boolean;
12
12
  }
13
- export interface GetOptions {
14
- readonly query?: Readonly<Record<string, QueryValue>> | undefined;
15
- readonly lane?: string | undefined;
16
- }
17
- export interface InstantlyClient {
13
+ export type GetOptions = RequestOptions;
14
+ export interface InstantlyClient extends VendorClient {
18
15
  readonly identity: Identity;
19
16
  readonly raw: RawDescriptor;
20
- readonly get: (ctx: AdapterContext, path: string, options?: GetOptions) => Promise<Json>;
21
- readonly post: (ctx: AdapterContext, path: string, body: JsonObject) => Promise<Json>;
22
17
  /** `false` when the caller turned the `tags` capability off. */
23
18
  readonly readTags: boolean;
24
19
  /** `get`, for an endpoint that returns one object. */
@@ -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 { InstantlyNative } from "./native.ts";
4
5
  export declare const PROVIDER = "instantly";
5
6
  export { NATIVE } from "./native.ts";
@@ -16,5 +17,11 @@ export interface InstantlyOptions {
16
17
  readonly baseUrl?: string | undefined;
17
18
  /** Overrides what the adapter declares, for example on a plan without webhooks. */
18
19
  readonly capabilities?: CapabilityDeclaration | undefined;
20
+ /**
21
+ * Which of a lead's custom fields holds a value this vendor has no field
22
+ * for, for example `{ title: "job_title" }`. Read only where the vendor's
23
+ * own field is empty.
24
+ */
25
+ readonly leadFields?: LeadFieldMap | undefined;
19
26
  }
20
27
  export declare const instantly: (options?: InstantlyOptions) => Adapter<InstantlyNative>;