@mastra/mysql 0.0.0
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/README.md +81 -0
- package/dist/index.cjs +10820 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10803 -0
- package/dist/index.js.map +1 -0
- package/dist/storage/domains/agents/index.d.ts +62 -0
- package/dist/storage/domains/agents/index.d.ts.map +1 -0
- package/dist/storage/domains/background-tasks/index.d.ts +33 -0
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -0
- package/dist/storage/domains/blobs/index.d.ts +22 -0
- package/dist/storage/domains/blobs/index.d.ts.map +1 -0
- package/dist/storage/domains/channels/index.d.ts +34 -0
- package/dist/storage/domains/channels/index.d.ts.map +1 -0
- package/dist/storage/domains/datasets/index.d.ts +75 -0
- package/dist/storage/domains/datasets/index.d.ts.map +1 -0
- package/dist/storage/domains/experiments/index.d.ts +63 -0
- package/dist/storage/domains/experiments/index.d.ts.map +1 -0
- package/dist/storage/domains/favorites/index.d.ts +49 -0
- package/dist/storage/domains/favorites/index.d.ts.map +1 -0
- package/dist/storage/domains/mcp-clients/index.d.ts +61 -0
- package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -0
- package/dist/storage/domains/mcp-servers/index.d.ts +61 -0
- package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -0
- package/dist/storage/domains/memory/index.d.ts +110 -0
- package/dist/storage/domains/memory/index.d.ts.map +1 -0
- package/dist/storage/domains/observability/index.d.ts +35 -0
- package/dist/storage/domains/observability/index.d.ts.map +1 -0
- package/dist/storage/domains/operations/index.d.ts +106 -0
- package/dist/storage/domains/operations/index.d.ts.map +1 -0
- package/dist/storage/domains/prompt-blocks/index.d.ts +42 -0
- package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -0
- package/dist/storage/domains/schedules/index.d.ts +33 -0
- package/dist/storage/domains/schedules/index.d.ts.map +1 -0
- package/dist/storage/domains/scorer-definitions/index.d.ts +43 -0
- package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -0
- package/dist/storage/domains/scores/index.d.ts +87 -0
- package/dist/storage/domains/scores/index.d.ts.map +1 -0
- package/dist/storage/domains/skills/index.d.ts +61 -0
- package/dist/storage/domains/skills/index.d.ts.map +1 -0
- package/dist/storage/domains/tool-provider-connections/index.d.ts +46 -0
- package/dist/storage/domains/tool-provider-connections/index.d.ts.map +1 -0
- package/dist/storage/domains/utils.d.ts +40 -0
- package/dist/storage/domains/utils.d.ts.map +1 -0
- package/dist/storage/domains/workflows/index.d.ts +78 -0
- package/dist/storage/domains/workflows/index.d.ts.map +1 -0
- package/dist/storage/domains/workspaces/index.d.ts +61 -0
- package/dist/storage/domains/workspaces/index.d.ts.map +1 -0
- package/dist/storage/index.d.ts +58 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { CreateIndexOptions, StorageListWorkflowRunsInput, UpdateWorkflowStateOptions, WorkflowRun, WorkflowRuns } from '@mastra/core/storage';
|
|
3
|
+
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
4
|
+
import type { Pool } from 'mysql2/promise';
|
|
5
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
6
|
+
export declare class WorkflowsMySQL extends WorkflowsStorage {
|
|
7
|
+
#private;
|
|
8
|
+
private operations;
|
|
9
|
+
private pool;
|
|
10
|
+
/** Tables managed by this domain */
|
|
11
|
+
static readonly MANAGED_TABLES: readonly ["mastra_workflow_snapshot"];
|
|
12
|
+
/**
|
|
13
|
+
* Returns default index definitions for the workflows domain tables.
|
|
14
|
+
* Currently no default indexes are defined for workflows.
|
|
15
|
+
*/
|
|
16
|
+
static getDefaultIndexDefs(_prefix?: string): CreateIndexOptions[];
|
|
17
|
+
/**
|
|
18
|
+
* Exports DDL statements for all managed tables.
|
|
19
|
+
*/
|
|
20
|
+
static getExportDDL(): string[];
|
|
21
|
+
constructor({ operations, pool, skipDefaultIndexes, indexes, }: {
|
|
22
|
+
operations: StoreOperationsMySQL;
|
|
23
|
+
pool: Pool;
|
|
24
|
+
skipDefaultIndexes?: boolean;
|
|
25
|
+
indexes?: CreateIndexOptions[];
|
|
26
|
+
});
|
|
27
|
+
supportsConcurrentUpdates(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Returns default index definitions for the workflows domain tables.
|
|
30
|
+
*/
|
|
31
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
32
|
+
/**
|
|
33
|
+
* Creates default indexes for optimal query performance.
|
|
34
|
+
* Currently no default indexes are defined for workflows.
|
|
35
|
+
*/
|
|
36
|
+
createDefaultIndexes(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Creates custom user-defined indexes for this domain's tables.
|
|
39
|
+
*/
|
|
40
|
+
createCustomIndexes(): Promise<void>;
|
|
41
|
+
init(): Promise<void>;
|
|
42
|
+
dangerouslyClearAll(): Promise<void>;
|
|
43
|
+
deleteWorkflowRunById({ runId, workflowName }: {
|
|
44
|
+
runId: string;
|
|
45
|
+
workflowName: string;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
48
|
+
workflowName: string;
|
|
49
|
+
runId: string;
|
|
50
|
+
stepId: string;
|
|
51
|
+
result: StepResult<any, any, any, any>;
|
|
52
|
+
requestContext?: Record<string, any>;
|
|
53
|
+
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
54
|
+
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
55
|
+
workflowName: string;
|
|
56
|
+
runId: string;
|
|
57
|
+
opts: UpdateWorkflowStateOptions;
|
|
58
|
+
}): Promise<WorkflowRunState | undefined>;
|
|
59
|
+
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, createdAt, updatedAt, }: {
|
|
60
|
+
workflowName: string;
|
|
61
|
+
runId: string;
|
|
62
|
+
resourceId?: string;
|
|
63
|
+
snapshot: WorkflowRunState;
|
|
64
|
+
createdAt?: Date;
|
|
65
|
+
updatedAt?: Date;
|
|
66
|
+
}): Promise<void>;
|
|
67
|
+
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
68
|
+
workflowName: string;
|
|
69
|
+
runId: string;
|
|
70
|
+
}): Promise<WorkflowRunState | null>;
|
|
71
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
72
|
+
getWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
73
|
+
getWorkflowRunById({ runId, workflowName, }: {
|
|
74
|
+
runId: string;
|
|
75
|
+
workflowName?: string;
|
|
76
|
+
}): Promise<WorkflowRun | null>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA0C,gBAAgB,EAAoB,MAAM,sBAAsB,CAAC;AAClH,OAAO,KAAK,EACV,kBAAkB,EAClB,4BAA4B,EAC5B,0BAA0B,EAC1B,WAAW,EACX,YAAY,EACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,IAAI,EAAiB,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAmC1D,qBAAa,cAAe,SAAQ,gBAAgB;;IAClD,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,IAAI,CAAO;IAInB,oCAAoC;IACpC,MAAM,CAAC,QAAQ,CAAC,cAAc,wCAAsC;IAEpE;;;OAGG;IACH,M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B,CAAC,EACxB,YAAY,EACZ,KAAK,EACL,IAAI,GACL,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,0BAA0B,CAAC;KAClC,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAyCnC,uBAAuB,CAAC,EAC5B,YAAY,EACZ,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,SAAS,GACV,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,gBAAgB,CAAC;QAC3B,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,SAAS,CAAC,EAAE,IAAI,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCX,oBAAoB,CAAC,EACzB,YAAY,EACZ,KAAK,GACN,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAoB9B,gBAAgB,CAAC,IAAI,GAAE,4BAAiC,GAAG,OAAO,CAAC,YAAY,CAAC;IA6EhF,eAAe,CAAC,IAAI,GAAE,4BAAiC,GAAG,OAAO,CAAC,YAAY,CAAC;IAI/E,kBAAkB,CAAC,EACvB,KAAK,EACL,YAAY,GACb,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;CAyBhC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { WorkspacesStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { CreateIndexOptions, StorageWorkspaceType, StorageCreateWorkspaceInput, StorageUpdateWorkspaceInput, StorageListWorkspacesInput, StorageListWorkspacesOutput } from '@mastra/core/storage';
|
|
3
|
+
import type { WorkspaceVersion, CreateWorkspaceVersionInput, ListWorkspaceVersionsInput, ListWorkspaceVersionsOutput } from '@mastra/core/storage/domains/workspaces';
|
|
4
|
+
import type { Pool } from 'mysql2/promise';
|
|
5
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
6
|
+
export declare class WorkspacesMySQL extends WorkspacesStorage {
|
|
7
|
+
#private;
|
|
8
|
+
private pool;
|
|
9
|
+
private operations;
|
|
10
|
+
/** Tables managed by this domain */
|
|
11
|
+
static readonly MANAGED_TABLES: readonly ["mastra_workspaces", "mastra_workspace_versions"];
|
|
12
|
+
/**
|
|
13
|
+
* Returns default index definitions for the workspaces domain tables.
|
|
14
|
+
* Currently no default indexes are defined for workspaces.
|
|
15
|
+
*/
|
|
16
|
+
static getDefaultIndexDefs(_prefix?: string): CreateIndexOptions[];
|
|
17
|
+
/**
|
|
18
|
+
* Exports DDL statements for all managed tables.
|
|
19
|
+
*/
|
|
20
|
+
static getExportDDL(): string[];
|
|
21
|
+
constructor({ pool, operations, skipDefaultIndexes, indexes, }: {
|
|
22
|
+
pool: Pool;
|
|
23
|
+
operations: StoreOperationsMySQL;
|
|
24
|
+
skipDefaultIndexes?: boolean;
|
|
25
|
+
indexes?: CreateIndexOptions[];
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Returns default index definitions for the workspaces domain tables.
|
|
29
|
+
*/
|
|
30
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
31
|
+
/**
|
|
32
|
+
* Creates default indexes for optimal query performance.
|
|
33
|
+
* Currently no default indexes are defined for workspaces.
|
|
34
|
+
*/
|
|
35
|
+
createDefaultIndexes(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates custom user-defined indexes for this domain's tables.
|
|
38
|
+
*/
|
|
39
|
+
createCustomIndexes(): Promise<void>;
|
|
40
|
+
init(): Promise<void>;
|
|
41
|
+
dangerouslyClearAll(): Promise<void>;
|
|
42
|
+
private safeParseJSON;
|
|
43
|
+
private parseWorkspaceRow;
|
|
44
|
+
private parseVersionRow;
|
|
45
|
+
getById(id: string): Promise<StorageWorkspaceType | null>;
|
|
46
|
+
create(input: {
|
|
47
|
+
workspace: StorageCreateWorkspaceInput;
|
|
48
|
+
}): Promise<StorageWorkspaceType>;
|
|
49
|
+
update(input: StorageUpdateWorkspaceInput): Promise<StorageWorkspaceType>;
|
|
50
|
+
delete(id: string): Promise<void>;
|
|
51
|
+
list(args?: StorageListWorkspacesInput): Promise<StorageListWorkspacesOutput>;
|
|
52
|
+
createVersion(input: CreateWorkspaceVersionInput): Promise<WorkspaceVersion>;
|
|
53
|
+
getVersion(id: string): Promise<WorkspaceVersion | null>;
|
|
54
|
+
getVersionByNumber(workspaceId: string, versionNumber: number): Promise<WorkspaceVersion | null>;
|
|
55
|
+
getLatestVersion(workspaceId: string): Promise<WorkspaceVersion | null>;
|
|
56
|
+
listVersions(input: ListWorkspaceVersionsInput): Promise<ListWorkspaceVersionsOutput>;
|
|
57
|
+
deleteVersion(id: string): Promise<void>;
|
|
58
|
+
deleteVersionsByParentId(entityId: string): Promise<void>;
|
|
59
|
+
countVersions(workspaceId: string): Promise<number>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workspaces/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EASlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,gBAAgB,EAChB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAiB,MAAM,gBAAgB,CAA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,CAAC;IAmBjC,IAAI,CAAC,IAAI,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA4E7E,aAAa,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAsC5E,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAoBxD,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAwBhG,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAsBvE,YAAY,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAwCrF,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBxC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBzD,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAkB1D"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { MastraCompositeStore } from '@mastra/core/storage';
|
|
2
|
+
import type { StorageDomains, CreateIndexOptions } from '@mastra/core/storage';
|
|
3
|
+
import { AgentsMySQL } from './domains/agents/index.js';
|
|
4
|
+
import { BackgroundTasksMySQL } from './domains/background-tasks/index.js';
|
|
5
|
+
import { BlobsMySQL } from './domains/blobs/index.js';
|
|
6
|
+
import { ChannelsMySQL } from './domains/channels/index.js';
|
|
7
|
+
import { DatasetsMySQL } from './domains/datasets/index.js';
|
|
8
|
+
import { ExperimentsMySQL } from './domains/experiments/index.js';
|
|
9
|
+
import { FavoritesMySQL } from './domains/favorites/index.js';
|
|
10
|
+
import { MCPClientsMySQL } from './domains/mcp-clients/index.js';
|
|
11
|
+
import { MCPServersMySQL } from './domains/mcp-servers/index.js';
|
|
12
|
+
import { MemoryMySQL } from './domains/memory/index.js';
|
|
13
|
+
import { ObservabilityMySQL } from './domains/observability/index.js';
|
|
14
|
+
import { StoreOperationsMySQL } from './domains/operations/index.js';
|
|
15
|
+
import { PromptBlocksMySQL } from './domains/prompt-blocks/index.js';
|
|
16
|
+
import { SchedulesMySQL } from './domains/schedules/index.js';
|
|
17
|
+
import { ScorerDefinitionsMySQL } from './domains/scorer-definitions/index.js';
|
|
18
|
+
import { ScoresMySQL } from './domains/scores/index.js';
|
|
19
|
+
import { SkillsMySQL } from './domains/skills/index.js';
|
|
20
|
+
import { ToolProviderConnectionsMySQL } from './domains/tool-provider-connections/index.js';
|
|
21
|
+
import { WorkflowsMySQL } from './domains/workflows/index.js';
|
|
22
|
+
import { WorkspacesMySQL } from './domains/workspaces/index.js';
|
|
23
|
+
export { AgentsMySQL, BackgroundTasksMySQL, BlobsMySQL, ChannelsMySQL, DatasetsMySQL, ExperimentsMySQL, FavoritesMySQL, MCPClientsMySQL, MCPServersMySQL, MemoryMySQL, ObservabilityMySQL, StoreOperationsMySQL, PromptBlocksMySQL, SchedulesMySQL, ScorerDefinitionsMySQL, ScoresMySQL, SkillsMySQL, ToolProviderConnectionsMySQL, WorkflowsMySQL, WorkspacesMySQL, };
|
|
24
|
+
export type MySQLStoreConfig = ({
|
|
25
|
+
connectionString: string;
|
|
26
|
+
database?: string;
|
|
27
|
+
max?: number;
|
|
28
|
+
ssl?: boolean | Record<string, unknown>;
|
|
29
|
+
} | {
|
|
30
|
+
host: string;
|
|
31
|
+
port?: number;
|
|
32
|
+
user: string;
|
|
33
|
+
password?: string;
|
|
34
|
+
database: string;
|
|
35
|
+
ssl?: boolean | Record<string, unknown>;
|
|
36
|
+
max?: number;
|
|
37
|
+
waitForConnections?: boolean;
|
|
38
|
+
queueLimit?: number;
|
|
39
|
+
}) & {
|
|
40
|
+
skipDefaultIndexes?: boolean;
|
|
41
|
+
indexes?: CreateIndexOptions[];
|
|
42
|
+
};
|
|
43
|
+
export declare class MySQLStore extends MastraCompositeStore {
|
|
44
|
+
private pool;
|
|
45
|
+
stores: StorageDomains;
|
|
46
|
+
constructor(config: MySQLStoreConfig & {
|
|
47
|
+
id?: string;
|
|
48
|
+
disableInit?: boolean;
|
|
49
|
+
});
|
|
50
|
+
init(): Promise<void>;
|
|
51
|
+
close(): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Exports the Mastra database schema as MySQL DDL statements.
|
|
55
|
+
* Does not require a database connection.
|
|
56
|
+
*/
|
|
57
|
+
export declare function exportSchemas(): string;
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI/E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,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BAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CACJ,GAAG;IACF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAChC,CAAC;AAsHF,qBAAa,UAAW,SAAQ,oBAAoB;IAClD,OAAO,CAAC,IAAI,CAAO;IAEnB,MAAM,EAAE,cAAc,CAAC;gBAEX,MAAM,EAAE,gBAAgB,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE;IA4IvE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B;AAqBD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAQtC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mastra/mysql",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "MySQL provider for Mastra - db storage capabilities",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.cjs"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build:lib": "tsup --silent --config tsup.config.ts",
|
|
23
|
+
"prepack": "pnpx tsx ../../scripts/generate-package-docs.ts",
|
|
24
|
+
"build:watch": "tsup --watch --silent --config tsup.config.ts",
|
|
25
|
+
"pretest": "docker compose up -d && (found=0; for i in $(seq 1 30); do docker compose ps | grep db >/dev/null && { found=1; break; } || sleep 1; done; [ \"$found\" -eq 1 ]) && (found=0; for i in $(seq 1 30); do container=$(docker compose ps -q db); [ -n \"$container\" ] && docker inspect --format='{{.State.Health.Status}}' \"$container\" | grep healthy >/dev/null && { found=1; break; } || sleep 2; done; [ \"$found\" -eq 1 ])",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"pretest:watch": "docker compose up -d",
|
|
28
|
+
"test:watch": "vitest watch",
|
|
29
|
+
"posttest:watch": "docker compose down -v",
|
|
30
|
+
"lint": "eslint ."
|
|
31
|
+
},
|
|
32
|
+
"license": "Apache-2.0",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"mysql2": "^3.11.3"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@internal/lint": "workspace:*",
|
|
38
|
+
"@internal/storage-test-utils": "workspace:*",
|
|
39
|
+
"@internal/types-builder": "workspace:*",
|
|
40
|
+
"@mastra/core": "workspace:*",
|
|
41
|
+
"@types/node": "22.19.7",
|
|
42
|
+
"@vitest/coverage-v8": "catalog:",
|
|
43
|
+
"@vitest/ui": "catalog:",
|
|
44
|
+
"eslint": "^9.37.0",
|
|
45
|
+
"tsup": "^8.5.1",
|
|
46
|
+
"typescript": "catalog:",
|
|
47
|
+
"vitest": "catalog:"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@mastra/core": ">=1.0.0-0 <2.0.0-0"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"dist",
|
|
54
|
+
"CHANGELOG.md"
|
|
55
|
+
],
|
|
56
|
+
"homepage": "https://mastra.ai",
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "git+https://github.com/mastra-ai/mastra.git",
|
|
60
|
+
"directory": "stores/mysql"
|
|
61
|
+
},
|
|
62
|
+
"bugs": {
|
|
63
|
+
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=22.13.0"
|
|
67
|
+
}
|
|
68
|
+
}
|