@humation/sdk 0.1.0

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/openapi.json ADDED
@@ -0,0 +1,778 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "version": "0.1.0",
5
+ "title": "Humation Public API v1",
6
+ "description": "Public API for rendering Humation SVG assets."
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "https://api.humation.app/v1",
11
+ "description": "Production"
12
+ },
13
+ {
14
+ "url": "https://staging-api.humation.app/v1",
15
+ "description": "Staging"
16
+ }
17
+ ],
18
+ "components": {
19
+ "schemas": {},
20
+ "parameters": {},
21
+ "securitySchemes": {
22
+ "bearerAuth": {
23
+ "type": "http",
24
+ "scheme": "bearer"
25
+ }
26
+ }
27
+ },
28
+ "paths": {
29
+ "/health": {
30
+ "get": {
31
+ "operationId": "getHealth",
32
+ "tags": ["v1"],
33
+ "summary": "Check API availability",
34
+ "responses": {
35
+ "200": {
36
+ "description": "API is available.",
37
+ "content": {
38
+ "application/json": {
39
+ "schema": {
40
+ "type": "object",
41
+ "properties": {
42
+ "status": {
43
+ "type": "string",
44
+ "enum": ["ok"]
45
+ }
46
+ },
47
+ "required": ["status"]
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ },
55
+ "/templates": {
56
+ "get": {
57
+ "operationId": "listTemplates",
58
+ "tags": ["Templates"],
59
+ "summary": "List published templates",
60
+ "security": [
61
+ {
62
+ "bearerAuth": []
63
+ }
64
+ ],
65
+ "responses": {
66
+ "200": {
67
+ "description": "Published templates.",
68
+ "content": {
69
+ "application/json": {
70
+ "schema": {
71
+ "type": "object",
72
+ "properties": {
73
+ "templates": {
74
+ "type": "array",
75
+ "items": {
76
+ "type": "object",
77
+ "properties": {
78
+ "id": {
79
+ "type": "string"
80
+ },
81
+ "name": {
82
+ "type": "string"
83
+ },
84
+ "author": {
85
+ "type": "object",
86
+ "properties": {
87
+ "name": {
88
+ "type": "string"
89
+ },
90
+ "url": {
91
+ "type": "string"
92
+ }
93
+ },
94
+ "required": ["name"]
95
+ },
96
+ "templateUrl": {
97
+ "type": "string"
98
+ },
99
+ "assetsUrl": {
100
+ "type": "string"
101
+ },
102
+ "renderSvgUrl": {
103
+ "type": "string"
104
+ }
105
+ },
106
+ "required": [
107
+ "id",
108
+ "name",
109
+ "author",
110
+ "templateUrl",
111
+ "assetsUrl",
112
+ "renderSvgUrl"
113
+ ]
114
+ }
115
+ }
116
+ },
117
+ "required": ["templates"]
118
+ }
119
+ }
120
+ }
121
+ },
122
+ "304": {
123
+ "description": "Not modified."
124
+ },
125
+ "401": {
126
+ "description": "API key is missing or invalid."
127
+ },
128
+ "429": {
129
+ "description": "Rate limit exceeded."
130
+ }
131
+ }
132
+ }
133
+ },
134
+ "/templates/{templateId}": {
135
+ "get": {
136
+ "operationId": "getTemplate",
137
+ "tags": ["Templates"],
138
+ "summary": "Get a published template",
139
+ "security": [
140
+ {
141
+ "bearerAuth": []
142
+ }
143
+ ],
144
+ "parameters": [
145
+ {
146
+ "schema": {
147
+ "type": "string",
148
+ "minLength": 1
149
+ },
150
+ "required": true,
151
+ "name": "templateId",
152
+ "in": "path"
153
+ }
154
+ ],
155
+ "responses": {
156
+ "200": {
157
+ "description": "Template customization metadata.",
158
+ "content": {
159
+ "application/json": {
160
+ "schema": {
161
+ "type": "object",
162
+ "properties": {
163
+ "id": {
164
+ "type": "string"
165
+ },
166
+ "name": {
167
+ "type": "string"
168
+ },
169
+ "author": {
170
+ "type": "object",
171
+ "properties": {
172
+ "name": {
173
+ "type": "string"
174
+ },
175
+ "url": {
176
+ "type": "string"
177
+ }
178
+ },
179
+ "required": ["name"]
180
+ },
181
+ "groups": {
182
+ "type": "array",
183
+ "items": {
184
+ "type": "object",
185
+ "properties": {
186
+ "id": {
187
+ "type": "string",
188
+ "minLength": 1
189
+ },
190
+ "label": {
191
+ "type": "string",
192
+ "minLength": 1
193
+ },
194
+ "control": {
195
+ "type": "string",
196
+ "enum": ["select", "toggle"],
197
+ "default": "select"
198
+ },
199
+ "defaultPart": {
200
+ "type": "string",
201
+ "minLength": 1
202
+ },
203
+ "onPart": {
204
+ "type": "string",
205
+ "minLength": 1
206
+ },
207
+ "offPart": {
208
+ "type": "string",
209
+ "minLength": 1
210
+ },
211
+ "parts": {
212
+ "type": "array",
213
+ "items": {
214
+ "type": "object",
215
+ "properties": {
216
+ "id": {
217
+ "type": "string",
218
+ "minLength": 1
219
+ },
220
+ "label": {
221
+ "type": "string"
222
+ }
223
+ },
224
+ "required": ["id"]
225
+ },
226
+ "minItems": 1
227
+ },
228
+ "layerOrder": {
229
+ "type": "integer"
230
+ },
231
+ "offset": {
232
+ "type": "object",
233
+ "properties": {
234
+ "x": {
235
+ "type": "number"
236
+ },
237
+ "y": {
238
+ "type": "number"
239
+ }
240
+ },
241
+ "required": ["x", "y"]
242
+ },
243
+ "size": {
244
+ "type": "object",
245
+ "properties": {
246
+ "width": {
247
+ "type": "number",
248
+ "minimum": 0,
249
+ "exclusiveMinimum": true
250
+ },
251
+ "height": {
252
+ "type": "number",
253
+ "minimum": 0,
254
+ "exclusiveMinimum": true
255
+ }
256
+ },
257
+ "required": ["width", "height"]
258
+ }
259
+ },
260
+ "required": [
261
+ "id",
262
+ "label",
263
+ "defaultPart",
264
+ "parts",
265
+ "layerOrder",
266
+ "offset",
267
+ "size"
268
+ ]
269
+ }
270
+ },
271
+ "colorOptions": {
272
+ "type": "array",
273
+ "items": {
274
+ "type": "object",
275
+ "properties": {
276
+ "id": {
277
+ "type": "string",
278
+ "minLength": 1
279
+ },
280
+ "label": {
281
+ "type": "string",
282
+ "minLength": 1
283
+ },
284
+ "default": {
285
+ "type": "string",
286
+ "pattern": "^[0-9a-fA-F]{6}$"
287
+ }
288
+ },
289
+ "required": ["id", "label", "default"]
290
+ }
291
+ },
292
+ "cropOptions": {
293
+ "type": "array",
294
+ "items": {
295
+ "type": "object",
296
+ "properties": {
297
+ "id": {
298
+ "type": "string",
299
+ "enum": ["avatar", "full"]
300
+ },
301
+ "mode": {
302
+ "type": "string",
303
+ "enum": ["bounds", "square_from_bounds", "view_box"]
304
+ },
305
+ "paddingRatio": {
306
+ "type": "number",
307
+ "minimum": 0
308
+ },
309
+ "viewBox": {
310
+ "type": "object",
311
+ "properties": {
312
+ "x": {
313
+ "type": "number"
314
+ },
315
+ "y": {
316
+ "type": "number"
317
+ },
318
+ "width": {
319
+ "type": "number",
320
+ "minimum": 0,
321
+ "exclusiveMinimum": true
322
+ },
323
+ "height": {
324
+ "type": "number",
325
+ "minimum": 0,
326
+ "exclusiveMinimum": true
327
+ }
328
+ },
329
+ "required": ["x", "y", "width", "height"]
330
+ }
331
+ },
332
+ "required": ["id", "mode"]
333
+ }
334
+ },
335
+ "defaultCrop": {
336
+ "type": "string",
337
+ "enum": ["avatar", "full"]
338
+ },
339
+ "renderSvgUrl": {
340
+ "type": "string"
341
+ }
342
+ },
343
+ "required": [
344
+ "id",
345
+ "name",
346
+ "author",
347
+ "groups",
348
+ "colorOptions",
349
+ "cropOptions",
350
+ "defaultCrop",
351
+ "renderSvgUrl"
352
+ ]
353
+ }
354
+ }
355
+ }
356
+ },
357
+ "304": {
358
+ "description": "Not modified."
359
+ },
360
+ "401": {
361
+ "description": "API key is missing or invalid."
362
+ },
363
+ "404": {
364
+ "description": "Template is unavailable.",
365
+ "content": {
366
+ "application/json": {
367
+ "schema": {
368
+ "type": "object",
369
+ "properties": {
370
+ "error": {
371
+ "type": "object",
372
+ "properties": {
373
+ "message": {
374
+ "type": "string"
375
+ }
376
+ },
377
+ "required": ["message"]
378
+ }
379
+ },
380
+ "required": ["error"]
381
+ }
382
+ }
383
+ }
384
+ },
385
+ "429": {
386
+ "description": "Rate limit exceeded."
387
+ }
388
+ }
389
+ }
390
+ },
391
+ "/templates/{templateId}/assets": {
392
+ "get": {
393
+ "operationId": "getTemplateAssets",
394
+ "tags": ["Templates"],
395
+ "summary": "Get template assets",
396
+ "security": [
397
+ {
398
+ "bearerAuth": []
399
+ }
400
+ ],
401
+ "parameters": [
402
+ {
403
+ "schema": {
404
+ "type": "string",
405
+ "minLength": 1
406
+ },
407
+ "required": true,
408
+ "name": "templateId",
409
+ "in": "path"
410
+ }
411
+ ],
412
+ "responses": {
413
+ "200": {
414
+ "description": "Published metadata and SVG parts, including linked hidden render layers, for local composition.",
415
+ "content": {
416
+ "application/json": {
417
+ "schema": {
418
+ "type": "object",
419
+ "properties": {
420
+ "id": {
421
+ "type": "string"
422
+ },
423
+ "name": {
424
+ "type": "string"
425
+ },
426
+ "author": {
427
+ "type": "object",
428
+ "properties": {
429
+ "name": {
430
+ "type": "string"
431
+ },
432
+ "url": {
433
+ "type": "string"
434
+ }
435
+ },
436
+ "required": ["name"]
437
+ },
438
+ "groups": {
439
+ "type": "array",
440
+ "items": {
441
+ "type": "object",
442
+ "properties": {
443
+ "id": {
444
+ "type": "string",
445
+ "minLength": 1
446
+ },
447
+ "label": {
448
+ "type": "string",
449
+ "minLength": 1
450
+ },
451
+ "control": {
452
+ "type": "string",
453
+ "enum": ["select", "toggle"],
454
+ "default": "select"
455
+ },
456
+ "hidden": {
457
+ "type": "boolean",
458
+ "default": false
459
+ },
460
+ "defaultPart": {
461
+ "type": "string",
462
+ "minLength": 1
463
+ },
464
+ "onPart": {
465
+ "type": "string",
466
+ "minLength": 1
467
+ },
468
+ "offPart": {
469
+ "type": "string",
470
+ "minLength": 1
471
+ },
472
+ "parts": {
473
+ "type": "array",
474
+ "items": {
475
+ "type": "object",
476
+ "properties": {
477
+ "id": {
478
+ "type": "string",
479
+ "minLength": 1
480
+ },
481
+ "label": {
482
+ "type": "string"
483
+ }
484
+ },
485
+ "required": ["id"]
486
+ },
487
+ "minItems": 1
488
+ },
489
+ "layerOrder": {
490
+ "type": "integer"
491
+ },
492
+ "offset": {
493
+ "type": "object",
494
+ "properties": {
495
+ "x": {
496
+ "type": "number"
497
+ },
498
+ "y": {
499
+ "type": "number"
500
+ }
501
+ },
502
+ "required": ["x", "y"]
503
+ },
504
+ "size": {
505
+ "type": "object",
506
+ "properties": {
507
+ "width": {
508
+ "type": "number",
509
+ "minimum": 0,
510
+ "exclusiveMinimum": true
511
+ },
512
+ "height": {
513
+ "type": "number",
514
+ "minimum": 0,
515
+ "exclusiveMinimum": true
516
+ }
517
+ },
518
+ "required": ["width", "height"]
519
+ },
520
+ "links": {
521
+ "type": "array",
522
+ "items": {
523
+ "type": "object",
524
+ "properties": {
525
+ "targetGroupId": {
526
+ "type": "string",
527
+ "minLength": 1
528
+ },
529
+ "behavior": {
530
+ "type": "string",
531
+ "enum": ["mirror_selection"]
532
+ }
533
+ },
534
+ "required": ["targetGroupId", "behavior"]
535
+ },
536
+ "default": []
537
+ }
538
+ },
539
+ "required": [
540
+ "id",
541
+ "label",
542
+ "defaultPart",
543
+ "parts",
544
+ "layerOrder",
545
+ "offset",
546
+ "size"
547
+ ]
548
+ }
549
+ },
550
+ "colorOptions": {
551
+ "type": "array",
552
+ "items": {
553
+ "type": "object",
554
+ "properties": {
555
+ "id": {
556
+ "type": "string",
557
+ "minLength": 1
558
+ },
559
+ "label": {
560
+ "type": "string",
561
+ "minLength": 1
562
+ },
563
+ "default": {
564
+ "type": "string",
565
+ "pattern": "^[0-9a-fA-F]{6}$"
566
+ }
567
+ },
568
+ "required": ["id", "label", "default"]
569
+ }
570
+ },
571
+ "cropOptions": {
572
+ "type": "array",
573
+ "items": {
574
+ "type": "object",
575
+ "properties": {
576
+ "id": {
577
+ "type": "string",
578
+ "enum": ["avatar", "full"]
579
+ },
580
+ "mode": {
581
+ "type": "string",
582
+ "enum": ["bounds", "square_from_bounds", "view_box"]
583
+ },
584
+ "paddingRatio": {
585
+ "type": "number",
586
+ "minimum": 0
587
+ },
588
+ "viewBox": {
589
+ "type": "object",
590
+ "properties": {
591
+ "x": {
592
+ "type": "number"
593
+ },
594
+ "y": {
595
+ "type": "number"
596
+ },
597
+ "width": {
598
+ "type": "number",
599
+ "minimum": 0,
600
+ "exclusiveMinimum": true
601
+ },
602
+ "height": {
603
+ "type": "number",
604
+ "minimum": 0,
605
+ "exclusiveMinimum": true
606
+ }
607
+ },
608
+ "required": ["x", "y", "width", "height"]
609
+ }
610
+ },
611
+ "required": ["id", "mode"]
612
+ }
613
+ },
614
+ "defaultCrop": {
615
+ "type": "string",
616
+ "enum": ["avatar", "full"]
617
+ },
618
+ "renderSvgUrl": {
619
+ "type": "string"
620
+ },
621
+ "assets": {
622
+ "type": "array",
623
+ "items": {
624
+ "type": "object",
625
+ "properties": {
626
+ "groupId": {
627
+ "type": "string"
628
+ },
629
+ "partId": {
630
+ "type": "string"
631
+ },
632
+ "svg": {
633
+ "type": "string"
634
+ }
635
+ },
636
+ "required": ["groupId", "partId", "svg"]
637
+ }
638
+ }
639
+ },
640
+ "required": [
641
+ "id",
642
+ "name",
643
+ "author",
644
+ "groups",
645
+ "colorOptions",
646
+ "cropOptions",
647
+ "defaultCrop",
648
+ "renderSvgUrl",
649
+ "assets"
650
+ ]
651
+ }
652
+ }
653
+ }
654
+ },
655
+ "304": {
656
+ "description": "Not modified."
657
+ },
658
+ "401": {
659
+ "description": "API key is missing or invalid."
660
+ },
661
+ "404": {
662
+ "description": "Template is unavailable.",
663
+ "content": {
664
+ "application/json": {
665
+ "schema": {
666
+ "type": "object",
667
+ "properties": {
668
+ "error": {
669
+ "type": "object",
670
+ "properties": {
671
+ "message": {
672
+ "type": "string"
673
+ }
674
+ },
675
+ "required": ["message"]
676
+ }
677
+ },
678
+ "required": ["error"]
679
+ }
680
+ }
681
+ }
682
+ },
683
+ "429": {
684
+ "description": "Rate limit exceeded."
685
+ }
686
+ }
687
+ }
688
+ },
689
+ "/templates/{templateId}/render.svg": {
690
+ "get": {
691
+ "operationId": "renderTemplateSvg",
692
+ "tags": ["Templates"],
693
+ "summary": "Render a customized SVG avatar",
694
+ "security": [
695
+ {
696
+ "bearerAuth": []
697
+ }
698
+ ],
699
+ "parameters": [
700
+ {
701
+ "schema": {
702
+ "type": "string",
703
+ "minLength": 1
704
+ },
705
+ "required": true,
706
+ "name": "templateId",
707
+ "in": "path"
708
+ }
709
+ ],
710
+ "responses": {
711
+ "200": {
712
+ "description": "Rendered SVG avatar.",
713
+ "content": {
714
+ "image/svg+xml": {
715
+ "schema": {
716
+ "type": "string"
717
+ }
718
+ }
719
+ }
720
+ },
721
+ "304": {
722
+ "description": "Not modified."
723
+ },
724
+ "400": {
725
+ "description": "Invalid customization parameter.",
726
+ "content": {
727
+ "application/json": {
728
+ "schema": {
729
+ "type": "object",
730
+ "properties": {
731
+ "error": {
732
+ "type": "object",
733
+ "properties": {
734
+ "message": {
735
+ "type": "string"
736
+ }
737
+ },
738
+ "required": ["message"]
739
+ }
740
+ },
741
+ "required": ["error"]
742
+ }
743
+ }
744
+ }
745
+ },
746
+ "401": {
747
+ "description": "API key is missing or invalid."
748
+ },
749
+ "404": {
750
+ "description": "Template is unavailable.",
751
+ "content": {
752
+ "application/json": {
753
+ "schema": {
754
+ "type": "object",
755
+ "properties": {
756
+ "error": {
757
+ "type": "object",
758
+ "properties": {
759
+ "message": {
760
+ "type": "string"
761
+ }
762
+ },
763
+ "required": ["message"]
764
+ }
765
+ },
766
+ "required": ["error"]
767
+ }
768
+ }
769
+ }
770
+ },
771
+ "429": {
772
+ "description": "Rate limit exceeded."
773
+ }
774
+ }
775
+ }
776
+ }
777
+ }
778
+ }