atlassian-cli 0.8.0__tar.gz → 0.9.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.8.0/src/atlassian_cli.egg-info → atlassian_cli-0.9.0}/PKG-INFO +1 -1
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/pyproject.toml +1 -1
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/confluence.py +13 -4
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0/src/atlassian_cli.egg-info}/PKG-INFO +1 -1
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/LICENSE +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/README.md +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/setup.cfg +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/__init__.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/adf.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/config.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/hints.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/http.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/jira.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/jira_assets.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/jira_issues.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/output.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli/update_check.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli.egg-info/SOURCES.txt +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli.egg-info/dependency_links.txt +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli.egg-info/entry_points.txt +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli.egg-info/requires.txt +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/src/atlassian_cli.egg-info/top_level.txt +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/tests/test_adf.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/tests/test_config.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/tests/test_confluence.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/tests/test_http.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/tests/test_jira_assets.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/tests/test_jira_issues.py +0 -0
- {atlassian_cli-0.8.0 → atlassian_cli-0.9.0}/tests/test_output.py +0 -0
|
@@ -72,10 +72,15 @@ def get_space(session, base, *, key=None, space_id=None):
|
|
|
72
72
|
return space
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
def list_pages(session, base, space_id):
|
|
76
|
-
"""Cursor-paginated listing of
|
|
75
|
+
def list_pages(session, base, space_id, statuses=('current',)):
|
|
76
|
+
"""Cursor-paginated listing of pages in a space, filtered by status.
|
|
77
|
+
|
|
78
|
+
The V2 default returns *all* statuses (current, archived, draft, deleted)
|
|
79
|
+
which is rarely what callers want. We default to current-only and let the
|
|
80
|
+
caller widen the filter if needed."""
|
|
77
81
|
pages = []
|
|
78
|
-
|
|
82
|
+
status_q = '&'.join(f'status={s}' for s in statuses)
|
|
83
|
+
url = f'{base}{V2}/spaces/{space_id}/pages?limit=250&sort=id&{status_q}'
|
|
79
84
|
while url:
|
|
80
85
|
resp = _retry(session.get, url)
|
|
81
86
|
resp.raise_for_status()
|
|
@@ -431,11 +436,12 @@ def cmd_index(args):
|
|
|
431
436
|
spaces = args.space if args.space else ['POL', 'COMPLY']
|
|
432
437
|
index = {}
|
|
433
438
|
|
|
439
|
+
statuses = ('current', 'archived') if args.include_archived else ('current',)
|
|
434
440
|
for space_key in spaces:
|
|
435
441
|
space = get_space(session, base, key=space_key)
|
|
436
442
|
space_id = space['id']
|
|
437
443
|
print(f'Indexing {space_key}…', file=sys.stderr)
|
|
438
|
-
pages = list_pages(session, base, space_id)
|
|
444
|
+
pages = list_pages(session, base, space_id, statuses=statuses)
|
|
439
445
|
|
|
440
446
|
index[space_key] = []
|
|
441
447
|
for page in pages:
|
|
@@ -445,6 +451,7 @@ def cmd_index(args):
|
|
|
445
451
|
'parentId': page.get('parentId', ''),
|
|
446
452
|
'version': _ver(page),
|
|
447
453
|
'updatedAt': _ver_ts(page),
|
|
454
|
+
'status': page.get('status', 'current'),
|
|
448
455
|
})
|
|
449
456
|
print(f' {space_key}: {len(pages)} pages', file=sys.stderr)
|
|
450
457
|
|
|
@@ -995,6 +1002,8 @@ def main():
|
|
|
995
1002
|
p = sub.add_parser('index', help='Rebuild page-index.json from API')
|
|
996
1003
|
p.add_argument('--space', action='append', help='Space key(s) to index (default: POL COMPLY)')
|
|
997
1004
|
p.add_argument('--output', default='page-index.json', help='Output file (default: page-index.json)')
|
|
1005
|
+
p.add_argument('--include-archived', action='store_true',
|
|
1006
|
+
help='Also include archived pages (default is current only)')
|
|
998
1007
|
p.set_defaults(func=cmd_index)
|
|
999
1008
|
|
|
1000
1009
|
p = sub.add_parser('comments', help='List comments on a page')
|
|
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
|