ya-dialogs-api 1.0.0__py3-none-any.whl
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.
- ya_dialogs_api/__init__.py +85 -0
- ya_dialogs_api/api_client.py +1119 -0
- ya_dialogs_api/assets/__init__.py +1 -0
- ya_dialogs_api/assets/default_logo.png +0 -0
- ya_dialogs_api/py.typed +0 -0
- ya_dialogs_api/state.py +122 -0
- ya_dialogs_api-1.0.0.dist-info/METADATA +170 -0
- ya_dialogs_api-1.0.0.dist-info/RECORD +11 -0
- ya_dialogs_api-1.0.0.dist-info/WHEEL +4 -0
- ya_dialogs_api-1.0.0.dist-info/licenses/LICENSE +21 -0
- ya_dialogs_api-1.0.0.dist-info/licenses/NOTICE +29 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
r"""ya-dialogs-api — Yandex Dialogs Developer API client.
|
|
2
|
+
|
|
3
|
+
Programmatic skill creation, draft management, and publication against the
|
|
4
|
+
``dialogs.yandex.ru/developer-api/v2/`` endpoints. Framework-agnostic: the
|
|
5
|
+
caller produces an authorized ``aiohttp.ClientSession`` (typically via
|
|
6
|
+
``ya-passport-auth.PassportClient.login_device_code``) and hands it to the
|
|
7
|
+
library through a context-manager factory.
|
|
8
|
+
|
|
9
|
+
Public API:
|
|
10
|
+
|
|
11
|
+
- :func:`auto_create_skill` — full pipeline: create app → upload logo →
|
|
12
|
+
patch draft → create OAuth app → attach → publish. Resumable via
|
|
13
|
+
``SkillCreationArtifacts``.
|
|
14
|
+
- :func:`auto_rename_dialog_skill` — patch a dialog skill draft and re-deploy.
|
|
15
|
+
- :class:`DialogsSkillCreator` — low-level dev-console client (one method
|
|
16
|
+
per pipeline step). Use this if you need finer control than
|
|
17
|
+
:func:`auto_create_skill` provides.
|
|
18
|
+
- :data:`SkillType` — Literal\\["smart_home", "dialog"\\].
|
|
19
|
+
- Payload builders: :func:`build_smart_home_draft_payload`,
|
|
20
|
+
:func:`build_dialog_draft_payload`, :func:`build_oauth_app_payload`.
|
|
21
|
+
- State machine: :class:`SkillCreationArtifacts`, :class:`SkillCreationState`,
|
|
22
|
+
:func:`dump_artifacts`, :func:`load_artifacts`.
|
|
23
|
+
- Default logo asset: :func:`load_default_logo_bytes`.
|
|
24
|
+
- :class:`SecretStr` re-exported from :mod:`ya_passport_auth` for token
|
|
25
|
+
redaction in repr/format/tracebacks.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from __future__ import annotations
|
|
29
|
+
|
|
30
|
+
from ya_passport_auth import SecretStr
|
|
31
|
+
|
|
32
|
+
from .api_client import (
|
|
33
|
+
DEVICE_FLOW_TIMEOUT_SECONDS,
|
|
34
|
+
DIALOG_CHANNEL,
|
|
35
|
+
DIALOGS_API_BASE,
|
|
36
|
+
DIALOGS_CSRF_REGEX,
|
|
37
|
+
DIALOGS_DEV_BASE,
|
|
38
|
+
DIALOGS_DEV_HTML_URL,
|
|
39
|
+
SMART_HOME_CHANNEL,
|
|
40
|
+
AuthenticatorCM,
|
|
41
|
+
DialogsApiError,
|
|
42
|
+
DialogsCsrfError,
|
|
43
|
+
DialogsDuplicateSkillError,
|
|
44
|
+
DialogsSkillCreator,
|
|
45
|
+
SkillType,
|
|
46
|
+
auto_create_skill,
|
|
47
|
+
auto_rename_dialog_skill,
|
|
48
|
+
build_dialog_draft_payload,
|
|
49
|
+
build_oauth_app_payload,
|
|
50
|
+
build_smart_home_draft_payload,
|
|
51
|
+
load_default_logo_bytes,
|
|
52
|
+
)
|
|
53
|
+
from .state import (
|
|
54
|
+
SkillCreationArtifacts,
|
|
55
|
+
SkillCreationState,
|
|
56
|
+
dump_artifacts,
|
|
57
|
+
load_artifacts,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
__all__ = [
|
|
61
|
+
"DEVICE_FLOW_TIMEOUT_SECONDS",
|
|
62
|
+
"DIALOGS_API_BASE",
|
|
63
|
+
"DIALOGS_CSRF_REGEX",
|
|
64
|
+
"DIALOGS_DEV_BASE",
|
|
65
|
+
"DIALOGS_DEV_HTML_URL",
|
|
66
|
+
"DIALOG_CHANNEL",
|
|
67
|
+
"SMART_HOME_CHANNEL",
|
|
68
|
+
"AuthenticatorCM",
|
|
69
|
+
"DialogsApiError",
|
|
70
|
+
"DialogsCsrfError",
|
|
71
|
+
"DialogsDuplicateSkillError",
|
|
72
|
+
"DialogsSkillCreator",
|
|
73
|
+
"SecretStr",
|
|
74
|
+
"SkillCreationArtifacts",
|
|
75
|
+
"SkillCreationState",
|
|
76
|
+
"SkillType",
|
|
77
|
+
"auto_create_skill",
|
|
78
|
+
"auto_rename_dialog_skill",
|
|
79
|
+
"build_dialog_draft_payload",
|
|
80
|
+
"build_oauth_app_payload",
|
|
81
|
+
"build_smart_home_draft_payload",
|
|
82
|
+
"dump_artifacts",
|
|
83
|
+
"load_artifacts",
|
|
84
|
+
"load_default_logo_bytes",
|
|
85
|
+
]
|