@mastra/core 0.1.2 → 0.1.3
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/dist/core.cjs.development.js +37 -42
- package/dist/core.cjs.development.js.map +1 -1
- package/dist/core.cjs.production.min.js +1 -1
- package/dist/core.cjs.production.min.js.map +1 -1
- package/dist/core.esm.js +37 -42
- package/dist/core.esm.js.map +1 -1
- package/dist/prisma/migrations/20241008024219_initial_migration/migration.sql +69 -0
- package/dist/types.d.ts +14 -1
- package/package.json +2 -3
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `referenceId` on the `connections` table. All the data in the column will be lost.
|
|
5
|
+
- You are about to drop the column `connectionId` on the `credentials` table. All the data in the column will be lost.
|
|
6
|
+
- You are about to drop the column `connectionId` on the `entity` table. All the data in the column will be lost.
|
|
7
|
+
- A unique constraint covering the columns `[connectionId,name]` on the table `connections` will be added. If there are existing duplicate values, this will fail.
|
|
8
|
+
- A unique constraint covering the columns `[k_id]` on the table `credentials` will be added. If there are existing duplicate values, this will fail.
|
|
9
|
+
- A unique constraint covering the columns `[k_id,type]` on the table `entity` will be added. If there are existing duplicate values, this will fail.
|
|
10
|
+
- Added the required column `connectionId` to the `connections` table without a default value. This is not possible if the table is not empty.
|
|
11
|
+
- Added the required column `k_id` to the `credentials` table without a default value. This is not possible if the table is not empty.
|
|
12
|
+
- Added the required column `k_id` to the `entity` table without a default value. This is not possible if the table is not empty.
|
|
13
|
+
|
|
14
|
+
*/
|
|
15
|
+
-- AlterEnum
|
|
16
|
+
-- This migration adds more than one value to an enum.
|
|
17
|
+
-- With PostgreSQL versions 11 and earlier, this is not possible
|
|
18
|
+
-- in a single migration. This can be worked around by creating
|
|
19
|
+
-- multiple migrations, each migration adding only one value to
|
|
20
|
+
-- the enum.
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
ALTER TYPE "PropertyType" ADD VALUE 'BOOLEAN';
|
|
24
|
+
ALTER TYPE "PropertyType" ADD VALUE 'NUMBER';
|
|
25
|
+
ALTER TYPE "PropertyType" ADD VALUE 'FLOAT';
|
|
26
|
+
ALTER TYPE "PropertyType" ADD VALUE 'JSON_OBJECT';
|
|
27
|
+
ALTER TYPE "PropertyType" ADD VALUE 'JSON_ARRAY';
|
|
28
|
+
|
|
29
|
+
-- DropForeignKey
|
|
30
|
+
ALTER TABLE "credentials" DROP CONSTRAINT "credentials_connectionId_fkey";
|
|
31
|
+
|
|
32
|
+
-- DropForeignKey
|
|
33
|
+
ALTER TABLE "entity" DROP CONSTRAINT "entity_connectionId_fkey";
|
|
34
|
+
|
|
35
|
+
-- DropIndex
|
|
36
|
+
DROP INDEX "connections_referenceId_name_key";
|
|
37
|
+
|
|
38
|
+
-- DropIndex
|
|
39
|
+
DROP INDEX "credentials_connectionId_key";
|
|
40
|
+
|
|
41
|
+
-- DropIndex
|
|
42
|
+
DROP INDEX "entity_connectionId_type_key";
|
|
43
|
+
|
|
44
|
+
-- AlterTable
|
|
45
|
+
ALTER TABLE "connections" DROP COLUMN "referenceId",
|
|
46
|
+
ADD COLUMN "connectionId" TEXT NOT NULL;
|
|
47
|
+
|
|
48
|
+
-- AlterTable
|
|
49
|
+
ALTER TABLE "credentials" DROP COLUMN "connectionId",
|
|
50
|
+
ADD COLUMN "k_id" TEXT NOT NULL;
|
|
51
|
+
|
|
52
|
+
-- AlterTable
|
|
53
|
+
ALTER TABLE "entity" DROP COLUMN "connectionId",
|
|
54
|
+
ADD COLUMN "k_id" TEXT NOT NULL;
|
|
55
|
+
|
|
56
|
+
-- CreateIndex
|
|
57
|
+
CREATE UNIQUE INDEX "connections_connectionId_name_key" ON "connections"("connectionId", "name");
|
|
58
|
+
|
|
59
|
+
-- CreateIndex
|
|
60
|
+
CREATE UNIQUE INDEX "credentials_k_id_key" ON "credentials"("k_id");
|
|
61
|
+
|
|
62
|
+
-- CreateIndex
|
|
63
|
+
CREATE UNIQUE INDEX "entity_k_id_type_key" ON "entity"("k_id", "type");
|
|
64
|
+
|
|
65
|
+
-- AddForeignKey
|
|
66
|
+
ALTER TABLE "credentials" ADD CONSTRAINT "credentials_k_id_fkey" FOREIGN KEY ("k_id") REFERENCES "connections"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
67
|
+
|
|
68
|
+
-- AddForeignKey
|
|
69
|
+
ALTER TABLE "entity" ADD CONSTRAINT "entity_k_id_fkey" FOREIGN KEY ("k_id") REFERENCES "connections"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
package/dist/types.d.ts
CHANGED
|
@@ -2,13 +2,18 @@ import { OAuth2Token } from '@badgateway/oauth2-client';
|
|
|
2
2
|
import { BaseContext } from 'inngest';
|
|
3
3
|
import { ZodSchema } from 'zod';
|
|
4
4
|
import { Integration } from './integration';
|
|
5
|
-
|
|
5
|
+
import { Prisma } from '@prisma-app/client';
|
|
6
|
+
export interface WorkflowConfig {
|
|
6
7
|
blueprintDirPath: string;
|
|
7
8
|
systemApis: Omit<IntegrationApi, 'integrationName'>[];
|
|
8
9
|
systemEvents: {
|
|
9
10
|
[key: string]: IntegrationEvent;
|
|
10
11
|
};
|
|
11
12
|
}
|
|
13
|
+
export interface AgentConfig {
|
|
14
|
+
agentDirPath: string;
|
|
15
|
+
vectorProvider: any[];
|
|
16
|
+
}
|
|
12
17
|
export interface Config {
|
|
13
18
|
name: string;
|
|
14
19
|
packageManager?: string;
|
|
@@ -18,12 +23,18 @@ export interface Config {
|
|
|
18
23
|
provider: string;
|
|
19
24
|
uri: string;
|
|
20
25
|
};
|
|
26
|
+
runner?: {
|
|
27
|
+
provider: string;
|
|
28
|
+
uri: string;
|
|
29
|
+
signingKey?: string;
|
|
30
|
+
};
|
|
21
31
|
workflows: WorkflowConfig;
|
|
22
32
|
integrations: Integration[];
|
|
23
33
|
env?: {
|
|
24
34
|
provider?: 'local' | 'vercel';
|
|
25
35
|
file?: string;
|
|
26
36
|
};
|
|
37
|
+
agents: AgentConfig;
|
|
27
38
|
}
|
|
28
39
|
export type IntegrationContext = {
|
|
29
40
|
connectionId: string;
|
|
@@ -107,6 +118,8 @@ export type RefinedIntegrationEvent<T = unknown> = {
|
|
|
107
118
|
ctx: IntegrationContext;
|
|
108
119
|
}) => Promise<Record<string, SchemaFieldOptions>>;
|
|
109
120
|
zodSchema?: ZodSchema<T>;
|
|
121
|
+
entityType?: string;
|
|
122
|
+
fields?: Prisma.PropertyCreateInput[];
|
|
110
123
|
};
|
|
111
124
|
export declare enum IntegrationCredentialType {
|
|
112
125
|
OAUTH = "OAUTH",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/mylib.esm.js",
|
|
@@ -74,7 +74,6 @@
|
|
|
74
74
|
"test": "jest",
|
|
75
75
|
"clean": "rm -rf dist && rm -rf node_modules",
|
|
76
76
|
"generate": "node --env-file .env ./src/prisma/gen.js && npx prisma generate --schema=./src/prisma/schema.prisma",
|
|
77
|
-
"synchronize": "npx prisma db push --schema=./src/prisma/schema.prisma --force-reset"
|
|
78
|
-
"postinstall": "pnpm generate"
|
|
77
|
+
"synchronize": "npx prisma db push --schema=./src/prisma/schema.prisma --force-reset"
|
|
79
78
|
}
|
|
80
79
|
}
|