@mastra/pg 1.8.4-alpha.2 → 1.8.4

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
@@ -4330,6 +4330,7 @@ var DatasetsPG = class _DatasetsPG extends DatasetsStorage {
4330
4330
  await this.#addColumnIfNotExists(TABLE_DATASETS, "tags", "JSONB");
4331
4331
  await this.#addColumnIfNotExists(TABLE_DATASETS, "targetType", "TEXT");
4332
4332
  await this.#addColumnIfNotExists(TABLE_DATASETS, "targetIds", "JSONB");
4333
+ await this.#addColumnIfNotExists(TABLE_DATASETS, "scorerIds", "JSONB");
4333
4334
  await this.#addColumnIfNotExists(TABLE_DATASET_ITEMS, "requestContext", "JSONB");
4334
4335
  await this.#addColumnIfNotExists(TABLE_DATASET_ITEMS, "source", "JSONB");
4335
4336
  await this.createDefaultIndexes();
@@ -4401,6 +4402,7 @@ var DatasetsPG = class _DatasetsPG extends DatasetsStorage {
4401
4402
  tags: row.tags ? safelyParseJSON(row.tags) : void 0,
4402
4403
  targetType: row.targetType || null,
4403
4404
  targetIds: row.targetIds || null,
4405
+ scorerIds: row.scorerIds || null,
4404
4406
  version: row.version,
4405
4407
  createdAt: ensureDate(row.createdAtZ || row.createdAt),
4406
4408
  updatedAt: ensureDate(row.updatedAtZ || row.updatedAt)
@@ -4462,6 +4464,7 @@ var DatasetsPG = class _DatasetsPG extends DatasetsStorage {
4462
4464
  requestContextSchema: input.requestContextSchema ?? null,
4463
4465
  targetType: input.targetType ?? null,
4464
4466
  targetIds: input.targetIds !== void 0 ? JSON.stringify(input.targetIds) : null,
4467
+ scorerIds: input.scorerIds ? JSON.stringify(input.scorerIds) : null,
4465
4468
  version: 0,
4466
4469
  createdAt: nowIso,
4467
4470
  updatedAt: nowIso
@@ -4477,6 +4480,7 @@ var DatasetsPG = class _DatasetsPG extends DatasetsStorage {
4477
4480
  requestContextSchema: input.requestContextSchema ?? void 0,
4478
4481
  targetType: input.targetType ?? null,
4479
4482
  targetIds: input.targetIds ?? null,
4483
+ scorerIds: input.scorerIds ?? null,
4480
4484
  version: 0,
4481
4485
  createdAt: now,
4482
4486
  updatedAt: now
@@ -4560,6 +4564,10 @@ var DatasetsPG = class _DatasetsPG extends DatasetsStorage {
4560
4564
  setClauses.push(`"targetIds" = $${paramIndex++}`);
4561
4565
  values.push(args.targetIds === null ? null : JSON.stringify(args.targetIds));
4562
4566
  }
4567
+ if (args.scorerIds !== void 0) {
4568
+ setClauses.push(`"scorerIds" = $${paramIndex++}`);
4569
+ values.push(args.scorerIds === null ? null : JSON.stringify(args.scorerIds));
4570
+ }
4563
4571
  values.push(args.id);
4564
4572
  await this.#db.client.none(
4565
4573
  `UPDATE ${tableName} SET ${setClauses.join(", ")} WHERE "id" = $${paramIndex}`,
@@ -4576,6 +4584,7 @@ var DatasetsPG = class _DatasetsPG extends DatasetsStorage {
4576
4584
  tags: (args.tags !== void 0 ? args.tags : existing.tags) ?? void 0,
4577
4585
  targetType: (args.targetType !== void 0 ? args.targetType : existing.targetType) ?? null,
4578
4586
  targetIds: (args.targetIds !== void 0 ? args.targetIds : existing.targetIds) ?? null,
4587
+ scorerIds: (args.scorerIds !== void 0 ? args.scorerIds : existing.scorerIds) ?? null,
4579
4588
  updatedAt: new Date(now)
4580
4589
  };
4581
4590
  } catch (error) {
@@ -12395,7 +12404,7 @@ function getTableName5({ indexName, schemaName }) {
12395
12404
  return schemaName ? `${schemaName}.${quotedIndexName}` : quotedIndexName;
12396
12405
  }
12397
12406
  function sanitizeJsonForPg(jsonString) {
12398
- return jsonString.replace(/\\u(0000|[Dd][89A-Fa-f][0-9A-Fa-f]{2})/g, "");
12407
+ return jsonString.replace(/(^|[^\\])(\\(?!["\\/bfnrtu]))/g, "$1\\\\").replace(/\\u(0000|[Dd][89A-Fa-f][0-9A-Fa-f]{2})/g, "");
12399
12408
  }
12400
12409
  var WorkflowsPG = class _WorkflowsPG extends WorkflowsStorage {
12401
12410
  #db;