@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/index.mjs CHANGED
@@ -1701,7 +1701,7 @@ const safeJSON = (text) => {
1701
1701
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1702
1702
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
1703
1703
 
1704
- const VERSION = '6.41.0'; // x-release-please-version
1704
+ const VERSION = '6.44.0'; // x-release-please-version
1705
1705
 
1706
1706
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1707
1707
  const isRunningInBrowser = () => {
@@ -4087,7 +4087,12 @@ _AbstractChatCompletionRunner_instances = new WeakSet(), _AbstractChatCompletion
4087
4087
  for (let i = this.messages.length - 1; i >= 0; i--) {
4088
4088
  const message = this.messages[i];
4089
4089
  if (isAssistantMessage(message) && message?.tool_calls?.length) {
4090
- return message.tool_calls.filter((x) => x.type === 'function').at(-1)?.function;
4090
+ for (let j = message.tool_calls.length - 1; j >= 0; j--) {
4091
+ const toolCall = message.tool_calls[j];
4092
+ if (toolCall?.type === 'function') {
4093
+ return toolCall.function;
4094
+ }
4095
+ }
4091
4096
  }
4092
4097
  }
4093
4098
  return;
@@ -5465,6 +5470,23 @@ let SpendAlerts$1 = class SpendAlerts extends APIResource {
5465
5470
  __security: { adminAPIKeyAuth: true },
5466
5471
  });
5467
5472
  }
5473
+ /**
5474
+ * Retrieves an organization spend alert.
5475
+ *
5476
+ * @example
5477
+ * ```ts
5478
+ * const organizationSpendAlert =
5479
+ * await client.admin.organization.spendAlerts.retrieve(
5480
+ * 'alert_id',
5481
+ * );
5482
+ * ```
5483
+ */
5484
+ retrieve(alertID, options) {
5485
+ return this._client.get(path `/organization/spend_alerts/${alertID}`, {
5486
+ ...options,
5487
+ __security: { adminAPIKeyAuth: true },
5488
+ });
5489
+ }
5468
5490
  /**
5469
5491
  * Updates an organization spend alert.
5470
5492
  *
@@ -6496,6 +6518,25 @@ class SpendAlerts extends APIResource {
6496
6518
  __security: { adminAPIKeyAuth: true },
6497
6519
  });
6498
6520
  }
6521
+ /**
6522
+ * Retrieves a project spend alert.
6523
+ *
6524
+ * @example
6525
+ * ```ts
6526
+ * const projectSpendAlert =
6527
+ * await client.admin.organization.projects.spendAlerts.retrieve(
6528
+ * 'alert_id',
6529
+ * { project_id: 'project_id' },
6530
+ * );
6531
+ * ```
6532
+ */
6533
+ retrieve(alertID, params, options) {
6534
+ const { project_id } = params;
6535
+ return this._client.get(path `/organization/projects/${project_id}/spend_alerts/${alertID}`, {
6536
+ ...options,
6537
+ __security: { adminAPIKeyAuth: true },
6538
+ });
6539
+ }
6499
6540
  /**
6500
6541
  * Updates a project spend alert.
6501
6542
  *