@consilioweb/payload-support 0.9.12 → 0.9.13

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.cjs CHANGED
@@ -8471,6 +8471,7 @@ exports.createTicketsCollection = createTicketsCollection;
8471
8471
  exports.createTimeEntriesCollection = createTimeEntriesCollection;
8472
8472
  exports.createWebhookEndpointsCollection = createWebhookEndpointsCollection;
8473
8473
  exports.dispatchWebhook = dispatchWebhook;
8474
+ exports.generateTicketSynthesis = generateTicketSynthesis;
8474
8475
  exports.readSupportSettings = readSupportSettings;
8475
8476
  exports.readUserPrefs = readUserPrefs;
8476
8477
  exports.resolveSlugs = resolveSlugs;
package/dist/index.d.cts CHANGED
@@ -309,6 +309,23 @@ type WebhookEvent = 'ticket_created' | 'ticket_resolved' | 'ticket_replied' | 's
309
309
  */
310
310
  declare function dispatchWebhook(data: Record<string, unknown>, event: WebhookEvent, payload: BasePayload, slugs: CollectionSlugs): void;
311
311
 
312
+ interface TicketSynthesisResult {
313
+ summary: string;
314
+ generatedAt: string;
315
+ status: 'done' | 'error' | 'skipped';
316
+ reason?: string;
317
+ }
318
+ /**
319
+ * Generates a billing-oriented bullet-point synthesis for a single support ticket.
320
+ * Persists the result on the ticket (aiSummary, aiSummaryGeneratedAt, aiSummaryStatus).
321
+ * Designed to be called from an HTTP endpoint OR from a Payload hook (async fire-and-forget).
322
+ */
323
+ declare function generateTicketSynthesis(args: {
324
+ payload: Payload;
325
+ slugs: CollectionSlugs;
326
+ ticketId: number | string;
327
+ }): Promise<TicketSynthesisResult>;
328
+
312
329
  /**
313
330
  * Calculate a business-hours deadline from a start date.
314
331
  * Business hours: Mon-Fri, 9:00-18:00 (Europe/Paris).
@@ -381,4 +398,4 @@ declare function createMacrosCollection(slugs: CollectionSlugs): CollectionConfi
381
398
 
382
399
  declare function createTicketStatusesCollection(slugs: CollectionSlugs): CollectionConfig;
383
400
 
384
- export { type AIProviderConfig, type ActivityEntryData, type CannedResponseData, type ClientData, type CollectionSlugs, DEFAULT_FEATURES, DEFAULT_SETTINGS, DEFAULT_SLUGS, DEFAULT_USER_PREFS, type EmailConfig, type MessageData, type SatisfactionSurveyData, type SupportFeatures, type SupportPluginConfig, type SupportSettings, type TicketData, type TimeEntryData, type UserPrefs, calculateBusinessHoursDeadline, createAdminNotification, createAssignSlaDeadlines, createAuthLogsCollection, createCannedResponsesCollection, createChatMessagesCollection, createCheckSlaOnReply, createCheckSlaOnResolve, createEmailLogsCollection, createKnowledgeBaseCollection, createMacrosCollection, createPendingEmailsCollection, createSatisfactionSurveysCollection, createSlaPoliciesCollection, createSupportClientsCollection, createTicketActivityLogCollection, createTicketMessagesCollection, createTicketStatusEmail, createTicketStatusesCollection, createTicketsCollection, createTimeEntriesCollection, createWebhookEndpointsCollection, dispatchWebhook, readSupportSettings, readUserPrefs, resolveSlugs, supportPlugin };
401
+ export { type AIProviderConfig, type ActivityEntryData, type CannedResponseData, type ClientData, type CollectionSlugs, DEFAULT_FEATURES, DEFAULT_SETTINGS, DEFAULT_SLUGS, DEFAULT_USER_PREFS, type EmailConfig, type MessageData, type SatisfactionSurveyData, type SupportFeatures, type SupportPluginConfig, type SupportSettings, type TicketData, type TicketSynthesisResult, type TimeEntryData, type UserPrefs, calculateBusinessHoursDeadline, createAdminNotification, createAssignSlaDeadlines, createAuthLogsCollection, createCannedResponsesCollection, createChatMessagesCollection, createCheckSlaOnReply, createCheckSlaOnResolve, createEmailLogsCollection, createKnowledgeBaseCollection, createMacrosCollection, createPendingEmailsCollection, createSatisfactionSurveysCollection, createSlaPoliciesCollection, createSupportClientsCollection, createTicketActivityLogCollection, createTicketMessagesCollection, createTicketStatusEmail, createTicketStatusesCollection, createTicketsCollection, createTimeEntriesCollection, createWebhookEndpointsCollection, dispatchWebhook, generateTicketSynthesis, readSupportSettings, readUserPrefs, resolveSlugs, supportPlugin };
package/dist/index.d.ts CHANGED
@@ -309,6 +309,23 @@ type WebhookEvent = 'ticket_created' | 'ticket_resolved' | 'ticket_replied' | 's
309
309
  */
310
310
  declare function dispatchWebhook(data: Record<string, unknown>, event: WebhookEvent, payload: BasePayload, slugs: CollectionSlugs): void;
311
311
 
312
+ interface TicketSynthesisResult {
313
+ summary: string;
314
+ generatedAt: string;
315
+ status: 'done' | 'error' | 'skipped';
316
+ reason?: string;
317
+ }
318
+ /**
319
+ * Generates a billing-oriented bullet-point synthesis for a single support ticket.
320
+ * Persists the result on the ticket (aiSummary, aiSummaryGeneratedAt, aiSummaryStatus).
321
+ * Designed to be called from an HTTP endpoint OR from a Payload hook (async fire-and-forget).
322
+ */
323
+ declare function generateTicketSynthesis(args: {
324
+ payload: Payload;
325
+ slugs: CollectionSlugs;
326
+ ticketId: number | string;
327
+ }): Promise<TicketSynthesisResult>;
328
+
312
329
  /**
313
330
  * Calculate a business-hours deadline from a start date.
314
331
  * Business hours: Mon-Fri, 9:00-18:00 (Europe/Paris).
@@ -381,4 +398,4 @@ declare function createMacrosCollection(slugs: CollectionSlugs): CollectionConfi
381
398
 
382
399
  declare function createTicketStatusesCollection(slugs: CollectionSlugs): CollectionConfig;
383
400
 
384
- export { type AIProviderConfig, type ActivityEntryData, type CannedResponseData, type ClientData, type CollectionSlugs, DEFAULT_FEATURES, DEFAULT_SETTINGS, DEFAULT_SLUGS, DEFAULT_USER_PREFS, type EmailConfig, type MessageData, type SatisfactionSurveyData, type SupportFeatures, type SupportPluginConfig, type SupportSettings, type TicketData, type TimeEntryData, type UserPrefs, calculateBusinessHoursDeadline, createAdminNotification, createAssignSlaDeadlines, createAuthLogsCollection, createCannedResponsesCollection, createChatMessagesCollection, createCheckSlaOnReply, createCheckSlaOnResolve, createEmailLogsCollection, createKnowledgeBaseCollection, createMacrosCollection, createPendingEmailsCollection, createSatisfactionSurveysCollection, createSlaPoliciesCollection, createSupportClientsCollection, createTicketActivityLogCollection, createTicketMessagesCollection, createTicketStatusEmail, createTicketStatusesCollection, createTicketsCollection, createTimeEntriesCollection, createWebhookEndpointsCollection, dispatchWebhook, readSupportSettings, readUserPrefs, resolveSlugs, supportPlugin };
401
+ export { type AIProviderConfig, type ActivityEntryData, type CannedResponseData, type ClientData, type CollectionSlugs, DEFAULT_FEATURES, DEFAULT_SETTINGS, DEFAULT_SLUGS, DEFAULT_USER_PREFS, type EmailConfig, type MessageData, type SatisfactionSurveyData, type SupportFeatures, type SupportPluginConfig, type SupportSettings, type TicketData, type TicketSynthesisResult, type TimeEntryData, type UserPrefs, calculateBusinessHoursDeadline, createAdminNotification, createAssignSlaDeadlines, createAuthLogsCollection, createCannedResponsesCollection, createChatMessagesCollection, createCheckSlaOnReply, createCheckSlaOnResolve, createEmailLogsCollection, createKnowledgeBaseCollection, createMacrosCollection, createPendingEmailsCollection, createSatisfactionSurveysCollection, createSlaPoliciesCollection, createSupportClientsCollection, createTicketActivityLogCollection, createTicketMessagesCollection, createTicketStatusEmail, createTicketStatusesCollection, createTicketsCollection, createTimeEntriesCollection, createWebhookEndpointsCollection, dispatchWebhook, generateTicketSynthesis, readSupportSettings, readUserPrefs, resolveSlugs, supportPlugin };
package/dist/index.js CHANGED
@@ -8438,4 +8438,4 @@ function supportPlugin(config) {
8438
8438
  };
8439
8439
  }
8440
8440
 
8441
- export { DEFAULT_FEATURES, DEFAULT_SETTINGS, DEFAULT_SLUGS, DEFAULT_USER_PREFS, calculateBusinessHoursDeadline, createAdminNotification, createAssignSlaDeadlines, createAuthLogsCollection, createCannedResponsesCollection, createChatMessagesCollection, createCheckSlaOnReply, createCheckSlaOnResolve, createEmailLogsCollection, createKnowledgeBaseCollection, createMacrosCollection, createPendingEmailsCollection, createSatisfactionSurveysCollection, createSlaPoliciesCollection, createSupportClientsCollection, createTicketActivityLogCollection, createTicketMessagesCollection, createTicketStatusEmail, createTicketStatusesCollection, createTicketsCollection, createTimeEntriesCollection, createWebhookEndpointsCollection, dispatchWebhook, readSupportSettings, readUserPrefs, resolveSlugs, supportPlugin };
8441
+ export { DEFAULT_FEATURES, DEFAULT_SETTINGS, DEFAULT_SLUGS, DEFAULT_USER_PREFS, calculateBusinessHoursDeadline, createAdminNotification, createAssignSlaDeadlines, createAuthLogsCollection, createCannedResponsesCollection, createChatMessagesCollection, createCheckSlaOnReply, createCheckSlaOnResolve, createEmailLogsCollection, createKnowledgeBaseCollection, createMacrosCollection, createPendingEmailsCollection, createSatisfactionSurveysCollection, createSlaPoliciesCollection, createSupportClientsCollection, createTicketActivityLogCollection, createTicketMessagesCollection, createTicketStatusEmail, createTicketStatusesCollection, createTicketsCollection, createTimeEntriesCollection, createWebhookEndpointsCollection, dispatchWebhook, generateTicketSynthesis, readSupportSettings, readUserPrefs, resolveSlugs, supportPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consilioweb/payload-support",
3
- "version": "0.9.12",
3
+ "version": "0.9.13",
4
4
  "description": "Payload CMS plugin — professional support & ticketing system with AI, SLA, time tracking, live chat, and more",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
package/src/index.ts CHANGED
@@ -25,6 +25,8 @@ export { readSupportSettings, readUserPrefs, DEFAULT_SETTINGS, DEFAULT_USER_PREF
25
25
  export type { SupportSettings, UserPrefs } from './utils/readSettings'
26
26
  export { createAdminNotification } from './utils/adminNotification'
27
27
  export { dispatchWebhook } from './utils/webhookDispatcher'
28
+ export { generateTicketSynthesis } from './utils/generateTicketSynthesis'
29
+ export type { TicketSynthesisResult } from './utils/generateTicketSynthesis'
28
30
 
29
31
  // Hooks
30
32
  export { createAssignSlaDeadlines, createCheckSlaOnResolve, createCheckSlaOnReply, calculateBusinessHoursDeadline } from './hooks/checkSLA'