@mastra/convex 0.0.0-new-button-export-20251219133013 → 0.0.0-salesman-20260127182805
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 +711 -3
- package/dist/chunk-FTVDAP6U.cjs +113 -0
- package/dist/chunk-FTVDAP6U.cjs.map +1 -0
- package/dist/chunk-G5FLGAPE.js +82 -0
- package/dist/chunk-G5FLGAPE.js.map +1 -0
- package/dist/docs/README.md +32 -0
- package/dist/docs/SKILL.md +46 -0
- package/dist/docs/SOURCE_MAP.json +63 -0
- package/dist/docs/storage/01-reference.md +143 -0
- package/dist/docs/vectors/01-reference.md +240 -0
- package/dist/index.cjs +66 -158
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +54 -146
- package/dist/index.js.map +1 -1
- package/dist/schema.cjs +17 -17
- package/dist/schema.d.ts +66 -67
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +1 -1
- package/dist/server/index.cjs +14 -14
- package/dist/server/index.js +1 -1
- package/dist/storage/db/index.d.ts +10 -1
- package/dist/storage/db/index.d.ts.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +2 -2
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +5 -14
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +56 -125
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +13 -12
- package/dist/chunk-PKUUSREO.js +0 -76
- package/dist/chunk-PKUUSREO.js.map +0 -1
- package/dist/chunk-ZBUP3DS6.cjs +0 -93
- package/dist/chunk-ZBUP3DS6.cjs.map +0 -1
- package/dist/server/schema.d.ts +0 -115
- package/dist/server/schema.d.ts.map +0 -1
package/dist/schema.d.ts
CHANGED
|
@@ -1,103 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convex schema definitions for Mastra tables.
|
|
3
|
+
*
|
|
4
|
+
* This file dynamically builds Convex table definitions from the canonical
|
|
5
|
+
* TABLE_SCHEMAS in @mastra/core/storage/constants to ensure they stay in sync.
|
|
6
|
+
*
|
|
7
|
+
* The import path @mastra/core/storage/constants is specifically designed to
|
|
8
|
+
* avoid pulling in Node.js dependencies, making it safe to use in Convex's
|
|
9
|
+
* sandboxed schema evaluation environment.
|
|
10
|
+
*/
|
|
11
|
+
import { TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, TABLE_THREADS, TABLE_RESOURCES, TABLE_SCORERS } from '@mastra/core/storage/constants';
|
|
12
|
+
/**
|
|
13
|
+
* Threads table - stores conversation threads
|
|
14
|
+
* Schema: TABLE_SCHEMAS[TABLE_THREADS]
|
|
15
|
+
*/
|
|
1
16
|
export declare const mastraThreadsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
id: string;
|
|
5
|
-
createdAt: string;
|
|
6
|
-
updatedAt: string;
|
|
7
|
-
}, {
|
|
8
|
-
id: import("convex/values").VString<string, "required">;
|
|
9
|
-
resourceId: import("convex/values").VString<string, "optional">;
|
|
10
|
-
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
11
|
-
createdAt: import("convex/values").VString<string, "required">;
|
|
12
|
-
updatedAt: import("convex/values").VString<string, "required">;
|
|
13
|
-
}, "required", "id" | "createdAt" | "resourceId" | "metadata" | "updatedAt" | `metadata.${string}`>, {
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
}, Record<string, any>, "required", string>, {
|
|
14
19
|
by_record_id: ["id", "_creationTime"];
|
|
15
20
|
by_resource: ["resourceId", "_creationTime"];
|
|
16
21
|
by_created: ["createdAt", "_creationTime"];
|
|
17
22
|
by_updated: ["updatedAt", "_creationTime"];
|
|
18
23
|
}, {}, {}>;
|
|
24
|
+
/**
|
|
25
|
+
* Messages table - stores conversation messages
|
|
26
|
+
* Schema: TABLE_SCHEMAS[TABLE_MESSAGES]
|
|
27
|
+
*/
|
|
19
28
|
export declare const mastraMessagesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
createdAt: string;
|
|
23
|
-
role: string;
|
|
24
|
-
type: string;
|
|
25
|
-
content: string;
|
|
26
|
-
thread_id: string;
|
|
27
|
-
}, {
|
|
28
|
-
id: import("convex/values").VString<string, "required">;
|
|
29
|
-
thread_id: import("convex/values").VString<string, "required">;
|
|
30
|
-
content: import("convex/values").VString<string, "required">;
|
|
31
|
-
role: import("convex/values").VString<string, "required">;
|
|
32
|
-
type: import("convex/values").VString<string, "required">;
|
|
33
|
-
createdAt: import("convex/values").VString<string, "required">;
|
|
34
|
-
resourceId: import("convex/values").VString<string, "optional">;
|
|
35
|
-
}, "required", "id" | "createdAt" | "role" | "resourceId" | "type" | "content" | "thread_id">, {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
}, Record<string, any>, "required", string>, {
|
|
36
31
|
by_record_id: ["id", "_creationTime"];
|
|
37
32
|
by_thread: ["thread_id", "_creationTime"];
|
|
38
33
|
by_thread_created: ["thread_id", "createdAt", "_creationTime"];
|
|
39
34
|
by_resource: ["resourceId", "_creationTime"];
|
|
40
35
|
}, {}, {}>;
|
|
36
|
+
/**
|
|
37
|
+
* Resources table - stores resource/user working memory
|
|
38
|
+
* Schema: TABLE_SCHEMAS[TABLE_RESOURCES]
|
|
39
|
+
*/
|
|
41
40
|
export declare const mastraResourcesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
updatedAt: string;
|
|
45
|
-
data: any;
|
|
46
|
-
}, {
|
|
47
|
-
id: import("convex/values").VString<string, "required">;
|
|
48
|
-
data: import("convex/values").VAny<any, "required", string>;
|
|
49
|
-
createdAt: import("convex/values").VString<string, "required">;
|
|
50
|
-
updatedAt: import("convex/values").VString<string, "required">;
|
|
51
|
-
}, "required", "id" | "createdAt" | "updatedAt" | "data" | `data.${string}`>, {
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
}, Record<string, any>, "required", string>, {
|
|
52
43
|
by_record_id: ["id", "_creationTime"];
|
|
53
44
|
by_updated: ["updatedAt", "_creationTime"];
|
|
54
45
|
}, {}, {}>;
|
|
46
|
+
/**
|
|
47
|
+
* Workflow snapshots table - stores workflow execution state
|
|
48
|
+
* Schema: TABLE_SCHEMAS[TABLE_WORKFLOW_SNAPSHOT]
|
|
49
|
+
*
|
|
50
|
+
* Note: The `id` field is added explicitly for Convex's by_record_id index.
|
|
51
|
+
* The core schema uses (workflow_name, run_id) as a composite key, but Convex
|
|
52
|
+
* requires a single-column index. The id value is generated at runtime as
|
|
53
|
+
* `${workflow_name}-${run_id}` by the Convex storage adapter's normalizeRecord().
|
|
54
|
+
*
|
|
55
|
+
* Fields are defined explicitly (not using buildTableFromSchema) because TypeScript's
|
|
56
|
+
* type inference doesn't work well with spread operators in Convex's defineTable.
|
|
57
|
+
*/
|
|
55
58
|
export declare const mastraWorkflowSnapshotsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
59
|
+
id?: string;
|
|
56
60
|
resourceId?: string;
|
|
57
|
-
id: string;
|
|
58
61
|
run_id: string;
|
|
59
62
|
workflow_name: string;
|
|
60
63
|
createdAt: string;
|
|
61
|
-
|
|
64
|
+
updatedAt: string;
|
|
65
|
+
snapshot: any;
|
|
62
66
|
}, {
|
|
63
|
-
id: import("convex/values").VString<string, "
|
|
67
|
+
id: import("convex/values").VString<string, "optional">;
|
|
64
68
|
workflow_name: import("convex/values").VString<string, "required">;
|
|
65
69
|
run_id: import("convex/values").VString<string, "required">;
|
|
66
|
-
state: import("convex/values").VAny<any, "required", string>;
|
|
67
|
-
createdAt: import("convex/values").VString<string, "required">;
|
|
68
70
|
resourceId: import("convex/values").VString<string, "optional">;
|
|
69
|
-
|
|
71
|
+
snapshot: import("convex/values").VAny<any, "required", string>;
|
|
72
|
+
createdAt: import("convex/values").VString<string, "required">;
|
|
73
|
+
updatedAt: import("convex/values").VString<string, "required">;
|
|
74
|
+
}, "required", "id" | "run_id" | "workflow_name" | "createdAt" | "resourceId" | "updatedAt" | "snapshot" | `snapshot.${string}`>, {
|
|
70
75
|
by_record_id: ["id", "_creationTime"];
|
|
71
76
|
by_workflow_run: ["workflow_name", "run_id", "_creationTime"];
|
|
72
77
|
by_workflow: ["workflow_name", "_creationTime"];
|
|
73
78
|
by_resource: ["resourceId", "_creationTime"];
|
|
74
79
|
by_created: ["createdAt", "_creationTime"];
|
|
75
80
|
}, {}, {}>;
|
|
81
|
+
/**
|
|
82
|
+
* Scores table - stores evaluation scores
|
|
83
|
+
* Schema: TABLE_SCHEMAS[TABLE_SCORERS]
|
|
84
|
+
*/
|
|
76
85
|
export declare const mastraScoresTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
id: string;
|
|
80
|
-
createdAt: string;
|
|
81
|
-
score: number;
|
|
82
|
-
entityType: string;
|
|
83
|
-
entityId: string;
|
|
84
|
-
scorerId: string;
|
|
85
|
-
}, {
|
|
86
|
-
id: import("convex/values").VString<string, "required">;
|
|
87
|
-
scorerId: import("convex/values").VString<string, "required">;
|
|
88
|
-
entityId: import("convex/values").VString<string, "required">;
|
|
89
|
-
entityType: import("convex/values").VString<string, "required">;
|
|
90
|
-
score: import("convex/values").VFloat64<number, "required">;
|
|
91
|
-
runId: import("convex/values").VString<string, "optional">;
|
|
92
|
-
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
93
|
-
createdAt: import("convex/values").VString<string, "required">;
|
|
94
|
-
}, "required", "id" | "runId" | "createdAt" | "metadata" | "score" | "entityType" | "entityId" | "scorerId" | `metadata.${string}`>, {
|
|
86
|
+
[x: string]: any;
|
|
87
|
+
}, Record<string, any>, "required", string>, {
|
|
95
88
|
by_record_id: ["id", "_creationTime"];
|
|
96
89
|
by_scorer: ["scorerId", "_creationTime"];
|
|
97
90
|
by_entity: ["entityId", "entityType", "_creationTime"];
|
|
98
91
|
by_run: ["runId", "_creationTime"];
|
|
99
92
|
by_created: ["createdAt", "_creationTime"];
|
|
100
93
|
}, {}, {}>;
|
|
94
|
+
/**
|
|
95
|
+
* Vector indexes table - stores metadata about vector indexes
|
|
96
|
+
*/
|
|
101
97
|
export declare const mastraVectorIndexesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
102
98
|
id: string;
|
|
103
99
|
createdAt: string;
|
|
@@ -114,6 +110,10 @@ export declare const mastraVectorIndexesTable: import("convex/server").TableDefi
|
|
|
114
110
|
by_record_id: ["id", "_creationTime"];
|
|
115
111
|
by_name: ["indexName", "_creationTime"];
|
|
116
112
|
}, {}, {}>;
|
|
113
|
+
/**
|
|
114
|
+
* Vectors table - stores vector embeddings
|
|
115
|
+
* Uses indexName field to support multiple indexes with different dimensions
|
|
116
|
+
*/
|
|
117
117
|
export declare const mastraVectorsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
118
118
|
metadata?: any;
|
|
119
119
|
id: string;
|
|
@@ -128,6 +128,9 @@ export declare const mastraVectorsTable: import("convex/server").TableDefinition
|
|
|
128
128
|
by_index_id: ["indexName", "id", "_creationTime"];
|
|
129
129
|
by_index: ["indexName", "_creationTime"];
|
|
130
130
|
}, {}, {}>;
|
|
131
|
+
/**
|
|
132
|
+
* Generic documents table - fallback for unknown table types
|
|
133
|
+
*/
|
|
131
134
|
export declare const mastraDocumentsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
132
135
|
record: any;
|
|
133
136
|
table: string;
|
|
@@ -140,11 +143,7 @@ export declare const mastraDocumentsTable: import("convex/server").TableDefiniti
|
|
|
140
143
|
by_table: ["table", "_creationTime"];
|
|
141
144
|
by_table_primary: ["table", "primaryKey", "_creationTime"];
|
|
142
145
|
}, {}, {}>;
|
|
143
|
-
export
|
|
144
|
-
export declare const TABLE_MESSAGES = "mastra_messages";
|
|
145
|
-
export declare const TABLE_THREADS = "mastra_threads";
|
|
146
|
-
export declare const TABLE_RESOURCES = "mastra_resources";
|
|
147
|
-
export declare const TABLE_SCORERS = "mastra_scores";
|
|
146
|
+
export { TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, TABLE_THREADS, TABLE_RESOURCES, TABLE_SCORERS };
|
|
148
147
|
export declare const TABLE_VECTOR_INDEXES = "mastra_vector_indexes";
|
|
149
148
|
export declare const TABLE_VECTORS = "mastra_vectors";
|
|
150
149
|
export declare const TABLE_DOCUMENTS = "mastra_documents";
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAEL,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,eAAe,EACf,aAAa,EACd,MAAM,gCAAgC,CAAC;AAoDxC;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;UAIM,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;UAIO,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;UAEI,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;UAaJ,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;UAKO,CAAC;AAMtC;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;UAQH,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;UAOI,CAAC;AAMpC;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;UAMoB,CAAC;AAMtD,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AAGlG,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAC9C,eAAO,MAAM,eAAe,qBAAqB,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { TABLE_DOCUMENTS, TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCORERS, TABLE_THREADS, TABLE_VECTORS, TABLE_VECTOR_INDEXES, TABLE_WORKFLOW_SNAPSHOT, mastraDocumentsTable, mastraMessagesTable, mastraResourcesTable, mastraScoresTable, mastraThreadsTable, mastraVectorIndexesTable, mastraVectorsTable, mastraWorkflowSnapshotsTable } from './chunk-
|
|
1
|
+
export { TABLE_DOCUMENTS, TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCORERS, TABLE_THREADS, TABLE_VECTORS, TABLE_VECTOR_INDEXES, TABLE_WORKFLOW_SNAPSHOT, mastraDocumentsTable, mastraMessagesTable, mastraResourcesTable, mastraScoresTable, mastraThreadsTable, mastraVectorIndexesTable, mastraVectorsTable, mastraWorkflowSnapshotsTable } from './chunk-G5FLGAPE.js';
|
|
2
2
|
//# sourceMappingURL=schema.js.map
|
|
3
3
|
//# sourceMappingURL=schema.js.map
|
package/dist/server/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkBKVR7SL7_cjs = require('../chunk-BKVR7SL7.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkFTVDAP6U_cjs = require('../chunk-FTVDAP6U.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -11,55 +11,55 @@ Object.defineProperty(exports, "mastraStorage", {
|
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "TABLE_MESSAGES", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkFTVDAP6U_cjs.TABLE_MESSAGES; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "TABLE_RESOURCES", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkFTVDAP6U_cjs.TABLE_RESOURCES; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "TABLE_SCORERS", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkFTVDAP6U_cjs.TABLE_SCORERS; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "TABLE_THREADS", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkFTVDAP6U_cjs.TABLE_THREADS; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "TABLE_WORKFLOW_SNAPSHOT", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkFTVDAP6U_cjs.TABLE_WORKFLOW_SNAPSHOT; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "mastraDocumentsTable", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkFTVDAP6U_cjs.mastraDocumentsTable; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "mastraMessagesTable", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkFTVDAP6U_cjs.mastraMessagesTable; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "mastraResourcesTable", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkFTVDAP6U_cjs.mastraResourcesTable; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "mastraScoresTable", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkFTVDAP6U_cjs.mastraScoresTable; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "mastraThreadsTable", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkFTVDAP6U_cjs.mastraThreadsTable; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "mastraVectorIndexesTable", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkFTVDAP6U_cjs.mastraVectorIndexesTable; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "mastraVectorsTable", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkFTVDAP6U_cjs.mastraVectorsTable; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "mastraWorkflowSnapshotsTable", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkFTVDAP6U_cjs.mastraWorkflowSnapshotsTable; }
|
|
63
63
|
});
|
|
64
64
|
//# sourceMappingURL=index.cjs.map
|
|
65
65
|
//# sourceMappingURL=index.cjs.map
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { mastraStorage } from '../chunk-KSAPIIEJ.js';
|
|
2
|
-
export { TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCORERS, TABLE_THREADS, TABLE_WORKFLOW_SNAPSHOT, mastraDocumentsTable, mastraMessagesTable, mastraResourcesTable, mastraScoresTable, mastraThreadsTable, mastraVectorIndexesTable, mastraVectorsTable, mastraWorkflowSnapshotsTable } from '../chunk-
|
|
2
|
+
export { TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCORERS, TABLE_THREADS, TABLE_WORKFLOW_SNAPSHOT, mastraDocumentsTable, mastraMessagesTable, mastraResourcesTable, mastraScoresTable, mastraThreadsTable, mastraVectorIndexesTable, mastraVectorsTable, mastraWorkflowSnapshotsTable } from '../chunk-G5FLGAPE.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MastraBase } from '@mastra/core/base';
|
|
2
|
-
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
2
|
+
import type { StorageColumn, TABLE_NAMES } from '@mastra/core/storage';
|
|
3
3
|
import { ConvexAdminClient } from '../client.js';
|
|
4
4
|
import type { EqualityFilter } from '../types.js';
|
|
5
5
|
/**
|
|
@@ -32,6 +32,15 @@ export declare class ConvexDB extends MastraBase {
|
|
|
32
32
|
private readonly client;
|
|
33
33
|
constructor(client: ConvexAdminClient);
|
|
34
34
|
hasColumn(_table: string, _column: string): Promise<boolean>;
|
|
35
|
+
createTable({ tableName, schema: _schema, }: {
|
|
36
|
+
tableName: TABLE_NAMES;
|
|
37
|
+
schema: Record<string, StorageColumn>;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
alterTable({ tableName, schema: _schema, ifNotExists: _ifNotExists, }: {
|
|
40
|
+
tableName: TABLE_NAMES;
|
|
41
|
+
schema: Record<string, StorageColumn>;
|
|
42
|
+
ifNotExists: string[];
|
|
43
|
+
}): Promise<void>;
|
|
35
44
|
clearTable({ tableName }: {
|
|
36
45
|
tableName: TABLE_NAMES;
|
|
37
46
|
}): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/db/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/db/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GAAG,sBAAsB,CAAC;AAEnF;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,GAAG,iBAAiB,CAQjF;AAED,qBAAa,QAAS,SAAQ,UAAU;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,iBAAiB;IAIhD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5D,WAAW,CAAC,EAChB,SAAS,EACT,MAAM,EAAE,OAAO,GAChB,EAAE;QACD,SAAS,EAAE,WAAW,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;KACvC,GAAG,OAAO,CAAC,IAAI,CAAC;IAKX,UAAU,CAAC,EACf,SAAS,EACT,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,YAAY,GAC1B,EAAE;QACD,SAAS,EAAE,WAAW,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QACtC,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKX,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAapE,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAanE,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrG,WAAW,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAU9G,IAAI,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAU/F,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAQ/E,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAS7E,OAAO,CAAC,eAAe;CAqBxB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
2
2
|
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
|
|
3
3
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
4
|
-
import type { StorageListMessagesInput, StorageListMessagesOutput,
|
|
4
|
+
import type { StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsInput, StorageListThreadsOutput, StorageResourceType } from '@mastra/core/storage';
|
|
5
5
|
import type { ConvexDomainConfig } from '../../db/index.js';
|
|
6
6
|
export declare class MemoryConvex extends MemoryStorage {
|
|
7
7
|
#private;
|
|
@@ -22,7 +22,7 @@ export declare class MemoryConvex extends MemoryStorage {
|
|
|
22
22
|
deleteThread({ threadId }: {
|
|
23
23
|
threadId: string;
|
|
24
24
|
}): Promise<void>;
|
|
25
|
-
|
|
25
|
+
listThreads(args: StorageListThreadsInput): Promise<StorageListThreadsOutput>;
|
|
26
26
|
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
27
27
|
listMessagesById({ messageIds }: {
|
|
28
28
|
messageIds: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { SaveScorePayload, ScoreRowData, ScoringEntityType, ScoringSource } from '@mastra/core/evals';
|
|
1
|
+
import type { ListScoresResponse, SaveScorePayload, ScoreRowData, ScoringEntityType, ScoringSource } from '@mastra/core/evals';
|
|
2
2
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
3
|
-
import type {
|
|
3
|
+
import type { StoragePagination } from '@mastra/core/storage';
|
|
4
4
|
import type { ConvexDomainConfig } from '../../db/index.js';
|
|
5
5
|
export declare class ScoresConvex extends ScoresStorage {
|
|
6
6
|
#private;
|
|
@@ -19,25 +19,16 @@ export declare class ScoresConvex extends ScoresStorage {
|
|
|
19
19
|
entityId?: string;
|
|
20
20
|
entityType?: ScoringEntityType;
|
|
21
21
|
source?: ScoringSource;
|
|
22
|
-
}): Promise<
|
|
23
|
-
pagination: PaginationInfo;
|
|
24
|
-
scores: ScoreRowData[];
|
|
25
|
-
}>;
|
|
22
|
+
}): Promise<ListScoresResponse>;
|
|
26
23
|
listScoresByRunId({ runId, pagination, }: {
|
|
27
24
|
runId: string;
|
|
28
25
|
pagination: StoragePagination;
|
|
29
|
-
}): Promise<
|
|
30
|
-
pagination: PaginationInfo;
|
|
31
|
-
scores: ScoreRowData[];
|
|
32
|
-
}>;
|
|
26
|
+
}): Promise<ListScoresResponse>;
|
|
33
27
|
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
34
28
|
entityId: string;
|
|
35
29
|
entityType: ScoringEntityType;
|
|
36
30
|
pagination: StoragePagination;
|
|
37
|
-
}): Promise<
|
|
38
|
-
pagination: PaginationInfo;
|
|
39
|
-
scores: ScoreRowData[];
|
|
40
|
-
}>;
|
|
31
|
+
}): Promise<ListScoresResponse>;
|
|
41
32
|
private listScores;
|
|
42
33
|
private deserialize;
|
|
43
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAiB,aAAa,EAAwB,MAAM,sBAAsB,CAAC;AAC1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAOnD,qBAAa,YAAa,SAAQ,aAAa;;gBAEjC,MAAM,EAAE,kBAAkB;IAMhC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAQlE,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IAiBpE,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,GACP,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,iBAAiB,CAAC;QAC/B,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAOzB,iBAAiB,CAAC,EACtB,KAAK,EACL,UAAU,GACX,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAOzB,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,iBAAiB,CAAC;QAC9B,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC,kBAAkB,CAAC;YAOjB,UAAU;IA4CxB,OAAO,CAAC,WAAW;CAOpB"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import type { StorageResourceType, PaginationInfo, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput, StorageListWorkflowRunsInput, StoragePagination, WorkflowRun, WorkflowRuns, UpdateWorkflowStateOptions } from '@mastra/core/storage';
|
|
4
|
-
import { MastraStorage } from '@mastra/core/storage';
|
|
5
|
-
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
1
|
+
import type { StorageDomains } from '@mastra/core/storage';
|
|
2
|
+
import { MastraCompositeStore } from '@mastra/core/storage';
|
|
6
3
|
import type { ConvexAdminClientConfig } from './client.js';
|
|
7
|
-
|
|
4
|
+
import { ConvexAdminClient } from './client.js';
|
|
5
|
+
import { MemoryConvex } from './domains/memory/index.js';
|
|
6
|
+
import { ScoresConvex } from './domains/scores/index.js';
|
|
7
|
+
import { WorkflowsConvex } from './domains/workflows/index.js';
|
|
8
|
+
export { MemoryConvex, ScoresConvex, WorkflowsConvex };
|
|
9
|
+
export type { ConvexDomainConfig } from './db/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Convex configuration type.
|
|
12
|
+
*
|
|
13
|
+
* Accepts either:
|
|
14
|
+
* - A pre-configured ConvexAdminClient: `{ id, client }`
|
|
15
|
+
* - Deployment config: `{ id, deploymentUrl, adminAuthToken, storageFunction? }`
|
|
16
|
+
*/
|
|
17
|
+
export type ConvexStoreConfig = {
|
|
8
18
|
id: string;
|
|
9
19
|
name?: string;
|
|
10
20
|
/**
|
|
@@ -27,125 +37,46 @@ export type ConvexStoreConfig = ConvexAdminClientConfig & {
|
|
|
27
37
|
* // No auto-init, tables must already exist
|
|
28
38
|
*/
|
|
29
39
|
disableInit?: boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
} & ({
|
|
41
|
+
/**
|
|
42
|
+
* Pre-configured ConvexAdminClient.
|
|
43
|
+
* Use this when you need to configure the client before initialization.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* import { ConvexAdminClient } from '@mastra/convex/storage/client';
|
|
48
|
+
*
|
|
49
|
+
* const client = new ConvexAdminClient({
|
|
50
|
+
* deploymentUrl: 'https://your-deployment.convex.cloud',
|
|
51
|
+
* adminAuthToken: 'your-token',
|
|
52
|
+
* storageFunction: 'custom/storage:handle',
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* const store = new ConvexStore({ id: 'my-store', client });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
client: ConvexAdminClient;
|
|
59
|
+
} | ConvexAdminClientConfig);
|
|
60
|
+
/**
|
|
61
|
+
* Convex storage adapter for Mastra.
|
|
62
|
+
*
|
|
63
|
+
* Access domain-specific storage via `getStore()`:
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const storage = new ConvexStore({ id: 'my-store', deploymentUrl: '...', adminAuthToken: '...' });
|
|
68
|
+
*
|
|
69
|
+
* // Access memory domain
|
|
70
|
+
* const memory = await storage.getStore('memory');
|
|
71
|
+
* await memory?.saveThread({ thread });
|
|
72
|
+
*
|
|
73
|
+
* // Access workflows domain
|
|
74
|
+
* const workflows = await storage.getStore('workflows');
|
|
75
|
+
* await workflows?.persistWorkflowSnapshot({ workflowName, runId, snapshot });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare class ConvexStore extends MastraCompositeStore {
|
|
79
|
+
stores: StorageDomains;
|
|
35
80
|
constructor(config: ConvexStoreConfig);
|
|
36
|
-
get supports(): {
|
|
37
|
-
selectByIncludeResourceScope: boolean;
|
|
38
|
-
resourceWorkingMemory: boolean;
|
|
39
|
-
hasColumn: boolean;
|
|
40
|
-
createTable: boolean;
|
|
41
|
-
deleteMessages: boolean;
|
|
42
|
-
observabilityInstance: boolean;
|
|
43
|
-
listScoresBySpan: boolean;
|
|
44
|
-
};
|
|
45
|
-
getThreadById({ threadId }: {
|
|
46
|
-
threadId: string;
|
|
47
|
-
}): Promise<StorageThreadType | null>;
|
|
48
|
-
saveThread({ thread }: {
|
|
49
|
-
thread: StorageThreadType;
|
|
50
|
-
}): Promise<StorageThreadType>;
|
|
51
|
-
updateThread({ id, title, metadata, }: {
|
|
52
|
-
id: string;
|
|
53
|
-
title: string;
|
|
54
|
-
metadata: Record<string, unknown>;
|
|
55
|
-
}): Promise<StorageThreadType>;
|
|
56
|
-
deleteThread({ threadId }: {
|
|
57
|
-
threadId: string;
|
|
58
|
-
}): Promise<void>;
|
|
59
|
-
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
60
|
-
listMessagesById({ messageIds }: {
|
|
61
|
-
messageIds: string[];
|
|
62
|
-
}): Promise<{
|
|
63
|
-
messages: MastraDBMessage[];
|
|
64
|
-
}>;
|
|
65
|
-
saveMessages(args: {
|
|
66
|
-
messages: MastraDBMessage[];
|
|
67
|
-
}): Promise<{
|
|
68
|
-
messages: MastraDBMessage[];
|
|
69
|
-
}>;
|
|
70
|
-
updateMessages({ messages, }: {
|
|
71
|
-
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
72
|
-
id: string;
|
|
73
|
-
})[];
|
|
74
|
-
}): Promise<MastraDBMessage[]>;
|
|
75
|
-
deleteMessages(messageIds: string[]): Promise<void>;
|
|
76
|
-
listThreadsByResourceId(args: StorageListThreadsByResourceIdInput): Promise<StorageListThreadsByResourceIdOutput>;
|
|
77
|
-
getResourceById({ resourceId }: {
|
|
78
|
-
resourceId: string;
|
|
79
|
-
}): Promise<StorageResourceType | null>;
|
|
80
|
-
saveResource({ resource }: {
|
|
81
|
-
resource: StorageResourceType;
|
|
82
|
-
}): Promise<StorageResourceType>;
|
|
83
|
-
updateResource({ resourceId, workingMemory, metadata, }: {
|
|
84
|
-
resourceId: string;
|
|
85
|
-
workingMemory?: string;
|
|
86
|
-
metadata?: Record<string, unknown>;
|
|
87
|
-
}): Promise<StorageResourceType>;
|
|
88
|
-
updateWorkflowResults(params: {
|
|
89
|
-
workflowName: string;
|
|
90
|
-
runId: string;
|
|
91
|
-
stepId: string;
|
|
92
|
-
result: StepResult<any, any, any, any>;
|
|
93
|
-
requestContext: Record<string, any>;
|
|
94
|
-
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
95
|
-
updateWorkflowState(params: {
|
|
96
|
-
workflowName: string;
|
|
97
|
-
runId: string;
|
|
98
|
-
opts: UpdateWorkflowStateOptions;
|
|
99
|
-
}): Promise<WorkflowRunState | undefined>;
|
|
100
|
-
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
101
|
-
workflowName: string;
|
|
102
|
-
runId: string;
|
|
103
|
-
resourceId?: string | undefined;
|
|
104
|
-
snapshot: WorkflowRunState;
|
|
105
|
-
}): Promise<void>;
|
|
106
|
-
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
107
|
-
workflowName: string;
|
|
108
|
-
runId: string;
|
|
109
|
-
}): Promise<WorkflowRunState | null>;
|
|
110
|
-
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
111
|
-
getWorkflowRunById({ runId, workflowName, }: {
|
|
112
|
-
runId: string;
|
|
113
|
-
workflowName?: string | undefined;
|
|
114
|
-
}): Promise<WorkflowRun | null>;
|
|
115
|
-
deleteWorkflowRunById({ runId, workflowName }: {
|
|
116
|
-
runId: string;
|
|
117
|
-
workflowName: string;
|
|
118
|
-
}): Promise<void>;
|
|
119
|
-
getScoreById({ id }: {
|
|
120
|
-
id: string;
|
|
121
|
-
}): Promise<ScoreRowData | null>;
|
|
122
|
-
saveScore(score: SaveScorePayload): Promise<{
|
|
123
|
-
score: ScoreRowData;
|
|
124
|
-
}>;
|
|
125
|
-
listScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
126
|
-
scorerId: string;
|
|
127
|
-
pagination: StoragePagination;
|
|
128
|
-
entityId?: string | undefined;
|
|
129
|
-
entityType?: ScoringEntityType | undefined;
|
|
130
|
-
source?: ScoringSource | undefined;
|
|
131
|
-
}): Promise<{
|
|
132
|
-
pagination: PaginationInfo;
|
|
133
|
-
scores: ScoreRowData[];
|
|
134
|
-
}>;
|
|
135
|
-
listScoresByRunId({ runId, pagination, }: {
|
|
136
|
-
runId: string;
|
|
137
|
-
pagination: StoragePagination;
|
|
138
|
-
}): Promise<{
|
|
139
|
-
pagination: PaginationInfo;
|
|
140
|
-
scores: ScoreRowData[];
|
|
141
|
-
}>;
|
|
142
|
-
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
143
|
-
pagination: StoragePagination;
|
|
144
|
-
entityId: string;
|
|
145
|
-
entityType: ScoringEntityType;
|
|
146
|
-
}): Promise<{
|
|
147
|
-
pagination: PaginationInfo;
|
|
148
|
-
scores: ScoreRowData[];
|
|
149
|
-
}>;
|
|
150
81
|
}
|
|
151
82
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;AACvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,CACA;IACE;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GACD,uBAAuB,CAC1B,CAAC;AASF;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAY,SAAQ,oBAAoB;IAC3C,MAAM,EAAE,cAAc,CAAC;gBAEnB,MAAM,EAAE,iBAAiB;CAiBtC"}
|