@firela/api-types 0.0.0-canary.888f4d12 → 0.0.0-canary.8bf286b3

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.
@@ -595,7 +595,7 @@ export type PostingResponseDto = {
595
595
  */
596
596
  account: string;
597
597
  /**
598
- * Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.
598
+ * Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned. Carries the raw Beancount sign (credit-normal accounts such as Income post negative — the accounting truth, ADR-0126); renderers must not infer economic semantics from this sign.
599
599
  */
600
600
  units?: string;
601
601
  /**
@@ -830,7 +830,7 @@ export type PostingDetailDto = {
830
830
  */
831
831
  account: string;
832
832
  /**
833
- * Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.
833
+ * Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned. Carries the raw Beancount sign (credit-normal accounts such as Income post negative — the accounting truth, ADR-0126); renderers must not infer economic semantics from this sign.
834
834
  */
835
835
  units?: string;
836
836
  /**
@@ -976,6 +976,101 @@ export type flag2 =
976
976
  */
977
977
  export type status2 = 'ACTIVE' | 'VOIDED' | 'SUPERSEDED';
978
978
 
979
+ export type TransactionListItemDto = {
980
+ /**
981
+ * Transaction ID
982
+ */
983
+ id: string;
984
+ /**
985
+ * Transaction date
986
+ */
987
+ date: string;
988
+ /**
989
+ * Transaction flag
990
+ */
991
+ flag?:
992
+ | 'CLEARED'
993
+ | 'PENDING'
994
+ | 'PADDING'
995
+ | 'SUMMARIZE'
996
+ | 'TRANSFER'
997
+ | 'CONVERSIONS';
998
+ /**
999
+ * Custom flag (if not using standard flags)
1000
+ */
1001
+ customFlag?: string;
1002
+ /**
1003
+ * Payee name
1004
+ */
1005
+ payee?: string;
1006
+ /**
1007
+ * Transaction narration
1008
+ */
1009
+ narration: string;
1010
+ /**
1011
+ * Transaction tags
1012
+ */
1013
+ tags: Array<string>;
1014
+ /**
1015
+ * Transaction links
1016
+ */
1017
+ links: Array<string>;
1018
+ /**
1019
+ * Transaction metadata
1020
+ */
1021
+ meta?: {
1022
+ [key: string]: unknown;
1023
+ };
1024
+ /**
1025
+ * Transaction status
1026
+ */
1027
+ status: 'ACTIVE' | 'VOIDED' | 'SUPERSEDED';
1028
+ /**
1029
+ * Source type (free-form string from transaction metadata, e.g. import, api)
1030
+ */
1031
+ sourceType?: string;
1032
+ /**
1033
+ * Source platform (e.g., alipay, wechat)
1034
+ */
1035
+ sourcePlatform?: string;
1036
+ /**
1037
+ * Transaction postings
1038
+ */
1039
+ postings: Array<PostingDetailDto>;
1040
+ /**
1041
+ * Created at timestamp
1042
+ */
1043
+ createdAt: string;
1044
+ /**
1045
+ * Voided at timestamp (if voided)
1046
+ */
1047
+ voidedAt?: string;
1048
+ /**
1049
+ * User ID who voided this transaction
1050
+ */
1051
+ voidedBy?: string;
1052
+ /**
1053
+ * Correction reason (if voided or superseded)
1054
+ */
1055
+ correctionReason?: string;
1056
+ /**
1057
+ * ID of the transaction that supersedes this one (set when status=SUPERSEDED)
1058
+ */
1059
+ supersededBy?: string;
1060
+ /**
1061
+ * ID of the transaction this one corrected/replaced (back-link on the replacement)
1062
+ */
1063
+ originalTxn?: string;
1064
+ /**
1065
+ * Per-leg sign-normalized row amount for the category viewpoint (ADR-0126): each posting on the category account set contributes its unitsNumber with Income-root legs negated and Expenses-root legs identity. Positive under normal booking but NOT clamped (explicit negative expense legs and net-flip refund months stay negative). Omitted outside the category viewpoint.
1066
+ */
1067
+ viewpointAmount?: string;
1068
+ /**
1069
+ * Currency of viewpointAmount. A row spanning multiple currencies takes the largest-magnitude currency group (known simplification, ADR-0126). Omitted outside the category viewpoint.
1070
+ */
1071
+ viewpointCurrency?: string;
1072
+ };
1073
+
979
1074
  export type BalanceByCurrencyDto = {
980
1075
  /**
981
1076
  * ISO 4217 currency code
@@ -1004,7 +1099,7 @@ export type ExchangeRateWarningDto = {
1004
1099
 
1005
1100
  export type TransactionListSummaryDto = {
1006
1101
  /**
1007
- * Partial converted total in base currency (rated currencies only, raw Beancount sign). When warnings is non-empty this excludes currencies missing an FX rate; may be "0.00" if ALL non-base currencies lack a rate. Converted at the dateTo (or current) available rate.
1102
+ * Partial converted total in base currency (rated currencies only). Sign by viewpoint (ADR-0126): account viewpoint keeps the raw Beancount sign (income negative); category viewpoint is per-leg sign-normalized (Income legs negated, Expenses legs identity — positive under normal booking, not clamped). When warnings is non-empty this excludes currencies missing an FX rate; may be "0.00" if ALL non-base currencies lack a rate. Converted at the dateTo (or current) available rate.
1008
1103
  */
1009
1104
  totalAmount: string;
1010
1105
  /**
@@ -1021,11 +1116,32 @@ export type TransactionListSummaryDto = {
1021
1116
  warnings?: Array<ExchangeRateWarningDto>;
1022
1117
  };
1023
1118
 
1119
+ export type TransactionListViewpointDto = {
1120
+ /**
1121
+ * Viewpoint type (only category drill-down carries a viewpoint today)
1122
+ */
1123
+ type: 'category';
1124
+ /**
1125
+ * Flow root the category account set is restricted to
1126
+ */
1127
+ flow: 'income' | 'expense';
1128
+ };
1129
+
1130
+ /**
1131
+ * Viewpoint type (only category drill-down carries a viewpoint today)
1132
+ */
1133
+ export type type2 = 'category';
1134
+
1135
+ /**
1136
+ * Flow root the category account set is restricted to
1137
+ */
1138
+ export type flow = 'income' | 'expense';
1139
+
1024
1140
  export type TransactionListResponseDto = {
1025
1141
  /**
1026
1142
  * List of transactions
1027
1143
  */
1028
- data: Array<TransactionDetailDto>;
1144
+ data: Array<TransactionListItemDto>;
1029
1145
  /**
1030
1146
  * Total count of matching transactions
1031
1147
  */
@@ -1042,6 +1158,10 @@ export type TransactionListResponseDto = {
1042
1158
  * Amount summary for the full filtered set (#514). Present only when the request has a single account OR category viewpoint; omitted for search-only / plain-list / dual-perspective requests.
1043
1159
  */
1044
1160
  summary?: TransactionListSummaryDto;
1161
+ /**
1162
+ * Viewpoint metadata (ADR-0126). Present only for a single category filter (category + flow, no accountId); dual-perspective requests are viewpoint-less (raw signs, no viewpointAmount).
1163
+ */
1164
+ viewpoint?: TransactionListViewpointDto;
1045
1165
  };
1046
1166
 
1047
1167
  export type TagSuggestionDto = {
@@ -1253,7 +1373,7 @@ export type ReviewSummaryDto = {
1253
1373
  /**
1254
1374
  * Review type
1255
1375
  */
1256
- export type type2 =
1376
+ export type type3 =
1257
1377
  | 'DUPLICATE'
1258
1378
  | 'RULE_MATCH'
1259
1379
  | 'PAYEE_MATCH'
@@ -4781,7 +4901,12 @@ export type NlpResponseDto = {
4781
4901
  /**
4782
4902
  * Asset sub-type (only present when intent is "asset"). Determines which asset-related form to render.
4783
4903
  */
4784
- assetSubType?: 'transfer' | 'banking' | 'investment';
4904
+ assetSubType?:
4905
+ | 'transfer'
4906
+ | 'banking'
4907
+ | 'investment'
4908
+ | 'lend'
4909
+ | 'lend_collect';
4785
4910
  /**
4786
4911
  * Liability sub-type (only present when intent is "liability"). borrow: borrowing money (Liabilities → Assets), repay: repaying debt (Assets → Liabilities).
4787
4912
  */
@@ -4898,7 +5023,12 @@ export type intent = 'expense' | 'asset' | 'income' | 'liability' | 'equity';
4898
5023
  /**
4899
5024
  * Asset sub-type (only present when intent is "asset"). Determines which asset-related form to render.
4900
5025
  */
4901
- export type assetSubType = 'transfer' | 'banking' | 'investment';
5026
+ export type assetSubType =
5027
+ | 'transfer'
5028
+ | 'banking'
5029
+ | 'investment'
5030
+ | 'lend'
5031
+ | 'lend_collect';
4902
5032
 
4903
5033
  /**
4904
5034
  * Liability sub-type (only present when intent is "liability"). borrow: borrowing money (Liabilities → Assets), repay: repaying debt (Assets → Liabilities).
@@ -4963,7 +5093,7 @@ export type PlatformListItemDto = {
4963
5093
  /**
4964
5094
  * Platform type
4965
5095
  */
4966
- export type type3 =
5096
+ export type type4 =
4967
5097
  | 'BANK'
4968
5098
  | 'BROKERAGE'
4969
5099
  | 'CRYPTO_EXCHANGE'
@@ -5795,7 +5925,7 @@ export type HoldingPnlWarningDto = {
5795
5925
  /**
5796
5926
  * Warning type
5797
5927
  */
5798
- export type type4 =
5928
+ export type type5 =
5799
5929
  | 'MISSING_COST_FX_RATE'
5800
5930
  | 'MISSING_MARKET_FX_RATE'
5801
5931
  | 'MISSING_SALE_PRICE'
@@ -5834,6 +5964,121 @@ export type AnonymousLoginResponseDto = {
5834
5964
  authToken: string;
5835
5965
  };
5836
5966
 
5967
+ export type ParserContributionMetaDto = {
5968
+ /**
5969
+ * Institution slug (lowercase kebab-case)
5970
+ */
5971
+ institution: string;
5972
+ region:
5973
+ | 'cn'
5974
+ | 'us'
5975
+ | 'de'
5976
+ | 'fr'
5977
+ | 'gb'
5978
+ | 'hk'
5979
+ | 'jp'
5980
+ | 'sg'
5981
+ | 'au'
5982
+ | 'ca'
5983
+ | 'other';
5984
+ accountType: 'checking' | 'savings' | 'credit' | 'debit' | 'investment';
5985
+ format: 'csv' | 'xlsx' | 'pdf' | 'ofx' | 'qif';
5986
+ institutionDisplayName?: string;
5987
+ encoding?: string;
5988
+ /**
5989
+ * CSV delimiter character: ",", ";", "\t" or "|"
5990
+ */
5991
+ delimiter?: string;
5992
+ /**
5993
+ * Header row count; the client omits the field when it is 1
5994
+ */
5995
+ headerRows?: number;
5996
+ notes?: string;
5997
+ };
5998
+
5999
+ export type region =
6000
+ | 'cn'
6001
+ | 'us'
6002
+ | 'de'
6003
+ | 'fr'
6004
+ | 'gb'
6005
+ | 'hk'
6006
+ | 'jp'
6007
+ | 'sg'
6008
+ | 'au'
6009
+ | 'ca'
6010
+ | 'other';
6011
+
6012
+ export type accountType =
6013
+ | 'checking'
6014
+ | 'savings'
6015
+ | 'credit'
6016
+ | 'debit'
6017
+ | 'investment';
6018
+
6019
+ export type format = 'csv' | 'xlsx' | 'pdf' | 'ofx' | 'qif';
6020
+
6021
+ export type ParserContributionSamplesDto = {
6022
+ /**
6023
+ * Client-sanitized sample rows (key = column name, value = cell)
6024
+ */
6025
+ rows: Array<string>;
6026
+ rawHeaders?: Array<string>;
6027
+ };
6028
+
6029
+ export type FieldHintDto = {
6030
+ columnName: string;
6031
+ /**
6032
+ * Date format, e.g. yyyy-MM-dd HH:mm
6033
+ */
6034
+ format?: string;
6035
+ signConvention?: 'negative-expense' | 'positive-expense' | 'separate-columns';
6036
+ creditColumn?: string;
6037
+ debitColumn?: string;
6038
+ };
6039
+
6040
+ export type signConvention =
6041
+ | 'negative-expense'
6042
+ | 'positive-expense'
6043
+ | 'separate-columns';
6044
+
6045
+ export type ParserContributionFieldHintsDto = {
6046
+ date: FieldHintDto;
6047
+ amount: FieldHintDto;
6048
+ description?: FieldHintDto;
6049
+ balance?: FieldHintDto;
6050
+ payee?: FieldHintDto;
6051
+ reference?: FieldHintDto;
6052
+ category?: FieldHintDto;
6053
+ };
6054
+
6055
+ export type ExpectedTransactionDto = {
6056
+ date: string;
6057
+ amount: number;
6058
+ description: string;
6059
+ payee?: string;
6060
+ category?: string;
6061
+ };
6062
+
6063
+ export type ParserContributionExamplesDto = {
6064
+ expectedTransactions: Array<ExpectedTransactionDto>;
6065
+ };
6066
+
6067
+ export type ParserContributionRequestDto = {
6068
+ meta: ParserContributionMetaDto;
6069
+ samples: ParserContributionSamplesDto;
6070
+ fieldHints: ParserContributionFieldHintsDto;
6071
+ /**
6072
+ * Omitted entirely by the client when empty
6073
+ */
6074
+ examples?: ParserContributionExamplesDto;
6075
+ };
6076
+
6077
+ export type ParserContributionRelayResponseDto = {
6078
+ issueUrl: string;
6079
+ issueNumber: number;
6080
+ };
6081
+
5837
6082
  export type SymbolSearchResultDto = {
5838
6083
  symbol: string;
5839
6084
  name?: {
@@ -6449,7 +6694,7 @@ export type TransactionControllerListData = {
6449
6694
  */
6450
6695
  accountId?: string;
6451
6696
  /**
6452
- * Filter by ADR-0075 functional category (Group segment); matches any posting to an Expenses/Income account whose derived Group segment equals this value
6697
+ * 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).
6453
6698
  */
6454
6699
  category?: string;
6455
6700
  /**
@@ -6460,6 +6705,10 @@ export type TransactionControllerListData = {
6460
6705
  * Filter by end date (inclusive), format: YYYY-MM-DD
6461
6706
  */
6462
6707
  dateTo?: string;
6708
+ /**
6709
+ * 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.
6710
+ */
6711
+ flow?: 'income' | 'expense';
6463
6712
  /**
6464
6713
  * Number of items per page (1-100, default: 20)
6465
6714
  */
@@ -10535,6 +10784,42 @@ export type AuthControllerAccessTokenLoginData = {
10535
10784
 
10536
10785
  export type AuthControllerAccessTokenLoginResponse = AnonymousLoginResponseDto;
10537
10786
 
10787
+ export type ParserContributionControllerCreateData = {
10788
+ /**
10789
+ * Region code for tenant context (routing only; the institution region rides in the payload meta)
10790
+ */
10791
+ region:
10792
+ | 'ad'
10793
+ | 'ae'
10794
+ | 'af'
10795
+ | 'ag'
10796
+ | 'al'
10797
+ | 'am'
10798
+ | 'ao'
10799
+ | 'au'
10800
+ | 'br'
10801
+ | 'ca'
10802
+ | 'cn'
10803
+ | 'de'
10804
+ | 'dz'
10805
+ | 'es'
10806
+ | 'fr'
10807
+ | 'gb'
10808
+ | 'hk'
10809
+ | 'in'
10810
+ | 'it'
10811
+ | 'jp'
10812
+ | 'kr'
10813
+ | 'nl'
10814
+ | 'sg'
10815
+ | 'tw'
10816
+ | 'us';
10817
+ requestBody: ParserContributionRequestDto;
10818
+ };
10819
+
10820
+ export type ParserContributionControllerCreateResponse =
10821
+ ParserContributionRelayResponseDto;
10822
+
10538
10823
  export type CacheControllerFlushCacheResponse = unknown;
10539
10824
 
10540
10825
  export type ExchangeRateControllerGetExchangeRateData = {
@@ -12852,6 +13137,37 @@ export type $OpenApiTs = {
12852
13137
  };
12853
13138
  };
12854
13139
  };
13140
+ '/api/v1/{region}/community/parser-contributions': {
13141
+ post: {
13142
+ req: ParserContributionControllerCreateData;
13143
+ res: {
13144
+ /**
13145
+ * Issue created by the bot
13146
+ */
13147
+ 201: ParserContributionRelayResponseDto;
13148
+ /**
13149
+ * Unauthorized
13150
+ */
13151
+ 401: ApiProblemResponseDto;
13152
+ /**
13153
+ * Validation failed (institution slug, empty samples, row/cell size limits)
13154
+ */
13155
+ 422: ApiProblemResponseDto;
13156
+ /**
13157
+ * Rate limited (5 submissions per user per hour)
13158
+ */
13159
+ 429: ApiProblemResponseDto;
13160
+ /**
13161
+ * Relay not configured on this deployment — clients fall back to the clipboard flow
13162
+ */
13163
+ 501: ApiProblemResponseDto;
13164
+ /**
13165
+ * GitHub bot failure (upstream), safe to retry
13166
+ */
13167
+ 502: ApiProblemResponseDto;
13168
+ };
13169
+ };
13170
+ };
12855
13171
  '/api/v1/cache/flush': {
12856
13172
  post: {
12857
13173
  res: {