@egdesk/next-api-plugin 1.5.0 → 1.5.1

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.
@@ -549,6 +549,7 @@ export async function queryBankProductTable(options: {
549
549
  orderBy?: { column: string; direction?: 'ASC' | 'DESC' };
550
550
  limit?: number;
551
551
  offset?: number;
552
+ latestOnly?: boolean;
552
553
  }) {
553
554
  return callFinanceHubTool('financehub_query_bank_product_table', options);
554
555
  }
@@ -1063,6 +1064,16 @@ export async function createTag(data: {
1063
1064
  export async function deleteTag(id: string) {
1064
1065
  return callAICenterTool('ai_center_delete_tag', { id });
1065
1066
  }
1067
+
1068
+ /** List all company-wide shared business deadlines from the company calendar (company_calendar table). */
1069
+ export async function getCalendarEventsFromAICenter() {
1070
+ return callAICenterTool('ai_center_get_calendar_events', {});
1071
+ }
1072
+
1073
+ /** Update the status of an operational task. */
1074
+ export async function completeTask(taskId: string, status: 'completed' | 'approved' | 'rejected') {
1075
+ return callAICenterTool('ai_center_complete_task', { taskId, status });
1076
+ }
1066
1077
  `;
1067
1078
  fs.writeFileSync(helperPath, helperContent.replace(/\r?\n/g, os.EOL), 'utf-8');
1068
1079
  console.log(`✅ Generated ${helperPath}`);
@@ -66,7 +66,7 @@ async function discoverTables(egdeskUrl = 'http://localhost:8080', apiKey) {
66
66
  arguments: {}
67
67
  })
68
68
  });
69
- const listResult = await listResponse.json().catch(() => null);
69
+ const listResult = (await listResponse.json().catch(() => null));
70
70
  if (listResult && typeof listResult === 'object' && listResult.success === false) {
71
71
  throw new Error(listResult.error || 'Failed to list tables');
72
72
  }
@@ -100,7 +100,7 @@ async function discoverTables(egdeskUrl = 'http://localhost:8080', apiKey) {
100
100
  })
101
101
  });
102
102
  if (schemaResponse.ok) {
103
- const schemaResult = await schemaResponse.json();
103
+ const schemaResult = (await schemaResponse.json());
104
104
  const schemaContent = schemaResult.result?.content?.[0]?.text;
105
105
  const schemaData = schemaContent ? JSON.parse(schemaContent) : null;
106
106
  tablesWithColumns.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egdesk/next-api-plugin",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Next.js plugin for EGDesk database proxy integration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -516,6 +516,7 @@ export async function queryBankProductTable(options: {
516
516
  orderBy?: { column: string; direction?: 'ASC' | 'DESC' };
517
517
  limit?: number;
518
518
  offset?: number;
519
+ latestOnly?: boolean;
519
520
  }) {
520
521
  return callFinanceHubTool('financehub_query_bank_product_table', options);
521
522
  }
@@ -1030,6 +1031,16 @@ export async function createTag(data: {
1030
1031
  export async function deleteTag(id: string) {
1031
1032
  return callAICenterTool('ai_center_delete_tag', { id });
1032
1033
  }
1034
+
1035
+ /** List all company-wide shared business deadlines from the company calendar (company_calendar table). */
1036
+ export async function getCalendarEventsFromAICenter() {
1037
+ return callAICenterTool('ai_center_get_calendar_events', {});
1038
+ }
1039
+
1040
+ /** Update the status of an operational task. */
1041
+ export async function completeTask(taskId: string, status: 'completed' | 'approved' | 'rejected') {
1042
+ return callAICenterTool('ai_center_complete_task', { taskId, status });
1043
+ }
1033
1044
  `;
1034
1045
 
1035
1046
  fs.writeFileSync(helperPath, helperContent.replace(/\r?\n/g, os.EOL), 'utf-8');
@@ -53,7 +53,7 @@ export async function discoverTables(
53
53
  })
54
54
  });
55
55
 
56
- const listResult = await listResponse.json().catch(() => null);
56
+ const listResult = (await listResponse.json().catch(() => null)) as any;
57
57
 
58
58
  if (listResult && typeof listResult === 'object' && listResult.success === false) {
59
59
  throw new Error(listResult.error || 'Failed to list tables');
@@ -98,7 +98,7 @@ export async function discoverTables(
98
98
  });
99
99
 
100
100
  if (schemaResponse.ok) {
101
- const schemaResult = await schemaResponse.json();
101
+ const schemaResult = (await schemaResponse.json()) as any;
102
102
  const schemaContent = schemaResult.result?.content?.[0]?.text;
103
103
  const schemaData = schemaContent ? JSON.parse(schemaContent) : null;
104
104