@discomedia/utils 1.0.76 → 1.0.77

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.0.76",
6
+ "version": "1.0.77",
7
7
  "author": "Disco Media",
8
8
  "description": "Utility functions used in Disco Media apps",
9
9
  "always-build-npm": true,
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "dotenv": "^17.4.2",
36
- "openai": "^6.41.0",
36
+ "openai": "^6.44.0",
37
37
  "p-limit": "^7.3.0",
38
38
  "tslib": "^2.8.1",
39
39
  "ws": "^8.21.0",
@@ -47,7 +47,7 @@
47
47
  "@rollup/plugin-typescript": "^12.3.0",
48
48
  "@types/ws": "^8.18.1",
49
49
  "lightweight-charts": "^5.2.0",
50
- "rollup": "^4.61.0",
50
+ "rollup": "^4.62.2",
51
51
  "typescript": "^6.0.3"
52
52
  }
53
53
  }
package/dist/test.js CHANGED
@@ -648,7 +648,7 @@ const safeJSON = (text) => {
648
648
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
649
649
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
650
650
 
651
- const VERSION = '6.41.0'; // x-release-please-version
651
+ const VERSION = '6.44.0'; // x-release-please-version
652
652
 
653
653
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
654
654
  const isRunningInBrowser = () => {
@@ -3020,7 +3020,12 @@ _AbstractChatCompletionRunner_instances = new WeakSet(), _AbstractChatCompletion
3020
3020
  for (let i = this.messages.length - 1; i >= 0; i--) {
3021
3021
  const message = this.messages[i];
3022
3022
  if (isAssistantMessage(message) && message?.tool_calls?.length) {
3023
- return message.tool_calls.filter((x) => x.type === 'function').at(-1)?.function;
3023
+ for (let j = message.tool_calls.length - 1; j >= 0; j--) {
3024
+ const toolCall = message.tool_calls[j];
3025
+ if (toolCall?.type === 'function') {
3026
+ return toolCall.function;
3027
+ }
3028
+ }
3024
3029
  }
3025
3030
  }
3026
3031
  return;
@@ -4398,6 +4403,23 @@ let SpendAlerts$1 = class SpendAlerts extends APIResource {
4398
4403
  __security: { adminAPIKeyAuth: true },
4399
4404
  });
4400
4405
  }
4406
+ /**
4407
+ * Retrieves an organization spend alert.
4408
+ *
4409
+ * @example
4410
+ * ```ts
4411
+ * const organizationSpendAlert =
4412
+ * await client.admin.organization.spendAlerts.retrieve(
4413
+ * 'alert_id',
4414
+ * );
4415
+ * ```
4416
+ */
4417
+ retrieve(alertID, options) {
4418
+ return this._client.get(path `/organization/spend_alerts/${alertID}`, {
4419
+ ...options,
4420
+ __security: { adminAPIKeyAuth: true },
4421
+ });
4422
+ }
4401
4423
  /**
4402
4424
  * Updates an organization spend alert.
4403
4425
  *
@@ -5429,6 +5451,25 @@ class SpendAlerts extends APIResource {
5429
5451
  __security: { adminAPIKeyAuth: true },
5430
5452
  });
5431
5453
  }
5454
+ /**
5455
+ * Retrieves a project spend alert.
5456
+ *
5457
+ * @example
5458
+ * ```ts
5459
+ * const projectSpendAlert =
5460
+ * await client.admin.organization.projects.spendAlerts.retrieve(
5461
+ * 'alert_id',
5462
+ * { project_id: 'project_id' },
5463
+ * );
5464
+ * ```
5465
+ */
5466
+ retrieve(alertID, params, options) {
5467
+ const { project_id } = params;
5468
+ return this._client.get(path `/organization/projects/${project_id}/spend_alerts/${alertID}`, {
5469
+ ...options,
5470
+ __security: { adminAPIKeyAuth: true },
5471
+ });
5472
+ }
5432
5473
  /**
5433
5474
  * Updates a project spend alert.
5434
5475
  *