Allow publishing generated documents as minor versions
Generated documents (asset list, risk register, SoA, ...) previously
only ever produced a new major version. Every regeneration of an
auto-built register consumed a major number, even when the change was
trivial. They now accept a minor flag and publish as
currentMajor.currentMinor+1 when set, bypassing the approval flow.
To carry the flag through cleanly, the document publish API was
refactored. The three split mutations (publishMajor, publishMinor,
requestDocumentVersionApproval) and the two bulk variants collapse
into a single publishDocument / bulkPublishDocuments, both taking the
new minor: Boolean! and a now-required changelog: String!. The same
shape flows through the CLI ("prb document publish --minor"), the MCP
tool, the n8n operations, and the Relay dialogs, where each
generated-doc dialog gains a "Publish as minor" button. Publishing
minor without an existing major is rejected with
ErrCannotPublishMinorWithoutMajor.
This is a deliberate breaking change for callers of the prior
mutations.
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -43,6 +43,19 @@ export const description: INodeProperties[] = [
|
||||
default: '',
|
||||
description: 'Comma-separated list of approver profile IDs',
|
||||
},
|
||||
{
|
||||
displayName: 'Minor',
|
||||
name: 'minor',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['processingActivity'],
|
||||
operation: ['publish'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to publish as a minor version. Approvers are ignored when set. The list must already have a published major version.',
|
||||
},
|
||||
];
|
||||
|
||||
export async function execute(
|
||||
@@ -51,6 +64,7 @@ export async function execute(
|
||||
): Promise<INodeExecutionData> {
|
||||
const organizationId = this.getNodeParameter('organizationId', itemIndex) as string;
|
||||
const approverIds = this.getNodeParameter('approverIds', itemIndex, '') as string;
|
||||
const minor = this.getNodeParameter('minor', itemIndex, false) as boolean;
|
||||
|
||||
const query = `
|
||||
mutation PublishProcessingActivityList($input: PublishProcessingActivityListInput!) {
|
||||
@@ -83,7 +97,7 @@ export async function execute(
|
||||
}
|
||||
`;
|
||||
|
||||
const input: Record<string, unknown> = { organizationId };
|
||||
const input: Record<string, unknown> = { organizationId, minor };
|
||||
|
||||
if (approverIds) {
|
||||
input.approverIds = approverIds
|
||||
|
||||
Reference in New Issue
Block a user