@cherwell/emdash-crm 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,921 @@
1
+ {
2
+ "id": "crm",
3
+ "version": "0.1.1",
4
+ "declaredAccess": {
5
+ "content": {
6
+ "read": {}
7
+ },
8
+ "network": {
9
+ "request": {}
10
+ }
11
+ },
12
+ "capabilities": [
13
+ "content:read",
14
+ "network:request:unrestricted",
15
+ "network:request"
16
+ ],
17
+ "allowedHosts": [],
18
+ "storage": {
19
+ "organisations": {
20
+ "indexes": [
21
+ "status",
22
+ "nameKey",
23
+ "email",
24
+ "updatedAt",
25
+ [
26
+ "status",
27
+ "nameKey"
28
+ ]
29
+ ]
30
+ },
31
+ "people": {
32
+ "indexes": [
33
+ "nameKey",
34
+ "createdAt"
35
+ ],
36
+ "uniqueIndexes": [
37
+ "email"
38
+ ]
39
+ },
40
+ "links": {
41
+ "indexes": [
42
+ "orgId",
43
+ "personId",
44
+ "role"
45
+ ],
46
+ "uniqueIndexes": [
47
+ "key"
48
+ ]
49
+ },
50
+ "activities": {
51
+ "indexes": [
52
+ "orgId",
53
+ "createdAt",
54
+ [
55
+ "orgId",
56
+ "createdAt"
57
+ ]
58
+ ]
59
+ },
60
+ "tasks": {
61
+ "indexes": [
62
+ "orgId",
63
+ "personId",
64
+ "assignee",
65
+ "dueOn",
66
+ "done",
67
+ [
68
+ "done",
69
+ "dueOn"
70
+ ],
71
+ [
72
+ "done",
73
+ "assignee"
74
+ ],
75
+ [
76
+ "orgId",
77
+ "done"
78
+ ]
79
+ ]
80
+ },
81
+ "audit": {
82
+ "indexes": [
83
+ "at",
84
+ "target",
85
+ "actor",
86
+ [
87
+ "target",
88
+ "at"
89
+ ]
90
+ ]
91
+ },
92
+ "webhooks": {
93
+ "indexes": [
94
+ "createdAt"
95
+ ]
96
+ },
97
+ "deliveries": {
98
+ "indexes": [
99
+ "status",
100
+ "createdAt",
101
+ [
102
+ "status",
103
+ "nextAt"
104
+ ]
105
+ ]
106
+ },
107
+ "rate_limits": {
108
+ "indexes": [
109
+ "expiresAt"
110
+ ]
111
+ }
112
+ },
113
+ "hooks": [
114
+ "plugin:activate",
115
+ "cron"
116
+ ],
117
+ "routes": [
118
+ {
119
+ "name": "service/config",
120
+ "methods": [
121
+ "POST"
122
+ ],
123
+ "request": {
124
+ "body": "json",
125
+ "headers": [
126
+ "x-crm-service-key"
127
+ ]
128
+ },
129
+ "public": true
130
+ },
131
+ {
132
+ "name": "service/person",
133
+ "methods": [
134
+ "POST"
135
+ ],
136
+ "request": {
137
+ "body": "json",
138
+ "headers": [
139
+ "x-crm-service-key"
140
+ ]
141
+ },
142
+ "public": true
143
+ },
144
+ {
145
+ "name": "service/organisation",
146
+ "methods": [
147
+ "POST"
148
+ ],
149
+ "request": {
150
+ "body": "json",
151
+ "headers": [
152
+ "x-crm-service-key"
153
+ ]
154
+ },
155
+ "public": true
156
+ },
157
+ {
158
+ "name": "service/organisations",
159
+ "methods": [
160
+ "POST"
161
+ ],
162
+ "request": {
163
+ "body": "json",
164
+ "headers": [
165
+ "x-crm-service-key"
166
+ ]
167
+ },
168
+ "public": true
169
+ },
170
+ {
171
+ "name": "service/entry-owner",
172
+ "methods": [
173
+ "POST"
174
+ ],
175
+ "request": {
176
+ "body": "json",
177
+ "headers": [
178
+ "x-crm-service-key"
179
+ ]
180
+ },
181
+ "public": true
182
+ },
183
+ {
184
+ "name": "service/timeline",
185
+ "methods": [
186
+ "POST"
187
+ ],
188
+ "request": {
189
+ "body": "json",
190
+ "headers": [
191
+ "x-crm-service-key"
192
+ ]
193
+ },
194
+ "public": true
195
+ },
196
+ {
197
+ "name": "service/organisation/create",
198
+ "methods": [
199
+ "POST"
200
+ ],
201
+ "request": {
202
+ "body": "json",
203
+ "headers": [
204
+ "x-crm-service-key"
205
+ ]
206
+ },
207
+ "public": true
208
+ },
209
+ {
210
+ "name": "service/organisation/update",
211
+ "methods": [
212
+ "POST"
213
+ ],
214
+ "request": {
215
+ "body": "json",
216
+ "headers": [
217
+ "x-crm-service-key"
218
+ ]
219
+ },
220
+ "public": true
221
+ },
222
+ {
223
+ "name": "service/person/ensure",
224
+ "methods": [
225
+ "POST"
226
+ ],
227
+ "request": {
228
+ "body": "json",
229
+ "headers": [
230
+ "x-crm-service-key"
231
+ ]
232
+ },
233
+ "public": true
234
+ },
235
+ {
236
+ "name": "service/link",
237
+ "methods": [
238
+ "POST"
239
+ ],
240
+ "request": {
241
+ "body": "json",
242
+ "headers": [
243
+ "x-crm-service-key"
244
+ ]
245
+ },
246
+ "public": true
247
+ },
248
+ {
249
+ "name": "service/activity",
250
+ "methods": [
251
+ "POST"
252
+ ],
253
+ "request": {
254
+ "body": "json",
255
+ "headers": [
256
+ "x-crm-service-key"
257
+ ]
258
+ },
259
+ "public": true
260
+ },
261
+ {
262
+ "name": "service/record",
263
+ "methods": [
264
+ "POST"
265
+ ],
266
+ "request": {
267
+ "body": "json",
268
+ "headers": [
269
+ "x-crm-service-key"
270
+ ]
271
+ },
272
+ "public": true
273
+ },
274
+ {
275
+ "name": "privacy/download",
276
+ "methods": [
277
+ "GET"
278
+ ],
279
+ "response": "raw",
280
+ "public": true
281
+ },
282
+ {
283
+ "name": "organisations/list",
284
+ "permission": "content:edit_any"
285
+ },
286
+ {
287
+ "name": "organisations/get",
288
+ "permission": "content:edit_any"
289
+ },
290
+ {
291
+ "name": "organisations/create",
292
+ "methods": [
293
+ "POST"
294
+ ],
295
+ "permission": "content:edit_any"
296
+ },
297
+ {
298
+ "name": "organisations/update",
299
+ "methods": [
300
+ "POST"
301
+ ],
302
+ "permission": "content:edit_any"
303
+ },
304
+ {
305
+ "name": "people/find",
306
+ "permission": "content:edit_any"
307
+ },
308
+ {
309
+ "name": "people/update",
310
+ "methods": [
311
+ "POST"
312
+ ],
313
+ "permission": "content:edit_any"
314
+ },
315
+ {
316
+ "name": "activities/add",
317
+ "methods": [
318
+ "POST"
319
+ ],
320
+ "permission": "content:edit_any"
321
+ },
322
+ {
323
+ "name": "tasks/list",
324
+ "permission": "content:edit_any"
325
+ },
326
+ {
327
+ "name": "tasks/create",
328
+ "methods": [
329
+ "POST"
330
+ ],
331
+ "permission": "content:edit_any"
332
+ },
333
+ {
334
+ "name": "tasks/complete",
335
+ "methods": [
336
+ "POST"
337
+ ],
338
+ "permission": "content:edit_any"
339
+ },
340
+ {
341
+ "name": "privacy/export",
342
+ "methods": [
343
+ "POST"
344
+ ],
345
+ "permission": "users:manage"
346
+ },
347
+ {
348
+ "name": "privacy/erase",
349
+ "methods": [
350
+ "POST"
351
+ ],
352
+ "permission": "users:manage"
353
+ },
354
+ {
355
+ "name": "admin",
356
+ "permission": "content:edit_any"
357
+ }
358
+ ],
359
+ "mcp": {
360
+ "tools": [
361
+ {
362
+ "name": "crm_organisations_list",
363
+ "description": "List CRM organisations by name prefix or status, with cursor paging.",
364
+ "route": "organisations/list",
365
+ "permission": "content:edit_any",
366
+ "destructive": false,
367
+ "inputSchema": {
368
+ "$schema": "http://json-schema.org/draft-07/schema#",
369
+ "type": "object",
370
+ "properties": {
371
+ "q": {
372
+ "type": "string",
373
+ "maxLength": 80
374
+ },
375
+ "status": {
376
+ "type": "string",
377
+ "enum": [
378
+ "prospect",
379
+ "active",
380
+ "lapsed",
381
+ "archived"
382
+ ]
383
+ },
384
+ "cursor": {
385
+ "type": "string",
386
+ "maxLength": 500
387
+ },
388
+ "limit": {
389
+ "type": "integer",
390
+ "minimum": 1,
391
+ "maximum": 100
392
+ }
393
+ },
394
+ "additionalProperties": false
395
+ }
396
+ },
397
+ {
398
+ "name": "crm_organisation_get",
399
+ "description": "Read one organisation with its people and roles, active plans and recent timeline.",
400
+ "route": "organisations/get",
401
+ "permission": "content:edit_any",
402
+ "destructive": false,
403
+ "inputSchema": {
404
+ "$schema": "http://json-schema.org/draft-07/schema#",
405
+ "type": "object",
406
+ "properties": {
407
+ "id": {
408
+ "type": "string",
409
+ "minLength": 1,
410
+ "maxLength": 40
411
+ }
412
+ },
413
+ "required": [
414
+ "id"
415
+ ],
416
+ "additionalProperties": false
417
+ }
418
+ },
419
+ {
420
+ "name": "crm_organisation_create",
421
+ "description": "Add an organisation to the CRM.",
422
+ "route": "organisations/create",
423
+ "permission": "content:edit_any",
424
+ "destructive": false,
425
+ "inputSchema": {
426
+ "$schema": "http://json-schema.org/draft-07/schema#",
427
+ "type": "object",
428
+ "properties": {
429
+ "name": {
430
+ "type": "string",
431
+ "minLength": 1,
432
+ "maxLength": 160
433
+ },
434
+ "status": {
435
+ "type": "string",
436
+ "enum": [
437
+ "prospect",
438
+ "active",
439
+ "lapsed",
440
+ "archived"
441
+ ]
442
+ },
443
+ "email": {
444
+ "anyOf": [
445
+ {
446
+ "type": "string",
447
+ "maxLength": 254,
448
+ "format": "email",
449
+ "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
450
+ },
451
+ {
452
+ "type": "string",
453
+ "const": ""
454
+ }
455
+ ]
456
+ },
457
+ "phone": {
458
+ "type": "string",
459
+ "maxLength": 40
460
+ },
461
+ "website": {
462
+ "type": "string",
463
+ "maxLength": 500
464
+ },
465
+ "address": {
466
+ "type": "object",
467
+ "properties": {
468
+ "line1": {
469
+ "type": "string",
470
+ "maxLength": 120
471
+ },
472
+ "line2": {
473
+ "type": "string",
474
+ "maxLength": 120
475
+ },
476
+ "town": {
477
+ "type": "string",
478
+ "maxLength": 80
479
+ },
480
+ "region": {
481
+ "type": "string",
482
+ "maxLength": 80
483
+ },
484
+ "postcode": {
485
+ "type": "string",
486
+ "maxLength": 20
487
+ },
488
+ "country": {
489
+ "type": "string",
490
+ "maxLength": 2
491
+ }
492
+ },
493
+ "additionalProperties": false
494
+ },
495
+ "tags": {
496
+ "maxItems": 30,
497
+ "type": "array",
498
+ "items": {
499
+ "type": "string",
500
+ "minLength": 1,
501
+ "maxLength": 40
502
+ }
503
+ },
504
+ "entries": {
505
+ "maxItems": 50,
506
+ "type": "array",
507
+ "items": {
508
+ "type": "string",
509
+ "pattern": "^[a-z][a-z0-9_]*:[A-Za-z0-9_-]{1,64}$"
510
+ }
511
+ },
512
+ "notifyEmails": {
513
+ "maxItems": 5,
514
+ "type": "array",
515
+ "items": {
516
+ "type": "string",
517
+ "maxLength": 254,
518
+ "format": "email",
519
+ "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
520
+ }
521
+ },
522
+ "custom": {
523
+ "type": "object",
524
+ "propertyNames": {
525
+ "type": "string"
526
+ },
527
+ "additionalProperties": {}
528
+ }
529
+ },
530
+ "required": [
531
+ "name"
532
+ ],
533
+ "additionalProperties": false
534
+ }
535
+ },
536
+ {
537
+ "name": "crm_organisation_update",
538
+ "description": "Change an organisation's details, tags, status or linked entries.",
539
+ "route": "organisations/update",
540
+ "permission": "content:edit_any",
541
+ "destructive": true,
542
+ "inputSchema": {
543
+ "$schema": "http://json-schema.org/draft-07/schema#",
544
+ "type": "object",
545
+ "properties": {
546
+ "name": {
547
+ "type": "string",
548
+ "minLength": 1,
549
+ "maxLength": 160
550
+ },
551
+ "status": {
552
+ "type": "string",
553
+ "enum": [
554
+ "prospect",
555
+ "active",
556
+ "lapsed",
557
+ "archived"
558
+ ]
559
+ },
560
+ "email": {
561
+ "anyOf": [
562
+ {
563
+ "type": "string",
564
+ "maxLength": 254,
565
+ "format": "email",
566
+ "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
567
+ },
568
+ {
569
+ "type": "string",
570
+ "const": ""
571
+ }
572
+ ]
573
+ },
574
+ "phone": {
575
+ "type": "string",
576
+ "maxLength": 40
577
+ },
578
+ "website": {
579
+ "type": "string",
580
+ "maxLength": 500
581
+ },
582
+ "address": {
583
+ "type": "object",
584
+ "properties": {
585
+ "line1": {
586
+ "type": "string",
587
+ "maxLength": 120
588
+ },
589
+ "line2": {
590
+ "type": "string",
591
+ "maxLength": 120
592
+ },
593
+ "town": {
594
+ "type": "string",
595
+ "maxLength": 80
596
+ },
597
+ "region": {
598
+ "type": "string",
599
+ "maxLength": 80
600
+ },
601
+ "postcode": {
602
+ "type": "string",
603
+ "maxLength": 20
604
+ },
605
+ "country": {
606
+ "type": "string",
607
+ "maxLength": 2
608
+ }
609
+ },
610
+ "additionalProperties": false
611
+ },
612
+ "tags": {
613
+ "maxItems": 30,
614
+ "type": "array",
615
+ "items": {
616
+ "type": "string",
617
+ "minLength": 1,
618
+ "maxLength": 40
619
+ }
620
+ },
621
+ "entries": {
622
+ "maxItems": 50,
623
+ "type": "array",
624
+ "items": {
625
+ "type": "string",
626
+ "pattern": "^[a-z][a-z0-9_]*:[A-Za-z0-9_-]{1,64}$"
627
+ }
628
+ },
629
+ "notifyEmails": {
630
+ "maxItems": 5,
631
+ "type": "array",
632
+ "items": {
633
+ "type": "string",
634
+ "maxLength": 254,
635
+ "format": "email",
636
+ "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
637
+ }
638
+ },
639
+ "custom": {
640
+ "type": "object",
641
+ "propertyNames": {
642
+ "type": "string"
643
+ },
644
+ "additionalProperties": {}
645
+ },
646
+ "id": {
647
+ "type": "string"
648
+ }
649
+ },
650
+ "required": [
651
+ "id"
652
+ ],
653
+ "additionalProperties": false
654
+ }
655
+ },
656
+ {
657
+ "name": "crm_people_find",
658
+ "description": "Find people by exact email or name prefix.",
659
+ "route": "people/find",
660
+ "permission": "content:edit_any",
661
+ "destructive": false,
662
+ "inputSchema": {
663
+ "$schema": "http://json-schema.org/draft-07/schema#",
664
+ "type": "object",
665
+ "properties": {
666
+ "email": {
667
+ "type": "string",
668
+ "maxLength": 254
669
+ },
670
+ "q": {
671
+ "type": "string",
672
+ "maxLength": 80
673
+ },
674
+ "cursor": {
675
+ "type": "string",
676
+ "maxLength": 500
677
+ }
678
+ },
679
+ "additionalProperties": false
680
+ }
681
+ },
682
+ {
683
+ "name": "crm_note_add",
684
+ "description": "Add a note, call, email or meeting to an organisation's timeline; visibleToMember shows it to the organisation.",
685
+ "route": "activities/add",
686
+ "permission": "content:edit_any",
687
+ "destructive": false,
688
+ "inputSchema": {
689
+ "$schema": "http://json-schema.org/draft-07/schema#",
690
+ "type": "object",
691
+ "properties": {
692
+ "orgId": {
693
+ "type": "string",
694
+ "minLength": 1,
695
+ "maxLength": 40
696
+ },
697
+ "text": {
698
+ "type": "string",
699
+ "minLength": 1,
700
+ "maxLength": 4000
701
+ },
702
+ "kind": {
703
+ "type": "string",
704
+ "enum": [
705
+ "note",
706
+ "call",
707
+ "email",
708
+ "meeting"
709
+ ]
710
+ },
711
+ "visibleToMember": {
712
+ "type": "boolean"
713
+ }
714
+ },
715
+ "required": [
716
+ "orgId",
717
+ "text"
718
+ ],
719
+ "additionalProperties": false
720
+ }
721
+ },
722
+ {
723
+ "name": "crm_tasks_list",
724
+ "description": "List open follow-up tasks, optionally only mine.",
725
+ "route": "tasks/list",
726
+ "permission": "content:edit_any",
727
+ "destructive": false,
728
+ "inputSchema": {
729
+ "$schema": "http://json-schema.org/draft-07/schema#",
730
+ "type": "object",
731
+ "properties": {
732
+ "mine": {
733
+ "type": "boolean"
734
+ },
735
+ "cursor": {
736
+ "type": "string"
737
+ }
738
+ },
739
+ "additionalProperties": false
740
+ }
741
+ },
742
+ {
743
+ "name": "crm_task_create",
744
+ "description": "Create a follow-up task with a due date.",
745
+ "route": "tasks/create",
746
+ "permission": "content:edit_any",
747
+ "destructive": false,
748
+ "inputSchema": {
749
+ "$schema": "http://json-schema.org/draft-07/schema#",
750
+ "type": "object",
751
+ "properties": {
752
+ "title": {
753
+ "type": "string",
754
+ "minLength": 1,
755
+ "maxLength": 200
756
+ },
757
+ "orgId": {
758
+ "anyOf": [
759
+ {
760
+ "type": "string",
761
+ "maxLength": 40
762
+ },
763
+ {
764
+ "type": "null"
765
+ }
766
+ ]
767
+ },
768
+ "personId": {
769
+ "anyOf": [
770
+ {
771
+ "type": "string",
772
+ "maxLength": 40
773
+ },
774
+ {
775
+ "type": "null"
776
+ }
777
+ ]
778
+ },
779
+ "assignee": {
780
+ "anyOf": [
781
+ {
782
+ "type": "string",
783
+ "maxLength": 80
784
+ },
785
+ {
786
+ "type": "null"
787
+ }
788
+ ]
789
+ },
790
+ "dueOn": {
791
+ "type": "string"
792
+ }
793
+ },
794
+ "required": [
795
+ "title",
796
+ "dueOn"
797
+ ],
798
+ "additionalProperties": false
799
+ }
800
+ }
801
+ ]
802
+ },
803
+ "admin": {
804
+ "settingsSchema": {
805
+ "roles": {
806
+ "label": "Roles and permissions as JSON, highest role first (see the README); empty uses the defaults",
807
+ "type": "string",
808
+ "multiline": true
809
+ },
810
+ "ownerRole": {
811
+ "label": "The role that owns an organisation",
812
+ "type": "string",
813
+ "default": "owner"
814
+ },
815
+ "billingRole": {
816
+ "label": "The role that gets renewal reminders (used by Memberships)",
817
+ "type": "string",
818
+ "default": "billing"
819
+ },
820
+ "notifyPermission": {
821
+ "label": "Permission that receives notifications about an organisation's entries",
822
+ "type": "string",
823
+ "default": "notify"
824
+ },
825
+ "contactRole": {
826
+ "label": "Role for people added without one (imports, staff)",
827
+ "type": "string",
828
+ "default": "contact"
829
+ },
830
+ "orgFields": {
831
+ "label": "Custom fields on organisations (JSON; see the README)",
832
+ "type": "string",
833
+ "multiline": true
834
+ },
835
+ "personFields": {
836
+ "label": "Custom fields on people (JSON; see the README)",
837
+ "type": "string",
838
+ "multiline": true
839
+ },
840
+ "timeZone": {
841
+ "label": "Time zone for due dates (IANA name, e.g. Europe/London)",
842
+ "type": "string",
843
+ "default": "UTC"
844
+ },
845
+ "serviceKey": {
846
+ "label": "Service key: give the same value to plugins that build on the CRM (Memberships and others)",
847
+ "type": "secret"
848
+ },
849
+ "webhookSecret": {
850
+ "label": "Webhook signing secret",
851
+ "type": "secret"
852
+ },
853
+ "callBudget": {
854
+ "label": "Host calls per background run (28 suits a Cloudflare sandbox; raise it when running in-process)",
855
+ "type": "number",
856
+ "default": 28,
857
+ "min": 10,
858
+ "max": 10000
859
+ },
860
+ "auditDays": {
861
+ "label": "Keep the audit trail for (days)",
862
+ "type": "number",
863
+ "default": 730,
864
+ "min": 30,
865
+ "max": 3650
866
+ },
867
+ "deliveryDays": {
868
+ "label": "Keep webhook delivery records for (days)",
869
+ "type": "number",
870
+ "default": 30,
871
+ "min": 1,
872
+ "max": 365
873
+ }
874
+ },
875
+ "pages": [
876
+ {
877
+ "path": "/organisations",
878
+ "label": "Organisations",
879
+ "icon": "buildings",
880
+ "group": "CRM"
881
+ },
882
+ {
883
+ "path": "/tasks",
884
+ "label": "Tasks",
885
+ "icon": "check-square",
886
+ "group": "CRM"
887
+ },
888
+ {
889
+ "path": "/import",
890
+ "label": "Import",
891
+ "icon": "upload",
892
+ "group": "CRM"
893
+ },
894
+ {
895
+ "path": "/privacy",
896
+ "label": "Data requests",
897
+ "icon": "shield-check",
898
+ "group": "CRM"
899
+ },
900
+ {
901
+ "path": "/webhooks",
902
+ "label": "Webhooks",
903
+ "icon": "plugs",
904
+ "group": "CRM"
905
+ },
906
+ {
907
+ "path": "/audit",
908
+ "label": "Audit trail",
909
+ "icon": "clock-counter-clockwise",
910
+ "group": "CRM"
911
+ }
912
+ ],
913
+ "widgets": [
914
+ {
915
+ "id": "overview",
916
+ "title": "CRM",
917
+ "size": "half"
918
+ }
919
+ ]
920
+ }
921
+ }