@imbue-ai/detent 1.15.0 → 1.15.2
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/README.md +12 -0
- package/dist/src/schemas/generatedBuiltinSchemas.d.ts.map +1 -1
- package/dist/src/schemas/generatedBuiltinSchemas.js +745 -72
- package/dist/src/schemas/generatedBuiltinSchemas.js.map +1 -1
- package/dist/tests/builtinSchemas.test.js +255 -89
- package/dist/tests/builtinSchemas.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -992,18 +992,42 @@ describe('builtin schemas: notion-mcp', () => {
|
|
|
992
992
|
const readAll = builtinRegistry.get('notion-mcp-read-all');
|
|
993
993
|
for (const tool of [
|
|
994
994
|
'notion-search',
|
|
995
|
+
'notion-ai-search',
|
|
995
996
|
'notion-fetch',
|
|
996
997
|
'notion-query-data-sources',
|
|
998
|
+
'notion-query-multiple-data-sources',
|
|
997
999
|
'notion-query-database-view',
|
|
1000
|
+
'notion-query-meeting-notes',
|
|
1001
|
+
'notion-list-recent-pages',
|
|
1002
|
+
'notion-list-private-pages',
|
|
1003
|
+
'notion-list-favorite-pages',
|
|
1004
|
+
'notion-list-shared-pages',
|
|
998
1005
|
'notion-get-comments',
|
|
999
1006
|
'notion-get-teams',
|
|
1007
|
+
'notion-get-users',
|
|
1000
1008
|
'notion-get-self',
|
|
1009
|
+
'notion-get-async-task',
|
|
1010
|
+
'notion-search-skills',
|
|
1011
|
+
'notion-download-skill',
|
|
1012
|
+
'notion-download-attachment',
|
|
1013
|
+
'notion-list-agents',
|
|
1014
|
+
'notion-search-agents',
|
|
1015
|
+
'notion-query-sessions',
|
|
1016
|
+
'notion-search-sessions',
|
|
1017
|
+
'notion-get-session-status',
|
|
1018
|
+
'notion-wait-session',
|
|
1019
|
+
'notion-list-session-events',
|
|
1020
|
+
'notion-read-session-event',
|
|
1021
|
+
'notion-check-mcp-next-steps',
|
|
1022
|
+
'notion-show-advanced-analysis-next-steps',
|
|
1001
1023
|
]) {
|
|
1002
1024
|
expect(readAll.match(mcpRequest(toolCall(tool))), `read-all should allow ${tool}`).toBe(true);
|
|
1003
1025
|
}
|
|
1004
1026
|
expect(readAll.match(mcpRequest(rpc('initialize')))).toBe(true);
|
|
1005
1027
|
expect(readAll.match(mcpRequest(toolCall('notion-create-pages')))).toBe(false);
|
|
1006
1028
|
expect(readAll.match(mcpRequest(toolCall('notion-update-page')))).toBe(false);
|
|
1029
|
+
expect(readAll.match(mcpRequest(toolCall('notion-spawn-session')))).toBe(false);
|
|
1030
|
+
expect(readAll.match(mcpRequest(toolCall('notion-create-attachment')))).toBe(false);
|
|
1007
1031
|
});
|
|
1008
1032
|
it('notion-mcp-write-all matches write tools and the handshake but not reads', () => {
|
|
1009
1033
|
expectSchemaExists('notion-mcp-write-all');
|
|
@@ -1013,17 +1037,84 @@ describe('builtin schemas: notion-mcp', () => {
|
|
|
1013
1037
|
'notion-update-page',
|
|
1014
1038
|
'notion-move-pages',
|
|
1015
1039
|
'notion-duplicate-page',
|
|
1040
|
+
'notion-convert-page-to-skill',
|
|
1041
|
+
'notion-create-file-upload',
|
|
1042
|
+
'notion-create-attachment',
|
|
1016
1043
|
'notion-create-database',
|
|
1044
|
+
'notion-create-folder',
|
|
1045
|
+
'notion-update-folder',
|
|
1017
1046
|
'notion-update-data-source',
|
|
1018
1047
|
'notion-create-view',
|
|
1019
1048
|
'notion-update-view',
|
|
1020
1049
|
'notion-create-comment',
|
|
1050
|
+
'notion-spawn-session',
|
|
1051
|
+
'notion-stop-session',
|
|
1052
|
+
'notion-send-message-to-session',
|
|
1021
1053
|
]) {
|
|
1022
1054
|
expect(writeAll.match(mcpRequest(toolCall(tool))), `write-all should allow ${tool}`).toBe(true);
|
|
1023
1055
|
}
|
|
1024
1056
|
expect(writeAll.match(mcpRequest(rpc('initialize')))).toBe(true);
|
|
1025
1057
|
expect(writeAll.match(mcpRequest(toolCall('notion-search')))).toBe(false);
|
|
1026
1058
|
expect(writeAll.match(mcpRequest(toolCall('notion-fetch')))).toBe(false);
|
|
1059
|
+
expect(writeAll.match(mcpRequest(toolCall('notion-list-private-pages')))).toBe(false);
|
|
1060
|
+
});
|
|
1061
|
+
it('notion-mcp-list-pages matches the undocumented page-listing tools', () => {
|
|
1062
|
+
expectSchemaExists('notion-mcp-list-pages');
|
|
1063
|
+
const listPages = builtinRegistry.get('notion-mcp-list-pages');
|
|
1064
|
+
for (const tool of [
|
|
1065
|
+
'notion-list-recent-pages',
|
|
1066
|
+
'notion-list-private-pages',
|
|
1067
|
+
'notion-list-favorite-pages',
|
|
1068
|
+
'notion-list-shared-pages',
|
|
1069
|
+
]) {
|
|
1070
|
+
expect(listPages.match(mcpRequest(toolCall(tool))), `should allow ${tool}`).toBe(true);
|
|
1071
|
+
}
|
|
1072
|
+
expect(listPages.match(mcpRequest(toolCall('notion-search')))).toBe(false);
|
|
1073
|
+
});
|
|
1074
|
+
it('notion-mcp-query-data-sources covers the single and multi data source tools', () => {
|
|
1075
|
+
expectSchemaExists('notion-mcp-query-data-sources');
|
|
1076
|
+
const query = builtinRegistry.get('notion-mcp-query-data-sources');
|
|
1077
|
+
expect(query.match(mcpRequest(toolCall('notion-query-data-sources')))).toBe(true);
|
|
1078
|
+
expect(query.match(mcpRequest(toolCall('notion-query-multiple-data-sources')))).toBe(true);
|
|
1079
|
+
expect(query.match(mcpRequest(toolCall('notion-query-database-view')))).toBe(false);
|
|
1080
|
+
});
|
|
1081
|
+
it('notion-mcp agent schemas separate reading sessions from driving them', () => {
|
|
1082
|
+
expectSchemaExists('notion-mcp-read-agents');
|
|
1083
|
+
expectSchemaExists('notion-mcp-write-agents');
|
|
1084
|
+
const readAgents = builtinRegistry.get('notion-mcp-read-agents');
|
|
1085
|
+
const writeAgents = builtinRegistry.get('notion-mcp-write-agents');
|
|
1086
|
+
expect(readAgents.match(mcpRequest(toolCall('notion-list-agents')))).toBe(true);
|
|
1087
|
+
expect(readAgents.match(mcpRequest(toolCall('notion-read-session-event')))).toBe(true);
|
|
1088
|
+
expect(readAgents.match(mcpRequest(toolCall('notion-spawn-session')))).toBe(false);
|
|
1089
|
+
expect(writeAgents.match(mcpRequest(toolCall('notion-spawn-session')))).toBe(true);
|
|
1090
|
+
expect(writeAgents.match(mcpRequest(toolCall('notion-send-message-to-session')))).toBe(true);
|
|
1091
|
+
expect(writeAgents.match(mcpRequest(toolCall('notion-get-session-status')))).toBe(false);
|
|
1092
|
+
});
|
|
1093
|
+
it('notion-mcp attachment schemas separate downloads from uploads', () => {
|
|
1094
|
+
expectSchemaExists('notion-mcp-read-attachments');
|
|
1095
|
+
expectSchemaExists('notion-mcp-write-attachments');
|
|
1096
|
+
const readAttachments = builtinRegistry.get('notion-mcp-read-attachments');
|
|
1097
|
+
const writeAttachments = builtinRegistry.get('notion-mcp-write-attachments');
|
|
1098
|
+
expect(readAttachments.match(mcpRequest(toolCall('notion-download-attachment')))).toBe(true);
|
|
1099
|
+
expect(readAttachments.match(mcpRequest(toolCall('notion-create-attachment')))).toBe(false);
|
|
1100
|
+
expect(writeAttachments.match(mcpRequest(toolCall('notion-create-file-upload')))).toBe(true);
|
|
1101
|
+
expect(writeAttachments.match(mcpRequest(toolCall('notion-create-attachment')))).toBe(true);
|
|
1102
|
+
expect(writeAttachments.match(mcpRequest(toolCall('notion-download-attachment')))).toBe(false);
|
|
1103
|
+
});
|
|
1104
|
+
it('notion-mcp single-tool schemas do not match the session handshake', () => {
|
|
1105
|
+
for (const schemaName of [
|
|
1106
|
+
'notion-mcp-ai-search',
|
|
1107
|
+
'notion-mcp-list-pages',
|
|
1108
|
+
'notion-mcp-query-meeting-notes',
|
|
1109
|
+
'notion-mcp-get-async-task',
|
|
1110
|
+
'notion-mcp-read-skills',
|
|
1111
|
+
'notion-mcp-next-steps',
|
|
1112
|
+
'notion-mcp-convert-page-to-skill',
|
|
1113
|
+
'notion-mcp-write-folders',
|
|
1114
|
+
]) {
|
|
1115
|
+
expectSchemaExists(schemaName);
|
|
1116
|
+
expect(builtinRegistry.get(schemaName).match(mcpRequest(rpc('initialize'))), `${schemaName} should not match the handshake`).toBe(false);
|
|
1117
|
+
}
|
|
1027
1118
|
});
|
|
1028
1119
|
});
|
|
1029
1120
|
describe('builtin schemas: sentry', () => {
|
|
@@ -1056,18 +1147,28 @@ describe('builtin schemas: sentry', () => {
|
|
|
1056
1147
|
});
|
|
1057
1148
|
});
|
|
1058
1149
|
describe('builtin schemas: slack', () => {
|
|
1150
|
+
function makeSlackRequest(overrides = {}) {
|
|
1151
|
+
return makeRequest({ domain: 'slack.com', ...overrides });
|
|
1152
|
+
}
|
|
1059
1153
|
it('slack scope matches slack.com', () => {
|
|
1060
1154
|
expectSchemaExists('slack-api');
|
|
1061
|
-
const request =
|
|
1062
|
-
domain: 'slack.com',
|
|
1155
|
+
const request = makeSlackRequest({
|
|
1063
1156
|
path: '/api/chat.postMessage',
|
|
1064
1157
|
});
|
|
1065
1158
|
expect(builtinRegistry.get('slack-api').match(request)).toBe(true);
|
|
1066
1159
|
});
|
|
1067
1160
|
it('slack scope rejects unrelated domains', () => {
|
|
1068
|
-
const request =
|
|
1161
|
+
const request = makeSlackRequest({ domain: 'slack.example.com' });
|
|
1069
1162
|
expect(builtinRegistry.get('slack-api').match(request)).toBe(false);
|
|
1070
1163
|
});
|
|
1164
|
+
it('slack scope matches files.slack.com, the file-content host', () => {
|
|
1165
|
+
expectSchemaExists('slack-api');
|
|
1166
|
+
const request = makeSlackRequest({
|
|
1167
|
+
domain: 'files.slack.com',
|
|
1168
|
+
path: '/files-pri/TEAM123-FILE456/download/image.png',
|
|
1169
|
+
});
|
|
1170
|
+
expect(builtinRegistry.get('slack-api').match(request)).toBe(true);
|
|
1171
|
+
});
|
|
1071
1172
|
it('slack-read-all matches known read methods across all families', () => {
|
|
1072
1173
|
expectSchemaExists('slack-read-all');
|
|
1073
1174
|
const readMethods = [
|
|
@@ -1108,22 +1209,53 @@ describe('builtin schemas: slack', () => {
|
|
|
1108
1209
|
'/api/threads.getView',
|
|
1109
1210
|
];
|
|
1110
1211
|
for (const path of readMethods) {
|
|
1111
|
-
expect(builtinRegistry.get('slack-read-all').match(
|
|
1212
|
+
expect(builtinRegistry.get('slack-read-all').match(makeSlackRequest({ path })), `Expected slack-read-all to match "${path}"`).toBe(true);
|
|
1112
1213
|
}
|
|
1113
1214
|
});
|
|
1215
|
+
it('slack-read-all matches file content and thumbnail downloads on files.slack.com only', () => {
|
|
1216
|
+
const filePaths = [
|
|
1217
|
+
'/files-pri/TEAM123-FILE456/image.png',
|
|
1218
|
+
'/files-pri/TEAM123-FILE456/download/image.png',
|
|
1219
|
+
'/files-tmb/TEAM123-FILE456-abcdef1234/image_360.png',
|
|
1220
|
+
];
|
|
1221
|
+
for (const path of filePaths) {
|
|
1222
|
+
expect(builtinRegistry
|
|
1223
|
+
.get('slack-read-all')
|
|
1224
|
+
.match(makeRequest({ domain: 'files.slack.com', path })), `Expected slack-read-all to match "${path}" on files.slack.com`).toBe(true);
|
|
1225
|
+
expect(builtinRegistry.get('slack-read-all').match(makeSlackRequest({ path })), `Expected slack-read-all to reject "${path}" on slack.com`).toBe(false);
|
|
1226
|
+
}
|
|
1227
|
+
expect(builtinRegistry
|
|
1228
|
+
.get('slack-read-all')
|
|
1229
|
+
.match(makeRequest({ domain: 'files.slack.com', path: '/api/conversations.history' }))).toBe(false);
|
|
1230
|
+
});
|
|
1231
|
+
it('slack scopes reject unrelated domains even for matching paths', () => {
|
|
1232
|
+
expect(builtinRegistry
|
|
1233
|
+
.get('slack-read-all')
|
|
1234
|
+
.match(makeRequest({ path: '/api/conversations.history' }))).toBe(false);
|
|
1235
|
+
expect(builtinRegistry.get('slack-chat-write').match(makeRequest({ path: '/api/chat.postMessage' }))).toBe(false);
|
|
1236
|
+
expect(builtinRegistry
|
|
1237
|
+
.get('slack-files-read')
|
|
1238
|
+
.match(makeRequest({ path: '/files-pri/TEAM123-FILE456/download/image.png' }))).toBe(false);
|
|
1239
|
+
});
|
|
1114
1240
|
it('slack-auth-read matches read auth methods but not write', () => {
|
|
1115
1241
|
expectSchemaExists('slack-auth-read');
|
|
1116
|
-
expect(builtinRegistry.get('slack-auth-read').match(
|
|
1117
|
-
expect(builtinRegistry
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
expect(builtinRegistry.get('slack-auth-read').match(
|
|
1242
|
+
expect(builtinRegistry.get('slack-auth-read').match(makeSlackRequest({ path: '/api/auth.test' }))).toBe(true);
|
|
1243
|
+
expect(builtinRegistry
|
|
1244
|
+
.get('slack-auth-read')
|
|
1245
|
+
.match(makeSlackRequest({ path: '/api/auth.teams.list' }))).toBe(true);
|
|
1246
|
+
expect(builtinRegistry.get('slack-auth-read').match(makeSlackRequest({ path: '/api/auth.revoke' }))).toBe(false);
|
|
1247
|
+
expect(builtinRegistry.get('slack-auth-read').match(makeSlackRequest({ path: '/api/auth.testfoo' }))).toBe(false);
|
|
1248
|
+
expect(builtinRegistry
|
|
1249
|
+
.get('slack-auth-read')
|
|
1250
|
+
.match(makeSlackRequest({ path: '/api/chat.postMessage' }))).toBe(false);
|
|
1121
1251
|
});
|
|
1122
1252
|
it('slack-auth-write matches write auth methods but not read', () => {
|
|
1123
1253
|
expectSchemaExists('slack-auth-write');
|
|
1124
|
-
expect(builtinRegistry.get('slack-auth-write').match(
|
|
1125
|
-
expect(builtinRegistry.get('slack-auth-write').match(
|
|
1126
|
-
expect(builtinRegistry
|
|
1254
|
+
expect(builtinRegistry.get('slack-auth-write').match(makeSlackRequest({ path: '/api/auth.revoke' }))).toBe(true);
|
|
1255
|
+
expect(builtinRegistry.get('slack-auth-write').match(makeSlackRequest({ path: '/api/auth.test' }))).toBe(false);
|
|
1256
|
+
expect(builtinRegistry
|
|
1257
|
+
.get('slack-auth-write')
|
|
1258
|
+
.match(makeSlackRequest({ path: '/api/auth.teams.list' }))).toBe(false);
|
|
1127
1259
|
});
|
|
1128
1260
|
it('slack-read-all rejects known write methods', () => {
|
|
1129
1261
|
const writeMethods = [
|
|
@@ -1142,7 +1274,7 @@ describe('builtin schemas: slack', () => {
|
|
|
1142
1274
|
'/api/subscriptions.thread.mark',
|
|
1143
1275
|
];
|
|
1144
1276
|
for (const path of writeMethods) {
|
|
1145
|
-
expect(builtinRegistry.get('slack-read-all').match(
|
|
1277
|
+
expect(builtinRegistry.get('slack-read-all').match(makeSlackRequest({ path })), `Expected slack-read-all to reject "${path}"`).toBe(false);
|
|
1146
1278
|
}
|
|
1147
1279
|
});
|
|
1148
1280
|
it('slack-write-all matches known write methods across all families', () => {
|
|
@@ -1205,7 +1337,7 @@ describe('builtin schemas: slack', () => {
|
|
|
1205
1337
|
'/api/subscriptions.thread.mark',
|
|
1206
1338
|
];
|
|
1207
1339
|
for (const path of writeMethods) {
|
|
1208
|
-
expect(builtinRegistry.get('slack-write-all').match(
|
|
1340
|
+
expect(builtinRegistry.get('slack-write-all').match(makeSlackRequest({ path })), `Expected slack-write-all to match "${path}"`).toBe(true);
|
|
1209
1341
|
}
|
|
1210
1342
|
});
|
|
1211
1343
|
it('slack-write-all rejects known read methods', () => {
|
|
@@ -1227,229 +1359,263 @@ describe('builtin schemas: slack', () => {
|
|
|
1227
1359
|
'/api/threads.getView',
|
|
1228
1360
|
];
|
|
1229
1361
|
for (const path of readMethods) {
|
|
1230
|
-
expect(builtinRegistry.get('slack-write-all').match(
|
|
1362
|
+
expect(builtinRegistry.get('slack-write-all').match(makeSlackRequest({ path })), `Expected slack-write-all to reject "${path}"`).toBe(false);
|
|
1231
1363
|
}
|
|
1232
1364
|
});
|
|
1233
1365
|
it('slack-chat-read matches read chat methods but not write', () => {
|
|
1234
1366
|
expectSchemaExists('slack-chat-read');
|
|
1235
|
-
expect(builtinRegistry.get('slack-chat-read').match(makeRequest({ path: '/api/chat.getPermalink' }))).toBe(true);
|
|
1236
1367
|
expect(builtinRegistry
|
|
1237
1368
|
.get('slack-chat-read')
|
|
1238
|
-
.match(
|
|
1239
|
-
expect(builtinRegistry
|
|
1240
|
-
|
|
1369
|
+
.match(makeSlackRequest({ path: '/api/chat.getPermalink' }))).toBe(true);
|
|
1370
|
+
expect(builtinRegistry
|
|
1371
|
+
.get('slack-chat-read')
|
|
1372
|
+
.match(makeSlackRequest({ path: '/api/chat.scheduledMessages.list' }))).toBe(true);
|
|
1373
|
+
expect(builtinRegistry
|
|
1374
|
+
.get('slack-chat-read')
|
|
1375
|
+
.match(makeSlackRequest({ path: '/api/chat.postMessage' }))).toBe(false);
|
|
1376
|
+
expect(builtinRegistry.get('slack-chat-read').match(makeSlackRequest({ path: '/api/chat.delete' }))).toBe(false);
|
|
1241
1377
|
});
|
|
1242
1378
|
it('slack-chat-write matches write chat methods but not read', () => {
|
|
1243
1379
|
expectSchemaExists('slack-chat-write');
|
|
1244
|
-
expect(builtinRegistry.get('slack-chat-write').match(makeRequest({ path: '/api/chat.postMessage' }))).toBe(true);
|
|
1245
|
-
expect(builtinRegistry.get('slack-chat-write').match(makeRequest({ path: '/api/chat.delete' }))).toBe(true);
|
|
1246
|
-
expect(builtinRegistry.get('slack-chat-write').match(makeRequest({ path: '/api/chat.update' }))).toBe(true);
|
|
1247
1380
|
expect(builtinRegistry
|
|
1248
1381
|
.get('slack-chat-write')
|
|
1249
|
-
.match(
|
|
1250
|
-
expect(builtinRegistry.get('slack-chat-write').match(
|
|
1251
|
-
expect(builtinRegistry.get('slack-chat-write').match(
|
|
1382
|
+
.match(makeSlackRequest({ path: '/api/chat.postMessage' }))).toBe(true);
|
|
1383
|
+
expect(builtinRegistry.get('slack-chat-write').match(makeSlackRequest({ path: '/api/chat.delete' }))).toBe(true);
|
|
1384
|
+
expect(builtinRegistry.get('slack-chat-write').match(makeSlackRequest({ path: '/api/chat.update' }))).toBe(true);
|
|
1385
|
+
expect(builtinRegistry
|
|
1386
|
+
.get('slack-chat-write')
|
|
1387
|
+
.match(makeSlackRequest({ path: '/api/chat.appendStream' }))).toBe(true);
|
|
1388
|
+
expect(builtinRegistry
|
|
1389
|
+
.get('slack-chat-write')
|
|
1390
|
+
.match(makeSlackRequest({ path: '/api/chat.startStream' }))).toBe(true);
|
|
1391
|
+
expect(builtinRegistry
|
|
1392
|
+
.get('slack-chat-write')
|
|
1393
|
+
.match(makeSlackRequest({ path: '/api/chat.stopStream' }))).toBe(true);
|
|
1252
1394
|
expect(builtinRegistry
|
|
1253
1395
|
.get('slack-chat-write')
|
|
1254
|
-
.match(
|
|
1396
|
+
.match(makeSlackRequest({ path: '/api/chat.getPermalink' }))).toBe(false);
|
|
1255
1397
|
});
|
|
1256
1398
|
it('slack-conversations-read matches read conversation methods but not write', () => {
|
|
1257
1399
|
expectSchemaExists('slack-conversations-read');
|
|
1258
1400
|
expect(builtinRegistry
|
|
1259
1401
|
.get('slack-conversations-read')
|
|
1260
|
-
.match(
|
|
1402
|
+
.match(makeSlackRequest({ path: '/api/conversations.list' }))).toBe(true);
|
|
1261
1403
|
expect(builtinRegistry
|
|
1262
1404
|
.get('slack-conversations-read')
|
|
1263
|
-
.match(
|
|
1405
|
+
.match(makeSlackRequest({ path: '/api/conversations.history' }))).toBe(true);
|
|
1264
1406
|
expect(builtinRegistry
|
|
1265
1407
|
.get('slack-conversations-read')
|
|
1266
|
-
.match(
|
|
1408
|
+
.match(makeSlackRequest({ path: '/api/conversations.listConnectInvites' }))).toBe(true);
|
|
1267
1409
|
expect(builtinRegistry
|
|
1268
1410
|
.get('slack-conversations-read')
|
|
1269
|
-
.match(
|
|
1411
|
+
.match(makeSlackRequest({ path: '/api/conversations.requestSharedInvite.list' }))).toBe(true);
|
|
1270
1412
|
expect(builtinRegistry
|
|
1271
1413
|
.get('slack-conversations-read')
|
|
1272
|
-
.match(
|
|
1414
|
+
.match(makeSlackRequest({ path: '/api/conversations.kick' }))).toBe(false);
|
|
1273
1415
|
expect(builtinRegistry
|
|
1274
1416
|
.get('slack-conversations-read')
|
|
1275
|
-
.match(
|
|
1417
|
+
.match(makeSlackRequest({ path: '/api/conversations.archive' }))).toBe(false);
|
|
1276
1418
|
});
|
|
1277
1419
|
it('slack-conversations-write matches write conversation methods but not read', () => {
|
|
1278
1420
|
expectSchemaExists('slack-conversations-write');
|
|
1279
1421
|
expect(builtinRegistry
|
|
1280
1422
|
.get('slack-conversations-write')
|
|
1281
|
-
.match(
|
|
1423
|
+
.match(makeSlackRequest({ path: '/api/conversations.kick' }))).toBe(true);
|
|
1282
1424
|
expect(builtinRegistry
|
|
1283
1425
|
.get('slack-conversations-write')
|
|
1284
|
-
.match(
|
|
1426
|
+
.match(makeSlackRequest({ path: '/api/conversations.archive' }))).toBe(true);
|
|
1285
1427
|
expect(builtinRegistry
|
|
1286
1428
|
.get('slack-conversations-write')
|
|
1287
|
-
.match(
|
|
1429
|
+
.match(makeSlackRequest({ path: '/api/conversations.create' }))).toBe(true);
|
|
1288
1430
|
expect(builtinRegistry
|
|
1289
1431
|
.get('slack-conversations-write')
|
|
1290
|
-
.match(
|
|
1432
|
+
.match(makeSlackRequest({ path: '/api/conversations.acceptSharedInvite' }))).toBe(true);
|
|
1291
1433
|
expect(builtinRegistry
|
|
1292
1434
|
.get('slack-conversations-write')
|
|
1293
|
-
.match(
|
|
1435
|
+
.match(makeSlackRequest({ path: '/api/conversations.canvasCreate' }))).toBe(true);
|
|
1294
1436
|
expect(builtinRegistry
|
|
1295
1437
|
.get('slack-conversations-write')
|
|
1296
|
-
.match(
|
|
1438
|
+
.match(makeSlackRequest({ path: '/api/conversations.inviteShared' }))).toBe(true);
|
|
1297
1439
|
expect(builtinRegistry
|
|
1298
1440
|
.get('slack-conversations-write')
|
|
1299
|
-
.match(
|
|
1441
|
+
.match(makeSlackRequest({ path: '/api/conversations.externalInvitePermissions.set' }))).toBe(true);
|
|
1300
1442
|
expect(builtinRegistry
|
|
1301
1443
|
.get('slack-conversations-write')
|
|
1302
|
-
.match(
|
|
1444
|
+
.match(makeSlackRequest({ path: '/api/conversations.requestSharedInvite.approve' }))).toBe(true);
|
|
1303
1445
|
expect(builtinRegistry
|
|
1304
1446
|
.get('slack-conversations-write')
|
|
1305
|
-
.match(
|
|
1447
|
+
.match(makeSlackRequest({ path: '/api/conversations.requestSharedInvite.deny' }))).toBe(true);
|
|
1306
1448
|
expect(builtinRegistry
|
|
1307
1449
|
.get('slack-conversations-write')
|
|
1308
|
-
.match(
|
|
1450
|
+
.match(makeSlackRequest({ path: '/api/conversations.list' }))).toBe(false);
|
|
1309
1451
|
expect(builtinRegistry
|
|
1310
1452
|
.get('slack-conversations-write')
|
|
1311
|
-
.match(
|
|
1453
|
+
.match(makeSlackRequest({ path: '/api/conversations.history' }))).toBe(false);
|
|
1312
1454
|
});
|
|
1313
1455
|
it('slack-users-read matches read user methods but not write', () => {
|
|
1314
1456
|
expectSchemaExists('slack-users-read');
|
|
1315
|
-
expect(builtinRegistry.get('slack-users-read').match(
|
|
1316
|
-
expect(builtinRegistry.get('slack-users-read').match(
|
|
1457
|
+
expect(builtinRegistry.get('slack-users-read').match(makeSlackRequest({ path: '/api/users.list' }))).toBe(true);
|
|
1458
|
+
expect(builtinRegistry.get('slack-users-read').match(makeSlackRequest({ path: '/api/users.info' }))).toBe(true);
|
|
1317
1459
|
expect(builtinRegistry
|
|
1318
1460
|
.get('slack-users-read')
|
|
1319
|
-
.match(
|
|
1461
|
+
.match(makeSlackRequest({ path: '/api/users.profile.get' }))).toBe(true);
|
|
1320
1462
|
expect(builtinRegistry
|
|
1321
1463
|
.get('slack-users-read')
|
|
1322
|
-
.match(
|
|
1464
|
+
.match(makeSlackRequest({ path: '/api/users.setPresence' }))).toBe(false);
|
|
1323
1465
|
expect(builtinRegistry
|
|
1324
1466
|
.get('slack-users-read')
|
|
1325
|
-
.match(
|
|
1467
|
+
.match(makeSlackRequest({ path: '/api/users.profile.set' }))).toBe(false);
|
|
1326
1468
|
});
|
|
1327
1469
|
it('slack-users-write matches write user methods but not read', () => {
|
|
1328
1470
|
expectSchemaExists('slack-users-write');
|
|
1329
1471
|
expect(builtinRegistry
|
|
1330
1472
|
.get('slack-users-write')
|
|
1331
|
-
.match(
|
|
1473
|
+
.match(makeSlackRequest({ path: '/api/users.setPresence' }))).toBe(true);
|
|
1332
1474
|
expect(builtinRegistry
|
|
1333
1475
|
.get('slack-users-write')
|
|
1334
|
-
.match(
|
|
1335
|
-
expect(builtinRegistry.get('slack-users-write').match(
|
|
1476
|
+
.match(makeSlackRequest({ path: '/api/users.profile.set' }))).toBe(true);
|
|
1477
|
+
expect(builtinRegistry.get('slack-users-write').match(makeSlackRequest({ path: '/api/users.list' }))).toBe(false);
|
|
1336
1478
|
});
|
|
1337
1479
|
it('slack-files-read matches read file methods but not write', () => {
|
|
1338
1480
|
expectSchemaExists('slack-files-read');
|
|
1339
|
-
expect(builtinRegistry.get('slack-files-read').match(
|
|
1340
|
-
expect(builtinRegistry.get('slack-files-read').match(
|
|
1481
|
+
expect(builtinRegistry.get('slack-files-read').match(makeSlackRequest({ path: '/api/files.info' }))).toBe(true);
|
|
1482
|
+
expect(builtinRegistry.get('slack-files-read').match(makeSlackRequest({ path: '/api/files.list' }))).toBe(true);
|
|
1483
|
+
expect(builtinRegistry
|
|
1484
|
+
.get('slack-files-read')
|
|
1485
|
+
.match(makeSlackRequest({ path: '/api/files.remote.info' }))).toBe(true);
|
|
1486
|
+
expect(builtinRegistry
|
|
1487
|
+
.get('slack-files-read')
|
|
1488
|
+
.match(makeSlackRequest({ path: '/api/files.getUploadURLExternal' }))).toBe(false);
|
|
1489
|
+
expect(builtinRegistry
|
|
1490
|
+
.get('slack-files-read')
|
|
1491
|
+
.match(makeSlackRequest({ path: '/api/files.delete' }))).toBe(false);
|
|
1492
|
+
});
|
|
1493
|
+
it('slack-files-read matches file content and thumbnail downloads on files.slack.com only', () => {
|
|
1494
|
+
expectSchemaExists('slack-files-read');
|
|
1495
|
+
const filesDomain = 'files.slack.com';
|
|
1341
1496
|
expect(builtinRegistry
|
|
1342
1497
|
.get('slack-files-read')
|
|
1343
|
-
.match(makeRequest({ path: '/
|
|
1498
|
+
.match(makeRequest({ domain: filesDomain, path: '/files-pri/TEAM123-FILE456/image.png' }))).toBe(true);
|
|
1499
|
+
expect(builtinRegistry.get('slack-files-read').match(makeRequest({
|
|
1500
|
+
domain: filesDomain,
|
|
1501
|
+
path: '/files-pri/TEAM123-FILE456/download/image.png',
|
|
1502
|
+
}))).toBe(true);
|
|
1503
|
+
expect(builtinRegistry.get('slack-files-read').match(makeRequest({
|
|
1504
|
+
domain: filesDomain,
|
|
1505
|
+
path: '/files-tmb/TEAM123-FILE456-abcdef1234/image_360.png',
|
|
1506
|
+
}))).toBe(true);
|
|
1344
1507
|
expect(builtinRegistry
|
|
1345
1508
|
.get('slack-files-read')
|
|
1346
|
-
.match(makeRequest({ path: '/api/files.
|
|
1347
|
-
expect(builtinRegistry.get('slack-files-read').match(makeRequest({ path: '/api/files.delete' }))).toBe(false);
|
|
1509
|
+
.match(makeRequest({ domain: filesDomain, path: '/api/files.info' }))).toBe(false);
|
|
1348
1510
|
});
|
|
1349
1511
|
it('slack-files-write matches write file methods but not read', () => {
|
|
1350
1512
|
expectSchemaExists('slack-files-write');
|
|
1351
1513
|
expect(builtinRegistry
|
|
1352
1514
|
.get('slack-files-write')
|
|
1353
|
-
.match(
|
|
1515
|
+
.match(makeSlackRequest({ path: '/api/files.getUploadURLExternal' }))).toBe(true);
|
|
1516
|
+
expect(builtinRegistry
|
|
1517
|
+
.get('slack-files-write')
|
|
1518
|
+
.match(makeSlackRequest({ path: '/api/files.completeUploadExternal' }))).toBe(true);
|
|
1354
1519
|
expect(builtinRegistry
|
|
1355
1520
|
.get('slack-files-write')
|
|
1356
|
-
.match(
|
|
1357
|
-
expect(builtinRegistry.get('slack-files-write').match(makeRequest({ path: '/api/files.delete' }))).toBe(true);
|
|
1521
|
+
.match(makeSlackRequest({ path: '/api/files.delete' }))).toBe(true);
|
|
1358
1522
|
expect(builtinRegistry
|
|
1359
1523
|
.get('slack-files-write')
|
|
1360
|
-
.match(
|
|
1361
|
-
expect(builtinRegistry.get('slack-files-write').match(
|
|
1362
|
-
expect(builtinRegistry.get('slack-files-write').match(
|
|
1524
|
+
.match(makeSlackRequest({ path: '/api/files.remote.remove' }))).toBe(true);
|
|
1525
|
+
expect(builtinRegistry.get('slack-files-write').match(makeSlackRequest({ path: '/api/files.info' }))).toBe(false);
|
|
1526
|
+
expect(builtinRegistry.get('slack-files-write').match(makeSlackRequest({ path: '/api/files.list' }))).toBe(false);
|
|
1363
1527
|
});
|
|
1364
1528
|
it('slack-reactions-read matches read reaction methods but not write', () => {
|
|
1365
1529
|
expectSchemaExists('slack-reactions-read');
|
|
1366
1530
|
expect(builtinRegistry
|
|
1367
1531
|
.get('slack-reactions-read')
|
|
1368
|
-
.match(
|
|
1532
|
+
.match(makeSlackRequest({ path: '/api/reactions.get' }))).toBe(true);
|
|
1369
1533
|
expect(builtinRegistry
|
|
1370
1534
|
.get('slack-reactions-read')
|
|
1371
|
-
.match(
|
|
1535
|
+
.match(makeSlackRequest({ path: '/api/reactions.list' }))).toBe(true);
|
|
1372
1536
|
expect(builtinRegistry
|
|
1373
1537
|
.get('slack-reactions-read')
|
|
1374
|
-
.match(
|
|
1538
|
+
.match(makeSlackRequest({ path: '/api/reactions.add' }))).toBe(false);
|
|
1375
1539
|
});
|
|
1376
1540
|
it('slack-reactions-write matches write reaction methods but not read', () => {
|
|
1377
1541
|
expectSchemaExists('slack-reactions-write');
|
|
1378
1542
|
expect(builtinRegistry
|
|
1379
1543
|
.get('slack-reactions-write')
|
|
1380
|
-
.match(
|
|
1544
|
+
.match(makeSlackRequest({ path: '/api/reactions.add' }))).toBe(true);
|
|
1381
1545
|
expect(builtinRegistry
|
|
1382
1546
|
.get('slack-reactions-write')
|
|
1383
|
-
.match(
|
|
1547
|
+
.match(makeSlackRequest({ path: '/api/reactions.remove' }))).toBe(true);
|
|
1384
1548
|
expect(builtinRegistry
|
|
1385
1549
|
.get('slack-reactions-write')
|
|
1386
|
-
.match(
|
|
1550
|
+
.match(makeSlackRequest({ path: '/api/reactions.get' }))).toBe(false);
|
|
1387
1551
|
});
|
|
1388
1552
|
it('slack-search matches search methods', () => {
|
|
1389
1553
|
expectSchemaExists('slack-search');
|
|
1390
|
-
expect(builtinRegistry.get('slack-search').match(
|
|
1391
|
-
expect(builtinRegistry.get('slack-search').match(
|
|
1392
|
-
expect(builtinRegistry.get('slack-search').match(
|
|
1554
|
+
expect(builtinRegistry.get('slack-search').match(makeSlackRequest({ path: '/api/search.messages' }))).toBe(true);
|
|
1555
|
+
expect(builtinRegistry.get('slack-search').match(makeSlackRequest({ path: '/api/search.files' }))).toBe(true);
|
|
1556
|
+
expect(builtinRegistry.get('slack-search').match(makeSlackRequest({ path: '/api/search.all' }))).toBe(true);
|
|
1557
|
+
expect(builtinRegistry
|
|
1558
|
+
.get('slack-search')
|
|
1559
|
+
.match(makeSlackRequest({ path: '/api/search.modules.messages' }))).toBe(true);
|
|
1393
1560
|
expect(builtinRegistry
|
|
1394
1561
|
.get('slack-search')
|
|
1395
|
-
.match(
|
|
1396
|
-
expect(builtinRegistry.get('slack-search').match(makeRequest({ path: '/api/chat.postMessage' }))).toBe(false);
|
|
1562
|
+
.match(makeSlackRequest({ path: '/api/chat.postMessage' }))).toBe(false);
|
|
1397
1563
|
});
|
|
1398
1564
|
it('slack-pins-read matches pins.list but not pins.add', () => {
|
|
1399
1565
|
expectSchemaExists('slack-pins-read');
|
|
1400
|
-
expect(builtinRegistry.get('slack-pins-read').match(
|
|
1401
|
-
expect(builtinRegistry.get('slack-pins-read').match(
|
|
1566
|
+
expect(builtinRegistry.get('slack-pins-read').match(makeSlackRequest({ path: '/api/pins.list' }))).toBe(true);
|
|
1567
|
+
expect(builtinRegistry.get('slack-pins-read').match(makeSlackRequest({ path: '/api/pins.add' }))).toBe(false);
|
|
1402
1568
|
});
|
|
1403
1569
|
it('slack-pins-write matches pins.add and pins.remove but not pins.list', () => {
|
|
1404
1570
|
expectSchemaExists('slack-pins-write');
|
|
1405
|
-
expect(builtinRegistry.get('slack-pins-write').match(
|
|
1406
|
-
expect(builtinRegistry.get('slack-pins-write').match(
|
|
1407
|
-
expect(builtinRegistry.get('slack-pins-write').match(
|
|
1571
|
+
expect(builtinRegistry.get('slack-pins-write').match(makeSlackRequest({ path: '/api/pins.add' }))).toBe(true);
|
|
1572
|
+
expect(builtinRegistry.get('slack-pins-write').match(makeSlackRequest({ path: '/api/pins.remove' }))).toBe(true);
|
|
1573
|
+
expect(builtinRegistry.get('slack-pins-write').match(makeSlackRequest({ path: '/api/pins.list' }))).toBe(false);
|
|
1408
1574
|
});
|
|
1409
1575
|
it('slack-bookmarks-read matches bookmarks.list but not bookmarks.add', () => {
|
|
1410
1576
|
expectSchemaExists('slack-bookmarks-read');
|
|
1411
1577
|
expect(builtinRegistry
|
|
1412
1578
|
.get('slack-bookmarks-read')
|
|
1413
|
-
.match(
|
|
1579
|
+
.match(makeSlackRequest({ path: '/api/bookmarks.list' }))).toBe(true);
|
|
1414
1580
|
expect(builtinRegistry
|
|
1415
1581
|
.get('slack-bookmarks-read')
|
|
1416
|
-
.match(
|
|
1582
|
+
.match(makeSlackRequest({ path: '/api/bookmarks.add' }))).toBe(false);
|
|
1417
1583
|
});
|
|
1418
1584
|
it('slack-bookmarks-write matches bookmarks.add and bookmarks.edit but not bookmarks.list', () => {
|
|
1419
1585
|
expectSchemaExists('slack-bookmarks-write');
|
|
1420
1586
|
expect(builtinRegistry
|
|
1421
1587
|
.get('slack-bookmarks-write')
|
|
1422
|
-
.match(
|
|
1588
|
+
.match(makeSlackRequest({ path: '/api/bookmarks.add' }))).toBe(true);
|
|
1423
1589
|
expect(builtinRegistry
|
|
1424
1590
|
.get('slack-bookmarks-write')
|
|
1425
|
-
.match(
|
|
1591
|
+
.match(makeSlackRequest({ path: '/api/bookmarks.edit' }))).toBe(true);
|
|
1426
1592
|
expect(builtinRegistry
|
|
1427
1593
|
.get('slack-bookmarks-write')
|
|
1428
|
-
.match(
|
|
1594
|
+
.match(makeSlackRequest({ path: '/api/bookmarks.list' }))).toBe(false);
|
|
1429
1595
|
});
|
|
1430
1596
|
it('slack-reminders-read matches reminders.info and reminders.list but not reminders.add', () => {
|
|
1431
1597
|
expectSchemaExists('slack-reminders-read');
|
|
1432
1598
|
expect(builtinRegistry
|
|
1433
1599
|
.get('slack-reminders-read')
|
|
1434
|
-
.match(
|
|
1600
|
+
.match(makeSlackRequest({ path: '/api/reminders.info' }))).toBe(true);
|
|
1435
1601
|
expect(builtinRegistry
|
|
1436
1602
|
.get('slack-reminders-read')
|
|
1437
|
-
.match(
|
|
1603
|
+
.match(makeSlackRequest({ path: '/api/reminders.list' }))).toBe(true);
|
|
1438
1604
|
expect(builtinRegistry
|
|
1439
1605
|
.get('slack-reminders-read')
|
|
1440
|
-
.match(
|
|
1606
|
+
.match(makeSlackRequest({ path: '/api/reminders.add' }))).toBe(false);
|
|
1441
1607
|
});
|
|
1442
1608
|
it('slack-reminders-write matches reminders.add and reminders.delete but not reminders.list', () => {
|
|
1443
1609
|
expectSchemaExists('slack-reminders-write');
|
|
1444
1610
|
expect(builtinRegistry
|
|
1445
1611
|
.get('slack-reminders-write')
|
|
1446
|
-
.match(
|
|
1612
|
+
.match(makeSlackRequest({ path: '/api/reminders.add' }))).toBe(true);
|
|
1447
1613
|
expect(builtinRegistry
|
|
1448
1614
|
.get('slack-reminders-write')
|
|
1449
|
-
.match(
|
|
1615
|
+
.match(makeSlackRequest({ path: '/api/reminders.delete' }))).toBe(true);
|
|
1450
1616
|
expect(builtinRegistry
|
|
1451
1617
|
.get('slack-reminders-write')
|
|
1452
|
-
.match(
|
|
1618
|
+
.match(makeSlackRequest({ path: '/api/reminders.list' }))).toBe(false);
|
|
1453
1619
|
});
|
|
1454
1620
|
});
|
|
1455
1621
|
describe('builtin schemas: stripe', () => {
|