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.
Files changed (121) hide show
  1. dex/__init__.py +146 -0
  2. dex/_grpc_errors.py +73 -0
  3. dex/_invocation_context.py +269 -0
  4. dex/_native.pyd +0 -0
  5. dex/_native.pyi +20 -0
  6. dex/_utils.py +18 -0
  7. dex/_value_hydrator.py +223 -0
  8. dex/_value_mapper.py +174 -0
  9. dex/_worker_dispatcher.py +451 -0
  10. dex/_worker_service.py +60 -0
  11. dex/attribute.py +87 -0
  12. dex/blob_cache.py +73 -0
  13. dex/channel.py +165 -0
  14. dex/client.py +715 -0
  15. dex/client_options.py +19 -0
  16. dex/codec.py +286 -0
  17. dex/command_request.py +120 -0
  18. dex/command_results.py +107 -0
  19. dex/communication.py +136 -0
  20. dex/communication_schema.py +54 -0
  21. dex/condition.py +74 -0
  22. dex/context.py +86 -0
  23. dex/data_attributes.py +70 -0
  24. dex/dexpb/__init__.py +1 -0
  25. dex/dexpb/dex_pb2.py +381 -0
  26. dex/dexpb/dex_pb2.pyi +1734 -0
  27. dex/dexpb/dex_pb2_grpc.py +1298 -0
  28. dex/errors.py +109 -0
  29. dex/flow.py +456 -0
  30. dex/flow_config.py +29 -0
  31. dex/flow_info.py +51 -0
  32. dex/flow_options.py +122 -0
  33. dex/object_encoder.py +799 -0
  34. dex/persistence.py +89 -0
  35. dex/persistence_options.py +12 -0
  36. dex/persistence_schema.py +51 -0
  37. dex/py.typed +1 -0
  38. dex/registry.py +204 -0
  39. dex/reset_workflow_type_and_options.py +67 -0
  40. dex/rpc.py +93 -0
  41. dex/runtime_errors.py +81 -0
  42. dex/search_attributes.py +184 -0
  43. dex/state_decision.py +153 -0
  44. dex/state_execution_locals.py +66 -0
  45. dex/state_movement.py +115 -0
  46. dex/state_schema.py +48 -0
  47. dex/step.py +194 -0
  48. dex/step_execution.py +42 -0
  49. dex/stop_workflow_options.py +18 -0
  50. dex/tests/__init__.py +80 -0
  51. dex/tests/dex-service-env/.env +7 -0
  52. dex/tests/dex-service-env/docker-compose-init.sh +44 -0
  53. dex/tests/dex-service-env/docker-compose.yml +97 -0
  54. dex/tests/dex-service-env/dynamicconfig/README.md +39 -0
  55. dex/tests/dex-service-env/dynamicconfig/development-sql.yaml +9 -0
  56. dex/tests/dex-service-env/dynamicconfig/docker.yaml +2 -0
  57. dex/tests/test_abnormal_exit_workflow.py +43 -0
  58. dex/tests/test_basic_workflow.py +70 -0
  59. dex/tests/test_conditional_complete.py +50 -0
  60. dex/tests/test_describe_workflow.py +40 -0
  61. dex/tests/test_empty_data_decodes_properly.py +74 -0
  62. dex/tests/test_internal_channel.py +28 -0
  63. dex/tests/test_internal_channel_with_no_prefix_channel.py +41 -0
  64. dex/tests/test_persistence_data_attributes.py +62 -0
  65. dex/tests/test_persistence_search_attributes.py +127 -0
  66. dex/tests/test_persistence_state_execution_locals.py +38 -0
  67. dex/tests/test_rpc.py +64 -0
  68. dex/tests/test_rpc_with_memo.py +195 -0
  69. dex/tests/test_rpc_with_memo_duplicate_java_tests.py +117 -0
  70. dex/tests/test_signal.py +51 -0
  71. dex/tests/test_skip_wait_until.py +76 -0
  72. dex/tests/test_state_failure_recovery.py +28 -0
  73. dex/tests/test_timer.py +35 -0
  74. dex/tests/test_wait_for_state_execution_completion.py +53 -0
  75. dex/tests/test_workflow_errors.py +87 -0
  76. dex/tests/test_workflow_state_options.py +118 -0
  77. dex/tests/test_workflow_state_options_override.py +44 -0
  78. dex/tests/worker_server.py +64 -0
  79. dex/tests/workflows/abnormal_exit_workflow.py +42 -0
  80. dex/tests/workflows/basic_workflow.py +62 -0
  81. dex/tests/workflows/conditional_complete_workflow.py +95 -0
  82. dex/tests/workflows/describe_workflow.py +46 -0
  83. dex/tests/workflows/empty_data_workflow.py +45 -0
  84. dex/tests/workflows/internal_channel_workflow.py +129 -0
  85. dex/tests/workflows/internal_channel_workflow_with_no_prefix_channel.py +100 -0
  86. dex/tests/workflows/java_duplicate_rpc_memo_workflow.py +276 -0
  87. dex/tests/workflows/persistence_data_attributes_workflow.py +98 -0
  88. dex/tests/workflows/persistence_search_attributes_workflow.py +159 -0
  89. dex/tests/workflows/persistence_state_execution_local_workflow.py +63 -0
  90. dex/tests/workflows/recovery_workflow.py +82 -0
  91. dex/tests/workflows/rpc_memo_workflow.py +231 -0
  92. dex/tests/workflows/rpc_workflow.py +117 -0
  93. dex/tests/workflows/state_options_override_workflow.py +93 -0
  94. dex/tests/workflows/state_options_workflow.py +84 -0
  95. dex/tests/workflows/timer_workflow.py +46 -0
  96. dex/tests/workflows/wait_for_state_with_state_execution_id_workflow.py +70 -0
  97. dex/tests/workflows/wait_for_state_with_wait_for_key_workflow.py +71 -0
  98. dex/tests/workflows/wait_internal_channel_workflow.py +47 -0
  99. dex/tests/workflows/wait_signal_workflow.py +147 -0
  100. dex/timer.py +21 -0
  101. dex/type_store.py +99 -0
  102. dex/unregistered_client.py +585 -0
  103. dex/utils/__init__.py +3 -0
  104. dex/utils/dex_typing.py +25 -0
  105. dex/utils/persistence_utils.py +32 -0
  106. dex/wait.py +49 -0
  107. dex/worker.py +121 -0
  108. dex/worker_options.py +22 -0
  109. dex/worker_service.py +432 -0
  110. dex/workflow.py +79 -0
  111. dex/workflow_context.py +44 -0
  112. dex/workflow_info.py +16 -0
  113. dex/workflow_options.py +74 -0
  114. dex/workflow_state.py +123 -0
  115. dex/workflow_state_options.py +154 -0
  116. dex_python_sdk-0.0.2.dist-info/METADATA +202 -0
  117. dex_python_sdk-0.0.2.dist-info/RECORD +121 -0
  118. dex_python_sdk-0.0.2.dist-info/WHEEL +4 -0
  119. dex_python_sdk-0.0.2.dist-info/licenses/LEGACY_NOTICES.md +61 -0
  120. dex_python_sdk-0.0.2.dist-info/licenses/LICENSE +192 -0
  121. 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