@mastra/astra 0.2.13 → 0.2.14-alpha.1

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,23 +1,23 @@
1
1
 
2
- > @mastra/astra@0.2.13-alpha.6 build /home/runner/work/mastra/mastra/stores/astra
2
+ > @mastra/astra@0.2.14-alpha.1 build /home/runner/work/mastra/mastra/stores/astra
3
3
  > tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 7594ms
9
+ TSC ⚡️ Build success in 8630ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/stores/astra/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/stores/astra/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 10644ms
16
+ DTS ⚡️ Build success in 10014ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
20
  ESM dist/index.js 10.54 KB
21
- ESM ⚡️ Build success in 768ms
21
+ ESM ⚡️ Build success in 366ms
22
22
  CJS dist/index.cjs 10.60 KB
23
- CJS ⚡️ Build success in 768ms
23
+ CJS ⚡️ Build success in 366ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @mastra/astra
2
2
 
3
+ ## 0.2.14-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [e450778]
8
+ - Updated dependencies [8902157]
9
+ - Updated dependencies [ca0dc88]
10
+ - Updated dependencies [9cd1a46]
11
+ - Updated dependencies [70dbf51]
12
+ - @mastra/core@0.9.3-alpha.1
13
+
14
+ ## 0.2.14-alpha.0
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [526c570]
19
+ - Updated dependencies [b5d2de0]
20
+ - Updated dependencies [644f8ad]
21
+ - @mastra/core@0.9.3-alpha.0
22
+
3
23
  ## 0.2.13
4
24
 
5
25
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/astra",
3
- "version": "0.2.13",
3
+ "version": "0.2.14-alpha.1",
4
4
  "description": "Astra DB provider for Mastra - includes vector store capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
23
  "@datastax/astra-db-ts": "^1.5.0",
24
- "@mastra/core": "^0.9.2"
24
+ "@mastra/core": "^0.9.3-alpha.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@microsoft/api-extractor": "^7.52.5",
@@ -1323,4 +1323,61 @@ describe.skip('AstraVector Integration Tests', () => {
1323
1323
  expect(results.map(res => res.id)).not.toContain(idToBeDeleted);
1324
1324
  });
1325
1325
  });
1326
+
1327
+ describe('Error Handling', () => {
1328
+ const testIndexName = 'test_index_error';
1329
+ beforeAll(async () => {
1330
+ await vectorDB.createIndex({ indexName: testIndexName, dimension: 3 });
1331
+ });
1332
+
1333
+ afterAll(async () => {
1334
+ await vectorDB.deleteIndex(testIndexName);
1335
+ });
1336
+
1337
+ it('should handle non-existent index queries', async () => {
1338
+ await expect(vectorDB.query({ indexName: 'non-existent-index', queryVector: [1, 2, 3] })).rejects.toThrow();
1339
+ });
1340
+
1341
+ it('should handle invalid dimension vectors', async () => {
1342
+ const invalidVector = [1, 2, 3, 4]; // 4D vector for 3D index
1343
+ await expect(vectorDB.upsert({ indexName: testIndexName, vectors: [invalidVector] })).rejects.toThrow();
1344
+ });
1345
+
1346
+ it('should handle duplicate index creation gracefully', async () => {
1347
+ const duplicateIndexName = `duplicate_test`;
1348
+ const dimension = 768;
1349
+
1350
+ try {
1351
+ // Create index first time
1352
+ await vectorDB.createIndex({
1353
+ indexName: duplicateIndexName,
1354
+ dimension,
1355
+ metric: 'cosine',
1356
+ });
1357
+
1358
+ // Try to create with same dimensions - should not throw
1359
+ await expect(
1360
+ vectorDB.createIndex({
1361
+ indexName: duplicateIndexName,
1362
+ dimension,
1363
+ metric: 'cosine',
1364
+ }),
1365
+ ).resolves.not.toThrow();
1366
+
1367
+ // Try to create with different dimensions - should throw
1368
+ await expect(
1369
+ vectorDB.createIndex({
1370
+ indexName: duplicateIndexName,
1371
+ dimension: dimension + 1,
1372
+ metric: 'cosine',
1373
+ }),
1374
+ ).rejects.toThrow(
1375
+ `Collection already exists: trying to create Collection ('${duplicateIndexName}') with different settings`,
1376
+ );
1377
+ } finally {
1378
+ // Cleanup
1379
+ await vectorDB.deleteIndex(duplicateIndexName);
1380
+ }
1381
+ });
1382
+ });
1326
1383
  });