@firela/api-types 0.0.0-canary.a3c2cb48 → 0.0.0-canary.a43ffd21

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
@@ -484,7 +484,7 @@ var BeanAccountsService = class {
484
484
  * @param data.type Filter by account type
485
485
  * @param data.status Filter by status
486
486
  * @param data.isCustom Filter by custom (user-created) accounts only
487
- * @param data.search Search term for path or i18nKey
487
+ * @param data.search Search term for account path
488
488
  * @param data.limit Maximum number of results
489
489
  * @param data.offset Number of results to skip
490
490
  * @returns AccountListResponseDto Accounts retrieved successfully
@@ -556,7 +556,7 @@ var BeanAccountsService = class {
556
556
  }
557
557
  /**
558
558
  * Delete account
559
- * Deletes an account (only if no transactions)
559
+ * Deletes an account (only if no active transactions; voided/superseded residual postings are cleaned up)
560
560
  * @param data The data for the request.
561
561
  * @param data.id Account UUID
562
562
  * @param data.region Region code for tenant context
@@ -573,7 +573,7 @@ var BeanAccountsService = class {
573
573
  },
574
574
  errors: {
575
575
  404: "Account not found",
576
- 409: "Account has transactions and cannot be deleted"
576
+ 409: "Account has active transactions and cannot be deleted"
577
577
  }
578
578
  });
579
579
  }
@@ -629,6 +629,32 @@ var BeanAccountsService = class {
629
629
  }
630
630
  });
631
631
  }
632
+ /**
633
+ * Post an opening-balance transaction
634
+ * Posts a double-entry opening-balance transaction against Equity:Opening-Balances for an existing Assets/Liabilities account. At most one active opening balance per account.
635
+ * @param data The data for the request.
636
+ * @param data.id Account UUID
637
+ * @param data.region Region code for tenant context
638
+ * @param data.requestBody
639
+ * @returns OpeningBalanceResultDto Opening-balance transaction created
640
+ * @throws ApiError
641
+ */
642
+ static accountControllerAddOpeningBalance(data) {
643
+ return request(OpenAPI, {
644
+ method: "POST",
645
+ url: "/api/v1/{region}/bean/accounts/{id}/opening-balance",
646
+ path: {
647
+ id: data.id,
648
+ region: data.region
649
+ },
650
+ body: data.requestBody,
651
+ mediaType: "application/json",
652
+ errors: {
653
+ 404: "Account not found",
654
+ 409: "An opening balance already exists for this account"
655
+ }
656
+ });
657
+ }
632
658
  };
633
659
  var BeanTransactionsService = class {
634
660
  /**
@@ -667,9 +693,11 @@ var BeanTransactionsService = class {
667
693
  * @param data.offset Number of items to skip (default: 0)
668
694
  * @param data.dateFrom Filter by start date (inclusive), format: YYYY-MM-DD
669
695
  * @param data.dateTo Filter by end date (inclusive), format: YYYY-MM-DD
670
- * @param data.status Filter by transaction status
696
+ * @param data.status Filter by transaction status: single value, comma-separated multi-value (e.g. VOIDED,SUPERSEDED), or ALL to include audit rows. Defaults to ACTIVE-only (ADR-0128; previously unfiltered — breaking change).
671
697
  * @param data.search Search in narration and payee fields (max 200 chars)
672
698
  * @param data.accountId Filter by account ID (transactions with postings to this account)
699
+ * @param data.category Filter by ADR-0075 functional category (Group segment); matches any posting to an account whose derived Group segment equals this value. Must be accompanied by flow (ADR-0126).
700
+ * @param data.flow Required when category is present (400 otherwise) and vice versa (ADR-0126). Restricts the category account set to the flow root (income → Income:, expense → Expenses:) and drives the per-leg sign normalization of row viewpointAmount and the summary. OpenAPI cannot express conditional requiredness — the pairing is enforced at runtime.
673
701
  * @returns TransactionListResponseDto Transaction list
674
702
  * @throws ApiError
675
703
  */
@@ -687,25 +715,94 @@ var BeanTransactionsService = class {
687
715
  dateTo: data.dateTo,
688
716
  status: data.status,
689
717
  search: data.search,
690
- accountId: data.accountId
718
+ accountId: data.accountId,
719
+ category: data.category,
720
+ flow: data.flow
691
721
  },
692
722
  errors: {
723
+ 400: "Validation failed",
693
724
  401: "Authentication required"
694
725
  }
695
726
  });
696
727
  }
697
728
  /**
729
+ * @deprecated
730
+ * Batch create transactions (DEPRECATED)
731
+ * DEPRECATED: Use POST /:region/bean/import/provider/:name/sync instead. This endpoint skips dedup, rule matching, and review branching.
698
732
  * @param data The data for the request.
699
733
  * @param data.region Region code for tenant context
700
- * @returns unknown
734
+ * @param data.requestBody
735
+ * @returns BatchTransactionResponseDto Transactions processed
701
736
  * @throws ApiError
702
737
  */
703
- static transactionController(data) {
738
+ static transactionControllerCreateBatch(data) {
704
739
  return request(OpenAPI, {
705
740
  method: "POST",
706
741
  url: "/api/v1/{region}/bean/transactions/batch",
707
742
  path: {
708
743
  region: data.region
744
+ },
745
+ body: data.requestBody,
746
+ mediaType: "application/json",
747
+ errors: {
748
+ 400: "Invalid input",
749
+ 401: "Authentication required"
750
+ }
751
+ });
752
+ }
753
+ /**
754
+ * Correct (supersede) a transaction
755
+ * Atomically voids the original (SUPERSEDED) and creates a replacement through the full validation pipeline.
756
+ * @param data The data for the request.
757
+ * @param data.id Original transaction ID to correct
758
+ * @param data.region Region code for tenant context
759
+ * @param data.requestBody
760
+ * @returns TransactionDetailDto Corrected transaction created
761
+ * @throws ApiError
762
+ */
763
+ static transactionControllerCorrect(data) {
764
+ return request(OpenAPI, {
765
+ method: "POST",
766
+ url: "/api/v1/{region}/bean/transactions/{id}/correct",
767
+ path: {
768
+ id: data.id,
769
+ region: data.region
770
+ },
771
+ body: data.requestBody,
772
+ mediaType: "application/json",
773
+ errors: {
774
+ 404: "Original transaction not found",
775
+ 409: "Original no longer ACTIVE (concurrent modification)",
776
+ 422: "Pipeline validation failed (does not balance, invalid accounts)"
777
+ }
778
+ });
779
+ }
780
+ /**
781
+ * Suggest transaction tags
782
+ * Returns distinct tags from the user ACTIVE transactions, sorted by usage, for autocomplete. Optional q performs a case-insensitive prefix match.
783
+ * @param data The data for the request.
784
+ * @param data.region Region code for tenant context
785
+ * @param data.q Prefix match, case-insensitive (max 50 chars)
786
+ * @param data.sort usage (default) or name
787
+ * @param data.limit Max suggestions (1-100, default 10)
788
+ * @returns TagSuggestionsResponseDto Tag suggestions
789
+ * @throws ApiError
790
+ */
791
+ static transactionControllerSuggestTags(data) {
792
+ return request(OpenAPI, {
793
+ method: "GET",
794
+ url: "/api/v1/{region}/bean/transactions/tags",
795
+ path: {
796
+ region: data.region
797
+ },
798
+ query: {
799
+ q: data.q,
800
+ sort: data.sort,
801
+ limit: data.limit
802
+ },
803
+ errors: {
804
+ 400: "Validation failed",
805
+ 401: "Authentication required"
709
806
  }
710
807
  });
711
808
  }
@@ -760,17 +857,26 @@ var BeanTransactionsService = class {
760
857
  });
761
858
  }
762
859
  /**
860
+ * Void transaction
861
+ * Soft-deletes a transaction by marking it as VOIDED
763
862
  * @param data The data for the request.
863
+ * @param data.id Transaction ID
764
864
  * @param data.region Region code for tenant context
765
- * @returns void
865
+ * @returns void Transaction voided successfully
766
866
  * @throws ApiError
767
867
  */
768
- static transactionController1(data) {
868
+ static transactionControllerDelete(data) {
769
869
  return request(OpenAPI, {
770
870
  method: "DELETE",
771
871
  url: "/api/v1/{region}/bean/transactions/{id}",
772
872
  path: {
873
+ id: data.id,
773
874
  region: data.region
875
+ },
876
+ errors: {
877
+ 400: "Transaction already voided",
878
+ 401: "Authentication required",
879
+ 404: "Transaction not found"
774
880
  }
775
881
  });
776
882
  }
@@ -780,7 +886,8 @@ var BeanBalancesService = class {
780
886
  * Query account balance
781
887
  * Calculate account balance at a specific date for a single currency
782
888
  * @param data The data for the request.
783
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
889
+ * @param data.account Account name (e.g., "Assets:Checking")
890
+ * @param data.region Region code for tenant context
784
891
  * @param data.date Date to calculate balance at (ISO 8601 format)
785
892
  * @param data.currency Currency to query (e.g., "USD", "CNY")
786
893
  * @returns BalanceResponseDto Balance calculated successfully
@@ -790,6 +897,9 @@ var BeanBalancesService = class {
790
897
  return request(OpenAPI, {
791
898
  method: "GET",
792
899
  url: "/api/v1/{region}/bean/balances",
900
+ path: {
901
+ region: data.region
902
+ },
793
903
  query: {
794
904
  account: data.account,
795
905
  date: data.date,
@@ -804,13 +914,18 @@ var BeanBalancesService = class {
804
914
  /**
805
915
  * Query multi-currency account balance
806
916
  * Calculate account balances for all currencies at a specific date
917
+ * @param data The data for the request.
918
+ * @param data.region Region code for tenant context
807
919
  * @returns MultiCurrencyBalanceResponseDto Balances calculated successfully
808
920
  * @throws ApiError
809
921
  */
810
- static balanceControllerGetMultiCurrencyBalance() {
922
+ static balanceControllerGetMultiCurrencyBalance(data) {
811
923
  return request(OpenAPI, {
812
924
  method: "GET",
813
925
  url: "/api/v1/{region}/bean/balances/multi-currency",
926
+ path: {
927
+ region: data.region
928
+ },
814
929
  errors: {
815
930
  400: "Invalid query parameters",
816
931
  401: "User not authenticated"
@@ -820,17 +935,26 @@ var BeanBalancesService = class {
820
935
  };
821
936
  var BeanCommoditiesService = class {
822
937
  /**
938
+ * Create a new commodity
939
+ * Creates a new commodity definition for the authenticated user
823
940
  * @param data The data for the request.
824
941
  * @param data.region Region code for tenant context
825
- * @returns unknown
942
+ * @param data.requestBody
943
+ * @returns CommodityResponseDto Commodity created successfully
826
944
  * @throws ApiError
827
945
  */
828
- static commodityController(data) {
946
+ static commodityControllerCreate(data) {
829
947
  return request(OpenAPI, {
830
948
  method: "POST",
831
949
  url: "/api/v1/{region}/bean/commodities",
832
950
  path: {
833
951
  region: data.region
952
+ },
953
+ body: data.requestBody,
954
+ mediaType: "application/json",
955
+ errors: {
956
+ 400: "Invalid input data",
957
+ 409: "Commodity already exists"
834
958
  }
835
959
  });
836
960
  }
@@ -880,57 +1004,81 @@ var BeanCommoditiesService = class {
880
1004
  });
881
1005
  }
882
1006
  /**
1007
+ * Update commodity
1008
+ * Updates an existing commodity definition. Symbol cannot be changed.
883
1009
  * @param data The data for the request.
1010
+ * @param data.symbol Commodity symbol
884
1011
  * @param data.region Region code for tenant context
885
- * @returns unknown
1012
+ * @param data.requestBody
1013
+ * @returns CommodityResponseDto Commodity updated successfully
886
1014
  * @throws ApiError
887
1015
  */
888
- static commodityController1(data) {
1016
+ static commodityControllerUpdate(data) {
889
1017
  return request(OpenAPI, {
890
1018
  method: "PUT",
891
1019
  url: "/api/v1/{region}/bean/commodities/{symbol}",
892
1020
  path: {
1021
+ symbol: data.symbol,
893
1022
  region: data.region
1023
+ },
1024
+ body: data.requestBody,
1025
+ mediaType: "application/json",
1026
+ errors: {
1027
+ 400: "Invalid input data",
1028
+ 404: "Commodity not found"
894
1029
  }
895
1030
  });
896
1031
  }
897
1032
  /**
1033
+ * Delete commodity
1034
+ * Deletes a commodity definition
898
1035
  * @param data The data for the request.
1036
+ * @param data.symbol Commodity symbol
899
1037
  * @param data.region Region code for tenant context
900
- * @returns void
1038
+ * @returns void Commodity deleted successfully
901
1039
  * @throws ApiError
902
1040
  */
903
- static commodityController2(data) {
1041
+ static commodityControllerDelete(data) {
904
1042
  return request(OpenAPI, {
905
1043
  method: "DELETE",
906
1044
  url: "/api/v1/{region}/bean/commodities/{symbol}",
907
1045
  path: {
1046
+ symbol: data.symbol,
908
1047
  region: data.region
1048
+ },
1049
+ errors: {
1050
+ 404: "Commodity not found"
909
1051
  }
910
1052
  });
911
1053
  }
912
1054
  /**
1055
+ * Ensure commodity exists
1056
+ * Gets existing commodity or creates it with automatic initialization from OpenBB
913
1057
  * @param data The data for the request.
1058
+ * @param data.symbol Commodity symbol
914
1059
  * @param data.region Region code for tenant context
915
- * @returns unknown
1060
+ * @returns CommodityResponseDto Commodity retrieved or created
916
1061
  * @throws ApiError
917
1062
  */
918
- static commodityController3(data) {
1063
+ static commodityControllerGetOrCreate(data) {
919
1064
  return request(OpenAPI, {
920
1065
  method: "POST",
921
1066
  url: "/api/v1/{region}/bean/commodities/{symbol}/ensure",
922
1067
  path: {
1068
+ symbol: data.symbol,
923
1069
  region: data.region
924
1070
  }
925
1071
  });
926
1072
  }
927
1073
  /**
1074
+ * Bulk create commodities
1075
+ * Creates multiple commodities from a list of symbols, useful for initialization
928
1076
  * @param data The data for the request.
929
1077
  * @param data.region Region code for tenant context
930
- * @returns unknown
1078
+ * @returns CommodityResponseDto Commodities created successfully
931
1079
  * @throws ApiError
932
1080
  */
933
- static commodityController4(data) {
1081
+ static commodityControllerBulkCreate(data) {
934
1082
  return request(OpenAPI, {
935
1083
  method: "POST",
936
1084
  url: "/api/v1/{region}/bean/commodities/bulk",
@@ -966,7 +1114,7 @@ var ProviderSyncService = class {
966
1114
  *
967
1115
  * @param data The data for the request.
968
1116
  * @param data.providerName Provider name
969
- * @param data.region Region code
1117
+ * @param data.region Region code for tenant context
970
1118
  * @param data.requestBody
971
1119
  * @returns ProviderSyncResponseDto Sync completed successfully
972
1120
  * @throws ApiError
@@ -991,13 +1139,18 @@ var ProviderSyncService = class {
991
1139
  /**
992
1140
  * Get supported providers
993
1141
  * Returns a list of all providers supported by the sync endpoint.
1142
+ * @param data The data for the request.
1143
+ * @param data.region Region code for tenant context
994
1144
  * @returns SupportedProvidersResponseDto List of supported providers
995
1145
  * @throws ApiError
996
1146
  */
997
- static providerSyncControllerGetSupportedProviders() {
1147
+ static providerSyncControllerGetSupportedProviders(data) {
998
1148
  return request(OpenAPI, {
999
1149
  method: "GET",
1000
1150
  url: "/api/v1/{region}/bean/import/provider/supported",
1151
+ path: {
1152
+ region: data.region
1153
+ },
1001
1154
  errors: {
1002
1155
  401: "Missing or invalid authentication"
1003
1156
  }
@@ -1008,6 +1161,7 @@ var ProviderSyncService = class {
1008
1161
  * Returns whether a specific provider is supported.
1009
1162
  * @param data The data for the request.
1010
1163
  * @param data.providerName Provider name to check
1164
+ * @param data.region Region code for tenant context
1011
1165
  * @returns unknown Provider support status
1012
1166
  * @throws ApiError
1013
1167
  */
@@ -1016,7 +1170,8 @@ var ProviderSyncService = class {
1016
1170
  method: "GET",
1017
1171
  url: "/api/v1/{region}/bean/import/provider/{providerName}/supported",
1018
1172
  path: {
1019
- providerName: data.providerName
1173
+ providerName: data.providerName,
1174
+ region: data.region
1020
1175
  },
1021
1176
  errors: {
1022
1177
  401: "Missing or invalid authentication"
@@ -1053,6 +1208,20 @@ var HealthService = class {
1053
1208
  }
1054
1209
  });
1055
1210
  }
1211
+ /**
1212
+ * Check OpenBB schema status
1213
+ * @returns unknown OpenBB status
1214
+ * @throws ApiError
1215
+ */
1216
+ static healthControllerCheckOpenBb() {
1217
+ return request(OpenAPI, {
1218
+ method: "GET",
1219
+ url: "/api/v1/health/openbb",
1220
+ errors: {
1221
+ 503: "OpenBB unavailable"
1222
+ }
1223
+ });
1224
+ }
1056
1225
  /**
1057
1226
  * Check Redis connection health
1058
1227
  * @returns unknown Redis is healthy
@@ -1116,62 +1285,6 @@ var HealthService = class {
1116
1285
  }
1117
1286
  });
1118
1287
  }
1119
- /**
1120
- * Check health of a specific data enhancer
1121
- * @param data The data for the request.
1122
- * @param data.name Data enhancer name
1123
- * @returns unknown Data enhancer is healthy
1124
- * @throws ApiError
1125
- */
1126
- static healthControllerGetHealthOfDataEnhancer(data) {
1127
- return request(OpenAPI, {
1128
- method: "GET",
1129
- url: "/api/v1/health/data-enhancer/{name}",
1130
- path: {
1131
- name: data.name
1132
- },
1133
- errors: {
1134
- 401: "Unauthorized",
1135
- 503: "Data enhancer unavailable"
1136
- }
1137
- });
1138
- }
1139
- /**
1140
- * Check health of all data providers
1141
- * @returns unknown Data providers health status
1142
- * @throws ApiError
1143
- */
1144
- static healthControllerCheckDataProviders() {
1145
- return request(OpenAPI, {
1146
- method: "GET",
1147
- url: "/api/v1/health/data-providers",
1148
- errors: {
1149
- 401: "Unauthorized",
1150
- 503: "Data providers check failed"
1151
- }
1152
- });
1153
- }
1154
- /**
1155
- * Check health of a specific data provider
1156
- * @param data The data for the request.
1157
- * @param data.dataSource Data source identifier
1158
- * @returns unknown Data provider is healthy
1159
- * @throws ApiError
1160
- */
1161
- static healthControllerGetHealthOfDataProvider(data) {
1162
- return request(OpenAPI, {
1163
- method: "GET",
1164
- url: "/api/v1/health/data-provider/{dataSource}",
1165
- path: {
1166
- dataSource: data.dataSource
1167
- },
1168
- errors: {
1169
- 400: "Invalid data source",
1170
- 401: "Unauthorized",
1171
- 503: "Data provider unavailable"
1172
- }
1173
- });
1174
- }
1175
1288
  };
1176
1289
  // Annotate the CommonJS export names for ESM import in node:
1177
1290
  0 && (module.exports = {