wizata-dsapi 2.0.0.dev2__tar.gz → 2.0.0.dev4__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.
- {wizata_dsapi-2.0.0.dev2/wizata_dsapi.egg-info → wizata_dsapi-2.0.0.dev4}/PKG-INFO +1 -1
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/__init__.py +2 -1
- wizata_dsapi-2.0.0.dev4/wizata_dsapi/dashboard.py +112 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/notification.py +5 -0
- wizata_dsapi-2.0.0.dev4/wizata_dsapi/version.py +1 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4/wizata_dsapi.egg-info}/PKG-INFO +1 -1
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi.egg-info/SOURCES.txt +1 -0
- wizata_dsapi-2.0.0.dev2/wizata_dsapi/version.py +0 -1
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/LICENSE.txt +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/README.rst +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/setup.cfg +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/setup.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/api_config.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/api_dto.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/api_interface.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/bucket.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/business_label.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/context.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/dataframe_toolkit.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/datapoint.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/datastore.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/ds_dataframe.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/dsapi_json_encoder.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/edge_device.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/evaluation.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/execution.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/execution_log.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/experiment.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/group_system.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/ilogger.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/insight.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/mlmodel.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/model_toolkit.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/models/__init__.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/models/common.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/paged_query_result.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/pipeline.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/pipeline_image.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/plot.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/plots/__init__.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/plots/common.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/request.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/script.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/scripts/__init__.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/scripts/common.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/search.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/solution_component.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/streamlit_utils.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/template.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/trigger.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/twin.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/twinregistration.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/wizard_function.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/wizard_request.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/wizata_dsapi_client.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi/words.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi.egg-info/requires.txt +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi.egg-info/top_level.txt +0 -0
|
@@ -51,4 +51,5 @@ from .streamlit_utils import (get_streamlit_token, get_streamlit_domain, get_str
|
|
|
51
51
|
|
|
52
52
|
from .search import FilterOperator, SearchQuery, SortOption, GroupSearchQuery
|
|
53
53
|
from .notification import NotificationScope, DeviceToken, AlertRule, AlertActive
|
|
54
|
-
from .edge_device import EdgeDevice, EdgeDeviceStatus, EdgeDeviceType
|
|
54
|
+
from .edge_device import EdgeDevice, EdgeDeviceStatus, EdgeDeviceType
|
|
55
|
+
from .dashboard import Dashboard, DashboardType
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Dashboard DTO for mobile dashboard persistence.
|
|
3
|
+
|
|
4
|
+
DashboardType — platform the dashboard is designed for:
|
|
5
|
+
- MOBILE: mobile app dashboard.
|
|
6
|
+
|
|
7
|
+
Dashboard — stores a named dashboard with an ordered list of tiles.
|
|
8
|
+
Linked to either a template (by key) or a twin (by hardware_id), not both.
|
|
9
|
+
Tiles are stored as a JSON array — tile order is array index.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from datetime import datetime, timezone
|
|
13
|
+
from enum import Enum
|
|
14
|
+
from typing import Optional
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class DashboardType(str, Enum):
|
|
18
|
+
MOBILE = "mobile"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Dashboard:
|
|
22
|
+
"""
|
|
23
|
+
Dashboard entity stored in PostgreSQL ``"Dashboard"`` table.
|
|
24
|
+
|
|
25
|
+
PK is ``id`` (UUID, server-generated).
|
|
26
|
+
|
|
27
|
+
- ``name``: display name.
|
|
28
|
+
- ``dashboard_type``: MOBILE (more values later).
|
|
29
|
+
- ``template``: template key (mutually exclusive with ``twin``).
|
|
30
|
+
- ``twin``: twin hardware ID (mutually exclusive with ``template``).
|
|
31
|
+
- ``tiles``: ordered list of tile dicts (type + config).
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def __init__(self):
|
|
35
|
+
self.id: Optional[str] = None
|
|
36
|
+
self.name: Optional[str] = None
|
|
37
|
+
self.dashboard_type: Optional[DashboardType] = None
|
|
38
|
+
self.template: Optional[str] = None
|
|
39
|
+
self.twin: Optional[str] = None
|
|
40
|
+
self.tiles: list = []
|
|
41
|
+
self.created_at: Optional[datetime] = None
|
|
42
|
+
self.updated_at: Optional[datetime] = None
|
|
43
|
+
|
|
44
|
+
# ------------------------------------------------------------------
|
|
45
|
+
# Serialisation
|
|
46
|
+
# ------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
def to_dict(self) -> dict:
|
|
49
|
+
obj = {}
|
|
50
|
+
if self.id is not None:
|
|
51
|
+
obj["id"] = str(self.id)
|
|
52
|
+
if self.name is not None:
|
|
53
|
+
obj["name"] = self.name
|
|
54
|
+
if self.dashboard_type is not None:
|
|
55
|
+
obj["dashboardType"] = (
|
|
56
|
+
self.dashboard_type.value
|
|
57
|
+
if isinstance(self.dashboard_type, DashboardType)
|
|
58
|
+
else self.dashboard_type
|
|
59
|
+
)
|
|
60
|
+
if self.template is not None:
|
|
61
|
+
obj["template"] = self.template
|
|
62
|
+
if self.twin is not None:
|
|
63
|
+
obj["twin"] = self.twin
|
|
64
|
+
obj["tiles"] = list(self.tiles)
|
|
65
|
+
if self.created_at is not None:
|
|
66
|
+
obj["createdAt"] = int(self.created_at.timestamp() * 1000)
|
|
67
|
+
if self.updated_at is not None:
|
|
68
|
+
obj["updatedAt"] = int(self.updated_at.timestamp() * 1000)
|
|
69
|
+
return obj
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_dict(cls, data: dict) -> "Dashboard":
|
|
73
|
+
obj = cls()
|
|
74
|
+
obj.id = data.get("id")
|
|
75
|
+
obj.name = data.get("name")
|
|
76
|
+
|
|
77
|
+
raw_type = data.get("dashboardType") or data.get("dashboard_type")
|
|
78
|
+
if raw_type is not None:
|
|
79
|
+
obj.dashboard_type = DashboardType(raw_type.lower())
|
|
80
|
+
|
|
81
|
+
obj.template = data.get("template")
|
|
82
|
+
obj.twin = data.get("twin")
|
|
83
|
+
obj.tiles = data.get("tiles") or []
|
|
84
|
+
|
|
85
|
+
created_raw = data.get("createdAt") or data.get("created_at")
|
|
86
|
+
if created_raw is not None:
|
|
87
|
+
obj.created_at = datetime.fromtimestamp(created_raw / 1000, tz=timezone.utc)
|
|
88
|
+
|
|
89
|
+
updated_raw = data.get("updatedAt") or data.get("updated_at")
|
|
90
|
+
if updated_raw is not None:
|
|
91
|
+
obj.updated_at = datetime.fromtimestamp(updated_raw / 1000, tz=timezone.utc)
|
|
92
|
+
return obj
|
|
93
|
+
|
|
94
|
+
# ------------------------------------------------------------------
|
|
95
|
+
# API identity helpers
|
|
96
|
+
# ------------------------------------------------------------------
|
|
97
|
+
|
|
98
|
+
def api_id(self) -> str:
|
|
99
|
+
return str(self.id) if self.id else None
|
|
100
|
+
|
|
101
|
+
def api_key(self) -> str:
|
|
102
|
+
return str(self.id) if self.id else None
|
|
103
|
+
|
|
104
|
+
def set_id(self, value):
|
|
105
|
+
self.id = str(value)
|
|
106
|
+
|
|
107
|
+
def __repr__(self) -> str:
|
|
108
|
+
return (
|
|
109
|
+
f"Dashboard(id={self.id!r}, name={self.name!r}, "
|
|
110
|
+
f"type={self.dashboard_type!r}, "
|
|
111
|
+
f"template={self.template!r}, twin={self.twin!r})"
|
|
112
|
+
)
|
|
@@ -24,6 +24,7 @@ class NotificationScope(str, Enum):
|
|
|
24
24
|
PIPELINE_USER = "pipeline_user"
|
|
25
25
|
EDGE_MONITOR = "edge_monitor"
|
|
26
26
|
PIPELINE_MONITOR = "pipeline_monitor"
|
|
27
|
+
DATAPOINT_MONITOR = "datapoint_monitor"
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
class DeviceToken:
|
|
@@ -127,6 +128,7 @@ class AlertRule:
|
|
|
127
128
|
self.event_type: Optional[str] = None
|
|
128
129
|
self.pipeline_key: Optional[str] = None
|
|
129
130
|
self.group_system: Optional[str] = None
|
|
131
|
+
self.hardware_id: Optional[str] = None
|
|
130
132
|
self.scope: Optional[NotificationScope] = None
|
|
131
133
|
self.expiration_cycles: int = 3
|
|
132
134
|
self.activation_threshold: int = 1
|
|
@@ -145,6 +147,8 @@ class AlertRule:
|
|
|
145
147
|
obj["pipelineKey"] = self.pipeline_key
|
|
146
148
|
if self.group_system is not None:
|
|
147
149
|
obj["groupSystem"] = self.group_system
|
|
150
|
+
if self.hardware_id is not None:
|
|
151
|
+
obj["hardwareId"] = self.hardware_id
|
|
148
152
|
if self.scope is not None:
|
|
149
153
|
obj["scope"] = self.scope.value if isinstance(self.scope, NotificationScope) else self.scope
|
|
150
154
|
obj["expirationCycles"] = self.expiration_cycles
|
|
@@ -158,6 +162,7 @@ class AlertRule:
|
|
|
158
162
|
obj.event_type = data.get("eventType") or data.get("event_type")
|
|
159
163
|
obj.pipeline_key = data.get("pipelineKey") or data.get("pipeline_key")
|
|
160
164
|
obj.group_system = data.get("groupSystem") or data.get("group_system")
|
|
165
|
+
obj.hardware_id = data.get("hardwareId") or data.get("hardware_id")
|
|
161
166
|
|
|
162
167
|
raw_scope = data.get("scope")
|
|
163
168
|
if raw_scope is not None:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.0.dev4"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.0.0.dev2"
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev4}/wizata_dsapi.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|