feat: yarn build no errors

This commit is contained in:
Agusti Fernandez Pardo committed 2022-04-02 01:55:41 +02:00
1 parent 1c19032884
commit 9f4a62e2ef
25 files changed
+786 -322

No files matched your search

-2
View File
@@ -3,8 +3,6 @@
// Initially to test out 0,5 cent per booking via API call
// withCost(5)(endpoint)
// Should add a charge of 0.5 cent per booking to the subscription of the user making the request
// Should be called in the middleware of the e
//
import { NextMiddleware } from "next-api-middleware";
export const withCost = (priceInCents: number): NextMiddleware => {
+9
View File
@@ -5,6 +5,7 @@ import {
Credential,
SelectedCalendar,
EventType,
EventTypeCustomInput,
Attendee,
Availability,
BookingReference,
@@ -120,6 +121,14 @@ export type MembershipsResponse = BaseResponse & {
data?: Partial<Membership>[];
};
// EventTypeCustomInput
export type EventTypeCustomInputResponse = BaseResponse & {
data?: Partial<EventTypeCustomInput>;
};
export type EventTypeCustomInputsResponse = BaseResponse & {
data?: Partial<EventTypeCustomInput>[];
};
// EventType
export type EventTypeResponse = BaseResponse & {
data?: Partial<EventType>;
@@ -0,0 +1,29 @@
import { withValidation } from "next-validations";
import { z } from "zod";
import { EventTypeModel, _EventTypeCustomInputModel as EventTypeCustomInput } from "@calcom/prisma/zod";
export const schemaEventTypeCustomInputBaseBodyParams = EventTypeCustomInput.omit({
id: true,
eventTypeId: true,
}).partial();
export const schemaEventTypeCustomInputPublic = EventTypeCustomInput.omit({});
const schemaEventTypeCustomInputRequiredParams = z.object({
label: z.string(),
// uid: z.string(),
eventType: EventTypeModel.optional(),
// eventType: z.instanceof(EventTypeInputModel),
});
export const schemaEventTypeCustomInputBodyParams = schemaEventTypeCustomInputBaseBodyParams.merge(
schemaEventTypeCustomInputRequiredParams
);
export const withValidEventTypeCustomInput = withValidation({
schema: schemaEventTypeCustomInputBodyParams,
type: "Zod",
mode: "body",
});
+11 -1
View File
@@ -1,8 +1,18 @@
import { withValidation } from "next-validations";
import { z } from "zod";
import { _ScheduleModel as Schedule } from "@calcom/prisma/zod";
export const schemaScheduleBodyParams = Schedule.omit({ id: true }).partial();
// import { jsonSchema } from "./shared/jsonSchema";
const schemaScheduleBaseBodyParams = Schedule.omit({ id: true }).partial();
const schemaScheduleRequiredParams = z.object({
userId: z.number(),
name: z.string(),
});
export const schemaScheduleBodyParams = schemaScheduleBaseBodyParams.merge(schemaScheduleRequiredParams);
export const schemaSchedulePublic = Schedule.omit({});
+21 -3
View File
@@ -1,10 +1,28 @@
import { withValidation } from "next-validations";
import { z } from "zod";
import { _SelectedCalendarModel as SelectedCalendar } from "@calcom/prisma/zod";
import { _UserModel, _SelectedCalendarModel as SelectedCalendar } from "@calcom/prisma/zod";
export const schemaSelectedCalendarBodyParams = SelectedCalendar.omit({}).partial();
export const schemaSelectedCalendarBaseBodyParams = SelectedCalendar.omit({ userId: true }).partial();
export const schemaSelectedCalendarPublic = SelectedCalendar.omit({ userId: true });
export const schemaSelectedCalendarPublic = SelectedCalendar.omit({});
const schemaSelectedCalendarRequiredParams = z.object({
externalId: z.string(),
integration: z.string(),
user: z.object({
connect: z.object({
id: z.number().optional(),
username: z.string().optional(),
email: z.string().optional(),
}),
create: z.any(),
}),
});
export const schemaSelectedCalendarBodyParams = schemaSelectedCalendarBaseBodyParams.merge(
schemaSelectedCalendarRequiredParams
);
export const withValidSelectedCalendar = withValidation({
schema: schemaSelectedCalendarBodyParams,