reconify-python 0.1.0__py3-none-any.whl → 2.0.0__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.
reconify/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Typed clients for the Reconify Public API."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "1.0.0"
4
4
 
5
5
  from .client import AsyncReconify, Reconify
6
6
  from .errors import (
reconify/client.py CHANGED
@@ -9,52 +9,35 @@ from typing import Any
9
9
  import httpx
10
10
 
11
11
  from .errors import ReconifyValidationError
12
- from .pagination import (
13
- aiter_cursor_pages,
14
- aiter_offset_pages,
15
- iter_cursor_pages,
16
- iter_offset_pages,
17
- )
12
+ from .pagination import aiter_cursor_pages, iter_cursor_pages
18
13
  from .resources import (
19
14
  ASYNC_RESOURCE_CLASSES,
20
15
  SYNC_RESOURCE_CLASSES,
21
- Alerts,
22
- AsyncAlerts,
23
16
  AsyncEvents,
24
17
  AsyncIngestion,
25
18
  AsyncIssues,
26
- AsyncLedger,
27
- AsyncReconciliations,
28
- AsyncSearch,
29
- AsyncSetup,
30
- AsyncTransactions,
31
- AsyncWallets,
19
+ AsyncMetadata,
20
+ AsyncOrganization,
32
21
  Events,
33
22
  Ingestion,
34
23
  Issues,
35
- Ledger,
36
- Reconciliations,
37
- Search,
38
- Setup,
39
- Transactions,
40
- Wallets,
24
+ Metadata,
25
+ Organization,
41
26
  )
42
27
  from .transport import AsyncTransport, RetryConfig, SyncTransport
43
28
 
44
- DEFAULT_BASE_URL = "https://api.reconifyhq.com/v1"
29
+ DEFAULT_BASE_URL = "https://api.reconifyhq.com/v2"
45
30
 
46
31
 
47
32
  def _normalize_base_url(base_url: str | None) -> str:
48
33
  value = (base_url or os.getenv("RECONIFY_API_URL") or DEFAULT_BASE_URL).rstrip("/")
49
- return value if value.endswith("/v1") else f"{value}/v1"
34
+ return value if value.endswith("/v2") else f"{value}/v2"
50
35
 
51
36
 
52
37
  def _api_key(api_key: str | None) -> str:
53
38
  value = api_key or os.getenv("RECONIFY_API_KEY")
54
39
  if not value:
55
- raise ReconifyValidationError("An API key is required")
56
- if value.startswith("sk_live_"):
57
- raise ReconifyValidationError("Legacy sk_live_ keys are not supported; use an rk_ key")
40
+ raise ReconifyValidationError("An API key is required; set api_key or RECONIFY_API_KEY")
58
41
  if not value.startswith("rk_"):
59
42
  raise ReconifyValidationError("Reconify public API keys must start with rk_")
60
43
  return value
@@ -63,16 +46,11 @@ def _api_key(api_key: str | None) -> str:
63
46
  class Reconify:
64
47
  """Synchronous typed Reconify API client."""
65
48
 
66
- alerts: Alerts
49
+ metadata: Metadata
67
50
  events: Events
68
51
  ingestion: Ingestion
69
52
  issues: Issues
70
- ledger: Ledger
71
- reconciliations: Reconciliations
72
- search: Search
73
- setup: Setup
74
- transactions: Transactions
75
- wallets: Wallets
53
+ organization: Organization
76
54
 
77
55
  def __init__(
78
56
  self,
@@ -114,67 +92,22 @@ class Reconify:
114
92
  lambda params: self.issues.list_issues(**params), item_field="issues", query=query
115
93
  )
116
94
 
117
- def iter_ledger_sources(self, **query: Any) -> Iterator[Any]:
118
- return iter_offset_pages(
119
- lambda params: self.ledger.list_ledger_sources(**params),
120
- item_field="sources",
121
- query=query,
122
- )
123
-
124
- def iter_ledger_transactions(self, source_id: str, **query: Any) -> Iterator[Any]:
125
- return iter_offset_pages(
126
- lambda params: self.ledger.list_transactions(source_id, **params),
127
- item_field="transactions",
128
- query=query,
129
- )
130
-
131
- def iter_reconciliation_schedules(self, **query: Any) -> Iterator[Any]:
132
- return iter_offset_pages(
133
- lambda params: self.reconciliations.list_reconciliation_schedules(**params),
134
- item_field="schedules",
135
- query=query,
136
- )
137
-
138
- def iter_reconciliations(self, **query: Any) -> Iterator[Any]:
139
- return iter_offset_pages(
140
- lambda params: self.reconciliations.list_reconciliations(**params),
141
- item_field="reconciliations",
142
- query=query,
143
- )
144
-
145
- def iter_setup_sources(self, **query: Any) -> Iterator[Any]:
146
- return iter_offset_pages(
147
- lambda params: self.setup.list_setup_sources(**params),
148
- item_field="sources",
149
- query=query,
150
- )
151
-
152
- def iter_wallet_transactions(self, **query: Any) -> Iterator[Any]:
95
+ def iter_issue_events(self, issue_id: str, **query: Any) -> Iterator[Any]:
153
96
  return iter_cursor_pages(
154
- lambda params: self.transactions.list_wallet_transactions(**params),
155
- item_field="transactions",
97
+ lambda params: self.events.list_issue_events(issue_id, **params),
98
+ item_field="events",
156
99
  query=query,
157
100
  )
158
101
 
159
- def iter_wallets(self, **query: Any) -> Iterator[Any]:
160
- return iter_offset_pages(
161
- lambda params: self.wallets.list_wallets(**params), item_field="wallets", query=query
162
- )
163
-
164
102
 
165
103
  class AsyncReconify:
166
104
  """Asynchronous typed Reconify API client."""
167
105
 
168
- alerts: AsyncAlerts
106
+ metadata: AsyncMetadata
169
107
  events: AsyncEvents
170
108
  ingestion: AsyncIngestion
171
109
  issues: AsyncIssues
172
- ledger: AsyncLedger
173
- reconciliations: AsyncReconciliations
174
- search: AsyncSearch
175
- setup: AsyncSetup
176
- transactions: AsyncTransactions
177
- wallets: AsyncWallets
110
+ organization: AsyncOrganization
178
111
 
179
112
  def __init__(
180
113
  self,
@@ -216,49 +149,9 @@ class AsyncReconify:
216
149
  lambda params: self.issues.list_issues(**params), item_field="issues", query=query
217
150
  )
218
151
 
219
- def iter_ledger_sources(self, **query: Any) -> AsyncIterator[Any]:
220
- return aiter_offset_pages(
221
- lambda params: self.ledger.list_ledger_sources(**params),
222
- item_field="sources",
223
- query=query,
224
- )
225
-
226
- def iter_ledger_transactions(self, source_id: str, **query: Any) -> AsyncIterator[Any]:
227
- return aiter_offset_pages(
228
- lambda params: self.ledger.list_transactions(source_id, **params),
229
- item_field="transactions",
230
- query=query,
231
- )
232
-
233
- def iter_reconciliation_schedules(self, **query: Any) -> AsyncIterator[Any]:
234
- return aiter_offset_pages(
235
- lambda params: self.reconciliations.list_reconciliation_schedules(**params),
236
- item_field="schedules",
237
- query=query,
238
- )
239
-
240
- def iter_reconciliations(self, **query: Any) -> AsyncIterator[Any]:
241
- return aiter_offset_pages(
242
- lambda params: self.reconciliations.list_reconciliations(**params),
243
- item_field="reconciliations",
244
- query=query,
245
- )
246
-
247
- def iter_setup_sources(self, **query: Any) -> AsyncIterator[Any]:
248
- return aiter_offset_pages(
249
- lambda params: self.setup.list_setup_sources(**params),
250
- item_field="sources",
251
- query=query,
252
- )
253
-
254
- def iter_wallet_transactions(self, **query: Any) -> AsyncIterator[Any]:
152
+ def iter_issue_events(self, issue_id: str, **query: Any) -> AsyncIterator[Any]:
255
153
  return aiter_cursor_pages(
256
- lambda params: self.transactions.list_wallet_transactions(**params),
257
- item_field="transactions",
154
+ lambda params: self.events.list_issue_events(issue_id, **params),
155
+ item_field="events",
258
156
  query=query,
259
157
  )
260
-
261
- def iter_wallets(self, **query: Any) -> AsyncIterator[Any]:
262
- return aiter_offset_pages(
263
- lambda params: self.wallets.list_wallets(**params), item_field="wallets", query=query
264
- )