digital-tools 2.1.3 → 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 (294) hide show
  1. package/CHANGELOG.md +9 -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 +21 -11
  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 +31 -14
  132. package/src/client.ts +136 -0
  133. package/src/define.ts +30 -24
  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 -4
  199. package/LICENSE +0 -21
  200. package/dist/providers/voice/vapi.d.ts +0 -27
  201. package/dist/providers/voice/vapi.d.ts.map +0 -1
  202. package/dist/providers/voice/vapi.js +0 -440
  203. package/dist/providers/voice/vapi.js.map +0 -1
  204. package/src/define.js +0 -259
  205. package/src/entities/advertising.js +0 -999
  206. package/src/entities/ai.js +0 -756
  207. package/src/entities/analytics.js +0 -1588
  208. package/src/entities/automation.js +0 -601
  209. package/src/entities/communication.js +0 -1150
  210. package/src/entities/crm.js +0 -1386
  211. package/src/entities/design.js +0 -546
  212. package/src/entities/development.js +0 -2212
  213. package/src/entities/document.js +0 -874
  214. package/src/entities/ecommerce.js +0 -1429
  215. package/src/entities/experiment.js +0 -1039
  216. package/src/entities/finance.js +0 -3478
  217. package/src/entities/forms.js +0 -1892
  218. package/src/entities/hr.js +0 -661
  219. package/src/entities/identity.js +0 -997
  220. package/src/entities/index.js +0 -282
  221. package/src/entities/infrastructure.js +0 -1153
  222. package/src/entities/knowledge.js +0 -1438
  223. package/src/entities/marketing.js +0 -1610
  224. package/src/entities/media.js +0 -1634
  225. package/src/entities/notification.js +0 -1199
  226. package/src/entities/presentation.js +0 -1274
  227. package/src/entities/productivity.js +0 -1317
  228. package/src/entities/project-management.js +0 -1136
  229. package/src/entities/recruiting.js +0 -736
  230. package/src/entities/shipping.js +0 -509
  231. package/src/entities/signature.js +0 -1102
  232. package/src/entities/site.js +0 -222
  233. package/src/entities/spreadsheet.js +0 -1341
  234. package/src/entities/storage.js +0 -1198
  235. package/src/entities/support.js +0 -1166
  236. package/src/entities/video-conferencing.js +0 -1750
  237. package/src/entities/video.js +0 -950
  238. package/src/entities.js +0 -1663
  239. package/src/index.js +0 -74
  240. package/src/providers/analytics/index.js +0 -17
  241. package/src/providers/analytics/mixpanel.js +0 -255
  242. package/src/providers/calendar/cal-com.js +0 -303
  243. package/src/providers/calendar/google-calendar.js +0 -335
  244. package/src/providers/calendar/index.js +0 -20
  245. package/src/providers/crm/hubspot.js +0 -566
  246. package/src/providers/crm/index.js +0 -17
  247. package/src/providers/development/github.js +0 -472
  248. package/src/providers/development/index.js +0 -17
  249. package/src/providers/ecommerce/index.js +0 -17
  250. package/src/providers/ecommerce/shopify.js +0 -378
  251. package/src/providers/email/index.js +0 -20
  252. package/src/providers/email/resend.js +0 -258
  253. package/src/providers/email/sendgrid.js +0 -161
  254. package/src/providers/finance/index.js +0 -17
  255. package/src/providers/finance/stripe.js +0 -549
  256. package/src/providers/forms/index.js +0 -17
  257. package/src/providers/forms/typeform.js +0 -500
  258. package/src/providers/index.js +0 -123
  259. package/src/providers/knowledge/index.js +0 -17
  260. package/src/providers/knowledge/notion.js +0 -389
  261. package/src/providers/marketing/index.js +0 -17
  262. package/src/providers/marketing/mailchimp.js +0 -443
  263. package/src/providers/media/cloudinary.js +0 -318
  264. package/src/providers/media/index.js +0 -17
  265. package/src/providers/messaging/index.js +0 -20
  266. package/src/providers/messaging/slack.js +0 -393
  267. package/src/providers/messaging/twilio-sms.js +0 -249
  268. package/src/providers/project-management/index.js +0 -17
  269. package/src/providers/project-management/linear.js +0 -575
  270. package/src/providers/registry.js +0 -86
  271. package/src/providers/spreadsheet/google-sheets.js +0 -375
  272. package/src/providers/spreadsheet/index.js +0 -20
  273. package/src/providers/spreadsheet/xlsx.js +0 -423
  274. package/src/providers/storage/index.js +0 -24
  275. package/src/providers/storage/s3.js +0 -419
  276. package/src/providers/support/index.js +0 -17
  277. package/src/providers/support/zendesk.js +0 -373
  278. package/src/providers/tasks/index.js +0 -17
  279. package/src/providers/tasks/todoist.js +0 -286
  280. package/src/providers/types.js +0 -9
  281. package/src/providers/video-conferencing/google-meet.js +0 -286
  282. package/src/providers/video-conferencing/index.js +0 -31
  283. package/src/providers/video-conferencing/jitsi.js +0 -254
  284. package/src/providers/video-conferencing/teams.js +0 -270
  285. package/src/providers/video-conferencing/zoom.js +0 -332
  286. package/src/registry.js +0 -128
  287. package/src/tools/communication.js +0 -184
  288. package/src/tools/data.js +0 -205
  289. package/src/tools/index.js +0 -11
  290. package/src/tools/web.js +0 -137
  291. package/src/types.js +0 -10
  292. package/test/define.test.js +0 -306
  293. package/test/registry.test.js +0 -357
  294. package/test/tools.test.js +0 -363
@@ -0,0 +1,623 @@
1
+ /**
2
+ * Tests for Entity Type Definitions
3
+ *
4
+ * Covers all entity types (Nouns) defined for digital tools.
5
+ */
6
+
7
+ import { describe, it, expect } from 'vitest'
8
+ import {
9
+ // Email
10
+ Email,
11
+ EmailThread,
12
+
13
+ // Spreadsheet
14
+ Spreadsheet,
15
+ Sheet,
16
+ Cell,
17
+
18
+ // Document
19
+ Document,
20
+
21
+ // Presentation
22
+ Presentation,
23
+ Slide,
24
+
25
+ // Phone
26
+ PhoneCall,
27
+ Voicemail,
28
+
29
+ // Team Messaging
30
+ Workspace,
31
+ Channel,
32
+ Message,
33
+ Thread,
34
+ DirectMessage,
35
+ Member,
36
+ Reaction,
37
+
38
+ // Supporting
39
+ Attachment,
40
+ Contact,
41
+ Comment,
42
+ Revision,
43
+
44
+ // Collections
45
+ DigitalToolEntities,
46
+ DigitalToolCategories,
47
+ } from '../src/entities.js'
48
+
49
+ describe('Email Entities', () => {
50
+ describe('Email', () => {
51
+ it('has correct noun definition', () => {
52
+ expect(Email.singular).toBe('email')
53
+ expect(Email.plural).toBe('emails')
54
+ expect(Email.description).toBeDefined()
55
+ })
56
+
57
+ it('has required properties', () => {
58
+ expect(Email.properties).toHaveProperty('messageId')
59
+ expect(Email.properties).toHaveProperty('from')
60
+ expect(Email.properties).toHaveProperty('to')
61
+ expect(Email.properties).toHaveProperty('subject')
62
+ expect(Email.properties).toHaveProperty('body')
63
+ expect(Email.properties).toHaveProperty('status')
64
+ })
65
+
66
+ it('has optional addressing properties', () => {
67
+ expect(Email.properties.cc?.optional).toBe(true)
68
+ expect(Email.properties.bcc?.optional).toBe(true)
69
+ expect(Email.properties.replyTo?.optional).toBe(true)
70
+ })
71
+
72
+ it('has threading properties', () => {
73
+ expect(Email.properties).toHaveProperty('inReplyTo')
74
+ expect(Email.properties).toHaveProperty('references')
75
+ expect(Email.properties).toHaveProperty('threadId')
76
+ })
77
+
78
+ it('defines relationships', () => {
79
+ expect(Email.relationships).toHaveProperty('attachments')
80
+ expect(Email.relationships).toHaveProperty('sender')
81
+ expect(Email.relationships).toHaveProperty('recipients')
82
+ expect(Email.relationships).toHaveProperty('thread')
83
+ })
84
+
85
+ it('has standard email actions', () => {
86
+ expect(Email.actions).toContain('compose')
87
+ expect(Email.actions).toContain('send')
88
+ expect(Email.actions).toContain('reply')
89
+ expect(Email.actions).toContain('replyAll')
90
+ expect(Email.actions).toContain('forward')
91
+ expect(Email.actions).toContain('archive')
92
+ expect(Email.actions).toContain('delete')
93
+ })
94
+
95
+ it('has email events', () => {
96
+ expect(Email.events).toContain('sent')
97
+ expect(Email.events).toContain('delivered')
98
+ expect(Email.events).toContain('opened')
99
+ expect(Email.events).toContain('bounced')
100
+ })
101
+ })
102
+
103
+ describe('EmailThread', () => {
104
+ it('has correct noun definition', () => {
105
+ expect(EmailThread.singular).toBe('email thread')
106
+ expect(EmailThread.plural).toBe('email threads')
107
+ })
108
+
109
+ it('has thread-specific properties', () => {
110
+ expect(EmailThread.properties).toHaveProperty('subject')
111
+ expect(EmailThread.properties).toHaveProperty('messageCount')
112
+ expect(EmailThread.properties).toHaveProperty('participants')
113
+ expect(EmailThread.properties).toHaveProperty('lastMessageAt')
114
+ })
115
+
116
+ it('has backref relationship to emails', () => {
117
+ expect(EmailThread.relationships?.emails?.backref).toBe('thread')
118
+ })
119
+ })
120
+ })
121
+
122
+ describe('Spreadsheet Entities', () => {
123
+ describe('Spreadsheet', () => {
124
+ it('has correct noun definition', () => {
125
+ expect(Spreadsheet.singular).toBe('spreadsheet')
126
+ expect(Spreadsheet.plural).toBe('spreadsheets')
127
+ })
128
+
129
+ it('has core properties', () => {
130
+ expect(Spreadsheet.properties).toHaveProperty('name')
131
+ expect(Spreadsheet.properties).toHaveProperty('format')
132
+ expect(Spreadsheet.properties).toHaveProperty('sheetCount')
133
+ })
134
+
135
+ it('has format examples', () => {
136
+ expect(Spreadsheet.properties.format?.examples).toContain('xlsx')
137
+ expect(Spreadsheet.properties.format?.examples).toContain('csv')
138
+ expect(Spreadsheet.properties.format?.examples).toContain('gsheet')
139
+ })
140
+
141
+ it('has sheet management actions', () => {
142
+ expect(Spreadsheet.actions).toContain('create')
143
+ expect(Spreadsheet.actions).toContain('addSheet')
144
+ expect(Spreadsheet.actions).toContain('removeSheet')
145
+ expect(Spreadsheet.actions).toContain('export')
146
+ })
147
+ })
148
+
149
+ describe('Sheet', () => {
150
+ it('has correct noun definition', () => {
151
+ expect(Sheet.singular).toBe('sheet')
152
+ expect(Sheet.plural).toBe('sheets')
153
+ })
154
+
155
+ it('has positional properties', () => {
156
+ expect(Sheet.properties).toHaveProperty('name')
157
+ expect(Sheet.properties).toHaveProperty('index')
158
+ expect(Sheet.properties).toHaveProperty('rowCount')
159
+ expect(Sheet.properties).toHaveProperty('columnCount')
160
+ })
161
+
162
+ it('has frozen row/column properties', () => {
163
+ expect(Sheet.properties.frozenRows?.optional).toBe(true)
164
+ expect(Sheet.properties.frozenColumns?.optional).toBe(true)
165
+ })
166
+
167
+ it('has backref to spreadsheet', () => {
168
+ expect(Sheet.relationships?.spreadsheet?.backref).toBe('sheets')
169
+ })
170
+ })
171
+
172
+ describe('Cell', () => {
173
+ it('has correct noun definition', () => {
174
+ expect(Cell.singular).toBe('cell')
175
+ expect(Cell.plural).toBe('cells')
176
+ })
177
+
178
+ it('has cell addressing properties', () => {
179
+ expect(Cell.properties).toHaveProperty('address')
180
+ expect(Cell.properties).toHaveProperty('row')
181
+ expect(Cell.properties).toHaveProperty('column')
182
+ })
183
+
184
+ it('has value and formula properties', () => {
185
+ expect(Cell.properties).toHaveProperty('value')
186
+ expect(Cell.properties).toHaveProperty('formula')
187
+ expect(Cell.properties).toHaveProperty('displayValue')
188
+ })
189
+
190
+ it('has data type examples', () => {
191
+ expect(Cell.properties.dataType?.examples).toContain('string')
192
+ expect(Cell.properties.dataType?.examples).toContain('number')
193
+ expect(Cell.properties.dataType?.examples).toContain('formula')
194
+ })
195
+ })
196
+ })
197
+
198
+ describe('Document Entity', () => {
199
+ it('has correct noun definition', () => {
200
+ expect(Document.singular).toBe('document')
201
+ expect(Document.plural).toBe('documents')
202
+ })
203
+
204
+ it('has content properties', () => {
205
+ expect(Document.properties).toHaveProperty('title')
206
+ expect(Document.properties).toHaveProperty('content')
207
+ expect(Document.properties).toHaveProperty('format')
208
+ })
209
+
210
+ it('has statistics properties', () => {
211
+ expect(Document.properties.wordCount?.optional).toBe(true)
212
+ expect(Document.properties.characterCount?.optional).toBe(true)
213
+ expect(Document.properties.pageCount?.optional).toBe(true)
214
+ })
215
+
216
+ it('has collaboration relationships', () => {
217
+ expect(Document.relationships).toHaveProperty('owner')
218
+ expect(Document.relationships).toHaveProperty('collaborators')
219
+ expect(Document.relationships).toHaveProperty('comments')
220
+ expect(Document.relationships).toHaveProperty('revisions')
221
+ })
222
+
223
+ it('has document workflow actions', () => {
224
+ expect(Document.actions).toContain('create')
225
+ expect(Document.actions).toContain('edit')
226
+ expect(Document.actions).toContain('comment')
227
+ expect(Document.actions).toContain('suggest')
228
+ expect(Document.actions).toContain('accept')
229
+ expect(Document.actions).toContain('reject')
230
+ })
231
+ })
232
+
233
+ describe('Presentation Entities', () => {
234
+ describe('Presentation', () => {
235
+ it('has correct noun definition', () => {
236
+ expect(Presentation.singular).toBe('presentation')
237
+ expect(Presentation.plural).toBe('presentations')
238
+ })
239
+
240
+ it('has presentation-specific properties', () => {
241
+ expect(Presentation.properties).toHaveProperty('slideCount')
242
+ expect(Presentation.properties).toHaveProperty('aspectRatio')
243
+ expect(Presentation.properties).toHaveProperty('theme')
244
+ })
245
+
246
+ it('has aspect ratio examples', () => {
247
+ expect(Presentation.properties.aspectRatio?.examples).toContain('16:9')
248
+ expect(Presentation.properties.aspectRatio?.examples).toContain('4:3')
249
+ })
250
+
251
+ it('has presentation actions', () => {
252
+ expect(Presentation.actions).toContain('present')
253
+ expect(Presentation.actions).toContain('addSlide')
254
+ expect(Presentation.actions).toContain('reorderSlides')
255
+ expect(Presentation.actions).toContain('applyTheme')
256
+ })
257
+ })
258
+
259
+ describe('Slide', () => {
260
+ it('has correct noun definition', () => {
261
+ expect(Slide.singular).toBe('slide')
262
+ expect(Slide.plural).toBe('slides')
263
+ })
264
+
265
+ it('has slide-specific properties', () => {
266
+ expect(Slide.properties).toHaveProperty('index')
267
+ expect(Slide.properties).toHaveProperty('layout')
268
+ expect(Slide.properties).toHaveProperty('notes')
269
+ })
270
+
271
+ it('has layout examples', () => {
272
+ expect(Slide.properties.layout?.examples).toContain('title')
273
+ expect(Slide.properties.layout?.examples).toContain('titleAndContent')
274
+ expect(Slide.properties.layout?.examples).toContain('blank')
275
+ })
276
+ })
277
+ })
278
+
279
+ describe('Phone Entities', () => {
280
+ describe('PhoneCall', () => {
281
+ it('has correct noun definition', () => {
282
+ expect(PhoneCall.singular).toBe('phone call')
283
+ expect(PhoneCall.plural).toBe('phone calls')
284
+ })
285
+
286
+ it('has call routing properties', () => {
287
+ expect(PhoneCall.properties).toHaveProperty('from')
288
+ expect(PhoneCall.properties).toHaveProperty('to')
289
+ expect(PhoneCall.properties).toHaveProperty('direction')
290
+ })
291
+
292
+ it('has call status tracking', () => {
293
+ expect(PhoneCall.properties).toHaveProperty('status')
294
+ expect(PhoneCall.properties.status?.examples).toContain('ringing')
295
+ expect(PhoneCall.properties.status?.examples).toContain('in-progress')
296
+ expect(PhoneCall.properties.status?.examples).toContain('completed')
297
+ })
298
+
299
+ it('has timing properties', () => {
300
+ expect(PhoneCall.properties).toHaveProperty('startedAt')
301
+ expect(PhoneCall.properties).toHaveProperty('answeredAt')
302
+ expect(PhoneCall.properties).toHaveProperty('endedAt')
303
+ expect(PhoneCall.properties).toHaveProperty('duration')
304
+ })
305
+
306
+ it('has recording properties', () => {
307
+ expect(PhoneCall.properties).toHaveProperty('recorded')
308
+ expect(PhoneCall.properties).toHaveProperty('recordingUrl')
309
+ expect(PhoneCall.properties).toHaveProperty('transcription')
310
+ })
311
+
312
+ it('has telephony actions', () => {
313
+ expect(PhoneCall.actions).toContain('dial')
314
+ expect(PhoneCall.actions).toContain('answer')
315
+ expect(PhoneCall.actions).toContain('hangup')
316
+ expect(PhoneCall.actions).toContain('hold')
317
+ expect(PhoneCall.actions).toContain('transfer')
318
+ })
319
+ })
320
+
321
+ describe('Voicemail', () => {
322
+ it('has correct noun definition', () => {
323
+ expect(Voicemail.singular).toBe('voicemail')
324
+ expect(Voicemail.plural).toBe('voicemails')
325
+ })
326
+
327
+ it('has voicemail properties', () => {
328
+ expect(Voicemail.properties).toHaveProperty('from')
329
+ expect(Voicemail.properties).toHaveProperty('duration')
330
+ expect(Voicemail.properties).toHaveProperty('audioUrl')
331
+ expect(Voicemail.properties).toHaveProperty('transcription')
332
+ expect(Voicemail.properties).toHaveProperty('read')
333
+ })
334
+ })
335
+ })
336
+
337
+ describe('Team Messaging Entities', () => {
338
+ describe('Workspace', () => {
339
+ it('has correct noun definition', () => {
340
+ expect(Workspace.singular).toBe('workspace')
341
+ expect(Workspace.plural).toBe('workspaces')
342
+ })
343
+
344
+ it('has workspace properties', () => {
345
+ expect(Workspace.properties).toHaveProperty('name')
346
+ expect(Workspace.properties).toHaveProperty('visibility')
347
+ expect(Workspace.properties).toHaveProperty('memberCount')
348
+ })
349
+
350
+ it('has visibility options', () => {
351
+ expect(Workspace.properties.visibility?.examples).toContain('public')
352
+ expect(Workspace.properties.visibility?.examples).toContain('private')
353
+ })
354
+
355
+ it('has workspace relationships', () => {
356
+ expect(Workspace.relationships).toHaveProperty('channels')
357
+ expect(Workspace.relationships).toHaveProperty('members')
358
+ })
359
+ })
360
+
361
+ describe('Channel', () => {
362
+ it('has correct noun definition', () => {
363
+ expect(Channel.singular).toBe('channel')
364
+ expect(Channel.plural).toBe('channels')
365
+ })
366
+
367
+ it('has channel properties', () => {
368
+ expect(Channel.properties).toHaveProperty('name')
369
+ expect(Channel.properties).toHaveProperty('topic')
370
+ expect(Channel.properties).toHaveProperty('visibility')
371
+ expect(Channel.properties).toHaveProperty('archived')
372
+ })
373
+
374
+ it('has backref to workspace', () => {
375
+ expect(Channel.relationships?.workspace?.backref).toBe('channels')
376
+ })
377
+
378
+ it('has channel actions', () => {
379
+ expect(Channel.actions).toContain('join')
380
+ expect(Channel.actions).toContain('leave')
381
+ expect(Channel.actions).toContain('archive')
382
+ expect(Channel.actions).toContain('mute')
383
+ })
384
+ })
385
+
386
+ describe('Message', () => {
387
+ it('has correct noun definition', () => {
388
+ expect(Message.singular).toBe('message')
389
+ expect(Message.plural).toBe('messages')
390
+ })
391
+
392
+ it('has message content properties', () => {
393
+ expect(Message.properties).toHaveProperty('text')
394
+ expect(Message.properties).toHaveProperty('richText')
395
+ })
396
+
397
+ it('has threading properties', () => {
398
+ expect(Message.properties).toHaveProperty('threadId')
399
+ expect(Message.properties).toHaveProperty('replyCount')
400
+ })
401
+
402
+ it('has editing properties', () => {
403
+ expect(Message.properties).toHaveProperty('edited')
404
+ expect(Message.properties).toHaveProperty('editedAt')
405
+ })
406
+
407
+ it('has message relationships', () => {
408
+ expect(Message.relationships).toHaveProperty('channel')
409
+ expect(Message.relationships).toHaveProperty('sender')
410
+ expect(Message.relationships).toHaveProperty('reactions')
411
+ })
412
+
413
+ it('has message actions', () => {
414
+ expect(Message.actions).toContain('send')
415
+ expect(Message.actions).toContain('edit')
416
+ expect(Message.actions).toContain('react')
417
+ expect(Message.actions).toContain('reply')
418
+ expect(Message.actions).toContain('pin')
419
+ })
420
+ })
421
+
422
+ describe('Thread', () => {
423
+ it('has correct noun definition', () => {
424
+ expect(Thread.singular).toBe('thread')
425
+ expect(Thread.plural).toBe('threads')
426
+ })
427
+
428
+ it('has thread statistics', () => {
429
+ expect(Thread.properties).toHaveProperty('replyCount')
430
+ expect(Thread.properties).toHaveProperty('participantCount')
431
+ expect(Thread.properties).toHaveProperty('lastReplyAt')
432
+ })
433
+ })
434
+
435
+ describe('DirectMessage', () => {
436
+ it('has correct noun definition', () => {
437
+ expect(DirectMessage.singular).toBe('direct message')
438
+ expect(DirectMessage.plural).toBe('direct messages')
439
+ })
440
+
441
+ it('has DM properties', () => {
442
+ expect(DirectMessage.properties).toHaveProperty('isGroup')
443
+ expect(DirectMessage.properties).toHaveProperty('lastMessageAt')
444
+ expect(DirectMessage.properties).toHaveProperty('unreadCount')
445
+ })
446
+ })
447
+
448
+ describe('Member', () => {
449
+ it('has correct noun definition', () => {
450
+ expect(Member.singular).toBe('member')
451
+ expect(Member.plural).toBe('members')
452
+ })
453
+
454
+ it('has member profile properties', () => {
455
+ expect(Member.properties).toHaveProperty('displayName')
456
+ expect(Member.properties).toHaveProperty('username')
457
+ expect(Member.properties).toHaveProperty('avatar')
458
+ expect(Member.properties).toHaveProperty('title')
459
+ })
460
+
461
+ it('has presence properties', () => {
462
+ expect(Member.properties).toHaveProperty('status')
463
+ expect(Member.properties).toHaveProperty('presence')
464
+ expect(Member.properties.presence?.examples).toContain('online')
465
+ expect(Member.properties.presence?.examples).toContain('away')
466
+ expect(Member.properties.presence?.examples).toContain('dnd')
467
+ })
468
+
469
+ it('has role property with examples', () => {
470
+ expect(Member.properties.role?.examples).toContain('owner')
471
+ expect(Member.properties.role?.examples).toContain('admin')
472
+ expect(Member.properties.role?.examples).toContain('member')
473
+ })
474
+ })
475
+
476
+ describe('Reaction', () => {
477
+ it('has correct noun definition', () => {
478
+ expect(Reaction.singular).toBe('reaction')
479
+ expect(Reaction.plural).toBe('reactions')
480
+ })
481
+
482
+ it('has reaction properties', () => {
483
+ expect(Reaction.properties).toHaveProperty('emoji')
484
+ expect(Reaction.properties).toHaveProperty('count')
485
+ })
486
+
487
+ it('has backref to message', () => {
488
+ expect(Reaction.relationships?.message?.backref).toBe('reactions')
489
+ })
490
+ })
491
+ })
492
+
493
+ describe('Supporting Entities', () => {
494
+ describe('Attachment', () => {
495
+ it('has correct noun definition', () => {
496
+ expect(Attachment.singular).toBe('attachment')
497
+ expect(Attachment.plural).toBe('attachments')
498
+ })
499
+
500
+ it('has file properties', () => {
501
+ expect(Attachment.properties).toHaveProperty('filename')
502
+ expect(Attachment.properties).toHaveProperty('mimeType')
503
+ expect(Attachment.properties).toHaveProperty('size')
504
+ expect(Attachment.properties).toHaveProperty('url')
505
+ })
506
+
507
+ it('has file actions', () => {
508
+ expect(Attachment.actions).toContain('upload')
509
+ expect(Attachment.actions).toContain('download')
510
+ expect(Attachment.actions).toContain('preview')
511
+ })
512
+ })
513
+
514
+ describe('Contact', () => {
515
+ it('has correct noun definition', () => {
516
+ expect(Contact.singular).toBe('contact')
517
+ expect(Contact.plural).toBe('contacts')
518
+ })
519
+
520
+ it('has contact information properties', () => {
521
+ expect(Contact.properties).toHaveProperty('name')
522
+ expect(Contact.properties).toHaveProperty('email')
523
+ expect(Contact.properties).toHaveProperty('phone')
524
+ expect(Contact.properties).toHaveProperty('company')
525
+ })
526
+ })
527
+
528
+ describe('Comment', () => {
529
+ it('has correct noun definition', () => {
530
+ expect(Comment.singular).toBe('comment')
531
+ expect(Comment.plural).toBe('comments')
532
+ })
533
+
534
+ it('has comment properties', () => {
535
+ expect(Comment.properties).toHaveProperty('text')
536
+ expect(Comment.properties).toHaveProperty('anchor')
537
+ expect(Comment.properties).toHaveProperty('resolved')
538
+ })
539
+
540
+ it('has backref to document', () => {
541
+ expect(Comment.relationships?.document?.backref).toBe('comments')
542
+ })
543
+ })
544
+
545
+ describe('Revision', () => {
546
+ it('has correct noun definition', () => {
547
+ expect(Revision.singular).toBe('revision')
548
+ expect(Revision.plural).toBe('revisions')
549
+ })
550
+
551
+ it('has version properties', () => {
552
+ expect(Revision.properties).toHaveProperty('version')
553
+ expect(Revision.properties).toHaveProperty('label')
554
+ expect(Revision.properties).toHaveProperty('changes')
555
+ })
556
+
557
+ it('has backref to document', () => {
558
+ expect(Revision.relationships?.document?.backref).toBe('revisions')
559
+ })
560
+ })
561
+ })
562
+
563
+ describe('Entity Collections', () => {
564
+ describe('DigitalToolEntities', () => {
565
+ it('contains all entity types', () => {
566
+ expect(DigitalToolEntities).toHaveProperty('Email')
567
+ expect(DigitalToolEntities).toHaveProperty('EmailThread')
568
+ expect(DigitalToolEntities).toHaveProperty('Spreadsheet')
569
+ expect(DigitalToolEntities).toHaveProperty('Sheet')
570
+ expect(DigitalToolEntities).toHaveProperty('Cell')
571
+ expect(DigitalToolEntities).toHaveProperty('Document')
572
+ expect(DigitalToolEntities).toHaveProperty('Presentation')
573
+ expect(DigitalToolEntities).toHaveProperty('Slide')
574
+ expect(DigitalToolEntities).toHaveProperty('PhoneCall')
575
+ expect(DigitalToolEntities).toHaveProperty('Voicemail')
576
+ expect(DigitalToolEntities).toHaveProperty('Workspace')
577
+ expect(DigitalToolEntities).toHaveProperty('Channel')
578
+ expect(DigitalToolEntities).toHaveProperty('Message')
579
+ expect(DigitalToolEntities).toHaveProperty('Thread')
580
+ expect(DigitalToolEntities).toHaveProperty('DirectMessage')
581
+ expect(DigitalToolEntities).toHaveProperty('Member')
582
+ expect(DigitalToolEntities).toHaveProperty('Reaction')
583
+ expect(DigitalToolEntities).toHaveProperty('Attachment')
584
+ expect(DigitalToolEntities).toHaveProperty('Contact')
585
+ expect(DigitalToolEntities).toHaveProperty('Comment')
586
+ expect(DigitalToolEntities).toHaveProperty('Revision')
587
+ })
588
+
589
+ it('has 21 entity types', () => {
590
+ expect(Object.keys(DigitalToolEntities)).toHaveLength(21)
591
+ })
592
+ })
593
+
594
+ describe('DigitalToolCategories', () => {
595
+ it('organizes entities by category', () => {
596
+ expect(DigitalToolCategories.email).toContain('Email')
597
+ expect(DigitalToolCategories.email).toContain('EmailThread')
598
+
599
+ expect(DigitalToolCategories.spreadsheet).toContain('Spreadsheet')
600
+ expect(DigitalToolCategories.spreadsheet).toContain('Sheet')
601
+ expect(DigitalToolCategories.spreadsheet).toContain('Cell')
602
+
603
+ expect(DigitalToolCategories.document).toContain('Document')
604
+
605
+ expect(DigitalToolCategories.presentation).toContain('Presentation')
606
+ expect(DigitalToolCategories.presentation).toContain('Slide')
607
+
608
+ expect(DigitalToolCategories.phone).toContain('PhoneCall')
609
+ expect(DigitalToolCategories.phone).toContain('Voicemail')
610
+
611
+ expect(DigitalToolCategories.messaging).toContain('Workspace')
612
+ expect(DigitalToolCategories.messaging).toContain('Channel')
613
+ expect(DigitalToolCategories.messaging).toContain('Message')
614
+
615
+ expect(DigitalToolCategories.shared).toContain('Attachment')
616
+ expect(DigitalToolCategories.shared).toContain('Contact')
617
+ })
618
+
619
+ it('has 7 categories', () => {
620
+ expect(Object.keys(DigitalToolCategories)).toHaveLength(7)
621
+ })
622
+ })
623
+ })