deepflow-opendesk-cli 0.1.2__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.
- deepflow_opendesk_cli-0.1.4/PKG-INFO +285 -0
- deepflow_opendesk_cli-0.1.4/README.md +263 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/pyproject.toml +2 -2
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/setup.py +2 -2
- deepflow_opendesk_cli-0.1.4/src/deepflow_opendesk_cli/__init__.py +3 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/cli.py +348 -20
- deepflow_opendesk_cli-0.1.4/src/deepflow_opendesk_cli/schema.py +641 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/workflows.py +27 -2
- deepflow_opendesk_cli-0.1.4/src/deepflow_opendesk_cli.egg-info/PKG-INFO +285 -0
- deepflow_opendesk_cli-0.1.4/tests/test_cli.py +419 -0
- deepflow_opendesk_cli-0.1.4/tests/test_schema.py +450 -0
- deepflow_opendesk_cli-0.1.2/PKG-INFO +0 -156
- deepflow_opendesk_cli-0.1.2/README.md +0 -134
- deepflow_opendesk_cli-0.1.2/src/deepflow_opendesk_cli/__init__.py +0 -3
- deepflow_opendesk_cli-0.1.2/src/deepflow_opendesk_cli/schema.py +0 -393
- deepflow_opendesk_cli-0.1.2/src/deepflow_opendesk_cli.egg-info/PKG-INFO +0 -156
- deepflow_opendesk_cli-0.1.2/tests/test_cli.py +0 -154
- deepflow_opendesk_cli-0.1.2/tests/test_schema.py +0 -154
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/setup.cfg +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/__main__.py +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/batch.py +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/client.py +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli/profiles.py +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/SOURCES.txt +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/dependency_links.txt +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/entry_points.txt +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/requires.txt +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/src/deepflow_opendesk_cli.egg-info/top_level.txt +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/tests/test_client.py +0 -0
- {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.4}/tests/test_profiles.py +0 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: deepflow-opendesk-cli
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Command-line client for OpenDesk admin configuration and outbound task APIs.
|
|
5
|
+
Author: DeepFlow AI
|
|
6
|
+
Project-URL: Repository, https://github.com/DeepFlowAI/opendesk-dev
|
|
7
|
+
Keywords: deepflow,opendesk,cli,openapi,admin,configuration
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
19
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
20
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
|
|
23
|
+
# deepflow-opendesk-cli
|
|
24
|
+
|
|
25
|
+
Python command-line client for OpenDesk admin configuration and outbound task APIs.
|
|
26
|
+
|
|
27
|
+
The CLI is designed for implementation engineers, operators, and AI agents that need to configure OpenDesk through the same APIs used by the admin console.
|
|
28
|
+
|
|
29
|
+
## Scope
|
|
30
|
+
|
|
31
|
+
This package intentionally exposes admin configuration APIs and API-key outbound task management APIs. Runtime workspace data, public visitor APIs, reports, and call-center agent actions are excluded by a schema whitelist.
|
|
32
|
+
|
|
33
|
+
Included examples:
|
|
34
|
+
|
|
35
|
+
- System settings
|
|
36
|
+
- Roles, employees, employee groups
|
|
37
|
+
- Service hours
|
|
38
|
+
- Channels
|
|
39
|
+
- Field definitions, form layouts, interaction rules
|
|
40
|
+
- User, ticket, and organization view configuration
|
|
41
|
+
- Satisfaction and welcome-message settings
|
|
42
|
+
- Voice flows, ticket workflows, inbound/session routing rules
|
|
43
|
+
- Queue policies
|
|
44
|
+
- Outbound task templates, manual outbound tasks, and automatic outbound tasks
|
|
45
|
+
- Learning courses and exams (admin configuration)
|
|
46
|
+
- Optional tenant, SIP trunk, and phone-number configuration endpoints when extensions are loaded
|
|
47
|
+
|
|
48
|
+
## Install For Development
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
cd packages/deepflow-opendesk-cli
|
|
52
|
+
pip install -e ".[dev]"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Configure Host And Token
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
export OPENDESK_HOST="http://localhost:5001"
|
|
59
|
+
export OPENDESK_TOKEN="..."
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Or log in and save a local profile:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
deepflow_opendesk_cli auth login \
|
|
66
|
+
--tenant 12058577c8114513 \
|
|
67
|
+
--username test \
|
|
68
|
+
--save-token
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Profile files are stored under `~/.opendesk/cli/{profile}/` with owner-only permissions where supported.
|
|
72
|
+
|
|
73
|
+
## Common Commands
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
deepflow_opendesk_cli schema fetch
|
|
77
|
+
deepflow_opendesk_cli docs list --tag FieldDefinitions
|
|
78
|
+
deepflow_opendesk_cli docs show fields.create --json
|
|
79
|
+
deepflow_opendesk_cli docs schema FieldDefinitionCreate
|
|
80
|
+
|
|
81
|
+
deepflow_opendesk_cli request GET /api/v1/system/info
|
|
82
|
+
deepflow_opendesk_cli call fields.list --query domain=ticket
|
|
83
|
+
deepflow_opendesk_cli call fields.create --json-file field.json
|
|
84
|
+
|
|
85
|
+
deepflow_opendesk_cli system settings
|
|
86
|
+
deepflow_opendesk_cli roles permission-tree
|
|
87
|
+
deepflow_opendesk_cli employees list
|
|
88
|
+
deepflow_opendesk_cli channels list
|
|
89
|
+
deepflow_opendesk_cli call service_hours.list
|
|
90
|
+
deepflow_opendesk_cli call satisfaction.get
|
|
91
|
+
deepflow_opendesk_cli call welcome_rules.create --json-file welcome-rule.json
|
|
92
|
+
deepflow_opendesk_cli routing session list
|
|
93
|
+
deepflow_opendesk_cli queue policies
|
|
94
|
+
deepflow_opendesk_cli outbound-templates list
|
|
95
|
+
deepflow_opendesk_cli outbound-templates get-script 12
|
|
96
|
+
deepflow_opendesk_cli outbound-templates set-script 12 --json-file script.json
|
|
97
|
+
deepflow_opendesk_cli outbound-tasks list
|
|
98
|
+
deepflow_opendesk_cli auto-outbound-tasks list
|
|
99
|
+
deepflow_opendesk_cli call courses.list
|
|
100
|
+
deepflow_opendesk_cli call exams.list
|
|
101
|
+
```
|
|
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
|
+
|
|
144
|
+
## Outbound Tasks
|
|
145
|
+
|
|
146
|
+
The outbound commands use the API-key OpenAPI under
|
|
147
|
+
`/api/v1/open/engagement`. Set the tenant API key in `OPENDESK_TOKEN` or pass
|
|
148
|
+
the global `--token` option before the command.
|
|
149
|
+
|
|
150
|
+
Manual task examples:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
deepflow_opendesk_cli outbound-tasks create --json-file manual-task.json
|
|
154
|
+
deepflow_opendesk_cli outbound-tasks publish 18
|
|
155
|
+
deepflow_opendesk_cli outbound-tasks targets 18 --status pending
|
|
156
|
+
deepflow_opendesk_cli outbound-tasks add-target 18 \
|
|
157
|
+
--json '{"phone_number":"13800138000","field_values":{"name":"Alice"}}'
|
|
158
|
+
deepflow_opendesk_cli outbound-tasks add-targets 18 --json-file targets.json
|
|
159
|
+
deepflow_opendesk_cli outbound-tasks import-targets 18 targets.xlsx
|
|
160
|
+
deepflow_opendesk_cli outbound-tasks records 18
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Automatic task examples:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
deepflow_opendesk_cli auto-outbound-tasks create --json-file auto-task.json
|
|
167
|
+
deepflow_opendesk_cli auto-outbound-tasks start 27
|
|
168
|
+
deepflow_opendesk_cli auto-outbound-tasks monitor 27
|
|
169
|
+
deepflow_opendesk_cli auto-outbound-tasks add-targets 27 --json-file targets.json
|
|
170
|
+
deepflow_opendesk_cli auto-outbound-tasks import-targets 27 targets.csv
|
|
171
|
+
deepflow_opendesk_cli auto-outbound-tasks mark-target-invalid 81
|
|
172
|
+
deepflow_opendesk_cli auto-outbound-tasks delete 27 --yes
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
`add-targets` accepts a JSON object containing 1–5000 targets:
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"targets": [
|
|
180
|
+
{
|
|
181
|
+
"phone_number": "13800138000",
|
|
182
|
+
"user_id": 123,
|
|
183
|
+
"field_values": {"name": "Alice", "customer_level": "VIP"}
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
`import-targets` keeps the existing Excel/CSV file import behavior. Use
|
|
190
|
+
`docs show outbound_tasks.create` or `docs show auto_outbound_tasks.create`
|
|
191
|
+
after `schema fetch` to inspect the current request fields.
|
|
192
|
+
|
|
193
|
+
Equivalent module invocation:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
python -m deepflow_opendesk_cli docs list
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Construct Request Bodies
|
|
200
|
+
|
|
201
|
+
`docs show <endpoint-key>` expands the request body schema into a field tree
|
|
202
|
+
(name, type, required, enum, description) and prints a generated example
|
|
203
|
+
payload, so an agent can construct a valid body without reading the OpenAPI
|
|
204
|
+
components by hand. `docs schema <SchemaName>` does the same for any component
|
|
205
|
+
schema in the fetched OpenAPI document.
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
deepflow_opendesk_cli docs show fields.create
|
|
209
|
+
deepflow_opendesk_cli docs schema WelcomeMessageRuleCreate --json
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Use the printed example as a starting point, edit values, then pass it with
|
|
213
|
+
`--json` / `--json-file`. Add `--dry-run` to validate the plan without sending
|
|
214
|
+
requests.
|
|
215
|
+
|
|
216
|
+
## AI Agent Flow
|
|
217
|
+
|
|
218
|
+
Recommended execution loop:
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
1. schema fetch or docs list
|
|
222
|
+
2. docs show <endpoint-key> (and docs schema <SchemaName> for body details)
|
|
223
|
+
3. request/call --dry-run
|
|
224
|
+
4. present plan to a human
|
|
225
|
+
5. batch run / workflow run --yes
|
|
226
|
+
6. verify with config list/get commands
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Batch
|
|
230
|
+
|
|
231
|
+
`batch run` accepts JSONL. Each line is a config operation:
|
|
232
|
+
|
|
233
|
+
```jsonl
|
|
234
|
+
{"key":"auth.me"}
|
|
235
|
+
{"key":"fields.create","body":{"domain":"ticket","name":"Customer Tier","field_type":"select"}}
|
|
236
|
+
{"method":"PUT","path":"/api/v1/system-settings","body":{"default_language":"zh","default_timezone":"Asia/Shanghai"}}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Run:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
deepflow_opendesk_cli batch run ops.jsonl --dry-run
|
|
243
|
+
deepflow_opendesk_cli batch run ops.jsonl --continue-on-error --output results.jsonl
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Workflows
|
|
247
|
+
|
|
248
|
+
`workflow list` shows named configuration workflows. Running a workflow without
|
|
249
|
+
`--json-file` executes its built-in **read-only** plan, which snapshots the
|
|
250
|
+
relevant current configuration (safe to run anytime). Pass `--json-file` with a
|
|
251
|
+
batch-style operations array to run a custom write plan instead.
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
deepflow_opendesk_cli workflow list
|
|
255
|
+
deepflow_opendesk_cli workflow run setup-tenant --dry-run
|
|
256
|
+
deepflow_opendesk_cli workflow run setup-web-channel --json-file channel-plan.json --yes
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## Development
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
cd packages/deepflow-opendesk-cli
|
|
263
|
+
PYTHONPATH=src python -m pytest tests -q
|
|
264
|
+
python -m build
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Distribution
|
|
268
|
+
|
|
269
|
+
Releases are automated. Pushing a `v*` git tag (e.g. `v0.1.1`) triggers
|
|
270
|
+
`.github/workflows/release.yml`, which runs the tests, builds the sdist + wheel,
|
|
271
|
+
publishes `deepflow-opendesk-cli` to PyPI, and cuts a GitHub Release.
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
pip install deepflow-opendesk-cli
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
To cut a patch release, run the helper script (bumps the version across
|
|
278
|
+
`pyproject.toml`, `setup.py`, and `__init__.py`, then tags and pushes):
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
bash .claude/skills/release-publish/scripts/release-tag.sh --dry-run
|
|
282
|
+
bash .claude/skills/release-publish/scripts/release-tag.sh
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
To build locally without publishing: `python -m build`.
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
# deepflow-opendesk-cli
|
|
2
|
+
|
|
3
|
+
Python command-line client for OpenDesk admin configuration and outbound task APIs.
|
|
4
|
+
|
|
5
|
+
The CLI is designed for implementation engineers, operators, and AI agents that need to configure OpenDesk through the same APIs used by the admin console.
|
|
6
|
+
|
|
7
|
+
## Scope
|
|
8
|
+
|
|
9
|
+
This package intentionally exposes admin configuration APIs and API-key outbound task management APIs. Runtime workspace data, public visitor APIs, reports, and call-center agent actions are excluded by a schema whitelist.
|
|
10
|
+
|
|
11
|
+
Included examples:
|
|
12
|
+
|
|
13
|
+
- System settings
|
|
14
|
+
- Roles, employees, employee groups
|
|
15
|
+
- Service hours
|
|
16
|
+
- Channels
|
|
17
|
+
- Field definitions, form layouts, interaction rules
|
|
18
|
+
- User, ticket, and organization view configuration
|
|
19
|
+
- Satisfaction and welcome-message settings
|
|
20
|
+
- Voice flows, ticket workflows, inbound/session routing rules
|
|
21
|
+
- Queue policies
|
|
22
|
+
- Outbound task templates, manual outbound tasks, and automatic outbound tasks
|
|
23
|
+
- Learning courses and exams (admin configuration)
|
|
24
|
+
- Optional tenant, SIP trunk, and phone-number configuration endpoints when extensions are loaded
|
|
25
|
+
|
|
26
|
+
## Install For Development
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cd packages/deepflow-opendesk-cli
|
|
30
|
+
pip install -e ".[dev]"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Configure Host And Token
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
export OPENDESK_HOST="http://localhost:5001"
|
|
37
|
+
export OPENDESK_TOKEN="..."
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Or log in and save a local profile:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
deepflow_opendesk_cli auth login \
|
|
44
|
+
--tenant 12058577c8114513 \
|
|
45
|
+
--username test \
|
|
46
|
+
--save-token
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Profile files are stored under `~/.opendesk/cli/{profile}/` with owner-only permissions where supported.
|
|
50
|
+
|
|
51
|
+
## Common Commands
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
deepflow_opendesk_cli schema fetch
|
|
55
|
+
deepflow_opendesk_cli docs list --tag FieldDefinitions
|
|
56
|
+
deepflow_opendesk_cli docs show fields.create --json
|
|
57
|
+
deepflow_opendesk_cli docs schema FieldDefinitionCreate
|
|
58
|
+
|
|
59
|
+
deepflow_opendesk_cli request GET /api/v1/system/info
|
|
60
|
+
deepflow_opendesk_cli call fields.list --query domain=ticket
|
|
61
|
+
deepflow_opendesk_cli call fields.create --json-file field.json
|
|
62
|
+
|
|
63
|
+
deepflow_opendesk_cli system settings
|
|
64
|
+
deepflow_opendesk_cli roles permission-tree
|
|
65
|
+
deepflow_opendesk_cli employees list
|
|
66
|
+
deepflow_opendesk_cli channels list
|
|
67
|
+
deepflow_opendesk_cli call service_hours.list
|
|
68
|
+
deepflow_opendesk_cli call satisfaction.get
|
|
69
|
+
deepflow_opendesk_cli call welcome_rules.create --json-file welcome-rule.json
|
|
70
|
+
deepflow_opendesk_cli routing session list
|
|
71
|
+
deepflow_opendesk_cli queue policies
|
|
72
|
+
deepflow_opendesk_cli outbound-templates list
|
|
73
|
+
deepflow_opendesk_cli outbound-templates get-script 12
|
|
74
|
+
deepflow_opendesk_cli outbound-templates set-script 12 --json-file script.json
|
|
75
|
+
deepflow_opendesk_cli outbound-tasks list
|
|
76
|
+
deepflow_opendesk_cli auto-outbound-tasks list
|
|
77
|
+
deepflow_opendesk_cli call courses.list
|
|
78
|
+
deepflow_opendesk_cli call exams.list
|
|
79
|
+
```
|
|
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
|
+
|
|
122
|
+
## Outbound Tasks
|
|
123
|
+
|
|
124
|
+
The outbound commands use the API-key OpenAPI under
|
|
125
|
+
`/api/v1/open/engagement`. Set the tenant API key in `OPENDESK_TOKEN` or pass
|
|
126
|
+
the global `--token` option before the command.
|
|
127
|
+
|
|
128
|
+
Manual task examples:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
deepflow_opendesk_cli outbound-tasks create --json-file manual-task.json
|
|
132
|
+
deepflow_opendesk_cli outbound-tasks publish 18
|
|
133
|
+
deepflow_opendesk_cli outbound-tasks targets 18 --status pending
|
|
134
|
+
deepflow_opendesk_cli outbound-tasks add-target 18 \
|
|
135
|
+
--json '{"phone_number":"13800138000","field_values":{"name":"Alice"}}'
|
|
136
|
+
deepflow_opendesk_cli outbound-tasks add-targets 18 --json-file targets.json
|
|
137
|
+
deepflow_opendesk_cli outbound-tasks import-targets 18 targets.xlsx
|
|
138
|
+
deepflow_opendesk_cli outbound-tasks records 18
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Automatic task examples:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
deepflow_opendesk_cli auto-outbound-tasks create --json-file auto-task.json
|
|
145
|
+
deepflow_opendesk_cli auto-outbound-tasks start 27
|
|
146
|
+
deepflow_opendesk_cli auto-outbound-tasks monitor 27
|
|
147
|
+
deepflow_opendesk_cli auto-outbound-tasks add-targets 27 --json-file targets.json
|
|
148
|
+
deepflow_opendesk_cli auto-outbound-tasks import-targets 27 targets.csv
|
|
149
|
+
deepflow_opendesk_cli auto-outbound-tasks mark-target-invalid 81
|
|
150
|
+
deepflow_opendesk_cli auto-outbound-tasks delete 27 --yes
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`add-targets` accepts a JSON object containing 1–5000 targets:
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"targets": [
|
|
158
|
+
{
|
|
159
|
+
"phone_number": "13800138000",
|
|
160
|
+
"user_id": 123,
|
|
161
|
+
"field_values": {"name": "Alice", "customer_level": "VIP"}
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
`import-targets` keeps the existing Excel/CSV file import behavior. Use
|
|
168
|
+
`docs show outbound_tasks.create` or `docs show auto_outbound_tasks.create`
|
|
169
|
+
after `schema fetch` to inspect the current request fields.
|
|
170
|
+
|
|
171
|
+
Equivalent module invocation:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
python -m deepflow_opendesk_cli docs list
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Construct Request Bodies
|
|
178
|
+
|
|
179
|
+
`docs show <endpoint-key>` expands the request body schema into a field tree
|
|
180
|
+
(name, type, required, enum, description) and prints a generated example
|
|
181
|
+
payload, so an agent can construct a valid body without reading the OpenAPI
|
|
182
|
+
components by hand. `docs schema <SchemaName>` does the same for any component
|
|
183
|
+
schema in the fetched OpenAPI document.
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
deepflow_opendesk_cli docs show fields.create
|
|
187
|
+
deepflow_opendesk_cli docs schema WelcomeMessageRuleCreate --json
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Use the printed example as a starting point, edit values, then pass it with
|
|
191
|
+
`--json` / `--json-file`. Add `--dry-run` to validate the plan without sending
|
|
192
|
+
requests.
|
|
193
|
+
|
|
194
|
+
## AI Agent Flow
|
|
195
|
+
|
|
196
|
+
Recommended execution loop:
|
|
197
|
+
|
|
198
|
+
```text
|
|
199
|
+
1. schema fetch or docs list
|
|
200
|
+
2. docs show <endpoint-key> (and docs schema <SchemaName> for body details)
|
|
201
|
+
3. request/call --dry-run
|
|
202
|
+
4. present plan to a human
|
|
203
|
+
5. batch run / workflow run --yes
|
|
204
|
+
6. verify with config list/get commands
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Batch
|
|
208
|
+
|
|
209
|
+
`batch run` accepts JSONL. Each line is a config operation:
|
|
210
|
+
|
|
211
|
+
```jsonl
|
|
212
|
+
{"key":"auth.me"}
|
|
213
|
+
{"key":"fields.create","body":{"domain":"ticket","name":"Customer Tier","field_type":"select"}}
|
|
214
|
+
{"method":"PUT","path":"/api/v1/system-settings","body":{"default_language":"zh","default_timezone":"Asia/Shanghai"}}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Run:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
deepflow_opendesk_cli batch run ops.jsonl --dry-run
|
|
221
|
+
deepflow_opendesk_cli batch run ops.jsonl --continue-on-error --output results.jsonl
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Workflows
|
|
225
|
+
|
|
226
|
+
`workflow list` shows named configuration workflows. Running a workflow without
|
|
227
|
+
`--json-file` executes its built-in **read-only** plan, which snapshots the
|
|
228
|
+
relevant current configuration (safe to run anytime). Pass `--json-file` with a
|
|
229
|
+
batch-style operations array to run a custom write plan instead.
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
deepflow_opendesk_cli workflow list
|
|
233
|
+
deepflow_opendesk_cli workflow run setup-tenant --dry-run
|
|
234
|
+
deepflow_opendesk_cli workflow run setup-web-channel --json-file channel-plan.json --yes
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Development
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
cd packages/deepflow-opendesk-cli
|
|
241
|
+
PYTHONPATH=src python -m pytest tests -q
|
|
242
|
+
python -m build
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Distribution
|
|
246
|
+
|
|
247
|
+
Releases are automated. Pushing a `v*` git tag (e.g. `v0.1.1`) triggers
|
|
248
|
+
`.github/workflows/release.yml`, which runs the tests, builds the sdist + wheel,
|
|
249
|
+
publishes `deepflow-opendesk-cli` to PyPI, and cuts a GitHub Release.
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
pip install deepflow-opendesk-cli
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
To cut a patch release, run the helper script (bumps the version across
|
|
256
|
+
`pyproject.toml`, `setup.py`, and `__init__.py`, then tags and pushes):
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
bash .claude/skills/release-publish/scripts/release-tag.sh --dry-run
|
|
260
|
+
bash .claude/skills/release-publish/scripts/release-tag.sh
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
To build locally without publishing: `python -m build`.
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "deepflow-opendesk-cli"
|
|
7
|
-
version = "0.1.
|
|
8
|
-
description = "Command-line client for OpenDesk admin configuration APIs."
|
|
7
|
+
version = "0.1.4"
|
|
8
|
+
description = "Command-line client for OpenDesk admin configuration and outbound task APIs."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
11
11
|
authors = [{ name = "DeepFlow AI" }]
|
|
@@ -7,8 +7,8 @@ from setuptools import find_packages, setup
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name="deepflow-opendesk-cli",
|
|
10
|
-
version="0.1.
|
|
11
|
-
description="Command-line client for OpenDesk admin configuration APIs.",
|
|
10
|
+
version="0.1.4",
|
|
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",
|
|
14
14
|
python_requires=">=3.11",
|