@stack0/sdk 0.5.11 → 0.5.12
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/dist/crawl/index.d.mts +206 -0
- package/dist/crawl/index.d.ts +206 -0
- package/dist/crawl/index.js +179 -0
- package/dist/crawl/index.js.map +1 -0
- package/dist/crawl/index.mjs +176 -0
- package/dist/crawl/index.mjs.map +1 -0
- package/dist/documents/index.d.mts +84 -0
- package/dist/documents/index.d.ts +84 -0
- package/dist/documents/index.js +144 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/documents/index.mjs +142 -0
- package/dist/documents/index.mjs.map +1 -0
- package/dist/index.d.mts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +261 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +257 -1
- package/dist/index.mjs.map +1 -1
- package/dist/map/index.d.mts +93 -0
- package/dist/map/index.d.ts +93 -0
- package/dist/map/index.js +151 -0
- package/dist/map/index.js.map +1 -0
- package/dist/map/index.mjs +148 -0
- package/dist/map/index.mjs.map +1 -0
- package/package.json +20 -2
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// src/lib/http-client.ts
|
|
2
|
+
var HttpClient = class {
|
|
3
|
+
apiKey;
|
|
4
|
+
baseUrl;
|
|
5
|
+
constructor(config) {
|
|
6
|
+
this.apiKey = config.apiKey;
|
|
7
|
+
this.baseUrl = config.baseUrl || "https://api.stack0.dev/v1";
|
|
8
|
+
}
|
|
9
|
+
getHeaders(includeContentType = true) {
|
|
10
|
+
const headers = {
|
|
11
|
+
Authorization: `Bearer ${this.apiKey}`
|
|
12
|
+
};
|
|
13
|
+
if (includeContentType) {
|
|
14
|
+
headers["Content-Type"] = "application/json";
|
|
15
|
+
}
|
|
16
|
+
return headers;
|
|
17
|
+
}
|
|
18
|
+
async request(method, path, body) {
|
|
19
|
+
const url = `${this.baseUrl}${path}`;
|
|
20
|
+
const bodyString = body === void 0 ? void 0 : JSON.stringify(body);
|
|
21
|
+
const hasBody = bodyString !== void 0;
|
|
22
|
+
try {
|
|
23
|
+
const response = await fetch(url, {
|
|
24
|
+
method,
|
|
25
|
+
headers: this.getHeaders(hasBody),
|
|
26
|
+
body: hasBody ? bodyString : void 0
|
|
27
|
+
});
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
await this.handleErrorResponse(response);
|
|
30
|
+
}
|
|
31
|
+
const data = await response.json();
|
|
32
|
+
return data;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
if (error instanceof Error && "statusCode" in error) {
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
throw this.createError("Network error", error);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async handleErrorResponse(response) {
|
|
41
|
+
let errorBody;
|
|
42
|
+
try {
|
|
43
|
+
errorBody = await response.json();
|
|
44
|
+
} catch {
|
|
45
|
+
errorBody = { message: response.statusText };
|
|
46
|
+
}
|
|
47
|
+
const error = new Error(errorBody?.message || `HTTP ${response.status}`);
|
|
48
|
+
error.statusCode = response.status;
|
|
49
|
+
error.code = errorBody?.code ?? "";
|
|
50
|
+
error.response = errorBody;
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
createError(message, cause) {
|
|
54
|
+
const error = new Error(message);
|
|
55
|
+
error.cause = cause;
|
|
56
|
+
return error;
|
|
57
|
+
}
|
|
58
|
+
async get(path) {
|
|
59
|
+
return this.request("GET", path);
|
|
60
|
+
}
|
|
61
|
+
async post(path, body) {
|
|
62
|
+
return this.request("POST", path, body);
|
|
63
|
+
}
|
|
64
|
+
async put(path, body) {
|
|
65
|
+
return this.request("PUT", path, body);
|
|
66
|
+
}
|
|
67
|
+
async delete(path) {
|
|
68
|
+
return this.request("DELETE", path);
|
|
69
|
+
}
|
|
70
|
+
async deleteWithBody(path, body) {
|
|
71
|
+
return this.request("DELETE", path, body);
|
|
72
|
+
}
|
|
73
|
+
async patch(path, body) {
|
|
74
|
+
return this.request("PATCH", path, body);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// src/documents/client.ts
|
|
79
|
+
var Documents = class {
|
|
80
|
+
http;
|
|
81
|
+
constructor(config) {
|
|
82
|
+
this.http = new HttpClient(config);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Parse a document from a URL or a previously-uploaded file URL.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const { id } = await stack0.documents.parse({
|
|
90
|
+
* url: 'https://example.com/whitepaper.pdf',
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
async parse(request) {
|
|
95
|
+
return this.http.post("/webdata/documents", request);
|
|
96
|
+
}
|
|
97
|
+
async get(request) {
|
|
98
|
+
const params = new URLSearchParams();
|
|
99
|
+
if (request.environment) params.set("environment", request.environment);
|
|
100
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
101
|
+
const q = params.toString();
|
|
102
|
+
return this.http.get(`/webdata/documents/${request.id}${q ? `?${q}` : ""}`);
|
|
103
|
+
}
|
|
104
|
+
async list(request = {}) {
|
|
105
|
+
const params = new URLSearchParams();
|
|
106
|
+
if (request.environment) params.set("environment", request.environment);
|
|
107
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
108
|
+
if (request.status) params.set("status", request.status);
|
|
109
|
+
if (request.limit) params.set("limit", String(request.limit));
|
|
110
|
+
if (request.cursor) params.set("cursor", request.cursor);
|
|
111
|
+
const q = params.toString();
|
|
112
|
+
return this.http.get(`/webdata/documents${q ? `?${q}` : ""}`);
|
|
113
|
+
}
|
|
114
|
+
async delete(request) {
|
|
115
|
+
const params = new URLSearchParams();
|
|
116
|
+
if (request.environment) params.set("environment", request.environment);
|
|
117
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
118
|
+
const q = params.toString();
|
|
119
|
+
return this.http.deleteWithBody(
|
|
120
|
+
`/webdata/documents/${request.id}${q ? `?${q}` : ""}`,
|
|
121
|
+
request
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
async parseAndWait(request, options = {}) {
|
|
125
|
+
const { pollInterval = 2e3, timeout = 18e4 } = options;
|
|
126
|
+
const { id } = await this.parse(request);
|
|
127
|
+
const start = Date.now();
|
|
128
|
+
while (Date.now() - start < timeout) {
|
|
129
|
+
const doc = await this.get({ id, environment: request.environment, projectId: request.projectId });
|
|
130
|
+
if (doc.status === "completed" || doc.status === "failed") {
|
|
131
|
+
if (doc.status === "failed") throw new Error(doc.error || "Document parsing failed");
|
|
132
|
+
return doc;
|
|
133
|
+
}
|
|
134
|
+
await new Promise((r) => setTimeout(r, pollInterval));
|
|
135
|
+
}
|
|
136
|
+
throw new Error("Document parsing timed out");
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export { Documents };
|
|
141
|
+
//# sourceMappingURL=index.mjs.map
|
|
142
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/http-client.ts","../../src/documents/client.ts"],"names":[],"mappings":";AAUO,IAAM,aAAN,MAAiB;AAAA,EACd,MAAA;AAAA,EACA,OAAA;AAAA,EAER,YAAY,MAAA,EAA0B;AACpC,IAAA,IAAA,CAAK,SAAS,MAAA,CAAO,MAAA;AACrB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAO,OAAA,IAAW,2BAAA;AAAA,EACnC;AAAA,EAEQ,UAAA,CAAW,qBAAqB,IAAA,EAA8B;AACpE,IAAA,MAAM,OAAA,GAAkC;AAAA,MACtC,aAAA,EAAe,CAAA,OAAA,EAAU,IAAA,CAAK,MAAM,CAAA;AAAA,KACtC;AACA,IAAA,IAAI,kBAAA,EAAoB;AACtB,MAAA,OAAA,CAAQ,cAAc,CAAA,GAAI,kBAAA;AAAA,IAC5B;AACA,IAAA,OAAO,OAAA;AAAA,EACT;AAAA,EAEA,MAAM,OAAA,CAAW,MAAA,EAAg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GAAA,EAAI,GAAI,KAAA,GAAQ,OAAA,EAAS;AACnC,MAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,GAAA,CAAI,EAAE,EAAA,EAAI,WAAA,EAAa,OAAA,CAAQ,WAAA,EAAa,SAAA,EAAW,OAAA,CAAQ,SAAA,EAAW,CAAA;AACjG,MAAA,IAAI,GAAA,CAAI,MAAA,KAAW,WAAA,IAAe,GAAA,CAAI,WAAW,QAAA,EAAU;AACzD,QAAA,IAAI,GAAA,CAAI,WAAW,QAAA,EAAU,MAAM,IAAI,KAAA,CAAM,GAAA,CAAI,SAAS,yBAAyB,CAAA;AACnF,QAAA,OAAO,GAAA;AAAA,MACT;AACA,MAAA,MAAM,IAAI,OAAA,CAAQ,CAAC,MAAM,UAAA,CAAW,CAAA,EAAG,YAAY,CAAC,CAAA;AAAA,IACtD;AACA,IAAA,MAAM,IAAI,MAAM,4BAA4B,CAAA;AAAA,EAC9C;AACF","file":"index.mjs","sourcesContent":["/**\n * HTTP client for Stack0 API\n * Handles authentication, request/response formatting, and error handling\n */\n\nexport interface HttpClientConfig {\n apiKey: string;\n baseUrl?: string;\n}\n\nexport class HttpClient {\n private apiKey: string;\n private baseUrl: string;\n\n constructor(config: HttpClientConfig) {\n this.apiKey = config.apiKey;\n this.baseUrl = config.baseUrl || \"https://api.stack0.dev/v1\";\n }\n\n private getHeaders(includeContentType = true): Record<string, string> {\n const headers: Record<string, string> = {\n Authorization: `Bearer ${this.apiKey}`,\n };\n if (includeContentType) {\n headers[\"Content-Type\"] = \"application/json\";\n }\n return headers;\n }\n\n async request<T>(method: string, path: string, body?: unknown): Promise<T> {\n const url = `${this.baseUrl}${path}`;\n const bodyString = body === undefined ? undefined : JSON.stringify(body);\n const hasBody = bodyString !== undefined;\n\n try {\n const response = await fetch(url, {\n method,\n headers: this.getHeaders(hasBody),\n body: hasBody ? bodyString : undefined,\n });\n\n if (!response.ok) {\n await this.handleErrorResponse(response);\n }\n\n const data = await response.json();\n return data as T;\n } catch (error) {\n if (error instanceof Error && \"statusCode\" in error) {\n throw error; // Re-throw our custom errors\n }\n throw this.createError(\"Network error\", error);\n }\n }\n\n private async handleErrorResponse(response: Response): Promise<never> {\n let errorBody: { message: string } | undefined;\n try {\n errorBody = (await response.json()) as { message: string };\n } catch {\n errorBody = { message: response.statusText };\n }\n\n const error = new Error(errorBody?.message || `HTTP ${response.status}`) as Error & {\n statusCode: number;\n code: string;\n response: unknown;\n };\n error.statusCode = response.status;\n error.code = (errorBody as unknown as { code: string } | undefined)?.code ?? \"\";\n error.response = errorBody;\n throw error;\n }\n\n private createError(message: string, cause?: unknown): Error {\n const error = new Error(message) as Error & { cause: unknown };\n error.cause = cause;\n return error;\n }\n\n async get<T>(path: string): Promise<T> {\n return this.request<T>(\"GET\", path);\n }\n\n async post<T>(path: string, body: unknown): Promise<T> {\n return this.request<T>(\"POST\", path, body);\n }\n\n async put<T>(path: string, body: unknown): Promise<T> {\n return this.request<T>(\"PUT\", path, body);\n }\n\n async delete<T>(path: string): Promise<T> {\n return this.request<T>(\"DELETE\", path);\n }\n\n async deleteWithBody<T>(path: string, body: unknown): Promise<T> {\n return this.request<T>(\"DELETE\", path, body);\n }\n\n async patch<T>(path: string, body: unknown): Promise<T> {\n return this.request<T>(\"PATCH\", path, body);\n }\n}\n","/**\n * Stack0 Documents Client\n * Parse PDF and DOCX documents into clean markdown.\n */\n\nimport { HttpClient, type HttpClientConfig } from \"../lib/http-client\";\nimport type {\n CreateDocumentRequest,\n CreateDocumentResponse,\n GetDocumentRequest,\n ListDocumentsRequest,\n ListDocumentsResponse,\n WebdataDocument,\n} from \"./types\";\n\nexport class Documents {\n private http: HttpClient;\n\n constructor(config: HttpClientConfig) {\n this.http = new HttpClient(config);\n }\n\n /**\n * Parse a document from a URL or a previously-uploaded file URL.\n *\n * @example\n * ```typescript\n * const { id } = await stack0.documents.parse({\n * url: 'https://example.com/whitepaper.pdf',\n * });\n * ```\n */\n async parse(request: CreateDocumentRequest): Promise<CreateDocumentResponse> {\n return this.http.post<CreateDocumentResponse>(\"/webdata/documents\", request);\n }\n\n async get(request: GetDocumentRequest): Promise<WebdataDocument> {\n const params = new URLSearchParams();\n if (request.environment) params.set(\"environment\", request.environment);\n if (request.projectId) params.set(\"projectId\", request.projectId);\n const q = params.toString();\n return this.http.get<WebdataDocument>(`/webdata/documents/${request.id}${q ? `?${q}` : \"\"}`);\n }\n\n async list(request: ListDocumentsRequest = {}): Promise<ListDocumentsResponse> {\n const params = new URLSearchParams();\n if (request.environment) params.set(\"environment\", request.environment);\n if (request.projectId) params.set(\"projectId\", request.projectId);\n if (request.status) params.set(\"status\", request.status);\n if (request.limit) params.set(\"limit\", String(request.limit));\n if (request.cursor) params.set(\"cursor\", request.cursor);\n const q = params.toString();\n return this.http.get<ListDocumentsResponse>(`/webdata/documents${q ? `?${q}` : \"\"}`);\n }\n\n async delete(request: GetDocumentRequest): Promise<{ success: boolean }> {\n const params = new URLSearchParams();\n if (request.environment) params.set(\"environment\", request.environment);\n if (request.projectId) params.set(\"projectId\", request.projectId);\n const q = params.toString();\n return this.http.deleteWithBody<{ success: boolean }>(\n `/webdata/documents/${request.id}${q ? `?${q}` : \"\"}`,\n request,\n );\n }\n\n async parseAndWait(\n request: CreateDocumentRequest,\n options: { pollInterval?: number; timeout?: number } = {},\n ): Promise<WebdataDocument> {\n const { pollInterval = 2000, timeout = 180_000 } = options;\n const { id } = await this.parse(request);\n const start = Date.now();\n while (Date.now() - start < timeout) {\n const doc = await this.get({ id, environment: request.environment, projectId: request.projectId });\n if (doc.status === \"completed\" || doc.status === \"failed\") {\n if (doc.status === \"failed\") throw new Error(doc.error || \"Document parsing failed\");\n return doc;\n }\n await new Promise((r) => setTimeout(r, pollInterval));\n }\n throw new Error(\"Document parsing timed out\");\n }\n}\n"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -7,6 +7,12 @@ export { BatchScreenshotJob, Clip, CreateBatchScreenshotsRequest, CreateScreensh
|
|
|
7
7
|
import { Extraction } from './extraction/index.mjs';
|
|
8
8
|
export { BatchExtractionJob, CreateBatchExtractionsRequest, CreateExtractionRequest, CreateExtractionResponse, CreateExtractionScheduleRequest, DailyUsageItem, ExtractionBatchJobsResponse, ExtractionMode, ExtractionResult, ExtractionSchedule, ExtractionSchedulesResponse, ExtractionStatus, ExtractionUsage, GetDailyUsageResponse, GetExtractionRequest, GetUsageRequest, ListExtractionsRequest, ListExtractionsResponse, PageMetadata, UpdateExtractionScheduleRequest } from './extraction/index.mjs';
|
|
9
9
|
import { Webdata } from './webdata/index.mjs';
|
|
10
|
+
import { Crawl as Crawl$ } from './crawl/index.mjs';
|
|
11
|
+
export { CancelCrawlRequest, CrawlPage, CrawlStatus, CreateCrawlRequest, CreateCrawlResponse, GetCrawlRequest, ListCrawlPagesRequest, ListCrawlPagesResponse, ListCrawlsRequest, ListCrawlsResponse, ProxyType, ScrapeAction, ScrapeActionType, ScrapeFormat, ScrapeOptions } from './crawl/index.mjs';
|
|
12
|
+
import { Map as Map$ } from './map/index.mjs';
|
|
13
|
+
export { CreateMapRequest, CreateMapResponse, GetMapRequest, ListMapsRequest, ListMapsResponse, MapStatus, WebdataMap } from './map/index.mjs';
|
|
14
|
+
import { Documents } from './documents/index.mjs';
|
|
15
|
+
export { CreateDocumentRequest, CreateDocumentResponse, DocumentStatus, GetDocumentRequest, ListDocumentsRequest, ListDocumentsResponse, WebdataDocument } from './documents/index.mjs';
|
|
10
16
|
import { H as HttpClient, a as HttpClientConfig } from './http-client-Cgie_Rv6.mjs';
|
|
11
17
|
import { E as Environment$1 } from './shared-types-CjKSP5Xc.mjs';
|
|
12
18
|
export { B as BatchJobStatus, C as CreateBatchResponse, e as CreateScheduleResponse, G as GetBatchJobRequest, c as GetScheduleRequest, L as ListBatchJobsRequest, d as ListSchedulesRequest, P as PaginatedRequest, a as PaginatedResponse, b as ScheduleFrequency, S as Stack0Error } from './shared-types-CjKSP5Xc.mjs';
|
|
@@ -2645,6 +2651,26 @@ declare class Memory {
|
|
|
2645
2651
|
* ```
|
|
2646
2652
|
*/
|
|
2647
2653
|
|
|
2654
|
+
interface Project {
|
|
2655
|
+
id: string;
|
|
2656
|
+
name: string;
|
|
2657
|
+
slug: string;
|
|
2658
|
+
description?: string | null;
|
|
2659
|
+
iconUrl?: string | null;
|
|
2660
|
+
organizationId: string;
|
|
2661
|
+
createdAt: Date | string;
|
|
2662
|
+
updatedAt?: Date | string | null;
|
|
2663
|
+
}
|
|
2664
|
+
interface CreateProjectRequest {
|
|
2665
|
+
name: string;
|
|
2666
|
+
description?: string;
|
|
2667
|
+
}
|
|
2668
|
+
interface UpdateProjectRequest {
|
|
2669
|
+
id: string;
|
|
2670
|
+
name?: string;
|
|
2671
|
+
description?: string;
|
|
2672
|
+
iconUrl?: string | null;
|
|
2673
|
+
}
|
|
2648
2674
|
interface Stack0Config extends HttpClientConfig {
|
|
2649
2675
|
apiKey: string;
|
|
2650
2676
|
baseUrl?: string;
|
|
@@ -2659,10 +2685,14 @@ interface Stack0Config extends HttpClientConfig {
|
|
|
2659
2685
|
* Provides access to all Stack0 services
|
|
2660
2686
|
*/
|
|
2661
2687
|
declare class Stack0 {
|
|
2688
|
+
private http;
|
|
2662
2689
|
mail: Mail$1;
|
|
2663
2690
|
cdn: CDN;
|
|
2664
2691
|
screenshots: Screenshots;
|
|
2665
2692
|
extraction: Extraction;
|
|
2693
|
+
crawl: Crawl$;
|
|
2694
|
+
map: Map$;
|
|
2695
|
+
documents: Documents;
|
|
2666
2696
|
integrations: Integrations;
|
|
2667
2697
|
marketing: Marketing;
|
|
2668
2698
|
workflows: Workflows;
|
|
@@ -2672,6 +2702,14 @@ declare class Stack0 {
|
|
|
2672
2702
|
*/
|
|
2673
2703
|
webdata: Webdata;
|
|
2674
2704
|
constructor(config: Stack0Config);
|
|
2705
|
+
listProjects(): Promise<Project[]>;
|
|
2706
|
+
getProject(id: string): Promise<Project>;
|
|
2707
|
+
getProjectBySlug(slug: string): Promise<Project>;
|
|
2708
|
+
createProject(request: CreateProjectRequest): Promise<Project>;
|
|
2709
|
+
updateProject(request: UpdateProjectRequest): Promise<Project>;
|
|
2710
|
+
deleteProject(id: string): Promise<{
|
|
2711
|
+
success: boolean;
|
|
2712
|
+
}>;
|
|
2675
2713
|
}
|
|
2676
2714
|
|
|
2677
|
-
export { type Agent, type AgentSettings, type AnalyticsOverviewRequest, type AnalyticsOverviewResponse, type ApprovalStatus, type ApproveContentRequest, type AssetJob, type AssetJobStatus, type AssetJobType, CDN, type Calendar, type CalendarAttendee, type CalendarEntry, type CalendarEvent, type CancelAssetJobResponse, type CancelCalendarEntryResponse, type CancelRunRequest, type Channel, type CollectionResponse, type CollectionStats, type CommunicationUser, type CompactRequest, type CompactionJob, type Company, type Connection, type Connector, type ConnectorCategory, type Contact, type Content, type ContentPerformanceItem, type ContentPerformanceRequest, type ContentPerformanceResponse, type ContentStatus, type ContentType, type CreateAgentRequest, type CreateAssetJobRequest, type CreateCalendarEventInput, type CreateCollectionRequest, type CreateCompanyInput, type CreateConnectionSessionRequest, type CreateConnectionSessionResponse, type CreateContactInput, type CreateContentRequest, type CreateDealInput, type CreateScriptRequest, type CreateScriptVersionRequest, type CreateWorkflowRequest, type CreateWorkflowResponse, type CurrentUsageResponse, type Deal, type DeleteManyRequest, type DeleteScriptResponse, type DeleteWorkflowRequest, type DiscoverTrendsRequest, type DiscoverTrendsResponse, type DismissOpportunityRequest, type EmailAttachment, type EmailLabel, type EmailMessage, type EmailThread, type Entity, type EntityRelation, type EntityType, type Environment, Extraction, type GenerateOpportunitiesRequest, type GenerateOpportunitiesResponse, type GetCurrentUsageRequest, type GetEntityParams, type GetRunRequest, type GetSettingsRequest, type GetTotalUsageRequest, type GetUsageHistoryRequest, type GetWorkflowRequest, type Address as IntegrationAddress, type ColumnType as IntegrationColumnType, type CreateDocumentInput as IntegrationCreateDocumentInput, type CreateFolderInput as IntegrationCreateFolderInput, type CreateTableRowInput as IntegrationCreateTableRowInput, type Document as IntegrationDocument, type IntegrationEmailAddress, type File as IntegrationFile, type FilePermission as IntegrationFilePermission, type IntegrationFolder, type MessageAttachment as IntegrationMessageAttachment, type MessageReaction as IntegrationMessageReaction, type PhoneNumber as IntegrationPhoneNumber, type SelectOption as IntegrationSelectOption, type SendEmailInput as IntegrationSendEmailInput, type Table as IntegrationTable, type TableColumn as IntegrationTableColumn, type TableRow as IntegrationTableRow, type UpdateDocumentInput as IntegrationUpdateDocumentInput, type UpdateTableRowInput as IntegrationUpdateTableRowInput, Integrations, type ListOptions as IntegrationsListOptions, type PaginatedResult as IntegrationsPaginatedResult, type ListAgentsParams, type ListAssetJobsRequest, type ListAssetJobsResponse, type ListCalendarEntriesRequest, type ListCalendarEntriesResponse, type ListContentRequest, type ListContentResponse, type ListEmailMessagesOptions, type ListEntitiesParams, type ListEntitiesResult, type ListEventsOptions, type ListMemoriesParams, type ListOpportunitiesRequest, type ListOpportunitiesResponse, type ListRunsRequest, type ListRunsResponse, type ListScriptsRequest, type ListScriptsResponse, type ListTrendsRequest, type ListTrendsResponse, type ListWorkflowsRequest, type ListWorkflowsResponse, Mail$1 as Mail, type MarkPublishedRequest, Marketing, type MarketingEnvironment, type MarketingSettings, type MarketingUsage, Memory, MemoryAgents, MemoryCollections, MemoryEntities, type MemoryResponse, type MemoryType, type Message, type Opportunity, type OpportunityConversionRequest, type OpportunityConversionResponse, type PassthroughRequest, type Provider, type RecallRequest, type RecallResult, type RecordUsageRequest, type RejectContentRequest, type ResponseFormat, type RetryAssetJobResponse, type RetryConfig, type RunStatus, type RunWorkflowRequest, type RunWorkflowResponse, type ScheduleContentRequest, Screenshots, type Script, type ScriptSlide, type SearchRequest, type SearchResult, type SendMessageInput, Stack0, type Stack0Config, type StepConfig, type StepDefinition, type StepRunStatus, type StepState, type StepType, type StoreBatchRequest, type StoreMemoryRequest, type TotalUsageResponse, type Trend, type TrendAnalyticsRequest, type TrendAnalyticsResponse, type TrendStatus, type UpdateAgentRequest, type UpdateAssetJobStatusRequest, type UpdateCalendarEntryRequest, type UpdateCalendarEventInput, type UpdateCollectionRequest, type UpdateCompanyInput, type UpdateContactInput, type UpdateContentRequest, type UpdateDealInput, type UpdateMemoryRequest, type UpdateScriptRequest, type UpdateSettingsRequest, type UpdateSettingsResponse, type UpdateTrendStatusRequest, type UpdateTrendStatusResponse, type UpdateWorkflowRequest, type UploadFileInput, type UsageHistoryResponse, type VariableDefinition, Webdata, type WebhookConfig, type Workflow, type WorkflowRun, Workflows, Stack0 as default };
|
|
2715
|
+
export { type Agent, type AgentSettings, type AnalyticsOverviewRequest, type AnalyticsOverviewResponse, type ApprovalStatus, type ApproveContentRequest, type AssetJob, type AssetJobStatus, type AssetJobType, CDN, type Calendar, type CalendarAttendee, type CalendarEntry, type CalendarEvent, type CancelAssetJobResponse, type CancelCalendarEntryResponse, type CancelRunRequest, type Channel, type CollectionResponse, type CollectionStats, type CommunicationUser, type CompactRequest, type CompactionJob, type Company, type Connection, type Connector, type ConnectorCategory, type Contact, type Content, type ContentPerformanceItem, type ContentPerformanceRequest, type ContentPerformanceResponse, type ContentStatus, type ContentType, Crawl$ as Crawl, Crawl$, type CreateAgentRequest, type CreateAssetJobRequest, type CreateCalendarEventInput, type CreateCollectionRequest, type CreateCompanyInput, type CreateConnectionSessionRequest, type CreateConnectionSessionResponse, type CreateContactInput, type CreateContentRequest, type CreateDealInput, type CreateProjectRequest, type CreateScriptRequest, type CreateScriptVersionRequest, type CreateWorkflowRequest, type CreateWorkflowResponse, type CurrentUsageResponse, type Deal, type DeleteManyRequest, type DeleteScriptResponse, type DeleteWorkflowRequest, type DiscoverTrendsRequest, type DiscoverTrendsResponse, type DismissOpportunityRequest, Documents, type EmailAttachment, type EmailLabel, type EmailMessage, type EmailThread, type Entity, type EntityRelation, type EntityType, type Environment, Extraction, type GenerateOpportunitiesRequest, type GenerateOpportunitiesResponse, type GetCurrentUsageRequest, type GetEntityParams, type GetRunRequest, type GetSettingsRequest, type GetTotalUsageRequest, type GetUsageHistoryRequest, type GetWorkflowRequest, type Address as IntegrationAddress, type ColumnType as IntegrationColumnType, type CreateDocumentInput as IntegrationCreateDocumentInput, type CreateFolderInput as IntegrationCreateFolderInput, type CreateTableRowInput as IntegrationCreateTableRowInput, type Document as IntegrationDocument, type IntegrationEmailAddress, type File as IntegrationFile, type FilePermission as IntegrationFilePermission, type IntegrationFolder, type MessageAttachment as IntegrationMessageAttachment, type MessageReaction as IntegrationMessageReaction, type PhoneNumber as IntegrationPhoneNumber, type SelectOption as IntegrationSelectOption, type SendEmailInput as IntegrationSendEmailInput, type Table as IntegrationTable, type TableColumn as IntegrationTableColumn, type TableRow as IntegrationTableRow, type UpdateDocumentInput as IntegrationUpdateDocumentInput, type UpdateTableRowInput as IntegrationUpdateTableRowInput, Integrations, type ListOptions as IntegrationsListOptions, type PaginatedResult as IntegrationsPaginatedResult, type ListAgentsParams, type ListAssetJobsRequest, type ListAssetJobsResponse, type ListCalendarEntriesRequest, type ListCalendarEntriesResponse, type ListContentRequest, type ListContentResponse, type ListEmailMessagesOptions, type ListEntitiesParams, type ListEntitiesResult, type ListEventsOptions, type ListMemoriesParams, type ListOpportunitiesRequest, type ListOpportunitiesResponse, type ListRunsRequest, type ListRunsResponse, type ListScriptsRequest, type ListScriptsResponse, type ListTrendsRequest, type ListTrendsResponse, type ListWorkflowsRequest, type ListWorkflowsResponse, Mail$1 as Mail, Map$ as Map, Map$, type MarkPublishedRequest, Marketing, type MarketingEnvironment, type MarketingSettings, type MarketingUsage, Memory, MemoryAgents, MemoryCollections, MemoryEntities, type MemoryResponse, type MemoryType, type Message, type Opportunity, type OpportunityConversionRequest, type OpportunityConversionResponse, type PassthroughRequest, type Project, type Provider, type RecallRequest, type RecallResult, type RecordUsageRequest, type RejectContentRequest, type ResponseFormat, type RetryAssetJobResponse, type RetryConfig, type RunStatus, type RunWorkflowRequest, type RunWorkflowResponse, type ScheduleContentRequest, Screenshots, type Script, type ScriptSlide, type SearchRequest, type SearchResult, type SendMessageInput, Stack0, type Stack0Config, type StepConfig, type StepDefinition, type StepRunStatus, type StepState, type StepType, type StoreBatchRequest, type StoreMemoryRequest, type TotalUsageResponse, type Trend, type TrendAnalyticsRequest, type TrendAnalyticsResponse, type TrendStatus, type UpdateAgentRequest, type UpdateAssetJobStatusRequest, type UpdateCalendarEntryRequest, type UpdateCalendarEventInput, type UpdateCollectionRequest, type UpdateCompanyInput, type UpdateContactInput, type UpdateContentRequest, type UpdateDealInput, type UpdateMemoryRequest, type UpdateProjectRequest, type UpdateScriptRequest, type UpdateSettingsRequest, type UpdateSettingsResponse, type UpdateTrendStatusRequest, type UpdateTrendStatusResponse, type UpdateWorkflowRequest, type UploadFileInput, type UsageHistoryResponse, type VariableDefinition, Webdata, type WebhookConfig, type Workflow, type WorkflowRun, Workflows, Stack0 as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,12 @@ export { BatchScreenshotJob, Clip, CreateBatchScreenshotsRequest, CreateScreensh
|
|
|
7
7
|
import { Extraction } from './extraction/index.js';
|
|
8
8
|
export { BatchExtractionJob, CreateBatchExtractionsRequest, CreateExtractionRequest, CreateExtractionResponse, CreateExtractionScheduleRequest, DailyUsageItem, ExtractionBatchJobsResponse, ExtractionMode, ExtractionResult, ExtractionSchedule, ExtractionSchedulesResponse, ExtractionStatus, ExtractionUsage, GetDailyUsageResponse, GetExtractionRequest, GetUsageRequest, ListExtractionsRequest, ListExtractionsResponse, PageMetadata, UpdateExtractionScheduleRequest } from './extraction/index.js';
|
|
9
9
|
import { Webdata } from './webdata/index.js';
|
|
10
|
+
import { Crawl as Crawl$ } from './crawl/index.js';
|
|
11
|
+
export { CancelCrawlRequest, CrawlPage, CrawlStatus, CreateCrawlRequest, CreateCrawlResponse, GetCrawlRequest, ListCrawlPagesRequest, ListCrawlPagesResponse, ListCrawlsRequest, ListCrawlsResponse, ProxyType, ScrapeAction, ScrapeActionType, ScrapeFormat, ScrapeOptions } from './crawl/index.js';
|
|
12
|
+
import { Map as Map$ } from './map/index.js';
|
|
13
|
+
export { CreateMapRequest, CreateMapResponse, GetMapRequest, ListMapsRequest, ListMapsResponse, MapStatus, WebdataMap } from './map/index.js';
|
|
14
|
+
import { Documents } from './documents/index.js';
|
|
15
|
+
export { CreateDocumentRequest, CreateDocumentResponse, DocumentStatus, GetDocumentRequest, ListDocumentsRequest, ListDocumentsResponse, WebdataDocument } from './documents/index.js';
|
|
10
16
|
import { H as HttpClient, a as HttpClientConfig } from './http-client-Cgie_Rv6.js';
|
|
11
17
|
import { E as Environment$1 } from './shared-types-CjKSP5Xc.js';
|
|
12
18
|
export { B as BatchJobStatus, C as CreateBatchResponse, e as CreateScheduleResponse, G as GetBatchJobRequest, c as GetScheduleRequest, L as ListBatchJobsRequest, d as ListSchedulesRequest, P as PaginatedRequest, a as PaginatedResponse, b as ScheduleFrequency, S as Stack0Error } from './shared-types-CjKSP5Xc.js';
|
|
@@ -2645,6 +2651,26 @@ declare class Memory {
|
|
|
2645
2651
|
* ```
|
|
2646
2652
|
*/
|
|
2647
2653
|
|
|
2654
|
+
interface Project {
|
|
2655
|
+
id: string;
|
|
2656
|
+
name: string;
|
|
2657
|
+
slug: string;
|
|
2658
|
+
description?: string | null;
|
|
2659
|
+
iconUrl?: string | null;
|
|
2660
|
+
organizationId: string;
|
|
2661
|
+
createdAt: Date | string;
|
|
2662
|
+
updatedAt?: Date | string | null;
|
|
2663
|
+
}
|
|
2664
|
+
interface CreateProjectRequest {
|
|
2665
|
+
name: string;
|
|
2666
|
+
description?: string;
|
|
2667
|
+
}
|
|
2668
|
+
interface UpdateProjectRequest {
|
|
2669
|
+
id: string;
|
|
2670
|
+
name?: string;
|
|
2671
|
+
description?: string;
|
|
2672
|
+
iconUrl?: string | null;
|
|
2673
|
+
}
|
|
2648
2674
|
interface Stack0Config extends HttpClientConfig {
|
|
2649
2675
|
apiKey: string;
|
|
2650
2676
|
baseUrl?: string;
|
|
@@ -2659,10 +2685,14 @@ interface Stack0Config extends HttpClientConfig {
|
|
|
2659
2685
|
* Provides access to all Stack0 services
|
|
2660
2686
|
*/
|
|
2661
2687
|
declare class Stack0 {
|
|
2688
|
+
private http;
|
|
2662
2689
|
mail: Mail$1;
|
|
2663
2690
|
cdn: CDN;
|
|
2664
2691
|
screenshots: Screenshots;
|
|
2665
2692
|
extraction: Extraction;
|
|
2693
|
+
crawl: Crawl$;
|
|
2694
|
+
map: Map$;
|
|
2695
|
+
documents: Documents;
|
|
2666
2696
|
integrations: Integrations;
|
|
2667
2697
|
marketing: Marketing;
|
|
2668
2698
|
workflows: Workflows;
|
|
@@ -2672,6 +2702,14 @@ declare class Stack0 {
|
|
|
2672
2702
|
*/
|
|
2673
2703
|
webdata: Webdata;
|
|
2674
2704
|
constructor(config: Stack0Config);
|
|
2705
|
+
listProjects(): Promise<Project[]>;
|
|
2706
|
+
getProject(id: string): Promise<Project>;
|
|
2707
|
+
getProjectBySlug(slug: string): Promise<Project>;
|
|
2708
|
+
createProject(request: CreateProjectRequest): Promise<Project>;
|
|
2709
|
+
updateProject(request: UpdateProjectRequest): Promise<Project>;
|
|
2710
|
+
deleteProject(id: string): Promise<{
|
|
2711
|
+
success: boolean;
|
|
2712
|
+
}>;
|
|
2675
2713
|
}
|
|
2676
2714
|
|
|
2677
|
-
export { type Agent, type AgentSettings, type AnalyticsOverviewRequest, type AnalyticsOverviewResponse, type ApprovalStatus, type ApproveContentRequest, type AssetJob, type AssetJobStatus, type AssetJobType, CDN, type Calendar, type CalendarAttendee, type CalendarEntry, type CalendarEvent, type CancelAssetJobResponse, type CancelCalendarEntryResponse, type CancelRunRequest, type Channel, type CollectionResponse, type CollectionStats, type CommunicationUser, type CompactRequest, type CompactionJob, type Company, type Connection, type Connector, type ConnectorCategory, type Contact, type Content, type ContentPerformanceItem, type ContentPerformanceRequest, type ContentPerformanceResponse, type ContentStatus, type ContentType, type CreateAgentRequest, type CreateAssetJobRequest, type CreateCalendarEventInput, type CreateCollectionRequest, type CreateCompanyInput, type CreateConnectionSessionRequest, type CreateConnectionSessionResponse, type CreateContactInput, type CreateContentRequest, type CreateDealInput, type CreateScriptRequest, type CreateScriptVersionRequest, type CreateWorkflowRequest, type CreateWorkflowResponse, type CurrentUsageResponse, type Deal, type DeleteManyRequest, type DeleteScriptResponse, type DeleteWorkflowRequest, type DiscoverTrendsRequest, type DiscoverTrendsResponse, type DismissOpportunityRequest, type EmailAttachment, type EmailLabel, type EmailMessage, type EmailThread, type Entity, type EntityRelation, type EntityType, type Environment, Extraction, type GenerateOpportunitiesRequest, type GenerateOpportunitiesResponse, type GetCurrentUsageRequest, type GetEntityParams, type GetRunRequest, type GetSettingsRequest, type GetTotalUsageRequest, type GetUsageHistoryRequest, type GetWorkflowRequest, type Address as IntegrationAddress, type ColumnType as IntegrationColumnType, type CreateDocumentInput as IntegrationCreateDocumentInput, type CreateFolderInput as IntegrationCreateFolderInput, type CreateTableRowInput as IntegrationCreateTableRowInput, type Document as IntegrationDocument, type IntegrationEmailAddress, type File as IntegrationFile, type FilePermission as IntegrationFilePermission, type IntegrationFolder, type MessageAttachment as IntegrationMessageAttachment, type MessageReaction as IntegrationMessageReaction, type PhoneNumber as IntegrationPhoneNumber, type SelectOption as IntegrationSelectOption, type SendEmailInput as IntegrationSendEmailInput, type Table as IntegrationTable, type TableColumn as IntegrationTableColumn, type TableRow as IntegrationTableRow, type UpdateDocumentInput as IntegrationUpdateDocumentInput, type UpdateTableRowInput as IntegrationUpdateTableRowInput, Integrations, type ListOptions as IntegrationsListOptions, type PaginatedResult as IntegrationsPaginatedResult, type ListAgentsParams, type ListAssetJobsRequest, type ListAssetJobsResponse, type ListCalendarEntriesRequest, type ListCalendarEntriesResponse, type ListContentRequest, type ListContentResponse, type ListEmailMessagesOptions, type ListEntitiesParams, type ListEntitiesResult, type ListEventsOptions, type ListMemoriesParams, type ListOpportunitiesRequest, type ListOpportunitiesResponse, type ListRunsRequest, type ListRunsResponse, type ListScriptsRequest, type ListScriptsResponse, type ListTrendsRequest, type ListTrendsResponse, type ListWorkflowsRequest, type ListWorkflowsResponse, Mail$1 as Mail, type MarkPublishedRequest, Marketing, type MarketingEnvironment, type MarketingSettings, type MarketingUsage, Memory, MemoryAgents, MemoryCollections, MemoryEntities, type MemoryResponse, type MemoryType, type Message, type Opportunity, type OpportunityConversionRequest, type OpportunityConversionResponse, type PassthroughRequest, type Provider, type RecallRequest, type RecallResult, type RecordUsageRequest, type RejectContentRequest, type ResponseFormat, type RetryAssetJobResponse, type RetryConfig, type RunStatus, type RunWorkflowRequest, type RunWorkflowResponse, type ScheduleContentRequest, Screenshots, type Script, type ScriptSlide, type SearchRequest, type SearchResult, type SendMessageInput, Stack0, type Stack0Config, type StepConfig, type StepDefinition, type StepRunStatus, type StepState, type StepType, type StoreBatchRequest, type StoreMemoryRequest, type TotalUsageResponse, type Trend, type TrendAnalyticsRequest, type TrendAnalyticsResponse, type TrendStatus, type UpdateAgentRequest, type UpdateAssetJobStatusRequest, type UpdateCalendarEntryRequest, type UpdateCalendarEventInput, type UpdateCollectionRequest, type UpdateCompanyInput, type UpdateContactInput, type UpdateContentRequest, type UpdateDealInput, type UpdateMemoryRequest, type UpdateScriptRequest, type UpdateSettingsRequest, type UpdateSettingsResponse, type UpdateTrendStatusRequest, type UpdateTrendStatusResponse, type UpdateWorkflowRequest, type UploadFileInput, type UsageHistoryResponse, type VariableDefinition, Webdata, type WebhookConfig, type Workflow, type WorkflowRun, Workflows, Stack0 as default };
|
|
2715
|
+
export { type Agent, type AgentSettings, type AnalyticsOverviewRequest, type AnalyticsOverviewResponse, type ApprovalStatus, type ApproveContentRequest, type AssetJob, type AssetJobStatus, type AssetJobType, CDN, type Calendar, type CalendarAttendee, type CalendarEntry, type CalendarEvent, type CancelAssetJobResponse, type CancelCalendarEntryResponse, type CancelRunRequest, type Channel, type CollectionResponse, type CollectionStats, type CommunicationUser, type CompactRequest, type CompactionJob, type Company, type Connection, type Connector, type ConnectorCategory, type Contact, type Content, type ContentPerformanceItem, type ContentPerformanceRequest, type ContentPerformanceResponse, type ContentStatus, type ContentType, Crawl$ as Crawl, Crawl$, type CreateAgentRequest, type CreateAssetJobRequest, type CreateCalendarEventInput, type CreateCollectionRequest, type CreateCompanyInput, type CreateConnectionSessionRequest, type CreateConnectionSessionResponse, type CreateContactInput, type CreateContentRequest, type CreateDealInput, type CreateProjectRequest, type CreateScriptRequest, type CreateScriptVersionRequest, type CreateWorkflowRequest, type CreateWorkflowResponse, type CurrentUsageResponse, type Deal, type DeleteManyRequest, type DeleteScriptResponse, type DeleteWorkflowRequest, type DiscoverTrendsRequest, type DiscoverTrendsResponse, type DismissOpportunityRequest, Documents, type EmailAttachment, type EmailLabel, type EmailMessage, type EmailThread, type Entity, type EntityRelation, type EntityType, type Environment, Extraction, type GenerateOpportunitiesRequest, type GenerateOpportunitiesResponse, type GetCurrentUsageRequest, type GetEntityParams, type GetRunRequest, type GetSettingsRequest, type GetTotalUsageRequest, type GetUsageHistoryRequest, type GetWorkflowRequest, type Address as IntegrationAddress, type ColumnType as IntegrationColumnType, type CreateDocumentInput as IntegrationCreateDocumentInput, type CreateFolderInput as IntegrationCreateFolderInput, type CreateTableRowInput as IntegrationCreateTableRowInput, type Document as IntegrationDocument, type IntegrationEmailAddress, type File as IntegrationFile, type FilePermission as IntegrationFilePermission, type IntegrationFolder, type MessageAttachment as IntegrationMessageAttachment, type MessageReaction as IntegrationMessageReaction, type PhoneNumber as IntegrationPhoneNumber, type SelectOption as IntegrationSelectOption, type SendEmailInput as IntegrationSendEmailInput, type Table as IntegrationTable, type TableColumn as IntegrationTableColumn, type TableRow as IntegrationTableRow, type UpdateDocumentInput as IntegrationUpdateDocumentInput, type UpdateTableRowInput as IntegrationUpdateTableRowInput, Integrations, type ListOptions as IntegrationsListOptions, type PaginatedResult as IntegrationsPaginatedResult, type ListAgentsParams, type ListAssetJobsRequest, type ListAssetJobsResponse, type ListCalendarEntriesRequest, type ListCalendarEntriesResponse, type ListContentRequest, type ListContentResponse, type ListEmailMessagesOptions, type ListEntitiesParams, type ListEntitiesResult, type ListEventsOptions, type ListMemoriesParams, type ListOpportunitiesRequest, type ListOpportunitiesResponse, type ListRunsRequest, type ListRunsResponse, type ListScriptsRequest, type ListScriptsResponse, type ListTrendsRequest, type ListTrendsResponse, type ListWorkflowsRequest, type ListWorkflowsResponse, Mail$1 as Mail, Map$ as Map, Map$, type MarkPublishedRequest, Marketing, type MarketingEnvironment, type MarketingSettings, type MarketingUsage, Memory, MemoryAgents, MemoryCollections, MemoryEntities, type MemoryResponse, type MemoryType, type Message, type Opportunity, type OpportunityConversionRequest, type OpportunityConversionResponse, type PassthroughRequest, type Project, type Provider, type RecallRequest, type RecallResult, type RecordUsageRequest, type RejectContentRequest, type ResponseFormat, type RetryAssetJobResponse, type RetryConfig, type RunStatus, type RunWorkflowRequest, type RunWorkflowResponse, type ScheduleContentRequest, Screenshots, type Script, type ScriptSlide, type SearchRequest, type SearchResult, type SendMessageInput, Stack0, type Stack0Config, type StepConfig, type StepDefinition, type StepRunStatus, type StepState, type StepType, type StoreBatchRequest, type StoreMemoryRequest, type TotalUsageResponse, type Trend, type TrendAnalyticsRequest, type TrendAnalyticsResponse, type TrendStatus, type UpdateAgentRequest, type UpdateAssetJobStatusRequest, type UpdateCalendarEntryRequest, type UpdateCalendarEventInput, type UpdateCollectionRequest, type UpdateCompanyInput, type UpdateContactInput, type UpdateContentRequest, type UpdateDealInput, type UpdateMemoryRequest, type UpdateProjectRequest, type UpdateScriptRequest, type UpdateSettingsRequest, type UpdateSettingsResponse, type UpdateTrendStatusRequest, type UpdateTrendStatusResponse, type UpdateWorkflowRequest, type UploadFileInput, type UsageHistoryResponse, type VariableDefinition, Webdata, type WebhookConfig, type Workflow, type WorkflowRun, Workflows, Stack0 as default };
|
package/dist/index.js
CHANGED
|
@@ -3669,6 +3669,232 @@ var Webdata = class {
|
|
|
3669
3669
|
}
|
|
3670
3670
|
};
|
|
3671
3671
|
|
|
3672
|
+
// src/crawl/client.ts
|
|
3673
|
+
var Crawl$ = class {
|
|
3674
|
+
http;
|
|
3675
|
+
constructor(config) {
|
|
3676
|
+
this.http = new HttpClient(config);
|
|
3677
|
+
}
|
|
3678
|
+
/**
|
|
3679
|
+
* Start a crawl.
|
|
3680
|
+
*
|
|
3681
|
+
* @example
|
|
3682
|
+
* ```typescript
|
|
3683
|
+
* const { id } = await stack0.crawl.start({
|
|
3684
|
+
* url: 'https://docs.example.com',
|
|
3685
|
+
* maxDepth: 3,
|
|
3686
|
+
* maxPages: 200,
|
|
3687
|
+
* formats: ['markdown', 'links'],
|
|
3688
|
+
* });
|
|
3689
|
+
* ```
|
|
3690
|
+
*/
|
|
3691
|
+
async start(request) {
|
|
3692
|
+
return this.http.post("/webdata/crawl", request);
|
|
3693
|
+
}
|
|
3694
|
+
/**
|
|
3695
|
+
* Get a crawl by ID. Pass `includePages: true` to include the scraped pages.
|
|
3696
|
+
*/
|
|
3697
|
+
async get(request) {
|
|
3698
|
+
const params = new URLSearchParams();
|
|
3699
|
+
if (request.environment) params.set("environment", request.environment);
|
|
3700
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
3701
|
+
if (request.includePages) params.set("includePages", "true");
|
|
3702
|
+
const query = params.toString();
|
|
3703
|
+
return this.http.get(`/webdata/crawl/${request.id}${query ? `?${query}` : ""}`);
|
|
3704
|
+
}
|
|
3705
|
+
async list(request = {}) {
|
|
3706
|
+
const params = new URLSearchParams();
|
|
3707
|
+
if (request.environment) params.set("environment", request.environment);
|
|
3708
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
3709
|
+
if (request.status) params.set("status", request.status);
|
|
3710
|
+
if (request.url) params.set("url", request.url);
|
|
3711
|
+
if (request.limit) params.set("limit", String(request.limit));
|
|
3712
|
+
if (request.cursor) params.set("cursor", request.cursor);
|
|
3713
|
+
const query = params.toString();
|
|
3714
|
+
return this.http.get(`/webdata/crawl${query ? `?${query}` : ""}`);
|
|
3715
|
+
}
|
|
3716
|
+
async listPages(request) {
|
|
3717
|
+
const params = new URLSearchParams();
|
|
3718
|
+
if (request.environment) params.set("environment", request.environment);
|
|
3719
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
3720
|
+
if (request.limit) params.set("limit", String(request.limit));
|
|
3721
|
+
if (request.cursor) params.set("cursor", request.cursor);
|
|
3722
|
+
const query = params.toString();
|
|
3723
|
+
return this.http.get(
|
|
3724
|
+
`/webdata/crawl/${request.crawlId}/pages${query ? `?${query}` : ""}`
|
|
3725
|
+
);
|
|
3726
|
+
}
|
|
3727
|
+
async cancel(request) {
|
|
3728
|
+
return this.http.post(`/webdata/crawl/${request.id}/cancel`, {
|
|
3729
|
+
environment: request.environment,
|
|
3730
|
+
projectId: request.projectId
|
|
3731
|
+
});
|
|
3732
|
+
}
|
|
3733
|
+
async delete(request) {
|
|
3734
|
+
const params = new URLSearchParams();
|
|
3735
|
+
if (request.environment) params.set("environment", request.environment);
|
|
3736
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
3737
|
+
const query = params.toString();
|
|
3738
|
+
return this.http.deleteWithBody(
|
|
3739
|
+
`/webdata/crawl/${request.id}${query ? `?${query}` : ""}`,
|
|
3740
|
+
request
|
|
3741
|
+
);
|
|
3742
|
+
}
|
|
3743
|
+
/**
|
|
3744
|
+
* Start a crawl and poll until it completes. Returns the full Crawl record
|
|
3745
|
+
* with pages included.
|
|
3746
|
+
*/
|
|
3747
|
+
async startAndWait(request, options = {}) {
|
|
3748
|
+
const { pollInterval = 2e3, timeout = 6e5, includePages = true } = options;
|
|
3749
|
+
const { id } = await this.start(request);
|
|
3750
|
+
const start = Date.now();
|
|
3751
|
+
while (Date.now() - start < timeout) {
|
|
3752
|
+
const crawl = await this.get({
|
|
3753
|
+
id,
|
|
3754
|
+
environment: request.environment,
|
|
3755
|
+
projectId: request.projectId,
|
|
3756
|
+
includePages
|
|
3757
|
+
});
|
|
3758
|
+
if (crawl.status === "completed" || crawl.status === "failed" || crawl.status === "cancelled") {
|
|
3759
|
+
if (crawl.status === "failed") throw new Error(crawl.error || "Crawl failed");
|
|
3760
|
+
return crawl;
|
|
3761
|
+
}
|
|
3762
|
+
await new Promise((r) => setTimeout(r, pollInterval));
|
|
3763
|
+
}
|
|
3764
|
+
throw new Error("Crawl timed out");
|
|
3765
|
+
}
|
|
3766
|
+
};
|
|
3767
|
+
|
|
3768
|
+
// src/map/client.ts
|
|
3769
|
+
var Map$ = class {
|
|
3770
|
+
http;
|
|
3771
|
+
constructor(config) {
|
|
3772
|
+
this.http = new HttpClient(config);
|
|
3773
|
+
}
|
|
3774
|
+
/**
|
|
3775
|
+
* Start a map job.
|
|
3776
|
+
*
|
|
3777
|
+
* @example
|
|
3778
|
+
* ```typescript
|
|
3779
|
+
* const { id } = await stack0.map.create({
|
|
3780
|
+
* url: 'https://docs.example.com',
|
|
3781
|
+
* search: 'api',
|
|
3782
|
+
* limit: 1000,
|
|
3783
|
+
* });
|
|
3784
|
+
* ```
|
|
3785
|
+
*/
|
|
3786
|
+
async create(request) {
|
|
3787
|
+
return this.http.post("/webdata/map", request);
|
|
3788
|
+
}
|
|
3789
|
+
async get(request) {
|
|
3790
|
+
const params = new URLSearchParams();
|
|
3791
|
+
if (request.environment) params.set("environment", request.environment);
|
|
3792
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
3793
|
+
const query = params.toString();
|
|
3794
|
+
return this.http.get(`/webdata/map/${request.id}${query ? `?${query}` : ""}`);
|
|
3795
|
+
}
|
|
3796
|
+
async list(request = {}) {
|
|
3797
|
+
const params = new URLSearchParams();
|
|
3798
|
+
if (request.environment) params.set("environment", request.environment);
|
|
3799
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
3800
|
+
if (request.status) params.set("status", request.status);
|
|
3801
|
+
if (request.limit) params.set("limit", String(request.limit));
|
|
3802
|
+
if (request.cursor) params.set("cursor", request.cursor);
|
|
3803
|
+
const query = params.toString();
|
|
3804
|
+
return this.http.get(`/webdata/map${query ? `?${query}` : ""}`);
|
|
3805
|
+
}
|
|
3806
|
+
async delete(request) {
|
|
3807
|
+
const params = new URLSearchParams();
|
|
3808
|
+
if (request.environment) params.set("environment", request.environment);
|
|
3809
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
3810
|
+
const query = params.toString();
|
|
3811
|
+
return this.http.deleteWithBody(
|
|
3812
|
+
`/webdata/map/${request.id}${query ? `?${query}` : ""}`,
|
|
3813
|
+
request
|
|
3814
|
+
);
|
|
3815
|
+
}
|
|
3816
|
+
/**
|
|
3817
|
+
* Create a map job and poll until it completes. Maps usually finish in
|
|
3818
|
+
* seconds, so default timeout is generous.
|
|
3819
|
+
*/
|
|
3820
|
+
async createAndWait(request, options = {}) {
|
|
3821
|
+
const { pollInterval = 1e3, timeout = 12e4 } = options;
|
|
3822
|
+
const { id } = await this.create(request);
|
|
3823
|
+
const start = Date.now();
|
|
3824
|
+
while (Date.now() - start < timeout) {
|
|
3825
|
+
const result = await this.get({ id, environment: request.environment, projectId: request.projectId });
|
|
3826
|
+
if (result.status === "completed" || result.status === "failed") {
|
|
3827
|
+
if (result.status === "failed") throw new Error(result.error || "Map failed");
|
|
3828
|
+
return result;
|
|
3829
|
+
}
|
|
3830
|
+
await new Promise((r) => setTimeout(r, pollInterval));
|
|
3831
|
+
}
|
|
3832
|
+
throw new Error("Map timed out");
|
|
3833
|
+
}
|
|
3834
|
+
};
|
|
3835
|
+
|
|
3836
|
+
// src/documents/client.ts
|
|
3837
|
+
var Documents = class {
|
|
3838
|
+
http;
|
|
3839
|
+
constructor(config) {
|
|
3840
|
+
this.http = new HttpClient(config);
|
|
3841
|
+
}
|
|
3842
|
+
/**
|
|
3843
|
+
* Parse a document from a URL or a previously-uploaded file URL.
|
|
3844
|
+
*
|
|
3845
|
+
* @example
|
|
3846
|
+
* ```typescript
|
|
3847
|
+
* const { id } = await stack0.documents.parse({
|
|
3848
|
+
* url: 'https://example.com/whitepaper.pdf',
|
|
3849
|
+
* });
|
|
3850
|
+
* ```
|
|
3851
|
+
*/
|
|
3852
|
+
async parse(request) {
|
|
3853
|
+
return this.http.post("/webdata/documents", request);
|
|
3854
|
+
}
|
|
3855
|
+
async get(request) {
|
|
3856
|
+
const params = new URLSearchParams();
|
|
3857
|
+
if (request.environment) params.set("environment", request.environment);
|
|
3858
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
3859
|
+
const q = params.toString();
|
|
3860
|
+
return this.http.get(`/webdata/documents/${request.id}${q ? `?${q}` : ""}`);
|
|
3861
|
+
}
|
|
3862
|
+
async list(request = {}) {
|
|
3863
|
+
const params = new URLSearchParams();
|
|
3864
|
+
if (request.environment) params.set("environment", request.environment);
|
|
3865
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
3866
|
+
if (request.status) params.set("status", request.status);
|
|
3867
|
+
if (request.limit) params.set("limit", String(request.limit));
|
|
3868
|
+
if (request.cursor) params.set("cursor", request.cursor);
|
|
3869
|
+
const q = params.toString();
|
|
3870
|
+
return this.http.get(`/webdata/documents${q ? `?${q}` : ""}`);
|
|
3871
|
+
}
|
|
3872
|
+
async delete(request) {
|
|
3873
|
+
const params = new URLSearchParams();
|
|
3874
|
+
if (request.environment) params.set("environment", request.environment);
|
|
3875
|
+
if (request.projectId) params.set("projectId", request.projectId);
|
|
3876
|
+
const q = params.toString();
|
|
3877
|
+
return this.http.deleteWithBody(
|
|
3878
|
+
`/webdata/documents/${request.id}${q ? `?${q}` : ""}`,
|
|
3879
|
+
request
|
|
3880
|
+
);
|
|
3881
|
+
}
|
|
3882
|
+
async parseAndWait(request, options = {}) {
|
|
3883
|
+
const { pollInterval = 2e3, timeout = 18e4 } = options;
|
|
3884
|
+
const { id } = await this.parse(request);
|
|
3885
|
+
const start = Date.now();
|
|
3886
|
+
while (Date.now() - start < timeout) {
|
|
3887
|
+
const doc = await this.get({ id, environment: request.environment, projectId: request.projectId });
|
|
3888
|
+
if (doc.status === "completed" || doc.status === "failed") {
|
|
3889
|
+
if (doc.status === "failed") throw new Error(doc.error || "Document parsing failed");
|
|
3890
|
+
return doc;
|
|
3891
|
+
}
|
|
3892
|
+
await new Promise((r) => setTimeout(r, pollInterval));
|
|
3893
|
+
}
|
|
3894
|
+
throw new Error("Document parsing timed out");
|
|
3895
|
+
}
|
|
3896
|
+
};
|
|
3897
|
+
|
|
3672
3898
|
// src/integrations/client.ts
|
|
3673
3899
|
var CRM = class {
|
|
3674
3900
|
http;
|
|
@@ -5540,10 +5766,14 @@ var Memory = class {
|
|
|
5540
5766
|
|
|
5541
5767
|
// src/index.ts
|
|
5542
5768
|
var Stack0 = class {
|
|
5769
|
+
http;
|
|
5543
5770
|
mail;
|
|
5544
5771
|
cdn;
|
|
5545
5772
|
screenshots;
|
|
5546
5773
|
extraction;
|
|
5774
|
+
crawl;
|
|
5775
|
+
map;
|
|
5776
|
+
documents;
|
|
5547
5777
|
integrations;
|
|
5548
5778
|
marketing;
|
|
5549
5779
|
workflows;
|
|
@@ -5557,16 +5787,42 @@ var Stack0 = class {
|
|
|
5557
5787
|
apiKey: config.apiKey,
|
|
5558
5788
|
baseUrl: config.baseUrl
|
|
5559
5789
|
};
|
|
5790
|
+
this.http = new HttpClient(clientConfig);
|
|
5560
5791
|
this.mail = new Mail(clientConfig);
|
|
5561
5792
|
this.cdn = new CDN(clientConfig, config.cdnUrl);
|
|
5562
5793
|
this.screenshots = new Screenshots(clientConfig);
|
|
5563
5794
|
this.extraction = new Extraction(clientConfig);
|
|
5795
|
+
this.crawl = new Crawl$(clientConfig);
|
|
5796
|
+
this.map = new Map$(clientConfig);
|
|
5797
|
+
this.documents = new Documents(clientConfig);
|
|
5564
5798
|
this.integrations = new Integrations(clientConfig);
|
|
5565
5799
|
this.marketing = new Marketing(clientConfig);
|
|
5566
5800
|
this.workflows = new Workflows(clientConfig);
|
|
5567
5801
|
this.memory = new Memory(clientConfig);
|
|
5568
5802
|
this.webdata = new Webdata(clientConfig);
|
|
5569
5803
|
}
|
|
5804
|
+
// ============================================================================
|
|
5805
|
+
// PROJECTS
|
|
5806
|
+
// ============================================================================
|
|
5807
|
+
async listProjects() {
|
|
5808
|
+
return this.http.get("/projects");
|
|
5809
|
+
}
|
|
5810
|
+
async getProject(id) {
|
|
5811
|
+
return this.http.get(`/projects/${id}`);
|
|
5812
|
+
}
|
|
5813
|
+
async getProjectBySlug(slug) {
|
|
5814
|
+
return this.http.get(`/projects/by-slug/${slug}`);
|
|
5815
|
+
}
|
|
5816
|
+
async createProject(request) {
|
|
5817
|
+
return this.http.post("/projects", request);
|
|
5818
|
+
}
|
|
5819
|
+
async updateProject(request) {
|
|
5820
|
+
const { id, ...data } = request;
|
|
5821
|
+
return this.http.patch(`/projects/${id}`, data);
|
|
5822
|
+
}
|
|
5823
|
+
async deleteProject(id) {
|
|
5824
|
+
return this.http.delete(`/projects/${id}`);
|
|
5825
|
+
}
|
|
5570
5826
|
};
|
|
5571
5827
|
var src_default = Stack0;
|
|
5572
5828
|
|
|
@@ -5574,12 +5830,17 @@ exports.Audiences = Audiences;
|
|
|
5574
5830
|
exports.CDN = CDN;
|
|
5575
5831
|
exports.Campaigns = Campaigns;
|
|
5576
5832
|
exports.Contacts = Contacts;
|
|
5833
|
+
exports.Crawl = Crawl$;
|
|
5834
|
+
exports.Crawl$ = Crawl$;
|
|
5835
|
+
exports.Documents = Documents;
|
|
5577
5836
|
exports.Domains = Domains;
|
|
5578
5837
|
exports.Events = Events;
|
|
5579
5838
|
exports.Extraction = Extraction;
|
|
5580
5839
|
exports.Integrations = Integrations;
|
|
5581
5840
|
exports.Mail = Mail;
|
|
5582
5841
|
exports.Mailboxes = Mailboxes;
|
|
5842
|
+
exports.Map = Map$;
|
|
5843
|
+
exports.Map$ = Map$;
|
|
5583
5844
|
exports.Marketing = Marketing;
|
|
5584
5845
|
exports.Memory = Memory;
|
|
5585
5846
|
exports.MemoryAgents = MemoryAgents;
|