@pdfvector/instance-contract 0.0.13 → 0.0.14

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.
@@ -0,0 +1,23 @@
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
+ duration: z.ZodNumber;
17
+ operation: z.ZodString;
18
+ pageCount: z.ZodNullable<z.ZodNumber>;
19
+ requestedModel: z.ZodString;
20
+ createdAt: z.ZodNumber;
21
+ }, z.core.$strip>>;
22
+ hasMore: z.ZodBoolean;
23
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
@@ -0,0 +1,36 @@
1
+ import { oc } from "@orpc/contract";
2
+ import { z } from "zod";
3
+ const usageRecordSchema = z.object({
4
+ id: z.number(),
5
+ credits: z.number(),
6
+ model: z.string().nullable(),
7
+ inputSource: z.string(),
8
+ inputRef: z.string().nullable(),
9
+ fileSize: z.number(),
10
+ documentType: z.string(),
11
+ documentId: z.string().nullable(),
12
+ error: z.string().nullable(),
13
+ duration: z.number(),
14
+ operation: z.string(),
15
+ pageCount: z.number().nullable(),
16
+ requestedModel: z.string(),
17
+ createdAt: z.number(),
18
+ });
19
+ export const getUsageRecords = oc
20
+ .route({
21
+ summary: "Get usage records",
22
+ description: "Returns usage records with id > cursor, ordered by id ascending",
23
+ tags: ["Admin"],
24
+ spec: (op) => {
25
+ op.security = [{ bearerAuth: [] }];
26
+ return op;
27
+ },
28
+ })
29
+ .input(z.object({
30
+ cursor: z.number().optional().default(0),
31
+ limit: z.number().optional().default(1000),
32
+ }))
33
+ .output(z.object({
34
+ records: z.array(usageRecordSchema),
35
+ hasMore: z.boolean(),
36
+ }));
@@ -1,3 +1,4 @@
1
+ export * from "./get-usage-records";
1
2
  export * from "./health-check";
2
3
  export * from "./set-domain";
3
4
  export * from "./set-environment";
@@ -1,3 +1,4 @@
1
+ export * from "./get-usage-records";
1
2
  export * from "./health-check";
2
3
  export * from "./set-domain";
3
4
  export * from "./set-environment";
@@ -3,6 +3,8 @@ import { z } from "zod";
3
3
  const reservedKeys = new Set([
4
4
  "NODE_ENV",
5
5
  "PDFVECTOR_LOCAL",
6
+ "VITE_PDFVECTOR_LOCAL",
7
+ "NEXT_PUBLIC_PDFVECTOR_LOCAL",
6
8
  "PDFVECTOR_RELEASES_REGION",
7
9
  "PDFVECTOR_RELEASES_S3_BUCKET",
8
10
  "PDFVECTOR_RELEASES_DYNAMODB_TABLE",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @pdfvector/instance-contract
2
2
 
3
+ ## 0.0.14
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [#97](https://github.com/phuctm97/pdfvector/pull/97) [`ae078b8`](https://github.com/phuctm97/pdfvector/commit/ae078b8c10bbab802726e4f05b31ad08be96fd42) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add instance in spa and sync usage
9
+
3
10
  ## 0.0.13
4
11
  ### Patch Changes
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/instance-contract",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "main": ".tsc/lib/index.js",
6
6
  "dependencies": {