@optima-chat/commerce-cli 1.7.4 → 1.7.6

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 (179) hide show
  1. package/dist/api/rest/commerce.d.ts +6 -2
  2. package/dist/api/rest/commerce.d.ts.map +1 -1
  3. package/dist/api/rest/commerce.js +5 -1
  4. package/dist/api/rest/commerce.js.map +1 -1
  5. package/dist/commands/product/list.js +24 -21
  6. package/dist/commands/product/list.js.map +1 -1
  7. package/dist/commands/test/smoke.js +1 -1
  8. package/dist/commands/test/smoke.js.map +1 -1
  9. package/dist/index.js +0 -0
  10. package/package.json +1 -1
  11. package/.claude/settings.local.json +0 -70
  12. package/dist/commands/address/create.d.ts +0 -3
  13. package/dist/commands/address/create.d.ts.map +0 -1
  14. package/dist/commands/address/create.js +0 -122
  15. package/dist/commands/address/create.js.map +0 -1
  16. package/dist/commands/address/delete.d.ts +0 -3
  17. package/dist/commands/address/delete.d.ts.map +0 -1
  18. package/dist/commands/address/delete.js +0 -50
  19. package/dist/commands/address/delete.js.map +0 -1
  20. package/dist/commands/address/get.d.ts +0 -3
  21. package/dist/commands/address/get.d.ts.map +0 -1
  22. package/dist/commands/address/get.js +0 -50
  23. package/dist/commands/address/get.js.map +0 -1
  24. package/dist/commands/address/index.d.ts +0 -3
  25. package/dist/commands/address/index.d.ts.map +0 -1
  26. package/dist/commands/address/index.js +0 -16
  27. package/dist/commands/address/index.js.map +0 -1
  28. package/dist/commands/address/list.d.ts +0 -3
  29. package/dist/commands/address/list.d.ts.map +0 -1
  30. package/dist/commands/address/list.js +0 -34
  31. package/dist/commands/address/list.js.map +0 -1
  32. package/dist/commands/address/set-default.d.ts +0 -3
  33. package/dist/commands/address/set-default.d.ts.map +0 -1
  34. package/dist/commands/address/set-default.js +0 -34
  35. package/dist/commands/address/set-default.js.map +0 -1
  36. package/dist/commands/address/update.d.ts +0 -3
  37. package/dist/commands/address/update.d.ts.map +0 -1
  38. package/dist/commands/address/update.js +0 -120
  39. package/dist/commands/address/update.js.map +0 -1
  40. package/dist/commands/auth/switch.d.ts +0 -3
  41. package/dist/commands/auth/switch.d.ts.map +0 -1
  42. package/dist/commands/auth/switch.js +0 -111
  43. package/dist/commands/auth/switch.js.map +0 -1
  44. package/dist/commands/auth/test-refresh.d.ts +0 -3
  45. package/dist/commands/auth/test-refresh.d.ts.map +0 -1
  46. package/dist/commands/auth/test-refresh.js +0 -43
  47. package/dist/commands/auth/test-refresh.js.map +0 -1
  48. package/dist/commands/category/create.d.ts +0 -3
  49. package/dist/commands/category/create.d.ts.map +0 -1
  50. package/dist/commands/category/create.js +0 -142
  51. package/dist/commands/category/create.js.map +0 -1
  52. package/dist/commands/category/delete.d.ts +0 -3
  53. package/dist/commands/category/delete.d.ts.map +0 -1
  54. package/dist/commands/category/delete.js +0 -98
  55. package/dist/commands/category/delete.js.map +0 -1
  56. package/dist/commands/category/get.d.ts +0 -3
  57. package/dist/commands/category/get.d.ts.map +0 -1
  58. package/dist/commands/category/get.js +0 -74
  59. package/dist/commands/category/get.js.map +0 -1
  60. package/dist/commands/category/index.d.ts +0 -3
  61. package/dist/commands/category/index.d.ts.map +0 -1
  62. package/dist/commands/category/index.js +0 -14
  63. package/dist/commands/category/index.js.map +0 -1
  64. package/dist/commands/category/list.d.ts +0 -3
  65. package/dist/commands/category/list.d.ts.map +0 -1
  66. package/dist/commands/category/list.js +0 -77
  67. package/dist/commands/category/list.js.map +0 -1
  68. package/dist/commands/category/update.d.ts +0 -3
  69. package/dist/commands/category/update.d.ts.map +0 -1
  70. package/dist/commands/category/update.js +0 -104
  71. package/dist/commands/category/update.js.map +0 -1
  72. package/dist/commands/cleanup.d.ts +0 -3
  73. package/dist/commands/cleanup.d.ts.map +0 -1
  74. package/dist/commands/cleanup.js +0 -100
  75. package/dist/commands/cleanup.js.map +0 -1
  76. package/dist/commands/i18n/category/create.d.ts +0 -3
  77. package/dist/commands/i18n/category/create.d.ts.map +0 -1
  78. package/dist/commands/i18n/category/create.js +0 -113
  79. package/dist/commands/i18n/category/create.js.map +0 -1
  80. package/dist/commands/i18n/category/delete.d.ts +0 -3
  81. package/dist/commands/i18n/category/delete.d.ts.map +0 -1
  82. package/dist/commands/i18n/category/delete.js +0 -63
  83. package/dist/commands/i18n/category/delete.js.map +0 -1
  84. package/dist/commands/i18n/category/get.d.ts +0 -3
  85. package/dist/commands/i18n/category/get.d.ts.map +0 -1
  86. package/dist/commands/i18n/category/get.js +0 -56
  87. package/dist/commands/i18n/category/get.js.map +0 -1
  88. package/dist/commands/i18n/category/index.d.ts +0 -3
  89. package/dist/commands/i18n/category/index.d.ts.map +0 -1
  90. package/dist/commands/i18n/category/index.js +0 -14
  91. package/dist/commands/i18n/category/index.js.map +0 -1
  92. package/dist/commands/i18n/category/list.d.ts +0 -3
  93. package/dist/commands/i18n/category/list.d.ts.map +0 -1
  94. package/dist/commands/i18n/category/list.js +0 -72
  95. package/dist/commands/i18n/category/list.js.map +0 -1
  96. package/dist/commands/i18n/category/update.d.ts +0 -3
  97. package/dist/commands/i18n/category/update.d.ts.map +0 -1
  98. package/dist/commands/i18n/category/update.js +0 -68
  99. package/dist/commands/i18n/category/update.js.map +0 -1
  100. package/dist/commands/i18n/merchant/get.d.ts +0 -3
  101. package/dist/commands/i18n/merchant/get.d.ts.map +0 -1
  102. package/dist/commands/i18n/merchant/get.js +0 -30
  103. package/dist/commands/i18n/merchant/get.js.map +0 -1
  104. package/dist/commands/section/create.d.ts +0 -3
  105. package/dist/commands/section/create.d.ts.map +0 -1
  106. package/dist/commands/section/create.js +0 -218
  107. package/dist/commands/section/create.js.map +0 -1
  108. package/dist/commands/section/delete.d.ts +0 -3
  109. package/dist/commands/section/delete.d.ts.map +0 -1
  110. package/dist/commands/section/delete.js +0 -86
  111. package/dist/commands/section/delete.js.map +0 -1
  112. package/dist/commands/section/hide.d.ts +0 -3
  113. package/dist/commands/section/hide.d.ts.map +0 -1
  114. package/dist/commands/section/hide.js +0 -82
  115. package/dist/commands/section/hide.js.map +0 -1
  116. package/dist/commands/section/index.d.ts +0 -4
  117. package/dist/commands/section/index.d.ts.map +0 -1
  118. package/dist/commands/section/index.js +0 -23
  119. package/dist/commands/section/index.js.map +0 -1
  120. package/dist/commands/section/list.d.ts +0 -3
  121. package/dist/commands/section/list.d.ts.map +0 -1
  122. package/dist/commands/section/list.js +0 -164
  123. package/dist/commands/section/list.js.map +0 -1
  124. package/dist/commands/section/product/create.d.ts +0 -3
  125. package/dist/commands/section/product/create.d.ts.map +0 -1
  126. package/dist/commands/section/product/create.js +0 -208
  127. package/dist/commands/section/product/create.js.map +0 -1
  128. package/dist/commands/section/product/delete.d.ts +0 -3
  129. package/dist/commands/section/product/delete.d.ts.map +0 -1
  130. package/dist/commands/section/product/delete.js +0 -85
  131. package/dist/commands/section/product/delete.js.map +0 -1
  132. package/dist/commands/section/product/hide.d.ts +0 -3
  133. package/dist/commands/section/product/hide.d.ts.map +0 -1
  134. package/dist/commands/section/product/hide.js +0 -78
  135. package/dist/commands/section/product/hide.js.map +0 -1
  136. package/dist/commands/section/product/index.d.ts +0 -4
  137. package/dist/commands/section/product/index.d.ts.map +0 -1
  138. package/dist/commands/section/product/index.js +0 -17
  139. package/dist/commands/section/product/index.js.map +0 -1
  140. package/dist/commands/section/product/list.d.ts +0 -3
  141. package/dist/commands/section/product/list.d.ts.map +0 -1
  142. package/dist/commands/section/product/list.js +0 -157
  143. package/dist/commands/section/product/list.js.map +0 -1
  144. package/dist/commands/section/product/reorder.d.ts +0 -3
  145. package/dist/commands/section/product/reorder.d.ts.map +0 -1
  146. package/dist/commands/section/product/reorder.js +0 -110
  147. package/dist/commands/section/product/reorder.js.map +0 -1
  148. package/dist/commands/section/product/update.d.ts +0 -3
  149. package/dist/commands/section/product/update.d.ts.map +0 -1
  150. package/dist/commands/section/product/update.js +0 -127
  151. package/dist/commands/section/product/update.js.map +0 -1
  152. package/dist/commands/section/reorder.d.ts +0 -3
  153. package/dist/commands/section/reorder.d.ts.map +0 -1
  154. package/dist/commands/section/reorder.js +0 -111
  155. package/dist/commands/section/reorder.js.map +0 -1
  156. package/dist/commands/section/translation/delete.d.ts +0 -3
  157. package/dist/commands/section/translation/delete.d.ts.map +0 -1
  158. package/dist/commands/section/translation/delete.js +0 -97
  159. package/dist/commands/section/translation/delete.js.map +0 -1
  160. package/dist/commands/section/translation/index.d.ts +0 -4
  161. package/dist/commands/section/translation/index.d.ts.map +0 -1
  162. package/dist/commands/section/translation/index.js +0 -11
  163. package/dist/commands/section/translation/index.js.map +0 -1
  164. package/dist/commands/section/translation/list.d.ts +0 -3
  165. package/dist/commands/section/translation/list.d.ts.map +0 -1
  166. package/dist/commands/section/translation/list.js +0 -104
  167. package/dist/commands/section/translation/list.js.map +0 -1
  168. package/dist/commands/section/translation/set.d.ts +0 -3
  169. package/dist/commands/section/translation/set.d.ts.map +0 -1
  170. package/dist/commands/section/translation/set.js +0 -151
  171. package/dist/commands/section/translation/set.js.map +0 -1
  172. package/dist/commands/section/update.d.ts +0 -3
  173. package/dist/commands/section/update.d.ts.map +0 -1
  174. package/dist/commands/section/update.js +0 -137
  175. package/dist/commands/section/update.js.map +0 -1
  176. package/dist/commands/variant/get.d.ts +0 -3
  177. package/dist/commands/variant/get.d.ts.map +0 -1
  178. package/dist/commands/variant/get.js +0 -41
  179. package/dist/commands/variant/get.js.map +0 -1
@@ -1,72 +0,0 @@
1
- import { addEnhancedHelp } from '../../../utils/helpText.js';
2
- import { Command } from 'commander';
3
- import chalk from 'chalk';
4
- import Table from 'cli-table3';
5
- import { output } from '../../../utils/output.js';
6
- import { commerceApi } from '../../../api/rest/commerce.js';
7
- import { handleError, ValidationError } from '../../../utils/error.js';
8
- const cmd = new Command('list')
9
- .description('查看分类翻译列表')
10
- .option('--category-id <id>', '分类 ID')
11
- .action(async (options) => {
12
- try {
13
- if (!options.categoryId || options.categoryId.trim().length === 0) {
14
- throw new ValidationError('分类 ID 不能为空', 'category-id');
15
- }
16
- const categoryId = options.categoryId;
17
- const spinner = output.spinner('正在获取分类翻译...').start();
18
- const translations = await commerceApi.i18n.categoryTranslations.list(categoryId);
19
- spinner.succeed('分类翻译获取成功');
20
- if (translations.length === 0) {
21
- if (output.isJson()) {
22
- output.success({
23
- category_id: categoryId,
24
- translations: [],
25
- total: 0
26
- }, '该分类暂无翻译');
27
- }
28
- else {
29
- console.log(chalk.yellow('\n该分类暂无翻译\n'));
30
- }
31
- return;
32
- }
33
- if (output.isJson()) {
34
- output.success({
35
- category_id: categoryId,
36
- translations: translations,
37
- total: translations.length
38
- });
39
- }
40
- else {
41
- const table = new Table({
42
- head: [chalk.cyan('语言代码'), chalk.cyan('名称'), chalk.cyan('描述预览')],
43
- colWidths: [12, 30, 50],
44
- });
45
- translations.forEach((trans) => {
46
- const descPreview = trans.description
47
- ? trans.description.substring(0, 47) + (trans.description.length > 47 ? '...' : '')
48
- : '-';
49
- table.push([
50
- trans.language_code,
51
- trans.name || '-',
52
- descPreview,
53
- ]);
54
- });
55
- console.log('\n' + table.toString());
56
- console.log(chalk.gray(`\n共 ${translations.length} 个翻译\n`));
57
- }
58
- }
59
- catch (error) {
60
- handleError(error);
61
- }
62
- });
63
- addEnhancedHelp(cmd, {
64
- examples: ['$ optima i18n category list --category-id id-123'],
65
- relatedCommands: [
66
- { command: 'i18n category create', description: 'Add new translation' },
67
- { command: 'i18n category get', description: 'View specific translation' },
68
- ],
69
- notes: ['Category ID is required']
70
- });
71
- export const listCategoryTranslationsCommand = cmd;
72
- //# sourceMappingURL=list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/i18n/category/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE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AQ,EAAE,CAAC,kDAAkD,CAAC;IAC9D,eAAe,EAAE;QACf,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,qBAAqB,EAAE;QACvE,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,2BAA2B,EAAE;KAC3E;IACD,KAAK,EAAE,CAAC,yBAAyB,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const updateCategoryTranslationCommand: Command;
3
- //# sourceMappingURL=update.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/commands/i18n/category/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8EpC,eAAO,MAAM,gCAAgC,SAAM,CAAC"}
@@ -1,68 +0,0 @@
1
- import { addEnhancedHelp } from '../../../utils/helpText.js';
2
- import { Command } from 'commander';
3
- import chalk from 'chalk';
4
- import { output } from '../../../utils/output.js';
5
- import { commerceApi } from '../../../api/rest/commerce.js';
6
- import { handleError, ValidationError } from '../../../utils/error.js';
7
- import { validateLanguageCode, SUPPORTED_LANGUAGES } from '../../../utils/validation.js';
8
- const cmd = new Command('update')
9
- .description('更新分类翻译')
10
- .option('--category-id <id>', '分类 ID')
11
- .option('--lang <code>', `语言代码(支持: ${SUPPORTED_LANGUAGES.join(', ')})`)
12
- .option('-n, --name <name>', '翻译后的名称')
13
- .option('-d, --description <description>', '翻译后的描述')
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
- const { name, description } = options;
26
- if (!name && !description) {
27
- throw new ValidationError('至少需要提供一个更新字段', 'fields');
28
- }
29
- const data = {};
30
- if (name)
31
- data.name = name;
32
- if (description)
33
- data.description = description;
34
- const spinner = output.spinner('正在更新翻译...');
35
- const translation = await commerceApi.i18n.categoryTranslations.update(categoryId, languageCode, data);
36
- spinner.succeed('翻译更新成功!');
37
- if (output.isJson()) {
38
- output.success({
39
- category_id: categoryId,
40
- language_code: languageCode,
41
- updated_fields: Object.keys(data),
42
- translation: translation
43
- });
44
- }
45
- else {
46
- console.log();
47
- console.log(chalk.gray('语言代码: ') + chalk.cyan(translation.language_code));
48
- console.log(chalk.gray('名称: ') + chalk.white(translation.name));
49
- if (translation.description) {
50
- console.log(chalk.gray('描述: ') + chalk.white(translation.description));
51
- }
52
- console.log();
53
- }
54
- }
55
- catch (error) {
56
- handleError(error);
57
- }
58
- });
59
- addEnhancedHelp(cmd, {
60
- examples: ['$ optima i18n category update --category-id id-123 --lang zh-CN --name "新名称"'],
61
- relatedCommands: [
62
- { command: 'i18n category get', description: 'View current translation' },
63
- { command: 'i18n category list', description: 'View all translations' },
64
- ],
65
- notes: ['Language code and at least one field to update are required']
66
- });
67
- export const updateCategoryTranslationCommand = cmd;
68
- //# sourceMappingURL=update.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/i18n/category/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,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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;IAC1F,eAAe,EAAE;QACf,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,0BAA0B,EAAE;QACzE,EAAE,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,uBAAuB,EAAE;KACxE;IACD,KAAK,EAAE,CAAC,6DAA6D,CAAC;CACvE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const getMerchantTranslationCommand: Command;
3
- //# sourceMappingURL=get.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/commands/i18n/merchant/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,6BAA6B,SAyBtC,CAAC"}
@@ -1,30 +0,0 @@
1
- import { Command } from 'commander';
2
- import ora from 'ora';
3
- import chalk from 'chalk';
4
- import { commerceApi } from '../../../api/rest/commerce.js';
5
- import { handleError, ValidationError } from '../../../utils/error.js';
6
- export const getMerchantTranslationCommand = new Command('get')
7
- .description('查看商户翻译详情')
8
- .option('--lang <code>', '语言代码(如 zh-CN, en, es)')
9
- .action(async (options) => {
10
- try {
11
- if (!options.lang || options.lang.trim().length === 0) {
12
- throw new ValidationError('语言代码不能为空', 'lang');
13
- }
14
- const languageCode = options.lang;
15
- const spinner = ora('正在获取翻译详情...').start();
16
- const translation = await commerceApi.i18n.merchantTranslations.get(languageCode);
17
- spinner.succeed('翻译详情获取成功');
18
- console.log();
19
- console.log(chalk.gray('语言代码: ') + chalk.cyan(translation.language_code));
20
- console.log(chalk.gray('名称: ') + chalk.white(translation.name));
21
- if (translation.description) {
22
- console.log(chalk.gray('描述: ') + chalk.white(translation.description));
23
- }
24
- console.log();
25
- }
26
- catch (error) {
27
- handleError(error);
28
- }
29
- });
30
- //# sourceMappingURL=get.js.map
@@ -1 +0,0 @@
1
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KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAChE,IAAI,WAAW,CAAC,WAAW,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;QACzE,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const createSectionCommand: Command;
3
- //# sourceMappingURL=create.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/section/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2FpC,eAAO,MAAM,oBAAoB,SAAM,CAAC"}
@@ -1,218 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import inquirer from 'inquirer';
4
- import { commerceApi } from '../../api/rest/commerce.js';
5
- import { handleError, createApiError, ValidationError } from '../../utils/error.js';
6
- import { output } from '../../utils/output.js';
7
- import { addEnhancedHelp } from '../../utils/helpText.js';
8
- import { isInteractiveEnvironment } from '../../utils/interactive.js';
9
- const cmd = new Command('create')
10
- .description('Create or override a product page section (merchant-level)')
11
- .option('--handle <handle>', 'Section handle/identifier (required)')
12
- .option('--operation-type <type>', 'Operation type: override | new | hidden (required)')
13
- .option('--type <type>', 'Section type: collapsible | static (required for override/new)')
14
- .option('--position <n>', 'Display position (required for override/new)')
15
- .option('--content <text>', 'Section content in Markdown (required for override/new)')
16
- .option('--tab-group <group>', 'Tab group name (optional, null for independent sections)')
17
- .option('--inherit-translations', 'Inherit translations from parent layer')
18
- .action(async (options) => {
19
- try {
20
- await createSection(options);
21
- }
22
- catch (error) {
23
- handleError(error);
24
- }
25
- });
26
- addEnhancedHelp(cmd, {
27
- examples: [
28
- '# Override system default section',
29
- '$ commerce section create --handle care --operation-type override \\',
30
- ' --type collapsible --position 4 --content "Machine washable, 30°C"',
31
- '',
32
- '# Create a new custom section',
33
- '$ commerce section create --handle brand-story --operation-type new \\',
34
- ' --type collapsible --position 8 --content "## Our Story\\n\\nFounded in 2020..."',
35
- '',
36
- '# Hide a system section',
37
- '$ commerce section create --handle eco-friendly --operation-type hidden',
38
- '',
39
- '# Create section in a tab group',
40
- '$ commerce section create --handle ingredients --operation-type new \\',
41
- ' --type collapsible --position 5 --content "100% organic cotton" \\',
42
- ' --tab-group product-info',
43
- ],
44
- output: {
45
- example: JSON.stringify({
46
- success: true,
47
- data: {
48
- id: 'customization-uuid',
49
- merchant_id: 'merchant-uuid',
50
- handle: 'care',
51
- operation_type: 'override',
52
- type: 'collapsible',
53
- position: 4,
54
- content: 'Machine washable, 30°C',
55
- tab_group: null,
56
- created_at: '2025-11-27T00:00:00Z',
57
- updated_at: '2025-11-27T00:00:00Z',
58
- },
59
- message: '区块创建成功',
60
- }, null, 2),
61
- },
62
- relatedCommands: [
63
- { command: 'section list --resolved', description: 'View all sections' },
64
- { command: 'section update', description: 'Update a section' },
65
- { command: 'section hide', description: 'Quick hide a section' },
66
- { command: 'section delete', description: 'Delete a customization' },
67
- ],
68
- notes: [
69
- 'operation_type: override (modify system default), new (create custom), hidden (hide section)',
70
- 'For hidden operation, only --handle and --operation-type are required',
71
- 'System default sections: highlights, details, guarantee, care, shipping-policies, return, eco-friendly',
72
- 'Content supports Markdown and template variables like {{product.name}}',
73
- 'Use section hide command as a shortcut for hiding sections',
74
- ],
75
- });
76
- export const createSectionCommand = cmd;
77
- async function createSection(options) {
78
- let { handle, operationType, type, position, content, tabGroup, inheritTranslations } = options;
79
- // 非交互模式下验证必需参数
80
- if (!isInteractiveEnvironment()) {
81
- if (!handle || handle.trim().length === 0) {
82
- throw new ValidationError('缺少必需参数: --handle (区块标识符)', 'handle');
83
- }
84
- if (!operationType || operationType.trim().length === 0) {
85
- throw new ValidationError('缺少必需参数: --operation-type (操作类型: override | new | hidden)', 'operation_type');
86
- }
87
- // hidden 类型不需要其他参数
88
- if (operationType !== 'hidden') {
89
- if (!type || type.trim().length === 0) {
90
- throw new ValidationError('缺少必需参数: --type (区块类型: collapsible | static)', 'type');
91
- }
92
- if (!position) {
93
- throw new ValidationError('缺少必需参数: --position (显示位置)', 'position');
94
- }
95
- if (!content || content.trim().length === 0) {
96
- throw new ValidationError('缺少必需参数: --content (区块内容)', 'content');
97
- }
98
- }
99
- }
100
- else {
101
- // 交互模式:提示缺失的字段
102
- const answers = await inquirer.prompt([
103
- {
104
- type: 'input',
105
- name: 'handle',
106
- message: '区块标识符 (handle):',
107
- when: !handle,
108
- validate: (input) => (input.trim().length > 0 ? true : '标识符不能为空'),
109
- },
110
- {
111
- type: 'list',
112
- name: 'operationType',
113
- message: '操作类型:',
114
- choices: [
115
- { name: 'override - 覆盖系统默认', value: 'override' },
116
- { name: 'new - 创建新区块', value: 'new' },
117
- { name: 'hidden - 隐藏区块', value: 'hidden' },
118
- ],
119
- when: !operationType,
120
- },
121
- ]);
122
- handle = handle || answers.handle;
123
- operationType = operationType || answers.operationType;
124
- // 如果不是 hidden,继续询问其他字段
125
- if (operationType !== 'hidden') {
126
- const moreAnswers = await inquirer.prompt([
127
- {
128
- type: 'list',
129
- name: 'type',
130
- message: '区块类型:',
131
- choices: [
132
- { name: 'collapsible - 可折叠', value: 'collapsible' },
133
- { name: 'static - 静态', value: 'static' },
134
- ],
135
- when: !type,
136
- },
137
- {
138
- type: 'number',
139
- name: 'position',
140
- message: '显示位置 (1-10):',
141
- when: !position,
142
- validate: (input) => (input > 0 ? true : '位置必须大于0'),
143
- },
144
- {
145
- type: 'editor',
146
- name: 'content',
147
- message: '区块内容 (Markdown):',
148
- when: !content,
149
- },
150
- ]);
151
- type = type || moreAnswers.type;
152
- position = position || moreAnswers.position?.toString();
153
- content = content || moreAnswers.content;
154
- }
155
- }
156
- // 验证 operationType
157
- const validOperationTypes = ['override', 'new', 'hidden'];
158
- if (!validOperationTypes.includes(operationType)) {
159
- throw new ValidationError(`无效的操作类型: ${operationType}。有效值: ${validOperationTypes.join(', ')}`, 'operation_type');
160
- }
161
- // 验证 type(仅 override/new 需要)
162
- if (operationType !== 'hidden') {
163
- const validTypes = ['collapsible', 'static'];
164
- if (!validTypes.includes(type)) {
165
- throw new ValidationError(`无效的区块类型: ${type}。有效值: ${validTypes.join(', ')}`, 'type');
166
- }
167
- }
168
- const spinner = output.spinner('正在创建区块...');
169
- try {
170
- const data = {
171
- handle: handle,
172
- operation_type: operationType,
173
- };
174
- if (operationType !== 'hidden') {
175
- data.type = type;
176
- data.position = parseInt(position, 10);
177
- data.content = content;
178
- }
179
- if (tabGroup !== undefined) {
180
- data.tab_group = tabGroup || null;
181
- }
182
- if (inheritTranslations !== undefined) {
183
- data.inherit_translations = inheritTranslations;
184
- }
185
- const result = await commerceApi.productSections.merchant.create(data);
186
- spinner.succeed('区块创建成功!');
187
- if (output.isJson()) {
188
- output.success(result, '区块创建成功');
189
- }
190
- else {
191
- console.log();
192
- console.log(chalk.green('✓ 区块创建成功!'));
193
- console.log();
194
- console.log(chalk.gray('ID: ') + chalk.cyan(result.id));
195
- console.log(chalk.gray('Handle: ') + chalk.white(result.handle));
196
- console.log(chalk.gray('操作类型: ') + chalk.white(result.operation_type));
197
- if (result.type) {
198
- console.log(chalk.gray('区块类型: ') + chalk.white(result.type));
199
- }
200
- if (result.position !== undefined) {
201
- console.log(chalk.gray('位置: ') + chalk.white(result.position.toString()));
202
- }
203
- if (result.tab_group) {
204
- console.log(chalk.gray('Tab分组: ') + chalk.white(result.tab_group));
205
- }
206
- if (result.content) {
207
- const preview = result.content.length > 100 ? result.content.substring(0, 100) + '...' : result.content;
208
- console.log(chalk.gray('内容: ') + chalk.white(preview));
209
- }
210
- console.log();
211
- }
212
- }
213
- catch (error) {
214
- spinner.fail('创建区块失败');
215
- throw createApiError(error);
216
- }
217
- }
218
- //# sourceMappingURL=create.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/section/create.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,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAYtE,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC9B,WAAW,CAAC,4DAA4D,CAAC;KACzE,MAAM,CAAC,mBAAmB,EAAE,sCAAsC,CAAC;KACnE,MAAM,CAAC,yBAAyB,EAAE,oDAAoD,CAAC;KACvF,MAAM,CAAC,eAAe,EAAE,gEAAgE,CAAC;KACzF,MAAM,CAAC,gBAAgB,EAAE,8CAA8C,CAAC;KACxE,MAAM,CAAC,kBAAkB,EAAE,yDAAyD,CAAC;KACrF,MAAM,CAAC,qBAAqB,EAAE,0DAA0D,CAAC;KACzF,MAAM,CAAC,wBAAwB,EAAE,wCAAwC,CAAC;KAC1E,MAAM,CAAC,KAAK,EAAE,OAAsB,EAAE,EAAE;IACvC,IAAI,CAAC;QACH,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,eAAe,CAAC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AAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;YAC/D,CAAC;YACD,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAClC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC5E,CAAC;YACD,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;gBACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;YACrE,CAAC;YACD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;gBACxG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YACzD,CAAC;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,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"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const deleteSectionCommand: Command;
3
- //# sourceMappingURL=delete.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/section/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuDpC,eAAO,MAAM,oBAAoB,SAAM,CAAC"}
@@ -1,86 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import inquirer from 'inquirer';
4
- import { commerceApi } from '../../api/rest/commerce.js';
5
- import { handleError, createApiError, ValidationError } from '../../utils/error.js';
6
- import { output } from '../../utils/output.js';
7
- import { addEnhancedHelp } from '../../utils/helpText.js';
8
- import { isInteractiveEnvironment } from '../../utils/interactive.js';
9
- const cmd = new Command('delete')
10
- .description('Delete a product page section customization (merchant-level)')
11
- .argument('<handle>', 'Section handle to delete')
12
- .option('-y, --yes', 'Skip confirmation prompt')
13
- .action(async (handle, options) => {
14
- try {
15
- await deleteSection(handle, options);
16
- }
17
- catch (error) {
18
- handleError(error);
19
- }
20
- });
21
- addEnhancedHelp(cmd, {
22
- examples: [
23
- '# Delete with confirmation prompt',
24
- '$ commerce section delete care',
25
- '',
26
- '# Delete without confirmation',
27
- '$ commerce section delete care --yes',
28
- ],
29
- output: {
30
- example: JSON.stringify({
31
- success: true,
32
- message: '区块自定义已删除',
33
- }, null, 2),
34
- },
35
- relatedCommands: [
36
- { command: 'section list', description: 'View customizations' },
37
- { command: 'section create', description: 'Create a customization' },
38
- { command: 'section hide', description: 'Hide a section instead of deleting' },
39
- ],
40
- notes: [
41
- 'This deletes the merchant customization, not the system default',
42
- 'After deletion, the section will revert to system default (if exists)',
43
- 'Use --yes to skip confirmation in non-interactive environments',
44
- ],
45
- });
46
- export const deleteSectionCommand = cmd;
47
- async function deleteSection(handle, options) {
48
- // 非交互模式下必须指定 --yes
49
- if (!isInteractiveEnvironment() && !options.yes) {
50
- throw new ValidationError('非交互模式下需要 --yes 确认删除操作', 'yes');
51
- }
52
- // 交互模式下显示确认提示
53
- if (isInteractiveEnvironment() && !options.yes) {
54
- const { confirm } = await inquirer.prompt([
55
- {
56
- type: 'confirm',
57
- name: 'confirm',
58
- message: `确定要删除区块 "${handle}" 的自定义吗?删除后将恢复为系统默认(如有)。`,
59
- default: false,
60
- },
61
- ]);
62
- if (!confirm) {
63
- console.log(chalk.yellow('已取消删除操作'));
64
- return;
65
- }
66
- }
67
- const spinner = output.spinner('正在删除区块自定义...');
68
- try {
69
- await commerceApi.productSections.merchant.delete(handle);
70
- spinner.succeed('区块自定义已删除!');
71
- if (output.isJson()) {
72
- output.success({ handle }, '区块自定义已删除');
73
- }
74
- else {
75
- console.log();
76
- console.log(chalk.green(`✓ 区块 "${handle}" 的自定义已删除`));
77
- console.log(chalk.gray('提示: 如果是系统默认区块,将恢复为系统默认内容'));
78
- console.log();
79
- }
80
- }
81
- catch (error) {
82
- spinner.fail('删除区块失败');
83
- throw createApiError(error);
84
- }
85
- }
86
- //# sourceMappingURL=delete.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/section/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,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAMtE,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC9B,WAAW,CAAC,8DAA8D,CAAC;KAC3E,QAAQ,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAChD,MAAM,CAAC,WAAW,EAAE,0BAA0B,CAAC;KAC/C,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,OAAsB,EAAE,EAAE;IACv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AAM,0BAA0B;gBACrD,OAAO,EAAE,KAAK;aACf;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;YACrC,OAAO;QACT,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAE/C,IAAI,CAAC;QACH,MAAM,WAAW,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC1D,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAE7B,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;YACpB,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC;QACzC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,MAAM,WAAW,CAAC,CAAC,CAAC;YACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC;YACpD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,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"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const hideSectionCommand: Command;
3
- //# sourceMappingURL=hide.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hide.d.ts","sourceRoot":"","sources":["../../../src/commands/section/hide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6DpC,eAAO,MAAM,kBAAkB,SAAM,CAAC"}
@@ -1,82 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import { commerceApi } from '../../api/rest/commerce.js';
4
- import { handleError, createApiError } from '../../utils/error.js';
5
- import { output } from '../../utils/output.js';
6
- import { addEnhancedHelp } from '../../utils/helpText.js';
7
- const cmd = new Command('hide')
8
- .description('Hide a product page section (merchant-level)')
9
- .argument('<handle>', 'Section handle to hide')
10
- .action(async (handle) => {
11
- try {
12
- await hideSection(handle);
13
- }
14
- catch (error) {
15
- handleError(error);
16
- }
17
- });
18
- addEnhancedHelp(cmd, {
19
- examples: [
20
- '# Hide the eco-friendly section for all products',
21
- '$ commerce section hide eco-friendly',
22
- '',
23
- '# Hide the return policy section',
24
- '$ commerce section hide return',
25
- ],
26
- output: {
27
- example: JSON.stringify({
28
- success: true,
29
- data: {
30
- id: 'customization-uuid',
31
- merchant_id: 'merchant-uuid',
32
- handle: 'eco-friendly',
33
- operation_type: 'hidden',
34
- type: 'collapsible',
35
- position: 7,
36
- content: '',
37
- tab_group: null,
38
- created_at: '2025-11-27T00:00:00Z',
39
- updated_at: '2025-11-27T00:00:00Z',
40
- },
41
- message: '区块已隐藏',
42
- }, null, 2),
43
- },
44
- relatedCommands: [
45
- { command: 'section list --resolved', description: 'View all sections (shows hidden status)' },
46
- { command: 'section delete', description: 'Delete customization to unhide' },
47
- { command: 'section product hide', description: 'Hide for specific product only' },
48
- ],
49
- notes: [
50
- 'This is a shortcut for: section create --handle <handle> --operation-type hidden',
51
- 'Hidden sections will not appear on any product page',
52
- 'To unhide, delete the customization with: section delete <handle>',
53
- 'System default sections: highlights, details, guarantee, care, shipping-policies, return, eco-friendly',
54
- ],
55
- });
56
- export const hideSectionCommand = cmd;
57
- async function hideSection(handle) {
58
- const spinner = output.spinner('正在隐藏区块...');
59
- try {
60
- const result = await commerceApi.productSections.merchant.hide(handle);
61
- spinner.succeed('区块已隐藏!');
62
- if (output.isJson()) {
63
- output.success(result, '区块已隐藏');
64
- }
65
- else {
66
- console.log();
67
- console.log(chalk.green(`✓ 区块 "${handle}" 已隐藏`));
68
- console.log();
69
- console.log(chalk.gray('ID: ') + chalk.cyan(result.id));
70
- console.log(chalk.gray('Handle: ') + chalk.white(result.handle));
71
- console.log(chalk.gray('操作类型: ') + chalk.white(result.operation_type));
72
- console.log();
73
- console.log(chalk.gray('提示: 要取消隐藏,使用 commerce section delete ' + handle));
74
- console.log();
75
- }
76
- }
77
- catch (error) {
78
- spinner.fail('隐藏区块失败');
79
- throw createApiError(error);
80
- }
81
- }
82
- //# sourceMappingURL=hide.js.map