digital-tools 2.1.1 → 2.3.0

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 (293) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +2 -0
  3. package/dist/client.d.ts +109 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +69 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/define.d.ts +2 -2
  8. package/dist/define.d.ts.map +1 -1
  9. package/dist/define.js +22 -20
  10. package/dist/define.js.map +1 -1
  11. package/dist/function-ref.d.ts +229 -0
  12. package/dist/function-ref.d.ts.map +1 -0
  13. package/dist/function-ref.js +28 -0
  14. package/dist/function-ref.js.map +1 -0
  15. package/dist/function-sugar.d.ts +57 -0
  16. package/dist/function-sugar.d.ts.map +1 -0
  17. package/dist/function-sugar.js +79 -0
  18. package/dist/function-sugar.js.map +1 -0
  19. package/dist/index.d.ts +10 -3
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +24 -4
  22. package/dist/index.js.map +1 -1
  23. package/dist/providers/analytics/mixpanel.d.ts.map +1 -1
  24. package/dist/providers/analytics/mixpanel.js +21 -18
  25. package/dist/providers/analytics/mixpanel.js.map +1 -1
  26. package/dist/providers/calendar/cal-com.d.ts.map +1 -1
  27. package/dist/providers/calendar/cal-com.js +10 -10
  28. package/dist/providers/calendar/cal-com.js.map +1 -1
  29. package/dist/providers/calendar/google-calendar.d.ts.map +1 -1
  30. package/dist/providers/calendar/google-calendar.js +4 -4
  31. package/dist/providers/calendar/google-calendar.js.map +1 -1
  32. package/dist/providers/crm/hubspot.d.ts.map +1 -1
  33. package/dist/providers/crm/hubspot.js +107 -85
  34. package/dist/providers/crm/hubspot.js.map +1 -1
  35. package/dist/providers/development/github.d.ts.map +1 -1
  36. package/dist/providers/development/github.js +40 -43
  37. package/dist/providers/development/github.js.map +1 -1
  38. package/dist/providers/ecommerce/shopify.d.ts.map +1 -1
  39. package/dist/providers/ecommerce/shopify.js +79 -62
  40. package/dist/providers/ecommerce/shopify.js.map +1 -1
  41. package/dist/providers/email/resend.d.ts.map +1 -1
  42. package/dist/providers/email/resend.js +20 -16
  43. package/dist/providers/email/resend.js.map +1 -1
  44. package/dist/providers/email/sendgrid.d.ts.map +1 -1
  45. package/dist/providers/email/sendgrid.js +12 -9
  46. package/dist/providers/email/sendgrid.js.map +1 -1
  47. package/dist/providers/finance/stripe.d.ts.map +1 -1
  48. package/dist/providers/finance/stripe.js +44 -42
  49. package/dist/providers/finance/stripe.js.map +1 -1
  50. package/dist/providers/forms/typeform.d.ts.map +1 -1
  51. package/dist/providers/forms/typeform.js +68 -58
  52. package/dist/providers/forms/typeform.js.map +1 -1
  53. package/dist/providers/knowledge/notion.d.ts.map +1 -1
  54. package/dist/providers/knowledge/notion.js +75 -41
  55. package/dist/providers/knowledge/notion.js.map +1 -1
  56. package/dist/providers/marketing/mailchimp.d.ts.map +1 -1
  57. package/dist/providers/marketing/mailchimp.js +74 -61
  58. package/dist/providers/marketing/mailchimp.js.map +1 -1
  59. package/dist/providers/media/cloudinary.d.ts.map +1 -1
  60. package/dist/providers/media/cloudinary.js +30 -28
  61. package/dist/providers/media/cloudinary.js.map +1 -1
  62. package/dist/providers/messaging/slack.d.ts.map +1 -1
  63. package/dist/providers/messaging/slack.js +75 -58
  64. package/dist/providers/messaging/slack.js.map +1 -1
  65. package/dist/providers/messaging/twilio-sms.d.ts.map +1 -1
  66. package/dist/providers/messaging/twilio-sms.js +33 -15
  67. package/dist/providers/messaging/twilio-sms.js.map +1 -1
  68. package/dist/providers/project-management/linear.d.ts.map +1 -1
  69. package/dist/providers/project-management/linear.js +31 -27
  70. package/dist/providers/project-management/linear.js.map +1 -1
  71. package/dist/providers/spreadsheet/google-sheets.d.ts.map +1 -1
  72. package/dist/providers/spreadsheet/google-sheets.js +21 -18
  73. package/dist/providers/spreadsheet/google-sheets.js.map +1 -1
  74. package/dist/providers/spreadsheet/xlsx.d.ts.map +1 -1
  75. package/dist/providers/spreadsheet/xlsx.js +4 -4
  76. package/dist/providers/spreadsheet/xlsx.js.map +1 -1
  77. package/dist/providers/storage/index.js +1 -0
  78. package/dist/providers/storage/index.js.map +1 -1
  79. package/dist/providers/storage/s3.d.ts.map +1 -1
  80. package/dist/providers/storage/s3.js +36 -27
  81. package/dist/providers/storage/s3.js.map +1 -1
  82. package/dist/providers/support/zendesk.d.ts.map +1 -1
  83. package/dist/providers/support/zendesk.js +24 -25
  84. package/dist/providers/support/zendesk.js.map +1 -1
  85. package/dist/providers/tasks/todoist.d.ts.map +1 -1
  86. package/dist/providers/tasks/todoist.js +18 -18
  87. package/dist/providers/tasks/todoist.js.map +1 -1
  88. package/dist/providers/video-conferencing/google-meet.d.ts.map +1 -1
  89. package/dist/providers/video-conferencing/google-meet.js +11 -11
  90. package/dist/providers/video-conferencing/google-meet.js.map +1 -1
  91. package/dist/providers/video-conferencing/jitsi.js +14 -14
  92. package/dist/providers/video-conferencing/jitsi.js.map +1 -1
  93. package/dist/providers/video-conferencing/teams.d.ts.map +1 -1
  94. package/dist/providers/video-conferencing/teams.js +9 -7
  95. package/dist/providers/video-conferencing/teams.js.map +1 -1
  96. package/dist/providers/video-conferencing/zoom.d.ts.map +1 -1
  97. package/dist/providers/video-conferencing/zoom.js +26 -24
  98. package/dist/providers/video-conferencing/zoom.js.map +1 -1
  99. package/dist/tools/data.d.ts.map +1 -1
  100. package/dist/tools/data.js +5 -12
  101. package/dist/tools/data.js.map +1 -1
  102. package/dist/tools/index.d.ts +1 -0
  103. package/dist/tools/index.d.ts.map +1 -1
  104. package/dist/tools/index.js +1 -0
  105. package/dist/tools/index.js.map +1 -1
  106. package/dist/tools/system.d.ts +289 -0
  107. package/dist/tools/system.d.ts.map +1 -0
  108. package/dist/tools/system.js +752 -0
  109. package/dist/tools/system.js.map +1 -0
  110. package/dist/tools/web.d.ts.map +1 -1
  111. package/dist/tools/web.js +22 -10
  112. package/dist/tools/web.js.map +1 -1
  113. package/dist/track-record.d.ts +101 -0
  114. package/dist/track-record.d.ts.map +1 -0
  115. package/dist/track-record.js +17 -0
  116. package/dist/track-record.js.map +1 -0
  117. package/dist/types.d.ts +210 -9
  118. package/dist/types.d.ts.map +1 -1
  119. package/dist/verb-registration.d.ts +122 -0
  120. package/dist/verb-registration.d.ts.map +1 -0
  121. package/dist/verb-registration.js +176 -0
  122. package/dist/verb-registration.js.map +1 -0
  123. package/dist/worker.d.ts +93 -0
  124. package/dist/worker.d.ts.map +1 -0
  125. package/dist/worker.js +315 -0
  126. package/dist/worker.js.map +1 -0
  127. package/dist/wrap.d.ts +89 -0
  128. package/dist/wrap.d.ts.map +1 -0
  129. package/dist/wrap.js +225 -0
  130. package/dist/wrap.js.map +1 -0
  131. package/package.json +21 -4
  132. package/src/client.ts +136 -0
  133. package/src/define.ts +31 -37
  134. package/src/function-ref.ts +264 -0
  135. package/src/function-sugar.ts +134 -0
  136. package/src/index.ts +132 -10
  137. package/src/providers/analytics/mixpanel.ts +19 -18
  138. package/src/providers/calendar/cal-com.ts +29 -18
  139. package/src/providers/calendar/google-calendar.ts +20 -14
  140. package/src/providers/crm/hubspot.ts +225 -99
  141. package/src/providers/development/github.ts +206 -135
  142. package/src/providers/ecommerce/shopify.ts +250 -89
  143. package/src/providers/email/resend.ts +101 -28
  144. package/src/providers/email/sendgrid.ts +12 -9
  145. package/src/providers/finance/stripe.ts +128 -49
  146. package/src/providers/forms/typeform.ts +74 -58
  147. package/src/providers/knowledge/notion.ts +340 -88
  148. package/src/providers/marketing/mailchimp.ts +86 -70
  149. package/src/providers/media/cloudinary.ts +99 -41
  150. package/src/providers/messaging/slack.ts +283 -85
  151. package/src/providers/messaging/twilio-sms.ts +35 -15
  152. package/src/providers/project-management/linear.ts +143 -55
  153. package/src/providers/spreadsheet/google-sheets.ts +222 -56
  154. package/src/providers/spreadsheet/xlsx.ts +47 -16
  155. package/src/providers/storage/s3.ts +119 -47
  156. package/src/providers/support/zendesk.ts +196 -46
  157. package/src/providers/tasks/todoist.ts +20 -26
  158. package/src/providers/video-conferencing/google-meet.ts +17 -20
  159. package/src/providers/video-conferencing/jitsi.ts +14 -14
  160. package/src/providers/video-conferencing/teams.ts +14 -13
  161. package/src/providers/video-conferencing/zoom.ts +54 -49
  162. package/src/tools/data.ts +6 -16
  163. package/src/tools/index.ts +1 -0
  164. package/src/tools/system.ts +887 -0
  165. package/src/tools/web.ts +22 -10
  166. package/src/track-record.ts +106 -0
  167. package/src/types.ts +241 -13
  168. package/src/verb-registration.ts +197 -0
  169. package/src/worker.ts +370 -0
  170. package/src/wrap.ts +260 -0
  171. package/test/client.test.ts +146 -0
  172. package/test/communication-tools-extended.test.ts +734 -0
  173. package/test/data-tools-extended.test.ts +743 -0
  174. package/test/define-extended.test.ts +819 -0
  175. package/test/define.test.ts +150 -41
  176. package/test/entities.test.ts +623 -0
  177. package/test/extended-entities.test.ts +1228 -0
  178. package/test/provider-implementations.test.ts +725 -0
  179. package/test/provider-registry-extended.test.ts +583 -0
  180. package/test/providers/google-sheets.test.ts +851 -0
  181. package/test/providers/helpers.ts +554 -0
  182. package/test/providers/hubspot.test.ts +576 -0
  183. package/test/providers/slack.test.ts +932 -0
  184. package/test/providers/stripe.test.ts +701 -0
  185. package/test/providers.test.ts +578 -0
  186. package/test/system-tools-extended.test.ts +632 -0
  187. package/test/system.test.ts +673 -0
  188. package/test/tools.test.ts +15 -11
  189. package/test/types.test.ts +402 -0
  190. package/test/verb-registration.test.ts +395 -0
  191. package/test/web-tools.test.ts +553 -0
  192. package/test/worker-extended.test.ts +699 -0
  193. package/test/worker.test.ts +576 -0
  194. package/test/wrap.test.ts +366 -0
  195. package/tsconfig.json +3 -13
  196. package/vitest.config.ts +37 -0
  197. package/wrangler.jsonc +9 -0
  198. package/.turbo/turbo-build.log +0 -5
  199. package/dist/providers/voice/vapi.d.ts +0 -27
  200. package/dist/providers/voice/vapi.d.ts.map +0 -1
  201. package/dist/providers/voice/vapi.js +0 -440
  202. package/dist/providers/voice/vapi.js.map +0 -1
  203. package/src/define.js +0 -267
  204. package/src/entities/advertising.js +0 -999
  205. package/src/entities/ai.js +0 -756
  206. package/src/entities/analytics.js +0 -1588
  207. package/src/entities/automation.js +0 -601
  208. package/src/entities/communication.js +0 -1150
  209. package/src/entities/crm.js +0 -1386
  210. package/src/entities/design.js +0 -546
  211. package/src/entities/development.js +0 -2212
  212. package/src/entities/document.js +0 -874
  213. package/src/entities/ecommerce.js +0 -1429
  214. package/src/entities/experiment.js +0 -1039
  215. package/src/entities/finance.js +0 -3478
  216. package/src/entities/forms.js +0 -1892
  217. package/src/entities/hr.js +0 -661
  218. package/src/entities/identity.js +0 -997
  219. package/src/entities/index.js +0 -282
  220. package/src/entities/infrastructure.js +0 -1153
  221. package/src/entities/knowledge.js +0 -1438
  222. package/src/entities/marketing.js +0 -1610
  223. package/src/entities/media.js +0 -1634
  224. package/src/entities/notification.js +0 -1199
  225. package/src/entities/presentation.js +0 -1274
  226. package/src/entities/productivity.js +0 -1317
  227. package/src/entities/project-management.js +0 -1136
  228. package/src/entities/recruiting.js +0 -736
  229. package/src/entities/shipping.js +0 -509
  230. package/src/entities/signature.js +0 -1102
  231. package/src/entities/site.js +0 -222
  232. package/src/entities/spreadsheet.js +0 -1341
  233. package/src/entities/storage.js +0 -1198
  234. package/src/entities/support.js +0 -1166
  235. package/src/entities/video-conferencing.js +0 -1750
  236. package/src/entities/video.js +0 -950
  237. package/src/entities.js +0 -1663
  238. package/src/index.js +0 -74
  239. package/src/providers/analytics/index.js +0 -17
  240. package/src/providers/analytics/mixpanel.js +0 -255
  241. package/src/providers/calendar/cal-com.js +0 -303
  242. package/src/providers/calendar/google-calendar.js +0 -335
  243. package/src/providers/calendar/index.js +0 -20
  244. package/src/providers/crm/hubspot.js +0 -566
  245. package/src/providers/crm/index.js +0 -17
  246. package/src/providers/development/github.js +0 -472
  247. package/src/providers/development/index.js +0 -17
  248. package/src/providers/ecommerce/index.js +0 -17
  249. package/src/providers/ecommerce/shopify.js +0 -378
  250. package/src/providers/email/index.js +0 -20
  251. package/src/providers/email/resend.js +0 -258
  252. package/src/providers/email/sendgrid.js +0 -161
  253. package/src/providers/finance/index.js +0 -17
  254. package/src/providers/finance/stripe.js +0 -549
  255. package/src/providers/forms/index.js +0 -17
  256. package/src/providers/forms/typeform.js +0 -500
  257. package/src/providers/index.js +0 -123
  258. package/src/providers/knowledge/index.js +0 -17
  259. package/src/providers/knowledge/notion.js +0 -389
  260. package/src/providers/marketing/index.js +0 -17
  261. package/src/providers/marketing/mailchimp.js +0 -443
  262. package/src/providers/media/cloudinary.js +0 -318
  263. package/src/providers/media/index.js +0 -17
  264. package/src/providers/messaging/index.js +0 -20
  265. package/src/providers/messaging/slack.js +0 -393
  266. package/src/providers/messaging/twilio-sms.js +0 -249
  267. package/src/providers/project-management/index.js +0 -17
  268. package/src/providers/project-management/linear.js +0 -575
  269. package/src/providers/registry.js +0 -86
  270. package/src/providers/spreadsheet/google-sheets.js +0 -375
  271. package/src/providers/spreadsheet/index.js +0 -20
  272. package/src/providers/spreadsheet/xlsx.js +0 -423
  273. package/src/providers/storage/index.js +0 -24
  274. package/src/providers/storage/s3.js +0 -419
  275. package/src/providers/support/index.js +0 -17
  276. package/src/providers/support/zendesk.js +0 -373
  277. package/src/providers/tasks/index.js +0 -17
  278. package/src/providers/tasks/todoist.js +0 -286
  279. package/src/providers/types.js +0 -9
  280. package/src/providers/video-conferencing/google-meet.js +0 -286
  281. package/src/providers/video-conferencing/index.js +0 -31
  282. package/src/providers/video-conferencing/jitsi.js +0 -254
  283. package/src/providers/video-conferencing/teams.js +0 -270
  284. package/src/providers/video-conferencing/zoom.js +0 -332
  285. package/src/registry.js +0 -128
  286. package/src/tools/communication.js +0 -184
  287. package/src/tools/data.js +0 -205
  288. package/src/tools/index.js +0 -11
  289. package/src/tools/web.js +0 -137
  290. package/src/types.js +0 -10
  291. package/test/define.test.js +0 -306
  292. package/test/registry.test.js +0 -357
  293. package/test/tools.test.js +0 -363
@@ -1,1166 +0,0 @@
1
- /**
2
- * Support/Helpdesk Entity Types (Nouns)
3
- *
4
- * Semantic type definitions for support and helpdesk tools that can be used by
5
- * both remote human workers AND AI agents. Each entity defines:
6
- * - Properties: The data fields
7
- * - Actions: Operations that can be performed (Verbs)
8
- * - Events: State changes that occur
9
- *
10
- * @packageDocumentation
11
- */
12
- // =============================================================================
13
- // Support Ticket
14
- // =============================================================================
15
- /**
16
- * Support ticket entity
17
- *
18
- * Represents a customer support request or issue that needs resolution
19
- */
20
- export const SupportTicket = {
21
- singular: 'support ticket',
22
- plural: 'support tickets',
23
- description: 'A customer support request or issue requiring assistance',
24
- properties: {
25
- // Identity
26
- ticketNumber: {
27
- type: 'string',
28
- description: 'Unique ticket identifier or number',
29
- },
30
- // Content
31
- subject: {
32
- type: 'string',
33
- description: 'Brief subject or title of the issue',
34
- },
35
- description: {
36
- type: 'string',
37
- description: 'Detailed description of the issue or request',
38
- },
39
- // Classification
40
- type: {
41
- type: 'string',
42
- optional: true,
43
- description: 'Ticket type: question, problem, incident, task, feature-request',
44
- examples: ['question', 'problem', 'incident', 'task', 'feature-request'],
45
- },
46
- category: {
47
- type: 'string',
48
- optional: true,
49
- description: 'Category or department: technical, billing, general, etc.',
50
- },
51
- tags: {
52
- type: 'string',
53
- array: true,
54
- optional: true,
55
- description: 'Tags for categorization and filtering',
56
- },
57
- // Priority & Status
58
- priority: {
59
- type: 'string',
60
- description: 'Ticket priority: low, normal, high, urgent, critical',
61
- examples: ['low', 'normal', 'high', 'urgent', 'critical'],
62
- },
63
- status: {
64
- type: 'string',
65
- description: 'Ticket status: new, open, pending, on-hold, solved, closed',
66
- examples: ['new', 'open', 'pending', 'on-hold', 'solved', 'closed'],
67
- },
68
- // Assignment
69
- assigneeId: {
70
- type: 'string',
71
- optional: true,
72
- description: 'ID of the agent assigned to this ticket',
73
- },
74
- groupId: {
75
- type: 'string',
76
- optional: true,
77
- description: 'ID of the team/group assigned to this ticket',
78
- },
79
- // Customer
80
- requesterId: {
81
- type: 'string',
82
- description: 'ID of the customer who created the ticket',
83
- },
84
- requesterEmail: {
85
- type: 'string',
86
- description: 'Email address of the requester',
87
- },
88
- requesterName: {
89
- type: 'string',
90
- optional: true,
91
- description: 'Name of the requester',
92
- },
93
- // Channel
94
- channel: {
95
- type: 'string',
96
- optional: true,
97
- description: 'How the ticket was created: email, web, chat, phone, api',
98
- examples: ['email', 'web', 'chat', 'phone', 'api'],
99
- },
100
- // Timing
101
- dueAt: {
102
- type: 'datetime',
103
- optional: true,
104
- description: 'Due date/time for resolution',
105
- },
106
- firstResponseAt: {
107
- type: 'datetime',
108
- optional: true,
109
- description: 'When the first response was sent',
110
- },
111
- resolvedAt: {
112
- type: 'datetime',
113
- optional: true,
114
- description: 'When the ticket was resolved',
115
- },
116
- closedAt: {
117
- type: 'datetime',
118
- optional: true,
119
- description: 'When the ticket was closed',
120
- },
121
- // Metrics
122
- responseTime: {
123
- type: 'number',
124
- optional: true,
125
- description: 'Time to first response in minutes',
126
- },
127
- resolutionTime: {
128
- type: 'number',
129
- optional: true,
130
- description: 'Time to resolution in minutes',
131
- },
132
- // Additional
133
- customFields: {
134
- type: 'json',
135
- optional: true,
136
- description: 'Custom field values specific to organization',
137
- },
138
- isPublic: {
139
- type: 'boolean',
140
- optional: true,
141
- description: 'Whether the ticket is publicly visible',
142
- },
143
- satisfaction: {
144
- type: 'string',
145
- optional: true,
146
- description: 'Customer satisfaction rating: good, bad',
147
- examples: ['good', 'bad'],
148
- },
149
- },
150
- relationships: {
151
- requester: {
152
- type: 'Contact',
153
- description: 'The customer who submitted the ticket',
154
- },
155
- assignee: {
156
- type: 'Contact',
157
- required: false,
158
- description: 'The support agent assigned to the ticket',
159
- },
160
- comments: {
161
- type: 'TicketComment[]',
162
- backref: 'ticket',
163
- description: 'Comments and replies on this ticket',
164
- },
165
- attachments: {
166
- type: 'Attachment[]',
167
- description: 'Files attached to the ticket',
168
- },
169
- relatedTickets: {
170
- type: 'SupportTicket[]',
171
- description: 'Related or linked tickets',
172
- },
173
- satisfactionRating: {
174
- type: 'SatisfactionRating',
175
- required: false,
176
- backref: 'ticket',
177
- description: 'Customer satisfaction rating for this ticket',
178
- },
179
- },
180
- actions: [
181
- 'create',
182
- 'update',
183
- 'assign',
184
- 'reassign',
185
- 'escalate',
186
- 'merge',
187
- 'split',
188
- 'reply',
189
- 'addComment',
190
- 'addAttachment',
191
- 'setPriority',
192
- 'setStatus',
193
- 'addTags',
194
- 'removeTags',
195
- 'markSpam',
196
- 'delete',
197
- 'close',
198
- 'reopen',
199
- 'requestFeedback',
200
- ],
201
- events: [
202
- 'created',
203
- 'updated',
204
- 'assigned',
205
- 'reassigned',
206
- 'escalated',
207
- 'merged',
208
- 'split',
209
- 'replied',
210
- 'commented',
211
- 'priorityChanged',
212
- 'statusChanged',
213
- 'tagged',
214
- 'markedSpam',
215
- 'deleted',
216
- 'closed',
217
- 'reopened',
218
- 'rated',
219
- 'solved',
220
- ],
221
- };
222
- /**
223
- * Ticket comment entity
224
- *
225
- * Represents a comment or reply on a support ticket
226
- */
227
- export const TicketComment = {
228
- singular: 'ticket comment',
229
- plural: 'ticket comments',
230
- description: 'A comment or reply on a support ticket',
231
- properties: {
232
- // Content
233
- body: {
234
- type: 'string',
235
- description: 'Comment text content',
236
- },
237
- html: {
238
- type: 'string',
239
- optional: true,
240
- description: 'HTML formatted content',
241
- },
242
- plainText: {
243
- type: 'string',
244
- optional: true,
245
- description: 'Plain text version of the comment',
246
- },
247
- // Visibility
248
- isPublic: {
249
- type: 'boolean',
250
- description: 'Whether the comment is visible to the customer (vs internal note)',
251
- },
252
- // Author
253
- authorId: {
254
- type: 'string',
255
- description: 'ID of the person who wrote the comment',
256
- },
257
- authorType: {
258
- type: 'string',
259
- description: 'Type of author: agent, customer, system',
260
- examples: ['agent', 'customer', 'system'],
261
- },
262
- // Channel
263
- channel: {
264
- type: 'string',
265
- optional: true,
266
- description: 'How the comment was created: web, email, chat, api',
267
- examples: ['web', 'email', 'chat', 'api'],
268
- },
269
- // Email specific
270
- from: {
271
- type: 'string',
272
- optional: true,
273
- description: 'Sender email address if from email',
274
- },
275
- to: {
276
- type: 'string',
277
- array: true,
278
- optional: true,
279
- description: 'Recipient email addresses if via email',
280
- },
281
- cc: {
282
- type: 'string',
283
- array: true,
284
- optional: true,
285
- description: 'CC email addresses',
286
- },
287
- // Metadata
288
- edited: {
289
- type: 'boolean',
290
- optional: true,
291
- description: 'Whether the comment was edited',
292
- },
293
- editedAt: {
294
- type: 'datetime',
295
- optional: true,
296
- description: 'When the comment was last edited',
297
- },
298
- },
299
- relationships: {
300
- ticket: {
301
- type: 'SupportTicket',
302
- backref: 'comments',
303
- description: 'The ticket this comment belongs to',
304
- },
305
- author: {
306
- type: 'Contact',
307
- description: 'Who wrote the comment',
308
- },
309
- attachments: {
310
- type: 'Attachment[]',
311
- description: 'Files attached to this comment',
312
- },
313
- },
314
- actions: [
315
- 'create',
316
- 'edit',
317
- 'delete',
318
- 'makePublic',
319
- 'makePrivate',
320
- 'addAttachment',
321
- 'removeAttachment',
322
- ],
323
- events: [
324
- 'created',
325
- 'edited',
326
- 'deleted',
327
- 'madePublic',
328
- 'madePrivate',
329
- 'attachmentAdded',
330
- 'attachmentRemoved',
331
- ],
332
- };
333
- // =============================================================================
334
- // Live Chat Conversation
335
- // =============================================================================
336
- /**
337
- * Live chat conversation entity
338
- *
339
- * Represents a real-time chat conversation between customer and support (Intercom, Zendesk Chat style)
340
- */
341
- export const Conversation = {
342
- singular: 'conversation',
343
- plural: 'conversations',
344
- description: 'A live chat conversation between customer and support',
345
- properties: {
346
- // Status
347
- status: {
348
- type: 'string',
349
- description: 'Conversation status: open, active, pending, closed, snoozed',
350
- examples: ['open', 'active', 'pending', 'closed', 'snoozed'],
351
- },
352
- state: {
353
- type: 'string',
354
- optional: true,
355
- description: 'Conversation state: waiting, assigned, resolved',
356
- examples: ['waiting', 'assigned', 'resolved'],
357
- },
358
- // Participants
359
- customerId: {
360
- type: 'string',
361
- description: 'ID of the customer in the conversation',
362
- },
363
- assigneeId: {
364
- type: 'string',
365
- optional: true,
366
- description: 'ID of the assigned agent',
367
- },
368
- // Channel & Source
369
- channel: {
370
- type: 'string',
371
- description: 'Channel type: web, mobile, email, facebook, twitter, etc.',
372
- examples: ['web', 'mobile', 'email', 'facebook', 'twitter', 'whatsapp'],
373
- },
374
- source: {
375
- type: 'json',
376
- optional: true,
377
- description: 'Source information (URL, device, etc.)',
378
- },
379
- // Classification
380
- tags: {
381
- type: 'string',
382
- array: true,
383
- optional: true,
384
- description: 'Tags for categorization',
385
- },
386
- priority: {
387
- type: 'number',
388
- optional: true,
389
- description: 'Priority score or level',
390
- },
391
- // Metrics
392
- messageCount: {
393
- type: 'number',
394
- optional: true,
395
- description: 'Total number of messages',
396
- },
397
- responseTime: {
398
- type: 'number',
399
- optional: true,
400
- description: 'Average response time in seconds',
401
- },
402
- waitingTime: {
403
- type: 'number',
404
- optional: true,
405
- description: 'Total time customer waited in seconds',
406
- },
407
- // Timing
408
- startedAt: {
409
- type: 'datetime',
410
- description: 'When the conversation started',
411
- },
412
- lastMessageAt: {
413
- type: 'datetime',
414
- optional: true,
415
- description: 'When the last message was sent',
416
- },
417
- closedAt: {
418
- type: 'datetime',
419
- optional: true,
420
- description: 'When the conversation was closed',
421
- },
422
- snoozedUntil: {
423
- type: 'datetime',
424
- optional: true,
425
- description: 'When a snoozed conversation should reopen',
426
- },
427
- // Customer context
428
- customerContext: {
429
- type: 'json',
430
- optional: true,
431
- description: 'Customer context data (location, device, page visited, etc.)',
432
- },
433
- // Rating
434
- rated: {
435
- type: 'boolean',
436
- optional: true,
437
- description: 'Whether the customer rated the conversation',
438
- },
439
- },
440
- relationships: {
441
- customer: {
442
- type: 'Contact',
443
- description: 'The customer in the conversation',
444
- },
445
- assignee: {
446
- type: 'Contact',
447
- required: false,
448
- description: 'The assigned support agent',
449
- },
450
- messages: {
451
- type: 'ConversationMessage[]',
452
- backref: 'conversation',
453
- description: 'Messages in this conversation',
454
- },
455
- ticket: {
456
- type: 'SupportTicket',
457
- required: false,
458
- description: 'Support ticket created from this conversation',
459
- },
460
- satisfactionRating: {
461
- type: 'SatisfactionRating',
462
- required: false,
463
- backref: 'conversation',
464
- description: 'Customer satisfaction rating for this conversation',
465
- },
466
- },
467
- actions: [
468
- 'start',
469
- 'reply',
470
- 'assign',
471
- 'reassign',
472
- 'transfer',
473
- 'close',
474
- 'reopen',
475
- 'snooze',
476
- 'unsnooze',
477
- 'addTags',
478
- 'removeTags',
479
- 'addNote',
480
- 'markSpam',
481
- 'createTicket',
482
- 'requestRating',
483
- ],
484
- events: [
485
- 'started',
486
- 'messageSent',
487
- 'messageReceived',
488
- 'assigned',
489
- 'reassigned',
490
- 'transferred',
491
- 'closed',
492
- 'reopened',
493
- 'snoozed',
494
- 'unsnoozed',
495
- 'tagged',
496
- 'noteAdded',
497
- 'markedSpam',
498
- 'ticketCreated',
499
- 'rated',
500
- ],
501
- };
502
- /**
503
- * Conversation message entity
504
- *
505
- * Represents a single message in a live chat conversation
506
- */
507
- export const ConversationMessage = {
508
- singular: 'conversation message',
509
- plural: 'conversation messages',
510
- description: 'A single message in a live chat conversation',
511
- properties: {
512
- // Content
513
- body: {
514
- type: 'string',
515
- description: 'Message text content',
516
- },
517
- html: {
518
- type: 'string',
519
- optional: true,
520
- description: 'HTML formatted content',
521
- },
522
- // Type
523
- messageType: {
524
- type: 'string',
525
- description: 'Message type: text, note, assignment, system',
526
- examples: ['text', 'note', 'assignment', 'system'],
527
- },
528
- // Author
529
- senderId: {
530
- type: 'string',
531
- description: 'ID of the person who sent the message',
532
- },
533
- senderType: {
534
- type: 'string',
535
- description: 'Type of sender: customer, agent, bot, system',
536
- examples: ['customer', 'agent', 'bot', 'system'],
537
- },
538
- // Delivery
539
- deliveredAt: {
540
- type: 'datetime',
541
- optional: true,
542
- description: 'When the message was delivered',
543
- },
544
- readAt: {
545
- type: 'datetime',
546
- optional: true,
547
- description: 'When the message was read',
548
- },
549
- // Metadata
550
- metadata: {
551
- type: 'json',
552
- optional: true,
553
- description: 'Additional message metadata',
554
- },
555
- },
556
- relationships: {
557
- conversation: {
558
- type: 'Conversation',
559
- backref: 'messages',
560
- description: 'The conversation this message belongs to',
561
- },
562
- sender: {
563
- type: 'Contact',
564
- description: 'Who sent the message',
565
- },
566
- attachments: {
567
- type: 'Attachment[]',
568
- description: 'Files attached to this message',
569
- },
570
- },
571
- actions: [
572
- 'send',
573
- 'edit',
574
- 'delete',
575
- 'markRead',
576
- 'addAttachment',
577
- 'react',
578
- ],
579
- events: [
580
- 'sent',
581
- 'delivered',
582
- 'read',
583
- 'edited',
584
- 'deleted',
585
- 'attachmentAdded',
586
- 'reacted',
587
- ],
588
- };
589
- // =============================================================================
590
- // Help Center / Knowledge Base
591
- // =============================================================================
592
- /**
593
- * Help article entity
594
- *
595
- * Represents a help center or knowledge base article
596
- */
597
- export const HelpArticle = {
598
- singular: 'help article',
599
- plural: 'help articles',
600
- description: 'A help center or knowledge base article',
601
- properties: {
602
- // Content
603
- title: {
604
- type: 'string',
605
- description: 'Article title',
606
- },
607
- body: {
608
- type: 'markdown',
609
- description: 'Article content in markdown',
610
- },
611
- html: {
612
- type: 'string',
613
- optional: true,
614
- description: 'Article content in HTML',
615
- },
616
- description: {
617
- type: 'string',
618
- optional: true,
619
- description: 'Brief description or excerpt',
620
- },
621
- // Organization
622
- slug: {
623
- type: 'string',
624
- optional: true,
625
- description: 'URL-friendly slug',
626
- },
627
- categoryId: {
628
- type: 'string',
629
- optional: true,
630
- description: 'ID of the category this article belongs to',
631
- },
632
- position: {
633
- type: 'number',
634
- optional: true,
635
- description: 'Display order within category',
636
- },
637
- // Visibility
638
- status: {
639
- type: 'string',
640
- description: 'Article status: draft, published, archived',
641
- examples: ['draft', 'published', 'archived'],
642
- },
643
- visibility: {
644
- type: 'string',
645
- optional: true,
646
- description: 'Who can see: public, internal, restricted',
647
- examples: ['public', 'internal', 'restricted'],
648
- },
649
- // Author & Attribution
650
- authorId: {
651
- type: 'string',
652
- optional: true,
653
- description: 'ID of the article author',
654
- },
655
- lastUpdatedBy: {
656
- type: 'string',
657
- optional: true,
658
- description: 'ID of the last person to update the article',
659
- },
660
- // Engagement
661
- viewCount: {
662
- type: 'number',
663
- optional: true,
664
- description: 'Number of times article has been viewed',
665
- },
666
- upvoteCount: {
667
- type: 'number',
668
- optional: true,
669
- description: 'Number of positive votes',
670
- },
671
- downvoteCount: {
672
- type: 'number',
673
- optional: true,
674
- description: 'Number of negative votes',
675
- },
676
- helpfulCount: {
677
- type: 'number',
678
- optional: true,
679
- description: 'Number of "helpful" votes',
680
- },
681
- // SEO
682
- metaTitle: {
683
- type: 'string',
684
- optional: true,
685
- description: 'SEO meta title',
686
- },
687
- metaDescription: {
688
- type: 'string',
689
- optional: true,
690
- description: 'SEO meta description',
691
- },
692
- keywords: {
693
- type: 'string',
694
- array: true,
695
- optional: true,
696
- description: 'Keywords for search',
697
- },
698
- // Timing
699
- publishedAt: {
700
- type: 'datetime',
701
- optional: true,
702
- description: 'When the article was published',
703
- },
704
- lastUpdatedAt: {
705
- type: 'datetime',
706
- optional: true,
707
- description: 'When the article was last updated',
708
- },
709
- // Localization
710
- locale: {
711
- type: 'string',
712
- optional: true,
713
- description: 'Language/locale code',
714
- },
715
- },
716
- relationships: {
717
- category: {
718
- type: 'HelpCategory',
719
- required: false,
720
- backref: 'articles',
721
- description: 'Category this article belongs to',
722
- },
723
- author: {
724
- type: 'Contact',
725
- required: false,
726
- description: 'Article author',
727
- },
728
- relatedArticles: {
729
- type: 'HelpArticle[]',
730
- description: 'Related or suggested articles',
731
- },
732
- attachments: {
733
- type: 'Attachment[]',
734
- description: 'Images and files in the article',
735
- },
736
- },
737
- actions: [
738
- 'create',
739
- 'edit',
740
- 'publish',
741
- 'unpublish',
742
- 'archive',
743
- 'delete',
744
- 'move',
745
- 'duplicate',
746
- 'translate',
747
- 'upvote',
748
- 'downvote',
749
- 'markHelpful',
750
- 'markNotHelpful',
751
- 'view',
752
- 'search',
753
- ],
754
- events: [
755
- 'created',
756
- 'edited',
757
- 'published',
758
- 'unpublished',
759
- 'archived',
760
- 'deleted',
761
- 'moved',
762
- 'duplicated',
763
- 'translated',
764
- 'viewed',
765
- 'upvoted',
766
- 'downvoted',
767
- 'markedHelpful',
768
- 'markedNotHelpful',
769
- ],
770
- };
771
- /**
772
- * Help category entity
773
- *
774
- * Represents a category for organizing help articles
775
- */
776
- export const HelpCategory = {
777
- singular: 'help category',
778
- plural: 'help categories',
779
- description: 'A category for organizing help articles',
780
- properties: {
781
- // Identity
782
- name: {
783
- type: 'string',
784
- description: 'Category name',
785
- },
786
- description: {
787
- type: 'string',
788
- optional: true,
789
- description: 'Category description',
790
- },
791
- slug: {
792
- type: 'string',
793
- optional: true,
794
- description: 'URL-friendly slug',
795
- },
796
- // Organization
797
- parentId: {
798
- type: 'string',
799
- optional: true,
800
- description: 'ID of parent category for nested structure',
801
- },
802
- position: {
803
- type: 'number',
804
- optional: true,
805
- description: 'Display order',
806
- },
807
- // Display
808
- icon: {
809
- type: 'string',
810
- optional: true,
811
- description: 'Icon name or emoji',
812
- },
813
- color: {
814
- type: 'string',
815
- optional: true,
816
- description: 'Display color (hex code)',
817
- },
818
- // Visibility
819
- visibility: {
820
- type: 'string',
821
- optional: true,
822
- description: 'Who can see: public, internal, restricted',
823
- examples: ['public', 'internal', 'restricted'],
824
- },
825
- // Metrics
826
- articleCount: {
827
- type: 'number',
828
- optional: true,
829
- description: 'Number of articles in this category',
830
- },
831
- // Localization
832
- locale: {
833
- type: 'string',
834
- optional: true,
835
- description: 'Language/locale code',
836
- },
837
- },
838
- relationships: {
839
- parent: {
840
- type: 'HelpCategory',
841
- required: false,
842
- description: 'Parent category for nested structure',
843
- },
844
- subcategories: {
845
- type: 'HelpCategory[]',
846
- description: 'Child categories',
847
- },
848
- articles: {
849
- type: 'HelpArticle[]',
850
- backref: 'category',
851
- description: 'Articles in this category',
852
- },
853
- },
854
- actions: [
855
- 'create',
856
- 'edit',
857
- 'delete',
858
- 'move',
859
- 'reorder',
860
- 'addArticle',
861
- 'removeArticle',
862
- ],
863
- events: [
864
- 'created',
865
- 'edited',
866
- 'deleted',
867
- 'moved',
868
- 'reordered',
869
- 'articleAdded',
870
- 'articleRemoved',
871
- ],
872
- };
873
- /**
874
- * FAQ entity
875
- *
876
- * Represents a frequently asked question with answer
877
- */
878
- export const FAQ = {
879
- singular: 'FAQ',
880
- plural: 'FAQs',
881
- description: 'A frequently asked question with answer',
882
- properties: {
883
- // Content
884
- question: {
885
- type: 'string',
886
- description: 'The question text',
887
- },
888
- answer: {
889
- type: 'string',
890
- description: 'The answer text',
891
- },
892
- answerHtml: {
893
- type: 'string',
894
- optional: true,
895
- description: 'HTML formatted answer',
896
- },
897
- // Organization
898
- categoryId: {
899
- type: 'string',
900
- optional: true,
901
- description: 'Category or topic ID',
902
- },
903
- position: {
904
- type: 'number',
905
- optional: true,
906
- description: 'Display order',
907
- },
908
- tags: {
909
- type: 'string',
910
- array: true,
911
- optional: true,
912
- description: 'Tags for categorization',
913
- },
914
- // Visibility
915
- status: {
916
- type: 'string',
917
- description: 'Status: draft, published, archived',
918
- examples: ['draft', 'published', 'archived'],
919
- },
920
- visibility: {
921
- type: 'string',
922
- optional: true,
923
- description: 'Who can see: public, internal',
924
- examples: ['public', 'internal'],
925
- },
926
- // Engagement
927
- viewCount: {
928
- type: 'number',
929
- optional: true,
930
- description: 'Number of views',
931
- },
932
- helpfulCount: {
933
- type: 'number',
934
- optional: true,
935
- description: 'Number of "helpful" votes',
936
- },
937
- notHelpfulCount: {
938
- type: 'number',
939
- optional: true,
940
- description: 'Number of "not helpful" votes',
941
- },
942
- // Timing
943
- publishedAt: {
944
- type: 'datetime',
945
- optional: true,
946
- description: 'When published',
947
- },
948
- // Localization
949
- locale: {
950
- type: 'string',
951
- optional: true,
952
- description: 'Language/locale code',
953
- },
954
- },
955
- relationships: {
956
- category: {
957
- type: 'HelpCategory',
958
- required: false,
959
- description: 'Category this FAQ belongs to',
960
- },
961
- relatedArticles: {
962
- type: 'HelpArticle[]',
963
- description: 'Related help articles',
964
- },
965
- },
966
- actions: [
967
- 'create',
968
- 'edit',
969
- 'publish',
970
- 'unpublish',
971
- 'archive',
972
- 'delete',
973
- 'reorder',
974
- 'markHelpful',
975
- 'markNotHelpful',
976
- 'view',
977
- ],
978
- events: [
979
- 'created',
980
- 'edited',
981
- 'published',
982
- 'unpublished',
983
- 'archived',
984
- 'deleted',
985
- 'reordered',
986
- 'viewed',
987
- 'markedHelpful',
988
- 'markedNotHelpful',
989
- ],
990
- };
991
- // =============================================================================
992
- // Customer Feedback
993
- // =============================================================================
994
- /**
995
- * Satisfaction rating entity
996
- *
997
- * Represents a CSAT/NPS rating from a customer
998
- */
999
- export const SatisfactionRating = {
1000
- singular: 'satisfaction rating',
1001
- plural: 'satisfaction ratings',
1002
- description: 'A customer satisfaction (CSAT) or NPS rating',
1003
- properties: {
1004
- // Rating
1005
- score: {
1006
- type: 'number',
1007
- description: 'Rating score (e.g., 1-5 for CSAT, 0-10 for NPS)',
1008
- },
1009
- ratingType: {
1010
- type: 'string',
1011
- description: 'Type of rating: csat, nps, ces, custom',
1012
- examples: ['csat', 'nps', 'ces', 'custom'],
1013
- },
1014
- sentiment: {
1015
- type: 'string',
1016
- optional: true,
1017
- description: 'Calculated sentiment: positive, neutral, negative, promoter, passive, detractor',
1018
- examples: ['positive', 'neutral', 'negative', 'promoter', 'passive', 'detractor'],
1019
- },
1020
- // Feedback
1021
- comment: {
1022
- type: 'string',
1023
- optional: true,
1024
- description: 'Optional text feedback from customer',
1025
- },
1026
- reason: {
1027
- type: 'string',
1028
- optional: true,
1029
- description: 'Reason for the rating (category)',
1030
- },
1031
- // Context
1032
- customerId: {
1033
- type: 'string',
1034
- description: 'ID of the customer who provided the rating',
1035
- },
1036
- agentId: {
1037
- type: 'string',
1038
- optional: true,
1039
- description: 'ID of the agent who was rated',
1040
- },
1041
- // Association
1042
- ticketId: {
1043
- type: 'string',
1044
- optional: true,
1045
- description: 'ID of the ticket being rated',
1046
- },
1047
- conversationId: {
1048
- type: 'string',
1049
- optional: true,
1050
- description: 'ID of the conversation being rated',
1051
- },
1052
- // Source
1053
- channel: {
1054
- type: 'string',
1055
- optional: true,
1056
- description: 'How the rating was collected: email, web, in-app, sms',
1057
- examples: ['email', 'web', 'in-app', 'sms'],
1058
- },
1059
- // Timing
1060
- requestedAt: {
1061
- type: 'datetime',
1062
- optional: true,
1063
- description: 'When the rating was requested',
1064
- },
1065
- respondedAt: {
1066
- type: 'datetime',
1067
- description: 'When the customer responded',
1068
- },
1069
- // Status
1070
- reviewed: {
1071
- type: 'boolean',
1072
- optional: true,
1073
- description: 'Whether the rating has been reviewed by staff',
1074
- },
1075
- reviewedAt: {
1076
- type: 'datetime',
1077
- optional: true,
1078
- description: 'When the rating was reviewed',
1079
- },
1080
- reviewedBy: {
1081
- type: 'string',
1082
- optional: true,
1083
- description: 'ID of the person who reviewed the rating',
1084
- },
1085
- // Follow-up
1086
- followedUp: {
1087
- type: 'boolean',
1088
- optional: true,
1089
- description: 'Whether follow-up action was taken',
1090
- },
1091
- followUpNote: {
1092
- type: 'string',
1093
- optional: true,
1094
- description: 'Notes about follow-up action',
1095
- },
1096
- },
1097
- relationships: {
1098
- customer: {
1099
- type: 'Contact',
1100
- description: 'The customer who provided the rating',
1101
- },
1102
- agent: {
1103
- type: 'Contact',
1104
- required: false,
1105
- description: 'The agent who was rated',
1106
- },
1107
- ticket: {
1108
- type: 'SupportTicket',
1109
- required: false,
1110
- backref: 'satisfactionRating',
1111
- description: 'The ticket being rated',
1112
- },
1113
- conversation: {
1114
- type: 'Conversation',
1115
- required: false,
1116
- backref: 'satisfactionRating',
1117
- description: 'The conversation being rated',
1118
- },
1119
- },
1120
- actions: [
1121
- 'submit',
1122
- 'update',
1123
- 'review',
1124
- 'followUp',
1125
- 'dismiss',
1126
- 'export',
1127
- 'analyze',
1128
- ],
1129
- events: [
1130
- 'submitted',
1131
- 'updated',
1132
- 'reviewed',
1133
- 'followedUp',
1134
- 'dismissed',
1135
- 'exported',
1136
- ],
1137
- };
1138
- // =============================================================================
1139
- // Export all entities as a schema
1140
- // =============================================================================
1141
- /**
1142
- * All support/helpdesk entity types
1143
- */
1144
- export const SupportEntities = {
1145
- // Support Tickets
1146
- SupportTicket,
1147
- TicketComment,
1148
- // Live Chat
1149
- Conversation,
1150
- ConversationMessage,
1151
- // Help Center
1152
- HelpArticle,
1153
- HelpCategory,
1154
- FAQ,
1155
- // Feedback
1156
- SatisfactionRating,
1157
- };
1158
- /**
1159
- * Entity categories for organization
1160
- */
1161
- export const SupportCategories = {
1162
- tickets: ['SupportTicket', 'TicketComment'],
1163
- liveChat: ['Conversation', 'ConversationMessage'],
1164
- helpCenter: ['HelpArticle', 'HelpCategory', 'FAQ'],
1165
- feedback: ['SatisfactionRating'],
1166
- };