@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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.0.35",
6
+ "version": "1.0.36",
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.2.2",
36
- "openai": "^5.22.0",
36
+ "openai": "^5.23.1",
37
37
  "p-limit": "^7.1.1",
38
38
  "tslib": "^2.8.1",
39
39
  "ws": "^8.18.3"
@@ -46,7 +46,7 @@
46
46
  "@rollup/plugin-typescript": "^12.1.4",
47
47
  "@types/ws": "^8.18.1",
48
48
  "lightweight-charts": "^5.0.8",
49
- "rollup": "^4.52.0",
49
+ "rollup": "^4.52.2",
50
50
  "typescript": "^5.9.2"
51
51
  }
52
52
  }
package/dist/test.js CHANGED
@@ -772,6 +772,22 @@ function getNYTimeZone(date) {
772
772
  const offset = getNYOffset(date || new Date());
773
773
  return offset === -4 ? '-04:00' : '-05:00';
774
774
  }
775
+ /**
776
+ * Converts any date to the market time zone (America/New_York, Eastern Time).
777
+ * Returns a new Date object representing the same moment in time but adjusted to NY/Eastern timezone.
778
+ * Automatically handles daylight saving time transitions (EST/EDT).
779
+ *
780
+ * @param date - Date object to convert to market time zone
781
+ * @returns Date object in NY/Eastern time zone
782
+ * @example
783
+ * ```typescript
784
+ * const utcDate = new Date('2024-01-15T15:30:00Z'); // 3:30 PM UTC
785
+ * const nyDate = convertDateToMarketTimeZone(utcDate); // 10:30 AM EST (winter) or 11:30 AM EDT (summer)
786
+ * ```
787
+ */
788
+ function convertDateToMarketTimeZone(date) {
789
+ return toNYTime(date);
790
+ }
775
791
  /**
776
792
  * Returns the current market status for a given date.
777
793
  * @param options - { date?: Date }
@@ -2393,7 +2409,7 @@ const safeJSON = (text) => {
2393
2409
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2394
2410
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
2395
2411
 
2396
- const VERSION = '5.22.0'; // x-release-please-version
2412
+ const VERSION = '5.23.1'; // x-release-please-version
2397
2413
 
2398
2414
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2399
2415
  const isRunningInBrowser = () => {
@@ -6900,23 +6916,23 @@ class Conversations extends APIResource {
6900
6916
  /**
6901
6917
  * Create a conversation.
6902
6918
  */
6903
- create(body, options) {
6919
+ create(body = {}, options) {
6904
6920
  return this._client.post('/conversations', { body, ...options });
6905
6921
  }
6906
6922
  /**
6907
- * Get a conversation with the given ID.
6923
+ * Get a conversation
6908
6924
  */
6909
6925
  retrieve(conversationID, options) {
6910
6926
  return this._client.get(path `/conversations/${conversationID}`, options);
6911
6927
  }
6912
6928
  /**
6913
- * Update a conversation's metadata with the given ID.
6929
+ * Update a conversation
6914
6930
  */
6915
6931
  update(conversationID, body, options) {
6916
6932
  return this._client.post(path `/conversations/${conversationID}`, { body, ...options });
6917
6933
  }
6918
6934
  /**
6919
- * Delete a conversation with the given ID.
6935
+ * Delete a conversation. Items in the conversation will not be deleted.
6920
6936
  */
6921
6937
  delete(conversationID, options) {
6922
6938
  return this._client.delete(path `/conversations/${conversationID}`, options);
@@ -18984,6 +19000,7 @@ const disco = {
18984
19000
  calculateFibonacciLevels: calculateFibonacciLevels,
18985
19001
  },
18986
19002
  time: {
19003
+ convertDateToMarketTimeZone: convertDateToMarketTimeZone,
18987
19004
  getStartAndEndDates: getStartAndEndDates,
18988
19005
  getMarketOpenClose: getMarketOpenClose,
18989
19006
  getLastFullTradingDate: getLastFullTradingDate,