@signaliz/sdk 1.0.72 → 1.0.74
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 +13 -23
- package/dist/{chunk-MFXKZU6K.mjs → chunk-KZICNZZF.mjs} +84 -73
- package/dist/index.d.mts +26 -56
- package/dist/index.d.ts +26 -56
- package/dist/index.js +84 -73
- package/dist/index.mjs +1 -1
- package/dist/mcp-config.js +84 -73
- package/dist/mcp-config.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,10 +11,13 @@ Production REST endpoints:
|
|
|
11
11
|
|
|
12
12
|
- `https://api.signaliz.com/functions/v1/api/v1/find-email`
|
|
13
13
|
- `https://api.signaliz.com/functions/v1/api/v1/verify-email`
|
|
14
|
-
- `https://api.signaliz.com/functions/v1/
|
|
14
|
+
- `https://api.signaliz.com/functions/v1/company-signal-enrichment-v2`
|
|
15
15
|
- `https://api.signaliz.com/functions/v1/api/v1/signal-to-copy`
|
|
16
16
|
- `https://api.signaliz.com/functions/v1/api/v1/signals`
|
|
17
|
-
- `https://api.signaliz.com/functions/v1/api/v1/signal-awareness`
|
|
17
|
+
- `https://api.signaliz.com/functions/v1/api/v1/signal-awareness/signals`
|
|
18
|
+
- `https://api.signaliz.com/functions/v1/api/v1/signal-awareness/companies/add`
|
|
19
|
+
- `https://api.signaliz.com/functions/v1/api/v1/signal-awareness/companies/delete`
|
|
20
|
+
- `https://api.signaliz.com/functions/v1/api/v1/signal-awareness/companies/schedule`
|
|
18
21
|
- `https://api.signaliz.com/functions/v1/api/v1/flow`
|
|
19
22
|
|
|
20
23
|
The same request and response schemas are available under `/api/v2/`.
|
|
@@ -68,6 +71,7 @@ console.log(resumedVerification.creditsUsed, resumedVerification.billingReplayed
|
|
|
68
71
|
|
|
69
72
|
const signals = await signaliz.enrichCompanySignals({
|
|
70
73
|
domain: 'example.com',
|
|
74
|
+
researchPrompt: 'Find recent signals that explain why this company would use Signaliz.',
|
|
71
75
|
});
|
|
72
76
|
// Signal rows expose only the customer-facing signal fields.
|
|
73
77
|
console.log(
|
|
@@ -81,13 +85,6 @@ console.log(
|
|
|
81
85
|
const signalDiscovery = await signaliz.discoverSignals({
|
|
82
86
|
query: 'companies that just got funded',
|
|
83
87
|
limit: 100,
|
|
84
|
-
sources: ['web', 'news'],
|
|
85
|
-
});
|
|
86
|
-
const painSignalDiscovery = await signaliz.discoverSignals({
|
|
87
|
-
query: 'companies showing signals they need account-signal automation',
|
|
88
|
-
icpContext: 'B2B SaaS companies with outbound sales teams and manual account research',
|
|
89
|
-
limit: 100,
|
|
90
|
-
sources: ['web', 'news'],
|
|
91
88
|
});
|
|
92
89
|
const completedDiscovery = signalDiscovery.signalSearchRunId
|
|
93
90
|
? await signaliz.discoverSignals({ signalSearchRunId: signalDiscovery.signalSearchRunId })
|
|
@@ -103,23 +100,17 @@ const copy = await signaliz.signalToCopy({
|
|
|
103
100
|
enableDeepSearch: false,
|
|
104
101
|
});
|
|
105
102
|
|
|
106
|
-
|
|
107
|
-
const copyFromSignalRun = await signaliz.signalToCopy({
|
|
103
|
+
const offerLedCopy = await signaliz.signalToCopy({
|
|
108
104
|
companyDomain: 'example.com',
|
|
109
105
|
personName: 'Jane Doe',
|
|
110
106
|
title: 'VP Sales',
|
|
111
107
|
campaignOffer: 'pipeline intelligence',
|
|
112
|
-
|
|
108
|
+
runWithoutSignal: true,
|
|
113
109
|
});
|
|
114
|
-
// The copy result reuses the completed snapshot without rediscovery.
|
|
115
110
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
schedule: 'daily',
|
|
120
|
-
});
|
|
121
|
-
await signaliz.updateSignalMonitor(monitor.monitor?.id!, { schedule: 'weekly' });
|
|
122
|
-
const awareness = await signaliz.listSignalAwarenessSignals(monitor.monitor?.id);
|
|
111
|
+
await signaliz.addSignalAwarenessCompany('acme.com', 'daily');
|
|
112
|
+
await signaliz.changeSignalAwarenessSchedule('acme.com', 'weekly');
|
|
113
|
+
const awareness = await signaliz.listAllSignalAwarenessSignals('acme.com');
|
|
123
114
|
console.log(
|
|
124
115
|
awareness.signals?.[0].signal_type,
|
|
125
116
|
awareness.signals?.[0].source,
|
|
@@ -127,8 +118,7 @@ console.log(
|
|
|
127
118
|
awareness.signals?.[0].company_name,
|
|
128
119
|
awareness.signals?.[0].domain,
|
|
129
120
|
);
|
|
130
|
-
|
|
131
|
-
// Signal Enrichment. Use scheduleCron for an exact UTC schedule.
|
|
121
|
+
await signaliz.deleteSignalAwarenessCompany('acme.com');
|
|
132
122
|
|
|
133
123
|
// Flow uses the same versioned REST gateway as every other SDK capability.
|
|
134
124
|
const flow = await signaliz.startFlow({
|
|
@@ -230,7 +220,7 @@ Single calls and synchronous batches of at most 25 may instead pass
|
|
|
230
220
|
Durable batches of 26-5,000 reject these references rather than silently
|
|
231
221
|
starting new research.
|
|
232
222
|
|
|
233
|
-
Signals
|
|
223
|
+
Signals First is query-first rather than a row batch. It defaults to 100
|
|
234
224
|
distinct companies and supports up to 1,000. Every returned signal row contains
|
|
235
225
|
only a signal type, verified source URL, event date, company name, and domain.
|
|
236
226
|
A request is a ceiling, not a promise: it can return fewer results
|
|
@@ -813,6 +813,38 @@ var Signaliz = class {
|
|
|
813
813
|
);
|
|
814
814
|
return normalizeSignalAwarenessResponse(data);
|
|
815
815
|
}
|
|
816
|
+
async addSignalAwarenessCompany(domain, schedule = "daily") {
|
|
817
|
+
const data = await this.client.post(
|
|
818
|
+
"api/v1/signal-awareness/companies/add",
|
|
819
|
+
{ domain, schedule },
|
|
820
|
+
{ automaticIdempotency: false }
|
|
821
|
+
);
|
|
822
|
+
return normalizeSignalAwarenessResponse(data);
|
|
823
|
+
}
|
|
824
|
+
async deleteSignalAwarenessCompany(domain) {
|
|
825
|
+
const data = await this.client.post(
|
|
826
|
+
"api/v1/signal-awareness/companies/delete",
|
|
827
|
+
{ domain },
|
|
828
|
+
{ automaticIdempotency: false }
|
|
829
|
+
);
|
|
830
|
+
return normalizeSignalAwarenessResponse(data);
|
|
831
|
+
}
|
|
832
|
+
async changeSignalAwarenessSchedule(domain, schedule) {
|
|
833
|
+
const data = await this.client.post(
|
|
834
|
+
"api/v1/signal-awareness/companies/schedule",
|
|
835
|
+
{ domain, schedule },
|
|
836
|
+
{ automaticIdempotency: false }
|
|
837
|
+
);
|
|
838
|
+
return normalizeSignalAwarenessResponse(data);
|
|
839
|
+
}
|
|
840
|
+
async listAllSignalAwarenessSignals(domain) {
|
|
841
|
+
const data = await this.client.post(
|
|
842
|
+
"api/v1/signal-awareness/signals",
|
|
843
|
+
{ domain },
|
|
844
|
+
{ automaticIdempotency: false }
|
|
845
|
+
);
|
|
846
|
+
return normalizeSignalAwarenessResponse(data);
|
|
847
|
+
}
|
|
816
848
|
async createSignalMonitor(monitor) {
|
|
817
849
|
return this.signalAwareness({ action: "create", monitor });
|
|
818
850
|
}
|
|
@@ -1002,7 +1034,7 @@ var Signaliz = class {
|
|
|
1002
1034
|
async enrichCompanySignals(params) {
|
|
1003
1035
|
validateCompanySignalParams(params);
|
|
1004
1036
|
const request = companySignalRequestBody(params);
|
|
1005
|
-
const data = await this.client.post("
|
|
1037
|
+
const data = await this.client.post("company-signal-enrichment-v2", request);
|
|
1006
1038
|
if (isCoreProductDryRun(data)) return normalizeCoreProductDryRunResult(data);
|
|
1007
1039
|
assertTerminalSignalResponse(data, "Company Signals");
|
|
1008
1040
|
return normalizeCompanySignalResult(params, data);
|
|
@@ -1049,7 +1081,7 @@ var Signaliz = class {
|
|
|
1049
1081
|
const largeBatch = companySignalLargeBatchSubmission(requests);
|
|
1050
1082
|
if (companies.length > 25 && !largeBatch) {
|
|
1051
1083
|
throw new RangeError(
|
|
1052
|
-
"Company Signals batches larger than 25 require homogeneous new-enrichment rows with
|
|
1084
|
+
"Company Signals batches larger than 25 require homogeneous new-enrichment rows with domain and researchPrompt; split recovery or mixed-context rows into batches of at most 25."
|
|
1053
1085
|
);
|
|
1054
1086
|
}
|
|
1055
1087
|
if (options?.dryRun === true) {
|
|
@@ -1924,6 +1956,16 @@ function normalizeFindEmailResult(data) {
|
|
|
1924
1956
|
success: processing || !failed && found,
|
|
1925
1957
|
found,
|
|
1926
1958
|
email,
|
|
1959
|
+
checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
|
|
1960
|
+
candidateSource: typeof data.candidate_source === "string" ? data.candidate_source : null,
|
|
1961
|
+
primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
|
|
1962
|
+
primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
|
|
1963
|
+
terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
|
|
1964
|
+
terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
|
|
1965
|
+
terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
|
|
1966
|
+
terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
|
|
1967
|
+
terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
|
|
1968
|
+
bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
|
|
1927
1969
|
firstName: data.first_name,
|
|
1928
1970
|
lastName: data.last_name,
|
|
1929
1971
|
confidence: failed ? 0 : data.confidence ?? data.confidence_score ?? (verified ? 1 : 0),
|
|
@@ -1963,6 +2005,19 @@ function normalizeFindEmailResult(data) {
|
|
|
1963
2005
|
function normalizeVerifyEmailResult(email, data) {
|
|
1964
2006
|
data = publicProductData(data, "verify_email");
|
|
1965
2007
|
const failed = coreProductResponseFailed(data);
|
|
2008
|
+
const publicIsCatchAll = data.is_catch_all === true || data.email_is_catch_all === true;
|
|
2009
|
+
const publicPrimaryResult = String(data.primary_verdict ?? "").toLowerCase();
|
|
2010
|
+
const publicTerminalResult = String(data.terminal_result ?? "").toLowerCase();
|
|
2011
|
+
const okToSend = !failed && (data.ok_to_send === true || publicPrimaryResult === "ok" || publicPrimaryResult === "catch_all" && publicTerminalResult === "deliverable");
|
|
2012
|
+
return {
|
|
2013
|
+
email: typeof data.email === "string" ? data.email : email || null,
|
|
2014
|
+
status: String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
|
|
2015
|
+
isCatchAll: publicIsCatchAll,
|
|
2016
|
+
creditsCharged: Number.isFinite(Number(data.credits_charged)) ? Number(data.credits_charged) : 0,
|
|
2017
|
+
okToSend,
|
|
2018
|
+
...data.verification_run_id || data.run_id ? { verificationRunId: data.verification_run_id ?? data.run_id } : {},
|
|
2019
|
+
...data.next_poll_after_seconds !== void 0 ? { nextPollAfterSeconds: data.next_poll_after_seconds } : {}
|
|
2020
|
+
};
|
|
1966
2021
|
const malformed = data.is_malformed === true || data.verification_verdict === "malformed" || data.verification_status === "malformed" || data.deliverability_status === "malformed";
|
|
1967
2022
|
const verificationStatus = normalizeVerifyEmailStatus(
|
|
1968
2023
|
failed ? malformed ? "malformed" : "error" : data.verification_status ?? data.verification_verdict ?? data.deliverability_status ?? "unknown"
|
|
@@ -1977,6 +2032,15 @@ function normalizeVerifyEmailResult(email, data) {
|
|
|
1977
2032
|
error: failed ? coreProductErrorMessage(data) : void 0,
|
|
1978
2033
|
errorCode: failed ? coreProductErrorCode(data) : void 0,
|
|
1979
2034
|
email: data.email ?? email,
|
|
2035
|
+
checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
|
|
2036
|
+
primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
|
|
2037
|
+
primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
|
|
2038
|
+
terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
|
|
2039
|
+
terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
|
|
2040
|
+
terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
|
|
2041
|
+
terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
|
|
2042
|
+
terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
|
|
2043
|
+
bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
|
|
1980
2044
|
status: !failed && String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
|
|
1981
2045
|
verificationRunId,
|
|
1982
2046
|
retryAfterMs: data.retry_after_ms,
|
|
@@ -2038,16 +2102,12 @@ function companySignalRequestBody(params) {
|
|
|
2038
2102
|
return compact({
|
|
2039
2103
|
signal_run_id: params.signalRunId,
|
|
2040
2104
|
domain: params.domain ?? params.companyDomain,
|
|
2041
|
-
|
|
2042
|
-
idempotency_key: params.idempotencyKey
|
|
2105
|
+
research_prompt: params.researchPrompt
|
|
2043
2106
|
});
|
|
2044
2107
|
}
|
|
2045
2108
|
function validateCompanySignalParams(params) {
|
|
2046
|
-
if (!params.signalRunId && !(params.domain ?? params.companyDomain)?.trim()) {
|
|
2047
|
-
throw new TypeError("Company Signals requires domain");
|
|
2048
|
-
}
|
|
2049
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2050
|
-
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2109
|
+
if (!params.signalRunId && (!(params.domain ?? params.companyDomain)?.trim() || !params.researchPrompt?.trim())) {
|
|
2110
|
+
throw new TypeError("Company Signals requires domain and researchPrompt");
|
|
2051
2111
|
}
|
|
2052
2112
|
}
|
|
2053
2113
|
function companySignalParamsFromRecoveredRow(row) {
|
|
@@ -2077,7 +2137,10 @@ function companySignalLargeBatchSubmission(requests) {
|
|
|
2077
2137
|
if (!hasIdentity) return null;
|
|
2078
2138
|
}
|
|
2079
2139
|
return {
|
|
2080
|
-
requests: requests.map((request) => compact({
|
|
2140
|
+
requests: requests.map((request) => compact({
|
|
2141
|
+
domain: request.domain,
|
|
2142
|
+
research_prompt: request.research_prompt
|
|
2143
|
+
})),
|
|
2081
2144
|
submissionFields
|
|
2082
2145
|
};
|
|
2083
2146
|
}
|
|
@@ -2227,7 +2290,6 @@ function normalizeSignalizFlowStatus(data) {
|
|
|
2227
2290
|
completedAt: typeof publicData.completed_at === "string" ? publicData.completed_at : void 0
|
|
2228
2291
|
};
|
|
2229
2292
|
}
|
|
2230
|
-
var SIGNAL_DISCOVERY_SOURCES = /* @__PURE__ */ new Set(["web", "news"]);
|
|
2231
2293
|
var SIGNAL_DISCOVERY_STATUSES = /* @__PURE__ */ new Set([
|
|
2232
2294
|
"planned",
|
|
2233
2295
|
"queued",
|
|
@@ -2240,47 +2302,13 @@ function validateSignalDiscoveryParams(params) {
|
|
|
2240
2302
|
const runId = typeof params.signalSearchRunId === "string" ? params.signalSearchRunId.trim() : "";
|
|
2241
2303
|
const query = typeof params.query === "string" ? params.query.trim() : "";
|
|
2242
2304
|
if (!runId && !query) {
|
|
2243
|
-
throw new TypeError("Signals
|
|
2305
|
+
throw new TypeError("Signals First requires query or signalSearchRunId");
|
|
2244
2306
|
}
|
|
2245
2307
|
if (query && (query.length < 2 || query.length > 2e3)) {
|
|
2246
2308
|
throw new RangeError("query must contain between 2 and 2000 characters");
|
|
2247
2309
|
}
|
|
2248
|
-
if (params.
|
|
2249
|
-
|
|
2250
|
-
if (icpContext.length < 2 || icpContext.length > 4e3) {
|
|
2251
|
-
throw new RangeError("icpContext must contain between 2 and 4000 characters");
|
|
2252
|
-
}
|
|
2253
|
-
}
|
|
2254
|
-
if (params.limit !== void 0 && (!Number.isInteger(params.limit) || params.limit < 1 || params.limit > 1e3)) {
|
|
2255
|
-
throw new RangeError("limit must be an integer between 1 and 1000");
|
|
2256
|
-
}
|
|
2257
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2258
|
-
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2259
|
-
}
|
|
2260
|
-
validateSignalDateWindow(params);
|
|
2261
|
-
if (params.sources !== void 0 && (!Array.isArray(params.sources) || params.sources.length < 1 || params.sources.length > 2 || params.sources.some((source) => !SIGNAL_DISCOVERY_SOURCES.has(source)))) {
|
|
2262
|
-
throw new TypeError("sources must contain only web or news");
|
|
2263
|
-
}
|
|
2264
|
-
}
|
|
2265
|
-
function validateSignalDateWindow(params) {
|
|
2266
|
-
const afterDate = params.afterDate?.trim();
|
|
2267
|
-
const beforeDate = params.beforeDate?.trim();
|
|
2268
|
-
if ((afterDate || beforeDate) && params.lookbackDays !== void 0) {
|
|
2269
|
-
throw new RangeError("afterDate/beforeDate cannot be combined with lookbackDays");
|
|
2270
|
-
}
|
|
2271
|
-
const parseDate = (value, field) => {
|
|
2272
|
-
if (value === void 0) return void 0;
|
|
2273
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) throw new RangeError(`${field} must use YYYY-MM-DD format`);
|
|
2274
|
-
const timestamp = Date.parse(`${value}T00:00:00Z`);
|
|
2275
|
-
if (!Number.isFinite(timestamp) || new Date(timestamp).toISOString().slice(0, 10) !== value) {
|
|
2276
|
-
throw new RangeError(`${field} must be a valid calendar date`);
|
|
2277
|
-
}
|
|
2278
|
-
return timestamp;
|
|
2279
|
-
};
|
|
2280
|
-
const afterTimestamp = parseDate(afterDate, "afterDate");
|
|
2281
|
-
const beforeTimestamp = parseDate(beforeDate, "beforeDate");
|
|
2282
|
-
if (afterTimestamp !== void 0 && beforeTimestamp !== void 0 && beforeTimestamp < afterTimestamp) {
|
|
2283
|
-
throw new RangeError("beforeDate must be on or after afterDate");
|
|
2310
|
+
if (params.limit !== void 0 && (!Number.isInteger(params.limit) || params.limit < 1 || params.limit > 100)) {
|
|
2311
|
+
throw new RangeError("limit must be an integer between 1 and 100");
|
|
2284
2312
|
}
|
|
2285
2313
|
}
|
|
2286
2314
|
function signalDiscoveryRequestBody(params) {
|
|
@@ -2290,23 +2318,12 @@ function signalDiscoveryRequestBody(params) {
|
|
|
2290
2318
|
signal_search_run_id: runId,
|
|
2291
2319
|
// An explicit limit expands or narrows the retained qualified cohort;
|
|
2292
2320
|
// omitting it preserves the original preview size.
|
|
2293
|
-
limit: params.limit
|
|
2294
|
-
after_date: params.afterDate?.trim(),
|
|
2295
|
-
before_date: params.beforeDate?.trim(),
|
|
2296
|
-
dry_run: params.dryRun,
|
|
2297
|
-
idempotency_key: params.idempotencyKey
|
|
2321
|
+
limit: params.limit
|
|
2298
2322
|
});
|
|
2299
2323
|
}
|
|
2300
2324
|
return compact({
|
|
2301
2325
|
query: params.query?.trim(),
|
|
2302
|
-
|
|
2303
|
-
limit: params.limit ?? 100,
|
|
2304
|
-
sources: params.sources,
|
|
2305
|
-
lookback_days: params.lookbackDays,
|
|
2306
|
-
after_date: params.afterDate?.trim(),
|
|
2307
|
-
before_date: params.beforeDate?.trim(),
|
|
2308
|
-
dry_run: params.dryRun,
|
|
2309
|
-
idempotency_key: params.idempotencyKey
|
|
2326
|
+
limit: params.limit ?? 100
|
|
2310
2327
|
});
|
|
2311
2328
|
}
|
|
2312
2329
|
function normalizeSignalDiscoveryResult(params, data) {
|
|
@@ -2426,10 +2443,9 @@ function coreProductBatchRequestKey(path, request) {
|
|
|
2426
2443
|
typeof request.title === "string" ? request.title.trim() : "",
|
|
2427
2444
|
typeof request.campaign_offer === "string" ? request.campaign_offer.trim() : "",
|
|
2428
2445
|
typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
|
|
2429
|
-
|
|
2446
|
+
request.run_without_signal === true,
|
|
2430
2447
|
Number(request.lookback_days) || null,
|
|
2431
2448
|
typeof request.signal_run_id === "string" ? request.signal_run_id.trim() : "",
|
|
2432
|
-
typeof request.signal_search_run_id === "string" ? request.signal_search_run_id.trim() : "",
|
|
2433
2449
|
typeof request.fact_id === "string" ? request.fact_id.trim() : "",
|
|
2434
2450
|
typeof request.event_id === "string" ? request.event_id.trim() : "",
|
|
2435
2451
|
request.enable_deep_search === true,
|
|
@@ -2536,10 +2552,9 @@ function signalToCopyRequestBody(params) {
|
|
|
2536
2552
|
person_name: params.personName,
|
|
2537
2553
|
title: params.title,
|
|
2538
2554
|
campaign_offer: params.campaignOffer,
|
|
2539
|
-
|
|
2555
|
+
run_without_signal: params.runWithoutSignal,
|
|
2540
2556
|
lookback_days: 365,
|
|
2541
2557
|
signal_run_id: params.signalRunId,
|
|
2542
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2543
2558
|
fact_id: params.factId,
|
|
2544
2559
|
event_id: params.eventId,
|
|
2545
2560
|
enable_deep_search: params.enableDeepSearch,
|
|
@@ -2551,7 +2566,7 @@ function signalToCopyRequestBody(params) {
|
|
|
2551
2566
|
function validateLargeSignalCopyBatch(requests) {
|
|
2552
2567
|
if (requests.length <= 25) return;
|
|
2553
2568
|
const invalidIndex = requests.findIndex(
|
|
2554
|
-
(request) => Boolean(request.idempotencyKey?.trim()) || request.maxWaitMs !== void 0 || request.pollIntervalMs !== void 0 || request.waitForResult === false || Boolean(request.
|
|
2569
|
+
(request) => Boolean(request.idempotencyKey?.trim()) || request.maxWaitMs !== void 0 || request.pollIntervalMs !== void 0 || request.waitForResult === false || Boolean(request.factId?.trim()) || Boolean(request.eventId?.trim()) || !request.companyDomain?.trim() || !request.personName?.trim() || !request.title?.trim() || !request.campaignOffer?.trim()
|
|
2555
2570
|
);
|
|
2556
2571
|
if (invalidIndex >= 0) {
|
|
2557
2572
|
throw new RangeError(
|
|
@@ -2565,10 +2580,9 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2565
2580
|
person_name: params.personName,
|
|
2566
2581
|
title: params.title,
|
|
2567
2582
|
campaign_offer: params.campaignOffer,
|
|
2568
|
-
|
|
2583
|
+
run_without_signal: params.runWithoutSignal,
|
|
2569
2584
|
lookback_days: 365,
|
|
2570
2585
|
signal_run_id: params.signalRunId,
|
|
2571
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2572
2586
|
fact_id: params.factId,
|
|
2573
2587
|
event_id: params.eventId,
|
|
2574
2588
|
enable_deep_search: params.enableDeepSearch
|
|
@@ -2576,15 +2590,12 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2576
2590
|
}
|
|
2577
2591
|
function validateSignalToCopyParams(params) {
|
|
2578
2592
|
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
2579
|
-
if (params.
|
|
2580
|
-
throw new
|
|
2593
|
+
if (params.runWithoutSignal !== void 0 && typeof params.runWithoutSignal !== "boolean") {
|
|
2594
|
+
throw new TypeError("runWithoutSignal must be a boolean");
|
|
2581
2595
|
}
|
|
2582
2596
|
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2583
2597
|
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2584
2598
|
}
|
|
2585
|
-
if (params.signalSearchRunId !== void 0 && !params.signalSearchRunId.trim()) {
|
|
2586
|
-
throw new TypeError("signalSearchRunId must be a non-empty string");
|
|
2587
|
-
}
|
|
2588
2599
|
for (const [field, value] of [["factId", params.factId], ["eventId", params.eventId]]) {
|
|
2589
2600
|
if (value !== void 0 && !/^[0-9a-f]{64}$/.test(value.trim())) {
|
|
2590
2601
|
throw new TypeError(`${field} must be a lowercase 64-character SHA-256 identifier`);
|
package/dist/index.d.mts
CHANGED
|
@@ -7,7 +7,7 @@ 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 = '
|
|
10
|
+
type SignalAwarenessSchedulePreset = 'daily' | 'weekly' | 'monthly';
|
|
11
11
|
interface SignalMonitorInput {
|
|
12
12
|
companyName: string;
|
|
13
13
|
domain: string;
|
|
@@ -256,6 +256,17 @@ interface FindEmailResult {
|
|
|
256
256
|
success: boolean;
|
|
257
257
|
found: boolean;
|
|
258
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;
|
|
259
270
|
firstName?: string;
|
|
260
271
|
lastName?: string;
|
|
261
272
|
confidence: number;
|
|
@@ -300,45 +311,13 @@ interface FindEmailResult {
|
|
|
300
311
|
type VerifyEmailStatus = 'valid' | 'invalid' | 'catch_all' | 'role' | 'disposable' | 'unknown' | 'verifier_error' | 'malformed' | 'error';
|
|
301
312
|
type VerifyEmailRecommendation = 'send' | 'do_not_send' | 'manual_review';
|
|
302
313
|
interface VerifyEmailResult {
|
|
303
|
-
|
|
304
|
-
error?: string;
|
|
305
|
-
errorCode?: string;
|
|
306
|
-
email: string;
|
|
307
|
-
/** Execution state. Processing results are never send-safe. */
|
|
314
|
+
email: string | null;
|
|
308
315
|
status: 'processing' | 'completed';
|
|
309
|
-
|
|
316
|
+
isCatchAll: boolean;
|
|
317
|
+
creditsCharged: number;
|
|
318
|
+
okToSend: boolean;
|
|
310
319
|
verificationRunId?: string;
|
|
311
|
-
retryAfterMs?: number;
|
|
312
320
|
nextPollAfterSeconds?: number;
|
|
313
|
-
isValid: boolean;
|
|
314
|
-
isDeliverable: boolean;
|
|
315
|
-
/** True when the address failed syntax validation before any provider call. */
|
|
316
|
-
isMalformed: boolean;
|
|
317
|
-
isCatchAll: boolean;
|
|
318
|
-
/** Explicit send-safety verdict. Missing or false never becomes true by inference. */
|
|
319
|
-
verifiedForSending: boolean;
|
|
320
|
-
verificationStatus?: VerifyEmailStatus;
|
|
321
|
-
deliverabilityStatus?: VerifyEmailStatus;
|
|
322
|
-
verificationVerdict: VerifyEmailStatus;
|
|
323
|
-
isRoleAccount?: boolean;
|
|
324
|
-
quality?: string | null;
|
|
325
|
-
recommendation?: VerifyEmailRecommendation;
|
|
326
|
-
smtpStatus?: string;
|
|
327
|
-
providerStatus?: string;
|
|
328
|
-
failureReason?: string;
|
|
329
|
-
confidenceScore: number;
|
|
330
|
-
provider?: string;
|
|
331
|
-
verificationSource?: string;
|
|
332
|
-
/** ISO timestamp when the provider observed the winning verdict. */
|
|
333
|
-
verificationObservedAt?: string;
|
|
334
|
-
billingReplayed?: boolean;
|
|
335
|
-
/** True when the public result came from a completed response-idempotency reservation. */
|
|
336
|
-
idempotencyReplayed?: boolean;
|
|
337
|
-
creditsUsed?: number;
|
|
338
|
-
/** Canonical run ID alias returned alongside verificationRunId when available. */
|
|
339
|
-
runId?: string;
|
|
340
|
-
suggestedAction?: string;
|
|
341
|
-
raw: Record<string, unknown>;
|
|
342
321
|
}
|
|
343
322
|
interface VerifyEmailOptions {
|
|
344
323
|
/** Resume an existing long verification without another provider call. */
|
|
@@ -364,13 +343,13 @@ interface VerifyEmailBatchInput {
|
|
|
364
343
|
interface CompanySignalEnrichmentParams {
|
|
365
344
|
/** Resume an existing enrichment without creating another provider run. */
|
|
366
345
|
signalRunId?: string;
|
|
367
|
-
/** Company domain.
|
|
346
|
+
/** Company domain. Required for a new enrichment. */
|
|
368
347
|
domain?: string;
|
|
369
348
|
/** @deprecated Use domain. Accepted for source compatibility but not sent. */
|
|
370
349
|
companyDomain?: string;
|
|
371
350
|
/** @deprecated Company names are derived from the supplied domain. */
|
|
372
351
|
companyName?: string;
|
|
373
|
-
/**
|
|
352
|
+
/** Required research question for a new enrichment. */
|
|
374
353
|
researchPrompt?: string;
|
|
375
354
|
/** @deprecated Signaliz owns the fixed evidence window and ignores this value. */
|
|
376
355
|
lookbackDays?: number;
|
|
@@ -401,23 +380,12 @@ interface CompanySignalEnrichmentResult {
|
|
|
401
380
|
signalCount: number;
|
|
402
381
|
creditsUsed?: number;
|
|
403
382
|
}
|
|
404
|
-
type SignalDiscoverySource = 'web' | 'news';
|
|
405
383
|
type SignalDiscoveryStatus = 'planned' | 'queued' | 'processing' | 'completed' | 'completed_with_warnings' | 'failed';
|
|
406
384
|
interface SignalDiscoveryParams {
|
|
407
385
|
/** Any natural-language signal question. Required for a new search. */
|
|
408
386
|
query?: string;
|
|
409
|
-
/**
|
|
410
|
-
icpContext?: string;
|
|
411
|
-
/** Number of qualified company signals requested. Defaults to 100; allowed range is 1-1,000. */
|
|
387
|
+
/** Number of qualified company signals requested. Defaults to 100; allowed range is 1-100. */
|
|
412
388
|
limit?: number;
|
|
413
|
-
/** Restrict discovery to selected source families. */
|
|
414
|
-
sources?: SignalDiscoverySource[];
|
|
415
|
-
/** Maximum signal age in days. Allowed range is 1-365. */
|
|
416
|
-
lookbackDays?: number;
|
|
417
|
-
/** Inclusive event-date lower bound (YYYY-MM-DD). Mutually exclusive with lookbackDays. */
|
|
418
|
-
afterDate?: string;
|
|
419
|
-
/** Inclusive event-date upper bound (YYYY-MM-DD). Mutually exclusive with lookbackDays. */
|
|
420
|
-
beforeDate?: string;
|
|
421
389
|
/** Resume an existing asynchronous discovery run without starting another search. */
|
|
422
390
|
signalSearchRunId?: string;
|
|
423
391
|
/** Stable retry key for recovering the same search after an ambiguous response. */
|
|
@@ -514,13 +482,11 @@ interface SignalToCopyParams {
|
|
|
514
482
|
title?: string;
|
|
515
483
|
campaignOffer?: string;
|
|
516
484
|
researchPrompt?: string;
|
|
517
|
-
/**
|
|
518
|
-
|
|
485
|
+
/** Set true to draft from the campaign offer without researching or claiming a company signal. */
|
|
486
|
+
runWithoutSignal?: boolean;
|
|
519
487
|
/** Maximum signal age used for company-signal research. Defaults to 90 days. */
|
|
520
488
|
lookbackDays?: number;
|
|
521
489
|
signalRunId?: string;
|
|
522
|
-
/** Reuse an immutable Signals First snapshot without company re-research. Supported in single calls and batches of 25 or fewer. */
|
|
523
|
-
signalSearchRunId?: string;
|
|
524
490
|
/** Reuse one canonical signal fact without rediscovery. Supported in single calls and batches of 25 or fewer. */
|
|
525
491
|
factId?: string;
|
|
526
492
|
/** Reuse one canonical signal event without rediscovery. Supported in single calls and batches of 25 or fewer. */
|
|
@@ -605,6 +571,10 @@ declare class Signaliz {
|
|
|
605
571
|
* receipt, including zero-credit available-data reuse.
|
|
606
572
|
*/
|
|
607
573
|
signalAwareness(request: SignalAwarenessRequest): Promise<SignalAwarenessResponse>;
|
|
574
|
+
addSignalAwarenessCompany(domain: string, schedule?: SignalAwarenessSchedulePreset): Promise<SignalAwarenessResponse>;
|
|
575
|
+
deleteSignalAwarenessCompany(domain: string): Promise<SignalAwarenessResponse>;
|
|
576
|
+
changeSignalAwarenessSchedule(domain: string, schedule: SignalAwarenessSchedulePreset): Promise<SignalAwarenessResponse>;
|
|
577
|
+
listAllSignalAwarenessSignals(domain: string): Promise<SignalAwarenessResponse>;
|
|
608
578
|
createSignalMonitor(monitor: SignalMonitorInput): Promise<SignalAwarenessResponse>;
|
|
609
579
|
listSignalMonitors(limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
|
|
610
580
|
runSignalMonitor(monitorId: string, idempotencyKey?: string): Promise<SignalAwarenessResponse>;
|
|
@@ -680,4 +650,4 @@ declare class Signaliz {
|
|
|
680
650
|
health(): Promise<PlatformHealth>;
|
|
681
651
|
}
|
|
682
652
|
|
|
683
|
-
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
|
|
653
|
+
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 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,7 +7,7 @@ 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 = '
|
|
10
|
+
type SignalAwarenessSchedulePreset = 'daily' | 'weekly' | 'monthly';
|
|
11
11
|
interface SignalMonitorInput {
|
|
12
12
|
companyName: string;
|
|
13
13
|
domain: string;
|
|
@@ -256,6 +256,17 @@ interface FindEmailResult {
|
|
|
256
256
|
success: boolean;
|
|
257
257
|
found: boolean;
|
|
258
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;
|
|
259
270
|
firstName?: string;
|
|
260
271
|
lastName?: string;
|
|
261
272
|
confidence: number;
|
|
@@ -300,45 +311,13 @@ interface FindEmailResult {
|
|
|
300
311
|
type VerifyEmailStatus = 'valid' | 'invalid' | 'catch_all' | 'role' | 'disposable' | 'unknown' | 'verifier_error' | 'malformed' | 'error';
|
|
301
312
|
type VerifyEmailRecommendation = 'send' | 'do_not_send' | 'manual_review';
|
|
302
313
|
interface VerifyEmailResult {
|
|
303
|
-
|
|
304
|
-
error?: string;
|
|
305
|
-
errorCode?: string;
|
|
306
|
-
email: string;
|
|
307
|
-
/** Execution state. Processing results are never send-safe. */
|
|
314
|
+
email: string | null;
|
|
308
315
|
status: 'processing' | 'completed';
|
|
309
|
-
|
|
316
|
+
isCatchAll: boolean;
|
|
317
|
+
creditsCharged: number;
|
|
318
|
+
okToSend: boolean;
|
|
310
319
|
verificationRunId?: string;
|
|
311
|
-
retryAfterMs?: number;
|
|
312
320
|
nextPollAfterSeconds?: number;
|
|
313
|
-
isValid: boolean;
|
|
314
|
-
isDeliverable: boolean;
|
|
315
|
-
/** True when the address failed syntax validation before any provider call. */
|
|
316
|
-
isMalformed: boolean;
|
|
317
|
-
isCatchAll: boolean;
|
|
318
|
-
/** Explicit send-safety verdict. Missing or false never becomes true by inference. */
|
|
319
|
-
verifiedForSending: boolean;
|
|
320
|
-
verificationStatus?: VerifyEmailStatus;
|
|
321
|
-
deliverabilityStatus?: VerifyEmailStatus;
|
|
322
|
-
verificationVerdict: VerifyEmailStatus;
|
|
323
|
-
isRoleAccount?: boolean;
|
|
324
|
-
quality?: string | null;
|
|
325
|
-
recommendation?: VerifyEmailRecommendation;
|
|
326
|
-
smtpStatus?: string;
|
|
327
|
-
providerStatus?: string;
|
|
328
|
-
failureReason?: string;
|
|
329
|
-
confidenceScore: number;
|
|
330
|
-
provider?: string;
|
|
331
|
-
verificationSource?: string;
|
|
332
|
-
/** ISO timestamp when the provider observed the winning verdict. */
|
|
333
|
-
verificationObservedAt?: string;
|
|
334
|
-
billingReplayed?: boolean;
|
|
335
|
-
/** True when the public result came from a completed response-idempotency reservation. */
|
|
336
|
-
idempotencyReplayed?: boolean;
|
|
337
|
-
creditsUsed?: number;
|
|
338
|
-
/** Canonical run ID alias returned alongside verificationRunId when available. */
|
|
339
|
-
runId?: string;
|
|
340
|
-
suggestedAction?: string;
|
|
341
|
-
raw: Record<string, unknown>;
|
|
342
321
|
}
|
|
343
322
|
interface VerifyEmailOptions {
|
|
344
323
|
/** Resume an existing long verification without another provider call. */
|
|
@@ -364,13 +343,13 @@ interface VerifyEmailBatchInput {
|
|
|
364
343
|
interface CompanySignalEnrichmentParams {
|
|
365
344
|
/** Resume an existing enrichment without creating another provider run. */
|
|
366
345
|
signalRunId?: string;
|
|
367
|
-
/** Company domain.
|
|
346
|
+
/** Company domain. Required for a new enrichment. */
|
|
368
347
|
domain?: string;
|
|
369
348
|
/** @deprecated Use domain. Accepted for source compatibility but not sent. */
|
|
370
349
|
companyDomain?: string;
|
|
371
350
|
/** @deprecated Company names are derived from the supplied domain. */
|
|
372
351
|
companyName?: string;
|
|
373
|
-
/**
|
|
352
|
+
/** Required research question for a new enrichment. */
|
|
374
353
|
researchPrompt?: string;
|
|
375
354
|
/** @deprecated Signaliz owns the fixed evidence window and ignores this value. */
|
|
376
355
|
lookbackDays?: number;
|
|
@@ -401,23 +380,12 @@ interface CompanySignalEnrichmentResult {
|
|
|
401
380
|
signalCount: number;
|
|
402
381
|
creditsUsed?: number;
|
|
403
382
|
}
|
|
404
|
-
type SignalDiscoverySource = 'web' | 'news';
|
|
405
383
|
type SignalDiscoveryStatus = 'planned' | 'queued' | 'processing' | 'completed' | 'completed_with_warnings' | 'failed';
|
|
406
384
|
interface SignalDiscoveryParams {
|
|
407
385
|
/** Any natural-language signal question. Required for a new search. */
|
|
408
386
|
query?: string;
|
|
409
|
-
/**
|
|
410
|
-
icpContext?: string;
|
|
411
|
-
/** Number of qualified company signals requested. Defaults to 100; allowed range is 1-1,000. */
|
|
387
|
+
/** Number of qualified company signals requested. Defaults to 100; allowed range is 1-100. */
|
|
412
388
|
limit?: number;
|
|
413
|
-
/** Restrict discovery to selected source families. */
|
|
414
|
-
sources?: SignalDiscoverySource[];
|
|
415
|
-
/** Maximum signal age in days. Allowed range is 1-365. */
|
|
416
|
-
lookbackDays?: number;
|
|
417
|
-
/** Inclusive event-date lower bound (YYYY-MM-DD). Mutually exclusive with lookbackDays. */
|
|
418
|
-
afterDate?: string;
|
|
419
|
-
/** Inclusive event-date upper bound (YYYY-MM-DD). Mutually exclusive with lookbackDays. */
|
|
420
|
-
beforeDate?: string;
|
|
421
389
|
/** Resume an existing asynchronous discovery run without starting another search. */
|
|
422
390
|
signalSearchRunId?: string;
|
|
423
391
|
/** Stable retry key for recovering the same search after an ambiguous response. */
|
|
@@ -514,13 +482,11 @@ interface SignalToCopyParams {
|
|
|
514
482
|
title?: string;
|
|
515
483
|
campaignOffer?: string;
|
|
516
484
|
researchPrompt?: string;
|
|
517
|
-
/**
|
|
518
|
-
|
|
485
|
+
/** Set true to draft from the campaign offer without researching or claiming a company signal. */
|
|
486
|
+
runWithoutSignal?: boolean;
|
|
519
487
|
/** Maximum signal age used for company-signal research. Defaults to 90 days. */
|
|
520
488
|
lookbackDays?: number;
|
|
521
489
|
signalRunId?: string;
|
|
522
|
-
/** Reuse an immutable Signals First snapshot without company re-research. Supported in single calls and batches of 25 or fewer. */
|
|
523
|
-
signalSearchRunId?: string;
|
|
524
490
|
/** Reuse one canonical signal fact without rediscovery. Supported in single calls and batches of 25 or fewer. */
|
|
525
491
|
factId?: string;
|
|
526
492
|
/** Reuse one canonical signal event without rediscovery. Supported in single calls and batches of 25 or fewer. */
|
|
@@ -605,6 +571,10 @@ declare class Signaliz {
|
|
|
605
571
|
* receipt, including zero-credit available-data reuse.
|
|
606
572
|
*/
|
|
607
573
|
signalAwareness(request: SignalAwarenessRequest): Promise<SignalAwarenessResponse>;
|
|
574
|
+
addSignalAwarenessCompany(domain: string, schedule?: SignalAwarenessSchedulePreset): Promise<SignalAwarenessResponse>;
|
|
575
|
+
deleteSignalAwarenessCompany(domain: string): Promise<SignalAwarenessResponse>;
|
|
576
|
+
changeSignalAwarenessSchedule(domain: string, schedule: SignalAwarenessSchedulePreset): Promise<SignalAwarenessResponse>;
|
|
577
|
+
listAllSignalAwarenessSignals(domain: string): Promise<SignalAwarenessResponse>;
|
|
608
578
|
createSignalMonitor(monitor: SignalMonitorInput): Promise<SignalAwarenessResponse>;
|
|
609
579
|
listSignalMonitors(limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
|
|
610
580
|
runSignalMonitor(monitorId: string, idempotencyKey?: string): Promise<SignalAwarenessResponse>;
|
|
@@ -680,4 +650,4 @@ declare class Signaliz {
|
|
|
680
650
|
health(): Promise<PlatformHealth>;
|
|
681
651
|
}
|
|
682
652
|
|
|
683
|
-
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
|
|
653
|
+
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 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
|
@@ -840,6 +840,38 @@ var Signaliz = class {
|
|
|
840
840
|
);
|
|
841
841
|
return normalizeSignalAwarenessResponse(data);
|
|
842
842
|
}
|
|
843
|
+
async addSignalAwarenessCompany(domain, schedule = "daily") {
|
|
844
|
+
const data = await this.client.post(
|
|
845
|
+
"api/v1/signal-awareness/companies/add",
|
|
846
|
+
{ domain, schedule },
|
|
847
|
+
{ automaticIdempotency: false }
|
|
848
|
+
);
|
|
849
|
+
return normalizeSignalAwarenessResponse(data);
|
|
850
|
+
}
|
|
851
|
+
async deleteSignalAwarenessCompany(domain) {
|
|
852
|
+
const data = await this.client.post(
|
|
853
|
+
"api/v1/signal-awareness/companies/delete",
|
|
854
|
+
{ domain },
|
|
855
|
+
{ automaticIdempotency: false }
|
|
856
|
+
);
|
|
857
|
+
return normalizeSignalAwarenessResponse(data);
|
|
858
|
+
}
|
|
859
|
+
async changeSignalAwarenessSchedule(domain, schedule) {
|
|
860
|
+
const data = await this.client.post(
|
|
861
|
+
"api/v1/signal-awareness/companies/schedule",
|
|
862
|
+
{ domain, schedule },
|
|
863
|
+
{ automaticIdempotency: false }
|
|
864
|
+
);
|
|
865
|
+
return normalizeSignalAwarenessResponse(data);
|
|
866
|
+
}
|
|
867
|
+
async listAllSignalAwarenessSignals(domain) {
|
|
868
|
+
const data = await this.client.post(
|
|
869
|
+
"api/v1/signal-awareness/signals",
|
|
870
|
+
{ domain },
|
|
871
|
+
{ automaticIdempotency: false }
|
|
872
|
+
);
|
|
873
|
+
return normalizeSignalAwarenessResponse(data);
|
|
874
|
+
}
|
|
843
875
|
async createSignalMonitor(monitor) {
|
|
844
876
|
return this.signalAwareness({ action: "create", monitor });
|
|
845
877
|
}
|
|
@@ -1029,7 +1061,7 @@ var Signaliz = class {
|
|
|
1029
1061
|
async enrichCompanySignals(params) {
|
|
1030
1062
|
validateCompanySignalParams(params);
|
|
1031
1063
|
const request = companySignalRequestBody(params);
|
|
1032
|
-
const data = await this.client.post("
|
|
1064
|
+
const data = await this.client.post("company-signal-enrichment-v2", request);
|
|
1033
1065
|
if (isCoreProductDryRun(data)) return normalizeCoreProductDryRunResult(data);
|
|
1034
1066
|
assertTerminalSignalResponse(data, "Company Signals");
|
|
1035
1067
|
return normalizeCompanySignalResult(params, data);
|
|
@@ -1076,7 +1108,7 @@ var Signaliz = class {
|
|
|
1076
1108
|
const largeBatch = companySignalLargeBatchSubmission(requests);
|
|
1077
1109
|
if (companies.length > 25 && !largeBatch) {
|
|
1078
1110
|
throw new RangeError(
|
|
1079
|
-
"Company Signals batches larger than 25 require homogeneous new-enrichment rows with
|
|
1111
|
+
"Company Signals batches larger than 25 require homogeneous new-enrichment rows with domain and researchPrompt; split recovery or mixed-context rows into batches of at most 25."
|
|
1080
1112
|
);
|
|
1081
1113
|
}
|
|
1082
1114
|
if (options?.dryRun === true) {
|
|
@@ -1951,6 +1983,16 @@ function normalizeFindEmailResult(data) {
|
|
|
1951
1983
|
success: processing || !failed && found,
|
|
1952
1984
|
found,
|
|
1953
1985
|
email,
|
|
1986
|
+
checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
|
|
1987
|
+
candidateSource: typeof data.candidate_source === "string" ? data.candidate_source : null,
|
|
1988
|
+
primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
|
|
1989
|
+
primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
|
|
1990
|
+
terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
|
|
1991
|
+
terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
|
|
1992
|
+
terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
|
|
1993
|
+
terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
|
|
1994
|
+
terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
|
|
1995
|
+
bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
|
|
1954
1996
|
firstName: data.first_name,
|
|
1955
1997
|
lastName: data.last_name,
|
|
1956
1998
|
confidence: failed ? 0 : data.confidence ?? data.confidence_score ?? (verified ? 1 : 0),
|
|
@@ -1990,6 +2032,19 @@ function normalizeFindEmailResult(data) {
|
|
|
1990
2032
|
function normalizeVerifyEmailResult(email, data) {
|
|
1991
2033
|
data = publicProductData(data, "verify_email");
|
|
1992
2034
|
const failed = coreProductResponseFailed(data);
|
|
2035
|
+
const publicIsCatchAll = data.is_catch_all === true || data.email_is_catch_all === true;
|
|
2036
|
+
const publicPrimaryResult = String(data.primary_verdict ?? "").toLowerCase();
|
|
2037
|
+
const publicTerminalResult = String(data.terminal_result ?? "").toLowerCase();
|
|
2038
|
+
const okToSend = !failed && (data.ok_to_send === true || publicPrimaryResult === "ok" || publicPrimaryResult === "catch_all" && publicTerminalResult === "deliverable");
|
|
2039
|
+
return {
|
|
2040
|
+
email: typeof data.email === "string" ? data.email : email || null,
|
|
2041
|
+
status: String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
|
|
2042
|
+
isCatchAll: publicIsCatchAll,
|
|
2043
|
+
creditsCharged: Number.isFinite(Number(data.credits_charged)) ? Number(data.credits_charged) : 0,
|
|
2044
|
+
okToSend,
|
|
2045
|
+
...data.verification_run_id || data.run_id ? { verificationRunId: data.verification_run_id ?? data.run_id } : {},
|
|
2046
|
+
...data.next_poll_after_seconds !== void 0 ? { nextPollAfterSeconds: data.next_poll_after_seconds } : {}
|
|
2047
|
+
};
|
|
1993
2048
|
const malformed = data.is_malformed === true || data.verification_verdict === "malformed" || data.verification_status === "malformed" || data.deliverability_status === "malformed";
|
|
1994
2049
|
const verificationStatus = normalizeVerifyEmailStatus(
|
|
1995
2050
|
failed ? malformed ? "malformed" : "error" : data.verification_status ?? data.verification_verdict ?? data.deliverability_status ?? "unknown"
|
|
@@ -2004,6 +2059,15 @@ function normalizeVerifyEmailResult(email, data) {
|
|
|
2004
2059
|
error: failed ? coreProductErrorMessage(data) : void 0,
|
|
2005
2060
|
errorCode: failed ? coreProductErrorCode(data) : void 0,
|
|
2006
2061
|
email: data.email ?? email,
|
|
2062
|
+
checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
|
|
2063
|
+
primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
|
|
2064
|
+
primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
|
|
2065
|
+
terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
|
|
2066
|
+
terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
|
|
2067
|
+
terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
|
|
2068
|
+
terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
|
|
2069
|
+
terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
|
|
2070
|
+
bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
|
|
2007
2071
|
status: !failed && String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
|
|
2008
2072
|
verificationRunId,
|
|
2009
2073
|
retryAfterMs: data.retry_after_ms,
|
|
@@ -2065,16 +2129,12 @@ function companySignalRequestBody(params) {
|
|
|
2065
2129
|
return compact({
|
|
2066
2130
|
signal_run_id: params.signalRunId,
|
|
2067
2131
|
domain: params.domain ?? params.companyDomain,
|
|
2068
|
-
|
|
2069
|
-
idempotency_key: params.idempotencyKey
|
|
2132
|
+
research_prompt: params.researchPrompt
|
|
2070
2133
|
});
|
|
2071
2134
|
}
|
|
2072
2135
|
function validateCompanySignalParams(params) {
|
|
2073
|
-
if (!params.signalRunId && !(params.domain ?? params.companyDomain)?.trim()) {
|
|
2074
|
-
throw new TypeError("Company Signals requires domain");
|
|
2075
|
-
}
|
|
2076
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2077
|
-
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2136
|
+
if (!params.signalRunId && (!(params.domain ?? params.companyDomain)?.trim() || !params.researchPrompt?.trim())) {
|
|
2137
|
+
throw new TypeError("Company Signals requires domain and researchPrompt");
|
|
2078
2138
|
}
|
|
2079
2139
|
}
|
|
2080
2140
|
function companySignalParamsFromRecoveredRow(row) {
|
|
@@ -2104,7 +2164,10 @@ function companySignalLargeBatchSubmission(requests) {
|
|
|
2104
2164
|
if (!hasIdentity) return null;
|
|
2105
2165
|
}
|
|
2106
2166
|
return {
|
|
2107
|
-
requests: requests.map((request) => compact({
|
|
2167
|
+
requests: requests.map((request) => compact({
|
|
2168
|
+
domain: request.domain,
|
|
2169
|
+
research_prompt: request.research_prompt
|
|
2170
|
+
})),
|
|
2108
2171
|
submissionFields
|
|
2109
2172
|
};
|
|
2110
2173
|
}
|
|
@@ -2254,7 +2317,6 @@ function normalizeSignalizFlowStatus(data) {
|
|
|
2254
2317
|
completedAt: typeof publicData.completed_at === "string" ? publicData.completed_at : void 0
|
|
2255
2318
|
};
|
|
2256
2319
|
}
|
|
2257
|
-
var SIGNAL_DISCOVERY_SOURCES = /* @__PURE__ */ new Set(["web", "news"]);
|
|
2258
2320
|
var SIGNAL_DISCOVERY_STATUSES = /* @__PURE__ */ new Set([
|
|
2259
2321
|
"planned",
|
|
2260
2322
|
"queued",
|
|
@@ -2267,47 +2329,13 @@ function validateSignalDiscoveryParams(params) {
|
|
|
2267
2329
|
const runId = typeof params.signalSearchRunId === "string" ? params.signalSearchRunId.trim() : "";
|
|
2268
2330
|
const query = typeof params.query === "string" ? params.query.trim() : "";
|
|
2269
2331
|
if (!runId && !query) {
|
|
2270
|
-
throw new TypeError("Signals
|
|
2332
|
+
throw new TypeError("Signals First requires query or signalSearchRunId");
|
|
2271
2333
|
}
|
|
2272
2334
|
if (query && (query.length < 2 || query.length > 2e3)) {
|
|
2273
2335
|
throw new RangeError("query must contain between 2 and 2000 characters");
|
|
2274
2336
|
}
|
|
2275
|
-
if (params.
|
|
2276
|
-
|
|
2277
|
-
if (icpContext.length < 2 || icpContext.length > 4e3) {
|
|
2278
|
-
throw new RangeError("icpContext must contain between 2 and 4000 characters");
|
|
2279
|
-
}
|
|
2280
|
-
}
|
|
2281
|
-
if (params.limit !== void 0 && (!Number.isInteger(params.limit) || params.limit < 1 || params.limit > 1e3)) {
|
|
2282
|
-
throw new RangeError("limit must be an integer between 1 and 1000");
|
|
2283
|
-
}
|
|
2284
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2285
|
-
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2286
|
-
}
|
|
2287
|
-
validateSignalDateWindow(params);
|
|
2288
|
-
if (params.sources !== void 0 && (!Array.isArray(params.sources) || params.sources.length < 1 || params.sources.length > 2 || params.sources.some((source) => !SIGNAL_DISCOVERY_SOURCES.has(source)))) {
|
|
2289
|
-
throw new TypeError("sources must contain only web or news");
|
|
2290
|
-
}
|
|
2291
|
-
}
|
|
2292
|
-
function validateSignalDateWindow(params) {
|
|
2293
|
-
const afterDate = params.afterDate?.trim();
|
|
2294
|
-
const beforeDate = params.beforeDate?.trim();
|
|
2295
|
-
if ((afterDate || beforeDate) && params.lookbackDays !== void 0) {
|
|
2296
|
-
throw new RangeError("afterDate/beforeDate cannot be combined with lookbackDays");
|
|
2297
|
-
}
|
|
2298
|
-
const parseDate = (value, field) => {
|
|
2299
|
-
if (value === void 0) return void 0;
|
|
2300
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) throw new RangeError(`${field} must use YYYY-MM-DD format`);
|
|
2301
|
-
const timestamp = Date.parse(`${value}T00:00:00Z`);
|
|
2302
|
-
if (!Number.isFinite(timestamp) || new Date(timestamp).toISOString().slice(0, 10) !== value) {
|
|
2303
|
-
throw new RangeError(`${field} must be a valid calendar date`);
|
|
2304
|
-
}
|
|
2305
|
-
return timestamp;
|
|
2306
|
-
};
|
|
2307
|
-
const afterTimestamp = parseDate(afterDate, "afterDate");
|
|
2308
|
-
const beforeTimestamp = parseDate(beforeDate, "beforeDate");
|
|
2309
|
-
if (afterTimestamp !== void 0 && beforeTimestamp !== void 0 && beforeTimestamp < afterTimestamp) {
|
|
2310
|
-
throw new RangeError("beforeDate must be on or after afterDate");
|
|
2337
|
+
if (params.limit !== void 0 && (!Number.isInteger(params.limit) || params.limit < 1 || params.limit > 100)) {
|
|
2338
|
+
throw new RangeError("limit must be an integer between 1 and 100");
|
|
2311
2339
|
}
|
|
2312
2340
|
}
|
|
2313
2341
|
function signalDiscoveryRequestBody(params) {
|
|
@@ -2317,23 +2345,12 @@ function signalDiscoveryRequestBody(params) {
|
|
|
2317
2345
|
signal_search_run_id: runId,
|
|
2318
2346
|
// An explicit limit expands or narrows the retained qualified cohort;
|
|
2319
2347
|
// omitting it preserves the original preview size.
|
|
2320
|
-
limit: params.limit
|
|
2321
|
-
after_date: params.afterDate?.trim(),
|
|
2322
|
-
before_date: params.beforeDate?.trim(),
|
|
2323
|
-
dry_run: params.dryRun,
|
|
2324
|
-
idempotency_key: params.idempotencyKey
|
|
2348
|
+
limit: params.limit
|
|
2325
2349
|
});
|
|
2326
2350
|
}
|
|
2327
2351
|
return compact({
|
|
2328
2352
|
query: params.query?.trim(),
|
|
2329
|
-
|
|
2330
|
-
limit: params.limit ?? 100,
|
|
2331
|
-
sources: params.sources,
|
|
2332
|
-
lookback_days: params.lookbackDays,
|
|
2333
|
-
after_date: params.afterDate?.trim(),
|
|
2334
|
-
before_date: params.beforeDate?.trim(),
|
|
2335
|
-
dry_run: params.dryRun,
|
|
2336
|
-
idempotency_key: params.idempotencyKey
|
|
2353
|
+
limit: params.limit ?? 100
|
|
2337
2354
|
});
|
|
2338
2355
|
}
|
|
2339
2356
|
function normalizeSignalDiscoveryResult(params, data) {
|
|
@@ -2453,10 +2470,9 @@ function coreProductBatchRequestKey(path, request) {
|
|
|
2453
2470
|
typeof request.title === "string" ? request.title.trim() : "",
|
|
2454
2471
|
typeof request.campaign_offer === "string" ? request.campaign_offer.trim() : "",
|
|
2455
2472
|
typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
|
|
2456
|
-
|
|
2473
|
+
request.run_without_signal === true,
|
|
2457
2474
|
Number(request.lookback_days) || null,
|
|
2458
2475
|
typeof request.signal_run_id === "string" ? request.signal_run_id.trim() : "",
|
|
2459
|
-
typeof request.signal_search_run_id === "string" ? request.signal_search_run_id.trim() : "",
|
|
2460
2476
|
typeof request.fact_id === "string" ? request.fact_id.trim() : "",
|
|
2461
2477
|
typeof request.event_id === "string" ? request.event_id.trim() : "",
|
|
2462
2478
|
request.enable_deep_search === true,
|
|
@@ -2563,10 +2579,9 @@ function signalToCopyRequestBody(params) {
|
|
|
2563
2579
|
person_name: params.personName,
|
|
2564
2580
|
title: params.title,
|
|
2565
2581
|
campaign_offer: params.campaignOffer,
|
|
2566
|
-
|
|
2582
|
+
run_without_signal: params.runWithoutSignal,
|
|
2567
2583
|
lookback_days: 365,
|
|
2568
2584
|
signal_run_id: params.signalRunId,
|
|
2569
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2570
2585
|
fact_id: params.factId,
|
|
2571
2586
|
event_id: params.eventId,
|
|
2572
2587
|
enable_deep_search: params.enableDeepSearch,
|
|
@@ -2578,7 +2593,7 @@ function signalToCopyRequestBody(params) {
|
|
|
2578
2593
|
function validateLargeSignalCopyBatch(requests) {
|
|
2579
2594
|
if (requests.length <= 25) return;
|
|
2580
2595
|
const invalidIndex = requests.findIndex(
|
|
2581
|
-
(request) => Boolean(request.idempotencyKey?.trim()) || request.maxWaitMs !== void 0 || request.pollIntervalMs !== void 0 || request.waitForResult === false || Boolean(request.
|
|
2596
|
+
(request) => Boolean(request.idempotencyKey?.trim()) || request.maxWaitMs !== void 0 || request.pollIntervalMs !== void 0 || request.waitForResult === false || Boolean(request.factId?.trim()) || Boolean(request.eventId?.trim()) || !request.companyDomain?.trim() || !request.personName?.trim() || !request.title?.trim() || !request.campaignOffer?.trim()
|
|
2582
2597
|
);
|
|
2583
2598
|
if (invalidIndex >= 0) {
|
|
2584
2599
|
throw new RangeError(
|
|
@@ -2592,10 +2607,9 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2592
2607
|
person_name: params.personName,
|
|
2593
2608
|
title: params.title,
|
|
2594
2609
|
campaign_offer: params.campaignOffer,
|
|
2595
|
-
|
|
2610
|
+
run_without_signal: params.runWithoutSignal,
|
|
2596
2611
|
lookback_days: 365,
|
|
2597
2612
|
signal_run_id: params.signalRunId,
|
|
2598
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2599
2613
|
fact_id: params.factId,
|
|
2600
2614
|
event_id: params.eventId,
|
|
2601
2615
|
enable_deep_search: params.enableDeepSearch
|
|
@@ -2603,15 +2617,12 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2603
2617
|
}
|
|
2604
2618
|
function validateSignalToCopyParams(params) {
|
|
2605
2619
|
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
2606
|
-
if (params.
|
|
2607
|
-
throw new
|
|
2620
|
+
if (params.runWithoutSignal !== void 0 && typeof params.runWithoutSignal !== "boolean") {
|
|
2621
|
+
throw new TypeError("runWithoutSignal must be a boolean");
|
|
2608
2622
|
}
|
|
2609
2623
|
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2610
2624
|
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2611
2625
|
}
|
|
2612
|
-
if (params.signalSearchRunId !== void 0 && !params.signalSearchRunId.trim()) {
|
|
2613
|
-
throw new TypeError("signalSearchRunId must be a non-empty string");
|
|
2614
|
-
}
|
|
2615
2626
|
for (const [field, value] of [["factId", params.factId], ["eventId", params.eventId]]) {
|
|
2616
2627
|
if (value !== void 0 && !/^[0-9a-f]{64}$/.test(value.trim())) {
|
|
2617
2628
|
throw new TypeError(`${field} must be a lowercase 64-character SHA-256 identifier`);
|
package/dist/index.mjs
CHANGED
package/dist/mcp-config.js
CHANGED
|
@@ -844,6 +844,38 @@ var Signaliz = class {
|
|
|
844
844
|
);
|
|
845
845
|
return normalizeSignalAwarenessResponse(data);
|
|
846
846
|
}
|
|
847
|
+
async addSignalAwarenessCompany(domain, schedule = "daily") {
|
|
848
|
+
const data = await this.client.post(
|
|
849
|
+
"api/v1/signal-awareness/companies/add",
|
|
850
|
+
{ domain, schedule },
|
|
851
|
+
{ automaticIdempotency: false }
|
|
852
|
+
);
|
|
853
|
+
return normalizeSignalAwarenessResponse(data);
|
|
854
|
+
}
|
|
855
|
+
async deleteSignalAwarenessCompany(domain) {
|
|
856
|
+
const data = await this.client.post(
|
|
857
|
+
"api/v1/signal-awareness/companies/delete",
|
|
858
|
+
{ domain },
|
|
859
|
+
{ automaticIdempotency: false }
|
|
860
|
+
);
|
|
861
|
+
return normalizeSignalAwarenessResponse(data);
|
|
862
|
+
}
|
|
863
|
+
async changeSignalAwarenessSchedule(domain, schedule) {
|
|
864
|
+
const data = await this.client.post(
|
|
865
|
+
"api/v1/signal-awareness/companies/schedule",
|
|
866
|
+
{ domain, schedule },
|
|
867
|
+
{ automaticIdempotency: false }
|
|
868
|
+
);
|
|
869
|
+
return normalizeSignalAwarenessResponse(data);
|
|
870
|
+
}
|
|
871
|
+
async listAllSignalAwarenessSignals(domain) {
|
|
872
|
+
const data = await this.client.post(
|
|
873
|
+
"api/v1/signal-awareness/signals",
|
|
874
|
+
{ domain },
|
|
875
|
+
{ automaticIdempotency: false }
|
|
876
|
+
);
|
|
877
|
+
return normalizeSignalAwarenessResponse(data);
|
|
878
|
+
}
|
|
847
879
|
async createSignalMonitor(monitor) {
|
|
848
880
|
return this.signalAwareness({ action: "create", monitor });
|
|
849
881
|
}
|
|
@@ -1033,7 +1065,7 @@ var Signaliz = class {
|
|
|
1033
1065
|
async enrichCompanySignals(params) {
|
|
1034
1066
|
validateCompanySignalParams(params);
|
|
1035
1067
|
const request = companySignalRequestBody(params);
|
|
1036
|
-
const data = await this.client.post("
|
|
1068
|
+
const data = await this.client.post("company-signal-enrichment-v2", request);
|
|
1037
1069
|
if (isCoreProductDryRun(data)) return normalizeCoreProductDryRunResult(data);
|
|
1038
1070
|
assertTerminalSignalResponse(data, "Company Signals");
|
|
1039
1071
|
return normalizeCompanySignalResult(params, data);
|
|
@@ -1080,7 +1112,7 @@ var Signaliz = class {
|
|
|
1080
1112
|
const largeBatch = companySignalLargeBatchSubmission(requests);
|
|
1081
1113
|
if (companies.length > 25 && !largeBatch) {
|
|
1082
1114
|
throw new RangeError(
|
|
1083
|
-
"Company Signals batches larger than 25 require homogeneous new-enrichment rows with
|
|
1115
|
+
"Company Signals batches larger than 25 require homogeneous new-enrichment rows with domain and researchPrompt; split recovery or mixed-context rows into batches of at most 25."
|
|
1084
1116
|
);
|
|
1085
1117
|
}
|
|
1086
1118
|
if (options?.dryRun === true) {
|
|
@@ -1955,6 +1987,16 @@ function normalizeFindEmailResult(data) {
|
|
|
1955
1987
|
success: processing || !failed && found,
|
|
1956
1988
|
found,
|
|
1957
1989
|
email,
|
|
1990
|
+
checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
|
|
1991
|
+
candidateSource: typeof data.candidate_source === "string" ? data.candidate_source : null,
|
|
1992
|
+
primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
|
|
1993
|
+
primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
|
|
1994
|
+
terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
|
|
1995
|
+
terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
|
|
1996
|
+
terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
|
|
1997
|
+
terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
|
|
1998
|
+
terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
|
|
1999
|
+
bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
|
|
1958
2000
|
firstName: data.first_name,
|
|
1959
2001
|
lastName: data.last_name,
|
|
1960
2002
|
confidence: failed ? 0 : data.confidence ?? data.confidence_score ?? (verified ? 1 : 0),
|
|
@@ -1994,6 +2036,19 @@ function normalizeFindEmailResult(data) {
|
|
|
1994
2036
|
function normalizeVerifyEmailResult(email, data) {
|
|
1995
2037
|
data = publicProductData(data, "verify_email");
|
|
1996
2038
|
const failed = coreProductResponseFailed(data);
|
|
2039
|
+
const publicIsCatchAll = data.is_catch_all === true || data.email_is_catch_all === true;
|
|
2040
|
+
const publicPrimaryResult = String(data.primary_verdict ?? "").toLowerCase();
|
|
2041
|
+
const publicTerminalResult = String(data.terminal_result ?? "").toLowerCase();
|
|
2042
|
+
const okToSend = !failed && (data.ok_to_send === true || publicPrimaryResult === "ok" || publicPrimaryResult === "catch_all" && publicTerminalResult === "deliverable");
|
|
2043
|
+
return {
|
|
2044
|
+
email: typeof data.email === "string" ? data.email : email || null,
|
|
2045
|
+
status: String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
|
|
2046
|
+
isCatchAll: publicIsCatchAll,
|
|
2047
|
+
creditsCharged: Number.isFinite(Number(data.credits_charged)) ? Number(data.credits_charged) : 0,
|
|
2048
|
+
okToSend,
|
|
2049
|
+
...data.verification_run_id || data.run_id ? { verificationRunId: data.verification_run_id ?? data.run_id } : {},
|
|
2050
|
+
...data.next_poll_after_seconds !== void 0 ? { nextPollAfterSeconds: data.next_poll_after_seconds } : {}
|
|
2051
|
+
};
|
|
1997
2052
|
const malformed = data.is_malformed === true || data.verification_verdict === "malformed" || data.verification_status === "malformed" || data.deliverability_status === "malformed";
|
|
1998
2053
|
const verificationStatus = normalizeVerifyEmailStatus(
|
|
1999
2054
|
failed ? malformed ? "malformed" : "error" : data.verification_status ?? data.verification_verdict ?? data.deliverability_status ?? "unknown"
|
|
@@ -2008,6 +2063,15 @@ function normalizeVerifyEmailResult(email, data) {
|
|
|
2008
2063
|
error: failed ? coreProductErrorMessage(data) : void 0,
|
|
2009
2064
|
errorCode: failed ? coreProductErrorCode(data) : void 0,
|
|
2010
2065
|
email: data.email ?? email,
|
|
2066
|
+
checkedEmail: typeof data.checked_email === "string" ? data.checked_email : null,
|
|
2067
|
+
primaryVerifier: typeof data.primary_verifier === "string" ? data.primary_verifier : null,
|
|
2068
|
+
primaryVerdict: typeof data.primary_verdict === "string" ? data.primary_verdict : null,
|
|
2069
|
+
terminalVerifier: typeof data.terminal_verifier === "string" ? data.terminal_verifier : null,
|
|
2070
|
+
terminalVerdict: typeof data.terminal_verdict === "string" ? data.terminal_verdict : null,
|
|
2071
|
+
terminalResult: typeof data.terminal_result === "string" ? data.terminal_result : null,
|
|
2072
|
+
terminalIsCatchAll: typeof data.terminal_is_catch_all === "boolean" ? data.terminal_is_catch_all : null,
|
|
2073
|
+
terminalIsAcceptAll: typeof data.terminal_is_accept_all === "boolean" ? data.terminal_is_accept_all : null,
|
|
2074
|
+
bouncebanId: typeof data.bounceban_id === "string" ? data.bounceban_id : null,
|
|
2011
2075
|
status: !failed && String(data.status || "").toLowerCase() === "processing" ? "processing" : "completed",
|
|
2012
2076
|
verificationRunId,
|
|
2013
2077
|
retryAfterMs: data.retry_after_ms,
|
|
@@ -2069,16 +2133,12 @@ function companySignalRequestBody(params) {
|
|
|
2069
2133
|
return compact({
|
|
2070
2134
|
signal_run_id: params.signalRunId,
|
|
2071
2135
|
domain: params.domain ?? params.companyDomain,
|
|
2072
|
-
|
|
2073
|
-
idempotency_key: params.idempotencyKey
|
|
2136
|
+
research_prompt: params.researchPrompt
|
|
2074
2137
|
});
|
|
2075
2138
|
}
|
|
2076
2139
|
function validateCompanySignalParams(params) {
|
|
2077
|
-
if (!params.signalRunId && !(params.domain ?? params.companyDomain)?.trim()) {
|
|
2078
|
-
throw new TypeError("Company Signals requires domain");
|
|
2079
|
-
}
|
|
2080
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2081
|
-
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2140
|
+
if (!params.signalRunId && (!(params.domain ?? params.companyDomain)?.trim() || !params.researchPrompt?.trim())) {
|
|
2141
|
+
throw new TypeError("Company Signals requires domain and researchPrompt");
|
|
2082
2142
|
}
|
|
2083
2143
|
}
|
|
2084
2144
|
function companySignalParamsFromRecoveredRow(row) {
|
|
@@ -2108,7 +2168,10 @@ function companySignalLargeBatchSubmission(requests) {
|
|
|
2108
2168
|
if (!hasIdentity) return null;
|
|
2109
2169
|
}
|
|
2110
2170
|
return {
|
|
2111
|
-
requests: requests.map((request) => compact({
|
|
2171
|
+
requests: requests.map((request) => compact({
|
|
2172
|
+
domain: request.domain,
|
|
2173
|
+
research_prompt: request.research_prompt
|
|
2174
|
+
})),
|
|
2112
2175
|
submissionFields
|
|
2113
2176
|
};
|
|
2114
2177
|
}
|
|
@@ -2258,7 +2321,6 @@ function normalizeSignalizFlowStatus(data) {
|
|
|
2258
2321
|
completedAt: typeof publicData.completed_at === "string" ? publicData.completed_at : void 0
|
|
2259
2322
|
};
|
|
2260
2323
|
}
|
|
2261
|
-
var SIGNAL_DISCOVERY_SOURCES = /* @__PURE__ */ new Set(["web", "news"]);
|
|
2262
2324
|
var SIGNAL_DISCOVERY_STATUSES = /* @__PURE__ */ new Set([
|
|
2263
2325
|
"planned",
|
|
2264
2326
|
"queued",
|
|
@@ -2271,47 +2333,13 @@ function validateSignalDiscoveryParams(params) {
|
|
|
2271
2333
|
const runId = typeof params.signalSearchRunId === "string" ? params.signalSearchRunId.trim() : "";
|
|
2272
2334
|
const query = typeof params.query === "string" ? params.query.trim() : "";
|
|
2273
2335
|
if (!runId && !query) {
|
|
2274
|
-
throw new TypeError("Signals
|
|
2336
|
+
throw new TypeError("Signals First requires query or signalSearchRunId");
|
|
2275
2337
|
}
|
|
2276
2338
|
if (query && (query.length < 2 || query.length > 2e3)) {
|
|
2277
2339
|
throw new RangeError("query must contain between 2 and 2000 characters");
|
|
2278
2340
|
}
|
|
2279
|
-
if (params.
|
|
2280
|
-
|
|
2281
|
-
if (icpContext.length < 2 || icpContext.length > 4e3) {
|
|
2282
|
-
throw new RangeError("icpContext must contain between 2 and 4000 characters");
|
|
2283
|
-
}
|
|
2284
|
-
}
|
|
2285
|
-
if (params.limit !== void 0 && (!Number.isInteger(params.limit) || params.limit < 1 || params.limit > 1e3)) {
|
|
2286
|
-
throw new RangeError("limit must be an integer between 1 and 1000");
|
|
2287
|
-
}
|
|
2288
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2289
|
-
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2290
|
-
}
|
|
2291
|
-
validateSignalDateWindow(params);
|
|
2292
|
-
if (params.sources !== void 0 && (!Array.isArray(params.sources) || params.sources.length < 1 || params.sources.length > 2 || params.sources.some((source) => !SIGNAL_DISCOVERY_SOURCES.has(source)))) {
|
|
2293
|
-
throw new TypeError("sources must contain only web or news");
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
function validateSignalDateWindow(params) {
|
|
2297
|
-
const afterDate = params.afterDate?.trim();
|
|
2298
|
-
const beforeDate = params.beforeDate?.trim();
|
|
2299
|
-
if ((afterDate || beforeDate) && params.lookbackDays !== void 0) {
|
|
2300
|
-
throw new RangeError("afterDate/beforeDate cannot be combined with lookbackDays");
|
|
2301
|
-
}
|
|
2302
|
-
const parseDate = (value, field) => {
|
|
2303
|
-
if (value === void 0) return void 0;
|
|
2304
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) throw new RangeError(`${field} must use YYYY-MM-DD format`);
|
|
2305
|
-
const timestamp = Date.parse(`${value}T00:00:00Z`);
|
|
2306
|
-
if (!Number.isFinite(timestamp) || new Date(timestamp).toISOString().slice(0, 10) !== value) {
|
|
2307
|
-
throw new RangeError(`${field} must be a valid calendar date`);
|
|
2308
|
-
}
|
|
2309
|
-
return timestamp;
|
|
2310
|
-
};
|
|
2311
|
-
const afterTimestamp = parseDate(afterDate, "afterDate");
|
|
2312
|
-
const beforeTimestamp = parseDate(beforeDate, "beforeDate");
|
|
2313
|
-
if (afterTimestamp !== void 0 && beforeTimestamp !== void 0 && beforeTimestamp < afterTimestamp) {
|
|
2314
|
-
throw new RangeError("beforeDate must be on or after afterDate");
|
|
2341
|
+
if (params.limit !== void 0 && (!Number.isInteger(params.limit) || params.limit < 1 || params.limit > 100)) {
|
|
2342
|
+
throw new RangeError("limit must be an integer between 1 and 100");
|
|
2315
2343
|
}
|
|
2316
2344
|
}
|
|
2317
2345
|
function signalDiscoveryRequestBody(params) {
|
|
@@ -2321,23 +2349,12 @@ function signalDiscoveryRequestBody(params) {
|
|
|
2321
2349
|
signal_search_run_id: runId,
|
|
2322
2350
|
// An explicit limit expands or narrows the retained qualified cohort;
|
|
2323
2351
|
// omitting it preserves the original preview size.
|
|
2324
|
-
limit: params.limit
|
|
2325
|
-
after_date: params.afterDate?.trim(),
|
|
2326
|
-
before_date: params.beforeDate?.trim(),
|
|
2327
|
-
dry_run: params.dryRun,
|
|
2328
|
-
idempotency_key: params.idempotencyKey
|
|
2352
|
+
limit: params.limit
|
|
2329
2353
|
});
|
|
2330
2354
|
}
|
|
2331
2355
|
return compact({
|
|
2332
2356
|
query: params.query?.trim(),
|
|
2333
|
-
|
|
2334
|
-
limit: params.limit ?? 100,
|
|
2335
|
-
sources: params.sources,
|
|
2336
|
-
lookback_days: params.lookbackDays,
|
|
2337
|
-
after_date: params.afterDate?.trim(),
|
|
2338
|
-
before_date: params.beforeDate?.trim(),
|
|
2339
|
-
dry_run: params.dryRun,
|
|
2340
|
-
idempotency_key: params.idempotencyKey
|
|
2357
|
+
limit: params.limit ?? 100
|
|
2341
2358
|
});
|
|
2342
2359
|
}
|
|
2343
2360
|
function normalizeSignalDiscoveryResult(params, data) {
|
|
@@ -2457,10 +2474,9 @@ function coreProductBatchRequestKey(path2, request) {
|
|
|
2457
2474
|
typeof request.title === "string" ? request.title.trim() : "",
|
|
2458
2475
|
typeof request.campaign_offer === "string" ? request.campaign_offer.trim() : "",
|
|
2459
2476
|
typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
|
|
2460
|
-
|
|
2477
|
+
request.run_without_signal === true,
|
|
2461
2478
|
Number(request.lookback_days) || null,
|
|
2462
2479
|
typeof request.signal_run_id === "string" ? request.signal_run_id.trim() : "",
|
|
2463
|
-
typeof request.signal_search_run_id === "string" ? request.signal_search_run_id.trim() : "",
|
|
2464
2480
|
typeof request.fact_id === "string" ? request.fact_id.trim() : "",
|
|
2465
2481
|
typeof request.event_id === "string" ? request.event_id.trim() : "",
|
|
2466
2482
|
request.enable_deep_search === true,
|
|
@@ -2567,10 +2583,9 @@ function signalToCopyRequestBody(params) {
|
|
|
2567
2583
|
person_name: params.personName,
|
|
2568
2584
|
title: params.title,
|
|
2569
2585
|
campaign_offer: params.campaignOffer,
|
|
2570
|
-
|
|
2586
|
+
run_without_signal: params.runWithoutSignal,
|
|
2571
2587
|
lookback_days: 365,
|
|
2572
2588
|
signal_run_id: params.signalRunId,
|
|
2573
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2574
2589
|
fact_id: params.factId,
|
|
2575
2590
|
event_id: params.eventId,
|
|
2576
2591
|
enable_deep_search: params.enableDeepSearch,
|
|
@@ -2582,7 +2597,7 @@ function signalToCopyRequestBody(params) {
|
|
|
2582
2597
|
function validateLargeSignalCopyBatch(requests) {
|
|
2583
2598
|
if (requests.length <= 25) return;
|
|
2584
2599
|
const invalidIndex = requests.findIndex(
|
|
2585
|
-
(request) => Boolean(request.idempotencyKey?.trim()) || request.maxWaitMs !== void 0 || request.pollIntervalMs !== void 0 || request.waitForResult === false || Boolean(request.
|
|
2600
|
+
(request) => Boolean(request.idempotencyKey?.trim()) || request.maxWaitMs !== void 0 || request.pollIntervalMs !== void 0 || request.waitForResult === false || Boolean(request.factId?.trim()) || Boolean(request.eventId?.trim()) || !request.companyDomain?.trim() || !request.personName?.trim() || !request.title?.trim() || !request.campaignOffer?.trim()
|
|
2586
2601
|
);
|
|
2587
2602
|
if (invalidIndex >= 0) {
|
|
2588
2603
|
throw new RangeError(
|
|
@@ -2596,10 +2611,9 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2596
2611
|
person_name: params.personName,
|
|
2597
2612
|
title: params.title,
|
|
2598
2613
|
campaign_offer: params.campaignOffer,
|
|
2599
|
-
|
|
2614
|
+
run_without_signal: params.runWithoutSignal,
|
|
2600
2615
|
lookback_days: 365,
|
|
2601
2616
|
signal_run_id: params.signalRunId,
|
|
2602
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2603
2617
|
fact_id: params.factId,
|
|
2604
2618
|
event_id: params.eventId,
|
|
2605
2619
|
enable_deep_search: params.enableDeepSearch
|
|
@@ -2607,15 +2621,12 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2607
2621
|
}
|
|
2608
2622
|
function validateSignalToCopyParams(params) {
|
|
2609
2623
|
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
2610
|
-
if (params.
|
|
2611
|
-
throw new
|
|
2624
|
+
if (params.runWithoutSignal !== void 0 && typeof params.runWithoutSignal !== "boolean") {
|
|
2625
|
+
throw new TypeError("runWithoutSignal must be a boolean");
|
|
2612
2626
|
}
|
|
2613
2627
|
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2614
2628
|
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2615
2629
|
}
|
|
2616
|
-
if (params.signalSearchRunId !== void 0 && !params.signalSearchRunId.trim()) {
|
|
2617
|
-
throw new TypeError("signalSearchRunId must be a non-empty string");
|
|
2618
|
-
}
|
|
2619
2630
|
for (const [field, value] of [["factId", params.factId], ["eventId", params.eventId]]) {
|
|
2620
2631
|
if (value !== void 0 && !/^[0-9a-f]{64}$/.test(value.trim())) {
|
|
2621
2632
|
throw new TypeError(`${field} must be a lowercase 64-character SHA-256 identifier`);
|
package/dist/mcp-config.mjs
CHANGED
package/package.json
CHANGED