feat: api v2 event types ordering - user, team, org (#25177)
* feat: api-v2-event-types-ordering * sort team and org event types * revert: remove accidental changes to api-auth.strategy.ts * docs: add ordering documentation and test for event types endpoints - Added test assertion to verify event types are returned in descending order by ID (newest first) - Added API documentation to user event types endpoint describing default ordering behavior - Added API documentation to team event types endpoint describing default ordering behavior - Added API documentation to organization event types endpoints describing default ordering behavior Addresses PR feedback to document and test the ordering behavior introduced in the API v2 event types ordering feature. * feat: add optional sortCreatedAt parameter to event types endpoints - Add sortCreatedAt query parameter (SortOrderType: "asc" | "desc") to all event types endpoints - Define SortOrder enum and SortOrderType in pagination.input.ts for reusability - When not provided, no explicit ordering is applied (backward compatible) - Update user, team, and organization event types endpoints - Add comprehensive e2e tests for all sorting scenarios - Fix circular dependency in platform-types import - Thread sortCreatedAt through all service layers - Use spread pattern for conditional orderBy to avoid empty array issues Addresses PR feedback to make ordering opt-in rather than changing default behavior
This commit is contained in:
@@ -4470,6 +4470,7 @@
|
||||
"get": {
|
||||
"operationId": "OrganizationsEventTypesController_getTeamEventTypes",
|
||||
"summary": "Get team event types",
|
||||
"description": "Use the optional `sortCreatedAt` query parameter to order results by creation date (by ID). Accepts \"asc\" (oldest first) or \"desc\" (newest first). When not provided, no explicit ordering is applied.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
@@ -4523,6 +4524,16 @@
|
||||
"schema": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "sortCreatedAt",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"description": "Sort event types by creation date. When not provided, no explicit ordering is applied.",
|
||||
"schema": {
|
||||
"enum": ["asc", "desc"],
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -4816,6 +4827,7 @@
|
||||
"get": {
|
||||
"operationId": "OrganizationsEventTypesController_getTeamsEventTypes",
|
||||
"summary": "Get all team event types",
|
||||
"description": "Use the optional `sortCreatedAt` query parameter to order results by creation date (by ID). Accepts \"asc\" (oldest first) or \"desc\" (newest first). When not provided, no explicit ordering is applied.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
@@ -4876,6 +4888,16 @@
|
||||
"default": 0,
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "sortCreatedAt",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"description": "Sort event types by creation date. When not provided, no explicit ordering is applied.",
|
||||
"schema": {
|
||||
"enum": ["asc", "desc"],
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -11552,7 +11574,7 @@
|
||||
"get": {
|
||||
"operationId": "EventTypesController_2024_06_14_getEventTypes",
|
||||
"summary": "Get all event types",
|
||||
"description": "Hidden event types are returned only if authentication is provided and it belongs to the event type owner.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
|
||||
"description": "Hidden event types are returned only if authentication is provided and it belongs to the event type owner.\n \n Use the optional `sortCreatedAt` query parameter to order results by creation date (by ID). Accepts \"asc\" (oldest first) or \"desc\" (newest first). When not provided, no explicit ordering is applied.\n \n <Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>\n ",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "cal-api-version",
|
||||
@@ -11609,6 +11631,16 @@
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "sortCreatedAt",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"description": "Sort event types by creation date. When not provided, no explicit ordering is applied.",
|
||||
"schema": {
|
||||
"enum": ["asc", "desc"],
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
@@ -14420,6 +14452,7 @@
|
||||
"get": {
|
||||
"operationId": "TeamsEventTypesController_getTeamEventTypes",
|
||||
"summary": "Get a team event type",
|
||||
"description": "Use the optional `sortCreatedAt` query parameter to order results by creation date (by ID). Accepts \"asc\" (oldest first) or \"desc\" (newest first). When not provided, no explicit ordering is applied.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "teamId",
|
||||
@@ -14446,6 +14479,16 @@
|
||||
"schema": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "sortCreatedAt",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"description": "Sort event types by creation date. When not provided, no explicit ordering is applied.",
|
||||
"schema": {
|
||||
"enum": ["asc", "desc"],
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -27467,6 +27510,14 @@
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"avatarUrl": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"bio": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"timeFormat": {
|
||||
"type": "number"
|
||||
},
|
||||
@@ -27493,6 +27544,8 @@
|
||||
"username",
|
||||
"email",
|
||||
"name",
|
||||
"avatarUrl",
|
||||
"bio",
|
||||
"timeFormat",
|
||||
"defaultScheduleId",
|
||||
"weekStart",
|
||||
|
||||
Reference in New Issue
Block a user