@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.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,7 +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")
857
+ * @param data.account Account name (e.g., "Assets:Checking")
858
+ * @param data.region Region code for tenant context
752
859
  * @param data.date Date to calculate balance at (ISO 8601 format)
753
860
  * @param data.currency Currency to query (e.g., "USD", "CNY")
754
861
  * @returns BalanceResponseDto Balance calculated successfully
@@ -758,6 +865,9 @@ var BeanBalancesService = class {
758
865
  return request(OpenAPI, {
759
866
  method: "GET",
760
867
  url: "/api/v1/{region}/bean/balances",
868
+ path: {
869
+ region: data.region
870
+ },
761
871
  query: {
762
872
  account: data.account,
763
873
  date: data.date,
@@ -772,13 +882,18 @@ var BeanBalancesService = class {
772
882
  /**
773
883
  * Query multi-currency account balance
774
884
  * Calculate account balances for all currencies at a specific date
885
+ * @param data The data for the request.
886
+ * @param data.region Region code for tenant context
775
887
  * @returns MultiCurrencyBalanceResponseDto Balances calculated successfully
776
888
  * @throws ApiError
777
889
  */
778
- static balanceControllerGetMultiCurrencyBalance() {
890
+ static balanceControllerGetMultiCurrencyBalance(data) {
779
891
  return request(OpenAPI, {
780
892
  method: "GET",
781
893
  url: "/api/v1/{region}/bean/balances/multi-currency",
894
+ path: {
895
+ region: data.region
896
+ },
782
897
  errors: {
783
898
  400: "Invalid query parameters",
784
899
  401: "User not authenticated"
@@ -788,17 +903,26 @@ var BeanBalancesService = class {
788
903
  };
789
904
  var BeanCommoditiesService = class {
790
905
  /**
906
+ * Create a new commodity
907
+ * Creates a new commodity definition for the authenticated user
791
908
  * @param data The data for the request.
792
909
  * @param data.region Region code for tenant context
793
- * @returns unknown
910
+ * @param data.requestBody
911
+ * @returns CommodityResponseDto Commodity created successfully
794
912
  * @throws ApiError
795
913
  */
796
- static commodityController(data) {
914
+ static commodityControllerCreate(data) {
797
915
  return request(OpenAPI, {
798
916
  method: "POST",
799
917
  url: "/api/v1/{region}/bean/commodities",
800
918
  path: {
801
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"
802
926
  }
803
927
  });
804
928
  }
@@ -848,57 +972,81 @@ var BeanCommoditiesService = class {
848
972
  });
849
973
  }
850
974
  /**
975
+ * Update commodity
976
+ * Updates an existing commodity definition. Symbol cannot be changed.
851
977
  * @param data The data for the request.
978
+ * @param data.symbol Commodity symbol
852
979
  * @param data.region Region code for tenant context
853
- * @returns unknown
980
+ * @param data.requestBody
981
+ * @returns CommodityResponseDto Commodity updated successfully
854
982
  * @throws ApiError
855
983
  */
856
- static commodityController1(data) {
984
+ static commodityControllerUpdate(data) {
857
985
  return request(OpenAPI, {
858
986
  method: "PUT",
859
987
  url: "/api/v1/{region}/bean/commodities/{symbol}",
860
988
  path: {
989
+ symbol: data.symbol,
861
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"
862
997
  }
863
998
  });
864
999
  }
865
1000
  /**
1001
+ * Delete commodity
1002
+ * Deletes a commodity definition
866
1003
  * @param data The data for the request.
1004
+ * @param data.symbol Commodity symbol
867
1005
  * @param data.region Region code for tenant context
868
- * @returns void
1006
+ * @returns void Commodity deleted successfully
869
1007
  * @throws ApiError
870
1008
  */
871
- static commodityController2(data) {
1009
+ static commodityControllerDelete(data) {
872
1010
  return request(OpenAPI, {
873
1011
  method: "DELETE",
874
1012
  url: "/api/v1/{region}/bean/commodities/{symbol}",
875
1013
  path: {
1014
+ symbol: data.symbol,
876
1015
  region: data.region
1016
+ },
1017
+ errors: {
1018
+ 404: "Commodity not found"
877
1019
  }
878
1020
  });
879
1021
  }
880
1022
  /**
1023
+ * Ensure commodity exists
1024
+ * Gets existing commodity or creates it with automatic initialization from OpenBB
881
1025
  * @param data The data for the request.
1026
+ * @param data.symbol Commodity symbol
882
1027
  * @param data.region Region code for tenant context
883
- * @returns unknown
1028
+ * @returns CommodityResponseDto Commodity retrieved or created
884
1029
  * @throws ApiError
885
1030
  */
886
- static commodityController3(data) {
1031
+ static commodityControllerGetOrCreate(data) {
887
1032
  return request(OpenAPI, {
888
1033
  method: "POST",
889
1034
  url: "/api/v1/{region}/bean/commodities/{symbol}/ensure",
890
1035
  path: {
1036
+ symbol: data.symbol,
891
1037
  region: data.region
892
1038
  }
893
1039
  });
894
1040
  }
895
1041
  /**
1042
+ * Bulk create commodities
1043
+ * Creates multiple commodities from a list of symbols, useful for initialization
896
1044
  * @param data The data for the request.
897
1045
  * @param data.region Region code for tenant context
898
- * @returns unknown
1046
+ * @returns CommodityResponseDto Commodities created successfully
899
1047
  * @throws ApiError
900
1048
  */
901
- static commodityController4(data) {
1049
+ static commodityControllerBulkCreate(data) {
902
1050
  return request(OpenAPI, {
903
1051
  method: "POST",
904
1052
  url: "/api/v1/{region}/bean/commodities/bulk",
@@ -934,7 +1082,7 @@ var ProviderSyncService = class {
934
1082
  *
935
1083
  * @param data The data for the request.
936
1084
  * @param data.providerName Provider name
937
- * @param data.region Region code
1085
+ * @param data.region Region code for tenant context
938
1086
  * @param data.requestBody
939
1087
  * @returns ProviderSyncResponseDto Sync completed successfully
940
1088
  * @throws ApiError
@@ -959,13 +1107,18 @@ var ProviderSyncService = class {
959
1107
  /**
960
1108
  * Get supported providers
961
1109
  * Returns a list of all providers supported by the sync endpoint.
1110
+ * @param data The data for the request.
1111
+ * @param data.region Region code for tenant context
962
1112
  * @returns SupportedProvidersResponseDto List of supported providers
963
1113
  * @throws ApiError
964
1114
  */
965
- static providerSyncControllerGetSupportedProviders() {
1115
+ static providerSyncControllerGetSupportedProviders(data) {
966
1116
  return request(OpenAPI, {
967
1117
  method: "GET",
968
1118
  url: "/api/v1/{region}/bean/import/provider/supported",
1119
+ path: {
1120
+ region: data.region
1121
+ },
969
1122
  errors: {
970
1123
  401: "Missing or invalid authentication"
971
1124
  }
@@ -976,6 +1129,7 @@ var ProviderSyncService = class {
976
1129
  * Returns whether a specific provider is supported.
977
1130
  * @param data The data for the request.
978
1131
  * @param data.providerName Provider name to check
1132
+ * @param data.region Region code for tenant context
979
1133
  * @returns unknown Provider support status
980
1134
  * @throws ApiError
981
1135
  */
@@ -984,7 +1138,8 @@ var ProviderSyncService = class {
984
1138
  method: "GET",
985
1139
  url: "/api/v1/{region}/bean/import/provider/{providerName}/supported",
986
1140
  path: {
987
- providerName: data.providerName
1141
+ providerName: data.providerName,
1142
+ region: data.region
988
1143
  },
989
1144
  errors: {
990
1145
  401: "Missing or invalid authentication"
@@ -1021,6 +1176,20 @@ var HealthService = class {
1021
1176
  }
1022
1177
  });
1023
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
+ }
1024
1193
  /**
1025
1194
  * Check Redis connection health
1026
1195
  * @returns unknown Redis is healthy
@@ -1084,62 +1253,6 @@ var HealthService = class {
1084
1253
  }
1085
1254
  });
1086
1255
  }
1087
- /**
1088
- * Check health of a specific data enhancer
1089
- * @param data The data for the request.
1090
- * @param data.name Data enhancer name
1091
- * @returns unknown Data enhancer is healthy
1092
- * @throws ApiError
1093
- */
1094
- static healthControllerGetHealthOfDataEnhancer(data) {
1095
- return request(OpenAPI, {
1096
- method: "GET",
1097
- url: "/api/v1/health/data-enhancer/{name}",
1098
- path: {
1099
- name: data.name
1100
- },
1101
- errors: {
1102
- 401: "Unauthorized",
1103
- 503: "Data enhancer unavailable"
1104
- }
1105
- });
1106
- }
1107
- /**
1108
- * Check health of all data providers
1109
- * @returns unknown Data providers health status
1110
- * @throws ApiError
1111
- */
1112
- static healthControllerCheckDataProviders() {
1113
- return request(OpenAPI, {
1114
- method: "GET",
1115
- url: "/api/v1/health/data-providers",
1116
- errors: {
1117
- 401: "Unauthorized",
1118
- 503: "Data providers check failed"
1119
- }
1120
- });
1121
- }
1122
- /**
1123
- * Check health of a specific data provider
1124
- * @param data The data for the request.
1125
- * @param data.dataSource Data source identifier
1126
- * @returns unknown Data provider is healthy
1127
- * @throws ApiError
1128
- */
1129
- static healthControllerGetHealthOfDataProvider(data) {
1130
- return request(OpenAPI, {
1131
- method: "GET",
1132
- url: "/api/v1/health/data-provider/{dataSource}",
1133
- path: {
1134
- dataSource: data.dataSource
1135
- },
1136
- errors: {
1137
- 400: "Invalid data source",
1138
- 401: "Unauthorized",
1139
- 503: "Data provider unavailable"
1140
- }
1141
- });
1142
- }
1143
1256
  };
1144
1257
  export {
1145
1258
  BeanAccountsService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firela/api-types",
3
- "version": "0.0.0-canary.a3c2cb48",
3
+ "version": "0.0.0-canary.a43ffd21",
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"