@firedrill-tools/salesforce 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.
Files changed (41) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +156 -0
  3. package/firedrill/agent.target.json +17 -0
  4. package/firedrill/api-limit-exceeded.scenario.json +11 -0
  5. package/firedrill/baseline.scenario.json +2213 -0
  6. package/firedrill/conformance.suite.json +23 -0
  7. package/firedrill/row-locked.scenario.json +11 -0
  8. package/firedrill/salesforce-api-limit-exceeded.drill.json +336 -0
  9. package/firedrill/salesforce-collections-composite.drill.json +277 -0
  10. package/firedrill/salesforce-denied.drill.json +74 -0
  11. package/firedrill/salesforce-fresh-install.drill.json +86 -0
  12. package/firedrill/salesforce-inactive-user.drill.json +43 -0
  13. package/firedrill/salesforce-invalid-session.drill.json +336 -0
  14. package/firedrill/salesforce-large-responses.drill.json +138 -0
  15. package/firedrill/salesforce-mcp-aliases.drill.json +156 -0
  16. package/firedrill/salesforce-profile-permissions.drill.json +241 -0
  17. package/firedrill/salesforce-read-only.drill.json +154 -0
  18. package/firedrill/salesforce-rest-flow.drill.json +714 -0
  19. package/firedrill/salesforce-row-locked.drill.json +227 -0
  20. package/firedrill/salesforce-sharing.drill.json +201 -0
  21. package/firedrill/salesforce-soql.drill.json +139 -0
  22. package/firedrill/salesforce-tight-limits.drill.json +336 -0
  23. package/firedrill/salesforce-write-committed-lost.drill.json +176 -0
  24. package/firedrill/tight-limits.scenario.json +41 -0
  25. package/firedrill/tools/salesforce/behavior.mjs +637 -0
  26. package/firedrill/tools/salesforce/lib/bytes.mjs +56 -0
  27. package/firedrill/tools/salesforce/lib/ids.mjs +68 -0
  28. package/firedrill/tools/salesforce/lib/match.mjs +352 -0
  29. package/firedrill/tools/salesforce/lib/records.mjs +506 -0
  30. package/firedrill/tools/salesforce/lib/schema.mjs +429 -0
  31. package/firedrill/tools/salesforce/lib/search.mjs +92 -0
  32. package/firedrill/tools/salesforce/lib/soql.mjs +1119 -0
  33. package/firedrill/tools/salesforce/lib/state.mjs +378 -0
  34. package/firedrill/tools/salesforce/lib/wire.mjs +109 -0
  35. package/firedrill/tools/salesforce/salesforce.tool.json +3939 -0
  36. package/firedrill/world.json +2705 -0
  37. package/firedrill/write-committed-lost.scenario.json +11 -0
  38. package/firedrill.json +5 -0
  39. package/package.json +64 -0
  40. package/starter.json +2212 -0
  41. package/test/conformance.mjs +1122 -0
@@ -0,0 +1,74 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "salesforce-denied",
4
+ "title": "An actor without operation grants is denied by the framework and sees Salesforce's API_DISABLED_FOR_ORG 403 body",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "baseline",
7
+ "actorId": "auditor",
8
+ "task": {
9
+ "instruction": "Run the denied conformance flow against the synthetic Salesforce Tool and fail loudly on any unexpected status, header or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "userinfo-get-denied",
14
+ "kind": "operation.denied",
15
+ "operation": {
16
+ "packageId": "salesforce",
17
+ "operationId": "userinfo.get"
18
+ },
19
+ "outcomes": [
20
+ "denied"
21
+ ],
22
+ "attemptRequired": true
23
+ },
24
+ {
25
+ "id": "query-execute-denied",
26
+ "kind": "operation.denied",
27
+ "operation": {
28
+ "packageId": "salesforce",
29
+ "operationId": "query.execute"
30
+ },
31
+ "outcomes": [
32
+ "denied"
33
+ ],
34
+ "attemptRequired": true
35
+ },
36
+ {
37
+ "id": "records-create-denied",
38
+ "kind": "operation.denied",
39
+ "operation": {
40
+ "packageId": "salesforce",
41
+ "operationId": "records.create"
42
+ },
43
+ "outcomes": [
44
+ "denied"
45
+ ],
46
+ "attemptRequired": true
47
+ },
48
+ {
49
+ "id": "records-create-ok-eq-0",
50
+ "kind": "operation.count",
51
+ "operation": {
52
+ "packageId": "salesforce",
53
+ "operationId": "records.create"
54
+ },
55
+ "outcomes": [
56
+ "ok"
57
+ ],
58
+ "comparison": {
59
+ "operator": "equals",
60
+ "value": 0
61
+ }
62
+ },
63
+ {
64
+ "id": "accounts-count-10",
65
+ "kind": "state.count",
66
+ "packageId": "salesforce",
67
+ "namespace": "accounts",
68
+ "comparison": {
69
+ "operator": "equals",
70
+ "value": 10
71
+ }
72
+ }
73
+ ]
74
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "salesforce-fresh-install",
4
+ "title": "An actor without a username resolves to the org's default identity (the seeded System Administrator), as a freshly installed world does",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "baseline",
7
+ "actorId": "fresh",
8
+ "task": {
9
+ "instruction": "Run the fresh-install conformance flow against the synthetic Salesforce Tool and fail loudly on any unexpected status, header or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "userinfo-get-ok-eq-1",
14
+ "kind": "operation.count",
15
+ "operation": {
16
+ "packageId": "salesforce",
17
+ "operationId": "userinfo.get"
18
+ },
19
+ "outcomes": [
20
+ "ok"
21
+ ],
22
+ "comparison": {
23
+ "operator": "equals",
24
+ "value": 1
25
+ }
26
+ },
27
+ {
28
+ "id": "query-execute-ok-eq-1",
29
+ "kind": "operation.count",
30
+ "operation": {
31
+ "packageId": "salesforce",
32
+ "operationId": "query.execute"
33
+ },
34
+ "outcomes": [
35
+ "ok"
36
+ ],
37
+ "comparison": {
38
+ "operator": "equals",
39
+ "value": 1
40
+ }
41
+ },
42
+ {
43
+ "id": "records-create-ok-eq-1",
44
+ "kind": "operation.count",
45
+ "operation": {
46
+ "packageId": "salesforce",
47
+ "operationId": "records.create"
48
+ },
49
+ "outcomes": [
50
+ "ok"
51
+ ],
52
+ "comparison": {
53
+ "operator": "equals",
54
+ "value": 1
55
+ }
56
+ },
57
+ {
58
+ "id": "fresh-owner",
59
+ "kind": "state.value",
60
+ "packageId": "salesforce",
61
+ "namespace": "accounts",
62
+ "rowId": "001Fd0000001001IAA",
63
+ "path": [
64
+ "fields",
65
+ "OwnerId"
66
+ ],
67
+ "comparison": {
68
+ "operator": "equals",
69
+ "value": "005Fd0000000001IAA"
70
+ }
71
+ },
72
+ {
73
+ "id": "event-record-created-eq-1",
74
+ "kind": "event.count",
75
+ "event": {
76
+ "packageId": "salesforce",
77
+ "eventId": "record.created"
78
+ },
79
+ "phase": "emitted",
80
+ "comparison": {
81
+ "operator": "equals",
82
+ "value": 1
83
+ }
84
+ }
85
+ ]
86
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "salesforce-inactive-user",
4
+ "title": "A deactivated user's token is an invalid session",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "baseline",
7
+ "actorId": "former",
8
+ "task": {
9
+ "instruction": "Run the inactive-user conformance flow against the synthetic Salesforce Tool and fail loudly on any unexpected status, header or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "userinfo-get-tool-error-eq-1",
14
+ "kind": "operation.count",
15
+ "operation": {
16
+ "packageId": "salesforce",
17
+ "operationId": "userinfo.get"
18
+ },
19
+ "outcomes": [
20
+ "tool_error"
21
+ ],
22
+ "comparison": {
23
+ "operator": "equals",
24
+ "value": 1
25
+ }
26
+ },
27
+ {
28
+ "id": "query-execute-tool-error-eq-1",
29
+ "kind": "operation.count",
30
+ "operation": {
31
+ "packageId": "salesforce",
32
+ "operationId": "query.execute"
33
+ },
34
+ "outcomes": [
35
+ "tool_error"
36
+ ],
37
+ "comparison": {
38
+ "operator": "equals",
39
+ "value": 1
40
+ }
41
+ }
42
+ ]
43
+ }
@@ -0,0 +1,336 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "salesforce-invalid-session",
4
+ "title": "A username that matches no user fails every operation with INVALID_SESSION_ID (401 'Session expired or invalid')",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "baseline",
7
+ "actorId": "ghost",
8
+ "task": {
9
+ "instruction": "Run the invalid-session conformance flow against the synthetic Salesforce Tool and fail loudly on any unexpected status, header or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "versions-list-tool-error-ge-1",
14
+ "kind": "operation.count",
15
+ "operation": {
16
+ "packageId": "salesforce",
17
+ "operationId": "versions.list"
18
+ },
19
+ "outcomes": [
20
+ "tool_error"
21
+ ],
22
+ "comparison": {
23
+ "operator": "greater_than_or_equal",
24
+ "value": 1
25
+ }
26
+ },
27
+ {
28
+ "id": "userinfo-get-tool-error-ge-1",
29
+ "kind": "operation.count",
30
+ "operation": {
31
+ "packageId": "salesforce",
32
+ "operationId": "userinfo.get"
33
+ },
34
+ "outcomes": [
35
+ "tool_error"
36
+ ],
37
+ "comparison": {
38
+ "operator": "greater_than_or_equal",
39
+ "value": 1
40
+ }
41
+ },
42
+ {
43
+ "id": "limits-get-tool-error-ge-1",
44
+ "kind": "operation.count",
45
+ "operation": {
46
+ "packageId": "salesforce",
47
+ "operationId": "limits.get"
48
+ },
49
+ "outcomes": [
50
+ "tool_error"
51
+ ],
52
+ "comparison": {
53
+ "operator": "greater_than_or_equal",
54
+ "value": 1
55
+ }
56
+ },
57
+ {
58
+ "id": "sobjects-list-tool-error-ge-1",
59
+ "kind": "operation.count",
60
+ "operation": {
61
+ "packageId": "salesforce",
62
+ "operationId": "sobjects.list"
63
+ },
64
+ "outcomes": [
65
+ "tool_error"
66
+ ],
67
+ "comparison": {
68
+ "operator": "greater_than_or_equal",
69
+ "value": 1
70
+ }
71
+ },
72
+ {
73
+ "id": "sobjects-basic-info-tool-error-ge-1",
74
+ "kind": "operation.count",
75
+ "operation": {
76
+ "packageId": "salesforce",
77
+ "operationId": "sobjects.basic-info"
78
+ },
79
+ "outcomes": [
80
+ "tool_error"
81
+ ],
82
+ "comparison": {
83
+ "operator": "greater_than_or_equal",
84
+ "value": 1
85
+ }
86
+ },
87
+ {
88
+ "id": "sobjects-describe-tool-error-ge-1",
89
+ "kind": "operation.count",
90
+ "operation": {
91
+ "packageId": "salesforce",
92
+ "operationId": "sobjects.describe"
93
+ },
94
+ "outcomes": [
95
+ "tool_error"
96
+ ],
97
+ "comparison": {
98
+ "operator": "greater_than_or_equal",
99
+ "value": 1
100
+ }
101
+ },
102
+ {
103
+ "id": "records-create-tool-error-ge-1",
104
+ "kind": "operation.count",
105
+ "operation": {
106
+ "packageId": "salesforce",
107
+ "operationId": "records.create"
108
+ },
109
+ "outcomes": [
110
+ "tool_error"
111
+ ],
112
+ "comparison": {
113
+ "operator": "greater_than_or_equal",
114
+ "value": 1
115
+ }
116
+ },
117
+ {
118
+ "id": "records-retrieve-tool-error-ge-1",
119
+ "kind": "operation.count",
120
+ "operation": {
121
+ "packageId": "salesforce",
122
+ "operationId": "records.retrieve"
123
+ },
124
+ "outcomes": [
125
+ "tool_error"
126
+ ],
127
+ "comparison": {
128
+ "operator": "greater_than_or_equal",
129
+ "value": 1
130
+ }
131
+ },
132
+ {
133
+ "id": "records-update-tool-error-ge-1",
134
+ "kind": "operation.count",
135
+ "operation": {
136
+ "packageId": "salesforce",
137
+ "operationId": "records.update"
138
+ },
139
+ "outcomes": [
140
+ "tool_error"
141
+ ],
142
+ "comparison": {
143
+ "operator": "greater_than_or_equal",
144
+ "value": 1
145
+ }
146
+ },
147
+ {
148
+ "id": "records-delete-tool-error-ge-1",
149
+ "kind": "operation.count",
150
+ "operation": {
151
+ "packageId": "salesforce",
152
+ "operationId": "records.delete"
153
+ },
154
+ "outcomes": [
155
+ "tool_error"
156
+ ],
157
+ "comparison": {
158
+ "operator": "greater_than_or_equal",
159
+ "value": 1
160
+ }
161
+ },
162
+ {
163
+ "id": "records-upsert-tool-error-ge-1",
164
+ "kind": "operation.count",
165
+ "operation": {
166
+ "packageId": "salesforce",
167
+ "operationId": "records.upsert"
168
+ },
169
+ "outcomes": [
170
+ "tool_error"
171
+ ],
172
+ "comparison": {
173
+ "operator": "greater_than_or_equal",
174
+ "value": 1
175
+ }
176
+ },
177
+ {
178
+ "id": "query-execute-tool-error-ge-1",
179
+ "kind": "operation.count",
180
+ "operation": {
181
+ "packageId": "salesforce",
182
+ "operationId": "query.execute"
183
+ },
184
+ "outcomes": [
185
+ "tool_error"
186
+ ],
187
+ "comparison": {
188
+ "operator": "greater_than_or_equal",
189
+ "value": 1
190
+ }
191
+ },
192
+ {
193
+ "id": "query-more-tool-error-ge-1",
194
+ "kind": "operation.count",
195
+ "operation": {
196
+ "packageId": "salesforce",
197
+ "operationId": "query.more"
198
+ },
199
+ "outcomes": [
200
+ "tool_error"
201
+ ],
202
+ "comparison": {
203
+ "operator": "greater_than_or_equal",
204
+ "value": 1
205
+ }
206
+ },
207
+ {
208
+ "id": "search-parameterized-tool-error-ge-1",
209
+ "kind": "operation.count",
210
+ "operation": {
211
+ "packageId": "salesforce",
212
+ "operationId": "search.parameterized"
213
+ },
214
+ "outcomes": [
215
+ "tool_error"
216
+ ],
217
+ "comparison": {
218
+ "operator": "greater_than_or_equal",
219
+ "value": 1
220
+ }
221
+ },
222
+ {
223
+ "id": "collections-create-tool-error-ge-1",
224
+ "kind": "operation.count",
225
+ "operation": {
226
+ "packageId": "salesforce",
227
+ "operationId": "collections.create"
228
+ },
229
+ "outcomes": [
230
+ "tool_error"
231
+ ],
232
+ "comparison": {
233
+ "operator": "greater_than_or_equal",
234
+ "value": 1
235
+ }
236
+ },
237
+ {
238
+ "id": "collections-retrieve-tool-error-ge-1",
239
+ "kind": "operation.count",
240
+ "operation": {
241
+ "packageId": "salesforce",
242
+ "operationId": "collections.retrieve"
243
+ },
244
+ "outcomes": [
245
+ "tool_error"
246
+ ],
247
+ "comparison": {
248
+ "operator": "greater_than_or_equal",
249
+ "value": 1
250
+ }
251
+ },
252
+ {
253
+ "id": "collections-update-tool-error-ge-1",
254
+ "kind": "operation.count",
255
+ "operation": {
256
+ "packageId": "salesforce",
257
+ "operationId": "collections.update"
258
+ },
259
+ "outcomes": [
260
+ "tool_error"
261
+ ],
262
+ "comparison": {
263
+ "operator": "greater_than_or_equal",
264
+ "value": 1
265
+ }
266
+ },
267
+ {
268
+ "id": "collections-delete-tool-error-ge-1",
269
+ "kind": "operation.count",
270
+ "operation": {
271
+ "packageId": "salesforce",
272
+ "operationId": "collections.delete"
273
+ },
274
+ "outcomes": [
275
+ "tool_error"
276
+ ],
277
+ "comparison": {
278
+ "operator": "greater_than_or_equal",
279
+ "value": 1
280
+ }
281
+ },
282
+ {
283
+ "id": "collections-upsert-tool-error-ge-1",
284
+ "kind": "operation.count",
285
+ "operation": {
286
+ "packageId": "salesforce",
287
+ "operationId": "collections.upsert"
288
+ },
289
+ "outcomes": [
290
+ "tool_error"
291
+ ],
292
+ "comparison": {
293
+ "operator": "greater_than_or_equal",
294
+ "value": 1
295
+ }
296
+ },
297
+ {
298
+ "id": "composite-execute-tool-error-ge-1",
299
+ "kind": "operation.count",
300
+ "operation": {
301
+ "packageId": "salesforce",
302
+ "operationId": "composite.execute"
303
+ },
304
+ "outcomes": [
305
+ "tool_error"
306
+ ],
307
+ "comparison": {
308
+ "operator": "greater_than_or_equal",
309
+ "value": 1
310
+ }
311
+ },
312
+ {
313
+ "id": "accounts-count-10",
314
+ "kind": "state.count",
315
+ "packageId": "salesforce",
316
+ "namespace": "accounts",
317
+ "comparison": {
318
+ "operator": "equals",
319
+ "value": 10
320
+ }
321
+ },
322
+ {
323
+ "id": "event-record-created-eq-0",
324
+ "kind": "event.count",
325
+ "event": {
326
+ "packageId": "salesforce",
327
+ "eventId": "record.created"
328
+ },
329
+ "phase": "emitted",
330
+ "comparison": {
331
+ "operator": "equals",
332
+ "value": 0
333
+ }
334
+ }
335
+ ]
336
+ }
@@ -0,0 +1,138 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "salesforce-large-responses",
4
+ "title": "Response budgets and bounded error text: wide pages resume by locator, oversized reads fail LIMIT_EXCEEDED, deep JSON 400, long caller names clipped",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "baseline",
7
+ "actorId": "admin",
8
+ "task": {
9
+ "instruction": "Run the large-responses conformance flow against the synthetic Salesforce Tool and fail loudly on any unexpected status, header or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "query-more-ok-ge-6",
14
+ "kind": "operation.count",
15
+ "operation": {
16
+ "packageId": "salesforce",
17
+ "operationId": "query.more"
18
+ },
19
+ "outcomes": [
20
+ "ok"
21
+ ],
22
+ "comparison": {
23
+ "operator": "greater_than_or_equal",
24
+ "value": 6
25
+ }
26
+ },
27
+ {
28
+ "id": "query-execute-tool-error-ge-1",
29
+ "kind": "operation.count",
30
+ "operation": {
31
+ "packageId": "salesforce",
32
+ "operationId": "query.execute"
33
+ },
34
+ "outcomes": [
35
+ "tool_error"
36
+ ],
37
+ "comparison": {
38
+ "operator": "greater_than_or_equal",
39
+ "value": 1
40
+ }
41
+ },
42
+ {
43
+ "id": "search-parameterized-tool-error-ge-1",
44
+ "kind": "operation.count",
45
+ "operation": {
46
+ "packageId": "salesforce",
47
+ "operationId": "search.parameterized"
48
+ },
49
+ "outcomes": [
50
+ "tool_error"
51
+ ],
52
+ "comparison": {
53
+ "operator": "greater_than_or_equal",
54
+ "value": 1
55
+ }
56
+ },
57
+ {
58
+ "id": "collections-retrieve-tool-error-ge-1",
59
+ "kind": "operation.count",
60
+ "operation": {
61
+ "packageId": "salesforce",
62
+ "operationId": "collections.retrieve"
63
+ },
64
+ "outcomes": [
65
+ "tool_error"
66
+ ],
67
+ "comparison": {
68
+ "operator": "greater_than_or_equal",
69
+ "value": 1
70
+ }
71
+ },
72
+ {
73
+ "id": "composite-execute-ok-ge-3",
74
+ "kind": "operation.count",
75
+ "operation": {
76
+ "packageId": "salesforce",
77
+ "operationId": "composite.execute"
78
+ },
79
+ "outcomes": [
80
+ "ok"
81
+ ],
82
+ "comparison": {
83
+ "operator": "greater_than_or_equal",
84
+ "value": 3
85
+ }
86
+ },
87
+ {
88
+ "id": "collections-create-ok-eq-10",
89
+ "kind": "operation.count",
90
+ "operation": {
91
+ "packageId": "salesforce",
92
+ "operationId": "collections.create"
93
+ },
94
+ "outcomes": [
95
+ "ok"
96
+ ],
97
+ "comparison": {
98
+ "operator": "equals",
99
+ "value": 10
100
+ }
101
+ },
102
+ {
103
+ "id": "records-create-tool-error-ge-6",
104
+ "kind": "operation.count",
105
+ "operation": {
106
+ "packageId": "salesforce",
107
+ "operationId": "records.create"
108
+ },
109
+ "outcomes": [
110
+ "tool_error"
111
+ ],
112
+ "comparison": {
113
+ "operator": "greater_than_or_equal",
114
+ "value": 6
115
+ }
116
+ },
117
+ {
118
+ "id": "accounts-count-40",
119
+ "kind": "state.count",
120
+ "packageId": "salesforce",
121
+ "namespace": "accounts",
122
+ "comparison": {
123
+ "operator": "equals",
124
+ "value": 40
125
+ }
126
+ },
127
+ {
128
+ "id": "contacts-count",
129
+ "kind": "state.count",
130
+ "packageId": "salesforce",
131
+ "namespace": "contacts",
132
+ "comparison": {
133
+ "operator": "greater_than_or_equal",
134
+ "value": 10
135
+ }
136
+ }
137
+ ]
138
+ }