@pdfvector/client 0.0.53 → 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/CHANGELOG.md +15 -0
- package/README.md +71 -8
- package/contract/package.json +5 -0
- package/dist/contract.cjs +3962 -0
- package/dist/contract.d.cts +2084 -0
- package/dist/contract.d.mts +2084 -0
- package/dist/contract.mjs +3945 -0
- package/dist/index.cjs +1904 -0
- package/dist/index.d.cts +2470 -0
- package/dist/index.d.mts +2470 -0
- package/dist/index.mjs +1871 -0
- package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
- package/package.json +37 -7
- package/.tsc/lib/index.d.ts +0 -2
- package/.tsc/lib/index.d.ts.map +0 -1
- package/.tsc/lib/index.js +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,2470 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
Create a type that represents either the value or the value wrapped in `PromiseLike`.
|
|
4
|
+
|
|
5
|
+
Use-cases:
|
|
6
|
+
- A function accepts a callback that may either return a value synchronously or may return a promised value.
|
|
7
|
+
- This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks.
|
|
8
|
+
|
|
9
|
+
Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript.
|
|
10
|
+
|
|
11
|
+
@example
|
|
12
|
+
```
|
|
13
|
+
import type {Promisable} from 'type-fest';
|
|
14
|
+
|
|
15
|
+
async function logger(getLogEntry: () => Promisable<string>): Promise<void> {
|
|
16
|
+
const entry = await getLogEntry();
|
|
17
|
+
console.log(entry);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
await logger(() => 'foo');
|
|
21
|
+
await logger(() => Promise.resolve('bar'));
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
@category Async
|
|
25
|
+
*/
|
|
26
|
+
type Promisable<T> = T | PromiseLike<T>;
|
|
27
|
+
type MaybeOptionalOptions<TOptions> = Record<never, never> extends TOptions ? [options?: TOptions] : [options: TOptions];
|
|
28
|
+
type PromiseWithError<T, TError> = Promise<T> & {
|
|
29
|
+
__error?: {
|
|
30
|
+
type: TError;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The place where you can config the orpc types.
|
|
35
|
+
*
|
|
36
|
+
* - `throwableError` the error type that represent throwable errors should be `Error` or `null | undefined | {}` if you want more strict.
|
|
37
|
+
*/
|
|
38
|
+
interface Registry {}
|
|
39
|
+
type ThrowableError = Registry extends {
|
|
40
|
+
throwableError: infer T;
|
|
41
|
+
} ? T : Error;
|
|
42
|
+
type InterceptableOptions = Record<string, any>;
|
|
43
|
+
type InterceptorOptions<TOptions extends InterceptableOptions, TResult> = Omit<TOptions, 'next'> & {
|
|
44
|
+
next(options?: TOptions): TResult;
|
|
45
|
+
};
|
|
46
|
+
type Interceptor<TOptions extends InterceptableOptions, TResult> = (options: InterceptorOptions<TOptions, TResult>) => TResult;
|
|
47
|
+
/**
|
|
48
|
+
* Can be used for interceptors or middlewares
|
|
49
|
+
*/
|
|
50
|
+
declare function onError<T, TOptions extends {
|
|
51
|
+
next(): any;
|
|
52
|
+
}, TRest extends any[]>(callback: NoInfer<(error: ReturnType<TOptions['next']> extends PromiseWithError<any, infer E> ? E : ThrowableError, options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => T | Promise<Awaited<ReturnType<TOptions['next']>>>;
|
|
53
|
+
type Value$1<T, TArgs extends any[] = []> = T | ((...args: TArgs) => T);
|
|
54
|
+
type HTTPPath = `/${string}`;
|
|
55
|
+
type HTTPMethod = 'HEAD' | 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
56
|
+
type ClientContext$1 = Record<PropertyKey, any>;
|
|
57
|
+
interface ClientOptions<T extends ClientContext$1> {
|
|
58
|
+
signal?: AbortSignal;
|
|
59
|
+
lastEventId?: string | undefined;
|
|
60
|
+
context: T;
|
|
61
|
+
}
|
|
62
|
+
type FriendlyClientOptions<T extends ClientContext$1> = Omit<ClientOptions<T>, 'context'> & (Record<never, never> extends T ? {
|
|
63
|
+
context?: T;
|
|
64
|
+
} : {
|
|
65
|
+
context: T;
|
|
66
|
+
});
|
|
67
|
+
type ClientRest<TClientContext extends ClientContext$1, TInput> = Record<never, never> extends TClientContext ? undefined extends TInput ? [input?: TInput, options?: FriendlyClientOptions<TClientContext>] : [input: TInput, options?: FriendlyClientOptions<TClientContext>] : [input: TInput, options: FriendlyClientOptions<TClientContext>];
|
|
68
|
+
type ClientPromiseResult<TOutput, TError> = PromiseWithError<TOutput, TError>;
|
|
69
|
+
interface Client$1<TClientContext extends ClientContext$1, TInput, TOutput, TError> {
|
|
70
|
+
(...rest: ClientRest<TClientContext, TInput>): ClientPromiseResult<TOutput, TError>;
|
|
71
|
+
}
|
|
72
|
+
type NestedClient<TClientContext extends ClientContext$1> = Client$1<TClientContext, any, any, any> | {
|
|
73
|
+
[k: string]: NestedClient<TClientContext>;
|
|
74
|
+
};
|
|
75
|
+
type InferClientContext<T extends NestedClient<any>> = T extends NestedClient<infer U> ? U : never;
|
|
76
|
+
interface ClientLink<TClientContext extends ClientContext$1> {
|
|
77
|
+
call: (path: readonly string[], input: unknown, options: ClientOptions<TClientContext>) => Promise<unknown>;
|
|
78
|
+
}
|
|
79
|
+
interface StandardHeaders {
|
|
80
|
+
[key: string]: string | string[] | undefined;
|
|
81
|
+
}
|
|
82
|
+
type StandardBody = undefined | unknown | Blob | URLSearchParams | FormData | AsyncIterator<unknown | void, unknown | void, undefined> | ReadableStream<Uint8Array>;
|
|
83
|
+
interface StandardRequest {
|
|
84
|
+
method: string;
|
|
85
|
+
url: URL;
|
|
86
|
+
headers: StandardHeaders;
|
|
87
|
+
/**
|
|
88
|
+
* The body has been parsed based on the content-type header.
|
|
89
|
+
*/
|
|
90
|
+
body: StandardBody;
|
|
91
|
+
signal: AbortSignal | undefined;
|
|
92
|
+
}
|
|
93
|
+
interface StandardResponse {
|
|
94
|
+
status: number;
|
|
95
|
+
headers: StandardHeaders;
|
|
96
|
+
/**
|
|
97
|
+
* The body has been parsed based on the content-type header.
|
|
98
|
+
*/
|
|
99
|
+
body: StandardBody;
|
|
100
|
+
}
|
|
101
|
+
interface StandardLazyResponse extends Omit<StandardResponse, 'body'> {
|
|
102
|
+
/**
|
|
103
|
+
* The body has been parsed based on the content-type header.
|
|
104
|
+
* This method can safely call multiple times (cached).
|
|
105
|
+
*/
|
|
106
|
+
body: () => Promise<StandardBody>;
|
|
107
|
+
}
|
|
108
|
+
interface createORPCClientOptions {
|
|
109
|
+
/**
|
|
110
|
+
* Use as base path for all procedure, useful when you only want to call a subset of the procedure.
|
|
111
|
+
*/
|
|
112
|
+
path?: readonly string[];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Create a oRPC client-side client from a link.
|
|
116
|
+
*
|
|
117
|
+
* @see {@link https://orpc.dev/docs/client/client-side Client-side Client Docs}
|
|
118
|
+
*/
|
|
119
|
+
declare function createORPCClient<T extends NestedClient<any>>(link: ClientLink<InferClientContext<T>>, options?: createORPCClientOptions): T;
|
|
120
|
+
declare const COMMON_ORPC_ERROR_DEFS: {
|
|
121
|
+
readonly BAD_REQUEST: {
|
|
122
|
+
readonly status: 400;
|
|
123
|
+
readonly message: "Bad Request";
|
|
124
|
+
};
|
|
125
|
+
readonly UNAUTHORIZED: {
|
|
126
|
+
readonly status: 401;
|
|
127
|
+
readonly message: "Unauthorized";
|
|
128
|
+
};
|
|
129
|
+
readonly FORBIDDEN: {
|
|
130
|
+
readonly status: 403;
|
|
131
|
+
readonly message: "Forbidden";
|
|
132
|
+
};
|
|
133
|
+
readonly NOT_FOUND: {
|
|
134
|
+
readonly status: 404;
|
|
135
|
+
readonly message: "Not Found";
|
|
136
|
+
};
|
|
137
|
+
readonly METHOD_NOT_SUPPORTED: {
|
|
138
|
+
readonly status: 405;
|
|
139
|
+
readonly message: "Method Not Supported";
|
|
140
|
+
};
|
|
141
|
+
readonly NOT_ACCEPTABLE: {
|
|
142
|
+
readonly status: 406;
|
|
143
|
+
readonly message: "Not Acceptable";
|
|
144
|
+
};
|
|
145
|
+
readonly TIMEOUT: {
|
|
146
|
+
readonly status: 408;
|
|
147
|
+
readonly message: "Request Timeout";
|
|
148
|
+
};
|
|
149
|
+
readonly CONFLICT: {
|
|
150
|
+
readonly status: 409;
|
|
151
|
+
readonly message: "Conflict";
|
|
152
|
+
};
|
|
153
|
+
readonly PRECONDITION_FAILED: {
|
|
154
|
+
readonly status: 412;
|
|
155
|
+
readonly message: "Precondition Failed";
|
|
156
|
+
};
|
|
157
|
+
readonly PAYLOAD_TOO_LARGE: {
|
|
158
|
+
readonly status: 413;
|
|
159
|
+
readonly message: "Payload Too Large";
|
|
160
|
+
};
|
|
161
|
+
readonly UNSUPPORTED_MEDIA_TYPE: {
|
|
162
|
+
readonly status: 415;
|
|
163
|
+
readonly message: "Unsupported Media Type";
|
|
164
|
+
};
|
|
165
|
+
readonly UNPROCESSABLE_CONTENT: {
|
|
166
|
+
readonly status: 422;
|
|
167
|
+
readonly message: "Unprocessable Content";
|
|
168
|
+
};
|
|
169
|
+
readonly TOO_MANY_REQUESTS: {
|
|
170
|
+
readonly status: 429;
|
|
171
|
+
readonly message: "Too Many Requests";
|
|
172
|
+
};
|
|
173
|
+
readonly CLIENT_CLOSED_REQUEST: {
|
|
174
|
+
readonly status: 499;
|
|
175
|
+
readonly message: "Client Closed Request";
|
|
176
|
+
};
|
|
177
|
+
readonly INTERNAL_SERVER_ERROR: {
|
|
178
|
+
readonly status: 500;
|
|
179
|
+
readonly message: "Internal Server Error";
|
|
180
|
+
};
|
|
181
|
+
readonly NOT_IMPLEMENTED: {
|
|
182
|
+
readonly status: 501;
|
|
183
|
+
readonly message: "Not Implemented";
|
|
184
|
+
};
|
|
185
|
+
readonly BAD_GATEWAY: {
|
|
186
|
+
readonly status: 502;
|
|
187
|
+
readonly message: "Bad Gateway";
|
|
188
|
+
};
|
|
189
|
+
readonly SERVICE_UNAVAILABLE: {
|
|
190
|
+
readonly status: 503;
|
|
191
|
+
readonly message: "Service Unavailable";
|
|
192
|
+
};
|
|
193
|
+
readonly GATEWAY_TIMEOUT: {
|
|
194
|
+
readonly status: 504;
|
|
195
|
+
readonly message: "Gateway Timeout";
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
type CommonORPCErrorCode = keyof typeof COMMON_ORPC_ERROR_DEFS;
|
|
199
|
+
type ORPCErrorCode = CommonORPCErrorCode | (string & {});
|
|
200
|
+
type ORPCErrorOptions<TData> = ErrorOptions & {
|
|
201
|
+
defined?: boolean;
|
|
202
|
+
status?: number;
|
|
203
|
+
message?: string;
|
|
204
|
+
} & (undefined extends TData ? {
|
|
205
|
+
data?: TData;
|
|
206
|
+
} : {
|
|
207
|
+
data: TData;
|
|
208
|
+
});
|
|
209
|
+
declare class ORPCError<TCode extends ORPCErrorCode, TData> extends Error {
|
|
210
|
+
readonly defined: boolean;
|
|
211
|
+
readonly code: TCode;
|
|
212
|
+
readonly status: number;
|
|
213
|
+
readonly data: TData;
|
|
214
|
+
constructor(code: TCode, ...rest: MaybeOptionalOptions<ORPCErrorOptions<TData>>);
|
|
215
|
+
toJSON(): ORPCErrorJSON<TCode, TData>;
|
|
216
|
+
/**
|
|
217
|
+
* Workaround for Next.js where different contexts use separate
|
|
218
|
+
* dependency graphs, causing multiple ORPCError constructors existing and breaking
|
|
219
|
+
* `instanceof` checks across contexts.
|
|
220
|
+
*
|
|
221
|
+
* This is particularly problematic with "Optimized SSR", where orpc-client
|
|
222
|
+
* executes in one context but is invoked from another. When an error is thrown
|
|
223
|
+
* in the execution context, `instanceof ORPCError` checks fail in the
|
|
224
|
+
* invocation context due to separate class constructors.
|
|
225
|
+
*
|
|
226
|
+
* @todo Remove this and related code if Next.js resolves the multiple dependency graph issue.
|
|
227
|
+
*/
|
|
228
|
+
static [Symbol.hasInstance](instance: unknown): boolean;
|
|
229
|
+
}
|
|
230
|
+
type ORPCErrorJSON<TCode extends string, TData> = Pick<ORPCError<TCode, TData>, 'defined' | 'code' | 'status' | 'message' | 'data'>;
|
|
231
|
+
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
232
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
233
|
+
/** The Standard properties. */
|
|
234
|
+
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
235
|
+
}
|
|
236
|
+
declare namespace StandardTypedV1 {
|
|
237
|
+
/** The Standard Typed properties interface. */
|
|
238
|
+
interface Props<Input = unknown, Output = Input> {
|
|
239
|
+
/** The version number of the standard. */
|
|
240
|
+
readonly version: 1;
|
|
241
|
+
/** The vendor name of the schema library. */
|
|
242
|
+
readonly vendor: string;
|
|
243
|
+
/** Inferred types associated with the schema. */
|
|
244
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
245
|
+
}
|
|
246
|
+
/** The Standard Typed types interface. */
|
|
247
|
+
interface Types<Input = unknown, Output = Input> {
|
|
248
|
+
/** The input type of the schema. */
|
|
249
|
+
readonly input: Input;
|
|
250
|
+
/** The output type of the schema. */
|
|
251
|
+
readonly output: Output;
|
|
252
|
+
}
|
|
253
|
+
/** Infers the input type of a Standard Typed. */
|
|
254
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
255
|
+
/** Infers the output type of a Standard Typed. */
|
|
256
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
257
|
+
}
|
|
258
|
+
/** The Standard Schema interface. */
|
|
259
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
260
|
+
/** The Standard Schema properties. */
|
|
261
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
262
|
+
}
|
|
263
|
+
declare namespace StandardSchemaV1 {
|
|
264
|
+
/** The Standard Schema properties interface. */
|
|
265
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
266
|
+
/** Validates unknown input values. */
|
|
267
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
268
|
+
}
|
|
269
|
+
/** The result interface of the validate function. */
|
|
270
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
271
|
+
/** The result interface if validation succeeds. */
|
|
272
|
+
interface SuccessResult<Output> {
|
|
273
|
+
/** The typed output value. */
|
|
274
|
+
readonly value: Output;
|
|
275
|
+
/** A falsy value for `issues` indicates success. */
|
|
276
|
+
readonly issues?: undefined;
|
|
277
|
+
}
|
|
278
|
+
interface Options {
|
|
279
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
280
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
281
|
+
}
|
|
282
|
+
/** The result interface if validation fails. */
|
|
283
|
+
interface FailureResult {
|
|
284
|
+
/** The issues of failed validation. */
|
|
285
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
286
|
+
}
|
|
287
|
+
/** The issue interface of the failure output. */
|
|
288
|
+
interface Issue {
|
|
289
|
+
/** The error message of the issue. */
|
|
290
|
+
readonly message: string;
|
|
291
|
+
/** The path of the issue, if any. */
|
|
292
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
293
|
+
}
|
|
294
|
+
/** The path segment interface of the issue. */
|
|
295
|
+
interface PathSegment {
|
|
296
|
+
/** The key representing a path segment. */
|
|
297
|
+
readonly key: PropertyKey;
|
|
298
|
+
}
|
|
299
|
+
/** The Standard types interface. */
|
|
300
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
301
|
+
/** Infers the input type of a Standard. */
|
|
302
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
303
|
+
/** Infers the output type of a Standard. */
|
|
304
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
305
|
+
}
|
|
306
|
+
declare namespace OpenAPIV3_1 {
|
|
307
|
+
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
308
|
+
type PathsWebhooksComponents<T extends {} = {}> = {
|
|
309
|
+
paths: PathsObject<T>;
|
|
310
|
+
webhooks: Record<string, PathItemObject | ReferenceObject>;
|
|
311
|
+
components: ComponentsObject;
|
|
312
|
+
};
|
|
313
|
+
export type Document<T extends {} = {}> = Modify<Omit<OpenAPIV3.Document<T>, 'paths' | 'components'>, {
|
|
314
|
+
info: InfoObject;
|
|
315
|
+
jsonSchemaDialect?: string;
|
|
316
|
+
servers?: ServerObject[];
|
|
317
|
+
} & ((Pick<PathsWebhooksComponents<T>, 'paths'> & Omit<Partial<PathsWebhooksComponents<T>>, 'paths'>) | (Pick<PathsWebhooksComponents<T>, 'webhooks'> & Omit<Partial<PathsWebhooksComponents<T>>, 'webhooks'>) | (Pick<PathsWebhooksComponents<T>, 'components'> & Omit<Partial<PathsWebhooksComponents<T>>, 'components'>))>;
|
|
318
|
+
export type InfoObject = Modify<OpenAPIV3.InfoObject, {
|
|
319
|
+
summary?: string;
|
|
320
|
+
license?: LicenseObject;
|
|
321
|
+
}>;
|
|
322
|
+
export type ContactObject = OpenAPIV3.ContactObject;
|
|
323
|
+
export type LicenseObject = Modify<OpenAPIV3.LicenseObject, {
|
|
324
|
+
identifier?: string;
|
|
325
|
+
}>;
|
|
326
|
+
export type ServerObject = Modify<OpenAPIV3.ServerObject, {
|
|
327
|
+
url: string;
|
|
328
|
+
description?: string;
|
|
329
|
+
variables?: Record<string, ServerVariableObject>;
|
|
330
|
+
}>;
|
|
331
|
+
export type ServerVariableObject = Modify<OpenAPIV3.ServerVariableObject, {
|
|
332
|
+
enum?: [string, ...string[]];
|
|
333
|
+
}>;
|
|
334
|
+
export type PathsObject<T extends {} = {}, P extends {} = {}> = Record<string, (PathItemObject<T> & P) | undefined>;
|
|
335
|
+
export type HttpMethods = OpenAPIV3.HttpMethods;
|
|
336
|
+
export type PathItemObject<T extends {} = {}> = Modify<OpenAPIV3.PathItemObject<T>, {
|
|
337
|
+
servers?: ServerObject[];
|
|
338
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
339
|
+
}> & { [method in HttpMethods]?: OperationObject<T>; };
|
|
340
|
+
export type OperationObject<T extends {} = {}> = Modify<OpenAPIV3.OperationObject<T>, {
|
|
341
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
342
|
+
requestBody?: ReferenceObject | RequestBodyObject;
|
|
343
|
+
responses?: ResponsesObject;
|
|
344
|
+
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
345
|
+
servers?: ServerObject[];
|
|
346
|
+
}> & T;
|
|
347
|
+
export type ExternalDocumentationObject = OpenAPIV3.ExternalDocumentationObject;
|
|
348
|
+
export type ParameterObject = OpenAPIV3.ParameterObject;
|
|
349
|
+
export type HeaderObject = OpenAPIV3.HeaderObject;
|
|
350
|
+
export type ParameterBaseObject = OpenAPIV3.ParameterBaseObject;
|
|
351
|
+
export type NonArraySchemaObjectType = OpenAPIV3.NonArraySchemaObjectType | 'null';
|
|
352
|
+
export type ArraySchemaObjectType = OpenAPIV3.ArraySchemaObjectType;
|
|
353
|
+
/**
|
|
354
|
+
* There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type
|
|
355
|
+
* 'items' will be always visible as optional
|
|
356
|
+
* Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine
|
|
357
|
+
*/
|
|
358
|
+
export type SchemaObject = ArraySchemaObject | NonArraySchemaObject | MixedSchemaObject;
|
|
359
|
+
export interface ArraySchemaObject extends BaseSchemaObject {
|
|
360
|
+
type: ArraySchemaObjectType;
|
|
361
|
+
items: ReferenceObject | SchemaObject;
|
|
362
|
+
}
|
|
363
|
+
export interface NonArraySchemaObject extends BaseSchemaObject {
|
|
364
|
+
type?: NonArraySchemaObjectType;
|
|
365
|
+
}
|
|
366
|
+
interface MixedSchemaObject extends BaseSchemaObject {
|
|
367
|
+
type?: (ArraySchemaObjectType | NonArraySchemaObjectType)[];
|
|
368
|
+
items?: ReferenceObject | SchemaObject;
|
|
369
|
+
}
|
|
370
|
+
export type BaseSchemaObject = Modify<Omit<OpenAPIV3.BaseSchemaObject, 'nullable'>, {
|
|
371
|
+
examples?: OpenAPIV3.BaseSchemaObject['example'][];
|
|
372
|
+
exclusiveMinimum?: boolean | number;
|
|
373
|
+
exclusiveMaximum?: boolean | number;
|
|
374
|
+
contentMediaType?: string;
|
|
375
|
+
$schema?: string;
|
|
376
|
+
additionalProperties?: boolean | ReferenceObject | SchemaObject;
|
|
377
|
+
properties?: {
|
|
378
|
+
[name: string]: ReferenceObject | SchemaObject;
|
|
379
|
+
};
|
|
380
|
+
allOf?: (ReferenceObject | SchemaObject)[];
|
|
381
|
+
oneOf?: (ReferenceObject | SchemaObject)[];
|
|
382
|
+
anyOf?: (ReferenceObject | SchemaObject)[];
|
|
383
|
+
not?: ReferenceObject | SchemaObject;
|
|
384
|
+
discriminator?: DiscriminatorObject;
|
|
385
|
+
externalDocs?: ExternalDocumentationObject;
|
|
386
|
+
xml?: XMLObject;
|
|
387
|
+
const?: any;
|
|
388
|
+
}>;
|
|
389
|
+
export type DiscriminatorObject = OpenAPIV3.DiscriminatorObject;
|
|
390
|
+
export type XMLObject = OpenAPIV3.XMLObject;
|
|
391
|
+
export type ReferenceObject = Modify<OpenAPIV3.ReferenceObject, {
|
|
392
|
+
summary?: string;
|
|
393
|
+
description?: string;
|
|
394
|
+
}>;
|
|
395
|
+
export type ExampleObject = OpenAPIV3.ExampleObject;
|
|
396
|
+
export type MediaTypeObject = Modify<OpenAPIV3.MediaTypeObject, {
|
|
397
|
+
schema?: SchemaObject | ReferenceObject;
|
|
398
|
+
examples?: Record<string, ReferenceObject | ExampleObject>;
|
|
399
|
+
}>;
|
|
400
|
+
export type EncodingObject = OpenAPIV3.EncodingObject;
|
|
401
|
+
export type RequestBodyObject = Modify<OpenAPIV3.RequestBodyObject, {
|
|
402
|
+
content: {
|
|
403
|
+
[media: string]: MediaTypeObject;
|
|
404
|
+
};
|
|
405
|
+
}>;
|
|
406
|
+
export type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
|
|
407
|
+
export type ResponseObject = Modify<OpenAPIV3.ResponseObject, {
|
|
408
|
+
headers?: {
|
|
409
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
410
|
+
};
|
|
411
|
+
content?: {
|
|
412
|
+
[media: string]: MediaTypeObject;
|
|
413
|
+
};
|
|
414
|
+
links?: {
|
|
415
|
+
[link: string]: ReferenceObject | LinkObject;
|
|
416
|
+
};
|
|
417
|
+
}>;
|
|
418
|
+
export type LinkObject = Modify<OpenAPIV3.LinkObject, {
|
|
419
|
+
server?: ServerObject;
|
|
420
|
+
}>;
|
|
421
|
+
export type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
|
|
422
|
+
export type SecurityRequirementObject = OpenAPIV3.SecurityRequirementObject;
|
|
423
|
+
export type ComponentsObject = Modify<OpenAPIV3.ComponentsObject, {
|
|
424
|
+
schemas?: Record<string, SchemaObject>;
|
|
425
|
+
responses?: Record<string, ReferenceObject | ResponseObject>;
|
|
426
|
+
parameters?: Record<string, ReferenceObject | ParameterObject>;
|
|
427
|
+
examples?: Record<string, ReferenceObject | ExampleObject>;
|
|
428
|
+
requestBodies?: Record<string, ReferenceObject | RequestBodyObject>;
|
|
429
|
+
headers?: Record<string, ReferenceObject | HeaderObject>;
|
|
430
|
+
securitySchemes?: Record<string, ReferenceObject | SecuritySchemeObject>;
|
|
431
|
+
links?: Record<string, ReferenceObject | LinkObject>;
|
|
432
|
+
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
433
|
+
pathItems?: Record<string, ReferenceObject | PathItemObject>;
|
|
434
|
+
}>;
|
|
435
|
+
export type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject;
|
|
436
|
+
export type HttpSecurityScheme = OpenAPIV3.HttpSecurityScheme;
|
|
437
|
+
export type ApiKeySecurityScheme = OpenAPIV3.ApiKeySecurityScheme;
|
|
438
|
+
export type OAuth2SecurityScheme = OpenAPIV3.OAuth2SecurityScheme;
|
|
439
|
+
export type OpenIdSecurityScheme = OpenAPIV3.OpenIdSecurityScheme;
|
|
440
|
+
export type TagObject = OpenAPIV3.TagObject;
|
|
441
|
+
export {};
|
|
442
|
+
}
|
|
443
|
+
declare namespace OpenAPIV3 {
|
|
444
|
+
interface Document<T extends {} = {}> {
|
|
445
|
+
openapi: string;
|
|
446
|
+
info: InfoObject;
|
|
447
|
+
servers?: ServerObject[];
|
|
448
|
+
paths: PathsObject<T>;
|
|
449
|
+
components?: ComponentsObject;
|
|
450
|
+
security?: SecurityRequirementObject[];
|
|
451
|
+
tags?: TagObject[];
|
|
452
|
+
externalDocs?: ExternalDocumentationObject;
|
|
453
|
+
'x-express-openapi-additional-middleware'?: (((request: any, response: any, next: any) => Promise<void>) | ((request: any, response: any, next: any) => void))[];
|
|
454
|
+
'x-express-openapi-validation-strict'?: boolean;
|
|
455
|
+
}
|
|
456
|
+
interface InfoObject {
|
|
457
|
+
title: string;
|
|
458
|
+
description?: string;
|
|
459
|
+
termsOfService?: string;
|
|
460
|
+
contact?: ContactObject;
|
|
461
|
+
license?: LicenseObject;
|
|
462
|
+
version: string;
|
|
463
|
+
}
|
|
464
|
+
interface ContactObject {
|
|
465
|
+
name?: string;
|
|
466
|
+
url?: string;
|
|
467
|
+
email?: string;
|
|
468
|
+
}
|
|
469
|
+
interface LicenseObject {
|
|
470
|
+
name: string;
|
|
471
|
+
url?: string;
|
|
472
|
+
}
|
|
473
|
+
interface ServerObject {
|
|
474
|
+
url: string;
|
|
475
|
+
description?: string;
|
|
476
|
+
variables?: {
|
|
477
|
+
[variable: string]: ServerVariableObject;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
interface ServerVariableObject {
|
|
481
|
+
enum?: string[];
|
|
482
|
+
default: string;
|
|
483
|
+
description?: string;
|
|
484
|
+
}
|
|
485
|
+
interface PathsObject<T extends {} = {}, P extends {} = {}> {
|
|
486
|
+
[pattern: string]: (PathItemObject<T> & P) | undefined;
|
|
487
|
+
}
|
|
488
|
+
enum HttpMethods {
|
|
489
|
+
GET = "get",
|
|
490
|
+
PUT = "put",
|
|
491
|
+
POST = "post",
|
|
492
|
+
DELETE = "delete",
|
|
493
|
+
OPTIONS = "options",
|
|
494
|
+
HEAD = "head",
|
|
495
|
+
PATCH = "patch",
|
|
496
|
+
TRACE = "trace"
|
|
497
|
+
}
|
|
498
|
+
type PathItemObject<T extends {} = {}> = {
|
|
499
|
+
$ref?: string;
|
|
500
|
+
summary?: string;
|
|
501
|
+
description?: string;
|
|
502
|
+
servers?: ServerObject[];
|
|
503
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
504
|
+
} & { [method in HttpMethods]?: OperationObject<T>; };
|
|
505
|
+
type OperationObject<T extends {} = {}> = {
|
|
506
|
+
tags?: string[];
|
|
507
|
+
summary?: string;
|
|
508
|
+
description?: string;
|
|
509
|
+
externalDocs?: ExternalDocumentationObject;
|
|
510
|
+
operationId?: string;
|
|
511
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
512
|
+
requestBody?: ReferenceObject | RequestBodyObject;
|
|
513
|
+
responses: ResponsesObject;
|
|
514
|
+
callbacks?: {
|
|
515
|
+
[callback: string]: ReferenceObject | CallbackObject;
|
|
516
|
+
};
|
|
517
|
+
deprecated?: boolean;
|
|
518
|
+
security?: SecurityRequirementObject[];
|
|
519
|
+
servers?: ServerObject[];
|
|
520
|
+
} & T;
|
|
521
|
+
interface ExternalDocumentationObject {
|
|
522
|
+
description?: string;
|
|
523
|
+
url: string;
|
|
524
|
+
}
|
|
525
|
+
interface ParameterObject extends ParameterBaseObject {
|
|
526
|
+
name: string;
|
|
527
|
+
in: string;
|
|
528
|
+
}
|
|
529
|
+
interface HeaderObject extends ParameterBaseObject {}
|
|
530
|
+
interface ParameterBaseObject {
|
|
531
|
+
description?: string;
|
|
532
|
+
required?: boolean;
|
|
533
|
+
deprecated?: boolean;
|
|
534
|
+
allowEmptyValue?: boolean;
|
|
535
|
+
style?: string;
|
|
536
|
+
explode?: boolean;
|
|
537
|
+
allowReserved?: boolean;
|
|
538
|
+
schema?: ReferenceObject | SchemaObject;
|
|
539
|
+
example?: any;
|
|
540
|
+
examples?: {
|
|
541
|
+
[media: string]: ReferenceObject | ExampleObject;
|
|
542
|
+
};
|
|
543
|
+
content?: {
|
|
544
|
+
[media: string]: MediaTypeObject;
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
type NonArraySchemaObjectType = 'boolean' | 'object' | 'number' | 'string' | 'integer';
|
|
548
|
+
type ArraySchemaObjectType = 'array';
|
|
549
|
+
type SchemaObject = ArraySchemaObject | NonArraySchemaObject;
|
|
550
|
+
interface ArraySchemaObject extends BaseSchemaObject {
|
|
551
|
+
type: ArraySchemaObjectType;
|
|
552
|
+
items: ReferenceObject | SchemaObject;
|
|
553
|
+
}
|
|
554
|
+
interface NonArraySchemaObject extends BaseSchemaObject {
|
|
555
|
+
type?: NonArraySchemaObjectType;
|
|
556
|
+
}
|
|
557
|
+
interface BaseSchemaObject {
|
|
558
|
+
title?: string;
|
|
559
|
+
description?: string;
|
|
560
|
+
format?: string;
|
|
561
|
+
default?: any;
|
|
562
|
+
multipleOf?: number;
|
|
563
|
+
maximum?: number;
|
|
564
|
+
exclusiveMaximum?: boolean;
|
|
565
|
+
minimum?: number;
|
|
566
|
+
exclusiveMinimum?: boolean;
|
|
567
|
+
maxLength?: number;
|
|
568
|
+
minLength?: number;
|
|
569
|
+
pattern?: string;
|
|
570
|
+
additionalProperties?: boolean | ReferenceObject | SchemaObject;
|
|
571
|
+
maxItems?: number;
|
|
572
|
+
minItems?: number;
|
|
573
|
+
uniqueItems?: boolean;
|
|
574
|
+
maxProperties?: number;
|
|
575
|
+
minProperties?: number;
|
|
576
|
+
required?: string[];
|
|
577
|
+
enum?: any[];
|
|
578
|
+
properties?: {
|
|
579
|
+
[name: string]: ReferenceObject | SchemaObject;
|
|
580
|
+
};
|
|
581
|
+
allOf?: (ReferenceObject | SchemaObject)[];
|
|
582
|
+
oneOf?: (ReferenceObject | SchemaObject)[];
|
|
583
|
+
anyOf?: (ReferenceObject | SchemaObject)[];
|
|
584
|
+
not?: ReferenceObject | SchemaObject;
|
|
585
|
+
nullable?: boolean;
|
|
586
|
+
discriminator?: DiscriminatorObject;
|
|
587
|
+
readOnly?: boolean;
|
|
588
|
+
writeOnly?: boolean;
|
|
589
|
+
xml?: XMLObject;
|
|
590
|
+
externalDocs?: ExternalDocumentationObject;
|
|
591
|
+
example?: any;
|
|
592
|
+
deprecated?: boolean;
|
|
593
|
+
}
|
|
594
|
+
interface DiscriminatorObject {
|
|
595
|
+
propertyName: string;
|
|
596
|
+
mapping?: {
|
|
597
|
+
[value: string]: string;
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
interface XMLObject {
|
|
601
|
+
name?: string;
|
|
602
|
+
namespace?: string;
|
|
603
|
+
prefix?: string;
|
|
604
|
+
attribute?: boolean;
|
|
605
|
+
wrapped?: boolean;
|
|
606
|
+
}
|
|
607
|
+
interface ReferenceObject {
|
|
608
|
+
$ref: string;
|
|
609
|
+
}
|
|
610
|
+
interface ExampleObject {
|
|
611
|
+
summary?: string;
|
|
612
|
+
description?: string;
|
|
613
|
+
value?: any;
|
|
614
|
+
externalValue?: string;
|
|
615
|
+
}
|
|
616
|
+
interface MediaTypeObject {
|
|
617
|
+
schema?: ReferenceObject | SchemaObject;
|
|
618
|
+
example?: any;
|
|
619
|
+
examples?: {
|
|
620
|
+
[media: string]: ReferenceObject | ExampleObject;
|
|
621
|
+
};
|
|
622
|
+
encoding?: {
|
|
623
|
+
[media: string]: EncodingObject;
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
interface EncodingObject {
|
|
627
|
+
contentType?: string;
|
|
628
|
+
headers?: {
|
|
629
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
630
|
+
};
|
|
631
|
+
style?: string;
|
|
632
|
+
explode?: boolean;
|
|
633
|
+
allowReserved?: boolean;
|
|
634
|
+
}
|
|
635
|
+
interface RequestBodyObject {
|
|
636
|
+
description?: string;
|
|
637
|
+
content: {
|
|
638
|
+
[media: string]: MediaTypeObject;
|
|
639
|
+
};
|
|
640
|
+
required?: boolean;
|
|
641
|
+
}
|
|
642
|
+
interface ResponsesObject {
|
|
643
|
+
[code: string]: ReferenceObject | ResponseObject;
|
|
644
|
+
}
|
|
645
|
+
interface ResponseObject {
|
|
646
|
+
description: string;
|
|
647
|
+
headers?: {
|
|
648
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
649
|
+
};
|
|
650
|
+
content?: {
|
|
651
|
+
[media: string]: MediaTypeObject;
|
|
652
|
+
};
|
|
653
|
+
links?: {
|
|
654
|
+
[link: string]: ReferenceObject | LinkObject;
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
interface LinkObject {
|
|
658
|
+
operationRef?: string;
|
|
659
|
+
operationId?: string;
|
|
660
|
+
parameters?: {
|
|
661
|
+
[parameter: string]: any;
|
|
662
|
+
};
|
|
663
|
+
requestBody?: any;
|
|
664
|
+
description?: string;
|
|
665
|
+
server?: ServerObject;
|
|
666
|
+
}
|
|
667
|
+
interface CallbackObject {
|
|
668
|
+
[url: string]: PathItemObject;
|
|
669
|
+
}
|
|
670
|
+
interface SecurityRequirementObject {
|
|
671
|
+
[name: string]: string[];
|
|
672
|
+
}
|
|
673
|
+
interface ComponentsObject {
|
|
674
|
+
schemas?: {
|
|
675
|
+
[key: string]: ReferenceObject | SchemaObject;
|
|
676
|
+
};
|
|
677
|
+
responses?: {
|
|
678
|
+
[key: string]: ReferenceObject | ResponseObject;
|
|
679
|
+
};
|
|
680
|
+
parameters?: {
|
|
681
|
+
[key: string]: ReferenceObject | ParameterObject;
|
|
682
|
+
};
|
|
683
|
+
examples?: {
|
|
684
|
+
[key: string]: ReferenceObject | ExampleObject;
|
|
685
|
+
};
|
|
686
|
+
requestBodies?: {
|
|
687
|
+
[key: string]: ReferenceObject | RequestBodyObject;
|
|
688
|
+
};
|
|
689
|
+
headers?: {
|
|
690
|
+
[key: string]: ReferenceObject | HeaderObject;
|
|
691
|
+
};
|
|
692
|
+
securitySchemes?: {
|
|
693
|
+
[key: string]: ReferenceObject | SecuritySchemeObject;
|
|
694
|
+
};
|
|
695
|
+
links?: {
|
|
696
|
+
[key: string]: ReferenceObject | LinkObject;
|
|
697
|
+
};
|
|
698
|
+
callbacks?: {
|
|
699
|
+
[key: string]: ReferenceObject | CallbackObject;
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
type SecuritySchemeObject = HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | OpenIdSecurityScheme;
|
|
703
|
+
interface HttpSecurityScheme {
|
|
704
|
+
type: 'http';
|
|
705
|
+
description?: string;
|
|
706
|
+
scheme: string;
|
|
707
|
+
bearerFormat?: string;
|
|
708
|
+
}
|
|
709
|
+
interface ApiKeySecurityScheme {
|
|
710
|
+
type: 'apiKey';
|
|
711
|
+
description?: string;
|
|
712
|
+
name: string;
|
|
713
|
+
in: string;
|
|
714
|
+
}
|
|
715
|
+
interface OAuth2SecurityScheme {
|
|
716
|
+
type: 'oauth2';
|
|
717
|
+
description?: string;
|
|
718
|
+
flows: {
|
|
719
|
+
implicit?: {
|
|
720
|
+
authorizationUrl: string;
|
|
721
|
+
refreshUrl?: string;
|
|
722
|
+
scopes: {
|
|
723
|
+
[scope: string]: string;
|
|
724
|
+
};
|
|
725
|
+
};
|
|
726
|
+
password?: {
|
|
727
|
+
tokenUrl: string;
|
|
728
|
+
refreshUrl?: string;
|
|
729
|
+
scopes: {
|
|
730
|
+
[scope: string]: string;
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
clientCredentials?: {
|
|
734
|
+
tokenUrl: string;
|
|
735
|
+
refreshUrl?: string;
|
|
736
|
+
scopes: {
|
|
737
|
+
[scope: string]: string;
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
authorizationCode?: {
|
|
741
|
+
authorizationUrl: string;
|
|
742
|
+
tokenUrl: string;
|
|
743
|
+
refreshUrl?: string;
|
|
744
|
+
scopes: {
|
|
745
|
+
[scope: string]: string;
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
interface OpenIdSecurityScheme {
|
|
751
|
+
type: 'openIdConnect';
|
|
752
|
+
description?: string;
|
|
753
|
+
openIdConnectUrl: string;
|
|
754
|
+
}
|
|
755
|
+
interface TagObject {
|
|
756
|
+
name: string;
|
|
757
|
+
description?: string;
|
|
758
|
+
externalDocs?: ExternalDocumentationObject;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
type Schema$1<TInput, TOutput> = StandardSchemaV1<TInput, TOutput>;
|
|
762
|
+
type AnySchema = Schema$1<any, any>;
|
|
763
|
+
type InferSchemaInput<T extends AnySchema> = T extends StandardSchemaV1<infer UInput, any> ? UInput : never;
|
|
764
|
+
type InferSchemaOutput<T extends AnySchema> = T extends StandardSchemaV1<any, infer UOutput> ? UOutput : never;
|
|
765
|
+
interface ErrorMapItem<TDataSchema extends AnySchema> {
|
|
766
|
+
status?: number;
|
|
767
|
+
message?: string;
|
|
768
|
+
data?: TDataSchema;
|
|
769
|
+
}
|
|
770
|
+
type ErrorMap = { [key in ORPCErrorCode]?: ErrorMapItem<AnySchema>; };
|
|
771
|
+
type MergedErrorMap<T1 extends ErrorMap, T2 extends ErrorMap> = Omit<T1, keyof T2> & T2;
|
|
772
|
+
type ORPCErrorFromErrorMap<TErrorMap extends ErrorMap> = { [K in keyof TErrorMap]: K extends string ? TErrorMap[K] extends ErrorMapItem<infer TDataSchema extends Schema$1<unknown, unknown>> ? ORPCError<K, InferSchemaOutput<TDataSchema>> : never : never; }[keyof TErrorMap];
|
|
773
|
+
type ErrorFromErrorMap<TErrorMap extends ErrorMap> = ORPCErrorFromErrorMap<TErrorMap> | ThrowableError;
|
|
774
|
+
type Meta = Record<string, any>;
|
|
775
|
+
type InputStructure = 'compact' | 'detailed';
|
|
776
|
+
type OutputStructure = 'compact' | 'detailed';
|
|
777
|
+
interface Route {
|
|
778
|
+
/**
|
|
779
|
+
* The HTTP method of the procedure.
|
|
780
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
781
|
+
*
|
|
782
|
+
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
|
|
783
|
+
*/
|
|
784
|
+
method?: HTTPMethod;
|
|
785
|
+
/**
|
|
786
|
+
* The HTTP path of the procedure.
|
|
787
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
788
|
+
*
|
|
789
|
+
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
|
|
790
|
+
*/
|
|
791
|
+
path?: HTTPPath;
|
|
792
|
+
/**
|
|
793
|
+
* The operation ID of the endpoint.
|
|
794
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
795
|
+
*
|
|
796
|
+
* @default Concatenation of router segments
|
|
797
|
+
*/
|
|
798
|
+
operationId?: string;
|
|
799
|
+
/**
|
|
800
|
+
* The summary of the procedure.
|
|
801
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
802
|
+
*
|
|
803
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
804
|
+
*/
|
|
805
|
+
summary?: string;
|
|
806
|
+
/**
|
|
807
|
+
* The description of the procedure.
|
|
808
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
809
|
+
*
|
|
810
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
811
|
+
*/
|
|
812
|
+
description?: string;
|
|
813
|
+
/**
|
|
814
|
+
* Marks the procedure as deprecated.
|
|
815
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
816
|
+
*
|
|
817
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
818
|
+
*/
|
|
819
|
+
deprecated?: boolean;
|
|
820
|
+
/**
|
|
821
|
+
* The tags of the procedure.
|
|
822
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
823
|
+
*
|
|
824
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
825
|
+
*/
|
|
826
|
+
tags?: readonly string[];
|
|
827
|
+
/**
|
|
828
|
+
* The status code of the response when the procedure is successful.
|
|
829
|
+
* The status code must be in the 200-399 range.
|
|
830
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
831
|
+
*
|
|
832
|
+
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
|
|
833
|
+
* @default 200
|
|
834
|
+
*/
|
|
835
|
+
successStatus?: number;
|
|
836
|
+
/**
|
|
837
|
+
* The description of the response when the procedure is successful.
|
|
838
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
839
|
+
*
|
|
840
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata OpenAPI Operation Metadata Docs}
|
|
841
|
+
* @default 'OK'
|
|
842
|
+
*/
|
|
843
|
+
successDescription?: string;
|
|
844
|
+
/**
|
|
845
|
+
* Determines how the input should be structured based on `params`, `query`, `headers`, and `body`.
|
|
846
|
+
*
|
|
847
|
+
* @option 'compact'
|
|
848
|
+
* Combines `params` and either `query` or `body` (depending on the HTTP method) into a single object.
|
|
849
|
+
*
|
|
850
|
+
* @option 'detailed'
|
|
851
|
+
* Keeps each part of the request (`params`, `query`, `headers`, and `body`) as separate fields in the input object.
|
|
852
|
+
*
|
|
853
|
+
* Example:
|
|
854
|
+
* ```ts
|
|
855
|
+
* const input = {
|
|
856
|
+
* params: { id: 1 },
|
|
857
|
+
* query: { search: 'hello' },
|
|
858
|
+
* headers: { 'Content-Type': 'application/json' },
|
|
859
|
+
* body: { name: 'John' },
|
|
860
|
+
* }
|
|
861
|
+
* ```
|
|
862
|
+
*
|
|
863
|
+
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
864
|
+
* @default 'compact'
|
|
865
|
+
*/
|
|
866
|
+
inputStructure?: InputStructure;
|
|
867
|
+
/**
|
|
868
|
+
* Determines how the response should be structured based on the output.
|
|
869
|
+
*
|
|
870
|
+
* @option 'compact'
|
|
871
|
+
* The output data is directly returned as the response body.
|
|
872
|
+
*
|
|
873
|
+
* @option 'detailed'
|
|
874
|
+
* Return an object with optional properties:
|
|
875
|
+
* - `status`: The response status (must be in 200-399 range) if not set fallback to `successStatus`.
|
|
876
|
+
* - `headers`: Custom headers to merge with the response headers (`Record<string, string | string[] | undefined>`)
|
|
877
|
+
* - `body`: The response body.
|
|
878
|
+
*
|
|
879
|
+
* Example:
|
|
880
|
+
* ```ts
|
|
881
|
+
* const output = {
|
|
882
|
+
* status: 201,
|
|
883
|
+
* headers: { 'x-custom-header': 'value' },
|
|
884
|
+
* body: { message: 'Hello, world!' },
|
|
885
|
+
* };
|
|
886
|
+
* ```
|
|
887
|
+
*
|
|
888
|
+
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
889
|
+
* @default 'compact'
|
|
890
|
+
*/
|
|
891
|
+
outputStructure?: OutputStructure;
|
|
892
|
+
/**
|
|
893
|
+
* Override entire auto-generated OpenAPI Operation Object Specification.
|
|
894
|
+
*
|
|
895
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-specification#operation-metadata Operation Metadata Docs}
|
|
896
|
+
*/
|
|
897
|
+
spec?: OpenAPIV3_1.OperationObject | ((current: OpenAPIV3_1.OperationObject) => OpenAPIV3_1.OperationObject);
|
|
898
|
+
}
|
|
899
|
+
interface ContractProcedureDef<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
900
|
+
meta: TMeta;
|
|
901
|
+
route: Route;
|
|
902
|
+
inputSchema?: TInputSchema;
|
|
903
|
+
outputSchema?: TOutputSchema;
|
|
904
|
+
errorMap: TErrorMap;
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* This class represents a contract procedure.
|
|
908
|
+
*
|
|
909
|
+
* @see {@link https://orpc.dev/docs/contract-first/define-contract#procedure-contract Contract Procedure Docs}
|
|
910
|
+
*/
|
|
911
|
+
declare class ContractProcedure<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> {
|
|
912
|
+
/**
|
|
913
|
+
* This property holds the defined options for the contract procedure.
|
|
914
|
+
*/
|
|
915
|
+
'~orpc': ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
916
|
+
constructor(def: ContractProcedureDef<TInputSchema, TOutputSchema, TErrorMap, TMeta>);
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Represents a contract router, which defines a hierarchical structure of contract procedures.
|
|
920
|
+
*
|
|
921
|
+
* @info A contract procedure is a contract router too.
|
|
922
|
+
* @see {@link https://orpc.dev/docs/contract-first/define-contract#contract-router Contract Router Docs}
|
|
923
|
+
*/
|
|
924
|
+
type ContractRouter<TMeta extends Meta> = ContractProcedure<any, any, any, TMeta> | {
|
|
925
|
+
[k: string]: ContractRouter<TMeta>;
|
|
926
|
+
};
|
|
927
|
+
type AnyContractRouter = ContractRouter<any>;
|
|
928
|
+
/**
|
|
929
|
+
* Infer all inputs of the contract router.
|
|
930
|
+
*
|
|
931
|
+
* @info A contract procedure is a contract router too.
|
|
932
|
+
* @see {@link https://orpc.dev/docs/contract-first/define-contract#utilities Contract Utilities Docs}
|
|
933
|
+
*/
|
|
934
|
+
type InferContractRouterInputs<T extends AnyContractRouter> = T extends ContractProcedure<infer UInputSchema, any, any, any> ? InferSchemaInput<UInputSchema> : { [K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterInputs<T[K]> : never; };
|
|
935
|
+
/**
|
|
936
|
+
* Infer all outputs of the contract router.
|
|
937
|
+
*
|
|
938
|
+
* @info A contract procedure is a contract router too.
|
|
939
|
+
* @see {@link https://orpc.dev/docs/contract-first/define-contract#utilities Contract Utilities Docs}
|
|
940
|
+
*/
|
|
941
|
+
type InferContractRouterOutputs<T extends AnyContractRouter> = T extends ContractProcedure<any, infer UOutputSchema, any, any> ? InferSchemaOutput<UOutputSchema> : { [K in keyof T]: T[K] extends AnyContractRouter ? InferContractRouterOutputs<T[K]> : never; };
|
|
942
|
+
interface ContractProcedureBuilderWithOutput<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> extends ContractProcedure<TInputSchema, TOutputSchema, TErrorMap, TMeta> {
|
|
943
|
+
/**
|
|
944
|
+
* Adds type-safe custom errors to the contract.
|
|
945
|
+
* The provided errors are spared-merged with any existing errors in the contract.
|
|
946
|
+
*
|
|
947
|
+
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
948
|
+
*/
|
|
949
|
+
errors<U extends ErrorMap>(errors: U): ContractProcedureBuilderWithOutput<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;
|
|
950
|
+
/**
|
|
951
|
+
* Sets or updates the metadata for the contract.
|
|
952
|
+
* The provided metadata is spared-merged with any existing metadata in the contract.
|
|
953
|
+
*
|
|
954
|
+
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
|
|
955
|
+
*/
|
|
956
|
+
meta(meta: TMeta): ContractProcedureBuilderWithOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
957
|
+
/**
|
|
958
|
+
* Sets or updates the route definition for the contract.
|
|
959
|
+
* The provided route is spared-merged with any existing route in the contract.
|
|
960
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
961
|
+
*
|
|
962
|
+
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
|
|
963
|
+
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
964
|
+
*/
|
|
965
|
+
route(route: Route): ContractProcedureBuilderWithOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
966
|
+
/**
|
|
967
|
+
* Defines the input validation schema for the contract.
|
|
968
|
+
*
|
|
969
|
+
* @see {@link https://orpc.dev/docs/procedure#input-output-validation Input Validation Docs}
|
|
970
|
+
*/
|
|
971
|
+
input<U extends AnySchema>(schema: U): ContractProcedureBuilderWithInputOutput<U, TOutputSchema, TErrorMap, TMeta>;
|
|
972
|
+
}
|
|
973
|
+
interface ContractProcedureBuilderWithInputOutput<TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap, TMeta extends Meta> extends ContractProcedure<TInputSchema, TOutputSchema, TErrorMap, TMeta> {
|
|
974
|
+
/**
|
|
975
|
+
* Adds type-safe custom errors to the contract.
|
|
976
|
+
* The provided errors are spared-merged with any existing errors in the contract.
|
|
977
|
+
*
|
|
978
|
+
* @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
|
|
979
|
+
*/
|
|
980
|
+
errors<U extends ErrorMap>(errors: U): ContractProcedureBuilderWithInputOutput<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta>;
|
|
981
|
+
/**
|
|
982
|
+
* Sets or updates the metadata for the contract.
|
|
983
|
+
* The provided metadata is spared-merged with any existing metadata in the contract.
|
|
984
|
+
*
|
|
985
|
+
* @see {@link https://orpc.dev/docs/metadata Metadata Docs}
|
|
986
|
+
*/
|
|
987
|
+
meta(meta: TMeta): ContractProcedureBuilderWithInputOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
988
|
+
/**
|
|
989
|
+
* Sets or updates the route definition for the contract.
|
|
990
|
+
* The provided route is spared-merged with any existing route in the contract.
|
|
991
|
+
* This option is typically relevant when integrating with OpenAPI.
|
|
992
|
+
*
|
|
993
|
+
* @see {@link https://orpc.dev/docs/openapi/routing OpenAPI Routing Docs}
|
|
994
|
+
* @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
|
|
995
|
+
*/
|
|
996
|
+
route(route: Route): ContractProcedureBuilderWithInputOutput<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
|
|
997
|
+
}
|
|
998
|
+
type ContractProcedureClient<TClientContext extends ClientContext$1, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TErrorMap extends ErrorMap> = Client$1<TClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ErrorFromErrorMap<TErrorMap>>;
|
|
999
|
+
type ContractRouterClient<TRouter extends AnyContractRouter, TClientContext extends ClientContext$1 = Record<never, never>> = TRouter extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, any> ? ContractProcedureClient<TClientContext, UInputSchema, UOutputSchema, UErrorMap> : { [K in keyof TRouter]: TRouter[K] extends AnyContractRouter ? ContractRouterClient<TRouter[K], TClientContext> : never; };
|
|
1000
|
+
declare const fetch: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1001
|
+
ids: z.ZodArray<z.ZodString>;
|
|
1002
|
+
fields: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
1003
|
+
abstract: "abstract";
|
|
1004
|
+
authors: "authors";
|
|
1005
|
+
date: "date";
|
|
1006
|
+
doi: "doi";
|
|
1007
|
+
pdfURL: "pdfURL";
|
|
1008
|
+
provider: "provider";
|
|
1009
|
+
providerData: "providerData";
|
|
1010
|
+
providerURL: "providerURL";
|
|
1011
|
+
title: "title";
|
|
1012
|
+
totalCitations: "totalCitations";
|
|
1013
|
+
totalReferences: "totalReferences";
|
|
1014
|
+
url: "url";
|
|
1015
|
+
year: "year";
|
|
1016
|
+
}>>>>;
|
|
1017
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1018
|
+
url: z.ZodURL;
|
|
1019
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1020
|
+
}, z.core.$strip>>;
|
|
1021
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1022
|
+
results: z.ZodArray<z.ZodObject<{
|
|
1023
|
+
id: z.ZodString;
|
|
1024
|
+
detectedProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1025
|
+
arxiv: "arxiv";
|
|
1026
|
+
crossref: "crossref";
|
|
1027
|
+
eric: "eric";
|
|
1028
|
+
"europe-pmc": "europe-pmc";
|
|
1029
|
+
"google-scholar": "google-scholar";
|
|
1030
|
+
openalex: "openalex";
|
|
1031
|
+
pubmed: "pubmed";
|
|
1032
|
+
"semantic-scholar": "semantic-scholar";
|
|
1033
|
+
}>>>;
|
|
1034
|
+
doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1035
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1036
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1037
|
+
providerURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1038
|
+
authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1039
|
+
name: z.ZodString;
|
|
1040
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1041
|
+
}, z.core.$strip>>>>;
|
|
1042
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1043
|
+
year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1044
|
+
totalCitations: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1045
|
+
totalReferences: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1046
|
+
abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1047
|
+
pdfURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1048
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1049
|
+
arxiv: "arxiv";
|
|
1050
|
+
crossref: "crossref";
|
|
1051
|
+
eric: "eric";
|
|
1052
|
+
"europe-pmc": "europe-pmc";
|
|
1053
|
+
"google-scholar": "google-scholar";
|
|
1054
|
+
openalex: "openalex";
|
|
1055
|
+
pubmed: "pubmed";
|
|
1056
|
+
"semantic-scholar": "semantic-scholar";
|
|
1057
|
+
}>>>;
|
|
1058
|
+
providerData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1059
|
+
}, z.core.$strip>>;
|
|
1060
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1061
|
+
id: z.ZodString;
|
|
1062
|
+
error: z.ZodString;
|
|
1063
|
+
code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1064
|
+
}, z.core.$strip>>>>;
|
|
1065
|
+
requestId: z.ZodNumber;
|
|
1066
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1067
|
+
declare const findCitations: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1068
|
+
paragraph: z.ZodString;
|
|
1069
|
+
providers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
1070
|
+
arxiv: "arxiv";
|
|
1071
|
+
crossref: "crossref";
|
|
1072
|
+
eric: "eric";
|
|
1073
|
+
"europe-pmc": "europe-pmc";
|
|
1074
|
+
"google-scholar": "google-scholar";
|
|
1075
|
+
openalex: "openalex";
|
|
1076
|
+
pubmed: "pubmed";
|
|
1077
|
+
"semantic-scholar": "semantic-scholar";
|
|
1078
|
+
}>>>;
|
|
1079
|
+
fields: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
1080
|
+
abstract: "abstract";
|
|
1081
|
+
authors: "authors";
|
|
1082
|
+
date: "date";
|
|
1083
|
+
doi: "doi";
|
|
1084
|
+
pdfURL: "pdfURL";
|
|
1085
|
+
provider: "provider";
|
|
1086
|
+
providerData: "providerData";
|
|
1087
|
+
providerURL: "providerURL";
|
|
1088
|
+
title: "title";
|
|
1089
|
+
totalCitations: "totalCitations";
|
|
1090
|
+
totalReferences: "totalReferences";
|
|
1091
|
+
url: "url";
|
|
1092
|
+
year: "year";
|
|
1093
|
+
}>>>>;
|
|
1094
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1095
|
+
url: z.ZodURL;
|
|
1096
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1097
|
+
}, z.core.$strip>>;
|
|
1098
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1099
|
+
results: z.ZodArray<z.ZodObject<{
|
|
1100
|
+
sentence: z.ZodString;
|
|
1101
|
+
citations: z.ZodArray<z.ZodObject<{
|
|
1102
|
+
score: z.ZodNumber;
|
|
1103
|
+
doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1104
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1105
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1106
|
+
providerURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1107
|
+
authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1108
|
+
name: z.ZodString;
|
|
1109
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1110
|
+
}, z.core.$strip>>>>;
|
|
1111
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1112
|
+
year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1113
|
+
totalCitations: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1114
|
+
totalReferences: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1115
|
+
abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1116
|
+
pdfURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1117
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1118
|
+
arxiv: "arxiv";
|
|
1119
|
+
crossref: "crossref";
|
|
1120
|
+
eric: "eric";
|
|
1121
|
+
"europe-pmc": "europe-pmc";
|
|
1122
|
+
"google-scholar": "google-scholar";
|
|
1123
|
+
openalex: "openalex";
|
|
1124
|
+
pubmed: "pubmed";
|
|
1125
|
+
"semantic-scholar": "semantic-scholar";
|
|
1126
|
+
}>>>;
|
|
1127
|
+
providerData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1128
|
+
}, z.core.$strip>>;
|
|
1129
|
+
}, z.core.$strip>>;
|
|
1130
|
+
sentenceCount: z.ZodNumber;
|
|
1131
|
+
totalCitations: z.ZodNumber;
|
|
1132
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1133
|
+
requestId: z.ZodNumber;
|
|
1134
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1135
|
+
declare const paperGraph: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1136
|
+
id: z.ZodString;
|
|
1137
|
+
citationsLimit: z.ZodDefault<z.ZodNumber>;
|
|
1138
|
+
referencesLimit: z.ZodDefault<z.ZodNumber>;
|
|
1139
|
+
citationsOffset: z.ZodDefault<z.ZodNumber>;
|
|
1140
|
+
referencesOffset: z.ZodDefault<z.ZodNumber>;
|
|
1141
|
+
fields: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
1142
|
+
abstract: "abstract";
|
|
1143
|
+
authors: "authors";
|
|
1144
|
+
date: "date";
|
|
1145
|
+
doi: "doi";
|
|
1146
|
+
pdfURL: "pdfURL";
|
|
1147
|
+
provider: "provider";
|
|
1148
|
+
providerData: "providerData";
|
|
1149
|
+
providerURL: "providerURL";
|
|
1150
|
+
title: "title";
|
|
1151
|
+
totalCitations: "totalCitations";
|
|
1152
|
+
totalReferences: "totalReferences";
|
|
1153
|
+
url: "url";
|
|
1154
|
+
year: "year";
|
|
1155
|
+
}>>>>;
|
|
1156
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1157
|
+
url: z.ZodURL;
|
|
1158
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1159
|
+
}, z.core.$strip>>;
|
|
1160
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1161
|
+
paper: z.ZodObject<{
|
|
1162
|
+
doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1163
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1164
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1165
|
+
providerURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1166
|
+
authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1167
|
+
name: z.ZodString;
|
|
1168
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1169
|
+
}, z.core.$strip>>>>;
|
|
1170
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1171
|
+
year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1172
|
+
totalCitations: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1173
|
+
totalReferences: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1174
|
+
abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1175
|
+
pdfURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1176
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1177
|
+
arxiv: "arxiv";
|
|
1178
|
+
crossref: "crossref";
|
|
1179
|
+
eric: "eric";
|
|
1180
|
+
"europe-pmc": "europe-pmc";
|
|
1181
|
+
"google-scholar": "google-scholar";
|
|
1182
|
+
openalex: "openalex";
|
|
1183
|
+
pubmed: "pubmed";
|
|
1184
|
+
"semantic-scholar": "semantic-scholar";
|
|
1185
|
+
}>>>;
|
|
1186
|
+
providerData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1187
|
+
}, z.core.$strip>;
|
|
1188
|
+
citations: z.ZodArray<z.ZodObject<{
|
|
1189
|
+
doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1190
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1191
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1192
|
+
providerURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1193
|
+
authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1194
|
+
name: z.ZodString;
|
|
1195
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1196
|
+
}, z.core.$strip>>>>;
|
|
1197
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1198
|
+
year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1199
|
+
totalCitations: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1200
|
+
totalReferences: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1201
|
+
abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1202
|
+
pdfURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1203
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1204
|
+
arxiv: "arxiv";
|
|
1205
|
+
crossref: "crossref";
|
|
1206
|
+
eric: "eric";
|
|
1207
|
+
"europe-pmc": "europe-pmc";
|
|
1208
|
+
"google-scholar": "google-scholar";
|
|
1209
|
+
openalex: "openalex";
|
|
1210
|
+
pubmed: "pubmed";
|
|
1211
|
+
"semantic-scholar": "semantic-scholar";
|
|
1212
|
+
}>>>;
|
|
1213
|
+
providerData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1214
|
+
}, z.core.$strip>>;
|
|
1215
|
+
references: z.ZodArray<z.ZodObject<{
|
|
1216
|
+
doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1217
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1218
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1219
|
+
providerURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1220
|
+
authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1221
|
+
name: z.ZodString;
|
|
1222
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1223
|
+
}, z.core.$strip>>>>;
|
|
1224
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1225
|
+
year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1226
|
+
totalCitations: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1227
|
+
totalReferences: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1228
|
+
abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1229
|
+
pdfURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1230
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1231
|
+
arxiv: "arxiv";
|
|
1232
|
+
crossref: "crossref";
|
|
1233
|
+
eric: "eric";
|
|
1234
|
+
"europe-pmc": "europe-pmc";
|
|
1235
|
+
"google-scholar": "google-scholar";
|
|
1236
|
+
openalex: "openalex";
|
|
1237
|
+
pubmed: "pubmed";
|
|
1238
|
+
"semantic-scholar": "semantic-scholar";
|
|
1239
|
+
}>>>;
|
|
1240
|
+
providerData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1241
|
+
}, z.core.$strip>>;
|
|
1242
|
+
totalCitations: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1243
|
+
totalReferences: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1244
|
+
requestId: z.ZodNumber;
|
|
1245
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1246
|
+
declare const parse$4: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1247
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1248
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1249
|
+
model: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1250
|
+
auto: "auto";
|
|
1251
|
+
max: "max";
|
|
1252
|
+
mini: "mini";
|
|
1253
|
+
nano: "nano";
|
|
1254
|
+
pro: "pro";
|
|
1255
|
+
}>>>;
|
|
1256
|
+
includePages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1257
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1258
|
+
url: z.ZodURL;
|
|
1259
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1260
|
+
}, z.core.$strip>>;
|
|
1261
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1262
|
+
id: z.ZodString;
|
|
1263
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1264
|
+
doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1265
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1266
|
+
providerURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1267
|
+
pdfURL: z.ZodString;
|
|
1268
|
+
detectedProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1269
|
+
arxiv: "arxiv";
|
|
1270
|
+
crossref: "crossref";
|
|
1271
|
+
eric: "eric";
|
|
1272
|
+
"europe-pmc": "europe-pmc";
|
|
1273
|
+
"google-scholar": "google-scholar";
|
|
1274
|
+
openalex: "openalex";
|
|
1275
|
+
pubmed: "pubmed";
|
|
1276
|
+
"semantic-scholar": "semantic-scholar";
|
|
1277
|
+
}>>>;
|
|
1278
|
+
markdown: z.ZodString;
|
|
1279
|
+
pageCount: z.ZodNumber;
|
|
1280
|
+
model: z.ZodEnum<{
|
|
1281
|
+
max: "max";
|
|
1282
|
+
mini: "mini";
|
|
1283
|
+
nano: "nano";
|
|
1284
|
+
pro: "pro";
|
|
1285
|
+
}>;
|
|
1286
|
+
credits: z.ZodNumber;
|
|
1287
|
+
requestId: z.ZodNumber;
|
|
1288
|
+
html: z.ZodOptional<z.ZodString>;
|
|
1289
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1290
|
+
pageNumber: z.ZodNumber;
|
|
1291
|
+
markdown: z.ZodString;
|
|
1292
|
+
}, z.core.$strip>>>;
|
|
1293
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1294
|
+
declare const search: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1295
|
+
query: z.ZodString;
|
|
1296
|
+
providers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
1297
|
+
arxiv: "arxiv";
|
|
1298
|
+
crossref: "crossref";
|
|
1299
|
+
eric: "eric";
|
|
1300
|
+
"europe-pmc": "europe-pmc";
|
|
1301
|
+
"google-scholar": "google-scholar";
|
|
1302
|
+
openalex: "openalex";
|
|
1303
|
+
pubmed: "pubmed";
|
|
1304
|
+
"semantic-scholar": "semantic-scholar";
|
|
1305
|
+
}>>>;
|
|
1306
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
1307
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
1308
|
+
yearFrom: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1309
|
+
yearTo: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1310
|
+
fields: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
1311
|
+
abstract: "abstract";
|
|
1312
|
+
authors: "authors";
|
|
1313
|
+
date: "date";
|
|
1314
|
+
doi: "doi";
|
|
1315
|
+
pdfURL: "pdfURL";
|
|
1316
|
+
provider: "provider";
|
|
1317
|
+
providerData: "providerData";
|
|
1318
|
+
providerURL: "providerURL";
|
|
1319
|
+
title: "title";
|
|
1320
|
+
totalCitations: "totalCitations";
|
|
1321
|
+
totalReferences: "totalReferences";
|
|
1322
|
+
url: "url";
|
|
1323
|
+
year: "year";
|
|
1324
|
+
}>>>>;
|
|
1325
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1326
|
+
url: z.ZodURL;
|
|
1327
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1328
|
+
}, z.core.$strip>>;
|
|
1329
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1330
|
+
estimatedTotalResults: z.ZodNumber;
|
|
1331
|
+
results: z.ZodArray<z.ZodObject<{
|
|
1332
|
+
doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1333
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1334
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1335
|
+
providerURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1336
|
+
authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1337
|
+
name: z.ZodString;
|
|
1338
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1339
|
+
}, z.core.$strip>>>>;
|
|
1340
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1341
|
+
year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1342
|
+
totalCitations: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1343
|
+
totalReferences: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1344
|
+
abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1345
|
+
pdfURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1346
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1347
|
+
arxiv: "arxiv";
|
|
1348
|
+
crossref: "crossref";
|
|
1349
|
+
eric: "eric";
|
|
1350
|
+
"europe-pmc": "europe-pmc";
|
|
1351
|
+
"google-scholar": "google-scholar";
|
|
1352
|
+
openalex: "openalex";
|
|
1353
|
+
pubmed: "pubmed";
|
|
1354
|
+
"semantic-scholar": "semantic-scholar";
|
|
1355
|
+
}>>>;
|
|
1356
|
+
providerData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1357
|
+
}, z.core.$strip>>;
|
|
1358
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1359
|
+
provider: z.ZodEnum<{
|
|
1360
|
+
arxiv: "arxiv";
|
|
1361
|
+
crossref: "crossref";
|
|
1362
|
+
eric: "eric";
|
|
1363
|
+
"europe-pmc": "europe-pmc";
|
|
1364
|
+
"google-scholar": "google-scholar";
|
|
1365
|
+
openalex: "openalex";
|
|
1366
|
+
pubmed: "pubmed";
|
|
1367
|
+
"semantic-scholar": "semantic-scholar";
|
|
1368
|
+
}>;
|
|
1369
|
+
message: z.ZodString;
|
|
1370
|
+
code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1371
|
+
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1372
|
+
}, z.core.$strip>>>>;
|
|
1373
|
+
requestId: z.ZodNumber;
|
|
1374
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1375
|
+
declare const searchGrants: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1376
|
+
query: z.ZodString;
|
|
1377
|
+
providers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
1378
|
+
cordis: "cordis";
|
|
1379
|
+
"grants-gov": "grants-gov";
|
|
1380
|
+
"nih-reporter": "nih-reporter";
|
|
1381
|
+
ukri: "ukri";
|
|
1382
|
+
}>>>;
|
|
1383
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
1384
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
1385
|
+
deadlineFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1386
|
+
deadlineTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1387
|
+
fundingMin: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1388
|
+
fundingMax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1389
|
+
fields: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
1390
|
+
agency: "agency";
|
|
1391
|
+
closeDate: "closeDate";
|
|
1392
|
+
currency: "currency";
|
|
1393
|
+
deadlineDate: "deadlineDate";
|
|
1394
|
+
description: "description";
|
|
1395
|
+
eligibility: "eligibility";
|
|
1396
|
+
fundingAmountMax: "fundingAmountMax";
|
|
1397
|
+
fundingAmountMin: "fundingAmountMin";
|
|
1398
|
+
grantType: "grantType";
|
|
1399
|
+
keywords: "keywords";
|
|
1400
|
+
openDate: "openDate";
|
|
1401
|
+
organizationName: "organizationName";
|
|
1402
|
+
piName: "piName";
|
|
1403
|
+
program: "program";
|
|
1404
|
+
provider: "provider";
|
|
1405
|
+
providerData: "providerData";
|
|
1406
|
+
region: "region";
|
|
1407
|
+
sourceId: "sourceId";
|
|
1408
|
+
title: "title";
|
|
1409
|
+
url: "url";
|
|
1410
|
+
}>>>>;
|
|
1411
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1412
|
+
url: z.ZodURL;
|
|
1413
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1414
|
+
}, z.core.$strip>>;
|
|
1415
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1416
|
+
estimatedTotalResults: z.ZodNumber;
|
|
1417
|
+
results: z.ZodArray<z.ZodObject<{
|
|
1418
|
+
sourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1419
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1420
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1421
|
+
agency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1422
|
+
program: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1423
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1424
|
+
eligibility: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1425
|
+
fundingAmountMin: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1426
|
+
fundingAmountMax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1427
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1428
|
+
deadlineDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1429
|
+
openDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1430
|
+
closeDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1431
|
+
grantType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1432
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1433
|
+
keywords: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1434
|
+
piName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1435
|
+
organizationName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1436
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1437
|
+
cordis: "cordis";
|
|
1438
|
+
"grants-gov": "grants-gov";
|
|
1439
|
+
"nih-reporter": "nih-reporter";
|
|
1440
|
+
ukri: "ukri";
|
|
1441
|
+
}>>>;
|
|
1442
|
+
providerData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1443
|
+
}, z.core.$strip>>;
|
|
1444
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1445
|
+
provider: z.ZodEnum<{
|
|
1446
|
+
cordis: "cordis";
|
|
1447
|
+
"grants-gov": "grants-gov";
|
|
1448
|
+
"nih-reporter": "nih-reporter";
|
|
1449
|
+
ukri: "ukri";
|
|
1450
|
+
}>;
|
|
1451
|
+
message: z.ZodString;
|
|
1452
|
+
code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1453
|
+
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1454
|
+
}, z.core.$strip>>>>;
|
|
1455
|
+
requestId: z.ZodNumber;
|
|
1456
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1457
|
+
declare const similarPapers: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1458
|
+
id: z.ZodString;
|
|
1459
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
1460
|
+
includeEdges: z.ZodDefault<z.ZodBoolean>;
|
|
1461
|
+
fields: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
1462
|
+
abstract: "abstract";
|
|
1463
|
+
authors: "authors";
|
|
1464
|
+
date: "date";
|
|
1465
|
+
doi: "doi";
|
|
1466
|
+
pdfURL: "pdfURL";
|
|
1467
|
+
provider: "provider";
|
|
1468
|
+
providerData: "providerData";
|
|
1469
|
+
providerURL: "providerURL";
|
|
1470
|
+
title: "title";
|
|
1471
|
+
totalCitations: "totalCitations";
|
|
1472
|
+
totalReferences: "totalReferences";
|
|
1473
|
+
url: "url";
|
|
1474
|
+
year: "year";
|
|
1475
|
+
}>>>>;
|
|
1476
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1477
|
+
url: z.ZodURL;
|
|
1478
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1479
|
+
}, z.core.$strip>>;
|
|
1480
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1481
|
+
seed: z.ZodObject<{
|
|
1482
|
+
doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1483
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1484
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1485
|
+
providerURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1486
|
+
authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1487
|
+
name: z.ZodString;
|
|
1488
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1489
|
+
}, z.core.$strip>>>>;
|
|
1490
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1491
|
+
year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1492
|
+
totalCitations: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1493
|
+
totalReferences: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1494
|
+
abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1495
|
+
pdfURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1496
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1497
|
+
arxiv: "arxiv";
|
|
1498
|
+
crossref: "crossref";
|
|
1499
|
+
eric: "eric";
|
|
1500
|
+
"europe-pmc": "europe-pmc";
|
|
1501
|
+
"google-scholar": "google-scholar";
|
|
1502
|
+
openalex: "openalex";
|
|
1503
|
+
pubmed: "pubmed";
|
|
1504
|
+
"semantic-scholar": "semantic-scholar";
|
|
1505
|
+
}>>>;
|
|
1506
|
+
providerData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1507
|
+
}, z.core.$strip>;
|
|
1508
|
+
results: z.ZodArray<z.ZodObject<{
|
|
1509
|
+
publication: z.ZodObject<{
|
|
1510
|
+
doi: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1511
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1512
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1513
|
+
providerURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1514
|
+
authors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1515
|
+
name: z.ZodString;
|
|
1516
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1517
|
+
}, z.core.$strip>>>>;
|
|
1518
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1519
|
+
year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1520
|
+
totalCitations: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1521
|
+
totalReferences: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1522
|
+
abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1523
|
+
pdfURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1524
|
+
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1525
|
+
arxiv: "arxiv";
|
|
1526
|
+
crossref: "crossref";
|
|
1527
|
+
eric: "eric";
|
|
1528
|
+
"europe-pmc": "europe-pmc";
|
|
1529
|
+
"google-scholar": "google-scholar";
|
|
1530
|
+
openalex: "openalex";
|
|
1531
|
+
pubmed: "pubmed";
|
|
1532
|
+
"semantic-scholar": "semantic-scholar";
|
|
1533
|
+
}>>>;
|
|
1534
|
+
providerData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1535
|
+
}, z.core.$strip>;
|
|
1536
|
+
similarity: z.ZodNumber;
|
|
1537
|
+
pageRank: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1538
|
+
distance: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1539
|
+
citingIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1540
|
+
citedByIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1541
|
+
}, z.core.$strip>>;
|
|
1542
|
+
requestId: z.ZodNumber;
|
|
1543
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1544
|
+
declare namespace index_d_exports$8 {
|
|
1545
|
+
export { fetch, findCitations, paperGraph, parse$4 as parse, search, searchGrants, similarPapers };
|
|
1546
|
+
}
|
|
1547
|
+
declare const getEnvironment: ContractProcedureBuilderWithOutput<Schema$1<unknown, unknown>, z.ZodObject<{
|
|
1548
|
+
environment: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1549
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1550
|
+
declare const getFreeUsageRecords: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1551
|
+
cursor: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1552
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1553
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1554
|
+
records: z.ZodArray<z.ZodObject<{
|
|
1555
|
+
id: z.ZodNumber;
|
|
1556
|
+
operation: z.ZodString;
|
|
1557
|
+
ip: z.ZodString;
|
|
1558
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
1559
|
+
api: "api";
|
|
1560
|
+
internal: "internal";
|
|
1561
|
+
make: "make";
|
|
1562
|
+
mcp: "mcp";
|
|
1563
|
+
n8n: "n8n";
|
|
1564
|
+
playground: "playground";
|
|
1565
|
+
sdk: "sdk";
|
|
1566
|
+
unknown: "unknown";
|
|
1567
|
+
zapier: "zapier";
|
|
1568
|
+
}>>;
|
|
1569
|
+
model: z.ZodNullable<z.ZodString>;
|
|
1570
|
+
inputSource: z.ZodNullable<z.ZodString>;
|
|
1571
|
+
inputRef: z.ZodNullable<z.ZodString>;
|
|
1572
|
+
fileSize: z.ZodNullable<z.ZodNumber>;
|
|
1573
|
+
documentType: z.ZodNullable<z.ZodString>;
|
|
1574
|
+
pageCount: z.ZodNullable<z.ZodNumber>;
|
|
1575
|
+
error: z.ZodNullable<z.ZodString>;
|
|
1576
|
+
status: z.ZodEnum<{
|
|
1577
|
+
success: "success";
|
|
1578
|
+
system_error: "system_error";
|
|
1579
|
+
user_error: "user_error";
|
|
1580
|
+
}>;
|
|
1581
|
+
errorStage: z.ZodNullable<z.ZodEnum<{
|
|
1582
|
+
auth: "auth";
|
|
1583
|
+
preprocessing: "preprocessing";
|
|
1584
|
+
processing: "processing";
|
|
1585
|
+
validation: "validation";
|
|
1586
|
+
}>>;
|
|
1587
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
1588
|
+
duration: z.ZodNumber;
|
|
1589
|
+
createdAt: z.ZodNumber;
|
|
1590
|
+
}, z.core.$strip>>;
|
|
1591
|
+
hasMore: z.ZodBoolean;
|
|
1592
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1593
|
+
declare const getProviderUsageRecords: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1594
|
+
cursor: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1595
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1596
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1597
|
+
records: z.ZodArray<z.ZodObject<{
|
|
1598
|
+
id: z.ZodNumber;
|
|
1599
|
+
apiUsageId: z.ZodNullable<z.ZodNumber>;
|
|
1600
|
+
operation: z.ZodString;
|
|
1601
|
+
phase: z.ZodString;
|
|
1602
|
+
provider: z.ZodString;
|
|
1603
|
+
service: z.ZodString;
|
|
1604
|
+
providerModel: z.ZodNullable<z.ZodString>;
|
|
1605
|
+
providerRegion: z.ZodNullable<z.ZodString>;
|
|
1606
|
+
providerResource: z.ZodNullable<z.ZodString>;
|
|
1607
|
+
documentType: z.ZodNullable<z.ZodString>;
|
|
1608
|
+
fileSize: z.ZodNullable<z.ZodNumber>;
|
|
1609
|
+
pageCount: z.ZodNullable<z.ZodNumber>;
|
|
1610
|
+
inputTokens: z.ZodNullable<z.ZodNumber>;
|
|
1611
|
+
uncachedInputTokens: z.ZodNullable<z.ZodNumber>;
|
|
1612
|
+
cachedInputTokens: z.ZodNullable<z.ZodNumber>;
|
|
1613
|
+
cacheWriteTokens: z.ZodNullable<z.ZodNumber>;
|
|
1614
|
+
outputTokens: z.ZodNullable<z.ZodNumber>;
|
|
1615
|
+
reasoningTokens: z.ZodNullable<z.ZodNumber>;
|
|
1616
|
+
totalTokens: z.ZodNullable<z.ZodNumber>;
|
|
1617
|
+
featuresJson: z.ZodNullable<z.ZodString>;
|
|
1618
|
+
status: z.ZodEnum<{
|
|
1619
|
+
success: "success";
|
|
1620
|
+
system_error: "system_error";
|
|
1621
|
+
user_error: "user_error";
|
|
1622
|
+
}>;
|
|
1623
|
+
error: z.ZodNullable<z.ZodString>;
|
|
1624
|
+
duration: z.ZodNumber;
|
|
1625
|
+
estimatedCostUsdMicro: z.ZodNullable<z.ZodNumber>;
|
|
1626
|
+
pricingVersion: z.ZodNullable<z.ZodString>;
|
|
1627
|
+
rawUsageJson: z.ZodNullable<z.ZodString>;
|
|
1628
|
+
createdAt: z.ZodNumber;
|
|
1629
|
+
}, z.core.$strip>>;
|
|
1630
|
+
hasMore: z.ZodBoolean;
|
|
1631
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1632
|
+
declare const getUsageRecords: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1633
|
+
cursor: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1634
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1635
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1636
|
+
records: z.ZodArray<z.ZodObject<{
|
|
1637
|
+
id: z.ZodNumber;
|
|
1638
|
+
credits: z.ZodNumber;
|
|
1639
|
+
model: z.ZodNullable<z.ZodString>;
|
|
1640
|
+
inputSource: z.ZodString;
|
|
1641
|
+
inputRef: z.ZodNullable<z.ZodString>;
|
|
1642
|
+
fileSize: z.ZodNumber;
|
|
1643
|
+
documentType: z.ZodString;
|
|
1644
|
+
documentId: z.ZodNullable<z.ZodString>;
|
|
1645
|
+
error: z.ZodNullable<z.ZodString>;
|
|
1646
|
+
status: z.ZodEnum<{
|
|
1647
|
+
success: "success";
|
|
1648
|
+
system_error: "system_error";
|
|
1649
|
+
user_error: "user_error";
|
|
1650
|
+
}>;
|
|
1651
|
+
errorStage: z.ZodNullable<z.ZodEnum<{
|
|
1652
|
+
auth: "auth";
|
|
1653
|
+
preprocessing: "preprocessing";
|
|
1654
|
+
processing: "processing";
|
|
1655
|
+
validation: "validation";
|
|
1656
|
+
}>>;
|
|
1657
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
1658
|
+
duration: z.ZodNumber;
|
|
1659
|
+
operation: z.ZodString;
|
|
1660
|
+
pageCount: z.ZodNullable<z.ZodNumber>;
|
|
1661
|
+
requestedModel: z.ZodString;
|
|
1662
|
+
actualModel: z.ZodNullable<z.ZodString>;
|
|
1663
|
+
apiKey: z.ZodNullable<z.ZodString>;
|
|
1664
|
+
workspaceId: z.ZodNullable<z.ZodNumber>;
|
|
1665
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
1666
|
+
api: "api";
|
|
1667
|
+
internal: "internal";
|
|
1668
|
+
make: "make";
|
|
1669
|
+
mcp: "mcp";
|
|
1670
|
+
n8n: "n8n";
|
|
1671
|
+
playground: "playground";
|
|
1672
|
+
sdk: "sdk";
|
|
1673
|
+
unknown: "unknown";
|
|
1674
|
+
zapier: "zapier";
|
|
1675
|
+
}>>;
|
|
1676
|
+
createdAt: z.ZodNumber;
|
|
1677
|
+
}, z.core.$strip>>;
|
|
1678
|
+
hasMore: z.ZodBoolean;
|
|
1679
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1680
|
+
declare const healthCheck: ContractProcedureBuilderWithOutput<Schema$1<unknown, unknown>, z.ZodObject<{
|
|
1681
|
+
message: z.ZodString;
|
|
1682
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1683
|
+
declare const setDomain: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1684
|
+
domain: z.ZodString;
|
|
1685
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1686
|
+
message: z.ZodString;
|
|
1687
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1688
|
+
declare const setEnvironment: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1689
|
+
environment: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
1690
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1691
|
+
message: z.ZodString;
|
|
1692
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1693
|
+
declare const setVersion: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1694
|
+
version: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"LATEST">]>;
|
|
1695
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1696
|
+
message: z.ZodString;
|
|
1697
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1698
|
+
declare namespace index_d_exports$7 {
|
|
1699
|
+
export { getEnvironment, getFreeUsageRecords, getProviderUsageRecords, getUsageRecords, healthCheck, setDomain, setEnvironment, setVersion };
|
|
1700
|
+
}
|
|
1701
|
+
declare const validateCredential: ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
|
|
1702
|
+
status: z.ZodString;
|
|
1703
|
+
version: z.ZodString;
|
|
1704
|
+
timestamp: z.ZodString;
|
|
1705
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1706
|
+
declare namespace index_d_exports$6 {
|
|
1707
|
+
export { validateCredential };
|
|
1708
|
+
}
|
|
1709
|
+
declare const ask$3: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1710
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1711
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
1712
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
1713
|
+
question: z.ZodString;
|
|
1714
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
1715
|
+
auto: "auto";
|
|
1716
|
+
max: "max";
|
|
1717
|
+
mini: "mini";
|
|
1718
|
+
nano: "nano";
|
|
1719
|
+
pro: "pro";
|
|
1720
|
+
}>>;
|
|
1721
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1722
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1723
|
+
url: z.ZodURL;
|
|
1724
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1725
|
+
}, z.core.$strip>>;
|
|
1726
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1727
|
+
markdown: z.ZodString;
|
|
1728
|
+
pageCount: z.ZodNumber;
|
|
1729
|
+
model: z.ZodEnum<{
|
|
1730
|
+
max: "max";
|
|
1731
|
+
mini: "mini";
|
|
1732
|
+
nano: "nano";
|
|
1733
|
+
pro: "pro";
|
|
1734
|
+
}>;
|
|
1735
|
+
credits: z.ZodNumber;
|
|
1736
|
+
requestId: z.ZodNumber;
|
|
1737
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1738
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1739
|
+
declare const extract$3: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1740
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1741
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
1742
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
1743
|
+
prompt: z.ZodString;
|
|
1744
|
+
schema: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<unknown, string>>, z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
|
|
1745
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
1746
|
+
auto: "auto";
|
|
1747
|
+
max: "max";
|
|
1748
|
+
mini: "mini";
|
|
1749
|
+
nano: "nano";
|
|
1750
|
+
pro: "pro";
|
|
1751
|
+
}>>;
|
|
1752
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1753
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1754
|
+
url: z.ZodURL;
|
|
1755
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1756
|
+
}, z.core.$strip>>;
|
|
1757
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1758
|
+
data: z.ZodUnknown;
|
|
1759
|
+
pageCount: z.ZodNumber;
|
|
1760
|
+
model: z.ZodEnum<{
|
|
1761
|
+
max: "max";
|
|
1762
|
+
mini: "mini";
|
|
1763
|
+
nano: "nano";
|
|
1764
|
+
pro: "pro";
|
|
1765
|
+
}>;
|
|
1766
|
+
credits: z.ZodNumber;
|
|
1767
|
+
requestId: z.ZodNumber;
|
|
1768
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1769
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1770
|
+
declare const parse$3: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1771
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1772
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
1773
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
1774
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
1775
|
+
auto: "auto";
|
|
1776
|
+
max: "max";
|
|
1777
|
+
pro: "pro";
|
|
1778
|
+
}>>;
|
|
1779
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1780
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1781
|
+
url: z.ZodURL;
|
|
1782
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1783
|
+
}, z.core.$strip>>;
|
|
1784
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1785
|
+
markdown: z.ZodString;
|
|
1786
|
+
pageCount: z.ZodNumber;
|
|
1787
|
+
model: z.ZodEnum<{
|
|
1788
|
+
max: "max";
|
|
1789
|
+
pro: "pro";
|
|
1790
|
+
}>;
|
|
1791
|
+
credits: z.ZodNumber;
|
|
1792
|
+
requestId: z.ZodNumber;
|
|
1793
|
+
html: z.ZodOptional<z.ZodString>;
|
|
1794
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1795
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1796
|
+
declare namespace index_d_exports$5 {
|
|
1797
|
+
export { ask$3 as ask, extract$3 as extract, parse$3 as parse };
|
|
1798
|
+
}
|
|
1799
|
+
declare const ask$2: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1800
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1801
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
1802
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
1803
|
+
question: z.ZodString;
|
|
1804
|
+
model: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1805
|
+
auto: "auto";
|
|
1806
|
+
max: "max";
|
|
1807
|
+
mini: "mini";
|
|
1808
|
+
nano: "nano";
|
|
1809
|
+
pro: "pro";
|
|
1810
|
+
}>>>;
|
|
1811
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1812
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1813
|
+
url: z.ZodURL;
|
|
1814
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1815
|
+
}, z.core.$strip>>;
|
|
1816
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1817
|
+
markdown: z.ZodString;
|
|
1818
|
+
pageCount: z.ZodNumber;
|
|
1819
|
+
model: z.ZodEnum<{
|
|
1820
|
+
max: "max";
|
|
1821
|
+
mini: "mini";
|
|
1822
|
+
nano: "nano";
|
|
1823
|
+
pro: "pro";
|
|
1824
|
+
}>;
|
|
1825
|
+
credits: z.ZodNumber;
|
|
1826
|
+
requestId: z.ZodNumber;
|
|
1827
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1828
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1829
|
+
declare const extract$2: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1830
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1831
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
1832
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
1833
|
+
prompt: z.ZodString;
|
|
1834
|
+
schema: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<unknown, string>>, z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
|
|
1835
|
+
model: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1836
|
+
auto: "auto";
|
|
1837
|
+
max: "max";
|
|
1838
|
+
mini: "mini";
|
|
1839
|
+
nano: "nano";
|
|
1840
|
+
pro: "pro";
|
|
1841
|
+
}>>>;
|
|
1842
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1843
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1844
|
+
url: z.ZodURL;
|
|
1845
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1846
|
+
}, z.core.$strip>>;
|
|
1847
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1848
|
+
data: z.ZodUnknown;
|
|
1849
|
+
pageCount: z.ZodNumber;
|
|
1850
|
+
model: z.ZodEnum<{
|
|
1851
|
+
max: "max";
|
|
1852
|
+
mini: "mini";
|
|
1853
|
+
nano: "nano";
|
|
1854
|
+
pro: "pro";
|
|
1855
|
+
}>;
|
|
1856
|
+
credits: z.ZodNumber;
|
|
1857
|
+
requestId: z.ZodNumber;
|
|
1858
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1859
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1860
|
+
declare const parse$2: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1861
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1862
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
1863
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
1864
|
+
model: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1865
|
+
auto: "auto";
|
|
1866
|
+
max: "max";
|
|
1867
|
+
mini: "mini";
|
|
1868
|
+
nano: "nano";
|
|
1869
|
+
pro: "pro";
|
|
1870
|
+
}>>>;
|
|
1871
|
+
includePages: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodPipe<z.ZodEnum<{
|
|
1872
|
+
false: "false";
|
|
1873
|
+
true: "true";
|
|
1874
|
+
}>, z.ZodTransform<boolean, "false" | "true">>]>>>;
|
|
1875
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1876
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1877
|
+
url: z.ZodURL;
|
|
1878
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1879
|
+
}, z.core.$strip>>;
|
|
1880
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1881
|
+
documentFormat: z.ZodOptional<z.ZodEnum<{
|
|
1882
|
+
csv: "csv";
|
|
1883
|
+
docx: "docx";
|
|
1884
|
+
html: "html";
|
|
1885
|
+
json: "json";
|
|
1886
|
+
md: "md";
|
|
1887
|
+
odp: "odp";
|
|
1888
|
+
ods: "ods";
|
|
1889
|
+
odt: "odt";
|
|
1890
|
+
pdf: "pdf";
|
|
1891
|
+
pptx: "pptx";
|
|
1892
|
+
rtf: "rtf";
|
|
1893
|
+
tsv: "tsv";
|
|
1894
|
+
txt: "txt";
|
|
1895
|
+
vtt: "vtt";
|
|
1896
|
+
xlsx: "xlsx";
|
|
1897
|
+
xml: "xml";
|
|
1898
|
+
}>>;
|
|
1899
|
+
pageUnit: z.ZodOptional<z.ZodEnum<{
|
|
1900
|
+
chunk: "chunk";
|
|
1901
|
+
page: "page";
|
|
1902
|
+
sheet: "sheet";
|
|
1903
|
+
slide: "slide";
|
|
1904
|
+
}>>;
|
|
1905
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1906
|
+
markdown: z.ZodString;
|
|
1907
|
+
pageCount: z.ZodNumber;
|
|
1908
|
+
model: z.ZodEnum<{
|
|
1909
|
+
max: "max";
|
|
1910
|
+
mini: "mini";
|
|
1911
|
+
nano: "nano";
|
|
1912
|
+
pro: "pro";
|
|
1913
|
+
}>;
|
|
1914
|
+
credits: z.ZodNumber;
|
|
1915
|
+
requestId: z.ZodNumber;
|
|
1916
|
+
html: z.ZodOptional<z.ZodString>;
|
|
1917
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1918
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1919
|
+
pageNumber: z.ZodNumber;
|
|
1920
|
+
markdown: z.ZodString;
|
|
1921
|
+
}, z.core.$strip>>>;
|
|
1922
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1923
|
+
declare namespace index_d_exports$4 {
|
|
1924
|
+
export { ask$2 as ask, extract$2 as extract, parse$2 as parse };
|
|
1925
|
+
}
|
|
1926
|
+
declare const bankStatementParse: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1927
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1928
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
1929
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
1930
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1931
|
+
markdown: z.ZodString;
|
|
1932
|
+
pageCount: z.ZodNumber;
|
|
1933
|
+
model: z.ZodEnum<{
|
|
1934
|
+
max: "max";
|
|
1935
|
+
pro: "pro";
|
|
1936
|
+
}>;
|
|
1937
|
+
requestId: z.ZodNumber;
|
|
1938
|
+
html: z.ZodOptional<z.ZodString>;
|
|
1939
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1940
|
+
declare const generateSchema: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1941
|
+
instruction: z.ZodString;
|
|
1942
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1943
|
+
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1944
|
+
requestId: z.ZodNumber;
|
|
1945
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1946
|
+
declare const publicationPdfUrl: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1947
|
+
ids: z.ZodArray<z.ZodString>;
|
|
1948
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1949
|
+
results: z.ZodArray<z.ZodObject<{
|
|
1950
|
+
id: z.ZodString;
|
|
1951
|
+
pdfUrl: z.ZodOptional<z.ZodString>;
|
|
1952
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1953
|
+
}, z.core.$strip>>;
|
|
1954
|
+
requestId: z.ZodNumber;
|
|
1955
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1956
|
+
declare const rateLimitStatus: ContractProcedureBuilderWithOutput<Schema$1<unknown, unknown>, z.ZodObject<{
|
|
1957
|
+
bankStatementParse: z.ZodObject<{
|
|
1958
|
+
limit: z.ZodNumber;
|
|
1959
|
+
used: z.ZodNumber;
|
|
1960
|
+
remaining: z.ZodNumber;
|
|
1961
|
+
}, z.core.$strip>;
|
|
1962
|
+
generateSchema: z.ZodObject<{
|
|
1963
|
+
limit: z.ZodNumber;
|
|
1964
|
+
used: z.ZodNumber;
|
|
1965
|
+
remaining: z.ZodNumber;
|
|
1966
|
+
}, z.core.$strip>;
|
|
1967
|
+
publicationPdfUrl: z.ZodObject<{
|
|
1968
|
+
limit: z.ZodNumber;
|
|
1969
|
+
used: z.ZodNumber;
|
|
1970
|
+
remaining: z.ZodNumber;
|
|
1971
|
+
}, z.core.$strip>;
|
|
1972
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1973
|
+
declare namespace index_d_exports$3 {
|
|
1974
|
+
export { bankStatementParse, generateSchema, publicationPdfUrl, rateLimitStatus };
|
|
1975
|
+
}
|
|
1976
|
+
declare const ask$1: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1977
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1978
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
1979
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
1980
|
+
question: z.ZodString;
|
|
1981
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
1982
|
+
auto: "auto";
|
|
1983
|
+
max: "max";
|
|
1984
|
+
mini: "mini";
|
|
1985
|
+
nano: "nano";
|
|
1986
|
+
pro: "pro";
|
|
1987
|
+
}>>;
|
|
1988
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1989
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
1990
|
+
url: z.ZodURL;
|
|
1991
|
+
type: z.ZodOptional<z.ZodString>;
|
|
1992
|
+
}, z.core.$strip>>;
|
|
1993
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1994
|
+
markdown: z.ZodString;
|
|
1995
|
+
pageCount: z.ZodNumber;
|
|
1996
|
+
model: z.ZodEnum<{
|
|
1997
|
+
max: "max";
|
|
1998
|
+
mini: "mini";
|
|
1999
|
+
nano: "nano";
|
|
2000
|
+
pro: "pro";
|
|
2001
|
+
}>;
|
|
2002
|
+
credits: z.ZodNumber;
|
|
2003
|
+
requestId: z.ZodNumber;
|
|
2004
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2005
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
2006
|
+
declare const extract$1: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
2007
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
2008
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
2009
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
2010
|
+
prompt: z.ZodString;
|
|
2011
|
+
schema: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<unknown, string>>, z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
|
|
2012
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
2013
|
+
auto: "auto";
|
|
2014
|
+
max: "max";
|
|
2015
|
+
mini: "mini";
|
|
2016
|
+
nano: "nano";
|
|
2017
|
+
pro: "pro";
|
|
2018
|
+
}>>;
|
|
2019
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2020
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
2021
|
+
url: z.ZodURL;
|
|
2022
|
+
type: z.ZodOptional<z.ZodString>;
|
|
2023
|
+
}, z.core.$strip>>;
|
|
2024
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2025
|
+
data: z.ZodUnknown;
|
|
2026
|
+
pageCount: z.ZodNumber;
|
|
2027
|
+
model: z.ZodEnum<{
|
|
2028
|
+
max: "max";
|
|
2029
|
+
mini: "mini";
|
|
2030
|
+
nano: "nano";
|
|
2031
|
+
pro: "pro";
|
|
2032
|
+
}>;
|
|
2033
|
+
credits: z.ZodNumber;
|
|
2034
|
+
requestId: z.ZodNumber;
|
|
2035
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2036
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
2037
|
+
declare const parse$1: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
2038
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
2039
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
2040
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
2041
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
2042
|
+
auto: "auto";
|
|
2043
|
+
max: "max";
|
|
2044
|
+
pro: "pro";
|
|
2045
|
+
}>>;
|
|
2046
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2047
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
2048
|
+
url: z.ZodURL;
|
|
2049
|
+
type: z.ZodOptional<z.ZodString>;
|
|
2050
|
+
}, z.core.$strip>>;
|
|
2051
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2052
|
+
markdown: z.ZodString;
|
|
2053
|
+
pageCount: z.ZodNumber;
|
|
2054
|
+
model: z.ZodEnum<{
|
|
2055
|
+
max: "max";
|
|
2056
|
+
pro: "pro";
|
|
2057
|
+
}>;
|
|
2058
|
+
documentType: z.ZodOptional<z.ZodString>;
|
|
2059
|
+
html: z.ZodOptional<z.ZodString>;
|
|
2060
|
+
credits: z.ZodNumber;
|
|
2061
|
+
requestId: z.ZodNumber;
|
|
2062
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2063
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
2064
|
+
declare namespace index_d_exports$2 {
|
|
2065
|
+
export { ask$1 as ask, extract$1 as extract, parse$1 as parse };
|
|
2066
|
+
}
|
|
2067
|
+
declare const ask: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
2068
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
2069
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
2070
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
2071
|
+
question: z.ZodString;
|
|
2072
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
2073
|
+
auto: "auto";
|
|
2074
|
+
max: "max";
|
|
2075
|
+
mini: "mini";
|
|
2076
|
+
nano: "nano";
|
|
2077
|
+
pro: "pro";
|
|
2078
|
+
}>>;
|
|
2079
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2080
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
2081
|
+
url: z.ZodURL;
|
|
2082
|
+
type: z.ZodOptional<z.ZodString>;
|
|
2083
|
+
}, z.core.$strip>>;
|
|
2084
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2085
|
+
markdown: z.ZodString;
|
|
2086
|
+
pageCount: z.ZodNumber;
|
|
2087
|
+
model: z.ZodEnum<{
|
|
2088
|
+
max: "max";
|
|
2089
|
+
mini: "mini";
|
|
2090
|
+
nano: "nano";
|
|
2091
|
+
pro: "pro";
|
|
2092
|
+
}>;
|
|
2093
|
+
credits: z.ZodNumber;
|
|
2094
|
+
requestId: z.ZodNumber;
|
|
2095
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2096
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
2097
|
+
declare const extract: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
2098
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
2099
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
2100
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
2101
|
+
prompt: z.ZodString;
|
|
2102
|
+
schema: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<unknown, string>>, z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
|
|
2103
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
2104
|
+
auto: "auto";
|
|
2105
|
+
max: "max";
|
|
2106
|
+
mini: "mini";
|
|
2107
|
+
nano: "nano";
|
|
2108
|
+
pro: "pro";
|
|
2109
|
+
}>>;
|
|
2110
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2111
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
2112
|
+
url: z.ZodURL;
|
|
2113
|
+
type: z.ZodOptional<z.ZodString>;
|
|
2114
|
+
}, z.core.$strip>>;
|
|
2115
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2116
|
+
data: z.ZodUnknown;
|
|
2117
|
+
pageCount: z.ZodNumber;
|
|
2118
|
+
model: z.ZodEnum<{
|
|
2119
|
+
max: "max";
|
|
2120
|
+
mini: "mini";
|
|
2121
|
+
nano: "nano";
|
|
2122
|
+
pro: "pro";
|
|
2123
|
+
}>;
|
|
2124
|
+
credits: z.ZodNumber;
|
|
2125
|
+
requestId: z.ZodNumber;
|
|
2126
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2127
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
2128
|
+
declare const parse: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
2129
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
2130
|
+
file: z.ZodOptional<z.ZodFile>;
|
|
2131
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
2132
|
+
model: z.ZodDefault<z.ZodEnum<{
|
|
2133
|
+
auto: "auto";
|
|
2134
|
+
max: "max";
|
|
2135
|
+
pro: "pro";
|
|
2136
|
+
}>>;
|
|
2137
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2138
|
+
callback: z.ZodOptional<z.ZodObject<{
|
|
2139
|
+
url: z.ZodURL;
|
|
2140
|
+
type: z.ZodOptional<z.ZodString>;
|
|
2141
|
+
}, z.core.$strip>>;
|
|
2142
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2143
|
+
markdown: z.ZodString;
|
|
2144
|
+
pageCount: z.ZodNumber;
|
|
2145
|
+
model: z.ZodEnum<{
|
|
2146
|
+
max: "max";
|
|
2147
|
+
pro: "pro";
|
|
2148
|
+
}>;
|
|
2149
|
+
credits: z.ZodNumber;
|
|
2150
|
+
requestId: z.ZodNumber;
|
|
2151
|
+
html: z.ZodOptional<z.ZodString>;
|
|
2152
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
2153
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
2154
|
+
declare namespace index_d_exports$1 {
|
|
2155
|
+
export { ask, extract, parse };
|
|
2156
|
+
}
|
|
2157
|
+
declare namespace index_d_exports {
|
|
2158
|
+
export { index_d_exports$8 as academic, index_d_exports$7 as admin, index_d_exports$6 as authenticate, index_d_exports$5 as bankStatement, index_d_exports$4 as document, index_d_exports$3 as free, index_d_exports$2 as identity, index_d_exports$1 as invoice };
|
|
2159
|
+
}
|
|
2160
|
+
interface ToEventStreamOptions {
|
|
2161
|
+
/**
|
|
2162
|
+
* If true, a ping comment is sent periodically to keep the connection alive.
|
|
2163
|
+
*
|
|
2164
|
+
* @default true
|
|
2165
|
+
*/
|
|
2166
|
+
eventIteratorKeepAliveEnabled?: boolean;
|
|
2167
|
+
/**
|
|
2168
|
+
* Interval (in milliseconds) between ping comments sent after the last event.
|
|
2169
|
+
*
|
|
2170
|
+
* @default 5000
|
|
2171
|
+
*/
|
|
2172
|
+
eventIteratorKeepAliveInterval?: number;
|
|
2173
|
+
/**
|
|
2174
|
+
* The content of the ping comment. Must not include newline characters.
|
|
2175
|
+
*
|
|
2176
|
+
* @default ''
|
|
2177
|
+
*/
|
|
2178
|
+
eventIteratorKeepAliveComment?: string;
|
|
2179
|
+
/**
|
|
2180
|
+
* If true, an initial comment is sent immediately upon stream start to flush headers.
|
|
2181
|
+
* This allows the receiving side to establish the connection without waiting for the first event.
|
|
2182
|
+
*
|
|
2183
|
+
* @default true
|
|
2184
|
+
*/
|
|
2185
|
+
eventIteratorInitialCommentEnabled?: boolean;
|
|
2186
|
+
/**
|
|
2187
|
+
* The content of the initial comment sent upon stream start. Must not include newline characters.
|
|
2188
|
+
*
|
|
2189
|
+
* @default ''
|
|
2190
|
+
*/
|
|
2191
|
+
eventIteratorInitialComment?: string;
|
|
2192
|
+
}
|
|
2193
|
+
interface ToFetchBodyOptions extends ToEventStreamOptions {}
|
|
2194
|
+
interface ToFetchRequestOptions extends ToFetchBodyOptions {}
|
|
2195
|
+
interface StandardLinkPlugin<T extends ClientContext$1> {
|
|
2196
|
+
order?: number;
|
|
2197
|
+
init?(options: StandardLinkOptions<T>): void;
|
|
2198
|
+
}
|
|
2199
|
+
interface StandardLinkCodec<T extends ClientContext$1> {
|
|
2200
|
+
encode(path: readonly string[], input: unknown, options: ClientOptions<T>): Promise<StandardRequest>;
|
|
2201
|
+
decode(response: StandardLazyResponse, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<unknown>;
|
|
2202
|
+
}
|
|
2203
|
+
interface StandardLinkClient<T extends ClientContext$1> {
|
|
2204
|
+
call(request: StandardRequest, options: ClientOptions<T>, path: readonly string[], input: unknown): Promise<StandardLazyResponse>;
|
|
2205
|
+
}
|
|
2206
|
+
interface StandardLinkInterceptorOptions<T extends ClientContext$1> extends ClientOptions<T> {
|
|
2207
|
+
path: readonly string[];
|
|
2208
|
+
input: unknown;
|
|
2209
|
+
}
|
|
2210
|
+
interface StandardLinkClientInterceptorOptions<T extends ClientContext$1> extends StandardLinkInterceptorOptions<T> {
|
|
2211
|
+
request: StandardRequest;
|
|
2212
|
+
}
|
|
2213
|
+
interface StandardLinkOptions<T extends ClientContext$1> {
|
|
2214
|
+
interceptors?: Interceptor<StandardLinkInterceptorOptions<T>, Promise<unknown>>[];
|
|
2215
|
+
clientInterceptors?: Interceptor<StandardLinkClientInterceptorOptions<T>, Promise<StandardLazyResponse>>[];
|
|
2216
|
+
plugins?: StandardLinkPlugin<T>[];
|
|
2217
|
+
}
|
|
2218
|
+
declare class StandardLink<T extends ClientContext$1> implements ClientLink<T> {
|
|
2219
|
+
readonly codec: StandardLinkCodec<T>;
|
|
2220
|
+
readonly sender: StandardLinkClient<T>;
|
|
2221
|
+
private readonly interceptors;
|
|
2222
|
+
private readonly clientInterceptors;
|
|
2223
|
+
constructor(codec: StandardLinkCodec<T>, sender: StandardLinkClient<T>, options?: StandardLinkOptions<T>);
|
|
2224
|
+
call(path: readonly string[], input: unknown, options: ClientOptions<T>): Promise<unknown>;
|
|
2225
|
+
}
|
|
2226
|
+
interface StandardRPCCustomJsonSerializer {
|
|
2227
|
+
type: number;
|
|
2228
|
+
condition(data: unknown): boolean;
|
|
2229
|
+
serialize(data: any): unknown;
|
|
2230
|
+
/**
|
|
2231
|
+
* `serialized` comes from the wire, so validate its type and throw on mismatch.
|
|
2232
|
+
*/
|
|
2233
|
+
deserialize(serialized: any): unknown;
|
|
2234
|
+
}
|
|
2235
|
+
interface StandardRPCJsonSerializerOptions {
|
|
2236
|
+
customJsonSerializers?: readonly StandardRPCCustomJsonSerializer[];
|
|
2237
|
+
}
|
|
2238
|
+
interface StandardRPCLinkCodecOptions<T extends ClientContext$1> {
|
|
2239
|
+
/**
|
|
2240
|
+
* Base url for all requests.
|
|
2241
|
+
*/
|
|
2242
|
+
url: Value$1<Promisable<string | URL>, [options: ClientOptions<T>, path: readonly string[], input: unknown]>;
|
|
2243
|
+
/**
|
|
2244
|
+
* The maximum length of the URL.
|
|
2245
|
+
*
|
|
2246
|
+
* @default 2083
|
|
2247
|
+
*/
|
|
2248
|
+
maxUrlLength?: Value$1<Promisable<number>, [options: ClientOptions<T>, path: readonly string[], input: unknown]>;
|
|
2249
|
+
/**
|
|
2250
|
+
* The method used to make the request.
|
|
2251
|
+
*
|
|
2252
|
+
* @default 'POST'
|
|
2253
|
+
*/
|
|
2254
|
+
method?: Value$1<Promisable<Exclude<HTTPMethod, 'HEAD'>>, [options: ClientOptions<T>, path: readonly string[], input: unknown]>;
|
|
2255
|
+
/**
|
|
2256
|
+
* The method to use when the payload cannot safely pass to the server with method return from method function.
|
|
2257
|
+
* GET is not allowed, it's very dangerous.
|
|
2258
|
+
*
|
|
2259
|
+
* @default 'POST'
|
|
2260
|
+
*/
|
|
2261
|
+
fallbackMethod?: Exclude<HTTPMethod, 'HEAD' | 'GET'>;
|
|
2262
|
+
/**
|
|
2263
|
+
* Inject headers to the request.
|
|
2264
|
+
*/
|
|
2265
|
+
headers?: Value$1<Promisable<StandardHeaders | Headers>, [options: ClientOptions<T>, path: readonly string[], input: unknown]>;
|
|
2266
|
+
}
|
|
2267
|
+
interface StandardRPCLinkOptions<T extends ClientContext$1> extends StandardLinkOptions<T>, StandardRPCLinkCodecOptions<T>, StandardRPCJsonSerializerOptions {}
|
|
2268
|
+
declare class StandardRPCLink<T extends ClientContext$1> extends StandardLink<T> {
|
|
2269
|
+
constructor(linkClient: StandardLinkClient<T>, options: StandardRPCLinkOptions<T>);
|
|
2270
|
+
}
|
|
2271
|
+
interface LinkFetchPlugin<T extends ClientContext$1> extends StandardLinkPlugin<T> {
|
|
2272
|
+
initRuntimeAdapter?(options: LinkFetchClientOptions<T>): void;
|
|
2273
|
+
}
|
|
2274
|
+
interface LinkFetchInterceptorOptions<T extends ClientContext$1> extends ClientOptions<T> {
|
|
2275
|
+
request: Request;
|
|
2276
|
+
init: {
|
|
2277
|
+
redirect?: Request['redirect'];
|
|
2278
|
+
};
|
|
2279
|
+
path: readonly string[];
|
|
2280
|
+
input: unknown;
|
|
2281
|
+
}
|
|
2282
|
+
interface LinkFetchClientOptions<T extends ClientContext$1> extends ToFetchRequestOptions {
|
|
2283
|
+
fetch?: (request: Request, init: LinkFetchInterceptorOptions<T>['init'], options: ClientOptions<T>, path: readonly string[], input: unknown) => Promise<Response>;
|
|
2284
|
+
adapterInterceptors?: Interceptor<LinkFetchInterceptorOptions<T>, Promise<Response>>[];
|
|
2285
|
+
plugins?: LinkFetchPlugin<T>[];
|
|
2286
|
+
}
|
|
2287
|
+
interface RPCLinkOptions<T extends ClientContext$1> extends LinkFetchClientOptions<T>, Omit<StandardRPCLinkOptions<T>, 'plugins'> {}
|
|
2288
|
+
/**
|
|
2289
|
+
* The RPC Link communicates with the server using the RPC protocol.
|
|
2290
|
+
*
|
|
2291
|
+
* @see {@link https://orpc.dev/docs/client/rpc-link RPC Link Docs}
|
|
2292
|
+
* @see {@link https://orpc.dev/docs/advanced/rpc-protocol RPC Protocol Docs}
|
|
2293
|
+
*/
|
|
2294
|
+
declare class RPCLink<T extends ClientContext$1> extends StandardRPCLink<T> {
|
|
2295
|
+
constructor(options: RPCLinkOptions<T>);
|
|
2296
|
+
}
|
|
2297
|
+
declare const pdfvectorModelSchema: z.ZodEnum<{
|
|
2298
|
+
max: "max";
|
|
2299
|
+
mini: "mini";
|
|
2300
|
+
nano: "nano";
|
|
2301
|
+
pro: "pro";
|
|
2302
|
+
}>;
|
|
2303
|
+
type PDFVectorModel = z.infer<typeof pdfvectorModelSchema>;
|
|
2304
|
+
type ContractInputs = InferContractRouterInputs<typeof index_d_exports>;
|
|
2305
|
+
type ContractOutputs = InferContractRouterOutputs<typeof index_d_exports>;
|
|
2306
|
+
type PDFVectorErrorCode = "BAD_REQUEST" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "NOT_FOUND" | "TOO_MANY_REQUESTS" | "CONFLICT" | "NOT_IMPLEMENTED" | "UNPROCESSABLE_CONTENT" | "INTERNAL_SERVER_ERROR";
|
|
2307
|
+
type PDFVectorErrorCategory = "authentication" | "credits" | "validation" | "document_input" | "document_processing" | "rate_limit" | "not_found" | "conflict" | "unsupported" | "server";
|
|
2308
|
+
type PDFVectorErrorOrigin = "user" | "system";
|
|
2309
|
+
interface PDFVectorErrorOptions {
|
|
2310
|
+
code: PDFVectorErrorCode;
|
|
2311
|
+
status: number;
|
|
2312
|
+
message: string;
|
|
2313
|
+
data?: Record<string, unknown> | undefined;
|
|
2314
|
+
cause?: unknown;
|
|
2315
|
+
}
|
|
2316
|
+
type SubclassOptions = Omit<PDFVectorErrorOptions, "code" | "status">;
|
|
2317
|
+
interface PDFVectorAgentError {
|
|
2318
|
+
name: string;
|
|
2319
|
+
code: PDFVectorErrorCode;
|
|
2320
|
+
status: number;
|
|
2321
|
+
category: PDFVectorErrorCategory;
|
|
2322
|
+
origin: PDFVectorErrorOrigin;
|
|
2323
|
+
userError: boolean;
|
|
2324
|
+
title: string;
|
|
2325
|
+
message: string;
|
|
2326
|
+
suggestion: string;
|
|
2327
|
+
retryable: boolean;
|
|
2328
|
+
retryableWithHigherModel: boolean;
|
|
2329
|
+
requestId?: number;
|
|
2330
|
+
documentId?: string;
|
|
2331
|
+
reasonCode?: string;
|
|
2332
|
+
requestedModel?: string;
|
|
2333
|
+
supportMessage: string;
|
|
2334
|
+
data: Record<string, unknown>;
|
|
2335
|
+
}
|
|
2336
|
+
export declare class PDFVectorError extends Error {
|
|
2337
|
+
readonly code: PDFVectorErrorCode;
|
|
2338
|
+
readonly status: number;
|
|
2339
|
+
readonly data: Record<string, unknown>;
|
|
2340
|
+
readonly requestId: number | undefined;
|
|
2341
|
+
readonly documentId: string | undefined;
|
|
2342
|
+
readonly userError: boolean;
|
|
2343
|
+
readonly category: PDFVectorErrorCategory;
|
|
2344
|
+
readonly origin: PDFVectorErrorOrigin;
|
|
2345
|
+
readonly title: string;
|
|
2346
|
+
readonly suggestion: string;
|
|
2347
|
+
readonly retryable: boolean;
|
|
2348
|
+
readonly retryableWithHigherModel: boolean;
|
|
2349
|
+
readonly requestedModel: string | undefined;
|
|
2350
|
+
readonly reasonCode: string | undefined;
|
|
2351
|
+
readonly supportMessage: string;
|
|
2352
|
+
constructor(options: PDFVectorErrorOptions);
|
|
2353
|
+
toAgentError(): PDFVectorAgentError;
|
|
2354
|
+
toJSON(): PDFVectorAgentError;
|
|
2355
|
+
}
|
|
2356
|
+
export declare class BadRequestError extends PDFVectorError {
|
|
2357
|
+
constructor(options: SubclassOptions);
|
|
2358
|
+
}
|
|
2359
|
+
export declare class UnauthorizedError extends PDFVectorError {
|
|
2360
|
+
constructor(options: SubclassOptions);
|
|
2361
|
+
}
|
|
2362
|
+
export declare class PaymentRequiredError extends PDFVectorError {
|
|
2363
|
+
readonly totalCredits: number | undefined;
|
|
2364
|
+
readonly remainingCredits: number | undefined;
|
|
2365
|
+
readonly resetsAt: string | undefined;
|
|
2366
|
+
readonly billingReason: string | undefined;
|
|
2367
|
+
readonly invoiceCount: number | undefined;
|
|
2368
|
+
readonly amountDue: number | undefined;
|
|
2369
|
+
readonly currency: string | undefined;
|
|
2370
|
+
readonly billingUrl: string | undefined;
|
|
2371
|
+
readonly payUrl: string | undefined;
|
|
2372
|
+
constructor(options: SubclassOptions);
|
|
2373
|
+
get isBillingHold(): boolean;
|
|
2374
|
+
get isCreditsExhausted(): boolean;
|
|
2375
|
+
}
|
|
2376
|
+
export declare class NotFoundError extends PDFVectorError {
|
|
2377
|
+
constructor(options: SubclassOptions);
|
|
2378
|
+
}
|
|
2379
|
+
export declare class TooManyRequestsError extends PDFVectorError {
|
|
2380
|
+
readonly limit: number | undefined;
|
|
2381
|
+
readonly resetAt: string | undefined;
|
|
2382
|
+
readonly retryAfterSeconds: number | undefined;
|
|
2383
|
+
constructor(options: SubclassOptions);
|
|
2384
|
+
}
|
|
2385
|
+
export declare class ConflictError extends PDFVectorError {
|
|
2386
|
+
constructor(options: SubclassOptions);
|
|
2387
|
+
}
|
|
2388
|
+
export declare class NotImplementedError extends PDFVectorError {
|
|
2389
|
+
constructor(options: SubclassOptions);
|
|
2390
|
+
}
|
|
2391
|
+
export declare class UnprocessableContentError extends PDFVectorError {
|
|
2392
|
+
constructor(options: SubclassOptions);
|
|
2393
|
+
}
|
|
2394
|
+
export declare class InternalServerError extends PDFVectorError {
|
|
2395
|
+
constructor(options: SubclassOptions);
|
|
2396
|
+
}
|
|
2397
|
+
export declare class FileTooLargeError extends BadRequestError {
|
|
2398
|
+
readonly fileSizeMB: number | undefined;
|
|
2399
|
+
readonly limitMB: number | undefined;
|
|
2400
|
+
readonly model: string | undefined;
|
|
2401
|
+
constructor(options: SubclassOptions);
|
|
2402
|
+
}
|
|
2403
|
+
export declare class PageLimitExceededError extends BadRequestError {
|
|
2404
|
+
readonly pageCount: number | undefined;
|
|
2405
|
+
readonly pageLimit: number | undefined;
|
|
2406
|
+
readonly model: string | undefined;
|
|
2407
|
+
constructor(options: SubclassOptions);
|
|
2408
|
+
}
|
|
2409
|
+
export declare class PasswordProtectedError extends BadRequestError {}
|
|
2410
|
+
export declare class UnsupportedFormatError extends BadRequestError {
|
|
2411
|
+
readonly format: string | undefined;
|
|
2412
|
+
readonly supportedFormats: string | undefined;
|
|
2413
|
+
constructor(options: SubclassOptions);
|
|
2414
|
+
}
|
|
2415
|
+
export declare class URLFetchError extends BadRequestError {
|
|
2416
|
+
readonly url: string | undefined;
|
|
2417
|
+
readonly statusCode: number | undefined;
|
|
2418
|
+
readonly statusText: string | undefined;
|
|
2419
|
+
constructor(options: SubclassOptions);
|
|
2420
|
+
}
|
|
2421
|
+
export declare class InvalidDocumentURLError extends BadRequestError {}
|
|
2422
|
+
export declare class InvalidBase64Error extends BadRequestError {}
|
|
2423
|
+
export declare class TierNotSupportedError extends BadRequestError {
|
|
2424
|
+
readonly documentType: string | undefined;
|
|
2425
|
+
readonly model: string | undefined;
|
|
2426
|
+
readonly allowedTypes: string[] | undefined;
|
|
2427
|
+
constructor(options: SubclassOptions);
|
|
2428
|
+
}
|
|
2429
|
+
export declare class InvalidSchemaError extends BadRequestError {
|
|
2430
|
+
readonly reason: string | undefined;
|
|
2431
|
+
constructor(options: SubclassOptions);
|
|
2432
|
+
}
|
|
2433
|
+
export declare class NoInputProvidedError extends BadRequestError {}
|
|
2434
|
+
export declare class EmptyDocumentError extends UnprocessableContentError {}
|
|
2435
|
+
export declare class NoTextDetectedError extends UnprocessableContentError {}
|
|
2436
|
+
export declare class ExtractionFailedError extends UnprocessableContentError {
|
|
2437
|
+
readonly hint: string | undefined;
|
|
2438
|
+
readonly rawText: string | undefined;
|
|
2439
|
+
constructor(options: SubclassOptions);
|
|
2440
|
+
}
|
|
2441
|
+
export declare class AcademicPaperNotFoundError extends NotFoundError {
|
|
2442
|
+
readonly input: string | undefined;
|
|
2443
|
+
readonly paperErrorCode: string | undefined;
|
|
2444
|
+
constructor(options: SubclassOptions);
|
|
2445
|
+
}
|
|
2446
|
+
export declare class NoPublicPDFError extends NotFoundError {
|
|
2447
|
+
readonly input: string | undefined;
|
|
2448
|
+
readonly paperTitle: string | undefined;
|
|
2449
|
+
readonly doi: string | undefined;
|
|
2450
|
+
readonly providerURL: string | undefined;
|
|
2451
|
+
constructor(options: SubclassOptions);
|
|
2452
|
+
}
|
|
2453
|
+
export declare function fromORPCError(error: unknown): PDFVectorError | undefined;
|
|
2454
|
+
export declare function isPDFVectorError(error: unknown): error is PDFVectorError;
|
|
2455
|
+
export declare function isPDFVectorUserError(error: unknown): error is PDFVectorError;
|
|
2456
|
+
type APISource = "make" | "zapier" | "n8n" | "sdk" | "playground" | "api" | "unknown";
|
|
2457
|
+
interface CreateClientOptions {
|
|
2458
|
+
/** Defaults to "global.pdfvector.com". */
|
|
2459
|
+
domain?: string;
|
|
2460
|
+
apiKey?: string;
|
|
2461
|
+
/** Identifies the calling surface. Defaults to "sdk". */
|
|
2462
|
+
source?: APISource;
|
|
2463
|
+
}
|
|
2464
|
+
interface ClientContext {
|
|
2465
|
+
/** Optional ID echoed back in responses, used for per-document usage tracking. */
|
|
2466
|
+
documentId?: string;
|
|
2467
|
+
}
|
|
2468
|
+
type Client = Omit<ContractRouterClient<typeof index_d_exports, ClientContext>, "admin" | "free">;
|
|
2469
|
+
export declare function createClient(options?: CreateClientOptions): Client;
|
|
2470
|
+
export { type APISource, type Client, type ClientContext, type ContractInputs, type ContractOutputs, type ContractRouterClient, type CreateClientOptions, ORPCError, type PDFVectorAgentError, type PDFVectorErrorCategory, type PDFVectorErrorCode, type PDFVectorErrorOptions, type PDFVectorErrorOrigin, type PDFVectorModel, RPCLink, createORPCClient, onError };
|