@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/README.md +172 -0
- package/dist/index.d.mts +699 -0
- package/dist/index.d.ts +699 -0
- package/dist/index.js +520 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +495 -0
- package/dist/index.mjs.map +1 -0
- package/openapi.json +778 -0
- package/package.json +54 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
type HexColor = string;
|
|
2
|
+
type CropId = 'avatar' | 'full';
|
|
3
|
+
type Background = HexColor | 'transparent';
|
|
4
|
+
type HumationClientOptions = {
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
fetch?: typeof fetch;
|
|
8
|
+
headers?: HeadersInit;
|
|
9
|
+
};
|
|
10
|
+
type TemplateSummary = {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
author: {
|
|
14
|
+
name: string;
|
|
15
|
+
url?: string;
|
|
16
|
+
};
|
|
17
|
+
templateUrl: string;
|
|
18
|
+
assetsUrl: string;
|
|
19
|
+
renderSvgUrl: string;
|
|
20
|
+
};
|
|
21
|
+
type TemplatePart = {
|
|
22
|
+
id: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
};
|
|
25
|
+
type TemplateGroup = {
|
|
26
|
+
id: string;
|
|
27
|
+
label: string;
|
|
28
|
+
control?: 'select' | 'toggle';
|
|
29
|
+
hidden?: boolean;
|
|
30
|
+
defaultPart: string;
|
|
31
|
+
onPart?: string;
|
|
32
|
+
offPart?: string;
|
|
33
|
+
parts: TemplatePart[];
|
|
34
|
+
layerOrder: number;
|
|
35
|
+
offset: {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
};
|
|
39
|
+
size: {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
};
|
|
43
|
+
links?: Array<{
|
|
44
|
+
targetGroupId: string;
|
|
45
|
+
behavior: 'mirror_selection';
|
|
46
|
+
}>;
|
|
47
|
+
};
|
|
48
|
+
type TemplateColorOption = {
|
|
49
|
+
id: string;
|
|
50
|
+
label: string;
|
|
51
|
+
default: HexColor;
|
|
52
|
+
};
|
|
53
|
+
type TemplateCropOption = {
|
|
54
|
+
id: CropId;
|
|
55
|
+
mode: 'bounds' | 'square_from_bounds' | 'view_box';
|
|
56
|
+
paddingRatio?: number;
|
|
57
|
+
viewBox?: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
type AvatarTemplate = {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
author: {
|
|
68
|
+
name: string;
|
|
69
|
+
url?: string;
|
|
70
|
+
};
|
|
71
|
+
groups: TemplateGroup[];
|
|
72
|
+
colorOptions: TemplateColorOption[];
|
|
73
|
+
cropOptions: TemplateCropOption[];
|
|
74
|
+
defaultCrop: CropId;
|
|
75
|
+
renderSvgUrl: string;
|
|
76
|
+
};
|
|
77
|
+
type AvatarAsset = {
|
|
78
|
+
groupId: string;
|
|
79
|
+
partId: string;
|
|
80
|
+
svg: string;
|
|
81
|
+
};
|
|
82
|
+
type AvatarAssetsResponse = AvatarTemplate & {
|
|
83
|
+
assets: AvatarAsset[];
|
|
84
|
+
};
|
|
85
|
+
type AvatarState = {
|
|
86
|
+
templateId: string;
|
|
87
|
+
parts: Record<string, string>;
|
|
88
|
+
colors: Record<string, HexColor>;
|
|
89
|
+
background: Background;
|
|
90
|
+
crop: CropId;
|
|
91
|
+
};
|
|
92
|
+
type LoadAvatarOptions = {
|
|
93
|
+
state?: Partial<AvatarState>;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
declare class AvatarSession {
|
|
97
|
+
readonly template: AvatarAssetsResponse;
|
|
98
|
+
private readonly assets;
|
|
99
|
+
private readonly baseUrl;
|
|
100
|
+
private state;
|
|
101
|
+
constructor(template: AvatarAssetsResponse, baseUrl: string, state?: Partial<AvatarState>);
|
|
102
|
+
getState(): AvatarState;
|
|
103
|
+
toJSON(): AvatarState;
|
|
104
|
+
getGroups(options?: {
|
|
105
|
+
includeHidden?: boolean;
|
|
106
|
+
}): TemplateGroup[];
|
|
107
|
+
getParts(groupId: string): TemplatePart[];
|
|
108
|
+
getColors(): TemplateColorOption[];
|
|
109
|
+
setPart(groupId: string, partId: string): this;
|
|
110
|
+
setColor(colorId: string, color: string): this;
|
|
111
|
+
setBackground(background: Background): this;
|
|
112
|
+
setCrop(crop: CropId): this;
|
|
113
|
+
toSvg(): string;
|
|
114
|
+
toPngBlob(): Promise<Blob>;
|
|
115
|
+
renderUrl(): string;
|
|
116
|
+
private getGroup;
|
|
117
|
+
private normalizePartValue;
|
|
118
|
+
private resolveLinkedSelections;
|
|
119
|
+
private buildRenderLayers;
|
|
120
|
+
private resolveViewBox;
|
|
121
|
+
private getBounds;
|
|
122
|
+
private findAsset;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
declare class HumationClient {
|
|
126
|
+
readonly baseUrl: string;
|
|
127
|
+
private readonly apiKey?;
|
|
128
|
+
private readonly fetcher;
|
|
129
|
+
private readonly headers?;
|
|
130
|
+
constructor(options?: HumationClientOptions);
|
|
131
|
+
listTemplates(): Promise<TemplateSummary[]>;
|
|
132
|
+
getTemplate(templateId: string): Promise<AvatarTemplate>;
|
|
133
|
+
getTemplateAssets(templateId: string): Promise<AvatarAssetsResponse>;
|
|
134
|
+
loadAvatar(templateId: string, options?: LoadAvatarOptions): Promise<AvatarSession>;
|
|
135
|
+
renderUrl(templateId: string): string;
|
|
136
|
+
private requestJson;
|
|
137
|
+
private buildHeaders;
|
|
138
|
+
}
|
|
139
|
+
declare function createHumationClient(options?: HumationClientOptions): HumationClient;
|
|
140
|
+
|
|
141
|
+
declare class HumationApiError extends Error {
|
|
142
|
+
readonly status: number;
|
|
143
|
+
readonly statusText: string;
|
|
144
|
+
readonly body: unknown;
|
|
145
|
+
constructor(response: Response, body?: unknown);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Generated by orval v8.13.0 🍺
|
|
150
|
+
* Do not edit manually.
|
|
151
|
+
* Humation Public API v1
|
|
152
|
+
* Public API for rendering Humation SVG assets.
|
|
153
|
+
* OpenAPI spec version: 0.1.0
|
|
154
|
+
*/
|
|
155
|
+
type GetHealth200Status = (typeof GetHealth200Status)[keyof typeof GetHealth200Status];
|
|
156
|
+
declare const GetHealth200Status: {
|
|
157
|
+
readonly ok: "ok";
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Generated by orval v8.13.0 🍺
|
|
162
|
+
* Do not edit manually.
|
|
163
|
+
* Humation Public API v1
|
|
164
|
+
* Public API for rendering Humation SVG assets.
|
|
165
|
+
* OpenAPI spec version: 0.1.0
|
|
166
|
+
*/
|
|
167
|
+
|
|
168
|
+
type GetHealth200 = {
|
|
169
|
+
status: GetHealth200Status;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Generated by orval v8.13.0 🍺
|
|
174
|
+
* Do not edit manually.
|
|
175
|
+
* Humation Public API v1
|
|
176
|
+
* Public API for rendering Humation SVG assets.
|
|
177
|
+
* OpenAPI spec version: 0.1.0
|
|
178
|
+
*/
|
|
179
|
+
type GetTemplate200Author = {
|
|
180
|
+
name: string;
|
|
181
|
+
url?: string;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Generated by orval v8.13.0 🍺
|
|
186
|
+
* Do not edit manually.
|
|
187
|
+
* Humation Public API v1
|
|
188
|
+
* Public API for rendering Humation SVG assets.
|
|
189
|
+
* OpenAPI spec version: 0.1.0
|
|
190
|
+
*/
|
|
191
|
+
type GetTemplate200ColorOptionsItem = {
|
|
192
|
+
/** @minLength 1 */
|
|
193
|
+
id: string;
|
|
194
|
+
/** @minLength 1 */
|
|
195
|
+
label: string;
|
|
196
|
+
/** @pattern ^[0-9a-fA-F]{6}$ */
|
|
197
|
+
default: string;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Generated by orval v8.13.0 🍺
|
|
202
|
+
* Do not edit manually.
|
|
203
|
+
* Humation Public API v1
|
|
204
|
+
* Public API for rendering Humation SVG assets.
|
|
205
|
+
* OpenAPI spec version: 0.1.0
|
|
206
|
+
*/
|
|
207
|
+
type GetTemplate200CropOptionsItemId = (typeof GetTemplate200CropOptionsItemId)[keyof typeof GetTemplate200CropOptionsItemId];
|
|
208
|
+
declare const GetTemplate200CropOptionsItemId: {
|
|
209
|
+
readonly avatar: "avatar";
|
|
210
|
+
readonly full: "full";
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Generated by orval v8.13.0 🍺
|
|
215
|
+
* Do not edit manually.
|
|
216
|
+
* Humation Public API v1
|
|
217
|
+
* Public API for rendering Humation SVG assets.
|
|
218
|
+
* OpenAPI spec version: 0.1.0
|
|
219
|
+
*/
|
|
220
|
+
type GetTemplate200CropOptionsItemMode = (typeof GetTemplate200CropOptionsItemMode)[keyof typeof GetTemplate200CropOptionsItemMode];
|
|
221
|
+
declare const GetTemplate200CropOptionsItemMode: {
|
|
222
|
+
readonly bounds: "bounds";
|
|
223
|
+
readonly square_from_bounds: "square_from_bounds";
|
|
224
|
+
readonly view_box: "view_box";
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Generated by orval v8.13.0 🍺
|
|
229
|
+
* Do not edit manually.
|
|
230
|
+
* Humation Public API v1
|
|
231
|
+
* Public API for rendering Humation SVG assets.
|
|
232
|
+
* OpenAPI spec version: 0.1.0
|
|
233
|
+
*/
|
|
234
|
+
type GetTemplate200CropOptionsItemViewBox = {
|
|
235
|
+
x: number;
|
|
236
|
+
y: number;
|
|
237
|
+
/** @exclusiveMinimum 0 */
|
|
238
|
+
width: number;
|
|
239
|
+
/** @exclusiveMinimum 0 */
|
|
240
|
+
height: number;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Generated by orval v8.13.0 🍺
|
|
245
|
+
* Do not edit manually.
|
|
246
|
+
* Humation Public API v1
|
|
247
|
+
* Public API for rendering Humation SVG assets.
|
|
248
|
+
* OpenAPI spec version: 0.1.0
|
|
249
|
+
*/
|
|
250
|
+
|
|
251
|
+
type GetTemplate200CropOptionsItem = {
|
|
252
|
+
id: GetTemplate200CropOptionsItemId;
|
|
253
|
+
mode: GetTemplate200CropOptionsItemMode;
|
|
254
|
+
/** @minimum 0 */
|
|
255
|
+
paddingRatio?: number;
|
|
256
|
+
viewBox?: GetTemplate200CropOptionsItemViewBox;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Generated by orval v8.13.0 🍺
|
|
261
|
+
* Do not edit manually.
|
|
262
|
+
* Humation Public API v1
|
|
263
|
+
* Public API for rendering Humation SVG assets.
|
|
264
|
+
* OpenAPI spec version: 0.1.0
|
|
265
|
+
*/
|
|
266
|
+
type GetTemplate200DefaultCrop = (typeof GetTemplate200DefaultCrop)[keyof typeof GetTemplate200DefaultCrop];
|
|
267
|
+
declare const GetTemplate200DefaultCrop: {
|
|
268
|
+
readonly avatar: "avatar";
|
|
269
|
+
readonly full: "full";
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Generated by orval v8.13.0 🍺
|
|
274
|
+
* Do not edit manually.
|
|
275
|
+
* Humation Public API v1
|
|
276
|
+
* Public API for rendering Humation SVG assets.
|
|
277
|
+
* OpenAPI spec version: 0.1.0
|
|
278
|
+
*/
|
|
279
|
+
type GetTemplate200GroupsItemControl = (typeof GetTemplate200GroupsItemControl)[keyof typeof GetTemplate200GroupsItemControl];
|
|
280
|
+
declare const GetTemplate200GroupsItemControl: {
|
|
281
|
+
readonly select: "select";
|
|
282
|
+
readonly toggle: "toggle";
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Generated by orval v8.13.0 🍺
|
|
287
|
+
* Do not edit manually.
|
|
288
|
+
* Humation Public API v1
|
|
289
|
+
* Public API for rendering Humation SVG assets.
|
|
290
|
+
* OpenAPI spec version: 0.1.0
|
|
291
|
+
*/
|
|
292
|
+
type GetTemplate200GroupsItemOffset = {
|
|
293
|
+
x: number;
|
|
294
|
+
y: number;
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Generated by orval v8.13.0 🍺
|
|
299
|
+
* Do not edit manually.
|
|
300
|
+
* Humation Public API v1
|
|
301
|
+
* Public API for rendering Humation SVG assets.
|
|
302
|
+
* OpenAPI spec version: 0.1.0
|
|
303
|
+
*/
|
|
304
|
+
type GetTemplate200GroupsItemPartsItem = {
|
|
305
|
+
/** @minLength 1 */
|
|
306
|
+
id: string;
|
|
307
|
+
label?: string;
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Generated by orval v8.13.0 🍺
|
|
312
|
+
* Do not edit manually.
|
|
313
|
+
* Humation Public API v1
|
|
314
|
+
* Public API for rendering Humation SVG assets.
|
|
315
|
+
* OpenAPI spec version: 0.1.0
|
|
316
|
+
*/
|
|
317
|
+
type GetTemplate200GroupsItemSize = {
|
|
318
|
+
/** @exclusiveMinimum 0 */
|
|
319
|
+
width: number;
|
|
320
|
+
/** @exclusiveMinimum 0 */
|
|
321
|
+
height: number;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Generated by orval v8.13.0 🍺
|
|
326
|
+
* Do not edit manually.
|
|
327
|
+
* Humation Public API v1
|
|
328
|
+
* Public API for rendering Humation SVG assets.
|
|
329
|
+
* OpenAPI spec version: 0.1.0
|
|
330
|
+
*/
|
|
331
|
+
|
|
332
|
+
type GetTemplate200GroupsItem = {
|
|
333
|
+
/** @minLength 1 */
|
|
334
|
+
id: string;
|
|
335
|
+
/** @minLength 1 */
|
|
336
|
+
label: string;
|
|
337
|
+
control?: GetTemplate200GroupsItemControl;
|
|
338
|
+
/** @minLength 1 */
|
|
339
|
+
defaultPart: string;
|
|
340
|
+
/** @minLength 1 */
|
|
341
|
+
onPart?: string;
|
|
342
|
+
/** @minLength 1 */
|
|
343
|
+
offPart?: string;
|
|
344
|
+
/** @minItems 1 */
|
|
345
|
+
parts: GetTemplate200GroupsItemPartsItem[];
|
|
346
|
+
layerOrder: number;
|
|
347
|
+
offset: GetTemplate200GroupsItemOffset;
|
|
348
|
+
size: GetTemplate200GroupsItemSize;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Generated by orval v8.13.0 🍺
|
|
353
|
+
* Do not edit manually.
|
|
354
|
+
* Humation Public API v1
|
|
355
|
+
* Public API for rendering Humation SVG assets.
|
|
356
|
+
* OpenAPI spec version: 0.1.0
|
|
357
|
+
*/
|
|
358
|
+
|
|
359
|
+
type GetTemplate200 = {
|
|
360
|
+
id: string;
|
|
361
|
+
name: string;
|
|
362
|
+
author: GetTemplate200Author;
|
|
363
|
+
groups: GetTemplate200GroupsItem[];
|
|
364
|
+
colorOptions: GetTemplate200ColorOptionsItem[];
|
|
365
|
+
cropOptions: GetTemplate200CropOptionsItem[];
|
|
366
|
+
defaultCrop: GetTemplate200DefaultCrop;
|
|
367
|
+
renderSvgUrl: string;
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Generated by orval v8.13.0 🍺
|
|
372
|
+
* Do not edit manually.
|
|
373
|
+
* Humation Public API v1
|
|
374
|
+
* Public API for rendering Humation SVG assets.
|
|
375
|
+
* OpenAPI spec version: 0.1.0
|
|
376
|
+
*/
|
|
377
|
+
type GetTemplateAssets200AssetsItem = {
|
|
378
|
+
groupId: string;
|
|
379
|
+
partId: string;
|
|
380
|
+
svg: string;
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Generated by orval v8.13.0 🍺
|
|
385
|
+
* Do not edit manually.
|
|
386
|
+
* Humation Public API v1
|
|
387
|
+
* Public API for rendering Humation SVG assets.
|
|
388
|
+
* OpenAPI spec version: 0.1.0
|
|
389
|
+
*/
|
|
390
|
+
type GetTemplateAssets200Author = {
|
|
391
|
+
name: string;
|
|
392
|
+
url?: string;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Generated by orval v8.13.0 🍺
|
|
397
|
+
* Do not edit manually.
|
|
398
|
+
* Humation Public API v1
|
|
399
|
+
* Public API for rendering Humation SVG assets.
|
|
400
|
+
* OpenAPI spec version: 0.1.0
|
|
401
|
+
*/
|
|
402
|
+
type GetTemplateAssets200ColorOptionsItem = {
|
|
403
|
+
/** @minLength 1 */
|
|
404
|
+
id: string;
|
|
405
|
+
/** @minLength 1 */
|
|
406
|
+
label: string;
|
|
407
|
+
/** @pattern ^[0-9a-fA-F]{6}$ */
|
|
408
|
+
default: string;
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Generated by orval v8.13.0 🍺
|
|
413
|
+
* Do not edit manually.
|
|
414
|
+
* Humation Public API v1
|
|
415
|
+
* Public API for rendering Humation SVG assets.
|
|
416
|
+
* OpenAPI spec version: 0.1.0
|
|
417
|
+
*/
|
|
418
|
+
type GetTemplateAssets200CropOptionsItemId = (typeof GetTemplateAssets200CropOptionsItemId)[keyof typeof GetTemplateAssets200CropOptionsItemId];
|
|
419
|
+
declare const GetTemplateAssets200CropOptionsItemId: {
|
|
420
|
+
readonly avatar: "avatar";
|
|
421
|
+
readonly full: "full";
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Generated by orval v8.13.0 🍺
|
|
426
|
+
* Do not edit manually.
|
|
427
|
+
* Humation Public API v1
|
|
428
|
+
* Public API for rendering Humation SVG assets.
|
|
429
|
+
* OpenAPI spec version: 0.1.0
|
|
430
|
+
*/
|
|
431
|
+
type GetTemplateAssets200CropOptionsItemMode = (typeof GetTemplateAssets200CropOptionsItemMode)[keyof typeof GetTemplateAssets200CropOptionsItemMode];
|
|
432
|
+
declare const GetTemplateAssets200CropOptionsItemMode: {
|
|
433
|
+
readonly bounds: "bounds";
|
|
434
|
+
readonly square_from_bounds: "square_from_bounds";
|
|
435
|
+
readonly view_box: "view_box";
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Generated by orval v8.13.0 🍺
|
|
440
|
+
* Do not edit manually.
|
|
441
|
+
* Humation Public API v1
|
|
442
|
+
* Public API for rendering Humation SVG assets.
|
|
443
|
+
* OpenAPI spec version: 0.1.0
|
|
444
|
+
*/
|
|
445
|
+
type GetTemplateAssets200CropOptionsItemViewBox = {
|
|
446
|
+
x: number;
|
|
447
|
+
y: number;
|
|
448
|
+
/** @exclusiveMinimum 0 */
|
|
449
|
+
width: number;
|
|
450
|
+
/** @exclusiveMinimum 0 */
|
|
451
|
+
height: number;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Generated by orval v8.13.0 🍺
|
|
456
|
+
* Do not edit manually.
|
|
457
|
+
* Humation Public API v1
|
|
458
|
+
* Public API for rendering Humation SVG assets.
|
|
459
|
+
* OpenAPI spec version: 0.1.0
|
|
460
|
+
*/
|
|
461
|
+
|
|
462
|
+
type GetTemplateAssets200CropOptionsItem = {
|
|
463
|
+
id: GetTemplateAssets200CropOptionsItemId;
|
|
464
|
+
mode: GetTemplateAssets200CropOptionsItemMode;
|
|
465
|
+
/** @minimum 0 */
|
|
466
|
+
paddingRatio?: number;
|
|
467
|
+
viewBox?: GetTemplateAssets200CropOptionsItemViewBox;
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Generated by orval v8.13.0 🍺
|
|
472
|
+
* Do not edit manually.
|
|
473
|
+
* Humation Public API v1
|
|
474
|
+
* Public API for rendering Humation SVG assets.
|
|
475
|
+
* OpenAPI spec version: 0.1.0
|
|
476
|
+
*/
|
|
477
|
+
type GetTemplateAssets200DefaultCrop = (typeof GetTemplateAssets200DefaultCrop)[keyof typeof GetTemplateAssets200DefaultCrop];
|
|
478
|
+
declare const GetTemplateAssets200DefaultCrop: {
|
|
479
|
+
readonly avatar: "avatar";
|
|
480
|
+
readonly full: "full";
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Generated by orval v8.13.0 🍺
|
|
485
|
+
* Do not edit manually.
|
|
486
|
+
* Humation Public API v1
|
|
487
|
+
* Public API for rendering Humation SVG assets.
|
|
488
|
+
* OpenAPI spec version: 0.1.0
|
|
489
|
+
*/
|
|
490
|
+
type GetTemplateAssets200GroupsItemControl = (typeof GetTemplateAssets200GroupsItemControl)[keyof typeof GetTemplateAssets200GroupsItemControl];
|
|
491
|
+
declare const GetTemplateAssets200GroupsItemControl: {
|
|
492
|
+
readonly select: "select";
|
|
493
|
+
readonly toggle: "toggle";
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Generated by orval v8.13.0 🍺
|
|
498
|
+
* Do not edit manually.
|
|
499
|
+
* Humation Public API v1
|
|
500
|
+
* Public API for rendering Humation SVG assets.
|
|
501
|
+
* OpenAPI spec version: 0.1.0
|
|
502
|
+
*/
|
|
503
|
+
type GetTemplateAssets200GroupsItemLinksItemBehavior = (typeof GetTemplateAssets200GroupsItemLinksItemBehavior)[keyof typeof GetTemplateAssets200GroupsItemLinksItemBehavior];
|
|
504
|
+
declare const GetTemplateAssets200GroupsItemLinksItemBehavior: {
|
|
505
|
+
readonly mirror_selection: "mirror_selection";
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Generated by orval v8.13.0 🍺
|
|
510
|
+
* Do not edit manually.
|
|
511
|
+
* Humation Public API v1
|
|
512
|
+
* Public API for rendering Humation SVG assets.
|
|
513
|
+
* OpenAPI spec version: 0.1.0
|
|
514
|
+
*/
|
|
515
|
+
|
|
516
|
+
type GetTemplateAssets200GroupsItemLinksItem = {
|
|
517
|
+
/** @minLength 1 */
|
|
518
|
+
targetGroupId: string;
|
|
519
|
+
behavior: GetTemplateAssets200GroupsItemLinksItemBehavior;
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Generated by orval v8.13.0 🍺
|
|
524
|
+
* Do not edit manually.
|
|
525
|
+
* Humation Public API v1
|
|
526
|
+
* Public API for rendering Humation SVG assets.
|
|
527
|
+
* OpenAPI spec version: 0.1.0
|
|
528
|
+
*/
|
|
529
|
+
type GetTemplateAssets200GroupsItemOffset = {
|
|
530
|
+
x: number;
|
|
531
|
+
y: number;
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Generated by orval v8.13.0 🍺
|
|
536
|
+
* Do not edit manually.
|
|
537
|
+
* Humation Public API v1
|
|
538
|
+
* Public API for rendering Humation SVG assets.
|
|
539
|
+
* OpenAPI spec version: 0.1.0
|
|
540
|
+
*/
|
|
541
|
+
type GetTemplateAssets200GroupsItemPartsItem = {
|
|
542
|
+
/** @minLength 1 */
|
|
543
|
+
id: string;
|
|
544
|
+
label?: string;
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Generated by orval v8.13.0 🍺
|
|
549
|
+
* Do not edit manually.
|
|
550
|
+
* Humation Public API v1
|
|
551
|
+
* Public API for rendering Humation SVG assets.
|
|
552
|
+
* OpenAPI spec version: 0.1.0
|
|
553
|
+
*/
|
|
554
|
+
type GetTemplateAssets200GroupsItemSize = {
|
|
555
|
+
/** @exclusiveMinimum 0 */
|
|
556
|
+
width: number;
|
|
557
|
+
/** @exclusiveMinimum 0 */
|
|
558
|
+
height: number;
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Generated by orval v8.13.0 🍺
|
|
563
|
+
* Do not edit manually.
|
|
564
|
+
* Humation Public API v1
|
|
565
|
+
* Public API for rendering Humation SVG assets.
|
|
566
|
+
* OpenAPI spec version: 0.1.0
|
|
567
|
+
*/
|
|
568
|
+
|
|
569
|
+
type GetTemplateAssets200GroupsItem = {
|
|
570
|
+
/** @minLength 1 */
|
|
571
|
+
id: string;
|
|
572
|
+
/** @minLength 1 */
|
|
573
|
+
label: string;
|
|
574
|
+
control?: GetTemplateAssets200GroupsItemControl;
|
|
575
|
+
hidden?: boolean;
|
|
576
|
+
/** @minLength 1 */
|
|
577
|
+
defaultPart: string;
|
|
578
|
+
/** @minLength 1 */
|
|
579
|
+
onPart?: string;
|
|
580
|
+
/** @minLength 1 */
|
|
581
|
+
offPart?: string;
|
|
582
|
+
/** @minItems 1 */
|
|
583
|
+
parts: GetTemplateAssets200GroupsItemPartsItem[];
|
|
584
|
+
layerOrder: number;
|
|
585
|
+
offset: GetTemplateAssets200GroupsItemOffset;
|
|
586
|
+
size: GetTemplateAssets200GroupsItemSize;
|
|
587
|
+
links?: GetTemplateAssets200GroupsItemLinksItem[];
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Generated by orval v8.13.0 🍺
|
|
592
|
+
* Do not edit manually.
|
|
593
|
+
* Humation Public API v1
|
|
594
|
+
* Public API for rendering Humation SVG assets.
|
|
595
|
+
* OpenAPI spec version: 0.1.0
|
|
596
|
+
*/
|
|
597
|
+
|
|
598
|
+
type GetTemplateAssets200 = {
|
|
599
|
+
id: string;
|
|
600
|
+
name: string;
|
|
601
|
+
author: GetTemplateAssets200Author;
|
|
602
|
+
groups: GetTemplateAssets200GroupsItem[];
|
|
603
|
+
colorOptions: GetTemplateAssets200ColorOptionsItem[];
|
|
604
|
+
cropOptions: GetTemplateAssets200CropOptionsItem[];
|
|
605
|
+
defaultCrop: GetTemplateAssets200DefaultCrop;
|
|
606
|
+
renderSvgUrl: string;
|
|
607
|
+
assets: GetTemplateAssets200AssetsItem[];
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Generated by orval v8.13.0 🍺
|
|
612
|
+
* Do not edit manually.
|
|
613
|
+
* Humation Public API v1
|
|
614
|
+
* Public API for rendering Humation SVG assets.
|
|
615
|
+
* OpenAPI spec version: 0.1.0
|
|
616
|
+
*/
|
|
617
|
+
type ListTemplates200TemplatesItemAuthor = {
|
|
618
|
+
name: string;
|
|
619
|
+
url?: string;
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Generated by orval v8.13.0 🍺
|
|
624
|
+
* Do not edit manually.
|
|
625
|
+
* Humation Public API v1
|
|
626
|
+
* Public API for rendering Humation SVG assets.
|
|
627
|
+
* OpenAPI spec version: 0.1.0
|
|
628
|
+
*/
|
|
629
|
+
|
|
630
|
+
type ListTemplates200TemplatesItem = {
|
|
631
|
+
id: string;
|
|
632
|
+
name: string;
|
|
633
|
+
author: ListTemplates200TemplatesItemAuthor;
|
|
634
|
+
templateUrl: string;
|
|
635
|
+
assetsUrl: string;
|
|
636
|
+
renderSvgUrl: string;
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Generated by orval v8.13.0 🍺
|
|
641
|
+
* Do not edit manually.
|
|
642
|
+
* Humation Public API v1
|
|
643
|
+
* Public API for rendering Humation SVG assets.
|
|
644
|
+
* OpenAPI spec version: 0.1.0
|
|
645
|
+
*/
|
|
646
|
+
|
|
647
|
+
type ListTemplates200 = {
|
|
648
|
+
templates: ListTemplates200TemplatesItem[];
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Generated by orval v8.13.0 🍺
|
|
653
|
+
* Do not edit manually.
|
|
654
|
+
* Humation Public API v1
|
|
655
|
+
* Public API for rendering Humation SVG assets.
|
|
656
|
+
* OpenAPI spec version: 0.1.0
|
|
657
|
+
*/
|
|
658
|
+
|
|
659
|
+
declare const getGetHealthUrl: () => string;
|
|
660
|
+
/**
|
|
661
|
+
* @summary Check API availability
|
|
662
|
+
*/
|
|
663
|
+
declare const getHealth: (options?: RequestInit) => Promise<GetHealth200>;
|
|
664
|
+
declare const getListTemplatesUrl: () => string;
|
|
665
|
+
/**
|
|
666
|
+
* @summary List published templates
|
|
667
|
+
*/
|
|
668
|
+
declare const listTemplates: (options?: RequestInit) => Promise<ListTemplates200>;
|
|
669
|
+
declare const getGetTemplateUrl: (templateId: string) => string;
|
|
670
|
+
/**
|
|
671
|
+
* @summary Get a published template
|
|
672
|
+
*/
|
|
673
|
+
declare const getTemplate: (templateId: string, options?: RequestInit) => Promise<GetTemplate200>;
|
|
674
|
+
declare const getGetTemplateAssetsUrl: (templateId: string) => string;
|
|
675
|
+
/**
|
|
676
|
+
* @summary Get template assets
|
|
677
|
+
*/
|
|
678
|
+
declare const getTemplateAssets: (templateId: string, options?: RequestInit) => Promise<GetTemplateAssets200>;
|
|
679
|
+
declare const getRenderTemplateSvgUrl: (templateId: string) => string;
|
|
680
|
+
/**
|
|
681
|
+
* @summary Render a customized SVG avatar
|
|
682
|
+
*/
|
|
683
|
+
declare const renderTemplateSvg: (templateId: string, options?: RequestInit) => Promise<Blob>;
|
|
684
|
+
|
|
685
|
+
declare const api_getGetHealthUrl: typeof getGetHealthUrl;
|
|
686
|
+
declare const api_getGetTemplateAssetsUrl: typeof getGetTemplateAssetsUrl;
|
|
687
|
+
declare const api_getGetTemplateUrl: typeof getGetTemplateUrl;
|
|
688
|
+
declare const api_getHealth: typeof getHealth;
|
|
689
|
+
declare const api_getListTemplatesUrl: typeof getListTemplatesUrl;
|
|
690
|
+
declare const api_getRenderTemplateSvgUrl: typeof getRenderTemplateSvgUrl;
|
|
691
|
+
declare const api_getTemplate: typeof getTemplate;
|
|
692
|
+
declare const api_getTemplateAssets: typeof getTemplateAssets;
|
|
693
|
+
declare const api_listTemplates: typeof listTemplates;
|
|
694
|
+
declare const api_renderTemplateSvg: typeof renderTemplateSvg;
|
|
695
|
+
declare namespace api {
|
|
696
|
+
export { api_getGetHealthUrl as getGetHealthUrl, api_getGetTemplateAssetsUrl as getGetTemplateAssetsUrl, api_getGetTemplateUrl as getGetTemplateUrl, api_getHealth as getHealth, api_getListTemplatesUrl as getListTemplatesUrl, api_getRenderTemplateSvgUrl as getRenderTemplateSvgUrl, api_getTemplate as getTemplate, api_getTemplateAssets as getTemplateAssets, api_listTemplates as listTemplates, api_renderTemplateSvg as renderTemplateSvg };
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
export { type AvatarAsset, type AvatarAssetsResponse, AvatarSession, type AvatarState, type AvatarTemplate, type Background, type CropId, type HexColor, HumationApiError, HumationClient, type HumationClientOptions, type LoadAvatarOptions, type TemplateColorOption, type TemplateCropOption, type TemplateGroup, type TemplatePart, type TemplateSummary, createHumationClient, api as raw };
|