@signaliz/sdk 1.0.56 → 1.0.57

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.
@@ -532,9 +532,10 @@ var Signaliz = class {
532
532
  );
533
533
  }
534
534
  const startedAt = Date.now();
535
- const deduplicated = dedupeExactBatchItems(requests, (params) => JSON.stringify({
536
- request: signalToCopyRequestBody(params)
537
- }));
535
+ const deduplicated = dedupeExactBatchItems(
536
+ requests,
537
+ (params) => coreProductBatchRequestKey("api/v1/signal-to-copy", signalToCopyRequestBody(params))
538
+ );
538
539
  const uniqueRequests = deduplicated.uniqueItems;
539
540
  const uniqueInputIndices = new Array(uniqueRequests.length);
540
541
  deduplicated.sourceIndexByInput.forEach((uniqueIndex, inputIndex) => {
@@ -731,7 +732,10 @@ var Signaliz = class {
731
732
  }
732
733
  async runCoreBatchRound(path, tasks, options, rowRateLimitAttempt = 0) {
733
734
  const { serverConcurrency, chunkConcurrency } = path === "api/v1/company-signals" ? batchConcurrencyPlan(options, 25, 25) : batchConcurrencyPlan(options);
734
- const deduplicated = dedupeExactBatchItems(tasks, (task) => JSON.stringify(task.request));
735
+ const deduplicated = dedupeExactBatchItems(
736
+ tasks,
737
+ (task) => coreProductBatchRequestKey(path, task.request)
738
+ );
735
739
  const uniqueTasks = deduplicated.uniqueItems;
736
740
  const recoverableBatch = path === "api/v1/find-email" ? { label: "Find Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : path === "api/v1/verify-email" ? { label: "Verify Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : void 0;
737
741
  if (path !== "api/v1/company-signals" && recoverableBatch && uniqueTasks.length > 25) {
@@ -1247,6 +1251,75 @@ function dedupeExactBatchItems(items, keyForItem) {
1247
1251
  }
1248
1252
  return { uniqueItems, sourceIndexByInput };
1249
1253
  }
1254
+ function normalizedBatchText(value) {
1255
+ return typeof value === "string" ? value.trim().toLowerCase().replace(/\s+/g, " ") : "";
1256
+ }
1257
+ function normalizedBatchDomain(value) {
1258
+ return normalizedBatchText(value).replace(/^https?:\/\//, "").replace(/^www\./, "").split(/[/?#]/, 1)[0].replace(/\.+$/, "");
1259
+ }
1260
+ function normalizedBatchLinkedIn(value) {
1261
+ return normalizedBatchText(value).replace(/\/+$/, "");
1262
+ }
1263
+ function normalizedBatchList(value) {
1264
+ return Array.isArray(value) ? value.map(normalizedBatchText).filter(Boolean).sort() : [];
1265
+ }
1266
+ function normalizedFindEmailBatchName(request) {
1267
+ const fullName = normalizedBatchText(request.full_name);
1268
+ const componentName = [normalizedBatchText(request.first_name), normalizedBatchText(request.last_name)].filter(Boolean).join(" ");
1269
+ if (!fullName || !componentName || fullName === componentName) return fullName || componentName;
1270
+ return JSON.stringify([fullName, componentName]);
1271
+ }
1272
+ function coreProductBatchRequestKey(path, request) {
1273
+ if (path === "api/v1/find-email") {
1274
+ return JSON.stringify([
1275
+ normalizedFindEmailBatchName(request),
1276
+ normalizedBatchDomain(request.company_domain),
1277
+ normalizedBatchLinkedIn(request.linkedin_url),
1278
+ normalizedBatchText(request.company_name),
1279
+ request.skip_cache === true || request.bypass_cache === true
1280
+ ]);
1281
+ }
1282
+ if (path === "api/v1/verify-email") {
1283
+ return JSON.stringify([
1284
+ normalizedBatchText(request.email),
1285
+ request.skip_cache === true || request.bypass_cache === true,
1286
+ request.skip_catch_all_verification === true,
1287
+ request.skip_esp_check === true
1288
+ ]);
1289
+ }
1290
+ if (path === "api/v1/company-signals") {
1291
+ const online = request.online !== false;
1292
+ const deepSearch = request.enable_deep_search === void 0 ? online : request.enable_deep_search !== false;
1293
+ return JSON.stringify([
1294
+ normalizedBatchText(request.signal_run_id),
1295
+ normalizedBatchDomain(request.company_domain || request.domain),
1296
+ normalizedBatchText(request.company_name),
1297
+ normalizedBatchText(request.company_id),
1298
+ normalizedBatchLinkedIn(request.linkedin_url),
1299
+ normalizedBatchText(request.industry),
1300
+ typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
1301
+ normalizedBatchList(request.signal_types),
1302
+ Number(request.target_signal_count) || null,
1303
+ Number(request.lookback_days) || null,
1304
+ online,
1305
+ deepSearch,
1306
+ normalizedBatchText(request.search_mode || "balanced"),
1307
+ request.enable_outreach_intelligence === true,
1308
+ request.enable_predictive_intelligence === true,
1309
+ request.skip_cache === true || request.bypass_cache === true
1310
+ ]);
1311
+ }
1312
+ return JSON.stringify([
1313
+ normalizedBatchDomain(request.company_domain),
1314
+ typeof request.person_name === "string" ? request.person_name.trim() : "",
1315
+ typeof request.title === "string" ? request.title.trim() : "",
1316
+ typeof request.campaign_offer === "string" ? request.campaign_offer.trim() : "",
1317
+ typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
1318
+ typeof request.signal_run_id === "string" ? request.signal_run_id.trim() : "",
1319
+ request.skip_cache === true,
1320
+ request.enable_deep_search === true
1321
+ ]);
1322
+ }
1250
1323
  function finalizeCoreBatch(total, startedAt, round, normalize, options) {
1251
1324
  const results = new Array(total);
1252
1325
  for (const item of round) {
package/dist/index.js CHANGED
@@ -559,9 +559,10 @@ var Signaliz = class {
559
559
  );
560
560
  }
561
561
  const startedAt = Date.now();
562
- const deduplicated = dedupeExactBatchItems(requests, (params) => JSON.stringify({
563
- request: signalToCopyRequestBody(params)
564
- }));
562
+ const deduplicated = dedupeExactBatchItems(
563
+ requests,
564
+ (params) => coreProductBatchRequestKey("api/v1/signal-to-copy", signalToCopyRequestBody(params))
565
+ );
565
566
  const uniqueRequests = deduplicated.uniqueItems;
566
567
  const uniqueInputIndices = new Array(uniqueRequests.length);
567
568
  deduplicated.sourceIndexByInput.forEach((uniqueIndex, inputIndex) => {
@@ -758,7 +759,10 @@ var Signaliz = class {
758
759
  }
759
760
  async runCoreBatchRound(path, tasks, options, rowRateLimitAttempt = 0) {
760
761
  const { serverConcurrency, chunkConcurrency } = path === "api/v1/company-signals" ? batchConcurrencyPlan(options, 25, 25) : batchConcurrencyPlan(options);
761
- const deduplicated = dedupeExactBatchItems(tasks, (task) => JSON.stringify(task.request));
762
+ const deduplicated = dedupeExactBatchItems(
763
+ tasks,
764
+ (task) => coreProductBatchRequestKey(path, task.request)
765
+ );
762
766
  const uniqueTasks = deduplicated.uniqueItems;
763
767
  const recoverableBatch = path === "api/v1/find-email" ? { label: "Find Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : path === "api/v1/verify-email" ? { label: "Verify Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : void 0;
764
768
  if (path !== "api/v1/company-signals" && recoverableBatch && uniqueTasks.length > 25) {
@@ -1274,6 +1278,75 @@ function dedupeExactBatchItems(items, keyForItem) {
1274
1278
  }
1275
1279
  return { uniqueItems, sourceIndexByInput };
1276
1280
  }
1281
+ function normalizedBatchText(value) {
1282
+ return typeof value === "string" ? value.trim().toLowerCase().replace(/\s+/g, " ") : "";
1283
+ }
1284
+ function normalizedBatchDomain(value) {
1285
+ return normalizedBatchText(value).replace(/^https?:\/\//, "").replace(/^www\./, "").split(/[/?#]/, 1)[0].replace(/\.+$/, "");
1286
+ }
1287
+ function normalizedBatchLinkedIn(value) {
1288
+ return normalizedBatchText(value).replace(/\/+$/, "");
1289
+ }
1290
+ function normalizedBatchList(value) {
1291
+ return Array.isArray(value) ? value.map(normalizedBatchText).filter(Boolean).sort() : [];
1292
+ }
1293
+ function normalizedFindEmailBatchName(request) {
1294
+ const fullName = normalizedBatchText(request.full_name);
1295
+ const componentName = [normalizedBatchText(request.first_name), normalizedBatchText(request.last_name)].filter(Boolean).join(" ");
1296
+ if (!fullName || !componentName || fullName === componentName) return fullName || componentName;
1297
+ return JSON.stringify([fullName, componentName]);
1298
+ }
1299
+ function coreProductBatchRequestKey(path, request) {
1300
+ if (path === "api/v1/find-email") {
1301
+ return JSON.stringify([
1302
+ normalizedFindEmailBatchName(request),
1303
+ normalizedBatchDomain(request.company_domain),
1304
+ normalizedBatchLinkedIn(request.linkedin_url),
1305
+ normalizedBatchText(request.company_name),
1306
+ request.skip_cache === true || request.bypass_cache === true
1307
+ ]);
1308
+ }
1309
+ if (path === "api/v1/verify-email") {
1310
+ return JSON.stringify([
1311
+ normalizedBatchText(request.email),
1312
+ request.skip_cache === true || request.bypass_cache === true,
1313
+ request.skip_catch_all_verification === true,
1314
+ request.skip_esp_check === true
1315
+ ]);
1316
+ }
1317
+ if (path === "api/v1/company-signals") {
1318
+ const online = request.online !== false;
1319
+ const deepSearch = request.enable_deep_search === void 0 ? online : request.enable_deep_search !== false;
1320
+ return JSON.stringify([
1321
+ normalizedBatchText(request.signal_run_id),
1322
+ normalizedBatchDomain(request.company_domain || request.domain),
1323
+ normalizedBatchText(request.company_name),
1324
+ normalizedBatchText(request.company_id),
1325
+ normalizedBatchLinkedIn(request.linkedin_url),
1326
+ normalizedBatchText(request.industry),
1327
+ typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
1328
+ normalizedBatchList(request.signal_types),
1329
+ Number(request.target_signal_count) || null,
1330
+ Number(request.lookback_days) || null,
1331
+ online,
1332
+ deepSearch,
1333
+ normalizedBatchText(request.search_mode || "balanced"),
1334
+ request.enable_outreach_intelligence === true,
1335
+ request.enable_predictive_intelligence === true,
1336
+ request.skip_cache === true || request.bypass_cache === true
1337
+ ]);
1338
+ }
1339
+ return JSON.stringify([
1340
+ normalizedBatchDomain(request.company_domain),
1341
+ typeof request.person_name === "string" ? request.person_name.trim() : "",
1342
+ typeof request.title === "string" ? request.title.trim() : "",
1343
+ typeof request.campaign_offer === "string" ? request.campaign_offer.trim() : "",
1344
+ typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
1345
+ typeof request.signal_run_id === "string" ? request.signal_run_id.trim() : "",
1346
+ request.skip_cache === true,
1347
+ request.enable_deep_search === true
1348
+ ]);
1349
+ }
1277
1350
  function finalizeCoreBatch(total, startedAt, round, normalize, options) {
1278
1351
  const results = new Array(total);
1279
1352
  for (const item of round) {
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Signaliz,
3
3
  SignalizError
4
- } from "./chunk-K7RDDRMJ.mjs";
4
+ } from "./chunk-SZ3H5W5L.mjs";
5
5
  export {
6
6
  Signaliz,
7
7
  SignalizError
@@ -563,9 +563,10 @@ var Signaliz = class {
563
563
  );
564
564
  }
565
565
  const startedAt = Date.now();
566
- const deduplicated = dedupeExactBatchItems(requests, (params) => JSON.stringify({
567
- request: signalToCopyRequestBody(params)
568
- }));
566
+ const deduplicated = dedupeExactBatchItems(
567
+ requests,
568
+ (params) => coreProductBatchRequestKey("api/v1/signal-to-copy", signalToCopyRequestBody(params))
569
+ );
569
570
  const uniqueRequests = deduplicated.uniqueItems;
570
571
  const uniqueInputIndices = new Array(uniqueRequests.length);
571
572
  deduplicated.sourceIndexByInput.forEach((uniqueIndex, inputIndex) => {
@@ -762,7 +763,10 @@ var Signaliz = class {
762
763
  }
763
764
  async runCoreBatchRound(path2, tasks, options, rowRateLimitAttempt = 0) {
764
765
  const { serverConcurrency, chunkConcurrency } = path2 === "api/v1/company-signals" ? batchConcurrencyPlan(options, 25, 25) : batchConcurrencyPlan(options);
765
- const deduplicated = dedupeExactBatchItems(tasks, (task) => JSON.stringify(task.request));
766
+ const deduplicated = dedupeExactBatchItems(
767
+ tasks,
768
+ (task) => coreProductBatchRequestKey(path2, task.request)
769
+ );
766
770
  const uniqueTasks = deduplicated.uniqueItems;
767
771
  const recoverableBatch = path2 === "api/v1/find-email" ? { label: "Find Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : path2 === "api/v1/verify-email" ? { label: "Verify Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : void 0;
768
772
  if (path2 !== "api/v1/company-signals" && recoverableBatch && uniqueTasks.length > 25) {
@@ -1278,6 +1282,75 @@ function dedupeExactBatchItems(items, keyForItem) {
1278
1282
  }
1279
1283
  return { uniqueItems, sourceIndexByInput };
1280
1284
  }
1285
+ function normalizedBatchText(value) {
1286
+ return typeof value === "string" ? value.trim().toLowerCase().replace(/\s+/g, " ") : "";
1287
+ }
1288
+ function normalizedBatchDomain(value) {
1289
+ return normalizedBatchText(value).replace(/^https?:\/\//, "").replace(/^www\./, "").split(/[/?#]/, 1)[0].replace(/\.+$/, "");
1290
+ }
1291
+ function normalizedBatchLinkedIn(value) {
1292
+ return normalizedBatchText(value).replace(/\/+$/, "");
1293
+ }
1294
+ function normalizedBatchList(value) {
1295
+ return Array.isArray(value) ? value.map(normalizedBatchText).filter(Boolean).sort() : [];
1296
+ }
1297
+ function normalizedFindEmailBatchName(request) {
1298
+ const fullName = normalizedBatchText(request.full_name);
1299
+ const componentName = [normalizedBatchText(request.first_name), normalizedBatchText(request.last_name)].filter(Boolean).join(" ");
1300
+ if (!fullName || !componentName || fullName === componentName) return fullName || componentName;
1301
+ return JSON.stringify([fullName, componentName]);
1302
+ }
1303
+ function coreProductBatchRequestKey(path2, request) {
1304
+ if (path2 === "api/v1/find-email") {
1305
+ return JSON.stringify([
1306
+ normalizedFindEmailBatchName(request),
1307
+ normalizedBatchDomain(request.company_domain),
1308
+ normalizedBatchLinkedIn(request.linkedin_url),
1309
+ normalizedBatchText(request.company_name),
1310
+ request.skip_cache === true || request.bypass_cache === true
1311
+ ]);
1312
+ }
1313
+ if (path2 === "api/v1/verify-email") {
1314
+ return JSON.stringify([
1315
+ normalizedBatchText(request.email),
1316
+ request.skip_cache === true || request.bypass_cache === true,
1317
+ request.skip_catch_all_verification === true,
1318
+ request.skip_esp_check === true
1319
+ ]);
1320
+ }
1321
+ if (path2 === "api/v1/company-signals") {
1322
+ const online = request.online !== false;
1323
+ const deepSearch = request.enable_deep_search === void 0 ? online : request.enable_deep_search !== false;
1324
+ return JSON.stringify([
1325
+ normalizedBatchText(request.signal_run_id),
1326
+ normalizedBatchDomain(request.company_domain || request.domain),
1327
+ normalizedBatchText(request.company_name),
1328
+ normalizedBatchText(request.company_id),
1329
+ normalizedBatchLinkedIn(request.linkedin_url),
1330
+ normalizedBatchText(request.industry),
1331
+ typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
1332
+ normalizedBatchList(request.signal_types),
1333
+ Number(request.target_signal_count) || null,
1334
+ Number(request.lookback_days) || null,
1335
+ online,
1336
+ deepSearch,
1337
+ normalizedBatchText(request.search_mode || "balanced"),
1338
+ request.enable_outreach_intelligence === true,
1339
+ request.enable_predictive_intelligence === true,
1340
+ request.skip_cache === true || request.bypass_cache === true
1341
+ ]);
1342
+ }
1343
+ return JSON.stringify([
1344
+ normalizedBatchDomain(request.company_domain),
1345
+ typeof request.person_name === "string" ? request.person_name.trim() : "",
1346
+ typeof request.title === "string" ? request.title.trim() : "",
1347
+ typeof request.campaign_offer === "string" ? request.campaign_offer.trim() : "",
1348
+ typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
1349
+ typeof request.signal_run_id === "string" ? request.signal_run_id.trim() : "",
1350
+ request.skip_cache === true,
1351
+ request.enable_deep_search === true
1352
+ ]);
1353
+ }
1281
1354
  function finalizeCoreBatch(total, startedAt, round, normalize, options) {
1282
1355
  const results = new Array(total);
1283
1356
  for (const item of round) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Signaliz
4
- } from "./chunk-K7RDDRMJ.mjs";
4
+ } from "./chunk-SZ3H5W5L.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.56",
3
+ "version": "1.0.57",
4
4
  "description": "Signaliz SDK for Signals Everything, Find Email, Verify Email, Company Signal Enrichment, and Signal to Copy AI.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",