@oneentry/mcp-platform-server 0.1.7 → 0.1.8
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/data/permissions.json +1 -0
- package/dist/api/operation-notes.js +100 -78
- package/package.json +1 -1
package/data/permissions.json
CHANGED
|
@@ -214,6 +214,7 @@
|
|
|
214
214
|
"AdminTemplatePreviewsController_update": "settings.templatePreview.update",
|
|
215
215
|
"AdminTemplatePreviewsController_remove": "settings.templatePreview.delete",
|
|
216
216
|
"AdminTemplatePreviewsController_updateAttributeSetPosition": "settings.templatePreview.changePositions",
|
|
217
|
+
"AdminTemplatePreviewsController_regenerate": "settings.templatePreview.update",
|
|
217
218
|
"AdminTemplatesController_create": "settings.templates.create",
|
|
218
219
|
"AdminTemplatesController_update": "settings.templates.update",
|
|
219
220
|
"AdminTemplatesController_remove": "settings.templates.delete",
|
|
@@ -58,36 +58,39 @@ export const OPERATION_NOTES = {
|
|
|
58
58
|
'the validator is describing the query parameter you did not send.',
|
|
59
59
|
},
|
|
60
60
|
AdminProductsController_setStatusForProducts: {
|
|
61
|
-
|
|
62
|
-
'
|
|
63
|
-
'
|
|
64
|
-
'AdminProductsController_findAll.
|
|
65
|
-
'AdminProductsController_update
|
|
61
|
+
note: 'The status id goes in "statusId". The older field name "id" is accepted for the same ' +
|
|
62
|
+
'value, and a body carrying neither answers 400 rather than writing an empty status. ' +
|
|
63
|
+
'The call re-indexes what it changed, so the new status is visible to ' +
|
|
64
|
+
'AdminProductsController_findAll and not only to a read by id. For a single product, ' +
|
|
65
|
+
'sending statusId through AdminProductsController_update does the same job.',
|
|
66
66
|
verifyWith: {
|
|
67
67
|
opId: 'AdminProductsController_findOne',
|
|
68
68
|
check: 'statusId',
|
|
69
|
-
why: 'the
|
|
69
|
+
why: 'the response says the call was accepted, not which products ended up with the status',
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
72
|
AdminAttributesSetsController_create: {
|
|
73
|
-
note: 'Inside an attribute, "validators", "localizeInfos"
|
|
74
|
-
'locale first: validators.en_US.requiredValidator, not
|
|
75
|
-
'A flat map
|
|
73
|
+
note: 'Inside an attribute, "validators", "localizeInfos", "listTitles" and "additionalFields" ' +
|
|
74
|
+
'are keyed by locale first: validators.en_US.requiredValidator, not ' +
|
|
75
|
+
'validators.requiredValidator. A flat map answers 400 here, and the message names the ' +
|
|
76
|
+
'attribute and the field — only AdminAttributesSetsController_updateSchema still accepts ' +
|
|
77
|
+
'one silently. ' +
|
|
76
78
|
LIST_EXTRAS_NOTE,
|
|
77
79
|
example: LIST_ATTRIBUTE_WITH_EXTRAS,
|
|
78
80
|
verifyWith: {
|
|
79
81
|
opId: 'AdminAttributesSetsController_findOne',
|
|
80
82
|
check: 'schema[].validators.<locale>',
|
|
81
|
-
why: 'the raw set
|
|
83
|
+
why: 'the raw set is where a locale key is either present or not, whatever the panel shows',
|
|
82
84
|
},
|
|
83
85
|
},
|
|
84
86
|
AdminAttributesSetsController_update: {
|
|
85
|
-
note: 'Inside an attribute, "validators", "localizeInfos"
|
|
86
|
-
'locale first
|
|
87
|
-
'Dropping an attribute from the set
|
|
88
|
-
'
|
|
89
|
-
'read
|
|
90
|
-
'
|
|
87
|
+
note: 'Inside an attribute, "validators", "localizeInfos", "listTitles" and "additionalFields" ' +
|
|
88
|
+
'are keyed by locale first, and a flat map answers 400 here as it does on create. ' +
|
|
89
|
+
'Dropping an attribute from the set clears the values entities held under its key, but ' +
|
|
90
|
+
'not by the time the call returns: the cleanup runs behind the write, so for a short ' +
|
|
91
|
+
'window a read still shows the removed key. Do not build an update from a read taken ' +
|
|
92
|
+
'immediately after removing an attribute — compare the keys you are about to send against ' +
|
|
93
|
+
'the current set and drop the ones it no longer defines. ' +
|
|
91
94
|
LIST_EXTRAS_NOTE,
|
|
92
95
|
example: LIST_ATTRIBUTE_WITH_EXTRAS,
|
|
93
96
|
verifyWith: {
|
|
@@ -97,12 +100,18 @@ export const OPERATION_NOTES = {
|
|
|
97
100
|
},
|
|
98
101
|
},
|
|
99
102
|
AdminAttributesSetsController_updateSchema: {
|
|
100
|
-
note: 'The body is the schema object itself, never wrapped as { "schema": … }.
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'
|
|
103
|
+
note: 'The body is the schema object itself, never wrapped as { "schema": … }. Locale-keyed ' +
|
|
104
|
+
'rules apply here too, and so does the cleanup rule: an attribute removed here has its ' +
|
|
105
|
+
'values cleared behind the write, so a read taken straight afterwards can still show the ' +
|
|
106
|
+
'old key. ' +
|
|
104
107
|
LIST_EXTRAS_NOTE,
|
|
105
108
|
example: LIST_ATTRIBUTE_WITH_EXTRAS,
|
|
109
|
+
silentNoOp: 'This is the one route that does NOT check locale keying: a flat "validators", ' +
|
|
110
|
+
'"localizeInfos", "listTitles" or "additionalFields" answers 200 and is stored where no ' +
|
|
111
|
+
'consumer reads it, so a field you meant to make required is simply not enforced. Create ' +
|
|
112
|
+
'and update of the set answer 400 for the same body. Wrapping the body as ' +
|
|
113
|
+
'{ "schema": … } is worse and equally quiet: it answers 200 and replaces the set with a ' +
|
|
114
|
+
'single attribute called "schema". Read the set back after every schema replace.',
|
|
106
115
|
verifyWith: {
|
|
107
116
|
opId: 'AdminAttributesSetsController_findOne',
|
|
108
117
|
check: 'schema[].validators.<locale>',
|
|
@@ -120,13 +129,20 @@ export const OPERATION_NOTES = {
|
|
|
120
129
|
'and reports no error; the only repair is uploading the file again. That matters because ' +
|
|
121
130
|
'previewLink.default[0] is the inline placeholder a site renders while the full image ' +
|
|
122
131
|
'loads, so an image without it cannot be shown progressively. The stored record carries ' +
|
|
123
|
-
'no "alt" and no "title"
|
|
124
|
-
'
|
|
132
|
+
'no "alt" and no "title", but the attribute slot you write it into keeps whatever keys ' +
|
|
133
|
+
'you add: send "alt" and "title" beside the upload\'s own fields and they come back from ' +
|
|
134
|
+
'the public read. Use exactly those two names — the admin panel offers the same pair on ' +
|
|
135
|
+
'an image attribute value and writes them into the same slot, so text set either way ' +
|
|
136
|
+
'survives an edit made the other way.',
|
|
125
137
|
},
|
|
126
138
|
AdminMenusController_create: {
|
|
127
|
-
note: '
|
|
128
|
-
'
|
|
129
|
-
'
|
|
139
|
+
note: 'A create may carry pagesIds. The ids are checked before anything is written: one that ' +
|
|
140
|
+
'does not exist answers 404 naming it and no menu is created, so a typo costs nothing to ' +
|
|
141
|
+
'clean up. What the create does NOT do is nest anything — pagesIds is a flat set wherever ' +
|
|
142
|
+
'it appears, and the pages arrive as siblings at the top level whatever their relationship ' +
|
|
143
|
+
'in the page tree. Creating the menu empty and attaching with ' +
|
|
144
|
+
'AdminMenusController_update is equally valid and the better shape when you are building ' +
|
|
145
|
+
'the tree level by level.',
|
|
130
146
|
},
|
|
131
147
|
AdminMenusController_update: {
|
|
132
148
|
note: '"pagesIds" is a flat set of page ids and nothing else: nesting is NOT taken from the ' +
|
|
@@ -145,46 +161,52 @@ export const OPERATION_NOTES = {
|
|
|
145
161
|
AdminMenusController_createCustomItem: {
|
|
146
162
|
note: 'A custom item is for anything that is not a page: a product, an external address, a ' +
|
|
147
163
|
'column heading. An empty "value" is rejected, so a heading with no link needs a ' +
|
|
148
|
-
'placeholder target such as "#". The
|
|
149
|
-
'
|
|
150
|
-
'
|
|
151
|
-
'
|
|
152
|
-
'
|
|
153
|
-
'the
|
|
164
|
+
'placeholder target such as "#". The create body takes localizeInfos and value only: the ' +
|
|
165
|
+
'item arrives at the top level and is nested afterwards with ' +
|
|
166
|
+
'AdminMenusController_updateCustomItemPosition. Custom items and page items are numbered ' +
|
|
167
|
+
'separately, so the same number can name one of each — which is why a parent is addressed ' +
|
|
168
|
+
'by kind as well as number. Reads return "parentType" beside "parentId", and a public read ' +
|
|
169
|
+
'also returns "itemType" for the item itself, which is the value its children have to send.',
|
|
154
170
|
verifyWith: {
|
|
155
171
|
opId: 'AdminMenusController_findOne',
|
|
156
|
-
check: 'the
|
|
157
|
-
why: 'a
|
|
172
|
+
check: 'the parent of the item, its parentType, and where it appears in the tree',
|
|
173
|
+
why: 'a parent resolved to the other kind puts the item under a plausible wrong branch',
|
|
158
174
|
},
|
|
159
175
|
},
|
|
160
176
|
AdminMenusController_updatePosition: {
|
|
161
|
-
example: {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
'
|
|
168
|
-
'
|
|
169
|
-
'
|
|
170
|
-
'
|
|
171
|
-
'
|
|
177
|
+
example: {
|
|
178
|
+
position: { leftObjectId: null, rightObjectId: null },
|
|
179
|
+
newParentId: 12,
|
|
180
|
+
newParentType: 'custom',
|
|
181
|
+
},
|
|
182
|
+
note: '"position" is required even when the order does not matter, and it must be an object: a ' +
|
|
183
|
+
'body without it answers 400 naming the field, and an empty object is not enough — send ' +
|
|
184
|
+
'{ leftObjectId: null, rightObjectId: null }. Both re-parenting and sibling order apply, ' +
|
|
185
|
+
'and a public read returns the items in that order. Neighbours are addressed by the id of ' +
|
|
186
|
+
'the item, not of its position, and page items and custom items are numbered separately: ' +
|
|
187
|
+
'in a mixed row name each neighbour with "leftObjectType" and "rightObjectType", or a ' +
|
|
188
|
+
'neighbour of the other kind is not found and the item lands at the edge of the list. ' +
|
|
189
|
+
'"newParentType" says which kind the new parent is; omit it and the number is looked up ' +
|
|
190
|
+
'among pages first, which is not necessarily the parent you meant.',
|
|
172
191
|
verifyWith: {
|
|
173
192
|
opId: 'AdminMenusController_findOne',
|
|
174
|
-
check: 'the parent of the item you moved, and the order of its siblings',
|
|
175
|
-
why: '
|
|
193
|
+
check: 'the parent of the item you moved, its parentType, and the order of its siblings',
|
|
194
|
+
why: 'a neighbour or parent resolved to the other kind answers success and moves it elsewhere',
|
|
176
195
|
},
|
|
177
196
|
},
|
|
178
197
|
AdminMenusController_updateCustomItemPosition: {
|
|
179
|
-
example: {
|
|
198
|
+
example: {
|
|
199
|
+
position: { leftObjectId: null, rightObjectId: null },
|
|
200
|
+
newParentId: 12,
|
|
201
|
+
newParentType: 'custom',
|
|
202
|
+
},
|
|
180
203
|
note: 'Same body as AdminMenusController_updatePosition: "position" is required and must be an ' +
|
|
181
|
-
'object — { leftObjectId: null, rightObjectId: null } when the order does not matter
|
|
182
|
-
|
|
183
|
-
'public reads order items by page id rather than by the positions stored here.',
|
|
204
|
+
'object — { leftObjectId: null, rightObjectId: null } when the order does not matter — and ' +
|
|
205
|
+
'the kind of every neighbour and of the new parent is named alongside its number.',
|
|
184
206
|
verifyWith: {
|
|
185
207
|
opId: 'AdminMenusController_findOne',
|
|
186
|
-
check: 'the parent of the item you moved, and the order of its siblings',
|
|
187
|
-
why: '
|
|
208
|
+
check: 'the parent of the item you moved, its parentType, and the order of its siblings',
|
|
209
|
+
why: 'a neighbour or parent resolved to the other kind answers success and moves it elsewhere',
|
|
188
210
|
},
|
|
189
211
|
},
|
|
190
212
|
AdminFormsController_create: {
|
|
@@ -257,10 +279,10 @@ export const OPERATION_NOTES = {
|
|
|
257
279
|
AdminPagesController_update: {
|
|
258
280
|
note: 'Omitting parentId does not leave the parent alone — it moves the page to the root and ' +
|
|
259
281
|
'decrements the former parent\'s childrenCount. Read the page first and send parentId ' +
|
|
260
|
-
'back unchanged unless you mean to re-parent it.
|
|
261
|
-
'
|
|
262
|
-
'
|
|
263
|
-
'
|
|
282
|
+
'back unchanged unless you mean to re-parent it. "position" is safe to echo back: a ' +
|
|
283
|
+
'listing returns it as a lexorank string, and this operation accepts that string and ' +
|
|
284
|
+
'ignores it, so a read-modify-write body no longer has to be stripped of the field. It ' +
|
|
285
|
+
'also does not reorder anything — the page position operation is what changes order.',
|
|
264
286
|
verifyWith: {
|
|
265
287
|
opId: 'AdminPagesController_findOne',
|
|
266
288
|
check: 'parentId',
|
|
@@ -286,25 +308,24 @@ export const OPERATION_NOTES = {
|
|
|
286
308
|
'under "mailing", which belongs to the mailing module. Placeholders depend on the module: ' +
|
|
287
309
|
'{{ product.title }} and {{ product.<marker> }} for the catalogue, {{ user.<marker> }} ' +
|
|
288
310
|
'for the recipient. Events support six modules — catalog, forms, orders, users, payments ' +
|
|
289
|
-
'and discounts.
|
|
290
|
-
'
|
|
291
|
-
|
|
292
|
-
'
|
|
293
|
-
'
|
|
294
|
-
'
|
|
295
|
-
'the object and reporting success.',
|
|
311
|
+
'and discounts. A moduleId outside those six answers 400 and the message names every ' +
|
|
312
|
+
'module that is accepted; the same check runs on update, so an event cannot be moved onto ' +
|
|
313
|
+
'an unsupported one either. There is no content module among them, so "notify when this ' +
|
|
314
|
+
'page changes" is not an events task: say so rather than looking for a body that gets ' +
|
|
315
|
+
'through. Whether an event that fired actually reached anyone is a separate read — ' +
|
|
316
|
+
'AdminEventsController_findEmailLogs.',
|
|
296
317
|
verifyWith: {
|
|
297
318
|
opId: 'AdminEventsController_findOne',
|
|
298
319
|
check: 'moduleId and localizeInfos.<locale>.title',
|
|
299
|
-
why: '
|
|
320
|
+
why: 'a name sent only as "name" is stored and never displayed, and the create still answers 201',
|
|
300
321
|
},
|
|
301
322
|
},
|
|
302
323
|
AdminEventsController_update: {
|
|
303
324
|
note: 'The event name, the mail subject and the mail body all live in ' +
|
|
304
325
|
'localizeInfos.<locale> as "title", "subject" and "template", with "push" for the push ' +
|
|
305
326
|
'channel. Nothing about the message belongs under "mailing". Supported modules are ' +
|
|
306
|
-
'catalog, forms, orders, users, payments and discounts; any other moduleId
|
|
307
|
-
'
|
|
327
|
+
'catalog, forms, orders, users, payments and discounts; any other moduleId answers 400, ' +
|
|
328
|
+
'checked against the merged result so a partial update cannot slip past it.',
|
|
308
329
|
example: {
|
|
309
330
|
localizeInfos: {
|
|
310
331
|
en_US: {
|
|
@@ -337,28 +358,29 @@ export const OPERATION_NOTES = {
|
|
|
337
358
|
},
|
|
338
359
|
},
|
|
339
360
|
AdminDiscountsController_createCoupon: {
|
|
340
|
-
note: '
|
|
341
|
-
'for everyone, any number of times.
|
|
342
|
-
'
|
|
343
|
-
'
|
|
344
|
-
'
|
|
345
|
-
'
|
|
361
|
+
note: '"isReusable" is accepted in the body, and the default when you omit it is TRUE for this ' +
|
|
362
|
+
'operation — one code, valid for everyone, any number of times. That default is the ' +
|
|
363
|
+
'opposite of the one AdminDiscountsController_generateCouponsByMask applies, so on a ' +
|
|
364
|
+
'"first order" discount the field decides whether one customer gets the discount or ' +
|
|
365
|
+
'everyone does, permanently. State the reuse you mean rather than relying on either ' +
|
|
366
|
+
'default.',
|
|
346
367
|
verifyWith: {
|
|
347
368
|
opId: 'AdminDiscountsController_findOne',
|
|
348
369
|
check: 'the coupon\'s isReusable',
|
|
349
|
-
why: '
|
|
370
|
+
why: 'an omitted field takes a default that differs between the two ways of making a coupon',
|
|
350
371
|
},
|
|
351
372
|
},
|
|
352
373
|
AdminDiscountsController_generateCouponsByMask: {
|
|
353
|
-
note: '
|
|
354
|
-
'after the order that used it.
|
|
355
|
-
'
|
|
374
|
+
note: '"isReusable" is accepted in the body here too, and the default when you omit it is ' +
|
|
375
|
+
'FALSE — each generated code stops working after the order that used it. Send the field ' +
|
|
376
|
+
'explicitly when the reuse matters; the two coupon operations disagree only in what an ' +
|
|
377
|
+
'omitted value means.',
|
|
356
378
|
},
|
|
357
379
|
AdminProductsController_update: {
|
|
358
380
|
note: 'Always include "blocks" — send [] when there is nothing to set, because omitting it ' +
|
|
359
381
|
'fails the update. Never include "forms": the schema accepts the field and saving rejects ' +
|
|
360
|
-
'it.
|
|
361
|
-
'
|
|
382
|
+
'it. A product status can be set here with "statusId", or for many products in one call ' +
|
|
383
|
+
'with AdminProductsController_setStatusForProducts.',
|
|
362
384
|
},
|
|
363
385
|
AdminBlocksController_update: {
|
|
364
386
|
note: 'Omitting blockPages detaches the block from every page it was on. Read the block first ' +
|
package/package.json
CHANGED