@1msg/cli 0.1.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.
Files changed (76) hide show
  1. package/ARCHITECTURE.md +21 -0
  2. package/LICENSE +21 -0
  3. package/README.md +69 -0
  4. package/dist/commands.d.ts +8 -0
  5. package/dist/commands.d.ts.map +1 -0
  6. package/dist/commands.js +90 -0
  7. package/dist/commands.js.map +1 -0
  8. package/dist/completion.d.ts +11 -0
  9. package/dist/completion.d.ts.map +1 -0
  10. package/dist/completion.js +205 -0
  11. package/dist/completion.js.map +1 -0
  12. package/dist/config.d.ts +37 -0
  13. package/dist/config.d.ts.map +1 -0
  14. package/dist/config.js +185 -0
  15. package/dist/config.js.map +1 -0
  16. package/dist/context.d.ts +30 -0
  17. package/dist/context.d.ts.map +1 -0
  18. package/dist/context.js +111 -0
  19. package/dist/context.js.map +1 -0
  20. package/dist/dest.d.ts +27 -0
  21. package/dist/dest.d.ts.map +1 -0
  22. package/dist/dest.js +63 -0
  23. package/dist/dest.js.map +1 -0
  24. package/dist/errors.d.ts +34 -0
  25. package/dist/errors.d.ts.map +1 -0
  26. package/dist/errors.js +133 -0
  27. package/dist/errors.js.map +1 -0
  28. package/dist/execute.d.ts +11 -0
  29. package/dist/execute.d.ts.map +1 -0
  30. package/dist/execute.js +89 -0
  31. package/dist/execute.js.map +1 -0
  32. package/dist/help-text.d.ts +3 -0
  33. package/dist/help-text.d.ts.map +1 -0
  34. package/dist/help-text.js +55 -0
  35. package/dist/help-text.js.map +1 -0
  36. package/dist/index.d.ts +3 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +14 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/io.d.ts +14 -0
  41. package/dist/io.d.ts.map +1 -0
  42. package/dist/io.js +128 -0
  43. package/dist/io.js.map +1 -0
  44. package/dist/local.d.ts +30 -0
  45. package/dist/local.d.ts.map +1 -0
  46. package/dist/local.js +247 -0
  47. package/dist/local.js.map +1 -0
  48. package/dist/output.d.ts +20 -0
  49. package/dist/output.d.ts.map +1 -0
  50. package/dist/output.js +118 -0
  51. package/dist/output.js.map +1 -0
  52. package/dist/paths.d.ts +5 -0
  53. package/dist/paths.d.ts.map +1 -0
  54. package/dist/paths.js +33 -0
  55. package/dist/paths.js.map +1 -0
  56. package/dist/program.d.ts +5 -0
  57. package/dist/program.d.ts.map +1 -0
  58. package/dist/program.js +507 -0
  59. package/dist/program.js.map +1 -0
  60. package/dist/rest.d.ts +112 -0
  61. package/dist/rest.d.ts.map +1 -0
  62. package/dist/rest.js +549 -0
  63. package/dist/rest.js.map +1 -0
  64. package/dist/run.d.ts +3 -0
  65. package/dist/run.d.ts.map +1 -0
  66. package/dist/run.js +33 -0
  67. package/dist/run.js.map +1 -0
  68. package/dist/send.d.ts +188 -0
  69. package/dist/send.d.ts.map +1 -0
  70. package/dist/send.js +498 -0
  71. package/dist/send.js.map +1 -0
  72. package/dist/version.d.ts +3 -0
  73. package/dist/version.d.ts.map +1 -0
  74. package/dist/version.js +6 -0
  75. package/dist/version.js.map +1 -0
  76. package/package.json +50 -0
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.outputOpts = outputOpts;
4
+ exports.withClient = withClient;
5
+ exports.printApiResult = printApiResult;
6
+ exports.printSent = printSent;
7
+ exports.emitError = emitError;
8
+ exports.ok = ok;
9
+ const config_1 = require("./config");
10
+ const errors_1 = require("./errors");
11
+ const output_1 = require("./output");
12
+ function outputOpts(flags, ctx) {
13
+ const noColorEnv = Boolean(ctx.env.NO_COLOR);
14
+ return {
15
+ json: Boolean(flags.json),
16
+ color: flags.color !== false && !noColorEnv,
17
+ };
18
+ }
19
+ async function withClient(ctx, flags, fn) {
20
+ const resolved = (0, config_1.resolveChannel)(ctx, flags);
21
+ const client = ctx.createClient({
22
+ baseUrl: resolved.baseUrl,
23
+ instanceId: resolved.instanceId,
24
+ token: resolved.token,
25
+ });
26
+ try {
27
+ return await fn(client);
28
+ }
29
+ catch (error) {
30
+ throw await (0, errors_1.normalizeThrown)(error);
31
+ }
32
+ }
33
+ function printApiResult(ctx, flags, body, human) {
34
+ const opts = outputOpts(flags, ctx);
35
+ if (opts.json) {
36
+ (0, output_1.printJson)(ctx.stdout, body);
37
+ return;
38
+ }
39
+ if (human) {
40
+ human();
41
+ return;
42
+ }
43
+ if (body && typeof body === 'object' && !Array.isArray(body)) {
44
+ (0, output_1.printKv)(ctx.stdout, Object.entries(body).map(([k, v]) => [k, v]));
45
+ return;
46
+ }
47
+ (0, output_1.printJson)(ctx.stdout, body);
48
+ }
49
+ function printSent(ctx, flags, body, to) {
50
+ printApiResult(ctx, flags, body, () => {
51
+ const rec = body && typeof body === 'object' ? body : {};
52
+ (0, output_1.printKv)(ctx.stdout, [
53
+ ['sent', rec.sent],
54
+ ['id', rec.id ?? rec.message],
55
+ ['to', rec.to ?? rec.chatId ?? to],
56
+ ]);
57
+ });
58
+ }
59
+ async function emitError(ctx, flags, error) {
60
+ const normalized = await (0, errors_1.normalizeThrown)(error);
61
+ if (normalized instanceof errors_1.CliExit)
62
+ return normalized.exitCode;
63
+ const opts = outputOpts(flags, ctx);
64
+ if (normalized instanceof errors_1.UsageError) {
65
+ (0, output_1.printError)(ctx.stderr, opts, normalized, { see: normalized.see });
66
+ return normalized.exitCode;
67
+ }
68
+ if (normalized instanceof errors_1.NotConfiguredError) {
69
+ (0, output_1.printError)(ctx.stderr, opts, normalized);
70
+ return normalized.exitCode;
71
+ }
72
+ if (normalized instanceof errors_1.ApiError) {
73
+ const human = new Error(`${normalized.message} (HTTP ${normalized.status})`);
74
+ (0, output_1.printError)(ctx.stderr, opts, opts.json ? normalized : human, {
75
+ hint: (0, errors_1.hintFor)(normalized),
76
+ rawBody: opts.json ? normalized.rawBody || JSON.stringify({ error: normalized.message }) : undefined,
77
+ jsonBody: opts.json ? normalized.jsonBody ?? { error: normalized.message } : undefined,
78
+ });
79
+ return normalized.exitCode;
80
+ }
81
+ (0, output_1.printError)(ctx.stderr, opts, normalized);
82
+ return 'exitCode' in normalized && typeof normalized.exitCode === 'number'
83
+ ? normalized.exitCode
84
+ : 1;
85
+ }
86
+ function ok() {
87
+ return errors_1.EXIT_OK;
88
+ }
89
+ //# sourceMappingURL=execute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":";;AAcA,gCAMC;AAED,gCAgBC;AAED,wCAuBC;AAED,8BASC;AAED,8BA0BC;AAED,gBAEC;AAxGD,qCAA4D;AAC5D,qCAQkB;AAClB,qCAA2E;AAE3E,SAAgB,UAAU,CAAC,KAAkB,EAAE,GAAe;IAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7C,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;QACzB,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,KAAK,IAAI,CAAC,UAAU;KAC5C,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,UAAU,CAC9B,GAAe,EACf,KAAkB,EAClB,EAAkC;IAElC,MAAM,QAAQ,GAAG,IAAA,uBAAc,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC;QAC9B,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,KAAK,EAAE,QAAQ,CAAC,KAAK;KACtB,CAAC,CAAC;IACH,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,IAAA,wBAAe,EAAC,KAAK,CAAC,CAAC;IACrC,CAAC;AACH,CAAC;AAED,SAAgB,cAAc,CAC5B,GAAe,EACf,KAAkB,EAClB,I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IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;SACvF,CAAC,CAAC;QACH,OAAO,UAAU,CAAC,QAAQ,CAAC;IAC7B,CAAC;IACD,IAAA,mBAAU,EAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACzC,OAAO,UAAU,IAAI,UAAU,IAAI,OAAQ,UAAmC,CAAC,QAAQ,KAAK,QAAQ;QAClG,CAAC,CAAE,UAAmC,CAAC,QAAQ;QAC/C,CAAC,CAAC,CAAC,CAAC;AACR,CAAC;AAED,SAAgB,EAAE;IAChB,OAAO,gBAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const HELP_TEXT: Record<string, string>;
2
+ export declare function helpFor(path: string): string | undefined;
3
+ //# sourceMappingURL=help-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help-text.d.ts","sourceRoot":"","sources":["../src/help-text.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2C5C,CAAC;AAEF,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGxD"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HELP_TEXT = void 0;
4
+ exports.helpFor = helpFor;
5
+ /* Generated from docs/CLI.md — freeze RFC --help as the acceptance artifact. */
6
+ exports.HELP_TEXT = {
7
+ "root": "1msg — command-line client for the 1msg WhatsApp Business API\n\nUSAGE\n 1msg <command> [flags]\n\nA channel is one WhatsApp instance (instance id + token). Commands use the\ndefault channel from the config file unless --channel is set. Environment\nvariables fill empty fields on that channel; they do not override a named\nchannel that already has a value.\n\nCOMMANDS\n init Interactive setup: config file, API host, instance, token\n send Send a text or file message (alias of message send)\n message Send, list, and mark messages\n template List, send, create, and delete message templates\n channel Local channel switcher; remote status and settings\n me WhatsApp Business profile (GET/POST /me)\n status Connection status (alias of channel status)\n media Upload, fetch, and delete WABA media\n group Create and manage WhatsApp groups\n flow WhatsApp Flows and business encryption key\n webhook Get or set the client webhook URL\n user Block, unblock, and list blocked users\n catalog Catalog and cart commerce settings\n call WhatsApp Calling API (beta, signaling only)\n completion Print shell completion script (bash | zsh | powershell)\n version Print CLI and SDK versions\n\nFLAGS\n -c, --channel <name> Named channel from the config file\n --instance-id <id> Override instance id\n --base-url <url> Override API root\n --token <token> Override token (prefer ONE_MSG_TOKEN)\n --json Print the API response body as JSON\n --no-color Disable ANSI color\n -h, --help Help for this command\n -v, --version Version\n\nEXAMPLES\n $ 1msg init\n $ 1msg channel list\n $ 1msg channel use acme-prod\n $ 1msg channel use ODI371267300\n $ 1msg channel info\n $ 1msg channel info --json\n $ 1msg send --to 12020721369 --text \"Hello\"\n $ 1msg send --to 12020721369 --file ./invoice.pdf --caption \"Invoice\"\n $ 1msg template list\n $ 1msg status --json\n $ 1msg message list --chat-id 12020721369@c.us --limit 20\n\nENVIRONMENT\n ONE_MSG_CHANNEL Same as --channel\n ONE_MSG_BASE_URL https://api.1msg.io or https://sandbox.1msg.io\n ONE_MSG_INSTANCE_ID Channel instance id\n ONE_MSG_TOKEN Channel API token\n\n Deprecated aliases (same as MCP): CHAT_API_BASE_URL, CHAT_API_TOKEN,\n CHAT_API_INSTANCE_ID, CHAT_API_KEY, TOKEN, INSTANCE_ID.\n\nConfig: ~/.config/1msg/config.yaml (Windows: %AppData%\\1msg\\config.yaml)\nDocs: https://docs.1msg.io/\n",
8
+ "init": "Create a config file and register the first channel.\n\nUSAGE\n 1msg init [flags]\n\nFLAGS\n --name <name> Channel name in the config file (default: default)\n --base-url <url> https://api.1msg.io or https://sandbox.1msg.io\n (also api-stage.1msg.io / http://127.0.0.1:3050)\n --instance-id <id> Channel instance id\n --token-stdin Read token from stdin (non-interactive)\n --no-verify Skip GET /status after save\n -h, --help\n\nEXAMPLES\n $ 1msg init\n $ printf '%s' \"$ONE_MSG_TOKEN\" | 1msg init --name prod \\\n --base-url https://api.1msg.io --instance-id ODI371267300 --token-stdin\n\nInteractive prompts: name, live vs sandbox, instance id, token (hidden),\nset as default. Writes the config file with mode 0600 and runs 1msg status\nunless --no-verify.\n",
9
+ "channel": "Local named channels, and remote status/settings of the selected channel.\n\nUSAGE\n 1msg channel <command> [flags]\n\nThere is no API to list a customer's channels. list / use / add / remove /\ncurrent are always local. Other subcommands call the public API.\n\nLOCAL\n list Channels in the config file (* = default)\n use <name|id> Set the default channel (see `1msg channel use --help`)\n add Add a channel (see `1msg channel add --help`)\n remove <name> Remove a channel from the config file\n current Print the default channel name and instance id\n\nREMOTE\n info GET /status + GET /me (human summary, or one JSON object)\n status GET /status\n settings GET /settings\n settings set POST /settings (only flags you pass are sent)\n mm-lite GET /mmLiteStatus\n automation GET /conversationalAutomation\n automation set POST /conversationalAutomation\n\nEXAMPLES\n $ 1msg channel add --name acme-test --base-url https://sandbox.1msg.io \\\n --instance-id ODI… --token-stdin\n $ 1msg channel use acme-test\n $ 1msg channel use ODI371267300\n $ 1msg channel list\n $ 1msg channel current\n $ 1msg -c acme-prod channel info\n $ 1msg channel info --json\n $ 1msg channel status --json\n $ 1msg me --json\n $ 1msg channel settings set --ack-notifications --no-guaranteed-hooks\n\nCOLUMNS (channel list)\n default name instance_id base_url\n\n`channel info` calls GET /status then GET /me. `--json` prints one object:\n\n { \"status\": <GET /status body>, \"me\": <GET /me body> }\n\nThis is the only CLI-built JSON (not a single server body). If either call\nfails, do not print a partial object: emit that call's error (raw body with\n`--json`) and that HTTP status; skip the second call if the first failed.\n`-c` / `--channel` take a config name, not an instance id.\n\n\nFLAGS (settings set)\n --webhook-url <url> Repeatable, max 5; empty string clears webhooks\n --guaranteed-hooks Retry webhooks until acknowledged\n --no-guaranteed-hooks\n --ack-notifications Include ACK / status events\n --no-ack-notifications\n --raw-hooks Forward raw provider payloads\n --no-raw-hooks\n --template-analytics Enable template analytics\n --no-template-analytics\n --cta-tracking-opt-out Opt out of CTA URL click tracking\n --no-cta-tracking-opt-out\n\nFLAGS (automation set)\n --welcome Enable welcome message\n --no-welcome\n --prompt <text> Repeatable, max 4, each ≤ 80 chars\n --command <name:description> Repeatable slash commands\n\nFLAGS\n -c, --channel <name> Selects which config channel (does not filter `list`)\n -h, --help\n",
10
+ "channel use": "Set the default channel in the config file. Local only; no API call.\n\nUSAGE\n 1msg channel use <name|instance-id>\n\nLOOKUP\n 1. Exact key under channels: in the config file (e.g. acme-prod)\n 2. Else unique instance_id among channels\n 3. Zero matches: exit 1, \"channel \\\"…\\\" not in config\"\n 4. Two or more names share that instance_id: exit 1,\n \"instance id … matches NAME and NAME; pass a config name\"\n\n`--channel` / ONE_MSG_CHANNEL / tab-completion still use config names.\n`remove` takes a config name only.\n\nEXAMPLES\n $ 1msg channel use acme-test\n $ 1msg channel use ODI371267300\n",
11
+ "channel info": "Human summary of the selected channel: GET /status then GET /me.\n\nUSAGE\n 1msg channel info [flags]\n\nFLAGS\n --json One object: { \"status\": <GET /status>, \"me\": <GET /me> }\n -c, --channel <name>\n -h, --help\n\nEXAMPLES\n $ 1msg channel info\n $ 1msg channel info --json\n $ 1msg -c acme-prod channel info --json\n\nWithout --json: key-value from both responses (status, accountStatus,\nmm_lite_available, then profile fields from /me).\nWith --json: the two raw bodies nested under \"status\" and \"me\". Not a server\nschema — CLI-only. A single endpoint remains `1msg status --json` / `1msg me --json`.\n",
12
+ "channel add": "Add a named channel to the config file. Does not change the default unless\nthis is the first channel (then it becomes default).\n\nUSAGE\n 1msg channel add [flags]\n\nFLAGS\n --name <name> Required. Config name (e.g. acme-prod), not instance id\n --base-url <url> https://api.1msg.io | https://sandbox.1msg.io\n Also accepts https://api-stage.1msg.io and http://127.0.0.1:3050\n --instance-id <id> Required unless ONE_MSG_INSTANCE_ID is set\n --token-stdin Read token from stdin\n --default Make this channel the default\n --no-verify Skip GET /status after save\n -h, --help\n\nEXAMPLES\n $ 1msg channel add --name acme-test --base-url https://sandbox.1msg.io \\\n --instance-id ODI371267301 --token-stdin\n $ 1msg channel add --name prod --base-url https://api.1msg.io \\\n --instance-id ODI371267300 --token-stdin --default\n\nNon-interactive: --name, --base-url, --instance-id, and a token (stdin or env)\nare required. Interactive prompts match `1msg init` when flags are omitted.\nWrites ~/.config/1msg/config.yaml mode 0600.\n",
13
+ "status": "USAGE\n 1msg status [flags]\n 1msg channel status [flags]\n\nPrints connection status (typically `connected` when the number can send),\naccountStatus, and mm_lite_available.\n\nEXAMPLES\n $ 1msg status\n $ 1msg status --json\n $ 1msg -c acme-test status\n\nCOLUMNS (human)\n key-value: status, accountStatus, mm_lite_available\n",
14
+ "send": "Send a text or file message (session window must be open).\nOutside 24h use: 1msg template send\n\nUSAGE\n 1msg send [flags]\n 1msg message send [flags]\n\nExactly one destination: --to or --chat-id.\nExactly one body: --text, --file, or --media-id.\n\nFLAGS\n --to <phone>\n --chat-id <id>\n --text <body> UTF-8 text (max 4096) → sendMessage\n --file <path|url> Local file or https URL → sendFile\n --caption <text> Caption when sending a file (max 1024)\n --filename <name> File name with extension. Required with an\n https --file URL (API requires filename with\n body). Optional for a local path (default:\n basename). Ignored with --media-id.\n --media-id <id> WABA media id from `1msg media upload`\n --media-type <type> image | video | audio | document (required with --media-id)\n --voice Native voice note (audio/ogg only)\n --quote <wamid>\n -h, --help\n\nEXAMPLES\n $ 1msg send --to 12020721369 --text \"Hello\"\n $ 1msg send --chat-id 12020721369@c.us --text \"Hello\" --quote wamid.HBgN…\n $ 1msg send --to 12020721369 --file ./photo.jpg --caption \"Look\"\n $ 1msg send --to 12020721369 --file https://example.com/a.pdf --filename invoice.pdf\n $ 1msg send --to 12020721369 --media-id 123456 --media-type image\n\nA local --file is read from disk, encoded as a data URI, and sent as\nsendFile.body. An https URL is passed through as sendFile.body and **requires\n--filename**. This does not call uploadMedia unless you run `1msg media upload`\nyourself. Exit 1 if --file is an https URL without --filename.\n",
15
+ "message send": "Send a text or file message (session window must be open).\nOutside 24h use: 1msg template send\n\nUSAGE\n 1msg send [flags]\n 1msg message send [flags]\n\nExactly one destination: --to or --chat-id.\nExactly one body: --text, --file, or --media-id.\n\nFLAGS\n --to <phone>\n --chat-id <id>\n --text <body> UTF-8 text (max 4096) → sendMessage\n --file <path|url> Local file or https URL → sendFile\n --caption <text> Caption when sending a file (max 1024)\n --filename <name> File name with extension. Required with an\n https --file URL (API requires filename with\n body). Optional for a local path (default:\n basename). Ignored with --media-id.\n --media-id <id> WABA media id from `1msg media upload`\n --media-type <type> image | video | audio | document (required with --media-id)\n --voice Native voice note (audio/ogg only)\n --quote <wamid>\n -h, --help\n\nEXAMPLES\n $ 1msg send --to 12020721369 --text \"Hello\"\n $ 1msg send --chat-id 12020721369@c.us --text \"Hello\" --quote wamid.HBgN…\n $ 1msg send --to 12020721369 --file ./photo.jpg --caption \"Look\"\n $ 1msg send --to 12020721369 --file https://example.com/a.pdf --filename invoice.pdf\n $ 1msg send --to 12020721369 --media-id 123456 --media-type image\n\nA local --file is read from disk, encoded as a data URI, and sent as\nsendFile.body. An https URL is passed through as sendFile.body and **requires\n--filename**. This does not call uploadMedia unless you run `1msg media upload`\nyourself. Exit 1 if --file is an https URL without --filename.\n",
16
+ "message": "Send, list, and mark messages.\n\nUSAGE\n 1msg message <command> [flags]\n\nCOMMANDS\n send Text or file (see 1msg send)\n list Stored chat history (GET /messages)\n read Mark a message as read (POST /readMessage)\n react Send or remove a reaction\n location Send a location pin\n location-request Ask the user to share location\n contact Send a contact card\n buttons Interactive reply buttons (max 3)\n menu Interactive list message (WhatsApp list)\n carousel Carousel\n product Product message\n cta CTA URL button\n address Address message\n order Order details\n payment Payment request\n sticker Sticker\n flow Send a Flow message\n\n`message list` is inbox history. WhatsApp interactive lists are `message menu`.\n\nEXAMPLES\n $ 1msg message send --to 12020721369 --text \"Hello\"\n $ 1msg message list --chat-id 12020721369@c.us --limit 20\n",
17
+ "message list": "USAGE\n 1msg message list [flags]\n\nFLAGS\n --chat-id <id> Filter one chat\n --limit <n> Max rows (API default 100)\n --last Latest first (DESC)\n --msg-id <id> Filter by stored message id\n --min-time <unix> Lower bound\n --max-time <unix> Upper bound\n --first-number <n>\n --last-number <n>\n\nCOLUMNS\n time chat_id from type id body\n\nEXAMPLES\n $ 1msg message list\n $ 1msg message list --chat-id 12020721369@c.us --limit 20 --last\n $ 1msg message list --limit 5 --json\n",
18
+ "message read": "USAGE\n 1msg message read --message-id <id> [flags]\n\nFLAGS\n --message-id <id> Required. API field messageId / msgId\n --typing Show typing indicator (max 25s)\n\nThe read API does not take a chat id.\n\nEXAMPLES\n $ 1msg message read --message-id wamid.HBgNMTIwMjA3MjEzNjkVAgARGBI5RTBCNUY0QUE2RjZBQzhGNDkA\n $ 1msg message read --message-id wamid.… --typing\n",
19
+ "message react": "USAGE\n 1msg message react --message-id <id> --emoji <emoji> [flags]\n\nFLAGS\n --to / --chat-id Required destination\n --message-id <id> Target message → API quotedMsgId\n --emoji <emoji> Reaction → API body. Empty string removes it\n\nEXAMPLES\n $ 1msg message react --to 12020721369 --message-id wamid.… --emoji \"👍\"\n $ 1msg message react --chat-id 12020721369@c.us --message-id wamid.… --emoji \"\"\n",
20
+ "message location": "USAGE\n 1msg message location --lat <n> --lng <n> [flags]\n\nFLAGS\n --to / --chat-id / --quote\n --lat <n> Required, -90..90\n --lng <n> Required, -180..180\n --name <text>\n --address <text>\n\nEXAMPLES\n $ 1msg message location --to 12020721369 --lat 55.7558 --lng 37.6173 \\\n --name \"Red Square\" --address \"Moscow\"\n",
21
+ "message location-request": "USAGE\n 1msg message location-request [flags]\n\nFLAGS\n --to / --chat-id / --quote\n --text <body> Optional prompt\n\nEXAMPLES\n $ 1msg message location-request --to 12020721369 --text \"Share your location\"\n",
22
+ "message contact": "USAGE\n 1msg message contact --name <formatted> --phone <number> [flags]\n\nFLAGS\n --to / --chat-id / --quote\n --name <formatted> Required (formatted_name)\n --first-name <text>\n --last-name <text>\n --phone <number> Contact's phone (not the destination)\n --email <email>\n --org <company>\n --title <text>\n --url <url>\n --from-file <path> Full contact JSON (SendContactRequest)\n\nEXAMPLES\n $ 1msg message contact --to 12020721369 --name \"John Doe\" --phone +12020721369\n $ 1msg message contact --to 12020721369 --from-file contact.json\n",
23
+ "message buttons": "USAGE\n 1msg message buttons --text <body> --button <id:title> [flags]\n\nFLAGS\n --to / --chat-id / --quote\n --text <body> Required, max 1024\n --footer <text> Max 60\n --button <id:title> Repeatable, max 3\n --from-file <path> Full SendButtonRequest JSON\n\nEXAMPLES\n $ 1msg message buttons --to 12020721369 --text \"Choose:\" \\\n --button yes:Yes --button no:No\n $ 1msg message buttons --to 12020721369 --from-file buttons.json\n",
24
+ "message menu": "USAGE\n 1msg message menu --from-file <path> [flags]\n\nAPI requires body, buttonText, and sections[]. sections[] is nested JSON,\nso --from-file is required. --text / --button-text / --title / --footer\noverride the file when set. Destination may be on the CLI or in the file.\n\nFLAGS\n --to / --chat-id / --quote\n --from-file <path> Required. `-` = stdin. Public sendList body\n --text <body> Override body (max 1024)\n --button-text <text> Override list button label (max 20)\n --title <text> Max 60\n --footer <text> Max 60\n\nEXAMPLES\n $ 1msg message menu --to 12020721369 --from-file menu.json\n $ 1msg message menu --from-file menu.json --text \"Pick one\" --button-text \"Open\"\n",
25
+ "message carousel": "USAGE\n 1msg message carousel --from-file <path> [flags]\n\nFLAGS\n --to / --chat-id / --quote\n --text <body> Text above the carousel\n --from-file <path> Required. JSON with cards[] and/or params[]\n\nEXAMPLES\n $ 1msg message carousel --to 12020721369 --from-file carousel.json\n $ 1msg message carousel --to 12020721369 --text \"Pick a product\" --from-file cards.json\n",
26
+ "message product": "USAGE\n 1msg message product [flags]\n\nExactly one of: --from-file, or --catalog-id plus --product-id (single product).\nProduct lists use --from-file (action.sections).\n\nFLAGS\n --to / --chat-id / --quote\n --text <body>\n --header <text> Product list only\n --footer <text>\n --catalog-id <id>\n --product-id <retailer-id> Single product (action.product_retailer_id)\n --from-file <path> Full body including action\n\nEXAMPLES\n $ 1msg message product --to 12020721369 --catalog-id 448008021021719 --product-id 0001\n $ 1msg message product --to 12020721369 --from-file product-list.json\n",
27
+ "message cta": "USAGE\n 1msg message cta --text <body> --button <label> --url <https> [flags]\n\nFLAGS\n --to / --chat-id / --quote\n --text <body> Required → body\n --button <label> Required → displayText\n --url <https> Required\n --footer <text>\n --from-file <path> Optional header object and extras\n\nEXAMPLES\n $ 1msg message cta --to 12020721369 --text \"See details\" \\\n --button \"Open site\" --url https://example.com\n",
28
+ "message address": "USAGE\n 1msg message address --text <body> --country <IN|SG> [flags]\n\nFLAGS\n --to / --chat-id / --quote\n --text <body> Required\n --country <IN|SG> Default IN\n --from-file <path> Optional values / saved_addresses /\n validation_errors\n\nEXAMPLES\n $ 1msg message address --to 919876543210 --text \"Delivery address?\" --country IN\n $ 1msg message address --to 6531650115 --text \"Delivery address?\" --country SG\n",
29
+ "message order": "USAGE\n 1msg message order --from-file <path> [flags]\n\nAPI requires template, namespace, language, and order (order.items required).\n\nFLAGS\n --to / --chat-id\n --name <template> Utility template name\n --lang <code>\n --namespace <id>\n --reference-id <id>\n --currency <code> e.g. INR\n --from-file <path> Required for order / paymentSettings / extra params\n\nEXAMPLES\n $ 1msg message order --to 919876543210 --name order_details_utility \\\n --lang en --namespace YOUR_NS --from-file order.json\n",
30
+ "message payment": "USAGE\n 1msg message payment --to <phone> --region <IN|SG|BR> [flags]\n\nFLAGS\n --to <phone> Required (API phone, not chatId)\n --region <IN|SG|BR> Required\n --text <body>\n --from-file <path> interactive / action objects\n\nEXAMPLES\n $ 1msg message payment --to 919876543210 --region IN --text \"Pay now\" \\\n --from-file payment.json\n",
31
+ "message sticker": "USAGE\n 1msg message sticker [flags]\n\nExactly one source: --link, --media-id, or --file.\n\nFLAGS\n --to / --chat-id / --quote\n --link <https> Public webp URL\n --media-id <id> From `1msg media upload`\n --file <path> Local webp: uploadMedia, then send with mediaId\n\nEXAMPLES\n $ 1msg message sticker --to 12020721369 --link https://example.com/sticker.webp\n $ 1msg message sticker --to 12020721369 --file ./sticker.webp\n $ 1msg message sticker --to 12020721369 --media-id 123456\n",
32
+ "message flow": "USAGE\n 1msg message flow --text <body> --flow-id <id> --flow-token <token> --cta <text> [flags]\n\nFLAGS\n --to / --chat-id / --quote\n --text <body> Required\n --flow-id <id> Required (published Flow id)\n --flow-token <token> Required (business-generated)\n --cta <text> Required (flowCta)\n --header <text>\n --footer <text>\n --action <navigate|data_exchange>\n --screen <id> flowActionPayload.screen (navigate)\n --mode <draft|published>\n --from-file <path> flowActionPayload / extra fields\n\nEXAMPLES\n $ 1msg message flow --to 12020721369 --text \"Open form\" --flow-id FLOW123 \\\n --flow-token tok --cta \"Start\" --action navigate --screen WELCOME\n",
33
+ "template": "Message templates (work outside the 24-hour session window).\n\nUSAGE\n 1msg template <command> [flags]\n\nCOMMANDS\n list GET /templates\n send POST /sendTemplate\n add POST /addTemplate\n remove POST /removeTemplate\n",
34
+ "template list": "1msg template list [flags]\nFLAGS\n --limit <n>\n --offset <n>\n --sort <id|name|status>\n\nCOLUMNS\n name status language category id\n footer: total N\n\nEXAMPLES\n $ 1msg template list\n $ 1msg template list --sort name --json\n",
35
+ "template send": "1msg template send [flags]\nFLAGS\n --to / --chat-id / --quote\n --name <template> Template name (not HSM element_name)\n --lang <code> e.g. en, ru (policy=deterministic)\n --namespace <id>\n --params <json> Cloud API components array (not a string list)\n --params-file <path> Same JSON from file\n --mm-lite Force Marketing Messages API\n --activity-sharing Click-tracking webhooks (MM Lite path)\n --ttl <seconds> message_send_ttl_seconds\n\nEXAMPLES\n $ 1msg template send --to 12020721369 --name hello_world --lang en \\\n --params '[{\"type\":\"body\",\"parameters\":[{\"type\":\"text\",\"text\":\"Ivan\"}]}]'\n",
36
+ "template add": "1msg template add --from-file <path> [flags]\n\n--from-file is required. The JSON must include components[] (HEADER / BODY /\nFOOTER / BUTTONS). Optional flags override scalar fields in the file.\n\nFLAGS\n --from-file <path> Required. `-` = stdin\n --name <name> Override file name\n --category <MARKETING|UTILITY|AUTHENTICATION>\n --language <code> Override file language (e.g. en_US)\n\nEXAMPLES\n $ 1msg template add --from-file hello_world.json\n $ 1msg template add --from-file hello_world.json --name hello_world_v2\n\nExit 1 if --from-file is missing or components[] is absent.\n\n1msg template remove --name hello_world\n\nEXAMPLES\n $ 1msg template remove --name hello_world\n",
37
+ "template remove": "1msg template add --from-file <path> [flags]\n\n--from-file is required. The JSON must include components[] (HEADER / BODY /\nFOOTER / BUTTONS). Optional flags override scalar fields in the file.\n\nFLAGS\n --from-file <path> Required. `-` = stdin\n --name <name> Override file name\n --category <MARKETING|UTILITY|AUTHENTICATION>\n --language <code> Override file language (e.g. en_US)\n\nEXAMPLES\n $ 1msg template add --from-file hello_world.json\n $ 1msg template add --from-file hello_world.json --name hello_world_v2\n\nExit 1 if --from-file is missing or components[] is absent.\n\n1msg template remove --name hello_world\n\nEXAMPLES\n $ 1msg template remove --name hello_world\n",
38
+ "me": "WhatsApp Business profile (GET /me, POST /me).\n\nUSAGE\n 1msg me [flags]\n 1msg me update [flags]\n\nFLAGS (update; at least one required)\n --about <text>\n --address <text>\n --description <text>\n --email <email>\n --vertical <text> ProfileInfo industry enum (e.g. \"Food and Grocery\")\n --photo <url|data-uri>\n --website <url> Repeatable → websites[]\n\nEXAMPLES\n $ 1msg me\n $ 1msg me --json\n $ 1msg me update --about \"Available 9–18\" --email support@example.com\n",
39
+ "media": "WABA media storage.\n\nUSAGE\n 1msg media <command> [flags]\n\nCOMMANDS\n upload POST /uploadMedia — prints mediaId\n get GET /retrieveMedia — metadata + temporary url (~5 min)\n delete DELETE /media/{mediaId}\n\nEXAMPLES\n $ 1msg media upload --file ./photo.jpg\n $ 1msg media upload --url https://example.com/a.pdf\n $ 1msg media get --id 123456\n $ 1msg media delete --id 123456\n\nFLAGS (upload)\n --file <path> Local file → data URI in body (public uploadMedia)\n --url <https> Public URL (API field url / body)\n\nPublic uploadMedia accepts URL or data URI, not multipart. Unused\nshared UploadMediaRequest.yaml (file + MIME enum) is not this endpoint.\n\nPOST /deleteMedia (deleteMediaLegacy) is not exposed.\n\nEXAMPLES\n $ 1msg media upload --file ./photo.jpg\n $ 1msg media upload --url https://example.com/a.pdf\n $ 1msg media get --id 123456\n $ 1msg media delete --id 123456\n",
40
+ "group": "USAGE\n 1msg group <command> [flags]\n\nCOMMANDS\n list GET /groups\n create POST /groups\n get <group-id> GET /groups/{groupId}\n update <group-id> POST /groups/{groupId}\n delete <group-id> DELETE /groups/{groupId}\n invite-link <id> GET /groups/{groupId}/inviteLink\n invite-link reset <id> POST /groups/{groupId}/inviteLink\n\ngroup-id is the WABA group id without @g.us.\n\nFLAGS (list)\n --limit <n> --before <cursor> --after <cursor>\n\nFLAGS (create)\n --name <subject> Required (groupName)\n --description <text>\n\nFLAGS (get)\n --fields <csv>\n\nFLAGS (update)\n --subject <text>\n --description <text>\n --picture <url|data-uri>\n\nCOLUMNS (list)\n id subject\n\nEXAMPLES\n $ 1msg group list\n $ 1msg group create --name \"Support team\" --description \"Customer support\"\n $ 1msg group get 120363046942338209\n $ 1msg group update 120363046942338209 --subject \"Support\"\n $ 1msg group invite-link 120363046942338209\n $ 1msg group invite-link reset 120363046942338209\n $ 1msg group delete 120363046942338209\n",
41
+ "flow": "WhatsApp Flows. Some endpoints currently return HTTP 501 until the Meta\nGraph Flows rewrite is available — the CLI still exposes them and prints\nthe API error.\n\nUSAGE\n 1msg flow <command> [flags]\n\nCOMMANDS\n list GET /flows\n create POST /flows\n get <flow-id> GET /flows/{flowId}\n delete <flow-id> DELETE /flows/{flowId}\n preview <flow-id> GET /flows/{flowId}/preview\n publish <flow-id> POST /flows/{flowId}/publish\n deprecate <flow-id> POST /flows/{flowId}/deprecate\n metadata <flow-id> PATCH /flows/{flowId}/metadata\n assets <flow-id> PATCH /flows/{flowId}/assets (replace flowJson)\n encryption GET /whatsapp_business_encryption\n encryption set POST /whatsapp_business_encryption\n\nFLAGS (all flow API commands)\n --waba-account-id <id> Query wabaAccountId\n\nFLAGS (list)\n --fields <csv>\n\nFLAGS (create)\n --name <name> Required\n --category <ENUM> Repeatable: SIGN_UP, SIGN_IN,\n APPOINTMENT_BOOKING, LEAD_GENERATION,\n CONTACT_US, CUSTOMER_SUPPORT, SURVEY, OTHER\n --endpoint <uri>\n --publish Publish immediately\n --json-file <path> flowJson document\n\nFLAGS (metadata)\n --name --category --endpoint\n\nFLAGS (assets)\n --json-file <path> Required flowJson\n\nFLAGS (encryption set)\n --pem-file <path> 2048-bit RSA public key PEM\n\nCOLUMNS (list)\n id name status categories\n\nEXAMPLES\n $ 1msg flow list\n $ 1msg flow create --name lead_form --category LEAD_GENERATION\n $ 1msg flow get FLOW123\n $ 1msg flow publish FLOW123\n $ 1msg flow assets FLOW123 --json-file flow.json\n $ 1msg flow encryption\n $ 1msg flow encryption set --pem-file business.pem\n",
42
+ "webhook": "USAGE\n 1msg webhook get\n 1msg webhook set --url <https> [--url <https> ...]\n 1msg webhook clear\n\nset replaces the stored list (max 5). It does not append.\nclear calls POST /settings with an empty webhookUrl (setWebhook rejects empty).\n\nEXAMPLES\n $ 1msg webhook get\n $ 1msg webhook set --url https://example.com/webhook\n $ 1msg webhook set --url https://a.example/hook --url https://b.example/hook\n $ 1msg webhook clear\n",
43
+ "user": "USAGE\n 1msg user blocked GET /blockedUsers\n 1msg user block --to <phone> POST /blockUser\n 1msg user unblock --to <phone> POST /unblockUser\n\nCOLUMNS (blocked)\n phone\n\nEXAMPLES\n $ 1msg user blocked\n $ 1msg user block --to 12020721369\n $ 1msg user unblock --to 12020721369\n",
44
+ "catalog": "USAGE\n 1msg catalog get\n 1msg catalog set --cart --visible\n 1msg catalog set --no-cart --no-visible\n\nget → GET /commerce\nset → POST /commerce with params.is_cart_enabled and params.is_catalog_visible\n (both required by the API)\n\nFails when the WABA has no catalog linked — that is an account limit, not a CLI bug.\n\nCOLUMNS (get)\n id cart visible\n\nEXAMPLES\n $ 1msg catalog get\n $ 1msg catalog set --cart --visible\n $ 1msg catalog set --no-cart --no-visible\n",
45
+ "call": "WhatsApp Calling API (beta). 1msg proxies signaling only. Real media needs\nyour own WebRTC or SIP stack. Trial / subscriptionBlocked → HTTP 403.\n\nUSAGE\n 1msg call settings GET /callingSettings\n 1msg call settings set --from-file <path>\n 1msg call connect --to <phone> --sdp-file <offer.sdp> [--callback-data <str>]\n 1msg call pre-accept --call-id <id> --sdp-file <answer.sdp>\n 1msg call accept --call-id <id> --sdp-file <answer.sdp>\n 1msg call reject --call-id <id>\n 1msg call hangup --call-id <id>\n\nAll call-control commands POST /initiateCall. The CLI always sets\nmessaging_product=whatsapp (required by the API; not a user flag).\n\n connect action=connect requires --to + --sdp-file (sdp_type=offer)\n pre-accept action=pre_accept requires --call-id + --sdp-file (sdp_type=answer)\n accept action=accept requires --call-id + --sdp-file (sdp_type=answer)\n reject action=reject requires --call-id\n hangup action=terminate requires --call-id\n\nDo not echo Meta's offer SDP as the answer.\nsettings set body is forwarded as-is (CallingSettings). Prefer focused\nupdates (enable status first, then SIP).\n\nEXAMPLES\n $ 1msg call settings\n $ 1msg call settings set --from-file calling.json\n $ 1msg call connect --to 12185552828 --sdp-file offer.sdp\n $ 1msg call accept --call-id wacid.ABGG… --sdp-file answer.sdp\n $ 1msg call hangup --call-id wacid.ABGG…\n",
46
+ "completion": "Print a completion script to stdout. The CLI never writes into /etc or $fpath\nby itself — redirect the script, then reload the shell.\n\nUSAGE\n 1msg completion <bash|zsh|powershell>\n\nWHAT IS COMPLETED\n commands, subcommands, flags always (from the command tree)\n channel names (-c / --channel / channel use / remove)\n keys of channels: in ~/.config/1msg/config.yaml\n (local file, no API call)\n template names (template send --name, template remove --name)\n from the completion cache written after a\n successful `1msg template list` (see below)\n flow ids / group ids not cached; type them\n\nTEMPLATE CACHE\n File: ~/.cache/1msg/completion.json\n Windows: %LOCALAPPDATA%\\1msg\\completion.json\n Shape: { \"updated_at\": \"<iso>\", \"channel\": \"<config name>\", \"templates\": [\"hello_world\", …] }\n Written only after `template list` exits 0. Names are unique `templates[].name`.\n Completing --name with no cache: no values (commands/flags still complete).\n Cache is per default channel name; switching `channel use` without a new\n `template list` may show stale names — run `1msg template list` again.\n\nINSTALL — Bash\n User (no sudo):\n mkdir -p ~/.local/share/bash-completion/completions\n 1msg completion bash > ~/.local/share/bash-completion/completions/1msg\n Linux system:\n 1msg completion bash | sudo tee /etc/bash_completion.d/1msg\n macOS Homebrew:\n 1msg completion bash > \"$(brew --prefix)/etc/bash_completion.d/1msg\"\n Then: source ~/.bashrc # or open a new terminal\n\nINSTALL — Zsh\n mkdir -p ~/.zsh/completions\n 1msg completion zsh > ~/.zsh/completions/_1msg\n # once in ~/.zshrc:\n # fpath=($HOME/.zsh/completions $fpath)\n # autoload -U compinit && compinit\n Then: exec zsh\n Do not write to ${fpath[1]} — that path is not stable.\n\nINSTALL — PowerShell\n $dir = Split-Path $PROFILE\n New-Item -ItemType Directory -Force $dir | Out-Null\n 1msg completion powershell | Out-File -Encoding utf8 (Join-Path $dir 1msg.ps1)\n # once in $PROFILE:\n # . (Join-Path (Split-Path $PROFILE) '1msg.ps1')\n Then: . $PROFILE\n\nEXAMPLES\n $ 1msg completion bash > ~/.local/share/bash-completion/completions/1msg\n $ 1msg completion zsh > ~/.zsh/completions/_1msg\n $ 1msg completion powershell | Out-File 1msg.ps1\n",
47
+ "version": "USAGE\n 1msg version\n 1msg -v\n\nPrints CLI version and the `@1msg/sdk` version used for HTTP.\n\nEXAMPLES\n $ 1msg version\n $ 1msg -v\n",
48
+ "channel status": "USAGE\n 1msg status [flags]\n 1msg channel status [flags]\n\nPrints connection status (typically `connected` when the number can send),\naccountStatus, and mm_lite_available.\n\nEXAMPLES\n $ 1msg status\n $ 1msg status --json\n $ 1msg -c acme-test status\n\nCOLUMNS (human)\n key-value: status, accountStatus, mm_lite_available\n"
49
+ };
50
+ function helpFor(path) {
51
+ if (!path || path === 'root')
52
+ return exports.HELP_TEXT.root;
53
+ return exports.HELP_TEXT[path];
54
+ }
55
+ //# sourceMappingURL=help-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help-text.js","sourceRoot":"","sources":["../src/help-text.ts"],"names":[],"mappings":";;;AA8CA,0BAGC;AAjDD,gFAAgF;AACnE,QAAA,SAAS,GAA2B;IAC/C,MAAM,EAAE,2jFAA2jF;IACnkF,MAAM,EAAE,82BAA82B;IACt3B,SAAS,EAAE,uzFAAuzF;IACl0F,aAAa,EAAE,0mBAA0mB;IACznB,cAAc,EAAE,moBAAmoB;IACnpB,aAAa,EAAE,spCAAspC;IACrqC,QAAQ,EAAE,iVAAiV;IAC3V,MAAM,EAAE,6tDAA6tD;IACruD,cAAc,EAAE,6tDAA6tD;IAC7uD,SAAS,EAAE,glCAAglC;IAC3lC,cAAc,EAAE,kmBAAkmB;IAClnB,cAAc,EAAE,oZAAoZ;IACpa,eAAe,EAAE,ycAAyc;IAC1d,kBAAkB,EAAE,yYAAyY;IAC7Z,0BAA0B,EAAE,8OAA8O;IAC1Q,iBAAiB,EAAE,qnBAAqnB;IACxoB,iBAAiB,EAAE,8fAA8f;IACjhB,cAAc,EAAE,wwBAAwwB;IACxxB,kBAAkB,EAAE,+ZAA+Z;IACnb,iBAAiB,EAAE,6oBAA6oB;IAChqB,aAAa,EAAE,mfAAmf;IAClgB,iBAAiB,EAAE,4fAA4f;IAC/gB,eAAe,EAAE,+jBAA+jB;IAChlB,iBAAiB,EAAE,+YAA+Y;IACla,iBAAiB,EAAE,siBAAsiB;IACzjB,cAAc,EAAE,wxBAAwxB;IACxyB,UAAU,EAAE,iSAAiS;IAC7S,eAAe,EAAE,gQAAgQ;IACjR,eAAe,EAAE,0uBAA0uB;IAC3vB,cAAc,EAAE,quBAAquB;IACrvB,iBAAiB,EAAE,quBAAquB;IACxvB,IAAI,EAAE,0hBAA0hB;IAChiB,OAAO,EAAE,w9BAAw9B;IACj+B,OAAO,EAAE,mnCAAmnC;IAC5nC,MAAM,EAAE,00DAA00D;IACl1D,SAAS,EAAE,ybAAyb;IACpc,MAAM,EAAE,oTAAoT;IAC5T,SAAS,EAAE,6eAA6e;IACxf,MAAM,EAAE,o6CAAo6C;IAC56C,YAAY,EAAE,85EAA85E;IAC56E,SAAS,EAAE,gJAAgJ;IAC3J,gBAAgB,EAAE,iVAAiV;CACpW,CAAC;AAEF,SAAgB,OAAO,CAAC,IAAY;IAClC,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,iBAAS,CAAC,IAAI,CAAC;IACpD,OAAO,iBAAS,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const run_1 = require("./run");
5
+ (0, run_1.runCli)(process.argv.slice(2))
6
+ .then((code) => {
7
+ if (code !== 0)
8
+ process.exitCode = code;
9
+ })
10
+ .catch((error) => {
11
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
12
+ process.exitCode = 1;
13
+ });
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,+BAA+B;AAE/B,IAAA,YAAM,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KAC1B,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;IACb,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC1C,CAAC,CAAC;KACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
package/dist/io.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import type { CliContext } from './context';
2
+ export declare function mimeFromName(filename: string): string;
3
+ export declare function isHttpUrl(value: string): boolean;
4
+ export declare function fileToDataUri(contents: Buffer, filename: string): string;
5
+ export declare function readFromFile(ctx: CliContext, filePath: string | undefined): Promise<string | undefined>;
6
+ export declare function readJsonFile(ctx: CliContext, filePath: string | undefined): Promise<Record<string, unknown>>;
7
+ export declare function readJsonValue(ctx: CliContext, filePath: string | undefined): Promise<unknown>;
8
+ export declare function parseJsonFlag(raw: string | undefined, flag: string): unknown;
9
+ export declare function readBinaryFile(ctx: CliContext, filePath: string): Buffer;
10
+ export declare function basenameOf(filePath: string): string;
11
+ export declare function splitOnce(value: string, sep: string): [string, string];
12
+ export declare function collect(value: string, previous?: string[]): string[];
13
+ export declare function parseInteger(raw: string | number | undefined, flag: string): number | undefined;
14
+ //# sourceMappingURL=io.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AA0B5C,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wBAAsB,YAAY,CAChC,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAK7B;AAED,wBAAsB,YAAY,CAChC,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAelC;AAED,wBAAsB,aAAa,CACjC,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAAC,OAAO,CAAC,CASlB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAO5E;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIxE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAItE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAExE;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK/F"}
package/dist/io.js ADDED
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.mimeFromName = mimeFromName;
7
+ exports.isHttpUrl = isHttpUrl;
8
+ exports.fileToDataUri = fileToDataUri;
9
+ exports.readFromFile = readFromFile;
10
+ exports.readJsonFile = readJsonFile;
11
+ exports.readJsonValue = readJsonValue;
12
+ exports.parseJsonFlag = parseJsonFlag;
13
+ exports.readBinaryFile = readBinaryFile;
14
+ exports.basenameOf = basenameOf;
15
+ exports.splitOnce = splitOnce;
16
+ exports.collect = collect;
17
+ exports.parseInteger = parseInteger;
18
+ const path_1 = __importDefault(require("path"));
19
+ const errors_1 = require("./errors");
20
+ const paths_1 = require("./paths");
21
+ const MIME_BY_EXT = {
22
+ '.jpg': 'image/jpeg',
23
+ '.jpeg': 'image/jpeg',
24
+ '.png': 'image/png',
25
+ '.gif': 'image/gif',
26
+ '.webp': 'image/webp',
27
+ '.pdf': 'application/pdf',
28
+ '.mp4': 'video/mp4',
29
+ '.mp3': 'audio/mpeg',
30
+ '.ogg': 'audio/ogg',
31
+ '.oga': 'audio/ogg',
32
+ '.opus': 'audio/ogg',
33
+ '.wav': 'audio/wav',
34
+ '.txt': 'text/plain',
35
+ '.json': 'application/json',
36
+ '.csv': 'text/csv',
37
+ '.doc': 'application/msword',
38
+ '.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
39
+ '.xls': 'application/vnd.ms-excel',
40
+ '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
41
+ };
42
+ function mimeFromName(filename) {
43
+ const ext = path_1.default.extname(filename).toLowerCase();
44
+ return MIME_BY_EXT[ext] || 'application/octet-stream';
45
+ }
46
+ function isHttpUrl(value) {
47
+ return /^https?:\/\//i.test(value.trim());
48
+ }
49
+ function fileToDataUri(contents, filename) {
50
+ return `data:${mimeFromName(filename)};base64,${contents.toString('base64')}`;
51
+ }
52
+ async function readFromFile(ctx, filePath) {
53
+ if (!filePath)
54
+ return undefined;
55
+ if (filePath === '-')
56
+ return ctx.readStdin();
57
+ const resolved = (0, paths_1.resolveUserPath)(ctx, filePath);
58
+ return ctx.fs.readFileSync(resolved, 'utf8').toString();
59
+ }
60
+ async function readJsonFile(ctx, filePath) {
61
+ const raw = await readFromFile(ctx, filePath);
62
+ if (raw === undefined)
63
+ return {};
64
+ const trimmed = raw.trim();
65
+ if (!trimmed)
66
+ return {};
67
+ try {
68
+ const parsed = JSON.parse(trimmed);
69
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
70
+ (0, errors_1.usage)('JSON file must contain an object');
71
+ }
72
+ return parsed;
73
+ }
74
+ catch (error) {
75
+ if (error instanceof SyntaxError)
76
+ (0, errors_1.usage)(`invalid JSON: ${error.message}`);
77
+ throw error;
78
+ }
79
+ }
80
+ async function readJsonValue(ctx, filePath) {
81
+ const raw = await readFromFile(ctx, filePath);
82
+ if (raw === undefined)
83
+ return undefined;
84
+ try {
85
+ return JSON.parse(raw);
86
+ }
87
+ catch (error) {
88
+ if (error instanceof SyntaxError)
89
+ (0, errors_1.usage)(`invalid JSON: ${error.message}`);
90
+ throw error;
91
+ }
92
+ }
93
+ function parseJsonFlag(raw, flag) {
94
+ if (raw === undefined)
95
+ return undefined;
96
+ try {
97
+ return JSON.parse(raw);
98
+ }
99
+ catch {
100
+ (0, errors_1.usage)(`${flag} must be valid JSON`);
101
+ }
102
+ }
103
+ function readBinaryFile(ctx, filePath) {
104
+ const resolved = (0, paths_1.resolveUserPath)(ctx, filePath);
105
+ const data = ctx.fs.readFileSync(resolved);
106
+ return Buffer.isBuffer(data) ? data : Buffer.from(String(data));
107
+ }
108
+ function basenameOf(filePath) {
109
+ return path_1.default.basename(filePath);
110
+ }
111
+ function splitOnce(value, sep) {
112
+ const index = value.indexOf(sep);
113
+ if (index === -1)
114
+ return [value, ''];
115
+ return [value.slice(0, index), value.slice(index + sep.length)];
116
+ }
117
+ function collect(value, previous = []) {
118
+ return [...previous, value];
119
+ }
120
+ function parseInteger(raw, flag) {
121
+ if (raw === undefined || raw === '')
122
+ return undefined;
123
+ const n = typeof raw === 'number' ? raw : Number(raw);
124
+ if (!Number.isFinite(n))
125
+ (0, errors_1.usage)(`${flag} must be a number`);
126
+ return n;
127
+ }
128
+ //# sourceMappingURL=io.js.map
package/dist/io.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"io.js","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings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AAC,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,SAAgB,OAAO,CAAC,KAAa,EAAE,WAAqB,EAAE;IAC5D,OAAO,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,SAAgB,YAAY,CAAC,GAAgC,EAAE,IAAY;IACzE,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IACtD,MAAM,CAAC,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACtD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,IAAA,cAAK,EAAC,GAAG,IAAI,mBAAmB,CAAC,CAAC;IAC3D,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { Command } from 'commander';
2
+ import type { CliContext } from './context';
3
+ import { type GlobalFlags } from './config';
4
+ export declare function globalsFrom(cmd: Command): GlobalFlags;
5
+ export declare function writeHelp(ctx: CliContext, path: string): void;
6
+ export declare function resolveHelp(path: string): string;
7
+ export declare function missingSubcommand(ctx: CliContext, helpPath: string): never;
8
+ export declare function handleInit(ctx: CliContext, cmd: Command, opts: {
9
+ name?: string;
10
+ baseUrl?: string;
11
+ instanceId?: string;
12
+ tokenStdin?: boolean;
13
+ verify?: boolean;
14
+ }): Promise<number>;
15
+ export declare function handleChannelAdd(ctx: CliContext, cmd: Command, opts: {
16
+ name?: string;
17
+ baseUrl?: string;
18
+ instanceId?: string;
19
+ tokenStdin?: boolean;
20
+ default?: boolean;
21
+ verify?: boolean;
22
+ }): Promise<number>;
23
+ export declare function handleChannelList(ctx: CliContext, cmd: Command): number;
24
+ export declare function handleChannelUse(ctx: CliContext, nameOrId: string | undefined): number;
25
+ export declare function handleChannelRemove(ctx: CliContext, name: string | undefined): number;
26
+ export declare function handleChannelCurrent(ctx: CliContext, cmd: Command): number;
27
+ export declare function handleVersion(ctx: CliContext): number;
28
+ export declare function handleCompletion(ctx: CliContext, shell: string | undefined): number;
29
+ export declare function handleCompleteQuery(ctx: CliContext, kind: string | undefined): number;
30
+ //# sourceMappingURL=local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../src/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EASL,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAUlB,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAUrD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAG7D;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAShD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAG1E;AA8FD,wBAAsB,UAAU,CAC9B,GAAG,EAAE,UAAU,EACf,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE;IACJ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,OAAO,CAAC,MAAM,CAAC,CAajB;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,UAAU,EACf,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE;IACJ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO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