dex-python-sdk 0.0.2__cp311-abi3-win_amd64.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.
- dex/__init__.py +146 -0
- dex/_grpc_errors.py +73 -0
- dex/_invocation_context.py +269 -0
- dex/_native.pyd +0 -0
- dex/_native.pyi +20 -0
- dex/_utils.py +18 -0
- dex/_value_hydrator.py +223 -0
- dex/_value_mapper.py +174 -0
- dex/_worker_dispatcher.py +451 -0
- dex/_worker_service.py +60 -0
- dex/attribute.py +87 -0
- dex/blob_cache.py +73 -0
- dex/channel.py +165 -0
- dex/client.py +715 -0
- dex/client_options.py +19 -0
- dex/codec.py +286 -0
- dex/command_request.py +120 -0
- dex/command_results.py +107 -0
- dex/communication.py +136 -0
- dex/communication_schema.py +54 -0
- dex/condition.py +74 -0
- dex/context.py +86 -0
- dex/data_attributes.py +70 -0
- dex/dexpb/__init__.py +1 -0
- dex/dexpb/dex_pb2.py +381 -0
- dex/dexpb/dex_pb2.pyi +1734 -0
- dex/dexpb/dex_pb2_grpc.py +1298 -0
- dex/errors.py +109 -0
- dex/flow.py +456 -0
- dex/flow_config.py +29 -0
- dex/flow_info.py +51 -0
- dex/flow_options.py +122 -0
- dex/object_encoder.py +799 -0
- dex/persistence.py +89 -0
- dex/persistence_options.py +12 -0
- dex/persistence_schema.py +51 -0
- dex/py.typed +1 -0
- dex/registry.py +204 -0
- dex/reset_workflow_type_and_options.py +67 -0
- dex/rpc.py +93 -0
- dex/runtime_errors.py +81 -0
- dex/search_attributes.py +184 -0
- dex/state_decision.py +153 -0
- dex/state_execution_locals.py +66 -0
- dex/state_movement.py +115 -0
- dex/state_schema.py +48 -0
- dex/step.py +194 -0
- dex/step_execution.py +42 -0
- dex/stop_workflow_options.py +18 -0
- dex/tests/__init__.py +80 -0
- dex/tests/dex-service-env/.env +7 -0
- dex/tests/dex-service-env/docker-compose-init.sh +44 -0
- dex/tests/dex-service-env/docker-compose.yml +97 -0
- dex/tests/dex-service-env/dynamicconfig/README.md +39 -0
- dex/tests/dex-service-env/dynamicconfig/development-sql.yaml +9 -0
- dex/tests/dex-service-env/dynamicconfig/docker.yaml +2 -0
- dex/tests/test_abnormal_exit_workflow.py +43 -0
- dex/tests/test_basic_workflow.py +70 -0
- dex/tests/test_conditional_complete.py +50 -0
- dex/tests/test_describe_workflow.py +40 -0
- dex/tests/test_empty_data_decodes_properly.py +74 -0
- dex/tests/test_internal_channel.py +28 -0
- dex/tests/test_internal_channel_with_no_prefix_channel.py +41 -0
- dex/tests/test_persistence_data_attributes.py +62 -0
- dex/tests/test_persistence_search_attributes.py +127 -0
- dex/tests/test_persistence_state_execution_locals.py +38 -0
- dex/tests/test_rpc.py +64 -0
- dex/tests/test_rpc_with_memo.py +195 -0
- dex/tests/test_rpc_with_memo_duplicate_java_tests.py +117 -0
- dex/tests/test_signal.py +51 -0
- dex/tests/test_skip_wait_until.py +76 -0
- dex/tests/test_state_failure_recovery.py +28 -0
- dex/tests/test_timer.py +35 -0
- dex/tests/test_wait_for_state_execution_completion.py +53 -0
- dex/tests/test_workflow_errors.py +87 -0
- dex/tests/test_workflow_state_options.py +118 -0
- dex/tests/test_workflow_state_options_override.py +44 -0
- dex/tests/worker_server.py +64 -0
- dex/tests/workflows/abnormal_exit_workflow.py +42 -0
- dex/tests/workflows/basic_workflow.py +62 -0
- dex/tests/workflows/conditional_complete_workflow.py +95 -0
- dex/tests/workflows/describe_workflow.py +46 -0
- dex/tests/workflows/empty_data_workflow.py +45 -0
- dex/tests/workflows/internal_channel_workflow.py +129 -0
- dex/tests/workflows/internal_channel_workflow_with_no_prefix_channel.py +100 -0
- dex/tests/workflows/java_duplicate_rpc_memo_workflow.py +276 -0
- dex/tests/workflows/persistence_data_attributes_workflow.py +98 -0
- dex/tests/workflows/persistence_search_attributes_workflow.py +159 -0
- dex/tests/workflows/persistence_state_execution_local_workflow.py +63 -0
- dex/tests/workflows/recovery_workflow.py +82 -0
- dex/tests/workflows/rpc_memo_workflow.py +231 -0
- dex/tests/workflows/rpc_workflow.py +117 -0
- dex/tests/workflows/state_options_override_workflow.py +93 -0
- dex/tests/workflows/state_options_workflow.py +84 -0
- dex/tests/workflows/timer_workflow.py +46 -0
- dex/tests/workflows/wait_for_state_with_state_execution_id_workflow.py +70 -0
- dex/tests/workflows/wait_for_state_with_wait_for_key_workflow.py +71 -0
- dex/tests/workflows/wait_internal_channel_workflow.py +47 -0
- dex/tests/workflows/wait_signal_workflow.py +147 -0
- dex/timer.py +21 -0
- dex/type_store.py +99 -0
- dex/unregistered_client.py +585 -0
- dex/utils/__init__.py +3 -0
- dex/utils/dex_typing.py +25 -0
- dex/utils/persistence_utils.py +32 -0
- dex/wait.py +49 -0
- dex/worker.py +121 -0
- dex/worker_options.py +22 -0
- dex/worker_service.py +432 -0
- dex/workflow.py +79 -0
- dex/workflow_context.py +44 -0
- dex/workflow_info.py +16 -0
- dex/workflow_options.py +74 -0
- dex/workflow_state.py +123 -0
- dex/workflow_state_options.py +154 -0
- dex_python_sdk-0.0.2.dist-info/METADATA +202 -0
- dex_python_sdk-0.0.2.dist-info/RECORD +121 -0
- dex_python_sdk-0.0.2.dist-info/WHEEL +4 -0
- dex_python_sdk-0.0.2.dist-info/licenses/LEGACY_NOTICES.md +61 -0
- dex_python_sdk-0.0.2.dist-info/licenses/LICENSE +192 -0
- dex_python_sdk-0.0.2.dist-info/sboms/dex-blob-cache-python.cyclonedx.json +2406 -0
dex/flow_options.py
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Legacy Materials in this file remain under their original licenses.
|
|
2
|
+
# See LEGACY_NOTICES.md.
|
|
3
|
+
|
|
4
|
+
# Modifications Copyright (c) 2026 Super Durable, Inc.
|
|
5
|
+
#
|
|
6
|
+
# Modifications after the Legacy Cutoff are licensed under the
|
|
7
|
+
# Super Durable Source License 1.0.
|
|
8
|
+
# Legacy Materials remain under their original licenses.
|
|
9
|
+
# See LICENSE and LEGACY_NOTICES.md.
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from dataclasses import dataclass, replace
|
|
14
|
+
from datetime import datetime, timedelta
|
|
15
|
+
from enum import Enum
|
|
16
|
+
from typing import Any, TypeVar, overload
|
|
17
|
+
|
|
18
|
+
from dex._utils import require_name
|
|
19
|
+
from dex.attribute import Attribute, AttributeMap
|
|
20
|
+
from dex.flow_config import FlowConfig
|
|
21
|
+
from dex.step import RetryPolicy
|
|
22
|
+
|
|
23
|
+
ValueT = TypeVar("ValueT")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class IdReusePolicy(Enum):
|
|
27
|
+
DEFAULT = "default"
|
|
28
|
+
ALLOW_IF_PREVIOUS_FAILED = "allow_if_previous_failed"
|
|
29
|
+
ALLOW_IF_NOT_RUNNING = "allow_if_not_running"
|
|
30
|
+
ALLOW_TERMINATE_IF_RUNNING = "allow_terminate_if_running"
|
|
31
|
+
DISALLOW = "disallow"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass(frozen=True)
|
|
35
|
+
class _AttributeInitialization:
|
|
36
|
+
definition: Attribute[Any] | AttributeMap[Any]
|
|
37
|
+
instance: str | None
|
|
38
|
+
value: object
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(frozen=True)
|
|
42
|
+
class StartFlowOptions:
|
|
43
|
+
timeout: timedelta | None = None
|
|
44
|
+
start_delay: timedelta | None = None
|
|
45
|
+
id_reuse_policy: IdReusePolicy = IdReusePolicy.DEFAULT
|
|
46
|
+
cron_schedule: str | None = None
|
|
47
|
+
retry_policy: RetryPolicy | None = None
|
|
48
|
+
_attribute_initializations: tuple[_AttributeInitialization, ...] = ()
|
|
49
|
+
config_override: FlowConfig | None = None
|
|
50
|
+
ignore_already_started: bool = False
|
|
51
|
+
request_id: str | None = None
|
|
52
|
+
|
|
53
|
+
@overload
|
|
54
|
+
def with_attribute(
|
|
55
|
+
self,
|
|
56
|
+
attribute: Attribute[ValueT],
|
|
57
|
+
value: ValueT,
|
|
58
|
+
/,
|
|
59
|
+
) -> StartFlowOptions: ...
|
|
60
|
+
|
|
61
|
+
@overload
|
|
62
|
+
def with_attribute(
|
|
63
|
+
self,
|
|
64
|
+
attribute: AttributeMap[ValueT],
|
|
65
|
+
instance: str,
|
|
66
|
+
value: ValueT,
|
|
67
|
+
/,
|
|
68
|
+
) -> StartFlowOptions: ...
|
|
69
|
+
|
|
70
|
+
def with_attribute(
|
|
71
|
+
self,
|
|
72
|
+
attribute: Attribute[Any] | AttributeMap[Any],
|
|
73
|
+
/,
|
|
74
|
+
*args: object,
|
|
75
|
+
) -> StartFlowOptions:
|
|
76
|
+
if isinstance(attribute, Attribute) and len(args) == 1:
|
|
77
|
+
initialization = _AttributeInitialization(attribute, None, args[0])
|
|
78
|
+
elif isinstance(attribute, AttributeMap) and len(args) == 2:
|
|
79
|
+
instance = args[0]
|
|
80
|
+
if not isinstance(instance, str):
|
|
81
|
+
raise TypeError("attribute-map instance must be a string")
|
|
82
|
+
require_name(instance)
|
|
83
|
+
initialization = _AttributeInitialization(attribute, instance, args[1])
|
|
84
|
+
else:
|
|
85
|
+
raise TypeError("with_attribute received invalid arguments")
|
|
86
|
+
return replace(
|
|
87
|
+
self,
|
|
88
|
+
_attribute_initializations=self._attribute_initializations
|
|
89
|
+
+ (initialization,),
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class ResetType(Enum):
|
|
94
|
+
BEGINNING = "beginning"
|
|
95
|
+
HISTORY_EVENT_ID = "history_event_id"
|
|
96
|
+
HISTORY_EVENT_TIME = "history_event_time"
|
|
97
|
+
STEP_TYPE = "step_type"
|
|
98
|
+
STEP_EXECUTION_ID = "step_execution_id"
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@dataclass(frozen=True)
|
|
102
|
+
class ResetFlowOptions:
|
|
103
|
+
type: ResetType
|
|
104
|
+
history_event_id: int | None = None
|
|
105
|
+
history_event_time: datetime | None = None
|
|
106
|
+
step_type: str | None = None
|
|
107
|
+
step_execution_id: str | None = None
|
|
108
|
+
reason: str | None = None
|
|
109
|
+
skip_channel_messages_reapply: bool = False
|
|
110
|
+
skip_locking_rpc_reapply: bool = False
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class StopType(Enum):
|
|
114
|
+
CANCEL = "cancel"
|
|
115
|
+
TERMINATE = "terminate"
|
|
116
|
+
FAIL = "fail"
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
@dataclass(frozen=True)
|
|
120
|
+
class StopFlowOptions:
|
|
121
|
+
type: StopType = StopType.CANCEL
|
|
122
|
+
reason: str | None = None
|