@pdfvector/instance-contract 0.2.8 → 0.2.9
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/.tsc/lib/index.d.ts +1 -11
- package/.tsc/lib/index.d.ts.map +1 -1
- package/.tsc/lib/index.js +1 -7
- package/CHANGELOG.md +13 -0
- package/package.json +4 -4
- package/.tsc/lib/fetchable-url-schema.d.ts +0 -3
- package/.tsc/lib/fetchable-url-schema.d.ts.map +0 -1
- package/.tsc/lib/fetchable-url-schema.js +0 -13
- package/.tsc/lib/json-schema-input.d.ts +0 -3
- package/.tsc/lib/json-schema-input.d.ts.map +0 -1
- package/.tsc/lib/json-schema-input.js +0 -25
- package/.tsc/lib/page-markdown-schema.d.ts +0 -6
- package/.tsc/lib/page-markdown-schema.d.ts.map +0 -1
- package/.tsc/lib/page-markdown-schema.js +0 -9
- package/.tsc/lib/pdfvector-model-schema.d.ts +0 -8
- package/.tsc/lib/pdfvector-model-schema.d.ts.map +0 -1
- package/.tsc/lib/pdfvector-model-schema.js +0 -4
- package/.tsc/lib/pdfvector-model.d.ts +0 -4
- package/.tsc/lib/pdfvector-model.d.ts.map +0 -1
- package/.tsc/lib/pdfvector-model.js +0 -0
- package/.tsc/lib/router/academic/fetch.d.ts +0 -69
- package/.tsc/lib/router/academic/fetch.d.ts.map +0 -1
- package/.tsc/lib/router/academic/fetch.js +0 -119
- package/.tsc/lib/router/academic/find-citations.d.ts +0 -70
- package/.tsc/lib/router/academic/find-citations.d.ts.map +0 -1
- package/.tsc/lib/router/academic/find-citations.js +0 -116
- package/.tsc/lib/router/academic/index.d.ts +0 -8
- package/.tsc/lib/router/academic/index.d.ts.map +0 -1
- package/.tsc/lib/router/academic/index.js +0 -7
- package/.tsc/lib/router/academic/paper-graph.d.ts +0 -113
- package/.tsc/lib/router/academic/paper-graph.d.ts.map +0 -1
- package/.tsc/lib/router/academic/paper-graph.js +0 -144
- package/.tsc/lib/router/academic/parse.d.ts +0 -50
- package/.tsc/lib/router/academic/parse.d.ts.map +0 -1
- package/.tsc/lib/router/academic/parse.js +0 -146
- package/.tsc/lib/router/academic/provider.d.ts +0 -18
- package/.tsc/lib/router/academic/provider.d.ts.map +0 -1
- package/.tsc/lib/router/academic/provider.js +0 -16
- package/.tsc/lib/router/academic/search-grants.d.ts +0 -84
- package/.tsc/lib/router/academic/search-grants.d.ts.map +0 -1
- package/.tsc/lib/router/academic/search-grants.js +0 -171
- package/.tsc/lib/router/academic/search.d.ts +0 -83
- package/.tsc/lib/router/academic/search.d.ts.map +0 -1
- package/.tsc/lib/router/academic/search.js +0 -154
- package/.tsc/lib/router/academic/similar-papers.d.ts +0 -89
- package/.tsc/lib/router/academic/similar-papers.d.ts.map +0 -1
- package/.tsc/lib/router/academic/similar-papers.js +0 -143
- package/.tsc/lib/router/admin/get-environment.d.ts +0 -5
- package/.tsc/lib/router/admin/get-environment.d.ts.map +0 -1
- package/.tsc/lib/router/admin/get-environment.js +0 -13
- package/.tsc/lib/router/admin/get-free-usage-records.d.ts +0 -34
- package/.tsc/lib/router/admin/get-free-usage-records.d.ts.map +0 -1
- package/.tsc/lib/router/admin/get-free-usage-records.js +0 -38
- package/.tsc/lib/router/admin/get-provider-usage-records.d.ts +0 -41
- package/.tsc/lib/router/admin/get-provider-usage-records.d.ts.map +0 -1
- package/.tsc/lib/router/admin/get-provider-usage-records.js +0 -50
- package/.tsc/lib/router/admin/get-usage-records.d.ts +0 -48
- package/.tsc/lib/router/admin/get-usage-records.d.ts.map +0 -1
- package/.tsc/lib/router/admin/get-usage-records.js +0 -44
- package/.tsc/lib/router/admin/health-check.d.ts +0 -5
- package/.tsc/lib/router/admin/health-check.d.ts.map +0 -1
- package/.tsc/lib/router/admin/health-check.js +0 -14
- package/.tsc/lib/router/admin/index.d.ts +0 -9
- package/.tsc/lib/router/admin/index.d.ts.map +0 -1
- package/.tsc/lib/router/admin/index.js +0 -8
- package/.tsc/lib/router/admin/set-domain.d.ts +0 -7
- package/.tsc/lib/router/admin/set-domain.d.ts.map +0 -1
- package/.tsc/lib/router/admin/set-domain.js +0 -20
- package/.tsc/lib/router/admin/set-environment.d.ts +0 -7
- package/.tsc/lib/router/admin/set-environment.d.ts.map +0 -1
- package/.tsc/lib/router/admin/set-environment.js +0 -41
- package/.tsc/lib/router/admin/set-version.d.ts +0 -7
- package/.tsc/lib/router/admin/set-version.d.ts.map +0 -1
- package/.tsc/lib/router/admin/set-version.js +0 -21
- package/.tsc/lib/router/authenticate/index.d.ts +0 -2
- package/.tsc/lib/router/authenticate/index.d.ts.map +0 -1
- package/.tsc/lib/router/authenticate/index.js +0 -1
- package/.tsc/lib/router/authenticate/validate-credential.d.ts +0 -7
- package/.tsc/lib/router/authenticate/validate-credential.d.ts.map +0 -1
- package/.tsc/lib/router/authenticate/validate-credential.js +0 -20
- package/.tsc/lib/router/bankStatement/ask.d.ts +0 -32
- package/.tsc/lib/router/bankStatement/ask.d.ts.map +0 -1
- package/.tsc/lib/router/bankStatement/ask.js +0 -88
- package/.tsc/lib/router/bankStatement/extract.d.ts +0 -33
- package/.tsc/lib/router/bankStatement/extract.d.ts.map +0 -1
- package/.tsc/lib/router/bankStatement/extract.js +0 -113
- package/.tsc/lib/router/bankStatement/get-default-spec.d.ts +0 -2
- package/.tsc/lib/router/bankStatement/get-default-spec.d.ts.map +0 -1
- package/.tsc/lib/router/bankStatement/get-default-spec.js +0 -19
- package/.tsc/lib/router/bankStatement/index.d.ts +0 -4
- package/.tsc/lib/router/bankStatement/index.d.ts.map +0 -1
- package/.tsc/lib/router/bankStatement/index.js +0 -3
- package/.tsc/lib/router/bankStatement/parse.d.ts +0 -28
- package/.tsc/lib/router/bankStatement/parse.d.ts.map +0 -1
- package/.tsc/lib/router/bankStatement/parse.js +0 -105
- package/.tsc/lib/router/document/ask.d.ts +0 -32
- package/.tsc/lib/router/document/ask.d.ts.map +0 -1
- package/.tsc/lib/router/document/ask.js +0 -134
- package/.tsc/lib/router/document/extract.d.ts +0 -33
- package/.tsc/lib/router/document/extract.d.ts.map +0 -1
- package/.tsc/lib/router/document/extract.js +0 -152
- package/.tsc/lib/router/document/get-default-spec.d.ts +0 -2
- package/.tsc/lib/router/document/get-default-spec.d.ts.map +0 -1
- package/.tsc/lib/router/document/get-default-spec.js +0 -19
- package/.tsc/lib/router/document/index.d.ts +0 -4
- package/.tsc/lib/router/document/index.d.ts.map +0 -1
- package/.tsc/lib/router/document/index.js +0 -3
- package/.tsc/lib/router/document/parse.d.ts +0 -40
- package/.tsc/lib/router/document/parse.d.ts.map +0 -1
- package/.tsc/lib/router/document/parse.js +0 -142
- package/.tsc/lib/router/free/bank-statement-parse.d.ts +0 -16
- package/.tsc/lib/router/free/bank-statement-parse.d.ts.map +0 -1
- package/.tsc/lib/router/free/bank-statement-parse.js +0 -87
- package/.tsc/lib/router/free/generate-schema.d.ts +0 -8
- package/.tsc/lib/router/free/generate-schema.d.ts.map +0 -1
- package/.tsc/lib/router/free/generate-schema.js +0 -110
- package/.tsc/lib/router/free/index.d.ts +0 -5
- package/.tsc/lib/router/free/index.d.ts.map +0 -1
- package/.tsc/lib/router/free/index.js +0 -4
- package/.tsc/lib/router/free/publication-pdf-url.d.ts +0 -12
- package/.tsc/lib/router/free/publication-pdf-url.d.ts.map +0 -1
- package/.tsc/lib/router/free/publication-pdf-url.js +0 -86
- package/.tsc/lib/router/free/rate-limit-status.d.ts +0 -19
- package/.tsc/lib/router/free/rate-limit-status.d.ts.map +0 -1
- package/.tsc/lib/router/free/rate-limit-status.js +0 -36
- package/.tsc/lib/router/identity/ask.d.ts +0 -32
- package/.tsc/lib/router/identity/ask.d.ts.map +0 -1
- package/.tsc/lib/router/identity/ask.js +0 -95
- package/.tsc/lib/router/identity/extract.d.ts +0 -33
- package/.tsc/lib/router/identity/extract.d.ts.map +0 -1
- package/.tsc/lib/router/identity/extract.js +0 -103
- package/.tsc/lib/router/identity/get-default-spec.d.ts +0 -2
- package/.tsc/lib/router/identity/get-default-spec.d.ts.map +0 -1
- package/.tsc/lib/router/identity/get-default-spec.js +0 -19
- package/.tsc/lib/router/identity/index.d.ts +0 -4
- package/.tsc/lib/router/identity/index.d.ts.map +0 -1
- package/.tsc/lib/router/identity/index.js +0 -3
- package/.tsc/lib/router/identity/parse.d.ts +0 -29
- package/.tsc/lib/router/identity/parse.d.ts.map +0 -1
- package/.tsc/lib/router/identity/parse.js +0 -109
- package/.tsc/lib/router/index.d.ts +0 -9
- package/.tsc/lib/router/index.d.ts.map +0 -1
- package/.tsc/lib/router/index.js +0 -8
- package/.tsc/lib/router/invoice/ask.d.ts +0 -32
- package/.tsc/lib/router/invoice/ask.d.ts.map +0 -1
- package/.tsc/lib/router/invoice/ask.js +0 -85
- package/.tsc/lib/router/invoice/extract.d.ts +0 -33
- package/.tsc/lib/router/invoice/extract.d.ts.map +0 -1
- package/.tsc/lib/router/invoice/extract.js +0 -109
- package/.tsc/lib/router/invoice/get-default-spec.d.ts +0 -2
- package/.tsc/lib/router/invoice/get-default-spec.d.ts.map +0 -1
- package/.tsc/lib/router/invoice/get-default-spec.js +0 -19
- package/.tsc/lib/router/invoice/index.d.ts +0 -4
- package/.tsc/lib/router/invoice/index.d.ts.map +0 -1
- package/.tsc/lib/router/invoice/index.js +0 -3
- package/.tsc/lib/router/invoice/parse.d.ts +0 -28
- package/.tsc/lib/router/invoice/parse.d.ts.map +0 -1
- package/.tsc/lib/router/invoice/parse.js +0 -100
- package/.tsc/lib/supported-mimes.d.ts +0 -35
- package/.tsc/lib/supported-mimes.d.ts.map +0 -1
- package/.tsc/lib/supported-mimes.js +0 -130
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const getFreeUsageRecords: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
-
cursor: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
4
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
5
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
-
records: z.ZodArray<z.ZodObject<{
|
|
7
|
-
id: z.ZodNumber;
|
|
8
|
-
operation: z.ZodString;
|
|
9
|
-
ip: z.ZodString;
|
|
10
|
-
model: z.ZodNullable<z.ZodString>;
|
|
11
|
-
inputSource: z.ZodNullable<z.ZodString>;
|
|
12
|
-
inputRef: z.ZodNullable<z.ZodString>;
|
|
13
|
-
fileSize: z.ZodNullable<z.ZodNumber>;
|
|
14
|
-
documentType: z.ZodNullable<z.ZodString>;
|
|
15
|
-
pageCount: z.ZodNullable<z.ZodNumber>;
|
|
16
|
-
error: z.ZodNullable<z.ZodString>;
|
|
17
|
-
status: z.ZodEnum<{
|
|
18
|
-
success: "success";
|
|
19
|
-
system_error: "system_error";
|
|
20
|
-
user_error: "user_error";
|
|
21
|
-
}>;
|
|
22
|
-
errorStage: z.ZodNullable<z.ZodEnum<{
|
|
23
|
-
auth: "auth";
|
|
24
|
-
preprocessing: "preprocessing";
|
|
25
|
-
processing: "processing";
|
|
26
|
-
validation: "validation";
|
|
27
|
-
}>>;
|
|
28
|
-
errorCode: z.ZodNullable<z.ZodString>;
|
|
29
|
-
duration: z.ZodNumber;
|
|
30
|
-
createdAt: z.ZodNumber;
|
|
31
|
-
}, z.core.$strip>>;
|
|
32
|
-
hasMore: z.ZodBoolean;
|
|
33
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
34
|
-
//# sourceMappingURL=get-free-usage-records.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-free-usage-records.d.ts","sourceRoot":"","sources":["../../../../lib/router/admin/get-free-usage-records.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAsB9B,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { errorStages, usageStatuses } from "@pdfvector/util";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
const freeUsageRecordSchema = z.object({
|
|
5
|
-
id: z.number(),
|
|
6
|
-
operation: z.string(),
|
|
7
|
-
ip: z.string(),
|
|
8
|
-
model: z.string().nullable(),
|
|
9
|
-
inputSource: z.string().nullable(),
|
|
10
|
-
inputRef: z.string().nullable(),
|
|
11
|
-
fileSize: z.number().nullable(),
|
|
12
|
-
documentType: z.string().nullable(),
|
|
13
|
-
pageCount: z.number().nullable(),
|
|
14
|
-
error: z.string().nullable(),
|
|
15
|
-
status: z.enum(usageStatuses),
|
|
16
|
-
errorStage: z.enum(errorStages).nullable(),
|
|
17
|
-
errorCode: z.string().nullable(),
|
|
18
|
-
duration: z.number(),
|
|
19
|
-
createdAt: z.number(),
|
|
20
|
-
});
|
|
21
|
-
export const getFreeUsageRecords = oc
|
|
22
|
-
.route({
|
|
23
|
-
summary: "Get free usage records",
|
|
24
|
-
description: "Returns free usage records with id > cursor, ordered by id ascending",
|
|
25
|
-
tags: ["Admin"],
|
|
26
|
-
spec: (op) => {
|
|
27
|
-
op.security = [{ bearerAuth: [] }];
|
|
28
|
-
return op;
|
|
29
|
-
},
|
|
30
|
-
})
|
|
31
|
-
.input(z.object({
|
|
32
|
-
cursor: z.number().optional().default(0),
|
|
33
|
-
limit: z.number().optional().default(1000),
|
|
34
|
-
}))
|
|
35
|
-
.output(z.object({
|
|
36
|
-
records: z.array(freeUsageRecordSchema),
|
|
37
|
-
hasMore: z.boolean(),
|
|
38
|
-
}));
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const getProviderUsageRecords: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
-
cursor: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
4
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
5
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
-
records: z.ZodArray<z.ZodObject<{
|
|
7
|
-
id: z.ZodNumber;
|
|
8
|
-
apiUsageId: z.ZodNullable<z.ZodNumber>;
|
|
9
|
-
operation: z.ZodString;
|
|
10
|
-
phase: z.ZodString;
|
|
11
|
-
provider: z.ZodString;
|
|
12
|
-
service: z.ZodString;
|
|
13
|
-
providerModel: z.ZodNullable<z.ZodString>;
|
|
14
|
-
providerRegion: z.ZodNullable<z.ZodString>;
|
|
15
|
-
providerResource: z.ZodNullable<z.ZodString>;
|
|
16
|
-
documentType: z.ZodNullable<z.ZodString>;
|
|
17
|
-
fileSize: z.ZodNullable<z.ZodNumber>;
|
|
18
|
-
pageCount: z.ZodNullable<z.ZodNumber>;
|
|
19
|
-
inputTokens: z.ZodNullable<z.ZodNumber>;
|
|
20
|
-
uncachedInputTokens: z.ZodNullable<z.ZodNumber>;
|
|
21
|
-
cachedInputTokens: z.ZodNullable<z.ZodNumber>;
|
|
22
|
-
cacheWriteTokens: z.ZodNullable<z.ZodNumber>;
|
|
23
|
-
outputTokens: z.ZodNullable<z.ZodNumber>;
|
|
24
|
-
reasoningTokens: z.ZodNullable<z.ZodNumber>;
|
|
25
|
-
totalTokens: z.ZodNullable<z.ZodNumber>;
|
|
26
|
-
featuresJson: z.ZodNullable<z.ZodString>;
|
|
27
|
-
status: z.ZodEnum<{
|
|
28
|
-
success: "success";
|
|
29
|
-
system_error: "system_error";
|
|
30
|
-
user_error: "user_error";
|
|
31
|
-
}>;
|
|
32
|
-
error: z.ZodNullable<z.ZodString>;
|
|
33
|
-
duration: z.ZodNumber;
|
|
34
|
-
estimatedCostUsdMicro: z.ZodNullable<z.ZodNumber>;
|
|
35
|
-
pricingVersion: z.ZodNullable<z.ZodString>;
|
|
36
|
-
rawUsageJson: z.ZodNullable<z.ZodString>;
|
|
37
|
-
createdAt: z.ZodNumber;
|
|
38
|
-
}, z.core.$strip>>;
|
|
39
|
-
hasMore: z.ZodBoolean;
|
|
40
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
41
|
-
//# sourceMappingURL=get-provider-usage-records.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-provider-usage-records.d.ts","sourceRoot":"","sources":["../../../../lib/router/admin/get-provider-usage-records.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAsBlC,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { usageStatuses } from "@pdfvector/util";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
const providerUsageRecordSchema = z.object({
|
|
5
|
-
id: z.number(),
|
|
6
|
-
apiUsageId: z.number().nullable(),
|
|
7
|
-
operation: z.string(),
|
|
8
|
-
phase: z.string(),
|
|
9
|
-
provider: z.string(),
|
|
10
|
-
service: z.string(),
|
|
11
|
-
providerModel: z.string().nullable(),
|
|
12
|
-
providerRegion: z.string().nullable(),
|
|
13
|
-
providerResource: z.string().nullable(),
|
|
14
|
-
documentType: z.string().nullable(),
|
|
15
|
-
fileSize: z.number().nullable(),
|
|
16
|
-
pageCount: z.number().nullable(),
|
|
17
|
-
inputTokens: z.number().nullable(),
|
|
18
|
-
uncachedInputTokens: z.number().nullable(),
|
|
19
|
-
cachedInputTokens: z.number().nullable(),
|
|
20
|
-
cacheWriteTokens: z.number().nullable(),
|
|
21
|
-
outputTokens: z.number().nullable(),
|
|
22
|
-
reasoningTokens: z.number().nullable(),
|
|
23
|
-
totalTokens: z.number().nullable(),
|
|
24
|
-
featuresJson: z.string().nullable(),
|
|
25
|
-
status: z.enum(usageStatuses),
|
|
26
|
-
error: z.string().nullable(),
|
|
27
|
-
duration: z.number(),
|
|
28
|
-
estimatedCostUsdMicro: z.number().nullable(),
|
|
29
|
-
pricingVersion: z.string().nullable(),
|
|
30
|
-
rawUsageJson: z.string().nullable(),
|
|
31
|
-
createdAt: z.number(),
|
|
32
|
-
});
|
|
33
|
-
export const getProviderUsageRecords = oc
|
|
34
|
-
.route({
|
|
35
|
-
summary: "Get provider usage records",
|
|
36
|
-
description: "Returns provider-level usage records with id > cursor, ordered by id ascending",
|
|
37
|
-
tags: ["Admin"],
|
|
38
|
-
spec: (op) => {
|
|
39
|
-
op.security = [{ bearerAuth: [] }];
|
|
40
|
-
return op;
|
|
41
|
-
},
|
|
42
|
-
})
|
|
43
|
-
.input(z.object({
|
|
44
|
-
cursor: z.number().optional().default(0),
|
|
45
|
-
limit: z.number().optional().default(1000),
|
|
46
|
-
}))
|
|
47
|
-
.output(z.object({
|
|
48
|
-
records: z.array(providerUsageRecordSchema),
|
|
49
|
-
hasMore: z.boolean(),
|
|
50
|
-
}));
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const getUsageRecords: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
-
cursor: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
4
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
5
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
-
records: z.ZodArray<z.ZodObject<{
|
|
7
|
-
id: z.ZodNumber;
|
|
8
|
-
credits: z.ZodNumber;
|
|
9
|
-
model: z.ZodNullable<z.ZodString>;
|
|
10
|
-
inputSource: z.ZodString;
|
|
11
|
-
inputRef: z.ZodNullable<z.ZodString>;
|
|
12
|
-
fileSize: z.ZodNumber;
|
|
13
|
-
documentType: z.ZodString;
|
|
14
|
-
documentId: z.ZodNullable<z.ZodString>;
|
|
15
|
-
error: z.ZodNullable<z.ZodString>;
|
|
16
|
-
status: z.ZodEnum<{
|
|
17
|
-
success: "success";
|
|
18
|
-
system_error: "system_error";
|
|
19
|
-
user_error: "user_error";
|
|
20
|
-
}>;
|
|
21
|
-
errorStage: z.ZodNullable<z.ZodEnum<{
|
|
22
|
-
auth: "auth";
|
|
23
|
-
preprocessing: "preprocessing";
|
|
24
|
-
processing: "processing";
|
|
25
|
-
validation: "validation";
|
|
26
|
-
}>>;
|
|
27
|
-
errorCode: z.ZodNullable<z.ZodString>;
|
|
28
|
-
duration: z.ZodNumber;
|
|
29
|
-
operation: z.ZodString;
|
|
30
|
-
pageCount: z.ZodNullable<z.ZodNumber>;
|
|
31
|
-
requestedModel: z.ZodString;
|
|
32
|
-
actualModel: z.ZodNullable<z.ZodString>;
|
|
33
|
-
apiKey: z.ZodNullable<z.ZodString>;
|
|
34
|
-
workspaceId: z.ZodNullable<z.ZodNumber>;
|
|
35
|
-
source: z.ZodDefault<z.ZodEnum<{
|
|
36
|
-
api: "api";
|
|
37
|
-
make: "make";
|
|
38
|
-
n8n: "n8n";
|
|
39
|
-
playground: "playground";
|
|
40
|
-
sdk: "sdk";
|
|
41
|
-
unknown: "unknown";
|
|
42
|
-
zapier: "zapier";
|
|
43
|
-
}>>;
|
|
44
|
-
createdAt: z.ZodNumber;
|
|
45
|
-
}, z.core.$strip>>;
|
|
46
|
-
hasMore: z.ZodBoolean;
|
|
47
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
48
|
-
//# sourceMappingURL=get-usage-records.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-usage-records.d.ts","sourceRoot":"","sources":["../../../../lib/router/admin/get-usage-records.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAsB1B,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { apiSources, errorStages, usageStatuses } from "@pdfvector/util";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
const usageRecordSchema = z.object({
|
|
5
|
-
id: z.number(),
|
|
6
|
-
credits: z.number(),
|
|
7
|
-
model: z.string().nullable(),
|
|
8
|
-
inputSource: z.string(),
|
|
9
|
-
inputRef: z.string().nullable(),
|
|
10
|
-
fileSize: z.number(),
|
|
11
|
-
documentType: z.string(),
|
|
12
|
-
documentId: z.string().nullable(),
|
|
13
|
-
error: z.string().nullable(),
|
|
14
|
-
status: z.enum(usageStatuses),
|
|
15
|
-
errorStage: z.enum(errorStages).nullable(),
|
|
16
|
-
errorCode: z.string().nullable(),
|
|
17
|
-
duration: z.number(),
|
|
18
|
-
operation: z.string(),
|
|
19
|
-
pageCount: z.number().nullable(),
|
|
20
|
-
requestedModel: z.string(),
|
|
21
|
-
actualModel: z.string().nullable(),
|
|
22
|
-
apiKey: z.string().nullable(),
|
|
23
|
-
workspaceId: z.number().nullable(),
|
|
24
|
-
source: z.enum(apiSources).default("unknown"),
|
|
25
|
-
createdAt: z.number(),
|
|
26
|
-
});
|
|
27
|
-
export const getUsageRecords = oc
|
|
28
|
-
.route({
|
|
29
|
-
summary: "Get usage records",
|
|
30
|
-
description: "Returns usage records with id > cursor, ordered by id ascending",
|
|
31
|
-
tags: ["Admin"],
|
|
32
|
-
spec: (op) => {
|
|
33
|
-
op.security = [{ bearerAuth: [] }];
|
|
34
|
-
return op;
|
|
35
|
-
},
|
|
36
|
-
})
|
|
37
|
-
.input(z.object({
|
|
38
|
-
cursor: z.number().optional().default(0),
|
|
39
|
-
limit: z.number().optional().default(1000),
|
|
40
|
-
}))
|
|
41
|
-
.output(z.object({
|
|
42
|
-
records: z.array(usageRecordSchema),
|
|
43
|
-
hasMore: z.boolean(),
|
|
44
|
-
}));
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const healthCheck: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
|
|
3
|
-
message: z.ZodString;
|
|
4
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
5
|
-
//# sourceMappingURL=health-check.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"health-check.d.ts","sourceRoot":"","sources":["../../../../lib/router/admin/health-check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,WAAW;;8DAUG,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const adminOutputSchema = z.object({ message: z.string() });
|
|
4
|
-
export const healthCheck = oc
|
|
5
|
-
.route({
|
|
6
|
-
summary: "Health check",
|
|
7
|
-
description: "Check that the instance server and database are operational",
|
|
8
|
-
tags: ["Admin"],
|
|
9
|
-
spec: (op) => {
|
|
10
|
-
op.security = [{ bearerAuth: [] }];
|
|
11
|
-
return op;
|
|
12
|
-
},
|
|
13
|
-
})
|
|
14
|
-
.output(adminOutputSchema);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./get-environment.js";
|
|
2
|
-
export * from "./get-free-usage-records.js";
|
|
3
|
-
export * from "./get-provider-usage-records.js";
|
|
4
|
-
export * from "./get-usage-records.js";
|
|
5
|
-
export * from "./health-check.js";
|
|
6
|
-
export * from "./set-domain.js";
|
|
7
|
-
export * from "./set-environment.js";
|
|
8
|
-
export * from "./set-version.js";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/router/admin/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./get-environment.js";
|
|
2
|
-
export * from "./get-free-usage-records.js";
|
|
3
|
-
export * from "./get-provider-usage-records.js";
|
|
4
|
-
export * from "./get-usage-records.js";
|
|
5
|
-
export * from "./health-check.js";
|
|
6
|
-
export * from "./set-domain.js";
|
|
7
|
-
export * from "./set-environment.js";
|
|
8
|
-
export * from "./set-version.js";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const setDomain: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
-
domain: z.ZodString;
|
|
4
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
-
message: z.ZodString;
|
|
6
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
7
|
-
//# sourceMappingURL=set-domain.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-domain.d.ts","sourceRoot":"","sources":["../../../../lib/router/admin/set-domain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,SAAS;;;;8DAWK,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const adminOutputSchema = z.object({ message: z.string() });
|
|
4
|
-
const setDomainInputSchema = z.object({
|
|
5
|
-
domain: z
|
|
6
|
-
.string()
|
|
7
|
-
.regex(/^([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/, "Must be a valid hostname (e.g. app.example.com)"),
|
|
8
|
-
});
|
|
9
|
-
export const setDomain = oc
|
|
10
|
-
.route({
|
|
11
|
-
summary: "Set instance server's domain",
|
|
12
|
-
description: "Update the instance server's domain name",
|
|
13
|
-
tags: ["Admin"],
|
|
14
|
-
spec: (op) => {
|
|
15
|
-
op.security = [{ bearerAuth: [] }];
|
|
16
|
-
return op;
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
.input(setDomainInputSchema)
|
|
20
|
-
.output(adminOutputSchema);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const setEnvironment: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
-
environment: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
4
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
-
message: z.ZodString;
|
|
6
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
7
|
-
//# sourceMappingURL=set-environment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-environment.d.ts","sourceRoot":"","sources":["../../../../lib/router/admin/set-environment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,cAAc;;;;8DA0CgB,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const reservedKeys = new Set([
|
|
4
|
-
"NODE_ENV",
|
|
5
|
-
"PDFVECTOR_LOCAL",
|
|
6
|
-
"VITE_PDFVECTOR_LOCAL",
|
|
7
|
-
"NEXT_PUBLIC_PDFVECTOR_LOCAL",
|
|
8
|
-
"PDFVECTOR_RELEASES_REGION",
|
|
9
|
-
"PDFVECTOR_RELEASES_S3_BUCKET",
|
|
10
|
-
"PDFVECTOR_RELEASES_DYNAMODB_TABLE",
|
|
11
|
-
"PDFVECTOR_INSTANCE_SERVER_DOMAIN",
|
|
12
|
-
"PDFVECTOR_INSTANCE_SERVER_DATA_DIR",
|
|
13
|
-
]);
|
|
14
|
-
export const setEnvironment = oc
|
|
15
|
-
.route({
|
|
16
|
-
summary: "Set instance server's environment",
|
|
17
|
-
description: "Update instance environment variables, or remove them by passing null",
|
|
18
|
-
tags: ["Admin"],
|
|
19
|
-
spec: (op) => {
|
|
20
|
-
op.security = [{ bearerAuth: [] }];
|
|
21
|
-
return op;
|
|
22
|
-
},
|
|
23
|
-
})
|
|
24
|
-
.input(z.object({
|
|
25
|
-
environment: z
|
|
26
|
-
.record(z
|
|
27
|
-
.string()
|
|
28
|
-
.regex(/^[A-Z_][A-Z0-9_]*$/, "Keys must be valid env var names (e.g. MY_VAR)"), z.union([
|
|
29
|
-
z
|
|
30
|
-
.string()
|
|
31
|
-
.regex(/^[^\0\n\r]*$/, "Values must not contain NULs or newlines"),
|
|
32
|
-
z.null(),
|
|
33
|
-
]))
|
|
34
|
-
.refine((env) => Object.keys(env).length > 0, {
|
|
35
|
-
message: "At least one environment variable is required",
|
|
36
|
-
})
|
|
37
|
-
.refine((env) => !Object.keys(env).some((key) => reservedKeys.has(key)), {
|
|
38
|
-
message: `Cannot set reserved keys: ${[...reservedKeys].join(", ")}`,
|
|
39
|
-
}),
|
|
40
|
-
}))
|
|
41
|
-
.output(z.object({ message: z.string() }));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const setVersion: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
-
version: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"LATEST">]>;
|
|
4
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
-
message: z.ZodString;
|
|
6
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
7
|
-
//# sourceMappingURL=set-version.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-version.d.ts","sourceRoot":"","sources":["../../../../lib/router/admin/set-version.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,UAAU;;;;8DAWI,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const setVersionInputSchema = z.object({
|
|
4
|
-
version: z.union([
|
|
5
|
-
z.string().regex(/^\d+\.\d+\.\d+$/, "Must be a valid semver (e.g. 1.2.3)"),
|
|
6
|
-
z.literal("LATEST"),
|
|
7
|
-
]),
|
|
8
|
-
});
|
|
9
|
-
const adminOutputSchema = z.object({ message: z.string() });
|
|
10
|
-
export const setVersion = oc
|
|
11
|
-
.route({
|
|
12
|
-
summary: "Set instance server's version",
|
|
13
|
-
description: "Update the instance server to a specific version",
|
|
14
|
-
tags: ["Admin"],
|
|
15
|
-
spec: (op) => {
|
|
16
|
-
op.security = [{ bearerAuth: [] }];
|
|
17
|
-
return op;
|
|
18
|
-
},
|
|
19
|
-
})
|
|
20
|
-
.input(setVersionInputSchema)
|
|
21
|
-
.output(adminOutputSchema);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/router/authenticate/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./validate-credential.js";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const validateCredential: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
|
|
3
|
-
status: z.ZodString;
|
|
4
|
-
version: z.ZodString;
|
|
5
|
-
timestamp: z.ZodString;
|
|
6
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
7
|
-
//# sourceMappingURL=validate-credential.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-credential.d.ts","sourceRoot":"","sources":["../../../../lib/router/authenticate/validate-credential.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,kBAAkB;;;;8DAYT,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const inputSchema = z.object({}).optional();
|
|
4
|
-
const outputSchema = z.object({
|
|
5
|
-
status: z.string().describe("Server status indicator"),
|
|
6
|
-
version: z.string().describe("Server version"),
|
|
7
|
-
timestamp: z.string().describe("Current server timestamp in ISO 8601 format"),
|
|
8
|
-
});
|
|
9
|
-
export const validateCredential = oc
|
|
10
|
-
.route({
|
|
11
|
-
summary: "Validate API credential",
|
|
12
|
-
description: "Verify that the API key is valid and the server is reachable. Returns basic server information.",
|
|
13
|
-
tags: ["Authenticate"],
|
|
14
|
-
spec: (op) => {
|
|
15
|
-
op.security = [{ bearerAuth: [] }];
|
|
16
|
-
return op;
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
.input(inputSchema)
|
|
20
|
-
.output(outputSchema);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
-
url: z.ZodOptional<z.ZodURL>;
|
|
4
|
-
file: z.ZodOptional<z.ZodFile>;
|
|
5
|
-
base64: z.ZodOptional<z.ZodString>;
|
|
6
|
-
question: z.ZodString;
|
|
7
|
-
model: z.ZodDefault<z.ZodEnum<{
|
|
8
|
-
auto: "auto";
|
|
9
|
-
max: "max";
|
|
10
|
-
mini: "mini";
|
|
11
|
-
nano: "nano";
|
|
12
|
-
pro: "pro";
|
|
13
|
-
}>>;
|
|
14
|
-
documentId: z.ZodOptional<z.ZodString>;
|
|
15
|
-
callback: z.ZodOptional<z.ZodObject<{
|
|
16
|
-
url: z.ZodURL;
|
|
17
|
-
type: z.ZodOptional<z.ZodString>;
|
|
18
|
-
}, z.core.$strip>>;
|
|
19
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
-
markdown: z.ZodString;
|
|
21
|
-
pageCount: z.ZodNumber;
|
|
22
|
-
model: z.ZodEnum<{
|
|
23
|
-
max: "max";
|
|
24
|
-
mini: "mini";
|
|
25
|
-
nano: "nano";
|
|
26
|
-
pro: "pro";
|
|
27
|
-
}>;
|
|
28
|
-
credits: z.ZodNumber;
|
|
29
|
-
requestId: z.ZodNumber;
|
|
30
|
-
documentId: z.ZodOptional<z.ZodString>;
|
|
31
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
32
|
-
//# sourceMappingURL=ask.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../../../../lib/router/bankStatement/ask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiGxB,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAYS,CAAC"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
|
|
5
|
-
import { pdfvectorModelSchema } from "../../pdfvector-model-schema.js";
|
|
6
|
-
import { outputAskModelDescription, specializedAskModelDescription, supportedFileFormatsDescription, supportedFileMimeErrorMessage, supportedFileMimes, supportedFileTypesLong, } from "../../supported-mimes.js";
|
|
7
|
-
import { getDefaultSpec } from "./get-default-spec.js";
|
|
8
|
-
const specializedModelSchema = z
|
|
9
|
-
.enum(["auto", ...pdfvectorModelSchema.options])
|
|
10
|
-
.default("auto");
|
|
11
|
-
const askInputSchema = z.object({
|
|
12
|
-
url: fetchableUrlSchema
|
|
13
|
-
.optional()
|
|
14
|
-
.describe("URL of the bank statement file to fetch and parse"),
|
|
15
|
-
file: z
|
|
16
|
-
.file()
|
|
17
|
-
.mime([...supportedFileMimes], supportedFileMimeErrorMessage)
|
|
18
|
-
.optional()
|
|
19
|
-
.describe(`Bank statement file upload via multipart form-data (${supportedFileFormatsDescription})`),
|
|
20
|
-
base64: z
|
|
21
|
-
.string()
|
|
22
|
-
.optional()
|
|
23
|
-
.describe("Base64-encoded bank statement file content"),
|
|
24
|
-
question: z
|
|
25
|
-
.string()
|
|
26
|
-
.min(4, "question must be at least 4 characters")
|
|
27
|
-
.describe("The question to answer about the bank statement"),
|
|
28
|
-
model: specializedModelSchema.describe(specializedAskModelDescription),
|
|
29
|
-
documentId: z
|
|
30
|
-
.string()
|
|
31
|
-
.trim()
|
|
32
|
-
.min(1)
|
|
33
|
-
.max(512)
|
|
34
|
-
.optional()
|
|
35
|
-
.describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
|
|
36
|
-
callback: z
|
|
37
|
-
.object({
|
|
38
|
-
url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
|
|
39
|
-
type: z
|
|
40
|
-
.string()
|
|
41
|
-
.optional()
|
|
42
|
-
.describe("Callback type identifier (e.g. 'zapier')"),
|
|
43
|
-
})
|
|
44
|
-
.optional()
|
|
45
|
-
.describe("Optional webhook callback for async processing. " +
|
|
46
|
-
"When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
|
|
47
|
-
"On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
|
|
48
|
-
"Useful for long-running operations that may exceed client timeout limits."),
|
|
49
|
-
});
|
|
50
|
-
const askOutputSchema = z.object({
|
|
51
|
-
markdown: z.string().describe("The answer to the question"),
|
|
52
|
-
pageCount: z.number().int().describe("Total number of pages in the document"),
|
|
53
|
-
model: pdfvectorModelSchema.describe(outputAskModelDescription),
|
|
54
|
-
credits: z
|
|
55
|
-
.number()
|
|
56
|
-
.int()
|
|
57
|
-
.describe("Number of credits consumed by this API call. Cost per page: nano=6, mini=10, pro=14, max=18."),
|
|
58
|
-
requestId: z
|
|
59
|
-
.number()
|
|
60
|
-
.int()
|
|
61
|
-
.describe("Unique request identifier for this API call"),
|
|
62
|
-
documentId: z
|
|
63
|
-
.string()
|
|
64
|
-
.optional()
|
|
65
|
-
.describe("Document ID if provided via x-pdfvector-document-id header or request body"),
|
|
66
|
-
});
|
|
67
|
-
const requestExamples = {
|
|
68
|
-
"Ask from URL": {
|
|
69
|
-
summary: "Ask from URL",
|
|
70
|
-
value: {
|
|
71
|
-
url: "https://example.com/bank-statement.pdf",
|
|
72
|
-
question: "What is the ending balance?",
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
export const ask = oc
|
|
77
|
-
.route({
|
|
78
|
-
summary: "Ask a question about a bank statement",
|
|
79
|
-
description: `Parse a bank statement and answer a question about its content using AI. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
|
|
80
|
-
tags: ["Bank Statement"],
|
|
81
|
-
spec: (op) => {
|
|
82
|
-
const spec = getDefaultSpec(op, requestExamples);
|
|
83
|
-
spec["x-codeSamples"] = getOpenApiCodeSamples("bank-statement-ask");
|
|
84
|
-
return spec;
|
|
85
|
-
},
|
|
86
|
-
})
|
|
87
|
-
.input(askInputSchema)
|
|
88
|
-
.output(askOutputSchema);
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const extract: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
-
url: z.ZodOptional<z.ZodURL>;
|
|
4
|
-
file: z.ZodOptional<z.ZodFile>;
|
|
5
|
-
base64: z.ZodOptional<z.ZodString>;
|
|
6
|
-
prompt: z.ZodString;
|
|
7
|
-
schema: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, unknown>, string>>]>;
|
|
8
|
-
model: z.ZodDefault<z.ZodEnum<{
|
|
9
|
-
auto: "auto";
|
|
10
|
-
max: "max";
|
|
11
|
-
mini: "mini";
|
|
12
|
-
nano: "nano";
|
|
13
|
-
pro: "pro";
|
|
14
|
-
}>>;
|
|
15
|
-
documentId: z.ZodOptional<z.ZodString>;
|
|
16
|
-
callback: z.ZodOptional<z.ZodObject<{
|
|
17
|
-
url: z.ZodURL;
|
|
18
|
-
type: z.ZodOptional<z.ZodString>;
|
|
19
|
-
}, z.core.$strip>>;
|
|
20
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
-
data: z.ZodUnknown;
|
|
22
|
-
pageCount: z.ZodNumber;
|
|
23
|
-
model: z.ZodEnum<{
|
|
24
|
-
max: "max";
|
|
25
|
-
mini: "mini";
|
|
26
|
-
nano: "nano";
|
|
27
|
-
pro: "pro";
|
|
28
|
-
}>;
|
|
29
|
-
credits: z.ZodNumber;
|
|
30
|
-
requestId: z.ZodNumber;
|
|
31
|
-
documentId: z.ZodOptional<z.ZodString>;
|
|
32
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
33
|
-
//# sourceMappingURL=extract.d.ts.map
|