digital-tools 2.0.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.
Files changed (452) hide show
  1. package/.turbo/turbo-build.log +5 -0
  2. package/CHANGELOG.md +9 -0
  3. package/README.md +1144 -0
  4. package/dist/define.d.ts +109 -0
  5. package/dist/define.d.ts.map +1 -0
  6. package/dist/define.js +268 -0
  7. package/dist/define.js.map +1 -0
  8. package/dist/entities/advertising.d.ts +79 -0
  9. package/dist/entities/advertising.d.ts.map +1 -0
  10. package/dist/entities/advertising.js +1000 -0
  11. package/dist/entities/advertising.js.map +1 -0
  12. package/dist/entities/ai.d.ts +69 -0
  13. package/dist/entities/ai.d.ts.map +1 -0
  14. package/dist/entities/ai.js +757 -0
  15. package/dist/entities/ai.js.map +1 -0
  16. package/dist/entities/analytics.d.ts +83 -0
  17. package/dist/entities/analytics.d.ts.map +1 -0
  18. package/dist/entities/analytics.js +1589 -0
  19. package/dist/entities/analytics.js.map +1 -0
  20. package/dist/entities/automation.d.ts +61 -0
  21. package/dist/entities/automation.d.ts.map +1 -0
  22. package/dist/entities/automation.js +602 -0
  23. package/dist/entities/automation.js.map +1 -0
  24. package/dist/entities/communication.d.ts +96 -0
  25. package/dist/entities/communication.d.ts.map +1 -0
  26. package/dist/entities/communication.js +1151 -0
  27. package/dist/entities/communication.js.map +1 -0
  28. package/dist/entities/crm.d.ts +91 -0
  29. package/dist/entities/crm.d.ts.map +1 -0
  30. package/dist/entities/crm.js +1387 -0
  31. package/dist/entities/crm.js.map +1 -0
  32. package/dist/entities/design.d.ts +61 -0
  33. package/dist/entities/design.d.ts.map +1 -0
  34. package/dist/entities/design.js +547 -0
  35. package/dist/entities/design.js.map +1 -0
  36. package/dist/entities/development.d.ts +145 -0
  37. package/dist/entities/development.d.ts.map +1 -0
  38. package/dist/entities/development.js +2213 -0
  39. package/dist/entities/development.js.map +1 -0
  40. package/dist/entities/document.d.ts +54 -0
  41. package/dist/entities/document.d.ts.map +1 -0
  42. package/dist/entities/document.js +875 -0
  43. package/dist/entities/document.js.map +1 -0
  44. package/dist/entities/ecommerce.d.ts +93 -0
  45. package/dist/entities/ecommerce.d.ts.map +1 -0
  46. package/dist/entities/ecommerce.js +1430 -0
  47. package/dist/entities/ecommerce.js.map +1 -0
  48. package/dist/entities/experiment.d.ts +89 -0
  49. package/dist/entities/experiment.d.ts.map +1 -0
  50. package/dist/entities/experiment.js +1040 -0
  51. package/dist/entities/experiment.js.map +1 -0
  52. package/dist/entities/finance.d.ts +272 -0
  53. package/dist/entities/finance.d.ts.map +1 -0
  54. package/dist/entities/finance.js +3479 -0
  55. package/dist/entities/finance.js.map +1 -0
  56. package/dist/entities/forms.d.ts +91 -0
  57. package/dist/entities/forms.d.ts.map +1 -0
  58. package/dist/entities/forms.js +1893 -0
  59. package/dist/entities/forms.js.map +1 -0
  60. package/dist/entities/hr.d.ts +62 -0
  61. package/dist/entities/hr.d.ts.map +1 -0
  62. package/dist/entities/hr.js +662 -0
  63. package/dist/entities/hr.js.map +1 -0
  64. package/dist/entities/identity.d.ts +90 -0
  65. package/dist/entities/identity.d.ts.map +1 -0
  66. package/dist/entities/identity.js +998 -0
  67. package/dist/entities/identity.js.map +1 -0
  68. package/dist/entities/index.d.ts +410 -0
  69. package/dist/entities/index.d.ts.map +1 -0
  70. package/dist/entities/index.js +283 -0
  71. package/dist/entities/index.js.map +1 -0
  72. package/dist/entities/infrastructure.d.ts +98 -0
  73. package/dist/entities/infrastructure.d.ts.map +1 -0
  74. package/dist/entities/infrastructure.js +1154 -0
  75. package/dist/entities/infrastructure.js.map +1 -0
  76. package/dist/entities/knowledge.d.ts +98 -0
  77. package/dist/entities/knowledge.d.ts.map +1 -0
  78. package/dist/entities/knowledge.js +1439 -0
  79. package/dist/entities/knowledge.js.map +1 -0
  80. package/dist/entities/marketing.d.ts +82 -0
  81. package/dist/entities/marketing.d.ts.map +1 -0
  82. package/dist/entities/marketing.js +1611 -0
  83. package/dist/entities/marketing.js.map +1 -0
  84. package/dist/entities/media.d.ts +83 -0
  85. package/dist/entities/media.d.ts.map +1 -0
  86. package/dist/entities/media.js +1635 -0
  87. package/dist/entities/media.js.map +1 -0
  88. package/dist/entities/notification.d.ts +76 -0
  89. package/dist/entities/notification.d.ts.map +1 -0
  90. package/dist/entities/notification.js +1200 -0
  91. package/dist/entities/notification.js.map +1 -0
  92. package/dist/entities/presentation.d.ts +61 -0
  93. package/dist/entities/presentation.d.ts.map +1 -0
  94. package/dist/entities/presentation.js +1275 -0
  95. package/dist/entities/presentation.js.map +1 -0
  96. package/dist/entities/productivity.d.ts +92 -0
  97. package/dist/entities/productivity.d.ts.map +1 -0
  98. package/dist/entities/productivity.js +1318 -0
  99. package/dist/entities/productivity.js.map +1 -0
  100. package/dist/entities/project-management.d.ts +89 -0
  101. package/dist/entities/project-management.d.ts.map +1 -0
  102. package/dist/entities/project-management.js +1137 -0
  103. package/dist/entities/project-management.js.map +1 -0
  104. package/dist/entities/recruiting.d.ts +54 -0
  105. package/dist/entities/recruiting.d.ts.map +1 -0
  106. package/dist/entities/recruiting.js +737 -0
  107. package/dist/entities/recruiting.js.map +1 -0
  108. package/dist/entities/shipping.d.ts +52 -0
  109. package/dist/entities/shipping.d.ts.map +1 -0
  110. package/dist/entities/shipping.js +510 -0
  111. package/dist/entities/shipping.js.map +1 -0
  112. package/dist/entities/signature.d.ts +83 -0
  113. package/dist/entities/signature.d.ts.map +1 -0
  114. package/dist/entities/signature.js +1103 -0
  115. package/dist/entities/signature.js.map +1 -0
  116. package/dist/entities/site.d.ts +33 -0
  117. package/dist/entities/site.d.ts.map +1 -0
  118. package/dist/entities/site.js +223 -0
  119. package/dist/entities/site.js.map +1 -0
  120. package/dist/entities/spreadsheet.d.ts +68 -0
  121. package/dist/entities/spreadsheet.d.ts.map +1 -0
  122. package/dist/entities/spreadsheet.js +1342 -0
  123. package/dist/entities/spreadsheet.js.map +1 -0
  124. package/dist/entities/storage.d.ts +74 -0
  125. package/dist/entities/storage.d.ts.map +1 -0
  126. package/dist/entities/storage.js +1199 -0
  127. package/dist/entities/storage.js.map +1 -0
  128. package/dist/entities/support.d.ts +83 -0
  129. package/dist/entities/support.d.ts.map +1 -0
  130. package/dist/entities/support.js +1167 -0
  131. package/dist/entities/support.js.map +1 -0
  132. package/dist/entities/video-conferencing.d.ts +129 -0
  133. package/dist/entities/video-conferencing.d.ts.map +1 -0
  134. package/dist/entities/video-conferencing.js +1751 -0
  135. package/dist/entities/video-conferencing.js.map +1 -0
  136. package/dist/entities/video.d.ts +76 -0
  137. package/dist/entities/video.d.ts.map +1 -0
  138. package/dist/entities/video.js +951 -0
  139. package/dist/entities/video.js.map +1 -0
  140. package/dist/entities.d.ts +147 -0
  141. package/dist/entities.d.ts.map +1 -0
  142. package/dist/entities.js +1664 -0
  143. package/dist/entities.js.map +1 -0
  144. package/dist/index.d.ts +29 -0
  145. package/dist/index.d.ts.map +1 -0
  146. package/dist/index.js +75 -0
  147. package/dist/index.js.map +1 -0
  148. package/dist/providers/analytics/index.d.ts +19 -0
  149. package/dist/providers/analytics/index.d.ts.map +1 -0
  150. package/dist/providers/analytics/index.js +18 -0
  151. package/dist/providers/analytics/index.js.map +1 -0
  152. package/dist/providers/analytics/mixpanel.d.ts +25 -0
  153. package/dist/providers/analytics/mixpanel.d.ts.map +1 -0
  154. package/dist/providers/analytics/mixpanel.js +256 -0
  155. package/dist/providers/analytics/mixpanel.js.map +1 -0
  156. package/dist/providers/calendar/cal-com.d.ts +26 -0
  157. package/dist/providers/calendar/cal-com.d.ts.map +1 -0
  158. package/dist/providers/calendar/cal-com.js +304 -0
  159. package/dist/providers/calendar/cal-com.js.map +1 -0
  160. package/dist/providers/calendar/google-calendar.d.ts +25 -0
  161. package/dist/providers/calendar/google-calendar.d.ts.map +1 -0
  162. package/dist/providers/calendar/google-calendar.js +336 -0
  163. package/dist/providers/calendar/google-calendar.js.map +1 -0
  164. package/dist/providers/calendar/index.d.ts +20 -0
  165. package/dist/providers/calendar/index.d.ts.map +1 -0
  166. package/dist/providers/calendar/index.js +21 -0
  167. package/dist/providers/calendar/index.js.map +1 -0
  168. package/dist/providers/crm/hubspot.d.ts +25 -0
  169. package/dist/providers/crm/hubspot.d.ts.map +1 -0
  170. package/dist/providers/crm/hubspot.js +567 -0
  171. package/dist/providers/crm/hubspot.js.map +1 -0
  172. package/dist/providers/crm/index.d.ts +19 -0
  173. package/dist/providers/crm/index.d.ts.map +1 -0
  174. package/dist/providers/crm/index.js +18 -0
  175. package/dist/providers/crm/index.js.map +1 -0
  176. package/dist/providers/development/github.d.ts +25 -0
  177. package/dist/providers/development/github.d.ts.map +1 -0
  178. package/dist/providers/development/github.js +473 -0
  179. package/dist/providers/development/github.js.map +1 -0
  180. package/dist/providers/development/index.d.ts +19 -0
  181. package/dist/providers/development/index.d.ts.map +1 -0
  182. package/dist/providers/development/index.js +18 -0
  183. package/dist/providers/development/index.js.map +1 -0
  184. package/dist/providers/ecommerce/index.d.ts +19 -0
  185. package/dist/providers/ecommerce/index.d.ts.map +1 -0
  186. package/dist/providers/ecommerce/index.js +18 -0
  187. package/dist/providers/ecommerce/index.js.map +1 -0
  188. package/dist/providers/ecommerce/shopify.d.ts +25 -0
  189. package/dist/providers/ecommerce/shopify.d.ts.map +1 -0
  190. package/dist/providers/ecommerce/shopify.js +379 -0
  191. package/dist/providers/ecommerce/shopify.js.map +1 -0
  192. package/dist/providers/email/index.d.ts +20 -0
  193. package/dist/providers/email/index.d.ts.map +1 -0
  194. package/dist/providers/email/index.js +21 -0
  195. package/dist/providers/email/index.js.map +1 -0
  196. package/dist/providers/email/resend.d.ts +25 -0
  197. package/dist/providers/email/resend.d.ts.map +1 -0
  198. package/dist/providers/email/resend.js +259 -0
  199. package/dist/providers/email/resend.js.map +1 -0
  200. package/dist/providers/email/sendgrid.d.ts +25 -0
  201. package/dist/providers/email/sendgrid.d.ts.map +1 -0
  202. package/dist/providers/email/sendgrid.js +162 -0
  203. package/dist/providers/email/sendgrid.js.map +1 -0
  204. package/dist/providers/finance/index.d.ts +19 -0
  205. package/dist/providers/finance/index.d.ts.map +1 -0
  206. package/dist/providers/finance/index.js +18 -0
  207. package/dist/providers/finance/index.js.map +1 -0
  208. package/dist/providers/finance/stripe.d.ts +25 -0
  209. package/dist/providers/finance/stripe.d.ts.map +1 -0
  210. package/dist/providers/finance/stripe.js +550 -0
  211. package/dist/providers/finance/stripe.js.map +1 -0
  212. package/dist/providers/forms/index.d.ts +19 -0
  213. package/dist/providers/forms/index.d.ts.map +1 -0
  214. package/dist/providers/forms/index.js +18 -0
  215. package/dist/providers/forms/index.js.map +1 -0
  216. package/dist/providers/forms/typeform.d.ts +25 -0
  217. package/dist/providers/forms/typeform.d.ts.map +1 -0
  218. package/dist/providers/forms/typeform.js +501 -0
  219. package/dist/providers/forms/typeform.js.map +1 -0
  220. package/dist/providers/index.d.ts +56 -0
  221. package/dist/providers/index.d.ts.map +1 -0
  222. package/dist/providers/index.js +124 -0
  223. package/dist/providers/index.js.map +1 -0
  224. package/dist/providers/knowledge/index.d.ts +19 -0
  225. package/dist/providers/knowledge/index.d.ts.map +1 -0
  226. package/dist/providers/knowledge/index.js +18 -0
  227. package/dist/providers/knowledge/index.js.map +1 -0
  228. package/dist/providers/knowledge/notion.d.ts +25 -0
  229. package/dist/providers/knowledge/notion.d.ts.map +1 -0
  230. package/dist/providers/knowledge/notion.js +390 -0
  231. package/dist/providers/knowledge/notion.js.map +1 -0
  232. package/dist/providers/marketing/index.d.ts +19 -0
  233. package/dist/providers/marketing/index.d.ts.map +1 -0
  234. package/dist/providers/marketing/index.js +18 -0
  235. package/dist/providers/marketing/index.js.map +1 -0
  236. package/dist/providers/marketing/mailchimp.d.ts +25 -0
  237. package/dist/providers/marketing/mailchimp.d.ts.map +1 -0
  238. package/dist/providers/marketing/mailchimp.js +444 -0
  239. package/dist/providers/marketing/mailchimp.js.map +1 -0
  240. package/dist/providers/media/cloudinary.d.ts +25 -0
  241. package/dist/providers/media/cloudinary.d.ts.map +1 -0
  242. package/dist/providers/media/cloudinary.js +319 -0
  243. package/dist/providers/media/cloudinary.js.map +1 -0
  244. package/dist/providers/media/index.d.ts +19 -0
  245. package/dist/providers/media/index.d.ts.map +1 -0
  246. package/dist/providers/media/index.js +18 -0
  247. package/dist/providers/media/index.js.map +1 -0
  248. package/dist/providers/messaging/index.d.ts +24 -0
  249. package/dist/providers/messaging/index.d.ts.map +1 -0
  250. package/dist/providers/messaging/index.js +21 -0
  251. package/dist/providers/messaging/index.js.map +1 -0
  252. package/dist/providers/messaging/slack.d.ts +25 -0
  253. package/dist/providers/messaging/slack.d.ts.map +1 -0
  254. package/dist/providers/messaging/slack.js +394 -0
  255. package/dist/providers/messaging/slack.js.map +1 -0
  256. package/dist/providers/messaging/twilio-sms.d.ts +25 -0
  257. package/dist/providers/messaging/twilio-sms.d.ts.map +1 -0
  258. package/dist/providers/messaging/twilio-sms.js +250 -0
  259. package/dist/providers/messaging/twilio-sms.js.map +1 -0
  260. package/dist/providers/project-management/index.d.ts +19 -0
  261. package/dist/providers/project-management/index.d.ts.map +1 -0
  262. package/dist/providers/project-management/index.js +18 -0
  263. package/dist/providers/project-management/index.js.map +1 -0
  264. package/dist/providers/project-management/linear.d.ts +25 -0
  265. package/dist/providers/project-management/linear.d.ts.map +1 -0
  266. package/dist/providers/project-management/linear.js +576 -0
  267. package/dist/providers/project-management/linear.js.map +1 -0
  268. package/dist/providers/registry.d.ts +41 -0
  269. package/dist/providers/registry.d.ts.map +1 -0
  270. package/dist/providers/registry.js +87 -0
  271. package/dist/providers/registry.js.map +1 -0
  272. package/dist/providers/spreadsheet/google-sheets.d.ts +25 -0
  273. package/dist/providers/spreadsheet/google-sheets.d.ts.map +1 -0
  274. package/dist/providers/spreadsheet/google-sheets.js +376 -0
  275. package/dist/providers/spreadsheet/google-sheets.js.map +1 -0
  276. package/dist/providers/spreadsheet/index.d.ts +20 -0
  277. package/dist/providers/spreadsheet/index.d.ts.map +1 -0
  278. package/dist/providers/spreadsheet/index.js +21 -0
  279. package/dist/providers/spreadsheet/index.js.map +1 -0
  280. package/dist/providers/spreadsheet/xlsx.d.ts +26 -0
  281. package/dist/providers/spreadsheet/xlsx.d.ts.map +1 -0
  282. package/dist/providers/spreadsheet/xlsx.js +424 -0
  283. package/dist/providers/spreadsheet/xlsx.js.map +1 -0
  284. package/dist/providers/storage/index.d.ts +30 -0
  285. package/dist/providers/storage/index.d.ts.map +1 -0
  286. package/dist/providers/storage/index.js +25 -0
  287. package/dist/providers/storage/index.js.map +1 -0
  288. package/dist/providers/storage/s3.d.ts +25 -0
  289. package/dist/providers/storage/s3.d.ts.map +1 -0
  290. package/dist/providers/storage/s3.js +420 -0
  291. package/dist/providers/storage/s3.js.map +1 -0
  292. package/dist/providers/support/index.d.ts +19 -0
  293. package/dist/providers/support/index.d.ts.map +1 -0
  294. package/dist/providers/support/index.js +18 -0
  295. package/dist/providers/support/index.js.map +1 -0
  296. package/dist/providers/support/zendesk.d.ts +25 -0
  297. package/dist/providers/support/zendesk.d.ts.map +1 -0
  298. package/dist/providers/support/zendesk.js +374 -0
  299. package/dist/providers/support/zendesk.js.map +1 -0
  300. package/dist/providers/tasks/index.d.ts +19 -0
  301. package/dist/providers/tasks/index.d.ts.map +1 -0
  302. package/dist/providers/tasks/index.js +18 -0
  303. package/dist/providers/tasks/index.js.map +1 -0
  304. package/dist/providers/tasks/todoist.d.ts +25 -0
  305. package/dist/providers/tasks/todoist.d.ts.map +1 -0
  306. package/dist/providers/tasks/todoist.js +287 -0
  307. package/dist/providers/tasks/todoist.js.map +1 -0
  308. package/dist/providers/types.d.ts +1753 -0
  309. package/dist/providers/types.d.ts.map +1 -0
  310. package/dist/providers/types.js +10 -0
  311. package/dist/providers/types.js.map +1 -0
  312. package/dist/providers/video-conferencing/google-meet.d.ts +26 -0
  313. package/dist/providers/video-conferencing/google-meet.d.ts.map +1 -0
  314. package/dist/providers/video-conferencing/google-meet.js +287 -0
  315. package/dist/providers/video-conferencing/google-meet.js.map +1 -0
  316. package/dist/providers/video-conferencing/index.d.ts +22 -0
  317. package/dist/providers/video-conferencing/index.d.ts.map +1 -0
  318. package/dist/providers/video-conferencing/index.js +32 -0
  319. package/dist/providers/video-conferencing/index.js.map +1 -0
  320. package/dist/providers/video-conferencing/jitsi.d.ts +26 -0
  321. package/dist/providers/video-conferencing/jitsi.d.ts.map +1 -0
  322. package/dist/providers/video-conferencing/jitsi.js +255 -0
  323. package/dist/providers/video-conferencing/jitsi.js.map +1 -0
  324. package/dist/providers/video-conferencing/teams.d.ts +26 -0
  325. package/dist/providers/video-conferencing/teams.d.ts.map +1 -0
  326. package/dist/providers/video-conferencing/teams.js +271 -0
  327. package/dist/providers/video-conferencing/teams.js.map +1 -0
  328. package/dist/providers/video-conferencing/zoom.d.ts +25 -0
  329. package/dist/providers/video-conferencing/zoom.d.ts.map +1 -0
  330. package/dist/providers/video-conferencing/zoom.js +333 -0
  331. package/dist/providers/video-conferencing/zoom.js.map +1 -0
  332. package/dist/providers/voice/vapi.d.ts +27 -0
  333. package/dist/providers/voice/vapi.d.ts.map +1 -0
  334. package/dist/providers/voice/vapi.js +440 -0
  335. package/dist/providers/voice/vapi.js.map +1 -0
  336. package/dist/registry.d.ts +38 -0
  337. package/dist/registry.d.ts.map +1 -0
  338. package/dist/registry.js +129 -0
  339. package/dist/registry.js.map +1 -0
  340. package/dist/tools/communication.d.ts +94 -0
  341. package/dist/tools/communication.d.ts.map +1 -0
  342. package/dist/tools/communication.js +185 -0
  343. package/dist/tools/communication.js.map +1 -0
  344. package/dist/tools/data.d.ts +61 -0
  345. package/dist/tools/data.d.ts.map +1 -0
  346. package/dist/tools/data.js +206 -0
  347. package/dist/tools/data.js.map +1 -0
  348. package/dist/tools/index.d.ts +12 -0
  349. package/dist/tools/index.d.ts.map +1 -0
  350. package/dist/tools/index.js +12 -0
  351. package/dist/tools/index.js.map +1 -0
  352. package/dist/tools/web.d.ts +45 -0
  353. package/dist/tools/web.d.ts.map +1 -0
  354. package/dist/tools/web.js +138 -0
  355. package/dist/tools/web.js.map +1 -0
  356. package/dist/types.d.ts +330 -0
  357. package/dist/types.d.ts.map +1 -0
  358. package/dist/types.js +11 -0
  359. package/dist/types.js.map +1 -0
  360. package/package.json +45 -0
  361. package/src/define.ts +321 -0
  362. package/src/entities/advertising.ts +1086 -0
  363. package/src/entities/ai.ts +835 -0
  364. package/src/entities/analytics.ts +1690 -0
  365. package/src/entities/automation.ts +669 -0
  366. package/src/entities/communication.ts +1255 -0
  367. package/src/entities/crm.ts +1481 -0
  368. package/src/entities/design.ts +606 -0
  369. package/src/entities/development.ts +2392 -0
  370. package/src/entities/document.ts +930 -0
  371. package/src/entities/ecommerce.ts +1539 -0
  372. package/src/entities/experiment.ts +1139 -0
  373. package/src/entities/finance.ts +3907 -0
  374. package/src/entities/forms.ts +2021 -0
  375. package/src/entities/hr.ts +725 -0
  376. package/src/entities/identity.ts +1093 -0
  377. package/src/entities/index.ts +731 -0
  378. package/src/entities/infrastructure.ts +1254 -0
  379. package/src/entities/knowledge.ts +1547 -0
  380. package/src/entities/marketing.ts +1718 -0
  381. package/src/entities/media.ts +1747 -0
  382. package/src/entities/notification.ts +1260 -0
  383. package/src/entities/presentation.ts +1360 -0
  384. package/src/entities/productivity.ts +1411 -0
  385. package/src/entities/project-management.ts +1222 -0
  386. package/src/entities/recruiting.ts +797 -0
  387. package/src/entities/shipping.ts +566 -0
  388. package/src/entities/signature.ts +1204 -0
  389. package/src/entities/site.ts +244 -0
  390. package/src/entities/spreadsheet.ts +1434 -0
  391. package/src/entities/storage.ts +1290 -0
  392. package/src/entities/support.ts +1267 -0
  393. package/src/entities/video-conferencing.ts +1874 -0
  394. package/src/entities/video.ts +1035 -0
  395. package/src/entities.ts +1795 -0
  396. package/src/index.ts +176 -0
  397. package/src/providers/analytics/index.ts +21 -0
  398. package/src/providers/analytics/mixpanel.ts +311 -0
  399. package/src/providers/calendar/cal-com.ts +435 -0
  400. package/src/providers/calendar/google-calendar.ts +412 -0
  401. package/src/providers/calendar/index.ts +24 -0
  402. package/src/providers/crm/hubspot.ts +667 -0
  403. package/src/providers/crm/index.ts +21 -0
  404. package/src/providers/development/github.ts +608 -0
  405. package/src/providers/development/index.ts +21 -0
  406. package/src/providers/ecommerce/index.ts +21 -0
  407. package/src/providers/ecommerce/shopify.ts +451 -0
  408. package/src/providers/email/index.ts +24 -0
  409. package/src/providers/email/resend.ts +301 -0
  410. package/src/providers/email/sendgrid.ts +196 -0
  411. package/src/providers/finance/index.ts +21 -0
  412. package/src/providers/finance/stripe.ts +665 -0
  413. package/src/providers/forms/index.ts +21 -0
  414. package/src/providers/forms/typeform.ts +598 -0
  415. package/src/providers/index.ts +281 -0
  416. package/src/providers/knowledge/index.ts +21 -0
  417. package/src/providers/knowledge/notion.ts +497 -0
  418. package/src/providers/marketing/index.ts +21 -0
  419. package/src/providers/marketing/mailchimp.ts +656 -0
  420. package/src/providers/media/cloudinary.ts +373 -0
  421. package/src/providers/media/index.ts +21 -0
  422. package/src/providers/messaging/index.ts +24 -0
  423. package/src/providers/messaging/slack.ts +487 -0
  424. package/src/providers/messaging/twilio-sms.ts +301 -0
  425. package/src/providers/project-management/index.ts +21 -0
  426. package/src/providers/project-management/linear.ts +693 -0
  427. package/src/providers/registry.ts +119 -0
  428. package/src/providers/spreadsheet/google-sheets.ts +464 -0
  429. package/src/providers/spreadsheet/index.ts +24 -0
  430. package/src/providers/spreadsheet/xlsx.ts +542 -0
  431. package/src/providers/storage/index.ts +35 -0
  432. package/src/providers/storage/s3.ts +513 -0
  433. package/src/providers/support/index.ts +21 -0
  434. package/src/providers/support/zendesk.ts +417 -0
  435. package/src/providers/tasks/index.ts +21 -0
  436. package/src/providers/tasks/todoist.ts +407 -0
  437. package/src/providers/types.ts +2113 -0
  438. package/src/providers/video-conferencing/google-meet.ts +412 -0
  439. package/src/providers/video-conferencing/index.ts +35 -0
  440. package/src/providers/video-conferencing/jitsi.ts +324 -0
  441. package/src/providers/video-conferencing/teams.ts +408 -0
  442. package/src/providers/video-conferencing/zoom.ts +451 -0
  443. package/src/registry.ts +172 -0
  444. package/src/tools/communication.ts +256 -0
  445. package/src/tools/data.ts +236 -0
  446. package/src/tools/index.ts +12 -0
  447. package/src/tools/web.ts +161 -0
  448. package/src/types.ts +539 -0
  449. package/test/define.test.ts +367 -0
  450. package/test/registry.test.ts +444 -0
  451. package/test/tools.test.ts +453 -0
  452. package/tsconfig.json +20 -0
@@ -0,0 +1,2021 @@
1
+ /**
2
+ * Forms and Survey Entity Types (Nouns)
3
+ *
4
+ * Semantic type definitions for forms, surveys, and quizzes 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
+ import type { Noun, NounProperty, NounRelationship, Verb } from 'ai-database'
14
+
15
+ // =============================================================================
16
+ // Form
17
+ // =============================================================================
18
+
19
+ /**
20
+ * Form entity
21
+ *
22
+ * Represents a customizable form for collecting structured data from users.
23
+ * Can be used for applications, registrations, feedback, data collection, etc.
24
+ */
25
+ export const Form: Noun = {
26
+ singular: 'form',
27
+ plural: 'forms',
28
+ description: 'A customizable form for collecting structured data from users',
29
+
30
+ properties: {
31
+ // Identity
32
+ title: {
33
+ type: 'string',
34
+ description: 'Form title',
35
+ },
36
+ description: {
37
+ type: 'string',
38
+ optional: true,
39
+ description: 'Form description or instructions',
40
+ },
41
+ slug: {
42
+ type: 'string',
43
+ optional: true,
44
+ description: 'URL-friendly identifier',
45
+ },
46
+
47
+ // Status
48
+ status: {
49
+ type: 'string',
50
+ description: 'Form status: draft, published, archived, closed',
51
+ examples: ['draft', 'published', 'archived', 'closed'],
52
+ },
53
+ active: {
54
+ type: 'boolean',
55
+ description: 'Whether the form is actively accepting responses',
56
+ },
57
+
58
+ // Configuration
59
+ allowMultipleResponses: {
60
+ type: 'boolean',
61
+ optional: true,
62
+ description: 'Whether users can submit multiple times',
63
+ },
64
+ requireAuthentication: {
65
+ type: 'boolean',
66
+ optional: true,
67
+ description: 'Whether users must be logged in to submit',
68
+ },
69
+ collectEmail: {
70
+ type: 'boolean',
71
+ optional: true,
72
+ description: 'Whether to collect respondent email addresses',
73
+ },
74
+ shuffleFields: {
75
+ type: 'boolean',
76
+ optional: true,
77
+ description: 'Whether to randomize field order',
78
+ },
79
+
80
+ // Submission settings
81
+ submitButtonText: {
82
+ type: 'string',
83
+ optional: true,
84
+ description: 'Custom text for submit button',
85
+ },
86
+ confirmationMessage: {
87
+ type: 'string',
88
+ optional: true,
89
+ description: 'Message shown after successful submission',
90
+ },
91
+ redirectUrl: {
92
+ type: 'url',
93
+ optional: true,
94
+ description: 'URL to redirect to after submission',
95
+ },
96
+
97
+ // Notifications
98
+ notifyOnSubmission: {
99
+ type: 'boolean',
100
+ optional: true,
101
+ description: 'Whether to send notifications on new submissions',
102
+ },
103
+ notificationEmails: {
104
+ type: 'string',
105
+ array: true,
106
+ optional: true,
107
+ description: 'Email addresses to notify on submissions',
108
+ },
109
+
110
+ // Limits
111
+ maxResponses: {
112
+ type: 'number',
113
+ optional: true,
114
+ description: 'Maximum number of responses allowed',
115
+ },
116
+ responseCount: {
117
+ type: 'number',
118
+ optional: true,
119
+ description: 'Current number of responses received',
120
+ },
121
+ closesAt: {
122
+ type: 'datetime',
123
+ optional: true,
124
+ description: 'When the form stops accepting responses',
125
+ },
126
+
127
+ // Styling
128
+ theme: {
129
+ type: 'json',
130
+ optional: true,
131
+ description: 'Custom theme and styling configuration',
132
+ },
133
+ logo: {
134
+ type: 'url',
135
+ optional: true,
136
+ description: 'Logo URL to display on the form',
137
+ },
138
+
139
+ // Integration
140
+ webhookUrl: {
141
+ type: 'url',
142
+ optional: true,
143
+ description: 'Webhook URL to POST submissions to',
144
+ },
145
+ integrations: {
146
+ type: 'json',
147
+ optional: true,
148
+ description: 'Third-party integration configurations',
149
+ },
150
+
151
+ // Metadata
152
+ tags: {
153
+ type: 'string',
154
+ array: true,
155
+ optional: true,
156
+ description: 'Tags for categorizing the form',
157
+ },
158
+ folder: {
159
+ type: 'string',
160
+ optional: true,
161
+ description: 'Folder or workspace the form belongs to',
162
+ },
163
+ },
164
+
165
+ relationships: {
166
+ fields: {
167
+ type: 'FormField[]',
168
+ backref: 'form',
169
+ description: 'Fields in this form',
170
+ },
171
+ responses: {
172
+ type: 'FormResponse[]',
173
+ backref: 'form',
174
+ description: 'Responses submitted to this form',
175
+ },
176
+ owner: {
177
+ type: 'Contact',
178
+ description: 'Owner of the form',
179
+ },
180
+ collaborators: {
181
+ type: 'Contact[]',
182
+ description: 'People with edit access to the form',
183
+ },
184
+ },
185
+
186
+ actions: [
187
+ 'create',
188
+ 'edit',
189
+ 'duplicate',
190
+ 'publish',
191
+ 'unpublish',
192
+ 'archive',
193
+ 'delete',
194
+ 'addField',
195
+ 'removeField',
196
+ 'reorderFields',
197
+ 'share',
198
+ 'export',
199
+ 'import',
200
+ 'preview',
201
+ 'embed',
202
+ 'close',
203
+ 'reopen',
204
+ ],
205
+
206
+ events: [
207
+ 'created',
208
+ 'edited',
209
+ 'duplicated',
210
+ 'published',
211
+ 'unpublished',
212
+ 'archived',
213
+ 'deleted',
214
+ 'fieldAdded',
215
+ 'fieldRemoved',
216
+ 'fieldsReordered',
217
+ 'shared',
218
+ 'exported',
219
+ 'imported',
220
+ 'responseReceived',
221
+ 'closed',
222
+ 'reopened',
223
+ ],
224
+ }
225
+
226
+ /**
227
+ * FormField entity
228
+ *
229
+ * Represents a single field within a form with validation rules and options.
230
+ */
231
+ export const FormField: Noun = {
232
+ singular: 'form field',
233
+ plural: 'form fields',
234
+ description: 'A field within a form for collecting specific data',
235
+
236
+ properties: {
237
+ // Identity
238
+ label: {
239
+ type: 'string',
240
+ description: 'Field label displayed to users',
241
+ },
242
+ name: {
243
+ type: 'string',
244
+ description: 'Internal field name/key for data storage',
245
+ },
246
+ description: {
247
+ type: 'string',
248
+ optional: true,
249
+ description: 'Help text or description for the field',
250
+ },
251
+ placeholder: {
252
+ type: 'string',
253
+ optional: true,
254
+ description: 'Placeholder text shown in the input',
255
+ },
256
+
257
+ // Type and configuration
258
+ type: {
259
+ type: 'string',
260
+ description: 'Field type: text, textarea, email, number, phone, select, radio, checkbox, date, file, rating, etc.',
261
+ examples: [
262
+ 'text',
263
+ 'textarea',
264
+ 'email',
265
+ 'number',
266
+ 'phone',
267
+ 'url',
268
+ 'select',
269
+ 'multiselect',
270
+ 'radio',
271
+ 'checkbox',
272
+ 'date',
273
+ 'datetime',
274
+ 'time',
275
+ 'file',
276
+ 'rating',
277
+ 'scale',
278
+ 'matrix',
279
+ 'signature',
280
+ ],
281
+ },
282
+ order: {
283
+ type: 'number',
284
+ description: 'Display order within the form',
285
+ },
286
+ section: {
287
+ type: 'string',
288
+ optional: true,
289
+ description: 'Section or page the field belongs to',
290
+ },
291
+
292
+ // Options for select/radio/checkbox fields
293
+ options: {
294
+ type: 'json',
295
+ optional: true,
296
+ description: 'Options for select, radio, or checkbox fields',
297
+ },
298
+ allowOther: {
299
+ type: 'boolean',
300
+ optional: true,
301
+ description: 'Whether to allow "Other" option with text input',
302
+ },
303
+
304
+ // Validation
305
+ required: {
306
+ type: 'boolean',
307
+ optional: true,
308
+ description: 'Whether the field is required',
309
+ },
310
+ validation: {
311
+ type: 'json',
312
+ optional: true,
313
+ description: 'Validation rules (regex, min/max, format, etc.)',
314
+ },
315
+ minLength: {
316
+ type: 'number',
317
+ optional: true,
318
+ description: 'Minimum length for text fields',
319
+ },
320
+ maxLength: {
321
+ type: 'number',
322
+ optional: true,
323
+ description: 'Maximum length for text fields',
324
+ },
325
+ minValue: {
326
+ type: 'number',
327
+ optional: true,
328
+ description: 'Minimum value for number fields',
329
+ },
330
+ maxValue: {
331
+ type: 'number',
332
+ optional: true,
333
+ description: 'Maximum value for number fields',
334
+ },
335
+ pattern: {
336
+ type: 'string',
337
+ optional: true,
338
+ description: 'Regex pattern for validation',
339
+ },
340
+ errorMessage: {
341
+ type: 'string',
342
+ optional: true,
343
+ description: 'Custom error message for validation failures',
344
+ },
345
+
346
+ // File upload specific
347
+ acceptedFileTypes: {
348
+ type: 'string',
349
+ array: true,
350
+ optional: true,
351
+ description: 'Accepted file types for file upload fields',
352
+ },
353
+ maxFileSize: {
354
+ type: 'number',
355
+ optional: true,
356
+ description: 'Maximum file size in bytes',
357
+ },
358
+ maxFiles: {
359
+ type: 'number',
360
+ optional: true,
361
+ description: 'Maximum number of files allowed',
362
+ },
363
+
364
+ // Conditional logic
365
+ conditionalLogic: {
366
+ type: 'json',
367
+ optional: true,
368
+ description: 'Rules for showing/hiding field based on other answers',
369
+ },
370
+
371
+ // Display
372
+ width: {
373
+ type: 'string',
374
+ optional: true,
375
+ description: 'Field width: full, half, third, quarter',
376
+ examples: ['full', 'half', 'third', 'quarter'],
377
+ },
378
+ hidden: {
379
+ type: 'boolean',
380
+ optional: true,
381
+ description: 'Whether the field is hidden',
382
+ },
383
+
384
+ // Metadata
385
+ metadata: {
386
+ type: 'json',
387
+ optional: true,
388
+ description: 'Additional field configuration and metadata',
389
+ },
390
+ },
391
+
392
+ relationships: {
393
+ form: {
394
+ type: 'Form',
395
+ backref: 'fields',
396
+ description: 'Parent form',
397
+ },
398
+ },
399
+
400
+ actions: [
401
+ 'create',
402
+ 'edit',
403
+ 'delete',
404
+ 'duplicate',
405
+ 'move',
406
+ 'hide',
407
+ 'show',
408
+ 'setRequired',
409
+ 'setOptional',
410
+ 'addOption',
411
+ 'removeOption',
412
+ 'reorderOptions',
413
+ 'setValidation',
414
+ ],
415
+
416
+ events: [
417
+ 'created',
418
+ 'edited',
419
+ 'deleted',
420
+ 'duplicated',
421
+ 'moved',
422
+ 'hidden',
423
+ 'shown',
424
+ 'requiredChanged',
425
+ 'optionAdded',
426
+ 'optionRemoved',
427
+ 'optionsReordered',
428
+ 'validationChanged',
429
+ ],
430
+ }
431
+
432
+ /**
433
+ * FormResponse entity
434
+ *
435
+ * Represents a submission/response to a form.
436
+ */
437
+ export const FormResponse: Noun = {
438
+ singular: 'form response',
439
+ plural: 'form responses',
440
+ description: 'A submitted response to a form',
441
+
442
+ properties: {
443
+ // Response data
444
+ answers: {
445
+ type: 'json',
446
+ description: 'Field answers as key-value pairs',
447
+ },
448
+ completionTime: {
449
+ type: 'number',
450
+ optional: true,
451
+ description: 'Time taken to complete the form in seconds',
452
+ },
453
+
454
+ // Status
455
+ status: {
456
+ type: 'string',
457
+ description: 'Response status: draft, completed, verified, flagged',
458
+ examples: ['draft', 'completed', 'verified', 'flagged'],
459
+ },
460
+ completed: {
461
+ type: 'boolean',
462
+ description: 'Whether the response is fully completed',
463
+ },
464
+
465
+ // Respondent info
466
+ respondentEmail: {
467
+ type: 'string',
468
+ optional: true,
469
+ description: 'Email address of the respondent',
470
+ },
471
+ respondentName: {
472
+ type: 'string',
473
+ optional: true,
474
+ description: 'Name of the respondent',
475
+ },
476
+ respondentId: {
477
+ type: 'string',
478
+ optional: true,
479
+ description: 'ID of authenticated respondent',
480
+ },
481
+
482
+ // Metadata
483
+ ipAddress: {
484
+ type: 'string',
485
+ optional: true,
486
+ description: 'IP address of submission',
487
+ },
488
+ userAgent: {
489
+ type: 'string',
490
+ optional: true,
491
+ description: 'Browser user agent string',
492
+ },
493
+ referrer: {
494
+ type: 'url',
495
+ optional: true,
496
+ description: 'Referrer URL',
497
+ },
498
+ source: {
499
+ type: 'string',
500
+ optional: true,
501
+ description: 'Source of the response: web, email, api, embed',
502
+ examples: ['web', 'email', 'api', 'embed', 'mobile'],
503
+ },
504
+ device: {
505
+ type: 'string',
506
+ optional: true,
507
+ description: 'Device type: desktop, mobile, tablet',
508
+ examples: ['desktop', 'mobile', 'tablet'],
509
+ },
510
+
511
+ // Tracking
512
+ startedAt: {
513
+ type: 'datetime',
514
+ optional: true,
515
+ description: 'When the respondent started filling the form',
516
+ },
517
+ submittedAt: {
518
+ type: 'datetime',
519
+ description: 'When the response was submitted',
520
+ },
521
+
522
+ // Processing
523
+ score: {
524
+ type: 'number',
525
+ optional: true,
526
+ description: 'Calculated score if applicable',
527
+ },
528
+ tags: {
529
+ type: 'string',
530
+ array: true,
531
+ optional: true,
532
+ description: 'Tags applied to this response',
533
+ },
534
+ notes: {
535
+ type: 'string',
536
+ optional: true,
537
+ description: 'Internal notes about the response',
538
+ },
539
+ reviewed: {
540
+ type: 'boolean',
541
+ optional: true,
542
+ description: 'Whether the response has been reviewed',
543
+ },
544
+ reviewedBy: {
545
+ type: 'string',
546
+ optional: true,
547
+ description: 'User who reviewed the response',
548
+ },
549
+ reviewedAt: {
550
+ type: 'datetime',
551
+ optional: true,
552
+ description: 'When the response was reviewed',
553
+ },
554
+
555
+ // Integration
556
+ exported: {
557
+ type: 'boolean',
558
+ optional: true,
559
+ description: 'Whether the response has been exported',
560
+ },
561
+ webhookDelivered: {
562
+ type: 'boolean',
563
+ optional: true,
564
+ description: 'Whether webhook delivery succeeded',
565
+ },
566
+ },
567
+
568
+ relationships: {
569
+ form: {
570
+ type: 'Form',
571
+ backref: 'responses',
572
+ description: 'Form this response belongs to',
573
+ },
574
+ respondent: {
575
+ type: 'Contact',
576
+ required: false,
577
+ description: 'Contact record for the respondent',
578
+ },
579
+ attachments: {
580
+ type: 'Attachment[]',
581
+ description: 'Files uploaded with the response',
582
+ },
583
+ },
584
+
585
+ actions: [
586
+ 'submit',
587
+ 'save',
588
+ 'edit',
589
+ 'delete',
590
+ 'review',
591
+ 'flag',
592
+ 'unflag',
593
+ 'tag',
594
+ 'untag',
595
+ 'export',
596
+ 'print',
597
+ 'addNote',
598
+ 'verify',
599
+ ],
600
+
601
+ events: [
602
+ 'started',
603
+ 'saved',
604
+ 'submitted',
605
+ 'edited',
606
+ 'deleted',
607
+ 'reviewed',
608
+ 'flagged',
609
+ 'unflagged',
610
+ 'tagged',
611
+ 'exported',
612
+ 'verified',
613
+ ],
614
+ }
615
+
616
+ // =============================================================================
617
+ // Survey
618
+ // =============================================================================
619
+
620
+ /**
621
+ * Survey entity
622
+ *
623
+ * Represents a survey for collecting feedback, opinions, and research data.
624
+ * Surveys typically include conditional logic, branching, and analysis features.
625
+ */
626
+ export const Survey: Noun = {
627
+ singular: 'survey',
628
+ plural: 'surveys',
629
+ description: 'A survey for collecting feedback, opinions, and research data',
630
+
631
+ properties: {
632
+ // Identity
633
+ title: {
634
+ type: 'string',
635
+ description: 'Survey title',
636
+ },
637
+ description: {
638
+ type: 'string',
639
+ optional: true,
640
+ description: 'Survey description or purpose',
641
+ },
642
+ category: {
643
+ type: 'string',
644
+ optional: true,
645
+ description: 'Survey category: customer satisfaction, market research, feedback, poll, etc.',
646
+ examples: [
647
+ 'customer-satisfaction',
648
+ 'market-research',
649
+ 'employee-feedback',
650
+ 'product-feedback',
651
+ 'nps',
652
+ 'poll',
653
+ 'quiz',
654
+ ],
655
+ },
656
+
657
+ // Status
658
+ status: {
659
+ type: 'string',
660
+ description: 'Survey status: draft, active, paused, closed, archived',
661
+ examples: ['draft', 'active', 'paused', 'closed', 'archived'],
662
+ },
663
+
664
+ // Settings
665
+ anonymous: {
666
+ type: 'boolean',
667
+ optional: true,
668
+ description: 'Whether responses are anonymous',
669
+ },
670
+ allowMultipleResponses: {
671
+ type: 'boolean',
672
+ optional: true,
673
+ description: 'Whether users can submit multiple responses',
674
+ },
675
+ requireCompletion: {
676
+ type: 'boolean',
677
+ optional: true,
678
+ description: 'Whether partial responses are saved',
679
+ },
680
+ showProgress: {
681
+ type: 'boolean',
682
+ optional: true,
683
+ description: 'Whether to show progress indicator',
684
+ },
685
+ randomizeQuestions: {
686
+ type: 'boolean',
687
+ optional: true,
688
+ description: 'Whether to randomize question order',
689
+ },
690
+ allowBackNavigation: {
691
+ type: 'boolean',
692
+ optional: true,
693
+ description: 'Whether respondents can go back to previous questions',
694
+ },
695
+
696
+ // Pages/sections
697
+ pages: {
698
+ type: 'json',
699
+ optional: true,
700
+ description: 'Page/section configuration for multi-page surveys',
701
+ },
702
+ questionCount: {
703
+ type: 'number',
704
+ optional: true,
705
+ description: 'Total number of questions',
706
+ },
707
+
708
+ // Logic
709
+ branchingLogic: {
710
+ type: 'json',
711
+ optional: true,
712
+ description: 'Conditional branching and skip logic rules',
713
+ },
714
+ quotas: {
715
+ type: 'json',
716
+ optional: true,
717
+ description: 'Response quotas by segment or condition',
718
+ },
719
+
720
+ // Distribution
721
+ accessMode: {
722
+ type: 'string',
723
+ optional: true,
724
+ description: 'Access mode: public, private, invite-only',
725
+ examples: ['public', 'private', 'invite-only'],
726
+ },
727
+ distributionChannels: {
728
+ type: 'string',
729
+ array: true,
730
+ optional: true,
731
+ description: 'Channels where survey is distributed',
732
+ examples: ['email', 'web', 'social', 'embed', 'sms', 'qr-code'],
733
+ },
734
+
735
+ // Timing
736
+ estimatedTime: {
737
+ type: 'number',
738
+ optional: true,
739
+ description: 'Estimated completion time in minutes',
740
+ },
741
+ opensAt: {
742
+ type: 'datetime',
743
+ optional: true,
744
+ description: 'When the survey opens for responses',
745
+ },
746
+ closesAt: {
747
+ type: 'datetime',
748
+ optional: true,
749
+ description: 'When the survey closes',
750
+ },
751
+
752
+ // Responses
753
+ targetResponses: {
754
+ type: 'number',
755
+ optional: true,
756
+ description: 'Target number of responses',
757
+ },
758
+ responseCount: {
759
+ type: 'number',
760
+ optional: true,
761
+ description: 'Current number of responses',
762
+ },
763
+ completionRate: {
764
+ type: 'number',
765
+ optional: true,
766
+ description: 'Percentage of started surveys that were completed',
767
+ },
768
+
769
+ // Appearance
770
+ theme: {
771
+ type: 'json',
772
+ optional: true,
773
+ description: 'Visual theme and branding',
774
+ },
775
+ logo: {
776
+ type: 'url',
777
+ optional: true,
778
+ description: 'Logo URL',
779
+ },
780
+ language: {
781
+ type: 'string',
782
+ optional: true,
783
+ description: 'Primary language code',
784
+ },
785
+ languages: {
786
+ type: 'string',
787
+ array: true,
788
+ optional: true,
789
+ description: 'Supported languages for multi-lingual surveys',
790
+ },
791
+
792
+ // Incentives
793
+ incentive: {
794
+ type: 'json',
795
+ optional: true,
796
+ description: 'Incentive configuration for completion',
797
+ },
798
+
799
+ // Metadata
800
+ tags: {
801
+ type: 'string',
802
+ array: true,
803
+ optional: true,
804
+ description: 'Tags for categorizing the survey',
805
+ },
806
+ },
807
+
808
+ relationships: {
809
+ questions: {
810
+ type: 'SurveyQuestion[]',
811
+ backref: 'survey',
812
+ description: 'Questions in this survey',
813
+ },
814
+ responses: {
815
+ type: 'SurveyResponse[]',
816
+ backref: 'survey',
817
+ description: 'Responses submitted to this survey',
818
+ },
819
+ owner: {
820
+ type: 'Contact',
821
+ description: 'Owner of the survey',
822
+ },
823
+ collaborators: {
824
+ type: 'Contact[]',
825
+ description: 'People with edit access',
826
+ },
827
+ },
828
+
829
+ actions: [
830
+ 'create',
831
+ 'edit',
832
+ 'duplicate',
833
+ 'activate',
834
+ 'pause',
835
+ 'close',
836
+ 'archive',
837
+ 'delete',
838
+ 'addQuestion',
839
+ 'removeQuestion',
840
+ 'reorderQuestions',
841
+ 'addPage',
842
+ 'removePage',
843
+ 'setBranching',
844
+ 'share',
845
+ 'distribute',
846
+ 'export',
847
+ 'analyze',
848
+ 'preview',
849
+ ],
850
+
851
+ events: [
852
+ 'created',
853
+ 'edited',
854
+ 'duplicated',
855
+ 'activated',
856
+ 'paused',
857
+ 'closed',
858
+ 'archived',
859
+ 'deleted',
860
+ 'questionAdded',
861
+ 'questionRemoved',
862
+ 'questionsReordered',
863
+ 'pageAdded',
864
+ 'pageRemoved',
865
+ 'branchingSet',
866
+ 'shared',
867
+ 'distributed',
868
+ 'responseReceived',
869
+ 'targetReached',
870
+ ],
871
+ }
872
+
873
+ /**
874
+ * SurveyQuestion entity
875
+ *
876
+ * Represents a single question within a survey.
877
+ */
878
+ export const SurveyQuestion: Noun = {
879
+ singular: 'survey question',
880
+ plural: 'survey questions',
881
+ description: 'A question within a survey',
882
+
883
+ properties: {
884
+ // Identity
885
+ text: {
886
+ type: 'string',
887
+ description: 'Question text',
888
+ },
889
+ description: {
890
+ type: 'string',
891
+ optional: true,
892
+ description: 'Additional context or instructions',
893
+ },
894
+ code: {
895
+ type: 'string',
896
+ optional: true,
897
+ description: 'Question code for analysis',
898
+ },
899
+
900
+ // Type
901
+ type: {
902
+ type: 'string',
903
+ description: 'Question type',
904
+ examples: [
905
+ 'multiple-choice',
906
+ 'checkbox',
907
+ 'dropdown',
908
+ 'rating',
909
+ 'scale',
910
+ 'matrix',
911
+ 'text',
912
+ 'textarea',
913
+ 'number',
914
+ 'email',
915
+ 'date',
916
+ 'ranking',
917
+ 'slider',
918
+ 'nps',
919
+ 'likert',
920
+ ],
921
+ },
922
+ subtype: {
923
+ type: 'string',
924
+ optional: true,
925
+ description: 'Question subtype for specific variations',
926
+ },
927
+
928
+ // Order and grouping
929
+ order: {
930
+ type: 'number',
931
+ description: 'Display order within the survey',
932
+ },
933
+ page: {
934
+ type: 'number',
935
+ optional: true,
936
+ description: 'Page number for multi-page surveys',
937
+ },
938
+ section: {
939
+ type: 'string',
940
+ optional: true,
941
+ description: 'Section identifier',
942
+ },
943
+
944
+ // Options
945
+ options: {
946
+ type: 'json',
947
+ optional: true,
948
+ description: 'Answer options for multiple choice, rating, etc.',
949
+ },
950
+ randomizeOptions: {
951
+ type: 'boolean',
952
+ optional: true,
953
+ description: 'Whether to randomize option order',
954
+ },
955
+ allowOther: {
956
+ type: 'boolean',
957
+ optional: true,
958
+ description: 'Whether to allow "Other" with text input',
959
+ },
960
+ allowMultiple: {
961
+ type: 'boolean',
962
+ optional: true,
963
+ description: 'Whether multiple selections are allowed',
964
+ },
965
+
966
+ // Validation
967
+ required: {
968
+ type: 'boolean',
969
+ optional: true,
970
+ description: 'Whether the question is required',
971
+ },
972
+ validation: {
973
+ type: 'json',
974
+ optional: true,
975
+ description: 'Validation rules',
976
+ },
977
+ minSelections: {
978
+ type: 'number',
979
+ optional: true,
980
+ description: 'Minimum number of selections required',
981
+ },
982
+ maxSelections: {
983
+ type: 'number',
984
+ optional: true,
985
+ description: 'Maximum number of selections allowed',
986
+ },
987
+
988
+ // Scale settings
989
+ scaleMin: {
990
+ type: 'number',
991
+ optional: true,
992
+ description: 'Minimum scale value',
993
+ },
994
+ scaleMax: {
995
+ type: 'number',
996
+ optional: true,
997
+ description: 'Maximum scale value',
998
+ },
999
+ scaleMinLabel: {
1000
+ type: 'string',
1001
+ optional: true,
1002
+ description: 'Label for minimum scale value',
1003
+ },
1004
+ scaleMaxLabel: {
1005
+ type: 'string',
1006
+ optional: true,
1007
+ description: 'Label for maximum scale value',
1008
+ },
1009
+
1010
+ // Logic
1011
+ skipLogic: {
1012
+ type: 'json',
1013
+ optional: true,
1014
+ description: 'Skip logic rules based on this answer',
1015
+ },
1016
+ displayLogic: {
1017
+ type: 'json',
1018
+ optional: true,
1019
+ description: 'Conditions for showing this question',
1020
+ },
1021
+ piping: {
1022
+ type: 'json',
1023
+ optional: true,
1024
+ description: 'Text piping configuration from other answers',
1025
+ },
1026
+
1027
+ // Media
1028
+ imageUrl: {
1029
+ type: 'url',
1030
+ optional: true,
1031
+ description: 'Image to display with the question',
1032
+ },
1033
+ videoUrl: {
1034
+ type: 'url',
1035
+ optional: true,
1036
+ description: 'Video to display with the question',
1037
+ },
1038
+
1039
+ // Metadata
1040
+ metadata: {
1041
+ type: 'json',
1042
+ optional: true,
1043
+ description: 'Additional question configuration',
1044
+ },
1045
+ },
1046
+
1047
+ relationships: {
1048
+ survey: {
1049
+ type: 'Survey',
1050
+ backref: 'questions',
1051
+ description: 'Parent survey',
1052
+ },
1053
+ },
1054
+
1055
+ actions: [
1056
+ 'create',
1057
+ 'edit',
1058
+ 'delete',
1059
+ 'duplicate',
1060
+ 'move',
1061
+ 'setRequired',
1062
+ 'setOptional',
1063
+ 'addOption',
1064
+ 'removeOption',
1065
+ 'reorderOptions',
1066
+ 'setSkipLogic',
1067
+ 'setDisplayLogic',
1068
+ ],
1069
+
1070
+ events: [
1071
+ 'created',
1072
+ 'edited',
1073
+ 'deleted',
1074
+ 'duplicated',
1075
+ 'moved',
1076
+ 'requiredChanged',
1077
+ 'optionAdded',
1078
+ 'optionRemoved',
1079
+ 'optionsReordered',
1080
+ 'skipLogicSet',
1081
+ 'displayLogicSet',
1082
+ ],
1083
+ }
1084
+
1085
+ /**
1086
+ * SurveyResponse entity
1087
+ *
1088
+ * Represents a submitted response to a survey.
1089
+ */
1090
+ export const SurveyResponse: Noun = {
1091
+ singular: 'survey response',
1092
+ plural: 'survey responses',
1093
+ description: 'A submitted response to a survey',
1094
+
1095
+ properties: {
1096
+ // Response data
1097
+ answers: {
1098
+ type: 'json',
1099
+ description: 'Question answers as key-value pairs',
1100
+ },
1101
+ metadata: {
1102
+ type: 'json',
1103
+ optional: true,
1104
+ description: 'Response metadata and tracking data',
1105
+ },
1106
+
1107
+ // Status
1108
+ status: {
1109
+ type: 'string',
1110
+ description: 'Response status: in-progress, completed, partial, disqualified',
1111
+ examples: ['in-progress', 'completed', 'partial', 'disqualified'],
1112
+ },
1113
+ completionProgress: {
1114
+ type: 'number',
1115
+ optional: true,
1116
+ description: 'Completion percentage (0-100)',
1117
+ },
1118
+
1119
+ // Timing
1120
+ startedAt: {
1121
+ type: 'datetime',
1122
+ description: 'When the respondent started the survey',
1123
+ },
1124
+ submittedAt: {
1125
+ type: 'datetime',
1126
+ optional: true,
1127
+ description: 'When the response was submitted',
1128
+ },
1129
+ duration: {
1130
+ type: 'number',
1131
+ optional: true,
1132
+ description: 'Time taken to complete in seconds',
1133
+ },
1134
+ lastActivityAt: {
1135
+ type: 'datetime',
1136
+ optional: true,
1137
+ description: 'Last interaction timestamp',
1138
+ },
1139
+
1140
+ // Respondent
1141
+ respondentEmail: {
1142
+ type: 'string',
1143
+ optional: true,
1144
+ description: 'Email address if not anonymous',
1145
+ },
1146
+ respondentName: {
1147
+ type: 'string',
1148
+ optional: true,
1149
+ description: 'Name if provided',
1150
+ },
1151
+ respondentId: {
1152
+ type: 'string',
1153
+ optional: true,
1154
+ description: 'Authenticated respondent ID',
1155
+ },
1156
+ anonymous: {
1157
+ type: 'boolean',
1158
+ description: 'Whether the response is anonymous',
1159
+ },
1160
+
1161
+ // Source tracking
1162
+ source: {
1163
+ type: 'string',
1164
+ optional: true,
1165
+ description: 'Response source',
1166
+ examples: ['email', 'web', 'social', 'embed', 'sms', 'qr-code', 'api'],
1167
+ },
1168
+ channel: {
1169
+ type: 'string',
1170
+ optional: true,
1171
+ description: 'Distribution channel identifier',
1172
+ },
1173
+ campaign: {
1174
+ type: 'string',
1175
+ optional: true,
1176
+ description: 'Campaign identifier',
1177
+ },
1178
+ referrer: {
1179
+ type: 'url',
1180
+ optional: true,
1181
+ description: 'Referrer URL',
1182
+ },
1183
+
1184
+ // Technical
1185
+ ipAddress: {
1186
+ type: 'string',
1187
+ optional: true,
1188
+ description: 'IP address',
1189
+ },
1190
+ userAgent: {
1191
+ type: 'string',
1192
+ optional: true,
1193
+ description: 'Browser user agent',
1194
+ },
1195
+ device: {
1196
+ type: 'string',
1197
+ optional: true,
1198
+ description: 'Device type: desktop, mobile, tablet',
1199
+ examples: ['desktop', 'mobile', 'tablet'],
1200
+ },
1201
+ location: {
1202
+ type: 'json',
1203
+ optional: true,
1204
+ description: 'Geographic location data',
1205
+ },
1206
+
1207
+ // Analysis
1208
+ segment: {
1209
+ type: 'string',
1210
+ optional: true,
1211
+ description: 'Respondent segment for analysis',
1212
+ },
1213
+ tags: {
1214
+ type: 'string',
1215
+ array: true,
1216
+ optional: true,
1217
+ description: 'Tags for categorization',
1218
+ },
1219
+ quality: {
1220
+ type: 'string',
1221
+ optional: true,
1222
+ description: 'Response quality score or flag',
1223
+ examples: ['high', 'medium', 'low', 'flagged', 'spam'],
1224
+ },
1225
+ notes: {
1226
+ type: 'string',
1227
+ optional: true,
1228
+ description: 'Internal notes',
1229
+ },
1230
+
1231
+ // Processing
1232
+ reviewed: {
1233
+ type: 'boolean',
1234
+ optional: true,
1235
+ description: 'Whether response has been reviewed',
1236
+ },
1237
+ exported: {
1238
+ type: 'boolean',
1239
+ optional: true,
1240
+ description: 'Whether response has been exported',
1241
+ },
1242
+ },
1243
+
1244
+ relationships: {
1245
+ survey: {
1246
+ type: 'Survey',
1247
+ backref: 'responses',
1248
+ description: 'Survey this response belongs to',
1249
+ },
1250
+ respondent: {
1251
+ type: 'Contact',
1252
+ required: false,
1253
+ description: 'Contact record for the respondent',
1254
+ },
1255
+ },
1256
+
1257
+ actions: [
1258
+ 'start',
1259
+ 'continue',
1260
+ 'submit',
1261
+ 'save',
1262
+ 'delete',
1263
+ 'review',
1264
+ 'flag',
1265
+ 'unflag',
1266
+ 'tag',
1267
+ 'untag',
1268
+ 'export',
1269
+ 'disqualify',
1270
+ ],
1271
+
1272
+ events: [
1273
+ 'started',
1274
+ 'saved',
1275
+ 'submitted',
1276
+ 'deleted',
1277
+ 'reviewed',
1278
+ 'flagged',
1279
+ 'unflagged',
1280
+ 'tagged',
1281
+ 'exported',
1282
+ 'disqualified',
1283
+ ],
1284
+ }
1285
+
1286
+ // =============================================================================
1287
+ // Quiz
1288
+ // =============================================================================
1289
+
1290
+ /**
1291
+ * Quiz entity
1292
+ *
1293
+ * Represents a quiz for testing knowledge with correct/incorrect answers and scoring.
1294
+ */
1295
+ export const Quiz: Noun = {
1296
+ singular: 'quiz',
1297
+ plural: 'quizzes',
1298
+ description: 'A quiz for testing knowledge with scoring and correct answers',
1299
+
1300
+ properties: {
1301
+ // Identity
1302
+ title: {
1303
+ type: 'string',
1304
+ description: 'Quiz title',
1305
+ },
1306
+ description: {
1307
+ type: 'string',
1308
+ optional: true,
1309
+ description: 'Quiz description or instructions',
1310
+ },
1311
+ category: {
1312
+ type: 'string',
1313
+ optional: true,
1314
+ description: 'Quiz category or subject',
1315
+ },
1316
+
1317
+ // Status
1318
+ status: {
1319
+ type: 'string',
1320
+ description: 'Quiz status: draft, published, archived',
1321
+ examples: ['draft', 'published', 'archived'],
1322
+ },
1323
+
1324
+ // Settings
1325
+ randomizeQuestions: {
1326
+ type: 'boolean',
1327
+ optional: true,
1328
+ description: 'Whether to randomize question order',
1329
+ },
1330
+ randomizeAnswers: {
1331
+ type: 'boolean',
1332
+ optional: true,
1333
+ description: 'Whether to randomize answer options',
1334
+ },
1335
+ showFeedback: {
1336
+ type: 'boolean',
1337
+ optional: true,
1338
+ description: 'Whether to show correct/incorrect feedback',
1339
+ },
1340
+ showCorrectAnswers: {
1341
+ type: 'boolean',
1342
+ optional: true,
1343
+ description: 'Whether to show correct answers after submission',
1344
+ },
1345
+ allowRetake: {
1346
+ type: 'boolean',
1347
+ optional: true,
1348
+ description: 'Whether users can retake the quiz',
1349
+ },
1350
+ maxAttempts: {
1351
+ type: 'number',
1352
+ optional: true,
1353
+ description: 'Maximum number of attempts allowed',
1354
+ },
1355
+ allowBackNavigation: {
1356
+ type: 'boolean',
1357
+ optional: true,
1358
+ description: 'Whether users can go back to previous questions',
1359
+ },
1360
+
1361
+ // Timing
1362
+ timeLimit: {
1363
+ type: 'number',
1364
+ optional: true,
1365
+ description: 'Time limit in seconds',
1366
+ },
1367
+ timeLimitPerQuestion: {
1368
+ type: 'number',
1369
+ optional: true,
1370
+ description: 'Time limit per question in seconds',
1371
+ },
1372
+ availableFrom: {
1373
+ type: 'datetime',
1374
+ optional: true,
1375
+ description: 'When quiz becomes available',
1376
+ },
1377
+ availableUntil: {
1378
+ type: 'datetime',
1379
+ optional: true,
1380
+ description: 'When quiz expires',
1381
+ },
1382
+
1383
+ // Structure
1384
+ questionCount: {
1385
+ type: 'number',
1386
+ optional: true,
1387
+ description: 'Total number of questions',
1388
+ },
1389
+ questionsPerPage: {
1390
+ type: 'number',
1391
+ optional: true,
1392
+ description: 'Number of questions per page',
1393
+ },
1394
+
1395
+ // Scoring
1396
+ totalPoints: {
1397
+ type: 'number',
1398
+ optional: true,
1399
+ description: 'Total points possible',
1400
+ },
1401
+ passingScore: {
1402
+ type: 'number',
1403
+ optional: true,
1404
+ description: 'Minimum score to pass (percentage or points)',
1405
+ },
1406
+ scoringType: {
1407
+ type: 'string',
1408
+ optional: true,
1409
+ description: 'Scoring method: points, percentage, letter-grade',
1410
+ examples: ['points', 'percentage', 'letter-grade'],
1411
+ },
1412
+ negativeMarking: {
1413
+ type: 'boolean',
1414
+ optional: true,
1415
+ description: 'Whether incorrect answers deduct points',
1416
+ },
1417
+ partialCredit: {
1418
+ type: 'boolean',
1419
+ optional: true,
1420
+ description: 'Whether partial credit is awarded',
1421
+ },
1422
+
1423
+ // Results
1424
+ showScore: {
1425
+ type: 'boolean',
1426
+ optional: true,
1427
+ description: 'Whether to show score to quiz takers',
1428
+ },
1429
+ certificateEnabled: {
1430
+ type: 'boolean',
1431
+ optional: true,
1432
+ description: 'Whether to generate completion certificate',
1433
+ },
1434
+ certificateTemplate: {
1435
+ type: 'string',
1436
+ optional: true,
1437
+ description: 'Certificate template ID',
1438
+ },
1439
+
1440
+ // Access
1441
+ accessMode: {
1442
+ type: 'string',
1443
+ optional: true,
1444
+ description: 'Access mode: public, private, password-protected',
1445
+ examples: ['public', 'private', 'password-protected'],
1446
+ },
1447
+ password: {
1448
+ type: 'string',
1449
+ optional: true,
1450
+ description: 'Password for protected quizzes',
1451
+ },
1452
+ requireAuthentication: {
1453
+ type: 'boolean',
1454
+ optional: true,
1455
+ description: 'Whether authentication is required',
1456
+ },
1457
+
1458
+ // Statistics
1459
+ attemptCount: {
1460
+ type: 'number',
1461
+ optional: true,
1462
+ description: 'Total number of attempts',
1463
+ },
1464
+ averageScore: {
1465
+ type: 'number',
1466
+ optional: true,
1467
+ description: 'Average score across all attempts',
1468
+ },
1469
+ passRate: {
1470
+ type: 'number',
1471
+ optional: true,
1472
+ description: 'Percentage of passing attempts',
1473
+ },
1474
+
1475
+ // Appearance
1476
+ theme: {
1477
+ type: 'json',
1478
+ optional: true,
1479
+ description: 'Visual theme and styling',
1480
+ },
1481
+ logo: {
1482
+ type: 'url',
1483
+ optional: true,
1484
+ description: 'Logo URL',
1485
+ },
1486
+
1487
+ // Metadata
1488
+ tags: {
1489
+ type: 'string',
1490
+ array: true,
1491
+ optional: true,
1492
+ description: 'Tags for categorization',
1493
+ },
1494
+ },
1495
+
1496
+ relationships: {
1497
+ questions: {
1498
+ type: 'QuizQuestion[]',
1499
+ backref: 'quiz',
1500
+ description: 'Questions in this quiz',
1501
+ },
1502
+ results: {
1503
+ type: 'QuizResult[]',
1504
+ backref: 'quiz',
1505
+ description: 'Results from quiz attempts',
1506
+ },
1507
+ owner: {
1508
+ type: 'Contact',
1509
+ description: 'Owner of the quiz',
1510
+ },
1511
+ collaborators: {
1512
+ type: 'Contact[]',
1513
+ description: 'People with edit access',
1514
+ },
1515
+ },
1516
+
1517
+ actions: [
1518
+ 'create',
1519
+ 'edit',
1520
+ 'duplicate',
1521
+ 'publish',
1522
+ 'unpublish',
1523
+ 'archive',
1524
+ 'delete',
1525
+ 'addQuestion',
1526
+ 'removeQuestion',
1527
+ 'reorderQuestions',
1528
+ 'share',
1529
+ 'export',
1530
+ 'import',
1531
+ 'preview',
1532
+ 'reset',
1533
+ ],
1534
+
1535
+ events: [
1536
+ 'created',
1537
+ 'edited',
1538
+ 'duplicated',
1539
+ 'published',
1540
+ 'unpublished',
1541
+ 'archived',
1542
+ 'deleted',
1543
+ 'questionAdded',
1544
+ 'questionRemoved',
1545
+ 'questionsReordered',
1546
+ 'shared',
1547
+ 'attempted',
1548
+ 'completed',
1549
+ ],
1550
+ }
1551
+
1552
+ /**
1553
+ * QuizQuestion entity
1554
+ *
1555
+ * Represents a question within a quiz with correct answer(s) and scoring.
1556
+ */
1557
+ export const QuizQuestion: Noun = {
1558
+ singular: 'quiz question',
1559
+ plural: 'quiz questions',
1560
+ description: 'A question within a quiz with correct answer and scoring',
1561
+
1562
+ properties: {
1563
+ // Identity
1564
+ text: {
1565
+ type: 'string',
1566
+ description: 'Question text',
1567
+ },
1568
+ description: {
1569
+ type: 'string',
1570
+ optional: true,
1571
+ description: 'Additional context or instructions',
1572
+ },
1573
+
1574
+ // Type
1575
+ type: {
1576
+ type: 'string',
1577
+ description: 'Question type',
1578
+ examples: [
1579
+ 'multiple-choice',
1580
+ 'multiple-select',
1581
+ 'true-false',
1582
+ 'short-answer',
1583
+ 'essay',
1584
+ 'fill-blank',
1585
+ 'matching',
1586
+ 'ordering',
1587
+ ],
1588
+ },
1589
+ order: {
1590
+ type: 'number',
1591
+ description: 'Display order within the quiz',
1592
+ },
1593
+ category: {
1594
+ type: 'string',
1595
+ optional: true,
1596
+ description: 'Question category for grouping',
1597
+ },
1598
+
1599
+ // Options and answers
1600
+ options: {
1601
+ type: 'json',
1602
+ optional: true,
1603
+ description: 'Answer options for multiple choice',
1604
+ },
1605
+ correctAnswers: {
1606
+ type: 'json',
1607
+ description: 'Correct answer(s) with metadata',
1608
+ },
1609
+ caseSensitive: {
1610
+ type: 'boolean',
1611
+ optional: true,
1612
+ description: 'Whether text answers are case sensitive',
1613
+ },
1614
+
1615
+ // Scoring
1616
+ points: {
1617
+ type: 'number',
1618
+ optional: true,
1619
+ description: 'Points awarded for correct answer',
1620
+ },
1621
+ negativePoints: {
1622
+ type: 'number',
1623
+ optional: true,
1624
+ description: 'Points deducted for incorrect answer',
1625
+ },
1626
+ partialCreditRules: {
1627
+ type: 'json',
1628
+ optional: true,
1629
+ description: 'Rules for awarding partial credit',
1630
+ },
1631
+
1632
+ // Difficulty
1633
+ difficulty: {
1634
+ type: 'string',
1635
+ optional: true,
1636
+ description: 'Question difficulty level',
1637
+ examples: ['easy', 'medium', 'hard'],
1638
+ },
1639
+
1640
+ // Feedback
1641
+ correctFeedback: {
1642
+ type: 'string',
1643
+ optional: true,
1644
+ description: 'Feedback shown for correct answers',
1645
+ },
1646
+ incorrectFeedback: {
1647
+ type: 'string',
1648
+ optional: true,
1649
+ description: 'Feedback shown for incorrect answers',
1650
+ },
1651
+ explanation: {
1652
+ type: 'string',
1653
+ optional: true,
1654
+ description: 'Detailed explanation of the correct answer',
1655
+ },
1656
+
1657
+ // Media
1658
+ imageUrl: {
1659
+ type: 'url',
1660
+ optional: true,
1661
+ description: 'Image to display with the question',
1662
+ },
1663
+ videoUrl: {
1664
+ type: 'url',
1665
+ optional: true,
1666
+ description: 'Video to display with the question',
1667
+ },
1668
+ audioUrl: {
1669
+ type: 'url',
1670
+ optional: true,
1671
+ description: 'Audio to play with the question',
1672
+ },
1673
+
1674
+ // Settings
1675
+ required: {
1676
+ type: 'boolean',
1677
+ optional: true,
1678
+ description: 'Whether the question must be answered',
1679
+ },
1680
+ randomizeOptions: {
1681
+ type: 'boolean',
1682
+ optional: true,
1683
+ description: 'Whether to randomize option order',
1684
+ },
1685
+ timeLimit: {
1686
+ type: 'number',
1687
+ optional: true,
1688
+ description: 'Time limit for this question in seconds',
1689
+ },
1690
+
1691
+ // Statistics
1692
+ timesAnswered: {
1693
+ type: 'number',
1694
+ optional: true,
1695
+ description: 'Number of times this question was answered',
1696
+ },
1697
+ correctRate: {
1698
+ type: 'number',
1699
+ optional: true,
1700
+ description: 'Percentage of correct answers',
1701
+ },
1702
+ averageTime: {
1703
+ type: 'number',
1704
+ optional: true,
1705
+ description: 'Average time to answer in seconds',
1706
+ },
1707
+
1708
+ // Metadata
1709
+ metadata: {
1710
+ type: 'json',
1711
+ optional: true,
1712
+ description: 'Additional question configuration',
1713
+ },
1714
+ },
1715
+
1716
+ relationships: {
1717
+ quiz: {
1718
+ type: 'Quiz',
1719
+ backref: 'questions',
1720
+ description: 'Parent quiz',
1721
+ },
1722
+ },
1723
+
1724
+ actions: [
1725
+ 'create',
1726
+ 'edit',
1727
+ 'delete',
1728
+ 'duplicate',
1729
+ 'move',
1730
+ 'setCorrectAnswer',
1731
+ 'addOption',
1732
+ 'removeOption',
1733
+ 'reorderOptions',
1734
+ 'setPoints',
1735
+ 'setFeedback',
1736
+ ],
1737
+
1738
+ events: [
1739
+ 'created',
1740
+ 'edited',
1741
+ 'deleted',
1742
+ 'duplicated',
1743
+ 'moved',
1744
+ 'correctAnswerSet',
1745
+ 'optionAdded',
1746
+ 'optionRemoved',
1747
+ 'optionsReordered',
1748
+ 'pointsSet',
1749
+ 'feedbackSet',
1750
+ ],
1751
+ }
1752
+
1753
+ /**
1754
+ * QuizResult entity
1755
+ *
1756
+ * Represents a completed quiz attempt with score and answers.
1757
+ */
1758
+ export const QuizResult: Noun = {
1759
+ singular: 'quiz result',
1760
+ plural: 'quiz results',
1761
+ description: 'A completed quiz attempt with score and detailed results',
1762
+
1763
+ properties: {
1764
+ // Score
1765
+ score: {
1766
+ type: 'number',
1767
+ description: 'Total score achieved',
1768
+ },
1769
+ maxScore: {
1770
+ type: 'number',
1771
+ description: 'Maximum possible score',
1772
+ },
1773
+ percentage: {
1774
+ type: 'number',
1775
+ description: 'Score as percentage (0-100)',
1776
+ },
1777
+ grade: {
1778
+ type: 'string',
1779
+ optional: true,
1780
+ description: 'Letter grade if applicable',
1781
+ },
1782
+ passed: {
1783
+ type: 'boolean',
1784
+ description: 'Whether the passing score was met',
1785
+ },
1786
+
1787
+ // Answers
1788
+ answers: {
1789
+ type: 'json',
1790
+ description: 'Question answers with correctness',
1791
+ },
1792
+ correctCount: {
1793
+ type: 'number',
1794
+ description: 'Number of correct answers',
1795
+ },
1796
+ incorrectCount: {
1797
+ type: 'number',
1798
+ description: 'Number of incorrect answers',
1799
+ },
1800
+ skippedCount: {
1801
+ type: 'number',
1802
+ optional: true,
1803
+ description: 'Number of skipped questions',
1804
+ },
1805
+
1806
+ // Timing
1807
+ startedAt: {
1808
+ type: 'datetime',
1809
+ description: 'When the quiz was started',
1810
+ },
1811
+ completedAt: {
1812
+ type: 'datetime',
1813
+ description: 'When the quiz was completed',
1814
+ },
1815
+ duration: {
1816
+ type: 'number',
1817
+ description: 'Time taken to complete in seconds',
1818
+ },
1819
+ timePerQuestion: {
1820
+ type: 'json',
1821
+ optional: true,
1822
+ description: 'Time spent on each question',
1823
+ },
1824
+
1825
+ // Attempt
1826
+ attemptNumber: {
1827
+ type: 'number',
1828
+ description: 'Attempt number for this user',
1829
+ },
1830
+ isRetake: {
1831
+ type: 'boolean',
1832
+ description: 'Whether this is a retake',
1833
+ },
1834
+ previousBestScore: {
1835
+ type: 'number',
1836
+ optional: true,
1837
+ description: 'Best score from previous attempts',
1838
+ },
1839
+
1840
+ // Participant
1841
+ participantEmail: {
1842
+ type: 'string',
1843
+ optional: true,
1844
+ description: 'Email address of quiz taker',
1845
+ },
1846
+ participantName: {
1847
+ type: 'string',
1848
+ optional: true,
1849
+ description: 'Name of quiz taker',
1850
+ },
1851
+ participantId: {
1852
+ type: 'string',
1853
+ optional: true,
1854
+ description: 'Authenticated user ID',
1855
+ },
1856
+
1857
+ // Certification
1858
+ certificateIssued: {
1859
+ type: 'boolean',
1860
+ optional: true,
1861
+ description: 'Whether a certificate was issued',
1862
+ },
1863
+ certificateUrl: {
1864
+ type: 'url',
1865
+ optional: true,
1866
+ description: 'URL to download certificate',
1867
+ },
1868
+ certificateId: {
1869
+ type: 'string',
1870
+ optional: true,
1871
+ description: 'Unique certificate identifier',
1872
+ },
1873
+
1874
+ // Analysis
1875
+ strengthAreas: {
1876
+ type: 'string',
1877
+ array: true,
1878
+ optional: true,
1879
+ description: 'Categories where participant performed well',
1880
+ },
1881
+ improvementAreas: {
1882
+ type: 'string',
1883
+ array: true,
1884
+ optional: true,
1885
+ description: 'Categories needing improvement',
1886
+ },
1887
+ percentile: {
1888
+ type: 'number',
1889
+ optional: true,
1890
+ description: 'Percentile rank compared to other attempts',
1891
+ },
1892
+
1893
+ // Technical
1894
+ ipAddress: {
1895
+ type: 'string',
1896
+ optional: true,
1897
+ description: 'IP address',
1898
+ },
1899
+ userAgent: {
1900
+ type: 'string',
1901
+ optional: true,
1902
+ description: 'Browser user agent',
1903
+ },
1904
+ device: {
1905
+ type: 'string',
1906
+ optional: true,
1907
+ description: 'Device type: desktop, mobile, tablet',
1908
+ examples: ['desktop', 'mobile', 'tablet'],
1909
+ },
1910
+
1911
+ // Review
1912
+ reviewed: {
1913
+ type: 'boolean',
1914
+ optional: true,
1915
+ description: 'Whether result has been reviewed by instructor',
1916
+ },
1917
+ reviewedBy: {
1918
+ type: 'string',
1919
+ optional: true,
1920
+ description: 'Instructor who reviewed the result',
1921
+ },
1922
+ reviewNotes: {
1923
+ type: 'string',
1924
+ optional: true,
1925
+ description: 'Instructor notes',
1926
+ },
1927
+ manualScore: {
1928
+ type: 'number',
1929
+ optional: true,
1930
+ description: 'Manually adjusted score if applicable',
1931
+ },
1932
+
1933
+ // Flags
1934
+ flagged: {
1935
+ type: 'boolean',
1936
+ optional: true,
1937
+ description: 'Whether result is flagged for review',
1938
+ },
1939
+ flagReason: {
1940
+ type: 'string',
1941
+ optional: true,
1942
+ description: 'Reason for flagging',
1943
+ },
1944
+ cheatingDetected: {
1945
+ type: 'boolean',
1946
+ optional: true,
1947
+ description: 'Whether potential cheating was detected',
1948
+ },
1949
+ },
1950
+
1951
+ relationships: {
1952
+ quiz: {
1953
+ type: 'Quiz',
1954
+ backref: 'results',
1955
+ description: 'Quiz this result belongs to',
1956
+ },
1957
+ participant: {
1958
+ type: 'Contact',
1959
+ required: false,
1960
+ description: 'Contact record for the quiz taker',
1961
+ },
1962
+ },
1963
+
1964
+ actions: [
1965
+ 'view',
1966
+ 'export',
1967
+ 'print',
1968
+ 'downloadCertificate',
1969
+ 'review',
1970
+ 'flag',
1971
+ 'unflag',
1972
+ 'adjustScore',
1973
+ 'delete',
1974
+ 'retake',
1975
+ ],
1976
+
1977
+ events: [
1978
+ 'completed',
1979
+ 'exported',
1980
+ 'printed',
1981
+ 'certificateDownloaded',
1982
+ 'reviewed',
1983
+ 'flagged',
1984
+ 'unflagged',
1985
+ 'scoreAdjusted',
1986
+ 'deleted',
1987
+ ],
1988
+ }
1989
+
1990
+ // =============================================================================
1991
+ // Export all entities as a schema
1992
+ // =============================================================================
1993
+
1994
+ /**
1995
+ * All forms and survey entity types
1996
+ */
1997
+ export const FormsEntities = {
1998
+ // Forms
1999
+ Form,
2000
+ FormField,
2001
+ FormResponse,
2002
+
2003
+ // Surveys
2004
+ Survey,
2005
+ SurveyQuestion,
2006
+ SurveyResponse,
2007
+
2008
+ // Quizzes
2009
+ Quiz,
2010
+ QuizQuestion,
2011
+ QuizResult,
2012
+ }
2013
+
2014
+ /**
2015
+ * Entity categories for organization
2016
+ */
2017
+ export const FormsCategories = {
2018
+ forms: ['Form', 'FormField', 'FormResponse'],
2019
+ surveys: ['Survey', 'SurveyQuestion', 'SurveyResponse'],
2020
+ quizzes: ['Quiz', 'QuizQuestion', 'QuizResult'],
2021
+ } as const