@pipe0/client 0.0.5 → 0.0.6
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 +6 -0
- package/dist/generated/openapi.types.d.ts +24 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/pipe0.d.ts +21 -15
- package/dist/pipe0.js +7 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -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
|
|
1
|
+
export * from "./pipe0.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
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
|
|
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
|
|
6
|
-
export type
|
|
7
|
-
export declare class
|
|
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
|
|
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?:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
224
|
-
onPoll?: (_response:
|
|
223
|
+
search: (payload: SearchesRequest, options?: {
|
|
224
|
+
onPoll?: (_response: SearchesResponse) => unknown;
|
|
225
225
|
signal?: AbortSignal;
|
|
226
|
-
}) => Promise<
|
|
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:
|
|
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:
|
|
320
|
+
onPoll?: (_response: SearchesResponse) => unknown;
|
|
315
321
|
signal?: AbortSignal;
|
|
316
|
-
}) => Promise<
|
|
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
|
|
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 = "
|
|
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 = "
|
|
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 = "
|
|
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 = "
|
|
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 = "
|
|
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
|
|
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);
|