digital-tools 2.0.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -5
- package/CHANGELOG.md +25 -0
- package/LICENSE +21 -0
- package/dist/define.d.ts.map +1 -1
- package/dist/define.js +1 -9
- package/dist/define.js.map +1 -1
- package/package.json +14 -15
- package/src/define.js +259 -0
- package/src/define.ts +1 -13
- package/src/entities/advertising.js +999 -0
- package/src/entities/ai.js +756 -0
- package/src/entities/analytics.js +1588 -0
- package/src/entities/automation.js +601 -0
- package/src/entities/communication.js +1150 -0
- package/src/entities/crm.js +1386 -0
- package/src/entities/design.js +546 -0
- package/src/entities/development.js +2212 -0
- package/src/entities/document.js +874 -0
- package/src/entities/ecommerce.js +1429 -0
- package/src/entities/experiment.js +1039 -0
- package/src/entities/finance.js +3478 -0
- package/src/entities/forms.js +1892 -0
- package/src/entities/hr.js +661 -0
- package/src/entities/identity.js +997 -0
- package/src/entities/index.js +282 -0
- package/src/entities/infrastructure.js +1153 -0
- package/src/entities/knowledge.js +1438 -0
- package/src/entities/marketing.js +1610 -0
- package/src/entities/media.js +1634 -0
- package/src/entities/notification.js +1199 -0
- package/src/entities/presentation.js +1274 -0
- package/src/entities/productivity.js +1317 -0
- package/src/entities/project-management.js +1136 -0
- package/src/entities/recruiting.js +736 -0
- package/src/entities/shipping.js +509 -0
- package/src/entities/signature.js +1102 -0
- package/src/entities/site.js +222 -0
- package/src/entities/spreadsheet.js +1341 -0
- package/src/entities/storage.js +1198 -0
- package/src/entities/support.js +1166 -0
- package/src/entities/video-conferencing.js +1750 -0
- package/src/entities/video.js +950 -0
- package/src/entities.js +1663 -0
- package/src/index.js +74 -0
- package/src/providers/analytics/index.js +17 -0
- package/src/providers/analytics/mixpanel.js +255 -0
- package/src/providers/calendar/cal-com.js +303 -0
- package/src/providers/calendar/google-calendar.js +335 -0
- package/src/providers/calendar/index.js +20 -0
- package/src/providers/crm/hubspot.js +566 -0
- package/src/providers/crm/index.js +17 -0
- package/src/providers/development/github.js +472 -0
- package/src/providers/development/index.js +17 -0
- package/src/providers/ecommerce/index.js +17 -0
- package/src/providers/ecommerce/shopify.js +378 -0
- package/src/providers/email/index.js +20 -0
- package/src/providers/email/resend.js +258 -0
- package/src/providers/email/sendgrid.js +161 -0
- package/src/providers/finance/index.js +17 -0
- package/src/providers/finance/stripe.js +549 -0
- package/src/providers/forms/index.js +17 -0
- package/src/providers/forms/typeform.js +500 -0
- package/src/providers/index.js +123 -0
- package/src/providers/knowledge/index.js +17 -0
- package/src/providers/knowledge/notion.js +389 -0
- package/src/providers/marketing/index.js +17 -0
- package/src/providers/marketing/mailchimp.js +443 -0
- package/src/providers/media/cloudinary.js +318 -0
- package/src/providers/media/index.js +17 -0
- package/src/providers/messaging/index.js +20 -0
- package/src/providers/messaging/slack.js +393 -0
- package/src/providers/messaging/twilio-sms.js +249 -0
- package/src/providers/project-management/index.js +17 -0
- package/src/providers/project-management/linear.js +575 -0
- package/src/providers/registry.js +86 -0
- package/src/providers/spreadsheet/google-sheets.js +375 -0
- package/src/providers/spreadsheet/index.js +20 -0
- package/src/providers/spreadsheet/xlsx.js +423 -0
- package/src/providers/storage/index.js +24 -0
- package/src/providers/storage/s3.js +419 -0
- package/src/providers/support/index.js +17 -0
- package/src/providers/support/zendesk.js +373 -0
- package/src/providers/tasks/index.js +17 -0
- package/src/providers/tasks/todoist.js +286 -0
- package/src/providers/types.js +9 -0
- package/src/providers/video-conferencing/google-meet.js +286 -0
- package/src/providers/video-conferencing/index.js +31 -0
- package/src/providers/video-conferencing/jitsi.js +254 -0
- package/src/providers/video-conferencing/teams.js +270 -0
- package/src/providers/video-conferencing/zoom.js +332 -0
- package/src/registry.js +128 -0
- package/src/tools/communication.js +184 -0
- package/src/tools/data.js +205 -0
- package/src/tools/index.js +11 -0
- package/src/tools/web.js +137 -0
- package/src/types.js +10 -0
- package/test/define.test.js +306 -0
- package/test/registry.test.js +357 -0
- package/test/tools.test.js +363 -0
|
@@ -0,0 +1,874 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document Entity Types (Nouns)
|
|
3
|
+
*
|
|
4
|
+
* Semantic type definitions for word processing documents that support
|
|
5
|
+
* Google Docs, Microsoft Word/DOCX, and Markdown/MDX formats.
|
|
6
|
+
* Each entity defines:
|
|
7
|
+
* - Properties: The data fields
|
|
8
|
+
* - Actions: Operations that can be performed (Verbs)
|
|
9
|
+
* - Events: State changes that occur
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// Document
|
|
15
|
+
// =============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Document entity
|
|
18
|
+
*
|
|
19
|
+
* Represents a word processing document for creating and editing text content.
|
|
20
|
+
* Supports Google Docs, Microsoft Word/DOCX, and Markdown/MDX formats.
|
|
21
|
+
*/
|
|
22
|
+
export const Document = {
|
|
23
|
+
singular: 'document',
|
|
24
|
+
plural: 'documents',
|
|
25
|
+
description: 'A word processing document for creating and editing text content',
|
|
26
|
+
properties: {
|
|
27
|
+
// Identity
|
|
28
|
+
title: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'Document title',
|
|
31
|
+
},
|
|
32
|
+
slug: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
optional: true,
|
|
35
|
+
description: 'URL-friendly identifier',
|
|
36
|
+
},
|
|
37
|
+
description: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
optional: true,
|
|
40
|
+
description: 'Document description or summary',
|
|
41
|
+
},
|
|
42
|
+
// Content
|
|
43
|
+
content: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Document content in native format',
|
|
46
|
+
},
|
|
47
|
+
format: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Document format: docx, gdoc, markdown, mdx, html, plain',
|
|
50
|
+
examples: ['docx', 'gdoc', 'markdown', 'mdx', 'html', 'plain'],
|
|
51
|
+
},
|
|
52
|
+
wordCount: {
|
|
53
|
+
type: 'number',
|
|
54
|
+
optional: true,
|
|
55
|
+
description: 'Total word count',
|
|
56
|
+
},
|
|
57
|
+
characterCount: {
|
|
58
|
+
type: 'number',
|
|
59
|
+
optional: true,
|
|
60
|
+
description: 'Total character count',
|
|
61
|
+
},
|
|
62
|
+
pageCount: {
|
|
63
|
+
type: 'number',
|
|
64
|
+
optional: true,
|
|
65
|
+
description: 'Number of pages',
|
|
66
|
+
},
|
|
67
|
+
// Status and workflow
|
|
68
|
+
status: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
description: 'Document status: draft, in-review, approved, published, archived',
|
|
71
|
+
examples: ['draft', 'in-review', 'approved', 'published', 'archived'],
|
|
72
|
+
},
|
|
73
|
+
visibility: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
description: 'Visibility: private, internal, public',
|
|
76
|
+
examples: ['private', 'internal', 'public'],
|
|
77
|
+
},
|
|
78
|
+
// Versioning
|
|
79
|
+
version: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
optional: true,
|
|
82
|
+
description: 'Current version number',
|
|
83
|
+
},
|
|
84
|
+
versionNumber: {
|
|
85
|
+
type: 'number',
|
|
86
|
+
optional: true,
|
|
87
|
+
description: 'Numeric version counter',
|
|
88
|
+
},
|
|
89
|
+
majorVersion: {
|
|
90
|
+
type: 'number',
|
|
91
|
+
optional: true,
|
|
92
|
+
description: 'Major version number',
|
|
93
|
+
},
|
|
94
|
+
minorVersion: {
|
|
95
|
+
type: 'number',
|
|
96
|
+
optional: true,
|
|
97
|
+
description: 'Minor version number',
|
|
98
|
+
},
|
|
99
|
+
// Styling and formatting
|
|
100
|
+
pageSize: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
optional: true,
|
|
103
|
+
description: 'Page size: letter, a4, legal, custom',
|
|
104
|
+
examples: ['letter', 'a4', 'legal', 'custom'],
|
|
105
|
+
},
|
|
106
|
+
pageOrientation: {
|
|
107
|
+
type: 'string',
|
|
108
|
+
optional: true,
|
|
109
|
+
description: 'Page orientation: portrait, landscape',
|
|
110
|
+
examples: ['portrait', 'landscape'],
|
|
111
|
+
},
|
|
112
|
+
margins: {
|
|
113
|
+
type: 'json',
|
|
114
|
+
optional: true,
|
|
115
|
+
description: 'Page margins configuration',
|
|
116
|
+
},
|
|
117
|
+
defaultFont: {
|
|
118
|
+
type: 'string',
|
|
119
|
+
optional: true,
|
|
120
|
+
description: 'Default font family',
|
|
121
|
+
},
|
|
122
|
+
defaultFontSize: {
|
|
123
|
+
type: 'number',
|
|
124
|
+
optional: true,
|
|
125
|
+
description: 'Default font size in points',
|
|
126
|
+
},
|
|
127
|
+
lineSpacing: {
|
|
128
|
+
type: 'number',
|
|
129
|
+
optional: true,
|
|
130
|
+
description: 'Line spacing multiplier',
|
|
131
|
+
},
|
|
132
|
+
theme: {
|
|
133
|
+
type: 'json',
|
|
134
|
+
optional: true,
|
|
135
|
+
description: 'Document theme and styling configuration',
|
|
136
|
+
},
|
|
137
|
+
// Collaboration
|
|
138
|
+
allowComments: {
|
|
139
|
+
type: 'boolean',
|
|
140
|
+
optional: true,
|
|
141
|
+
description: 'Whether comments are enabled',
|
|
142
|
+
},
|
|
143
|
+
allowSuggestions: {
|
|
144
|
+
type: 'boolean',
|
|
145
|
+
optional: true,
|
|
146
|
+
description: 'Whether suggestions/tracked changes are enabled',
|
|
147
|
+
},
|
|
148
|
+
shareMode: {
|
|
149
|
+
type: 'string',
|
|
150
|
+
optional: true,
|
|
151
|
+
description: 'Sharing mode: view, comment, edit',
|
|
152
|
+
examples: ['view', 'comment', 'edit'],
|
|
153
|
+
},
|
|
154
|
+
// Protection
|
|
155
|
+
protected: {
|
|
156
|
+
type: 'boolean',
|
|
157
|
+
optional: true,
|
|
158
|
+
description: 'Whether document is protected from editing',
|
|
159
|
+
},
|
|
160
|
+
password: {
|
|
161
|
+
type: 'string',
|
|
162
|
+
optional: true,
|
|
163
|
+
description: 'Password for protected documents',
|
|
164
|
+
},
|
|
165
|
+
readOnly: {
|
|
166
|
+
type: 'boolean',
|
|
167
|
+
optional: true,
|
|
168
|
+
description: 'Whether document is read-only',
|
|
169
|
+
},
|
|
170
|
+
downloadable: {
|
|
171
|
+
type: 'boolean',
|
|
172
|
+
optional: true,
|
|
173
|
+
description: 'Whether document can be downloaded',
|
|
174
|
+
},
|
|
175
|
+
copyable: {
|
|
176
|
+
type: 'boolean',
|
|
177
|
+
optional: true,
|
|
178
|
+
description: 'Whether content can be copied',
|
|
179
|
+
},
|
|
180
|
+
printable: {
|
|
181
|
+
type: 'boolean',
|
|
182
|
+
optional: true,
|
|
183
|
+
description: 'Whether document can be printed',
|
|
184
|
+
},
|
|
185
|
+
// Templates
|
|
186
|
+
isTemplate: {
|
|
187
|
+
type: 'boolean',
|
|
188
|
+
optional: true,
|
|
189
|
+
description: 'Whether this document is a template',
|
|
190
|
+
},
|
|
191
|
+
templateId: {
|
|
192
|
+
type: 'string',
|
|
193
|
+
optional: true,
|
|
194
|
+
description: 'ID of template this was created from',
|
|
195
|
+
},
|
|
196
|
+
// Integration
|
|
197
|
+
externalId: {
|
|
198
|
+
type: 'string',
|
|
199
|
+
optional: true,
|
|
200
|
+
description: 'External system ID (Google Docs ID, OneDrive ID, etc.)',
|
|
201
|
+
},
|
|
202
|
+
externalUrl: {
|
|
203
|
+
type: 'url',
|
|
204
|
+
optional: true,
|
|
205
|
+
description: 'URL in external system',
|
|
206
|
+
},
|
|
207
|
+
syncEnabled: {
|
|
208
|
+
type: 'boolean',
|
|
209
|
+
optional: true,
|
|
210
|
+
description: 'Whether sync with external system is enabled',
|
|
211
|
+
},
|
|
212
|
+
lastSyncedAt: {
|
|
213
|
+
type: 'datetime',
|
|
214
|
+
optional: true,
|
|
215
|
+
description: 'Last sync timestamp',
|
|
216
|
+
},
|
|
217
|
+
// Metadata
|
|
218
|
+
language: {
|
|
219
|
+
type: 'string',
|
|
220
|
+
optional: true,
|
|
221
|
+
description: 'Document language code',
|
|
222
|
+
},
|
|
223
|
+
tags: {
|
|
224
|
+
type: 'string',
|
|
225
|
+
array: true,
|
|
226
|
+
optional: true,
|
|
227
|
+
description: 'Tags for categorizing the document',
|
|
228
|
+
},
|
|
229
|
+
category: {
|
|
230
|
+
type: 'string',
|
|
231
|
+
optional: true,
|
|
232
|
+
description: 'Document category',
|
|
233
|
+
},
|
|
234
|
+
folder: {
|
|
235
|
+
type: 'string',
|
|
236
|
+
optional: true,
|
|
237
|
+
description: 'Folder or workspace path',
|
|
238
|
+
},
|
|
239
|
+
customMetadata: {
|
|
240
|
+
type: 'json',
|
|
241
|
+
optional: true,
|
|
242
|
+
description: 'Custom metadata fields',
|
|
243
|
+
},
|
|
244
|
+
// Analytics
|
|
245
|
+
viewCount: {
|
|
246
|
+
type: 'number',
|
|
247
|
+
optional: true,
|
|
248
|
+
description: 'Number of views',
|
|
249
|
+
},
|
|
250
|
+
downloadCount: {
|
|
251
|
+
type: 'number',
|
|
252
|
+
optional: true,
|
|
253
|
+
description: 'Number of downloads',
|
|
254
|
+
},
|
|
255
|
+
lastViewedAt: {
|
|
256
|
+
type: 'datetime',
|
|
257
|
+
optional: true,
|
|
258
|
+
description: 'Last view timestamp',
|
|
259
|
+
},
|
|
260
|
+
lastEditedAt: {
|
|
261
|
+
type: 'datetime',
|
|
262
|
+
optional: true,
|
|
263
|
+
description: 'Last edit timestamp',
|
|
264
|
+
},
|
|
265
|
+
// Publishing
|
|
266
|
+
publishedAt: {
|
|
267
|
+
type: 'datetime',
|
|
268
|
+
optional: true,
|
|
269
|
+
description: 'Publication timestamp',
|
|
270
|
+
},
|
|
271
|
+
publishedUrl: {
|
|
272
|
+
type: 'url',
|
|
273
|
+
optional: true,
|
|
274
|
+
description: 'Published document URL',
|
|
275
|
+
},
|
|
276
|
+
expiresAt: {
|
|
277
|
+
type: 'datetime',
|
|
278
|
+
optional: true,
|
|
279
|
+
description: 'Document expiration timestamp',
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
relationships: {
|
|
283
|
+
owner: {
|
|
284
|
+
type: 'Contact',
|
|
285
|
+
description: 'Document owner',
|
|
286
|
+
},
|
|
287
|
+
creator: {
|
|
288
|
+
type: 'Contact',
|
|
289
|
+
description: 'User who created the document',
|
|
290
|
+
},
|
|
291
|
+
lastEditor: {
|
|
292
|
+
type: 'Contact',
|
|
293
|
+
required: false,
|
|
294
|
+
description: 'User who last edited the document',
|
|
295
|
+
},
|
|
296
|
+
collaborators: {
|
|
297
|
+
type: 'DocumentCollaborator[]',
|
|
298
|
+
backref: 'document',
|
|
299
|
+
description: 'Users with access to the document',
|
|
300
|
+
},
|
|
301
|
+
versions: {
|
|
302
|
+
type: 'DocumentVersion[]',
|
|
303
|
+
backref: 'document',
|
|
304
|
+
description: 'Version history',
|
|
305
|
+
},
|
|
306
|
+
comments: {
|
|
307
|
+
type: 'DocumentComment[]',
|
|
308
|
+
backref: 'document',
|
|
309
|
+
description: 'Comments and suggestions',
|
|
310
|
+
},
|
|
311
|
+
attachments: {
|
|
312
|
+
type: 'Attachment[]',
|
|
313
|
+
description: 'Attached files',
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
actions: [
|
|
317
|
+
'create',
|
|
318
|
+
'open',
|
|
319
|
+
'edit',
|
|
320
|
+
'save',
|
|
321
|
+
'saveAs',
|
|
322
|
+
'duplicate',
|
|
323
|
+
'rename',
|
|
324
|
+
'delete',
|
|
325
|
+
'restore',
|
|
326
|
+
'export',
|
|
327
|
+
'download',
|
|
328
|
+
'print',
|
|
329
|
+
'share',
|
|
330
|
+
'unshare',
|
|
331
|
+
'publish',
|
|
332
|
+
'unpublish',
|
|
333
|
+
'archive',
|
|
334
|
+
'unarchive',
|
|
335
|
+
'move',
|
|
336
|
+
'copy',
|
|
337
|
+
'lock',
|
|
338
|
+
'unlock',
|
|
339
|
+
'protect',
|
|
340
|
+
'unprotect',
|
|
341
|
+
'makeTemplate',
|
|
342
|
+
'createFromTemplate',
|
|
343
|
+
'compare',
|
|
344
|
+
'merge',
|
|
345
|
+
'split',
|
|
346
|
+
'convert',
|
|
347
|
+
'translate',
|
|
348
|
+
'spellCheck',
|
|
349
|
+
'findAndReplace',
|
|
350
|
+
'formatDocument',
|
|
351
|
+
'insertImage',
|
|
352
|
+
'insertTable',
|
|
353
|
+
'insertLink',
|
|
354
|
+
'addPageBreak',
|
|
355
|
+
'addComment',
|
|
356
|
+
'acceptSuggestion',
|
|
357
|
+
'rejectSuggestion',
|
|
358
|
+
],
|
|
359
|
+
events: [
|
|
360
|
+
'created',
|
|
361
|
+
'opened',
|
|
362
|
+
'edited',
|
|
363
|
+
'saved',
|
|
364
|
+
'renamed',
|
|
365
|
+
'deleted',
|
|
366
|
+
'restored',
|
|
367
|
+
'exported',
|
|
368
|
+
'downloaded',
|
|
369
|
+
'printed',
|
|
370
|
+
'shared',
|
|
371
|
+
'unshared',
|
|
372
|
+
'published',
|
|
373
|
+
'unpublished',
|
|
374
|
+
'archived',
|
|
375
|
+
'unarchived',
|
|
376
|
+
'moved',
|
|
377
|
+
'copied',
|
|
378
|
+
'locked',
|
|
379
|
+
'unlocked',
|
|
380
|
+
'protected',
|
|
381
|
+
'unprotected',
|
|
382
|
+
'converted',
|
|
383
|
+
'translated',
|
|
384
|
+
'commentAdded',
|
|
385
|
+
'commentResolved',
|
|
386
|
+
'suggestionAccepted',
|
|
387
|
+
'suggestionRejected',
|
|
388
|
+
'collaboratorAdded',
|
|
389
|
+
'collaboratorRemoved',
|
|
390
|
+
'permissionChanged',
|
|
391
|
+
'versionCreated',
|
|
392
|
+
'versionRestored',
|
|
393
|
+
'synced',
|
|
394
|
+
'viewed',
|
|
395
|
+
],
|
|
396
|
+
};
|
|
397
|
+
// =============================================================================
|
|
398
|
+
// DocumentVersion
|
|
399
|
+
// =============================================================================
|
|
400
|
+
/**
|
|
401
|
+
* DocumentVersion entity
|
|
402
|
+
*
|
|
403
|
+
* Represents a version in the document's history with content snapshot.
|
|
404
|
+
*/
|
|
405
|
+
export const DocumentVersion = {
|
|
406
|
+
singular: 'document version',
|
|
407
|
+
plural: 'document versions',
|
|
408
|
+
description: 'A version snapshot in document history',
|
|
409
|
+
properties: {
|
|
410
|
+
// Identity
|
|
411
|
+
versionNumber: {
|
|
412
|
+
type: 'number',
|
|
413
|
+
description: 'Sequential version number',
|
|
414
|
+
},
|
|
415
|
+
label: {
|
|
416
|
+
type: 'string',
|
|
417
|
+
optional: true,
|
|
418
|
+
description: 'Version label or tag',
|
|
419
|
+
},
|
|
420
|
+
description: {
|
|
421
|
+
type: 'string',
|
|
422
|
+
optional: true,
|
|
423
|
+
description: 'Version description or change notes',
|
|
424
|
+
},
|
|
425
|
+
// Content
|
|
426
|
+
content: {
|
|
427
|
+
type: 'string',
|
|
428
|
+
description: 'Document content at this version',
|
|
429
|
+
},
|
|
430
|
+
contentDiff: {
|
|
431
|
+
type: 'string',
|
|
432
|
+
optional: true,
|
|
433
|
+
description: 'Diff from previous version',
|
|
434
|
+
},
|
|
435
|
+
wordCount: {
|
|
436
|
+
type: 'number',
|
|
437
|
+
optional: true,
|
|
438
|
+
description: 'Word count at this version',
|
|
439
|
+
},
|
|
440
|
+
characterCount: {
|
|
441
|
+
type: 'number',
|
|
442
|
+
optional: true,
|
|
443
|
+
description: 'Character count at this version',
|
|
444
|
+
},
|
|
445
|
+
// Change tracking
|
|
446
|
+
changeType: {
|
|
447
|
+
type: 'string',
|
|
448
|
+
optional: true,
|
|
449
|
+
description: 'Type of change: edit, format, insert, delete, move',
|
|
450
|
+
examples: ['edit', 'format', 'insert', 'delete', 'move', 'restructure'],
|
|
451
|
+
},
|
|
452
|
+
changedSections: {
|
|
453
|
+
type: 'json',
|
|
454
|
+
optional: true,
|
|
455
|
+
description: 'Sections that were changed',
|
|
456
|
+
},
|
|
457
|
+
addedWords: {
|
|
458
|
+
type: 'number',
|
|
459
|
+
optional: true,
|
|
460
|
+
description: 'Number of words added',
|
|
461
|
+
},
|
|
462
|
+
deletedWords: {
|
|
463
|
+
type: 'number',
|
|
464
|
+
optional: true,
|
|
465
|
+
description: 'Number of words deleted',
|
|
466
|
+
},
|
|
467
|
+
// Versioning
|
|
468
|
+
isMajorVersion: {
|
|
469
|
+
type: 'boolean',
|
|
470
|
+
optional: true,
|
|
471
|
+
description: 'Whether this is a major version',
|
|
472
|
+
},
|
|
473
|
+
isAutoSave: {
|
|
474
|
+
type: 'boolean',
|
|
475
|
+
optional: true,
|
|
476
|
+
description: 'Whether this was an auto-saved version',
|
|
477
|
+
},
|
|
478
|
+
isPinned: {
|
|
479
|
+
type: 'boolean',
|
|
480
|
+
optional: true,
|
|
481
|
+
description: 'Whether this version is pinned',
|
|
482
|
+
},
|
|
483
|
+
// Metadata
|
|
484
|
+
size: {
|
|
485
|
+
type: 'number',
|
|
486
|
+
optional: true,
|
|
487
|
+
description: 'Version size in bytes',
|
|
488
|
+
},
|
|
489
|
+
checksum: {
|
|
490
|
+
type: 'string',
|
|
491
|
+
optional: true,
|
|
492
|
+
description: 'Content checksum for verification',
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
relationships: {
|
|
496
|
+
document: {
|
|
497
|
+
type: 'Document',
|
|
498
|
+
backref: 'versions',
|
|
499
|
+
description: 'Parent document',
|
|
500
|
+
},
|
|
501
|
+
author: {
|
|
502
|
+
type: 'Contact',
|
|
503
|
+
description: 'User who created this version',
|
|
504
|
+
},
|
|
505
|
+
previousVersion: {
|
|
506
|
+
type: 'DocumentVersion',
|
|
507
|
+
required: false,
|
|
508
|
+
description: 'Previous version in history',
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
actions: [
|
|
512
|
+
'create',
|
|
513
|
+
'view',
|
|
514
|
+
'compare',
|
|
515
|
+
'restore',
|
|
516
|
+
'download',
|
|
517
|
+
'delete',
|
|
518
|
+
'pin',
|
|
519
|
+
'unpin',
|
|
520
|
+
'label',
|
|
521
|
+
'addNote',
|
|
522
|
+
],
|
|
523
|
+
events: [
|
|
524
|
+
'created',
|
|
525
|
+
'viewed',
|
|
526
|
+
'compared',
|
|
527
|
+
'restored',
|
|
528
|
+
'downloaded',
|
|
529
|
+
'deleted',
|
|
530
|
+
'pinned',
|
|
531
|
+
'unpinned',
|
|
532
|
+
'labeled',
|
|
533
|
+
],
|
|
534
|
+
};
|
|
535
|
+
// =============================================================================
|
|
536
|
+
// DocumentComment
|
|
537
|
+
// =============================================================================
|
|
538
|
+
/**
|
|
539
|
+
* DocumentComment entity
|
|
540
|
+
*
|
|
541
|
+
* Represents a comment or suggestion on a document.
|
|
542
|
+
*/
|
|
543
|
+
export const DocumentComment = {
|
|
544
|
+
singular: 'document comment',
|
|
545
|
+
plural: 'document comments',
|
|
546
|
+
description: 'A comment or suggestion on a document',
|
|
547
|
+
properties: {
|
|
548
|
+
// Content
|
|
549
|
+
text: {
|
|
550
|
+
type: 'string',
|
|
551
|
+
description: 'Comment text',
|
|
552
|
+
},
|
|
553
|
+
quotedText: {
|
|
554
|
+
type: 'string',
|
|
555
|
+
optional: true,
|
|
556
|
+
description: 'Text being commented on',
|
|
557
|
+
},
|
|
558
|
+
// Type
|
|
559
|
+
type: {
|
|
560
|
+
type: 'string',
|
|
561
|
+
description: 'Comment type: comment, suggestion, edit, note',
|
|
562
|
+
examples: ['comment', 'suggestion', 'edit', 'note', 'question'],
|
|
563
|
+
},
|
|
564
|
+
severity: {
|
|
565
|
+
type: 'string',
|
|
566
|
+
optional: true,
|
|
567
|
+
description: 'Comment severity for editorial workflows',
|
|
568
|
+
examples: ['info', 'suggestion', 'warning', 'required'],
|
|
569
|
+
},
|
|
570
|
+
// Location
|
|
571
|
+
anchor: {
|
|
572
|
+
type: 'json',
|
|
573
|
+
optional: true,
|
|
574
|
+
description: 'Position anchor in document (character offset, paragraph, etc.)',
|
|
575
|
+
},
|
|
576
|
+
range: {
|
|
577
|
+
type: 'json',
|
|
578
|
+
optional: true,
|
|
579
|
+
description: 'Text range this comment applies to',
|
|
580
|
+
},
|
|
581
|
+
page: {
|
|
582
|
+
type: 'number',
|
|
583
|
+
optional: true,
|
|
584
|
+
description: 'Page number',
|
|
585
|
+
},
|
|
586
|
+
// Status
|
|
587
|
+
status: {
|
|
588
|
+
type: 'string',
|
|
589
|
+
description: 'Comment status: open, resolved, accepted, rejected',
|
|
590
|
+
examples: ['open', 'resolved', 'accepted', 'rejected', 'wont-fix'],
|
|
591
|
+
},
|
|
592
|
+
resolved: {
|
|
593
|
+
type: 'boolean',
|
|
594
|
+
description: 'Whether comment is resolved',
|
|
595
|
+
},
|
|
596
|
+
// Suggestions
|
|
597
|
+
suggestedChange: {
|
|
598
|
+
type: 'string',
|
|
599
|
+
optional: true,
|
|
600
|
+
description: 'Suggested text change',
|
|
601
|
+
},
|
|
602
|
+
originalText: {
|
|
603
|
+
type: 'string',
|
|
604
|
+
optional: true,
|
|
605
|
+
description: 'Original text before suggestion',
|
|
606
|
+
},
|
|
607
|
+
// Threading
|
|
608
|
+
isReply: {
|
|
609
|
+
type: 'boolean',
|
|
610
|
+
optional: true,
|
|
611
|
+
description: 'Whether this is a reply to another comment',
|
|
612
|
+
},
|
|
613
|
+
replyCount: {
|
|
614
|
+
type: 'number',
|
|
615
|
+
optional: true,
|
|
616
|
+
description: 'Number of replies',
|
|
617
|
+
},
|
|
618
|
+
// Resolution
|
|
619
|
+
resolvedAt: {
|
|
620
|
+
type: 'datetime',
|
|
621
|
+
optional: true,
|
|
622
|
+
description: 'When comment was resolved',
|
|
623
|
+
},
|
|
624
|
+
resolution: {
|
|
625
|
+
type: 'string',
|
|
626
|
+
optional: true,
|
|
627
|
+
description: 'Resolution notes',
|
|
628
|
+
},
|
|
629
|
+
// Metadata
|
|
630
|
+
mentions: {
|
|
631
|
+
type: 'string',
|
|
632
|
+
array: true,
|
|
633
|
+
optional: true,
|
|
634
|
+
description: 'User IDs mentioned in comment',
|
|
635
|
+
},
|
|
636
|
+
attachments: {
|
|
637
|
+
type: 'json',
|
|
638
|
+
optional: true,
|
|
639
|
+
description: 'Attached files or images',
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
relationships: {
|
|
643
|
+
document: {
|
|
644
|
+
type: 'Document',
|
|
645
|
+
backref: 'comments',
|
|
646
|
+
description: 'Parent document',
|
|
647
|
+
},
|
|
648
|
+
author: {
|
|
649
|
+
type: 'Contact',
|
|
650
|
+
description: 'Comment author',
|
|
651
|
+
},
|
|
652
|
+
parentComment: {
|
|
653
|
+
type: 'DocumentComment',
|
|
654
|
+
required: false,
|
|
655
|
+
description: 'Parent comment if this is a reply',
|
|
656
|
+
},
|
|
657
|
+
replies: {
|
|
658
|
+
type: 'DocumentComment[]',
|
|
659
|
+
backref: 'parentComment',
|
|
660
|
+
description: 'Reply comments',
|
|
661
|
+
},
|
|
662
|
+
resolver: {
|
|
663
|
+
type: 'Contact',
|
|
664
|
+
required: false,
|
|
665
|
+
description: 'User who resolved the comment',
|
|
666
|
+
},
|
|
667
|
+
},
|
|
668
|
+
actions: [
|
|
669
|
+
'create',
|
|
670
|
+
'edit',
|
|
671
|
+
'delete',
|
|
672
|
+
'reply',
|
|
673
|
+
'resolve',
|
|
674
|
+
'reopen',
|
|
675
|
+
'accept',
|
|
676
|
+
'reject',
|
|
677
|
+
'mention',
|
|
678
|
+
'attach',
|
|
679
|
+
'react',
|
|
680
|
+
],
|
|
681
|
+
events: [
|
|
682
|
+
'created',
|
|
683
|
+
'edited',
|
|
684
|
+
'deleted',
|
|
685
|
+
'replied',
|
|
686
|
+
'resolved',
|
|
687
|
+
'reopened',
|
|
688
|
+
'accepted',
|
|
689
|
+
'rejected',
|
|
690
|
+
'mentioned',
|
|
691
|
+
'reacted',
|
|
692
|
+
],
|
|
693
|
+
};
|
|
694
|
+
// =============================================================================
|
|
695
|
+
// DocumentCollaborator
|
|
696
|
+
// =============================================================================
|
|
697
|
+
/**
|
|
698
|
+
* DocumentCollaborator entity
|
|
699
|
+
*
|
|
700
|
+
* Represents a user with access to a document and their permissions.
|
|
701
|
+
*/
|
|
702
|
+
export const DocumentCollaborator = {
|
|
703
|
+
singular: 'document collaborator',
|
|
704
|
+
plural: 'document collaborators',
|
|
705
|
+
description: 'A user with access permissions to a document',
|
|
706
|
+
properties: {
|
|
707
|
+
// Permissions
|
|
708
|
+
role: {
|
|
709
|
+
type: 'string',
|
|
710
|
+
description: 'Access role: owner, editor, commenter, viewer',
|
|
711
|
+
examples: ['owner', 'editor', 'commenter', 'viewer', 'reviewer'],
|
|
712
|
+
},
|
|
713
|
+
canEdit: {
|
|
714
|
+
type: 'boolean',
|
|
715
|
+
description: 'Whether user can edit content',
|
|
716
|
+
},
|
|
717
|
+
canComment: {
|
|
718
|
+
type: 'boolean',
|
|
719
|
+
description: 'Whether user can add comments',
|
|
720
|
+
},
|
|
721
|
+
canShare: {
|
|
722
|
+
type: 'boolean',
|
|
723
|
+
optional: true,
|
|
724
|
+
description: 'Whether user can share with others',
|
|
725
|
+
},
|
|
726
|
+
canDownload: {
|
|
727
|
+
type: 'boolean',
|
|
728
|
+
optional: true,
|
|
729
|
+
description: 'Whether user can download',
|
|
730
|
+
},
|
|
731
|
+
canPrint: {
|
|
732
|
+
type: 'boolean',
|
|
733
|
+
optional: true,
|
|
734
|
+
description: 'Whether user can print',
|
|
735
|
+
},
|
|
736
|
+
canDelete: {
|
|
737
|
+
type: 'boolean',
|
|
738
|
+
optional: true,
|
|
739
|
+
description: 'Whether user can delete document',
|
|
740
|
+
},
|
|
741
|
+
// Access control
|
|
742
|
+
accessType: {
|
|
743
|
+
type: 'string',
|
|
744
|
+
description: 'Access type: direct, inherited, link, public',
|
|
745
|
+
examples: ['direct', 'inherited', 'link', 'public'],
|
|
746
|
+
},
|
|
747
|
+
inviteStatus: {
|
|
748
|
+
type: 'string',
|
|
749
|
+
optional: true,
|
|
750
|
+
description: 'Invitation status: pending, accepted, declined',
|
|
751
|
+
examples: ['pending', 'accepted', 'declined'],
|
|
752
|
+
},
|
|
753
|
+
// Expiration
|
|
754
|
+
expiresAt: {
|
|
755
|
+
type: 'datetime',
|
|
756
|
+
optional: true,
|
|
757
|
+
description: 'When access expires',
|
|
758
|
+
},
|
|
759
|
+
isTemporary: {
|
|
760
|
+
type: 'boolean',
|
|
761
|
+
optional: true,
|
|
762
|
+
description: 'Whether this is temporary access',
|
|
763
|
+
},
|
|
764
|
+
// Activity
|
|
765
|
+
lastAccessedAt: {
|
|
766
|
+
type: 'datetime',
|
|
767
|
+
optional: true,
|
|
768
|
+
description: 'Last access timestamp',
|
|
769
|
+
},
|
|
770
|
+
accessCount: {
|
|
771
|
+
type: 'number',
|
|
772
|
+
optional: true,
|
|
773
|
+
description: 'Number of times accessed',
|
|
774
|
+
},
|
|
775
|
+
editCount: {
|
|
776
|
+
type: 'number',
|
|
777
|
+
optional: true,
|
|
778
|
+
description: 'Number of edits made',
|
|
779
|
+
},
|
|
780
|
+
commentCount: {
|
|
781
|
+
type: 'number',
|
|
782
|
+
optional: true,
|
|
783
|
+
description: 'Number of comments made',
|
|
784
|
+
},
|
|
785
|
+
// Notifications
|
|
786
|
+
notifyOnEdit: {
|
|
787
|
+
type: 'boolean',
|
|
788
|
+
optional: true,
|
|
789
|
+
description: 'Whether to notify on edits',
|
|
790
|
+
},
|
|
791
|
+
notifyOnComment: {
|
|
792
|
+
type: 'boolean',
|
|
793
|
+
optional: true,
|
|
794
|
+
description: 'Whether to notify on comments',
|
|
795
|
+
},
|
|
796
|
+
notifyOnShare: {
|
|
797
|
+
type: 'boolean',
|
|
798
|
+
optional: true,
|
|
799
|
+
description: 'Whether to notify on new shares',
|
|
800
|
+
},
|
|
801
|
+
// Metadata
|
|
802
|
+
inviteMessage: {
|
|
803
|
+
type: 'string',
|
|
804
|
+
optional: true,
|
|
805
|
+
description: 'Message included with invitation',
|
|
806
|
+
},
|
|
807
|
+
customPermissions: {
|
|
808
|
+
type: 'json',
|
|
809
|
+
optional: true,
|
|
810
|
+
description: 'Additional custom permissions',
|
|
811
|
+
},
|
|
812
|
+
},
|
|
813
|
+
relationships: {
|
|
814
|
+
document: {
|
|
815
|
+
type: 'Document',
|
|
816
|
+
backref: 'collaborators',
|
|
817
|
+
description: 'Document being shared',
|
|
818
|
+
},
|
|
819
|
+
user: {
|
|
820
|
+
type: 'Contact',
|
|
821
|
+
description: 'User with access',
|
|
822
|
+
},
|
|
823
|
+
inviter: {
|
|
824
|
+
type: 'Contact',
|
|
825
|
+
required: false,
|
|
826
|
+
description: 'User who shared the document',
|
|
827
|
+
},
|
|
828
|
+
},
|
|
829
|
+
actions: [
|
|
830
|
+
'invite',
|
|
831
|
+
'accept',
|
|
832
|
+
'decline',
|
|
833
|
+
'revoke',
|
|
834
|
+
'updatePermissions',
|
|
835
|
+
'makeOwner',
|
|
836
|
+
'promote',
|
|
837
|
+
'demote',
|
|
838
|
+
'notify',
|
|
839
|
+
'resendInvite',
|
|
840
|
+
'setExpiration',
|
|
841
|
+
],
|
|
842
|
+
events: [
|
|
843
|
+
'invited',
|
|
844
|
+
'accepted',
|
|
845
|
+
'declined',
|
|
846
|
+
'revoked',
|
|
847
|
+
'permissionsUpdated',
|
|
848
|
+
'ownerChanged',
|
|
849
|
+
'promoted',
|
|
850
|
+
'demoted',
|
|
851
|
+
'expired',
|
|
852
|
+
'accessed',
|
|
853
|
+
'edited',
|
|
854
|
+
'commented',
|
|
855
|
+
],
|
|
856
|
+
};
|
|
857
|
+
// =============================================================================
|
|
858
|
+
// Export all entities as a schema
|
|
859
|
+
// =============================================================================
|
|
860
|
+
/**
|
|
861
|
+
* All document entity types
|
|
862
|
+
*/
|
|
863
|
+
export const DocumentEntities = {
|
|
864
|
+
Document,
|
|
865
|
+
DocumentVersion,
|
|
866
|
+
DocumentComment,
|
|
867
|
+
DocumentCollaborator,
|
|
868
|
+
};
|
|
869
|
+
/**
|
|
870
|
+
* Entity categories for organization
|
|
871
|
+
*/
|
|
872
|
+
export const DocumentCategories = {
|
|
873
|
+
documents: ['Document', 'DocumentVersion', 'DocumentComment', 'DocumentCollaborator'],
|
|
874
|
+
};
|