Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
688 lines (686 loc) · 19.4 KB
/
Copy pathopenapi.yaml
File metadata and controls
688 lines (686 loc) · 19.4 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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
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
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
openapi: 3.1.0
info:
title: LogShare API
version: 1.8.8_hotfix.1
description: |
Minecraft / Hytale log sharing platform.
A log is a set of files, not a single body. New clients upload `files`;
the legacy `content` field is still accepted and mapped to `latest.log`.
Each file is filtered and deobfuscated independently. Full Codex analysis
runs only when an insights endpoint is called.
Multi-file logs return `200` plus a file list when accessed without a
filename. Clients should ask the user which file to open, then request
`/raw/{id}/{filename}` or `/insights/{id}/{filename}`.
servers:
- url: https://api.logshare.cn
description: Production API
- url: http://localhost:9501
description: Local Hyperf (direct, dev only)
tags:
- name: Logs
description: Log submission, retrieval, deletion
- name: Analysis
description: Per-file Codex analysis
- name: Meta
description: Upload limits
paths:
/:
get:
tags: [Meta]
summary: API index
operationId: getIndex
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/IndexResponse'
/1/log:
post:
tags: [Logs]
summary: Submit a log (deprecated prefix)
deprecated: true
operationId: createLog
requestBody:
$ref: '#/components/requestBodies/LogUpload'
responses:
'200':
description: Log created
content:
application/json:
schema:
$ref: '#/components/schemas/LogCreateResponse'
'400':
$ref: '#/components/responses/BadRequest'
'413':
$ref: '#/components/responses/PayloadTooLarge'
/v1/log:
post:
tags: [Logs]
summary: Submit a log
description: |
Accepts `files`, legacy `content`, `metadata` and `source` as JSON or
form-urlencoded. Files may be plain text or ZIP archives (auto-expanded).
Limits: 200 files and 20 MiB total after expansion. No per-file size/line limit.
operationId: createLogV1
requestBody:
$ref: '#/components/requestBodies/LogUpload'
responses:
'200':
description: Log created
content:
application/json:
schema:
$ref: '#/components/schemas/LogCreateResponse'
'400':
$ref: '#/components/responses/BadRequest'
'413':
$ref: '#/components/responses/PayloadTooLarge'
delete:
tags: [Logs]
summary: Delete one or more logs
operationId: deleteLogsV1
parameters:
- $ref: '#/components/parameters/LogIdList'
security:
- bearerAuth: []
responses:
'200':
description: Deletion result
content:
application/json:
schema:
$ref: '#/components/schemas/LogDeleteResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
/1/log/{id}:
get:
tags: [Logs]
summary: Get log metadata and file list (deprecated prefix)
deprecated: true
operationId: getLogMeta
parameters:
- $ref: '#/components/parameters/LogId'
responses:
'200':
description: Log metadata and files
content:
application/json:
schema:
$ref: '#/components/schemas/LogMetaResponse'
'404':
$ref: '#/components/responses/NotFound'
delete:
tags: [Logs]
summary: Delete one log (deprecated prefix)
deprecated: true
operationId: deleteLogById
parameters:
- $ref: '#/components/parameters/LogId'
security:
- bearerAuth: []
responses:
'200':
description: Deletion result
content:
application/json:
schema:
$ref: '#/components/schemas/LogDeleteResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
/v1/log/{id}:
get:
tags: [Logs]
summary: Get log metadata and file list
operationId: getLogMetaV1
parameters:
- $ref: '#/components/parameters/LogId'
responses:
'200':
description: Log metadata and files
content:
application/json:
schema:
$ref: '#/components/schemas/LogMetaResponse'
'404':
$ref: '#/components/responses/NotFound'
delete:
tags: [Logs]
summary: Delete one log
operationId: deleteLogByIdV1
parameters:
- $ref: '#/components/parameters/LogId'
security:
- bearerAuth: []
responses:
'200':
description: Deletion result
content:
application/json:
schema:
$ref: '#/components/schemas/LogDeleteResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
/1/raw/{id}:
get:
tags: [Logs]
summary: Read a single file or list files (deprecated prefix)
deprecated: true
operationId: getRawLog
parameters:
- $ref: '#/components/parameters/LogId'
responses:
'200':
description: File content for single-file logs, or a file list for multi-file logs
content:
text/plain:
schema:
type: string
application/json:
schema:
$ref: '#/components/schemas/FileListResponse'
'404':
$ref: '#/components/responses/NotFound'
/v1/raw/{id}:
get:
tags: [Logs]
summary: Read a single file or list files
operationId: getRawLogV1
parameters:
- $ref: '#/components/parameters/LogId'
responses:
'200':
description: File content for single-file logs, or a file list for multi-file logs
content:
text/plain:
schema:
type: string
application/json:
schema:
$ref: '#/components/schemas/FileListResponse'
'404':
$ref: '#/components/responses/NotFound'
/1/raw/{id}/{filename}:
get:
tags: [Logs]
summary: Read one file (deprecated prefix)
deprecated: true
operationId: getRawFile
parameters:
- $ref: '#/components/parameters/LogId'
- $ref: '#/components/parameters/Filename'
responses:
'200':
description: File content
content:
text/plain:
schema:
type: string
'404':
$ref: '#/components/responses/NotFound'
/v1/raw/{id}/{filename}:
get:
tags: [Logs]
summary: Read one file
operationId: getRawFileV1
parameters:
- $ref: '#/components/parameters/LogId'
- $ref: '#/components/parameters/Filename'
responses:
'200':
description: File content
content:
text/plain:
schema:
type: string
'404':
$ref: '#/components/responses/NotFound'
/1/insights/{id}:
get:
tags: [Analysis]
summary: Analyse a single file or list files (deprecated prefix)
deprecated: true
operationId: getInsights
parameters:
- $ref: '#/components/parameters/LogId'
responses:
'200':
description: Analysis JSON for single-file logs, or a file list for multi-file logs
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/AnalysisResponse'
- $ref: '#/components/schemas/FileListResponse'
'404':
$ref: '#/components/responses/NotFound'
/v1/insights/{id}:
get:
tags: [Analysis]
summary: Analyse a single file or list files
operationId: getInsightsV1
parameters:
- $ref: '#/components/parameters/LogId'
responses:
'200':
description: Analysis JSON for single-file logs, or a file list for multi-file logs
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/AnalysisResponse'
- $ref: '#/components/schemas/FileListResponse'
'404':
$ref: '#/components/responses/NotFound'
/1/insights/{id}/{filename}:
get:
tags: [Analysis]
summary: Analyse one file (deprecated prefix)
deprecated: true
operationId: getInsightsFile
parameters:
- $ref: '#/components/parameters/LogId'
- $ref: '#/components/parameters/Filename'
responses:
'200':
description: Codex analysis JSON
content:
application/json:
schema:
$ref: '#/components/schemas/AnalysisResponse'
'404':
$ref: '#/components/responses/NotFound'
/v1/insights/{id}/{filename}:
get:
tags: [Analysis]
summary: Analyse one file
operationId: getInsightsFileV1
parameters:
- $ref: '#/components/parameters/LogId'
- $ref: '#/components/parameters/Filename'
responses:
'200':
description: Codex analysis JSON
content:
application/json:
schema:
$ref: '#/components/schemas/AnalysisResponse'
'404':
$ref: '#/components/responses/NotFound'
/1/limits:
get:
tags: [Meta]
summary: Get upload limits (deprecated prefix)
deprecated: true
operationId: getLimits
responses:
'200':
description: Limits
content:
application/json:
schema:
$ref: '#/components/schemas/LimitsResponse'
/v1/limits:
get:
tags: [Meta]
summary: Get upload limits
operationId: getLimitsV1
responses:
'200':
description: Limits
content:
application/json:
schema:
$ref: '#/components/schemas/LimitsResponse'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
parameters:
LogId:
name: id
in: path
required: true
schema:
type: string
pattern: '^[a-zA-Z0-9]{7}$'
example: sAbCdEf
LogIdList:
name: id
in: path
required: true
schema:
type: string
pattern: '^[a-zA-Z0-9]{7}(,[a-zA-Z0-9]{7})*$'
example: sAbCdEf,fGhIjK
Filename:
name: filename
in: path
required: true
description: URL-encoded file name; may contain relative sub-paths.
schema:
type: string
example: crash-reports/crash-01.txt
requestBodies:
LogUpload:
required: true
content:
application/json:
schema:
type: object
anyOf:
- required: [files]
- required: [content]
properties:
content:
type: string
description: Legacy single-file field, mapped to `latest.log` when non-empty.
files:
type: array
minItems: 1
maxItems: 200
items:
$ref: '#/components/schemas/FileUpload'
metadata:
type: array
maxItems: 100
items:
$ref: '#/components/schemas/MetadataEntry'
source:
type: string
maxLength: 64
application/x-www-form-urlencoded:
schema:
type: object
anyOf:
- required: [files]
- required: [content]
properties:
content:
type: string
description: Legacy single-file field, mapped to `latest.log` when non-empty.
files:
type: array
items:
$ref: '#/components/schemas/FileUpload'
metadata:
type: array
items:
$ref: '#/components/schemas/MetadataEntry'
source:
type: string
maxLength: 64
schemas:
FileUpload:
type: object
required: [name, content]
properties:
name:
type: string
description: File name; may contain relative sub-paths. `.zip` is auto-expanded.
content:
type: string
description: File content or ZIP archive bytes.
FileEntry:
type: object
required: [name, size, lines, raw, insights]
properties:
name:
type: string
size:
type: integer
lines:
type: integer
raw:
type: string
format: uri
insights:
type: string
format: uri
FileListResponse:
type: object
required: [success, message, id, fileCount, requiresFileSelection, raw, files]
properties:
success:
type: boolean
example: true
message:
type: string
example: Multiple files available; specify a filename.
id:
type: string
fileCount:
type: integer
requiresFileSelection:
type: boolean
raw:
type: string
format: uri
description: Main file URL, or `/raw/{id}` for single-file logs.
files:
type: array
items:
$ref: '#/components/schemas/FileEntry'
LogCreateResponse:
type: object
required: [success, message, id, url, filesUrl, raw, token, deduplicated, fileCount, requiresFileSelection, files]
properties:
success:
type: boolean
message:
type: string
id:
type: string
url:
type: string
format: uri
filesUrl:
type: string
format: uri
raw:
type: string
format: uri
description: Main file URL, or `/raw/{id}` for single-file logs.
token:
type: string
pattern: '^[a-f0-9]{64}$'
description: Deletion token. Save it; it cannot be recovered.
deduplicated:
type: boolean
description: True when the upload matched an existing fingerprint. The returned token was not stored and cannot delete that log.
fileCount:
type: integer
requiresFileSelection:
type: boolean
files:
type: array
items:
$ref: '#/components/schemas/FileEntry'
LogMetaResponse:
type: object
required: [success, message, id, fileCount, requiresFileSelection, size, lines, raw, files, filesUrl]
properties:
success:
type: boolean
message:
type: string
id:
type: string
fileCount:
type: integer
requiresFileSelection:
type: boolean
size:
type: integer
lines:
type: integer
created:
type: integer
nullable: true
expires:
type: integer
nullable: true
metadata:
type: array
maxItems: 100
items:
$ref: '#/components/schemas/MetadataEntry'
source:
type: string
nullable: true
raw:
type: string
format: uri
description: Main file URL, or `/raw/{id}` for single-file logs.
files:
type: array
items:
$ref: '#/components/schemas/FileEntry'
filesUrl:
type: string
format: uri
LogDeleteResponse:
type: object
required: [success, message, deleted, failed, total, deletedCount, failedCount]
properties:
success:
type: boolean
message:
type: string
deleted:
type: array
items:
type: string
failed:
type: array
items:
type: object
properties:
id:
type: string
message:
type: string
code:
type: integer
total:
type: integer
deletedCount:
type: integer
failedCount:
type: integer
AnalysisResponse:
type: object
description: Full Codex analysis result (shape varies by log type).
additionalProperties: true
LimitsResponse:
type: object
required: [storageTime, maxFiles, maxTotalBytes, maxRequestBodyBytes]
properties:
storageTime:
type: integer
example: 604800
maxFiles:
type: integer
example: 200
maxTotalBytes:
type: integer
example: 20971520
maxRequestBodyBytes:
type: integer
example: 33554432
MetadataEntry:
type: object
required: [key, value]
description: |
Structured metadata is an important analysis input. Clients should submit
fields such as version, loader, launcher, modpack and crash context.
Backend-derived version/loader fields are stored with visible=false and are
not returned in public metadata responses; only client-submitted visible
entries are exposed.
properties:
key:
type: string
minLength: 1
maxLength: 64
value:
oneOf:
- type: string
- type: number
- type: boolean
- type: array
items: {}
- type: object
additionalProperties: true
label:
type: string
nullable: true
maxLength: 128
visible:
type: boolean
default: true
description: When false, the entry is omitted from public metadata responses.
IndexResponse:
type: object
properties:
success:
type: boolean
message:
type: string
endpoints:
type: array
items:
type: string
ErrorResponse:
type: object
required: [success, error, code]
properties:
success:
type: boolean
example: false
error:
type: string
code:
type: integer
errors:
type: array
items:
type: object
responses:
BadRequest:
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
Unauthorized:
description: Missing or invalid Authorization header
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
Forbidden:
description: Token mismatch or banned IP
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
NotFound:
description: Log or file not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
PayloadTooLarge:
description: Request body or total file size exceeds limit
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'