replylayer 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 (65) hide show
  1. package/dist/api-client.d.ts +54 -0
  2. package/dist/api-client.d.ts.map +1 -0
  3. package/dist/api-client.js +185 -0
  4. package/dist/api-client.js.map +1 -0
  5. package/dist/auth.d.ts +33 -0
  6. package/dist/auth.d.ts.map +1 -0
  7. package/dist/auth.js +85 -0
  8. package/dist/auth.js.map +1 -0
  9. package/dist/bin/replylayer.d.ts +3 -0
  10. package/dist/bin/replylayer.d.ts.map +1 -0
  11. package/dist/bin/replylayer.js +4 -0
  12. package/dist/bin/replylayer.js.map +1 -0
  13. package/dist/commands/account.d.ts +3 -0
  14. package/dist/commands/account.d.ts.map +1 -0
  15. package/dist/commands/account.js +47 -0
  16. package/dist/commands/account.js.map +1 -0
  17. package/dist/commands/api-key.d.ts +3 -0
  18. package/dist/commands/api-key.d.ts.map +1 -0
  19. package/dist/commands/api-key.js +75 -0
  20. package/dist/commands/api-key.js.map +1 -0
  21. package/dist/commands/auth.d.ts +3 -0
  22. package/dist/commands/auth.d.ts.map +1 -0
  23. package/dist/commands/auth.js +115 -0
  24. package/dist/commands/auth.js.map +1 -0
  25. package/dist/commands/inbox.d.ts +3 -0
  26. package/dist/commands/inbox.d.ts.map +1 -0
  27. package/dist/commands/inbox.js +95 -0
  28. package/dist/commands/inbox.js.map +1 -0
  29. package/dist/commands/mailbox.d.ts +3 -0
  30. package/dist/commands/mailbox.d.ts.map +1 -0
  31. package/dist/commands/mailbox.js +113 -0
  32. package/dist/commands/mailbox.js.map +1 -0
  33. package/dist/commands/recipients.d.ts +3 -0
  34. package/dist/commands/recipients.d.ts.map +1 -0
  35. package/dist/commands/recipients.js +50 -0
  36. package/dist/commands/recipients.js.map +1 -0
  37. package/dist/commands/reply.d.ts +3 -0
  38. package/dist/commands/reply.d.ts.map +1 -0
  39. package/dist/commands/reply.js +23 -0
  40. package/dist/commands/reply.js.map +1 -0
  41. package/dist/commands/send.d.ts +3 -0
  42. package/dist/commands/send.d.ts.map +1 -0
  43. package/dist/commands/send.js +28 -0
  44. package/dist/commands/send.js.map +1 -0
  45. package/dist/commands/signup.d.ts +3 -0
  46. package/dist/commands/signup.d.ts.map +1 -0
  47. package/dist/commands/signup.js +50 -0
  48. package/dist/commands/signup.js.map +1 -0
  49. package/dist/format.d.ts +26 -0
  50. package/dist/format.d.ts.map +1 -0
  51. package/dist/format.js +153 -0
  52. package/dist/format.js.map +1 -0
  53. package/dist/index.d.ts +7 -0
  54. package/dist/index.d.ts.map +1 -0
  55. package/dist/index.js +77 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/resolve.d.ts +14 -0
  58. package/dist/resolve.d.ts.map +1 -0
  59. package/dist/resolve.js +36 -0
  60. package/dist/resolve.js.map +1 -0
  61. package/dist/types.d.ts +48 -0
  62. package/dist/types.d.ts.map +1 -0
  63. package/dist/types.js +15 -0
  64. package/dist/types.js.map +1 -0
  65. package/package.json +41 -0
@@ -0,0 +1,115 @@
1
+ import { Command } from 'commander';
2
+ import readline from 'node:readline';
3
+ import { ApiClient } from '../api-client.js';
4
+ import { resolveApiKey, storeApiKey, deleteCredentialFile, getCredentialFilePath, requireApiKey, } from '../auth.js';
5
+ import { output } from '../format.js';
6
+ export function authCommand() {
7
+ const auth = new Command('auth').description('Manage authentication');
8
+ auth.addCommand(loginCommand());
9
+ auth.addCommand(logoutCommand());
10
+ auth.addCommand(rotateCommand());
11
+ auth.addCommand(statusCommand());
12
+ return auth;
13
+ }
14
+ function loginCommand() {
15
+ return new Command('login')
16
+ .description('Store an API key for authentication')
17
+ .action(async (_opts, cmd) => {
18
+ const opts = cmd.optsWithGlobals();
19
+ let apiKey;
20
+ if (!process.stdin.isTTY) {
21
+ // Reading from pipe/redirect
22
+ apiKey = await readStdin();
23
+ }
24
+ else {
25
+ apiKey = await promptApiKey();
26
+ }
27
+ apiKey = apiKey.trim();
28
+ if (!apiKey) {
29
+ console.error('Error: API key is required.');
30
+ process.exit(1);
31
+ }
32
+ storeApiKey(apiKey);
33
+ output({ stored: true, path: getCredentialFilePath() }, `API key stored in ${getCredentialFilePath()}`, opts.json);
34
+ });
35
+ }
36
+ function logoutCommand() {
37
+ return new Command('logout')
38
+ .description('Remove stored API key')
39
+ .action((_opts, cmd) => {
40
+ const opts = cmd.optsWithGlobals();
41
+ const deleted = deleteCredentialFile();
42
+ if (deleted) {
43
+ output({ deleted: true }, `Removed credentials from ${getCredentialFilePath()}`, opts.json);
44
+ }
45
+ else {
46
+ output({ deleted: false }, 'No credentials file found.', opts.json);
47
+ }
48
+ });
49
+ }
50
+ function rotateCommand() {
51
+ return new Command('rotate')
52
+ .description('Rotate your API key (revokes the current key)')
53
+ .action(async (_opts, cmd) => {
54
+ const opts = cmd.optsWithGlobals();
55
+ const apiKey = requireApiKey(opts.apiKey);
56
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
57
+ const result = await client.rotateKey();
58
+ storeApiKey(result.api_key);
59
+ output(result, `New API key: ${result.api_key} (stored in ${getCredentialFilePath()})`, opts.json);
60
+ });
61
+ }
62
+ function statusCommand() {
63
+ return new Command('status')
64
+ .description('Show authentication status')
65
+ .action((_opts, cmd) => {
66
+ const opts = cmd.optsWithGlobals();
67
+ const { apiKey, source } = resolveApiKey(opts.apiKey);
68
+ const data = {
69
+ authenticated: !!apiKey,
70
+ source,
71
+ key_preview: apiKey
72
+ ? apiKey.substring(0, 10) + '...' + apiKey.substring(apiKey.length - 4)
73
+ : null,
74
+ };
75
+ if (opts.json) {
76
+ console.log(JSON.stringify(data, null, 2));
77
+ }
78
+ else {
79
+ if (apiKey) {
80
+ console.log(`Authenticated: yes`);
81
+ console.log(`Source: ${source}`);
82
+ console.log(`Key: ${data.key_preview}`);
83
+ }
84
+ else {
85
+ console.log('Authenticated: no');
86
+ console.log('Run `replylayer auth login` or set REPLYLAYER_API_KEY to authenticate.');
87
+ }
88
+ }
89
+ });
90
+ }
91
+ function promptApiKey() {
92
+ return new Promise((resolve, reject) => {
93
+ const rl = readline.createInterface({
94
+ input: process.stdin,
95
+ output: process.stderr,
96
+ });
97
+ rl.question('API Key: ', (answer) => {
98
+ rl.close();
99
+ resolve(answer);
100
+ });
101
+ });
102
+ }
103
+ function readStdin() {
104
+ return new Promise((resolve) => {
105
+ let data = '';
106
+ process.stdin.setEncoding('utf-8');
107
+ process.stdin.on('data', (chunk) => {
108
+ data += chunk;
109
+ });
110
+ process.stdin.on('end', () => {
111
+ resolve(data);
112
+ });
113
+ });
114
+ }
115
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,UAAU,WAAW;IACzB,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAEtE,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;IAChC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IAEjC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,YAAY;IACnB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;SACxB,WAAW,CAAC,qCAAqC,CAAC;SAClD,MAAM,CAAC,KAAK,EA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C,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YACjC,IAAI,IAAI,KAAK,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function inboxCommand(): Command;
3
+ //# sourceMappingURL=inbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../../src/commands/inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,YAAY,IAAI,OAAO,CAQtC"}
@@ -0,0 +1,95 @@
1
+ import { Command } from 'commander';
2
+ import { ApiClient } from '../api-client.js';
3
+ import { requireApiKey } from '../auth.js';
4
+ import { resolveMailboxId } from '../resolve.js';
5
+ import { formatTable, formatMessage, formatMessageRow, output } from '../format.js';
6
+ export function inboxCommand() {
7
+ const inbox = new Command('inbox').description('Read and manage messages');
8
+ inbox.addCommand(listCommand());
9
+ inbox.addCommand(readCommand());
10
+ inbox.addCommand(waitCommand());
11
+ return inbox;
12
+ }
13
+ function listCommand() {
14
+ return new Command('list')
15
+ .description('List messages in a mailbox')
16
+ .requiredOption('--mailbox <name-or-id>', 'Mailbox name or UUID')
17
+ .option('--unread', 'Show unread messages only')
18
+ .option('--limit <n>', 'Maximum number of messages', '50')
19
+ .option('--sender <email>', 'Filter by sender email (partial match)')
20
+ .option('--since <iso-date>', 'Show messages created after this date (ISO 8601)')
21
+ .option('--until <iso-date>', 'Show messages created before this date (ISO 8601)')
22
+ .option('--search <term>', 'Search subject and body text')
23
+ .option('--status <state>', 'Filter by message state (e.g. available, quarantined)')
24
+ .option('--direction <dir>', 'Filter by direction (inbound or outbound)')
25
+ .action(async (_opts, cmd) => {
26
+ const opts = cmd.optsWithGlobals();
27
+ const localOpts = cmd.opts();
28
+ const apiKey = requireApiKey(opts.apiKey);
29
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
30
+ const mailboxId = await resolveMailboxId(client, localOpts.mailbox);
31
+ const result = await client.listMessages(mailboxId, {
32
+ unread: localOpts.unread || false,
33
+ limit: parseInt(localOpts.limit, 10),
34
+ sender: localOpts.sender,
35
+ since: localOpts.since,
36
+ until: localOpts.until,
37
+ search: localOpts.search,
38
+ status: localOpts.status,
39
+ direction: localOpts.direction,
40
+ });
41
+ const table = formatTable(['ID', 'FROM', 'SUBJECT', 'DATE', 'STATUS'], result.messages.map(formatMessageRow));
42
+ output(result, table, opts.json);
43
+ });
44
+ }
45
+ function readCommand() {
46
+ return new Command('read')
47
+ .description('Read a message')
48
+ .argument('<message-id>', 'Message UUID')
49
+ .action(async (messageId, _opts, cmd) => {
50
+ const opts = cmd.optsWithGlobals();
51
+ const apiKey = requireApiKey(opts.apiKey);
52
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
53
+ const result = await client.getMessage(messageId);
54
+ output(result, formatMessage(result), opts.json);
55
+ });
56
+ }
57
+ function waitCommand() {
58
+ return new Command('wait')
59
+ .description('Wait for a new message (long-poll)')
60
+ .requiredOption('--mailbox <name-or-id>', 'Mailbox name or UUID')
61
+ .option('--timeout <seconds>', 'Max seconds to wait', '30')
62
+ .action(async (_opts, cmd) => {
63
+ const opts = cmd.optsWithGlobals();
64
+ const localOpts = cmd.opts();
65
+ const apiKey = requireApiKey(opts.apiKey);
66
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
67
+ const mailboxId = await resolveMailboxId(client, localOpts.mailbox);
68
+ const totalTimeout = parseInt(localOpts.timeout, 10);
69
+ const startTime = Date.now();
70
+ const maxEndTime = startTime + totalTimeout * 1000;
71
+ // Long-poll reconnect loop: if server returns null, reconnect
72
+ while (Date.now() < maxEndTime) {
73
+ const remainingMs = maxEndTime - Date.now();
74
+ const pollTimeout = Math.min(30, Math.ceil(remainingMs / 1000));
75
+ if (pollTimeout <= 0)
76
+ break;
77
+ const result = await client.waitForMessage(mailboxId, pollTimeout);
78
+ if (result.message) {
79
+ const row = formatMessageRow(result.message);
80
+ const table = formatTable(['ID', 'FROM', 'SUBJECT', 'DATE', 'STATUS'], [row]);
81
+ output(result, table, opts.json);
82
+ return;
83
+ }
84
+ // Server returned null — reconnect immediately (unless we've exceeded total timeout)
85
+ }
86
+ // Timed out
87
+ if (opts.json) {
88
+ console.log(JSON.stringify({ message: null }, null, 2));
89
+ }
90
+ else {
91
+ console.log(`No new messages (timed out after ${totalTimeout}s)`);
92
+ }
93
+ });
94
+ }
95
+ //# sourceMappingURL=inbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../src/commands/inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEpF,MAAM,UAAU,YAAY;IAC1B,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;IAE3E,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;IAChC,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;IAChC,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;IAEhC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,WAAW;IAClB,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;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G,CAAC,CACN,CAAC;gBACF,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjC,OAAO;YACT,CAAC;YAED,qFAAqF;QACvF,CAAC;QAED,YAAY;QACZ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CACT,oCAAoC,YAAY,IAAI,CACrD,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function mailboxCommand(): Command;
3
+ //# sourceMappingURL=mailbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../src/commands/mailbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,cAAc,IAAI,OAAO,CASxC"}
@@ -0,0 +1,113 @@
1
+ import { Command } from 'commander';
2
+ import readline from 'node:readline';
3
+ import { ApiClient } from '../api-client.js';
4
+ import { requireApiKey } from '../auth.js';
5
+ import { resolveMailboxId } from '../resolve.js';
6
+ import { formatTable, output } from '../format.js';
7
+ export function mailboxCommand() {
8
+ const mailbox = new Command('mailbox').description('Manage mailboxes');
9
+ mailbox.addCommand(createCommand());
10
+ mailbox.addCommand(listCommand());
11
+ mailbox.addCommand(deleteCommand());
12
+ mailbox.addCommand(updateCommand());
13
+ return mailbox;
14
+ }
15
+ function createCommand() {
16
+ return new Command('create')
17
+ .description('Create a new mailbox')
18
+ .argument('<name>', 'Mailbox name (e.g., support-bot)')
19
+ .action(async (name, _opts, cmd) => {
20
+ const opts = cmd.optsWithGlobals();
21
+ const apiKey = requireApiKey(opts.apiKey);
22
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
23
+ const result = await client.createMailbox(name);
24
+ output(result, `Created mailbox: ${result.address}`, opts.json);
25
+ });
26
+ }
27
+ function listCommand() {
28
+ return new Command('list')
29
+ .description('List all mailboxes')
30
+ .action(async (_opts, cmd) => {
31
+ const opts = cmd.optsWithGlobals();
32
+ const apiKey = requireApiKey(opts.apiKey);
33
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
34
+ const result = await client.listMailboxes();
35
+ const table = formatTable(['NAME', 'ADDRESS', 'STATUS', 'CREATED'], result.mailboxes.map((m) => [
36
+ m.name,
37
+ m.address,
38
+ m.status,
39
+ m.created_at,
40
+ ]));
41
+ output(result, table, opts.json);
42
+ });
43
+ }
44
+ function deleteCommand() {
45
+ return new Command('delete')
46
+ .description('Delete a mailbox')
47
+ .argument('<name-or-id>', 'Mailbox name or UUID')
48
+ .option('-y, --yes', 'Skip confirmation prompt')
49
+ .action(async (nameOrId, _opts, cmd) => {
50
+ const opts = cmd.optsWithGlobals();
51
+ const localOpts = cmd.opts();
52
+ const apiKey = requireApiKey(opts.apiKey);
53
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
54
+ const id = await resolveMailboxId(client, nameOrId);
55
+ if (!localOpts.yes && process.stdin.isTTY) {
56
+ const confirmed = await confirm(`Delete mailbox ${nameOrId}? (y/N) `);
57
+ if (!confirmed) {
58
+ console.log('Cancelled.');
59
+ return;
60
+ }
61
+ }
62
+ await client.deleteMailbox(id);
63
+ output({ status: 'deleted', id }, `Deleted mailbox: ${nameOrId}`, opts.json);
64
+ });
65
+ }
66
+ function updateCommand() {
67
+ return new Command('update')
68
+ .description('Update mailbox scanner policy')
69
+ .argument('<name-or-id>', 'Mailbox name or UUID')
70
+ .option('--scanner-policy <json>', 'Scanner policy as JSON')
71
+ .option('--disable-scanner <name...>', 'Disable specific scanners')
72
+ .option('--disable-criterion <name...>', 'Disable specific proxy criteria')
73
+ .option('--language-mode <mode>', 'Language mode: english_only, allow_all_languages, disabled')
74
+ .option('--reset-policy', 'Reset to platform defaults')
75
+ .action(async (nameOrId, _opts, cmd) => {
76
+ const opts = cmd.optsWithGlobals();
77
+ const localOpts = cmd.opts();
78
+ const apiKey = requireApiKey(opts.apiKey);
79
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
80
+ const id = await resolveMailboxId(client, nameOrId);
81
+ let policy;
82
+ if (localOpts.resetPolicy) {
83
+ policy = {};
84
+ }
85
+ else if (localOpts.scannerPolicy) {
86
+ policy = JSON.parse(localOpts.scannerPolicy);
87
+ }
88
+ else {
89
+ policy = {};
90
+ if (localOpts.languageMode)
91
+ policy.language_mode = localOpts.languageMode;
92
+ if (localOpts.disableScanner)
93
+ policy.disabled_scanners = localOpts.disableScanner;
94
+ if (localOpts.disableCriterion)
95
+ policy.disabled_proxy_criteria = localOpts.disableCriterion;
96
+ }
97
+ const result = await client.updateMailbox(id, { scanner_policy: policy });
98
+ output(result, `Updated scanner policy for mailbox: ${nameOrId}`, opts.json);
99
+ });
100
+ }
101
+ function confirm(question) {
102
+ return new Promise((resolve) => {
103
+ const rl = readline.createInterface({
104
+ input: process.stdin,
105
+ output: process.stderr,
106
+ });
107
+ rl.question(question, (answer) => {
108
+ rl.close();
109
+ resolve(answer.trim().toLowerCase() === 'y');
110
+ });
111
+ });
112
+ }
113
+ //# sourceMappingURL=mailbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mailbox.js","sourceRoot":"","sources":["../../src/commands/mailbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,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,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function recipientsCommand(): Command;
3
+ //# sourceMappingURL=recipients.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipients.d.ts","sourceRoot":"","sources":["../../src/commands/recipients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,iBAAiB,IAAI,OAAO,CAU3C"}
@@ -0,0 +1,50 @@
1
+ import { Command } from 'commander';
2
+ import { ApiClient } from '../api-client.js';
3
+ import { requireApiKey } from '../auth.js';
4
+ import { resolveRecipientId } from '../resolve.js';
5
+ import { formatTable, output } from '../format.js';
6
+ export function recipientsCommand() {
7
+ const recipients = new Command('recipients').description('Manage verified recipients (sandbox tier)');
8
+ recipients.addCommand(addCommand());
9
+ recipients.addCommand(listCommand());
10
+ recipients.addCommand(removeCommand());
11
+ return recipients;
12
+ }
13
+ function addCommand() {
14
+ return new Command('add')
15
+ .description('Add a verified recipient')
16
+ .argument('<email>', 'Recipient email address')
17
+ .action(async (email, _opts, cmd) => {
18
+ const opts = cmd.optsWithGlobals();
19
+ const apiKey = requireApiKey(opts.apiKey);
20
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
21
+ const result = await client.addRecipient(email);
22
+ output(result, `Added verified recipient: ${result.email}`, opts.json);
23
+ });
24
+ }
25
+ function listCommand() {
26
+ return new Command('list')
27
+ .description('List verified recipients')
28
+ .action(async (_opts, cmd) => {
29
+ const opts = cmd.optsWithGlobals();
30
+ const apiKey = requireApiKey(opts.apiKey);
31
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
32
+ const result = await client.listRecipients();
33
+ const table = formatTable(['EMAIL', 'ADDED'], result.recipients.map((r) => [r.email, r.created_at]));
34
+ output(result, table, opts.json);
35
+ });
36
+ }
37
+ function removeCommand() {
38
+ return new Command('remove')
39
+ .description('Remove a verified recipient')
40
+ .argument('<email-or-id>', 'Recipient email or UUID')
41
+ .action(async (emailOrId, _opts, cmd) => {
42
+ const opts = cmd.optsWithGlobals();
43
+ const apiKey = requireApiKey(opts.apiKey);
44
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
45
+ const id = await resolveRecipientId(client, emailOrId);
46
+ await client.deleteRecipient(id);
47
+ output({ removed: true, id }, `Removed: ${emailOrId}`, opts.json);
48
+ });
49
+ }
50
+ //# sourceMappingURL=recipients.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipients.js","sourceRoot":"","sources":["../../src/commands/recipients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,UAAU,iBAAiB;IAC/B,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,WAAW,CACtD,2CAA2C,CAC5C,CAAC;IAEF,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;IACpC,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;IACrC,UAAU,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IAEvC,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,UAAU;IACjB,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC;SACtB,WAAW,CAAC,0BAA0B,CAAC;SACvC,QAAQ,CAAC,SAAS,EAAE,yBA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IAAI,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,aAAa;IACpB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;SACzB,WAAW,CAAC,6BAA6B,CAAC;SAC1C,QAAQ,CAAC,eAAe,EAAE,yBAAyB,CAAC;SACpD,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,eAAe,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAE/D,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAEvD,MAAM,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QAEjC,MAAM,CACJ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,EACrB,YAAY,SAAS,EAAE,EACvB,IAAI,CAAC,IAAI,CACV,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function replyCommand(): Command;
3
+ //# sourceMappingURL=reply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../src/commands/reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,YAAY,IAAI,OAAO,CAmBtC"}
@@ -0,0 +1,23 @@
1
+ import { Command } from 'commander';
2
+ import { ApiClient } from '../api-client.js';
3
+ import { requireApiKey } from '../auth.js';
4
+ import { formatSendResult, output } from '../format.js';
5
+ export function replyCommand() {
6
+ return new Command('reply')
7
+ .description('Reply to a message')
8
+ .argument('<message-id>', 'Message UUID to reply to')
9
+ .requiredOption('--body <body>', 'Reply body (plain text)')
10
+ .option('--html <html>', 'Reply body (HTML)')
11
+ .action(async (messageId, _opts, cmd) => {
12
+ const opts = cmd.optsWithGlobals();
13
+ const localOpts = cmd.opts();
14
+ const apiKey = requireApiKey(opts.apiKey);
15
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
16
+ const result = await client.reply(messageId, {
17
+ body: localOpts.body,
18
+ html: localOpts.html,
19
+ });
20
+ output(result, formatSendResult(result), opts.json);
21
+ });
22
+ }
23
+ //# sourceMappingURL=reply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply.js","sourceRoot":"","sources":["../../src/commands/reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;SACxB,WAAW,CAAC,oBAAoB,CAAC;SACjC,QAAQ,CAAC,cAAc,EAAE,0BAA0B,CAAC;SACpD,cAAc,CAAC,eAAe,EAAE,yBAAyB,CAAC;SAC1D,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC;SAC5C,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,eAAe,EAAE,CAAC;QACnC,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAE/D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE;YAC3C,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,IAAI,EAAE,SAAS,CAAC,IAAI;SACrB,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function sendCommand(): Command;
3
+ //# sourceMappingURL=send.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,WAAW,IAAI,OAAO,CAwBrC"}
@@ -0,0 +1,28 @@
1
+ import { Command } from 'commander';
2
+ import { ApiClient } from '../api-client.js';
3
+ import { requireApiKey } from '../auth.js';
4
+ import { formatSendResult, output } from '../format.js';
5
+ export function sendCommand() {
6
+ return new Command('send')
7
+ .description('Send an email')
8
+ .requiredOption('--from <mailbox>', 'Mailbox name or ID to send from')
9
+ .requiredOption('--to <email>', 'Recipient email address')
10
+ .requiredOption('--subject <subject>', 'Email subject')
11
+ .requiredOption('--body <body>', 'Email body (plain text)')
12
+ .option('--html <html>', 'Email body (HTML)')
13
+ .action(async (_opts, cmd) => {
14
+ const opts = cmd.optsWithGlobals();
15
+ const localOpts = cmd.opts();
16
+ const apiKey = requireApiKey(opts.apiKey);
17
+ const client = new ApiClient({ baseUrl: opts.apiUrl, apiKey });
18
+ const result = await client.send({
19
+ from_mailbox: localOpts.from,
20
+ to: localOpts.to,
21
+ subject: localOpts.subject,
22
+ body: localOpts.body,
23
+ html: localOpts.html,
24
+ });
25
+ output(result, formatSendResult(result), opts.json);
26
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AAC,IAAI;SACrB,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function signupCommand(): Command;
3
+ //# sourceMappingURL=signup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signup.d.ts","sourceRoot":"","sources":["../../src/commands/signup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,aAAa,IAAI,OAAO,CAkCvC"}
@@ -0,0 +1,50 @@
1
+ import { Command } from 'commander';
2
+ import readline from 'node:readline';
3
+ import { ApiClient } from '../api-client.js';
4
+ import { storeApiKey, getCredentialFilePath } from '../auth.js';
5
+ import { output } from '../format.js';
6
+ export function signupCommand() {
7
+ return new Command('signup')
8
+ .description('Create a new ReplyLayer account')
9
+ .option('--email <email>', 'Email address for the account')
10
+ .option('--accept-terms', 'Accept Terms of Service, Privacy Policy, AUP, and DPA')
11
+ .action(async (_opts, cmd) => {
12
+ const opts = cmd.optsWithGlobals();
13
+ const localOpts = cmd.opts();
14
+ let email = localOpts.email;
15
+ if (!email) {
16
+ email = await promptEmail();
17
+ }
18
+ if (!localOpts.acceptTerms) {
19
+ console.error('You must accept the Terms of Service, Privacy Policy, Acceptable Use Policy,');
20
+ console.error('and Data Processing Agreement to create an account.');
21
+ console.error('');
22
+ console.error('Review them at: https://replylayer.ai/terms');
23
+ console.error('Then re-run with: replylayer signup --accept-terms');
24
+ process.exit(1);
25
+ }
26
+ const client = new ApiClient({ baseUrl: opts.apiUrl });
27
+ const result = await client.signup(email);
28
+ storeApiKey(result.api_key);
29
+ output(result, `Account created. Your API key: ${result.api_key} (stored in ${getCredentialFilePath()})`, opts.json);
30
+ });
31
+ }
32
+ function promptEmail() {
33
+ return new Promise((resolve, reject) => {
34
+ const rl = readline.createInterface({
35
+ input: process.stdin,
36
+ output: process.stderr,
37
+ });
38
+ rl.question('Email: ', (answer) => {
39
+ rl.close();
40
+ const trimmed = answer.trim();
41
+ if (!trimmed) {
42
+ reject(new Error('Email is required'));
43
+ }
44
+ else {
45
+ resolve(trimmed);
46
+ }
47
+ });
48
+ });
49
+ }
50
+ //# sourceMappingURL=signup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signup.js","sourceRoot":"","sources":["../../src/commands/signup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;SACzB,WAAW,CAAC,iCAAiC,CAAC;SAC9C,MAAM,CAAC,iBAAiB,EAAE,+BAA+B,CAAC;SAC1D,MAAM,CAAC,gBAAgB,EAAE,uDAAuD,CAAC;SACjF,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC3B,MAAM,IAAI,GAAG,GAAG,CAAC,eAAe,EAAE,CAAC;QACnC,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QAC7B,IAAI,KAAK,GAAG,SAAS,CAAC,KAA2B,CAAC;QAElD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,KAAK,GAAG,MAAM,WAAW,EAAE,CAAC;QAC9B,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,8EAA8E,CAAC,CAAC;YAC9F,OAAO,CAAC,KAAK,CAAC,qDAAqD,C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essageResponse, MessageSummary } from '@replylayer/shared/types';
2
+ /**
3
+ * Format a table with aligned columns.
4
+ */
5
+ export declare function formatTable(headers: string[], rows: string[][]): string;
6
+ /**
7
+ * Format a message for `inbox read` display.
8
+ */
9
+ export declare function formatMessage(msg: GetMessageResponse): string;
10
+ /**
11
+ * Format a message summary for inbox list rows.
12
+ */
13
+ export declare function formatMessageRow(msg: MessageSummary): string[];
14
+ /**
15
+ * Output helper: prints JSON if --json flag is set, otherwise the formatted string.
16
+ */
17
+ export declare function output(data: unknown, formatted: string, json: boolean): void;
18
+ /**
19
+ * Print a status message about a send/reply result.
20
+ */
21
+ export declare function formatSendResult(result: {
22
+ message_id: string;
23
+ status: string;
24
+ warning?: string;
25
+ }): string;
26
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAcnF;;GAEG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,EAAE,MAAM,EAAE,EAAE,GACf,MAAM,CA4BR;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAyD7D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,EAAE,CAS9D;AAkCD;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAM5E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAezG"}