Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | 39x 39x 39x 39x | import { z } from "zod";
import {
LoginProvider,
EventSignupStrategy,
} from "shared/config/eventConfigTypes";
import { EmailNotificationTrigger } from "shared/types/emailNotification";
import {
Settings,
SettingsSchema,
SignupQuestion,
SignupQuestionSchema,
} from "shared/types/models/settings";
import { ApiError, ApiResult } from "shared/types/api/errors";
// POST hidden
export const PostHiddenRequestSchema = z.object({
hiddenProgramItemIds: z.array(z.string()).readonly(),
});
export type PostHiddenRequest = z.infer<typeof PostHiddenRequestSchema>;
interface PostHiddenResult extends ApiResult {
hiddenProgramItemIds: readonly string[];
}
interface PostHiddenError extends ApiError {
errorId: "unknown";
}
export type PostHiddenResponse = PostHiddenResult | PostHiddenError;
// GET settings
export interface SettingsPayload {
hiddenProgramItemIds: readonly string[];
appOpen: boolean;
adminMessageFi: string;
adminMessageEn: string;
signupQuestions: readonly SignupQuestion[];
signupStrategy: EventSignupStrategy;
loginProvider: LoginProvider;
emailNotificationTrigger: readonly EmailNotificationTrigger[];
}
type GetSettingsResult = SettingsPayload & ApiResult;
interface GetSettingsError extends ApiError {
errorId: "unknown";
}
export type GetSettingsResponse = GetSettingsResult | GetSettingsError;
// POST signup question
export const PostSignupQuestionRequestSchema = z.object({
signupQuestion: SignupQuestionSchema,
});
export type PostSignupQuestionRequest = z.infer<
typeof PostSignupQuestionRequestSchema
>;
interface PostSignupQuestionResult extends ApiResult {
signupQuestions: readonly SignupQuestion[];
}
interface PostSignupQuestionError extends ApiError {
errorId: "unknown";
}
export type PostSignupQuestionResponse =
| PostSignupQuestionResult
| PostSignupQuestionError;
// DELETE signup question
export const DeleteSignupQuestionRequestSchema = z.object({
programItemId: z.string(),
});
export type DeleteSignupQuestionRequest = z.infer<
typeof DeleteSignupQuestionRequestSchema
>;
type DeleteSignupQuestionResult = PostSignupQuestionResult;
interface DeleteSignupQuestionError extends ApiError {
errorId: "unknown";
}
export type DeleteSignupQuestionResponse =
| DeleteSignupQuestionResult
| DeleteSignupQuestionError;
// POST settings
export const PostSettingsRequestSchema = SettingsSchema.partial();
export type PostSettingsRequest = z.infer<typeof PostSettingsRequestSchema>;
interface PostSettingsResult extends ApiResult {
settings: Settings;
}
interface PostSettingsError extends ApiError {
errorId: "unknown";
}
export type PostSettingsResponse = PostSettingsResult | PostSettingsError;
|