@pdfvector/instance-contract 0.1.2 → 0.2.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.
|
@@ -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;;;;
|
|
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
|
|
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.
|
|
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,12 @@
|
|
|
1
1
|
# @pdfvector/instance-contract
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
### Minor Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#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.
|
|
9
|
+
|
|
3
10
|
## 0.1.2
|
|
4
11
|
### Patch Changes
|
|
5
12
|
|