@optima-chat/commerce-cli 1.17.2 → 1.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/commerce-storefront/SKILL.md +54 -132
- package/dist/api/rest/commerce.d.ts +5 -0
- package/dist/api/rest/commerce.d.ts.map +1 -1
- package/dist/api/rest/commerce.js +7 -0
- package/dist/api/rest/commerce.js.map +1 -1
- package/dist/commands/homepage/get-config.js +9 -0
- package/dist/commands/homepage/get-config.js.map +1 -1
- package/dist/commands/homepage/index.d.ts.map +1 -1
- package/dist/commands/homepage/index.js +2 -0
- package/dist/commands/homepage/index.js.map +1 -1
- package/dist/commands/homepage/update-page-settings.d.ts +3 -0
- package/dist/commands/homepage/update-page-settings.d.ts.map +1 -0
- package/dist/commands/homepage/update-page-settings.js +111 -0
- package/dist/commands/homepage/update-page-settings.js.map +1 -0
- package/dist/commands/order/ship.d.ts.map +1 -1
- package/dist/commands/order/ship.js +59 -21
- package/dist/commands/order/ship.js.map +1 -1
- package/dist/commands/pdp/add.d.ts +3 -0
- package/dist/commands/pdp/add.d.ts.map +1 -0
- package/dist/commands/pdp/add.js +234 -0
- package/dist/commands/pdp/add.js.map +1 -0
- package/dist/commands/pdp/edit.d.ts +3 -0
- package/dist/commands/pdp/edit.d.ts.map +1 -0
- package/dist/commands/pdp/edit.js +258 -0
- package/dist/commands/pdp/edit.js.map +1 -0
- package/dist/commands/pdp/hide.d.ts +3 -0
- package/dist/commands/pdp/hide.d.ts.map +1 -0
- package/dist/commands/pdp/hide.js +191 -0
- package/dist/commands/pdp/hide.js.map +1 -0
- package/dist/commands/pdp/index.d.ts +4 -0
- package/dist/commands/pdp/index.d.ts.map +1 -0
- package/dist/commands/pdp/index.js +19 -0
- package/dist/commands/pdp/index.js.map +1 -0
- package/dist/commands/pdp/reorder.d.ts +3 -0
- package/dist/commands/pdp/reorder.d.ts.map +1 -0
- package/dist/commands/pdp/reorder.js +117 -0
- package/dist/commands/pdp/reorder.js.map +1 -0
- package/dist/commands/pdp/reset.d.ts +3 -0
- package/dist/commands/pdp/reset.d.ts.map +1 -0
- package/dist/commands/pdp/reset.js +123 -0
- package/dist/commands/pdp/reset.js.map +1 -0
- package/dist/commands/pdp/show.d.ts +3 -0
- package/dist/commands/pdp/show.d.ts.map +1 -0
- package/dist/commands/pdp/show.js +225 -0
- package/dist/commands/pdp/show.js.map +1 -0
- package/dist/commands/pdp/translate.d.ts +3 -0
- package/dist/commands/pdp/translate.d.ts.map +1 -0
- package/dist/commands/pdp/translate.js +258 -0
- package/dist/commands/pdp/translate.js.map +1 -0
- package/dist/commands/pdp/utils.d.ts +34 -0
- package/dist/commands/pdp/utils.d.ts.map +1 -0
- package/dist/commands/pdp/utils.js +85 -0
- package/dist/commands/pdp/utils.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/commands/product-page/create.d.ts +0 -3
- package/dist/commands/product-page/create.d.ts.map +0 -1
- package/dist/commands/product-page/create.js +0 -218
- package/dist/commands/product-page/create.js.map +0 -1
- package/dist/commands/product-page/delete.d.ts +0 -3
- package/dist/commands/product-page/delete.d.ts.map +0 -1
- package/dist/commands/product-page/delete.js +0 -86
- package/dist/commands/product-page/delete.js.map +0 -1
- package/dist/commands/product-page/hide.d.ts +0 -3
- package/dist/commands/product-page/hide.d.ts.map +0 -1
- package/dist/commands/product-page/hide.js +0 -82
- package/dist/commands/product-page/hide.js.map +0 -1
- package/dist/commands/product-page/index.d.ts +0 -4
- package/dist/commands/product-page/index.d.ts.map +0 -1
- package/dist/commands/product-page/index.js +0 -23
- package/dist/commands/product-page/index.js.map +0 -1
- package/dist/commands/product-page/list.d.ts +0 -3
- package/dist/commands/product-page/list.d.ts.map +0 -1
- package/dist/commands/product-page/list.js +0 -164
- package/dist/commands/product-page/list.js.map +0 -1
- package/dist/commands/product-page/product/create.d.ts +0 -3
- package/dist/commands/product-page/product/create.d.ts.map +0 -1
- package/dist/commands/product-page/product/create.js +0 -208
- package/dist/commands/product-page/product/create.js.map +0 -1
- package/dist/commands/product-page/product/delete.d.ts +0 -3
- package/dist/commands/product-page/product/delete.d.ts.map +0 -1
- package/dist/commands/product-page/product/delete.js +0 -85
- package/dist/commands/product-page/product/delete.js.map +0 -1
- package/dist/commands/product-page/product/hide.d.ts +0 -3
- package/dist/commands/product-page/product/hide.d.ts.map +0 -1
- package/dist/commands/product-page/product/hide.js +0 -78
- package/dist/commands/product-page/product/hide.js.map +0 -1
- package/dist/commands/product-page/product/index.d.ts +0 -4
- package/dist/commands/product-page/product/index.d.ts.map +0 -1
- package/dist/commands/product-page/product/index.js +0 -17
- package/dist/commands/product-page/product/index.js.map +0 -1
- package/dist/commands/product-page/product/list.d.ts +0 -3
- package/dist/commands/product-page/product/list.d.ts.map +0 -1
- package/dist/commands/product-page/product/list.js +0 -157
- package/dist/commands/product-page/product/list.js.map +0 -1
- package/dist/commands/product-page/product/reorder.d.ts +0 -3
- package/dist/commands/product-page/product/reorder.d.ts.map +0 -1
- package/dist/commands/product-page/product/reorder.js +0 -110
- package/dist/commands/product-page/product/reorder.js.map +0 -1
- package/dist/commands/product-page/product/update.d.ts +0 -3
- package/dist/commands/product-page/product/update.d.ts.map +0 -1
- package/dist/commands/product-page/product/update.js +0 -127
- package/dist/commands/product-page/product/update.js.map +0 -1
- package/dist/commands/product-page/reorder.d.ts +0 -3
- package/dist/commands/product-page/reorder.d.ts.map +0 -1
- package/dist/commands/product-page/reorder.js +0 -111
- package/dist/commands/product-page/reorder.js.map +0 -1
- package/dist/commands/product-page/translation/delete.d.ts +0 -3
- package/dist/commands/product-page/translation/delete.d.ts.map +0 -1
- package/dist/commands/product-page/translation/delete.js +0 -97
- package/dist/commands/product-page/translation/delete.js.map +0 -1
- package/dist/commands/product-page/translation/index.d.ts +0 -4
- package/dist/commands/product-page/translation/index.d.ts.map +0 -1
- package/dist/commands/product-page/translation/index.js +0 -11
- package/dist/commands/product-page/translation/index.js.map +0 -1
- package/dist/commands/product-page/translation/list.d.ts +0 -3
- package/dist/commands/product-page/translation/list.d.ts.map +0 -1
- package/dist/commands/product-page/translation/list.js +0 -104
- package/dist/commands/product-page/translation/list.js.map +0 -1
- package/dist/commands/product-page/translation/set.d.ts +0 -3
- package/dist/commands/product-page/translation/set.d.ts.map +0 -1
- package/dist/commands/product-page/translation/set.js +0 -151
- package/dist/commands/product-page/translation/set.js.map +0 -1
- package/dist/commands/product-page/update.d.ts +0 -3
- package/dist/commands/product-page/update.d.ts.map +0 -1
- package/dist/commands/product-page/update.js +0 -137
- package/dist/commands/product-page/update.js.map +0 -1
|
@@ -0,0 +1,234 @@
|
|
|
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
|
+
import { resolveProductId } from './utils.js';
|
|
10
|
+
const HANDLE_PATTERN = /^[a-z0-9-]+$/;
|
|
11
|
+
const cmd = new Command('add')
|
|
12
|
+
.description('Add a new custom section to the product detail page')
|
|
13
|
+
.option('--handle <handle>', 'Section identifier (lowercase, digits, hyphens)')
|
|
14
|
+
.option('--title <title>', 'Section title (creates default-language translation)')
|
|
15
|
+
.option('--content <content>', 'Markdown content (supports template variables)')
|
|
16
|
+
.option('--type <type>', 'Section type: collapsible | static (default: collapsible)')
|
|
17
|
+
.option('--position <n>', 'Display position (>=1, appended to end if omitted)')
|
|
18
|
+
.option('--tab-group <group>', 'Tab group identifier')
|
|
19
|
+
.option('--product <identifier>', 'Product ID or handle (product-level if specified)')
|
|
20
|
+
.action(async (options) => {
|
|
21
|
+
try {
|
|
22
|
+
await addSection(options);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
handleError(error);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
addEnhancedHelp(cmd, {
|
|
29
|
+
examples: [
|
|
30
|
+
'# Add a collapsible section (merchant-level)',
|
|
31
|
+
'$ commerce pdp add --handle care --content "Machine washable, 30°C"',
|
|
32
|
+
'',
|
|
33
|
+
'# Add a static section with title',
|
|
34
|
+
'$ commerce pdp add --handle brand-story --type static \\',
|
|
35
|
+
' --title "Our Story" --content "## Founded in 2020\\n\\nWe believe in..."',
|
|
36
|
+
'',
|
|
37
|
+
'# Add section at a specific position',
|
|
38
|
+
'$ commerce pdp add --handle ingredients --content "100% organic cotton" --position 3',
|
|
39
|
+
'',
|
|
40
|
+
'# Add section in a tab group',
|
|
41
|
+
'$ commerce pdp add --handle specs --content "Weight: 200g" --tab-group product-info',
|
|
42
|
+
'',
|
|
43
|
+
'# Add product-level section',
|
|
44
|
+
'$ commerce pdp add --handle custom-note --content "Limited edition" --product my-product',
|
|
45
|
+
'',
|
|
46
|
+
'# Use template variables in content',
|
|
47
|
+
'$ commerce pdp add --handle dynamic --content "Details for {{product.name}}"',
|
|
48
|
+
],
|
|
49
|
+
output: {
|
|
50
|
+
example: JSON.stringify({
|
|
51
|
+
success: true,
|
|
52
|
+
data: {
|
|
53
|
+
id: 'customization-uuid',
|
|
54
|
+
merchant_id: 'merchant-uuid',
|
|
55
|
+
handle: 'care',
|
|
56
|
+
operation_type: 'new',
|
|
57
|
+
type: 'collapsible',
|
|
58
|
+
position: 4,
|
|
59
|
+
content: 'Machine washable, 30°C',
|
|
60
|
+
tab_group: null,
|
|
61
|
+
created_at: '2025-11-27T00:00:00Z',
|
|
62
|
+
updated_at: '2025-11-27T00:00:00Z',
|
|
63
|
+
},
|
|
64
|
+
message: '区块创建成功',
|
|
65
|
+
}, null, 2),
|
|
66
|
+
},
|
|
67
|
+
relatedCommands: [
|
|
68
|
+
{ command: 'pdp show', description: 'View all sections' },
|
|
69
|
+
{ command: 'pdp edit', description: 'Edit an existing section' },
|
|
70
|
+
{ command: 'pdp hide', description: 'Hide a section' },
|
|
71
|
+
{ command: 'pdp reorder', description: 'Reorder sections' },
|
|
72
|
+
{ command: 'pdp translate', description: 'Manage section translations' },
|
|
73
|
+
],
|
|
74
|
+
notes: [
|
|
75
|
+
'--handle must match ^[a-z0-9-]+$ (lowercase letters, digits, hyphens)',
|
|
76
|
+
'Default type is collapsible; use --type static for non-collapsible sections',
|
|
77
|
+
'If --position is omitted, the section is appended to the end',
|
|
78
|
+
'Content supports Markdown and template variables like {{product.name}}',
|
|
79
|
+
'If --title is provided, a default-language translation is created automatically',
|
|
80
|
+
'--product accepts a product ID (UUID) or handle for product-level sections',
|
|
81
|
+
],
|
|
82
|
+
});
|
|
83
|
+
export const addCommand = cmd;
|
|
84
|
+
async function addSection(options) {
|
|
85
|
+
let { handle, title, content, type, position, tabGroup, product } = options;
|
|
86
|
+
// Default type
|
|
87
|
+
type = type || 'collapsible';
|
|
88
|
+
if (!isInteractiveEnvironment()) {
|
|
89
|
+
// Non-interactive: validate required fields
|
|
90
|
+
if (!handle || handle.trim().length === 0) {
|
|
91
|
+
throw new ValidationError('缺少必需参数: --handle (区块标识符)', 'handle');
|
|
92
|
+
}
|
|
93
|
+
if (!content || content.trim().length === 0) {
|
|
94
|
+
throw new ValidationError('缺少必需参数: --content (区块内容)', 'content');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// Interactive: prompt for missing required fields
|
|
99
|
+
const answers = await inquirer.prompt([
|
|
100
|
+
{
|
|
101
|
+
type: 'input',
|
|
102
|
+
name: 'handle',
|
|
103
|
+
message: '区块标识符 (handle):',
|
|
104
|
+
when: !handle,
|
|
105
|
+
validate: (input) => {
|
|
106
|
+
if (input.trim().length === 0)
|
|
107
|
+
return '标识符不能为空';
|
|
108
|
+
if (!HANDLE_PATTERN.test(input))
|
|
109
|
+
return '标识符只能包含小写字母、数字和连字符 (a-z, 0-9, -)';
|
|
110
|
+
return true;
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: 'editor',
|
|
115
|
+
name: 'content',
|
|
116
|
+
message: '区块内容 (Markdown):',
|
|
117
|
+
when: !content,
|
|
118
|
+
},
|
|
119
|
+
]);
|
|
120
|
+
handle = handle || answers.handle;
|
|
121
|
+
content = content || answers.content;
|
|
122
|
+
}
|
|
123
|
+
// Validate handle format
|
|
124
|
+
if (!HANDLE_PATTERN.test(handle)) {
|
|
125
|
+
throw new ValidationError(`无效的 handle "${handle}"。必须匹配 ^[a-z0-9-]+$(小写字母、数字、连字符)`, 'handle');
|
|
126
|
+
}
|
|
127
|
+
// Validate type
|
|
128
|
+
const validTypes = ['collapsible', 'static'];
|
|
129
|
+
if (!validTypes.includes(type)) {
|
|
130
|
+
throw new ValidationError(`无效的区块类型: ${type}。有效值: ${validTypes.join(', ')}`, 'type');
|
|
131
|
+
}
|
|
132
|
+
// Validate position if provided
|
|
133
|
+
let positionNum;
|
|
134
|
+
if (position !== undefined) {
|
|
135
|
+
positionNum = parseInt(position, 10);
|
|
136
|
+
if (isNaN(positionNum) || positionNum < 1) {
|
|
137
|
+
throw new ValidationError('位置必须是 >= 1 的整数', 'position');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// Resolve product ID if provided
|
|
141
|
+
let productId;
|
|
142
|
+
if (product) {
|
|
143
|
+
productId = await resolveProductId(product);
|
|
144
|
+
}
|
|
145
|
+
const isProductLevel = !!productId;
|
|
146
|
+
const spinnerMsg = isProductLevel ? '正在创建商品级区块...' : '正在创建商户级区块...';
|
|
147
|
+
const spinner = output.spinner(spinnerMsg);
|
|
148
|
+
try {
|
|
149
|
+
const data = {
|
|
150
|
+
handle: handle,
|
|
151
|
+
operation_type: 'new',
|
|
152
|
+
type,
|
|
153
|
+
content: content,
|
|
154
|
+
};
|
|
155
|
+
if (positionNum !== undefined) {
|
|
156
|
+
data.position = positionNum;
|
|
157
|
+
}
|
|
158
|
+
if (tabGroup !== undefined) {
|
|
159
|
+
data.tab_group = tabGroup || null;
|
|
160
|
+
}
|
|
161
|
+
let result;
|
|
162
|
+
if (isProductLevel) {
|
|
163
|
+
result = await commerceApi.productSections.product.create(productId, data);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
result = await commerceApi.productSections.merchant.create(data);
|
|
167
|
+
}
|
|
168
|
+
spinner.succeed('区块创建成功!');
|
|
169
|
+
// If --title provided, create default-language translation (best-effort)
|
|
170
|
+
if (title) {
|
|
171
|
+
try {
|
|
172
|
+
let defaultLang = 'en-US';
|
|
173
|
+
try {
|
|
174
|
+
const merchantInfo = await commerceApi.merchant.getProfile();
|
|
175
|
+
if (merchantInfo.default_language) {
|
|
176
|
+
defaultLang = merchantInfo.default_language;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
// Fallback to en-US
|
|
181
|
+
}
|
|
182
|
+
const translationData = { title, content: content };
|
|
183
|
+
if (isProductLevel) {
|
|
184
|
+
await commerceApi.productSections.product.translations.set(productId, handle, defaultLang, translationData);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
await commerceApi.productSections.merchant.translations.set(handle, defaultLang, translationData);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
const msg = err?.response?.data?.message || err?.message || 'unknown error';
|
|
192
|
+
if (!output.isJson()) {
|
|
193
|
+
console.log(chalk.yellow(` Warning: failed to set title translation: ${msg}`));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (output.isJson()) {
|
|
198
|
+
output.success(result, '区块创建成功');
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
console.log();
|
|
202
|
+
console.log(chalk.green('✓ 区块创建成功!'));
|
|
203
|
+
console.log();
|
|
204
|
+
console.log(chalk.gray('ID: ') + chalk.cyan(result.id));
|
|
205
|
+
console.log(chalk.gray('Handle: ') + chalk.white(result.handle));
|
|
206
|
+
console.log(chalk.gray('操作类型: ') + chalk.white(result.operation_type));
|
|
207
|
+
if (result.type) {
|
|
208
|
+
console.log(chalk.gray('区块类型: ') + chalk.white(result.type));
|
|
209
|
+
}
|
|
210
|
+
if (result.position !== undefined) {
|
|
211
|
+
console.log(chalk.gray('位置: ') + chalk.white(result.position.toString()));
|
|
212
|
+
}
|
|
213
|
+
if (result.tab_group) {
|
|
214
|
+
console.log(chalk.gray('Tab分组: ') + chalk.white(result.tab_group));
|
|
215
|
+
}
|
|
216
|
+
if (result.content) {
|
|
217
|
+
const preview = result.content.length > 100 ? result.content.substring(0, 100) + '...' : result.content;
|
|
218
|
+
console.log(chalk.gray('内容: ') + chalk.white(preview));
|
|
219
|
+
}
|
|
220
|
+
if (isProductLevel) {
|
|
221
|
+
console.log(chalk.gray('级别: ') + chalk.white('商品级'));
|
|
222
|
+
}
|
|
223
|
+
if (title) {
|
|
224
|
+
console.log(chalk.gray('标题翻译: ') + chalk.white(title));
|
|
225
|
+
}
|
|
226
|
+
console.log();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
spinner.fail('创建区块失败');
|
|
231
|
+
throw createApiError(error);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/commands/pdp/add.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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
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { commerceApi } from '../../api/rest/commerce.js';
|
|
4
|
+
import { handleError, createApiError, ValidationError } from '../../utils/error.js';
|
|
5
|
+
import { output } from '../../utils/output.js';
|
|
6
|
+
import { addEnhancedHelp } from '../../utils/helpText.js';
|
|
7
|
+
import { resolveProductId } from './utils.js';
|
|
8
|
+
const cmd = new Command('edit')
|
|
9
|
+
.description('Edit an existing PDP section (auto-creates override from inherited sections)')
|
|
10
|
+
.requiredOption('--handle <handle>', 'Section handle to edit (required)')
|
|
11
|
+
.option('--content <content>', 'New Markdown content')
|
|
12
|
+
.option('--title <title>', 'New title (updates default-language translation)')
|
|
13
|
+
.option('--type <type>', 'Section type: collapsible | static')
|
|
14
|
+
.option('--position <n>', 'New display position')
|
|
15
|
+
.option('--tab-group <group>', 'New tab group (use "none" to clear)')
|
|
16
|
+
.option('--product <identifier>', 'Product ID or handle (product-level if specified)')
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
try {
|
|
19
|
+
await editSection(options);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
handleError(error);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
addEnhancedHelp(cmd, {
|
|
26
|
+
examples: [
|
|
27
|
+
'# Update content of a merchant-level section',
|
|
28
|
+
'$ commerce pdp edit --handle care --content "Hand wash only, cold water"',
|
|
29
|
+
'',
|
|
30
|
+
'# Change section type and position',
|
|
31
|
+
'$ commerce pdp edit --handle specs --type static --position 2',
|
|
32
|
+
'',
|
|
33
|
+
'# Update title (default-language translation)',
|
|
34
|
+
'$ commerce pdp edit --handle brand-story --title "Our Brand Story"',
|
|
35
|
+
'',
|
|
36
|
+
'# Clear tab group',
|
|
37
|
+
'$ commerce pdp edit --handle specs --tab-group none',
|
|
38
|
+
'',
|
|
39
|
+
'# Set a tab group',
|
|
40
|
+
'$ commerce pdp edit --handle specs --tab-group product-info',
|
|
41
|
+
'',
|
|
42
|
+
'# Edit a product-level section',
|
|
43
|
+
'$ commerce pdp edit --handle care --content "Special care for this product" --product my-product',
|
|
44
|
+
'',
|
|
45
|
+
'# Edit an inherited system section (auto-creates merchant override)',
|
|
46
|
+
'$ commerce pdp edit --handle highlights --position 3',
|
|
47
|
+
],
|
|
48
|
+
output: {
|
|
49
|
+
example: JSON.stringify({
|
|
50
|
+
success: true,
|
|
51
|
+
data: {
|
|
52
|
+
id: 'customization-uuid',
|
|
53
|
+
merchant_id: 'merchant-uuid',
|
|
54
|
+
handle: 'care',
|
|
55
|
+
operation_type: 'override',
|
|
56
|
+
type: 'collapsible',
|
|
57
|
+
position: 2,
|
|
58
|
+
content: 'Hand wash only, cold water',
|
|
59
|
+
tab_group: null,
|
|
60
|
+
created_at: '2025-11-27T00:00:00Z',
|
|
61
|
+
updated_at: '2025-11-27T00:00:00Z',
|
|
62
|
+
},
|
|
63
|
+
message: 'Section updated',
|
|
64
|
+
}, null, 2),
|
|
65
|
+
},
|
|
66
|
+
relatedCommands: [
|
|
67
|
+
{ command: 'pdp show', description: 'View all sections' },
|
|
68
|
+
{ command: 'pdp add', description: 'Add a new section' },
|
|
69
|
+
{ command: 'pdp hide', description: 'Hide a section' },
|
|
70
|
+
{ command: 'pdp reorder', description: 'Reorder sections' },
|
|
71
|
+
{ command: 'pdp translate', description: 'Manage section translations' },
|
|
72
|
+
],
|
|
73
|
+
notes: [
|
|
74
|
+
'--handle is required to identify the section to edit',
|
|
75
|
+
'At least one of --content, --title, --type, --position, or --tab-group must be provided',
|
|
76
|
+
'If the section is inherited (e.g., from system), an override is automatically created',
|
|
77
|
+
'Use --tab-group none to clear the tab group (sends null to API)',
|
|
78
|
+
'--title updates the default-language translation (best-effort)',
|
|
79
|
+
'--product accepts a product ID (UUID) or handle for product-level edits',
|
|
80
|
+
],
|
|
81
|
+
});
|
|
82
|
+
export const editCommand = cmd;
|
|
83
|
+
async function editSection(options) {
|
|
84
|
+
const { handle, content, title, type, position, tabGroup, product } = options;
|
|
85
|
+
// Validate: at least one field to update
|
|
86
|
+
if (!content && !title && !type && position === undefined && tabGroup === undefined) {
|
|
87
|
+
throw new ValidationError('At least one field to update is required (--content, --title, --type, --position, or --tab-group).', 'options');
|
|
88
|
+
}
|
|
89
|
+
// Validate type if provided
|
|
90
|
+
if (type) {
|
|
91
|
+
const validTypes = ['collapsible', 'static'];
|
|
92
|
+
if (!validTypes.includes(type)) {
|
|
93
|
+
throw new ValidationError(`无效的区块类型: ${type}。有效值: ${validTypes.join(', ')}`, 'type');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// Validate position if provided
|
|
97
|
+
let positionNum;
|
|
98
|
+
if (position !== undefined) {
|
|
99
|
+
positionNum = parseInt(position, 10);
|
|
100
|
+
if (isNaN(positionNum) || positionNum < 1) {
|
|
101
|
+
throw new ValidationError('位置必须是 >= 1 的整数', 'position');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Handle tab-group "none" → null, undefined means "don't change"
|
|
105
|
+
const tabGroupValue = tabGroup === 'none' ? null : (tabGroup || undefined);
|
|
106
|
+
// Resolve product ID if provided
|
|
107
|
+
let productId;
|
|
108
|
+
if (product) {
|
|
109
|
+
productId = await resolveProductId(product);
|
|
110
|
+
}
|
|
111
|
+
const isProductLevel = !!productId;
|
|
112
|
+
const spinnerMsg = isProductLevel ? '正在编辑商品级区块...' : '正在编辑商户级区块...';
|
|
113
|
+
const spinner = output.spinner(spinnerMsg);
|
|
114
|
+
try {
|
|
115
|
+
// Step 1: Fetch resolved view to find the target section
|
|
116
|
+
let resolved;
|
|
117
|
+
if (isProductLevel) {
|
|
118
|
+
resolved = await commerceApi.productSections.product.listResolved(productId);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
resolved = await commerceApi.productSections.merchant.listResolved();
|
|
122
|
+
}
|
|
123
|
+
// Step 2: Find section by handle
|
|
124
|
+
const section = resolved.sections.find((s) => s.handle === handle);
|
|
125
|
+
if (!section) {
|
|
126
|
+
spinner.fail('区块未找到');
|
|
127
|
+
throw new ValidationError(`Section "${handle}" not found. Use 'commerce pdp show' to see available sections, or 'commerce pdp add' to create a new one.`, 'handle');
|
|
128
|
+
}
|
|
129
|
+
// Step 3: Determine if customization exists at current level
|
|
130
|
+
const currentLevelSource = isProductLevel ? 'product' : 'merchant';
|
|
131
|
+
const isCurrentLevel = section.source === currentLevelSource;
|
|
132
|
+
let result;
|
|
133
|
+
let createdOverride = false;
|
|
134
|
+
if (isCurrentLevel) {
|
|
135
|
+
// Current level already has customization — PUT with only changed fields
|
|
136
|
+
const updateData = {};
|
|
137
|
+
if (content !== undefined)
|
|
138
|
+
updateData.content = content;
|
|
139
|
+
if (type !== undefined)
|
|
140
|
+
updateData.type = type;
|
|
141
|
+
if (positionNum !== undefined)
|
|
142
|
+
updateData.position = positionNum;
|
|
143
|
+
if (tabGroupValue !== undefined)
|
|
144
|
+
updateData.tab_group = tabGroupValue;
|
|
145
|
+
if (isProductLevel) {
|
|
146
|
+
result = await commerceApi.productSections.product.update(productId, handle, updateData);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
result = await commerceApi.productSections.merchant.update(handle, updateData);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
// Inherited from upper layer — must create override via POST
|
|
154
|
+
// Read parent values from resolved section, merge user-provided fields on top
|
|
155
|
+
const createData = {
|
|
156
|
+
handle: handle,
|
|
157
|
+
operation_type: 'override',
|
|
158
|
+
type: type || section.type,
|
|
159
|
+
position: positionNum !== undefined ? positionNum : section.position,
|
|
160
|
+
content: content !== undefined ? content : section.content,
|
|
161
|
+
};
|
|
162
|
+
// Handle tab_group: user-provided takes precedence, otherwise inherit
|
|
163
|
+
if (tabGroup === 'none') {
|
|
164
|
+
createData.tab_group = null;
|
|
165
|
+
}
|
|
166
|
+
else if (tabGroup !== undefined) {
|
|
167
|
+
createData.tab_group = tabGroup;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
createData.tab_group = section.tab_group;
|
|
171
|
+
}
|
|
172
|
+
if (isProductLevel) {
|
|
173
|
+
result = await commerceApi.productSections.product.create(productId, createData);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
result = await commerceApi.productSections.merchant.create(createData);
|
|
177
|
+
}
|
|
178
|
+
createdOverride = true;
|
|
179
|
+
}
|
|
180
|
+
spinner.succeed('区块编辑成功!');
|
|
181
|
+
// Step 4: If --title provided, update default-language translation (best-effort)
|
|
182
|
+
if (title) {
|
|
183
|
+
try {
|
|
184
|
+
let defaultLang = 'en-US';
|
|
185
|
+
try {
|
|
186
|
+
const merchantInfo = await commerceApi.merchant.getProfile();
|
|
187
|
+
if (merchantInfo.default_language) {
|
|
188
|
+
defaultLang = merchantInfo.default_language;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
// Fallback to en-US
|
|
193
|
+
}
|
|
194
|
+
const translationData = { title: title };
|
|
195
|
+
if (content !== undefined) {
|
|
196
|
+
translationData.content = content;
|
|
197
|
+
}
|
|
198
|
+
if (isProductLevel) {
|
|
199
|
+
await commerceApi.productSections.product.translations.set(productId, handle, defaultLang, translationData);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
await commerceApi.productSections.merchant.translations.set(handle, defaultLang, translationData);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch (err) {
|
|
206
|
+
const msg = err?.response?.data?.message || err?.message || 'unknown error';
|
|
207
|
+
if (!output.isJson()) {
|
|
208
|
+
console.log(chalk.yellow(` Warning: failed to set title translation: ${msg}`));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (output.isJson()) {
|
|
213
|
+
output.success(result, 'Section updated');
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
console.log();
|
|
217
|
+
console.log(chalk.green('✓ 区块编辑成功!'));
|
|
218
|
+
if (createdOverride) {
|
|
219
|
+
console.log(chalk.yellow(` (从 ${section.source} 级继承,已自动创建 ${currentLevelSource} 级覆盖)`));
|
|
220
|
+
}
|
|
221
|
+
console.log();
|
|
222
|
+
console.log(chalk.gray('ID: ') + chalk.cyan(result.id));
|
|
223
|
+
console.log(chalk.gray('Handle: ') + chalk.white(result.handle));
|
|
224
|
+
console.log(chalk.gray('操作类型: ') + chalk.white(result.operation_type));
|
|
225
|
+
if (result.type) {
|
|
226
|
+
console.log(chalk.gray('区块类型: ') + chalk.white(result.type));
|
|
227
|
+
}
|
|
228
|
+
if (result.position !== undefined) {
|
|
229
|
+
console.log(chalk.gray('位置: ') + chalk.white(result.position.toString()));
|
|
230
|
+
}
|
|
231
|
+
if (result.tab_group) {
|
|
232
|
+
console.log(chalk.gray('Tab分组: ') + chalk.white(result.tab_group));
|
|
233
|
+
}
|
|
234
|
+
else if (tabGroup === 'none') {
|
|
235
|
+
console.log(chalk.gray('Tab分组: ') + chalk.white('(已清除)'));
|
|
236
|
+
}
|
|
237
|
+
if (result.content) {
|
|
238
|
+
const preview = result.content.length > 100 ? result.content.substring(0, 100) + '...' : result.content;
|
|
239
|
+
console.log(chalk.gray('内容: ') + chalk.white(preview));
|
|
240
|
+
}
|
|
241
|
+
if (isProductLevel) {
|
|
242
|
+
console.log(chalk.gray('级别: ') + chalk.white('商品级'));
|
|
243
|
+
}
|
|
244
|
+
if (title) {
|
|
245
|
+
console.log(chalk.gray('标题翻译: ') + chalk.white(title));
|
|
246
|
+
}
|
|
247
|
+
console.log();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
if (error instanceof ValidationError) {
|
|
252
|
+
throw error;
|
|
253
|
+
}
|
|
254
|
+
spinner.fail('编辑区块失败');
|
|
255
|
+
throw createApiError(error);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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