@mastra/mssql 0.0.0-new-scorer-api-20250801075530 → 0.0.0-new-button-export-20251219133013
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 +1208 -4
- package/README.md +324 -37
- package/dist/index.cjs +2967 -1369
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2968 -1370
- package/dist/index.js.map +1 -1
- package/dist/storage/db/index.d.ts +159 -0
- package/dist/storage/db/index.d.ts.map +1 -0
- package/dist/storage/db/utils.d.ts +25 -0
- package/dist/storage/db/utils.d.ts.map +1 -0
- package/dist/storage/domains/memory/index.d.ts +67 -0
- package/dist/storage/domains/memory/index.d.ts.map +1 -0
- package/dist/storage/domains/observability/index.d.ts +43 -0
- package/dist/storage/domains/observability/index.d.ts.map +1 -0
- package/dist/storage/domains/scores/index.d.ts +54 -0
- package/dist/storage/domains/scores/index.d.ts.map +1 -0
- package/dist/storage/domains/utils.d.ts +25 -0
- package/dist/storage/domains/utils.d.ts.map +1 -0
- package/dist/storage/domains/workflows/index.d.ts +47 -0
- package/dist/storage/domains/workflows/index.d.ts.map +1 -0
- package/dist/storage/index.d.ts +139 -141
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +31 -13
- package/docker-compose.yaml +0 -14
- package/eslint.config.js +0 -6
- package/src/index.ts +0 -2
- package/src/storage/index.test.ts +0 -2228
- package/src/storage/index.ts +0 -2136
- package/tsconfig.build.json +0 -9
- package/tsconfig.json +0 -5
- package/tsup.config.ts +0 -22
- package/vitest.config.ts +0 -12
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,15 +1,36 @@
|
|
|
1
|
-
import type { MastraMessageContentV2,
|
|
2
|
-
|
|
1
|
+
import type { MastraMessageContentV2, MastraDBMessage } from '@mastra/core/agent';
|
|
2
|
+
import type { SaveScorePayload, ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
3
|
+
import type { StorageThreadType } from '@mastra/core/memory';
|
|
4
|
+
import { MastraStorage } from '@mastra/core/storage';
|
|
5
|
+
export type MastraDBMessageWithTypedContent = Omit<MastraDBMessage, 'content'> & {
|
|
3
6
|
content: MastraMessageContentV2;
|
|
4
7
|
};
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import { MastraStorage } from '@mastra/core/storage';
|
|
8
|
-
import type { EvalRow, PaginationInfo, StorageColumn, StorageGetMessagesArg, StorageResourceType, TABLE_NAMES, WorkflowRun, WorkflowRuns, PaginationArgs, StoragePagination } from '@mastra/core/storage';
|
|
9
|
-
import type { WorkflowRunState } from '@mastra/core/workflows';
|
|
8
|
+
import type { PaginationInfo, StorageResourceType, WorkflowRun, WorkflowRuns, StoragePagination, StorageDomains, SpanRecord, TraceRecord, TracesPaginatedArg, UpdateSpanRecord, CreateIndexOptions, IndexInfo, StorageIndexStats, StorageListWorkflowRunsInput, UpdateWorkflowStateOptions } from '@mastra/core/storage';
|
|
9
|
+
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
10
10
|
import sql from 'mssql';
|
|
11
11
|
export type MSSQLConfigType = {
|
|
12
|
+
id: string;
|
|
12
13
|
schemaName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* When true, automatic initialization (table creation/migrations) is disabled.
|
|
16
|
+
* This is useful for CI/CD pipelines where you want to:
|
|
17
|
+
* 1. Run migrations explicitly during deployment (not at runtime)
|
|
18
|
+
* 2. Use different credentials for schema changes vs runtime operations
|
|
19
|
+
*
|
|
20
|
+
* When disableInit is true:
|
|
21
|
+
* - The storage will not automatically create/alter tables on first use
|
|
22
|
+
* - You must call `storage.init()` explicitly in your CI/CD scripts
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // In CI/CD script:
|
|
26
|
+
* const storage = new MSSQLStore({ ...config, disableInit: false });
|
|
27
|
+
* await storage.init(); // Explicitly run migrations
|
|
28
|
+
*
|
|
29
|
+
* // In runtime application:
|
|
30
|
+
* const storage = new MSSQLStore({ ...config, disableInit: true });
|
|
31
|
+
* // No auto-init, tables must already exist
|
|
32
|
+
*/
|
|
33
|
+
disableInit?: boolean;
|
|
13
34
|
} & ({
|
|
14
35
|
server: string;
|
|
15
36
|
port: number;
|
|
@@ -22,11 +43,11 @@ export type MSSQLConfigType = {
|
|
|
22
43
|
});
|
|
23
44
|
export type MSSQLConfig = MSSQLConfigType;
|
|
24
45
|
export declare class MSSQLStore extends MastraStorage {
|
|
46
|
+
#private;
|
|
25
47
|
pool: sql.ConnectionPool;
|
|
26
48
|
private schema?;
|
|
27
|
-
private setupSchemaPromise;
|
|
28
|
-
private schemaSetupComplete;
|
|
29
49
|
private isConnected;
|
|
50
|
+
stores: StorageDomains;
|
|
30
51
|
constructor(config: MSSQLConfigType);
|
|
31
52
|
init(): Promise<void>;
|
|
32
53
|
private _performInitializationAndStore;
|
|
@@ -36,78 +57,19 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
36
57
|
hasColumn: boolean;
|
|
37
58
|
createTable: boolean;
|
|
38
59
|
deleteMessages: boolean;
|
|
60
|
+
listScoresBySpan: boolean;
|
|
61
|
+
observabilityInstance: boolean;
|
|
62
|
+
indexManagement: boolean;
|
|
39
63
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/** @deprecated use getEvals instead */
|
|
44
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
45
|
-
batchInsert({ tableName, records }: {
|
|
46
|
-
tableName: TABLE_NAMES;
|
|
47
|
-
records: Record<string, any>[];
|
|
48
|
-
}): Promise<void>;
|
|
49
|
-
/** @deprecated use getTracesPaginated instead*/
|
|
50
|
-
getTraces(args: {
|
|
51
|
-
name?: string;
|
|
52
|
-
scope?: string;
|
|
53
|
-
attributes?: Record<string, string>;
|
|
54
|
-
filters?: Record<string, any>;
|
|
55
|
-
page: number;
|
|
56
|
-
perPage?: number;
|
|
57
|
-
fromDate?: Date;
|
|
58
|
-
toDate?: Date;
|
|
59
|
-
}): Promise<any[]>;
|
|
60
|
-
getTracesPaginated(args: {
|
|
61
|
-
name?: string;
|
|
62
|
-
scope?: string;
|
|
63
|
-
attributes?: Record<string, string>;
|
|
64
|
-
filters?: Record<string, any>;
|
|
65
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
66
|
-
traces: any[];
|
|
67
|
-
}>;
|
|
68
|
-
private setupSchema;
|
|
69
|
-
protected getSqlType(type: StorageColumn['type'], isPrimaryKey?: boolean): string;
|
|
70
|
-
createTable({ tableName, schema, }: {
|
|
71
|
-
tableName: TABLE_NAMES;
|
|
72
|
-
schema: Record<string, StorageColumn>;
|
|
73
|
-
}): Promise<void>;
|
|
74
|
-
protected getDefaultValue(type: StorageColumn['type']): string;
|
|
75
|
-
alterTable({ tableName, schema, ifNotExists, }: {
|
|
76
|
-
tableName: TABLE_NAMES;
|
|
77
|
-
schema: Record<string, StorageColumn>;
|
|
78
|
-
ifNotExists: string[];
|
|
79
|
-
}): Promise<void>;
|
|
80
|
-
clearTable({ tableName }: {
|
|
81
|
-
tableName: TABLE_NAMES;
|
|
82
|
-
}): Promise<void>;
|
|
83
|
-
insert({ tableName, record }: {
|
|
84
|
-
tableName: TABLE_NAMES;
|
|
85
|
-
record: Record<string, any>;
|
|
86
|
-
}): Promise<void>;
|
|
87
|
-
load<R>({ tableName, keys }: {
|
|
88
|
-
tableName: TABLE_NAMES;
|
|
89
|
-
keys: Record<string, string>;
|
|
90
|
-
}): Promise<R | null>;
|
|
64
|
+
/**
|
|
65
|
+
* Memory
|
|
66
|
+
*/
|
|
91
67
|
getThreadById({ threadId }: {
|
|
92
68
|
threadId: string;
|
|
93
69
|
}): Promise<StorageThreadType | null>;
|
|
94
|
-
getThreadsByResourceIdPaginated(args: {
|
|
95
|
-
resourceId: string;
|
|
96
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
97
|
-
threads: StorageThreadType[];
|
|
98
|
-
}>;
|
|
99
70
|
saveThread({ thread }: {
|
|
100
71
|
thread: StorageThreadType;
|
|
101
72
|
}): Promise<StorageThreadType>;
|
|
102
|
-
/**
|
|
103
|
-
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
104
|
-
*/
|
|
105
|
-
getThreadsByResourceId(args: {
|
|
106
|
-
resourceId: string;
|
|
107
|
-
}): Promise<StorageThreadType[]>;
|
|
108
|
-
/**
|
|
109
|
-
* Updates a thread's title and metadata, merging with existing metadata. Returns the updated thread.
|
|
110
|
-
*/
|
|
111
73
|
updateThread({ id, title, metadata, }: {
|
|
112
74
|
id: string;
|
|
113
75
|
title: string;
|
|
@@ -116,69 +78,29 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
116
78
|
deleteThread({ threadId }: {
|
|
117
79
|
threadId: string;
|
|
118
80
|
}): Promise<void>;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
124
|
-
format?: 'v1';
|
|
125
|
-
}): Promise<MastraMessageV1[]>;
|
|
126
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
127
|
-
format: 'v2';
|
|
128
|
-
}): Promise<MastraMessageV2[]>;
|
|
129
|
-
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
130
|
-
format?: 'v1' | 'v2';
|
|
131
|
-
}): Promise<PaginationInfo & {
|
|
132
|
-
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
81
|
+
listMessagesById({ messageIds }: {
|
|
82
|
+
messageIds: string[];
|
|
83
|
+
}): Promise<{
|
|
84
|
+
messages: MastraDBMessage[];
|
|
133
85
|
}>;
|
|
134
|
-
private _parseAndFormatMessages;
|
|
135
|
-
saveMessages(args: {
|
|
136
|
-
messages: MastraMessageV1[];
|
|
137
|
-
format?: undefined | 'v1';
|
|
138
|
-
}): Promise<MastraMessageV1[]>;
|
|
139
86
|
saveMessages(args: {
|
|
140
|
-
messages:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
workflowName: string;
|
|
145
|
-
runId: string;
|
|
146
|
-
snapshot: WorkflowRunState;
|
|
147
|
-
}): Promise<void>;
|
|
148
|
-
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
149
|
-
workflowName: string;
|
|
150
|
-
runId: string;
|
|
151
|
-
}): Promise<WorkflowRunState | null>;
|
|
152
|
-
private hasColumn;
|
|
153
|
-
private parseWorkflowRun;
|
|
154
|
-
getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
155
|
-
workflowName?: string;
|
|
156
|
-
fromDate?: Date;
|
|
157
|
-
toDate?: Date;
|
|
158
|
-
limit?: number;
|
|
159
|
-
offset?: number;
|
|
160
|
-
resourceId?: string;
|
|
161
|
-
}): Promise<WorkflowRuns>;
|
|
162
|
-
getWorkflowRunById({ runId, workflowName, }: {
|
|
163
|
-
runId: string;
|
|
164
|
-
workflowName?: string;
|
|
165
|
-
}): Promise<WorkflowRun | null>;
|
|
87
|
+
messages: MastraDBMessage[];
|
|
88
|
+
}): Promise<{
|
|
89
|
+
messages: MastraDBMessage[];
|
|
90
|
+
}>;
|
|
166
91
|
updateMessages({ messages, }: {
|
|
167
|
-
messages: (Partial<Omit<
|
|
92
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
168
93
|
id: string;
|
|
169
94
|
content?: {
|
|
170
95
|
metadata?: MastraMessageContentV2['metadata'];
|
|
171
96
|
content?: MastraMessageContentV2['content'];
|
|
172
97
|
};
|
|
173
98
|
})[];
|
|
174
|
-
}): Promise<
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
180
|
-
evals: EvalRow[];
|
|
181
|
-
}>;
|
|
99
|
+
}): Promise<MastraDBMessage[]>;
|
|
100
|
+
deleteMessages(messageIds: string[]): Promise<void>;
|
|
101
|
+
getResourceById({ resourceId }: {
|
|
102
|
+
resourceId: string;
|
|
103
|
+
}): Promise<StorageResourceType | null>;
|
|
182
104
|
saveResource({ resource }: {
|
|
183
105
|
resource: StorageResourceType;
|
|
184
106
|
}): Promise<StorageResourceType>;
|
|
@@ -187,32 +109,103 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
187
109
|
workingMemory?: string;
|
|
188
110
|
metadata?: Record<string, unknown>;
|
|
189
111
|
}): Promise<StorageResourceType>;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Workflows
|
|
114
|
+
*/
|
|
115
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
116
|
+
workflowName: string;
|
|
117
|
+
runId: string;
|
|
118
|
+
stepId: string;
|
|
119
|
+
result: StepResult<any, any, any, any>;
|
|
120
|
+
requestContext: Record<string, any>;
|
|
121
|
+
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
122
|
+
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
123
|
+
workflowName: string;
|
|
124
|
+
runId: string;
|
|
125
|
+
opts: UpdateWorkflowStateOptions;
|
|
126
|
+
}): Promise<WorkflowRunState | undefined>;
|
|
127
|
+
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
128
|
+
workflowName: string;
|
|
129
|
+
runId: string;
|
|
130
|
+
resourceId?: string;
|
|
131
|
+
snapshot: WorkflowRunState;
|
|
132
|
+
}): Promise<void>;
|
|
133
|
+
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
134
|
+
workflowName: string;
|
|
135
|
+
runId: string;
|
|
136
|
+
}): Promise<WorkflowRunState | null>;
|
|
137
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
138
|
+
getWorkflowRunById({ runId, workflowName, }: {
|
|
139
|
+
runId: string;
|
|
140
|
+
workflowName?: string;
|
|
141
|
+
}): Promise<WorkflowRun | null>;
|
|
142
|
+
deleteWorkflowRunById({ runId, workflowName }: {
|
|
143
|
+
runId: string;
|
|
144
|
+
workflowName: string;
|
|
145
|
+
}): Promise<void>;
|
|
146
|
+
close(): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* Index Management
|
|
149
|
+
*/
|
|
150
|
+
createIndex(options: CreateIndexOptions): Promise<void>;
|
|
151
|
+
listIndexes(tableName?: string): Promise<IndexInfo[]>;
|
|
152
|
+
describeIndex(indexName: string): Promise<StorageIndexStats>;
|
|
153
|
+
dropIndex(indexName: string): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* Tracing / Observability
|
|
156
|
+
*/
|
|
157
|
+
private getObservabilityStore;
|
|
158
|
+
createSpan(span: SpanRecord): Promise<void>;
|
|
159
|
+
updateSpan({ spanId, traceId, updates, }: {
|
|
160
|
+
spanId: string;
|
|
161
|
+
traceId: string;
|
|
162
|
+
updates: Partial<UpdateSpanRecord>;
|
|
163
|
+
}): Promise<void>;
|
|
164
|
+
getTrace(traceId: string): Promise<TraceRecord | null>;
|
|
165
|
+
getTracesPaginated(args: TracesPaginatedArg): Promise<{
|
|
166
|
+
pagination: PaginationInfo;
|
|
167
|
+
spans: SpanRecord[];
|
|
168
|
+
}>;
|
|
169
|
+
batchCreateSpans(args: {
|
|
170
|
+
records: SpanRecord[];
|
|
171
|
+
}): Promise<void>;
|
|
172
|
+
batchUpdateSpans(args: {
|
|
173
|
+
records: {
|
|
174
|
+
traceId: string;
|
|
175
|
+
spanId: string;
|
|
176
|
+
updates: Partial<UpdateSpanRecord>;
|
|
177
|
+
}[];
|
|
178
|
+
}): Promise<void>;
|
|
179
|
+
batchDeleteTraces(args: {
|
|
180
|
+
traceIds: string[];
|
|
181
|
+
}): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Scorers
|
|
184
|
+
*/
|
|
185
|
+
getScoreById({ id: _id }: {
|
|
194
186
|
id: string;
|
|
195
187
|
}): Promise<ScoreRowData | null>;
|
|
196
|
-
|
|
197
|
-
score: ScoreRowData;
|
|
198
|
-
}>;
|
|
199
|
-
getScoresByScorerId({ scorerId, pagination: _pagination, entityId, entityType, }: {
|
|
188
|
+
listScoresByScorerId({ scorerId: _scorerId, pagination: _pagination, entityId: _entityId, entityType: _entityType, source: _source, }: {
|
|
200
189
|
scorerId: string;
|
|
201
190
|
pagination: StoragePagination;
|
|
202
191
|
entityId?: string;
|
|
203
192
|
entityType?: string;
|
|
193
|
+
source?: ScoringSource;
|
|
204
194
|
}): Promise<{
|
|
205
195
|
pagination: PaginationInfo;
|
|
206
196
|
scores: ScoreRowData[];
|
|
207
197
|
}>;
|
|
208
|
-
|
|
198
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
199
|
+
score: ScoreRowData;
|
|
200
|
+
}>;
|
|
201
|
+
listScoresByRunId({ runId: _runId, pagination: _pagination, }: {
|
|
209
202
|
runId: string;
|
|
210
203
|
pagination: StoragePagination;
|
|
211
204
|
}): Promise<{
|
|
212
205
|
pagination: PaginationInfo;
|
|
213
206
|
scores: ScoreRowData[];
|
|
214
207
|
}>;
|
|
215
|
-
|
|
208
|
+
listScoresByEntityId({ entityId: _entityId, entityType: _entityType, pagination: _pagination, }: {
|
|
216
209
|
pagination: StoragePagination;
|
|
217
210
|
entityId: string;
|
|
218
211
|
entityType: string;
|
|
@@ -220,8 +213,13 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
220
213
|
pagination: PaginationInfo;
|
|
221
214
|
scores: ScoreRowData[];
|
|
222
215
|
}>;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
216
|
+
listScoresBySpan({ traceId, spanId, pagination: _pagination, }: {
|
|
217
|
+
traceId: string;
|
|
218
|
+
spanId: string;
|
|
219
|
+
pagination: StoragePagination;
|
|
220
|
+
}): Promise<{
|
|
221
|
+
pagination: PaginationInfo;
|
|
222
|
+
scores: ScoreRowData[];
|
|
223
|
+
}>;
|
|
226
224
|
}
|
|
227
225
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAwB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE3E,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GAAG;IAAE,OAAO,EAAE,sBAAsB,CAAA;CAAE,CAAC;AACrH,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,GAAG,MAAM,OAAO,CAAC;AAOxB,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,CACA;IACE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,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AE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAQ7D,gBAAgB,CAAC,EACrB,OAAO,EACP,MAAM,EACN,UAAU,EAAE,WAAW,GACxB,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CAGpE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mssql",
|
|
3
|
-
"version": "0.0.0-new-
|
|
3
|
+
"version": "0.0.0-new-button-export-20251219133013",
|
|
4
4
|
"description": "MSSQL provider for Mastra - db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,30 +12,48 @@
|
|
|
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
|
},
|
|
19
19
|
"./package.json": "./package.json"
|
|
20
20
|
},
|
|
21
|
-
"license": "
|
|
21
|
+
"license": "Apache-2.0",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"mssql": "^
|
|
23
|
+
"mssql": "^11.0.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@types/
|
|
28
|
-
"@
|
|
29
|
-
"
|
|
26
|
+
"@types/mssql": "^9.1.8",
|
|
27
|
+
"@types/node": "22.13.17",
|
|
28
|
+
"@vitest/coverage-v8": "4.0.12",
|
|
29
|
+
"@vitest/ui": "4.0.12",
|
|
30
|
+
"eslint": "^9.37.0",
|
|
30
31
|
"tsup": "^8.5.0",
|
|
31
32
|
"typescript": "^5.8.3",
|
|
32
|
-
"vitest": "
|
|
33
|
-
"@internal/lint": "0.0.0-new-
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
33
|
+
"vitest": "4.0.12",
|
|
34
|
+
"@internal/lint": "0.0.0-new-button-export-20251219133013",
|
|
35
|
+
"@internal/storage-test-utils": "0.0.49",
|
|
36
|
+
"@mastra/core": "0.0.0-new-button-export-20251219133013",
|
|
37
|
+
"@internal/types-builder": "0.0.0-new-button-export-20251219133013"
|
|
36
38
|
},
|
|
37
39
|
"peerDependencies": {
|
|
38
|
-
"@mastra/core": "0.0.0-new-
|
|
40
|
+
"@mastra/core": "0.0.0-new-button-export-20251219133013"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"CHANGELOG.md"
|
|
45
|
+
],
|
|
46
|
+
"homepage": "https://mastra.ai",
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "git+https://github.com/mastra-ai/mastra.git",
|
|
50
|
+
"directory": "stores/mssql"
|
|
51
|
+
},
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=22.13.0"
|
|
39
57
|
},
|
|
40
58
|
"scripts": {
|
|
41
59
|
"build": "tsup --silent --config tsup.config.ts",
|
package/docker-compose.yaml
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
services:
|
|
2
|
-
mssql:
|
|
3
|
-
image: mcr.microsoft.com/mssql/server:2025-latest
|
|
4
|
-
environment:
|
|
5
|
-
- ACCEPT_EULA=Y
|
|
6
|
-
- SA_PASSWORD=Your_password123
|
|
7
|
-
ports:
|
|
8
|
-
- '1433:1433'
|
|
9
|
-
healthcheck:
|
|
10
|
-
test: ['CMD-SHELL', 'echo > /dev/tcp/localhost/1433']
|
|
11
|
-
interval: 10s
|
|
12
|
-
timeout: 5s
|
|
13
|
-
retries: 10
|
|
14
|
-
start_period: 20s
|
package/eslint.config.js
DELETED
package/src/index.ts
DELETED