@signaliz/sdk 1.0.19 → 1.0.21

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
@@ -31,6 +31,13 @@ integration, and approval primitives exposed through MCP and CLI.
31
31
  npm install @signaliz/sdk
32
32
  ```
33
33
 
34
+ ## Production REST Endpoints
35
+
36
+ - Find Email: `https://api.signaliz.com/functions/v1/find-verified-email-v2`
37
+ - Email Verification: `https://api.signaliz.com/functions/v1/email-verification-2`
38
+ - Company Signal Enrichment: `https://api.signaliz.com/functions/v1/company-signal-enrichment-v2`
39
+ - Signal to Copy: `https://api.signaliz.com/functions/v1/api/v1/signal-to-copy`
40
+
34
41
  ## Quick Start - Ops
35
42
 
36
43
  Use Ops when a script or agent needs to turn a plain-English GTM outcome into
@@ -536,7 +536,27 @@ var Signals = class {
536
536
  if (params.icpId) args.icp_id = params.icpId;
537
537
  if (params.cacheTtlHours !== void 0) args.cache_ttl_hours = params.cacheTtlHours;
538
538
  if (params.skipCache) args.skip_cache = params.skipCache;
539
- const data = await this.client.post("company-signal-enrichment-v2", args);
539
+ args.wait_for_result = params.waitForResult !== false;
540
+ let data = await this.client.post("company-signal-enrichment-v2", args);
541
+ if (params.waitForResult !== false && data?.run_id && isPendingSignalResponse(data)) {
542
+ const maxWaitMs = Math.max(1e3, params.maxWaitMs ?? 20 * 6e4);
543
+ const pollIntervalMs = Math.max(250, params.pollIntervalMs ?? 2e3);
544
+ const startedAt = Date.now();
545
+ while (Date.now() - startedAt < maxWaitMs) {
546
+ const status = await this.client.post("trigger-run-status", { run_id: data.run_id });
547
+ if (isCompletedSignalRun(status)) {
548
+ data = status.output ?? status.result ?? status.data ?? status;
549
+ break;
550
+ }
551
+ if (isFailedSignalRun(status)) {
552
+ throw new Error(`Company signal enrichment ${data.run_id} failed with status ${status.status || "unknown"}`);
553
+ }
554
+ await sleep2(pollIntervalMs);
555
+ }
556
+ if (isPendingSignalResponse(data)) {
557
+ throw new Error(`Company signal enrichment ${data.run_id} did not complete within ${maxWaitMs}ms`);
558
+ }
559
+ }
540
560
  return {
541
561
  success: data.success ?? false,
542
562
  company: {
@@ -656,6 +676,18 @@ var Signals = class {
656
676
  };
657
677
  }
658
678
  };
679
+ function isPendingSignalResponse(data) {
680
+ return ["triggered", "queued", "processing", "pending", "pending_version", "waiting_for_deploy"].includes(String(data?.status || "").toLowerCase());
681
+ }
682
+ function isCompletedSignalRun(data) {
683
+ return ["completed", "success", "succeeded"].includes(String(data?.status || "").toLowerCase());
684
+ }
685
+ function isFailedSignalRun(data) {
686
+ return ["failed", "error", "cancelled", "canceled", "crashed", "timed_out"].includes(String(data?.status || "").toLowerCase());
687
+ }
688
+ function sleep2(ms) {
689
+ return new Promise((resolve) => setTimeout(resolve, ms));
690
+ }
659
691
 
660
692
  // src/resources/systems.ts
661
693
  var Systems = class {
package/dist/cli.js CHANGED
@@ -475,6 +475,18 @@ var init_emails = __esm({
475
475
  });
476
476
 
477
477
  // src/resources/signals.ts
478
+ function isPendingSignalResponse(data) {
479
+ return ["triggered", "queued", "processing", "pending", "pending_version", "waiting_for_deploy"].includes(String(data?.status || "").toLowerCase());
480
+ }
481
+ function isCompletedSignalRun(data) {
482
+ return ["completed", "success", "succeeded"].includes(String(data?.status || "").toLowerCase());
483
+ }
484
+ function isFailedSignalRun(data) {
485
+ return ["failed", "error", "cancelled", "canceled", "crashed", "timed_out"].includes(String(data?.status || "").toLowerCase());
486
+ }
487
+ function sleep2(ms) {
488
+ return new Promise((resolve) => setTimeout(resolve, ms));
489
+ }
478
490
  var Signals;
479
491
  var init_signals = __esm({
480
492
  "src/resources/signals.ts"() {
@@ -571,7 +583,27 @@ var init_signals = __esm({
571
583
  if (params.icpId) args.icp_id = params.icpId;
572
584
  if (params.cacheTtlHours !== void 0) args.cache_ttl_hours = params.cacheTtlHours;
573
585
  if (params.skipCache) args.skip_cache = params.skipCache;
574
- const data = await this.client.post("company-signal-enrichment-v2", args);
586
+ args.wait_for_result = params.waitForResult !== false;
587
+ let data = await this.client.post("company-signal-enrichment-v2", args);
588
+ if (params.waitForResult !== false && data?.run_id && isPendingSignalResponse(data)) {
589
+ const maxWaitMs = Math.max(1e3, params.maxWaitMs ?? 20 * 6e4);
590
+ const pollIntervalMs = Math.max(250, params.pollIntervalMs ?? 2e3);
591
+ const startedAt = Date.now();
592
+ while (Date.now() - startedAt < maxWaitMs) {
593
+ const status = await this.client.post("trigger-run-status", { run_id: data.run_id });
594
+ if (isCompletedSignalRun(status)) {
595
+ data = status.output ?? status.result ?? status.data ?? status;
596
+ break;
597
+ }
598
+ if (isFailedSignalRun(status)) {
599
+ throw new Error(`Company signal enrichment ${data.run_id} failed with status ${status.status || "unknown"}`);
600
+ }
601
+ await sleep2(pollIntervalMs);
602
+ }
603
+ if (isPendingSignalResponse(data)) {
604
+ throw new Error(`Company signal enrichment ${data.run_id} did not complete within ${maxWaitMs}ms`);
605
+ }
606
+ }
575
607
  return {
576
608
  success: data.success ?? false,
577
609
  company: {
package/dist/index.d.mts CHANGED
@@ -110,6 +110,12 @@ interface EnrichSignalsV2Params {
110
110
  icpId?: string;
111
111
  cacheTtlHours?: number;
112
112
  skipCache?: boolean;
113
+ /** Wait for a queued Trigger.dev enrichment to finish. Defaults to true. */
114
+ waitForResult?: boolean;
115
+ /** Maximum time to wait for a queued enrichment. Defaults to 20 minutes. */
116
+ maxWaitMs?: number;
117
+ /** Delay between queued-enrichment status checks. Defaults to 2 seconds. */
118
+ pollIntervalMs?: number;
113
119
  }
114
120
  interface SignalV2 {
115
121
  id: string;
package/dist/index.d.ts CHANGED
@@ -110,6 +110,12 @@ interface EnrichSignalsV2Params {
110
110
  icpId?: string;
111
111
  cacheTtlHours?: number;
112
112
  skipCache?: boolean;
113
+ /** Wait for a queued Trigger.dev enrichment to finish. Defaults to true. */
114
+ waitForResult?: boolean;
115
+ /** Maximum time to wait for a queued enrichment. Defaults to 20 minutes. */
116
+ maxWaitMs?: number;
117
+ /** Delay between queued-enrichment status checks. Defaults to 2 seconds. */
118
+ pollIntervalMs?: number;
113
119
  }
114
120
  interface SignalV2 {
115
121
  id: string;
package/dist/index.js CHANGED
@@ -591,7 +591,27 @@ var Signals = class {
591
591
  if (params.icpId) args.icp_id = params.icpId;
592
592
  if (params.cacheTtlHours !== void 0) args.cache_ttl_hours = params.cacheTtlHours;
593
593
  if (params.skipCache) args.skip_cache = params.skipCache;
594
- const data = await this.client.post("company-signal-enrichment-v2", args);
594
+ args.wait_for_result = params.waitForResult !== false;
595
+ let data = await this.client.post("company-signal-enrichment-v2", args);
596
+ if (params.waitForResult !== false && data?.run_id && isPendingSignalResponse(data)) {
597
+ const maxWaitMs = Math.max(1e3, params.maxWaitMs ?? 20 * 6e4);
598
+ const pollIntervalMs = Math.max(250, params.pollIntervalMs ?? 2e3);
599
+ const startedAt = Date.now();
600
+ while (Date.now() - startedAt < maxWaitMs) {
601
+ const status = await this.client.post("trigger-run-status", { run_id: data.run_id });
602
+ if (isCompletedSignalRun(status)) {
603
+ data = status.output ?? status.result ?? status.data ?? status;
604
+ break;
605
+ }
606
+ if (isFailedSignalRun(status)) {
607
+ throw new Error(`Company signal enrichment ${data.run_id} failed with status ${status.status || "unknown"}`);
608
+ }
609
+ await sleep2(pollIntervalMs);
610
+ }
611
+ if (isPendingSignalResponse(data)) {
612
+ throw new Error(`Company signal enrichment ${data.run_id} did not complete within ${maxWaitMs}ms`);
613
+ }
614
+ }
595
615
  return {
596
616
  success: data.success ?? false,
597
617
  company: {
@@ -711,6 +731,18 @@ var Signals = class {
711
731
  };
712
732
  }
713
733
  };
734
+ function isPendingSignalResponse(data) {
735
+ return ["triggered", "queued", "processing", "pending", "pending_version", "waiting_for_deploy"].includes(String(data?.status || "").toLowerCase());
736
+ }
737
+ function isCompletedSignalRun(data) {
738
+ return ["completed", "success", "succeeded"].includes(String(data?.status || "").toLowerCase());
739
+ }
740
+ function isFailedSignalRun(data) {
741
+ return ["failed", "error", "cancelled", "canceled", "crashed", "timed_out"].includes(String(data?.status || "").toLowerCase());
742
+ }
743
+ function sleep2(ms) {
744
+ return new Promise((resolve) => setTimeout(resolve, ms));
745
+ }
714
746
 
715
747
  // src/resources/systems.ts
716
748
  var Systems = class {
package/dist/index.mjs CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  getCampaignBuilderStrategyTemplate,
30
30
  getMissingCampaignBuilderApprovals,
31
31
  normalizeExecutionReference
32
- } from "./chunk-PBJFIO72.mjs";
32
+ } from "./chunk-SLU4VF5G.mjs";
33
33
  export {
34
34
  Ai,
35
35
  CAMPAIGN_BUILDER_OPERATING_PLAYBOOKS,
@@ -567,7 +567,27 @@ var Signals = class {
567
567
  if (params.icpId) args.icp_id = params.icpId;
568
568
  if (params.cacheTtlHours !== void 0) args.cache_ttl_hours = params.cacheTtlHours;
569
569
  if (params.skipCache) args.skip_cache = params.skipCache;
570
- const data = await this.client.post("company-signal-enrichment-v2", args);
570
+ args.wait_for_result = params.waitForResult !== false;
571
+ let data = await this.client.post("company-signal-enrichment-v2", args);
572
+ if (params.waitForResult !== false && data?.run_id && isPendingSignalResponse(data)) {
573
+ const maxWaitMs = Math.max(1e3, params.maxWaitMs ?? 20 * 6e4);
574
+ const pollIntervalMs = Math.max(250, params.pollIntervalMs ?? 2e3);
575
+ const startedAt = Date.now();
576
+ while (Date.now() - startedAt < maxWaitMs) {
577
+ const status = await this.client.post("trigger-run-status", { run_id: data.run_id });
578
+ if (isCompletedSignalRun(status)) {
579
+ data = status.output ?? status.result ?? status.data ?? status;
580
+ break;
581
+ }
582
+ if (isFailedSignalRun(status)) {
583
+ throw new Error(`Company signal enrichment ${data.run_id} failed with status ${status.status || "unknown"}`);
584
+ }
585
+ await sleep2(pollIntervalMs);
586
+ }
587
+ if (isPendingSignalResponse(data)) {
588
+ throw new Error(`Company signal enrichment ${data.run_id} did not complete within ${maxWaitMs}ms`);
589
+ }
590
+ }
571
591
  return {
572
592
  success: data.success ?? false,
573
593
  company: {
@@ -687,6 +707,18 @@ var Signals = class {
687
707
  };
688
708
  }
689
709
  };
710
+ function isPendingSignalResponse(data) {
711
+ return ["triggered", "queued", "processing", "pending", "pending_version", "waiting_for_deploy"].includes(String(data?.status || "").toLowerCase());
712
+ }
713
+ function isCompletedSignalRun(data) {
714
+ return ["completed", "success", "succeeded"].includes(String(data?.status || "").toLowerCase());
715
+ }
716
+ function isFailedSignalRun(data) {
717
+ return ["failed", "error", "cancelled", "canceled", "crashed", "timed_out"].includes(String(data?.status || "").toLowerCase());
718
+ }
719
+ function sleep2(ms) {
720
+ return new Promise((resolve) => setTimeout(resolve, ms));
721
+ }
690
722
 
691
723
  // src/resources/systems.ts
692
724
  var Systems = class {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Signaliz
4
- } from "./chunk-PBJFIO72.mjs";
4
+ } from "./chunk-SLU4VF5G.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.19",
3
+ "version": "1.0.21",
4
4
  "description": "Signaliz SDK — GTM Kernel, Nango routes, MCP, and enrichment for AI agents",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",