atlassian-cli 0.9.0__tar.gz → 0.10.0__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.
- {atlassian_cli-0.9.0/src/atlassian_cli.egg-info → atlassian_cli-0.10.0}/PKG-INFO +1 -1
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/pyproject.toml +1 -1
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/confluence.py +57 -6
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0/src/atlassian_cli.egg-info}/PKG-INFO +1 -1
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/LICENSE +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/README.md +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/setup.cfg +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/__init__.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/adf.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/config.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/hints.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/http.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/jira.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/jira_assets.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/jira_issues.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/output.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli/update_check.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli.egg-info/SOURCES.txt +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli.egg-info/dependency_links.txt +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli.egg-info/entry_points.txt +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli.egg-info/requires.txt +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli.egg-info/top_level.txt +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/tests/test_adf.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/tests/test_config.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/tests/test_confluence.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/tests/test_http.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/tests/test_jira_assets.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/tests/test_jira_issues.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/tests/test_output.py +0 -0
|
@@ -218,12 +218,18 @@ def cmd_create(args):
|
|
|
218
218
|
|
|
219
219
|
|
|
220
220
|
def _modify_page_metadata(session, base, page_id, *,
|
|
221
|
-
new_title=None, new_parent_id=None,
|
|
222
|
-
|
|
221
|
+
new_title=None, new_parent_id=None, new_space_id=None,
|
|
222
|
+
message=None):
|
|
223
|
+
"""Update a page's title, parentId and/or spaceId without touching the body.
|
|
223
224
|
|
|
224
225
|
Confluence has no dedicated 'move' or 'rename' endpoint — both go through
|
|
225
226
|
PUT /pages/{id}, which requires the full body and a bumped version. Here
|
|
226
227
|
we fetch the current state and round-trip it with the requested changes.
|
|
228
|
+
|
|
229
|
+
Setting `new_space_id` moves the page to a different space (cross-space
|
|
230
|
+
move). If you cross spaces you also need a parent in the destination
|
|
231
|
+
space (Confluence doesn't allow space-root pages via this endpoint), so
|
|
232
|
+
callers should normally pass new_parent_id alongside new_space_id.
|
|
227
233
|
"""
|
|
228
234
|
remote = get_page(session, base, page_id)
|
|
229
235
|
current_title = remote.get('title', '')
|
|
@@ -245,18 +251,29 @@ def _modify_page_metadata(session, base, page_id, *,
|
|
|
245
251
|
}
|
|
246
252
|
if new_parent_id is not None:
|
|
247
253
|
payload['parentId'] = str(new_parent_id)
|
|
254
|
+
if new_space_id is not None:
|
|
255
|
+
payload['spaceId'] = str(new_space_id)
|
|
248
256
|
api_put(session, base, f'{V2}/pages/{page_id}', payload)
|
|
249
257
|
return title, new_version
|
|
250
258
|
|
|
251
259
|
|
|
252
260
|
def cmd_move(args):
|
|
253
261
|
session, base = setup()
|
|
262
|
+
space_id = getattr(args, 'space_id', None)
|
|
263
|
+
msg = getattr(args, 'message', None)
|
|
264
|
+
if space_id:
|
|
265
|
+
msg = msg or f'Moved to space {space_id} under parent {args.parent_id}'
|
|
266
|
+
else:
|
|
267
|
+
msg = msg or f'Moved under parent {args.parent_id}'
|
|
254
268
|
new_title, new_version = _modify_page_metadata(
|
|
255
269
|
session, base, args.page_id,
|
|
256
270
|
new_parent_id=args.parent_id,
|
|
257
|
-
|
|
271
|
+
new_space_id=space_id,
|
|
272
|
+
message=msg,
|
|
258
273
|
)
|
|
259
|
-
|
|
274
|
+
suffix = f' in space {space_id}' if space_id else ''
|
|
275
|
+
emit('OK',
|
|
276
|
+
f'Moved {args.page_id} ({new_title}) -> parent {args.parent_id}{suffix} (v{new_version})')
|
|
260
277
|
|
|
261
278
|
|
|
262
279
|
def cmd_rename(args):
|
|
@@ -269,6 +286,30 @@ def cmd_rename(args):
|
|
|
269
286
|
emit('OK', f'Renamed {args.page_id} -> {new_title!r} (v{new_version})')
|
|
270
287
|
|
|
271
288
|
|
|
289
|
+
def cmd_archive(args):
|
|
290
|
+
"""Archive a page (and optionally its descendants) via the V2 bulk
|
|
291
|
+
archive endpoint."""
|
|
292
|
+
session, base = setup()
|
|
293
|
+
body = {'pages': [{'id': str(args.page_id)}]}
|
|
294
|
+
result = api_post(session, base, f'{V2}/pages/archive', body)
|
|
295
|
+
# The endpoint returns a long-running task descriptor; the page becomes
|
|
296
|
+
# archived asynchronously. We surface the task link so the caller can
|
|
297
|
+
# poll if they need confirmation.
|
|
298
|
+
links = result.get('links', {}) if isinstance(result, dict) else {}
|
|
299
|
+
status_link = links.get('status', '')
|
|
300
|
+
emit('OK', f'Archive submitted for {args.page_id}', data={'task': status_link})
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
def cmd_unarchive(args):
|
|
304
|
+
"""Restore a previously archived page via the V2 bulk restore endpoint."""
|
|
305
|
+
session, base = setup()
|
|
306
|
+
body = {'pages': [{'id': str(args.page_id)}]}
|
|
307
|
+
result = api_post(session, base, f'{V2}/pages/restore', body)
|
|
308
|
+
links = result.get('links', {}) if isinstance(result, dict) else {}
|
|
309
|
+
status_link = links.get('status', '')
|
|
310
|
+
emit('OK', f'Restore submitted for {args.page_id}', data={'task': status_link})
|
|
311
|
+
|
|
312
|
+
|
|
272
313
|
def cmd_delete(args):
|
|
273
314
|
session, base = setup()
|
|
274
315
|
page = get_page(session, base, args.page_id)
|
|
@@ -436,7 +477,7 @@ def cmd_index(args):
|
|
|
436
477
|
spaces = args.space if args.space else ['POL', 'COMPLY']
|
|
437
478
|
index = {}
|
|
438
479
|
|
|
439
|
-
statuses = ('current', 'archived') if args
|
|
480
|
+
statuses = ('current', 'archived') if getattr(args, 'include_archived', False) else ('current',)
|
|
440
481
|
for space_key in spaces:
|
|
441
482
|
space = get_space(session, base, key=space_key)
|
|
442
483
|
space_id = space['id']
|
|
@@ -963,9 +1004,11 @@ def main():
|
|
|
963
1004
|
p.add_argument('page_id', help='Confluence page ID')
|
|
964
1005
|
p.set_defaults(func=cmd_delete)
|
|
965
1006
|
|
|
966
|
-
p = sub.add_parser('move', help='Move a page to a new parent (preserves body)'
|
|
1007
|
+
p = sub.add_parser('move', help='Move a page to a new parent (preserves body); '
|
|
1008
|
+
'optionally to a different space')
|
|
967
1009
|
p.add_argument('page_id', help='Confluence page ID to move')
|
|
968
1010
|
p.add_argument('parent_id', help='New parent page ID')
|
|
1011
|
+
p.add_argument('--space-id', help='Destination space ID (cross-space move)')
|
|
969
1012
|
p.add_argument('--message', '-m', help='Version message')
|
|
970
1013
|
p.set_defaults(func=cmd_move)
|
|
971
1014
|
|
|
@@ -975,6 +1018,14 @@ def main():
|
|
|
975
1018
|
p.add_argument('--message', '-m', help='Version message')
|
|
976
1019
|
p.set_defaults(func=cmd_rename)
|
|
977
1020
|
|
|
1021
|
+
p = sub.add_parser('archive', help='Archive a page (V2 bulk archive endpoint)')
|
|
1022
|
+
p.add_argument('page_id', help='Confluence page ID to archive')
|
|
1023
|
+
p.set_defaults(func=cmd_archive)
|
|
1024
|
+
|
|
1025
|
+
p = sub.add_parser('unarchive', help='Restore an archived page')
|
|
1026
|
+
p.add_argument('page_id', help='Confluence page ID to restore')
|
|
1027
|
+
p.set_defaults(func=cmd_unarchive)
|
|
1028
|
+
|
|
978
1029
|
p = sub.add_parser('put', help='Upload local ADF to Confluence')
|
|
979
1030
|
p.add_argument('page_id', help='Confluence page ID')
|
|
980
1031
|
p.add_argument('--dir', default='pages', help='Pages directory (default: pages)')
|
|
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
|
{atlassian_cli-0.9.0 → atlassian_cli-0.10.0}/src/atlassian_cli.egg-info/dependency_links.txt
RENAMED
|
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
|