janet-cli 0.2.4__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {janet_cli-0.2.4/janet_cli.egg-info → janet_cli-0.2.6}/PKG-INFO +1 -1
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/__init__.py +1 -1
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/api/tickets.py +33 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/sync/sync_engine.py +7 -18
- {janet_cli-0.2.4 → janet_cli-0.2.6/janet_cli.egg-info}/PKG-INFO +1 -1
- {janet_cli-0.2.4 → janet_cli-0.2.6}/pyproject.toml +1 -1
- {janet_cli-0.2.4 → janet_cli-0.2.6}/.env.example +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/LICENSE +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/MANIFEST.in +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/README.md +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/__main__.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/api/__init__.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/api/client.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/api/models.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/api/organizations.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/api/projects.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/auth/__init__.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/auth/callback_server.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/auth/oauth_flow.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/auth/token_manager.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/cli.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/config/__init__.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/config/manager.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/config/models.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/markdown/__init__.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/markdown/generator.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/markdown/yjs_converter.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/sync/__init__.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/sync/file_manager.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/sync/readme_generator.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/utils/__init__.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/utils/console.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/utils/errors.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet/utils/paths.py +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet_cli.egg-info/SOURCES.txt +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet_cli.egg-info/dependency_links.txt +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet_cli.egg-info/entry_points.txt +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet_cli.egg-info/requires.txt +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/janet_cli.egg-info/top_level.txt +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/requirements.txt +0 -0
- {janet_cli-0.2.4 → janet_cli-0.2.6}/setup.cfg +0 -0
|
@@ -99,6 +99,39 @@ class TicketAPI(APIClient):
|
|
|
99
99
|
|
|
100
100
|
return response.get("tickets", [])
|
|
101
101
|
|
|
102
|
+
def sync_tickets_paginated(
|
|
103
|
+
self, project_id: str, limit: int = 500, offset: int = 0
|
|
104
|
+
) -> Dict:
|
|
105
|
+
"""
|
|
106
|
+
Get tickets for a project using the CLI sync endpoint with pagination.
|
|
107
|
+
Supports up to 500 tickets per page.
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
project_id: Project ID
|
|
111
|
+
limit: Tickets per page (max 500)
|
|
112
|
+
offset: Pagination offset
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
Dictionary with tickets and pagination info
|
|
116
|
+
|
|
117
|
+
Raises:
|
|
118
|
+
NetworkError: If API request fails
|
|
119
|
+
"""
|
|
120
|
+
endpoint = f"/api/v1/cli/projects/{project_id}/tickets/sync"
|
|
121
|
+
|
|
122
|
+
data = {
|
|
123
|
+
"show_resolved_over_7_days": True,
|
|
124
|
+
"limit": limit,
|
|
125
|
+
"offset": offset,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
response = self.post(endpoint, data=data, include_org=True)
|
|
129
|
+
|
|
130
|
+
if not response.get("success"):
|
|
131
|
+
raise Exception(response.get("error", "Failed to sync tickets"))
|
|
132
|
+
|
|
133
|
+
return response
|
|
134
|
+
|
|
102
135
|
def get_ticket_attachments(self, ticket_id: str) -> Dict:
|
|
103
136
|
"""
|
|
104
137
|
Get attachments for a ticket.
|
|
@@ -114,36 +114,25 @@ class SyncEngine:
|
|
|
114
114
|
"""
|
|
115
115
|
org_name = self.config.selected_organization.name
|
|
116
116
|
|
|
117
|
-
# Fetch all tickets with pagination
|
|
117
|
+
# Fetch all tickets using CLI sync endpoint with pagination (500 per page)
|
|
118
118
|
tickets = []
|
|
119
119
|
offset = 0
|
|
120
|
-
limit =
|
|
120
|
+
limit = 500 # CLI endpoint allows 500 per page
|
|
121
121
|
|
|
122
122
|
while True:
|
|
123
|
-
response = self.ticket_api.
|
|
124
|
-
|
|
125
|
-
# Extract tickets from current page
|
|
126
|
-
page_tickets = []
|
|
127
|
-
if "items" in response:
|
|
128
|
-
page_tickets = response["items"]
|
|
129
|
-
elif "kanban_data" in response:
|
|
130
|
-
kanban_data = response["kanban_data"]
|
|
131
|
-
for column in kanban_data.get("columns", []):
|
|
132
|
-
column_tickets = column.get("tickets", [])
|
|
133
|
-
page_tickets.extend(column_tickets)
|
|
134
|
-
elif "tickets" in response:
|
|
135
|
-
page_tickets = response["tickets"]
|
|
123
|
+
response = self.ticket_api.sync_tickets_paginated(project_id, limit=limit, offset=offset)
|
|
136
124
|
|
|
125
|
+
page_tickets = response.get("tickets", [])
|
|
137
126
|
if not page_tickets:
|
|
138
|
-
break
|
|
127
|
+
break
|
|
139
128
|
|
|
140
129
|
tickets.extend(page_tickets)
|
|
141
130
|
|
|
142
|
-
# Check if there are more
|
|
131
|
+
# Check if there are more
|
|
143
132
|
if response.get("has_more"):
|
|
144
133
|
offset = response.get("next_offset", offset + limit)
|
|
145
134
|
else:
|
|
146
|
-
break
|
|
135
|
+
break
|
|
147
136
|
|
|
148
137
|
if not tickets:
|
|
149
138
|
console.print(f" [dim]↳ {project_key} - No tickets found[/dim]")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|