@firela/api-types 0.0.0-canary.ebb51de2 → 0.0.0-canary.efbd2b9a
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.d.mts +728 -35
- package/dist/index.d.ts +728 -35
- package/dist/index.js +71 -16
- package/dist/index.mjs +71 -16
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +819 -2
- package/src/generated/services.gen.ts +89 -20
- package/src/generated/types.gen.ts +734 -23
|
@@ -257,10 +257,12 @@ import type {
|
|
|
257
257
|
|
|
258
258
|
export class BeanAccountsService {
|
|
259
259
|
/**
|
|
260
|
+
* Create a new account
|
|
261
|
+
* Creates a new account (Beancount Open directive)
|
|
260
262
|
* @param data The data for the request.
|
|
261
263
|
* @param data.region Region code for tenant context
|
|
262
264
|
* @param data.requestBody
|
|
263
|
-
* @returns
|
|
265
|
+
* @returns AccountResponseDto Account created successfully
|
|
264
266
|
* @throws ApiError
|
|
265
267
|
*/
|
|
266
268
|
public static accountControllerCreate(
|
|
@@ -273,7 +275,10 @@ export class BeanAccountsService {
|
|
|
273
275
|
region: data.region
|
|
274
276
|
},
|
|
275
277
|
body: data.requestBody,
|
|
276
|
-
mediaType: 'application/json'
|
|
278
|
+
mediaType: 'application/json',
|
|
279
|
+
errors: {
|
|
280
|
+
409: 'Account already exists'
|
|
281
|
+
}
|
|
277
282
|
});
|
|
278
283
|
}
|
|
279
284
|
|
|
@@ -337,11 +342,13 @@ export class BeanAccountsService {
|
|
|
337
342
|
}
|
|
338
343
|
|
|
339
344
|
/**
|
|
345
|
+
* Update account
|
|
346
|
+
* Updates account metadata (path cannot be changed)
|
|
340
347
|
* @param data The data for the request.
|
|
341
|
-
* @param data.id
|
|
348
|
+
* @param data.id Account UUID
|
|
342
349
|
* @param data.region Region code for tenant context
|
|
343
350
|
* @param data.requestBody
|
|
344
|
-
* @returns
|
|
351
|
+
* @returns AccountResponseDto Account updated successfully
|
|
345
352
|
* @throws ApiError
|
|
346
353
|
*/
|
|
347
354
|
public static accountControllerUpdate(
|
|
@@ -355,15 +362,20 @@ export class BeanAccountsService {
|
|
|
355
362
|
region: data.region
|
|
356
363
|
},
|
|
357
364
|
body: data.requestBody,
|
|
358
|
-
mediaType: 'application/json'
|
|
365
|
+
mediaType: 'application/json',
|
|
366
|
+
errors: {
|
|
367
|
+
404: 'Account not found'
|
|
368
|
+
}
|
|
359
369
|
});
|
|
360
370
|
}
|
|
361
371
|
|
|
362
372
|
/**
|
|
373
|
+
* Delete account
|
|
374
|
+
* Deletes an account (only if no transactions)
|
|
363
375
|
* @param data The data for the request.
|
|
364
|
-
* @param data.id
|
|
376
|
+
* @param data.id Account UUID
|
|
365
377
|
* @param data.region Region code for tenant context
|
|
366
|
-
* @returns
|
|
378
|
+
* @returns void Account deleted successfully
|
|
367
379
|
* @throws ApiError
|
|
368
380
|
*/
|
|
369
381
|
public static accountControllerDelete(
|
|
@@ -375,16 +387,22 @@ export class BeanAccountsService {
|
|
|
375
387
|
path: {
|
|
376
388
|
id: data.id,
|
|
377
389
|
region: data.region
|
|
390
|
+
},
|
|
391
|
+
errors: {
|
|
392
|
+
404: 'Account not found',
|
|
393
|
+
409: 'Account has transactions and cannot be deleted'
|
|
378
394
|
}
|
|
379
395
|
});
|
|
380
396
|
}
|
|
381
397
|
|
|
382
398
|
/**
|
|
399
|
+
* Close account
|
|
400
|
+
* Closes an account (Beancount Close directive)
|
|
383
401
|
* @param data The data for the request.
|
|
384
|
-
* @param data.id
|
|
402
|
+
* @param data.id Account UUID
|
|
385
403
|
* @param data.region Region code for tenant context
|
|
386
404
|
* @param data.requestBody
|
|
387
|
-
* @returns
|
|
405
|
+
* @returns AccountResponseDto Account closed successfully
|
|
388
406
|
* @throws ApiError
|
|
389
407
|
*/
|
|
390
408
|
public static accountControllerClose(
|
|
@@ -398,16 +416,22 @@ export class BeanAccountsService {
|
|
|
398
416
|
region: data.region
|
|
399
417
|
},
|
|
400
418
|
body: data.requestBody,
|
|
401
|
-
mediaType: 'application/json'
|
|
419
|
+
mediaType: 'application/json',
|
|
420
|
+
errors: {
|
|
421
|
+
400: 'Account is already closed',
|
|
422
|
+
404: 'Account not found'
|
|
423
|
+
}
|
|
402
424
|
});
|
|
403
425
|
}
|
|
404
426
|
|
|
405
427
|
/**
|
|
428
|
+
* Reopen account
|
|
429
|
+
* Reopens a previously closed account
|
|
406
430
|
* @param data The data for the request.
|
|
407
|
-
* @param data.id
|
|
431
|
+
* @param data.id Account UUID
|
|
408
432
|
* @param data.region Region code for tenant context
|
|
409
433
|
* @param data.requestBody
|
|
410
|
-
* @returns
|
|
434
|
+
* @returns AccountResponseDto Account reopened successfully
|
|
411
435
|
* @throws ApiError
|
|
412
436
|
*/
|
|
413
437
|
public static accountControllerReopen(
|
|
@@ -421,7 +445,11 @@ export class BeanAccountsService {
|
|
|
421
445
|
region: data.region
|
|
422
446
|
},
|
|
423
447
|
body: data.requestBody,
|
|
424
|
-
mediaType: 'application/json'
|
|
448
|
+
mediaType: 'application/json',
|
|
449
|
+
errors: {
|
|
450
|
+
400: 'Account is not closed',
|
|
451
|
+
404: 'Account not found'
|
|
452
|
+
}
|
|
425
453
|
});
|
|
426
454
|
}
|
|
427
455
|
}
|
|
@@ -2504,9 +2532,12 @@ export class BeanImportService {
|
|
|
2504
2532
|
}
|
|
2505
2533
|
|
|
2506
2534
|
/**
|
|
2535
|
+
* Import a Beancount file in community format
|
|
2536
|
+
* 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
2537
|
* @param data The data for the request.
|
|
2508
2538
|
* @param data.region Region code for tenant context
|
|
2509
|
-
* @
|
|
2539
|
+
* @param data.formData Beancount file to import
|
|
2540
|
+
* @returns unknown Beancount file imported successfully
|
|
2510
2541
|
* @throws ApiError
|
|
2511
2542
|
*/
|
|
2512
2543
|
public static fileImportControllerImportBeancount(
|
|
@@ -2517,6 +2548,11 @@ export class BeanImportService {
|
|
|
2517
2548
|
url: '/api/v1/{region}/bean/import/beancount',
|
|
2518
2549
|
path: {
|
|
2519
2550
|
region: data.region
|
|
2551
|
+
},
|
|
2552
|
+
formData: data.formData,
|
|
2553
|
+
mediaType: 'multipart/form-data',
|
|
2554
|
+
errors: {
|
|
2555
|
+
400: 'Bad request - invalid file or no file uploaded'
|
|
2520
2556
|
}
|
|
2521
2557
|
});
|
|
2522
2558
|
}
|
|
@@ -2719,11 +2755,33 @@ export class BeanPlatformsService {
|
|
|
2719
2755
|
|
|
2720
2756
|
export class ProviderSyncService {
|
|
2721
2757
|
/**
|
|
2758
|
+
* Sync transactions from financial data provider
|
|
2759
|
+
*
|
|
2760
|
+
* Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
|
|
2761
|
+
*
|
|
2762
|
+
* **Supported Providers:**
|
|
2763
|
+
* - **plaid**: Plaid API (US, Canada, Europe)
|
|
2764
|
+
* - **teller**: Teller API (US)
|
|
2765
|
+
* - **truelayer**: TrueLayer Open Banking (UK, Europe)
|
|
2766
|
+
* - **gocardless**: GoCardless Bank Account Data (Europe)
|
|
2767
|
+
* - **simplefin**: SimpleFIN (Self-hosted)
|
|
2768
|
+
* - **yodlee**: Yodlee (Global)
|
|
2769
|
+
* - **beancount-direct**: Beancount format transactions
|
|
2770
|
+
* - **parsed-bill**: Client-side parsed bill transactions
|
|
2771
|
+
*
|
|
2772
|
+
* **Processing Flow:**
|
|
2773
|
+
* 1. Transform raw data via provider adapter
|
|
2774
|
+
* 2. Validate transaction format
|
|
2775
|
+
* 3. Deduplicate using originalId
|
|
2776
|
+
* 4. Classify using rule engine
|
|
2777
|
+
* 5. Route low-confidence to Review Center
|
|
2778
|
+
* 6. Persist validated transactions
|
|
2779
|
+
*
|
|
2722
2780
|
* @param data The data for the request.
|
|
2723
|
-
* @param data.providerName
|
|
2781
|
+
* @param data.providerName Provider name
|
|
2724
2782
|
* @param data.region Region code for tenant context
|
|
2725
2783
|
* @param data.requestBody
|
|
2726
|
-
* @returns
|
|
2784
|
+
* @returns ProviderSyncResponseDto Sync completed successfully
|
|
2727
2785
|
* @throws ApiError
|
|
2728
2786
|
*/
|
|
2729
2787
|
public static providerSyncControllerSync(
|
|
@@ -2737,7 +2795,12 @@ export class ProviderSyncService {
|
|
|
2737
2795
|
region: data.region
|
|
2738
2796
|
},
|
|
2739
2797
|
body: data.requestBody,
|
|
2740
|
-
mediaType: 'application/json'
|
|
2798
|
+
mediaType: 'application/json',
|
|
2799
|
+
errors: {
|
|
2800
|
+
400: 'Invalid request data',
|
|
2801
|
+
401: 'Missing or invalid authentication',
|
|
2802
|
+
404: 'Provider not supported'
|
|
2803
|
+
}
|
|
2741
2804
|
});
|
|
2742
2805
|
}
|
|
2743
2806
|
|
|
@@ -2867,10 +2930,12 @@ export class ImportTelemetryService {
|
|
|
2867
2930
|
|
|
2868
2931
|
export class BeanNlpService {
|
|
2869
2932
|
/**
|
|
2933
|
+
* Process natural language input
|
|
2934
|
+
* 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
2935
|
* @param data The data for the request.
|
|
2871
2936
|
* @param data.region Region code for tenant context
|
|
2872
|
-
* @param data.requestBody
|
|
2873
|
-
* @returns
|
|
2937
|
+
* @param data.requestBody Natural language transaction input with optional session ID
|
|
2938
|
+
* @returns NlpResponseDto NLP processing result - either created transaction or asking for more info
|
|
2874
2939
|
* @throws ApiError
|
|
2875
2940
|
*/
|
|
2876
2941
|
public static nlpControllerProcessNaturalLanguage(
|
|
@@ -2883,7 +2948,11 @@ export class BeanNlpService {
|
|
|
2883
2948
|
region: data.region
|
|
2884
2949
|
},
|
|
2885
2950
|
body: data.requestBody,
|
|
2886
|
-
mediaType: 'application/json'
|
|
2951
|
+
mediaType: 'application/json',
|
|
2952
|
+
errors: {
|
|
2953
|
+
400: 'Invalid input',
|
|
2954
|
+
401: 'Unauthorized'
|
|
2955
|
+
}
|
|
2887
2956
|
});
|
|
2888
2957
|
}
|
|
2889
2958
|
|