@signaliz/cli 1.0.66 → 1.0.68
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 +8 -4
- package/dist/bin.js +155 -47
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ signaliz signal-to-copy --company-domain example.com --person-name "Jane Doe" \
|
|
|
45
45
|
|
|
46
46
|
# Omit --deep-search for bounded credit-free first-party and Bing grounding.
|
|
47
47
|
|
|
48
|
-
# Signals
|
|
48
|
+
# Signals First returns distinct companies with a source-backed signal.
|
|
49
49
|
# It is asynchronous by default; add --wait or resume the returned run ID.
|
|
50
50
|
signaliz signals "companies that just got funded" --limit 100 --sources web,news
|
|
51
51
|
signaliz signals "companies showing signals they need account-signal automation" \
|
|
@@ -53,10 +53,14 @@ signaliz signals "companies showing signals they need account-signal automation"
|
|
|
53
53
|
--limit 100 --sources web,news
|
|
54
54
|
signaliz signals --signal-search-run-id run_... --wait --json
|
|
55
55
|
|
|
56
|
-
# Monitor companies
|
|
57
|
-
|
|
56
|
+
# Monitor companies with the fixed Company Signal evidence engine.
|
|
57
|
+
signaliz awareness create --company-name "Acme" --domain acme.com --schedule daily
|
|
58
|
+
signaliz awareness schedule --monitor-id <uuid> --schedule monthly
|
|
59
|
+
signaliz awareness import --input companies.json --schedule weekly
|
|
58
60
|
signaliz awareness list --limit 100 --offset 0 --json
|
|
59
61
|
signaliz awareness signals --monitor-id <uuid> --limit 100 --offset 0 --json
|
|
62
|
+
signaliz awareness set-output --mode webhook --webhook-url https://hooks.example.com/signaliz
|
|
63
|
+
signaliz awareness export --monitor-id <uuid> --json
|
|
60
64
|
|
|
61
65
|
# Flow starts and resumes through the versioned REST contract.
|
|
62
66
|
signaliz flow --signal-query "companies with recent hiring" \
|
|
@@ -157,7 +161,7 @@ Company Signals. Signal to Copy costs 1 credit per successful result on Free and
|
|
|
157
161
|
Builder, and is unlimited on Team and Agency. `--lookback-days` remains a hard
|
|
158
162
|
evidence-age bound.
|
|
159
163
|
|
|
160
|
-
Signals
|
|
164
|
+
Signals First is a query-first company discovery command rather than a
|
|
161
165
|
row batch. It returns only dated, source-linked signals that contain both a
|
|
162
166
|
company name and company domain. The default request is 100 companies and the
|
|
163
167
|
maximum is 1,000. It is included on Builder, Team, and Agency plans, is resumable with
|
package/dist/bin.js
CHANGED
|
@@ -39,11 +39,19 @@ Six product commands:
|
|
|
39
39
|
signaliz signals "companies that just got funded" [--icp-context "..."] [--limit 100] [--sources web,news] [--after-date YYYY-MM-DD --before-date YYYY-MM-DD] [--wait]
|
|
40
40
|
signaliz signals-first "companies that just got funded" [--limit 100] [--lookback-days 30] [--wait]
|
|
41
41
|
signaliz signals --signal-search-run-id run_... Resume an existing company-attributed signal search
|
|
42
|
-
signaliz awareness create --company-name "Acme" --domain acme.com [--schedule daily
|
|
42
|
+
signaliz awareness create --company-name "Acme" --domain acme.com [--schedule daily|weekly|monthly | --schedule-cron "0 8 * * *"]
|
|
43
|
+
signaliz awareness import --input companies.json [--schedule daily]
|
|
43
44
|
signaliz awareness list [--limit 100] [--offset 0]
|
|
45
|
+
signaliz awareness update --monitor-id <uuid> [--company-name "Acme"] [--schedule weekly] [--webhook-url https://...]
|
|
46
|
+
signaliz awareness schedule --monitor-id <uuid> --schedule monthly
|
|
44
47
|
signaliz awareness run --monitor-id <uuid> --idempotency-key <key>
|
|
45
48
|
signaliz awareness signals [--monitor-id <uuid>]
|
|
46
49
|
signaliz awareness pause|resume|delete --monitor-id <uuid>
|
|
50
|
+
signaliz awareness settings
|
|
51
|
+
signaliz awareness set-output --mode csv|webhook [--webhook-url https://...]
|
|
52
|
+
signaliz awareness test-webhook --webhook-url https://...
|
|
53
|
+
signaliz awareness export [--monitor-id <uuid>] --json
|
|
54
|
+
signaliz awareness send-export --input signals.jsonl
|
|
47
55
|
signaliz flow --signal-query "companies with recent hiring" --campaign-offer "..." [--limit 5] [--lookback-days 90] [--people-titles "CEO,VP Sales"]
|
|
48
56
|
signaliz flow --run-id run_... Read a durable Flow checkpoint without dispatching new work
|
|
49
57
|
|
|
@@ -76,7 +84,7 @@ Common flags:
|
|
|
76
84
|
--event-id <sha256> Pin one canonical signal event in Signal to Copy
|
|
77
85
|
--dry-run Return a no-spend plan without provider calls, jobs, or writes
|
|
78
86
|
|
|
79
|
-
Company Signals accepts only --domain. Signaliz checks its cache, runs one type-agnostic Parallel Advanced search plus at most one first-party hub Extract, and returns the newest distinct events that pass its deterministic date, source, company, evidence, and duplicate gates. For a durable batch larger than 25 rows, provide domain-only rows with --no-wait and resume with --job-id. Signal to Copy canonical references remain separate. Signals
|
|
87
|
+
Company Signals accepts only --domain. Signaliz checks its cache, runs one type-agnostic Parallel Advanced search plus at most one first-party hub Extract, and returns the newest distinct events that pass its deterministic date, source, company, evidence, and duplicate gates. For a durable batch larger than 25 rows, provide domain-only rows with --no-wait and resume with --job-id. Signal to Copy canonical references remain separate. Signals First is asynchronous by default; use --wait to poll until it completes.
|
|
80
88
|
`;
|
|
81
89
|
function loadConfig() {
|
|
82
90
|
if (!(0, import_node_fs.existsSync)(CONFIG_FILE)) return {};
|
|
@@ -427,6 +435,15 @@ function customerEmailBillingMetadata(value) {
|
|
|
427
435
|
function customerEmailResult(value, kind) {
|
|
428
436
|
const result = record(value);
|
|
429
437
|
const raw = record(result.raw);
|
|
438
|
+
if (kind === "verify") {
|
|
439
|
+
return {
|
|
440
|
+
email: typeof result.email === "string" ? result.email : typeof raw.email === "string" ? raw.email : null,
|
|
441
|
+
status: result.status || raw.status || "completed",
|
|
442
|
+
is_catch_all: result.isCatchAll === true || raw.is_catch_all === true || raw.email_is_catch_all === true,
|
|
443
|
+
credits_charged: safeNonNegativeNumber(result.creditsCharged ?? raw.credits_charged) ?? 0,
|
|
444
|
+
ok_to_send: result.okToSend === true || raw.ok_to_send === true
|
|
445
|
+
};
|
|
446
|
+
}
|
|
430
447
|
if (String(result.status || "").toLowerCase() === "processing") {
|
|
431
448
|
const verificationRunId2 = result.verificationRunId ?? raw.verification_run_id;
|
|
432
449
|
const runId2 = result.runId ?? raw.run_id ?? verificationRunId2;
|
|
@@ -459,6 +476,7 @@ function customerEmailResult(value, kind) {
|
|
|
459
476
|
const creditsCharged = Number(result.creditsCharged ?? raw.credits_charged ?? creditsUsed);
|
|
460
477
|
const base = {
|
|
461
478
|
email: typeof result.email === "string" && result.email.trim() ? result.email.trim() : null,
|
|
479
|
+
...typeof result.checkedEmail === "string" || typeof raw.checked_email === "string" ? { checked_email: result.checkedEmail ?? raw.checked_email } : {},
|
|
462
480
|
status: "completed",
|
|
463
481
|
success: result.success === true,
|
|
464
482
|
is_valid: typeof result.isValid === "boolean" ? result.isValid : typeof raw.is_valid === "boolean" ? raw.is_valid : result.isVerified ?? false,
|
|
@@ -519,6 +537,15 @@ function customerEmailResult(value, kind) {
|
|
|
519
537
|
email_is_catch_all: isCatchAll2,
|
|
520
538
|
is_catch_all: isCatchAll2,
|
|
521
539
|
verification_source: result.verificationSource ?? raw.verification_source ?? result.providerUsed ?? "email_finder",
|
|
540
|
+
...typeof raw.candidate_source === "string" ? { candidate_source: raw.candidate_source } : {},
|
|
541
|
+
...typeof raw.primary_verifier === "string" ? { primary_verifier: raw.primary_verifier } : {},
|
|
542
|
+
...typeof raw.primary_verdict === "string" ? { primary_verdict: raw.primary_verdict } : {},
|
|
543
|
+
...typeof raw.terminal_verifier === "string" ? { terminal_verifier: raw.terminal_verifier } : {},
|
|
544
|
+
...typeof raw.terminal_verdict === "string" ? { terminal_verdict: raw.terminal_verdict } : {},
|
|
545
|
+
...typeof raw.terminal_result === "string" ? { terminal_result: raw.terminal_result } : {},
|
|
546
|
+
...typeof raw.terminal_is_catch_all === "boolean" ? { terminal_is_catch_all: raw.terminal_is_catch_all } : {},
|
|
547
|
+
...typeof raw.terminal_is_accept_all === "boolean" ? { terminal_is_accept_all: raw.terminal_is_accept_all } : {},
|
|
548
|
+
...typeof raw.bounceban_id === "string" ? { bounceban_id: raw.bounceban_id } : {},
|
|
522
549
|
...result.verificationObservedAt ?? raw.verification_observed_at ? { verification_observed_at: result.verificationObservedAt ?? raw.verification_observed_at } : {},
|
|
523
550
|
failure_reason: result.failureReason ?? raw.failure_reason ?? (verifiedForSending2 ? "none" : "no_verified_email_found"),
|
|
524
551
|
billing_replayed: typeof raw.billing_replayed === "boolean" ? raw.billing_replayed : result.billingReplayed === true,
|
|
@@ -594,6 +621,15 @@ function customerEmailResult(value, kind) {
|
|
|
594
621
|
smtp_status: result.smtpStatus ?? raw.smtp_status ?? (isCatchAll ? "accept_all" : verifiedForSending ? "accepted" : "not_checked"),
|
|
595
622
|
provider_status: result.providerStatus ?? raw.provider_status ?? verificationStatus,
|
|
596
623
|
verification_source: result.verificationSource ?? raw.verification_source ?? "email_verification",
|
|
624
|
+
...typeof raw.checked_email === "string" ? { checked_email: raw.checked_email } : {},
|
|
625
|
+
...typeof raw.primary_verifier === "string" ? { primary_verifier: raw.primary_verifier } : {},
|
|
626
|
+
...typeof raw.primary_verdict === "string" ? { primary_verdict: raw.primary_verdict } : {},
|
|
627
|
+
...typeof raw.terminal_verifier === "string" ? { terminal_verifier: raw.terminal_verifier } : {},
|
|
628
|
+
...typeof raw.terminal_verdict === "string" ? { terminal_verdict: raw.terminal_verdict } : {},
|
|
629
|
+
...typeof raw.terminal_result === "string" ? { terminal_result: raw.terminal_result } : {},
|
|
630
|
+
...typeof raw.terminal_is_catch_all === "boolean" ? { terminal_is_catch_all: raw.terminal_is_catch_all } : {},
|
|
631
|
+
...typeof raw.terminal_is_accept_all === "boolean" ? { terminal_is_accept_all: raw.terminal_is_accept_all } : {},
|
|
632
|
+
...typeof raw.bounceban_id === "string" ? { bounceban_id: raw.bounceban_id } : {},
|
|
597
633
|
...result.verificationObservedAt ?? raw.verification_observed_at ? { verification_observed_at: result.verificationObservedAt ?? raw.verification_observed_at } : {},
|
|
598
634
|
failure_reason: result.failureReason ?? raw.failure_reason ?? (verifiedForSending ? "none" : isCatchAll ? "catch_all_domain_not_send_safe" : "verification_not_send_safe"),
|
|
599
635
|
billing_replayed: typeof raw.billing_replayed === "boolean" ? raw.billing_replayed : result.billingReplayed === true,
|
|
@@ -693,7 +729,7 @@ function customerCompanySignalBatch(value) {
|
|
|
693
729
|
function customerSignalAwarenessResult(value) {
|
|
694
730
|
const result = record(value);
|
|
695
731
|
const { raw: _raw, signals: _signals, ...publicResult } = result;
|
|
696
|
-
const signals2 = Array.isArray(result.signals) ?
|
|
732
|
+
const signals2 = Array.isArray(result.signals) ? publicSignalRows(result.signals) : void 0;
|
|
697
733
|
return {
|
|
698
734
|
...publicResult,
|
|
699
735
|
...signals2 ? { signals: signals2 } : {}
|
|
@@ -824,7 +860,7 @@ function publicSignalDiscoveryFailure(value) {
|
|
|
824
860
|
if (requestedCode === "IDEMPOTENCY_CONFLICT") {
|
|
825
861
|
return {
|
|
826
862
|
errorCode: requestedCode,
|
|
827
|
-
error: "This recovery key belongs to a different Signals
|
|
863
|
+
error: "This recovery key belongs to a different Signals First request."
|
|
828
864
|
};
|
|
829
865
|
}
|
|
830
866
|
if (requestedCode === "PERSISTENCE_UNAVAILABLE") {
|
|
@@ -835,7 +871,7 @@ function publicSignalDiscoveryFailure(value) {
|
|
|
835
871
|
}
|
|
836
872
|
return {
|
|
837
873
|
errorCode: "SOURCE_UNAVAILABLE",
|
|
838
|
-
error: "Signals
|
|
874
|
+
error: "Signals First could not complete this search."
|
|
839
875
|
};
|
|
840
876
|
}
|
|
841
877
|
function hasFindEmailLinkedInIdentity(value) {
|
|
@@ -1264,19 +1300,11 @@ async function verifyEmail(args) {
|
|
|
1264
1300
|
`);
|
|
1265
1301
|
process.stdout.write(`Status: ${publicResult.status}
|
|
1266
1302
|
`);
|
|
1267
|
-
process.stdout.write(`
|
|
1268
|
-
`);
|
|
1269
|
-
process.stdout.write(`Valid: ${publicResult.is_valid}
|
|
1270
|
-
`);
|
|
1271
|
-
process.stdout.write(`Verdict: ${publicResult.verification_status}
|
|
1272
|
-
`);
|
|
1273
|
-
process.stdout.write(`Recommendation: ${publicResult.recommendation}
|
|
1303
|
+
process.stdout.write(`Catch-all: ${publicResult.is_catch_all}
|
|
1274
1304
|
`);
|
|
1275
|
-
process.stdout.write(`
|
|
1305
|
+
process.stdout.write(`Credits charged: ${publicResult.credits_charged}
|
|
1276
1306
|
`);
|
|
1277
|
-
|
|
1278
|
-
`);
|
|
1279
|
-
process.stdout.write(`Credits used: ${publicResult.credits_used}
|
|
1307
|
+
process.stdout.write(`OK to send: ${publicResult.ok_to_send ? "Yes" : "No"}
|
|
1280
1308
|
`);
|
|
1281
1309
|
});
|
|
1282
1310
|
}
|
|
@@ -1458,7 +1486,7 @@ function sleep(milliseconds) {
|
|
|
1458
1486
|
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
1459
1487
|
}
|
|
1460
1488
|
async function signals(args) {
|
|
1461
|
-
if (flag("input")) fail("Signals
|
|
1489
|
+
if (flag("input")) fail("Signals First accepts one natural-language query at a time; do not pass --input.");
|
|
1462
1490
|
const signalSearchRunId = flag("signal-search-run-id");
|
|
1463
1491
|
const query = signalQueryFromArgs(args);
|
|
1464
1492
|
if (!query && !signalSearchRunId) {
|
|
@@ -1500,12 +1528,12 @@ async function signals(args) {
|
|
|
1500
1528
|
}
|
|
1501
1529
|
output(result, () => {
|
|
1502
1530
|
if (result.status === "planned") {
|
|
1503
|
-
process.stdout.write(`Signals
|
|
1531
|
+
process.stdout.write(`Signals First plan: ${result.requestedCount} distinct companies. No source acquisition was launched. Included on plan; 0 Signaliz credits charged.
|
|
1504
1532
|
`);
|
|
1505
1533
|
return;
|
|
1506
1534
|
}
|
|
1507
1535
|
if (signalDiscoveryIsPending(result.status)) {
|
|
1508
|
-
process.stdout.write(`Signals
|
|
1536
|
+
process.stdout.write(`Signals First ${result.status}: ${result.signalSearchRunId}
|
|
1509
1537
|
`);
|
|
1510
1538
|
process.stdout.write(`Billing: included on plan \xB7 ${result.creditsCharged} Signaliz credits charged.
|
|
1511
1539
|
`);
|
|
@@ -1514,7 +1542,7 @@ async function signals(args) {
|
|
|
1514
1542
|
return;
|
|
1515
1543
|
}
|
|
1516
1544
|
if (!result.success || result.status === "failed") {
|
|
1517
|
-
process.stdout.write(`${result.error || "Signals
|
|
1545
|
+
process.stdout.write(`${result.error || "Signals First failed."}
|
|
1518
1546
|
`);
|
|
1519
1547
|
return;
|
|
1520
1548
|
}
|
|
@@ -1840,18 +1868,36 @@ function awarenessSchedule() {
|
|
|
1840
1868
|
every_6_hours: "0 */6 * * *",
|
|
1841
1869
|
daily: "0 8 * * *",
|
|
1842
1870
|
every_2_days: "0 8 */2 * *",
|
|
1843
|
-
weekly: "0 8 * * 1"
|
|
1871
|
+
weekly: "0 8 * * 1",
|
|
1872
|
+
monthly: "0 8 1 * *"
|
|
1844
1873
|
};
|
|
1845
1874
|
if (!schedules[schedule]) {
|
|
1846
|
-
throw new CliInputError("--schedule must be every_6_hours, daily, every_2_days, or
|
|
1875
|
+
throw new CliInputError("--schedule must be every_6_hours, daily, every_2_days, weekly, or monthly");
|
|
1847
1876
|
}
|
|
1848
1877
|
return schedules[schedule];
|
|
1849
1878
|
}
|
|
1850
1879
|
async function awareness(args) {
|
|
1851
1880
|
const action = args[0];
|
|
1852
1881
|
const monitorId = flag("monitor-id");
|
|
1853
|
-
|
|
1854
|
-
|
|
1882
|
+
const actions = [
|
|
1883
|
+
"create",
|
|
1884
|
+
"import",
|
|
1885
|
+
"list",
|
|
1886
|
+
"update",
|
|
1887
|
+
"schedule",
|
|
1888
|
+
"run",
|
|
1889
|
+
"signals",
|
|
1890
|
+
"pause",
|
|
1891
|
+
"resume",
|
|
1892
|
+
"delete",
|
|
1893
|
+
"settings",
|
|
1894
|
+
"set-output",
|
|
1895
|
+
"test-webhook",
|
|
1896
|
+
"export",
|
|
1897
|
+
"send-export"
|
|
1898
|
+
];
|
|
1899
|
+
if (!action || !actions.includes(action)) {
|
|
1900
|
+
throw new CliInputError(`Usage: signaliz awareness <${actions.join("|")}>`);
|
|
1855
1901
|
}
|
|
1856
1902
|
const client = createClient();
|
|
1857
1903
|
if (action === "create") {
|
|
@@ -1860,32 +1906,42 @@ async function awareness(args) {
|
|
|
1860
1906
|
if (!companyName || !domain) {
|
|
1861
1907
|
throw new CliInputError('Usage: signaliz awareness create --company-name "Acme" --domain acme.com');
|
|
1862
1908
|
}
|
|
1863
|
-
const monthlyCreditCap = numberFlag("monthly-credit-cap");
|
|
1864
|
-
if (monthlyCreditCap !== void 0) requireIntegerInRange(monthlyCreditCap, "--monthly-credit-cap", 1, 1e4);
|
|
1865
|
-
const lookbackDays = numberFlag("lookback-days");
|
|
1866
|
-
if (lookbackDays !== void 0) requireIntegerInRange(lookbackDays, "--lookback-days", 1, 365);
|
|
1867
|
-
const signalTypes = csvFlag("signal-types");
|
|
1868
1909
|
const result2 = await client.createSignalMonitor({
|
|
1869
1910
|
companyName,
|
|
1870
1911
|
domain,
|
|
1871
|
-
template: flag("template") === "basic" ? "basic" : "full_intelligence",
|
|
1872
1912
|
scheduleCron: awarenessSchedule(),
|
|
1873
|
-
|
|
1874
|
-
webhookUrl: flag("webhook-url"),
|
|
1875
|
-
signalConfig: {
|
|
1876
|
-
...lookbackDays !== void 0 ? { lookback_days: lookbackDays } : {},
|
|
1877
|
-
...signalTypes ? { signal_types: signalTypes } : {},
|
|
1878
|
-
...flag("research-prompt") ? { research_prompt: flag("research-prompt") } : {}
|
|
1879
|
-
}
|
|
1913
|
+
webhookUrl: flag("webhook-url")
|
|
1880
1914
|
});
|
|
1881
1915
|
output(result2, () => process.stdout.write(`Monitor created: ${String(result2.monitor?.id || "pending")}
|
|
1916
|
+
`));
|
|
1917
|
+
return;
|
|
1918
|
+
}
|
|
1919
|
+
if (action === "import") {
|
|
1920
|
+
const rows = readBatchInput();
|
|
1921
|
+
if (!rows) throw new CliInputError("signaliz awareness import requires --input <json-or-jsonl-file>");
|
|
1922
|
+
if (rows.length > 500) throw new CliInputError(`Signal Awareness imports at most 500 companies; received ${rows.length}`);
|
|
1923
|
+
const monitors = rows.map((value, index) => {
|
|
1924
|
+
const row = record(value);
|
|
1925
|
+
const companyName = stringValue(row.company_name ?? row.companyName ?? row.company ?? row.name);
|
|
1926
|
+
const domain = stringValue(row.domain ?? row.website);
|
|
1927
|
+
if (!companyName || !domain) throw new CliInputError(`Awareness import row ${index + 1} requires company_name and domain`);
|
|
1928
|
+
return { companyName, domain };
|
|
1929
|
+
});
|
|
1930
|
+
const result2 = await client.bulkCreateSignalMonitors(monitors, {
|
|
1931
|
+
scheduleCron: awarenessSchedule(),
|
|
1932
|
+
webhookUrl: flag("webhook-url")
|
|
1933
|
+
});
|
|
1934
|
+
output(result2, () => process.stdout.write(`Created: ${result2.created || 0}
|
|
1935
|
+
Skipped: ${result2.skipped || 0}
|
|
1882
1936
|
`));
|
|
1883
1937
|
return;
|
|
1884
1938
|
}
|
|
1885
1939
|
if (action === "list") {
|
|
1886
1940
|
const offset = numberFlag("offset");
|
|
1941
|
+
const limit = numberFlag("limit");
|
|
1942
|
+
if (limit !== void 0) requireIntegerInRange(limit, "--limit", 1, 500);
|
|
1887
1943
|
if (offset !== void 0) requireIntegerInRange(offset, "--offset", 0, 1e4);
|
|
1888
|
-
const result2 = await client.listSignalMonitors(
|
|
1944
|
+
const result2 = await client.listSignalMonitors(limit, offset);
|
|
1889
1945
|
output(result2, () => {
|
|
1890
1946
|
for (const monitor of result2.monitors || []) {
|
|
1891
1947
|
process.stdout.write(`${String(monitor.company_name)} ${String(monitor.status)} ${String(monitor.next_run_at || "not scheduled")} ${String(monitor.id)}
|
|
@@ -1896,13 +1952,10 @@ async function awareness(args) {
|
|
|
1896
1952
|
}
|
|
1897
1953
|
if (action === "signals") {
|
|
1898
1954
|
const offset = numberFlag("offset");
|
|
1955
|
+
const limit = numberFlag("limit");
|
|
1956
|
+
if (limit !== void 0) requireIntegerInRange(limit, "--limit", 1, 500);
|
|
1899
1957
|
if (offset !== void 0) requireIntegerInRange(offset, "--offset", 0, 1e4);
|
|
1900
|
-
const result2 = customerSignalAwarenessResult(await client.
|
|
1901
|
-
action: "list_signals",
|
|
1902
|
-
monitorId,
|
|
1903
|
-
limit: numberFlag("limit"),
|
|
1904
|
-
offset
|
|
1905
|
-
}));
|
|
1958
|
+
const result2 = customerSignalAwarenessResult(await client.listSignalAwarenessSignals(monitorId, limit, offset));
|
|
1906
1959
|
output(result2, () => {
|
|
1907
1960
|
for (const signal of result2.signals || []) {
|
|
1908
1961
|
process.stdout.write(`${signal.signal_type} ${signal.signal_title} ${signal.signal_summary} ${signal.source} ${signal.date} ${signal.company_name} ${signal.domain}
|
|
@@ -1911,7 +1964,64 @@ async function awareness(args) {
|
|
|
1911
1964
|
});
|
|
1912
1965
|
return;
|
|
1913
1966
|
}
|
|
1967
|
+
if (action === "settings") {
|
|
1968
|
+
const result2 = await client.getSignalAwarenessSettings();
|
|
1969
|
+
output(result2, () => process.stdout.write(`Output: ${result2.outputMode || "csv"}
|
|
1970
|
+
Webhook: ${result2.webhookUrl || "not configured"}
|
|
1971
|
+
`));
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
if (action === "set-output") {
|
|
1975
|
+
const mode = flag("mode");
|
|
1976
|
+
if (mode !== "csv" && mode !== "webhook") throw new CliInputError("signaliz awareness set-output requires --mode csv|webhook");
|
|
1977
|
+
const webhookUrl = flag("webhook-url");
|
|
1978
|
+
if (mode === "webhook" && !webhookUrl) throw new CliInputError("--webhook-url is required when --mode webhook");
|
|
1979
|
+
const result2 = await client.setSignalAwarenessOutput(mode, webhookUrl);
|
|
1980
|
+
output(result2, () => process.stdout.write(`Signal Awareness output set to ${mode}
|
|
1981
|
+
`));
|
|
1982
|
+
return;
|
|
1983
|
+
}
|
|
1984
|
+
if (action === "test-webhook") {
|
|
1985
|
+
const webhookUrl = flag("webhook-url");
|
|
1986
|
+
if (!webhookUrl) throw new CliInputError("signaliz awareness test-webhook requires --webhook-url https://...");
|
|
1987
|
+
const result2 = await client.testSignalAwarenessWebhook(webhookUrl);
|
|
1988
|
+
output(result2, () => process.stdout.write(`Webhook returned HTTP ${result2.webhookStatus || "unknown"}
|
|
1989
|
+
`));
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1992
|
+
if (action === "export") {
|
|
1993
|
+
const result2 = customerSignalAwarenessResult(await client.exportSignalAwareness(monitorId));
|
|
1994
|
+
output(result2, () => process.stdout.write(`Companies: ${result2.monitors?.length || 0}
|
|
1995
|
+
Signals: ${result2.signals?.length || 0}
|
|
1996
|
+
`));
|
|
1997
|
+
return;
|
|
1998
|
+
}
|
|
1999
|
+
if (action === "send-export") {
|
|
2000
|
+
const rows = readBatchInput();
|
|
2001
|
+
if (!rows) throw new CliInputError("signaliz awareness send-export requires --input <json-or-jsonl-file>");
|
|
2002
|
+
if (rows.length > 2e3) throw new CliInputError(`Signal Awareness sends at most 2,000 signals per call; received ${rows.length}`);
|
|
2003
|
+
const signals2 = publicSignalRows(rows);
|
|
2004
|
+
if (signals2.length !== rows.length) throw new CliInputError("Every send-export row must contain signal_type, source, date, company_name, and domain");
|
|
2005
|
+
const result2 = await client.sendSignalAwarenessExport(signals2);
|
|
2006
|
+
output(result2, () => process.stdout.write(`Delivered: ${result2.delivered || 0}
|
|
2007
|
+
Webhook: HTTP ${result2.webhookStatus || "unknown"}
|
|
2008
|
+
`));
|
|
2009
|
+
return;
|
|
2010
|
+
}
|
|
1914
2011
|
if (!monitorId) throw new CliInputError(`signaliz awareness ${action} requires --monitor-id <uuid>`);
|
|
2012
|
+
if (action === "update" || action === "schedule") {
|
|
2013
|
+
const scheduleCron = awarenessSchedule();
|
|
2014
|
+
const companyName = flag("company-name");
|
|
2015
|
+
const webhookUrl = hasFlag("clear-webhook") ? null : flag("webhook-url");
|
|
2016
|
+
if (action === "schedule" && !scheduleCron) throw new CliInputError("signaliz awareness schedule requires --schedule or --schedule-cron");
|
|
2017
|
+
if (!companyName && !scheduleCron && webhookUrl === void 0) {
|
|
2018
|
+
throw new CliInputError("signaliz awareness update requires --company-name, --schedule/--schedule-cron, --webhook-url, or --clear-webhook");
|
|
2019
|
+
}
|
|
2020
|
+
const result2 = await client.updateSignalMonitor(monitorId, { companyName, scheduleCron, webhookUrl });
|
|
2021
|
+
output(result2, () => process.stdout.write(`Monitor updated: ${monitorId}
|
|
2022
|
+
`));
|
|
2023
|
+
return;
|
|
2024
|
+
}
|
|
1915
2025
|
if (action === "run") {
|
|
1916
2026
|
if (hasFlag("dry-run")) {
|
|
1917
2027
|
const result3 = await client.signalAwareness({ action: "manual_run", monitorId, idempotencyKey: flag("idempotency-key"), dryRun: true });
|
|
@@ -1927,9 +2037,7 @@ Credits used: ${result2.creditsUsed || 0}
|
|
|
1927
2037
|
});
|
|
1928
2038
|
return;
|
|
1929
2039
|
}
|
|
1930
|
-
const result = await client.
|
|
1931
|
-
action === "delete" ? { action: "delete", monitorId } : { action: "update", monitorId, updates: { status: action === "resume" ? "active" : "paused", ...action === "resume" ? { auto_paused: false, auto_pause_reason: null } : {} } }
|
|
1932
|
-
);
|
|
2040
|
+
const result = action === "delete" ? await client.deleteSignalMonitor(monitorId) : action === "resume" ? await client.resumeSignalMonitor(monitorId) : await client.pauseSignalMonitor(monitorId);
|
|
1933
2041
|
output(result, () => process.stdout.write(`Monitor ${action === "delete" ? "deleted" : action === "resume" ? "resumed" : "paused"}: ${monitorId}
|
|
1934
2042
|
`));
|
|
1935
2043
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signaliz/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.68",
|
|
4
4
|
"description": "Signaliz CLI for Company Signal Enrichment, Signals First, Signal Awareness, Signal to Copy AI, and Signaliz Flow.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"signaliz": "dist/bin.js"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"node": ">=18"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@signaliz/sdk": "^1.0.
|
|
32
|
+
"@signaliz/sdk": "^1.0.72"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"tsup": "^8.0.0",
|