@mastra/oracledb 0.2.0 → 0.2.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
@@ -2,7 +2,7 @@ import { MastraVector, validateTopK, validateUpsertInput } from '@mastra/core/ve
2
2
  import oracledb from 'oracledb';
3
3
  import { ErrorCategory, MastraError, ErrorDomain } from '@mastra/core/error';
4
4
  import { randomUUID, createHash } from 'crypto';
5
- import { TABLE_WORKFLOW_SNAPSHOT, TABLE_OBSERVATIONAL_MEMORY, TABLE_RESOURCES, TABLE_MESSAGES, TABLE_THREADS, TABLE_SCHEMAS, TABLE_AGENT_VERSIONS, TABLE_SPANS, AgentsStorage, TABLE_AGENTS, normalizePerPage, calculatePagination, MCPClientsStorage, TABLE_MCP_CLIENTS, TABLE_MCP_CLIENT_VERSIONS, MemoryStorage, ObservabilityStorage, ScorerDefinitionsStorage, TABLE_SCORER_DEFINITIONS, TABLE_SCORER_DEFINITION_VERSIONS, ScoresStorage, TABLE_SCORERS, WorkflowsStorage, MastraCompositeStore, createStorageErrorId, createVectorErrorId, listLogsArgsSchema, listScoresArgsSchema, listTracesArgsSchema, toTraceSpans, transformScoreRow as transformScoreRow$1, validateStorageMetadataFilter, storageMessageMatchesMetadataFilter, TraceStatus } from '@mastra/core/storage';
5
+ import { TABLE_WORKFLOW_SNAPSHOT, TABLE_OBSERVATIONAL_MEMORY, TABLE_RESOURCES, TABLE_MESSAGES, TABLE_THREADS, TABLE_SCHEMAS, TABLE_AGENT_VERSIONS, TABLE_SPANS, AgentsStorage, TABLE_AGENTS, normalizePerPage, calculatePagination, MCPClientsStorage, TABLE_MCP_CLIENTS, TABLE_MCP_CLIENT_VERSIONS, MemoryStorage, ObservabilityStorage, ScorerDefinitionsStorage, TABLE_SCORER_DEFINITIONS, TABLE_SCORER_DEFINITION_VERSIONS, ScoresStorage, TABLE_SCORERS, WorkflowsStorage, matchesExpectedWorkflowStatus, MastraCompositeStore, createStorageErrorId, createVectorErrorId, listLogsArgsSchema, listScoresArgsSchema, listTracesArgsSchema, toTraceSpans, transformScoreRow as transformScoreRow$1, validateStorageMetadataFilter, storageMessageMatchesMetadataFilter, TraceStatus } from '@mastra/core/storage';
6
6
  import { MessageList } from '@mastra/core/agent';
7
7
  import { saveScorePayloadSchema } from '@mastra/core/evals';
8
8
 
@@ -8954,7 +8954,11 @@ var WorkflowsOracle = class _WorkflowsOracle extends WorkflowsStorage {
8954
8954
  if (!snapshot?.context) {
8955
8955
  throw new Error(`Snapshot not found for runId ${runId}`);
8956
8956
  }
8957
- const updatedSnapshot = { ...snapshot, ...opts };
8957
+ const { expectedStatus, ...state } = opts;
8958
+ if (!matchesExpectedWorkflowStatus(snapshot.status, expectedStatus)) {
8959
+ return void 0;
8960
+ }
8961
+ const updatedSnapshot = { ...snapshot, ...state };
8958
8962
  await client.none(
8959
8963
  `UPDATE ${this.table()} SET snapshot = :snapshot, ${WORKFLOW_UPDATED_AT} = :updatedAt WHERE workflow_name = :workflowName AND run_id = :runId`,
8960
8964
  { workflowName, runId, snapshot: jsonBind(updatedSnapshot), updatedAt: /* @__PURE__ */ new Date() }