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

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
  };
@@ -639,9 +693,11 @@ var BeanTransactionsService = class {
639
693
  * @param data.offset Number of items to skip (default: 0)
640
694
  * @param data.dateFrom Filter by start date (inclusive), format: YYYY-MM-DD
641
695
  * @param data.dateTo Filter by end date (inclusive), format: YYYY-MM-DD
642
- * @param data.status Filter by transaction status
696
+ * @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).
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 account whose derived Group segment equals this value. Must be accompanied by flow (ADR-0126).
700
+ * @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.
645
701
  * @returns TransactionListResponseDto Transaction list
646
702
  * @throws ApiError
647
703
  */
@@ -659,7 +715,9 @@ var BeanTransactionsService = class {
659
715
  dateTo: data.dateTo,
660
716
  status: data.status,
661
717
  search: data.search,
662
- accountId: data.accountId
718
+ accountId: data.accountId,
719
+ category: data.category,
720
+ flow: data.flow
663
721
  },
664
722
  errors: {
665
723
  400: "Validation failed",
@@ -828,7 +886,7 @@ var BeanBalancesService = class {
828
886
  * Query account balance
829
887
  * Calculate account balance at a specific date for a single currency
830
888
  * @param data The data for the request.
831
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
889
+ * @param data.account Account name (e.g., "Assets:Checking")
832
890
  * @param data.region Region code for tenant context
833
891
  * @param data.date Date to calculate balance at (ISO 8601 format)
834
892
  * @param data.currency Currency to query (e.g., "USD", "CNY")
@@ -1032,11 +1090,33 @@ var BeanCommoditiesService = class {
1032
1090
  };
1033
1091
  var ProviderSyncService = class {
1034
1092
  /**
1093
+ * Sync transactions from financial data provider
1094
+ *
1095
+ * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
1096
+ *
1097
+ * **Supported Providers:**
1098
+ * - **plaid**: Plaid API (US, Canada, Europe)
1099
+ * - **teller**: Teller API (US)
1100
+ * - **truelayer**: TrueLayer Open Banking (UK, Europe)
1101
+ * - **gocardless**: GoCardless Bank Account Data (Europe)
1102
+ * - **simplefin**: SimpleFIN (Self-hosted)
1103
+ * - **yodlee**: Yodlee (Global)
1104
+ * - **beancount-direct**: Beancount format transactions
1105
+ * - **parsed-bill**: Client-side parsed bill transactions
1106
+ *
1107
+ * **Processing Flow:**
1108
+ * 1. Transform raw data via provider adapter
1109
+ * 2. Validate transaction format
1110
+ * 3. Deduplicate using originalId
1111
+ * 4. Classify using rule engine
1112
+ * 5. Route low-confidence to Review Center
1113
+ * 6. Persist validated transactions
1114
+ *
1035
1115
  * @param data The data for the request.
1036
- * @param data.providerName
1116
+ * @param data.providerName Provider name
1037
1117
  * @param data.region Region code for tenant context
1038
1118
  * @param data.requestBody
1039
- * @returns unknown
1119
+ * @returns ProviderSyncResponseDto Sync completed successfully
1040
1120
  * @throws ApiError
1041
1121
  */
1042
1122
  static providerSyncControllerSync(data) {
@@ -1048,7 +1128,12 @@ var ProviderSyncService = class {
1048
1128
  region: data.region
1049
1129
  },
1050
1130
  body: data.requestBody,
1051
- mediaType: "application/json"
1131
+ mediaType: "application/json",
1132
+ errors: {
1133
+ 400: "Invalid request data",
1134
+ 401: "Missing or invalid authentication",
1135
+ 404: "Provider not supported"
1136
+ }
1052
1137
  });
1053
1138
  }
1054
1139
  /**
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
  };
@@ -607,9 +661,11 @@ var BeanTransactionsService = class {
607
661
  * @param data.offset Number of items to skip (default: 0)
608
662
  * @param data.dateFrom Filter by start date (inclusive), format: YYYY-MM-DD
609
663
  * @param data.dateTo Filter by end date (inclusive), format: YYYY-MM-DD
610
- * @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).
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 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.
613
669
  * @returns TransactionListResponseDto Transaction list
614
670
  * @throws ApiError
615
671
  */
@@ -627,7 +683,9 @@ var BeanTransactionsService = class {
627
683
  dateTo: data.dateTo,
628
684
  status: data.status,
629
685
  search: data.search,
630
- accountId: data.accountId
686
+ accountId: data.accountId,
687
+ category: data.category,
688
+ flow: data.flow
631
689
  },
632
690
  errors: {
633
691
  400: "Validation failed",
@@ -796,7 +854,7 @@ var BeanBalancesService = class {
796
854
  * Query account balance
797
855
  * Calculate account balance at a specific date for a single currency
798
856
  * @param data The data for the request.
799
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
857
+ * @param data.account Account name (e.g., "Assets:Checking")
800
858
  * @param data.region Region code for tenant context
801
859
  * @param data.date Date to calculate balance at (ISO 8601 format)
802
860
  * @param data.currency Currency to query (e.g., "USD", "CNY")
@@ -1000,11 +1058,33 @@ var BeanCommoditiesService = class {
1000
1058
  };
1001
1059
  var ProviderSyncService = class {
1002
1060
  /**
1061
+ * Sync transactions from financial data provider
1062
+ *
1063
+ * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
1064
+ *
1065
+ * **Supported Providers:**
1066
+ * - **plaid**: Plaid API (US, Canada, Europe)
1067
+ * - **teller**: Teller API (US)
1068
+ * - **truelayer**: TrueLayer Open Banking (UK, Europe)
1069
+ * - **gocardless**: GoCardless Bank Account Data (Europe)
1070
+ * - **simplefin**: SimpleFIN (Self-hosted)
1071
+ * - **yodlee**: Yodlee (Global)
1072
+ * - **beancount-direct**: Beancount format transactions
1073
+ * - **parsed-bill**: Client-side parsed bill transactions
1074
+ *
1075
+ * **Processing Flow:**
1076
+ * 1. Transform raw data via provider adapter
1077
+ * 2. Validate transaction format
1078
+ * 3. Deduplicate using originalId
1079
+ * 4. Classify using rule engine
1080
+ * 5. Route low-confidence to Review Center
1081
+ * 6. Persist validated transactions
1082
+ *
1003
1083
  * @param data The data for the request.
1004
- * @param data.providerName
1084
+ * @param data.providerName Provider name
1005
1085
  * @param data.region Region code for tenant context
1006
1086
  * @param data.requestBody
1007
- * @returns unknown
1087
+ * @returns ProviderSyncResponseDto Sync completed successfully
1008
1088
  * @throws ApiError
1009
1089
  */
1010
1090
  static providerSyncControllerSync(data) {
@@ -1016,7 +1096,12 @@ var ProviderSyncService = class {
1016
1096
  region: data.region
1017
1097
  },
1018
1098
  body: data.requestBody,
1019
- mediaType: "application/json"
1099
+ mediaType: "application/json",
1100
+ errors: {
1101
+ 400: "Invalid request data",
1102
+ 401: "Missing or invalid authentication",
1103
+ 404: "Provider not supported"
1104
+ }
1020
1105
  });
1021
1106
  }
1022
1107
  /**
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.f73c3118",
4
4
  "description": "TypeScript types generated from IGN OpenAPI specification",
5
5
  "license": "MIT",
6
6
  "author": "FireLa Team",