janet-cli 0.2.4__py3-none-any.whl → 0.2.5__py3-none-any.whl

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/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Janet AI CLI - Sync tickets to local markdown files."""
2
2
 
3
- __version__ = "0.2.4"
3
+ __version__ = "0.2.5"
janet/api/tickets.py CHANGED
@@ -99,6 +99,33 @@ class TicketAPI(APIClient):
99
99
 
100
100
  return response.get("tickets", [])
101
101
 
102
+ def sync_all_tickets(self, project_id: str) -> Dict:
103
+ """
104
+ Get ALL tickets for a project using the CLI sync endpoint.
105
+ No pagination - returns everything in one call.
106
+
107
+ Args:
108
+ project_id: Project ID
109
+
110
+ Returns:
111
+ Dictionary with all tickets
112
+
113
+ Raises:
114
+ NetworkError: If API request fails
115
+ """
116
+ endpoint = f"/api/v1/cli/projects/{project_id}/tickets/sync"
117
+
118
+ data = {
119
+ "show_resolved_over_7_days": True,
120
+ }
121
+
122
+ response = self.post(endpoint, data=data, include_org=True)
123
+
124
+ if not response.get("success"):
125
+ raise Exception(response.get("error", "Failed to sync tickets"))
126
+
127
+ return response
128
+
102
129
  def get_ticket_attachments(self, ticket_id: str) -> Dict:
103
130
  """
104
131
  Get attachments for a ticket.
janet/sync/sync_engine.py CHANGED
@@ -114,36 +114,11 @@ class SyncEngine:
114
114
  """
115
115
  org_name = self.config.selected_organization.name
116
116
 
117
- # Fetch all tickets with pagination
118
- tickets = []
119
- offset = 0
120
- limit = 200 # API limit per request
121
-
122
- while True:
123
- response = self.ticket_api.list_tickets(project_id, limit=limit, offset=offset)
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"]
136
-
137
- if not page_tickets:
138
- break # No more tickets
139
-
140
- tickets.extend(page_tickets)
141
-
142
- # Check if there are more tickets
143
- if response.get("has_more"):
144
- offset = response.get("next_offset", offset + limit)
145
- else:
146
- break # No more pages
117
+ # Fetch all tickets using CLI sync endpoint (no pagination needed)
118
+ response = self.ticket_api.sync_all_tickets(project_id)
119
+
120
+ # Extract tickets from response
121
+ tickets = response.get("tickets", [])
147
122
 
148
123
  if not tickets:
149
124
  console.print(f" [dim]↳ {project_key} - No tickets found[/dim]")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: janet-cli
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: CLI tool to sync Janet AI tickets to local markdown files
5
5
  Author-email: Janet AI <support@janet-ai.com>
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- janet/__init__.py,sha256=8DF8tFbjKs8D9a6FdTTInpkTpX0ruJBYIrWuRdhzozg,82
1
+ janet/__init__.py,sha256=GANp_UZr2ffT1uceYabUv2auPSs6BMsolNt8-rdIf1M,82
2
2
  janet/__main__.py,sha256=nxsNRykF1aXRRSYNcMvohre4QDfpUzyr5JMyHRHWrwI,130
3
3
  janet/cli.py,sha256=AxjY76l5d7NnsaYEEvUP4dJ1LxXsY1Ya-uNaTGSfXd8,20391
4
4
  janet/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -6,7 +6,7 @@ janet/api/client.py,sha256=fiIpCaQlvXBn_T2VGf0sT9jyQE83Xx7o_WJkCDnwykY,4399
6
6
  janet/api/models.py,sha256=41or0kCcEJ3KJ2QCdV1xbrAoAcma_DteqqVlO0Ng18g,2002
7
7
  janet/api/organizations.py,sha256=abaita6e2drm6RikTOfU-E1ohPeRPhiTYmWRFG0kqaQ,1539
8
8
  janet/api/projects.py,sha256=Oxao4vvXMuXWMfUwZUuBrhkSUtC8t57FNc2d6Qzd5ms,1488
9
- janet/api/tickets.py,sha256=k8EKrShdRVmevNbZahchJI_0iiHosP1QLCWfyFsXGxo,3346
9
+ janet/api/tickets.py,sha256=2_GCNX66COM72og5xmG4VpL2_pvKkSzW9LVd1v7NfkM,4079
10
10
  janet/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  janet/auth/callback_server.py,sha256=mLkkQMMN6PnNUFf4mlQyY3eKOgK1W6_9O9u90xsLMhY,12499
12
12
  janet/auth/oauth_flow.py,sha256=YaLQVRXyhAvZ3IWkd3AvjQlCkQgRRjhPEU9fXfZBgko,9133
@@ -20,14 +20,14 @@ janet/markdown/yjs_converter.py,sha256=omoT6dZ0K3UIoSun2fczTw56vbTrHomz64no3U0YU
20
20
  janet/sync/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  janet/sync/file_manager.py,sha256=fwV0VYP-0ZpwTAyDVqlVUPn3MB2wK6TvFQq450Lhr0I,5839
22
22
  janet/sync/readme_generator.py,sha256=RHfqlr-3oyGIy5zRbMcloAo1rrwy5aSqAvleC49QZME,6847
23
- janet/sync/sync_engine.py,sha256=4WEQ6wmcwTWg1cZurQCZTcSBZhKkUtw4eBKUsAcL6WY,9779
23
+ janet/sync/sync_engine.py,sha256=yLPIQZ5QOPeQohwSUCbvPZH56nBPs5vzs5owIMyQlBs,8898
24
24
  janet/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  janet/utils/console.py,sha256=zMhX4HUXSco-or9KpqBJmYCzmfH_GWtvq-n2Sy6Dfgc,927
26
26
  janet/utils/errors.py,sha256=yxoVDF7ovMT7ooJA-8cvxJK8_3nWumGv7s1n8povi-4,783
27
27
  janet/utils/paths.py,sha256=JYp5gcSEjIbYNJaUcAwdpz6rmta9m0JzoBARC6_AWmM,1706
28
- janet_cli-0.2.4.dist-info/licenses/LICENSE,sha256=wNChlibp2El7r-zfLH8QhOg2oLPAvGwP7ETnVWyNRio,1065
29
- janet_cli-0.2.4.dist-info/METADATA,sha256=LmM2eaqKExhBIUZHpwbN7P2T2Mta96Y3-zT5iKsY9Io,5875
30
- janet_cli-0.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
- janet_cli-0.2.4.dist-info/entry_points.txt,sha256=MeYUkStK_xcqW3AylPNpQh_H5zmfojB1-d8WMhifkvw,40
32
- janet_cli-0.2.4.dist-info/top_level.txt,sha256=Ux5zWeRoPO3Tu87toTRoiwMkIQNQylV9aRO2g7KqNW4,6
33
- janet_cli-0.2.4.dist-info/RECORD,,
28
+ janet_cli-0.2.5.dist-info/licenses/LICENSE,sha256=wNChlibp2El7r-zfLH8QhOg2oLPAvGwP7ETnVWyNRio,1065
29
+ janet_cli-0.2.5.dist-info/METADATA,sha256=YfoeWwmY6kBoeJ47Cwix7JovjbYvq3cnzCoViyej4bc,5875
30
+ janet_cli-0.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
+ janet_cli-0.2.5.dist-info/entry_points.txt,sha256=MeYUkStK_xcqW3AylPNpQh_H5zmfojB1-d8WMhifkvw,40
32
+ janet_cli-0.2.5.dist-info/top_level.txt,sha256=Ux5zWeRoPO3Tu87toTRoiwMkIQNQylV9aRO2g7KqNW4,6
33
+ janet_cli-0.2.5.dist-info/RECORD,,