bannerify-js 0.0.28 → 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/dist/index.d.cts CHANGED
@@ -1,11 +1,8 @@
1
- import { ChartData } from 'chart.js';
2
-
3
1
  /**
4
2
  * This file was auto-generated by openapi-typescript.
5
3
  * Do not make direct changes to the file.
6
4
  */
7
5
 
8
-
9
6
  interface paths {
10
7
  "/v1/templates/createImage": {
11
8
  /** @description Create an image from a template */
@@ -17,409 +14,548 @@ interface paths {
17
14
  * @default png
18
15
  * @enum {string}
19
16
  */
20
- format?: "png" | "svg";
17
+ format?: "png" | "jpeg" | "webp"
21
18
  /** @description Only for debug purpose, it draws bounding box for each layer */
22
- _debug?: string;
23
- apiKey: string;
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
24
66
  /**
25
67
  * @description Your template id
26
68
  * @example tpl_xxxxxxxxx
27
69
  */
28
- templateId: string;
29
- /** @default [] */
30
- modifications?: components["schemas"]["Modification"][];
31
- };
32
- };
33
- };
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
+ }
34
90
  responses: {
35
91
  /** @description A image file */
36
92
  200: {
37
93
  content: {
38
- "image/png": string;
39
- "image/svg+xml": string;
40
- };
41
- };
94
+ "image/png": string
95
+ }
96
+ }
42
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). */
43
98
  400: {
44
99
  content: {
45
- "application/json": components["schemas"]["ErrBadRequest"] | components["schemas"]["ErrFetchImageError"];
46
- };
47
- };
100
+ "application/json":
101
+ | components["schemas"]["ErrBadRequest"]
102
+ | components["schemas"]["ErrFetchImageError"]
103
+ }
104
+ }
48
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. */
49
106
  401: {
50
107
  content: {
51
- "application/json": components["schemas"]["ErrUnauthorized"];
52
- };
53
- };
108
+ "application/json": components["schemas"]["ErrUnauthorized"]
109
+ }
110
+ }
54
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. */
55
112
  403: {
56
113
  content: {
57
- "application/json": components["schemas"]["ErrForbidden"];
58
- };
59
- };
114
+ "application/json": components["schemas"]["ErrForbidden"]
115
+ }
116
+ }
60
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. */
61
118
  404: {
62
119
  content: {
63
- "application/json": components["schemas"]["ErrNotFound"];
64
- };
65
- };
120
+ "application/json": components["schemas"]["ErrNotFound"]
121
+ }
122
+ }
66
123
  /** @description This response is sent when a request conflicts with the current state of the server. */
67
124
  409: {
68
125
  content: {
69
- "application/json": components["schemas"]["ErrConflict"];
70
- };
71
- };
126
+ "application/json": components["schemas"]["ErrConflict"]
127
+ }
128
+ }
72
129
  /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
73
130
  429: {
74
131
  content: {
75
- "application/json": components["schemas"]["ErrTooManyRequests"];
76
- };
77
- };
132
+ "application/json": components["schemas"]["ErrTooManyRequests"]
133
+ }
134
+ }
78
135
  /** @description The server has encountered a situation it does not know how to handle. */
79
136
  500: {
80
137
  content: {
81
- "application/json": components["schemas"]["ErrInternalServerError"];
82
- };
83
- };
84
- };
85
- };
86
- };
138
+ "application/json": components["schemas"]["ErrInternalServerError"]
139
+ }
140
+ }
141
+ }
142
+ }
143
+ }
87
144
  "/v1/templates/createPdf": {
88
145
  post: {
89
146
  requestBody: {
90
147
  content: {
91
148
  "application/json": {
92
- apiKey: string;
149
+ apiKey: string
93
150
  /**
94
151
  * @description Your template ID
95
152
  * @example tpl_xxx
96
153
  */
97
- templateId: string;
98
- /** @default [] */
99
- modifications?: components["schemas"]["Modification"][];
100
- };
101
- };
102
- };
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
+ }
103
169
  responses: {
104
170
  /** @description Success create pdf */
105
171
  200: {
106
172
  content: {
107
- "application/pdf": string;
108
- };
109
- };
173
+ "application/pdf": string
174
+ }
175
+ }
110
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). */
111
177
  400: {
112
178
  content: {
113
- "application/json": components["schemas"]["ErrBadRequest"] | components["schemas"]["ErrFetchImageError"];
114
- };
115
- };
179
+ "application/json":
180
+ | components["schemas"]["ErrBadRequest"]
181
+ | components["schemas"]["ErrFetchImageError"]
182
+ }
183
+ }
116
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. */
117
185
  401: {
118
186
  content: {
119
- "application/json": components["schemas"]["ErrUnauthorized"];
120
- };
121
- };
187
+ "application/json": components["schemas"]["ErrUnauthorized"]
188
+ }
189
+ }
122
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. */
123
191
  403: {
124
192
  content: {
125
- "application/json": components["schemas"]["ErrForbidden"];
126
- };
127
- };
193
+ "application/json": components["schemas"]["ErrForbidden"]
194
+ }
195
+ }
128
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. */
129
197
  404: {
130
198
  content: {
131
- "application/json": components["schemas"]["ErrNotFound"];
132
- };
133
- };
199
+ "application/json": components["schemas"]["ErrNotFound"]
200
+ }
201
+ }
134
202
  /** @description This response is sent when a request conflicts with the current state of the server. */
135
203
  409: {
136
204
  content: {
137
- "application/json": components["schemas"]["ErrConflict"];
138
- };
139
- };
205
+ "application/json": components["schemas"]["ErrConflict"]
206
+ }
207
+ }
140
208
  /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
141
209
  429: {
142
210
  content: {
143
- "application/json": components["schemas"]["ErrTooManyRequests"];
144
- };
145
- };
211
+ "application/json": components["schemas"]["ErrTooManyRequests"]
212
+ }
213
+ }
146
214
  /** @description The server has encountered a situation it does not know how to handle. */
147
215
  500: {
148
216
  content: {
149
- "application/json": components["schemas"]["ErrInternalServerError"];
150
- };
151
- };
152
- };
153
- };
154
- };
217
+ "application/json": components["schemas"]["ErrInternalServerError"]
218
+ }
219
+ }
220
+ }
221
+ }
222
+ }
155
223
  "/v1/templates/signedurl": {
156
224
  /** @description Generate a signed URL for a template */
157
225
  get: {
158
226
  parameters: {
159
227
  query: {
160
- format?: "png" | "svg";
161
- nocache?: string;
162
- _debug?: string;
163
- templateId: string;
164
- apiKeyMd5?: string;
165
- apiKeyHashed?: string;
166
- sign: string;
167
- modifications?: string;
168
- };
169
- };
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
+ }
170
292
  responses: {
171
293
  /** @description A image file */
172
294
  200: {
173
295
  content: {
174
- "image/png": unknown;
175
- };
176
- };
296
+ "image/png": string
297
+ "image/jpeg": string
298
+ "image/webp": string
299
+ }
300
+ }
177
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). */
178
302
  400: {
179
303
  content: {
180
- "application/json": components["schemas"]["ErrBadRequest"] | components["schemas"]["ErrFetchImageError"];
181
- };
182
- };
304
+ "application/json":
305
+ | components["schemas"]["ErrBadRequest"]
306
+ | components["schemas"]["ErrFetchImageError"]
307
+ }
308
+ }
183
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. */
184
310
  401: {
185
311
  content: {
186
- "application/json": components["schemas"]["ErrUnauthorized"];
187
- };
188
- };
312
+ "application/json": components["schemas"]["ErrUnauthorized"]
313
+ }
314
+ }
189
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. */
190
316
  403: {
191
317
  content: {
192
- "application/json": components["schemas"]["ErrForbidden"];
193
- };
194
- };
318
+ "application/json": components["schemas"]["ErrForbidden"]
319
+ }
320
+ }
195
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. */
196
322
  404: {
197
323
  content: {
198
- "application/json": components["schemas"]["ErrNotFound"];
199
- };
200
- };
324
+ "application/json": components["schemas"]["ErrNotFound"]
325
+ }
326
+ }
201
327
  /** @description This response is sent when a request conflicts with the current state of the server. */
202
328
  409: {
203
329
  content: {
204
- "application/json": components["schemas"]["ErrConflict"];
205
- };
206
- };
330
+ "application/json": components["schemas"]["ErrConflict"]
331
+ }
332
+ }
207
333
  /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
208
334
  429: {
209
335
  content: {
210
- "application/json": components["schemas"]["ErrTooManyRequests"];
211
- };
212
- };
336
+ "application/json": components["schemas"]["ErrTooManyRequests"]
337
+ }
338
+ }
213
339
  /** @description The server has encountered a situation it does not know how to handle. */
214
340
  500: {
215
341
  content: {
216
- "application/json": components["schemas"]["ErrInternalServerError"];
217
- };
218
- };
219
- };
220
- };
221
- };
342
+ "application/json": components["schemas"]["ErrInternalServerError"]
343
+ }
344
+ }
345
+ }
346
+ }
347
+ }
222
348
  "/v1/info": {
223
349
  /** @description Get project info */
224
350
  get: {
225
351
  parameters: {
226
352
  query: {
227
- apiKey: string;
228
- };
229
- };
353
+ /** @description The api key to use for this request */
354
+ apiKey: string
355
+ }
356
+ }
230
357
  responses: {
231
358
  /** @description Project info */
232
359
  200: {
233
360
  content: {
234
361
  "application/json": {
235
- id: string;
236
- name: string;
237
- createdAt: string;
238
- };
239
- };
240
- };
362
+ id: string
363
+ name: string
364
+ createdAt: string
365
+ }
366
+ }
367
+ }
241
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). */
242
369
  400: {
243
370
  content: {
244
- "application/json": components["schemas"]["ErrBadRequest"] | components["schemas"]["ErrFetchImageError"];
245
- };
246
- };
371
+ "application/json":
372
+ | components["schemas"]["ErrBadRequest"]
373
+ | components["schemas"]["ErrFetchImageError"]
374
+ }
375
+ }
247
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. */
248
377
  401: {
249
378
  content: {
250
- "application/json": components["schemas"]["ErrUnauthorized"];
251
- };
252
- };
379
+ "application/json": components["schemas"]["ErrUnauthorized"]
380
+ }
381
+ }
253
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. */
254
383
  403: {
255
384
  content: {
256
- "application/json": components["schemas"]["ErrForbidden"];
257
- };
258
- };
385
+ "application/json": components["schemas"]["ErrForbidden"]
386
+ }
387
+ }
259
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. */
260
389
  404: {
261
390
  content: {
262
- "application/json": components["schemas"]["ErrNotFound"];
263
- };
264
- };
391
+ "application/json": components["schemas"]["ErrNotFound"]
392
+ }
393
+ }
265
394
  /** @description This response is sent when a request conflicts with the current state of the server. */
266
395
  409: {
267
396
  content: {
268
- "application/json": components["schemas"]["ErrConflict"];
269
- };
270
- };
397
+ "application/json": components["schemas"]["ErrConflict"]
398
+ }
399
+ }
271
400
  /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
272
401
  429: {
273
402
  content: {
274
- "application/json": components["schemas"]["ErrTooManyRequests"];
275
- };
276
- };
403
+ "application/json": components["schemas"]["ErrTooManyRequests"]
404
+ }
405
+ }
277
406
  /** @description The server has encountered a situation it does not know how to handle. */
278
407
  500: {
279
408
  content: {
280
- "application/json": components["schemas"]["ErrInternalServerError"];
281
- };
282
- };
283
- };
284
- };
285
- };
409
+ "application/json": components["schemas"]["ErrInternalServerError"]
410
+ }
411
+ }
412
+ }
413
+ }
414
+ }
286
415
  "/v1/templates": {
287
416
  /** @description List templates */
288
417
  get: {
289
418
  parameters: {
290
419
  query: {
291
- apiKey: string;
292
- includeLayers?: string;
293
- };
294
- };
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
+ }
295
426
  responses: {
296
427
  /** @description A list of templates */
297
428
  200: {
298
429
  content: {
299
- "application/json": unknown[];
300
- };
301
- };
430
+ "application/json": unknown[]
431
+ }
432
+ }
302
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). */
303
434
  400: {
304
435
  content: {
305
- "application/json": components["schemas"]["ErrBadRequest"] | components["schemas"]["ErrFetchImageError"];
306
- };
307
- };
436
+ "application/json":
437
+ | components["schemas"]["ErrBadRequest"]
438
+ | components["schemas"]["ErrFetchImageError"]
439
+ }
440
+ }
308
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. */
309
442
  401: {
310
443
  content: {
311
- "application/json": components["schemas"]["ErrUnauthorized"];
312
- };
313
- };
444
+ "application/json": components["schemas"]["ErrUnauthorized"]
445
+ }
446
+ }
314
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. */
315
448
  403: {
316
449
  content: {
317
- "application/json": components["schemas"]["ErrForbidden"];
318
- };
319
- };
450
+ "application/json": components["schemas"]["ErrForbidden"]
451
+ }
452
+ }
320
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. */
321
454
  404: {
322
455
  content: {
323
- "application/json": components["schemas"]["ErrNotFound"];
324
- };
325
- };
456
+ "application/json": components["schemas"]["ErrNotFound"]
457
+ }
458
+ }
326
459
  /** @description This response is sent when a request conflicts with the current state of the server. */
327
460
  409: {
328
461
  content: {
329
- "application/json": components["schemas"]["ErrConflict"];
330
- };
331
- };
462
+ "application/json": components["schemas"]["ErrConflict"]
463
+ }
464
+ }
332
465
  /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
333
466
  429: {
334
467
  content: {
335
- "application/json": components["schemas"]["ErrTooManyRequests"];
336
- };
337
- };
468
+ "application/json": components["schemas"]["ErrTooManyRequests"]
469
+ }
470
+ }
338
471
  /** @description The server has encountered a situation it does not know how to handle. */
339
472
  500: {
340
473
  content: {
341
- "application/json": components["schemas"]["ErrInternalServerError"];
342
- };
343
- };
344
- };
345
- };
346
- };
474
+ "application/json": components["schemas"]["ErrInternalServerError"]
475
+ }
476
+ }
477
+ }
478
+ }
479
+ }
347
480
  "/v1/templates/:id": {
348
481
  /** @description Template details */
349
482
  get: {
350
483
  parameters: {
351
484
  query: {
352
- apiKey: string;
353
- };
354
- };
485
+ /** @description The api key to use for this request */
486
+ apiKey: string
487
+ }
488
+ }
355
489
  responses: {
356
490
  /** @description Template details */
357
491
  200: {
358
492
  content: {
359
493
  "application/json": {
360
494
  /** @description The name of the template */
361
- name: string;
495
+ name: string
362
496
  /** @description The id of the template */
363
- id: string;
497
+ id: string
364
498
  /** @description The layers of the template */
365
- layers: ({
366
- /** @description The name of the layer */
367
- name: string;
368
- /** @description The id of the layer */
369
- id: string;
370
- /** @description The type of the layer */
371
- type: string;
372
- /** @description The suggest input of the layer */
373
- suggestInput: string | null;
374
- })[];
375
- };
376
- };
377
- };
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
+ }
378
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). */
379
513
  400: {
380
514
  content: {
381
- "application/json": components["schemas"]["ErrBadRequest"] | components["schemas"]["ErrFetchImageError"];
382
- };
383
- };
515
+ "application/json":
516
+ | components["schemas"]["ErrBadRequest"]
517
+ | components["schemas"]["ErrFetchImageError"]
518
+ }
519
+ }
384
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. */
385
521
  401: {
386
522
  content: {
387
- "application/json": components["schemas"]["ErrUnauthorized"];
388
- };
389
- };
523
+ "application/json": components["schemas"]["ErrUnauthorized"]
524
+ }
525
+ }
390
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. */
391
527
  403: {
392
528
  content: {
393
- "application/json": components["schemas"]["ErrForbidden"];
394
- };
395
- };
529
+ "application/json": components["schemas"]["ErrForbidden"]
530
+ }
531
+ }
396
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. */
397
533
  404: {
398
534
  content: {
399
- "application/json": components["schemas"]["ErrNotFound"];
400
- };
401
- };
535
+ "application/json": components["schemas"]["ErrNotFound"]
536
+ }
537
+ }
402
538
  /** @description This response is sent when a request conflicts with the current state of the server. */
403
539
  409: {
404
540
  content: {
405
- "application/json": components["schemas"]["ErrConflict"];
406
- };
407
- };
541
+ "application/json": components["schemas"]["ErrConflict"]
542
+ }
543
+ }
408
544
  /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
409
545
  429: {
410
546
  content: {
411
- "application/json": components["schemas"]["ErrTooManyRequests"];
412
- };
413
- };
547
+ "application/json": components["schemas"]["ErrTooManyRequests"]
548
+ }
549
+ }
414
550
  /** @description The server has encountered a situation it does not know how to handle. */
415
551
  500: {
416
552
  content: {
417
- "application/json": components["schemas"]["ErrInternalServerError"];
418
- };
419
- };
420
- };
421
- };
422
- };
553
+ "application/json": components["schemas"]["ErrInternalServerError"]
554
+ }
555
+ }
556
+ }
557
+ }
558
+ }
423
559
  "/v1/templates/createStoredImage": {
424
560
  /** @description Create an image from a template */
425
561
  post: {
@@ -430,74 +566,258 @@ interface paths {
430
566
  * @default png
431
567
  * @enum {string}
432
568
  */
433
- format?: "png" | "svg";
569
+ format?: "png" | "jpeg" | "webp"
434
570
  /** @description Only for debug purpose, it draws bounding box for each layer */
435
- _debug?: string;
436
- apiKey: string;
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
437
618
  /**
438
619
  * @description Your template id
439
620
  * @example tpl_xxxxxxxxx
440
621
  */
441
- templateId: string;
442
- /** @default [] */
443
- modifications?: components["schemas"]["Modification"][];
444
- };
445
- };
446
- };
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
+ }
447
637
  responses: {
448
638
  /** @description Image object */
449
639
  200: {
450
640
  content: {
451
641
  "application/json": {
452
- url: string;
453
- };
454
- };
455
- };
642
+ url: string
643
+ }
644
+ }
645
+ }
456
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). */
457
647
  400: {
458
648
  content: {
459
- "application/json": components["schemas"]["ErrBadRequest"] | components["schemas"]["ErrFetchImageError"];
460
- };
461
- };
649
+ "application/json":
650
+ | components["schemas"]["ErrBadRequest"]
651
+ | components["schemas"]["ErrFetchImageError"]
652
+ }
653
+ }
462
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. */
463
655
  401: {
464
656
  content: {
465
- "application/json": components["schemas"]["ErrUnauthorized"];
466
- };
467
- };
657
+ "application/json": components["schemas"]["ErrUnauthorized"]
658
+ }
659
+ }
468
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. */
469
661
  403: {
470
662
  content: {
471
- "application/json": components["schemas"]["ErrForbidden"];
472
- };
473
- };
663
+ "application/json": components["schemas"]["ErrForbidden"]
664
+ }
665
+ }
474
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. */
475
667
  404: {
476
668
  content: {
477
- "application/json": components["schemas"]["ErrNotFound"];
478
- };
479
- };
669
+ "application/json": components["schemas"]["ErrNotFound"]
670
+ }
671
+ }
480
672
  /** @description This response is sent when a request conflicts with the current state of the server. */
481
673
  409: {
482
674
  content: {
483
- "application/json": components["schemas"]["ErrConflict"];
484
- };
485
- };
675
+ "application/json": components["schemas"]["ErrConflict"]
676
+ }
677
+ }
486
678
  /** @description The user has sent too many requests in a given amount of time ("rate limiting") */
487
679
  429: {
488
680
  content: {
489
- "application/json": components["schemas"]["ErrTooManyRequests"];
490
- };
491
- };
681
+ "application/json": components["schemas"]["ErrTooManyRequests"]
682
+ }
683
+ }
492
684
  /** @description The server has encountered a situation it does not know how to handle. */
493
685
  500: {
494
686
  content: {
495
- "application/json": components["schemas"]["ErrInternalServerError"];
496
- };
497
- };
498
- };
499
- };
500
- };
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
+ }
501
821
  }
502
822
 
503
823
  interface components {
@@ -509,21 +829,21 @@ interface components {
509
829
  * @example BAD_REQUEST
510
830
  * @enum {string}
511
831
  */
512
- code: "BAD_REQUEST";
832
+ code: "BAD_REQUEST"
513
833
  /**
514
834
  * @description A link to our documentation with more details about this error code
515
835
  * @example https://bannerify.co/docs/api-reference/errors/code/BAD_REQUEST
516
836
  */
517
- docs: string;
837
+ docs: string
518
838
  /** @description A human readable explanation of what went wrong */
519
- message: string;
839
+ message: string
520
840
  /**
521
841
  * @description Please always include the requestId in your error report
522
842
  * @example req:1234
523
843
  */
524
- requestId: string;
525
- };
526
- };
844
+ requestId: string
845
+ }
846
+ }
527
847
  ErrFetchImageError: {
528
848
  error: {
529
849
  /**
@@ -531,21 +851,21 @@ interface components {
531
851
  * @example FETCH_IMAGE_ERROR
532
852
  * @enum {string}
533
853
  */
534
- code: "FETCH_IMAGE_ERROR";
854
+ code: "FETCH_IMAGE_ERROR"
535
855
  /**
536
856
  * @description A link to our documentation with more details about this error code
537
857
  * @example https://bannerify.co/docs/api-reference/errors/code/FETCH_IMAGE_ERROR
538
858
  */
539
- docs: string;
859
+ docs: string
540
860
  /** @description A human readable explanation of what went wrong */
541
- message: string;
861
+ message: string
542
862
  /**
543
863
  * @description Please always include the requestId in your error report
544
864
  * @example req:1234
545
865
  */
546
- requestId: string;
547
- };
548
- };
866
+ requestId: string
867
+ }
868
+ }
549
869
  ErrUnauthorized: {
550
870
  error: {
551
871
  /**
@@ -553,21 +873,21 @@ interface components {
553
873
  * @example UNAUTHORIZED
554
874
  * @enum {string}
555
875
  */
556
- code: "UNAUTHORIZED";
876
+ code: "UNAUTHORIZED"
557
877
  /**
558
878
  * @description A link to our documentation with more details about this error code
559
879
  * @example https://bannerify.co/docs/api-reference/errors/code/UNAUTHORIZED
560
880
  */
561
- docs: string;
881
+ docs: string
562
882
  /** @description A human readable explanation of what went wrong */
563
- message: string;
883
+ message: string
564
884
  /**
565
885
  * @description Please always include the requestId in your error report
566
886
  * @example req:1234
567
887
  */
568
- requestId: string;
569
- };
570
- };
888
+ requestId: string
889
+ }
890
+ }
571
891
  ErrForbidden: {
572
892
  error: {
573
893
  /**
@@ -575,21 +895,21 @@ interface components {
575
895
  * @example FORBIDDEN
576
896
  * @enum {string}
577
897
  */
578
- code: "FORBIDDEN";
898
+ code: "FORBIDDEN"
579
899
  /**
580
900
  * @description A link to our documentation with more details about this error code
581
901
  * @example https://bannerify.co/docs/api-reference/errors/code/FORBIDDEN
582
902
  */
583
- docs: string;
903
+ docs: string
584
904
  /** @description A human readable explanation of what went wrong */
585
- message: string;
905
+ message: string
586
906
  /**
587
907
  * @description Please always include the requestId in your error report
588
908
  * @example req:1234
589
909
  */
590
- requestId: string;
591
- };
592
- };
910
+ requestId: string
911
+ }
912
+ }
593
913
  ErrNotFound: {
594
914
  error: {
595
915
  /**
@@ -597,21 +917,21 @@ interface components {
597
917
  * @example NOT_FOUND
598
918
  * @enum {string}
599
919
  */
600
- code: "NOT_FOUND";
920
+ code: "NOT_FOUND"
601
921
  /**
602
922
  * @description A link to our documentation with more details about this error code
603
923
  * @example https://bannerify.co/docs/api-reference/errors/code/NOT_FOUND
604
924
  */
605
- docs: string;
925
+ docs: string
606
926
  /** @description A human readable explanation of what went wrong */
607
- message: string;
927
+ message: string
608
928
  /**
609
929
  * @description Please always include the requestId in your error report
610
930
  * @example req:1234
611
931
  */
612
- requestId: string;
613
- };
614
- };
932
+ requestId: string
933
+ }
934
+ }
615
935
  ErrConflict: {
616
936
  error: {
617
937
  /**
@@ -619,21 +939,21 @@ interface components {
619
939
  * @example CONFLICT
620
940
  * @enum {string}
621
941
  */
622
- code: "CONFLICT";
942
+ code: "CONFLICT"
623
943
  /**
624
944
  * @description A link to our documentation with more details about this error code
625
945
  * @example https://bannerify.co/docs/api-reference/errors/code/CONFLICT
626
946
  */
627
- docs: string;
947
+ docs: string
628
948
  /** @description A human readable explanation of what went wrong */
629
- message: string;
949
+ message: string
630
950
  /**
631
951
  * @description Please always include the requestId in your error report
632
952
  * @example req:1234
633
953
  */
634
- requestId: string;
635
- };
636
- };
954
+ requestId: string
955
+ }
956
+ }
637
957
  ErrTooManyRequests: {
638
958
  error: {
639
959
  /**
@@ -641,21 +961,21 @@ interface components {
641
961
  * @example TOO_MANY_REQUESTS
642
962
  * @enum {string}
643
963
  */
644
- code: "TOO_MANY_REQUESTS";
964
+ code: "TOO_MANY_REQUESTS"
645
965
  /**
646
966
  * @description A link to our documentation with more details about this error code
647
967
  * @example https://bannerify.co/docs/api-reference/errors/code/TOO_MANY_REQUESTS
648
968
  */
649
- docs: string;
969
+ docs: string
650
970
  /** @description A human readable explanation of what went wrong */
651
- message: string;
971
+ message: string
652
972
  /**
653
973
  * @description Please always include the requestId in your error report
654
974
  * @example req:1234
655
975
  */
656
- requestId: string;
657
- };
658
- };
976
+ requestId: string
977
+ }
978
+ }
659
979
  ErrInternalServerError: {
660
980
  error: {
661
981
  /**
@@ -663,100 +983,113 @@ interface components {
663
983
  * @example INTERNAL_SERVER_ERROR
664
984
  * @enum {string}
665
985
  */
666
- code: "INTERNAL_SERVER_ERROR";
986
+ code: "INTERNAL_SERVER_ERROR"
667
987
  /**
668
988
  * @description A link to our documentation with more details about this error code
669
989
  * @example https://bannerify.co/docs/api-reference/errors/code/INTERNAL_SERVER_ERROR
670
990
  */
671
- docs: string;
991
+ docs: string
672
992
  /** @description A human readable explanation of what went wrong */
673
- message: string;
993
+ message: string
674
994
  /**
675
995
  * @description Please always include the requestId in your error report
676
996
  * @example req:1234
677
997
  */
678
- requestId: string;
679
- };
680
- };
998
+ requestId: string
999
+ }
1000
+ }
681
1001
  /** @description A modification (aka override) to apply to the layer in image */
682
1002
  Modification: {
683
1003
  /**
684
1004
  * @description The layer name of the modification
685
1005
  * @example Text 1
686
1006
  */
687
- name: string;
1007
+ name: string
688
1008
  /**
689
1009
  * @description The color for the modification
690
1010
  * @example #FF0000
691
1011
  */
692
- color?: string;
1012
+ color?: string
693
1013
  /**
694
1014
  * @description The source image for the modification
695
1015
  * @example https://example.com/image.jpg
696
1016
  */
697
- src?: string;
1017
+ src?: string
698
1018
  /**
699
1019
  * @description You can modify the text layer with this field
700
1020
  * @example Hello World
701
1021
  */
702
- text?: string;
1022
+ text?: string
703
1023
  /**
704
1024
  * @description Modify the barcode layer content with this field
705
1025
  * @example 1234567890
706
1026
  */
707
- barcode?: string;
1027
+ barcode?: string
708
1028
  /**
709
1029
  * @description Modify the qrcode layer content with this field
710
1030
  * @example Some text
711
1031
  */
712
- qrcode?: string;
713
- /** @description Update chart layer's data, follow chart.js data structure */
714
- chart?: {
715
- [key: string]: unknown;
716
- };
1032
+ qrcode?: string
717
1033
  /**
718
1034
  * @description Set the visibility of the field
719
1035
  * @example true
720
1036
  */
721
- visible?: boolean;
1037
+ visible?: boolean
722
1038
  /**
723
1039
  * @description Star value
724
1040
  * @example 5
725
1041
  */
726
- star?: number;
1042
+ star?: number
727
1043
  /**
728
- * @description Table width mode
729
- * @example adaptive
730
- * @enum {string}
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
+ * ]
731
1051
  */
732
- widthMode?: "standard" | "adaptive";
1052
+ rows?: unknown[]
733
1053
  /**
734
- * @description Table height mode
735
- * @example adaptive
736
- * @enum {string}
1054
+ * @description The column names of a table layer
1055
+ * @example [
1056
+ * "Item",
1057
+ * "Qty",
1058
+ * "Total"
1059
+ * ]
737
1060
  */
738
- heightMode?: "standard" | "adaptive";
1061
+ columns?: string[]
739
1062
  /**
740
- * @description Table theme
741
- * @example NONE
742
- * @enum {string}
1063
+ * @description The heading of an alert layer, or the job title of a signature layer
1064
+ * @example Payment terms
743
1065
  */
744
- theme?: "NONE" | "DEFAULT" | "BRIGHT" | "SIMPLIFY" | "ARCO";
745
- /** @description Table rows */
746
- rows?: unknown[];
747
- /** @description Table columns */
748
- columns?: string[];
749
- };
750
- };
751
- responses: never;
752
- parameters: {
753
- };
754
- requestBodies: never;
755
- headers: never;
756
- pathItems: never;
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
757
1079
  }
758
1080
 
759
- type Modification = NonNullable<paths["/v1/templates/createImage"]["post"]["requestBody"]["content"]["application/json"]["modifications"]>[0] & {
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"] & {
760
1093
  name: string;
761
1094
  /**
762
1095
  * color
@@ -794,12 +1127,33 @@ type Modification = NonNullable<paths["/v1/templates/createImage"]["post"]["requ
794
1127
  */
795
1128
  src?: string;
796
1129
  /**
797
- * chart data
798
- * @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 }] }
799
- * @default The default chart data of the layer
800
- * @description Update chart layer's data, follow chart.js data structure
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
801
1141
  */
802
- chart?: ChartData;
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;
803
1157
  /**
804
1158
  * text content
805
1159
  * @example Hello World
@@ -837,8 +1191,11 @@ type Modification = NonNullable<paths["/v1/templates/createImage"]["post"]["requ
837
1191
  visible?: boolean;
838
1192
  };
839
1193
 
840
- type codes = '400' | '401' | '403' | '404' | '500';
841
- type ErrorResponse = paths['/v1/templates/createImage']['post']['responses'][codes]['content']['application/json'];
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"];
842
1199
  declare const timeoutError: {
843
1200
  error: {
844
1201
  code: string;
@@ -852,7 +1209,7 @@ type Result<R> = {
852
1209
  error?: never;
853
1210
  } | {
854
1211
  result?: never;
855
- error: ErrorResponse['error'] | (typeof timeoutError)['error'];
1212
+ error: ErrorResponse["error"] | (typeof timeoutError)["error"];
856
1213
  };
857
1214
 
858
1215
  interface Options {
@@ -862,8 +1219,13 @@ interface Options {
862
1219
  }
863
1220
  type CreateOptions = {
864
1221
  modifications?: Modification[];
1222
+ thumbnail?: boolean;
865
1223
  nocache?: boolean;
866
- format?: "svg" | "png";
1224
+ format?: ImageFormat;
1225
+ quality?: number;
1226
+ };
1227
+ type CreateStoredImageOptions = CreateOptions & {
1228
+ s3Config?: S3Config;
867
1229
  };
868
1230
  declare function createClient(apiKey: string, opts?: Options): Bannerify;
869
1231
  declare class Bannerify {
@@ -873,98 +1235,10 @@ declare class Bannerify {
873
1235
  private readonly client;
874
1236
  private readonly baseUrl;
875
1237
  constructor(apiKey: string, opts?: Options | undefined);
876
- createImage(templateId: string, options?: CreateOptions): Promise<Result<ArrayBuffer | string>>;
877
- createPdf(templateId: string, options?: CreateOptions): Promise<{
878
- error: {
879
- code: "BAD_REQUEST";
880
- docs: string;
881
- message: string;
882
- requestId: string;
883
- };
884
- } | {
885
- error: {
886
- code: "FETCH_IMAGE_ERROR";
887
- docs: string;
888
- message: string;
889
- requestId: string;
890
- };
891
- } | {
892
- error: {
893
- code: "UNAUTHORIZED";
894
- docs: string;
895
- message: string;
896
- requestId: string;
897
- };
898
- } | {
899
- error: {
900
- code: "FORBIDDEN";
901
- docs: string;
902
- message: string;
903
- requestId: string;
904
- };
905
- } | {
906
- error: {
907
- code: "NOT_FOUND";
908
- docs: string;
909
- message: string;
910
- requestId: string;
911
- };
912
- } | {
913
- error: {
914
- code: "INTERNAL_SERVER_ERROR";
915
- docs: string;
916
- message: string;
917
- requestId: string;
918
- };
919
- } | {
920
- result: ArrayBuffer;
921
- }>;
922
- createStoredImage(templateId: string, options?: CreateOptions): Promise<{
923
- error: {
924
- code: "BAD_REQUEST";
925
- docs: string;
926
- message: string;
927
- requestId: string;
928
- };
929
- } | {
930
- error: {
931
- code: "FETCH_IMAGE_ERROR";
932
- docs: string;
933
- message: string;
934
- requestId: string;
935
- };
936
- } | {
937
- error: {
938
- code: "UNAUTHORIZED";
939
- docs: string;
940
- message: string;
941
- requestId: string;
942
- };
943
- } | {
944
- error: {
945
- code: "FORBIDDEN";
946
- docs: string;
947
- message: string;
948
- requestId: string;
949
- };
950
- } | {
951
- error: {
952
- code: "NOT_FOUND";
953
- docs: string;
954
- message: string;
955
- requestId: string;
956
- };
957
- } | {
958
- error: {
959
- code: "INTERNAL_SERVER_ERROR";
960
- docs: string;
961
- message: string;
962
- requestId: string;
963
- };
964
- } | {
965
- result: string;
966
- }>;
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>>;
967
1241
  generateImageSignedUrl(templateId: string, options?: CreateOptions): Promise<string>;
968
1242
  }
969
1243
 
970
- export { Bannerify, type Modification, createClient };
1244
+ export { Bannerify, type Modification, type S3Config, createClient };