markdown-to-confluence 0.4.6__tar.gz → 0.4.7__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.
- {markdown_to_confluence-0.4.6/markdown_to_confluence.egg-info → markdown_to_confluence-0.4.7}/PKG-INFO +4 -1
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/README.md +3 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7/markdown_to_confluence.egg-info}/PKG-INFO +4 -1
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/markdown_to_confluence.egg-info/SOURCES.txt +3 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/__init__.py +1 -1
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/__main__.py +18 -1
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/api.py +37 -23
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/converter.py +246 -134
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/csf.py +9 -7
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/domain.py +4 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/drawio.py +5 -3
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/latex.py +2 -2
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/matcher.py +1 -3
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/processor.py +1 -1
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/publisher.py +1 -1
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/scanner.py +12 -4
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/xml.py +8 -5
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/emoji.py +1 -1
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/admonition.md +18 -0
- markdown_to_confluence-0.4.7/tests/source/alignment.md +9 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/macro.md +10 -0
- markdown_to_confluence-0.4.7/tests/target/admonition.xml +73 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/alert.xml +5 -6
- markdown_to_confluence-0.4.7/tests/target/alignment.xml +10 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/macro.xml +7 -0
- markdown_to_confluence-0.4.7/tests/target/panel.xml +112 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/test_conversion.py +16 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/test_xml.py +5 -3
- markdown_to_confluence-0.4.6/tests/target/admonition.xml +0 -37
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/LICENSE +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/MANIFEST.in +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/markdown_to_confluence.egg-info/dependency_links.txt +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/markdown_to_confluence.egg-info/entry_points.txt +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/markdown_to_confluence.egg-info/requires.txt +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/markdown_to_confluence.egg-info/top_level.txt +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/markdown_to_confluence.egg-info/zip-safe +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/collection.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/emoticon.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/entities.dtd +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/environment.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/extra.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/local.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/markdown.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/mermaid.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/metadata.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/puppeteer-config.json +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/py.typed +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/text.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/toc.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/md2conf/uri.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/pyproject.toml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/setup.cfg +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/setup.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/__init__.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/alert.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/anchors.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/basic.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/code.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/collapsed.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/fenced.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/figure/diagram.drawio +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/figure/diagram.drawio.png +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/figure/diagram.drawio.svg +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/figure/raster.png +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/figure/vector.svg +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/footnote.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/ignore.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/images/images.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/images.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/math.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/mermaid.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/missing.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/sections.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/status.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/table.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/tags.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/tasklist.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/title.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/source/toc.md +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/anchors.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/basic.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/code.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/collapsed.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/fenced.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/footnote.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/images/images.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/images.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/math.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/mermaid.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/missing.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/sections.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/status.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/table.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/tags.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/tasklist.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/target/toc.xml +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/test_drawio.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/test_matcher.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/test_mermaid.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/test_processor.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/test_scanner.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/test_text.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/test_unit.py +0 -0
- {markdown_to_confluence-0.4.6 → markdown_to_confluence-0.4.7}/tests/utility.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: markdown-to-confluence
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
4
4
|
Summary: Publish Markdown files to Confluence wiki
|
|
5
5
|
Author-email: Levente Hunyadi <hunyadi@gmail.com>
|
|
6
6
|
Maintainer-email: Levente Hunyadi <hunyadi@gmail.com>
|
|
@@ -581,6 +581,9 @@ options:
|
|
|
581
581
|
--headers KEY=VALUE [KEY=VALUE ...]
|
|
582
582
|
Apply custom headers to all Confluence API requests.
|
|
583
583
|
--webui-links Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)
|
|
584
|
+
--alignment {center,left,right}
|
|
585
|
+
Alignment for block-level images and formulas (default: 'center').
|
|
586
|
+
--use-panel Transform admonitions and alerts into a Confluence custom panel.
|
|
584
587
|
```
|
|
585
588
|
|
|
586
589
|
### Using the Docker container
|
|
@@ -535,6 +535,9 @@ options:
|
|
|
535
535
|
--headers KEY=VALUE [KEY=VALUE ...]
|
|
536
536
|
Apply custom headers to all Confluence API requests.
|
|
537
537
|
--webui-links Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)
|
|
538
|
+
--alignment {center,left,right}
|
|
539
|
+
Alignment for block-level images and formulas (default: 'center').
|
|
540
|
+
--use-panel Transform admonitions and alerts into a Confluence custom panel.
|
|
538
541
|
```
|
|
539
542
|
|
|
540
543
|
### Using the Docker container
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: markdown-to-confluence
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
4
4
|
Summary: Publish Markdown files to Confluence wiki
|
|
5
5
|
Author-email: Levente Hunyadi <hunyadi@gmail.com>
|
|
6
6
|
Maintainer-email: Levente Hunyadi <hunyadi@gmail.com>
|
|
@@ -581,6 +581,9 @@ options:
|
|
|
581
581
|
--headers KEY=VALUE [KEY=VALUE ...]
|
|
582
582
|
Apply custom headers to all Confluence API requests.
|
|
583
583
|
--webui-links Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)
|
|
584
|
+
--alignment {center,left,right}
|
|
585
|
+
Alignment for block-level images and formulas (default: 'center').
|
|
586
|
+
--use-panel Transform admonitions and alerts into a Confluence custom panel.
|
|
584
587
|
```
|
|
585
588
|
|
|
586
589
|
### Using the Docker container
|
|
@@ -51,6 +51,7 @@ tests/test_xml.py
|
|
|
51
51
|
tests/utility.py
|
|
52
52
|
tests/source/admonition.md
|
|
53
53
|
tests/source/alert.md
|
|
54
|
+
tests/source/alignment.md
|
|
54
55
|
tests/source/anchors.md
|
|
55
56
|
tests/source/basic.md
|
|
56
57
|
tests/source/code.md
|
|
@@ -78,6 +79,7 @@ tests/source/figure/vector.svg
|
|
|
78
79
|
tests/source/images/images.md
|
|
79
80
|
tests/target/admonition.xml
|
|
80
81
|
tests/target/alert.xml
|
|
82
|
+
tests/target/alignment.xml
|
|
81
83
|
tests/target/anchors.xml
|
|
82
84
|
tests/target/basic.xml
|
|
83
85
|
tests/target/code.xml
|
|
@@ -89,6 +91,7 @@ tests/target/macro.xml
|
|
|
89
91
|
tests/target/math.xml
|
|
90
92
|
tests/target/mermaid.xml
|
|
91
93
|
tests/target/missing.xml
|
|
94
|
+
tests/target/panel.xml
|
|
92
95
|
tests/target/sections.xml
|
|
93
96
|
tests/target/status.xml
|
|
94
97
|
tests/target/table.xml
|
|
@@ -5,7 +5,7 @@ Parses Markdown files, converts Markdown content into the Confluence Storage For
|
|
|
5
5
|
Confluence API endpoints to upload images and content.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "0.4.
|
|
8
|
+
__version__ = "0.4.7"
|
|
9
9
|
__author__ = "Levente Hunyadi"
|
|
10
10
|
__copyright__ = "Copyright 2022-2025, Levente Hunyadi"
|
|
11
11
|
__license__ = "MIT"
|
|
@@ -46,6 +46,8 @@ class Arguments(argparse.Namespace):
|
|
|
46
46
|
local: bool
|
|
47
47
|
headers: dict[str, str]
|
|
48
48
|
webui_links: bool
|
|
49
|
+
alignment: Literal["center", "left", "right"]
|
|
50
|
+
use_panel: bool
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
class KwargsAppendAction(argparse.Action):
|
|
@@ -74,7 +76,7 @@ class PositionalOnlyHelpFormatter(argparse.HelpFormatter):
|
|
|
74
76
|
self,
|
|
75
77
|
usage: Optional[str],
|
|
76
78
|
actions: Iterable[argparse.Action],
|
|
77
|
-
groups: Iterable[argparse._MutuallyExclusiveGroup],
|
|
79
|
+
groups: Iterable[argparse._MutuallyExclusiveGroup], # pyright: ignore[reportPrivateUsage]
|
|
78
80
|
prefix: Optional[str],
|
|
79
81
|
) -> str:
|
|
80
82
|
# filter only positional arguments
|
|
@@ -242,6 +244,19 @@ def get_parser() -> argparse.ArgumentParser:
|
|
|
242
244
|
default=False,
|
|
243
245
|
help="Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)",
|
|
244
246
|
)
|
|
247
|
+
parser.add_argument(
|
|
248
|
+
"--alignment",
|
|
249
|
+
dest="alignment",
|
|
250
|
+
choices=["center", "left", "right"],
|
|
251
|
+
default="center",
|
|
252
|
+
help="Alignment for block-level images and formulas (default: 'center').",
|
|
253
|
+
)
|
|
254
|
+
parser.add_argument(
|
|
255
|
+
"--use-panel",
|
|
256
|
+
action="store_true",
|
|
257
|
+
default=False,
|
|
258
|
+
help="Transform admonitions and alerts into a Confluence custom panel.",
|
|
259
|
+
)
|
|
245
260
|
return parser
|
|
246
261
|
|
|
247
262
|
|
|
@@ -275,6 +290,8 @@ def main() -> None:
|
|
|
275
290
|
render_latex=args.render_latex,
|
|
276
291
|
diagram_output_format=args.diagram_output_format,
|
|
277
292
|
webui_links=args.webui_links,
|
|
293
|
+
alignment=args.alignment,
|
|
294
|
+
use_panel=args.use_panel,
|
|
278
295
|
)
|
|
279
296
|
if args.local:
|
|
280
297
|
from .local import LocalConverter
|
|
@@ -17,7 +17,7 @@ import typing
|
|
|
17
17
|
from dataclasses import dataclass
|
|
18
18
|
from pathlib import Path
|
|
19
19
|
from types import TracebackType
|
|
20
|
-
from typing import Any, Optional, TypeVar
|
|
20
|
+
from typing import Any, Optional, TypeVar, overload
|
|
21
21
|
from urllib.parse import urlencode, urlparse, urlunparse
|
|
22
22
|
|
|
23
23
|
import requests
|
|
@@ -71,16 +71,24 @@ def build_url(base_url: str, query: Optional[dict[str, str]] = None) -> str:
|
|
|
71
71
|
LOGGER = logging.getLogger(__name__)
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
@overload
|
|
75
|
+
def response_cast(response_type: None, response: requests.Response) -> None: ...
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@overload
|
|
79
|
+
def response_cast(response_type: type[T], response: requests.Response) -> T: ...
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def response_cast(response_type: Optional[type[T]], response: requests.Response) -> Optional[T]:
|
|
75
83
|
"Converts a response body into the expected type."
|
|
76
84
|
|
|
77
85
|
if response.text:
|
|
78
86
|
LOGGER.debug("Received HTTP payload:\n%s", response.text)
|
|
79
87
|
response.raise_for_status()
|
|
80
|
-
if response_type is
|
|
81
|
-
return _json_to_object(response_type, response.json())
|
|
82
|
-
else:
|
|
88
|
+
if response_type is None:
|
|
83
89
|
return None
|
|
90
|
+
else:
|
|
91
|
+
return _json_to_object(response_type, response.json())
|
|
84
92
|
|
|
85
93
|
|
|
86
94
|
@enum.unique
|
|
@@ -450,7 +458,7 @@ class ConfluenceSession:
|
|
|
450
458
|
|
|
451
459
|
if not domain or not base_path:
|
|
452
460
|
data = self._get(ConfluenceVersion.VERSION_2, "/spaces", ConfluenceResultSet, query={"limit": "1"})
|
|
453
|
-
base_url = data._links.base
|
|
461
|
+
base_url = data._links.base # pyright: ignore[reportPrivateUsage]
|
|
454
462
|
|
|
455
463
|
_, domain, base_path, _, _, _ = urlparse(base_url)
|
|
456
464
|
if not base_path.endswith("/"):
|
|
@@ -548,23 +556,23 @@ class ConfluenceSession:
|
|
|
548
556
|
|
|
549
557
|
return items
|
|
550
558
|
|
|
551
|
-
def _build_request(self, version: ConfluenceVersion, path: str, body: Any, response_type: type[T]) -> tuple[str, dict[str, str], bytes]:
|
|
559
|
+
def _build_request(self, version: ConfluenceVersion, path: str, body: Any, response_type: Optional[type[T]]) -> tuple[str, dict[str, str], bytes]:
|
|
552
560
|
"Generates URL, headers and raw payload for a typed request/response."
|
|
553
561
|
|
|
554
562
|
url = self._build_url(version, path)
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
"Accept": "application/json",
|
|
559
|
-
}
|
|
560
|
-
else:
|
|
561
|
-
headers = {
|
|
562
|
-
"Content-Type": "application/json; charset=utf-8",
|
|
563
|
-
}
|
|
563
|
+
headers = {"Content-Type": "application/json"}
|
|
564
|
+
if response_type is not None:
|
|
565
|
+
headers["Accept"] = "application/json"
|
|
564
566
|
data = json_dump_string(object_to_json(body)).encode("utf-8")
|
|
565
567
|
return url, headers, data
|
|
566
568
|
|
|
567
|
-
|
|
569
|
+
@overload
|
|
570
|
+
def _post(self, version: ConfluenceVersion, path: str, body: Any, response_type: None) -> None: ...
|
|
571
|
+
|
|
572
|
+
@overload
|
|
573
|
+
def _post(self, version: ConfluenceVersion, path: str, body: Any, response_type: type[T]) -> T: ...
|
|
574
|
+
|
|
575
|
+
def _post(self, version: ConfluenceVersion, path: str, body: Any, response_type: Optional[type[T]]) -> Optional[T]:
|
|
568
576
|
"Creates a new object via Confluence REST API."
|
|
569
577
|
|
|
570
578
|
url, headers, data = self._build_request(version, path, body, response_type)
|
|
@@ -572,7 +580,13 @@ class ConfluenceSession:
|
|
|
572
580
|
response.raise_for_status()
|
|
573
581
|
return response_cast(response_type, response)
|
|
574
582
|
|
|
575
|
-
|
|
583
|
+
@overload
|
|
584
|
+
def _put(self, version: ConfluenceVersion, path: str, body: Any, response_type: None) -> None: ...
|
|
585
|
+
|
|
586
|
+
@overload
|
|
587
|
+
def _put(self, version: ConfluenceVersion, path: str, body: Any, response_type: type[T]) -> T: ...
|
|
588
|
+
|
|
589
|
+
def _put(self, version: ConfluenceVersion, path: str, body: Any, response_type: Optional[type[T]]) -> Optional[T]:
|
|
576
590
|
"Updates an existing object via Confluence REST API."
|
|
577
591
|
|
|
578
592
|
url, headers, data = self._build_request(version, path, body, response_type)
|
|
@@ -806,7 +820,7 @@ class ConfluenceSession:
|
|
|
806
820
|
)
|
|
807
821
|
|
|
808
822
|
LOGGER.info("Updating attachment: %s", attachment_id)
|
|
809
|
-
self._put(ConfluenceVersion.VERSION_1, path, request,
|
|
823
|
+
self._put(ConfluenceVersion.VERSION_1, path, request, None)
|
|
810
824
|
|
|
811
825
|
def get_page_properties_by_title(
|
|
812
826
|
self,
|
|
@@ -899,7 +913,7 @@ class ConfluenceSession:
|
|
|
899
913
|
version=ConfluenceContentVersion(number=version, minorEdit=True),
|
|
900
914
|
)
|
|
901
915
|
LOGGER.info("Updating page: %s", page_id)
|
|
902
|
-
self._put(ConfluenceVersion.VERSION_2, path, request,
|
|
916
|
+
self._put(ConfluenceVersion.VERSION_2, path, request, None)
|
|
903
917
|
|
|
904
918
|
def create_page(
|
|
905
919
|
self,
|
|
@@ -934,7 +948,7 @@ class ConfluenceSession:
|
|
|
934
948
|
url,
|
|
935
949
|
data=json_dump_string(object_to_json(request)).encode("utf-8"),
|
|
936
950
|
headers={
|
|
937
|
-
"Content-Type": "application/json
|
|
951
|
+
"Content-Type": "application/json",
|
|
938
952
|
"Accept": "application/json",
|
|
939
953
|
},
|
|
940
954
|
verify=True,
|
|
@@ -995,7 +1009,7 @@ class ConfluenceSession:
|
|
|
995
1009
|
url,
|
|
996
1010
|
params=query,
|
|
997
1011
|
headers={
|
|
998
|
-
"Content-Type": "application/json
|
|
1012
|
+
"Content-Type": "application/json",
|
|
999
1013
|
"Accept": "application/json",
|
|
1000
1014
|
},
|
|
1001
1015
|
verify=True,
|
|
@@ -1048,7 +1062,7 @@ class ConfluenceSession:
|
|
|
1048
1062
|
"""
|
|
1049
1063
|
|
|
1050
1064
|
path = f"/content/{page_id}/label"
|
|
1051
|
-
self._post(ConfluenceVersion.VERSION_1, path, labels,
|
|
1065
|
+
self._post(ConfluenceVersion.VERSION_1, path, labels, None)
|
|
1052
1066
|
|
|
1053
1067
|
def remove_labels(self, page_id: str, labels: list[ConfluenceLabel]) -> None:
|
|
1054
1068
|
"""
|