das-cli 1.5.25__tar.gz → 1.5.71__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.
- {das_cli-1.5.25/das_cli.egg-info → das_cli-1.5.71}/PKG-INFO +107 -3
- {das_cli-1.5.25 → das_cli-1.5.71}/README.md +1376 -1272
- {das_cli-1.5.25 → das_cli-1.5.71}/das/authentication/auth.py +23 -5
- {das_cli-1.5.25 → das_cli-1.5.71}/das/cli.py +1702 -1643
- das_cli-1.5.71/das/common/api.py +177 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/common/config.py +188 -2
- {das_cli-1.5.25 → das_cli-1.5.71}/das/common/enums.py +14 -0
- das_cli-1.5.71/das/common/errors.py +93 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/managers/digital_objects_manager.py +12 -9
- {das_cli-1.5.25 → das_cli-1.5.71}/das/managers/entries_manager.py +78 -21
- {das_cli-1.5.25 → das_cli-1.5.71}/das/managers/search_manager.py +30 -6
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/attributes.py +4 -3
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/cache.py +4 -3
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/das_elastic_search.py +2 -5
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/digital_objects.py +3 -2
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/downloads.py +65 -67
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/entries.py +2 -9
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/entry_fields.py +2 -5
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/hangfire.py +2 -1
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/search.py +2 -4
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/users.py +2 -1
- {das_cli-1.5.25 → das_cli-1.5.71/das_cli.egg-info}/PKG-INFO +107 -3
- {das_cli-1.5.25 → das_cli-1.5.71}/das_cli.egg-info/SOURCES.txt +2 -10
- {das_cli-1.5.25 → das_cli-1.5.71}/pyproject.toml +1 -1
- das_cli-1.5.25/das/common/api.py +0 -120
- das_cli-1.5.25/tests/__init__.py +0 -3
- das_cli-1.5.25/tests/attributes_test.py +0 -77
- das_cli-1.5.25/tests/download_manager_test.py +0 -34
- das_cli-1.5.25/tests/entries_manager_test.py +0 -511
- das_cli-1.5.25/tests/entries_service_test.py +0 -270
- das_cli-1.5.25/tests/entries_test.py +0 -43
- das_cli-1.5.25/tests/file_utils_test.py +0 -115
- das_cli-1.5.25/tests/run_tests.py +0 -18
- das_cli-1.5.25/tests/search_manager_test.py +0 -74
- {das_cli-1.5.25 → das_cli-1.5.71}/LICENSE +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/MANIFEST.in +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/__init__.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/ai/plugins/dasai.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/ai/plugins/entries/entries_plugin.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/app.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/authentication/oauth.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/authentication/secure_input.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/common/entry_fields_constants.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/common/file_utils.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/managers/__init__.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/managers/download_manager.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das/services/service_base.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das_cli.egg-info/dependency_links.txt +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das_cli.egg-info/entry_points.txt +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das_cli.egg-info/requires.txt +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/das_cli.egg-info/top_level.txt +0 -0
- {das_cli-1.5.25 → das_cli-1.5.71}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: das-cli
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.71
|
|
4
4
|
Summary: DAS api client.
|
|
5
5
|
Author: Royal Netherlands Institute for Sea Research
|
|
6
6
|
License-Expression: MIT
|
|
@@ -117,20 +117,38 @@ das login --api-url https://your-das-instance/api --api-key <your-api-key>
|
|
|
117
117
|
# Configure once, then login
|
|
118
118
|
das oauth configure --client-id <id> --authority https://login.microsoftonline.com/<tenant-id>
|
|
119
119
|
das login --api-url https://your-das-instance/api --oauth
|
|
120
|
+
|
|
121
|
+
# Show current OAuth configuration and token status
|
|
122
|
+
das oauth status
|
|
123
|
+
|
|
124
|
+
# Remove OAuth configuration and stored tokens
|
|
125
|
+
das oauth clear
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
- Add `--debug` to `das login --oauth` to print the decoded token claims for troubleshooting.
|
|
129
|
+
|
|
130
|
+
**Verify the current session:**
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Show API URL, auth type, token, SSL status, and OAuth/OpenAI config
|
|
134
|
+
das config show
|
|
120
135
|
```
|
|
121
136
|
|
|
122
137
|
### Search
|
|
123
138
|
|
|
124
139
|
```bash
|
|
125
140
|
das search entries --attribute <AttributeName> --query '<SearchQuery>' \
|
|
126
|
-
--max-results 10 --page 1 --sort-
|
|
141
|
+
--max-results 10 --page 1 --sort-order asc --format table
|
|
127
142
|
```
|
|
128
143
|
|
|
129
144
|
Options:
|
|
130
145
|
|
|
131
146
|
- `--max-results <n>`: Maximum results per page (default: 10)
|
|
132
147
|
- `--page <num>`: Page number (default: 1)
|
|
133
|
-
- `--sort-by <field>`: Field to sort by
|
|
148
|
+
- `--sort-by <field>`: Field to sort by. Defaults to none, letting the server
|
|
149
|
+
decide the order. Not every attribute has a `Name` field (e.g. `Cruise`), so
|
|
150
|
+
passing a field that does not exist returns a clear error listing the valid
|
|
151
|
+
fields instead of failing.
|
|
134
152
|
- `--sort-order <order>`: `asc` or `desc` (default: asc)
|
|
135
153
|
- `--format <format>`: `table`, `json`, or `compact` (default: table)
|
|
136
154
|
- `--raw`: Print raw API response
|
|
@@ -237,6 +255,29 @@ das entry link-digital-objects --entry-code ENT001 -d DO003 --unlink
|
|
|
237
255
|
das entry chown --user alice --code ENT001 --code ENT002
|
|
238
256
|
```
|
|
239
257
|
|
|
258
|
+
#### Entry logs
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Get change/audit logs by entry ID
|
|
262
|
+
das entry logs --id d7b99f36-5ccb-11f0-87f3-a84a63c8db73
|
|
263
|
+
|
|
264
|
+
# By entry code, with pagination
|
|
265
|
+
das entry logs --code ENT001 --max-results 50 --skip 0
|
|
266
|
+
|
|
267
|
+
# JSON output
|
|
268
|
+
das entry logs --id d7b99f36-5ccb-11f0-87f3-a84a63c8db73 --format json
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Elastic Search
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# Search for an item by field and value
|
|
275
|
+
das elastic search-item --field identifier --value 10.1234/abcd --format table
|
|
276
|
+
|
|
277
|
+
# JSON or compact output
|
|
278
|
+
das elastic search-item --field identifier --value 10.1234/abcd --format json
|
|
279
|
+
```
|
|
280
|
+
|
|
240
281
|
### Hangfire
|
|
241
282
|
|
|
242
283
|
```bash
|
|
@@ -283,10 +324,42 @@ das config ssl-verify false
|
|
|
283
324
|
# Show current SSL verification status
|
|
284
325
|
das config ssl-status
|
|
285
326
|
|
|
327
|
+
# Set the diagnostic log level (TRACE, DEBUG, INFO, WARN, ERROR, FATAL)
|
|
328
|
+
das config log-level DEBUG
|
|
329
|
+
|
|
330
|
+
# Write logs to a file (in addition to the console)
|
|
331
|
+
das config log-file C:\logs\das.log
|
|
332
|
+
|
|
333
|
+
# Log to the console only again
|
|
334
|
+
das config log-file --clear
|
|
335
|
+
|
|
336
|
+
# Show all current persistent settings (API URL, auth type, token, SSL, logging, OAuth, OpenAI)
|
|
337
|
+
das config show
|
|
338
|
+
|
|
286
339
|
# Reset all configuration (clears credentials and settings)
|
|
287
340
|
das config reset --force
|
|
288
341
|
```
|
|
289
342
|
|
|
343
|
+
#### Logging
|
|
344
|
+
|
|
345
|
+
The CLI logs diagnostic information (HTTP requests and error details) through the
|
|
346
|
+
`das` logger. Control how much is shown and where it goes:
|
|
347
|
+
|
|
348
|
+
- **Level** — from most to least verbose: `TRACE`, `DEBUG`, `INFO`, `WARN`
|
|
349
|
+
(default), `ERROR`, `FATAL`. Set with `das config log-level <LEVEL>` or the
|
|
350
|
+
`DAS_LOG_LEVEL` environment variable.
|
|
351
|
+
- **Destination** — by default logs go to the console only. Point them at a file
|
|
352
|
+
with `das config log-file <path>` (parent folders are created automatically)
|
|
353
|
+
or the `DAS_LOG_FILE` environment variable. The file log includes timestamps
|
|
354
|
+
and logger names; the console stays terse.
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
# Verbose troubleshooting session written to a file
|
|
358
|
+
das config log-level DEBUG
|
|
359
|
+
das config log-file C:\logs\das.log
|
|
360
|
+
das search entries --attribute Cruise --query "cruisecode(*64PE*)"
|
|
361
|
+
```
|
|
362
|
+
|
|
290
363
|
### AI
|
|
291
364
|
|
|
292
365
|
```bash
|
|
@@ -1102,6 +1175,14 @@ DAS_API_KEY=
|
|
|
1102
1175
|
# Enable or disable SSL certificate verification (True/False). Overrides `das config ssl-verify`.
|
|
1103
1176
|
VERIFY_SSL=True
|
|
1104
1177
|
|
|
1178
|
+
# ── Logging ────────────────────────────────────────────────────────────────────
|
|
1179
|
+
|
|
1180
|
+
# Diagnostic log level: TRACE, DEBUG, INFO, WARN, ERROR, FATAL. Overrides `das config log-level`.
|
|
1181
|
+
DAS_LOG_LEVEL=WARN
|
|
1182
|
+
|
|
1183
|
+
# Optional path to write logs to a file. Overrides `das config log-file`.
|
|
1184
|
+
DAS_LOG_FILE=
|
|
1185
|
+
|
|
1105
1186
|
# ── Test / script credentials (basic auth) ─────────────────────────────────────
|
|
1106
1187
|
|
|
1107
1188
|
# Used by tests and scripts when authenticating with username/password.
|
|
@@ -1129,6 +1210,8 @@ TWINE_PASSWORD=
|
|
|
1129
1210
|
| `DAS_API_URL` | Library, CLI | DAS API base URL. Takes priority over the URL stored via `das login`. Example: `https://api.das-dev.nioz.nl`. |
|
|
1130
1211
|
| `DAS_API_KEY` | Library, CLI | DAS API key for authentication. Takes priority over any key stored via `das login --api-key`. Generate in the DAS web UI under **My Settings → API Keys**. Sent as `X-Api-Key` header on every request. |
|
|
1131
1212
|
| `VERIFY_SSL` | Library, CLI | `True` or `False`. Overrides the value set by `das config ssl-verify`. |
|
|
1213
|
+
| `DAS_LOG_LEVEL` | Library, CLI | Diagnostic log level: `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`. Overrides `das config log-level`. |
|
|
1214
|
+
| `DAS_LOG_FILE` | Library, CLI | Path to write logs to (in addition to the console). Overrides `das config log-file`. |
|
|
1132
1215
|
| `API_URL` | Tests | DAS API base URL used by the test suite. Equivalent to `DAS_API_URL` but only read by tests. |
|
|
1133
1216
|
| `USER_NAME` | Tests | DAS username for test authentication. Never commit to version control. |
|
|
1134
1217
|
| `USER_PASSWORD` | Tests | DAS password for test authentication. Never commit to version control. |
|
|
@@ -1200,6 +1283,12 @@ das download files 6b0e68e6-00cd-43a7-9c51-d56c9c091123 --out C:\Downloads
|
|
|
1200
1283
|
|
|
1201
1284
|
# Save to an explicit filename, overwriting if it exists
|
|
1202
1285
|
das download files 6b0e68e6-00cd-43a7-9c51-d56c9c091123 --out C:\Downloads\bundle.zip --force
|
|
1286
|
+
|
|
1287
|
+
# Download a single digital object by code
|
|
1288
|
+
das download digital-object --digital-object-code DO001 --out C:\Downloads\
|
|
1289
|
+
|
|
1290
|
+
# Download a single digital object by ID to an explicit file path
|
|
1291
|
+
das download digital-object --digital-object-id cf335b17-80e3-4151-aa80-40b69fe0567e --out C:\Downloads\file.bin
|
|
1203
1292
|
```
|
|
1204
1293
|
|
|
1205
1294
|
## Examples
|
|
@@ -1227,9 +1316,24 @@ das config reset --force
|
|
|
1227
1316
|
- Authentication failed:
|
|
1228
1317
|
- Ensure `--api-url` points to the correct DAS instance base URL (often ends with `/api`).
|
|
1229
1318
|
- Try re-running `das login` without passing password to be prompted.
|
|
1319
|
+
- The CLI now reports the actual cause — a wrong password shows the API's
|
|
1320
|
+
message, while an untrusted certificate or unreachable host is reported
|
|
1321
|
+
distinctly (see below).
|
|
1230
1322
|
- SSL certificate errors:
|
|
1323
|
+
- If the host uses a self-signed or otherwise untrusted certificate, the CLI
|
|
1324
|
+
says so explicitly and suggests the fix rather than reporting a generic
|
|
1325
|
+
"authentication failed".
|
|
1231
1326
|
- Use `das config ssl-verify false` temporarily in non-production environments.
|
|
1232
1327
|
- Consider configuring your corporate CA store instead of disabling verification.
|
|
1328
|
+
- Getting more detail on an error:
|
|
1329
|
+
- Error messages include the HTTP status and the message returned by the API
|
|
1330
|
+
(e.g. `HTTP 400: <reason>`) instead of a raw stack trace.
|
|
1331
|
+
- Run with a more verbose log level for full request diagnostics:
|
|
1332
|
+
`das config log-level DEBUG`, optionally with `das config log-file <path>`.
|
|
1333
|
+
- Search errors:
|
|
1334
|
+
- Sorting by a field that does not exist for the chosen attribute returns a
|
|
1335
|
+
clear error listing the available fields. Omit `--sort-by` to let the server
|
|
1336
|
+
choose the order (the default).
|
|
1233
1337
|
- Proxy/network issues:
|
|
1234
1338
|
- Respect environment variables `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` if required.
|
|
1235
1339
|
- Windows PowerShell quoting:
|