wizata-dsapi 2.0.0.dev17__tar.gz → 2.0.0.dev18__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.dev17/wizata_dsapi.egg-info → wizata_dsapi-2.0.0.dev18}/PKG-INFO +1 -1
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/notification.py +17 -19
- wizata_dsapi-2.0.0.dev18/wizata_dsapi/version.py +1 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18/wizata_dsapi.egg-info}/PKG-INFO +1 -1
- wizata_dsapi-2.0.0.dev17/wizata_dsapi/version.py +0 -1
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/LICENSE.txt +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/README.rst +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/setup.cfg +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/setup.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/__init__.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/api_config.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/api_dto.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/api_interface.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/bucket.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/business_label.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/context.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/dashboard.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/dataframe_toolkit.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/datapoint.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/datastore.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/ds_dataframe.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/dsapi_json_encoder.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/edge_config.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/edge_device.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/edge_module.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/evaluation.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/execution.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/execution_log.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/experiment.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/graylog_log.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/group_system.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/ilogger.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/insight.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/mlmodel.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/mobile_asset.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/model_toolkit.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/models/__init__.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/models/common.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/paged_query_result.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/pipeline.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/pipeline_image.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/plot.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/plots/__init__.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/plots/common.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/request.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/script.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/scripts/__init__.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/scripts/common.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/search.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/solution_component.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/streamlit_utils.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/template.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/template_config.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/trigger.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/twin.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/twinregistration.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/user.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/wizard_function.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/wizard_request.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/wizata_dsapi_client.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi/words.py +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi.egg-info/SOURCES.txt +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi.egg-info/requires.txt +0 -0
- {wizata_dsapi-2.0.0.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi.egg-info/top_level.txt +0 -0
|
@@ -38,19 +38,13 @@ class DeviceToken:
|
|
|
38
38
|
|
|
39
39
|
Primary key is ``(token, tenant_id)`` — one row per device per tenant.
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
- ``scopes``: which event types to receive.
|
|
43
|
-
Defaults to ``[PIPELINE_USER]``.
|
|
44
|
-
- ``twins``: hardware IDs of twins to filter on.
|
|
45
|
-
Empty list means all twins.
|
|
41
|
+
Pure token registration — scopes and twins are on NotificationPreference.
|
|
46
42
|
"""
|
|
47
43
|
|
|
48
44
|
def __init__(self):
|
|
49
45
|
self.token: Optional[str] = None
|
|
50
46
|
self.tenant_id: Optional[str] = None
|
|
51
47
|
self.user_id: Optional[str] = None
|
|
52
|
-
self.scopes: list = [NotificationScope.PIPELINE_USER]
|
|
53
|
-
self.twins: list = []
|
|
54
48
|
self.platform: Optional[str] = None
|
|
55
49
|
self.created_at: Optional[datetime] = None
|
|
56
50
|
|
|
@@ -66,8 +60,6 @@ class DeviceToken:
|
|
|
66
60
|
obj["tenantId"] = self.tenant_id
|
|
67
61
|
if self.user_id is not None:
|
|
68
62
|
obj["userId"] = self.user_id
|
|
69
|
-
obj["scopes"] = [s.value if isinstance(s, NotificationScope) else s for s in self.scopes]
|
|
70
|
-
obj["twins"] = list(self.twins)
|
|
71
63
|
if self.platform is not None:
|
|
72
64
|
obj["platform"] = self.platform
|
|
73
65
|
if self.created_at is not None:
|
|
@@ -80,14 +72,6 @@ class DeviceToken:
|
|
|
80
72
|
obj.token = data.get("token")
|
|
81
73
|
obj.tenant_id = data.get("tenantId") or data.get("tenant_id")
|
|
82
74
|
obj.user_id = data.get("userId") or data.get("user_id")
|
|
83
|
-
|
|
84
|
-
raw_scopes = data.get("scopes")
|
|
85
|
-
if raw_scopes is not None:
|
|
86
|
-
obj.scopes = [NotificationScope(s.lower()) for s in raw_scopes]
|
|
87
|
-
else:
|
|
88
|
-
obj.scopes = [NotificationScope.PIPELINE_USER]
|
|
89
|
-
|
|
90
|
-
obj.twins = data.get("twins") or []
|
|
91
75
|
obj.platform = data.get("platform")
|
|
92
76
|
|
|
93
77
|
created_raw = data.get("createdAt") or data.get("created_at")
|
|
@@ -108,7 +92,7 @@ class DeviceToken:
|
|
|
108
92
|
def __repr__(self) -> str:
|
|
109
93
|
return (
|
|
110
94
|
f"DeviceToken(tenant={self.tenant_id!r}, user={self.user_id!r}, "
|
|
111
|
-
f"
|
|
95
|
+
f"platform={self.platform!r})"
|
|
112
96
|
)
|
|
113
97
|
|
|
114
98
|
|
|
@@ -370,6 +354,8 @@ class NotificationPreference:
|
|
|
370
354
|
self.email_enabled: bool = False
|
|
371
355
|
self.sms_enabled: bool = False
|
|
372
356
|
self.whatsapp_enabled: bool = False
|
|
357
|
+
self.scopes: list = [NotificationScope.PIPELINE_USER]
|
|
358
|
+
self.twins: list = []
|
|
373
359
|
self.created_at: Optional[datetime] = None
|
|
374
360
|
self.updated_at: Optional[datetime] = None
|
|
375
361
|
|
|
@@ -400,6 +386,8 @@ class NotificationPreference:
|
|
|
400
386
|
obj["emailEnabled"] = self.email_enabled
|
|
401
387
|
obj["smsEnabled"] = self.sms_enabled
|
|
402
388
|
obj["whatsappEnabled"] = self.whatsapp_enabled
|
|
389
|
+
obj["scopes"] = [s.value if isinstance(s, NotificationScope) else s for s in self.scopes]
|
|
390
|
+
obj["twins"] = list(self.twins)
|
|
403
391
|
if self.created_at is not None:
|
|
404
392
|
obj["createdAt"] = self.created_at.isoformat()
|
|
405
393
|
if self.updated_at is not None:
|
|
@@ -415,6 +403,13 @@ class NotificationPreference:
|
|
|
415
403
|
obj.sms_enabled = data.get("smsEnabled", data.get("sms_enabled", False))
|
|
416
404
|
obj.whatsapp_enabled = data.get("whatsappEnabled", data.get("whatsapp_enabled", False))
|
|
417
405
|
|
|
406
|
+
raw_scopes = data.get("scopes")
|
|
407
|
+
if raw_scopes is not None:
|
|
408
|
+
obj.scopes = [NotificationScope(s.lower()) for s in raw_scopes]
|
|
409
|
+
else:
|
|
410
|
+
obj.scopes = [NotificationScope.PIPELINE_USER]
|
|
411
|
+
obj.twins = data.get("twins") or []
|
|
412
|
+
|
|
418
413
|
for key in ("createdAt", "created_at"):
|
|
419
414
|
raw = data.get(key)
|
|
420
415
|
if raw is not None:
|
|
@@ -452,7 +447,10 @@ class NotificationPreference:
|
|
|
452
447
|
channels.append("sms")
|
|
453
448
|
if self.whatsapp_enabled:
|
|
454
449
|
channels.append("whatsapp")
|
|
455
|
-
return
|
|
450
|
+
return (
|
|
451
|
+
f"NotificationPreference(user={self.user_id!r}, channels={channels}, "
|
|
452
|
+
f"scopes={[s.value for s in self.scopes]}, twins={self.twins!r})"
|
|
453
|
+
)
|
|
456
454
|
|
|
457
455
|
|
|
458
456
|
class RecipientType(str, Enum):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.0.dev18"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.0.0.dev17"
|
|
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
|
|
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.dev17 → wizata_dsapi-2.0.0.dev18}/wizata_dsapi.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|