@robosystems/client 2.6.1 → 2.8.0

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/sdk/sdk.gen.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  // This file is auto-generated by @hey-api/openapi-ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.resendOrgInvitation = exports.revokeOrgInvitation = exports.createOrgInvitation = exports.listOrgInvitations = exports.updateOrgMemberRole = exports.removeOrgMember = exports.listOrgMembers = exports.listOrgGraphs = exports.updateOrg = exports.getOrg = exports.listUserOrgs = exports.revokeUserOAuthGrant = exports.listUserOAuthGrants = exports.updateUserApiKey = exports.revokeUserApiKey = exports.createUserApiKey = exports.listUserApiKeys = exports.updateUserPassword = exports.updateUser = exports.getCurrentUser = exports.getServiceStatus = exports.getAuthProviders = exports.getCaptchaConfig = exports.regenerateMfaRecoveryCodes = exports.getMfaStatus = exports.verifyMfa = exports.getMfaOptions = exports.verifyPasskeyLogin = exports.getPasskeyLoginOptions = exports.deleteUserPasskey = exports.getPasskeyReauthOptions = exports.listUserPasskeys = exports.verifyPasskeyRegistration = exports.getPasskeyRegistrationOptions = exports.completeSsoAuth = exports.ssoTokenExchange = exports.generateSsoToken = exports.resetPassword = exports.validateResetToken = exports.forgotPassword = exports.checkPasswordStrength = exports.getPasswordPolicy = exports.getInvitationPreview = exports.verifyEmail = exports.resendVerificationEmail = exports.refreshAuthSession = exports.getCurrentAuthUser = exports.logoutUser = exports.loginUser = exports.registerUser = void 0;
5
- exports.deleteSubgraph = exports.createSubgraph = exports.recallMemory = exports.getMemory = exports.listMemories = exports.getDocument = exports.listDocuments = exports.getDocumentSection = exports.searchDocuments = exports.listTables = exports.cancelRepositorySubscription = exports.createRepositorySubscription = exports.changeSubscriptionPlan = exports.getGraphSubscription = exports.getSubgraphInfo = exports.listSubgraphs = exports.listGraphMutations = exports.updateGraphMemberRole = exports.removeGraphMember = exports.addGraphMember = exports.listGraphMembers = exports.getGraphLimits = exports.getDatabaseInfo = exports.getDatabaseHealth = exports.listCreditTransactions = exports.getCreditSummary = exports.exportGraphSchema = exports.getGraphSchema = exports.executeSql = exports.executeCypher = exports.getGraphUsage = exports.getGraphMetrics = exports.getBackupStats = exports.getBackupDownloadUrl = exports.listBackups = exports.executeSpecificOperator = exports.getOperatorMetadata = exports.autoSelectOperator = exports.listOperators = exports.setConnectionWritePolicy = exports.getConnection = exports.deleteConnection = exports.createConnection = exports.listConnections = exports.oauthCallback = exports.initOAuth = exports.getConnectionOptions = exports.syncConnection = exports.getOrgUsage = exports.getOrgLimits = void 0;
6
- exports.createInformationBlock = exports.autoMapElements = exports.deleteMappingAssociation = exports.createMappingAssociation = exports.linkEntityTaxonomy = exports.deleteTaxonomyBlock = exports.updateTaxonomyBlock = exports.createTaxonomyBlock = exports.changeReportingStyle = exports.updateEntity = exports.initializeChartOfAccounts = exports.initializeLedger = exports.handleHttpPostExtensionsGraphIdGraphqlPost = exports.handleHttpGetExtensionsGraphIdGraphqlGet = exports.getCheckoutStatus = exports.createCheckoutSession = exports.getOrgUpcomingInvoice = exports.listOrgInvoices = exports.cancelOrgSubscription = exports.getOrgSubscription = exports.listOrgSubscriptions = exports.createPortalSession = exports.getOrgBillingCustomer = exports.resumeOperation = exports.cancelOperation = exports.getOperationStatus = exports.streamOperationEvents = exports.getServiceOfferings = exports.validateSchema = exports.selectGraph = exports.getGraphCapacity = exports.getAvailableGraphTiers = exports.getAvailableExtensions = exports.createGraph = exports.getGraphs = exports.getFile = exports.listFiles = exports.deleteFile = exports.ingestFile = exports.createFileUpload = exports.deleteDocument = exports.indexDocument = exports.updateMemory = exports.forget = exports.remember = exports.materialize = exports.updateGraphMetadata = exports.changeTier = exports.createBackup = exports.deleteGraph = void 0;
7
- exports.describeFiling = exports.informationBlock = exports.disclosures = exports.financialStatementAnalysis = exports.buildFactGrid = exports.unblockSourceGraph = exports.blockSourceGraph = exports.removePublishListMember = exports.addPublishListMembers = exports.deletePublishList = exports.updatePublishList = exports.createPublishList = exports.revokeReportShare = exports.shareReport = exports.transitionFilingStatus = exports.fileReport = exports.deleteReport = exports.regenerateReport = exports.createReport = exports.terminateSchedule = exports.rebuildSchedule = exports.promoteObligations = exports.backfillPlanHistory = exports.reopenPeriod = exports.closePeriod = exports.setCloseTarget = exports.deleteJournalEntry = exports.updateJournalEntry = exports.signOffReconciliation = exports.setReconciliationPolicy = exports.recordStatementBalance = exports.refreshReconciliations = exports.previewReconciliations = exports.resolveReconcilingItem = exports.previewReconcilingItem = exports.previewEventBlock = exports.updateEventHandler = exports.createEventHandler = exports.executeEventBlock = exports.updateEventBlock = exports.createEventBlock = exports.updateAgent = exports.createAgent = exports.bindTextBlock = exports.computeForecast = exports.assertMetrics = exports.computeMetrics = exports.evaluateRules = exports.deleteInformationBlock = exports.updateInformationBlock = void 0;
8
- exports.deleteSecurity = exports.updateSecurity = exports.createSecurity = exports.deletePortfolioBlock = exports.updatePortfolioBlock = exports.createPortfolioBlock = exports.liveFinancialStatement = exports.readText = exports.searchText = void 0;
4
+ exports.revokeOrgInvitation = exports.createOrgInvitation = exports.listOrgInvitations = exports.updateOrgMemberRole = exports.removeOrgMember = exports.listOrgMembers = exports.listOrgGraphs = exports.updateOrg = exports.getOrg = exports.listUserOrgs = exports.revokeUserOAuthGrant = exports.listUserOAuthGrants = exports.updateUserApiKey = exports.revokeUserApiKey = exports.createUserApiKey = exports.listUserApiKeys = exports.setSelectedGraph = exports.updateUserPassword = exports.updateUser = exports.getCurrentUser = exports.getServiceStatus = exports.getAuthProviders = exports.getCaptchaConfig = exports.regenerateMfaRecoveryCodes = exports.getMfaStatus = exports.verifyMfa = exports.getMfaOptions = exports.verifyPasskeyLogin = exports.getPasskeyLoginOptions = exports.deleteUserPasskey = exports.getPasskeyReauthOptions = exports.listUserPasskeys = exports.verifyPasskeyRegistration = exports.getPasskeyRegistrationOptions = exports.completeSsoAuth = exports.ssoTokenExchange = exports.generateSsoToken = exports.resetPassword = exports.validateResetToken = exports.forgotPassword = exports.checkPasswordStrength = exports.getPasswordPolicy = exports.getInvitationPreview = exports.verifyEmail = exports.resendVerificationEmail = exports.refreshAuthSession = exports.getCurrentAuthUser = exports.logoutUser = exports.loginUser = exports.registerUser = void 0;
5
+ exports.createSubgraph = exports.recallMemory = exports.getMemory = exports.listMemories = exports.getDocument = exports.listDocuments = exports.getDocumentSection = exports.searchDocuments = exports.listTables = exports.cancelRepositorySubscription = exports.createRepositorySubscription = exports.changeSubscriptionPlan = exports.getGraphSubscription = exports.getSubgraphInfo = exports.listSubgraphs = exports.listGraphMutations = exports.updateGraphMemberRole = exports.removeGraphMember = exports.addGraphMember = exports.listGraphMembers = exports.getGraphLimits = exports.getDatabaseInfo = exports.getDatabaseHealth = exports.listCreditTransactions = exports.getCreditSummary = exports.exportGraphSchema = exports.getGraphSchema = exports.executeSql = exports.executeCypher = exports.getGraphUsage = exports.getGraphMetrics = exports.getBackupStats = exports.getBackupDownloadUrl = exports.listBackups = exports.executeSpecificOperator = exports.getOperatorMetadata = exports.autoSelectOperator = exports.listOperators = exports.setConnectionWritePolicy = exports.syncConnection = exports.getConnection = exports.deleteConnection = exports.oauthCallback = exports.initOAuth = exports.createConnection = exports.listConnections = exports.getConnectionOptions = exports.getOrgUsage = exports.getOrgLimits = exports.resendOrgInvitation = void 0;
6
+ exports.autoMapElements = exports.deleteMappingAssociation = exports.createMappingAssociation = exports.linkEntityTaxonomy = exports.deleteTaxonomyBlock = exports.updateTaxonomyBlock = exports.createTaxonomyBlock = exports.changeReportingStyle = exports.updateEntity = exports.createEntity = exports.initializeChartOfAccounts = exports.initializeLedger = exports.handleHttpPostExtensionsGraphIdGraphqlPost = exports.handleHttpGetExtensionsGraphIdGraphqlGet = exports.getCheckoutStatus = exports.createCheckoutSession = exports.getOrgUpcomingInvoice = exports.listOrgInvoices = exports.cancelOrgSubscription = exports.getOrgSubscription = exports.listOrgSubscriptions = exports.createPortalSession = exports.getOrgBillingCustomer = exports.resumeOperation = exports.cancelOperation = exports.getOperationStatus = exports.streamOperationEvents = exports.getServiceOfferings = exports.validateSchema = exports.getGraphCapacity = exports.getAvailableGraphTiers = exports.getAvailableExtensions = exports.createGraph = exports.getGraphs = exports.getFile = exports.listFiles = exports.deleteFile = exports.ingestFile = exports.createFileUpload = exports.deleteDocument = exports.indexDocument = exports.updateMemory = exports.forget = exports.remember = exports.materialize = exports.updateGraphMetadata = exports.changeTier = exports.createBackup = exports.deleteGraph = exports.deleteSubgraph = void 0;
7
+ exports.informationBlock = exports.disclosures = exports.financialStatementAnalysis = exports.buildFactGrid = exports.unblockSourceGraph = exports.blockSourceGraph = exports.removePublishListMember = exports.addPublishListMembers = exports.deletePublishList = exports.updatePublishList = exports.createPublishList = exports.revokeReportShare = exports.shareReport = exports.transitionFilingStatus = exports.fileReport = exports.deleteReport = exports.regenerateReport = exports.createReport = exports.terminateSchedule = exports.rebuildSchedule = exports.promoteObligations = exports.backfillPlanHistory = exports.reopenPeriod = exports.closePeriod = exports.setCloseTarget = exports.deleteJournalEntry = exports.updateJournalEntry = exports.signOffReconciliation = exports.setReconciliationPolicy = exports.recordStatementBalance = exports.refreshReconciliations = exports.previewReconciliations = exports.resolveReconcilingItem = exports.previewReconcilingItem = exports.previewEventBlock = exports.updateEventHandler = exports.createEventHandler = exports.executeEventBlock = exports.updateEventBlock = exports.createEventBlock = exports.updateAgent = exports.createAgent = exports.bindTextBlock = exports.computeForecast = exports.assertMetrics = exports.computeMetrics = exports.evaluateRules = exports.deleteInformationBlock = exports.updateInformationBlock = exports.createInformationBlock = void 0;
8
+ exports.deleteSecurity = exports.updateSecurity = exports.createSecurity = exports.deletePortfolioBlock = exports.updatePortfolioBlock = exports.createPortfolioBlock = exports.liveFinancialStatement = exports.readText = exports.searchText = exports.describeFiling = void 0;
9
9
  const client_gen_1 = require("./client.gen");
10
10
  /**
11
11
  * Register New User
@@ -359,6 +359,21 @@ const updateUserPassword = (options) => (options.client ?? client_gen_1.client).
359
359
  }
360
360
  });
361
361
  exports.updateUserPassword = updateUserPassword;
362
+ /**
363
+ * Set Selected Graph
364
+ *
365
+ * Remembers the graph as the caller's current one: `GET /v1/graphs` then reports it as `selectedGraphId`, and the apps open on it. One graph per user, replacing the previous selection. Only a graph the caller belongs to can be selected; shared repositories cannot be.
366
+ */
367
+ const setSelectedGraph = (options) => (options.client ?? client_gen_1.client).put({
368
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
369
+ url: '/v1/user/selected-graph',
370
+ ...options,
371
+ headers: {
372
+ 'Content-Type': 'application/json',
373
+ ...options.headers
374
+ }
375
+ });
376
+ exports.setSelectedGraph = setSelectedGraph;
362
377
  /**
363
378
  * List API Keys
364
379
  *
@@ -576,21 +591,6 @@ const getOrgUsage = (options) => (options.client ?? client_gen_1.client).get({
576
591
  ...options
577
592
  });
578
593
  exports.getOrgUsage = getOrgUsage;
579
- /**
580
- * Sync Connection
581
- *
582
- * QuickBooks: fetches transactions, balances, and chart of accounts. Mercury: pulls the bank feed (a 60-day window by default, or from `since_date` / the full backfill on `full_rebuild`) and captures it into the inbox. Plaid: continues from the Item's stored cursor (added, modified and removed transactions), or replays its history on `full_rebuild` / `since_date`. For all three the envelope is `pending` with the run's `task_id`, and completion is reflected in the connection's `last_sync` timestamp and `last_sync_result`. External connections are push-based and have nothing to pull; the envelope is `completed` with a null `task_id` and a message saying so — there is nothing to poll. Returns an `OperationEnvelope`; supports `Idempotency-Key`.
583
- */
584
- const syncConnection = (options) => (options.client ?? client_gen_1.client).post({
585
- security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
586
- url: '/v1/graphs/{graph_id}/connections/{connection_id}/sync',
587
- ...options,
588
- headers: {
589
- 'Content-Type': 'application/json',
590
- ...options.headers
591
- }
592
- });
593
- exports.syncConnection = syncConnection;
594
594
  /**
595
595
  * List Connection Options
596
596
  *
@@ -603,57 +603,57 @@ const getConnectionOptions = (options) => (options.client ?? client_gen_1.client
603
603
  });
604
604
  exports.getConnectionOptions = getConnectionOptions;
605
605
  /**
606
- * Initialize OAuth Flow
606
+ * List Connections
607
607
  */
608
- const initOAuth = (options) => (options.client ?? client_gen_1.client).post({
608
+ const listConnections = (options) => (options.client ?? client_gen_1.client).get({
609
609
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
610
- url: '/v1/graphs/{graph_id}/connections/oauth/init',
611
- ...options,
612
- headers: {
613
- 'Content-Type': 'application/json',
614
- ...options.headers
615
- }
610
+ url: '/v1/graphs/{graph_id}/connections',
611
+ ...options
616
612
  });
617
- exports.initOAuth = initOAuth;
613
+ exports.listConnections = listConnections;
618
614
  /**
619
- * OAuth Callback
615
+ * Create Connection
620
616
  *
621
- * Completes the OAuth authorization flow after provider redirect. Exchanges the authorization code for tokens, stores them, and triggers an initial sync. This is a redirect target — not typically called directly. Plaid: pass Link's public_token as `code`; a bank already connected to the graph is refused (409 DUPLICATE_BANK_CONNECTION).
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.
622
618
  */
623
- const oauthCallback = (options) => (options.client ?? client_gen_1.client).post({
619
+ const createConnection = (options) => (options.client ?? client_gen_1.client).post({
624
620
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
625
- url: '/v1/graphs/{graph_id}/connections/oauth/callback/{provider}',
621
+ url: '/v1/graphs/{graph_id}/connections',
626
622
  ...options,
627
623
  headers: {
628
624
  'Content-Type': 'application/json',
629
625
  ...options.headers
630
626
  }
631
627
  });
632
- exports.oauthCallback = oauthCallback;
628
+ exports.createConnection = createConnection;
633
629
  /**
634
- * List Connections
630
+ * Initialize OAuth Flow
635
631
  */
636
- const listConnections = (options) => (options.client ?? client_gen_1.client).get({
632
+ const initOAuth = (options) => (options.client ?? client_gen_1.client).post({
637
633
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
638
- url: '/v1/graphs/{graph_id}/connections',
639
- ...options
634
+ url: '/v1/graphs/{graph_id}/connections/oauth/init',
635
+ ...options,
636
+ headers: {
637
+ 'Content-Type': 'application/json',
638
+ ...options.headers
639
+ }
640
640
  });
641
- exports.listConnections = listConnections;
641
+ exports.initOAuth = initOAuth;
642
642
  /**
643
- * Create Connection
643
+ * OAuth Callback
644
644
  *
645
- * 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.
645
+ * Completes the OAuth authorization flow after provider redirect. Exchanges the authorization code for tokens, stores them, and triggers an initial sync. This is a redirect target — not typically called directly. Plaid: pass Link's public_token as `code`; a bank already connected to the graph is refused (409 DUPLICATE_BANK_CONNECTION).
646
646
  */
647
- const createConnection = (options) => (options.client ?? client_gen_1.client).post({
647
+ const oauthCallback = (options) => (options.client ?? client_gen_1.client).post({
648
648
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
649
- url: '/v1/graphs/{graph_id}/connections',
649
+ url: '/v1/graphs/{graph_id}/connections/oauth/callback/{provider}',
650
650
  ...options,
651
651
  headers: {
652
652
  'Content-Type': 'application/json',
653
653
  ...options.headers
654
654
  }
655
655
  });
656
- exports.createConnection = createConnection;
656
+ exports.oauthCallback = oauthCallback;
657
657
  /**
658
658
  * Delete Connection
659
659
  *
@@ -674,6 +674,21 @@ const getConnection = (options) => (options.client ?? client_gen_1.client).get({
674
674
  ...options
675
675
  });
676
676
  exports.getConnection = getConnection;
677
+ /**
678
+ * Sync Connection
679
+ *
680
+ * QuickBooks: fetches transactions, balances, and chart of accounts. Mercury: pulls the bank feed (a 60-day window by default, or from `since_date` / the full backfill on `full_rebuild`) and captures it into the inbox. Plaid: continues from the Item's stored cursor (added, modified and removed transactions), or replays its history on `full_rebuild` / `since_date`. For all three the envelope is `pending` with the run's `task_id`, and completion is reflected in the connection's `last_sync` timestamp and `last_sync_result`. External connections are push-based and have nothing to pull; the envelope is `completed` with a null `task_id` and a message saying so — there is nothing to poll. Returns an `OperationEnvelope`; supports `Idempotency-Key`.
681
+ */
682
+ const syncConnection = (options) => (options.client ?? client_gen_1.client).post({
683
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
684
+ url: '/v1/graphs/{graph_id}/connections/{connection_id}/sync',
685
+ ...options,
686
+ headers: {
687
+ 'Content-Type': 'application/json',
688
+ ...options.headers
689
+ }
690
+ });
691
+ exports.syncConnection = syncConnection;
677
692
  /**
678
693
  * Set Connection Write Policy
679
694
  *
@@ -1442,15 +1457,6 @@ const getGraphCapacity = (options) => (options?.client ?? client_gen_1.client).g
1442
1457
  ...options
1443
1458
  });
1444
1459
  exports.getGraphCapacity = getGraphCapacity;
1445
- /**
1446
- * Select Graph
1447
- */
1448
- const selectGraph = (options) => (options.client ?? client_gen_1.client).post({
1449
- security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
1450
- url: '/v1/graphs/{graph_id}/select',
1451
- ...options
1452
- });
1453
- exports.selectGraph = selectGraph;
1454
1460
  /**
1455
1461
  * Validate Schema
1456
1462
  *
@@ -1688,7 +1694,7 @@ exports.initializeLedger = initializeLedger;
1688
1694
  /**
1689
1695
  * Initialize Chart of Accounts
1690
1696
  *
1691
- * Create the graph's chart of accounts from a shipped template — the fresh-company path to native books. Use when the graph has NO chart (a QuickBooks-synced tenant never needs this: its chart arrives with the sync and stays after a sever) and before connecting a bank feed, which needs a chart to resolve against. Templates: `saas` (subscription software), `services` (professional services), `product` (inventory and COGS) — the `chartTemplates` GraphQL field lists them with names and account counts. Creates the chart, its `coa_mapping` structure and the template's CoA → rs-gaap mapping associations in one transaction, with the equity rows mapped by the entity's legal form (`entity_type`, defaulting to the graph's primary entity). One-time: 409 once a chart exists — a chart is never replaced. Customize afterwards with update-taxonomy-block; accounts that carry activity are never deleted.
1697
+ * Create the graph's chart of accounts from a shipped template — the fresh-company path to native books. Use when the graph has NO chart (a QuickBooks-synced tenant never needs this: its chart arrives with the sync and stays after a sever) and before connecting a bank feed, which needs a chart to resolve against. Templates: `saas` (subscription software), `services` (professional services), `product` (inventory and COGS) — the `chartTemplates` GraphQL field lists them with names and account counts. Creates the chart, its `coa_mapping` structure and the template's CoA → rs-gaap mapping associations in one transaction, with the equity rows mapped by the entity's legal form (`entity_type`, defaulting to the entity's). Each entity of the group keeps its own chart: `entity_id` names a subsidiary, omitted means the group parent. One-time per entity: 409 once that entity has a chart — a chart is never replaced. Customize afterwards with update-taxonomy-block; accounts that carry activity are never deleted.
1692
1698
  *
1693
1699
  * **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.
1694
1700
  */
@@ -1702,10 +1708,27 @@ const initializeChartOfAccounts = (options) => (options.client ?? client_gen_1.c
1702
1708
  }
1703
1709
  });
1704
1710
  exports.initializeChartOfAccounts = initializeChartOfAccounts;
1711
+ /**
1712
+ * Create Entity
1713
+ *
1714
+ * Add an entity to the graph's reporting group: a subsidiary under `parent_entity_id` (default the group parent) that keeps its own books, chart of accounts and close, on the group's fiscal cadence. A graph created without an entity gets this one as its group parent. Creates the entity row only — give it a chart next (initialize-chart-of-accounts with `entity_id`) and a calendar (initialize with `entity_id`); from then on every ledger operation takes `entity_id` to act in its books, and omitting it means the group parent. The Reporting Style follows `entity_type` unless `reporting_style_id` names one. `ticker` prefixes the entity's account names and must be unique in the graph (409). There is no cap on entities: a graph is one reporting group, and everyone with access to it sees every entity.
1715
+ *
1716
+ * **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.
1717
+ */
1718
+ const createEntity = (options) => (options.client ?? client_gen_1.client).post({
1719
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
1720
+ url: '/extensions/roboledger/{graph_id}/operations/create-entity',
1721
+ ...options,
1722
+ headers: {
1723
+ 'Content-Type': 'application/json',
1724
+ ...options.headers
1725
+ }
1726
+ });
1727
+ exports.createEntity = createEntity;
1705
1728
  /**
1706
1729
  * Update Entity
1707
1730
  *
1708
- * Update the graph's primary entity. Only provided (non-null) fields are updated. The graph is implicit in the URL — the operation always targets the graph's primary entity.
1731
+ * Update an entity of the graph's reporting group. Only provided (non-null) fields are updated. Omit `entity_id` to target the group parent; name a subsidiary's id to edit it. `ownership_pct` is refused on the group parent (422), and `ticker` must stay unique in the graph (409).
1709
1732
  *
1710
1733
  * **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.
1711
1734
  */
@@ -2062,7 +2085,7 @@ exports.updateEventBlock = updateEventBlock;
2062
2085
  /**
2063
2086
  * Execute Event Block
2064
2087
  *
2065
- * For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the captured GL plan to the source-of-truth system (QuickBooks). Captures qb_txn_id on event.metadata.qb_external_id, transitions status to 'fulfilled' (or 'pending' on rejection), and promotes draft GL rows to 'posted'. Native-policy events fast-path through with no QB write — RoboSystems is the system of record.
2088
+ * For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the event's draft GL entries to the source-of-truth system (QuickBooks), each as its own JournalEntry. Records the QuickBooks ids per entry on event.metadata.qb_entry_ids and promotes the published entries to 'posted'; the event goes 'fulfilled' once no draft remains, or 'pending' on rejection (what landed is kept). Native-policy events fast-path through with no QB write — RoboSystems is the system of record.
2066
2089
  *
2067
2090
  * **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.
2068
2091
  */
@@ -2759,7 +2782,7 @@ exports.readText = readText;
2759
2782
  /**
2760
2783
  * Live Financial Statement
2761
2784
  *
2762
- * Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph materialization required. Rejected on shared-repository graphs; those should use `financial-statement-analysis` instead.
2785
+ * Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph materialization required. One entity's books: `entity_id` names a subsidiary, omitted means the group parent; `consolidated` on the parent combines every entity of the group at the rs-gaap concepts, with no eliminations. Rejected on shared-repository graphs; those should use `financial-statement-analysis` instead.
2763
2786
  *
2764
2787
  * **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.
2765
2788
  */
package/sdk/sdk.gen.ts CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';
4
4
  import { client } from './client.gen';
5
- import type { AddGraphMemberData, AddGraphMemberErrors, AddGraphMemberResponses, AddPublishListMembersData, AddPublishListMembersErrors, AddPublishListMembersResponses, AssertMetricsData, AssertMetricsErrors, AssertMetricsResponses, AutoMapElementsData, AutoMapElementsErrors, AutoMapElementsResponses, AutoSelectOperatorData, AutoSelectOperatorErrors, AutoSelectOperatorResponses, BackfillPlanHistoryData, BackfillPlanHistoryErrors, BackfillPlanHistoryResponses, BindTextBlockData, BindTextBlockErrors, BindTextBlockResponses, BlockSourceGraphData, BlockSourceGraphErrors, BlockSourceGraphResponses, BuildFactGridData, BuildFactGridErrors, BuildFactGridResponses, CancelOperationData, CancelOperationErrors, CancelOperationResponses, CancelOrgSubscriptionData, CancelOrgSubscriptionErrors, CancelOrgSubscriptionResponses, CancelRepositorySubscriptionData, CancelRepositorySubscriptionErrors, CancelRepositorySubscriptionResponses, ChangeReportingStyleData, ChangeReportingStyleErrors, ChangeReportingStyleResponses, ChangeSubscriptionPlanData, ChangeSubscriptionPlanErrors, ChangeSubscriptionPlanResponses, ChangeTierData, ChangeTierErrors, ChangeTierResponses, CheckPasswordStrengthData, CheckPasswordStrengthErrors, CheckPasswordStrengthResponses, ClosePeriodData, ClosePeriodErrors, ClosePeriodResponses, CompleteSsoAuthData, CompleteSsoAuthErrors, CompleteSsoAuthResponses, ComputeForecastData, ComputeForecastErrors, ComputeForecastResponses, ComputeMetricsData, ComputeMetricsErrors, ComputeMetricsResponses, CreateAgentData, CreateAgentErrors, CreateAgentResponses, CreateBackupData, CreateBackupErrors, CreateBackupResponses, CreateCheckoutSessionData, CreateCheckoutSessionErrors, CreateCheckoutSessionResponses, CreateConnectionData, CreateConnectionErrors, CreateConnectionResponses, CreateEventBlockData, CreateEventBlockErrors, CreateEventBlockResponses, CreateEventHandlerData, CreateEventHandlerErrors, CreateEventHandlerResponses, CreateFileUploadData, CreateFileUploadErrors, CreateFileUploadResponses, CreateGraphData, CreateGraphErrors, CreateGraphResponses, CreateInformationBlockData, CreateInformationBlockErrors, CreateInformationBlockResponses, CreateMappingAssociationData, CreateMappingAssociationErrors, CreateMappingAssociationResponses, CreateOrgInvitationData, CreateOrgInvitationErrors, CreateOrgInvitationResponses, CreatePortalSessionData, CreatePortalSessionErrors, CreatePortalSessionResponses, CreatePortfolioBlockData, CreatePortfolioBlockErrors, CreatePortfolioBlockResponses, CreatePublishListData, CreatePublishListErrors, CreatePublishListResponses, CreateReportData, CreateReportErrors, CreateReportResponses, CreateRepositorySubscriptionData, CreateRepositorySubscriptionErrors, CreateRepositorySubscriptionResponses, CreateSecurityData, CreateSecurityErrors, CreateSecurityResponses, CreateSubgraphData, CreateSubgraphErrors, CreateSubgraphResponses, CreateTaxonomyBlockData, CreateTaxonomyBlockErrors, CreateTaxonomyBlockResponses, CreateUserApiKeyData, CreateUserApiKeyErrors, CreateUserApiKeyResponses, DeleteConnectionData, DeleteConnectionErrors, DeleteConnectionResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteFileData, DeleteFileErrors, DeleteFileResponses, DeleteGraphData, DeleteGraphErrors, DeleteGraphResponses, DeleteInformationBlockData, DeleteInformationBlockErrors, DeleteInformationBlockResponses, DeleteJournalEntryData, DeleteJournalEntryErrors, DeleteJournalEntryResponses, DeleteMappingAssociationData, DeleteMappingAssociationErrors, DeleteMappingAssociationResponses, DeletePortfolioBlockData, DeletePortfolioBlockErrors, DeletePortfolioBlockResponses, DeletePublishListData, DeletePublishListErrors, DeletePublishListResponses, DeleteReportData, DeleteReportErrors, DeleteReportResponses, DeleteSecurityData, DeleteSecurityErrors, DeleteSecurityResponses, DeleteSubgraphData, DeleteSubgraphErrors, DeleteSubgraphResponses, DeleteTaxonomyBlockData, DeleteTaxonomyBlockErrors, DeleteTaxonomyBlockResponses, DeleteUserPasskeyData, DeleteUserPasskeyErrors, DeleteUserPasskeyResponses, DescribeFilingData, DescribeFilingErrors, DescribeFilingResponses, DisclosuresData, DisclosuresErrors, DisclosuresResponses, EvaluateRulesData, EvaluateRulesErrors, EvaluateRulesResponses, ExecuteCypherData, ExecuteCypherErrors, ExecuteCypherResponses, ExecuteEventBlockData, ExecuteEventBlockErrors, ExecuteEventBlockResponses, ExecuteSpecificOperatorData, ExecuteSpecificOperatorErrors, ExecuteSpecificOperatorResponses, ExecuteSqlData, ExecuteSqlErrors, ExecuteSqlResponses, ExportGraphSchemaData, ExportGraphSchemaErrors, ExportGraphSchemaResponses, FileReportData, FileReportErrors, FileReportResponses, FinancialStatementAnalysisData, FinancialStatementAnalysisErrors, FinancialStatementAnalysisResponses, ForgetData, ForgetErrors, ForgetResponses, ForgotPasswordData, ForgotPasswordErrors, ForgotPasswordResponses, GenerateSsoTokenData, GenerateSsoTokenErrors, GenerateSsoTokenResponses, GetAuthProvidersData, GetAuthProvidersErrors, GetAuthProvidersResponses, GetAvailableExtensionsData, GetAvailableExtensionsErrors, GetAvailableExtensionsResponses, GetAvailableGraphTiersData, GetAvailableGraphTiersErrors, GetAvailableGraphTiersResponses, GetBackupDownloadUrlData, GetBackupDownloadUrlErrors, GetBackupDownloadUrlResponses, GetBackupStatsData, GetBackupStatsErrors, GetBackupStatsResponses, GetCaptchaConfigData, GetCaptchaConfigErrors, GetCaptchaConfigResponses, GetCheckoutStatusData, GetCheckoutStatusErrors, GetCheckoutStatusResponses, GetConnectionData, GetConnectionErrors, GetConnectionOptionsData, GetConnectionOptionsErrors, GetConnectionOptionsResponses, GetConnectionResponses, GetCreditSummaryData, GetCreditSummaryErrors, GetCreditSummaryResponses, GetCurrentAuthUserData, GetCurrentAuthUserErrors, GetCurrentAuthUserResponses, GetCurrentUserData, GetCurrentUserErrors, GetCurrentUserResponses, GetDatabaseHealthData, GetDatabaseHealthErrors, GetDatabaseHealthResponses, GetDatabaseInfoData, GetDatabaseInfoErrors, GetDatabaseInfoResponses, GetDocumentData, GetDocumentErrors, GetDocumentResponses, GetDocumentSectionData, GetDocumentSectionErrors, GetDocumentSectionResponses, GetFileData, GetFileErrors, GetFileResponses, GetGraphCapacityData, GetGraphCapacityErrors, GetGraphCapacityResponses, GetGraphLimitsData, GetGraphLimitsErrors, GetGraphLimitsResponses, GetGraphMetricsData, GetGraphMetricsErrors, GetGraphMetricsResponses, GetGraphSchemaData, GetGraphSchemaErrors, GetGraphSchemaResponses, GetGraphsData, GetGraphsErrors, GetGraphsResponses, GetGraphSubscriptionData, GetGraphSubscriptionErrors, GetGraphSubscriptionResponses, GetGraphUsageData, GetGraphUsageErrors, GetGraphUsageResponses, GetInvitationPreviewData, GetInvitationPreviewErrors, GetInvitationPreviewResponses, GetMemoryData, GetMemoryErrors, GetMemoryResponses, GetMfaOptionsData, GetMfaOptionsErrors, GetMfaOptionsResponses, GetMfaStatusData, GetMfaStatusErrors, GetMfaStatusResponses, GetOperationStatusData, GetOperationStatusErrors, GetOperationStatusResponses, GetOperatorMetadataData, GetOperatorMetadataErrors, GetOperatorMetadataResponses, GetOrgBillingCustomerData, GetOrgBillingCustomerErrors, GetOrgBillingCustomerResponses, GetOrgData, GetOrgErrors, GetOrgLimitsData, GetOrgLimitsErrors, GetOrgLimitsResponses, GetOrgResponses, GetOrgSubscriptionData, GetOrgSubscriptionErrors, GetOrgSubscriptionResponses, GetOrgUpcomingInvoiceData, GetOrgUpcomingInvoiceErrors, GetOrgUpcomingInvoiceResponses, GetOrgUsageData, GetOrgUsageErrors, GetOrgUsageResponses, GetPasskeyLoginOptionsData, GetPasskeyLoginOptionsErrors, GetPasskeyLoginOptionsResponses, GetPasskeyReauthOptionsData, GetPasskeyReauthOptionsErrors, GetPasskeyReauthOptionsResponses, GetPasskeyRegistrationOptionsData, GetPasskeyRegistrationOptionsErrors, GetPasskeyRegistrationOptionsResponses, GetPasswordPolicyData, GetPasswordPolicyErrors, GetPasswordPolicyResponses, GetServiceOfferingsData, GetServiceOfferingsErrors, GetServiceOfferingsResponses, GetServiceStatusData, GetServiceStatusResponses, GetSubgraphInfoData, GetSubgraphInfoErrors, GetSubgraphInfoResponses, HandleHttpGetExtensionsGraphIdGraphqlGetData, HandleHttpGetExtensionsGraphIdGraphqlGetErrors, HandleHttpGetExtensionsGraphIdGraphqlGetResponses, HandleHttpPostExtensionsGraphIdGraphqlPostData, HandleHttpPostExtensionsGraphIdGraphqlPostErrors, HandleHttpPostExtensionsGraphIdGraphqlPostResponses, IndexDocumentData, IndexDocumentErrors, IndexDocumentResponses, InformationBlockData, InformationBlockErrors, InformationBlockResponses, IngestFileData, IngestFileErrors, IngestFileResponses, InitializeChartOfAccountsData, InitializeChartOfAccountsErrors, InitializeChartOfAccountsResponses, InitializeLedgerData, InitializeLedgerErrors, InitializeLedgerResponses, InitOAuthData, InitOAuthErrors, InitOAuthResponses, LinkEntityTaxonomyData, LinkEntityTaxonomyErrors, LinkEntityTaxonomyResponses, ListBackupsData, ListBackupsErrors, ListBackupsResponses, ListConnectionsData, ListConnectionsErrors, ListConnectionsResponses, ListCreditTransactionsData, ListCreditTransactionsErrors, ListCreditTransactionsResponses, ListDocumentsData, ListDocumentsErrors, ListDocumentsResponses, ListFilesData, ListFilesErrors, ListFilesResponses, ListGraphMembersData, ListGraphMembersErrors, ListGraphMembersResponses, ListGraphMutationsData, ListGraphMutationsErrors, ListGraphMutationsResponses, ListMemoriesData, ListMemoriesErrors, ListMemoriesResponses, ListOperatorsData, ListOperatorsErrors, ListOperatorsResponses, ListOrgGraphsData, ListOrgGraphsErrors, ListOrgGraphsResponses, ListOrgInvitationsData, ListOrgInvitationsErrors, ListOrgInvitationsResponses, ListOrgInvoicesData, ListOrgInvoicesErrors, ListOrgInvoicesResponses, ListOrgMembersData, ListOrgMembersErrors, ListOrgMembersResponses, ListOrgSubscriptionsData, ListOrgSubscriptionsErrors, ListOrgSubscriptionsResponses, ListSubgraphsData, ListSubgraphsErrors, ListSubgraphsResponses, ListTablesData, ListTablesErrors, ListTablesResponses, ListUserApiKeysData, ListUserApiKeysErrors, ListUserApiKeysResponses, ListUserOAuthGrantsData, ListUserOAuthGrantsErrors, ListUserOAuthGrantsResponses, ListUserOrgsData, ListUserOrgsErrors, ListUserOrgsResponses, ListUserPasskeysData, ListUserPasskeysErrors, ListUserPasskeysResponses, LiveFinancialStatementData, LiveFinancialStatementErrors, LiveFinancialStatementResponses, LoginUserData, LoginUserErrors, LoginUserResponses, LogoutUserData, LogoutUserErrors, LogoutUserResponses, MaterializeData, MaterializeErrors, MaterializeResponses, OauthCallbackData, OauthCallbackErrors, OauthCallbackResponses, PreviewEventBlockData, PreviewEventBlockErrors, PreviewEventBlockResponses, PreviewReconciliationsData, PreviewReconciliationsErrors, PreviewReconciliationsResponses, PreviewReconcilingItemData, PreviewReconcilingItemErrors, PreviewReconcilingItemResponses, PromoteObligationsData, PromoteObligationsErrors, PromoteObligationsResponses, ReadTextData, ReadTextErrors, ReadTextResponses, RebuildScheduleData, RebuildScheduleErrors, RebuildScheduleResponses, RecallMemoryData, RecallMemoryErrors, RecallMemoryResponses, RecordStatementBalanceData, RecordStatementBalanceErrors, RecordStatementBalanceResponses, RefreshAuthSessionData, RefreshAuthSessionErrors, RefreshAuthSessionResponses, RefreshReconciliationsData, RefreshReconciliationsErrors, RefreshReconciliationsResponses, RegenerateMfaRecoveryCodesData, RegenerateMfaRecoveryCodesErrors, RegenerateMfaRecoveryCodesResponses, RegenerateReportData, RegenerateReportErrors, RegenerateReportResponses, RegisterUserData, RegisterUserErrors, RegisterUserResponses, RememberData, RememberErrors, RememberResponses, RemoveGraphMemberData, RemoveGraphMemberErrors, RemoveGraphMemberResponses, RemoveOrgMemberData, RemoveOrgMemberErrors, RemoveOrgMemberResponses, RemovePublishListMemberData, RemovePublishListMemberErrors, RemovePublishListMemberResponses, ReopenPeriodData, ReopenPeriodErrors, ReopenPeriodResponses, ResendOrgInvitationData, ResendOrgInvitationErrors, ResendOrgInvitationResponses, ResendVerificationEmailData, ResendVerificationEmailErrors, ResendVerificationEmailResponses, ResetPasswordData, ResetPasswordErrors, ResetPasswordResponses, ResolveReconcilingItemData, ResolveReconcilingItemErrors, ResolveReconcilingItemResponses, ResumeOperationData, ResumeOperationErrors, ResumeOperationResponses, RevokeOrgInvitationData, RevokeOrgInvitationErrors, RevokeOrgInvitationResponses, RevokeReportShareData, RevokeReportShareErrors, RevokeReportShareResponses, RevokeUserApiKeyData, RevokeUserApiKeyErrors, RevokeUserApiKeyResponses, RevokeUserOAuthGrantData, RevokeUserOAuthGrantErrors, RevokeUserOAuthGrantResponses, SearchDocumentsData, SearchDocumentsErrors, SearchDocumentsResponses, SearchTextData, SearchTextErrors, SearchTextResponses, SelectGraphData, SelectGraphErrors, SelectGraphResponses, SetCloseTargetData, SetCloseTargetErrors, SetCloseTargetResponses, SetConnectionWritePolicyData, SetConnectionWritePolicyErrors, SetConnectionWritePolicyResponses, SetReconciliationPolicyData, SetReconciliationPolicyErrors, SetReconciliationPolicyResponses, ShareReportData, ShareReportErrors, ShareReportResponses, SignOffReconciliationData, SignOffReconciliationErrors, SignOffReconciliationResponses, SsoTokenExchangeData, SsoTokenExchangeErrors, SsoTokenExchangeResponses, StreamOperationEventsData, StreamOperationEventsErrors, StreamOperationEventsResponses, SyncConnectionData, SyncConnectionErrors, SyncConnectionResponses, TerminateScheduleData, TerminateScheduleErrors, TerminateScheduleResponses, TransitionFilingStatusData, TransitionFilingStatusErrors, TransitionFilingStatusResponses, UnblockSourceGraphData, UnblockSourceGraphErrors, UnblockSourceGraphResponses, UpdateAgentData, UpdateAgentErrors, UpdateAgentResponses, UpdateEntityData, UpdateEntityErrors, UpdateEntityResponses, UpdateEventBlockData, UpdateEventBlockErrors, UpdateEventBlockResponses, UpdateEventHandlerData, UpdateEventHandlerErrors, UpdateEventHandlerResponses, UpdateGraphMemberRoleData, UpdateGraphMemberRoleErrors, UpdateGraphMemberRoleResponses, UpdateGraphMetadataData, UpdateGraphMetadataErrors, UpdateGraphMetadataResponses, UpdateInformationBlockData, UpdateInformationBlockErrors, UpdateInformationBlockResponses, UpdateJournalEntryData, UpdateJournalEntryErrors, UpdateJournalEntryResponses, UpdateMemoryData, UpdateMemoryErrors, UpdateMemoryResponses, UpdateOrgData, UpdateOrgErrors, UpdateOrgMemberRoleData, UpdateOrgMemberRoleErrors, UpdateOrgMemberRoleResponses, UpdateOrgResponses, UpdatePortfolioBlockData, UpdatePortfolioBlockErrors, UpdatePortfolioBlockResponses, UpdatePublishListData, UpdatePublishListErrors, UpdatePublishListResponses, UpdateSecurityData, UpdateSecurityErrors, UpdateSecurityResponses, UpdateTaxonomyBlockData, UpdateTaxonomyBlockErrors, UpdateTaxonomyBlockResponses, UpdateUserApiKeyData, UpdateUserApiKeyErrors, UpdateUserApiKeyResponses, UpdateUserData, UpdateUserErrors, UpdateUserPasswordData, UpdateUserPasswordErrors, UpdateUserPasswordResponses, UpdateUserResponses, ValidateResetTokenData, ValidateResetTokenErrors, ValidateResetTokenResponses, ValidateSchemaData, ValidateSchemaErrors, ValidateSchemaResponses, VerifyEmailData, VerifyEmailErrors, VerifyEmailResponses, VerifyMfaData, VerifyMfaErrors, VerifyMfaResponses, VerifyPasskeyLoginData, VerifyPasskeyLoginErrors, VerifyPasskeyLoginResponses, VerifyPasskeyRegistrationData, VerifyPasskeyRegistrationErrors, VerifyPasskeyRegistrationResponses } from './types.gen';
5
+ import type { AddGraphMemberData, AddGraphMemberErrors, AddGraphMemberResponses, AddPublishListMembersData, AddPublishListMembersErrors, AddPublishListMembersResponses, AssertMetricsData, AssertMetricsErrors, AssertMetricsResponses, AutoMapElementsData, AutoMapElementsErrors, AutoMapElementsResponses, AutoSelectOperatorData, AutoSelectOperatorErrors, AutoSelectOperatorResponses, BackfillPlanHistoryData, BackfillPlanHistoryErrors, BackfillPlanHistoryResponses, BindTextBlockData, BindTextBlockErrors, BindTextBlockResponses, BlockSourceGraphData, BlockSourceGraphErrors, BlockSourceGraphResponses, BuildFactGridData, BuildFactGridErrors, BuildFactGridResponses, CancelOperationData, CancelOperationErrors, CancelOperationResponses, CancelOrgSubscriptionData, CancelOrgSubscriptionErrors, CancelOrgSubscriptionResponses, CancelRepositorySubscriptionData, CancelRepositorySubscriptionErrors, CancelRepositorySubscriptionResponses, ChangeReportingStyleData, ChangeReportingStyleErrors, ChangeReportingStyleResponses, ChangeSubscriptionPlanData, ChangeSubscriptionPlanErrors, ChangeSubscriptionPlanResponses, ChangeTierData, ChangeTierErrors, ChangeTierResponses, CheckPasswordStrengthData, CheckPasswordStrengthErrors, CheckPasswordStrengthResponses, ClosePeriodData, ClosePeriodErrors, ClosePeriodResponses, CompleteSsoAuthData, CompleteSsoAuthErrors, CompleteSsoAuthResponses, ComputeForecastData, ComputeForecastErrors, ComputeForecastResponses, ComputeMetricsData, ComputeMetricsErrors, ComputeMetricsResponses, CreateAgentData, CreateAgentErrors, CreateAgentResponses, CreateBackupData, CreateBackupErrors, CreateBackupResponses, CreateCheckoutSessionData, CreateCheckoutSessionErrors, CreateCheckoutSessionResponses, CreateConnectionData, CreateConnectionErrors, CreateConnectionResponses, CreateEntityData, CreateEntityErrors, CreateEntityResponses, CreateEventBlockData, CreateEventBlockErrors, CreateEventBlockResponses, CreateEventHandlerData, CreateEventHandlerErrors, CreateEventHandlerResponses, CreateFileUploadData, CreateFileUploadErrors, CreateFileUploadResponses, CreateGraphData, CreateGraphErrors, CreateGraphResponses, CreateInformationBlockData, CreateInformationBlockErrors, CreateInformationBlockResponses, CreateMappingAssociationData, CreateMappingAssociationErrors, CreateMappingAssociationResponses, CreateOrgInvitationData, CreateOrgInvitationErrors, CreateOrgInvitationResponses, CreatePortalSessionData, CreatePortalSessionErrors, CreatePortalSessionResponses, CreatePortfolioBlockData, CreatePortfolioBlockErrors, CreatePortfolioBlockResponses, CreatePublishListData, CreatePublishListErrors, CreatePublishListResponses, CreateReportData, CreateReportErrors, CreateReportResponses, CreateRepositorySubscriptionData, CreateRepositorySubscriptionErrors, CreateRepositorySubscriptionResponses, CreateSecurityData, CreateSecurityErrors, CreateSecurityResponses, CreateSubgraphData, CreateSubgraphErrors, CreateSubgraphResponses, CreateTaxonomyBlockData, CreateTaxonomyBlockErrors, CreateTaxonomyBlockResponses, CreateUserApiKeyData, CreateUserApiKeyErrors, CreateUserApiKeyResponses, DeleteConnectionData, DeleteConnectionErrors, DeleteConnectionResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteFileData, DeleteFileErrors, DeleteFileResponses, DeleteGraphData, DeleteGraphErrors, DeleteGraphResponses, DeleteInformationBlockData, DeleteInformationBlockErrors, DeleteInformationBlockResponses, DeleteJournalEntryData, DeleteJournalEntryErrors, DeleteJournalEntryResponses, DeleteMappingAssociationData, DeleteMappingAssociationErrors, DeleteMappingAssociationResponses, DeletePortfolioBlockData, DeletePortfolioBlockErrors, DeletePortfolioBlockResponses, DeletePublishListData, DeletePublishListErrors, DeletePublishListResponses, DeleteReportData, DeleteReportErrors, DeleteReportResponses, DeleteSecurityData, DeleteSecurityErrors, DeleteSecurityResponses, DeleteSubgraphData, DeleteSubgraphErrors, DeleteSubgraphResponses, DeleteTaxonomyBlockData, DeleteTaxonomyBlockErrors, DeleteTaxonomyBlockResponses, DeleteUserPasskeyData, DeleteUserPasskeyErrors, DeleteUserPasskeyResponses, DescribeFilingData, DescribeFilingErrors, DescribeFilingResponses, DisclosuresData, DisclosuresErrors, DisclosuresResponses, EvaluateRulesData, EvaluateRulesErrors, EvaluateRulesResponses, ExecuteCypherData, ExecuteCypherErrors, ExecuteCypherResponses, ExecuteEventBlockData, ExecuteEventBlockErrors, ExecuteEventBlockResponses, ExecuteSpecificOperatorData, ExecuteSpecificOperatorErrors, ExecuteSpecificOperatorResponses, ExecuteSqlData, ExecuteSqlErrors, ExecuteSqlResponses, ExportGraphSchemaData, ExportGraphSchemaErrors, ExportGraphSchemaResponses, FileReportData, FileReportErrors, FileReportResponses, FinancialStatementAnalysisData, FinancialStatementAnalysisErrors, FinancialStatementAnalysisResponses, ForgetData, ForgetErrors, ForgetResponses, ForgotPasswordData, ForgotPasswordErrors, ForgotPasswordResponses, GenerateSsoTokenData, GenerateSsoTokenErrors, GenerateSsoTokenResponses, GetAuthProvidersData, GetAuthProvidersErrors, GetAuthProvidersResponses, GetAvailableExtensionsData, GetAvailableExtensionsErrors, GetAvailableExtensionsResponses, GetAvailableGraphTiersData, GetAvailableGraphTiersErrors, GetAvailableGraphTiersResponses, GetBackupDownloadUrlData, GetBackupDownloadUrlErrors, GetBackupDownloadUrlResponses, GetBackupStatsData, GetBackupStatsErrors, GetBackupStatsResponses, GetCaptchaConfigData, GetCaptchaConfigErrors, GetCaptchaConfigResponses, GetCheckoutStatusData, GetCheckoutStatusErrors, GetCheckoutStatusResponses, GetConnectionData, GetConnectionErrors, GetConnectionOptionsData, GetConnectionOptionsErrors, GetConnectionOptionsResponses, GetConnectionResponses, GetCreditSummaryData, GetCreditSummaryErrors, GetCreditSummaryResponses, GetCurrentAuthUserData, GetCurrentAuthUserErrors, GetCurrentAuthUserResponses, GetCurrentUserData, GetCurrentUserErrors, GetCurrentUserResponses, GetDatabaseHealthData, GetDatabaseHealthErrors, GetDatabaseHealthResponses, GetDatabaseInfoData, GetDatabaseInfoErrors, GetDatabaseInfoResponses, GetDocumentData, GetDocumentErrors, GetDocumentResponses, GetDocumentSectionData, GetDocumentSectionErrors, GetDocumentSectionResponses, GetFileData, GetFileErrors, GetFileResponses, GetGraphCapacityData, GetGraphCapacityErrors, GetGraphCapacityResponses, GetGraphLimitsData, GetGraphLimitsErrors, GetGraphLimitsResponses, GetGraphMetricsData, GetGraphMetricsErrors, GetGraphMetricsResponses, GetGraphSchemaData, GetGraphSchemaErrors, GetGraphSchemaResponses, GetGraphsData, GetGraphsErrors, GetGraphsResponses, GetGraphSubscriptionData, GetGraphSubscriptionErrors, GetGraphSubscriptionResponses, GetGraphUsageData, GetGraphUsageErrors, GetGraphUsageResponses, GetInvitationPreviewData, GetInvitationPreviewErrors, GetInvitationPreviewResponses, GetMemoryData, GetMemoryErrors, GetMemoryResponses, GetMfaOptionsData, GetMfaOptionsErrors, GetMfaOptionsResponses, GetMfaStatusData, GetMfaStatusErrors, GetMfaStatusResponses, GetOperationStatusData, GetOperationStatusErrors, GetOperationStatusResponses, GetOperatorMetadataData, GetOperatorMetadataErrors, GetOperatorMetadataResponses, GetOrgBillingCustomerData, GetOrgBillingCustomerErrors, GetOrgBillingCustomerResponses, GetOrgData, GetOrgErrors, GetOrgLimitsData, GetOrgLimitsErrors, GetOrgLimitsResponses, GetOrgResponses, GetOrgSubscriptionData, GetOrgSubscriptionErrors, GetOrgSubscriptionResponses, GetOrgUpcomingInvoiceData, GetOrgUpcomingInvoiceErrors, GetOrgUpcomingInvoiceResponses, GetOrgUsageData, GetOrgUsageErrors, GetOrgUsageResponses, GetPasskeyLoginOptionsData, GetPasskeyLoginOptionsErrors, GetPasskeyLoginOptionsResponses, GetPasskeyReauthOptionsData, GetPasskeyReauthOptionsErrors, GetPasskeyReauthOptionsResponses, GetPasskeyRegistrationOptionsData, GetPasskeyRegistrationOptionsErrors, GetPasskeyRegistrationOptionsResponses, GetPasswordPolicyData, GetPasswordPolicyErrors, GetPasswordPolicyResponses, GetServiceOfferingsData, GetServiceOfferingsErrors, GetServiceOfferingsResponses, GetServiceStatusData, GetServiceStatusResponses, GetSubgraphInfoData, GetSubgraphInfoErrors, GetSubgraphInfoResponses, HandleHttpGetExtensionsGraphIdGraphqlGetData, HandleHttpGetExtensionsGraphIdGraphqlGetErrors, HandleHttpGetExtensionsGraphIdGraphqlGetResponses, HandleHttpPostExtensionsGraphIdGraphqlPostData, HandleHttpPostExtensionsGraphIdGraphqlPostErrors, HandleHttpPostExtensionsGraphIdGraphqlPostResponses, IndexDocumentData, IndexDocumentErrors, IndexDocumentResponses, InformationBlockData, InformationBlockErrors, InformationBlockResponses, IngestFileData, IngestFileErrors, IngestFileResponses, InitializeChartOfAccountsData, InitializeChartOfAccountsErrors, InitializeChartOfAccountsResponses, InitializeLedgerData, InitializeLedgerErrors, InitializeLedgerResponses, InitOAuthData, InitOAuthErrors, InitOAuthResponses, LinkEntityTaxonomyData, LinkEntityTaxonomyErrors, LinkEntityTaxonomyResponses, ListBackupsData, ListBackupsErrors, ListBackupsResponses, ListConnectionsData, ListConnectionsErrors, ListConnectionsResponses, ListCreditTransactionsData, ListCreditTransactionsErrors, ListCreditTransactionsResponses, ListDocumentsData, ListDocumentsErrors, ListDocumentsResponses, ListFilesData, ListFilesErrors, ListFilesResponses, ListGraphMembersData, ListGraphMembersErrors, ListGraphMembersResponses, ListGraphMutationsData, ListGraphMutationsErrors, ListGraphMutationsResponses, ListMemoriesData, ListMemoriesErrors, ListMemoriesResponses, ListOperatorsData, ListOperatorsErrors, ListOperatorsResponses, ListOrgGraphsData, ListOrgGraphsErrors, ListOrgGraphsResponses, ListOrgInvitationsData, ListOrgInvitationsErrors, ListOrgInvitationsResponses, ListOrgInvoicesData, ListOrgInvoicesErrors, ListOrgInvoicesResponses, ListOrgMembersData, ListOrgMembersErrors, ListOrgMembersResponses, ListOrgSubscriptionsData, ListOrgSubscriptionsErrors, ListOrgSubscriptionsResponses, ListSubgraphsData, ListSubgraphsErrors, ListSubgraphsResponses, ListTablesData, ListTablesErrors, ListTablesResponses, ListUserApiKeysData, ListUserApiKeysErrors, ListUserApiKeysResponses, ListUserOAuthGrantsData, ListUserOAuthGrantsErrors, ListUserOAuthGrantsResponses, ListUserOrgsData, ListUserOrgsErrors, ListUserOrgsResponses, ListUserPasskeysData, ListUserPasskeysErrors, ListUserPasskeysResponses, LiveFinancialStatementData, LiveFinancialStatementErrors, LiveFinancialStatementResponses, LoginUserData, LoginUserErrors, LoginUserResponses, LogoutUserData, LogoutUserErrors, LogoutUserResponses, MaterializeData, MaterializeErrors, MaterializeResponses, OauthCallbackData, OauthCallbackErrors, OauthCallbackResponses, PreviewEventBlockData, PreviewEventBlockErrors, PreviewEventBlockResponses, PreviewReconciliationsData, PreviewReconciliationsErrors, PreviewReconciliationsResponses, PreviewReconcilingItemData, PreviewReconcilingItemErrors, PreviewReconcilingItemResponses, PromoteObligationsData, PromoteObligationsErrors, PromoteObligationsResponses, ReadTextData, ReadTextErrors, ReadTextResponses, RebuildScheduleData, RebuildScheduleErrors, RebuildScheduleResponses, RecallMemoryData, RecallMemoryErrors, RecallMemoryResponses, RecordStatementBalanceData, RecordStatementBalanceErrors, RecordStatementBalanceResponses, RefreshAuthSessionData, RefreshAuthSessionErrors, RefreshAuthSessionResponses, RefreshReconciliationsData, RefreshReconciliationsErrors, RefreshReconciliationsResponses, RegenerateMfaRecoveryCodesData, RegenerateMfaRecoveryCodesErrors, RegenerateMfaRecoveryCodesResponses, RegenerateReportData, RegenerateReportErrors, RegenerateReportResponses, RegisterUserData, RegisterUserErrors, RegisterUserResponses, RememberData, RememberErrors, RememberResponses, RemoveGraphMemberData, RemoveGraphMemberErrors, RemoveGraphMemberResponses, RemoveOrgMemberData, RemoveOrgMemberErrors, RemoveOrgMemberResponses, RemovePublishListMemberData, RemovePublishListMemberErrors, RemovePublishListMemberResponses, ReopenPeriodData, ReopenPeriodErrors, ReopenPeriodResponses, ResendOrgInvitationData, ResendOrgInvitationErrors, ResendOrgInvitationResponses, ResendVerificationEmailData, ResendVerificationEmailErrors, ResendVerificationEmailResponses, ResetPasswordData, ResetPasswordErrors, ResetPasswordResponses, ResolveReconcilingItemData, ResolveReconcilingItemErrors, ResolveReconcilingItemResponses, ResumeOperationData, ResumeOperationErrors, ResumeOperationResponses, RevokeOrgInvitationData, RevokeOrgInvitationErrors, RevokeOrgInvitationResponses, RevokeReportShareData, RevokeReportShareErrors, RevokeReportShareResponses, RevokeUserApiKeyData, RevokeUserApiKeyErrors, RevokeUserApiKeyResponses, RevokeUserOAuthGrantData, RevokeUserOAuthGrantErrors, RevokeUserOAuthGrantResponses, SearchDocumentsData, SearchDocumentsErrors, SearchDocumentsResponses, SearchTextData, SearchTextErrors, SearchTextResponses, SetCloseTargetData, SetCloseTargetErrors, SetCloseTargetResponses, SetConnectionWritePolicyData, SetConnectionWritePolicyErrors, SetConnectionWritePolicyResponses, SetReconciliationPolicyData, SetReconciliationPolicyErrors, SetReconciliationPolicyResponses, SetSelectedGraphData, SetSelectedGraphErrors, SetSelectedGraphResponses, ShareReportData, ShareReportErrors, ShareReportResponses, SignOffReconciliationData, SignOffReconciliationErrors, SignOffReconciliationResponses, SsoTokenExchangeData, SsoTokenExchangeErrors, SsoTokenExchangeResponses, StreamOperationEventsData, StreamOperationEventsErrors, StreamOperationEventsResponses, SyncConnectionData, SyncConnectionErrors, SyncConnectionResponses, TerminateScheduleData, TerminateScheduleErrors, TerminateScheduleResponses, TransitionFilingStatusData, TransitionFilingStatusErrors, TransitionFilingStatusResponses, UnblockSourceGraphData, UnblockSourceGraphErrors, UnblockSourceGraphResponses, UpdateAgentData, UpdateAgentErrors, UpdateAgentResponses, UpdateEntityData, UpdateEntityErrors, UpdateEntityResponses, UpdateEventBlockData, UpdateEventBlockErrors, UpdateEventBlockResponses, UpdateEventHandlerData, UpdateEventHandlerErrors, UpdateEventHandlerResponses, UpdateGraphMemberRoleData, UpdateGraphMemberRoleErrors, UpdateGraphMemberRoleResponses, UpdateGraphMetadataData, UpdateGraphMetadataErrors, UpdateGraphMetadataResponses, UpdateInformationBlockData, UpdateInformationBlockErrors, UpdateInformationBlockResponses, UpdateJournalEntryData, UpdateJournalEntryErrors, UpdateJournalEntryResponses, UpdateMemoryData, UpdateMemoryErrors, UpdateMemoryResponses, UpdateOrgData, UpdateOrgErrors, UpdateOrgMemberRoleData, UpdateOrgMemberRoleErrors, UpdateOrgMemberRoleResponses, UpdateOrgResponses, UpdatePortfolioBlockData, UpdatePortfolioBlockErrors, UpdatePortfolioBlockResponses, UpdatePublishListData, UpdatePublishListErrors, UpdatePublishListResponses, UpdateSecurityData, UpdateSecurityErrors, UpdateSecurityResponses, UpdateTaxonomyBlockData, UpdateTaxonomyBlockErrors, UpdateTaxonomyBlockResponses, UpdateUserApiKeyData, UpdateUserApiKeyErrors, UpdateUserApiKeyResponses, UpdateUserData, UpdateUserErrors, UpdateUserPasswordData, UpdateUserPasswordErrors, UpdateUserPasswordResponses, UpdateUserResponses, ValidateResetTokenData, ValidateResetTokenErrors, ValidateResetTokenResponses, ValidateSchemaData, ValidateSchemaErrors, ValidateSchemaResponses, VerifyEmailData, VerifyEmailErrors, VerifyEmailResponses, VerifyMfaData, VerifyMfaErrors, VerifyMfaResponses, VerifyPasskeyLoginData, VerifyPasskeyLoginErrors, VerifyPasskeyLoginResponses, VerifyPasskeyRegistrationData, VerifyPasskeyRegistrationErrors, VerifyPasskeyRegistrationResponses } from './types.gen';
6
6
 
7
7
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
8
8
  /**
@@ -370,6 +370,21 @@ export const updateUserPassword = <ThrowOnError extends boolean = false>(options
370
370
  }
371
371
  });
372
372
 
373
+ /**
374
+ * Set Selected Graph
375
+ *
376
+ * Remembers the graph as the caller's current one: `GET /v1/graphs` then reports it as `selectedGraphId`, and the apps open on it. One graph per user, replacing the previous selection. Only a graph the caller belongs to can be selected; shared repositories cannot be.
377
+ */
378
+ export const setSelectedGraph = <ThrowOnError extends boolean = false>(options: Options<SetSelectedGraphData, ThrowOnError>): RequestResult<SetSelectedGraphResponses, SetSelectedGraphErrors, ThrowOnError> => (options.client ?? client).put<SetSelectedGraphResponses, SetSelectedGraphErrors, ThrowOnError>({
379
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
380
+ url: '/v1/user/selected-graph',
381
+ ...options,
382
+ headers: {
383
+ 'Content-Type': 'application/json',
384
+ ...options.headers
385
+ }
386
+ });
387
+
373
388
  /**
374
389
  * List API Keys
375
390
  *
@@ -587,21 +602,6 @@ export const getOrgUsage = <ThrowOnError extends boolean = false>(options: Optio
587
602
  ...options
588
603
  });
589
604
 
590
- /**
591
- * Sync Connection
592
- *
593
- * QuickBooks: fetches transactions, balances, and chart of accounts. Mercury: pulls the bank feed (a 60-day window by default, or from `since_date` / the full backfill on `full_rebuild`) and captures it into the inbox. Plaid: continues from the Item's stored cursor (added, modified and removed transactions), or replays its history on `full_rebuild` / `since_date`. For all three the envelope is `pending` with the run's `task_id`, and completion is reflected in the connection's `last_sync` timestamp and `last_sync_result`. External connections are push-based and have nothing to pull; the envelope is `completed` with a null `task_id` and a message saying so — there is nothing to poll. Returns an `OperationEnvelope`; supports `Idempotency-Key`.
594
- */
595
- export const syncConnection = <ThrowOnError extends boolean = false>(options: Options<SyncConnectionData, ThrowOnError>): RequestResult<SyncConnectionResponses, SyncConnectionErrors, ThrowOnError> => (options.client ?? client).post<SyncConnectionResponses, SyncConnectionErrors, ThrowOnError>({
596
- security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
597
- url: '/v1/graphs/{graph_id}/connections/{connection_id}/sync',
598
- ...options,
599
- headers: {
600
- 'Content-Type': 'application/json',
601
- ...options.headers
602
- }
603
- });
604
-
605
605
  /**
606
606
  * List Connection Options
607
607
  *
@@ -614,26 +614,22 @@ export const getConnectionOptions = <ThrowOnError extends boolean = false>(optio
614
614
  });
615
615
 
616
616
  /**
617
- * Initialize OAuth Flow
617
+ * List Connections
618
618
  */
619
- export const initOAuth = <ThrowOnError extends boolean = false>(options: Options<InitOAuthData, ThrowOnError>): RequestResult<InitOAuthResponses, InitOAuthErrors, ThrowOnError> => (options.client ?? client).post<InitOAuthResponses, InitOAuthErrors, ThrowOnError>({
619
+ export const listConnections = <ThrowOnError extends boolean = false>(options: Options<ListConnectionsData, ThrowOnError>): RequestResult<ListConnectionsResponses, ListConnectionsErrors, ThrowOnError> => (options.client ?? client).get<ListConnectionsResponses, ListConnectionsErrors, ThrowOnError>({
620
620
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
621
- url: '/v1/graphs/{graph_id}/connections/oauth/init',
622
- ...options,
623
- headers: {
624
- 'Content-Type': 'application/json',
625
- ...options.headers
626
- }
621
+ url: '/v1/graphs/{graph_id}/connections',
622
+ ...options
627
623
  });
628
624
 
629
625
  /**
630
- * OAuth Callback
626
+ * Create Connection
631
627
  *
632
- * Completes the OAuth authorization flow after provider redirect. Exchanges the authorization code for tokens, stores them, and triggers an initial sync. This is a redirect target — not typically called directly. Plaid: pass Link's public_token as `code`; a bank already connected to the graph is refused (409 DUPLICATE_BANK_CONNECTION).
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.
633
629
  */
634
- export const oauthCallback = <ThrowOnError extends boolean = false>(options: Options<OauthCallbackData, ThrowOnError>): RequestResult<OauthCallbackResponses, OauthCallbackErrors, ThrowOnError> => (options.client ?? client).post<OauthCallbackResponses, OauthCallbackErrors, ThrowOnError>({
630
+ export const createConnection = <ThrowOnError extends boolean = false>(options: Options<CreateConnectionData, ThrowOnError>): RequestResult<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError> => (options.client ?? client).post<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError>({
635
631
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
636
- url: '/v1/graphs/{graph_id}/connections/oauth/callback/{provider}',
632
+ url: '/v1/graphs/{graph_id}/connections',
637
633
  ...options,
638
634
  headers: {
639
635
  'Content-Type': 'application/json',
@@ -642,22 +638,26 @@ export const oauthCallback = <ThrowOnError extends boolean = false>(options: Opt
642
638
  });
643
639
 
644
640
  /**
645
- * List Connections
641
+ * Initialize OAuth Flow
646
642
  */
647
- export const listConnections = <ThrowOnError extends boolean = false>(options: Options<ListConnectionsData, ThrowOnError>): RequestResult<ListConnectionsResponses, ListConnectionsErrors, ThrowOnError> => (options.client ?? client).get<ListConnectionsResponses, ListConnectionsErrors, ThrowOnError>({
643
+ export const initOAuth = <ThrowOnError extends boolean = false>(options: Options<InitOAuthData, ThrowOnError>): RequestResult<InitOAuthResponses, InitOAuthErrors, ThrowOnError> => (options.client ?? client).post<InitOAuthResponses, InitOAuthErrors, ThrowOnError>({
648
644
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
649
- url: '/v1/graphs/{graph_id}/connections',
650
- ...options
645
+ url: '/v1/graphs/{graph_id}/connections/oauth/init',
646
+ ...options,
647
+ headers: {
648
+ 'Content-Type': 'application/json',
649
+ ...options.headers
650
+ }
651
651
  });
652
652
 
653
653
  /**
654
- * Create Connection
654
+ * OAuth Callback
655
655
  *
656
- * 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.
656
+ * Completes the OAuth authorization flow after provider redirect. Exchanges the authorization code for tokens, stores them, and triggers an initial sync. This is a redirect target — not typically called directly. Plaid: pass Link's public_token as `code`; a bank already connected to the graph is refused (409 DUPLICATE_BANK_CONNECTION).
657
657
  */
658
- export const createConnection = <ThrowOnError extends boolean = false>(options: Options<CreateConnectionData, ThrowOnError>): RequestResult<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError> => (options.client ?? client).post<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError>({
658
+ export const oauthCallback = <ThrowOnError extends boolean = false>(options: Options<OauthCallbackData, ThrowOnError>): RequestResult<OauthCallbackResponses, OauthCallbackErrors, ThrowOnError> => (options.client ?? client).post<OauthCallbackResponses, OauthCallbackErrors, ThrowOnError>({
659
659
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
660
- url: '/v1/graphs/{graph_id}/connections',
660
+ url: '/v1/graphs/{graph_id}/connections/oauth/callback/{provider}',
661
661
  ...options,
662
662
  headers: {
663
663
  'Content-Type': 'application/json',
@@ -685,6 +685,21 @@ export const getConnection = <ThrowOnError extends boolean = false>(options: Opt
685
685
  ...options
686
686
  });
687
687
 
688
+ /**
689
+ * Sync Connection
690
+ *
691
+ * QuickBooks: fetches transactions, balances, and chart of accounts. Mercury: pulls the bank feed (a 60-day window by default, or from `since_date` / the full backfill on `full_rebuild`) and captures it into the inbox. Plaid: continues from the Item's stored cursor (added, modified and removed transactions), or replays its history on `full_rebuild` / `since_date`. For all three the envelope is `pending` with the run's `task_id`, and completion is reflected in the connection's `last_sync` timestamp and `last_sync_result`. External connections are push-based and have nothing to pull; the envelope is `completed` with a null `task_id` and a message saying so — there is nothing to poll. Returns an `OperationEnvelope`; supports `Idempotency-Key`.
692
+ */
693
+ export const syncConnection = <ThrowOnError extends boolean = false>(options: Options<SyncConnectionData, ThrowOnError>): RequestResult<SyncConnectionResponses, SyncConnectionErrors, ThrowOnError> => (options.client ?? client).post<SyncConnectionResponses, SyncConnectionErrors, ThrowOnError>({
694
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
695
+ url: '/v1/graphs/{graph_id}/connections/{connection_id}/sync',
696
+ ...options,
697
+ headers: {
698
+ 'Content-Type': 'application/json',
699
+ ...options.headers
700
+ }
701
+ });
702
+
688
703
  /**
689
704
  * Set Connection Write Policy
690
705
  *
@@ -1453,15 +1468,6 @@ export const getGraphCapacity = <ThrowOnError extends boolean = false>(options?:
1453
1468
  ...options
1454
1469
  });
1455
1470
 
1456
- /**
1457
- * Select Graph
1458
- */
1459
- export const selectGraph = <ThrowOnError extends boolean = false>(options: Options<SelectGraphData, ThrowOnError>): RequestResult<SelectGraphResponses, SelectGraphErrors, ThrowOnError> => (options.client ?? client).post<SelectGraphResponses, SelectGraphErrors, ThrowOnError>({
1460
- security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
1461
- url: '/v1/graphs/{graph_id}/select',
1462
- ...options
1463
- });
1464
-
1465
1471
  /**
1466
1472
  * Validate Schema
1467
1473
  *
@@ -1699,7 +1705,7 @@ export const initializeLedger = <ThrowOnError extends boolean = false>(options:
1699
1705
  /**
1700
1706
  * Initialize Chart of Accounts
1701
1707
  *
1702
- * Create the graph's chart of accounts from a shipped template — the fresh-company path to native books. Use when the graph has NO chart (a QuickBooks-synced tenant never needs this: its chart arrives with the sync and stays after a sever) and before connecting a bank feed, which needs a chart to resolve against. Templates: `saas` (subscription software), `services` (professional services), `product` (inventory and COGS) — the `chartTemplates` GraphQL field lists them with names and account counts. Creates the chart, its `coa_mapping` structure and the template's CoA → rs-gaap mapping associations in one transaction, with the equity rows mapped by the entity's legal form (`entity_type`, defaulting to the graph's primary entity). One-time: 409 once a chart exists — a chart is never replaced. Customize afterwards with update-taxonomy-block; accounts that carry activity are never deleted.
1708
+ * Create the graph's chart of accounts from a shipped template — the fresh-company path to native books. Use when the graph has NO chart (a QuickBooks-synced tenant never needs this: its chart arrives with the sync and stays after a sever) and before connecting a bank feed, which needs a chart to resolve against. Templates: `saas` (subscription software), `services` (professional services), `product` (inventory and COGS) — the `chartTemplates` GraphQL field lists them with names and account counts. Creates the chart, its `coa_mapping` structure and the template's CoA → rs-gaap mapping associations in one transaction, with the equity rows mapped by the entity's legal form (`entity_type`, defaulting to the entity's). Each entity of the group keeps its own chart: `entity_id` names a subsidiary, omitted means the group parent. One-time per entity: 409 once that entity has a chart — a chart is never replaced. Customize afterwards with update-taxonomy-block; accounts that carry activity are never deleted.
1703
1709
  *
1704
1710
  * **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.
1705
1711
  */
@@ -1713,10 +1719,27 @@ export const initializeChartOfAccounts = <ThrowOnError extends boolean = false>(
1713
1719
  }
1714
1720
  });
1715
1721
 
1722
+ /**
1723
+ * Create Entity
1724
+ *
1725
+ * Add an entity to the graph's reporting group: a subsidiary under `parent_entity_id` (default the group parent) that keeps its own books, chart of accounts and close, on the group's fiscal cadence. A graph created without an entity gets this one as its group parent. Creates the entity row only — give it a chart next (initialize-chart-of-accounts with `entity_id`) and a calendar (initialize with `entity_id`); from then on every ledger operation takes `entity_id` to act in its books, and omitting it means the group parent. The Reporting Style follows `entity_type` unless `reporting_style_id` names one. `ticker` prefixes the entity's account names and must be unique in the graph (409). There is no cap on entities: a graph is one reporting group, and everyone with access to it sees every entity.
1726
+ *
1727
+ * **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.
1728
+ */
1729
+ export const createEntity = <ThrowOnError extends boolean = false>(options: Options<CreateEntityData, ThrowOnError>): RequestResult<CreateEntityResponses, CreateEntityErrors, ThrowOnError> => (options.client ?? client).post<CreateEntityResponses, CreateEntityErrors, ThrowOnError>({
1730
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
1731
+ url: '/extensions/roboledger/{graph_id}/operations/create-entity',
1732
+ ...options,
1733
+ headers: {
1734
+ 'Content-Type': 'application/json',
1735
+ ...options.headers
1736
+ }
1737
+ });
1738
+
1716
1739
  /**
1717
1740
  * Update Entity
1718
1741
  *
1719
- * Update the graph's primary entity. Only provided (non-null) fields are updated. The graph is implicit in the URL — the operation always targets the graph's primary entity.
1742
+ * Update an entity of the graph's reporting group. Only provided (non-null) fields are updated. Omit `entity_id` to target the group parent; name a subsidiary's id to edit it. `ownership_pct` is refused on the group parent (422), and `ticker` must stay unique in the graph (409).
1720
1743
  *
1721
1744
  * **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.
1722
1745
  */
@@ -2073,7 +2096,7 @@ export const updateEventBlock = <ThrowOnError extends boolean = false>(options:
2073
2096
  /**
2074
2097
  * Execute Event Block
2075
2098
  *
2076
- * For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the captured GL plan to the source-of-truth system (QuickBooks). Captures qb_txn_id on event.metadata.qb_external_id, transitions status to 'fulfilled' (or 'pending' on rejection), and promotes draft GL rows to 'posted'. Native-policy events fast-path through with no QB write — RoboSystems is the system of record.
2099
+ * For events on a connection with write_policy='qb_authoritative' or 'hybrid', publish the event's draft GL entries to the source-of-truth system (QuickBooks), each as its own JournalEntry. Records the QuickBooks ids per entry on event.metadata.qb_entry_ids and promotes the published entries to 'posted'; the event goes 'fulfilled' once no draft remains, or 'pending' on rejection (what landed is kept). Native-policy events fast-path through with no QB write — RoboSystems is the system of record.
2077
2100
  *
2078
2101
  * **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.
2079
2102
  */
@@ -2770,7 +2793,7 @@ export const readText = <ThrowOnError extends boolean = false>(options: Options<
2770
2793
  /**
2771
2794
  * Live Financial Statement
2772
2795
  *
2773
- * Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph materialization required. Rejected on shared-repository graphs; those should use `financial-statement-analysis` instead.
2796
+ * Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph materialization required. One entity's books: `entity_id` names a subsidiary, omitted means the group parent; `consolidated` on the parent combines every entity of the group at the rs-gaap concepts, with no eliminations. Rejected on shared-repository graphs; those should use `financial-statement-analysis` instead.
2774
2797
  *
2775
2798
  * **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.
2776
2799
  */