From ffba83c7270a373225ec39caf71eecc6c8a35330 Mon Sep 17 00:00:00 2001 From: Suhail Kakar Date: Tue, 30 Apr 2024 20:37:20 +0530 Subject: [PATCH] add webhook request body --- packages/api/src/schema/api-schema.yaml | 26 +++++++++++++++++++++++++ packages/api/src/schema/db-schema.yaml | 14 ------------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/packages/api/src/schema/api-schema.yaml b/packages/api/src/schema/api-schema.yaml index f380bc5f0e..e5878f9e00 100644 --- a/packages/api/src/schema/api-schema.yaml +++ b/packages/api/src/schema/api-schema.yaml @@ -162,6 +162,20 @@ components: - VP8 - VP9 example: H.264 + webhook-payload: + type: object + additionalProperties: false + properties: + name: + $ref: "#/components/schemas/webhook/properties/name" + url: + $ref: "#/components/schemas/webhook/properties/url" + events: + $ref: "#/components/schemas/webhook/properties/events" + sharedSecret: + $ref: "#/components/schemas/webhook/properties/sharedSecret" + streamId: + $ref: "#/components/schemas/webhook/properties/streamId" webhook: type: object required: @@ -3054,6 +3068,12 @@ paths: To create a new webhook, you need to make an API call with the events you want to listen for and the URL that will be called when those events occur. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/webhook-payload" responses: "200": description: Success @@ -3107,6 +3127,12 @@ paths: operationId: updateWebhook tags: - webhook + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/webhook-payload" responses: "200": description: Success diff --git a/packages/api/src/schema/db-schema.yaml b/packages/api/src/schema/db-schema.yaml index 2a41c01b17..2ac81d420f 100644 --- a/packages/api/src/schema/db-schema.yaml +++ b/packages/api/src/schema/db-schema.yaml @@ -1066,20 +1066,6 @@ components: type: number description: Timestamp (in milliseconds) at which the stream started. example: 1587667174725 - webhook-patch-payload: - type: object - additionalProperties: false - properties: - name: - $ref: "#/components/schemas/webhook/properties/name" - url: - $ref: "#/components/schemas/webhook/properties/url" - events: - $ref: "#/components/schemas/webhook/properties/events" - sharedSecret: - $ref: "#/components/schemas/webhook/properties/sharedSecret" - streamId: - $ref: "#/components/schemas/webhook/properties/streamId" ipfs-file-info: properties: cid: