Skip to content

Commit

Permalink
workflow state
Browse files Browse the repository at this point in the history
  • Loading branch information
hugowetterberg committed Jan 28, 2025
1 parent c1018d7 commit 9ae460d
Show file tree
Hide file tree
Showing 8 changed files with 2,866 additions and 1,312 deletions.
2 changes: 1 addition & 1 deletion docs/index-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@
},
"info": {
"title": "index API",
"version": "v0.17.5"
"version": "v0.17.7"
},
"openapi": "3.0.0",
"paths": {
Expand Down
200 changes: 199 additions & 1 deletion docs/repository-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@
"elephant.repository.DeleteStatusRuleResponse": {
"type": "object"
},
"elephant.repository.DeleteWorkflowRequest": {
"properties": {
"type": {
"description": "Type of the document to remove the workflow for.",
"type": "string"
}
},
"type": "object"
},
"elephant.repository.DeleteWorkflowResponse": {
"type": "object"
},
"elephant.repository.Deprecation": {
"properties": {
"enforced": {
Expand Down Expand Up @@ -262,6 +274,14 @@
"modified": {
"description": "Modified timestamp is the RFC3339 timestamp for the last change that affected the document.",
"type": "string"
},
"workflow_checkpoint": {
"description": "WorkflowCheckpoint that the document reached most recently.",
"type": "string"
},
"workflow_state": {
"description": "WorkflowState that the document is in.",
"type": "string"
}
},
"type": "object"
Expand Down Expand Up @@ -290,6 +310,30 @@
},
"type": "object"
},
"elephant.repository.DocumentWorkflow": {
"properties": {
"checkpoint": {
"description": "Checkpoint is the status that should be used as the state checkpoint.",
"type": "string"
},
"negative_checkpoint": {
"description": "NegativeCheckpoint is the state that should be used when the checkpoint status is set using a negative version.",
"type": "string"
},
"step_zero": {
"description": "StepZero is the step that the state begins in, or reverts to after a checkpoint.",
"type": "string"
},
"steps": {
"description": "Steps are the names of statuses that should be used as steps between checkpoints.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"elephant.repository.EntityRef": {
"properties": {
"index": {
Expand Down Expand Up @@ -379,6 +423,14 @@
"version": {
"description": "Version of the document.",
"type": "integer"
},
"workflow_checkpoint": {
"description": "WorkflowCheckpoint that the document reached most recently.",
"type": "string"
},
"workflow_state": {
"description": "WorkflowState that the document is in.",
"type": "string"
}
},
"type": "object"
Expand Down Expand Up @@ -827,6 +879,23 @@
},
"type": "object"
},
"elephant.repository.GetWorkflowRequest": {
"properties": {
"type": {
"description": "Type of the document to get workflow for.",
"type": "string"
}
},
"type": "object"
},
"elephant.repository.GetWorkflowResponse": {
"properties": {
"workflow": {
"$ref": "#/components/schemas/elephant.repository.DocumentWorkflow"
}
},
"type": "object"
},
"elephant.repository.ImportDirective": {
"description": "ImportDirective can be used to preserve timestamps and authorship information from originating systems.",
"properties": {
Expand Down Expand Up @@ -1266,6 +1335,21 @@
"elephant.repository.SetActiveSchemaResponse": {
"type": "object"
},
"elephant.repository.SetWorkflowRequest": {
"properties": {
"type": {
"description": "Type of the document that this workflow is for.",
"type": "string"
},
"workflow": {
"$ref": "#/components/schemas/elephant.repository.DocumentWorkflow"
}
},
"type": "object"
},
"elephant.repository.SetWorkflowResponse": {
"type": "object"
},
"elephant.repository.Status": {
"properties": {
"created": {
Expand Down Expand Up @@ -1734,7 +1818,7 @@
},
"info": {
"title": "repository API",
"version": "v0.17.5"
"version": "v0.17.7"
},
"openapi": "3.0.0",
"paths": {
Expand Down Expand Up @@ -3296,6 +3380,44 @@
]
}
},
"/twirp/elephant.repository.Workflows/DeleteWorkflow": {
"post": {
"description": "DeleteWorkflow removes the workflow configuration for a document type.",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/elephant.repository.DeleteWorkflowRequest"
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/elephant.repository.DeleteWorkflowResponse"
}
}
},
"description": "Method response"
},
"default": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "DeleteWorkflow",
"tags": [
"Workflows"
]
}
},
"/twirp/elephant.repository.Workflows/GetStatusRules": {
"post": {
"description": "GetStatusRules returns all status rules.",
Expand Down Expand Up @@ -3372,6 +3494,82 @@
]
}
},
"/twirp/elephant.repository.Workflows/GetWorkflow": {
"post": {
"description": "GetWorkflow for a document type.",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/elephant.repository.GetWorkflowRequest"
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/elephant.repository.GetWorkflowResponse"
}
}
},
"description": "Method response"
},
"default": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "GetWorkflow",
"tags": [
"Workflows"
]
}
},
"/twirp/elephant.repository.Workflows/SetWorkflow": {
"post": {
"description": "SetWorkflow configures a workflow for a document type.",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/elephant.repository.SetWorkflowRequest"
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/elephant.repository.SetWorkflowResponse"
}
}
},
"description": "Method response"
},
"default": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "SetWorkflow",
"tags": [
"Workflows"
]
}
},
"/twirp/elephant.repository.Workflows/UpdateStatus": {
"post": {
"description": "UpdateStatus creates or updates a status that can be used for documents.",
Expand Down
2 changes: 1 addition & 1 deletion docs/spell-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
},
"info": {
"title": "spell API",
"version": "v0.17.5"
"version": "v0.17.7"
},
"openapi": "3.0.0",
"paths": {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ go 1.23.2

require (
github.com/magefile/mage v1.15.0
github.com/ttab/mage v0.7.4
github.com/ttab/mage v0.7.5
github.com/ttab/newsdoc v0.7.0
github.com/twitchtv/twirp v8.1.3+incompatible
google.golang.org/protobuf v1.36.2
google.golang.org/protobuf v1.36.4
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6Ng
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/ttab/mage v0.7.4 h1:UfoUUQ75b4NNn1wnAeLPIZL3HrJDYjYvlSkIifTMf5k=
github.com/ttab/mage v0.7.4/go.mod h1:Bcw/5hjVOHou89Gy182jVVUmXOdeRf1hkPXTfJsO0/E=
github.com/ttab/mage v0.7.5 h1:O31j/AODjH/OU2EZQ4bvqvuNzNv+NVB/mZJwWHPfm/M=
github.com/ttab/mage v0.7.5/go.mod h1:Bcw/5hjVOHou89Gy182jVVUmXOdeRf1hkPXTfJsO0/E=
github.com/ttab/newsdoc v0.7.0 h1:mzj0VUQJ+XqrQv5MiQHODetvsHQ2lI1cwKwCkHIbPdE=
github.com/ttab/newsdoc v0.7.0/go.mod h1:AXwLv9THaZTTPVOzP4dZ22FzOsVhL5662RQqfTPtvGs=
github.com/twitchtv/twirp v8.1.3+incompatible h1:+F4TdErPgSUbMZMwp13Q/KgDVuI7HJXP61mNV3/7iuU=
Expand All @@ -39,8 +39,8 @@ github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU=
google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
Loading

0 comments on commit 9ae460d

Please sign in to comment.