@signaliz/sdk 1.0.48 → 1.0.49
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 +2 -1
- package/dist/{chunk-NOOQDYOJ.mjs → chunk-KA66GBVZ.mjs} +36 -1
- package/dist/index.d.mts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +36 -1
- package/dist/index.mjs +1 -1
- package/dist/mcp-config.js +36 -1
- package/dist/mcp-config.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,7 +124,8 @@ normally finishes within an agent turn; set `skipCache` or `enableDeepSearch`
|
|
|
124
124
|
only when fresh or deeper research is required.
|
|
125
125
|
Unclassified evidence is returned by signal enrichment but is not used to
|
|
126
126
|
generate outreach copy.
|
|
127
|
-
Each normalized signal
|
|
127
|
+
Each normalized signal keeps `date` separate from crawl-time `detectedAt` and
|
|
128
|
+
also exposes `datePrecision`, `hasSpecificDate`, `sourceProvenance`,
|
|
128
129
|
`entityConfidence`, `classification`, `derived`, `evidencePublishedDate`,
|
|
129
130
|
`signalFeedSource`, and the provider `metadata` needed for integrity audits.
|
|
130
131
|
|
|
@@ -457,6 +457,7 @@ var Signaliz = class {
|
|
|
457
457
|
);
|
|
458
458
|
}
|
|
459
459
|
async enrichCompanySignals(params) {
|
|
460
|
+
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
460
461
|
const request = companySignalRequestBody(params);
|
|
461
462
|
const data = await this.client.post("api/v1/company-signals", request);
|
|
462
463
|
if (isCoreProductDryRun(data)) return normalizeCoreProductDryRunResult(data);
|
|
@@ -465,6 +466,7 @@ var Signaliz = class {
|
|
|
465
466
|
}
|
|
466
467
|
async enrichCompanies(companies, options) {
|
|
467
468
|
validateBatchSize(companies);
|
|
469
|
+
companies.forEach((params) => validateCoreProductMaxWaitMs(params.maxWaitMs));
|
|
468
470
|
if (options?.dryRun === true) {
|
|
469
471
|
return this.runCoreProductDryRun(
|
|
470
472
|
"api/v1/company-signals",
|
|
@@ -901,6 +903,15 @@ function normalizeFindEmailResult(data) {
|
|
|
901
903
|
verifiedAt: typeof data.verified_at === "string" ? data.verified_at : null,
|
|
902
904
|
needsReverification,
|
|
903
905
|
providerUsed: data.provider_used ?? data.provider ?? data.email_source ?? data.source ?? "unknown",
|
|
906
|
+
creditsUsed: data.credits_used,
|
|
907
|
+
estimatedExternalCostUsd: data.estimated_external_cost_usd,
|
|
908
|
+
billingMetadata: data.billing_metadata,
|
|
909
|
+
resultReturnedFrom: data.result_returned_from,
|
|
910
|
+
cacheHit: data.cache_hit,
|
|
911
|
+
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
912
|
+
liveProviderCalled: data.live_provider_called,
|
|
913
|
+
openrouterCalled: data.openrouter_called,
|
|
914
|
+
byoOpenrouterUsed: data.byo_openrouter_used,
|
|
904
915
|
error: found ? void 0 : data.error ?? "No verified email found",
|
|
905
916
|
errorCode: found ? void 0 : data.error_code ?? "EMAIL_NOT_FOUND",
|
|
906
917
|
raw: data
|
|
@@ -910,6 +921,7 @@ function normalizeVerifyEmailResult(email, data) {
|
|
|
910
921
|
const verificationStatus = String(data.verification_status ?? "").toLowerCase();
|
|
911
922
|
const verified = data.email_verified === true || ["valid", "deliverable"].includes(verificationStatus);
|
|
912
923
|
return {
|
|
924
|
+
success: data.success !== false,
|
|
913
925
|
email: data.email ?? email,
|
|
914
926
|
status: String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
|
|
915
927
|
verificationRunId: data.verification_run_id ?? data.run_id,
|
|
@@ -918,9 +930,20 @@ function normalizeVerifyEmailResult(email, data) {
|
|
|
918
930
|
isValid: data.is_valid ?? data.valid ?? verified,
|
|
919
931
|
isDeliverable: data.is_deliverable ?? data.deliverable ?? verified,
|
|
920
932
|
isCatchAll: data.email_is_catch_all ?? data.is_catch_all ?? data.catch_all ?? data.diagnostics?.is_catch_all ?? false,
|
|
933
|
+
verifiedForSending: data.verified_for_sending === true,
|
|
934
|
+
verificationVerdict: data.verification_verdict ?? data.verification_status ?? "unknown",
|
|
921
935
|
confidenceScore: data.confidence_score ?? data.confidence ?? data.diagnostics?.confidence_score ?? (verified ? 1 : 0),
|
|
922
936
|
provider: data.provider,
|
|
923
937
|
verificationSource: data.verification_source,
|
|
938
|
+
billingReplayed: data.billing_replayed,
|
|
939
|
+
creditsUsed: data.credits_used,
|
|
940
|
+
billingMetadata: data.billing_metadata,
|
|
941
|
+
resultReturnedFrom: data.result_returned_from,
|
|
942
|
+
cacheHit: data.cache_hit,
|
|
943
|
+
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
944
|
+
liveProviderCalled: data.live_provider_called,
|
|
945
|
+
openrouterCalled: data.openrouter_called,
|
|
946
|
+
byoOpenrouterUsed: data.byo_openrouter_used,
|
|
924
947
|
raw: data
|
|
925
948
|
};
|
|
926
949
|
}
|
|
@@ -964,8 +987,10 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
964
987
|
title: signal.title ?? "",
|
|
965
988
|
type: signal.type ?? signal.signal_type ?? "unknown",
|
|
966
989
|
content: signal.content ?? signal.description ?? "",
|
|
967
|
-
date: signal.date ??
|
|
990
|
+
date: signal.date ?? null,
|
|
991
|
+
detectedAt: signal.detected_at ?? null,
|
|
968
992
|
datePrecision: signal.date_precision,
|
|
993
|
+
hasSpecificDate: signal.has_specific_date ?? metadata?.has_specific_date,
|
|
969
994
|
sourceUrl: signal.source_url ?? signal.url ?? null,
|
|
970
995
|
sourceType: signal.source_type,
|
|
971
996
|
sourceProvenance: signal.source_provenance,
|
|
@@ -994,7 +1019,10 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
994
1019
|
billingMetadata: data.billing_metadata,
|
|
995
1020
|
resultReturnedFrom: data.result_returned_from,
|
|
996
1021
|
cacheHit: data.cache_hit,
|
|
1022
|
+
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
997
1023
|
liveProviderCalled: data.live_provider_called,
|
|
1024
|
+
aiProviderCalled: data.ai_provider_called,
|
|
1025
|
+
byoAiUsed: data.byo_ai_used,
|
|
998
1026
|
metadata: data.metadata,
|
|
999
1027
|
raw: data
|
|
1000
1028
|
};
|
|
@@ -1100,6 +1128,7 @@ function signalToCopyRequestBody(params) {
|
|
|
1100
1128
|
});
|
|
1101
1129
|
}
|
|
1102
1130
|
function validateSignalToCopyParams(params) {
|
|
1131
|
+
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
1103
1132
|
if (typeof params.signalRunId === "string" && params.signalRunId.trim()) return;
|
|
1104
1133
|
const missing = [
|
|
1105
1134
|
["companyDomain", params.companyDomain],
|
|
@@ -1111,6 +1140,12 @@ function validateSignalToCopyParams(params) {
|
|
|
1111
1140
|
throw new TypeError(`Signal to Copy requires signalRunId or: ${missing.join(", ")}`);
|
|
1112
1141
|
}
|
|
1113
1142
|
}
|
|
1143
|
+
function validateCoreProductMaxWaitMs(value) {
|
|
1144
|
+
if (value === void 0) return;
|
|
1145
|
+
if (!Number.isInteger(value) || value < 1e4 || value > 12e4) {
|
|
1146
|
+
throw new RangeError("maxWaitMs must be an integer between 10000 and 120000");
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1114
1149
|
function normalizeSignalToCopyResult(data) {
|
|
1115
1150
|
return {
|
|
1116
1151
|
success: data.success ?? true,
|
package/dist/index.d.mts
CHANGED
|
@@ -92,11 +92,21 @@ interface FindEmailResult {
|
|
|
92
92
|
verifiedAt: string | null;
|
|
93
93
|
needsReverification: boolean;
|
|
94
94
|
providerUsed: string;
|
|
95
|
+
creditsUsed?: number;
|
|
96
|
+
estimatedExternalCostUsd?: number;
|
|
97
|
+
billingMetadata?: Record<string, unknown>;
|
|
98
|
+
resultReturnedFrom?: string;
|
|
99
|
+
cacheHit?: boolean;
|
|
100
|
+
freshEnrichmentUsed?: boolean;
|
|
101
|
+
liveProviderCalled?: boolean;
|
|
102
|
+
openrouterCalled?: boolean;
|
|
103
|
+
byoOpenrouterUsed?: boolean;
|
|
95
104
|
error?: string;
|
|
96
105
|
errorCode?: string;
|
|
97
106
|
raw: Record<string, unknown>;
|
|
98
107
|
}
|
|
99
108
|
interface VerifyEmailResult {
|
|
109
|
+
success: boolean;
|
|
100
110
|
email: string;
|
|
101
111
|
/** Execution state. Processing results are never send-safe. */
|
|
102
112
|
status: 'processing' | 'completed';
|
|
@@ -107,9 +117,21 @@ interface VerifyEmailResult {
|
|
|
107
117
|
isValid: boolean;
|
|
108
118
|
isDeliverable: boolean;
|
|
109
119
|
isCatchAll: boolean;
|
|
120
|
+
/** Explicit send-safety verdict. Missing or false never becomes true by inference. */
|
|
121
|
+
verifiedForSending: boolean;
|
|
122
|
+
verificationVerdict: string;
|
|
110
123
|
confidenceScore: number;
|
|
111
124
|
provider?: string;
|
|
112
125
|
verificationSource?: string;
|
|
126
|
+
billingReplayed?: boolean;
|
|
127
|
+
creditsUsed?: number;
|
|
128
|
+
billingMetadata?: Record<string, unknown>;
|
|
129
|
+
resultReturnedFrom?: string;
|
|
130
|
+
cacheHit?: boolean;
|
|
131
|
+
freshEnrichmentUsed?: boolean;
|
|
132
|
+
liveProviderCalled?: boolean;
|
|
133
|
+
openrouterCalled?: boolean;
|
|
134
|
+
byoOpenrouterUsed?: boolean;
|
|
113
135
|
raw: Record<string, unknown>;
|
|
114
136
|
}
|
|
115
137
|
interface VerifyEmailOptions {
|
|
@@ -164,7 +186,9 @@ interface CompanySignal {
|
|
|
164
186
|
type: string;
|
|
165
187
|
content: string;
|
|
166
188
|
date?: string | null;
|
|
189
|
+
detectedAt?: string | null;
|
|
167
190
|
datePrecision?: string;
|
|
191
|
+
hasSpecificDate?: boolean;
|
|
168
192
|
sourceUrl?: string | null;
|
|
169
193
|
sourceType?: string;
|
|
170
194
|
sourceProvenance?: string;
|
|
@@ -201,7 +225,10 @@ interface CompanySignalEnrichmentResult {
|
|
|
201
225
|
billingMetadata?: Record<string, unknown>;
|
|
202
226
|
resultReturnedFrom?: string;
|
|
203
227
|
cacheHit?: boolean;
|
|
228
|
+
freshEnrichmentUsed?: boolean;
|
|
204
229
|
liveProviderCalled?: boolean;
|
|
230
|
+
aiProviderCalled?: boolean;
|
|
231
|
+
byoAiUsed?: boolean;
|
|
205
232
|
metadata?: Record<string, unknown>;
|
|
206
233
|
raw: Record<string, unknown>;
|
|
207
234
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -92,11 +92,21 @@ interface FindEmailResult {
|
|
|
92
92
|
verifiedAt: string | null;
|
|
93
93
|
needsReverification: boolean;
|
|
94
94
|
providerUsed: string;
|
|
95
|
+
creditsUsed?: number;
|
|
96
|
+
estimatedExternalCostUsd?: number;
|
|
97
|
+
billingMetadata?: Record<string, unknown>;
|
|
98
|
+
resultReturnedFrom?: string;
|
|
99
|
+
cacheHit?: boolean;
|
|
100
|
+
freshEnrichmentUsed?: boolean;
|
|
101
|
+
liveProviderCalled?: boolean;
|
|
102
|
+
openrouterCalled?: boolean;
|
|
103
|
+
byoOpenrouterUsed?: boolean;
|
|
95
104
|
error?: string;
|
|
96
105
|
errorCode?: string;
|
|
97
106
|
raw: Record<string, unknown>;
|
|
98
107
|
}
|
|
99
108
|
interface VerifyEmailResult {
|
|
109
|
+
success: boolean;
|
|
100
110
|
email: string;
|
|
101
111
|
/** Execution state. Processing results are never send-safe. */
|
|
102
112
|
status: 'processing' | 'completed';
|
|
@@ -107,9 +117,21 @@ interface VerifyEmailResult {
|
|
|
107
117
|
isValid: boolean;
|
|
108
118
|
isDeliverable: boolean;
|
|
109
119
|
isCatchAll: boolean;
|
|
120
|
+
/** Explicit send-safety verdict. Missing or false never becomes true by inference. */
|
|
121
|
+
verifiedForSending: boolean;
|
|
122
|
+
verificationVerdict: string;
|
|
110
123
|
confidenceScore: number;
|
|
111
124
|
provider?: string;
|
|
112
125
|
verificationSource?: string;
|
|
126
|
+
billingReplayed?: boolean;
|
|
127
|
+
creditsUsed?: number;
|
|
128
|
+
billingMetadata?: Record<string, unknown>;
|
|
129
|
+
resultReturnedFrom?: string;
|
|
130
|
+
cacheHit?: boolean;
|
|
131
|
+
freshEnrichmentUsed?: boolean;
|
|
132
|
+
liveProviderCalled?: boolean;
|
|
133
|
+
openrouterCalled?: boolean;
|
|
134
|
+
byoOpenrouterUsed?: boolean;
|
|
113
135
|
raw: Record<string, unknown>;
|
|
114
136
|
}
|
|
115
137
|
interface VerifyEmailOptions {
|
|
@@ -164,7 +186,9 @@ interface CompanySignal {
|
|
|
164
186
|
type: string;
|
|
165
187
|
content: string;
|
|
166
188
|
date?: string | null;
|
|
189
|
+
detectedAt?: string | null;
|
|
167
190
|
datePrecision?: string;
|
|
191
|
+
hasSpecificDate?: boolean;
|
|
168
192
|
sourceUrl?: string | null;
|
|
169
193
|
sourceType?: string;
|
|
170
194
|
sourceProvenance?: string;
|
|
@@ -201,7 +225,10 @@ interface CompanySignalEnrichmentResult {
|
|
|
201
225
|
billingMetadata?: Record<string, unknown>;
|
|
202
226
|
resultReturnedFrom?: string;
|
|
203
227
|
cacheHit?: boolean;
|
|
228
|
+
freshEnrichmentUsed?: boolean;
|
|
204
229
|
liveProviderCalled?: boolean;
|
|
230
|
+
aiProviderCalled?: boolean;
|
|
231
|
+
byoAiUsed?: boolean;
|
|
205
232
|
metadata?: Record<string, unknown>;
|
|
206
233
|
raw: Record<string, unknown>;
|
|
207
234
|
}
|
package/dist/index.js
CHANGED
|
@@ -484,6 +484,7 @@ var Signaliz = class {
|
|
|
484
484
|
);
|
|
485
485
|
}
|
|
486
486
|
async enrichCompanySignals(params) {
|
|
487
|
+
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
487
488
|
const request = companySignalRequestBody(params);
|
|
488
489
|
const data = await this.client.post("api/v1/company-signals", request);
|
|
489
490
|
if (isCoreProductDryRun(data)) return normalizeCoreProductDryRunResult(data);
|
|
@@ -492,6 +493,7 @@ var Signaliz = class {
|
|
|
492
493
|
}
|
|
493
494
|
async enrichCompanies(companies, options) {
|
|
494
495
|
validateBatchSize(companies);
|
|
496
|
+
companies.forEach((params) => validateCoreProductMaxWaitMs(params.maxWaitMs));
|
|
495
497
|
if (options?.dryRun === true) {
|
|
496
498
|
return this.runCoreProductDryRun(
|
|
497
499
|
"api/v1/company-signals",
|
|
@@ -928,6 +930,15 @@ function normalizeFindEmailResult(data) {
|
|
|
928
930
|
verifiedAt: typeof data.verified_at === "string" ? data.verified_at : null,
|
|
929
931
|
needsReverification,
|
|
930
932
|
providerUsed: data.provider_used ?? data.provider ?? data.email_source ?? data.source ?? "unknown",
|
|
933
|
+
creditsUsed: data.credits_used,
|
|
934
|
+
estimatedExternalCostUsd: data.estimated_external_cost_usd,
|
|
935
|
+
billingMetadata: data.billing_metadata,
|
|
936
|
+
resultReturnedFrom: data.result_returned_from,
|
|
937
|
+
cacheHit: data.cache_hit,
|
|
938
|
+
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
939
|
+
liveProviderCalled: data.live_provider_called,
|
|
940
|
+
openrouterCalled: data.openrouter_called,
|
|
941
|
+
byoOpenrouterUsed: data.byo_openrouter_used,
|
|
931
942
|
error: found ? void 0 : data.error ?? "No verified email found",
|
|
932
943
|
errorCode: found ? void 0 : data.error_code ?? "EMAIL_NOT_FOUND",
|
|
933
944
|
raw: data
|
|
@@ -937,6 +948,7 @@ function normalizeVerifyEmailResult(email, data) {
|
|
|
937
948
|
const verificationStatus = String(data.verification_status ?? "").toLowerCase();
|
|
938
949
|
const verified = data.email_verified === true || ["valid", "deliverable"].includes(verificationStatus);
|
|
939
950
|
return {
|
|
951
|
+
success: data.success !== false,
|
|
940
952
|
email: data.email ?? email,
|
|
941
953
|
status: String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
|
|
942
954
|
verificationRunId: data.verification_run_id ?? data.run_id,
|
|
@@ -945,9 +957,20 @@ function normalizeVerifyEmailResult(email, data) {
|
|
|
945
957
|
isValid: data.is_valid ?? data.valid ?? verified,
|
|
946
958
|
isDeliverable: data.is_deliverable ?? data.deliverable ?? verified,
|
|
947
959
|
isCatchAll: data.email_is_catch_all ?? data.is_catch_all ?? data.catch_all ?? data.diagnostics?.is_catch_all ?? false,
|
|
960
|
+
verifiedForSending: data.verified_for_sending === true,
|
|
961
|
+
verificationVerdict: data.verification_verdict ?? data.verification_status ?? "unknown",
|
|
948
962
|
confidenceScore: data.confidence_score ?? data.confidence ?? data.diagnostics?.confidence_score ?? (verified ? 1 : 0),
|
|
949
963
|
provider: data.provider,
|
|
950
964
|
verificationSource: data.verification_source,
|
|
965
|
+
billingReplayed: data.billing_replayed,
|
|
966
|
+
creditsUsed: data.credits_used,
|
|
967
|
+
billingMetadata: data.billing_metadata,
|
|
968
|
+
resultReturnedFrom: data.result_returned_from,
|
|
969
|
+
cacheHit: data.cache_hit,
|
|
970
|
+
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
971
|
+
liveProviderCalled: data.live_provider_called,
|
|
972
|
+
openrouterCalled: data.openrouter_called,
|
|
973
|
+
byoOpenrouterUsed: data.byo_openrouter_used,
|
|
951
974
|
raw: data
|
|
952
975
|
};
|
|
953
976
|
}
|
|
@@ -991,8 +1014,10 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
991
1014
|
title: signal.title ?? "",
|
|
992
1015
|
type: signal.type ?? signal.signal_type ?? "unknown",
|
|
993
1016
|
content: signal.content ?? signal.description ?? "",
|
|
994
|
-
date: signal.date ??
|
|
1017
|
+
date: signal.date ?? null,
|
|
1018
|
+
detectedAt: signal.detected_at ?? null,
|
|
995
1019
|
datePrecision: signal.date_precision,
|
|
1020
|
+
hasSpecificDate: signal.has_specific_date ?? metadata?.has_specific_date,
|
|
996
1021
|
sourceUrl: signal.source_url ?? signal.url ?? null,
|
|
997
1022
|
sourceType: signal.source_type,
|
|
998
1023
|
sourceProvenance: signal.source_provenance,
|
|
@@ -1021,7 +1046,10 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
1021
1046
|
billingMetadata: data.billing_metadata,
|
|
1022
1047
|
resultReturnedFrom: data.result_returned_from,
|
|
1023
1048
|
cacheHit: data.cache_hit,
|
|
1049
|
+
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
1024
1050
|
liveProviderCalled: data.live_provider_called,
|
|
1051
|
+
aiProviderCalled: data.ai_provider_called,
|
|
1052
|
+
byoAiUsed: data.byo_ai_used,
|
|
1025
1053
|
metadata: data.metadata,
|
|
1026
1054
|
raw: data
|
|
1027
1055
|
};
|
|
@@ -1127,6 +1155,7 @@ function signalToCopyRequestBody(params) {
|
|
|
1127
1155
|
});
|
|
1128
1156
|
}
|
|
1129
1157
|
function validateSignalToCopyParams(params) {
|
|
1158
|
+
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
1130
1159
|
if (typeof params.signalRunId === "string" && params.signalRunId.trim()) return;
|
|
1131
1160
|
const missing = [
|
|
1132
1161
|
["companyDomain", params.companyDomain],
|
|
@@ -1138,6 +1167,12 @@ function validateSignalToCopyParams(params) {
|
|
|
1138
1167
|
throw new TypeError(`Signal to Copy requires signalRunId or: ${missing.join(", ")}`);
|
|
1139
1168
|
}
|
|
1140
1169
|
}
|
|
1170
|
+
function validateCoreProductMaxWaitMs(value) {
|
|
1171
|
+
if (value === void 0) return;
|
|
1172
|
+
if (!Number.isInteger(value) || value < 1e4 || value > 12e4) {
|
|
1173
|
+
throw new RangeError("maxWaitMs must be an integer between 10000 and 120000");
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1141
1176
|
function normalizeSignalToCopyResult(data) {
|
|
1142
1177
|
return {
|
|
1143
1178
|
success: data.success ?? true,
|
package/dist/index.mjs
CHANGED
package/dist/mcp-config.js
CHANGED
|
@@ -488,6 +488,7 @@ var Signaliz = class {
|
|
|
488
488
|
);
|
|
489
489
|
}
|
|
490
490
|
async enrichCompanySignals(params) {
|
|
491
|
+
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
491
492
|
const request = companySignalRequestBody(params);
|
|
492
493
|
const data = await this.client.post("api/v1/company-signals", request);
|
|
493
494
|
if (isCoreProductDryRun(data)) return normalizeCoreProductDryRunResult(data);
|
|
@@ -496,6 +497,7 @@ var Signaliz = class {
|
|
|
496
497
|
}
|
|
497
498
|
async enrichCompanies(companies, options) {
|
|
498
499
|
validateBatchSize(companies);
|
|
500
|
+
companies.forEach((params) => validateCoreProductMaxWaitMs(params.maxWaitMs));
|
|
499
501
|
if (options?.dryRun === true) {
|
|
500
502
|
return this.runCoreProductDryRun(
|
|
501
503
|
"api/v1/company-signals",
|
|
@@ -932,6 +934,15 @@ function normalizeFindEmailResult(data) {
|
|
|
932
934
|
verifiedAt: typeof data.verified_at === "string" ? data.verified_at : null,
|
|
933
935
|
needsReverification,
|
|
934
936
|
providerUsed: data.provider_used ?? data.provider ?? data.email_source ?? data.source ?? "unknown",
|
|
937
|
+
creditsUsed: data.credits_used,
|
|
938
|
+
estimatedExternalCostUsd: data.estimated_external_cost_usd,
|
|
939
|
+
billingMetadata: data.billing_metadata,
|
|
940
|
+
resultReturnedFrom: data.result_returned_from,
|
|
941
|
+
cacheHit: data.cache_hit,
|
|
942
|
+
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
943
|
+
liveProviderCalled: data.live_provider_called,
|
|
944
|
+
openrouterCalled: data.openrouter_called,
|
|
945
|
+
byoOpenrouterUsed: data.byo_openrouter_used,
|
|
935
946
|
error: found ? void 0 : data.error ?? "No verified email found",
|
|
936
947
|
errorCode: found ? void 0 : data.error_code ?? "EMAIL_NOT_FOUND",
|
|
937
948
|
raw: data
|
|
@@ -941,6 +952,7 @@ function normalizeVerifyEmailResult(email, data) {
|
|
|
941
952
|
const verificationStatus = String(data.verification_status ?? "").toLowerCase();
|
|
942
953
|
const verified = data.email_verified === true || ["valid", "deliverable"].includes(verificationStatus);
|
|
943
954
|
return {
|
|
955
|
+
success: data.success !== false,
|
|
944
956
|
email: data.email ?? email,
|
|
945
957
|
status: String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
|
|
946
958
|
verificationRunId: data.verification_run_id ?? data.run_id,
|
|
@@ -949,9 +961,20 @@ function normalizeVerifyEmailResult(email, data) {
|
|
|
949
961
|
isValid: data.is_valid ?? data.valid ?? verified,
|
|
950
962
|
isDeliverable: data.is_deliverable ?? data.deliverable ?? verified,
|
|
951
963
|
isCatchAll: data.email_is_catch_all ?? data.is_catch_all ?? data.catch_all ?? data.diagnostics?.is_catch_all ?? false,
|
|
964
|
+
verifiedForSending: data.verified_for_sending === true,
|
|
965
|
+
verificationVerdict: data.verification_verdict ?? data.verification_status ?? "unknown",
|
|
952
966
|
confidenceScore: data.confidence_score ?? data.confidence ?? data.diagnostics?.confidence_score ?? (verified ? 1 : 0),
|
|
953
967
|
provider: data.provider,
|
|
954
968
|
verificationSource: data.verification_source,
|
|
969
|
+
billingReplayed: data.billing_replayed,
|
|
970
|
+
creditsUsed: data.credits_used,
|
|
971
|
+
billingMetadata: data.billing_metadata,
|
|
972
|
+
resultReturnedFrom: data.result_returned_from,
|
|
973
|
+
cacheHit: data.cache_hit,
|
|
974
|
+
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
975
|
+
liveProviderCalled: data.live_provider_called,
|
|
976
|
+
openrouterCalled: data.openrouter_called,
|
|
977
|
+
byoOpenrouterUsed: data.byo_openrouter_used,
|
|
955
978
|
raw: data
|
|
956
979
|
};
|
|
957
980
|
}
|
|
@@ -995,8 +1018,10 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
995
1018
|
title: signal.title ?? "",
|
|
996
1019
|
type: signal.type ?? signal.signal_type ?? "unknown",
|
|
997
1020
|
content: signal.content ?? signal.description ?? "",
|
|
998
|
-
date: signal.date ??
|
|
1021
|
+
date: signal.date ?? null,
|
|
1022
|
+
detectedAt: signal.detected_at ?? null,
|
|
999
1023
|
datePrecision: signal.date_precision,
|
|
1024
|
+
hasSpecificDate: signal.has_specific_date ?? metadata?.has_specific_date,
|
|
1000
1025
|
sourceUrl: signal.source_url ?? signal.url ?? null,
|
|
1001
1026
|
sourceType: signal.source_type,
|
|
1002
1027
|
sourceProvenance: signal.source_provenance,
|
|
@@ -1025,7 +1050,10 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
1025
1050
|
billingMetadata: data.billing_metadata,
|
|
1026
1051
|
resultReturnedFrom: data.result_returned_from,
|
|
1027
1052
|
cacheHit: data.cache_hit,
|
|
1053
|
+
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
1028
1054
|
liveProviderCalled: data.live_provider_called,
|
|
1055
|
+
aiProviderCalled: data.ai_provider_called,
|
|
1056
|
+
byoAiUsed: data.byo_ai_used,
|
|
1029
1057
|
metadata: data.metadata,
|
|
1030
1058
|
raw: data
|
|
1031
1059
|
};
|
|
@@ -1131,6 +1159,7 @@ function signalToCopyRequestBody(params) {
|
|
|
1131
1159
|
});
|
|
1132
1160
|
}
|
|
1133
1161
|
function validateSignalToCopyParams(params) {
|
|
1162
|
+
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
1134
1163
|
if (typeof params.signalRunId === "string" && params.signalRunId.trim()) return;
|
|
1135
1164
|
const missing = [
|
|
1136
1165
|
["companyDomain", params.companyDomain],
|
|
@@ -1142,6 +1171,12 @@ function validateSignalToCopyParams(params) {
|
|
|
1142
1171
|
throw new TypeError(`Signal to Copy requires signalRunId or: ${missing.join(", ")}`);
|
|
1143
1172
|
}
|
|
1144
1173
|
}
|
|
1174
|
+
function validateCoreProductMaxWaitMs(value) {
|
|
1175
|
+
if (value === void 0) return;
|
|
1176
|
+
if (!Number.isInteger(value) || value < 1e4 || value > 12e4) {
|
|
1177
|
+
throw new RangeError("maxWaitMs must be an integer between 10000 and 120000");
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1145
1180
|
function normalizeSignalToCopyResult(data) {
|
|
1146
1181
|
return {
|
|
1147
1182
|
success: data.success ?? true,
|
package/dist/mcp-config.mjs
CHANGED
package/package.json
CHANGED