-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
373 lines (371 loc) · 11 KB
/
Copy pathopenapi.yaml
File metadata and controls
373 lines (371 loc) · 11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
openapi: 3.1.0
info:
title: HollerKit Report API
version: 0.5.0
description: |
Machine-readable contract for receiving signed HollerKit bug reports.
The report endpoint accepts `multipart/form-data`. JSON payloads such as
`metadata`, `breadcrumbs`, and `transcript` are sent as multipart text fields
containing JSON strings.
servers:
- url: https://example.com
description: Replace with your HollerKit backend origin.
paths:
/bug-report:
post:
operationId: createBugReport
summary: Create a signed bug report
description: |
Accepts a timestamped HMAC-signed multipart report and creates, skips,
or dispatches the report according to the server configuration.
The signature is the lowercase hex HMAC-SHA256 of `body || timestamp`
using the configured app secret.
security:
- HollerKitTimestamp: []
HollerKitSignature: []
parameters:
- $ref: '#/components/parameters/ContentLength'
- $ref: '#/components/parameters/HollerKitTimestamp'
- $ref: '#/components/parameters/HollerKitSignature'
- $ref: '#/components/parameters/HollerKitRequestId'
requestBody:
required: true
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/BugReportMultipartRequest'
encoding:
image:
contentType: image/png, image/jpeg, image/heic, image/heif
audio:
contentType: audio/mp4, audio/aac, audio/m4a, audio/x-m4a
responses:
'200':
description: The report was accepted.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/BugReportCreatedResponse'
- $ref: '#/components/schemas/BugReportSkippedResponse'
examples:
created:
value:
ok: true
issueUrl: https://github.com/owner/repo/issues/1
reportId: 018f2d0c-33d8-7d6a-b0e2-7fb4cf957e99
skipped:
value:
ok: true
reportId: 018f2d0c-33d8-7d6a-b0e2-7fb4cf957e99
skipped: true
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'405':
$ref: '#/components/responses/MethodNotAllowed'
'413':
$ref: '#/components/responses/PayloadTooLarge'
'415':
$ref: '#/components/responses/UnsupportedMediaType'
'500':
$ref: '#/components/responses/InternalError'
components:
securitySchemes:
HollerKitTimestamp:
type: apiKey
in: header
name: x-hollerkit-timestamp
description: Unix seconds timestamp covered by the HMAC signature.
HollerKitSignature:
type: apiKey
in: header
name: x-hollerkit-signature
description: Lowercase hex HMAC-SHA256 of `body || timestamp`.
parameters:
ContentLength:
name: Content-Length
in: header
required: false
description: Request body byte count. Servers reject values above `maxBodyBytes` before buffering.
schema:
type: integer
minimum: 0
example: 12452
HollerKitTimestamp:
name: x-hollerkit-timestamp
in: header
required: true
description: Unix seconds timestamp covered by the HMAC signature.
schema:
type: integer
minimum: 1
example: 1777857600
HollerKitSignature:
name: x-hollerkit-signature
in: header
required: true
description: Lowercase hex HMAC-SHA256 of `body || timestamp`.
schema:
type: string
pattern: '^[a-f0-9]{64}$'
example: b35166f39a9ce2767342b3153007692e1de6b1c68394e4abb57f806dc23486bd
HollerKitRequestId:
name: x-hollerkit-request-id
in: header
required: false
description: Optional deployment extension for replay deduplication. Include it in the signed material if used.
schema:
type: string
minLength: 1
maxLength: 200
responses:
BadRequest:
description: The request is malformed or violates report mode rules.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
invalidInputMode:
value:
ok: false
error:
code: invalid_input_mode
message: Invalid inputMode value.
Unauthorized:
description: The request is missing or fails authentication.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
invalidSignature:
value:
ok: false
error:
code: invalid_signature
message: Invalid HollerKit request signature.
MethodNotAllowed:
description: The endpoint only accepts POST.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
PayloadTooLarge:
description: The report exceeds a configured count, byte, duration, or length limit.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
UnsupportedMediaType:
description: The request or an uploaded file uses an unsupported media type.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
InternalError:
description: The server failed to handle the report.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
schemas:
BugReportMultipartRequest:
type: object
properties:
inputMode:
$ref: '#/components/schemas/InputMode'
comment:
type: string
description: Optional typed report comment. Not allowed for `audio-only` reports.
maxLength: 10000
transcript:
type: string
description: JSON string matching `TranscriptPayload`.
contentMediaType: application/json
contentSchema:
$ref: '#/components/schemas/TranscriptPayload'
examples:
- '{"text":"It crashes after I tap save.","locale":"en-US","engine":"apple-on-device","durationSeconds":12}'
metadata:
type: string
description: JSON object string containing app, device, OS, and integration metadata.
contentMediaType: application/json
contentSchema:
type: object
additionalProperties: true
examples:
- '{"appVersion":"1.0","osVersion":"iOS 18.5"}'
breadcrumbs:
type: string
description: JSON array string of recent app events.
contentMediaType: application/json
contentSchema:
type: array
maxItems: 100
items:
$ref: '#/components/schemas/Breadcrumb'
examples:
- '[{"timestamp":"2026-05-03T20:00:00.000Z","category":"checkout","message":"Tapped pay"}]'
userIdHash:
type: string
description: Optional opaque hashed user identifier.
image:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/ImageFile'
description: Repeatable image file field.
audio:
$ref: '#/components/schemas/AudioFile'
additionalProperties: false
anyOf:
- required: [comment]
- required: [transcript]
- required: [image]
- required: [audio]
InputMode:
type: string
default: text-and-audio
enum:
- text-and-audio
- text-only
- audio-only
ImageFile:
type: string
format: binary
description: PNG, JPEG, HEIC, or HEIF image file. Default limit is 8 MB per image.
AudioFile:
type: string
format: binary
description: M4A/AAC-style short audio note. Default limits are one file, 2 MB, and 60 seconds.
TranscriptPayload:
type: object
required:
- text
- locale
- engine
properties:
text:
type: string
maxLength: 20000
locale:
type: string
examples: [en-US]
engine:
type: string
enum:
- apple-on-device
- apple-network
- manual
- unavailable
confidence:
type: number
minimum: 0
maximum: 1
durationSeconds:
type: number
minimum: 0
maximum: 60
additionalProperties: true
Breadcrumb:
type: object
required:
- message
properties:
timestamp:
type: string
format: date-time
category:
type: string
message:
type: string
metadata:
type: object
additionalProperties: true
additionalProperties: true
BugReportCreatedResponse:
type: object
required:
- ok
- issueUrl
- reportId
properties:
ok:
type: boolean
const: true
issueUrl:
type: string
format: uri
reportId:
type: string
BugReportSkippedResponse:
type: object
required:
- ok
- reportId
- skipped
properties:
ok:
type: boolean
const: true
reportId:
type: string
skipped:
type: boolean
const: true
ErrorResponse:
type: object
required:
- ok
- error
properties:
ok:
type: boolean
const: false
error:
type: object
required:
- code
- message
properties:
code:
$ref: '#/components/schemas/ErrorCode'
message:
type: string
ErrorCode:
type: string
enum:
- audio_not_allowed
- audio_too_large
- audio_too_long
- body_too_large
- comment_not_allowed
- comment_too_large
- empty_report
- image_too_large
- internal_error
- invalid_breadcrumbs
- invalid_content_length
- invalid_field
- invalid_file
- invalid_input_mode
- invalid_json
- invalid_signature
- invalid_timestamp
- invalid_transcript
- metadata_too_large
- method_not_allowed
- missing_signature
- missing_storage_adapter
- missing_timestamp
- timestamp_out_of_range
- too_many_audio_files
- too_many_breadcrumbs
- too_many_images
- transcript_too_large
- unsupported_audio_type
- unsupported_content_type
- unsupported_image_type