-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenapi.v1.yaml
More file actions
2968 lines (2799 loc) · 77.8 KB
/
Copy pathopenapi.v1.yaml
File metadata and controls
2968 lines (2799 loc) · 77.8 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
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: cixing api
version: 1.0.0
description: |
Cixing ("姝よ") API V1.0.
servers:
- url: /
tags:
- name: Health
- name: Auth
- name: Official
- name: Review
- name: CustomKeywords
- name: UploadSessions
- name: Reactions
- name: Me
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
headers:
X-Request-ID:
description: Correlation id for tracing.
schema:
type: string
parameters:
XRequestId:
name: X-Request-ID
in: header
required: false
schema:
type: string
maxLength: 128
description: Optional client-provided request id for tracing.
IdempotencyKey:
name: Idempotency-Key
in: header
required: false
schema:
type: string
maxLength: 128
description: Optional idempotency key.
responses:
BadRequest:
description: Bad Request (validation failed)
headers:
X-Request-ID:
$ref: "#/components/headers/X-Request-ID"
content:
application/json:
schema:
$ref: "#/components/schemas/ValidationErrorResponse"
Unauthorized:
description: Unauthorized
headers:
X-Request-ID:
$ref: "#/components/headers/X-Request-ID"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
Forbidden:
description: Forbidden
headers:
X-Request-ID:
$ref: "#/components/headers/X-Request-ID"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
NotFound:
description: Not Found
headers:
X-Request-ID:
$ref: "#/components/headers/X-Request-ID"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
Conflict:
description: Conflict
headers:
X-Request-ID:
$ref: "#/components/headers/X-Request-ID"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
InternalError:
description: Internal Server Error
headers:
X-Request-ID:
$ref: "#/components/headers/X-Request-ID"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
schemas:
ErrorCode:
type: string
enum: [validation, unauthorized, forbidden, not_found, conflict, rate_limited, feature_not_ready, internal]
ErrorResponse:
type: object
required: [code, reason, message, request_id]
properties:
code:
$ref: "#/components/schemas/ErrorCode"
reason:
type: string
example: "common.unauthorized"
message:
type: string
request_id:
type: string
ValidationErrorDetail:
type: object
required: [field, rule, reason]
properties:
field:
type: string
example: "email"
rule:
type: string
example: "email"
reason:
type: string
example: "invalid format"
ValidationErrorResponse:
allOf:
- $ref: "#/components/schemas/ErrorResponse"
- type: object
properties:
code:
type: string
enum: [validation]
details:
type: array
items:
$ref: "#/components/schemas/ValidationErrorDetail"
# ---- Common Enums ----
KeywordCategory:
type: string
enum: [emotion, color, shape, time, abstract]
PromptKind:
type: string
enum: [intuition, structure, concept]
ReactionType:
type: string
enum: [inspired, resonated]
NotificationType:
type: string
enum: [reaction_received]
# ---- Auth ----
EmailRequest:
type: object
required: [email]
properties:
email:
type: string
format: email
maxLength: 254
EmailCodeRequest:
type: object
required: [email, code]
properties:
email:
type: string
format: email
maxLength: 254
code:
type: string
minLength: 6
maxLength: 6
pattern: '^[0-9]{6}$'
SignupVerifyResponse:
type: object
required: [signup_token]
properties:
signup_token:
type: string
SignupCompleteRequest:
type: object
required: [signup_token, password]
properties:
signup_token:
type: string
minLength: 16
password:
type: string
minLength: 8
LoginPasswordRequest:
type: object
required: [email, password]
properties:
email:
type: string
format: email
maxLength: 254
password:
type: string
minLength: 8
ResetVerifyResponse:
type: object
required: [reset_token]
properties:
reset_token:
type: string
ResetCompleteRequest:
type: object
required: [reset_token, new_password]
properties:
reset_token:
type: string
minLength: 16
new_password:
type: string
minLength: 8
AuthToken:
type: object
required: [access_token, token_type]
properties:
token_type:
type: string
enum: [Bearer]
access_token:
type: string
expires_in:
type: integer
format: int64
nullable: true
description: Access token expiry in seconds (optional).
# ---- Keywords & Prompts ----
OfficialKeyword:
type: object
required: [id, text, category, is_active, display_order]
properties:
id:
type: string
format: uuid
text:
type: string
minLength: 1
maxLength: 50
category:
$ref: "#/components/schemas/KeywordCategory"
is_active:
type: boolean
display_order:
type: integer
minimum: 1
ReactionCounts:
type: object
required: [inspired, resonated]
properties:
inspired:
type: integer
minimum: 0
resonated:
type: integer
minimum: 0
TodayKeywordResponse:
type: object
required: [biz_date, keyword, participant_user_count]
properties:
biz_date:
type: string
format: date
keyword:
$ref: "#/components/schemas/OfficialKeyword"
participant_user_count:
type: integer
minimum: 0
OfficialHomeResponse:
type: object
required: [today, yesterday]
properties:
today:
$ref: "#/components/schemas/TodayKeywordResponse"
yesterday:
$ref: "#/components/schemas/TodayKeywordResponse"
Prompt:
type: object
required: [id, kind, content]
properties:
id:
type: string
format: uuid
kind:
$ref: "#/components/schemas/PromptKind"
content:
type: string
minLength: 1
maxLength: 200
DrawPromptRequest:
type: object
required: [kind]
properties:
kind:
$ref: "#/components/schemas/PromptKind"
# ---- Images & Uploads ----
ImageVariant:
type: object
required: [url, width, height]
properties:
url:
type: string
format: uri
width:
type: integer
minimum: 1
height:
type: integer
minimum: 1
ImageRef:
type: object
required: [id, variants]
properties:
id:
type: string
format: uuid
variants:
type: object
required: [original, card_4x3, square_small, square_medium]
properties:
original:
$ref: "#/components/schemas/ImageVariant"
card_4x3:
$ref: "#/components/schemas/ImageVariant"
square_small:
$ref: "#/components/schemas/ImageVariant"
square_medium:
$ref: "#/components/schemas/ImageVariant"
ImageRefSquareSmall:
type: object
required: [id, variants]
properties:
id:
type: string
format: uuid
variants:
type: object
required: [square_small]
properties:
square_small:
$ref: "#/components/schemas/ImageVariant"
ImageRefSquareMedium:
type: object
required: [id, variants]
properties:
id:
type: string
format: uuid
variants:
type: object
required: [square_medium]
properties:
square_medium:
$ref: "#/components/schemas/ImageVariant"
ImageRefCard4x3:
type: object
required: [id, variants]
properties:
id:
type: string
format: uuid
variants:
type: object
required: [card_4x3]
properties:
card_4x3:
$ref: "#/components/schemas/ImageVariant"
ImageRefOriginal:
type: object
required: [id, variants]
properties:
id:
type: string
format: uuid
variants:
type: object
required: [original]
properties:
original:
$ref: "#/components/schemas/ImageVariant"
ImageRefDetailLarge:
type: object
required: [id, variants]
properties:
id:
type: string
format: uuid
variants:
type: object
required: [detail_large]
properties:
detail_large:
$ref: "#/components/schemas/ImageVariant"
UploadPublishContextType:
type: string
enum: [official_today, custom_keyword]
UploadPublishSessionStatus:
type: string
enum: [created, committed, canceled, expired]
UploadPublishSessionItemStatus:
type: string
enum: [pending_upload, uploaded]
UploadPublishVisibilityStatus:
type: string
enum: [processing, visible, hidden, deleted]
UploadPublishSessionContext:
type: object
required: [type]
properties:
type:
$ref: "#/components/schemas/UploadPublishContextType"
official_keyword_id:
type: string
format: uuid
nullable: true
biz_date:
type: string
format: date
nullable: true
custom_keyword_id:
type: string
format: uuid
nullable: true
CreateUploadPublishSessionRequest:
type: object
required: [context]
properties:
context:
$ref: "#/components/schemas/UploadPublishSessionContext"
expected_image_count:
type: integer
minimum: 1
nullable: true
CreateUploadPublishSessionResponse:
type: object
required: [session_id, status, expires_at]
properties:
session_id:
type: string
format: uuid
status:
$ref: "#/components/schemas/UploadPublishSessionStatus"
expires_at:
type: string
format: date-time
UploadPublishSessionItemSummary:
type: object
required: [item_id, client_image_id, status, is_cover, has_audio]
properties:
item_id:
type: string
format: uuid
client_image_id:
type: string
minLength: 1
status:
$ref: "#/components/schemas/UploadPublishSessionItemStatus"
display_order:
type: integer
minimum: 1
nullable: true
is_cover:
type: boolean
has_audio:
type: boolean
title:
type: string
maxLength: 80
nullable: true
note:
type: string
maxLength: 500
nullable: true
UploadPresignedTarget:
type: object
required: [method, url, object_key, expires_at]
properties:
method:
type: string
enum: [POST, PUT]
url:
type: string
format: uri
headers:
type: object
additionalProperties:
type: string
nullable: true
form_fields:
type: object
additionalProperties:
type: string
nullable: true
object_key:
type: string
minLength: 1
expires_at:
type: string
format: date-time
UploadPublishPresignBatchItemRequest:
type: object
required: [client_image_id, image_content_type, image_content_length]
description: >
One batch item represents one image in the upload flow. The item may
optionally include one bound audio file. Order, cover choice, title,
and note are not submitted here; they are submitted later in
complete-batch after client uploads finish.
properties:
client_image_id:
type: string
minLength: 1
image_content_type:
type: string
example: image/jpeg
image_content_length:
type: integer
format: int64
minimum: 1
image_sha256:
type: string
nullable: true
audio_content_type:
type: string
nullable: true
example: audio/aac
audio_content_length:
type: integer
format: int64
minimum: 1
nullable: true
audio_sha256:
type: string
nullable: true
UploadPublishPresignBatchRequest:
type: object
required: [items]
description: >
The client calls this once after local editing is done. Each item
describes one image and an optional bound audio file to presign for
direct upload.
properties:
items:
type: array
minItems: 1
items:
$ref: "#/components/schemas/UploadPublishPresignBatchItemRequest"
UploadPublishPresignBatchItemResponse:
type: object
required: [client_image_id, item_id, image_id, image_upload]
properties:
client_image_id:
type: string
item_id:
type: string
format: uuid
image_id:
type: string
format: uuid
image_upload:
$ref: "#/components/schemas/UploadPresignedTarget"
audio_upload:
allOf:
- $ref: "#/components/schemas/UploadPresignedTarget"
nullable: true
UploadPublishPresignBatchResponse:
type: object
required: [session_id, items]
properties:
session_id:
type: string
format: uuid
items:
type: array
items:
$ref: "#/components/schemas/UploadPublishPresignBatchItemResponse"
UploadPublishCompleteBatchItemRequest:
type: object
required: [item_id, image_etag, image_width, image_height, display_order]
description: >
One completed upload item. This is where the client submits the final
metadata for that image in a single round-trip, including optional
audio, optional title/note, final order, and optional cover flag.
properties:
item_id:
type: string
format: uuid
description: Must be unique within one batch request.
image_etag:
type: string
minLength: 1
image_width:
type: integer
minimum: 1
image_height:
type: integer
minimum: 1
display_order:
type: integer
minimum: 1
description: Final image order candidate. At commit time all completed items must form a continuous sequence from 1.
is_cover:
type: boolean
nullable: true
description: Cover candidate for this item. Across one upload, at most one image can be cover.
title:
type: string
maxLength: 80
nullable: true
note:
type: string
maxLength: 500
nullable: true
audio_etag:
type: string
nullable: true
audio_duration_ms:
type: integer
minimum: 1
nullable: true
UploadPublishCompleteBatchRequest:
type: object
required: [items]
description: >
The client submits all finalized item metadata in one request after all
direct uploads succeed. There are no separate cover or reorder APIs.
properties:
items:
type: array
minItems: 1
description: item_id and display_order should both be unique in the same request.
items:
$ref: "#/components/schemas/UploadPublishCompleteBatchItemRequest"
UploadPublishCompleteBatchItemResponse:
type: object
required: [item_id, status, display_order, is_cover]
properties:
item_id:
type: string
format: uuid
status:
$ref: "#/components/schemas/UploadPublishSessionItemStatus"
display_order:
type: integer
is_cover:
type: boolean
UploadPublishCompleteBatchResponse:
type: object
required: [session_id, status, items]
properties:
session_id:
type: string
format: uuid
status:
$ref: "#/components/schemas/UploadPublishSessionStatus"
items:
type: array
items:
$ref: "#/components/schemas/UploadPublishCompleteBatchItemResponse"
UploadPublishCommitResponse:
type: object
required: [session_id, upload_id, status, upload_visibility]
properties:
session_id:
type: string
format: uuid
upload_id:
type: string
format: uuid
status:
$ref: "#/components/schemas/UploadPublishSessionStatus"
upload_visibility:
$ref: "#/components/schemas/UploadPublishVisibilityStatus"
SetCustomKeywordCoverRequest:
type: object
required: [image_id]
properties:
image_id:
type: string
format: uuid
SetCustomKeywordCoverResponse:
type: object
required: [keyword_id, cover_source]
properties:
keyword_id:
type: string
format: uuid
cover_source:
$ref: "#/components/schemas/CustomKeywordCoverSource"
cover_image:
$ref: "#/components/schemas/ImageRefDetailLarge"
nullable: true
# ---- WorkUploads / WorkImages ----
WorkImage:
type: object
required: [id, image, display_order, has_audio, created_at]
properties:
id:
type: string
format: uuid
image:
$ref: "#/components/schemas/ImageRefDetailLarge"
display_order:
type: integer
minimum: 1
title:
type: string
maxLength: 80
nullable: true
note:
type: string
maxLength: 500
nullable: true
has_audio:
type: boolean
audio_duration_ms:
type: integer
minimum: 1
nullable: true
audio_play_url:
type: string
format: uri
nullable: true
created_at:
type: string
format: date-time
PublicWorkUploadCard:
type: object
required: [id, biz_date, keyword_id, cover_image, image_count, created_at]
properties:
id:
type: string
format: uuid
biz_date:
type: string
format: date
keyword_id:
type: string
format: uuid
cover_image:
$ref: "#/components/schemas/ImageRefCard4x3"
display_text:
type: string
maxLength: 500
nullable: true
description: UI text for list card, fallback policy decided by server (title first, else note).
cover_has_audio:
type: boolean
nullable: true
cover_audio_duration_ms:
type: integer
minimum: 1
nullable: true
image_count:
type: integer
minimum: 1
reaction_counts:
$ref: "#/components/schemas/ReactionCounts"
nullable: true
my_reactions:
type: array
items:
$ref: "#/components/schemas/ReactionType"
nullable: true
created_at:
type: string
format: date-time
PublicWorkUploadDetail:
allOf:
- $ref: "#/components/schemas/PublicWorkUploadCard"
- type: object
required: [images]
properties:
images:
type: array
items:
$ref: "#/components/schemas/WorkImage"
ListPublicUploadsResponse:
type: object
required: [items]
properties:
items:
type: array
items:
$ref: "#/components/schemas/PublicWorkUploadCard"
seed:
type: number
format: double
nullable: true
MyWorkUploadCard:
type: object
required: [id, biz_date, keyword_id, cover_image, image_count, created_at]
properties:
id:
type: string
format: uuid
biz_date:
type: string
format: date
keyword_id:
type: string
format: uuid
cover_image:
$ref: "#/components/schemas/ImageRefCard4x3"
display_text:
type: string
maxLength: 500
nullable: true
description: UI text for list card, fallback policy decided by server (title first, else note).
cover_has_audio:
type: boolean
nullable: true
cover_audio_duration_ms:
type: integer
minimum: 1
nullable: true
image_count:
type: integer
minimum: 1
reaction_counts:
$ref: "#/components/schemas/ReactionCounts"
nullable: true
created_at:
type: string
format: date-time
MyWorkUploadDetail:
allOf:
- $ref: "#/components/schemas/MyWorkUploadCard"
- type: object
required: [images]
properties:
images:
type: array
items:
$ref: "#/components/schemas/WorkImage"
ListMyUploadsResponse:
type: object
required: [items]
properties:
items:
type: array
items:
$ref: "#/components/schemas/MyWorkUploadCard"
CustomKeywordCoverSource:
type: string
enum: [auto_latest, manual]
CustomKeywordImageCard:
type: object
required: [id, image, display_order, created_at]
properties:
id:
type: string
format: uuid
image:
$ref: "#/components/schemas/ImageRefSquareMedium"
display_order:
type: integer
minimum: 1
created_at:
type: string
format: date-time
ListCustomKeywordImagesResponse:
type: object
required: [cover_source, items]
properties:
cover_source:
$ref: "#/components/schemas/CustomKeywordCoverSource"
cover_image:
$ref: "#/components/schemas/ImageRefDetailLarge"
nullable: true
items:
type: array
items:
$ref: "#/components/schemas/CustomKeywordImageCard"
CustomKeywordImageDetail:
type: object
required: [id, custom_keyword_id, image, display_order, has_audio, created_at]
properties:
id:
type: string
format: uuid
custom_keyword_id:
type: string
format: uuid
image:
$ref: "#/components/schemas/ImageRefDetailLarge"
display_order:
type: integer
minimum: 1
title:
type: string
maxLength: 80
nullable: true
note:
type: string
maxLength: 500
nullable: true
has_audio:
type: boolean
audio_duration_ms:
type: integer
minimum: 1
nullable: true
audio_play_url:
type: string
format: uri
nullable: true
created_at:
type: string
format: date-time
CustomKeywordUploadPreviewImage:
type: object
required: [id, image, display_order, has_audio, created_at]
properties:
id:
type: string
format: uuid
description: work_upload_images.id
image:
$ref: "#/components/schemas/ImageRefSquareMedium"
display_order:
type: integer
minimum: 1
title:
type: string
maxLength: 80
nullable: true