@egdesk/next-api-plugin 1.3.1 → 1.3.2
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/generate-helpers.js +44 -3
- package/package.json +1 -1
- package/src/generate-helpers.ts +44 -3
package/dist/generate-helpers.js
CHANGED
|
@@ -50,7 +50,7 @@ function generateHelpers(projectPath) {
|
|
|
50
50
|
const helperContent = `/**
|
|
51
51
|
* EGDesk Helper Functions for Next.js
|
|
52
52
|
*
|
|
53
|
-
* Type-safe helpers for EGDesk user data, FinanceHub, and browser recorder replay.
|
|
53
|
+
* Type-safe helpers for EGDesk user data, FinanceHub (banks, cards, Hometax), and browser recorder replay.
|
|
54
54
|
* Works in both client and server components.
|
|
55
55
|
*
|
|
56
56
|
* Generated by @egdesk/next-api-plugin
|
|
@@ -325,7 +325,7 @@ export async function callFinanceHubTool(
|
|
|
325
325
|
toolName: string,
|
|
326
326
|
args: Record<string, any> = {}
|
|
327
327
|
): Promise<any> {
|
|
328
|
-
const body = JSON.stringify({ tool: toolName, args });
|
|
328
|
+
const body = JSON.stringify({ tool: toolName, arguments: args });
|
|
329
329
|
const headers: Record<string, string> = {
|
|
330
330
|
'Content-Type': 'application/json'
|
|
331
331
|
};
|
|
@@ -450,12 +450,53 @@ export async function getOverallStats() {
|
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
/**
|
|
453
|
-
* Get sync operation history
|
|
453
|
+
* Get bank/card sync operation history (sync_operations table)
|
|
454
454
|
*/
|
|
455
455
|
export async function getSyncHistory(limit: number = 50) {
|
|
456
456
|
return callFinanceHubTool('financehub_get_sync_history', { limit });
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
+
/**
|
|
460
|
+
* List Hometax business connections (hometax_connections: counts, spreadsheet URLs, status)
|
|
461
|
+
*/
|
|
462
|
+
export async function listHometaxConnections() {
|
|
463
|
+
return callFinanceHubTool('financehub_list_hometax_connections', {});
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Query electronic tax invoices synced from Hometax (tax_invoices table)
|
|
468
|
+
*/
|
|
469
|
+
export async function queryTaxInvoices(options: {
|
|
470
|
+
businessNumber?: string;
|
|
471
|
+
invoiceType?: 'sales' | 'purchase';
|
|
472
|
+
startDate?: string;
|
|
473
|
+
endDate?: string;
|
|
474
|
+
limit?: number;
|
|
475
|
+
offset?: number;
|
|
476
|
+
} = {}) {
|
|
477
|
+
return callFinanceHubTool('financehub_query_tax_invoices', options);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Query cash receipts synced from Hometax (cash_receipts table)
|
|
482
|
+
*/
|
|
483
|
+
export async function queryCashReceipts(options: {
|
|
484
|
+
businessNumber?: string;
|
|
485
|
+
startDate?: string;
|
|
486
|
+
endDate?: string;
|
|
487
|
+
limit?: number;
|
|
488
|
+
offset?: number;
|
|
489
|
+
} = {}) {
|
|
490
|
+
return callFinanceHubTool('financehub_query_cash_receipts', options);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Get Hometax Excel import sync history (hometax_sync_operations). Not the same as getSyncHistory (banks/cards).
|
|
495
|
+
*/
|
|
496
|
+
export async function getHometaxSyncHistory(limit: number = 50) {
|
|
497
|
+
return callFinanceHubTool('financehub_get_hometax_sync_history', { limit });
|
|
498
|
+
}
|
|
499
|
+
|
|
459
500
|
// ==========================================
|
|
460
501
|
// BROWSER RECORDING HELPERS
|
|
461
502
|
// ==========================================
|
package/package.json
CHANGED
package/src/generate-helpers.ts
CHANGED
|
@@ -17,7 +17,7 @@ export function generateHelpers(projectPath: string): void {
|
|
|
17
17
|
const helperContent = `/**
|
|
18
18
|
* EGDesk Helper Functions for Next.js
|
|
19
19
|
*
|
|
20
|
-
* Type-safe helpers for EGDesk user data, FinanceHub, and browser recorder replay.
|
|
20
|
+
* Type-safe helpers for EGDesk user data, FinanceHub (banks, cards, Hometax), and browser recorder replay.
|
|
21
21
|
* Works in both client and server components.
|
|
22
22
|
*
|
|
23
23
|
* Generated by @egdesk/next-api-plugin
|
|
@@ -292,7 +292,7 @@ export async function callFinanceHubTool(
|
|
|
292
292
|
toolName: string,
|
|
293
293
|
args: Record<string, any> = {}
|
|
294
294
|
): Promise<any> {
|
|
295
|
-
const body = JSON.stringify({ tool: toolName, args });
|
|
295
|
+
const body = JSON.stringify({ tool: toolName, arguments: args });
|
|
296
296
|
const headers: Record<string, string> = {
|
|
297
297
|
'Content-Type': 'application/json'
|
|
298
298
|
};
|
|
@@ -417,12 +417,53 @@ export async function getOverallStats() {
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
/**
|
|
420
|
-
* Get sync operation history
|
|
420
|
+
* Get bank/card sync operation history (sync_operations table)
|
|
421
421
|
*/
|
|
422
422
|
export async function getSyncHistory(limit: number = 50) {
|
|
423
423
|
return callFinanceHubTool('financehub_get_sync_history', { limit });
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
+
/**
|
|
427
|
+
* List Hometax business connections (hometax_connections: counts, spreadsheet URLs, status)
|
|
428
|
+
*/
|
|
429
|
+
export async function listHometaxConnections() {
|
|
430
|
+
return callFinanceHubTool('financehub_list_hometax_connections', {});
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Query electronic tax invoices synced from Hometax (tax_invoices table)
|
|
435
|
+
*/
|
|
436
|
+
export async function queryTaxInvoices(options: {
|
|
437
|
+
businessNumber?: string;
|
|
438
|
+
invoiceType?: 'sales' | 'purchase';
|
|
439
|
+
startDate?: string;
|
|
440
|
+
endDate?: string;
|
|
441
|
+
limit?: number;
|
|
442
|
+
offset?: number;
|
|
443
|
+
} = {}) {
|
|
444
|
+
return callFinanceHubTool('financehub_query_tax_invoices', options);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Query cash receipts synced from Hometax (cash_receipts table)
|
|
449
|
+
*/
|
|
450
|
+
export async function queryCashReceipts(options: {
|
|
451
|
+
businessNumber?: string;
|
|
452
|
+
startDate?: string;
|
|
453
|
+
endDate?: string;
|
|
454
|
+
limit?: number;
|
|
455
|
+
offset?: number;
|
|
456
|
+
} = {}) {
|
|
457
|
+
return callFinanceHubTool('financehub_query_cash_receipts', options);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Get Hometax Excel import sync history (hometax_sync_operations). Not the same as getSyncHistory (banks/cards).
|
|
462
|
+
*/
|
|
463
|
+
export async function getHometaxSyncHistory(limit: number = 50) {
|
|
464
|
+
return callFinanceHubTool('financehub_get_hometax_sync_history', { limit });
|
|
465
|
+
}
|
|
466
|
+
|
|
426
467
|
// ==========================================
|
|
427
468
|
// BROWSER RECORDING HELPERS
|
|
428
469
|
// ==========================================
|