chore: remove /ee from apiv2 urls (#14568)
* chore: remove /ee from apiv2 urls * fixup! chore: remove /ee from apiv2 urls * chore: remove /ee from apiv2 urls * fixup! chore: remove /ee from apiv2 urls * fixup! fixup! chore: remove /ee from apiv2 urls * fixup! fixup! fixup! chore: remove /ee from apiv2 urls
This commit is contained in:
1 parent
ac3d7c9fae
commit
38e62786e4
19 files changed
+139
-106
No files matched your search
@@ -21,7 +21,7 @@ export const useCalendarsBusyTimes = ({ onError, enabled, ...rest }: UseCalendar
|
||||
],
|
||||
queryFn: () => {
|
||||
return http
|
||||
.get<ApiResponse<EventBusyDate[]>>("/ee/calendars/busy-times", {
|
||||
.get<ApiResponse<EventBusyDate[]>>("/calendars/busy-times", {
|
||||
params: rest,
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -11,7 +11,7 @@ export const useConnectedCalendars = (props: { enabled?: boolean }) => {
|
||||
const calendars = useQuery({
|
||||
queryKey: [QUERY_KEY],
|
||||
queryFn: () => {
|
||||
return http.get<ApiResponse<ConnectedDestinationCalendars>>("/ee/calendars").then((res) => {
|
||||
return http.get<ApiResponse<ConnectedDestinationCalendars>>("/calendars").then((res) => {
|
||||
if (res.data.status === SUCCESS_STATUS) {
|
||||
return (res.data as ApiSuccessResponse<ConnectedDestinationCalendars>)?.data;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export const useCreateBooking = (
|
||||
) => {
|
||||
const createBooking = useMutation<ApiResponse<BookingResponse>, Error, BookingCreateBody>({
|
||||
mutationFn: (data) => {
|
||||
return http.post<ApiResponse<BookingResponse>>("/ee/bookings", data).then((res) => {
|
||||
return http.post<ApiResponse<BookingResponse>>("/bookings", data).then((res) => {
|
||||
if (res.data.status === SUCCESS_STATUS) {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export const useCreateInstantBooking = (
|
||||
) => {
|
||||
const createInstantBooking = useMutation<ApiResponse<BookingResponse>, Error, BookingCreateBody>({
|
||||
mutationFn: (data) => {
|
||||
return http.post<ApiResponse<BookingResponse>>("/ee/bookings/instant", data).then((res) => {
|
||||
return http.post<ApiResponse<BookingResponse>>("/bookings/instant", data).then((res) => {
|
||||
if (res.data.status === SUCCESS_STATUS) {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@@ -27,9 +27,7 @@ export const useCreateRecurringBooking = (
|
||||
RecurringBookingCreateBody[]
|
||||
>({
|
||||
mutationFn: (data) => {
|
||||
return http
|
||||
.post<ApiResponse<BookingResponse[]>>("/ee/bookings/recurring", data)
|
||||
.then((res) => res.data);
|
||||
return http.post<ApiResponse<BookingResponse[]>>("/bookings/recurring", data).then((res) => res.data);
|
||||
},
|
||||
onSuccess: (data) => {
|
||||
if (data.status === SUCCESS_STATUS) {
|
||||
|
||||
@@ -16,7 +16,7 @@ export const useGcal = ({ isAuth, onCheckError }: useGcalProps) => {
|
||||
|
||||
const redirectToGcalOAuth = () => {
|
||||
http
|
||||
?.get("/ee/gcal/oauth/auth-url")
|
||||
?.get("/gcal/oauth/auth-url")
|
||||
.then(({ data: responseBody }) => {
|
||||
if (responseBody.data?.authUrl) {
|
||||
window.location.href = responseBody.data.authUrl;
|
||||
@@ -28,7 +28,7 @@ export const useGcal = ({ isAuth, onCheckError }: useGcalProps) => {
|
||||
useEffect(() => {
|
||||
if (isAuth) {
|
||||
http
|
||||
?.get("/ee/gcal/check")
|
||||
?.get("/gcal/check")
|
||||
.then(() => setAllowConnect(false))
|
||||
.catch((err) => {
|
||||
setAllowConnect(true);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
export const BASE_URL = "http://localhost:5555";
|
||||
export const API_VERSION = "v2";
|
||||
export const V2_ENDPOINTS = {
|
||||
me: "ee/me",
|
||||
me: "me",
|
||||
availability: "schedules",
|
||||
eventTypes: "event-types",
|
||||
bookings: "ee/bookings",
|
||||
bookings: "bookings",
|
||||
};
|
||||
|
||||
export const SUCCESS_STATUS = "success";
|
||||
|
||||
@@ -29,7 +29,7 @@ REDIS_URL="redis://localhost:6379"
|
||||
2. Open ".env" file and paste client id from step 8 in `NEXT_PUBLIC_X_CAL_ID` and client secret in `X_CAL_SECRET_KEY`. If in step 2 you used the same environment variables, then `NEXT_PUBLIC_CALCOM_API_URL` can stay as is. Otherwise adjust the port to point to the same `API_PORT` as you used in step 2.
|
||||
10. Navigate to example app and setup database by running `rm -f prisma/dev.db && yarn prisma db push`.
|
||||
11. Start the example app by running `yarn dev` and go to `http://localhost:4321`.
|
||||
12. In the Google Cloud Console "API & Services" "Credentials" `https://console.cloud.google.com/apis/credentials` open web project setup in step 1 and add `http://localhost:5555/api/v2/ee/gcal/oauth/save` to the authorized redirect URIs.
|
||||
12. In the Google Cloud Console "API & Services" "Credentials" `https://console.cloud.google.com/apis/credentials` open web project setup in step 1 and add `http://localhost:5555/v2/gcal/oauth/save` to the authorized redirect URIs.
|
||||
|
||||
<img width="1000" alt="Screenshot 2024-03-21 at 09 42 36" src="https://github.com/calcom/atoms-examples/assets/42170848/82ce4d7a-fc08-489a-ab06-a8eb41a68a2a">
|
||||
|
||||
+29
-29
@@ -7,18 +7,18 @@ export interface paths {
|
||||
"/health": {
|
||||
get: operations["AppController_getHealth"];
|
||||
};
|
||||
"/api/v2/events/public": {
|
||||
"/v2/events/public": {
|
||||
get: operations["EventsController_getPublicEvent"];
|
||||
};
|
||||
"/api/v2/oauth-clients/{clientId}/users": {
|
||||
"/v2/oauth-clients/{clientId}/users": {
|
||||
post: operations["OAuthClientUsersController_createUser"];
|
||||
};
|
||||
"/api/v2/oauth-clients/{clientId}/users/{userId}": {
|
||||
"/v2/oauth-clients/{clientId}/users/{userId}": {
|
||||
get: operations["OAuthClientUsersController_getUserById"];
|
||||
delete: operations["OAuthClientUsersController_deleteUser"];
|
||||
patch: operations["OAuthClientUsersController_updateUser"];
|
||||
};
|
||||
"/api/v2/oauth-clients": {
|
||||
"/v2/oauth-clients": {
|
||||
/**
|
||||
* @description ⚠️ First, this endpoint requires `Cookie: next-auth.session-token=eyJhbGciOiJ` header. Log into Cal web app using owner of organization that was created after visiting `/settings/organizations/new`, refresh swagger docs, and the cookie will be added to requests automatically to pass the NextAuthGuard.
|
||||
* Second, make sure that the logged in user has organizationId set to pass the OrganizationRolesGuard guard.
|
||||
@@ -30,7 +30,7 @@ export interface paths {
|
||||
*/
|
||||
post: operations["OAuthClientsController_createOAuthClient"];
|
||||
};
|
||||
"/api/v2/oauth-clients/{clientId}": {
|
||||
"/v2/oauth-clients/{clientId}": {
|
||||
/**
|
||||
* @description ⚠️ First, this endpoint requires `Cookie: next-auth.session-token=eyJhbGciOiJ` header. Log into Cal web app using owner of organization that was created after visiting `/settings/organizations/new`, refresh swagger docs, and the cookie will be added to requests automatically to pass the NextAuthGuard.
|
||||
* Second, make sure that the logged in user has organizationId set to pass the OrganizationRolesGuard guard.
|
||||
@@ -47,89 +47,89 @@ export interface paths {
|
||||
*/
|
||||
patch: operations["OAuthClientsController_updateOAuthClient"];
|
||||
};
|
||||
"/api/v2/oauth/{clientId}/authorize": {
|
||||
"/v2/oauth/{clientId}/authorize": {
|
||||
/**
|
||||
* Authorize an OAuth client
|
||||
* @description Redirects the user to the specified 'redirect_uri' with an authorization code in query parameter if the client is authorized successfully. The code is then exchanged for access and refresh tokens via the `/exchange` endpoint.
|
||||
*/
|
||||
post: operations["OAuthFlowController_authorize"];
|
||||
};
|
||||
"/api/v2/oauth/{clientId}/exchange": {
|
||||
"/v2/oauth/{clientId}/exchange": {
|
||||
/**
|
||||
* Exchange authorization code for access tokens
|
||||
* @description Exchanges the authorization code received from the `/authorize` endpoint for access and refresh tokens. The authorization code should be provided in the 'Authorization' header prefixed with 'Bearer '.
|
||||
*/
|
||||
post: operations["OAuthFlowController_exchange"];
|
||||
};
|
||||
"/api/v2/oauth/{clientId}/refresh": {
|
||||
"/v2/oauth/{clientId}/refresh": {
|
||||
post: operations["OAuthFlowController_refreshAccessToken"];
|
||||
};
|
||||
"/api/v2/event-types": {
|
||||
"/v2/event-types": {
|
||||
get: operations["EventTypesController_getEventTypes"];
|
||||
post: operations["EventTypesController_createEventType"];
|
||||
};
|
||||
"/api/v2/event-types/{eventTypeId}": {
|
||||
"/v2/event-types/{eventTypeId}": {
|
||||
get: operations["EventTypesController_getEventType"];
|
||||
};
|
||||
"/api/v2/event-types/{username}/public": {
|
||||
"/v2/event-types/{username}/public": {
|
||||
get: operations["EventTypesController_getPublicEventTypes"];
|
||||
};
|
||||
"/api/v2/platform/gcal/oauth/auth-url": {
|
||||
"/v2/gcal/oauth/auth-url": {
|
||||
get: operations["GcalController_redirect"];
|
||||
};
|
||||
"/api/v2/platform/gcal/oauth/save": {
|
||||
"/v2/gcal/oauth/save": {
|
||||
get: operations["GcalController_save"];
|
||||
};
|
||||
"/api/v2/platform/gcal/check": {
|
||||
"/v2/gcal/check": {
|
||||
get: operations["GcalController_check"];
|
||||
};
|
||||
"/api/v2/platform/provider/{clientId}": {
|
||||
"/v2/provider/{clientId}": {
|
||||
get: operations["CalProviderController_verifyClientId"];
|
||||
};
|
||||
"/api/v2/platform/provider/{clientId}/access-token": {
|
||||
"/v2/provider/{clientId}/access-token": {
|
||||
get: operations["CalProviderController_verifyAccessToken"];
|
||||
};
|
||||
"/api/v2/schedules": {
|
||||
"/v2/schedules": {
|
||||
get: operations["SchedulesController_getSchedules"];
|
||||
post: operations["SchedulesController_createSchedule"];
|
||||
};
|
||||
"/api/v2/schedules/default": {
|
||||
"/v2/schedules/default": {
|
||||
get: operations["SchedulesController_getDefaultSchedule"];
|
||||
};
|
||||
"/api/v2/schedules/time-zones": {
|
||||
"/v2/schedules/time-zones": {
|
||||
get: operations["SchedulesController_getTimeZones"];
|
||||
};
|
||||
"/api/v2/schedules/{scheduleId}": {
|
||||
"/v2/schedules/{scheduleId}": {
|
||||
get: operations["SchedulesController_getSchedule"];
|
||||
delete: operations["SchedulesController_deleteSchedule"];
|
||||
patch: operations["SchedulesController_updateSchedule"];
|
||||
};
|
||||
"/api/v2/me": {
|
||||
"/v2/me": {
|
||||
get: operations["MeController_getMe"];
|
||||
patch: operations["MeController_updateMe"];
|
||||
};
|
||||
"/api/v2/ee/calendars/busy-times": {
|
||||
"/v2/calendars/busy-times": {
|
||||
get: operations["CalendarsController_getBusyTimes"];
|
||||
};
|
||||
"/api/v2/ee/calendars": {
|
||||
"/v2/calendars": {
|
||||
get: operations["CalendarsController_getCalendars"];
|
||||
};
|
||||
"/api/v2/ee/bookings": {
|
||||
"/v2/bookings": {
|
||||
post: operations["BookingsController_createBooking"];
|
||||
};
|
||||
"/api/v2/ee/bookings/reccuring": {
|
||||
"/v2/bookings/reccuring": {
|
||||
post: operations["BookingsController_createReccuringBooking"];
|
||||
};
|
||||
"/api/v2/ee/bookings/instant": {
|
||||
"/v2/bookings/instant": {
|
||||
post: operations["BookingsController_createInstantBooking"];
|
||||
};
|
||||
"/api/v2/slots/reserve": {
|
||||
"/v2/slots/reserve": {
|
||||
post: operations["SlotsController_reserveSlot"];
|
||||
};
|
||||
"/api/v2/slots/selected-slot": {
|
||||
"/v2/slots/selected-slot": {
|
||||
delete: operations["SlotsController_deleteSelectedSlot"];
|
||||
};
|
||||
"/api/v2/slots/available": {
|
||||
"/v2/slots/available": {
|
||||
get: operations["SlotsController_getAvailableSlots"];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user