mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
* Add installation.create API endpoint - Add new endpoint that accepts teamName, userName, userEmail - Use accountProvisioner to create team and user - Only allow when no existing teams exist (unauthenticated) - Add comprehensive tests for success, failure, and validation cases - Add schema validation with Zod - Include rate limiting (5 per hour) - Follow existing API patterns and conventions * Remove changes to .env.test * fix * Centralize validation * test * test * test --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom@getoutline.com>
19 lines
598 B
TypeScript
19 lines
598 B
TypeScript
import { z } from "zod";
|
|
import { TeamValidation, UserValidation } from "@shared/validations";
|
|
import { BaseSchema } from "@server/routes/api/schema";
|
|
|
|
export const InstallationCreateSchema = BaseSchema.extend({
|
|
body: z.object({
|
|
/** Team name */
|
|
teamName: z.string().min(1).max(TeamValidation.maxNameLength),
|
|
/** User name */
|
|
userName: z.string().min(1).max(UserValidation.maxNameLength),
|
|
/** User email */
|
|
userEmail: z.string().email().max(UserValidation.maxEmailLength),
|
|
}),
|
|
});
|
|
|
|
export type InstallationCreateSchemaReq = z.infer<
|
|
typeof InstallationCreateSchema
|
|
>;
|