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

@@ -68,7 +68,7 @@ async def _initialize_required_integration_settings(
68
68
  )
69
69
  integration = await port_client.create_integration(
70
70
  integration_config.integration.type,
71
- integration_config.event_listener.to_request(),
71
+ integration_config.event_listener.get_changelog_destination_details(),
72
72
  port_app_config=default_mapping,
73
73
  )
74
74
  elif not integration.get("config"):
@@ -77,7 +77,7 @@ async def _initialize_required_integration_settings(
77
77
  )
78
78
  integration = await port_client.patch_integration(
79
79
  integration_config.integration.type,
80
- integration_config.event_listener.to_request(),
80
+ integration_config.event_listener.get_changelog_destination_details(),
81
81
  port_app_config=default_mapping,
82
82
  )
83
83
  except httpx.HTTPStatusError as err:
@@ -85,8 +85,10 @@ async def _initialize_required_integration_settings(
85
85
  raise err
86
86
 
87
87
  logger.info("Checking for diff in integration configuration")
88
- changelog_destination = integration_config.event_listener.to_request().get(
89
- "changelog_destination"
88
+ changelog_destination = (
89
+ integration_config.event_listener.get_changelog_destination_details().get(
90
+ "changelog_destination"
91
+ )
90
92
  )
91
93
  if (
92
94
  integration.get("changelogDestination") != changelog_destination
@@ -78,8 +78,16 @@ class EventListenerSettings(BaseOceanModel, extra=Extra.allow):
78
78
  type: str
79
79
  should_resync: bool = True
80
80
 
81
- def to_request(self) -> dict[str, Any]:
81
+ def get_changelog_destination_details(self) -> dict[str, Any]:
82
82
  """
83
- Converts the Settings object to a dictionary representation (request format).
83
+ Returns the changelog destination configuration for the event listener.
84
+ By default, returns an empty dict. Only KAFKA and WEBHOOK event listeners need to override this
85
+ to provide their specific changelog destination details.
86
+
87
+ Returns:
88
+ dict[str, Any]: The changelog destination configuration. For example:
89
+ - KAFKA returns {"type": "KAFKA"}
90
+ - WEBHOOK returns {"type": "WEBHOOK", "url": "https://example.com/resync"}
91
+ - Other event listeners return {}
84
92
  """
85
- return {"type": self.type}
93
+ return {}
@@ -27,9 +27,17 @@ class HttpEventListenerSettings(EventListenerSettings):
27
27
  type: Literal["WEBHOOK"]
28
28
  app_host: AnyHttpUrl = Field(..., sensitive=True)
29
29
 
30
- def to_request(self) -> dict[str, Any]:
30
+ def get_changelog_destination_details(self) -> dict[str, Any]:
31
+ """
32
+ Returns the changelog destination configuration for the webhook event listener.
33
+ For webhook event listeners, this specifies the URL where changelog events should be sent.
34
+
35
+ Returns:
36
+ dict[str, Any]: A dictionary with the webhook URL where changelog events should be sent,
37
+ constructed by appending "/resync" to the app_host.
38
+ """
31
39
  return {
32
- **super().to_request(),
40
+ "type": self.type,
33
41
  "url": self.app_host + "/resync",
34
42
  }
35
43
 
@@ -46,6 +46,19 @@ class KafkaEventListenerSettings(EventListenerSettings):
46
46
  kafka_security_enabled: bool = True
47
47
  consumer_poll_timeout: int = 1
48
48
 
49
+ def get_changelog_destination_details(self) -> dict[str, Any]:
50
+ """
51
+ Returns the changelog destination configuration for the Kafka event listener.
52
+ For Kafka event listeners, this specifies that changelog events should be sent via Kafka.
53
+
54
+ Returns:
55
+ dict[str, Any]: A dictionary with type "KAFKA" to indicate that changelog events
56
+ should be sent through the Kafka message bus.
57
+ """
58
+ return {
59
+ "type": self.type,
60
+ }
61
+
49
62
 
50
63
  class KafkaEventListener(BaseEventListener):
51
64
  """
@@ -23,9 +23,6 @@ class OnceEventListenerSettings(EventListenerSettings):
23
23
 
24
24
  type: Literal["ONCE"]
25
25
 
26
- def to_request(self) -> dict[str, Any]:
27
- return {}
28
-
29
26
 
30
27
  class OnceEventListener(BaseEventListener):
31
28
  """
@@ -27,9 +27,6 @@ class PollingEventListenerSettings(EventListenerSettings):
27
27
  resync_on_start: bool = True
28
28
  interval: int = 60
29
29
 
30
- def to_request(self) -> dict[str, Any]:
31
- return {}
32
-
33
30
 
34
31
  class PollingEventListener(BaseEventListener):
35
32
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.17.6
3
+ Version: 0.17.7
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
@@ -69,14 +69,14 @@ port_ocean/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
69
  port_ocean/core/defaults/__init__.py,sha256=8qCZg8n06WAdMu9s_FiRtDYLGPGHbOuS60vapeUoAks,142
70
70
  port_ocean/core/defaults/clean.py,sha256=TOVe5b5FAjFspAkQuKA70k2BClCEFbrQ3xgiAoKXKYE,2427
71
71
  port_ocean/core/defaults/common.py,sha256=zJsj7jvlqIMLGXhdASUlbKS8GIAf-FDKKB0O7jB6nx0,4166
72
- port_ocean/core/defaults/initialize.py,sha256=eX5AMo3fug202lHvnwwGAuYlVbh3yDvUQaimTzre1do,8477
72
+ port_ocean/core/defaults/initialize.py,sha256=PVR0awQc0eFKKD5wldMpqg5IKtfc8llreZ1FDN3cCIE,8570
73
73
  port_ocean/core/event_listener/__init__.py,sha256=T3E52MKs79fNEW381p7zU9F2vOMvIiiTYWlqRUqnsg0,1135
74
- port_ocean/core/event_listener/base.py,sha256=dZjz4y8PtiTJAU2fNbvUO7ibHY8mVIgwLUKC9_ydUJ4,2387
74
+ port_ocean/core/event_listener/base.py,sha256=VdIdp7RLOSxH3ICyV-wCD3NiJoUzsh2KkJ0a9B29GeI,2847
75
75
  port_ocean/core/event_listener/factory.py,sha256=M4Qi05pI840sjDIbdjUEgYe9Gp5ckoCkX-KgLBxUpZg,4096
76
- port_ocean/core/event_listener/http.py,sha256=N8HrfFqR3KGKz96pWdp_pP-m30jGtcz_1CkijovkBN8,2565
77
- port_ocean/core/event_listener/kafka.py,sha256=ulidnp4sz-chXwHsbH9JayVjcxy_mG6ts_Im3YKmLpI,6983
78
- port_ocean/core/event_listener/once.py,sha256=iL3NkujZOw-7LpxT-EAUJUcAuiAZPm4ZzjHTSt9EdHs,5918
79
- port_ocean/core/event_listener/polling.py,sha256=d9E3oRLy-Ogb0oadZNxSDgSLIHe4z92uMVwztscZycg,3667
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
80
  port_ocean/core/event_listener/webhooks_only.py,sha256=PTWnmbLtbJb3ySfotMpTWMYgDVy9zOSYIIGqNbWK0UU,1214
81
81
  port_ocean/core/handlers/__init__.py,sha256=d7ShmS90gLRzGKJA6oNy2Zs_dF2yjkmYZInRhBnO9Rw,572
82
82
  port_ocean/core/handlers/base.py,sha256=cTarblazu8yh8xz2FpB-dzDKuXxtoi143XJgPbV_DcM,157
@@ -157,8 +157,8 @@ port_ocean/utils/repeat.py,sha256=0EFWM9d8lLXAhZmAyczY20LAnijw6UbIECf5lpGbOas,32
157
157
  port_ocean/utils/signal.py,sha256=K-6kKFQTltcmKDhtyZAcn0IMa3sUpOHGOAUdWKgx0_E,1369
158
158
  port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
159
159
  port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
160
- port_ocean-0.17.6.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
161
- port_ocean-0.17.6.dist-info/METADATA,sha256=TKcBAHIAELisX7FYMubFZq5aXplH-eCuMbH6q0r2kU4,6673
162
- port_ocean-0.17.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
163
- port_ocean-0.17.6.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
164
- port_ocean-0.17.6.dist-info/RECORD,,
160
+ port_ocean-0.17.7.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
161
+ port_ocean-0.17.7.dist-info/METADATA,sha256=nwTcJ2J0x9KUU05CfuuvE8DtMN2DmX1JfQr7Y4_hzOE,6673
162
+ port_ocean-0.17.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
163
+ port_ocean-0.17.7.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
164
+ port_ocean-0.17.7.dist-info/RECORD,,