das-cli 1.5.25__tar.gz → 1.5.27__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.27}/PKG-INFO +48 -1
- {das_cli-1.5.25 → das_cli-1.5.27}/README.md +47 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/managers/digital_objects_manager.py +12 -9
- {das_cli-1.5.25 → das_cli-1.5.27/das_cli.egg-info}/PKG-INFO +48 -1
- {das_cli-1.5.25 → das_cli-1.5.27}/pyproject.toml +1 -1
- {das_cli-1.5.25 → das_cli-1.5.27}/LICENSE +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/MANIFEST.in +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/__init__.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/ai/plugins/dasai.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/ai/plugins/entries/entries_plugin.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/app.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/authentication/auth.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/authentication/oauth.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/authentication/secure_input.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/cli.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/common/api.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/common/config.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/common/entry_fields_constants.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/common/enums.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/common/file_utils.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/managers/__init__.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/managers/download_manager.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/managers/entries_manager.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/managers/search_manager.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/attributes.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/cache.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/das_elastic_search.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/digital_objects.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/downloads.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/entries.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/entry_fields.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/hangfire.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/search.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/service_base.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das/services/users.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das_cli.egg-info/SOURCES.txt +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das_cli.egg-info/dependency_links.txt +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das_cli.egg-info/entry_points.txt +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das_cli.egg-info/requires.txt +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/das_cli.egg-info/top_level.txt +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/setup.cfg +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/tests/__init__.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/tests/attributes_test.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/tests/download_manager_test.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/tests/entries_manager_test.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/tests/entries_service_test.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/tests/entries_test.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/tests/file_utils_test.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/tests/run_tests.py +0 -0
- {das_cli-1.5.25 → das_cli-1.5.27}/tests/search_manager_test.py +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.27
|
|
4
4
|
Summary: DAS api client.
|
|
5
5
|
Author: Royal Netherlands Institute for Sea Research
|
|
6
6
|
License-Expression: MIT
|
|
@@ -117,6 +117,21 @@ 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
|
|
@@ -237,6 +252,29 @@ das entry link-digital-objects --entry-code ENT001 -d DO003 --unlink
|
|
|
237
252
|
das entry chown --user alice --code ENT001 --code ENT002
|
|
238
253
|
```
|
|
239
254
|
|
|
255
|
+
#### Entry logs
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
# Get change/audit logs by entry ID
|
|
259
|
+
das entry logs --id d7b99f36-5ccb-11f0-87f3-a84a63c8db73
|
|
260
|
+
|
|
261
|
+
# By entry code, with pagination
|
|
262
|
+
das entry logs --code ENT001 --max-results 50 --skip 0
|
|
263
|
+
|
|
264
|
+
# JSON output
|
|
265
|
+
das entry logs --id d7b99f36-5ccb-11f0-87f3-a84a63c8db73 --format json
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Elastic Search
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Search for an item by field and value
|
|
272
|
+
das elastic search-item --field identifier --value 10.1234/abcd --format table
|
|
273
|
+
|
|
274
|
+
# JSON or compact output
|
|
275
|
+
das elastic search-item --field identifier --value 10.1234/abcd --format json
|
|
276
|
+
```
|
|
277
|
+
|
|
240
278
|
### Hangfire
|
|
241
279
|
|
|
242
280
|
```bash
|
|
@@ -283,6 +321,9 @@ das config ssl-verify false
|
|
|
283
321
|
# Show current SSL verification status
|
|
284
322
|
das config ssl-status
|
|
285
323
|
|
|
324
|
+
# Show all current persistent settings (API URL, auth type, token, SSL, OAuth, OpenAI)
|
|
325
|
+
das config show
|
|
326
|
+
|
|
286
327
|
# Reset all configuration (clears credentials and settings)
|
|
287
328
|
das config reset --force
|
|
288
329
|
```
|
|
@@ -1200,6 +1241,12 @@ das download files 6b0e68e6-00cd-43a7-9c51-d56c9c091123 --out C:\Downloads
|
|
|
1200
1241
|
|
|
1201
1242
|
# Save to an explicit filename, overwriting if it exists
|
|
1202
1243
|
das download files 6b0e68e6-00cd-43a7-9c51-d56c9c091123 --out C:\Downloads\bundle.zip --force
|
|
1244
|
+
|
|
1245
|
+
# Download a single digital object by code
|
|
1246
|
+
das download digital-object --digital-object-code DO001 --out C:\Downloads\
|
|
1247
|
+
|
|
1248
|
+
# Download a single digital object by ID to an explicit file path
|
|
1249
|
+
das download digital-object --digital-object-id cf335b17-80e3-4151-aa80-40b69fe0567e --out C:\Downloads\file.bin
|
|
1203
1250
|
```
|
|
1204
1251
|
|
|
1205
1252
|
## Examples
|
|
@@ -94,6 +94,21 @@ das login --api-url https://your-das-instance/api --api-key <your-api-key>
|
|
|
94
94
|
# Configure once, then login
|
|
95
95
|
das oauth configure --client-id <id> --authority https://login.microsoftonline.com/<tenant-id>
|
|
96
96
|
das login --api-url https://your-das-instance/api --oauth
|
|
97
|
+
|
|
98
|
+
# Show current OAuth configuration and token status
|
|
99
|
+
das oauth status
|
|
100
|
+
|
|
101
|
+
# Remove OAuth configuration and stored tokens
|
|
102
|
+
das oauth clear
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- Add `--debug` to `das login --oauth` to print the decoded token claims for troubleshooting.
|
|
106
|
+
|
|
107
|
+
**Verify the current session:**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Show API URL, auth type, token, SSL status, and OAuth/OpenAI config
|
|
111
|
+
das config show
|
|
97
112
|
```
|
|
98
113
|
|
|
99
114
|
### Search
|
|
@@ -214,6 +229,29 @@ das entry link-digital-objects --entry-code ENT001 -d DO003 --unlink
|
|
|
214
229
|
das entry chown --user alice --code ENT001 --code ENT002
|
|
215
230
|
```
|
|
216
231
|
|
|
232
|
+
#### Entry logs
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Get change/audit logs by entry ID
|
|
236
|
+
das entry logs --id d7b99f36-5ccb-11f0-87f3-a84a63c8db73
|
|
237
|
+
|
|
238
|
+
# By entry code, with pagination
|
|
239
|
+
das entry logs --code ENT001 --max-results 50 --skip 0
|
|
240
|
+
|
|
241
|
+
# JSON output
|
|
242
|
+
das entry logs --id d7b99f36-5ccb-11f0-87f3-a84a63c8db73 --format json
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Elastic Search
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# Search for an item by field and value
|
|
249
|
+
das elastic search-item --field identifier --value 10.1234/abcd --format table
|
|
250
|
+
|
|
251
|
+
# JSON or compact output
|
|
252
|
+
das elastic search-item --field identifier --value 10.1234/abcd --format json
|
|
253
|
+
```
|
|
254
|
+
|
|
217
255
|
### Hangfire
|
|
218
256
|
|
|
219
257
|
```bash
|
|
@@ -260,6 +298,9 @@ das config ssl-verify false
|
|
|
260
298
|
# Show current SSL verification status
|
|
261
299
|
das config ssl-status
|
|
262
300
|
|
|
301
|
+
# Show all current persistent settings (API URL, auth type, token, SSL, OAuth, OpenAI)
|
|
302
|
+
das config show
|
|
303
|
+
|
|
263
304
|
# Reset all configuration (clears credentials and settings)
|
|
264
305
|
das config reset --force
|
|
265
306
|
```
|
|
@@ -1177,6 +1218,12 @@ das download files 6b0e68e6-00cd-43a7-9c51-d56c9c091123 --out C:\Downloads
|
|
|
1177
1218
|
|
|
1178
1219
|
# Save to an explicit filename, overwriting if it exists
|
|
1179
1220
|
das download files 6b0e68e6-00cd-43a7-9c51-d56c9c091123 --out C:\Downloads\bundle.zip --force
|
|
1221
|
+
|
|
1222
|
+
# Download a single digital object by code
|
|
1223
|
+
das download digital-object --digital-object-code DO001 --out C:\Downloads\
|
|
1224
|
+
|
|
1225
|
+
# Download a single digital object by ID to an explicit file path
|
|
1226
|
+
das download digital-object --digital-object-id cf335b17-80e3-4151-aa80-40b69fe0567e --out C:\Downloads\file.bin
|
|
1180
1227
|
```
|
|
1181
1228
|
|
|
1182
1229
|
## Examples
|
|
@@ -64,7 +64,9 @@ class DigitalObjectsManager:
|
|
|
64
64
|
|
|
65
65
|
return response.get("items", [])[0].get("entry").get("id")
|
|
66
66
|
|
|
67
|
-
def _resolve_digital_object_code(self, upload_result: dict) -> str:
|
|
67
|
+
def _resolve_digital_object_code(self, upload_result: dict, retries: int = 10, delay: float = 2.0) -> str:
|
|
68
|
+
import time
|
|
69
|
+
|
|
68
70
|
code = upload_result.get("code")
|
|
69
71
|
if code:
|
|
70
72
|
return code
|
|
@@ -73,15 +75,16 @@ class DigitalObjectsManager:
|
|
|
73
75
|
if not object_id:
|
|
74
76
|
raise ValueError("Upload result is missing digital object id and code")
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
for attempt in range(retries):
|
|
79
|
+
entry_response = self.entry_service.get(id=object_id)
|
|
80
|
+
if entry_response is not None:
|
|
81
|
+
code = (entry_response.get("entry") or {}).get("code")
|
|
82
|
+
if code:
|
|
83
|
+
return code
|
|
84
|
+
if attempt < retries - 1:
|
|
85
|
+
time.sleep(delay)
|
|
83
86
|
|
|
84
|
-
|
|
87
|
+
raise ValueError(f"Digital object with id '{object_id}' has no code after {retries} attempts")
|
|
85
88
|
|
|
86
89
|
def upload_file(
|
|
87
90
|
self, file_description: str, digital_object_type: str, file_path: str
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: das-cli
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.27
|
|
4
4
|
Summary: DAS api client.
|
|
5
5
|
Author: Royal Netherlands Institute for Sea Research
|
|
6
6
|
License-Expression: MIT
|
|
@@ -117,6 +117,21 @@ 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
|
|
@@ -237,6 +252,29 @@ das entry link-digital-objects --entry-code ENT001 -d DO003 --unlink
|
|
|
237
252
|
das entry chown --user alice --code ENT001 --code ENT002
|
|
238
253
|
```
|
|
239
254
|
|
|
255
|
+
#### Entry logs
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
# Get change/audit logs by entry ID
|
|
259
|
+
das entry logs --id d7b99f36-5ccb-11f0-87f3-a84a63c8db73
|
|
260
|
+
|
|
261
|
+
# By entry code, with pagination
|
|
262
|
+
das entry logs --code ENT001 --max-results 50 --skip 0
|
|
263
|
+
|
|
264
|
+
# JSON output
|
|
265
|
+
das entry logs --id d7b99f36-5ccb-11f0-87f3-a84a63c8db73 --format json
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Elastic Search
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Search for an item by field and value
|
|
272
|
+
das elastic search-item --field identifier --value 10.1234/abcd --format table
|
|
273
|
+
|
|
274
|
+
# JSON or compact output
|
|
275
|
+
das elastic search-item --field identifier --value 10.1234/abcd --format json
|
|
276
|
+
```
|
|
277
|
+
|
|
240
278
|
### Hangfire
|
|
241
279
|
|
|
242
280
|
```bash
|
|
@@ -283,6 +321,9 @@ das config ssl-verify false
|
|
|
283
321
|
# Show current SSL verification status
|
|
284
322
|
das config ssl-status
|
|
285
323
|
|
|
324
|
+
# Show all current persistent settings (API URL, auth type, token, SSL, OAuth, OpenAI)
|
|
325
|
+
das config show
|
|
326
|
+
|
|
286
327
|
# Reset all configuration (clears credentials and settings)
|
|
287
328
|
das config reset --force
|
|
288
329
|
```
|
|
@@ -1200,6 +1241,12 @@ das download files 6b0e68e6-00cd-43a7-9c51-d56c9c091123 --out C:\Downloads
|
|
|
1200
1241
|
|
|
1201
1242
|
# Save to an explicit filename, overwriting if it exists
|
|
1202
1243
|
das download files 6b0e68e6-00cd-43a7-9c51-d56c9c091123 --out C:\Downloads\bundle.zip --force
|
|
1244
|
+
|
|
1245
|
+
# Download a single digital object by code
|
|
1246
|
+
das download digital-object --digital-object-code DO001 --out C:\Downloads\
|
|
1247
|
+
|
|
1248
|
+
# Download a single digital object by ID to an explicit file path
|
|
1249
|
+
das download digital-object --digital-object-id cf335b17-80e3-4151-aa80-40b69fe0567e --out C:\Downloads\file.bin
|
|
1203
1250
|
```
|
|
1204
1251
|
|
|
1205
1252
|
## Examples
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|