@finatic/client 0.9.3 → 0.9.4

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/dist/index.js CHANGED
@@ -637,7 +637,11 @@ function coerceEnumValue(input, EnumObj, enumName) {
637
637
  // Direct match by value (case-insensitive)
638
638
  const valueMatch = values.find(v => v.toLowerCase() === normalized.toLowerCase());
639
639
  if (valueMatch) {
640
- return valueMatch;
640
+ // Find the enum key that has this value
641
+ const matchingKey = Object.keys(EnumObj).find(k => EnumObj[k] === valueMatch);
642
+ if (matchingKey) {
643
+ return EnumObj[matchingKey]; // Returns enum member (e.g., BrokerDataOrderStatusEnum.Filled)
644
+ }
641
645
  }
642
646
  // Match by key name (case-insensitive)
643
647
  const keyMatch = Object.keys(EnumObj).find(k => String(k).toLowerCase() === normalized.toLowerCase());
@@ -785,34 +789,6 @@ exports.BrokerDataOrderSideEnum = void 0;
785
789
  BrokerDataOrderSideEnum["Sell"] = "sell";
786
790
  })(exports.BrokerDataOrderSideEnum || (exports.BrokerDataOrderSideEnum = {}));
787
791
 
788
- /* tslint:disable */
789
- /* eslint-disable */
790
- /**
791
- * Finatic FastAPI Backend
792
- * FinaticAPI REST API
793
- *
794
- * The version of the OpenAPI document: 1.0.0
795
- *
796
- *
797
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
798
- * https://openapi-generator.tech
799
- * Do not edit the class manually.
800
- */
801
- exports.BrokerDataOrderStatusEnum = void 0;
802
- (function (BrokerDataOrderStatusEnum) {
803
- BrokerDataOrderStatusEnum["Submitted"] = "submitted";
804
- BrokerDataOrderStatusEnum["New"] = "new";
805
- BrokerDataOrderStatusEnum["PartiallyFilled"] = "partially_filled";
806
- BrokerDataOrderStatusEnum["Filled"] = "filled";
807
- BrokerDataOrderStatusEnum["PendingCancel"] = "pending_cancel";
808
- BrokerDataOrderStatusEnum["Cancelled"] = "cancelled";
809
- BrokerDataOrderStatusEnum["Rejected"] = "rejected";
810
- BrokerDataOrderStatusEnum["Expired"] = "expired";
811
- BrokerDataOrderStatusEnum["Created"] = "created";
812
- BrokerDataOrderStatusEnum["Received"] = "received";
813
- BrokerDataOrderStatusEnum["Queued"] = "queued";
814
- })(exports.BrokerDataOrderStatusEnum || (exports.BrokerDataOrderStatusEnum = {}));
815
-
816
792
  /* tslint:disable */
817
793
  /* eslint-disable */
818
794
  /**
@@ -1396,6 +1372,23 @@ class PaginatedData {
1396
1372
  toLocaleString() {
1397
1373
  return this.items.toLocaleString();
1398
1374
  }
1375
+ /**
1376
+ * Convert to JSON - returns just the items array for serialization.
1377
+ * This allows clean serialization without exposing internal methods.
1378
+ *
1379
+ * @returns The items array
1380
+ *
1381
+ * @example
1382
+ * ```typescript
1383
+ * const orders = await sdk.getOrders();
1384
+ * console.log(orders); // Shows full PaginatedData with methods
1385
+ * console.log(orders.toJSON()); // Shows just the items array
1386
+ * JSON.stringify(orders); // Automatically uses toJSON()
1387
+ * ```
1388
+ */
1389
+ toJSON() {
1390
+ return this.items;
1391
+ }
1399
1392
  /**
1400
1393
  * Get the next page of data.
1401
1394
  * @returns Promise<PaginatedData<T>> - The next page (not wrapped in FinaticResponse)
@@ -1878,7 +1871,7 @@ class BrokersWrapper {
1878
1871
  });
1879
1872
  try {
1880
1873
  const response = await retryApiCall(async () => {
1881
- const apiResponse = await this.api.disconnectCompanyFromBrokerApiV1BrokersDisconnectCompanyConnectionIdDelete({ connectionId: resolvedParams.connectionId }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
1874
+ const apiResponse = await this.api.disconnectCompanyFromBrokerApiV1BrokersDisconnectCompanyConnectionIdDelete({ connectionId: resolvedParams.connectionId ?? null }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
1882
1875
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
1883
1876
  }, {}, this.sdkConfig);
1884
1877
  // Unwrap axios response immediately - get FinaticResponse object
@@ -1982,9 +1975,9 @@ class BrokersWrapper {
1982
1975
  * Returns orders from connections the company has read access to.
1983
1976
  * @param params.brokerId {string} (optional) Filter by broker ID
1984
1977
  * @param params.connectionId {string} (optional) Filter by connection ID
1985
- * @param params.accountId {string} (optional) Filter by broker provided account ID
1978
+ * @param params.accountId {string} (optional) Filter by broker provided account ID or internal account UUID
1986
1979
  * @param params.symbol {string} (optional) Filter by symbol
1987
- * @param params.orderStatus {BrokerDataOrderStatusEnum} (optional) Filter by order status (e.g., 'filled', 'pending_new', 'cancelled')
1980
+ * @param params.orderStatus {string} (optional) Filter by order status (e.g., 'filled', 'pending_new', 'cancelled')
1988
1981
  * @param params.side {BrokerDataOrderSideEnum} (optional) Filter by order side (e.g., 'buy', 'sell')
1989
1982
  * @param params.assetType {BrokerDataAssetTypeEnum} (optional) Filter by asset type (e.g., 'stock', 'option', 'crypto', 'future')
1990
1983
  * @param params.limit {number} (optional) Maximum number of orders to return
@@ -2030,14 +2023,17 @@ class BrokersWrapper {
2030
2023
  async getOrders(params) {
2031
2024
  // Use params object (with default empty object)
2032
2025
  const resolvedParams = params || {};
2033
- if (params?.orderStatus !== undefined) {
2034
- params.orderStatus = coerceEnumValue(params.orderStatus, exports.BrokerDataOrderStatusEnum, 'orderStatus');
2035
- }
2036
2026
  if (params?.side !== undefined) {
2037
- params.side = coerceEnumValue(params.side, exports.BrokerDataOrderSideEnum, 'side');
2027
+ const coerced = coerceEnumValue(params.side, exports.BrokerDataOrderSideEnum, 'side');
2028
+ if (coerced !== undefined) {
2029
+ params.side = coerced;
2030
+ }
2038
2031
  }
2039
2032
  if (params?.assetType !== undefined) {
2040
- params.assetType = coerceEnumValue(params.assetType, exports.BrokerDataAssetTypeEnum, 'assetType');
2033
+ const coerced = coerceEnumValue(params.assetType, exports.BrokerDataAssetTypeEnum, 'assetType');
2034
+ if (coerced !== undefined) {
2035
+ params.assetType = coerced;
2036
+ }
2041
2037
  } // Authentication check
2042
2038
  if (!this.sessionId || !this.companyId) {
2043
2039
  throw new Error('Session not initialized. Call startSession() first.');
@@ -2067,7 +2063,7 @@ class BrokersWrapper {
2067
2063
  });
2068
2064
  try {
2069
2065
  const response = await retryApiCall(async () => {
2070
- const apiResponse = await this.api.getOrdersApiV1BrokersDataOrdersGet({ brokerId: resolvedParams.brokerId, connectionId: resolvedParams.connectionId, accountId: resolvedParams.accountId, symbol: resolvedParams.symbol, orderStatus: resolvedParams.orderStatus, side: resolvedParams.side, assetType: resolvedParams.assetType, limit: resolvedParams.limit, offset: resolvedParams.offset, createdAfter: resolvedParams.createdAfter, createdBefore: resolvedParams.createdBefore, includeMetadata: resolvedParams.includeMetadata }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
2066
+ const apiResponse = await this.api.getOrdersApiV1BrokersDataOrdersGet({ ...(resolvedParams.brokerId !== undefined ? { brokerId: resolvedParams.brokerId } : {}), ...(resolvedParams.connectionId !== undefined ? { connectionId: resolvedParams.connectionId } : {}), ...(resolvedParams.accountId !== undefined ? { accountId: resolvedParams.accountId } : {}), ...(resolvedParams.symbol !== undefined ? { symbol: resolvedParams.symbol } : {}), ...(resolvedParams.orderStatus !== undefined ? { orderStatus: resolvedParams.orderStatus } : {}), ...(resolvedParams.side !== undefined ? { side: resolvedParams.side } : {}), ...(resolvedParams.assetType !== undefined ? { assetType: resolvedParams.assetType } : {}), ...(resolvedParams.limit !== undefined ? { limit: resolvedParams.limit } : {}), ...(resolvedParams.offset !== undefined ? { offset: resolvedParams.offset } : {}), ...(resolvedParams.createdAfter !== undefined ? { createdAfter: resolvedParams.createdAfter } : {}), ...(resolvedParams.createdBefore !== undefined ? { createdBefore: resolvedParams.createdBefore } : {}), ...(resolvedParams.includeMetadata !== undefined ? { includeMetadata: resolvedParams.includeMetadata } : {}) }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
2071
2067
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
2072
2068
  }, {}, this.sdkConfig);
2073
2069
  // Unwrap axios response immediately - get FinaticResponse object
@@ -2183,7 +2179,7 @@ class BrokersWrapper {
2183
2179
  * Returns positions from connections the company has read access to.
2184
2180
  * @param params.brokerId {string} (optional) Filter by broker ID
2185
2181
  * @param params.connectionId {string} (optional) Filter by connection ID
2186
- * @param params.accountId {string} (optional) Filter by broker provided account ID
2182
+ * @param params.accountId {string} (optional) Filter by broker provided account ID or internal account UUID
2187
2183
  * @param params.symbol {string} (optional) Filter by symbol
2188
2184
  * @param params.side {BrokerDataOrderSideEnum} (optional) Filter by position side (e.g., 'long', 'short')
2189
2185
  * @param params.assetType {BrokerDataAssetTypeEnum} (optional) Filter by asset type (e.g., 'stock', 'option', 'crypto', 'future')
@@ -2232,13 +2228,22 @@ class BrokersWrapper {
2232
2228
  // Use params object (with default empty object)
2233
2229
  const resolvedParams = params || {};
2234
2230
  if (params?.side !== undefined) {
2235
- params.side = coerceEnumValue(params.side, exports.BrokerDataOrderSideEnum, 'side');
2231
+ const coerced = coerceEnumValue(params.side, exports.BrokerDataOrderSideEnum, 'side');
2232
+ if (coerced !== undefined) {
2233
+ params.side = coerced;
2234
+ }
2236
2235
  }
2237
2236
  if (params?.assetType !== undefined) {
2238
- params.assetType = coerceEnumValue(params.assetType, exports.BrokerDataAssetTypeEnum, 'assetType');
2237
+ const coerced = coerceEnumValue(params.assetType, exports.BrokerDataAssetTypeEnum, 'assetType');
2238
+ if (coerced !== undefined) {
2239
+ params.assetType = coerced;
2240
+ }
2239
2241
  }
2240
2242
  if (params?.positionStatus !== undefined) {
2241
- params.positionStatus = coerceEnumValue(params.positionStatus, exports.BrokerDataPositionStatusEnum, 'positionStatus');
2243
+ const coerced = coerceEnumValue(params.positionStatus, exports.BrokerDataPositionStatusEnum, 'positionStatus');
2244
+ if (coerced !== undefined) {
2245
+ params.positionStatus = coerced;
2246
+ }
2242
2247
  } // Authentication check
2243
2248
  if (!this.sessionId || !this.companyId) {
2244
2249
  throw new Error('Session not initialized. Call startSession() first.');
@@ -2268,7 +2273,7 @@ class BrokersWrapper {
2268
2273
  });
2269
2274
  try {
2270
2275
  const response = await retryApiCall(async () => {
2271
- const apiResponse = await this.api.getPositionsApiV1BrokersDataPositionsGet({ brokerId: resolvedParams.brokerId, connectionId: resolvedParams.connectionId, accountId: resolvedParams.accountId, symbol: resolvedParams.symbol, side: resolvedParams.side, assetType: resolvedParams.assetType, positionStatus: resolvedParams.positionStatus, limit: resolvedParams.limit, offset: resolvedParams.offset, updatedAfter: resolvedParams.updatedAfter, updatedBefore: resolvedParams.updatedBefore, includeMetadata: resolvedParams.includeMetadata }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
2276
+ const apiResponse = await this.api.getPositionsApiV1BrokersDataPositionsGet({ ...(resolvedParams.brokerId !== undefined ? { brokerId: resolvedParams.brokerId } : {}), ...(resolvedParams.connectionId !== undefined ? { connectionId: resolvedParams.connectionId } : {}), ...(resolvedParams.accountId !== undefined ? { accountId: resolvedParams.accountId } : {}), ...(resolvedParams.symbol !== undefined ? { symbol: resolvedParams.symbol } : {}), ...(resolvedParams.side !== undefined ? { side: resolvedParams.side } : {}), ...(resolvedParams.assetType !== undefined ? { assetType: resolvedParams.assetType } : {}), ...(resolvedParams.positionStatus !== undefined ? { positionStatus: resolvedParams.positionStatus } : {}), ...(resolvedParams.limit !== undefined ? { limit: resolvedParams.limit } : {}), ...(resolvedParams.offset !== undefined ? { offset: resolvedParams.offset } : {}), ...(resolvedParams.updatedAfter !== undefined ? { updatedAfter: resolvedParams.updatedAfter } : {}), ...(resolvedParams.updatedBefore !== undefined ? { updatedBefore: resolvedParams.updatedBefore } : {}), ...(resolvedParams.includeMetadata !== undefined ? { includeMetadata: resolvedParams.includeMetadata } : {}) }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
2272
2277
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
2273
2278
  }, {}, this.sdkConfig);
2274
2279
  // Unwrap axios response immediately - get FinaticResponse object
@@ -2384,7 +2389,7 @@ class BrokersWrapper {
2384
2389
  * Returns balances from connections the company has read access to.
2385
2390
  * @param params.brokerId {string} (optional) Filter by broker ID
2386
2391
  * @param params.connectionId {string} (optional) Filter by connection ID
2387
- * @param params.accountId {string} (optional) Filter by broker provided account ID
2392
+ * @param params.accountId {string} (optional) Filter by broker provided account ID or internal account UUID
2388
2393
  * @param params.isEndOfDaySnapshot {boolean} (optional) Filter by end-of-day snapshot status (true/false)
2389
2394
  * @param params.limit {number} (optional) Maximum number of balances to return
2390
2395
  * @param params.offset {number} (optional) Number of balances to skip for pagination
@@ -2457,7 +2462,7 @@ class BrokersWrapper {
2457
2462
  });
2458
2463
  try {
2459
2464
  const response = await retryApiCall(async () => {
2460
- const apiResponse = await this.api.getBalancesApiV1BrokersDataBalancesGet({ brokerId: resolvedParams.brokerId, connectionId: resolvedParams.connectionId, accountId: resolvedParams.accountId, isEndOfDaySnapshot: resolvedParams.isEndOfDaySnapshot, limit: resolvedParams.limit, offset: resolvedParams.offset, balanceCreatedAfter: resolvedParams.balanceCreatedAfter, balanceCreatedBefore: resolvedParams.balanceCreatedBefore, includeMetadata: resolvedParams.includeMetadata }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
2465
+ const apiResponse = await this.api.getBalancesApiV1BrokersDataBalancesGet({ ...(resolvedParams.brokerId !== undefined ? { brokerId: resolvedParams.brokerId } : {}), ...(resolvedParams.connectionId !== undefined ? { connectionId: resolvedParams.connectionId } : {}), ...(resolvedParams.accountId !== undefined ? { accountId: resolvedParams.accountId } : {}), ...(resolvedParams.isEndOfDaySnapshot !== undefined ? { isEndOfDaySnapshot: resolvedParams.isEndOfDaySnapshot } : {}), ...(resolvedParams.limit !== undefined ? { limit: resolvedParams.limit } : {}), ...(resolvedParams.offset !== undefined ? { offset: resolvedParams.offset } : {}), ...(resolvedParams.balanceCreatedAfter !== undefined ? { balanceCreatedAfter: resolvedParams.balanceCreatedAfter } : {}), ...(resolvedParams.balanceCreatedBefore !== undefined ? { balanceCreatedBefore: resolvedParams.balanceCreatedBefore } : {}), ...(resolvedParams.includeMetadata !== undefined ? { includeMetadata: resolvedParams.includeMetadata } : {}) }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
2461
2466
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
2462
2467
  }, {}, this.sdkConfig);
2463
2468
  // Unwrap axios response immediately - get FinaticResponse object
@@ -2618,7 +2623,10 @@ class BrokersWrapper {
2618
2623
  // Use params object (with default empty object)
2619
2624
  const resolvedParams = params || {};
2620
2625
  if (params?.accountType !== undefined) {
2621
- params.accountType = coerceEnumValue(params.accountType, exports.BrokerDataAccountTypeEnum, 'accountType');
2626
+ const coerced = coerceEnumValue(params.accountType, exports.BrokerDataAccountTypeEnum, 'accountType');
2627
+ if (coerced !== undefined) {
2628
+ params.accountType = coerced;
2629
+ }
2622
2630
  } // Authentication check
2623
2631
  if (!this.sessionId || !this.companyId) {
2624
2632
  throw new Error('Session not initialized. Call startSession() first.');
@@ -2648,7 +2656,7 @@ class BrokersWrapper {
2648
2656
  });
2649
2657
  try {
2650
2658
  const response = await retryApiCall(async () => {
2651
- const apiResponse = await this.api.getAccountsApiV1BrokersDataAccountsGet({ brokerId: resolvedParams.brokerId, connectionId: resolvedParams.connectionId, accountType: resolvedParams.accountType, status: resolvedParams.status, currency: resolvedParams.currency, limit: resolvedParams.limit, offset: resolvedParams.offset, includeMetadata: resolvedParams.includeMetadata }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
2659
+ const apiResponse = await this.api.getAccountsApiV1BrokersDataAccountsGet({ ...(resolvedParams.brokerId !== undefined ? { brokerId: resolvedParams.brokerId } : {}), ...(resolvedParams.connectionId !== undefined ? { connectionId: resolvedParams.connectionId } : {}), ...(resolvedParams.accountType !== undefined ? { accountType: resolvedParams.accountType } : {}), ...(resolvedParams.status !== undefined ? { status: resolvedParams.status } : {}), ...(resolvedParams.currency !== undefined ? { currency: resolvedParams.currency } : {}), ...(resolvedParams.limit !== undefined ? { limit: resolvedParams.limit } : {}), ...(resolvedParams.offset !== undefined ? { offset: resolvedParams.offset } : {}), ...(resolvedParams.includeMetadata !== undefined ? { includeMetadata: resolvedParams.includeMetadata } : {}) }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
2652
2660
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
2653
2661
  }, {}, this.sdkConfig);
2654
2662
  // Unwrap axios response immediately - get FinaticResponse object
@@ -2837,7 +2845,7 @@ class BrokersWrapper {
2837
2845
  });
2838
2846
  try {
2839
2847
  const response = await retryApiCall(async () => {
2840
- const apiResponse = await this.api.getOrderFillsApiV1BrokersDataOrdersOrderIdFillsGet({ orderId: resolvedParams.orderId, connectionId: resolvedParams.connectionId, limit: resolvedParams.limit, offset: resolvedParams.offset, includeMetadata: resolvedParams.includeMetadata }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
2848
+ const apiResponse = await this.api.getOrderFillsApiV1BrokersDataOrdersOrderIdFillsGet({ orderId: resolvedParams.orderId ?? null, ...(resolvedParams.connectionId !== undefined ? { connectionId: resolvedParams.connectionId } : {}), ...(resolvedParams.limit !== undefined ? { limit: resolvedParams.limit } : {}), ...(resolvedParams.offset !== undefined ? { offset: resolvedParams.offset } : {}), ...(resolvedParams.includeMetadata !== undefined ? { includeMetadata: resolvedParams.includeMetadata } : {}) }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
2841
2849
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
2842
2850
  }, {}, this.sdkConfig);
2843
2851
  // Unwrap axios response immediately - get FinaticResponse object
@@ -3026,7 +3034,7 @@ class BrokersWrapper {
3026
3034
  });
3027
3035
  try {
3028
3036
  const response = await retryApiCall(async () => {
3029
- const apiResponse = await this.api.getOrderEventsApiV1BrokersDataOrdersOrderIdEventsGet({ orderId: resolvedParams.orderId, connectionId: resolvedParams.connectionId, limit: resolvedParams.limit, offset: resolvedParams.offset, includeMetadata: resolvedParams.includeMetadata }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
3037
+ const apiResponse = await this.api.getOrderEventsApiV1BrokersDataOrdersOrderIdEventsGet({ orderId: resolvedParams.orderId ?? null, ...(resolvedParams.connectionId !== undefined ? { connectionId: resolvedParams.connectionId } : {}), ...(resolvedParams.limit !== undefined ? { limit: resolvedParams.limit } : {}), ...(resolvedParams.offset !== undefined ? { offset: resolvedParams.offset } : {}), ...(resolvedParams.includeMetadata !== undefined ? { includeMetadata: resolvedParams.includeMetadata } : {}) }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
3030
3038
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
3031
3039
  }, {}, this.sdkConfig);
3032
3040
  // Unwrap axios response immediately - get FinaticResponse object
@@ -3212,7 +3220,7 @@ class BrokersWrapper {
3212
3220
  });
3213
3221
  try {
3214
3222
  const response = await retryApiCall(async () => {
3215
- const apiResponse = await this.api.getOrderGroupsApiV1BrokersDataOrdersGroupsGet({ brokerId: resolvedParams.brokerId, connectionId: resolvedParams.connectionId, limit: resolvedParams.limit, offset: resolvedParams.offset, createdAfter: resolvedParams.createdAfter, createdBefore: resolvedParams.createdBefore, includeMetadata: resolvedParams.includeMetadata }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
3223
+ const apiResponse = await this.api.getOrderGroupsApiV1BrokersDataOrdersGroupsGet({ ...(resolvedParams.brokerId !== undefined ? { brokerId: resolvedParams.brokerId } : {}), ...(resolvedParams.connectionId !== undefined ? { connectionId: resolvedParams.connectionId } : {}), ...(resolvedParams.limit !== undefined ? { limit: resolvedParams.limit } : {}), ...(resolvedParams.offset !== undefined ? { offset: resolvedParams.offset } : {}), ...(resolvedParams.createdAfter !== undefined ? { createdAfter: resolvedParams.createdAfter } : {}), ...(resolvedParams.createdBefore !== undefined ? { createdBefore: resolvedParams.createdBefore } : {}), ...(resolvedParams.includeMetadata !== undefined ? { includeMetadata: resolvedParams.includeMetadata } : {}) }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
3216
3224
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
3217
3225
  }, {}, this.sdkConfig);
3218
3226
  // Unwrap axios response immediately - get FinaticResponse object
@@ -3399,7 +3407,7 @@ class BrokersWrapper {
3399
3407
  });
3400
3408
  try {
3401
3409
  const response = await retryApiCall(async () => {
3402
- const apiResponse = await this.api.getPositionLotsApiV1BrokersDataPositionsLotsGet({ brokerId: resolvedParams.brokerId, connectionId: resolvedParams.connectionId, accountId: resolvedParams.accountId, symbol: resolvedParams.symbol, positionId: resolvedParams.positionId, limit: resolvedParams.limit, offset: resolvedParams.offset }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
3410
+ const apiResponse = await this.api.getPositionLotsApiV1BrokersDataPositionsLotsGet({ ...(resolvedParams.brokerId !== undefined ? { brokerId: resolvedParams.brokerId } : {}), ...(resolvedParams.connectionId !== undefined ? { connectionId: resolvedParams.connectionId } : {}), ...(resolvedParams.accountId !== undefined ? { accountId: resolvedParams.accountId } : {}), ...(resolvedParams.symbol !== undefined ? { symbol: resolvedParams.symbol } : {}), ...(resolvedParams.positionId !== undefined ? { positionId: resolvedParams.positionId } : {}), ...(resolvedParams.limit !== undefined ? { limit: resolvedParams.limit } : {}), ...(resolvedParams.offset !== undefined ? { offset: resolvedParams.offset } : {}) }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
3403
3411
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
3404
3412
  }, {}, this.sdkConfig);
3405
3413
  // Unwrap axios response immediately - get FinaticResponse object
@@ -3587,7 +3595,7 @@ class BrokersWrapper {
3587
3595
  });
3588
3596
  try {
3589
3597
  const response = await retryApiCall(async () => {
3590
- const apiResponse = await this.api.getPositionLotFillsApiV1BrokersDataPositionsLotsLotIdFillsGet({ lotId: resolvedParams.lotId, connectionId: resolvedParams.connectionId, limit: resolvedParams.limit, offset: resolvedParams.offset }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
3598
+ const apiResponse = await this.api.getPositionLotFillsApiV1BrokersDataPositionsLotsLotIdFillsGet({ lotId: resolvedParams.lotId ?? null, ...(resolvedParams.connectionId !== undefined ? { connectionId: resolvedParams.connectionId } : {}), ...(resolvedParams.limit !== undefined ? { limit: resolvedParams.limit } : {}), ...(resolvedParams.offset !== undefined ? { offset: resolvedParams.offset } : {}) }, { headers: { 'x-request-id': requestId, ...(this.sessionId && this.companyId ? { 'x-session-id': this.sessionId, 'x-company-id': this.companyId, ...(this.csrfToken ? { 'x-csrf-token': this.csrfToken } : {}) } : {}) } });
3591
3599
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
3592
3600
  }, {}, this.sdkConfig);
3593
3601
  // Unwrap axios response immediately - get FinaticResponse object
@@ -3785,7 +3793,7 @@ class CompanyWrapper {
3785
3793
  });
3786
3794
  try {
3787
3795
  const response = await retryApiCall(async () => {
3788
- const apiResponse = await this.api.getCompanyApiV1CompanyCompanyIdGet({ companyId: resolvedParams.companyId }, { headers: { 'x-request-id': requestId } });
3796
+ const apiResponse = await this.api.getCompanyApiV1CompanyCompanyIdGet({ companyId: resolvedParams.companyId ?? null }, { headers: { 'x-request-id': requestId } });
3789
3797
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
3790
3798
  }, {}, this.sdkConfig);
3791
3799
  // Unwrap axios response immediately - get FinaticResponse object
@@ -3967,7 +3975,7 @@ class SessionWrapper {
3967
3975
  });
3968
3976
  try {
3969
3977
  const response = await retryApiCall(async () => {
3970
- const apiResponse = await this.api.initSessionApiV1SessionInitPost({ xApiKey: resolvedParams.xApiKey }, { headers: { 'x-request-id': requestId } });
3978
+ const apiResponse = await this.api.initSessionApiV1SessionInitPost({ xApiKey: resolvedParams.xApiKey ?? null }, { headers: { 'x-request-id': requestId } });
3971
3979
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
3972
3980
  }, {}, this.sdkConfig);
3973
3981
  // Unwrap axios response immediately - get FinaticResponse object
@@ -4111,7 +4119,7 @@ class SessionWrapper {
4111
4119
  });
4112
4120
  try {
4113
4121
  const response = await retryApiCall(async () => {
4114
- const apiResponse = await this.api.startSessionApiV1SessionStartPost({ oneTimeToken: resolvedParams.OneTimeToken, sessionStartRequest: resolvedParams.body }, { headers: { 'x-request-id': requestId } });
4122
+ const apiResponse = await this.api.startSessionApiV1SessionStartPost({ oneTimeToken: resolvedParams.OneTimeToken ?? null, sessionStartRequest: resolvedParams.body ?? null }, { headers: { 'x-request-id': requestId } });
4115
4123
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
4116
4124
  }, {}, this.sdkConfig);
4117
4125
  // Unwrap axios response immediately - get FinaticResponse object
@@ -4423,7 +4431,7 @@ class SessionWrapper {
4423
4431
  });
4424
4432
  try {
4425
4433
  const response = await retryApiCall(async () => {
4426
- const apiResponse = await this.api.getSessionUserApiV1SessionSessionIdUserGet({ sessionId: resolvedParams.sessionId, xSessionId: resolvedParams.sessionId }, { headers: { 'x-request-id': requestId } });
4434
+ const apiResponse = await this.api.getSessionUserApiV1SessionSessionIdUserGet({ sessionId: resolvedParams.sessionId ?? null, xSessionId: resolvedParams.sessionId ?? null }, { headers: { 'x-request-id': requestId } });
4427
4435
  return await applyResponseInterceptors(apiResponse, this.sdkConfig);
4428
4436
  }, {}, this.sdkConfig);
4429
4437
  // Unwrap axios response immediately - get FinaticResponse object
@@ -5497,7 +5505,7 @@ const BrokersApiAxiosParamCreator = function (configuration) {
5497
5505
  * @summary Get Balances
5498
5506
  * @param {string | null} [brokerId] Filter by broker ID
5499
5507
  * @param {string | null} [connectionId] Filter by connection ID
5500
- * @param {string | null} [accountId] Filter by broker provided account ID
5508
+ * @param {string | null} [accountId] Filter by broker provided account ID or internal account UUID
5501
5509
  * @param {boolean | null} [isEndOfDaySnapshot] Filter by end-of-day snapshot status (true/false)
5502
5510
  * @param {number} [limit] Maximum number of balances to return
5503
5511
  * @param {number} [offset] Number of balances to skip for pagination
@@ -5734,9 +5742,9 @@ const BrokersApiAxiosParamCreator = function (configuration) {
5734
5742
  * @summary Get Orders
5735
5743
  * @param {string | null} [brokerId] Filter by broker ID
5736
5744
  * @param {string | null} [connectionId] Filter by connection ID
5737
- * @param {string | null} [accountId] Filter by broker provided account ID
5745
+ * @param {string | null} [accountId] Filter by broker provided account ID or internal account UUID
5738
5746
  * @param {string | null} [symbol] Filter by symbol
5739
- * @param {BrokerDataOrderStatusEnum | null} [orderStatus] Filter by order status (e.g., \&#39;filled\&#39;, \&#39;pending_new\&#39;, \&#39;cancelled\&#39;)
5747
+ * @param {string | null} [orderStatus] Filter by order status (e.g., \&#39;filled\&#39;, \&#39;pending_new\&#39;, \&#39;cancelled\&#39;)
5740
5748
  * @param {BrokerDataOrderSideEnum | null} [side] Filter by order side (e.g., \&#39;buy\&#39;, \&#39;sell\&#39;)
5741
5749
  * @param {BrokerDataAssetTypeEnum | null} [assetType] Filter by asset type (e.g., \&#39;stock\&#39;, \&#39;option\&#39;, \&#39;crypto\&#39;, \&#39;future\&#39;)
5742
5750
  * @param {number} [limit] Maximum number of orders to return
@@ -5905,7 +5913,7 @@ const BrokersApiAxiosParamCreator = function (configuration) {
5905
5913
  * @summary Get Positions
5906
5914
  * @param {string | null} [brokerId] Filter by broker ID
5907
5915
  * @param {string | null} [connectionId] Filter by connection ID
5908
- * @param {string | null} [accountId] Filter by broker provided account ID
5916
+ * @param {string | null} [accountId] Filter by broker provided account ID or internal account UUID
5909
5917
  * @param {string | null} [symbol] Filter by symbol
5910
5918
  * @param {BrokerDataOrderSideEnum | null} [side] Filter by position side (e.g., \&#39;long\&#39;, \&#39;short\&#39;)
5911
5919
  * @param {BrokerDataAssetTypeEnum | null} [assetType] Filter by asset type (e.g., \&#39;stock\&#39;, \&#39;option\&#39;, \&#39;crypto\&#39;, \&#39;future\&#39;)
@@ -6048,7 +6056,7 @@ const BrokersApiFp = function (configuration) {
6048
6056
  * @summary Get Balances
6049
6057
  * @param {string | null} [brokerId] Filter by broker ID
6050
6058
  * @param {string | null} [connectionId] Filter by connection ID
6051
- * @param {string | null} [accountId] Filter by broker provided account ID
6059
+ * @param {string | null} [accountId] Filter by broker provided account ID or internal account UUID
6052
6060
  * @param {boolean | null} [isEndOfDaySnapshot] Filter by end-of-day snapshot status (true/false)
6053
6061
  * @param {number} [limit] Maximum number of balances to return
6054
6062
  * @param {number} [offset] Number of balances to skip for pagination
@@ -6134,9 +6142,9 @@ const BrokersApiFp = function (configuration) {
6134
6142
  * @summary Get Orders
6135
6143
  * @param {string | null} [brokerId] Filter by broker ID
6136
6144
  * @param {string | null} [connectionId] Filter by connection ID
6137
- * @param {string | null} [accountId] Filter by broker provided account ID
6145
+ * @param {string | null} [accountId] Filter by broker provided account ID or internal account UUID
6138
6146
  * @param {string | null} [symbol] Filter by symbol
6139
- * @param {BrokerDataOrderStatusEnum | null} [orderStatus] Filter by order status (e.g., \&#39;filled\&#39;, \&#39;pending_new\&#39;, \&#39;cancelled\&#39;)
6147
+ * @param {string | null} [orderStatus] Filter by order status (e.g., \&#39;filled\&#39;, \&#39;pending_new\&#39;, \&#39;cancelled\&#39;)
6140
6148
  * @param {BrokerDataOrderSideEnum | null} [side] Filter by order side (e.g., \&#39;buy\&#39;, \&#39;sell\&#39;)
6141
6149
  * @param {BrokerDataAssetTypeEnum | null} [assetType] Filter by asset type (e.g., \&#39;stock\&#39;, \&#39;option\&#39;, \&#39;crypto\&#39;, \&#39;future\&#39;)
6142
6150
  * @param {number} [limit] Maximum number of orders to return
@@ -6193,7 +6201,7 @@ const BrokersApiFp = function (configuration) {
6193
6201
  * @summary Get Positions
6194
6202
  * @param {string | null} [brokerId] Filter by broker ID
6195
6203
  * @param {string | null} [connectionId] Filter by connection ID
6196
- * @param {string | null} [accountId] Filter by broker provided account ID
6204
+ * @param {string | null} [accountId] Filter by broker provided account ID or internal account UUID
6197
6205
  * @param {string | null} [symbol] Filter by symbol
6198
6206
  * @param {BrokerDataOrderSideEnum | null} [side] Filter by position side (e.g., \&#39;long\&#39;, \&#39;short\&#39;)
6199
6207
  * @param {BrokerDataAssetTypeEnum | null} [assetType] Filter by asset type (e.g., \&#39;stock\&#39;, \&#39;option\&#39;, \&#39;crypto\&#39;, \&#39;future\&#39;)