@firela/api-types 0.0.0-canary.8cbdced0 → 0.0.0-canary.9d0af796

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.
@@ -171,6 +171,18 @@ import type {
171
171
  PropertyControllerUpdateResponse,
172
172
  PropertyControllerDeleteData,
173
173
  PropertyControllerDeleteResponse,
174
+ EventControllerCreateData,
175
+ EventControllerCreateResponse,
176
+ EventControllerFindAllData,
177
+ EventControllerFindAllResponse,
178
+ EventControllerFindOneData,
179
+ EventControllerFindOneResponse,
180
+ EventControllerUpdateData,
181
+ EventControllerUpdateResponse,
182
+ EventControllerDeleteData,
183
+ EventControllerDeleteResponse,
184
+ EventControllerGetSliceData,
185
+ EventControllerGetSliceResponse,
174
186
  ExportControllerExportBeancountResponse,
175
187
  FileImportControllerImportFileData,
176
188
  FileImportControllerImportFileResponse,
@@ -234,6 +246,8 @@ import type {
234
246
  PriceControllerBulkCreateResponse,
235
247
  ReportingControllerGetPortfolioTrendsData,
236
248
  ReportingControllerGetPortfolioTrendsResponse,
249
+ ReportingControllerGetCashFlowTrendsData,
250
+ ReportingControllerGetCashFlowTrendsResponse,
237
251
  ReportingControllerGenerateSnapshotData,
238
252
  ReportingControllerGenerateSnapshotResponse,
239
253
  ReportingControllerBackfillSnapshotsData,
@@ -257,10 +271,12 @@ import type {
257
271
 
258
272
  export class BeanAccountsService {
259
273
  /**
274
+ * Create a new account
275
+ * Creates a new account (Beancount Open directive)
260
276
  * @param data The data for the request.
261
277
  * @param data.region Region code for tenant context
262
278
  * @param data.requestBody
263
- * @returns unknown
279
+ * @returns AccountResponseDto Account created successfully
264
280
  * @throws ApiError
265
281
  */
266
282
  public static accountControllerCreate(
@@ -273,7 +289,10 @@ export class BeanAccountsService {
273
289
  region: data.region
274
290
  },
275
291
  body: data.requestBody,
276
- mediaType: 'application/json'
292
+ mediaType: 'application/json',
293
+ errors: {
294
+ 409: 'Account already exists'
295
+ }
277
296
  });
278
297
  }
279
298
 
@@ -337,11 +356,13 @@ export class BeanAccountsService {
337
356
  }
338
357
 
339
358
  /**
359
+ * Update account
360
+ * Updates account metadata (path cannot be changed)
340
361
  * @param data The data for the request.
341
- * @param data.id
362
+ * @param data.id Account UUID
342
363
  * @param data.region Region code for tenant context
343
364
  * @param data.requestBody
344
- * @returns unknown
365
+ * @returns AccountResponseDto Account updated successfully
345
366
  * @throws ApiError
346
367
  */
347
368
  public static accountControllerUpdate(
@@ -355,15 +376,20 @@ export class BeanAccountsService {
355
376
  region: data.region
356
377
  },
357
378
  body: data.requestBody,
358
- mediaType: 'application/json'
379
+ mediaType: 'application/json',
380
+ errors: {
381
+ 404: 'Account not found'
382
+ }
359
383
  });
360
384
  }
361
385
 
362
386
  /**
387
+ * Delete account
388
+ * Deletes an account (only if no transactions)
363
389
  * @param data The data for the request.
364
- * @param data.id
390
+ * @param data.id Account UUID
365
391
  * @param data.region Region code for tenant context
366
- * @returns unknown
392
+ * @returns void Account deleted successfully
367
393
  * @throws ApiError
368
394
  */
369
395
  public static accountControllerDelete(
@@ -375,16 +401,22 @@ export class BeanAccountsService {
375
401
  path: {
376
402
  id: data.id,
377
403
  region: data.region
404
+ },
405
+ errors: {
406
+ 404: 'Account not found',
407
+ 409: 'Account has transactions and cannot be deleted'
378
408
  }
379
409
  });
380
410
  }
381
411
 
382
412
  /**
413
+ * Close account
414
+ * Closes an account (Beancount Close directive)
383
415
  * @param data The data for the request.
384
- * @param data.id
416
+ * @param data.id Account UUID
385
417
  * @param data.region Region code for tenant context
386
418
  * @param data.requestBody
387
- * @returns unknown
419
+ * @returns AccountResponseDto Account closed successfully
388
420
  * @throws ApiError
389
421
  */
390
422
  public static accountControllerClose(
@@ -398,16 +430,22 @@ export class BeanAccountsService {
398
430
  region: data.region
399
431
  },
400
432
  body: data.requestBody,
401
- mediaType: 'application/json'
433
+ mediaType: 'application/json',
434
+ errors: {
435
+ 400: 'Account is already closed',
436
+ 404: 'Account not found'
437
+ }
402
438
  });
403
439
  }
404
440
 
405
441
  /**
442
+ * Reopen account
443
+ * Reopens a previously closed account
406
444
  * @param data The data for the request.
407
- * @param data.id
445
+ * @param data.id Account UUID
408
446
  * @param data.region Region code for tenant context
409
447
  * @param data.requestBody
410
- * @returns unknown
448
+ * @returns AccountResponseDto Account reopened successfully
411
449
  * @throws ApiError
412
450
  */
413
451
  public static accountControllerReopen(
@@ -421,7 +459,11 @@ export class BeanAccountsService {
421
459
  region: data.region
422
460
  },
423
461
  body: data.requestBody,
424
- mediaType: 'application/json'
462
+ mediaType: 'application/json',
463
+ errors: {
464
+ 400: 'Account is not closed',
465
+ 404: 'Account not found'
466
+ }
425
467
  });
426
468
  }
427
469
  }
@@ -2432,6 +2474,181 @@ export class PropertiesService {
2432
2474
  }
2433
2475
  }
2434
2476
 
2477
+ export class LifeEventsService {
2478
+ /**
2479
+ * Create a new life event
2480
+ * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2481
+ * @param data The data for the request.
2482
+ * @param data.region Region code for tenant context (decorative for life events)
2483
+ * @param data.requestBody
2484
+ * @returns EventResponseDto Life event created successfully
2485
+ * @throws ApiError
2486
+ */
2487
+ public static eventControllerCreate(
2488
+ data: EventControllerCreateData
2489
+ ): CancelablePromise<EventControllerCreateResponse> {
2490
+ return __request(OpenAPI, {
2491
+ method: 'POST',
2492
+ url: '/api/v1/{region}/bean/events',
2493
+ path: {
2494
+ region: data.region
2495
+ },
2496
+ body: data.requestBody,
2497
+ mediaType: 'application/json',
2498
+ errors: {
2499
+ 409: 'Life event already exists for this (userId, type, date) combination'
2500
+ }
2501
+ });
2502
+ }
2503
+
2504
+ /**
2505
+ * List user life events
2506
+ * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2507
+ * @param data The data for the request.
2508
+ * @param data.region Region code for tenant context (decorative for life events)
2509
+ * @param data.type Filter by life event type (exact match)
2510
+ * @param data.q Search term for description (case-insensitive partial match)
2511
+ * @param data.from Filter life events from this date (ISO 8601 format)
2512
+ * @param data.to Filter life events to this date (ISO 8601 format)
2513
+ * @param data.page Page number for pagination (default: 1)
2514
+ * @param data.limit Number of items per page (default: 20, max: 100)
2515
+ * @returns EventListResponseDto Life events retrieved successfully
2516
+ * @throws ApiError
2517
+ */
2518
+ public static eventControllerFindAll(
2519
+ data: EventControllerFindAllData
2520
+ ): CancelablePromise<EventControllerFindAllResponse> {
2521
+ return __request(OpenAPI, {
2522
+ method: 'GET',
2523
+ url: '/api/v1/{region}/bean/events',
2524
+ path: {
2525
+ region: data.region
2526
+ },
2527
+ query: {
2528
+ type: data.type,
2529
+ q: data.q,
2530
+ from: data.from,
2531
+ to: data.to,
2532
+ page: data.page,
2533
+ limit: data.limit
2534
+ }
2535
+ });
2536
+ }
2537
+
2538
+ /**
2539
+ * Get life event by ID
2540
+ * Returns a single life event by its ID. Returns ETag header.
2541
+ * @param data The data for the request.
2542
+ * @param data.id Life event ID
2543
+ * @param data.region Region code for tenant context (decorative for life events)
2544
+ * @returns EventResponseDto Life event retrieved successfully
2545
+ * @throws ApiError
2546
+ */
2547
+ public static eventControllerFindOne(
2548
+ data: EventControllerFindOneData
2549
+ ): CancelablePromise<EventControllerFindOneResponse> {
2550
+ return __request(OpenAPI, {
2551
+ method: 'GET',
2552
+ url: '/api/v1/{region}/bean/events/{id}',
2553
+ path: {
2554
+ id: data.id,
2555
+ region: data.region
2556
+ },
2557
+ errors: {
2558
+ 404: 'Life event not found'
2559
+ }
2560
+ });
2561
+ }
2562
+
2563
+ /**
2564
+ * Update a life event
2565
+ * Updates an existing life event. If If-Match header is provided, performs optimistic concurrency check; mismatched updatedAt returns 412.
2566
+ * @param data The data for the request.
2567
+ * @param data.id Life event ID
2568
+ * @param data.region Region code for tenant context (decorative for life events)
2569
+ * @param data.requestBody
2570
+ * @returns EventResponseDto Life event updated successfully
2571
+ * @throws ApiError
2572
+ */
2573
+ public static eventControllerUpdate(
2574
+ data: EventControllerUpdateData
2575
+ ): CancelablePromise<EventControllerUpdateResponse> {
2576
+ return __request(OpenAPI, {
2577
+ method: 'PUT',
2578
+ url: '/api/v1/{region}/bean/events/{id}',
2579
+ path: {
2580
+ id: data.id,
2581
+ region: data.region
2582
+ },
2583
+ body: data.requestBody,
2584
+ mediaType: 'application/json',
2585
+ errors: {
2586
+ 400: 'If-Match header is not a valid ISO 8601 date',
2587
+ 404: 'Life event not found',
2588
+ 409: 'Updated event conflicts with an existing (userId, type, date) combination',
2589
+ 412: 'If-Match precondition failed (updatedAt mismatch)'
2590
+ }
2591
+ });
2592
+ }
2593
+
2594
+ /**
2595
+ * Delete a life event
2596
+ * Deletes a life event entry (hard delete). Returns 204.
2597
+ * @param data The data for the request.
2598
+ * @param data.id Life event ID
2599
+ * @param data.region Region code for tenant context (decorative for life events)
2600
+ * @returns void Life event deleted successfully
2601
+ * @throws ApiError
2602
+ */
2603
+ public static eventControllerDelete(
2604
+ data: EventControllerDeleteData
2605
+ ): CancelablePromise<EventControllerDeleteResponse> {
2606
+ return __request(OpenAPI, {
2607
+ method: 'DELETE',
2608
+ url: '/api/v1/{region}/bean/events/{id}',
2609
+ path: {
2610
+ id: data.id,
2611
+ region: data.region
2612
+ },
2613
+ errors: {
2614
+ 404: 'Life event not found'
2615
+ }
2616
+ });
2617
+ }
2618
+
2619
+ /**
2620
+ * Slice time-series by a life event (Phase 79)
2621
+ * Returns aggregated time-series for postings matching accountPattern within the half-open date range of the given life event.
2622
+ * @param data The data for the request.
2623
+ * @param data.id Life event ID
2624
+ * @param data.accountPattern
2625
+ * @param data.granularity
2626
+ * @param data.region Region code for tenant context (decorative for life events)
2627
+ * @returns unknown Time-series sliced by the life event range
2628
+ * @throws ApiError
2629
+ */
2630
+ public static eventControllerGetSlice(
2631
+ data: EventControllerGetSliceData
2632
+ ): CancelablePromise<EventControllerGetSliceResponse> {
2633
+ return __request(OpenAPI, {
2634
+ method: 'GET',
2635
+ url: '/api/v1/{region}/bean/events/{id}/slice',
2636
+ path: {
2637
+ id: data.id,
2638
+ region: data.region
2639
+ },
2640
+ query: {
2641
+ accountPattern: data.accountPattern,
2642
+ granularity: data.granularity
2643
+ },
2644
+ errors: {
2645
+ 400: 'accountPattern query param is empty',
2646
+ 404: 'Life event not found'
2647
+ }
2648
+ });
2649
+ }
2650
+ }
2651
+
2435
2652
  export class BeanExportService {
2436
2653
  /**
2437
2654
  * Export Beancount ledger as ZIP
@@ -2504,9 +2721,12 @@ export class BeanImportService {
2504
2721
  }
2505
2722
 
2506
2723
  /**
2724
+ * Import a Beancount file in community format
2725
+ * Upload a .beancount file to import. The system parses community-format paths, converts to internal format using category metadata, auto-creates accounts, and imports transactions with deduplication. Maximum file size: 50MB. Only 1 import per user at a time.
2507
2726
  * @param data The data for the request.
2508
2727
  * @param data.region Region code for tenant context
2509
- * @returns unknown
2728
+ * @param data.formData Beancount file to import
2729
+ * @returns unknown Beancount file imported successfully
2510
2730
  * @throws ApiError
2511
2731
  */
2512
2732
  public static fileImportControllerImportBeancount(
@@ -2517,6 +2737,11 @@ export class BeanImportService {
2517
2737
  url: '/api/v1/{region}/bean/import/beancount',
2518
2738
  path: {
2519
2739
  region: data.region
2740
+ },
2741
+ formData: data.formData,
2742
+ mediaType: 'multipart/form-data',
2743
+ errors: {
2744
+ 400: 'Bad request - invalid file or no file uploaded'
2520
2745
  }
2521
2746
  });
2522
2747
  }
@@ -2719,11 +2944,33 @@ export class BeanPlatformsService {
2719
2944
 
2720
2945
  export class ProviderSyncService {
2721
2946
  /**
2947
+ * Sync transactions from financial data provider
2948
+ *
2949
+ * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
2950
+ *
2951
+ * **Supported Providers:**
2952
+ * - **plaid**: Plaid API (US, Canada, Europe)
2953
+ * - **teller**: Teller API (US)
2954
+ * - **truelayer**: TrueLayer Open Banking (UK, Europe)
2955
+ * - **gocardless**: GoCardless Bank Account Data (Europe)
2956
+ * - **simplefin**: SimpleFIN (Self-hosted)
2957
+ * - **yodlee**: Yodlee (Global)
2958
+ * - **beancount-direct**: Beancount format transactions
2959
+ * - **parsed-bill**: Client-side parsed bill transactions
2960
+ *
2961
+ * **Processing Flow:**
2962
+ * 1. Transform raw data via provider adapter
2963
+ * 2. Validate transaction format
2964
+ * 3. Deduplicate using originalId
2965
+ * 4. Classify using rule engine
2966
+ * 5. Route low-confidence to Review Center
2967
+ * 6. Persist validated transactions
2968
+ *
2722
2969
  * @param data The data for the request.
2723
- * @param data.providerName
2970
+ * @param data.providerName Provider name
2724
2971
  * @param data.region Region code for tenant context
2725
2972
  * @param data.requestBody
2726
- * @returns unknown
2973
+ * @returns ProviderSyncResponseDto Sync completed successfully
2727
2974
  * @throws ApiError
2728
2975
  */
2729
2976
  public static providerSyncControllerSync(
@@ -2737,7 +2984,12 @@ export class ProviderSyncService {
2737
2984
  region: data.region
2738
2985
  },
2739
2986
  body: data.requestBody,
2740
- mediaType: 'application/json'
2987
+ mediaType: 'application/json',
2988
+ errors: {
2989
+ 400: 'Invalid request data',
2990
+ 401: 'Missing or invalid authentication',
2991
+ 404: 'Provider not supported'
2992
+ }
2741
2993
  });
2742
2994
  }
2743
2995
 
@@ -2867,10 +3119,12 @@ export class ImportTelemetryService {
2867
3119
 
2868
3120
  export class BeanNlpService {
2869
3121
  /**
3122
+ * Process natural language input
3123
+ * Parse natural language text (Chinese/English) describing a transaction. Supports multi-turn dialogue for collecting missing information. When confidence < 0.75, returns "confirm" action requiring user verification. User can reply with confirmation words (确认/yes/ok) or provide corrections. Examples: "yesterday Starbucks spent 35 yuan", "today lunch 28 yuan", "spent $50 at Walmart"
2870
3124
  * @param data The data for the request.
2871
3125
  * @param data.region Region code for tenant context
2872
- * @param data.requestBody
2873
- * @returns unknown
3126
+ * @param data.requestBody Natural language transaction input with optional session ID
3127
+ * @returns NlpResponseDto NLP processing result - either created transaction or asking for more info
2874
3128
  * @throws ApiError
2875
3129
  */
2876
3130
  public static nlpControllerProcessNaturalLanguage(
@@ -2883,7 +3137,11 @@ export class BeanNlpService {
2883
3137
  region: data.region
2884
3138
  },
2885
3139
  body: data.requestBody,
2886
- mediaType: 'application/json'
3140
+ mediaType: 'application/json',
3141
+ errors: {
3142
+ 400: 'Invalid input',
3143
+ 401: 'Unauthorized'
3144
+ }
2887
3145
  });
2888
3146
  }
2889
3147
 
@@ -3272,6 +3530,42 @@ export class ReportingService {
3272
3530
  });
3273
3531
  }
3274
3532
 
3533
+ /**
3534
+ * Get cash-flow trends
3535
+ *
3536
+ * Monthly income / expense / netSavings over a fixed N-month window
3537
+ * (current month + N−1 prior). Missing months are zero-filled (flow metric).
3538
+ *
3539
+ * **Parameters:**
3540
+ * - `period`: 1m | 3m | 6m | 1y (default 6m)
3541
+ * - `granularity`: accepted for API symmetry; v1 returns month buckets
3542
+ *
3543
+ * @param data The data for the request.
3544
+ * @param data.region Region code for tenant context
3545
+ * @param data.period Time period
3546
+ * @param data.granularity Data granularity (accepted for API symmetry; v1 returns month buckets)
3547
+ * @returns CashFlowTrendsResponseDto Cash-flow trends retrieved successfully
3548
+ * @throws ApiError
3549
+ */
3550
+ public static reportingControllerGetCashFlowTrends(
3551
+ data: ReportingControllerGetCashFlowTrendsData
3552
+ ): CancelablePromise<ReportingControllerGetCashFlowTrendsResponse> {
3553
+ return __request(OpenAPI, {
3554
+ method: 'GET',
3555
+ url: '/api/v1/{region}/reporting/cash-flow/trends',
3556
+ path: {
3557
+ region: data.region
3558
+ },
3559
+ query: {
3560
+ period: data.period,
3561
+ granularity: data.granularity
3562
+ },
3563
+ errors: {
3564
+ 401: 'User not authenticated'
3565
+ }
3566
+ });
3567
+ }
3568
+
3275
3569
  /**
3276
3570
  * Generate portfolio snapshot
3277
3571
  *