@xuda.io/ai_module 1.1.4636 → 1.1.4638

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.
Files changed (2) hide show
  1. package/index.mjs +99 -10
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -7165,11 +7165,19 @@ export const get_name_from_email_addr = async function (uid, email, account_prof
7165
7165
  export const categorize_email_subject = async function (uid, subject, account_profile_info) {
7166
7166
  // Define comprehensive email categories
7167
7167
  const email_categories = [
7168
+ // Communication & Collaboration (1-10)
7168
7169
  'Meeting Invitations',
7169
7170
  'Meeting Updates / Cancellations',
7170
7171
  'Team Announcements',
7171
7172
  'One-on-One Requests',
7172
7173
  'Project Collaboration',
7174
+ 'Brainstorming Session',
7175
+ 'Workshop / Training Session',
7176
+ 'Conference Invitation',
7177
+ 'Stand-up Meeting',
7178
+ 'Board Meeting',
7179
+
7180
+ // Work & Business (11-25)
7173
7181
  'Job Applications',
7174
7182
  'Interview Scheduling',
7175
7183
  'Contract / Agreement',
@@ -7180,42 +7188,125 @@ export const categorize_email_subject = async function (uid, subject, account_pr
7180
7188
  'Partnership Opportunity',
7181
7189
  'Report / Analysis',
7182
7190
  'Performance Review',
7191
+ 'Recruitment / Hiring',
7192
+ 'Employee Onboarding',
7193
+ 'Company Policy Update',
7194
+ 'Business Development',
7195
+ 'Vendor Communication',
7196
+
7197
+ // Finance & Transactions (26-40)
7183
7198
  'Payment Received',
7184
7199
  'Payment Request / Reminder',
7185
7200
  'Subscription Renewal',
7186
7201
  'Order Confirmation',
7187
7202
  'Shipping Notification',
7188
7203
  'Refund / Return',
7204
+ 'Purchase Order',
7205
+ 'Expense Report',
7206
+ 'Tax Documentation',
7207
+ 'Financial Statement',
7208
+ 'Credit Card Statement',
7209
+ 'Bank Transaction Alert',
7210
+ 'Investment Update',
7211
+ 'Donation / Fundraising',
7212
+ 'Receipt / Proof of Payment',
7213
+
7214
+ // Account & Security (41-55)
7189
7215
  'Account Verification',
7190
7216
  'Password Reset',
7191
7217
  'Security Alert',
7192
7218
  'Privacy Policy Update',
7193
7219
  'Terms of Service Change',
7220
+ 'Two-Factor Authentication',
7221
+ 'Account Suspension',
7222
+ 'Data Breach Notification',
7223
+ 'Compliance Update',
7224
+ 'Access Request',
7225
+ 'Permission Grant/Revoke',
7226
+ 'Device Login Alert',
7227
+ 'Account Activity Summary',
7228
+ 'Profile Update Confirmation',
7229
+ 'Email Change Verification',
7230
+
7231
+ // Social & Networking (56-70)
7194
7232
  'Event Invitation (Social)',
7195
7233
  'Connection Request',
7196
7234
  'Newsletter',
7197
7235
  'Blog / Content Update',
7198
7236
  'Survey / Feedback Request',
7237
+ 'Social Media Notification',
7238
+ 'Networking Event',
7239
+ 'Community Update',
7240
+ 'Member Announcement',
7241
+ 'Forum / Discussion Update',
7242
+ 'Testimonial Request',
7243
+ 'Referral Program',
7244
+ 'Award / Recognition',
7245
+ 'Birthday / Anniversary',
7246
+ 'Holiday Greeting',
7247
+
7248
+ // System & Technology (71-80)
7199
7249
  'System Maintenance',
7200
7250
  'Software Update',
7201
7251
  'Service Outage',
7202
7252
  'New Feature Announcement',
7253
+ 'API Update',
7254
+ 'Integration Notification',
7255
+ 'Backup Completion',
7256
+ 'Storage Limit Alert',
7257
+ 'Downtime Notification',
7258
+ 'Migration Update',
7259
+
7260
+ // Education & Learning (81-90)
7203
7261
  'Course Enrollment',
7204
7262
  'Webinar Invitation',
7205
7263
  'Certification / Training',
7206
7264
  'Research / Study Invitation',
7265
+ 'Homework / Assignment',
7266
+ 'Grade / Score Notification',
7267
+ 'Scholarship Opportunity',
7268
+ 'Academic Conference',
7269
+ 'Library Notification',
7270
+ 'Alumni Update',
7271
+
7272
+ // Health & Wellness (91-95)
7207
7273
  'Appointment Reminder',
7208
7274
  'Health Tips / Newsletter',
7209
7275
  'Prescription Ready',
7276
+ 'Lab Results',
7277
+ 'Insurance Update',
7278
+
7279
+ // Travel & Leisure (96-100)
7210
7280
  'Travel Booking Confirmation',
7211
7281
  'Flight / Hotel Updates',
7212
7282
  'Event Tickets',
7283
+ 'Restaurant Reservation',
7284
+ 'Activity Booking',
7285
+
7286
+ // General & Administrative (101-110)
7213
7287
  'Notification / Alert',
7214
7288
  'Confirmation (General)',
7215
7289
  'Welcome / Onboarding',
7216
7290
  'Follow-up / Reminder',
7217
- 'Miscellaneous / Unclassified'
7218
- ] as const;
7291
+ 'Miscellaneous / Unclassified',
7292
+ 'Forwarded Message',
7293
+ 'Auto-Reply / Out of Office',
7294
+ 'Spam / Junk',
7295
+ 'Support Ticket Update',
7296
+ 'Document Sharing',
7297
+
7298
+ // Additional specialized categories (111-120)
7299
+ 'Legal Notice',
7300
+ 'Government / Official',
7301
+ 'Real Estate Update',
7302
+ 'Automotive Service',
7303
+ 'Home Services',
7304
+ 'Gaming / Entertainment',
7305
+ 'Fitness / Wellness',
7306
+ 'Parenting / Family',
7307
+ 'Pet Care',
7308
+ 'Food Delivery Update',
7309
+ ];
7219
7310
 
7220
7311
  // Create a more detailed prompt with context
7221
7312
  const prompt = `Categorize the email subject into one of these exact categories:
@@ -7246,14 +7337,12 @@ Category:`;
7246
7337
 
7247
7338
  if (email_category_ret && email_category_ret.code > -1) {
7248
7339
  // Parse the response data
7249
- const data = typeof email_category_ret.data === 'string'
7250
- ? JSON.parse(email_category_ret.data)
7251
- : email_category_ret.data; // Fixed variable name (was business_info_ret.data)
7252
-
7340
+ const data = typeof email_category_ret.data === 'string' ? JSON.parse(email_category_ret.data) : email_category_ret.data; // Fixed variable name (was business_info_ret.data)
7341
+
7253
7342
  return {
7254
7343
  success: true,
7255
7344
  category: data.email_category,
7256
- subject: subject
7345
+ subject: subject,
7257
7346
  };
7258
7347
  } else {
7259
7348
  console.warn('Failed to categorize email subject:', email_category_ret?.message);
@@ -7261,7 +7350,7 @@ Category:`;
7261
7350
  success: false,
7262
7351
  category: 'Miscellaneous / Unclassified',
7263
7352
  subject: subject,
7264
- error: email_category_ret?.message || 'Unknown error'
7353
+ error: email_category_ret?.message || 'Unknown error',
7265
7354
  };
7266
7355
  }
7267
7356
  } catch (error) {
@@ -7270,7 +7359,7 @@ Category:`;
7270
7359
  success: false,
7271
7360
  category: 'Miscellaneous / Unclassified',
7272
7361
  subject: subject,
7273
- error: error.message
7362
+ error: error.message,
7274
7363
  };
7275
7364
  }
7276
- };
7365
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4636",
3
+ "version": "1.1.4638",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",