@firela/api-types 0.0.0-canary.b3b7767b → 0.0.0-canary.b4fc3fae

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.mjs CHANGED
@@ -452,7 +452,7 @@ var BeanAccountsService = class {
452
452
  * @param data.type Filter by account type
453
453
  * @param data.status Filter by status
454
454
  * @param data.isCustom Filter by custom (user-created) accounts only
455
- * @param data.search Search term for path or i18nKey
455
+ * @param data.search Search term for account path
456
456
  * @param data.limit Maximum number of results
457
457
  * @param data.offset Number of results to skip
458
458
  * @returns AccountListResponseDto Accounts retrieved successfully
@@ -524,7 +524,7 @@ var BeanAccountsService = class {
524
524
  }
525
525
  /**
526
526
  * Delete account
527
- * Deletes an account (only if no transactions)
527
+ * Deletes an account (only if no active transactions; voided/superseded residual postings are cleaned up)
528
528
  * @param data The data for the request.
529
529
  * @param data.id Account UUID
530
530
  * @param data.region Region code for tenant context
@@ -541,7 +541,7 @@ var BeanAccountsService = class {
541
541
  },
542
542
  errors: {
543
543
  404: "Account not found",
544
- 409: "Account has transactions and cannot be deleted"
544
+ 409: "Account has active transactions and cannot be deleted"
545
545
  }
546
546
  });
547
547
  }
@@ -597,6 +597,32 @@ var BeanAccountsService = class {
597
597
  }
598
598
  });
599
599
  }
600
+ /**
601
+ * Post an opening-balance transaction
602
+ * 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.
603
+ * @param data The data for the request.
604
+ * @param data.id Account UUID
605
+ * @param data.region Region code for tenant context
606
+ * @param data.requestBody
607
+ * @returns OpeningBalanceResultDto Opening-balance transaction created
608
+ * @throws ApiError
609
+ */
610
+ static accountControllerAddOpeningBalance(data) {
611
+ return request(OpenAPI, {
612
+ method: "POST",
613
+ url: "/api/v1/{region}/bean/accounts/{id}/opening-balance",
614
+ path: {
615
+ id: data.id,
616
+ region: data.region
617
+ },
618
+ body: data.requestBody,
619
+ mediaType: "application/json",
620
+ errors: {
621
+ 404: "Account not found",
622
+ 409: "An opening balance already exists for this account"
623
+ }
624
+ });
625
+ }
600
626
  };
601
627
  var BeanTransactionsService = class {
602
628
  /**
@@ -635,9 +661,11 @@ var BeanTransactionsService = class {
635
661
  * @param data.offset Number of items to skip (default: 0)
636
662
  * @param data.dateFrom Filter by start date (inclusive), format: YYYY-MM-DD
637
663
  * @param data.dateTo Filter by end date (inclusive), format: YYYY-MM-DD
638
- * @param data.status Filter by transaction status
664
+ * @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).
639
665
  * @param data.search Search in narration and payee fields (max 200 chars)
640
666
  * @param data.accountId Filter by account ID (transactions with postings to this account)
667
+ * @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).
668
+ * @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.
641
669
  * @returns TransactionListResponseDto Transaction list
642
670
  * @throws ApiError
643
671
  */
@@ -655,25 +683,94 @@ var BeanTransactionsService = class {
655
683
  dateTo: data.dateTo,
656
684
  status: data.status,
657
685
  search: data.search,
658
- accountId: data.accountId
686
+ accountId: data.accountId,
687
+ category: data.category,
688
+ flow: data.flow
659
689
  },
660
690
  errors: {
691
+ 400: "Validation failed",
661
692
  401: "Authentication required"
662
693
  }
663
694
  });
664
695
  }
665
696
  /**
697
+ * @deprecated
698
+ * Batch create transactions (DEPRECATED)
699
+ * DEPRECATED: Use POST /:region/bean/import/provider/:name/sync instead. This endpoint skips dedup, rule matching, and review branching.
666
700
  * @param data The data for the request.
667
701
  * @param data.region Region code for tenant context
668
- * @returns unknown
702
+ * @param data.requestBody
703
+ * @returns BatchTransactionResponseDto Transactions processed
669
704
  * @throws ApiError
670
705
  */
671
- static transactionController(data) {
706
+ static transactionControllerCreateBatch(data) {
672
707
  return request(OpenAPI, {
673
708
  method: "POST",
674
709
  url: "/api/v1/{region}/bean/transactions/batch",
675
710
  path: {
676
711
  region: data.region
712
+ },
713
+ body: data.requestBody,
714
+ mediaType: "application/json",
715
+ errors: {
716
+ 400: "Invalid input",
717
+ 401: "Authentication required"
718
+ }
719
+ });
720
+ }
721
+ /**
722
+ * Correct (supersede) a transaction
723
+ * Atomically voids the original (SUPERSEDED) and creates a replacement through the full validation pipeline.
724
+ * @param data The data for the request.
725
+ * @param data.id Original transaction ID to correct
726
+ * @param data.region Region code for tenant context
727
+ * @param data.requestBody
728
+ * @returns TransactionDetailDto Corrected transaction created
729
+ * @throws ApiError
730
+ */
731
+ static transactionControllerCorrect(data) {
732
+ return request(OpenAPI, {
733
+ method: "POST",
734
+ url: "/api/v1/{region}/bean/transactions/{id}/correct",
735
+ path: {
736
+ id: data.id,
737
+ region: data.region
738
+ },
739
+ body: data.requestBody,
740
+ mediaType: "application/json",
741
+ errors: {
742
+ 404: "Original transaction not found",
743
+ 409: "Original no longer ACTIVE (concurrent modification)",
744
+ 422: "Pipeline validation failed (does not balance, invalid accounts)"
745
+ }
746
+ });
747
+ }
748
+ /**
749
+ * Suggest transaction tags
750
+ * Returns distinct tags from the user ACTIVE transactions, sorted by usage, for autocomplete. Optional q performs a case-insensitive prefix match.
751
+ * @param data The data for the request.
752
+ * @param data.region Region code for tenant context
753
+ * @param data.q Prefix match, case-insensitive (max 50 chars)
754
+ * @param data.sort usage (default) or name
755
+ * @param data.limit Max suggestions (1-100, default 10)
756
+ * @returns TagSuggestionsResponseDto Tag suggestions
757
+ * @throws ApiError
758
+ */
759
+ static transactionControllerSuggestTags(data) {
760
+ return request(OpenAPI, {
761
+ method: "GET",
762
+ url: "/api/v1/{region}/bean/transactions/tags",
763
+ path: {
764
+ region: data.region
765
+ },
766
+ query: {
767
+ q: data.q,
768
+ sort: data.sort,
769
+ limit: data.limit
770
+ },
771
+ errors: {
772
+ 400: "Validation failed",
773
+ 401: "Authentication required"
677
774
  }
678
775
  });
679
776
  }
@@ -728,17 +825,26 @@ var BeanTransactionsService = class {
728
825
  });
729
826
  }
730
827
  /**
828
+ * Void transaction
829
+ * Soft-deletes a transaction by marking it as VOIDED
731
830
  * @param data The data for the request.
831
+ * @param data.id Transaction ID
732
832
  * @param data.region Region code for tenant context
733
- * @returns void
833
+ * @returns void Transaction voided successfully
734
834
  * @throws ApiError
735
835
  */
736
- static transactionController1(data) {
836
+ static transactionControllerDelete(data) {
737
837
  return request(OpenAPI, {
738
838
  method: "DELETE",
739
839
  url: "/api/v1/{region}/bean/transactions/{id}",
740
840
  path: {
841
+ id: data.id,
741
842
  region: data.region
843
+ },
844
+ errors: {
845
+ 400: "Transaction already voided",
846
+ 401: "Authentication required",
847
+ 404: "Transaction not found"
742
848
  }
743
849
  });
744
850
  }
@@ -748,8 +854,8 @@ var BeanBalancesService = class {
748
854
  * Query account balance
749
855
  * Calculate account balance at a specific date for a single currency
750
856
  * @param data The data for the request.
751
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
752
- * @param data.region Region code (cn, us, de)
857
+ * @param data.account Account name (e.g., "Assets:Checking")
858
+ * @param data.region Region code for tenant context
753
859
  * @param data.date Date to calculate balance at (ISO 8601 format)
754
860
  * @param data.currency Currency to query (e.g., "USD", "CNY")
755
861
  * @returns BalanceResponseDto Balance calculated successfully
@@ -777,7 +883,7 @@ var BeanBalancesService = class {
777
883
  * Query multi-currency account balance
778
884
  * Calculate account balances for all currencies at a specific date
779
885
  * @param data The data for the request.
780
- * @param data.region Region code (cn, us, de)
886
+ * @param data.region Region code for tenant context
781
887
  * @returns MultiCurrencyBalanceResponseDto Balances calculated successfully
782
888
  * @throws ApiError
783
889
  */
@@ -797,17 +903,26 @@ var BeanBalancesService = class {
797
903
  };
798
904
  var BeanCommoditiesService = class {
799
905
  /**
906
+ * Create a new commodity
907
+ * Creates a new commodity definition for the authenticated user
800
908
  * @param data The data for the request.
801
- * @param data.region Region code (cn, us, de)
802
- * @returns unknown
909
+ * @param data.region Region code for tenant context
910
+ * @param data.requestBody
911
+ * @returns CommodityResponseDto Commodity created successfully
803
912
  * @throws ApiError
804
913
  */
805
- static commodityController(data) {
914
+ static commodityControllerCreate(data) {
806
915
  return request(OpenAPI, {
807
916
  method: "POST",
808
917
  url: "/api/v1/{region}/bean/commodities",
809
918
  path: {
810
919
  region: data.region
920
+ },
921
+ body: data.requestBody,
922
+ mediaType: "application/json",
923
+ errors: {
924
+ 400: "Invalid input data",
925
+ 409: "Commodity already exists"
811
926
  }
812
927
  });
813
928
  }
@@ -815,7 +930,7 @@ var BeanCommoditiesService = class {
815
930
  * List user commodities
816
931
  * Returns all commodity definitions for the authenticated user with optional filtering
817
932
  * @param data The data for the request.
818
- * @param data.region Region code (cn, us, de)
933
+ * @param data.region Region code for tenant context
819
934
  * @param data.search Search term for symbol or metadata fields (partial match). Searches symbol and metadata.name.
820
935
  * @param data.symbol Filter by exact symbol match
821
936
  * @returns CommodityListResponseDto Commodities retrieved successfully
@@ -839,7 +954,7 @@ var BeanCommoditiesService = class {
839
954
  * Returns a specific commodity definition by its symbol
840
955
  * @param data The data for the request.
841
956
  * @param data.symbol Commodity symbol
842
- * @param data.region Region code (cn, us, de)
957
+ * @param data.region Region code for tenant context
843
958
  * @returns CommodityResponseDto Commodity retrieved successfully
844
959
  * @throws ApiError
845
960
  */
@@ -857,57 +972,81 @@ var BeanCommoditiesService = class {
857
972
  });
858
973
  }
859
974
  /**
975
+ * Update commodity
976
+ * Updates an existing commodity definition. Symbol cannot be changed.
860
977
  * @param data The data for the request.
861
- * @param data.region Region code (cn, us, de)
862
- * @returns unknown
978
+ * @param data.symbol Commodity symbol
979
+ * @param data.region Region code for tenant context
980
+ * @param data.requestBody
981
+ * @returns CommodityResponseDto Commodity updated successfully
863
982
  * @throws ApiError
864
983
  */
865
- static commodityController1(data) {
984
+ static commodityControllerUpdate(data) {
866
985
  return request(OpenAPI, {
867
986
  method: "PUT",
868
987
  url: "/api/v1/{region}/bean/commodities/{symbol}",
869
988
  path: {
989
+ symbol: data.symbol,
870
990
  region: data.region
991
+ },
992
+ body: data.requestBody,
993
+ mediaType: "application/json",
994
+ errors: {
995
+ 400: "Invalid input data",
996
+ 404: "Commodity not found"
871
997
  }
872
998
  });
873
999
  }
874
1000
  /**
1001
+ * Delete commodity
1002
+ * Deletes a commodity definition
875
1003
  * @param data The data for the request.
876
- * @param data.region Region code (cn, us, de)
877
- * @returns void
1004
+ * @param data.symbol Commodity symbol
1005
+ * @param data.region Region code for tenant context
1006
+ * @returns void Commodity deleted successfully
878
1007
  * @throws ApiError
879
1008
  */
880
- static commodityController2(data) {
1009
+ static commodityControllerDelete(data) {
881
1010
  return request(OpenAPI, {
882
1011
  method: "DELETE",
883
1012
  url: "/api/v1/{region}/bean/commodities/{symbol}",
884
1013
  path: {
1014
+ symbol: data.symbol,
885
1015
  region: data.region
1016
+ },
1017
+ errors: {
1018
+ 404: "Commodity not found"
886
1019
  }
887
1020
  });
888
1021
  }
889
1022
  /**
1023
+ * Ensure commodity exists
1024
+ * Gets existing commodity or creates it with automatic initialization from OpenBB
890
1025
  * @param data The data for the request.
891
- * @param data.region Region code (cn, us, de)
892
- * @returns unknown
1026
+ * @param data.symbol Commodity symbol
1027
+ * @param data.region Region code for tenant context
1028
+ * @returns CommodityResponseDto Commodity retrieved or created
893
1029
  * @throws ApiError
894
1030
  */
895
- static commodityController3(data) {
1031
+ static commodityControllerGetOrCreate(data) {
896
1032
  return request(OpenAPI, {
897
1033
  method: "POST",
898
1034
  url: "/api/v1/{region}/bean/commodities/{symbol}/ensure",
899
1035
  path: {
1036
+ symbol: data.symbol,
900
1037
  region: data.region
901
1038
  }
902
1039
  });
903
1040
  }
904
1041
  /**
1042
+ * Bulk create commodities
1043
+ * Creates multiple commodities from a list of symbols, useful for initialization
905
1044
  * @param data The data for the request.
906
- * @param data.region Region code (cn, us, de)
907
- * @returns unknown
1045
+ * @param data.region Region code for tenant context
1046
+ * @returns CommodityResponseDto Commodities created successfully
908
1047
  * @throws ApiError
909
1048
  */
910
- static commodityController4(data) {
1049
+ static commodityControllerBulkCreate(data) {
911
1050
  return request(OpenAPI, {
912
1051
  method: "POST",
913
1052
  url: "/api/v1/{region}/bean/commodities/bulk",
@@ -943,7 +1082,7 @@ var ProviderSyncService = class {
943
1082
  *
944
1083
  * @param data The data for the request.
945
1084
  * @param data.providerName Provider name
946
- * @param data.region Region code
1085
+ * @param data.region Region code for tenant context
947
1086
  * @param data.requestBody
948
1087
  * @returns ProviderSyncResponseDto Sync completed successfully
949
1088
  * @throws ApiError
@@ -969,7 +1108,7 @@ var ProviderSyncService = class {
969
1108
  * Get supported providers
970
1109
  * Returns a list of all providers supported by the sync endpoint.
971
1110
  * @param data The data for the request.
972
- * @param data.region Region code (cn, us, de)
1111
+ * @param data.region Region code for tenant context
973
1112
  * @returns SupportedProvidersResponseDto List of supported providers
974
1113
  * @throws ApiError
975
1114
  */
@@ -990,7 +1129,7 @@ var ProviderSyncService = class {
990
1129
  * Returns whether a specific provider is supported.
991
1130
  * @param data The data for the request.
992
1131
  * @param data.providerName Provider name to check
993
- * @param data.region Region code (cn, us, de)
1132
+ * @param data.region Region code for tenant context
994
1133
  * @returns unknown Provider support status
995
1134
  * @throws ApiError
996
1135
  */
@@ -1011,18 +1150,13 @@ var ProviderSyncService = class {
1011
1150
  var HealthService = class {
1012
1151
  /**
1013
1152
  * Basic health check for K8s/load balancer probes
1014
- * @param data The data for the request.
1015
- * @param data.region Region code (cn, us, de)
1016
1153
  * @returns unknown Service is healthy
1017
1154
  * @throws ApiError
1018
1155
  */
1019
- static healthControllerGetHealth(data) {
1156
+ static healthControllerGetHealth() {
1020
1157
  return request(OpenAPI, {
1021
1158
  method: "GET",
1022
1159
  url: "/api/v1/health",
1023
- path: {
1024
- region: data.region
1025
- },
1026
1160
  errors: {
1027
1161
  503: "Service unavailable"
1028
1162
  }
@@ -1030,37 +1164,41 @@ var HealthService = class {
1030
1164
  }
1031
1165
  /**
1032
1166
  * Check database connection health
1033
- * @param data The data for the request.
1034
- * @param data.region Region code (cn, us, de)
1035
1167
  * @returns unknown Database is healthy
1036
1168
  * @throws ApiError
1037
1169
  */
1038
- static healthControllerCheckDatabase(data) {
1170
+ static healthControllerCheckDatabase() {
1039
1171
  return request(OpenAPI, {
1040
1172
  method: "GET",
1041
1173
  url: "/api/v1/health/database",
1042
- path: {
1043
- region: data.region
1044
- },
1045
1174
  errors: {
1046
1175
  503: "Database unavailable"
1047
1176
  }
1048
1177
  });
1049
1178
  }
1179
+ /**
1180
+ * Check OpenBB schema status
1181
+ * @returns unknown OpenBB status
1182
+ * @throws ApiError
1183
+ */
1184
+ static healthControllerCheckOpenBb() {
1185
+ return request(OpenAPI, {
1186
+ method: "GET",
1187
+ url: "/api/v1/health/openbb",
1188
+ errors: {
1189
+ 503: "OpenBB unavailable"
1190
+ }
1191
+ });
1192
+ }
1050
1193
  /**
1051
1194
  * Check Redis connection health
1052
- * @param data The data for the request.
1053
- * @param data.region Region code (cn, us, de)
1054
1195
  * @returns unknown Redis is healthy
1055
1196
  * @throws ApiError
1056
1197
  */
1057
- static healthControllerCheckRedis(data) {
1198
+ static healthControllerCheckRedis() {
1058
1199
  return request(OpenAPI, {
1059
1200
  method: "GET",
1060
1201
  url: "/api/v1/health/redis",
1061
- path: {
1062
- region: data.region
1063
- },
1064
1202
  errors: {
1065
1203
  503: "Redis unavailable"
1066
1204
  }
@@ -1068,18 +1206,13 @@ var HealthService = class {
1068
1206
  }
1069
1207
  /**
1070
1208
  * Get status of all circuit breakers
1071
- * @param data The data for the request.
1072
- * @param data.region Region code (cn, us, de)
1073
1209
  * @returns unknown Circuit breaker status
1074
1210
  * @throws ApiError
1075
1211
  */
1076
- static healthControllerGetCircuitBreakersHealth(data) {
1212
+ static healthControllerGetCircuitBreakersHealth() {
1077
1213
  return request(OpenAPI, {
1078
1214
  method: "GET",
1079
1215
  url: "/api/v1/health/circuit-breakers",
1080
- path: {
1081
- region: data.region
1082
- },
1083
1216
  errors: {
1084
1217
  401: "Unauthorized",
1085
1218
  500: "Internal error"
@@ -1090,7 +1223,6 @@ var HealthService = class {
1090
1223
  * Reset a circuit breaker to CLOSED state
1091
1224
  * @param data The data for the request.
1092
1225
  * @param data.name Circuit breaker name to reset
1093
- * @param data.region Region code (cn, us, de)
1094
1226
  * @returns unknown Circuit breaker reset successfully
1095
1227
  * @throws ApiError
1096
1228
  */
@@ -1099,8 +1231,7 @@ var HealthService = class {
1099
1231
  method: "POST",
1100
1232
  url: "/api/v1/health/circuit-breakers/{name}/reset",
1101
1233
  path: {
1102
- name: data.name,
1103
- region: data.region
1234
+ name: data.name
1104
1235
  },
1105
1236
  errors: {
1106
1237
  401: "Unauthorized",
@@ -1110,88 +1241,18 @@ var HealthService = class {
1110
1241
  }
1111
1242
  /**
1112
1243
  * Get health check metrics and statistics
1113
- * @param data The data for the request.
1114
- * @param data.region Region code (cn, us, de)
1115
1244
  * @returns unknown Health metrics
1116
1245
  * @throws ApiError
1117
1246
  */
1118
- static healthControllerGetMetrics(data) {
1247
+ static healthControllerGetMetrics() {
1119
1248
  return request(OpenAPI, {
1120
1249
  method: "GET",
1121
1250
  url: "/api/v1/health/metrics",
1122
- path: {
1123
- region: data.region
1124
- },
1125
1251
  errors: {
1126
1252
  401: "Unauthorized"
1127
1253
  }
1128
1254
  });
1129
1255
  }
1130
- /**
1131
- * Check health of a specific data enhancer
1132
- * @param data The data for the request.
1133
- * @param data.name Data enhancer name
1134
- * @param data.region Region code (cn, us, de)
1135
- * @returns unknown Data enhancer is healthy
1136
- * @throws ApiError
1137
- */
1138
- static healthControllerGetHealthOfDataEnhancer(data) {
1139
- return request(OpenAPI, {
1140
- method: "GET",
1141
- url: "/api/v1/health/data-enhancer/{name}",
1142
- path: {
1143
- name: data.name,
1144
- region: data.region
1145
- },
1146
- errors: {
1147
- 401: "Unauthorized",
1148
- 503: "Data enhancer unavailable"
1149
- }
1150
- });
1151
- }
1152
- /**
1153
- * Check health of all data providers
1154
- * @param data The data for the request.
1155
- * @param data.region Region code (cn, us, de)
1156
- * @returns unknown Data providers health status
1157
- * @throws ApiError
1158
- */
1159
- static healthControllerCheckDataProviders(data) {
1160
- return request(OpenAPI, {
1161
- method: "GET",
1162
- url: "/api/v1/health/data-providers",
1163
- path: {
1164
- region: data.region
1165
- },
1166
- errors: {
1167
- 401: "Unauthorized",
1168
- 503: "Data providers check failed"
1169
- }
1170
- });
1171
- }
1172
- /**
1173
- * Check health of a specific data provider
1174
- * @param data The data for the request.
1175
- * @param data.dataSource Data source identifier
1176
- * @param data.region Region code (cn, us, de)
1177
- * @returns unknown Data provider is healthy
1178
- * @throws ApiError
1179
- */
1180
- static healthControllerGetHealthOfDataProvider(data) {
1181
- return request(OpenAPI, {
1182
- method: "GET",
1183
- url: "/api/v1/health/data-provider/{dataSource}",
1184
- path: {
1185
- dataSource: data.dataSource,
1186
- region: data.region
1187
- },
1188
- errors: {
1189
- 400: "Invalid data source",
1190
- 401: "Unauthorized",
1191
- 503: "Data provider unavailable"
1192
- }
1193
- });
1194
- }
1195
1256
  };
1196
1257
  export {
1197
1258
  BeanAccountsService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firela/api-types",
3
- "version": "0.0.0-canary.b3b7767b",
3
+ "version": "0.0.0-canary.b4fc3fae",
4
4
  "description": "TypeScript types generated from IGN OpenAPI specification",
5
5
  "license": "MIT",
6
6
  "author": "FireLa Team",
@@ -24,8 +24,7 @@
24
24
  "src"
25
25
  ],
26
26
  "scripts": {
27
- "sync": "npx ts-node scripts/sync-spec.ts",
28
- "generate": "npm run sync && openapi-ts",
27
+ "generate": "openapi-ts",
29
28
  "build": "tsup src/index.ts --format cjs,esm --dts --clean",
30
29
  "lint": "spectral lint openapi.yaml",
31
30
  "prepublishOnly": "npm run generate && npm run build"