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:
@@ -25,9 +25,7 @@ import * as getAllVersionsOp from './getAllVersions.operation';
|
||||
import * as createDraftVersionOp from './createDraftVersion.operation';
|
||||
import * as updateVersionOp from './updateVersion.operation';
|
||||
import * as deleteDraftVersionOp from './deleteDraftVersion.operation';
|
||||
import * as publishMajorVersionOp from './publishMajorVersion.operation';
|
||||
import * as publishMinorVersionOp from './publishMinorVersion.operation';
|
||||
import * as requestApprovalOp from './requestApproval.operation';
|
||||
import * as publishOp from './publish.operation';
|
||||
import * as voidApprovalOp from './voidApproval.operation';
|
||||
import * as getSignatureOp from './getSignature.operation';
|
||||
import * as getAllSignaturesOp from './getAllSignatures.operation';
|
||||
@@ -148,22 +146,10 @@ export const description: INodeProperties[] = [
|
||||
action: 'Get a document version',
|
||||
},
|
||||
{
|
||||
name: 'Publish Major Version',
|
||||
value: 'publishMajorVersion',
|
||||
description: 'Publish a draft as a new major version',
|
||||
action: 'Publish a major document version',
|
||||
},
|
||||
{
|
||||
name: 'Publish Minor Version',
|
||||
value: 'publishMinorVersion',
|
||||
description: 'Publish a draft as a minor version',
|
||||
action: 'Publish a minor document version',
|
||||
},
|
||||
{
|
||||
name: 'Request Approval',
|
||||
value: 'requestApproval',
|
||||
description: 'Request approval for a document version',
|
||||
action: 'Request document version approval',
|
||||
name: 'Publish',
|
||||
value: 'publish',
|
||||
description: 'Publish a draft document, request approval, or publish as minor',
|
||||
action: 'Publish a document',
|
||||
},
|
||||
{
|
||||
name: 'Request Signature',
|
||||
@@ -216,9 +202,7 @@ export const description: INodeProperties[] = [
|
||||
...createDraftVersionOp.description,
|
||||
...updateVersionOp.description,
|
||||
...deleteDraftVersionOp.description,
|
||||
...publishMajorVersionOp.description,
|
||||
...publishMinorVersionOp.description,
|
||||
...requestApprovalOp.description,
|
||||
...publishOp.description,
|
||||
...voidApprovalOp.description,
|
||||
...getSignatureOp.description,
|
||||
...getAllSignaturesOp.description,
|
||||
@@ -244,9 +228,7 @@ export {
|
||||
createDraftVersionOp as createDraftVersion,
|
||||
updateVersionOp as updateVersion,
|
||||
deleteDraftVersionOp as deleteDraftVersion,
|
||||
publishMajorVersionOp as publishMajorVersion,
|
||||
publishMinorVersionOp as publishMinorVersion,
|
||||
requestApprovalOp as requestApproval,
|
||||
publishOp as publish,
|
||||
voidApprovalOp as voidApproval,
|
||||
getSignatureOp as getSignature,
|
||||
getAllSignaturesOp as getAllSignatures,
|
||||
|
||||
Reference in New Issue
Block a user