@robosystems/client 2.9.1 → 2.9.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robosystems/client",
3
- "version": "2.9.1",
3
+ "version": "2.9.2",
4
4
  "description": "TypeScript client library for the RoboSystems financial intelligence platform",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/sdk/sdk.gen.d.ts CHANGED
@@ -320,7 +320,7 @@ export declare const listConnections: <ThrowOnError extends boolean = false>(opt
320
320
  /**
321
321
  * Create Connection
322
322
  *
323
- * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) is refused (409) beside a live QuickBooks connection or on a graph with no chart of accounts.
323
+ * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) names the entity its accounts book to (`entity_id`, the group parent when omitted) and is refused (409) when that entity has no chart of accounts or is the one QuickBooks keeps; QuickBooks is refused (409) when the group parent's books are already native.
324
324
  */
325
325
  export declare const createConnection: <ThrowOnError extends boolean = false>(options: Options<CreateConnectionData, ThrowOnError>) => RequestResult<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError>;
326
326
  /**
@@ -352,7 +352,7 @@ export declare const syncConnection: <ThrowOnError extends boolean = false>(opti
352
352
  /**
353
353
  * Set Connection Write Policy
354
354
  *
355
- * Opt a connection into or out of outbound write-back. 'qb_authoritative' makes QuickBooks the source of truth — RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'native' keeps RoboSystems authoritative with no write-back. This is the explicit operator opt-in for writing to your books of record.
355
+ * Choose how a live connection and RoboSystems share the books. 'qb_authoritative', the default, makes QuickBooks the book of record: RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'shadow' keeps QuickBooks the book of record and writes nothing to it: the close posts nothing locally either, its drafts become shadowed expectations compared with what QuickBooks holds, and its gates are recorded as findings. 'native' is not a choice here: it is what disconnecting or severing leaves, books kept in RoboSystems with no connection to write to. This is the explicit operator opt-in for writing to your books of record.
356
356
  */
357
357
  export declare const setConnectionWritePolicy: <ThrowOnError extends boolean = false>(options: Options<SetConnectionWritePolicyData, ThrowOnError>) => RequestResult<SetConnectionWritePolicyResponses, SetConnectionWritePolicyErrors, ThrowOnError>;
358
358
  /**
@@ -1136,7 +1136,7 @@ export declare const setCloseTarget: <ThrowOnError extends boolean = false>(opti
1136
1136
  /**
1137
1137
  * Close Fiscal Period
1138
1138
  *
1139
- * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order).
1139
+ * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order). Under a QuickBooks connection whose write_policy is `shadow`, the close observes instead: nothing is written to QuickBooks or posted, the drafts become `shadowed` expectations (`entries_shadowed`), and the gates that would have blocked are returned as `gate_findings` rather than enforced.
1140
1140
  *
1141
1141
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1142
1142
  */
package/sdk/sdk.gen.js CHANGED
@@ -614,7 +614,7 @@ exports.listConnections = listConnections;
614
614
  /**
615
615
  * Create Connection
616
616
  *
617
- * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) is refused (409) beside a live QuickBooks connection or on a graph with no chart of accounts.
617
+ * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) names the entity its accounts book to (`entity_id`, the group parent when omitted) and is refused (409) when that entity has no chart of accounts or is the one QuickBooks keeps; QuickBooks is refused (409) when the group parent's books are already native.
618
618
  */
619
619
  const createConnection = (options) => (options.client ?? client_gen_1.client).post({
620
620
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -692,7 +692,7 @@ exports.syncConnection = syncConnection;
692
692
  /**
693
693
  * Set Connection Write Policy
694
694
  *
695
- * Opt a connection into or out of outbound write-back. 'qb_authoritative' makes QuickBooks the source of truth — RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'native' keeps RoboSystems authoritative with no write-back. This is the explicit operator opt-in for writing to your books of record.
695
+ * Choose how a live connection and RoboSystems share the books. 'qb_authoritative', the default, makes QuickBooks the book of record: RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'shadow' keeps QuickBooks the book of record and writes nothing to it: the close posts nothing locally either, its drafts become shadowed expectations compared with what QuickBooks holds, and its gates are recorded as findings. 'native' is not a choice here: it is what disconnecting or severing leaves, books kept in RoboSystems with no connection to write to. This is the explicit operator opt-in for writing to your books of record.
696
696
  */
697
697
  const setConnectionWritePolicy = (options) => (options.client ?? client_gen_1.client).put({
698
698
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2340,7 +2340,7 @@ exports.setCloseTarget = setCloseTarget;
2340
2340
  /**
2341
2341
  * Close Fiscal Period
2342
2342
  *
2343
- * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order).
2343
+ * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order). Under a QuickBooks connection whose write_policy is `shadow`, the close observes instead: nothing is written to QuickBooks or posted, the drafts become `shadowed` expectations (`entries_shadowed`), and the gates that would have blocked are returned as `gate_findings` rather than enforced.
2344
2344
  *
2345
2345
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2346
2346
  */
package/sdk/sdk.gen.ts CHANGED
@@ -625,7 +625,7 @@ export const listConnections = <ThrowOnError extends boolean = false>(options: O
625
625
  /**
626
626
  * Create Connection
627
627
  *
628
- * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) is refused (409) beside a live QuickBooks connection or on a graph with no chart of accounts.
628
+ * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) names the entity its accounts book to (`entity_id`, the group parent when omitted) and is refused (409) when that entity has no chart of accounts or is the one QuickBooks keeps; QuickBooks is refused (409) when the group parent's books are already native.
629
629
  */
630
630
  export const createConnection = <ThrowOnError extends boolean = false>(options: Options<CreateConnectionData, ThrowOnError>): RequestResult<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError> => (options.client ?? client).post<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError>({
631
631
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -703,7 +703,7 @@ export const syncConnection = <ThrowOnError extends boolean = false>(options: Op
703
703
  /**
704
704
  * Set Connection Write Policy
705
705
  *
706
- * Opt a connection into or out of outbound write-back. 'qb_authoritative' makes QuickBooks the source of truth — RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'native' keeps RoboSystems authoritative with no write-back. This is the explicit operator opt-in for writing to your books of record.
706
+ * Choose how a live connection and RoboSystems share the books. 'qb_authoritative', the default, makes QuickBooks the book of record: RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'shadow' keeps QuickBooks the book of record and writes nothing to it: the close posts nothing locally either, its drafts become shadowed expectations compared with what QuickBooks holds, and its gates are recorded as findings. 'native' is not a choice here: it is what disconnecting or severing leaves, books kept in RoboSystems with no connection to write to. This is the explicit operator opt-in for writing to your books of record.
707
707
  */
708
708
  export const setConnectionWritePolicy = <ThrowOnError extends boolean = false>(options: Options<SetConnectionWritePolicyData, ThrowOnError>): RequestResult<SetConnectionWritePolicyResponses, SetConnectionWritePolicyErrors, ThrowOnError> => (options.client ?? client).put<SetConnectionWritePolicyResponses, SetConnectionWritePolicyErrors, ThrowOnError>({
709
709
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2351,7 +2351,7 @@ export const setCloseTarget = <ThrowOnError extends boolean = false>(options: Op
2351
2351
  /**
2352
2352
  * Close Fiscal Period
2353
2353
  *
2354
- * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order).
2354
+ * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order). Under a QuickBooks connection whose write_policy is `shadow`, the close observes instead: nothing is written to QuickBooks or posted, the drafts become `shadowed` expectations (`entries_shadowed`), and the gates that would have blocked are returned as `gate_findings` rather than enforced.
2355
2355
  *
2356
2356
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2357
2357
  */
@@ -1738,6 +1738,32 @@ export type ClosePeriodResponse = {
1738
1738
  * Whether the close stamped the period's canonical statement FactSets (the close-time pivot). False when the tenant hasn't set up reporting yet — see statement_stamp_note.
1739
1739
  */
1740
1740
  statements_stamped?: boolean;
1741
+ /**
1742
+ * Shadow
1743
+ *
1744
+ * True when the close ran in shadow (the QuickBooks connection's write_policy is 'shadow'): nothing was written to QuickBooks, nothing posted, the in-window drafts were shadowed, and the gates that would have blocked the close are in gate_findings.
1745
+ */
1746
+ shadow?: boolean;
1747
+ /**
1748
+ * Entries Shadowed
1749
+ *
1750
+ * Drafts a shadow close took as expectations (status 'shadowed') instead of posting. Always 0 outside shadow.
1751
+ */
1752
+ entries_shadowed?: number;
1753
+ /**
1754
+ * Gate Findings
1755
+ *
1756
+ * Blocker codes a shadow close recorded instead of enforcing: sync_stale, pending_obligations, stranded_obligations, reconciling_items, unposted_source_events, unreconciled_accounts. Empty outside shadow.
1757
+ */
1758
+ gate_findings?: Array<string>;
1759
+ /**
1760
+ * Gate Finding Counts
1761
+ *
1762
+ * Each finding's size: days stale for sync_stale, a count for the rest.
1763
+ */
1764
+ gate_finding_counts?: {
1765
+ [key: string]: number;
1766
+ };
1741
1767
  /**
1742
1768
  * Statement Stamp Note
1743
1769
  *
@@ -9021,7 +9047,7 @@ export type LinkBankAccountResponse = {
9021
9047
  /**
9022
9048
  * Changed
9023
9049
  *
9024
- * False when the link already stood.
9050
+ * False when the link already stood and no line moved.
9025
9051
  */
9026
9052
  changed?: boolean;
9027
9053
  };
@@ -9472,8 +9498,9 @@ export type MemoryRecord = {
9472
9498
  *
9473
9499
  * Mercury bank-feed connection configuration.
9474
9500
  *
9475
- * A bank feed is native accounting: the graph must already have a chart of
9476
- * accounts and no live QuickBooks connection. Over OAuth (the hosted
9501
+ * A bank feed is native accounting: the entity its accounts land on must
9502
+ * already have a chart of accounts and must not be the one QuickBooks keeps
9503
+ * (the group parent, while QuickBooks is connected). Over OAuth (the hosted
9477
9504
  * default) the connection is created `pending_oauth` and activated by the
9478
9505
  * callback. `api_key` — a personal **read-only** Mercury token — connects
9479
9506
  * at once without a browser round-trip, but only on deployments that turn
@@ -17177,9 +17204,9 @@ export type SetWritePolicyRequest = {
17177
17204
  /**
17178
17205
  * Write Policy
17179
17206
  *
17180
- * 'native' = RoboSystems authoritative, no write-back; 'qb_authoritative' = QuickBooks authoritative, entries publish to QB.
17207
+ * 'qb_authoritative' = QuickBooks authoritative, entries publish to QB; 'shadow' = QuickBooks authoritative and RoboSystems only observes: nothing is written to QuickBooks, the close posts nothing locally, its drafts become shadowed expectations and its gates are findings. 'native', books kept in RoboSystems with no write-back, is what disconnecting or severing leaves, not a choice for a live connection.
17181
17208
  */
17182
- write_policy: 'native' | 'qb_authoritative';
17209
+ write_policy: 'qb_authoritative' | 'shadow';
17183
17210
  };
17184
17211
  /**
17185
17212
  * ShareReportOperation
package/sdk/types.gen.ts CHANGED
@@ -1786,6 +1786,32 @@ export type ClosePeriodResponse = {
1786
1786
  * Whether the close stamped the period's canonical statement FactSets (the close-time pivot). False when the tenant hasn't set up reporting yet — see statement_stamp_note.
1787
1787
  */
1788
1788
  statements_stamped?: boolean;
1789
+ /**
1790
+ * Shadow
1791
+ *
1792
+ * True when the close ran in shadow (the QuickBooks connection's write_policy is 'shadow'): nothing was written to QuickBooks, nothing posted, the in-window drafts were shadowed, and the gates that would have blocked the close are in gate_findings.
1793
+ */
1794
+ shadow?: boolean;
1795
+ /**
1796
+ * Entries Shadowed
1797
+ *
1798
+ * Drafts a shadow close took as expectations (status 'shadowed') instead of posting. Always 0 outside shadow.
1799
+ */
1800
+ entries_shadowed?: number;
1801
+ /**
1802
+ * Gate Findings
1803
+ *
1804
+ * Blocker codes a shadow close recorded instead of enforcing: sync_stale, pending_obligations, stranded_obligations, reconciling_items, unposted_source_events, unreconciled_accounts. Empty outside shadow.
1805
+ */
1806
+ gate_findings?: Array<string>;
1807
+ /**
1808
+ * Gate Finding Counts
1809
+ *
1810
+ * Each finding's size: days stale for sync_stale, a count for the rest.
1811
+ */
1812
+ gate_finding_counts?: {
1813
+ [key: string]: number;
1814
+ };
1789
1815
  /**
1790
1816
  * Statement Stamp Note
1791
1817
  *
@@ -9227,7 +9253,7 @@ export type LinkBankAccountResponse = {
9227
9253
  /**
9228
9254
  * Changed
9229
9255
  *
9230
- * False when the link already stood.
9256
+ * False when the link already stood and no line moved.
9231
9257
  */
9232
9258
  changed?: boolean;
9233
9259
  };
@@ -9690,8 +9716,9 @@ export type MemoryRecord = {
9690
9716
  *
9691
9717
  * Mercury bank-feed connection configuration.
9692
9718
  *
9693
- * A bank feed is native accounting: the graph must already have a chart of
9694
- * accounts and no live QuickBooks connection. Over OAuth (the hosted
9719
+ * A bank feed is native accounting: the entity its accounts land on must
9720
+ * already have a chart of accounts and must not be the one QuickBooks keeps
9721
+ * (the group parent, while QuickBooks is connected). Over OAuth (the hosted
9695
9722
  * default) the connection is created `pending_oauth` and activated by the
9696
9723
  * callback. `api_key` — a personal **read-only** Mercury token — connects
9697
9724
  * at once without a browser round-trip, but only on deployments that turn
@@ -17586,9 +17613,9 @@ export type SetWritePolicyRequest = {
17586
17613
  /**
17587
17614
  * Write Policy
17588
17615
  *
17589
- * 'native' = RoboSystems authoritative, no write-back; 'qb_authoritative' = QuickBooks authoritative, entries publish to QB.
17616
+ * 'qb_authoritative' = QuickBooks authoritative, entries publish to QB; 'shadow' = QuickBooks authoritative and RoboSystems only observes: nothing is written to QuickBooks, the close posts nothing locally, its drafts become shadowed expectations and its gates are findings. 'native', books kept in RoboSystems with no write-back, is what disconnecting or severing leaves, not a choice for a live connection.
17590
17617
  */
17591
- write_policy: 'native' | 'qb_authoritative';
17618
+ write_policy: 'qb_authoritative' | 'shadow';
17592
17619
  };
17593
17620
 
17594
17621
  /**
package/sdk.gen.d.ts CHANGED
@@ -320,7 +320,7 @@ export declare const listConnections: <ThrowOnError extends boolean = false>(opt
320
320
  /**
321
321
  * Create Connection
322
322
  *
323
- * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) is refused (409) beside a live QuickBooks connection or on a graph with no chart of accounts.
323
+ * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) names the entity its accounts book to (`entity_id`, the group parent when omitted) and is refused (409) when that entity has no chart of accounts or is the one QuickBooks keeps; QuickBooks is refused (409) when the group parent's books are already native.
324
324
  */
325
325
  export declare const createConnection: <ThrowOnError extends boolean = false>(options: Options<CreateConnectionData, ThrowOnError>) => RequestResult<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError>;
326
326
  /**
@@ -352,7 +352,7 @@ export declare const syncConnection: <ThrowOnError extends boolean = false>(opti
352
352
  /**
353
353
  * Set Connection Write Policy
354
354
  *
355
- * Opt a connection into or out of outbound write-back. 'qb_authoritative' makes QuickBooks the source of truth — RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'native' keeps RoboSystems authoritative with no write-back. This is the explicit operator opt-in for writing to your books of record.
355
+ * Choose how a live connection and RoboSystems share the books. 'qb_authoritative', the default, makes QuickBooks the book of record: RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'shadow' keeps QuickBooks the book of record and writes nothing to it: the close posts nothing locally either, its drafts become shadowed expectations compared with what QuickBooks holds, and its gates are recorded as findings. 'native' is not a choice here: it is what disconnecting or severing leaves, books kept in RoboSystems with no connection to write to. This is the explicit operator opt-in for writing to your books of record.
356
356
  */
357
357
  export declare const setConnectionWritePolicy: <ThrowOnError extends boolean = false>(options: Options<SetConnectionWritePolicyData, ThrowOnError>) => RequestResult<SetConnectionWritePolicyResponses, SetConnectionWritePolicyErrors, ThrowOnError>;
358
358
  /**
@@ -1136,7 +1136,7 @@ export declare const setCloseTarget: <ThrowOnError extends boolean = false>(opti
1136
1136
  /**
1137
1137
  * Close Fiscal Period
1138
1138
  *
1139
- * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order).
1139
+ * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order). Under a QuickBooks connection whose write_policy is `shadow`, the close observes instead: nothing is written to QuickBooks or posted, the drafts become `shadowed` expectations (`entries_shadowed`), and the gates that would have blocked are returned as `gate_findings` rather than enforced.
1140
1140
  *
1141
1141
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1142
1142
  */
package/sdk.gen.js CHANGED
@@ -614,7 +614,7 @@ exports.listConnections = listConnections;
614
614
  /**
615
615
  * Create Connection
616
616
  *
617
- * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) is refused (409) beside a live QuickBooks connection or on a graph with no chart of accounts.
617
+ * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) names the entity its accounts book to (`entity_id`, the group parent when omitted) and is refused (409) when that entity has no chart of accounts or is the one QuickBooks keeps; QuickBooks is refused (409) when the group parent's books are already native.
618
618
  */
619
619
  const createConnection = (options) => (options.client ?? client_gen_1.client).post({
620
620
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -692,7 +692,7 @@ exports.syncConnection = syncConnection;
692
692
  /**
693
693
  * Set Connection Write Policy
694
694
  *
695
- * Opt a connection into or out of outbound write-back. 'qb_authoritative' makes QuickBooks the source of truth — RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'native' keeps RoboSystems authoritative with no write-back. This is the explicit operator opt-in for writing to your books of record.
695
+ * Choose how a live connection and RoboSystems share the books. 'qb_authoritative', the default, makes QuickBooks the book of record: RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'shadow' keeps QuickBooks the book of record and writes nothing to it: the close posts nothing locally either, its drafts become shadowed expectations compared with what QuickBooks holds, and its gates are recorded as findings. 'native' is not a choice here: it is what disconnecting or severing leaves, books kept in RoboSystems with no connection to write to. This is the explicit operator opt-in for writing to your books of record.
696
696
  */
697
697
  const setConnectionWritePolicy = (options) => (options.client ?? client_gen_1.client).put({
698
698
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2340,7 +2340,7 @@ exports.setCloseTarget = setCloseTarget;
2340
2340
  /**
2341
2341
  * Close Fiscal Period
2342
2342
  *
2343
- * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order).
2343
+ * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order). Under a QuickBooks connection whose write_policy is `shadow`, the close observes instead: nothing is written to QuickBooks or posted, the drafts become `shadowed` expectations (`entries_shadowed`), and the gates that would have blocked are returned as `gate_findings` rather than enforced.
2344
2344
  *
2345
2345
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2346
2346
  */
package/sdk.gen.ts CHANGED
@@ -625,7 +625,7 @@ export const listConnections = <ThrowOnError extends boolean = false>(options: O
625
625
  /**
626
626
  * Create Connection
627
627
  *
628
- * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) is refused (409) beside a live QuickBooks connection or on a graph with no chart of accounts.
628
+ * QuickBooks and Mercury: returns a pending connection — complete the OAuth flow to activate (Mercury may instead connect at once with a personal API token where the deployment allows it). External: registers a source namespace for an integration that writes through the public API. One connection allowed per provider per graph, except 'external' which allows one per source_name and 'plaid' which allows one per bank login (a connection still waiting on Link is returned instead of a second). Plaid: returns a pending connection — `POST /oauth/init` returns a `link_token` for Plaid Link. A bank feed (Mercury, Plaid) names the entity its accounts book to (`entity_id`, the group parent when omitted) and is refused (409) when that entity has no chart of accounts or is the one QuickBooks keeps; QuickBooks is refused (409) when the group parent's books are already native.
629
629
  */
630
630
  export const createConnection = <ThrowOnError extends boolean = false>(options: Options<CreateConnectionData, ThrowOnError>): RequestResult<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError> => (options.client ?? client).post<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError>({
631
631
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -703,7 +703,7 @@ export const syncConnection = <ThrowOnError extends boolean = false>(options: Op
703
703
  /**
704
704
  * Set Connection Write Policy
705
705
  *
706
- * Opt a connection into or out of outbound write-back. 'qb_authoritative' makes QuickBooks the source of truth — RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'native' keeps RoboSystems authoritative with no write-back. This is the explicit operator opt-in for writing to your books of record.
706
+ * Choose how a live connection and RoboSystems share the books. 'qb_authoritative', the default, makes QuickBooks the book of record: RoboSystems-originated entries (manual JEs, schedule drafts) publish to QuickBooks when executed or at close. 'shadow' keeps QuickBooks the book of record and writes nothing to it: the close posts nothing locally either, its drafts become shadowed expectations compared with what QuickBooks holds, and its gates are recorded as findings. 'native' is not a choice here: it is what disconnecting or severing leaves, books kept in RoboSystems with no connection to write to. This is the explicit operator opt-in for writing to your books of record.
707
707
  */
708
708
  export const setConnectionWritePolicy = <ThrowOnError extends boolean = false>(options: Options<SetConnectionWritePolicyData, ThrowOnError>): RequestResult<SetConnectionWritePolicyResponses, SetConnectionWritePolicyErrors, ThrowOnError> => (options.client ?? client).put<SetConnectionWritePolicyResponses, SetConnectionWritePolicyErrors, ThrowOnError>({
709
709
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2351,7 +2351,7 @@ export const setCloseTarget = <ThrowOnError extends boolean = false>(options: Op
2351
2351
  /**
2352
2352
  * Close Fiscal Period
2353
2353
  *
2354
- * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order).
2354
+ * Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances `closed_through` by one, auto-advances `close_target` if this close caught up to it, and stamps the period's canonical statement FactSets from the posted ledger (`statements_stamped` / `stamped_statement_sets` in the response; soft-skipped with `statement_stamp_note` when reporting isn't set up). Period must be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order). Under a QuickBooks connection whose write_policy is `shadow`, the close observes instead: nothing is written to QuickBooks or posted, the drafts become `shadowed` expectations (`entries_shadowed`), and the gates that would have blocked are returned as `gate_findings` rather than enforced.
2355
2355
  *
2356
2356
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2357
2357
  */
package/types.gen.d.ts CHANGED
@@ -1738,6 +1738,32 @@ export type ClosePeriodResponse = {
1738
1738
  * Whether the close stamped the period's canonical statement FactSets (the close-time pivot). False when the tenant hasn't set up reporting yet — see statement_stamp_note.
1739
1739
  */
1740
1740
  statements_stamped?: boolean;
1741
+ /**
1742
+ * Shadow
1743
+ *
1744
+ * True when the close ran in shadow (the QuickBooks connection's write_policy is 'shadow'): nothing was written to QuickBooks, nothing posted, the in-window drafts were shadowed, and the gates that would have blocked the close are in gate_findings.
1745
+ */
1746
+ shadow?: boolean;
1747
+ /**
1748
+ * Entries Shadowed
1749
+ *
1750
+ * Drafts a shadow close took as expectations (status 'shadowed') instead of posting. Always 0 outside shadow.
1751
+ */
1752
+ entries_shadowed?: number;
1753
+ /**
1754
+ * Gate Findings
1755
+ *
1756
+ * Blocker codes a shadow close recorded instead of enforcing: sync_stale, pending_obligations, stranded_obligations, reconciling_items, unposted_source_events, unreconciled_accounts. Empty outside shadow.
1757
+ */
1758
+ gate_findings?: Array<string>;
1759
+ /**
1760
+ * Gate Finding Counts
1761
+ *
1762
+ * Each finding's size: days stale for sync_stale, a count for the rest.
1763
+ */
1764
+ gate_finding_counts?: {
1765
+ [key: string]: number;
1766
+ };
1741
1767
  /**
1742
1768
  * Statement Stamp Note
1743
1769
  *
@@ -9021,7 +9047,7 @@ export type LinkBankAccountResponse = {
9021
9047
  /**
9022
9048
  * Changed
9023
9049
  *
9024
- * False when the link already stood.
9050
+ * False when the link already stood and no line moved.
9025
9051
  */
9026
9052
  changed?: boolean;
9027
9053
  };
@@ -9472,8 +9498,9 @@ export type MemoryRecord = {
9472
9498
  *
9473
9499
  * Mercury bank-feed connection configuration.
9474
9500
  *
9475
- * A bank feed is native accounting: the graph must already have a chart of
9476
- * accounts and no live QuickBooks connection. Over OAuth (the hosted
9501
+ * A bank feed is native accounting: the entity its accounts land on must
9502
+ * already have a chart of accounts and must not be the one QuickBooks keeps
9503
+ * (the group parent, while QuickBooks is connected). Over OAuth (the hosted
9477
9504
  * default) the connection is created `pending_oauth` and activated by the
9478
9505
  * callback. `api_key` — a personal **read-only** Mercury token — connects
9479
9506
  * at once without a browser round-trip, but only on deployments that turn
@@ -17177,9 +17204,9 @@ export type SetWritePolicyRequest = {
17177
17204
  /**
17178
17205
  * Write Policy
17179
17206
  *
17180
- * 'native' = RoboSystems authoritative, no write-back; 'qb_authoritative' = QuickBooks authoritative, entries publish to QB.
17207
+ * 'qb_authoritative' = QuickBooks authoritative, entries publish to QB; 'shadow' = QuickBooks authoritative and RoboSystems only observes: nothing is written to QuickBooks, the close posts nothing locally, its drafts become shadowed expectations and its gates are findings. 'native', books kept in RoboSystems with no write-back, is what disconnecting or severing leaves, not a choice for a live connection.
17181
17208
  */
17182
- write_policy: 'native' | 'qb_authoritative';
17209
+ write_policy: 'qb_authoritative' | 'shadow';
17183
17210
  };
17184
17211
  /**
17185
17212
  * ShareReportOperation
package/types.gen.ts CHANGED
@@ -1786,6 +1786,32 @@ export type ClosePeriodResponse = {
1786
1786
  * Whether the close stamped the period's canonical statement FactSets (the close-time pivot). False when the tenant hasn't set up reporting yet — see statement_stamp_note.
1787
1787
  */
1788
1788
  statements_stamped?: boolean;
1789
+ /**
1790
+ * Shadow
1791
+ *
1792
+ * True when the close ran in shadow (the QuickBooks connection's write_policy is 'shadow'): nothing was written to QuickBooks, nothing posted, the in-window drafts were shadowed, and the gates that would have blocked the close are in gate_findings.
1793
+ */
1794
+ shadow?: boolean;
1795
+ /**
1796
+ * Entries Shadowed
1797
+ *
1798
+ * Drafts a shadow close took as expectations (status 'shadowed') instead of posting. Always 0 outside shadow.
1799
+ */
1800
+ entries_shadowed?: number;
1801
+ /**
1802
+ * Gate Findings
1803
+ *
1804
+ * Blocker codes a shadow close recorded instead of enforcing: sync_stale, pending_obligations, stranded_obligations, reconciling_items, unposted_source_events, unreconciled_accounts. Empty outside shadow.
1805
+ */
1806
+ gate_findings?: Array<string>;
1807
+ /**
1808
+ * Gate Finding Counts
1809
+ *
1810
+ * Each finding's size: days stale for sync_stale, a count for the rest.
1811
+ */
1812
+ gate_finding_counts?: {
1813
+ [key: string]: number;
1814
+ };
1789
1815
  /**
1790
1816
  * Statement Stamp Note
1791
1817
  *
@@ -9227,7 +9253,7 @@ export type LinkBankAccountResponse = {
9227
9253
  /**
9228
9254
  * Changed
9229
9255
  *
9230
- * False when the link already stood.
9256
+ * False when the link already stood and no line moved.
9231
9257
  */
9232
9258
  changed?: boolean;
9233
9259
  };
@@ -9690,8 +9716,9 @@ export type MemoryRecord = {
9690
9716
  *
9691
9717
  * Mercury bank-feed connection configuration.
9692
9718
  *
9693
- * A bank feed is native accounting: the graph must already have a chart of
9694
- * accounts and no live QuickBooks connection. Over OAuth (the hosted
9719
+ * A bank feed is native accounting: the entity its accounts land on must
9720
+ * already have a chart of accounts and must not be the one QuickBooks keeps
9721
+ * (the group parent, while QuickBooks is connected). Over OAuth (the hosted
9695
9722
  * default) the connection is created `pending_oauth` and activated by the
9696
9723
  * callback. `api_key` — a personal **read-only** Mercury token — connects
9697
9724
  * at once without a browser round-trip, but only on deployments that turn
@@ -17586,9 +17613,9 @@ export type SetWritePolicyRequest = {
17586
17613
  /**
17587
17614
  * Write Policy
17588
17615
  *
17589
- * 'native' = RoboSystems authoritative, no write-back; 'qb_authoritative' = QuickBooks authoritative, entries publish to QB.
17616
+ * 'qb_authoritative' = QuickBooks authoritative, entries publish to QB; 'shadow' = QuickBooks authoritative and RoboSystems only observes: nothing is written to QuickBooks, the close posts nothing locally, its drafts become shadowed expectations and its gates are findings. 'native', books kept in RoboSystems with no write-back, is what disconnecting or severing leaves, not a choice for a live connection.
17590
17617
  */
17591
- write_policy: 'native' | 'qb_authoritative';
17618
+ write_policy: 'qb_authoritative' | 'shadow';
17592
17619
  };
17593
17620
 
17594
17621
  /**