hooksniff-python 0.4.1__tar.gz → 0.4.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hooksniff-python
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Official HookSniff SDK for Python - Webhook infrastructure for developers
5
5
  Project-URL: Homepage, https://hooksniff.vercel.app
6
6
  Project-URL: Repository, https://github.com/servetarslan02/hooksniff-python
@@ -28,13 +28,13 @@ Official Python SDK for [HookSniff](https://hooksniff.vercel.app) — the webhoo
28
28
  ## Installation
29
29
 
30
30
  ```bash
31
- pip install hooksniff
31
+ pip install hooksniff-python
32
32
  ```
33
33
 
34
34
  ## Quick Start
35
35
 
36
36
  ```python
37
- from hooksniff import HookSniff
37
+ from hooksniff_python import HookSniff
38
38
 
39
39
  hs = HookSniff("hr_live_...")
40
40
 
@@ -156,7 +156,7 @@ delivery = hs.webhook.replay("msg_123")
156
156
  ### Webhook Verification
157
157
 
158
158
  ```python
159
- from hooksniff import Webhook, WebhookVerificationError
159
+ from hooksniff_python import Webhook, WebhookVerificationError
160
160
 
161
161
  wh = Webhook("whsec_...")
162
162
 
@@ -173,7 +173,7 @@ def handle_webhook(request):
173
173
  ### Error Handling
174
174
 
175
175
  ```python
176
- from hooksniff import AuthenticationError, NotFoundError, RateLimitError
176
+ from hooksniff_python import AuthenticationError, NotFoundError, RateLimitError
177
177
 
178
178
  try:
179
179
  hs.endpoint.get("invalid_id")
@@ -5,13 +5,13 @@ Official Python SDK for [HookSniff](https://hooksniff.vercel.app) — the webhoo
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- pip install hooksniff
8
+ pip install hooksniff-python
9
9
  ```
10
10
 
11
11
  ## Quick Start
12
12
 
13
13
  ```python
14
- from hooksniff import HookSniff
14
+ from hooksniff_python import HookSniff
15
15
 
16
16
  hs = HookSniff("hr_live_...")
17
17
 
@@ -133,7 +133,7 @@ delivery = hs.webhook.replay("msg_123")
133
133
  ### Webhook Verification
134
134
 
135
135
  ```python
136
- from hooksniff import Webhook, WebhookVerificationError
136
+ from hooksniff_python import Webhook, WebhookVerificationError
137
137
 
138
138
  wh = Webhook("whsec_...")
139
139
 
@@ -150,7 +150,7 @@ def handle_webhook(request):
150
150
  ### Error Handling
151
151
 
152
152
  ```python
153
- from hooksniff import AuthenticationError, NotFoundError, RateLimitError
153
+ from hooksniff_python import AuthenticationError, NotFoundError, RateLimitError
154
154
 
155
155
  try:
156
156
  hs.endpoint.get("invalid_id")
@@ -23,6 +23,8 @@ Usage:
23
23
  from typing import Any, Dict
24
24
  from .http_client import HttpClient
25
25
  from .resources import (
26
+ BroadcastResource,
27
+ TransformResource,
26
28
  ApplicationResource,
27
29
  EndpointResource,
28
30
  WebhookResource,
@@ -102,6 +104,8 @@ class HookSniff:
102
104
  self.sso = SsoResource(self.http)
103
105
  self.custom_domain = CustomDomainResource(self.http)
104
106
  self.environment = EnvironmentResource(self.http)
107
+ self.broadcast = BroadcastResource(self.http)
108
+ self.transform = TransformResource(self.http)
105
109
 
106
110
  def me(self) -> Dict[str, Any]:
107
111
  """Get current user profile."""
@@ -408,3 +408,43 @@ class EnvironmentResource:
408
408
 
409
409
  def list(self) -> List[Dict[str, Any]]:
410
410
  return self.http.request("GET", "/v1/environments")
411
+
412
+
413
+ class BroadcastResource:
414
+ def __init__(self, http: HttpClient):
415
+ self.http = http
416
+
417
+ def list(self) -> List[Dict[str, Any]]:
418
+ return self.http.request("GET", "/v1/broadcasts")
419
+
420
+ def create(self, title: str, message: str, scheduled_at: str = None) -> Dict[str, Any]:
421
+ body = {"title": title, "message": message}
422
+ if scheduled_at:
423
+ body["scheduled_at"] = scheduled_at
424
+ return self.http.request("POST", "/v1/broadcasts", body)
425
+
426
+ def get(self, broadcast_id: str) -> Dict[str, Any]:
427
+ return self.http.request("GET", f"/v1/broadcasts/{broadcast_id}")
428
+
429
+ def delete(self, broadcast_id: str) -> None:
430
+ self.http.request("DELETE", f"/v1/broadcasts/{broadcast_id}")
431
+
432
+ def send(self, broadcast_id: str) -> None:
433
+ self.http.request("POST", f"/v1/broadcasts/{broadcast_id}/send")
434
+
435
+
436
+ class TransformResource:
437
+ def __init__(self, http: HttpClient):
438
+ self.http = http
439
+
440
+ def list(self, endpoint_id: str) -> List[Dict[str, Any]]:
441
+ return self.http.request("GET", f"/v1/endpoints/{endpoint_id}/transforms")
442
+
443
+ def create(self, endpoint_id: str, name: str, code: str) -> Dict[str, Any]:
444
+ return self.http.request("POST", f"/v1/endpoints/{endpoint_id}/transforms", {"name": name, "code": code})
445
+
446
+ def get(self, endpoint_id: str, transform_id: str) -> Dict[str, Any]:
447
+ return self.http.request("GET", f"/v1/endpoints/{endpoint_id}/transforms/{transform_id}")
448
+
449
+ def delete(self, endpoint_id: str, transform_id: str) -> None:
450
+ self.http.request("DELETE", f"/v1/endpoints/{endpoint_id}/transforms/{transform_id}")
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hooksniff-python"
7
- version = "0.4.1"
7
+ version = "0.4.2"
8
8
  description = "Official HookSniff SDK for Python - Webhook infrastructure for developers"
9
9
  readme = "README.md"
10
10
  license = "MIT"