@optima-chat/commerce-cli 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/.claude/skills/commerce-storefront/SKILL.md +183 -3
  2. package/dist/api/rest/commerce.d.ts +170 -1
  3. package/dist/api/rest/commerce.d.ts.map +1 -1
  4. package/dist/api/rest/commerce.js +167 -0
  5. package/dist/api/rest/commerce.js.map +1 -1
  6. package/dist/commands/section/create.d.ts +3 -0
  7. package/dist/commands/section/create.d.ts.map +1 -0
  8. package/dist/commands/section/create.js +218 -0
  9. package/dist/commands/section/create.js.map +1 -0
  10. package/dist/commands/section/delete.d.ts +3 -0
  11. package/dist/commands/section/delete.d.ts.map +1 -0
  12. package/dist/commands/section/delete.js +86 -0
  13. package/dist/commands/section/delete.js.map +1 -0
  14. package/dist/commands/section/hide.d.ts +3 -0
  15. package/dist/commands/section/hide.d.ts.map +1 -0
  16. package/dist/commands/section/hide.js +82 -0
  17. package/dist/commands/section/hide.js.map +1 -0
  18. package/dist/commands/section/index.d.ts +4 -0
  19. package/dist/commands/section/index.d.ts.map +1 -0
  20. package/dist/commands/section/index.js +23 -0
  21. package/dist/commands/section/index.js.map +1 -0
  22. package/dist/commands/section/list.d.ts +3 -0
  23. package/dist/commands/section/list.d.ts.map +1 -0
  24. package/dist/commands/section/list.js +164 -0
  25. package/dist/commands/section/list.js.map +1 -0
  26. package/dist/commands/section/product/create.d.ts +3 -0
  27. package/dist/commands/section/product/create.d.ts.map +1 -0
  28. package/dist/commands/section/product/create.js +208 -0
  29. package/dist/commands/section/product/create.js.map +1 -0
  30. package/dist/commands/section/product/delete.d.ts +3 -0
  31. package/dist/commands/section/product/delete.d.ts.map +1 -0
  32. package/dist/commands/section/product/delete.js +85 -0
  33. package/dist/commands/section/product/delete.js.map +1 -0
  34. package/dist/commands/section/product/hide.d.ts +3 -0
  35. package/dist/commands/section/product/hide.d.ts.map +1 -0
  36. package/dist/commands/section/product/hide.js +78 -0
  37. package/dist/commands/section/product/hide.js.map +1 -0
  38. package/dist/commands/section/product/index.d.ts +4 -0
  39. package/dist/commands/section/product/index.d.ts.map +1 -0
  40. package/dist/commands/section/product/index.js +17 -0
  41. package/dist/commands/section/product/index.js.map +1 -0
  42. package/dist/commands/section/product/list.d.ts +3 -0
  43. package/dist/commands/section/product/list.d.ts.map +1 -0
  44. package/dist/commands/section/product/list.js +157 -0
  45. package/dist/commands/section/product/list.js.map +1 -0
  46. package/dist/commands/section/product/reorder.d.ts +3 -0
  47. package/dist/commands/section/product/reorder.d.ts.map +1 -0
  48. package/dist/commands/section/product/reorder.js +110 -0
  49. package/dist/commands/section/product/reorder.js.map +1 -0
  50. package/dist/commands/section/product/update.d.ts +3 -0
  51. package/dist/commands/section/product/update.d.ts.map +1 -0
  52. package/dist/commands/section/product/update.js +127 -0
  53. package/dist/commands/section/product/update.js.map +1 -0
  54. package/dist/commands/section/reorder.d.ts +3 -0
  55. package/dist/commands/section/reorder.d.ts.map +1 -0
  56. package/dist/commands/section/reorder.js +111 -0
  57. package/dist/commands/section/reorder.js.map +1 -0
  58. package/dist/commands/section/translation/delete.d.ts +3 -0
  59. package/dist/commands/section/translation/delete.d.ts.map +1 -0
  60. package/dist/commands/section/translation/delete.js +97 -0
  61. package/dist/commands/section/translation/delete.js.map +1 -0
  62. package/dist/commands/section/translation/index.d.ts +4 -0
  63. package/dist/commands/section/translation/index.d.ts.map +1 -0
  64. package/dist/commands/section/translation/index.js +11 -0
  65. package/dist/commands/section/translation/index.js.map +1 -0
  66. package/dist/commands/section/translation/list.d.ts +3 -0
  67. package/dist/commands/section/translation/list.d.ts.map +1 -0
  68. package/dist/commands/section/translation/list.js +104 -0
  69. package/dist/commands/section/translation/list.js.map +1 -0
  70. package/dist/commands/section/translation/set.d.ts +3 -0
  71. package/dist/commands/section/translation/set.d.ts.map +1 -0
  72. package/dist/commands/section/translation/set.js +151 -0
  73. package/dist/commands/section/translation/set.js.map +1 -0
  74. package/dist/commands/section/update.d.ts +3 -0
  75. package/dist/commands/section/update.d.ts.map +1 -0
  76. package/dist/commands/section/update.js +137 -0
  77. package/dist/commands/section/update.js.map +1 -0
  78. package/dist/index.js +8 -6
  79. package/dist/index.js.map +1 -1
  80. package/dist/utils/config.d.ts +4 -1
  81. package/dist/utils/config.d.ts.map +1 -1
  82. package/dist/utils/config.js +10 -2
  83. package/dist/utils/config.js.map +1 -1
  84. package/package.json +1 -1
@@ -0,0 +1,164 @@
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('list')
8
+ .description('List product page sections (merchant-level)')
9
+ .option('--resolved', 'Show merged view with System + Merchant layers (recommended)')
10
+ .action(async (options) => {
11
+ try {
12
+ await listSections(options);
13
+ }
14
+ catch (error) {
15
+ handleError(error);
16
+ }
17
+ });
18
+ addEnhancedHelp(cmd, {
19
+ examples: [
20
+ '# List merchant customizations only (usually empty for new merchants)',
21
+ '$ commerce section list',
22
+ '',
23
+ '# List merged view with all sections (recommended)',
24
+ '$ commerce section list --resolved',
25
+ ],
26
+ output: {
27
+ example: JSON.stringify({
28
+ success: true,
29
+ data: {
30
+ sections: [
31
+ {
32
+ handle: 'highlights',
33
+ source: 'system',
34
+ type: 'static',
35
+ position: 1,
36
+ is_hidden: false,
37
+ content: '',
38
+ translations: {
39
+ 'en-US': { title: 'Highlights', content: '' },
40
+ 'zh-CN': { title: '产品亮点', content: '' },
41
+ },
42
+ },
43
+ {
44
+ handle: 'care',
45
+ source: 'merchant',
46
+ type: 'collapsible',
47
+ position: 4,
48
+ is_hidden: false,
49
+ content: 'Custom care instructions...',
50
+ translations: {},
51
+ },
52
+ ],
53
+ available_languages: ['en-US', 'zh-CN', 'ja-JP'],
54
+ },
55
+ }, null, 2),
56
+ },
57
+ relatedCommands: [
58
+ { command: 'section create', description: 'Create/override a section' },
59
+ { command: 'section product list', description: 'List product-level sections' },
60
+ { command: 'section hide', description: 'Hide a section' },
61
+ ],
62
+ notes: [
63
+ 'Without --resolved: shows only merchant customizations (may be empty)',
64
+ 'With --resolved: shows System + Merchant merged view (recommended for daily use)',
65
+ 'source field indicates origin: system | merchant',
66
+ 'is_hidden indicates if section is hidden from product pages',
67
+ ],
68
+ });
69
+ export const listSectionsCommand = cmd;
70
+ async function listSections(options) {
71
+ const spinner = output.spinner('正在获取商品页区块配置...');
72
+ try {
73
+ if (options.resolved) {
74
+ // 获取合并后的视图
75
+ const result = await commerceApi.productSections.merchant.listResolved();
76
+ spinner.succeed('区块配置获取成功');
77
+ if (!result.sections || result.sections.length === 0) {
78
+ if (output.isJson()) {
79
+ output.success({ sections: [], available_languages: result.available_languages || [] }, '暂无区块配置');
80
+ }
81
+ else {
82
+ console.log(chalk.yellow('\n暂无区块配置\n'));
83
+ }
84
+ return;
85
+ }
86
+ if (output.isJson()) {
87
+ output.success(result);
88
+ }
89
+ else {
90
+ console.log();
91
+ console.log(chalk.bold('商品页区块配置(合并视图):\n'));
92
+ result.sections.forEach((section, index) => {
93
+ const sourceColor = section.source === 'system' ? chalk.gray : chalk.cyan;
94
+ const hiddenBadge = section.is_hidden ? chalk.red(' [已隐藏]') : '';
95
+ console.log(chalk.white(`${index + 1}. ${section.handle}`) + hiddenBadge);
96
+ console.log(chalk.gray(` 来源: `) + sourceColor(section.source));
97
+ console.log(chalk.gray(` 类型: ${section.type}`));
98
+ console.log(chalk.gray(` 位置: ${section.position}`));
99
+ if (section.tab_group) {
100
+ console.log(chalk.gray(` Tab分组: ${section.tab_group}`));
101
+ }
102
+ if (section.content) {
103
+ const preview = section.content.length > 50 ? section.content.substring(0, 50) + '...' : section.content;
104
+ console.log(chalk.gray(` 内容: ${preview}`));
105
+ }
106
+ const langCount = Object.keys(section.translations || {}).length;
107
+ if (langCount > 0) {
108
+ console.log(chalk.gray(` 翻译: ${langCount} 种语言`));
109
+ }
110
+ console.log();
111
+ });
112
+ console.log(chalk.gray(`共 ${result.sections.length} 个区块`));
113
+ if (result.available_languages && result.available_languages.length > 0) {
114
+ console.log(chalk.gray(`支持语言: ${result.available_languages.join(', ')}`));
115
+ }
116
+ console.log();
117
+ }
118
+ }
119
+ else {
120
+ // 仅获取商户自定义
121
+ const sections = await commerceApi.productSections.merchant.list();
122
+ spinner.succeed('商户自定义获取成功');
123
+ if (!sections || sections.length === 0) {
124
+ if (output.isJson()) {
125
+ output.success({ sections: [] }, '暂无商户自定义(提示: 使用 --resolved 查看完整视图)');
126
+ }
127
+ else {
128
+ console.log(chalk.yellow('\n暂无商户自定义'));
129
+ console.log(chalk.gray('提示: 使用 --resolved 查看 System + Merchant 合并后的完整视图\n'));
130
+ }
131
+ return;
132
+ }
133
+ if (output.isJson()) {
134
+ output.success({ sections });
135
+ }
136
+ else {
137
+ console.log();
138
+ console.log(chalk.bold('商户自定义区块:\n'));
139
+ sections.forEach((section, index) => {
140
+ console.log(chalk.cyan(`${index + 1}. ${section.handle}`));
141
+ console.log(chalk.gray(` ID: ${section.id}`));
142
+ console.log(chalk.gray(` 操作类型: ${section.operation_type}`));
143
+ console.log(chalk.gray(` 区块类型: ${section.type}`));
144
+ console.log(chalk.gray(` 位置: ${section.position}`));
145
+ if (section.tab_group) {
146
+ console.log(chalk.gray(` Tab分组: ${section.tab_group}`));
147
+ }
148
+ if (section.content) {
149
+ const preview = section.content.length > 50 ? section.content.substring(0, 50) + '...' : section.content;
150
+ console.log(chalk.gray(` 内容: ${preview}`));
151
+ }
152
+ console.log();
153
+ });
154
+ console.log(chalk.gray(`共 ${sections.length} 个自定义`));
155
+ console.log(chalk.gray('提示: 使用 --resolved 查看完整的合并视图\n'));
156
+ }
157
+ }
158
+ }
159
+ catch (error) {
160
+ spinner.fail('获取区块配置失败');
161
+ throw createApiError(error);
162
+ }
163
+ }
164
+ //# sourceMappingURL=list.js.map
@@ -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C,CAAC;IAC9B,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const createProductSectionCommand: Command;
3
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/commands/section/product/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkFpC,eAAO,MAAM,2BAA2B,SAAM,CAAC"}
@@ -0,0 +1,208 @@
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 (product-level)')
11
+ .argument('<product-id>', 'Product ID')
12
+ .option('--handle <handle>', 'Section handle/identifier (required)')
13
+ .option('--operation-type <type>', 'Operation type: override | new | hidden (required)')
14
+ .option('--type <type>', 'Section type: collapsible | static (required for override/new)')
15
+ .option('--position <n>', 'Display position (required for override/new)')
16
+ .option('--content <text>', 'Section content in Markdown (required for override/new)')
17
+ .option('--tab-group <group>', 'Tab group name (optional)')
18
+ .option('--inherit-translations', 'Inherit translations from parent layer')
19
+ .action(async (productId, options) => {
20
+ try {
21
+ await createProductSection(productId, options);
22
+ }
23
+ catch (error) {
24
+ handleError(error);
25
+ }
26
+ });
27
+ addEnhancedHelp(cmd, {
28
+ examples: [
29
+ '# Override care section for a specific product',
30
+ '$ commerce section product create prod-123 --handle care --operation-type override \\',
31
+ ' --type collapsible --position 4 --content "This silk product requires dry cleaning."',
32
+ '',
33
+ '# Create a product-specific section',
34
+ '$ commerce section product create prod-123 --handle ingredients --operation-type new \\',
35
+ ' --type collapsible --position 5 --content "100% organic cotton"',
36
+ '',
37
+ '# Hide a section for this product only',
38
+ '$ commerce section product create prod-123 --handle eco-friendly --operation-type hidden',
39
+ ],
40
+ output: {
41
+ example: JSON.stringify({
42
+ success: true,
43
+ data: {
44
+ id: 'override-uuid',
45
+ product_id: 'prod-123',
46
+ handle: 'care',
47
+ operation_type: 'override',
48
+ type: 'collapsible',
49
+ position: 4,
50
+ content: 'This silk product requires dry cleaning.',
51
+ tab_group: null,
52
+ },
53
+ message: '商品区块创建成功',
54
+ }, null, 2),
55
+ },
56
+ relatedCommands: [
57
+ { command: 'section product list --resolved', description: 'View product sections' },
58
+ { command: 'section create', description: 'Create merchant-level section (affects all products)' },
59
+ { command: 'section product hide', description: 'Quick hide a section' },
60
+ ],
61
+ notes: [
62
+ 'Product-level overrides have highest priority (Product > Merchant > System)',
63
+ 'Use this for product-specific customizations only',
64
+ 'For changes affecting all products, use merchant-level: section create',
65
+ ],
66
+ });
67
+ export const createProductSectionCommand = cmd;
68
+ async function createProductSection(productId, options) {
69
+ let { handle, operationType, type, position, content, tabGroup, inheritTranslations } = options;
70
+ // 非交互模式下验证必需参数
71
+ if (!isInteractiveEnvironment()) {
72
+ if (!handle || handle.trim().length === 0) {
73
+ throw new ValidationError('缺少必需参数: --handle (区块标识符)', 'handle');
74
+ }
75
+ if (!operationType || operationType.trim().length === 0) {
76
+ throw new ValidationError('缺少必需参数: --operation-type (操作类型: override | new | hidden)', 'operation_type');
77
+ }
78
+ if (operationType !== 'hidden') {
79
+ if (!type || type.trim().length === 0) {
80
+ throw new ValidationError('缺少必需参数: --type (区块类型: collapsible | static)', 'type');
81
+ }
82
+ if (!position) {
83
+ throw new ValidationError('缺少必需参数: --position (显示位置)', 'position');
84
+ }
85
+ if (!content || content.trim().length === 0) {
86
+ throw new ValidationError('缺少必需参数: --content (区块内容)', 'content');
87
+ }
88
+ }
89
+ }
90
+ else {
91
+ // 交互模式
92
+ const answers = await inquirer.prompt([
93
+ {
94
+ type: 'input',
95
+ name: 'handle',
96
+ message: '区块标识符 (handle):',
97
+ when: !handle,
98
+ validate: (input) => (input.trim().length > 0 ? true : '标识符不能为空'),
99
+ },
100
+ {
101
+ type: 'list',
102
+ name: 'operationType',
103
+ message: '操作类型:',
104
+ choices: [
105
+ { name: 'override - 覆盖上层配置', value: 'override' },
106
+ { name: 'new - 创建商品专属区块', value: 'new' },
107
+ { name: 'hidden - 隐藏区块', value: 'hidden' },
108
+ ],
109
+ when: !operationType,
110
+ },
111
+ ]);
112
+ handle = handle || answers.handle;
113
+ operationType = operationType || answers.operationType;
114
+ if (operationType !== 'hidden') {
115
+ const moreAnswers = await inquirer.prompt([
116
+ {
117
+ type: 'list',
118
+ name: 'type',
119
+ message: '区块类型:',
120
+ choices: [
121
+ { name: 'collapsible - 可折叠', value: 'collapsible' },
122
+ { name: 'static - 静态', value: 'static' },
123
+ ],
124
+ when: !type,
125
+ },
126
+ {
127
+ type: 'number',
128
+ name: 'position',
129
+ message: '显示位置 (1-10):',
130
+ when: !position,
131
+ validate: (input) => (input > 0 ? true : '位置必须大于0'),
132
+ },
133
+ {
134
+ type: 'editor',
135
+ name: 'content',
136
+ message: '区块内容 (Markdown):',
137
+ when: !content,
138
+ },
139
+ ]);
140
+ type = type || moreAnswers.type;
141
+ position = position || moreAnswers.position?.toString();
142
+ content = content || moreAnswers.content;
143
+ }
144
+ }
145
+ // 验证 operationType
146
+ const validOperationTypes = ['override', 'new', 'hidden'];
147
+ if (!validOperationTypes.includes(operationType)) {
148
+ throw new ValidationError(`无效的操作类型: ${operationType}。有效值: ${validOperationTypes.join(', ')}`, 'operation_type');
149
+ }
150
+ // 验证 type
151
+ if (operationType !== 'hidden') {
152
+ const validTypes = ['collapsible', 'static'];
153
+ if (!validTypes.includes(type)) {
154
+ throw new ValidationError(`无效的区块类型: ${type}。有效值: ${validTypes.join(', ')}`, 'type');
155
+ }
156
+ }
157
+ const spinner = output.spinner('正在创建商品区块...');
158
+ try {
159
+ const data = {
160
+ handle: handle,
161
+ operation_type: operationType,
162
+ };
163
+ if (operationType !== 'hidden') {
164
+ data.type = type;
165
+ data.position = parseInt(position, 10);
166
+ data.content = content;
167
+ }
168
+ if (tabGroup !== undefined) {
169
+ data.tab_group = tabGroup || null;
170
+ }
171
+ if (inheritTranslations !== undefined) {
172
+ data.inherit_translations = inheritTranslations;
173
+ }
174
+ const result = await commerceApi.productSections.product.create(productId, data);
175
+ spinner.succeed('商品区块创建成功!');
176
+ if (output.isJson()) {
177
+ output.success(result, '商品区块创建成功');
178
+ }
179
+ else {
180
+ console.log();
181
+ console.log(chalk.green('✓ 商品区块创建成功!'));
182
+ console.log();
183
+ console.log(chalk.gray('ID: ') + chalk.cyan(result.id));
184
+ console.log(chalk.gray('商品ID: ') + chalk.white(result.product_id));
185
+ console.log(chalk.gray('Handle: ') + chalk.white(result.handle));
186
+ console.log(chalk.gray('操作类型: ') + chalk.white(result.operation_type));
187
+ if (result.type) {
188
+ console.log(chalk.gray('区块类型: ') + chalk.white(result.type));
189
+ }
190
+ if (result.position !== undefined) {
191
+ console.log(chalk.gray('位置: ') + chalk.white(result.position.toString()));
192
+ }
193
+ if (result.tab_group) {
194
+ console.log(chalk.gray('Tab分组: ') + chalk.white(result.tab_group));
195
+ }
196
+ if (result.content) {
197
+ const preview = result.content.length > 100 ? result.content.substring(0, 100) + '...' : result.content;
198
+ console.log(chalk.gray('内容: ') + chalk.white(preview));
199
+ }
200
+ console.log();
201
+ }
202
+ }
203
+ catch (error) {
204
+ spinner.fail('创建商品区块失败');
205
+ throw createApiError(error);
206
+ }
207
+ }
208
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/section/product/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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AAC,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,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 deleteProductSectionCommand: Command;
3
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/commands/section/product/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwDpC,eAAO,MAAM,2BAA2B,SAAM,CAAC"}
@@ -0,0 +1,85 @@
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 override (product-level)')
11
+ .argument('<product-id>', 'Product ID')
12
+ .argument('<handle>', 'Section handle to delete')
13
+ .option('-y, --yes', 'Skip confirmation prompt')
14
+ .action(async (productId, handle, options) => {
15
+ try {
16
+ await deleteProductSection(productId, handle, options);
17
+ }
18
+ catch (error) {
19
+ handleError(error);
20
+ }
21
+ });
22
+ addEnhancedHelp(cmd, {
23
+ examples: [
24
+ '# Delete with confirmation',
25
+ '$ commerce section product delete prod-123 care',
26
+ '',
27
+ '# Delete without confirmation',
28
+ '$ commerce section product delete prod-123 care --yes',
29
+ ],
30
+ output: {
31
+ example: JSON.stringify({
32
+ success: true,
33
+ message: '商品区块覆盖已删除',
34
+ }, null, 2),
35
+ },
36
+ relatedCommands: [
37
+ { command: 'section product list', description: 'View product overrides' },
38
+ { command: 'section product create', description: 'Create product override' },
39
+ { command: 'section product hide', description: 'Hide section instead of deleting' },
40
+ ],
41
+ notes: [
42
+ 'This deletes the product-level override only',
43
+ 'After deletion, the section will fall back to merchant-level or system default',
44
+ 'Use --yes to skip confirmation in non-interactive environments',
45
+ ],
46
+ });
47
+ export const deleteProductSectionCommand = cmd;
48
+ async function deleteProductSection(productId, handle, options) {
49
+ if (!isInteractiveEnvironment() && !options.yes) {
50
+ throw new ValidationError('非交互模式下需要 --yes 确认删除操作', 'yes');
51
+ }
52
+ if (isInteractiveEnvironment() && !options.yes) {
53
+ const { confirm } = await inquirer.prompt([
54
+ {
55
+ type: 'confirm',
56
+ name: 'confirm',
57
+ message: `确定要删除商品 "${productId}" 的区块 "${handle}" 覆盖吗?删除后将回退到商户级或系统默认。`,
58
+ default: false,
59
+ },
60
+ ]);
61
+ if (!confirm) {
62
+ console.log(chalk.yellow('已取消删除操作'));
63
+ return;
64
+ }
65
+ }
66
+ const spinner = output.spinner('正在删除商品区块覆盖...');
67
+ try {
68
+ await commerceApi.productSections.product.delete(productId, handle);
69
+ spinner.succeed('商品区块覆盖已删除!');
70
+ if (output.isJson()) {
71
+ output.success({ product_id: productId, handle }, '商品区块覆盖已删除');
72
+ }
73
+ else {
74
+ console.log();
75
+ console.log(chalk.green(`✓ 商品 "${productId}" 的区块 "${handle}" 覆盖已删除`));
76
+ console.log(chalk.gray('提示: 区块将回退到商户级配置或系统默认'));
77
+ console.log();
78
+ }
79
+ }
80
+ catch (error) {
81
+ spinner.fail('删除商品区块失败');
82
+ throw createApiError(error);
83
+ }
84
+ }
85
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/section/product/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,+BAA+B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAMzE,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC9B,WAAW,CAAC,wDAAwD,CAAC;KACrE,QAAQ,CAAC,cAAc,EAAE,YAAY,CAAC;KACtC,QAAQ,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAChD,MAAM,CAAC,WAAW,EAAE,0BAA0B,CAAC;KAC/C,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,MAAc,EAAE,OAAsB,EAAE,EAAE;IAC1E,IAAI,CAAC;QACH,MAAM,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAAC,OAAO,KAAK,E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AE,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,eAAe,CAAC,CAAC;IAEhD,IAAI,CAAC;QACH,MAAM,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACpE,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAE9B,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;YACpB,MAAM,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,SAAS,UAAU,MAAM,SAAS,CAAC,CAAC,CAAC;YACtE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;YAChD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,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 hideProductSectionCommand: Command;
3
+ //# sourceMappingURL=hide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hide.d.ts","sourceRoot":"","sources":["../../../../src/commands/section/product/hide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwDpC,eAAO,MAAM,yBAAyB,SAAM,CAAC"}
@@ -0,0 +1,78 @@
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 (product-level)')
9
+ .argument('<product-id>', 'Product ID')
10
+ .argument('<handle>', 'Section handle to hide')
11
+ .action(async (productId, handle) => {
12
+ try {
13
+ await hideProductSection(productId, handle);
14
+ }
15
+ catch (error) {
16
+ handleError(error);
17
+ }
18
+ });
19
+ addEnhancedHelp(cmd, {
20
+ examples: [
21
+ '# Hide return policy for a specific product',
22
+ '$ commerce section product hide prod-123 return',
23
+ '',
24
+ '# Hide eco-friendly section for this product only',
25
+ '$ commerce section product hide prod-123 eco-friendly',
26
+ ],
27
+ output: {
28
+ example: JSON.stringify({
29
+ success: true,
30
+ data: {
31
+ id: 'override-uuid',
32
+ product_id: 'prod-123',
33
+ handle: 'return',
34
+ operation_type: 'hidden',
35
+ },
36
+ message: '商品区块已隐藏',
37
+ }, null, 2),
38
+ },
39
+ relatedCommands: [
40
+ { command: 'section product list --resolved', description: 'View product sections (shows hidden status)' },
41
+ { command: 'section product delete', description: 'Delete override to unhide' },
42
+ { command: 'section hide', description: 'Hide for all products (merchant-level)' },
43
+ ],
44
+ notes: [
45
+ 'This hides the section for this product only',
46
+ 'Other products will still show the section',
47
+ 'To unhide, delete the override: section product delete <product-id> <handle>',
48
+ 'For hiding across all products, use: section hide',
49
+ ],
50
+ });
51
+ export const hideProductSectionCommand = cmd;
52
+ async function hideProductSection(productId, handle) {
53
+ const spinner = output.spinner('正在隐藏商品区块...');
54
+ try {
55
+ const result = await commerceApi.productSections.product.hide(productId, handle);
56
+ spinner.succeed('商品区块已隐藏!');
57
+ if (output.isJson()) {
58
+ output.success(result, '商品区块已隐藏');
59
+ }
60
+ else {
61
+ console.log();
62
+ console.log(chalk.green(`✓ 商品 "${productId}" 的区块 "${handle}" 已隐藏`));
63
+ console.log();
64
+ console.log(chalk.gray('ID: ') + chalk.cyan(result.id));
65
+ console.log(chalk.gray('商品ID: ') + chalk.white(result.product_id));
66
+ console.log(chalk.gray('Handle: ') + chalk.white(result.handle));
67
+ console.log(chalk.gray('操作类型: ') + chalk.white(result.operation_type));
68
+ console.log();
69
+ console.log(chalk.gray(`提示: 要取消隐藏,使用 commerce section product delete ${productId} ${handle}`));
70
+ console.log();
71
+ }
72
+ }
73
+ catch (error) {
74
+ spinner.fail('隐藏商品区块失败');
75
+ throw createApiError(error);
76
+ }
77
+ }
78
+ //# sourceMappingURL=hide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hide.js","sourceRoot":"","sources":["../../../../src/commands/section/product/hide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC5B,WAAW,CAAC,6CAA6C,CAAC;KAC1D,QAAQ,CAAC,cAAc,EAAE,YAAY,CAAC;KACtC,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC;KAC9C,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,MAAc,EAAE,EAAE;IAClD,IAAI,CAAC;QACH,MAAM,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC,CAAC,CAAC;A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AAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,SAAS,UAAU,MAAM,OAAO,CAAC,CAAC,CAAC;YACpE,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;YACxD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;YACnE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;YACvE,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,gDAAgD,SAAS,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC;YAC/F,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,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,4 @@
1
+ import { Command } from 'commander';
2
+ declare const productCommand: Command;
3
+ export { productCommand };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/section/product/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,QAAA,MAAM,cAAc,SACmE,CAAC;AASxF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { Command } from 'commander';
2
+ import { listProductSectionsCommand } from './list.js';
3
+ import { createProductSectionCommand } from './create.js';
4
+ import { updateProductSectionCommand } from './update.js';
5
+ import { deleteProductSectionCommand } from './delete.js';
6
+ import { hideProductSectionCommand } from './hide.js';
7
+ import { reorderProductSectionsCommand } from './reorder.js';
8
+ const productCommand = new Command('product')
9
+ .description('Product-level section management (overrides merchant/system defaults)');
10
+ productCommand.addCommand(listProductSectionsCommand);
11
+ productCommand.addCommand(createProductSectionCommand);
12
+ productCommand.addCommand(updateProductSectionCommand);
13
+ productCommand.addCommand(deleteProductSectionCommand);
14
+ productCommand.addCommand(hideProductSectionCommand);
15
+ productCommand.addCommand(reorderProductSectionsCommand);
16
+ export { productCommand };
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/section/product/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC;KAC1C,WAAW,CAAC,uEAAuE,CAAC,CAAC;AAExF,cAAc,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;AACtD,cAAc,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;AACvD,cAAc,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;AACvD,cAAc,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;AACvD,cAAc,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACrD,cAAc,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const listProductSectionsCommand: Command;
3
+ //# sourceMappingURL=list.d.ts.map