@happyvertical/smrt-comments 0.0.0-stage → 0.55.10
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/AGENTS.md +17 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +58 -2
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/collections/CommentCollection.d.ts +7 -0
- package/dist/collections/CommentCollection.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +184 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.json +474 -0
- package/dist/models/Comment.d.ts +13 -0
- package/dist/models/Comment.d.ts.map +1 -0
- package/dist/recipes.d.ts +27 -0
- package/dist/recipes.d.ts.map +1 -0
- package/dist/services/CommentService.d.ts +16 -0
- package/dist/services/CommentService.d.ts.map +1 -0
- package/dist/services/mentionNotifications.d.ts +18 -0
- package/dist/services/mentionNotifications.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +269 -0
- package/dist/svelte/RecordComments.svelte +71 -0
- package/dist/svelte/RecordComments.svelte.d.ts +16 -0
- package/dist/svelte/RecordComments.svelte.d.ts.map +1 -0
- package/dist/svelte/RecordCommentsPlayground.svelte +20 -0
- package/dist/svelte/RecordCommentsPlayground.svelte.d.ts +4 -0
- package/dist/svelte/RecordCommentsPlayground.svelte.d.ts.map +1 -0
- package/dist/svelte/demo.d.ts +4 -0
- package/dist/svelte/demo.d.ts.map +1 -0
- package/dist/svelte/demo.js +13 -0
- package/dist/svelte/index.d.ts +6 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +4 -0
- package/dist/types.d.ts +31 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +0 -0
- package/package.json +62 -3
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"timestamp": 0,
|
|
4
|
+
"packageName": "@happyvertical/smrt-comments",
|
|
5
|
+
"packageVersion": "0.55.10",
|
|
6
|
+
"objects": {
|
|
7
|
+
"@happyvertical/smrt-comments:CommentCollection": {
|
|
8
|
+
"name": "commentcollection",
|
|
9
|
+
"className": "CommentCollection",
|
|
10
|
+
"qualifiedName": "@happyvertical/smrt-comments:CommentCollection",
|
|
11
|
+
"collection": "comments",
|
|
12
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/comments/src/collections/CommentCollection.ts",
|
|
13
|
+
"packageName": "@happyvertical/smrt-comments",
|
|
14
|
+
"fields": {},
|
|
15
|
+
"methods": {
|
|
16
|
+
"listForRecord": {
|
|
17
|
+
"name": "listForRecord",
|
|
18
|
+
"async": true,
|
|
19
|
+
"parameters": [
|
|
20
|
+
{
|
|
21
|
+
"name": "recordType",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"optional": false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "recordId",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"optional": false
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"returnType": "Promise<Comment[]>",
|
|
32
|
+
"isStatic": false,
|
|
33
|
+
"isPublic": true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"decoratorConfig": {
|
|
37
|
+
"tableName": "record_comments",
|
|
38
|
+
"api": false,
|
|
39
|
+
"mcp": false,
|
|
40
|
+
"cli": false
|
|
41
|
+
},
|
|
42
|
+
"extends": "SmrtCollection",
|
|
43
|
+
"extendsTypeArg": "Comment",
|
|
44
|
+
"exportName": "CommentCollection",
|
|
45
|
+
"collectionExportName": "CommentCollectionCollection",
|
|
46
|
+
"schema": {
|
|
47
|
+
"tableName": "record_comments",
|
|
48
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"record_comments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"meta_type\" TEXT NOT NULL,\n \"meta_id\" TEXT NOT NULL,\n \"role\" TEXT NOT NULL,\n \"sort_order\" INTEGER DEFAULT 0,\n \"tenant_id\" UUID NOT NULL,\n \"author_user_id\" UUID NOT NULL,\n \"body\" TEXT NOT NULL,\n \"mentions\" TEXT\n);",
|
|
49
|
+
"columns": {
|
|
50
|
+
"id": {
|
|
51
|
+
"type": "UUID",
|
|
52
|
+
"primaryKey": true,
|
|
53
|
+
"referenceKind": "id",
|
|
54
|
+
"notNull": true
|
|
55
|
+
},
|
|
56
|
+
"slug": {
|
|
57
|
+
"type": "TEXT",
|
|
58
|
+
"notNull": true
|
|
59
|
+
},
|
|
60
|
+
"context": {
|
|
61
|
+
"type": "TEXT",
|
|
62
|
+
"notNull": true,
|
|
63
|
+
"default": ""
|
|
64
|
+
},
|
|
65
|
+
"created_at": {
|
|
66
|
+
"type": "TIMESTAMP",
|
|
67
|
+
"notNull": true,
|
|
68
|
+
"default": "current_timestamp"
|
|
69
|
+
},
|
|
70
|
+
"updated_at": {
|
|
71
|
+
"type": "TIMESTAMP",
|
|
72
|
+
"notNull": true,
|
|
73
|
+
"default": "current_timestamp"
|
|
74
|
+
},
|
|
75
|
+
"meta_type": {
|
|
76
|
+
"type": "TEXT",
|
|
77
|
+
"notNull": true,
|
|
78
|
+
"unique": false
|
|
79
|
+
},
|
|
80
|
+
"meta_id": {
|
|
81
|
+
"type": "TEXT",
|
|
82
|
+
"notNull": true,
|
|
83
|
+
"unique": false
|
|
84
|
+
},
|
|
85
|
+
"role": {
|
|
86
|
+
"type": "TEXT",
|
|
87
|
+
"notNull": true,
|
|
88
|
+
"unique": false
|
|
89
|
+
},
|
|
90
|
+
"sort_order": {
|
|
91
|
+
"type": "INTEGER",
|
|
92
|
+
"notNull": false,
|
|
93
|
+
"unique": false,
|
|
94
|
+
"default": 0
|
|
95
|
+
},
|
|
96
|
+
"tenant_id": {
|
|
97
|
+
"type": "UUID",
|
|
98
|
+
"referenceKind": "tenantId",
|
|
99
|
+
"notNull": true,
|
|
100
|
+
"unique": false
|
|
101
|
+
},
|
|
102
|
+
"author_user_id": {
|
|
103
|
+
"type": "UUID",
|
|
104
|
+
"referenceKind": "crossPackageRef",
|
|
105
|
+
"notNull": true,
|
|
106
|
+
"unique": false
|
|
107
|
+
},
|
|
108
|
+
"body": {
|
|
109
|
+
"type": "TEXT",
|
|
110
|
+
"notNull": true,
|
|
111
|
+
"unique": false
|
|
112
|
+
},
|
|
113
|
+
"mentions": {
|
|
114
|
+
"type": "TEXT",
|
|
115
|
+
"notNull": false,
|
|
116
|
+
"unique": false
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"indexes": [
|
|
120
|
+
{
|
|
121
|
+
"name": "record_comments_slug_context_idx",
|
|
122
|
+
"columns": [
|
|
123
|
+
"tenant_id",
|
|
124
|
+
"slug",
|
|
125
|
+
"context"
|
|
126
|
+
],
|
|
127
|
+
"unique": true
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "record_comments_record_created_idx",
|
|
131
|
+
"columns": [
|
|
132
|
+
"tenant_id",
|
|
133
|
+
"meta_type",
|
|
134
|
+
"meta_id",
|
|
135
|
+
"created_at"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "record_comments_tenant_id_created_at_idx",
|
|
140
|
+
"columns": [
|
|
141
|
+
"tenant_id",
|
|
142
|
+
"created_at"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "record_comments_meta_type_meta_id_idx",
|
|
147
|
+
"columns": [
|
|
148
|
+
"meta_type",
|
|
149
|
+
"meta_id"
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "record_comments_author_user_id_idx",
|
|
154
|
+
"columns": [
|
|
155
|
+
"author_user_id"
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"version": "78644ad4"
|
|
160
|
+
},
|
|
161
|
+
"importPath": "@happyvertical/smrt-comments"
|
|
162
|
+
},
|
|
163
|
+
"@happyvertical/smrt-comments:Comment": {
|
|
164
|
+
"name": "comment",
|
|
165
|
+
"className": "Comment",
|
|
166
|
+
"qualifiedName": "@happyvertical/smrt-comments:Comment",
|
|
167
|
+
"collection": "comments",
|
|
168
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/comments/src/models/Comment.ts",
|
|
169
|
+
"packageName": "@happyvertical/smrt-comments",
|
|
170
|
+
"fields": {
|
|
171
|
+
"metaType": {
|
|
172
|
+
"type": "text",
|
|
173
|
+
"required": true,
|
|
174
|
+
"_meta": {
|
|
175
|
+
"required": true
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"metaId": {
|
|
179
|
+
"type": "text",
|
|
180
|
+
"required": true,
|
|
181
|
+
"_meta": {
|
|
182
|
+
"required": true
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"role": {
|
|
186
|
+
"type": "text",
|
|
187
|
+
"required": true,
|
|
188
|
+
"_meta": {
|
|
189
|
+
"required": true
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"sortOrder": {
|
|
193
|
+
"type": "integer",
|
|
194
|
+
"required": false,
|
|
195
|
+
"default": 0
|
|
196
|
+
},
|
|
197
|
+
"tenantId": {
|
|
198
|
+
"type": "text",
|
|
199
|
+
"required": true,
|
|
200
|
+
"_meta": {
|
|
201
|
+
"sqlType": "UUID",
|
|
202
|
+
"__tenancy": {
|
|
203
|
+
"isTenantIdField": true,
|
|
204
|
+
"autoFilter": true,
|
|
205
|
+
"required": true,
|
|
206
|
+
"autoPopulate": true,
|
|
207
|
+
"nullable": false,
|
|
208
|
+
"mode": "required",
|
|
209
|
+
"field": "tenantId",
|
|
210
|
+
"allowSuperAdminBypass": false
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"authorUserId": {
|
|
215
|
+
"type": "crossPackageRef",
|
|
216
|
+
"required": true,
|
|
217
|
+
"related": "@happyvertical/smrt-users:User"
|
|
218
|
+
},
|
|
219
|
+
"body": {
|
|
220
|
+
"type": "text",
|
|
221
|
+
"required": true,
|
|
222
|
+
"_meta": {
|
|
223
|
+
"required": true
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"mentions": {
|
|
227
|
+
"type": "text",
|
|
228
|
+
"required": false
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"methods": {
|
|
232
|
+
"hydrate": {
|
|
233
|
+
"name": "hydrate",
|
|
234
|
+
"async": true,
|
|
235
|
+
"parameters": [],
|
|
236
|
+
"returnType": "Promise<T | null>",
|
|
237
|
+
"isStatic": false,
|
|
238
|
+
"isPublic": true
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"decoratorConfig": {
|
|
242
|
+
"tableName": "record_comments",
|
|
243
|
+
"api": false,
|
|
244
|
+
"mcp": false,
|
|
245
|
+
"cli": false,
|
|
246
|
+
"indexes": [
|
|
247
|
+
{
|
|
248
|
+
"name": "record_comments_record_created_idx",
|
|
249
|
+
"columns": [
|
|
250
|
+
"tenantId",
|
|
251
|
+
"metaType",
|
|
252
|
+
"metaId",
|
|
253
|
+
"createdAt"
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
"tenantScoped": {
|
|
258
|
+
"mode": "required"
|
|
259
|
+
},
|
|
260
|
+
"conflictColumns": [
|
|
261
|
+
"tenant_id",
|
|
262
|
+
"slug",
|
|
263
|
+
"context"
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
"extends": "SmrtPolymorphicAssociation",
|
|
267
|
+
"exportName": "Comment",
|
|
268
|
+
"collectionExportName": "CommentCollection",
|
|
269
|
+
"validationRules": [
|
|
270
|
+
{
|
|
271
|
+
"field": "metaType",
|
|
272
|
+
"rule": "required",
|
|
273
|
+
"fieldType": "text"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"field": "metaId",
|
|
277
|
+
"rule": "required",
|
|
278
|
+
"fieldType": "text"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"field": "role",
|
|
282
|
+
"rule": "required",
|
|
283
|
+
"fieldType": "text"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"field": "authorUserId",
|
|
287
|
+
"rule": "required",
|
|
288
|
+
"fieldType": "crossPackageRef"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"field": "body",
|
|
292
|
+
"rule": "required",
|
|
293
|
+
"fieldType": "text"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"schema": {
|
|
297
|
+
"tableName": "record_comments",
|
|
298
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"record_comments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"meta_type\" TEXT NOT NULL,\n \"meta_id\" TEXT NOT NULL,\n \"role\" TEXT NOT NULL,\n \"sort_order\" INTEGER DEFAULT 0,\n \"tenant_id\" UUID NOT NULL,\n \"author_user_id\" UUID NOT NULL,\n \"body\" TEXT NOT NULL,\n \"mentions\" TEXT\n);",
|
|
299
|
+
"columns": {
|
|
300
|
+
"id": {
|
|
301
|
+
"type": "UUID",
|
|
302
|
+
"primaryKey": true,
|
|
303
|
+
"referenceKind": "id",
|
|
304
|
+
"notNull": true
|
|
305
|
+
},
|
|
306
|
+
"slug": {
|
|
307
|
+
"type": "TEXT",
|
|
308
|
+
"notNull": true
|
|
309
|
+
},
|
|
310
|
+
"context": {
|
|
311
|
+
"type": "TEXT",
|
|
312
|
+
"notNull": true,
|
|
313
|
+
"default": ""
|
|
314
|
+
},
|
|
315
|
+
"created_at": {
|
|
316
|
+
"type": "TIMESTAMP",
|
|
317
|
+
"notNull": true,
|
|
318
|
+
"default": "current_timestamp"
|
|
319
|
+
},
|
|
320
|
+
"updated_at": {
|
|
321
|
+
"type": "TIMESTAMP",
|
|
322
|
+
"notNull": true,
|
|
323
|
+
"default": "current_timestamp"
|
|
324
|
+
},
|
|
325
|
+
"meta_type": {
|
|
326
|
+
"type": "TEXT",
|
|
327
|
+
"notNull": true,
|
|
328
|
+
"unique": false
|
|
329
|
+
},
|
|
330
|
+
"meta_id": {
|
|
331
|
+
"type": "TEXT",
|
|
332
|
+
"notNull": true,
|
|
333
|
+
"unique": false
|
|
334
|
+
},
|
|
335
|
+
"role": {
|
|
336
|
+
"type": "TEXT",
|
|
337
|
+
"notNull": true,
|
|
338
|
+
"unique": false
|
|
339
|
+
},
|
|
340
|
+
"sort_order": {
|
|
341
|
+
"type": "INTEGER",
|
|
342
|
+
"notNull": false,
|
|
343
|
+
"unique": false,
|
|
344
|
+
"default": 0
|
|
345
|
+
},
|
|
346
|
+
"tenant_id": {
|
|
347
|
+
"type": "UUID",
|
|
348
|
+
"referenceKind": "tenantId",
|
|
349
|
+
"notNull": true,
|
|
350
|
+
"unique": false
|
|
351
|
+
},
|
|
352
|
+
"author_user_id": {
|
|
353
|
+
"type": "UUID",
|
|
354
|
+
"referenceKind": "crossPackageRef",
|
|
355
|
+
"notNull": true,
|
|
356
|
+
"unique": false
|
|
357
|
+
},
|
|
358
|
+
"body": {
|
|
359
|
+
"type": "TEXT",
|
|
360
|
+
"notNull": true,
|
|
361
|
+
"unique": false
|
|
362
|
+
},
|
|
363
|
+
"mentions": {
|
|
364
|
+
"type": "TEXT",
|
|
365
|
+
"notNull": false,
|
|
366
|
+
"unique": false
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"indexes": [
|
|
370
|
+
{
|
|
371
|
+
"name": "record_comments_slug_context_idx",
|
|
372
|
+
"columns": [
|
|
373
|
+
"tenant_id",
|
|
374
|
+
"slug",
|
|
375
|
+
"context"
|
|
376
|
+
],
|
|
377
|
+
"unique": true
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"name": "record_comments_record_created_idx",
|
|
381
|
+
"columns": [
|
|
382
|
+
"tenant_id",
|
|
383
|
+
"meta_type",
|
|
384
|
+
"meta_id",
|
|
385
|
+
"created_at"
|
|
386
|
+
]
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"name": "record_comments_tenant_id_created_at_idx",
|
|
390
|
+
"columns": [
|
|
391
|
+
"tenant_id",
|
|
392
|
+
"created_at"
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"name": "record_comments_meta_type_meta_id_idx",
|
|
397
|
+
"columns": [
|
|
398
|
+
"meta_type",
|
|
399
|
+
"meta_id"
|
|
400
|
+
]
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"name": "record_comments_author_user_id_idx",
|
|
404
|
+
"columns": [
|
|
405
|
+
"author_user_id"
|
|
406
|
+
]
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
"version": "78644ad4"
|
|
410
|
+
},
|
|
411
|
+
"importPath": "@happyvertical/smrt-comments"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"moduleType": "smrt",
|
|
415
|
+
"recipes": [
|
|
416
|
+
{
|
|
417
|
+
"id": "comments.records",
|
|
418
|
+
"className": "RecordCommentsRecipe",
|
|
419
|
+
"label": "Record comments",
|
|
420
|
+
"summary": "Discuss work directly on the records it concerns.",
|
|
421
|
+
"synonyms": [
|
|
422
|
+
"comments",
|
|
423
|
+
"mentions",
|
|
424
|
+
"discussion"
|
|
425
|
+
],
|
|
426
|
+
"models": [
|
|
427
|
+
"@happyvertical/smrt-comments:Comment"
|
|
428
|
+
],
|
|
429
|
+
"nav": [],
|
|
430
|
+
"requires": [],
|
|
431
|
+
"group": {
|
|
432
|
+
"id": "comments",
|
|
433
|
+
"label": "Comments",
|
|
434
|
+
"summary": "Keep discussions alongside the records your team works on."
|
|
435
|
+
},
|
|
436
|
+
"help": {
|
|
437
|
+
"markdown": "## Overview\n\nRecord comments keep a discussion next to the work it concerns. Open a record\nyou can access to read its discussion or add a comment. Comments are part of\nthe record page, rather than a separate list of every discussion.\n\n## Tasks\n\n### Add a comment\n\nOpen the record, find Comments, write your message and choose Post comment.\nYour app controls who can read the record and who can contribute to its discussion.\n\n### Mention someone\n\nIf your app provides mention selection, choose a teammate who can access the\nrecord. When mention notifications are connected, that person receives a\nnotification. Typing a name alone does not select a recipient.\n\n### Check a failed post\n\nIf posting reports an error, refresh the discussion before trying again. A\ncomment may have been saved even when its mention notification could not be\ndelivered. If it appears in the discussion, do not post it a second time.\n",
|
|
438
|
+
"fieldRefs": []
|
|
439
|
+
},
|
|
440
|
+
"surfaces": [
|
|
441
|
+
{
|
|
442
|
+
"kind": "playground",
|
|
443
|
+
"export": "@happyvertical/smrt-comments/svelte#RecordCommentsPlayground",
|
|
444
|
+
"label": "Record discussion preview"
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
"runtime": "both",
|
|
448
|
+
"demoSeed": {
|
|
449
|
+
"export": "@happyvertical/smrt-comments/svelte#recordCommentsDemo"
|
|
450
|
+
},
|
|
451
|
+
"demo": {
|
|
452
|
+
"mode": "server",
|
|
453
|
+
"reasons": [
|
|
454
|
+
"Needs a server because its package depends on @happyvertical/smrt-tenancy, which do not build for a browser (#3624)."
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
"smrtDependencies": [
|
|
460
|
+
"@happyvertical/smrt-core",
|
|
461
|
+
"@happyvertical/smrt-messages",
|
|
462
|
+
"@happyvertical/smrt-tenancy"
|
|
463
|
+
],
|
|
464
|
+
"browser": {
|
|
465
|
+
"status": "server-only",
|
|
466
|
+
"issues": [
|
|
467
|
+
"#3624"
|
|
468
|
+
],
|
|
469
|
+
"via": [
|
|
470
|
+
"@happyvertical/smrt-tenancy"
|
|
471
|
+
]
|
|
472
|
+
},
|
|
473
|
+
"stampsConstructors": true
|
|
474
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SmrtPolymorphicAssociation } from '@happyvertical/smrt-core';
|
|
2
|
+
import type { CommentOptions } from '../types.js';
|
|
3
|
+
export declare class Comment extends SmrtPolymorphicAssociation {
|
|
4
|
+
tenantId: string;
|
|
5
|
+
authorUserId: string;
|
|
6
|
+
body: string;
|
|
7
|
+
/** JSON array of referenced User UUIDs; use mentionUserIds for validation. */
|
|
8
|
+
mentions: string;
|
|
9
|
+
constructor(options?: CommentOptions);
|
|
10
|
+
get mentionUserIds(): string[];
|
|
11
|
+
set mentionUserIds(value: readonly string[]);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=Comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Comment.d.ts","sourceRoot":"","sources":["../../src/models/Comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,0BAA0B,EAE3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,qBAaa,OAAQ,SAAQ,0BAA0B;IAErD,QAAQ,SAAM;IAGd,YAAY,SAAM;IAGlB,IAAI,SAAM;IAEV,8EAA8E;IAC9E,QAAQ,SAAQ;gBAEJ,OAAO,GAAE,cAAmB;IAWxC,IAAI,cAAc,IAAI,MAAM,EAAE,CAU7B;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAQ1C;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SmrtRecipe } from '@happyvertical/smrt-core';
|
|
2
|
+
import { Comment } from './models/Comment.js';
|
|
3
|
+
/** Discussion attached to any authorized business record. */
|
|
4
|
+
export declare class RecordCommentsRecipe extends SmrtRecipe {
|
|
5
|
+
static id: string;
|
|
6
|
+
static label: string;
|
|
7
|
+
static summary: string;
|
|
8
|
+
static synonyms: string[];
|
|
9
|
+
static group: {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
summary: string;
|
|
13
|
+
};
|
|
14
|
+
static models: (typeof Comment)[];
|
|
15
|
+
static nav: never[];
|
|
16
|
+
static runtime: "both";
|
|
17
|
+
static surfaces: readonly [{
|
|
18
|
+
readonly kind: "playground";
|
|
19
|
+
readonly export: "@happyvertical/smrt-comments/svelte#RecordCommentsPlayground";
|
|
20
|
+
readonly label: "Record discussion preview";
|
|
21
|
+
}];
|
|
22
|
+
static demoSeed: {
|
|
23
|
+
readonly export: "@happyvertical/smrt-comments/svelte#recordCommentsDemo";
|
|
24
|
+
};
|
|
25
|
+
static help: string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=recipes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../src/recipes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,6DAA6D;AAC7D,qBAAa,oBAAqB,SAAQ,UAAU;IAClD,MAAM,CAAC,EAAE,SAAsB;IAC/B,MAAM,CAAC,KAAK,SAAqB;IACjC,MAAM,CAAC,OAAO,SAAuD;IACrE,MAAM,CAAC,QAAQ,WAA0C;IACzD,MAAM,CAAC,KAAK;;;;MAIV;IACF,MAAM,CAAC,MAAM,qBAAa;IAE1B,MAAM,CAAC,GAAG,UAAM;IAChB,MAAM,CAAC,OAAO,EAAG,MAAM,CAAU;IACjC,MAAM,CAAC,QAAQ;;;;OAMJ;IACX,MAAM,CAAC,QAAQ;;MAEJ;IACX,MAAM,CAAC,IAAI,SAAkC;CAC9C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
2
|
+
import { Comment } from '../models/Comment.js';
|
|
3
|
+
import type { CommentActorContext, CommentMentionNotificationAdapter, CommentOptions, CommentRecordAccess } from '../types.js';
|
|
4
|
+
export declare class CommentService {
|
|
5
|
+
private readonly options;
|
|
6
|
+
constructor(options: {
|
|
7
|
+
db: SmrtClassOptions['db'];
|
|
8
|
+
actor: CommentActorContext;
|
|
9
|
+
authorizeRecord: (access: CommentRecordAccess) => Promise<boolean>;
|
|
10
|
+
mentionNotifications?: CommentMentionNotificationAdapter;
|
|
11
|
+
});
|
|
12
|
+
private authorize;
|
|
13
|
+
listForRecord(recordType: string, recordId: string): Promise<Comment[]>;
|
|
14
|
+
create(commentOptions: CommentOptions): Promise<Comment>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=CommentService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommentService.d.ts","sourceRoot":"","sources":["../../src/services/CommentService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,EACV,mBAAmB,EACnB,iCAAiC,EACjC,cAAc,EACd,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE;QACxB,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,EAAE,mBAAmB,CAAC;QAC3B,eAAe,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;QACnE,oBAAoB,CAAC,EAAE,iCAAiC,CAAC;KAC1D;YAGW,SAAS;IAsBjB,aAAa,CACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,EAAE,CAAC;IAUf,MAAM,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;CAgD/D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CommentMention, CommentMentionNotificationAdapter } from '../types.js';
|
|
2
|
+
/** Structural subset implemented by smrt-messages UserNotificationService. */
|
|
3
|
+
export interface CommentNotificationService {
|
|
4
|
+
notify(input: {
|
|
5
|
+
tenantId: string;
|
|
6
|
+
recipientUserId: string;
|
|
7
|
+
kind: string;
|
|
8
|
+
title: string;
|
|
9
|
+
body: string;
|
|
10
|
+
sourceRef: string;
|
|
11
|
+
}): Promise<unknown>;
|
|
12
|
+
}
|
|
13
|
+
/** Hosts must check recipient membership AND access to the referenced record. */
|
|
14
|
+
export declare function createCommentMentionNotifications(options: {
|
|
15
|
+
notifications: CommentNotificationService;
|
|
16
|
+
canNotify: (mention: CommentMention) => Promise<boolean>;
|
|
17
|
+
}): CommentMentionNotificationAdapter;
|
|
18
|
+
//# sourceMappingURL=mentionNotifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mentionNotifications.d.ts","sourceRoot":"","sources":["../../src/services/mentionNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iCAAiC,EAClC,MAAM,aAAa,CAAC;AAErB,8EAA8E;AAC9E,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,KAAK,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtB;AAED,iFAAiF;AACjF,wBAAgB,iCAAiC,CAAC,OAAO,EAAE;IACzD,aAAa,EAAE,0BAA0B,CAAC;IAC1C,SAAS,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1D,GAAG,iCAAiC,CAcpC"}
|