@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.
- package/LICENSE +105 -0
- package/README.md +598 -0
- package/contracts/README.md +14 -0
- package/contracts/beta-core-v1.json +52 -0
- package/contracts/cli/init-cases-v1.json +27 -0
- package/contracts/errors/error-codes.json +48 -0
- package/contracts/errors/integration-recovery-v1.json +127 -0
- package/contracts/errors/provider-normalization.json +111 -0
- package/contracts/events/conformance-invalid.json +20 -0
- package/contracts/events/conformance.json +511 -0
- package/contracts/events/new-kaji-event-v1.schema.json +1021 -0
- package/contracts/events/stored-kaji-event-v1.schema.json +1025 -0
- package/contracts/feature-tiers-v1.json +488 -0
- package/contracts/integrations/abi-index-v1.json +8 -0
- package/contracts/integrations/conformance-invalid.json +443 -0
- package/contracts/integrations/conformance-valid.json +121 -0
- package/contracts/integrations/copy-provenance-v1.schema.json +61 -0
- package/contracts/integrations/echo-tool-abi-v1.json +37 -0
- package/contracts/integrations/github-api-conformance-v1.json +644 -0
- package/contracts/integrations/github-tool-abi-typescript-v1.json +369 -0
- package/contracts/integrations/github-tool-abi-v1.json +146 -0
- package/contracts/integrations/gmail-api-conformance-v1.json +750 -0
- package/contracts/integrations/gmail-tool-abi-v1.json +62 -0
- package/contracts/integrations/index.schema.json +37 -0
- package/contracts/integrations/manifest.schema.json +119 -0
- package/contracts/parity/expected-normalized.json +4906 -0
- package/contracts/parity/scenarios.json +100 -0
- package/contracts/parity/scenarios.schema.json +214 -0
- package/contracts/providers/cost-conformance.json +112 -0
- package/contracts/release/github-proof-v1.schema.json +138 -0
- package/contracts/release/gmail-proof-v1.schema.json +138 -0
- package/contracts/release/kaji-ts-consumer-handoff-v1.schema.json +1289 -0
- package/contracts/release/publisher-identity-receipt-v1.schema.json +319 -0
- package/contracts/release/typescript-onboarding-evidence-v1.schema.json +740 -0
- package/contracts/tools/conformance-invalid.json +271 -0
- package/contracts/tools/conformance-valid.json +78 -0
- package/contracts/tools/tool-schema-v1.schema.json +18 -0
- package/dist/anthropic.cjs +1231 -0
- package/dist/anthropic.cjs.map +1 -0
- package/dist/anthropic.d.cts +26 -0
- package/dist/anthropic.d.ts +26 -0
- package/dist/anthropic.js +270 -0
- package/dist/anthropic.js.map +1 -0
- package/dist/auth.cjs +1507 -0
- package/dist/auth.cjs.map +1 -0
- package/dist/auth.d.cts +129 -0
- package/dist/auth.d.ts +129 -0
- package/dist/auth.js +1039 -0
- package/dist/auth.js.map +1 -0
- package/dist/base-B9FRMcP8.d.cts +140 -0
- package/dist/base-nHQd1VtS.d.ts +140 -0
- package/dist/chunk-AAM33KAO.js +4367 -0
- package/dist/chunk-AAM33KAO.js.map +1 -0
- package/dist/chunk-KAJ6BM64.js +153 -0
- package/dist/chunk-KAJ6BM64.js.map +1 -0
- package/dist/chunk-KCAXIOZS.js +308 -0
- package/dist/chunk-KCAXIOZS.js.map +1 -0
- package/dist/chunk-LSJ4AVO2.js +243 -0
- package/dist/chunk-LSJ4AVO2.js.map +1 -0
- package/dist/chunk-TM7ZGOJX.js +716 -0
- package/dist/chunk-TM7ZGOJX.js.map +1 -0
- package/dist/cli/bin.d.ts +2 -0
- package/dist/cli/bin.js +13 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/chunk-2RCWPRVY.js +6277 -0
- package/dist/cli/chunk-2RCWPRVY.js.map +1 -0
- package/dist/cli/chunk-SEBX54TR.js +681 -0
- package/dist/cli/chunk-SEBX54TR.js.map +1 -0
- package/dist/cli/index.d.ts +232 -0
- package/dist/cli/index.js +11 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init-worker.d.ts +2 -0
- package/dist/cli/init-worker.js +18 -0
- package/dist/cli/init-worker.js.map +1 -0
- package/dist/cli/integration-copy-worker.js +48 -0
- package/dist/cli/integration-copy-worker.js.map +1 -0
- package/dist/cli/package-entry-cjs.cjs +21 -0
- package/dist/cli/package-entry-cjs.cjs.map +1 -0
- package/dist/cli/package-entry-cjs.d.cts +2 -0
- package/dist/cli/package-entry.d.ts +2 -0
- package/dist/cli/package-entry.js +13 -0
- package/dist/cli/package-entry.js.map +1 -0
- package/dist/context-BaFHrQHv.d.cts +21 -0
- package/dist/context-BaFHrQHv.d.ts +21 -0
- package/dist/context-C-YPY-GS.d.cts +1538 -0
- package/dist/context-C-YPY-GS.d.ts +1538 -0
- package/dist/index.cjs +12346 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1560 -0
- package/dist/index.d.ts +1560 -0
- package/dist/index.js +7852 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/github.cjs +2092 -0
- package/dist/integrations/github.cjs.map +1 -0
- package/dist/integrations/github.d.cts +21 -0
- package/dist/integrations/github.d.ts +21 -0
- package/dist/integrations/github.js +2088 -0
- package/dist/integrations/github.js.map +1 -0
- package/dist/integrations.cjs +3370 -0
- package/dist/integrations.cjs.map +1 -0
- package/dist/integrations.d.cts +202 -0
- package/dist/integrations.d.ts +202 -0
- package/dist/integrations.js +2650 -0
- package/dist/integrations.js.map +1 -0
- package/dist/observability-Cj--OkME.d.cts +96 -0
- package/dist/observability-Cj--OkME.d.ts +96 -0
- package/dist/openai.cjs +1235 -0
- package/dist/openai.cjs.map +1 -0
- package/dist/openai.d.cts +32 -0
- package/dist/openai.d.ts +32 -0
- package/dist/openai.js +272 -0
- package/dist/openai.js.map +1 -0
- package/dist/testing.cjs +554 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +43 -0
- package/dist/testing.d.ts +43 -0
- package/dist/testing.js +118 -0
- package/dist/testing.js.map +1 -0
- package/package.json +188 -0
- package/registry/echo/index.ts +53 -0
- package/registry/echo/manifest.json +53 -0
- package/registry/github/LICENSE +105 -0
- package/registry/github/client.ts +1727 -0
- package/registry/github/index.ts +263 -0
- package/registry/github/manifest.json +227 -0
- package/registry/github/owner-fixtures.json +10 -0
- package/registry/github/tests/github.test.ts +32 -0
- package/registry/gmail/LICENSE +105 -0
- package/registry/gmail/client.ts +548 -0
- package/registry/gmail/index.ts +165 -0
- package/registry/gmail/manifest.json +102 -0
- package/registry/gmail/owner-fixtures.json +10 -0
- package/registry/gmail/tests/gmail.test.ts +32 -0
- package/registry/index.json +21 -0
- package/registry/index.schema.json +37 -0
- package/registry/schema.json +119 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"namespace": "echo",
|
|
5
|
+
"tools": [
|
|
6
|
+
{
|
|
7
|
+
"name": "say",
|
|
8
|
+
"description": "Return the input string unchanged.",
|
|
9
|
+
"parameters": {
|
|
10
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"message": { "type": "string" }
|
|
14
|
+
},
|
|
15
|
+
"required": ["message"],
|
|
16
|
+
"additionalProperties": false
|
|
17
|
+
},
|
|
18
|
+
"risk": "read",
|
|
19
|
+
"parallel_safe": false
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "shout",
|
|
23
|
+
"description": "Return the input string uppercased.",
|
|
24
|
+
"parameters": {
|
|
25
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
26
|
+
"type": "object",
|
|
27
|
+
"properties": {
|
|
28
|
+
"message": { "type": "string" }
|
|
29
|
+
},
|
|
30
|
+
"required": ["message"],
|
|
31
|
+
"additionalProperties": false
|
|
32
|
+
},
|
|
33
|
+
"risk": "read",
|
|
34
|
+
"parallel_safe": false
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kaji.dev/contracts/integrations/github-api-conformance-v1.json",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"repository": "octo/widgets",
|
|
6
|
+
"token": "fixture-token",
|
|
7
|
+
"cases": [
|
|
8
|
+
{
|
|
9
|
+
"name": "search code",
|
|
10
|
+
"operation": "search_code",
|
|
11
|
+
"input": { "query": "needle", "page": 1, "per_page": 2 },
|
|
12
|
+
"responses": [
|
|
13
|
+
{
|
|
14
|
+
"status": 200,
|
|
15
|
+
"headers": { "content-type": "application/json" },
|
|
16
|
+
"json": {
|
|
17
|
+
"total_count": 1,
|
|
18
|
+
"items": [
|
|
19
|
+
{
|
|
20
|
+
"path": "src/lib.py",
|
|
21
|
+
"sha": "abc123",
|
|
22
|
+
"repository": { "full_name": "octo/widgets" },
|
|
23
|
+
"text_matches": [{ "fragment": "the needle is here" }]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"expected_requests": [
|
|
30
|
+
{
|
|
31
|
+
"method": "GET",
|
|
32
|
+
"path_and_query": "/search/code?page=1&per_page=2&q=needle%20repo%3Aocto%2Fwidgets",
|
|
33
|
+
"headers": {
|
|
34
|
+
"accept": "application/vnd.github.text-match+json",
|
|
35
|
+
"authorization": "Bearer fixture-token"
|
|
36
|
+
},
|
|
37
|
+
"body": null
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"expected": {
|
|
41
|
+
"result": {
|
|
42
|
+
"items": [{ "fragment": "the needle is here", "path": "src/lib.py", "sha": "abc123" }],
|
|
43
|
+
"total_count": 1
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "get file",
|
|
49
|
+
"operation": "get_file",
|
|
50
|
+
"input": { "path": "src/lib.py", "ref": "main" },
|
|
51
|
+
"responses": [
|
|
52
|
+
{
|
|
53
|
+
"status": 200,
|
|
54
|
+
"headers": { "content-type": "application/json" },
|
|
55
|
+
"json": {
|
|
56
|
+
"type": "file",
|
|
57
|
+
"path": "src/lib.py",
|
|
58
|
+
"sha": "def456",
|
|
59
|
+
"size": 6,
|
|
60
|
+
"encoding": "base64",
|
|
61
|
+
"content": "aGVsbG8K"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"expected_requests": [
|
|
66
|
+
{
|
|
67
|
+
"method": "GET",
|
|
68
|
+
"path_and_query": "/repos/octo/widgets/contents/src/lib.py?ref=main",
|
|
69
|
+
"headers": {
|
|
70
|
+
"accept": "application/vnd.github+json",
|
|
71
|
+
"authorization": "Bearer fixture-token"
|
|
72
|
+
},
|
|
73
|
+
"body": null
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"expected": {
|
|
77
|
+
"result": {
|
|
78
|
+
"content": "hello\n",
|
|
79
|
+
"content_omitted": false,
|
|
80
|
+
"path": "src/lib.py",
|
|
81
|
+
"sha": "def456",
|
|
82
|
+
"size": 6
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "omit large file without partial content",
|
|
88
|
+
"operation": "get_file",
|
|
89
|
+
"input": { "path": "large.txt" },
|
|
90
|
+
"responses": [
|
|
91
|
+
{
|
|
92
|
+
"status": 200,
|
|
93
|
+
"headers": { "content-type": "application/json" },
|
|
94
|
+
"json": {
|
|
95
|
+
"type": "file",
|
|
96
|
+
"path": "large.txt",
|
|
97
|
+
"sha": "large456",
|
|
98
|
+
"size": 49153,
|
|
99
|
+
"encoding": "base64",
|
|
100
|
+
"content": ""
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"expected_requests": [
|
|
105
|
+
{
|
|
106
|
+
"method": "GET",
|
|
107
|
+
"path_and_query": "/repos/octo/widgets/contents/large.txt",
|
|
108
|
+
"headers": {
|
|
109
|
+
"accept": "application/vnd.github+json",
|
|
110
|
+
"authorization": "Bearer fixture-token"
|
|
111
|
+
},
|
|
112
|
+
"body": null
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"expected": {
|
|
116
|
+
"result": {
|
|
117
|
+
"content_omitted": true,
|
|
118
|
+
"path": "large.txt",
|
|
119
|
+
"sha": "large456",
|
|
120
|
+
"size": 49153
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "list issues",
|
|
126
|
+
"operation": "list_issues",
|
|
127
|
+
"input": { "state": "closed", "page": 2, "per_page": 2 },
|
|
128
|
+
"responses": [
|
|
129
|
+
{
|
|
130
|
+
"status": 200,
|
|
131
|
+
"headers": {
|
|
132
|
+
"content-type": "application/json",
|
|
133
|
+
"link": "<https://api.github.com/page/3>; rel=next"
|
|
134
|
+
},
|
|
135
|
+
"json": [
|
|
136
|
+
{ "number": 7, "state": "closed", "title": "Fixed", "body": "Issue body" },
|
|
137
|
+
{ "number": 8, "state": "open", "title": "Open", "body": null }
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"expected_requests": [
|
|
142
|
+
{
|
|
143
|
+
"method": "GET",
|
|
144
|
+
"path_and_query": "/repos/octo/widgets/issues?page=2&per_page=2&state=closed",
|
|
145
|
+
"headers": {
|
|
146
|
+
"accept": "application/vnd.github+json",
|
|
147
|
+
"authorization": "Bearer fixture-token"
|
|
148
|
+
},
|
|
149
|
+
"body": null
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"expected": {
|
|
153
|
+
"result": {
|
|
154
|
+
"items": [
|
|
155
|
+
{ "body_preview": "Issue body", "number": 7, "state": "closed", "title": "Fixed" },
|
|
156
|
+
{ "body_preview": "", "number": 8, "state": "open", "title": "Open" }
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "get issue",
|
|
163
|
+
"operation": "get_issue",
|
|
164
|
+
"input": { "issue_number": 7 },
|
|
165
|
+
"responses": [
|
|
166
|
+
{
|
|
167
|
+
"status": 200,
|
|
168
|
+
"headers": { "content-type": "application/json" },
|
|
169
|
+
"json": {
|
|
170
|
+
"number": 7,
|
|
171
|
+
"state": "open",
|
|
172
|
+
"title": "Bug",
|
|
173
|
+
"body": "Details",
|
|
174
|
+
"html_url": "https://github.com/octo/widgets/issues/7"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"expected_requests": [
|
|
179
|
+
{
|
|
180
|
+
"method": "GET",
|
|
181
|
+
"path_and_query": "/repos/octo/widgets/issues/7",
|
|
182
|
+
"headers": {
|
|
183
|
+
"accept": "application/vnd.github+json",
|
|
184
|
+
"authorization": "Bearer fixture-token"
|
|
185
|
+
},
|
|
186
|
+
"body": null
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"expected": {
|
|
190
|
+
"result": {
|
|
191
|
+
"body": "Details",
|
|
192
|
+
"number": 7,
|
|
193
|
+
"state": "open",
|
|
194
|
+
"title": "Bug",
|
|
195
|
+
"url": "https://github.com/octo/widgets/issues/7"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "create issue",
|
|
201
|
+
"operation": "create_issue",
|
|
202
|
+
"input": { "title": "Bug", "body": "Details" },
|
|
203
|
+
"responses": [
|
|
204
|
+
{
|
|
205
|
+
"status": 201,
|
|
206
|
+
"headers": { "content-type": "application/json" },
|
|
207
|
+
"json": {
|
|
208
|
+
"number": 9,
|
|
209
|
+
"state": "open",
|
|
210
|
+
"title": "Bug",
|
|
211
|
+
"body": "Details",
|
|
212
|
+
"html_url": "https://github.com/octo/widgets/issues/9"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"expected_requests": [
|
|
217
|
+
{
|
|
218
|
+
"method": "POST",
|
|
219
|
+
"path_and_query": "/repos/octo/widgets/issues",
|
|
220
|
+
"headers": {
|
|
221
|
+
"accept": "application/vnd.github+json",
|
|
222
|
+
"authorization": "Bearer fixture-token",
|
|
223
|
+
"content-type": "application/json"
|
|
224
|
+
},
|
|
225
|
+
"body": "{\"body\":\"Details\",\"title\":\"Bug\"}"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"expected": {
|
|
229
|
+
"result": {
|
|
230
|
+
"body": "Details",
|
|
231
|
+
"number": 9,
|
|
232
|
+
"state": "open",
|
|
233
|
+
"title": "Bug",
|
|
234
|
+
"url": "https://github.com/octo/widgets/issues/9"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "add comment",
|
|
240
|
+
"operation": "add_comment",
|
|
241
|
+
"input": { "issue_number": 7, "body": "Looks good" },
|
|
242
|
+
"responses": [
|
|
243
|
+
{
|
|
244
|
+
"status": 201,
|
|
245
|
+
"headers": { "content-type": "application/json" },
|
|
246
|
+
"json": {
|
|
247
|
+
"id": 101,
|
|
248
|
+
"html_url": "https://github.com/octo/widgets/issues/7#issuecomment-101",
|
|
249
|
+
"body": "Looks good"
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
],
|
|
253
|
+
"expected_requests": [
|
|
254
|
+
{
|
|
255
|
+
"method": "POST",
|
|
256
|
+
"path_and_query": "/repos/octo/widgets/issues/7/comments",
|
|
257
|
+
"headers": {
|
|
258
|
+
"accept": "application/vnd.github+json",
|
|
259
|
+
"authorization": "Bearer fixture-token",
|
|
260
|
+
"content-type": "application/json"
|
|
261
|
+
},
|
|
262
|
+
"body": "{\"body\":\"Looks good\"}"
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
"expected": {
|
|
266
|
+
"result": {
|
|
267
|
+
"id": 101,
|
|
268
|
+
"url": "https://github.com/octo/widgets/issues/7#issuecomment-101"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "empty search result",
|
|
274
|
+
"operation": "search_code",
|
|
275
|
+
"input": { "query": "absent", "page": 1, "per_page": 10 },
|
|
276
|
+
"responses": [
|
|
277
|
+
{
|
|
278
|
+
"status": 200,
|
|
279
|
+
"headers": { "content-type": "application/json" },
|
|
280
|
+
"json": { "total_count": 0, "items": [] }
|
|
281
|
+
}
|
|
282
|
+
],
|
|
283
|
+
"expected_requests": [
|
|
284
|
+
{
|
|
285
|
+
"method": "GET",
|
|
286
|
+
"path_and_query": "/search/code?page=1&per_page=10&q=absent%20repo%3Aocto%2Fwidgets",
|
|
287
|
+
"headers": {
|
|
288
|
+
"accept": "application/vnd.github.text-match+json",
|
|
289
|
+
"authorization": "Bearer fixture-token"
|
|
290
|
+
},
|
|
291
|
+
"body": null
|
|
292
|
+
}
|
|
293
|
+
],
|
|
294
|
+
"expected": { "result": { "items": [], "total_count": 0 } }
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"name": "401 requires authentication",
|
|
298
|
+
"operation": "get_issue",
|
|
299
|
+
"input": { "issue_number": 7 },
|
|
300
|
+
"responses": [
|
|
301
|
+
{ "status": 401, "headers": { "content-type": "application/json" }, "body": "private-auth-body" }
|
|
302
|
+
],
|
|
303
|
+
"expected_requests": [
|
|
304
|
+
{
|
|
305
|
+
"method": "GET",
|
|
306
|
+
"path_and_query": "/repos/octo/widgets/issues/7",
|
|
307
|
+
"headers": {
|
|
308
|
+
"accept": "application/vnd.github+json",
|
|
309
|
+
"authorization": "Bearer fixture-token"
|
|
310
|
+
},
|
|
311
|
+
"body": null
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"expected": { "error": { "code": "INTEGRATION_AUTH_REQUIRED", "outcome": "failed", "retryable": false } }
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"name": "permission 403 is not rate limit",
|
|
318
|
+
"operation": "get_issue",
|
|
319
|
+
"input": { "issue_number": 7 },
|
|
320
|
+
"responses": [
|
|
321
|
+
{ "status": 403, "headers": { "content-type": "application/json" }, "body": "private-permission-body" }
|
|
322
|
+
],
|
|
323
|
+
"expected_requests": [
|
|
324
|
+
{
|
|
325
|
+
"method": "GET",
|
|
326
|
+
"path_and_query": "/repos/octo/widgets/issues/7",
|
|
327
|
+
"headers": {
|
|
328
|
+
"accept": "application/vnd.github+json",
|
|
329
|
+
"authorization": "Bearer fixture-token"
|
|
330
|
+
},
|
|
331
|
+
"body": null
|
|
332
|
+
}
|
|
333
|
+
],
|
|
334
|
+
"expected": { "error": { "code": "INTEGRATION_API_ERROR", "outcome": "failed", "retryable": false } }
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"name": "secondary rate limit retries one read",
|
|
338
|
+
"operation": "search_code",
|
|
339
|
+
"input": { "query": "needle", "page": 1, "per_page": 2 },
|
|
340
|
+
"responses": [
|
|
341
|
+
{
|
|
342
|
+
"status": 403,
|
|
343
|
+
"headers": { "retry-after": "0", "x-ratelimit-remaining": "1", "x-ratelimit-reset": "1" },
|
|
344
|
+
"body": "private-rate-body"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"status": 200,
|
|
348
|
+
"headers": { "content-type": "application/json" },
|
|
349
|
+
"json": { "total_count": 0, "items": [] }
|
|
350
|
+
}
|
|
351
|
+
],
|
|
352
|
+
"expected_requests": [
|
|
353
|
+
{
|
|
354
|
+
"method": "GET",
|
|
355
|
+
"path_and_query": "/search/code?page=1&per_page=2&q=needle%20repo%3Aocto%2Fwidgets",
|
|
356
|
+
"headers": {
|
|
357
|
+
"accept": "application/vnd.github.text-match+json",
|
|
358
|
+
"authorization": "Bearer fixture-token"
|
|
359
|
+
},
|
|
360
|
+
"body": null
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"method": "GET",
|
|
364
|
+
"path_and_query": "/search/code?page=1&per_page=2&q=needle%20repo%3Aocto%2Fwidgets",
|
|
365
|
+
"headers": {
|
|
366
|
+
"accept": "application/vnd.github.text-match+json",
|
|
367
|
+
"authorization": "Bearer fixture-token"
|
|
368
|
+
},
|
|
369
|
+
"body": null
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
"expected_sleeps": [0],
|
|
373
|
+
"expected": { "result": { "items": [], "total_count": 0 } }
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"name": "404 is confirmed read failure",
|
|
377
|
+
"operation": "get_issue",
|
|
378
|
+
"input": { "issue_number": 404 },
|
|
379
|
+
"responses": [
|
|
380
|
+
{ "status": 404, "headers": { "content-type": "application/json" }, "body": "private-not-found" }
|
|
381
|
+
],
|
|
382
|
+
"expected_requests": [
|
|
383
|
+
{
|
|
384
|
+
"method": "GET",
|
|
385
|
+
"path_and_query": "/repos/octo/widgets/issues/404",
|
|
386
|
+
"headers": {
|
|
387
|
+
"accept": "application/vnd.github+json",
|
|
388
|
+
"authorization": "Bearer fixture-token"
|
|
389
|
+
},
|
|
390
|
+
"body": null
|
|
391
|
+
}
|
|
392
|
+
],
|
|
393
|
+
"expected": { "error": { "code": "INTEGRATION_API_ERROR", "outcome": "failed", "retryable": false } }
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"name": "422 is confirmed mutation rejection",
|
|
397
|
+
"operation": "create_issue",
|
|
398
|
+
"input": { "title": "Bug", "body": "Details" },
|
|
399
|
+
"responses": [
|
|
400
|
+
{ "status": 422, "headers": { "content-type": "application/json" }, "body": "private-validation" }
|
|
401
|
+
],
|
|
402
|
+
"expected_requests": [
|
|
403
|
+
{
|
|
404
|
+
"method": "POST",
|
|
405
|
+
"path_and_query": "/repos/octo/widgets/issues",
|
|
406
|
+
"headers": {
|
|
407
|
+
"accept": "application/vnd.github+json",
|
|
408
|
+
"authorization": "Bearer fixture-token",
|
|
409
|
+
"content-type": "application/json"
|
|
410
|
+
},
|
|
411
|
+
"body": "{\"body\":\"Details\",\"title\":\"Bug\"}"
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
"expected": { "error": { "code": "INTEGRATION_API_ERROR", "outcome": "failed", "retryable": false } }
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"name": "429 mutation is not retried",
|
|
418
|
+
"operation": "add_comment",
|
|
419
|
+
"input": { "issue_number": 7, "body": "Looks good" },
|
|
420
|
+
"responses": [
|
|
421
|
+
{ "status": 429, "headers": { "retry-after": "0", "x-ratelimit-remaining": "0" }, "body": "private-rate" }
|
|
422
|
+
],
|
|
423
|
+
"expected_requests": [
|
|
424
|
+
{
|
|
425
|
+
"method": "POST",
|
|
426
|
+
"path_and_query": "/repos/octo/widgets/issues/7/comments",
|
|
427
|
+
"headers": {
|
|
428
|
+
"accept": "application/vnd.github+json",
|
|
429
|
+
"authorization": "Bearer fixture-token",
|
|
430
|
+
"content-type": "application/json"
|
|
431
|
+
},
|
|
432
|
+
"body": "{\"body\":\"Looks good\"}"
|
|
433
|
+
}
|
|
434
|
+
],
|
|
435
|
+
"expected_sleeps": [],
|
|
436
|
+
"expected": { "error": { "code": "INTEGRATION_RATE_LIMITED", "outcome": "failed", "retryable": true } }
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"name": "malformed JSON read is certified read failure",
|
|
440
|
+
"operation": "get_issue",
|
|
441
|
+
"input": { "issue_number": 7 },
|
|
442
|
+
"responses": [
|
|
443
|
+
{ "status": 200, "headers": { "content-type": "application/json" }, "body": "{not-json" }
|
|
444
|
+
],
|
|
445
|
+
"expected_requests": [
|
|
446
|
+
{
|
|
447
|
+
"method": "GET",
|
|
448
|
+
"path_and_query": "/repos/octo/widgets/issues/7",
|
|
449
|
+
"headers": {
|
|
450
|
+
"accept": "application/vnd.github+json",
|
|
451
|
+
"authorization": "Bearer fixture-token"
|
|
452
|
+
},
|
|
453
|
+
"body": null
|
|
454
|
+
}
|
|
455
|
+
],
|
|
456
|
+
"expected": { "error": { "code": "INTEGRATION_API_ERROR", "outcome": "failed", "retryable": true } }
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"name": "malformed JSON after POST is unknown",
|
|
460
|
+
"operation": "create_issue",
|
|
461
|
+
"input": { "title": "Bug", "body": "Details" },
|
|
462
|
+
"responses": [
|
|
463
|
+
{ "status": 201, "headers": { "content-type": "application/json" }, "body": "{private-not-json" }
|
|
464
|
+
],
|
|
465
|
+
"expected_requests": [
|
|
466
|
+
{
|
|
467
|
+
"method": "POST",
|
|
468
|
+
"path_and_query": "/repos/octo/widgets/issues",
|
|
469
|
+
"headers": {
|
|
470
|
+
"accept": "application/vnd.github+json",
|
|
471
|
+
"authorization": "Bearer fixture-token",
|
|
472
|
+
"content-type": "application/json"
|
|
473
|
+
},
|
|
474
|
+
"body": "{\"body\":\"Details\",\"title\":\"Bug\"}"
|
|
475
|
+
}
|
|
476
|
+
],
|
|
477
|
+
"expected": { "exception": "unknown" }
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"name": "oversize transport read is certified read failure",
|
|
481
|
+
"operation": "get_issue",
|
|
482
|
+
"input": { "issue_number": 7 },
|
|
483
|
+
"responses": [{ "transport_error": "response_limit" }],
|
|
484
|
+
"expected_requests": [
|
|
485
|
+
{
|
|
486
|
+
"method": "GET",
|
|
487
|
+
"path_and_query": "/repos/octo/widgets/issues/7",
|
|
488
|
+
"headers": {
|
|
489
|
+
"accept": "application/vnd.github+json",
|
|
490
|
+
"authorization": "Bearer fixture-token"
|
|
491
|
+
},
|
|
492
|
+
"body": null
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
"expected": { "error": { "code": "INTEGRATION_API_ERROR", "outcome": "failed", "retryable": true } }
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"name": "request cancellation propagates",
|
|
499
|
+
"operation": "get_issue",
|
|
500
|
+
"input": { "issue_number": 7 },
|
|
501
|
+
"responses": [{ "transport_error": "cancelled" }],
|
|
502
|
+
"expected_requests": [
|
|
503
|
+
{
|
|
504
|
+
"method": "GET",
|
|
505
|
+
"path_and_query": "/repos/octo/widgets/issues/7",
|
|
506
|
+
"headers": {
|
|
507
|
+
"accept": "application/vnd.github+json",
|
|
508
|
+
"authorization": "Bearer fixture-token"
|
|
509
|
+
},
|
|
510
|
+
"body": null
|
|
511
|
+
}
|
|
512
|
+
],
|
|
513
|
+
"expected": { "exception": "cancelled" }
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
"name": "connection loss after write dispatch is unknown",
|
|
517
|
+
"operation": "create_issue",
|
|
518
|
+
"input": { "title": "Bug", "body": "Details" },
|
|
519
|
+
"responses": [{ "transport_error": "connection" }],
|
|
520
|
+
"expected_requests": [
|
|
521
|
+
{
|
|
522
|
+
"method": "POST",
|
|
523
|
+
"path_and_query": "/repos/octo/widgets/issues",
|
|
524
|
+
"headers": {
|
|
525
|
+
"accept": "application/vnd.github+json",
|
|
526
|
+
"authorization": "Bearer fixture-token",
|
|
527
|
+
"content-type": "application/json"
|
|
528
|
+
},
|
|
529
|
+
"body": "{\"body\":\"Details\",\"title\":\"Bug\"}"
|
|
530
|
+
}
|
|
531
|
+
],
|
|
532
|
+
"expected": { "exception": "unknown" }
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"name": "mismatched search repository rejects whole response",
|
|
536
|
+
"operation": "search_code",
|
|
537
|
+
"input": { "query": "needle", "page": 1, "per_page": 10 },
|
|
538
|
+
"responses": [
|
|
539
|
+
{
|
|
540
|
+
"status": 200,
|
|
541
|
+
"headers": { "content-type": "application/json" },
|
|
542
|
+
"json": {
|
|
543
|
+
"total_count": 1,
|
|
544
|
+
"items": [
|
|
545
|
+
{
|
|
546
|
+
"path": "private.txt",
|
|
547
|
+
"sha": "bad",
|
|
548
|
+
"repository": { "full_name": "other/private" },
|
|
549
|
+
"text_matches": [{ "fragment": "private-fragment" }]
|
|
550
|
+
}
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
],
|
|
555
|
+
"expected_requests": [
|
|
556
|
+
{
|
|
557
|
+
"method": "GET",
|
|
558
|
+
"path_and_query": "/search/code?page=1&per_page=10&q=needle%20repo%3Aocto%2Fwidgets",
|
|
559
|
+
"headers": {
|
|
560
|
+
"accept": "application/vnd.github.text-match+json",
|
|
561
|
+
"authorization": "Bearer fixture-token"
|
|
562
|
+
},
|
|
563
|
+
"body": null
|
|
564
|
+
}
|
|
565
|
+
],
|
|
566
|
+
"expected": { "error": { "code": "INTEGRATION_API_ERROR", "outcome": "failed", "retryable": true } }
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"name": "scope qualifier rejected before token",
|
|
570
|
+
"operation": "search_code",
|
|
571
|
+
"input": { "query": "Needle ORG:other", "page": 1, "per_page": 10 },
|
|
572
|
+
"responses": [],
|
|
573
|
+
"expected_requests": [],
|
|
574
|
+
"expected_token_calls": 0,
|
|
575
|
+
"expected": { "error": { "code": "INTEGRATION_POLICY_REJECTED", "outcome": "failed", "retryable": false } }
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "invalid base64 file is certified read failure",
|
|
579
|
+
"operation": "get_file",
|
|
580
|
+
"input": { "path": "bad.txt" },
|
|
581
|
+
"responses": [
|
|
582
|
+
{
|
|
583
|
+
"status": 200,
|
|
584
|
+
"headers": { "content-type": "application/json" },
|
|
585
|
+
"json": {
|
|
586
|
+
"type": "file",
|
|
587
|
+
"path": "bad.txt",
|
|
588
|
+
"sha": "bad64",
|
|
589
|
+
"size": 3,
|
|
590
|
+
"encoding": "base64",
|
|
591
|
+
"content": "***="
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
],
|
|
595
|
+
"expected_requests": [
|
|
596
|
+
{
|
|
597
|
+
"method": "GET",
|
|
598
|
+
"path_and_query": "/repos/octo/widgets/contents/bad.txt",
|
|
599
|
+
"headers": {
|
|
600
|
+
"accept": "application/vnd.github+json",
|
|
601
|
+
"authorization": "Bearer fixture-token"
|
|
602
|
+
},
|
|
603
|
+
"body": null
|
|
604
|
+
}
|
|
605
|
+
],
|
|
606
|
+
"expected": { "error": { "code": "INTEGRATION_API_ERROR", "outcome": "failed", "retryable": true } }
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"name": "invalid UTF-8 file is certified read failure",
|
|
610
|
+
"operation": "get_file",
|
|
611
|
+
"input": { "path": "binary.txt" },
|
|
612
|
+
"responses": [
|
|
613
|
+
{
|
|
614
|
+
"status": 200,
|
|
615
|
+
"headers": { "content-type": "application/json" },
|
|
616
|
+
"json": {
|
|
617
|
+
"type": "file",
|
|
618
|
+
"path": "binary.txt",
|
|
619
|
+
"sha": "badutf8",
|
|
620
|
+
"size": 1,
|
|
621
|
+
"encoding": "base64",
|
|
622
|
+
"content": "/w=="
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
],
|
|
626
|
+
"expected_requests": [
|
|
627
|
+
{
|
|
628
|
+
"method": "GET",
|
|
629
|
+
"path_and_query": "/repos/octo/widgets/contents/binary.txt",
|
|
630
|
+
"headers": {
|
|
631
|
+
"accept": "application/vnd.github+json",
|
|
632
|
+
"authorization": "Bearer fixture-token"
|
|
633
|
+
},
|
|
634
|
+
"body": null
|
|
635
|
+
}
|
|
636
|
+
],
|
|
637
|
+
"expected": { "error": { "code": "INTEGRATION_API_ERROR", "outcome": "failed", "retryable": true } }
|
|
638
|
+
}
|
|
639
|
+
],
|
|
640
|
+
"durable_result_boundaries": [
|
|
641
|
+
{ "name": "last accepted byte", "serialized_bytes": 65536, "accepted": true },
|
|
642
|
+
{ "name": "first rejected byte", "serialized_bytes": 65537, "accepted": false }
|
|
643
|
+
]
|
|
644
|
+
}
|