bannerify-js 0.0.27 → 0.0.29

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/dist/index.d.cts CHANGED
@@ -1,280 +1,823 @@
1
- import { ChartData } from 'chart.js';
2
-
3
- type Modification = {
4
- name: string;
5
- /**
6
- * color
7
- * @example #FF0000
8
- * @default The default color of the layer
9
- * @description The color for the modification, accept any valid CSS color value, for example: #FF0000, red, rgba(0,0,0,0.5), etc. You can only modify the color of the text layer with this field.
10
- */
11
- color?: string;
12
- /**
13
- * star
14
- * @example 5
15
- * @default The default star of the layer
16
- * @description The star for the modification, accept range 1-5, for example: 5, 4, 3, 2, 1.
17
- */
18
- star?: number;
19
- /**
20
- * background color
21
- * @example #FF0000
22
- * @default The default background color of the layer
23
- * @description The background color for the modification, accept any valid CSS color value, for example: #FF0000, red, rgba(0,0,0,0.5), etc.
24
- */
25
- background?: string;
26
- /**
27
- * font size
28
- * @example 12
29
- * @default The default font size of the layer
30
- * @description The font size for the modification, accept any valid CSS font size value, for example: 12, 12px;
31
- */
32
- size?: number;
33
- /**
34
- * source image
35
- * @example https://example.com/image.jpg
36
- * @default The default source image of the layer
37
- * @description The source image for the modification, accept any valid image URL, for example: https://example.com/image.jpg
38
- */
39
- src?: string;
40
- /**
41
- * chart data
42
- * @example { labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], datasets: [{ label: 'My First Dataset', data: [65, 59, 80, 81, 56, 55, 40], fill: false, borderColor: 'rgb(75, 192, 192)', tension: 0.1 }] }
43
- * @default The default chart data of the layer
44
- * @description Update chart layer's data, follow chart.js data structure
45
- */
46
- chart?: ChartData;
47
- /**
48
- * text content
49
- * @example Hello World
50
- * @default The default text content of the layer
51
- * @description You can modify the text layer with this field
52
- */
53
- text?: string;
54
- /**
55
- * barcode content
56
- * @example 1234567890
57
- * @default The default barcode content of the layer
58
- * @description Modify the barcode layer content with this field
59
- */
60
- qrcode?: string;
61
- /**
62
- * qrcode content
63
- * @example Some text
64
- * @default The default qrcode content of the layer
65
- * @description Modify the qrcode layer content with this field
66
- */
67
- barcode?: string;
68
- /**
69
- * icon name
70
- * @example Menu
71
- * @default The default icon name of the layer
72
- * @description Modify the icon name with this field
73
- */
74
- icon?: string;
75
- /**
76
- * visibility
77
- * @example true
78
- * @default The default visibility of the layer
79
- * @description Set the visibility of the field
80
- */
81
- visible?: boolean;
82
- };
83
-
84
1
  /**
85
2
  * This file was auto-generated by openapi-typescript.
86
3
  * Do not make direct changes to the file.
87
4
  */
88
5
 
89
-
90
6
  interface paths {
91
- "/v1/liveness": {
7
+ "/v1/templates/createImage": {
8
+ /** @description Create an image from a template */
9
+ post: {
10
+ requestBody: {
11
+ content: {
12
+ "application/json": {
13
+ /**
14
+ * @default png
15
+ * @enum {string}
16
+ */
17
+ format?: "png" | "jpeg" | "webp"
18
+ /** @description Only for debug purpose, it draws bounding box for each layer */
19
+ _debug?: boolean | string
20
+ /** @description Optional custom S3 configuration. If provided, the generated file will be stored in your S3-compatible storage instead of the default Bannerify storage. */
21
+ s3Config?: {
22
+ /**
23
+ * @description S3 endpoint URL (without protocol)
24
+ * @example s3.amazonaws.com
25
+ */
26
+ endPoint: string
27
+ /**
28
+ * @description S3 endpoint port
29
+ * @default 443
30
+ * @example 443
31
+ */
32
+ port?: number
33
+ /**
34
+ * @description Whether to use SSL/TLS
35
+ * @default true
36
+ * @example true
37
+ */
38
+ useSSL?: boolean
39
+ /**
40
+ * @description S3 region
41
+ * @example us-east-1
42
+ */
43
+ region: string
44
+ /**
45
+ * @description S3 bucket name
46
+ * @example my-images-bucket
47
+ */
48
+ bucket: string
49
+ /**
50
+ * @description Whether to use path-style URLs
51
+ * @default false
52
+ * @example false
53
+ */
54
+ pathStyle?: boolean
55
+ /** @description S3 access key */
56
+ accessKey: string
57
+ /** @description S3 secret key */
58
+ secretKey: string
59
+ /**
60
+ * @description Custom URL template for accessing uploaded files. Use {key} as placeholder for the file key.
61
+ * @example https://cdn.example.com/{key}
62
+ */
63
+ customUrl?: string
64
+ }
65
+ apiKey: string
66
+ /**
67
+ * @description Your template id
68
+ * @example tpl_xxxxxxxxx
69
+ */
70
+ templateId: string
71
+ /**
72
+ * @description Template modifications as the API array format, an object shorthand, or a JSON string. Object values map to text by default, while nested objects keep fields such as src, qrcode, rows, or columns.
73
+ * @default []
74
+ * @example {
75
+ * "headline": "Summer sale",
76
+ * "photo": {
77
+ * "src": "https://example.com/photo.png"
78
+ * }
79
+ * }
80
+ */
81
+ modifications?: unknown
82
+ /**
83
+ * @description Generate thumbnail preview (non-billable)
84
+ * @default false
85
+ */
86
+ thumbnail?: boolean | string
87
+ }
88
+ }
89
+ }
90
+ responses: {
91
+ /** @description A image file */
92
+ 200: {
93
+ content: {
94
+ "image/png": string
95
+ }
96
+ }
97
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
98
+ 400: {
99
+ content: {
100
+ "application/json":
101
+ | components["schemas"]["ErrBadRequest"]
102
+ | components["schemas"]["ErrFetchImageError"]
103
+ }
104
+ }
105
+ /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
106
+ 401: {
107
+ content: {
108
+ "application/json": components["schemas"]["ErrUnauthorized"]
109
+ }
110
+ }
111
+ /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
112
+ 403: {
113
+ content: {
114
+ "application/json": components["schemas"]["ErrForbidden"]
115
+ }
116
+ }
117
+ /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
118
+ 404: {
119
+ content: {
120
+ "application/json": components["schemas"]["ErrNotFound"]
121
+ }
122
+ }
123
+ /** @description This response is sent when a request conflicts with the current state of the server. */
124
+ 409: {
125
+ content: {
126
+ "application/json": components["schemas"]["ErrConflict"]
127
+ }
128
+ }
129
+ /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
130
+ 429: {
131
+ content: {
132
+ "application/json": components["schemas"]["ErrTooManyRequests"]
133
+ }
134
+ }
135
+ /** @description The server has encountered a situation it does not know how to handle. */
136
+ 500: {
137
+ content: {
138
+ "application/json": components["schemas"]["ErrInternalServerError"]
139
+ }
140
+ }
141
+ }
142
+ }
143
+ }
144
+ "/v1/templates/createPdf": {
145
+ post: {
146
+ requestBody: {
147
+ content: {
148
+ "application/json": {
149
+ apiKey: string
150
+ /**
151
+ * @description Your template ID
152
+ * @example tpl_xxx
153
+ */
154
+ templateId: string
155
+ /**
156
+ * @description Template modifications as the API array format, an object shorthand, or a JSON string. Object values map to text by default, while nested objects keep fields such as src, qrcode, rows, or columns.
157
+ * @default []
158
+ * @example {
159
+ * "headline": "Summer sale",
160
+ * "photo": {
161
+ * "src": "https://example.com/photo.png"
162
+ * }
163
+ * }
164
+ */
165
+ modifications?: unknown
166
+ }
167
+ }
168
+ }
169
+ responses: {
170
+ /** @description Success create pdf */
171
+ 200: {
172
+ content: {
173
+ "application/pdf": string
174
+ }
175
+ }
176
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
177
+ 400: {
178
+ content: {
179
+ "application/json":
180
+ | components["schemas"]["ErrBadRequest"]
181
+ | components["schemas"]["ErrFetchImageError"]
182
+ }
183
+ }
184
+ /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
185
+ 401: {
186
+ content: {
187
+ "application/json": components["schemas"]["ErrUnauthorized"]
188
+ }
189
+ }
190
+ /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
191
+ 403: {
192
+ content: {
193
+ "application/json": components["schemas"]["ErrForbidden"]
194
+ }
195
+ }
196
+ /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
197
+ 404: {
198
+ content: {
199
+ "application/json": components["schemas"]["ErrNotFound"]
200
+ }
201
+ }
202
+ /** @description This response is sent when a request conflicts with the current state of the server. */
203
+ 409: {
204
+ content: {
205
+ "application/json": components["schemas"]["ErrConflict"]
206
+ }
207
+ }
208
+ /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
209
+ 429: {
210
+ content: {
211
+ "application/json": components["schemas"]["ErrTooManyRequests"]
212
+ }
213
+ }
214
+ /** @description The server has encountered a situation it does not know how to handle. */
215
+ 500: {
216
+ content: {
217
+ "application/json": components["schemas"]["ErrInternalServerError"]
218
+ }
219
+ }
220
+ }
221
+ }
222
+ }
223
+ "/v1/templates/signedurl": {
224
+ /** @description Generate a signed URL for a template */
92
225
  get: {
226
+ parameters: {
227
+ query: {
228
+ format?: "png" | "jpeg" | "webp"
229
+ /** @description By default, we cache the image in the CDN for 1 day to save your bandwidth, use this field to disable cache so you can get the latest image */
230
+ nocache?: boolean | string
231
+ /** @description Only for debug purpose, it draws bounding box for each layer */
232
+ _debug?: boolean | string
233
+ /** @description Optional custom S3 configuration. If provided, the generated file will be stored in your S3-compatible storage instead of the default Bannerify storage. */
234
+ s3Config?: {
235
+ /**
236
+ * @description S3 endpoint URL (without protocol)
237
+ * @example s3.amazonaws.com
238
+ */
239
+ endPoint: string
240
+ /**
241
+ * @description S3 endpoint port
242
+ * @default 443
243
+ * @example 443
244
+ */
245
+ port?: number
246
+ /**
247
+ * @description Whether to use SSL/TLS
248
+ * @default true
249
+ * @example true
250
+ */
251
+ useSSL?: boolean
252
+ /**
253
+ * @description S3 region
254
+ * @example us-east-1
255
+ */
256
+ region: string
257
+ /**
258
+ * @description S3 bucket name
259
+ * @example my-images-bucket
260
+ */
261
+ bucket: string
262
+ /**
263
+ * @description Whether to use path-style URLs
264
+ * @default false
265
+ * @example false
266
+ */
267
+ pathStyle?: boolean
268
+ /** @description S3 access key */
269
+ accessKey: string
270
+ /** @description S3 secret key */
271
+ secretKey: string
272
+ /**
273
+ * @description Custom URL template for accessing uploaded files. Use {key} as placeholder for the file key.
274
+ * @example https://cdn.example.com/{key}
275
+ */
276
+ customUrl?: string
277
+ }
278
+ /** @description Your template id */
279
+ templateId: string
280
+ /** @description Deprecated alias of apiKeyHashed */
281
+ apiKeyMd5?: string
282
+ /** @description SHA-256 hash of the API key, it identifies which key signed the URL */
283
+ apiKeyHashed?: string
284
+ /** @description HMAC-SHA256 of the sorted query params, keyed with the API key, read more at https://bannerify.co/docs/api-reference/endpoint/signed-url */
285
+ sign: string
286
+ /** @description Template modifications as the API array format, an object shorthand, or a JSON string. Object values map to text by default, while nested objects keep fields such as src, qrcode, rows, or columns. */
287
+ modifications?: unknown
288
+ /** @description Generate thumbnail preview (low-quality, non-billable) */
289
+ thumbnail?: boolean | string
290
+ }
291
+ }
292
+ responses: {
293
+ /** @description A image file */
294
+ 200: {
295
+ content: {
296
+ "image/png": string
297
+ "image/jpeg": string
298
+ "image/webp": string
299
+ }
300
+ }
301
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
302
+ 400: {
303
+ content: {
304
+ "application/json":
305
+ | components["schemas"]["ErrBadRequest"]
306
+ | components["schemas"]["ErrFetchImageError"]
307
+ }
308
+ }
309
+ /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
310
+ 401: {
311
+ content: {
312
+ "application/json": components["schemas"]["ErrUnauthorized"]
313
+ }
314
+ }
315
+ /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
316
+ 403: {
317
+ content: {
318
+ "application/json": components["schemas"]["ErrForbidden"]
319
+ }
320
+ }
321
+ /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
322
+ 404: {
323
+ content: {
324
+ "application/json": components["schemas"]["ErrNotFound"]
325
+ }
326
+ }
327
+ /** @description This response is sent when a request conflicts with the current state of the server. */
328
+ 409: {
329
+ content: {
330
+ "application/json": components["schemas"]["ErrConflict"]
331
+ }
332
+ }
333
+ /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
334
+ 429: {
335
+ content: {
336
+ "application/json": components["schemas"]["ErrTooManyRequests"]
337
+ }
338
+ }
339
+ /** @description The server has encountered a situation it does not know how to handle. */
340
+ 500: {
341
+ content: {
342
+ "application/json": components["schemas"]["ErrInternalServerError"]
343
+ }
344
+ }
345
+ }
346
+ }
347
+ }
348
+ "/v1/info": {
349
+ /** @description Get project info */
350
+ get: {
351
+ parameters: {
352
+ query: {
353
+ /** @description The api key to use for this request */
354
+ apiKey: string
355
+ }
356
+ }
93
357
  responses: {
94
- /** @description The configured services and their status */
358
+ /** @description Project info */
95
359
  200: {
96
360
  content: {
97
361
  "application/json": {
98
- /** @description The status of the server */
99
- status: string;
100
- };
101
- };
102
- };
362
+ id: string
363
+ name: string
364
+ createdAt: string
365
+ }
366
+ }
367
+ }
103
368
  /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
104
369
  400: {
105
370
  content: {
106
- "application/json": components["schemas"]["ErrBadRequest"];
107
- };
108
- };
371
+ "application/json":
372
+ | components["schemas"]["ErrBadRequest"]
373
+ | components["schemas"]["ErrFetchImageError"]
374
+ }
375
+ }
109
376
  /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
110
377
  401: {
111
378
  content: {
112
- "application/json": components["schemas"]["ErrUnauthorized"];
113
- };
114
- };
379
+ "application/json": components["schemas"]["ErrUnauthorized"]
380
+ }
381
+ }
115
382
  /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
116
383
  403: {
117
384
  content: {
118
- "application/json": components["schemas"]["ErrForbidden"];
119
- };
120
- };
385
+ "application/json": components["schemas"]["ErrForbidden"]
386
+ }
387
+ }
121
388
  /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
122
389
  404: {
123
390
  content: {
124
- "application/json": components["schemas"]["ErrNotFound"];
125
- };
126
- };
391
+ "application/json": components["schemas"]["ErrNotFound"]
392
+ }
393
+ }
127
394
  /** @description This response is sent when a request conflicts with the current state of the server. */
128
395
  409: {
129
396
  content: {
130
- "application/json": components["schemas"]["ErrConflict"];
131
- };
132
- };
397
+ "application/json": components["schemas"]["ErrConflict"]
398
+ }
399
+ }
133
400
  /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
134
401
  429: {
135
402
  content: {
136
- "application/json": components["schemas"]["ErrTooManyRequests"];
137
- };
138
- };
403
+ "application/json": components["schemas"]["ErrTooManyRequests"]
404
+ }
405
+ }
139
406
  /** @description The server has encountered a situation it does not know how to handle. */
140
407
  500: {
141
408
  content: {
142
- "application/json": components["schemas"]["ErrInternalServerError"];
143
- };
144
- };
145
- };
146
- };
147
- };
148
- "/v1/templates/createImage": {
409
+ "application/json": components["schemas"]["ErrInternalServerError"]
410
+ }
411
+ }
412
+ }
413
+ }
414
+ }
415
+ "/v1/templates": {
416
+ /** @description List templates */
149
417
  get: {
150
418
  parameters: {
151
419
  query: {
152
- modifications?: string;
153
- format?: "png" | "svg";
154
- nocache?: string;
155
- _debug?: string;
156
- apiKey: string;
157
- templateId: string;
158
- };
159
- };
420
+ /** @description The api key to use for this request */
421
+ apiKey: string
422
+ /** @description Whether to include layers in the response */
423
+ includeLayers?: boolean | string
424
+ }
425
+ }
160
426
  responses: {
161
- /** @description A image file */
427
+ /** @description A list of templates */
162
428
  200: {
163
429
  content: {
164
- "image/png": unknown;
165
- "image/svg+xml": string;
166
- };
167
- };
430
+ "application/json": unknown[]
431
+ }
432
+ }
168
433
  /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
169
434
  400: {
170
435
  content: {
171
- "application/json": components["schemas"]["ErrBadRequest"];
172
- };
173
- };
436
+ "application/json":
437
+ | components["schemas"]["ErrBadRequest"]
438
+ | components["schemas"]["ErrFetchImageError"]
439
+ }
440
+ }
174
441
  /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
175
442
  401: {
176
443
  content: {
177
- "application/json": components["schemas"]["ErrUnauthorized"];
178
- };
179
- };
444
+ "application/json": components["schemas"]["ErrUnauthorized"]
445
+ }
446
+ }
180
447
  /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
181
448
  403: {
182
449
  content: {
183
- "application/json": components["schemas"]["ErrForbidden"];
184
- };
185
- };
450
+ "application/json": components["schemas"]["ErrForbidden"]
451
+ }
452
+ }
186
453
  /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
187
454
  404: {
188
455
  content: {
189
- "application/json": components["schemas"]["ErrNotFound"];
190
- };
191
- };
456
+ "application/json": components["schemas"]["ErrNotFound"]
457
+ }
458
+ }
192
459
  /** @description This response is sent when a request conflicts with the current state of the server. */
193
460
  409: {
194
461
  content: {
195
- "application/json": components["schemas"]["ErrConflict"];
196
- };
197
- };
462
+ "application/json": components["schemas"]["ErrConflict"]
463
+ }
464
+ }
198
465
  /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
199
466
  429: {
200
467
  content: {
201
- "application/json": components["schemas"]["ErrTooManyRequests"];
202
- };
203
- };
468
+ "application/json": components["schemas"]["ErrTooManyRequests"]
469
+ }
470
+ }
204
471
  /** @description The server has encountered a situation it does not know how to handle. */
205
472
  500: {
206
473
  content: {
207
- "application/json": components["schemas"]["ErrInternalServerError"];
208
- };
209
- };
210
- };
211
- };
212
- };
213
- "/v1/templates/imageSignedUrl": {
474
+ "application/json": components["schemas"]["ErrInternalServerError"]
475
+ }
476
+ }
477
+ }
478
+ }
479
+ }
480
+ "/v1/templates/:id": {
481
+ /** @description Template details */
214
482
  get: {
215
483
  parameters: {
216
484
  query: {
217
- modifications?: string;
218
- format?: "png" | "svg";
219
- nocache?: string;
220
- _debug?: string;
221
- templateId: string;
222
- apiKeyMd5: string;
223
- sign: string;
224
- };
225
- };
485
+ /** @description The api key to use for this request */
486
+ apiKey: string
487
+ }
488
+ }
226
489
  responses: {
227
- /** @description A image file */
490
+ /** @description Template details */
228
491
  200: {
229
492
  content: {
230
- "image/png": unknown;
231
- };
232
- };
493
+ "application/json": {
494
+ /** @description The name of the template */
495
+ name: string
496
+ /** @description The id of the template */
497
+ id: string
498
+ /** @description The layers of the template */
499
+ layers: {
500
+ /** @description The name of the layer */
501
+ name: string
502
+ /** @description The id of the layer */
503
+ id: string
504
+ /** @description The type of the layer */
505
+ type: string
506
+ /** @description The suggest input of the layer */
507
+ suggestInput: string | null
508
+ }[]
509
+ }
510
+ }
511
+ }
233
512
  /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
234
513
  400: {
235
514
  content: {
236
- "application/json": components["schemas"]["ErrBadRequest"];
237
- };
238
- };
515
+ "application/json":
516
+ | components["schemas"]["ErrBadRequest"]
517
+ | components["schemas"]["ErrFetchImageError"]
518
+ }
519
+ }
239
520
  /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
240
521
  401: {
241
522
  content: {
242
- "application/json": components["schemas"]["ErrUnauthorized"];
243
- };
244
- };
523
+ "application/json": components["schemas"]["ErrUnauthorized"]
524
+ }
525
+ }
245
526
  /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
246
527
  403: {
247
528
  content: {
248
- "application/json": components["schemas"]["ErrForbidden"];
249
- };
250
- };
529
+ "application/json": components["schemas"]["ErrForbidden"]
530
+ }
531
+ }
251
532
  /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
252
533
  404: {
253
534
  content: {
254
- "application/json": components["schemas"]["ErrNotFound"];
255
- };
256
- };
535
+ "application/json": components["schemas"]["ErrNotFound"]
536
+ }
537
+ }
257
538
  /** @description This response is sent when a request conflicts with the current state of the server. */
258
539
  409: {
259
540
  content: {
260
- "application/json": components["schemas"]["ErrConflict"];
261
- };
262
- };
541
+ "application/json": components["schemas"]["ErrConflict"]
542
+ }
543
+ }
263
544
  /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
264
545
  429: {
265
546
  content: {
266
- "application/json": components["schemas"]["ErrTooManyRequests"];
267
- };
268
- };
547
+ "application/json": components["schemas"]["ErrTooManyRequests"]
548
+ }
549
+ }
269
550
  /** @description The server has encountered a situation it does not know how to handle. */
270
551
  500: {
271
552
  content: {
272
- "application/json": components["schemas"]["ErrInternalServerError"];
273
- };
274
- };
275
- };
276
- };
277
- };
553
+ "application/json": components["schemas"]["ErrInternalServerError"]
554
+ }
555
+ }
556
+ }
557
+ }
558
+ }
559
+ "/v1/templates/createStoredImage": {
560
+ /** @description Create an image from a template */
561
+ post: {
562
+ requestBody: {
563
+ content: {
564
+ "application/json": {
565
+ /**
566
+ * @default png
567
+ * @enum {string}
568
+ */
569
+ format?: "png" | "jpeg" | "webp"
570
+ /** @description Only for debug purpose, it draws bounding box for each layer */
571
+ _debug?: boolean | string
572
+ /** @description Optional custom S3 configuration. If provided, the generated file will be stored in your S3-compatible storage instead of the default Bannerify storage. */
573
+ s3Config?: {
574
+ /**
575
+ * @description S3 endpoint URL (without protocol)
576
+ * @example s3.amazonaws.com
577
+ */
578
+ endPoint: string
579
+ /**
580
+ * @description S3 endpoint port
581
+ * @default 443
582
+ * @example 443
583
+ */
584
+ port?: number
585
+ /**
586
+ * @description Whether to use SSL/TLS
587
+ * @default true
588
+ * @example true
589
+ */
590
+ useSSL?: boolean
591
+ /**
592
+ * @description S3 region
593
+ * @example us-east-1
594
+ */
595
+ region: string
596
+ /**
597
+ * @description S3 bucket name
598
+ * @example my-images-bucket
599
+ */
600
+ bucket: string
601
+ /**
602
+ * @description Whether to use path-style URLs
603
+ * @default false
604
+ * @example false
605
+ */
606
+ pathStyle?: boolean
607
+ /** @description S3 access key */
608
+ accessKey: string
609
+ /** @description S3 secret key */
610
+ secretKey: string
611
+ /**
612
+ * @description Custom URL template for accessing uploaded files. Use {key} as placeholder for the file key.
613
+ * @example https://cdn.example.com/{key}
614
+ */
615
+ customUrl?: string
616
+ }
617
+ apiKey: string
618
+ /**
619
+ * @description Your template id
620
+ * @example tpl_xxxxxxxxx
621
+ */
622
+ templateId: string
623
+ /**
624
+ * @description Template modifications as the API array format, an object shorthand, or a JSON string. Object values map to text by default, while nested objects keep fields such as src, qrcode, rows, or columns.
625
+ * @default []
626
+ * @example {
627
+ * "headline": "Summer sale",
628
+ * "photo": {
629
+ * "src": "https://example.com/photo.png"
630
+ * }
631
+ * }
632
+ */
633
+ modifications?: unknown
634
+ }
635
+ }
636
+ }
637
+ responses: {
638
+ /** @description Image object */
639
+ 200: {
640
+ content: {
641
+ "application/json": {
642
+ url: string
643
+ }
644
+ }
645
+ }
646
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
647
+ 400: {
648
+ content: {
649
+ "application/json":
650
+ | components["schemas"]["ErrBadRequest"]
651
+ | components["schemas"]["ErrFetchImageError"]
652
+ }
653
+ }
654
+ /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
655
+ 401: {
656
+ content: {
657
+ "application/json": components["schemas"]["ErrUnauthorized"]
658
+ }
659
+ }
660
+ /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
661
+ 403: {
662
+ content: {
663
+ "application/json": components["schemas"]["ErrForbidden"]
664
+ }
665
+ }
666
+ /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
667
+ 404: {
668
+ content: {
669
+ "application/json": components["schemas"]["ErrNotFound"]
670
+ }
671
+ }
672
+ /** @description This response is sent when a request conflicts with the current state of the server. */
673
+ 409: {
674
+ content: {
675
+ "application/json": components["schemas"]["ErrConflict"]
676
+ }
677
+ }
678
+ /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
679
+ 429: {
680
+ content: {
681
+ "application/json": components["schemas"]["ErrTooManyRequests"]
682
+ }
683
+ }
684
+ /** @description The server has encountered a situation it does not know how to handle. */
685
+ 500: {
686
+ content: {
687
+ "application/json": components["schemas"]["ErrInternalServerError"]
688
+ }
689
+ }
690
+ }
691
+ }
692
+ }
693
+ "/v1/templates/createStoredPdf": {
694
+ /** @description Create a PDF from a template and store it in Bannerify storage */
695
+ post: {
696
+ requestBody: {
697
+ content: {
698
+ "application/json": {
699
+ apiKey: string
700
+ /**
701
+ * @description Your template id
702
+ * @example tpl_xxxxxxxxx
703
+ */
704
+ templateId: string
705
+ /**
706
+ * @description Template modifications as the API array format, an object shorthand, or a JSON string. Object values map to text by default, while nested objects keep fields such as src, qrcode, rows, or columns.
707
+ * @default []
708
+ * @example {
709
+ * "headline": "Summer sale",
710
+ * "photo": {
711
+ * "src": "https://example.com/photo.png"
712
+ * }
713
+ * }
714
+ */
715
+ modifications?: unknown
716
+ /** @description Custom S3 configuration for storing generated files in your own S3-compatible storage */
717
+ s3Config?: {
718
+ /**
719
+ * @description S3 endpoint URL (without protocol)
720
+ * @example s3.amazonaws.com
721
+ */
722
+ endPoint: string
723
+ /**
724
+ * @description S3 endpoint port
725
+ * @default 443
726
+ * @example 443
727
+ */
728
+ port?: number
729
+ /**
730
+ * @description Whether to use SSL/TLS
731
+ * @default true
732
+ * @example true
733
+ */
734
+ useSSL?: boolean
735
+ /**
736
+ * @description S3 region
737
+ * @example us-east-1
738
+ */
739
+ region: string
740
+ /**
741
+ * @description S3 bucket name
742
+ * @example my-images-bucket
743
+ */
744
+ bucket: string
745
+ /**
746
+ * @description Whether to use path-style URLs
747
+ * @default false
748
+ * @example false
749
+ */
750
+ pathStyle?: boolean
751
+ /** @description S3 access key */
752
+ accessKey: string
753
+ /** @description S3 secret key */
754
+ secretKey: string
755
+ /**
756
+ * @description Custom URL template for accessing uploaded files. Use {key} as placeholder for the file key.
757
+ * @example https://cdn.example.com/{key}
758
+ */
759
+ customUrl?: string
760
+ }
761
+ }
762
+ }
763
+ }
764
+ responses: {
765
+ /** @description Stored PDF object */
766
+ 200: {
767
+ content: {
768
+ "application/json": {
769
+ /** @description Public URL of the generated PDF */
770
+ url: string
771
+ }
772
+ }
773
+ }
774
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
775
+ 400: {
776
+ content: {
777
+ "application/json":
778
+ | components["schemas"]["ErrBadRequest"]
779
+ | components["schemas"]["ErrFetchImageError"]
780
+ }
781
+ }
782
+ /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
783
+ 401: {
784
+ content: {
785
+ "application/json": components["schemas"]["ErrUnauthorized"]
786
+ }
787
+ }
788
+ /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
789
+ 403: {
790
+ content: {
791
+ "application/json": components["schemas"]["ErrForbidden"]
792
+ }
793
+ }
794
+ /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
795
+ 404: {
796
+ content: {
797
+ "application/json": components["schemas"]["ErrNotFound"]
798
+ }
799
+ }
800
+ /** @description This response is sent when a request conflicts with the current state of the server. */
801
+ 409: {
802
+ content: {
803
+ "application/json": components["schemas"]["ErrConflict"]
804
+ }
805
+ }
806
+ /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
807
+ 429: {
808
+ content: {
809
+ "application/json": components["schemas"]["ErrTooManyRequests"]
810
+ }
811
+ }
812
+ /** @description The server has encountered a situation it does not know how to handle. */
813
+ 500: {
814
+ content: {
815
+ "application/json": components["schemas"]["ErrInternalServerError"]
816
+ }
817
+ }
818
+ }
819
+ }
820
+ }
278
821
  }
279
822
 
280
823
  interface components {
@@ -286,21 +829,43 @@ interface components {
286
829
  * @example BAD_REQUEST
287
830
  * @enum {string}
288
831
  */
289
- code: "BAD_REQUEST";
832
+ code: "BAD_REQUEST"
290
833
  /**
291
834
  * @description A link to our documentation with more details about this error code
292
835
  * @example https://bannerify.co/docs/api-reference/errors/code/BAD_REQUEST
293
836
  */
294
- docs: string;
837
+ docs: string
295
838
  /** @description A human readable explanation of what went wrong */
296
- message: string;
839
+ message: string
297
840
  /**
298
841
  * @description Please always include the requestId in your error report
299
842
  * @example req:1234
300
843
  */
301
- requestId: string;
302
- };
303
- };
844
+ requestId: string
845
+ }
846
+ }
847
+ ErrFetchImageError: {
848
+ error: {
849
+ /**
850
+ * @description A machine readable error code.
851
+ * @example FETCH_IMAGE_ERROR
852
+ * @enum {string}
853
+ */
854
+ code: "FETCH_IMAGE_ERROR"
855
+ /**
856
+ * @description A link to our documentation with more details about this error code
857
+ * @example https://bannerify.co/docs/api-reference/errors/code/FETCH_IMAGE_ERROR
858
+ */
859
+ docs: string
860
+ /** @description A human readable explanation of what went wrong */
861
+ message: string
862
+ /**
863
+ * @description Please always include the requestId in your error report
864
+ * @example req:1234
865
+ */
866
+ requestId: string
867
+ }
868
+ }
304
869
  ErrUnauthorized: {
305
870
  error: {
306
871
  /**
@@ -308,21 +873,21 @@ interface components {
308
873
  * @example UNAUTHORIZED
309
874
  * @enum {string}
310
875
  */
311
- code: "UNAUTHORIZED";
876
+ code: "UNAUTHORIZED"
312
877
  /**
313
878
  * @description A link to our documentation with more details about this error code
314
879
  * @example https://bannerify.co/docs/api-reference/errors/code/UNAUTHORIZED
315
880
  */
316
- docs: string;
881
+ docs: string
317
882
  /** @description A human readable explanation of what went wrong */
318
- message: string;
883
+ message: string
319
884
  /**
320
885
  * @description Please always include the requestId in your error report
321
886
  * @example req:1234
322
887
  */
323
- requestId: string;
324
- };
325
- };
888
+ requestId: string
889
+ }
890
+ }
326
891
  ErrForbidden: {
327
892
  error: {
328
893
  /**
@@ -330,21 +895,21 @@ interface components {
330
895
  * @example FORBIDDEN
331
896
  * @enum {string}
332
897
  */
333
- code: "FORBIDDEN";
898
+ code: "FORBIDDEN"
334
899
  /**
335
900
  * @description A link to our documentation with more details about this error code
336
901
  * @example https://bannerify.co/docs/api-reference/errors/code/FORBIDDEN
337
902
  */
338
- docs: string;
903
+ docs: string
339
904
  /** @description A human readable explanation of what went wrong */
340
- message: string;
905
+ message: string
341
906
  /**
342
907
  * @description Please always include the requestId in your error report
343
908
  * @example req:1234
344
909
  */
345
- requestId: string;
346
- };
347
- };
910
+ requestId: string
911
+ }
912
+ }
348
913
  ErrNotFound: {
349
914
  error: {
350
915
  /**
@@ -352,21 +917,21 @@ interface components {
352
917
  * @example NOT_FOUND
353
918
  * @enum {string}
354
919
  */
355
- code: "NOT_FOUND";
920
+ code: "NOT_FOUND"
356
921
  /**
357
922
  * @description A link to our documentation with more details about this error code
358
923
  * @example https://bannerify.co/docs/api-reference/errors/code/NOT_FOUND
359
924
  */
360
- docs: string;
925
+ docs: string
361
926
  /** @description A human readable explanation of what went wrong */
362
- message: string;
927
+ message: string
363
928
  /**
364
929
  * @description Please always include the requestId in your error report
365
930
  * @example req:1234
366
931
  */
367
- requestId: string;
368
- };
369
- };
932
+ requestId: string
933
+ }
934
+ }
370
935
  ErrConflict: {
371
936
  error: {
372
937
  /**
@@ -374,21 +939,21 @@ interface components {
374
939
  * @example CONFLICT
375
940
  * @enum {string}
376
941
  */
377
- code: "CONFLICT";
942
+ code: "CONFLICT"
378
943
  /**
379
944
  * @description A link to our documentation with more details about this error code
380
945
  * @example https://bannerify.co/docs/api-reference/errors/code/CONFLICT
381
946
  */
382
- docs: string;
947
+ docs: string
383
948
  /** @description A human readable explanation of what went wrong */
384
- message: string;
949
+ message: string
385
950
  /**
386
951
  * @description Please always include the requestId in your error report
387
952
  * @example req:1234
388
953
  */
389
- requestId: string;
390
- };
391
- };
954
+ requestId: string
955
+ }
956
+ }
392
957
  ErrTooManyRequests: {
393
958
  error: {
394
959
  /**
@@ -396,21 +961,21 @@ interface components {
396
961
  * @example TOO_MANY_REQUESTS
397
962
  * @enum {string}
398
963
  */
399
- code: "TOO_MANY_REQUESTS";
964
+ code: "TOO_MANY_REQUESTS"
400
965
  /**
401
966
  * @description A link to our documentation with more details about this error code
402
967
  * @example https://bannerify.co/docs/api-reference/errors/code/TOO_MANY_REQUESTS
403
968
  */
404
- docs: string;
969
+ docs: string
405
970
  /** @description A human readable explanation of what went wrong */
406
- message: string;
971
+ message: string
407
972
  /**
408
973
  * @description Please always include the requestId in your error report
409
974
  * @example req:1234
410
975
  */
411
- requestId: string;
412
- };
413
- };
976
+ requestId: string
977
+ }
978
+ }
414
979
  ErrInternalServerError: {
415
980
  error: {
416
981
  /**
@@ -418,32 +983,219 @@ interface components {
418
983
  * @example INTERNAL_SERVER_ERROR
419
984
  * @enum {string}
420
985
  */
421
- code: "INTERNAL_SERVER_ERROR";
986
+ code: "INTERNAL_SERVER_ERROR"
422
987
  /**
423
988
  * @description A link to our documentation with more details about this error code
424
989
  * @example https://bannerify.co/docs/api-reference/errors/code/INTERNAL_SERVER_ERROR
425
990
  */
426
- docs: string;
991
+ docs: string
427
992
  /** @description A human readable explanation of what went wrong */
428
- message: string;
993
+ message: string
429
994
  /**
430
995
  * @description Please always include the requestId in your error report
431
996
  * @example req:1234
432
997
  */
433
- requestId: string;
434
- };
435
- };
436
- };
437
- responses: never;
438
- parameters: {
439
- };
440
- requestBodies: never;
441
- headers: never;
442
- pathItems: never;
998
+ requestId: string
999
+ }
1000
+ }
1001
+ /** @description A modification (aka override) to apply to the layer in image */
1002
+ Modification: {
1003
+ /**
1004
+ * @description The layer name of the modification
1005
+ * @example Text 1
1006
+ */
1007
+ name: string
1008
+ /**
1009
+ * @description The color for the modification
1010
+ * @example #FF0000
1011
+ */
1012
+ color?: string
1013
+ /**
1014
+ * @description The source image for the modification
1015
+ * @example https://example.com/image.jpg
1016
+ */
1017
+ src?: string
1018
+ /**
1019
+ * @description You can modify the text layer with this field
1020
+ * @example Hello World
1021
+ */
1022
+ text?: string
1023
+ /**
1024
+ * @description Modify the barcode layer content with this field
1025
+ * @example 1234567890
1026
+ */
1027
+ barcode?: string
1028
+ /**
1029
+ * @description Modify the qrcode layer content with this field
1030
+ * @example Some text
1031
+ */
1032
+ qrcode?: string
1033
+ /**
1034
+ * @description Set the visibility of the field
1035
+ * @example true
1036
+ */
1037
+ visible?: boolean
1038
+ /**
1039
+ * @description Star value
1040
+ * @example 5
1041
+ */
1042
+ star?: number
1043
+ /**
1044
+ * @description The rows of a data layer. A table takes row objects keyed by the column names, a chart takes { label, value } points, and a key value layer takes { key, value } entries.
1045
+ * @example [
1046
+ * {
1047
+ * "label": "Jan",
1048
+ * "value": 22
1049
+ * }
1050
+ * ]
1051
+ */
1052
+ rows?: unknown[]
1053
+ /**
1054
+ * @description The column names of a table layer
1055
+ * @example [
1056
+ * "Item",
1057
+ * "Qty",
1058
+ * "Total"
1059
+ * ]
1060
+ */
1061
+ columns?: string[]
1062
+ /**
1063
+ * @description The heading of an alert layer, or the job title of a signature layer
1064
+ * @example Payment terms
1065
+ */
1066
+ title?: string
1067
+ /**
1068
+ * @description The date of a signature layer
1069
+ * @example 2026-01-31
1070
+ */
1071
+ date?: string
1072
+ }
1073
+ }
1074
+ responses: never
1075
+ parameters: {}
1076
+ requestBodies: never
1077
+ headers: never
1078
+ pathItems: never
443
1079
  }
444
1080
 
445
- type codes = '400' | '401' | '403' | '404' | '500';
446
- type ErrorResponse = paths['/v1/liveness']['get']['responses'][codes]['content']['application/json'];
1081
+ type S3Config = {
1082
+ endPoint: string;
1083
+ port?: number;
1084
+ useSSL?: boolean;
1085
+ region: string;
1086
+ bucket: string;
1087
+ pathStyle?: boolean;
1088
+ accessKey: string;
1089
+ secretKey: string;
1090
+ customUrl?: string;
1091
+ };
1092
+ type Modification = components["schemas"]["Modification"] & {
1093
+ name: string;
1094
+ /**
1095
+ * color
1096
+ * @example #FF0000
1097
+ * @default The default color of the layer
1098
+ * @description The color for the modification, accept any valid CSS color value, for example: #FF0000, red, rgba(0,0,0,0.5), etc. You can only modify the color of the text layer with this field.
1099
+ */
1100
+ color?: string;
1101
+ /**
1102
+ * star
1103
+ * @example 5
1104
+ * @default The default star of the layer
1105
+ * @description The star for the modification, accept range 1-5, for example: 5, 4, 3, 2, 1.
1106
+ */
1107
+ star?: number;
1108
+ /**
1109
+ * background color
1110
+ * @example #FF0000
1111
+ * @default The default background color of the layer
1112
+ * @description The background color for the modification, accept any valid CSS color value, for example: #FF0000, red, rgba(0,0,0,0.5), etc.
1113
+ */
1114
+ background?: string;
1115
+ /**
1116
+ * font size
1117
+ * @example 12
1118
+ * @default The default font size of the layer
1119
+ * @description The font size for the modification, accept any valid CSS font size value, for example: 12, 12px;
1120
+ */
1121
+ size?: number;
1122
+ /**
1123
+ * source image
1124
+ * @example https://example.com/image.jpg
1125
+ * @default The default source image of the layer
1126
+ * @description The source image for the modification, accept any valid image URL, for example: https://example.com/image.jpg
1127
+ */
1128
+ src?: string;
1129
+ /**
1130
+ * rows
1131
+ * @example [{ label: 'Jan', value: 22 }, { label: 'Feb', value: 30 }]
1132
+ * @default The default rows of the layer
1133
+ * @description The rows of a data layer. A table takes row objects keyed by the column names, a chart takes { label, value } points, and a key value layer takes { key, value } entries.
1134
+ */
1135
+ rows?: Record<string, unknown>[];
1136
+ /**
1137
+ * columns
1138
+ * @example ["Item", "Qty", "Total"]
1139
+ * @default The default columns of the layer
1140
+ * @description The column names of a table layer
1141
+ */
1142
+ columns?: string[];
1143
+ /**
1144
+ * title
1145
+ * @example Payment terms
1146
+ * @default The default title of the layer
1147
+ * @description The heading of an alert layer, or the job title of a signature layer
1148
+ */
1149
+ title?: string;
1150
+ /**
1151
+ * date
1152
+ * @example 2026-01-31
1153
+ * @default The default date of the layer
1154
+ * @description The date of a signature layer
1155
+ */
1156
+ date?: string;
1157
+ /**
1158
+ * text content
1159
+ * @example Hello World
1160
+ * @default The default text content of the layer
1161
+ * @description You can modify the text layer with this field
1162
+ */
1163
+ text?: string;
1164
+ /**
1165
+ * barcode content
1166
+ * @example 1234567890
1167
+ * @default The default barcode content of the layer
1168
+ * @description Modify the barcode layer content with this field
1169
+ */
1170
+ qrcode?: string;
1171
+ /**
1172
+ * qrcode content
1173
+ * @example Some text
1174
+ * @default The default qrcode content of the layer
1175
+ * @description Modify the qrcode layer content with this field
1176
+ */
1177
+ barcode?: string;
1178
+ /**
1179
+ * icon name
1180
+ * @example Menu
1181
+ * @default The default icon name of the layer
1182
+ * @description Modify the icon name with this field
1183
+ */
1184
+ icon?: string;
1185
+ /**
1186
+ * visibility
1187
+ * @example true
1188
+ * @default The default visibility of the layer
1189
+ * @description Set the visibility of the field
1190
+ */
1191
+ visible?: boolean;
1192
+ };
1193
+
1194
+ declare const SUPPORTED_FORMATS: readonly ["png", "jpeg", "webp"];
1195
+ type ImageFormat = (typeof SUPPORTED_FORMATS)[number];
1196
+
1197
+ type codes = "400" | "401" | "403" | "404" | "500";
1198
+ type ErrorResponse = paths["/v1/templates/createImage"]["post"]["responses"][codes]["content"]["application/json"];
447
1199
  declare const timeoutError: {
448
1200
  error: {
449
1201
  code: string;
@@ -457,7 +1209,7 @@ type Result<R> = {
457
1209
  error?: never;
458
1210
  } | {
459
1211
  result?: never;
460
- error: ErrorResponse['error'] | (typeof timeoutError)['error'];
1212
+ error: ErrorResponse["error"] | (typeof timeoutError)["error"];
461
1213
  };
462
1214
 
463
1215
  interface Options {
@@ -467,8 +1219,13 @@ interface Options {
467
1219
  }
468
1220
  type CreateOptions = {
469
1221
  modifications?: Modification[];
1222
+ thumbnail?: boolean;
470
1223
  nocache?: boolean;
471
- format?: 'svg' | 'png';
1224
+ format?: ImageFormat;
1225
+ quality?: number;
1226
+ };
1227
+ type CreateStoredImageOptions = CreateOptions & {
1228
+ s3Config?: S3Config;
472
1229
  };
473
1230
  declare function createClient(apiKey: string, opts?: Options): Bannerify;
474
1231
  declare class Bannerify {
@@ -478,10 +1235,10 @@ declare class Bannerify {
478
1235
  private readonly client;
479
1236
  private readonly baseUrl;
480
1237
  constructor(apiKey: string, opts?: Options | undefined);
481
- createImage(templateId: string, options?: CreateOptions): Promise<Result<ArrayBuffer | string>>;
482
- createPdf(templateId: string, options?: CreateOptions): Promise<void>;
483
- createPermanentImage(): Promise<void>;
1238
+ createImage(templateId: string, options?: CreateOptions): Promise<Result<ArrayBuffer>>;
1239
+ createPdf(templateId: string, options?: CreateOptions): Promise<Result<ArrayBuffer>>;
1240
+ createStoredImage(templateId: string, options?: CreateStoredImageOptions): Promise<Result<string>>;
484
1241
  generateImageSignedUrl(templateId: string, options?: CreateOptions): Promise<string>;
485
1242
  }
486
1243
 
487
- export { Bannerify, type Modification, createClient };
1244
+ export { Bannerify, type Modification, type S3Config, createClient };