Files
calendar/packages/platform/constants/api.ts
T
0072aba55d refactor: v2 event-types (#15457)
* refactor: UserAvatarGroupWithOrg.tsx remove unecessary profile prop

* chore: define event-type types in platform/types

* feat: event-type transformes in lib and re-exported through platform-libraries

* chore: define user types in platform/types

* chore: add users endpoint to platform-constants

* refactor: app-store use narrowed down booker event type

* chore: version old event-types module

* fix: old event-types e2e test

* fix: libraries add missing export

* fix: reset libraries version to 0

* feat: new event-types module and users endpoints

* feat: make booker atom work with v2 event-types

* updating event type

* refactor: remove guard for get event-types

* refactor: move private hook to public

* Revert "refactor: remove guard for get event-types"

This reverts commit d41204069f1d5bb1305b388ce53399f9175f4249.

* Revert "refactor: move private hook to public"

This reverts commit 09322e8fba102e57104959f79ed6bfa9a677dc9d.

* refactor: get by username and slug in /event-types

* remove console log

* feat: locations handle displayEventPublicly

* test e2e event-types

* revert: user output from types

* refactor: event-types hooks have private and public folders

* refactor: require event-type.slug in input

* refactor: demand that all labels of booking fields are unique

* refactor: remove unused import

* refactor: only have email and name by default in booker

* refactor: add booking field slug

* fix: display event-type location publicly / hide it in booker

* fix: display event-type location publicly / hide it in booker

* fix: packages/lib tests

* fix: typescript in e2e test

* fix: dynamic event types input

* refactor: use IsIn instead of IsEnum

* refactor: simplify getEventTypes

* fix: use ApiAuthGuard instead of AccessTokenGuard

* chore: export more stuff from libraries

* refactor: SchedulingTypeEnum and Type

---------

Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
2024-06-21 10:49:12 +00:00

63 lines
1.9 KiB
TypeScript

export const BASE_URL = "http://localhost:5555";
export const V2_ENDPOINTS = {
me: "me",
availability: "schedules",
eventTypes: "event-types",
bookings: "bookings",
};
export const SUCCESS_STATUS = "success";
export const ERROR_STATUS = "error";
export const REDIRECT_STATUS = "redirect";
// Client Errors (4xx)
export const BAD_REQUEST = "BAD_REQUEST";
export const UNAUTHORIZED = "UNAUTHORIZED";
export const FORBIDDEN = "FORBIDDEN";
export const NOT_FOUND = "NOT_FOUND";
export const METHOD_NOT_ALLOWED = "METHOD_NOT_ALLOWED";
export const UNPROCESSABLE_ENTITY = "UNPROCESSABLE_ENTITY";
export const ACCESS_TOKEN_EXPIRED = "ACCESS_TOKEN_IS_EXPIRED";
export const INVALID_ACCESS_TOKEN = "Invalid Access Token.";
// Server Errors (5xx)
export const INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR";
// Custom Errors
export const INVALID_PARAMETER = "INVALID_PARAMETER";
export const MISSING_PARAMETER = "MISSING_PARAMETER";
export const INVALID_API_KEY = "INVALID_API_KEY";
export const RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND";
export const DUPLICATE_RESOURCE = "DUPLICATE_RESOURCE";
export const API_ERROR_CODES = [
BAD_REQUEST,
UNAUTHORIZED,
FORBIDDEN,
NOT_FOUND,
METHOD_NOT_ALLOWED,
UNPROCESSABLE_ENTITY,
INTERNAL_SERVER_ERROR,
INVALID_PARAMETER,
MISSING_PARAMETER,
INVALID_API_KEY,
RESOURCE_NOT_FOUND,
DUPLICATE_RESOURCE,
] as const;
// Request headers
export const X_CAL_SECRET_KEY = "x-cal-secret-key";
export const X_CAL_CLIENT_ID = "x-cal-client-id";
// HTTP status codes
export const HTTP_CODE_TOKEN_EXPIRED = 498;
export const VERSION_2024_06_14 = "2024-06-14";
export const VERSION_2024_06_11 = "2024-06-11";
export const VERSION_2024_04_15 = "2024-04-15";
export const API_VERSIONS = [VERSION_2024_06_14, VERSION_2024_06_11, VERSION_2024_04_15] as const;
export type API_VERSIONS_ENUM = (typeof API_VERSIONS)[number];
export type API_VERSIONS_TYPE = typeof API_VERSIONS;
export const CAL_API_VERSION_HEADER = "cal-api-version";