arcadible 1.0.27 → 1.0.29
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.
- package/dist/account.js +2 -3
- package/dist/action/serve/tool.js +4 -4
- package/dist/schema/client.js +2 -1
- package/dist/schema/host.js +3 -0
- package/dist/schema/runner.js +2 -1
- package/dist/util/os.js +17 -6
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/account.js
CHANGED
|
@@ -9,7 +9,7 @@ import { HttpError } from "./util/http.js";
|
|
|
9
9
|
import { sessionExpired } from "./phrase/index.js";
|
|
10
10
|
import { deepSort, isTable } from "./util/objs.js";
|
|
11
11
|
import { configDir } from "./util/os.js";
|
|
12
|
-
import { title
|
|
12
|
+
import { title } from "./config/product.js";
|
|
13
13
|
// [declare]
|
|
14
14
|
const DIR_MODE = 0o700;
|
|
15
15
|
const FILE = "account.json";
|
|
@@ -19,9 +19,8 @@ const FILE_MODE = 0o600;
|
|
|
19
19
|
const REJECTED = [400, 401, 403];
|
|
20
20
|
// [declare]
|
|
21
21
|
const TOKEN_USER = { display_name: `${title} Token`, id: null };
|
|
22
|
-
const TOOL = tool;
|
|
23
22
|
// [define]
|
|
24
|
-
const dir =
|
|
23
|
+
const dir = configDir();
|
|
25
24
|
const file = join(dir, FILE);
|
|
26
25
|
// [function]
|
|
27
26
|
// whether a failure is the file system's, with this code, such as ENOENT.
|
|
@@ -18,7 +18,7 @@ import * as phrase from "../../phrase/index.js";
|
|
|
18
18
|
import { media } from "../../parser/media.js";
|
|
19
19
|
import { textOf } from "../../util/objs.js";
|
|
20
20
|
import { configDir } from "../../util/os.js";
|
|
21
|
-
import { title
|
|
21
|
+
import { title } from "../../config/product.js";
|
|
22
22
|
import { watchDir } from "../../serve/reload.js";
|
|
23
23
|
import { remoteFiles } from "../../serve/remote.js";
|
|
24
24
|
import { serve } from "../../serve/server.js";
|
|
@@ -165,20 +165,20 @@ export async function serveTool(conf) {
|
|
|
165
165
|
version: game.version ?? null,
|
|
166
166
|
},
|
|
167
167
|
// arc serve's own tickets, signed with a key kept beside the session
|
|
168
|
-
keyFile: join(configDir(),
|
|
168
|
+
keyFile: join(configDir(), "ticket-key.json"),
|
|
169
169
|
onRemote: handler.onRemote,
|
|
170
170
|
player,
|
|
171
171
|
port,
|
|
172
172
|
root,
|
|
173
173
|
remote: remoteFiles({
|
|
174
|
-
dir: join(configDir(),
|
|
174
|
+
dir: join(configDir(), "sdk"),
|
|
175
175
|
host: HOST_HTTP_PLAY,
|
|
176
176
|
sdk: ARCADIBLE_SDK,
|
|
177
177
|
}),
|
|
178
178
|
...(runs && runnerMain
|
|
179
179
|
? {
|
|
180
180
|
runner: {
|
|
181
|
-
dir: join(configDir(),
|
|
181
|
+
dir: join(configDir(), "runner"),
|
|
182
182
|
handler: {
|
|
183
183
|
onError: handler.onRunnerError,
|
|
184
184
|
onInstall: handler.onRunnerInstall,
|
package/dist/schema/client.js
CHANGED
|
@@ -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
|
}
|
package/dist/schema/host.js
CHANGED
|
@@ -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
|
}
|
package/dist/schema/runner.js
CHANGED
|
@@ -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
|
|
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]
|
package/dist/util/os.js
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
// [import]
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
// [import]
|
|
5
|
+
import { tool } from "../config/product.js";
|
|
4
6
|
// [function]
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
7
|
+
// arc's own folder, which holds the session and arc serve's key and caches:
|
|
8
|
+
// ARCADIBLE_CONFIG_DIR when it's set (left out of the developer docs on
|
|
9
|
+
// purpose, as ARCADIBLE_TOKEN is: it gives an agent or a test a folder of its
|
|
10
|
+
// own), or else ~/.config/arc, or on Windows the machine's own folder
|
|
11
|
+
// (%LOCALAPPDATA%\arc), not the roaming one: the session is a credential, and
|
|
12
|
+
// the SDK's copy a cache, neither of which should follow a roaming profile to
|
|
13
|
+
// other machines
|
|
8
14
|
export function configDir() {
|
|
15
|
+
const dir = process.env["ARCADIBLE_CONFIG_DIR"];
|
|
16
|
+
if (dir) {
|
|
17
|
+
return resolve(dir);
|
|
18
|
+
}
|
|
9
19
|
if (process.platform === "win32") {
|
|
10
|
-
|
|
20
|
+
const local = process.env["LOCALAPPDATA"] || join(homedir(), "AppData", "Local");
|
|
21
|
+
return join(local, tool);
|
|
11
22
|
}
|
|
12
|
-
return join(homedir(), ".config");
|
|
23
|
+
return join(homedir(), ".config", tool);
|
|
13
24
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"license": "Apache-2.0",
|
|
45
45
|
"name": "arcadible",
|
|
46
|
-
"version": "1.0.
|
|
46
|
+
"version": "1.0.29"
|
|
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.
|
|
3255
|
+
"version": "1.0.29"
|
|
3256
3256
|
}
|
package/package.json
CHANGED