feat(32.2-01): per-item rows and item actions on My account contributions

- pact: AccountContribution.Items/ItemActions/ItemsEmpty, AccountItem,
  AccountItemAction, AccountItemActionInput, ErrAccountItemNotFound
- cabana: the list sends items (null without Items), permitted item actions
  and the empty line; boot refuses item actions without Items
- cabana: POST {api}/account/contribution-items/{name}/{item}/actions/{action}
  runs only for an item the administrator's own Items listed, in a transaction
  (path outside /account/contributions/ to avoid a ServeMux overlap)
- swag views; admin.json and schema.d.ts regenerated; route inventories
This commit is contained in:
Jakub Zych
2026-11-21 00:22:13 +01:00
parent 97d7ee0586
commit 3f7ce6020d
16 changed files with 706 additions and 30 deletions

View File

@@ -210,6 +210,88 @@ export interface paths {
patch?: never;
trace?: never;
};
"/account/contribution-items/{name}/{item}/actions/{action}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Run a My account item action
* @description Runs one item action of a contributed section on one of the signed-in admin's rows. The action's permissions are checked (403); an item the section's Items does not list for this admin, or one that is gone, is 404. The answer is the action's message and an optional URL to open. Personal API tokens are refused (403 interactive_only).
*/
post: {
parameters: {
query?: never;
header?: never;
path: {
/** @description Section name */
name: string;
/** @description Item id */
item: string;
/** @description Item action name */
action: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["cabana.Envelope-cabana_AccountActionResultView"];
};
};
/** @description Unauthorized */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["cabana.ErrorEnvelope"];
};
};
/** @description Forbidden */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["cabana.ErrorEnvelope"];
};
};
/** @description Not Found */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["cabana.ErrorEnvelope"];
};
};
/** @description Unprocessable Entity */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["cabana.ErrorEnvelope"];
};
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/account/contributions": {
parameters: {
query?: never;
@@ -6200,12 +6282,29 @@ export interface components {
actions: components["schemas"]["cabana.AccountContributionActionView"][];
description: string;
/**
* @description Error is true when the section's status or one of its actions could
* not be loaded (the plugin's Status or an action's Applies failed; that
* action is left out); the other sections are answered as usual. Absent
* otherwise.
* @description Error is true when the section's status, its items or one of its
* actions could not be loaded (the plugin's Status, Items or an action's
* Applies failed; that action is left out); the other sections are
* answered as usual. Absent otherwise.
*/
error?: boolean;
/**
* @description ItemActions are the buttons of each row the admin holds the
* permissions for; null for a section without Items. Confirm may hold
* :title, which the admin fills with the row's title.
*/
item_actions: components["schemas"]["cabana.AccountContributionActionView"][];
/**
* @description Items are the signed-in admin's rows of a section with an Items
* function: an array, possibly empty. null for a section without Items
* and when the section's Items failed.
*/
items: components["schemas"]["cabana.AccountItemView"][];
/**
* @description ItemsEmpty is the translated line for a section with no rows; "" means
* the admin's own empty line.
*/
items_empty: string;
label: string;
name: string;
/**
@@ -6214,6 +6313,12 @@ export interface components {
*/
status: string;
};
"cabana.AccountItemView": {
id: string;
meta: string[];
subtitle: string;
title: string;
};
"cabana.AdminAPIToken": {
created_at: string;
expired: boolean;