@mastra/clickhouse 1.30.0-alpha.0 → 1.30.0-alpha.1

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.js CHANGED
@@ -5178,6 +5178,13 @@ async function hasFeedbackDeletionRequest(client, feedbackId, organizationId, re
5178
5178
  resourceId: resourceId ?? ""
5179
5179
  }, FINAL_SKIP_INDEX_SETTINGS)).length > 0;
5180
5180
  }
5181
+ /** Retrieves the latest feedback record with this ID, or null when missing. */
5182
+ async function getFeedbackById(client, feedbackId) {
5183
+ const rows = await queryJson$2(client, `SELECT * FROM ${TABLE_FEEDBACK_EVENTS} FINAL
5184
+ WHERE feedbackId = {feedbackId:String}
5185
+ ORDER BY writeVersion DESC, timestamp DESC LIMIT 1`, { feedbackId }, FINAL_SKIP_INDEX_SETTINGS);
5186
+ return rows[0] ? rowToFeedbackRecord(rows[0]) : null;
5187
+ }
5181
5188
  /**
5182
5189
  * Review updates insert a replacement row, so they need only `INSERT` and the
5183
5190
  * insert materialized view publishes the delta cursor.
@@ -10843,6 +10850,19 @@ var ObservabilityStorageClickhouseVNext = class extends ObservabilityStorage {
10843
10850
  }, error);
10844
10851
  }
10845
10852
  }
10853
+ async getFeedbackById(feedbackId) {
10854
+ try {
10855
+ return await getFeedbackById(this.#client, feedbackId);
10856
+ } catch (error) {
10857
+ if (error instanceof MastraError) throw error;
10858
+ throw new MastraError({
10859
+ id: createStorageErrorId("CLICKHOUSE", "GET_FEEDBACK_BY_ID", "FAILED"),
10860
+ domain: ErrorDomain.STORAGE,
10861
+ category: ErrorCategory.THIRD_PARTY,
10862
+ details: { feedbackId }
10863
+ }, error);
10864
+ }
10865
+ }
10846
10866
  async createFeedback(args) {
10847
10867
  try {
10848
10868
  await createFeedback(this.#client, args);