@signaliz/sdk 1.0.67 → 1.0.69

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 CHANGED
@@ -1,6 +1,7 @@
1
1
  # @signaliz/sdk
2
2
 
3
- Typed JavaScript/TypeScript access to all five core products in Signaliz.
3
+ Typed JavaScript/TypeScript access to all five core products in Signaliz, plus
4
+ Signal Awareness and Signaliz Flow through the same public contract.
4
5
 
5
6
  ```bash
6
7
  npm install @signaliz/sdk
@@ -13,6 +14,10 @@ Production REST endpoints:
13
14
  - `https://api.signaliz.com/functions/v1/api/v1/company-signals`
14
15
  - `https://api.signaliz.com/functions/v1/api/v1/signal-to-copy`
15
16
  - `https://api.signaliz.com/functions/v1/api/v1/signals`
17
+ - `https://api.signaliz.com/functions/v1/api/v1/signal-awareness`
18
+ - `https://api.signaliz.com/functions/v1/api/v1/flow`
19
+
20
+ The same request and response schemas are available under `/api/v2/`.
16
21
 
17
22
  ```ts
18
23
  import { Signaliz } from '@signaliz/sdk';
@@ -35,8 +40,6 @@ console.log(plan.inputCount, plan.uniqueFreshInputCount, plan.inputDuplicatesSup
35
40
  const found = await signaliz.findEmail({
36
41
  companyDomain: 'example.com',
37
42
  fullName: 'Jane Doe',
38
- // Optional: bypass cached email and verification data for a fresh-provider run.
39
- skipCache: true,
40
43
  });
41
44
 
42
45
  // An HTTPS LinkedIn person profile URL (/in/<slug>) is also sufficient on its own.
@@ -45,8 +48,6 @@ const foundFromLinkedIn = await signaliz.findEmail({
45
48
  });
46
49
 
47
50
  const verified = await signaliz.verifyEmail(found.email!, {
48
- // Optional: bypass cached verification proof for a fresh-provider check.
49
- skipCache: true,
50
51
  });
51
52
 
52
53
  // Syntax failures are terminal local results, with no HTTP or provider call.
@@ -56,25 +57,24 @@ console.log(malformed.success, malformed.isMalformed, malformed.verificationVerd
56
57
  // The SDK waits for long checks by default. For an agent handoff, return early
57
58
  // and resume the exact provider run later without duplicate spend.
58
59
  const queuedVerification = await signaliz.verifyEmail('jane@example.com', {
59
- skipCache: true,
60
60
  waitForResult: false,
61
61
  });
62
62
  const resumedVerification = await signaliz.verifyEmail('jane@example.com', {
63
63
  verificationRunId: queuedVerification.verificationRunId,
64
64
  });
65
65
 
66
- // Recovery is zero-current-spend. When the original provider call had a
67
- // receipt, Find Email and Verify Email retain it separately for audit.
68
- console.log(resumedVerification.billingMetadata?.result_returned_from); // run_recovery
69
- console.log(resumedVerification.historicalBillingMetadata?.result_returned_from);
66
+ // Recovery reuses the original request and its public credit receipt.
67
+ console.log(resumedVerification.creditsUsed, resumedVerification.billingReplayed);
70
68
 
71
69
  const signals = await signaliz.enrichCompanySignals({
72
- companyDomain: 'example.com',
73
- researchPrompt: 'expansion priorities',
70
+ domain: 'example.com',
74
71
  });
75
- // Audit normalized evidence provenance without reaching into `raw`.
76
- console.log(signals.signals[0].evidencePublishedDate);
77
- console.log(signals.signals[0].signalFeedSource, signals.signals[0].derived);
72
+ // Signal rows expose only the customer-facing signal fields.
73
+ console.log(
74
+ signals.signals[0].signal_type,
75
+ signals.signals[0].source,
76
+ signals.signals[0].date,
77
+ );
78
78
 
79
79
  // Query-first discovery returns distinct companies with dated source evidence.
80
80
  // The first response is usually queued; resume only the returned run ID.
@@ -92,8 +92,7 @@ const painSignalDiscovery = await signaliz.discoverSignals({
92
92
  const completedDiscovery = signalDiscovery.signalSearchRunId
93
93
  ? await signaliz.discoverSignals({ signalSearchRunId: signalDiscovery.signalSearchRunId })
94
94
  : signalDiscovery;
95
- console.log(completedDiscovery.signals[0]?.company.domain);
96
- console.log(completedDiscovery.costGuardrail?.costPerQualifiedSignalUsd);
95
+ console.log(completedDiscovery.signals[0]?.domain);
97
96
 
98
97
  const copy = await signaliz.signalToCopy({
99
98
  companyDomain: 'example.com',
@@ -101,11 +100,38 @@ const copy = await signaliz.signalToCopy({
101
100
  title: 'VP Sales',
102
101
  campaignOffer: 'pipeline intelligence',
103
102
  researchPrompt: 'expansion priorities',
104
- // Cache-first and shallow by default; opt into either behavior explicitly.
105
- skipCache: false,
106
103
  enableDeepSearch: false,
107
104
  });
108
105
 
106
+ // Reuse the completed Signals First snapshot instead of rediscovering it.
107
+ const copyFromSignalRun = await signaliz.signalToCopy({
108
+ companyDomain: 'example.com',
109
+ personName: 'Jane Doe',
110
+ title: 'VP Sales',
111
+ campaignOffer: 'pipeline intelligence',
112
+ signalSearchRunId: completedDiscovery.signalSearchRunId,
113
+ });
114
+ // The copy result reuses the completed snapshot without rediscovery.
115
+
116
+ const awareness = await signaliz.signalAwareness({
117
+ action: 'list_signals',
118
+ monitorId: 'monitor-uuid',
119
+ });
120
+ console.log(
121
+ awareness.signals?.[0].signal_type,
122
+ awareness.signals?.[0].source,
123
+ awareness.signals?.[0].date,
124
+ awareness.signals?.[0].company_name,
125
+ awareness.signals?.[0].domain,
126
+ );
127
+
128
+ // Flow uses the same versioned REST gateway as every other SDK capability.
129
+ const flow = await signaliz.startFlow({
130
+ signalQuery: 'companies with recent hiring',
131
+ campaignOffer: 'pipeline intelligence',
132
+ });
133
+ const flowStatus = await signaliz.getFlow(flow.runId);
134
+
109
135
  // Company Signals and Signal to Copy are hard synchronous contracts: these
110
136
  // methods return complete data, an explicit success:false result, or throw a
111
137
  // non-2xx terminal error in this same call.
@@ -189,49 +215,47 @@ Company/Copy submissions preserve every input row and its index so the server's
189
215
  idempotency identity remains stable across REST, MCP, SDK, and CLI recovery.
190
216
  Set `compactDuplicates: true` to return repeated successful rows as
191
217
  `duplicateOf` references; the default remains expanded for compatibility.
192
- Signal to Copy durable jobs use persisted, eligible company-signal data only
193
- and never start live providers or deep research. Rows without qualifying
194
- evidence return the terminal row error `SIGNAL_DATA_REQUIRED`. Batches larger
195
- than 25 reject fresh/deep/synchronous row controls before HTTP; callers must
196
- split explicitly fresh requests into batches of at most 25.
218
+ Signal to Copy durable jobs complete missing company-signal research before
219
+ generating copy. They accept uniform `enableDeepSearch`
220
+ controls for the full job. Rows still return `SIGNAL_DATA_REQUIRED` when
221
+ research completes without qualifying evidence.
197
222
  Signal to Copy also shares company research across copy recipients.
223
+ Single calls and synchronous batches of at most 25 may instead pass
224
+ `signalSearchRunId`, `factId`, or `eventId` to reuse canonical signal evidence.
225
+ Durable batches of 26-5,000 reject these references rather than silently
226
+ starting new research.
198
227
 
199
228
  Signals Everything is query-first rather than a row batch. It defaults to 100
200
- distinct companies and supports up to 1,000. Every returned signal contains a
201
- company name, company domain, dated evidence, and a source URL. The typed
202
- `costGuardrail` reports projected and observed source acquisition cost plus
203
- identity-resolution cost, receipt source, and fallback-provider request count;
204
- Signaliz returns signals only when cost stays strictly below $0.01 per qualified
205
- company. A request is a ceiling, not a promise: it can return fewer results
229
+ distinct companies and supports up to 1,000. Every returned signal row contains
230
+ only a signal type, verified source URL, event date, company name, and domain.
231
+ A request is a ceiling, not a promise: it can return fewer results
206
232
  when public evidence cannot verify both a date and company identity. It is
207
233
  included on Builder, Team, and Agency plans and can be resumed with
208
- `signalSearchRunId` without duplicate source acquisition. Pass `icpContext` to
234
+ `signalSearchRunId`. Pass `icpContext` to
209
235
  ground an open-ended request such as “companies showing signals they need our
210
236
  product” in the user's target market.
211
237
 
212
- Company Signal Enrichment defaults `online` and `enableDeepSearch` to `true`
213
- unless the caller explicitly disables them. Its `searchMode` defaults to
214
- `balanced`; use `fast` for the primary low-latency search lane only or
215
- `coverage` when breadth matters more than the sub-cent average budget target.
238
+ Company Signal Enrichment uses one fixed provider policy: cache first, one
239
+ type-agnostic Parallel Advanced search, and at most one Extract of a
240
+ first-party multi-event hub. Deterministic code enforces company identity,
241
+ retrieved URLs, source quality, content-proven dates, copied evidence,
242
+ lookback, and event deduplication before returning the newest ten events. It
243
+ does not expose provider, model, prompt, lookback, signal-type, cache, or
244
+ target-count controls.
216
245
  Signal to Copy AI returns three
217
246
  complete, evidence-backed email variations when supported signals are available.
218
- Signal to Copy is cache-first and defaults `enableDeepSearch` to `false` so it
219
- normally finishes within an agent turn; set `skipCache` or `enableDeepSearch`
220
- only when fresh or deeper research is required.
221
- Every core request uses the authenticated workspace. Find Email and Verify Email
222
- honor that workspace's configured cache window; eligible hits cost 0 credits,
223
- while fresh discovery or verification is charged on every plan. Builder, Team,
224
- Agency, and Pay-As-You-Go include fresh Company Signals. Team and Agency also
225
- include Unlimited Signal to Copy AI; Signal to Copy remains callable on other
226
- plans under the standard product contract. These plans still check eligible
227
- workspace signal data first even when Company Signals is set to No cache.
228
- `lookbackDays` remains a hard evidence-age bound for both
229
- cached and fresh Company Signals and Signal to Copy results.
247
+ Signal to Copy defaults `enableDeepSearch` to `false` so it normally finishes
248
+ within an agent turn; enable it only when deeper research is required.
249
+ Every core request uses the authenticated workspace. Find Email costs 1 credit
250
+ per returned result and Verify Email costs 0.02 credits per returned terminal
251
+ result on every plan. Signaliz automatically reuses eligible evidence and
252
+ prevents duplicate provider work. Builder, Team, Agency, and Pay-As-You-Go
253
+ include Company Signals.
254
+ Signal to Copy costs 1 credit per successful result on Free and Builder, and is
255
+ unlimited on Team and Agency. `lookbackDays` remains a hard evidence-age bound.
230
256
  Unclassified evidence is returned by signal enrichment but is not used to
231
257
  generate outreach copy.
232
- Each normalized signal keeps `date` separate from crawl-time `detectedAt` and
233
- also exposes customer-facing classification fields such as `datePrecision`,
234
- `signalFamily`, `eventType`, `eventLabel`, and `classification`. Provider,
235
- billing, cache, routing, and validation internals are intentionally omitted.
258
+ Provider, billing provenance, routing, and validation internals are intentionally
259
+ omitted from public signal rows.
236
260
 
237
261
  `listTools()` and `health()` are connection helpers, not additional products.