@@ -89,6 +89,17 @@ export interface DownloadFileParams {
89
89
*/
90
90
cacheTtl404 ?: number ;
91
91
92
+ /**
93
+ * Expires the URL at the given Unix epoch timestamp.
94
+ *
95
+ * The value can be provided in either milliseconds or seconds since January 1, 1970, 00:00:00 UTC.
96
+ *
97
+ * Must less than 7 days in the future.
98
+ *
99
+ * See: Secure URLs
100
+ */
101
+ exp ?: number ;
102
+
92
103
/**
93
104
* Downloads the latest version of your file (if you have overwritten it) when added to the URL with a unique value.
94
105
*
@@ -115,6 +126,19 @@ export interface ProcessFileParams {
115
126
*/
116
127
transformation : string ;
117
128
129
+ /**
130
+ * Each File Processing API requires additional query string parameters to specify the desired transformation behavior.
131
+ *
132
+ * For details, refer to the relevant documentation:
133
+ *
134
+ * - https://www.bytescale.com/docs/image-processing-api
135
+ * - https://www.bytescale.com/docs/video-processing-api
136
+ * - https://www.bytescale.com/docs/audio-processing-api
137
+ * - https://www.bytescale.com/docs/archive-processing-api
138
+ * - https://www.bytescale.com/docs/antivirus-api
139
+ */
140
+ transformationParams ?: TransformationParams ;
141
+
118
142
/**
119
143
* Some transformations output multiple files, called artifacts.
120
144
*
@@ -127,7 +151,7 @@ export interface ProcessFileParams {
127
151
*
128
152
* If set to `false` the transformation will be executed on every request.
129
153
*
130
- * *Recommendation:* instead of disabling the cache, a more performant solution is to use the `version` parameter and to increment it each time you require an updated result.
154
+ * *Recommendation:* instead of disabling the cache, a more performant solution is to use the `version` or `v` parameter and to increment it each time you require an updated result.
131
155
*
132
156
* Default: true
133
157
*/
@@ -151,7 +175,7 @@ export interface ProcessFileParams {
151
175
*
152
176
* When `cache=false` this parameter is automatically set to `false`.
153
177
*
154
- * When `cache_perm =auto` the perma-cache will only be used for files that take more than 1000ms to process.
178
+ * When `cache-perm =auto` the perma-cache will only be used for files that take more than 500ms to process.
155
179
*
156
180
* When the perma-cache is used, approximately 200ms of latency is added to the initial request. Thereafter, files will be served from the Bytescale CDN's edge cache or perma-cache, so will have minimal latency.
157
181
*
@@ -166,7 +190,7 @@ export interface ProcessFileParams {
166
190
*
167
191
* If the file is not perma-cached, then the file will be reprocessed on edge cache misses.
168
192
*
169
- * For more information on perma-caching, see: `cache_perm `
193
+ * For more information on perma-caching, see: `cache-perm `
170
194
*
171
195
* Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
172
196
*/
@@ -180,16 +204,15 @@ export interface ProcessFileParams {
180
204
cacheTtl404 ?: number ;
181
205
182
206
/**
183
- * Parameters to submit to the File Processing API (e.g. the Image Processing API) .
207
+ * Expires the URL at the given Unix epoch timestamp .
184
208
*
185
- * Please see the documentation for each File Processing API to determine which values can appear here:
209
+ * The value can be provided in either milliseconds or seconds since January 1, 1970, 00:00:00 UTC.
186
210
*
187
- * - https://www.bytescale.com/docs/image-processing-api
188
- * - https://www.bytescale.com/docs/video-processing-api
189
- * - https://www.bytescale.com/docs/audio-processing-api
190
- * - https://www.bytescale.com/docs/archive-processing-api
211
+ * Must less than 7 days in the future.
212
+ *
213
+ * See: Secure URLs
191
214
*/
192
- transformationParams ?: TransformationParams ;
215
+ exp ?: number ;
193
216
194
217
/**
195
218
* Add this parameter and increment its value to force the file to be reprocessed.
@@ -219,14 +242,15 @@ export interface ProcessFileAndSaveOperationParams {
219
242
processFileAndSaveRequest : ProcessFileAndSaveRequest ;
220
243
221
244
/**
222
- * Parameters to submit to the File Processing API (e.g. the Image Processing API) .
245
+ * Each File Processing API requires additional query string parameters to specify the desired transformation behavior .
223
246
*
224
- * Please see the documentation for each File Processing API to determine which values can appear here :
247
+ * For details, refer to the relevant documentation :
225
248
*
226
249
* - https://www.bytescale.com/docs/image-processing-api
227
250
* - https://www.bytescale.com/docs/video-processing-api
228
251
* - https://www.bytescale.com/docs/audio-processing-api
229
252
* - https://www.bytescale.com/docs/archive-processing-api
253
+ * - https://www.bytescale.com/docs/antivirus-api
230
254
*/
231
255
transformationParams ?: TransformationParams ;
232
256
}
@@ -246,7 +270,7 @@ export class FileApi extends runtime.BaseAPI {
246
270
path : `/v2/accounts/{accountId}/files/copy` . replace (
247
271
`{${ "accountId" } }` ,
248
272
// @ts -ignore
249
- this . encodeParam ( "accountId" , params . accountId )
273
+ this . encodePathParam ( "accountId" , params . accountId )
250
274
) ,
251
275
method : "POST" ,
252
276
headers,
@@ -274,7 +298,7 @@ export class FileApi extends runtime.BaseAPI {
274
298
path : `/v2/accounts/{accountId}/files/copy/batch` . replace (
275
299
`{${ "accountId" } }` ,
276
300
// @ts -ignore
277
- this . encodeParam ( "accountId" , params . accountId )
301
+ this . encodePathParam ( "accountId" , params . accountId )
278
302
) ,
279
303
method : "POST" ,
280
304
headers,
@@ -304,7 +328,7 @@ export class FileApi extends runtime.BaseAPI {
304
328
path : `/v2/accounts/{accountId}/files` . replace (
305
329
`{${ "accountId" } }` ,
306
330
// @ts -ignore
307
- this . encodeParam ( "accountId" , params . accountId )
331
+ this . encodePathParam ( "accountId" , params . accountId )
308
332
) ,
309
333
method : "DELETE" ,
310
334
headers,
@@ -331,7 +355,7 @@ export class FileApi extends runtime.BaseAPI {
331
355
path : `/v2/accounts/{accountId}/files/batch` . replace (
332
356
`{${ "accountId" } }` ,
333
357
// @ts -ignore
334
- this . encodeParam ( "accountId" , params . accountId )
358
+ this . encodePathParam ( "accountId" , params . accountId )
335
359
) ,
336
360
method : "DELETE" ,
337
361
headers,
@@ -355,11 +379,15 @@ export class FileApi extends runtime.BaseAPI {
355
379
}
356
380
357
381
if ( params . cacheTtl !== undefined ) {
358
- query [ "cache_ttl " ] = params . cacheTtl ;
382
+ query [ "cache-ttl " ] = params . cacheTtl ;
359
383
}
360
384
361
385
if ( params . cacheTtl404 !== undefined ) {
362
- query [ "cache_ttl_404" ] = params . cacheTtl404 ;
386
+ query [ "cache-ttl-404" ] = params . cacheTtl404 ;
387
+ }
388
+
389
+ if ( params . exp !== undefined ) {
390
+ query [ "exp" ] = params . exp ;
363
391
}
364
392
365
393
if ( params . version !== undefined ) {
@@ -374,12 +402,12 @@ export class FileApi extends runtime.BaseAPI {
374
402
. replace (
375
403
`{${ "accountId" } }` ,
376
404
// @ts -ignore
377
- this . encodeParam ( "accountId" , params . accountId )
405
+ this . encodePathParam ( "accountId" , params . accountId )
378
406
)
379
407
. replace (
380
408
`{${ "filePath" } }` ,
381
409
// @ts -ignore
382
- this . encodeParam ( "filePath" , params . filePath )
410
+ this . encodePathParam ( "filePath" , params . filePath )
383
411
) ,
384
412
method : "GET" ,
385
413
headers,
@@ -408,7 +436,7 @@ export class FileApi extends runtime.BaseAPI {
408
436
path : `/v2/accounts/{accountId}/files/details` . replace (
409
437
`{${ "accountId" } }` ,
410
438
// @ts -ignore
411
- this . encodeParam ( "accountId" , params . accountId )
439
+ this . encodePathParam ( "accountId" , params . accountId )
412
440
) ,
413
441
method : "GET" ,
414
442
headers,
@@ -426,6 +454,10 @@ export class FileApi extends runtime.BaseAPI {
426
454
*/
427
455
async processFile ( params : ProcessFileParams ) : Promise < runtime . BinaryResult > {
428
456
const query : any = { } ;
457
+ if ( params . transformationParams !== undefined ) {
458
+ query [ "<transformation-params>" ] = params . transformationParams ;
459
+ }
460
+
429
461
if ( params . artifact !== undefined ) {
430
462
query [ "artifact" ] = params . artifact ;
431
463
}
@@ -435,23 +467,23 @@ export class FileApi extends runtime.BaseAPI {
435
467
}
436
468
437
469
if ( params . cacheOnly !== undefined ) {
438
- query [ "cache_only " ] = params . cacheOnly ;
470
+ query [ "cache-only " ] = params . cacheOnly ;
439
471
}
440
472
441
473
if ( params . cachePerm !== undefined ) {
442
- query [ "cache_perm " ] = params . cachePerm ;
474
+ query [ "cache-perm " ] = params . cachePerm ;
443
475
}
444
476
445
477
if ( params . cacheTtl !== undefined ) {
446
- query [ "cache_ttl " ] = params . cacheTtl ;
478
+ query [ "cache-ttl " ] = params . cacheTtl ;
447
479
}
448
480
449
481
if ( params . cacheTtl404 !== undefined ) {
450
- query [ "cache_ttl_404 " ] = params . cacheTtl404 ;
482
+ query [ "cache-ttl-404 " ] = params . cacheTtl404 ;
451
483
}
452
484
453
- if ( params . transformationParams !== undefined ) {
454
- query [ "transformationParams " ] = params . transformationParams ;
485
+ if ( params . exp !== undefined ) {
486
+ query [ "exp " ] = params . exp ;
455
487
}
456
488
457
489
if ( params . version !== undefined ) {
@@ -466,17 +498,17 @@ export class FileApi extends runtime.BaseAPI {
466
498
. replace (
467
499
`{${ "accountId" } }` ,
468
500
// @ts -ignore
469
- this . encodeParam ( "accountId" , params . accountId )
501
+ this . encodePathParam ( "accountId" , params . accountId )
470
502
)
471
503
. replace (
472
504
`{${ "filePath" } }` ,
473
505
// @ts -ignore
474
- this . encodeParam ( "filePath" , params . filePath )
506
+ this . encodePathParam ( "filePath" , params . filePath )
475
507
)
476
508
. replace (
477
509
`{${ "transformation" } }` ,
478
510
// @ts -ignore
479
- this . encodeParam ( "transformation" , params . transformation )
511
+ this . encodePathParam ( "transformation" , params . transformation )
480
512
) ,
481
513
method : "GET" ,
482
514
headers,
@@ -495,7 +527,7 @@ export class FileApi extends runtime.BaseAPI {
495
527
async processFileAndSave ( params : ProcessFileAndSaveOperationParams ) : Promise < ProcessFileAndSaveResponse > {
496
528
const query : any = { } ;
497
529
if ( params . transformationParams !== undefined ) {
498
- query [ "transformationParams " ] = params . transformationParams ;
530
+ query [ "<transformation-params> " ] = params . transformationParams ;
499
531
}
500
532
501
533
const headers : runtime . HTTPHeaders = { } ;
@@ -508,17 +540,17 @@ export class FileApi extends runtime.BaseAPI {
508
540
. replace (
509
541
`{${ "accountId" } }` ,
510
542
// @ts -ignore
511
- this . encodeParam ( "accountId" , params . accountId )
543
+ this . encodePathParam ( "accountId" , params . accountId )
512
544
)
513
545
. replace (
514
546
`{${ "filePath" } }` ,
515
547
// @ts -ignore
516
- this . encodeParam ( "filePath" , params . filePath )
548
+ this . encodePathParam ( "filePath" , params . filePath )
517
549
)
518
550
. replace (
519
551
`{${ "transformation" } }` ,
520
552
// @ts -ignore
521
- this . encodeParam ( "transformation" , params . transformation )
553
+ this . encodePathParam ( "transformation" , params . transformation )
522
554
) ,
523
555
method : "POST" ,
524
556
headers,
0 commit comments