janet-cli 0.3.7__tar.gz → 0.3.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.3.7/janet_cli.egg-info → janet_cli-0.3.8}/PKG-INFO +1 -1
- janet_cli-0.3.8/janet/__init__.py +8 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/markdown/generator.py +27 -2
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/sync/sse_watcher.py +4 -1
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/sync/sync_engine.py +8 -2
- {janet_cli-0.3.7 → janet_cli-0.3.8/janet_cli.egg-info}/PKG-INFO +1 -1
- janet_cli-0.3.8/janet_cli.egg-info/top_level.txt +1 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/pyproject.toml +1 -1
- janet_cli-0.3.7/janet/__init__.py +0 -3
- janet_cli-0.3.7/janet_cli.egg-info/top_level.txt +0 -2
- {janet_cli-0.3.7 → janet_cli-0.3.8}/.env.example +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/LICENSE +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/MANIFEST.in +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/README.md +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/__main__.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/api/__init__.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/api/client.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/api/models.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/api/organizations.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/api/projects.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/api/tickets.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/auth/__init__.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/auth/callback_server.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/auth/oauth_flow.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/auth/token_manager.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/cli.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/config/__init__.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/config/manager.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/config/models.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/markdown/__init__.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/markdown/yjs_converter.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/sync/__init__.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/sync/file_manager.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/sync/readme_generator.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/utils/__init__.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/utils/console.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/utils/errors.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet/utils/paths.py +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet_cli.egg-info/SOURCES.txt +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet_cli.egg-info/dependency_links.txt +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet_cli.egg-info/entry_points.txt +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/janet_cli.egg-info/requires.txt +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/requirements.txt +0 -0
- {janet_cli-0.3.7 → janet_cli-0.3.8}/setup.cfg +0 -0
|
@@ -22,6 +22,8 @@ class MarkdownGenerator:
|
|
|
22
22
|
ticket: Dict,
|
|
23
23
|
organization_members: Optional[List[Dict]] = None,
|
|
24
24
|
attachments: Optional[Dict] = None,
|
|
25
|
+
org_id: Optional[str] = None,
|
|
26
|
+
project_id: Optional[str] = None,
|
|
25
27
|
) -> str:
|
|
26
28
|
"""
|
|
27
29
|
Generate complete markdown document from ticket data.
|
|
@@ -30,18 +32,26 @@ class MarkdownGenerator:
|
|
|
30
32
|
ticket: Ticket dictionary
|
|
31
33
|
organization_members: List of organization members (for name resolution)
|
|
32
34
|
attachments: Dictionary with direct_attachments and indirect_attachments
|
|
35
|
+
org_id: Organization ID for generating frontend link
|
|
36
|
+
project_id: Project ID for generating frontend link
|
|
33
37
|
|
|
34
38
|
Returns:
|
|
35
39
|
Complete markdown string
|
|
36
40
|
"""
|
|
37
41
|
sections = []
|
|
38
42
|
|
|
39
|
-
# 1.
|
|
43
|
+
# 1. Link to Janet frontend (at the very top)
|
|
44
|
+
ticket_id = ticket.get("id")
|
|
45
|
+
if org_id and project_id and ticket_id:
|
|
46
|
+
link = self._generate_frontend_link(org_id, project_id, ticket_id)
|
|
47
|
+
sections.append(f"**View in Janet:** {link}\n")
|
|
48
|
+
|
|
49
|
+
# 2. Title
|
|
40
50
|
ticket_key = ticket.get("ticket_key", "UNKNOWN")
|
|
41
51
|
title = ticket.get("title", "Untitled")
|
|
42
52
|
sections.append(f"# {ticket_key}: {title}\n")
|
|
43
53
|
|
|
44
|
-
#
|
|
54
|
+
# 3. Metadata
|
|
45
55
|
sections.append(self._generate_metadata(ticket, organization_members))
|
|
46
56
|
|
|
47
57
|
# 3. Description (pass attachments for inline image handling)
|
|
@@ -240,6 +250,21 @@ class MarkdownGenerator:
|
|
|
240
250
|
lines.append("") # Empty line after child tasks
|
|
241
251
|
return "\n".join(lines)
|
|
242
252
|
|
|
253
|
+
def _generate_frontend_link(self, org_id: str, project_id: str, ticket_id: str) -> str:
|
|
254
|
+
"""
|
|
255
|
+
Generate link to view ticket in Janet frontend.
|
|
256
|
+
|
|
257
|
+
Args:
|
|
258
|
+
org_id: Organization ID
|
|
259
|
+
project_id: Project ID
|
|
260
|
+
ticket_id: Ticket ID
|
|
261
|
+
|
|
262
|
+
Returns:
|
|
263
|
+
Markdown link to Janet frontend
|
|
264
|
+
"""
|
|
265
|
+
url = f"https://app.tryjanet.ai/dashboard/{org_id}/projects/{project_id}/{ticket_id}"
|
|
266
|
+
return url
|
|
267
|
+
|
|
243
268
|
def _generate_footer(self, ticket_key: str) -> str:
|
|
244
269
|
"""Generate footer section."""
|
|
245
270
|
export_date = self._format_date(datetime.utcnow().isoformat())
|
|
@@ -109,7 +109,10 @@ class SSEWatcher:
|
|
|
109
109
|
"direct_attachments": ticket_data.get("attachments", []),
|
|
110
110
|
"indirect_attachments": []
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
org_id = self.config.selected_organization.id
|
|
113
|
+
markdown = self.markdown_generator.generate(
|
|
114
|
+
ticket_data, self.org_members, attachments, org_id, project_id
|
|
115
|
+
)
|
|
113
116
|
self.file_manager.write_ticket(
|
|
114
117
|
org_name=self.org_name,
|
|
115
118
|
project_name=project_name,
|
|
@@ -168,8 +168,10 @@ class SyncEngine:
|
|
|
168
168
|
# Get pre-fetched attachments for this ticket
|
|
169
169
|
ticket_attachments = attachments_map.get(ticket_id)
|
|
170
170
|
|
|
171
|
+
org_id = self.config.selected_organization.id
|
|
171
172
|
self._sync_single_ticket_fast(
|
|
172
|
-
merged_ticket, org_name, project_name, org_members, ticket_attachments
|
|
173
|
+
merged_ticket, org_name, project_name, org_members, ticket_attachments,
|
|
174
|
+
org_id, project_id
|
|
173
175
|
)
|
|
174
176
|
synced_count += 1
|
|
175
177
|
except Exception as e:
|
|
@@ -188,6 +190,8 @@ class SyncEngine:
|
|
|
188
190
|
project_name: str,
|
|
189
191
|
org_members: Optional[List[Dict]] = None,
|
|
190
192
|
attachments: Optional[Dict] = None,
|
|
193
|
+
org_id: Optional[str] = None,
|
|
194
|
+
project_id: Optional[str] = None,
|
|
191
195
|
) -> None:
|
|
192
196
|
"""
|
|
193
197
|
Sync a single ticket (optimized - no individual API calls).
|
|
@@ -198,6 +202,8 @@ class SyncEngine:
|
|
|
198
202
|
project_name: Project name
|
|
199
203
|
org_members: Organization members for name resolution
|
|
200
204
|
attachments: Pre-fetched attachments dict (from batch fetch)
|
|
205
|
+
org_id: Organization ID for generating frontend link
|
|
206
|
+
project_id: Project ID for generating frontend link
|
|
201
207
|
"""
|
|
202
208
|
ticket_id = ticket.get("id")
|
|
203
209
|
|
|
@@ -224,7 +230,7 @@ class SyncEngine:
|
|
|
224
230
|
|
|
225
231
|
# Generate markdown
|
|
226
232
|
markdown = self.markdown_generator.generate(
|
|
227
|
-
ticket, org_members, attachments
|
|
233
|
+
ticket, org_members, attachments, org_id, project_id
|
|
228
234
|
)
|
|
229
235
|
|
|
230
236
|
# Write to file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
janet
|
|
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
|