@zaisma/cli 0.60.0 → 0.62.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.
- package/check.d.mts +5 -1
- package/check.mjs +19 -0
- package/fixed-checks.d.mts +39 -0
- package/fixed-checks.mjs +528 -0
- package/package.json +6 -1
- package/skill/SKILL.md +1 -1
- package/skill/references/developer-api.md +36 -74
- package/skill/references/errors.md +0 -1
- package/skill/references/naming.md +5 -7
- package/skill/references/sdk.md +8 -3
- package/zaisma.mjs +5 -16
package/skill/references/sdk.md
CHANGED
|
@@ -1527,8 +1527,11 @@ interface Room {
|
|
|
1527
1527
|
block(playerId: string): Promise<boolean>;
|
|
1528
1528
|
/**
|
|
1529
1529
|
* Report a player to Zaisma, with what happened in the player's own words if they gave any (details).
|
|
1530
|
-
*
|
|
1531
|
-
*
|
|
1530
|
+
* On Zaisma it opens Zaisma's report sheet beside the game, filled in with the player, reason and words,
|
|
1531
|
+
* where the player picks the messages to send and sends it: only reports a player sends there count
|
|
1532
|
+
* toward muting someone. Resolves once they send it; rejects with error.code "report_not_sent" when they
|
|
1533
|
+
* close it without sending. Off Zaisma (a game's own site) the last chat lines (up to 20) they sent this
|
|
1534
|
+
* player, or this player sent them, go with it; nothing else about the reporting player is sent.
|
|
1532
1535
|
*/
|
|
1533
1536
|
report(playerId: string, reason: ReportReason, details?: string): Promise<ReportAnswer>;
|
|
1534
1537
|
/**
|
|
@@ -2171,6 +2174,7 @@ type RequestErrorCode =
|
|
|
2171
2174
|
* - slow_down: too many calls; try again in a minute.
|
|
2172
2175
|
* - zaisma_rooms_not_used: the game doesn't use Zaisma rooms.
|
|
2173
2176
|
* - bad_report: a report whose reason isn't a {@link ReportReason}, or whose player ID isn't one.
|
|
2177
|
+
* - report_not_sent: the player closed Zaisma's report sheet, which {@link Room.report} opened, without sending it.
|
|
2174
2178
|
* - bad_origin: the call didn't come from the game's own page.
|
|
2175
2179
|
* - not_on_zaisma: the game is played off Zaisma, so it has no player passes, sign-in or room lists; joinRoom and server.request need {@link setUpOffZaisma} and a serverUrl.
|
|
2176
2180
|
* - bad_game_slug: {@link setUpOffZaisma}'s gameSlug isn't a game slug: 1 to 40 lowercase letters, digits or hyphens.
|
|
@@ -2205,6 +2209,7 @@ type ErrorCode =
|
|
|
2205
2209
|
```ts
|
|
2206
2210
|
| RoomErrorCode
|
|
2207
2211
|
| RequestErrorCode
|
|
2212
|
+
| "report_not_sent"
|
|
2208
2213
|
| "chat_stopped"
|
|
2209
2214
|
| "chat_not_allowed"
|
|
2210
2215
|
| "chat_empty"
|
|
@@ -2326,7 +2331,7 @@ type ChatCheckReason = "contact_details" | "personal_details" | "slur" | "sexual
|
|
|
2326
2331
|
|
|
2327
2332
|
```ts
|
|
2328
2333
|
/** What happened, in a player report. Zaisma looks at real_life_threat (a threat that reaches past the game: their real details, finding them, a plan), personal_details (sharing someone's), following_after_block and sexual (behavior); harassment, cheating and other go to the game's developer. */
|
|
2329
|
-
type ReportReason = "real_life_threat" | "personal_details" | "following_after_block" | "sexual" | "harassment" | "cheating" | "other";
|
|
2334
|
+
type ReportReason = "real_life_threat" | "personal_details" | "following_after_block" | "sexual" | "harassment" | "cheating" | "wrong_age" | "under_13" | "other";
|
|
2330
2335
|
```
|
|
2331
2336
|
|
|
2332
2337
|
### ReportAnswer
|
package/zaisma.mjs
CHANGED
|
@@ -203,8 +203,7 @@ const COMMANDS = {
|
|
|
203
203
|
flags: {
|
|
204
204
|
game: { hasValue: true, isRequired: true, placeholder: "<slug>", about: "The game to upload to" },
|
|
205
205
|
"patch-notes": { hasValue: true, placeholder: '"…"', about: "What changed, shown with the update" },
|
|
206
|
-
"
|
|
207
|
-
"publish-when-approved": { hasValue: false, about: "Go live as soon as it passes review" },
|
|
206
|
+
"publish-when-approved": { hasValue: false, about: "Go live as soon as it passes the scan" },
|
|
208
207
|
"big-update": { hasValue: false, about: "With --publish-when-approved and --patch-notes: mark it a big update; left out, it goes live as a quiet patch" },
|
|
209
208
|
"match-update-mode": { hasValue: true, choices: MATCH_UPDATE_MODES, about: "With --publish-when-approved: when running matches get it: next_match (they finish on the version they started; the default) or now (every live match switches within seconds, in the same room)" },
|
|
210
209
|
},
|
|
@@ -224,14 +223,12 @@ const COMMANDS = {
|
|
|
224
223
|
about: "Publish a version that passed, or roll back to an older one",
|
|
225
224
|
arguments: [{ name: "slug" }, { name: "version_id" }],
|
|
226
225
|
flags: {
|
|
227
|
-
"after-review": { about: "Go live only once the AI review passes, for a developer who could go first" },
|
|
228
226
|
"scheduled-publish-at": { hasValue: true, placeholder: "<time>", about: 'Publish later instead: an ISO 8601 time with Z or an offset, like "2026-11-01T17:00:00Z" or "2026-11-01T17:00+01:00"' },
|
|
229
227
|
"big-update": { hasValue: false, about: "Mark it a big update, which must say what's new; left out, it's a quiet patch" },
|
|
230
228
|
"patch-notes": { hasValue: true, placeholder: '"…"', about: "What changed, in place of what it was uploaded with; only for a version that has never been live" },
|
|
231
229
|
"match-update-mode": { hasValue: true, choices: MATCH_UPDATE_MODES, about: "When running matches get it: next_match (they finish on the version they started; the default) or now (every live match switches within seconds, in the same room)" },
|
|
232
230
|
},
|
|
233
231
|
},
|
|
234
|
-
"ai-review": { about: "Start a version's AI review without publishing it, ahead of a launch", arguments: [{ name: "slug" }, { name: "version_id" }], flags: {} },
|
|
235
232
|
unschedule: { about: "Cancel a publish-later", arguments: [{ name: "slug" }, { name: "version_id" }], flags: {} },
|
|
236
233
|
visibility: { about: "Set who can see a game: everyone (listed), people with the link (unlisted), or only you and tester links (private, draft)", arguments: [{ name: "slug" }, { name: "visibility", choices: VISIBILITIES }], flags: {} },
|
|
237
234
|
"allowed-hosts": {
|
|
@@ -1259,7 +1256,7 @@ async function sendVersion(slug, fixedFiles, flags) {
|
|
|
1259
1256
|
);
|
|
1260
1257
|
if (todo.length && !isJson) process.stdout.write("\n");
|
|
1261
1258
|
|
|
1262
|
-
let answer = await api("POST", `/games/${slug}/versions`, { files: list, patch_notes: flags["patch-notes"] ?? "", publish_when_approved: flags["publish-when-approved"] === true, ...(flags["match-update-mode"] !== undefined ? { match_update_mode: flags["match-update-mode"] } : {}), ...(flags["big-update"] === true ? { is_big_update: true } : {})
|
|
1259
|
+
let answer = await api("POST", `/games/${slug}/versions`, { files: list, patch_notes: flags["patch-notes"] ?? "", publish_when_approved: flags["publish-when-approved"] === true, ...(flags["match-update-mode"] !== undefined ? { match_update_mode: flags["match-update-mode"] } : {}), ...(flags["big-update"] === true ? { is_big_update: true } : {}) });
|
|
1263
1260
|
const versionId = answer.version.id;
|
|
1264
1261
|
say(`Version ${versionId} is being scanned. This usually takes under a minute…`);
|
|
1265
1262
|
|
|
@@ -2289,25 +2286,17 @@ async function run({ command, values, flags, globalFlags, rest }) {
|
|
|
2289
2286
|
const { slug, version_id: versionId } = values;
|
|
2290
2287
|
const scheduledPublishAt = flags["scheduled-publish-at"] === undefined ? undefined : checkPublishTime(flags["scheduled-publish-at"]);
|
|
2291
2288
|
const matchUpdateMode = flags["match-update-mode"];
|
|
2292
|
-
const publishBody = { ...(scheduledPublishAt ? { scheduled_publish_at: scheduledPublishAt } : {}), ...(matchUpdateMode !== undefined ? { match_update_mode: matchUpdateMode } : {}), ...(flags["big-update"] === true ? { is_big_update: true } : {}), ...(flags["patch-notes"] !== undefined ? { patch_notes: flags["patch-notes"] } : {})
|
|
2289
|
+
const publishBody = { ...(scheduledPublishAt ? { scheduled_publish_at: scheduledPublishAt } : {}), ...(matchUpdateMode !== undefined ? { match_update_mode: matchUpdateMode } : {}), ...(flags["big-update"] === true ? { is_big_update: true } : {}), ...(flags["patch-notes"] !== undefined ? { patch_notes: flags["patch-notes"] } : {}) };
|
|
2293
2290
|
const answer = await api("POST", `/games/${slug}/versions/${versionId}/publish`, Object.keys(publishBody).length ? publishBody : undefined);
|
|
2294
2291
|
if (isJson) return printAnswer(answer);
|
|
2295
2292
|
const { game, version } = answer;
|
|
2296
2293
|
if (scheduledPublishAt) console.log(`Version ${versionId} will go live at ${when(version.scheduled_publish_at)}${version.scan_status === "scanning" ? ", if it has passed the scan by then" : ""}.`);
|
|
2297
|
-
else
|
|
2298
|
-
console.log(`Version ${versionId}
|
|
2299
|
-
} else {
|
|
2300
|
-
console.log(`Version ${versionId} is live at ${game.page_url}${matchUpdateMode === "now" ? "; running matches switch to it within seconds" : ""}${version.usual_ai_review_duration_min === null ? "" : `, with its AI review pending (usually about ${version.usual_ai_review_duration_min} minutes)`}`);
|
|
2294
|
+
else {
|
|
2295
|
+
console.log(`Version ${versionId} is live at ${game.page_url}${matchUpdateMode === "now" ? "; running matches switch to it within seconds" : ""}`);
|
|
2301
2296
|
if (game.visibility === "draft") console.log(`The game is still a draft, so only you can see it. Show it to everyone with: zaisma visibility ${slug} listed`);
|
|
2302
2297
|
}
|
|
2303
2298
|
return EXIT_CODES.done;
|
|
2304
2299
|
}
|
|
2305
|
-
if (command === "ai-review") {
|
|
2306
|
-
const answer = await api("POST", `/games/${values.slug}/versions/${values.version_id}/ai-review`);
|
|
2307
|
-
if (isJson) return printAnswer(answer);
|
|
2308
|
-
console.log(answer.version.usual_ai_review_duration_min === null ? `Version ${values.version_id}'s AI review has ended: ${answer.version.ai_review_status}.` : `Version ${values.version_id}'s AI review is on its way. It usually takes about ${answer.version.usual_ai_review_duration_min} minutes.`);
|
|
2309
|
-
return EXIT_CODES.done;
|
|
2310
|
-
}
|
|
2311
2300
|
if (command === "unschedule") {
|
|
2312
2301
|
const answer = await api("DELETE", `/games/${values.slug}/versions/${values.version_id}/publish`);
|
|
2313
2302
|
if (isJson) return printAnswer(answer);
|