wavespeed 0.0.10 → 0.0.12

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.ts CHANGED
@@ -29,6 +29,7 @@ export interface RequestOptions extends RequestInit {
29
29
  maxRetries?: number;
30
30
  webhook?: string;
31
31
  isUpload?: boolean;
32
+ filename?: string;
32
33
  }
33
34
  /**
34
35
  * Prediction model representing an image generation job
package/dist/index.js CHANGED
@@ -238,11 +238,19 @@ class WaveSpeed {
238
238
  */
239
239
  async upload(file, options) {
240
240
  const form = new FormData();
241
- form.append('file', file);
241
+ if (options === null || options === void 0 ? void 0 : options.filename) {
242
+ form.append('file', file, options.filename);
243
+ }
244
+ else {
245
+ form.append('file', file);
246
+ }
242
247
  // Only set Authorization header; browser will set Content-Type
243
248
  if (options == null) {
244
249
  options = { isUpload: true };
245
250
  }
251
+ else {
252
+ options.isUpload = true;
253
+ }
246
254
  const response = await this.fetchWithTimeout('media/upload/binary', {
247
255
  method: 'POST',
248
256
  body: form,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wavespeed",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "WaveSpeed Client SDK for Wavespeed API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",