@chatlychat/cli 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/output.js ADDED
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Rendering. Two modes, and the choice is the caller's, not ours.
3
+ *
4
+ * Default: a table a person reads. `--json`: the raw API response, unmodified,
5
+ * so a script can pipe it to `jq`. The second one matters more than it looks —
6
+ * a CLI that only pretty-prints cannot be used in a pipeline, and a CLI that
7
+ * only emits JSON is unpleasant to use by hand.
8
+ */
9
+ export function printJson(value) {
10
+ process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
11
+ }
12
+ /** Pick a handful of fields out of an unknown object, in order, as strings. */
13
+ function cell(row, key) {
14
+ if (typeof row !== 'object' || row === null) {
15
+ return '';
16
+ }
17
+ const value = row[key];
18
+ if (value === null || value === undefined) {
19
+ return '';
20
+ }
21
+ if (typeof value === 'object') {
22
+ return JSON.stringify(value);
23
+ }
24
+ return String(value);
25
+ }
26
+ /**
27
+ * A fixed-width table. Width is computed from the content, and every cell is
28
+ * truncated to `max` so one 4KB message body cannot destroy the layout.
29
+ */
30
+ export function printTable(rows, columns, max = 48) {
31
+ if (rows.length === 0) {
32
+ process.stdout.write('(no results)\n');
33
+ return;
34
+ }
35
+ const clip = (s) => (s.length > max ? `${s.slice(0, max - 1)}…` : s);
36
+ const body = rows.map((r) => columns.map((c) => clip(cell(r, c).replace(/\s+/g, ' '))));
37
+ const widths = columns.map((c, i) => Math.max(c.length, ...body.map((r) => (r[i] ?? '').length)));
38
+ const line = (cells) => cells.map((v, i) => v.padEnd(widths[i] ?? 0)).join(' ').trimEnd();
39
+ process.stdout.write(`${line(columns.map((c) => c.toUpperCase()))}\n`);
40
+ process.stdout.write(`${widths.map((w) => '─'.repeat(w)).join(' ')}\n`);
41
+ for (const r of body) {
42
+ process.stdout.write(`${line(r)}\n`);
43
+ }
44
+ process.stdout.write(`\n${String(rows.length)} row(s)\n`);
45
+ }
46
+ /** `{ items, nextCursor }` from a list endpoint, defensively. */
47
+ export function itemsOf(value) {
48
+ if (Array.isArray(value)) {
49
+ return value;
50
+ }
51
+ if (typeof value === 'object' && value !== null) {
52
+ const items = value['items'];
53
+ if (Array.isArray(items)) {
54
+ return items;
55
+ }
56
+ const data = value['data'];
57
+ if (Array.isArray(data)) {
58
+ return data;
59
+ }
60
+ }
61
+ return [];
62
+ }
63
+ export function nextCursorOf(value) {
64
+ if (typeof value === 'object' && value !== null) {
65
+ const c = value['nextCursor'];
66
+ if (typeof c === 'string' && c.length > 0) {
67
+ return c;
68
+ }
69
+ }
70
+ return null;
71
+ }
72
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC;AAED,+EAA+E;AAC/E,SAAS,IAAI,CAAC,GAAY,EAAE,GAAW;IACrC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC5C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,KAAK,GAAI,GAA+B,CAAC,GAAG,CAAC,CAAC;IACpD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED;;;GAGG;AACH,MAAM,UAA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,KAAK,IAAI,EAAE,CAAC;QAChD,MAAM,CAAC,GAAI,KAAiC,CAAC,YAAY,CAAC,CAAC;QAC3D,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1C,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/dist/run.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The CLI's behaviour, separated from the process it runs in.
3
+ *
4
+ * Dogfoods `@chatlychat/sdk-node`: every call here goes through the published
5
+ * SDK, so the CLI and a customer's own integration exercise the same
6
+ * transport, the same retry policy and the same error model. When the SDK's
7
+ * errors are unhelpful, we feel it first.
8
+ */
9
+ import { ChatlyClient } from '@chatlychat/sdk-node';
10
+ /**
11
+ * How a client is made. Injectable for tests ONLY.
12
+ *
13
+ * The CLI's whole value is that it goes through the published SDK, so a test
14
+ * that stubs the SDK would prove nothing. This seam replaces `fetch`, one
15
+ * level lower: the real `ChatlyClient`, the real transport, the real retry
16
+ * policy and the real error mapping all run, and only the socket is fake.
17
+ */
18
+ export type ClientFactory = (opts: {
19
+ apiKey: string;
20
+ apiUrl?: string;
21
+ }) => ChatlyClient;
22
+ export declare function run(argv: ReadonlyArray<string>, makeClient?: ClientFactory): Promise<number>;
23
+ /**
24
+ * One place that turns an error into an exit code and a sentence.
25
+ *
26
+ * A CLI whose failure mode is a stack trace is a CLI people stop trusting.
27
+ * The SDK's typed errors are the whole reason this can say something useful:
28
+ * 401 and 403 need different advice, and a transport failure is not an API
29
+ * failure at all.
30
+ */
31
+ export declare function explain(err: unknown): {
32
+ code: number;
33
+ message: string;
34
+ };
35
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAkB,YAAY,EAAwB,MAAM,sBAAsB,CAAC;AAc1F;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,YAAY,CAAC;AAIxF,wBAAsB,GAAG,CACvB,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,EAC3B,UAAU,GAAE,aAA8B,GACzC,OAAO,CAAC,MAAM,CAAC,CA8EjB;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAoBvE"}
package/dist/run.js ADDED
@@ -0,0 +1,122 @@
1
+ /**
2
+ * The CLI's behaviour, separated from the process it runs in.
3
+ *
4
+ * Dogfoods `@chatlychat/sdk-node`: every call here goes through the published
5
+ * SDK, so the CLI and a customer's own integration exercise the same
6
+ * transport, the same retry policy and the same error model. When the SDK's
7
+ * errors are unhelpful, we feel it first.
8
+ */
9
+ import { ChatlyApiError, ChatlyClient, ChatlyTransportError } from '@chatlychat/sdk-node';
10
+ import { bool, parseArgs, str } from './args.js';
11
+ import * as auth from './commands/auth.js';
12
+ import * as cmd from './commands/resources.js';
13
+ import { resolveCredentials } from './config.js';
14
+ import { HELP } from './help.js';
15
+ /** Bumped with the package. Printed by `--version`, which support will ask for. */
16
+ const VERSION = '0.1.0';
17
+ /** Commands that need no credential. Everything else resolves a key first. */
18
+ const UNAUTHENTICATED = new Set(['login', 'logout', 'help', 'version']);
19
+ const defaultFactory = (opts) => new ChatlyClient(opts);
20
+ export async function run(argv, makeClient = defaultFactory) {
21
+ const args = parseArgs(argv);
22
+ const command = args.path[0];
23
+ /*
24
+ * Version BEFORE the no-command branch.
25
+ *
26
+ * `chatly --version` parses to an empty command path with one flag, so a
27
+ * `command === undefined` check placed first swallows it and prints the
28
+ * help — which is what this did on its first run.
29
+ */
30
+ if (bool(args.flags, 'version') || command === 'version') {
31
+ process.stdout.write(`${VERSION}\n`);
32
+ return 0;
33
+ }
34
+ if (command === undefined || bool(args.flags, 'help') || bool(args.flags, 'h') || command === 'help') {
35
+ process.stdout.write(HELP);
36
+ return 0;
37
+ }
38
+ if (command === 'login') {
39
+ return auth.login(args);
40
+ }
41
+ if (command === 'logout') {
42
+ return auth.logout();
43
+ }
44
+ if (!UNAUTHENTICATED.has(command)) {
45
+ // Resolution order and the reason for it are in config.ts.
46
+ const creds = resolveCredentials(str(args.flags, 'key'), str(args.flags, 'api-url'));
47
+ const chatly = makeClient({
48
+ apiKey: creds.apiKey,
49
+ ...(creds.apiUrl === undefined ? {} : { apiUrl: creds.apiUrl }),
50
+ });
51
+ const json = bool(args.flags, 'json');
52
+ switch (command) {
53
+ case 'whoami':
54
+ return auth.whoami(chatly, json);
55
+ case 'conversations':
56
+ case 'conversation':
57
+ return cmd.conversations(chatly, args);
58
+ case 'contacts':
59
+ case 'contact':
60
+ return cmd.contacts(chatly, args);
61
+ case 'tickets':
62
+ case 'ticket':
63
+ return cmd.tickets(chatly, args);
64
+ case 'search':
65
+ return cmd.search(chatly, args);
66
+ case 'kb':
67
+ return cmd.kb(chatly, args);
68
+ case 'events':
69
+ case 'event':
70
+ return cmd.events(chatly, args);
71
+ case 'webhooks':
72
+ case 'webhook':
73
+ return cmd.webhooks(chatly, args);
74
+ case 'reports':
75
+ case 'report':
76
+ return cmd.reports(chatly, args);
77
+ case 'workspace':
78
+ return cmd.workspace(chatly, args);
79
+ case 'channels':
80
+ case 'channel':
81
+ return cmd.channels(chatly, args);
82
+ case 'billing':
83
+ return cmd.billing(chatly, args);
84
+ case 'api':
85
+ return cmd.api(chatly, args);
86
+ default:
87
+ process.stderr.write(`Unknown command "${command}". Run \`chatly --help\`.\n`);
88
+ return 2;
89
+ }
90
+ }
91
+ process.stdout.write(HELP);
92
+ return 0;
93
+ }
94
+ /**
95
+ * One place that turns an error into an exit code and a sentence.
96
+ *
97
+ * A CLI whose failure mode is a stack trace is a CLI people stop trusting.
98
+ * The SDK's typed errors are the whole reason this can say something useful:
99
+ * 401 and 403 need different advice, and a transport failure is not an API
100
+ * failure at all.
101
+ */
102
+ export function explain(err) {
103
+ if (err instanceof ChatlyApiError) {
104
+ const id = err.requestId === null ? '' : ` (request ${err.requestId})`;
105
+ const hint = err.status === 401
106
+ ? '\nThe key was rejected. Check it with `chatly whoami`, or run `chatly login` again.'
107
+ : err.status === 403
108
+ ? '\nThe key is valid but lacks a scope for this route. `chatly whoami` lists what it has.'
109
+ : err.status === 429
110
+ ? `\nRate limited.${err.retryAfter === null ? '' : ` Retry after ${String(err.retryAfter)}s.`}`
111
+ : '';
112
+ return { code: 1, message: `${err.message}${id}${hint}` };
113
+ }
114
+ if (err instanceof ChatlyTransportError) {
115
+ return {
116
+ code: 1,
117
+ message: `${err.message}\nThe request never reached Chatly — check the network and --api-url.`,
118
+ };
119
+ }
120
+ return { code: 1, message: err instanceof Error ? err.message : String(err) };
121
+ }
122
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE1F,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,IAAI,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,GAAG,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,mFAAmF;AACnF,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB,8EAA8E;AAC9E,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,M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CAAC,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC;IAC5D,CAAC;IACD,IAAI,GAAG,YAAY,oBAAoB,EAAE,CAAC;QACxC,OAAO;YACL,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,uEAAuE;SAC/F,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;AAChF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,56 @@
1
1
  {
2
2
  "name": "@chatlychat/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "The Chatly command line — inspect conversations, send replies, read reports and call any API route from a terminal.",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/chatlychat/chatly-cli#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/chatlychat/chatly-cli.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/chatlychat/chatly-cli/issues"
13
+ },
14
+ "keywords": [
15
+ "chatly",
16
+ "cli",
17
+ "live-chat",
18
+ "support",
19
+ "customer-messaging"
20
+ ],
21
+ "author": "Chatly",
22
+ "type": "module",
23
+ "bin": {
24
+ "chatly": "dist/main.js"
25
+ },
26
+ "files": [
27
+ "dist",
28
+ "README.md",
29
+ "LICENSE"
30
+ ],
31
+ "dependencies": {
32
+ "@chatlychat/sdk-node": "0.2.1"
33
+ },
34
+ "devDependencies": {
35
+ "@types/node": "20.14.10",
36
+ "tsx": "4.19.1",
37
+ "typescript": "5.6.2",
38
+ "vitest": "2.1.2",
39
+ "@livechat/config": "0.1.0"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public",
43
+ "registry": "https://registry.npmjs.org/",
44
+ "provenance": true
45
+ },
46
+ "engines": {
47
+ "node": ">=20"
48
+ },
49
+ "scripts": {
50
+ "build": "tsc -p tsconfig.json",
51
+ "dev": "tsx src/main.ts",
52
+ "typecheck": "tsc -p tsconfig.json --noEmit",
53
+ "lint": "eslint src --max-warnings=0",
54
+ "test": "vitest run"
55
+ }
6
56
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.