@firela/api-types 0.0.0-canary.f2efa2bf → 0.0.0-canary.fb3ac1dd

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.js CHANGED
@@ -454,10 +454,12 @@ var request = (config, options) => {
454
454
  // src/generated/services.gen.ts
455
455
  var BeanAccountsService = class {
456
456
  /**
457
+ * Create a new account
458
+ * Creates a new account (Beancount Open directive)
457
459
  * @param data The data for the request.
458
460
  * @param data.region Region code for tenant context
459
461
  * @param data.requestBody
460
- * @returns unknown
462
+ * @returns AccountResponseDto Account created successfully
461
463
  * @throws ApiError
462
464
  */
463
465
  static accountControllerCreate(data) {
@@ -468,7 +470,10 @@ var BeanAccountsService = class {
468
470
  region: data.region
469
471
  },
470
472
  body: data.requestBody,
471
- mediaType: "application/json"
473
+ mediaType: "application/json",
474
+ errors: {
475
+ 409: "Account already exists"
476
+ }
472
477
  });
473
478
  }
474
479
  /**
@@ -479,7 +484,7 @@ var BeanAccountsService = class {
479
484
  * @param data.type Filter by account type
480
485
  * @param data.status Filter by status
481
486
  * @param data.isCustom Filter by custom (user-created) accounts only
482
- * @param data.search Search term for path or i18nKey
487
+ * @param data.search Search term for account path
483
488
  * @param data.limit Maximum number of results
484
489
  * @param data.offset Number of results to skip
485
490
  * @returns AccountListResponseDto Accounts retrieved successfully
@@ -525,11 +530,13 @@ var BeanAccountsService = class {
525
530
  });
526
531
  }
527
532
  /**
533
+ * Update account
534
+ * Updates account metadata (path cannot be changed)
528
535
  * @param data The data for the request.
529
- * @param data.id
536
+ * @param data.id Account UUID
530
537
  * @param data.region Region code for tenant context
531
538
  * @param data.requestBody
532
- * @returns unknown
539
+ * @returns AccountResponseDto Account updated successfully
533
540
  * @throws ApiError
534
541
  */
535
542
  static accountControllerUpdate(data) {
@@ -541,14 +548,19 @@ var BeanAccountsService = class {
541
548
  region: data.region
542
549
  },
543
550
  body: data.requestBody,
544
- mediaType: "application/json"
551
+ mediaType: "application/json",
552
+ errors: {
553
+ 404: "Account not found"
554
+ }
545
555
  });
546
556
  }
547
557
  /**
558
+ * Delete account
559
+ * Deletes an account (only if no active transactions; voided/superseded residual postings are cleaned up)
548
560
  * @param data The data for the request.
549
- * @param data.id
561
+ * @param data.id Account UUID
550
562
  * @param data.region Region code for tenant context
551
- * @returns unknown
563
+ * @returns void Account deleted successfully
552
564
  * @throws ApiError
553
565
  */
554
566
  static accountControllerDelete(data) {
@@ -558,15 +570,21 @@ var BeanAccountsService = class {
558
570
  path: {
559
571
  id: data.id,
560
572
  region: data.region
573
+ },
574
+ errors: {
575
+ 404: "Account not found",
576
+ 409: "Account has active transactions and cannot be deleted"
561
577
  }
562
578
  });
563
579
  }
564
580
  /**
581
+ * Close account
582
+ * Closes an account (Beancount Close directive)
565
583
  * @param data The data for the request.
566
- * @param data.id
584
+ * @param data.id Account UUID
567
585
  * @param data.region Region code for tenant context
568
586
  * @param data.requestBody
569
- * @returns unknown
587
+ * @returns AccountResponseDto Account closed successfully
570
588
  * @throws ApiError
571
589
  */
572
590
  static accountControllerClose(data) {
@@ -578,15 +596,21 @@ var BeanAccountsService = class {
578
596
  region: data.region
579
597
  },
580
598
  body: data.requestBody,
581
- mediaType: "application/json"
599
+ mediaType: "application/json",
600
+ errors: {
601
+ 400: "Account is already closed",
602
+ 404: "Account not found"
603
+ }
582
604
  });
583
605
  }
584
606
  /**
607
+ * Reopen account
608
+ * Reopens a previously closed account
585
609
  * @param data The data for the request.
586
- * @param data.id
610
+ * @param data.id Account UUID
587
611
  * @param data.region Region code for tenant context
588
612
  * @param data.requestBody
589
- * @returns unknown
613
+ * @returns AccountResponseDto Account reopened successfully
590
614
  * @throws ApiError
591
615
  */
592
616
  static accountControllerReopen(data) {
@@ -598,7 +622,37 @@ var BeanAccountsService = class {
598
622
  region: data.region
599
623
  },
600
624
  body: data.requestBody,
601
- mediaType: "application/json"
625
+ mediaType: "application/json",
626
+ errors: {
627
+ 400: "Account is not closed",
628
+ 404: "Account not found"
629
+ }
630
+ });
631
+ }
632
+ /**
633
+ * Post an opening-balance transaction
634
+ * 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.
635
+ * @param data The data for the request.
636
+ * @param data.id Account UUID
637
+ * @param data.region Region code for tenant context
638
+ * @param data.requestBody
639
+ * @returns OpeningBalanceResultDto Opening-balance transaction created
640
+ * @throws ApiError
641
+ */
642
+ static accountControllerAddOpeningBalance(data) {
643
+ return request(OpenAPI, {
644
+ method: "POST",
645
+ url: "/api/v1/{region}/bean/accounts/{id}/opening-balance",
646
+ path: {
647
+ id: data.id,
648
+ region: data.region
649
+ },
650
+ body: data.requestBody,
651
+ mediaType: "application/json",
652
+ errors: {
653
+ 404: "Account not found",
654
+ 409: "An opening balance already exists for this account"
655
+ }
602
656
  });
603
657
  }
604
658
  };
@@ -642,6 +696,7 @@ var BeanTransactionsService = class {
642
696
  * @param data.status Filter by transaction status
643
697
  * @param data.search Search in narration and payee fields (max 200 chars)
644
698
  * @param data.accountId Filter by account ID (transactions with postings to this account)
699
+ * @param data.category Filter by ADR-0075 functional category (Group segment); matches any posting to an Expenses/Income account whose derived Group segment equals this value
645
700
  * @returns TransactionListResponseDto Transaction list
646
701
  * @throws ApiError
647
702
  */
@@ -659,7 +714,8 @@ var BeanTransactionsService = class {
659
714
  dateTo: data.dateTo,
660
715
  status: data.status,
661
716
  search: data.search,
662
- accountId: data.accountId
717
+ accountId: data.accountId,
718
+ category: data.category
663
719
  },
664
720
  errors: {
665
721
  400: "Validation failed",
@@ -828,7 +884,7 @@ var BeanBalancesService = class {
828
884
  * Query account balance
829
885
  * Calculate account balance at a specific date for a single currency
830
886
  * @param data The data for the request.
831
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
887
+ * @param data.account Account name (e.g., "Assets:Checking")
832
888
  * @param data.region Region code for tenant context
833
889
  * @param data.date Date to calculate balance at (ISO 8601 format)
834
890
  * @param data.currency Currency to query (e.g., "USD", "CNY")
@@ -1032,11 +1088,33 @@ var BeanCommoditiesService = class {
1032
1088
  };
1033
1089
  var ProviderSyncService = class {
1034
1090
  /**
1091
+ * Sync transactions from financial data provider
1092
+ *
1093
+ * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
1094
+ *
1095
+ * **Supported Providers:**
1096
+ * - **plaid**: Plaid API (US, Canada, Europe)
1097
+ * - **teller**: Teller API (US)
1098
+ * - **truelayer**: TrueLayer Open Banking (UK, Europe)
1099
+ * - **gocardless**: GoCardless Bank Account Data (Europe)
1100
+ * - **simplefin**: SimpleFIN (Self-hosted)
1101
+ * - **yodlee**: Yodlee (Global)
1102
+ * - **beancount-direct**: Beancount format transactions
1103
+ * - **parsed-bill**: Client-side parsed bill transactions
1104
+ *
1105
+ * **Processing Flow:**
1106
+ * 1. Transform raw data via provider adapter
1107
+ * 2. Validate transaction format
1108
+ * 3. Deduplicate using originalId
1109
+ * 4. Classify using rule engine
1110
+ * 5. Route low-confidence to Review Center
1111
+ * 6. Persist validated transactions
1112
+ *
1035
1113
  * @param data The data for the request.
1036
- * @param data.providerName
1114
+ * @param data.providerName Provider name
1037
1115
  * @param data.region Region code for tenant context
1038
1116
  * @param data.requestBody
1039
- * @returns unknown
1117
+ * @returns ProviderSyncResponseDto Sync completed successfully
1040
1118
  * @throws ApiError
1041
1119
  */
1042
1120
  static providerSyncControllerSync(data) {
@@ -1048,7 +1126,12 @@ var ProviderSyncService = class {
1048
1126
  region: data.region
1049
1127
  },
1050
1128
  body: data.requestBody,
1051
- mediaType: "application/json"
1129
+ mediaType: "application/json",
1130
+ errors: {
1131
+ 400: "Invalid request data",
1132
+ 401: "Missing or invalid authentication",
1133
+ 404: "Provider not supported"
1134
+ }
1052
1135
  });
1053
1136
  }
1054
1137
  /**
package/dist/index.mjs CHANGED
@@ -422,10 +422,12 @@ var request = (config, options) => {
422
422
  // src/generated/services.gen.ts
423
423
  var BeanAccountsService = class {
424
424
  /**
425
+ * Create a new account
426
+ * Creates a new account (Beancount Open directive)
425
427
  * @param data The data for the request.
426
428
  * @param data.region Region code for tenant context
427
429
  * @param data.requestBody
428
- * @returns unknown
430
+ * @returns AccountResponseDto Account created successfully
429
431
  * @throws ApiError
430
432
  */
431
433
  static accountControllerCreate(data) {
@@ -436,7 +438,10 @@ var BeanAccountsService = class {
436
438
  region: data.region
437
439
  },
438
440
  body: data.requestBody,
439
- mediaType: "application/json"
441
+ mediaType: "application/json",
442
+ errors: {
443
+ 409: "Account already exists"
444
+ }
440
445
  });
441
446
  }
442
447
  /**
@@ -447,7 +452,7 @@ var BeanAccountsService = class {
447
452
  * @param data.type Filter by account type
448
453
  * @param data.status Filter by status
449
454
  * @param data.isCustom Filter by custom (user-created) accounts only
450
- * @param data.search Search term for path or i18nKey
455
+ * @param data.search Search term for account path
451
456
  * @param data.limit Maximum number of results
452
457
  * @param data.offset Number of results to skip
453
458
  * @returns AccountListResponseDto Accounts retrieved successfully
@@ -493,11 +498,13 @@ var BeanAccountsService = class {
493
498
  });
494
499
  }
495
500
  /**
501
+ * Update account
502
+ * Updates account metadata (path cannot be changed)
496
503
  * @param data The data for the request.
497
- * @param data.id
504
+ * @param data.id Account UUID
498
505
  * @param data.region Region code for tenant context
499
506
  * @param data.requestBody
500
- * @returns unknown
507
+ * @returns AccountResponseDto Account updated successfully
501
508
  * @throws ApiError
502
509
  */
503
510
  static accountControllerUpdate(data) {
@@ -509,14 +516,19 @@ var BeanAccountsService = class {
509
516
  region: data.region
510
517
  },
511
518
  body: data.requestBody,
512
- mediaType: "application/json"
519
+ mediaType: "application/json",
520
+ errors: {
521
+ 404: "Account not found"
522
+ }
513
523
  });
514
524
  }
515
525
  /**
526
+ * Delete account
527
+ * Deletes an account (only if no active transactions; voided/superseded residual postings are cleaned up)
516
528
  * @param data The data for the request.
517
- * @param data.id
529
+ * @param data.id Account UUID
518
530
  * @param data.region Region code for tenant context
519
- * @returns unknown
531
+ * @returns void Account deleted successfully
520
532
  * @throws ApiError
521
533
  */
522
534
  static accountControllerDelete(data) {
@@ -526,15 +538,21 @@ var BeanAccountsService = class {
526
538
  path: {
527
539
  id: data.id,
528
540
  region: data.region
541
+ },
542
+ errors: {
543
+ 404: "Account not found",
544
+ 409: "Account has active transactions and cannot be deleted"
529
545
  }
530
546
  });
531
547
  }
532
548
  /**
549
+ * Close account
550
+ * Closes an account (Beancount Close directive)
533
551
  * @param data The data for the request.
534
- * @param data.id
552
+ * @param data.id Account UUID
535
553
  * @param data.region Region code for tenant context
536
554
  * @param data.requestBody
537
- * @returns unknown
555
+ * @returns AccountResponseDto Account closed successfully
538
556
  * @throws ApiError
539
557
  */
540
558
  static accountControllerClose(data) {
@@ -546,15 +564,21 @@ var BeanAccountsService = class {
546
564
  region: data.region
547
565
  },
548
566
  body: data.requestBody,
549
- mediaType: "application/json"
567
+ mediaType: "application/json",
568
+ errors: {
569
+ 400: "Account is already closed",
570
+ 404: "Account not found"
571
+ }
550
572
  });
551
573
  }
552
574
  /**
575
+ * Reopen account
576
+ * Reopens a previously closed account
553
577
  * @param data The data for the request.
554
- * @param data.id
578
+ * @param data.id Account UUID
555
579
  * @param data.region Region code for tenant context
556
580
  * @param data.requestBody
557
- * @returns unknown
581
+ * @returns AccountResponseDto Account reopened successfully
558
582
  * @throws ApiError
559
583
  */
560
584
  static accountControllerReopen(data) {
@@ -566,7 +590,37 @@ var BeanAccountsService = class {
566
590
  region: data.region
567
591
  },
568
592
  body: data.requestBody,
569
- mediaType: "application/json"
593
+ mediaType: "application/json",
594
+ errors: {
595
+ 400: "Account is not closed",
596
+ 404: "Account not found"
597
+ }
598
+ });
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
+ }
570
624
  });
571
625
  }
572
626
  };
@@ -610,6 +664,7 @@ var BeanTransactionsService = class {
610
664
  * @param data.status Filter by transaction status
611
665
  * @param data.search Search in narration and payee fields (max 200 chars)
612
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 Expenses/Income account whose derived Group segment equals this value
613
668
  * @returns TransactionListResponseDto Transaction list
614
669
  * @throws ApiError
615
670
  */
@@ -627,7 +682,8 @@ var BeanTransactionsService = class {
627
682
  dateTo: data.dateTo,
628
683
  status: data.status,
629
684
  search: data.search,
630
- accountId: data.accountId
685
+ accountId: data.accountId,
686
+ category: data.category
631
687
  },
632
688
  errors: {
633
689
  400: "Validation failed",
@@ -796,7 +852,7 @@ var BeanBalancesService = class {
796
852
  * Query account balance
797
853
  * Calculate account balance at a specific date for a single currency
798
854
  * @param data The data for the request.
799
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
855
+ * @param data.account Account name (e.g., "Assets:Checking")
800
856
  * @param data.region Region code for tenant context
801
857
  * @param data.date Date to calculate balance at (ISO 8601 format)
802
858
  * @param data.currency Currency to query (e.g., "USD", "CNY")
@@ -1000,11 +1056,33 @@ var BeanCommoditiesService = class {
1000
1056
  };
1001
1057
  var ProviderSyncService = class {
1002
1058
  /**
1059
+ * Sync transactions from financial data provider
1060
+ *
1061
+ * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
1062
+ *
1063
+ * **Supported Providers:**
1064
+ * - **plaid**: Plaid API (US, Canada, Europe)
1065
+ * - **teller**: Teller API (US)
1066
+ * - **truelayer**: TrueLayer Open Banking (UK, Europe)
1067
+ * - **gocardless**: GoCardless Bank Account Data (Europe)
1068
+ * - **simplefin**: SimpleFIN (Self-hosted)
1069
+ * - **yodlee**: Yodlee (Global)
1070
+ * - **beancount-direct**: Beancount format transactions
1071
+ * - **parsed-bill**: Client-side parsed bill transactions
1072
+ *
1073
+ * **Processing Flow:**
1074
+ * 1. Transform raw data via provider adapter
1075
+ * 2. Validate transaction format
1076
+ * 3. Deduplicate using originalId
1077
+ * 4. Classify using rule engine
1078
+ * 5. Route low-confidence to Review Center
1079
+ * 6. Persist validated transactions
1080
+ *
1003
1081
  * @param data The data for the request.
1004
- * @param data.providerName
1082
+ * @param data.providerName Provider name
1005
1083
  * @param data.region Region code for tenant context
1006
1084
  * @param data.requestBody
1007
- * @returns unknown
1085
+ * @returns ProviderSyncResponseDto Sync completed successfully
1008
1086
  * @throws ApiError
1009
1087
  */
1010
1088
  static providerSyncControllerSync(data) {
@@ -1016,7 +1094,12 @@ var ProviderSyncService = class {
1016
1094
  region: data.region
1017
1095
  },
1018
1096
  body: data.requestBody,
1019
- mediaType: "application/json"
1097
+ mediaType: "application/json",
1098
+ errors: {
1099
+ 400: "Invalid request data",
1100
+ 401: "Missing or invalid authentication",
1101
+ 404: "Provider not supported"
1102
+ }
1020
1103
  });
1021
1104
  }
1022
1105
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firela/api-types",
3
- "version": "0.0.0-canary.f2efa2bf",
3
+ "version": "0.0.0-canary.fb3ac1dd",
4
4
  "description": "TypeScript types generated from IGN OpenAPI specification",
5
5
  "license": "MIT",
6
6
  "author": "FireLa Team",