@inkeep/agents-core 0.37.1 → 0.38.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/auth/auth-schema.d.ts +47 -1
- package/dist/auth/auth-schema.js +1 -1
- package/dist/auth/auth-validation-schemas.d.ts +35 -1
- package/dist/auth/auth-validation-schemas.js +2 -2
- package/dist/auth/auth.d.ts +24 -23
- package/dist/auth/auth.js +11 -4
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/auth/permissions.js +1 -1
- package/dist/chunk-3OPS2LN5.js +4 -0
- package/dist/{chunk-7CLFCY6J.js → chunk-7IQFIW44.js} +2 -0
- package/dist/{chunk-ZEZCCHV7.js → chunk-AJCP2QYU.js} +2 -2
- package/dist/{chunk-7GZHUB4J.js → chunk-AUGHKZEB.js} +42 -2
- package/dist/{chunk-W3QDM7WH.js → chunk-CWAFZVRI.js} +2 -2
- package/dist/{chunk-I6IF7ZTL.js → chunk-DW4DNYUS.js} +2 -2
- package/dist/chunk-GENLXHZ4.js +159 -0
- package/dist/{chunk-VMSYBWFH.js → chunk-JNBVHWXX.js} +7 -4
- package/dist/{chunk-PVRIMF6N.js → chunk-LH6OJIIM.js} +27 -12
- package/dist/{chunk-ROXPFQAM.js → chunk-MGHGIB7U.js} +25 -31
- package/dist/{chunk-FOK3JSQN.js → chunk-S4XQEAAF.js} +7 -4
- package/dist/{chunk-K6GMXJPW.js → chunk-UK63CULA.js} +7 -14
- package/dist/{chunk-LL6F3EAR.js → chunk-ZIXAWYZI.js} +1 -1
- package/dist/{client-B_3j-V4-.d.ts → client-DG_xZdlN.d.ts} +1 -1
- package/dist/client-exports.d.ts +14 -8
- package/dist/client-exports.js +10 -4
- package/dist/constants/models.d.ts +2 -0
- package/dist/constants/models.js +1 -1
- package/dist/constants/schema-validation/index.js +1 -1
- package/dist/credential-stores/index.d.ts +6 -6
- package/dist/credential-stores/index.js +1 -1
- package/dist/db/schema.d.ts +3 -4
- package/dist/db/schema.js +2 -2
- package/dist/db/test-client.d.ts +4 -5
- package/dist/db/test-client.js +1 -1
- package/dist/index.d.ts +379 -362
- package/dist/index.js +186 -125
- package/dist/{schema-DKbG39on.d.ts → schema-DA6PfmoP.d.ts} +83 -7
- package/dist/{server-BXoUiBMg.d.ts → server-BviIeoo5.d.ts} +1 -1
- package/dist/types/index.d.ts +3 -4
- package/dist/{utility-Lo5NoRHK.d.ts → utility-dsfXkYTu.d.ts} +1018 -366
- package/dist/utils/schema-conversion.d.ts +12 -2
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/index.d.ts +131 -132
- package/dist/validation/index.js +2 -2
- package/drizzle/0002_puzzling_goblin_queen.sql +8 -0
- package/drizzle/0003_sweet_human_robot.sql +8 -0
- package/drizzle/0004_cuddly_shooting_star.sql +6 -0
- package/drizzle/0005_reflective_starfox.sql +9 -0
- package/drizzle/meta/0003_snapshot.json +3643 -0
- package/drizzle/meta/0005_snapshot.json +3693 -0
- package/drizzle/meta/_journal.json +28 -0
- package/package.json +9 -11
- package/dist/chunk-NFTJ5JBY.js +0 -82
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as drizzle_orm from 'drizzle-orm';
|
|
1
2
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
2
3
|
|
|
3
4
|
declare const user: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
@@ -1073,6 +1074,23 @@ declare const invitation: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
1073
1074
|
identity: undefined;
|
|
1074
1075
|
generated: undefined;
|
|
1075
1076
|
}, {}, {}>;
|
|
1077
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
1078
|
+
name: "created_at";
|
|
1079
|
+
tableName: "invitation";
|
|
1080
|
+
dataType: "date";
|
|
1081
|
+
columnType: "PgTimestamp";
|
|
1082
|
+
data: Date;
|
|
1083
|
+
driverParam: string;
|
|
1084
|
+
notNull: true;
|
|
1085
|
+
hasDefault: true;
|
|
1086
|
+
isPrimaryKey: false;
|
|
1087
|
+
isAutoincrement: false;
|
|
1088
|
+
hasRuntimeDefault: false;
|
|
1089
|
+
enumValues: undefined;
|
|
1090
|
+
baseColumn: never;
|
|
1091
|
+
identity: undefined;
|
|
1092
|
+
generated: undefined;
|
|
1093
|
+
}, {}, {}>;
|
|
1076
1094
|
inviterId: drizzle_orm_pg_core.PgColumn<{
|
|
1077
1095
|
name: "inviter_id";
|
|
1078
1096
|
tableName: "invitation";
|
|
@@ -1093,5 +1111,33 @@ declare const invitation: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
1093
1111
|
};
|
|
1094
1112
|
dialect: "pg";
|
|
1095
1113
|
}>;
|
|
1114
|
+
declare const userRelations: drizzle_orm.Relations<"user", {
|
|
1115
|
+
sessions: drizzle_orm.Many<"session">;
|
|
1116
|
+
accounts: drizzle_orm.Many<"account">;
|
|
1117
|
+
ssoProviders: drizzle_orm.Many<"sso_provider">;
|
|
1118
|
+
members: drizzle_orm.Many<"member">;
|
|
1119
|
+
invitations: drizzle_orm.Many<"invitation">;
|
|
1120
|
+
}>;
|
|
1121
|
+
declare const sessionRelations: drizzle_orm.Relations<"session", {
|
|
1122
|
+
user: drizzle_orm.One<"user", true>;
|
|
1123
|
+
}>;
|
|
1124
|
+
declare const accountRelations: drizzle_orm.Relations<"account", {
|
|
1125
|
+
user: drizzle_orm.One<"user", true>;
|
|
1126
|
+
}>;
|
|
1127
|
+
declare const ssoProviderRelations: drizzle_orm.Relations<"sso_provider", {
|
|
1128
|
+
user: drizzle_orm.One<"user", false>;
|
|
1129
|
+
}>;
|
|
1130
|
+
declare const organizationRelations: drizzle_orm.Relations<"organization", {
|
|
1131
|
+
members: drizzle_orm.Many<"member">;
|
|
1132
|
+
invitations: drizzle_orm.Many<"invitation">;
|
|
1133
|
+
}>;
|
|
1134
|
+
declare const memberRelations: drizzle_orm.Relations<"member", {
|
|
1135
|
+
organization: drizzle_orm.One<"organization", true>;
|
|
1136
|
+
user: drizzle_orm.One<"user", true>;
|
|
1137
|
+
}>;
|
|
1138
|
+
declare const invitationRelations: drizzle_orm.Relations<"invitation", {
|
|
1139
|
+
organization: drizzle_orm.One<"organization", true>;
|
|
1140
|
+
user: drizzle_orm.One<"user", true>;
|
|
1141
|
+
}>;
|
|
1096
1142
|
|
|
1097
|
-
export { account, invitation, member, organization, session, ssoProvider, user, verification };
|
|
1143
|
+
export { account, accountRelations, invitation, invitationRelations, member, memberRelations, organization, organizationRelations, session, sessionRelations, ssoProvider, ssoProviderRelations, user, userRelations, verification };
|
package/dist/auth/auth-schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { account, invitation, member, organization, session, ssoProvider, user, verification } from '../chunk-
|
|
1
|
+
export { account, accountRelations, invitation, invitationRelations, member, memberRelations, organization, organizationRelations, session, sessionRelations, ssoProvider, ssoProviderRelations, user, userRelations, verification } from '../chunk-GENLXHZ4.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as drizzle_zod from 'drizzle-zod';
|
|
2
2
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
3
|
-
import { z } from 'zod';
|
|
3
|
+
import { z } from '@hono/zod-openapi';
|
|
4
4
|
|
|
5
5
|
declare const UserSelectSchema: drizzle_zod.BuildSchema<"select", {
|
|
6
6
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
@@ -1485,6 +1485,23 @@ declare const InvitationSelectSchema: drizzle_zod.BuildSchema<"select", {
|
|
|
1485
1485
|
identity: undefined;
|
|
1486
1486
|
generated: undefined;
|
|
1487
1487
|
}, {}, {}>;
|
|
1488
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
1489
|
+
name: "created_at";
|
|
1490
|
+
tableName: "invitation";
|
|
1491
|
+
dataType: "date";
|
|
1492
|
+
columnType: "PgTimestamp";
|
|
1493
|
+
data: Date;
|
|
1494
|
+
driverParam: string;
|
|
1495
|
+
notNull: true;
|
|
1496
|
+
hasDefault: true;
|
|
1497
|
+
isPrimaryKey: false;
|
|
1498
|
+
isAutoincrement: false;
|
|
1499
|
+
hasRuntimeDefault: false;
|
|
1500
|
+
enumValues: undefined;
|
|
1501
|
+
baseColumn: never;
|
|
1502
|
+
identity: undefined;
|
|
1503
|
+
generated: undefined;
|
|
1504
|
+
}, {}, {}>;
|
|
1488
1505
|
inviterId: drizzle_orm_pg_core.PgColumn<{
|
|
1489
1506
|
name: "inviter_id";
|
|
1490
1507
|
tableName: "invitation";
|
|
@@ -1606,6 +1623,23 @@ declare const InvitationInsertSchema: drizzle_zod.BuildSchema<"insert", {
|
|
|
1606
1623
|
identity: undefined;
|
|
1607
1624
|
generated: undefined;
|
|
1608
1625
|
}, {}, {}>;
|
|
1626
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
1627
|
+
name: "created_at";
|
|
1628
|
+
tableName: "invitation";
|
|
1629
|
+
dataType: "date";
|
|
1630
|
+
columnType: "PgTimestamp";
|
|
1631
|
+
data: Date;
|
|
1632
|
+
driverParam: string;
|
|
1633
|
+
notNull: true;
|
|
1634
|
+
hasDefault: true;
|
|
1635
|
+
isPrimaryKey: false;
|
|
1636
|
+
isAutoincrement: false;
|
|
1637
|
+
hasRuntimeDefault: false;
|
|
1638
|
+
enumValues: undefined;
|
|
1639
|
+
baseColumn: never;
|
|
1640
|
+
identity: undefined;
|
|
1641
|
+
generated: undefined;
|
|
1642
|
+
}, {}, {}>;
|
|
1609
1643
|
inviterId: drizzle_orm_pg_core.PgColumn<{
|
|
1610
1644
|
name: "inviter_id";
|
|
1611
1645
|
tableName: "invitation";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { user, session, account, organization, member, invitation, verification } from '../chunk-
|
|
1
|
+
import { user, session, account, organization, member, invitation, verification } from '../chunk-GENLXHZ4.js';
|
|
2
|
+
import { z } from '@hono/zod-openapi';
|
|
2
3
|
import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
|
|
3
|
-
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
var UserSelectSchema = createSelectSchema(user);
|
|
6
6
|
var UserInsertSchema = createInsertSchema(user);
|
package/dist/auth/auth.d.ts
CHANGED
|
@@ -4,15 +4,15 @@ import * as zod from 'zod';
|
|
|
4
4
|
import * as better_auth from 'better-auth';
|
|
5
5
|
import { BetterAuthAdvancedOptions } from 'better-auth';
|
|
6
6
|
import { GoogleOptions } from 'better-auth/social-providers';
|
|
7
|
-
import { D as DatabaseClient } from '../client-
|
|
7
|
+
import { D as DatabaseClient } from '../client-DG_xZdlN.js';
|
|
8
8
|
import 'drizzle-orm/node-postgres';
|
|
9
9
|
import 'drizzle-orm/pglite';
|
|
10
|
-
import '../schema-
|
|
10
|
+
import '../schema-DA6PfmoP.js';
|
|
11
11
|
import 'drizzle-orm';
|
|
12
12
|
import 'drizzle-orm/pg-core';
|
|
13
|
-
import '../utility-
|
|
14
|
-
import 'drizzle-zod';
|
|
13
|
+
import '../utility-dsfXkYTu.js';
|
|
15
14
|
import '@hono/zod-openapi';
|
|
15
|
+
import 'drizzle-zod';
|
|
16
16
|
import './auth-schema.js';
|
|
17
17
|
|
|
18
18
|
interface OIDCProviderConfig {
|
|
@@ -115,13 +115,14 @@ declare function createAuth(config: BetterAuthConfig): better_auth.Auth<{
|
|
|
115
115
|
attributes?: better_auth.CookieOptions;
|
|
116
116
|
};
|
|
117
117
|
} | undefined;
|
|
118
|
-
defaultCookieAttributes
|
|
118
|
+
defaultCookieAttributes: better_auth.CookieOptions;
|
|
119
119
|
cookiePrefix?: string | undefined;
|
|
120
120
|
database?: {
|
|
121
121
|
defaultFindManyLimit?: number;
|
|
122
122
|
useNumberId?: boolean;
|
|
123
123
|
generateId?: better_auth.GenerateIdFn | false | "serial" | "uuid";
|
|
124
124
|
} | undefined;
|
|
125
|
+
trustedProxyHeaders?: boolean | undefined;
|
|
125
126
|
};
|
|
126
127
|
trustedOrigins: string[];
|
|
127
128
|
plugins: [{
|
|
@@ -716,25 +717,25 @@ declare function createAuth(config: BetterAuthConfig): better_auth.Auth<{
|
|
|
716
717
|
ac: better_auth_plugins.AccessControl;
|
|
717
718
|
roles: {
|
|
718
719
|
member: {
|
|
719
|
-
authorize<K_1 extends "function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key] | {
|
|
720
|
-
actions: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key];
|
|
720
|
+
authorize<K_1 extends "function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key] | {
|
|
721
|
+
actions: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key];
|
|
721
722
|
connector: "OR" | "AND";
|
|
722
723
|
} | undefined; } : never, connector?: "OR" | "AND"): better_auth_plugins.AuthorizeResponse;
|
|
723
|
-
statements: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>;
|
|
724
|
+
statements: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>;
|
|
724
725
|
};
|
|
725
726
|
admin: {
|
|
726
|
-
authorize<K_1 extends "function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key] | {
|
|
727
|
-
actions: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key];
|
|
727
|
+
authorize<K_1 extends "function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key] | {
|
|
728
|
+
actions: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key];
|
|
728
729
|
connector: "OR" | "AND";
|
|
729
730
|
} | undefined; } : never, connector?: "OR" | "AND"): better_auth_plugins.AuthorizeResponse;
|
|
730
|
-
statements: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>;
|
|
731
|
+
statements: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>;
|
|
731
732
|
};
|
|
732
733
|
owner: {
|
|
733
|
-
authorize<K_1 extends "function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key] | {
|
|
734
|
-
actions: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key];
|
|
734
|
+
authorize<K_1 extends "function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key] | {
|
|
735
|
+
actions: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key];
|
|
735
736
|
connector: "OR" | "AND";
|
|
736
737
|
} | undefined; } : never, connector?: "OR" | "AND"): better_auth_plugins.AuthorizeResponse;
|
|
737
|
-
statements: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>;
|
|
738
|
+
statements: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>;
|
|
738
739
|
};
|
|
739
740
|
};
|
|
740
741
|
sendInvitationEmail(data: {
|
|
@@ -992,25 +993,25 @@ declare function createAuth(config: BetterAuthConfig): better_auth.Auth<{
|
|
|
992
993
|
ac: better_auth_plugins.AccessControl;
|
|
993
994
|
roles: {
|
|
994
995
|
member: {
|
|
995
|
-
authorize<K_1 extends "function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key] | {
|
|
996
|
-
actions: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key];
|
|
996
|
+
authorize<K_1 extends "function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key] | {
|
|
997
|
+
actions: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key];
|
|
997
998
|
connector: "OR" | "AND";
|
|
998
999
|
} | undefined; } : never, connector?: "OR" | "AND"): better_auth_plugins.AuthorizeResponse;
|
|
999
|
-
statements: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>;
|
|
1000
|
+
statements: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>;
|
|
1000
1001
|
};
|
|
1001
1002
|
admin: {
|
|
1002
|
-
authorize<K_1 extends "function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key] | {
|
|
1003
|
-
actions: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key];
|
|
1003
|
+
authorize<K_1 extends "function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key] | {
|
|
1004
|
+
actions: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key];
|
|
1004
1005
|
connector: "OR" | "AND";
|
|
1005
1006
|
} | undefined; } : never, connector?: "OR" | "AND"): better_auth_plugins.AuthorizeResponse;
|
|
1006
|
-
statements: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>;
|
|
1007
|
+
statements: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>;
|
|
1007
1008
|
};
|
|
1008
1009
|
owner: {
|
|
1009
|
-
authorize<K_1 extends "function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key] | {
|
|
1010
|
-
actions: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key];
|
|
1010
|
+
authorize<K_1 extends "function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key] | {
|
|
1011
|
+
actions: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key];
|
|
1011
1012
|
connector: "OR" | "AND";
|
|
1012
1013
|
} | undefined; } : never, connector?: "OR" | "AND"): better_auth_plugins.AuthorizeResponse;
|
|
1013
|
-
statements: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>;
|
|
1014
|
+
statements: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>;
|
|
1014
1015
|
};
|
|
1015
1016
|
};
|
|
1016
1017
|
sendInvitationEmail(data: {
|
package/dist/auth/auth.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { generateId } from '../chunk-
|
|
2
|
-
import { env } from '../chunk-
|
|
3
|
-
import { ssoProvider } from '../chunk-
|
|
4
|
-
import { ownerRole, adminRole, memberRole, ac } from '../chunk-
|
|
1
|
+
import { generateId } from '../chunk-MGHGIB7U.js';
|
|
2
|
+
import { env } from '../chunk-ZIXAWYZI.js';
|
|
3
|
+
import { ssoProvider } from '../chunk-GENLXHZ4.js';
|
|
4
|
+
import { ownerRole, adminRole, memberRole, ac } from '../chunk-JNBVHWXX.js';
|
|
5
5
|
import { sso } from '@better-auth/sso';
|
|
6
6
|
import { betterAuth } from 'better-auth';
|
|
7
7
|
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
|
|
@@ -82,6 +82,13 @@ function createAuth(config) {
|
|
|
82
82
|
enabled: true,
|
|
83
83
|
...cookieDomain && { domain: cookieDomain }
|
|
84
84
|
},
|
|
85
|
+
defaultCookieAttributes: {
|
|
86
|
+
sameSite: "none",
|
|
87
|
+
secure: true,
|
|
88
|
+
httpOnly: true,
|
|
89
|
+
partitioned: true,
|
|
90
|
+
...cookieDomain && { domain: cookieDomain }
|
|
91
|
+
},
|
|
85
92
|
...config.advanced
|
|
86
93
|
},
|
|
87
94
|
trustedOrigins: [
|
|
@@ -3,25 +3,25 @@ import { AccessControl } from 'better-auth/plugins/access';
|
|
|
3
3
|
|
|
4
4
|
declare const ac: AccessControl;
|
|
5
5
|
declare const memberRole: {
|
|
6
|
-
authorize<K_1 extends "function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key] | {
|
|
7
|
-
actions: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key];
|
|
6
|
+
authorize<K_1 extends "function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key] | {
|
|
7
|
+
actions: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key];
|
|
8
8
|
connector: "OR" | "AND";
|
|
9
9
|
} | undefined; } : never, connector?: "OR" | "AND"): better_auth_plugins.AuthorizeResponse;
|
|
10
|
-
statements: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>;
|
|
10
|
+
statements: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>;
|
|
11
11
|
};
|
|
12
12
|
declare const adminRole: {
|
|
13
|
-
authorize<K_1 extends "function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key] | {
|
|
14
|
-
actions: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key];
|
|
13
|
+
authorize<K_1 extends "function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key] | {
|
|
14
|
+
actions: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key];
|
|
15
15
|
connector: "OR" | "AND";
|
|
16
16
|
} | undefined; } : never, connector?: "OR" | "AND"): better_auth_plugins.AuthorizeResponse;
|
|
17
|
-
statements: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>;
|
|
17
|
+
statements: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>;
|
|
18
18
|
};
|
|
19
19
|
declare const ownerRole: {
|
|
20
|
-
authorize<K_1 extends "function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key] | {
|
|
21
|
-
actions: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>[key];
|
|
20
|
+
authorize<K_1 extends "function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key] | {
|
|
21
|
+
actions: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>[key];
|
|
22
22
|
connector: "OR" | "AND";
|
|
23
23
|
} | undefined; } : never, connector?: "OR" | "AND"): better_auth_plugins.AuthorizeResponse;
|
|
24
|
-
statements: better_auth_plugins.Subset<"function" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config", better_auth_plugins.Statements>;
|
|
24
|
+
statements: better_auth_plugins.Subset<"function" | "organization" | "ac" | "member" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "invitation" | "team", better_auth_plugins.Statements>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export { ac, adminRole, memberRole, ownerRole };
|
package/dist/auth/permissions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ac, adminRole, memberRole, ownerRole } from '../chunk-
|
|
1
|
+
export { ac, adminRole, memberRole, ownerRole } from '../chunk-JNBVHWXX.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// src/constants/models.ts
|
|
2
2
|
var ANTHROPIC_MODELS = {
|
|
3
|
+
CLAUDE_OPUS_4_5: "anthropic/claude-opus-4-5",
|
|
4
|
+
CLAUDE_OPUS_4_5_20251101: "anthropic/claude-opus-4-5-20251101",
|
|
3
5
|
CLAUDE_OPUS_4_1: "anthropic/claude-opus-4-1",
|
|
4
6
|
CLAUDE_OPUS_4_1_20250805: "anthropic/claude-opus-4-1-20250805",
|
|
5
7
|
CLAUDE_SONNET_4_5: "anthropic/claude-sonnet-4-5",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { schemaValidationDefaults } from './chunk-Z64UK4CA.js';
|
|
2
|
-
import { loadEnvironmentFiles } from './chunk-
|
|
3
|
-
import { z } from 'zod';
|
|
2
|
+
import { loadEnvironmentFiles } from './chunk-ZIXAWYZI.js';
|
|
3
|
+
import { z } from '@hono/zod-openapi';
|
|
4
4
|
|
|
5
5
|
loadEnvironmentFiles();
|
|
6
6
|
var constantsSchema = z.object(
|
|
@@ -1,7 +1,47 @@
|
|
|
1
1
|
import { getLogger } from './chunk-DN4B564Y.js';
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import { z } from '@hono/zod-openapi';
|
|
3
3
|
|
|
4
4
|
var logger = getLogger("schema-conversion");
|
|
5
|
+
function jsonSchemaToZod(jsonSchema) {
|
|
6
|
+
if (!jsonSchema || typeof jsonSchema !== "object") {
|
|
7
|
+
logger.warn({ jsonSchema }, "Invalid JSON schema provided, using string fallback");
|
|
8
|
+
return z.string();
|
|
9
|
+
}
|
|
10
|
+
const schemaType = jsonSchema.type;
|
|
11
|
+
switch (schemaType) {
|
|
12
|
+
case "object": {
|
|
13
|
+
const properties = jsonSchema.properties;
|
|
14
|
+
if (properties && typeof properties === "object") {
|
|
15
|
+
const shape = {};
|
|
16
|
+
for (const [key, prop] of Object.entries(properties)) {
|
|
17
|
+
shape[key] = jsonSchemaToZod(prop);
|
|
18
|
+
}
|
|
19
|
+
return z.object(shape);
|
|
20
|
+
}
|
|
21
|
+
return z.record(z.string(), z.string());
|
|
22
|
+
}
|
|
23
|
+
case "array": {
|
|
24
|
+
const items = jsonSchema.items;
|
|
25
|
+
const itemSchema = items ? jsonSchemaToZod(items) : z.string();
|
|
26
|
+
return z.array(itemSchema);
|
|
27
|
+
}
|
|
28
|
+
case "string":
|
|
29
|
+
return z.string();
|
|
30
|
+
case "number":
|
|
31
|
+
case "integer":
|
|
32
|
+
return z.number();
|
|
33
|
+
case "boolean":
|
|
34
|
+
return z.boolean();
|
|
35
|
+
case "null":
|
|
36
|
+
return z.null();
|
|
37
|
+
default:
|
|
38
|
+
logger.warn(
|
|
39
|
+
{ unsupportedType: schemaType, schema: jsonSchema },
|
|
40
|
+
"Unsupported JSON schema type, using string fallback"
|
|
41
|
+
);
|
|
42
|
+
return z.string();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
5
45
|
function convertZodToJsonSchema(zodSchema) {
|
|
6
46
|
try {
|
|
7
47
|
const jsonSchema = z.toJSONSchema(zodSchema);
|
|
@@ -60,4 +100,4 @@ function extractPreviewFields(schema) {
|
|
|
60
100
|
return previewFields;
|
|
61
101
|
}
|
|
62
102
|
|
|
63
|
-
export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview };
|
|
103
|
+
export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, jsonSchemaToZod, preview };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-
|
|
2
|
-
import { z } from 'zod';
|
|
1
|
+
import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-UK63CULA.js';
|
|
2
|
+
import { z } from '@hono/zod-openapi';
|
|
3
3
|
|
|
4
4
|
// src/validation/cycleDetection.ts
|
|
5
5
|
function detectDelegationCycles(agentData) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { schema_exports, projects } from './chunk-
|
|
2
|
-
import { organization } from './chunk-
|
|
1
|
+
import { schema_exports, projects } from './chunk-LH6OJIIM.js';
|
|
2
|
+
import { organization } from './chunk-GENLXHZ4.js';
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { PGlite } from '@electric-sql/pglite';
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { relations } from 'drizzle-orm';
|
|
2
|
+
import { pgTable, timestamp, text, boolean, index } from 'drizzle-orm/pg-core';
|
|
3
|
+
|
|
4
|
+
// src/auth/auth-schema.ts
|
|
5
|
+
var user = pgTable("user", {
|
|
6
|
+
id: text("id").primaryKey(),
|
|
7
|
+
name: text("name").notNull(),
|
|
8
|
+
email: text("email").notNull().unique(),
|
|
9
|
+
emailVerified: boolean("email_verified").default(false).notNull(),
|
|
10
|
+
image: text("image"),
|
|
11
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
12
|
+
updatedAt: timestamp("updated_at").defaultNow().$onUpdate(() => /* @__PURE__ */ new Date()).notNull()
|
|
13
|
+
});
|
|
14
|
+
var session = pgTable(
|
|
15
|
+
"session",
|
|
16
|
+
{
|
|
17
|
+
id: text("id").primaryKey(),
|
|
18
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
19
|
+
token: text("token").notNull().unique(),
|
|
20
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
21
|
+
updatedAt: timestamp("updated_at").$onUpdate(() => /* @__PURE__ */ new Date()).notNull(),
|
|
22
|
+
ipAddress: text("ip_address"),
|
|
23
|
+
userAgent: text("user_agent"),
|
|
24
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
25
|
+
activeOrganizationId: text("active_organization_id")
|
|
26
|
+
},
|
|
27
|
+
(table) => [index("session_userId_idx").on(table.userId)]
|
|
28
|
+
);
|
|
29
|
+
var account = pgTable(
|
|
30
|
+
"account",
|
|
31
|
+
{
|
|
32
|
+
id: text("id").primaryKey(),
|
|
33
|
+
accountId: text("account_id").notNull(),
|
|
34
|
+
providerId: text("provider_id").notNull(),
|
|
35
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
36
|
+
accessToken: text("access_token"),
|
|
37
|
+
refreshToken: text("refresh_token"),
|
|
38
|
+
idToken: text("id_token"),
|
|
39
|
+
accessTokenExpiresAt: timestamp("access_token_expires_at"),
|
|
40
|
+
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
|
|
41
|
+
scope: text("scope"),
|
|
42
|
+
password: text("password"),
|
|
43
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
44
|
+
updatedAt: timestamp("updated_at").$onUpdate(() => /* @__PURE__ */ new Date()).notNull()
|
|
45
|
+
},
|
|
46
|
+
(table) => [index("account_userId_idx").on(table.userId)]
|
|
47
|
+
);
|
|
48
|
+
var verification = pgTable(
|
|
49
|
+
"verification",
|
|
50
|
+
{
|
|
51
|
+
id: text("id").primaryKey(),
|
|
52
|
+
identifier: text("identifier").notNull(),
|
|
53
|
+
value: text("value").notNull(),
|
|
54
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
55
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
56
|
+
updatedAt: timestamp("updated_at").defaultNow().$onUpdate(() => /* @__PURE__ */ new Date()).notNull()
|
|
57
|
+
},
|
|
58
|
+
(table) => [index("verification_identifier_idx").on(table.identifier)]
|
|
59
|
+
);
|
|
60
|
+
var ssoProvider = pgTable("sso_provider", {
|
|
61
|
+
id: text("id").primaryKey(),
|
|
62
|
+
issuer: text("issuer").notNull(),
|
|
63
|
+
oidcConfig: text("oidc_config"),
|
|
64
|
+
samlConfig: text("saml_config"),
|
|
65
|
+
userId: text("user_id").references(() => user.id, { onDelete: "cascade" }),
|
|
66
|
+
providerId: text("provider_id").notNull().unique(),
|
|
67
|
+
organizationId: text("organization_id"),
|
|
68
|
+
domain: text("domain").notNull()
|
|
69
|
+
});
|
|
70
|
+
var organization = pgTable("organization", {
|
|
71
|
+
id: text("id").primaryKey(),
|
|
72
|
+
name: text("name").notNull(),
|
|
73
|
+
slug: text("slug").notNull().unique(),
|
|
74
|
+
logo: text("logo"),
|
|
75
|
+
createdAt: timestamp("created_at").notNull(),
|
|
76
|
+
metadata: text("metadata")
|
|
77
|
+
});
|
|
78
|
+
var member = pgTable(
|
|
79
|
+
"member",
|
|
80
|
+
{
|
|
81
|
+
id: text("id").primaryKey(),
|
|
82
|
+
organizationId: text("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),
|
|
83
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
84
|
+
role: text("role").default("member").notNull(),
|
|
85
|
+
createdAt: timestamp("created_at").notNull()
|
|
86
|
+
},
|
|
87
|
+
(table) => [
|
|
88
|
+
index("member_organizationId_idx").on(table.organizationId),
|
|
89
|
+
index("member_userId_idx").on(table.userId)
|
|
90
|
+
]
|
|
91
|
+
);
|
|
92
|
+
var invitation = pgTable(
|
|
93
|
+
"invitation",
|
|
94
|
+
{
|
|
95
|
+
id: text("id").primaryKey(),
|
|
96
|
+
organizationId: text("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),
|
|
97
|
+
email: text("email").notNull(),
|
|
98
|
+
role: text("role"),
|
|
99
|
+
status: text("status").default("pending").notNull(),
|
|
100
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
101
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
102
|
+
inviterId: text("inviter_id").notNull().references(() => user.id, { onDelete: "cascade" })
|
|
103
|
+
},
|
|
104
|
+
(table) => [
|
|
105
|
+
index("invitation_organizationId_idx").on(table.organizationId),
|
|
106
|
+
index("invitation_email_idx").on(table.email)
|
|
107
|
+
]
|
|
108
|
+
);
|
|
109
|
+
var userRelations = relations(user, ({ many }) => ({
|
|
110
|
+
sessions: many(session),
|
|
111
|
+
accounts: many(account),
|
|
112
|
+
ssoProviders: many(ssoProvider),
|
|
113
|
+
members: many(member),
|
|
114
|
+
invitations: many(invitation)
|
|
115
|
+
}));
|
|
116
|
+
var sessionRelations = relations(session, ({ one }) => ({
|
|
117
|
+
user: one(user, {
|
|
118
|
+
fields: [session.userId],
|
|
119
|
+
references: [user.id]
|
|
120
|
+
})
|
|
121
|
+
}));
|
|
122
|
+
var accountRelations = relations(account, ({ one }) => ({
|
|
123
|
+
user: one(user, {
|
|
124
|
+
fields: [account.userId],
|
|
125
|
+
references: [user.id]
|
|
126
|
+
})
|
|
127
|
+
}));
|
|
128
|
+
var ssoProviderRelations = relations(ssoProvider, ({ one }) => ({
|
|
129
|
+
user: one(user, {
|
|
130
|
+
fields: [ssoProvider.userId],
|
|
131
|
+
references: [user.id]
|
|
132
|
+
})
|
|
133
|
+
}));
|
|
134
|
+
var organizationRelations = relations(organization, ({ many }) => ({
|
|
135
|
+
members: many(member),
|
|
136
|
+
invitations: many(invitation)
|
|
137
|
+
}));
|
|
138
|
+
var memberRelations = relations(member, ({ one }) => ({
|
|
139
|
+
organization: one(organization, {
|
|
140
|
+
fields: [member.organizationId],
|
|
141
|
+
references: [organization.id]
|
|
142
|
+
}),
|
|
143
|
+
user: one(user, {
|
|
144
|
+
fields: [member.userId],
|
|
145
|
+
references: [user.id]
|
|
146
|
+
})
|
|
147
|
+
}));
|
|
148
|
+
var invitationRelations = relations(invitation, ({ one }) => ({
|
|
149
|
+
organization: one(organization, {
|
|
150
|
+
fields: [invitation.organizationId],
|
|
151
|
+
references: [organization.id]
|
|
152
|
+
}),
|
|
153
|
+
user: one(user, {
|
|
154
|
+
fields: [invitation.inviterId],
|
|
155
|
+
references: [user.id]
|
|
156
|
+
})
|
|
157
|
+
}));
|
|
158
|
+
|
|
159
|
+
export { account, accountRelations, invitation, invitationRelations, member, memberRelations, organization, organizationRelations, session, sessionRelations, ssoProvider, ssoProviderRelations, user, userRelations, verification };
|