dnastack-client-library 3.1.179__py3-none-any.whl → 3.1.205__py3-none-any.whl
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.
- dnastack/alpha/app/explorer.py +1 -1
- dnastack/alpha/app/workbench.py +4 -4
- dnastack/alpha/cli/wes.py +3 -3
- dnastack/alpha/client/collections/client.py +2 -3
- dnastack/alpha/client/wes/client.py +5 -8
- dnastack/cli/commands/collections/commands.py +3 -4
- dnastack/cli/commands/collections/tables.py +1 -1
- dnastack/cli/commands/collections/utils.py +1 -1
- dnastack/cli/commands/config/commands.py +1 -1
- dnastack/cli/commands/config/endpoints.py +39 -20
- dnastack/cli/commands/config/registries.py +2 -2
- dnastack/cli/commands/dataconnect/tables.py +1 -1
- dnastack/cli/commands/drs/commands.py +1 -1
- dnastack/cli/commands/explorer/questions/commands.py +12 -6
- dnastack/cli/commands/explorer/questions/utils.py +16 -7
- dnastack/cli/commands/publisher/collections/commands.py +20 -20
- dnastack/cli/commands/publisher/collections/items.py +9 -0
- dnastack/cli/commands/publisher/collections/tables.py +1 -1
- dnastack/cli/commands/publisher/collections/utils.py +1 -1
- dnastack/cli/commands/publisher/datasources/commands.py +1 -1
- dnastack/cli/commands/workbench/runs/commands.py +11 -3
- dnastack/cli/commands/workbench/workflows/versions/dependencies/commands.py +3 -3
- dnastack/cli/commands/workbench/workflows/versions/transformations.py +5 -9
- dnastack/cli/helpers/exporter.py +1 -1
- dnastack/client/base_exceptions.py +2 -2
- dnastack/client/collections/client.py +4 -4
- dnastack/client/collections/model.py +30 -29
- dnastack/client/data_connect.py +5 -9
- dnastack/client/datasources/model.py +3 -3
- dnastack/client/drs.py +4 -4
- dnastack/client/explorer/client.py +1 -1
- dnastack/client/explorer/models.py +3 -7
- dnastack/client/factory.py +1 -1
- dnastack/client/models.py +6 -6
- dnastack/client/service_registry/factory.py +3 -3
- dnastack/client/service_registry/helper.py +7 -14
- dnastack/client/service_registry/manager.py +4 -4
- dnastack/client/workbench/base_client.py +2 -2
- dnastack/client/workbench/ewes/client.py +3 -3
- dnastack/client/workbench/ewes/models.py +246 -181
- dnastack/client/workbench/models.py +7 -7
- dnastack/client/workbench/samples/models.py +40 -40
- dnastack/client/workbench/storage/client.py +2 -2
- dnastack/client/workbench/storage/models.py +24 -24
- dnastack/client/workbench/workflow/client.py +7 -7
- dnastack/client/workbench/workflow/models.py +64 -64
- dnastack/client/workbench/workflow/utils.py +5 -5
- dnastack/common/auth_manager.py +6 -13
- dnastack/common/class_decorator.py +3 -3
- dnastack/common/events.py +7 -7
- dnastack/common/json_argument_parser.py +4 -4
- dnastack/common/model_mixin.py +1 -1
- dnastack/common/parser.py +3 -3
- dnastack/common/simple_stream.py +1 -1
- dnastack/configuration/manager.py +8 -4
- dnastack/configuration/models.py +2 -2
- dnastack/constants.py +1 -1
- dnastack/context/manager.py +2 -2
- dnastack/context/models.py +2 -2
- dnastack/feature_flags.py +2 -2
- dnastack/http/authenticators/abstract.py +2 -2
- dnastack/http/authenticators/factory.py +2 -2
- dnastack/http/authenticators/oauth2.py +8 -8
- dnastack/http/authenticators/oauth2_adapter/client_credential.py +5 -14
- dnastack/http/authenticators/oauth2_adapter/models.py +15 -15
- dnastack/http/session.py +3 -3
- dnastack/http/session_info.py +3 -3
- {dnastack_client_library-3.1.179.dist-info → dnastack_client_library-3.1.205.dist-info}/METADATA +2 -2
- {dnastack_client_library-3.1.179.dist-info → dnastack_client_library-3.1.205.dist-info}/RECORD +73 -73
- {dnastack_client_library-3.1.179.dist-info → dnastack_client_library-3.1.205.dist-info}/WHEEL +0 -0
- {dnastack_client_library-3.1.179.dist-info → dnastack_client_library-3.1.205.dist-info}/entry_points.txt +0 -0
- {dnastack_client_library-3.1.179.dist-info → dnastack_client_library-3.1.205.dist-info}/licenses/LICENSE +0 -0
- {dnastack_client_library-3.1.179.dist-info → dnastack_client_library-3.1.205.dist-info}/top_level.txt +0 -0
|
@@ -10,33 +10,33 @@ from dnastack.client.workbench.storage.models import PlatformType
|
|
|
10
10
|
|
|
11
11
|
class OntologyClass(BaseModel):
|
|
12
12
|
id: str
|
|
13
|
-
label: Optional[str]
|
|
13
|
+
label: Optional[str] = None
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class PhenotypicFeature(BaseModel):
|
|
17
|
-
created_at: Optional[datetime]
|
|
18
|
-
last_updated_at: Optional[datetime]
|
|
19
|
-
type: Optional[OntologyClass]
|
|
17
|
+
created_at: Optional[datetime] = None
|
|
18
|
+
last_updated_at: Optional[datetime] = None
|
|
19
|
+
type: Optional[OntologyClass] = None
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class SampleMetrics(BaseModel):
|
|
23
|
-
file_count: Optional[int]
|
|
24
|
-
instrument_types: Optional[List[str]]
|
|
23
|
+
file_count: Optional[int] = None
|
|
24
|
+
instrument_types: Optional[List[str]] = None
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class RunMetadata(BaseModel):
|
|
28
|
-
run_id: Optional[str]
|
|
29
|
-
state: Optional[State]
|
|
30
|
-
start_time: Optional[datetime]
|
|
31
|
-
end_time: Optional[datetime]
|
|
32
|
-
updated_time: Optional[datetime]
|
|
33
|
-
submitted_by: Optional[str]
|
|
34
|
-
workflow_id: Optional[str]
|
|
35
|
-
workflow_version_id: Optional[str]
|
|
36
|
-
workflow_name: Optional[str]
|
|
37
|
-
workflow_version: Optional[str]
|
|
38
|
-
last_recorded_event_time: Optional[datetime]
|
|
39
|
-
tags: Optional[dict[str, str]]
|
|
28
|
+
run_id: Optional[str] = None
|
|
29
|
+
state: Optional[State] = None
|
|
30
|
+
start_time: Optional[datetime] = None
|
|
31
|
+
end_time: Optional[datetime] = None
|
|
32
|
+
updated_time: Optional[datetime] = None
|
|
33
|
+
submitted_by: Optional[str] = None
|
|
34
|
+
workflow_id: Optional[str] = None
|
|
35
|
+
workflow_version_id: Optional[str] = None
|
|
36
|
+
workflow_name: Optional[str] = None
|
|
37
|
+
workflow_version: Optional[str] = None
|
|
38
|
+
last_recorded_event_time: Optional[datetime] = None
|
|
39
|
+
tags: Optional[dict[str, str]] = None
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
class Sex(str, CaseInsensitiveEnum):
|
|
@@ -76,27 +76,27 @@ class SampleListOptions(BaseListOptions):
|
|
|
76
76
|
class SampleFile(BaseModel):
|
|
77
77
|
sample_id: str
|
|
78
78
|
path: str
|
|
79
|
-
storage_account_id: Optional[str]
|
|
80
|
-
platform_type: Optional[PlatformType]
|
|
81
|
-
instrument_id: Optional[str]
|
|
82
|
-
created_at: Optional[datetime]
|
|
83
|
-
last_updated_at: Optional[datetime]
|
|
84
|
-
size: Optional[int]
|
|
79
|
+
storage_account_id: Optional[str] = None
|
|
80
|
+
platform_type: Optional[PlatformType] = None
|
|
81
|
+
instrument_id: Optional[str] = None
|
|
82
|
+
created_at: Optional[datetime] = None
|
|
83
|
+
last_updated_at: Optional[datetime] = None
|
|
84
|
+
size: Optional[int] = None
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
class Sample(BaseModel):
|
|
88
88
|
id: str
|
|
89
|
-
created_at: Optional[datetime]
|
|
90
|
-
last_updated_at: Optional[datetime]
|
|
91
|
-
father_id: Optional[str]
|
|
92
|
-
mother_id: Optional[str]
|
|
93
|
-
family_id: Optional[str]
|
|
94
|
-
sex: Optional[str]
|
|
95
|
-
metrics: Optional[SampleMetrics]
|
|
96
|
-
phenotypes: Optional[List[PhenotypicFeature]]
|
|
97
|
-
runs: Optional[List[RunMetadata]]
|
|
98
|
-
affected_status: Optional[AffectedStatus]
|
|
99
|
-
has_been_analyzed: Optional[bool]
|
|
89
|
+
created_at: Optional[datetime] = None
|
|
90
|
+
last_updated_at: Optional[datetime] = None
|
|
91
|
+
father_id: Optional[str] = None
|
|
92
|
+
mother_id: Optional[str] = None
|
|
93
|
+
family_id: Optional[str] = None
|
|
94
|
+
sex: Optional[str] = None
|
|
95
|
+
metrics: Optional[SampleMetrics] = None
|
|
96
|
+
phenotypes: Optional[List[PhenotypicFeature]] = None
|
|
97
|
+
runs: Optional[List[RunMetadata]] = None
|
|
98
|
+
affected_status: Optional[AffectedStatus] = None
|
|
99
|
+
has_been_analyzed: Optional[bool] = None
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
class SampleListResponse(PaginatedResource):
|
|
@@ -107,10 +107,10 @@ class SampleListResponse(PaginatedResource):
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
class SampleFilesListOptions(BaseListOptions):
|
|
110
|
-
storage_id: Optional[str]
|
|
111
|
-
platform_type: Optional[PlatformType]
|
|
112
|
-
instrument_id: Optional[str]
|
|
113
|
-
search: Optional[str]
|
|
110
|
+
storage_id: Optional[str] = None
|
|
111
|
+
platform_type: Optional[PlatformType] = None
|
|
112
|
+
instrument_id: Optional[str] = None
|
|
113
|
+
search: Optional[str] = None
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
class SampleFileListResponse(PaginatedResource):
|
|
@@ -121,7 +121,7 @@ class SampleFileListResponse(PaginatedResource):
|
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
class InstrumentListOptions(BaseListOptions):
|
|
124
|
-
platform_type: Optional[PlatformType]
|
|
124
|
+
platform_type: Optional[PlatformType] = None
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
class Instrument(BaseModel):
|
|
@@ -53,7 +53,7 @@ class StorageClient(BaseWorkbenchClient):
|
|
|
53
53
|
with self.create_http_session() as session:
|
|
54
54
|
response = session.post(
|
|
55
55
|
urljoin(self.endpoint.url, f'{self.namespace}/storage'),
|
|
56
|
-
json=storage_account.
|
|
56
|
+
json=storage_account.model_dump()
|
|
57
57
|
)
|
|
58
58
|
return StorageAccount(**response.json())
|
|
59
59
|
|
|
@@ -62,7 +62,7 @@ class StorageClient(BaseWorkbenchClient):
|
|
|
62
62
|
with self.create_http_session() as session:
|
|
63
63
|
response = session.submit("PUT",
|
|
64
64
|
urljoin(self.endpoint.url, f'{self.namespace}/storage/{storage_account_id}'),
|
|
65
|
-
json=storage_account.
|
|
65
|
+
json=storage_account.model_dump(),
|
|
66
66
|
headers={"If-Match": if_match}
|
|
67
67
|
)
|
|
68
68
|
return StorageAccount(**response.json())
|
|
@@ -20,16 +20,16 @@ class PlatformType(str, CaseInsensitiveEnum):
|
|
|
20
20
|
|
|
21
21
|
class AwsStorageAccountCredentials(BaseModel):
|
|
22
22
|
type: Literal['AWS_ACCESS_KEY'] = 'AWS_ACCESS_KEY'
|
|
23
|
-
access_key_id: Optional[str]
|
|
24
|
-
secret_access_key: Optional[str]
|
|
25
|
-
region: Optional[str]
|
|
23
|
+
access_key_id: Optional[str] = None
|
|
24
|
+
secret_access_key: Optional[str] = None
|
|
25
|
+
region: Optional[str] = None
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class GcpStorageAccountCredentials(BaseModel):
|
|
29
29
|
type: Literal['GCP_SERVICE_ACCOUNT'] = 'GCP_SERVICE_ACCOUNT'
|
|
30
|
-
service_account_json: Optional[str]
|
|
31
|
-
region: Optional[str]
|
|
32
|
-
project_id: Optional[str]
|
|
30
|
+
service_account_json: Optional[str] = None
|
|
31
|
+
region: Optional[str] = None
|
|
32
|
+
project_id: Optional[str] = None
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
class AzureCredentialsType(str, CaseInsensitiveEnum):
|
|
@@ -40,30 +40,30 @@ class AzureCredentialsType(str, CaseInsensitiveEnum):
|
|
|
40
40
|
|
|
41
41
|
class AzureStorageAccountCredentials(BaseModel):
|
|
42
42
|
type: Literal['AZURE_CREDENTIALS'] = 'AZURE_CREDENTIALS'
|
|
43
|
-
sas_url: Optional[str]
|
|
44
|
-
access_key: Optional[str]
|
|
45
|
-
tenant_id: Optional[str]
|
|
46
|
-
client_id: Optional[str]
|
|
47
|
-
client_secret: Optional[str]
|
|
48
|
-
storage_account_name: Optional[str]
|
|
49
|
-
azure_credentials_type: Optional[AzureCredentialsType]
|
|
43
|
+
sas_url: Optional[str] = None
|
|
44
|
+
access_key: Optional[str] = None
|
|
45
|
+
tenant_id: Optional[str] = None
|
|
46
|
+
client_id: Optional[str] = None
|
|
47
|
+
client_secret: Optional[str] = None
|
|
48
|
+
storage_account_name: Optional[str] = None
|
|
49
|
+
azure_credentials_type: Optional[AzureCredentialsType] = None
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
class StorageAccount(BaseModel):
|
|
53
|
-
id: Optional[str]
|
|
54
|
-
namespace: Optional[str]
|
|
55
|
-
name: Optional[str]
|
|
56
|
-
etag: Optional[str]
|
|
57
|
-
provider: Optional[Provider]
|
|
58
|
-
created_at: Optional[str]
|
|
59
|
-
last_updated_at: Optional[str]
|
|
60
|
-
bucket: Optional[str]
|
|
61
|
-
credentials: Optional[Union[AwsStorageAccountCredentials, GcpStorageAccountCredentials, AzureStorageAccountCredentials]]
|
|
53
|
+
id: Optional[str] = None
|
|
54
|
+
namespace: Optional[str] = None
|
|
55
|
+
name: Optional[str] = None
|
|
56
|
+
etag: Optional[str] = None
|
|
57
|
+
provider: Optional[Provider] = None
|
|
58
|
+
created_at: Optional[str] = None
|
|
59
|
+
last_updated_at: Optional[str] = None
|
|
60
|
+
bucket: Optional[str] = None
|
|
61
|
+
credentials: Optional[Union[AwsStorageAccountCredentials, GcpStorageAccountCredentials, AzureStorageAccountCredentials]] = None
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
class StorageListOptions(BaseListOptions):
|
|
65
|
-
provider: Optional[Provider]
|
|
66
|
-
sort: Optional[str]
|
|
65
|
+
provider: Optional[Provider] = None
|
|
66
|
+
sort: Optional[str] = None
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
class StorageListResponse(PaginatedResource):
|
|
@@ -259,7 +259,7 @@ class WorkflowClient(BaseWorkbenchClient):
|
|
|
259
259
|
|
|
260
260
|
def update_workflow(self, workflow_id: str, etag: str, updates: List[JsonPatch]) -> Workflow:
|
|
261
261
|
with self.create_http_session() as session:
|
|
262
|
-
updates = [update.
|
|
262
|
+
updates = [update.model_dump() for update in updates]
|
|
263
263
|
response = session.json_patch(
|
|
264
264
|
urljoin(self.endpoint.url, f'{self.namespace}/workflows/{workflow_id}'),
|
|
265
265
|
headers={'If-Match': etag},
|
|
@@ -270,7 +270,7 @@ class WorkflowClient(BaseWorkbenchClient):
|
|
|
270
270
|
def update_workflow_version(self, workflow_id: str, version_id: str, etag: str,
|
|
271
271
|
updates: List[JsonPatch]) -> WorkflowVersion:
|
|
272
272
|
with self.create_http_session() as session:
|
|
273
|
-
updates = [update.
|
|
273
|
+
updates = [update.model_dump() for update in updates]
|
|
274
274
|
response = session.json_patch(
|
|
275
275
|
urljoin(self.endpoint.url, f'{self.namespace}/workflows/{workflow_id}/versions/{version_id}'),
|
|
276
276
|
headers={'If-Match': etag},
|
|
@@ -325,7 +325,7 @@ class WorkflowClient(BaseWorkbenchClient):
|
|
|
325
325
|
response = session.post(
|
|
326
326
|
urljoin(self.endpoint.url,
|
|
327
327
|
f'{self.namespace}/workflows/{workflow_id}/versions/{version_id}/defaults'),
|
|
328
|
-
json=workflow_defaults.
|
|
328
|
+
json=workflow_defaults.model_dump()
|
|
329
329
|
)
|
|
330
330
|
return WorkflowDefaults(**response.json())
|
|
331
331
|
|
|
@@ -343,7 +343,7 @@ class WorkflowClient(BaseWorkbenchClient):
|
|
|
343
343
|
response = session.submit("PUT",
|
|
344
344
|
urljoin(self.endpoint.url,
|
|
345
345
|
f'{self.namespace}/workflows/{workflow_id}/versions/{version_id}/defaults/{default_id}'),
|
|
346
|
-
json=workflow_defaults.
|
|
346
|
+
json=workflow_defaults.model_dump(),
|
|
347
347
|
headers={"If-Match": if_match}
|
|
348
348
|
)
|
|
349
349
|
return WorkflowDefaults(**response.json())
|
|
@@ -378,7 +378,7 @@ class WorkflowClient(BaseWorkbenchClient):
|
|
|
378
378
|
with self.create_http_session() as session:
|
|
379
379
|
response = session.post(
|
|
380
380
|
urljoin(self.endpoint.url, f'{self.namespace}/workflows/{workflow_id}/versions/{workflow_version_id}/transformations'),
|
|
381
|
-
json=workflow_transformation_create_request.
|
|
381
|
+
json=workflow_transformation_create_request.model_dump()
|
|
382
382
|
)
|
|
383
383
|
return WorkflowTransformation(**response.json())
|
|
384
384
|
|
|
@@ -411,7 +411,7 @@ class WorkflowClient(BaseWorkbenchClient):
|
|
|
411
411
|
with self.create_http_session() as session:
|
|
412
412
|
response = session.post(
|
|
413
413
|
urljoin(self.endpoint.url, f'{self.namespace}/workflows/{workflow_id}/versions/{workflow_version_id}/dependencies'),
|
|
414
|
-
json=workflow_dependency_create_request.
|
|
414
|
+
json=workflow_dependency_create_request.model_dump(),
|
|
415
415
|
headers=headers
|
|
416
416
|
)
|
|
417
417
|
return WorkflowDependency(**response.json())
|
|
@@ -426,7 +426,7 @@ class WorkflowClient(BaseWorkbenchClient):
|
|
|
426
426
|
with self.create_http_session() as session:
|
|
427
427
|
response = session.submit("PUT",
|
|
428
428
|
urljoin(self.endpoint.url, f'{self.namespace}/workflows/{workflow_id}/versions/{workflow_version_id}/dependencies/{dependency_id}'),
|
|
429
|
-
json=workflow_dependency_update_request.
|
|
429
|
+
json=workflow_dependency_update_request.model_dump(),
|
|
430
430
|
headers=headers
|
|
431
431
|
)
|
|
432
432
|
return WorkflowDependency(**response.json())
|
|
@@ -12,17 +12,17 @@ class WorkflowDescriptor(BaseModel):
|
|
|
12
12
|
input_schema: Dict
|
|
13
13
|
output_schema: Dict
|
|
14
14
|
wdl_version: str
|
|
15
|
-
errors: Optional[Any]
|
|
15
|
+
errors: Optional[Any] = None
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class WorkflowVersion(BaseModel):
|
|
19
|
-
workflowId: Optional[str]
|
|
19
|
+
workflowId: Optional[str] = None
|
|
20
20
|
id: str
|
|
21
|
-
externalId: Optional[str]
|
|
21
|
+
externalId: Optional[str] = None
|
|
22
22
|
versionName: str
|
|
23
23
|
workflowName: str
|
|
24
|
-
createdAt: Optional[str]
|
|
25
|
-
lastUpdatedAt: Optional[str]
|
|
24
|
+
createdAt: Optional[str] = None
|
|
25
|
+
lastUpdatedAt: Optional[str] = None
|
|
26
26
|
descriptorType: str
|
|
27
27
|
authors: Optional[List[str]] = None
|
|
28
28
|
description: Optional[str] = None
|
|
@@ -34,14 +34,14 @@ class Workflow(BaseModel):
|
|
|
34
34
|
internalId: str
|
|
35
35
|
source: str
|
|
36
36
|
name: str
|
|
37
|
-
description: Optional[str]
|
|
38
|
-
lastUpdatedAt: Optional[str]
|
|
37
|
+
description: Optional[str] = None
|
|
38
|
+
lastUpdatedAt: Optional[str] = None
|
|
39
39
|
latestVersion: str
|
|
40
|
-
authors: Optional[List[str]]
|
|
41
|
-
versions: Optional[List[WorkflowVersion]]
|
|
42
|
-
deleted: Optional[bool]
|
|
43
|
-
etag: Optional[str]
|
|
44
|
-
labels: Optional[List[str]]
|
|
40
|
+
authors: Optional[List[str]] = None
|
|
41
|
+
versions: Optional[List[WorkflowVersion]] = None
|
|
42
|
+
deleted: Optional[bool] = None
|
|
43
|
+
etag: Optional[str] = None
|
|
44
|
+
labels: Optional[List[str]] = None
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
class WorkflowFileType(str, Enum):
|
|
@@ -83,12 +83,12 @@ class WorkflowVersionCreate(BaseModel):
|
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
class WorkflowListOptions(BaseListOptions):
|
|
86
|
-
search: Optional[str]
|
|
87
|
-
source: Optional[WorkflowSource]
|
|
88
|
-
deleted: Optional[bool]
|
|
89
|
-
sort: Optional[str]
|
|
86
|
+
search: Optional[str] = None
|
|
87
|
+
source: Optional[WorkflowSource] = None
|
|
88
|
+
deleted: Optional[bool] = None
|
|
89
|
+
sort: Optional[str] = None
|
|
90
90
|
order: Optional[str] = Field(default=None, deprecated=True)
|
|
91
|
-
direction: Optional[str]
|
|
91
|
+
direction: Optional[str] = None
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
class WorkflowListResponse(PaginatedResource):
|
|
@@ -99,7 +99,7 @@ class WorkflowListResponse(PaginatedResource):
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
class WorkflowVersionListOptions(BaseListOptions):
|
|
102
|
-
deleted: Optional[bool]
|
|
102
|
+
deleted: Optional[bool] = None
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
class WorkflowVersionListResponse(PaginatedResource):
|
|
@@ -113,42 +113,42 @@ class ResolvedWorkflow(BaseModel):
|
|
|
113
113
|
internalId: str
|
|
114
114
|
source: str
|
|
115
115
|
name: str
|
|
116
|
-
description: Optional[str]
|
|
117
|
-
lastUpdatedAt: Optional[str]
|
|
118
|
-
versionId: Optional[str]
|
|
119
|
-
version: Optional[WorkflowVersion]
|
|
120
|
-
authors: Optional[List[str]]
|
|
121
|
-
etag: Optional[str]
|
|
116
|
+
description: Optional[str] = None
|
|
117
|
+
lastUpdatedAt: Optional[str] = None
|
|
118
|
+
versionId: Optional[str] = None
|
|
119
|
+
version: Optional[WorkflowVersion] = None
|
|
120
|
+
authors: Optional[List[str]] = None
|
|
121
|
+
etag: Optional[str] = None
|
|
122
122
|
|
|
123
123
|
class WorkflowDefaultsSelector(BaseModel):
|
|
124
|
-
engine: Optional[str]
|
|
125
|
-
provider: Optional[str]
|
|
126
|
-
region: Optional[str]
|
|
124
|
+
engine: Optional[str] = None
|
|
125
|
+
provider: Optional[str] = None
|
|
126
|
+
region: Optional[str] = None
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
class WorkflowDefaults(BaseModel):
|
|
130
|
-
id: Optional[str]
|
|
131
|
-
name: Optional[str]
|
|
132
|
-
workflow_id: Optional[str]
|
|
133
|
-
workflow_version_id: Optional[str]
|
|
134
|
-
created_at: Optional[str]
|
|
135
|
-
updated_at: Optional[str]
|
|
136
|
-
selector: Optional[WorkflowDefaultsSelector]
|
|
137
|
-
values: Optional[Dict]
|
|
138
|
-
etag: Optional[str]
|
|
130
|
+
id: Optional[str] = None
|
|
131
|
+
name: Optional[str] = None
|
|
132
|
+
workflow_id: Optional[str] = None
|
|
133
|
+
workflow_version_id: Optional[str] = None
|
|
134
|
+
created_at: Optional[str] = None
|
|
135
|
+
updated_at: Optional[str] = None
|
|
136
|
+
selector: Optional[WorkflowDefaultsSelector] = None
|
|
137
|
+
values: Optional[Dict] = None
|
|
138
|
+
etag: Optional[str] = None
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
class WorkflowDefaultsCreateRequest(BaseModel):
|
|
142
|
-
id: Optional[str]
|
|
143
|
-
name: Optional[str]
|
|
144
|
-
selector: Optional[WorkflowDefaultsSelector]
|
|
145
|
-
values: Optional[Dict]
|
|
142
|
+
id: Optional[str] = None
|
|
143
|
+
name: Optional[str] = None
|
|
144
|
+
selector: Optional[WorkflowDefaultsSelector] = None
|
|
145
|
+
values: Optional[Dict] = None
|
|
146
146
|
|
|
147
147
|
|
|
148
148
|
class WorkflowDefaultsUpdateRequest(BaseModel):
|
|
149
|
-
name: Optional[str]
|
|
150
|
-
selector: Optional[WorkflowDefaultsSelector]
|
|
151
|
-
values: Optional[Dict]
|
|
149
|
+
name: Optional[str] = None
|
|
150
|
+
selector: Optional[WorkflowDefaultsSelector] = None
|
|
151
|
+
values: Optional[Dict] = None
|
|
152
152
|
|
|
153
153
|
|
|
154
154
|
class WorkflowDefaultsListResponse(PaginatedResource):
|
|
@@ -159,24 +159,24 @@ class WorkflowDefaultsListResponse(PaginatedResource):
|
|
|
159
159
|
|
|
160
160
|
|
|
161
161
|
class WorkflowDefaultsListOptions(BaseListOptions):
|
|
162
|
-
sort: Optional[str]
|
|
162
|
+
sort: Optional[str] = None
|
|
163
163
|
|
|
164
164
|
|
|
165
165
|
class WorkflowTransformationCreate(BaseModel):
|
|
166
|
-
id: Optional[str]
|
|
167
|
-
next_transformation_id: Optional[str]
|
|
168
|
-
script: Optional[str]
|
|
169
|
-
labels: Optional[List[str]]
|
|
166
|
+
id: Optional[str] = None
|
|
167
|
+
next_transformation_id: Optional[str] = None
|
|
168
|
+
script: Optional[str] = None
|
|
169
|
+
labels: Optional[List[str]] = None
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
class WorkflowTransformation(BaseModel):
|
|
173
|
-
id: Optional[str]
|
|
174
|
-
workflow_id: Optional[str]
|
|
175
|
-
workflow_version_id: Optional[str]
|
|
176
|
-
next_transformation_id: Optional[str]
|
|
177
|
-
script: Optional[str]
|
|
178
|
-
labels: Optional[List[str]]
|
|
179
|
-
created_at: Optional[str]
|
|
173
|
+
id: Optional[str] = None
|
|
174
|
+
workflow_id: Optional[str] = None
|
|
175
|
+
workflow_version_id: Optional[str] = None
|
|
176
|
+
next_transformation_id: Optional[str] = None
|
|
177
|
+
script: Optional[str] = None
|
|
178
|
+
labels: Optional[List[str]] = None
|
|
179
|
+
created_at: Optional[str] = None
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
class WorkflowTransformationListOptions(BaseListOptions):
|
|
@@ -191,20 +191,20 @@ class WorkflowTransformationListResponse(PaginatedResource):
|
|
|
191
191
|
|
|
192
192
|
|
|
193
193
|
class WorkflowDependencyPrerequisite(BaseModel):
|
|
194
|
-
workflow_id: Optional[str]
|
|
195
|
-
workflow_version_id: Optional[str]
|
|
194
|
+
workflow_id: Optional[str] = None
|
|
195
|
+
workflow_version_id: Optional[str] = None
|
|
196
196
|
|
|
197
197
|
|
|
198
198
|
class WorkflowDependency(BaseModel):
|
|
199
|
-
namespace: Optional[str]
|
|
200
|
-
id: Optional[str]
|
|
201
|
-
workflow_id: Optional[str]
|
|
202
|
-
workflow_version_id: Optional[str]
|
|
203
|
-
name: Optional[str]
|
|
199
|
+
namespace: Optional[str] = None
|
|
200
|
+
id: Optional[str] = None
|
|
201
|
+
workflow_id: Optional[str] = None
|
|
202
|
+
workflow_version_id: Optional[str] = None
|
|
203
|
+
name: Optional[str] = None
|
|
204
204
|
dependencies: Optional[List[WorkflowDependencyPrerequisite]] = []
|
|
205
205
|
global_: Optional[bool] = Field(default=None, alias="global")
|
|
206
|
-
created_at: Optional[str]
|
|
207
|
-
updated_at: Optional[str]
|
|
206
|
+
created_at: Optional[str] = None
|
|
207
|
+
updated_at: Optional[str] = None
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
class WorkflowDependencyCreateRequest(BaseModel):
|
|
@@ -42,10 +42,10 @@ class WorkflowSourceLoader(object):
|
|
|
42
42
|
if import_path not in _visited:
|
|
43
43
|
_visited.append(import_path)
|
|
44
44
|
else:
|
|
45
|
-
return
|
|
45
|
+
return []
|
|
46
46
|
|
|
47
|
-
resolved_content =
|
|
48
|
-
all_imported_contents =
|
|
47
|
+
resolved_content = []
|
|
48
|
+
all_imported_contents = []
|
|
49
49
|
if path.name.endswith(".wdl"):
|
|
50
50
|
pattern = re.compile(r'^\s*import\s["\'](?!http)(.+)["\'].*$')
|
|
51
51
|
with import_path.open('r') as fp:
|
|
@@ -67,8 +67,8 @@ class WorkflowSourceLoader(object):
|
|
|
67
67
|
os.chdir(cwd)
|
|
68
68
|
|
|
69
69
|
def _load_files(self):
|
|
70
|
-
path_and_contents: List[Tuple[Path, bytes]] =
|
|
71
|
-
_visited =
|
|
70
|
+
path_and_contents: List[Tuple[Path, bytes]] = []
|
|
71
|
+
_visited = []
|
|
72
72
|
for path in self.source_files:
|
|
73
73
|
path_and_contents.extend(self._resolve_content(None, Path(path), _visited))
|
|
74
74
|
wdl_files = [wdl_file for wdl_file in path_and_contents if wdl_file[0].name.endswith(".wdl")]
|
dnastack/common/auth_manager.py
CHANGED
|
@@ -64,12 +64,8 @@ class AuthManager:
|
|
|
64
64
|
if state.session_info and state.session_info.get('scope'):
|
|
65
65
|
granted_scopes.extend(sorted(str(state.session_info.get('scope')).split(r' ')))
|
|
66
66
|
|
|
67
|
-
basic_event_info =
|
|
68
|
-
|
|
69
|
-
total=total,
|
|
70
|
-
state=state,
|
|
71
|
-
endpoint_ids=affected_endpoint_ids,
|
|
72
|
-
scopes=granted_scopes)
|
|
67
|
+
basic_event_info = {'session_id': authenticator.session_id, 'index': index, 'total': total, 'state': state,
|
|
68
|
+
'endpoint_ids': affected_endpoint_ids, 'scopes': granted_scopes}
|
|
73
69
|
|
|
74
70
|
self.events.dispatch('revoke-begin', basic_event_info)
|
|
75
71
|
|
|
@@ -91,7 +87,7 @@ class AuthManager:
|
|
|
91
87
|
endpoints = self.get_filtered_endpoints(endpoint_ids)
|
|
92
88
|
for authenticator in self.get_authenticators(endpoint_ids):
|
|
93
89
|
auth_state = authenticator.get_state()
|
|
94
|
-
state = ExtendedAuthState(**auth_state.
|
|
90
|
+
state = ExtendedAuthState(**auth_state.model_dump())
|
|
95
91
|
|
|
96
92
|
# Simplify the auth info.
|
|
97
93
|
simplified_auth_info = self._remove_none_entry_from(auth_state.auth_info)
|
|
@@ -144,10 +140,7 @@ class AuthManager:
|
|
|
144
140
|
index += 1
|
|
145
141
|
continue
|
|
146
142
|
|
|
147
|
-
basic_event_info =
|
|
148
|
-
state=state,
|
|
149
|
-
index=index,
|
|
150
|
-
total=total)
|
|
143
|
+
basic_event_info = {'session_id': authenticator.session_id, 'state': state, 'index': index, 'total': total}
|
|
151
144
|
|
|
152
145
|
self.events.dispatch('auth-begin', basic_event_info)
|
|
153
146
|
|
|
@@ -166,7 +159,7 @@ class AuthManager:
|
|
|
166
159
|
with trace.new_span({'actor': 'auth_manager', 'action': 'revoke_session'}):
|
|
167
160
|
authenticator.revoke()
|
|
168
161
|
|
|
169
|
-
state.session_info = authenticator.initialize(trace_context=trace).
|
|
162
|
+
state.session_info = authenticator.initialize(trace_context=trace).model_dump()
|
|
170
163
|
session = state.session_info
|
|
171
164
|
|
|
172
165
|
if (
|
|
@@ -196,7 +189,7 @@ class AuthManager:
|
|
|
196
189
|
def handle_block_response_required_event(self, event: Event):
|
|
197
190
|
if event.details.get('kind') == 'user_verification':
|
|
198
191
|
self._logger.debug(f'Intercepting the "blocking-response-required" event for user verification ({event.details})...')
|
|
199
|
-
self.events.dispatch('user-verification-required',
|
|
192
|
+
self.events.dispatch('user-verification-required', {'url': event.details.get('url')})
|
|
200
193
|
else:
|
|
201
194
|
self._logger.error(f'Intercepted the "blocking-response-required" event but FAILED to handle {event.details}.')
|
|
202
195
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from collections.abc import Callable
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import Any, Dict, get_origin, get_args, Union, Type
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
@dataclass(repr=True)
|
|
@@ -20,11 +20,11 @@ class UndefinedInitializedPropertyError(RuntimeError):
|
|
|
20
20
|
return f'{self.__cls.__module__}.{self.__cls.__name__}: "{self.__property_name}" not defined'
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
def simple_constructor(
|
|
23
|
+
def simple_constructor():
|
|
24
24
|
""" Provide a simple constructor by turning all annotated properties into non-static instance variables. """
|
|
25
25
|
|
|
26
26
|
def wrapper(cls):
|
|
27
|
-
property_map: Dict[str, _Property] =
|
|
27
|
+
property_map: Dict[str, _Property] = {}
|
|
28
28
|
|
|
29
29
|
for p, a in cls.__annotations__.items():
|
|
30
30
|
special_type = get_origin(a)
|
dnastack/common/events.py
CHANGED
|
@@ -17,7 +17,7 @@ class Event(BaseModel):
|
|
|
17
17
|
|
|
18
18
|
@classmethod
|
|
19
19
|
def make(cls, details: Optional[Dict[str, Any]] = None):
|
|
20
|
-
return Event(details=deepcopy(details) if details else
|
|
20
|
+
return Event(details=deepcopy(details) if details else {})
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class EventHandler:
|
|
@@ -70,8 +70,8 @@ class EventSource(AbstractEventSource):
|
|
|
70
70
|
self._alias = f'{type(self._origin).__name__}/{hash(self._origin)}/{self._alias}'
|
|
71
71
|
|
|
72
72
|
self._event_logger = get_logger(self._alias, logging.WARNING)
|
|
73
|
-
self._event_handlers: Dict[str, List[Union[EventHandler, Callable[[Event], None]]]] =
|
|
74
|
-
self._fixed_types = fixed_types or
|
|
73
|
+
self._event_handlers: Dict[str, List[Union[EventHandler, Callable[[Event], None]]]] = {}
|
|
74
|
+
self._fixed_types = fixed_types or []
|
|
75
75
|
|
|
76
76
|
self._event_logger.debug('Initialized')
|
|
77
77
|
|
|
@@ -110,7 +110,7 @@ class EventSource(AbstractEventSource):
|
|
|
110
110
|
self._raise_error_for_non_registered_event_type(event_type)
|
|
111
111
|
|
|
112
112
|
if event_type not in self._event_handlers:
|
|
113
|
-
self._event_handlers[event_type] =
|
|
113
|
+
self._event_handlers[event_type] = []
|
|
114
114
|
|
|
115
115
|
if handler in self._event_handlers[event_type]:
|
|
116
116
|
self._event_logger.debug(f'E/{event_type}: IGNORE BINDING {handler} (duplicate)')
|
|
@@ -124,7 +124,7 @@ class EventSource(AbstractEventSource):
|
|
|
124
124
|
self._raise_error_for_non_registered_event_type(event_type)
|
|
125
125
|
|
|
126
126
|
if event_type not in self._event_handlers:
|
|
127
|
-
self._event_handlers[event_type] =
|
|
127
|
+
self._event_handlers[event_type] = []
|
|
128
128
|
|
|
129
129
|
new_handlers = [
|
|
130
130
|
existing_handler
|
|
@@ -166,9 +166,9 @@ class EventSource(AbstractEventSource):
|
|
|
166
166
|
def _compute_event_hash(obj: Event) -> str:
|
|
167
167
|
h = hashlib.new('sha1')
|
|
168
168
|
try:
|
|
169
|
-
h.update(obj.
|
|
169
|
+
h.update(obj.model_dump_json().encode('utf-8'))
|
|
170
170
|
except TypeError:
|
|
171
|
-
h.update(str(obj.
|
|
171
|
+
h.update(str(obj.model_dump()).encode('utf-8'))
|
|
172
172
|
return h.hexdigest()[:8]
|
|
173
173
|
|
|
174
174
|
def __repr__(self):
|
|
@@ -160,7 +160,7 @@ def get_argument_type(argument: str) -> str:
|
|
|
160
160
|
|
|
161
161
|
def parse_kv_arguments(arguments: List[str]) -> Union[List[JSONType], Dict[str, JSONType]]:
|
|
162
162
|
arg_types = KeyValueArgType(*SEPARATOR_GROUP_NESTED_JSON_ITEMS)
|
|
163
|
-
kv_pairs =
|
|
163
|
+
kv_pairs = []
|
|
164
164
|
for argument in arguments:
|
|
165
165
|
arg_type = arg_types(argument)
|
|
166
166
|
if arg_type.sep == SEPARATOR_DATA_EMBED_FILE_CONTENTS:
|
|
@@ -180,8 +180,8 @@ def parse_kv_arguments(arguments: List[str]) -> Union[List[JSONType], Dict[str,
|
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
def parse_and_merge_arguments(arguments: List[JsonLike]) -> Dict[str, JSONType]:
|
|
183
|
-
arguments_results =
|
|
184
|
-
kv_arguments =
|
|
183
|
+
arguments_results = {}
|
|
184
|
+
kv_arguments = []
|
|
185
185
|
for argument in arguments:
|
|
186
186
|
if argument.argument_type == ArgumentType.KV_PARAM_TYPE:
|
|
187
187
|
kv_arguments.extend(split_arguments_list(argument.value()))
|
|
@@ -198,7 +198,7 @@ def parse_and_merge_arguments(arguments: List[JsonLike]) -> Dict[str, JSONType]:
|
|
|
198
198
|
|
|
199
199
|
def merge_param_json_data(kv_pairs_list: List[str], json_literals_list: List[str],
|
|
200
200
|
files_list: List[str]) -> Dict[str, JSONType]:
|
|
201
|
-
param_presets =
|
|
201
|
+
param_presets = {}
|
|
202
202
|
|
|
203
203
|
# in this ordering the JSON content of the file will be overwritten by any keys with the same values
|
|
204
204
|
if files_list:
|
dnastack/common/model_mixin.py
CHANGED