@firela/api-types 0.0.0-canary.209967 → 0.0.0-canary.20e5bd10

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,11 +629,38 @@ 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
  /**
635
- * Create transaction
636
- * Creates a new double-entry transaction. Missing accounts are auto-created by default.
661
+ * @deprecated
662
+ * Create transaction (DEPRECATED)
663
+ * DEPRECATED: Use POST /:region/bean/import/provider/:name/sync instead. This endpoint skips dedup, rule matching, and review branching.
637
664
  * @param data The data for the request.
638
665
  * @param data.region Region code for tenant context
639
666
  * @param data.requestBody Transaction data with postings
@@ -669,6 +696,7 @@ var BeanTransactionsService = class {
669
696
  * @param data.status Filter by transaction status
670
697
  * @param data.search Search in narration and payee fields (max 200 chars)
671
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 Expenses/Income account whose derived Group segment equals this value
672
700
  * @returns TransactionListResponseDto Transaction list
673
701
  * @throws ApiError
674
702
  */
@@ -686,25 +714,93 @@ var BeanTransactionsService = class {
686
714
  dateTo: data.dateTo,
687
715
  status: data.status,
688
716
  search: data.search,
689
- accountId: data.accountId
717
+ accountId: data.accountId,
718
+ category: data.category
690
719
  },
691
720
  errors: {
721
+ 400: "Validation failed",
692
722
  401: "Authentication required"
693
723
  }
694
724
  });
695
725
  }
696
726
  /**
727
+ * @deprecated
728
+ * Batch create transactions (DEPRECATED)
729
+ * DEPRECATED: Use POST /:region/bean/import/provider/:name/sync instead. This endpoint skips dedup, rule matching, and review branching.
697
730
  * @param data The data for the request.
698
731
  * @param data.region Region code for tenant context
699
- * @returns unknown
732
+ * @param data.requestBody
733
+ * @returns BatchTransactionResponseDto Transactions processed
700
734
  * @throws ApiError
701
735
  */
702
- static transactionController(data) {
736
+ static transactionControllerCreateBatch(data) {
703
737
  return request(OpenAPI, {
704
738
  method: "POST",
705
739
  url: "/api/v1/{region}/bean/transactions/batch",
706
740
  path: {
707
741
  region: data.region
742
+ },
743
+ body: data.requestBody,
744
+ mediaType: "application/json",
745
+ errors: {
746
+ 400: "Invalid input",
747
+ 401: "Authentication required"
748
+ }
749
+ });
750
+ }
751
+ /**
752
+ * Correct (supersede) a transaction
753
+ * Atomically voids the original (SUPERSEDED) and creates a replacement through the full validation pipeline.
754
+ * @param data The data for the request.
755
+ * @param data.id Original transaction ID to correct
756
+ * @param data.region Region code for tenant context
757
+ * @param data.requestBody
758
+ * @returns TransactionDetailDto Corrected transaction created
759
+ * @throws ApiError
760
+ */
761
+ static transactionControllerCorrect(data) {
762
+ return request(OpenAPI, {
763
+ method: "POST",
764
+ url: "/api/v1/{region}/bean/transactions/{id}/correct",
765
+ path: {
766
+ id: data.id,
767
+ region: data.region
768
+ },
769
+ body: data.requestBody,
770
+ mediaType: "application/json",
771
+ errors: {
772
+ 404: "Original transaction not found",
773
+ 409: "Original no longer ACTIVE (concurrent modification)",
774
+ 422: "Pipeline validation failed (does not balance, invalid accounts)"
775
+ }
776
+ });
777
+ }
778
+ /**
779
+ * Suggest transaction tags
780
+ * Returns distinct tags from the user ACTIVE transactions, sorted by usage, for autocomplete. Optional q performs a case-insensitive prefix match.
781
+ * @param data The data for the request.
782
+ * @param data.region Region code for tenant context
783
+ * @param data.q Prefix match, case-insensitive (max 50 chars)
784
+ * @param data.sort usage (default) or name
785
+ * @param data.limit Max suggestions (1-100, default 10)
786
+ * @returns TagSuggestionsResponseDto Tag suggestions
787
+ * @throws ApiError
788
+ */
789
+ static transactionControllerSuggestTags(data) {
790
+ return request(OpenAPI, {
791
+ method: "GET",
792
+ url: "/api/v1/{region}/bean/transactions/tags",
793
+ path: {
794
+ region: data.region
795
+ },
796
+ query: {
797
+ q: data.q,
798
+ sort: data.sort,
799
+ limit: data.limit
800
+ },
801
+ errors: {
802
+ 400: "Validation failed",
803
+ 401: "Authentication required"
708
804
  }
709
805
  });
710
806
  }
@@ -759,17 +855,26 @@ var BeanTransactionsService = class {
759
855
  });
760
856
  }
761
857
  /**
858
+ * Void transaction
859
+ * Soft-deletes a transaction by marking it as VOIDED
762
860
  * @param data The data for the request.
861
+ * @param data.id Transaction ID
763
862
  * @param data.region Region code for tenant context
764
- * @returns void
863
+ * @returns void Transaction voided successfully
765
864
  * @throws ApiError
766
865
  */
767
- static transactionController1(data) {
866
+ static transactionControllerDelete(data) {
768
867
  return request(OpenAPI, {
769
868
  method: "DELETE",
770
869
  url: "/api/v1/{region}/bean/transactions/{id}",
771
870
  path: {
871
+ id: data.id,
772
872
  region: data.region
873
+ },
874
+ errors: {
875
+ 400: "Transaction already voided",
876
+ 401: "Authentication required",
877
+ 404: "Transaction not found"
773
878
  }
774
879
  });
775
880
  }
@@ -779,8 +884,8 @@ var BeanBalancesService = class {
779
884
  * Query account balance
780
885
  * Calculate account balance at a specific date for a single currency
781
886
  * @param data The data for the request.
782
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
783
- * @param data.region Region code (cn, us, de)
887
+ * @param data.account Account name (e.g., "Assets:Checking")
888
+ * @param data.region Region code for tenant context
784
889
  * @param data.date Date to calculate balance at (ISO 8601 format)
785
890
  * @param data.currency Currency to query (e.g., "USD", "CNY")
786
891
  * @returns BalanceResponseDto Balance calculated successfully
@@ -808,7 +913,7 @@ var BeanBalancesService = class {
808
913
  * Query multi-currency account balance
809
914
  * Calculate account balances for all currencies at a specific date
810
915
  * @param data The data for the request.
811
- * @param data.region Region code (cn, us, de)
916
+ * @param data.region Region code for tenant context
812
917
  * @returns MultiCurrencyBalanceResponseDto Balances calculated successfully
813
918
  * @throws ApiError
814
919
  */
@@ -828,17 +933,26 @@ var BeanBalancesService = class {
828
933
  };
829
934
  var BeanCommoditiesService = class {
830
935
  /**
936
+ * Create a new commodity
937
+ * Creates a new commodity definition for the authenticated user
831
938
  * @param data The data for the request.
832
- * @param data.region Region code (cn, us, de)
833
- * @returns unknown
939
+ * @param data.region Region code for tenant context
940
+ * @param data.requestBody
941
+ * @returns CommodityResponseDto Commodity created successfully
834
942
  * @throws ApiError
835
943
  */
836
- static commodityController(data) {
944
+ static commodityControllerCreate(data) {
837
945
  return request(OpenAPI, {
838
946
  method: "POST",
839
947
  url: "/api/v1/{region}/bean/commodities",
840
948
  path: {
841
949
  region: data.region
950
+ },
951
+ body: data.requestBody,
952
+ mediaType: "application/json",
953
+ errors: {
954
+ 400: "Invalid input data",
955
+ 409: "Commodity already exists"
842
956
  }
843
957
  });
844
958
  }
@@ -846,7 +960,7 @@ var BeanCommoditiesService = class {
846
960
  * List user commodities
847
961
  * Returns all commodity definitions for the authenticated user with optional filtering
848
962
  * @param data The data for the request.
849
- * @param data.region Region code (cn, us, de)
963
+ * @param data.region Region code for tenant context
850
964
  * @param data.search Search term for symbol or metadata fields (partial match). Searches symbol and metadata.name.
851
965
  * @param data.symbol Filter by exact symbol match
852
966
  * @returns CommodityListResponseDto Commodities retrieved successfully
@@ -870,7 +984,7 @@ var BeanCommoditiesService = class {
870
984
  * Returns a specific commodity definition by its symbol
871
985
  * @param data The data for the request.
872
986
  * @param data.symbol Commodity symbol
873
- * @param data.region Region code (cn, us, de)
987
+ * @param data.region Region code for tenant context
874
988
  * @returns CommodityResponseDto Commodity retrieved successfully
875
989
  * @throws ApiError
876
990
  */
@@ -888,57 +1002,81 @@ var BeanCommoditiesService = class {
888
1002
  });
889
1003
  }
890
1004
  /**
1005
+ * Update commodity
1006
+ * Updates an existing commodity definition. Symbol cannot be changed.
891
1007
  * @param data The data for the request.
892
- * @param data.region Region code (cn, us, de)
893
- * @returns unknown
1008
+ * @param data.symbol Commodity symbol
1009
+ * @param data.region Region code for tenant context
1010
+ * @param data.requestBody
1011
+ * @returns CommodityResponseDto Commodity updated successfully
894
1012
  * @throws ApiError
895
1013
  */
896
- static commodityController1(data) {
1014
+ static commodityControllerUpdate(data) {
897
1015
  return request(OpenAPI, {
898
1016
  method: "PUT",
899
1017
  url: "/api/v1/{region}/bean/commodities/{symbol}",
900
1018
  path: {
1019
+ symbol: data.symbol,
901
1020
  region: data.region
1021
+ },
1022
+ body: data.requestBody,
1023
+ mediaType: "application/json",
1024
+ errors: {
1025
+ 400: "Invalid input data",
1026
+ 404: "Commodity not found"
902
1027
  }
903
1028
  });
904
1029
  }
905
1030
  /**
1031
+ * Delete commodity
1032
+ * Deletes a commodity definition
906
1033
  * @param data The data for the request.
907
- * @param data.region Region code (cn, us, de)
908
- * @returns void
1034
+ * @param data.symbol Commodity symbol
1035
+ * @param data.region Region code for tenant context
1036
+ * @returns void Commodity deleted successfully
909
1037
  * @throws ApiError
910
1038
  */
911
- static commodityController2(data) {
1039
+ static commodityControllerDelete(data) {
912
1040
  return request(OpenAPI, {
913
1041
  method: "DELETE",
914
1042
  url: "/api/v1/{region}/bean/commodities/{symbol}",
915
1043
  path: {
1044
+ symbol: data.symbol,
916
1045
  region: data.region
1046
+ },
1047
+ errors: {
1048
+ 404: "Commodity not found"
917
1049
  }
918
1050
  });
919
1051
  }
920
1052
  /**
1053
+ * Ensure commodity exists
1054
+ * Gets existing commodity or creates it with automatic initialization from OpenBB
921
1055
  * @param data The data for the request.
922
- * @param data.region Region code (cn, us, de)
923
- * @returns unknown
1056
+ * @param data.symbol Commodity symbol
1057
+ * @param data.region Region code for tenant context
1058
+ * @returns CommodityResponseDto Commodity retrieved or created
924
1059
  * @throws ApiError
925
1060
  */
926
- static commodityController3(data) {
1061
+ static commodityControllerGetOrCreate(data) {
927
1062
  return request(OpenAPI, {
928
1063
  method: "POST",
929
1064
  url: "/api/v1/{region}/bean/commodities/{symbol}/ensure",
930
1065
  path: {
1066
+ symbol: data.symbol,
931
1067
  region: data.region
932
1068
  }
933
1069
  });
934
1070
  }
935
1071
  /**
1072
+ * Bulk create commodities
1073
+ * Creates multiple commodities from a list of symbols, useful for initialization
936
1074
  * @param data The data for the request.
937
- * @param data.region Region code (cn, us, de)
938
- * @returns unknown
1075
+ * @param data.region Region code for tenant context
1076
+ * @returns CommodityResponseDto Commodities created successfully
939
1077
  * @throws ApiError
940
1078
  */
941
- static commodityController4(data) {
1079
+ static commodityControllerBulkCreate(data) {
942
1080
  return request(OpenAPI, {
943
1081
  method: "POST",
944
1082
  url: "/api/v1/{region}/bean/commodities/bulk",
@@ -962,6 +1100,7 @@ var ProviderSyncService = class {
962
1100
  * - **simplefin**: SimpleFIN (Self-hosted)
963
1101
  * - **yodlee**: Yodlee (Global)
964
1102
  * - **beancount-direct**: Beancount format transactions
1103
+ * - **parsed-bill**: Client-side parsed bill transactions
965
1104
  *
966
1105
  * **Processing Flow:**
967
1106
  * 1. Transform raw data via provider adapter
@@ -973,7 +1112,7 @@ var ProviderSyncService = class {
973
1112
  *
974
1113
  * @param data The data for the request.
975
1114
  * @param data.providerName Provider name
976
- * @param data.region Region code
1115
+ * @param data.region Region code for tenant context
977
1116
  * @param data.requestBody
978
1117
  * @returns ProviderSyncResponseDto Sync completed successfully
979
1118
  * @throws ApiError
@@ -999,7 +1138,7 @@ var ProviderSyncService = class {
999
1138
  * Get supported providers
1000
1139
  * Returns a list of all providers supported by the sync endpoint.
1001
1140
  * @param data The data for the request.
1002
- * @param data.region Region code (cn, us, de)
1141
+ * @param data.region Region code for tenant context
1003
1142
  * @returns SupportedProvidersResponseDto List of supported providers
1004
1143
  * @throws ApiError
1005
1144
  */
@@ -1020,7 +1159,7 @@ var ProviderSyncService = class {
1020
1159
  * Returns whether a specific provider is supported.
1021
1160
  * @param data The data for the request.
1022
1161
  * @param data.providerName Provider name to check
1023
- * @param data.region Region code (cn, us, de)
1162
+ * @param data.region Region code for tenant context
1024
1163
  * @returns unknown Provider support status
1025
1164
  * @throws ApiError
1026
1165
  */
@@ -1041,18 +1180,13 @@ var ProviderSyncService = class {
1041
1180
  var HealthService = class {
1042
1181
  /**
1043
1182
  * Basic health check for K8s/load balancer probes
1044
- * @param data The data for the request.
1045
- * @param data.region Region code (cn, us, de)
1046
1183
  * @returns unknown Service is healthy
1047
1184
  * @throws ApiError
1048
1185
  */
1049
- static healthControllerGetHealth(data) {
1186
+ static healthControllerGetHealth() {
1050
1187
  return request(OpenAPI, {
1051
1188
  method: "GET",
1052
1189
  url: "/api/v1/health",
1053
- path: {
1054
- region: data.region
1055
- },
1056
1190
  errors: {
1057
1191
  503: "Service unavailable"
1058
1192
  }
@@ -1060,37 +1194,41 @@ var HealthService = class {
1060
1194
  }
1061
1195
  /**
1062
1196
  * Check database connection health
1063
- * @param data The data for the request.
1064
- * @param data.region Region code (cn, us, de)
1065
1197
  * @returns unknown Database is healthy
1066
1198
  * @throws ApiError
1067
1199
  */
1068
- static healthControllerCheckDatabase(data) {
1200
+ static healthControllerCheckDatabase() {
1069
1201
  return request(OpenAPI, {
1070
1202
  method: "GET",
1071
1203
  url: "/api/v1/health/database",
1072
- path: {
1073
- region: data.region
1074
- },
1075
1204
  errors: {
1076
1205
  503: "Database unavailable"
1077
1206
  }
1078
1207
  });
1079
1208
  }
1209
+ /**
1210
+ * Check OpenBB schema status
1211
+ * @returns unknown OpenBB status
1212
+ * @throws ApiError
1213
+ */
1214
+ static healthControllerCheckOpenBb() {
1215
+ return request(OpenAPI, {
1216
+ method: "GET",
1217
+ url: "/api/v1/health/openbb",
1218
+ errors: {
1219
+ 503: "OpenBB unavailable"
1220
+ }
1221
+ });
1222
+ }
1080
1223
  /**
1081
1224
  * Check Redis connection health
1082
- * @param data The data for the request.
1083
- * @param data.region Region code (cn, us, de)
1084
1225
  * @returns unknown Redis is healthy
1085
1226
  * @throws ApiError
1086
1227
  */
1087
- static healthControllerCheckRedis(data) {
1228
+ static healthControllerCheckRedis() {
1088
1229
  return request(OpenAPI, {
1089
1230
  method: "GET",
1090
1231
  url: "/api/v1/health/redis",
1091
- path: {
1092
- region: data.region
1093
- },
1094
1232
  errors: {
1095
1233
  503: "Redis unavailable"
1096
1234
  }
@@ -1098,18 +1236,13 @@ var HealthService = class {
1098
1236
  }
1099
1237
  /**
1100
1238
  * Get status of all circuit breakers
1101
- * @param data The data for the request.
1102
- * @param data.region Region code (cn, us, de)
1103
1239
  * @returns unknown Circuit breaker status
1104
1240
  * @throws ApiError
1105
1241
  */
1106
- static healthControllerGetCircuitBreakersHealth(data) {
1242
+ static healthControllerGetCircuitBreakersHealth() {
1107
1243
  return request(OpenAPI, {
1108
1244
  method: "GET",
1109
1245
  url: "/api/v1/health/circuit-breakers",
1110
- path: {
1111
- region: data.region
1112
- },
1113
1246
  errors: {
1114
1247
  401: "Unauthorized",
1115
1248
  500: "Internal error"
@@ -1120,7 +1253,6 @@ var HealthService = class {
1120
1253
  * Reset a circuit breaker to CLOSED state
1121
1254
  * @param data The data for the request.
1122
1255
  * @param data.name Circuit breaker name to reset
1123
- * @param data.region Region code (cn, us, de)
1124
1256
  * @returns unknown Circuit breaker reset successfully
1125
1257
  * @throws ApiError
1126
1258
  */
@@ -1129,8 +1261,7 @@ var HealthService = class {
1129
1261
  method: "POST",
1130
1262
  url: "/api/v1/health/circuit-breakers/{name}/reset",
1131
1263
  path: {
1132
- name: data.name,
1133
- region: data.region
1264
+ name: data.name
1134
1265
  },
1135
1266
  errors: {
1136
1267
  401: "Unauthorized",
@@ -1140,88 +1271,18 @@ var HealthService = class {
1140
1271
  }
1141
1272
  /**
1142
1273
  * Get health check metrics and statistics
1143
- * @param data The data for the request.
1144
- * @param data.region Region code (cn, us, de)
1145
1274
  * @returns unknown Health metrics
1146
1275
  * @throws ApiError
1147
1276
  */
1148
- static healthControllerGetMetrics(data) {
1277
+ static healthControllerGetMetrics() {
1149
1278
  return request(OpenAPI, {
1150
1279
  method: "GET",
1151
1280
  url: "/api/v1/health/metrics",
1152
- path: {
1153
- region: data.region
1154
- },
1155
1281
  errors: {
1156
1282
  401: "Unauthorized"
1157
1283
  }
1158
1284
  });
1159
1285
  }
1160
- /**
1161
- * Check health of a specific data enhancer
1162
- * @param data The data for the request.
1163
- * @param data.name Data enhancer name
1164
- * @param data.region Region code (cn, us, de)
1165
- * @returns unknown Data enhancer is healthy
1166
- * @throws ApiError
1167
- */
1168
- static healthControllerGetHealthOfDataEnhancer(data) {
1169
- return request(OpenAPI, {
1170
- method: "GET",
1171
- url: "/api/v1/health/data-enhancer/{name}",
1172
- path: {
1173
- name: data.name,
1174
- region: data.region
1175
- },
1176
- errors: {
1177
- 401: "Unauthorized",
1178
- 503: "Data enhancer unavailable"
1179
- }
1180
- });
1181
- }
1182
- /**
1183
- * Check health of all data providers
1184
- * @param data The data for the request.
1185
- * @param data.region Region code (cn, us, de)
1186
- * @returns unknown Data providers health status
1187
- * @throws ApiError
1188
- */
1189
- static healthControllerCheckDataProviders(data) {
1190
- return request(OpenAPI, {
1191
- method: "GET",
1192
- url: "/api/v1/health/data-providers",
1193
- path: {
1194
- region: data.region
1195
- },
1196
- errors: {
1197
- 401: "Unauthorized",
1198
- 503: "Data providers check failed"
1199
- }
1200
- });
1201
- }
1202
- /**
1203
- * Check health of a specific data provider
1204
- * @param data The data for the request.
1205
- * @param data.dataSource Data source identifier
1206
- * @param data.region Region code (cn, us, de)
1207
- * @returns unknown Data provider is healthy
1208
- * @throws ApiError
1209
- */
1210
- static healthControllerGetHealthOfDataProvider(data) {
1211
- return request(OpenAPI, {
1212
- method: "GET",
1213
- url: "/api/v1/health/data-provider/{dataSource}",
1214
- path: {
1215
- dataSource: data.dataSource,
1216
- region: data.region
1217
- },
1218
- errors: {
1219
- 400: "Invalid data source",
1220
- 401: "Unauthorized",
1221
- 503: "Data provider unavailable"
1222
- }
1223
- });
1224
- }
1225
1286
  };
1226
1287
  // Annotate the CommonJS export names for ESM import in node:
1227
1288
  0 && (module.exports = {