feat: Platform OAuthClient Webhooks (#16134)

* wip

* fixup! Merge branch 'main' into platform-oauth-client-webhooks

* wip

* fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! Merge branch 'platform-oauth-client-webhooks' of github.com:calcom/cal.com into platform-oauth-client-webhooks

* fixup! fixup! Merge branch 'platform-oauth-client-webhooks' of github.com:calcom/cal.com into platform-oauth-client-webhooks

---------

Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
MorganandPeer Richelsen authored and GitHub committed 2024-08-09 17:02:39 +02:00
1 parent 4def31e98f
commit dda4b17a7c
47 files changed
+1199 -68

No files matched your search

+288
View File
@@ -3624,6 +3624,206 @@
"Users' EventTypes Webhooks"
]
}
},
"/v2/oauth-clients/{clientId}/webhooks": {
"post": {
"operationId": "OAuthClientWebhooksController_createOAuthClientWebhook",
"summary": "Create a webhook for an oAuthClient",
"parameters": [
{
"name": "clientId",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateWebhookInputDto"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OAuthClientWebhookOutputResponseDto"
}
}
}
}
},
"tags": [
"OAuthClients Webhooks"
]
},
"get": {
"operationId": "OAuthClientWebhooksController_getOAuthClientWebhooks",
"summary": "Get all webhooks of an oAuthClient",
"parameters": [
{
"name": "clientId",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
},
{
"name": "take",
"required": false,
"in": "query",
"description": "The number of items to return",
"example": 10,
"schema": {
"type": "number"
}
},
{
"name": "skip",
"required": false,
"in": "query",
"description": "The number of items to skip",
"example": 0,
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OAuthClientWebhooksOutputResponseDto"
}
}
}
}
},
"tags": [
"OAuthClients Webhooks"
]
},
"delete": {
"operationId": "OAuthClientWebhooksController_deleteAllOAuthClientWebhooks",
"summary": "Delete all webhooks of an oAuthClient",
"parameters": [
{
"name": "clientId",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteManyWebhooksOutputResponseDto"
}
}
}
}
},
"tags": [
"OAuthClients Webhooks"
]
}
},
"/v2/oauth-clients/{clientId}/webhooks/{webhookId}": {
"patch": {
"operationId": "OAuthClientWebhooksController_updateOAuthClientWebhook",
"summary": "Update a webhook of an oAuthClient",
"parameters": [
{
"name": "webhookId",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateWebhookInputDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OAuthClientWebhookOutputResponseDto"
}
}
}
}
},
"tags": [
"OAuthClients Webhooks"
]
},
"get": {
"operationId": "OAuthClientWebhooksController_getOAuthClientWebhook",
"summary": "Get a webhook of an oAuthClient",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OAuthClientWebhookOutputResponseDto"
}
}
}
}
},
"tags": [
"OAuthClients Webhooks"
]
},
"delete": {
"operationId": "OAuthClientWebhooksController_deleteOAuthClientWebhook",
"summary": "Delete a webhook of an oAuthClient",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OAuthClientWebhookOutputResponseDto"
}
}
}
}
},
"tags": [
"OAuthClients Webhooks"
]
}
}
},
"info": {
@@ -8864,6 +9064,9 @@
},
"active": {
"type": "boolean"
},
"secret": {
"type": "string"
}
},
"required": [
@@ -8991,6 +9194,9 @@
},
"active": {
"type": "boolean"
},
"secret": {
"type": "string"
}
},
"required": [
@@ -9064,6 +9270,88 @@
"status",
"data"
]
},
"OAuthClientWebhookOutputDto": {
"type": "object",
"properties": {
"payloadTemplate": {
"type": "string",
"description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information",
"example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}"
},
"oAuthClientId": {
"type": "string"
},
"id": {
"type": "number"
},
"triggers": {
"type": "array",
"items": {
"type": "object"
}
},
"subscriberUrl": {
"type": "string"
},
"active": {
"type": "boolean"
},
"secret": {
"type": "string"
}
},
"required": [
"payloadTemplate",
"oAuthClientId",
"id",
"triggers",
"subscriberUrl",
"active"
]
},
"OAuthClientWebhookOutputResponseDto": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success",
"enum": [
"success",
"error"
]
},
"data": {
"$ref": "#/components/schemas/OAuthClientWebhookOutputDto"
}
},
"required": [
"status",
"data"
]
},
"OAuthClientWebhooksOutputResponseDto": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success",
"enum": [
"success",
"error"
]
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OAuthClientWebhookOutputDto"
}
}
},
"required": [
"status",
"data"
]
}
}
}