flexorch-sdk 0.1.0
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/LICENSE +21 -0
- package/README.md +265 -0
- package/dist/chunk-7JBTDKMH.js +87 -0
- package/dist/dataset-IS63EK2G.js +6 -0
- package/dist/index.cjs +722 -0
- package/dist/index.d.cts +279 -0
- package/dist/index.d.ts +279 -0
- package/dist/index.js +576 -0
- package/package.json +54 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
type FetchFn = (input: string, init?: RequestInit) => Promise<Response>;
|
|
2
|
+
declare class Transport {
|
|
3
|
+
private baseUrl;
|
|
4
|
+
private defaultHeaders;
|
|
5
|
+
private timeout;
|
|
6
|
+
private maxRetries;
|
|
7
|
+
private fetchFn;
|
|
8
|
+
constructor(apiKey: string, baseUrl: string, timeout: number, maxRetries: number, fetchFn?: FetchFn);
|
|
9
|
+
private url;
|
|
10
|
+
private doRequest;
|
|
11
|
+
getBytes(path: string, params?: Record<string, string>): Promise<Uint8Array>;
|
|
12
|
+
get(path: string, params?: Record<string, string>): Promise<unknown>;
|
|
13
|
+
post(path: string, json?: unknown): Promise<unknown>;
|
|
14
|
+
postForm(path: string, form: FormData): Promise<unknown>;
|
|
15
|
+
delete(path: string): Promise<unknown>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type ExportFormat = "json" | "jsonl" | "csv" | "parquet" | "md" | "xml" | "xlsx" | "rag";
|
|
19
|
+
declare class Dataset {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly slug: string;
|
|
23
|
+
readonly status: string;
|
|
24
|
+
readonly rowCount: number;
|
|
25
|
+
readonly createdAt: string;
|
|
26
|
+
readonly availableFormats: string[];
|
|
27
|
+
private readonly _transport;
|
|
28
|
+
constructor(data: {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
slug: string;
|
|
32
|
+
status: string;
|
|
33
|
+
rowCount: number;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
availableFormats: string[];
|
|
36
|
+
_transport: Transport;
|
|
37
|
+
});
|
|
38
|
+
static fromDict(data: Record<string, unknown>, transport: Transport): Dataset;
|
|
39
|
+
export(format: ExportFormat): Promise<Uint8Array>;
|
|
40
|
+
exportToS3(connectorId: string, format: ExportFormat, prefix?: string): Promise<{
|
|
41
|
+
s3Key: string;
|
|
42
|
+
sizeBytes: number;
|
|
43
|
+
}>;
|
|
44
|
+
index(): Promise<{
|
|
45
|
+
status: string;
|
|
46
|
+
message: string;
|
|
47
|
+
}>;
|
|
48
|
+
indexStatus(): Promise<{
|
|
49
|
+
status: string;
|
|
50
|
+
chunksIndexed: number;
|
|
51
|
+
totalChunks: number;
|
|
52
|
+
}>;
|
|
53
|
+
toString(): string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare class Job {
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly status: string;
|
|
59
|
+
readonly qualityGrade: string | null;
|
|
60
|
+
readonly qualityScore: number | null;
|
|
61
|
+
readonly documentId: string | null;
|
|
62
|
+
readonly hasDataset: boolean;
|
|
63
|
+
readonly failureReason: string | null;
|
|
64
|
+
private readonly _transport;
|
|
65
|
+
constructor(data: {
|
|
66
|
+
id: string;
|
|
67
|
+
status: string;
|
|
68
|
+
qualityGrade: string | null;
|
|
69
|
+
qualityScore: number | null;
|
|
70
|
+
documentId: string | null;
|
|
71
|
+
hasDataset: boolean;
|
|
72
|
+
failureReason: string | null;
|
|
73
|
+
_transport: Transport;
|
|
74
|
+
});
|
|
75
|
+
static fromDict(data: Record<string, unknown>, transport: Transport): Job;
|
|
76
|
+
wait(opts?: {
|
|
77
|
+
timeout?: number;
|
|
78
|
+
pollInterval?: number;
|
|
79
|
+
}): Promise<Job>;
|
|
80
|
+
dataset(): Promise<Dataset | null>;
|
|
81
|
+
toString(): string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare class SearchResult {
|
|
85
|
+
readonly chunkId: string;
|
|
86
|
+
readonly text: string;
|
|
87
|
+
readonly score: number;
|
|
88
|
+
readonly datasetId: string;
|
|
89
|
+
readonly chunkIndex: number;
|
|
90
|
+
readonly tokenCount: number;
|
|
91
|
+
readonly metadata: Record<string, unknown>;
|
|
92
|
+
constructor(data: {
|
|
93
|
+
chunkId: string;
|
|
94
|
+
text: string;
|
|
95
|
+
score: number;
|
|
96
|
+
datasetId: string;
|
|
97
|
+
chunkIndex: number;
|
|
98
|
+
tokenCount: number;
|
|
99
|
+
metadata: Record<string, unknown>;
|
|
100
|
+
});
|
|
101
|
+
static fromDict(data: Record<string, unknown>): SearchResult;
|
|
102
|
+
toString(): string;
|
|
103
|
+
}
|
|
104
|
+
interface SearchFilters {
|
|
105
|
+
documentType?: string;
|
|
106
|
+
language?: string;
|
|
107
|
+
piiMasked?: boolean;
|
|
108
|
+
qualityGrade?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
declare class JobsResource {
|
|
112
|
+
private readonly _t;
|
|
113
|
+
constructor(_t: Transport);
|
|
114
|
+
get(jobId: string): Promise<Job>;
|
|
115
|
+
list(opts?: {
|
|
116
|
+
page?: number;
|
|
117
|
+
pageSize?: number;
|
|
118
|
+
}): Promise<Job[]>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare class DatasetsResource {
|
|
122
|
+
private readonly _t;
|
|
123
|
+
constructor(_t: Transport);
|
|
124
|
+
get(datasetId: string): Promise<Dataset>;
|
|
125
|
+
list(opts?: {
|
|
126
|
+
page?: number;
|
|
127
|
+
pageSize?: number;
|
|
128
|
+
}): Promise<Dataset[]>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface UsageSnapshot {
|
|
132
|
+
plan: string;
|
|
133
|
+
creditsUsed: number;
|
|
134
|
+
creditsLimit: number;
|
|
135
|
+
creditsRemaining: number;
|
|
136
|
+
resetAt: string;
|
|
137
|
+
periodStart: string;
|
|
138
|
+
periodEnd: string;
|
|
139
|
+
}
|
|
140
|
+
declare class UsageResource {
|
|
141
|
+
private readonly _t;
|
|
142
|
+
constructor(_t: Transport);
|
|
143
|
+
current(): Promise<UsageSnapshot>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
type WebhookEvent = "dataset.ready" | "job.completed" | "job.failed";
|
|
147
|
+
interface Webhook {
|
|
148
|
+
id: string;
|
|
149
|
+
url: string;
|
|
150
|
+
events: WebhookEvent[];
|
|
151
|
+
active: boolean;
|
|
152
|
+
createdAt: string;
|
|
153
|
+
}
|
|
154
|
+
declare class WebhooksResource {
|
|
155
|
+
private readonly _t;
|
|
156
|
+
constructor(_t: Transport);
|
|
157
|
+
register(url: string, events: WebhookEvent[]): Promise<Webhook>;
|
|
158
|
+
list(): Promise<Webhook[]>;
|
|
159
|
+
delete(webhookId: string): Promise<void>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
declare class Connector {
|
|
163
|
+
readonly id: string;
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly type: string;
|
|
166
|
+
readonly active: boolean;
|
|
167
|
+
readonly lastTestedAt: string | null;
|
|
168
|
+
readonly lastUsedAt: string | null;
|
|
169
|
+
readonly createdAt: string;
|
|
170
|
+
constructor(data: {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
type: string;
|
|
174
|
+
active: boolean;
|
|
175
|
+
lastTestedAt: string | null;
|
|
176
|
+
lastUsedAt: string | null;
|
|
177
|
+
createdAt: string;
|
|
178
|
+
});
|
|
179
|
+
static fromDict(data: Record<string, unknown>): Connector;
|
|
180
|
+
toString(): string;
|
|
181
|
+
}
|
|
182
|
+
interface ConnectorTestResult {
|
|
183
|
+
success: boolean;
|
|
184
|
+
latencyMs: number | null;
|
|
185
|
+
message: string;
|
|
186
|
+
}
|
|
187
|
+
type ConnectorType = "s3" | "gcs" | "azure_blob";
|
|
188
|
+
interface S3ConnectorConfig {
|
|
189
|
+
bucket: string;
|
|
190
|
+
region: string;
|
|
191
|
+
accessKeyId: string;
|
|
192
|
+
secretAccessKey: string;
|
|
193
|
+
prefix?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
declare class ConnectorsResource {
|
|
197
|
+
private readonly _t;
|
|
198
|
+
constructor(_t: Transport);
|
|
199
|
+
create(name: string, type: ConnectorType, config: Record<string, string>): Promise<Connector>;
|
|
200
|
+
list(): Promise<Connector[]>;
|
|
201
|
+
get(connectorId: string): Promise<Connector>;
|
|
202
|
+
delete(connectorId: string): Promise<void>;
|
|
203
|
+
test(connectorId: string): Promise<ConnectorTestResult>;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
interface FlexOrchClientOptions {
|
|
207
|
+
apiKey?: string;
|
|
208
|
+
baseUrl?: string;
|
|
209
|
+
timeout?: number;
|
|
210
|
+
maxRetries?: number;
|
|
211
|
+
/** @internal — override fetch for testing */
|
|
212
|
+
_fetch?: FetchFn;
|
|
213
|
+
}
|
|
214
|
+
declare class FlexOrchClient {
|
|
215
|
+
readonly jobs: JobsResource;
|
|
216
|
+
readonly datasets: DatasetsResource;
|
|
217
|
+
readonly usage: UsageResource;
|
|
218
|
+
readonly webhooks: WebhooksResource;
|
|
219
|
+
readonly connectors: ConnectorsResource;
|
|
220
|
+
private readonly _transport;
|
|
221
|
+
constructor(apiKeyOrOptions?: string | FlexOrchClientOptions);
|
|
222
|
+
process(filePath: string, opts?: {
|
|
223
|
+
locale?: string;
|
|
224
|
+
pipelineConfig?: Record<string, unknown>;
|
|
225
|
+
}): Promise<Job>;
|
|
226
|
+
processMany(filePaths: string[], opts?: {
|
|
227
|
+
locale?: string;
|
|
228
|
+
}): Promise<Job[]>;
|
|
229
|
+
processFromS3(connectorId: string, keys: string[], opts?: {
|
|
230
|
+
locale?: string;
|
|
231
|
+
pipelineConfig?: Record<string, unknown>;
|
|
232
|
+
}): Promise<Job[]>;
|
|
233
|
+
search(query: string, opts?: {
|
|
234
|
+
topK?: number;
|
|
235
|
+
filters?: SearchFilters;
|
|
236
|
+
}): Promise<SearchResult[]>;
|
|
237
|
+
toString(): string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
declare class FlexOrchError extends Error {
|
|
241
|
+
readonly statusCode: number | undefined;
|
|
242
|
+
readonly errorCode: string | undefined;
|
|
243
|
+
constructor(message: string, statusCode?: number, errorCode?: string);
|
|
244
|
+
}
|
|
245
|
+
declare class AuthError extends FlexOrchError {
|
|
246
|
+
constructor(message: string, statusCode?: number, errorCode?: string);
|
|
247
|
+
}
|
|
248
|
+
declare class QuotaError extends FlexOrchError {
|
|
249
|
+
readonly remainingCredits: number | undefined;
|
|
250
|
+
readonly resetAt: string | undefined;
|
|
251
|
+
constructor(message: string, statusCode?: number, errorCode?: string, remainingCredits?: number, resetAt?: string);
|
|
252
|
+
}
|
|
253
|
+
declare class RateLimitError extends FlexOrchError {
|
|
254
|
+
readonly retryAfter: number;
|
|
255
|
+
constructor(message: string, retryAfter?: number);
|
|
256
|
+
}
|
|
257
|
+
declare class NotFoundError extends FlexOrchError {
|
|
258
|
+
constructor(message: string, errorCode?: string);
|
|
259
|
+
}
|
|
260
|
+
declare class ValidationError extends FlexOrchError {
|
|
261
|
+
constructor(message: string, errorCode?: string);
|
|
262
|
+
}
|
|
263
|
+
declare class ServerError extends FlexOrchError {
|
|
264
|
+
constructor(message: string, statusCode?: number, errorCode?: string);
|
|
265
|
+
}
|
|
266
|
+
declare class JobFailedError extends FlexOrchError {
|
|
267
|
+
readonly jobId: string;
|
|
268
|
+
readonly failureReason: string;
|
|
269
|
+
constructor(jobId: string, failureReason: string);
|
|
270
|
+
}
|
|
271
|
+
declare class JobTimeoutError extends FlexOrchError {
|
|
272
|
+
readonly jobId: string;
|
|
273
|
+
readonly timeout: number;
|
|
274
|
+
constructor(jobId: string, timeout: number);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare const version = "0.1.0";
|
|
278
|
+
|
|
279
|
+
export { AuthError, Connector, type ConnectorTestResult, type ConnectorType, Dataset, type ExportFormat, FlexOrchClient, type FlexOrchClientOptions, FlexOrchError, Job, JobFailedError, JobTimeoutError, NotFoundError, QuotaError, RateLimitError, type S3ConnectorConfig, type SearchFilters, SearchResult, ServerError, type UsageSnapshot, ValidationError, type Webhook, type WebhookEvent, version };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
type FetchFn = (input: string, init?: RequestInit) => Promise<Response>;
|
|
2
|
+
declare class Transport {
|
|
3
|
+
private baseUrl;
|
|
4
|
+
private defaultHeaders;
|
|
5
|
+
private timeout;
|
|
6
|
+
private maxRetries;
|
|
7
|
+
private fetchFn;
|
|
8
|
+
constructor(apiKey: string, baseUrl: string, timeout: number, maxRetries: number, fetchFn?: FetchFn);
|
|
9
|
+
private url;
|
|
10
|
+
private doRequest;
|
|
11
|
+
getBytes(path: string, params?: Record<string, string>): Promise<Uint8Array>;
|
|
12
|
+
get(path: string, params?: Record<string, string>): Promise<unknown>;
|
|
13
|
+
post(path: string, json?: unknown): Promise<unknown>;
|
|
14
|
+
postForm(path: string, form: FormData): Promise<unknown>;
|
|
15
|
+
delete(path: string): Promise<unknown>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type ExportFormat = "json" | "jsonl" | "csv" | "parquet" | "md" | "xml" | "xlsx" | "rag";
|
|
19
|
+
declare class Dataset {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly slug: string;
|
|
23
|
+
readonly status: string;
|
|
24
|
+
readonly rowCount: number;
|
|
25
|
+
readonly createdAt: string;
|
|
26
|
+
readonly availableFormats: string[];
|
|
27
|
+
private readonly _transport;
|
|
28
|
+
constructor(data: {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
slug: string;
|
|
32
|
+
status: string;
|
|
33
|
+
rowCount: number;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
availableFormats: string[];
|
|
36
|
+
_transport: Transport;
|
|
37
|
+
});
|
|
38
|
+
static fromDict(data: Record<string, unknown>, transport: Transport): Dataset;
|
|
39
|
+
export(format: ExportFormat): Promise<Uint8Array>;
|
|
40
|
+
exportToS3(connectorId: string, format: ExportFormat, prefix?: string): Promise<{
|
|
41
|
+
s3Key: string;
|
|
42
|
+
sizeBytes: number;
|
|
43
|
+
}>;
|
|
44
|
+
index(): Promise<{
|
|
45
|
+
status: string;
|
|
46
|
+
message: string;
|
|
47
|
+
}>;
|
|
48
|
+
indexStatus(): Promise<{
|
|
49
|
+
status: string;
|
|
50
|
+
chunksIndexed: number;
|
|
51
|
+
totalChunks: number;
|
|
52
|
+
}>;
|
|
53
|
+
toString(): string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare class Job {
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly status: string;
|
|
59
|
+
readonly qualityGrade: string | null;
|
|
60
|
+
readonly qualityScore: number | null;
|
|
61
|
+
readonly documentId: string | null;
|
|
62
|
+
readonly hasDataset: boolean;
|
|
63
|
+
readonly failureReason: string | null;
|
|
64
|
+
private readonly _transport;
|
|
65
|
+
constructor(data: {
|
|
66
|
+
id: string;
|
|
67
|
+
status: string;
|
|
68
|
+
qualityGrade: string | null;
|
|
69
|
+
qualityScore: number | null;
|
|
70
|
+
documentId: string | null;
|
|
71
|
+
hasDataset: boolean;
|
|
72
|
+
failureReason: string | null;
|
|
73
|
+
_transport: Transport;
|
|
74
|
+
});
|
|
75
|
+
static fromDict(data: Record<string, unknown>, transport: Transport): Job;
|
|
76
|
+
wait(opts?: {
|
|
77
|
+
timeout?: number;
|
|
78
|
+
pollInterval?: number;
|
|
79
|
+
}): Promise<Job>;
|
|
80
|
+
dataset(): Promise<Dataset | null>;
|
|
81
|
+
toString(): string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare class SearchResult {
|
|
85
|
+
readonly chunkId: string;
|
|
86
|
+
readonly text: string;
|
|
87
|
+
readonly score: number;
|
|
88
|
+
readonly datasetId: string;
|
|
89
|
+
readonly chunkIndex: number;
|
|
90
|
+
readonly tokenCount: number;
|
|
91
|
+
readonly metadata: Record<string, unknown>;
|
|
92
|
+
constructor(data: {
|
|
93
|
+
chunkId: string;
|
|
94
|
+
text: string;
|
|
95
|
+
score: number;
|
|
96
|
+
datasetId: string;
|
|
97
|
+
chunkIndex: number;
|
|
98
|
+
tokenCount: number;
|
|
99
|
+
metadata: Record<string, unknown>;
|
|
100
|
+
});
|
|
101
|
+
static fromDict(data: Record<string, unknown>): SearchResult;
|
|
102
|
+
toString(): string;
|
|
103
|
+
}
|
|
104
|
+
interface SearchFilters {
|
|
105
|
+
documentType?: string;
|
|
106
|
+
language?: string;
|
|
107
|
+
piiMasked?: boolean;
|
|
108
|
+
qualityGrade?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
declare class JobsResource {
|
|
112
|
+
private readonly _t;
|
|
113
|
+
constructor(_t: Transport);
|
|
114
|
+
get(jobId: string): Promise<Job>;
|
|
115
|
+
list(opts?: {
|
|
116
|
+
page?: number;
|
|
117
|
+
pageSize?: number;
|
|
118
|
+
}): Promise<Job[]>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare class DatasetsResource {
|
|
122
|
+
private readonly _t;
|
|
123
|
+
constructor(_t: Transport);
|
|
124
|
+
get(datasetId: string): Promise<Dataset>;
|
|
125
|
+
list(opts?: {
|
|
126
|
+
page?: number;
|
|
127
|
+
pageSize?: number;
|
|
128
|
+
}): Promise<Dataset[]>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface UsageSnapshot {
|
|
132
|
+
plan: string;
|
|
133
|
+
creditsUsed: number;
|
|
134
|
+
creditsLimit: number;
|
|
135
|
+
creditsRemaining: number;
|
|
136
|
+
resetAt: string;
|
|
137
|
+
periodStart: string;
|
|
138
|
+
periodEnd: string;
|
|
139
|
+
}
|
|
140
|
+
declare class UsageResource {
|
|
141
|
+
private readonly _t;
|
|
142
|
+
constructor(_t: Transport);
|
|
143
|
+
current(): Promise<UsageSnapshot>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
type WebhookEvent = "dataset.ready" | "job.completed" | "job.failed";
|
|
147
|
+
interface Webhook {
|
|
148
|
+
id: string;
|
|
149
|
+
url: string;
|
|
150
|
+
events: WebhookEvent[];
|
|
151
|
+
active: boolean;
|
|
152
|
+
createdAt: string;
|
|
153
|
+
}
|
|
154
|
+
declare class WebhooksResource {
|
|
155
|
+
private readonly _t;
|
|
156
|
+
constructor(_t: Transport);
|
|
157
|
+
register(url: string, events: WebhookEvent[]): Promise<Webhook>;
|
|
158
|
+
list(): Promise<Webhook[]>;
|
|
159
|
+
delete(webhookId: string): Promise<void>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
declare class Connector {
|
|
163
|
+
readonly id: string;
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly type: string;
|
|
166
|
+
readonly active: boolean;
|
|
167
|
+
readonly lastTestedAt: string | null;
|
|
168
|
+
readonly lastUsedAt: string | null;
|
|
169
|
+
readonly createdAt: string;
|
|
170
|
+
constructor(data: {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
type: string;
|
|
174
|
+
active: boolean;
|
|
175
|
+
lastTestedAt: string | null;
|
|
176
|
+
lastUsedAt: string | null;
|
|
177
|
+
createdAt: string;
|
|
178
|
+
});
|
|
179
|
+
static fromDict(data: Record<string, unknown>): Connector;
|
|
180
|
+
toString(): string;
|
|
181
|
+
}
|
|
182
|
+
interface ConnectorTestResult {
|
|
183
|
+
success: boolean;
|
|
184
|
+
latencyMs: number | null;
|
|
185
|
+
message: string;
|
|
186
|
+
}
|
|
187
|
+
type ConnectorType = "s3" | "gcs" | "azure_blob";
|
|
188
|
+
interface S3ConnectorConfig {
|
|
189
|
+
bucket: string;
|
|
190
|
+
region: string;
|
|
191
|
+
accessKeyId: string;
|
|
192
|
+
secretAccessKey: string;
|
|
193
|
+
prefix?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
declare class ConnectorsResource {
|
|
197
|
+
private readonly _t;
|
|
198
|
+
constructor(_t: Transport);
|
|
199
|
+
create(name: string, type: ConnectorType, config: Record<string, string>): Promise<Connector>;
|
|
200
|
+
list(): Promise<Connector[]>;
|
|
201
|
+
get(connectorId: string): Promise<Connector>;
|
|
202
|
+
delete(connectorId: string): Promise<void>;
|
|
203
|
+
test(connectorId: string): Promise<ConnectorTestResult>;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
interface FlexOrchClientOptions {
|
|
207
|
+
apiKey?: string;
|
|
208
|
+
baseUrl?: string;
|
|
209
|
+
timeout?: number;
|
|
210
|
+
maxRetries?: number;
|
|
211
|
+
/** @internal — override fetch for testing */
|
|
212
|
+
_fetch?: FetchFn;
|
|
213
|
+
}
|
|
214
|
+
declare class FlexOrchClient {
|
|
215
|
+
readonly jobs: JobsResource;
|
|
216
|
+
readonly datasets: DatasetsResource;
|
|
217
|
+
readonly usage: UsageResource;
|
|
218
|
+
readonly webhooks: WebhooksResource;
|
|
219
|
+
readonly connectors: ConnectorsResource;
|
|
220
|
+
private readonly _transport;
|
|
221
|
+
constructor(apiKeyOrOptions?: string | FlexOrchClientOptions);
|
|
222
|
+
process(filePath: string, opts?: {
|
|
223
|
+
locale?: string;
|
|
224
|
+
pipelineConfig?: Record<string, unknown>;
|
|
225
|
+
}): Promise<Job>;
|
|
226
|
+
processMany(filePaths: string[], opts?: {
|
|
227
|
+
locale?: string;
|
|
228
|
+
}): Promise<Job[]>;
|
|
229
|
+
processFromS3(connectorId: string, keys: string[], opts?: {
|
|
230
|
+
locale?: string;
|
|
231
|
+
pipelineConfig?: Record<string, unknown>;
|
|
232
|
+
}): Promise<Job[]>;
|
|
233
|
+
search(query: string, opts?: {
|
|
234
|
+
topK?: number;
|
|
235
|
+
filters?: SearchFilters;
|
|
236
|
+
}): Promise<SearchResult[]>;
|
|
237
|
+
toString(): string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
declare class FlexOrchError extends Error {
|
|
241
|
+
readonly statusCode: number | undefined;
|
|
242
|
+
readonly errorCode: string | undefined;
|
|
243
|
+
constructor(message: string, statusCode?: number, errorCode?: string);
|
|
244
|
+
}
|
|
245
|
+
declare class AuthError extends FlexOrchError {
|
|
246
|
+
constructor(message: string, statusCode?: number, errorCode?: string);
|
|
247
|
+
}
|
|
248
|
+
declare class QuotaError extends FlexOrchError {
|
|
249
|
+
readonly remainingCredits: number | undefined;
|
|
250
|
+
readonly resetAt: string | undefined;
|
|
251
|
+
constructor(message: string, statusCode?: number, errorCode?: string, remainingCredits?: number, resetAt?: string);
|
|
252
|
+
}
|
|
253
|
+
declare class RateLimitError extends FlexOrchError {
|
|
254
|
+
readonly retryAfter: number;
|
|
255
|
+
constructor(message: string, retryAfter?: number);
|
|
256
|
+
}
|
|
257
|
+
declare class NotFoundError extends FlexOrchError {
|
|
258
|
+
constructor(message: string, errorCode?: string);
|
|
259
|
+
}
|
|
260
|
+
declare class ValidationError extends FlexOrchError {
|
|
261
|
+
constructor(message: string, errorCode?: string);
|
|
262
|
+
}
|
|
263
|
+
declare class ServerError extends FlexOrchError {
|
|
264
|
+
constructor(message: string, statusCode?: number, errorCode?: string);
|
|
265
|
+
}
|
|
266
|
+
declare class JobFailedError extends FlexOrchError {
|
|
267
|
+
readonly jobId: string;
|
|
268
|
+
readonly failureReason: string;
|
|
269
|
+
constructor(jobId: string, failureReason: string);
|
|
270
|
+
}
|
|
271
|
+
declare class JobTimeoutError extends FlexOrchError {
|
|
272
|
+
readonly jobId: string;
|
|
273
|
+
readonly timeout: number;
|
|
274
|
+
constructor(jobId: string, timeout: number);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare const version = "0.1.0";
|
|
278
|
+
|
|
279
|
+
export { AuthError, Connector, type ConnectorTestResult, type ConnectorType, Dataset, type ExportFormat, FlexOrchClient, type FlexOrchClientOptions, FlexOrchError, Job, JobFailedError, JobTimeoutError, NotFoundError, QuotaError, RateLimitError, type S3ConnectorConfig, type SearchFilters, SearchResult, ServerError, type UsageSnapshot, ValidationError, type Webhook, type WebhookEvent, version };
|