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