@signaliz/sdk 1.0.71 → 1.0.73

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.
package/README.md CHANGED
@@ -113,10 +113,13 @@ const copyFromSignalRun = await signaliz.signalToCopy({
113
113
  });
114
114
  // The copy result reuses the completed snapshot without rediscovery.
115
115
 
116
- const awareness = await signaliz.signalAwareness({
117
- action: 'list_signals',
118
- monitorId: 'monitor-uuid',
116
+ const monitor = await signaliz.createSignalMonitor({
117
+ companyName: 'Acme',
118
+ domain: 'acme.com',
119
+ schedule: 'daily',
119
120
  });
121
+ await signaliz.updateSignalMonitor(monitor.monitor?.id!, { schedule: 'weekly' });
122
+ const awareness = await signaliz.listSignalAwarenessSignals(monitor.monitor?.id);
120
123
  console.log(
121
124
  awareness.signals?.[0].signal_type,
122
125
  awareness.signals?.[0].source,
@@ -124,6 +127,8 @@ console.log(
124
127
  awareness.signals?.[0].company_name,
125
128
  awareness.signals?.[0].domain,
126
129
  );
130
+ // Awareness runs the same fixed, type-agnostic evidence engine as Company
131
+ // Signal Enrichment. Use scheduleCron for an exact UTC schedule.
127
132
 
128
133
  // Flow uses the same versioned REST gateway as every other SDK capability.
129
134
  const flow = await signaliz.startFlow({
@@ -225,7 +230,7 @@ Single calls and synchronous batches of at most 25 may instead pass
225
230
  Durable batches of 26-5,000 reject these references rather than silently
226
231
  starting new research.
227
232
 
228
- Signals Everything is query-first rather than a row batch. It defaults to 100
233
+ Signals First is query-first rather than a row batch. It defaults to 100
229
234
  distinct companies and supports up to 1,000. Every returned signal row contains
230
235
  only a signal type, verified source URL, event date, company name, and domain.
231
236
  A request is a ceiling, not a promise: it can return fewer results
@@ -822,6 +822,43 @@ var Signaliz = class {
822
822
  async runSignalMonitor(monitorId, idempotencyKey) {
823
823
  return this.signalAwareness({ action: "manual_run", monitorId, idempotencyKey });
824
824
  }
825
+ async updateSignalMonitor(monitorId, updates) {
826
+ return this.signalAwareness({ action: "update", monitorId, updates });
827
+ }
828
+ async pauseSignalMonitor(monitorId) {
829
+ return this.updateSignalMonitor(monitorId, { status: "paused" });
830
+ }
831
+ async resumeSignalMonitor(monitorId) {
832
+ return this.updateSignalMonitor(monitorId, { status: "active" });
833
+ }
834
+ async deleteSignalMonitor(monitorId) {
835
+ return this.signalAwareness({ action: "delete", monitorId });
836
+ }
837
+ async listSignalAwarenessSignals(monitorId, limit, offset) {
838
+ return this.signalAwareness({ action: "list_signals", monitorId, limit, offset });
839
+ }
840
+ async bulkCreateSignalMonitors(monitors, defaults) {
841
+ return this.signalAwareness({ action: "bulk_import", monitors, defaults });
842
+ }
843
+ async getSignalAwarenessSettings() {
844
+ return this.signalAwareness({ action: "get_settings" });
845
+ }
846
+ async setSignalAwarenessOutput(outputMode, webhookUrl) {
847
+ return this.signalAwareness({
848
+ action: "set_global_webhook",
849
+ enabled: outputMode === "webhook",
850
+ webhookUrl: outputMode === "webhook" ? webhookUrl : null
851
+ });
852
+ }
853
+ async testSignalAwarenessWebhook(webhookUrl) {
854
+ return this.signalAwareness({ action: "test_webhook", webhookUrl });
855
+ }
856
+ async exportSignalAwareness(monitorId) {
857
+ return this.signalAwareness({ action: "export", monitorId });
858
+ }
859
+ async sendSignalAwarenessExport(signals) {
860
+ return this.signalAwareness({ action: "send_signal_export", signals });
861
+ }
825
862
  async findEmail(params) {
826
863
  const request = findEmailRequestBody(params);
827
864
  assertFindEmailRequestIdentity(request);
@@ -1887,6 +1924,16 @@ function normalizeFindEmailResult(data) {
1887
1924
  success: processing || !failed && found,
1888
1925
  found,
1889
1926
  email,
1927
+ checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
1928
+ candidateSource: typeof data.candidate_source === "string" ? data.candidate_source : null,
1929
+ primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
1930
+ primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
1931
+ terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
1932
+ terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
1933
+ terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
1934
+ terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
1935
+ terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
1936
+ bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
1890
1937
  firstName: data.first_name,
1891
1938
  lastName: data.last_name,
1892
1939
  confidence: failed ? 0 : data.confidence ?? data.confidence_score ?? (verified ? 1 : 0),
@@ -1926,6 +1973,19 @@ function normalizeFindEmailResult(data) {
1926
1973
  function normalizeVerifyEmailResult(email, data) {
1927
1974
  data = publicProductData(data, "verify_email");
1928
1975
  const failed = coreProductResponseFailed(data);
1976
+ const publicIsCatchAll = data.is_catch_all === true || data.email_is_catch_all === true;
1977
+ const publicPrimaryResult = String(data.primary_verdict ?? "").toLowerCase();
1978
+ const publicTerminalResult = String(data.terminal_result ?? "").toLowerCase();
1979
+ const okToSend = !failed && (data.ok_to_send === true || publicPrimaryResult === "ok" || publicPrimaryResult === "catch_all" && publicTerminalResult === "deliverable");
1980
+ return {
1981
+ email: typeof data.email === "string" ? data.email : email || null,
1982
+ status: String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
1983
+ isCatchAll: publicIsCatchAll,
1984
+ creditsCharged: Number.isFinite(Number(data.credits_charged)) ? Number(data.credits_charged) : 0,
1985
+ okToSend,
1986
+ ...data.verification_run_id || data.run_id ? { verificationRunId: data.verification_run_id ?? data.run_id } : {},
1987
+ ...data.next_poll_after_seconds !== void 0 ? { nextPollAfterSeconds: data.next_poll_after_seconds } : {}
1988
+ };
1929
1989
  const malformed = data.is_malformed === true || data.verification_verdict === "malformed" || data.verification_status === "malformed" || data.deliverability_status === "malformed";
1930
1990
  const verificationStatus = normalizeVerifyEmailStatus(
1931
1991
  failed ? malformed ? "malformed" : "error" : data.verification_status ?? data.verification_verdict ?? data.deliverability_status ?? "unknown"
@@ -1940,6 +2000,15 @@ function normalizeVerifyEmailResult(email, data) {
1940
2000
  error: failed ? coreProductErrorMessage(data) : void 0,
1941
2001
  errorCode: failed ? coreProductErrorCode(data) : void 0,
1942
2002
  email: data.email ?? email,
2003
+ checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
2004
+ primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
2005
+ primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
2006
+ terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
2007
+ terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
2008
+ terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
2009
+ terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
2010
+ terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
2011
+ bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
1943
2012
  status: !failed && String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
1944
2013
  verificationRunId,
1945
2014
  retryAfterMs: data.retry_after_ms,
@@ -2203,7 +2272,7 @@ function validateSignalDiscoveryParams(params) {
2203
2272
  const runId = typeof params.signalSearchRunId === "string" ? params.signalSearchRunId.trim() : "";
2204
2273
  const query = typeof params.query === "string" ? params.query.trim() : "";
2205
2274
  if (!runId && !query) {
2206
- throw new TypeError("Signals Everything requires query or signalSearchRunId");
2275
+ throw new TypeError("Signals First requires query or signalSearchRunId");
2207
2276
  }
2208
2277
  if (query && (query.length < 2 || query.length > 2e3)) {
2209
2278
  throw new RangeError("query must contain between 2 and 2000 characters");
@@ -2611,24 +2680,50 @@ function normalizeSignalToCopyResult(data) {
2611
2680
  raw: data
2612
2681
  };
2613
2682
  }
2683
+ var SIGNAL_AWARENESS_SCHEDULES = {
2684
+ every_6_hours: "0 */6 * * *",
2685
+ daily: "0 8 * * *",
2686
+ every_2_days: "0 8 */2 * *",
2687
+ weekly: "0 8 * * 1",
2688
+ monthly: "0 8 1 * *"
2689
+ };
2690
+ function signalAwarenessScheduleCron(value) {
2691
+ return value.scheduleCron || (value.schedule ? SIGNAL_AWARENESS_SCHEDULES[value.schedule] : void 0);
2692
+ }
2614
2693
  function signalAwarenessMonitorRequest(monitor) {
2615
2694
  return compact({
2616
2695
  company_name: monitor.companyName,
2617
2696
  domain: monitor.domain,
2618
- template: monitor.template,
2619
- signal_config: monitor.signalConfig,
2620
- schedule_cron: monitor.scheduleCron,
2697
+ schedule_cron: signalAwarenessScheduleCron(monitor),
2621
2698
  webhook_url: monitor.webhookUrl
2622
2699
  });
2623
2700
  }
2701
+ function signalAwarenessMonitorDefaultsRequest(defaults) {
2702
+ return compact({
2703
+ schedule_cron: signalAwarenessScheduleCron(defaults),
2704
+ webhook_url: defaults.webhookUrl
2705
+ });
2706
+ }
2707
+ function signalAwarenessMonitorUpdateRequest(updates) {
2708
+ return compact({
2709
+ company_name: updates.companyName,
2710
+ schedule_cron: signalAwarenessScheduleCron(updates),
2711
+ status: updates.status,
2712
+ webhook_url: updates.webhookUrl
2713
+ });
2714
+ }
2624
2715
  function signalAwarenessRequestBody(request) {
2625
2716
  return compact({
2626
2717
  action: request.action,
2627
2718
  monitor_id: request.monitorId,
2628
2719
  monitor: request.monitor ? signalAwarenessMonitorRequest(request.monitor) : void 0,
2629
2720
  monitors: request.monitors?.map(signalAwarenessMonitorRequest),
2630
- defaults: request.defaults,
2631
- updates: request.updates,
2721
+ defaults: request.defaults ? signalAwarenessMonitorDefaultsRequest(request.defaults) : void 0,
2722
+ updates: request.updates ? signalAwarenessMonitorUpdateRequest(request.updates) : void 0,
2723
+ enabled: request.enabled,
2724
+ webhook_url: request.webhookUrl,
2725
+ signal_ids: request.signalIds,
2726
+ signals: request.signals,
2632
2727
  limit: request.limit,
2633
2728
  offset: request.offset,
2634
2729
  idempotency_key: request.idempotencyKey,
@@ -2637,7 +2732,7 @@ function signalAwarenessRequestBody(request) {
2637
2732
  }
2638
2733
  function normalizeSignalAwarenessResponse(data) {
2639
2734
  const payload = data.data && typeof data.data === "object" ? data.data : data;
2640
- const signals = Array.isArray(payload.signals) ? oneSignalPerCompany(payload.signals.flatMap(normalizeSignalAwarenessSignal)) : void 0;
2735
+ const signals = Array.isArray(payload.signals) ? payload.signals.flatMap(normalizeSignalAwarenessSignal) : void 0;
2641
2736
  const monitors = Array.isArray(payload.monitors) ? payload.monitors.map(normalizeSignalAwarenessMonitor).filter((value) => value !== void 0) : void 0;
2642
2737
  const monitor = normalizeSignalAwarenessMonitor(payload.monitor);
2643
2738
  const run = normalizeSignalAwarenessRun(payload.run);
@@ -2655,6 +2750,18 @@ function normalizeSignalAwarenessResponse(data) {
2655
2750
  ...Number.isInteger(creditsUsed) && creditsUsed >= 0 ? { creditsUsed } : {},
2656
2751
  ...Number.isFinite(Number(payload.created)) ? { created: Number(payload.created) } : {},
2657
2752
  ...Number.isFinite(Number(payload.skipped)) ? { skipped: Number(payload.skipped) } : {},
2753
+ ...Number.isFinite(Number(payload.delivered)) ? { delivered: Number(payload.delivered) } : {},
2754
+ ...Array.isArray(payload.errors) ? {
2755
+ errors: payload.errors.flatMap((item) => {
2756
+ const error = signalAwarenessRecord(item);
2757
+ const row = signalAwarenessCount(error.row);
2758
+ const message = signalAwarenessText(error.error, 500);
2759
+ return row !== void 0 && message ? [{ row, error: message }] : [];
2760
+ })
2761
+ } : {},
2762
+ ...payload.output_mode === "csv" || payload.output_mode === "webhook" ? { outputMode: payload.output_mode } : {},
2763
+ ...payload.webhook_url === null || typeof payload.webhook_url === "string" ? { webhookUrl: payload.webhook_url } : {},
2764
+ ...Number.isInteger(Number(payload.webhook_status)) ? { webhookStatus: Number(payload.webhook_status) } : {},
2658
2765
  ...Number.isFinite(Number(payload.total)) ? { total: Number(payload.total) } : {},
2659
2766
  ...Number.isFinite(Number(payload.limit)) ? { limit: Number(payload.limit) } : {},
2660
2767
  ...Number.isFinite(Number(payload.offset)) ? { offset: Number(payload.offset) } : {},
@@ -2680,11 +2787,21 @@ function normalizeSignalAwarenessMonitor(value) {
2680
2787
  const domain = signalAwarenessText(monitor.domain, 253);
2681
2788
  const status = signalAwarenessText(monitor.status, 80);
2682
2789
  const schedule = signalAwarenessText(monitor.schedule, 120);
2790
+ const scheduleCron = signalAwarenessText(monitor.schedule_cron, 120);
2683
2791
  if (id) result.id = id;
2684
2792
  if (companyName) result.company_name = companyName;
2685
2793
  if (domain) result.domain = domain;
2686
2794
  if (status) result.status = status;
2687
2795
  if (schedule) result.schedule = schedule;
2796
+ if (scheduleCron) result.schedule_cron = scheduleCron;
2797
+ if (monitor.webhook_url === null || typeof monitor.webhook_url === "string") result.webhook_url = monitor.webhook_url;
2798
+ for (const key of ["total_runs", "total_signals_found", "consecutive_failures"]) {
2799
+ const value2 = signalAwarenessCount(monitor[key]);
2800
+ if (value2 !== void 0) result[key] = value2;
2801
+ }
2802
+ if (typeof monitor.auto_paused === "boolean") result.auto_paused = monitor.auto_paused;
2803
+ const autoPauseReason = signalAwarenessText(monitor.auto_pause_reason, 500);
2804
+ if (autoPauseReason) result.auto_pause_reason = autoPauseReason;
2688
2805
  for (const key of ["last_run_at", "next_run_at", "created_at", "updated_at"]) {
2689
2806
  const timestamp = signalAwarenessText(monitor[key], 64);
2690
2807
  if (timestamp && Number.isFinite(Date.parse(timestamp))) result[key] = timestamp;
package/dist/index.d.mts CHANGED
@@ -7,11 +7,23 @@ interface SignalizConfig {
7
7
  maxRetries?: number;
8
8
  }
9
9
  type SignalAwarenessAction = 'create' | 'list' | 'update' | 'delete' | 'manual_run' | 'list_signals' | 'bulk_import' | 'get_settings' | 'set_global_webhook' | 'test_webhook' | 'export' | 'send_signal_export';
10
+ type SignalAwarenessSchedulePreset = 'every_6_hours' | 'daily' | 'every_2_days' | 'weekly' | 'monthly';
10
11
  interface SignalMonitorInput {
11
12
  companyName: string;
12
13
  domain: string;
13
- template?: 'full_intelligence' | 'basic';
14
- signalConfig?: Record<string, unknown>;
14
+ schedule?: SignalAwarenessSchedulePreset;
15
+ scheduleCron?: string;
16
+ webhookUrl?: string | null;
17
+ }
18
+ interface SignalMonitorUpdateInput {
19
+ companyName?: string;
20
+ schedule?: SignalAwarenessSchedulePreset;
21
+ scheduleCron?: string;
22
+ status?: 'active' | 'paused';
23
+ webhookUrl?: string | null;
24
+ }
25
+ interface SignalMonitorDefaults {
26
+ schedule?: SignalAwarenessSchedulePreset;
15
27
  scheduleCron?: string;
16
28
  webhookUrl?: string | null;
17
29
  }
@@ -20,8 +32,12 @@ interface SignalAwarenessRequest {
20
32
  monitorId?: string;
21
33
  monitor?: SignalMonitorInput;
22
34
  monitors?: SignalMonitorInput[];
23
- defaults?: Record<string, unknown>;
24
- updates?: Record<string, unknown>;
35
+ defaults?: SignalMonitorDefaults;
36
+ updates?: SignalMonitorUpdateInput;
37
+ enabled?: boolean;
38
+ webhookUrl?: string | null;
39
+ signalIds?: string[];
40
+ signals?: SignalAwarenessSignal[];
25
41
  limit?: number;
26
42
  offset?: number;
27
43
  idempotencyKey?: string;
@@ -33,6 +49,13 @@ interface SignalAwarenessMonitor {
33
49
  domain?: string;
34
50
  status?: string;
35
51
  schedule?: string;
52
+ schedule_cron?: string;
53
+ webhook_url?: string | null;
54
+ total_runs?: number;
55
+ total_signals_found?: number;
56
+ consecutive_failures?: number;
57
+ auto_paused?: boolean;
58
+ auto_pause_reason?: string;
36
59
  last_run_at?: string;
37
60
  next_run_at?: string;
38
61
  created_at?: string;
@@ -70,6 +93,14 @@ interface SignalAwarenessResponse {
70
93
  creditsUsed?: number;
71
94
  created?: number;
72
95
  skipped?: number;
96
+ delivered?: number;
97
+ errors?: Array<{
98
+ row: number;
99
+ error: string;
100
+ }>;
101
+ outputMode?: 'csv' | 'webhook';
102
+ webhookUrl?: string | null;
103
+ webhookStatus?: number;
73
104
  total?: number;
74
105
  limit?: number;
75
106
  offset?: number;
@@ -225,6 +256,17 @@ interface FindEmailResult {
225
256
  success: boolean;
226
257
  found: boolean;
227
258
  email: string | null;
259
+ /** The mailbox checked even when it was not safe to send. */
260
+ checkedEmail?: string | null;
261
+ candidateSource?: string | null;
262
+ primaryVerifier?: string | null;
263
+ primaryVerdict?: string | null;
264
+ terminalVerifier?: string | null;
265
+ terminalVerdict?: string | null;
266
+ terminalResult?: string | null;
267
+ terminalIsCatchAll?: boolean | null;
268
+ terminalIsAcceptAll?: boolean | null;
269
+ bouncebanId?: string | null;
228
270
  firstName?: string;
229
271
  lastName?: string;
230
272
  confidence: number;
@@ -269,45 +311,13 @@ interface FindEmailResult {
269
311
  type VerifyEmailStatus = 'valid' | 'invalid' | 'catch_all' | 'role' | 'disposable' | 'unknown' | 'verifier_error' | 'malformed' | 'error';
270
312
  type VerifyEmailRecommendation = 'send' | 'do_not_send' | 'manual_review';
271
313
  interface VerifyEmailResult {
272
- success: boolean;
273
- error?: string;
274
- errorCode?: string;
275
- email: string;
276
- /** Execution state. Processing results are never send-safe. */
314
+ email: string | null;
277
315
  status: 'processing' | 'completed';
278
- /** Durable Trigger run id for resuming a long verification. */
316
+ isCatchAll: boolean;
317
+ creditsCharged: number;
318
+ okToSend: boolean;
279
319
  verificationRunId?: string;
280
- retryAfterMs?: number;
281
320
  nextPollAfterSeconds?: number;
282
- isValid: boolean;
283
- isDeliverable: boolean;
284
- /** True when the address failed syntax validation before any provider call. */
285
- isMalformed: boolean;
286
- isCatchAll: boolean;
287
- /** Explicit send-safety verdict. Missing or false never becomes true by inference. */
288
- verifiedForSending: boolean;
289
- verificationStatus?: VerifyEmailStatus;
290
- deliverabilityStatus?: VerifyEmailStatus;
291
- verificationVerdict: VerifyEmailStatus;
292
- isRoleAccount?: boolean;
293
- quality?: string | null;
294
- recommendation?: VerifyEmailRecommendation;
295
- smtpStatus?: string;
296
- providerStatus?: string;
297
- failureReason?: string;
298
- confidenceScore: number;
299
- provider?: string;
300
- verificationSource?: string;
301
- /** ISO timestamp when the provider observed the winning verdict. */
302
- verificationObservedAt?: string;
303
- billingReplayed?: boolean;
304
- /** True when the public result came from a completed response-idempotency reservation. */
305
- idempotencyReplayed?: boolean;
306
- creditsUsed?: number;
307
- /** Canonical run ID alias returned alongside verificationRunId when available. */
308
- runId?: string;
309
- suggestedAction?: string;
310
- raw: Record<string, unknown>;
311
321
  }
312
322
  interface VerifyEmailOptions {
313
323
  /** Resume an existing long verification without another provider call. */
@@ -577,6 +587,17 @@ declare class Signaliz {
577
587
  createSignalMonitor(monitor: SignalMonitorInput): Promise<SignalAwarenessResponse>;
578
588
  listSignalMonitors(limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
579
589
  runSignalMonitor(monitorId: string, idempotencyKey?: string): Promise<SignalAwarenessResponse>;
590
+ updateSignalMonitor(monitorId: string, updates: SignalMonitorUpdateInput): Promise<SignalAwarenessResponse>;
591
+ pauseSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
592
+ resumeSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
593
+ deleteSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
594
+ listSignalAwarenessSignals(monitorId?: string, limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
595
+ bulkCreateSignalMonitors(monitors: SignalMonitorInput[], defaults?: SignalMonitorDefaults): Promise<SignalAwarenessResponse>;
596
+ getSignalAwarenessSettings(): Promise<SignalAwarenessResponse>;
597
+ setSignalAwarenessOutput(outputMode: 'csv' | 'webhook', webhookUrl?: string | null): Promise<SignalAwarenessResponse>;
598
+ testSignalAwarenessWebhook(webhookUrl: string): Promise<SignalAwarenessResponse>;
599
+ exportSignalAwareness(monitorId?: string): Promise<SignalAwarenessResponse>;
600
+ sendSignalAwarenessExport(signals: SignalAwarenessSignal[]): Promise<SignalAwarenessResponse>;
580
601
  findEmail(params: FindEmailParams & {
581
602
  dryRun: true;
582
603
  }): Promise<CoreProductDryRunResult>;
@@ -638,4 +659,4 @@ declare class Signaliz {
638
659
  health(): Promise<PlatformHealth>;
639
660
  }
640
661
 
641
- export { type BatchItemResult, type BatchOptions, type BatchResult, type CompanySignal, type CompanySignalEnrichmentParams, type CompanySignalEnrichmentResult, type CoreBatchResumeOptions, type CoreEmailBatchResumeOptions, type ErrorType, type FindEmailParams, type FindEmailResult, type MCPToolInfo, type PlatformHealth, type PublicSignalRow, type RecoverableBatchJob, type SignalAwarenessAction, type SignalAwarenessMonitor, type SignalAwarenessRequest, type SignalAwarenessResponse, type SignalAwarenessRun, type SignalAwarenessSignal, type SignalDiscoveryParams, type SignalDiscoveryResult, type SignalDiscoverySignal, type SignalDiscoverySource, type SignalDiscoveryStatus, type SignalMonitorInput, type SignalToCopyParams, type SignalToCopyResult, type SignalToCopyVariation, Signaliz, type SignalizConfig, SignalizError, type SignalizErrorData, type SignalizFlowBillingReceipt, type SignalizFlowParams, type SignalizFlowPlan, type SignalizFlowPlanResult, type SignalizFlowReceiptLine, type SignalizFlowStartResult, type SignalizFlowStatus, type VerifyEmailBatchInput, type VerifyEmailBatchOptions, type VerifyEmailOptions, type VerifyEmailRecommendation, type VerifyEmailResult, type VerifyEmailStatus };
662
+ export { type BatchItemResult, type BatchOptions, type BatchResult, type CompanySignal, type CompanySignalEnrichmentParams, type CompanySignalEnrichmentResult, type CoreBatchResumeOptions, type CoreEmailBatchResumeOptions, type ErrorType, type FindEmailParams, type FindEmailResult, type MCPToolInfo, type PlatformHealth, type PublicSignalRow, type RecoverableBatchJob, type SignalAwarenessAction, type SignalAwarenessMonitor, type SignalAwarenessRequest, type SignalAwarenessResponse, type SignalAwarenessRun, type SignalAwarenessSchedulePreset, type SignalAwarenessSignal, type SignalDiscoveryParams, type SignalDiscoveryResult, type SignalDiscoverySignal, type SignalDiscoverySource, type SignalDiscoveryStatus, type SignalMonitorDefaults, type SignalMonitorInput, type SignalMonitorUpdateInput, type SignalToCopyParams, type SignalToCopyResult, type SignalToCopyVariation, Signaliz, type SignalizConfig, SignalizError, type SignalizErrorData, type SignalizFlowBillingReceipt, type SignalizFlowParams, type SignalizFlowPlan, type SignalizFlowPlanResult, type SignalizFlowReceiptLine, type SignalizFlowStartResult, type SignalizFlowStatus, type VerifyEmailBatchInput, type VerifyEmailBatchOptions, type VerifyEmailOptions, type VerifyEmailRecommendation, type VerifyEmailResult, type VerifyEmailStatus };
package/dist/index.d.ts CHANGED
@@ -7,11 +7,23 @@ interface SignalizConfig {
7
7
  maxRetries?: number;
8
8
  }
9
9
  type SignalAwarenessAction = 'create' | 'list' | 'update' | 'delete' | 'manual_run' | 'list_signals' | 'bulk_import' | 'get_settings' | 'set_global_webhook' | 'test_webhook' | 'export' | 'send_signal_export';
10
+ type SignalAwarenessSchedulePreset = 'every_6_hours' | 'daily' | 'every_2_days' | 'weekly' | 'monthly';
10
11
  interface SignalMonitorInput {
11
12
  companyName: string;
12
13
  domain: string;
13
- template?: 'full_intelligence' | 'basic';
14
- signalConfig?: Record<string, unknown>;
14
+ schedule?: SignalAwarenessSchedulePreset;
15
+ scheduleCron?: string;
16
+ webhookUrl?: string | null;
17
+ }
18
+ interface SignalMonitorUpdateInput {
19
+ companyName?: string;
20
+ schedule?: SignalAwarenessSchedulePreset;
21
+ scheduleCron?: string;
22
+ status?: 'active' | 'paused';
23
+ webhookUrl?: string | null;
24
+ }
25
+ interface SignalMonitorDefaults {
26
+ schedule?: SignalAwarenessSchedulePreset;
15
27
  scheduleCron?: string;
16
28
  webhookUrl?: string | null;
17
29
  }
@@ -20,8 +32,12 @@ interface SignalAwarenessRequest {
20
32
  monitorId?: string;
21
33
  monitor?: SignalMonitorInput;
22
34
  monitors?: SignalMonitorInput[];
23
- defaults?: Record<string, unknown>;
24
- updates?: Record<string, unknown>;
35
+ defaults?: SignalMonitorDefaults;
36
+ updates?: SignalMonitorUpdateInput;
37
+ enabled?: boolean;
38
+ webhookUrl?: string | null;
39
+ signalIds?: string[];
40
+ signals?: SignalAwarenessSignal[];
25
41
  limit?: number;
26
42
  offset?: number;
27
43
  idempotencyKey?: string;
@@ -33,6 +49,13 @@ interface SignalAwarenessMonitor {
33
49
  domain?: string;
34
50
  status?: string;
35
51
  schedule?: string;
52
+ schedule_cron?: string;
53
+ webhook_url?: string | null;
54
+ total_runs?: number;
55
+ total_signals_found?: number;
56
+ consecutive_failures?: number;
57
+ auto_paused?: boolean;
58
+ auto_pause_reason?: string;
36
59
  last_run_at?: string;
37
60
  next_run_at?: string;
38
61
  created_at?: string;
@@ -70,6 +93,14 @@ interface SignalAwarenessResponse {
70
93
  creditsUsed?: number;
71
94
  created?: number;
72
95
  skipped?: number;
96
+ delivered?: number;
97
+ errors?: Array<{
98
+ row: number;
99
+ error: string;
100
+ }>;
101
+ outputMode?: 'csv' | 'webhook';
102
+ webhookUrl?: string | null;
103
+ webhookStatus?: number;
73
104
  total?: number;
74
105
  limit?: number;
75
106
  offset?: number;
@@ -225,6 +256,17 @@ interface FindEmailResult {
225
256
  success: boolean;
226
257
  found: boolean;
227
258
  email: string | null;
259
+ /** The mailbox checked even when it was not safe to send. */
260
+ checkedEmail?: string | null;
261
+ candidateSource?: string | null;
262
+ primaryVerifier?: string | null;
263
+ primaryVerdict?: string | null;
264
+ terminalVerifier?: string | null;
265
+ terminalVerdict?: string | null;
266
+ terminalResult?: string | null;
267
+ terminalIsCatchAll?: boolean | null;
268
+ terminalIsAcceptAll?: boolean | null;
269
+ bouncebanId?: string | null;
228
270
  firstName?: string;
229
271
  lastName?: string;
230
272
  confidence: number;
@@ -269,45 +311,13 @@ interface FindEmailResult {
269
311
  type VerifyEmailStatus = 'valid' | 'invalid' | 'catch_all' | 'role' | 'disposable' | 'unknown' | 'verifier_error' | 'malformed' | 'error';
270
312
  type VerifyEmailRecommendation = 'send' | 'do_not_send' | 'manual_review';
271
313
  interface VerifyEmailResult {
272
- success: boolean;
273
- error?: string;
274
- errorCode?: string;
275
- email: string;
276
- /** Execution state. Processing results are never send-safe. */
314
+ email: string | null;
277
315
  status: 'processing' | 'completed';
278
- /** Durable Trigger run id for resuming a long verification. */
316
+ isCatchAll: boolean;
317
+ creditsCharged: number;
318
+ okToSend: boolean;
279
319
  verificationRunId?: string;
280
- retryAfterMs?: number;
281
320
  nextPollAfterSeconds?: number;
282
- isValid: boolean;
283
- isDeliverable: boolean;
284
- /** True when the address failed syntax validation before any provider call. */
285
- isMalformed: boolean;
286
- isCatchAll: boolean;
287
- /** Explicit send-safety verdict. Missing or false never becomes true by inference. */
288
- verifiedForSending: boolean;
289
- verificationStatus?: VerifyEmailStatus;
290
- deliverabilityStatus?: VerifyEmailStatus;
291
- verificationVerdict: VerifyEmailStatus;
292
- isRoleAccount?: boolean;
293
- quality?: string | null;
294
- recommendation?: VerifyEmailRecommendation;
295
- smtpStatus?: string;
296
- providerStatus?: string;
297
- failureReason?: string;
298
- confidenceScore: number;
299
- provider?: string;
300
- verificationSource?: string;
301
- /** ISO timestamp when the provider observed the winning verdict. */
302
- verificationObservedAt?: string;
303
- billingReplayed?: boolean;
304
- /** True when the public result came from a completed response-idempotency reservation. */
305
- idempotencyReplayed?: boolean;
306
- creditsUsed?: number;
307
- /** Canonical run ID alias returned alongside verificationRunId when available. */
308
- runId?: string;
309
- suggestedAction?: string;
310
- raw: Record<string, unknown>;
311
321
  }
312
322
  interface VerifyEmailOptions {
313
323
  /** Resume an existing long verification without another provider call. */
@@ -577,6 +587,17 @@ declare class Signaliz {
577
587
  createSignalMonitor(monitor: SignalMonitorInput): Promise<SignalAwarenessResponse>;
578
588
  listSignalMonitors(limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
579
589
  runSignalMonitor(monitorId: string, idempotencyKey?: string): Promise<SignalAwarenessResponse>;
590
+ updateSignalMonitor(monitorId: string, updates: SignalMonitorUpdateInput): Promise<SignalAwarenessResponse>;
591
+ pauseSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
592
+ resumeSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
593
+ deleteSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
594
+ listSignalAwarenessSignals(monitorId?: string, limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
595
+ bulkCreateSignalMonitors(monitors: SignalMonitorInput[], defaults?: SignalMonitorDefaults): Promise<SignalAwarenessResponse>;
596
+ getSignalAwarenessSettings(): Promise<SignalAwarenessResponse>;
597
+ setSignalAwarenessOutput(outputMode: 'csv' | 'webhook', webhookUrl?: string | null): Promise<SignalAwarenessResponse>;
598
+ testSignalAwarenessWebhook(webhookUrl: string): Promise<SignalAwarenessResponse>;
599
+ exportSignalAwareness(monitorId?: string): Promise<SignalAwarenessResponse>;
600
+ sendSignalAwarenessExport(signals: SignalAwarenessSignal[]): Promise<SignalAwarenessResponse>;
580
601
  findEmail(params: FindEmailParams & {
581
602
  dryRun: true;
582
603
  }): Promise<CoreProductDryRunResult>;
@@ -638,4 +659,4 @@ declare class Signaliz {
638
659
  health(): Promise<PlatformHealth>;
639
660
  }
640
661
 
641
- export { type BatchItemResult, type BatchOptions, type BatchResult, type CompanySignal, type CompanySignalEnrichmentParams, type CompanySignalEnrichmentResult, type CoreBatchResumeOptions, type CoreEmailBatchResumeOptions, type ErrorType, type FindEmailParams, type FindEmailResult, type MCPToolInfo, type PlatformHealth, type PublicSignalRow, type RecoverableBatchJob, type SignalAwarenessAction, type SignalAwarenessMonitor, type SignalAwarenessRequest, type SignalAwarenessResponse, type SignalAwarenessRun, type SignalAwarenessSignal, type SignalDiscoveryParams, type SignalDiscoveryResult, type SignalDiscoverySignal, type SignalDiscoverySource, type SignalDiscoveryStatus, type SignalMonitorInput, type SignalToCopyParams, type SignalToCopyResult, type SignalToCopyVariation, Signaliz, type SignalizConfig, SignalizError, type SignalizErrorData, type SignalizFlowBillingReceipt, type SignalizFlowParams, type SignalizFlowPlan, type SignalizFlowPlanResult, type SignalizFlowReceiptLine, type SignalizFlowStartResult, type SignalizFlowStatus, type VerifyEmailBatchInput, type VerifyEmailBatchOptions, type VerifyEmailOptions, type VerifyEmailRecommendation, type VerifyEmailResult, type VerifyEmailStatus };
662
+ export { type BatchItemResult, type BatchOptions, type BatchResult, type CompanySignal, type CompanySignalEnrichmentParams, type CompanySignalEnrichmentResult, type CoreBatchResumeOptions, type CoreEmailBatchResumeOptions, type ErrorType, type FindEmailParams, type FindEmailResult, type MCPToolInfo, type PlatformHealth, type PublicSignalRow, type RecoverableBatchJob, type SignalAwarenessAction, type SignalAwarenessMonitor, type SignalAwarenessRequest, type SignalAwarenessResponse, type SignalAwarenessRun, type SignalAwarenessSchedulePreset, type SignalAwarenessSignal, type SignalDiscoveryParams, type SignalDiscoveryResult, type SignalDiscoverySignal, type SignalDiscoverySource, type SignalDiscoveryStatus, type SignalMonitorDefaults, type SignalMonitorInput, type SignalMonitorUpdateInput, type SignalToCopyParams, type SignalToCopyResult, type SignalToCopyVariation, Signaliz, type SignalizConfig, SignalizError, type SignalizErrorData, type SignalizFlowBillingReceipt, type SignalizFlowParams, type SignalizFlowPlan, type SignalizFlowPlanResult, type SignalizFlowReceiptLine, type SignalizFlowStartResult, type SignalizFlowStatus, type VerifyEmailBatchInput, type VerifyEmailBatchOptions, type VerifyEmailOptions, type VerifyEmailRecommendation, type VerifyEmailResult, type VerifyEmailStatus };
package/dist/index.js CHANGED
@@ -849,6 +849,43 @@ var Signaliz = class {
849
849
  async runSignalMonitor(monitorId, idempotencyKey) {
850
850
  return this.signalAwareness({ action: "manual_run", monitorId, idempotencyKey });
851
851
  }
852
+ async updateSignalMonitor(monitorId, updates) {
853
+ return this.signalAwareness({ action: "update", monitorId, updates });
854
+ }
855
+ async pauseSignalMonitor(monitorId) {
856
+ return this.updateSignalMonitor(monitorId, { status: "paused" });
857
+ }
858
+ async resumeSignalMonitor(monitorId) {
859
+ return this.updateSignalMonitor(monitorId, { status: "active" });
860
+ }
861
+ async deleteSignalMonitor(monitorId) {
862
+ return this.signalAwareness({ action: "delete", monitorId });
863
+ }
864
+ async listSignalAwarenessSignals(monitorId, limit, offset) {
865
+ return this.signalAwareness({ action: "list_signals", monitorId, limit, offset });
866
+ }
867
+ async bulkCreateSignalMonitors(monitors, defaults) {
868
+ return this.signalAwareness({ action: "bulk_import", monitors, defaults });
869
+ }
870
+ async getSignalAwarenessSettings() {
871
+ return this.signalAwareness({ action: "get_settings" });
872
+ }
873
+ async setSignalAwarenessOutput(outputMode, webhookUrl) {
874
+ return this.signalAwareness({
875
+ action: "set_global_webhook",
876
+ enabled: outputMode === "webhook",
877
+ webhookUrl: outputMode === "webhook" ? webhookUrl : null
878
+ });
879
+ }
880
+ async testSignalAwarenessWebhook(webhookUrl) {
881
+ return this.signalAwareness({ action: "test_webhook", webhookUrl });
882
+ }
883
+ async exportSignalAwareness(monitorId) {
884
+ return this.signalAwareness({ action: "export", monitorId });
885
+ }
886
+ async sendSignalAwarenessExport(signals) {
887
+ return this.signalAwareness({ action: "send_signal_export", signals });
888
+ }
852
889
  async findEmail(params) {
853
890
  const request = findEmailRequestBody(params);
854
891
  assertFindEmailRequestIdentity(request);
@@ -1914,6 +1951,16 @@ function normalizeFindEmailResult(data) {
1914
1951
  success: processing || !failed && found,
1915
1952
  found,
1916
1953
  email,
1954
+ checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
1955
+ candidateSource: typeof data.candidate_source === "string" ? data.candidate_source : null,
1956
+ primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
1957
+ primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
1958
+ terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
1959
+ terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
1960
+ terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
1961
+ terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
1962
+ terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
1963
+ bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
1917
1964
  firstName: data.first_name,
1918
1965
  lastName: data.last_name,
1919
1966
  confidence: failed ? 0 : data.confidence ?? data.confidence_score ?? (verified ? 1 : 0),
@@ -1953,6 +2000,19 @@ function normalizeFindEmailResult(data) {
1953
2000
  function normalizeVerifyEmailResult(email, data) {
1954
2001
  data = publicProductData(data, "verify_email");
1955
2002
  const failed = coreProductResponseFailed(data);
2003
+ const publicIsCatchAll = data.is_catch_all === true || data.email_is_catch_all === true;
2004
+ const publicPrimaryResult = String(data.primary_verdict ?? "").toLowerCase();
2005
+ const publicTerminalResult = String(data.terminal_result ?? "").toLowerCase();
2006
+ const okToSend = !failed && (data.ok_to_send === true || publicPrimaryResult === "ok" || publicPrimaryResult === "catch_all" && publicTerminalResult === "deliverable");
2007
+ return {
2008
+ email: typeof data.email === "string" ? data.email : email || null,
2009
+ status: String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
2010
+ isCatchAll: publicIsCatchAll,
2011
+ creditsCharged: Number.isFinite(Number(data.credits_charged)) ? Number(data.credits_charged) : 0,
2012
+ okToSend,
2013
+ ...data.verification_run_id || data.run_id ? { verificationRunId: data.verification_run_id ?? data.run_id } : {},
2014
+ ...data.next_poll_after_seconds !== void 0 ? { nextPollAfterSeconds: data.next_poll_after_seconds } : {}
2015
+ };
1956
2016
  const malformed = data.is_malformed === true || data.verification_verdict === "malformed" || data.verification_status === "malformed" || data.deliverability_status === "malformed";
1957
2017
  const verificationStatus = normalizeVerifyEmailStatus(
1958
2018
  failed ? malformed ? "malformed" : "error" : data.verification_status ?? data.verification_verdict ?? data.deliverability_status ?? "unknown"
@@ -1967,6 +2027,15 @@ function normalizeVerifyEmailResult(email, data) {
1967
2027
  error: failed ? coreProductErrorMessage(data) : void 0,
1968
2028
  errorCode: failed ? coreProductErrorCode(data) : void 0,
1969
2029
  email: data.email ?? email,
2030
+ checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
2031
+ primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
2032
+ primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
2033
+ terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
2034
+ terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
2035
+ terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
2036
+ terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
2037
+ terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
2038
+ bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
1970
2039
  status: !failed && String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
1971
2040
  verificationRunId,
1972
2041
  retryAfterMs: data.retry_after_ms,
@@ -2230,7 +2299,7 @@ function validateSignalDiscoveryParams(params) {
2230
2299
  const runId = typeof params.signalSearchRunId === "string" ? params.signalSearchRunId.trim() : "";
2231
2300
  const query = typeof params.query === "string" ? params.query.trim() : "";
2232
2301
  if (!runId && !query) {
2233
- throw new TypeError("Signals Everything requires query or signalSearchRunId");
2302
+ throw new TypeError("Signals First requires query or signalSearchRunId");
2234
2303
  }
2235
2304
  if (query && (query.length < 2 || query.length > 2e3)) {
2236
2305
  throw new RangeError("query must contain between 2 and 2000 characters");
@@ -2638,24 +2707,50 @@ function normalizeSignalToCopyResult(data) {
2638
2707
  raw: data
2639
2708
  };
2640
2709
  }
2710
+ var SIGNAL_AWARENESS_SCHEDULES = {
2711
+ every_6_hours: "0 */6 * * *",
2712
+ daily: "0 8 * * *",
2713
+ every_2_days: "0 8 */2 * *",
2714
+ weekly: "0 8 * * 1",
2715
+ monthly: "0 8 1 * *"
2716
+ };
2717
+ function signalAwarenessScheduleCron(value) {
2718
+ return value.scheduleCron || (value.schedule ? SIGNAL_AWARENESS_SCHEDULES[value.schedule] : void 0);
2719
+ }
2641
2720
  function signalAwarenessMonitorRequest(monitor) {
2642
2721
  return compact({
2643
2722
  company_name: monitor.companyName,
2644
2723
  domain: monitor.domain,
2645
- template: monitor.template,
2646
- signal_config: monitor.signalConfig,
2647
- schedule_cron: monitor.scheduleCron,
2724
+ schedule_cron: signalAwarenessScheduleCron(monitor),
2648
2725
  webhook_url: monitor.webhookUrl
2649
2726
  });
2650
2727
  }
2728
+ function signalAwarenessMonitorDefaultsRequest(defaults) {
2729
+ return compact({
2730
+ schedule_cron: signalAwarenessScheduleCron(defaults),
2731
+ webhook_url: defaults.webhookUrl
2732
+ });
2733
+ }
2734
+ function signalAwarenessMonitorUpdateRequest(updates) {
2735
+ return compact({
2736
+ company_name: updates.companyName,
2737
+ schedule_cron: signalAwarenessScheduleCron(updates),
2738
+ status: updates.status,
2739
+ webhook_url: updates.webhookUrl
2740
+ });
2741
+ }
2651
2742
  function signalAwarenessRequestBody(request) {
2652
2743
  return compact({
2653
2744
  action: request.action,
2654
2745
  monitor_id: request.monitorId,
2655
2746
  monitor: request.monitor ? signalAwarenessMonitorRequest(request.monitor) : void 0,
2656
2747
  monitors: request.monitors?.map(signalAwarenessMonitorRequest),
2657
- defaults: request.defaults,
2658
- updates: request.updates,
2748
+ defaults: request.defaults ? signalAwarenessMonitorDefaultsRequest(request.defaults) : void 0,
2749
+ updates: request.updates ? signalAwarenessMonitorUpdateRequest(request.updates) : void 0,
2750
+ enabled: request.enabled,
2751
+ webhook_url: request.webhookUrl,
2752
+ signal_ids: request.signalIds,
2753
+ signals: request.signals,
2659
2754
  limit: request.limit,
2660
2755
  offset: request.offset,
2661
2756
  idempotency_key: request.idempotencyKey,
@@ -2664,7 +2759,7 @@ function signalAwarenessRequestBody(request) {
2664
2759
  }
2665
2760
  function normalizeSignalAwarenessResponse(data) {
2666
2761
  const payload = data.data && typeof data.data === "object" ? data.data : data;
2667
- const signals = Array.isArray(payload.signals) ? oneSignalPerCompany(payload.signals.flatMap(normalizeSignalAwarenessSignal)) : void 0;
2762
+ const signals = Array.isArray(payload.signals) ? payload.signals.flatMap(normalizeSignalAwarenessSignal) : void 0;
2668
2763
  const monitors = Array.isArray(payload.monitors) ? payload.monitors.map(normalizeSignalAwarenessMonitor).filter((value) => value !== void 0) : void 0;
2669
2764
  const monitor = normalizeSignalAwarenessMonitor(payload.monitor);
2670
2765
  const run = normalizeSignalAwarenessRun(payload.run);
@@ -2682,6 +2777,18 @@ function normalizeSignalAwarenessResponse(data) {
2682
2777
  ...Number.isInteger(creditsUsed) && creditsUsed >= 0 ? { creditsUsed } : {},
2683
2778
  ...Number.isFinite(Number(payload.created)) ? { created: Number(payload.created) } : {},
2684
2779
  ...Number.isFinite(Number(payload.skipped)) ? { skipped: Number(payload.skipped) } : {},
2780
+ ...Number.isFinite(Number(payload.delivered)) ? { delivered: Number(payload.delivered) } : {},
2781
+ ...Array.isArray(payload.errors) ? {
2782
+ errors: payload.errors.flatMap((item) => {
2783
+ const error = signalAwarenessRecord(item);
2784
+ const row = signalAwarenessCount(error.row);
2785
+ const message = signalAwarenessText(error.error, 500);
2786
+ return row !== void 0 && message ? [{ row, error: message }] : [];
2787
+ })
2788
+ } : {},
2789
+ ...payload.output_mode === "csv" || payload.output_mode === "webhook" ? { outputMode: payload.output_mode } : {},
2790
+ ...payload.webhook_url === null || typeof payload.webhook_url === "string" ? { webhookUrl: payload.webhook_url } : {},
2791
+ ...Number.isInteger(Number(payload.webhook_status)) ? { webhookStatus: Number(payload.webhook_status) } : {},
2685
2792
  ...Number.isFinite(Number(payload.total)) ? { total: Number(payload.total) } : {},
2686
2793
  ...Number.isFinite(Number(payload.limit)) ? { limit: Number(payload.limit) } : {},
2687
2794
  ...Number.isFinite(Number(payload.offset)) ? { offset: Number(payload.offset) } : {},
@@ -2707,11 +2814,21 @@ function normalizeSignalAwarenessMonitor(value) {
2707
2814
  const domain = signalAwarenessText(monitor.domain, 253);
2708
2815
  const status = signalAwarenessText(monitor.status, 80);
2709
2816
  const schedule = signalAwarenessText(monitor.schedule, 120);
2817
+ const scheduleCron = signalAwarenessText(monitor.schedule_cron, 120);
2710
2818
  if (id) result.id = id;
2711
2819
  if (companyName) result.company_name = companyName;
2712
2820
  if (domain) result.domain = domain;
2713
2821
  if (status) result.status = status;
2714
2822
  if (schedule) result.schedule = schedule;
2823
+ if (scheduleCron) result.schedule_cron = scheduleCron;
2824
+ if (monitor.webhook_url === null || typeof monitor.webhook_url === "string") result.webhook_url = monitor.webhook_url;
2825
+ for (const key of ["total_runs", "total_signals_found", "consecutive_failures"]) {
2826
+ const value2 = signalAwarenessCount(monitor[key]);
2827
+ if (value2 !== void 0) result[key] = value2;
2828
+ }
2829
+ if (typeof monitor.auto_paused === "boolean") result.auto_paused = monitor.auto_paused;
2830
+ const autoPauseReason = signalAwarenessText(monitor.auto_pause_reason, 500);
2831
+ if (autoPauseReason) result.auto_pause_reason = autoPauseReason;
2715
2832
  for (const key of ["last_run_at", "next_run_at", "created_at", "updated_at"]) {
2716
2833
  const timestamp = signalAwarenessText(monitor[key], 64);
2717
2834
  if (timestamp && Number.isFinite(Date.parse(timestamp))) result[key] = timestamp;
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Signaliz,
3
3
  SignalizError
4
- } from "./chunk-L3Z56ZVO.mjs";
4
+ } from "./chunk-N4SFDZG7.mjs";
5
5
  export {
6
6
  Signaliz,
7
7
  SignalizError
@@ -853,6 +853,43 @@ var Signaliz = class {
853
853
  async runSignalMonitor(monitorId, idempotencyKey) {
854
854
  return this.signalAwareness({ action: "manual_run", monitorId, idempotencyKey });
855
855
  }
856
+ async updateSignalMonitor(monitorId, updates) {
857
+ return this.signalAwareness({ action: "update", monitorId, updates });
858
+ }
859
+ async pauseSignalMonitor(monitorId) {
860
+ return this.updateSignalMonitor(monitorId, { status: "paused" });
861
+ }
862
+ async resumeSignalMonitor(monitorId) {
863
+ return this.updateSignalMonitor(monitorId, { status: "active" });
864
+ }
865
+ async deleteSignalMonitor(monitorId) {
866
+ return this.signalAwareness({ action: "delete", monitorId });
867
+ }
868
+ async listSignalAwarenessSignals(monitorId, limit, offset) {
869
+ return this.signalAwareness({ action: "list_signals", monitorId, limit, offset });
870
+ }
871
+ async bulkCreateSignalMonitors(monitors, defaults) {
872
+ return this.signalAwareness({ action: "bulk_import", monitors, defaults });
873
+ }
874
+ async getSignalAwarenessSettings() {
875
+ return this.signalAwareness({ action: "get_settings" });
876
+ }
877
+ async setSignalAwarenessOutput(outputMode, webhookUrl) {
878
+ return this.signalAwareness({
879
+ action: "set_global_webhook",
880
+ enabled: outputMode === "webhook",
881
+ webhookUrl: outputMode === "webhook" ? webhookUrl : null
882
+ });
883
+ }
884
+ async testSignalAwarenessWebhook(webhookUrl) {
885
+ return this.signalAwareness({ action: "test_webhook", webhookUrl });
886
+ }
887
+ async exportSignalAwareness(monitorId) {
888
+ return this.signalAwareness({ action: "export", monitorId });
889
+ }
890
+ async sendSignalAwarenessExport(signals) {
891
+ return this.signalAwareness({ action: "send_signal_export", signals });
892
+ }
856
893
  async findEmail(params) {
857
894
  const request = findEmailRequestBody(params);
858
895
  assertFindEmailRequestIdentity(request);
@@ -1918,6 +1955,16 @@ function normalizeFindEmailResult(data) {
1918
1955
  success: processing || !failed && found,
1919
1956
  found,
1920
1957
  email,
1958
+ checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
1959
+ candidateSource: typeof data.candidate_source === "string" ? data.candidate_source : null,
1960
+ primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
1961
+ primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
1962
+ terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
1963
+ terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
1964
+ terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
1965
+ terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
1966
+ terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
1967
+ bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
1921
1968
  firstName: data.first_name,
1922
1969
  lastName: data.last_name,
1923
1970
  confidence: failed ? 0 : data.confidence ?? data.confidence_score ?? (verified ? 1 : 0),
@@ -1957,6 +2004,19 @@ function normalizeFindEmailResult(data) {
1957
2004
  function normalizeVerifyEmailResult(email, data) {
1958
2005
  data = publicProductData(data, "verify_email");
1959
2006
  const failed = coreProductResponseFailed(data);
2007
+ const publicIsCatchAll = data.is_catch_all === true || data.email_is_catch_all === true;
2008
+ const publicPrimaryResult = String(data.primary_verdict ?? "").toLowerCase();
2009
+ const publicTerminalResult = String(data.terminal_result ?? "").toLowerCase();
2010
+ const okToSend = !failed && (data.ok_to_send === true || publicPrimaryResult === "ok" || publicPrimaryResult === "catch_all" && publicTerminalResult === "deliverable");
2011
+ return {
2012
+ email: typeof data.email === "string" ? data.email : email || null,
2013
+ status: String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
2014
+ isCatchAll: publicIsCatchAll,
2015
+ creditsCharged: Number.isFinite(Number(data.credits_charged)) ? Number(data.credits_charged) : 0,
2016
+ okToSend,
2017
+ ...data.verification_run_id || data.run_id ? { verificationRunId: data.verification_run_id ?? data.run_id } : {},
2018
+ ...data.next_poll_after_seconds !== void 0 ? { nextPollAfterSeconds: data.next_poll_after_seconds } : {}
2019
+ };
1960
2020
  const malformed = data.is_malformed === true || data.verification_verdict === "malformed" || data.verification_status === "malformed" || data.deliverability_status === "malformed";
1961
2021
  const verificationStatus = normalizeVerifyEmailStatus(
1962
2022
  failed ? malformed ? "malformed" : "error" : data.verification_status ?? data.verification_verdict ?? data.deliverability_status ?? "unknown"
@@ -1971,6 +2031,15 @@ function normalizeVerifyEmailResult(email, data) {
1971
2031
  error: failed ? coreProductErrorMessage(data) : void 0,
1972
2032
  errorCode: failed ? coreProductErrorCode(data) : void 0,
1973
2033
  email: data.email ?? email,
2034
+ checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
2035
+ primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
2036
+ primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
2037
+ terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
2038
+ terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
2039
+ terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
2040
+ terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
2041
+ terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
2042
+ bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
1974
2043
  status: !failed && String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
1975
2044
  verificationRunId,
1976
2045
  retryAfterMs: data.retry_after_ms,
@@ -2234,7 +2303,7 @@ function validateSignalDiscoveryParams(params) {
2234
2303
  const runId = typeof params.signalSearchRunId === "string" ? params.signalSearchRunId.trim() : "";
2235
2304
  const query = typeof params.query === "string" ? params.query.trim() : "";
2236
2305
  if (!runId && !query) {
2237
- throw new TypeError("Signals Everything requires query or signalSearchRunId");
2306
+ throw new TypeError("Signals First requires query or signalSearchRunId");
2238
2307
  }
2239
2308
  if (query && (query.length < 2 || query.length > 2e3)) {
2240
2309
  throw new RangeError("query must contain between 2 and 2000 characters");
@@ -2642,24 +2711,50 @@ function normalizeSignalToCopyResult(data) {
2642
2711
  raw: data
2643
2712
  };
2644
2713
  }
2714
+ var SIGNAL_AWARENESS_SCHEDULES = {
2715
+ every_6_hours: "0 */6 * * *",
2716
+ daily: "0 8 * * *",
2717
+ every_2_days: "0 8 */2 * *",
2718
+ weekly: "0 8 * * 1",
2719
+ monthly: "0 8 1 * *"
2720
+ };
2721
+ function signalAwarenessScheduleCron(value) {
2722
+ return value.scheduleCron || (value.schedule ? SIGNAL_AWARENESS_SCHEDULES[value.schedule] : void 0);
2723
+ }
2645
2724
  function signalAwarenessMonitorRequest(monitor) {
2646
2725
  return compact({
2647
2726
  company_name: monitor.companyName,
2648
2727
  domain: monitor.domain,
2649
- template: monitor.template,
2650
- signal_config: monitor.signalConfig,
2651
- schedule_cron: monitor.scheduleCron,
2728
+ schedule_cron: signalAwarenessScheduleCron(monitor),
2652
2729
  webhook_url: monitor.webhookUrl
2653
2730
  });
2654
2731
  }
2732
+ function signalAwarenessMonitorDefaultsRequest(defaults) {
2733
+ return compact({
2734
+ schedule_cron: signalAwarenessScheduleCron(defaults),
2735
+ webhook_url: defaults.webhookUrl
2736
+ });
2737
+ }
2738
+ function signalAwarenessMonitorUpdateRequest(updates) {
2739
+ return compact({
2740
+ company_name: updates.companyName,
2741
+ schedule_cron: signalAwarenessScheduleCron(updates),
2742
+ status: updates.status,
2743
+ webhook_url: updates.webhookUrl
2744
+ });
2745
+ }
2655
2746
  function signalAwarenessRequestBody(request) {
2656
2747
  return compact({
2657
2748
  action: request.action,
2658
2749
  monitor_id: request.monitorId,
2659
2750
  monitor: request.monitor ? signalAwarenessMonitorRequest(request.monitor) : void 0,
2660
2751
  monitors: request.monitors?.map(signalAwarenessMonitorRequest),
2661
- defaults: request.defaults,
2662
- updates: request.updates,
2752
+ defaults: request.defaults ? signalAwarenessMonitorDefaultsRequest(request.defaults) : void 0,
2753
+ updates: request.updates ? signalAwarenessMonitorUpdateRequest(request.updates) : void 0,
2754
+ enabled: request.enabled,
2755
+ webhook_url: request.webhookUrl,
2756
+ signal_ids: request.signalIds,
2757
+ signals: request.signals,
2663
2758
  limit: request.limit,
2664
2759
  offset: request.offset,
2665
2760
  idempotency_key: request.idempotencyKey,
@@ -2668,7 +2763,7 @@ function signalAwarenessRequestBody(request) {
2668
2763
  }
2669
2764
  function normalizeSignalAwarenessResponse(data) {
2670
2765
  const payload = data.data && typeof data.data === "object" ? data.data : data;
2671
- const signals = Array.isArray(payload.signals) ? oneSignalPerCompany(payload.signals.flatMap(normalizeSignalAwarenessSignal)) : void 0;
2766
+ const signals = Array.isArray(payload.signals) ? payload.signals.flatMap(normalizeSignalAwarenessSignal) : void 0;
2672
2767
  const monitors = Array.isArray(payload.monitors) ? payload.monitors.map(normalizeSignalAwarenessMonitor).filter((value) => value !== void 0) : void 0;
2673
2768
  const monitor = normalizeSignalAwarenessMonitor(payload.monitor);
2674
2769
  const run = normalizeSignalAwarenessRun(payload.run);
@@ -2686,6 +2781,18 @@ function normalizeSignalAwarenessResponse(data) {
2686
2781
  ...Number.isInteger(creditsUsed) && creditsUsed >= 0 ? { creditsUsed } : {},
2687
2782
  ...Number.isFinite(Number(payload.created)) ? { created: Number(payload.created) } : {},
2688
2783
  ...Number.isFinite(Number(payload.skipped)) ? { skipped: Number(payload.skipped) } : {},
2784
+ ...Number.isFinite(Number(payload.delivered)) ? { delivered: Number(payload.delivered) } : {},
2785
+ ...Array.isArray(payload.errors) ? {
2786
+ errors: payload.errors.flatMap((item) => {
2787
+ const error = signalAwarenessRecord(item);
2788
+ const row = signalAwarenessCount(error.row);
2789
+ const message = signalAwarenessText(error.error, 500);
2790
+ return row !== void 0 && message ? [{ row, error: message }] : [];
2791
+ })
2792
+ } : {},
2793
+ ...payload.output_mode === "csv" || payload.output_mode === "webhook" ? { outputMode: payload.output_mode } : {},
2794
+ ...payload.webhook_url === null || typeof payload.webhook_url === "string" ? { webhookUrl: payload.webhook_url } : {},
2795
+ ...Number.isInteger(Number(payload.webhook_status)) ? { webhookStatus: Number(payload.webhook_status) } : {},
2689
2796
  ...Number.isFinite(Number(payload.total)) ? { total: Number(payload.total) } : {},
2690
2797
  ...Number.isFinite(Number(payload.limit)) ? { limit: Number(payload.limit) } : {},
2691
2798
  ...Number.isFinite(Number(payload.offset)) ? { offset: Number(payload.offset) } : {},
@@ -2711,11 +2818,21 @@ function normalizeSignalAwarenessMonitor(value) {
2711
2818
  const domain = signalAwarenessText(monitor.domain, 253);
2712
2819
  const status = signalAwarenessText(monitor.status, 80);
2713
2820
  const schedule = signalAwarenessText(monitor.schedule, 120);
2821
+ const scheduleCron = signalAwarenessText(monitor.schedule_cron, 120);
2714
2822
  if (id) result.id = id;
2715
2823
  if (companyName) result.company_name = companyName;
2716
2824
  if (domain) result.domain = domain;
2717
2825
  if (status) result.status = status;
2718
2826
  if (schedule) result.schedule = schedule;
2827
+ if (scheduleCron) result.schedule_cron = scheduleCron;
2828
+ if (monitor.webhook_url === null || typeof monitor.webhook_url === "string") result.webhook_url = monitor.webhook_url;
2829
+ for (const key of ["total_runs", "total_signals_found", "consecutive_failures"]) {
2830
+ const value2 = signalAwarenessCount(monitor[key]);
2831
+ if (value2 !== void 0) result[key] = value2;
2832
+ }
2833
+ if (typeof monitor.auto_paused === "boolean") result.auto_paused = monitor.auto_paused;
2834
+ const autoPauseReason = signalAwarenessText(monitor.auto_pause_reason, 500);
2835
+ if (autoPauseReason) result.auto_pause_reason = autoPauseReason;
2719
2836
  for (const key of ["last_run_at", "next_run_at", "created_at", "updated_at"]) {
2720
2837
  const timestamp = signalAwarenessText(monitor[key], 64);
2721
2838
  if (timestamp && Number.isFinite(Date.parse(timestamp))) result[key] = timestamp;
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Signaliz
4
- } from "./chunk-L3Z56ZVO.mjs";
4
+ } from "./chunk-N4SFDZG7.mjs";
5
5
 
6
6
  // src/mcp-config.ts
7
7
  import * as fs from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signaliz/sdk",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "Signaliz SDK for Company Signal Enrichment, Signals First, Signal Awareness, Signal to Copy AI, and Signaliz Flow.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",