@mastra/mongodb 0.13.0-alpha.0 → 0.13.0-alpha.2
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js.map +1 -1
- package/dist/storage/MongoDBConnector.d.ts +2 -2
- package/dist/storage/connectors/MongoDBConnector.d.ts +2 -2
- package/dist/storage/domains/legacy-evals/index.d.ts +1 -1
- package/dist/storage/domains/memory/index.d.ts +1 -1
- package/dist/storage/domains/operations/index.d.ts +1 -1
- package/dist/storage/domains/scores/index.d.ts +1 -1
- package/dist/storage/domains/traces/index.d.ts +1 -1
- package/dist/storage/domains/workflows/index.d.ts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/types.d.ts +1 -1
- package/dist/vector/index.d.ts +1 -1
- package/package.json +5 -4
- package/src/storage/domains/traces/index.ts +5 -5
- package/tsup.config.ts +2 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MongoClient } from 'mongodb';
|
|
2
|
-
import type { ConnectorHandler } from './connectors/base';
|
|
3
|
-
import type { DatabaseConfig } from './types';
|
|
2
|
+
import type { ConnectorHandler } from './connectors/base.js';
|
|
3
|
+
import type { DatabaseConfig } from './types.js';
|
|
4
4
|
type MongoDBConnectorOptions = {
|
|
5
5
|
client: MongoClient;
|
|
6
6
|
dbName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MongoClient } from 'mongodb';
|
|
2
|
-
import type { DatabaseConfig } from '../types';
|
|
3
|
-
import type { ConnectorHandler } from './base';
|
|
2
|
+
import type { DatabaseConfig } from '../types.js';
|
|
3
|
+
import type { ConnectorHandler } from './base.js';
|
|
4
4
|
type MongoDBConnectorOptions = {
|
|
5
5
|
client: MongoClient;
|
|
6
6
|
dbName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LegacyEvalsStorage } from '@mastra/core/storage';
|
|
2
2
|
import type { PaginationArgs, PaginationInfo, EvalRow } from '@mastra/core/storage';
|
|
3
|
-
import type { StoreOperationsMongoDB } from '../operations';
|
|
3
|
+
import type { StoreOperationsMongoDB } from '../operations/index.js';
|
|
4
4
|
export declare class LegacyEvalsMongoDB extends LegacyEvalsStorage {
|
|
5
5
|
private operations;
|
|
6
6
|
constructor({ operations }: {
|
|
@@ -2,7 +2,7 @@ import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
|
2
2
|
import type { MastraMessageV1, MastraMessageV2, StorageThreadType } from '@mastra/core/memory';
|
|
3
3
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
4
4
|
import type { PaginationInfo, StorageGetMessagesArg, StorageResourceType } from '@mastra/core/storage';
|
|
5
|
-
import type { StoreOperationsMongoDB } from '../operations';
|
|
5
|
+
import type { StoreOperationsMongoDB } from '../operations/index.js';
|
|
6
6
|
export declare class MemoryStorageMongoDB extends MemoryStorage {
|
|
7
7
|
private operations;
|
|
8
8
|
constructor({ operations }: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StoreOperations } from '@mastra/core/storage';
|
|
2
2
|
import type { StorageColumn, TABLE_NAMES } from '@mastra/core/storage';
|
|
3
|
-
import type { ConnectorHandler } from '../../connectors/base';
|
|
3
|
+
import type { ConnectorHandler } from '../../connectors/base.js';
|
|
4
4
|
export interface MongoDBOperationsConfig {
|
|
5
5
|
connector: ConnectorHandler;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ScoreRowData } from '@mastra/core/scores';
|
|
2
2
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
3
3
|
import type { PaginationInfo, StoragePagination } from '@mastra/core/storage';
|
|
4
|
-
import type { StoreOperationsMongoDB } from '../operations';
|
|
4
|
+
import type { StoreOperationsMongoDB } from '../operations/index.js';
|
|
5
5
|
export declare class ScoresStorageMongoDB extends ScoresStorage {
|
|
6
6
|
private operations;
|
|
7
7
|
constructor({ operations }: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PaginationInfo, StorageGetTracesArg, StorageGetTracesPaginatedArg } from '@mastra/core/storage';
|
|
2
2
|
import { TracesStorage } from '@mastra/core/storage';
|
|
3
3
|
import type { Trace } from '@mastra/core/telemetry';
|
|
4
|
-
import type { StoreOperationsMongoDB } from '../operations';
|
|
4
|
+
import type { StoreOperationsMongoDB } from '../operations/index.js';
|
|
5
5
|
export declare class TracesStorageMongoDB extends TracesStorage {
|
|
6
6
|
private operations;
|
|
7
7
|
constructor({ operations }: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
2
2
|
import type { WorkflowRun, WorkflowRuns } from '@mastra/core/storage';
|
|
3
3
|
import type { WorkflowRunState } from '@mastra/core/workflows';
|
|
4
|
-
import type { StoreOperationsMongoDB } from '../operations';
|
|
4
|
+
import type { StoreOperationsMongoDB } from '../operations/index.js';
|
|
5
5
|
export declare class WorkflowsStorageMongoDB extends WorkflowsStorage {
|
|
6
6
|
private operations;
|
|
7
7
|
constructor({ operations }: {
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { EvalRow, PaginationArgs, PaginationInfo, StorageColumn, StorageDom
|
|
|
5
5
|
import { MastraStorage } from '@mastra/core/storage';
|
|
6
6
|
import type { Trace } from '@mastra/core/telemetry';
|
|
7
7
|
import type { WorkflowRunState } from '@mastra/core/workflows';
|
|
8
|
-
import type { MongoDBConfig } from './types';
|
|
8
|
+
import type { MongoDBConfig } from './types.js';
|
|
9
9
|
export declare class MongoDBStore extends MastraStorage {
|
|
10
10
|
#private;
|
|
11
11
|
stores: StorageDomains;
|
package/dist/storage/types.d.ts
CHANGED
package/dist/vector/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MastraVector } from '@mastra/core/vector';
|
|
2
2
|
import type { QueryResult, IndexStats, CreateIndexParams, UpsertVectorParams, QueryVectorParams, DescribeIndexParams, DeleteIndexParams, DeleteVectorParams, UpdateVectorParams } from '@mastra/core/vector';
|
|
3
3
|
import type { MongoClientOptions } from 'mongodb';
|
|
4
|
-
import type { MongoDBVectorFilter } from './filter';
|
|
4
|
+
import type { MongoDBVectorFilter } from './filter.js';
|
|
5
5
|
export interface MongoDBUpsertVectorParams extends UpsertVectorParams {
|
|
6
6
|
documents?: string[];
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mongodb",
|
|
3
|
-
"version": "0.13.0-alpha.
|
|
3
|
+
"version": "0.13.0-alpha.2",
|
|
4
4
|
"description": "MongoDB provider for Mastra - includes vector store capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"require": {
|
|
15
|
-
"types": "./dist/index.d.
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
16
|
"default": "./dist/index.cjs"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
@@ -33,10 +33,11 @@
|
|
|
33
33
|
"vitest": "^3.2.4",
|
|
34
34
|
"@internal/lint": "0.0.26",
|
|
35
35
|
"@internal/storage-test-utils": "0.0.22",
|
|
36
|
-
"@
|
|
36
|
+
"@internal/types-builder": "0.0.1",
|
|
37
|
+
"@mastra/core": "0.13.0-alpha.2"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
|
-
"@mastra/core": ">=0.
|
|
40
|
+
"@mastra/core": ">=0.13.0-0 <0.14.0-0"
|
|
40
41
|
},
|
|
41
42
|
"scripts": {
|
|
42
43
|
"build": "tsup --silent --config tsup.config.ts",
|
|
@@ -103,13 +103,13 @@ export class TracesStorageMongoDB extends TracesStorage {
|
|
|
103
103
|
name: row.name,
|
|
104
104
|
scope: row.scope,
|
|
105
105
|
kind: row.kind,
|
|
106
|
-
status: safelyParseJSON(row.status
|
|
107
|
-
events: safelyParseJSON(row.events
|
|
108
|
-
links: safelyParseJSON(row.links
|
|
109
|
-
attributes: safelyParseJSON(row.attributes
|
|
106
|
+
status: safelyParseJSON(row.status),
|
|
107
|
+
events: safelyParseJSON(row.events),
|
|
108
|
+
links: safelyParseJSON(row.links),
|
|
109
|
+
attributes: safelyParseJSON(row.attributes),
|
|
110
110
|
startTime: row.startTime,
|
|
111
111
|
endTime: row.endTime,
|
|
112
|
-
other: safelyParseJSON(row.other
|
|
112
|
+
other: safelyParseJSON(row.other),
|
|
113
113
|
createdAt: row.createdAt,
|
|
114
114
|
})) as Trace[];
|
|
115
115
|
|
package/tsup.config.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { promisify } from 'util';
|
|
1
|
+
import { generateTypes } from '@internal/types-builder';
|
|
3
2
|
import { defineConfig } from 'tsup';
|
|
4
3
|
|
|
5
|
-
const exec = promisify(spawn);
|
|
6
|
-
|
|
7
4
|
export default defineConfig({
|
|
8
5
|
entry: ['src/index.ts'],
|
|
9
6
|
format: ['esm', 'cjs'],
|
|
@@ -15,8 +12,6 @@ export default defineConfig({
|
|
|
15
12
|
},
|
|
16
13
|
sourcemap: true,
|
|
17
14
|
onSuccess: async () => {
|
|
18
|
-
await
|
|
19
|
-
stdio: 'inherit',
|
|
20
|
-
});
|
|
15
|
+
await generateTypes(process.cwd());
|
|
21
16
|
},
|
|
22
17
|
});
|