outbound-sdk 0.6.0 → 0.7.1

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 (119) hide show
  1. package/dist/alerts/check-schema.d.ts +1 -1
  2. package/dist/alerts/index.js +6 -6
  3. package/dist/audit/index.js +2 -2
  4. package/dist/benchmarks/index.js +4 -4
  5. package/dist/budget/index.js +2 -2
  6. package/dist/cards/index.js +54 -44
  7. package/dist/chunks/{chunk-BLCJHP5H.js → chunk-45TXPJW7.js} +1 -0
  8. package/dist/chunks/chunk-4AVYRVN5.js +239 -0
  9. package/dist/chunks/{chunk-YYCT3NGV.js → chunk-65YAGEWZ.js} +24 -7
  10. package/dist/chunks/{chunk-3JOC5DGD.js → chunk-6NSCPTOY.js} +488 -127
  11. package/dist/chunks/{chunk-W22SDX6S.js → chunk-7I3EPR23.js} +3 -3
  12. package/dist/chunks/{chunk-MGR6HREO.js → chunk-BNDHEDHD.js} +2 -2
  13. package/dist/chunks/chunk-DNPNTD5W.js +81 -0
  14. package/dist/chunks/{chunk-53DCVFUB.js → chunk-FALWG5U3.js} +1 -0
  15. package/dist/chunks/{chunk-OLPMBRXM.js → chunk-GL7BABF2.js} +2 -2
  16. package/dist/chunks/{chunk-ZOAG2C6V.js → chunk-HIAK2GCI.js} +9 -2
  17. package/dist/chunks/{chunk-SXGCKCAR.js → chunk-I7DXXGNZ.js} +40 -9
  18. package/dist/chunks/{chunk-BK5SLY32.js → chunk-JRL3QRBS.js} +264 -76
  19. package/dist/chunks/{chunk-PHNQ3WC2.js → chunk-KTYTE2BU.js} +4 -3
  20. package/dist/chunks/{chunk-JWGSB7PT.js → chunk-LD6F46UT.js} +2 -2
  21. package/dist/chunks/{chunk-2D42TQFU.js → chunk-LVZGIKNF.js} +2 -2
  22. package/dist/chunks/{chunk-PQSTQKRD.js → chunk-M2VXGLLZ.js} +35 -2
  23. package/dist/chunks/{chunk-UWUPUMM2.js → chunk-MW4C6LTN.js} +2 -2
  24. package/dist/chunks/chunk-OK3GAZMT.js +51 -0
  25. package/dist/chunks/{chunk-BOWXGMN3.js → chunk-POBAY3TI.js} +80 -4
  26. package/dist/chunks/{chunk-J7DDZ4C2.js → chunk-QFC4ZHD3.js} +1 -1
  27. package/dist/chunks/{chunk-TFICTGM2.js → chunk-T5MJMW3R.js} +1 -1
  28. package/dist/chunks/{chunk-GFDNRWR3.js → chunk-UFQ4WMLU.js} +1 -1
  29. package/dist/chunks/{chunk-QAKJ76HB.js → chunk-YW6FFVSZ.js} +1 -1
  30. package/dist/cli/bin.js +14 -14
  31. package/dist/cli/by-name.d.ts +28 -0
  32. package/dist/cli/commands.d.ts +2 -1
  33. package/dist/cli/config.d.ts +3 -2
  34. package/dist/cli/envelope.d.ts +50 -0
  35. package/dist/cli/index.d.ts +5 -0
  36. package/dist/cli/index.js +13 -13
  37. package/dist/cli/listing.d.ts +13 -0
  38. package/dist/cli/native.d.ts +4 -0
  39. package/dist/cli/options.d.ts +88 -0
  40. package/dist/cli/output.d.ts +13 -1
  41. package/dist/cli/suggest.d.ts +10 -0
  42. package/dist/cli/update.d.ts +25 -2
  43. package/dist/clients/index.js +6 -6
  44. package/dist/combine/index.js +7 -7
  45. package/dist/emailbison/capabilities.d.ts +1 -0
  46. package/dist/emailbison/index.js +38 -14
  47. package/dist/emailbison/map-stats.d.ts +10 -0
  48. package/dist/exporter/index.js +2 -2
  49. package/dist/failover/index.js +2 -2
  50. package/dist/fixtures/index.js +4 -4
  51. package/dist/heyreach/capabilities.d.ts +3 -0
  52. package/dist/heyreach/index.js +34 -12
  53. package/dist/heyreach/map-account.d.ts +2 -2
  54. package/dist/identity/index.js +2 -2
  55. package/dist/index.js +9 -7
  56. package/dist/insights/copy/audit-samples.d.ts +24 -0
  57. package/dist/insights/copy/audit-variant.d.ts +34 -0
  58. package/dist/insights/copy/copy-audit.d.ts +26 -12
  59. package/dist/insights/copy/copy-preview.d.ts +16 -3
  60. package/dist/insights/copy/index.d.ts +6 -0
  61. package/dist/insights/copy/reply-timing.d.ts +4 -0
  62. package/dist/insights/copy/shared.d.ts +4 -1
  63. package/dist/insights/copy/step-funnel.d.ts +20 -6
  64. package/dist/insights/copy/variant-test.d.ts +2 -3
  65. package/dist/insights/index.js +1138 -589
  66. package/dist/insights/inputs.generated.d.ts +47 -11
  67. package/dist/insights/ops/campaign-diagnosis.d.ts +2 -0
  68. package/dist/insights/ops/diagnosis-checks.d.ts +20 -1
  69. package/dist/insights/ops/index.d.ts +2 -0
  70. package/dist/insights/ops/pipeline-forecast.d.ts +17 -6
  71. package/dist/insights/people/account-summary.d.ts +14 -1
  72. package/dist/insights/people/auto-replies.d.ts +14 -0
  73. package/dist/insights/people/dropped-replies.d.ts +1 -1
  74. package/dist/insights/people/hot-leads.d.ts +5 -1
  75. package/dist/insights/people/index.d.ts +4 -0
  76. package/dist/insights/people/lead-collisions.d.ts +11 -2
  77. package/dist/insights/people/person-summary.d.ts +19 -3
  78. package/dist/insights/people/personalization-gaps.d.ts +14 -8
  79. package/dist/insights/people/suppression-check.d.ts +9 -0
  80. package/dist/insights/registry.d.ts +12 -0
  81. package/dist/insights/step.d.ts +15 -0
  82. package/dist/insights/variables.d.ts +2 -0
  83. package/dist/instantly/capabilities.d.ts +4 -0
  84. package/dist/instantly/index.js +263 -53
  85. package/dist/instantly/map-stats.d.ts +4 -0
  86. package/dist/instantly/stats-tracking.d.ts +19 -0
  87. package/dist/instantly/thread.d.ts +9 -0
  88. package/dist/internal/adapter.d.ts +5 -0
  89. package/dist/internal/auto-reply.d.ts +20 -0
  90. package/dist/internal/capabilities.d.ts +2 -0
  91. package/dist/internal/entities-account.d.ts +1 -0
  92. package/dist/internal/entities.d.ts +79 -2
  93. package/dist/internal/fields.d.ts +37 -1
  94. package/dist/internal/metrics.d.ts +23 -1
  95. package/dist/internal/outbound/api.d.ts +2 -0
  96. package/dist/internal/records.d.ts +2 -2
  97. package/dist/internal/reply-people.d.ts +37 -0
  98. package/dist/internal/runway.d.ts +42 -0
  99. package/dist/internal/sender-screen.d.ts +9 -0
  100. package/dist/internal/tracking.d.ts +33 -0
  101. package/dist/loader/index.js +4 -4
  102. package/dist/memory/data.d.ts +2 -1
  103. package/dist/memory/index.js +23 -12
  104. package/dist/redact/index.js +3 -3
  105. package/dist/smartlead/capabilities.d.ts +4 -0
  106. package/dist/smartlead/index.js +152 -38
  107. package/dist/smartlead/map-account.d.ts +3 -0
  108. package/dist/smartlead/stats-tracking.d.ts +22 -0
  109. package/dist/sync/index.js +2 -2
  110. package/dist/tools/ai-sdk.js +8 -7
  111. package/dist/tools/by-name.d.ts +18 -0
  112. package/dist/tools/campaign-tools.d.ts +6 -2
  113. package/dist/tools/claude-agent.js +8 -7
  114. package/dist/tools/index.js +9 -8
  115. package/dist/tools/shared.d.ts +7 -0
  116. package/dist/tracing/index.js +2 -2
  117. package/dist/webhooks/index.js +12 -11
  118. package/package.json +1 -1
  119. package/dist/chunks/chunk-HWHI4LFY.js +0 -102
@@ -0,0 +1,88 @@
1
+ export declare const OPTIONS: {
2
+ readonly bodies: {
3
+ readonly type: "boolean";
4
+ };
5
+ readonly by: {
6
+ readonly type: "string";
7
+ };
8
+ readonly cache: {
9
+ readonly type: "string";
10
+ };
11
+ readonly campaign: {
12
+ readonly type: "string";
13
+ };
14
+ readonly card: {
15
+ readonly type: "boolean";
16
+ };
17
+ readonly category: {
18
+ readonly type: "string";
19
+ };
20
+ readonly compact: {
21
+ readonly type: "boolean";
22
+ };
23
+ readonly config: {
24
+ readonly type: "string";
25
+ };
26
+ readonly from: {
27
+ readonly type: "string";
28
+ };
29
+ readonly help: {
30
+ readonly short: "h";
31
+ readonly type: "boolean";
32
+ };
33
+ readonly input: {
34
+ readonly type: "string";
35
+ };
36
+ readonly limit: {
37
+ readonly type: "string";
38
+ };
39
+ readonly list: {
40
+ readonly type: "string";
41
+ };
42
+ readonly "max-requests": {
43
+ readonly type: "string";
44
+ };
45
+ readonly "no-redact": {
46
+ readonly type: "boolean";
47
+ };
48
+ readonly provider: {
49
+ readonly type: "string";
50
+ };
51
+ readonly raw: {
52
+ readonly type: "boolean";
53
+ };
54
+ readonly redact: {
55
+ readonly type: "boolean";
56
+ };
57
+ readonly search: {
58
+ readonly type: "string";
59
+ };
60
+ readonly sequence: {
61
+ readonly type: "boolean";
62
+ };
63
+ readonly settings: {
64
+ readonly type: "boolean";
65
+ };
66
+ readonly since: {
67
+ readonly type: "string";
68
+ };
69
+ readonly slack: {
70
+ readonly type: "boolean";
71
+ };
72
+ readonly stats: {
73
+ readonly type: "boolean";
74
+ };
75
+ readonly status: {
76
+ readonly type: "string";
77
+ };
78
+ readonly subsequences: {
79
+ readonly type: "boolean";
80
+ };
81
+ readonly to: {
82
+ readonly type: "string";
83
+ };
84
+ readonly version: {
85
+ readonly short: "v";
86
+ readonly type: "boolean";
87
+ };
88
+ };
@@ -1,4 +1,5 @@
1
1
  import type { Json } from "../internal/json.ts";
2
+ import type { Failure, Printed, RunFacts } from "./envelope.ts";
2
3
  /** The CLI's own `--compact` and `--raw`. */
3
4
  export interface PrintOptions {
4
5
  readonly compact?: boolean | undefined;
@@ -6,4 +7,15 @@ export interface PrintOptions {
6
7
  }
7
8
  /** The answer with `raw` taken off every record in it, at any depth. */
8
9
  export declare const withoutRaw: (value: Json) => Json;
9
- export declare const printAnswer: (write: (text: string) => void, value: Json, options: PrintOptions) => void;
10
+ /** Prints JSON as it is: indented, or on one line with `--compact`. */
11
+ export declare const printJson: (write: (text: string) => void, value: Json, options: PrintOptions) => void;
12
+ /** Prints a command's answer in the envelope (see `envelope.ts`). */
13
+ export declare const printAnswer: (write: (text: string) => void, printed: Printed, options: PrintOptions, facts: RunFacts) => void;
14
+ /**
15
+ * Prints a command that failed in the envelope, so stdout keeps its shape.
16
+ * Parsing may have failed first, so `--compact` is read from the arguments.
17
+ */
18
+ export declare const printFailure: (write: (text: string) => void, run: {
19
+ readonly argv: readonly string[];
20
+ readonly name: string | undefined;
21
+ }, failure: Failure, facts: RunFacts) => void;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Edits between two words: an insertion, a deletion, a substitution or a
3
+ * swap of two neighbouring letters each count one, so `campaing` is one edit
4
+ * from `campaign`.
5
+ */
6
+ export declare const distance: (from: string, to: string) => number;
7
+ /** The known words at most two edits away, closest first. */
8
+ export declare const closest: (typed: string, known: Iterable<string>) => string[];
9
+ /** ` Did you mean "a" or "b"?`, or nothing when no known word is close. */
10
+ export declare const didYouMean: (typed: string, known: Iterable<string>, prefix?: string) => string;
@@ -1,9 +1,31 @@
1
1
  /** Runs npm with these arguments and resolves to what it printed. */
2
2
  export type NpmRunner = (args: readonly string[]) => Promise<string>;
3
3
  export declare const STANDALONE: ReadonlyMap<string, readonly string[]>;
4
+ /** npm failed. `code` is npm's error code, such as `E404`, when it printed one. */
5
+ export declare class NpmFailedError extends Error {
6
+ readonly code: string | undefined;
7
+ constructor(message: string, code: string | undefined, cause: unknown);
8
+ }
9
+ /** What npm said when it failed. */
10
+ interface NpmReason {
11
+ /** npm's error code, such as `E404`. */
12
+ readonly code: string | undefined;
13
+ /** The first line that says what went wrong. */
14
+ readonly said: string;
15
+ }
16
+ /**
17
+ * npm's code and the first line that says what went wrong. npm ends every
18
+ * failure with "A complete log of this run can be found in: ...", so the last
19
+ * line says nothing. npm starts its explanation lines with a tag, such as
20
+ * `404`, `notarget` or the code in lower case, which is dropped.
21
+ */
22
+ export declare const npmReason: (stderr: string) => NpmReason;
4
23
  export declare const runNpm: NpmRunner;
24
+ /** Waits this many milliseconds. */
25
+ export type Sleep = (ms: number) => Promise<void>;
26
+ export declare const sleep: Sleep;
5
27
  /** Checks npm for a newer version and updates a global install. */
6
- export declare const update: (npm: NpmRunner, say: (text: string) => void) => Promise<void>;
28
+ export declare const update: (npm: NpmRunner, say: (text: string) => void, wait?: Sleep) => Promise<void>;
7
29
  /**
8
30
  * Runs `version` (also a bare `--version`) or `update`, and says whether it
9
31
  * did. Version comes before help, which is what no command at all prints;
@@ -12,4 +34,5 @@ export declare const update: (npm: NpmRunner, say: (text: string) => void) => Pr
12
34
  export declare const runSelf: (name: string | undefined, flags: {
13
35
  readonly help?: boolean;
14
36
  readonly version?: boolean;
15
- }, npm: NpmRunner, say: (text: string) => void) => Promise<boolean>;
37
+ }, npm: NpmRunner, say: (text: string) => void, wait?: Sleep) => Promise<boolean>;
38
+ export {};
@@ -3,14 +3,14 @@ import {
3
3
  } from "../chunks/chunk-HZCTYL22.js";
4
4
  import {
5
5
  emptyCounts,
6
- sumCounts
7
- } from "../chunks/chunk-PQSTQKRD.js";
6
+ sumMeasured
7
+ } from "../chunks/chunk-M2VXGLLZ.js";
8
8
  import "../chunks/chunk-QGRZDTX4.js";
9
9
  import {
10
10
  parseRef
11
- } from "../chunks/chunk-QAKJ76HB.js";
12
- import "../chunks/chunk-J7DDZ4C2.js";
13
- import "../chunks/chunk-BLCJHP5H.js";
11
+ } from "../chunks/chunk-YW6FFVSZ.js";
12
+ import "../chunks/chunk-QFC4ZHD3.js";
13
+ import "../chunks/chunk-45TXPJW7.js";
14
14
 
15
15
  // src/clients/plugin.ts
16
16
  var UNASSIGNED = "unassigned";
@@ -100,7 +100,7 @@ var clientStats = async (outbound, options) => {
100
100
  const clientsRead = [...byClient.entries()].map(([client, rows]) => ({
101
101
  campaigns: rows.length,
102
102
  client,
103
- counts: rows.length === 0 ? emptyCounts() : sumCounts(rows)
103
+ counts: rows.length === 0 ? emptyCounts() : sumMeasured(rows)
104
104
  })).toSorted((left, right) => left.client.localeCompare(right.client));
105
105
  return { clients: clientsRead, requests };
106
106
  };
@@ -3,23 +3,23 @@ import {
3
3
  mergeFields,
4
4
  resolveCapabilities,
5
5
  resolveFields
6
- } from "../chunks/chunk-ZOAG2C6V.js";
6
+ } from "../chunks/chunk-HIAK2GCI.js";
7
7
  import {
8
8
  recordBase
9
- } from "../chunks/chunk-2D42TQFU.js";
10
- import "../chunks/chunk-BOWXGMN3.js";
9
+ } from "../chunks/chunk-LVZGIKNF.js";
10
+ import "../chunks/chunk-POBAY3TI.js";
11
11
  import "../chunks/chunk-QGRZDTX4.js";
12
12
  import {
13
13
  parseRef
14
- } from "../chunks/chunk-QAKJ76HB.js";
14
+ } from "../chunks/chunk-YW6FFVSZ.js";
15
15
  import {
16
16
  OutboundError,
17
17
  makeErrorMapper
18
- } from "../chunks/chunk-J7DDZ4C2.js";
18
+ } from "../chunks/chunk-QFC4ZHD3.js";
19
19
  import {
20
20
  count,
21
21
  field
22
- } from "../chunks/chunk-BLCJHP5H.js";
22
+ } from "../chunks/chunk-45TXPJW7.js";
23
23
 
24
24
  // src/combine/route.ts
25
25
  var COMBINED = "combined";
@@ -252,7 +252,7 @@ var lists = (members) => ({
252
252
  }
253
253
  return member.listLeads(scoped, memberCtx);
254
254
  };
255
- const lookup = query.email !== void 0 || query.linkedinUrl !== void 0;
255
+ const lookup = query.email !== void 0 || query.linkedinUrl !== void 0 || query.domain !== void 0;
256
256
  if (lookup && query.campaignId === void 0) {
257
257
  return pageTogether(
258
258
  members,
@@ -63,6 +63,7 @@ export declare const costs: {
63
63
  };
64
64
  stats: {
65
65
  perPage: number;
66
+ perPageAtMost: number;
66
67
  };
67
68
  "tags.list": {
68
69
  perPage: number;
@@ -22,7 +22,13 @@ import {
22
22
  toTag,
23
23
  toWebhook,
24
24
  toWorkspace
25
- } from "../chunks/chunk-SXGCKCAR.js";
25
+ } from "../chunks/chunk-I7DXXGNZ.js";
26
+ import {
27
+ applyTracking,
28
+ ownTracking,
29
+ unlessFailed
30
+ } from "../chunks/chunk-DNPNTD5W.js";
31
+ import "../chunks/chunk-OK3GAZMT.js";
26
32
  import {
27
33
  flatMapPage,
28
34
  mapPage,
@@ -32,8 +38,8 @@ import {
32
38
  import {
33
39
  toVariant,
34
40
  variantKey
35
- } from "../chunks/chunk-MGR6HREO.js";
36
- import "../chunks/chunk-53DCVFUB.js";
41
+ } from "../chunks/chunk-BNDHEDHD.js";
42
+ import "../chunks/chunk-FALWG5U3.js";
37
43
  import {
38
44
  defineNative,
39
45
  inPath,
@@ -43,34 +49,35 @@ import {
43
49
  import {
44
50
  recordBase,
45
51
  refTo
46
- } from "../chunks/chunk-2D42TQFU.js";
47
- import "../chunks/chunk-BOWXGMN3.js";
52
+ } from "../chunks/chunk-LVZGIKNF.js";
53
+ import "../chunks/chunk-POBAY3TI.js";
48
54
  import {
49
55
  emptyCounts,
50
56
  metricRow,
51
57
  sumCounts
52
- } from "../chunks/chunk-PQSTQKRD.js";
58
+ } from "../chunks/chunk-M2VXGLLZ.js";
53
59
  import "../chunks/chunk-QGRZDTX4.js";
54
60
  import {
55
61
  assertWorkspaceId
56
- } from "../chunks/chunk-QAKJ76HB.js";
62
+ } from "../chunks/chunk-YW6FFVSZ.js";
57
63
  import "../chunks/chunk-NAWZ73QS.js";
58
64
  import "../chunks/chunk-FHKSLCVW.js";
59
65
  import {
60
66
  readEnv,
61
67
  requireCredential
62
- } from "../chunks/chunk-GFDNRWR3.js";
68
+ } from "../chunks/chunk-UFQ4WMLU.js";
63
69
  import {
64
70
  OutboundError,
65
71
  makeErrorMapper
66
- } from "../chunks/chunk-J7DDZ4C2.js";
72
+ } from "../chunks/chunk-QFC4ZHD3.js";
67
73
  import {
68
74
  count,
69
75
  field,
76
+ flag,
70
77
  isJsonArray,
71
78
  objects,
72
79
  text
73
- } from "../chunks/chunk-BLCJHP5H.js";
80
+ } from "../chunks/chunk-45TXPJW7.js";
74
81
 
75
82
  // src/emailbison/account.ts
76
83
  var DAY_MS = 864e5;
@@ -465,6 +472,17 @@ var readSteps = async (client, ctx, scope, range2) => {
465
472
  );
466
473
  return stepRows2(scope, summary, stepPlaces(steps));
467
474
  };
475
+ var judged = async (client, ctx, scope, rows) => {
476
+ const path = `/api/campaigns/${id(scope)}`;
477
+ const flags = await unlessFailed(async () => ({
478
+ clicks: null,
479
+ opens: flag(client.one(await client.get(ctx, path), path).open_tracking)
480
+ }));
481
+ return applyTracking(
482
+ rows,
483
+ flags === null ? null : [ownTracking(flags, rows)]
484
+ );
485
+ };
468
486
  var readStats = async (client, ctx, query, now = Date.now()) => {
469
487
  const { provider } = client.identity;
470
488
  if (query.scope === "campaign" && query.scopeId === void 0) {
@@ -487,22 +505,28 @@ var readStats = async (client, ctx, query, now = Date.now()) => {
487
505
  { provider }
488
506
  );
489
507
  }
490
- return await readDaily(client, ctx, scope, rangeOf(query, true, now));
508
+ const days = await readDaily(client, ctx, scope, rangeOf(query, true, now));
509
+ return query.scope === "campaign" ? await judged(client, ctx, scope, days) : days;
491
510
  }
492
511
  const range2 = rangeOf(query, false, now);
493
512
  if (query.scope === "sender") {
494
513
  return await readSender(client, ctx, scope, query, now);
495
514
  }
496
515
  if (query.scope === "step") {
497
- return await readSteps(client, ctx, scope, range2);
516
+ return await judged(
517
+ client,
518
+ ctx,
519
+ scope,
520
+ await readSteps(client, ctx, scope, range2)
521
+ );
498
522
  }
499
523
  if (query.scope === "campaign") {
500
- return [
524
+ return await judged(client, ctx, scope, [
501
525
  metricRow(
502
526
  scope,
503
527
  summaryCounts(await campaignSummary(client, ctx, scope, range2))
504
528
  )
505
- ];
529
+ ]);
506
530
  }
507
531
  const path = "/api/workspaces/v1.1/stats";
508
532
  return [
@@ -39,6 +39,16 @@ export declare const summedRow: (scope: RowScope, rows: readonly MetricRow[]) =>
39
39
  unsubscribed: number | null;
40
40
  variantKey: string | null;
41
41
  workspaceId: string;
42
+ completed?: number | null | undefined;
43
+ leads?: number | null | undefined;
44
+ opportunities?: number | null | undefined;
45
+ opportunityValue?: number | null | undefined;
46
+ repliedAutoTotal?: number | null | undefined;
47
+ repliedTotal?: number | null | undefined;
48
+ tracking?: {
49
+ clicks: "mixed" | "off" | "on" | null;
50
+ opens: "mixed" | "off" | "on" | null;
51
+ } | undefined;
42
52
  };
43
53
  /**
44
54
  * A row per step of `sequence_step_stats`. `places` says where each step id
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  OutboundError
3
- } from "../chunks/chunk-J7DDZ4C2.js";
3
+ } from "../chunks/chunk-QFC4ZHD3.js";
4
4
  import {
5
5
  isJsonObject,
6
6
  toJson
7
- } from "../chunks/chunk-BLCJHP5H.js";
7
+ } from "../chunks/chunk-45TXPJW7.js";
8
8
 
9
9
  // src/exporter/index.ts
10
10
  import { open } from "node:fs/promises";
@@ -4,8 +4,8 @@ import {
4
4
  import "../chunks/chunk-FHKSLCVW.js";
5
5
  import {
6
6
  OutboundError
7
- } from "../chunks/chunk-J7DDZ4C2.js";
8
- import "../chunks/chunk-BLCJHP5H.js";
7
+ } from "../chunks/chunk-QFC4ZHD3.js";
8
+ import "../chunks/chunk-45TXPJW7.js";
9
9
 
10
10
  // src/failover/index.ts
11
11
  var WEEK_SECONDS = 7 * 24 * 60 * 60;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  evidenceSchema
3
- } from "../chunks/chunk-BOWXGMN3.js";
3
+ } from "../chunks/chunk-POBAY3TI.js";
4
4
  import "../chunks/chunk-QGRZDTX4.js";
5
5
  import {
6
6
  makeRef,
7
7
  parseRef
8
- } from "../chunks/chunk-QAKJ76HB.js";
8
+ } from "../chunks/chunk-YW6FFVSZ.js";
9
9
  import {
10
10
  profileSlug
11
11
  } from "../chunks/chunk-NAWZ73QS.js";
@@ -14,13 +14,13 @@ import {
14
14
  } from "../chunks/chunk-FHKSLCVW.js";
15
15
  import {
16
16
  OutboundError
17
- } from "../chunks/chunk-J7DDZ4C2.js";
17
+ } from "../chunks/chunk-QFC4ZHD3.js";
18
18
  import {
19
19
  field,
20
20
  objects,
21
21
  parseJson,
22
22
  toJson
23
- } from "../chunks/chunk-BLCJHP5H.js";
23
+ } from "../chunks/chunk-45TXPJW7.js";
24
24
 
25
25
  // src/fixtures/index.ts
26
26
  import { mkdir, readFile, writeFile } from "node:fs/promises";
@@ -23,6 +23,9 @@ export declare const costs: {
23
23
  pageSize: number;
24
24
  perPage: number;
25
25
  };
26
+ "campaigns.progress": {
27
+ perPage: number;
28
+ };
26
29
  "leads.get": {
27
30
  perPage: number;
28
31
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EVENT_TYPES,
3
3
  heyreachEvents
4
- } from "../chunks/chunk-JWGSB7PT.js";
4
+ } from "../chunks/chunk-LD6F46UT.js";
5
5
  import {
6
6
  mapPage,
7
7
  withLeadFields,
@@ -13,10 +13,10 @@ import {
13
13
  listIn,
14
14
  toVariant,
15
15
  variantKey
16
- } from "../chunks/chunk-MGR6HREO.js";
16
+ } from "../chunks/chunk-BNDHEDHD.js";
17
17
  import {
18
18
  normalizeBody
19
- } from "../chunks/chunk-53DCVFUB.js";
19
+ } from "../chunks/chunk-FALWG5U3.js";
20
20
  import {
21
21
  defineNative
22
22
  } from "../chunks/chunk-NAKXLBA6.js";
@@ -25,16 +25,16 @@ import {
25
25
  recordBase,
26
26
  refTo,
27
27
  refsTo
28
- } from "../chunks/chunk-2D42TQFU.js";
29
- import "../chunks/chunk-BOWXGMN3.js";
28
+ } from "../chunks/chunk-LVZGIKNF.js";
29
+ import "../chunks/chunk-POBAY3TI.js";
30
30
  import {
31
31
  emptyCounts,
32
32
  metricRow
33
- } from "../chunks/chunk-PQSTQKRD.js";
33
+ } from "../chunks/chunk-M2VXGLLZ.js";
34
34
  import "../chunks/chunk-QGRZDTX4.js";
35
35
  import {
36
36
  assertWorkspaceId
37
- } from "../chunks/chunk-QAKJ76HB.js";
37
+ } from "../chunks/chunk-YW6FFVSZ.js";
38
38
  import {
39
39
  profileSlug
40
40
  } from "../chunks/chunk-NAWZ73QS.js";
@@ -44,13 +44,13 @@ import {
44
44
  import {
45
45
  readEnv,
46
46
  requireCredential
47
- } from "../chunks/chunk-GFDNRWR3.js";
47
+ } from "../chunks/chunk-UFQ4WMLU.js";
48
48
  import {
49
49
  OutboundError,
50
50
  isHttpFailure,
51
51
  makeErrorMapper,
52
52
  requireObject
53
- } from "../chunks/chunk-J7DDZ4C2.js";
53
+ } from "../chunks/chunk-QFC4ZHD3.js";
54
54
  import {
55
55
  count,
56
56
  emailAddress,
@@ -64,7 +64,7 @@ import {
64
64
  objects,
65
65
  text,
66
66
  timestamp
67
- } from "../chunks/chunk-BLCJHP5H.js";
67
+ } from "../chunks/chunk-45TXPJW7.js";
68
68
 
69
69
  // src/heyreach/map-account.ts
70
70
  var toCampaignProgress = (identity, campaignId, raw) => {
@@ -79,6 +79,7 @@ var toCampaignProgress = (identity, campaignId, raw) => {
79
79
  inProgress: count(field(stats, "totalUsersInProgress")),
80
80
  leads: count(field(stats, "totalUsers")),
81
81
  notStarted: count(field(stats, "totalUsersPending")),
82
+ skipped: count(field(stats, "totalUsersExcluded")),
82
83
  stopped: count(field(stats, "totalUsersManuallyStopped"))
83
84
  };
84
85
  };
@@ -211,6 +212,7 @@ var toSender = (identity, raw) => ({
211
212
  warmup: null
212
213
  });
213
214
  var LEAD_PROGRESS = /* @__PURE__ */ new Map([
215
+ ["Excluded", "skipped"],
214
216
  ["Finished", "completed"],
215
217
  ["InSequence", "active"],
216
218
  ["Paused", "paused"],
@@ -272,6 +274,7 @@ var profileFields = (identity, profile, raw) => ({
272
274
  location: text(field(profile, "location")),
273
275
  // HeyReach profiles carry no phone number and no company website.
274
276
  phone: null,
277
+ recipientMailProvider: null,
275
278
  title: text(field(profile, "position")),
276
279
  website: null
277
280
  });
@@ -422,20 +425,35 @@ var fields = {
422
425
  bounced: false,
423
426
  engagement: false,
424
427
  phone: false,
428
+ recipientMailProvider: false,
425
429
  unsubscribed: false,
426
430
  website: false
427
431
  },
428
- message: { bodyHtml: false, stepIndex: false, variantKey: false },
432
+ message: {
433
+ bodyHtml: false,
434
+ isAuto: false,
435
+ isAutoSource: false,
436
+ stepIndex: false,
437
+ variantKey: false
438
+ },
429
439
  metricRow: {
430
440
  bounced: false,
431
441
  clicked: false,
432
442
  clickedTotal: false,
443
+ completed: false,
433
444
  contentHash: false,
434
445
  delivered: false,
446
+ leads: false,
435
447
  opened: false,
436
448
  openedTotal: false,
449
+ opportunities: false,
450
+ opportunityValue: false,
451
+ repliedAutoTotal: false,
452
+ repliedTotal: false,
437
453
  repliedAuto: false,
438
454
  stepIndex: false,
455
+ // LinkedIn has no open or click tracking.
456
+ tracking: false,
439
457
  unsubscribed: false,
440
458
  variantKey: false
441
459
  },
@@ -447,6 +465,8 @@ var fields = {
447
465
  category: "derived",
448
466
  categorySource: "derived",
449
467
  isAuto: false,
468
+ isAutoSource: false,
469
+ leftCompany: false,
450
470
  stepIndex: false,
451
471
  variantKey: false
452
472
  },
@@ -486,6 +506,8 @@ var costs = {
486
506
  "blocklist.list": { pageSize: PAGE_SIZE, perPage: 1 },
487
507
  "campaigns.get": { perPage: 1 },
488
508
  "campaigns.list": { pageSize: PAGE_SIZE, perPage: 1 },
509
+ // The campaign object, which carries its lead counts.
510
+ "campaigns.progress": { perPage: 1 },
489
511
  // The profile and its tags are two requests.
490
512
  "leads.get": { perPage: 2 },
491
513
  // A campaign's leads. A saved list's leads come up to 1000 a page. Without
@@ -522,7 +544,7 @@ var caveats = [
522
544
  "A sender's dailyLimit is null: accountLimits holds several limit pairs and the docs do not say which are daily or what Limit and Max mean. They stay in raw.",
523
545
  "A lead's id is its LinkedIn profile URL, the only key GetLead accepts and the only one present in every lead shape. The docs do not say the URL has one canonical form.",
524
546
  "A lead is looked up by profile URL with two requests (GetCampaignsForLead and GetLead) and returned once per campaign it is in. A lead's id is its profile URL in every campaign, so a person's records share one ref and differ by campaignRef. The timeline is the lead's whole conversation history, the same on each of its records.",
525
- "A looked-up lead's status follows leadStatus and never says replied, because GetCampaignsForLead reports no message status; Excluded and PendingOrExcludedToBeCalculated are unknown. createdAt is null (the creationTime beside a campaign is the campaign's), tags are empty and interest is null. A lookup cannot be combined with a saved list or a date range.",
547
+ "A looked-up lead's status follows leadStatus and never says replied, because GetCampaignsForLead reports no message status; Excluded (kept out by an exclusion filter or exclusion list) is skipped, and PendingOrExcludedToBeCalculated, not decided yet, is unknown. createdAt is null (the creationTime beside a campaign is the campaign's), tags are empty and interest is null. A lookup cannot be combined with a saved list or a date range.",
526
548
  "HeyReach matches a profile URL whatever its scheme, www prefix, trailing slash or query, but by exact case: seen live, a slug sent in upper case is not found. The lookup sends the slug lowercased, so a profile HeyReach stores with upper-case letters would not be found. A slug with non-ASCII letters is sent percent-encoded; how HeyReach stores one is not known.",
527
549
  "No HeyReach read returns a profile for an email address. An email lookup asks for the campaigns (which names the person), then one saved list the address is in, searches that list for the name (5 rows at most) and reads each match's profile until one carries the address: four requests in the usual case. An address that is in no saved list, or whose profile is not among those rows, gives an empty page although HeyReach knows it. The record's email is the address asked for, which the profile may hold as its enriched or custom address.",
528
550
  "Lookup was checked against one live lead in one campaign. A person in several campaigns (and so a second page of campaigns) and a known person in no campaign were not seen; an empty campaign answer and a 404 from GetCampaignsForLead are both read as no campaigns.",
@@ -3,8 +3,8 @@ import type { JsonObject } from "../internal/json.ts";
3
3
  import type { Identity } from "../internal/record.ts";
4
4
  /**
5
5
  * `GET /campaign/GetById`: `progressStats` counts the campaign's leads by how
6
- * far they got. `totalUsersExcluded` (leads kept out by an exclusion rule) has
7
- * no equivalent and stays in raw.
6
+ * far they got. `totalUsersExcluded` counts the leads an exclusion filter or
7
+ * exclusion list kept out, which are skipped.
8
8
  */
9
9
  export declare const toCampaignProgress: (identity: Identity, campaignId: string, raw: JsonObject) => CampaignProgress;
10
10
  /** `POST /list/GetAll`: `listType` is `USER_LIST` or `COMPANY_LIST`. */
@@ -6,8 +6,8 @@ import {
6
6
  } from "../chunks/chunk-NAWZ73QS.js";
7
7
  import {
8
8
  OutboundError
9
- } from "../chunks/chunk-J7DDZ4C2.js";
10
- import "../chunks/chunk-BLCJHP5H.js";
9
+ } from "../chunks/chunk-QFC4ZHD3.js";
10
+ import "../chunks/chunk-45TXPJW7.js";
11
11
 
12
12
  // src/identity/keys.ts
13
13
  var emailKey = (email) => {