Skip to content

Commit 41510ca

Browse files
authored
feat: add setSelectedGraph and mark selectGraph deprecated (#238)
## Summary Regenerated from robosystems#1706, which adds `PUT /v1/user/selected-graph` under the User tag and deprecates `POST /v1/graphs/{graph_id}/select`. Until that server change is deployed the new call answers 404; nothing in this package calls it. ## Changes - **Generated `api/` and `models/`** — new `api.user.set_selected_graph` (sync and async, detailed and plain) with `SetSelectedGraphRequest`; `api.graphs.select_graph` now carries the deprecation note. The drift swept up since the last regeneration is docstring-only: the `from_sequence` replay semantics on `stream_operation_events`, the per-entry QuickBooks write-back description on `execute_event_block` and its request model, and three new blocker codes listed on `FiscalCalendarResponse`. - **GraphQL schema snapshot** — the same blocker-code description line. No type changed, so the ariadne-generated models are untouched. - Facades untouched. ## Compatibility ADDITIVE ## Testing - `just test-all`: 654 passed, 17 skipped; ruff, format and basedpyright clean. - Generated against the local stack serving robosystems#1706, after confirming `origin/main` differed from that branch only by the Grafana dashboard JSON. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents dc50d89 + 33368dc commit 41510ca

9 files changed

Lines changed: 357 additions & 55 deletions

File tree

‎robosystems_client/api/graphs/select_graph.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ def sync_detailed(
9393
) -> Response[ErrorResponse | HTTPValidationError | SuccessResponse]:
9494
"""Select Graph
9595
96+
Deprecated: use `PUT /v1/user/selected-graph`, which writes the same selection. Remembers the graph
97+
as the caller's current one.
98+
9699
Args:
97100
graph_id (str):
98101
@@ -122,6 +125,9 @@ def sync(
122125
) -> ErrorResponse | HTTPValidationError | SuccessResponse | None:
123126
"""Select Graph
124127
128+
Deprecated: use `PUT /v1/user/selected-graph`, which writes the same selection. Remembers the graph
129+
as the caller's current one.
130+
125131
Args:
126132
graph_id (str):
127133
@@ -146,6 +152,9 @@ async def asyncio_detailed(
146152
) -> Response[ErrorResponse | HTTPValidationError | SuccessResponse]:
147153
"""Select Graph
148154
155+
Deprecated: use `PUT /v1/user/selected-graph`, which writes the same selection. Remembers the graph
156+
as the caller's current one.
157+
149158
Args:
150159
graph_id (str):
151160
@@ -173,6 +182,9 @@ async def asyncio(
173182
) -> ErrorResponse | HTTPValidationError | SuccessResponse | None:
174183
"""Select Graph
175184
185+
Deprecated: use `PUT /v1/user/selected-graph`, which writes the same selection. Remembers the graph
186+
as the caller's current one.
187+
176188
Args:
177189
graph_id (str):
178190

‎robosystems_client/api/operations/stream_operation_events.py‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ def sync_detailed(
121121
122122
Args:
123123
operation_id (str): Operation identifier from initial submission
124-
from_sequence (int | Unset): Start streaming from this sequence number (0 = from
125-
beginning) Default: 0.
124+
from_sequence (int | Unset): Replay stored events from this sequence number, then stream
125+
live ones. A running operation replays nothing at 0 (live events only); a settled one
126+
replays its history from here (0 = all) and closes. Default: 0.
126127
token (None | str | Unset): JWT token for SSE authentication
127128
authorization (None | str | Unset):
128129
@@ -163,8 +164,9 @@ def sync(
163164
164165
Args:
165166
operation_id (str): Operation identifier from initial submission
166-
from_sequence (int | Unset): Start streaming from this sequence number (0 = from
167-
beginning) Default: 0.
167+
from_sequence (int | Unset): Replay stored events from this sequence number, then stream
168+
live ones. A running operation replays nothing at 0 (live events only); a settled one
169+
replays its history from here (0 = all) and closes. Default: 0.
168170
token (None | str | Unset): JWT token for SSE authentication
169171
authorization (None | str | Unset):
170172
@@ -200,8 +202,9 @@ async def asyncio_detailed(
200202
201203
Args:
202204
operation_id (str): Operation identifier from initial submission
203-
from_sequence (int | Unset): Start streaming from this sequence number (0 = from
204-
beginning) Default: 0.
205+
from_sequence (int | Unset): Replay stored events from this sequence number, then stream
206+
live ones. A running operation replays nothing at 0 (live events only); a settled one
207+
replays its history from here (0 = all) and closes. Default: 0.
205208
token (None | str | Unset): JWT token for SSE authentication
206209
authorization (None | str | Unset):
207210
@@ -240,8 +243,9 @@ async def asyncio(
240243
241244
Args:
242245
operation_id (str): Operation identifier from initial submission
243-
from_sequence (int | Unset): Start streaming from this sequence number (0 = from
244-
beginning) Default: 0.
246+
from_sequence (int | Unset): Replay stored events from this sequence number, then stream
247+
live ones. A running operation replays nothing at 0 (live events only); a settled one
248+
replays its history from here (0 = all) and closes. Default: 0.
245249
token (None | str | Unset): JWT token for SSE authentication
246250
authorization (None | str | Unset):
247251

‎robosystems_client/api/robo_ledger_ledger_events/execute_event_block.py‎

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ def sync_detailed(
113113
) -> Response[ErrorResponse | OperationEnvelopeExecuteEventBlockResponse]:
114114
"""Execute Event Block
115115
116-
For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the captured GL
117-
plan to the source-of-truth system (QuickBooks). Captures qb_txn_id on
118-
event.metadata.qb_external_id, transitions status to 'fulfilled' (or 'pending' on rejection), and
119-
promotes draft GL rows to 'posted'. Native-policy events fast-path through with no QB write —
120-
RoboSystems is the system of record.
116+
For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the event's
117+
draft GL entries to the source-of-truth system (QuickBooks), each as its own JournalEntry. Records
118+
the QuickBooks ids per entry on event.metadata.qb_entry_ids and promotes the published entries to
119+
'posted'; the event goes 'fulfilled' once no draft remains, or 'pending' on rejection (what landed
120+
is kept). Native-policy events fast-path through with no QB write — RoboSystems is the system of
121+
record.
121122
122123
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
123124
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -129,11 +130,12 @@ def sync_detailed(
129130
system.
130131
131132
For events on a connection with `write_policy='qb_authoritative'`
132-
(or `'hybrid'`), this triggers a synchronous write to QuickBooks
133-
via the QB API. The returned `qb_txn_id` lands on
134-
`event.metadata.qb_external_id` and the event transitions to
135-
`committed` (in flight) → `fulfilled` (QB accepted) or `pending`
136-
(QB rejected).
133+
(or `'hybrid'`), this triggers a synchronous write to QuickBooks:
134+
each draft entry posts as its own JournalEntry, with the entry id as
135+
the RequestId, and its QuickBooks id is recorded per entry on
136+
`event.metadata.qb_entry_ids`. The event goes `fulfilled` once no
137+
draft remains, or `pending` when QuickBooks rejects an entry (what
138+
landed is kept).
137139
138140
`'native'`-policy events fast-path through with no QB write —
139141
RoboSystems IS the source of truth, no outbound publish needed.
@@ -168,11 +170,12 @@ def sync(
168170
) -> ErrorResponse | OperationEnvelopeExecuteEventBlockResponse | None:
169171
"""Execute Event Block
170172
171-
For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the captured GL
172-
plan to the source-of-truth system (QuickBooks). Captures qb_txn_id on
173-
event.metadata.qb_external_id, transitions status to 'fulfilled' (or 'pending' on rejection), and
174-
promotes draft GL rows to 'posted'. Native-policy events fast-path through with no QB write —
175-
RoboSystems is the system of record.
173+
For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the event's
174+
draft GL entries to the source-of-truth system (QuickBooks), each as its own JournalEntry. Records
175+
the QuickBooks ids per entry on event.metadata.qb_entry_ids and promotes the published entries to
176+
'posted'; the event goes 'fulfilled' once no draft remains, or 'pending' on rejection (what landed
177+
is kept). Native-policy events fast-path through with no QB write — RoboSystems is the system of
178+
record.
176179
177180
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
178181
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -184,11 +187,12 @@ def sync(
184187
system.
185188
186189
For events on a connection with `write_policy='qb_authoritative'`
187-
(or `'hybrid'`), this triggers a synchronous write to QuickBooks
188-
via the QB API. The returned `qb_txn_id` lands on
189-
`event.metadata.qb_external_id` and the event transitions to
190-
`committed` (in flight) → `fulfilled` (QB accepted) or `pending`
191-
(QB rejected).
190+
(or `'hybrid'`), this triggers a synchronous write to QuickBooks:
191+
each draft entry posts as its own JournalEntry, with the entry id as
192+
the RequestId, and its QuickBooks id is recorded per entry on
193+
`event.metadata.qb_entry_ids`. The event goes `fulfilled` once no
194+
draft remains, or `pending` when QuickBooks rejects an entry (what
195+
landed is kept).
192196
193197
`'native'`-policy events fast-path through with no QB write —
194198
RoboSystems IS the source of truth, no outbound publish needed.
@@ -218,11 +222,12 @@ async def asyncio_detailed(
218222
) -> Response[ErrorResponse | OperationEnvelopeExecuteEventBlockResponse]:
219223
"""Execute Event Block
220224
221-
For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the captured GL
222-
plan to the source-of-truth system (QuickBooks). Captures qb_txn_id on
223-
event.metadata.qb_external_id, transitions status to 'fulfilled' (or 'pending' on rejection), and
224-
promotes draft GL rows to 'posted'. Native-policy events fast-path through with no QB write —
225-
RoboSystems is the system of record.
225+
For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the event's
226+
draft GL entries to the source-of-truth system (QuickBooks), each as its own JournalEntry. Records
227+
the QuickBooks ids per entry on event.metadata.qb_entry_ids and promotes the published entries to
228+
'posted'; the event goes 'fulfilled' once no draft remains, or 'pending' on rejection (what landed
229+
is kept). Native-policy events fast-path through with no QB write — RoboSystems is the system of
230+
record.
226231
227232
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
228233
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -234,11 +239,12 @@ async def asyncio_detailed(
234239
system.
235240
236241
For events on a connection with `write_policy='qb_authoritative'`
237-
(or `'hybrid'`), this triggers a synchronous write to QuickBooks
238-
via the QB API. The returned `qb_txn_id` lands on
239-
`event.metadata.qb_external_id` and the event transitions to
240-
`committed` (in flight) → `fulfilled` (QB accepted) or `pending`
241-
(QB rejected).
242+
(or `'hybrid'`), this triggers a synchronous write to QuickBooks:
243+
each draft entry posts as its own JournalEntry, with the entry id as
244+
the RequestId, and its QuickBooks id is recorded per entry on
245+
`event.metadata.qb_entry_ids`. The event goes `fulfilled` once no
246+
draft remains, or `pending` when QuickBooks rejects an entry (what
247+
landed is kept).
242248
243249
`'native'`-policy events fast-path through with no QB write —
244250
RoboSystems IS the source of truth, no outbound publish needed.
@@ -271,11 +277,12 @@ async def asyncio(
271277
) -> ErrorResponse | OperationEnvelopeExecuteEventBlockResponse | None:
272278
"""Execute Event Block
273279
274-
For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the captured GL
275-
plan to the source-of-truth system (QuickBooks). Captures qb_txn_id on
276-
event.metadata.qb_external_id, transitions status to 'fulfilled' (or 'pending' on rejection), and
277-
promotes draft GL rows to 'posted'. Native-policy events fast-path through with no QB write —
278-
RoboSystems is the system of record.
280+
For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the event's
281+
draft GL entries to the source-of-truth system (QuickBooks), each as its own JournalEntry. Records
282+
the QuickBooks ids per entry on event.metadata.qb_entry_ids and promotes the published entries to
283+
'posted'; the event goes 'fulfilled' once no draft remains, or 'pending' on rejection (what landed
284+
is kept). Native-policy events fast-path through with no QB write — RoboSystems is the system of
285+
record.
279286
280287
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
281288
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -287,11 +294,12 @@ async def asyncio(
287294
system.
288295
289296
For events on a connection with `write_policy='qb_authoritative'`
290-
(or `'hybrid'`), this triggers a synchronous write to QuickBooks
291-
via the QB API. The returned `qb_txn_id` lands on
292-
`event.metadata.qb_external_id` and the event transitions to
293-
`committed` (in flight) → `fulfilled` (QB accepted) or `pending`
294-
(QB rejected).
297+
(or `'hybrid'`), this triggers a synchronous write to QuickBooks:
298+
each draft entry posts as its own JournalEntry, with the entry id as
299+
the RequestId, and its QuickBooks id is recorded per entry on
300+
`event.metadata.qb_entry_ids`. The event goes `fulfilled` once no
301+
draft remains, or `pending` when QuickBooks rejects an entry (what
302+
landed is kept).
295303
296304
`'native'`-policy events fast-path through with no QB write —
297305
RoboSystems IS the source of truth, no outbound publish needed.

0 commit comments

Comments
 (0)