@pipe0/client 0.0.5 → 0.0.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @pipe0/client
2
2
 
3
+ ## 0.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 6aaf957: Add new pipes and readme
8
+
9
+ ## 0.0.6
10
+
11
+ ### Patch Changes
12
+
13
+ - 12c1b32: Change primitive names
14
+
3
15
  ## 0.0.5
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -15,51 +15,64 @@ Here are some things pipe0 does for you:
15
15
  - 💨 Analyze enrichment pipelines and parallelize execution (we're fast!)
16
16
  - 💰 Run enrichment, scraping and AI infrastructure at low cost (we take 0% margin on external providers)
17
17
 
18
- ## Browser SDK
18
+ ## Client Library
19
19
 
20
- This package contains the browser SDK for [pipe0](https://pipe0.com). It is written in TypeScript and contains
21
- many useful types and utilities for building [UI-based apps](https://pipe0.com/resources/documentation/ui-apps)
22
- based on pipe0.
20
+ This package contains a strongly typed client for [pipe0](https://pipe0.com).
23
21
 
24
- ## Quckstart
22
+ ## Pipes (Enrichment)
25
23
 
26
- The main way to interact with the SDK is the `Pipe0` class. Use it like this.
24
+ Perform enrichments and actions. See [pipes catalog](https://www.pipe0.com/resources/pipe-catalog) to find all available pipes.
27
25
 
28
26
  ```typescript
29
- export const pipe0 = new Pipe0({ url: YOUR_SERVER_URL });
30
-
31
- const req = pipe0.request
32
- .create({
33
- pipes: initialPipeList,
34
- input: initialInput,
35
- fieldAnnotations,
36
- })
37
- .validate()
38
- .getResponse();
39
-
40
- const res = await req.send();
27
+ import { Pipe0 } from "@pipe0/client";
28
+
29
+ const piper = new Pipe0({ apiKey: API_KEY });
30
+
31
+ const data = await piper.pipes.pipe({
32
+ config: {
33
+ environment: "sandbox",
34
+ },
35
+ pipes: [
36
+ {
37
+ pipe_id: "people:name:split@1",
38
+ },
39
+ ],
40
+ input: [
41
+ {
42
+ id: "1",
43
+ name: "John Doe",
44
+ },
45
+ ],
46
+ });
41
47
  ```
42
48
 
43
- ## What makes a framework?
49
+ ## Search
44
50
 
45
- The term `framework` may surprise you because pipe0 is an API, dashboard, and SDK.
51
+ Find companies and people. See [search catalog](https://www.pipe0.com/resources/search-catalog) to find all available searches.
46
52
 
47
- While you can perform powerful enrichments in just 10 lines of code, you can choose to express logic and direction of data flow
48
- with it, too.
49
-
50
- The following is an example of an enrichment flow that requires logic.
51
-
52
- ```text filename="Flow that needs logic"
53
- FIND phone number of person
54
- IF found
55
- FIND website of current employer
56
- IF NOT found
57
- FIND work email address
53
+ ```typescript
54
+ import { Pipe0 } from "@pipe0/client";
55
+
56
+ const piper = new Pipe0({ apiKey: API_KEY });
57
+
58
+ const data = await piper.searches.search({
59
+ config: {
60
+ environment: "sandbox",
61
+ },
62
+ searches: [
63
+ {
64
+ search_id: "people:profiles:exa@1",
65
+ config: {
66
+ limit: 1,
67
+ filters: {
68
+ query: "Find all employees of pipe0",
69
+ },
70
+ },
71
+ },
72
+ ],
73
+ });
58
74
  ```
59
75
 
60
- Your first instinct might be to implement this with code. However, pipe0 offers a much simpler way to express this
61
- and removes brittle spaghetti code once and for all.
62
-
63
76
  ## Useful links
64
77
 
65
78
  - [Documentation](https://pipe0.com/resources/documentation)
@@ -7669,6 +7669,14 @@ export interface paths {
7669
7669
  type?: "string" | "number" | "boolean" | "json" | "unknown";
7670
7670
  /** @enum {string|null} */
7671
7671
  format?: "json_object" | "json_list" | "json_list_string" | "url" | "website_url" | "profile_url" | "email" | "datetime" | "currency" | "date" | "phone" | "markdown" | "text" | "int" | "decimal" | "address_line_1" | "zip_code" | "percent" | null;
7672
+ resolved_by?: {
7673
+ /** @enum {string|null} */
7674
+ ref: "prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "company:funding:leadmagic@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "json:extract@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:personalemail:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "people:email:validate:zerobounce@1" | "people:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "fields:merge@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:maplinks:firecrawl@1" | "sheet:append@1" | "sheet:expandappend@1" | "company:lookalikes:companyenrich@1" | "company:match:logodev@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "input" | "system" | null;
7675
+ /** @enum {string|null} */
7676
+ environment: "production" | "sandbox" | null;
7677
+ config_hash: string | null;
7678
+ input_hash: string | null;
7679
+ } | null;
7672
7680
  /** @description A map of widgets associated with this field for UI display, keyed by widget type. */
7673
7681
  widgets?: {
7674
7682
  display_value?: {
@@ -8600,6 +8608,14 @@ export interface paths {
8600
8608
  type?: "string" | "number" | "boolean" | "json" | "unknown";
8601
8609
  /** @enum {string|null} */
8602
8610
  format?: "json_object" | "json_list" | "json_list_string" | "url" | "website_url" | "profile_url" | "email" | "datetime" | "currency" | "date" | "phone" | "markdown" | "text" | "int" | "decimal" | "address_line_1" | "zip_code" | "percent" | null;
8611
+ resolved_by?: {
8612
+ /** @enum {string|null} */
8613
+ ref: "prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "company:funding:leadmagic@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "json:extract@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:personalemail:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "people:email:validate:zerobounce@1" | "people:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "fields:merge@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:maplinks:firecrawl@1" | "sheet:append@1" | "sheet:expandappend@1" | "company:lookalikes:companyenrich@1" | "company:match:logodev@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "input" | "system" | null;
8614
+ /** @enum {string|null} */
8615
+ environment: "production" | "sandbox" | null;
8616
+ config_hash: string | null;
8617
+ input_hash: string | null;
8618
+ } | null;
8603
8619
  /** @description A map of widgets associated with this field for UI display, keyed by widget type. */
8604
8620
  widgets?: {
8605
8621
  display_value?: {
@@ -9529,6 +9545,14 @@ export interface paths {
9529
9545
  type?: "string" | "number" | "boolean" | "json" | "unknown";
9530
9546
  /** @enum {string|null} */
9531
9547
  format?: "json_object" | "json_list" | "json_list_string" | "url" | "website_url" | "profile_url" | "email" | "datetime" | "currency" | "date" | "phone" | "markdown" | "text" | "int" | "decimal" | "address_line_1" | "zip_code" | "percent" | null;
9548
+ resolved_by?: {
9549
+ /** @enum {string|null} */
9550
+ ref: "prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "company:funding:leadmagic@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "json:extract@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:personalemail:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "people:email:validate:zerobounce@1" | "people:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "fields:merge@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:maplinks:firecrawl@1" | "sheet:append@1" | "sheet:expandappend@1" | "company:lookalikes:companyenrich@1" | "company:match:logodev@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "input" | "system" | null;
9551
+ /** @enum {string|null} */
9552
+ environment: "production" | "sandbox" | null;
9553
+ config_hash: string | null;
9554
+ input_hash: string | null;
9555
+ } | null;
9532
9556
  /** @description A map of widgets associated with this field for UI display, keyed by widget type. */
9533
9557
  widgets?: {
9534
9558
  display_value?: {
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { Pipe0 } from "./pipe0.js";
1
+ export * from "./pipe0.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { Pipe0 } from "./pipe0.js";
1
+ export * from "./pipe0.js";
package/dist/pipe0.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { type Client } from "openapi-fetch";
2
2
  import type { paths } from "./generated/openapi.types.js";
3
- export type PipesRequestPayload = paths["/v1/pipes/run"]["post"]["requestBody"]["content"]["application/json"];
3
+ export type PipesRequest = paths["/v1/pipes/run"]["post"]["requestBody"]["content"]["application/json"];
4
4
  export type PipesResponse = paths["/v1/pipes/check/{run_id}"]["get"]["responses"]["200"]["content"]["application/json"];
5
- export type PiperSearchRequestPayload = paths["/v1/searches/run"]["post"]["requestBody"]["content"]["application/json"];
6
- export type PiperSearchResponse = paths["/v1/searches/check/{run_id}"]["get"]["responses"]["200"]["content"]["application/json"];
7
- export declare class PiperTimeoutError extends Error {
5
+ export type SearchesRequest = paths["/v1/searches/run"]["post"]["requestBody"]["content"]["application/json"];
6
+ export type SearchesResponse = paths["/v1/searches/check/{run_id}"]["get"]["responses"]["200"]["content"]["application/json"];
7
+ export declare class Pipe0TimeoutError extends Error {
8
8
  readonly runId?: string | undefined;
9
9
  constructor(message: string, runId?: string | undefined);
10
10
  }
@@ -49,7 +49,7 @@ export interface BatchOptions {
49
49
  */
50
50
  signal?: AbortSignal;
51
51
  }
52
- export interface PiperOptions {
52
+ export interface Pipe0Options {
53
53
  apiKey?: string;
54
54
  baseUrl?: string;
55
55
  /**
@@ -86,7 +86,7 @@ export declare class Pipe0 {
86
86
  private maxPollingIntervalMs;
87
87
  private defaultBatchSize;
88
88
  private maxConcurrentBatches;
89
- constructor(options?: PiperOptions);
89
+ constructor(options?: Pipe0Options);
90
90
  /**
91
91
  * Centralized logic to poll until a task completes, fails, or times out.
92
92
  */
@@ -95,14 +95,14 @@ export declare class Pipe0 {
95
95
  /**
96
96
  * Create and immediately wait for completion (convenience method)
97
97
  */
98
- pipe: (payload: PipesRequestPayload, options?: {
98
+ pipe: (payload: PipesRequest, options?: {
99
99
  onPoll?: (_response: PipesResponse) => unknown;
100
100
  signal?: AbortSignal;
101
101
  }) => Promise<PipesResponse>;
102
102
  /**
103
103
  * Create a pipes task but don't want for it. Use this method if you want to fire and forget.
104
104
  */
105
- create: (payload: PipesRequestPayload) => Promise<string>;
105
+ create: (payload: PipesRequest) => Promise<string>;
106
106
  /**
107
107
  * Check the status of a pipes task manually.
108
108
  */
@@ -214,21 +214,21 @@ export declare class Pipe0 {
214
214
  * @param options - Batching options
215
215
  * @returns Array of completed batch responses
216
216
  */
217
- pipeInBatches: (payload: PipesRequestPayload, { stopOnError, ...options }?: BatchOptions) => Promise<PipesResponse[]>;
217
+ pipeInBatches: (payload: PipesRequest, { stopOnError, ...options }?: BatchOptions) => Promise<PipesResponse[]>;
218
218
  };
219
219
  searches: {
220
220
  /**
221
221
  * Create and immediately wait for completion (convenience method)
222
222
  */
223
- search: (payload: PiperSearchRequestPayload, options?: {
224
- onPoll?: (_response: PiperSearchResponse) => unknown;
223
+ search: (payload: SearchesRequest, options?: {
224
+ onPoll?: (_response: SearchesResponse) => unknown;
225
225
  signal?: AbortSignal;
226
- }) => Promise<PiperSearchResponse>;
226
+ }) => Promise<SearchesResponse>;
227
227
  /**
228
228
  * Create a searches task but don't wait for it.
229
229
  * Use this if you want fire and forget.
230
230
  */
231
- create: (payload: PiperSearchRequestPayload) => Promise<string>;
231
+ create: (payload: SearchesRequest) => Promise<string>;
232
232
  /**
233
233
  * Check the status of a search task manually.
234
234
  */
@@ -243,6 +243,12 @@ export declare class Pipe0 {
243
243
  status: "completed" | "failed" | "pending" | "queued" | "processing" | "no_result" | "skipped";
244
244
  type?: "string" | "number" | "boolean" | "json" | "unknown";
245
245
  format?: "json_object" | "json_list" | "json_list_string" | "url" | "website_url" | "profile_url" | "email" | "datetime" | "currency" | "date" | "phone" | "markdown" | "text" | "int" | "decimal" | "address_line_1" | "zip_code" | "percent" | null;
246
+ resolved_by?: {
247
+ ref: "prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "company:funding:leadmagic@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "json:extract@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:personalemail:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "people:email:validate:zerobounce@1" | "people:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "fields:merge@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:maplinks:firecrawl@1" | "sheet:append@1" | "sheet:expandappend@1" | "company:lookalikes:companyenrich@1" | "company:match:logodev@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "input" | "system" | null;
248
+ environment: "production" | "sandbox" | null;
249
+ config_hash: string | null;
250
+ input_hash: string | null;
251
+ } | null;
246
252
  widgets?: {
247
253
  display_value?: {
248
254
  label?: string;
@@ -311,9 +317,9 @@ export declare class Pipe0 {
311
317
  * Poll until the search completes or fails.
312
318
  */
313
319
  waitUntilComplete: (runId: string | Promise<string>, options?: {
314
- onPoll?: (_response: PiperSearchResponse) => unknown;
320
+ onPoll?: (_response: SearchesResponse) => unknown;
315
321
  signal?: AbortSignal;
316
- }) => Promise<PiperSearchResponse>;
322
+ }) => Promise<SearchesResponse>;
317
323
  };
318
324
  private sleep;
319
325
  }
package/dist/pipe0.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import createFetchClient, {} from "openapi-fetch";
2
- export class PiperTimeoutError extends Error {
2
+ export class Pipe0TimeoutError extends Error {
3
3
  runId;
4
4
  constructor(message, runId) {
5
5
  super(message);
6
6
  this.runId = runId;
7
- this.name = "PiperTimeoutError";
7
+ this.name = "Pipe0TimeoutError";
8
8
  this.runId = runId;
9
9
  }
10
10
  }
@@ -13,7 +13,7 @@ export class Pipe0AbortError extends Error {
13
13
  constructor(message, runId) {
14
14
  super(message);
15
15
  this.runId = runId;
16
- this.name = "PiperAbortError";
16
+ this.name = "Pipe0AbortError";
17
17
  this.runId = runId;
18
18
  }
19
19
  }
@@ -24,7 +24,7 @@ export class Pipe0BatchError extends Error {
24
24
  super(message);
25
25
  this.errors = errors;
26
26
  this.successfulBatches = successfulBatches;
27
- this.name = "PiperBatchError";
27
+ this.name = "Pipe0BatchError";
28
28
  this.errors = errors;
29
29
  this.successfulBatches = successfulBatches;
30
30
  }
@@ -34,14 +34,14 @@ export class Pipe0TaskError extends Error {
34
34
  constructor(message, responseBody) {
35
35
  super(message);
36
36
  this.responseBody = responseBody;
37
- this.name = "PiperTaskError";
37
+ this.name = "Pipe0TaskError";
38
38
  this.responseBody = responseBody;
39
39
  }
40
40
  }
41
41
  export class Pipe0ServerError extends Error {
42
42
  constructor(message) {
43
43
  super(message);
44
- this.name = "PiperServerError";
44
+ this.name = "Pipe0ServerError";
45
45
  }
46
46
  }
47
47
  export class Pipe0 {
@@ -85,7 +85,7 @@ export class Pipe0 {
85
85
  let currentInterval = initialInterval;
86
86
  while (true) {
87
87
  if (Date.now() - startTime >= timeout) {
88
- throw new PiperTimeoutError(`${taskType} polling timed out after ${timeout}ms`, resolvedRunId);
88
+ throw new Pipe0TimeoutError(`${taskType} polling timed out after ${timeout}ms`, resolvedRunId);
89
89
  }
90
90
  if (options.signal?.aborted) {
91
91
  throw new Pipe0AbortError(`${taskType} polling was aborted`, resolvedRunId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipe0/client",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "type": "module",