@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.
@@ -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 }: {
@@ -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;
@@ -1,5 +1,5 @@
1
1
  import type { MongoClientOptions } from 'mongodb';
2
- import type { ConnectorHandler } from './connectors/base';
2
+ import type { ConnectorHandler } from './connectors/base.js';
3
3
  export type MongoDBConfig = DatabaseConfig | {
4
4
  connectorHandler: ConnectorHandler;
5
5
  };
@@ -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.0",
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.cts",
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
- "@mastra/core": "0.13.0-alpha.1"
36
+ "@internal/types-builder": "0.0.1",
37
+ "@mastra/core": "0.13.0-alpha.2"
37
38
  },
38
39
  "peerDependencies": {
39
- "@mastra/core": ">=0.10.7-0 <0.13.0-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 as string),
107
- events: safelyParseJSON(row.events as string),
108
- links: safelyParseJSON(row.links as string),
109
- attributes: safelyParseJSON(row.attributes as string),
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 as string),
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 { spawn } from 'child_process';
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 exec('pnpm', ['tsc', '-p', 'tsconfig.build.json'], {
19
- stdio: 'inherit',
20
- });
15
+ await generateTypes(process.cwd());
21
16
  },
22
17
  });