Skip to content

Commit 88193c4

Browse files
committed
Remove versioning
1 parent e293fc1 commit 88193c4

5 files changed

Lines changed: 5 additions & 71 deletions

File tree

apps/api/v2/src/lib/api-versions.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,17 @@ import {
77
VERSION_2024_06_14,
88
VERSION_2024_08_13,
99
VERSION_2024_09_04,
10-
VERSION_2025_07_11,
1110
} from "@calcom/platform-constants";
1211

13-
export const API_VERSIONS_VALUES = [...API_VERSIONS];
12+
export const API_VERSIONS_VALUES: VersionValue = API_VERSIONS as unknown as VersionValue;
1413
export const VERSION_2024_06_14_VALUE: VersionValue = VERSION_2024_06_14 as unknown as VersionValue;
1514
export const VERSION_2024_06_11_VALUE: VersionValue = VERSION_2024_06_11 as unknown as VersionValue;
1615
export const VERSION_2024_04_15_VALUE: VersionValue = VERSION_2024_04_15 as unknown as VersionValue;
1716
export const VERSION_2024_08_13_VALUE: VersionValue = VERSION_2024_08_13 as unknown as VersionValue;
1817
export const VERSION_2024_09_04_VALUE: VersionValue = VERSION_2024_09_04 as unknown as VersionValue;
19-
export const VERSION_2025_07_11_VALUE: VersionValue = VERSION_2025_07_11 as unknown as VersionValue;
20-
/**
21-
* Even when no version header is provided, we default to this version.
22-
*/
23-
export const DEFAULT_API_VERSION: VersionValue = VERSION_2024_04_15 as unknown as VersionValue;
2418

2519
export { VERSION_2024_04_15 };
2620
export { VERSION_2024_06_11 };
2721
export { VERSION_2024_06_14 };
2822
export { VERSION_2024_08_13 };
2923
export { VERSION_2024_09_04 };
30-
export { VERSION_2025_07_11 };

apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.e2e-spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,14 +698,13 @@ describe("OrganizationsRoutingFormsResponsesController", () => {
698698
});
699699
});
700700

701-
describe(`POST /v2/organizations/:orgId/routing-forms/:routingFormId/responses (2025-07-11 version)`, () => {
701+
describe(`POST /v2/organizations/:orgId/routing-forms/:routingFormId/responses - restrictions check`, () => {
702702
// Helper functions to centralize API version header setting
703703
const createAuthenticatedRequest = (method: "get" | "post" | "patch", url: string, apiKey: string) => {
704704
return request(app.getHttpServer())
705705
[method](url)
706706
.set({
707707
Authorization: `Bearer cal_test_${apiKey}`,
708-
"cal-api-version": VERSION_2025_07_11,
709708
});
710709
};
711710

apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { API_VERSIONS_VALUES } from "@/lib/api-versions";
2-
import { VERSION_2025_07_11 } from "@/lib/api-versions";
32
import { API_KEY_HEADER } from "@/lib/docs/headers";
43
import { PlatformPlan } from "@/modules/auth/decorators/billing/platform-plan.decorator";
54
import { Roles } from "@/modules/auth/decorators/roles/roles.decorator";
@@ -36,9 +35,6 @@ import { UpdateRoutingFormResponseInput } from "../inputs/update-routing-form-re
3635
import { CreateRoutingFormResponseOutput } from "../outputs/create-routing-form-response.output";
3736
import { UpdateRoutingFormResponseOutput } from "../outputs/update-routing-form-response.output";
3837

39-
// We allow all but 2025-07-11 version in here because users might be using with any cal-api-version header, and we don't want to break it for them
40-
const UNVERSIONED = API_VERSIONS_VALUES.filter((v) => v !== VERSION_2025_07_11);
41-
4238
@Controller({
4339
path: "/v2/organizations/:orgId/routing-forms/:routingFormId/responses",
4440
version: API_VERSIONS_VALUES,
@@ -79,45 +75,11 @@ export class OrganizationsRoutingFormsResponsesController {
7975
}
8076

8177
@Post("/")
82-
@Version(UNVERSIONED)
83-
@ApiOperation({ summary: "Create routing form response and get available slots" })
84-
@Roles("ORG_ADMIN")
85-
@UseGuards(RolesGuard)
86-
@PlatformPlan("ESSENTIALS")
87-
async createRoutingFormResponse(
88-
@Param("orgId", ParseIntPipe) orgId: number,
89-
@Param("routingFormId") routingFormId: string,
90-
@Query() query: CreateRoutingFormResponseInput,
91-
@Req() request: Request
92-
): Promise<CreateRoutingFormResponseOutput> {
93-
const result = await this.organizationsRoutingFormsResponsesService.createRoutingFormResponseWithSlots(
94-
routingFormId,
95-
query,
96-
request
97-
);
98-
99-
return {
100-
status: SUCCESS_STATUS,
101-
data: result,
102-
};
103-
}
104-
105-
@Post("/")
106-
@ApiHeader({
107-
name: "cal-api-version",
108-
description: `Must be set to ${VERSION_2025_07_11}`,
109-
example: VERSION_2025_07_11,
110-
required: true,
111-
schema: {
112-
default: VERSION_2025_07_11,
113-
},
114-
})
115-
@Version(VERSION_2025_07_11)
11678
@ApiOperation({ summary: "Create routing form response and get available slots" })
11779
@Roles("ORG_ADMIN")
11880
@UseGuards(Or([RolesGuard, IsUserRoutingForm]))
11981
@PlatformPlan("ESSENTIALS")
120-
async createRoutingFormResponseV2025_07_11(
82+
async createRoutingFormResponse(
12183
@Param("orgId", ParseIntPipe) orgId: number,
12284
@Param("routingFormId") routingFormId: string,
12385
@Query() query: CreateRoutingFormResponseInput,

apps/api/v2/swagger/documentation.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,7 +2544,7 @@
25442544
]
25452545
},
25462546
"post": {
2547-
"operationId": "OrganizationsRoutingFormsResponsesController_createRoutingFormResponseV2025_07_11",
2547+
"operationId": "OrganizationsRoutingFormsResponsesController_createRoutingFormResponse",
25482548
"summary": "Create routing form response and get available slots",
25492549
"parameters": [
25502550
{
@@ -2645,16 +2645,6 @@
26452645
"schema": {
26462646
"type": "boolean"
26472647
}
2648-
},
2649-
{
2650-
"name": "cal-api-version",
2651-
"in": "header",
2652-
"description": "Must be set to 2025-07-11",
2653-
"required": true,
2654-
"schema": {
2655-
"type": "string",
2656-
"default": "2025-07-11"
2657-
}
26582648
}
26592649
],
26602650
"responses": {

docs/api-reference/v2/openapi.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,7 +2544,7 @@
25442544
]
25452545
},
25462546
"post": {
2547-
"operationId": "OrganizationsRoutingFormsResponsesController_createRoutingFormResponseV2025_07_11",
2547+
"operationId": "OrganizationsRoutingFormsResponsesController_createRoutingFormResponse",
25482548
"summary": "Create routing form response and get available slots",
25492549
"parameters": [
25502550
{
@@ -2645,16 +2645,6 @@
26452645
"schema": {
26462646
"type": "boolean"
26472647
}
2648-
},
2649-
{
2650-
"name": "cal-api-version",
2651-
"in": "header",
2652-
"description": "Must be set to 2025-07-11",
2653-
"required": true,
2654-
"schema": {
2655-
"type": "string",
2656-
"default": "2025-07-11"
2657-
}
26582648
}
26592649
],
26602650
"responses": {

0 commit comments

Comments
 (0)