@discomedia/utils 1.0.17 → 1.0.18

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.cjs CHANGED
@@ -2281,7 +2281,7 @@ const safeJSON = (text) => {
2281
2281
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2282
2282
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
2283
2283
 
2284
- const VERSION = '5.9.0'; // x-release-please-version
2284
+ const VERSION = '5.10.1'; // x-release-please-version
2285
2285
 
2286
2286
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2287
2287
  const isRunningInBrowser = () => {
@@ -3138,6 +3138,8 @@ class Stream {
3138
3138
  }
3139
3139
  if (sse.event === null ||
3140
3140
  sse.event.startsWith('response.') ||
3141
+ sse.event.startsWith('image_edit.') ||
3142
+ sse.event.startsWith('image_generation.') ||
3141
3143
  sse.event.startsWith('transcript.')) {
3142
3144
  let data;
3143
3145
  try {
@@ -7241,34 +7243,11 @@ class Images extends APIResource {
7241
7243
  createVariation(body, options) {
7242
7244
  return this._client.post('/images/variations', multipartFormRequestOptions({ body, ...options }, this._client));
7243
7245
  }
7244
- /**
7245
- * Creates an edited or extended image given one or more source images and a
7246
- * prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`.
7247
- *
7248
- * @example
7249
- * ```ts
7250
- * const imagesResponse = await client.images.edit({
7251
- * image: fs.createReadStream('path/to/file'),
7252
- * prompt: 'A cute baby sea otter wearing a beret',
7253
- * });
7254
- * ```
7255
- */
7256
7246
  edit(body, options) {
7257
- return this._client.post('/images/edits', multipartFormRequestOptions({ body, ...options }, this._client));
7247
+ return this._client.post('/images/edits', multipartFormRequestOptions({ body, ...options, stream: body.stream ?? false }, this._client));
7258
7248
  }
7259
- /**
7260
- * Creates an image given a prompt.
7261
- * [Learn more](https://platform.openai.com/docs/guides/images).
7262
- *
7263
- * @example
7264
- * ```ts
7265
- * const imagesResponse = await client.images.generate({
7266
- * prompt: 'A cute baby sea otter',
7267
- * });
7268
- * ```
7269
- */
7270
7249
  generate(body, options) {
7271
- return this._client.post('/images/generations', { body, ...options });
7250
+ return this._client.post('/images/generations', { body, ...options, stream: body.stream ?? false });
7272
7251
  }
7273
7252
  }
7274
7253