@firela/api-types 0.0.0-canary.7f2ecc16 → 0.0.0-canary.7fcf7940

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firela/api-types",
3
- "version": "0.0.0-canary.7f2ecc16",
3
+ "version": "0.0.0-canary.7fcf7940",
4
4
  "description": "TypeScript types generated from IGN OpenAPI specification",
5
5
  "license": "MIT",
6
6
  "author": "FireLa Team",
@@ -4123,6 +4123,50 @@ export const $DeleteOwnUserDto = {
4123
4123
  required: ['accessToken']
4124
4124
  } as const;
4125
4125
 
4126
+ export const $UserSettingsResponseDto = {
4127
+ type: 'object',
4128
+ properties: {
4129
+ baseCurrency: {
4130
+ type: 'string',
4131
+ description:
4132
+ 'Base currency (ISO 4217) for net-worth/report aggregation. Independent of region (ADR-0006).',
4133
+ example: 'USD',
4134
+ nullable: true
4135
+ }
4136
+ },
4137
+ required: ['baseCurrency']
4138
+ } as const;
4139
+
4140
+ export const $UserResponseDto = {
4141
+ type: 'object',
4142
+ properties: {
4143
+ id: {
4144
+ type: 'string',
4145
+ description: 'User ID'
4146
+ },
4147
+ role: {
4148
+ type: 'string',
4149
+ description: 'Assigned user role'
4150
+ },
4151
+ permissions: {
4152
+ description: 'Permission strings',
4153
+ type: 'array',
4154
+ items: {
4155
+ type: 'string'
4156
+ }
4157
+ },
4158
+ settings: {
4159
+ description: 'User settings',
4160
+ allOf: [
4161
+ {
4162
+ $ref: '#/components/schemas/UserSettingsResponseDto'
4163
+ }
4164
+ ]
4165
+ }
4166
+ },
4167
+ required: ['id', 'role', 'permissions', 'settings']
4168
+ } as const;
4169
+
4126
4170
  export const $SignupDto = {
4127
4171
  type: 'object',
4128
4172
  properties: {
@@ -4928,6 +4972,69 @@ export const $TestRuleResponseDto = {
4928
4972
  required: ['ruleId', 'matches', 'confidence', 'matchDetails']
4929
4973
  } as const;
4930
4974
 
4975
+ export const $CategoryCatalogEntryDto = {
4976
+ type: 'object',
4977
+ properties: {
4978
+ slug: {
4979
+ type: 'string',
4980
+ description: 'Category slug (single source-of-truth)',
4981
+ example: 'food'
4982
+ },
4983
+ scenario: {
4984
+ type: 'string',
4985
+ description: 'Display scenario group (maps to frontend picker _scenario)',
4986
+ enum: [
4987
+ 'expense',
4988
+ 'income',
4989
+ 'investment',
4990
+ 'banking',
4991
+ 'transfer',
4992
+ 'payment'
4993
+ ],
4994
+ example: 'expense'
4995
+ },
4996
+ icon: {
4997
+ type: 'string',
4998
+ description: 'Lucide icon name',
4999
+ example: 'utensils'
5000
+ },
5001
+ regions: {
5002
+ description: "Applicable regions ('*' = all, 'cn' = CN-only)",
5003
+ example: ['*'],
5004
+ type: 'array',
5005
+ items: {
5006
+ type: 'string'
5007
+ }
5008
+ }
5009
+ },
5010
+ required: ['slug', 'scenario', 'icon', 'regions']
5011
+ } as const;
5012
+
5013
+ export const $CategoryCatalogListResponseDto = {
5014
+ type: 'object',
5015
+ properties: {
5016
+ items: {
5017
+ description: 'Category entries (region-scoped, query-filtered)',
5018
+ type: 'array',
5019
+ items: {
5020
+ $ref: '#/components/schemas/CategoryCatalogEntryDto'
5021
+ }
5022
+ },
5023
+ total: {
5024
+ type: 'number',
5025
+ description:
5026
+ 'Total category entries for the region (before query filtering)',
5027
+ example: 30
5028
+ },
5029
+ region: {
5030
+ type: 'string',
5031
+ description: 'Region code',
5032
+ example: 'cn'
5033
+ }
5034
+ },
5035
+ required: ['items', 'total', 'region']
5036
+ } as const;
5037
+
4931
5038
  export const $CreateBeanEventDto = {
4932
5039
  type: 'object',
4933
5040
  properties: {
@@ -5670,7 +5777,8 @@ export const $UpdateMapperDefaultsDto = {
5670
5777
  type: 'string',
5671
5778
  description: 'Source account for transactions (Beancount format)',
5672
5779
  example: 'Assets:CN:Alipay:Balance',
5673
- pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
5780
+ pattern:
5781
+ '^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
5674
5782
  },
5675
5783
  currency: {
5676
5784
  type: 'string',
@@ -5684,13 +5792,15 @@ export const $UpdateMapperDefaultsDto = {
5684
5792
  type: 'string',
5685
5793
  description: 'Default expense account (optional)',
5686
5794
  example: 'Expenses:Unknown',
5687
- pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
5795
+ pattern:
5796
+ '^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
5688
5797
  },
5689
5798
  incomeAccount: {
5690
5799
  type: 'string',
5691
5800
  description: 'Default income account (optional)',
5692
5801
  example: 'Income:Unknown',
5693
- pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
5802
+ pattern:
5803
+ '^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
5694
5804
  },
5695
5805
  methodAccountMapping: {
5696
5806
  type: 'object',
@@ -5747,12 +5857,14 @@ export const $ProviderSyncConfigDto = {
5747
5857
  },
5748
5858
  defaultExpenseAccount: {
5749
5859
  type: 'string',
5750
- description: 'Default expense account for the second posting',
5860
+ description:
5861
+ 'Default expense account for the second posting. Omit when no real default exists; the pipeline routes to Review via the Uncategorized sentinel (#618).',
5751
5862
  example: 'Expenses:Unknown'
5752
5863
  },
5753
5864
  defaultIncomeAccount: {
5754
5865
  type: 'string',
5755
- description: 'Default income account for the second posting',
5866
+ description:
5867
+ 'Default income account for the second posting. Omit when no real default exists; the pipeline routes to Review via the Uncategorized sentinel (#618).',
5756
5868
  example: 'Income:Unknown'
5757
5869
  },
5758
5870
  filterPending: {
@@ -5767,12 +5879,7 @@ export const $ProviderSyncConfigDto = {
5767
5879
  example: 'acc_gocardless_001'
5768
5880
  }
5769
5881
  },
5770
- required: [
5771
- 'sourceAccount',
5772
- 'defaultCurrency',
5773
- 'defaultExpenseAccount',
5774
- 'defaultIncomeAccount'
5775
- ]
5882
+ required: ['sourceAccount', 'defaultCurrency']
5776
5883
  } as const;
5777
5884
 
5778
5885
  export const $ProviderSyncDto = {
@@ -5982,15 +6089,105 @@ export const $UncoveredFormatMissDto = {
5982
6089
  properties: {}
5983
6090
  } as const;
5984
6091
 
6092
+ export const $ClientParsedDataDto = {
6093
+ type: 'object',
6094
+ properties: {
6095
+ amount: {
6096
+ type: 'number',
6097
+ description: 'Transaction amount',
6098
+ example: 35
6099
+ },
6100
+ currency: {
6101
+ type: 'string',
6102
+ description: 'Currency code',
6103
+ example: 'CNY'
6104
+ },
6105
+ date: {
6106
+ type: 'string',
6107
+ description: 'Transaction date (ISO 8601)',
6108
+ example: '2026-08-15'
6109
+ },
6110
+ payee: {
6111
+ type: 'string',
6112
+ description: 'Payee/merchant name',
6113
+ example: 'Starbucks'
6114
+ },
6115
+ narration: {
6116
+ type: 'string',
6117
+ description: 'Transaction narration'
6118
+ },
6119
+ category: {
6120
+ type: 'string',
6121
+ description: 'Category slug',
6122
+ example: 'food_restaurant'
6123
+ },
6124
+ incomeType: {
6125
+ type: 'string',
6126
+ description: 'Income type',
6127
+ example: 'Salary'
6128
+ },
6129
+ incomeSource: {
6130
+ type: 'string',
6131
+ description: 'Income source',
6132
+ example: 'Anthropic Inc.'
6133
+ },
6134
+ symbol: {
6135
+ type: 'string',
6136
+ description: 'Security symbol code (e.g., 600519, AAPL)',
6137
+ example: 'AAPL'
6138
+ },
6139
+ quantity: {
6140
+ type: 'number',
6141
+ description: 'Quantity of shares/units',
6142
+ example: 100
6143
+ },
6144
+ price: {
6145
+ type: 'number',
6146
+ description: 'Unit price per share/unit',
6147
+ example: 1900
6148
+ },
6149
+ investmentAction: {
6150
+ type: 'string',
6151
+ description: 'Investment action',
6152
+ enum: ['buy', 'sell'],
6153
+ example: 'buy'
6154
+ },
6155
+ paymentSource: {
6156
+ type: 'string',
6157
+ description: 'Payment source: asset (default) or liability (credit card)',
6158
+ enum: ['asset', 'liability'],
6159
+ example: 'asset'
6160
+ },
6161
+ liabilityHint: {
6162
+ type: 'string',
6163
+ description: 'Liability account hint (CreditCard/Huabei/Baitiao)',
6164
+ example: 'CreditCard'
6165
+ },
6166
+ warning: {
6167
+ type: 'string',
6168
+ description:
6169
+ 'Display-only warning from the prior response; accepted but ignored.',
6170
+ example: 'Cross-currency settlement applies.'
6171
+ }
6172
+ }
6173
+ } as const;
6174
+
5985
6175
  export const $ProcessNlpDto = {
5986
6176
  type: 'object',
5987
6177
  properties: {
5988
6178
  message: {
5989
6179
  type: 'string',
5990
- description: 'Natural language text describing a transaction (Chinese)',
5991
- example: 'yesterday Starbucks spent 35 yuan',
6180
+ description:
6181
+ 'Natural language text describing a transaction. Optional when `confirm` is true (structured confirm); otherwise required.',
6182
+ example: 'Starbucks 35',
5992
6183
  maxLength: 500
5993
6184
  },
6185
+ confirm: {
6186
+ type: 'boolean',
6187
+ description:
6188
+ 'Structured confirm signal — bypasses NL confirm-word matching when true. Send parsedData field edits alongside. The NL word-list path is the fallback.',
6189
+ example: true
6190
+ },
5994
6191
  sessionId: {
5995
6192
  type: 'string',
5996
6193
  description:
@@ -5998,14 +6195,18 @@ export const $ProcessNlpDto = {
5998
6195
  example: 'session_abc123'
5999
6196
  },
6000
6197
  parsedData: {
6001
- type: 'object',
6002
6198
  description:
6003
6199
  'Parsed data from previous NLP response for session recovery. Send back the parsedData received in confirm_payee/confirm responses.',
6004
6200
  example: {
6005
6201
  amount: 35,
6006
6202
  currency: 'CNY',
6007
6203
  payee: 'Starbucks'
6008
- }
6204
+ },
6205
+ allOf: [
6206
+ {
6207
+ $ref: '#/components/schemas/ClientParsedDataDto'
6208
+ }
6209
+ ]
6009
6210
  },
6010
6211
  selectedRuleId: {
6011
6212
  type: 'string',
@@ -6019,8 +6220,7 @@ export const $ProcessNlpDto = {
6019
6220
  'confirm_account echo-back: account path selected from the prior confirm_account response (suggestedAccount, similarAccounts[i], or a typed path). Applied directly when the session is confirming_account — no NL re-parse.',
6020
6221
  example: 'Expenses:Food:Coffee'
6021
6222
  }
6022
- },
6023
- required: ['message']
6223
+ }
6024
6224
  } as const;
6025
6225
 
6026
6226
  export const $NlpTransactionInfoDto = {
@@ -6841,13 +7041,26 @@ export const $PlatformListItemDto = {
6841
7041
  suggestedSegment: {
6842
7042
  type: 'string',
6843
7043
  description:
6844
- 'Suggested path segment — canonical with first char uppercased (ACC_COMP_NAME_RE)'
7044
+ 'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
6845
7045
  },
6846
7046
  logoUrl: {
6847
7047
  type: 'string',
6848
7048
  description: 'Logo URL',
6849
7049
  nullable: true
6850
7050
  },
7051
+ countryCode: {
7052
+ type: 'string',
7053
+ description: 'ISO 3166-1 alpha-2 (UPPERCASE); null = global platform',
7054
+ example: 'CN',
7055
+ nullable: true
7056
+ },
7057
+ category: {
7058
+ type: 'string',
7059
+ description:
7060
+ 'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
7061
+ nullable: true,
7062
+ example: 'DigitalWallet'
7063
+ },
6851
7064
  isBound: {
6852
7065
  type: 'boolean',
6853
7066
  description: 'Whether user has accounts using this platform'
@@ -6861,6 +7074,8 @@ export const $PlatformListItemDto = {
6861
7074
  'canonical',
6862
7075
  'suggestedSegment',
6863
7076
  'logoUrl',
7077
+ 'countryCode',
7078
+ 'category',
6864
7079
  'isBound'
6865
7080
  ]
6866
7081
  } as const;
@@ -6896,13 +7111,26 @@ export const $PlatformMatchResultDto = {
6896
7111
  suggestedSegment: {
6897
7112
  type: 'string',
6898
7113
  description:
6899
- 'Suggested path segment — canonical, already in ACCOUNT_RE format'
7114
+ 'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
6900
7115
  },
6901
7116
  logoUrl: {
6902
7117
  type: 'string',
6903
7118
  description: 'Logo URL',
6904
7119
  nullable: true
6905
7120
  },
7121
+ countryCode: {
7122
+ type: 'string',
7123
+ description: 'ISO 3166-1 alpha-2 (UPPERCASE); null = global platform',
7124
+ example: 'CN',
7125
+ nullable: true
7126
+ },
7127
+ category: {
7128
+ type: 'string',
7129
+ description:
7130
+ 'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
7131
+ nullable: true,
7132
+ example: 'DigitalWallet'
7133
+ },
6906
7134
  matchType: {
6907
7135
  type: 'string',
6908
7136
  description: "How this row matched: 'exact' > 'prefix' > 'substring'",
@@ -6916,6 +7144,8 @@ export const $PlatformMatchResultDto = {
6916
7144
  'type',
6917
7145
  'suggestedSegment',
6918
7146
  'logoUrl',
7147
+ 'countryCode',
7148
+ 'category',
6919
7149
  'matchType'
6920
7150
  ]
6921
7151
  } as const;
@@ -193,6 +193,8 @@ import type {
193
193
  TransactionRuleControllerDeleteResponse,
194
194
  TransactionRuleControllerTestData,
195
195
  TransactionRuleControllerTestResponse,
196
+ CategoryCatalogControllerListData,
197
+ CategoryCatalogControllerListResponse,
196
198
  EventControllerCreateData,
197
199
  EventControllerCreateResponse,
198
200
  EventControllerFindAllData,
@@ -257,6 +259,7 @@ import type {
257
259
  PlatformControllerFindAllResponse,
258
260
  PlatformControllerCreateData,
259
261
  PlatformControllerCreateResponse,
262
+ PlatformControllerGetPlatformListData,
260
263
  PlatformControllerGetPlatformListResponse,
261
264
  PlatformControllerMatchPlatformsData,
262
265
  PlatformControllerMatchPlatformsResponse,
@@ -2348,7 +2351,7 @@ export class UsersService {
2348
2351
  * Get current authenticated user
2349
2352
  * @param data The data for the request.
2350
2353
  * @param data.acceptLanguage
2351
- * @returns unknown User retrieved successfully
2354
+ * @returns UserResponseDto User retrieved successfully
2352
2355
  * @throws ApiError
2353
2356
  */
2354
2357
  public static userControllerGetUser(
@@ -2855,6 +2858,34 @@ export class BeanTransactionRulesService {
2855
2858
  }
2856
2859
  }
2857
2860
 
2861
+ export class BeanCategoryCatalogService {
2862
+ /**
2863
+ * List category catalog for a region
2864
+ * Returns the region-scoped category slugs (expense/income/investment/banking/transfer/payment) for the NLP result picker. CN-exclusive payment instruments (huabei/baitiao) appear only under /cn.
2865
+ * @param data The data for the request.
2866
+ * @param data.region Region code for tenant context
2867
+ * @param data.scenario Filter by scenario
2868
+ * @param data.routeBearing Filter by routeBearing (entity-router route() consumes it)
2869
+ * @returns CategoryCatalogListResponseDto Category catalog retrieved successfully
2870
+ * @throws ApiError
2871
+ */
2872
+ public static categoryCatalogControllerList(
2873
+ data: CategoryCatalogControllerListData
2874
+ ): CancelablePromise<CategoryCatalogControllerListResponse> {
2875
+ return __request(OpenAPI, {
2876
+ method: 'GET',
2877
+ url: '/api/v1/{region}/bean/categories',
2878
+ path: {
2879
+ region: data.region
2880
+ },
2881
+ query: {
2882
+ scenario: data.scenario,
2883
+ routeBearing: data.routeBearing
2884
+ }
2885
+ });
2886
+ }
2887
+ }
2888
+
2858
2889
  export class LifeEventsService {
2859
2890
  /**
2860
2891
  * Create a new life event
@@ -3730,13 +3761,20 @@ export class BeanPlatformsService {
3730
3761
 
3731
3762
  /**
3732
3763
  * Get platform list for current user
3764
+ * @param data The data for the request.
3765
+ * @param data.region Region code (ISO 3166-1 alpha-2) that biases within-type-bucket ordering (local-region platforms first). Case-insensitive — stored/compared UPPERCASE ("cn" == "CN").
3733
3766
  * @returns PlatformListItemDto List of platforms with user binding status
3734
3767
  * @throws ApiError
3735
3768
  */
3736
- public static platformControllerGetPlatformList(): CancelablePromise<PlatformControllerGetPlatformListResponse> {
3769
+ public static platformControllerGetPlatformList(
3770
+ data: PlatformControllerGetPlatformListData = {}
3771
+ ): CancelablePromise<PlatformControllerGetPlatformListResponse> {
3737
3772
  return __request(OpenAPI, {
3738
3773
  method: 'GET',
3739
- url: '/api/v1/bean/platforms/list'
3774
+ url: '/api/v1/bean/platforms/list',
3775
+ query: {
3776
+ region: data.region
3777
+ }
3740
3778
  });
3741
3779
  }
3742
3780
 
@@ -3744,7 +3782,7 @@ export class BeanPlatformsService {
3744
3782
  * Match platforms by name or alias
3745
3783
  * @param data The data for the request.
3746
3784
  * @param data.q Search query — Chinese name, English name, or abbreviation
3747
- * @param data.region Region code for category override lookup
3785
+ * @param data.region Region code (ISO 3166-1 alpha-2) that biases within-tier ordering (local-region platforms first); also the intended categoryOverrides key. Case-insensitive — stored/compared UPPERCASE ("cn" == "CN").
3748
3786
  * @returns PlatformMatchResponseDto Matching platforms with overall match type and truncation flag
3749
3787
  * @throws ApiError
3750
3788
  */