@mastra/core 0.1.25 → 0.1.27-alpha.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/dist/agents/index.d.ts +6 -3
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/openai/assistant.d.ts +6 -3
- package/dist/agents/openai/assistant.d.ts.map +1 -1
- package/dist/agents/vector-sync.d.ts.map +1 -1
- package/dist/core.cjs.development.js +821 -7480
- 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 +817 -7419
- package/dist/core.esm.js.map +1 -1
- package/dist/framework.d.ts +16 -19
- package/dist/framework.d.ts.map +1 -1
- package/dist/index.d.ts +1 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/integration.d.ts +1 -0
- package/dist/integration.d.ts.map +1 -1
- package/dist/lib/index.d.ts +0 -5
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/next-src/agent/index.d.ts +62 -0
- package/dist/next-src/agent/index.d.ts.map +1 -0
- package/dist/next-src/index.d.ts +41 -0
- package/dist/next-src/index.d.ts.map +1 -0
- package/dist/next-src/integration/index.d.ts +30 -0
- package/dist/next-src/integration/index.d.ts.map +1 -0
- package/dist/next-src/logger/index.d.ts +61 -0
- package/dist/next-src/logger/index.d.ts.map +1 -0
- package/dist/next-src/tools/index.d.ts +4 -0
- package/dist/next-src/tools/index.d.ts.map +1 -0
- package/dist/next-src/tools/types.d.ts +27 -0
- package/dist/next-src/tools/types.d.ts.map +1 -0
- package/dist/utils/inngest.d.ts +1 -0
- package/dist/utils/inngest.d.ts.map +1 -1
- package/dist/workflows/handler.d.ts +5 -0
- package/dist/workflows/handler.d.ts.map +1 -1
- package/dist/workflows/runner.d.ts.map +1 -1
- package/package.json +14 -17
- package/dist/data-access/index.d.ts +0 -351
- package/dist/data-access/index.d.ts.map +0 -1
- package/dist/generated-types/index.d.ts +0 -5
- package/dist/generated-types/index.d.ts.map +0 -1
- package/dist/lib/logger-utils/logger.d.ts +0 -118
- package/dist/lib/logger-utils/logger.d.ts.map +0 -1
- package/dist/lib/query-builder/constants.d.ts +0 -17
- package/dist/lib/query-builder/constants.d.ts.map +0 -1
- package/dist/lib/query-builder/filters/sql.d.ts +0 -9
- package/dist/lib/query-builder/filters/sql.d.ts.map +0 -1
- package/dist/lib/query-builder/schema.d.ts +0 -37
- package/dist/lib/query-builder/schema.d.ts.map +0 -1
- package/dist/lib/query-builder/sorts/sql.d.ts +0 -8
- package/dist/lib/query-builder/sorts/sql.d.ts.map +0 -1
- package/dist/lib/query-builder/types.d.ts +0 -31
- package/dist/lib/query-builder/types.d.ts.map +0 -1
- package/dist/lib/query-builder/utils.d.ts +0 -27
- package/dist/lib/query-builder/utils.d.ts.map +0 -1
- package/dist/prisma/client.d.ts +0 -3
- package/dist/prisma/client.d.ts.map +0 -1
- package/dist/prisma/client.ts +0 -31
- package/dist/prisma/gen.js +0 -140
- package/dist/prisma/schema.prisma +0 -130
- package/dist/service/service.property.d.ts +0 -25
- package/dist/service/service.property.d.ts.map +0 -1
- package/dist/service/service.record.d.ts +0 -25
- package/dist/service/service.record.d.ts.map +0 -1
package/dist/prisma/client.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { PrismaClient, Prisma } from '@prisma-app/client';
|
|
2
|
-
|
|
3
|
-
const globalForPrisma = globalThis as unknown as {
|
|
4
|
-
standardPrisma: PrismaClient;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const logLevels = ['error', 'warn', 'info'] as Prisma.LogLevel[];
|
|
8
|
-
|
|
9
|
-
if (process.env.SHOW_SQL_QUERY === 'true') {
|
|
10
|
-
logLevels.push('query');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const prisma = (url: string): PrismaClient => {
|
|
14
|
-
let prismaInstance;
|
|
15
|
-
|
|
16
|
-
if (globalForPrisma.standardPrisma) {
|
|
17
|
-
console.log('Reusing Global Prisma Client...');
|
|
18
|
-
prismaInstance = globalForPrisma.standardPrisma;
|
|
19
|
-
} else {
|
|
20
|
-
prismaInstance = new PrismaClient({
|
|
21
|
-
datasourceUrl: url,
|
|
22
|
-
log: logLevels,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
27
|
-
globalForPrisma.standardPrisma = prismaInstance;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return prismaInstance;
|
|
31
|
-
};
|
package/dist/prisma/gen.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
const { writeFileSync } = require('fs');
|
|
2
|
-
|
|
3
|
-
const tmpl = `
|
|
4
|
-
enum PropertyType {
|
|
5
|
-
LONG_TEXT
|
|
6
|
-
SINGLE_LINE_TEXT
|
|
7
|
-
SINGLE_SELECT
|
|
8
|
-
MULTI_SELECT
|
|
9
|
-
CHECKBOX
|
|
10
|
-
DATE
|
|
11
|
-
USER
|
|
12
|
-
BADGE_LIST
|
|
13
|
-
CURRENCY
|
|
14
|
-
URL
|
|
15
|
-
PHONE
|
|
16
|
-
CONTACT
|
|
17
|
-
COMPANY
|
|
18
|
-
PERSON
|
|
19
|
-
ENRICHMENT
|
|
20
|
-
COMPOSITE
|
|
21
|
-
BOOLEAN
|
|
22
|
-
NUMBER
|
|
23
|
-
FLOAT
|
|
24
|
-
JSON_OBJECT
|
|
25
|
-
JSON_ARRAY
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
model Property {
|
|
29
|
-
id String @id @default(cuid())
|
|
30
|
-
name String
|
|
31
|
-
displayName String
|
|
32
|
-
visible Boolean @default(true)
|
|
33
|
-
config Json?
|
|
34
|
-
description String?
|
|
35
|
-
type PropertyType
|
|
36
|
-
order Int
|
|
37
|
-
modifiable Boolean @default(true)
|
|
38
|
-
parentId String? @map("parentId")
|
|
39
|
-
parent Property? @relation("PropertyToProperty", fields: [parentId], references: [id])
|
|
40
|
-
compositeProperty Property[] @relation("PropertyToProperty")
|
|
41
|
-
entity Entity? @relation(fields: [entityId], references: [id])
|
|
42
|
-
entityId String?
|
|
43
|
-
@@map("properties")
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
enum RecordStatus {
|
|
47
|
-
ACTIVE
|
|
48
|
-
ARCHIVED
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
enum RecordEnrichmentStatus {
|
|
52
|
-
PENDING
|
|
53
|
-
APPLIED
|
|
54
|
-
UNAPPLIED
|
|
55
|
-
FAILED
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
model Record {
|
|
59
|
-
id String @id @default(cuid())
|
|
60
|
-
externalId String?
|
|
61
|
-
data Json @default("{}")
|
|
62
|
-
source String @default("MANUAL")
|
|
63
|
-
entityType String
|
|
64
|
-
entity Entity? @relation(fields: [entityId], references: [id])
|
|
65
|
-
entityId String?
|
|
66
|
-
status RecordStatus @default(ACTIVE)
|
|
67
|
-
enrichmentStatus RecordEnrichmentStatus @default(UNAPPLIED)
|
|
68
|
-
deletedAt DateTime?
|
|
69
|
-
createdAt DateTime @default(now())
|
|
70
|
-
updatedAt DateTime? @default(now())
|
|
71
|
-
|
|
72
|
-
@@index([externalId])
|
|
73
|
-
@@map("records")
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
model Credential {
|
|
77
|
-
id String @id @default(cuid())
|
|
78
|
-
type String
|
|
79
|
-
value Json
|
|
80
|
-
scope String[]
|
|
81
|
-
connection Connection @relation(fields: [k_id], references: [id], onDelete: Cascade)
|
|
82
|
-
k_id String @unique
|
|
83
|
-
@@map("credentials")
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
model Connection {
|
|
87
|
-
id String @id @default(cuid())
|
|
88
|
-
name String
|
|
89
|
-
issues String[] @default([])
|
|
90
|
-
syncConfig Json?
|
|
91
|
-
connectionId String
|
|
92
|
-
createdAt DateTime @default(now())
|
|
93
|
-
updatedAt DateTime? @updatedAt
|
|
94
|
-
|
|
95
|
-
lastSyncAt DateTime?
|
|
96
|
-
credential Credential?
|
|
97
|
-
subscriptionId String?
|
|
98
|
-
entities Entity[]
|
|
99
|
-
@@unique([connectionId, name])
|
|
100
|
-
@@index([subscriptionId])
|
|
101
|
-
@@map("connections")
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
model Entity {
|
|
105
|
-
id String @id @default(cuid())
|
|
106
|
-
type String
|
|
107
|
-
properties Property[]
|
|
108
|
-
records Record[]
|
|
109
|
-
|
|
110
|
-
createdAt DateTime @default(now())
|
|
111
|
-
updatedAt DateTime? @default(now())
|
|
112
|
-
createdBy String
|
|
113
|
-
|
|
114
|
-
connection Connection @relation(fields: [k_id], references: [id])
|
|
115
|
-
k_id String
|
|
116
|
-
|
|
117
|
-
lastSyncId String?
|
|
118
|
-
@@unique([k_id, type])
|
|
119
|
-
@@map("entity")
|
|
120
|
-
}
|
|
121
|
-
`;
|
|
122
|
-
|
|
123
|
-
function main() {
|
|
124
|
-
const schema = `
|
|
125
|
-
datasource db {
|
|
126
|
-
provider = "postgresql"
|
|
127
|
-
url = env("DB_URL")
|
|
128
|
-
}
|
|
129
|
-
generator client {
|
|
130
|
-
provider = "prisma-client-js"
|
|
131
|
-
output = "../../node_modules/@prisma-app/client"
|
|
132
|
-
binaryTargets = ["native", "rhel-openssl-3.0.x", "debian-openssl-1.1.x", "debian-openssl-3.0.x"]
|
|
133
|
-
}
|
|
134
|
-
${tmpl}
|
|
135
|
-
`;
|
|
136
|
-
|
|
137
|
-
writeFileSync(__dirname + '/schema.prisma', schema);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
main();
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
datasource db {
|
|
3
|
-
provider = "postgresql"
|
|
4
|
-
url = env("DB_URL")
|
|
5
|
-
}
|
|
6
|
-
generator client {
|
|
7
|
-
provider = "prisma-client-js"
|
|
8
|
-
output = "../../node_modules/@prisma-app/client"
|
|
9
|
-
binaryTargets = ["native", "rhel-openssl-3.0.x", "debian-openssl-1.1.x", "debian-openssl-3.0.x"]
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
enum PropertyType {
|
|
13
|
-
LONG_TEXT
|
|
14
|
-
SINGLE_LINE_TEXT
|
|
15
|
-
SINGLE_SELECT
|
|
16
|
-
MULTI_SELECT
|
|
17
|
-
CHECKBOX
|
|
18
|
-
DATE
|
|
19
|
-
USER
|
|
20
|
-
BADGE_LIST
|
|
21
|
-
CURRENCY
|
|
22
|
-
URL
|
|
23
|
-
PHONE
|
|
24
|
-
CONTACT
|
|
25
|
-
COMPANY
|
|
26
|
-
PERSON
|
|
27
|
-
ENRICHMENT
|
|
28
|
-
COMPOSITE
|
|
29
|
-
BOOLEAN
|
|
30
|
-
NUMBER
|
|
31
|
-
FLOAT
|
|
32
|
-
JSON_OBJECT
|
|
33
|
-
JSON_ARRAY
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
model Property {
|
|
37
|
-
id String @id @default(cuid())
|
|
38
|
-
name String
|
|
39
|
-
displayName String
|
|
40
|
-
visible Boolean @default(true)
|
|
41
|
-
config Json?
|
|
42
|
-
description String?
|
|
43
|
-
type PropertyType
|
|
44
|
-
order Int
|
|
45
|
-
modifiable Boolean @default(true)
|
|
46
|
-
parentId String? @map("parentId")
|
|
47
|
-
parent Property? @relation("PropertyToProperty", fields: [parentId], references: [id])
|
|
48
|
-
compositeProperty Property[] @relation("PropertyToProperty")
|
|
49
|
-
entity Entity? @relation(fields: [entityId], references: [id])
|
|
50
|
-
entityId String?
|
|
51
|
-
@@map("properties")
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
enum RecordStatus {
|
|
55
|
-
ACTIVE
|
|
56
|
-
ARCHIVED
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
enum RecordEnrichmentStatus {
|
|
60
|
-
PENDING
|
|
61
|
-
APPLIED
|
|
62
|
-
UNAPPLIED
|
|
63
|
-
FAILED
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
model Record {
|
|
67
|
-
id String @id @default(cuid())
|
|
68
|
-
externalId String?
|
|
69
|
-
data Json @default("{}")
|
|
70
|
-
source String @default("MANUAL")
|
|
71
|
-
entityType String
|
|
72
|
-
entity Entity? @relation(fields: [entityId], references: [id])
|
|
73
|
-
entityId String?
|
|
74
|
-
status RecordStatus @default(ACTIVE)
|
|
75
|
-
enrichmentStatus RecordEnrichmentStatus @default(UNAPPLIED)
|
|
76
|
-
deletedAt DateTime?
|
|
77
|
-
createdAt DateTime @default(now())
|
|
78
|
-
updatedAt DateTime? @default(now())
|
|
79
|
-
|
|
80
|
-
@@index([externalId])
|
|
81
|
-
@@map("records")
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
model Credential {
|
|
85
|
-
id String @id @default(cuid())
|
|
86
|
-
type String
|
|
87
|
-
value Json
|
|
88
|
-
scope String[]
|
|
89
|
-
connection Connection @relation(fields: [k_id], references: [id], onDelete: Cascade)
|
|
90
|
-
k_id String @unique
|
|
91
|
-
@@map("credentials")
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
model Connection {
|
|
95
|
-
id String @id @default(cuid())
|
|
96
|
-
name String
|
|
97
|
-
issues String[] @default([])
|
|
98
|
-
syncConfig Json?
|
|
99
|
-
connectionId String
|
|
100
|
-
createdAt DateTime @default(now())
|
|
101
|
-
updatedAt DateTime? @updatedAt
|
|
102
|
-
|
|
103
|
-
lastSyncAt DateTime?
|
|
104
|
-
credential Credential?
|
|
105
|
-
subscriptionId String?
|
|
106
|
-
entities Entity[]
|
|
107
|
-
@@unique([connectionId, name])
|
|
108
|
-
@@index([subscriptionId])
|
|
109
|
-
@@map("connections")
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
model Entity {
|
|
113
|
-
id String @id @default(cuid())
|
|
114
|
-
type String
|
|
115
|
-
properties Property[]
|
|
116
|
-
records Record[]
|
|
117
|
-
|
|
118
|
-
createdAt DateTime @default(now())
|
|
119
|
-
updatedAt DateTime? @default(now())
|
|
120
|
-
createdBy String
|
|
121
|
-
|
|
122
|
-
connection Connection @relation(fields: [k_id], references: [id])
|
|
123
|
-
k_id String
|
|
124
|
-
|
|
125
|
-
lastSyncId String?
|
|
126
|
-
@@unique([k_id, type])
|
|
127
|
-
@@map("entity")
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { prisma } from '../prisma/client';
|
|
2
|
-
import { PrismaClient } from '@prisma-app/client';
|
|
3
|
-
export declare class PropertyService<T extends typeof prisma> {
|
|
4
|
-
db: PrismaClient;
|
|
5
|
-
constructor({ db }: {
|
|
6
|
-
db: T;
|
|
7
|
-
});
|
|
8
|
-
getPropertiesByEntityType({ entityType, }: {
|
|
9
|
-
entityType: string;
|
|
10
|
-
}): Promise<{
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
displayName: string;
|
|
14
|
-
visible: boolean;
|
|
15
|
-
config: import("@prisma-app/client/runtime/library").JsonValue | null;
|
|
16
|
-
description: string | null;
|
|
17
|
-
type: import("@prisma-app/client").$Enums.PropertyType;
|
|
18
|
-
order: number;
|
|
19
|
-
modifiable: boolean;
|
|
20
|
-
parentId: string | null;
|
|
21
|
-
entityId: string | null;
|
|
22
|
-
}[]>;
|
|
23
|
-
}
|
|
24
|
-
export declare const propertyService: PropertyService<(url: string) => PrismaClient>;
|
|
25
|
-
//# sourceMappingURL=service.property.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.property.d.ts","sourceRoot":"","sources":["../../src/service/service.property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,qBAAa,eAAe,CAAC,CAAC,SAAS,OAAO,MAAM;IAClD,EAAE,EAAE,YAAY,CAAC;gBACL,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,CAAC,CAAA;KAAE;IAIvB,yBAAyB,CAAC,EAC9B,UAAU,GACX,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;KAEpB;;;;;;;;;;;;;CASF;AAED,eAAO,MAAM,eAAe,gDAAsC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { prisma } from '../prisma/client';
|
|
2
|
-
import { PrismaClient } from '@prisma-app/client';
|
|
3
|
-
import { PropertyService } from './service.property';
|
|
4
|
-
import { FilterObject } from '../lib/query-builder/types';
|
|
5
|
-
export declare class RecordService<T extends typeof prisma> {
|
|
6
|
-
db: PrismaClient;
|
|
7
|
-
propertyService: PropertyService<T>;
|
|
8
|
-
constructor({ db }: {
|
|
9
|
-
db: T;
|
|
10
|
-
});
|
|
11
|
-
buildRecordQuerySql({ whereClause, filterClause, sortClauses, entityType, }: {
|
|
12
|
-
whereClause: string;
|
|
13
|
-
filterClause?: string;
|
|
14
|
-
entityType: string;
|
|
15
|
-
sortClauses: string[];
|
|
16
|
-
}): string;
|
|
17
|
-
getFilteredRecords<T extends string | number | symbol>({ entityType, k_id, filters, sort, }: {
|
|
18
|
-
entityType: string;
|
|
19
|
-
filters?: FilterObject<T>;
|
|
20
|
-
sort?: string[];
|
|
21
|
-
k_id: string;
|
|
22
|
-
}): Promise<any>;
|
|
23
|
-
}
|
|
24
|
-
export declare const recordService: RecordService<(url: string) => PrismaClient>;
|
|
25
|
-
//# sourceMappingURL=service.record.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.record.d.ts","sourceRoot":"","sources":["../../src/service/service.record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAGL,YAAY,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMrD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,qBAAa,aAAa,CAAC,CAAC,SAAS,OAAO,MAAM;IAChD,EAAE,EAAE,YAAY,CAAC;IACjB,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;gBAExB,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,CAAC,CAAA;KAAE;IAK7B,mBAAmB,CAAC,EAClB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,GACX,EAAE;QACD,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB;IAeK,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,EAC3D,UAAU,EACV,IAAI,EACJ,OAAO,EACP,IAAI,GACL,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;KACd;CAiEF;AAED,eAAO,MAAM,aAAa,8CAAoC,CAAC"}
|