@signaliz/sdk 1.0.70 → 1.0.72
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 -3
- package/dist/{chunk-WEQLL67T.mjs → chunk-MFXKZU6K.mjs} +107 -18
- package/dist/index.d.mts +47 -5
- package/dist/index.d.ts +47 -5
- package/dist/index.js +107 -18
- package/dist/index.mjs +1 -1
- package/dist/mcp-config.js +107 -18
- package/dist/mcp-config.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -113,10 +113,13 @@ const copyFromSignalRun = await signaliz.signalToCopy({
|
|
|
113
113
|
});
|
|
114
114
|
// The copy result reuses the completed snapshot without rediscovery.
|
|
115
115
|
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
const monitor = await signaliz.createSignalMonitor({
|
|
117
|
+
companyName: 'Acme',
|
|
118
|
+
domain: 'acme.com',
|
|
119
|
+
schedule: 'daily',
|
|
119
120
|
});
|
|
121
|
+
await signaliz.updateSignalMonitor(monitor.monitor?.id!, { schedule: 'weekly' });
|
|
122
|
+
const awareness = await signaliz.listSignalAwarenessSignals(monitor.monitor?.id);
|
|
120
123
|
console.log(
|
|
121
124
|
awareness.signals?.[0].signal_type,
|
|
122
125
|
awareness.signals?.[0].source,
|
|
@@ -124,6 +127,8 @@ console.log(
|
|
|
124
127
|
awareness.signals?.[0].company_name,
|
|
125
128
|
awareness.signals?.[0].domain,
|
|
126
129
|
);
|
|
130
|
+
// Awareness runs the same fixed, type-agnostic evidence engine as Company
|
|
131
|
+
// Signal Enrichment. Use scheduleCron for an exact UTC schedule.
|
|
127
132
|
|
|
128
133
|
// Flow uses the same versioned REST gateway as every other SDK capability.
|
|
129
134
|
const flow = await signaliz.startFlow({
|
|
@@ -648,25 +648,29 @@ function firstValid(values, normalize) {
|
|
|
648
648
|
}
|
|
649
649
|
return "";
|
|
650
650
|
}
|
|
651
|
+
function publicSignalSummary(value, title) {
|
|
652
|
+
return /^(?:read more|read post|keep reading|learn more|api|\.{3})$/i.test(value) ? title : value;
|
|
653
|
+
}
|
|
651
654
|
function publicSignalRow(value, fallbackCompany) {
|
|
652
655
|
const signal = recordValue(value);
|
|
653
656
|
const raw = recordValue(signal.raw_data);
|
|
654
657
|
const company = recordValue(signal.company);
|
|
655
658
|
const rawCompany = recordValue(raw.company);
|
|
656
659
|
const fallback = recordValue(fallbackCompany);
|
|
660
|
+
const signalTitle = firstValid([
|
|
661
|
+
signal.signal_title,
|
|
662
|
+
raw.signal_title,
|
|
663
|
+
signal.title,
|
|
664
|
+
raw.title,
|
|
665
|
+
signal.headline,
|
|
666
|
+
raw.headline,
|
|
667
|
+
signal.name,
|
|
668
|
+
raw.name
|
|
669
|
+
], text);
|
|
657
670
|
const row = {
|
|
658
671
|
signal_type: signalType(signal),
|
|
659
|
-
signal_title:
|
|
660
|
-
|
|
661
|
-
raw.signal_title,
|
|
662
|
-
signal.title,
|
|
663
|
-
raw.title,
|
|
664
|
-
signal.headline,
|
|
665
|
-
raw.headline,
|
|
666
|
-
signal.name,
|
|
667
|
-
raw.name
|
|
668
|
-
], text),
|
|
669
|
-
signal_summary: firstValid([
|
|
672
|
+
signal_title: signalTitle,
|
|
673
|
+
signal_summary: publicSignalSummary(firstValid([
|
|
670
674
|
signal.signal_summary,
|
|
671
675
|
raw.signal_summary,
|
|
672
676
|
signal.summary,
|
|
@@ -677,7 +681,7 @@ function publicSignalRow(value, fallbackCompany) {
|
|
|
677
681
|
raw.content,
|
|
678
682
|
signal.description,
|
|
679
683
|
raw.description
|
|
680
|
-
], text),
|
|
684
|
+
], text), signalTitle),
|
|
681
685
|
source: firstValid([
|
|
682
686
|
signal.canonical_source_url,
|
|
683
687
|
signal.source_url,
|
|
@@ -818,6 +822,43 @@ var Signaliz = class {
|
|
|
818
822
|
async runSignalMonitor(monitorId, idempotencyKey) {
|
|
819
823
|
return this.signalAwareness({ action: "manual_run", monitorId, idempotencyKey });
|
|
820
824
|
}
|
|
825
|
+
async updateSignalMonitor(monitorId, updates) {
|
|
826
|
+
return this.signalAwareness({ action: "update", monitorId, updates });
|
|
827
|
+
}
|
|
828
|
+
async pauseSignalMonitor(monitorId) {
|
|
829
|
+
return this.updateSignalMonitor(monitorId, { status: "paused" });
|
|
830
|
+
}
|
|
831
|
+
async resumeSignalMonitor(monitorId) {
|
|
832
|
+
return this.updateSignalMonitor(monitorId, { status: "active" });
|
|
833
|
+
}
|
|
834
|
+
async deleteSignalMonitor(monitorId) {
|
|
835
|
+
return this.signalAwareness({ action: "delete", monitorId });
|
|
836
|
+
}
|
|
837
|
+
async listSignalAwarenessSignals(monitorId, limit, offset) {
|
|
838
|
+
return this.signalAwareness({ action: "list_signals", monitorId, limit, offset });
|
|
839
|
+
}
|
|
840
|
+
async bulkCreateSignalMonitors(monitors, defaults) {
|
|
841
|
+
return this.signalAwareness({ action: "bulk_import", monitors, defaults });
|
|
842
|
+
}
|
|
843
|
+
async getSignalAwarenessSettings() {
|
|
844
|
+
return this.signalAwareness({ action: "get_settings" });
|
|
845
|
+
}
|
|
846
|
+
async setSignalAwarenessOutput(outputMode, webhookUrl) {
|
|
847
|
+
return this.signalAwareness({
|
|
848
|
+
action: "set_global_webhook",
|
|
849
|
+
enabled: outputMode === "webhook",
|
|
850
|
+
webhookUrl: outputMode === "webhook" ? webhookUrl : null
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
async testSignalAwarenessWebhook(webhookUrl) {
|
|
854
|
+
return this.signalAwareness({ action: "test_webhook", webhookUrl });
|
|
855
|
+
}
|
|
856
|
+
async exportSignalAwareness(monitorId) {
|
|
857
|
+
return this.signalAwareness({ action: "export", monitorId });
|
|
858
|
+
}
|
|
859
|
+
async sendSignalAwarenessExport(signals) {
|
|
860
|
+
return this.signalAwareness({ action: "send_signal_export", signals });
|
|
861
|
+
}
|
|
821
862
|
async findEmail(params) {
|
|
822
863
|
const request = findEmailRequestBody(params);
|
|
823
864
|
assertFindEmailRequestIdentity(request);
|
|
@@ -2607,24 +2648,50 @@ function normalizeSignalToCopyResult(data) {
|
|
|
2607
2648
|
raw: data
|
|
2608
2649
|
};
|
|
2609
2650
|
}
|
|
2651
|
+
var SIGNAL_AWARENESS_SCHEDULES = {
|
|
2652
|
+
every_6_hours: "0 */6 * * *",
|
|
2653
|
+
daily: "0 8 * * *",
|
|
2654
|
+
every_2_days: "0 8 */2 * *",
|
|
2655
|
+
weekly: "0 8 * * 1",
|
|
2656
|
+
monthly: "0 8 1 * *"
|
|
2657
|
+
};
|
|
2658
|
+
function signalAwarenessScheduleCron(value) {
|
|
2659
|
+
return value.scheduleCron || (value.schedule ? SIGNAL_AWARENESS_SCHEDULES[value.schedule] : void 0);
|
|
2660
|
+
}
|
|
2610
2661
|
function signalAwarenessMonitorRequest(monitor) {
|
|
2611
2662
|
return compact({
|
|
2612
2663
|
company_name: monitor.companyName,
|
|
2613
2664
|
domain: monitor.domain,
|
|
2614
|
-
|
|
2615
|
-
signal_config: monitor.signalConfig,
|
|
2616
|
-
schedule_cron: monitor.scheduleCron,
|
|
2665
|
+
schedule_cron: signalAwarenessScheduleCron(monitor),
|
|
2617
2666
|
webhook_url: monitor.webhookUrl
|
|
2618
2667
|
});
|
|
2619
2668
|
}
|
|
2669
|
+
function signalAwarenessMonitorDefaultsRequest(defaults) {
|
|
2670
|
+
return compact({
|
|
2671
|
+
schedule_cron: signalAwarenessScheduleCron(defaults),
|
|
2672
|
+
webhook_url: defaults.webhookUrl
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
function signalAwarenessMonitorUpdateRequest(updates) {
|
|
2676
|
+
return compact({
|
|
2677
|
+
company_name: updates.companyName,
|
|
2678
|
+
schedule_cron: signalAwarenessScheduleCron(updates),
|
|
2679
|
+
status: updates.status,
|
|
2680
|
+
webhook_url: updates.webhookUrl
|
|
2681
|
+
});
|
|
2682
|
+
}
|
|
2620
2683
|
function signalAwarenessRequestBody(request) {
|
|
2621
2684
|
return compact({
|
|
2622
2685
|
action: request.action,
|
|
2623
2686
|
monitor_id: request.monitorId,
|
|
2624
2687
|
monitor: request.monitor ? signalAwarenessMonitorRequest(request.monitor) : void 0,
|
|
2625
2688
|
monitors: request.monitors?.map(signalAwarenessMonitorRequest),
|
|
2626
|
-
defaults: request.defaults,
|
|
2627
|
-
updates: request.updates,
|
|
2689
|
+
defaults: request.defaults ? signalAwarenessMonitorDefaultsRequest(request.defaults) : void 0,
|
|
2690
|
+
updates: request.updates ? signalAwarenessMonitorUpdateRequest(request.updates) : void 0,
|
|
2691
|
+
enabled: request.enabled,
|
|
2692
|
+
webhook_url: request.webhookUrl,
|
|
2693
|
+
signal_ids: request.signalIds,
|
|
2694
|
+
signals: request.signals,
|
|
2628
2695
|
limit: request.limit,
|
|
2629
2696
|
offset: request.offset,
|
|
2630
2697
|
idempotency_key: request.idempotencyKey,
|
|
@@ -2633,7 +2700,7 @@ function signalAwarenessRequestBody(request) {
|
|
|
2633
2700
|
}
|
|
2634
2701
|
function normalizeSignalAwarenessResponse(data) {
|
|
2635
2702
|
const payload = data.data && typeof data.data === "object" ? data.data : data;
|
|
2636
|
-
const signals = Array.isArray(payload.signals) ?
|
|
2703
|
+
const signals = Array.isArray(payload.signals) ? payload.signals.flatMap(normalizeSignalAwarenessSignal) : void 0;
|
|
2637
2704
|
const monitors = Array.isArray(payload.monitors) ? payload.monitors.map(normalizeSignalAwarenessMonitor).filter((value) => value !== void 0) : void 0;
|
|
2638
2705
|
const monitor = normalizeSignalAwarenessMonitor(payload.monitor);
|
|
2639
2706
|
const run = normalizeSignalAwarenessRun(payload.run);
|
|
@@ -2651,6 +2718,18 @@ function normalizeSignalAwarenessResponse(data) {
|
|
|
2651
2718
|
...Number.isInteger(creditsUsed) && creditsUsed >= 0 ? { creditsUsed } : {},
|
|
2652
2719
|
...Number.isFinite(Number(payload.created)) ? { created: Number(payload.created) } : {},
|
|
2653
2720
|
...Number.isFinite(Number(payload.skipped)) ? { skipped: Number(payload.skipped) } : {},
|
|
2721
|
+
...Number.isFinite(Number(payload.delivered)) ? { delivered: Number(payload.delivered) } : {},
|
|
2722
|
+
...Array.isArray(payload.errors) ? {
|
|
2723
|
+
errors: payload.errors.flatMap((item) => {
|
|
2724
|
+
const error = signalAwarenessRecord(item);
|
|
2725
|
+
const row = signalAwarenessCount(error.row);
|
|
2726
|
+
const message = signalAwarenessText(error.error, 500);
|
|
2727
|
+
return row !== void 0 && message ? [{ row, error: message }] : [];
|
|
2728
|
+
})
|
|
2729
|
+
} : {},
|
|
2730
|
+
...payload.output_mode === "csv" || payload.output_mode === "webhook" ? { outputMode: payload.output_mode } : {},
|
|
2731
|
+
...payload.webhook_url === null || typeof payload.webhook_url === "string" ? { webhookUrl: payload.webhook_url } : {},
|
|
2732
|
+
...Number.isInteger(Number(payload.webhook_status)) ? { webhookStatus: Number(payload.webhook_status) } : {},
|
|
2654
2733
|
...Number.isFinite(Number(payload.total)) ? { total: Number(payload.total) } : {},
|
|
2655
2734
|
...Number.isFinite(Number(payload.limit)) ? { limit: Number(payload.limit) } : {},
|
|
2656
2735
|
...Number.isFinite(Number(payload.offset)) ? { offset: Number(payload.offset) } : {},
|
|
@@ -2676,11 +2755,21 @@ function normalizeSignalAwarenessMonitor(value) {
|
|
|
2676
2755
|
const domain = signalAwarenessText(monitor.domain, 253);
|
|
2677
2756
|
const status = signalAwarenessText(monitor.status, 80);
|
|
2678
2757
|
const schedule = signalAwarenessText(monitor.schedule, 120);
|
|
2758
|
+
const scheduleCron = signalAwarenessText(monitor.schedule_cron, 120);
|
|
2679
2759
|
if (id) result.id = id;
|
|
2680
2760
|
if (companyName) result.company_name = companyName;
|
|
2681
2761
|
if (domain) result.domain = domain;
|
|
2682
2762
|
if (status) result.status = status;
|
|
2683
2763
|
if (schedule) result.schedule = schedule;
|
|
2764
|
+
if (scheduleCron) result.schedule_cron = scheduleCron;
|
|
2765
|
+
if (monitor.webhook_url === null || typeof monitor.webhook_url === "string") result.webhook_url = monitor.webhook_url;
|
|
2766
|
+
for (const key of ["total_runs", "total_signals_found", "consecutive_failures"]) {
|
|
2767
|
+
const value2 = signalAwarenessCount(monitor[key]);
|
|
2768
|
+
if (value2 !== void 0) result[key] = value2;
|
|
2769
|
+
}
|
|
2770
|
+
if (typeof monitor.auto_paused === "boolean") result.auto_paused = monitor.auto_paused;
|
|
2771
|
+
const autoPauseReason = signalAwarenessText(monitor.auto_pause_reason, 500);
|
|
2772
|
+
if (autoPauseReason) result.auto_pause_reason = autoPauseReason;
|
|
2684
2773
|
for (const key of ["last_run_at", "next_run_at", "created_at", "updated_at"]) {
|
|
2685
2774
|
const timestamp = signalAwarenessText(monitor[key], 64);
|
|
2686
2775
|
if (timestamp && Number.isFinite(Date.parse(timestamp))) result[key] = timestamp;
|
package/dist/index.d.mts
CHANGED
|
@@ -7,11 +7,23 @@ 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 = 'every_6_hours' | 'daily' | 'every_2_days' | 'weekly' | 'monthly';
|
|
10
11
|
interface SignalMonitorInput {
|
|
11
12
|
companyName: string;
|
|
12
13
|
domain: string;
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
schedule?: SignalAwarenessSchedulePreset;
|
|
15
|
+
scheduleCron?: string;
|
|
16
|
+
webhookUrl?: string | null;
|
|
17
|
+
}
|
|
18
|
+
interface SignalMonitorUpdateInput {
|
|
19
|
+
companyName?: string;
|
|
20
|
+
schedule?: SignalAwarenessSchedulePreset;
|
|
21
|
+
scheduleCron?: string;
|
|
22
|
+
status?: 'active' | 'paused';
|
|
23
|
+
webhookUrl?: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface SignalMonitorDefaults {
|
|
26
|
+
schedule?: SignalAwarenessSchedulePreset;
|
|
15
27
|
scheduleCron?: string;
|
|
16
28
|
webhookUrl?: string | null;
|
|
17
29
|
}
|
|
@@ -20,8 +32,12 @@ interface SignalAwarenessRequest {
|
|
|
20
32
|
monitorId?: string;
|
|
21
33
|
monitor?: SignalMonitorInput;
|
|
22
34
|
monitors?: SignalMonitorInput[];
|
|
23
|
-
defaults?:
|
|
24
|
-
updates?:
|
|
35
|
+
defaults?: SignalMonitorDefaults;
|
|
36
|
+
updates?: SignalMonitorUpdateInput;
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
webhookUrl?: string | null;
|
|
39
|
+
signalIds?: string[];
|
|
40
|
+
signals?: SignalAwarenessSignal[];
|
|
25
41
|
limit?: number;
|
|
26
42
|
offset?: number;
|
|
27
43
|
idempotencyKey?: string;
|
|
@@ -33,6 +49,13 @@ interface SignalAwarenessMonitor {
|
|
|
33
49
|
domain?: string;
|
|
34
50
|
status?: string;
|
|
35
51
|
schedule?: string;
|
|
52
|
+
schedule_cron?: string;
|
|
53
|
+
webhook_url?: string | null;
|
|
54
|
+
total_runs?: number;
|
|
55
|
+
total_signals_found?: number;
|
|
56
|
+
consecutive_failures?: number;
|
|
57
|
+
auto_paused?: boolean;
|
|
58
|
+
auto_pause_reason?: string;
|
|
36
59
|
last_run_at?: string;
|
|
37
60
|
next_run_at?: string;
|
|
38
61
|
created_at?: string;
|
|
@@ -70,6 +93,14 @@ interface SignalAwarenessResponse {
|
|
|
70
93
|
creditsUsed?: number;
|
|
71
94
|
created?: number;
|
|
72
95
|
skipped?: number;
|
|
96
|
+
delivered?: number;
|
|
97
|
+
errors?: Array<{
|
|
98
|
+
row: number;
|
|
99
|
+
error: string;
|
|
100
|
+
}>;
|
|
101
|
+
outputMode?: 'csv' | 'webhook';
|
|
102
|
+
webhookUrl?: string | null;
|
|
103
|
+
webhookStatus?: number;
|
|
73
104
|
total?: number;
|
|
74
105
|
limit?: number;
|
|
75
106
|
offset?: number;
|
|
@@ -577,6 +608,17 @@ declare class Signaliz {
|
|
|
577
608
|
createSignalMonitor(monitor: SignalMonitorInput): Promise<SignalAwarenessResponse>;
|
|
578
609
|
listSignalMonitors(limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
|
|
579
610
|
runSignalMonitor(monitorId: string, idempotencyKey?: string): Promise<SignalAwarenessResponse>;
|
|
611
|
+
updateSignalMonitor(monitorId: string, updates: SignalMonitorUpdateInput): Promise<SignalAwarenessResponse>;
|
|
612
|
+
pauseSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
|
|
613
|
+
resumeSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
|
|
614
|
+
deleteSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
|
|
615
|
+
listSignalAwarenessSignals(monitorId?: string, limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
|
|
616
|
+
bulkCreateSignalMonitors(monitors: SignalMonitorInput[], defaults?: SignalMonitorDefaults): Promise<SignalAwarenessResponse>;
|
|
617
|
+
getSignalAwarenessSettings(): Promise<SignalAwarenessResponse>;
|
|
618
|
+
setSignalAwarenessOutput(outputMode: 'csv' | 'webhook', webhookUrl?: string | null): Promise<SignalAwarenessResponse>;
|
|
619
|
+
testSignalAwarenessWebhook(webhookUrl: string): Promise<SignalAwarenessResponse>;
|
|
620
|
+
exportSignalAwareness(monitorId?: string): Promise<SignalAwarenessResponse>;
|
|
621
|
+
sendSignalAwarenessExport(signals: SignalAwarenessSignal[]): Promise<SignalAwarenessResponse>;
|
|
580
622
|
findEmail(params: FindEmailParams & {
|
|
581
623
|
dryRun: true;
|
|
582
624
|
}): Promise<CoreProductDryRunResult>;
|
|
@@ -638,4 +680,4 @@ declare class Signaliz {
|
|
|
638
680
|
health(): Promise<PlatformHealth>;
|
|
639
681
|
}
|
|
640
682
|
|
|
641
|
-
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 SignalAwarenessSignal, type SignalDiscoveryParams, type SignalDiscoveryResult, type SignalDiscoverySignal, type SignalDiscoverySource, type SignalDiscoveryStatus, type SignalMonitorInput, 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 };
|
|
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 SignalDiscoverySource, 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,11 +7,23 @@ 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 = 'every_6_hours' | 'daily' | 'every_2_days' | 'weekly' | 'monthly';
|
|
10
11
|
interface SignalMonitorInput {
|
|
11
12
|
companyName: string;
|
|
12
13
|
domain: string;
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
schedule?: SignalAwarenessSchedulePreset;
|
|
15
|
+
scheduleCron?: string;
|
|
16
|
+
webhookUrl?: string | null;
|
|
17
|
+
}
|
|
18
|
+
interface SignalMonitorUpdateInput {
|
|
19
|
+
companyName?: string;
|
|
20
|
+
schedule?: SignalAwarenessSchedulePreset;
|
|
21
|
+
scheduleCron?: string;
|
|
22
|
+
status?: 'active' | 'paused';
|
|
23
|
+
webhookUrl?: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface SignalMonitorDefaults {
|
|
26
|
+
schedule?: SignalAwarenessSchedulePreset;
|
|
15
27
|
scheduleCron?: string;
|
|
16
28
|
webhookUrl?: string | null;
|
|
17
29
|
}
|
|
@@ -20,8 +32,12 @@ interface SignalAwarenessRequest {
|
|
|
20
32
|
monitorId?: string;
|
|
21
33
|
monitor?: SignalMonitorInput;
|
|
22
34
|
monitors?: SignalMonitorInput[];
|
|
23
|
-
defaults?:
|
|
24
|
-
updates?:
|
|
35
|
+
defaults?: SignalMonitorDefaults;
|
|
36
|
+
updates?: SignalMonitorUpdateInput;
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
webhookUrl?: string | null;
|
|
39
|
+
signalIds?: string[];
|
|
40
|
+
signals?: SignalAwarenessSignal[];
|
|
25
41
|
limit?: number;
|
|
26
42
|
offset?: number;
|
|
27
43
|
idempotencyKey?: string;
|
|
@@ -33,6 +49,13 @@ interface SignalAwarenessMonitor {
|
|
|
33
49
|
domain?: string;
|
|
34
50
|
status?: string;
|
|
35
51
|
schedule?: string;
|
|
52
|
+
schedule_cron?: string;
|
|
53
|
+
webhook_url?: string | null;
|
|
54
|
+
total_runs?: number;
|
|
55
|
+
total_signals_found?: number;
|
|
56
|
+
consecutive_failures?: number;
|
|
57
|
+
auto_paused?: boolean;
|
|
58
|
+
auto_pause_reason?: string;
|
|
36
59
|
last_run_at?: string;
|
|
37
60
|
next_run_at?: string;
|
|
38
61
|
created_at?: string;
|
|
@@ -70,6 +93,14 @@ interface SignalAwarenessResponse {
|
|
|
70
93
|
creditsUsed?: number;
|
|
71
94
|
created?: number;
|
|
72
95
|
skipped?: number;
|
|
96
|
+
delivered?: number;
|
|
97
|
+
errors?: Array<{
|
|
98
|
+
row: number;
|
|
99
|
+
error: string;
|
|
100
|
+
}>;
|
|
101
|
+
outputMode?: 'csv' | 'webhook';
|
|
102
|
+
webhookUrl?: string | null;
|
|
103
|
+
webhookStatus?: number;
|
|
73
104
|
total?: number;
|
|
74
105
|
limit?: number;
|
|
75
106
|
offset?: number;
|
|
@@ -577,6 +608,17 @@ declare class Signaliz {
|
|
|
577
608
|
createSignalMonitor(monitor: SignalMonitorInput): Promise<SignalAwarenessResponse>;
|
|
578
609
|
listSignalMonitors(limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
|
|
579
610
|
runSignalMonitor(monitorId: string, idempotencyKey?: string): Promise<SignalAwarenessResponse>;
|
|
611
|
+
updateSignalMonitor(monitorId: string, updates: SignalMonitorUpdateInput): Promise<SignalAwarenessResponse>;
|
|
612
|
+
pauseSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
|
|
613
|
+
resumeSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
|
|
614
|
+
deleteSignalMonitor(monitorId: string): Promise<SignalAwarenessResponse>;
|
|
615
|
+
listSignalAwarenessSignals(monitorId?: string, limit?: number, offset?: number): Promise<SignalAwarenessResponse>;
|
|
616
|
+
bulkCreateSignalMonitors(monitors: SignalMonitorInput[], defaults?: SignalMonitorDefaults): Promise<SignalAwarenessResponse>;
|
|
617
|
+
getSignalAwarenessSettings(): Promise<SignalAwarenessResponse>;
|
|
618
|
+
setSignalAwarenessOutput(outputMode: 'csv' | 'webhook', webhookUrl?: string | null): Promise<SignalAwarenessResponse>;
|
|
619
|
+
testSignalAwarenessWebhook(webhookUrl: string): Promise<SignalAwarenessResponse>;
|
|
620
|
+
exportSignalAwareness(monitorId?: string): Promise<SignalAwarenessResponse>;
|
|
621
|
+
sendSignalAwarenessExport(signals: SignalAwarenessSignal[]): Promise<SignalAwarenessResponse>;
|
|
580
622
|
findEmail(params: FindEmailParams & {
|
|
581
623
|
dryRun: true;
|
|
582
624
|
}): Promise<CoreProductDryRunResult>;
|
|
@@ -638,4 +680,4 @@ declare class Signaliz {
|
|
|
638
680
|
health(): Promise<PlatformHealth>;
|
|
639
681
|
}
|
|
640
682
|
|
|
641
|
-
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 SignalAwarenessSignal, type SignalDiscoveryParams, type SignalDiscoveryResult, type SignalDiscoverySignal, type SignalDiscoverySource, type SignalDiscoveryStatus, type SignalMonitorInput, 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 };
|
|
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 SignalDiscoverySource, 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
|
@@ -675,25 +675,29 @@ function firstValid(values, normalize) {
|
|
|
675
675
|
}
|
|
676
676
|
return "";
|
|
677
677
|
}
|
|
678
|
+
function publicSignalSummary(value, title) {
|
|
679
|
+
return /^(?:read more|read post|keep reading|learn more|api|\.{3})$/i.test(value) ? title : value;
|
|
680
|
+
}
|
|
678
681
|
function publicSignalRow(value, fallbackCompany) {
|
|
679
682
|
const signal = recordValue(value);
|
|
680
683
|
const raw = recordValue(signal.raw_data);
|
|
681
684
|
const company = recordValue(signal.company);
|
|
682
685
|
const rawCompany = recordValue(raw.company);
|
|
683
686
|
const fallback = recordValue(fallbackCompany);
|
|
687
|
+
const signalTitle = firstValid([
|
|
688
|
+
signal.signal_title,
|
|
689
|
+
raw.signal_title,
|
|
690
|
+
signal.title,
|
|
691
|
+
raw.title,
|
|
692
|
+
signal.headline,
|
|
693
|
+
raw.headline,
|
|
694
|
+
signal.name,
|
|
695
|
+
raw.name
|
|
696
|
+
], text);
|
|
684
697
|
const row = {
|
|
685
698
|
signal_type: signalType(signal),
|
|
686
|
-
signal_title:
|
|
687
|
-
|
|
688
|
-
raw.signal_title,
|
|
689
|
-
signal.title,
|
|
690
|
-
raw.title,
|
|
691
|
-
signal.headline,
|
|
692
|
-
raw.headline,
|
|
693
|
-
signal.name,
|
|
694
|
-
raw.name
|
|
695
|
-
], text),
|
|
696
|
-
signal_summary: firstValid([
|
|
699
|
+
signal_title: signalTitle,
|
|
700
|
+
signal_summary: publicSignalSummary(firstValid([
|
|
697
701
|
signal.signal_summary,
|
|
698
702
|
raw.signal_summary,
|
|
699
703
|
signal.summary,
|
|
@@ -704,7 +708,7 @@ function publicSignalRow(value, fallbackCompany) {
|
|
|
704
708
|
raw.content,
|
|
705
709
|
signal.description,
|
|
706
710
|
raw.description
|
|
707
|
-
], text),
|
|
711
|
+
], text), signalTitle),
|
|
708
712
|
source: firstValid([
|
|
709
713
|
signal.canonical_source_url,
|
|
710
714
|
signal.source_url,
|
|
@@ -845,6 +849,43 @@ var Signaliz = class {
|
|
|
845
849
|
async runSignalMonitor(monitorId, idempotencyKey) {
|
|
846
850
|
return this.signalAwareness({ action: "manual_run", monitorId, idempotencyKey });
|
|
847
851
|
}
|
|
852
|
+
async updateSignalMonitor(monitorId, updates) {
|
|
853
|
+
return this.signalAwareness({ action: "update", monitorId, updates });
|
|
854
|
+
}
|
|
855
|
+
async pauseSignalMonitor(monitorId) {
|
|
856
|
+
return this.updateSignalMonitor(monitorId, { status: "paused" });
|
|
857
|
+
}
|
|
858
|
+
async resumeSignalMonitor(monitorId) {
|
|
859
|
+
return this.updateSignalMonitor(monitorId, { status: "active" });
|
|
860
|
+
}
|
|
861
|
+
async deleteSignalMonitor(monitorId) {
|
|
862
|
+
return this.signalAwareness({ action: "delete", monitorId });
|
|
863
|
+
}
|
|
864
|
+
async listSignalAwarenessSignals(monitorId, limit, offset) {
|
|
865
|
+
return this.signalAwareness({ action: "list_signals", monitorId, limit, offset });
|
|
866
|
+
}
|
|
867
|
+
async bulkCreateSignalMonitors(monitors, defaults) {
|
|
868
|
+
return this.signalAwareness({ action: "bulk_import", monitors, defaults });
|
|
869
|
+
}
|
|
870
|
+
async getSignalAwarenessSettings() {
|
|
871
|
+
return this.signalAwareness({ action: "get_settings" });
|
|
872
|
+
}
|
|
873
|
+
async setSignalAwarenessOutput(outputMode, webhookUrl) {
|
|
874
|
+
return this.signalAwareness({
|
|
875
|
+
action: "set_global_webhook",
|
|
876
|
+
enabled: outputMode === "webhook",
|
|
877
|
+
webhookUrl: outputMode === "webhook" ? webhookUrl : null
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
async testSignalAwarenessWebhook(webhookUrl) {
|
|
881
|
+
return this.signalAwareness({ action: "test_webhook", webhookUrl });
|
|
882
|
+
}
|
|
883
|
+
async exportSignalAwareness(monitorId) {
|
|
884
|
+
return this.signalAwareness({ action: "export", monitorId });
|
|
885
|
+
}
|
|
886
|
+
async sendSignalAwarenessExport(signals) {
|
|
887
|
+
return this.signalAwareness({ action: "send_signal_export", signals });
|
|
888
|
+
}
|
|
848
889
|
async findEmail(params) {
|
|
849
890
|
const request = findEmailRequestBody(params);
|
|
850
891
|
assertFindEmailRequestIdentity(request);
|
|
@@ -2634,24 +2675,50 @@ function normalizeSignalToCopyResult(data) {
|
|
|
2634
2675
|
raw: data
|
|
2635
2676
|
};
|
|
2636
2677
|
}
|
|
2678
|
+
var SIGNAL_AWARENESS_SCHEDULES = {
|
|
2679
|
+
every_6_hours: "0 */6 * * *",
|
|
2680
|
+
daily: "0 8 * * *",
|
|
2681
|
+
every_2_days: "0 8 */2 * *",
|
|
2682
|
+
weekly: "0 8 * * 1",
|
|
2683
|
+
monthly: "0 8 1 * *"
|
|
2684
|
+
};
|
|
2685
|
+
function signalAwarenessScheduleCron(value) {
|
|
2686
|
+
return value.scheduleCron || (value.schedule ? SIGNAL_AWARENESS_SCHEDULES[value.schedule] : void 0);
|
|
2687
|
+
}
|
|
2637
2688
|
function signalAwarenessMonitorRequest(monitor) {
|
|
2638
2689
|
return compact({
|
|
2639
2690
|
company_name: monitor.companyName,
|
|
2640
2691
|
domain: monitor.domain,
|
|
2641
|
-
|
|
2642
|
-
signal_config: monitor.signalConfig,
|
|
2643
|
-
schedule_cron: monitor.scheduleCron,
|
|
2692
|
+
schedule_cron: signalAwarenessScheduleCron(monitor),
|
|
2644
2693
|
webhook_url: monitor.webhookUrl
|
|
2645
2694
|
});
|
|
2646
2695
|
}
|
|
2696
|
+
function signalAwarenessMonitorDefaultsRequest(defaults) {
|
|
2697
|
+
return compact({
|
|
2698
|
+
schedule_cron: signalAwarenessScheduleCron(defaults),
|
|
2699
|
+
webhook_url: defaults.webhookUrl
|
|
2700
|
+
});
|
|
2701
|
+
}
|
|
2702
|
+
function signalAwarenessMonitorUpdateRequest(updates) {
|
|
2703
|
+
return compact({
|
|
2704
|
+
company_name: updates.companyName,
|
|
2705
|
+
schedule_cron: signalAwarenessScheduleCron(updates),
|
|
2706
|
+
status: updates.status,
|
|
2707
|
+
webhook_url: updates.webhookUrl
|
|
2708
|
+
});
|
|
2709
|
+
}
|
|
2647
2710
|
function signalAwarenessRequestBody(request) {
|
|
2648
2711
|
return compact({
|
|
2649
2712
|
action: request.action,
|
|
2650
2713
|
monitor_id: request.monitorId,
|
|
2651
2714
|
monitor: request.monitor ? signalAwarenessMonitorRequest(request.monitor) : void 0,
|
|
2652
2715
|
monitors: request.monitors?.map(signalAwarenessMonitorRequest),
|
|
2653
|
-
defaults: request.defaults,
|
|
2654
|
-
updates: request.updates,
|
|
2716
|
+
defaults: request.defaults ? signalAwarenessMonitorDefaultsRequest(request.defaults) : void 0,
|
|
2717
|
+
updates: request.updates ? signalAwarenessMonitorUpdateRequest(request.updates) : void 0,
|
|
2718
|
+
enabled: request.enabled,
|
|
2719
|
+
webhook_url: request.webhookUrl,
|
|
2720
|
+
signal_ids: request.signalIds,
|
|
2721
|
+
signals: request.signals,
|
|
2655
2722
|
limit: request.limit,
|
|
2656
2723
|
offset: request.offset,
|
|
2657
2724
|
idempotency_key: request.idempotencyKey,
|
|
@@ -2660,7 +2727,7 @@ function signalAwarenessRequestBody(request) {
|
|
|
2660
2727
|
}
|
|
2661
2728
|
function normalizeSignalAwarenessResponse(data) {
|
|
2662
2729
|
const payload = data.data && typeof data.data === "object" ? data.data : data;
|
|
2663
|
-
const signals = Array.isArray(payload.signals) ?
|
|
2730
|
+
const signals = Array.isArray(payload.signals) ? payload.signals.flatMap(normalizeSignalAwarenessSignal) : void 0;
|
|
2664
2731
|
const monitors = Array.isArray(payload.monitors) ? payload.monitors.map(normalizeSignalAwarenessMonitor).filter((value) => value !== void 0) : void 0;
|
|
2665
2732
|
const monitor = normalizeSignalAwarenessMonitor(payload.monitor);
|
|
2666
2733
|
const run = normalizeSignalAwarenessRun(payload.run);
|
|
@@ -2678,6 +2745,18 @@ function normalizeSignalAwarenessResponse(data) {
|
|
|
2678
2745
|
...Number.isInteger(creditsUsed) && creditsUsed >= 0 ? { creditsUsed } : {},
|
|
2679
2746
|
...Number.isFinite(Number(payload.created)) ? { created: Number(payload.created) } : {},
|
|
2680
2747
|
...Number.isFinite(Number(payload.skipped)) ? { skipped: Number(payload.skipped) } : {},
|
|
2748
|
+
...Number.isFinite(Number(payload.delivered)) ? { delivered: Number(payload.delivered) } : {},
|
|
2749
|
+
...Array.isArray(payload.errors) ? {
|
|
2750
|
+
errors: payload.errors.flatMap((item) => {
|
|
2751
|
+
const error = signalAwarenessRecord(item);
|
|
2752
|
+
const row = signalAwarenessCount(error.row);
|
|
2753
|
+
const message = signalAwarenessText(error.error, 500);
|
|
2754
|
+
return row !== void 0 && message ? [{ row, error: message }] : [];
|
|
2755
|
+
})
|
|
2756
|
+
} : {},
|
|
2757
|
+
...payload.output_mode === "csv" || payload.output_mode === "webhook" ? { outputMode: payload.output_mode } : {},
|
|
2758
|
+
...payload.webhook_url === null || typeof payload.webhook_url === "string" ? { webhookUrl: payload.webhook_url } : {},
|
|
2759
|
+
...Number.isInteger(Number(payload.webhook_status)) ? { webhookStatus: Number(payload.webhook_status) } : {},
|
|
2681
2760
|
...Number.isFinite(Number(payload.total)) ? { total: Number(payload.total) } : {},
|
|
2682
2761
|
...Number.isFinite(Number(payload.limit)) ? { limit: Number(payload.limit) } : {},
|
|
2683
2762
|
...Number.isFinite(Number(payload.offset)) ? { offset: Number(payload.offset) } : {},
|
|
@@ -2703,11 +2782,21 @@ function normalizeSignalAwarenessMonitor(value) {
|
|
|
2703
2782
|
const domain = signalAwarenessText(monitor.domain, 253);
|
|
2704
2783
|
const status = signalAwarenessText(monitor.status, 80);
|
|
2705
2784
|
const schedule = signalAwarenessText(monitor.schedule, 120);
|
|
2785
|
+
const scheduleCron = signalAwarenessText(monitor.schedule_cron, 120);
|
|
2706
2786
|
if (id) result.id = id;
|
|
2707
2787
|
if (companyName) result.company_name = companyName;
|
|
2708
2788
|
if (domain) result.domain = domain;
|
|
2709
2789
|
if (status) result.status = status;
|
|
2710
2790
|
if (schedule) result.schedule = schedule;
|
|
2791
|
+
if (scheduleCron) result.schedule_cron = scheduleCron;
|
|
2792
|
+
if (monitor.webhook_url === null || typeof monitor.webhook_url === "string") result.webhook_url = monitor.webhook_url;
|
|
2793
|
+
for (const key of ["total_runs", "total_signals_found", "consecutive_failures"]) {
|
|
2794
|
+
const value2 = signalAwarenessCount(monitor[key]);
|
|
2795
|
+
if (value2 !== void 0) result[key] = value2;
|
|
2796
|
+
}
|
|
2797
|
+
if (typeof monitor.auto_paused === "boolean") result.auto_paused = monitor.auto_paused;
|
|
2798
|
+
const autoPauseReason = signalAwarenessText(monitor.auto_pause_reason, 500);
|
|
2799
|
+
if (autoPauseReason) result.auto_pause_reason = autoPauseReason;
|
|
2711
2800
|
for (const key of ["last_run_at", "next_run_at", "created_at", "updated_at"]) {
|
|
2712
2801
|
const timestamp = signalAwarenessText(monitor[key], 64);
|
|
2713
2802
|
if (timestamp && Number.isFinite(Date.parse(timestamp))) result[key] = timestamp;
|
package/dist/index.mjs
CHANGED
package/dist/mcp-config.js
CHANGED
|
@@ -679,25 +679,29 @@ function firstValid(values, normalize) {
|
|
|
679
679
|
}
|
|
680
680
|
return "";
|
|
681
681
|
}
|
|
682
|
+
function publicSignalSummary(value, title) {
|
|
683
|
+
return /^(?:read more|read post|keep reading|learn more|api|\.{3})$/i.test(value) ? title : value;
|
|
684
|
+
}
|
|
682
685
|
function publicSignalRow(value, fallbackCompany) {
|
|
683
686
|
const signal = recordValue(value);
|
|
684
687
|
const raw = recordValue(signal.raw_data);
|
|
685
688
|
const company = recordValue(signal.company);
|
|
686
689
|
const rawCompany = recordValue(raw.company);
|
|
687
690
|
const fallback = recordValue(fallbackCompany);
|
|
691
|
+
const signalTitle = firstValid([
|
|
692
|
+
signal.signal_title,
|
|
693
|
+
raw.signal_title,
|
|
694
|
+
signal.title,
|
|
695
|
+
raw.title,
|
|
696
|
+
signal.headline,
|
|
697
|
+
raw.headline,
|
|
698
|
+
signal.name,
|
|
699
|
+
raw.name
|
|
700
|
+
], text);
|
|
688
701
|
const row = {
|
|
689
702
|
signal_type: signalType(signal),
|
|
690
|
-
signal_title:
|
|
691
|
-
|
|
692
|
-
raw.signal_title,
|
|
693
|
-
signal.title,
|
|
694
|
-
raw.title,
|
|
695
|
-
signal.headline,
|
|
696
|
-
raw.headline,
|
|
697
|
-
signal.name,
|
|
698
|
-
raw.name
|
|
699
|
-
], text),
|
|
700
|
-
signal_summary: firstValid([
|
|
703
|
+
signal_title: signalTitle,
|
|
704
|
+
signal_summary: publicSignalSummary(firstValid([
|
|
701
705
|
signal.signal_summary,
|
|
702
706
|
raw.signal_summary,
|
|
703
707
|
signal.summary,
|
|
@@ -708,7 +712,7 @@ function publicSignalRow(value, fallbackCompany) {
|
|
|
708
712
|
raw.content,
|
|
709
713
|
signal.description,
|
|
710
714
|
raw.description
|
|
711
|
-
], text),
|
|
715
|
+
], text), signalTitle),
|
|
712
716
|
source: firstValid([
|
|
713
717
|
signal.canonical_source_url,
|
|
714
718
|
signal.source_url,
|
|
@@ -849,6 +853,43 @@ var Signaliz = class {
|
|
|
849
853
|
async runSignalMonitor(monitorId, idempotencyKey) {
|
|
850
854
|
return this.signalAwareness({ action: "manual_run", monitorId, idempotencyKey });
|
|
851
855
|
}
|
|
856
|
+
async updateSignalMonitor(monitorId, updates) {
|
|
857
|
+
return this.signalAwareness({ action: "update", monitorId, updates });
|
|
858
|
+
}
|
|
859
|
+
async pauseSignalMonitor(monitorId) {
|
|
860
|
+
return this.updateSignalMonitor(monitorId, { status: "paused" });
|
|
861
|
+
}
|
|
862
|
+
async resumeSignalMonitor(monitorId) {
|
|
863
|
+
return this.updateSignalMonitor(monitorId, { status: "active" });
|
|
864
|
+
}
|
|
865
|
+
async deleteSignalMonitor(monitorId) {
|
|
866
|
+
return this.signalAwareness({ action: "delete", monitorId });
|
|
867
|
+
}
|
|
868
|
+
async listSignalAwarenessSignals(monitorId, limit, offset) {
|
|
869
|
+
return this.signalAwareness({ action: "list_signals", monitorId, limit, offset });
|
|
870
|
+
}
|
|
871
|
+
async bulkCreateSignalMonitors(monitors, defaults) {
|
|
872
|
+
return this.signalAwareness({ action: "bulk_import", monitors, defaults });
|
|
873
|
+
}
|
|
874
|
+
async getSignalAwarenessSettings() {
|
|
875
|
+
return this.signalAwareness({ action: "get_settings" });
|
|
876
|
+
}
|
|
877
|
+
async setSignalAwarenessOutput(outputMode, webhookUrl) {
|
|
878
|
+
return this.signalAwareness({
|
|
879
|
+
action: "set_global_webhook",
|
|
880
|
+
enabled: outputMode === "webhook",
|
|
881
|
+
webhookUrl: outputMode === "webhook" ? webhookUrl : null
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
async testSignalAwarenessWebhook(webhookUrl) {
|
|
885
|
+
return this.signalAwareness({ action: "test_webhook", webhookUrl });
|
|
886
|
+
}
|
|
887
|
+
async exportSignalAwareness(monitorId) {
|
|
888
|
+
return this.signalAwareness({ action: "export", monitorId });
|
|
889
|
+
}
|
|
890
|
+
async sendSignalAwarenessExport(signals) {
|
|
891
|
+
return this.signalAwareness({ action: "send_signal_export", signals });
|
|
892
|
+
}
|
|
852
893
|
async findEmail(params) {
|
|
853
894
|
const request = findEmailRequestBody(params);
|
|
854
895
|
assertFindEmailRequestIdentity(request);
|
|
@@ -2638,24 +2679,50 @@ function normalizeSignalToCopyResult(data) {
|
|
|
2638
2679
|
raw: data
|
|
2639
2680
|
};
|
|
2640
2681
|
}
|
|
2682
|
+
var SIGNAL_AWARENESS_SCHEDULES = {
|
|
2683
|
+
every_6_hours: "0 */6 * * *",
|
|
2684
|
+
daily: "0 8 * * *",
|
|
2685
|
+
every_2_days: "0 8 */2 * *",
|
|
2686
|
+
weekly: "0 8 * * 1",
|
|
2687
|
+
monthly: "0 8 1 * *"
|
|
2688
|
+
};
|
|
2689
|
+
function signalAwarenessScheduleCron(value) {
|
|
2690
|
+
return value.scheduleCron || (value.schedule ? SIGNAL_AWARENESS_SCHEDULES[value.schedule] : void 0);
|
|
2691
|
+
}
|
|
2641
2692
|
function signalAwarenessMonitorRequest(monitor) {
|
|
2642
2693
|
return compact({
|
|
2643
2694
|
company_name: monitor.companyName,
|
|
2644
2695
|
domain: monitor.domain,
|
|
2645
|
-
|
|
2646
|
-
signal_config: monitor.signalConfig,
|
|
2647
|
-
schedule_cron: monitor.scheduleCron,
|
|
2696
|
+
schedule_cron: signalAwarenessScheduleCron(monitor),
|
|
2648
2697
|
webhook_url: monitor.webhookUrl
|
|
2649
2698
|
});
|
|
2650
2699
|
}
|
|
2700
|
+
function signalAwarenessMonitorDefaultsRequest(defaults) {
|
|
2701
|
+
return compact({
|
|
2702
|
+
schedule_cron: signalAwarenessScheduleCron(defaults),
|
|
2703
|
+
webhook_url: defaults.webhookUrl
|
|
2704
|
+
});
|
|
2705
|
+
}
|
|
2706
|
+
function signalAwarenessMonitorUpdateRequest(updates) {
|
|
2707
|
+
return compact({
|
|
2708
|
+
company_name: updates.companyName,
|
|
2709
|
+
schedule_cron: signalAwarenessScheduleCron(updates),
|
|
2710
|
+
status: updates.status,
|
|
2711
|
+
webhook_url: updates.webhookUrl
|
|
2712
|
+
});
|
|
2713
|
+
}
|
|
2651
2714
|
function signalAwarenessRequestBody(request) {
|
|
2652
2715
|
return compact({
|
|
2653
2716
|
action: request.action,
|
|
2654
2717
|
monitor_id: request.monitorId,
|
|
2655
2718
|
monitor: request.monitor ? signalAwarenessMonitorRequest(request.monitor) : void 0,
|
|
2656
2719
|
monitors: request.monitors?.map(signalAwarenessMonitorRequest),
|
|
2657
|
-
defaults: request.defaults,
|
|
2658
|
-
updates: request.updates,
|
|
2720
|
+
defaults: request.defaults ? signalAwarenessMonitorDefaultsRequest(request.defaults) : void 0,
|
|
2721
|
+
updates: request.updates ? signalAwarenessMonitorUpdateRequest(request.updates) : void 0,
|
|
2722
|
+
enabled: request.enabled,
|
|
2723
|
+
webhook_url: request.webhookUrl,
|
|
2724
|
+
signal_ids: request.signalIds,
|
|
2725
|
+
signals: request.signals,
|
|
2659
2726
|
limit: request.limit,
|
|
2660
2727
|
offset: request.offset,
|
|
2661
2728
|
idempotency_key: request.idempotencyKey,
|
|
@@ -2664,7 +2731,7 @@ function signalAwarenessRequestBody(request) {
|
|
|
2664
2731
|
}
|
|
2665
2732
|
function normalizeSignalAwarenessResponse(data) {
|
|
2666
2733
|
const payload = data.data && typeof data.data === "object" ? data.data : data;
|
|
2667
|
-
const signals = Array.isArray(payload.signals) ?
|
|
2734
|
+
const signals = Array.isArray(payload.signals) ? payload.signals.flatMap(normalizeSignalAwarenessSignal) : void 0;
|
|
2668
2735
|
const monitors = Array.isArray(payload.monitors) ? payload.monitors.map(normalizeSignalAwarenessMonitor).filter((value) => value !== void 0) : void 0;
|
|
2669
2736
|
const monitor = normalizeSignalAwarenessMonitor(payload.monitor);
|
|
2670
2737
|
const run = normalizeSignalAwarenessRun(payload.run);
|
|
@@ -2682,6 +2749,18 @@ function normalizeSignalAwarenessResponse(data) {
|
|
|
2682
2749
|
...Number.isInteger(creditsUsed) && creditsUsed >= 0 ? { creditsUsed } : {},
|
|
2683
2750
|
...Number.isFinite(Number(payload.created)) ? { created: Number(payload.created) } : {},
|
|
2684
2751
|
...Number.isFinite(Number(payload.skipped)) ? { skipped: Number(payload.skipped) } : {},
|
|
2752
|
+
...Number.isFinite(Number(payload.delivered)) ? { delivered: Number(payload.delivered) } : {},
|
|
2753
|
+
...Array.isArray(payload.errors) ? {
|
|
2754
|
+
errors: payload.errors.flatMap((item) => {
|
|
2755
|
+
const error = signalAwarenessRecord(item);
|
|
2756
|
+
const row = signalAwarenessCount(error.row);
|
|
2757
|
+
const message = signalAwarenessText(error.error, 500);
|
|
2758
|
+
return row !== void 0 && message ? [{ row, error: message }] : [];
|
|
2759
|
+
})
|
|
2760
|
+
} : {},
|
|
2761
|
+
...payload.output_mode === "csv" || payload.output_mode === "webhook" ? { outputMode: payload.output_mode } : {},
|
|
2762
|
+
...payload.webhook_url === null || typeof payload.webhook_url === "string" ? { webhookUrl: payload.webhook_url } : {},
|
|
2763
|
+
...Number.isInteger(Number(payload.webhook_status)) ? { webhookStatus: Number(payload.webhook_status) } : {},
|
|
2685
2764
|
...Number.isFinite(Number(payload.total)) ? { total: Number(payload.total) } : {},
|
|
2686
2765
|
...Number.isFinite(Number(payload.limit)) ? { limit: Number(payload.limit) } : {},
|
|
2687
2766
|
...Number.isFinite(Number(payload.offset)) ? { offset: Number(payload.offset) } : {},
|
|
@@ -2707,11 +2786,21 @@ function normalizeSignalAwarenessMonitor(value) {
|
|
|
2707
2786
|
const domain = signalAwarenessText(monitor.domain, 253);
|
|
2708
2787
|
const status = signalAwarenessText(monitor.status, 80);
|
|
2709
2788
|
const schedule = signalAwarenessText(monitor.schedule, 120);
|
|
2789
|
+
const scheduleCron = signalAwarenessText(monitor.schedule_cron, 120);
|
|
2710
2790
|
if (id) result.id = id;
|
|
2711
2791
|
if (companyName) result.company_name = companyName;
|
|
2712
2792
|
if (domain) result.domain = domain;
|
|
2713
2793
|
if (status) result.status = status;
|
|
2714
2794
|
if (schedule) result.schedule = schedule;
|
|
2795
|
+
if (scheduleCron) result.schedule_cron = scheduleCron;
|
|
2796
|
+
if (monitor.webhook_url === null || typeof monitor.webhook_url === "string") result.webhook_url = monitor.webhook_url;
|
|
2797
|
+
for (const key of ["total_runs", "total_signals_found", "consecutive_failures"]) {
|
|
2798
|
+
const value2 = signalAwarenessCount(monitor[key]);
|
|
2799
|
+
if (value2 !== void 0) result[key] = value2;
|
|
2800
|
+
}
|
|
2801
|
+
if (typeof monitor.auto_paused === "boolean") result.auto_paused = monitor.auto_paused;
|
|
2802
|
+
const autoPauseReason = signalAwarenessText(monitor.auto_pause_reason, 500);
|
|
2803
|
+
if (autoPauseReason) result.auto_pause_reason = autoPauseReason;
|
|
2715
2804
|
for (const key of ["last_run_at", "next_run_at", "created_at", "updated_at"]) {
|
|
2716
2805
|
const timestamp = signalAwarenessText(monitor[key], 64);
|
|
2717
2806
|
if (timestamp && Number.isFinite(Date.parse(timestamp))) result[key] = timestamp;
|
package/dist/mcp-config.mjs
CHANGED
package/package.json
CHANGED