@signaliz/sdk 1.0.44 → 1.0.45

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.
@@ -705,9 +705,10 @@ var Signaliz = class {
705
705
  if (seen.size !== requests.length) throw new Error(`${label} batch returned incomplete indexed results`);
706
706
  return rows;
707
707
  }
708
- async runSignalCopyBatchChunk(requests, concurrency) {
708
+ async runSignalCopyBatchChunk(requests, concurrency, rowRateLimitAttempt = 0) {
709
709
  const startedAt = Date.now();
710
710
  const results = new Array(requests.length);
711
+ const rateLimited = [];
711
712
  let pending = requests.map((params, index) => ({
712
713
  index,
713
714
  params,
@@ -727,6 +728,14 @@ var Signaliz = class {
727
728
  const task = pending[index];
728
729
  const item = data.results[index];
729
730
  if (item.success === false) {
731
+ if (rowRateLimitAttempt < MAX_ROW_RATE_LIMIT_RETRIES && isRetryableRowRateLimit({
732
+ index: task.index,
733
+ success: false,
734
+ raw: item
735
+ })) {
736
+ rateLimited.push({ index: task.index, params: task.params, raw: item });
737
+ continue;
738
+ }
730
739
  results[task.index] = { index: task.index, success: false, error: item.error || item.message || "Signal to Copy failed" };
731
740
  continue;
732
741
  }
@@ -765,6 +774,21 @@ var Signaliz = class {
765
774
  pending = nextPending;
766
775
  if (pending.length > 0) await sleep2(nextDelayMs);
767
776
  }
777
+ if (rateLimited.length > 0) {
778
+ await sleep2(rowRateLimitDelayMs(rateLimited.map((item) => ({
779
+ index: item.index,
780
+ success: false,
781
+ raw: item.raw
782
+ }))));
783
+ const retried = await this.runSignalCopyBatchChunk(
784
+ rateLimited.map((item) => item.params),
785
+ concurrency,
786
+ rowRateLimitAttempt + 1
787
+ );
788
+ for (let index = 0; index < rateLimited.length; index += 1) {
789
+ results[rateLimited[index].index] = { ...retried[index], index: rateLimited[index].index };
790
+ }
791
+ }
768
792
  return results;
769
793
  }
770
794
  async runCoreBatchRound(path, tasks, options, companyRecoverableBatch, rowRateLimitAttempt = 0) {
package/dist/index.js CHANGED
@@ -732,9 +732,10 @@ var Signaliz = class {
732
732
  if (seen.size !== requests.length) throw new Error(`${label} batch returned incomplete indexed results`);
733
733
  return rows;
734
734
  }
735
- async runSignalCopyBatchChunk(requests, concurrency) {
735
+ async runSignalCopyBatchChunk(requests, concurrency, rowRateLimitAttempt = 0) {
736
736
  const startedAt = Date.now();
737
737
  const results = new Array(requests.length);
738
+ const rateLimited = [];
738
739
  let pending = requests.map((params, index) => ({
739
740
  index,
740
741
  params,
@@ -754,6 +755,14 @@ var Signaliz = class {
754
755
  const task = pending[index];
755
756
  const item = data.results[index];
756
757
  if (item.success === false) {
758
+ if (rowRateLimitAttempt < MAX_ROW_RATE_LIMIT_RETRIES && isRetryableRowRateLimit({
759
+ index: task.index,
760
+ success: false,
761
+ raw: item
762
+ })) {
763
+ rateLimited.push({ index: task.index, params: task.params, raw: item });
764
+ continue;
765
+ }
757
766
  results[task.index] = { index: task.index, success: false, error: item.error || item.message || "Signal to Copy failed" };
758
767
  continue;
759
768
  }
@@ -792,6 +801,21 @@ var Signaliz = class {
792
801
  pending = nextPending;
793
802
  if (pending.length > 0) await sleep2(nextDelayMs);
794
803
  }
804
+ if (rateLimited.length > 0) {
805
+ await sleep2(rowRateLimitDelayMs(rateLimited.map((item) => ({
806
+ index: item.index,
807
+ success: false,
808
+ raw: item.raw
809
+ }))));
810
+ const retried = await this.runSignalCopyBatchChunk(
811
+ rateLimited.map((item) => item.params),
812
+ concurrency,
813
+ rowRateLimitAttempt + 1
814
+ );
815
+ for (let index = 0; index < rateLimited.length; index += 1) {
816
+ results[rateLimited[index].index] = { ...retried[index], index: rateLimited[index].index };
817
+ }
818
+ }
795
819
  return results;
796
820
  }
797
821
  async runCoreBatchRound(path, tasks, options, companyRecoverableBatch, rowRateLimitAttempt = 0) {
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Signaliz,
3
3
  SignalizError
4
- } from "./chunk-Q4T2GUXD.mjs";
4
+ } from "./chunk-NAJO2CAD.mjs";
5
5
  export {
6
6
  Signaliz,
7
7
  SignalizError
@@ -736,9 +736,10 @@ var Signaliz = class {
736
736
  if (seen.size !== requests.length) throw new Error(`${label} batch returned incomplete indexed results`);
737
737
  return rows;
738
738
  }
739
- async runSignalCopyBatchChunk(requests, concurrency) {
739
+ async runSignalCopyBatchChunk(requests, concurrency, rowRateLimitAttempt = 0) {
740
740
  const startedAt = Date.now();
741
741
  const results = new Array(requests.length);
742
+ const rateLimited = [];
742
743
  let pending = requests.map((params, index) => ({
743
744
  index,
744
745
  params,
@@ -758,6 +759,14 @@ var Signaliz = class {
758
759
  const task = pending[index];
759
760
  const item = data.results[index];
760
761
  if (item.success === false) {
762
+ if (rowRateLimitAttempt < MAX_ROW_RATE_LIMIT_RETRIES && isRetryableRowRateLimit({
763
+ index: task.index,
764
+ success: false,
765
+ raw: item
766
+ })) {
767
+ rateLimited.push({ index: task.index, params: task.params, raw: item });
768
+ continue;
769
+ }
761
770
  results[task.index] = { index: task.index, success: false, error: item.error || item.message || "Signal to Copy failed" };
762
771
  continue;
763
772
  }
@@ -796,6 +805,21 @@ var Signaliz = class {
796
805
  pending = nextPending;
797
806
  if (pending.length > 0) await sleep2(nextDelayMs);
798
807
  }
808
+ if (rateLimited.length > 0) {
809
+ await sleep2(rowRateLimitDelayMs(rateLimited.map((item) => ({
810
+ index: item.index,
811
+ success: false,
812
+ raw: item.raw
813
+ }))));
814
+ const retried = await this.runSignalCopyBatchChunk(
815
+ rateLimited.map((item) => item.params),
816
+ concurrency,
817
+ rowRateLimitAttempt + 1
818
+ );
819
+ for (let index = 0; index < rateLimited.length; index += 1) {
820
+ results[rateLimited[index].index] = { ...retried[index], index: rateLimited[index].index };
821
+ }
822
+ }
799
823
  return results;
800
824
  }
801
825
  async runCoreBatchRound(path2, tasks, options, companyRecoverableBatch, rowRateLimitAttempt = 0) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Signaliz
4
- } from "./chunk-Q4T2GUXD.mjs";
4
+ } from "./chunk-NAJO2CAD.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.44",
3
+ "version": "1.0.45",
4
4
  "description": "Signaliz SDK for Find Email, Verify Email, Company Signal Enrichment, and Signal to Copy AI.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",