@pdfvector/instance-contract 0.0.24 → 0.0.26

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.
Files changed (32) hide show
  1. package/.tsc/lib/router/academic/fetch.d.ts +4 -0
  2. package/.tsc/lib/router/academic/fetch.js +15 -0
  3. package/.tsc/lib/router/academic/find-citations.d.ts +4 -0
  4. package/.tsc/lib/router/academic/find-citations.js +15 -0
  5. package/.tsc/lib/router/academic/search.d.ts +4 -0
  6. package/.tsc/lib/router/academic/search.js +15 -0
  7. package/.tsc/lib/router/bankStatement/ask.d.ts +4 -0
  8. package/.tsc/lib/router/bankStatement/ask.js +15 -0
  9. package/.tsc/lib/router/bankStatement/extract.d.ts +4 -0
  10. package/.tsc/lib/router/bankStatement/extract.js +17 -0
  11. package/.tsc/lib/router/bankStatement/parse.d.ts +4 -0
  12. package/.tsc/lib/router/bankStatement/parse.js +15 -0
  13. package/.tsc/lib/router/document/ask.d.ts +4 -0
  14. package/.tsc/lib/router/document/ask.js +15 -0
  15. package/.tsc/lib/router/document/extract.d.ts +4 -0
  16. package/.tsc/lib/router/document/extract.js +17 -0
  17. package/.tsc/lib/router/document/parse.d.ts +4 -0
  18. package/.tsc/lib/router/document/parse.js +15 -0
  19. package/.tsc/lib/router/identity/ask.d.ts +4 -0
  20. package/.tsc/lib/router/identity/ask.js +15 -0
  21. package/.tsc/lib/router/identity/extract.d.ts +4 -0
  22. package/.tsc/lib/router/identity/extract.js +17 -0
  23. package/.tsc/lib/router/identity/parse.d.ts +4 -0
  24. package/.tsc/lib/router/identity/parse.js +15 -0
  25. package/.tsc/lib/router/invoice/ask.d.ts +4 -0
  26. package/.tsc/lib/router/invoice/ask.js +15 -0
  27. package/.tsc/lib/router/invoice/extract.d.ts +4 -0
  28. package/.tsc/lib/router/invoice/extract.js +17 -0
  29. package/.tsc/lib/router/invoice/parse.d.ts +4 -0
  30. package/.tsc/lib/router/invoice/parse.js +15 -0
  31. package/CHANGELOG.md +14 -0
  32. package/package.json +1 -1
@@ -16,6 +16,10 @@ export declare const fetch: import("@orpc/contract").ContractProcedureBuilderWit
16
16
  provider: "provider";
17
17
  providerData: "providerData";
18
18
  }>>>>;
19
+ callback: z.ZodOptional<z.ZodObject<{
20
+ url: z.ZodURL;
21
+ type: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>>;
19
23
  }, z.core.$strip>, z.ZodObject<{
20
24
  results: z.ZodArray<z.ZodObject<{
21
25
  id: z.ZodString;
@@ -78,6 +78,21 @@ export const fetch = oc
78
78
  })
79
79
  .nullish()
80
80
  .describe("Specific publication fields to return. If omitted, returns all fields except providerData."),
81
+ callback: z
82
+ .object({
83
+ url: z
84
+ .url()
85
+ .describe("Webhook URL where results will be POSTed when processing completes"),
86
+ type: z
87
+ .string()
88
+ .optional()
89
+ .describe("Callback type identifier (e.g. 'zapier')"),
90
+ })
91
+ .optional()
92
+ .describe("Optional webhook callback for async processing. " +
93
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
94
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
95
+ "Useful for long-running operations that may exceed client timeout limits."),
81
96
  }))
82
97
  .output(z.object({
83
98
  results: z.array(publicationSchema),
@@ -25,6 +25,10 @@ export declare const findCitations: import("@orpc/contract").ContractProcedureBu
25
25
  provider: "provider";
26
26
  providerData: "providerData";
27
27
  }>>>>;
28
+ callback: z.ZodOptional<z.ZodObject<{
29
+ url: z.ZodURL;
30
+ type: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>>;
28
32
  }, z.core.$strip>, z.ZodObject<{
29
33
  results: z.ZodArray<z.ZodObject<{
30
34
  sentence: z.ZodString;
@@ -83,6 +83,21 @@ export const findCitations = oc
83
83
  })
84
84
  .nullish()
85
85
  .describe("Specific citation fields to return. If omitted, returns all fields except providerData."),
86
+ callback: z
87
+ .object({
88
+ url: z
89
+ .url()
90
+ .describe("Webhook URL where results will be POSTed when processing completes"),
91
+ type: z
92
+ .string()
93
+ .optional()
94
+ .describe("Callback type identifier (e.g. 'zapier')"),
95
+ })
96
+ .optional()
97
+ .describe("Optional webhook callback for async processing. " +
98
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
99
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
100
+ "Useful for long-running operations that may exceed client timeout limits."),
86
101
  }))
87
102
  .output(z.object({
88
103
  results: z.array(sentenceCitationSchema),
@@ -29,6 +29,10 @@ export declare const search: import("@orpc/contract").ContractProcedureBuilderWi
29
29
  provider: "provider";
30
30
  providerData: "providerData";
31
31
  }>>>>;
32
+ callback: z.ZodOptional<z.ZodObject<{
33
+ url: z.ZodURL;
34
+ type: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$strip>>;
32
36
  }, z.core.$strip>, z.ZodObject<{
33
37
  estimatedTotalResults: z.ZodNumber;
34
38
  results: z.ZodArray<z.ZodObject<{
@@ -122,6 +122,21 @@ export const search = oc
122
122
  })
123
123
  .nullish()
124
124
  .describe("Specific publication fields to return. If omitted, returns all fields except providerData."),
125
+ callback: z
126
+ .object({
127
+ url: z
128
+ .url()
129
+ .describe("Webhook URL where results will be POSTed when processing completes"),
130
+ type: z
131
+ .string()
132
+ .optional()
133
+ .describe("Callback type identifier (e.g. 'zapier')"),
134
+ })
135
+ .optional()
136
+ .describe("Optional webhook callback for async processing. " +
137
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
138
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
139
+ "Useful for long-running operations that may exceed client timeout limits."),
125
140
  }))
126
141
  .output(z.object({
127
142
  estimatedTotalResults: z.number(),
@@ -11,6 +11,10 @@ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithI
11
11
  max: "max";
12
12
  auto: "auto";
13
13
  }>>;
14
+ callback: z.ZodOptional<z.ZodObject<{
15
+ url: z.ZodURL;
16
+ type: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>>;
14
18
  }, z.core.$strip>, z.ZodObject<{
15
19
  markdown: z.ZodString;
16
20
  pageCount: z.ZodNumber;
@@ -37,6 +37,21 @@ const askInputSchema = z.object({
37
37
  "'mini': Uses mid-range models. " +
38
38
  "'pro': Uses capable models. " +
39
39
  "'max': Uses the most powerful models."),
40
+ callback: z
41
+ .object({
42
+ url: z
43
+ .url()
44
+ .describe("Webhook URL where results will be POSTed when processing completes"),
45
+ type: z
46
+ .string()
47
+ .optional()
48
+ .describe("Callback type identifier (e.g. 'zapier')"),
49
+ })
50
+ .optional()
51
+ .describe("Optional webhook callback for async processing. " +
52
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
53
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
54
+ "Useful for long-running operations that may exceed client timeout limits."),
40
55
  });
41
56
  const askOutputSchema = z.object({
42
57
  markdown: z.string().describe("The answer to the question"),
@@ -12,6 +12,10 @@ export declare const extract: import("@orpc/contract").ContractProcedureBuilderW
12
12
  max: "max";
13
13
  auto: "auto";
14
14
  }>>;
15
+ callback: z.ZodOptional<z.ZodObject<{
16
+ url: z.ZodURL;
17
+ type: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>;
15
19
  }, z.core.$strip>, z.ZodObject<{
16
20
  data: z.ZodUnknown;
17
21
  pageCount: z.ZodNumber;
@@ -63,10 +63,27 @@ const extractInputSchema = z.object({
63
63
  "'mini': Uses mid-range models. " +
64
64
  "'pro': Uses capable models. " +
65
65
  "'max': Uses the most powerful models."),
66
+ callback: z
67
+ .object({
68
+ url: z
69
+ .url()
70
+ .describe("Webhook URL where results will be POSTed when processing completes"),
71
+ type: z
72
+ .string()
73
+ .optional()
74
+ .describe("Callback type identifier (e.g. 'zapier')"),
75
+ })
76
+ .optional()
77
+ .describe("Optional webhook callback for async processing. " +
78
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
79
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
80
+ "Useful for long-running operations that may exceed client timeout limits."),
66
81
  });
67
82
  const extractOutputSchema = z.object({
68
83
  data: z
69
84
  .unknown()
85
+ .refine((val) => val != null &&
86
+ (typeof val !== "object" || Object.keys(val).length > 0), { message: "Extracted data must not be empty" })
70
87
  .describe("Extracted structured data matching the provided JSON Schema"),
71
88
  pageCount: z.number().int().describe("Total number of pages in the document"),
72
89
  model: pdfvectorModelSchema.describe("Model tier used to extract the data"),
@@ -8,6 +8,10 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
8
8
  max: "max";
9
9
  auto: "auto";
10
10
  }>>;
11
+ callback: z.ZodOptional<z.ZodObject<{
12
+ url: z.ZodURL;
13
+ type: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>>;
11
15
  }, z.core.$strip>, z.ZodObject<{
12
16
  markdown: z.ZodString;
13
17
  pageCount: z.ZodNumber;
@@ -32,6 +32,21 @@ const parseInputSchema = z.object({
32
32
  "'auto' (default): Automatically selects the best parsing strategy with intelligent fallback. " +
33
33
  "'pro': Extracts structured bank statement fields with standard accuracy. " +
34
34
  "'max': Extracts structured bank statement fields with highest accuracy and fallback."),
35
+ callback: z
36
+ .object({
37
+ url: z
38
+ .url()
39
+ .describe("Webhook URL where results will be POSTed when processing completes"),
40
+ type: z
41
+ .string()
42
+ .optional()
43
+ .describe("Callback type identifier (e.g. 'zapier')"),
44
+ })
45
+ .optional()
46
+ .describe("Optional webhook callback for async processing. " +
47
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
48
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
49
+ "Useful for long-running operations that may exceed client timeout limits."),
35
50
  });
36
51
  const parseOutputSchema = z.object({
37
52
  markdown: z
@@ -11,6 +11,10 @@ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithI
11
11
  max: "max";
12
12
  auto: "auto";
13
13
  }>>>;
14
+ callback: z.ZodOptional<z.ZodObject<{
15
+ url: z.ZodURL;
16
+ type: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>>;
14
18
  }, z.core.$strip>, z.ZodObject<{
15
19
  markdown: z.ZodString;
16
20
  pageCount: z.ZodNumber;
@@ -38,6 +38,21 @@ const askInputSchema = z.object({
38
38
  "'mini': Uses mid-range models (likely better than GPT-5-mini). Supports PDF, Word, Excel, CSV. " +
39
39
  "'pro': Uses capable models (likely better than GPT-5.2). Supports PDF, Word, Excel, CSV, Image. " +
40
40
  "'max': Uses the most powerful models (likely better than Claude Opus 4.6). Supports PDF, Word, Excel, CSV, Image."),
41
+ callback: z
42
+ .object({
43
+ url: z
44
+ .url()
45
+ .describe("Webhook URL where results will be POSTed when processing completes"),
46
+ type: z
47
+ .string()
48
+ .optional()
49
+ .describe("Callback type identifier (e.g. 'zapier')"),
50
+ })
51
+ .optional()
52
+ .describe("Optional webhook callback for async processing. " +
53
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
54
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
55
+ "Useful for long-running operations that may exceed client timeout limits."),
41
56
  });
42
57
  const askOutputSchema = z
43
58
  .object({
@@ -12,6 +12,10 @@ export declare const extract: import("@orpc/contract").ContractProcedureBuilderW
12
12
  max: "max";
13
13
  auto: "auto";
14
14
  }>>>;
15
+ callback: z.ZodOptional<z.ZodObject<{
16
+ url: z.ZodURL;
17
+ type: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>;
15
19
  }, z.core.$strip>, z.ZodObject<{
16
20
  data: z.ZodUnknown;
17
21
  pageCount: z.ZodNumber;
@@ -65,11 +65,28 @@ const extractInputSchema = z.object({
65
65
  "'mini': Uses mid-range models (likely better than GPT-5-mini). Supports PDF, Word, Excel, CSV. " +
66
66
  "'pro': Uses capable models (likely better than GPT-5.2). Supports PDF, Word, Excel, CSV, Image. " +
67
67
  "'max': Uses the most powerful models (likely better than Claude Opus 4.6). Supports PDF, Word, Excel, CSV, Image."),
68
+ callback: z
69
+ .object({
70
+ url: z
71
+ .url()
72
+ .describe("Webhook URL where results will be POSTed when processing completes"),
73
+ type: z
74
+ .string()
75
+ .optional()
76
+ .describe("Callback type identifier (e.g. 'zapier')"),
77
+ })
78
+ .optional()
79
+ .describe("Optional webhook callback for async processing. " +
80
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
81
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
82
+ "Useful for long-running operations that may exceed client timeout limits."),
68
83
  });
69
84
  const extractOutputSchema = z
70
85
  .object({
71
86
  data: z
72
87
  .unknown()
88
+ .refine((val) => val != null &&
89
+ (typeof val !== "object" || Object.keys(val).length > 0), { message: "Extracted data must not be empty" })
73
90
  .describe("Extracted structured data matching the provided JSON Schema"),
74
91
  pageCount: z
75
92
  .number()
@@ -10,6 +10,10 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
10
10
  max: "max";
11
11
  auto: "auto";
12
12
  }>>>;
13
+ callback: z.ZodOptional<z.ZodObject<{
14
+ url: z.ZodURL;
15
+ type: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>>;
13
17
  }, z.core.$strip>, z.ZodObject<{
14
18
  markdown: z.ZodString;
15
19
  pageCount: z.ZodNumber;
@@ -34,6 +34,21 @@ const parseInputSchema = z.object({
34
34
  "'mini': For documents with tables and structured content. File up to 30 pages, up to 10MB in size. Supports PDF, Word, Excel, CSV. " +
35
35
  "'pro': For documents up to 30 pages with tables, handwritten text, figures, math, and Arabic. File up to 30 pages, up to 40MB in size. Supports PDF, Word, Excel, CSV, Image. " +
36
36
  "'max': For large documents with full Pro capabilities plus enhanced multilingual support. File up to 1000 pages, up to 500MB in size. Supports PDF, Word, Excel, CSV, Image."),
37
+ callback: z
38
+ .object({
39
+ url: z
40
+ .url()
41
+ .describe("Webhook URL where results will be POSTed when processing completes"),
42
+ type: z
43
+ .string()
44
+ .optional()
45
+ .describe("Callback type identifier (e.g. 'zapier')"),
46
+ })
47
+ .optional()
48
+ .describe("Optional webhook callback for async processing. " +
49
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
50
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
51
+ "Useful for long-running operations that may exceed client timeout limits."),
37
52
  });
38
53
  const parseOutputSchema = z.object({
39
54
  markdown: z.string().describe("Extracted text content from the document"),
@@ -11,6 +11,10 @@ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithI
11
11
  max: "max";
12
12
  auto: "auto";
13
13
  }>>;
14
+ callback: z.ZodOptional<z.ZodObject<{
15
+ url: z.ZodURL;
16
+ type: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>>;
14
18
  }, z.core.$strip>, z.ZodObject<{
15
19
  markdown: z.ZodString;
16
20
  pageCount: z.ZodNumber;
@@ -37,6 +37,21 @@ const askInputSchema = z.object({
37
37
  "'mini': Uses mid-range models. " +
38
38
  "'pro': Uses capable models. " +
39
39
  "'max': Uses the most powerful models."),
40
+ callback: z
41
+ .object({
42
+ url: z
43
+ .url()
44
+ .describe("Webhook URL where results will be POSTed when processing completes"),
45
+ type: z
46
+ .string()
47
+ .optional()
48
+ .describe("Callback type identifier (e.g. 'zapier')"),
49
+ })
50
+ .optional()
51
+ .describe("Optional webhook callback for async processing. " +
52
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
53
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
54
+ "Useful for long-running operations that may exceed client timeout limits."),
40
55
  });
41
56
  const askOutputSchema = z.object({
42
57
  markdown: z.string().describe("The answer to the question"),
@@ -12,6 +12,10 @@ export declare const extract: import("@orpc/contract").ContractProcedureBuilderW
12
12
  max: "max";
13
13
  auto: "auto";
14
14
  }>>;
15
+ callback: z.ZodOptional<z.ZodObject<{
16
+ url: z.ZodURL;
17
+ type: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>;
15
19
  }, z.core.$strip>, z.ZodObject<{
16
20
  data: z.ZodUnknown;
17
21
  pageCount: z.ZodNumber;
@@ -63,10 +63,27 @@ const extractInputSchema = z.object({
63
63
  "'mini': Uses mid-range models. " +
64
64
  "'pro': Uses capable models. " +
65
65
  "'max': Uses the most powerful models."),
66
+ callback: z
67
+ .object({
68
+ url: z
69
+ .url()
70
+ .describe("Webhook URL where results will be POSTed when processing completes"),
71
+ type: z
72
+ .string()
73
+ .optional()
74
+ .describe("Callback type identifier (e.g. 'zapier')"),
75
+ })
76
+ .optional()
77
+ .describe("Optional webhook callback for async processing. " +
78
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
79
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
80
+ "Useful for long-running operations that may exceed client timeout limits."),
66
81
  });
67
82
  const extractOutputSchema = z.object({
68
83
  data: z
69
84
  .unknown()
85
+ .refine((val) => val != null &&
86
+ (typeof val !== "object" || Object.keys(val).length > 0), { message: "Extracted data must not be empty" })
70
87
  .describe("Extracted structured data matching the provided JSON Schema"),
71
88
  pageCount: z.number().int().describe("Total number of pages in the document"),
72
89
  model: pdfvectorModelSchema.describe("Model tier used to extract the data"),
@@ -8,6 +8,10 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
8
8
  max: "max";
9
9
  auto: "auto";
10
10
  }>>;
11
+ callback: z.ZodOptional<z.ZodObject<{
12
+ url: z.ZodURL;
13
+ type: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>>;
11
15
  }, z.core.$strip>, z.ZodObject<{
12
16
  markdown: z.ZodString;
13
17
  pageCount: z.ZodNumber;
@@ -32,6 +32,21 @@ const parseInputSchema = z.object({
32
32
  "'auto' (default): Automatically selects the best parsing strategy with intelligent fallback. " +
33
33
  "'pro': Extracts structured identity document fields with standard accuracy. " +
34
34
  "'max': Extracts structured identity document fields with highest accuracy."),
35
+ callback: z
36
+ .object({
37
+ url: z
38
+ .url()
39
+ .describe("Webhook URL where results will be POSTed when processing completes"),
40
+ type: z
41
+ .string()
42
+ .optional()
43
+ .describe("Callback type identifier (e.g. 'zapier')"),
44
+ })
45
+ .optional()
46
+ .describe("Optional webhook callback for async processing. " +
47
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
48
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
49
+ "Useful for long-running operations that may exceed client timeout limits."),
35
50
  });
36
51
  const parseOutputSchema = z.object({
37
52
  markdown: z
@@ -11,6 +11,10 @@ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithI
11
11
  max: "max";
12
12
  auto: "auto";
13
13
  }>>;
14
+ callback: z.ZodOptional<z.ZodObject<{
15
+ url: z.ZodURL;
16
+ type: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>>;
14
18
  }, z.core.$strip>, z.ZodObject<{
15
19
  markdown: z.ZodString;
16
20
  pageCount: z.ZodNumber;
@@ -34,6 +34,21 @@ const askInputSchema = z.object({
34
34
  "'mini': Uses mid-range models. " +
35
35
  "'pro': Uses capable models. " +
36
36
  "'max': Uses the most powerful models."),
37
+ callback: z
38
+ .object({
39
+ url: z
40
+ .url()
41
+ .describe("Webhook URL where results will be POSTed when processing completes"),
42
+ type: z
43
+ .string()
44
+ .optional()
45
+ .describe("Callback type identifier (e.g. 'zapier')"),
46
+ })
47
+ .optional()
48
+ .describe("Optional webhook callback for async processing. " +
49
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
50
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
51
+ "Useful for long-running operations that may exceed client timeout limits."),
37
52
  });
38
53
  const askOutputSchema = z.object({
39
54
  markdown: z.string().describe("The answer to the question"),
@@ -12,6 +12,10 @@ export declare const extract: import("@orpc/contract").ContractProcedureBuilderW
12
12
  max: "max";
13
13
  auto: "auto";
14
14
  }>>;
15
+ callback: z.ZodOptional<z.ZodObject<{
16
+ url: z.ZodURL;
17
+ type: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>;
15
19
  }, z.core.$strip>, z.ZodObject<{
16
20
  data: z.ZodUnknown;
17
21
  pageCount: z.ZodNumber;
@@ -60,10 +60,27 @@ const extractInputSchema = z.object({
60
60
  "'mini': Uses mid-range models. " +
61
61
  "'pro': Uses capable models. " +
62
62
  "'max': Uses the most powerful models."),
63
+ callback: z
64
+ .object({
65
+ url: z
66
+ .url()
67
+ .describe("Webhook URL where results will be POSTed when processing completes"),
68
+ type: z
69
+ .string()
70
+ .optional()
71
+ .describe("Callback type identifier (e.g. 'zapier')"),
72
+ })
73
+ .optional()
74
+ .describe("Optional webhook callback for async processing. " +
75
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
76
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
77
+ "Useful for long-running operations that may exceed client timeout limits."),
63
78
  });
64
79
  const extractOutputSchema = z.object({
65
80
  data: z
66
81
  .unknown()
82
+ .refine((val) => val != null &&
83
+ (typeof val !== "object" || Object.keys(val).length > 0), { message: "Extracted data must not be empty" })
67
84
  .describe("Extracted structured data matching the provided JSON Schema"),
68
85
  pageCount: z.number().int().describe("Total number of pages in the document"),
69
86
  model: pdfvectorModelSchema.describe("Model tier used to extract the data"),
@@ -8,6 +8,10 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
8
8
  max: "max";
9
9
  auto: "auto";
10
10
  }>>;
11
+ callback: z.ZodOptional<z.ZodObject<{
12
+ url: z.ZodURL;
13
+ type: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>>;
11
15
  }, z.core.$strip>, z.ZodObject<{
12
16
  markdown: z.ZodString;
13
17
  pageCount: z.ZodNumber;
@@ -29,6 +29,21 @@ const parseInputSchema = z.object({
29
29
  "'auto' (default): Automatically selects the best parsing strategy with intelligent fallback. " +
30
30
  "'pro': Extracts structured invoice fields with standard accuracy. " +
31
31
  "'max': Extracts structured invoice fields with highest accuracy and fallback."),
32
+ callback: z
33
+ .object({
34
+ url: z
35
+ .url()
36
+ .describe("Webhook URL where results will be POSTed when processing completes"),
37
+ type: z
38
+ .string()
39
+ .optional()
40
+ .describe("Callback type identifier (e.g. 'zapier')"),
41
+ })
42
+ .optional()
43
+ .describe("Optional webhook callback for async processing. " +
44
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
45
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
46
+ "Useful for long-running operations that may exceed client timeout limits."),
32
47
  });
33
48
  const parseOutputSchema = z.object({
34
49
  markdown: z.string().describe("Extracted text content from the invoice"),
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @pdfvector/instance-contract
2
2
 
3
+ ## 0.0.26
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [#144](https://github.com/phuctm97/pdfvector/pull/144) [`4ba69fc`](https://github.com/phuctm97/pdfvector/commit/4ba69fc05b9fe462bfb9475d923cad66211c3222) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add schema mismatch retry and empty output validation for extract API
9
+
10
+ ## 0.0.25
11
+ ### Patch Changes
12
+
13
+
14
+
15
+ - [#135](https://github.com/phuctm97/pdfvector/pull/135) [`732ce5a`](https://github.com/phuctm97/pdfvector/commit/732ce5a843716075fa17c2ae64525b21919b0a3c) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add Zapier integration package with callback support and CI/CD release workflow
16
+
3
17
  ## 0.0.24
4
18
  ### Patch Changes
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/instance-contract",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "type": "module",
5
5
  "description": "API contract definitions for PDFVector instance server",
6
6
  "license": "MIT",