@optima-chat/commerce-cli 1.7.2 → 1.7.4

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 (181) hide show
  1. package/.claude/settings.local.json +70 -0
  2. package/README.md +7 -7
  3. package/dist/commands/address/create.d.ts +3 -0
  4. package/dist/commands/address/create.d.ts.map +1 -0
  5. package/dist/commands/address/create.js +122 -0
  6. package/dist/commands/address/create.js.map +1 -0
  7. package/dist/commands/address/delete.d.ts +3 -0
  8. package/dist/commands/address/delete.d.ts.map +1 -0
  9. package/dist/commands/address/delete.js +50 -0
  10. package/dist/commands/address/delete.js.map +1 -0
  11. package/dist/commands/address/get.d.ts +3 -0
  12. package/dist/commands/address/get.d.ts.map +1 -0
  13. package/dist/commands/address/get.js +50 -0
  14. package/dist/commands/address/get.js.map +1 -0
  15. package/dist/commands/address/index.d.ts +3 -0
  16. package/dist/commands/address/index.d.ts.map +1 -0
  17. package/dist/commands/address/index.js +16 -0
  18. package/dist/commands/address/index.js.map +1 -0
  19. package/dist/commands/address/list.d.ts +3 -0
  20. package/dist/commands/address/list.d.ts.map +1 -0
  21. package/dist/commands/address/list.js +34 -0
  22. package/dist/commands/address/list.js.map +1 -0
  23. package/dist/commands/address/set-default.d.ts +3 -0
  24. package/dist/commands/address/set-default.d.ts.map +1 -0
  25. package/dist/commands/address/set-default.js +34 -0
  26. package/dist/commands/address/set-default.js.map +1 -0
  27. package/dist/commands/address/update.d.ts +3 -0
  28. package/dist/commands/address/update.d.ts.map +1 -0
  29. package/dist/commands/address/update.js +120 -0
  30. package/dist/commands/address/update.js.map +1 -0
  31. package/dist/commands/auth/login.js +1 -1
  32. package/dist/commands/auth/login.js.map +1 -1
  33. package/dist/commands/auth/switch.d.ts +3 -0
  34. package/dist/commands/auth/switch.d.ts.map +1 -0
  35. package/dist/commands/auth/switch.js +111 -0
  36. package/dist/commands/auth/switch.js.map +1 -0
  37. package/dist/commands/auth/test-refresh.d.ts +3 -0
  38. package/dist/commands/auth/test-refresh.d.ts.map +1 -0
  39. package/dist/commands/auth/test-refresh.js +43 -0
  40. package/dist/commands/auth/test-refresh.js.map +1 -0
  41. package/dist/commands/auth/whoami.d.ts.map +1 -1
  42. package/dist/commands/auth/whoami.js +5 -5
  43. package/dist/commands/auth/whoami.js.map +1 -1
  44. package/dist/commands/category/create.d.ts +3 -0
  45. package/dist/commands/category/create.d.ts.map +1 -0
  46. package/dist/commands/category/create.js +142 -0
  47. package/dist/commands/category/create.js.map +1 -0
  48. package/dist/commands/category/delete.d.ts +3 -0
  49. package/dist/commands/category/delete.d.ts.map +1 -0
  50. package/dist/commands/category/delete.js +98 -0
  51. package/dist/commands/category/delete.js.map +1 -0
  52. package/dist/commands/category/get.d.ts +3 -0
  53. package/dist/commands/category/get.d.ts.map +1 -0
  54. package/dist/commands/category/get.js +74 -0
  55. package/dist/commands/category/get.js.map +1 -0
  56. package/dist/commands/category/index.d.ts +3 -0
  57. package/dist/commands/category/index.d.ts.map +1 -0
  58. package/dist/commands/category/index.js +14 -0
  59. package/dist/commands/category/index.js.map +1 -0
  60. package/dist/commands/category/list.d.ts +3 -0
  61. package/dist/commands/category/list.d.ts.map +1 -0
  62. package/dist/commands/category/list.js +77 -0
  63. package/dist/commands/category/list.js.map +1 -0
  64. package/dist/commands/category/update.d.ts +3 -0
  65. package/dist/commands/category/update.d.ts.map +1 -0
  66. package/dist/commands/category/update.js +104 -0
  67. package/dist/commands/category/update.js.map +1 -0
  68. package/dist/commands/cleanup.d.ts +3 -0
  69. package/dist/commands/cleanup.d.ts.map +1 -0
  70. package/dist/commands/cleanup.js +100 -0
  71. package/dist/commands/cleanup.js.map +1 -0
  72. package/dist/commands/i18n/category/create.d.ts +3 -0
  73. package/dist/commands/i18n/category/create.d.ts.map +1 -0
  74. package/dist/commands/i18n/category/create.js +113 -0
  75. package/dist/commands/i18n/category/create.js.map +1 -0
  76. package/dist/commands/i18n/category/delete.d.ts +3 -0
  77. package/dist/commands/i18n/category/delete.d.ts.map +1 -0
  78. package/dist/commands/i18n/category/delete.js +63 -0
  79. package/dist/commands/i18n/category/delete.js.map +1 -0
  80. package/dist/commands/i18n/category/get.d.ts +3 -0
  81. package/dist/commands/i18n/category/get.d.ts.map +1 -0
  82. package/dist/commands/i18n/category/get.js +56 -0
  83. package/dist/commands/i18n/category/get.js.map +1 -0
  84. package/dist/commands/i18n/category/index.d.ts +3 -0
  85. package/dist/commands/i18n/category/index.d.ts.map +1 -0
  86. package/dist/commands/i18n/category/index.js +14 -0
  87. package/dist/commands/i18n/category/index.js.map +1 -0
  88. package/dist/commands/i18n/category/list.d.ts +3 -0
  89. package/dist/commands/i18n/category/list.d.ts.map +1 -0
  90. package/dist/commands/i18n/category/list.js +72 -0
  91. package/dist/commands/i18n/category/list.js.map +1 -0
  92. package/dist/commands/i18n/category/update.d.ts +3 -0
  93. package/dist/commands/i18n/category/update.d.ts.map +1 -0
  94. package/dist/commands/i18n/category/update.js +68 -0
  95. package/dist/commands/i18n/category/update.js.map +1 -0
  96. package/dist/commands/i18n/merchant/get.d.ts +3 -0
  97. package/dist/commands/i18n/merchant/get.d.ts.map +1 -0
  98. package/dist/commands/i18n/merchant/get.js +30 -0
  99. package/dist/commands/i18n/merchant/get.js.map +1 -0
  100. package/dist/commands/section/create.d.ts +3 -0
  101. package/dist/commands/section/create.d.ts.map +1 -0
  102. package/dist/commands/section/create.js +218 -0
  103. package/dist/commands/section/create.js.map +1 -0
  104. package/dist/commands/section/delete.d.ts +3 -0
  105. package/dist/commands/section/delete.d.ts.map +1 -0
  106. package/dist/commands/section/delete.js +86 -0
  107. package/dist/commands/section/delete.js.map +1 -0
  108. package/dist/commands/section/hide.d.ts +3 -0
  109. package/dist/commands/section/hide.d.ts.map +1 -0
  110. package/dist/commands/section/hide.js +82 -0
  111. package/dist/commands/section/hide.js.map +1 -0
  112. package/dist/commands/section/index.d.ts +4 -0
  113. package/dist/commands/section/index.d.ts.map +1 -0
  114. package/dist/commands/section/index.js +23 -0
  115. package/dist/commands/section/index.js.map +1 -0
  116. package/dist/commands/section/list.d.ts +3 -0
  117. package/dist/commands/section/list.d.ts.map +1 -0
  118. package/dist/commands/section/list.js +164 -0
  119. package/dist/commands/section/list.js.map +1 -0
  120. package/dist/commands/section/product/create.d.ts +3 -0
  121. package/dist/commands/section/product/create.d.ts.map +1 -0
  122. package/dist/commands/section/product/create.js +208 -0
  123. package/dist/commands/section/product/create.js.map +1 -0
  124. package/dist/commands/section/product/delete.d.ts +3 -0
  125. package/dist/commands/section/product/delete.d.ts.map +1 -0
  126. package/dist/commands/section/product/delete.js +85 -0
  127. package/dist/commands/section/product/delete.js.map +1 -0
  128. package/dist/commands/section/product/hide.d.ts +3 -0
  129. package/dist/commands/section/product/hide.d.ts.map +1 -0
  130. package/dist/commands/section/product/hide.js +78 -0
  131. package/dist/commands/section/product/hide.js.map +1 -0
  132. package/dist/commands/section/product/index.d.ts +4 -0
  133. package/dist/commands/section/product/index.d.ts.map +1 -0
  134. package/dist/commands/section/product/index.js +17 -0
  135. package/dist/commands/section/product/index.js.map +1 -0
  136. package/dist/commands/section/product/list.d.ts +3 -0
  137. package/dist/commands/section/product/list.d.ts.map +1 -0
  138. package/dist/commands/section/product/list.js +157 -0
  139. package/dist/commands/section/product/list.js.map +1 -0
  140. package/dist/commands/section/product/reorder.d.ts +3 -0
  141. package/dist/commands/section/product/reorder.d.ts.map +1 -0
  142. package/dist/commands/section/product/reorder.js +110 -0
  143. package/dist/commands/section/product/reorder.js.map +1 -0
  144. package/dist/commands/section/product/update.d.ts +3 -0
  145. package/dist/commands/section/product/update.d.ts.map +1 -0
  146. package/dist/commands/section/product/update.js +127 -0
  147. package/dist/commands/section/product/update.js.map +1 -0
  148. package/dist/commands/section/reorder.d.ts +3 -0
  149. package/dist/commands/section/reorder.d.ts.map +1 -0
  150. package/dist/commands/section/reorder.js +111 -0
  151. package/dist/commands/section/reorder.js.map +1 -0
  152. package/dist/commands/section/translation/delete.d.ts +3 -0
  153. package/dist/commands/section/translation/delete.d.ts.map +1 -0
  154. package/dist/commands/section/translation/delete.js +97 -0
  155. package/dist/commands/section/translation/delete.js.map +1 -0
  156. package/dist/commands/section/translation/index.d.ts +4 -0
  157. package/dist/commands/section/translation/index.d.ts.map +1 -0
  158. package/dist/commands/section/translation/index.js +11 -0
  159. package/dist/commands/section/translation/index.js.map +1 -0
  160. package/dist/commands/section/translation/list.d.ts +3 -0
  161. package/dist/commands/section/translation/list.d.ts.map +1 -0
  162. package/dist/commands/section/translation/list.js +104 -0
  163. package/dist/commands/section/translation/list.js.map +1 -0
  164. package/dist/commands/section/translation/set.d.ts +3 -0
  165. package/dist/commands/section/translation/set.d.ts.map +1 -0
  166. package/dist/commands/section/translation/set.js +151 -0
  167. package/dist/commands/section/translation/set.js.map +1 -0
  168. package/dist/commands/section/update.d.ts +3 -0
  169. package/dist/commands/section/update.d.ts.map +1 -0
  170. package/dist/commands/section/update.js +137 -0
  171. package/dist/commands/section/update.js.map +1 -0
  172. package/dist/commands/test/health.js +2 -2
  173. package/dist/commands/test/health.js.map +1 -1
  174. package/dist/commands/variant/get.d.ts +3 -0
  175. package/dist/commands/variant/get.d.ts.map +1 -0
  176. package/dist/commands/variant/get.js +41 -0
  177. package/dist/commands/variant/get.js.map +1 -0
  178. package/dist/index.js +0 -0
  179. package/dist/utils/config.js +3 -3
  180. package/dist/utils/config.js.map +1 -1
  181. package/package.json +1 -1
@@ -0,0 +1,74 @@
1
+ import { Command } from 'commander';
2
+ import { commerceApi } from '../../api/rest/commerce.js';
3
+ import { handleError, createApiError, ValidationError } from '../../utils/error.js';
4
+ import { formatCategory } from '../../utils/format.js';
5
+ import { output } from '../../utils/output.js';
6
+ import { addEnhancedHelp } from '../../utils/helpText.js';
7
+ const cmd = new Command('get')
8
+ .description('Get category details by ID')
9
+ .option('--id <id>', 'Category ID (required)')
10
+ .action(async (options) => {
11
+ try {
12
+ await getCategory(options);
13
+ }
14
+ catch (error) {
15
+ handleError(error);
16
+ }
17
+ });
18
+ addEnhancedHelp(cmd, {
19
+ examples: [
20
+ '# Get category details',
21
+ '$ optima category get --id cat-123',
22
+ ],
23
+ output: {
24
+ description: 'Returns full category details',
25
+ example: JSON.stringify({
26
+ success: true,
27
+ data: {
28
+ category: {
29
+ id: 'uuid',
30
+ name: 'Electronics',
31
+ description: 'Electronic devices',
32
+ parent_id: null,
33
+ created_at: '2025-01-01T00:00:00Z'
34
+ }
35
+ }
36
+ }, null, 2)
37
+ },
38
+ relatedCommands: [
39
+ { command: 'category list', description: 'Find category IDs' },
40
+ { command: 'category update', description: 'Update category details' },
41
+ { command: 'i18n category list', description: 'View translations' },
42
+ ],
43
+ notes: [
44
+ 'Category ID is required',
45
+ 'Use --json for structured output',
46
+ ]
47
+ });
48
+ export const getCategoryCommand = cmd;
49
+ async function getCategory(options) {
50
+ // 验证参数
51
+ if (!options.id || options.id.trim().length === 0) {
52
+ throw new ValidationError('分类 ID 不能为空', 'id');
53
+ }
54
+ const categoryId = options.id;
55
+ const spinner = output.spinner('正在获取分类详情...');
56
+ try {
57
+ const category = await commerceApi.categories.get(categoryId);
58
+ spinner.succeed('分类详情获取成功');
59
+ if (output.isJson()) {
60
+ // JSON 模式:输出结构化数据
61
+ output.success({ category });
62
+ }
63
+ else {
64
+ // Pretty 模式:保持原有格式化输出
65
+ console.log();
66
+ console.log(formatCategory(category));
67
+ }
68
+ }
69
+ catch (error) {
70
+ spinner.fail('获取分类详情失败');
71
+ throw createApiError(error);
72
+ }
73
+ }
74
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/category/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,cAAc,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tC,KAAK,UAAU,WAAW,CAAC,OAAwB;IACjD,OAAO;IACP,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,EAAE,CAAC;IAE9B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAE9C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC9D,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAE5B,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;YACpB,kBAAkB;YAClB,MAAM,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,sBAAsB;YACtB,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACzB,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const categoryCommand: Command;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/category/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,eAAO,MAAM,eAAe,SAMQ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Command } from 'commander';
2
+ import { listCategoriesCommand } from './list.js';
3
+ import { createCategoryCommand } from './create.js';
4
+ import { getCategoryCommand } from './get.js';
5
+ import { updateCategoryCommand } from './update.js';
6
+ import { deleteCategoryCommand } from './delete.js';
7
+ export const categoryCommand = new Command('category')
8
+ .description('分类管理')
9
+ .addCommand(listCategoriesCommand)
10
+ .addCommand(createCategoryCommand)
11
+ .addCommand(getCategoryCommand)
12
+ .addCommand(updateCategoryCommand)
13
+ .addCommand(deleteCategoryCommand);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/category/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;KACnD,WAAW,CAAC,MAAM,CAAC;KACnB,UAAU,CAAC,qBAAqB,CAAC;KACjC,UAAU,CAAC,qBAAqB,CAAC;KACjC,UAAU,CAAC,kBAAkB,CAAC;KAC9B,UAAU,CAAC,qBAAqB,CAAC;KACjC,UAAU,CAAC,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const listCategoriesCommand: Command;
3
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/category/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsDpC,eAAO,MAAM,qBAAqB,SAAM,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { Command } from 'commander';
2
+ import { commerceApi } from '../../api/rest/commerce.js';
3
+ import { handleError, createApiError } from '../../utils/error.js';
4
+ import { formatCategoryList } from '../../utils/format.js';
5
+ import { output } from '../../utils/output.js';
6
+ import { addEnhancedHelp } from '../../utils/helpText.js';
7
+ const cmd = new Command('list')
8
+ .description('List all product categories (hierarchical tree structure)')
9
+ .action(async () => {
10
+ try {
11
+ await listCategories();
12
+ }
13
+ catch (error) {
14
+ handleError(error);
15
+ }
16
+ });
17
+ addEnhancedHelp(cmd, {
18
+ examples: [
19
+ '# List all categories',
20
+ '$ optima category list',
21
+ '',
22
+ '# Get categories in JSON format',
23
+ '$ optima category list --json',
24
+ ],
25
+ output: {
26
+ example: JSON.stringify({
27
+ success: true,
28
+ data: {
29
+ categories: [
30
+ {
31
+ category_id: 'uuid',
32
+ name: 'Electronics',
33
+ description: 'Electronic devices',
34
+ parent_id: null,
35
+ children: [
36
+ { category_id: 'uuid-2', name: 'Smartphones', parent_id: 'uuid' }
37
+ ]
38
+ }
39
+ ],
40
+ total: 2
41
+ }
42
+ }, null, 2)
43
+ },
44
+ relatedCommands: [
45
+ { command: 'category create', description: 'Create new category' },
46
+ { command: 'product list', description: 'Filter products by category' },
47
+ ],
48
+ notes: [
49
+ 'Returns hierarchical tree with parent-child relationships',
50
+ 'Use category IDs when creating products or subcategories',
51
+ ]
52
+ });
53
+ export const listCategoriesCommand = cmd;
54
+ async function listCategories() {
55
+ const spinner = output.spinner('正在获取分类列表...');
56
+ try {
57
+ const categories = await commerceApi.categories.list();
58
+ spinner.succeed('分类列表获取成功');
59
+ if (output.isJson()) {
60
+ // JSON 模式:输出结构化数据
61
+ output.success({
62
+ categories,
63
+ total: categories.length
64
+ });
65
+ }
66
+ else {
67
+ // Pretty 模式:保持原有表格输出
68
+ console.log();
69
+ console.log(formatCategoryList(categories));
70
+ }
71
+ }
72
+ catch (error) {
73
+ spinner.fail('获取分类列表失败');
74
+ throw createApiError(error);
75
+ }
76
+ }
77
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/category/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC5B,WAAW,CAAC,2DAA2D,CAAC;KACxE,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,IAAI,CAAC;QACH,MAAM,cAAc,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,eAAe,CAAC,GAAG,EAAE;IACnB,QAAQ,EAAE;QACR,uBAAuB;QACvB,wBAAwB;QACxB,EAAE;QACF,iCAAiC;QACjC,+BAA+B;KAChC;IACD,MAAM,EAAE;QACN,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;YACtB,OAAO,EAAE,IAAI;YACb,IAAI,EAAE;gBACJ,UAAU,EAAE;oBACV;wBACE,WAAW,EAAE,MAAM;wBACnB,IAAI,EAAE,aAAa;wBACnB,WAAW,EAAE,oBAAoB;wBACjC,SAAS,EAAE,IAAI;wBACf,QAAQ,EAAE;4BACR,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE;yBAClE;qBACF;iBACF;gBACD,KAAK,EAAE,CAAC;aACT;SACF,EAAE,IAAI,EAAE,CAAC,CAAC;KACZ;IACD,eAAe,EAAE;QACf,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE;QAClE,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,6BAA6B,EAAE;KACxE;IACD,KAAK,EAAE;QACL,2DAA2D;QAC3D,0DAA0D;KAC3D;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,KAAK,UAAU,cAAc;IAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAE9C,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACvD,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAE5B,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;YACpB,kBAAkB;YAClB,MAAM,CAAC,OAAO,CAAC;gBACb,UAAU;gBACV,KAAK,EAAE,UAAU,CAAC,MAAM;aACzB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,qBAAqB;YACrB,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACzB,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const updateCategoryCommand: Command;
3
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/category/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoEpC,eAAO,MAAM,qBAAqB,SAAM,CAAC"}
@@ -0,0 +1,104 @@
1
+ import { Command } from 'commander';
2
+ import { commerceApi } from '../../api/rest/commerce.js';
3
+ import { handleError, createApiError, ValidationError } from '../../utils/error.js';
4
+ import { formatCategory } from '../../utils/format.js';
5
+ import { output } from '../../utils/output.js';
6
+ import { addEnhancedHelp } from '../../utils/helpText.js';
7
+ const cmd = new Command('update')
8
+ .description('Update category details')
9
+ .option('--id <id>', 'Category ID (required)')
10
+ .option('-n, --name <name>', 'Category name')
11
+ .option('-d, --description <description>', 'Category description')
12
+ .option('-p, --parent <parent-id>', 'Parent category ID (for subcategory)')
13
+ .action(async (options) => {
14
+ try {
15
+ await updateCategory(options);
16
+ }
17
+ catch (error) {
18
+ handleError(error);
19
+ }
20
+ });
21
+ addEnhancedHelp(cmd, {
22
+ examples: [
23
+ '# Update category name',
24
+ '$ optima category update --id cat-123 --name "Digital Electronics"',
25
+ '',
26
+ '# Update multiple fields',
27
+ '$ optima category update \\',
28
+ ' --id cat-456 \\',
29
+ ' --name "Home Appliances" \\',
30
+ ' --description "Kitchen and household appliances"',
31
+ '',
32
+ '# Make a subcategory',
33
+ '$ optima category update --id cat-789 --parent cat-123',
34
+ ],
35
+ output: {
36
+ example: JSON.stringify({
37
+ success: true,
38
+ data: {
39
+ category_id: 'uuid',
40
+ updated_fields: ['name', 'description'],
41
+ category: {
42
+ id: 'uuid',
43
+ name: 'Digital Electronics',
44
+ description: 'Updated description'
45
+ }
46
+ }
47
+ }, null, 2)
48
+ },
49
+ relatedCommands: [
50
+ { command: 'category get', description: 'View current details' },
51
+ { command: 'category list', description: 'Find category IDs' },
52
+ { command: 'i18n category create', description: 'Add translations' },
53
+ ],
54
+ notes: [
55
+ 'Category ID is required',
56
+ 'At least one field to update is required',
57
+ 'Set parent to create category hierarchy',
58
+ ]
59
+ });
60
+ export const updateCategoryCommand = cmd;
61
+ async function updateCategory(options) {
62
+ // 验证参数
63
+ if (!options.id || options.id.trim().length === 0) {
64
+ throw new ValidationError('分类 ID 不能为空', 'id');
65
+ }
66
+ const categoryId = options.id;
67
+ // 构建更新数据
68
+ const updateData = {};
69
+ if (options.name) {
70
+ updateData.name = options.name;
71
+ }
72
+ if (options.description !== undefined) {
73
+ updateData.description = options.description;
74
+ }
75
+ if (options.parent !== undefined) {
76
+ updateData.parent_id = options.parent;
77
+ }
78
+ // 检查是否有更新内容
79
+ if (Object.keys(updateData).length === 0) {
80
+ throw new ValidationError('请至少提供一个要更新的字段', 'options');
81
+ }
82
+ const spinner = output.spinner('正在更新分类...');
83
+ try {
84
+ const category = await commerceApi.categories.update(categoryId, updateData);
85
+ spinner.succeed('分类更新成功!');
86
+ if (output.isJson()) {
87
+ output.success({
88
+ category_id: category.id || category.category_id,
89
+ updated_fields: Object.keys(updateData),
90
+ category: category
91
+ });
92
+ }
93
+ else {
94
+ // 显示分类详情
95
+ console.log();
96
+ console.log(formatCategory(category));
97
+ }
98
+ }
99
+ catch (error) {
100
+ spinner.fail('分类更新失败');
101
+ throw createApiError(error);
102
+ }
103
+ }
104
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/category/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAS1D,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC9B,WAAW,CAA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C;gBACb,WAAW,EAAE,QAAQ,CAAC,EAAE,IAAI,QAAQ,CAAC,WAAW;gBAChD,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;gBACvC,QAAQ,EAAE,QAAQ;aACnB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,SAAS;YACT,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvB,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const cleanupCommand: Command;
3
+ //# sourceMappingURL=cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../../src/commands/cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmHpC,eAAO,MAAM,cAAc,SAAM,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import fs from 'fs';
4
+ import path from 'path';
5
+ import os from 'os';
6
+ import inquirer from 'inquirer';
7
+ import { isInteractiveEnvironment } from '../utils/interactive.js';
8
+ import { ValidationError, handleError } from '../utils/error.js';
9
+ const CLAUDE_MD_PATH = path.join(os.homedir(), '.claude', 'CLAUDE.md');
10
+ const OPTIMA_START_MARKER = '## Optima CLI';
11
+ const OPTIMA_END_MARKER = '<!-- END_OPTIMA_CLI -->';
12
+ import { addEnhancedHelp } from '../utils/helpText.js';
13
+ const cmd = new Command('cleanup')
14
+ .description('Remove Optima CLI config from Claude Code global settings')
15
+ .option('--yes', 'Skip confirmation prompt (non-interactive)')
16
+ .action(async (options) => {
17
+ try {
18
+ await cleanupConfig(options);
19
+ }
20
+ catch (error) {
21
+ handleError(error);
22
+ }
23
+ });
24
+ async function cleanupConfig(options) {
25
+ // 检查文件是否存在
26
+ if (!fs.existsSync(CLAUDE_MD_PATH)) {
27
+ console.log(chalk.yellow('\n⚠️ 未找到 Claude Code 配置文件\n'));
28
+ return;
29
+ }
30
+ // 读取内容
31
+ const content = fs.readFileSync(CLAUDE_MD_PATH, 'utf-8');
32
+ // 检查是否包含 Optima CLI 配置
33
+ if (!content.includes(OPTIMA_START_MARKER)) {
34
+ console.log(chalk.yellow('\n⚠️ 配置文件中未找到 Optima CLI 区块\n'));
35
+ return;
36
+ }
37
+ // 确认
38
+ if (!options.yes) {
39
+ if (isInteractiveEnvironment()) {
40
+ // 交互模式:显示确认提示
41
+ const answer = await inquirer.prompt([
42
+ {
43
+ type: 'confirm',
44
+ name: 'confirm',
45
+ message: '确定要从 Claude Code 配置中移除 Optima CLI 区块吗?',
46
+ default: false,
47
+ },
48
+ ]);
49
+ if (!answer.confirm) {
50
+ console.log(chalk.gray('\n已取消\n'));
51
+ return;
52
+ }
53
+ }
54
+ else {
55
+ // 非交互模式:要求使用 --yes 标志
56
+ throw new ValidationError('非交互环境需要使用 --yes 标志确认清理操作', 'yes');
57
+ }
58
+ }
59
+ // 移除 Optima CLI 区块
60
+ let newContent = content;
61
+ if (content.includes(OPTIMA_END_MARKER)) {
62
+ const regex = new RegExp(`${OPTIMA_START_MARKER}[\\s\\S]*?${OPTIMA_END_MARKER}\\n?`, 'g');
63
+ newContent = newContent.replace(regex, '');
64
+ }
65
+ else {
66
+ const regex = /## Optima CLI[\s\S]*?(?=\n## [^\n]|\n*$)/g;
67
+ newContent = newContent.replace(regex, '');
68
+ }
69
+ // 清理多余空行
70
+ newContent = newContent.replace(/\n{3,}/g, '\n\n').trim() + '\n';
71
+ // 写回文件
72
+ fs.writeFileSync(CLAUDE_MD_PATH, newContent, 'utf-8');
73
+ console.log(chalk.green('\n✓ 已从 Claude Code 配置中移除 Optima CLI'));
74
+ console.log(chalk.gray(` 配置文件: ${CLAUDE_MD_PATH}\n`));
75
+ }
76
+ addEnhancedHelp(cmd, {
77
+ examples: [
78
+ '# Remove Optima config with confirmation',
79
+ '$ commerce cleanup',
80
+ '',
81
+ '# Remove without confirmation (non-interactive)',
82
+ '$ commerce cleanup --yes',
83
+ ],
84
+ output: {
85
+ description: 'Removes Optima CLI section from ~/.claude/CLAUDE.md',
86
+ example: 'Configuration file: /Users/username/.claude/CLAUDE.md'
87
+ },
88
+ relatedCommands: [
89
+ { command: 'init', description: 'Re-enable Optima in project' },
90
+ { command: 'auth logout', description: 'Logout before cleanup' },
91
+ ],
92
+ notes: [
93
+ 'Removes global configuration from ~/.claude/CLAUDE.md',
94
+ 'Requires confirmation unless --yes flag is used',
95
+ 'Does not affect tokens or login status',
96
+ 'Project-level configs (.claude/CLAUDE.md) are not affected',
97
+ ]
98
+ });
99
+ export const cleanupCommand = cmd;
100
+ //# sourceMappingURL=cleanup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../src/commands/cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AACvE,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAC5C,MAAM,iBAAiB,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,qDAAqD;QAClE,OAAO,EAAE,uDAAuD;KACjE;IACD,eAAe,EAAE;QACf,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,6BAA6B,EAAE;QAC/D,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,uBAAuB,EAAE;KACjE;IACD,KAAK,EAAE;QACL,uDAAuD;QACvD,iDAAiD;QACjD,wCAAwC;QACxC,4DAA4D;KAC7D;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const createCategoryTranslationCommand: Command;
3
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/commands/i18n/category/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuCpC,eAAO,MAAM,gCAAgC,SAAM,CAAC"}
@@ -0,0 +1,113 @@
1
+ import { addEnhancedHelp } from '../../../utils/helpText.js';
2
+ import { Command } from 'commander';
3
+ import inquirer from 'inquirer';
4
+ import chalk from 'chalk';
5
+ import { output } from '../../../utils/output.js';
6
+ import { commerceApi } from '../../../api/rest/commerce.js';
7
+ import { handleError, ValidationError } from '../../../utils/error.js';
8
+ import { validateLanguageCode, SUPPORTED_LANGUAGES } from '../../../utils/validation.js';
9
+ import { isInteractiveEnvironment, requireParam } from '../../../utils/interactive.js';
10
+ const cmd = new Command('create')
11
+ .description('创建分类翻译')
12
+ .option('--category-id <id>', '分类 ID')
13
+ .option('-l, --lang <code>', `语言代码(支持: ${SUPPORTED_LANGUAGES.join(', ')})`)
14
+ .option('-n, --name <name>', '翻译后的名称')
15
+ .option('-d, --description <description>', '翻译后的描述')
16
+ .action(async (options) => {
17
+ try {
18
+ await createCategoryTranslation(options);
19
+ }
20
+ catch (error) {
21
+ handleError(error);
22
+ }
23
+ });
24
+ addEnhancedHelp(cmd, {
25
+ examples: ['$ optima i18n category create --category-id id-123 --lang zh-CN --name "名称"'],
26
+ relatedCommands: [
27
+ { command: 'i18n languages', description: 'View supported language codes' },
28
+ { command: 'i18n category list', description: 'View all translations' },
29
+ ],
30
+ notes: ['Category ID, language code, and name are required', 'Supported: en-US, es-ES, ja-JP, vi-VN, zh-CN']
31
+ });
32
+ export const createCategoryTranslationCommand = cmd;
33
+ async function createCategoryTranslation(options) {
34
+ if (!options.categoryId || options.categoryId.trim().length === 0) {
35
+ throw new ValidationError('分类 ID 不能为空', 'category-id');
36
+ }
37
+ const categoryId = options.categoryId;
38
+ let { lang, name, description } = options;
39
+ // 检测环境
40
+ if (isInteractiveEnvironment()) {
41
+ // 交互模式:填写必填字段
42
+ if (!lang || !name) {
43
+ const questions = [];
44
+ if (!lang) {
45
+ questions.push({
46
+ type: 'input',
47
+ name: 'lang',
48
+ message: `语言代码(支持: ${SUPPORTED_LANGUAGES.join(', ')}):`,
49
+ validate: (input) => {
50
+ if (input.trim().length === 0)
51
+ return '语言代码不能为空';
52
+ try {
53
+ validateLanguageCode(input);
54
+ return true;
55
+ }
56
+ catch (error) {
57
+ return error.message;
58
+ }
59
+ },
60
+ });
61
+ }
62
+ if (!name) {
63
+ questions.push({
64
+ type: 'input',
65
+ name: 'name',
66
+ message: '翻译后的名称:',
67
+ validate: (input) => {
68
+ return input.trim().length > 0 ? true : '名称不能为空';
69
+ },
70
+ });
71
+ }
72
+ const answers = await inquirer.prompt(questions);
73
+ lang = lang || answers.lang;
74
+ name = name || answers.name;
75
+ }
76
+ }
77
+ else {
78
+ // 非交互模式:直接验证参数
79
+ lang = requireParam(options.lang, 'lang', '语言代码');
80
+ name = requireParam(options.name, 'name', '翻译名称');
81
+ }
82
+ // Validate lang and name exist (both modes)
83
+ if (!lang || !name) {
84
+ throw new ValidationError('语言代码和名称不能为空', 'lang/name');
85
+ }
86
+ validateLanguageCode(lang);
87
+ const data = {
88
+ language_code: lang,
89
+ name,
90
+ };
91
+ if (description)
92
+ data.description = description;
93
+ const spinner = output.spinner('正在创建翻译...');
94
+ const translation = await commerceApi.i18n.categoryTranslations.create(categoryId, data);
95
+ spinner.succeed('翻译创建成功!');
96
+ if (output.isJson()) {
97
+ output.success({
98
+ category_id: categoryId,
99
+ language_code: translation.language_code,
100
+ translation: translation
101
+ });
102
+ }
103
+ else {
104
+ console.log();
105
+ console.log(chalk.gray('语言代码: ') + chalk.cyan(translation.language_code));
106
+ console.log(chalk.gray('名称: ') + chalk.white(translation.name));
107
+ if (translation.description) {
108
+ console.log(chalk.gray('描述: ') + chalk.white(translation.description));
109
+ }
110
+ console.log();
111
+ }
112
+ }
113
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/i18n/category/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AASvF,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC9B,WAAW,CAAC,QAAQ,CAAC;KACrB,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC;KACrC,MAAM,CAAC,mBAAmB,EAAE,YAAY,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;KAC1E,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EAAE,CAAC;IAChB,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const deleteCategoryTranslationCommand: Command;
3
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/commands/i18n/category/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoEpC,eAAO,MAAM,gCAAgC,SAAM,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { addEnhancedHelp } from '../../../utils/helpText.js';
2
+ import { Command } from 'commander';
3
+ import inquirer from 'inquirer';
4
+ import chalk from 'chalk';
5
+ import { output } from '../../../utils/output.js';
6
+ import { commerceApi } from '../../../api/rest/commerce.js';
7
+ import { handleError, ValidationError } from '../../../utils/error.js';
8
+ import { validateLanguageCode, SUPPORTED_LANGUAGES } from '../../../utils/validation.js';
9
+ const cmd = new Command('delete')
10
+ .description('删除分类翻译')
11
+ .option('--category-id <id>', '分类 ID')
12
+ .option('--lang <code>', `语言代码(支持: ${SUPPORTED_LANGUAGES.join(', ')})`)
13
+ .option('-y, --yes', '跳过确认')
14
+ .action(async (options) => {
15
+ try {
16
+ if (!options.categoryId || options.categoryId.trim().length === 0) {
17
+ throw new ValidationError('分类 ID 不能为空', 'category-id');
18
+ }
19
+ if (!options.lang || options.lang.trim().length === 0) {
20
+ throw new ValidationError('语言代码不能为空', 'lang');
21
+ }
22
+ validateLanguageCode(options.lang);
23
+ const categoryId = options.categoryId;
24
+ const languageCode = options.lang;
25
+ if (!options.yes) {
26
+ const { confirm } = await inquirer.prompt([
27
+ {
28
+ type: 'confirm',
29
+ name: 'confirm',
30
+ message: `确定要删除分类 ${categoryId} 的 ${languageCode} 翻译吗?`,
31
+ default: false,
32
+ },
33
+ ]);
34
+ if (!confirm) {
35
+ console.log(chalk.yellow('已取消删除'));
36
+ return;
37
+ }
38
+ }
39
+ const spinner = output.spinner('正在删除翻译...');
40
+ await commerceApi.i18n.categoryTranslations.delete(categoryId, languageCode);
41
+ spinner.succeed(`翻译 ${languageCode} 已删除`);
42
+ if (output.isJson()) {
43
+ output.success({
44
+ category_id: categoryId,
45
+ language_code: languageCode,
46
+ deleted: true
47
+ });
48
+ }
49
+ }
50
+ catch (error) {
51
+ handleError(error);
52
+ }
53
+ });
54
+ addEnhancedHelp(cmd, {
55
+ examples: ['$ optima i18n category delete --category-id id-123 --lang zh-CN --yes'],
56
+ relatedCommands: [
57
+ { command: 'i18n category list', description: 'View all translations' },
58
+ { command: 'i18n category create', description: 'Create translation again' },
59
+ ],
60
+ notes: ['Language code is required', 'Requires confirmation unless --yes flag is used']
61
+ });
62
+ export const deleteCategoryTranslationCommand = cmd;
63
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/i18n/category/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEzF,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC9B,WAAW,CAAC,QAAQ,CAAC;KACrB,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC;KACrC,MAAM,CAAC,eAAe,EAAE,YAAY,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;KACtE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