port-ocean 0.5.6__py3-none-any.whl → 0.17.8__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.

Potentially problematic release.


This version of port-ocean might be problematic. Click here for more details.

Files changed (111) hide show
  1. integrations/_infra/Dockerfile.Deb +56 -0
  2. integrations/_infra/Dockerfile.alpine +108 -0
  3. integrations/_infra/Dockerfile.base.builder +26 -0
  4. integrations/_infra/Dockerfile.base.runner +13 -0
  5. integrations/_infra/Dockerfile.dockerignore +94 -0
  6. {port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}} → integrations/_infra}/Makefile +21 -8
  7. integrations/_infra/grpcio.sh +18 -0
  8. integrations/_infra/init.sh +5 -0
  9. port_ocean/bootstrap.py +1 -1
  10. port_ocean/cli/commands/defaults/clean.py +3 -1
  11. port_ocean/cli/commands/new.py +42 -7
  12. port_ocean/cli/commands/sail.py +7 -1
  13. port_ocean/cli/cookiecutter/cookiecutter.json +3 -0
  14. port_ocean/cli/cookiecutter/hooks/post_gen_project.py +20 -3
  15. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.env.example +6 -0
  16. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/blueprints.json +41 -0
  17. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/port-app-config.yml +16 -0
  18. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/spec.yaml +6 -7
  19. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CHANGELOG.md +1 -1
  20. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CONTRIBUTING.md +7 -0
  21. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/changelog/.gitignore +1 -0
  22. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/main.py +16 -1
  23. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/pyproject.toml +21 -10
  24. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/test_sample.py +2 -0
  25. port_ocean/clients/port/authentication.py +16 -4
  26. port_ocean/clients/port/client.py +17 -0
  27. port_ocean/clients/port/mixins/blueprints.py +7 -8
  28. port_ocean/clients/port/mixins/entities.py +108 -53
  29. port_ocean/clients/port/mixins/integrations.py +23 -34
  30. port_ocean/clients/port/retry_transport.py +0 -5
  31. port_ocean/clients/port/utils.py +9 -3
  32. port_ocean/config/base.py +16 -16
  33. port_ocean/config/settings.py +79 -11
  34. port_ocean/context/event.py +18 -5
  35. port_ocean/context/ocean.py +14 -3
  36. port_ocean/core/defaults/clean.py +10 -3
  37. port_ocean/core/defaults/common.py +25 -9
  38. port_ocean/core/defaults/initialize.py +111 -100
  39. port_ocean/core/event_listener/__init__.py +8 -0
  40. port_ocean/core/event_listener/base.py +49 -10
  41. port_ocean/core/event_listener/factory.py +9 -1
  42. port_ocean/core/event_listener/http.py +11 -3
  43. port_ocean/core/event_listener/kafka.py +24 -5
  44. port_ocean/core/event_listener/once.py +96 -4
  45. port_ocean/core/event_listener/polling.py +16 -14
  46. port_ocean/core/event_listener/webhooks_only.py +41 -0
  47. port_ocean/core/handlers/__init__.py +1 -2
  48. port_ocean/core/handlers/entities_state_applier/base.py +4 -1
  49. port_ocean/core/handlers/entities_state_applier/port/applier.py +29 -87
  50. port_ocean/core/handlers/entities_state_applier/port/order_by_entities_dependencies.py +5 -2
  51. port_ocean/core/handlers/entity_processor/base.py +26 -22
  52. port_ocean/core/handlers/entity_processor/jq_entity_processor.py +253 -45
  53. port_ocean/core/handlers/port_app_config/base.py +55 -15
  54. port_ocean/core/handlers/port_app_config/models.py +24 -5
  55. port_ocean/core/handlers/resync_state_updater/__init__.py +5 -0
  56. port_ocean/core/handlers/resync_state_updater/updater.py +84 -0
  57. port_ocean/core/integrations/base.py +5 -7
  58. port_ocean/core/integrations/mixins/events.py +3 -1
  59. port_ocean/core/integrations/mixins/sync.py +4 -2
  60. port_ocean/core/integrations/mixins/sync_raw.py +209 -74
  61. port_ocean/core/integrations/mixins/utils.py +1 -1
  62. port_ocean/core/models.py +44 -0
  63. port_ocean/core/ocean_types.py +29 -11
  64. port_ocean/core/utils/entity_topological_sorter.py +90 -0
  65. port_ocean/core/utils/utils.py +109 -0
  66. port_ocean/debug_cli.py +5 -0
  67. port_ocean/exceptions/core.py +4 -0
  68. port_ocean/exceptions/port_defaults.py +0 -2
  69. port_ocean/helpers/retry.py +85 -24
  70. port_ocean/log/handlers.py +23 -2
  71. port_ocean/log/logger_setup.py +8 -1
  72. port_ocean/log/sensetive.py +25 -10
  73. port_ocean/middlewares.py +10 -2
  74. port_ocean/ocean.py +57 -24
  75. port_ocean/run.py +10 -5
  76. port_ocean/tests/__init__.py +0 -0
  77. port_ocean/tests/clients/port/mixins/test_entities.py +53 -0
  78. port_ocean/tests/conftest.py +4 -0
  79. port_ocean/tests/core/defaults/test_common.py +166 -0
  80. port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py +350 -0
  81. port_ocean/tests/core/handlers/mixins/test_sync_raw.py +552 -0
  82. port_ocean/tests/core/test_utils.py +73 -0
  83. port_ocean/tests/core/utils/test_entity_topological_sorter.py +99 -0
  84. port_ocean/tests/helpers/__init__.py +0 -0
  85. port_ocean/tests/helpers/fake_port_api.py +191 -0
  86. port_ocean/tests/helpers/fixtures.py +46 -0
  87. port_ocean/tests/helpers/integration.py +31 -0
  88. port_ocean/tests/helpers/ocean_app.py +66 -0
  89. port_ocean/tests/helpers/port_client.py +21 -0
  90. port_ocean/tests/helpers/smoke_test.py +82 -0
  91. port_ocean/tests/log/test_handlers.py +71 -0
  92. port_ocean/tests/test_smoke.py +74 -0
  93. port_ocean/tests/utils/test_async_iterators.py +45 -0
  94. port_ocean/tests/utils/test_cache.py +189 -0
  95. port_ocean/utils/async_iterators.py +109 -0
  96. port_ocean/utils/cache.py +37 -1
  97. port_ocean/utils/misc.py +22 -4
  98. port_ocean/utils/queue_utils.py +88 -0
  99. port_ocean/utils/signal.py +1 -4
  100. port_ocean/utils/time.py +54 -0
  101. {port_ocean-0.5.6.dist-info → port_ocean-0.17.8.dist-info}/METADATA +27 -19
  102. port_ocean-0.17.8.dist-info/RECORD +164 -0
  103. {port_ocean-0.5.6.dist-info → port_ocean-0.17.8.dist-info}/WHEEL +1 -1
  104. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore +0 -94
  105. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile +0 -15
  106. port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/config.yaml +0 -17
  107. port_ocean/core/handlers/entities_state_applier/port/validate_entity_relations.py +0 -40
  108. port_ocean/core/utils.py +0 -65
  109. port_ocean-0.5.6.dist-info/RECORD +0 -129
  110. {port_ocean-0.5.6.dist-info → port_ocean-0.17.8.dist-info}/LICENSE.md +0 -0
  111. {port_ocean-0.5.6.dist-info → port_ocean-0.17.8.dist-info}/entry_points.txt +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.5.6
3
+ Version: 0.17.8
4
4
  Summary: Port Ocean is a CLI tool for managing your Port projects.
5
5
  Home-page: https://app.getport.io
6
6
  Keywords: ocean,port-ocean,port
7
7
  Author: Daniel Sinai
8
8
  Author-email: daniel@getport.io
9
- Requires-Python: >=3.11,<4.0
9
+ Requires-Python: >=3.12,<4.0
10
10
  Classifier: Framework :: FastAPI
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: Apache Software License
@@ -14,36 +14,38 @@ Classifier: Natural Language :: English
14
14
  Classifier: Operating System :: POSIX
15
15
  Classifier: Programming Language :: Python
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.11
19
20
  Classifier: Topic :: Software Development :: Libraries
20
21
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
23
  Classifier: Topic :: Utilities
23
24
  Provides-Extra: cli
25
+ Requires-Dist: aiostream (>=0.5.2,<0.7.0)
24
26
  Requires-Dist: click (>=8.1.3,<9.0.0) ; extra == "cli"
25
27
  Requires-Dist: confluent-kafka (>=2.1.1,<3.0.0)
26
28
  Requires-Dist: cookiecutter (>=2.1.1,<3.0.0) ; extra == "cli"
27
- Requires-Dist: fastapi (>=0.100,<0.110)
28
- Requires-Dist: httpx (>=0.24.1,<0.25.0)
29
+ Requires-Dist: fastapi (>=0.115.3,<0.116.0)
30
+ Requires-Dist: httpx (>=0.24.1,<0.28.0)
29
31
  Requires-Dist: jinja2-time (>=0.2.0,<0.3.0) ; extra == "cli"
32
+ Requires-Dist: jq (>=1.8.0,<2.0.0)
30
33
  Requires-Dist: loguru (>=0.7.0,<0.8.0)
31
- Requires-Dist: pydantic (>=1.10.8,<2.0.0)
34
+ Requires-Dist: pydantic[dotenv] (>=1.10.8,<2.0.0)
32
35
  Requires-Dist: pydispatcher (>=2.0.7,<3.0.0)
33
36
  Requires-Dist: pyhumps (>=3.8.0,<4.0.0)
34
- Requires-Dist: pyjq (>=2.6.0,<3.0.0)
37
+ Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
35
38
  Requires-Dist: pyyaml (>=6.0,<7.0)
36
39
  Requires-Dist: rich (>=13.4.1,<14.0.0) ; extra == "cli"
37
40
  Requires-Dist: six (>=1.16.0,<2.0.0)
38
41
  Requires-Dist: tomli (>=2.0.1,<3.0.0)
39
- Requires-Dist: urllib3 (>=1.26.16,<2.0.0)
40
- Requires-Dist: uvicorn (>=0.22.0,<0.23.0)
42
+ Requires-Dist: urllib3 (>=1.26.16,<3.0.0)
43
+ Requires-Dist: uvicorn (>=0.22,<0.31)
41
44
  Requires-Dist: werkzeug (>=2.3.4,<4.0.0)
42
45
  Project-URL: Repository, https://github.com/port-labs/Port-Ocean
43
46
  Description-Content-Type: text/markdown
44
47
 
45
- <img src="./assets/Thumbnail.jpg" alt="Ocean">
46
-
48
+ <img src="./assets/Thumbnail.png" alt="Ocean">
47
49
 
48
50
  # Ocean <img src="./assets/OceanSymbol.svg" alt="Ocean" width="100" height="100" align="right">
49
51
 
@@ -56,24 +58,23 @@ empowering engineers to effortlessly prioritize key features and streamline the
56
58
 
57
59
  - Python 3.11
58
60
 
59
-
60
-
61
61
  ## Installation
62
+
62
63
  In order to install the Ocean Framework, run the following command:
63
64
 
64
65
  ```bash
65
- pip install port-ocean[cli]
66
+ pip install "port-ocean[cli]"
66
67
  ```
67
68
 
68
69
  Or
69
70
 
70
71
  ```bash
71
- poetry add port-ocean[cli]
72
+ poetry add "port-ocean[cli]"
72
73
  ```
73
74
 
74
75
  ## Run Integration
75
76
 
76
- 1. source the integration venv
77
+ 1. source the integration venv
77
78
 
78
79
  ```bash
79
80
  . .venv/bin/activate
@@ -82,8 +83,7 @@ poetry add port-ocean[cli]
82
83
  2. Run
83
84
 
84
85
  ```bash
85
- ocean sail ./path/to/
86
- integration
86
+ ocean sail ./path/to/integration
87
87
  ```
88
88
 
89
89
  # Export Architecture
@@ -91,14 +91,15 @@ poetry add port-ocean[cli]
91
91
  ![image](./assets/ExportArchitecture.svg)
92
92
 
93
93
  ## Real-Time updates Architecture
94
+
94
95
  ![image](./assets/RealTimeUpdatesArchitecture.svg)
95
96
 
96
97
  ## Integration Lifecycle
97
98
 
98
99
  ![image](./assets/LifecycleOfIntegration.svg)
99
100
 
100
-
101
101
  ## Folder Structure
102
+
102
103
  The Ocean Integration Framework follows a specific folder structure within this mono repository. This structure ensures proper organization and easy identification of integration modules. The suggested folder structure is as follows:
103
104
 
104
105
  ```
@@ -122,9 +123,11 @@ port-ocean/
122
123
  - The `pyproject.toml` file inside each integration folder lists the required dependencies for that integration.
123
124
 
124
125
  ## Configuration
126
+
125
127
  The Integration Framework utilizes a `config.yaml` file for its configuration. This file defines both the framework configuration and the integration configuration within it. Each integration is identified by its type and unique identifier, which are utilized during initialization to appropriately update Port.
126
128
 
127
129
  Example `config.yaml`:
130
+
128
131
  ```yaml
129
132
  # This is an example configuration file for the integration service.
130
133
  # Please copy this file to config.yaml file in the integration folder and edit it to your needs.
@@ -153,6 +156,7 @@ The reason Ocean is open source is that we aim for the Port integration library
153
156
  In order to learn how you can contribute to Ocean, read our [contributing guide](./CONTRIBUTING.md)
154
157
 
155
158
  ### Local Development (Framework)
159
+
156
160
  1. Clone the repository
157
161
 
158
162
  2. Install dependencies:
@@ -174,6 +178,7 @@ In order to learn how you can contribute to Ocean, read our [contributing guide]
174
178
  ```
175
179
 
176
180
  ### Local Development (Integration)
181
+
177
182
  1. Clone the repository
178
183
 
179
184
  2. For new integration run
@@ -209,7 +214,10 @@ In order to learn how you can contribute to Ocean, read our [contributing guide]
209
214
  ```
210
215
 
211
216
  ## License
217
+
212
218
  The Ocean Framework is open-source software licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). See the [LICENSE](./LICENSE) file for more information.
213
219
 
214
220
  ## Contact
221
+
215
222
  For any questions or inquiries, please reach out to our team at support@getport.io
223
+
@@ -0,0 +1,164 @@
1
+ integrations/_infra/Dockerfile.Deb,sha256=iEyen_5YTa0syesJWS7NKuE-Oo4rM34Wwgjq9JzEjdA,1519
2
+ integrations/_infra/Dockerfile.alpine,sha256=iauglyEzz5uEPBxsN-9SLFr6qca3Tf4b0DPXKFFeKq4,3482
3
+ integrations/_infra/Dockerfile.base.builder,sha256=LwKLfJvQfKksMqacAT_aDQxFMC2Ty5fFKIa0Eu4QcCc,619
4
+ integrations/_infra/Dockerfile.base.runner,sha256=dsjTWgLQFm4x5gcm-IPhwkDv-M6VRKwdf-qct457h2c,357
5
+ integrations/_infra/Dockerfile.dockerignore,sha256=CM1Fxt3I2AvSvObuUZRmy5BNLSGC7ylnbpWzFgD4cso,1163
6
+ integrations/_infra/Makefile,sha256=ofVvsebe7-inGBjZI976L6ghe1Z3RhKFvQhCf6clHn8,2142
7
+ integrations/_infra/grpcio.sh,sha256=m924poYznoRZ6Tt7Ct8Cs5AV_cmmOx598yIZ3z4DvZE,616
8
+ integrations/_infra/init.sh,sha256=nN8lTrOhB286UfFvD6sJ9YJ-9asT9zVSddQB-RAb7Z4,99
9
+ port_ocean/__init__.py,sha256=J3Mqp7d-CkEe9eMigGG8gSEiVKICY2bf7csNEwVOXk0,294
10
+ port_ocean/bootstrap.py,sha256=CN1M5pVecZ7z_Vfu86Dk2HjFMiuiwt6E_SSOLFCYRMk,1321
11
+ port_ocean/cli/__init__.py,sha256=ZjTGS305llhbjC2BH2KkVj34gCASBGwqc5HZEO_0T_Q,328
12
+ port_ocean/cli/cli.py,sha256=RvWTELEn5YFw9aM0vaNqm5YqZZrL50ILaBs27ptiGl0,57
13
+ port_ocean/cli/commands/__init__.py,sha256=Y9Q6jeYw_ZAZ-mdfE_5DZTdS2KHhieQZoUTggk_AkwM,369
14
+ port_ocean/cli/commands/defaults/__init___.py,sha256=5OKgakO79bTbplFv1_yWCrw1x_JJqSdRXAHHqKSuEpQ,88
15
+ port_ocean/cli/commands/defaults/clean.py,sha256=258rOSC1xGT-NTBIkv-V8HTY57ZipnOD-gV5yEenut0,1570
16
+ port_ocean/cli/commands/defaults/dock.py,sha256=pFtHrU_LTvb5Ddrzj09Wxy-jg1Ym10wBYD-0tpDRugE,1104
17
+ port_ocean/cli/commands/defaults/group.py,sha256=hii_4CYoQ7jSMePbnP4AmruO_RKWCUcoV7dXXBlZafc,115
18
+ port_ocean/cli/commands/list_integrations.py,sha256=DVVioFruGUE-_v6UUHlcemWNN6RlWwCrf1X4HmAXsf8,1134
19
+ port_ocean/cli/commands/main.py,sha256=gj0lmuLep2XeLNuabB7Wk0UVYPT7_CD_rAw5AoUQWSE,1057
20
+ port_ocean/cli/commands/new.py,sha256=qJ6fQG1t95U574Cvx5pMRgxabrmdB6kxEI0bwuTryb8,3262
21
+ port_ocean/cli/commands/pull.py,sha256=VvrRjLNlfPuLIf7KzeIcbzzdi98Z0M9wCRpXC3QPxdI,2306
22
+ port_ocean/cli/commands/sail.py,sha256=rY7rEMjfy_KXiWvtL0T72TTLgeQ3HW4SOzKkz9wL9nI,2282
23
+ port_ocean/cli/commands/version.py,sha256=hEuIEIcm6Zkamz41Z9nxeSM_4g3oNlAgWwQyDGboh-E,536
24
+ port_ocean/cli/cookiecutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ port_ocean/cli/cookiecutter/cookiecutter.json,sha256=ie-LJjg-ek3lP2RRosY2u_q2W4y2TykXm_Gynjjt6Es,814
26
+ port_ocean/cli/cookiecutter/extensions.py,sha256=eQNjZvy2enDkJpvMbBGil77Xk9-38f862wfnmCjdoBc,446
27
+ port_ocean/cli/cookiecutter/hooks/post_gen_project.py,sha256=tFqtsjSbu7HMN32WIiFO37S1a_dfHezvdPwmM6MmNJk,1182
28
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.env.example,sha256=ywAmZto6YBGXyhEmpG1uYsgaHr2N1ZBRjdtRNt6Vkpw,388
29
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.gitignore,sha256=32p1lDW_g5hyBz486GWfDeR9m7ikFlASVri5a8vmNoo,2698
30
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/.gitignore,sha256=kCpRPdl3S_jqYYZaOrc0-xa6-l3KqVjNRXc6jCkd_-Q,12
31
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/blueprints.json,sha256=9kf5gY4YjP78vEPfd9j7347sV6wiqeHzmBz7UJkvmDg,1187
32
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/port-app-config.yml,sha256=pErf4_7-Be2C40JTDJHMywtizUTaQbqyn-SBhCB2ies,507
33
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/spec.yaml,sha256=ie8bI_QOZnJJVG-N1e4KlMebdYts4LUNO_kKw8nGdhA,531
34
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CHANGELOG.md,sha256=XVSgyxfXJZoZmtwaGbQ8XmCapIthe4E7flfuJub-m_s,338
35
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CONTRIBUTING.md,sha256=ZQwD3K35q0wugHZmb1z5wnynmn0uuzwGFSpjm7GieZU,259
36
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/README.md,sha256=5VZmgDRW9gO4d8UuzkujslOIDfIDBiAGL2Hd74HK770,468
37
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/changelog/.gitignore,sha256=JAo-DTfS6GthQGP1NH6wLU-ZymwlTea4KHH_jZVTKn0,14
38
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/debug.py,sha256=_TRsA2s6GV2E3CTI8CHcsH-ZuH4_Eh5-juDXWaET0ho,65
39
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/main.py,sha256=XUwo9yroqSKxAdwVrTKGNGSWvec9n1Rh9Cqvep4HIuE,2257
40
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/poetry.toml,sha256=kENq8nNmFPIzw9vySheyG4xHxAPuBSpZO1CYGD6G2NE,46
41
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/pyproject.toml,sha256=vG27DXTTEL7n68aXzITNfSdr9s7l66U038yCBB9wFO8,2358
42
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/sonar-project.properties,sha256=timmRpoSd50BdxLf45OcFUk2qs855z610kzz3yLAqJw,124
43
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
+ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/test_sample.py,sha256=Ew5LA_G1k6DC5a2ygU2FoyjZQa0fRmPy73N0bio0d14,46
45
+ port_ocean/cli/utils.py,sha256=IUK2UbWqjci-lrcDdynZXqVP5B5TcjF0w5CpEVUks-k,54
46
+ port_ocean/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
+ port_ocean/clients/port/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
+ port_ocean/clients/port/authentication.py,sha256=6-uDMWsJ0xLe1-9IoYXHWmwtufj8rJR4BCRXJlSkCSQ,3447
49
+ port_ocean/clients/port/client.py,sha256=Xd8Jk25Uh4WXY_WW-z1Qbv6F3ZTBFPoOolsxHMfozKw,3366
50
+ port_ocean/clients/port/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
+ port_ocean/clients/port/mixins/blueprints.py,sha256=POBl4uDocrgJBw4rvCAzwRcD4jk-uBL6pDAuKMTajdg,4633
52
+ port_ocean/clients/port/mixins/entities.py,sha256=zVOltaiX3Hx8k_CLjBZ5QFH0r_fQOGMimJ6jAJf9jwI,10327
53
+ port_ocean/clients/port/mixins/integrations.py,sha256=t8OSa7Iopnpp8IOEcp3a7WgwOcJEBdFow9UbGDKWxKI,4858
54
+ port_ocean/clients/port/mixins/migrations.py,sha256=A6896oJF6WbFL2WroyTkMzr12yhVyWqGoq9dtLNSKBY,1457
55
+ port_ocean/clients/port/retry_transport.py,sha256=PtIZOAZ6V-ncpVysRUsPOgt8Sf01QLnTKB5YeKBxkJk,1861
56
+ port_ocean/clients/port/types.py,sha256=nvlgiAq4WH5_F7wQbz_GAWl-faob84LVgIjZ2Ww5mTk,451
57
+ port_ocean/clients/port/utils.py,sha256=SjhgmJXAqH2JqXfGy8GoGwzUYiJvUhWDrJyxQcenxZc,2512
58
+ port_ocean/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
+ port_ocean/config/base.py,sha256=x1gFbzujrxn7EJudRT81C6eN9WsYAb3vOHwcpcpX8Tc,6370
60
+ port_ocean/config/dynamic.py,sha256=qOFkRoJsn_BW7581omi_AoMxoHqasf_foxDQ_G11_SI,2030
61
+ port_ocean/config/settings.py,sha256=cxGnOTO9cEwwFcTSzOmwMw1yPkQHniVJFyCQCyEZ6yY,4333
62
+ port_ocean/consumers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
+ port_ocean/consumers/kafka_consumer.py,sha256=N8KocjBi9aR0BOPG8hgKovg-ns_ggpEjrSxqSqF_BSo,4710
64
+ port_ocean/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
+ port_ocean/context/event.py,sha256=tf254jMqBW1GBmYDhfXMCkOqHA7C_chaYp1OY3Dfnsg,5869
66
+ port_ocean/context/ocean.py,sha256=0kgIi0zAsGarF52Qehu4bOxnAFEb0yayzG7xZioMHJc,4993
67
+ port_ocean/context/resource.py,sha256=yDj63URzQelj8zJPh4BAzTtPhpKr9Gw9DRn7I_0mJ1s,1692
68
+ port_ocean/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
+ port_ocean/core/defaults/__init__.py,sha256=8qCZg8n06WAdMu9s_FiRtDYLGPGHbOuS60vapeUoAks,142
70
+ port_ocean/core/defaults/clean.py,sha256=TOVe5b5FAjFspAkQuKA70k2BClCEFbrQ3xgiAoKXKYE,2427
71
+ port_ocean/core/defaults/common.py,sha256=zJsj7jvlqIMLGXhdASUlbKS8GIAf-FDKKB0O7jB6nx0,4166
72
+ port_ocean/core/defaults/initialize.py,sha256=PVR0awQc0eFKKD5wldMpqg5IKtfc8llreZ1FDN3cCIE,8570
73
+ port_ocean/core/event_listener/__init__.py,sha256=T3E52MKs79fNEW381p7zU9F2vOMvIiiTYWlqRUqnsg0,1135
74
+ port_ocean/core/event_listener/base.py,sha256=VdIdp7RLOSxH3ICyV-wCD3NiJoUzsh2KkJ0a9B29GeI,2847
75
+ port_ocean/core/event_listener/factory.py,sha256=M4Qi05pI840sjDIbdjUEgYe9Gp5ckoCkX-KgLBxUpZg,4096
76
+ port_ocean/core/event_listener/http.py,sha256=_hkQmi9nNh8YG6hbfLrhkATsmGVO8y3qBWvrBHX5Nhk,2992
77
+ port_ocean/core/event_listener/kafka.py,sha256=pVQfGtElIJN2P5lPBrMxyl05B8c2Q2wp5WvA6Pqjnyc,7501
78
+ port_ocean/core/event_listener/once.py,sha256=6DhxQLSz5hjEGhmgLU7aA2ZVRQw3tuwh8sh7N63gRdU,5855
79
+ port_ocean/core/event_listener/polling.py,sha256=iZt59z4Dyus_wVvNfIPbq-G1CozAW9kfPU7uRDLPJVE,3604
80
+ port_ocean/core/event_listener/webhooks_only.py,sha256=PTWnmbLtbJb3ySfotMpTWMYgDVy9zOSYIIGqNbWK0UU,1214
81
+ port_ocean/core/handlers/__init__.py,sha256=d7ShmS90gLRzGKJA6oNy2Zs_dF2yjkmYZInRhBnO9Rw,572
82
+ port_ocean/core/handlers/base.py,sha256=cTarblazu8yh8xz2FpB-dzDKuXxtoi143XJgPbV_DcM,157
83
+ port_ocean/core/handlers/entities_state_applier/__init__.py,sha256=kgLZDCeCEzi4r-0nzW9k78haOZNf6PX7mJOUr34A4c8,173
84
+ port_ocean/core/handlers/entities_state_applier/base.py,sha256=5wHL0icfFAYRPqk8iV_wN49GdJ3aRUtO8tumSxBi4Wo,2268
85
+ port_ocean/core/handlers/entities_state_applier/port/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
+ port_ocean/core/handlers/entities_state_applier/port/applier.py,sha256=FSJ77o-lilv5tF5WgpPNjA5lAw13CseFilL-kMHIF3A,5564
87
+ port_ocean/core/handlers/entities_state_applier/port/get_related_entities.py,sha256=1zncwCbE-Gej0xaWKlzZgoXxOBe9bgs_YxlZ8QW3NdI,1751
88
+ port_ocean/core/handlers/entities_state_applier/port/order_by_entities_dependencies.py,sha256=lyv6xKzhYfd6TioUgR3AVRSJqj7JpAaj1LxxU2xAqeo,1720
89
+ port_ocean/core/handlers/entity_processor/__init__.py,sha256=FvFCunFg44wNQoqlybem9MthOs7p1Wawac87uSXz9U8,156
90
+ port_ocean/core/handlers/entity_processor/base.py,sha256=udR0w5TstTOS5xOfTjAZIEdldn4xr6Oyb3DylatYX3Q,1869
91
+ port_ocean/core/handlers/entity_processor/jq_entity_processor.py,sha256=C6zJbS3miKyDeXiEV-0t5vJvkEznOeXRZFFOnwJcNdA,11714
92
+ port_ocean/core/handlers/port_app_config/__init__.py,sha256=8AAT5OthiVM7KCcM34iEgEeXtn2pRMrT4Dze5r1Ixbk,134
93
+ port_ocean/core/handlers/port_app_config/api.py,sha256=6VbKPwFzsWG0IYsVD81hxSmfqtHUFqrfUuj1DBX5g4w,853
94
+ port_ocean/core/handlers/port_app_config/base.py,sha256=4Nxt2g8voEIHJ4Y1Km5NJcaG2iSbCklw5P8-Kus7Y9k,3007
95
+ port_ocean/core/handlers/port_app_config/models.py,sha256=YvYtf_44KD_rN4xK-3xHtdpRZ1M8Qo-m9K4LDtH7FYU,2344
96
+ port_ocean/core/handlers/resync_state_updater/__init__.py,sha256=kG6y-JQGpPfuTHh912L_bctIDCzAK4DN-d00S7rguWU,81
97
+ port_ocean/core/handlers/resync_state_updater/updater.py,sha256=Yg9ET6ZV5B9GW7u6zZA6GlB_71kmvxvYX2FWgQNzMvo,3182
98
+ port_ocean/core/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
+ port_ocean/core/integrations/base.py,sha256=eS0WDOfCTim1UOQQrNuP14I6hvT_fr8dof_cr1ls01s,3107
100
+ port_ocean/core/integrations/mixins/__init__.py,sha256=FA1FEKMM6P-L2_m7Q4L20mFa4_RgZnwSRmTCreKcBVM,220
101
+ port_ocean/core/integrations/mixins/events.py,sha256=0jKRsBw6lU8Mqs7MaQK4n-t_H6Z4NEkXZ5VWzqTrKEc,2396
102
+ port_ocean/core/integrations/mixins/handler.py,sha256=mZ7-0UlG3LcrwJttFbMe-R4xcOU2H_g33tZar7PwTv8,3771
103
+ port_ocean/core/integrations/mixins/sync.py,sha256=B9fEs8faaYLLikH9GBjE_E61vo0bQDjIGQsQ1SRXOlA,3931
104
+ port_ocean/core/integrations/mixins/sync_raw.py,sha256=a23humX9HRS6xPWQhetbBcSQv3o29q2a72c9y3Do_1U,20457
105
+ port_ocean/core/integrations/mixins/utils.py,sha256=oN4Okz6xlaefpid1_Pud8HPSw9BwwjRohyNsknq-Myg,2309
106
+ port_ocean/core/models.py,sha256=O8nOKc4ORZz9tS5s6y5YgGLEBroXpvSPDqKuz48uKvs,1965
107
+ port_ocean/core/ocean_types.py,sha256=j_-or1VxDy22whLLxwxgzIsE4wAhFLH19Xff9l4oJA8,1124
108
+ port_ocean/core/utils/entity_topological_sorter.py,sha256=MDUjM6OuDy4Xj68o-7InNN0w1jqjxeDfeY8U02vySNI,3081
109
+ port_ocean/core/utils/utils.py,sha256=QSRuF9wlhbOw6cELlDlek_UIX6ciIuKWml8QhBmHU_k,3703
110
+ port_ocean/debug_cli.py,sha256=gHrv-Ey3cImKOcGZpjoHlo4pa_zfmyOl6TUM4o9VtcA,96
111
+ port_ocean/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
+ port_ocean/exceptions/api.py,sha256=TLmTMqn4uHGaHgZK8PMIJ0TVJlPB4iP7xl9rx7GtCyY,426
113
+ port_ocean/exceptions/base.py,sha256=uY4DX7fIITDFfemCJDWpaZi3bD51lcANc5swpoNvMJA,46
114
+ port_ocean/exceptions/clients.py,sha256=LKLLs-Zy3caNG85rwxfOw2rMr8qqVV6SHUq4fRCZ99U,180
115
+ port_ocean/exceptions/context.py,sha256=mA8HII6Rl4QxKUz98ppy1zX3kaziaen21h1ZWuU3ADc,372
116
+ port_ocean/exceptions/core.py,sha256=Zmb1m6NnkSPWpAiQA5tgejm3zpDMt1WQEN47OJNo54A,856
117
+ port_ocean/exceptions/port_defaults.py,sha256=45Bno5JEB-GXztvKsy8mw7TrydQmw13-4JAo2oQmXkE,438
118
+ port_ocean/exceptions/utils.py,sha256=gjOqpi-HpY1l4WlMFsGA9yzhxDhajhoGGdDDyGbLnqI,197
119
+ port_ocean/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
120
+ port_ocean/helpers/async_client.py,sha256=SRlP6o7_FCSY3UHnRlZdezppePVxxOzZ0z861vE3K40,1783
121
+ port_ocean/helpers/retry.py,sha256=fmvaUFLIW6PICgYH4RI5rrKBXDxCAhR1Gtl0dsb2kMs,15625
122
+ port_ocean/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
123
+ port_ocean/log/handlers.py,sha256=ncVjgqrZRh6BhyRrA6DQG86Wsbxph1yWYuEC0cWfe-Q,3631
124
+ port_ocean/log/logger_setup.py,sha256=CoEDowe5OwNOL_5clU6Z4faktfh0VWaOTS0VLmyhHjw,2404
125
+ port_ocean/log/sensetive.py,sha256=lVKiZH6b7TkrZAMmhEJRhcl67HNM94e56x12DwFgCQk,2920
126
+ port_ocean/middlewares.py,sha256=9wYCdyzRZGK1vjEJ28FY_DkfwDNENmXp504UKPf5NaQ,2727
127
+ port_ocean/ocean.py,sha256=XxO-aRExs1hcy6aJY_nceu-QXRWB2ZLpkIPPuBkp-bQ,5247
128
+ port_ocean/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
129
+ port_ocean/run.py,sha256=COoRSmLG4hbsjIW5DzhV0NYVegI9xHd1POv6sg4U1No,2217
130
+ port_ocean/sonar-project.properties,sha256=X_wLzDOkEVmpGLRMb2fg9Rb0DxWwUFSvESId8qpvrPI,73
131
+ port_ocean/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
132
+ port_ocean/tests/clients/port/mixins/test_entities.py,sha256=A9myrnkLhKSQrnOLv1Zz2wiOVSxW65Q9RIUIRbn_V7w,1586
133
+ port_ocean/tests/conftest.py,sha256=JXASSS0IY0nnR6bxBflhzxS25kf4iNaABmThyZ0mZt8,101
134
+ port_ocean/tests/core/defaults/test_common.py,sha256=sR7RqB3ZYV6Xn6NIg-c8k5K6JcGsYZ2SCe_PYX5vLYM,5560
135
+ port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py,sha256=FnEnaDjuoAbKvKyv6xJ46n3j0ZcaT70Sg2zc7oy7HAA,13596
136
+ port_ocean/tests/core/handlers/mixins/test_sync_raw.py,sha256=qpIrcF5A9B5WA0XW0PXplcSHdM7sjHAsqNccrY7TMk0,21887
137
+ port_ocean/tests/core/test_utils.py,sha256=Z3kdhb5V7Svhcyy3EansdTpgHL36TL6erNtU-OPwAcI,2647
138
+ port_ocean/tests/core/utils/test_entity_topological_sorter.py,sha256=zuq5WSPy_88PemG3mOUIHTxWMR_js1R7tOzUYlgBd68,3447
139
+ port_ocean/tests/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
140
+ port_ocean/tests/helpers/fake_port_api.py,sha256=9rtjC6iTQMfzWK6WipkDzzG0b1IIaRmvdJLOyV613vE,6479
141
+ port_ocean/tests/helpers/fixtures.py,sha256=IQEplbHhRgjrAsZlnXrgSYA5YQEn25I9HgO3_Fjibxg,1481
142
+ port_ocean/tests/helpers/integration.py,sha256=_RxS-RHpu11lrbhUXYPZp862HLWx8AoD7iZM6iXN8rs,1104
143
+ port_ocean/tests/helpers/ocean_app.py,sha256=8BysIhNqtTwhjnya5rr0AtrjulfJnJJMFz5cPUxIpLk,2167
144
+ port_ocean/tests/helpers/port_client.py,sha256=5d6GNr8vNNSOkrz1AdOhxBUKuusr_-UPDP7AVpHasQw,599
145
+ port_ocean/tests/helpers/smoke_test.py,sha256=_9aJJFRfuGJEg2D2YQJVJRmpreS6gEPHHQq8Q01x4aQ,2697
146
+ port_ocean/tests/log/test_handlers.py,sha256=uxgYCEQLP9U5qf-zUN9SgWFogMbYdnBeOVzXZ7E_yFw,2119
147
+ port_ocean/tests/test_smoke.py,sha256=uix2uIg_yOm8BHDgHw2hTFPy1fiIyxBGW3ENU_KoFlo,2557
148
+ port_ocean/tests/utils/test_async_iterators.py,sha256=3PLk1emEXekb8LcC5GgVh3OicaX15i5WyaJT_eFnu_4,1336
149
+ port_ocean/tests/utils/test_cache.py,sha256=GzoS8xGCBDbBcPwSDbdimsMMkRvJATrBC7UmFhdW3fw,4906
150
+ port_ocean/utils/__init__.py,sha256=KMGnCPXZJbNwtgxtyMycapkDz8tpSyw23MSYT3iVeHs,91
151
+ port_ocean/utils/async_http.py,sha256=arnH458TExn2Dju_Sy6pHas_vF5RMWnOp-jBz5WAAcE,1226
152
+ port_ocean/utils/async_iterators.py,sha256=CPXskYWkhkZtAG-ducEwM8537t3z5usPEqXR9vcivzw,3715
153
+ port_ocean/utils/cache.py,sha256=RgfN4SjjHrEkbqUChyboeD1mrXomolUUjsJtvbkmr3U,3353
154
+ port_ocean/utils/misc.py,sha256=0q2cJ5psqxn_5u_56pT7vOVQ3shDM02iC1lzyWQ_zl0,2098
155
+ port_ocean/utils/queue_utils.py,sha256=KWWl8YVnG-glcfIHhM6nefY-2sou_C6DVP1VynQwzB4,2762
156
+ port_ocean/utils/repeat.py,sha256=0EFWM9d8lLXAhZmAyczY20LAnijw6UbIECf5lpGbOas,3231
157
+ port_ocean/utils/signal.py,sha256=K-6kKFQTltcmKDhtyZAcn0IMa3sUpOHGOAUdWKgx0_E,1369
158
+ port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
159
+ port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
160
+ port_ocean-0.17.8.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
161
+ port_ocean-0.17.8.dist-info/METADATA,sha256=ai6732XzeLDxrSpKC9aiCL8ZIafzuDl3dbEE0Z8d7-4,6669
162
+ port_ocean-0.17.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
163
+ port_ocean-0.17.8.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
164
+ port_ocean-0.17.8.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 1.9.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,94 +0,0 @@
1
- # Git
2
- .git
3
- .gitignore
4
- .gitattributes
5
-
6
-
7
- # CI
8
- .codeclimate.yml
9
- .travis.yml
10
- .taskcluster.yml
11
-
12
- # Docker
13
- docker-compose.yml
14
- Dockerfile
15
- .docker
16
- .dockerignore
17
-
18
- # Byte-compiled / optimized / DLL files
19
- **/__pycache__/
20
- **/*.py[cod]
21
-
22
- # C extensions
23
- *.so
24
-
25
- # Distribution / packaging
26
- .Python
27
- env/
28
- build/
29
- develop-eggs/
30
- dist/
31
- downloads/
32
- eggs/
33
- lib/
34
- lib64/
35
- parts/
36
- sdist/
37
- var/
38
- *.egg-info/
39
- .installed.cfg
40
- *.egg
41
-
42
- # PyInstaller
43
- # Usually these files are written by a python script from a template
44
- # before PyInstaller builds the exe, so as to inject date/other infos into it.
45
- *.manifest
46
- *.spec
47
-
48
- # Installer logs
49
- pip-log.txt
50
- pip-delete-this-directory.txt
51
-
52
- # Unit test / coverage reports
53
- htmlcov/
54
- .tox/
55
- .coverage
56
- .cache
57
- nosetests.xml
58
- coverage.xml
59
-
60
- # Translations
61
- *.mo
62
- *.pot
63
-
64
- # Django stuff:
65
- *.log
66
-
67
- # Sphinx documentation
68
- docs/_build/
69
-
70
- # PyBuilder
71
- target/
72
-
73
- # Virtual environment
74
- .env
75
- .venv/
76
- venv/
77
-
78
- # PyCharm
79
- .idea
80
-
81
- # Python mode for VIM
82
- .ropeproject
83
- **/.ropeproject
84
-
85
- # Vim swap files
86
- **/*.swp
87
-
88
- # VS Code
89
- .vscode/
90
-
91
- *.md
92
- **/.ruff_cache
93
- **/cahangelog
94
- **/tests
@@ -1,15 +0,0 @@
1
- FROM python:3.11-slim-buster
2
-
3
- ENV LIBRDKAFKA_VERSION 1.9.2
4
-
5
- WORKDIR /app
6
-
7
- RUN apt update && \
8
- apt install -y wget make g++ libssl-dev autoconf automake libtool curl librdkafka-dev && \
9
- apt-get clean
10
-
11
- COPY . /app
12
-
13
- RUN export POETRY_VIRTUALENVS_CREATE=false && make install/prod && pip cache purge
14
-
15
- ENTRYPOINT ocean sail
@@ -1,17 +0,0 @@
1
- {{ "# This is an example configuration file for the integration service." }}
2
- {{ "# Please copy this file to config.yaml file in the integration folder and edit it to your needs." }}
3
-
4
- port:
5
- clientId: "{{ '{{' }} from env PORT_CLIENT_ID {{ '}}' }}" {{ "# Can be loaded via environment variable: PORT_CLIENT_ID" }}
6
- clientSecret: "{{ '{{' }} from env PORT_CLIENT_SECRET {{ '}}' }}" {{ "# Can be loaded via environment variable: PORT_CLIENT_SECRET" }}
7
- {{ "# The event listener to use for the integration service." }}
8
- eventListener:
9
- type: KAFKA
10
- integration:
11
- {{ "# The identifier of this integration instance." }}
12
- identifier: "{{ '{{' }} from env INTEGRATION_IDENTIFIER {{ '}}' }}"
13
- {{ "# The type of the integration." }}
14
- type: "My Integration type (Gitlab, Jira, etc.)"
15
- config:
16
- myGitToken: "{{ '{{' }} from env MY_GIT_TOKEN {{ '}}' }}"
17
- someApplicationUrl: "https://I-Am-Not-A-Real-Url.com"
@@ -1,40 +0,0 @@
1
- import asyncio
2
-
3
- from port_ocean.clients.port.client import PortClient
4
- from port_ocean.core.handlers.entities_state_applier.port.get_related_entities import (
5
- get_related_entities,
6
- )
7
- from port_ocean.core.handlers.entity_processor.base import EntityPortDiff
8
- from port_ocean.core.utils import is_same_entity
9
- from port_ocean.exceptions.core import RelationValidationException
10
-
11
-
12
- async def validate_entity_relations(
13
- diff: EntityPortDiff, port_client: PortClient
14
- ) -> None:
15
- modified_or_created_entities = diff.modified + diff.created
16
- related_entities = await get_related_entities(
17
- modified_or_created_entities, port_client
18
- )
19
-
20
- required_entities = []
21
-
22
- for entity in related_entities:
23
- if any(is_same_entity(item, entity) for item in diff.deleted):
24
- raise RelationValidationException(
25
- f"Cant delete entity {entity} of blueprint {entity.blueprint} "
26
- f"because it was specified as relation target of entity {entity} "
27
- f"of blueprint {entity.blueprint}"
28
- )
29
-
30
- if not any(
31
- is_same_entity(item, entity) for item in modified_or_created_entities
32
- ):
33
- required_entities.append(entity)
34
-
35
- await asyncio.gather(
36
- *(
37
- port_client.validate_entity_exist(item.identifier, item.blueprint)
38
- for item in required_entities
39
- )
40
- )
port_ocean/core/utils.py DELETED
@@ -1,65 +0,0 @@
1
- from typing import Iterable, Any, TypeVar
2
-
3
- from pydantic import parse_obj_as, ValidationError
4
-
5
- from port_ocean.core.handlers.entity_processor.base import EntityPortDiff
6
- from port_ocean.core.models import Entity
7
- from port_ocean.core.ocean_types import RAW_RESULT
8
- from port_ocean.exceptions.core import RawObjectValidationException
9
-
10
- T = TypeVar("T", bound=tuple[list[Any], ...])
11
-
12
-
13
- def zip_and_sum(collection: Iterable[T]) -> T:
14
- return tuple(sum(items, []) for items in zip(*collection)) # type: ignore
15
-
16
-
17
- def validate_result(result: Any) -> RAW_RESULT:
18
- try:
19
- return parse_obj_as(list[dict[str, Any]], result)
20
- except ValidationError as e:
21
- raise RawObjectValidationException(f"Expected list[dict[str, Any]], Error: {e}")
22
-
23
-
24
- def is_same_entity(first_entity: Entity, second_entity: Entity) -> bool:
25
- return (
26
- first_entity.identifier == second_entity.identifier
27
- and first_entity.blueprint == second_entity.blueprint
28
- )
29
-
30
-
31
- def get_unique(array: list[Entity]) -> list[Entity]:
32
- result: list[Entity] = []
33
- for item in array:
34
- if all(not is_same_entity(item, seen_item) for seen_item in result):
35
- result.append(item)
36
- return result
37
-
38
-
39
- def get_port_diff(
40
- before: Iterable[Entity],
41
- after: Iterable[Entity],
42
- ) -> EntityPortDiff:
43
- return EntityPortDiff(
44
- deleted=get_unique(
45
- [
46
- item
47
- for item in before
48
- if not any(is_same_entity(item, item_after) for item_after in after)
49
- ],
50
- ),
51
- created=get_unique(
52
- [
53
- item
54
- for item in after
55
- if not any(is_same_entity(item, item_before) for item_before in before)
56
- ],
57
- ),
58
- modified=get_unique(
59
- [
60
- item
61
- for item in after
62
- if any(is_same_entity(item, item_before) for item_before in before)
63
- ],
64
- ),
65
- )