atlassian-cli 0.9.0__tar.gz → 0.10.1__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.1}/PKG-INFO +1 -1
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/pyproject.toml +1 -1
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/confluence.py +44 -6
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1/src/atlassian_cli.egg-info}/PKG-INFO +1 -1
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/LICENSE +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/README.md +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/setup.cfg +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/__init__.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/adf.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/config.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/hints.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/http.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/jira.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/jira_assets.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/jira_issues.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/output.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli/update_check.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli.egg-info/SOURCES.txt +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli.egg-info/dependency_links.txt +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli.egg-info/entry_points.txt +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli.egg-info/requires.txt +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/src/atlassian_cli.egg-info/top_level.txt +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/tests/test_adf.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/tests/test_config.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/tests/test_confluence.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/tests/test_http.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/tests/test_jira_assets.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/tests/test_jira_issues.py +0 -0
- {atlassian_cli-0.9.0 → atlassian_cli-0.10.1}/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,21 @@ 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 any descendants) via the V1 bulk-archive endpoint.
|
|
291
|
+
|
|
292
|
+
The V2 API does not currently expose a working archive endpoint — the
|
|
293
|
+
Confluence UI itself uses ``POST /wiki/rest/api/content/archive`` (V1),
|
|
294
|
+
which returns 202 Accepted with a longtask handle. Archival completes
|
|
295
|
+
asynchronously; we return the task link so callers can poll if needed.
|
|
296
|
+
"""
|
|
297
|
+
session, base = setup()
|
|
298
|
+
body = {'pages': [{'id': str(args.page_id)}]}
|
|
299
|
+
result = api_post(session, base, '/wiki/rest/api/content/archive', body)
|
|
300
|
+
task = (result or {}).get('links', {}).get('status', '')
|
|
301
|
+
emit('OK', f'Archive submitted for {args.page_id}', data={'task': task})
|
|
302
|
+
|
|
303
|
+
|
|
272
304
|
def cmd_delete(args):
|
|
273
305
|
session, base = setup()
|
|
274
306
|
page = get_page(session, base, args.page_id)
|
|
@@ -436,7 +468,7 @@ def cmd_index(args):
|
|
|
436
468
|
spaces = args.space if args.space else ['POL', 'COMPLY']
|
|
437
469
|
index = {}
|
|
438
470
|
|
|
439
|
-
statuses = ('current', 'archived') if args
|
|
471
|
+
statuses = ('current', 'archived') if getattr(args, 'include_archived', False) else ('current',)
|
|
440
472
|
for space_key in spaces:
|
|
441
473
|
space = get_space(session, base, key=space_key)
|
|
442
474
|
space_id = space['id']
|
|
@@ -963,9 +995,11 @@ def main():
|
|
|
963
995
|
p.add_argument('page_id', help='Confluence page ID')
|
|
964
996
|
p.set_defaults(func=cmd_delete)
|
|
965
997
|
|
|
966
|
-
p = sub.add_parser('move', help='Move a page to a new parent (preserves body)'
|
|
998
|
+
p = sub.add_parser('move', help='Move a page to a new parent (preserves body); '
|
|
999
|
+
'optionally to a different space')
|
|
967
1000
|
p.add_argument('page_id', help='Confluence page ID to move')
|
|
968
1001
|
p.add_argument('parent_id', help='New parent page ID')
|
|
1002
|
+
p.add_argument('--space-id', help='Destination space ID (cross-space move)')
|
|
969
1003
|
p.add_argument('--message', '-m', help='Version message')
|
|
970
1004
|
p.set_defaults(func=cmd_move)
|
|
971
1005
|
|
|
@@ -975,6 +1009,10 @@ def main():
|
|
|
975
1009
|
p.add_argument('--message', '-m', help='Version message')
|
|
976
1010
|
p.set_defaults(func=cmd_rename)
|
|
977
1011
|
|
|
1012
|
+
p = sub.add_parser('archive', help='Archive a page and its descendants')
|
|
1013
|
+
p.add_argument('page_id', help='Confluence page ID to archive')
|
|
1014
|
+
p.set_defaults(func=cmd_archive)
|
|
1015
|
+
|
|
978
1016
|
p = sub.add_parser('put', help='Upload local ADF to Confluence')
|
|
979
1017
|
p.add_argument('page_id', help='Confluence page ID')
|
|
980
1018
|
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.1}/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
|