@irogane/kaji 0.2.0-beta.11

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 (136) hide show
  1. package/LICENSE +105 -0
  2. package/README.md +598 -0
  3. package/contracts/README.md +14 -0
  4. package/contracts/beta-core-v1.json +52 -0
  5. package/contracts/cli/init-cases-v1.json +27 -0
  6. package/contracts/errors/error-codes.json +48 -0
  7. package/contracts/errors/integration-recovery-v1.json +127 -0
  8. package/contracts/errors/provider-normalization.json +111 -0
  9. package/contracts/events/conformance-invalid.json +20 -0
  10. package/contracts/events/conformance.json +511 -0
  11. package/contracts/events/new-kaji-event-v1.schema.json +1021 -0
  12. package/contracts/events/stored-kaji-event-v1.schema.json +1025 -0
  13. package/contracts/feature-tiers-v1.json +488 -0
  14. package/contracts/integrations/abi-index-v1.json +8 -0
  15. package/contracts/integrations/conformance-invalid.json +443 -0
  16. package/contracts/integrations/conformance-valid.json +121 -0
  17. package/contracts/integrations/copy-provenance-v1.schema.json +61 -0
  18. package/contracts/integrations/echo-tool-abi-v1.json +37 -0
  19. package/contracts/integrations/github-api-conformance-v1.json +644 -0
  20. package/contracts/integrations/github-tool-abi-typescript-v1.json +369 -0
  21. package/contracts/integrations/github-tool-abi-v1.json +146 -0
  22. package/contracts/integrations/gmail-api-conformance-v1.json +750 -0
  23. package/contracts/integrations/gmail-tool-abi-v1.json +62 -0
  24. package/contracts/integrations/index.schema.json +37 -0
  25. package/contracts/integrations/manifest.schema.json +119 -0
  26. package/contracts/parity/expected-normalized.json +4906 -0
  27. package/contracts/parity/scenarios.json +100 -0
  28. package/contracts/parity/scenarios.schema.json +214 -0
  29. package/contracts/providers/cost-conformance.json +112 -0
  30. package/contracts/release/github-proof-v1.schema.json +138 -0
  31. package/contracts/release/gmail-proof-v1.schema.json +138 -0
  32. package/contracts/release/kaji-ts-consumer-handoff-v1.schema.json +1289 -0
  33. package/contracts/release/publisher-identity-receipt-v1.schema.json +319 -0
  34. package/contracts/release/typescript-onboarding-evidence-v1.schema.json +740 -0
  35. package/contracts/tools/conformance-invalid.json +271 -0
  36. package/contracts/tools/conformance-valid.json +78 -0
  37. package/contracts/tools/tool-schema-v1.schema.json +18 -0
  38. package/dist/anthropic.cjs +1231 -0
  39. package/dist/anthropic.cjs.map +1 -0
  40. package/dist/anthropic.d.cts +26 -0
  41. package/dist/anthropic.d.ts +26 -0
  42. package/dist/anthropic.js +270 -0
  43. package/dist/anthropic.js.map +1 -0
  44. package/dist/auth.cjs +1507 -0
  45. package/dist/auth.cjs.map +1 -0
  46. package/dist/auth.d.cts +129 -0
  47. package/dist/auth.d.ts +129 -0
  48. package/dist/auth.js +1039 -0
  49. package/dist/auth.js.map +1 -0
  50. package/dist/base-B9FRMcP8.d.cts +140 -0
  51. package/dist/base-nHQd1VtS.d.ts +140 -0
  52. package/dist/chunk-AAM33KAO.js +4367 -0
  53. package/dist/chunk-AAM33KAO.js.map +1 -0
  54. package/dist/chunk-KAJ6BM64.js +153 -0
  55. package/dist/chunk-KAJ6BM64.js.map +1 -0
  56. package/dist/chunk-KCAXIOZS.js +308 -0
  57. package/dist/chunk-KCAXIOZS.js.map +1 -0
  58. package/dist/chunk-LSJ4AVO2.js +243 -0
  59. package/dist/chunk-LSJ4AVO2.js.map +1 -0
  60. package/dist/chunk-TM7ZGOJX.js +716 -0
  61. package/dist/chunk-TM7ZGOJX.js.map +1 -0
  62. package/dist/cli/bin.d.ts +2 -0
  63. package/dist/cli/bin.js +13 -0
  64. package/dist/cli/bin.js.map +1 -0
  65. package/dist/cli/chunk-2RCWPRVY.js +6277 -0
  66. package/dist/cli/chunk-2RCWPRVY.js.map +1 -0
  67. package/dist/cli/chunk-SEBX54TR.js +681 -0
  68. package/dist/cli/chunk-SEBX54TR.js.map +1 -0
  69. package/dist/cli/index.d.ts +232 -0
  70. package/dist/cli/index.js +11 -0
  71. package/dist/cli/index.js.map +1 -0
  72. package/dist/cli/init-worker.d.ts +2 -0
  73. package/dist/cli/init-worker.js +18 -0
  74. package/dist/cli/init-worker.js.map +1 -0
  75. package/dist/cli/integration-copy-worker.js +48 -0
  76. package/dist/cli/integration-copy-worker.js.map +1 -0
  77. package/dist/cli/package-entry-cjs.cjs +21 -0
  78. package/dist/cli/package-entry-cjs.cjs.map +1 -0
  79. package/dist/cli/package-entry-cjs.d.cts +2 -0
  80. package/dist/cli/package-entry.d.ts +2 -0
  81. package/dist/cli/package-entry.js +13 -0
  82. package/dist/cli/package-entry.js.map +1 -0
  83. package/dist/context-BaFHrQHv.d.cts +21 -0
  84. package/dist/context-BaFHrQHv.d.ts +21 -0
  85. package/dist/context-C-YPY-GS.d.cts +1538 -0
  86. package/dist/context-C-YPY-GS.d.ts +1538 -0
  87. package/dist/index.cjs +12346 -0
  88. package/dist/index.cjs.map +1 -0
  89. package/dist/index.d.cts +1560 -0
  90. package/dist/index.d.ts +1560 -0
  91. package/dist/index.js +7852 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/integrations/github.cjs +2092 -0
  94. package/dist/integrations/github.cjs.map +1 -0
  95. package/dist/integrations/github.d.cts +21 -0
  96. package/dist/integrations/github.d.ts +21 -0
  97. package/dist/integrations/github.js +2088 -0
  98. package/dist/integrations/github.js.map +1 -0
  99. package/dist/integrations.cjs +3370 -0
  100. package/dist/integrations.cjs.map +1 -0
  101. package/dist/integrations.d.cts +202 -0
  102. package/dist/integrations.d.ts +202 -0
  103. package/dist/integrations.js +2650 -0
  104. package/dist/integrations.js.map +1 -0
  105. package/dist/observability-Cj--OkME.d.cts +96 -0
  106. package/dist/observability-Cj--OkME.d.ts +96 -0
  107. package/dist/openai.cjs +1235 -0
  108. package/dist/openai.cjs.map +1 -0
  109. package/dist/openai.d.cts +32 -0
  110. package/dist/openai.d.ts +32 -0
  111. package/dist/openai.js +272 -0
  112. package/dist/openai.js.map +1 -0
  113. package/dist/testing.cjs +554 -0
  114. package/dist/testing.cjs.map +1 -0
  115. package/dist/testing.d.cts +43 -0
  116. package/dist/testing.d.ts +43 -0
  117. package/dist/testing.js +118 -0
  118. package/dist/testing.js.map +1 -0
  119. package/package.json +188 -0
  120. package/registry/echo/index.ts +53 -0
  121. package/registry/echo/manifest.json +53 -0
  122. package/registry/github/LICENSE +105 -0
  123. package/registry/github/client.ts +1727 -0
  124. package/registry/github/index.ts +263 -0
  125. package/registry/github/manifest.json +227 -0
  126. package/registry/github/owner-fixtures.json +10 -0
  127. package/registry/github/tests/github.test.ts +32 -0
  128. package/registry/gmail/LICENSE +105 -0
  129. package/registry/gmail/client.ts +548 -0
  130. package/registry/gmail/index.ts +165 -0
  131. package/registry/gmail/manifest.json +102 -0
  132. package/registry/gmail/owner-fixtures.json +10 -0
  133. package/registry/gmail/tests/gmail.test.ts +32 -0
  134. package/registry/index.json +21 -0
  135. package/registry/index.schema.json +37 -0
  136. package/registry/schema.json +119 -0
@@ -0,0 +1,750 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kaji.dev/contracts/integrations/gmail-api-conformance-v1.json",
4
+ "version": "1.0.0",
5
+ "token": "fixture-token",
6
+ "cases": [
7
+ {
8
+ "name": "list messages",
9
+ "operation": "list_messages",
10
+ "input": {
11
+ "query": "from:alice",
12
+ "maxResults": 5
13
+ },
14
+ "responses": [
15
+ {
16
+ "status": 200,
17
+ "headers": {
18
+ "content-type": "application/json"
19
+ },
20
+ "json": {
21
+ "messages": [
22
+ {
23
+ "id": "abc123",
24
+ "threadId": "thread1"
25
+ },
26
+ {
27
+ "id": "def456",
28
+ "threadId": "thread2"
29
+ }
30
+ ],
31
+ "resultSizeEstimate": 2,
32
+ "nextPageToken": "CURSOR_2"
33
+ }
34
+ }
35
+ ],
36
+ "expected_requests": [
37
+ {
38
+ "method": "GET",
39
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=5&q=from%3Aalice",
40
+ "body": null
41
+ }
42
+ ],
43
+ "expected": {
44
+ "result": {
45
+ "messages": [
46
+ {
47
+ "id": "abc123",
48
+ "thread_id": "thread1"
49
+ },
50
+ {
51
+ "id": "def456",
52
+ "thread_id": "thread2"
53
+ }
54
+ ],
55
+ "result_size_estimate": 2,
56
+ "next_page_token": "CURSOR_2"
57
+ }
58
+ }
59
+ },
60
+ {
61
+ "name": "list messages empty",
62
+ "operation": "list_messages",
63
+ "input": {},
64
+ "responses": [
65
+ {
66
+ "status": 200,
67
+ "headers": {},
68
+ "json": {
69
+ "resultSizeEstimate": 0
70
+ }
71
+ }
72
+ ],
73
+ "expected_requests": [
74
+ {
75
+ "method": "GET",
76
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=10",
77
+ "body": null
78
+ }
79
+ ],
80
+ "expected": {
81
+ "result": {
82
+ "messages": [],
83
+ "result_size_estimate": 0
84
+ }
85
+ }
86
+ },
87
+ {
88
+ "name": "list messages with pagination",
89
+ "operation": "list_messages",
90
+ "input": {
91
+ "maxResults": 1,
92
+ "pageToken": "PREV_CURSOR"
93
+ },
94
+ "responses": [
95
+ {
96
+ "status": 200,
97
+ "headers": {},
98
+ "json": {
99
+ "messages": [
100
+ {
101
+ "id": "m1",
102
+ "threadId": "t1"
103
+ }
104
+ ],
105
+ "nextPageToken": "NEXT_PAGE_42",
106
+ "resultSizeEstimate": 50
107
+ }
108
+ }
109
+ ],
110
+ "expected_requests": [
111
+ {
112
+ "method": "GET",
113
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=1&pageToken=PREV_CURSOR",
114
+ "body": null
115
+ }
116
+ ],
117
+ "expected": {
118
+ "result": {
119
+ "messages": [
120
+ {
121
+ "id": "m1",
122
+ "thread_id": "t1"
123
+ }
124
+ ],
125
+ "next_page_token": "NEXT_PAGE_42",
126
+ "result_size_estimate": 50
127
+ }
128
+ }
129
+ },
130
+ {
131
+ "name": "get message text plain",
132
+ "operation": "get_message",
133
+ "input": {
134
+ "messageId": "abc123"
135
+ },
136
+ "responses": [
137
+ {
138
+ "status": 200,
139
+ "headers": {},
140
+ "json": {
141
+ "id": "abc123",
142
+ "threadId": "thread1",
143
+ "snippet": "hello there",
144
+ "payload": {
145
+ "headers": [
146
+ {
147
+ "name": "From",
148
+ "value": "alice@example.com"
149
+ },
150
+ {
151
+ "name": "Subject",
152
+ "value": "Hi"
153
+ },
154
+ {
155
+ "name": "X-Noise",
156
+ "value": "dropped"
157
+ }
158
+ ],
159
+ "mimeType": "multipart/alternative",
160
+ "parts": [
161
+ {
162
+ "mimeType": "text/html",
163
+ "body": {
164
+ "data": "PHA-aWdub3JlZDwvcD4"
165
+ }
166
+ },
167
+ {
168
+ "mimeType": "text/plain",
169
+ "body": {
170
+ "data": "cGxhaW4gYm9keQ"
171
+ }
172
+ }
173
+ ]
174
+ }
175
+ }
176
+ }
177
+ ],
178
+ "expected_requests": [
179
+ {
180
+ "method": "GET",
181
+ "path_and_query": "/gmail/v1/users/me/messages/abc123?format=full",
182
+ "body": null
183
+ }
184
+ ],
185
+ "expected": {
186
+ "result": {
187
+ "body": "plain body",
188
+ "body_truncated": false,
189
+ "headers": {
190
+ "from": "alice@example.com",
191
+ "subject": "Hi"
192
+ },
193
+ "id": "abc123",
194
+ "snippet": "hello there",
195
+ "thread_id": "thread1"
196
+ }
197
+ }
198
+ },
199
+ {
200
+ "name": "get message no text part",
201
+ "operation": "get_message",
202
+ "input": {
203
+ "messageId": "noBody01"
204
+ },
205
+ "responses": [
206
+ {
207
+ "status": 200,
208
+ "headers": {},
209
+ "json": {
210
+ "id": "noBody01",
211
+ "threadId": "noBody01",
212
+ "payload": {
213
+ "mimeType": "text/html",
214
+ "body": {
215
+ "data": "PHA-b25seSBodG1sPC9wPg"
216
+ }
217
+ }
218
+ }
219
+ }
220
+ ],
221
+ "expected_requests": [
222
+ {
223
+ "method": "GET",
224
+ "path_and_query": "/gmail/v1/users/me/messages/noBody01?format=full",
225
+ "body": null
226
+ }
227
+ ],
228
+ "expected": {
229
+ "result": {
230
+ "body": "",
231
+ "body_truncated": false,
232
+ "headers": {},
233
+ "id": "noBody01",
234
+ "snippet": "",
235
+ "thread_id": "noBody01"
236
+ }
237
+ }
238
+ },
239
+ {
240
+ "name": "send message",
241
+ "operation": "send_message",
242
+ "input": {
243
+ "raw": "RnJvbTogbWVAZXhhbXBsZS5jb20NClRvOiB5b3VAZXhhbXBsZS5jb20NCg0KSGk"
244
+ },
245
+ "responses": [
246
+ {
247
+ "status": 200,
248
+ "headers": {},
249
+ "json": {
250
+ "id": "sent1",
251
+ "threadId": "thread9"
252
+ }
253
+ }
254
+ ],
255
+ "expected_requests": [
256
+ {
257
+ "method": "POST",
258
+ "path_and_query": "/gmail/v1/users/me/messages/send",
259
+ "body": "{\"raw\":\"RnJvbTogbWVAZXhhbXBsZS5jb20NClRvOiB5b3VAZXhhbXBsZS5jb20NCg0KSGk\"}"
260
+ }
261
+ ],
262
+ "expected": {
263
+ "result": {
264
+ "id": "sent1",
265
+ "thread_id": "thread9"
266
+ }
267
+ }
268
+ },
269
+ {
270
+ "name": "401 requires authentication",
271
+ "operation": "list_messages",
272
+ "input": {},
273
+ "responses": [
274
+ {
275
+ "status": 401,
276
+ "headers": {},
277
+ "json": {}
278
+ }
279
+ ],
280
+ "expected_requests": [
281
+ {
282
+ "method": "GET",
283
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=10",
284
+ "body": null
285
+ }
286
+ ],
287
+ "expected": {
288
+ "error": {
289
+ "code": "INTEGRATION_AUTH_REQUIRED",
290
+ "outcome": "failed",
291
+ "retryable": false
292
+ }
293
+ }
294
+ },
295
+ {
296
+ "name": "permission 403 is not rate limit",
297
+ "operation": "list_messages",
298
+ "input": {},
299
+ "responses": [
300
+ {
301
+ "status": 403,
302
+ "headers": {},
303
+ "json": {}
304
+ }
305
+ ],
306
+ "expected_requests": [
307
+ {
308
+ "method": "GET",
309
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=10",
310
+ "body": null
311
+ }
312
+ ],
313
+ "expected": {
314
+ "error": {
315
+ "code": "INTEGRATION_API_ERROR",
316
+ "outcome": "failed",
317
+ "retryable": false
318
+ }
319
+ }
320
+ },
321
+ {
322
+ "name": "rate limited read retries once",
323
+ "operation": "list_messages",
324
+ "input": {},
325
+ "responses": [
326
+ {
327
+ "status": 429,
328
+ "headers": {
329
+ "retry-after": "1"
330
+ },
331
+ "json": {}
332
+ },
333
+ {
334
+ "status": 200,
335
+ "headers": {},
336
+ "json": {
337
+ "messages": [
338
+ {
339
+ "id": "abc123",
340
+ "threadId": "thread1"
341
+ }
342
+ ]
343
+ }
344
+ }
345
+ ],
346
+ "expected_requests": [
347
+ {
348
+ "method": "GET",
349
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=10",
350
+ "body": null
351
+ },
352
+ {
353
+ "method": "GET",
354
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=10",
355
+ "body": null
356
+ }
357
+ ],
358
+ "expected": {
359
+ "result": {
360
+ "messages": [
361
+ {
362
+ "id": "abc123",
363
+ "thread_id": "thread1"
364
+ }
365
+ ]
366
+ }
367
+ },
368
+ "expected_sleeps": [
369
+ 1000
370
+ ]
371
+ },
372
+ {
373
+ "name": "404 is confirmed read failure",
374
+ "operation": "get_message",
375
+ "input": {
376
+ "messageId": "missing01"
377
+ },
378
+ "responses": [
379
+ {
380
+ "status": 404,
381
+ "headers": {},
382
+ "json": {}
383
+ }
384
+ ],
385
+ "expected_requests": [
386
+ {
387
+ "method": "GET",
388
+ "path_and_query": "/gmail/v1/users/me/messages/missing01?format=full",
389
+ "body": null
390
+ }
391
+ ],
392
+ "expected": {
393
+ "error": {
394
+ "code": "INTEGRATION_API_ERROR",
395
+ "outcome": "failed",
396
+ "retryable": false
397
+ }
398
+ }
399
+ },
400
+ {
401
+ "name": "429 mutation is not retried",
402
+ "operation": "send_message",
403
+ "input": {
404
+ "raw": "RnJvbTogbWVAZXhhbXBsZS5jb20NCg0KSGk"
405
+ },
406
+ "responses": [
407
+ {
408
+ "status": 429,
409
+ "headers": {
410
+ "retry-after": "1"
411
+ },
412
+ "json": {}
413
+ }
414
+ ],
415
+ "expected_requests": [
416
+ {
417
+ "method": "POST",
418
+ "path_and_query": "/gmail/v1/users/me/messages/send",
419
+ "body": "{\"raw\":\"RnJvbTogbWVAZXhhbXBsZS5jb20NCg0KSGk\"}"
420
+ }
421
+ ],
422
+ "expected": {
423
+ "error": {
424
+ "code": "INTEGRATION_RATE_LIMITED",
425
+ "outcome": "failed",
426
+ "retryable": true
427
+ }
428
+ }
429
+ },
430
+ {
431
+ "name": "malformed JSON read is certified read failure",
432
+ "operation": "list_messages",
433
+ "input": {},
434
+ "responses": [
435
+ {
436
+ "status": 200,
437
+ "headers": {},
438
+ "body": "{not json"
439
+ }
440
+ ],
441
+ "expected_requests": [
442
+ {
443
+ "method": "GET",
444
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=10",
445
+ "body": null
446
+ }
447
+ ],
448
+ "expected": {
449
+ "error": {
450
+ "code": "INTEGRATION_API_ERROR",
451
+ "outcome": "failed",
452
+ "retryable": true
453
+ }
454
+ }
455
+ },
456
+ {
457
+ "name": "malformed JSON after POST is unknown",
458
+ "operation": "send_message",
459
+ "input": {
460
+ "raw": "RnJvbTogbWVAZXhhbXBsZS5jb20NCg0KSGk"
461
+ },
462
+ "responses": [
463
+ {
464
+ "status": 200,
465
+ "headers": {},
466
+ "body": "{not json"
467
+ }
468
+ ],
469
+ "expected_requests": [
470
+ {
471
+ "method": "POST",
472
+ "path_and_query": "/gmail/v1/users/me/messages/send",
473
+ "body": "{\"raw\":\"RnJvbTogbWVAZXhhbXBsZS5jb20NCg0KSGk\"}"
474
+ }
475
+ ],
476
+ "expected": {
477
+ "exception": "unknown"
478
+ }
479
+ },
480
+ {
481
+ "name": "5xx read is transient",
482
+ "operation": "list_messages",
483
+ "input": {},
484
+ "responses": [
485
+ {
486
+ "status": 503,
487
+ "headers": {},
488
+ "json": {}
489
+ }
490
+ ],
491
+ "expected_requests": [
492
+ {
493
+ "method": "GET",
494
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=10",
495
+ "body": null
496
+ }
497
+ ],
498
+ "expected": {
499
+ "error": {
500
+ "code": "INTEGRATION_API_ERROR",
501
+ "outcome": "failed",
502
+ "retryable": true
503
+ }
504
+ }
505
+ },
506
+ {
507
+ "name": "5xx mutation is unknown",
508
+ "operation": "send_message",
509
+ "input": {
510
+ "raw": "RnJvbTogbWVAZXhhbXBsZS5jb20NCg0KSGk"
511
+ },
512
+ "responses": [
513
+ {
514
+ "status": 500,
515
+ "headers": {},
516
+ "json": {}
517
+ }
518
+ ],
519
+ "expected_requests": [
520
+ {
521
+ "method": "POST",
522
+ "path_and_query": "/gmail/v1/users/me/messages/send",
523
+ "body": "{\"raw\":\"RnJvbTogbWVAZXhhbXBsZS5jb20NCg0KSGk\"}"
524
+ }
525
+ ],
526
+ "expected": {
527
+ "exception": "unknown"
528
+ }
529
+ },
530
+ {
531
+ "name": "connection loss after write dispatch is unknown",
532
+ "operation": "send_message",
533
+ "input": {
534
+ "raw": "RnJvbTogbWVAZXhhbXBsZS5jb20NCg0KSGk"
535
+ },
536
+ "responses": [
537
+ {
538
+ "transport_error": "connection"
539
+ }
540
+ ],
541
+ "expected_requests": [
542
+ {
543
+ "method": "POST",
544
+ "path_and_query": "/gmail/v1/users/me/messages/send",
545
+ "body": "{\"raw\":\"RnJvbTogbWVAZXhhbXBsZS5jb20NCg0KSGk\"}"
546
+ }
547
+ ],
548
+ "expected": {
549
+ "exception": "unknown"
550
+ }
551
+ },
552
+ {
553
+ "name": "malformed base64 body is transient read",
554
+ "operation": "get_message",
555
+ "input": {
556
+ "messageId": "bad64"
557
+ },
558
+ "responses": [
559
+ {
560
+ "status": 200,
561
+ "headers": {},
562
+ "json": {
563
+ "id": "bad64",
564
+ "threadId": "bad64",
565
+ "payload": {
566
+ "mimeType": "text/plain",
567
+ "body": {
568
+ "data": "@@@not-base64@@@"
569
+ }
570
+ }
571
+ }
572
+ }
573
+ ],
574
+ "expected_requests": [
575
+ {
576
+ "method": "GET",
577
+ "path_and_query": "/gmail/v1/users/me/messages/bad64?format=full",
578
+ "body": null
579
+ }
580
+ ],
581
+ "expected": {
582
+ "error": {
583
+ "code": "INTEGRATION_API_ERROR",
584
+ "outcome": "failed",
585
+ "retryable": true
586
+ }
587
+ }
588
+ },
589
+ {
590
+ "name": "mime depth bomb is transient read",
591
+ "operation": "get_message",
592
+ "input": {
593
+ "messageId": "deepbomb"
594
+ },
595
+ "responses": [
596
+ {
597
+ "status": 200,
598
+ "headers": {},
599
+ "json": {
600
+ "id": "deepbomb",
601
+ "threadId": "deepbomb",
602
+ "payload": {
603
+ "mimeType": "multipart/mixed",
604
+ "parts": [
605
+ {
606
+ "mimeType": "multipart/mixed",
607
+ "parts": [
608
+ {
609
+ "mimeType": "multipart/mixed",
610
+ "parts": [
611
+ {
612
+ "mimeType": "multipart/mixed",
613
+ "parts": [
614
+ {
615
+ "mimeType": "multipart/mixed",
616
+ "parts": [
617
+ {
618
+ "mimeType": "multipart/mixed",
619
+ "parts": [
620
+ {
621
+ "mimeType": "multipart/mixed",
622
+ "parts": [
623
+ {
624
+ "mimeType": "multipart/mixed",
625
+ "parts": [
626
+ {
627
+ "mimeType": "multipart/mixed",
628
+ "parts": [
629
+ {
630
+ "mimeType": "multipart/mixed",
631
+ "parts": [
632
+ {
633
+ "mimeType": "multipart/mixed",
634
+ "parts": [
635
+ {
636
+ "mimeType": "multipart/mixed",
637
+ "parts": [
638
+ {
639
+ "mimeType": "text/plain",
640
+ "body": {
641
+ "data": "ZGVlcA"
642
+ }
643
+ }
644
+ ]
645
+ }
646
+ ]
647
+ }
648
+ ]
649
+ }
650
+ ]
651
+ }
652
+ ]
653
+ }
654
+ ]
655
+ }
656
+ ]
657
+ }
658
+ ]
659
+ }
660
+ ]
661
+ }
662
+ ]
663
+ }
664
+ ]
665
+ }
666
+ ]
667
+ }
668
+ }
669
+ }
670
+ ],
671
+ "expected_requests": [
672
+ {
673
+ "method": "GET",
674
+ "path_and_query": "/gmail/v1/users/me/messages/deepbomb?format=full",
675
+ "body": null
676
+ }
677
+ ],
678
+ "expected": {
679
+ "error": {
680
+ "code": "INTEGRATION_API_ERROR",
681
+ "outcome": "failed",
682
+ "retryable": true
683
+ }
684
+ }
685
+ },
686
+ {
687
+ "name": "non-object list is transient read",
688
+ "operation": "list_messages",
689
+ "input": {},
690
+ "responses": [
691
+ {
692
+ "status": 200,
693
+ "headers": {},
694
+ "json": [
695
+ 1,
696
+ 2,
697
+ 3
698
+ ]
699
+ }
700
+ ],
701
+ "expected_requests": [
702
+ {
703
+ "method": "GET",
704
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=10",
705
+ "body": null
706
+ }
707
+ ],
708
+ "expected": {
709
+ "error": {
710
+ "code": "INTEGRATION_API_ERROR",
711
+ "outcome": "failed",
712
+ "retryable": true
713
+ }
714
+ }
715
+ },
716
+ {
717
+ "name": "bad provider message id is transient read",
718
+ "operation": "list_messages",
719
+ "input": {},
720
+ "responses": [
721
+ {
722
+ "status": 200,
723
+ "headers": {},
724
+ "json": {
725
+ "messages": [
726
+ {
727
+ "id": "not/valid",
728
+ "threadId": "t"
729
+ }
730
+ ]
731
+ }
732
+ }
733
+ ],
734
+ "expected_requests": [
735
+ {
736
+ "method": "GET",
737
+ "path_and_query": "/gmail/v1/users/me/messages?maxResults=10",
738
+ "body": null
739
+ }
740
+ ],
741
+ "expected": {
742
+ "error": {
743
+ "code": "INTEGRATION_API_ERROR",
744
+ "outcome": "failed",
745
+ "retryable": true
746
+ }
747
+ }
748
+ }
749
+ ]
750
+ }