@signaliz/sdk 1.0.73 → 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 +12 -22
- package/dist/{chunk-N4SFDZG7.mjs → chunk-KZICNZZF.mjs} +51 -72
- package/dist/index.d.mts +11 -20
- package/dist/index.d.ts +11 -20
- package/dist/index.js +51 -72
- package/dist/index.mjs +1 -1
- package/dist/mcp-config.js +51 -72
- 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({
|
|
@@ -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) {
|
|
@@ -2070,16 +2102,12 @@ function companySignalRequestBody(params) {
|
|
|
2070
2102
|
return compact({
|
|
2071
2103
|
signal_run_id: params.signalRunId,
|
|
2072
2104
|
domain: params.domain ?? params.companyDomain,
|
|
2073
|
-
|
|
2074
|
-
idempotency_key: params.idempotencyKey
|
|
2105
|
+
research_prompt: params.researchPrompt
|
|
2075
2106
|
});
|
|
2076
2107
|
}
|
|
2077
2108
|
function validateCompanySignalParams(params) {
|
|
2078
|
-
if (!params.signalRunId && !(params.domain ?? params.companyDomain)?.trim()) {
|
|
2079
|
-
throw new TypeError("Company Signals requires domain");
|
|
2080
|
-
}
|
|
2081
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2082
|
-
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");
|
|
2083
2111
|
}
|
|
2084
2112
|
}
|
|
2085
2113
|
function companySignalParamsFromRecoveredRow(row) {
|
|
@@ -2109,7 +2137,10 @@ function companySignalLargeBatchSubmission(requests) {
|
|
|
2109
2137
|
if (!hasIdentity) return null;
|
|
2110
2138
|
}
|
|
2111
2139
|
return {
|
|
2112
|
-
requests: requests.map((request) => compact({
|
|
2140
|
+
requests: requests.map((request) => compact({
|
|
2141
|
+
domain: request.domain,
|
|
2142
|
+
research_prompt: request.research_prompt
|
|
2143
|
+
})),
|
|
2113
2144
|
submissionFields
|
|
2114
2145
|
};
|
|
2115
2146
|
}
|
|
@@ -2259,7 +2290,6 @@ function normalizeSignalizFlowStatus(data) {
|
|
|
2259
2290
|
completedAt: typeof publicData.completed_at === "string" ? publicData.completed_at : void 0
|
|
2260
2291
|
};
|
|
2261
2292
|
}
|
|
2262
|
-
var SIGNAL_DISCOVERY_SOURCES = /* @__PURE__ */ new Set(["web", "news"]);
|
|
2263
2293
|
var SIGNAL_DISCOVERY_STATUSES = /* @__PURE__ */ new Set([
|
|
2264
2294
|
"planned",
|
|
2265
2295
|
"queued",
|
|
@@ -2277,42 +2307,8 @@ function validateSignalDiscoveryParams(params) {
|
|
|
2277
2307
|
if (query && (query.length < 2 || query.length > 2e3)) {
|
|
2278
2308
|
throw new RangeError("query must contain between 2 and 2000 characters");
|
|
2279
2309
|
}
|
|
2280
|
-
if (params.
|
|
2281
|
-
|
|
2282
|
-
if (icpContext.length < 2 || icpContext.length > 4e3) {
|
|
2283
|
-
throw new RangeError("icpContext must contain between 2 and 4000 characters");
|
|
2284
|
-
}
|
|
2285
|
-
}
|
|
2286
|
-
if (params.limit !== void 0 && (!Number.isInteger(params.limit) || params.limit < 1 || params.limit > 1e3)) {
|
|
2287
|
-
throw new RangeError("limit must be an integer between 1 and 1000");
|
|
2288
|
-
}
|
|
2289
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2290
|
-
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2291
|
-
}
|
|
2292
|
-
validateSignalDateWindow(params);
|
|
2293
|
-
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)))) {
|
|
2294
|
-
throw new TypeError("sources must contain only web or news");
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
function validateSignalDateWindow(params) {
|
|
2298
|
-
const afterDate = params.afterDate?.trim();
|
|
2299
|
-
const beforeDate = params.beforeDate?.trim();
|
|
2300
|
-
if ((afterDate || beforeDate) && params.lookbackDays !== void 0) {
|
|
2301
|
-
throw new RangeError("afterDate/beforeDate cannot be combined with lookbackDays");
|
|
2302
|
-
}
|
|
2303
|
-
const parseDate = (value, field) => {
|
|
2304
|
-
if (value === void 0) return void 0;
|
|
2305
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) throw new RangeError(`${field} must use YYYY-MM-DD format`);
|
|
2306
|
-
const timestamp = Date.parse(`${value}T00:00:00Z`);
|
|
2307
|
-
if (!Number.isFinite(timestamp) || new Date(timestamp).toISOString().slice(0, 10) !== value) {
|
|
2308
|
-
throw new RangeError(`${field} must be a valid calendar date`);
|
|
2309
|
-
}
|
|
2310
|
-
return timestamp;
|
|
2311
|
-
};
|
|
2312
|
-
const afterTimestamp = parseDate(afterDate, "afterDate");
|
|
2313
|
-
const beforeTimestamp = parseDate(beforeDate, "beforeDate");
|
|
2314
|
-
if (afterTimestamp !== void 0 && beforeTimestamp !== void 0 && beforeTimestamp < afterTimestamp) {
|
|
2315
|
-
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");
|
|
2316
2312
|
}
|
|
2317
2313
|
}
|
|
2318
2314
|
function signalDiscoveryRequestBody(params) {
|
|
@@ -2322,23 +2318,12 @@ function signalDiscoveryRequestBody(params) {
|
|
|
2322
2318
|
signal_search_run_id: runId,
|
|
2323
2319
|
// An explicit limit expands or narrows the retained qualified cohort;
|
|
2324
2320
|
// omitting it preserves the original preview size.
|
|
2325
|
-
limit: params.limit
|
|
2326
|
-
after_date: params.afterDate?.trim(),
|
|
2327
|
-
before_date: params.beforeDate?.trim(),
|
|
2328
|
-
dry_run: params.dryRun,
|
|
2329
|
-
idempotency_key: params.idempotencyKey
|
|
2321
|
+
limit: params.limit
|
|
2330
2322
|
});
|
|
2331
2323
|
}
|
|
2332
2324
|
return compact({
|
|
2333
2325
|
query: params.query?.trim(),
|
|
2334
|
-
|
|
2335
|
-
limit: params.limit ?? 100,
|
|
2336
|
-
sources: params.sources,
|
|
2337
|
-
lookback_days: params.lookbackDays,
|
|
2338
|
-
after_date: params.afterDate?.trim(),
|
|
2339
|
-
before_date: params.beforeDate?.trim(),
|
|
2340
|
-
dry_run: params.dryRun,
|
|
2341
|
-
idempotency_key: params.idempotencyKey
|
|
2326
|
+
limit: params.limit ?? 100
|
|
2342
2327
|
});
|
|
2343
2328
|
}
|
|
2344
2329
|
function normalizeSignalDiscoveryResult(params, data) {
|
|
@@ -2458,10 +2443,9 @@ function coreProductBatchRequestKey(path, request) {
|
|
|
2458
2443
|
typeof request.title === "string" ? request.title.trim() : "",
|
|
2459
2444
|
typeof request.campaign_offer === "string" ? request.campaign_offer.trim() : "",
|
|
2460
2445
|
typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
|
|
2461
|
-
|
|
2446
|
+
request.run_without_signal === true,
|
|
2462
2447
|
Number(request.lookback_days) || null,
|
|
2463
2448
|
typeof request.signal_run_id === "string" ? request.signal_run_id.trim() : "",
|
|
2464
|
-
typeof request.signal_search_run_id === "string" ? request.signal_search_run_id.trim() : "",
|
|
2465
2449
|
typeof request.fact_id === "string" ? request.fact_id.trim() : "",
|
|
2466
2450
|
typeof request.event_id === "string" ? request.event_id.trim() : "",
|
|
2467
2451
|
request.enable_deep_search === true,
|
|
@@ -2568,10 +2552,9 @@ function signalToCopyRequestBody(params) {
|
|
|
2568
2552
|
person_name: params.personName,
|
|
2569
2553
|
title: params.title,
|
|
2570
2554
|
campaign_offer: params.campaignOffer,
|
|
2571
|
-
|
|
2555
|
+
run_without_signal: params.runWithoutSignal,
|
|
2572
2556
|
lookback_days: 365,
|
|
2573
2557
|
signal_run_id: params.signalRunId,
|
|
2574
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2575
2558
|
fact_id: params.factId,
|
|
2576
2559
|
event_id: params.eventId,
|
|
2577
2560
|
enable_deep_search: params.enableDeepSearch,
|
|
@@ -2583,7 +2566,7 @@ function signalToCopyRequestBody(params) {
|
|
|
2583
2566
|
function validateLargeSignalCopyBatch(requests) {
|
|
2584
2567
|
if (requests.length <= 25) return;
|
|
2585
2568
|
const invalidIndex = requests.findIndex(
|
|
2586
|
-
(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()
|
|
2587
2570
|
);
|
|
2588
2571
|
if (invalidIndex >= 0) {
|
|
2589
2572
|
throw new RangeError(
|
|
@@ -2597,10 +2580,9 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2597
2580
|
person_name: params.personName,
|
|
2598
2581
|
title: params.title,
|
|
2599
2582
|
campaign_offer: params.campaignOffer,
|
|
2600
|
-
|
|
2583
|
+
run_without_signal: params.runWithoutSignal,
|
|
2601
2584
|
lookback_days: 365,
|
|
2602
2585
|
signal_run_id: params.signalRunId,
|
|
2603
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2604
2586
|
fact_id: params.factId,
|
|
2605
2587
|
event_id: params.eventId,
|
|
2606
2588
|
enable_deep_search: params.enableDeepSearch
|
|
@@ -2608,15 +2590,12 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2608
2590
|
}
|
|
2609
2591
|
function validateSignalToCopyParams(params) {
|
|
2610
2592
|
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
2611
|
-
if (params.
|
|
2612
|
-
throw new
|
|
2593
|
+
if (params.runWithoutSignal !== void 0 && typeof params.runWithoutSignal !== "boolean") {
|
|
2594
|
+
throw new TypeError("runWithoutSignal must be a boolean");
|
|
2613
2595
|
}
|
|
2614
2596
|
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2615
2597
|
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2616
2598
|
}
|
|
2617
|
-
if (params.signalSearchRunId !== void 0 && !params.signalSearchRunId.trim()) {
|
|
2618
|
-
throw new TypeError("signalSearchRunId must be a non-empty string");
|
|
2619
|
-
}
|
|
2620
2599
|
for (const [field, value] of [["factId", params.factId], ["eventId", params.eventId]]) {
|
|
2621
2600
|
if (value !== void 0 && !/^[0-9a-f]{64}$/.test(value.trim())) {
|
|
2622
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;
|
|
@@ -343,13 +343,13 @@ interface VerifyEmailBatchInput {
|
|
|
343
343
|
interface CompanySignalEnrichmentParams {
|
|
344
344
|
/** Resume an existing enrichment without creating another provider run. */
|
|
345
345
|
signalRunId?: string;
|
|
346
|
-
/** Company domain.
|
|
346
|
+
/** Company domain. Required for a new enrichment. */
|
|
347
347
|
domain?: string;
|
|
348
348
|
/** @deprecated Use domain. Accepted for source compatibility but not sent. */
|
|
349
349
|
companyDomain?: string;
|
|
350
350
|
/** @deprecated Company names are derived from the supplied domain. */
|
|
351
351
|
companyName?: string;
|
|
352
|
-
/**
|
|
352
|
+
/** Required research question for a new enrichment. */
|
|
353
353
|
researchPrompt?: string;
|
|
354
354
|
/** @deprecated Signaliz owns the fixed evidence window and ignores this value. */
|
|
355
355
|
lookbackDays?: number;
|
|
@@ -380,23 +380,12 @@ interface CompanySignalEnrichmentResult {
|
|
|
380
380
|
signalCount: number;
|
|
381
381
|
creditsUsed?: number;
|
|
382
382
|
}
|
|
383
|
-
type SignalDiscoverySource = 'web' | 'news';
|
|
384
383
|
type SignalDiscoveryStatus = 'planned' | 'queued' | 'processing' | 'completed' | 'completed_with_warnings' | 'failed';
|
|
385
384
|
interface SignalDiscoveryParams {
|
|
386
385
|
/** Any natural-language signal question. Required for a new search. */
|
|
387
386
|
query?: string;
|
|
388
|
-
/**
|
|
389
|
-
icpContext?: string;
|
|
390
|
-
/** 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. */
|
|
391
388
|
limit?: number;
|
|
392
|
-
/** Restrict discovery to selected source families. */
|
|
393
|
-
sources?: SignalDiscoverySource[];
|
|
394
|
-
/** Maximum signal age in days. Allowed range is 1-365. */
|
|
395
|
-
lookbackDays?: number;
|
|
396
|
-
/** Inclusive event-date lower bound (YYYY-MM-DD). Mutually exclusive with lookbackDays. */
|
|
397
|
-
afterDate?: string;
|
|
398
|
-
/** Inclusive event-date upper bound (YYYY-MM-DD). Mutually exclusive with lookbackDays. */
|
|
399
|
-
beforeDate?: string;
|
|
400
389
|
/** Resume an existing asynchronous discovery run without starting another search. */
|
|
401
390
|
signalSearchRunId?: string;
|
|
402
391
|
/** Stable retry key for recovering the same search after an ambiguous response. */
|
|
@@ -493,13 +482,11 @@ interface SignalToCopyParams {
|
|
|
493
482
|
title?: string;
|
|
494
483
|
campaignOffer?: string;
|
|
495
484
|
researchPrompt?: string;
|
|
496
|
-
/**
|
|
497
|
-
|
|
485
|
+
/** Set true to draft from the campaign offer without researching or claiming a company signal. */
|
|
486
|
+
runWithoutSignal?: boolean;
|
|
498
487
|
/** Maximum signal age used for company-signal research. Defaults to 90 days. */
|
|
499
488
|
lookbackDays?: number;
|
|
500
489
|
signalRunId?: string;
|
|
501
|
-
/** Reuse an immutable Signals First snapshot without company re-research. Supported in single calls and batches of 25 or fewer. */
|
|
502
|
-
signalSearchRunId?: string;
|
|
503
490
|
/** Reuse one canonical signal fact without rediscovery. Supported in single calls and batches of 25 or fewer. */
|
|
504
491
|
factId?: string;
|
|
505
492
|
/** Reuse one canonical signal event without rediscovery. Supported in single calls and batches of 25 or fewer. */
|
|
@@ -584,6 +571,10 @@ declare class Signaliz {
|
|
|
584
571
|
* receipt, including zero-credit available-data reuse.
|
|
585
572
|
*/
|
|
586
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>;
|
|
587
578
|
createSignalMonitor(monitor: SignalMonitorInput): Promise<SignalAwarenessResponse>;
|
|
588
579
|
listSignalMonitors(limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
|
|
589
580
|
runSignalMonitor(monitorId: string, idempotencyKey?: string): Promise<SignalAwarenessResponse>;
|
|
@@ -659,4 +650,4 @@ declare class Signaliz {
|
|
|
659
650
|
health(): Promise<PlatformHealth>;
|
|
660
651
|
}
|
|
661
652
|
|
|
662
|
-
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;
|
|
@@ -343,13 +343,13 @@ interface VerifyEmailBatchInput {
|
|
|
343
343
|
interface CompanySignalEnrichmentParams {
|
|
344
344
|
/** Resume an existing enrichment without creating another provider run. */
|
|
345
345
|
signalRunId?: string;
|
|
346
|
-
/** Company domain.
|
|
346
|
+
/** Company domain. Required for a new enrichment. */
|
|
347
347
|
domain?: string;
|
|
348
348
|
/** @deprecated Use domain. Accepted for source compatibility but not sent. */
|
|
349
349
|
companyDomain?: string;
|
|
350
350
|
/** @deprecated Company names are derived from the supplied domain. */
|
|
351
351
|
companyName?: string;
|
|
352
|
-
/**
|
|
352
|
+
/** Required research question for a new enrichment. */
|
|
353
353
|
researchPrompt?: string;
|
|
354
354
|
/** @deprecated Signaliz owns the fixed evidence window and ignores this value. */
|
|
355
355
|
lookbackDays?: number;
|
|
@@ -380,23 +380,12 @@ interface CompanySignalEnrichmentResult {
|
|
|
380
380
|
signalCount: number;
|
|
381
381
|
creditsUsed?: number;
|
|
382
382
|
}
|
|
383
|
-
type SignalDiscoverySource = 'web' | 'news';
|
|
384
383
|
type SignalDiscoveryStatus = 'planned' | 'queued' | 'processing' | 'completed' | 'completed_with_warnings' | 'failed';
|
|
385
384
|
interface SignalDiscoveryParams {
|
|
386
385
|
/** Any natural-language signal question. Required for a new search. */
|
|
387
386
|
query?: string;
|
|
388
|
-
/**
|
|
389
|
-
icpContext?: string;
|
|
390
|
-
/** 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. */
|
|
391
388
|
limit?: number;
|
|
392
|
-
/** Restrict discovery to selected source families. */
|
|
393
|
-
sources?: SignalDiscoverySource[];
|
|
394
|
-
/** Maximum signal age in days. Allowed range is 1-365. */
|
|
395
|
-
lookbackDays?: number;
|
|
396
|
-
/** Inclusive event-date lower bound (YYYY-MM-DD). Mutually exclusive with lookbackDays. */
|
|
397
|
-
afterDate?: string;
|
|
398
|
-
/** Inclusive event-date upper bound (YYYY-MM-DD). Mutually exclusive with lookbackDays. */
|
|
399
|
-
beforeDate?: string;
|
|
400
389
|
/** Resume an existing asynchronous discovery run without starting another search. */
|
|
401
390
|
signalSearchRunId?: string;
|
|
402
391
|
/** Stable retry key for recovering the same search after an ambiguous response. */
|
|
@@ -493,13 +482,11 @@ interface SignalToCopyParams {
|
|
|
493
482
|
title?: string;
|
|
494
483
|
campaignOffer?: string;
|
|
495
484
|
researchPrompt?: string;
|
|
496
|
-
/**
|
|
497
|
-
|
|
485
|
+
/** Set true to draft from the campaign offer without researching or claiming a company signal. */
|
|
486
|
+
runWithoutSignal?: boolean;
|
|
498
487
|
/** Maximum signal age used for company-signal research. Defaults to 90 days. */
|
|
499
488
|
lookbackDays?: number;
|
|
500
489
|
signalRunId?: string;
|
|
501
|
-
/** Reuse an immutable Signals First snapshot without company re-research. Supported in single calls and batches of 25 or fewer. */
|
|
502
|
-
signalSearchRunId?: string;
|
|
503
490
|
/** Reuse one canonical signal fact without rediscovery. Supported in single calls and batches of 25 or fewer. */
|
|
504
491
|
factId?: string;
|
|
505
492
|
/** Reuse one canonical signal event without rediscovery. Supported in single calls and batches of 25 or fewer. */
|
|
@@ -584,6 +571,10 @@ declare class Signaliz {
|
|
|
584
571
|
* receipt, including zero-credit available-data reuse.
|
|
585
572
|
*/
|
|
586
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>;
|
|
587
578
|
createSignalMonitor(monitor: SignalMonitorInput): Promise<SignalAwarenessResponse>;
|
|
588
579
|
listSignalMonitors(limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
|
|
589
580
|
runSignalMonitor(monitorId: string, idempotencyKey?: string): Promise<SignalAwarenessResponse>;
|
|
@@ -659,4 +650,4 @@ declare class Signaliz {
|
|
|
659
650
|
health(): Promise<PlatformHealth>;
|
|
660
651
|
}
|
|
661
652
|
|
|
662
|
-
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) {
|
|
@@ -2097,16 +2129,12 @@ function companySignalRequestBody(params) {
|
|
|
2097
2129
|
return compact({
|
|
2098
2130
|
signal_run_id: params.signalRunId,
|
|
2099
2131
|
domain: params.domain ?? params.companyDomain,
|
|
2100
|
-
|
|
2101
|
-
idempotency_key: params.idempotencyKey
|
|
2132
|
+
research_prompt: params.researchPrompt
|
|
2102
2133
|
});
|
|
2103
2134
|
}
|
|
2104
2135
|
function validateCompanySignalParams(params) {
|
|
2105
|
-
if (!params.signalRunId && !(params.domain ?? params.companyDomain)?.trim()) {
|
|
2106
|
-
throw new TypeError("Company Signals requires domain");
|
|
2107
|
-
}
|
|
2108
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2109
|
-
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");
|
|
2110
2138
|
}
|
|
2111
2139
|
}
|
|
2112
2140
|
function companySignalParamsFromRecoveredRow(row) {
|
|
@@ -2136,7 +2164,10 @@ function companySignalLargeBatchSubmission(requests) {
|
|
|
2136
2164
|
if (!hasIdentity) return null;
|
|
2137
2165
|
}
|
|
2138
2166
|
return {
|
|
2139
|
-
requests: requests.map((request) => compact({
|
|
2167
|
+
requests: requests.map((request) => compact({
|
|
2168
|
+
domain: request.domain,
|
|
2169
|
+
research_prompt: request.research_prompt
|
|
2170
|
+
})),
|
|
2140
2171
|
submissionFields
|
|
2141
2172
|
};
|
|
2142
2173
|
}
|
|
@@ -2286,7 +2317,6 @@ function normalizeSignalizFlowStatus(data) {
|
|
|
2286
2317
|
completedAt: typeof publicData.completed_at === "string" ? publicData.completed_at : void 0
|
|
2287
2318
|
};
|
|
2288
2319
|
}
|
|
2289
|
-
var SIGNAL_DISCOVERY_SOURCES = /* @__PURE__ */ new Set(["web", "news"]);
|
|
2290
2320
|
var SIGNAL_DISCOVERY_STATUSES = /* @__PURE__ */ new Set([
|
|
2291
2321
|
"planned",
|
|
2292
2322
|
"queued",
|
|
@@ -2304,42 +2334,8 @@ function validateSignalDiscoveryParams(params) {
|
|
|
2304
2334
|
if (query && (query.length < 2 || query.length > 2e3)) {
|
|
2305
2335
|
throw new RangeError("query must contain between 2 and 2000 characters");
|
|
2306
2336
|
}
|
|
2307
|
-
if (params.
|
|
2308
|
-
|
|
2309
|
-
if (icpContext.length < 2 || icpContext.length > 4e3) {
|
|
2310
|
-
throw new RangeError("icpContext must contain between 2 and 4000 characters");
|
|
2311
|
-
}
|
|
2312
|
-
}
|
|
2313
|
-
if (params.limit !== void 0 && (!Number.isInteger(params.limit) || params.limit < 1 || params.limit > 1e3)) {
|
|
2314
|
-
throw new RangeError("limit must be an integer between 1 and 1000");
|
|
2315
|
-
}
|
|
2316
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2317
|
-
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2318
|
-
}
|
|
2319
|
-
validateSignalDateWindow(params);
|
|
2320
|
-
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)))) {
|
|
2321
|
-
throw new TypeError("sources must contain only web or news");
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
function validateSignalDateWindow(params) {
|
|
2325
|
-
const afterDate = params.afterDate?.trim();
|
|
2326
|
-
const beforeDate = params.beforeDate?.trim();
|
|
2327
|
-
if ((afterDate || beforeDate) && params.lookbackDays !== void 0) {
|
|
2328
|
-
throw new RangeError("afterDate/beforeDate cannot be combined with lookbackDays");
|
|
2329
|
-
}
|
|
2330
|
-
const parseDate = (value, field) => {
|
|
2331
|
-
if (value === void 0) return void 0;
|
|
2332
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) throw new RangeError(`${field} must use YYYY-MM-DD format`);
|
|
2333
|
-
const timestamp = Date.parse(`${value}T00:00:00Z`);
|
|
2334
|
-
if (!Number.isFinite(timestamp) || new Date(timestamp).toISOString().slice(0, 10) !== value) {
|
|
2335
|
-
throw new RangeError(`${field} must be a valid calendar date`);
|
|
2336
|
-
}
|
|
2337
|
-
return timestamp;
|
|
2338
|
-
};
|
|
2339
|
-
const afterTimestamp = parseDate(afterDate, "afterDate");
|
|
2340
|
-
const beforeTimestamp = parseDate(beforeDate, "beforeDate");
|
|
2341
|
-
if (afterTimestamp !== void 0 && beforeTimestamp !== void 0 && beforeTimestamp < afterTimestamp) {
|
|
2342
|
-
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");
|
|
2343
2339
|
}
|
|
2344
2340
|
}
|
|
2345
2341
|
function signalDiscoveryRequestBody(params) {
|
|
@@ -2349,23 +2345,12 @@ function signalDiscoveryRequestBody(params) {
|
|
|
2349
2345
|
signal_search_run_id: runId,
|
|
2350
2346
|
// An explicit limit expands or narrows the retained qualified cohort;
|
|
2351
2347
|
// omitting it preserves the original preview size.
|
|
2352
|
-
limit: params.limit
|
|
2353
|
-
after_date: params.afterDate?.trim(),
|
|
2354
|
-
before_date: params.beforeDate?.trim(),
|
|
2355
|
-
dry_run: params.dryRun,
|
|
2356
|
-
idempotency_key: params.idempotencyKey
|
|
2348
|
+
limit: params.limit
|
|
2357
2349
|
});
|
|
2358
2350
|
}
|
|
2359
2351
|
return compact({
|
|
2360
2352
|
query: params.query?.trim(),
|
|
2361
|
-
|
|
2362
|
-
limit: params.limit ?? 100,
|
|
2363
|
-
sources: params.sources,
|
|
2364
|
-
lookback_days: params.lookbackDays,
|
|
2365
|
-
after_date: params.afterDate?.trim(),
|
|
2366
|
-
before_date: params.beforeDate?.trim(),
|
|
2367
|
-
dry_run: params.dryRun,
|
|
2368
|
-
idempotency_key: params.idempotencyKey
|
|
2353
|
+
limit: params.limit ?? 100
|
|
2369
2354
|
});
|
|
2370
2355
|
}
|
|
2371
2356
|
function normalizeSignalDiscoveryResult(params, data) {
|
|
@@ -2485,10 +2470,9 @@ function coreProductBatchRequestKey(path, request) {
|
|
|
2485
2470
|
typeof request.title === "string" ? request.title.trim() : "",
|
|
2486
2471
|
typeof request.campaign_offer === "string" ? request.campaign_offer.trim() : "",
|
|
2487
2472
|
typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
|
|
2488
|
-
|
|
2473
|
+
request.run_without_signal === true,
|
|
2489
2474
|
Number(request.lookback_days) || null,
|
|
2490
2475
|
typeof request.signal_run_id === "string" ? request.signal_run_id.trim() : "",
|
|
2491
|
-
typeof request.signal_search_run_id === "string" ? request.signal_search_run_id.trim() : "",
|
|
2492
2476
|
typeof request.fact_id === "string" ? request.fact_id.trim() : "",
|
|
2493
2477
|
typeof request.event_id === "string" ? request.event_id.trim() : "",
|
|
2494
2478
|
request.enable_deep_search === true,
|
|
@@ -2595,10 +2579,9 @@ function signalToCopyRequestBody(params) {
|
|
|
2595
2579
|
person_name: params.personName,
|
|
2596
2580
|
title: params.title,
|
|
2597
2581
|
campaign_offer: params.campaignOffer,
|
|
2598
|
-
|
|
2582
|
+
run_without_signal: params.runWithoutSignal,
|
|
2599
2583
|
lookback_days: 365,
|
|
2600
2584
|
signal_run_id: params.signalRunId,
|
|
2601
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2602
2585
|
fact_id: params.factId,
|
|
2603
2586
|
event_id: params.eventId,
|
|
2604
2587
|
enable_deep_search: params.enableDeepSearch,
|
|
@@ -2610,7 +2593,7 @@ function signalToCopyRequestBody(params) {
|
|
|
2610
2593
|
function validateLargeSignalCopyBatch(requests) {
|
|
2611
2594
|
if (requests.length <= 25) return;
|
|
2612
2595
|
const invalidIndex = requests.findIndex(
|
|
2613
|
-
(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()
|
|
2614
2597
|
);
|
|
2615
2598
|
if (invalidIndex >= 0) {
|
|
2616
2599
|
throw new RangeError(
|
|
@@ -2624,10 +2607,9 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2624
2607
|
person_name: params.personName,
|
|
2625
2608
|
title: params.title,
|
|
2626
2609
|
campaign_offer: params.campaignOffer,
|
|
2627
|
-
|
|
2610
|
+
run_without_signal: params.runWithoutSignal,
|
|
2628
2611
|
lookback_days: 365,
|
|
2629
2612
|
signal_run_id: params.signalRunId,
|
|
2630
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2631
2613
|
fact_id: params.factId,
|
|
2632
2614
|
event_id: params.eventId,
|
|
2633
2615
|
enable_deep_search: params.enableDeepSearch
|
|
@@ -2635,15 +2617,12 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2635
2617
|
}
|
|
2636
2618
|
function validateSignalToCopyParams(params) {
|
|
2637
2619
|
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
2638
|
-
if (params.
|
|
2639
|
-
throw new
|
|
2620
|
+
if (params.runWithoutSignal !== void 0 && typeof params.runWithoutSignal !== "boolean") {
|
|
2621
|
+
throw new TypeError("runWithoutSignal must be a boolean");
|
|
2640
2622
|
}
|
|
2641
2623
|
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2642
2624
|
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2643
2625
|
}
|
|
2644
|
-
if (params.signalSearchRunId !== void 0 && !params.signalSearchRunId.trim()) {
|
|
2645
|
-
throw new TypeError("signalSearchRunId must be a non-empty string");
|
|
2646
|
-
}
|
|
2647
2626
|
for (const [field, value] of [["factId", params.factId], ["eventId", params.eventId]]) {
|
|
2648
2627
|
if (value !== void 0 && !/^[0-9a-f]{64}$/.test(value.trim())) {
|
|
2649
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) {
|
|
@@ -2101,16 +2133,12 @@ function companySignalRequestBody(params) {
|
|
|
2101
2133
|
return compact({
|
|
2102
2134
|
signal_run_id: params.signalRunId,
|
|
2103
2135
|
domain: params.domain ?? params.companyDomain,
|
|
2104
|
-
|
|
2105
|
-
idempotency_key: params.idempotencyKey
|
|
2136
|
+
research_prompt: params.researchPrompt
|
|
2106
2137
|
});
|
|
2107
2138
|
}
|
|
2108
2139
|
function validateCompanySignalParams(params) {
|
|
2109
|
-
if (!params.signalRunId && !(params.domain ?? params.companyDomain)?.trim()) {
|
|
2110
|
-
throw new TypeError("Company Signals requires domain");
|
|
2111
|
-
}
|
|
2112
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2113
|
-
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");
|
|
2114
2142
|
}
|
|
2115
2143
|
}
|
|
2116
2144
|
function companySignalParamsFromRecoveredRow(row) {
|
|
@@ -2140,7 +2168,10 @@ function companySignalLargeBatchSubmission(requests) {
|
|
|
2140
2168
|
if (!hasIdentity) return null;
|
|
2141
2169
|
}
|
|
2142
2170
|
return {
|
|
2143
|
-
requests: requests.map((request) => compact({
|
|
2171
|
+
requests: requests.map((request) => compact({
|
|
2172
|
+
domain: request.domain,
|
|
2173
|
+
research_prompt: request.research_prompt
|
|
2174
|
+
})),
|
|
2144
2175
|
submissionFields
|
|
2145
2176
|
};
|
|
2146
2177
|
}
|
|
@@ -2290,7 +2321,6 @@ function normalizeSignalizFlowStatus(data) {
|
|
|
2290
2321
|
completedAt: typeof publicData.completed_at === "string" ? publicData.completed_at : void 0
|
|
2291
2322
|
};
|
|
2292
2323
|
}
|
|
2293
|
-
var SIGNAL_DISCOVERY_SOURCES = /* @__PURE__ */ new Set(["web", "news"]);
|
|
2294
2324
|
var SIGNAL_DISCOVERY_STATUSES = /* @__PURE__ */ new Set([
|
|
2295
2325
|
"planned",
|
|
2296
2326
|
"queued",
|
|
@@ -2308,42 +2338,8 @@ function validateSignalDiscoveryParams(params) {
|
|
|
2308
2338
|
if (query && (query.length < 2 || query.length > 2e3)) {
|
|
2309
2339
|
throw new RangeError("query must contain between 2 and 2000 characters");
|
|
2310
2340
|
}
|
|
2311
|
-
if (params.
|
|
2312
|
-
|
|
2313
|
-
if (icpContext.length < 2 || icpContext.length > 4e3) {
|
|
2314
|
-
throw new RangeError("icpContext must contain between 2 and 4000 characters");
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
if (params.limit !== void 0 && (!Number.isInteger(params.limit) || params.limit < 1 || params.limit > 1e3)) {
|
|
2318
|
-
throw new RangeError("limit must be an integer between 1 and 1000");
|
|
2319
|
-
}
|
|
2320
|
-
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2321
|
-
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2322
|
-
}
|
|
2323
|
-
validateSignalDateWindow(params);
|
|
2324
|
-
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)))) {
|
|
2325
|
-
throw new TypeError("sources must contain only web or news");
|
|
2326
|
-
}
|
|
2327
|
-
}
|
|
2328
|
-
function validateSignalDateWindow(params) {
|
|
2329
|
-
const afterDate = params.afterDate?.trim();
|
|
2330
|
-
const beforeDate = params.beforeDate?.trim();
|
|
2331
|
-
if ((afterDate || beforeDate) && params.lookbackDays !== void 0) {
|
|
2332
|
-
throw new RangeError("afterDate/beforeDate cannot be combined with lookbackDays");
|
|
2333
|
-
}
|
|
2334
|
-
const parseDate = (value, field) => {
|
|
2335
|
-
if (value === void 0) return void 0;
|
|
2336
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) throw new RangeError(`${field} must use YYYY-MM-DD format`);
|
|
2337
|
-
const timestamp = Date.parse(`${value}T00:00:00Z`);
|
|
2338
|
-
if (!Number.isFinite(timestamp) || new Date(timestamp).toISOString().slice(0, 10) !== value) {
|
|
2339
|
-
throw new RangeError(`${field} must be a valid calendar date`);
|
|
2340
|
-
}
|
|
2341
|
-
return timestamp;
|
|
2342
|
-
};
|
|
2343
|
-
const afterTimestamp = parseDate(afterDate, "afterDate");
|
|
2344
|
-
const beforeTimestamp = parseDate(beforeDate, "beforeDate");
|
|
2345
|
-
if (afterTimestamp !== void 0 && beforeTimestamp !== void 0 && beforeTimestamp < afterTimestamp) {
|
|
2346
|
-
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");
|
|
2347
2343
|
}
|
|
2348
2344
|
}
|
|
2349
2345
|
function signalDiscoveryRequestBody(params) {
|
|
@@ -2353,23 +2349,12 @@ function signalDiscoveryRequestBody(params) {
|
|
|
2353
2349
|
signal_search_run_id: runId,
|
|
2354
2350
|
// An explicit limit expands or narrows the retained qualified cohort;
|
|
2355
2351
|
// omitting it preserves the original preview size.
|
|
2356
|
-
limit: params.limit
|
|
2357
|
-
after_date: params.afterDate?.trim(),
|
|
2358
|
-
before_date: params.beforeDate?.trim(),
|
|
2359
|
-
dry_run: params.dryRun,
|
|
2360
|
-
idempotency_key: params.idempotencyKey
|
|
2352
|
+
limit: params.limit
|
|
2361
2353
|
});
|
|
2362
2354
|
}
|
|
2363
2355
|
return compact({
|
|
2364
2356
|
query: params.query?.trim(),
|
|
2365
|
-
|
|
2366
|
-
limit: params.limit ?? 100,
|
|
2367
|
-
sources: params.sources,
|
|
2368
|
-
lookback_days: params.lookbackDays,
|
|
2369
|
-
after_date: params.afterDate?.trim(),
|
|
2370
|
-
before_date: params.beforeDate?.trim(),
|
|
2371
|
-
dry_run: params.dryRun,
|
|
2372
|
-
idempotency_key: params.idempotencyKey
|
|
2357
|
+
limit: params.limit ?? 100
|
|
2373
2358
|
});
|
|
2374
2359
|
}
|
|
2375
2360
|
function normalizeSignalDiscoveryResult(params, data) {
|
|
@@ -2489,10 +2474,9 @@ function coreProductBatchRequestKey(path2, request) {
|
|
|
2489
2474
|
typeof request.title === "string" ? request.title.trim() : "",
|
|
2490
2475
|
typeof request.campaign_offer === "string" ? request.campaign_offer.trim() : "",
|
|
2491
2476
|
typeof request.research_prompt === "string" ? request.research_prompt.trim() : "",
|
|
2492
|
-
|
|
2477
|
+
request.run_without_signal === true,
|
|
2493
2478
|
Number(request.lookback_days) || null,
|
|
2494
2479
|
typeof request.signal_run_id === "string" ? request.signal_run_id.trim() : "",
|
|
2495
|
-
typeof request.signal_search_run_id === "string" ? request.signal_search_run_id.trim() : "",
|
|
2496
2480
|
typeof request.fact_id === "string" ? request.fact_id.trim() : "",
|
|
2497
2481
|
typeof request.event_id === "string" ? request.event_id.trim() : "",
|
|
2498
2482
|
request.enable_deep_search === true,
|
|
@@ -2599,10 +2583,9 @@ function signalToCopyRequestBody(params) {
|
|
|
2599
2583
|
person_name: params.personName,
|
|
2600
2584
|
title: params.title,
|
|
2601
2585
|
campaign_offer: params.campaignOffer,
|
|
2602
|
-
|
|
2586
|
+
run_without_signal: params.runWithoutSignal,
|
|
2603
2587
|
lookback_days: 365,
|
|
2604
2588
|
signal_run_id: params.signalRunId,
|
|
2605
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2606
2589
|
fact_id: params.factId,
|
|
2607
2590
|
event_id: params.eventId,
|
|
2608
2591
|
enable_deep_search: params.enableDeepSearch,
|
|
@@ -2614,7 +2597,7 @@ function signalToCopyRequestBody(params) {
|
|
|
2614
2597
|
function validateLargeSignalCopyBatch(requests) {
|
|
2615
2598
|
if (requests.length <= 25) return;
|
|
2616
2599
|
const invalidIndex = requests.findIndex(
|
|
2617
|
-
(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()
|
|
2618
2601
|
);
|
|
2619
2602
|
if (invalidIndex >= 0) {
|
|
2620
2603
|
throw new RangeError(
|
|
@@ -2628,10 +2611,9 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2628
2611
|
person_name: params.personName,
|
|
2629
2612
|
title: params.title,
|
|
2630
2613
|
campaign_offer: params.campaignOffer,
|
|
2631
|
-
|
|
2614
|
+
run_without_signal: params.runWithoutSignal,
|
|
2632
2615
|
lookback_days: 365,
|
|
2633
2616
|
signal_run_id: params.signalRunId,
|
|
2634
|
-
signal_search_run_id: params.signalSearchRunId,
|
|
2635
2617
|
fact_id: params.factId,
|
|
2636
2618
|
event_id: params.eventId,
|
|
2637
2619
|
enable_deep_search: params.enableDeepSearch
|
|
@@ -2639,15 +2621,12 @@ function durableSignalCopyRequestBody(params) {
|
|
|
2639
2621
|
}
|
|
2640
2622
|
function validateSignalToCopyParams(params) {
|
|
2641
2623
|
validateCoreProductMaxWaitMs(params.maxWaitMs);
|
|
2642
|
-
if (params.
|
|
2643
|
-
throw new
|
|
2624
|
+
if (params.runWithoutSignal !== void 0 && typeof params.runWithoutSignal !== "boolean") {
|
|
2625
|
+
throw new TypeError("runWithoutSignal must be a boolean");
|
|
2644
2626
|
}
|
|
2645
2627
|
if (params.lookbackDays !== void 0 && (!Number.isInteger(params.lookbackDays) || params.lookbackDays < 1 || params.lookbackDays > 365)) {
|
|
2646
2628
|
throw new RangeError("lookbackDays must be an integer between 1 and 365");
|
|
2647
2629
|
}
|
|
2648
|
-
if (params.signalSearchRunId !== void 0 && !params.signalSearchRunId.trim()) {
|
|
2649
|
-
throw new TypeError("signalSearchRunId must be a non-empty string");
|
|
2650
|
-
}
|
|
2651
2630
|
for (const [field, value] of [["factId", params.factId], ["eventId", params.eventId]]) {
|
|
2652
2631
|
if (value !== void 0 && !/^[0-9a-f]{64}$/.test(value.trim())) {
|
|
2653
2632
|
throw new TypeError(`${field} must be a lowercase 64-character SHA-256 identifier`);
|
package/dist/mcp-config.mjs
CHANGED
package/package.json
CHANGED