diff --git a/tap_linear/streams.py b/tap_linear/streams.py index 3c8f83a..fcb750e 100644 --- a/tap_linear/streams.py +++ b/tap_linear/streams.py @@ -353,3 +353,46 @@ class UsersStream(LinearStream): } } """ + + +class WorkflowStateStream(LinearStream): + """Workflow state stream.""" + + name = "workflowStates" + schema = th.PropertiesList( + th.Property("id", th.StringType), + th.Property("name", th.StringType), + th.Property("type", th.StringType), + th.Property("color", th.StringType), + th.Property("position", th.NumberType), + th.Property("createdAt", th.DateTimeType), + th.Property("updatedAt", th.DateTimeType), + th.Property("description", th.StringType), + ).to_dict() + + primary_keys: t.ClassVar[list[str]] = ["id"] + replication_key = "updatedAt" + query = """ + query WorkflowStates($next: String, $replicationKeyValue: DateTime) { + workflowStates( + first: 100 + after: $next + filter: { updatedAt: { gt: $replicationKeyValue } } + ) { + nodes { + id + color + createdAt + description + name + position + type + updatedAt + } + pageInfo { + hasNextPage + endCursor + } + } + } + """ diff --git a/tap_linear/tap.py b/tap_linear/tap.py index 9697daf..b3acc51 100644 --- a/tap_linear/tap.py +++ b/tap_linear/tap.py @@ -47,6 +47,7 @@ def discover_streams(self) -> list[streams.LinearStream]: streams.IssuesStream(self), streams.CommentStream(self), streams.UsersStream(self), + streams.WorkflowStateStream(self), ]