@snokam/mcp-api 1.21.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/auth.d.ts +0 -15
  2. package/dist/auth.js +17 -61
  3. package/dist/builtin-tools.d.ts +109 -0
  4. package/dist/builtin-tools.js +200 -0
  5. package/dist/execute-call.d.ts +5 -0
  6. package/dist/execute-call.js +45 -0
  7. package/dist/index.d.ts +0 -7
  8. package/dist/index.js +16 -311
  9. package/dist/openapi-loader.d.ts +1 -14
  10. package/dist/openapi-loader.js +27 -50
  11. package/dist/requirements.d.ts +10 -0
  12. package/dist/requirements.js +92 -0
  13. package/dist/state.d.ts +14 -0
  14. package/dist/state.js +66 -0
  15. package/dist/tool-schema.d.ts +2 -0
  16. package/dist/tool-schema.js +42 -0
  17. package/package.json +3 -3
  18. package/specs/production/accounting.json +2629 -1754
  19. package/specs/production/blog.json +1608 -1
  20. package/specs/production/broker.json +52 -24
  21. package/specs/production/chatgpt.json +299 -17
  22. package/specs/production/employees.json +2979 -299
  23. package/specs/production/events.json +366 -52
  24. package/specs/production/notifications.json +390 -13
  25. package/specs/production/office.json +818 -836
  26. package/specs/production/recruitment.json +3635 -1
  27. package/specs/production/sales.json +5088 -393
  28. package/specs/production/sanity.json +29008 -15539
  29. package/specs/production/sync.json +116 -20
  30. package/specs/production/webshop.json +38 -18
  31. package/specs/test/accounting.json +2629 -1754
  32. package/specs/test/blog.json +1608 -1
  33. package/specs/test/broker.json +52 -24
  34. package/specs/test/chatgpt.json +299 -17
  35. package/specs/test/employees.json +2979 -299
  36. package/specs/test/events.json +366 -52
  37. package/specs/test/notifications.json +390 -13
  38. package/specs/test/office.json +818 -836
  39. package/specs/test/recruitment.json +3635 -1
  40. package/specs/test/sales.json +5088 -393
  41. package/specs/test/sanity.json +29008 -15539
  42. package/specs/test/sync.json +116 -20
  43. package/specs/test/webshop.json +38 -18
@@ -11,6 +11,223 @@
11
11
  }
12
12
  ],
13
13
  "paths": {
14
+ "/v1.0/protected/health/{provider}": {
15
+ "get": {
16
+ "tags": [
17
+ "Health"
18
+ ],
19
+ "summary": "Checks an integration's connectivity",
20
+ "operationId": "NotificationsIntegrationHealth",
21
+ "parameters": [
22
+ {
23
+ "name": "provider",
24
+ "in": "path",
25
+ "required": true,
26
+ "schema": {
27
+ "type": "string"
28
+ }
29
+ }
30
+ ],
31
+ "responses": {
32
+ "200": {
33
+ "description": "Health result",
34
+ "content": {
35
+ "application/json": {
36
+ "schema": {
37
+ "$ref": "#/components/schemas/integrationHealthResult"
38
+ }
39
+ }
40
+ }
41
+ }
42
+ },
43
+ "security": [
44
+ {
45
+ "Implicit": [
46
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
47
+ ]
48
+ },
49
+ {
50
+ "ApiKey": []
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ "/v1.0/protected/newsletter/trigger": {
56
+ "post": {
57
+ "tags": [
58
+ "Notifications"
59
+ ],
60
+ "summary": "Trigger newsletter summarizer",
61
+ "description": "Manually runs the weekly knowledge-summarizer cron (iterates active newsletterSeries, posts Olaf's summary to the configured Slack channel per series, and emails subscribers for series with sendEmails=true).",
62
+ "operationId": "TriggerKnowledgeSummarizer",
63
+ "responses": {
64
+ "200": {
65
+ "description": "Summarizer run completed",
66
+ "x-ms-summary": "Success"
67
+ }
68
+ },
69
+ "security": [
70
+ {
71
+ "Implicit": [
72
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
73
+ ]
74
+ },
75
+ {
76
+ "ApiKey": []
77
+ }
78
+ ]
79
+ }
80
+ },
81
+ "/v1.0/protected/newsletter/debug": {
82
+ "post": {
83
+ "tags": [
84
+ "Notifications"
85
+ ],
86
+ "summary": "Preview newsletters by email",
87
+ "description": "Generates Olaf's summary for each active newsletterSeries and emails the rendered body (same composition the real cron uses) to the caller-supplied address. Skips Sanity persistence, Slack posts, and the 7-day dedup check — subscribers are never touched. Defaults to utvikling@snokam.no.",
88
+ "operationId": "DebugNewsletterEmail",
89
+ "parameters": [
90
+ {
91
+ "name": "to",
92
+ "in": "query",
93
+ "schema": {
94
+ "type": "string"
95
+ },
96
+ "x-ms-summary": "Recipient email (defaults to utvikling@snokam.no)"
97
+ }
98
+ ],
99
+ "responses": {
100
+ "200": {
101
+ "description": "Payload of Object",
102
+ "content": {
103
+ "application/json": {
104
+ "schema": {
105
+ "type": "object"
106
+ }
107
+ }
108
+ },
109
+ "x-ms-summary": "Preview sent"
110
+ }
111
+ },
112
+ "security": [
113
+ {
114
+ "Implicit": [
115
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
116
+ ]
117
+ },
118
+ {
119
+ "ApiKey": []
120
+ }
121
+ ]
122
+ }
123
+ },
124
+ "/v1.0/protected/alerts/azure": {
125
+ "post": {
126
+ "tags": [
127
+ "Alerts"
128
+ ],
129
+ "summary": "Receive Azure Monitor alert",
130
+ "description": "Action Group webhook receiver for the Azure Monitor common alert schema. Posts a formatted summary to the channel given by ?channel= (defaults to #feed-errors).",
131
+ "operationId": "ReceiveAzureAlert",
132
+ "parameters": [
133
+ {
134
+ "name": "channel",
135
+ "in": "query",
136
+ "schema": {
137
+ "type": "string"
138
+ },
139
+ "x-ms-summary": "Slack channel including the leading # (defaults to #feed-errors)"
140
+ }
141
+ ],
142
+ "responses": {
143
+ "200": {
144
+ "description": "Alert relayed",
145
+ "x-ms-summary": "Success"
146
+ }
147
+ },
148
+ "security": [
149
+ {
150
+ "Implicit": [
151
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
152
+ ]
153
+ },
154
+ {
155
+ "ApiKey": []
156
+ }
157
+ ]
158
+ }
159
+ },
160
+ "/v1.0/protected/routing": {
161
+ "get": {
162
+ "tags": [
163
+ "Notifications"
164
+ ],
165
+ "summary": "Get notification routing",
166
+ "description": "Returns the tenant's notification routing plus the known keys and active chat provider.",
167
+ "operationId": "GetNotificationRouting",
168
+ "responses": {
169
+ "200": {
170
+ "description": "Payload of NotificationRoutingResponse",
171
+ "content": {
172
+ "application/json": {
173
+ "schema": {
174
+ "$ref": "#/components/schemas/notificationRoutingResponse"
175
+ }
176
+ }
177
+ },
178
+ "x-ms-summary": "Success"
179
+ }
180
+ },
181
+ "security": [
182
+ {
183
+ "Implicit": [
184
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
185
+ ]
186
+ },
187
+ {
188
+ "ApiKey": []
189
+ }
190
+ ]
191
+ },
192
+ "put": {
193
+ "tags": [
194
+ "Notifications"
195
+ ],
196
+ "summary": "Update notification routing",
197
+ "description": "Upserts the tenant's notification routing (routes + default destination).",
198
+ "operationId": "UpdateNotificationRouting",
199
+ "requestBody": {
200
+ "content": {
201
+ "application/json": {
202
+ "schema": {
203
+ "$ref": "#/components/schemas/updateNotificationRoutingRequest"
204
+ }
205
+ }
206
+ },
207
+ "required": true
208
+ },
209
+ "responses": {
210
+ "204": {
211
+ "description": "No description",
212
+ "x-ms-summary": "Saved"
213
+ },
214
+ "400": {
215
+ "description": "No description",
216
+ "x-ms-summary": "Invalid body"
217
+ }
218
+ },
219
+ "security": [
220
+ {
221
+ "Implicit": [
222
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
223
+ ]
224
+ },
225
+ {
226
+ "ApiKey": []
227
+ }
228
+ ]
229
+ }
230
+ },
14
231
  "/v1.0/protected/push/register": {
15
232
  "post": {
16
233
  "tags": [
@@ -39,8 +256,11 @@
39
256
  "security": [
40
257
  {
41
258
  "Implicit": [
42
- "api://246713d5-cd48-4a00-84dd-7fc7ae290a62/.default"
259
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
43
260
  ]
261
+ },
262
+ {
263
+ "ApiKey": []
44
264
  }
45
265
  ]
46
266
  }
@@ -62,8 +282,11 @@
62
282
  "security": [
63
283
  {
64
284
  "Implicit": [
65
- "api://246713d5-cd48-4a00-84dd-7fc7ae290a62/.default"
285
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
66
286
  ]
287
+ },
288
+ {
289
+ "ApiKey": []
67
290
  }
68
291
  ]
69
292
  }
@@ -96,8 +319,11 @@
96
319
  "security": [
97
320
  {
98
321
  "Implicit": [
99
- "api://246713d5-cd48-4a00-84dd-7fc7ae290a62/.default"
322
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
100
323
  ]
324
+ },
325
+ {
326
+ "ApiKey": []
101
327
  }
102
328
  ]
103
329
  }
@@ -130,8 +356,11 @@
130
356
  "security": [
131
357
  {
132
358
  "Implicit": [
133
- "api://246713d5-cd48-4a00-84dd-7fc7ae290a62/.default"
359
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
134
360
  ]
361
+ },
362
+ {
363
+ "ApiKey": []
135
364
  }
136
365
  ]
137
366
  }
@@ -164,8 +393,11 @@
164
393
  "security": [
165
394
  {
166
395
  "Implicit": [
167
- "api://246713d5-cd48-4a00-84dd-7fc7ae290a62/.default"
396
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
168
397
  ]
398
+ },
399
+ {
400
+ "ApiKey": []
169
401
  }
170
402
  ]
171
403
  }
@@ -198,8 +430,11 @@
198
430
  "security": [
199
431
  {
200
432
  "Implicit": [
201
- "api://246713d5-cd48-4a00-84dd-7fc7ae290a62/.default"
433
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
202
434
  ]
435
+ },
436
+ {
437
+ "ApiKey": []
203
438
  }
204
439
  ]
205
440
  }
@@ -232,8 +467,11 @@
232
467
  "security": [
233
468
  {
234
469
  "Implicit": [
235
- "api://246713d5-cd48-4a00-84dd-7fc7ae290a62/.default"
470
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
236
471
  ]
472
+ },
473
+ {
474
+ "ApiKey": []
237
475
  }
238
476
  ]
239
477
  }
@@ -255,8 +493,11 @@
255
493
  "security": [
256
494
  {
257
495
  "Implicit": [
258
- "api://246713d5-cd48-4a00-84dd-7fc7ae290a62/.default"
496
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
259
497
  ]
498
+ },
499
+ {
500
+ "ApiKey": []
260
501
  }
261
502
  ]
262
503
  }
@@ -285,11 +526,63 @@
285
526
  "security": [
286
527
  {
287
528
  "Implicit": [
288
- "api://246713d5-cd48-4a00-84dd-7fc7ae290a62/.default"
529
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
289
530
  ]
290
531
  }
291
532
  ]
292
533
  }
534
+ },
535
+ "/v1.0/protected/time-logging/reminder/trigger": {
536
+ "post": {
537
+ "tags": [
538
+ "Notifications"
539
+ ],
540
+ "summary": "Trigger the time-logging SMS reminder",
541
+ "description": "Manually runs the personal time-logging SMS reminder for the calling tenant: texts active employees who have not yet locked their hours for the current month. Ignores the last-day-of-month gate.",
542
+ "operationId": "TriggerTimeLoggingReminder",
543
+ "responses": {
544
+ "200": {
545
+ "description": "Reminder run completed",
546
+ "x-ms-summary": "Success"
547
+ }
548
+ },
549
+ "security": [
550
+ {
551
+ "Implicit": [
552
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
553
+ ]
554
+ },
555
+ {
556
+ "ApiKey": []
557
+ }
558
+ ]
559
+ }
560
+ },
561
+ "/v1.0/protected/time-logging/shame/trigger": {
562
+ "post": {
563
+ "tags": [
564
+ "Notifications"
565
+ ],
566
+ "summary": "Trigger the monthly time-logging shame",
567
+ "description": "Manually runs the monthly time-logging shame for the calling tenant: reads employees without all hours approved for last month from accounting/PowerOffice and posts the public reminder to #general.",
568
+ "operationId": "TriggerTimeLoggingShame",
569
+ "responses": {
570
+ "200": {
571
+ "description": "Shame run completed",
572
+ "x-ms-summary": "Success"
573
+ }
574
+ },
575
+ "security": [
576
+ {
577
+ "Implicit": [
578
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default"
579
+ ]
580
+ },
581
+ {
582
+ "ApiKey": []
583
+ }
584
+ ]
585
+ }
293
586
  }
294
587
  },
295
588
  "components": {
@@ -314,6 +607,71 @@
314
607
  }
315
608
  }
316
609
  },
610
+ "integrationHealthResult": {
611
+ "type": "object",
612
+ "properties": {
613
+ "key": {
614
+ "type": "string"
615
+ },
616
+ "status": {
617
+ "type": "string"
618
+ },
619
+ "message": {
620
+ "type": "string"
621
+ }
622
+ }
623
+ },
624
+ "notificationKnownKeyDto": {
625
+ "type": "object",
626
+ "properties": {
627
+ "key": {
628
+ "type": "string"
629
+ },
630
+ "title": {
631
+ "type": "string"
632
+ },
633
+ "group": {
634
+ "type": "string"
635
+ }
636
+ }
637
+ },
638
+ "notificationRouteDto": {
639
+ "type": "object",
640
+ "properties": {
641
+ "key": {
642
+ "type": "string"
643
+ },
644
+ "destination": {
645
+ "type": "string"
646
+ },
647
+ "enabled": {
648
+ "type": "boolean"
649
+ }
650
+ }
651
+ },
652
+ "notificationRoutingResponse": {
653
+ "type": "object",
654
+ "properties": {
655
+ "routes": {
656
+ "type": "array",
657
+ "items": {
658
+ "$ref": "#/components/schemas/notificationRouteDto"
659
+ }
660
+ },
661
+ "defaultDestination": {
662
+ "type": "string"
663
+ },
664
+ "knownKeys": {
665
+ "type": "array",
666
+ "items": {
667
+ "$ref": "#/components/schemas/notificationKnownKeyDto"
668
+ }
669
+ },
670
+ "activeChatProvider": {
671
+ "type": "string"
672
+ }
673
+ }
674
+ },
317
675
  "sendEmailAttachmentRequest": {
318
676
  "type": "object",
319
677
  "properties": {
@@ -442,6 +800,20 @@
442
800
  "type": "string"
443
801
  }
444
802
  }
803
+ },
804
+ "updateNotificationRoutingRequest": {
805
+ "type": "object",
806
+ "properties": {
807
+ "routes": {
808
+ "type": "array",
809
+ "items": {
810
+ "$ref": "#/components/schemas/notificationRouteDto"
811
+ }
812
+ },
813
+ "defaultDestination": {
814
+ "type": "string"
815
+ }
816
+ }
445
817
  }
446
818
  },
447
819
  "securitySchemes": {
@@ -449,14 +821,19 @@
449
821
  "type": "oauth2",
450
822
  "flows": {
451
823
  "implicit": {
452
- "authorizationUrl": "https://login.microsoftonline.com/a8533784-aa3c-403b-a61a-1533ecc6e3ed/oauth2/v2.0/authorize",
453
- "tokenUrl": "https://login.microsoftonline.com/a8533784-aa3c-403b-a61a-1533ecc6e3ed/oauth2/v2.0/token",
454
- "refreshUrl": "https://login.microsoftonline.com/a8533784-aa3c-403b-a61a-1533ecc6e3ed/oauth2/v2.0/token",
824
+ "authorizationUrl": "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",
825
+ "tokenUrl": "https://login.microsoftonline.com/organizations/oauth2/v2.0/token",
826
+ "refreshUrl": "https://login.microsoftonline.com/organizations/oauth2/v2.0/token",
455
827
  "scopes": {
456
- "api://246713d5-cd48-4a00-84dd-7fc7ae290a62/.default": "Default function scope"
828
+ "api://b2c47b20-df4a-49b5-a7ee-87f3647ab227/.default": "Default function scope"
457
829
  }
458
830
  }
459
831
  }
832
+ },
833
+ "ApiKey": {
834
+ "type": "http",
835
+ "scheme": "bearer",
836
+ "bearerFormat": "JWT"
460
837
  }
461
838
  }
462
839
  }