another-ayx-python-sdk 2.4.23__py3-none-any.whl → 2.4.24__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.
Files changed (212) hide show
  1. another_ayx_python_sdk/version.py +3 -3
  2. {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/METADATA +2 -2
  3. {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/RECORD +212 -7
  4. {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/top_level.txt +2 -0
  5. build/lib/another_ayx_python_sdk/__init__.py +14 -0
  6. build/lib/another_ayx_python_sdk/__main__.py +470 -0
  7. build/lib/another_ayx_python_sdk/assets/workspace_files/__init__.py +14 -0
  8. build/lib/another_ayx_python_sdk/assets/workspace_files/setup.py +38 -0
  9. build/lib/another_ayx_python_sdk/cli/__init__.py +14 -0
  10. build/lib/another_ayx_python_sdk/cli/utilities.py +103 -0
  11. build/lib/another_ayx_python_sdk/cli/workspace.py +266 -0
  12. build/lib/another_ayx_python_sdk/cli/yxi_builder.py +125 -0
  13. build/lib/another_ayx_python_sdk/cli/yxi_installer.py +45 -0
  14. build/lib/another_ayx_python_sdk/core/__init__.py +51 -0
  15. build/lib/another_ayx_python_sdk/core/constants.py +25 -0
  16. build/lib/another_ayx_python_sdk/core/dcm_base.py +115 -0
  17. build/lib/another_ayx_python_sdk/core/doc_utilities.py +40 -0
  18. build/lib/another_ayx_python_sdk/core/environment_base.py +213 -0
  19. build/lib/another_ayx_python_sdk/core/exceptions.py +59 -0
  20. build/lib/another_ayx_python_sdk/core/field.py +183 -0
  21. build/lib/another_ayx_python_sdk/core/input_anchor_base.py +86 -0
  22. build/lib/another_ayx_python_sdk/core/input_connection_base.py +206 -0
  23. build/lib/another_ayx_python_sdk/core/io_base.py +139 -0
  24. build/lib/another_ayx_python_sdk/core/metadata.py +173 -0
  25. build/lib/another_ayx_python_sdk/core/observable_mixin.py +90 -0
  26. build/lib/another_ayx_python_sdk/core/output_anchor_base.py +151 -0
  27. build/lib/another_ayx_python_sdk/core/plugin.py +108 -0
  28. build/lib/another_ayx_python_sdk/core/plugin_v2.py +97 -0
  29. build/lib/another_ayx_python_sdk/core/provider_base.py +125 -0
  30. build/lib/another_ayx_python_sdk/core/proxy_requests.py +51 -0
  31. build/lib/another_ayx_python_sdk/core/record_packet.py +88 -0
  32. build/lib/another_ayx_python_sdk/core/record_packet_base.py +123 -0
  33. build/lib/another_ayx_python_sdk/core/register_plugin.py +127 -0
  34. build/lib/another_ayx_python_sdk/core/testing.py +191 -0
  35. build/lib/another_ayx_python_sdk/core/utils.py +146 -0
  36. build/lib/another_ayx_python_sdk/examples/AyxSdkInput/main.py +89 -0
  37. build/lib/another_ayx_python_sdk/examples/AyxSdkMultiConnectionsMultiOutputAnchor/main.py +102 -0
  38. build/lib/another_ayx_python_sdk/examples/AyxSdkMultipleInputAnchors/main.py +84 -0
  39. build/lib/another_ayx_python_sdk/examples/AyxSdkMultipleOutputAnchors/main.py +96 -0
  40. build/lib/another_ayx_python_sdk/examples/AyxSdkOptionalInputAnchor/main.py +94 -0
  41. build/lib/another_ayx_python_sdk/examples/AyxSdkOutput/main.py +78 -0
  42. build/lib/another_ayx_python_sdk/examples/AyxSdkPassThrough/main.py +82 -0
  43. build/lib/another_ayx_python_sdk/providers/__init__.py +14 -0
  44. build/lib/another_ayx_python_sdk/providers/amp_provider/__init__.py +41 -0
  45. build/lib/another_ayx_python_sdk/providers/amp_provider/__main__.py +85 -0
  46. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_dcm.py +58 -0
  47. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_driver.py +358 -0
  48. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_environment.py +73 -0
  49. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_environment_v2.py +278 -0
  50. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_input_anchor.py +73 -0
  51. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_input_connection.py +132 -0
  52. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_io.py +64 -0
  53. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_io_components.py +407 -0
  54. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_output_anchor.py +107 -0
  55. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_provider.py +68 -0
  56. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_provider_v2.py +128 -0
  57. build/lib/another_ayx_python_sdk/providers/amp_provider/amp_record_packet.py +21 -0
  58. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/__init__.py +32 -0
  59. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/input_anchor_builder.py +123 -0
  60. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/input_connection_builder.py +95 -0
  61. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/metadata_builder.py +118 -0
  62. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/output_anchor_builder.py +110 -0
  63. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/packers.py +458 -0
  64. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/record_builder.py +204 -0
  65. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/record_packet_builder.py +133 -0
  66. build/lib/another_ayx_python_sdk/providers/amp_provider/builders/tool_config_builder.py +59 -0
  67. build/lib/another_ayx_python_sdk/providers/amp_provider/cng_certs.py +197 -0
  68. build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/__init__.py +18 -0
  69. build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/amp_transport.py +127 -0
  70. build/lib/another_ayx_python_sdk/providers/amp_provider/data_transport/transport_base.py +35 -0
  71. build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/__init__.py +14 -0
  72. build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/control_msgs.py +189 -0
  73. build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/dcme_msgs.py +119 -0
  74. build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_helpers/record_transfer_msgs.py +32 -0
  75. build/lib/another_ayx_python_sdk/providers/amp_provider/grpc_util.py +161 -0
  76. build/lib/another_ayx_python_sdk/providers/amp_provider/logger_config.py +63 -0
  77. build/lib/another_ayx_python_sdk/providers/amp_provider/plugin_class_loader.py +77 -0
  78. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/__init__.py +67 -0
  79. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/dcm_repository.py +252 -0
  80. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/environment_repository.py +212 -0
  81. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/grpc_repository.py +119 -0
  82. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_anchor_repository.py +110 -0
  83. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_connection_repository.py +276 -0
  84. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_metadata_repository.py +144 -0
  85. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/input_record_packet_repository.py +252 -0
  86. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/io_repository.py +188 -0
  87. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_anchor_repository.py +117 -0
  88. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_metadata_repository.py +129 -0
  89. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/output_record_packet_repository.py +170 -0
  90. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/plugin_class_repository.py +55 -0
  91. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/singleton.py +32 -0
  92. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/test_harness_state_repository.py +172 -0
  93. build/lib/another_ayx_python_sdk/providers/amp_provider/repositories/tool_config_repository.py +89 -0
  94. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/__init__.py +14 -0
  95. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/__init__.py +0 -0
  96. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/close_outgoing_anchor_pb2.py +25 -0
  97. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/close_outgoing_anchor_pb2_grpc.py +4 -0
  98. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/dcm_e_pb2.py +38 -0
  99. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/dcm_e_pb2_grpc.py +4 -0
  100. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_anchor_pb2.py +26 -0
  101. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_anchor_pb2_grpc.py +4 -0
  102. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_complete_pb2.py +25 -0
  103. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_complete_pb2_grpc.py +4 -0
  104. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_pb2.py +26 -0
  105. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_connection_pb2_grpc.py +4 -0
  106. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_data_push_pb2.py +26 -0
  107. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_data_push_pb2_grpc.py +4 -0
  108. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_record_packet_push_pb2.py +26 -0
  109. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/incoming_record_packet_push_pb2_grpc.py +4 -0
  110. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/metadata_pb2.py +31 -0
  111. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/metadata_pb2_grpc.py +4 -0
  112. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_anchor_pb2.py +28 -0
  113. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_anchor_pb2_grpc.py +4 -0
  114. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_data_push_pb2.py +26 -0
  115. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_data_push_pb2_grpc.py +4 -0
  116. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_metadata_push_pb2.py +26 -0
  117. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_metadata_push_pb2_grpc.py +4 -0
  118. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_record_packet_push_pb2.py +26 -0
  119. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/outgoing_record_packet_push_pb2_grpc.py +4 -0
  120. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/output_message_data_pb2.py +29 -0
  121. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/output_message_data_pb2_grpc.py +4 -0
  122. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/password_data_pb2.py +25 -0
  123. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/password_data_pb2_grpc.py +4 -0
  124. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/plugin_initialization_data_pb2.py +33 -0
  125. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/plugin_initialization_data_pb2_grpc.py +4 -0
  126. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_batch_pb2.py +25 -0
  127. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_batch_pb2_grpc.py +4 -0
  128. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_packet_pb2.py +29 -0
  129. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/record_packet_pb2_grpc.py +4 -0
  130. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_engine_service_pb2.py +34 -0
  131. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_engine_service_pb2_grpc.py +305 -0
  132. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_pb2.py +30 -0
  133. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_pb2_grpc.py +235 -0
  134. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_startup_info_pb2.py +25 -0
  135. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_startup_info_pb2_grpc.py +4 -0
  136. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_v2_pb2.py +54 -0
  137. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/sdk_tool_service_v2_pb2_grpc.py +99 -0
  138. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/translate_message_data_pb2.py +27 -0
  139. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/translate_message_data_pb2_grpc.py +4 -0
  140. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/transport_pb2.py +31 -0
  141. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/transport_pb2_grpc.py +4 -0
  142. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/update_progress_pb2.py +25 -0
  143. build/lib/another_ayx_python_sdk/providers/amp_provider/resources/generated/update_progress_pb2_grpc.py +4 -0
  144. build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_runner.py +115 -0
  145. build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_service.py +207 -0
  146. build/lib/another_ayx_python_sdk/providers/amp_provider/sdk_tool_service_v2.py +306 -0
  147. build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/__init__.py +14 -0
  148. build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/constants.py +22 -0
  149. build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/conversions.py +55 -0
  150. build/lib/another_ayx_python_sdk/providers/amp_provider/utilities/utilities.py +63 -0
  151. build/lib/another_ayx_python_sdk/providers/e1_provider/__init__.py +36 -0
  152. build/lib/another_ayx_python_sdk/providers/e1_provider/anchor_builder.py +95 -0
  153. build/lib/another_ayx_python_sdk/providers/e1_provider/cache_e1_sdk_import.py +31 -0
  154. build/lib/another_ayx_python_sdk/providers/e1_provider/connection_callback_strategy.py +155 -0
  155. build/lib/another_ayx_python_sdk/providers/e1_provider/connection_interface.py +125 -0
  156. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_dcm.py +53 -0
  157. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_environment.py +127 -0
  158. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_anchor.py +51 -0
  159. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_anchor_proxy.py +33 -0
  160. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_input_connection.py +87 -0
  161. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_io.py +71 -0
  162. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_output_anchor.py +157 -0
  163. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_output_anchor_proxy.py +97 -0
  164. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_plugin_driver.py +63 -0
  165. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_plugin_proxy.py +363 -0
  166. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_provider.py +71 -0
  167. build/lib/another_ayx_python_sdk/providers/e1_provider/e1_record_packet.py +21 -0
  168. build/lib/another_ayx_python_sdk/providers/e1_provider/events.py +36 -0
  169. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/__init__.py +37 -0
  170. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/alteryx_engine.py +105 -0
  171. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/constants.py +50 -0
  172. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/field.py +122 -0
  173. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/output_anchor.py +55 -0
  174. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/output_anchor_manager.py +31 -0
  175. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_copier.py +65 -0
  176. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_creator.py +41 -0
  177. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_info.py +134 -0
  178. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/record_ref.py +42 -0
  179. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/tool.py +29 -0
  180. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/AlteryxPythonSDK/tool_execution_info.py +43 -0
  181. build/lib/another_ayx_python_sdk/providers/e1_provider/mock_e1_sdk/__init__.py +14 -0
  182. build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/__init__.py +18 -0
  183. build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/field_proxy.py +109 -0
  184. build/lib/another_ayx_python_sdk/providers/e1_provider/proxies/record_copier_proxy.py +49 -0
  185. build/lib/another_ayx_python_sdk/providers/e1_provider/records/__init__.py +23 -0
  186. build/lib/another_ayx_python_sdk/providers/e1_provider/records/base_record_container.py +47 -0
  187. build/lib/another_ayx_python_sdk/providers/e1_provider/records/parsed_record_container.py +67 -0
  188. build/lib/another_ayx_python_sdk/providers/e1_provider/records/raw_record_container.py +111 -0
  189. build/lib/another_ayx_python_sdk/providers/e1_provider/tool_config_loader.py +132 -0
  190. build/lib/another_ayx_python_sdk/providers/e1_provider/utilities/__init__.py +35 -0
  191. build/lib/another_ayx_python_sdk/providers/e1_provider/utilities/utilities.py +54 -0
  192. build/lib/another_ayx_python_sdk/providers/e1_provider/workflow_config.py +31 -0
  193. build/lib/another_ayx_python_sdk/providers/file_provider/__init__.py +32 -0
  194. build/lib/another_ayx_python_sdk/providers/file_provider/environment.py +131 -0
  195. build/lib/another_ayx_python_sdk/providers/file_provider/file_adapter.py +286 -0
  196. build/lib/another_ayx_python_sdk/providers/file_provider/file_provider.py +185 -0
  197. build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_dcm.py +53 -0
  198. build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_input_anchor.py +70 -0
  199. build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_input_connection.py +112 -0
  200. build/lib/another_ayx_python_sdk/providers/file_provider/file_provider_output_anchor.py +114 -0
  201. build/lib/another_ayx_python_sdk/providers/file_provider/file_record_packet.py +21 -0
  202. build/lib/another_ayx_python_sdk/providers/file_provider/iox.py +56 -0
  203. build/lib/another_ayx_python_sdk/providers/file_provider/tool_input.py +104 -0
  204. build/lib/another_ayx_python_sdk/test_harness/__init__.py +14 -0
  205. build/lib/another_ayx_python_sdk/test_harness/__main__.py +120 -0
  206. build/lib/another_ayx_python_sdk/test_harness/plugin_runner.py +416 -0
  207. build/lib/another_ayx_python_sdk/test_harness/process_lifecycle_manager.py +80 -0
  208. build/lib/another_ayx_python_sdk/test_harness/sdk_engine_service.py +106 -0
  209. build/lib/another_ayx_python_sdk/version.py +8 -0
  210. {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/WHEEL +0 -0
  211. {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/entry_points.txt +0 -0
  212. {another_ayx_python_sdk-2.4.23.dist-info → another_ayx_python_sdk-2.4.24.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,67 @@
1
+ # Copyright (C) 2022 Alteryx, Inc. All rights reserved.
2
+ #
3
+ # Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """Repository classes that store information coming from the out of process manager."""
15
+ from typing import Iterable, Optional
16
+
17
+ from .dcm_repository import DCMRepository
18
+ from .environment_repository import EnvironmentRepository
19
+ from .grpc_repository import GrpcRepository
20
+ from .input_anchor_repository import InputAnchorRepository
21
+ from .input_connection_repository import InputConnectionRepository
22
+ from .input_metadata_repository import InputMetadataRepository
23
+ from .input_record_packet_repository import InputRecordPacketRepository
24
+ from .io_repository import IORepository
25
+ from .output_anchor_repository import OutputAnchorRepository
26
+ from .output_metadata_repository import OutputMetadataRepository
27
+ from .output_record_packet_repository import OutputRecordPacketRepository
28
+ from .plugin_class_repository import PluginClassRepository
29
+ from .singleton import Singleton
30
+ from .tool_config_repository import ToolConfigRepository
31
+
32
+
33
+ def clear_repositories(exclude: Optional[Iterable] = None) -> None:
34
+ """Clear all repositories."""
35
+ exclude = exclude or {}
36
+
37
+ repos = [
38
+ var()
39
+ for name, var in globals().items()
40
+ if "repository" in name.lower()
41
+ and callable(var)
42
+ and hasattr(var(), "clear_repository")
43
+ and callable(var().clear_repository)
44
+ and var() not in exclude
45
+ ]
46
+
47
+ for repo in repos:
48
+ repo.clear_repository()
49
+
50
+
51
+ __all__ = [
52
+ "DCMRepository",
53
+ "EnvironmentRepository",
54
+ "GrpcRepository",
55
+ "InputAnchorRepository",
56
+ "InputConnectionRepository",
57
+ "InputMetadataRepository",
58
+ "InputRecordPacketRepository",
59
+ "IORepository",
60
+ "OutputAnchorRepository",
61
+ "OutputMetadataRepository",
62
+ "OutputRecordPacketRepository",
63
+ "PluginClassRepository",
64
+ "Singleton",
65
+ "ToolConfigRepository",
66
+ "clear_repositories",
67
+ ]
@@ -0,0 +1,252 @@
1
+ # Copyright (C) 2022 Alteryx, Inc. All rights reserved.
2
+ #
3
+ # Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """Class that saves and retrieves AMP DCM information."""
15
+ import datetime as dt
16
+ import logging
17
+ from typing import Dict, Optional
18
+
19
+ from another_ayx_python_sdk.core.exceptions import DcmEError, DcmEException
20
+ from another_ayx_python_sdk.providers.amp_provider.repositories.singleton import Singleton
21
+ from another_ayx_python_sdk.providers.amp_provider.resources.generated.dcm_e_pb2 import (
22
+ DcmERequest,
23
+ DcmEResponse,
24
+ )
25
+
26
+ from google.protobuf import json_format
27
+
28
+ import grpc
29
+
30
+ logger = logging.getLogger(__name__)
31
+
32
+
33
+ class DCMRepository(metaclass=Singleton):
34
+ """Repository that stores DCM information."""
35
+
36
+ from another_ayx_python_sdk.providers.amp_provider.resources.generated.sdk_engine_service_pb2_grpc import (
37
+ SdkEngineStub,
38
+ )
39
+
40
+ @staticmethod
41
+ def __get_grpc_client() -> "SdkEngineStub":
42
+ """
43
+ Get grpc sdk engine client.
44
+
45
+ Parameters
46
+ ----------
47
+ -
48
+ """
49
+ from another_ayx_python_sdk.providers.amp_provider.repositories.grpc_repository import (
50
+ GrpcRepository,
51
+ )
52
+
53
+ try:
54
+ return GrpcRepository().get_sdk_engine_client()
55
+ except ValueError:
56
+ raise DcmEException(
57
+ "Error getting GRPC client!",
58
+ DcmEError("Error getting GRPC client!", 10001),
59
+ )
60
+
61
+ @staticmethod
62
+ def __handle_response(res: DcmEResponse) -> Dict:
63
+ """Handle DcmE response."""
64
+ response_dict = json_format.MessageToDict(res.response)
65
+ if not res.success:
66
+ if (
67
+ "message" in response_dict.keys()
68
+ and "errorCode" in response_dict.keys()
69
+ ):
70
+ if "detail" in response_dict.keys():
71
+ raise DcmEException(
72
+ "Dcm.E Error!",
73
+ DcmEError(
74
+ response_dict["message"],
75
+ int(response_dict["errorCode"]),
76
+ response_dict["detail"],
77
+ ),
78
+ )
79
+ else:
80
+ raise DcmEException(
81
+ "Dcm.E Error!",
82
+ DcmEError(
83
+ response_dict["message"], int(response_dict["errorCode"])
84
+ ),
85
+ )
86
+ else:
87
+ raise DcmEException("Dcm.E Error!", DcmEError(res.response, 10003))
88
+
89
+ return response_dict
90
+
91
+ @staticmethod
92
+ def get_connection(connection_id: str) -> Dict:
93
+ """
94
+ Retrieve connection information including secrets by connection ID.
95
+
96
+ Parameters
97
+ ----------
98
+ connection_id
99
+ string with UUID of connection
100
+ """
101
+ logger.debug("Getting DCM connection for " + str(connection_id))
102
+ client = DCMRepository.__get_grpc_client()
103
+
104
+ try:
105
+ req = DcmERequest()
106
+ req.v2.get_connection.connection_id = connection_id
107
+ res = client.Dcm(req)
108
+ except grpc.RpcError:
109
+ raise DcmEException(
110
+ "Error getting DCM connection!",
111
+ DcmEError("Error getting DCM connection!"),
112
+ 10002,
113
+ )
114
+ return DCMRepository.__handle_response(res)
115
+
116
+ @staticmethod
117
+ def update_connection_secret(
118
+ connection_id: str,
119
+ lock_id: str,
120
+ role: str,
121
+ secret_type: str,
122
+ value: str,
123
+ expires_on: Optional[dt.datetime],
124
+ parameters: Optional[Dict[str, str]],
125
+ ) -> Dict:
126
+ """
127
+ Update a single secret for role and secret_type to value as well as the optional expires_on and parameters.
128
+
129
+ Parameters
130
+ ----------
131
+ connection_id
132
+ A connection ID
133
+ lock_id
134
+ A lock ID acquired from get_write_lock()
135
+ role
136
+ A role such as ?oauth?
137
+ secret_type
138
+ A secret type such as ?oauth_token?
139
+ value
140
+ The new value to store for the secret
141
+ expires_on
142
+ (Optional) DateTime expiration of this secret
143
+ parameters
144
+ Dict of parameter values for this secret (this is arbitrary user data stored as JSON)
145
+ """
146
+ from google.protobuf.struct_pb2 import Struct
147
+
148
+ logger.debug("Updating DCM connection secret for " + str(connection_id))
149
+ client = DCMRepository.__get_grpc_client()
150
+
151
+ try:
152
+ req = DcmERequest()
153
+ req.v2.update_secret.connection_id = connection_id
154
+ req.v2.update_secret.lock_id = lock_id
155
+ req.v2.update_secret.credential_role = role
156
+ req.v2.update_secret.secret_type = secret_type
157
+ req.v2.update_secret.value = value
158
+ if parameters:
159
+ st = Struct()
160
+ st.update(parameters)
161
+ req.v2.update_secret.parameters.CopyFrom(st)
162
+ if expires_on:
163
+ req.v2.update_secret.expires_on = expires_on.isoformat()
164
+ res = client.Dcm(req)
165
+ except grpc.RpcError:
166
+ raise DcmEException(
167
+ "Error getting DCM connection!",
168
+ DcmEError("Error getting DCM connection!"),
169
+ 10002,
170
+ )
171
+ return DCMRepository.__handle_response(res)
172
+
173
+ @staticmethod
174
+ def get_write_lock(
175
+ connection_id: str,
176
+ role: str,
177
+ secret_type: str,
178
+ expires_in: Optional[dt.datetime],
179
+ ) -> Dict:
180
+ """
181
+ Attempt to acquire an exclusive write lock.
182
+
183
+ Parameters
184
+ ----------
185
+ connection_id
186
+ string with UUID of connection
187
+ role
188
+ A role such as ?oauth?
189
+ secret_type
190
+ A secret type such as ?oauth_token?
191
+ expires_in
192
+ (Optional) A DateTime value in which to ask for the lock to be held for in milliseconds.
193
+ """
194
+ logger.debug("Getting DCM write lock for " + str(connection_id))
195
+ client = DCMRepository.__get_grpc_client()
196
+
197
+ try:
198
+ req = DcmERequest()
199
+ req.v2.lock_secret.connection_id = connection_id
200
+ req.v2.lock_secret.credential_role = role
201
+ req.v2.lock_secret.secret_type = secret_type
202
+ if expires_in:
203
+ req.v2.lock_secret.expires_in = expires_in.isoformat()
204
+ res = client.Dcm(req)
205
+ except grpc.RpcError:
206
+ raise DcmEException(
207
+ "Error getting DCM connection!",
208
+ DcmEError("Error getting DCM connection!"),
209
+ 10002,
210
+ )
211
+ return DCMRepository.__handle_response(res)
212
+
213
+ @staticmethod
214
+ def free_write_lock(
215
+ connection_id: str, role: str, secret_type: str, lock_id: str
216
+ ) -> None:
217
+ """
218
+ Frees a lock obtained from a previous call to get_write_lock().
219
+
220
+ Parameters
221
+ ----------
222
+ connection_id
223
+ string with UUID of connection
224
+ role
225
+ A role such as ?oauth?
226
+ secret_type
227
+ A secret type such as ?oauth_token?
228
+ lock_id
229
+ A lock_id acquired from a previous call to get_write_lock()
230
+ """
231
+ logger.debug(
232
+ "Freeing DCM write lock for "
233
+ + str(connection_id)
234
+ + " lock_id: "
235
+ + str(lock_id)
236
+ )
237
+ client = DCMRepository.__get_grpc_client()
238
+
239
+ try:
240
+ req = DcmERequest()
241
+ req.v2.unlock_secret.connection_id = connection_id
242
+ req.v2.unlock_secret.credential_role = role
243
+ req.v2.unlock_secret.secret_type = secret_type
244
+ req.v2.unlock_secret.lock_id = lock_id
245
+ res = client.Dcm(req)
246
+ except grpc.RpcError:
247
+ raise DcmEException(
248
+ "Error getting DCM connection!",
249
+ DcmEError("Error getting DCM connection!"),
250
+ 10002,
251
+ )
252
+ DCMRepository.__handle_response(res)
@@ -0,0 +1,212 @@
1
+ # Copyright (C) 2022 Alteryx, Inc. All rights reserved.
2
+ #
3
+ # Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """Class that saves and retrieves AMP environment information."""
15
+ import logging
16
+ from pathlib import Path
17
+ from typing import Dict, Optional, TYPE_CHECKING
18
+
19
+ from another_ayx_python_sdk.core.environment_base import UpdateMode
20
+ from another_ayx_python_sdk.core.exceptions import WorkflowRuntimeError
21
+ from another_ayx_python_sdk.providers.amp_provider.repositories.singleton import Singleton
22
+ from another_ayx_python_sdk.providers.amp_provider.resources.generated.plugin_initialization_data_pb2 import (
23
+ UpdateMode as Protobuf_UpdateMode,
24
+ )
25
+
26
+ if TYPE_CHECKING:
27
+ from another_ayx_python_sdk.core.environment_base import Locale
28
+
29
+ logger = logging.getLogger()
30
+
31
+
32
+ class EnvironmentRepository(metaclass=Singleton):
33
+ """Repository that stores environment information."""
34
+
35
+ def __init__(self) -> None:
36
+ """Initialize the environment repository."""
37
+ self._designer_version: Optional[str] = None
38
+ self._workflow_dir: Optional[Path] = None
39
+ self._alteryx_install_dir: Optional[Path] = None
40
+ self._temp_dir: Optional[str] = None
41
+ self._update_mode: Optional["UpdateMode"] = None
42
+ self._update_only: Optional[bool] = None
43
+ self._proxy_configuration: dict = {}
44
+
45
+ def get_update_only(self) -> bool:
46
+ """
47
+ Check if the tool is running in update only mode.
48
+
49
+ Returns
50
+ -------
51
+ bool
52
+ True if workflow isn't being run.
53
+ """
54
+ if self._update_only is None:
55
+ raise RuntimeError("Update Only has not been determined yet.")
56
+ return self._update_only
57
+
58
+ def get_update_mode(self) -> UpdateMode:
59
+ """
60
+ Get the type of tool update running.
61
+
62
+ Returns
63
+ -------
64
+ UpdateMode
65
+ Enum corresponding to the type of update mode designer is running in. (Quick, Full, No Update)
66
+ """
67
+ if self._update_mode is None:
68
+ raise RuntimeError("Update Mode has not been determined yet.")
69
+ return self._update_mode
70
+
71
+ def get_designer_version(self) -> str:
72
+ """
73
+ Get the version of designer that is running the tool.
74
+
75
+ Returns
76
+ -------
77
+ str
78
+ A version in the format of 1.2.3.4
79
+ """
80
+ if self._designer_version is None:
81
+ raise RuntimeError(
82
+ "Environment repository has not received the 'designer_version' engine constant yet."
83
+ )
84
+ return self._designer_version
85
+
86
+ def get_alteryx_install_dir(self) -> Path:
87
+ """
88
+ Get the directory where designer is stored.
89
+
90
+ Returns
91
+ -------
92
+ Path
93
+ The Alteryx install directory as a Path object.
94
+ """
95
+ if self._alteryx_install_dir is None:
96
+ raise RuntimeError(
97
+ "Environment repository has not received the 'alteryx_install_dir' engine constant yet."
98
+ )
99
+ return self._alteryx_install_dir
100
+
101
+ def get_temp_dir(self) -> str:
102
+ """
103
+ Get the directory where designer-managed temp files are created.
104
+
105
+ Returns
106
+ -------
107
+ str
108
+ The path to the directory where temporary files are stored.
109
+ """
110
+ if self._temp_dir is None:
111
+ raise RuntimeError(
112
+ "Environment repository has not received the 'temp_dir' engine constant yet."
113
+ )
114
+ return self._temp_dir
115
+
116
+ def get_alteryx_locale(self) -> "Locale":
117
+ """
118
+ Get the locale code from Alteryx user settings.
119
+
120
+ Returns
121
+ -------
122
+ Locale
123
+ The language / region that Alteryx is using to display messages.
124
+ """
125
+ # TODO
126
+ return "en"
127
+
128
+ def get_tool_id(self) -> int:
129
+ """
130
+ Get the ID of the tool.
131
+
132
+ Returns
133
+ -------
134
+ int
135
+ Tool's ID (specified by developer).
136
+ """
137
+ # TODO
138
+ return 0
139
+
140
+ def save_tool_config(self, new_config: dict) -> None:
141
+ """
142
+ Update the tool's configuration file.
143
+
144
+ Parameters
145
+ ----------
146
+ new_config
147
+ The new configuration to set for the tool.
148
+ """
149
+ from another_ayx_python_sdk.providers.amp_provider.repositories.tool_config_repository import (
150
+ ToolConfigRepository,
151
+ )
152
+
153
+ ToolConfigRepository().save_tool_config(new_config)
154
+
155
+ def get_proxy_configuration(self) -> dict: # noqa: D102
156
+ return self._proxy_configuration
157
+
158
+ def save_engine_constants(self, constants: Dict[str, str]) -> None:
159
+ """
160
+ Save engine constants to repo.
161
+
162
+ Parameters
163
+ ----------
164
+ constants
165
+ The dictionary of engine constants received through gRPC
166
+ """
167
+ try:
168
+ self._designer_version = constants["Engine.Version"]
169
+ self._alteryx_install_dir = Path(constants["AlteryxExecutable"])
170
+ self._workflow_dir = Path(constants["Engine.WorkflowDirectory"])
171
+ self._temp_dir = constants["Engine.TempFilePath"]
172
+
173
+ except KeyError:
174
+ raise WorkflowRuntimeError(
175
+ "One or more Engine Constants missing from dictionary."
176
+ )
177
+ # The proxy config keys are not always present, so technically an optional kwarg here.
178
+ self._proxy_configuration = {}
179
+ if constants.get("ProxyConfiguration"):
180
+ for key_val_pair in constants["ProxyConfiguration"].split("\n"):
181
+ keyval = key_val_pair.split("=", 1)
182
+ # might have a blank or unset key
183
+ if len(keyval) > 1:
184
+ self._proxy_configuration[keyval[0]] = keyval[1]
185
+
186
+ def save_update_mode(self, update_mode: int) -> None:
187
+ """
188
+ Save the passed in update mode.
189
+
190
+ Parameters
191
+ ----------
192
+ update_mode
193
+ An int that corresponds to the protobuf enumeration for the update mode that designer is running in.
194
+ """
195
+ if update_mode == Protobuf_UpdateMode.UM_Run:
196
+ self._update_mode = UpdateMode.NO_UPDATE_MODE
197
+ self._update_only = False
198
+ if update_mode == Protobuf_UpdateMode.UM_Full:
199
+ self._update_mode = UpdateMode.FULL
200
+ self._update_only = True
201
+ if update_mode == Protobuf_UpdateMode.UM_Quick:
202
+ self._update_mode = UpdateMode.QUICK
203
+ self._update_only = True
204
+
205
+ def clear_repository(self) -> None:
206
+ """Clear the repository."""
207
+ self._designer_version = None
208
+ self._workflow_dir = None
209
+ self._alteryx_install_dir = None
210
+ self._temp_dir = None
211
+ self._update_mode = None
212
+ self._update_only = None
@@ -0,0 +1,119 @@
1
+ # Copyright (C) 2022 Alteryx, Inc. All rights reserved.
2
+ #
3
+ # Licensed under the ALTERYX SDK AND API LICENSE AGREEMENT;
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.alteryx.com/alteryx-sdk-and-api-license-agreement
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """Repository for gRPC objects."""
15
+ from typing import Optional, TYPE_CHECKING
16
+
17
+ from another_ayx_python_sdk.providers.amp_provider.repositories.singleton import Singleton
18
+
19
+ if TYPE_CHECKING:
20
+ from grpc import Server
21
+ from another_ayx_python_sdk.providers.amp_provider.grpc_util import SocketAddress
22
+ from another_ayx_python_sdk.providers.amp_provider.resources.generated.sdk_engine_service_pb2_grpc import (
23
+ SdkEngineStub,
24
+ )
25
+
26
+
27
+ class GrpcRepository(metaclass=Singleton):
28
+ """Class used to get the grpc client/server."""
29
+
30
+ def __init__(self) -> None:
31
+ """Construct the repository."""
32
+ self._client: Optional["SdkEngineStub"] = None
33
+ self._server: Optional["Server"] = None
34
+ self._server_address: Optional["SocketAddress"] = None
35
+
36
+ def save_sdk_engine_client(self, client: "SdkEngineStub") -> None:
37
+ """
38
+ Save the client.
39
+
40
+ Parameters
41
+ ----------
42
+ client
43
+ gRPC SdkEngineClient that can make calls to the services defined in the SdkEngineServicer.
44
+ """
45
+ self._client = client
46
+
47
+ def get_sdk_engine_client(self) -> "SdkEngineStub":
48
+ """
49
+ Get the client.
50
+
51
+ Returns
52
+ -------
53
+ SdkEngineStub
54
+ The SdkEngineClient to make calls with.
55
+ """
56
+ if self._client is None:
57
+ raise ValueError("Client has not been saved.")
58
+
59
+ return self._client
60
+
61
+ def save_sdk_tool_server(self, server: "Server") -> None:
62
+ """
63
+ Save the server.
64
+
65
+ Parameters
66
+ ----------
67
+ server
68
+ The SdkToolServer that is running on the Python process.
69
+ """
70
+ self._server = server
71
+
72
+ def get_sdk_tool_server(self) -> "Server":
73
+ """
74
+ Get the server.
75
+
76
+ Returns
77
+ -------
78
+ Server
79
+ The SdkToolServer.
80
+ """
81
+ if self._server is None:
82
+ raise ValueError("Server has not been saved.")
83
+
84
+ return self._server
85
+
86
+ def save_sdk_tool_server_address(self, address: "SocketAddress") -> None:
87
+ """
88
+ Save the server address.
89
+
90
+ Parameters
91
+ ----------
92
+ address
93
+ The IP address and port that the server is listening on.
94
+ """
95
+ self._server_address = address
96
+
97
+ def get_sdk_tool_server_address(self) -> "SocketAddress":
98
+ """
99
+ Get the server address.
100
+
101
+ Returns
102
+ -------
103
+ SocketAddress
104
+ The IP address and port that the server is listening on.
105
+ """
106
+ if self._server_address is None:
107
+ raise ValueError("Server address has not been saved.")
108
+
109
+ return self._server_address
110
+
111
+ def clear_sdk_engine_client(self) -> None:
112
+ """Clear the client."""
113
+ self._client = None
114
+
115
+ def clear_repository(self) -> None:
116
+ """Clear the repo."""
117
+ self._client = None
118
+ self._server = None
119
+ self._server_address = None