@pdfvector/instance-contract 0.1.2 → 0.2.1

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.
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  export declare const setEnvironment: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
3
- environment: z.ZodRecord<z.ZodString, z.ZodString>;
3
+ environment: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
4
4
  }, z.core.$strip>, z.ZodObject<{
5
5
  message: z.ZodString;
6
6
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
@@ -1 +1 @@
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;;;;8DAiCgB,CAAC"}
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"}
@@ -14,7 +14,7 @@ const reservedKeys = new Set([
14
14
  export const setEnvironment = oc
15
15
  .route({
16
16
  summary: "Set instance server's environment",
17
- description: "Update the instance server's environment variables",
17
+ description: "Update instance environment variables, or remove them by passing null",
18
18
  tags: ["Admin"],
19
19
  spec: (op) => {
20
20
  op.security = [{ bearerAuth: [] }];
@@ -25,7 +25,12 @@ export const setEnvironment = oc
25
25
  environment: z
26
26
  .record(z
27
27
  .string()
28
- .regex(/^[A-Z_][A-Z0-9_]*$/, "Keys must be valid env var names (e.g. MY_VAR)"), z.string().regex(/^[^\n\r]*$/, "Values must not contain newlines"))
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
+ ]))
29
34
  .refine((env) => Object.keys(env).length > 0, {
30
35
  message: "At least one environment variable is required",
31
36
  })
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @pdfvector/instance-contract
2
2
 
3
+ ## 0.2.1
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [[`3b6df52`](https://github.com/phuctm97/pdfvector/commit/3b6df52ce23f3cf3fe869c9aeeba907836ab1f9e)]:
7
+ - @pdfvector/util@0.0.24
8
+
9
+ ## 0.2.0
10
+ ### Minor Changes
11
+
12
+
13
+
14
+ - [#296](https://github.com/phuctm97/pdfvector/pull/296) [`379edac`](https://github.com/phuctm97/pdfvector/commit/379edac78547b250f69442ef7d2ea2b8a7d633d0) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Allow authenticated instance administrators to remove environment variables by assigning null values.
15
+
3
16
  ## 0.1.2
4
17
  ### Patch Changes
5
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/instance-contract",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "API contract definitions for PDF Vector instance server",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  "@orpc/client": "^1.14.8",
24
24
  "@orpc/contract": "^1.14.8",
25
25
  "@pdfvector/api-docs": "^0.0.6",
26
- "@pdfvector/util": "^0.0.23"
26
+ "@pdfvector/util": "^0.0.24"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "zod": "^4.4.3"