@mastra/mssql 1.0.0-beta.4 → 1.0.0-beta.5

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
@@ -2340,13 +2340,21 @@ var ScoresMSSQL = class extends ScoresStorage {
2340
2340
  {
2341
2341
  id: createStorageErrorId("MSSQL", "SAVE_SCORE", "VALIDATION_FAILED"),
2342
2342
  domain: ErrorDomain.STORAGE,
2343
- category: ErrorCategory.THIRD_PARTY
2343
+ category: ErrorCategory.USER,
2344
+ details: {
2345
+ scorer: score.scorer?.id ?? "unknown",
2346
+ entityId: score.entityId ?? "unknown",
2347
+ entityType: score.entityType ?? "unknown",
2348
+ traceId: score.traceId ?? "",
2349
+ spanId: score.spanId ?? ""
2350
+ }
2344
2351
  },
2345
2352
  error
2346
2353
  );
2347
2354
  }
2348
2355
  try {
2349
2356
  const scoreId = randomUUID();
2357
+ const now = /* @__PURE__ */ new Date();
2350
2358
  const {
2351
2359
  scorer,
2352
2360
  preprocessStepResult,
@@ -2373,12 +2381,11 @@ var ScoresMSSQL = class extends ScoresStorage {
2373
2381
  requestContext: requestContext || null,
2374
2382
  entity: entity || null,
2375
2383
  scorer: scorer || null,
2376
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
2377
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
2384
+ createdAt: now.toISOString(),
2385
+ updatedAt: now.toISOString()
2378
2386
  }
2379
2387
  });
2380
- const scoreFromDb = await this.getScoreById({ id: scoreId });
2381
- return { score: scoreFromDb };
2388
+ return { score: { ...validatedScore, id: scoreId, createdAt: now, updatedAt: now } };
2382
2389
  } catch (error) {
2383
2390
  throw new MastraError(
2384
2391
  {
@@ -3302,8 +3309,8 @@ var MSSQLStore = class extends MastraStorage {
3302
3309
  source: _source
3303
3310
  });
3304
3311
  }
3305
- async saveScore(_score) {
3306
- return this.stores.scores.saveScore(_score);
3312
+ async saveScore(score) {
3313
+ return this.stores.scores.saveScore(score);
3307
3314
  }
3308
3315
  async listScoresByRunId({
3309
3316
  runId: _runId,