@discomedia/utils 1.0.35 → 1.0.36

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
@@ -774,6 +774,22 @@ function getNYTimeZone(date) {
774
774
  const offset = getNYOffset(date || new Date());
775
775
  return offset === -4 ? '-04:00' : '-05:00';
776
776
  }
777
+ /**
778
+ * Converts any date to the market time zone (America/New_York, Eastern Time).
779
+ * Returns a new Date object representing the same moment in time but adjusted to NY/Eastern timezone.
780
+ * Automatically handles daylight saving time transitions (EST/EDT).
781
+ *
782
+ * @param date - Date object to convert to market time zone
783
+ * @returns Date object in NY/Eastern time zone
784
+ * @example
785
+ * ```typescript
786
+ * const utcDate = new Date('2024-01-15T15:30:00Z'); // 3:30 PM UTC
787
+ * const nyDate = convertDateToMarketTimeZone(utcDate); // 10:30 AM EST (winter) or 11:30 AM EDT (summer)
788
+ * ```
789
+ */
790
+ function convertDateToMarketTimeZone(date) {
791
+ return toNYTime(date);
792
+ }
777
793
  /**
778
794
  * Returns the current market status for a given date.
779
795
  * @param options - { date?: Date }
@@ -2395,7 +2411,7 @@ const safeJSON = (text) => {
2395
2411
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2396
2412
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
2397
2413
 
2398
- const VERSION = '5.22.0'; // x-release-please-version
2414
+ const VERSION = '5.23.1'; // x-release-please-version
2399
2415
 
2400
2416
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2401
2417
  const isRunningInBrowser = () => {
@@ -6902,23 +6918,23 @@ class Conversations extends APIResource {
6902
6918
  /**
6903
6919
  * Create a conversation.
6904
6920
  */
6905
- create(body, options) {
6921
+ create(body = {}, options) {
6906
6922
  return this._client.post('/conversations', { body, ...options });
6907
6923
  }
6908
6924
  /**
6909
- * Get a conversation with the given ID.
6925
+ * Get a conversation
6910
6926
  */
6911
6927
  retrieve(conversationID, options) {
6912
6928
  return this._client.get(path `/conversations/${conversationID}`, options);
6913
6929
  }
6914
6930
  /**
6915
- * Update a conversation's metadata with the given ID.
6931
+ * Update a conversation
6916
6932
  */
6917
6933
  update(conversationID, body, options) {
6918
6934
  return this._client.post(path `/conversations/${conversationID}`, { body, ...options });
6919
6935
  }
6920
6936
  /**
6921
- * Delete a conversation with the given ID.
6937
+ * Delete a conversation. Items in the conversation will not be deleted.
6922
6938
  */
6923
6939
  delete(conversationID, options) {
6924
6940
  return this._client.delete(path `/conversations/${conversationID}`, options);
@@ -18981,6 +18997,7 @@ const disco = {
18981
18997
  calculateFibonacciLevels: calculateFibonacciLevels,
18982
18998
  },
18983
18999
  time: {
19000
+ convertDateToMarketTimeZone: convertDateToMarketTimeZone,
18984
19001
  getStartAndEndDates: getStartAndEndDates,
18985
19002
  getMarketOpenClose: getMarketOpenClose,
18986
19003
  getLastFullTradingDate: getLastFullTradingDate,