@newpeak/barista-cli 0.1.14 → 0.1.16

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 (178) hide show
  1. package/README.ja.md +211 -579
  2. package/README.md +208 -643
  3. package/README.vi.md +212 -586
  4. package/README.zh.md +340 -0
  5. package/dist/commands/arabica/access/index.d.ts +3 -0
  6. package/dist/commands/arabica/access/index.d.ts.map +1 -0
  7. package/dist/commands/arabica/access/index.js +15 -0
  8. package/dist/commands/arabica/access/index.js.map +1 -0
  9. package/dist/commands/arabica/access/url.d.ts +3 -0
  10. package/dist/commands/arabica/access/url.d.ts.map +1 -0
  11. package/dist/commands/arabica/access/url.js +101 -0
  12. package/dist/commands/arabica/access/url.js.map +1 -0
  13. package/dist/commands/arabica/auth/index.d.ts.map +1 -1
  14. package/dist/commands/arabica/auth/index.js +24 -5
  15. package/dist/commands/arabica/auth/index.js.map +1 -1
  16. package/dist/commands/arabica/enterprise/get.d.ts +3 -0
  17. package/dist/commands/arabica/enterprise/get.d.ts.map +1 -0
  18. package/dist/commands/arabica/enterprise/get.js +94 -0
  19. package/dist/commands/arabica/enterprise/get.js.map +1 -0
  20. package/dist/commands/arabica/enterprise/index.d.ts +3 -0
  21. package/dist/commands/arabica/enterprise/index.d.ts.map +1 -0
  22. package/dist/commands/arabica/enterprise/index.js +18 -0
  23. package/dist/commands/arabica/enterprise/index.js.map +1 -0
  24. package/dist/commands/arabica/enterprise/list.d.ts +3 -0
  25. package/dist/commands/arabica/enterprise/list.d.ts.map +1 -0
  26. package/dist/commands/arabica/enterprise/list.js +71 -0
  27. package/dist/commands/arabica/enterprise/list.js.map +1 -0
  28. package/dist/commands/arabica/enterprises/delete.d.ts +3 -0
  29. package/dist/commands/arabica/enterprises/delete.d.ts.map +1 -0
  30. package/dist/commands/arabica/enterprises/delete.js +89 -0
  31. package/dist/commands/arabica/enterprises/delete.js.map +1 -0
  32. package/dist/commands/arabica/enterprises/get.d.ts +3 -0
  33. package/dist/commands/arabica/enterprises/get.d.ts.map +1 -0
  34. package/dist/commands/arabica/enterprises/get.js +103 -0
  35. package/dist/commands/arabica/enterprises/get.js.map +1 -0
  36. package/dist/commands/arabica/enterprises/index.d.ts +3 -0
  37. package/dist/commands/arabica/enterprises/index.d.ts.map +1 -0
  38. package/dist/commands/arabica/enterprises/index.js +27 -0
  39. package/dist/commands/arabica/enterprises/index.js.map +1 -0
  40. package/dist/commands/arabica/enterprises/list.d.ts +3 -0
  41. package/dist/commands/arabica/enterprises/list.d.ts.map +1 -0
  42. package/dist/commands/arabica/enterprises/list.js +84 -0
  43. package/dist/commands/arabica/enterprises/list.js.map +1 -0
  44. package/dist/commands/arabica/enterprises/register.d.ts +3 -0
  45. package/dist/commands/arabica/enterprises/register.d.ts.map +1 -0
  46. package/dist/commands/arabica/enterprises/register.js +175 -0
  47. package/dist/commands/arabica/enterprises/register.js.map +1 -0
  48. package/dist/commands/arabica/enterprises/update.d.ts +3 -0
  49. package/dist/commands/arabica/enterprises/update.d.ts.map +1 -0
  50. package/dist/commands/arabica/enterprises/update.js +130 -0
  51. package/dist/commands/arabica/enterprises/update.js.map +1 -0
  52. package/dist/commands/arabica/index.d.ts.map +1 -1
  53. package/dist/commands/arabica/index.js +17 -4
  54. package/dist/commands/arabica/index.js.map +1 -1
  55. package/dist/commands/arabica/invoices/download.d.ts +3 -0
  56. package/dist/commands/arabica/invoices/download.d.ts.map +1 -0
  57. package/dist/commands/arabica/invoices/download.js +55 -0
  58. package/dist/commands/arabica/invoices/download.js.map +1 -0
  59. package/dist/commands/arabica/invoices/get.d.ts +3 -0
  60. package/dist/commands/arabica/invoices/get.d.ts.map +1 -0
  61. package/dist/commands/arabica/invoices/get.js +53 -0
  62. package/dist/commands/arabica/invoices/get.js.map +1 -0
  63. package/dist/commands/arabica/invoices/index.d.ts +3 -0
  64. package/dist/commands/arabica/invoices/index.d.ts.map +1 -0
  65. package/dist/commands/arabica/invoices/index.js +21 -0
  66. package/dist/commands/arabica/invoices/index.js.map +1 -0
  67. package/dist/commands/arabica/invoices/list.d.ts +3 -0
  68. package/dist/commands/arabica/invoices/list.d.ts.map +1 -0
  69. package/dist/commands/arabica/invoices/list.js +75 -0
  70. package/dist/commands/arabica/invoices/list.js.map +1 -0
  71. package/dist/commands/arabica/orders/cancel.d.ts +3 -0
  72. package/dist/commands/arabica/orders/cancel.d.ts.map +1 -0
  73. package/dist/commands/arabica/orders/cancel.js +133 -0
  74. package/dist/commands/arabica/orders/cancel.js.map +1 -0
  75. package/dist/commands/arabica/orders/get.d.ts +3 -0
  76. package/dist/commands/arabica/orders/get.d.ts.map +1 -0
  77. package/dist/commands/arabica/orders/get.js +145 -0
  78. package/dist/commands/arabica/orders/get.js.map +1 -0
  79. package/dist/commands/arabica/orders/index.d.ts +3 -0
  80. package/dist/commands/arabica/orders/index.d.ts.map +1 -0
  81. package/dist/commands/arabica/orders/index.js +24 -0
  82. package/dist/commands/arabica/orders/index.js.map +1 -0
  83. package/dist/commands/arabica/orders/list.d.ts +3 -0
  84. package/dist/commands/arabica/orders/list.d.ts.map +1 -0
  85. package/dist/commands/arabica/orders/list.js +111 -0
  86. package/dist/commands/arabica/orders/list.js.map +1 -0
  87. package/dist/commands/arabica/orders/submit.d.ts +3 -0
  88. package/dist/commands/arabica/orders/submit.d.ts.map +1 -0
  89. package/dist/commands/arabica/orders/submit.js +221 -0
  90. package/dist/commands/arabica/orders/submit.js.map +1 -0
  91. package/dist/commands/arabica/plans/compare.d.ts +3 -0
  92. package/dist/commands/arabica/plans/compare.d.ts.map +1 -0
  93. package/dist/commands/arabica/plans/compare.js +115 -0
  94. package/dist/commands/arabica/plans/compare.js.map +1 -0
  95. package/dist/commands/arabica/plans/get.d.ts +3 -0
  96. package/dist/commands/arabica/plans/get.d.ts.map +1 -0
  97. package/dist/commands/arabica/plans/get.js +94 -0
  98. package/dist/commands/arabica/plans/get.js.map +1 -0
  99. package/dist/commands/arabica/plans/index.d.ts +3 -0
  100. package/dist/commands/arabica/plans/index.d.ts.map +1 -0
  101. package/dist/commands/arabica/plans/index.js +21 -0
  102. package/dist/commands/arabica/plans/index.js.map +1 -0
  103. package/dist/commands/arabica/plans/list.d.ts +3 -0
  104. package/dist/commands/arabica/plans/list.d.ts.map +1 -0
  105. package/dist/commands/arabica/plans/list.js +69 -0
  106. package/dist/commands/arabica/plans/list.js.map +1 -0
  107. package/dist/commands/arabica/subscription/current.d.ts +3 -0
  108. package/dist/commands/arabica/subscription/current.d.ts.map +1 -0
  109. package/dist/commands/arabica/subscription/current.js +76 -0
  110. package/dist/commands/arabica/subscription/current.js.map +1 -0
  111. package/dist/commands/arabica/subscription/index.d.ts +3 -0
  112. package/dist/commands/arabica/subscription/index.d.ts.map +1 -0
  113. package/dist/commands/arabica/subscription/index.js +15 -0
  114. package/dist/commands/arabica/subscription/index.js.map +1 -0
  115. package/dist/commands/liberica/orgs/batch-delete.d.ts +3 -0
  116. package/dist/commands/liberica/orgs/batch-delete.d.ts.map +1 -0
  117. package/dist/commands/liberica/orgs/batch-delete.js +109 -0
  118. package/dist/commands/liberica/orgs/batch-delete.js.map +1 -0
  119. package/dist/commands/liberica/orgs/create.d.ts +3 -0
  120. package/dist/commands/liberica/orgs/create.d.ts.map +1 -0
  121. package/dist/commands/liberica/orgs/create.js +131 -0
  122. package/dist/commands/liberica/orgs/create.js.map +1 -0
  123. package/dist/commands/liberica/orgs/disable.d.ts +3 -0
  124. package/dist/commands/liberica/orgs/disable.d.ts.map +1 -0
  125. package/dist/commands/liberica/orgs/disable.js +98 -0
  126. package/dist/commands/liberica/orgs/disable.js.map +1 -0
  127. package/dist/commands/liberica/orgs/enable.d.ts +3 -0
  128. package/dist/commands/liberica/orgs/enable.d.ts.map +1 -0
  129. package/dist/commands/liberica/orgs/enable.js +98 -0
  130. package/dist/commands/liberica/orgs/enable.js.map +1 -0
  131. package/dist/commands/liberica/orgs/get.d.ts +3 -0
  132. package/dist/commands/liberica/orgs/get.d.ts.map +1 -0
  133. package/dist/commands/liberica/orgs/get.js +79 -0
  134. package/dist/commands/liberica/orgs/get.js.map +1 -0
  135. package/dist/commands/liberica/orgs/index.d.ts.map +1 -1
  136. package/dist/commands/liberica/orgs/index.js +15 -21
  137. package/dist/commands/liberica/orgs/index.js.map +1 -1
  138. package/dist/commands/liberica/orgs/list.d.ts +3 -0
  139. package/dist/commands/liberica/orgs/list.d.ts.map +1 -0
  140. package/dist/commands/liberica/orgs/list.js +51 -0
  141. package/dist/commands/liberica/orgs/list.js.map +1 -0
  142. package/dist/commands/liberica/orgs/update.d.ts +3 -0
  143. package/dist/commands/liberica/orgs/update.d.ts.map +1 -0
  144. package/dist/commands/liberica/orgs/update.js +136 -0
  145. package/dist/commands/liberica/orgs/update.js.map +1 -0
  146. package/dist/core/api/client.d.ts +78 -1
  147. package/dist/core/api/client.d.ts.map +1 -1
  148. package/dist/core/api/client.js +832 -76
  149. package/dist/core/api/client.js.map +1 -1
  150. package/dist/index.js +1 -1
  151. package/dist/types/enterprise.d.ts +60 -0
  152. package/dist/types/enterprise.d.ts.map +1 -0
  153. package/dist/types/enterprise.js +5 -0
  154. package/dist/types/enterprise.js.map +1 -0
  155. package/dist/types/index.d.ts +3 -0
  156. package/dist/types/index.d.ts.map +1 -1
  157. package/dist/types/index.js +3 -0
  158. package/dist/types/index.js.map +1 -1
  159. package/dist/types/invoice.d.ts +39 -0
  160. package/dist/types/invoice.d.ts.map +1 -0
  161. package/dist/types/invoice.js +5 -0
  162. package/dist/types/invoice.js.map +1 -0
  163. package/dist/types/member-product.d.ts +53 -0
  164. package/dist/types/member-product.d.ts.map +1 -0
  165. package/dist/types/member-product.js +2 -0
  166. package/dist/types/member-product.js.map +1 -0
  167. package/dist/types/order.d.ts +108 -0
  168. package/dist/types/order.d.ts.map +1 -0
  169. package/dist/types/order.js +5 -0
  170. package/dist/types/order.js.map +1 -0
  171. package/dist/types/org.d.ts +38 -0
  172. package/dist/types/org.d.ts.map +1 -1
  173. package/dist/types/subscription.d.ts +35 -0
  174. package/dist/types/subscription.d.ts.map +1 -0
  175. package/dist/types/subscription.js +5 -0
  176. package/dist/types/subscription.js.map +1 -0
  177. package/package.json +1 -1
  178. package/README.en.md +0 -714
@@ -0,0 +1,94 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import Table from 'cli-table3';
4
+ import { configManager } from '../../../core/config/manager.js';
5
+ import { apiClient } from '../../../core/api/client.js';
6
+ export function createEnterpriseGetCommand() {
7
+ const getCommand = new Command('get');
8
+ getCommand.description('Get detailed information about a specific enterprise');
9
+ getCommand
10
+ .arguments('<enterprise-id>')
11
+ .option('--env <environment>', 'Environment (dev|test|prod-cn|prod-jp)')
12
+ .option('--output <format>', 'Output format (table|json|yaml)', 'table')
13
+ .action(async (enterpriseId, options) => {
14
+ const context = configManager.getCurrentContext();
15
+ const environment = options.env || context.environment;
16
+ if (!enterpriseId) {
17
+ console.error(chalk.red('\nāœ— Enterprise ID is required\n'));
18
+ process.exit(1);
19
+ }
20
+ console.log(chalk.bold(`\nšŸ¢ Enterprise Details: ${enterpriseId}\n`));
21
+ try {
22
+ const response = await apiClient.getEnterpriseDetail(environment, enterpriseId);
23
+ if (!response.success) {
24
+ const errorMessage = response.error?.message || 'Unknown error';
25
+ if (errorMessage.includes('not found') || errorMessage.includes('äøå­˜åœØ')) {
26
+ console.error(chalk.red(`\nāœ— Enterprise not found: ${enterpriseId}\n`));
27
+ }
28
+ else {
29
+ console.error(chalk.red(`\nāœ— Failed to get enterprise: ${errorMessage}`));
30
+ if (response.error?.code) {
31
+ console.error(chalk.gray(` Error code: ${response.error.code}`));
32
+ }
33
+ console.error();
34
+ }
35
+ process.exit(1);
36
+ }
37
+ const enterprise = response.data;
38
+ if (!enterprise) {
39
+ console.error(chalk.red(`\nāœ— Enterprise not found: ${enterpriseId}\n`));
40
+ process.exit(1);
41
+ }
42
+ if (options.output === 'json') {
43
+ console.log(JSON.stringify({ success: true, data: enterprise }, null, 2));
44
+ return;
45
+ }
46
+ const statusText = enterprise.status === 'active'
47
+ ? chalk.green('Active')
48
+ : enterprise.status === 'trial'
49
+ ? chalk.yellow('Trial')
50
+ : chalk.red('Inactive');
51
+ const table = new Table({
52
+ head: [chalk.bold('Property'), chalk.bold('Value')],
53
+ colWidths: [20, 50],
54
+ style: {
55
+ head: [],
56
+ border: [],
57
+ },
58
+ });
59
+ table.push(['ID', enterprise.enterpriseId]);
60
+ table.push(['Name', enterprise.enterpriseName]);
61
+ table.push(['Contact', enterprise.contactName]);
62
+ table.push(['Email', enterprise.contactEmail]);
63
+ if (enterprise.contactPhone) {
64
+ table.push(['Phone', enterprise.contactPhone]);
65
+ }
66
+ if (enterprise.address) {
67
+ table.push(['Address', enterprise.address]);
68
+ }
69
+ table.push(['Status', statusText]);
70
+ if (enterprise.productInfo) {
71
+ table.push(['', '']);
72
+ table.push([chalk.bold('Current Plan'), enterprise.productInfo.productName]);
73
+ table.push(['Start Date', enterprise.productInfo.startDate]);
74
+ table.push(['End Date', enterprise.productInfo.endDate]);
75
+ }
76
+ table.push(['', '']);
77
+ table.push([chalk.bold('Seats'), '']);
78
+ table.push(['Total', enterprise.seats.total.toString()]);
79
+ table.push(['Used', enterprise.seats.used.toString()]);
80
+ table.push(['Available', (enterprise.seats.total - enterprise.seats.used).toString()]);
81
+ table.push(['', '']);
82
+ table.push(['Members', enterprise.memberCount.toString()]);
83
+ table.push(['Created', enterprise.createdAt]);
84
+ console.log(table.toString());
85
+ console.log();
86
+ }
87
+ catch (error) {
88
+ console.error(chalk.red(`\nāœ— Unexpected error: ${error instanceof Error ? error.message : 'Unknown error'}\n`));
89
+ process.exit(1);
90
+ }
91
+ });
92
+ return getCommand;
93
+ }
94
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprise/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,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OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAyB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC;YAChH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function createArabicaEnterpriseCommand(): Command;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprise/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,8BAA8B,IAAI,OAAO,CAexD"}
@@ -0,0 +1,18 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import { createEnterpriseListCommand } from './list.js';
4
+ import { createEnterpriseGetCommand } from './get.js';
5
+ export function createArabicaEnterpriseCommand() {
6
+ const enterpriseCommand = new Command('enterprise');
7
+ enterpriseCommand.description('Manage enterprise accounts on the Arabica platform');
8
+ enterpriseCommand.addCommand(createEnterpriseListCommand());
9
+ enterpriseCommand.addCommand(createEnterpriseGetCommand());
10
+ enterpriseCommand.action(() => {
11
+ console.log(chalk.bold('\nšŸ¢ Arabica Enterprise Commands\n'));
12
+ console.log(' Use "barista arabica enterprise list" to list all enterprises');
13
+ console.log(' Use "barista arabica enterprise get <enterprise-id>" to view enterprise details');
14
+ console.log('\n Run "barista arabica enterprise <command> --help" for more details\n');
15
+ });
16
+ return enterpriseCommand;
17
+ }
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprise/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAEtD,MAAM,UAAU,8BAA8B;IAC5C,MAAM,iBAAiB,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IACpD,iBAAiB,CAAC,WAAW,CAAC,oDAAoD,CAAC,CAAC;IAEpF,iBAAiB,CAAC,UAAU,CAAC,2BAA2B,EAAE,CAAC,CAAC;IAC5D,iBAAiB,CAAC,UAAU,CAAC,0BAA0B,EAAE,CAAC,CAAC;IAE3D,iBAAiB,CAAC,MAAM,CAAC,GAAG,EAAE;QAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;QAC/E,OAAO,CAAC,GAAG,CAAC,mFAAmF,CAAC,CAAC;QACjG,OAAO,CAAC,GAAG,CAAC,0EAA0E,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;IAEH,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function createEnterpriseListCommand(): Command;
3
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprise/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,2BAA2B,IAAI,OAAO,CAyErD"}
@@ -0,0 +1,71 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import Table from 'cli-table3';
4
+ import { configManager } from '../../../core/config/manager.js';
5
+ import { apiClient } from '../../../core/api/client.js';
6
+ export function createEnterpriseListCommand() {
7
+ const listCommand = new Command('list');
8
+ listCommand.description('List all enterprises associated with the current account');
9
+ listCommand
10
+ .option('--env <environment>', 'Environment (dev|test|prod-cn|prod-jp)')
11
+ .option('--output <format>', 'Output format (table|json|yaml)', 'table')
12
+ .action(async (options) => {
13
+ const context = configManager.getCurrentContext();
14
+ const environment = options.env || context.environment;
15
+ console.log(chalk.bold('\nšŸ¢ Enterprises\n'));
16
+ try {
17
+ const response = await apiClient.listEnterprises(environment);
18
+ if (!response.success) {
19
+ console.error(chalk.red(`\nāœ— Failed to list enterprises: ${response.error?.message || 'Unknown error'}`));
20
+ if (response.error?.code) {
21
+ console.error(chalk.gray(` Error code: ${response.error.code}`));
22
+ }
23
+ console.error();
24
+ process.exit(1);
25
+ }
26
+ const enterprises = response.data;
27
+ if (!enterprises || enterprises.length === 0) {
28
+ if (options.output === 'json') {
29
+ console.log(JSON.stringify({ success: true, data: { items: [] } }, null, 2));
30
+ }
31
+ else {
32
+ console.log(chalk.gray(' No enterprises found\n'));
33
+ }
34
+ return;
35
+ }
36
+ if (options.output === 'json') {
37
+ console.log(JSON.stringify({ success: true, data: { items: enterprises } }, null, 2));
38
+ return;
39
+ }
40
+ const table = new Table({
41
+ head: [chalk.bold('ID'), chalk.bold('Name'), chalk.bold('Contact'), chalk.bold('Status')],
42
+ colWidths: [20, 25, 20, 12],
43
+ style: {
44
+ head: [],
45
+ border: [],
46
+ },
47
+ });
48
+ for (const enterprise of enterprises) {
49
+ const statusText = enterprise.status === 'active'
50
+ ? chalk.green('Active')
51
+ : enterprise.status === 'trial'
52
+ ? chalk.yellow('Trial')
53
+ : chalk.red('Inactive');
54
+ table.push([
55
+ enterprise.enterpriseId,
56
+ enterprise.enterpriseName,
57
+ enterprise.contactName,
58
+ statusText,
59
+ ]);
60
+ }
61
+ console.log(table.toString());
62
+ console.log();
63
+ }
64
+ catch (error) {
65
+ console.error(chalk.red(`\nāœ— Unexpected error: ${error instanceof Error ? error.message : 'Unknown error'}\n`));
66
+ process.exit(1);
67
+ }
68
+ });
69
+ return listCommand;
70
+ }
71
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprise/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAIxD,MAAM,UAAU,2BAA2B;IACzC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,WAAW,CAAC,WAAW,CAAC,0DAA0D,CAAC,CAAC;IAEpF,WAAW;SACR,MAAM,CAAC,qBAAqB,EAAE,wCAAwC,CAAC;SACvE,MAAM,CAAC,mBAAmB,EAAE,iCAAiC,EAAE,OAAO,CAAC;SACvE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,MAAM,OAAO,GAAG,aAAa,CAAC,iBAAiB,EAAE,CAAC;QAClD,MAAM,WAAW,GAAI,OAAO,CAAC,GAAmB,IAAI,OAAO,CAAC,WAAW,CAAC;QAExE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAE9C,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;YAE9D,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACtB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,mCAAmC,QAAQ,CAAC,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE,CAAC,CAAC,CAAC;gBAC1G,IAAI,QAAQ,CAAC,KAAK,EAAE,IAAI,EA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zF,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;gBAC3B,KAAK,EAAE;oBACL,IAAI,EAAE,EAAE;oBACR,MAAM,EAAE,EAAE;iBACX;aACF,CAAC,CAAC;YAEH,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;gBACrC,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,KAAK,QAAQ;oBAC/C,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;oBACvB,CAAC,CAAC,UAAU,CAAC,MAAM,KAAK,OAAO;wBAC7B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;wBACvB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAC5B,KAAK,CAAC,IAAI,CAAC;oBACT,UAAU,CAAC,YAAY;oBACvB,UAAU,CAAC,cAAc;oBACzB,UAAU,CAAC,WAAW;oBACtB,UAAU;iBACX,CAAC,CAAC;YACL,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC9B,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAyB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC;YAChH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function createEnterprisesDeleteCommand(): Command;
3
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprises/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,8BAA8B,IAAI,OAAO,CA0FxD"}
@@ -0,0 +1,89 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import inquirer from 'inquirer';
4
+ import { configManager } from '../../../core/config/manager.js';
5
+ import { apiClient } from '../../../core/api/client.js';
6
+ export function createEnterprisesDeleteCommand() {
7
+ const deleteCommand = new Command('delete');
8
+ deleteCommand.description('Delete an enterprise');
9
+ deleteCommand
10
+ .argument('<enterprise-id>', 'Enterprise ID')
11
+ .option('--force', 'Skip confirmation prompt')
12
+ .option('--dry-run', 'Preview without making API call')
13
+ .option('--json', 'Output as JSON');
14
+ deleteCommand.action(async (enterpriseId, options) => {
15
+ const context = configManager.getCurrentContext();
16
+ const environment = context.environment;
17
+ const jsonOutput = options.json === true;
18
+ const dryRun = options.dryRun === true;
19
+ const force = options.force === true;
20
+ if (!jsonOutput) {
21
+ console.log(chalk.bold('\nšŸ—‘ļø Delete Enterprise\n'));
22
+ console.log(chalk.gray(` Enterprise ID: ${enterpriseId}`));
23
+ }
24
+ if (dryRun) {
25
+ if (jsonOutput) {
26
+ console.log(JSON.stringify({
27
+ success: true,
28
+ dryRun: true,
29
+ data: {
30
+ operation: 'delete',
31
+ enterpriseId,
32
+ message: 'Enterprise will be permanently deleted',
33
+ },
34
+ }));
35
+ }
36
+ else {
37
+ console.log(chalk.bold('\nšŸ” Dry-Run Mode: No changes will be made\n'));
38
+ console.log(` ${chalk.gray('Operation:')} Delete Enterprise`);
39
+ console.log(` ${chalk.gray('Enterprise ID:')} ${enterpriseId}`);
40
+ console.log(` ${chalk.gray('Impact:')} ${chalk.red('Enterprise will be permanently deleted')}`);
41
+ console.log();
42
+ }
43
+ return;
44
+ }
45
+ if (!force) {
46
+ const { confirmed } = await inquirer.prompt([
47
+ {
48
+ type: 'confirm',
49
+ name: 'confirmed',
50
+ message: `Are you sure you want to delete enterprise ${enterpriseId}?`,
51
+ default: false,
52
+ },
53
+ ]);
54
+ if (!confirmed) {
55
+ if (!jsonOutput) {
56
+ console.log(chalk.yellow('\nāš ļø Operation cancelled\n'));
57
+ }
58
+ return;
59
+ }
60
+ }
61
+ if (!jsonOutput) {
62
+ console.log(chalk.bold('\nšŸ“ Deleting Enterprise\n'));
63
+ }
64
+ const response = await apiClient.deleteEnterprise(environment, enterpriseId);
65
+ if (!response.success) {
66
+ const errorMsg = response.error?.message || 'Failed to delete enterprise';
67
+ const errorCode = response.error?.code || 'DELETE_ENTERPRISE_ERROR';
68
+ if (jsonOutput) {
69
+ console.log(JSON.stringify({ success: false, error: { code: errorCode, message: errorMsg } }));
70
+ }
71
+ else {
72
+ console.error(chalk.red(`\nāœ— Failed to delete enterprise: ${errorMsg}`));
73
+ if (response.error?.code) {
74
+ console.error(chalk.gray(` Error code: ${response.error.code}`));
75
+ }
76
+ console.error();
77
+ }
78
+ process.exit(1);
79
+ }
80
+ if (jsonOutput) {
81
+ console.log(JSON.stringify({ success: true, data: { enterpriseId } }));
82
+ }
83
+ else {
84
+ console.log(chalk.green(`\nāœ“ Enterprise ${enterpriseId} deleted successfully\n`));
85
+ }
86
+ });
87
+ return deleteCommand;
88
+ }
89
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprises/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAGxD,MAAM,UAAU,8BAA8B;IAC5C,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,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K,EAAE,IAAI,IAAI,yBAAyB,CAAC;YACpE,IAAI,UAAU,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;YACjG,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,oCAAoC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACzE,IAAI,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;oBACzB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;gBACpE,CAAC;gBACD,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;QACzE,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,kBAAkB,YAAY,yBAAyB,CAAC,CAAC,CAAC;QACpF,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACvB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function createEnterprisesGetCommand(): Command;
3
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprises/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,2BAA2B,IAAI,OAAO,CA+FrD"}
@@ -0,0 +1,103 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import Table from 'cli-table3';
4
+ import { configManager } from '../../../core/config/manager.js';
5
+ import { apiClient } from '../../../core/api/client.js';
6
+ export function createEnterprisesGetCommand() {
7
+ const getCommand = new Command('get');
8
+ getCommand.description('Get enterprise details');
9
+ getCommand
10
+ .option('-i, --id <id>', 'Enterprise ID')
11
+ .option('--env <environment>', 'Environment (dev|test|prod-cn|prod-jp)')
12
+ .option('--json', 'Output as JSON');
13
+ getCommand.action(async (options) => {
14
+ const context = configManager.getCurrentContext();
15
+ const environment = options.env || context.environment;
16
+ const enterpriseId = options.id;
17
+ const jsonOutput = options.json === true;
18
+ if (!jsonOutput) {
19
+ console.log(chalk.bold('\nšŸ¢ Enterprise Details\n'));
20
+ }
21
+ try {
22
+ const response = await apiClient.getEnterpriseDetail(environment, enterpriseId || '');
23
+ if (!response.success) {
24
+ const errorMsg = response.error?.message || 'Unknown error';
25
+ if (errorMsg.includes('not found') || errorMsg.includes('äøå­˜åœØ')) {
26
+ if (jsonOutput) {
27
+ console.log(JSON.stringify({ success: false, error: { code: 'ENTERPRISE_NOT_FOUND', message: `Enterprise not found: ${enterpriseId}` } }));
28
+ }
29
+ else {
30
+ console.error(chalk.red(`\nāœ— Enterprise not found: ${enterpriseId || 'default'}\n`));
31
+ }
32
+ }
33
+ else {
34
+ if (jsonOutput) {
35
+ console.log(JSON.stringify({ success: false, error: response.error }));
36
+ }
37
+ else {
38
+ console.error(chalk.red(`\nāœ— Failed to get enterprise: ${errorMsg}`));
39
+ if (response.error?.code) {
40
+ console.error(chalk.gray(` Error code: ${response.error.code}`));
41
+ }
42
+ console.error();
43
+ }
44
+ }
45
+ process.exit(1);
46
+ }
47
+ const enterprise = response.data;
48
+ if (!enterprise) {
49
+ if (jsonOutput) {
50
+ console.log(JSON.stringify({ success: false, error: { code: 'NOT_FOUND', message: 'Enterprise not found' } }));
51
+ }
52
+ else {
53
+ console.error(chalk.red('\nāœ— Enterprise not found\n'));
54
+ }
55
+ process.exit(1);
56
+ }
57
+ if (jsonOutput) {
58
+ console.log(JSON.stringify({ success: true, data: enterprise }));
59
+ return;
60
+ }
61
+ const table = new Table({
62
+ head: [chalk.bold('Property'), chalk.bold('Value')],
63
+ colWidths: [20, 50],
64
+ style: {
65
+ head: [],
66
+ border: [],
67
+ },
68
+ });
69
+ table.push(['ID', String(enterprise.enterpriseId || '')]);
70
+ table.push(['Name', String(enterprise.enterpriseName || '')]);
71
+ table.push(['Code', String(enterprise.enterpriseNo || '')]);
72
+ table.push(['Contact', String(enterprise.contactName || '')]);
73
+ table.push(['Email', String(enterprise.contactEmail || '')]);
74
+ if (enterprise.scale)
75
+ table.push(['Scale', String(enterprise.scale)]);
76
+ if (enterprise.country)
77
+ table.push(['Country', String(enterprise.country)]);
78
+ if (enterprise.address)
79
+ table.push(['Address', String(enterprise.address)]);
80
+ if (enterprise.progressStatus)
81
+ table.push(['Status', String(enterprise.progressStatus)]);
82
+ if (enterprise.admAccount)
83
+ table.push(['Admin Account', String(enterprise.admAccount)]);
84
+ if (enterprise.erpUrl)
85
+ table.push(['ERP URL', String(enterprise.erpUrl)]);
86
+ if (enterprise.remarks)
87
+ table.push(['Remarks', String(enterprise.remarks)]);
88
+ console.log(table.toString());
89
+ console.log();
90
+ }
91
+ catch (error) {
92
+ if (jsonOutput) {
93
+ console.log(JSON.stringify({ success: false, error: { message: error instanceof Error ? error.message : 'Unknown error' } }));
94
+ }
95
+ else {
96
+ console.error(chalk.red(`\nāœ— Unexpected error: ${error instanceof Error ? error.message : 'Unknown error'}\n`));
97
+ }
98
+ process.exit(1);
99
+ }
100
+ });
101
+ return getCommand;
102
+ }
103
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprises/get.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AAU,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;YAChI,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAyB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC;YAClH,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function createEnterprisesCommand(): Command;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprises/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,wBAAwB,IAAI,OAAO,CAqBlD"}
@@ -0,0 +1,27 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import { createEnterprisesListCommand } from './list.js';
4
+ import { createEnterprisesGetCommand } from './get.js';
5
+ import { createEnterprisesRegisterCommand } from './register.js';
6
+ import { createEnterprisesUpdateCommand } from './update.js';
7
+ import { createEnterprisesDeleteCommand } from './delete.js';
8
+ export function createEnterprisesCommand() {
9
+ const enterprisesCommand = new Command('enterprises');
10
+ enterprisesCommand.description('Manage enterprises on the Arabica platform');
11
+ enterprisesCommand.addCommand(createEnterprisesListCommand());
12
+ enterprisesCommand.addCommand(createEnterprisesGetCommand());
13
+ enterprisesCommand.addCommand(createEnterprisesRegisterCommand());
14
+ enterprisesCommand.addCommand(createEnterprisesUpdateCommand());
15
+ enterprisesCommand.addCommand(createEnterprisesDeleteCommand());
16
+ enterprisesCommand.action(() => {
17
+ console.log(chalk.bold('\nšŸ¢ Arabica Enterprises Commands\n'));
18
+ console.log(' Use "barista arabica enterprises list" to list all enterprises');
19
+ console.log(' Use "barista arabica enterprises get <enterprise-id>" to view enterprise details');
20
+ console.log(' Use "barista arabica enterprises register" to register a new enterprise');
21
+ console.log(' Use "barista arabica enterprises update" to update enterprise information');
22
+ console.log(' Use "barista arabica enterprises delete <enterprise-id>" to delete an enterprise');
23
+ console.log('\n Run "barista arabica enterprises <command> --help" for more details\n');
24
+ });
25
+ return enterprisesCommand;
26
+ }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprises/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,UAAU,wBAAwB;IACtC,MAAM,kBAAkB,GAAG,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IACtD,kBAAkB,CAAC,WAAW,CAAC,4CAA4C,CAAC,CAAC;IAE7E,kBAAkB,CAAC,UAAU,CAAC,4BAA4B,EAAE,CAAC,CAAC;IAC9D,kBAAkB,CAAC,UAAU,CAAC,2BAA2B,EAAE,CAAC,CAAC;IAC7D,kBAAkB,CAAC,UAAU,CAAC,gCAAgC,EAAE,CAAC,CAAC;IAClE,kBAAkB,CAAC,UAAU,CAAC,8BAA8B,EAAE,CAAC,CAAC;IAChE,kBAAkB,CAAC,UAAU,CAAC,8BAA8B,EAAE,CAAC,CAAC;IAEhE,kBAAkB,CAAC,MAAM,CAAC,GAAG,EAAE;QAC7B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,oFAAoF,CAAC,CAAC;QAClG,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;QACzF,OAAO,CAAC,GAAG,CAAC,6EAA6E,CAAC,CAAC;QAC3F,OAAO,CAAC,GAAG,CAAC,oFAAoF,CAAC,CAAC;QAClG,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;IAEH,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function createEnterprisesListCommand(): Command;
3
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprises/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,4BAA4B,IAAI,OAAO,CAqFtD"}
@@ -0,0 +1,84 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import Table from 'cli-table3';
4
+ import { configManager } from '../../../core/config/manager.js';
5
+ import { apiClient } from '../../../core/api/client.js';
6
+ export function createEnterprisesListCommand() {
7
+ const listCommand = new Command('list');
8
+ listCommand.description('List all enterprises created by current user');
9
+ listCommand
10
+ .option('-n, --name <name>', 'Enterprise name (fuzzy search)')
11
+ .option('-c, --code <code>', 'Enterprise code')
12
+ .option('--contact-name <contactName>', 'Contact person name (fuzzy search)')
13
+ .option('--country <country>', 'Country')
14
+ .option('-p, --progress-status <progressStatus>', 'Progress status')
15
+ .option('--env <environment>', 'Environment (dev|test|prod-cn|prod-jp)')
16
+ .option('--json', 'Output as JSON');
17
+ listCommand.action(async (options) => {
18
+ const context = configManager.getCurrentContext();
19
+ const environment = options.env || context.environment;
20
+ if (!options.json) {
21
+ console.log(chalk.bold('\nšŸ¢ Enterprises\n'));
22
+ }
23
+ try {
24
+ const response = await apiClient.listEnterprises(environment);
25
+ if (!response.success) {
26
+ if (options.json) {
27
+ console.log(JSON.stringify({ success: false, error: response.error }));
28
+ }
29
+ else {
30
+ console.error(chalk.red(`\nāœ— Failed to list enterprises: ${response.error?.message || 'Unknown error'}`));
31
+ if (response.error?.code) {
32
+ console.error(chalk.gray(` Error code: ${response.error.code}`));
33
+ }
34
+ console.error();
35
+ }
36
+ process.exit(1);
37
+ }
38
+ const enterprises = response.data;
39
+ if (!enterprises || enterprises.length === 0) {
40
+ if (options.json) {
41
+ console.log(JSON.stringify({ success: true, data: { items: [] } }));
42
+ }
43
+ else {
44
+ console.log(chalk.gray(' No enterprises found\n'));
45
+ }
46
+ return;
47
+ }
48
+ if (options.json) {
49
+ console.log(JSON.stringify({ success: true, data: { items: enterprises } }));
50
+ return;
51
+ }
52
+ const table = new Table({
53
+ head: [chalk.bold('ID'), chalk.bold('Name'), chalk.bold('Code'), chalk.bold('Contact'), chalk.bold('Country')],
54
+ colWidths: [15, 25, 15, 20, 15],
55
+ style: {
56
+ head: [],
57
+ border: [],
58
+ },
59
+ });
60
+ for (const enterprise of enterprises) {
61
+ table.push([
62
+ String(enterprise.enterpriseId || ''),
63
+ String(enterprise.enterpriseName || ''),
64
+ String(enterprise.enterpriseNo || ''),
65
+ String(enterprise.contactName || ''),
66
+ String(enterprise.country || ''),
67
+ ]);
68
+ }
69
+ console.log(table.toString());
70
+ console.log();
71
+ }
72
+ catch (error) {
73
+ if (options.json) {
74
+ console.log(JSON.stringify({ success: false, error: { message: error instanceof Error ? error.message : 'Unknown error' } }));
75
+ }
76
+ else {
77
+ console.error(chalk.red(`\nāœ— Unexpected error: ${error instanceof Error ? error.message : 'Unknown error'}\n`));
78
+ }
79
+ process.exit(1);
80
+ }
81
+ });
82
+ return listCommand;
83
+ }
84
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprises/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,MAAM,UAAU,4BAA4B;IAC1C,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,WAAW,CAAC,WAAW,CAAC,8CAA8C,CAAC,CAAC;IAExE,WAAW;SACR,MAAM,CAAC,mBAAmB,EAAE,gCAAgC,CAAC;SAC7D,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,CAAC;SAC9C,MAAM,CAAC,8BAA8B,EAAE,oCAAoC,CAAC;SAC5E,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC;SACxC,MAAM,CAAC,wCAAwC,EAAE,iBAAiB,CAAC;SACnE,MAAM,CAAC,qBAAqB,EAAE,wCAAwC,CAAC;SACvE,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IAEtC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACnC,MAAM,OAAO,GAAG,aAAa,CAAC,iBAAiB,EAAE,CAAC;QAClD,MAAM,WAAW,GAAI,OAAO,CAAC,GAAkC,IAAI,OAAO,CAAC,WA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AC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC9B,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;gBACjB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;YAChI,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAyB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC;YAClH,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function createEnterprisesRegisterCommand(): Command;
3
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprises/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBpC,wBAAgB,gCAAgC,IAAI,OAAO,CAiK1D"}