@newpeak/barista-cli 0.1.20 ā 0.1.21
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/LICENSE +20 -20
- package/README.ja.md +340 -340
- package/README.md +341 -340
- package/README.vi.md +340 -340
- package/README.zh.md +340 -340
- package/bin/barista +6 -6
- package/dist/commands/liberica/materials/create.d.ts.map +1 -1
- package/dist/commands/liberica/materials/create.js +131 -0
- package/dist/commands/liberica/materials/create.js.map +1 -1
- package/dist/commands/liberica/materials/list.d.ts.map +1 -1
- package/dist/commands/liberica/materials/list.js +46 -14
- package/dist/commands/liberica/materials/list.js.map +1 -1
- package/dist/commands/liberica/materials/update.d.ts.map +1 -1
- package/dist/commands/liberica/materials/update.js +129 -1
- package/dist/commands/liberica/materials/update.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/material.d.ts +135 -2
- package/dist/types/material.d.ts.map +1 -1
- package/package.json +63 -63
- package/dist/commands/arabica/enterprise/get.d.ts +0 -3
- package/dist/commands/arabica/enterprise/get.d.ts.map +0 -1
- package/dist/commands/arabica/enterprise/get.js +0 -94
- package/dist/commands/arabica/enterprise/get.js.map +0 -1
- package/dist/commands/arabica/enterprise/index.d.ts +0 -3
- package/dist/commands/arabica/enterprise/index.d.ts.map +0 -1
- package/dist/commands/arabica/enterprise/index.js +0 -18
- package/dist/commands/arabica/enterprise/index.js.map +0 -1
- package/dist/commands/arabica/enterprise/list.d.ts +0 -3
- package/dist/commands/arabica/enterprise/list.d.ts.map +0 -1
- package/dist/commands/arabica/enterprise/list.js +0 -71
- package/dist/commands/arabica/enterprise/list.js.map +0 -1
package/dist/types/material.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
export type MaterialStatusFlag = 1 | 2;
|
|
2
|
+
export interface MaterialTags {
|
|
3
|
+
tags: string[];
|
|
4
|
+
}
|
|
5
|
+
export interface UomConversion {
|
|
6
|
+
uomCode: string;
|
|
7
|
+
conversionRatio: number;
|
|
8
|
+
slidingScale: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface MultiUom {
|
|
11
|
+
uomConversions: UomConversion[];
|
|
12
|
+
}
|
|
13
|
+
export interface SubstituteMaterials {
|
|
14
|
+
materials: string[];
|
|
15
|
+
}
|
|
2
16
|
export interface Material {
|
|
3
17
|
materialId: string;
|
|
4
18
|
materialCode: string;
|
|
@@ -6,14 +20,124 @@ export interface Material {
|
|
|
6
20
|
materialName: string;
|
|
7
21
|
materialClass?: string;
|
|
8
22
|
statusFlag: MaterialStatusFlag;
|
|
23
|
+
materialShortName?: string;
|
|
24
|
+
materialMaker?: string;
|
|
25
|
+
materialBarCode?: string;
|
|
26
|
+
materialType?: string;
|
|
27
|
+
materialUomCode?: string;
|
|
28
|
+
enableMultiUom?: string;
|
|
29
|
+
materialTags?: MaterialTags;
|
|
30
|
+
multiUomCodes?: MultiUom;
|
|
31
|
+
enableSale?: string;
|
|
32
|
+
enablePurchase?: string;
|
|
33
|
+
enableSubMaterial?: string;
|
|
34
|
+
enableOutsourcing?: string;
|
|
35
|
+
enableDivision?: string;
|
|
36
|
+
enableShelfLifeManagement?: string;
|
|
37
|
+
stopProduction?: string;
|
|
38
|
+
useMaterialLotRate?: string;
|
|
39
|
+
shelfLifeUnit?: string;
|
|
40
|
+
shelfLife?: number;
|
|
41
|
+
shelfLifeWarningDays?: number;
|
|
42
|
+
shippingMethod?: string;
|
|
43
|
+
transactionMethod?: string;
|
|
44
|
+
tradeType?: string;
|
|
45
|
+
productionPeriod?: number;
|
|
46
|
+
productionQuantityPerLot?: number;
|
|
47
|
+
lowLotRate?: number;
|
|
48
|
+
substituteMaterials?: SubstituteMaterials;
|
|
49
|
+
safetyInventory?: number;
|
|
50
|
+
defaultWarehouse?: string;
|
|
51
|
+
defaultSupplier?: string;
|
|
52
|
+
defaultClient?: string;
|
|
53
|
+
follower?: string;
|
|
54
|
+
minPackageQuantity?: string;
|
|
55
|
+
grossWeight?: string;
|
|
56
|
+
netWeight?: string;
|
|
57
|
+
color?: string;
|
|
58
|
+
longX?: number;
|
|
59
|
+
wideY?: number;
|
|
60
|
+
highZ?: number;
|
|
61
|
+
thickness?: number;
|
|
62
|
+
totalThickness?: number;
|
|
63
|
+
diameter?: number;
|
|
64
|
+
outerDiameter?: number;
|
|
65
|
+
innerDiameter?: number;
|
|
66
|
+
longXUom?: string;
|
|
67
|
+
wideYUom?: string;
|
|
68
|
+
highZUom?: string;
|
|
69
|
+
thicknessUom?: string;
|
|
70
|
+
diameterUom?: string;
|
|
71
|
+
outerDiameterUom?: string;
|
|
72
|
+
innerDiameterUom?: string;
|
|
73
|
+
volumeUom?: string;
|
|
74
|
+
volume?: string;
|
|
75
|
+
unitPrice?: number;
|
|
76
|
+
currency?: string;
|
|
77
|
+
remark?: string;
|
|
78
|
+
mouldType?: string;
|
|
9
79
|
}
|
|
10
80
|
export interface MaterialRequest {
|
|
11
81
|
materialName: string;
|
|
12
82
|
materialClass: string;
|
|
13
|
-
materialType?: string;
|
|
14
|
-
materialUomCode?: string;
|
|
15
83
|
materialCode?: string;
|
|
16
84
|
materialNo?: string;
|
|
85
|
+
materialShortName?: string;
|
|
86
|
+
materialMaker?: string;
|
|
87
|
+
materialBarCode?: string;
|
|
88
|
+
materialType?: string;
|
|
89
|
+
materialUomCode?: string;
|
|
90
|
+
enableMultiUom?: string;
|
|
91
|
+
materialTags?: MaterialTags;
|
|
92
|
+
multiUomCodes?: MultiUom;
|
|
93
|
+
enableSale?: string;
|
|
94
|
+
enablePurchase?: string;
|
|
95
|
+
enableSubMaterial?: string;
|
|
96
|
+
enableOutsourcing?: string;
|
|
97
|
+
enableDivision?: string;
|
|
98
|
+
enableShelfLifeManagement?: string;
|
|
99
|
+
stopProduction?: string;
|
|
100
|
+
useMaterialLotRate?: string;
|
|
101
|
+
shelfLifeUnit?: string;
|
|
102
|
+
shelfLife?: number;
|
|
103
|
+
shelfLifeWarningDays?: number;
|
|
104
|
+
shippingMethod?: string;
|
|
105
|
+
transactionMethod?: string;
|
|
106
|
+
tradeType?: string;
|
|
107
|
+
productionPeriod?: number;
|
|
108
|
+
productionQuantityPerLot?: number;
|
|
109
|
+
lowLotRate?: number;
|
|
110
|
+
substituteMaterials?: SubstituteMaterials;
|
|
111
|
+
safetyInventory?: number;
|
|
112
|
+
defaultWarehouse?: string;
|
|
113
|
+
defaultSupplier?: string;
|
|
114
|
+
defaultClient?: string;
|
|
115
|
+
follower?: string;
|
|
116
|
+
minPackageQuantity?: string;
|
|
117
|
+
grossWeight?: string;
|
|
118
|
+
netWeight?: string;
|
|
119
|
+
color?: string;
|
|
120
|
+
longX?: number;
|
|
121
|
+
wideY?: number;
|
|
122
|
+
highZ?: number;
|
|
123
|
+
thickness?: number;
|
|
124
|
+
totalThickness?: number;
|
|
125
|
+
diameter?: number;
|
|
126
|
+
outerDiameter?: number;
|
|
127
|
+
innerDiameter?: number;
|
|
128
|
+
longXUom?: string;
|
|
129
|
+
wideYUom?: string;
|
|
130
|
+
highZUom?: string;
|
|
131
|
+
thicknessUom?: string;
|
|
132
|
+
diameterUom?: string;
|
|
133
|
+
outerDiameterUom?: string;
|
|
134
|
+
innerDiameterUom?: string;
|
|
135
|
+
volumeUom?: string;
|
|
136
|
+
volume?: string;
|
|
137
|
+
unitPrice?: number;
|
|
138
|
+
currency?: string;
|
|
139
|
+
remark?: string;
|
|
140
|
+
mouldType?: string;
|
|
17
141
|
}
|
|
18
142
|
export interface MaterialQueryParams {
|
|
19
143
|
pageNo?: number;
|
|
@@ -21,6 +145,15 @@ export interface MaterialQueryParams {
|
|
|
21
145
|
statusFlag?: MaterialStatusFlag;
|
|
22
146
|
materialClass?: string;
|
|
23
147
|
keyword?: string;
|
|
148
|
+
color?: string;
|
|
149
|
+
materialType?: string;
|
|
150
|
+
enableSale?: string;
|
|
151
|
+
stopProduction?: string;
|
|
152
|
+
materialCode?: string;
|
|
153
|
+
materialNo?: string;
|
|
154
|
+
}
|
|
155
|
+
export interface MaterialUpdateRequest extends Partial<Omit<MaterialRequest, 'materialCode'>> {
|
|
156
|
+
materialId: string;
|
|
24
157
|
}
|
|
25
158
|
export interface MaterialListResponse {
|
|
26
159
|
totalRows: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../src/types/material.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,CAAC;AAGvC,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../src/types/material.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,CAAC;AAGvC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAGD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;CACvB;AAGD,MAAM,WAAW,QAAQ;IACvB,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAGD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAGD,MAAM,WAAW,QAAQ;IAEvB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,kBAAkB,CAAC;IAE/B,iBAAiB,CAAC,EAA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,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAGD,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAGD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,GAAG,oBAAoB,CAAC;IACvC,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@newpeak/barista-cli",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "AI Tools CLI for Liberica and Arabica services",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"cli",
|
|
8
|
-
"ai-tools",
|
|
9
|
-
"liberica",
|
|
10
|
-
"arabica",
|
|
11
|
-
"enterprise-saas",
|
|
12
|
-
"production-management",
|
|
13
|
-
"api-client",
|
|
14
|
-
"typescript",
|
|
15
|
-
"nodejs",
|
|
16
|
-
"automation",
|
|
17
|
-
"ai-integration"
|
|
18
|
-
],
|
|
19
|
-
"author": "Newpeak Technology",
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "https://gitlab.newpeaksh.com/coffee/coffee-barista-cli.git"
|
|
23
|
-
},
|
|
24
|
-
"bugs": {
|
|
25
|
-
"url": "https://gitlab.newpeaksh.com/coffee/coffee-barista-cli/issues"
|
|
26
|
-
},
|
|
27
|
-
"homepage": "https://gitlab.newpeaksh.com/coffee/coffee-barista-cli#readme",
|
|
28
|
-
"type": "module",
|
|
29
|
-
"bin": {
|
|
30
|
-
"barista": "./bin/barista"
|
|
31
|
-
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "tsc",
|
|
34
|
-
"dev": "tsc --watch",
|
|
35
|
-
"start": "node ./bin/barista",
|
|
36
|
-
"test": "vitest",
|
|
37
|
-
"test:unit": "vitest run",
|
|
38
|
-
"lint": "eslint src --ext .ts,.js",
|
|
39
|
-
"format": "prettier --write src",
|
|
40
|
-
"prepare": "npm run build",
|
|
41
|
-
"prepublishOnly": "npm run build"
|
|
42
|
-
},
|
|
43
|
-
"files": ["dist", "bin", "package.json", "README.md", "LICENSE"],
|
|
44
|
-
"dependencies": {
|
|
45
|
-
"commander": "^12.0.0",
|
|
46
|
-
"axios": "^1.6.8",
|
|
47
|
-
"keytar": "^7.9.0",
|
|
48
|
-
"yaml": "^2.4.0",
|
|
49
|
-
"chalk": "^5.3.0",
|
|
50
|
-
"inquirer": "^9.2.12",
|
|
51
|
-
"cli-table3": "^0.6.3"
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"typescript": "^5.4.5",
|
|
55
|
-
"@types/node": "^20.0.0",
|
|
56
|
-
"@types/inquirer": "^9.0.7",
|
|
57
|
-
"vitest": "^1.5.0",
|
|
58
|
-
"eslint": "^8.57.0",
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
60
|
-
"@typescript-eslint/parser": "^7.0.0",
|
|
61
|
-
"prettier": "^3.2.0"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@newpeak/barista-cli",
|
|
3
|
+
"version": "0.1.21",
|
|
4
|
+
"description": "AI Tools CLI for Liberica and Arabica services",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"cli",
|
|
8
|
+
"ai-tools",
|
|
9
|
+
"liberica",
|
|
10
|
+
"arabica",
|
|
11
|
+
"enterprise-saas",
|
|
12
|
+
"production-management",
|
|
13
|
+
"api-client",
|
|
14
|
+
"typescript",
|
|
15
|
+
"nodejs",
|
|
16
|
+
"automation",
|
|
17
|
+
"ai-integration"
|
|
18
|
+
],
|
|
19
|
+
"author": "Newpeak Technology",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://gitlab.newpeaksh.com/coffee/coffee-barista-cli.git"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://gitlab.newpeaksh.com/coffee/coffee-barista-cli/issues"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://gitlab.newpeaksh.com/coffee/coffee-barista-cli#readme",
|
|
28
|
+
"type": "module",
|
|
29
|
+
"bin": {
|
|
30
|
+
"barista": "./bin/barista"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc",
|
|
34
|
+
"dev": "tsc --watch",
|
|
35
|
+
"start": "node ./bin/barista",
|
|
36
|
+
"test": "vitest",
|
|
37
|
+
"test:unit": "vitest run",
|
|
38
|
+
"lint": "eslint src --ext .ts,.js",
|
|
39
|
+
"format": "prettier --write src",
|
|
40
|
+
"prepare": "npm run build",
|
|
41
|
+
"prepublishOnly": "npm run build"
|
|
42
|
+
},
|
|
43
|
+
"files": ["dist", "bin", "package.json", "README.md", "LICENSE"],
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"commander": "^12.0.0",
|
|
46
|
+
"axios": "^1.6.8",
|
|
47
|
+
"keytar": "^7.9.0",
|
|
48
|
+
"yaml": "^2.4.0",
|
|
49
|
+
"chalk": "^5.3.0",
|
|
50
|
+
"inquirer": "^9.2.12",
|
|
51
|
+
"cli-table3": "^0.6.3"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"typescript": "^5.4.5",
|
|
55
|
+
"@types/node": "^20.0.0",
|
|
56
|
+
"@types/inquirer": "^9.0.7",
|
|
57
|
+
"vitest": "^1.5.0",
|
|
58
|
+
"eslint": "^8.57.0",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
60
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
61
|
+
"prettier": "^3.2.0"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/commands/arabica/enterprise/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,0BAA0B,IAAI,OAAO,CAqGpD"}
|
|
@@ -1,94 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,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,0BAA0B;IACxC,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC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AC,CAAC;IAEL,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,71 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,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