@mastra/oracledb 0.2.4-alpha.0 → 0.3.0-alpha.0

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.
@@ -3,7 +3,7 @@ name: mastra-oracledb
3
3
  description: Documentation for @mastra/oracledb. Use when working with @mastra/oracledb APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/oracledb"
6
- version: "0.2.4-alpha.0"
6
+ version: "0.3.0-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.4-alpha.0",
2
+ "version": "0.3.0-alpha.0",
3
3
  "package": "@mastra/oracledb",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -5255,6 +5255,36 @@ async function deleteThread(ctx, { threadId }) {
5255
5255
  throw storageError$1("DELETE_THREAD", "FAILED", { threadId }, error);
5256
5256
  }
5257
5257
  }
5258
+ async function updateThreadResourceId(ctx, { threadId, resourceId }) {
5259
+ try {
5260
+ return await ctx.db.tx(async (client) => {
5261
+ const row = await client.oneOrNone(`${threadSelect()} FROM ${table(ctx, _mastra_core_storage.TABLE_THREADS)} WHERE id = :threadId FOR UPDATE`, { threadId });
5262
+ if (!row) throw new Error(`Thread "${threadId}" not found`);
5263
+ const normalized = parseThread(row);
5264
+ if (normalized.resourceId === resourceId) return normalized;
5265
+ const updatedAt = /* @__PURE__ */ new Date();
5266
+ await client.none(`UPDATE ${table(ctx, _mastra_core_storage.TABLE_THREADS)} SET ${THREAD_RESOURCE_ID} = :resourceId, ${THREAD_UPDATED_AT} = :updatedAt WHERE id = :threadId`, {
5267
+ resourceId,
5268
+ updatedAt,
5269
+ threadId
5270
+ });
5271
+ await client.none(`UPDATE ${table(ctx, _mastra_core_storage.TABLE_MESSAGES)} SET ${MESSAGE_RESOURCE_ID} = :resourceId WHERE thread_id = :threadId`, {
5272
+ resourceId,
5273
+ threadId
5274
+ });
5275
+ return {
5276
+ ...normalized,
5277
+ resourceId,
5278
+ updatedAt
5279
+ };
5280
+ });
5281
+ } catch (error) {
5282
+ throw storageError$1("UPDATE_THREAD_RESOURCE_ID", "FAILED", {
5283
+ threadId,
5284
+ resourceId
5285
+ }, error);
5286
+ }
5287
+ }
5258
5288
  async function listThreads(ctx, args) {
5259
5289
  const { page = 0, perPage: perPageInput, orderBy, filter } = args;
5260
5290
  try {
@@ -5403,6 +5433,9 @@ var MemoryOracle = class MemoryOracle extends _mastra_core_storage.MemoryStorage
5403
5433
  async deleteThread(args) {
5404
5434
  return deleteThread(this.ctx, args);
5405
5435
  }
5436
+ async updateThreadResourceId(args) {
5437
+ return updateThreadResourceId(this.ctx, args);
5438
+ }
5406
5439
  async listThreads(args) {
5407
5440
  return listThreads(this.ctx, args);
5408
5441
  }