@pmate/cli 0.42.6 → 0.43.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/README.md +22 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.js +309 -393
- package/dist/templates/electron/automatic-updates.cjs +83 -0
- package/dist/templates/electron/main.cjs +3 -2
- package/dist/templates/electron/preload.cjs +6 -1
- package/dist/templates/electron/updates.cjs +31 -3
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -18289,7 +18289,7 @@ async function uploadDesktopArtifacts(directory, app, version, platform, arch) {
|
|
|
18289
18289
|
const bucket2 = "parrot-static";
|
|
18290
18290
|
const prefix = `desktop/${segments.join("/")}/`;
|
|
18291
18291
|
const url = (key) => `https://parrot-static.pmate.chat/${key.split("/").map(encodeURIComponent).join("/")}`;
|
|
18292
|
-
const artifacts = (0, import_node_fs20.readdirSync)(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && (platform === "mac" ?
|
|
18292
|
+
const artifacts = (0, import_node_fs20.readdirSync)(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && (platform === "mac" ? /(?:\.(dmg|zip|blockmap)$|^latest-mac\.yml$)/i : /(?:\.(exe|zip|blockmap)$|^latest\.yml$)/i).test(entry.name)).sort((a, b) => a.name.localeCompare(b.name)).map((entry) => {
|
|
18293
18293
|
const bytes = (0, import_node_fs20.readFileSync)(import_node_path25.default.join(directory, entry.name));
|
|
18294
18294
|
const objectKey = prefix + entry.name;
|
|
18295
18295
|
return { name: entry.name, objectKey, downloadUrl: url(objectKey), sha256: (0, import_node_crypto4.createHash)("sha256").update(bytes).digest("hex"), size: bytes.length };
|
|
@@ -18430,7 +18430,7 @@ async function buildDesktop(args) {
|
|
|
18430
18430
|
const templateDir = import_node_path26.default.join(__dirname, "templates", "electron");
|
|
18431
18431
|
(0, import_node_fs21.cpSync)(templateDir, appDir, { recursive: true });
|
|
18432
18432
|
(0, import_node_fs21.writeFileSync)(import_node_path26.default.join(appDir, "desktop-config.json"), JSON.stringify({ app: c.app, productName: c.productName, origin: c.origin, authOrigins: c.authOrigins, externalOrigins: c.externalOrigins ?? [], bundleId: c.bundleId }));
|
|
18433
|
-
(0, import_node_fs21.writeFileSync)(import_node_path26.default.join(appDir, "package.json"), JSON.stringify({ name: c.bundleId.replace(/\./g, "-"), version: c.version, description: `${c.productName} desktop application`, author: "PMate", main: "main.cjs", dependencies: { "@pmate/chat-sdk": "0.11.7" } }));
|
|
18433
|
+
(0, import_node_fs21.writeFileSync)(import_node_path26.default.join(appDir, "package.json"), JSON.stringify({ name: c.bundleId.replace(/\./g, "-"), version: c.version, description: `${c.productName} desktop application`, author: "PMate", main: "main.cjs", dependencies: { "@pmate/chat-sdk": "0.11.7", "electron-updater": "6.8.3" } }));
|
|
18434
18434
|
await runBuildCommand(["npm", "install", "--omit=dev", "--no-audit", "--no-fund"], appDir);
|
|
18435
18435
|
const cache = import_node_path26.default.join((0, import_node_os10.homedir)(), ".cache", "pmate", "electron", `${ELECTRON_VERSION}-${BUILDER_VERSION}`);
|
|
18436
18436
|
(0, import_node_fs21.mkdirSync)(cache, { recursive: true });
|
|
@@ -22667,86 +22667,39 @@ var VercelCommandHandler = class {
|
|
|
22667
22667
|
init_sessionStore();
|
|
22668
22668
|
var RoleCommandHandler = class {
|
|
22669
22669
|
async handle(args) {
|
|
22670
|
-
const token =
|
|
22671
|
-
const
|
|
22672
|
-
|
|
22673
|
-
|
|
22674
|
-
|
|
22675
|
-
|
|
22676
|
-
|
|
22677
|
-
|
|
22678
|
-
|
|
22679
|
-
|
|
22680
|
-
|
|
22681
|
-
|
|
22682
|
-
|
|
22683
|
-
|
|
22684
|
-
|
|
22685
|
-
|
|
22686
|
-
|
|
22687
|
-
|
|
22688
|
-
|
|
22689
|
-
|
|
22690
|
-
|
|
22691
|
-
|
|
22692
|
-
|
|
22693
|
-
|
|
22694
|
-
|
|
22695
|
-
|
|
22696
|
-
|
|
22697
|
-
|
|
22698
|
-
|
|
22699
|
-
|
|
22700
|
-
|
|
22701
|
-
|
|
22702
|
-
|
|
22703
|
-
}
|
|
22704
|
-
readToken() {
|
|
22705
|
-
return readRequiredSession({
|
|
22706
|
-
preferredApp: DEFAULT_APP_ID
|
|
22707
|
-
}).token;
|
|
22708
|
-
}
|
|
22709
|
-
async request(baseUrl2, token, method, pathname, body) {
|
|
22710
|
-
const response = await fetch(`${baseUrl2}${pathname}`, {
|
|
22711
|
-
method,
|
|
22712
|
-
headers: {
|
|
22713
|
-
Authorization: `Bearer ${token}`,
|
|
22714
|
-
"Content-Type": "application/json"
|
|
22715
|
-
},
|
|
22716
|
-
...body !== void 0 ? { body: JSON.stringify(body) } : {}
|
|
22717
|
-
});
|
|
22718
|
-
let payload = null;
|
|
22719
|
-
try {
|
|
22720
|
-
payload = await response.json();
|
|
22721
|
-
} catch {
|
|
22722
|
-
payload = null;
|
|
22723
|
-
}
|
|
22724
|
-
if (!response.ok || !payload?.success) {
|
|
22725
|
-
throw new Error(payload?.message || `Request failed with status ${response.status}`);
|
|
22726
|
-
}
|
|
22727
|
-
return payload.data;
|
|
22728
|
-
}
|
|
22729
|
-
renderList(items, asJson) {
|
|
22730
|
-
if (asJson) {
|
|
22731
|
-
ui.plain(JSON.stringify(items, null, 2));
|
|
22732
|
-
return;
|
|
22733
|
-
}
|
|
22734
|
-
if (items.length === 0) {
|
|
22735
|
-
ui.warn("No role definitions found.");
|
|
22736
|
-
return;
|
|
22737
|
-
}
|
|
22738
|
-
for (const item of items) {
|
|
22739
|
-
ui.info(item.role, {
|
|
22740
|
-
builtin: item.builtin,
|
|
22741
|
-
status: item.status
|
|
22742
|
-
});
|
|
22743
|
-
}
|
|
22744
|
-
}
|
|
22745
|
-
renderJson(value, asJson) {
|
|
22746
|
-
if (!asJson) {
|
|
22747
|
-
return;
|
|
22748
|
-
}
|
|
22749
|
-
ui.plain(JSON.stringify(value, null, 2));
|
|
22670
|
+
const token = readRequiredSession({ preferredApp: DEFAULT_APP_ID }).token;
|
|
22671
|
+
const base = (args.baseUrl || process.env.PMATE_AUTH_API_BASE_URL || process.env.AUTH_API_BASE_URL || "https://auth-api-v2.pmate.chat").replace(/\/+$/, "");
|
|
22672
|
+
const request2 = async (method, path36, body) => {
|
|
22673
|
+
const response = await fetch(base + path36, { method, redirect: "error", signal: AbortSignal.timeout(3e4), headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" }, ...body === void 0 ? {} : { body: JSON.stringify(body) } });
|
|
22674
|
+
const payload = await response.json().catch(() => null);
|
|
22675
|
+
if (!response.ok || !payload?.success) throw new Error(payload?.message || `Request failed with status ${response.status}`);
|
|
22676
|
+
return payload.data;
|
|
22677
|
+
};
|
|
22678
|
+
const scope = args.scope === "platform" ? { type: "platform" } : { type: "namespace", namespace: args.namespace };
|
|
22679
|
+
let result;
|
|
22680
|
+
if (args.resource === "migration") result = await request2("POST", "/authorization/migrate", { dryRun: args.action !== "apply" });
|
|
22681
|
+
else if (args.resource === "check") result = await request2("POST", "/authz/permission", { permission: args.permission, scope, ...args.account ? { account: args.account } : {} });
|
|
22682
|
+
else if (args.action === "list") {
|
|
22683
|
+
const data = await request2("GET", "/authorization");
|
|
22684
|
+
const key = { definition: "definitions", permission: "permissions", grant: "rolePermissions", binding: "bindings" }[args.resource];
|
|
22685
|
+
result = data[key].filter((row) => (!args.role || (row.roleId ?? row.id) === args.role) && (!args.account || row.account === args.account) && (!args.namespace || row.namespace === args.namespace || row.scope?.namespace === args.namespace));
|
|
22686
|
+
} else if (args.resource === "definition" || args.resource === "permission") {
|
|
22687
|
+
let existing;
|
|
22688
|
+
const id = args.resource === "definition" ? args.role : args.permission;
|
|
22689
|
+
if (args.action === "update") {
|
|
22690
|
+
const inventory = await request2("GET", "/authorization");
|
|
22691
|
+
existing = inventory[args.resource === "definition" ? "definitions" : "permissions"].find((row) => row.id === id);
|
|
22692
|
+
if (!existing) throw new Error(`Not found: ${id}`);
|
|
22693
|
+
}
|
|
22694
|
+
const body = { ...args.resource === "definition" ? { roleId: id } : { id, scopeType: args.scopeType ?? existing?.scopeType }, displayName: args.displayName ?? existing?.displayName ?? id, description: args.description ?? existing?.description ?? id, status: args.status ?? existing?.status ?? "active" };
|
|
22695
|
+
result = await request2(args.action === "update" ? "PUT" : "POST", `/authorization/${args.resource === "definition" ? "roles" : "permissions"}`, body);
|
|
22696
|
+
} else if (args.resource === "binding") result = await request2(args.action === "remove" ? "DELETE" : "POST", "/authorization/bindings", { account: args.account, roleId: args.role });
|
|
22697
|
+
else result = await request2(args.action === "remove" ? "DELETE" : "POST", "/authorization/role-permissions", { roleId: args.role, permission: args.permission, scope });
|
|
22698
|
+
if (args.json) ui.plain(JSON.stringify(result, null, 2));
|
|
22699
|
+
else if (Array.isArray(result)) {
|
|
22700
|
+
if (result.length) console.table(result);
|
|
22701
|
+
else ui.warn("No authorization records found.");
|
|
22702
|
+
} else ui.plain(JSON.stringify(result, null, 2));
|
|
22750
22703
|
}
|
|
22751
22704
|
};
|
|
22752
22705
|
|
|
@@ -23262,7 +23215,7 @@ var AccountCommandHandler = class {
|
|
|
23262
23215
|
return;
|
|
23263
23216
|
}
|
|
23264
23217
|
for (const item of items) {
|
|
23265
|
-
ui.info(`${item.account} ${item.namespace}/${item.role}`, {
|
|
23218
|
+
ui.info(`${item.account} ${item.roleId ?? `${item.namespace}/${item.role}`}`, {
|
|
23266
23219
|
source: item.source
|
|
23267
23220
|
});
|
|
23268
23221
|
}
|
|
@@ -23302,7 +23255,7 @@ var AccountCommandHandler = class {
|
|
|
23302
23255
|
role: profile.role
|
|
23303
23256
|
})),
|
|
23304
23257
|
nickNames: item.nickNames,
|
|
23305
|
-
roles: item.roles.map((role) => `${role.namespace}/${role.role}`)
|
|
23258
|
+
roles: item.roles.map((role) => role.roleId ?? `${role.namespace}/${role.role}`)
|
|
23306
23259
|
});
|
|
23307
23260
|
}
|
|
23308
23261
|
}
|
|
@@ -23333,7 +23286,7 @@ var AccountCommandHandler = class {
|
|
|
23333
23286
|
ui.info(item.account.id, {
|
|
23334
23287
|
mobile: item.account.mobile,
|
|
23335
23288
|
nickNames: item.nickNames,
|
|
23336
|
-
roles: item.roles.map((role) => `${role.namespace}/${role.role}`),
|
|
23289
|
+
roles: item.roles.map((role) => role.roleId ?? `${role.namespace}/${role.role}`),
|
|
23337
23290
|
sources: item.sources
|
|
23338
23291
|
});
|
|
23339
23292
|
}
|
|
@@ -24315,7 +24268,7 @@ function parseAppArgs(tokens) {
|
|
|
24315
24268
|
if (action === "build") throw new Error("app build was removed; register an electron service and use pmate service deploy <ns:service>");
|
|
24316
24269
|
let baseUrl2;
|
|
24317
24270
|
let json = false;
|
|
24318
|
-
const
|
|
24271
|
+
const takeSharedOptions3 = () => {
|
|
24319
24272
|
while (rest.length > 0) {
|
|
24320
24273
|
const token = rest[0];
|
|
24321
24274
|
if (token === "--base-url") {
|
|
@@ -24388,7 +24341,7 @@ function parseAppArgs(tokens) {
|
|
|
24388
24341
|
const id = parseNamespacedRef(rawRef, {
|
|
24389
24342
|
entityLabel: "app ref"
|
|
24390
24343
|
}).fullId;
|
|
24391
|
-
|
|
24344
|
+
takeSharedOptions3();
|
|
24392
24345
|
if (rest.length > 0) {
|
|
24393
24346
|
throw new Error(`Unknown app ${action} option: ${rest[0]}`);
|
|
24394
24347
|
}
|
|
@@ -25651,97 +25604,53 @@ function parseLogsArgs(input) {
|
|
|
25651
25604
|
}
|
|
25652
25605
|
|
|
25653
25606
|
// src/roleCommandParser.ts
|
|
25607
|
+
var rolePattern = /^[a-z0-9][a-z0-9_-]{0,62}(\/[a-z0-9][a-z0-9_-]{0,62})?$/;
|
|
25608
|
+
var permissionPattern = /^[a-z][a-z0-9-]*:[a-z][a-z0-9-]*$/;
|
|
25654
25609
|
function parseRoleArgs(tokens) {
|
|
25655
|
-
const rest = [...tokens];
|
|
25656
|
-
const
|
|
25657
|
-
if (resource
|
|
25658
|
-
|
|
25659
|
-
|
|
25660
|
-
|
|
25661
|
-
|
|
25662
|
-
|
|
25663
|
-
|
|
25664
|
-
|
|
25665
|
-
|
|
25666
|
-
|
|
25667
|
-
|
|
25668
|
-
|
|
25669
|
-
|
|
25670
|
-
|
|
25671
|
-
|
|
25672
|
-
|
|
25673
|
-
|
|
25674
|
-
|
|
25675
|
-
|
|
25676
|
-
|
|
25677
|
-
resource,
|
|
25678
|
-
action,
|
|
25679
|
-
baseUrl: baseUrl2,
|
|
25680
|
-
json
|
|
25681
|
-
};
|
|
25682
|
-
}
|
|
25683
|
-
if (action === "create") {
|
|
25684
|
-
const role = rest.shift();
|
|
25685
|
-
if (!role || role.startsWith("-")) {
|
|
25686
|
-
throw new Error(
|
|
25687
|
-
"Usage: role definition create <role> [--display-name <name>] [--description <text>] [--base-url <url>] [--json]"
|
|
25688
|
-
);
|
|
25689
|
-
}
|
|
25690
|
-
let displayName;
|
|
25691
|
-
let description;
|
|
25692
|
-
while (rest.length > 0) {
|
|
25693
|
-
const token = rest.shift();
|
|
25694
|
-
switch (token) {
|
|
25695
|
-
case "--display-name":
|
|
25696
|
-
displayName = requireValue5(rest, token);
|
|
25697
|
-
break;
|
|
25698
|
-
case "--description":
|
|
25699
|
-
description = requireValue5(rest, token);
|
|
25700
|
-
break;
|
|
25701
|
-
case "--base-url":
|
|
25702
|
-
baseUrl2 = requireValue5(rest, token);
|
|
25703
|
-
break;
|
|
25704
|
-
case "--json":
|
|
25705
|
-
json = true;
|
|
25706
|
-
break;
|
|
25707
|
-
default:
|
|
25708
|
-
throw new Error(`Unknown role create option: ${token}`);
|
|
25709
|
-
}
|
|
25710
|
-
}
|
|
25711
|
-
return {
|
|
25712
|
-
type: "role" /* Role */,
|
|
25713
|
-
resource,
|
|
25714
|
-
action,
|
|
25715
|
-
role,
|
|
25716
|
-
displayName,
|
|
25717
|
-
description,
|
|
25718
|
-
baseUrl: baseUrl2,
|
|
25719
|
-
json
|
|
25720
|
-
};
|
|
25721
|
-
}
|
|
25722
|
-
throw new Error(`Unknown role action: ${action}`);
|
|
25723
|
-
}
|
|
25724
|
-
function takeSharedOptions3(rest, handlers) {
|
|
25725
|
-
while (rest.length > 0) {
|
|
25726
|
-
const token = rest.shift();
|
|
25727
|
-
switch (token) {
|
|
25728
|
-
case "--base-url":
|
|
25729
|
-
handlers.onBaseUrl(requireValue5(rest, token));
|
|
25730
|
-
break;
|
|
25731
|
-
case "--json":
|
|
25732
|
-
handlers.onJson();
|
|
25733
|
-
break;
|
|
25734
|
-
default:
|
|
25735
|
-
throw new Error(`Unknown role option: ${token}`);
|
|
25610
|
+
const rest = [...tokens], resource = rest.shift();
|
|
25611
|
+
const actions = { definition: ["list", "create", "update"], permission: ["list", "create", "update"], grant: ["list", "add", "remove"], binding: ["list", "add", "remove"], migration: ["preview", "apply"], check: ["check"] };
|
|
25612
|
+
if (!actions[resource]) throw new Error("Missing role resource. Use: role definition|permission|grant|binding|migration|check");
|
|
25613
|
+
const action = resource === "check" ? "check" : rest.shift();
|
|
25614
|
+
if (!action) throw new Error("Missing role action");
|
|
25615
|
+
if (!actions[resource].includes(action)) throw new Error(`Unknown role action: ${action}`);
|
|
25616
|
+
const args = { type: "role" /* Role */, resource, action, baseUrl: void 0, json: false };
|
|
25617
|
+
if (["create", "update"].includes(action)) {
|
|
25618
|
+
const id = rest.shift();
|
|
25619
|
+
if (!id || id.startsWith("-")) throw new Error(`Usage: role ${resource} ${action} <${resource === "definition" ? "role" : "permission"}>`);
|
|
25620
|
+
if (resource === "definition") {
|
|
25621
|
+
args.role = id;
|
|
25622
|
+
args.displayName = void 0;
|
|
25623
|
+
args.description = void 0;
|
|
25624
|
+
} else args.permission = id;
|
|
25625
|
+
}
|
|
25626
|
+
const options = { "--role": "role", "--permission": "permission", "--account": "account", "--namespace": "namespace", "--scope": "scope", "--scope-type": "scopeType", "--status": "status", "--display-name": "displayName", "--description": "description", "--base-url": "baseUrl" };
|
|
25627
|
+
while (rest.length) {
|
|
25628
|
+
const flag = rest.shift();
|
|
25629
|
+
if (flag === "--json") {
|
|
25630
|
+
args.json = true;
|
|
25631
|
+
continue;
|
|
25736
25632
|
}
|
|
25737
|
-
|
|
25738
|
-
}
|
|
25739
|
-
|
|
25740
|
-
|
|
25741
|
-
|
|
25742
|
-
|
|
25743
|
-
|
|
25744
|
-
|
|
25633
|
+
const key = options[flag], value = rest.shift();
|
|
25634
|
+
if (!key) throw new Error(`Unknown role option: ${flag}`);
|
|
25635
|
+
if (!value || value.startsWith("--")) throw new Error(`Missing value for ${flag}`);
|
|
25636
|
+
if (args[key] !== void 0) throw new Error(`Duplicate role option: ${flag}`);
|
|
25637
|
+
Object.assign(args, { [key]: value });
|
|
25638
|
+
}
|
|
25639
|
+
if (args.role && !rolePattern.test(args.role)) throw new Error("Invalid role reference: use admin or blue/admin");
|
|
25640
|
+
if (args.permission && !permissionPattern.test(args.permission)) throw new Error("Invalid permission: use app:create");
|
|
25641
|
+
if (args.scopeType && !["platform", "namespace"].includes(args.scopeType)) throw new Error("Invalid --scope-type");
|
|
25642
|
+
if (args.scope && args.scope !== "platform") throw new Error("Use --scope platform or --namespace <name>");
|
|
25643
|
+
if (args.status && !["active", "disabled"].includes(args.status)) throw new Error("Invalid --status");
|
|
25644
|
+
if (args.namespace && !/^(\*|[a-z0-9][a-z0-9_-]{0,62})$/.test(args.namespace)) throw new Error("Invalid namespace");
|
|
25645
|
+
if (args.scope && args.namespace) throw new Error("Choose --scope platform or --namespace, not both");
|
|
25646
|
+
if (resource === "permission" && action === "create" && !args.scopeType) throw new Error("Permission creation requires --scope-type platform|namespace");
|
|
25647
|
+
if (["add", "remove"].includes(action) && !args.role) throw new Error("Missing --role");
|
|
25648
|
+
if (resource === "binding" && ["add", "remove"].includes(action) && !args.account) throw new Error("Missing --account");
|
|
25649
|
+
if (resource === "grant" && action !== "list" || resource === "check") {
|
|
25650
|
+
if (!args.permission || !args.scope && !args.namespace) throw new Error("Requires --permission and --scope platform or --namespace <name>");
|
|
25651
|
+
if (resource === "check" && args.namespace === "*") throw new Error("Permission checks require a concrete namespace");
|
|
25652
|
+
}
|
|
25653
|
+
return args;
|
|
25745
25654
|
}
|
|
25746
25655
|
|
|
25747
25656
|
// src/accountCommandParser.ts
|
|
@@ -25763,20 +25672,20 @@ function parseAccountArgs(tokens) {
|
|
|
25763
25672
|
const token = rest.shift();
|
|
25764
25673
|
switch (token) {
|
|
25765
25674
|
case "--mobile":
|
|
25766
|
-
mobile =
|
|
25675
|
+
mobile = requireValue5(rest, token);
|
|
25767
25676
|
break;
|
|
25768
25677
|
case "--nickname":
|
|
25769
25678
|
case "--nickName":
|
|
25770
|
-
nickName =
|
|
25679
|
+
nickName = requireValue5(rest, token);
|
|
25771
25680
|
break;
|
|
25772
25681
|
case "--page":
|
|
25773
|
-
page = parsePositiveInt(
|
|
25682
|
+
page = parsePositiveInt(requireValue5(rest, token), token);
|
|
25774
25683
|
break;
|
|
25775
25684
|
case "--page-size":
|
|
25776
|
-
pageSize = parsePositiveInt(
|
|
25685
|
+
pageSize = parsePositiveInt(requireValue5(rest, token), token);
|
|
25777
25686
|
break;
|
|
25778
25687
|
case "--base-url":
|
|
25779
|
-
baseUrl3 =
|
|
25688
|
+
baseUrl3 = requireValue5(rest, token);
|
|
25780
25689
|
break;
|
|
25781
25690
|
case "--json":
|
|
25782
25691
|
json2 = true;
|
|
@@ -25802,7 +25711,7 @@ function parseAccountArgs(tokens) {
|
|
|
25802
25711
|
};
|
|
25803
25712
|
}
|
|
25804
25713
|
if (action === "app-users") {
|
|
25805
|
-
const app = parseNamespacedRef(
|
|
25714
|
+
const app = parseNamespacedRef(requireValue5(rest, "app-users"), {
|
|
25806
25715
|
entityLabel: "app ref"
|
|
25807
25716
|
}).fullId;
|
|
25808
25717
|
let page;
|
|
@@ -25813,13 +25722,13 @@ function parseAccountArgs(tokens) {
|
|
|
25813
25722
|
const token = rest.shift();
|
|
25814
25723
|
switch (token) {
|
|
25815
25724
|
case "--page":
|
|
25816
|
-
page = parsePositiveInt(
|
|
25725
|
+
page = parsePositiveInt(requireValue5(rest, token), token);
|
|
25817
25726
|
break;
|
|
25818
25727
|
case "--page-size":
|
|
25819
|
-
pageSize = parsePositiveInt(
|
|
25728
|
+
pageSize = parsePositiveInt(requireValue5(rest, token), token);
|
|
25820
25729
|
break;
|
|
25821
25730
|
case "--base-url":
|
|
25822
|
-
baseUrl3 =
|
|
25731
|
+
baseUrl3 = requireValue5(rest, token);
|
|
25823
25732
|
break;
|
|
25824
25733
|
case "--json":
|
|
25825
25734
|
json2 = true;
|
|
@@ -25850,17 +25759,17 @@ function parseAccountArgs(tokens) {
|
|
|
25850
25759
|
case void 0:
|
|
25851
25760
|
break;
|
|
25852
25761
|
case "--account":
|
|
25853
|
-
account2 =
|
|
25762
|
+
account2 = requireValue5(rest, token);
|
|
25854
25763
|
break;
|
|
25855
25764
|
case "--mobile":
|
|
25856
|
-
mobile =
|
|
25765
|
+
mobile = requireValue5(rest, token);
|
|
25857
25766
|
break;
|
|
25858
25767
|
case "--nickname":
|
|
25859
25768
|
case "--nickName":
|
|
25860
|
-
nickName =
|
|
25769
|
+
nickName = requireValue5(rest, token);
|
|
25861
25770
|
break;
|
|
25862
25771
|
case "--base-url":
|
|
25863
|
-
baseUrl3 =
|
|
25772
|
+
baseUrl3 = requireValue5(rest, token);
|
|
25864
25773
|
break;
|
|
25865
25774
|
case "--json":
|
|
25866
25775
|
json2 = true;
|
|
@@ -25904,19 +25813,19 @@ function parseAccountArgs(tokens) {
|
|
|
25904
25813
|
const token = rest.shift();
|
|
25905
25814
|
switch (token) {
|
|
25906
25815
|
case "--account":
|
|
25907
|
-
account2 =
|
|
25816
|
+
account2 = requireValue5(rest, token);
|
|
25908
25817
|
break;
|
|
25909
25818
|
case "--app":
|
|
25910
|
-
app = parseNamespacedRef(
|
|
25819
|
+
app = parseNamespacedRef(requireValue5(rest, token), {
|
|
25911
25820
|
entityLabel: "app ref"
|
|
25912
25821
|
}).fullId;
|
|
25913
25822
|
apps.push(app);
|
|
25914
25823
|
break;
|
|
25915
25824
|
case "--file":
|
|
25916
|
-
filePath =
|
|
25825
|
+
filePath = requireValue5(rest, token);
|
|
25917
25826
|
break;
|
|
25918
25827
|
case "--base-url":
|
|
25919
|
-
baseUrl3 =
|
|
25828
|
+
baseUrl3 = requireValue5(rest, token);
|
|
25920
25829
|
break;
|
|
25921
25830
|
case "--json":
|
|
25922
25831
|
json2 = true;
|
|
@@ -26006,35 +25915,35 @@ function parseAccountArgs(tokens) {
|
|
|
26006
25915
|
const token = rest.shift();
|
|
26007
25916
|
switch (token) {
|
|
26008
25917
|
case "--app":
|
|
26009
|
-
app = parseNamespacedRef(
|
|
25918
|
+
app = parseNamespacedRef(requireValue5(rest, token), {
|
|
26010
25919
|
entityLabel: "app ref"
|
|
26011
25920
|
}).fullId;
|
|
26012
25921
|
break;
|
|
26013
25922
|
case "--name":
|
|
26014
|
-
name =
|
|
25923
|
+
name = requireValue5(rest, token);
|
|
26015
25924
|
break;
|
|
26016
25925
|
case "--out":
|
|
26017
|
-
out =
|
|
25926
|
+
out = requireValue5(rest, token);
|
|
26018
25927
|
break;
|
|
26019
25928
|
case "--key-file":
|
|
26020
|
-
keyFile =
|
|
25929
|
+
keyFile = requireValue5(rest, token);
|
|
26021
25930
|
break;
|
|
26022
25931
|
case "--public-key":
|
|
26023
|
-
publicKey =
|
|
25932
|
+
publicKey = requireValue5(rest, token);
|
|
26024
25933
|
break;
|
|
26025
25934
|
case "--private-key":
|
|
26026
|
-
privateKey =
|
|
25935
|
+
privateKey = requireValue5(rest, token);
|
|
26027
25936
|
break;
|
|
26028
25937
|
case "--new-name":
|
|
26029
25938
|
case "--newName":
|
|
26030
|
-
newName =
|
|
25939
|
+
newName = requireValue5(rest, token);
|
|
26031
25940
|
break;
|
|
26032
25941
|
case "--nickname":
|
|
26033
25942
|
case "--nickName":
|
|
26034
|
-
nickName =
|
|
25943
|
+
nickName = requireValue5(rest, token);
|
|
26035
25944
|
break;
|
|
26036
25945
|
case "--role": {
|
|
26037
|
-
const value =
|
|
25946
|
+
const value = requireValue5(rest, token);
|
|
26038
25947
|
if (value !== "practitioner" && value !== "mate") {
|
|
26039
25948
|
throw new Error("--role must be practitioner or mate");
|
|
26040
25949
|
}
|
|
@@ -26042,7 +25951,7 @@ function parseAccountArgs(tokens) {
|
|
|
26042
25951
|
break;
|
|
26043
25952
|
}
|
|
26044
25953
|
case "--base-url":
|
|
26045
|
-
baseUrl3 =
|
|
25954
|
+
baseUrl3 = requireValue5(rest, token);
|
|
26046
25955
|
break;
|
|
26047
25956
|
case "--json":
|
|
26048
25957
|
json2 = true;
|
|
@@ -26127,36 +26036,36 @@ function parseAccountArgs(tokens) {
|
|
|
26127
26036
|
const token = rest.shift();
|
|
26128
26037
|
switch (token) {
|
|
26129
26038
|
case "--app":
|
|
26130
|
-
app = parseNamespacedRef(
|
|
26039
|
+
app = parseNamespacedRef(requireValue5(rest, token), {
|
|
26131
26040
|
entityLabel: "app ref"
|
|
26132
26041
|
}).fullId;
|
|
26133
26042
|
break;
|
|
26134
26043
|
case "--name":
|
|
26135
|
-
name =
|
|
26044
|
+
name = requireValue5(rest, token);
|
|
26136
26045
|
break;
|
|
26137
26046
|
case "--namespace":
|
|
26138
|
-
namespace2 =
|
|
26047
|
+
namespace2 = requireValue5(rest, token);
|
|
26139
26048
|
break;
|
|
26140
26049
|
case "--expires-at":
|
|
26141
|
-
expiresAt =
|
|
26050
|
+
expiresAt = requireValue5(rest, token);
|
|
26142
26051
|
break;
|
|
26143
26052
|
case "--expires-in":
|
|
26144
|
-
expiresAt = parseExpiresIn(
|
|
26053
|
+
expiresAt = parseExpiresIn(requireValue5(rest, token));
|
|
26145
26054
|
break;
|
|
26146
26055
|
case "--grace-period":
|
|
26147
|
-
gracePeriodSeconds = parseDurationSeconds(
|
|
26056
|
+
gracePeriodSeconds = parseDurationSeconds(requireValue5(rest, token), token);
|
|
26148
26057
|
break;
|
|
26149
26058
|
case "--out":
|
|
26150
|
-
out =
|
|
26059
|
+
out = requireValue5(rest, token);
|
|
26151
26060
|
break;
|
|
26152
26061
|
case "--key":
|
|
26153
|
-
key =
|
|
26062
|
+
key = requireValue5(rest, token);
|
|
26154
26063
|
break;
|
|
26155
26064
|
case "--key-file":
|
|
26156
|
-
keyFile =
|
|
26065
|
+
keyFile = requireValue5(rest, token);
|
|
26157
26066
|
break;
|
|
26158
26067
|
case "--base-url":
|
|
26159
|
-
baseUrl3 =
|
|
26068
|
+
baseUrl3 = requireValue5(rest, token);
|
|
26160
26069
|
break;
|
|
26161
26070
|
case "--json":
|
|
26162
26071
|
json2 = true;
|
|
@@ -26217,16 +26126,16 @@ function parseAccountArgs(tokens) {
|
|
|
26217
26126
|
const token = rest.shift();
|
|
26218
26127
|
switch (token) {
|
|
26219
26128
|
case "--account":
|
|
26220
|
-
account =
|
|
26129
|
+
account = requireValue5(rest, token);
|
|
26221
26130
|
break;
|
|
26222
26131
|
case "--namespace":
|
|
26223
|
-
namespace =
|
|
26132
|
+
namespace = requireValue5(rest, token);
|
|
26224
26133
|
break;
|
|
26225
26134
|
case "--role":
|
|
26226
|
-
role =
|
|
26135
|
+
role = requireValue5(rest, token);
|
|
26227
26136
|
break;
|
|
26228
26137
|
case "--base-url":
|
|
26229
|
-
baseUrl2 =
|
|
26138
|
+
baseUrl2 = requireValue5(rest, token);
|
|
26230
26139
|
break;
|
|
26231
26140
|
case "--json":
|
|
26232
26141
|
json = true;
|
|
@@ -26268,7 +26177,7 @@ function parseAccountArgs(tokens) {
|
|
|
26268
26177
|
}
|
|
26269
26178
|
throw new Error(`Unknown account role action: ${roleAction}`);
|
|
26270
26179
|
}
|
|
26271
|
-
function
|
|
26180
|
+
function requireValue5(tokens, optionName) {
|
|
26272
26181
|
const value = tokens.shift();
|
|
26273
26182
|
if (!value || value.startsWith("-")) {
|
|
26274
26183
|
throw new Error(`Missing value for ${optionName}`);
|
|
@@ -26309,12 +26218,12 @@ function parseOrgArgs(tokens) {
|
|
|
26309
26218
|
}
|
|
26310
26219
|
let baseUrl2;
|
|
26311
26220
|
let json = false;
|
|
26312
|
-
const
|
|
26221
|
+
const takeSharedOptions3 = () => {
|
|
26313
26222
|
while (rest.length > 0) {
|
|
26314
26223
|
const token = rest[0];
|
|
26315
26224
|
if (token === "--base-url") {
|
|
26316
26225
|
rest.shift();
|
|
26317
|
-
baseUrl2 =
|
|
26226
|
+
baseUrl2 = requireValue6(rest, token);
|
|
26318
26227
|
continue;
|
|
26319
26228
|
}
|
|
26320
26229
|
if (token === "--json") {
|
|
@@ -26326,7 +26235,7 @@ function parseOrgArgs(tokens) {
|
|
|
26326
26235
|
}
|
|
26327
26236
|
};
|
|
26328
26237
|
if (action === "list") {
|
|
26329
|
-
|
|
26238
|
+
takeSharedOptions3();
|
|
26330
26239
|
if (rest.length > 0) {
|
|
26331
26240
|
throw new Error(`Unknown org list option: ${rest[0]}`);
|
|
26332
26241
|
}
|
|
@@ -26334,7 +26243,7 @@ function parseOrgArgs(tokens) {
|
|
|
26334
26243
|
}
|
|
26335
26244
|
if (action === "get" || action === "view" || action === "disable") {
|
|
26336
26245
|
const orgId = parseRequiredOrgRef(rest.shift(), action);
|
|
26337
|
-
|
|
26246
|
+
takeSharedOptions3();
|
|
26338
26247
|
if (rest.length > 0) {
|
|
26339
26248
|
throw new Error(`Unknown org ${action} option: ${rest[0]}`);
|
|
26340
26249
|
}
|
|
@@ -26348,13 +26257,13 @@ function parseOrgArgs(tokens) {
|
|
|
26348
26257
|
const token = rest.shift();
|
|
26349
26258
|
switch (token) {
|
|
26350
26259
|
case "--display-name":
|
|
26351
|
-
displayName =
|
|
26260
|
+
displayName = requireValue6(rest, token);
|
|
26352
26261
|
break;
|
|
26353
26262
|
case "--member":
|
|
26354
|
-
members.push(
|
|
26263
|
+
members.push(requireValue6(rest, token));
|
|
26355
26264
|
break;
|
|
26356
26265
|
case "--base-url":
|
|
26357
|
-
baseUrl2 =
|
|
26266
|
+
baseUrl2 = requireValue6(rest, token);
|
|
26358
26267
|
break;
|
|
26359
26268
|
case "--json":
|
|
26360
26269
|
json = true;
|
|
@@ -26385,10 +26294,10 @@ function parseOrgArgs(tokens) {
|
|
|
26385
26294
|
const token = rest.shift();
|
|
26386
26295
|
switch (token) {
|
|
26387
26296
|
case "--display-name":
|
|
26388
|
-
displayName =
|
|
26297
|
+
displayName = requireValue6(rest, token);
|
|
26389
26298
|
break;
|
|
26390
26299
|
case "--base-url":
|
|
26391
|
-
baseUrl2 =
|
|
26300
|
+
baseUrl2 = requireValue6(rest, token);
|
|
26392
26301
|
break;
|
|
26393
26302
|
case "--json":
|
|
26394
26303
|
json = true;
|
|
@@ -26431,16 +26340,16 @@ function parseOrgArgs(tokens) {
|
|
|
26431
26340
|
const token = memberTokens.shift();
|
|
26432
26341
|
switch (token) {
|
|
26433
26342
|
case "--account": {
|
|
26434
|
-
const value =
|
|
26343
|
+
const value = requireValue6(memberTokens, token);
|
|
26435
26344
|
account = value;
|
|
26436
26345
|
accounts.push(value);
|
|
26437
26346
|
break;
|
|
26438
26347
|
}
|
|
26439
26348
|
case "--file":
|
|
26440
|
-
filePath =
|
|
26349
|
+
filePath = requireValue6(memberTokens, token);
|
|
26441
26350
|
break;
|
|
26442
26351
|
case "--base-url":
|
|
26443
|
-
baseUrl2 =
|
|
26352
|
+
baseUrl2 = requireValue6(memberTokens, token);
|
|
26444
26353
|
break;
|
|
26445
26354
|
case "--json":
|
|
26446
26355
|
json = true;
|
|
@@ -26500,7 +26409,7 @@ function parseOrgArgs(tokens) {
|
|
|
26500
26409
|
const token = visibleTokens.shift();
|
|
26501
26410
|
switch (token) {
|
|
26502
26411
|
case "--app": {
|
|
26503
|
-
const value = parseNamespacedRef(
|
|
26412
|
+
const value = parseNamespacedRef(requireValue6(visibleTokens, token), {
|
|
26504
26413
|
entityLabel: "app ref"
|
|
26505
26414
|
}).fullId;
|
|
26506
26415
|
app = value;
|
|
@@ -26508,10 +26417,10 @@ function parseOrgArgs(tokens) {
|
|
|
26508
26417
|
break;
|
|
26509
26418
|
}
|
|
26510
26419
|
case "--file":
|
|
26511
|
-
filePath =
|
|
26420
|
+
filePath = requireValue6(visibleTokens, token);
|
|
26512
26421
|
break;
|
|
26513
26422
|
case "--base-url":
|
|
26514
|
-
baseUrl2 =
|
|
26423
|
+
baseUrl2 = requireValue6(visibleTokens, token);
|
|
26515
26424
|
break;
|
|
26516
26425
|
case "--json":
|
|
26517
26426
|
json = true;
|
|
@@ -26565,7 +26474,7 @@ function parseRequiredOrgRef(value, action) {
|
|
|
26565
26474
|
entityLabel: "org ref"
|
|
26566
26475
|
}).fullId;
|
|
26567
26476
|
}
|
|
26568
|
-
function
|
|
26477
|
+
function requireValue6(tokens, optionName) {
|
|
26569
26478
|
const value = tokens.shift();
|
|
26570
26479
|
if (!value || value.startsWith("-")) {
|
|
26571
26480
|
throw new Error(`Missing value for ${optionName}`);
|
|
@@ -26586,11 +26495,11 @@ function parseHostArgs(tokens) {
|
|
|
26586
26495
|
if (envAction === "list") action = "env-list";
|
|
26587
26496
|
else if (envAction === "set") {
|
|
26588
26497
|
action = "env-set";
|
|
26589
|
-
key =
|
|
26590
|
-
value =
|
|
26498
|
+
key = requireValue7(rest, "key");
|
|
26499
|
+
value = requireValue7(rest, "value");
|
|
26591
26500
|
} else if (envAction === "unset") {
|
|
26592
26501
|
action = "env-unset";
|
|
26593
|
-
key =
|
|
26502
|
+
key = requireValue7(rest, "key");
|
|
26594
26503
|
} else throw new Error("Usage: host env list|set|unset ... | host apply");
|
|
26595
26504
|
} else throw new Error("Usage: host env list|set|unset ... | host apply");
|
|
26596
26505
|
let host;
|
|
@@ -26599,16 +26508,16 @@ function parseHostArgs(tokens) {
|
|
|
26599
26508
|
let json = false;
|
|
26600
26509
|
while (rest.length > 0) {
|
|
26601
26510
|
const token = rest.shift();
|
|
26602
|
-
if (token === "--host") host =
|
|
26511
|
+
if (token === "--host") host = requireValue7(rest, token);
|
|
26603
26512
|
else if (token === "--secret") secret = true;
|
|
26604
|
-
else if (token === "--base-url") baseUrl2 =
|
|
26513
|
+
else if (token === "--base-url") baseUrl2 = requireValue7(rest, token);
|
|
26605
26514
|
else if (token === "--json") json = true;
|
|
26606
26515
|
else throw new Error(`Unknown host option: ${token}`);
|
|
26607
26516
|
}
|
|
26608
26517
|
if (secret && action !== "env-set") throw new Error("--secret is only valid for host env set");
|
|
26609
26518
|
return { type: "host" /* Host */, action, host, key, value, secret, baseUrl: baseUrl2, json };
|
|
26610
26519
|
}
|
|
26611
|
-
function
|
|
26520
|
+
function requireValue7(tokens, label) {
|
|
26612
26521
|
const value = tokens.shift();
|
|
26613
26522
|
if (!value || value.startsWith("--")) throw new Error(`Missing value for ${label}`);
|
|
26614
26523
|
return value;
|
|
@@ -26633,7 +26542,7 @@ function parseCollectArgs(tokens) {
|
|
|
26633
26542
|
const token = rest.shift();
|
|
26634
26543
|
switch (token) {
|
|
26635
26544
|
case "--source": {
|
|
26636
|
-
const value =
|
|
26545
|
+
const value = requireValue8(rest, token);
|
|
26637
26546
|
if (value !== "cc" && value !== "yelling") {
|
|
26638
26547
|
throw new Error(`Unsupported collect source: ${value}`);
|
|
26639
26548
|
}
|
|
@@ -26641,11 +26550,11 @@ function parseCollectArgs(tokens) {
|
|
|
26641
26550
|
break;
|
|
26642
26551
|
}
|
|
26643
26552
|
case "--endpoint":
|
|
26644
|
-
options.endpoint =
|
|
26553
|
+
options.endpoint = requireValue8(rest, token);
|
|
26645
26554
|
break;
|
|
26646
26555
|
case "--thread":
|
|
26647
26556
|
case "--channel":
|
|
26648
|
-
options.thread =
|
|
26557
|
+
options.thread = requireValue8(rest, token);
|
|
26649
26558
|
break;
|
|
26650
26559
|
default:
|
|
26651
26560
|
throw new Error(`Unknown collect option: ${token}`);
|
|
@@ -26661,7 +26570,7 @@ function parseCollectArgs(tokens) {
|
|
|
26661
26570
|
}
|
|
26662
26571
|
return { type: "collect" /* Collect */, ...options };
|
|
26663
26572
|
}
|
|
26664
|
-
function
|
|
26573
|
+
function requireValue8(tokens, optionName) {
|
|
26665
26574
|
const value = tokens.shift();
|
|
26666
26575
|
if (!value) {
|
|
26667
26576
|
throw new Error(`Missing value for ${optionName}`);
|
|
@@ -26709,22 +26618,22 @@ function parseIm1PendingMentionsArgs(tokens) {
|
|
|
26709
26618
|
const token = rest.shift();
|
|
26710
26619
|
switch (token) {
|
|
26711
26620
|
case "--me":
|
|
26712
|
-
me =
|
|
26621
|
+
me = requireValue9(rest, token);
|
|
26713
26622
|
break;
|
|
26714
26623
|
case "--from":
|
|
26715
|
-
from = parseIsoDate(
|
|
26624
|
+
from = parseIsoDate(requireValue9(rest, token), token);
|
|
26716
26625
|
break;
|
|
26717
26626
|
case "--to":
|
|
26718
|
-
to = parseIsoDate(
|
|
26627
|
+
to = parseIsoDate(requireValue9(rest, token), token);
|
|
26719
26628
|
break;
|
|
26720
26629
|
case "--hours":
|
|
26721
|
-
hours = parsePositiveInt2(
|
|
26630
|
+
hours = parsePositiveInt2(requireValue9(rest, token), token);
|
|
26722
26631
|
break;
|
|
26723
26632
|
case "--context":
|
|
26724
|
-
context = parseBoundedPositiveInt(
|
|
26633
|
+
context = parseBoundedPositiveInt(requireValue9(rest, token), token, 50);
|
|
26725
26634
|
break;
|
|
26726
26635
|
case "--limit":
|
|
26727
|
-
limit = parseBoundedPositiveInt(
|
|
26636
|
+
limit = parseBoundedPositiveInt(requireValue9(rest, token), token, 500);
|
|
26728
26637
|
break;
|
|
26729
26638
|
case "--json":
|
|
26730
26639
|
json = true;
|
|
@@ -26767,13 +26676,13 @@ function parseIm1ThreadsArgs(tokens) {
|
|
|
26767
26676
|
switch (token) {
|
|
26768
26677
|
case "--q":
|
|
26769
26678
|
case "--query":
|
|
26770
|
-
query =
|
|
26679
|
+
query = requireValue9(rest, token);
|
|
26771
26680
|
break;
|
|
26772
26681
|
case "--search":
|
|
26773
|
-
search =
|
|
26682
|
+
search = requireValue9(rest, token);
|
|
26774
26683
|
break;
|
|
26775
26684
|
case "--limit":
|
|
26776
|
-
limit = parsePositiveInt2(
|
|
26685
|
+
limit = parsePositiveInt2(requireValue9(rest, token), token);
|
|
26777
26686
|
break;
|
|
26778
26687
|
case "--json":
|
|
26779
26688
|
json = true;
|
|
@@ -26797,10 +26706,10 @@ function parseIm1MessagesArgs(tokens) {
|
|
|
26797
26706
|
switch (token) {
|
|
26798
26707
|
case "--thread":
|
|
26799
26708
|
case "--channel":
|
|
26800
|
-
thread =
|
|
26709
|
+
thread = requireValue9(rest, token);
|
|
26801
26710
|
break;
|
|
26802
26711
|
case "--limit":
|
|
26803
|
-
limit = parsePositiveInt2(
|
|
26712
|
+
limit = parsePositiveInt2(requireValue9(rest, token), token);
|
|
26804
26713
|
break;
|
|
26805
26714
|
case "--json":
|
|
26806
26715
|
json = true;
|
|
@@ -26827,14 +26736,14 @@ function parseIm1ReplyArgs(tokens) {
|
|
|
26827
26736
|
const token = rest.shift();
|
|
26828
26737
|
switch (token) {
|
|
26829
26738
|
case "--thread":
|
|
26830
|
-
thread =
|
|
26739
|
+
thread = requireValue9(rest, token);
|
|
26831
26740
|
break;
|
|
26832
26741
|
case "--text":
|
|
26833
|
-
text =
|
|
26742
|
+
text = requireValue9(rest, token);
|
|
26834
26743
|
break;
|
|
26835
26744
|
case "--file":
|
|
26836
26745
|
case "--image":
|
|
26837
|
-
file =
|
|
26746
|
+
file = requireValue9(rest, token);
|
|
26838
26747
|
break;
|
|
26839
26748
|
case "--dryrun":
|
|
26840
26749
|
case "--dry-run":
|
|
@@ -26867,13 +26776,13 @@ function parseIm1ReactArgs(tokens) {
|
|
|
26867
26776
|
const token = rest.shift();
|
|
26868
26777
|
switch (token) {
|
|
26869
26778
|
case "--thread":
|
|
26870
|
-
thread =
|
|
26779
|
+
thread = requireValue9(rest, token);
|
|
26871
26780
|
break;
|
|
26872
26781
|
case "--emoji":
|
|
26873
|
-
emoji =
|
|
26782
|
+
emoji = requireValue9(rest, token);
|
|
26874
26783
|
break;
|
|
26875
26784
|
case "--message":
|
|
26876
|
-
message =
|
|
26785
|
+
message = requireValue9(rest, token);
|
|
26877
26786
|
break;
|
|
26878
26787
|
case "--remove":
|
|
26879
26788
|
remove = true;
|
|
@@ -26891,7 +26800,7 @@ function parseIm1ReactArgs(tokens) {
|
|
|
26891
26800
|
}
|
|
26892
26801
|
return { type: "collect" /* Collect */, action: "react", thread, emoji, message, remove, dryRun };
|
|
26893
26802
|
}
|
|
26894
|
-
function
|
|
26803
|
+
function requireValue9(tokens, optionName) {
|
|
26895
26804
|
const value = tokens.shift();
|
|
26896
26805
|
if (!value || value.startsWith("--")) {
|
|
26897
26806
|
throw new Error(`Missing value for ${optionName}`);
|
|
@@ -27015,12 +26924,12 @@ function parseShared(tokens) {
|
|
|
27015
26924
|
case "--title":
|
|
27016
26925
|
case "--bot-a":
|
|
27017
26926
|
case "--bot-b":
|
|
27018
|
-
options.set(token,
|
|
26927
|
+
options.set(token, requireValue10(tokens, token));
|
|
27019
26928
|
break;
|
|
27020
26929
|
case "--member":
|
|
27021
26930
|
case "--recipient": {
|
|
27022
26931
|
const values = multiOptions.get(token) ?? [];
|
|
27023
|
-
values.push(
|
|
26932
|
+
values.push(requireValue10(tokens, token));
|
|
27024
26933
|
multiOptions.set(token, values);
|
|
27025
26934
|
break;
|
|
27026
26935
|
}
|
|
@@ -27046,7 +26955,7 @@ function requiredOption(options, option) {
|
|
|
27046
26955
|
}
|
|
27047
26956
|
return value;
|
|
27048
26957
|
}
|
|
27049
|
-
function
|
|
26958
|
+
function requireValue10(tokens, option) {
|
|
27050
26959
|
const value = tokens.shift();
|
|
27051
26960
|
if (!value || value.startsWith("--")) {
|
|
27052
26961
|
throw new Error(`Missing value for ${option}`);
|
|
@@ -27156,9 +27065,16 @@ var HELP_TEXT = [
|
|
|
27156
27065
|
` ${import_chalk4.default.gray(" list [--chain <chain>] [--base-url <url>] [--json]")}`,
|
|
27157
27066
|
` ${import_chalk4.default.gray(" get <namespace> [--chain <chain>] [--base-url <url>] [--json]")}`,
|
|
27158
27067
|
` ${import_chalk4.default.gray(" create <namespace> [--chain <chain>] [--base-url <url>] [--json]")}`,
|
|
27159
|
-
` ${import_chalk4.default.cyan("role")} Manage
|
|
27068
|
+
` ${import_chalk4.default.cyan("role")} Manage scoped roles and permissions via auth-api`,
|
|
27160
27069
|
` ${import_chalk4.default.gray(" definition list [--base-url <url>] [--json]")}`,
|
|
27161
27070
|
` ${import_chalk4.default.gray(" definition create <role> [--display-name <name>] [--description <text>] [--base-url <url>] [--json]")}`,
|
|
27071
|
+
` ${import_chalk4.default.gray(" definition update <role> [--display-name <name>] [--description <text>] [--status active|disabled]")}`,
|
|
27072
|
+
` ${import_chalk4.default.gray(" permission list|create|update [<action>] [--scope-type platform|namespace] [--status active|disabled]")}`,
|
|
27073
|
+
` ${import_chalk4.default.gray(" grant list|add|remove --role <role> [--permission <action>] [--scope platform | --namespace <ns|*>]")}`,
|
|
27074
|
+
` ${import_chalk4.default.gray(" binding list|add|remove [--account <id>] [--role <role>]")}`,
|
|
27075
|
+
` ${import_chalk4.default.gray(" check --permission <action> (--scope platform | --namespace <ns>) [--account <id>]")}`,
|
|
27076
|
+
` ${import_chalk4.default.gray(" migration preview|apply (root only)")}`,
|
|
27077
|
+
` ${import_chalk4.default.gray(" roles: admin (platform), blue/admin (namespace); shared flags: --base-url <url> --json")}`,
|
|
27162
27078
|
` ${import_chalk4.default.gray(" default base URL: https://auth-api-v2.pmate.chat")}`,
|
|
27163
27079
|
` ${import_chalk4.default.cyan("account")} View accounts and manage account role bindings`,
|
|
27164
27080
|
` ${import_chalk4.default.gray(" list [--page <n>] [--page-size <n>] [--mobile <mobile> | --nickname <nickname>] [--base-url <url>] [--json]")}`,
|
|
@@ -27308,10 +27224,10 @@ function parseCommandArgs(args) {
|
|
|
27308
27224
|
const token = rest.shift();
|
|
27309
27225
|
switch (token) {
|
|
27310
27226
|
case "--app":
|
|
27311
|
-
app =
|
|
27227
|
+
app = requireValue11(rest, token);
|
|
27312
27228
|
break;
|
|
27313
27229
|
case "--profile-id":
|
|
27314
|
-
profileId =
|
|
27230
|
+
profileId = requireValue11(rest, token);
|
|
27315
27231
|
break;
|
|
27316
27232
|
case "--access-key":
|
|
27317
27233
|
if (rest[0] && !rest[0].startsWith("--")) {
|
|
@@ -27321,7 +27237,7 @@ function parseCommandArgs(args) {
|
|
|
27321
27237
|
}
|
|
27322
27238
|
break;
|
|
27323
27239
|
case "--access-key-file":
|
|
27324
|
-
accessKeyFile =
|
|
27240
|
+
accessKeyFile = requireValue11(rest, token);
|
|
27325
27241
|
break;
|
|
27326
27242
|
case "--select-profile":
|
|
27327
27243
|
selectProfile = true;
|
|
@@ -27443,7 +27359,7 @@ function parseVercelArgs(tokens) {
|
|
|
27443
27359
|
const token = rest.shift();
|
|
27444
27360
|
switch (token) {
|
|
27445
27361
|
case "--scope":
|
|
27446
|
-
scope =
|
|
27362
|
+
scope = requireValue11(rest, token);
|
|
27447
27363
|
break;
|
|
27448
27364
|
default:
|
|
27449
27365
|
throw new Error(`Unknown vercel option: ${token}`);
|
|
@@ -27463,10 +27379,10 @@ function parseVercelArgs(tokens) {
|
|
|
27463
27379
|
const token = rest.shift();
|
|
27464
27380
|
switch (token) {
|
|
27465
27381
|
case "--scope":
|
|
27466
|
-
scope =
|
|
27382
|
+
scope = requireValue11(rest, token);
|
|
27467
27383
|
break;
|
|
27468
27384
|
case "--project":
|
|
27469
|
-
project =
|
|
27385
|
+
project = requireValue11(rest, token);
|
|
27470
27386
|
break;
|
|
27471
27387
|
case "--last-week":
|
|
27472
27388
|
lastWeek = true;
|
|
@@ -27497,16 +27413,16 @@ function parseAddDnsArgs(tokens) {
|
|
|
27497
27413
|
const token = rest.shift();
|
|
27498
27414
|
switch (token) {
|
|
27499
27415
|
case "--type":
|
|
27500
|
-
options.dnsType =
|
|
27416
|
+
options.dnsType = requireValue11(rest, token);
|
|
27501
27417
|
break;
|
|
27502
27418
|
case "--value":
|
|
27503
|
-
options.dnsValue =
|
|
27419
|
+
options.dnsValue = requireValue11(rest, token);
|
|
27504
27420
|
break;
|
|
27505
27421
|
case "--rr":
|
|
27506
|
-
options.dnsRr =
|
|
27422
|
+
options.dnsRr = requireValue11(rest, token);
|
|
27507
27423
|
break;
|
|
27508
27424
|
case "--ttl": {
|
|
27509
|
-
const ttlValue =
|
|
27425
|
+
const ttlValue = requireValue11(rest, token);
|
|
27510
27426
|
const ttl = Number.parseInt(ttlValue, 10);
|
|
27511
27427
|
if (!Number.isFinite(ttl) || ttl <= 0) {
|
|
27512
27428
|
throw new Error(`Invalid --ttl value: ${ttlValue}`);
|
|
@@ -27515,7 +27431,7 @@ function parseAddDnsArgs(tokens) {
|
|
|
27515
27431
|
break;
|
|
27516
27432
|
}
|
|
27517
27433
|
case "--domain":
|
|
27518
|
-
options.dnsDomain =
|
|
27434
|
+
options.dnsDomain = requireValue11(rest, token);
|
|
27519
27435
|
break;
|
|
27520
27436
|
default:
|
|
27521
27437
|
throw new Error(`Unknown add-dns option: ${token}`);
|
|
@@ -27548,13 +27464,13 @@ function parseBucketArgs(tokens) {
|
|
|
27548
27464
|
options.bucketCreate = true;
|
|
27549
27465
|
break;
|
|
27550
27466
|
case "--name":
|
|
27551
|
-
options.bucketName =
|
|
27467
|
+
options.bucketName = requireValue11(rest, token);
|
|
27552
27468
|
break;
|
|
27553
27469
|
case "--subdomain":
|
|
27554
|
-
options.bucketSubdomain =
|
|
27470
|
+
options.bucketSubdomain = requireValue11(rest, token);
|
|
27555
27471
|
break;
|
|
27556
27472
|
case "--domain":
|
|
27557
|
-
options.bucketDomain =
|
|
27473
|
+
options.bucketDomain = requireValue11(rest, token);
|
|
27558
27474
|
break;
|
|
27559
27475
|
default:
|
|
27560
27476
|
throw new Error(`Unknown bucket option: ${token}`);
|
|
@@ -27586,7 +27502,7 @@ function parseDevArgs(tokens) {
|
|
|
27586
27502
|
const token = rest.shift();
|
|
27587
27503
|
switch (token) {
|
|
27588
27504
|
case "--cwd":
|
|
27589
|
-
options.devCwd =
|
|
27505
|
+
options.devCwd = requireValue11(rest, token);
|
|
27590
27506
|
break;
|
|
27591
27507
|
default:
|
|
27592
27508
|
throw new Error(`Unknown dev option: ${token}`);
|
|
@@ -27606,7 +27522,7 @@ function parseDeleteArgs(tokens) {
|
|
|
27606
27522
|
const token = rest.shift();
|
|
27607
27523
|
switch (token) {
|
|
27608
27524
|
case "--cwd":
|
|
27609
|
-
deleteCwd =
|
|
27525
|
+
deleteCwd = requireValue11(rest, token);
|
|
27610
27526
|
break;
|
|
27611
27527
|
default:
|
|
27612
27528
|
throw new Error(`Unknown delete option: ${token}`);
|
|
@@ -27640,13 +27556,13 @@ function parseOssArgs(tokens) {
|
|
|
27640
27556
|
const token = rest.shift();
|
|
27641
27557
|
switch (token) {
|
|
27642
27558
|
case "--bucket":
|
|
27643
|
-
bucket2 =
|
|
27559
|
+
bucket2 = requireValue11(rest, token);
|
|
27644
27560
|
break;
|
|
27645
27561
|
case "--file":
|
|
27646
|
-
filePath =
|
|
27562
|
+
filePath = requireValue11(rest, token);
|
|
27647
27563
|
break;
|
|
27648
27564
|
case "--key":
|
|
27649
|
-
objectKey =
|
|
27565
|
+
objectKey = requireValue11(rest, token);
|
|
27650
27566
|
break;
|
|
27651
27567
|
default:
|
|
27652
27568
|
throw new Error(`Unknown oss option: ${token}`);
|
|
@@ -27679,7 +27595,7 @@ function parseEnvArgs(tokens) {
|
|
|
27679
27595
|
throw new Error("Only one env action is allowed.");
|
|
27680
27596
|
}
|
|
27681
27597
|
action = "set";
|
|
27682
|
-
key =
|
|
27598
|
+
key = requireValue11(rest, token);
|
|
27683
27599
|
break;
|
|
27684
27600
|
case "--list":
|
|
27685
27601
|
if (action) {
|
|
@@ -27692,17 +27608,17 @@ function parseEnvArgs(tokens) {
|
|
|
27692
27608
|
throw new Error("Only one env action is allowed.");
|
|
27693
27609
|
}
|
|
27694
27610
|
action = "delete";
|
|
27695
|
-
key =
|
|
27611
|
+
key = requireValue11(rest, token);
|
|
27696
27612
|
break;
|
|
27697
27613
|
case "--value":
|
|
27698
|
-
value =
|
|
27614
|
+
value = requireValue11(rest, token);
|
|
27699
27615
|
break;
|
|
27700
27616
|
case "--verbose":
|
|
27701
27617
|
case "-v":
|
|
27702
27618
|
verbose = true;
|
|
27703
27619
|
break;
|
|
27704
27620
|
case "--cwd":
|
|
27705
|
-
cwd =
|
|
27621
|
+
cwd = requireValue11(rest, token);
|
|
27706
27622
|
break;
|
|
27707
27623
|
default:
|
|
27708
27624
|
throw new Error(`Unknown env option: ${token}`);
|
|
@@ -27737,7 +27653,7 @@ function parseCommitArgs(tokens) {
|
|
|
27737
27653
|
push = true;
|
|
27738
27654
|
break;
|
|
27739
27655
|
case "--cwd":
|
|
27740
|
-
cwd =
|
|
27656
|
+
cwd = requireValue11(rest, token);
|
|
27741
27657
|
break;
|
|
27742
27658
|
default:
|
|
27743
27659
|
throw new Error(`Unknown commit option: ${token}`);
|
|
@@ -27753,10 +27669,10 @@ function parseSummaryArgs(tokens) {
|
|
|
27753
27669
|
const token = rest.shift();
|
|
27754
27670
|
switch (token) {
|
|
27755
27671
|
case "--pr":
|
|
27756
|
-
prRef =
|
|
27672
|
+
prRef = requireValue11(rest, token);
|
|
27757
27673
|
break;
|
|
27758
27674
|
case "--cwd":
|
|
27759
|
-
cwd =
|
|
27675
|
+
cwd = requireValue11(rest, token);
|
|
27760
27676
|
break;
|
|
27761
27677
|
default:
|
|
27762
27678
|
throw new Error(`Unknown summary option: ${token}`);
|
|
@@ -27781,13 +27697,13 @@ function parseQuizArgs(tokens) {
|
|
|
27781
27697
|
const token = rest.shift();
|
|
27782
27698
|
switch (token) {
|
|
27783
27699
|
case "--paper-id":
|
|
27784
|
-
paperId =
|
|
27700
|
+
paperId = requireValue11(rest, token);
|
|
27785
27701
|
break;
|
|
27786
27702
|
case "--base-url":
|
|
27787
|
-
apiBaseUrl =
|
|
27703
|
+
apiBaseUrl = requireValue11(rest, token);
|
|
27788
27704
|
break;
|
|
27789
27705
|
case "--link-base":
|
|
27790
|
-
linkBaseUrl =
|
|
27706
|
+
linkBaseUrl = requireValue11(rest, token);
|
|
27791
27707
|
break;
|
|
27792
27708
|
default:
|
|
27793
27709
|
throw new Error(`Unknown quiz create-draft option: ${token}`);
|
|
@@ -27813,16 +27729,16 @@ function parseQuizArgs(tokens) {
|
|
|
27813
27729
|
const token = rest.shift();
|
|
27814
27730
|
switch (token) {
|
|
27815
27731
|
case "--paper-id":
|
|
27816
|
-
paperId =
|
|
27732
|
+
paperId = requireValue11(rest, token);
|
|
27817
27733
|
break;
|
|
27818
27734
|
case "--file":
|
|
27819
|
-
filePath =
|
|
27735
|
+
filePath = requireValue11(rest, token);
|
|
27820
27736
|
break;
|
|
27821
27737
|
case "--base-url":
|
|
27822
|
-
apiBaseUrl =
|
|
27738
|
+
apiBaseUrl = requireValue11(rest, token);
|
|
27823
27739
|
break;
|
|
27824
27740
|
case "--link-base":
|
|
27825
|
-
linkBaseUrl =
|
|
27741
|
+
linkBaseUrl = requireValue11(rest, token);
|
|
27826
27742
|
break;
|
|
27827
27743
|
default:
|
|
27828
27744
|
throw new Error(`Unknown quiz update-meta option: ${token}`);
|
|
@@ -27852,16 +27768,16 @@ function parseQuizArgs(tokens) {
|
|
|
27852
27768
|
const token = rest.shift();
|
|
27853
27769
|
switch (token) {
|
|
27854
27770
|
case "--paper-id":
|
|
27855
|
-
paperId =
|
|
27771
|
+
paperId = requireValue11(rest, token);
|
|
27856
27772
|
break;
|
|
27857
27773
|
case "--file":
|
|
27858
|
-
filePath =
|
|
27774
|
+
filePath = requireValue11(rest, token);
|
|
27859
27775
|
break;
|
|
27860
27776
|
case "--base-url":
|
|
27861
|
-
apiBaseUrl =
|
|
27777
|
+
apiBaseUrl = requireValue11(rest, token);
|
|
27862
27778
|
break;
|
|
27863
27779
|
case "--link-base":
|
|
27864
|
-
linkBaseUrl =
|
|
27780
|
+
linkBaseUrl = requireValue11(rest, token);
|
|
27865
27781
|
break;
|
|
27866
27782
|
default:
|
|
27867
27783
|
throw new Error(`Unknown quiz append-step option: ${token}`);
|
|
@@ -27892,19 +27808,19 @@ function parseQuizArgs(tokens) {
|
|
|
27892
27808
|
const token = rest.shift();
|
|
27893
27809
|
switch (token) {
|
|
27894
27810
|
case "--paper-id":
|
|
27895
|
-
paperId =
|
|
27811
|
+
paperId = requireValue11(rest, token);
|
|
27896
27812
|
break;
|
|
27897
27813
|
case "--step-id":
|
|
27898
|
-
stepId =
|
|
27814
|
+
stepId = requireValue11(rest, token);
|
|
27899
27815
|
break;
|
|
27900
27816
|
case "--file":
|
|
27901
|
-
filePath =
|
|
27817
|
+
filePath = requireValue11(rest, token);
|
|
27902
27818
|
break;
|
|
27903
27819
|
case "--base-url":
|
|
27904
|
-
apiBaseUrl =
|
|
27820
|
+
apiBaseUrl = requireValue11(rest, token);
|
|
27905
27821
|
break;
|
|
27906
27822
|
case "--link-base":
|
|
27907
|
-
linkBaseUrl =
|
|
27823
|
+
linkBaseUrl = requireValue11(rest, token);
|
|
27908
27824
|
break;
|
|
27909
27825
|
default:
|
|
27910
27826
|
throw new Error(`Unknown quiz update-step option: ${token}`);
|
|
@@ -27938,16 +27854,16 @@ function parseQuizArgs(tokens) {
|
|
|
27938
27854
|
const token = rest.shift();
|
|
27939
27855
|
switch (token) {
|
|
27940
27856
|
case "--paper-id":
|
|
27941
|
-
paperId =
|
|
27857
|
+
paperId = requireValue11(rest, token);
|
|
27942
27858
|
break;
|
|
27943
27859
|
case "--step-ids":
|
|
27944
|
-
stepIdsRaw =
|
|
27860
|
+
stepIdsRaw = requireValue11(rest, token);
|
|
27945
27861
|
break;
|
|
27946
27862
|
case "--base-url":
|
|
27947
|
-
apiBaseUrl =
|
|
27863
|
+
apiBaseUrl = requireValue11(rest, token);
|
|
27948
27864
|
break;
|
|
27949
27865
|
case "--link-base":
|
|
27950
|
-
linkBaseUrl =
|
|
27866
|
+
linkBaseUrl = requireValue11(rest, token);
|
|
27951
27867
|
break;
|
|
27952
27868
|
default:
|
|
27953
27869
|
throw new Error(`Unknown quiz reorder option: ${token}`);
|
|
@@ -27981,16 +27897,16 @@ function parseQuizArgs(tokens) {
|
|
|
27981
27897
|
const token = rest.shift();
|
|
27982
27898
|
switch (token) {
|
|
27983
27899
|
case "--paper-id":
|
|
27984
|
-
paperId =
|
|
27900
|
+
paperId = requireValue11(rest, token);
|
|
27985
27901
|
break;
|
|
27986
27902
|
case "--step-id":
|
|
27987
|
-
stepId =
|
|
27903
|
+
stepId = requireValue11(rest, token);
|
|
27988
27904
|
break;
|
|
27989
27905
|
case "--base-url":
|
|
27990
|
-
apiBaseUrl =
|
|
27906
|
+
apiBaseUrl = requireValue11(rest, token);
|
|
27991
27907
|
break;
|
|
27992
27908
|
case "--link-base":
|
|
27993
|
-
linkBaseUrl =
|
|
27909
|
+
linkBaseUrl = requireValue11(rest, token);
|
|
27994
27910
|
break;
|
|
27995
27911
|
default:
|
|
27996
27912
|
throw new Error(`Unknown quiz delete-step option: ${token}`);
|
|
@@ -28019,13 +27935,13 @@ function parseQuizArgs(tokens) {
|
|
|
28019
27935
|
const token = rest.shift();
|
|
28020
27936
|
switch (token) {
|
|
28021
27937
|
case "--paper-id":
|
|
28022
|
-
paperId =
|
|
27938
|
+
paperId = requireValue11(rest, token);
|
|
28023
27939
|
break;
|
|
28024
27940
|
case "--base-url":
|
|
28025
|
-
apiBaseUrl =
|
|
27941
|
+
apiBaseUrl = requireValue11(rest, token);
|
|
28026
27942
|
break;
|
|
28027
27943
|
case "--link-base":
|
|
28028
|
-
linkBaseUrl =
|
|
27944
|
+
linkBaseUrl = requireValue11(rest, token);
|
|
28029
27945
|
break;
|
|
28030
27946
|
default:
|
|
28031
27947
|
throw new Error(`Unknown quiz activate option: ${token}`);
|
|
@@ -28050,13 +27966,13 @@ function parseQuizArgs(tokens) {
|
|
|
28050
27966
|
const token = rest.shift();
|
|
28051
27967
|
switch (token) {
|
|
28052
27968
|
case "--paper-id":
|
|
28053
|
-
paperId =
|
|
27969
|
+
paperId = requireValue11(rest, token);
|
|
28054
27970
|
break;
|
|
28055
27971
|
case "--base-url":
|
|
28056
|
-
apiBaseUrl =
|
|
27972
|
+
apiBaseUrl = requireValue11(rest, token);
|
|
28057
27973
|
break;
|
|
28058
27974
|
case "--link-base":
|
|
28059
|
-
linkBaseUrl =
|
|
27975
|
+
linkBaseUrl = requireValue11(rest, token);
|
|
28060
27976
|
break;
|
|
28061
27977
|
default:
|
|
28062
27978
|
throw new Error(`Unknown quiz view option: ${token}`);
|
|
@@ -28085,22 +28001,22 @@ function parseQuizArgs(tokens) {
|
|
|
28085
28001
|
const token = rest.shift();
|
|
28086
28002
|
switch (token) {
|
|
28087
28003
|
case "--paper-id":
|
|
28088
|
-
paperId =
|
|
28004
|
+
paperId = requireValue11(rest, token);
|
|
28089
28005
|
break;
|
|
28090
28006
|
case "--step-id":
|
|
28091
|
-
stepId =
|
|
28007
|
+
stepId = requireValue11(rest, token);
|
|
28092
28008
|
break;
|
|
28093
28009
|
case "--file":
|
|
28094
|
-
filePath =
|
|
28010
|
+
filePath = requireValue11(rest, token);
|
|
28095
28011
|
break;
|
|
28096
28012
|
case "--new-paper-id":
|
|
28097
|
-
newPaperId =
|
|
28013
|
+
newPaperId = requireValue11(rest, token);
|
|
28098
28014
|
break;
|
|
28099
28015
|
case "--base-url":
|
|
28100
|
-
apiBaseUrl =
|
|
28016
|
+
apiBaseUrl = requireValue11(rest, token);
|
|
28101
28017
|
break;
|
|
28102
28018
|
case "--link-base":
|
|
28103
|
-
linkBaseUrl =
|
|
28019
|
+
linkBaseUrl = requireValue11(rest, token);
|
|
28104
28020
|
break;
|
|
28105
28021
|
case "--activate":
|
|
28106
28022
|
activate = true;
|
|
@@ -28190,10 +28106,10 @@ function parseLinearPrArgs(tokens) {
|
|
|
28190
28106
|
const token = rest.shift();
|
|
28191
28107
|
switch (token) {
|
|
28192
28108
|
case "--account":
|
|
28193
|
-
account =
|
|
28109
|
+
account = requireValue11(rest, token);
|
|
28194
28110
|
break;
|
|
28195
28111
|
case "--cwd":
|
|
28196
|
-
cwd =
|
|
28112
|
+
cwd = requireValue11(rest, token);
|
|
28197
28113
|
break;
|
|
28198
28114
|
default:
|
|
28199
28115
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28222,35 +28138,35 @@ function parseLinearCreateArgs(tokens) {
|
|
|
28222
28138
|
const token = rest.shift();
|
|
28223
28139
|
switch (token) {
|
|
28224
28140
|
case "--account":
|
|
28225
|
-
account =
|
|
28141
|
+
account = requireValue11(rest, token);
|
|
28226
28142
|
break;
|
|
28227
28143
|
case "--repl":
|
|
28228
28144
|
useRepl = true;
|
|
28229
28145
|
break;
|
|
28230
28146
|
case "--title":
|
|
28231
|
-
title =
|
|
28147
|
+
title = requireValue11(rest, token);
|
|
28232
28148
|
break;
|
|
28233
28149
|
case "--desc":
|
|
28234
28150
|
case "--description":
|
|
28235
|
-
description = decodeEscapedNewlines(
|
|
28151
|
+
description = decodeEscapedNewlines(requireValue11(rest, token));
|
|
28236
28152
|
break;
|
|
28237
28153
|
case "--team-id":
|
|
28238
|
-
teamId =
|
|
28154
|
+
teamId = requireValue11(rest, token);
|
|
28239
28155
|
break;
|
|
28240
28156
|
case "--team-key":
|
|
28241
|
-
teamKey =
|
|
28157
|
+
teamKey = requireValue11(rest, token);
|
|
28242
28158
|
break;
|
|
28243
28159
|
case "--priority":
|
|
28244
|
-
priority = parseLinearPriority(
|
|
28160
|
+
priority = parseLinearPriority(requireValue11(rest, token));
|
|
28245
28161
|
break;
|
|
28246
28162
|
case "--parent-id":
|
|
28247
|
-
parentId =
|
|
28163
|
+
parentId = requireValue11(rest, token);
|
|
28248
28164
|
break;
|
|
28249
28165
|
case "--state-id":
|
|
28250
|
-
stateId =
|
|
28166
|
+
stateId = requireValue11(rest, token);
|
|
28251
28167
|
break;
|
|
28252
28168
|
case "--cwd":
|
|
28253
|
-
cwd =
|
|
28169
|
+
cwd = requireValue11(rest, token);
|
|
28254
28170
|
break;
|
|
28255
28171
|
default:
|
|
28256
28172
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28285,10 +28201,10 @@ function parseLinearWhoamiArgs(tokens) {
|
|
|
28285
28201
|
const token = rest.shift();
|
|
28286
28202
|
switch (token) {
|
|
28287
28203
|
case "--account":
|
|
28288
|
-
account =
|
|
28204
|
+
account = requireValue11(rest, token);
|
|
28289
28205
|
break;
|
|
28290
28206
|
case "--cwd":
|
|
28291
|
-
cwd =
|
|
28207
|
+
cwd = requireValue11(rest, token);
|
|
28292
28208
|
break;
|
|
28293
28209
|
default:
|
|
28294
28210
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28313,10 +28229,10 @@ function parseLinearViewArgs(tokens) {
|
|
|
28313
28229
|
const token = rest.shift();
|
|
28314
28230
|
switch (token) {
|
|
28315
28231
|
case "--account":
|
|
28316
|
-
account =
|
|
28232
|
+
account = requireValue11(rest, token);
|
|
28317
28233
|
break;
|
|
28318
28234
|
case "--cwd":
|
|
28319
|
-
cwd =
|
|
28235
|
+
cwd = requireValue11(rest, token);
|
|
28320
28236
|
break;
|
|
28321
28237
|
default:
|
|
28322
28238
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28351,32 +28267,32 @@ function parseLinearUpdateArgs(tokens) {
|
|
|
28351
28267
|
const token = rest.shift();
|
|
28352
28268
|
switch (token) {
|
|
28353
28269
|
case "--account":
|
|
28354
|
-
account =
|
|
28270
|
+
account = requireValue11(rest, token);
|
|
28355
28271
|
break;
|
|
28356
28272
|
case "--title":
|
|
28357
|
-
title =
|
|
28273
|
+
title = requireValue11(rest, token);
|
|
28358
28274
|
break;
|
|
28359
28275
|
case "--desc":
|
|
28360
28276
|
case "--description":
|
|
28361
|
-
description = decodeEscapedNewlines(
|
|
28277
|
+
description = decodeEscapedNewlines(requireValue11(rest, token));
|
|
28362
28278
|
break;
|
|
28363
28279
|
case "--team-id":
|
|
28364
|
-
teamId =
|
|
28280
|
+
teamId = requireValue11(rest, token);
|
|
28365
28281
|
break;
|
|
28366
28282
|
case "--team-key":
|
|
28367
|
-
teamKey =
|
|
28283
|
+
teamKey = requireValue11(rest, token);
|
|
28368
28284
|
break;
|
|
28369
28285
|
case "--priority":
|
|
28370
|
-
priority = parseLinearPriority(
|
|
28286
|
+
priority = parseLinearPriority(requireValue11(rest, token));
|
|
28371
28287
|
break;
|
|
28372
28288
|
case "--parent-id":
|
|
28373
|
-
parentId =
|
|
28289
|
+
parentId = requireValue11(rest, token);
|
|
28374
28290
|
break;
|
|
28375
28291
|
case "--state-id":
|
|
28376
|
-
stateId =
|
|
28292
|
+
stateId = requireValue11(rest, token);
|
|
28377
28293
|
break;
|
|
28378
28294
|
case "--cwd":
|
|
28379
|
-
cwd =
|
|
28295
|
+
cwd = requireValue11(rest, token);
|
|
28380
28296
|
break;
|
|
28381
28297
|
default:
|
|
28382
28298
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28414,10 +28330,10 @@ function parseLinearSubIssuesArgs(tokens) {
|
|
|
28414
28330
|
const token = rest.shift();
|
|
28415
28331
|
switch (token) {
|
|
28416
28332
|
case "--account":
|
|
28417
|
-
account =
|
|
28333
|
+
account = requireValue11(rest, token);
|
|
28418
28334
|
break;
|
|
28419
28335
|
case "--cwd":
|
|
28420
|
-
cwd =
|
|
28336
|
+
cwd = requireValue11(rest, token);
|
|
28421
28337
|
break;
|
|
28422
28338
|
default:
|
|
28423
28339
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28444,15 +28360,15 @@ function parseLinearCommentArgs(tokens) {
|
|
|
28444
28360
|
const token = rest.shift();
|
|
28445
28361
|
switch (token) {
|
|
28446
28362
|
case "--account":
|
|
28447
|
-
account =
|
|
28363
|
+
account = requireValue11(rest, token);
|
|
28448
28364
|
break;
|
|
28449
28365
|
case "--body":
|
|
28450
28366
|
case "--desc":
|
|
28451
28367
|
case "--description":
|
|
28452
|
-
body = decodeEscapedNewlines(
|
|
28368
|
+
body = decodeEscapedNewlines(requireValue11(rest, token));
|
|
28453
28369
|
break;
|
|
28454
28370
|
case "--cwd":
|
|
28455
|
-
cwd =
|
|
28371
|
+
cwd = requireValue11(rest, token);
|
|
28456
28372
|
break;
|
|
28457
28373
|
default:
|
|
28458
28374
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28482,10 +28398,10 @@ function parseLinearCommentsArgs(tokens) {
|
|
|
28482
28398
|
const token = rest.shift();
|
|
28483
28399
|
switch (token) {
|
|
28484
28400
|
case "--account":
|
|
28485
|
-
account =
|
|
28401
|
+
account = requireValue11(rest, token);
|
|
28486
28402
|
break;
|
|
28487
28403
|
case "--cwd":
|
|
28488
|
-
cwd =
|
|
28404
|
+
cwd = requireValue11(rest, token);
|
|
28489
28405
|
break;
|
|
28490
28406
|
default:
|
|
28491
28407
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28509,16 +28425,16 @@ function parseLinearCycleArgs(tokens) {
|
|
|
28509
28425
|
const token = rest.shift();
|
|
28510
28426
|
switch (token) {
|
|
28511
28427
|
case "--account":
|
|
28512
|
-
account =
|
|
28428
|
+
account = requireValue11(rest, token);
|
|
28513
28429
|
break;
|
|
28514
28430
|
case "--team-id":
|
|
28515
|
-
teamId =
|
|
28431
|
+
teamId = requireValue11(rest, token);
|
|
28516
28432
|
break;
|
|
28517
28433
|
case "--team-key":
|
|
28518
|
-
teamKey =
|
|
28434
|
+
teamKey = requireValue11(rest, token);
|
|
28519
28435
|
break;
|
|
28520
28436
|
case "--cwd":
|
|
28521
|
-
cwd =
|
|
28437
|
+
cwd = requireValue11(rest, token);
|
|
28522
28438
|
break;
|
|
28523
28439
|
default:
|
|
28524
28440
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28541,10 +28457,10 @@ function parseLinearTeamsArgs(tokens) {
|
|
|
28541
28457
|
const token = rest.shift();
|
|
28542
28458
|
switch (token) {
|
|
28543
28459
|
case "--account":
|
|
28544
|
-
account =
|
|
28460
|
+
account = requireValue11(rest, token);
|
|
28545
28461
|
break;
|
|
28546
28462
|
case "--cwd":
|
|
28547
|
-
cwd =
|
|
28463
|
+
cwd = requireValue11(rest, token);
|
|
28548
28464
|
break;
|
|
28549
28465
|
default:
|
|
28550
28466
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28571,16 +28487,16 @@ function parseLinearUserIssuesArgs(tokens) {
|
|
|
28571
28487
|
const token = rest.shift();
|
|
28572
28488
|
switch (token) {
|
|
28573
28489
|
case "--account":
|
|
28574
|
-
account =
|
|
28490
|
+
account = requireValue11(rest, token);
|
|
28575
28491
|
break;
|
|
28576
28492
|
case "--cycle":
|
|
28577
|
-
cycle = parseLinearCycle(
|
|
28493
|
+
cycle = parseLinearCycle(requireValue11(rest, token));
|
|
28578
28494
|
break;
|
|
28579
28495
|
case "--status":
|
|
28580
|
-
status = parseLinearStatus(
|
|
28496
|
+
status = parseLinearStatus(requireValue11(rest, token));
|
|
28581
28497
|
break;
|
|
28582
28498
|
case "--cwd":
|
|
28583
|
-
cwd =
|
|
28499
|
+
cwd = requireValue11(rest, token);
|
|
28584
28500
|
break;
|
|
28585
28501
|
default:
|
|
28586
28502
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28614,28 +28530,28 @@ function parseLinearIssuesArgs(tokens) {
|
|
|
28614
28530
|
const token = rest.shift();
|
|
28615
28531
|
switch (token) {
|
|
28616
28532
|
case "--account":
|
|
28617
|
-
account =
|
|
28533
|
+
account = requireValue11(rest, token);
|
|
28618
28534
|
break;
|
|
28619
28535
|
case "--team-id":
|
|
28620
|
-
teamId =
|
|
28536
|
+
teamId = requireValue11(rest, token);
|
|
28621
28537
|
break;
|
|
28622
28538
|
case "--team-key":
|
|
28623
|
-
teamKey =
|
|
28539
|
+
teamKey = requireValue11(rest, token);
|
|
28624
28540
|
break;
|
|
28625
28541
|
case "--user":
|
|
28626
|
-
user =
|
|
28542
|
+
user = requireValue11(rest, token);
|
|
28627
28543
|
break;
|
|
28628
28544
|
case "--cycle":
|
|
28629
|
-
cycle = parseLinearCycle(
|
|
28545
|
+
cycle = parseLinearCycle(requireValue11(rest, token));
|
|
28630
28546
|
break;
|
|
28631
28547
|
case "--status":
|
|
28632
|
-
status = parseLinearStatus(
|
|
28548
|
+
status = parseLinearStatus(requireValue11(rest, token));
|
|
28633
28549
|
break;
|
|
28634
28550
|
case "--query":
|
|
28635
|
-
query =
|
|
28551
|
+
query = requireValue11(rest, token).trim();
|
|
28636
28552
|
break;
|
|
28637
28553
|
case "--limit": {
|
|
28638
|
-
const value = Number.parseInt(
|
|
28554
|
+
const value = Number.parseInt(requireValue11(rest, token), 10);
|
|
28639
28555
|
if (!Number.isInteger(value) || value < 1 || value > 250) {
|
|
28640
28556
|
throw new Error("Invalid --limit. Expected an integer between 1 and 250.");
|
|
28641
28557
|
}
|
|
@@ -28643,7 +28559,7 @@ function parseLinearIssuesArgs(tokens) {
|
|
|
28643
28559
|
break;
|
|
28644
28560
|
}
|
|
28645
28561
|
case "--cwd":
|
|
28646
|
-
cwd =
|
|
28562
|
+
cwd = requireValue11(rest, token);
|
|
28647
28563
|
break;
|
|
28648
28564
|
default:
|
|
28649
28565
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28684,10 +28600,10 @@ function parseLinearLegacyArgs(tokens) {
|
|
|
28684
28600
|
useScreenshot = true;
|
|
28685
28601
|
break;
|
|
28686
28602
|
case "--account":
|
|
28687
|
-
account =
|
|
28603
|
+
account = requireValue11(rest, token);
|
|
28688
28604
|
break;
|
|
28689
28605
|
case "--cwd":
|
|
28690
|
-
cwd =
|
|
28606
|
+
cwd = requireValue11(rest, token);
|
|
28691
28607
|
break;
|
|
28692
28608
|
default:
|
|
28693
28609
|
throw new Error(`Unknown linear option: ${token}`);
|
|
@@ -28781,19 +28697,19 @@ function parseNotionArgs(tokens) {
|
|
|
28781
28697
|
const token = rest.shift();
|
|
28782
28698
|
switch (token) {
|
|
28783
28699
|
case "--parent":
|
|
28784
|
-
parentPageId =
|
|
28700
|
+
parentPageId = requireValue11(rest, token);
|
|
28785
28701
|
break;
|
|
28786
28702
|
case "--title":
|
|
28787
|
-
title =
|
|
28703
|
+
title = requireValue11(rest, token);
|
|
28788
28704
|
break;
|
|
28789
28705
|
case "--private":
|
|
28790
28706
|
isPrivate = true;
|
|
28791
28707
|
break;
|
|
28792
28708
|
case "--content":
|
|
28793
|
-
content2 =
|
|
28709
|
+
content2 = requireValue11(rest, token);
|
|
28794
28710
|
break;
|
|
28795
28711
|
case "--file":
|
|
28796
|
-
filePath2 =
|
|
28712
|
+
filePath2 = requireValue11(rest, token);
|
|
28797
28713
|
break;
|
|
28798
28714
|
default:
|
|
28799
28715
|
throw new Error(`Unknown notion option: ${token}`);
|
|
@@ -28837,10 +28753,10 @@ function parseNotionArgs(tokens) {
|
|
|
28837
28753
|
const token = rest.shift();
|
|
28838
28754
|
switch (token) {
|
|
28839
28755
|
case "--content":
|
|
28840
|
-
content =
|
|
28756
|
+
content = requireValue11(rest, token);
|
|
28841
28757
|
break;
|
|
28842
28758
|
case "--file":
|
|
28843
|
-
filePath =
|
|
28759
|
+
filePath = requireValue11(rest, token);
|
|
28844
28760
|
break;
|
|
28845
28761
|
case "--append":
|
|
28846
28762
|
append = true;
|
|
@@ -28885,11 +28801,11 @@ function parseRandomArgs(tokens) {
|
|
|
28885
28801
|
mode = "easy";
|
|
28886
28802
|
break;
|
|
28887
28803
|
case "--length":
|
|
28888
|
-
length = parsePositiveInt3(
|
|
28804
|
+
length = parsePositiveInt3(requireValue11(rest, token), token);
|
|
28889
28805
|
seenLength = true;
|
|
28890
28806
|
break;
|
|
28891
28807
|
case "--charset": {
|
|
28892
|
-
const value =
|
|
28808
|
+
const value = requireValue11(rest, token);
|
|
28893
28809
|
if (!["base64url", "hex", "alnum", "ascii"].includes(value)) {
|
|
28894
28810
|
throw new Error(
|
|
28895
28811
|
`Invalid --charset value: ${value}. Use base64url|hex|alnum|ascii.`
|
|
@@ -28900,18 +28816,18 @@ function parseRandomArgs(tokens) {
|
|
|
28900
28816
|
break;
|
|
28901
28817
|
}
|
|
28902
28818
|
case "--count":
|
|
28903
|
-
count = parsePositiveInt3(
|
|
28819
|
+
count = parsePositiveInt3(requireValue11(rest, token), token);
|
|
28904
28820
|
break;
|
|
28905
28821
|
case "--words":
|
|
28906
|
-
words = parsePositiveInt3(
|
|
28822
|
+
words = parsePositiveInt3(requireValue11(rest, token), token);
|
|
28907
28823
|
seenWords = true;
|
|
28908
28824
|
break;
|
|
28909
28825
|
case "--digits":
|
|
28910
|
-
digits = parseNonNegativeInt(
|
|
28826
|
+
digits = parseNonNegativeInt(requireValue11(rest, token), token);
|
|
28911
28827
|
seenDigits = true;
|
|
28912
28828
|
break;
|
|
28913
28829
|
case "--separator":
|
|
28914
|
-
separator =
|
|
28830
|
+
separator = requireValue11(rest, token);
|
|
28915
28831
|
seenSeparator = true;
|
|
28916
28832
|
break;
|
|
28917
28833
|
default:
|
|
@@ -28942,7 +28858,7 @@ function parseRandomArgs(tokens) {
|
|
|
28942
28858
|
count
|
|
28943
28859
|
};
|
|
28944
28860
|
}
|
|
28945
|
-
function
|
|
28861
|
+
function requireValue11(tokens, optionName) {
|
|
28946
28862
|
const value = tokens.shift();
|
|
28947
28863
|
if (!value) {
|
|
28948
28864
|
throw new Error(`Missing value for ${optionName}`);
|