janet-cli 0.2.6__tar.gz → 0.2.8__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.6/janet_cli.egg-info → janet_cli-0.2.8}/PKG-INFO +1 -1
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/__init__.py +1 -1
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/api/tickets.py +29 -10
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/sync/sync_engine.py +5 -21
- {janet_cli-0.2.6 → janet_cli-0.2.8/janet_cli.egg-info}/PKG-INFO +1 -1
- {janet_cli-0.2.6 → janet_cli-0.2.8}/pyproject.toml +1 -1
- {janet_cli-0.2.6 → janet_cli-0.2.8}/.env.example +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/LICENSE +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/MANIFEST.in +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/README.md +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/__main__.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/api/__init__.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/api/client.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/api/models.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/api/organizations.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/api/projects.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/auth/__init__.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/auth/callback_server.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/auth/oauth_flow.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/auth/token_manager.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/cli.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/config/__init__.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/config/manager.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/config/models.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/markdown/__init__.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/markdown/generator.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/markdown/yjs_converter.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/sync/__init__.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/sync/file_manager.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/sync/readme_generator.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/utils/__init__.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/utils/console.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/utils/errors.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet/utils/paths.py +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet_cli.egg-info/SOURCES.txt +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet_cli.egg-info/dependency_links.txt +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet_cli.egg-info/entry_points.txt +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet_cli.egg-info/requires.txt +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/janet_cli.egg-info/top_level.txt +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/requirements.txt +0 -0
- {janet_cli-0.2.6 → janet_cli-0.2.8}/setup.cfg +0 -0
|
@@ -75,6 +75,30 @@ class TicketAPI(APIClient):
|
|
|
75
75
|
|
|
76
76
|
return response.get("ticket", {})
|
|
77
77
|
|
|
78
|
+
def cli_batch_fetch(self, ticket_ids: List[str]) -> List[Dict]:
|
|
79
|
+
"""
|
|
80
|
+
Fetch multiple tickets using CLI unlimited endpoint - NO 500 LIMIT.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
ticket_ids: List of ticket IDs (unlimited)
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
List of ticket dictionaries
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
NetworkError: If API request fails
|
|
90
|
+
"""
|
|
91
|
+
if not ticket_ids:
|
|
92
|
+
return []
|
|
93
|
+
|
|
94
|
+
data = {"ticket_ids": ticket_ids}
|
|
95
|
+
response = self.post("/api/v1/cli/tickets/batch", data=data, include_org=True)
|
|
96
|
+
|
|
97
|
+
if not response.get("success"):
|
|
98
|
+
raise Exception(response.get("error", "Failed to batch fetch tickets"))
|
|
99
|
+
|
|
100
|
+
return response.get("tickets", [])
|
|
101
|
+
|
|
78
102
|
def batch_fetch(self, ticket_ids: List[str]) -> List[Dict]:
|
|
79
103
|
"""
|
|
80
104
|
Fetch multiple tickets in one request.
|
|
@@ -99,20 +123,17 @@ class TicketAPI(APIClient):
|
|
|
99
123
|
|
|
100
124
|
return response.get("tickets", [])
|
|
101
125
|
|
|
102
|
-
def
|
|
103
|
-
self, project_id: str, limit: int = 500, offset: int = 0
|
|
104
|
-
) -> Dict:
|
|
126
|
+
def sync_all_tickets(self, project_id: str) -> Dict:
|
|
105
127
|
"""
|
|
106
|
-
Get tickets for a project using the CLI sync endpoint
|
|
107
|
-
|
|
128
|
+
Get ALL tickets for a project using the CLI sync endpoint - NO LIMIT.
|
|
129
|
+
|
|
130
|
+
Uses dedicated CLI endpoint that returns all tickets in one call.
|
|
108
131
|
|
|
109
132
|
Args:
|
|
110
133
|
project_id: Project ID
|
|
111
|
-
limit: Tickets per page (max 500)
|
|
112
|
-
offset: Pagination offset
|
|
113
134
|
|
|
114
135
|
Returns:
|
|
115
|
-
Dictionary with tickets
|
|
136
|
+
Dictionary with ALL tickets (no pagination)
|
|
116
137
|
|
|
117
138
|
Raises:
|
|
118
139
|
NetworkError: If API request fails
|
|
@@ -121,8 +142,6 @@ class TicketAPI(APIClient):
|
|
|
121
142
|
|
|
122
143
|
data = {
|
|
123
144
|
"show_resolved_over_7_days": True,
|
|
124
|
-
"limit": limit,
|
|
125
|
-
"offset": offset,
|
|
126
145
|
}
|
|
127
146
|
|
|
128
147
|
response = self.post(endpoint, data=data, include_org=True)
|
|
@@ -114,25 +114,9 @@ class SyncEngine:
|
|
|
114
114
|
"""
|
|
115
115
|
org_name = self.config.selected_organization.name
|
|
116
116
|
|
|
117
|
-
# Fetch
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
limit = 500 # CLI endpoint allows 500 per page
|
|
121
|
-
|
|
122
|
-
while True:
|
|
123
|
-
response = self.ticket_api.sync_tickets_paginated(project_id, limit=limit, offset=offset)
|
|
124
|
-
|
|
125
|
-
page_tickets = response.get("tickets", [])
|
|
126
|
-
if not page_tickets:
|
|
127
|
-
break
|
|
128
|
-
|
|
129
|
-
tickets.extend(page_tickets)
|
|
130
|
-
|
|
131
|
-
# Check if there are more
|
|
132
|
-
if response.get("has_more"):
|
|
133
|
-
offset = response.get("next_offset", offset + limit)
|
|
134
|
-
else:
|
|
135
|
-
break
|
|
117
|
+
# Fetch ALL tickets using unlimited CLI sync endpoint (no pagination!)
|
|
118
|
+
response = self.ticket_api.sync_all_tickets(project_id)
|
|
119
|
+
tickets = response.get("tickets", [])
|
|
136
120
|
|
|
137
121
|
if not tickets:
|
|
138
122
|
console.print(f" [dim]↳ {project_key} - No tickets found[/dim]")
|
|
@@ -143,11 +127,11 @@ class SyncEngine:
|
|
|
143
127
|
# Fetch organization members for name resolution (once per project)
|
|
144
128
|
org_members = self._fetch_org_members()
|
|
145
129
|
|
|
146
|
-
# Batch fetch all full ticket details
|
|
130
|
+
# Batch fetch all full ticket details using unlimited CLI endpoint
|
|
147
131
|
ticket_ids = [t.get("id") for t in tickets if t.get("id")]
|
|
148
132
|
|
|
149
133
|
console.print(f" Fetching full details for {len(ticket_ids)} tickets...")
|
|
150
|
-
full_tickets_list = self.ticket_api.
|
|
134
|
+
full_tickets_list = self.ticket_api.cli_batch_fetch(ticket_ids)
|
|
151
135
|
|
|
152
136
|
# Create lookup map by ticket ID
|
|
153
137
|
full_tickets_map = {t.get("id"): t for t in full_tickets_list}
|
|
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
|