@mastra/dynamodb 1.0.0-beta.8 → 1.0.0-beta.9
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/CHANGELOG.md +49 -0
- package/dist/docs/README.md +31 -0
- package/dist/docs/SKILL.md +32 -0
- package/dist/docs/SOURCE_MAP.json +6 -0
- package/dist/docs/storage/01-reference.md +162 -0
- package/dist/index.cjs +5 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -16
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DynamoDBClient, DescribeTableCommand } from '@aws-sdk/client-dynamodb';
|
|
2
2
|
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
|
|
3
3
|
import { MastraError, ErrorCategory, ErrorDomain } from '@mastra/core/error';
|
|
4
|
-
import { MemoryStorage, createStorageErrorId, normalizePerPage, calculatePagination, ScoresStorage, SCORERS_SCHEMA, WorkflowsStorage, MastraStorage, TABLE_SCORERS, TABLE_WORKFLOW_SNAPSHOT, TABLE_RESOURCES, TABLE_MESSAGES, TABLE_THREADS } from '@mastra/core/storage';
|
|
4
|
+
import { MemoryStorage, createStorageErrorId, normalizePerPage, calculatePagination, filterByDateRange, ScoresStorage, SCORERS_SCHEMA, WorkflowsStorage, MastraStorage, TABLE_SCORERS, TABLE_WORKFLOW_SNAPSHOT, TABLE_RESOURCES, TABLE_MESSAGES, TABLE_THREADS } from '@mastra/core/storage';
|
|
5
5
|
import { Entity, Service } from 'electrodb';
|
|
6
6
|
import { MessageList } from '@mastra/core/agent';
|
|
7
7
|
import { saveScorePayloadSchema } from '@mastra/core/evals';
|
|
@@ -1277,21 +1277,11 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
|
|
|
1277
1277
|
if (resourceId) {
|
|
1278
1278
|
allThreadMessages = allThreadMessages.filter((msg) => msg.resourceId === resourceId);
|
|
1279
1279
|
}
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
const startTime = dateRange.start instanceof Date ? dateRange.start.getTime() : new Date(dateRange.start).getTime();
|
|
1286
|
-
if (createdAt < startTime) return false;
|
|
1287
|
-
}
|
|
1288
|
-
if (dateRange.end) {
|
|
1289
|
-
const endTime = dateRange.end instanceof Date ? dateRange.end.getTime() : new Date(dateRange.end).getTime();
|
|
1290
|
-
if (createdAt > endTime) return false;
|
|
1291
|
-
}
|
|
1292
|
-
return true;
|
|
1293
|
-
});
|
|
1294
|
-
}
|
|
1280
|
+
allThreadMessages = filterByDateRange(
|
|
1281
|
+
allThreadMessages,
|
|
1282
|
+
(msg) => new Date(msg.createdAt),
|
|
1283
|
+
filter?.dateRange
|
|
1284
|
+
);
|
|
1295
1285
|
allThreadMessages.sort((a, b) => {
|
|
1296
1286
|
const aValue = field === "createdAt" ? new Date(a.createdAt).getTime() : a[field];
|
|
1297
1287
|
const bValue = field === "createdAt" ? new Date(b.createdAt).getTime() : b[field];
|