@firela/api-types 0.0.0-canary.a133ccd5 → 0.0.0-canary.a203bb6

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 matched against account path and user-set display name (case-insensitive)
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,119 @@ 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
+ * Batch void transactions
723
+ * Soft-deletes (VOIDED) a batch of the caller's ACTIVE transactions in one DB transaction. Voiding releases each row's importId dedup slot, so re-importing the same file after an undo batch-void imports every row again instead of skipping them as duplicates.
724
+ * @param data The data for the request.
725
+ * @param data.region Region code for tenant context
726
+ * @param data.requestBody Batch void request (1-500 unique transaction IDs)
727
+ * @returns BatchVoidResultDto Batch void result: count of rows voided plus ids not found / no longer ACTIVE
728
+ * @throws ApiError
729
+ */
730
+ static transactionControllerBatchVoid(data) {
731
+ return request(OpenAPI, {
732
+ method: "POST",
733
+ url: "/api/v1/{region}/bean/transactions/batch-void",
734
+ path: {
735
+ region: data.region
736
+ },
737
+ body: data.requestBody,
738
+ mediaType: "application/json",
739
+ errors: {
740
+ 400: "Validation failed (empty, over 500, duplicate or non-string ids)",
741
+ 401: "Authentication required",
742
+ 403: "Batch contains ids owned by another user \u2014 whole request rejected, nothing committed"
743
+ }
744
+ });
745
+ }
746
+ /**
747
+ * Correct (supersede) a transaction
748
+ * Atomically voids the original (SUPERSEDED) and creates a replacement through the full validation pipeline.
749
+ * @param data The data for the request.
750
+ * @param data.id Original transaction ID to correct
751
+ * @param data.region Region code for tenant context
752
+ * @param data.requestBody
753
+ * @returns TransactionDetailDto Corrected transaction created
754
+ * @throws ApiError
755
+ */
756
+ static transactionControllerCorrect(data) {
757
+ return request(OpenAPI, {
758
+ method: "POST",
759
+ url: "/api/v1/{region}/bean/transactions/{id}/correct",
760
+ path: {
761
+ id: data.id,
762
+ region: data.region
763
+ },
764
+ body: data.requestBody,
765
+ mediaType: "application/json",
766
+ errors: {
767
+ 404: "Original transaction not found",
768
+ 409: "Original no longer ACTIVE (concurrent modification)",
769
+ 422: "Pipeline validation failed (does not balance, invalid accounts)"
770
+ }
771
+ });
772
+ }
773
+ /**
774
+ * Suggest transaction tags
775
+ * Returns distinct tags from the user ACTIVE transactions, sorted by usage, for autocomplete. Optional q performs a case-insensitive prefix match.
776
+ * @param data The data for the request.
777
+ * @param data.region Region code for tenant context
778
+ * @param data.q Prefix match, case-insensitive (max 50 chars)
779
+ * @param data.sort usage (default) or name
780
+ * @param data.limit Max suggestions (1-100, default 10)
781
+ * @returns TagSuggestionsResponseDto Tag suggestions
782
+ * @throws ApiError
783
+ */
784
+ static transactionControllerSuggestTags(data) {
785
+ return request(OpenAPI, {
786
+ method: "GET",
787
+ url: "/api/v1/{region}/bean/transactions/tags",
788
+ path: {
789
+ region: data.region
790
+ },
791
+ query: {
792
+ q: data.q,
793
+ sort: data.sort,
794
+ limit: data.limit
795
+ },
796
+ errors: {
797
+ 400: "Validation failed",
798
+ 401: "Authentication required"
677
799
  }
678
800
  });
679
801
  }
@@ -728,17 +850,26 @@ var BeanTransactionsService = class {
728
850
  });
729
851
  }
730
852
  /**
853
+ * Void transaction
854
+ * Soft-deletes a transaction by marking it as VOIDED
731
855
  * @param data The data for the request.
856
+ * @param data.id Transaction ID
732
857
  * @param data.region Region code for tenant context
733
- * @returns void
858
+ * @returns void Transaction voided successfully
734
859
  * @throws ApiError
735
860
  */
736
- static transactionController1(data) {
861
+ static transactionControllerDelete(data) {
737
862
  return request(OpenAPI, {
738
863
  method: "DELETE",
739
864
  url: "/api/v1/{region}/bean/transactions/{id}",
740
865
  path: {
866
+ id: data.id,
741
867
  region: data.region
868
+ },
869
+ errors: {
870
+ 400: "Transaction already voided",
871
+ 401: "Authentication required",
872
+ 404: "Transaction not found"
742
873
  }
743
874
  });
744
875
  }
@@ -748,7 +879,8 @@ var BeanBalancesService = class {
748
879
  * Query account balance
749
880
  * Calculate account balance at a specific date for a single currency
750
881
  * @param data The data for the request.
751
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
882
+ * @param data.account Account name (e.g., "Assets:Checking")
883
+ * @param data.region Region code for tenant context
752
884
  * @param data.date Date to calculate balance at (ISO 8601 format)
753
885
  * @param data.currency Currency to query (e.g., "USD", "CNY")
754
886
  * @returns BalanceResponseDto Balance calculated successfully
@@ -758,6 +890,9 @@ var BeanBalancesService = class {
758
890
  return request(OpenAPI, {
759
891
  method: "GET",
760
892
  url: "/api/v1/{region}/bean/balances",
893
+ path: {
894
+ region: data.region
895
+ },
761
896
  query: {
762
897
  account: data.account,
763
898
  date: data.date,
@@ -772,13 +907,18 @@ var BeanBalancesService = class {
772
907
  /**
773
908
  * Query multi-currency account balance
774
909
  * Calculate account balances for all currencies at a specific date
910
+ * @param data The data for the request.
911
+ * @param data.region Region code for tenant context
775
912
  * @returns MultiCurrencyBalanceResponseDto Balances calculated successfully
776
913
  * @throws ApiError
777
914
  */
778
- static balanceControllerGetMultiCurrencyBalance() {
915
+ static balanceControllerGetMultiCurrencyBalance(data) {
779
916
  return request(OpenAPI, {
780
917
  method: "GET",
781
918
  url: "/api/v1/{region}/bean/balances/multi-currency",
919
+ path: {
920
+ region: data.region
921
+ },
782
922
  errors: {
783
923
  400: "Invalid query parameters",
784
924
  401: "User not authenticated"
@@ -788,17 +928,26 @@ var BeanBalancesService = class {
788
928
  };
789
929
  var BeanCommoditiesService = class {
790
930
  /**
931
+ * Create a new commodity
932
+ * Creates a new commodity definition for the authenticated user
791
933
  * @param data The data for the request.
792
934
  * @param data.region Region code for tenant context
793
- * @returns unknown
935
+ * @param data.requestBody
936
+ * @returns CommodityResponseDto Commodity created successfully
794
937
  * @throws ApiError
795
938
  */
796
- static commodityController(data) {
939
+ static commodityControllerCreate(data) {
797
940
  return request(OpenAPI, {
798
941
  method: "POST",
799
942
  url: "/api/v1/{region}/bean/commodities",
800
943
  path: {
801
944
  region: data.region
945
+ },
946
+ body: data.requestBody,
947
+ mediaType: "application/json",
948
+ errors: {
949
+ 400: "Invalid input data",
950
+ 409: "Commodity already exists"
802
951
  }
803
952
  });
804
953
  }
@@ -848,57 +997,81 @@ var BeanCommoditiesService = class {
848
997
  });
849
998
  }
850
999
  /**
1000
+ * Update commodity
1001
+ * Updates an existing commodity definition. Symbol cannot be changed.
851
1002
  * @param data The data for the request.
1003
+ * @param data.symbol Commodity symbol
852
1004
  * @param data.region Region code for tenant context
853
- * @returns unknown
1005
+ * @param data.requestBody
1006
+ * @returns CommodityResponseDto Commodity updated successfully
854
1007
  * @throws ApiError
855
1008
  */
856
- static commodityController1(data) {
1009
+ static commodityControllerUpdate(data) {
857
1010
  return request(OpenAPI, {
858
1011
  method: "PUT",
859
1012
  url: "/api/v1/{region}/bean/commodities/{symbol}",
860
1013
  path: {
1014
+ symbol: data.symbol,
861
1015
  region: data.region
1016
+ },
1017
+ body: data.requestBody,
1018
+ mediaType: "application/json",
1019
+ errors: {
1020
+ 400: "Invalid input data",
1021
+ 404: "Commodity not found"
862
1022
  }
863
1023
  });
864
1024
  }
865
1025
  /**
1026
+ * Delete commodity
1027
+ * Deletes a commodity definition
866
1028
  * @param data The data for the request.
1029
+ * @param data.symbol Commodity symbol
867
1030
  * @param data.region Region code for tenant context
868
- * @returns void
1031
+ * @returns void Commodity deleted successfully
869
1032
  * @throws ApiError
870
1033
  */
871
- static commodityController2(data) {
1034
+ static commodityControllerDelete(data) {
872
1035
  return request(OpenAPI, {
873
1036
  method: "DELETE",
874
1037
  url: "/api/v1/{region}/bean/commodities/{symbol}",
875
1038
  path: {
1039
+ symbol: data.symbol,
876
1040
  region: data.region
1041
+ },
1042
+ errors: {
1043
+ 404: "Commodity not found"
877
1044
  }
878
1045
  });
879
1046
  }
880
1047
  /**
1048
+ * Ensure commodity exists
1049
+ * Gets existing commodity or creates it with automatic initialization from OpenBB
881
1050
  * @param data The data for the request.
1051
+ * @param data.symbol Commodity symbol
882
1052
  * @param data.region Region code for tenant context
883
- * @returns unknown
1053
+ * @returns CommodityResponseDto Commodity retrieved or created
884
1054
  * @throws ApiError
885
1055
  */
886
- static commodityController3(data) {
1056
+ static commodityControllerGetOrCreate(data) {
887
1057
  return request(OpenAPI, {
888
1058
  method: "POST",
889
1059
  url: "/api/v1/{region}/bean/commodities/{symbol}/ensure",
890
1060
  path: {
1061
+ symbol: data.symbol,
891
1062
  region: data.region
892
1063
  }
893
1064
  });
894
1065
  }
895
1066
  /**
1067
+ * Bulk create commodities
1068
+ * Creates multiple commodities from a list of symbols, useful for initialization
896
1069
  * @param data The data for the request.
897
1070
  * @param data.region Region code for tenant context
898
- * @returns unknown
1071
+ * @returns CommodityResponseDto Commodities created successfully
899
1072
  * @throws ApiError
900
1073
  */
901
- static commodityController4(data) {
1074
+ static commodityControllerBulkCreate(data) {
902
1075
  return request(OpenAPI, {
903
1076
  method: "POST",
904
1077
  url: "/api/v1/{region}/bean/commodities/bulk",
@@ -934,7 +1107,7 @@ var ProviderSyncService = class {
934
1107
  *
935
1108
  * @param data The data for the request.
936
1109
  * @param data.providerName Provider name
937
- * @param data.region Region code
1110
+ * @param data.region Region code for tenant context
938
1111
  * @param data.requestBody
939
1112
  * @returns ProviderSyncResponseDto Sync completed successfully
940
1113
  * @throws ApiError
@@ -959,13 +1132,18 @@ var ProviderSyncService = class {
959
1132
  /**
960
1133
  * Get supported providers
961
1134
  * Returns a list of all providers supported by the sync endpoint.
1135
+ * @param data The data for the request.
1136
+ * @param data.region Region code for tenant context
962
1137
  * @returns SupportedProvidersResponseDto List of supported providers
963
1138
  * @throws ApiError
964
1139
  */
965
- static providerSyncControllerGetSupportedProviders() {
1140
+ static providerSyncControllerGetSupportedProviders(data) {
966
1141
  return request(OpenAPI, {
967
1142
  method: "GET",
968
1143
  url: "/api/v1/{region}/bean/import/provider/supported",
1144
+ path: {
1145
+ region: data.region
1146
+ },
969
1147
  errors: {
970
1148
  401: "Missing or invalid authentication"
971
1149
  }
@@ -976,6 +1154,7 @@ var ProviderSyncService = class {
976
1154
  * Returns whether a specific provider is supported.
977
1155
  * @param data The data for the request.
978
1156
  * @param data.providerName Provider name to check
1157
+ * @param data.region Region code for tenant context
979
1158
  * @returns unknown Provider support status
980
1159
  * @throws ApiError
981
1160
  */
@@ -984,7 +1163,8 @@ var ProviderSyncService = class {
984
1163
  method: "GET",
985
1164
  url: "/api/v1/{region}/bean/import/provider/{providerName}/supported",
986
1165
  path: {
987
- providerName: data.providerName
1166
+ providerName: data.providerName,
1167
+ region: data.region
988
1168
  },
989
1169
  errors: {
990
1170
  401: "Missing or invalid authentication"
@@ -1021,6 +1201,20 @@ var HealthService = class {
1021
1201
  }
1022
1202
  });
1023
1203
  }
1204
+ /**
1205
+ * Check OpenBB schema status
1206
+ * @returns unknown OpenBB status
1207
+ * @throws ApiError
1208
+ */
1209
+ static healthControllerCheckOpenBb() {
1210
+ return request(OpenAPI, {
1211
+ method: "GET",
1212
+ url: "/api/v1/health/openbb",
1213
+ errors: {
1214
+ 503: "OpenBB unavailable"
1215
+ }
1216
+ });
1217
+ }
1024
1218
  /**
1025
1219
  * Check Redis connection health
1026
1220
  * @returns unknown Redis is healthy
@@ -1084,62 +1278,6 @@ var HealthService = class {
1084
1278
  }
1085
1279
  });
1086
1280
  }
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
1281
  };
1144
1282
  export {
1145
1283
  BeanAccountsService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firela/api-types",
3
- "version": "0.0.0-canary.a133ccd5",
3
+ "version": "0.0.0-canary.a203bb6",
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"