deepflow-opendesk-cli 0.1.3__tar.gz → 0.1.4__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.
Files changed (23) hide show
  1. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/PKG-INFO +42 -1
  2. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/README.md +41 -0
  3. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/pyproject.toml +1 -1
  4. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/setup.py +1 -1
  5. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/__init__.py +1 -1
  6. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/PKG-INFO +42 -1
  7. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/tests/test_cli.py +75 -0
  8. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/setup.cfg +0 -0
  9. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/__main__.py +0 -0
  10. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/batch.py +0 -0
  11. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/cli.py +0 -0
  12. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/client.py +0 -0
  13. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/profiles.py +0 -0
  14. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/schema.py +0 -0
  15. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/workflows.py +0 -0
  16. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/SOURCES.txt +0 -0
  17. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/dependency_links.txt +0 -0
  18. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/entry_points.txt +0 -0
  19. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/requires.txt +0 -0
  20. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/top_level.txt +0 -0
  21. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/tests/test_client.py +0 -0
  22. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/tests/test_profiles.py +0 -0
  23. {deepflow_opendesk_cli-0.1.3 → deepflow_opendesk_cli-0.1.4}/tests/test_schema.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepflow-opendesk-cli
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Command-line client for OpenDesk admin configuration and outbound task APIs.
5
5
  Author: DeepFlow AI
6
6
  Project-URL: Repository, https://github.com/DeepFlowAI/opendesk-dev
@@ -100,6 +100,47 @@ deepflow_opendesk_cli call courses.list
100
100
  deepflow_opendesk_cli call exams.list
101
101
  ```
102
102
 
103
+ ## Web Channel Bot Process Visibility
104
+
105
+ After deploying a server that supports `config.open_agent_hide_process`, the
106
+ existing generic commands can read and update this setting. No dedicated CLI
107
+ flag is required. Refresh the cached schema to discover the new boolean field:
108
+
109
+ ```bash
110
+ deepflow_opendesk_cli schema fetch
111
+ deepflow_opendesk_cli docs schema ChannelConfig
112
+ deepflow_opendesk_cli docs show channels.update
113
+ ```
114
+
115
+ Channel updates replace the full configuration; sending only the new boolean
116
+ can reset other settings. Read the channel first, preserve its editable fields
117
+ and complete `config`, then change the boolean. For example, using `jq`:
118
+
119
+ ```bash
120
+ deepflow_opendesk_cli call channels.get --path channel_id=12 > channel-current.json
121
+ jq -e '.ok == true and (.data.config | type == "object")' channel-current.json
122
+ jq '.data | {name, channel_type, access_mode, logo_url, favicon_url, config}
123
+ | .config.open_agent_hide_process = true' \
124
+ channel-current.json > channel-update.json
125
+
126
+ deepflow_opendesk_cli call channels.update --path channel_id=12 \
127
+ --json-file channel-update.json --dry-run
128
+ deepflow_opendesk_cli call channels.update --path channel_id=12 \
129
+ --json-file channel-update.json
130
+ deepflow_opendesk_cli call channels.get --path channel_id=12
131
+ ```
132
+
133
+ Continue to the update only if the read and validation succeeded. Use JSON
134
+ `false` to restore process visibility, not the string `"false"`. Both new and
135
+ legacy channels default to `false` when the field is missing. The setting affects
136
+ visitor display only; disabling the bot does not clear it. Existing channel
137
+ management permissions still apply. Concurrent edits between the read and update
138
+ can be overwritten, so read the latest configuration before applying the change.
139
+
140
+ `request PUT /api/v1/channels/12 --json-file channel-update.json` is equivalent;
141
+ batch and workflow bodies also pass the same field through unchanged. `--dry-run`
142
+ prints the request without sending it; the server performs field validation.
143
+
103
144
  ## Outbound Tasks
104
145
 
105
146
  The outbound commands use the API-key OpenAPI under
@@ -78,6 +78,47 @@ deepflow_opendesk_cli call courses.list
78
78
  deepflow_opendesk_cli call exams.list
79
79
  ```
80
80
 
81
+ ## Web Channel Bot Process Visibility
82
+
83
+ After deploying a server that supports `config.open_agent_hide_process`, the
84
+ existing generic commands can read and update this setting. No dedicated CLI
85
+ flag is required. Refresh the cached schema to discover the new boolean field:
86
+
87
+ ```bash
88
+ deepflow_opendesk_cli schema fetch
89
+ deepflow_opendesk_cli docs schema ChannelConfig
90
+ deepflow_opendesk_cli docs show channels.update
91
+ ```
92
+
93
+ Channel updates replace the full configuration; sending only the new boolean
94
+ can reset other settings. Read the channel first, preserve its editable fields
95
+ and complete `config`, then change the boolean. For example, using `jq`:
96
+
97
+ ```bash
98
+ deepflow_opendesk_cli call channels.get --path channel_id=12 > channel-current.json
99
+ jq -e '.ok == true and (.data.config | type == "object")' channel-current.json
100
+ jq '.data | {name, channel_type, access_mode, logo_url, favicon_url, config}
101
+ | .config.open_agent_hide_process = true' \
102
+ channel-current.json > channel-update.json
103
+
104
+ deepflow_opendesk_cli call channels.update --path channel_id=12 \
105
+ --json-file channel-update.json --dry-run
106
+ deepflow_opendesk_cli call channels.update --path channel_id=12 \
107
+ --json-file channel-update.json
108
+ deepflow_opendesk_cli call channels.get --path channel_id=12
109
+ ```
110
+
111
+ Continue to the update only if the read and validation succeeded. Use JSON
112
+ `false` to restore process visibility, not the string `"false"`. Both new and
113
+ legacy channels default to `false` when the field is missing. The setting affects
114
+ visitor display only; disabling the bot does not clear it. Existing channel
115
+ management permissions still apply. Concurrent edits between the read and update
116
+ can be overwritten, so read the latest configuration before applying the change.
117
+
118
+ `request PUT /api/v1/channels/12 --json-file channel-update.json` is equivalent;
119
+ batch and workflow bodies also pass the same field through unchanged. `--dry-run`
120
+ prints the request without sending it; the server performs field validation.
121
+
81
122
  ## Outbound Tasks
82
123
 
83
124
  The outbound commands use the API-key OpenAPI under
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "deepflow-opendesk-cli"
7
- version = "0.1.3"
7
+ version = "0.1.4"
8
8
  description = "Command-line client for OpenDesk admin configuration and outbound task APIs."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -7,7 +7,7 @@ from setuptools import find_packages, setup
7
7
 
8
8
  setup(
9
9
  name="deepflow-opendesk-cli",
10
- version="0.1.3",
10
+ version="0.1.4",
11
11
  description="Command-line client for OpenDesk admin configuration and outbound task APIs.",
12
12
  long_description=Path("README.md").read_text(encoding="utf-8"),
13
13
  long_description_content_type="text/markdown",
@@ -1,3 +1,3 @@
1
1
  """OpenDesk admin configuration and outbound task API CLI."""
2
2
 
3
- __version__ = "0.1.3"
3
+ __version__ = "0.1.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepflow-opendesk-cli
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Command-line client for OpenDesk admin configuration and outbound task APIs.
5
5
  Author: DeepFlow AI
6
6
  Project-URL: Repository, https://github.com/DeepFlowAI/opendesk-dev
@@ -100,6 +100,47 @@ deepflow_opendesk_cli call courses.list
100
100
  deepflow_opendesk_cli call exams.list
101
101
  ```
102
102
 
103
+ ## Web Channel Bot Process Visibility
104
+
105
+ After deploying a server that supports `config.open_agent_hide_process`, the
106
+ existing generic commands can read and update this setting. No dedicated CLI
107
+ flag is required. Refresh the cached schema to discover the new boolean field:
108
+
109
+ ```bash
110
+ deepflow_opendesk_cli schema fetch
111
+ deepflow_opendesk_cli docs schema ChannelConfig
112
+ deepflow_opendesk_cli docs show channels.update
113
+ ```
114
+
115
+ Channel updates replace the full configuration; sending only the new boolean
116
+ can reset other settings. Read the channel first, preserve its editable fields
117
+ and complete `config`, then change the boolean. For example, using `jq`:
118
+
119
+ ```bash
120
+ deepflow_opendesk_cli call channels.get --path channel_id=12 > channel-current.json
121
+ jq -e '.ok == true and (.data.config | type == "object")' channel-current.json
122
+ jq '.data | {name, channel_type, access_mode, logo_url, favicon_url, config}
123
+ | .config.open_agent_hide_process = true' \
124
+ channel-current.json > channel-update.json
125
+
126
+ deepflow_opendesk_cli call channels.update --path channel_id=12 \
127
+ --json-file channel-update.json --dry-run
128
+ deepflow_opendesk_cli call channels.update --path channel_id=12 \
129
+ --json-file channel-update.json
130
+ deepflow_opendesk_cli call channels.get --path channel_id=12
131
+ ```
132
+
133
+ Continue to the update only if the read and validation succeeded. Use JSON
134
+ `false` to restore process visibility, not the string `"false"`. Both new and
135
+ legacy channels default to `false` when the field is missing. The setting affects
136
+ visitor display only; disabling the bot does not clear it. Existing channel
137
+ management permissions still apply. Concurrent edits between the read and update
138
+ can be overwritten, so read the latest configuration before applying the change.
139
+
140
+ `request PUT /api/v1/channels/12 --json-file channel-update.json` is equivalent;
141
+ batch and workflow bodies also pass the same field through unchanged. `--dry-run`
142
+ prints the request without sending it; the server performs field validation.
143
+
103
144
  ## Outbound Tasks
104
145
 
105
146
  The outbound commands use the API-key OpenAPI under
@@ -1,10 +1,85 @@
1
1
  import json
2
+ from copy import deepcopy
3
+
4
+ import pytest
2
5
 
3
6
  from deepflow_opendesk_cli.cli import main
4
7
  from deepflow_opendesk_cli.client import HttpResult, OpenDeskClient
5
8
  from test_schema import SAMPLE_SCHEMA
6
9
 
7
10
 
11
+ @pytest.fixture
12
+ def channel_schema_file(tmp_path):
13
+ schema = deepcopy(SAMPLE_SCHEMA)
14
+ schema["paths"]["/api/v1/channels/{channel_id}"]["put"] = {
15
+ "tags": ["Channels"],
16
+ "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChannelUpdate"}}}},
17
+ }
18
+ schema["components"]["schemas"].update({
19
+ "ChannelConfig": {
20
+ "type": "object",
21
+ "properties": {"open_agent_hide_process": {"type": "boolean", "default": False}},
22
+ },
23
+ "ChannelUpdate": {
24
+ "type": "object",
25
+ "properties": {"config": {"$ref": "#/components/schemas/ChannelConfig"}},
26
+ },
27
+ })
28
+ path = tmp_path / "channel-openapi.json"
29
+ path.write_text(json.dumps(schema), encoding="utf-8")
30
+ return str(path)
31
+
32
+
33
+ def test_channel_docs_discover_process_visibility(channel_schema_file, capsys) -> None:
34
+ assert main(["docs", "show", "channels.update", "--schema-file", channel_schema_file, "--json"]) == 0
35
+ payload = json.loads(capsys.readouterr().out)
36
+ field = payload["body_fields"]["properties"]["config"]["properties"]["open_agent_hide_process"]
37
+ assert field["type"] == "boolean"
38
+ assert field["default"] is False
39
+
40
+
41
+ @pytest.mark.parametrize("hide_process", [False, True])
42
+ @pytest.mark.parametrize("command", ["call", "request", "batch", "workflow"])
43
+ def test_channel_update_preserves_visibility_and_other_config(
44
+ channel_schema_file, monkeypatch, capsys, tmp_path, hide_process, command,
45
+ ) -> None:
46
+ monkeypatch.setenv("OPENDESK_CONFIG_HOME", str(tmp_path))
47
+ body = {
48
+ "name": "Support", "channel_type": "web", "access_mode": "embed",
49
+ "logo_url": None, "favicon_url": None,
50
+ "config": {
51
+ "open_agent_enabled": True,
52
+ "open_agent_agent_id": 7,
53
+ "open_agent_hide_process": hide_process,
54
+ "open_agent_feedback_enabled": True,
55
+ "open_agent_custom_buttons": [{"label": "Help", "value": "help"}],
56
+ },
57
+ }
58
+ body_path = tmp_path / "channel-update.json"
59
+ body_path.write_text(json.dumps(body), encoding="utf-8")
60
+ operation = {"key": "channels.update", "path": {"channel_id": 12}, "body": body}
61
+ if command == "call":
62
+ args = ["call", "channels.update", "--path", "channel_id=12", "--json-file", str(body_path)]
63
+ elif command == "request":
64
+ args = ["request", "PUT", "/api/v1/channels/12", "--json-file", str(body_path)]
65
+ elif command == "batch":
66
+ plan = tmp_path / "operations.jsonl"
67
+ plan.write_text(json.dumps(operation) + "\n", encoding="utf-8")
68
+ args = ["batch", "run", str(plan)]
69
+ else:
70
+ plan = tmp_path / "operations.json"
71
+ plan.write_text(json.dumps([operation]), encoding="utf-8")
72
+ args = ["workflow", "run", "setup-web-channel", "--json-file", str(plan)]
73
+
74
+ assert main([*args, "--schema-file", channel_schema_file, "--dry-run"]) == 0
75
+ payload = json.loads(capsys.readouterr().out)
76
+ assert payload["method"] == "PUT"
77
+ assert payload["path"] == "/api/v1/channels/12"
78
+ assert payload["dry_run"] is True
79
+ assert payload["data"]["body"] == body
80
+ assert payload["data"]["body"]["config"]["open_agent_hide_process"] is hide_process
81
+
82
+
8
83
  def write_schema(tmp_path) -> str:
9
84
  path = tmp_path / "openapi.json"
10
85
  path.write_text(json.dumps(SAMPLE_SCHEMA), encoding="utf-8")