arcadible 1.0.27 → 1.0.28

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.
@@ -87,6 +87,7 @@ function zOrigins() {
87
87
  const field = "server_origins";
88
88
  return z.optional(z
89
89
  .array(zOrigin())
90
+ .min(1, message(field, ["Must not be empty.", "Leave the field out instead."]))
90
91
  .max(MAX_SERVERS, message(field, [`Must have at most ${MAX_SERVERS} items.`]))
91
92
  .refine((items) => new Set(items).size === items.length, message(field, ["Must not repeat an item."], ISSUE.DUPLICATE)));
92
93
  }
@@ -128,7 +129,7 @@ export function client() {
128
129
  code: "custom",
129
130
  path: ["outbound_hosts"],
130
131
  ...message("outbound_hosts", [
131
- `Must be, with client.server_origins, at most ${MAX_NAMES_LENGTH} characters together.`,
132
+ `Must be, with client.server_origins, at most ${MAX_NAMES_LENGTH.toLocaleString("en-US")} characters together.`,
132
133
  ], ISSUE.TOO_LONG),
133
134
  });
134
135
  }
@@ -67,6 +67,9 @@ function zHost(message, field, what) {
67
67
  export function zHosts(message, field, what) {
68
68
  return z.optional(z
69
69
  .array(zHost(message, field, what))
70
+ // an empty list is no list, as every list in the manifest is: leave
71
+ // the field out instead
72
+ .min(1, message(field, ["Must not be empty.", "Leave the field out instead."]))
70
73
  .max(MAX_HOSTS, message(field, [`Must have at most ${MAX_HOSTS} items.`]))
71
74
  .refine((items) => new Set(items).size === items.length, message(field, ["Must not repeat an item."], ISSUE.DUPLICATE)));
72
75
  }
@@ -8,7 +8,7 @@ import { messages } from "./message.js";
8
8
  const message = messages("function");
9
9
  // what a runner without `main` is told.
10
10
  const REQUIRED = message("main", [
11
- "Must be set: the path of the function's code, such as server/index.ts.",
11
+ "Must be set: the path of the function's code, such as function/index.ts.",
12
12
  ]).message;
13
13
  // a secret's name, as an environment variable is named.
14
14
  const SECRET = /^[A-Z][A-Z0-9_]*$/u;
@@ -19,6 +19,7 @@ function zNames(field, pattern, line) {
19
19
  .array(z
20
20
  .string()
21
21
  .regex(pattern, message(field, [line], ISSUE.CHARACTERS_INVALID)))
22
+ .min(1, message(field, ["Must not be empty.", "Leave the field out instead."]))
22
23
  .refine((items) => new Set(items).size === items.length, message(field, ["Must not repeat an item."], ISSUE.DUPLICATE)));
23
24
  }
24
25
  // [function]
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "license": "Apache-2.0",
45
45
  "name": "arcadible",
46
- "version": "1.0.27"
46
+ "version": "1.0.28"
47
47
  },
48
48
  "node_modules/@asamuzakjp/css-color": {
49
49
  "dependencies": {
@@ -3252,5 +3252,5 @@
3252
3252
  }
3253
3253
  },
3254
3254
  "requires": true,
3255
- "version": "1.0.27"
3255
+ "version": "1.0.28"
3256
3256
  }
package/package.json CHANGED
@@ -67,5 +67,5 @@
67
67
  "test": "tsc && npm run lint && node --test \"test/**/*.test.js\" \"test/**/*.test.mjs\""
68
68
  },
69
69
  "type": "module",
70
- "version": "1.0.27"
70
+ "version": "1.0.28"
71
71
  }