deepflow-opendesk-cli 0.1.2__tar.gz → 0.1.3__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 (28) hide show
  1. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/PKG-INFO +94 -6
  2. deepflow_opendesk_cli-0.1.3/README.md +222 -0
  3. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/pyproject.toml +2 -2
  4. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/setup.py +2 -2
  5. deepflow_opendesk_cli-0.1.3/src/deepflow_opendesk_cli/__init__.py +3 -0
  6. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli/cli.py +348 -20
  7. deepflow_opendesk_cli-0.1.3/src/deepflow_opendesk_cli/schema.py +641 -0
  8. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli/workflows.py +27 -2
  9. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli.egg-info/PKG-INFO +94 -6
  10. deepflow_opendesk_cli-0.1.3/tests/test_cli.py +344 -0
  11. deepflow_opendesk_cli-0.1.3/tests/test_schema.py +450 -0
  12. deepflow_opendesk_cli-0.1.2/README.md +0 -134
  13. deepflow_opendesk_cli-0.1.2/src/deepflow_opendesk_cli/__init__.py +0 -3
  14. deepflow_opendesk_cli-0.1.2/src/deepflow_opendesk_cli/schema.py +0 -393
  15. deepflow_opendesk_cli-0.1.2/tests/test_cli.py +0 -154
  16. deepflow_opendesk_cli-0.1.2/tests/test_schema.py +0 -154
  17. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/setup.cfg +0 -0
  18. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli/__main__.py +0 -0
  19. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli/batch.py +0 -0
  20. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli/client.py +0 -0
  21. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli/profiles.py +0 -0
  22. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli.egg-info/SOURCES.txt +0 -0
  23. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli.egg-info/dependency_links.txt +0 -0
  24. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli.egg-info/entry_points.txt +0 -0
  25. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli.egg-info/requires.txt +0 -0
  26. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/src/deepflow_opendesk_cli.egg-info/top_level.txt +0 -0
  27. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/tests/test_client.py +0 -0
  28. {deepflow_opendesk_cli-0.1.2 → deepflow_opendesk_cli-0.1.3}/tests/test_profiles.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepflow-opendesk-cli
3
- Version: 0.1.2
4
- Summary: Command-line client for OpenDesk admin configuration APIs.
3
+ Version: 0.1.3
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
7
7
  Keywords: deepflow,opendesk,cli,openapi,admin,configuration
@@ -22,13 +22,13 @@ Dynamic: requires-python
22
22
 
23
23
  # deepflow-opendesk-cli
24
24
 
25
- Python command-line client for OpenDesk admin configuration APIs.
25
+ Python command-line client for OpenDesk admin configuration and outbound task APIs.
26
26
 
27
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
28
 
29
29
  ## Scope
30
30
 
31
- This package intentionally exposes only admin configuration APIs. Runtime workspace data, public visitor APIs, reports, and call-center agent actions are excluded by a schema whitelist.
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
32
 
33
33
  Included examples:
34
34
 
@@ -41,7 +41,8 @@ Included examples:
41
41
  - Satisfaction and welcome-message settings
42
42
  - Voice flows, ticket workflows, inbound/session routing rules
43
43
  - Queue policies
44
- - Outbound task templates and outbound scripts
44
+ - Outbound task templates, manual outbound tasks, and automatic outbound tasks
45
+ - Learning courses and exams (admin configuration)
45
46
  - Optional tenant, SIP trunk, and phone-number configuration endpoints when extensions are loaded
46
47
 
47
48
  ## Install For Development
@@ -75,6 +76,7 @@ Profile files are stored under `~/.opendesk/cli/{profile}/` with owner-only perm
75
76
  deepflow_opendesk_cli schema fetch
76
77
  deepflow_opendesk_cli docs list --tag FieldDefinitions
77
78
  deepflow_opendesk_cli docs show fields.create --json
79
+ deepflow_opendesk_cli docs schema FieldDefinitionCreate
78
80
 
79
81
  deepflow_opendesk_cli request GET /api/v1/system/info
80
82
  deepflow_opendesk_cli call fields.list --query domain=ticket
@@ -84,26 +86,99 @@ deepflow_opendesk_cli system settings
84
86
  deepflow_opendesk_cli roles permission-tree
85
87
  deepflow_opendesk_cli employees list
86
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
87
92
  deepflow_opendesk_cli routing session list
88
93
  deepflow_opendesk_cli queue policies
89
94
  deepflow_opendesk_cli outbound-templates list
90
95
  deepflow_opendesk_cli outbound-templates get-script 12
91
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
92
101
  ```
93
102
 
103
+ ## Outbound Tasks
104
+
105
+ The outbound commands use the API-key OpenAPI under
106
+ `/api/v1/open/engagement`. Set the tenant API key in `OPENDESK_TOKEN` or pass
107
+ the global `--token` option before the command.
108
+
109
+ Manual task examples:
110
+
111
+ ```bash
112
+ deepflow_opendesk_cli outbound-tasks create --json-file manual-task.json
113
+ deepflow_opendesk_cli outbound-tasks publish 18
114
+ deepflow_opendesk_cli outbound-tasks targets 18 --status pending
115
+ deepflow_opendesk_cli outbound-tasks add-target 18 \
116
+ --json '{"phone_number":"13800138000","field_values":{"name":"Alice"}}'
117
+ deepflow_opendesk_cli outbound-tasks add-targets 18 --json-file targets.json
118
+ deepflow_opendesk_cli outbound-tasks import-targets 18 targets.xlsx
119
+ deepflow_opendesk_cli outbound-tasks records 18
120
+ ```
121
+
122
+ Automatic task examples:
123
+
124
+ ```bash
125
+ deepflow_opendesk_cli auto-outbound-tasks create --json-file auto-task.json
126
+ deepflow_opendesk_cli auto-outbound-tasks start 27
127
+ deepflow_opendesk_cli auto-outbound-tasks monitor 27
128
+ deepflow_opendesk_cli auto-outbound-tasks add-targets 27 --json-file targets.json
129
+ deepflow_opendesk_cli auto-outbound-tasks import-targets 27 targets.csv
130
+ deepflow_opendesk_cli auto-outbound-tasks mark-target-invalid 81
131
+ deepflow_opendesk_cli auto-outbound-tasks delete 27 --yes
132
+ ```
133
+
134
+ `add-targets` accepts a JSON object containing 1–5000 targets:
135
+
136
+ ```json
137
+ {
138
+ "targets": [
139
+ {
140
+ "phone_number": "13800138000",
141
+ "user_id": 123,
142
+ "field_values": {"name": "Alice", "customer_level": "VIP"}
143
+ }
144
+ ]
145
+ }
146
+ ```
147
+
148
+ `import-targets` keeps the existing Excel/CSV file import behavior. Use
149
+ `docs show outbound_tasks.create` or `docs show auto_outbound_tasks.create`
150
+ after `schema fetch` to inspect the current request fields.
151
+
94
152
  Equivalent module invocation:
95
153
 
96
154
  ```bash
97
155
  python -m deepflow_opendesk_cli docs list
98
156
  ```
99
157
 
158
+ ## Construct Request Bodies
159
+
160
+ `docs show <endpoint-key>` expands the request body schema into a field tree
161
+ (name, type, required, enum, description) and prints a generated example
162
+ payload, so an agent can construct a valid body without reading the OpenAPI
163
+ components by hand. `docs schema <SchemaName>` does the same for any component
164
+ schema in the fetched OpenAPI document.
165
+
166
+ ```bash
167
+ deepflow_opendesk_cli docs show fields.create
168
+ deepflow_opendesk_cli docs schema WelcomeMessageRuleCreate --json
169
+ ```
170
+
171
+ Use the printed example as a starting point, edit values, then pass it with
172
+ `--json` / `--json-file`. Add `--dry-run` to validate the plan without sending
173
+ requests.
174
+
100
175
  ## AI Agent Flow
101
176
 
102
177
  Recommended execution loop:
103
178
 
104
179
  ```text
105
180
  1. schema fetch or docs list
106
- 2. docs show <endpoint-key>
181
+ 2. docs show <endpoint-key> (and docs schema <SchemaName> for body details)
107
182
  3. request/call --dry-run
108
183
  4. present plan to a human
109
184
  5. batch run / workflow run --yes
@@ -127,6 +202,19 @@ deepflow_opendesk_cli batch run ops.jsonl --dry-run
127
202
  deepflow_opendesk_cli batch run ops.jsonl --continue-on-error --output results.jsonl
128
203
  ```
129
204
 
205
+ ## Workflows
206
+
207
+ `workflow list` shows named configuration workflows. Running a workflow without
208
+ `--json-file` executes its built-in **read-only** plan, which snapshots the
209
+ relevant current configuration (safe to run anytime). Pass `--json-file` with a
210
+ batch-style operations array to run a custom write plan instead.
211
+
212
+ ```bash
213
+ deepflow_opendesk_cli workflow list
214
+ deepflow_opendesk_cli workflow run setup-tenant --dry-run
215
+ deepflow_opendesk_cli workflow run setup-web-channel --json-file channel-plan.json --yes
216
+ ```
217
+
130
218
  ## Development
131
219
 
132
220
  ```bash
@@ -0,0 +1,222 @@
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
+ ## Outbound Tasks
82
+
83
+ The outbound commands use the API-key OpenAPI under
84
+ `/api/v1/open/engagement`. Set the tenant API key in `OPENDESK_TOKEN` or pass
85
+ the global `--token` option before the command.
86
+
87
+ Manual task examples:
88
+
89
+ ```bash
90
+ deepflow_opendesk_cli outbound-tasks create --json-file manual-task.json
91
+ deepflow_opendesk_cli outbound-tasks publish 18
92
+ deepflow_opendesk_cli outbound-tasks targets 18 --status pending
93
+ deepflow_opendesk_cli outbound-tasks add-target 18 \
94
+ --json '{"phone_number":"13800138000","field_values":{"name":"Alice"}}'
95
+ deepflow_opendesk_cli outbound-tasks add-targets 18 --json-file targets.json
96
+ deepflow_opendesk_cli outbound-tasks import-targets 18 targets.xlsx
97
+ deepflow_opendesk_cli outbound-tasks records 18
98
+ ```
99
+
100
+ Automatic task examples:
101
+
102
+ ```bash
103
+ deepflow_opendesk_cli auto-outbound-tasks create --json-file auto-task.json
104
+ deepflow_opendesk_cli auto-outbound-tasks start 27
105
+ deepflow_opendesk_cli auto-outbound-tasks monitor 27
106
+ deepflow_opendesk_cli auto-outbound-tasks add-targets 27 --json-file targets.json
107
+ deepflow_opendesk_cli auto-outbound-tasks import-targets 27 targets.csv
108
+ deepflow_opendesk_cli auto-outbound-tasks mark-target-invalid 81
109
+ deepflow_opendesk_cli auto-outbound-tasks delete 27 --yes
110
+ ```
111
+
112
+ `add-targets` accepts a JSON object containing 1–5000 targets:
113
+
114
+ ```json
115
+ {
116
+ "targets": [
117
+ {
118
+ "phone_number": "13800138000",
119
+ "user_id": 123,
120
+ "field_values": {"name": "Alice", "customer_level": "VIP"}
121
+ }
122
+ ]
123
+ }
124
+ ```
125
+
126
+ `import-targets` keeps the existing Excel/CSV file import behavior. Use
127
+ `docs show outbound_tasks.create` or `docs show auto_outbound_tasks.create`
128
+ after `schema fetch` to inspect the current request fields.
129
+
130
+ Equivalent module invocation:
131
+
132
+ ```bash
133
+ python -m deepflow_opendesk_cli docs list
134
+ ```
135
+
136
+ ## Construct Request Bodies
137
+
138
+ `docs show <endpoint-key>` expands the request body schema into a field tree
139
+ (name, type, required, enum, description) and prints a generated example
140
+ payload, so an agent can construct a valid body without reading the OpenAPI
141
+ components by hand. `docs schema <SchemaName>` does the same for any component
142
+ schema in the fetched OpenAPI document.
143
+
144
+ ```bash
145
+ deepflow_opendesk_cli docs show fields.create
146
+ deepflow_opendesk_cli docs schema WelcomeMessageRuleCreate --json
147
+ ```
148
+
149
+ Use the printed example as a starting point, edit values, then pass it with
150
+ `--json` / `--json-file`. Add `--dry-run` to validate the plan without sending
151
+ requests.
152
+
153
+ ## AI Agent Flow
154
+
155
+ Recommended execution loop:
156
+
157
+ ```text
158
+ 1. schema fetch or docs list
159
+ 2. docs show <endpoint-key> (and docs schema <SchemaName> for body details)
160
+ 3. request/call --dry-run
161
+ 4. present plan to a human
162
+ 5. batch run / workflow run --yes
163
+ 6. verify with config list/get commands
164
+ ```
165
+
166
+ ## Batch
167
+
168
+ `batch run` accepts JSONL. Each line is a config operation:
169
+
170
+ ```jsonl
171
+ {"key":"auth.me"}
172
+ {"key":"fields.create","body":{"domain":"ticket","name":"Customer Tier","field_type":"select"}}
173
+ {"method":"PUT","path":"/api/v1/system-settings","body":{"default_language":"zh","default_timezone":"Asia/Shanghai"}}
174
+ ```
175
+
176
+ Run:
177
+
178
+ ```bash
179
+ deepflow_opendesk_cli batch run ops.jsonl --dry-run
180
+ deepflow_opendesk_cli batch run ops.jsonl --continue-on-error --output results.jsonl
181
+ ```
182
+
183
+ ## Workflows
184
+
185
+ `workflow list` shows named configuration workflows. Running a workflow without
186
+ `--json-file` executes its built-in **read-only** plan, which snapshots the
187
+ relevant current configuration (safe to run anytime). Pass `--json-file` with a
188
+ batch-style operations array to run a custom write plan instead.
189
+
190
+ ```bash
191
+ deepflow_opendesk_cli workflow list
192
+ deepflow_opendesk_cli workflow run setup-tenant --dry-run
193
+ deepflow_opendesk_cli workflow run setup-web-channel --json-file channel-plan.json --yes
194
+ ```
195
+
196
+ ## Development
197
+
198
+ ```bash
199
+ cd packages/deepflow-opendesk-cli
200
+ PYTHONPATH=src python -m pytest tests -q
201
+ python -m build
202
+ ```
203
+
204
+ ## Distribution
205
+
206
+ Releases are automated. Pushing a `v*` git tag (e.g. `v0.1.1`) triggers
207
+ `.github/workflows/release.yml`, which runs the tests, builds the sdist + wheel,
208
+ publishes `deepflow-opendesk-cli` to PyPI, and cuts a GitHub Release.
209
+
210
+ ```bash
211
+ pip install deepflow-opendesk-cli
212
+ ```
213
+
214
+ To cut a patch release, run the helper script (bumps the version across
215
+ `pyproject.toml`, `setup.py`, and `__init__.py`, then tags and pushes):
216
+
217
+ ```bash
218
+ bash .claude/skills/release-publish/scripts/release-tag.sh --dry-run
219
+ bash .claude/skills/release-publish/scripts/release-tag.sh
220
+ ```
221
+
222
+ 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.2"
8
- description = "Command-line client for OpenDesk admin configuration APIs."
7
+ version = "0.1.3"
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.2",
11
- description="Command-line client for OpenDesk admin configuration APIs.",
10
+ version="0.1.3",
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",
@@ -0,0 +1,3 @@
1
+ """OpenDesk admin configuration and outbound task API CLI."""
2
+
3
+ __version__ = "0.1.3"