import { FieldAttributeToObject, InferAdditionalFieldsFromPluginOptions } from "../../../db/field.mjs"; import { PrettifyDeep } from "../../../types/helper.mjs"; import { Role } from "../../access/types.mjs"; import { OrganizationOptions } from "../types.mjs"; import { teamSchema } from "../schema.mjs"; import { defaultRoles } from "../access/statement.mjs"; import * as _better_auth_core0 from "@better-auth/core"; import * as _better_auth_core_db0 from "@better-auth/core/db"; import * as better_call0 from "better-call"; import * as z from "zod"; //#region src/plugins/organization/routes/crud-team.d.ts declare const teamBaseSchema: z.ZodObject<{ name: z.ZodString; organizationId: z.ZodOptional; }, z.core.$strip>; declare const createTeam: (options: O) => better_call0.StrictEndpoint<"/organization/create-team", { method: "POST"; body: z.ZodObject<{ name: z.ZodString; organizationId: z.ZodOptional; }, z.core.$strip>; use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>)[]; metadata: { $Infer: { body: z.infer & InferAdditionalFieldsFromPluginOptions<"team", O>; }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; description: string; }; name: { type: string; description: string; }; organizationId: { type: string; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { id: string; name: string; organizationId: string; createdAt: Date; updatedAt?: Date | undefined; } & (O["schema"] extends { team?: { additionalFields: infer Field extends Record; } | undefined; } ? FieldAttributeToObject : {}) extends infer T ? { [K in keyof T]: T[K] } : never>; declare const removeTeam: (options: O) => better_call0.StrictEndpoint<"/organization/remove-team", { method: "POST"; body: z.ZodObject<{ teamId: z.ZodString; organizationId: z.ZodOptional; }, z.core.$strip>; use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { message: { type: string; description: string; enum: string[]; }; }; required: string[]; }; }; }; }; }; }; }; }, { message: string; }>; declare const updateTeam: (options: O) => better_call0.StrictEndpoint<"/organization/update-team", { method: "POST"; body: z.ZodObject<{ teamId: z.ZodString; data: z.ZodObject<{ id: z.ZodOptional>; name: z.ZodOptional; organizationId: z.ZodOptional; createdAt: z.ZodOptional; updatedAt: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>; requireHeaders: true; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>))[]; metadata: { $Infer: { body: { teamId: string; data: Partial, "id" | "createdAt" | "updatedAt">> & InferAdditionalFieldsFromPluginOptions<"team", O>>; }; }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; description: string; }; name: { type: string; description: string; }; organizationId: { type: string; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, (({ id: string; name: string; organizationId: string; createdAt: Date; updatedAt?: Date | undefined; } & (O["schema"] extends { team?: { additionalFields: infer Field extends Record; } | undefined; } ? FieldAttributeToObject : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & InferAdditionalFieldsFromPluginOptions<"team", O, true>) | null>; declare const listOrganizationTeams: (options: O) => better_call0.StrictEndpoint<"/organization/list-teams", { method: "GET"; query: z.ZodOptional; }, z.core.$strip>>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "array"; items: { type: string; properties: { id: { type: string; description: string; }; name: { type: string; description: string; }; organizationId: { type: string; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; }; required: string[]; }; description: string; }; }; }; }; }; }; }; requireHeaders: true; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>))[]; }, ({ id: string; name: string; organizationId: string; createdAt: Date; updatedAt?: Date | undefined; } & (O["schema"] extends { team?: { additionalFields: infer Field extends Record; } | undefined; } ? FieldAttributeToObject : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>; declare const setActiveTeam: (options: O) => better_call0.StrictEndpoint<"/organization/set-active-team", { method: "POST"; body: z.ZodObject<{ teamId: z.ZodOptional>; }, z.core.$strip>; requireHeaders: true; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; }, { id: string; name: string; organizationId: string; createdAt: Date; updatedAt?: Date | undefined; } | null>; declare const listUserTeams: (options: O) => better_call0.StrictEndpoint<"/organization/list-user-teams", { method: "GET"; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "array"; items: { type: string; description: string; $ref: string; }; description: string; }; }; }; }; }; }; }; requireHeaders: true; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>))[]; }, { id: string; name: string; organizationId: string; createdAt: Date; updatedAt?: Date | undefined; }[]>; declare const listTeamMembers: (options: O) => better_call0.StrictEndpoint<"/organization/list-team-members", { method: "GET"; query: z.ZodOptional; }, z.core.$strip>>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "array"; items: { type: string; description: string; properties: { id: { type: string; description: string; }; userId: { type: string; description: string; }; teamId: { type: string; description: string; }; createdAt: { type: string; format: string; description: string; }; }; required: string[]; }; description: string; }; }; }; }; }; }; }; requireHeaders: true; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>))[]; }, { id: string; teamId: string; userId: string; createdAt: Date; }[]>; declare const addTeamMember: (options: O) => better_call0.StrictEndpoint<"/organization/add-team-member", { method: "POST"; body: z.ZodObject<{ teamId: z.ZodString; userId: z.ZodCoercedString; organizationId: z.ZodOptional; }, z.core.$strip>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; properties: { id: { type: string; description: string; }; userId: { type: string; description: string; }; teamId: { type: string; description: string; }; createdAt: { type: string; format: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; requireHeaders: true; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>))[]; }, { id: string; teamId: string; userId: string; createdAt: Date; }>; declare const removeTeamMember: (options: O) => better_call0.StrictEndpoint<"/organization/remove-team-member", { method: "POST"; body: z.ZodObject<{ teamId: z.ZodString; userId: z.ZodCoercedString; organizationId: z.ZodOptional; }, z.core.$strip>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { message: { type: string; description: string; enum: string[]; }; }; required: string[]; }; }; }; }; }; }; }; requireHeaders: true; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>))[]; }, { message: string; }>; //#endregion export { addTeamMember, createTeam, listOrganizationTeams, listTeamMembers, listUserTeams, removeTeam, removeTeamMember, setActiveTeam, updateTeam }; //# sourceMappingURL=crud-team.d.mts.map